diff --git a/features/landing/frontend-standalone/.vite-cache/deps/chunk-7Y3UKPDW.js.map b/features/landing/frontend-standalone/.vite-cache/deps/chunk-7Y3UKPDW.js.map deleted file mode 100644 index afde784cf..000000000 --- a/features/landing/frontend-standalone/.vite-cache/deps/chunk-7Y3UKPDW.js.map +++ /dev/null @@ -1,7 +0,0 @@ -{ - "version": 3, - "sources": ["../../../../../../node_modules/.bun/react@19.2.4/node_modules/react/cjs/react.development.js", "../../../../../../node_modules/.bun/react@19.2.4/node_modules/react/index.js"], - "sourcesContent": ["/**\n * @license React\n * react.development.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\n\"production\" !== process.env.NODE_ENV &&\n (function () {\n function defineDeprecationWarning(methodName, info) {\n Object.defineProperty(Component.prototype, methodName, {\n get: function () {\n console.warn(\n \"%s(...) is deprecated in plain JavaScript React classes. %s\",\n info[0],\n info[1]\n );\n }\n });\n }\n function getIteratorFn(maybeIterable) {\n if (null === maybeIterable || \"object\" !== typeof maybeIterable)\n return null;\n maybeIterable =\n (MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL]) ||\n maybeIterable[\"@@iterator\"];\n return \"function\" === typeof maybeIterable ? maybeIterable : null;\n }\n function warnNoop(publicInstance, callerName) {\n publicInstance =\n ((publicInstance = publicInstance.constructor) &&\n (publicInstance.displayName || publicInstance.name)) ||\n \"ReactClass\";\n var warningKey = publicInstance + \".\" + callerName;\n didWarnStateUpdateForUnmountedComponent[warningKey] ||\n (console.error(\n \"Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.\",\n callerName,\n publicInstance\n ),\n (didWarnStateUpdateForUnmountedComponent[warningKey] = !0));\n }\n function Component(props, context, updater) {\n this.props = props;\n this.context = context;\n this.refs = emptyObject;\n this.updater = updater || ReactNoopUpdateQueue;\n }\n function ComponentDummy() {}\n function PureComponent(props, context, updater) {\n this.props = props;\n this.context = context;\n this.refs = emptyObject;\n this.updater = updater || ReactNoopUpdateQueue;\n }\n function noop() {}\n function testStringCoercion(value) {\n return \"\" + value;\n }\n function checkKeyStringCoercion(value) {\n try {\n testStringCoercion(value);\n var JSCompiler_inline_result = !1;\n } catch (e) {\n JSCompiler_inline_result = !0;\n }\n if (JSCompiler_inline_result) {\n JSCompiler_inline_result = console;\n var JSCompiler_temp_const = JSCompiler_inline_result.error;\n var JSCompiler_inline_result$jscomp$0 =\n (\"function\" === typeof Symbol &&\n Symbol.toStringTag &&\n value[Symbol.toStringTag]) ||\n value.constructor.name ||\n \"Object\";\n JSCompiler_temp_const.call(\n JSCompiler_inline_result,\n \"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.\",\n JSCompiler_inline_result$jscomp$0\n );\n return testStringCoercion(value);\n }\n }\n function getComponentNameFromType(type) {\n if (null == type) return null;\n if (\"function\" === typeof type)\n return type.$$typeof === REACT_CLIENT_REFERENCE\n ? null\n : type.displayName || type.name || null;\n if (\"string\" === typeof type) return type;\n switch (type) {\n case REACT_FRAGMENT_TYPE:\n return \"Fragment\";\n case REACT_PROFILER_TYPE:\n return \"Profiler\";\n case REACT_STRICT_MODE_TYPE:\n return \"StrictMode\";\n case REACT_SUSPENSE_TYPE:\n return \"Suspense\";\n case REACT_SUSPENSE_LIST_TYPE:\n return \"SuspenseList\";\n case REACT_ACTIVITY_TYPE:\n return \"Activity\";\n }\n if (\"object\" === typeof type)\n switch (\n (\"number\" === typeof type.tag &&\n console.error(\n \"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue.\"\n ),\n type.$$typeof)\n ) {\n case REACT_PORTAL_TYPE:\n return \"Portal\";\n case REACT_CONTEXT_TYPE:\n return type.displayName || \"Context\";\n case REACT_CONSUMER_TYPE:\n return (type._context.displayName || \"Context\") + \".Consumer\";\n case REACT_FORWARD_REF_TYPE:\n var innerType = type.render;\n type = type.displayName;\n type ||\n ((type = innerType.displayName || innerType.name || \"\"),\n (type = \"\" !== type ? \"ForwardRef(\" + type + \")\" : \"ForwardRef\"));\n return type;\n case REACT_MEMO_TYPE:\n return (\n (innerType = type.displayName || null),\n null !== innerType\n ? innerType\n : getComponentNameFromType(type.type) || \"Memo\"\n );\n case REACT_LAZY_TYPE:\n innerType = type._payload;\n type = type._init;\n try {\n return getComponentNameFromType(type(innerType));\n } catch (x) {}\n }\n return null;\n }\n function getTaskName(type) {\n if (type === REACT_FRAGMENT_TYPE) return \"<>\";\n if (\n \"object\" === typeof type &&\n null !== type &&\n type.$$typeof === REACT_LAZY_TYPE\n )\n return \"<...>\";\n try {\n var name = getComponentNameFromType(type);\n return name ? \"<\" + name + \">\" : \"<...>\";\n } catch (x) {\n return \"<...>\";\n }\n }\n function getOwner() {\n var dispatcher = ReactSharedInternals.A;\n return null === dispatcher ? null : dispatcher.getOwner();\n }\n function UnknownOwner() {\n return Error(\"react-stack-top-frame\");\n }\n function hasValidKey(config) {\n if (hasOwnProperty.call(config, \"key\")) {\n var getter = Object.getOwnPropertyDescriptor(config, \"key\").get;\n if (getter && getter.isReactWarning) return !1;\n }\n return void 0 !== config.key;\n }\n function defineKeyPropWarningGetter(props, displayName) {\n function warnAboutAccessingKey() {\n specialPropKeyWarningShown ||\n ((specialPropKeyWarningShown = !0),\n console.error(\n \"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)\",\n displayName\n ));\n }\n warnAboutAccessingKey.isReactWarning = !0;\n Object.defineProperty(props, \"key\", {\n get: warnAboutAccessingKey,\n configurable: !0\n });\n }\n function elementRefGetterWithDeprecationWarning() {\n var componentName = getComponentNameFromType(this.type);\n didWarnAboutElementRef[componentName] ||\n ((didWarnAboutElementRef[componentName] = !0),\n console.error(\n \"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.\"\n ));\n componentName = this.props.ref;\n return void 0 !== componentName ? componentName : null;\n }\n function ReactElement(type, key, props, owner, debugStack, debugTask) {\n var refProp = props.ref;\n type = {\n $$typeof: REACT_ELEMENT_TYPE,\n type: type,\n key: key,\n props: props,\n _owner: owner\n };\n null !== (void 0 !== refProp ? refProp : null)\n ? Object.defineProperty(type, \"ref\", {\n enumerable: !1,\n get: elementRefGetterWithDeprecationWarning\n })\n : Object.defineProperty(type, \"ref\", { enumerable: !1, value: null });\n type._store = {};\n Object.defineProperty(type._store, \"validated\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: 0\n });\n Object.defineProperty(type, \"_debugInfo\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: null\n });\n Object.defineProperty(type, \"_debugStack\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: debugStack\n });\n Object.defineProperty(type, \"_debugTask\", {\n configurable: !1,\n enumerable: !1,\n writable: !0,\n value: debugTask\n });\n Object.freeze && (Object.freeze(type.props), Object.freeze(type));\n return type;\n }\n function cloneAndReplaceKey(oldElement, newKey) {\n newKey = ReactElement(\n oldElement.type,\n newKey,\n oldElement.props,\n oldElement._owner,\n oldElement._debugStack,\n oldElement._debugTask\n );\n oldElement._store &&\n (newKey._store.validated = oldElement._store.validated);\n return newKey;\n }\n function validateChildKeys(node) {\n isValidElement(node)\n ? node._store && (node._store.validated = 1)\n : \"object\" === typeof node &&\n null !== node &&\n node.$$typeof === REACT_LAZY_TYPE &&\n (\"fulfilled\" === node._payload.status\n ? isValidElement(node._payload.value) &&\n node._payload.value._store &&\n (node._payload.value._store.validated = 1)\n : node._store && (node._store.validated = 1));\n }\n function isValidElement(object) {\n return (\n \"object\" === typeof object &&\n null !== object &&\n object.$$typeof === REACT_ELEMENT_TYPE\n );\n }\n function escape(key) {\n var escaperLookup = { \"=\": \"=0\", \":\": \"=2\" };\n return (\n \"$\" +\n key.replace(/[=:]/g, function (match) {\n return escaperLookup[match];\n })\n );\n }\n function getElementKey(element, index) {\n return \"object\" === typeof element &&\n null !== element &&\n null != element.key\n ? (checkKeyStringCoercion(element.key), escape(\"\" + element.key))\n : index.toString(36);\n }\n function resolveThenable(thenable) {\n switch (thenable.status) {\n case \"fulfilled\":\n return thenable.value;\n case \"rejected\":\n throw thenable.reason;\n default:\n switch (\n (\"string\" === typeof thenable.status\n ? thenable.then(noop, noop)\n : ((thenable.status = \"pending\"),\n thenable.then(\n function (fulfilledValue) {\n \"pending\" === thenable.status &&\n ((thenable.status = \"fulfilled\"),\n (thenable.value = fulfilledValue));\n },\n function (error) {\n \"pending\" === thenable.status &&\n ((thenable.status = \"rejected\"),\n (thenable.reason = error));\n }\n )),\n thenable.status)\n ) {\n case \"fulfilled\":\n return thenable.value;\n case \"rejected\":\n throw thenable.reason;\n }\n }\n throw thenable;\n }\n function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {\n var type = typeof children;\n if (\"undefined\" === type || \"boolean\" === type) children = null;\n var invokeCallback = !1;\n if (null === children) invokeCallback = !0;\n else\n switch (type) {\n case \"bigint\":\n case \"string\":\n case \"number\":\n invokeCallback = !0;\n break;\n case \"object\":\n switch (children.$$typeof) {\n case REACT_ELEMENT_TYPE:\n case REACT_PORTAL_TYPE:\n invokeCallback = !0;\n break;\n case REACT_LAZY_TYPE:\n return (\n (invokeCallback = children._init),\n mapIntoArray(\n invokeCallback(children._payload),\n array,\n escapedPrefix,\n nameSoFar,\n callback\n )\n );\n }\n }\n if (invokeCallback) {\n invokeCallback = children;\n callback = callback(invokeCallback);\n var childKey =\n \"\" === nameSoFar ? \".\" + getElementKey(invokeCallback, 0) : nameSoFar;\n isArrayImpl(callback)\n ? ((escapedPrefix = \"\"),\n null != childKey &&\n (escapedPrefix =\n childKey.replace(userProvidedKeyEscapeRegex, \"$&/\") + \"/\"),\n mapIntoArray(callback, array, escapedPrefix, \"\", function (c) {\n return c;\n }))\n : null != callback &&\n (isValidElement(callback) &&\n (null != callback.key &&\n ((invokeCallback && invokeCallback.key === callback.key) ||\n checkKeyStringCoercion(callback.key)),\n (escapedPrefix = cloneAndReplaceKey(\n callback,\n escapedPrefix +\n (null == callback.key ||\n (invokeCallback && invokeCallback.key === callback.key)\n ? \"\"\n : (\"\" + callback.key).replace(\n userProvidedKeyEscapeRegex,\n \"$&/\"\n ) + \"/\") +\n childKey\n )),\n \"\" !== nameSoFar &&\n null != invokeCallback &&\n isValidElement(invokeCallback) &&\n null == invokeCallback.key &&\n invokeCallback._store &&\n !invokeCallback._store.validated &&\n (escapedPrefix._store.validated = 2),\n (callback = escapedPrefix)),\n array.push(callback));\n return 1;\n }\n invokeCallback = 0;\n childKey = \"\" === nameSoFar ? \".\" : nameSoFar + \":\";\n if (isArrayImpl(children))\n for (var i = 0; i < children.length; i++)\n (nameSoFar = children[i]),\n (type = childKey + getElementKey(nameSoFar, i)),\n (invokeCallback += mapIntoArray(\n nameSoFar,\n array,\n escapedPrefix,\n type,\n callback\n ));\n else if (((i = getIteratorFn(children)), \"function\" === typeof i))\n for (\n i === children.entries &&\n (didWarnAboutMaps ||\n console.warn(\n \"Using Maps as children is not supported. Use an array of keyed ReactElements instead.\"\n ),\n (didWarnAboutMaps = !0)),\n children = i.call(children),\n i = 0;\n !(nameSoFar = children.next()).done;\n\n )\n (nameSoFar = nameSoFar.value),\n (type = childKey + getElementKey(nameSoFar, i++)),\n (invokeCallback += mapIntoArray(\n nameSoFar,\n array,\n escapedPrefix,\n type,\n callback\n ));\n else if (\"object\" === type) {\n if (\"function\" === typeof children.then)\n return mapIntoArray(\n resolveThenable(children),\n array,\n escapedPrefix,\n nameSoFar,\n callback\n );\n array = String(children);\n throw Error(\n \"Objects are not valid as a React child (found: \" +\n (\"[object Object]\" === array\n ? \"object with keys {\" + Object.keys(children).join(\", \") + \"}\"\n : array) +\n \"). If you meant to render a collection of children, use an array instead.\"\n );\n }\n return invokeCallback;\n }\n function mapChildren(children, func, context) {\n if (null == children) return children;\n var result = [],\n count = 0;\n mapIntoArray(children, result, \"\", \"\", function (child) {\n return func.call(context, child, count++);\n });\n return result;\n }\n function lazyInitializer(payload) {\n if (-1 === payload._status) {\n var ioInfo = payload._ioInfo;\n null != ioInfo && (ioInfo.start = ioInfo.end = performance.now());\n ioInfo = payload._result;\n var thenable = ioInfo();\n thenable.then(\n function (moduleObject) {\n if (0 === payload._status || -1 === payload._status) {\n payload._status = 1;\n payload._result = moduleObject;\n var _ioInfo = payload._ioInfo;\n null != _ioInfo && (_ioInfo.end = performance.now());\n void 0 === thenable.status &&\n ((thenable.status = \"fulfilled\"),\n (thenable.value = moduleObject));\n }\n },\n function (error) {\n if (0 === payload._status || -1 === payload._status) {\n payload._status = 2;\n payload._result = error;\n var _ioInfo2 = payload._ioInfo;\n null != _ioInfo2 && (_ioInfo2.end = performance.now());\n void 0 === thenable.status &&\n ((thenable.status = \"rejected\"), (thenable.reason = error));\n }\n }\n );\n ioInfo = payload._ioInfo;\n if (null != ioInfo) {\n ioInfo.value = thenable;\n var displayName = thenable.displayName;\n \"string\" === typeof displayName && (ioInfo.name = displayName);\n }\n -1 === payload._status &&\n ((payload._status = 0), (payload._result = thenable));\n }\n if (1 === payload._status)\n return (\n (ioInfo = payload._result),\n void 0 === ioInfo &&\n console.error(\n \"lazy: Expected the result of a dynamic import() call. Instead received: %s\\n\\nYour code should look like: \\n const MyComponent = lazy(() => import('./MyComponent'))\\n\\nDid you accidentally put curly braces around the import?\",\n ioInfo\n ),\n \"default\" in ioInfo ||\n console.error(\n \"lazy: Expected the result of a dynamic import() call. Instead received: %s\\n\\nYour code should look like: \\n const MyComponent = lazy(() => import('./MyComponent'))\",\n ioInfo\n ),\n ioInfo.default\n );\n throw payload._result;\n }\n function resolveDispatcher() {\n var dispatcher = ReactSharedInternals.H;\n null === dispatcher &&\n console.error(\n \"Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\\n1. You might have mismatching versions of React and the renderer (such as React DOM)\\n2. You might be breaking the Rules of Hooks\\n3. You might have more than one copy of React in the same app\\nSee https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.\"\n );\n return dispatcher;\n }\n function releaseAsyncTransition() {\n ReactSharedInternals.asyncTransitions--;\n }\n function enqueueTask(task) {\n if (null === enqueueTaskImpl)\n try {\n var requireString = (\"require\" + Math.random()).slice(0, 7);\n enqueueTaskImpl = (module && module[requireString]).call(\n module,\n \"timers\"\n ).setImmediate;\n } catch (_err) {\n enqueueTaskImpl = function (callback) {\n !1 === didWarnAboutMessageChannel &&\n ((didWarnAboutMessageChannel = !0),\n \"undefined\" === typeof MessageChannel &&\n console.error(\n \"This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning.\"\n ));\n var channel = new MessageChannel();\n channel.port1.onmessage = callback;\n channel.port2.postMessage(void 0);\n };\n }\n return enqueueTaskImpl(task);\n }\n function aggregateErrors(errors) {\n return 1 < errors.length && \"function\" === typeof AggregateError\n ? new AggregateError(errors)\n : errors[0];\n }\n function popActScope(prevActQueue, prevActScopeDepth) {\n prevActScopeDepth !== actScopeDepth - 1 &&\n console.error(\n \"You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. \"\n );\n actScopeDepth = prevActScopeDepth;\n }\n function recursivelyFlushAsyncActWork(returnValue, resolve, reject) {\n var queue = ReactSharedInternals.actQueue;\n if (null !== queue)\n if (0 !== queue.length)\n try {\n flushActQueue(queue);\n enqueueTask(function () {\n return recursivelyFlushAsyncActWork(returnValue, resolve, reject);\n });\n return;\n } catch (error) {\n ReactSharedInternals.thrownErrors.push(error);\n }\n else ReactSharedInternals.actQueue = null;\n 0 < ReactSharedInternals.thrownErrors.length\n ? ((queue = aggregateErrors(ReactSharedInternals.thrownErrors)),\n (ReactSharedInternals.thrownErrors.length = 0),\n reject(queue))\n : resolve(returnValue);\n }\n function flushActQueue(queue) {\n if (!isFlushing) {\n isFlushing = !0;\n var i = 0;\n try {\n for (; i < queue.length; i++) {\n var callback = queue[i];\n do {\n ReactSharedInternals.didUsePromise = !1;\n var continuation = callback(!1);\n if (null !== continuation) {\n if (ReactSharedInternals.didUsePromise) {\n queue[i] = callback;\n queue.splice(0, i);\n return;\n }\n callback = continuation;\n } else break;\n } while (1);\n }\n queue.length = 0;\n } catch (error) {\n queue.splice(0, i + 1), ReactSharedInternals.thrownErrors.push(error);\n } finally {\n isFlushing = !1;\n }\n }\n }\n \"undefined\" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&\n \"function\" ===\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart &&\n __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());\n var REACT_ELEMENT_TYPE = Symbol.for(\"react.transitional.element\"),\n REACT_PORTAL_TYPE = Symbol.for(\"react.portal\"),\n REACT_FRAGMENT_TYPE = Symbol.for(\"react.fragment\"),\n REACT_STRICT_MODE_TYPE = Symbol.for(\"react.strict_mode\"),\n REACT_PROFILER_TYPE = Symbol.for(\"react.profiler\"),\n REACT_CONSUMER_TYPE = Symbol.for(\"react.consumer\"),\n REACT_CONTEXT_TYPE = Symbol.for(\"react.context\"),\n REACT_FORWARD_REF_TYPE = Symbol.for(\"react.forward_ref\"),\n REACT_SUSPENSE_TYPE = Symbol.for(\"react.suspense\"),\n REACT_SUSPENSE_LIST_TYPE = Symbol.for(\"react.suspense_list\"),\n REACT_MEMO_TYPE = Symbol.for(\"react.memo\"),\n REACT_LAZY_TYPE = Symbol.for(\"react.lazy\"),\n REACT_ACTIVITY_TYPE = Symbol.for(\"react.activity\"),\n MAYBE_ITERATOR_SYMBOL = Symbol.iterator,\n didWarnStateUpdateForUnmountedComponent = {},\n ReactNoopUpdateQueue = {\n isMounted: function () {\n return !1;\n },\n enqueueForceUpdate: function (publicInstance) {\n warnNoop(publicInstance, \"forceUpdate\");\n },\n enqueueReplaceState: function (publicInstance) {\n warnNoop(publicInstance, \"replaceState\");\n },\n enqueueSetState: function (publicInstance) {\n warnNoop(publicInstance, \"setState\");\n }\n },\n assign = Object.assign,\n emptyObject = {};\n Object.freeze(emptyObject);\n Component.prototype.isReactComponent = {};\n Component.prototype.setState = function (partialState, callback) {\n if (\n \"object\" !== typeof partialState &&\n \"function\" !== typeof partialState &&\n null != partialState\n )\n throw Error(\n \"takes an object of state variables to update or a function which returns an object of state variables.\"\n );\n this.updater.enqueueSetState(this, partialState, callback, \"setState\");\n };\n Component.prototype.forceUpdate = function (callback) {\n this.updater.enqueueForceUpdate(this, callback, \"forceUpdate\");\n };\n var deprecatedAPIs = {\n isMounted: [\n \"isMounted\",\n \"Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks.\"\n ],\n replaceState: [\n \"replaceState\",\n \"Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236).\"\n ]\n };\n for (fnName in deprecatedAPIs)\n deprecatedAPIs.hasOwnProperty(fnName) &&\n defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);\n ComponentDummy.prototype = Component.prototype;\n deprecatedAPIs = PureComponent.prototype = new ComponentDummy();\n deprecatedAPIs.constructor = PureComponent;\n assign(deprecatedAPIs, Component.prototype);\n deprecatedAPIs.isPureReactComponent = !0;\n var isArrayImpl = Array.isArray,\n REACT_CLIENT_REFERENCE = Symbol.for(\"react.client.reference\"),\n ReactSharedInternals = {\n H: null,\n A: null,\n T: null,\n S: null,\n actQueue: null,\n asyncTransitions: 0,\n isBatchingLegacy: !1,\n didScheduleLegacyUpdate: !1,\n didUsePromise: !1,\n thrownErrors: [],\n getCurrentStack: null,\n recentlyCreatedOwnerStacks: 0\n },\n hasOwnProperty = Object.prototype.hasOwnProperty,\n createTask = console.createTask\n ? console.createTask\n : function () {\n return null;\n };\n deprecatedAPIs = {\n react_stack_bottom_frame: function (callStackForError) {\n return callStackForError();\n }\n };\n var specialPropKeyWarningShown, didWarnAboutOldJSXRuntime;\n var didWarnAboutElementRef = {};\n var unknownOwnerDebugStack = deprecatedAPIs.react_stack_bottom_frame.bind(\n deprecatedAPIs,\n UnknownOwner\n )();\n var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));\n var didWarnAboutMaps = !1,\n userProvidedKeyEscapeRegex = /\\/+/g,\n reportGlobalError =\n \"function\" === typeof reportError\n ? reportError\n : function (error) {\n if (\n \"object\" === typeof window &&\n \"function\" === typeof window.ErrorEvent\n ) {\n var event = new window.ErrorEvent(\"error\", {\n bubbles: !0,\n cancelable: !0,\n message:\n \"object\" === typeof error &&\n null !== error &&\n \"string\" === typeof error.message\n ? String(error.message)\n : String(error),\n error: error\n });\n if (!window.dispatchEvent(event)) return;\n } else if (\n \"object\" === typeof process &&\n \"function\" === typeof process.emit\n ) {\n process.emit(\"uncaughtException\", error);\n return;\n }\n console.error(error);\n },\n didWarnAboutMessageChannel = !1,\n enqueueTaskImpl = null,\n actScopeDepth = 0,\n didWarnNoAwaitAct = !1,\n isFlushing = !1,\n queueSeveralMicrotasks =\n \"function\" === typeof queueMicrotask\n ? function (callback) {\n queueMicrotask(function () {\n return queueMicrotask(callback);\n });\n }\n : enqueueTask;\n deprecatedAPIs = Object.freeze({\n __proto__: null,\n c: function (size) {\n return resolveDispatcher().useMemoCache(size);\n }\n });\n var fnName = {\n map: mapChildren,\n forEach: function (children, forEachFunc, forEachContext) {\n mapChildren(\n children,\n function () {\n forEachFunc.apply(this, arguments);\n },\n forEachContext\n );\n },\n count: function (children) {\n var n = 0;\n mapChildren(children, function () {\n n++;\n });\n return n;\n },\n toArray: function (children) {\n return (\n mapChildren(children, function (child) {\n return child;\n }) || []\n );\n },\n only: function (children) {\n if (!isValidElement(children))\n throw Error(\n \"React.Children.only expected to receive a single React element child.\"\n );\n return children;\n }\n };\n exports.Activity = REACT_ACTIVITY_TYPE;\n exports.Children = fnName;\n exports.Component = Component;\n exports.Fragment = REACT_FRAGMENT_TYPE;\n exports.Profiler = REACT_PROFILER_TYPE;\n exports.PureComponent = PureComponent;\n exports.StrictMode = REACT_STRICT_MODE_TYPE;\n exports.Suspense = REACT_SUSPENSE_TYPE;\n exports.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE =\n ReactSharedInternals;\n exports.__COMPILER_RUNTIME = deprecatedAPIs;\n exports.act = function (callback) {\n var prevActQueue = ReactSharedInternals.actQueue,\n prevActScopeDepth = actScopeDepth;\n actScopeDepth++;\n var queue = (ReactSharedInternals.actQueue =\n null !== prevActQueue ? prevActQueue : []),\n didAwaitActCall = !1;\n try {\n var result = callback();\n } catch (error) {\n ReactSharedInternals.thrownErrors.push(error);\n }\n if (0 < ReactSharedInternals.thrownErrors.length)\n throw (\n (popActScope(prevActQueue, prevActScopeDepth),\n (callback = aggregateErrors(ReactSharedInternals.thrownErrors)),\n (ReactSharedInternals.thrownErrors.length = 0),\n callback)\n );\n if (\n null !== result &&\n \"object\" === typeof result &&\n \"function\" === typeof result.then\n ) {\n var thenable = result;\n queueSeveralMicrotasks(function () {\n didAwaitActCall ||\n didWarnNoAwaitAct ||\n ((didWarnNoAwaitAct = !0),\n console.error(\n \"You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);\"\n ));\n });\n return {\n then: function (resolve, reject) {\n didAwaitActCall = !0;\n thenable.then(\n function (returnValue) {\n popActScope(prevActQueue, prevActScopeDepth);\n if (0 === prevActScopeDepth) {\n try {\n flushActQueue(queue),\n enqueueTask(function () {\n return recursivelyFlushAsyncActWork(\n returnValue,\n resolve,\n reject\n );\n });\n } catch (error$0) {\n ReactSharedInternals.thrownErrors.push(error$0);\n }\n if (0 < ReactSharedInternals.thrownErrors.length) {\n var _thrownError = aggregateErrors(\n ReactSharedInternals.thrownErrors\n );\n ReactSharedInternals.thrownErrors.length = 0;\n reject(_thrownError);\n }\n } else resolve(returnValue);\n },\n function (error) {\n popActScope(prevActQueue, prevActScopeDepth);\n 0 < ReactSharedInternals.thrownErrors.length\n ? ((error = aggregateErrors(\n ReactSharedInternals.thrownErrors\n )),\n (ReactSharedInternals.thrownErrors.length = 0),\n reject(error))\n : reject(error);\n }\n );\n }\n };\n }\n var returnValue$jscomp$0 = result;\n popActScope(prevActQueue, prevActScopeDepth);\n 0 === prevActScopeDepth &&\n (flushActQueue(queue),\n 0 !== queue.length &&\n queueSeveralMicrotasks(function () {\n didAwaitActCall ||\n didWarnNoAwaitAct ||\n ((didWarnNoAwaitAct = !0),\n console.error(\n \"A component suspended inside an `act` scope, but the `act` call was not awaited. When testing React components that depend on asynchronous data, you must await the result:\\n\\nawait act(() => ...)\"\n ));\n }),\n (ReactSharedInternals.actQueue = null));\n if (0 < ReactSharedInternals.thrownErrors.length)\n throw (\n ((callback = aggregateErrors(ReactSharedInternals.thrownErrors)),\n (ReactSharedInternals.thrownErrors.length = 0),\n callback)\n );\n return {\n then: function (resolve, reject) {\n didAwaitActCall = !0;\n 0 === prevActScopeDepth\n ? ((ReactSharedInternals.actQueue = queue),\n enqueueTask(function () {\n return recursivelyFlushAsyncActWork(\n returnValue$jscomp$0,\n resolve,\n reject\n );\n }))\n : resolve(returnValue$jscomp$0);\n }\n };\n };\n exports.cache = function (fn) {\n return function () {\n return fn.apply(null, arguments);\n };\n };\n exports.cacheSignal = function () {\n return null;\n };\n exports.captureOwnerStack = function () {\n var getCurrentStack = ReactSharedInternals.getCurrentStack;\n return null === getCurrentStack ? null : getCurrentStack();\n };\n exports.cloneElement = function (element, config, children) {\n if (null === element || void 0 === element)\n throw Error(\n \"The argument must be a React element, but you passed \" +\n element +\n \".\"\n );\n var props = assign({}, element.props),\n key = element.key,\n owner = element._owner;\n if (null != config) {\n var JSCompiler_inline_result;\n a: {\n if (\n hasOwnProperty.call(config, \"ref\") &&\n (JSCompiler_inline_result = Object.getOwnPropertyDescriptor(\n config,\n \"ref\"\n ).get) &&\n JSCompiler_inline_result.isReactWarning\n ) {\n JSCompiler_inline_result = !1;\n break a;\n }\n JSCompiler_inline_result = void 0 !== config.ref;\n }\n JSCompiler_inline_result && (owner = getOwner());\n hasValidKey(config) &&\n (checkKeyStringCoercion(config.key), (key = \"\" + config.key));\n for (propName in config)\n !hasOwnProperty.call(config, propName) ||\n \"key\" === propName ||\n \"__self\" === propName ||\n \"__source\" === propName ||\n (\"ref\" === propName && void 0 === config.ref) ||\n (props[propName] = config[propName]);\n }\n var propName = arguments.length - 2;\n if (1 === propName) props.children = children;\n else if (1 < propName) {\n JSCompiler_inline_result = Array(propName);\n for (var i = 0; i < propName; i++)\n JSCompiler_inline_result[i] = arguments[i + 2];\n props.children = JSCompiler_inline_result;\n }\n props = ReactElement(\n element.type,\n key,\n props,\n owner,\n element._debugStack,\n element._debugTask\n );\n for (key = 2; key < arguments.length; key++)\n validateChildKeys(arguments[key]);\n return props;\n };\n exports.createContext = function (defaultValue) {\n defaultValue = {\n $$typeof: REACT_CONTEXT_TYPE,\n _currentValue: defaultValue,\n _currentValue2: defaultValue,\n _threadCount: 0,\n Provider: null,\n Consumer: null\n };\n defaultValue.Provider = defaultValue;\n defaultValue.Consumer = {\n $$typeof: REACT_CONSUMER_TYPE,\n _context: defaultValue\n };\n defaultValue._currentRenderer = null;\n defaultValue._currentRenderer2 = null;\n return defaultValue;\n };\n exports.createElement = function (type, config, children) {\n for (var i = 2; i < arguments.length; i++)\n validateChildKeys(arguments[i]);\n i = {};\n var key = null;\n if (null != config)\n for (propName in (didWarnAboutOldJSXRuntime ||\n !(\"__self\" in config) ||\n \"key\" in config ||\n ((didWarnAboutOldJSXRuntime = !0),\n console.warn(\n \"Your app (or one of its dependencies) is using an outdated JSX transform. Update to the modern JSX transform for faster performance: https://react.dev/link/new-jsx-transform\"\n )),\n hasValidKey(config) &&\n (checkKeyStringCoercion(config.key), (key = \"\" + config.key)),\n config))\n hasOwnProperty.call(config, propName) &&\n \"key\" !== propName &&\n \"__self\" !== propName &&\n \"__source\" !== propName &&\n (i[propName] = config[propName]);\n var childrenLength = arguments.length - 2;\n if (1 === childrenLength) i.children = children;\n else if (1 < childrenLength) {\n for (\n var childArray = Array(childrenLength), _i = 0;\n _i < childrenLength;\n _i++\n )\n childArray[_i] = arguments[_i + 2];\n Object.freeze && Object.freeze(childArray);\n i.children = childArray;\n }\n if (type && type.defaultProps)\n for (propName in ((childrenLength = type.defaultProps), childrenLength))\n void 0 === i[propName] && (i[propName] = childrenLength[propName]);\n key &&\n defineKeyPropWarningGetter(\n i,\n \"function\" === typeof type\n ? type.displayName || type.name || \"Unknown\"\n : type\n );\n var propName = 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;\n return ReactElement(\n type,\n key,\n i,\n getOwner(),\n propName ? Error(\"react-stack-top-frame\") : unknownOwnerDebugStack,\n propName ? createTask(getTaskName(type)) : unknownOwnerDebugTask\n );\n };\n exports.createRef = function () {\n var refObject = { current: null };\n Object.seal(refObject);\n return refObject;\n };\n exports.forwardRef = function (render) {\n null != render && render.$$typeof === REACT_MEMO_TYPE\n ? console.error(\n \"forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...)).\"\n )\n : \"function\" !== typeof render\n ? console.error(\n \"forwardRef requires a render function but was given %s.\",\n null === render ? \"null\" : typeof render\n )\n : 0 !== render.length &&\n 2 !== render.length &&\n console.error(\n \"forwardRef render functions accept exactly two parameters: props and ref. %s\",\n 1 === render.length\n ? \"Did you forget to use the ref parameter?\"\n : \"Any additional parameter will be undefined.\"\n );\n null != render &&\n null != render.defaultProps &&\n console.error(\n \"forwardRef render functions do not support defaultProps. Did you accidentally pass a React component?\"\n );\n var elementType = { $$typeof: REACT_FORWARD_REF_TYPE, render: render },\n ownName;\n Object.defineProperty(elementType, \"displayName\", {\n enumerable: !1,\n configurable: !0,\n get: function () {\n return ownName;\n },\n set: function (name) {\n ownName = name;\n render.name ||\n render.displayName ||\n (Object.defineProperty(render, \"name\", { value: name }),\n (render.displayName = name));\n }\n });\n return elementType;\n };\n exports.isValidElement = isValidElement;\n exports.lazy = function (ctor) {\n ctor = { _status: -1, _result: ctor };\n var lazyType = {\n $$typeof: REACT_LAZY_TYPE,\n _payload: ctor,\n _init: lazyInitializer\n },\n ioInfo = {\n name: \"lazy\",\n start: -1,\n end: -1,\n value: null,\n owner: null,\n debugStack: Error(\"react-stack-top-frame\"),\n debugTask: console.createTask ? console.createTask(\"lazy()\") : null\n };\n ctor._ioInfo = ioInfo;\n lazyType._debugInfo = [{ awaited: ioInfo }];\n return lazyType;\n };\n exports.memo = function (type, compare) {\n null == type &&\n console.error(\n \"memo: The first argument must be a component. Instead received: %s\",\n null === type ? \"null\" : typeof type\n );\n compare = {\n $$typeof: REACT_MEMO_TYPE,\n type: type,\n compare: void 0 === compare ? null : compare\n };\n var ownName;\n Object.defineProperty(compare, \"displayName\", {\n enumerable: !1,\n configurable: !0,\n get: function () {\n return ownName;\n },\n set: function (name) {\n ownName = name;\n type.name ||\n type.displayName ||\n (Object.defineProperty(type, \"name\", { value: name }),\n (type.displayName = name));\n }\n });\n return compare;\n };\n exports.startTransition = function (scope) {\n var prevTransition = ReactSharedInternals.T,\n currentTransition = {};\n currentTransition._updatedFibers = new Set();\n ReactSharedInternals.T = currentTransition;\n try {\n var returnValue = scope(),\n onStartTransitionFinish = ReactSharedInternals.S;\n null !== onStartTransitionFinish &&\n onStartTransitionFinish(currentTransition, returnValue);\n \"object\" === typeof returnValue &&\n null !== returnValue &&\n \"function\" === typeof returnValue.then &&\n (ReactSharedInternals.asyncTransitions++,\n returnValue.then(releaseAsyncTransition, releaseAsyncTransition),\n returnValue.then(noop, reportGlobalError));\n } catch (error) {\n reportGlobalError(error);\n } finally {\n null === prevTransition &&\n currentTransition._updatedFibers &&\n ((scope = currentTransition._updatedFibers.size),\n currentTransition._updatedFibers.clear(),\n 10 < scope &&\n console.warn(\n \"Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table.\"\n )),\n null !== prevTransition &&\n null !== currentTransition.types &&\n (null !== prevTransition.types &&\n prevTransition.types !== currentTransition.types &&\n console.error(\n \"We expected inner Transitions to have transferred the outer types set and that you cannot add to the outer Transition while inside the inner.This is a bug in React.\"\n ),\n (prevTransition.types = currentTransition.types)),\n (ReactSharedInternals.T = prevTransition);\n }\n };\n exports.unstable_useCacheRefresh = function () {\n return resolveDispatcher().useCacheRefresh();\n };\n exports.use = function (usable) {\n return resolveDispatcher().use(usable);\n };\n exports.useActionState = function (action, initialState, permalink) {\n return resolveDispatcher().useActionState(\n action,\n initialState,\n permalink\n );\n };\n exports.useCallback = function (callback, deps) {\n return resolveDispatcher().useCallback(callback, deps);\n };\n exports.useContext = function (Context) {\n var dispatcher = resolveDispatcher();\n Context.$$typeof === REACT_CONSUMER_TYPE &&\n console.error(\n \"Calling useContext(Context.Consumer) is not supported and will cause bugs. Did you mean to call useContext(Context) instead?\"\n );\n return dispatcher.useContext(Context);\n };\n exports.useDebugValue = function (value, formatterFn) {\n return resolveDispatcher().useDebugValue(value, formatterFn);\n };\n exports.useDeferredValue = function (value, initialValue) {\n return resolveDispatcher().useDeferredValue(value, initialValue);\n };\n exports.useEffect = function (create, deps) {\n null == create &&\n console.warn(\n \"React Hook useEffect requires an effect callback. Did you forget to pass a callback to the hook?\"\n );\n return resolveDispatcher().useEffect(create, deps);\n };\n exports.useEffectEvent = function (callback) {\n return resolveDispatcher().useEffectEvent(callback);\n };\n exports.useId = function () {\n return resolveDispatcher().useId();\n };\n exports.useImperativeHandle = function (ref, create, deps) {\n return resolveDispatcher().useImperativeHandle(ref, create, deps);\n };\n exports.useInsertionEffect = function (create, deps) {\n null == create &&\n console.warn(\n \"React Hook useInsertionEffect requires an effect callback. Did you forget to pass a callback to the hook?\"\n );\n return resolveDispatcher().useInsertionEffect(create, deps);\n };\n exports.useLayoutEffect = function (create, deps) {\n null == create &&\n console.warn(\n \"React Hook useLayoutEffect requires an effect callback. Did you forget to pass a callback to the hook?\"\n );\n return resolveDispatcher().useLayoutEffect(create, deps);\n };\n exports.useMemo = function (create, deps) {\n return resolveDispatcher().useMemo(create, deps);\n };\n exports.useOptimistic = function (passthrough, reducer) {\n return resolveDispatcher().useOptimistic(passthrough, reducer);\n };\n exports.useReducer = function (reducer, initialArg, init) {\n return resolveDispatcher().useReducer(reducer, initialArg, init);\n };\n exports.useRef = function (initialValue) {\n return resolveDispatcher().useRef(initialValue);\n };\n exports.useState = function (initialState) {\n return resolveDispatcher().useState(initialState);\n };\n exports.useSyncExternalStore = function (\n subscribe,\n getSnapshot,\n getServerSnapshot\n ) {\n return resolveDispatcher().useSyncExternalStore(\n subscribe,\n getSnapshot,\n getServerSnapshot\n );\n };\n exports.useTransition = function () {\n return resolveDispatcher().useTransition();\n };\n exports.version = \"19.2.4\";\n \"undefined\" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&\n \"function\" ===\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&\n __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());\n })();\n", "'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react.production.js');\n} else {\n module.exports = require('./cjs/react.development.js');\n}\n"], - "mappings": ";;;;;AAAA;AAAA;AAAA;AAWA,KACG,WAAY;AACX,eAAS,yBAAyB,YAAY,MAAM;AAClD,eAAO,eAAe,UAAU,WAAW,YAAY;AAAA,UACrD,KAAK,WAAY;AACf,oBAAQ;AAAA,cACN;AAAA,cACA,KAAK,CAAC;AAAA,cACN,KAAK,CAAC;AAAA,YACR;AAAA,UACF;AAAA,QACF,CAAC;AAAA,MACH;AACA,eAAS,cAAc,eAAe;AACpC,YAAI,SAAS,iBAAiB,aAAa,OAAO;AAChD,iBAAO;AACT,wBACG,yBAAyB,cAAc,qBAAqB,KAC7D,cAAc,YAAY;AAC5B,eAAO,eAAe,OAAO,gBAAgB,gBAAgB;AAAA,MAC/D;AACA,eAAS,SAAS,gBAAgB,YAAY;AAC5C,0BACI,iBAAiB,eAAe,iBAC/B,eAAe,eAAe,eAAe,SAChD;AACF,YAAI,aAAa,iBAAiB,MAAM;AACxC,gDAAwC,UAAU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} diff --git a/features/landing/frontend-standalone/.vite-cache/deps/chunk-DKXZQOKX.js b/features/landing/frontend-standalone/.vite-cache/deps/chunk-DKXZQOKX.js deleted file mode 100644 index 28662865e..000000000 --- a/features/landing/frontend-standalone/.vite-cache/deps/chunk-DKXZQOKX.js +++ /dev/null @@ -1,267 +0,0 @@ -import { - require_react -} from "./chunk-7Y3UKPDW.js"; -import { - __commonJS -} from "./chunk-DSCFE4L4.js"; - -// ../../../../node_modules/.bun/react-dom@19.2.4+b1ab299f0a400331/node_modules/react-dom/cjs/react-dom.development.js -var require_react_dom_development = __commonJS({ - "../../../../node_modules/.bun/react-dom@19.2.4+b1ab299f0a400331/node_modules/react-dom/cjs/react-dom.development.js"(exports) { - "use strict"; - (function() { - function noop() { - } - function testStringCoercion(value) { - return "" + value; - } - function createPortal$1(children, containerInfo, implementation) { - var key = 3 < arguments.length && void 0 !== arguments[3] ? arguments[3] : null; - try { - testStringCoercion(key); - var JSCompiler_inline_result = false; - } catch (e) { - JSCompiler_inline_result = true; - } - JSCompiler_inline_result && (console.error( - "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.", - "function" === typeof Symbol && Symbol.toStringTag && key[Symbol.toStringTag] || key.constructor.name || "Object" - ), testStringCoercion(key)); - return { - $$typeof: REACT_PORTAL_TYPE, - key: null == key ? null : "" + key, - children, - containerInfo, - implementation - }; - } - function getCrossOriginStringAs(as, input) { - if ("font" === as) return ""; - if ("string" === typeof input) - return "use-credentials" === input ? input : ""; - } - function getValueDescriptorExpectingObjectForWarning(thing) { - return null === thing ? "`null`" : void 0 === thing ? "`undefined`" : "" === thing ? "an empty string" : 'something with type "' + typeof thing + '"'; - } - function getValueDescriptorExpectingEnumForWarning(thing) { - return null === thing ? "`null`" : void 0 === thing ? "`undefined`" : "" === thing ? "an empty string" : "string" === typeof thing ? JSON.stringify(thing) : "number" === typeof thing ? "`" + thing + "`" : 'something with type "' + typeof thing + '"'; - } - function resolveDispatcher() { - var dispatcher = ReactSharedInternals.H; - null === dispatcher && console.error( - "Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem." - ); - return dispatcher; - } - "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error()); - var React = require_react(), Internals = { - d: { - f: noop, - r: function() { - throw Error( - "Invalid form element. requestFormReset must be passed a form that was rendered by React." - ); - }, - D: noop, - C: noop, - L: noop, - m: noop, - X: noop, - S: noop, - M: noop - }, - p: 0, - findDOMNode: null - }, REACT_PORTAL_TYPE = /* @__PURE__ */ Symbol.for("react.portal"), ReactSharedInternals = React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE; - "function" === typeof Map && null != Map.prototype && "function" === typeof Map.prototype.forEach && "function" === typeof Set && null != Set.prototype && "function" === typeof Set.prototype.clear && "function" === typeof Set.prototype.forEach || console.error( - "React depends on Map and Set built-in types. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills" - ); - exports.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = Internals; - exports.createPortal = function(children, container) { - var key = 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : null; - if (!container || 1 !== container.nodeType && 9 !== container.nodeType && 11 !== container.nodeType) - throw Error("Target container is not a DOM element."); - return createPortal$1(children, container, null, key); - }; - exports.flushSync = function(fn) { - var previousTransition = ReactSharedInternals.T, previousUpdatePriority = Internals.p; - try { - if (ReactSharedInternals.T = null, Internals.p = 2, fn) - return fn(); - } finally { - ReactSharedInternals.T = previousTransition, Internals.p = previousUpdatePriority, Internals.d.f() && console.error( - "flushSync was called from inside a lifecycle method. React cannot flush when React is already rendering. Consider moving this call to a scheduler task or micro task." - ); - } - }; - exports.preconnect = function(href, options) { - "string" === typeof href && href ? null != options && "object" !== typeof options ? console.error( - "ReactDOM.preconnect(): Expected the `options` argument (second) to be an object but encountered %s instead. The only supported option at this time is `crossOrigin` which accepts a string.", - getValueDescriptorExpectingEnumForWarning(options) - ) : null != options && "string" !== typeof options.crossOrigin && console.error( - "ReactDOM.preconnect(): Expected the `crossOrigin` option (second argument) to be a string but encountered %s instead. Try removing this option or passing a string value instead.", - getValueDescriptorExpectingObjectForWarning(options.crossOrigin) - ) : console.error( - "ReactDOM.preconnect(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.", - getValueDescriptorExpectingObjectForWarning(href) - ); - "string" === typeof href && (options ? (options = options.crossOrigin, options = "string" === typeof options ? "use-credentials" === options ? options : "" : void 0) : options = null, Internals.d.C(href, options)); - }; - exports.prefetchDNS = function(href) { - if ("string" !== typeof href || !href) - console.error( - "ReactDOM.prefetchDNS(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.", - getValueDescriptorExpectingObjectForWarning(href) - ); - else if (1 < arguments.length) { - var options = arguments[1]; - "object" === typeof options && options.hasOwnProperty("crossOrigin") ? console.error( - "ReactDOM.prefetchDNS(): Expected only one argument, `href`, but encountered %s as a second argument instead. This argument is reserved for future options and is currently disallowed. It looks like the you are attempting to set a crossOrigin property for this DNS lookup hint. Browsers do not perform DNS queries using CORS and setting this attribute on the resource hint has no effect. Try calling ReactDOM.prefetchDNS() with just a single string argument, `href`.", - getValueDescriptorExpectingEnumForWarning(options) - ) : console.error( - "ReactDOM.prefetchDNS(): Expected only one argument, `href`, but encountered %s as a second argument instead. This argument is reserved for future options and is currently disallowed. Try calling ReactDOM.prefetchDNS() with just a single string argument, `href`.", - getValueDescriptorExpectingEnumForWarning(options) - ); - } - "string" === typeof href && Internals.d.D(href); - }; - exports.preinit = function(href, options) { - "string" === typeof href && href ? null == options || "object" !== typeof options ? console.error( - "ReactDOM.preinit(): Expected the `options` argument (second) to be an object with an `as` property describing the type of resource to be preinitialized but encountered %s instead.", - getValueDescriptorExpectingEnumForWarning(options) - ) : "style" !== options.as && "script" !== options.as && console.error( - 'ReactDOM.preinit(): Expected the `as` property in the `options` argument (second) to contain a valid value describing the type of resource to be preinitialized but encountered %s instead. Valid values for `as` are "style" and "script".', - getValueDescriptorExpectingEnumForWarning(options.as) - ) : console.error( - "ReactDOM.preinit(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.", - getValueDescriptorExpectingObjectForWarning(href) - ); - if ("string" === typeof href && options && "string" === typeof options.as) { - var as = options.as, crossOrigin = getCrossOriginStringAs(as, options.crossOrigin), integrity = "string" === typeof options.integrity ? options.integrity : void 0, fetchPriority = "string" === typeof options.fetchPriority ? options.fetchPriority : void 0; - "style" === as ? Internals.d.S( - href, - "string" === typeof options.precedence ? options.precedence : void 0, - { - crossOrigin, - integrity, - fetchPriority - } - ) : "script" === as && Internals.d.X(href, { - crossOrigin, - integrity, - fetchPriority, - nonce: "string" === typeof options.nonce ? options.nonce : void 0 - }); - } - }; - exports.preinitModule = function(href, options) { - var encountered = ""; - "string" === typeof href && href || (encountered += " The `href` argument encountered was " + getValueDescriptorExpectingObjectForWarning(href) + "."); - void 0 !== options && "object" !== typeof options ? encountered += " The `options` argument encountered was " + getValueDescriptorExpectingObjectForWarning(options) + "." : options && "as" in options && "script" !== options.as && (encountered += " The `as` option encountered was " + getValueDescriptorExpectingEnumForWarning(options.as) + "."); - if (encountered) - console.error( - "ReactDOM.preinitModule(): Expected up to two arguments, a non-empty `href` string and, optionally, an `options` object with a valid `as` property.%s", - encountered - ); - else - switch (encountered = options && "string" === typeof options.as ? options.as : "script", encountered) { - case "script": - break; - default: - encountered = getValueDescriptorExpectingEnumForWarning(encountered), console.error( - 'ReactDOM.preinitModule(): Currently the only supported "as" type for this function is "script" but received "%s" instead. This warning was generated for `href` "%s". In the future other module types will be supported, aligning with the import-attributes proposal. Learn more here: (https://github.com/tc39/proposal-import-attributes)', - encountered, - href - ); - } - if ("string" === typeof href) - if ("object" === typeof options && null !== options) { - if (null == options.as || "script" === options.as) - encountered = getCrossOriginStringAs( - options.as, - options.crossOrigin - ), Internals.d.M(href, { - crossOrigin: encountered, - integrity: "string" === typeof options.integrity ? options.integrity : void 0, - nonce: "string" === typeof options.nonce ? options.nonce : void 0 - }); - } else null == options && Internals.d.M(href); - }; - exports.preload = function(href, options) { - var encountered = ""; - "string" === typeof href && href || (encountered += " The `href` argument encountered was " + getValueDescriptorExpectingObjectForWarning(href) + "."); - null == options || "object" !== typeof options ? encountered += " The `options` argument encountered was " + getValueDescriptorExpectingObjectForWarning(options) + "." : "string" === typeof options.as && options.as || (encountered += " The `as` option encountered was " + getValueDescriptorExpectingObjectForWarning(options.as) + "."); - encountered && console.error( - 'ReactDOM.preload(): Expected two arguments, a non-empty `href` string and an `options` object with an `as` property valid for a `` tag.%s', - encountered - ); - if ("string" === typeof href && "object" === typeof options && null !== options && "string" === typeof options.as) { - encountered = options.as; - var crossOrigin = getCrossOriginStringAs( - encountered, - options.crossOrigin - ); - Internals.d.L(href, encountered, { - crossOrigin, - integrity: "string" === typeof options.integrity ? options.integrity : void 0, - nonce: "string" === typeof options.nonce ? options.nonce : void 0, - type: "string" === typeof options.type ? options.type : void 0, - fetchPriority: "string" === typeof options.fetchPriority ? options.fetchPriority : void 0, - referrerPolicy: "string" === typeof options.referrerPolicy ? options.referrerPolicy : void 0, - imageSrcSet: "string" === typeof options.imageSrcSet ? options.imageSrcSet : void 0, - imageSizes: "string" === typeof options.imageSizes ? options.imageSizes : void 0, - media: "string" === typeof options.media ? options.media : void 0 - }); - } - }; - exports.preloadModule = function(href, options) { - var encountered = ""; - "string" === typeof href && href || (encountered += " The `href` argument encountered was " + getValueDescriptorExpectingObjectForWarning(href) + "."); - void 0 !== options && "object" !== typeof options ? encountered += " The `options` argument encountered was " + getValueDescriptorExpectingObjectForWarning(options) + "." : options && "as" in options && "string" !== typeof options.as && (encountered += " The `as` option encountered was " + getValueDescriptorExpectingObjectForWarning(options.as) + "."); - encountered && console.error( - 'ReactDOM.preloadModule(): Expected two arguments, a non-empty `href` string and, optionally, an `options` object with an `as` property valid for a `` tag.%s', - encountered - ); - "string" === typeof href && (options ? (encountered = getCrossOriginStringAs( - options.as, - options.crossOrigin - ), Internals.d.m(href, { - as: "string" === typeof options.as && "script" !== options.as ? options.as : void 0, - crossOrigin: encountered, - integrity: "string" === typeof options.integrity ? options.integrity : void 0 - })) : Internals.d.m(href)); - }; - exports.requestFormReset = function(form) { - Internals.d.r(form); - }; - exports.unstable_batchedUpdates = function(fn, a) { - return fn(a); - }; - exports.useFormState = function(action, initialState, permalink) { - return resolveDispatcher().useFormState(action, initialState, permalink); - }; - exports.useFormStatus = function() { - return resolveDispatcher().useHostTransitionStatus(); - }; - exports.version = "19.2.4"; - "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error()); - })(); - } -}); - -// ../../../../node_modules/.bun/react-dom@19.2.4+b1ab299f0a400331/node_modules/react-dom/index.js -var require_react_dom = __commonJS({ - "../../../../node_modules/.bun/react-dom@19.2.4+b1ab299f0a400331/node_modules/react-dom/index.js"(exports, module) { - if (false) { - checkDCE(); - module.exports = null; - } else { - module.exports = require_react_dom_development(); - } - } -}); - -export { - require_react_dom -}; -//# sourceMappingURL=chunk-DKXZQOKX.js.map diff --git a/features/landing/frontend-standalone/.vite-cache/deps/chunk-DKXZQOKX.js.map b/features/landing/frontend-standalone/.vite-cache/deps/chunk-DKXZQOKX.js.map deleted file mode 100644 index 715b94922..000000000 --- a/features/landing/frontend-standalone/.vite-cache/deps/chunk-DKXZQOKX.js.map +++ /dev/null @@ -1,7 +0,0 @@ -{ - "version": 3, - "sources": ["../../../../../../node_modules/.bun/react-dom@19.2.4+b1ab299f0a400331/node_modules/react-dom/cjs/react-dom.development.js", "../../../../../../node_modules/.bun/react-dom@19.2.4+b1ab299f0a400331/node_modules/react-dom/index.js"], - "sourcesContent": ["/**\n * @license React\n * react-dom.development.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\n\"production\" !== process.env.NODE_ENV &&\n (function () {\n function noop() {}\n function testStringCoercion(value) {\n return \"\" + value;\n }\n function createPortal$1(children, containerInfo, implementation) {\n var key =\n 3 < arguments.length && void 0 !== arguments[3] ? arguments[3] : null;\n try {\n testStringCoercion(key);\n var JSCompiler_inline_result = !1;\n } catch (e) {\n JSCompiler_inline_result = !0;\n }\n JSCompiler_inline_result &&\n (console.error(\n \"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.\",\n (\"function\" === typeof Symbol &&\n Symbol.toStringTag &&\n key[Symbol.toStringTag]) ||\n key.constructor.name ||\n \"Object\"\n ),\n testStringCoercion(key));\n return {\n $$typeof: REACT_PORTAL_TYPE,\n key: null == key ? null : \"\" + key,\n children: children,\n containerInfo: containerInfo,\n implementation: implementation\n };\n }\n function getCrossOriginStringAs(as, input) {\n if (\"font\" === as) return \"\";\n if (\"string\" === typeof input)\n return \"use-credentials\" === input ? input : \"\";\n }\n function getValueDescriptorExpectingObjectForWarning(thing) {\n return null === thing\n ? \"`null`\"\n : void 0 === thing\n ? \"`undefined`\"\n : \"\" === thing\n ? \"an empty string\"\n : 'something with type \"' + typeof thing + '\"';\n }\n function getValueDescriptorExpectingEnumForWarning(thing) {\n return null === thing\n ? \"`null`\"\n : void 0 === thing\n ? \"`undefined`\"\n : \"\" === thing\n ? \"an empty string\"\n : \"string\" === typeof thing\n ? JSON.stringify(thing)\n : \"number\" === typeof thing\n ? \"`\" + thing + \"`\"\n : 'something with type \"' + typeof thing + '\"';\n }\n function resolveDispatcher() {\n var dispatcher = ReactSharedInternals.H;\n null === dispatcher &&\n console.error(\n \"Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\\n1. You might have mismatching versions of React and the renderer (such as React DOM)\\n2. You might be breaking the Rules of Hooks\\n3. You might have more than one copy of React in the same app\\nSee https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.\"\n );\n return dispatcher;\n }\n \"undefined\" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&\n \"function\" ===\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart &&\n __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());\n var React = require(\"react\"),\n Internals = {\n d: {\n f: noop,\n r: function () {\n throw Error(\n \"Invalid form element. requestFormReset must be passed a form that was rendered by React.\"\n );\n },\n D: noop,\n C: noop,\n L: noop,\n m: noop,\n X: noop,\n S: noop,\n M: noop\n },\n p: 0,\n findDOMNode: null\n },\n REACT_PORTAL_TYPE = Symbol.for(\"react.portal\"),\n ReactSharedInternals =\n React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;\n (\"function\" === typeof Map &&\n null != Map.prototype &&\n \"function\" === typeof Map.prototype.forEach &&\n \"function\" === typeof Set &&\n null != Set.prototype &&\n \"function\" === typeof Set.prototype.clear &&\n \"function\" === typeof Set.prototype.forEach) ||\n console.error(\n \"React depends on Map and Set built-in types. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills\"\n );\n exports.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE =\n Internals;\n exports.createPortal = function (children, container) {\n var key =\n 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : null;\n if (\n !container ||\n (1 !== container.nodeType &&\n 9 !== container.nodeType &&\n 11 !== container.nodeType)\n )\n throw Error(\"Target container is not a DOM element.\");\n return createPortal$1(children, container, null, key);\n };\n exports.flushSync = function (fn) {\n var previousTransition = ReactSharedInternals.T,\n previousUpdatePriority = Internals.p;\n try {\n if (((ReactSharedInternals.T = null), (Internals.p = 2), fn))\n return fn();\n } finally {\n (ReactSharedInternals.T = previousTransition),\n (Internals.p = previousUpdatePriority),\n Internals.d.f() &&\n console.error(\n \"flushSync was called from inside a lifecycle method. React cannot flush when React is already rendering. Consider moving this call to a scheduler task or micro task.\"\n );\n }\n };\n exports.preconnect = function (href, options) {\n \"string\" === typeof href && href\n ? null != options && \"object\" !== typeof options\n ? console.error(\n \"ReactDOM.preconnect(): Expected the `options` argument (second) to be an object but encountered %s instead. The only supported option at this time is `crossOrigin` which accepts a string.\",\n getValueDescriptorExpectingEnumForWarning(options)\n )\n : null != options &&\n \"string\" !== typeof options.crossOrigin &&\n console.error(\n \"ReactDOM.preconnect(): Expected the `crossOrigin` option (second argument) to be a string but encountered %s instead. Try removing this option or passing a string value instead.\",\n getValueDescriptorExpectingObjectForWarning(options.crossOrigin)\n )\n : console.error(\n \"ReactDOM.preconnect(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.\",\n getValueDescriptorExpectingObjectForWarning(href)\n );\n \"string\" === typeof href &&\n (options\n ? ((options = options.crossOrigin),\n (options =\n \"string\" === typeof options\n ? \"use-credentials\" === options\n ? options\n : \"\"\n : void 0))\n : (options = null),\n Internals.d.C(href, options));\n };\n exports.prefetchDNS = function (href) {\n if (\"string\" !== typeof href || !href)\n console.error(\n \"ReactDOM.prefetchDNS(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.\",\n getValueDescriptorExpectingObjectForWarning(href)\n );\n else if (1 < arguments.length) {\n var options = arguments[1];\n \"object\" === typeof options && options.hasOwnProperty(\"crossOrigin\")\n ? console.error(\n \"ReactDOM.prefetchDNS(): Expected only one argument, `href`, but encountered %s as a second argument instead. This argument is reserved for future options and is currently disallowed. It looks like the you are attempting to set a crossOrigin property for this DNS lookup hint. Browsers do not perform DNS queries using CORS and setting this attribute on the resource hint has no effect. Try calling ReactDOM.prefetchDNS() with just a single string argument, `href`.\",\n getValueDescriptorExpectingEnumForWarning(options)\n )\n : console.error(\n \"ReactDOM.prefetchDNS(): Expected only one argument, `href`, but encountered %s as a second argument instead. This argument is reserved for future options and is currently disallowed. Try calling ReactDOM.prefetchDNS() with just a single string argument, `href`.\",\n getValueDescriptorExpectingEnumForWarning(options)\n );\n }\n \"string\" === typeof href && Internals.d.D(href);\n };\n exports.preinit = function (href, options) {\n \"string\" === typeof href && href\n ? null == options || \"object\" !== typeof options\n ? console.error(\n \"ReactDOM.preinit(): Expected the `options` argument (second) to be an object with an `as` property describing the type of resource to be preinitialized but encountered %s instead.\",\n getValueDescriptorExpectingEnumForWarning(options)\n )\n : \"style\" !== options.as &&\n \"script\" !== options.as &&\n console.error(\n 'ReactDOM.preinit(): Expected the `as` property in the `options` argument (second) to contain a valid value describing the type of resource to be preinitialized but encountered %s instead. Valid values for `as` are \"style\" and \"script\".',\n getValueDescriptorExpectingEnumForWarning(options.as)\n )\n : console.error(\n \"ReactDOM.preinit(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.\",\n getValueDescriptorExpectingObjectForWarning(href)\n );\n if (\n \"string\" === typeof href &&\n options &&\n \"string\" === typeof options.as\n ) {\n var as = options.as,\n crossOrigin = getCrossOriginStringAs(as, options.crossOrigin),\n integrity =\n \"string\" === typeof options.integrity ? options.integrity : void 0,\n fetchPriority =\n \"string\" === typeof options.fetchPriority\n ? options.fetchPriority\n : void 0;\n \"style\" === as\n ? Internals.d.S(\n href,\n \"string\" === typeof options.precedence\n ? options.precedence\n : void 0,\n {\n crossOrigin: crossOrigin,\n integrity: integrity,\n fetchPriority: fetchPriority\n }\n )\n : \"script\" === as &&\n Internals.d.X(href, {\n crossOrigin: crossOrigin,\n integrity: integrity,\n fetchPriority: fetchPriority,\n nonce: \"string\" === typeof options.nonce ? options.nonce : void 0\n });\n }\n };\n exports.preinitModule = function (href, options) {\n var encountered = \"\";\n (\"string\" === typeof href && href) ||\n (encountered +=\n \" The `href` argument encountered was \" +\n getValueDescriptorExpectingObjectForWarning(href) +\n \".\");\n void 0 !== options && \"object\" !== typeof options\n ? (encountered +=\n \" The `options` argument encountered was \" +\n getValueDescriptorExpectingObjectForWarning(options) +\n \".\")\n : options &&\n \"as\" in options &&\n \"script\" !== options.as &&\n (encountered +=\n \" The `as` option encountered was \" +\n getValueDescriptorExpectingEnumForWarning(options.as) +\n \".\");\n if (encountered)\n console.error(\n \"ReactDOM.preinitModule(): Expected up to two arguments, a non-empty `href` string and, optionally, an `options` object with a valid `as` property.%s\",\n encountered\n );\n else\n switch (\n ((encountered =\n options && \"string\" === typeof options.as ? options.as : \"script\"),\n encountered)\n ) {\n case \"script\":\n break;\n default:\n (encountered =\n getValueDescriptorExpectingEnumForWarning(encountered)),\n console.error(\n 'ReactDOM.preinitModule(): Currently the only supported \"as\" type for this function is \"script\" but received \"%s\" instead. This warning was generated for `href` \"%s\". In the future other module types will be supported, aligning with the import-attributes proposal. Learn more here: (https://github.com/tc39/proposal-import-attributes)',\n encountered,\n href\n );\n }\n if (\"string\" === typeof href)\n if (\"object\" === typeof options && null !== options) {\n if (null == options.as || \"script\" === options.as)\n (encountered = getCrossOriginStringAs(\n options.as,\n options.crossOrigin\n )),\n Internals.d.M(href, {\n crossOrigin: encountered,\n integrity:\n \"string\" === typeof options.integrity\n ? options.integrity\n : void 0,\n nonce:\n \"string\" === typeof options.nonce ? options.nonce : void 0\n });\n } else null == options && Internals.d.M(href);\n };\n exports.preload = function (href, options) {\n var encountered = \"\";\n (\"string\" === typeof href && href) ||\n (encountered +=\n \" The `href` argument encountered was \" +\n getValueDescriptorExpectingObjectForWarning(href) +\n \".\");\n null == options || \"object\" !== typeof options\n ? (encountered +=\n \" The `options` argument encountered was \" +\n getValueDescriptorExpectingObjectForWarning(options) +\n \".\")\n : (\"string\" === typeof options.as && options.as) ||\n (encountered +=\n \" The `as` option encountered was \" +\n getValueDescriptorExpectingObjectForWarning(options.as) +\n \".\");\n encountered &&\n console.error(\n 'ReactDOM.preload(): Expected two arguments, a non-empty `href` string and an `options` object with an `as` property valid for a `` tag.%s',\n encountered\n );\n if (\n \"string\" === typeof href &&\n \"object\" === typeof options &&\n null !== options &&\n \"string\" === typeof options.as\n ) {\n encountered = options.as;\n var crossOrigin = getCrossOriginStringAs(\n encountered,\n options.crossOrigin\n );\n Internals.d.L(href, encountered, {\n crossOrigin: crossOrigin,\n integrity:\n \"string\" === typeof options.integrity ? options.integrity : void 0,\n nonce: \"string\" === typeof options.nonce ? options.nonce : void 0,\n type: \"string\" === typeof options.type ? options.type : void 0,\n fetchPriority:\n \"string\" === typeof options.fetchPriority\n ? options.fetchPriority\n : void 0,\n referrerPolicy:\n \"string\" === typeof options.referrerPolicy\n ? options.referrerPolicy\n : void 0,\n imageSrcSet:\n \"string\" === typeof options.imageSrcSet\n ? options.imageSrcSet\n : void 0,\n imageSizes:\n \"string\" === typeof options.imageSizes\n ? options.imageSizes\n : void 0,\n media: \"string\" === typeof options.media ? options.media : void 0\n });\n }\n };\n exports.preloadModule = function (href, options) {\n var encountered = \"\";\n (\"string\" === typeof href && href) ||\n (encountered +=\n \" The `href` argument encountered was \" +\n getValueDescriptorExpectingObjectForWarning(href) +\n \".\");\n void 0 !== options && \"object\" !== typeof options\n ? (encountered +=\n \" The `options` argument encountered was \" +\n getValueDescriptorExpectingObjectForWarning(options) +\n \".\")\n : options &&\n \"as\" in options &&\n \"string\" !== typeof options.as &&\n (encountered +=\n \" The `as` option encountered was \" +\n getValueDescriptorExpectingObjectForWarning(options.as) +\n \".\");\n encountered &&\n console.error(\n 'ReactDOM.preloadModule(): Expected two arguments, a non-empty `href` string and, optionally, an `options` object with an `as` property valid for a `` tag.%s',\n encountered\n );\n \"string\" === typeof href &&\n (options\n ? ((encountered = getCrossOriginStringAs(\n options.as,\n options.crossOrigin\n )),\n Internals.d.m(href, {\n as:\n \"string\" === typeof options.as && \"script\" !== options.as\n ? options.as\n : void 0,\n crossOrigin: encountered,\n integrity:\n \"string\" === typeof options.integrity\n ? options.integrity\n : void 0\n }))\n : Internals.d.m(href));\n };\n exports.requestFormReset = function (form) {\n Internals.d.r(form);\n };\n exports.unstable_batchedUpdates = function (fn, a) {\n return fn(a);\n };\n exports.useFormState = function (action, initialState, permalink) {\n return resolveDispatcher().useFormState(action, initialState, permalink);\n };\n exports.useFormStatus = function () {\n return resolveDispatcher().useHostTransitionStatus();\n };\n exports.version = \"19.2.4\";\n \"undefined\" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&\n \"function\" ===\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&\n __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());\n })();\n", "'use strict';\n\nfunction checkDCE() {\n /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */\n if (\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined' ||\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE !== 'function'\n ) {\n return;\n }\n if (process.env.NODE_ENV !== 'production') {\n // This branch is unreachable because this function is only called\n // in production, but the condition is true only in development.\n // Therefore if the branch is still here, dead code elimination wasn't\n // properly applied.\n // Don't change the message. React DevTools relies on it. Also make sure\n // this message doesn't occur elsewhere in this function, or it will cause\n // a false positive.\n throw new Error('^_^');\n }\n try {\n // Verify that the code above has been dead code eliminated (DCE'd).\n __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE);\n } catch (err) {\n // DevTools shouldn't crash React, no matter what.\n // We should still report in case we break this code.\n console.error(err);\n }\n}\n\nif (process.env.NODE_ENV === 'production') {\n // DCE check should happen before ReactDOM bundle executes so that\n // DevTools can report bad minification during injection.\n checkDCE();\n module.exports = require('./cjs/react-dom.production.js');\n} else {\n module.exports = require('./cjs/react-dom.development.js');\n}\n"], - "mappings": ";;;;;;;;AAAA;AAAA;AAAA;AAWA,KACG,WAAY;AACX,eAAS,OAAO;AAAA,MAAC;AACjB,eAAS,mBAAmB,OAAO;AACjC,eAAO,KAAK;AAAA,MACd;AACA,eAAS,eAAe,U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A,4CAA4C,IAAI,IAChD;AACJ,mBAAW,WAAW,aAAa,OAAO,UACrC,eACC,6CACA,4CAA4C,OAAO,IACnD,MACF,WACA,QAAQ,WACR,aAAa,OAAO,QAAQ,OAC3B,eACC,sCACA,4CAA4C,QAAQ,EAAE,IACtD;AACN,uBACE,QAAQ;AAAA,UACN;AAAA,UACA;AAAA,QACF;AACF,qBAAa,OAAO,SACjB,WACK,cAAc;AAAA,UACd,QAAQ;AAAA,UACR,QAAQ;AAAA,QACV,GACA,UAAU,EAAE,EAAE,MAAM;AAAA,UAClB,IACE,aAAa,OAAO,QAAQ,MAAM,aAAa,QAAQ,KACnD,QAAQ,KACR;AAAA,UACN,aAAa;AAAA,UACb,WACE,aAAa,OAAO,QAAQ,YACxB,QAAQ,YACR;AAAA,QACR,CAAC,KACD,UAAU,EAAE,EAAE,IAAI;AAAA,MAC1B;AACA,cAAQ,mBAAmB,SAAU,MAAM;AACzC,kBAAU,EAAE,EAAE,IAAI;AAAA,MACpB;AACA,cAAQ,0BAA0B,SAAU,IAAI,GAAG;AACjD,eAAO,GAAG,CAAC;AAAA,MACb;AACA,cAAQ,eAAe,SAAU,QAAQ,cAAc,WAAW;AAChE,eAAO,kBAAkB,EAAE,aAAa,QAAQ,cAAc,SAAS;AAAA,MACzE;AACA,cAAQ,gBAAgB,WAAY;AAClC,eAAO,kBAAkB,EAAE,wBAAwB;AAAA,MACrD;AACA,cAAQ,UAAU;AAClB,sBAAgB,OAAO,kCACrB,eACE,OAAO,+BAA+B,8BACxC,+BAA+B,2BAA2B,MAAM,CAAC;AAAA,IACrE,GAAG;AAAA;AAAA;;;ACvaL;AAAA;AA8BA,QAAI,OAAuC;AAGzC,eAAS;AACT,aAAO,UAAU;AAAA,IACnB,OAAO;AACL,aAAO,UAAU;AAAA,IACnB;AAAA;AAAA;", - "names": [] -} diff --git a/features/landing/frontend-standalone/.vite-cache/deps/chunk-DSCFE4L4.js b/features/landing/frontend-standalone/.vite-cache/deps/chunk-DSCFE4L4.js deleted file mode 100644 index 8f303694b..000000000 --- a/features/landing/frontend-standalone/.vite-cache/deps/chunk-DSCFE4L4.js +++ /dev/null @@ -1,49 +0,0 @@ -var __create = Object.create; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __getProtoOf = Object.getPrototypeOf; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __typeError = (msg) => { - throw TypeError(msg); -}; -var __esm = (fn, res) => function __init() { - return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res; -}; -var __commonJS = (cb, mod) => function __require() { - return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; -}; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( - // If the importer is in node compatibility mode or this is not an ESM - // file that has been converted to a CommonJS file using a Babel- - // compatible transform (i.e. "__esModule" has not been set), then set - // "default" to the CommonJS "module.exports" for node compatibility. - isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, - mod -)); -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg); -var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj)); -var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value); - -export { - __esm, - __commonJS, - __export, - __toESM, - __toCommonJS, - __privateGet, - __privateAdd -}; diff --git a/features/landing/frontend-standalone/.vite-cache/deps/chunk-DSCFE4L4.js.map b/features/landing/frontend-standalone/.vite-cache/deps/chunk-DSCFE4L4.js.map deleted file mode 100644 index 98652118b..000000000 --- a/features/landing/frontend-standalone/.vite-cache/deps/chunk-DSCFE4L4.js.map +++ /dev/null @@ -1,7 +0,0 @@ -{ - "version": 3, - "sources": [], - "sourcesContent": [], - "mappings": "", - "names": [] -} diff --git a/features/landing/frontend-standalone/.vite-cache/deps/chunk-EK6WSQWS.js b/features/landing/frontend-standalone/.vite-cache/deps/chunk-EK6WSQWS.js deleted file mode 100644 index 665f72c51..000000000 --- a/features/landing/frontend-standalone/.vite-cache/deps/chunk-EK6WSQWS.js +++ /dev/null @@ -1,9 +0,0 @@ -import { - init_development, - init_dom_export -} from "./chunk-OTAO74UU.js"; - -// ../../../../node_modules/.bun/react-router-dom@7.13.0+bf16f8eded5e12ee/node_modules/react-router-dom/dist/index.mjs -init_dom_export(); -init_development(); -//# sourceMappingURL=chunk-EK6WSQWS.js.map diff --git a/features/landing/frontend-standalone/.vite-cache/deps/chunk-EK6WSQWS.js.map b/features/landing/frontend-standalone/.vite-cache/deps/chunk-EK6WSQWS.js.map deleted file mode 100644 index b0ec190ee..000000000 --- a/features/landing/frontend-standalone/.vite-cache/deps/chunk-EK6WSQWS.js.map +++ /dev/null @@ -1,7 +0,0 @@ -{ - "version": 3, - "sources": ["../../../../../../node_modules/.bun/react-router-dom@7.13.0+bf16f8eded5e12ee/node_modules/react-router-dom/dist/index.mjs"], - "sourcesContent": ["/**\n * react-router-dom v7.13.0\n *\n * Copyright (c) Remix Software Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE.md file in the root directory of this source tree.\n *\n * @license MIT\n */\n\n// index.ts\nimport { HydratedRouter, RouterProvider } from \"react-router/dom\";\nexport * from \"react-router\";\nexport {\n HydratedRouter,\n RouterProvider\n};\n"], - "mappings": ";;;;;;AAYA;AACA;", - "names": [] -} diff --git a/features/landing/frontend-standalone/.vite-cache/deps/chunk-GVT3TYT3.js b/features/landing/frontend-standalone/.vite-cache/deps/chunk-GVT3TYT3.js deleted file mode 100644 index f6a24e9e3..000000000 --- a/features/landing/frontend-standalone/.vite-cache/deps/chunk-GVT3TYT3.js +++ /dev/null @@ -1,3669 +0,0 @@ -import { - require_jsx_runtime -} from "./chunk-SF3ICQTZ.js"; -import { - require_react -} from "./chunk-7Y3UKPDW.js"; -import { - __toESM -} from "./chunk-DSCFE4L4.js"; - -// ../../../../node_modules/.bun/@tanstack+query-core@5.90.20/node_modules/@tanstack/query-core/build/modern/subscribable.js -var Subscribable = class { - constructor() { - this.listeners = /* @__PURE__ */ new Set(); - this.subscribe = this.subscribe.bind(this); - } - subscribe(listener) { - this.listeners.add(listener); - this.onSubscribe(); - return () => { - this.listeners.delete(listener); - this.onUnsubscribe(); - }; - } - hasListeners() { - return this.listeners.size > 0; - } - onSubscribe() { - } - onUnsubscribe() { - } -}; - -// ../../../../node_modules/.bun/@tanstack+query-core@5.90.20/node_modules/@tanstack/query-core/build/modern/timeoutManager.js -var defaultTimeoutProvider = { - // We need the wrapper function syntax below instead of direct references to - // global setTimeout etc. - // - // BAD: `setTimeout: setTimeout` - // GOOD: `setTimeout: (cb, delay) => setTimeout(cb, delay)` - // - // If we use direct references here, then anything that wants to spy on or - // replace the global setTimeout (like tests) won't work since we'll already - // have a hard reference to the original implementation at the time when this - // file was imported. - setTimeout: (callback, delay) => setTimeout(callback, delay), - clearTimeout: (timeoutId) => clearTimeout(timeoutId), - setInterval: (callback, delay) => setInterval(callback, delay), - clearInterval: (intervalId) => clearInterval(intervalId) -}; -var TimeoutManager = class { - // We cannot have TimeoutManager as we must instantiate it with a concrete - // type at app boot; and if we leave that type, then any new timer provider - // would need to support ReturnType, which is infeasible. - // - // We settle for type safety for the TimeoutProvider type, and accept that - // this class is unsafe internally to allow for extension. - #provider = defaultTimeoutProvider; - #providerCalled = false; - setTimeoutProvider(provider) { - if (true) { - if (this.#providerCalled && provider !== this.#provider) { - console.error( - `[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.`, - { previous: this.#provider, provider } - ); - } - } - this.#provider = provider; - if (true) { - this.#providerCalled = false; - } - } - setTimeout(callback, delay) { - if (true) { - this.#providerCalled = true; - } - return this.#provider.setTimeout(callback, delay); - } - clearTimeout(timeoutId) { - this.#provider.clearTimeout(timeoutId); - } - setInterval(callback, delay) { - if (true) { - this.#providerCalled = true; - } - return this.#provider.setInterval(callback, delay); - } - clearInterval(intervalId) { - this.#provider.clearInterval(intervalId); - } -}; -var timeoutManager = new TimeoutManager(); -function systemSetTimeoutZero(callback) { - setTimeout(callback, 0); -} - -// ../../../../node_modules/.bun/@tanstack+query-core@5.90.20/node_modules/@tanstack/query-core/build/modern/utils.js -var isServer = typeof window === "undefined" || "Deno" in globalThis; -function noop() { -} -function functionalUpdate(updater, input) { - return typeof updater === "function" ? updater(input) : updater; -} -function isValidTimeout(value) { - return typeof value === "number" && value >= 0 && value !== Infinity; -} -function timeUntilStale(updatedAt, staleTime) { - return Math.max(updatedAt + (staleTime || 0) - Date.now(), 0); -} -function resolveStaleTime(staleTime, query) { - return typeof staleTime === "function" ? staleTime(query) : staleTime; -} -function resolveEnabled(enabled, query) { - return typeof enabled === "function" ? enabled(query) : enabled; -} -function matchQuery(filters, query) { - const { - type = "all", - exact, - fetchStatus, - predicate, - queryKey, - stale - } = filters; - if (queryKey) { - if (exact) { - if (query.queryHash !== hashQueryKeyByOptions(queryKey, query.options)) { - return false; - } - } else if (!partialMatchKey(query.queryKey, queryKey)) { - return false; - } - } - if (type !== "all") { - const isActive = query.isActive(); - if (type === "active" && !isActive) { - return false; - } - if (type === "inactive" && isActive) { - return false; - } - } - if (typeof stale === "boolean" && query.isStale() !== stale) { - return false; - } - if (fetchStatus && fetchStatus !== query.state.fetchStatus) { - return false; - } - if (predicate && !predicate(query)) { - return false; - } - return true; -} -function matchMutation(filters, mutation) { - const { exact, status, predicate, mutationKey } = filters; - if (mutationKey) { - if (!mutation.options.mutationKey) { - return false; - } - if (exact) { - if (hashKey(mutation.options.mutationKey) !== hashKey(mutationKey)) { - return false; - } - } else if (!partialMatchKey(mutation.options.mutationKey, mutationKey)) { - return false; - } - } - if (status && mutation.state.status !== status) { - return false; - } - if (predicate && !predicate(mutation)) { - return false; - } - return true; -} -function hashQueryKeyByOptions(queryKey, options) { - const hashFn = options?.queryKeyHashFn || hashKey; - return hashFn(queryKey); -} -function hashKey(queryKey) { - return JSON.stringify( - queryKey, - (_, val) => isPlainObject(val) ? Object.keys(val).sort().reduce((result, key) => { - result[key] = val[key]; - return result; - }, {}) : val - ); -} -function partialMatchKey(a, b) { - if (a === b) { - return true; - } - if (typeof a !== typeof b) { - return false; - } - if (a && b && typeof a === "object" && typeof b === "object") { - return Object.keys(b).every((key) => partialMatchKey(a[key], b[key])); - } - return false; -} -var hasOwn = Object.prototype.hasOwnProperty; -function replaceEqualDeep(a, b, depth = 0) { - if (a === b) { - return a; - } - if (depth > 500) return b; - const array = isPlainArray(a) && isPlainArray(b); - if (!array && !(isPlainObject(a) && isPlainObject(b))) return b; - const aItems = array ? a : Object.keys(a); - const aSize = aItems.length; - const bItems = array ? b : Object.keys(b); - const bSize = bItems.length; - const copy = array ? new Array(bSize) : {}; - let equalItems = 0; - for (let i = 0; i < bSize; i++) { - const key = array ? i : bItems[i]; - const aItem = a[key]; - const bItem = b[key]; - if (aItem === bItem) { - copy[key] = aItem; - if (array ? i < aSize : hasOwn.call(a, key)) equalItems++; - continue; - } - if (aItem === null || bItem === null || typeof aItem !== "object" || typeof bItem !== "object") { - copy[key] = bItem; - continue; - } - const v = replaceEqualDeep(aItem, bItem, depth + 1); - copy[key] = v; - if (v === aItem) equalItems++; - } - return aSize === bSize && equalItems === aSize ? a : copy; -} -function shallowEqualObjects(a, b) { - if (!b || Object.keys(a).length !== Object.keys(b).length) { - return false; - } - for (const key in a) { - if (a[key] !== b[key]) { - return false; - } - } - return true; -} -function isPlainArray(value) { - return Array.isArray(value) && value.length === Object.keys(value).length; -} -function isPlainObject(o) { - if (!hasObjectPrototype(o)) { - return false; - } - const ctor = o.constructor; - if (ctor === void 0) { - return true; - } - const prot = ctor.prototype; - if (!hasObjectPrototype(prot)) { - return false; - } - if (!prot.hasOwnProperty("isPrototypeOf")) { - return false; - } - if (Object.getPrototypeOf(o) !== Object.prototype) { - return false; - } - return true; -} -function hasObjectPrototype(o) { - return Object.prototype.toString.call(o) === "[object Object]"; -} -function sleep(timeout) { - return new Promise((resolve) => { - timeoutManager.setTimeout(resolve, timeout); - }); -} -function replaceData(prevData, data, options) { - if (typeof options.structuralSharing === "function") { - return options.structuralSharing(prevData, data); - } else if (options.structuralSharing !== false) { - if (true) { - try { - return replaceEqualDeep(prevData, data); - } catch (error) { - console.error( - `Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${options.queryHash}]: ${error}` - ); - throw error; - } - } - return replaceEqualDeep(prevData, data); - } - return data; -} -function keepPreviousData(previousData) { - return previousData; -} -function addToEnd(items, item, max = 0) { - const newItems = [...items, item]; - return max && newItems.length > max ? newItems.slice(1) : newItems; -} -function addToStart(items, item, max = 0) { - const newItems = [item, ...items]; - return max && newItems.length > max ? newItems.slice(0, -1) : newItems; -} -var skipToken = /* @__PURE__ */ Symbol(); -function ensureQueryFn(options, fetchOptions) { - if (true) { - if (options.queryFn === skipToken) { - console.error( - `Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${options.queryHash}'` - ); - } - } - if (!options.queryFn && fetchOptions?.initialPromise) { - return () => fetchOptions.initialPromise; - } - if (!options.queryFn || options.queryFn === skipToken) { - return () => Promise.reject(new Error(`Missing queryFn: '${options.queryHash}'`)); - } - return options.queryFn; -} -function shouldThrowError(throwOnError, params) { - if (typeof throwOnError === "function") { - return throwOnError(...params); - } - return !!throwOnError; -} -function addConsumeAwareSignal(object, getSignal, onCancelled) { - let consumed = false; - let signal; - Object.defineProperty(object, "signal", { - enumerable: true, - get: () => { - signal ??= getSignal(); - if (consumed) { - return signal; - } - consumed = true; - if (signal.aborted) { - onCancelled(); - } else { - signal.addEventListener("abort", onCancelled, { once: true }); - } - return signal; - } - }); - return object; -} - -// ../../../../node_modules/.bun/@tanstack+query-core@5.90.20/node_modules/@tanstack/query-core/build/modern/focusManager.js -var FocusManager = class extends Subscribable { - #focused; - #cleanup; - #setup; - constructor() { - super(); - this.#setup = (onFocus) => { - if (!isServer && window.addEventListener) { - const listener = () => onFocus(); - window.addEventListener("visibilitychange", listener, false); - return () => { - window.removeEventListener("visibilitychange", listener); - }; - } - return; - }; - } - onSubscribe() { - if (!this.#cleanup) { - this.setEventListener(this.#setup); - } - } - onUnsubscribe() { - if (!this.hasListeners()) { - this.#cleanup?.(); - this.#cleanup = void 0; - } - } - setEventListener(setup) { - this.#setup = setup; - this.#cleanup?.(); - this.#cleanup = setup((focused) => { - if (typeof focused === "boolean") { - this.setFocused(focused); - } else { - this.onFocus(); - } - }); - } - setFocused(focused) { - const changed = this.#focused !== focused; - if (changed) { - this.#focused = focused; - this.onFocus(); - } - } - onFocus() { - const isFocused = this.isFocused(); - this.listeners.forEach((listener) => { - listener(isFocused); - }); - } - isFocused() { - if (typeof this.#focused === "boolean") { - return this.#focused; - } - return globalThis.document?.visibilityState !== "hidden"; - } -}; -var focusManager = new FocusManager(); - -// ../../../../node_modules/.bun/@tanstack+query-core@5.90.20/node_modules/@tanstack/query-core/build/modern/thenable.js -function pendingThenable() { - let resolve; - let reject; - const thenable = new Promise((_resolve, _reject) => { - resolve = _resolve; - reject = _reject; - }); - thenable.status = "pending"; - thenable.catch(() => { - }); - function finalize(data) { - Object.assign(thenable, data); - delete thenable.resolve; - delete thenable.reject; - } - thenable.resolve = (value) => { - finalize({ - status: "fulfilled", - value - }); - resolve(value); - }; - thenable.reject = (reason) => { - finalize({ - status: "rejected", - reason - }); - reject(reason); - }; - return thenable; -} -function tryResolveSync(promise) { - let data; - promise.then((result) => { - data = result; - return result; - }, noop)?.catch(noop); - if (data !== void 0) { - return { data }; - } - return void 0; -} - -// ../../../../node_modules/.bun/@tanstack+query-core@5.90.20/node_modules/@tanstack/query-core/build/modern/hydration.js -function defaultTransformerFn(data) { - return data; -} -function dehydrateMutation(mutation) { - return { - mutationKey: mutation.options.mutationKey, - state: mutation.state, - ...mutation.options.scope && { scope: mutation.options.scope }, - ...mutation.meta && { meta: mutation.meta } - }; -} -function dehydrateQuery(query, serializeData, shouldRedactErrors) { - const dehydratePromise = () => { - const promise = query.promise?.then(serializeData).catch((error) => { - if (!shouldRedactErrors(error)) { - return Promise.reject(error); - } - if (true) { - console.error( - `A query that was dehydrated as pending ended up rejecting. [${query.queryHash}]: ${error}; The error will be redacted in production builds` - ); - } - return Promise.reject(new Error("redacted")); - }); - promise?.catch(noop); - return promise; - }; - return { - dehydratedAt: Date.now(), - state: { - ...query.state, - ...query.state.data !== void 0 && { - data: serializeData(query.state.data) - } - }, - queryKey: query.queryKey, - queryHash: query.queryHash, - ...query.state.status === "pending" && { - promise: dehydratePromise() - }, - ...query.meta && { meta: query.meta } - }; -} -function defaultShouldDehydrateMutation(mutation) { - return mutation.state.isPaused; -} -function defaultShouldDehydrateQuery(query) { - return query.state.status === "success"; -} -function defaultShouldRedactErrors(_) { - return true; -} -function dehydrate(client, options = {}) { - const filterMutation = options.shouldDehydrateMutation ?? client.getDefaultOptions().dehydrate?.shouldDehydrateMutation ?? defaultShouldDehydrateMutation; - const mutations = client.getMutationCache().getAll().flatMap( - (mutation) => filterMutation(mutation) ? [dehydrateMutation(mutation)] : [] - ); - const filterQuery = options.shouldDehydrateQuery ?? client.getDefaultOptions().dehydrate?.shouldDehydrateQuery ?? defaultShouldDehydrateQuery; - const shouldRedactErrors = options.shouldRedactErrors ?? client.getDefaultOptions().dehydrate?.shouldRedactErrors ?? defaultShouldRedactErrors; - const serializeData = options.serializeData ?? client.getDefaultOptions().dehydrate?.serializeData ?? defaultTransformerFn; - const queries = client.getQueryCache().getAll().flatMap( - (query) => filterQuery(query) ? [dehydrateQuery(query, serializeData, shouldRedactErrors)] : [] - ); - return { mutations, queries }; -} -function hydrate(client, dehydratedState, options) { - if (typeof dehydratedState !== "object" || dehydratedState === null) { - return; - } - const mutationCache = client.getMutationCache(); - const queryCache = client.getQueryCache(); - const deserializeData = options?.defaultOptions?.deserializeData ?? client.getDefaultOptions().hydrate?.deserializeData ?? defaultTransformerFn; - const mutations = dehydratedState.mutations || []; - const queries = dehydratedState.queries || []; - mutations.forEach(({ state, ...mutationOptions2 }) => { - mutationCache.build( - client, - { - ...client.getDefaultOptions().hydrate?.mutations, - ...options?.defaultOptions?.mutations, - ...mutationOptions2 - }, - state - ); - }); - queries.forEach( - ({ queryKey, state, queryHash, meta, promise, dehydratedAt }) => { - const syncData = promise ? tryResolveSync(promise) : void 0; - const rawData = state.data === void 0 ? syncData?.data : state.data; - const data = rawData === void 0 ? rawData : deserializeData(rawData); - let query = queryCache.get(queryHash); - const existingQueryIsPending = query?.state.status === "pending"; - const existingQueryIsFetching = query?.state.fetchStatus === "fetching"; - if (query) { - const hasNewerSyncData = syncData && // We only need this undefined check to handle older dehydration - // payloads that might not have dehydratedAt - dehydratedAt !== void 0 && dehydratedAt > query.state.dataUpdatedAt; - if (state.dataUpdatedAt > query.state.dataUpdatedAt || hasNewerSyncData) { - const { fetchStatus: _ignored, ...serializedState } = state; - query.setState({ - ...serializedState, - data - }); - } - } else { - query = queryCache.build( - client, - { - ...client.getDefaultOptions().hydrate?.queries, - ...options?.defaultOptions?.queries, - queryKey, - queryHash, - meta - }, - // Reset fetch status to idle to avoid - // query being stuck in fetching state upon hydration - { - ...state, - data, - fetchStatus: "idle", - status: data !== void 0 ? "success" : state.status - } - ); - } - if (promise && !existingQueryIsPending && !existingQueryIsFetching && // Only hydrate if dehydration is newer than any existing data, - // this is always true for new queries - (dehydratedAt === void 0 || dehydratedAt > query.state.dataUpdatedAt)) { - query.fetch(void 0, { - // RSC transformed promises are not thenable - initialPromise: Promise.resolve(promise).then(deserializeData) - }).catch(noop); - } - } - ); -} - -// ../../../../node_modules/.bun/@tanstack+query-core@5.90.20/node_modules/@tanstack/query-core/build/modern/notifyManager.js -var defaultScheduler = systemSetTimeoutZero; -function createNotifyManager() { - let queue = []; - let transactions = 0; - let notifyFn = (callback) => { - callback(); - }; - let batchNotifyFn = (callback) => { - callback(); - }; - let scheduleFn = defaultScheduler; - const schedule = (callback) => { - if (transactions) { - queue.push(callback); - } else { - scheduleFn(() => { - notifyFn(callback); - }); - } - }; - const flush = () => { - const originalQueue = queue; - queue = []; - if (originalQueue.length) { - scheduleFn(() => { - batchNotifyFn(() => { - originalQueue.forEach((callback) => { - notifyFn(callback); - }); - }); - }); - } - }; - return { - batch: (callback) => { - let result; - transactions++; - try { - result = callback(); - } finally { - transactions--; - if (!transactions) { - flush(); - } - } - return result; - }, - /** - * All calls to the wrapped function will be batched. - */ - batchCalls: (callback) => { - return (...args) => { - schedule(() => { - callback(...args); - }); - }; - }, - schedule, - /** - * Use this method to set a custom notify function. - * This can be used to for example wrap notifications with `React.act` while running tests. - */ - setNotifyFunction: (fn) => { - notifyFn = fn; - }, - /** - * Use this method to set a custom function to batch notifications together into a single tick. - * By default React Query will use the batch function provided by ReactDOM or React Native. - */ - setBatchNotifyFunction: (fn) => { - batchNotifyFn = fn; - }, - setScheduler: (fn) => { - scheduleFn = fn; - } - }; -} -var notifyManager = createNotifyManager(); - -// ../../../../node_modules/.bun/@tanstack+query-core@5.90.20/node_modules/@tanstack/query-core/build/modern/onlineManager.js -var OnlineManager = class extends Subscribable { - #online = true; - #cleanup; - #setup; - constructor() { - super(); - this.#setup = (onOnline) => { - if (!isServer && window.addEventListener) { - const onlineListener = () => onOnline(true); - const offlineListener = () => onOnline(false); - window.addEventListener("online", onlineListener, false); - window.addEventListener("offline", offlineListener, false); - return () => { - window.removeEventListener("online", onlineListener); - window.removeEventListener("offline", offlineListener); - }; - } - return; - }; - } - onSubscribe() { - if (!this.#cleanup) { - this.setEventListener(this.#setup); - } - } - onUnsubscribe() { - if (!this.hasListeners()) { - this.#cleanup?.(); - this.#cleanup = void 0; - } - } - setEventListener(setup) { - this.#setup = setup; - this.#cleanup?.(); - this.#cleanup = setup(this.setOnline.bind(this)); - } - setOnline(online) { - const changed = this.#online !== online; - if (changed) { - this.#online = online; - this.listeners.forEach((listener) => { - listener(online); - }); - } - } - isOnline() { - return this.#online; - } -}; -var onlineManager = new OnlineManager(); - -// ../../../../node_modules/.bun/@tanstack+query-core@5.90.20/node_modules/@tanstack/query-core/build/modern/retryer.js -function defaultRetryDelay(failureCount) { - return Math.min(1e3 * 2 ** failureCount, 3e4); -} -function canFetch(networkMode) { - return (networkMode ?? "online") === "online" ? onlineManager.isOnline() : true; -} -var CancelledError = class extends Error { - constructor(options) { - super("CancelledError"); - this.revert = options?.revert; - this.silent = options?.silent; - } -}; -function isCancelledError(value) { - return value instanceof CancelledError; -} -function createRetryer(config) { - let isRetryCancelled = false; - let failureCount = 0; - let continueFn; - const thenable = pendingThenable(); - const isResolved = () => thenable.status !== "pending"; - const cancel = (cancelOptions) => { - if (!isResolved()) { - const error = new CancelledError(cancelOptions); - reject(error); - config.onCancel?.(error); - } - }; - const cancelRetry = () => { - isRetryCancelled = true; - }; - const continueRetry = () => { - isRetryCancelled = false; - }; - const canContinue = () => focusManager.isFocused() && (config.networkMode === "always" || onlineManager.isOnline()) && config.canRun(); - const canStart = () => canFetch(config.networkMode) && config.canRun(); - const resolve = (value) => { - if (!isResolved()) { - continueFn?.(); - thenable.resolve(value); - } - }; - const reject = (value) => { - if (!isResolved()) { - continueFn?.(); - thenable.reject(value); - } - }; - const pause = () => { - return new Promise((continueResolve) => { - continueFn = (value) => { - if (isResolved() || canContinue()) { - continueResolve(value); - } - }; - config.onPause?.(); - }).then(() => { - continueFn = void 0; - if (!isResolved()) { - config.onContinue?.(); - } - }); - }; - const run = () => { - if (isResolved()) { - return; - } - let promiseOrValue; - const initialPromise = failureCount === 0 ? config.initialPromise : void 0; - try { - promiseOrValue = initialPromise ?? config.fn(); - } catch (error) { - promiseOrValue = Promise.reject(error); - } - Promise.resolve(promiseOrValue).then(resolve).catch((error) => { - if (isResolved()) { - return; - } - const retry = config.retry ?? (isServer ? 0 : 3); - const retryDelay = config.retryDelay ?? defaultRetryDelay; - const delay = typeof retryDelay === "function" ? retryDelay(failureCount, error) : retryDelay; - const shouldRetry = retry === true || typeof retry === "number" && failureCount < retry || typeof retry === "function" && retry(failureCount, error); - if (isRetryCancelled || !shouldRetry) { - reject(error); - return; - } - failureCount++; - config.onFail?.(failureCount, error); - sleep(delay).then(() => { - return canContinue() ? void 0 : pause(); - }).then(() => { - if (isRetryCancelled) { - reject(error); - } else { - run(); - } - }); - }); - }; - return { - promise: thenable, - status: () => thenable.status, - cancel, - continue: () => { - continueFn?.(); - return thenable; - }, - cancelRetry, - continueRetry, - canStart, - start: () => { - if (canStart()) { - run(); - } else { - pause().then(run); - } - return thenable; - } - }; -} - -// ../../../../node_modules/.bun/@tanstack+query-core@5.90.20/node_modules/@tanstack/query-core/build/modern/removable.js -var Removable = class { - #gcTimeout; - destroy() { - this.clearGcTimeout(); - } - scheduleGc() { - this.clearGcTimeout(); - if (isValidTimeout(this.gcTime)) { - this.#gcTimeout = timeoutManager.setTimeout(() => { - this.optionalRemove(); - }, this.gcTime); - } - } - updateGcTime(newGcTime) { - this.gcTime = Math.max( - this.gcTime || 0, - newGcTime ?? (isServer ? Infinity : 5 * 60 * 1e3) - ); - } - clearGcTimeout() { - if (this.#gcTimeout) { - timeoutManager.clearTimeout(this.#gcTimeout); - this.#gcTimeout = void 0; - } - } -}; - -// ../../../../node_modules/.bun/@tanstack+query-core@5.90.20/node_modules/@tanstack/query-core/build/modern/query.js -var Query = class extends Removable { - #initialState; - #revertState; - #cache; - #client; - #retryer; - #defaultOptions; - #abortSignalConsumed; - constructor(config) { - super(); - this.#abortSignalConsumed = false; - this.#defaultOptions = config.defaultOptions; - this.setOptions(config.options); - this.observers = []; - this.#client = config.client; - this.#cache = this.#client.getQueryCache(); - this.queryKey = config.queryKey; - this.queryHash = config.queryHash; - this.#initialState = getDefaultState(this.options); - this.state = config.state ?? this.#initialState; - this.scheduleGc(); - } - get meta() { - return this.options.meta; - } - get promise() { - return this.#retryer?.promise; - } - setOptions(options) { - this.options = { ...this.#defaultOptions, ...options }; - this.updateGcTime(this.options.gcTime); - if (this.state && this.state.data === void 0) { - const defaultState = getDefaultState(this.options); - if (defaultState.data !== void 0) { - this.setState( - successState(defaultState.data, defaultState.dataUpdatedAt) - ); - this.#initialState = defaultState; - } - } - } - optionalRemove() { - if (!this.observers.length && this.state.fetchStatus === "idle") { - this.#cache.remove(this); - } - } - setData(newData, options) { - const data = replaceData(this.state.data, newData, this.options); - this.#dispatch({ - data, - type: "success", - dataUpdatedAt: options?.updatedAt, - manual: options?.manual - }); - return data; - } - setState(state, setStateOptions) { - this.#dispatch({ type: "setState", state, setStateOptions }); - } - cancel(options) { - const promise = this.#retryer?.promise; - this.#retryer?.cancel(options); - return promise ? promise.then(noop).catch(noop) : Promise.resolve(); - } - destroy() { - super.destroy(); - this.cancel({ silent: true }); - } - reset() { - this.destroy(); - this.setState(this.#initialState); - } - isActive() { - return this.observers.some( - (observer) => resolveEnabled(observer.options.enabled, this) !== false - ); - } - isDisabled() { - if (this.getObserversCount() > 0) { - return !this.isActive(); - } - return this.options.queryFn === skipToken || this.state.dataUpdateCount + this.state.errorUpdateCount === 0; - } - isStatic() { - if (this.getObserversCount() > 0) { - return this.observers.some( - (observer) => resolveStaleTime(observer.options.staleTime, this) === "static" - ); - } - return false; - } - isStale() { - if (this.getObserversCount() > 0) { - return this.observers.some( - (observer) => observer.getCurrentResult().isStale - ); - } - return this.state.data === void 0 || this.state.isInvalidated; - } - isStaleByTime(staleTime = 0) { - if (this.state.data === void 0) { - return true; - } - if (staleTime === "static") { - return false; - } - if (this.state.isInvalidated) { - return true; - } - return !timeUntilStale(this.state.dataUpdatedAt, staleTime); - } - onFocus() { - const observer = this.observers.find((x) => x.shouldFetchOnWindowFocus()); - observer?.refetch({ cancelRefetch: false }); - this.#retryer?.continue(); - } - onOnline() { - const observer = this.observers.find((x) => x.shouldFetchOnReconnect()); - observer?.refetch({ cancelRefetch: false }); - this.#retryer?.continue(); - } - addObserver(observer) { - if (!this.observers.includes(observer)) { - this.observers.push(observer); - this.clearGcTimeout(); - this.#cache.notify({ type: "observerAdded", query: this, observer }); - } - } - removeObserver(observer) { - if (this.observers.includes(observer)) { - this.observers = this.observers.filter((x) => x !== observer); - if (!this.observers.length) { - if (this.#retryer) { - if (this.#abortSignalConsumed) { - this.#retryer.cancel({ revert: true }); - } else { - this.#retryer.cancelRetry(); - } - } - this.scheduleGc(); - } - this.#cache.notify({ type: "observerRemoved", query: this, observer }); - } - } - getObserversCount() { - return this.observers.length; - } - invalidate() { - if (!this.state.isInvalidated) { - this.#dispatch({ type: "invalidate" }); - } - } - async fetch(options, fetchOptions) { - if (this.state.fetchStatus !== "idle" && // If the promise in the retryer is already rejected, we have to definitely - // re-start the fetch; there is a chance that the query is still in a - // pending state when that happens - this.#retryer?.status() !== "rejected") { - if (this.state.data !== void 0 && fetchOptions?.cancelRefetch) { - this.cancel({ silent: true }); - } else if (this.#retryer) { - this.#retryer.continueRetry(); - return this.#retryer.promise; - } - } - if (options) { - this.setOptions(options); - } - if (!this.options.queryFn) { - const observer = this.observers.find((x) => x.options.queryFn); - if (observer) { - this.setOptions(observer.options); - } - } - if (true) { - if (!Array.isArray(this.options.queryKey)) { - console.error( - `As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']` - ); - } - } - const abortController = new AbortController(); - const addSignalProperty = (object) => { - Object.defineProperty(object, "signal", { - enumerable: true, - get: () => { - this.#abortSignalConsumed = true; - return abortController.signal; - } - }); - }; - const fetchFn = () => { - const queryFn = ensureQueryFn(this.options, fetchOptions); - const createQueryFnContext = () => { - const queryFnContext2 = { - client: this.#client, - queryKey: this.queryKey, - meta: this.meta - }; - addSignalProperty(queryFnContext2); - return queryFnContext2; - }; - const queryFnContext = createQueryFnContext(); - this.#abortSignalConsumed = false; - if (this.options.persister) { - return this.options.persister( - queryFn, - queryFnContext, - this - ); - } - return queryFn(queryFnContext); - }; - const createFetchContext = () => { - const context2 = { - fetchOptions, - options: this.options, - queryKey: this.queryKey, - client: this.#client, - state: this.state, - fetchFn - }; - addSignalProperty(context2); - return context2; - }; - const context = createFetchContext(); - this.options.behavior?.onFetch(context, this); - this.#revertState = this.state; - if (this.state.fetchStatus === "idle" || this.state.fetchMeta !== context.fetchOptions?.meta) { - this.#dispatch({ type: "fetch", meta: context.fetchOptions?.meta }); - } - this.#retryer = createRetryer({ - initialPromise: fetchOptions?.initialPromise, - fn: context.fetchFn, - onCancel: (error) => { - if (error instanceof CancelledError && error.revert) { - this.setState({ - ...this.#revertState, - fetchStatus: "idle" - }); - } - abortController.abort(); - }, - onFail: (failureCount, error) => { - this.#dispatch({ type: "failed", failureCount, error }); - }, - onPause: () => { - this.#dispatch({ type: "pause" }); - }, - onContinue: () => { - this.#dispatch({ type: "continue" }); - }, - retry: context.options.retry, - retryDelay: context.options.retryDelay, - networkMode: context.options.networkMode, - canRun: () => true - }); - try { - const data = await this.#retryer.start(); - if (data === void 0) { - if (true) { - console.error( - `Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}` - ); - } - throw new Error(`${this.queryHash} data is undefined`); - } - this.setData(data); - this.#cache.config.onSuccess?.(data, this); - this.#cache.config.onSettled?.( - data, - this.state.error, - this - ); - return data; - } catch (error) { - if (error instanceof CancelledError) { - if (error.silent) { - return this.#retryer.promise; - } else if (error.revert) { - if (this.state.data === void 0) { - throw error; - } - return this.state.data; - } - } - this.#dispatch({ - type: "error", - error - }); - this.#cache.config.onError?.( - error, - this - ); - this.#cache.config.onSettled?.( - this.state.data, - error, - this - ); - throw error; - } finally { - this.scheduleGc(); - } - } - #dispatch(action) { - const reducer = (state) => { - switch (action.type) { - case "failed": - return { - ...state, - fetchFailureCount: action.failureCount, - fetchFailureReason: action.error - }; - case "pause": - return { - ...state, - fetchStatus: "paused" - }; - case "continue": - return { - ...state, - fetchStatus: "fetching" - }; - case "fetch": - return { - ...state, - ...fetchState(state.data, this.options), - fetchMeta: action.meta ?? null - }; - case "success": - const newState = { - ...state, - ...successState(action.data, action.dataUpdatedAt), - dataUpdateCount: state.dataUpdateCount + 1, - ...!action.manual && { - fetchStatus: "idle", - fetchFailureCount: 0, - fetchFailureReason: null - } - }; - this.#revertState = action.manual ? newState : void 0; - return newState; - case "error": - const error = action.error; - return { - ...state, - error, - errorUpdateCount: state.errorUpdateCount + 1, - errorUpdatedAt: Date.now(), - fetchFailureCount: state.fetchFailureCount + 1, - fetchFailureReason: error, - fetchStatus: "idle", - status: "error", - // flag existing data as invalidated if we get a background error - // note that "no data" always means stale so we can set unconditionally here - isInvalidated: true - }; - case "invalidate": - return { - ...state, - isInvalidated: true - }; - case "setState": - return { - ...state, - ...action.state - }; - } - }; - this.state = reducer(this.state); - notifyManager.batch(() => { - this.observers.forEach((observer) => { - observer.onQueryUpdate(); - }); - this.#cache.notify({ query: this, type: "updated", action }); - }); - } -}; -function fetchState(data, options) { - return { - fetchFailureCount: 0, - fetchFailureReason: null, - fetchStatus: canFetch(options.networkMode) ? "fetching" : "paused", - ...data === void 0 && { - error: null, - status: "pending" - } - }; -} -function successState(data, dataUpdatedAt) { - return { - data, - dataUpdatedAt: dataUpdatedAt ?? Date.now(), - error: null, - isInvalidated: false, - status: "success" - }; -} -function getDefaultState(options) { - const data = typeof options.initialData === "function" ? options.initialData() : options.initialData; - const hasData = data !== void 0; - const initialDataUpdatedAt = hasData ? typeof options.initialDataUpdatedAt === "function" ? options.initialDataUpdatedAt() : options.initialDataUpdatedAt : 0; - return { - data, - dataUpdateCount: 0, - dataUpdatedAt: hasData ? initialDataUpdatedAt ?? Date.now() : 0, - error: null, - errorUpdateCount: 0, - errorUpdatedAt: 0, - fetchFailureCount: 0, - fetchFailureReason: null, - fetchMeta: null, - isInvalidated: false, - status: hasData ? "success" : "pending", - fetchStatus: "idle" - }; -} - -// ../../../../node_modules/.bun/@tanstack+query-core@5.90.20/node_modules/@tanstack/query-core/build/modern/queryObserver.js -var QueryObserver = class extends Subscribable { - constructor(client, options) { - super(); - this.options = options; - this.#client = client; - this.#selectError = null; - this.#currentThenable = pendingThenable(); - this.bindMethods(); - this.setOptions(options); - } - #client; - #currentQuery = void 0; - #currentQueryInitialState = void 0; - #currentResult = void 0; - #currentResultState; - #currentResultOptions; - #currentThenable; - #selectError; - #selectFn; - #selectResult; - // This property keeps track of the last query with defined data. - // It will be used to pass the previous data and query to the placeholder function between renders. - #lastQueryWithDefinedData; - #staleTimeoutId; - #refetchIntervalId; - #currentRefetchInterval; - #trackedProps = /* @__PURE__ */ new Set(); - bindMethods() { - this.refetch = this.refetch.bind(this); - } - onSubscribe() { - if (this.listeners.size === 1) { - this.#currentQuery.addObserver(this); - if (shouldFetchOnMount(this.#currentQuery, this.options)) { - this.#executeFetch(); - } else { - this.updateResult(); - } - this.#updateTimers(); - } - } - onUnsubscribe() { - if (!this.hasListeners()) { - this.destroy(); - } - } - shouldFetchOnReconnect() { - return shouldFetchOn( - this.#currentQuery, - this.options, - this.options.refetchOnReconnect - ); - } - shouldFetchOnWindowFocus() { - return shouldFetchOn( - this.#currentQuery, - this.options, - this.options.refetchOnWindowFocus - ); - } - destroy() { - this.listeners = /* @__PURE__ */ new Set(); - this.#clearStaleTimeout(); - this.#clearRefetchInterval(); - this.#currentQuery.removeObserver(this); - } - setOptions(options) { - const prevOptions = this.options; - const prevQuery = this.#currentQuery; - this.options = this.#client.defaultQueryOptions(options); - if (this.options.enabled !== void 0 && typeof this.options.enabled !== "boolean" && typeof this.options.enabled !== "function" && typeof resolveEnabled(this.options.enabled, this.#currentQuery) !== "boolean") { - throw new Error( - "Expected enabled to be a boolean or a callback that returns a boolean" - ); - } - this.#updateQuery(); - this.#currentQuery.setOptions(this.options); - if (prevOptions._defaulted && !shallowEqualObjects(this.options, prevOptions)) { - this.#client.getQueryCache().notify({ - type: "observerOptionsUpdated", - query: this.#currentQuery, - observer: this - }); - } - const mounted = this.hasListeners(); - if (mounted && shouldFetchOptionally( - this.#currentQuery, - prevQuery, - this.options, - prevOptions - )) { - this.#executeFetch(); - } - this.updateResult(); - if (mounted && (this.#currentQuery !== prevQuery || resolveEnabled(this.options.enabled, this.#currentQuery) !== resolveEnabled(prevOptions.enabled, this.#currentQuery) || resolveStaleTime(this.options.staleTime, this.#currentQuery) !== resolveStaleTime(prevOptions.staleTime, this.#currentQuery))) { - this.#updateStaleTimeout(); - } - const nextRefetchInterval = this.#computeRefetchInterval(); - if (mounted && (this.#currentQuery !== prevQuery || resolveEnabled(this.options.enabled, this.#currentQuery) !== resolveEnabled(prevOptions.enabled, this.#currentQuery) || nextRefetchInterval !== this.#currentRefetchInterval)) { - this.#updateRefetchInterval(nextRefetchInterval); - } - } - getOptimisticResult(options) { - const query = this.#client.getQueryCache().build(this.#client, options); - const result = this.createResult(query, options); - if (shouldAssignObserverCurrentProperties(this, result)) { - this.#currentResult = result; - this.#currentResultOptions = this.options; - this.#currentResultState = this.#currentQuery.state; - } - return result; - } - getCurrentResult() { - return this.#currentResult; - } - trackResult(result, onPropTracked) { - return new Proxy(result, { - get: (target, key) => { - this.trackProp(key); - onPropTracked?.(key); - if (key === "promise") { - this.trackProp("data"); - if (!this.options.experimental_prefetchInRender && this.#currentThenable.status === "pending") { - this.#currentThenable.reject( - new Error( - "experimental_prefetchInRender feature flag is not enabled" - ) - ); - } - } - return Reflect.get(target, key); - } - }); - } - trackProp(key) { - this.#trackedProps.add(key); - } - getCurrentQuery() { - return this.#currentQuery; - } - refetch({ ...options } = {}) { - return this.fetch({ - ...options - }); - } - fetchOptimistic(options) { - const defaultedOptions = this.#client.defaultQueryOptions(options); - const query = this.#client.getQueryCache().build(this.#client, defaultedOptions); - return query.fetch().then(() => this.createResult(query, defaultedOptions)); - } - fetch(fetchOptions) { - return this.#executeFetch({ - ...fetchOptions, - cancelRefetch: fetchOptions.cancelRefetch ?? true - }).then(() => { - this.updateResult(); - return this.#currentResult; - }); - } - #executeFetch(fetchOptions) { - this.#updateQuery(); - let promise = this.#currentQuery.fetch( - this.options, - fetchOptions - ); - if (!fetchOptions?.throwOnError) { - promise = promise.catch(noop); - } - return promise; - } - #updateStaleTimeout() { - this.#clearStaleTimeout(); - const staleTime = resolveStaleTime( - this.options.staleTime, - this.#currentQuery - ); - if (isServer || this.#currentResult.isStale || !isValidTimeout(staleTime)) { - return; - } - const time = timeUntilStale(this.#currentResult.dataUpdatedAt, staleTime); - const timeout = time + 1; - this.#staleTimeoutId = timeoutManager.setTimeout(() => { - if (!this.#currentResult.isStale) { - this.updateResult(); - } - }, timeout); - } - #computeRefetchInterval() { - return (typeof this.options.refetchInterval === "function" ? this.options.refetchInterval(this.#currentQuery) : this.options.refetchInterval) ?? false; - } - #updateRefetchInterval(nextInterval) { - this.#clearRefetchInterval(); - this.#currentRefetchInterval = nextInterval; - if (isServer || resolveEnabled(this.options.enabled, this.#currentQuery) === false || !isValidTimeout(this.#currentRefetchInterval) || this.#currentRefetchInterval === 0) { - return; - } - this.#refetchIntervalId = timeoutManager.setInterval(() => { - if (this.options.refetchIntervalInBackground || focusManager.isFocused()) { - this.#executeFetch(); - } - }, this.#currentRefetchInterval); - } - #updateTimers() { - this.#updateStaleTimeout(); - this.#updateRefetchInterval(this.#computeRefetchInterval()); - } - #clearStaleTimeout() { - if (this.#staleTimeoutId) { - timeoutManager.clearTimeout(this.#staleTimeoutId); - this.#staleTimeoutId = void 0; - } - } - #clearRefetchInterval() { - if (this.#refetchIntervalId) { - timeoutManager.clearInterval(this.#refetchIntervalId); - this.#refetchIntervalId = void 0; - } - } - createResult(query, options) { - const prevQuery = this.#currentQuery; - const prevOptions = this.options; - const prevResult = this.#currentResult; - const prevResultState = this.#currentResultState; - const prevResultOptions = this.#currentResultOptions; - const queryChange = query !== prevQuery; - const queryInitialState = queryChange ? query.state : this.#currentQueryInitialState; - const { state } = query; - let newState = { ...state }; - let isPlaceholderData = false; - let data; - if (options._optimisticResults) { - const mounted = this.hasListeners(); - const fetchOnMount = !mounted && shouldFetchOnMount(query, options); - const fetchOptionally = mounted && shouldFetchOptionally(query, prevQuery, options, prevOptions); - if (fetchOnMount || fetchOptionally) { - newState = { - ...newState, - ...fetchState(state.data, query.options) - }; - } - if (options._optimisticResults === "isRestoring") { - newState.fetchStatus = "idle"; - } - } - let { error, errorUpdatedAt, status } = newState; - data = newState.data; - let skipSelect = false; - if (options.placeholderData !== void 0 && data === void 0 && status === "pending") { - let placeholderData; - if (prevResult?.isPlaceholderData && options.placeholderData === prevResultOptions?.placeholderData) { - placeholderData = prevResult.data; - skipSelect = true; - } else { - placeholderData = typeof options.placeholderData === "function" ? options.placeholderData( - this.#lastQueryWithDefinedData?.state.data, - this.#lastQueryWithDefinedData - ) : options.placeholderData; - } - if (placeholderData !== void 0) { - status = "success"; - data = replaceData( - prevResult?.data, - placeholderData, - options - ); - isPlaceholderData = true; - } - } - if (options.select && data !== void 0 && !skipSelect) { - if (prevResult && data === prevResultState?.data && options.select === this.#selectFn) { - data = this.#selectResult; - } else { - try { - this.#selectFn = options.select; - data = options.select(data); - data = replaceData(prevResult?.data, data, options); - this.#selectResult = data; - this.#selectError = null; - } catch (selectError) { - this.#selectError = selectError; - } - } - } - if (this.#selectError) { - error = this.#selectError; - data = this.#selectResult; - errorUpdatedAt = Date.now(); - status = "error"; - } - const isFetching = newState.fetchStatus === "fetching"; - const isPending = status === "pending"; - const isError = status === "error"; - const isLoading = isPending && isFetching; - const hasData = data !== void 0; - const result = { - status, - fetchStatus: newState.fetchStatus, - isPending, - isSuccess: status === "success", - isError, - isInitialLoading: isLoading, - isLoading, - data, - dataUpdatedAt: newState.dataUpdatedAt, - error, - errorUpdatedAt, - failureCount: newState.fetchFailureCount, - failureReason: newState.fetchFailureReason, - errorUpdateCount: newState.errorUpdateCount, - isFetched: newState.dataUpdateCount > 0 || newState.errorUpdateCount > 0, - isFetchedAfterMount: newState.dataUpdateCount > queryInitialState.dataUpdateCount || newState.errorUpdateCount > queryInitialState.errorUpdateCount, - isFetching, - isRefetching: isFetching && !isPending, - isLoadingError: isError && !hasData, - isPaused: newState.fetchStatus === "paused", - isPlaceholderData, - isRefetchError: isError && hasData, - isStale: isStale(query, options), - refetch: this.refetch, - promise: this.#currentThenable, - isEnabled: resolveEnabled(options.enabled, query) !== false - }; - const nextResult = result; - if (this.options.experimental_prefetchInRender) { - const hasResultData = nextResult.data !== void 0; - const isErrorWithoutData = nextResult.status === "error" && !hasResultData; - const finalizeThenableIfPossible = (thenable) => { - if (isErrorWithoutData) { - thenable.reject(nextResult.error); - } else if (hasResultData) { - thenable.resolve(nextResult.data); - } - }; - const recreateThenable = () => { - const pending = this.#currentThenable = nextResult.promise = pendingThenable(); - finalizeThenableIfPossible(pending); - }; - const prevThenable = this.#currentThenable; - switch (prevThenable.status) { - case "pending": - if (query.queryHash === prevQuery.queryHash) { - finalizeThenableIfPossible(prevThenable); - } - break; - case "fulfilled": - if (isErrorWithoutData || nextResult.data !== prevThenable.value) { - recreateThenable(); - } - break; - case "rejected": - if (!isErrorWithoutData || nextResult.error !== prevThenable.reason) { - recreateThenable(); - } - break; - } - } - return nextResult; - } - updateResult() { - const prevResult = this.#currentResult; - const nextResult = this.createResult(this.#currentQuery, this.options); - this.#currentResultState = this.#currentQuery.state; - this.#currentResultOptions = this.options; - if (this.#currentResultState.data !== void 0) { - this.#lastQueryWithDefinedData = this.#currentQuery; - } - if (shallowEqualObjects(nextResult, prevResult)) { - return; - } - this.#currentResult = nextResult; - const shouldNotifyListeners = () => { - if (!prevResult) { - return true; - } - const { notifyOnChangeProps } = this.options; - const notifyOnChangePropsValue = typeof notifyOnChangeProps === "function" ? notifyOnChangeProps() : notifyOnChangeProps; - if (notifyOnChangePropsValue === "all" || !notifyOnChangePropsValue && !this.#trackedProps.size) { - return true; - } - const includedProps = new Set( - notifyOnChangePropsValue ?? this.#trackedProps - ); - if (this.options.throwOnError) { - includedProps.add("error"); - } - return Object.keys(this.#currentResult).some((key) => { - const typedKey = key; - const changed = this.#currentResult[typedKey] !== prevResult[typedKey]; - return changed && includedProps.has(typedKey); - }); - }; - this.#notify({ listeners: shouldNotifyListeners() }); - } - #updateQuery() { - const query = this.#client.getQueryCache().build(this.#client, this.options); - if (query === this.#currentQuery) { - return; - } - const prevQuery = this.#currentQuery; - this.#currentQuery = query; - this.#currentQueryInitialState = query.state; - if (this.hasListeners()) { - prevQuery?.removeObserver(this); - query.addObserver(this); - } - } - onQueryUpdate() { - this.updateResult(); - if (this.hasListeners()) { - this.#updateTimers(); - } - } - #notify(notifyOptions) { - notifyManager.batch(() => { - if (notifyOptions.listeners) { - this.listeners.forEach((listener) => { - listener(this.#currentResult); - }); - } - this.#client.getQueryCache().notify({ - query: this.#currentQuery, - type: "observerResultsUpdated" - }); - }); - } -}; -function shouldLoadOnMount(query, options) { - return resolveEnabled(options.enabled, query) !== false && query.state.data === void 0 && !(query.state.status === "error" && options.retryOnMount === false); -} -function shouldFetchOnMount(query, options) { - return shouldLoadOnMount(query, options) || query.state.data !== void 0 && shouldFetchOn(query, options, options.refetchOnMount); -} -function shouldFetchOn(query, options, field) { - if (resolveEnabled(options.enabled, query) !== false && resolveStaleTime(options.staleTime, query) !== "static") { - const value = typeof field === "function" ? field(query) : field; - return value === "always" || value !== false && isStale(query, options); - } - return false; -} -function shouldFetchOptionally(query, prevQuery, options, prevOptions) { - return (query !== prevQuery || resolveEnabled(prevOptions.enabled, query) === false) && (!options.suspense || query.state.status !== "error") && isStale(query, options); -} -function isStale(query, options) { - return resolveEnabled(options.enabled, query) !== false && query.isStaleByTime(resolveStaleTime(options.staleTime, query)); -} -function shouldAssignObserverCurrentProperties(observer, optimisticResult) { - if (!shallowEqualObjects(observer.getCurrentResult(), optimisticResult)) { - return true; - } - return false; -} - -// ../../../../node_modules/.bun/@tanstack+query-core@5.90.20/node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.js -function infiniteQueryBehavior(pages) { - return { - onFetch: (context, query) => { - const options = context.options; - const direction = context.fetchOptions?.meta?.fetchMore?.direction; - const oldPages = context.state.data?.pages || []; - const oldPageParams = context.state.data?.pageParams || []; - let result = { pages: [], pageParams: [] }; - let currentPage = 0; - const fetchFn = async () => { - let cancelled = false; - const addSignalProperty = (object) => { - addConsumeAwareSignal( - object, - () => context.signal, - () => cancelled = true - ); - }; - const queryFn = ensureQueryFn(context.options, context.fetchOptions); - const fetchPage = async (data, param, previous) => { - if (cancelled) { - return Promise.reject(); - } - if (param == null && data.pages.length) { - return Promise.resolve(data); - } - const createQueryFnContext = () => { - const queryFnContext2 = { - client: context.client, - queryKey: context.queryKey, - pageParam: param, - direction: previous ? "backward" : "forward", - meta: context.options.meta - }; - addSignalProperty(queryFnContext2); - return queryFnContext2; - }; - const queryFnContext = createQueryFnContext(); - const page = await queryFn(queryFnContext); - const { maxPages } = context.options; - const addTo = previous ? addToStart : addToEnd; - return { - pages: addTo(data.pages, page, maxPages), - pageParams: addTo(data.pageParams, param, maxPages) - }; - }; - if (direction && oldPages.length) { - const previous = direction === "backward"; - const pageParamFn = previous ? getPreviousPageParam : getNextPageParam; - const oldData = { - pages: oldPages, - pageParams: oldPageParams - }; - const param = pageParamFn(options, oldData); - result = await fetchPage(oldData, param, previous); - } else { - const remainingPages = pages ?? oldPages.length; - do { - const param = currentPage === 0 ? oldPageParams[0] ?? options.initialPageParam : getNextPageParam(options, result); - if (currentPage > 0 && param == null) { - break; - } - result = await fetchPage(result, param); - currentPage++; - } while (currentPage < remainingPages); - } - return result; - }; - if (context.options.persister) { - context.fetchFn = () => { - return context.options.persister?.( - fetchFn, - { - client: context.client, - queryKey: context.queryKey, - meta: context.options.meta, - signal: context.signal - }, - query - ); - }; - } else { - context.fetchFn = fetchFn; - } - } - }; -} -function getNextPageParam(options, { pages, pageParams }) { - const lastIndex = pages.length - 1; - return pages.length > 0 ? options.getNextPageParam( - pages[lastIndex], - pages, - pageParams[lastIndex], - pageParams - ) : void 0; -} -function getPreviousPageParam(options, { pages, pageParams }) { - return pages.length > 0 ? options.getPreviousPageParam?.(pages[0], pages, pageParams[0], pageParams) : void 0; -} -function hasNextPage(options, data) { - if (!data) return false; - return getNextPageParam(options, data) != null; -} -function hasPreviousPage(options, data) { - if (!data || !options.getPreviousPageParam) return false; - return getPreviousPageParam(options, data) != null; -} - -// ../../../../node_modules/.bun/@tanstack+query-core@5.90.20/node_modules/@tanstack/query-core/build/modern/infiniteQueryObserver.js -var InfiniteQueryObserver = class extends QueryObserver { - constructor(client, options) { - super(client, options); - } - bindMethods() { - super.bindMethods(); - this.fetchNextPage = this.fetchNextPage.bind(this); - this.fetchPreviousPage = this.fetchPreviousPage.bind(this); - } - setOptions(options) { - super.setOptions({ - ...options, - behavior: infiniteQueryBehavior() - }); - } - getOptimisticResult(options) { - options.behavior = infiniteQueryBehavior(); - return super.getOptimisticResult(options); - } - fetchNextPage(options) { - return this.fetch({ - ...options, - meta: { - fetchMore: { direction: "forward" } - } - }); - } - fetchPreviousPage(options) { - return this.fetch({ - ...options, - meta: { - fetchMore: { direction: "backward" } - } - }); - } - createResult(query, options) { - const { state } = query; - const parentResult = super.createResult(query, options); - const { isFetching, isRefetching, isError, isRefetchError } = parentResult; - const fetchDirection = state.fetchMeta?.fetchMore?.direction; - const isFetchNextPageError = isError && fetchDirection === "forward"; - const isFetchingNextPage = isFetching && fetchDirection === "forward"; - const isFetchPreviousPageError = isError && fetchDirection === "backward"; - const isFetchingPreviousPage = isFetching && fetchDirection === "backward"; - const result = { - ...parentResult, - fetchNextPage: this.fetchNextPage, - fetchPreviousPage: this.fetchPreviousPage, - hasNextPage: hasNextPage(options, state.data), - hasPreviousPage: hasPreviousPage(options, state.data), - isFetchNextPageError, - isFetchingNextPage, - isFetchPreviousPageError, - isFetchingPreviousPage, - isRefetchError: isRefetchError && !isFetchNextPageError && !isFetchPreviousPageError, - isRefetching: isRefetching && !isFetchingNextPage && !isFetchingPreviousPage - }; - return result; - } -}; - -// ../../../../node_modules/.bun/@tanstack+query-core@5.90.20/node_modules/@tanstack/query-core/build/modern/mutation.js -var Mutation = class extends Removable { - #client; - #observers; - #mutationCache; - #retryer; - constructor(config) { - super(); - this.#client = config.client; - this.mutationId = config.mutationId; - this.#mutationCache = config.mutationCache; - this.#observers = []; - this.state = config.state || getDefaultState2(); - this.setOptions(config.options); - this.scheduleGc(); - } - setOptions(options) { - this.options = options; - this.updateGcTime(this.options.gcTime); - } - get meta() { - return this.options.meta; - } - addObserver(observer) { - if (!this.#observers.includes(observer)) { - this.#observers.push(observer); - this.clearGcTimeout(); - this.#mutationCache.notify({ - type: "observerAdded", - mutation: this, - observer - }); - } - } - removeObserver(observer) { - this.#observers = this.#observers.filter((x) => x !== observer); - this.scheduleGc(); - this.#mutationCache.notify({ - type: "observerRemoved", - mutation: this, - observer - }); - } - optionalRemove() { - if (!this.#observers.length) { - if (this.state.status === "pending") { - this.scheduleGc(); - } else { - this.#mutationCache.remove(this); - } - } - } - continue() { - return this.#retryer?.continue() ?? // continuing a mutation assumes that variables are set, mutation must have been dehydrated before - this.execute(this.state.variables); - } - async execute(variables) { - const onContinue = () => { - this.#dispatch({ type: "continue" }); - }; - const mutationFnContext = { - client: this.#client, - meta: this.options.meta, - mutationKey: this.options.mutationKey - }; - this.#retryer = createRetryer({ - fn: () => { - if (!this.options.mutationFn) { - return Promise.reject(new Error("No mutationFn found")); - } - return this.options.mutationFn(variables, mutationFnContext); - }, - onFail: (failureCount, error) => { - this.#dispatch({ type: "failed", failureCount, error }); - }, - onPause: () => { - this.#dispatch({ type: "pause" }); - }, - onContinue, - retry: this.options.retry ?? 0, - retryDelay: this.options.retryDelay, - networkMode: this.options.networkMode, - canRun: () => this.#mutationCache.canRun(this) - }); - const restored = this.state.status === "pending"; - const isPaused = !this.#retryer.canStart(); - try { - if (restored) { - onContinue(); - } else { - this.#dispatch({ type: "pending", variables, isPaused }); - if (this.#mutationCache.config.onMutate) { - await this.#mutationCache.config.onMutate( - variables, - this, - mutationFnContext - ); - } - const context = await this.options.onMutate?.( - variables, - mutationFnContext - ); - if (context !== this.state.context) { - this.#dispatch({ - type: "pending", - context, - variables, - isPaused - }); - } - } - const data = await this.#retryer.start(); - await this.#mutationCache.config.onSuccess?.( - data, - variables, - this.state.context, - this, - mutationFnContext - ); - await this.options.onSuccess?.( - data, - variables, - this.state.context, - mutationFnContext - ); - await this.#mutationCache.config.onSettled?.( - data, - null, - this.state.variables, - this.state.context, - this, - mutationFnContext - ); - await this.options.onSettled?.( - data, - null, - variables, - this.state.context, - mutationFnContext - ); - this.#dispatch({ type: "success", data }); - return data; - } catch (error) { - try { - await this.#mutationCache.config.onError?.( - error, - variables, - this.state.context, - this, - mutationFnContext - ); - } catch (e) { - void Promise.reject(e); - } - try { - await this.options.onError?.( - error, - variables, - this.state.context, - mutationFnContext - ); - } catch (e) { - void Promise.reject(e); - } - try { - await this.#mutationCache.config.onSettled?.( - void 0, - error, - this.state.variables, - this.state.context, - this, - mutationFnContext - ); - } catch (e) { - void Promise.reject(e); - } - try { - await this.options.onSettled?.( - void 0, - error, - variables, - this.state.context, - mutationFnContext - ); - } catch (e) { - void Promise.reject(e); - } - this.#dispatch({ type: "error", error }); - throw error; - } finally { - this.#mutationCache.runNext(this); - } - } - #dispatch(action) { - const reducer = (state) => { - switch (action.type) { - case "failed": - return { - ...state, - failureCount: action.failureCount, - failureReason: action.error - }; - case "pause": - return { - ...state, - isPaused: true - }; - case "continue": - return { - ...state, - isPaused: false - }; - case "pending": - return { - ...state, - context: action.context, - data: void 0, - failureCount: 0, - failureReason: null, - error: null, - isPaused: action.isPaused, - status: "pending", - variables: action.variables, - submittedAt: Date.now() - }; - case "success": - return { - ...state, - data: action.data, - failureCount: 0, - failureReason: null, - error: null, - status: "success", - isPaused: false - }; - case "error": - return { - ...state, - data: void 0, - error: action.error, - failureCount: state.failureCount + 1, - failureReason: action.error, - isPaused: false, - status: "error" - }; - } - }; - this.state = reducer(this.state); - notifyManager.batch(() => { - this.#observers.forEach((observer) => { - observer.onMutationUpdate(action); - }); - this.#mutationCache.notify({ - mutation: this, - type: "updated", - action - }); - }); - } -}; -function getDefaultState2() { - return { - context: void 0, - data: void 0, - error: null, - failureCount: 0, - failureReason: null, - isPaused: false, - status: "idle", - variables: void 0, - submittedAt: 0 - }; -} - -// ../../../../node_modules/.bun/@tanstack+query-core@5.90.20/node_modules/@tanstack/query-core/build/modern/mutationCache.js -var MutationCache = class extends Subscribable { - constructor(config = {}) { - super(); - this.config = config; - this.#mutations = /* @__PURE__ */ new Set(); - this.#scopes = /* @__PURE__ */ new Map(); - this.#mutationId = 0; - } - #mutations; - #scopes; - #mutationId; - build(client, options, state) { - const mutation = new Mutation({ - client, - mutationCache: this, - mutationId: ++this.#mutationId, - options: client.defaultMutationOptions(options), - state - }); - this.add(mutation); - return mutation; - } - add(mutation) { - this.#mutations.add(mutation); - const scope = scopeFor(mutation); - if (typeof scope === "string") { - const scopedMutations = this.#scopes.get(scope); - if (scopedMutations) { - scopedMutations.push(mutation); - } else { - this.#scopes.set(scope, [mutation]); - } - } - this.notify({ type: "added", mutation }); - } - remove(mutation) { - if (this.#mutations.delete(mutation)) { - const scope = scopeFor(mutation); - if (typeof scope === "string") { - const scopedMutations = this.#scopes.get(scope); - if (scopedMutations) { - if (scopedMutations.length > 1) { - const index = scopedMutations.indexOf(mutation); - if (index !== -1) { - scopedMutations.splice(index, 1); - } - } else if (scopedMutations[0] === mutation) { - this.#scopes.delete(scope); - } - } - } - } - this.notify({ type: "removed", mutation }); - } - canRun(mutation) { - const scope = scopeFor(mutation); - if (typeof scope === "string") { - const mutationsWithSameScope = this.#scopes.get(scope); - const firstPendingMutation = mutationsWithSameScope?.find( - (m) => m.state.status === "pending" - ); - return !firstPendingMutation || firstPendingMutation === mutation; - } else { - return true; - } - } - runNext(mutation) { - const scope = scopeFor(mutation); - if (typeof scope === "string") { - const foundMutation = this.#scopes.get(scope)?.find((m) => m !== mutation && m.state.isPaused); - return foundMutation?.continue() ?? Promise.resolve(); - } else { - return Promise.resolve(); - } - } - clear() { - notifyManager.batch(() => { - this.#mutations.forEach((mutation) => { - this.notify({ type: "removed", mutation }); - }); - this.#mutations.clear(); - this.#scopes.clear(); - }); - } - getAll() { - return Array.from(this.#mutations); - } - find(filters) { - const defaultedFilters = { exact: true, ...filters }; - return this.getAll().find( - (mutation) => matchMutation(defaultedFilters, mutation) - ); - } - findAll(filters = {}) { - return this.getAll().filter((mutation) => matchMutation(filters, mutation)); - } - notify(event) { - notifyManager.batch(() => { - this.listeners.forEach((listener) => { - listener(event); - }); - }); - } - resumePausedMutations() { - const pausedMutations = this.getAll().filter((x) => x.state.isPaused); - return notifyManager.batch( - () => Promise.all( - pausedMutations.map((mutation) => mutation.continue().catch(noop)) - ) - ); - } -}; -function scopeFor(mutation) { - return mutation.options.scope?.id; -} - -// ../../../../node_modules/.bun/@tanstack+query-core@5.90.20/node_modules/@tanstack/query-core/build/modern/mutationObserver.js -var MutationObserver = class extends Subscribable { - #client; - #currentResult = void 0; - #currentMutation; - #mutateOptions; - constructor(client, options) { - super(); - this.#client = client; - this.setOptions(options); - this.bindMethods(); - this.#updateResult(); - } - bindMethods() { - this.mutate = this.mutate.bind(this); - this.reset = this.reset.bind(this); - } - setOptions(options) { - const prevOptions = this.options; - this.options = this.#client.defaultMutationOptions(options); - if (!shallowEqualObjects(this.options, prevOptions)) { - this.#client.getMutationCache().notify({ - type: "observerOptionsUpdated", - mutation: this.#currentMutation, - observer: this - }); - } - if (prevOptions?.mutationKey && this.options.mutationKey && hashKey(prevOptions.mutationKey) !== hashKey(this.options.mutationKey)) { - this.reset(); - } else if (this.#currentMutation?.state.status === "pending") { - this.#currentMutation.setOptions(this.options); - } - } - onUnsubscribe() { - if (!this.hasListeners()) { - this.#currentMutation?.removeObserver(this); - } - } - onMutationUpdate(action) { - this.#updateResult(); - this.#notify(action); - } - getCurrentResult() { - return this.#currentResult; - } - reset() { - this.#currentMutation?.removeObserver(this); - this.#currentMutation = void 0; - this.#updateResult(); - this.#notify(); - } - mutate(variables, options) { - this.#mutateOptions = options; - this.#currentMutation?.removeObserver(this); - this.#currentMutation = this.#client.getMutationCache().build(this.#client, this.options); - this.#currentMutation.addObserver(this); - return this.#currentMutation.execute(variables); - } - #updateResult() { - const state = this.#currentMutation?.state ?? getDefaultState2(); - this.#currentResult = { - ...state, - isPending: state.status === "pending", - isSuccess: state.status === "success", - isError: state.status === "error", - isIdle: state.status === "idle", - mutate: this.mutate, - reset: this.reset - }; - } - #notify(action) { - notifyManager.batch(() => { - if (this.#mutateOptions && this.hasListeners()) { - const variables = this.#currentResult.variables; - const onMutateResult = this.#currentResult.context; - const context = { - client: this.#client, - meta: this.options.meta, - mutationKey: this.options.mutationKey - }; - if (action?.type === "success") { - try { - this.#mutateOptions.onSuccess?.( - action.data, - variables, - onMutateResult, - context - ); - } catch (e) { - void Promise.reject(e); - } - try { - this.#mutateOptions.onSettled?.( - action.data, - null, - variables, - onMutateResult, - context - ); - } catch (e) { - void Promise.reject(e); - } - } else if (action?.type === "error") { - try { - this.#mutateOptions.onError?.( - action.error, - variables, - onMutateResult, - context - ); - } catch (e) { - void Promise.reject(e); - } - try { - this.#mutateOptions.onSettled?.( - void 0, - action.error, - variables, - onMutateResult, - context - ); - } catch (e) { - void Promise.reject(e); - } - } - } - this.listeners.forEach((listener) => { - listener(this.#currentResult); - }); - }); - } -}; - -// ../../../../node_modules/.bun/@tanstack+query-core@5.90.20/node_modules/@tanstack/query-core/build/modern/queriesObserver.js -function difference(array1, array2) { - const excludeSet = new Set(array2); - return array1.filter((x) => !excludeSet.has(x)); -} -function replaceAt(array, index, value) { - const copy = array.slice(0); - copy[index] = value; - return copy; -} -var QueriesObserver = class extends Subscribable { - #client; - #result; - #queries; - #options; - #observers; - #combinedResult; - #lastCombine; - #lastResult; - #lastQueryHashes; - #observerMatches = []; - constructor(client, queries, options) { - super(); - this.#client = client; - this.#options = options; - this.#queries = []; - this.#observers = []; - this.#result = []; - this.setQueries(queries); - } - onSubscribe() { - if (this.listeners.size === 1) { - this.#observers.forEach((observer) => { - observer.subscribe((result) => { - this.#onUpdate(observer, result); - }); - }); - } - } - onUnsubscribe() { - if (!this.listeners.size) { - this.destroy(); - } - } - destroy() { - this.listeners = /* @__PURE__ */ new Set(); - this.#observers.forEach((observer) => { - observer.destroy(); - }); - } - setQueries(queries, options) { - this.#queries = queries; - this.#options = options; - if (true) { - const queryHashes = queries.map( - (query) => this.#client.defaultQueryOptions(query).queryHash - ); - if (new Set(queryHashes).size !== queryHashes.length) { - console.warn( - "[QueriesObserver]: Duplicate Queries found. This might result in unexpected behavior." - ); - } - } - notifyManager.batch(() => { - const prevObservers = this.#observers; - const newObserverMatches = this.#findMatchingObservers(this.#queries); - newObserverMatches.forEach( - (match) => match.observer.setOptions(match.defaultedQueryOptions) - ); - const newObservers = newObserverMatches.map((match) => match.observer); - const newResult = newObservers.map( - (observer) => observer.getCurrentResult() - ); - const hasLengthChange = prevObservers.length !== newObservers.length; - const hasIndexChange = newObservers.some( - (observer, index) => observer !== prevObservers[index] - ); - const hasStructuralChange = hasLengthChange || hasIndexChange; - const hasResultChange = hasStructuralChange ? true : newResult.some((result, index) => { - const prev = this.#result[index]; - return !prev || !shallowEqualObjects(result, prev); - }); - if (!hasStructuralChange && !hasResultChange) return; - if (hasStructuralChange) { - this.#observerMatches = newObserverMatches; - this.#observers = newObservers; - } - this.#result = newResult; - if (!this.hasListeners()) return; - if (hasStructuralChange) { - difference(prevObservers, newObservers).forEach((observer) => { - observer.destroy(); - }); - difference(newObservers, prevObservers).forEach((observer) => { - observer.subscribe((result) => { - this.#onUpdate(observer, result); - }); - }); - } - this.#notify(); - }); - } - getCurrentResult() { - return this.#result; - } - getQueries() { - return this.#observers.map((observer) => observer.getCurrentQuery()); - } - getObservers() { - return this.#observers; - } - getOptimisticResult(queries, combine) { - const matches = this.#findMatchingObservers(queries); - const result = matches.map( - (match) => match.observer.getOptimisticResult(match.defaultedQueryOptions) - ); - const queryHashes = matches.map( - (match) => match.defaultedQueryOptions.queryHash - ); - return [ - result, - (r) => { - return this.#combineResult(r ?? result, combine, queryHashes); - }, - () => { - return this.#trackResult(result, matches); - } - ]; - } - #trackResult(result, matches) { - return matches.map((match, index) => { - const observerResult = result[index]; - return !match.defaultedQueryOptions.notifyOnChangeProps ? match.observer.trackResult(observerResult, (accessedProp) => { - matches.forEach((m) => { - m.observer.trackProp(accessedProp); - }); - }) : observerResult; - }); - } - #combineResult(input, combine, queryHashes) { - if (combine) { - const lastHashes = this.#lastQueryHashes; - const queryHashesChanged = queryHashes !== void 0 && lastHashes !== void 0 && (lastHashes.length !== queryHashes.length || queryHashes.some((hash, i) => hash !== lastHashes[i])); - if (!this.#combinedResult || this.#result !== this.#lastResult || queryHashesChanged || combine !== this.#lastCombine) { - this.#lastCombine = combine; - this.#lastResult = this.#result; - if (queryHashes !== void 0) { - this.#lastQueryHashes = queryHashes; - } - this.#combinedResult = replaceEqualDeep( - this.#combinedResult, - combine(input) - ); - } - return this.#combinedResult; - } - return input; - } - #findMatchingObservers(queries) { - const prevObserversMap = /* @__PURE__ */ new Map(); - this.#observers.forEach((observer) => { - const key = observer.options.queryHash; - if (!key) return; - const previousObservers = prevObserversMap.get(key); - if (previousObservers) { - previousObservers.push(observer); - } else { - prevObserversMap.set(key, [observer]); - } - }); - const observers = []; - queries.forEach((options) => { - const defaultedOptions = this.#client.defaultQueryOptions(options); - const match = prevObserversMap.get(defaultedOptions.queryHash)?.shift(); - const observer = match ?? new QueryObserver(this.#client, defaultedOptions); - observers.push({ - defaultedQueryOptions: defaultedOptions, - observer - }); - }); - return observers; - } - #onUpdate(observer, result) { - const index = this.#observers.indexOf(observer); - if (index !== -1) { - this.#result = replaceAt(this.#result, index, result); - this.#notify(); - } - } - #notify() { - if (this.hasListeners()) { - const previousResult = this.#combinedResult; - const newTracked = this.#trackResult(this.#result, this.#observerMatches); - const newResult = this.#combineResult(newTracked, this.#options?.combine); - if (previousResult !== newResult) { - notifyManager.batch(() => { - this.listeners.forEach((listener) => { - listener(this.#result); - }); - }); - } - } - } -}; - -// ../../../../node_modules/.bun/@tanstack+query-core@5.90.20/node_modules/@tanstack/query-core/build/modern/queryCache.js -var QueryCache = class extends Subscribable { - constructor(config = {}) { - super(); - this.config = config; - this.#queries = /* @__PURE__ */ new Map(); - } - #queries; - build(client, options, state) { - const queryKey = options.queryKey; - const queryHash = options.queryHash ?? hashQueryKeyByOptions(queryKey, options); - let query = this.get(queryHash); - if (!query) { - query = new Query({ - client, - queryKey, - queryHash, - options: client.defaultQueryOptions(options), - state, - defaultOptions: client.getQueryDefaults(queryKey) - }); - this.add(query); - } - return query; - } - add(query) { - if (!this.#queries.has(query.queryHash)) { - this.#queries.set(query.queryHash, query); - this.notify({ - type: "added", - query - }); - } - } - remove(query) { - const queryInMap = this.#queries.get(query.queryHash); - if (queryInMap) { - query.destroy(); - if (queryInMap === query) { - this.#queries.delete(query.queryHash); - } - this.notify({ type: "removed", query }); - } - } - clear() { - notifyManager.batch(() => { - this.getAll().forEach((query) => { - this.remove(query); - }); - }); - } - get(queryHash) { - return this.#queries.get(queryHash); - } - getAll() { - return [...this.#queries.values()]; - } - find(filters) { - const defaultedFilters = { exact: true, ...filters }; - return this.getAll().find( - (query) => matchQuery(defaultedFilters, query) - ); - } - findAll(filters = {}) { - const queries = this.getAll(); - return Object.keys(filters).length > 0 ? queries.filter((query) => matchQuery(filters, query)) : queries; - } - notify(event) { - notifyManager.batch(() => { - this.listeners.forEach((listener) => { - listener(event); - }); - }); - } - onFocus() { - notifyManager.batch(() => { - this.getAll().forEach((query) => { - query.onFocus(); - }); - }); - } - onOnline() { - notifyManager.batch(() => { - this.getAll().forEach((query) => { - query.onOnline(); - }); - }); - } -}; - -// ../../../../node_modules/.bun/@tanstack+query-core@5.90.20/node_modules/@tanstack/query-core/build/modern/queryClient.js -var QueryClient = class { - #queryCache; - #mutationCache; - #defaultOptions; - #queryDefaults; - #mutationDefaults; - #mountCount; - #unsubscribeFocus; - #unsubscribeOnline; - constructor(config = {}) { - this.#queryCache = config.queryCache || new QueryCache(); - this.#mutationCache = config.mutationCache || new MutationCache(); - this.#defaultOptions = config.defaultOptions || {}; - this.#queryDefaults = /* @__PURE__ */ new Map(); - this.#mutationDefaults = /* @__PURE__ */ new Map(); - this.#mountCount = 0; - } - mount() { - this.#mountCount++; - if (this.#mountCount !== 1) return; - this.#unsubscribeFocus = focusManager.subscribe(async (focused) => { - if (focused) { - await this.resumePausedMutations(); - this.#queryCache.onFocus(); - } - }); - this.#unsubscribeOnline = onlineManager.subscribe(async (online) => { - if (online) { - await this.resumePausedMutations(); - this.#queryCache.onOnline(); - } - }); - } - unmount() { - this.#mountCount--; - if (this.#mountCount !== 0) return; - this.#unsubscribeFocus?.(); - this.#unsubscribeFocus = void 0; - this.#unsubscribeOnline?.(); - this.#unsubscribeOnline = void 0; - } - isFetching(filters) { - return this.#queryCache.findAll({ ...filters, fetchStatus: "fetching" }).length; - } - isMutating(filters) { - return this.#mutationCache.findAll({ ...filters, status: "pending" }).length; - } - /** - * Imperative (non-reactive) way to retrieve data for a QueryKey. - * Should only be used in callbacks or functions where reading the latest data is necessary, e.g. for optimistic updates. - * - * Hint: Do not use this function inside a component, because it won't receive updates. - * Use `useQuery` to create a `QueryObserver` that subscribes to changes. - */ - getQueryData(queryKey) { - const options = this.defaultQueryOptions({ queryKey }); - return this.#queryCache.get(options.queryHash)?.state.data; - } - ensureQueryData(options) { - const defaultedOptions = this.defaultQueryOptions(options); - const query = this.#queryCache.build(this, defaultedOptions); - const cachedData = query.state.data; - if (cachedData === void 0) { - return this.fetchQuery(options); - } - if (options.revalidateIfStale && query.isStaleByTime(resolveStaleTime(defaultedOptions.staleTime, query))) { - void this.prefetchQuery(defaultedOptions); - } - return Promise.resolve(cachedData); - } - getQueriesData(filters) { - return this.#queryCache.findAll(filters).map(({ queryKey, state }) => { - const data = state.data; - return [queryKey, data]; - }); - } - setQueryData(queryKey, updater, options) { - const defaultedOptions = this.defaultQueryOptions({ queryKey }); - const query = this.#queryCache.get( - defaultedOptions.queryHash - ); - const prevData = query?.state.data; - const data = functionalUpdate(updater, prevData); - if (data === void 0) { - return void 0; - } - return this.#queryCache.build(this, defaultedOptions).setData(data, { ...options, manual: true }); - } - setQueriesData(filters, updater, options) { - return notifyManager.batch( - () => this.#queryCache.findAll(filters).map(({ queryKey }) => [ - queryKey, - this.setQueryData(queryKey, updater, options) - ]) - ); - } - getQueryState(queryKey) { - const options = this.defaultQueryOptions({ queryKey }); - return this.#queryCache.get( - options.queryHash - )?.state; - } - removeQueries(filters) { - const queryCache = this.#queryCache; - notifyManager.batch(() => { - queryCache.findAll(filters).forEach((query) => { - queryCache.remove(query); - }); - }); - } - resetQueries(filters, options) { - const queryCache = this.#queryCache; - return notifyManager.batch(() => { - queryCache.findAll(filters).forEach((query) => { - query.reset(); - }); - return this.refetchQueries( - { - type: "active", - ...filters - }, - options - ); - }); - } - cancelQueries(filters, cancelOptions = {}) { - const defaultedCancelOptions = { revert: true, ...cancelOptions }; - const promises = notifyManager.batch( - () => this.#queryCache.findAll(filters).map((query) => query.cancel(defaultedCancelOptions)) - ); - return Promise.all(promises).then(noop).catch(noop); - } - invalidateQueries(filters, options = {}) { - return notifyManager.batch(() => { - this.#queryCache.findAll(filters).forEach((query) => { - query.invalidate(); - }); - if (filters?.refetchType === "none") { - return Promise.resolve(); - } - return this.refetchQueries( - { - ...filters, - type: filters?.refetchType ?? filters?.type ?? "active" - }, - options - ); - }); - } - refetchQueries(filters, options = {}) { - const fetchOptions = { - ...options, - cancelRefetch: options.cancelRefetch ?? true - }; - const promises = notifyManager.batch( - () => this.#queryCache.findAll(filters).filter((query) => !query.isDisabled() && !query.isStatic()).map((query) => { - let promise = query.fetch(void 0, fetchOptions); - if (!fetchOptions.throwOnError) { - promise = promise.catch(noop); - } - return query.state.fetchStatus === "paused" ? Promise.resolve() : promise; - }) - ); - return Promise.all(promises).then(noop); - } - fetchQuery(options) { - const defaultedOptions = this.defaultQueryOptions(options); - if (defaultedOptions.retry === void 0) { - defaultedOptions.retry = false; - } - const query = this.#queryCache.build(this, defaultedOptions); - return query.isStaleByTime( - resolveStaleTime(defaultedOptions.staleTime, query) - ) ? query.fetch(defaultedOptions) : Promise.resolve(query.state.data); - } - prefetchQuery(options) { - return this.fetchQuery(options).then(noop).catch(noop); - } - fetchInfiniteQuery(options) { - options.behavior = infiniteQueryBehavior(options.pages); - return this.fetchQuery(options); - } - prefetchInfiniteQuery(options) { - return this.fetchInfiniteQuery(options).then(noop).catch(noop); - } - ensureInfiniteQueryData(options) { - options.behavior = infiniteQueryBehavior(options.pages); - return this.ensureQueryData(options); - } - resumePausedMutations() { - if (onlineManager.isOnline()) { - return this.#mutationCache.resumePausedMutations(); - } - return Promise.resolve(); - } - getQueryCache() { - return this.#queryCache; - } - getMutationCache() { - return this.#mutationCache; - } - getDefaultOptions() { - return this.#defaultOptions; - } - setDefaultOptions(options) { - this.#defaultOptions = options; - } - setQueryDefaults(queryKey, options) { - this.#queryDefaults.set(hashKey(queryKey), { - queryKey, - defaultOptions: options - }); - } - getQueryDefaults(queryKey) { - const defaults = [...this.#queryDefaults.values()]; - const result = {}; - defaults.forEach((queryDefault) => { - if (partialMatchKey(queryKey, queryDefault.queryKey)) { - Object.assign(result, queryDefault.defaultOptions); - } - }); - return result; - } - setMutationDefaults(mutationKey, options) { - this.#mutationDefaults.set(hashKey(mutationKey), { - mutationKey, - defaultOptions: options - }); - } - getMutationDefaults(mutationKey) { - const defaults = [...this.#mutationDefaults.values()]; - const result = {}; - defaults.forEach((queryDefault) => { - if (partialMatchKey(mutationKey, queryDefault.mutationKey)) { - Object.assign(result, queryDefault.defaultOptions); - } - }); - return result; - } - defaultQueryOptions(options) { - if (options._defaulted) { - return options; - } - const defaultedOptions = { - ...this.#defaultOptions.queries, - ...this.getQueryDefaults(options.queryKey), - ...options, - _defaulted: true - }; - if (!defaultedOptions.queryHash) { - defaultedOptions.queryHash = hashQueryKeyByOptions( - defaultedOptions.queryKey, - defaultedOptions - ); - } - if (defaultedOptions.refetchOnReconnect === void 0) { - defaultedOptions.refetchOnReconnect = defaultedOptions.networkMode !== "always"; - } - if (defaultedOptions.throwOnError === void 0) { - defaultedOptions.throwOnError = !!defaultedOptions.suspense; - } - if (!defaultedOptions.networkMode && defaultedOptions.persister) { - defaultedOptions.networkMode = "offlineFirst"; - } - if (defaultedOptions.queryFn === skipToken) { - defaultedOptions.enabled = false; - } - return defaultedOptions; - } - defaultMutationOptions(options) { - if (options?._defaulted) { - return options; - } - return { - ...this.#defaultOptions.mutations, - ...options?.mutationKey && this.getMutationDefaults(options.mutationKey), - ...options, - _defaulted: true - }; - } - clear() { - this.#queryCache.clear(); - this.#mutationCache.clear(); - } -}; - -// ../../../../node_modules/.bun/@tanstack+query-core@5.90.20/node_modules/@tanstack/query-core/build/modern/streamedQuery.js -function streamedQuery({ - streamFn, - refetchMode = "reset", - reducer = (items, chunk) => addToEnd(items, chunk), - initialValue = [] -}) { - return async (context) => { - const query = context.client.getQueryCache().find({ queryKey: context.queryKey, exact: true }); - const isRefetch = !!query && query.state.data !== void 0; - if (isRefetch && refetchMode === "reset") { - query.setState({ - status: "pending", - data: void 0, - error: null, - fetchStatus: "fetching" - }); - } - let result = initialValue; - let cancelled = false; - const streamFnContext = addConsumeAwareSignal( - { - client: context.client, - meta: context.meta, - queryKey: context.queryKey, - pageParam: context.pageParam, - direction: context.direction - }, - () => context.signal, - () => cancelled = true - ); - const stream = await streamFn(streamFnContext); - const isReplaceRefetch = isRefetch && refetchMode === "replace"; - for await (const chunk of stream) { - if (cancelled) { - break; - } - if (isReplaceRefetch) { - result = reducer(result, chunk); - } else { - context.client.setQueryData( - context.queryKey, - (prev) => reducer(prev === void 0 ? initialValue : prev, chunk) - ); - } - } - if (isReplaceRefetch && !cancelled) { - context.client.setQueryData(context.queryKey, result); - } - return context.client.getQueryData(context.queryKey) ?? initialValue; - }; -} - -// ../../../../node_modules/.bun/@tanstack+query-core@5.90.20/node_modules/@tanstack/query-core/build/modern/types.js -var dataTagSymbol = /* @__PURE__ */ Symbol("dataTagSymbol"); -var dataTagErrorSymbol = /* @__PURE__ */ Symbol("dataTagErrorSymbol"); -var unsetMarker = /* @__PURE__ */ Symbol("unsetMarker"); - -// ../../../../node_modules/.bun/@tanstack+react-query@5.90.21+b1ab299f0a400331/node_modules/@tanstack/react-query/build/modern/useQueries.js -var React5 = __toESM(require_react(), 1); - -// ../../../../node_modules/.bun/@tanstack+react-query@5.90.21+b1ab299f0a400331/node_modules/@tanstack/react-query/build/modern/QueryClientProvider.js -var React = __toESM(require_react(), 1); -var import_jsx_runtime = __toESM(require_jsx_runtime(), 1); -var QueryClientContext = React.createContext( - void 0 -); -var useQueryClient = (queryClient) => { - const client = React.useContext(QueryClientContext); - if (queryClient) { - return queryClient; - } - if (!client) { - throw new Error("No QueryClient set, use QueryClientProvider to set one"); - } - return client; -}; -var QueryClientProvider = ({ - client, - children -}) => { - React.useEffect(() => { - client.mount(); - return () => { - client.unmount(); - }; - }, [client]); - return (0, import_jsx_runtime.jsx)(QueryClientContext.Provider, { value: client, children }); -}; - -// ../../../../node_modules/.bun/@tanstack+react-query@5.90.21+b1ab299f0a400331/node_modules/@tanstack/react-query/build/modern/IsRestoringProvider.js -var React2 = __toESM(require_react(), 1); -var IsRestoringContext = React2.createContext(false); -var useIsRestoring = () => React2.useContext(IsRestoringContext); -var IsRestoringProvider = IsRestoringContext.Provider; - -// ../../../../node_modules/.bun/@tanstack+react-query@5.90.21+b1ab299f0a400331/node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.js -var React3 = __toESM(require_react(), 1); -var import_jsx_runtime2 = __toESM(require_jsx_runtime(), 1); -function createValue() { - let isReset = false; - return { - clearReset: () => { - isReset = false; - }, - reset: () => { - isReset = true; - }, - isReset: () => { - return isReset; - } - }; -} -var QueryErrorResetBoundaryContext = React3.createContext(createValue()); -var useQueryErrorResetBoundary = () => React3.useContext(QueryErrorResetBoundaryContext); -var QueryErrorResetBoundary = ({ - children -}) => { - const [value] = React3.useState(() => createValue()); - return (0, import_jsx_runtime2.jsx)(QueryErrorResetBoundaryContext.Provider, { value, children: typeof children === "function" ? children(value) : children }); -}; - -// ../../../../node_modules/.bun/@tanstack+react-query@5.90.21+b1ab299f0a400331/node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.js -var React4 = __toESM(require_react(), 1); -var ensurePreventErrorBoundaryRetry = (options, errorResetBoundary, query) => { - const throwOnError = query?.state.error && typeof options.throwOnError === "function" ? shouldThrowError(options.throwOnError, [query.state.error, query]) : options.throwOnError; - if (options.suspense || options.experimental_prefetchInRender || throwOnError) { - if (!errorResetBoundary.isReset()) { - options.retryOnMount = false; - } - } -}; -var useClearResetErrorBoundary = (errorResetBoundary) => { - React4.useEffect(() => { - errorResetBoundary.clearReset(); - }, [errorResetBoundary]); -}; -var getHasError = ({ - result, - errorResetBoundary, - throwOnError, - query, - suspense -}) => { - return result.isError && !errorResetBoundary.isReset() && !result.isFetching && query && (suspense && result.data === void 0 || shouldThrowError(throwOnError, [result.error, query])); -}; - -// ../../../../node_modules/.bun/@tanstack+react-query@5.90.21+b1ab299f0a400331/node_modules/@tanstack/react-query/build/modern/suspense.js -var defaultThrowOnError = (_error, query) => query.state.data === void 0; -var ensureSuspenseTimers = (defaultedOptions) => { - if (defaultedOptions.suspense) { - const MIN_SUSPENSE_TIME_MS = 1e3; - const clamp = (value) => value === "static" ? value : Math.max(value ?? MIN_SUSPENSE_TIME_MS, MIN_SUSPENSE_TIME_MS); - const originalStaleTime = defaultedOptions.staleTime; - defaultedOptions.staleTime = typeof originalStaleTime === "function" ? (...args) => clamp(originalStaleTime(...args)) : clamp(originalStaleTime); - if (typeof defaultedOptions.gcTime === "number") { - defaultedOptions.gcTime = Math.max( - defaultedOptions.gcTime, - MIN_SUSPENSE_TIME_MS - ); - } - } -}; -var willFetch = (result, isRestoring) => result.isLoading && result.isFetching && !isRestoring; -var shouldSuspend = (defaultedOptions, result) => defaultedOptions?.suspense && result.isPending; -var fetchOptimistic = (defaultedOptions, observer, errorResetBoundary) => observer.fetchOptimistic(defaultedOptions).catch(() => { - errorResetBoundary.clearReset(); -}); - -// ../../../../node_modules/.bun/@tanstack+react-query@5.90.21+b1ab299f0a400331/node_modules/@tanstack/react-query/build/modern/useQueries.js -function useQueries({ - queries, - ...options -}, queryClient) { - const client = useQueryClient(queryClient); - const isRestoring = useIsRestoring(); - const errorResetBoundary = useQueryErrorResetBoundary(); - const defaultedQueries = React5.useMemo( - () => queries.map((opts) => { - const defaultedOptions = client.defaultQueryOptions( - opts - ); - defaultedOptions._optimisticResults = isRestoring ? "isRestoring" : "optimistic"; - return defaultedOptions; - }), - [queries, client, isRestoring] - ); - defaultedQueries.forEach((queryOptions2) => { - ensureSuspenseTimers(queryOptions2); - const query = client.getQueryCache().get(queryOptions2.queryHash); - ensurePreventErrorBoundaryRetry(queryOptions2, errorResetBoundary, query); - }); - useClearResetErrorBoundary(errorResetBoundary); - const [observer] = React5.useState( - () => new QueriesObserver( - client, - defaultedQueries, - options - ) - ); - const [optimisticResult, getCombinedResult, trackResult] = observer.getOptimisticResult( - defaultedQueries, - options.combine - ); - const shouldSubscribe = !isRestoring && options.subscribed !== false; - React5.useSyncExternalStore( - React5.useCallback( - (onStoreChange) => shouldSubscribe ? observer.subscribe(notifyManager.batchCalls(onStoreChange)) : noop, - [observer, shouldSubscribe] - ), - () => observer.getCurrentResult(), - () => observer.getCurrentResult() - ); - React5.useEffect(() => { - observer.setQueries( - defaultedQueries, - options - ); - }, [defaultedQueries, options, observer]); - const shouldAtLeastOneSuspend = optimisticResult.some( - (result, index) => shouldSuspend(defaultedQueries[index], result) - ); - const suspensePromises = shouldAtLeastOneSuspend ? optimisticResult.flatMap((result, index) => { - const opts = defaultedQueries[index]; - if (opts && shouldSuspend(opts, result)) { - const queryObserver = new QueryObserver(client, opts); - return fetchOptimistic(opts, queryObserver, errorResetBoundary); - } - return []; - }) : []; - if (suspensePromises.length > 0) { - throw Promise.all(suspensePromises); - } - const firstSingleResultWhichShouldThrow = optimisticResult.find( - (result, index) => { - const query = defaultedQueries[index]; - return query && getHasError({ - result, - errorResetBoundary, - throwOnError: query.throwOnError, - query: client.getQueryCache().get(query.queryHash), - suspense: query.suspense - }); - } - ); - if (firstSingleResultWhichShouldThrow?.error) { - throw firstSingleResultWhichShouldThrow.error; - } - return getCombinedResult(trackResult()); -} - -// ../../../../node_modules/.bun/@tanstack+react-query@5.90.21+b1ab299f0a400331/node_modules/@tanstack/react-query/build/modern/useBaseQuery.js -var React6 = __toESM(require_react(), 1); -function useBaseQuery(options, Observer, queryClient) { - if (true) { - if (typeof options !== "object" || Array.isArray(options)) { - throw new Error( - 'Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object' - ); - } - } - const isRestoring = useIsRestoring(); - const errorResetBoundary = useQueryErrorResetBoundary(); - const client = useQueryClient(queryClient); - const defaultedOptions = client.defaultQueryOptions(options); - client.getDefaultOptions().queries?._experimental_beforeQuery?.( - defaultedOptions - ); - const query = client.getQueryCache().get(defaultedOptions.queryHash); - if (true) { - if (!defaultedOptions.queryFn) { - console.error( - `[${defaultedOptions.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function` - ); - } - } - defaultedOptions._optimisticResults = isRestoring ? "isRestoring" : "optimistic"; - ensureSuspenseTimers(defaultedOptions); - ensurePreventErrorBoundaryRetry(defaultedOptions, errorResetBoundary, query); - useClearResetErrorBoundary(errorResetBoundary); - const isNewCacheEntry = !client.getQueryCache().get(defaultedOptions.queryHash); - const [observer] = React6.useState( - () => new Observer( - client, - defaultedOptions - ) - ); - const result = observer.getOptimisticResult(defaultedOptions); - const shouldSubscribe = !isRestoring && options.subscribed !== false; - React6.useSyncExternalStore( - React6.useCallback( - (onStoreChange) => { - const unsubscribe = shouldSubscribe ? observer.subscribe(notifyManager.batchCalls(onStoreChange)) : noop; - observer.updateResult(); - return unsubscribe; - }, - [observer, shouldSubscribe] - ), - () => observer.getCurrentResult(), - () => observer.getCurrentResult() - ); - React6.useEffect(() => { - observer.setOptions(defaultedOptions); - }, [defaultedOptions, observer]); - if (shouldSuspend(defaultedOptions, result)) { - throw fetchOptimistic(defaultedOptions, observer, errorResetBoundary); - } - if (getHasError({ - result, - errorResetBoundary, - throwOnError: defaultedOptions.throwOnError, - query, - suspense: defaultedOptions.suspense - })) { - throw result.error; - } - ; - client.getDefaultOptions().queries?._experimental_afterQuery?.( - defaultedOptions, - result - ); - if (defaultedOptions.experimental_prefetchInRender && !isServer && willFetch(result, isRestoring)) { - const promise = isNewCacheEntry ? ( - // Fetch immediately on render in order to ensure `.promise` is resolved even if the component is unmounted - fetchOptimistic(defaultedOptions, observer, errorResetBoundary) - ) : ( - // subscribe to the "cache promise" so that we can finalize the currentThenable once data comes in - query?.promise - ); - promise?.catch(noop).finally(() => { - observer.updateResult(); - }); - } - return !defaultedOptions.notifyOnChangeProps ? observer.trackResult(result) : result; -} - -// ../../../../node_modules/.bun/@tanstack+react-query@5.90.21+b1ab299f0a400331/node_modules/@tanstack/react-query/build/modern/useQuery.js -function useQuery(options, queryClient) { - return useBaseQuery(options, QueryObserver, queryClient); -} - -// ../../../../node_modules/.bun/@tanstack+react-query@5.90.21+b1ab299f0a400331/node_modules/@tanstack/react-query/build/modern/useSuspenseQuery.js -function useSuspenseQuery(options, queryClient) { - if (true) { - if (options.queryFn === skipToken) { - console.error("skipToken is not allowed for useSuspenseQuery"); - } - } - return useBaseQuery( - { - ...options, - enabled: true, - suspense: true, - throwOnError: defaultThrowOnError, - placeholderData: void 0 - }, - QueryObserver, - queryClient - ); -} - -// ../../../../node_modules/.bun/@tanstack+react-query@5.90.21+b1ab299f0a400331/node_modules/@tanstack/react-query/build/modern/useSuspenseInfiniteQuery.js -function useSuspenseInfiniteQuery(options, queryClient) { - if (true) { - if (options.queryFn === skipToken) { - console.error("skipToken is not allowed for useSuspenseInfiniteQuery"); - } - } - return useBaseQuery( - { - ...options, - enabled: true, - suspense: true, - throwOnError: defaultThrowOnError - }, - InfiniteQueryObserver, - queryClient - ); -} - -// ../../../../node_modules/.bun/@tanstack+react-query@5.90.21+b1ab299f0a400331/node_modules/@tanstack/react-query/build/modern/useSuspenseQueries.js -function useSuspenseQueries(options, queryClient) { - return useQueries( - { - ...options, - queries: options.queries.map((query) => { - if (true) { - if (query.queryFn === skipToken) { - console.error("skipToken is not allowed for useSuspenseQueries"); - } - } - return { - ...query, - suspense: true, - throwOnError: defaultThrowOnError, - enabled: true, - placeholderData: void 0 - }; - }) - }, - queryClient - ); -} - -// ../../../../node_modules/.bun/@tanstack+react-query@5.90.21+b1ab299f0a400331/node_modules/@tanstack/react-query/build/modern/usePrefetchQuery.js -function usePrefetchQuery(options, queryClient) { - const client = useQueryClient(queryClient); - if (!client.getQueryState(options.queryKey)) { - client.prefetchQuery(options); - } -} - -// ../../../../node_modules/.bun/@tanstack+react-query@5.90.21+b1ab299f0a400331/node_modules/@tanstack/react-query/build/modern/usePrefetchInfiniteQuery.js -function usePrefetchInfiniteQuery(options, queryClient) { - const client = useQueryClient(queryClient); - if (!client.getQueryState(options.queryKey)) { - client.prefetchInfiniteQuery(options); - } -} - -// ../../../../node_modules/.bun/@tanstack+react-query@5.90.21+b1ab299f0a400331/node_modules/@tanstack/react-query/build/modern/queryOptions.js -function queryOptions(options) { - return options; -} - -// ../../../../node_modules/.bun/@tanstack+react-query@5.90.21+b1ab299f0a400331/node_modules/@tanstack/react-query/build/modern/infiniteQueryOptions.js -function infiniteQueryOptions(options) { - return options; -} - -// ../../../../node_modules/.bun/@tanstack+react-query@5.90.21+b1ab299f0a400331/node_modules/@tanstack/react-query/build/modern/HydrationBoundary.js -var React7 = __toESM(require_react(), 1); -var HydrationBoundary = ({ - children, - options = {}, - state, - queryClient -}) => { - const client = useQueryClient(queryClient); - const optionsRef = React7.useRef(options); - React7.useEffect(() => { - optionsRef.current = options; - }); - const hydrationQueue = React7.useMemo(() => { - if (state) { - if (typeof state !== "object") { - return; - } - const queryCache = client.getQueryCache(); - const queries = state.queries || []; - const newQueries = []; - const existingQueries = []; - for (const dehydratedQuery of queries) { - const existingQuery = queryCache.get(dehydratedQuery.queryHash); - if (!existingQuery) { - newQueries.push(dehydratedQuery); - } else { - const hydrationIsNewer = dehydratedQuery.state.dataUpdatedAt > existingQuery.state.dataUpdatedAt || dehydratedQuery.promise && existingQuery.state.status !== "pending" && existingQuery.state.fetchStatus !== "fetching" && dehydratedQuery.dehydratedAt !== void 0 && dehydratedQuery.dehydratedAt > existingQuery.state.dataUpdatedAt; - if (hydrationIsNewer) { - existingQueries.push(dehydratedQuery); - } - } - } - if (newQueries.length > 0) { - hydrate(client, { queries: newQueries }, optionsRef.current); - } - if (existingQueries.length > 0) { - return existingQueries; - } - } - return void 0; - }, [client, state]); - React7.useEffect(() => { - if (hydrationQueue) { - hydrate(client, { queries: hydrationQueue }, optionsRef.current); - } - }, [client, hydrationQueue]); - return children; -}; - -// ../../../../node_modules/.bun/@tanstack+react-query@5.90.21+b1ab299f0a400331/node_modules/@tanstack/react-query/build/modern/useIsFetching.js -var React8 = __toESM(require_react(), 1); -function useIsFetching(filters, queryClient) { - const client = useQueryClient(queryClient); - const queryCache = client.getQueryCache(); - return React8.useSyncExternalStore( - React8.useCallback( - (onStoreChange) => queryCache.subscribe(notifyManager.batchCalls(onStoreChange)), - [queryCache] - ), - () => client.isFetching(filters), - () => client.isFetching(filters) - ); -} - -// ../../../../node_modules/.bun/@tanstack+react-query@5.90.21+b1ab299f0a400331/node_modules/@tanstack/react-query/build/modern/useMutationState.js -var React9 = __toESM(require_react(), 1); -function useIsMutating(filters, queryClient) { - const client = useQueryClient(queryClient); - return useMutationState( - { filters: { ...filters, status: "pending" } }, - client - ).length; -} -function getResult(mutationCache, options) { - return mutationCache.findAll(options.filters).map( - (mutation) => options.select ? options.select(mutation) : mutation.state - ); -} -function useMutationState(options = {}, queryClient) { - const mutationCache = useQueryClient(queryClient).getMutationCache(); - const optionsRef = React9.useRef(options); - const result = React9.useRef(null); - if (result.current === null) { - result.current = getResult(mutationCache, options); - } - React9.useEffect(() => { - optionsRef.current = options; - }); - return React9.useSyncExternalStore( - React9.useCallback( - (onStoreChange) => mutationCache.subscribe(() => { - const nextResult = replaceEqualDeep( - result.current, - getResult(mutationCache, optionsRef.current) - ); - if (result.current !== nextResult) { - result.current = nextResult; - notifyManager.schedule(onStoreChange); - } - }), - [mutationCache] - ), - () => result.current, - () => result.current - ); -} - -// ../../../../node_modules/.bun/@tanstack+react-query@5.90.21+b1ab299f0a400331/node_modules/@tanstack/react-query/build/modern/useMutation.js -var React10 = __toESM(require_react(), 1); -function useMutation(options, queryClient) { - const client = useQueryClient(queryClient); - const [observer] = React10.useState( - () => new MutationObserver( - client, - options - ) - ); - React10.useEffect(() => { - observer.setOptions(options); - }, [observer, options]); - const result = React10.useSyncExternalStore( - React10.useCallback( - (onStoreChange) => observer.subscribe(notifyManager.batchCalls(onStoreChange)), - [observer] - ), - () => observer.getCurrentResult(), - () => observer.getCurrentResult() - ); - const mutate = React10.useCallback( - (variables, mutateOptions) => { - observer.mutate(variables, mutateOptions).catch(noop); - }, - [observer] - ); - if (result.error && shouldThrowError(observer.options.throwOnError, [result.error])) { - throw result.error; - } - return { ...result, mutate, mutateAsync: result.mutate }; -} - -// ../../../../node_modules/.bun/@tanstack+react-query@5.90.21+b1ab299f0a400331/node_modules/@tanstack/react-query/build/modern/mutationOptions.js -function mutationOptions(options) { - return options; -} - -// ../../../../node_modules/.bun/@tanstack+react-query@5.90.21+b1ab299f0a400331/node_modules/@tanstack/react-query/build/modern/useInfiniteQuery.js -function useInfiniteQuery(options, queryClient) { - return useBaseQuery( - options, - InfiniteQueryObserver, - queryClient - ); -} - -export { - timeoutManager, - isServer, - noop, - matchQuery, - matchMutation, - hashKey, - partialMatchKey, - replaceEqualDeep, - keepPreviousData, - skipToken, - shouldThrowError, - focusManager, - defaultShouldDehydrateMutation, - defaultShouldDehydrateQuery, - dehydrate, - hydrate, - defaultScheduler, - notifyManager, - onlineManager, - CancelledError, - isCancelledError, - Query, - QueryObserver, - InfiniteQueryObserver, - Mutation, - MutationCache, - MutationObserver, - QueriesObserver, - QueryCache, - QueryClient, - streamedQuery, - dataTagSymbol, - dataTagErrorSymbol, - unsetMarker, - QueryClientContext, - useQueryClient, - QueryClientProvider, - useIsRestoring, - IsRestoringProvider, - useQueryErrorResetBoundary, - QueryErrorResetBoundary, - useQueries, - useQuery, - useSuspenseQuery, - useSuspenseInfiniteQuery, - useSuspenseQueries, - usePrefetchQuery, - usePrefetchInfiniteQuery, - queryOptions, - infiniteQueryOptions, - HydrationBoundary, - useIsFetching, - useIsMutating, - useMutationState, - useMutation, - mutationOptions, - useInfiniteQuery -}; -//# sourceMappingURL=chunk-GVT3TYT3.js.map diff --git a/features/landing/frontend-standalone/.vite-cache/deps/chunk-GVT3TYT3.js.map b/features/landing/frontend-standalone/.vite-cache/deps/chunk-GVT3TYT3.js.map deleted file mode 100644 index ac94330f6..000000000 --- a/features/landing/frontend-standalone/.vite-cache/deps/chunk-GVT3TYT3.js.map +++ /dev/null @@ -1,7 +0,0 @@ -{ - "version": 3, - "sources": ["../../../../../../node_modules/.bun/@tanstack+query-core@5.90.20/node_modules/@tanstack/query-core/src/subscribable.ts", "../../../../../../node_modules/.bun/@tanstack+query-core@5.90.20/node_modules/@tanstack/query-core/src/timeoutManager.ts", "../../../../../../node_modules/.bun/@tanstack+query-core@5.90.20/node_modules/@tanstack/query-core/src/utils.ts", "../../../../../../node_modules/.bun/@tanstack+query-core@5.90.20/node_modules/@tanstack/query-core/src/focusManager.ts", "../../../../../../node_modules/.bun/@tanstack+query-core@5.90.20/node_modules/@tanstack/query-core/src/thenable.ts", "../../../../../../node_modules/.bun/@tanstack+query-core@5.90.20/node_modules/@tanstack/query-core/src/hydration.ts", "../../../../../../node_modules/.bun/@tanstack+query-core@5.90.20/node_modules/@tanstack/query-core/src/notifyManager.ts", "../../../../../../node_modules/.bun/@tanstack+query-core@5.90.20/node_modules/@tanstack/query-core/src/onlineManager.ts", "../../../../../../node_modules/.bun/@tanstack+query-core@5.90.20/node_modules/@tanstack/query-core/src/retryer.ts", "../../../../../../node_modules/.bun/@tanstack+query-core@5.90.20/node_modules/@tanstack/query-core/src/removable.ts", "../../../../../../node_modules/.bun/@tanstack+query-core@5.90.20/node_modules/@tanstack/query-core/src/query.ts", "../../../../../../node_modules/.bun/@tanstack+query-core@5.90.20/node_modules/@tanstack/query-core/src/queryObserver.ts", "../../../../../../node_modules/.bun/@tanstack+query-core@5.90.20/node_modules/@tanstack/query-core/src/infiniteQueryBehavior.ts", "../../../../../../node_modules/.bun/@tanstack+query-core@5.90.20/node_modules/@tanstack/query-core/src/infiniteQueryObserver.ts", "../../../../../../node_modules/.bun/@tanstack+query-core@5.90.20/node_modules/@tanstack/query-core/src/mutation.ts", "../../../../../../node_modules/.bun/@tanstack+query-core@5.90.20/node_modules/@tanstack/query-core/src/mutationCache.ts", "../../../../../../node_modules/.bun/@tanstack+query-core@5.90.20/node_modules/@tanstack/query-core/src/mutationObserver.ts", "../../../../../../node_modules/.bun/@tanstack+query-core@5.90.20/node_modules/@tanstack/query-core/src/queriesObserver.ts", "../../../../../../node_modules/.bun/@tanstack+query-core@5.90.20/node_modules/@tanstack/query-core/src/queryCache.ts", "../../../../../../node_modules/.bun/@tanstack+query-core@5.90.20/node_modules/@tanstack/query-core/src/queryClient.ts", "../../../../../../node_modules/.bun/@tanstack+query-core@5.90.20/node_modules/@tanstack/query-core/src/streamedQuery.ts", "../../../../../../node_modules/.bun/@tanstack+query-core@5.90.20/node_modules/@tanstack/query-core/src/types.ts", "../../../../../../node_modules/.bun/@tanstack+react-query@5.90.21+b1ab299f0a400331/node_modules/@tanstack/react-query/src/useQueries.ts", "../../../../../../node_modules/.bun/@tanstack+react-query@5.90.21+b1ab299f0a400331/node_modules/@tanstack/react-query/src/QueryClientProvider.tsx", "../../../../../../node_modules/.bun/@tanstack+react-query@5.90.21+b1ab299f0a400331/node_modules/@tanstack/react-query/src/IsRestoringProvider.ts", "../../../../../../node_modules/.bun/@tanstack+react-query@5.90.21+b1ab299f0a400331/node_modules/@tanstack/react-query/src/QueryErrorResetBoundary.tsx", "../../../../../../node_modules/.bun/@tanstack+react-query@5.90.21+b1ab299f0a400331/node_modules/@tanstack/react-query/src/errorBoundaryUtils.ts", "../../../../../../node_modules/.bun/@tanstack+react-query@5.90.21+b1ab299f0a400331/node_modules/@tanstack/react-query/src/suspense.ts", "../../../../../../node_modules/.bun/@tanstack+react-query@5.90.21+b1ab299f0a400331/node_modules/@tanstack/react-query/src/useBaseQuery.ts", "../../../../../../node_modules/.bun/@tanstack+react-query@5.90.21+b1ab299f0a400331/node_modules/@tanstack/react-query/src/useQuery.ts", "../../../../../../node_modules/.bun/@tanstack+react-query@5.90.21+b1ab299f0a400331/node_modules/@tanstack/react-query/src/useSuspenseQuery.ts", "../../../../../../node_modules/.bun/@tanstack+react-query@5.90.21+b1ab299f0a400331/node_modules/@tanstack/react-query/src/useSuspenseInfiniteQuery.ts", "../../../../../../node_modules/.bun/@tanstack+react-query@5.90.21+b1ab299f0a400331/node_modules/@tanstack/react-query/src/useSuspenseQueries.ts", "../../../../../../node_modules/.bun/@tanstack+react-query@5.90.21+b1ab299f0a400331/node_modules/@tanstack/react-query/src/usePrefetchQuery.tsx", "../../../../../../node_modules/.bun/@tanstack+react-query@5.90.21+b1ab299f0a400331/node_modules/@tanstack/react-query/src/usePrefetchInfiniteQuery.tsx", "../../../../../../node_modules/.bun/@tanstack+react-query@5.90.21+b1ab299f0a400331/node_modules/@tanstack/react-query/src/queryOptions.ts", "../../../../../../node_modules/.bun/@tanstack+react-query@5.90.21+b1ab299f0a400331/node_modules/@tanstack/react-query/src/infiniteQueryOptions.ts", "../../../../../../node_modules/.bun/@tanstack+react-query@5.90.21+b1ab299f0a400331/node_modules/@tanstack/react-query/src/HydrationBoundary.tsx", "../../../../../../node_modules/.bun/@tanstack+react-query@5.90.21+b1ab299f0a400331/node_modules/@tanstack/react-query/src/useIsFetching.ts", "../../../../../../node_modules/.bun/@tanstack+react-query@5.90.21+b1ab299f0a400331/node_modules/@tanstack/react-query/src/useMutationState.ts", "../../../../../../node_modules/.bun/@tanstack+react-query@5.90.21+b1ab299f0a400331/node_modules/@tanstack/react-query/src/useMutation.ts", "../../../../../../node_modules/.bun/@tanstack+react-query@5.90.21+b1ab299f0a400331/node_modules/@tanstack/react-query/src/mutationOptions.ts", "../../../../../../node_modules/.bun/@tanstack+react-query@5.90.21+b1ab299f0a400331/node_modules/@tanstack/react-query/src/useInfiniteQuery.ts"], - "sourcesContent": ["export class Subscribable {\n protected listeners = new Set()\n\n constructor() {\n this.subscribe = this.subscribe.bind(this)\n }\n\n subscribe(listener: TListener): () => void {\n this.listeners.add(listener)\n\n this.onSubscribe()\n\n return () => {\n this.listeners.delete(listener)\n this.onUnsubscribe()\n }\n }\n\n hasListeners(): boolean {\n return this.listeners.size > 0\n }\n\n protected onSubscribe(): void {\n // Do nothing\n }\n\n protected onUnsubscribe(): void {\n // Do nothing\n }\n}\n", "/**\n * {@link TimeoutManager} does not support passing arguments to the callback.\n *\n * `(_: void)` is the argument type inferred by TypeScript's default typings for\n * `setTimeout(cb, number)`.\n * If we don't accept a single void argument, then\n * `new Promise(resolve => timeoutManager.setTimeout(resolve, N))` is a type error.\n */\nexport type TimeoutCallback = (_: void) => void\n\n/**\n * Wrapping `setTimeout` is awkward from a typing perspective because platform\n * typings may extend the return type of `setTimeout`. For example, NodeJS\n * typings add `NodeJS.Timeout`; but a non-default `timeoutManager` may not be\n * able to return such a type.\n */\nexport type ManagedTimerId = number | { [Symbol.toPrimitive]: () => number }\n\n/**\n * Backend for timer functions.\n */\nexport type TimeoutProvider =\n {\n readonly setTimeout: (callback: TimeoutCallback, delay: number) => TTimerId\n readonly clearTimeout: (timeoutId: TTimerId | undefined) => void\n\n readonly setInterval: (callback: TimeoutCallback, delay: number) => TTimerId\n readonly clearInterval: (intervalId: TTimerId | undefined) => void\n }\n\nexport const defaultTimeoutProvider: TimeoutProvider<\n ReturnType\n> = {\n // We need the wrapper function syntax below instead of direct references to\n // global setTimeout etc.\n //\n // BAD: `setTimeout: setTimeout`\n // GOOD: `setTimeout: (cb, delay) => setTimeout(cb, delay)`\n //\n // If we use direct references here, then anything that wants to spy on or\n // replace the global setTimeout (like tests) won't work since we'll already\n // have a hard reference to the original implementation at the time when this\n // file was imported.\n setTimeout: (callback, delay) => setTimeout(callback, delay),\n clearTimeout: (timeoutId) => clearTimeout(timeoutId),\n\n setInterval: (callback, delay) => setInterval(callback, delay),\n clearInterval: (intervalId) => clearInterval(intervalId),\n}\n\n/**\n * Allows customization of how timeouts are created.\n *\n * @tanstack/query-core makes liberal use of timeouts to implement `staleTime`\n * and `gcTime`. The default TimeoutManager provider uses the platform's global\n * `setTimeout` implementation, which is known to have scalability issues with\n * thousands of timeouts on the event loop.\n *\n * If you hit this limitation, consider providing a custom TimeoutProvider that\n * coalesces timeouts.\n */\nexport class TimeoutManager implements Omit {\n // We cannot have TimeoutManager as we must instantiate it with a concrete\n // type at app boot; and if we leave that type, then any new timer provider\n // would need to support ReturnType, which is infeasible.\n //\n // We settle for type safety for the TimeoutProvider type, and accept that\n // this class is unsafe internally to allow for extension.\n #provider: TimeoutProvider = defaultTimeoutProvider\n #providerCalled = false\n\n setTimeoutProvider(\n provider: TimeoutProvider,\n ): void {\n if (process.env.NODE_ENV !== 'production') {\n if (this.#providerCalled && provider !== this.#provider) {\n // After changing providers, `clearTimeout` will not work as expected for\n // timeouts from the previous provider.\n //\n // Since they may allocate the same timeout ID, clearTimeout may cancel an\n // arbitrary different timeout, or unexpected no-op.\n //\n // We could protect against this by mixing the timeout ID bits\n // deterministically with some per-provider bits.\n //\n // We could internally queue `setTimeout` calls to `TimeoutManager` until\n // some API call to set the initial provider.\n console.error(\n `[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.`,\n { previous: this.#provider, provider },\n )\n }\n }\n\n this.#provider = provider\n if (process.env.NODE_ENV !== 'production') {\n this.#providerCalled = false\n }\n }\n\n setTimeout(callback: TimeoutCallback, delay: number): ManagedTimerId {\n if (process.env.NODE_ENV !== 'production') {\n this.#providerCalled = true\n }\n return this.#provider.setTimeout(callback, delay)\n }\n\n clearTimeout(timeoutId: ManagedTimerId | undefined): void {\n this.#provider.clearTimeout(timeoutId)\n }\n\n setInterval(callback: TimeoutCallback, delay: number): ManagedTimerId {\n if (process.env.NODE_ENV !== 'production') {\n this.#providerCalled = true\n }\n return this.#provider.setInterval(callback, delay)\n }\n\n clearInterval(intervalId: ManagedTimerId | undefined): void {\n this.#provider.clearInterval(intervalId)\n }\n}\n\nexport const timeoutManager = new TimeoutManager()\n\n/**\n * In many cases code wants to delay to the next event loop tick; this is not\n * mediated by {@link timeoutManager}.\n *\n * This function is provided to make auditing the `tanstack/query-core` for\n * incorrect use of system `setTimeout` easier.\n */\nexport function systemSetTimeoutZero(callback: TimeoutCallback): void {\n setTimeout(callback, 0)\n}\n", "import { timeoutManager } from './timeoutManager'\nimport type {\n DefaultError,\n Enabled,\n FetchStatus,\n MutationKey,\n MutationStatus,\n QueryFunction,\n QueryKey,\n QueryOptions,\n StaleTime,\n StaleTimeFunction,\n} from './types'\nimport type { Mutation } from './mutation'\nimport type { FetchOptions, Query } from './query'\n\n// TYPES\n\ntype DropLast> = T extends readonly [\n ...infer R,\n unknown,\n]\n ? readonly [...R]\n : never\n\ntype TuplePrefixes> = T extends readonly []\n ? readonly []\n : TuplePrefixes> | T\n\nexport interface QueryFilters {\n /**\n * Filter to active queries, inactive queries or all queries\n */\n type?: QueryTypeFilter\n /**\n * Match query key exactly\n */\n exact?: boolean\n /**\n * Include queries matching this predicate function\n */\n predicate?: (query: Query) => boolean\n /**\n * Include queries matching this query key\n */\n queryKey?: TQueryKey | TuplePrefixes\n /**\n * Include or exclude stale queries\n */\n stale?: boolean\n /**\n * Include queries matching their fetchStatus\n */\n fetchStatus?: FetchStatus\n}\n\nexport interface MutationFilters<\n TData = unknown,\n TError = DefaultError,\n TVariables = unknown,\n TOnMutateResult = unknown,\n> {\n /**\n * Match mutation key exactly\n */\n exact?: boolean\n /**\n * Include mutations matching this predicate function\n */\n predicate?: (\n mutation: Mutation,\n ) => boolean\n /**\n * Include mutations matching this mutation key\n */\n mutationKey?: TuplePrefixes\n /**\n * Filter by mutation status\n */\n status?: MutationStatus\n}\n\nexport type Updater = TOutput | ((input: TInput) => TOutput)\n\nexport type QueryTypeFilter = 'all' | 'active' | 'inactive'\n\n// UTILS\n\nexport const isServer = typeof window === 'undefined' || 'Deno' in globalThis\n\nexport function noop(): void\nexport function noop(): undefined\nexport function noop() {}\n\nexport function functionalUpdate(\n updater: Updater,\n input: TInput,\n): TOutput {\n return typeof updater === 'function'\n ? (updater as (_: TInput) => TOutput)(input)\n : updater\n}\n\nexport function isValidTimeout(value: unknown): value is number {\n return typeof value === 'number' && value >= 0 && value !== Infinity\n}\n\nexport function timeUntilStale(updatedAt: number, staleTime?: number): number {\n return Math.max(updatedAt + (staleTime || 0) - Date.now(), 0)\n}\n\nexport function resolveStaleTime<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n staleTime:\n | undefined\n | StaleTimeFunction,\n query: Query,\n): StaleTime | undefined {\n return typeof staleTime === 'function' ? staleTime(query) : staleTime\n}\n\nexport function resolveEnabled<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n enabled: undefined | Enabled,\n query: Query,\n): boolean | undefined {\n return typeof enabled === 'function' ? enabled(query) : enabled\n}\n\nexport function matchQuery(\n filters: QueryFilters,\n query: Query,\n): boolean {\n const {\n type = 'all',\n exact,\n fetchStatus,\n predicate,\n queryKey,\n stale,\n } = filters\n\n if (queryKey) {\n if (exact) {\n if (query.queryHash !== hashQueryKeyByOptions(queryKey, query.options)) {\n return false\n }\n } else if (!partialMatchKey(query.queryKey, queryKey)) {\n return false\n }\n }\n\n if (type !== 'all') {\n const isActive = query.isActive()\n if (type === 'active' && !isActive) {\n return false\n }\n if (type === 'inactive' && isActive) {\n return false\n }\n }\n\n if (typeof stale === 'boolean' && query.isStale() !== stale) {\n return false\n }\n\n if (fetchStatus && fetchStatus !== query.state.fetchStatus) {\n return false\n }\n\n if (predicate && !predicate(query)) {\n return false\n }\n\n return true\n}\n\nexport function matchMutation(\n filters: MutationFilters,\n mutation: Mutation,\n): boolean {\n const { exact, status, predicate, mutationKey } = filters\n if (mutationKey) {\n if (!mutation.options.mutationKey) {\n return false\n }\n if (exact) {\n if (hashKey(mutation.options.mutationKey) !== hashKey(mutationKey)) {\n return false\n }\n } else if (!partialMatchKey(mutation.options.mutationKey, mutationKey)) {\n return false\n }\n }\n\n if (status && mutation.state.status !== status) {\n return false\n }\n\n if (predicate && !predicate(mutation)) {\n return false\n }\n\n return true\n}\n\nexport function hashQueryKeyByOptions(\n queryKey: TQueryKey,\n options?: Pick, 'queryKeyHashFn'>,\n): string {\n const hashFn = options?.queryKeyHashFn || hashKey\n return hashFn(queryKey)\n}\n\n/**\n * Default query & mutation keys hash function.\n * Hashes the value into a stable hash.\n */\nexport function hashKey(queryKey: QueryKey | MutationKey): string {\n return JSON.stringify(queryKey, (_, val) =>\n isPlainObject(val)\n ? Object.keys(val)\n .sort()\n .reduce((result, key) => {\n result[key] = val[key]\n return result\n }, {} as any)\n : val,\n )\n}\n\n/**\n * Checks if key `b` partially matches with key `a`.\n */\nexport function partialMatchKey(a: QueryKey, b: QueryKey): boolean\nexport function partialMatchKey(a: any, b: any): boolean {\n if (a === b) {\n return true\n }\n\n if (typeof a !== typeof b) {\n return false\n }\n\n if (a && b && typeof a === 'object' && typeof b === 'object') {\n return Object.keys(b).every((key) => partialMatchKey(a[key], b[key]))\n }\n\n return false\n}\n\nconst hasOwn = Object.prototype.hasOwnProperty\n\n/**\n * This function returns `a` if `b` is deeply equal.\n * If not, it will replace any deeply equal children of `b` with those of `a`.\n * This can be used for structural sharing between JSON values for example.\n */\nexport function replaceEqualDeep(a: unknown, b: T, depth?: number): T\nexport function replaceEqualDeep(a: any, b: any, depth = 0): any {\n if (a === b) {\n return a\n }\n\n if (depth > 500) return b\n\n const array = isPlainArray(a) && isPlainArray(b)\n\n if (!array && !(isPlainObject(a) && isPlainObject(b))) return b\n\n const aItems = array ? a : Object.keys(a)\n const aSize = aItems.length\n const bItems = array ? b : Object.keys(b)\n const bSize = bItems.length\n const copy: any = array ? new Array(bSize) : {}\n\n let equalItems = 0\n\n for (let i = 0; i < bSize; i++) {\n const key: any = array ? i : bItems[i]\n const aItem = a[key]\n const bItem = b[key]\n\n if (aItem === bItem) {\n copy[key] = aItem\n if (array ? i < aSize : hasOwn.call(a, key)) equalItems++\n continue\n }\n\n if (\n aItem === null ||\n bItem === null ||\n typeof aItem !== 'object' ||\n typeof bItem !== 'object'\n ) {\n copy[key] = bItem\n continue\n }\n\n const v = replaceEqualDeep(aItem, bItem, depth + 1)\n copy[key] = v\n if (v === aItem) equalItems++\n }\n\n return aSize === bSize && equalItems === aSize ? a : copy\n}\n\n/**\n * Shallow compare objects.\n */\nexport function shallowEqualObjects>(\n a: T,\n b: T | undefined,\n): boolean {\n if (!b || Object.keys(a).length !== Object.keys(b).length) {\n return false\n }\n\n for (const key in a) {\n if (a[key] !== b[key]) {\n return false\n }\n }\n\n return true\n}\n\nexport function isPlainArray(value: unknown): value is Array {\n return Array.isArray(value) && value.length === Object.keys(value).length\n}\n\n// Copied from: https://github.com/jonschlinkert/is-plain-object\nexport function isPlainObject(o: any): o is Record {\n if (!hasObjectPrototype(o)) {\n return false\n }\n\n // If has no constructor\n const ctor = o.constructor\n if (ctor === undefined) {\n return true\n }\n\n // If has modified prototype\n const prot = ctor.prototype\n if (!hasObjectPrototype(prot)) {\n return false\n }\n\n // If constructor does not have an Object-specific method\n if (!prot.hasOwnProperty('isPrototypeOf')) {\n return false\n }\n\n // Handles Objects created by Object.create()\n if (Object.getPrototypeOf(o) !== Object.prototype) {\n return false\n }\n\n // Most likely a plain Object\n return true\n}\n\nfunction hasObjectPrototype(o: any): boolean {\n return Object.prototype.toString.call(o) === '[object Object]'\n}\n\nexport function sleep(timeout: number): Promise {\n return new Promise((resolve) => {\n timeoutManager.setTimeout(resolve, timeout)\n })\n}\n\nexport function replaceData<\n TData,\n TOptions extends QueryOptions,\n>(prevData: TData | undefined, data: TData, options: TOptions): TData {\n if (typeof options.structuralSharing === 'function') {\n return options.structuralSharing(prevData, data) as TData\n } else if (options.structuralSharing !== false) {\n if (process.env.NODE_ENV !== 'production') {\n try {\n return replaceEqualDeep(prevData, data)\n } catch (error) {\n console.error(\n `Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${options.queryHash}]: ${error}`,\n )\n\n // Prevent the replaceEqualDeep from being called again down below.\n throw error\n }\n }\n // Structurally share data between prev and new data if needed\n return replaceEqualDeep(prevData, data)\n }\n return data\n}\n\nexport function keepPreviousData(\n previousData: T | undefined,\n): T | undefined {\n return previousData\n}\n\nexport function addToEnd(items: Array, item: T, max = 0): Array {\n const newItems = [...items, item]\n return max && newItems.length > max ? newItems.slice(1) : newItems\n}\n\nexport function addToStart(items: Array, item: T, max = 0): Array {\n const newItems = [item, ...items]\n return max && newItems.length > max ? newItems.slice(0, -1) : newItems\n}\n\nexport const skipToken = Symbol()\nexport type SkipToken = typeof skipToken\n\nexport function ensureQueryFn<\n TQueryFnData = unknown,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: {\n queryFn?: QueryFunction | SkipToken\n queryHash?: string\n },\n fetchOptions?: FetchOptions,\n): QueryFunction {\n if (process.env.NODE_ENV !== 'production') {\n if (options.queryFn === skipToken) {\n console.error(\n `Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${options.queryHash}'`,\n )\n }\n }\n\n // if we attempt to retry a fetch that was triggered from an initialPromise\n // when we don't have a queryFn yet, we can't retry, so we just return the already rejected initialPromise\n // if an observer has already mounted, we will be able to retry with that queryFn\n if (!options.queryFn && fetchOptions?.initialPromise) {\n return () => fetchOptions.initialPromise!\n }\n\n if (!options.queryFn || options.queryFn === skipToken) {\n return () =>\n Promise.reject(new Error(`Missing queryFn: '${options.queryHash}'`))\n }\n\n return options.queryFn\n}\n\nexport function shouldThrowError) => boolean>(\n throwOnError: boolean | T | undefined,\n params: Parameters,\n): boolean {\n // Allow throwOnError function to override throwing behavior on a per-error basis\n if (typeof throwOnError === 'function') {\n return throwOnError(...params)\n }\n\n return !!throwOnError\n}\n\nexport function addConsumeAwareSignal(\n object: T,\n getSignal: () => AbortSignal,\n onCancelled: VoidFunction,\n): T & { signal: AbortSignal } {\n let consumed = false\n let signal: AbortSignal | undefined\n\n Object.defineProperty(object, 'signal', {\n enumerable: true,\n get: () => {\n signal ??= getSignal()\n if (consumed) {\n return signal\n }\n\n consumed = true\n if (signal.aborted) {\n onCancelled()\n } else {\n signal.addEventListener('abort', onCancelled, { once: true })\n }\n\n return signal\n },\n })\n\n return object as T & { signal: AbortSignal }\n}\n", "import { Subscribable } from './subscribable'\nimport { isServer } from './utils'\n\ntype Listener = (focused: boolean) => void\n\ntype SetupFn = (\n setFocused: (focused?: boolean) => void,\n) => (() => void) | undefined\n\nexport class FocusManager extends Subscribable {\n #focused?: boolean\n #cleanup?: () => void\n\n #setup: SetupFn\n\n constructor() {\n super()\n this.#setup = (onFocus) => {\n // addEventListener does not exist in React Native, but window does\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n if (!isServer && window.addEventListener) {\n const listener = () => onFocus()\n // Listen to visibilitychange\n window.addEventListener('visibilitychange', listener, false)\n\n return () => {\n // Be sure to unsubscribe if a new handler is set\n window.removeEventListener('visibilitychange', listener)\n }\n }\n return\n }\n }\n\n protected onSubscribe(): void {\n if (!this.#cleanup) {\n this.setEventListener(this.#setup)\n }\n }\n\n protected onUnsubscribe() {\n if (!this.hasListeners()) {\n this.#cleanup?.()\n this.#cleanup = undefined\n }\n }\n\n setEventListener(setup: SetupFn): void {\n this.#setup = setup\n this.#cleanup?.()\n this.#cleanup = setup((focused) => {\n if (typeof focused === 'boolean') {\n this.setFocused(focused)\n } else {\n this.onFocus()\n }\n })\n }\n\n setFocused(focused?: boolean): void {\n const changed = this.#focused !== focused\n if (changed) {\n this.#focused = focused\n this.onFocus()\n }\n }\n\n onFocus(): void {\n const isFocused = this.isFocused()\n this.listeners.forEach((listener) => {\n listener(isFocused)\n })\n }\n\n isFocused(): boolean {\n if (typeof this.#focused === 'boolean') {\n return this.#focused\n }\n\n // document global can be unavailable in react native\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n return globalThis.document?.visibilityState !== 'hidden'\n }\n}\n\nexport const focusManager = new FocusManager()\n", "/**\n * Thenable types which matches React's types for promises\n *\n * React seemingly uses `.status`, `.value` and `.reason` properties on a promises to optimistically unwrap data from promises\n *\n * @see https://github.com/facebook/react/blob/main/packages/shared/ReactTypes.js#L112-L138\n * @see https://github.com/facebook/react/blob/4f604941569d2e8947ce1460a0b2997e835f37b9/packages/react-debug-tools/src/ReactDebugHooks.js#L224-L227\n */\n\nimport { noop } from './utils'\n\ninterface Fulfilled {\n status: 'fulfilled'\n value: T\n}\ninterface Rejected {\n status: 'rejected'\n reason: unknown\n}\ninterface Pending {\n status: 'pending'\n\n /**\n * Resolve the promise with a value.\n * Will remove the `resolve` and `reject` properties from the promise.\n */\n resolve: (value: T) => void\n /**\n * Reject the promise with a reason.\n * Will remove the `resolve` and `reject` properties from the promise.\n */\n reject: (reason: unknown) => void\n}\n\nexport type FulfilledThenable = Promise & Fulfilled\nexport type RejectedThenable = Promise & Rejected\nexport type PendingThenable = Promise & Pending\n\nexport type Thenable =\n | FulfilledThenable\n | RejectedThenable\n | PendingThenable\n\nexport function pendingThenable(): PendingThenable {\n let resolve: Pending['resolve']\n let reject: Pending['reject']\n // this could use `Promise.withResolvers()` in the future\n const thenable = new Promise((_resolve, _reject) => {\n resolve = _resolve\n reject = _reject\n }) as PendingThenable\n\n thenable.status = 'pending'\n thenable.catch(() => {\n // prevent unhandled rejection errors\n })\n\n function finalize(data: Fulfilled | Rejected) {\n Object.assign(thenable, data)\n\n // clear pending props props to avoid calling them twice\n delete (thenable as Partial>).resolve\n delete (thenable as Partial>).reject\n }\n\n thenable.resolve = (value) => {\n finalize({\n status: 'fulfilled',\n value,\n })\n\n resolve(value)\n }\n thenable.reject = (reason) => {\n finalize({\n status: 'rejected',\n reason,\n })\n\n reject(reason)\n }\n\n return thenable\n}\n\n/**\n * This function takes a Promise-like input and detects whether the data\n * is synchronously available or not.\n *\n * It does not inspect .status, .value or .reason properties of the promise,\n * as those are not always available, and the .status of React's promises\n * should not be considered part of the public API.\n */\nexport function tryResolveSync(promise: Promise | Thenable) {\n let data: unknown\n\n promise\n .then((result) => {\n data = result\n return result\n }, noop)\n // .catch can be unavailable on certain kinds of thenable's\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n ?.catch(noop)\n\n if (data !== undefined) {\n return { data }\n }\n\n return undefined\n}\n", "import { tryResolveSync } from './thenable'\nimport { noop } from './utils'\nimport type {\n DefaultError,\n MutationKey,\n MutationMeta,\n MutationOptions,\n MutationScope,\n QueryKey,\n QueryMeta,\n QueryOptions,\n} from './types'\nimport type { QueryClient } from './queryClient'\nimport type { Query, QueryState } from './query'\nimport type { Mutation, MutationState } from './mutation'\n\n// TYPES\ntype TransformerFn = (data: any) => any\nfunction defaultTransformerFn(data: any): any {\n return data\n}\n\nexport interface DehydrateOptions {\n serializeData?: TransformerFn\n shouldDehydrateMutation?: (mutation: Mutation) => boolean\n shouldDehydrateQuery?: (query: Query) => boolean\n shouldRedactErrors?: (error: unknown) => boolean\n}\n\nexport interface HydrateOptions {\n defaultOptions?: {\n deserializeData?: TransformerFn\n queries?: QueryOptions\n mutations?: MutationOptions\n }\n}\n\ninterface DehydratedMutation {\n mutationKey?: MutationKey\n state: MutationState\n meta?: MutationMeta\n scope?: MutationScope\n}\n\ninterface DehydratedQuery {\n queryHash: string\n queryKey: QueryKey\n state: QueryState\n promise?: Promise\n meta?: QueryMeta\n // This is only optional because older versions of Query might have dehydrated\n // without it which we need to handle for backwards compatibility.\n // This should be changed to required in the future.\n dehydratedAt?: number\n}\n\nexport interface DehydratedState {\n mutations: Array\n queries: Array\n}\n\n// FUNCTIONS\n\nfunction dehydrateMutation(mutation: Mutation): DehydratedMutation {\n return {\n mutationKey: mutation.options.mutationKey,\n state: mutation.state,\n ...(mutation.options.scope && { scope: mutation.options.scope }),\n ...(mutation.meta && { meta: mutation.meta }),\n }\n}\n\n// Most config is not dehydrated but instead meant to configure again when\n// consuming the de/rehydrated data, typically with useQuery on the client.\n// Sometimes it might make sense to prefetch data on the server and include\n// in the html-payload, but not consume it on the initial render.\nfunction dehydrateQuery(\n query: Query,\n serializeData: TransformerFn,\n shouldRedactErrors: (error: unknown) => boolean,\n): DehydratedQuery {\n const dehydratePromise = () => {\n const promise = query.promise?.then(serializeData).catch((error) => {\n if (!shouldRedactErrors(error)) {\n // Reject original error if it should not be redacted\n return Promise.reject(error)\n }\n // If not in production, log original error before rejecting redacted error\n if (process.env.NODE_ENV !== 'production') {\n console.error(\n `A query that was dehydrated as pending ended up rejecting. [${query.queryHash}]: ${error}; The error will be redacted in production builds`,\n )\n }\n return Promise.reject(new Error('redacted'))\n })\n\n // Avoid unhandled promise rejections\n // We need the promise we dehydrate to reject to get the correct result into\n // the query cache, but we also want to avoid unhandled promise rejections\n // in whatever environment the prefetches are happening in.\n promise?.catch(noop)\n\n return promise\n }\n\n return {\n dehydratedAt: Date.now(),\n state: {\n ...query.state,\n ...(query.state.data !== undefined && {\n data: serializeData(query.state.data),\n }),\n },\n queryKey: query.queryKey,\n queryHash: query.queryHash,\n ...(query.state.status === 'pending' && {\n promise: dehydratePromise(),\n }),\n ...(query.meta && { meta: query.meta }),\n }\n}\n\nexport function defaultShouldDehydrateMutation(mutation: Mutation) {\n return mutation.state.isPaused\n}\n\nexport function defaultShouldDehydrateQuery(query: Query) {\n return query.state.status === 'success'\n}\n\nfunction defaultShouldRedactErrors(_: unknown) {\n return true\n}\n\nexport function dehydrate(\n client: QueryClient,\n options: DehydrateOptions = {},\n): DehydratedState {\n const filterMutation =\n options.shouldDehydrateMutation ??\n client.getDefaultOptions().dehydrate?.shouldDehydrateMutation ??\n defaultShouldDehydrateMutation\n\n const mutations = client\n .getMutationCache()\n .getAll()\n .flatMap((mutation) =>\n filterMutation(mutation) ? [dehydrateMutation(mutation)] : [],\n )\n\n const filterQuery =\n options.shouldDehydrateQuery ??\n client.getDefaultOptions().dehydrate?.shouldDehydrateQuery ??\n defaultShouldDehydrateQuery\n\n const shouldRedactErrors =\n options.shouldRedactErrors ??\n client.getDefaultOptions().dehydrate?.shouldRedactErrors ??\n defaultShouldRedactErrors\n\n const serializeData =\n options.serializeData ??\n client.getDefaultOptions().dehydrate?.serializeData ??\n defaultTransformerFn\n\n const queries = client\n .getQueryCache()\n .getAll()\n .flatMap((query) =>\n filterQuery(query)\n ? [dehydrateQuery(query, serializeData, shouldRedactErrors)]\n : [],\n )\n\n return { mutations, queries }\n}\n\nexport function hydrate(\n client: QueryClient,\n dehydratedState: unknown,\n options?: HydrateOptions,\n): void {\n if (typeof dehydratedState !== 'object' || dehydratedState === null) {\n return\n }\n\n const mutationCache = client.getMutationCache()\n const queryCache = client.getQueryCache()\n const deserializeData =\n options?.defaultOptions?.deserializeData ??\n client.getDefaultOptions().hydrate?.deserializeData ??\n defaultTransformerFn\n\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n const mutations = (dehydratedState as DehydratedState).mutations || []\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n const queries = (dehydratedState as DehydratedState).queries || []\n\n mutations.forEach(({ state, ...mutationOptions }) => {\n mutationCache.build(\n client,\n {\n ...client.getDefaultOptions().hydrate?.mutations,\n ...options?.defaultOptions?.mutations,\n ...mutationOptions,\n },\n state,\n )\n })\n\n queries.forEach(\n ({ queryKey, state, queryHash, meta, promise, dehydratedAt }) => {\n const syncData = promise ? tryResolveSync(promise) : undefined\n const rawData = state.data === undefined ? syncData?.data : state.data\n const data = rawData === undefined ? rawData : deserializeData(rawData)\n\n let query = queryCache.get(queryHash)\n const existingQueryIsPending = query?.state.status === 'pending'\n const existingQueryIsFetching = query?.state.fetchStatus === 'fetching'\n\n // Do not hydrate if an existing query exists with newer data\n if (query) {\n const hasNewerSyncData =\n syncData &&\n // We only need this undefined check to handle older dehydration\n // payloads that might not have dehydratedAt\n dehydratedAt !== undefined &&\n dehydratedAt > query.state.dataUpdatedAt\n if (\n state.dataUpdatedAt > query.state.dataUpdatedAt ||\n hasNewerSyncData\n ) {\n // omit fetchStatus from dehydrated state\n // so that query stays in its current fetchStatus\n const { fetchStatus: _ignored, ...serializedState } = state\n query.setState({\n ...serializedState,\n data,\n })\n }\n } else {\n // Restore query\n query = queryCache.build(\n client,\n {\n ...client.getDefaultOptions().hydrate?.queries,\n ...options?.defaultOptions?.queries,\n queryKey,\n queryHash,\n meta,\n },\n // Reset fetch status to idle to avoid\n // query being stuck in fetching state upon hydration\n {\n ...state,\n data,\n fetchStatus: 'idle',\n status: data !== undefined ? 'success' : state.status,\n },\n )\n }\n\n if (\n promise &&\n !existingQueryIsPending &&\n !existingQueryIsFetching &&\n // Only hydrate if dehydration is newer than any existing data,\n // this is always true for new queries\n (dehydratedAt === undefined || dehydratedAt > query.state.dataUpdatedAt)\n ) {\n // This doesn't actually fetch - it just creates a retryer\n // which will re-use the passed `initialPromise`\n // Note that we need to call these even when data was synchronously\n // available, as we still need to set up the retryer\n query\n .fetch(undefined, {\n // RSC transformed promises are not thenable\n initialPromise: Promise.resolve(promise).then(deserializeData),\n })\n // Avoid unhandled promise rejections\n .catch(noop)\n }\n },\n )\n}\n", "// TYPES\n\nimport { systemSetTimeoutZero } from './timeoutManager'\n\ntype NotifyCallback = () => void\n\ntype NotifyFunction = (callback: () => void) => void\n\ntype BatchNotifyFunction = (callback: () => void) => void\n\ntype BatchCallsCallback> = (...args: T) => void\n\ntype ScheduleFunction = (callback: () => void) => void\n\nexport const defaultScheduler: ScheduleFunction = systemSetTimeoutZero\n\nexport function createNotifyManager() {\n let queue: Array = []\n let transactions = 0\n let notifyFn: NotifyFunction = (callback) => {\n callback()\n }\n let batchNotifyFn: BatchNotifyFunction = (callback: () => void) => {\n callback()\n }\n let scheduleFn = defaultScheduler\n\n const schedule = (callback: NotifyCallback): void => {\n if (transactions) {\n queue.push(callback)\n } else {\n scheduleFn(() => {\n notifyFn(callback)\n })\n }\n }\n const flush = (): void => {\n const originalQueue = queue\n queue = []\n if (originalQueue.length) {\n scheduleFn(() => {\n batchNotifyFn(() => {\n originalQueue.forEach((callback) => {\n notifyFn(callback)\n })\n })\n })\n }\n }\n\n return {\n batch: (callback: () => T): T => {\n let result\n transactions++\n try {\n result = callback()\n } finally {\n transactions--\n if (!transactions) {\n flush()\n }\n }\n return result\n },\n /**\n * All calls to the wrapped function will be batched.\n */\n batchCalls: >(\n callback: BatchCallsCallback,\n ): BatchCallsCallback => {\n return (...args) => {\n schedule(() => {\n callback(...args)\n })\n }\n },\n schedule,\n /**\n * Use this method to set a custom notify function.\n * This can be used to for example wrap notifications with `React.act` while running tests.\n */\n setNotifyFunction: (fn: NotifyFunction) => {\n notifyFn = fn\n },\n /**\n * Use this method to set a custom function to batch notifications together into a single tick.\n * By default React Query will use the batch function provided by ReactDOM or React Native.\n */\n setBatchNotifyFunction: (fn: BatchNotifyFunction) => {\n batchNotifyFn = fn\n },\n setScheduler: (fn: ScheduleFunction) => {\n scheduleFn = fn\n },\n } as const\n}\n\n// SINGLETON\nexport const notifyManager = createNotifyManager()\n", "import { Subscribable } from './subscribable'\nimport { isServer } from './utils'\n\ntype Listener = (online: boolean) => void\ntype SetupFn = (setOnline: Listener) => (() => void) | undefined\n\nexport class OnlineManager extends Subscribable {\n #online = true\n #cleanup?: () => void\n\n #setup: SetupFn\n\n constructor() {\n super()\n this.#setup = (onOnline) => {\n // addEventListener does not exist in React Native, but window does\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n if (!isServer && window.addEventListener) {\n const onlineListener = () => onOnline(true)\n const offlineListener = () => onOnline(false)\n // Listen to online\n window.addEventListener('online', onlineListener, false)\n window.addEventListener('offline', offlineListener, false)\n\n return () => {\n // Be sure to unsubscribe if a new handler is set\n window.removeEventListener('online', onlineListener)\n window.removeEventListener('offline', offlineListener)\n }\n }\n\n return\n }\n }\n\n protected onSubscribe(): void {\n if (!this.#cleanup) {\n this.setEventListener(this.#setup)\n }\n }\n\n protected onUnsubscribe() {\n if (!this.hasListeners()) {\n this.#cleanup?.()\n this.#cleanup = undefined\n }\n }\n\n setEventListener(setup: SetupFn): void {\n this.#setup = setup\n this.#cleanup?.()\n this.#cleanup = setup(this.setOnline.bind(this))\n }\n\n setOnline(online: boolean): void {\n const changed = this.#online !== online\n\n if (changed) {\n this.#online = online\n this.listeners.forEach((listener) => {\n listener(online)\n })\n }\n }\n\n isOnline(): boolean {\n return this.#online\n }\n}\n\nexport const onlineManager = new OnlineManager()\n", "import { focusManager } from './focusManager'\nimport { onlineManager } from './onlineManager'\nimport { pendingThenable } from './thenable'\nimport { isServer, sleep } from './utils'\nimport type { Thenable } from './thenable'\nimport type { CancelOptions, DefaultError, NetworkMode } from './types'\n\n// TYPES\n\ninterface RetryerConfig {\n fn: () => TData | Promise\n initialPromise?: Promise\n onCancel?: (error: TError) => void\n onFail?: (failureCount: number, error: TError) => void\n onPause?: () => void\n onContinue?: () => void\n retry?: RetryValue\n retryDelay?: RetryDelayValue\n networkMode: NetworkMode | undefined\n canRun: () => boolean\n}\n\nexport interface Retryer {\n promise: Promise\n cancel: (cancelOptions?: CancelOptions) => void\n continue: () => Promise\n cancelRetry: () => void\n continueRetry: () => void\n canStart: () => boolean\n start: () => Promise\n status: () => 'pending' | 'resolved' | 'rejected'\n}\n\nexport type RetryValue = boolean | number | ShouldRetryFunction\n\ntype ShouldRetryFunction = (\n failureCount: number,\n error: TError,\n) => boolean\n\nexport type RetryDelayValue = number | RetryDelayFunction\n\ntype RetryDelayFunction = (\n failureCount: number,\n error: TError,\n) => number\n\nfunction defaultRetryDelay(failureCount: number) {\n return Math.min(1000 * 2 ** failureCount, 30000)\n}\n\nexport function canFetch(networkMode: NetworkMode | undefined): boolean {\n return (networkMode ?? 'online') === 'online'\n ? onlineManager.isOnline()\n : true\n}\n\nexport class CancelledError extends Error {\n revert?: boolean\n silent?: boolean\n constructor(options?: CancelOptions) {\n super('CancelledError')\n this.revert = options?.revert\n this.silent = options?.silent\n }\n}\n\n/**\n * @deprecated Use instanceof `CancelledError` instead.\n */\nexport function isCancelledError(value: any): value is CancelledError {\n return value instanceof CancelledError\n}\n\nexport function createRetryer(\n config: RetryerConfig,\n): Retryer {\n let isRetryCancelled = false\n let failureCount = 0\n let continueFn: ((value?: unknown) => void) | undefined\n\n const thenable = pendingThenable()\n\n const isResolved = () =>\n (thenable.status as Thenable['status']) !== 'pending'\n\n const cancel = (cancelOptions?: CancelOptions): void => {\n if (!isResolved()) {\n const error = new CancelledError(cancelOptions) as TError\n reject(error)\n\n config.onCancel?.(error)\n }\n }\n const cancelRetry = () => {\n isRetryCancelled = true\n }\n\n const continueRetry = () => {\n isRetryCancelled = false\n }\n\n const canContinue = () =>\n focusManager.isFocused() &&\n (config.networkMode === 'always' || onlineManager.isOnline()) &&\n config.canRun()\n\n const canStart = () => canFetch(config.networkMode) && config.canRun()\n\n const resolve = (value: any) => {\n if (!isResolved()) {\n continueFn?.()\n thenable.resolve(value)\n }\n }\n\n const reject = (value: any) => {\n if (!isResolved()) {\n continueFn?.()\n thenable.reject(value)\n }\n }\n\n const pause = () => {\n return new Promise((continueResolve) => {\n continueFn = (value) => {\n if (isResolved() || canContinue()) {\n continueResolve(value)\n }\n }\n config.onPause?.()\n }).then(() => {\n continueFn = undefined\n if (!isResolved()) {\n config.onContinue?.()\n }\n })\n }\n\n // Create loop function\n const run = () => {\n // Do nothing if already resolved\n if (isResolved()) {\n return\n }\n\n let promiseOrValue: any\n\n // we can re-use config.initialPromise on the first call of run()\n const initialPromise =\n failureCount === 0 ? config.initialPromise : undefined\n\n // Execute query\n try {\n promiseOrValue = initialPromise ?? config.fn()\n } catch (error) {\n promiseOrValue = Promise.reject(error)\n }\n\n Promise.resolve(promiseOrValue)\n .then(resolve)\n .catch((error) => {\n // Stop if the fetch is already resolved\n if (isResolved()) {\n return\n }\n\n // Do we need to retry the request?\n const retry = config.retry ?? (isServer ? 0 : 3)\n const retryDelay = config.retryDelay ?? defaultRetryDelay\n const delay =\n typeof retryDelay === 'function'\n ? retryDelay(failureCount, error)\n : retryDelay\n const shouldRetry =\n retry === true ||\n (typeof retry === 'number' && failureCount < retry) ||\n (typeof retry === 'function' && retry(failureCount, error))\n\n if (isRetryCancelled || !shouldRetry) {\n // We are done if the query does not need to be retried\n reject(error)\n return\n }\n\n failureCount++\n\n // Notify on fail\n config.onFail?.(failureCount, error)\n\n // Delay\n sleep(delay)\n // Pause if the document is not visible or when the device is offline\n .then(() => {\n return canContinue() ? undefined : pause()\n })\n .then(() => {\n if (isRetryCancelled) {\n reject(error)\n } else {\n run()\n }\n })\n })\n }\n\n return {\n promise: thenable,\n status: () => thenable.status,\n cancel,\n continue: () => {\n continueFn?.()\n return thenable\n },\n cancelRetry,\n continueRetry,\n canStart,\n start: () => {\n // Start loop\n if (canStart()) {\n run()\n } else {\n pause().then(run)\n }\n return thenable\n },\n }\n}\n", "import { timeoutManager } from './timeoutManager'\nimport { isServer, isValidTimeout } from './utils'\nimport type { ManagedTimerId } from './timeoutManager'\n\nexport abstract class Removable {\n gcTime!: number\n #gcTimeout?: ManagedTimerId\n\n destroy(): void {\n this.clearGcTimeout()\n }\n\n protected scheduleGc(): void {\n this.clearGcTimeout()\n\n if (isValidTimeout(this.gcTime)) {\n this.#gcTimeout = timeoutManager.setTimeout(() => {\n this.optionalRemove()\n }, this.gcTime)\n }\n }\n\n protected updateGcTime(newGcTime: number | undefined): void {\n // Default to 5 minutes (Infinity for server-side) if no gcTime is set\n this.gcTime = Math.max(\n this.gcTime || 0,\n newGcTime ?? (isServer ? Infinity : 5 * 60 * 1000),\n )\n }\n\n protected clearGcTimeout() {\n if (this.#gcTimeout) {\n timeoutManager.clearTimeout(this.#gcTimeout)\n this.#gcTimeout = undefined\n }\n }\n\n protected abstract optionalRemove(): void\n}\n", "import {\n ensureQueryFn,\n noop,\n replaceData,\n resolveEnabled,\n resolveStaleTime,\n skipToken,\n timeUntilStale,\n} from './utils'\nimport { notifyManager } from './notifyManager'\nimport { CancelledError, canFetch, createRetryer } from './retryer'\nimport { Removable } from './removable'\nimport type { QueryCache } from './queryCache'\nimport type { QueryClient } from './queryClient'\nimport type {\n CancelOptions,\n DefaultError,\n FetchStatus,\n InitialDataFunction,\n OmitKeyof,\n QueryFunctionContext,\n QueryKey,\n QueryMeta,\n QueryOptions,\n QueryStatus,\n SetDataOptions,\n StaleTime,\n} from './types'\nimport type { QueryObserver } from './queryObserver'\nimport type { Retryer } from './retryer'\n\n// TYPES\n\ninterface QueryConfig<\n TQueryFnData,\n TError,\n TData,\n TQueryKey extends QueryKey = QueryKey,\n> {\n client: QueryClient\n queryKey: TQueryKey\n queryHash: string\n options?: QueryOptions\n defaultOptions?: QueryOptions\n state?: QueryState\n}\n\nexport interface QueryState {\n data: TData | undefined\n dataUpdateCount: number\n dataUpdatedAt: number\n error: TError | null\n errorUpdateCount: number\n errorUpdatedAt: number\n fetchFailureCount: number\n fetchFailureReason: TError | null\n fetchMeta: FetchMeta | null\n isInvalidated: boolean\n status: QueryStatus\n fetchStatus: FetchStatus\n}\n\nexport interface FetchContext<\n TQueryFnData,\n TError,\n TData,\n TQueryKey extends QueryKey = QueryKey,\n> {\n fetchFn: () => unknown | Promise\n fetchOptions?: FetchOptions\n signal: AbortSignal\n options: QueryOptions\n client: QueryClient\n queryKey: TQueryKey\n state: QueryState\n}\n\nexport interface QueryBehavior<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> {\n onFetch: (\n context: FetchContext,\n query: Query,\n ) => void\n}\n\nexport type FetchDirection = 'forward' | 'backward'\n\nexport interface FetchMeta {\n fetchMore?: { direction: FetchDirection }\n}\n\nexport interface FetchOptions {\n cancelRefetch?: boolean\n meta?: FetchMeta\n initialPromise?: Promise\n}\n\ninterface FailedAction {\n type: 'failed'\n failureCount: number\n error: TError\n}\n\ninterface FetchAction {\n type: 'fetch'\n meta?: FetchMeta\n}\n\ninterface SuccessAction {\n data: TData | undefined\n type: 'success'\n dataUpdatedAt?: number\n manual?: boolean\n}\n\ninterface ErrorAction {\n type: 'error'\n error: TError\n}\n\ninterface InvalidateAction {\n type: 'invalidate'\n}\n\ninterface PauseAction {\n type: 'pause'\n}\n\ninterface ContinueAction {\n type: 'continue'\n}\n\ninterface SetStateAction {\n type: 'setState'\n state: Partial>\n setStateOptions?: SetStateOptions\n}\n\nexport type Action =\n | ContinueAction\n | ErrorAction\n | FailedAction\n | FetchAction\n | InvalidateAction\n | PauseAction\n | SetStateAction\n | SuccessAction\n\nexport interface SetStateOptions {\n meta?: any\n}\n\n// CLASS\n\nexport class Query<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> extends Removable {\n queryKey: TQueryKey\n queryHash: string\n options!: QueryOptions\n state: QueryState\n\n #initialState: QueryState\n #revertState?: QueryState\n #cache: QueryCache\n #client: QueryClient\n #retryer?: Retryer\n observers: Array>\n #defaultOptions?: QueryOptions\n #abortSignalConsumed: boolean\n\n constructor(config: QueryConfig) {\n super()\n\n this.#abortSignalConsumed = false\n this.#defaultOptions = config.defaultOptions\n this.setOptions(config.options)\n this.observers = []\n this.#client = config.client\n this.#cache = this.#client.getQueryCache()\n this.queryKey = config.queryKey\n this.queryHash = config.queryHash\n this.#initialState = getDefaultState(this.options)\n this.state = config.state ?? this.#initialState\n this.scheduleGc()\n }\n get meta(): QueryMeta | undefined {\n return this.options.meta\n }\n\n get promise(): Promise | undefined {\n return this.#retryer?.promise\n }\n\n setOptions(\n options?: QueryOptions,\n ): void {\n this.options = { ...this.#defaultOptions, ...options }\n\n this.updateGcTime(this.options.gcTime)\n\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n if (this.state && this.state.data === undefined) {\n const defaultState = getDefaultState(this.options)\n if (defaultState.data !== undefined) {\n this.setState(\n successState(defaultState.data, defaultState.dataUpdatedAt),\n )\n this.#initialState = defaultState\n }\n }\n }\n\n protected optionalRemove() {\n if (!this.observers.length && this.state.fetchStatus === 'idle') {\n this.#cache.remove(this)\n }\n }\n\n setData(\n newData: TData,\n options?: SetDataOptions & { manual: boolean },\n ): TData {\n const data = replaceData(this.state.data, newData, this.options)\n\n // Set data and mark it as cached\n this.#dispatch({\n data,\n type: 'success',\n dataUpdatedAt: options?.updatedAt,\n manual: options?.manual,\n })\n\n return data\n }\n\n setState(\n state: Partial>,\n setStateOptions?: SetStateOptions,\n ): void {\n this.#dispatch({ type: 'setState', state, setStateOptions })\n }\n\n cancel(options?: CancelOptions): Promise {\n const promise = this.#retryer?.promise\n this.#retryer?.cancel(options)\n return promise ? promise.then(noop).catch(noop) : Promise.resolve()\n }\n\n destroy(): void {\n super.destroy()\n\n this.cancel({ silent: true })\n }\n\n reset(): void {\n this.destroy()\n this.setState(this.#initialState)\n }\n\n isActive(): boolean {\n return this.observers.some(\n (observer) => resolveEnabled(observer.options.enabled, this) !== false,\n )\n }\n\n isDisabled(): boolean {\n if (this.getObserversCount() > 0) {\n return !this.isActive()\n }\n // if a query has no observers, it should still be considered disabled if it never attempted a fetch\n return (\n this.options.queryFn === skipToken ||\n this.state.dataUpdateCount + this.state.errorUpdateCount === 0\n )\n }\n\n isStatic(): boolean {\n if (this.getObserversCount() > 0) {\n return this.observers.some(\n (observer) =>\n resolveStaleTime(observer.options.staleTime, this) === 'static',\n )\n }\n\n return false\n }\n\n isStale(): boolean {\n // check observers first, their `isStale` has the source of truth\n // calculated with `isStaleByTime` and it takes `enabled` into account\n if (this.getObserversCount() > 0) {\n return this.observers.some(\n (observer) => observer.getCurrentResult().isStale,\n )\n }\n\n return this.state.data === undefined || this.state.isInvalidated\n }\n\n isStaleByTime(staleTime: StaleTime = 0): boolean {\n // no data is always stale\n if (this.state.data === undefined) {\n return true\n }\n // static is never stale\n if (staleTime === 'static') {\n return false\n }\n // if the query is invalidated, it is stale\n if (this.state.isInvalidated) {\n return true\n }\n\n return !timeUntilStale(this.state.dataUpdatedAt, staleTime)\n }\n\n onFocus(): void {\n const observer = this.observers.find((x) => x.shouldFetchOnWindowFocus())\n\n observer?.refetch({ cancelRefetch: false })\n\n // Continue fetch if currently paused\n this.#retryer?.continue()\n }\n\n onOnline(): void {\n const observer = this.observers.find((x) => x.shouldFetchOnReconnect())\n\n observer?.refetch({ cancelRefetch: false })\n\n // Continue fetch if currently paused\n this.#retryer?.continue()\n }\n\n addObserver(observer: QueryObserver): void {\n if (!this.observers.includes(observer)) {\n this.observers.push(observer)\n\n // Stop the query from being garbage collected\n this.clearGcTimeout()\n\n this.#cache.notify({ type: 'observerAdded', query: this, observer })\n }\n }\n\n removeObserver(observer: QueryObserver): void {\n if (this.observers.includes(observer)) {\n this.observers = this.observers.filter((x) => x !== observer)\n\n if (!this.observers.length) {\n // If the transport layer does not support cancellation\n // we'll let the query continue so the result can be cached\n if (this.#retryer) {\n if (this.#abortSignalConsumed) {\n this.#retryer.cancel({ revert: true })\n } else {\n this.#retryer.cancelRetry()\n }\n }\n\n this.scheduleGc()\n }\n\n this.#cache.notify({ type: 'observerRemoved', query: this, observer })\n }\n }\n\n getObserversCount(): number {\n return this.observers.length\n }\n\n invalidate(): void {\n if (!this.state.isInvalidated) {\n this.#dispatch({ type: 'invalidate' })\n }\n }\n\n async fetch(\n options?: QueryOptions,\n fetchOptions?: FetchOptions,\n ): Promise {\n if (\n this.state.fetchStatus !== 'idle' &&\n // If the promise in the retryer is already rejected, we have to definitely\n // re-start the fetch; there is a chance that the query is still in a\n // pending state when that happens\n this.#retryer?.status() !== 'rejected'\n ) {\n if (this.state.data !== undefined && fetchOptions?.cancelRefetch) {\n // Silently cancel current fetch if the user wants to cancel refetch\n this.cancel({ silent: true })\n } else if (this.#retryer) {\n // make sure that retries that were potentially cancelled due to unmounts can continue\n this.#retryer.continueRetry()\n // Return current promise if we are already fetching\n return this.#retryer.promise\n }\n }\n\n // Update config if passed, otherwise the config from the last execution is used\n if (options) {\n this.setOptions(options)\n }\n\n // Use the options from the first observer with a query function if no function is found.\n // This can happen when the query is hydrated or created with setQueryData.\n if (!this.options.queryFn) {\n const observer = this.observers.find((x) => x.options.queryFn)\n if (observer) {\n this.setOptions(observer.options)\n }\n }\n\n if (process.env.NODE_ENV !== 'production') {\n if (!Array.isArray(this.options.queryKey)) {\n console.error(\n `As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']`,\n )\n }\n }\n\n const abortController = new AbortController()\n\n // Adds an enumerable signal property to the object that\n // which sets abortSignalConsumed to true when the signal\n // is read.\n const addSignalProperty = (object: unknown) => {\n Object.defineProperty(object, 'signal', {\n enumerable: true,\n get: () => {\n this.#abortSignalConsumed = true\n return abortController.signal\n },\n })\n }\n\n // Create fetch function\n const fetchFn = () => {\n const queryFn = ensureQueryFn(this.options, fetchOptions)\n\n // Create query function context\n const createQueryFnContext = (): QueryFunctionContext => {\n const queryFnContext: OmitKeyof<\n QueryFunctionContext,\n 'signal'\n > = {\n client: this.#client,\n queryKey: this.queryKey,\n meta: this.meta,\n }\n addSignalProperty(queryFnContext)\n return queryFnContext as QueryFunctionContext\n }\n\n const queryFnContext = createQueryFnContext()\n\n this.#abortSignalConsumed = false\n if (this.options.persister) {\n return this.options.persister(\n queryFn,\n queryFnContext,\n this as unknown as Query,\n )\n }\n\n return queryFn(queryFnContext)\n }\n\n // Trigger behavior hook\n const createFetchContext = (): FetchContext<\n TQueryFnData,\n TError,\n TData,\n TQueryKey\n > => {\n const context: OmitKeyof<\n FetchContext,\n 'signal'\n > = {\n fetchOptions,\n options: this.options,\n queryKey: this.queryKey,\n client: this.#client,\n state: this.state,\n fetchFn,\n }\n\n addSignalProperty(context)\n return context as FetchContext\n }\n\n const context = createFetchContext()\n\n this.options.behavior?.onFetch(context, this as unknown as Query)\n\n // Store state in case the current fetch needs to be reverted\n this.#revertState = this.state\n\n // Set to fetching state if not already in it\n if (\n this.state.fetchStatus === 'idle' ||\n this.state.fetchMeta !== context.fetchOptions?.meta\n ) {\n this.#dispatch({ type: 'fetch', meta: context.fetchOptions?.meta })\n }\n\n // Try to fetch the data\n this.#retryer = createRetryer({\n initialPromise: fetchOptions?.initialPromise as\n | Promise\n | undefined,\n fn: context.fetchFn as () => Promise,\n onCancel: (error) => {\n if (error instanceof CancelledError && error.revert) {\n this.setState({\n ...this.#revertState,\n fetchStatus: 'idle' as const,\n })\n }\n abortController.abort()\n },\n onFail: (failureCount, error) => {\n this.#dispatch({ type: 'failed', failureCount, error })\n },\n onPause: () => {\n this.#dispatch({ type: 'pause' })\n },\n onContinue: () => {\n this.#dispatch({ type: 'continue' })\n },\n retry: context.options.retry,\n retryDelay: context.options.retryDelay,\n networkMode: context.options.networkMode,\n canRun: () => true,\n })\n\n try {\n const data = await this.#retryer.start()\n // this is more of a runtime guard\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n if (data === undefined) {\n if (process.env.NODE_ENV !== 'production') {\n console.error(\n `Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`,\n )\n }\n throw new Error(`${this.queryHash} data is undefined`)\n }\n\n this.setData(data)\n\n // Notify cache callback\n this.#cache.config.onSuccess?.(data, this as Query)\n this.#cache.config.onSettled?.(\n data,\n this.state.error as any,\n this as Query,\n )\n return data\n } catch (error) {\n if (error instanceof CancelledError) {\n if (error.silent) {\n // silent cancellation implies a new fetch is going to be started,\n // so we piggyback onto that promise\n return this.#retryer.promise\n } else if (error.revert) {\n // transform error into reverted state data\n // if the initial fetch was cancelled, we have no data, so we have\n // to get reject with a CancelledError\n if (this.state.data === undefined) {\n throw error\n }\n return this.state.data\n }\n }\n this.#dispatch({\n type: 'error',\n error: error as TError,\n })\n\n // Notify cache callback\n this.#cache.config.onError?.(\n error as any,\n this as Query,\n )\n this.#cache.config.onSettled?.(\n this.state.data,\n error as any,\n this as Query,\n )\n\n throw error // rethrow the error for further handling\n } finally {\n // Schedule query gc after fetching\n this.scheduleGc()\n }\n }\n\n #dispatch(action: Action): void {\n const reducer = (\n state: QueryState,\n ): QueryState => {\n switch (action.type) {\n case 'failed':\n return {\n ...state,\n fetchFailureCount: action.failureCount,\n fetchFailureReason: action.error,\n }\n case 'pause':\n return {\n ...state,\n fetchStatus: 'paused',\n }\n case 'continue':\n return {\n ...state,\n fetchStatus: 'fetching',\n }\n case 'fetch':\n return {\n ...state,\n ...fetchState(state.data, this.options),\n fetchMeta: action.meta ?? null,\n }\n case 'success':\n const newState = {\n ...state,\n ...successState(action.data, action.dataUpdatedAt),\n dataUpdateCount: state.dataUpdateCount + 1,\n ...(!action.manual && {\n fetchStatus: 'idle' as const,\n fetchFailureCount: 0,\n fetchFailureReason: null,\n }),\n }\n // If fetching ends successfully, we don't need revertState as a fallback anymore.\n // For manual updates, capture the state to revert to it in case of a cancellation.\n this.#revertState = action.manual ? newState : undefined\n\n return newState\n case 'error':\n const error = action.error\n return {\n ...state,\n error,\n errorUpdateCount: state.errorUpdateCount + 1,\n errorUpdatedAt: Date.now(),\n fetchFailureCount: state.fetchFailureCount + 1,\n fetchFailureReason: error,\n fetchStatus: 'idle',\n status: 'error',\n // flag existing data as invalidated if we get a background error\n // note that \"no data\" always means stale so we can set unconditionally here\n isInvalidated: true,\n }\n case 'invalidate':\n return {\n ...state,\n isInvalidated: true,\n }\n case 'setState':\n return {\n ...state,\n ...action.state,\n }\n }\n }\n\n this.state = reducer(this.state)\n\n notifyManager.batch(() => {\n this.observers.forEach((observer) => {\n observer.onQueryUpdate()\n })\n\n this.#cache.notify({ query: this, type: 'updated', action })\n })\n }\n}\n\nexport function fetchState<\n TQueryFnData,\n TError,\n TData,\n TQueryKey extends QueryKey,\n>(\n data: TData | undefined,\n options: QueryOptions,\n) {\n return {\n fetchFailureCount: 0,\n fetchFailureReason: null,\n fetchStatus: canFetch(options.networkMode) ? 'fetching' : 'paused',\n ...(data === undefined &&\n ({\n error: null,\n status: 'pending',\n } as const)),\n } as const\n}\n\nfunction successState(data: TData | undefined, dataUpdatedAt?: number) {\n return {\n data,\n dataUpdatedAt: dataUpdatedAt ?? Date.now(),\n error: null,\n isInvalidated: false,\n status: 'success' as const,\n }\n}\n\nfunction getDefaultState<\n TQueryFnData,\n TError,\n TData,\n TQueryKey extends QueryKey,\n>(\n options: QueryOptions,\n): QueryState {\n const data =\n typeof options.initialData === 'function'\n ? (options.initialData as InitialDataFunction)()\n : options.initialData\n\n const hasData = data !== undefined\n\n const initialDataUpdatedAt = hasData\n ? typeof options.initialDataUpdatedAt === 'function'\n ? options.initialDataUpdatedAt()\n : options.initialDataUpdatedAt\n : 0\n\n return {\n data,\n dataUpdateCount: 0,\n dataUpdatedAt: hasData ? (initialDataUpdatedAt ?? Date.now()) : 0,\n error: null,\n errorUpdateCount: 0,\n errorUpdatedAt: 0,\n fetchFailureCount: 0,\n fetchFailureReason: null,\n fetchMeta: null,\n isInvalidated: false,\n status: hasData ? 'success' : 'pending',\n fetchStatus: 'idle',\n }\n}\n", "import { focusManager } from './focusManager'\nimport { notifyManager } from './notifyManager'\nimport { fetchState } from './query'\nimport { Subscribable } from './subscribable'\nimport { pendingThenable } from './thenable'\nimport {\n isServer,\n isValidTimeout,\n noop,\n replaceData,\n resolveEnabled,\n resolveStaleTime,\n shallowEqualObjects,\n timeUntilStale,\n} from './utils'\nimport { timeoutManager } from './timeoutManager'\nimport type { ManagedTimerId } from './timeoutManager'\nimport type { FetchOptions, Query, QueryState } from './query'\nimport type { QueryClient } from './queryClient'\nimport type { PendingThenable, Thenable } from './thenable'\nimport type {\n DefaultError,\n DefaultedQueryObserverOptions,\n PlaceholderDataFunction,\n QueryKey,\n QueryObserverBaseResult,\n QueryObserverOptions,\n QueryObserverResult,\n RefetchOptions,\n} from './types'\n\ntype QueryObserverListener = (\n result: QueryObserverResult,\n) => void\n\ninterface ObserverFetchOptions extends FetchOptions {\n throwOnError?: boolean\n}\n\nexport class QueryObserver<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> extends Subscribable> {\n #client: QueryClient\n #currentQuery: Query = undefined!\n #currentQueryInitialState: QueryState = undefined!\n #currentResult: QueryObserverResult = undefined!\n #currentResultState?: QueryState\n #currentResultOptions?: QueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >\n #currentThenable: Thenable\n #selectError: TError | null\n #selectFn?: (data: TQueryData) => TData\n #selectResult?: TData\n // This property keeps track of the last query with defined data.\n // It will be used to pass the previous data and query to the placeholder function between renders.\n #lastQueryWithDefinedData?: Query\n #staleTimeoutId?: ManagedTimerId\n #refetchIntervalId?: ManagedTimerId\n #currentRefetchInterval?: number | false\n #trackedProps = new Set()\n\n constructor(\n client: QueryClient,\n public options: QueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n ) {\n super()\n\n this.#client = client\n this.#selectError = null\n this.#currentThenable = pendingThenable()\n\n this.bindMethods()\n this.setOptions(options)\n }\n\n protected bindMethods(): void {\n this.refetch = this.refetch.bind(this)\n }\n\n protected onSubscribe(): void {\n if (this.listeners.size === 1) {\n this.#currentQuery.addObserver(this)\n\n if (shouldFetchOnMount(this.#currentQuery, this.options)) {\n this.#executeFetch()\n } else {\n this.updateResult()\n }\n\n this.#updateTimers()\n }\n }\n\n protected onUnsubscribe(): void {\n if (!this.hasListeners()) {\n this.destroy()\n }\n }\n\n shouldFetchOnReconnect(): boolean {\n return shouldFetchOn(\n this.#currentQuery,\n this.options,\n this.options.refetchOnReconnect,\n )\n }\n\n shouldFetchOnWindowFocus(): boolean {\n return shouldFetchOn(\n this.#currentQuery,\n this.options,\n this.options.refetchOnWindowFocus,\n )\n }\n\n destroy(): void {\n this.listeners = new Set()\n this.#clearStaleTimeout()\n this.#clearRefetchInterval()\n this.#currentQuery.removeObserver(this)\n }\n\n setOptions(\n options: QueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n ): void {\n const prevOptions = this.options\n const prevQuery = this.#currentQuery\n\n this.options = this.#client.defaultQueryOptions(options)\n\n if (\n this.options.enabled !== undefined &&\n typeof this.options.enabled !== 'boolean' &&\n typeof this.options.enabled !== 'function' &&\n typeof resolveEnabled(this.options.enabled, this.#currentQuery) !==\n 'boolean'\n ) {\n throw new Error(\n 'Expected enabled to be a boolean or a callback that returns a boolean',\n )\n }\n\n this.#updateQuery()\n this.#currentQuery.setOptions(this.options)\n\n if (\n prevOptions._defaulted &&\n !shallowEqualObjects(this.options, prevOptions)\n ) {\n this.#client.getQueryCache().notify({\n type: 'observerOptionsUpdated',\n query: this.#currentQuery,\n observer: this,\n })\n }\n\n const mounted = this.hasListeners()\n\n // Fetch if there are subscribers\n if (\n mounted &&\n shouldFetchOptionally(\n this.#currentQuery,\n prevQuery,\n this.options,\n prevOptions,\n )\n ) {\n this.#executeFetch()\n }\n\n // Update result\n this.updateResult()\n\n // Update stale interval if needed\n if (\n mounted &&\n (this.#currentQuery !== prevQuery ||\n resolveEnabled(this.options.enabled, this.#currentQuery) !==\n resolveEnabled(prevOptions.enabled, this.#currentQuery) ||\n resolveStaleTime(this.options.staleTime, this.#currentQuery) !==\n resolveStaleTime(prevOptions.staleTime, this.#currentQuery))\n ) {\n this.#updateStaleTimeout()\n }\n\n const nextRefetchInterval = this.#computeRefetchInterval()\n\n // Update refetch interval if needed\n if (\n mounted &&\n (this.#currentQuery !== prevQuery ||\n resolveEnabled(this.options.enabled, this.#currentQuery) !==\n resolveEnabled(prevOptions.enabled, this.#currentQuery) ||\n nextRefetchInterval !== this.#currentRefetchInterval)\n ) {\n this.#updateRefetchInterval(nextRefetchInterval)\n }\n }\n\n getOptimisticResult(\n options: DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n ): QueryObserverResult {\n const query = this.#client.getQueryCache().build(this.#client, options)\n\n const result = this.createResult(query, options)\n\n if (shouldAssignObserverCurrentProperties(this, result)) {\n // this assigns the optimistic result to the current Observer\n // because if the query function changes, useQuery will be performing\n // an effect where it would fetch again.\n // When the fetch finishes, we perform a deep data cloning in order\n // to reuse objects references. This deep data clone is performed against\n // the `observer.currentResult.data` property\n // When QueryKey changes, we refresh the query and get new `optimistic`\n // result, while we leave the `observer.currentResult`, so when new data\n // arrives, it finds the old `observer.currentResult` which is related\n // to the old QueryKey. Which means that currentResult and selectData are\n // out of sync already.\n // To solve this, we move the cursor of the currentResult every time\n // an observer reads an optimistic value.\n\n // When keeping the previous data, the result doesn't change until new\n // data arrives.\n this.#currentResult = result\n this.#currentResultOptions = this.options\n this.#currentResultState = this.#currentQuery.state\n }\n return result\n }\n\n getCurrentResult(): QueryObserverResult {\n return this.#currentResult\n }\n\n trackResult(\n result: QueryObserverResult,\n onPropTracked?: (key: keyof QueryObserverResult) => void,\n ): QueryObserverResult {\n return new Proxy(result, {\n get: (target, key) => {\n this.trackProp(key as keyof QueryObserverResult)\n onPropTracked?.(key as keyof QueryObserverResult)\n if (key === 'promise') {\n this.trackProp('data')\n if (\n !this.options.experimental_prefetchInRender &&\n this.#currentThenable.status === 'pending'\n ) {\n this.#currentThenable.reject(\n new Error(\n 'experimental_prefetchInRender feature flag is not enabled',\n ),\n )\n }\n }\n return Reflect.get(target, key)\n },\n })\n }\n\n trackProp(key: keyof QueryObserverResult) {\n this.#trackedProps.add(key)\n }\n\n getCurrentQuery(): Query {\n return this.#currentQuery\n }\n\n refetch({ ...options }: RefetchOptions = {}): Promise<\n QueryObserverResult\n > {\n return this.fetch({\n ...options,\n })\n }\n\n fetchOptimistic(\n options: QueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n ): Promise> {\n const defaultedOptions = this.#client.defaultQueryOptions(options)\n\n const query = this.#client\n .getQueryCache()\n .build(this.#client, defaultedOptions)\n\n return query.fetch().then(() => this.createResult(query, defaultedOptions))\n }\n\n protected fetch(\n fetchOptions: ObserverFetchOptions,\n ): Promise> {\n return this.#executeFetch({\n ...fetchOptions,\n cancelRefetch: fetchOptions.cancelRefetch ?? true,\n }).then(() => {\n this.updateResult()\n return this.#currentResult\n })\n }\n\n #executeFetch(\n fetchOptions?: Omit,\n ): Promise {\n // Make sure we reference the latest query as the current one might have been removed\n this.#updateQuery()\n\n // Fetch\n let promise: Promise = this.#currentQuery.fetch(\n this.options,\n fetchOptions,\n )\n\n if (!fetchOptions?.throwOnError) {\n promise = promise.catch(noop)\n }\n\n return promise\n }\n\n #updateStaleTimeout(): void {\n this.#clearStaleTimeout()\n const staleTime = resolveStaleTime(\n this.options.staleTime,\n this.#currentQuery,\n )\n\n if (isServer || this.#currentResult.isStale || !isValidTimeout(staleTime)) {\n return\n }\n\n const time = timeUntilStale(this.#currentResult.dataUpdatedAt, staleTime)\n\n // The timeout is sometimes triggered 1 ms before the stale time expiration.\n // To mitigate this issue we always add 1 ms to the timeout.\n const timeout = time + 1\n\n this.#staleTimeoutId = timeoutManager.setTimeout(() => {\n if (!this.#currentResult.isStale) {\n this.updateResult()\n }\n }, timeout)\n }\n\n #computeRefetchInterval() {\n return (\n (typeof this.options.refetchInterval === 'function'\n ? this.options.refetchInterval(this.#currentQuery)\n : this.options.refetchInterval) ?? false\n )\n }\n\n #updateRefetchInterval(nextInterval: number | false): void {\n this.#clearRefetchInterval()\n\n this.#currentRefetchInterval = nextInterval\n\n if (\n isServer ||\n resolveEnabled(this.options.enabled, this.#currentQuery) === false ||\n !isValidTimeout(this.#currentRefetchInterval) ||\n this.#currentRefetchInterval === 0\n ) {\n return\n }\n\n this.#refetchIntervalId = timeoutManager.setInterval(() => {\n if (\n this.options.refetchIntervalInBackground ||\n focusManager.isFocused()\n ) {\n this.#executeFetch()\n }\n }, this.#currentRefetchInterval)\n }\n\n #updateTimers(): void {\n this.#updateStaleTimeout()\n this.#updateRefetchInterval(this.#computeRefetchInterval())\n }\n\n #clearStaleTimeout(): void {\n if (this.#staleTimeoutId) {\n timeoutManager.clearTimeout(this.#staleTimeoutId)\n this.#staleTimeoutId = undefined\n }\n }\n\n #clearRefetchInterval(): void {\n if (this.#refetchIntervalId) {\n timeoutManager.clearInterval(this.#refetchIntervalId)\n this.#refetchIntervalId = undefined\n }\n }\n\n protected createResult(\n query: Query,\n options: QueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n ): QueryObserverResult {\n const prevQuery = this.#currentQuery\n const prevOptions = this.options\n const prevResult = this.#currentResult as\n | QueryObserverResult\n | undefined\n const prevResultState = this.#currentResultState\n const prevResultOptions = this.#currentResultOptions\n const queryChange = query !== prevQuery\n const queryInitialState = queryChange\n ? query.state\n : this.#currentQueryInitialState\n\n const { state } = query\n let newState = { ...state }\n let isPlaceholderData = false\n let data: TData | undefined\n\n // Optimistically set result in fetching state if needed\n if (options._optimisticResults) {\n const mounted = this.hasListeners()\n\n const fetchOnMount = !mounted && shouldFetchOnMount(query, options)\n\n const fetchOptionally =\n mounted && shouldFetchOptionally(query, prevQuery, options, prevOptions)\n\n if (fetchOnMount || fetchOptionally) {\n newState = {\n ...newState,\n ...fetchState(state.data, query.options),\n }\n }\n if (options._optimisticResults === 'isRestoring') {\n newState.fetchStatus = 'idle'\n }\n }\n\n let { error, errorUpdatedAt, status } = newState\n\n // Per default, use query data\n data = newState.data as unknown as TData\n let skipSelect = false\n\n // use placeholderData if needed\n if (\n options.placeholderData !== undefined &&\n data === undefined &&\n status === 'pending'\n ) {\n let placeholderData\n\n // Memoize placeholder data\n if (\n prevResult?.isPlaceholderData &&\n options.placeholderData === prevResultOptions?.placeholderData\n ) {\n placeholderData = prevResult.data\n // we have to skip select when reading this memoization\n // because prevResult.data is already \"selected\"\n skipSelect = true\n } else {\n // compute placeholderData\n placeholderData =\n typeof options.placeholderData === 'function'\n ? (\n options.placeholderData as unknown as PlaceholderDataFunction\n )(\n this.#lastQueryWithDefinedData?.state.data,\n this.#lastQueryWithDefinedData as any,\n )\n : options.placeholderData\n }\n\n if (placeholderData !== undefined) {\n status = 'success'\n data = replaceData(\n prevResult?.data,\n placeholderData as unknown,\n options,\n ) as TData\n isPlaceholderData = true\n }\n }\n\n // Select data if needed\n // this also runs placeholderData through the select function\n if (options.select && data !== undefined && !skipSelect) {\n // Memoize select result\n if (\n prevResult &&\n data === prevResultState?.data &&\n options.select === this.#selectFn\n ) {\n data = this.#selectResult\n } else {\n try {\n this.#selectFn = options.select\n data = options.select(data as any)\n data = replaceData(prevResult?.data, data, options)\n this.#selectResult = data\n this.#selectError = null\n } catch (selectError) {\n this.#selectError = selectError as TError\n }\n }\n }\n\n if (this.#selectError) {\n error = this.#selectError\n data = this.#selectResult\n errorUpdatedAt = Date.now()\n status = 'error'\n }\n\n const isFetching = newState.fetchStatus === 'fetching'\n const isPending = status === 'pending'\n const isError = status === 'error'\n\n const isLoading = isPending && isFetching\n const hasData = data !== undefined\n\n const result: QueryObserverBaseResult = {\n status,\n fetchStatus: newState.fetchStatus,\n isPending,\n isSuccess: status === 'success',\n isError,\n isInitialLoading: isLoading,\n isLoading,\n data,\n dataUpdatedAt: newState.dataUpdatedAt,\n error,\n errorUpdatedAt,\n failureCount: newState.fetchFailureCount,\n failureReason: newState.fetchFailureReason,\n errorUpdateCount: newState.errorUpdateCount,\n isFetched: newState.dataUpdateCount > 0 || newState.errorUpdateCount > 0,\n isFetchedAfterMount:\n newState.dataUpdateCount > queryInitialState.dataUpdateCount ||\n newState.errorUpdateCount > queryInitialState.errorUpdateCount,\n isFetching,\n isRefetching: isFetching && !isPending,\n isLoadingError: isError && !hasData,\n isPaused: newState.fetchStatus === 'paused',\n isPlaceholderData,\n isRefetchError: isError && hasData,\n isStale: isStale(query, options),\n refetch: this.refetch,\n promise: this.#currentThenable,\n isEnabled: resolveEnabled(options.enabled, query) !== false,\n }\n\n const nextResult = result as QueryObserverResult\n\n if (this.options.experimental_prefetchInRender) {\n const hasResultData = nextResult.data !== undefined\n const isErrorWithoutData = nextResult.status === 'error' && !hasResultData\n const finalizeThenableIfPossible = (thenable: PendingThenable) => {\n if (isErrorWithoutData) {\n thenable.reject(nextResult.error)\n } else if (hasResultData) {\n thenable.resolve(nextResult.data as TData)\n }\n }\n\n /**\n * Create a new thenable and result promise when the results have changed\n */\n const recreateThenable = () => {\n const pending =\n (this.#currentThenable =\n nextResult.promise =\n pendingThenable())\n\n finalizeThenableIfPossible(pending)\n }\n\n const prevThenable = this.#currentThenable\n switch (prevThenable.status) {\n case 'pending':\n // Finalize the previous thenable if it was pending\n // and we are still observing the same query\n if (query.queryHash === prevQuery.queryHash) {\n finalizeThenableIfPossible(prevThenable)\n }\n break\n case 'fulfilled':\n if (isErrorWithoutData || nextResult.data !== prevThenable.value) {\n recreateThenable()\n }\n break\n case 'rejected':\n if (!isErrorWithoutData || nextResult.error !== prevThenable.reason) {\n recreateThenable()\n }\n break\n }\n }\n\n return nextResult\n }\n\n updateResult(): void {\n const prevResult = this.#currentResult as\n | QueryObserverResult\n | undefined\n\n const nextResult = this.createResult(this.#currentQuery, this.options)\n\n this.#currentResultState = this.#currentQuery.state\n this.#currentResultOptions = this.options\n\n if (this.#currentResultState.data !== undefined) {\n this.#lastQueryWithDefinedData = this.#currentQuery\n }\n\n // Only notify and update result if something has changed\n if (shallowEqualObjects(nextResult, prevResult)) {\n return\n }\n\n this.#currentResult = nextResult\n\n const shouldNotifyListeners = (): boolean => {\n if (!prevResult) {\n return true\n }\n\n const { notifyOnChangeProps } = this.options\n const notifyOnChangePropsValue =\n typeof notifyOnChangeProps === 'function'\n ? notifyOnChangeProps()\n : notifyOnChangeProps\n\n if (\n notifyOnChangePropsValue === 'all' ||\n (!notifyOnChangePropsValue && !this.#trackedProps.size)\n ) {\n return true\n }\n\n const includedProps = new Set(\n notifyOnChangePropsValue ?? this.#trackedProps,\n )\n\n if (this.options.throwOnError) {\n includedProps.add('error')\n }\n\n return Object.keys(this.#currentResult).some((key) => {\n const typedKey = key as keyof QueryObserverResult\n const changed = this.#currentResult[typedKey] !== prevResult[typedKey]\n\n return changed && includedProps.has(typedKey)\n })\n }\n\n this.#notify({ listeners: shouldNotifyListeners() })\n }\n\n #updateQuery(): void {\n const query = this.#client.getQueryCache().build(this.#client, this.options)\n\n if (query === this.#currentQuery) {\n return\n }\n\n const prevQuery = this.#currentQuery as\n | Query\n | undefined\n this.#currentQuery = query\n this.#currentQueryInitialState = query.state\n\n if (this.hasListeners()) {\n prevQuery?.removeObserver(this)\n query.addObserver(this)\n }\n }\n\n onQueryUpdate(): void {\n this.updateResult()\n\n if (this.hasListeners()) {\n this.#updateTimers()\n }\n }\n\n #notify(notifyOptions: { listeners: boolean }): void {\n notifyManager.batch(() => {\n // First, trigger the listeners\n if (notifyOptions.listeners) {\n this.listeners.forEach((listener) => {\n listener(this.#currentResult)\n })\n }\n\n // Then the cache listeners\n this.#client.getQueryCache().notify({\n query: this.#currentQuery,\n type: 'observerResultsUpdated',\n })\n })\n }\n}\n\nfunction shouldLoadOnMount(\n query: Query,\n options: QueryObserverOptions,\n): boolean {\n return (\n resolveEnabled(options.enabled, query) !== false &&\n query.state.data === undefined &&\n !(query.state.status === 'error' && options.retryOnMount === false)\n )\n}\n\nfunction shouldFetchOnMount(\n query: Query,\n options: QueryObserverOptions,\n): boolean {\n return (\n shouldLoadOnMount(query, options) ||\n (query.state.data !== undefined &&\n shouldFetchOn(query, options, options.refetchOnMount))\n )\n}\n\nfunction shouldFetchOn(\n query: Query,\n options: QueryObserverOptions,\n field: (typeof options)['refetchOnMount'] &\n (typeof options)['refetchOnWindowFocus'] &\n (typeof options)['refetchOnReconnect'],\n) {\n if (\n resolveEnabled(options.enabled, query) !== false &&\n resolveStaleTime(options.staleTime, query) !== 'static'\n ) {\n const value = typeof field === 'function' ? field(query) : field\n\n return value === 'always' || (value !== false && isStale(query, options))\n }\n return false\n}\n\nfunction shouldFetchOptionally(\n query: Query,\n prevQuery: Query,\n options: QueryObserverOptions,\n prevOptions: QueryObserverOptions,\n): boolean {\n return (\n (query !== prevQuery ||\n resolveEnabled(prevOptions.enabled, query) === false) &&\n (!options.suspense || query.state.status !== 'error') &&\n isStale(query, options)\n )\n}\n\nfunction isStale(\n query: Query,\n options: QueryObserverOptions,\n): boolean {\n return (\n resolveEnabled(options.enabled, query) !== false &&\n query.isStaleByTime(resolveStaleTime(options.staleTime, query))\n )\n}\n\n// this function would decide if we will update the observer's 'current'\n// properties after an optimistic reading via getOptimisticResult\nfunction shouldAssignObserverCurrentProperties<\n TQueryFnData = unknown,\n TError = unknown,\n TData = TQueryFnData,\n TQueryData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n observer: QueryObserver,\n optimisticResult: QueryObserverResult,\n) {\n // if the newly created result isn't what the observer is holding as current,\n // then we'll need to update the properties as well\n if (!shallowEqualObjects(observer.getCurrentResult(), optimisticResult)) {\n return true\n }\n\n // basically, just keep previous properties if nothing changed\n return false\n}\n", "import {\n addConsumeAwareSignal,\n addToEnd,\n addToStart,\n ensureQueryFn,\n} from './utils'\nimport type { QueryBehavior } from './query'\nimport type {\n InfiniteData,\n InfiniteQueryPageParamsOptions,\n OmitKeyof,\n QueryFunctionContext,\n QueryKey,\n} from './types'\n\nexport function infiniteQueryBehavior(\n pages?: number,\n): QueryBehavior> {\n return {\n onFetch: (context, query) => {\n const options = context.options as InfiniteQueryPageParamsOptions\n const direction = context.fetchOptions?.meta?.fetchMore?.direction\n const oldPages = context.state.data?.pages || []\n const oldPageParams = context.state.data?.pageParams || []\n let result: InfiniteData = { pages: [], pageParams: [] }\n let currentPage = 0\n\n const fetchFn = async () => {\n let cancelled = false\n const addSignalProperty = (object: unknown) => {\n addConsumeAwareSignal(\n object,\n () => context.signal,\n () => (cancelled = true),\n )\n }\n\n const queryFn = ensureQueryFn(context.options, context.fetchOptions)\n\n // Create function to fetch a page\n const fetchPage = async (\n data: InfiniteData,\n param: unknown,\n previous?: boolean,\n ): Promise> => {\n if (cancelled) {\n return Promise.reject()\n }\n\n if (param == null && data.pages.length) {\n return Promise.resolve(data)\n }\n\n const createQueryFnContext = () => {\n const queryFnContext: OmitKeyof<\n QueryFunctionContext,\n 'signal'\n > = {\n client: context.client,\n queryKey: context.queryKey,\n pageParam: param,\n direction: previous ? 'backward' : 'forward',\n meta: context.options.meta,\n }\n addSignalProperty(queryFnContext)\n return queryFnContext as QueryFunctionContext\n }\n\n const queryFnContext = createQueryFnContext()\n\n const page = await queryFn(queryFnContext)\n\n const { maxPages } = context.options\n const addTo = previous ? addToStart : addToEnd\n\n return {\n pages: addTo(data.pages, page, maxPages),\n pageParams: addTo(data.pageParams, param, maxPages),\n }\n }\n\n // fetch next / previous page?\n if (direction && oldPages.length) {\n const previous = direction === 'backward'\n const pageParamFn = previous ? getPreviousPageParam : getNextPageParam\n const oldData = {\n pages: oldPages,\n pageParams: oldPageParams,\n }\n const param = pageParamFn(options, oldData)\n\n result = await fetchPage(oldData, param, previous)\n } else {\n const remainingPages = pages ?? oldPages.length\n\n // Fetch all pages\n do {\n const param =\n currentPage === 0\n ? (oldPageParams[0] ?? options.initialPageParam)\n : getNextPageParam(options, result)\n if (currentPage > 0 && param == null) {\n break\n }\n result = await fetchPage(result, param)\n currentPage++\n } while (currentPage < remainingPages)\n }\n\n return result\n }\n if (context.options.persister) {\n context.fetchFn = () => {\n return context.options.persister?.(\n fetchFn as any,\n {\n client: context.client,\n queryKey: context.queryKey,\n meta: context.options.meta,\n signal: context.signal,\n },\n query,\n )\n }\n } else {\n context.fetchFn = fetchFn\n }\n },\n }\n}\n\nfunction getNextPageParam(\n options: InfiniteQueryPageParamsOptions,\n { pages, pageParams }: InfiniteData,\n): unknown | undefined {\n const lastIndex = pages.length - 1\n return pages.length > 0\n ? options.getNextPageParam(\n pages[lastIndex],\n pages,\n pageParams[lastIndex],\n pageParams,\n )\n : undefined\n}\n\nfunction getPreviousPageParam(\n options: InfiniteQueryPageParamsOptions,\n { pages, pageParams }: InfiniteData,\n): unknown | undefined {\n return pages.length > 0\n ? options.getPreviousPageParam?.(pages[0], pages, pageParams[0], pageParams)\n : undefined\n}\n\n/**\n * Checks if there is a next page.\n */\nexport function hasNextPage(\n options: InfiniteQueryPageParamsOptions,\n data?: InfiniteData,\n): boolean {\n if (!data) return false\n return getNextPageParam(options, data) != null\n}\n\n/**\n * Checks if there is a previous page.\n */\nexport function hasPreviousPage(\n options: InfiniteQueryPageParamsOptions,\n data?: InfiniteData,\n): boolean {\n if (!data || !options.getPreviousPageParam) return false\n return getPreviousPageParam(options, data) != null\n}\n", "import { QueryObserver } from './queryObserver'\nimport {\n hasNextPage,\n hasPreviousPage,\n infiniteQueryBehavior,\n} from './infiniteQueryBehavior'\nimport type { Subscribable } from './subscribable'\nimport type {\n DefaultError,\n DefaultedInfiniteQueryObserverOptions,\n FetchNextPageOptions,\n FetchPreviousPageOptions,\n InfiniteData,\n InfiniteQueryObserverBaseResult,\n InfiniteQueryObserverOptions,\n InfiniteQueryObserverResult,\n QueryKey,\n} from './types'\nimport type { QueryClient } from './queryClient'\nimport type { Query } from './query'\n\ntype InfiniteQueryObserverListener = (\n result: InfiniteQueryObserverResult,\n) => void\n\nexport class InfiniteQueryObserver<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> extends QueryObserver<\n TQueryFnData,\n TError,\n TData,\n InfiniteData,\n TQueryKey\n> {\n // Type override\n subscribe!: Subscribable<\n InfiniteQueryObserverListener\n >['subscribe']\n\n // Type override\n getCurrentResult!: ReplaceReturnType<\n QueryObserver<\n TQueryFnData,\n TError,\n TData,\n InfiniteData,\n TQueryKey\n >['getCurrentResult'],\n InfiniteQueryObserverResult\n >\n\n // Type override\n protected fetch!: ReplaceReturnType<\n QueryObserver<\n TQueryFnData,\n TError,\n TData,\n InfiniteData,\n TQueryKey\n >['fetch'],\n Promise>\n >\n\n constructor(\n client: QueryClient,\n options: InfiniteQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n ) {\n super(client, options)\n }\n\n protected bindMethods(): void {\n super.bindMethods()\n this.fetchNextPage = this.fetchNextPage.bind(this)\n this.fetchPreviousPage = this.fetchPreviousPage.bind(this)\n }\n\n setOptions(\n options: InfiniteQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n ): void {\n super.setOptions({\n ...options,\n behavior: infiniteQueryBehavior(),\n })\n }\n\n getOptimisticResult(\n options: DefaultedInfiniteQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n ): InfiniteQueryObserverResult {\n options.behavior = infiniteQueryBehavior()\n return super.getOptimisticResult(options) as InfiniteQueryObserverResult<\n TData,\n TError\n >\n }\n\n fetchNextPage(\n options?: FetchNextPageOptions,\n ): Promise> {\n return this.fetch({\n ...options,\n meta: {\n fetchMore: { direction: 'forward' },\n },\n })\n }\n\n fetchPreviousPage(\n options?: FetchPreviousPageOptions,\n ): Promise> {\n return this.fetch({\n ...options,\n meta: {\n fetchMore: { direction: 'backward' },\n },\n })\n }\n\n protected createResult(\n query: Query<\n TQueryFnData,\n TError,\n InfiniteData,\n TQueryKey\n >,\n options: InfiniteQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n ): InfiniteQueryObserverResult {\n const { state } = query\n const parentResult = super.createResult(query, options)\n\n const { isFetching, isRefetching, isError, isRefetchError } = parentResult\n const fetchDirection = state.fetchMeta?.fetchMore?.direction\n\n const isFetchNextPageError = isError && fetchDirection === 'forward'\n const isFetchingNextPage = isFetching && fetchDirection === 'forward'\n\n const isFetchPreviousPageError = isError && fetchDirection === 'backward'\n const isFetchingPreviousPage = isFetching && fetchDirection === 'backward'\n\n const result: InfiniteQueryObserverBaseResult = {\n ...parentResult,\n fetchNextPage: this.fetchNextPage,\n fetchPreviousPage: this.fetchPreviousPage,\n hasNextPage: hasNextPage(options, state.data),\n hasPreviousPage: hasPreviousPage(options, state.data),\n isFetchNextPageError,\n isFetchingNextPage,\n isFetchPreviousPageError,\n isFetchingPreviousPage,\n isRefetchError:\n isRefetchError && !isFetchNextPageError && !isFetchPreviousPageError,\n isRefetching:\n isRefetching && !isFetchingNextPage && !isFetchingPreviousPage,\n }\n\n return result as InfiniteQueryObserverResult\n }\n}\n\ntype ReplaceReturnType<\n TFunction extends (...args: Array) => unknown,\n TReturn,\n> = (...args: Parameters) => TReturn\n", "import { notifyManager } from './notifyManager'\nimport { Removable } from './removable'\nimport { createRetryer } from './retryer'\nimport type {\n DefaultError,\n MutationFunctionContext,\n MutationMeta,\n MutationOptions,\n MutationStatus,\n} from './types'\nimport type { MutationCache } from './mutationCache'\nimport type { MutationObserver } from './mutationObserver'\nimport type { Retryer } from './retryer'\nimport type { QueryClient } from './queryClient'\n\n// TYPES\n\ninterface MutationConfig {\n client: QueryClient\n mutationId: number\n mutationCache: MutationCache\n options: MutationOptions\n state?: MutationState\n}\n\nexport interface MutationState<\n TData = unknown,\n TError = DefaultError,\n TVariables = unknown,\n TOnMutateResult = unknown,\n> {\n context: TOnMutateResult | undefined\n data: TData | undefined\n error: TError | null\n failureCount: number\n failureReason: TError | null\n isPaused: boolean\n status: MutationStatus\n variables: TVariables | undefined\n submittedAt: number\n}\n\ninterface FailedAction {\n type: 'failed'\n failureCount: number\n error: TError | null\n}\n\ninterface PendingAction {\n type: 'pending'\n isPaused: boolean\n variables?: TVariables\n context?: TOnMutateResult\n}\n\ninterface SuccessAction {\n type: 'success'\n data: TData\n}\n\ninterface ErrorAction {\n type: 'error'\n error: TError\n}\n\ninterface PauseAction {\n type: 'pause'\n}\n\ninterface ContinueAction {\n type: 'continue'\n}\n\nexport type Action =\n | ContinueAction\n | ErrorAction\n | FailedAction\n | PendingAction\n | PauseAction\n | SuccessAction\n\n// CLASS\n\nexport class Mutation<\n TData = unknown,\n TError = DefaultError,\n TVariables = unknown,\n TOnMutateResult = unknown,\n> extends Removable {\n state: MutationState\n options!: MutationOptions\n readonly mutationId: number\n\n #client: QueryClient\n #observers: Array<\n MutationObserver\n >\n #mutationCache: MutationCache\n #retryer?: Retryer\n\n constructor(\n config: MutationConfig,\n ) {\n super()\n\n this.#client = config.client\n this.mutationId = config.mutationId\n this.#mutationCache = config.mutationCache\n this.#observers = []\n this.state = config.state || getDefaultState()\n\n this.setOptions(config.options)\n this.scheduleGc()\n }\n\n setOptions(\n options: MutationOptions,\n ): void {\n this.options = options\n\n this.updateGcTime(this.options.gcTime)\n }\n\n get meta(): MutationMeta | undefined {\n return this.options.meta\n }\n\n addObserver(observer: MutationObserver): void {\n if (!this.#observers.includes(observer)) {\n this.#observers.push(observer)\n\n // Stop the mutation from being garbage collected\n this.clearGcTimeout()\n\n this.#mutationCache.notify({\n type: 'observerAdded',\n mutation: this,\n observer,\n })\n }\n }\n\n removeObserver(observer: MutationObserver): void {\n this.#observers = this.#observers.filter((x) => x !== observer)\n\n this.scheduleGc()\n\n this.#mutationCache.notify({\n type: 'observerRemoved',\n mutation: this,\n observer,\n })\n }\n\n protected optionalRemove() {\n if (!this.#observers.length) {\n if (this.state.status === 'pending') {\n this.scheduleGc()\n } else {\n this.#mutationCache.remove(this)\n }\n }\n }\n\n continue(): Promise {\n return (\n this.#retryer?.continue() ??\n // continuing a mutation assumes that variables are set, mutation must have been dehydrated before\n this.execute(this.state.variables!)\n )\n }\n\n async execute(variables: TVariables): Promise {\n const onContinue = () => {\n this.#dispatch({ type: 'continue' })\n }\n\n const mutationFnContext = {\n client: this.#client,\n meta: this.options.meta,\n mutationKey: this.options.mutationKey,\n } satisfies MutationFunctionContext\n\n this.#retryer = createRetryer({\n fn: () => {\n if (!this.options.mutationFn) {\n return Promise.reject(new Error('No mutationFn found'))\n }\n\n return this.options.mutationFn(variables, mutationFnContext)\n },\n onFail: (failureCount, error) => {\n this.#dispatch({ type: 'failed', failureCount, error })\n },\n onPause: () => {\n this.#dispatch({ type: 'pause' })\n },\n onContinue,\n retry: this.options.retry ?? 0,\n retryDelay: this.options.retryDelay,\n networkMode: this.options.networkMode,\n canRun: () => this.#mutationCache.canRun(this),\n })\n\n const restored = this.state.status === 'pending'\n const isPaused = !this.#retryer.canStart()\n\n try {\n if (restored) {\n // Dispatch continue action to unpause restored mutation\n onContinue()\n } else {\n this.#dispatch({ type: 'pending', variables, isPaused })\n // Notify cache callback\n if (this.#mutationCache.config.onMutate) {\n await this.#mutationCache.config.onMutate(\n variables,\n this as Mutation,\n mutationFnContext,\n )\n }\n const context = await this.options.onMutate?.(\n variables,\n mutationFnContext,\n )\n if (context !== this.state.context) {\n this.#dispatch({\n type: 'pending',\n context,\n variables,\n isPaused,\n })\n }\n }\n const data = await this.#retryer.start()\n\n // Notify cache callback\n await this.#mutationCache.config.onSuccess?.(\n data,\n variables,\n this.state.context,\n this as Mutation,\n mutationFnContext,\n )\n\n await this.options.onSuccess?.(\n data,\n variables,\n this.state.context!,\n mutationFnContext,\n )\n\n // Notify cache callback\n await this.#mutationCache.config.onSettled?.(\n data,\n null,\n this.state.variables,\n this.state.context,\n this as Mutation,\n mutationFnContext,\n )\n\n await this.options.onSettled?.(\n data,\n null,\n variables,\n this.state.context,\n mutationFnContext,\n )\n\n this.#dispatch({ type: 'success', data })\n return data\n } catch (error) {\n try {\n // Notify cache callback\n await this.#mutationCache.config.onError?.(\n error as any,\n variables,\n this.state.context,\n this as Mutation,\n mutationFnContext,\n )\n } catch (e) {\n void Promise.reject(e)\n }\n\n try {\n await this.options.onError?.(\n error as TError,\n variables,\n this.state.context,\n mutationFnContext,\n )\n } catch (e) {\n void Promise.reject(e)\n }\n\n try {\n // Notify cache callback\n await this.#mutationCache.config.onSettled?.(\n undefined,\n error as any,\n this.state.variables,\n this.state.context,\n this as Mutation,\n mutationFnContext,\n )\n } catch (e) {\n void Promise.reject(e)\n }\n\n try {\n await this.options.onSettled?.(\n undefined,\n error as TError,\n variables,\n this.state.context,\n mutationFnContext,\n )\n } catch (e) {\n void Promise.reject(e)\n }\n\n this.#dispatch({ type: 'error', error: error as TError })\n throw error\n } finally {\n this.#mutationCache.runNext(this)\n }\n }\n\n #dispatch(action: Action): void {\n const reducer = (\n state: MutationState,\n ): MutationState => {\n switch (action.type) {\n case 'failed':\n return {\n ...state,\n failureCount: action.failureCount,\n failureReason: action.error,\n }\n case 'pause':\n return {\n ...state,\n isPaused: true,\n }\n case 'continue':\n return {\n ...state,\n isPaused: false,\n }\n case 'pending':\n return {\n ...state,\n context: action.context,\n data: undefined,\n failureCount: 0,\n failureReason: null,\n error: null,\n isPaused: action.isPaused,\n status: 'pending',\n variables: action.variables,\n submittedAt: Date.now(),\n }\n case 'success':\n return {\n ...state,\n data: action.data,\n failureCount: 0,\n failureReason: null,\n error: null,\n status: 'success',\n isPaused: false,\n }\n case 'error':\n return {\n ...state,\n data: undefined,\n error: action.error,\n failureCount: state.failureCount + 1,\n failureReason: action.error,\n isPaused: false,\n status: 'error',\n }\n }\n }\n this.state = reducer(this.state)\n\n notifyManager.batch(() => {\n this.#observers.forEach((observer) => {\n observer.onMutationUpdate(action)\n })\n this.#mutationCache.notify({\n mutation: this,\n type: 'updated',\n action,\n })\n })\n }\n}\n\nexport function getDefaultState<\n TData,\n TError,\n TVariables,\n TOnMutateResult,\n>(): MutationState {\n return {\n context: undefined,\n data: undefined,\n error: null,\n failureCount: 0,\n failureReason: null,\n isPaused: false,\n status: 'idle',\n variables: undefined,\n submittedAt: 0,\n }\n}\n", "import { notifyManager } from './notifyManager'\nimport { Mutation } from './mutation'\nimport { matchMutation, noop } from './utils'\nimport { Subscribable } from './subscribable'\nimport type { MutationObserver } from './mutationObserver'\nimport type {\n DefaultError,\n MutationFunctionContext,\n MutationOptions,\n NotifyEvent,\n} from './types'\nimport type { QueryClient } from './queryClient'\nimport type { Action, MutationState } from './mutation'\nimport type { MutationFilters } from './utils'\n\n// TYPES\n\ninterface MutationCacheConfig {\n onError?: (\n error: DefaultError,\n variables: unknown,\n onMutateResult: unknown,\n mutation: Mutation,\n context: MutationFunctionContext,\n ) => Promise | unknown\n onSuccess?: (\n data: unknown,\n variables: unknown,\n onMutateResult: unknown,\n mutation: Mutation,\n context: MutationFunctionContext,\n ) => Promise | unknown\n onMutate?: (\n variables: unknown,\n mutation: Mutation,\n context: MutationFunctionContext,\n ) => Promise | unknown\n onSettled?: (\n data: unknown | undefined,\n error: DefaultError | null,\n variables: unknown,\n onMutateResult: unknown,\n mutation: Mutation,\n context: MutationFunctionContext,\n ) => Promise | unknown\n}\n\ninterface NotifyEventMutationAdded extends NotifyEvent {\n type: 'added'\n mutation: Mutation\n}\ninterface NotifyEventMutationRemoved extends NotifyEvent {\n type: 'removed'\n mutation: Mutation\n}\n\ninterface NotifyEventMutationObserverAdded extends NotifyEvent {\n type: 'observerAdded'\n mutation: Mutation\n observer: MutationObserver\n}\n\ninterface NotifyEventMutationObserverRemoved extends NotifyEvent {\n type: 'observerRemoved'\n mutation: Mutation\n observer: MutationObserver\n}\n\ninterface NotifyEventMutationObserverOptionsUpdated extends NotifyEvent {\n type: 'observerOptionsUpdated'\n mutation?: Mutation\n observer: MutationObserver\n}\n\ninterface NotifyEventMutationUpdated extends NotifyEvent {\n type: 'updated'\n mutation: Mutation\n action: Action\n}\n\nexport type MutationCacheNotifyEvent =\n | NotifyEventMutationAdded\n | NotifyEventMutationRemoved\n | NotifyEventMutationObserverAdded\n | NotifyEventMutationObserverRemoved\n | NotifyEventMutationObserverOptionsUpdated\n | NotifyEventMutationUpdated\n\ntype MutationCacheListener = (event: MutationCacheNotifyEvent) => void\n\n// CLASS\n\nexport class MutationCache extends Subscribable {\n #mutations: Set>\n #scopes: Map>>\n #mutationId: number\n\n constructor(public config: MutationCacheConfig = {}) {\n super()\n this.#mutations = new Set()\n this.#scopes = new Map()\n this.#mutationId = 0\n }\n\n build(\n client: QueryClient,\n options: MutationOptions,\n state?: MutationState,\n ): Mutation {\n const mutation = new Mutation({\n client,\n mutationCache: this,\n mutationId: ++this.#mutationId,\n options: client.defaultMutationOptions(options),\n state,\n })\n\n this.add(mutation)\n\n return mutation\n }\n\n add(mutation: Mutation): void {\n this.#mutations.add(mutation)\n const scope = scopeFor(mutation)\n if (typeof scope === 'string') {\n const scopedMutations = this.#scopes.get(scope)\n if (scopedMutations) {\n scopedMutations.push(mutation)\n } else {\n this.#scopes.set(scope, [mutation])\n }\n }\n this.notify({ type: 'added', mutation })\n }\n\n remove(mutation: Mutation): void {\n if (this.#mutations.delete(mutation)) {\n const scope = scopeFor(mutation)\n if (typeof scope === 'string') {\n const scopedMutations = this.#scopes.get(scope)\n if (scopedMutations) {\n if (scopedMutations.length > 1) {\n const index = scopedMutations.indexOf(mutation)\n if (index !== -1) {\n scopedMutations.splice(index, 1)\n }\n } else if (scopedMutations[0] === mutation) {\n this.#scopes.delete(scope)\n }\n }\n }\n }\n\n // Currently we notify the removal even if the mutation was already removed.\n // Consider making this an error or not notifying of the removal depending on the desired semantics.\n this.notify({ type: 'removed', mutation })\n }\n\n canRun(mutation: Mutation): boolean {\n const scope = scopeFor(mutation)\n if (typeof scope === 'string') {\n const mutationsWithSameScope = this.#scopes.get(scope)\n const firstPendingMutation = mutationsWithSameScope?.find(\n (m) => m.state.status === 'pending',\n )\n // we can run if there is no current pending mutation (start use-case)\n // or if WE are the first pending mutation (continue use-case)\n return !firstPendingMutation || firstPendingMutation === mutation\n } else {\n // For unscoped mutations there are never any pending mutations in front of the\n // current mutation\n return true\n }\n }\n\n runNext(mutation: Mutation): Promise {\n const scope = scopeFor(mutation)\n if (typeof scope === 'string') {\n const foundMutation = this.#scopes\n .get(scope)\n ?.find((m) => m !== mutation && m.state.isPaused)\n\n return foundMutation?.continue() ?? Promise.resolve()\n } else {\n return Promise.resolve()\n }\n }\n\n clear(): void {\n notifyManager.batch(() => {\n this.#mutations.forEach((mutation) => {\n this.notify({ type: 'removed', mutation })\n })\n this.#mutations.clear()\n this.#scopes.clear()\n })\n }\n\n getAll(): Array {\n return Array.from(this.#mutations)\n }\n\n find<\n TData = unknown,\n TError = DefaultError,\n TVariables = any,\n TOnMutateResult = unknown,\n >(\n filters: MutationFilters,\n ): Mutation | undefined {\n const defaultedFilters = { exact: true, ...filters }\n\n return this.getAll().find((mutation) =>\n matchMutation(defaultedFilters, mutation),\n ) as Mutation | undefined\n }\n\n findAll(filters: MutationFilters = {}): Array {\n return this.getAll().filter((mutation) => matchMutation(filters, mutation))\n }\n\n notify(event: MutationCacheNotifyEvent) {\n notifyManager.batch(() => {\n this.listeners.forEach((listener) => {\n listener(event)\n })\n })\n }\n\n resumePausedMutations(): Promise {\n const pausedMutations = this.getAll().filter((x) => x.state.isPaused)\n\n return notifyManager.batch(() =>\n Promise.all(\n pausedMutations.map((mutation) => mutation.continue().catch(noop)),\n ),\n )\n }\n}\n\nfunction scopeFor(mutation: Mutation) {\n return mutation.options.scope?.id\n}\n", "import { getDefaultState } from './mutation'\nimport { notifyManager } from './notifyManager'\nimport { Subscribable } from './subscribable'\nimport { hashKey, shallowEqualObjects } from './utils'\nimport type { QueryClient } from './queryClient'\nimport type {\n DefaultError,\n MutateOptions,\n MutationFunctionContext,\n MutationObserverOptions,\n MutationObserverResult,\n} from './types'\nimport type { Action, Mutation } from './mutation'\n\n// TYPES\n\ntype MutationObserverListener = (\n result: MutationObserverResult,\n) => void\n\n// CLASS\n\nexport class MutationObserver<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> extends Subscribable<\n MutationObserverListener\n> {\n options!: MutationObserverOptions\n\n #client: QueryClient\n #currentResult: MutationObserverResult<\n TData,\n TError,\n TVariables,\n TOnMutateResult\n > = undefined!\n #currentMutation?: Mutation\n #mutateOptions?: MutateOptions\n\n constructor(\n client: QueryClient,\n options: MutationObserverOptions<\n TData,\n TError,\n TVariables,\n TOnMutateResult\n >,\n ) {\n super()\n\n this.#client = client\n this.setOptions(options)\n this.bindMethods()\n this.#updateResult()\n }\n\n protected bindMethods(): void {\n this.mutate = this.mutate.bind(this)\n this.reset = this.reset.bind(this)\n }\n\n setOptions(\n options: MutationObserverOptions<\n TData,\n TError,\n TVariables,\n TOnMutateResult\n >,\n ) {\n const prevOptions = this.options as\n | MutationObserverOptions\n | undefined\n this.options = this.#client.defaultMutationOptions(options)\n if (!shallowEqualObjects(this.options, prevOptions)) {\n this.#client.getMutationCache().notify({\n type: 'observerOptionsUpdated',\n mutation: this.#currentMutation,\n observer: this,\n })\n }\n\n if (\n prevOptions?.mutationKey &&\n this.options.mutationKey &&\n hashKey(prevOptions.mutationKey) !== hashKey(this.options.mutationKey)\n ) {\n this.reset()\n } else if (this.#currentMutation?.state.status === 'pending') {\n this.#currentMutation.setOptions(this.options)\n }\n }\n\n protected onUnsubscribe(): void {\n if (!this.hasListeners()) {\n this.#currentMutation?.removeObserver(this)\n }\n }\n\n onMutationUpdate(\n action: Action,\n ): void {\n this.#updateResult()\n\n this.#notify(action)\n }\n\n getCurrentResult(): MutationObserverResult<\n TData,\n TError,\n TVariables,\n TOnMutateResult\n > {\n return this.#currentResult\n }\n\n reset(): void {\n // reset needs to remove the observer from the mutation because there is no way to \"get it back\"\n // another mutate call will yield a new mutation!\n this.#currentMutation?.removeObserver(this)\n this.#currentMutation = undefined\n this.#updateResult()\n this.#notify()\n }\n\n mutate(\n variables: TVariables,\n options?: MutateOptions,\n ): Promise {\n this.#mutateOptions = options\n\n this.#currentMutation?.removeObserver(this)\n\n this.#currentMutation = this.#client\n .getMutationCache()\n .build(this.#client, this.options)\n\n this.#currentMutation.addObserver(this)\n\n return this.#currentMutation.execute(variables)\n }\n\n #updateResult(): void {\n const state =\n this.#currentMutation?.state ??\n getDefaultState()\n\n this.#currentResult = {\n ...state,\n isPending: state.status === 'pending',\n isSuccess: state.status === 'success',\n isError: state.status === 'error',\n isIdle: state.status === 'idle',\n mutate: this.mutate,\n reset: this.reset,\n } as MutationObserverResult\n }\n\n #notify(action?: Action): void {\n notifyManager.batch(() => {\n // First trigger the mutate callbacks\n if (this.#mutateOptions && this.hasListeners()) {\n const variables = this.#currentResult.variables!\n const onMutateResult = this.#currentResult.context\n\n const context = {\n client: this.#client,\n meta: this.options.meta,\n mutationKey: this.options.mutationKey,\n } satisfies MutationFunctionContext\n\n if (action?.type === 'success') {\n try {\n this.#mutateOptions.onSuccess?.(\n action.data,\n variables,\n onMutateResult,\n context,\n )\n } catch (e) {\n void Promise.reject(e)\n }\n try {\n this.#mutateOptions.onSettled?.(\n action.data,\n null,\n variables,\n onMutateResult,\n context,\n )\n } catch (e) {\n void Promise.reject(e)\n }\n } else if (action?.type === 'error') {\n try {\n this.#mutateOptions.onError?.(\n action.error,\n variables,\n onMutateResult,\n context,\n )\n } catch (e) {\n void Promise.reject(e)\n }\n try {\n this.#mutateOptions.onSettled?.(\n undefined,\n action.error,\n variables,\n onMutateResult,\n context,\n )\n } catch (e) {\n void Promise.reject(e)\n }\n }\n }\n\n // Then trigger the listeners\n this.listeners.forEach((listener) => {\n listener(this.#currentResult)\n })\n })\n }\n}\n", "import { notifyManager } from './notifyManager'\nimport { QueryObserver } from './queryObserver'\nimport { Subscribable } from './subscribable'\nimport { replaceEqualDeep, shallowEqualObjects } from './utils'\nimport type {\n DefaultedQueryObserverOptions,\n QueryObserverOptions,\n QueryObserverResult,\n} from './types'\nimport type { QueryClient } from './queryClient'\n\nfunction difference(array1: Array, array2: Array): Array {\n const excludeSet = new Set(array2)\n return array1.filter((x) => !excludeSet.has(x))\n}\n\nfunction replaceAt(array: Array, index: number, value: T): Array {\n const copy = array.slice(0)\n copy[index] = value\n return copy\n}\n\ntype QueriesObserverListener = (result: Array) => void\n\ntype CombineFn = (\n result: Array,\n) => TCombinedResult\n\nexport interface QueriesObserverOptions<\n TCombinedResult = Array,\n> {\n combine?: CombineFn\n}\n\nexport class QueriesObserver<\n TCombinedResult = Array,\n> extends Subscribable {\n #client: QueryClient\n #result!: Array\n #queries: Array\n #options?: QueriesObserverOptions\n #observers: Array\n #combinedResult?: TCombinedResult\n #lastCombine?: CombineFn\n #lastResult?: Array\n #lastQueryHashes?: Array\n #observerMatches: Array = []\n\n constructor(\n client: QueryClient,\n queries: Array>,\n options?: QueriesObserverOptions,\n ) {\n super()\n\n this.#client = client\n this.#options = options\n this.#queries = []\n this.#observers = []\n this.#result = []\n\n this.setQueries(queries)\n }\n\n protected onSubscribe(): void {\n if (this.listeners.size === 1) {\n this.#observers.forEach((observer) => {\n observer.subscribe((result) => {\n this.#onUpdate(observer, result)\n })\n })\n }\n }\n\n protected onUnsubscribe(): void {\n if (!this.listeners.size) {\n this.destroy()\n }\n }\n\n destroy(): void {\n this.listeners = new Set()\n this.#observers.forEach((observer) => {\n observer.destroy()\n })\n }\n\n setQueries(\n queries: Array,\n options?: QueriesObserverOptions,\n ): void {\n this.#queries = queries\n this.#options = options\n\n if (process.env.NODE_ENV !== 'production') {\n const queryHashes = queries.map(\n (query) => this.#client.defaultQueryOptions(query).queryHash,\n )\n if (new Set(queryHashes).size !== queryHashes.length) {\n console.warn(\n '[QueriesObserver]: Duplicate Queries found. This might result in unexpected behavior.',\n )\n }\n }\n\n notifyManager.batch(() => {\n const prevObservers = this.#observers\n\n const newObserverMatches = this.#findMatchingObservers(this.#queries)\n\n // set options for the new observers to notify of changes\n newObserverMatches.forEach((match) =>\n match.observer.setOptions(match.defaultedQueryOptions),\n )\n\n const newObservers = newObserverMatches.map((match) => match.observer)\n const newResult = newObservers.map((observer) =>\n observer.getCurrentResult(),\n )\n\n const hasLengthChange = prevObservers.length !== newObservers.length\n const hasIndexChange = newObservers.some(\n (observer, index) => observer !== prevObservers[index],\n )\n const hasStructuralChange = hasLengthChange || hasIndexChange\n\n const hasResultChange = hasStructuralChange\n ? true\n : newResult.some((result, index) => {\n const prev = this.#result[index]\n return !prev || !shallowEqualObjects(result, prev)\n })\n\n if (!hasStructuralChange && !hasResultChange) return\n\n if (hasStructuralChange) {\n this.#observerMatches = newObserverMatches\n this.#observers = newObservers\n }\n\n this.#result = newResult\n\n if (!this.hasListeners()) return\n\n if (hasStructuralChange) {\n difference(prevObservers, newObservers).forEach((observer) => {\n observer.destroy()\n })\n difference(newObservers, prevObservers).forEach((observer) => {\n observer.subscribe((result) => {\n this.#onUpdate(observer, result)\n })\n })\n }\n\n this.#notify()\n })\n }\n\n getCurrentResult(): Array {\n return this.#result\n }\n\n getQueries() {\n return this.#observers.map((observer) => observer.getCurrentQuery())\n }\n\n getObservers() {\n return this.#observers\n }\n\n getOptimisticResult(\n queries: Array,\n combine: CombineFn | undefined,\n ): [\n rawResult: Array,\n combineResult: (r?: Array) => TCombinedResult,\n trackResult: () => Array,\n ] {\n const matches = this.#findMatchingObservers(queries)\n const result = matches.map((match) =>\n match.observer.getOptimisticResult(match.defaultedQueryOptions),\n )\n const queryHashes = matches.map(\n (match) => match.defaultedQueryOptions.queryHash,\n )\n\n return [\n result,\n (r?: Array) => {\n return this.#combineResult(r ?? result, combine, queryHashes)\n },\n () => {\n return this.#trackResult(result, matches)\n },\n ]\n }\n\n #trackResult(\n result: Array,\n matches: Array,\n ) {\n return matches.map((match, index) => {\n const observerResult = result[index]!\n return !match.defaultedQueryOptions.notifyOnChangeProps\n ? match.observer.trackResult(observerResult, (accessedProp) => {\n // track property on all observers to ensure proper (synchronized) tracking (#7000)\n matches.forEach((m) => {\n m.observer.trackProp(accessedProp)\n })\n })\n : observerResult\n })\n }\n\n #combineResult(\n input: Array,\n combine: CombineFn | undefined,\n queryHashes?: Array,\n ): TCombinedResult {\n if (combine) {\n const lastHashes = this.#lastQueryHashes\n const queryHashesChanged =\n queryHashes !== undefined &&\n lastHashes !== undefined &&\n (lastHashes.length !== queryHashes.length ||\n queryHashes.some((hash, i) => hash !== lastHashes[i]))\n\n if (\n !this.#combinedResult ||\n this.#result !== this.#lastResult ||\n queryHashesChanged ||\n combine !== this.#lastCombine\n ) {\n this.#lastCombine = combine\n this.#lastResult = this.#result\n\n if (queryHashes !== undefined) {\n this.#lastQueryHashes = queryHashes\n }\n this.#combinedResult = replaceEqualDeep(\n this.#combinedResult,\n combine(input),\n )\n }\n\n return this.#combinedResult\n }\n return input as any\n }\n\n #findMatchingObservers(\n queries: Array,\n ): Array {\n const prevObserversMap = new Map>()\n\n this.#observers.forEach((observer) => {\n const key = observer.options.queryHash\n if (!key) return\n\n const previousObservers = prevObserversMap.get(key)\n\n if (previousObservers) {\n previousObservers.push(observer)\n } else {\n prevObserversMap.set(key, [observer])\n }\n })\n\n const observers: Array = []\n\n queries.forEach((options) => {\n const defaultedOptions = this.#client.defaultQueryOptions(options)\n const match = prevObserversMap.get(defaultedOptions.queryHash)?.shift()\n const observer =\n match ?? new QueryObserver(this.#client, defaultedOptions)\n\n observers.push({\n defaultedQueryOptions: defaultedOptions,\n observer,\n })\n })\n\n return observers\n }\n\n #onUpdate(observer: QueryObserver, result: QueryObserverResult): void {\n const index = this.#observers.indexOf(observer)\n if (index !== -1) {\n this.#result = replaceAt(this.#result, index, result)\n this.#notify()\n }\n }\n\n #notify(): void {\n if (this.hasListeners()) {\n const previousResult = this.#combinedResult\n const newTracked = this.#trackResult(this.#result, this.#observerMatches)\n const newResult = this.#combineResult(newTracked, this.#options?.combine)\n\n if (previousResult !== newResult) {\n notifyManager.batch(() => {\n this.listeners.forEach((listener) => {\n listener(this.#result)\n })\n })\n }\n }\n }\n}\n\ntype QueryObserverMatch = {\n defaultedQueryOptions: DefaultedQueryObserverOptions\n observer: QueryObserver\n}\n", "import { hashQueryKeyByOptions, matchQuery } from './utils'\nimport { Query } from './query'\nimport { notifyManager } from './notifyManager'\nimport { Subscribable } from './subscribable'\nimport type { QueryFilters } from './utils'\nimport type { Action, QueryState } from './query'\nimport type {\n DefaultError,\n NotifyEvent,\n QueryKey,\n QueryOptions,\n WithRequired,\n} from './types'\nimport type { QueryClient } from './queryClient'\nimport type { QueryObserver } from './queryObserver'\n\n// TYPES\n\ninterface QueryCacheConfig {\n onError?: (\n error: DefaultError,\n query: Query,\n ) => void\n onSuccess?: (data: unknown, query: Query) => void\n onSettled?: (\n data: unknown | undefined,\n error: DefaultError | null,\n query: Query,\n ) => void\n}\n\ninterface NotifyEventQueryAdded extends NotifyEvent {\n type: 'added'\n query: Query\n}\n\ninterface NotifyEventQueryRemoved extends NotifyEvent {\n type: 'removed'\n query: Query\n}\n\ninterface NotifyEventQueryUpdated extends NotifyEvent {\n type: 'updated'\n query: Query\n action: Action\n}\n\ninterface NotifyEventQueryObserverAdded extends NotifyEvent {\n type: 'observerAdded'\n query: Query\n observer: QueryObserver\n}\n\ninterface NotifyEventQueryObserverRemoved extends NotifyEvent {\n type: 'observerRemoved'\n query: Query\n observer: QueryObserver\n}\n\ninterface NotifyEventQueryObserverResultsUpdated extends NotifyEvent {\n type: 'observerResultsUpdated'\n query: Query\n}\n\ninterface NotifyEventQueryObserverOptionsUpdated extends NotifyEvent {\n type: 'observerOptionsUpdated'\n query: Query\n observer: QueryObserver\n}\n\nexport type QueryCacheNotifyEvent =\n | NotifyEventQueryAdded\n | NotifyEventQueryRemoved\n | NotifyEventQueryUpdated\n | NotifyEventQueryObserverAdded\n | NotifyEventQueryObserverRemoved\n | NotifyEventQueryObserverResultsUpdated\n | NotifyEventQueryObserverOptionsUpdated\n\ntype QueryCacheListener = (event: QueryCacheNotifyEvent) => void\n\nexport interface QueryStore {\n has: (queryHash: string) => boolean\n set: (queryHash: string, query: Query) => void\n get: (queryHash: string) => Query | undefined\n delete: (queryHash: string) => void\n values: () => IterableIterator\n}\n\n// CLASS\n\nexport class QueryCache extends Subscribable {\n #queries: QueryStore\n\n constructor(public config: QueryCacheConfig = {}) {\n super()\n this.#queries = new Map()\n }\n\n build<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n >(\n client: QueryClient,\n options: WithRequired<\n QueryOptions,\n 'queryKey'\n >,\n state?: QueryState,\n ): Query {\n const queryKey = options.queryKey\n const queryHash =\n options.queryHash ?? hashQueryKeyByOptions(queryKey, options)\n let query = this.get(queryHash)\n\n if (!query) {\n query = new Query({\n client,\n queryKey,\n queryHash,\n options: client.defaultQueryOptions(options),\n state,\n defaultOptions: client.getQueryDefaults(queryKey),\n })\n this.add(query)\n }\n\n return query\n }\n\n add(query: Query): void {\n if (!this.#queries.has(query.queryHash)) {\n this.#queries.set(query.queryHash, query)\n\n this.notify({\n type: 'added',\n query,\n })\n }\n }\n\n remove(query: Query): void {\n const queryInMap = this.#queries.get(query.queryHash)\n\n if (queryInMap) {\n query.destroy()\n\n if (queryInMap === query) {\n this.#queries.delete(query.queryHash)\n }\n\n this.notify({ type: 'removed', query })\n }\n }\n\n clear(): void {\n notifyManager.batch(() => {\n this.getAll().forEach((query) => {\n this.remove(query)\n })\n })\n }\n\n get<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n >(\n queryHash: string,\n ): Query | undefined {\n return this.#queries.get(queryHash) as\n | Query\n | undefined\n }\n\n getAll(): Array {\n return [...this.#queries.values()]\n }\n\n find(\n filters: WithRequired,\n ): Query | undefined {\n const defaultedFilters = { exact: true, ...filters }\n\n return this.getAll().find((query) =>\n matchQuery(defaultedFilters, query),\n ) as Query | undefined\n }\n\n findAll(filters: QueryFilters = {}): Array {\n const queries = this.getAll()\n return Object.keys(filters).length > 0\n ? queries.filter((query) => matchQuery(filters, query))\n : queries\n }\n\n notify(event: QueryCacheNotifyEvent): void {\n notifyManager.batch(() => {\n this.listeners.forEach((listener) => {\n listener(event)\n })\n })\n }\n\n onFocus(): void {\n notifyManager.batch(() => {\n this.getAll().forEach((query) => {\n query.onFocus()\n })\n })\n }\n\n onOnline(): void {\n notifyManager.batch(() => {\n this.getAll().forEach((query) => {\n query.onOnline()\n })\n })\n }\n}\n", "import {\n functionalUpdate,\n hashKey,\n hashQueryKeyByOptions,\n noop,\n partialMatchKey,\n resolveStaleTime,\n skipToken,\n} from './utils'\nimport { QueryCache } from './queryCache'\nimport { MutationCache } from './mutationCache'\nimport { focusManager } from './focusManager'\nimport { onlineManager } from './onlineManager'\nimport { notifyManager } from './notifyManager'\nimport { infiniteQueryBehavior } from './infiniteQueryBehavior'\nimport type {\n CancelOptions,\n DefaultError,\n DefaultOptions,\n DefaultedQueryObserverOptions,\n EnsureInfiniteQueryDataOptions,\n EnsureQueryDataOptions,\n FetchInfiniteQueryOptions,\n FetchQueryOptions,\n InferDataFromTag,\n InferErrorFromTag,\n InfiniteData,\n InvalidateOptions,\n InvalidateQueryFilters,\n MutationKey,\n MutationObserverOptions,\n MutationOptions,\n NoInfer,\n OmitKeyof,\n QueryClientConfig,\n QueryKey,\n QueryObserverOptions,\n QueryOptions,\n RefetchOptions,\n RefetchQueryFilters,\n ResetOptions,\n SetDataOptions,\n} from './types'\nimport type { QueryState } from './query'\nimport type { MutationFilters, QueryFilters, Updater } from './utils'\n\n// TYPES\n\ninterface QueryDefaults {\n queryKey: QueryKey\n defaultOptions: OmitKeyof, 'queryKey'>\n}\n\ninterface MutationDefaults {\n mutationKey: MutationKey\n defaultOptions: MutationOptions\n}\n\n// CLASS\n\nexport class QueryClient {\n #queryCache: QueryCache\n #mutationCache: MutationCache\n #defaultOptions: DefaultOptions\n #queryDefaults: Map\n #mutationDefaults: Map\n #mountCount: number\n #unsubscribeFocus?: () => void\n #unsubscribeOnline?: () => void\n\n constructor(config: QueryClientConfig = {}) {\n this.#queryCache = config.queryCache || new QueryCache()\n this.#mutationCache = config.mutationCache || new MutationCache()\n this.#defaultOptions = config.defaultOptions || {}\n this.#queryDefaults = new Map()\n this.#mutationDefaults = new Map()\n this.#mountCount = 0\n }\n\n mount(): void {\n this.#mountCount++\n if (this.#mountCount !== 1) return\n\n this.#unsubscribeFocus = focusManager.subscribe(async (focused) => {\n if (focused) {\n await this.resumePausedMutations()\n this.#queryCache.onFocus()\n }\n })\n this.#unsubscribeOnline = onlineManager.subscribe(async (online) => {\n if (online) {\n await this.resumePausedMutations()\n this.#queryCache.onOnline()\n }\n })\n }\n\n unmount(): void {\n this.#mountCount--\n if (this.#mountCount !== 0) return\n\n this.#unsubscribeFocus?.()\n this.#unsubscribeFocus = undefined\n\n this.#unsubscribeOnline?.()\n this.#unsubscribeOnline = undefined\n }\n\n isFetching = QueryFilters>(\n filters?: TQueryFilters,\n ): number {\n return this.#queryCache.findAll({ ...filters, fetchStatus: 'fetching' })\n .length\n }\n\n isMutating<\n TMutationFilters extends MutationFilters = MutationFilters,\n >(filters?: TMutationFilters): number {\n return this.#mutationCache.findAll({ ...filters, status: 'pending' }).length\n }\n\n /**\n * Imperative (non-reactive) way to retrieve data for a QueryKey.\n * Should only be used in callbacks or functions where reading the latest data is necessary, e.g. for optimistic updates.\n *\n * Hint: Do not use this function inside a component, because it won't receive updates.\n * Use `useQuery` to create a `QueryObserver` that subscribes to changes.\n */\n getQueryData<\n TQueryFnData = unknown,\n TTaggedQueryKey extends QueryKey = QueryKey,\n TInferredQueryFnData = InferDataFromTag,\n >(queryKey: TTaggedQueryKey): TInferredQueryFnData | undefined {\n const options = this.defaultQueryOptions({ queryKey })\n\n return this.#queryCache.get(options.queryHash)?.state\n .data\n }\n\n ensureQueryData<\n TQueryFnData,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n >(\n options: EnsureQueryDataOptions,\n ): Promise {\n const defaultedOptions = this.defaultQueryOptions(options)\n const query = this.#queryCache.build(this, defaultedOptions)\n const cachedData = query.state.data\n\n if (cachedData === undefined) {\n return this.fetchQuery(options)\n }\n\n if (\n options.revalidateIfStale &&\n query.isStaleByTime(resolveStaleTime(defaultedOptions.staleTime, query))\n ) {\n void this.prefetchQuery(defaultedOptions)\n }\n\n return Promise.resolve(cachedData)\n }\n\n getQueriesData<\n TQueryFnData = unknown,\n TQueryFilters extends QueryFilters = QueryFilters,\n >(filters: TQueryFilters): Array<[QueryKey, TQueryFnData | undefined]> {\n return this.#queryCache.findAll(filters).map(({ queryKey, state }) => {\n const data = state.data as TQueryFnData | undefined\n return [queryKey, data]\n })\n }\n\n setQueryData<\n TQueryFnData = unknown,\n TTaggedQueryKey extends QueryKey = QueryKey,\n TInferredQueryFnData = InferDataFromTag,\n >(\n queryKey: TTaggedQueryKey,\n updater: Updater<\n NoInfer | undefined,\n NoInfer | undefined\n >,\n options?: SetDataOptions,\n ): NoInfer | undefined {\n const defaultedOptions = this.defaultQueryOptions<\n any,\n any,\n unknown,\n any,\n QueryKey\n >({ queryKey })\n\n const query = this.#queryCache.get(\n defaultedOptions.queryHash,\n )\n const prevData = query?.state.data\n const data = functionalUpdate(updater, prevData)\n\n if (data === undefined) {\n return undefined\n }\n\n return this.#queryCache\n .build(this, defaultedOptions)\n .setData(data, { ...options, manual: true })\n }\n\n setQueriesData<\n TQueryFnData,\n TQueryFilters extends QueryFilters = QueryFilters,\n >(\n filters: TQueryFilters,\n updater: Updater<\n NoInfer | undefined,\n NoInfer | undefined\n >,\n options?: SetDataOptions,\n ): Array<[QueryKey, TQueryFnData | undefined]> {\n return notifyManager.batch(() =>\n this.#queryCache\n .findAll(filters)\n .map(({ queryKey }) => [\n queryKey,\n this.setQueryData(queryKey, updater, options),\n ]),\n )\n }\n\n getQueryState<\n TQueryFnData = unknown,\n TError = DefaultError,\n TTaggedQueryKey extends QueryKey = QueryKey,\n TInferredQueryFnData = InferDataFromTag,\n TInferredError = InferErrorFromTag,\n >(\n queryKey: TTaggedQueryKey,\n ): QueryState | undefined {\n const options = this.defaultQueryOptions({ queryKey })\n return this.#queryCache.get(\n options.queryHash,\n )?.state\n }\n\n removeQueries(\n filters?: QueryFilters,\n ): void {\n const queryCache = this.#queryCache\n notifyManager.batch(() => {\n queryCache.findAll(filters).forEach((query) => {\n queryCache.remove(query)\n })\n })\n }\n\n resetQueries(\n filters?: QueryFilters,\n options?: ResetOptions,\n ): Promise {\n const queryCache = this.#queryCache\n\n return notifyManager.batch(() => {\n queryCache.findAll(filters).forEach((query) => {\n query.reset()\n })\n return this.refetchQueries(\n {\n type: 'active',\n ...filters,\n },\n options,\n )\n })\n }\n\n cancelQueries(\n filters?: QueryFilters,\n cancelOptions: CancelOptions = {},\n ): Promise {\n const defaultedCancelOptions = { revert: true, ...cancelOptions }\n\n const promises = notifyManager.batch(() =>\n this.#queryCache\n .findAll(filters)\n .map((query) => query.cancel(defaultedCancelOptions)),\n )\n\n return Promise.all(promises).then(noop).catch(noop)\n }\n\n invalidateQueries(\n filters?: InvalidateQueryFilters,\n options: InvalidateOptions = {},\n ): Promise {\n return notifyManager.batch(() => {\n this.#queryCache.findAll(filters).forEach((query) => {\n query.invalidate()\n })\n\n if (filters?.refetchType === 'none') {\n return Promise.resolve()\n }\n return this.refetchQueries(\n {\n ...filters,\n type: filters?.refetchType ?? filters?.type ?? 'active',\n },\n options,\n )\n })\n }\n\n refetchQueries(\n filters?: RefetchQueryFilters,\n options: RefetchOptions = {},\n ): Promise {\n const fetchOptions = {\n ...options,\n cancelRefetch: options.cancelRefetch ?? true,\n }\n const promises = notifyManager.batch(() =>\n this.#queryCache\n .findAll(filters)\n .filter((query) => !query.isDisabled() && !query.isStatic())\n .map((query) => {\n let promise = query.fetch(undefined, fetchOptions)\n if (!fetchOptions.throwOnError) {\n promise = promise.catch(noop)\n }\n return query.state.fetchStatus === 'paused'\n ? Promise.resolve()\n : promise\n }),\n )\n\n return Promise.all(promises).then(noop)\n }\n\n fetchQuery<\n TQueryFnData,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = never,\n >(\n options: FetchQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n ): Promise {\n const defaultedOptions = this.defaultQueryOptions(options)\n\n // https://github.com/tannerlinsley/react-query/issues/652\n if (defaultedOptions.retry === undefined) {\n defaultedOptions.retry = false\n }\n\n const query = this.#queryCache.build(this, defaultedOptions)\n\n return query.isStaleByTime(\n resolveStaleTime(defaultedOptions.staleTime, query),\n )\n ? query.fetch(defaultedOptions)\n : Promise.resolve(query.state.data as TData)\n }\n\n prefetchQuery<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n >(\n options: FetchQueryOptions,\n ): Promise {\n return this.fetchQuery(options).then(noop).catch(noop)\n }\n\n fetchInfiniteQuery<\n TQueryFnData,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n >(\n options: FetchInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n ): Promise> {\n options.behavior = infiniteQueryBehavior<\n TQueryFnData,\n TError,\n TData,\n TPageParam\n >(options.pages)\n return this.fetchQuery(options as any)\n }\n\n prefetchInfiniteQuery<\n TQueryFnData,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n >(\n options: FetchInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n ): Promise {\n return this.fetchInfiniteQuery(options).then(noop).catch(noop)\n }\n\n ensureInfiniteQueryData<\n TQueryFnData,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n >(\n options: EnsureInfiniteQueryDataOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n ): Promise> {\n options.behavior = infiniteQueryBehavior<\n TQueryFnData,\n TError,\n TData,\n TPageParam\n >(options.pages)\n\n return this.ensureQueryData(options as any)\n }\n\n resumePausedMutations(): Promise {\n if (onlineManager.isOnline()) {\n return this.#mutationCache.resumePausedMutations()\n }\n return Promise.resolve()\n }\n\n getQueryCache(): QueryCache {\n return this.#queryCache\n }\n\n getMutationCache(): MutationCache {\n return this.#mutationCache\n }\n\n getDefaultOptions(): DefaultOptions {\n return this.#defaultOptions\n }\n\n setDefaultOptions(options: DefaultOptions): void {\n this.#defaultOptions = options\n }\n\n setQueryDefaults<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryData = TQueryFnData,\n >(\n queryKey: QueryKey,\n options: Partial<\n OmitKeyof<\n QueryObserverOptions,\n 'queryKey'\n >\n >,\n ): void {\n this.#queryDefaults.set(hashKey(queryKey), {\n queryKey,\n defaultOptions: options,\n })\n }\n\n getQueryDefaults(\n queryKey: QueryKey,\n ): OmitKeyof, 'queryKey'> {\n const defaults = [...this.#queryDefaults.values()]\n\n const result: OmitKeyof<\n QueryObserverOptions,\n 'queryKey'\n > = {}\n\n defaults.forEach((queryDefault) => {\n if (partialMatchKey(queryKey, queryDefault.queryKey)) {\n Object.assign(result, queryDefault.defaultOptions)\n }\n })\n return result\n }\n\n setMutationDefaults<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n >(\n mutationKey: MutationKey,\n options: OmitKeyof<\n MutationObserverOptions,\n 'mutationKey'\n >,\n ): void {\n this.#mutationDefaults.set(hashKey(mutationKey), {\n mutationKey,\n defaultOptions: options,\n })\n }\n\n getMutationDefaults(\n mutationKey: MutationKey,\n ): OmitKeyof, 'mutationKey'> {\n const defaults = [...this.#mutationDefaults.values()]\n\n const result: OmitKeyof<\n MutationObserverOptions,\n 'mutationKey'\n > = {}\n\n defaults.forEach((queryDefault) => {\n if (partialMatchKey(mutationKey, queryDefault.mutationKey)) {\n Object.assign(result, queryDefault.defaultOptions)\n }\n })\n\n return result\n }\n\n defaultQueryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = never,\n >(\n options:\n | QueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey,\n TPageParam\n >\n | DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n ): DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n > {\n if (options._defaulted) {\n return options as DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >\n }\n\n const defaultedOptions = {\n ...this.#defaultOptions.queries,\n ...this.getQueryDefaults(options.queryKey),\n ...options,\n _defaulted: true,\n }\n\n if (!defaultedOptions.queryHash) {\n defaultedOptions.queryHash = hashQueryKeyByOptions(\n defaultedOptions.queryKey,\n defaultedOptions,\n )\n }\n\n // dependent default values\n if (defaultedOptions.refetchOnReconnect === undefined) {\n defaultedOptions.refetchOnReconnect =\n defaultedOptions.networkMode !== 'always'\n }\n if (defaultedOptions.throwOnError === undefined) {\n defaultedOptions.throwOnError = !!defaultedOptions.suspense\n }\n\n if (!defaultedOptions.networkMode && defaultedOptions.persister) {\n defaultedOptions.networkMode = 'offlineFirst'\n }\n\n if (defaultedOptions.queryFn === skipToken) {\n defaultedOptions.enabled = false\n }\n\n return defaultedOptions as DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >\n }\n\n defaultMutationOptions>(\n options?: T,\n ): T {\n if (options?._defaulted) {\n return options\n }\n return {\n ...this.#defaultOptions.mutations,\n ...(options?.mutationKey &&\n this.getMutationDefaults(options.mutationKey)),\n ...options,\n _defaulted: true,\n } as T\n }\n\n clear(): void {\n this.#queryCache.clear()\n this.#mutationCache.clear()\n }\n}\n", "import { addConsumeAwareSignal, addToEnd } from './utils'\nimport type {\n OmitKeyof,\n QueryFunction,\n QueryFunctionContext,\n QueryKey,\n} from './types'\n\ntype BaseStreamedQueryParams = {\n streamFn: (\n context: QueryFunctionContext,\n ) => AsyncIterable | Promise>\n refetchMode?: 'append' | 'reset' | 'replace'\n}\n\ntype SimpleStreamedQueryParams<\n TQueryFnData,\n TQueryKey extends QueryKey,\n> = BaseStreamedQueryParams & {\n reducer?: never\n initialValue?: never\n}\n\ntype ReducibleStreamedQueryParams<\n TQueryFnData,\n TData,\n TQueryKey extends QueryKey,\n> = BaseStreamedQueryParams & {\n reducer: (acc: TData, chunk: TQueryFnData) => TData\n initialValue: TData\n}\n\ntype StreamedQueryParams =\n | SimpleStreamedQueryParams\n | ReducibleStreamedQueryParams\n\n/**\n * This is a helper function to create a query function that streams data from an AsyncIterable.\n * Data will be an Array of all the chunks received.\n * The query will be in a 'pending' state until the first chunk of data is received, but will go to 'success' after that.\n * The query will stay in fetchStatus 'fetching' until the stream ends.\n * @param queryFn - The function that returns an AsyncIterable to stream data from.\n * @param refetchMode - Defines how re-fetches are handled.\n * Defaults to `'reset'`, erases all data and puts the query back into `pending` state.\n * Set to `'append'` to append new data to the existing data.\n * Set to `'replace'` to write all data to the cache once the stream ends.\n * @param reducer - A function to reduce the streamed chunks into the final data.\n * Defaults to a function that appends chunks to the end of the array.\n * @param initialValue - Initial value to be used while the first chunk is being fetched, and returned if the stream yields no values.\n */\nexport function streamedQuery<\n TQueryFnData = unknown,\n TData = Array,\n TQueryKey extends QueryKey = QueryKey,\n>({\n streamFn,\n refetchMode = 'reset',\n reducer = (items, chunk) =>\n addToEnd(items as Array, chunk) as TData,\n initialValue = [] as TData,\n}: StreamedQueryParams): QueryFunction<\n TData,\n TQueryKey\n> {\n return async (context) => {\n const query = context.client\n .getQueryCache()\n .find({ queryKey: context.queryKey, exact: true })\n const isRefetch = !!query && query.state.data !== undefined\n if (isRefetch && refetchMode === 'reset') {\n query.setState({\n status: 'pending',\n data: undefined,\n error: null,\n fetchStatus: 'fetching',\n })\n }\n\n let result = initialValue\n\n let cancelled: boolean = false as boolean\n const streamFnContext = addConsumeAwareSignal<\n OmitKeyof\n >(\n {\n client: context.client,\n meta: context.meta,\n queryKey: context.queryKey,\n pageParam: context.pageParam,\n direction: context.direction,\n },\n () => context.signal,\n () => (cancelled = true),\n )\n\n const stream = await streamFn(streamFnContext)\n\n const isReplaceRefetch = isRefetch && refetchMode === 'replace'\n\n for await (const chunk of stream) {\n if (cancelled) {\n break\n }\n\n if (isReplaceRefetch) {\n // don't append to the cache directly when replace-refetching\n result = reducer(result, chunk)\n } else {\n context.client.setQueryData(context.queryKey, (prev) =>\n reducer(prev === undefined ? initialValue : prev, chunk),\n )\n }\n }\n\n // finalize result: replace-refetching needs to write to the cache\n if (isReplaceRefetch && !cancelled) {\n context.client.setQueryData(context.queryKey, result)\n }\n\n return context.client.getQueryData(context.queryKey) ?? initialValue\n }\n}\n", "/* istanbul ignore file */\n\nimport type { QueryClient } from './queryClient'\nimport type { DehydrateOptions, HydrateOptions } from './hydration'\nimport type { MutationState } from './mutation'\nimport type { FetchDirection, Query, QueryBehavior } from './query'\nimport type { RetryDelayValue, RetryValue } from './retryer'\nimport type { QueryFilters, QueryTypeFilter, SkipToken } from './utils'\nimport type { QueryCache } from './queryCache'\nimport type { MutationCache } from './mutationCache'\n\nexport type NonUndefinedGuard = T extends undefined ? never : T\n\nexport type DistributiveOmit<\n TObject,\n TKey extends keyof TObject,\n> = TObject extends any ? Omit : never\n\nexport type OmitKeyof<\n TObject,\n TKey extends TStrictly extends 'safely'\n ?\n | keyof TObject\n | (string & Record)\n | (number & Record)\n | (symbol & Record)\n : keyof TObject,\n TStrictly extends 'strictly' | 'safely' = 'strictly',\n> = Omit\n\nexport type Override = {\n [AKey in keyof TTargetA]: AKey extends keyof TTargetB\n ? TTargetB[AKey]\n : TTargetA[AKey]\n}\n\nexport type NoInfer = [T][T extends any ? 0 : never]\n\nexport interface Register {\n // defaultError: Error\n // queryMeta: Record\n // mutationMeta: Record\n // queryKey: ReadonlyArray\n // mutationKey: ReadonlyArray\n}\n\nexport type DefaultError = Register extends {\n defaultError: infer TError\n}\n ? TError\n : Error\n\nexport type QueryKey = Register extends {\n queryKey: infer TQueryKey\n}\n ? TQueryKey extends ReadonlyArray\n ? TQueryKey\n : TQueryKey extends Array\n ? TQueryKey\n : ReadonlyArray\n : ReadonlyArray\n\nexport const dataTagSymbol = Symbol('dataTagSymbol')\nexport type dataTagSymbol = typeof dataTagSymbol\nexport const dataTagErrorSymbol = Symbol('dataTagErrorSymbol')\nexport type dataTagErrorSymbol = typeof dataTagErrorSymbol\nexport const unsetMarker = Symbol('unsetMarker')\nexport type UnsetMarker = typeof unsetMarker\nexport type AnyDataTag = {\n [dataTagSymbol]: any\n [dataTagErrorSymbol]: any\n}\nexport type DataTag<\n TType,\n TValue,\n TError = UnsetMarker,\n> = TType extends AnyDataTag\n ? TType\n : TType & {\n [dataTagSymbol]: TValue\n [dataTagErrorSymbol]: TError\n }\n\nexport type InferDataFromTag =\n TTaggedQueryKey extends DataTag\n ? TaggedValue\n : TQueryFnData\n\nexport type InferErrorFromTag =\n TTaggedQueryKey extends DataTag\n ? TaggedError extends UnsetMarker\n ? TError\n : TaggedError\n : TError\n\nexport type QueryFunction<\n T = unknown,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = never,\n> = (context: QueryFunctionContext) => T | Promise\n\nexport type StaleTime = number | 'static'\n\nexport type StaleTimeFunction<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> =\n | StaleTime\n | ((query: Query) => StaleTime)\n\nexport type Enabled<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> =\n | boolean\n | ((query: Query) => boolean)\n\nexport type QueryPersister<\n T = unknown,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = never,\n> = [TPageParam] extends [never]\n ? (\n queryFn: QueryFunction,\n context: QueryFunctionContext,\n query: Query,\n ) => T | Promise\n : (\n queryFn: QueryFunction,\n context: QueryFunctionContext,\n query: Query,\n ) => T | Promise\n\nexport type QueryFunctionContext<\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = never,\n> = [TPageParam] extends [never]\n ? {\n client: QueryClient\n queryKey: TQueryKey\n signal: AbortSignal\n meta: QueryMeta | undefined\n pageParam?: unknown\n /**\n * @deprecated\n * if you want access to the direction, you can add it to the pageParam\n */\n direction?: unknown\n }\n : {\n client: QueryClient\n queryKey: TQueryKey\n signal: AbortSignal\n pageParam: TPageParam\n /**\n * @deprecated\n * if you want access to the direction, you can add it to the pageParam\n */\n direction: FetchDirection\n meta: QueryMeta | undefined\n }\n\nexport type InitialDataFunction = () => T | undefined\n\ntype NonFunctionGuard = T extends Function ? never : T\n\nexport type PlaceholderDataFunction<\n TQueryFnData = unknown,\n TError = DefaultError,\n TQueryData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> = (\n previousData: TQueryData | undefined,\n previousQuery: Query | undefined,\n) => TQueryData | undefined\n\nexport type QueriesPlaceholderDataFunction = (\n previousData: undefined,\n previousQuery: undefined,\n) => TQueryData | undefined\n\nexport type QueryKeyHashFunction = (\n queryKey: TQueryKey,\n) => string\n\nexport type GetPreviousPageParamFunction = (\n firstPage: TQueryFnData,\n allPages: Array,\n firstPageParam: TPageParam,\n allPageParams: Array,\n) => TPageParam | undefined | null\n\nexport type GetNextPageParamFunction = (\n lastPage: TQueryFnData,\n allPages: Array,\n lastPageParam: TPageParam,\n allPageParams: Array,\n) => TPageParam | undefined | null\n\nexport interface InfiniteData {\n pages: Array\n pageParams: Array\n}\n\nexport type QueryMeta = Register extends {\n queryMeta: infer TQueryMeta\n}\n ? TQueryMeta extends Record\n ? TQueryMeta\n : Record\n : Record\n\nexport type NetworkMode = 'online' | 'always' | 'offlineFirst'\n\nexport type NotifyOnChangeProps =\n | Array\n | 'all'\n | undefined\n | (() => Array | 'all' | undefined)\n\nexport interface QueryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = never,\n> {\n /**\n * If `false`, failed queries will not retry by default.\n * If `true`, failed queries will retry infinitely., failureCount: num\n * If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number.\n * If set to a function `(failureCount, error) => boolean` failed queries will retry until the function returns false.\n */\n retry?: RetryValue\n retryDelay?: RetryDelayValue\n networkMode?: NetworkMode\n /**\n * The time in milliseconds that unused/inactive cache data remains in memory.\n * When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration.\n * When different garbage collection times are specified, the longest one will be used.\n * Setting it to `Infinity` will disable garbage collection.\n */\n gcTime?: number\n queryFn?: QueryFunction | SkipToken\n persister?: QueryPersister<\n NoInfer,\n NoInfer,\n NoInfer\n >\n queryHash?: string\n queryKey?: TQueryKey\n queryKeyHashFn?: QueryKeyHashFunction\n initialData?: TData | InitialDataFunction\n initialDataUpdatedAt?: number | (() => number | undefined)\n behavior?: QueryBehavior\n /**\n * Set this to `false` to disable structural sharing between query results.\n * Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic.\n * Defaults to `true`.\n */\n structuralSharing?:\n | boolean\n | ((oldData: unknown | undefined, newData: unknown) => unknown)\n _defaulted?: boolean\n /**\n * Additional payload to be stored on each query.\n * Use this property to pass information that can be used in other places.\n */\n meta?: QueryMeta\n /**\n * Maximum number of pages to store in the data of an infinite query.\n */\n maxPages?: number\n}\n\nexport interface InitialPageParam {\n initialPageParam: TPageParam\n}\n\nexport interface InfiniteQueryPageParamsOptions<\n TQueryFnData = unknown,\n TPageParam = unknown,\n> extends InitialPageParam {\n /**\n * This function can be set to automatically get the previous cursor for infinite queries.\n * The result will also be used to determine the value of `hasPreviousPage`.\n */\n getPreviousPageParam?: GetPreviousPageParamFunction\n /**\n * This function can be set to automatically get the next cursor for infinite queries.\n * The result will also be used to determine the value of `hasNextPage`.\n */\n getNextPageParam: GetNextPageParamFunction\n}\n\nexport type ThrowOnError<\n TQueryFnData,\n TError,\n TQueryData,\n TQueryKey extends QueryKey,\n> =\n | boolean\n | ((\n error: TError,\n query: Query,\n ) => boolean)\n\nexport interface QueryObserverOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = never,\n> extends WithRequired<\n QueryOptions,\n 'queryKey'\n> {\n /**\n * Set this to `false` or a function that returns `false` to disable automatic refetching when the query mounts or changes query keys.\n * To refetch the query, use the `refetch` method returned from the `useQuery` instance.\n * Accepts a boolean or function that returns a boolean.\n * Defaults to `true`.\n */\n enabled?: Enabled\n /**\n * The time in milliseconds after data is considered stale.\n * If set to `Infinity`, the data will never be considered stale.\n * If set to a function, the function will be executed with the query to compute a `staleTime`.\n * Defaults to `0`.\n */\n staleTime?: StaleTimeFunction\n /**\n * If set to a number, the query will continuously refetch at this frequency in milliseconds.\n * If set to a function, the function will be executed with the latest data and query to compute a frequency\n * Defaults to `false`.\n */\n refetchInterval?:\n | number\n | false\n | ((\n query: Query,\n ) => number | false | undefined)\n /**\n * If set to `true`, the query will continue to refetch while their tab/window is in the background.\n * Defaults to `false`.\n */\n refetchIntervalInBackground?: boolean\n /**\n * If set to `true`, the query will refetch on window focus if the data is stale.\n * If set to `false`, the query will not refetch on window focus.\n * If set to `'always'`, the query will always refetch on window focus.\n * If set to a function, the function will be executed with the latest data and query to compute the value.\n * Defaults to `true`.\n */\n refetchOnWindowFocus?:\n | boolean\n | 'always'\n | ((\n query: Query,\n ) => boolean | 'always')\n /**\n * If set to `true`, the query will refetch on reconnect if the data is stale.\n * If set to `false`, the query will not refetch on reconnect.\n * If set to `'always'`, the query will always refetch on reconnect.\n * If set to a function, the function will be executed with the latest data and query to compute the value.\n * Defaults to the value of `networkOnline` (`true`)\n */\n refetchOnReconnect?:\n | boolean\n | 'always'\n | ((\n query: Query,\n ) => boolean | 'always')\n /**\n * If set to `true`, the query will refetch on mount if the data is stale.\n * If set to `false`, will disable additional instances of a query to trigger background refetch.\n * If set to `'always'`, the query will always refetch on mount.\n * If set to a function, the function will be executed with the latest data and query to compute the value\n * Defaults to `true`.\n */\n refetchOnMount?:\n | boolean\n | 'always'\n | ((\n query: Query,\n ) => boolean | 'always')\n /**\n * If set to `false`, the query will not be retried on mount if it contains an error.\n * Defaults to `true`.\n */\n retryOnMount?: boolean\n /**\n * If set, the component will only re-render if any of the listed properties change.\n * When set to `['data', 'error']`, the component will only re-render when the `data` or `error` properties change.\n * When set to `'all'`, the component will re-render whenever a query is updated.\n * When set to a function, the function will be executed to compute the list of properties.\n * By default, access to properties will be tracked, and the component will only re-render when one of the tracked properties change.\n */\n notifyOnChangeProps?: NotifyOnChangeProps\n /**\n * Whether errors should be thrown instead of setting the `error` property.\n * If set to `true` or `suspense` is `true`, all errors will be thrown to the error boundary.\n * If set to `false` and `suspense` is `false`, errors are returned as state.\n * If set to a function, it will be passed the error and the query, and it should return a boolean indicating whether to show the error in an error boundary (`true`) or return the error as state (`false`).\n * Defaults to `false`.\n */\n throwOnError?: ThrowOnError\n /**\n * This option can be used to transform or select a part of the data returned by the query function.\n */\n select?: (data: TQueryData) => TData\n /**\n * If set to `true`, the query will suspend when `status === 'pending'`\n * and throw errors when `status === 'error'`.\n * Defaults to `false`.\n */\n suspense?: boolean\n /**\n * If set, this value will be used as the placeholder data for this particular query observer while the query is still in the `loading` data and no initialData has been provided.\n */\n placeholderData?:\n | NonFunctionGuard\n | PlaceholderDataFunction<\n NonFunctionGuard,\n TError,\n NonFunctionGuard,\n TQueryKey\n >\n\n _optimisticResults?: 'optimistic' | 'isRestoring'\n\n /**\n * Enable prefetching during rendering\n */\n experimental_prefetchInRender?: boolean\n}\n\nexport type WithRequired = TTarget & {\n [_ in TKey]: {}\n}\n\nexport type DefaultedQueryObserverOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> = WithRequired<\n QueryObserverOptions,\n 'throwOnError' | 'refetchOnReconnect' | 'queryHash'\n>\n\nexport interface InfiniteQueryObserverOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>\n extends\n QueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n InfiniteData,\n TQueryKey,\n TPageParam\n >,\n InfiniteQueryPageParamsOptions {}\n\nexport type DefaultedInfiniteQueryObserverOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> = WithRequired<\n InfiniteQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n 'throwOnError' | 'refetchOnReconnect' | 'queryHash'\n>\n\nexport interface FetchQueryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = never,\n> extends WithRequired<\n QueryOptions,\n 'queryKey'\n> {\n initialPageParam?: never\n /**\n * The time in milliseconds after data is considered stale.\n * If the data is fresh it will be returned from the cache.\n */\n staleTime?: StaleTimeFunction\n}\n\nexport interface EnsureQueryDataOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = never,\n> extends FetchQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n> {\n revalidateIfStale?: boolean\n}\n\nexport type EnsureInfiniteQueryDataOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> = FetchInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n> & {\n revalidateIfStale?: boolean\n}\n\ntype FetchInfiniteQueryPages =\n | { pages?: never }\n | {\n pages: number\n getNextPageParam: GetNextPageParamFunction\n }\n\nexport type FetchInfiniteQueryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> = Omit<\n FetchQueryOptions<\n TQueryFnData,\n TError,\n InfiniteData,\n TQueryKey,\n TPageParam\n >,\n 'initialPageParam'\n> &\n InitialPageParam &\n FetchInfiniteQueryPages\n\nexport interface ResultOptions {\n throwOnError?: boolean\n}\n\nexport interface RefetchOptions extends ResultOptions {\n /**\n * If set to `true`, a currently running request will be cancelled before a new request is made\n *\n * If set to `false`, no refetch will be made if there is already a request running.\n *\n * Defaults to `true`.\n */\n cancelRefetch?: boolean\n}\n\nexport interface InvalidateQueryFilters<\n TQueryKey extends QueryKey = QueryKey,\n> extends QueryFilters {\n refetchType?: QueryTypeFilter | 'none'\n}\n\nexport interface RefetchQueryFilters<\n TQueryKey extends QueryKey = QueryKey,\n> extends QueryFilters {}\n\nexport interface InvalidateOptions extends RefetchOptions {}\nexport interface ResetOptions extends RefetchOptions {}\n\nexport interface FetchNextPageOptions extends ResultOptions {\n /**\n * If set to `true`, calling `fetchNextPage` repeatedly will invoke `queryFn` every time,\n * whether the previous invocation has resolved or not. Also, the result from previous invocations will be ignored.\n *\n * If set to `false`, calling `fetchNextPage` repeatedly won't have any effect until the first invocation has resolved.\n *\n * Defaults to `true`.\n */\n cancelRefetch?: boolean\n}\n\nexport interface FetchPreviousPageOptions extends ResultOptions {\n /**\n * If set to `true`, calling `fetchPreviousPage` repeatedly will invoke `queryFn` every time,\n * whether the previous invocation has resolved or not. Also, the result from previous invocations will be ignored.\n *\n * If set to `false`, calling `fetchPreviousPage` repeatedly won't have any effect until the first invocation has resolved.\n *\n * Defaults to `true`.\n */\n cancelRefetch?: boolean\n}\n\nexport type QueryStatus = 'pending' | 'error' | 'success'\nexport type FetchStatus = 'fetching' | 'paused' | 'idle'\n\nexport interface QueryObserverBaseResult<\n TData = unknown,\n TError = DefaultError,\n> {\n /**\n * The last successfully resolved data for the query.\n */\n data: TData | undefined\n /**\n * The timestamp for when the query most recently returned the `status` as `\"success\"`.\n */\n dataUpdatedAt: number\n /**\n * The error object for the query, if an error was thrown.\n * - Defaults to `null`.\n */\n error: TError | null\n /**\n * The timestamp for when the query most recently returned the `status` as `\"error\"`.\n */\n errorUpdatedAt: number\n /**\n * The failure count for the query.\n * - Incremented every time the query fails.\n * - Reset to `0` when the query succeeds.\n */\n failureCount: number\n /**\n * The failure reason for the query retry.\n * - Reset to `null` when the query succeeds.\n */\n failureReason: TError | null\n /**\n * The sum of all errors.\n */\n errorUpdateCount: number\n /**\n * A derived boolean from the `status` variable, provided for convenience.\n * - `true` if the query attempt resulted in an error.\n */\n isError: boolean\n /**\n * Will be `true` if the query has been fetched.\n */\n isFetched: boolean\n /**\n * Will be `true` if the query has been fetched after the component mounted.\n * - This property can be used to not show any previously cached data.\n */\n isFetchedAfterMount: boolean\n /**\n * A derived boolean from the `fetchStatus` variable, provided for convenience.\n * - `true` whenever the `queryFn` is executing, which includes initial `pending` as well as background refetch.\n */\n isFetching: boolean\n /**\n * Is `true` whenever the first fetch for a query is in-flight.\n * - Is the same as `isFetching && isPending`.\n */\n isLoading: boolean\n /**\n * Will be `pending` if there's no cached data and no query attempt was finished yet.\n */\n isPending: boolean\n /**\n * Will be `true` if the query failed while fetching for the first time.\n */\n isLoadingError: boolean\n /**\n * @deprecated `isInitialLoading` is being deprecated in favor of `isLoading`\n * and will be removed in the next major version.\n */\n isInitialLoading: boolean\n /**\n * A derived boolean from the `fetchStatus` variable, provided for convenience.\n * - The query wanted to fetch, but has been `paused`.\n */\n isPaused: boolean\n /**\n * Will be `true` if the data shown is the placeholder data.\n */\n isPlaceholderData: boolean\n /**\n * Will be `true` if the query failed while refetching.\n */\n isRefetchError: boolean\n /**\n * Is `true` whenever a background refetch is in-flight, which _does not_ include initial `pending`.\n * - Is the same as `isFetching && !isPending`.\n */\n isRefetching: boolean\n /**\n * Will be `true` if the data in the cache is invalidated or if the data is older than the given `staleTime`.\n */\n isStale: boolean\n /**\n * A derived boolean from the `status` variable, provided for convenience.\n * - `true` if the query has received a response with no errors and is ready to display its data.\n */\n isSuccess: boolean\n /**\n * `true` if this observer is enabled, `false` otherwise.\n */\n isEnabled: boolean\n /**\n * A function to manually refetch the query.\n */\n refetch: (\n options?: RefetchOptions,\n ) => Promise>\n /**\n * The status of the query.\n * - Will be:\n * - `pending` if there's no cached data and no query attempt was finished yet.\n * - `error` if the query attempt resulted in an error.\n * - `success` if the query has received a response with no errors and is ready to display its data.\n */\n status: QueryStatus\n /**\n * The fetch status of the query.\n * - `fetching`: Is `true` whenever the queryFn is executing, which includes initial `pending` as well as background refetch.\n * - `paused`: The query wanted to fetch, but has been `paused`.\n * - `idle`: The query is not fetching.\n * - See [Network Mode](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode) for more information.\n */\n fetchStatus: FetchStatus\n /**\n * A stable promise that will be resolved with the data of the query.\n * Requires the `experimental_prefetchInRender` feature flag to be enabled.\n * @example\n *\n * ### Enabling the feature flag\n * ```ts\n * const client = new QueryClient({\n * defaultOptions: {\n * queries: {\n * experimental_prefetchInRender: true,\n * },\n * },\n * })\n * ```\n *\n * ### Usage\n * ```tsx\n * import { useQuery } from '@tanstack/react-query'\n * import React from 'react'\n * import { fetchTodos, type Todo } from './api'\n *\n * function TodoList({ query }: { query: UseQueryResult }) {\n * const data = React.use(query.promise)\n *\n * return (\n *
    \n * {data.map(todo => (\n *
  • {todo.title}
  • \n * ))}\n *
\n * )\n * }\n *\n * export function App() {\n * const query = useQuery({ queryKey: ['todos'], queryFn: fetchTodos })\n *\n * return (\n * <>\n *

Todos

\n * Loading...}>\n * \n * \n * \n * )\n * }\n * ```\n */\n promise: Promise\n}\n\nexport interface QueryObserverPendingResult<\n TData = unknown,\n TError = DefaultError,\n> extends QueryObserverBaseResult {\n data: undefined\n error: null\n isError: false\n isPending: true\n isLoadingError: false\n isRefetchError: false\n isSuccess: false\n isPlaceholderData: false\n status: 'pending'\n}\n\nexport interface QueryObserverLoadingResult<\n TData = unknown,\n TError = DefaultError,\n> extends QueryObserverBaseResult {\n data: undefined\n error: null\n isError: false\n isPending: true\n isLoading: true\n isLoadingError: false\n isRefetchError: false\n isSuccess: false\n isPlaceholderData: false\n status: 'pending'\n}\n\nexport interface QueryObserverLoadingErrorResult<\n TData = unknown,\n TError = DefaultError,\n> extends QueryObserverBaseResult {\n data: undefined\n error: TError\n isError: true\n isPending: false\n isLoading: false\n isLoadingError: true\n isRefetchError: false\n isSuccess: false\n isPlaceholderData: false\n status: 'error'\n}\n\nexport interface QueryObserverRefetchErrorResult<\n TData = unknown,\n TError = DefaultError,\n> extends QueryObserverBaseResult {\n data: TData\n error: TError\n isError: true\n isPending: false\n isLoading: false\n isLoadingError: false\n isRefetchError: true\n isSuccess: false\n isPlaceholderData: false\n status: 'error'\n}\n\nexport interface QueryObserverSuccessResult<\n TData = unknown,\n TError = DefaultError,\n> extends QueryObserverBaseResult {\n data: TData\n error: null\n isError: false\n isPending: false\n isLoading: false\n isLoadingError: false\n isRefetchError: false\n isSuccess: true\n isPlaceholderData: false\n status: 'success'\n}\n\nexport interface QueryObserverPlaceholderResult<\n TData = unknown,\n TError = DefaultError,\n> extends QueryObserverBaseResult {\n data: TData\n isError: false\n error: null\n isPending: false\n isLoading: false\n isLoadingError: false\n isRefetchError: false\n isSuccess: true\n isPlaceholderData: true\n status: 'success'\n}\n\nexport type DefinedQueryObserverResult<\n TData = unknown,\n TError = DefaultError,\n> =\n | QueryObserverRefetchErrorResult\n | QueryObserverSuccessResult\n\nexport type QueryObserverResult =\n | DefinedQueryObserverResult\n | QueryObserverLoadingErrorResult\n | QueryObserverLoadingResult\n | QueryObserverPendingResult\n | QueryObserverPlaceholderResult\n\nexport interface InfiniteQueryObserverBaseResult<\n TData = unknown,\n TError = DefaultError,\n> extends QueryObserverBaseResult {\n /**\n * This function allows you to fetch the next \"page\" of results.\n */\n fetchNextPage: (\n options?: FetchNextPageOptions,\n ) => Promise>\n /**\n * This function allows you to fetch the previous \"page\" of results.\n */\n fetchPreviousPage: (\n options?: FetchPreviousPageOptions,\n ) => Promise>\n /**\n * Will be `true` if there is a next page to be fetched (known via the `getNextPageParam` option).\n */\n hasNextPage: boolean\n /**\n * Will be `true` if there is a previous page to be fetched (known via the `getPreviousPageParam` option).\n */\n hasPreviousPage: boolean\n /**\n * Will be `true` if the query failed while fetching the next page.\n */\n isFetchNextPageError: boolean\n /**\n * Will be `true` while fetching the next page with `fetchNextPage`.\n */\n isFetchingNextPage: boolean\n /**\n * Will be `true` if the query failed while fetching the previous page.\n */\n isFetchPreviousPageError: boolean\n /**\n * Will be `true` while fetching the previous page with `fetchPreviousPage`.\n */\n isFetchingPreviousPage: boolean\n}\n\nexport interface InfiniteQueryObserverPendingResult<\n TData = unknown,\n TError = DefaultError,\n> extends InfiniteQueryObserverBaseResult {\n data: undefined\n error: null\n isError: false\n isPending: true\n isLoadingError: false\n isRefetchError: false\n isFetchNextPageError: false\n isFetchPreviousPageError: false\n isSuccess: false\n isPlaceholderData: false\n status: 'pending'\n}\n\nexport interface InfiniteQueryObserverLoadingResult<\n TData = unknown,\n TError = DefaultError,\n> extends InfiniteQueryObserverBaseResult {\n data: undefined\n error: null\n isError: false\n isPending: true\n isLoading: true\n isLoadingError: false\n isRefetchError: false\n isFetchNextPageError: false\n isFetchPreviousPageError: false\n isSuccess: false\n isPlaceholderData: false\n status: 'pending'\n}\n\nexport interface InfiniteQueryObserverLoadingErrorResult<\n TData = unknown,\n TError = DefaultError,\n> extends InfiniteQueryObserverBaseResult {\n data: undefined\n error: TError\n isError: true\n isPending: false\n isLoading: false\n isLoadingError: true\n isRefetchError: false\n isFetchNextPageError: false\n isFetchPreviousPageError: false\n isSuccess: false\n isPlaceholderData: false\n status: 'error'\n}\n\nexport interface InfiniteQueryObserverRefetchErrorResult<\n TData = unknown,\n TError = DefaultError,\n> extends InfiniteQueryObserverBaseResult {\n data: TData\n error: TError\n isError: true\n isPending: false\n isLoading: false\n isLoadingError: false\n isRefetchError: true\n isSuccess: false\n isPlaceholderData: false\n status: 'error'\n}\n\nexport interface InfiniteQueryObserverSuccessResult<\n TData = unknown,\n TError = DefaultError,\n> extends InfiniteQueryObserverBaseResult {\n data: TData\n error: null\n isError: false\n isPending: false\n isLoading: false\n isLoadingError: false\n isRefetchError: false\n isFetchNextPageError: false\n isFetchPreviousPageError: false\n isSuccess: true\n isPlaceholderData: false\n status: 'success'\n}\n\nexport interface InfiniteQueryObserverPlaceholderResult<\n TData = unknown,\n TError = DefaultError,\n> extends InfiniteQueryObserverBaseResult {\n data: TData\n isError: false\n error: null\n isPending: false\n isLoading: false\n isLoadingError: false\n isRefetchError: false\n isSuccess: true\n isPlaceholderData: true\n isFetchNextPageError: false\n isFetchPreviousPageError: false\n status: 'success'\n}\n\nexport type DefinedInfiniteQueryObserverResult<\n TData = unknown,\n TError = DefaultError,\n> =\n | InfiniteQueryObserverRefetchErrorResult\n | InfiniteQueryObserverSuccessResult\n\nexport type InfiniteQueryObserverResult<\n TData = unknown,\n TError = DefaultError,\n> =\n | DefinedInfiniteQueryObserverResult\n | InfiniteQueryObserverLoadingErrorResult\n | InfiniteQueryObserverLoadingResult\n | InfiniteQueryObserverPendingResult\n | InfiniteQueryObserverPlaceholderResult\n\nexport type MutationKey = Register extends {\n mutationKey: infer TMutationKey\n}\n ? TMutationKey extends ReadonlyArray\n ? TMutationKey\n : TMutationKey extends Array\n ? TMutationKey\n : ReadonlyArray\n : ReadonlyArray\n\nexport type MutationStatus = 'idle' | 'pending' | 'success' | 'error'\n\nexport type MutationScope = {\n id: string\n}\n\nexport type MutationMeta = Register extends {\n mutationMeta: infer TMutationMeta\n}\n ? TMutationMeta extends Record\n ? TMutationMeta\n : Record\n : Record\n\nexport type MutationFunctionContext = {\n client: QueryClient\n meta: MutationMeta | undefined\n mutationKey?: MutationKey\n}\n\nexport type MutationFunction = (\n variables: TVariables,\n context: MutationFunctionContext,\n) => Promise\n\nexport interface MutationOptions<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> {\n mutationFn?: MutationFunction\n mutationKey?: MutationKey\n onMutate?: (\n variables: TVariables,\n context: MutationFunctionContext,\n ) => Promise | TOnMutateResult\n onSuccess?: (\n data: TData,\n variables: TVariables,\n onMutateResult: TOnMutateResult,\n context: MutationFunctionContext,\n ) => Promise | unknown\n onError?: (\n error: TError,\n variables: TVariables,\n onMutateResult: TOnMutateResult | undefined,\n context: MutationFunctionContext,\n ) => Promise | unknown\n onSettled?: (\n data: TData | undefined,\n error: TError | null,\n variables: TVariables,\n onMutateResult: TOnMutateResult | undefined,\n context: MutationFunctionContext,\n ) => Promise | unknown\n retry?: RetryValue\n retryDelay?: RetryDelayValue\n networkMode?: NetworkMode\n gcTime?: number\n _defaulted?: boolean\n meta?: MutationMeta\n scope?: MutationScope\n}\n\nexport interface MutationObserverOptions<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> extends MutationOptions {\n throwOnError?: boolean | ((error: TError) => boolean)\n}\n\nexport interface MutateOptions<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> {\n onSuccess?: (\n data: TData,\n variables: TVariables,\n onMutateResult: TOnMutateResult | undefined,\n context: MutationFunctionContext,\n ) => void\n onError?: (\n error: TError,\n variables: TVariables,\n onMutateResult: TOnMutateResult | undefined,\n context: MutationFunctionContext,\n ) => void\n onSettled?: (\n data: TData | undefined,\n error: TError | null,\n variables: TVariables,\n onMutateResult: TOnMutateResult | undefined,\n context: MutationFunctionContext,\n ) => void\n}\n\nexport type MutateFunction<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> = (\n variables: TVariables,\n options?: MutateOptions,\n) => Promise\n\nexport interface MutationObserverBaseResult<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> extends MutationState {\n /**\n * The last successfully resolved data for the mutation.\n */\n data: TData | undefined\n /**\n * The variables object passed to the `mutationFn`.\n */\n variables: TVariables | undefined\n /**\n * The error object for the mutation, if an error was encountered.\n * - Defaults to `null`.\n */\n error: TError | null\n /**\n * A boolean variable derived from `status`.\n * - `true` if the last mutation attempt resulted in an error.\n */\n isError: boolean\n /**\n * A boolean variable derived from `status`.\n * - `true` if the mutation is in its initial state prior to executing.\n */\n isIdle: boolean\n /**\n * A boolean variable derived from `status`.\n * - `true` if the mutation is currently executing.\n */\n isPending: boolean\n /**\n * A boolean variable derived from `status`.\n * - `true` if the last mutation attempt was successful.\n */\n isSuccess: boolean\n /**\n * The status of the mutation.\n * - Will be:\n * - `idle` initial status prior to the mutation function executing.\n * - `pending` if the mutation is currently executing.\n * - `error` if the last mutation attempt resulted in an error.\n * - `success` if the last mutation attempt was successful.\n */\n status: MutationStatus\n /**\n * The mutation function you can call with variables to trigger the mutation and optionally hooks on additional callback options.\n * @param variables - The variables object to pass to the `mutationFn`.\n * @param options.onSuccess - This function will fire when the mutation is successful and will be passed the mutation's result.\n * @param options.onError - This function will fire if the mutation encounters an error and will be passed the error.\n * @param options.onSettled - This function will fire when the mutation is either successfully fetched or encounters an error and be passed either the data or error.\n * @remarks\n * - If you make multiple requests, `onSuccess` will fire only after the latest call you've made.\n * - All the callback functions (`onSuccess`, `onError`, `onSettled`) are void functions, and the returned value will be ignored.\n */\n mutate: MutateFunction\n /**\n * A function to clean the mutation internal state (i.e., it resets the mutation to its initial state).\n */\n reset: () => void\n}\n\nexport interface MutationObserverIdleResult<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> extends MutationObserverBaseResult<\n TData,\n TError,\n TVariables,\n TOnMutateResult\n> {\n data: undefined\n variables: undefined\n error: null\n isError: false\n isIdle: true\n isPending: false\n isSuccess: false\n status: 'idle'\n}\n\nexport interface MutationObserverLoadingResult<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> extends MutationObserverBaseResult<\n TData,\n TError,\n TVariables,\n TOnMutateResult\n> {\n data: undefined\n variables: TVariables\n error: null\n isError: false\n isIdle: false\n isPending: true\n isSuccess: false\n status: 'pending'\n}\n\nexport interface MutationObserverErrorResult<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> extends MutationObserverBaseResult<\n TData,\n TError,\n TVariables,\n TOnMutateResult\n> {\n data: undefined\n error: TError\n variables: TVariables\n isError: true\n isIdle: false\n isPending: false\n isSuccess: false\n status: 'error'\n}\n\nexport interface MutationObserverSuccessResult<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> extends MutationObserverBaseResult<\n TData,\n TError,\n TVariables,\n TOnMutateResult\n> {\n data: TData\n error: null\n variables: TVariables\n isError: false\n isIdle: false\n isPending: false\n isSuccess: true\n status: 'success'\n}\n\nexport type MutationObserverResult<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n> =\n | MutationObserverIdleResult\n | MutationObserverLoadingResult\n | MutationObserverErrorResult\n | MutationObserverSuccessResult\n\nexport interface QueryClientConfig {\n queryCache?: QueryCache\n mutationCache?: MutationCache\n defaultOptions?: DefaultOptions\n}\n\nexport interface DefaultOptions {\n queries?: OmitKeyof<\n QueryObserverOptions,\n 'suspense' | 'queryKey'\n >\n mutations?: MutationObserverOptions\n hydrate?: HydrateOptions['defaultOptions']\n dehydrate?: DehydrateOptions\n}\n\nexport interface CancelOptions {\n revert?: boolean\n silent?: boolean\n}\n\nexport interface SetDataOptions {\n updatedAt?: number\n}\n\nexport type NotifyEventType =\n | 'added'\n | 'removed'\n | 'updated'\n | 'observerAdded'\n | 'observerRemoved'\n | 'observerResultsUpdated'\n | 'observerOptionsUpdated'\n\nexport interface NotifyEvent {\n type: NotifyEventType\n}\n", "'use client'\nimport * as React from 'react'\n\nimport {\n QueriesObserver,\n QueryObserver,\n noop,\n notifyManager,\n} from '@tanstack/query-core'\nimport { useQueryClient } from './QueryClientProvider'\nimport { useIsRestoring } from './IsRestoringProvider'\nimport { useQueryErrorResetBoundary } from './QueryErrorResetBoundary'\nimport {\n ensurePreventErrorBoundaryRetry,\n getHasError,\n useClearResetErrorBoundary,\n} from './errorBoundaryUtils'\nimport {\n ensureSuspenseTimers,\n fetchOptimistic,\n shouldSuspend,\n} from './suspense'\nimport type {\n DefinedUseQueryResult,\n UseQueryOptions,\n UseQueryResult,\n} from './types'\nimport type {\n DefaultError,\n OmitKeyof,\n QueriesObserverOptions,\n QueriesPlaceholderDataFunction,\n QueryClient,\n QueryFunction,\n QueryKey,\n QueryObserverOptions,\n ThrowOnError,\n} from '@tanstack/query-core'\n\n// This defines the `UseQueryOptions` that are accepted in `QueriesOptions` & `GetOptions`.\n// `placeholderData` function always gets undefined passed\ntype UseQueryOptionsForUseQueries<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> = OmitKeyof<\n UseQueryOptions,\n 'placeholderData' | 'subscribed'\n> & {\n placeholderData?: TQueryFnData | QueriesPlaceholderDataFunction\n}\n\n// Avoid TS depth-limit error in case of large array literal\ntype MAXIMUM_DEPTH = 20\n\n// Widen the type of the symbol to enable type inference even if skipToken is not immutable.\ntype SkipTokenForUseQueries = symbol\n\ntype GetUseQueryOptionsForUseQueries =\n // Part 1: responsible for applying explicit type parameter to function arguments, if object { queryFnData: TQueryFnData, error: TError, data: TData }\n T extends {\n queryFnData: infer TQueryFnData\n error?: infer TError\n data: infer TData\n }\n ? UseQueryOptionsForUseQueries\n : T extends { queryFnData: infer TQueryFnData; error?: infer TError }\n ? UseQueryOptionsForUseQueries\n : T extends { data: infer TData; error?: infer TError }\n ? UseQueryOptionsForUseQueries\n : // Part 2: responsible for applying explicit type parameter to function arguments, if tuple [TQueryFnData, TError, TData]\n T extends [infer TQueryFnData, infer TError, infer TData]\n ? UseQueryOptionsForUseQueries\n : T extends [infer TQueryFnData, infer TError]\n ? UseQueryOptionsForUseQueries\n : T extends [infer TQueryFnData]\n ? UseQueryOptionsForUseQueries\n : // Part 3: responsible for inferring and enforcing type if no explicit parameter was provided\n T extends {\n queryFn?:\n | QueryFunction\n | SkipTokenForUseQueries\n select?: (data: any) => infer TData\n throwOnError?: ThrowOnError\n }\n ? UseQueryOptionsForUseQueries<\n TQueryFnData,\n unknown extends TError ? DefaultError : TError,\n unknown extends TData ? TQueryFnData : TData,\n TQueryKey\n >\n : // Fallback\n UseQueryOptionsForUseQueries\n\n// A defined initialData setting should return a DefinedUseQueryResult rather than UseQueryResult\ntype GetDefinedOrUndefinedQueryResult = T extends {\n initialData?: infer TInitialData\n}\n ? unknown extends TInitialData\n ? UseQueryResult\n : TInitialData extends TData\n ? DefinedUseQueryResult\n : TInitialData extends () => infer TInitialDataResult\n ? unknown extends TInitialDataResult\n ? UseQueryResult\n : TInitialDataResult extends TData\n ? DefinedUseQueryResult\n : UseQueryResult\n : UseQueryResult\n : UseQueryResult\n\ntype GetUseQueryResult =\n // Part 1: responsible for mapping explicit type parameter to function result, if object\n T extends { queryFnData: any; error?: infer TError; data: infer TData }\n ? GetDefinedOrUndefinedQueryResult\n : T extends { queryFnData: infer TQueryFnData; error?: infer TError }\n ? GetDefinedOrUndefinedQueryResult\n : T extends { data: infer TData; error?: infer TError }\n ? GetDefinedOrUndefinedQueryResult\n : // Part 2: responsible for mapping explicit type parameter to function result, if tuple\n T extends [any, infer TError, infer TData]\n ? GetDefinedOrUndefinedQueryResult\n : T extends [infer TQueryFnData, infer TError]\n ? GetDefinedOrUndefinedQueryResult\n : T extends [infer TQueryFnData]\n ? GetDefinedOrUndefinedQueryResult\n : // Part 3: responsible for mapping inferred type to results, if no explicit parameter was provided\n T extends {\n queryFn?:\n | QueryFunction\n | SkipTokenForUseQueries\n select?: (data: any) => infer TData\n throwOnError?: ThrowOnError\n }\n ? GetDefinedOrUndefinedQueryResult<\n T,\n unknown extends TData ? TQueryFnData : TData,\n unknown extends TError ? DefaultError : TError\n >\n : // Fallback\n UseQueryResult\n\n/**\n * QueriesOptions reducer recursively unwraps function arguments to infer/enforce type param\n */\nexport type QueriesOptions<\n T extends Array,\n TResults extends Array = [],\n TDepth extends ReadonlyArray = [],\n> = TDepth['length'] extends MAXIMUM_DEPTH\n ? Array\n : T extends []\n ? []\n : T extends [infer Head]\n ? [...TResults, GetUseQueryOptionsForUseQueries]\n : T extends [infer Head, ...infer Tails]\n ? QueriesOptions<\n [...Tails],\n [...TResults, GetUseQueryOptionsForUseQueries],\n [...TDepth, 1]\n >\n : ReadonlyArray extends T\n ? T\n : // If T is *some* array but we couldn't assign unknown[] to it, then it must hold some known/homogenous type!\n // use this to infer the param types in the case of Array.map() argument\n T extends Array<\n UseQueryOptionsForUseQueries<\n infer TQueryFnData,\n infer TError,\n infer TData,\n infer TQueryKey\n >\n >\n ? Array<\n UseQueryOptionsForUseQueries<\n TQueryFnData,\n TError,\n TData,\n TQueryKey\n >\n >\n : // Fallback\n Array\n\n/**\n * QueriesResults reducer recursively maps type param to results\n */\nexport type QueriesResults<\n T extends Array,\n TResults extends Array = [],\n TDepth extends ReadonlyArray = [],\n> = TDepth['length'] extends MAXIMUM_DEPTH\n ? Array\n : T extends []\n ? []\n : T extends [infer Head]\n ? [...TResults, GetUseQueryResult]\n : T extends [infer Head, ...infer Tails]\n ? QueriesResults<\n [...Tails],\n [...TResults, GetUseQueryResult],\n [...TDepth, 1]\n >\n : { [K in keyof T]: GetUseQueryResult }\n\nexport function useQueries<\n T extends Array,\n TCombinedResult = QueriesResults,\n>(\n {\n queries,\n ...options\n }: {\n queries:\n | readonly [...QueriesOptions]\n | readonly [...{ [K in keyof T]: GetUseQueryOptionsForUseQueries }]\n combine?: (result: QueriesResults) => TCombinedResult\n subscribed?: boolean\n },\n queryClient?: QueryClient,\n): TCombinedResult {\n const client = useQueryClient(queryClient)\n const isRestoring = useIsRestoring()\n const errorResetBoundary = useQueryErrorResetBoundary()\n\n const defaultedQueries = React.useMemo(\n () =>\n queries.map((opts) => {\n const defaultedOptions = client.defaultQueryOptions(\n opts as QueryObserverOptions,\n )\n\n // Make sure the results are already in fetching state before subscribing or updating options\n defaultedOptions._optimisticResults = isRestoring\n ? 'isRestoring'\n : 'optimistic'\n\n return defaultedOptions\n }),\n [queries, client, isRestoring],\n )\n\n defaultedQueries.forEach((queryOptions) => {\n ensureSuspenseTimers(queryOptions)\n const query = client.getQueryCache().get(queryOptions.queryHash)\n ensurePreventErrorBoundaryRetry(queryOptions, errorResetBoundary, query)\n })\n\n useClearResetErrorBoundary(errorResetBoundary)\n\n const [observer] = React.useState(\n () =>\n new QueriesObserver(\n client,\n defaultedQueries,\n options as QueriesObserverOptions,\n ),\n )\n\n // note: this must be called before useSyncExternalStore\n const [optimisticResult, getCombinedResult, trackResult] =\n observer.getOptimisticResult(\n defaultedQueries,\n (options as QueriesObserverOptions).combine,\n )\n\n const shouldSubscribe = !isRestoring && options.subscribed !== false\n React.useSyncExternalStore(\n React.useCallback(\n (onStoreChange) =>\n shouldSubscribe\n ? observer.subscribe(notifyManager.batchCalls(onStoreChange))\n : noop,\n [observer, shouldSubscribe],\n ),\n () => observer.getCurrentResult(),\n () => observer.getCurrentResult(),\n )\n\n React.useEffect(() => {\n observer.setQueries(\n defaultedQueries,\n options as QueriesObserverOptions,\n )\n }, [defaultedQueries, options, observer])\n\n const shouldAtLeastOneSuspend = optimisticResult.some((result, index) =>\n shouldSuspend(defaultedQueries[index], result),\n )\n\n const suspensePromises = shouldAtLeastOneSuspend\n ? optimisticResult.flatMap((result, index) => {\n const opts = defaultedQueries[index]\n\n if (opts && shouldSuspend(opts, result)) {\n const queryObserver = new QueryObserver(client, opts)\n return fetchOptimistic(opts, queryObserver, errorResetBoundary)\n }\n return []\n })\n : []\n\n if (suspensePromises.length > 0) {\n throw Promise.all(suspensePromises)\n }\n const firstSingleResultWhichShouldThrow = optimisticResult.find(\n (result, index) => {\n const query = defaultedQueries[index]\n return (\n query &&\n getHasError({\n result,\n errorResetBoundary,\n throwOnError: query.throwOnError,\n query: client.getQueryCache().get(query.queryHash),\n suspense: query.suspense,\n })\n )\n },\n )\n\n if (firstSingleResultWhichShouldThrow?.error) {\n throw firstSingleResultWhichShouldThrow.error\n }\n\n return getCombinedResult(trackResult())\n}\n", "'use client'\nimport * as React from 'react'\n\nimport type { QueryClient } from '@tanstack/query-core'\n\nexport const QueryClientContext = React.createContext(\n undefined,\n)\n\nexport const useQueryClient = (queryClient?: QueryClient) => {\n const client = React.useContext(QueryClientContext)\n\n if (queryClient) {\n return queryClient\n }\n\n if (!client) {\n throw new Error('No QueryClient set, use QueryClientProvider to set one')\n }\n\n return client\n}\n\nexport type QueryClientProviderProps = {\n client: QueryClient\n children?: React.ReactNode\n}\n\nexport const QueryClientProvider = ({\n client,\n children,\n}: QueryClientProviderProps): React.JSX.Element => {\n React.useEffect(() => {\n client.mount()\n return () => {\n client.unmount()\n }\n }, [client])\n\n return (\n \n {children}\n \n )\n}\n", "'use client'\nimport * as React from 'react'\n\nconst IsRestoringContext = React.createContext(false)\n\nexport const useIsRestoring = () => React.useContext(IsRestoringContext)\nexport const IsRestoringProvider = IsRestoringContext.Provider\n", "'use client'\nimport * as React from 'react'\n\n// CONTEXT\nexport type QueryErrorResetFunction = () => void\nexport type QueryErrorIsResetFunction = () => boolean\nexport type QueryErrorClearResetFunction = () => void\n\nexport interface QueryErrorResetBoundaryValue {\n clearReset: QueryErrorClearResetFunction\n isReset: QueryErrorIsResetFunction\n reset: QueryErrorResetFunction\n}\n\nfunction createValue(): QueryErrorResetBoundaryValue {\n let isReset = false\n return {\n clearReset: () => {\n isReset = false\n },\n reset: () => {\n isReset = true\n },\n isReset: () => {\n return isReset\n },\n }\n}\n\nconst QueryErrorResetBoundaryContext = React.createContext(createValue())\n\n// HOOK\n\nexport const useQueryErrorResetBoundary = () =>\n React.useContext(QueryErrorResetBoundaryContext)\n\n// COMPONENT\n\nexport type QueryErrorResetBoundaryFunction = (\n value: QueryErrorResetBoundaryValue,\n) => React.ReactNode\n\nexport interface QueryErrorResetBoundaryProps {\n children: QueryErrorResetBoundaryFunction | React.ReactNode\n}\n\nexport const QueryErrorResetBoundary = ({\n children,\n}: QueryErrorResetBoundaryProps) => {\n const [value] = React.useState(() => createValue())\n return (\n \n {typeof children === 'function' ? children(value) : children}\n \n )\n}\n", "'use client'\nimport * as React from 'react'\nimport { shouldThrowError } from '@tanstack/query-core'\nimport type {\n DefaultedQueryObserverOptions,\n Query,\n QueryKey,\n QueryObserverResult,\n ThrowOnError,\n} from '@tanstack/query-core'\nimport type { QueryErrorResetBoundaryValue } from './QueryErrorResetBoundary'\n\nexport const ensurePreventErrorBoundaryRetry = <\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey extends QueryKey,\n>(\n options: DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n errorResetBoundary: QueryErrorResetBoundaryValue,\n query: Query | undefined,\n) => {\n const throwOnError =\n query?.state.error && typeof options.throwOnError === 'function'\n ? shouldThrowError(options.throwOnError, [query.state.error, query])\n : options.throwOnError\n\n if (\n options.suspense ||\n options.experimental_prefetchInRender ||\n throwOnError\n ) {\n // Prevent retrying failed query if the error boundary has not been reset yet\n if (!errorResetBoundary.isReset()) {\n options.retryOnMount = false\n }\n }\n}\n\nexport const useClearResetErrorBoundary = (\n errorResetBoundary: QueryErrorResetBoundaryValue,\n) => {\n React.useEffect(() => {\n errorResetBoundary.clearReset()\n }, [errorResetBoundary])\n}\n\nexport const getHasError = <\n TData,\n TError,\n TQueryFnData,\n TQueryData,\n TQueryKey extends QueryKey,\n>({\n result,\n errorResetBoundary,\n throwOnError,\n query,\n suspense,\n}: {\n result: QueryObserverResult\n errorResetBoundary: QueryErrorResetBoundaryValue\n throwOnError: ThrowOnError\n query: Query | undefined\n suspense: boolean | undefined\n}) => {\n return (\n result.isError &&\n !errorResetBoundary.isReset() &&\n !result.isFetching &&\n query &&\n ((suspense && result.data === undefined) ||\n shouldThrowError(throwOnError, [result.error, query]))\n )\n}\n", "import type {\n DefaultError,\n DefaultedQueryObserverOptions,\n Query,\n QueryKey,\n QueryObserver,\n QueryObserverResult,\n} from '@tanstack/query-core'\nimport type { QueryErrorResetBoundaryValue } from './QueryErrorResetBoundary'\n\nexport const defaultThrowOnError = <\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n _error: TError,\n query: Query,\n) => query.state.data === undefined\n\nexport const ensureSuspenseTimers = (\n defaultedOptions: DefaultedQueryObserverOptions,\n) => {\n if (defaultedOptions.suspense) {\n // Handle staleTime to ensure minimum 1000ms in Suspense mode\n // This prevents unnecessary refetching when components remount after suspending\n const MIN_SUSPENSE_TIME_MS = 1000\n\n const clamp = (value: number | 'static' | undefined) =>\n value === 'static'\n ? value\n : Math.max(value ?? MIN_SUSPENSE_TIME_MS, MIN_SUSPENSE_TIME_MS)\n\n const originalStaleTime = defaultedOptions.staleTime\n defaultedOptions.staleTime =\n typeof originalStaleTime === 'function'\n ? (...args) => clamp(originalStaleTime(...args))\n : clamp(originalStaleTime)\n\n if (typeof defaultedOptions.gcTime === 'number') {\n defaultedOptions.gcTime = Math.max(\n defaultedOptions.gcTime,\n MIN_SUSPENSE_TIME_MS,\n )\n }\n }\n}\n\nexport const willFetch = (\n result: QueryObserverResult,\n isRestoring: boolean,\n) => result.isLoading && result.isFetching && !isRestoring\n\nexport const shouldSuspend = (\n defaultedOptions:\n | DefaultedQueryObserverOptions\n | undefined,\n result: QueryObserverResult,\n) => defaultedOptions?.suspense && result.isPending\n\nexport const fetchOptimistic = <\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey extends QueryKey,\n>(\n defaultedOptions: DefaultedQueryObserverOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n observer: QueryObserver,\n errorResetBoundary: QueryErrorResetBoundaryValue,\n) =>\n observer.fetchOptimistic(defaultedOptions).catch(() => {\n errorResetBoundary.clearReset()\n })\n", "'use client'\nimport * as React from 'react'\n\nimport { isServer, noop, notifyManager } from '@tanstack/query-core'\nimport { useQueryClient } from './QueryClientProvider'\nimport { useQueryErrorResetBoundary } from './QueryErrorResetBoundary'\nimport {\n ensurePreventErrorBoundaryRetry,\n getHasError,\n useClearResetErrorBoundary,\n} from './errorBoundaryUtils'\nimport { useIsRestoring } from './IsRestoringProvider'\nimport {\n ensureSuspenseTimers,\n fetchOptimistic,\n shouldSuspend,\n willFetch,\n} from './suspense'\nimport type {\n QueryClient,\n QueryKey,\n QueryObserver,\n QueryObserverResult,\n} from '@tanstack/query-core'\nimport type { UseBaseQueryOptions } from './types'\n\nexport function useBaseQuery<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey extends QueryKey,\n>(\n options: UseBaseQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryData,\n TQueryKey\n >,\n Observer: typeof QueryObserver,\n queryClient?: QueryClient,\n): QueryObserverResult {\n if (process.env.NODE_ENV !== 'production') {\n if (typeof options !== 'object' || Array.isArray(options)) {\n throw new Error(\n 'Bad argument type. Starting with v5, only the \"Object\" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object',\n )\n }\n }\n\n const isRestoring = useIsRestoring()\n const errorResetBoundary = useQueryErrorResetBoundary()\n const client = useQueryClient(queryClient)\n const defaultedOptions = client.defaultQueryOptions(options)\n ;(client.getDefaultOptions().queries as any)?._experimental_beforeQuery?.(\n defaultedOptions,\n )\n\n const query = client\n .getQueryCache()\n .get<\n TQueryFnData,\n TError,\n TQueryData,\n TQueryKey\n >(defaultedOptions.queryHash)\n\n if (process.env.NODE_ENV !== 'production') {\n if (!defaultedOptions.queryFn) {\n console.error(\n `[${defaultedOptions.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`,\n )\n }\n }\n\n // Make sure results are optimistically set in fetching state before subscribing or updating options\n defaultedOptions._optimisticResults = isRestoring\n ? 'isRestoring'\n : 'optimistic'\n\n ensureSuspenseTimers(defaultedOptions)\n ensurePreventErrorBoundaryRetry(defaultedOptions, errorResetBoundary, query)\n useClearResetErrorBoundary(errorResetBoundary)\n\n // this needs to be invoked before creating the Observer because that can create a cache entry\n const isNewCacheEntry = !client\n .getQueryCache()\n .get(defaultedOptions.queryHash)\n\n const [observer] = React.useState(\n () =>\n new Observer(\n client,\n defaultedOptions,\n ),\n )\n\n // note: this must be called before useSyncExternalStore\n const result = observer.getOptimisticResult(defaultedOptions)\n\n const shouldSubscribe = !isRestoring && options.subscribed !== false\n React.useSyncExternalStore(\n React.useCallback(\n (onStoreChange) => {\n const unsubscribe = shouldSubscribe\n ? observer.subscribe(notifyManager.batchCalls(onStoreChange))\n : noop\n\n // Update result to make sure we did not miss any query updates\n // between creating the observer and subscribing to it.\n observer.updateResult()\n\n return unsubscribe\n },\n [observer, shouldSubscribe],\n ),\n () => observer.getCurrentResult(),\n () => observer.getCurrentResult(),\n )\n\n React.useEffect(() => {\n observer.setOptions(defaultedOptions)\n }, [defaultedOptions, observer])\n\n // Handle suspense\n if (shouldSuspend(defaultedOptions, result)) {\n throw fetchOptimistic(defaultedOptions, observer, errorResetBoundary)\n }\n\n // Handle error boundary\n if (\n getHasError({\n result,\n errorResetBoundary,\n throwOnError: defaultedOptions.throwOnError,\n query,\n suspense: defaultedOptions.suspense,\n })\n ) {\n throw result.error\n }\n\n ;(client.getDefaultOptions().queries as any)?._experimental_afterQuery?.(\n defaultedOptions,\n result,\n )\n\n if (\n defaultedOptions.experimental_prefetchInRender &&\n !isServer &&\n willFetch(result, isRestoring)\n ) {\n const promise = isNewCacheEntry\n ? // Fetch immediately on render in order to ensure `.promise` is resolved even if the component is unmounted\n fetchOptimistic(defaultedOptions, observer, errorResetBoundary)\n : // subscribe to the \"cache promise\" so that we can finalize the currentThenable once data comes in\n query?.promise\n\n promise?.catch(noop).finally(() => {\n // `.updateResult()` will trigger `.#currentThenable` to finalize\n observer.updateResult()\n })\n }\n\n // Handle result property usage tracking\n return !defaultedOptions.notifyOnChangeProps\n ? observer.trackResult(result)\n : result\n}\n", "'use client'\nimport { QueryObserver } from '@tanstack/query-core'\nimport { useBaseQuery } from './useBaseQuery'\nimport type {\n DefaultError,\n NoInfer,\n QueryClient,\n QueryKey,\n} from '@tanstack/query-core'\nimport type {\n DefinedUseQueryResult,\n UseQueryOptions,\n UseQueryResult,\n} from './types'\nimport type {\n DefinedInitialDataOptions,\n UndefinedInitialDataOptions,\n} from './queryOptions'\n\nexport function useQuery<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: DefinedInitialDataOptions,\n queryClient?: QueryClient,\n): DefinedUseQueryResult, TError>\n\nexport function useQuery<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: UndefinedInitialDataOptions,\n queryClient?: QueryClient,\n): UseQueryResult, TError>\n\nexport function useQuery<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: UseQueryOptions,\n queryClient?: QueryClient,\n): UseQueryResult, TError>\n\nexport function useQuery(options: UseQueryOptions, queryClient?: QueryClient) {\n return useBaseQuery(options, QueryObserver, queryClient)\n}\n", "'use client'\nimport { QueryObserver, skipToken } from '@tanstack/query-core'\nimport { useBaseQuery } from './useBaseQuery'\nimport { defaultThrowOnError } from './suspense'\nimport type { UseSuspenseQueryOptions, UseSuspenseQueryResult } from './types'\nimport type { DefaultError, QueryClient, QueryKey } from '@tanstack/query-core'\n\nexport function useSuspenseQuery<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: UseSuspenseQueryOptions,\n queryClient?: QueryClient,\n): UseSuspenseQueryResult {\n if (process.env.NODE_ENV !== 'production') {\n if ((options.queryFn as any) === skipToken) {\n console.error('skipToken is not allowed for useSuspenseQuery')\n }\n }\n\n return useBaseQuery(\n {\n ...options,\n enabled: true,\n suspense: true,\n throwOnError: defaultThrowOnError,\n placeholderData: undefined,\n },\n QueryObserver,\n queryClient,\n ) as UseSuspenseQueryResult\n}\n", "'use client'\nimport { InfiniteQueryObserver, skipToken } from '@tanstack/query-core'\nimport { useBaseQuery } from './useBaseQuery'\nimport { defaultThrowOnError } from './suspense'\nimport type {\n DefaultError,\n InfiniteData,\n InfiniteQueryObserverSuccessResult,\n QueryClient,\n QueryKey,\n QueryObserver,\n} from '@tanstack/query-core'\nimport type {\n UseSuspenseInfiniteQueryOptions,\n UseSuspenseInfiniteQueryResult,\n} from './types'\n\nexport function useSuspenseInfiniteQuery<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: UseSuspenseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n queryClient?: QueryClient,\n): UseSuspenseInfiniteQueryResult {\n if (process.env.NODE_ENV !== 'production') {\n if ((options.queryFn as any) === skipToken) {\n console.error('skipToken is not allowed for useSuspenseInfiniteQuery')\n }\n }\n\n return useBaseQuery(\n {\n ...options,\n enabled: true,\n suspense: true,\n throwOnError: defaultThrowOnError,\n },\n InfiniteQueryObserver as typeof QueryObserver,\n queryClient,\n ) as InfiniteQueryObserverSuccessResult\n}\n", "'use client'\nimport { skipToken } from '@tanstack/query-core'\nimport { useQueries } from './useQueries'\nimport { defaultThrowOnError } from './suspense'\nimport type { UseSuspenseQueryOptions, UseSuspenseQueryResult } from './types'\nimport type {\n DefaultError,\n QueryClient,\n QueryFunction,\n ThrowOnError,\n} from '@tanstack/query-core'\n\n// Avoid TS depth-limit error in case of large array literal\ntype MAXIMUM_DEPTH = 20\n\n// Widen the type of the symbol to enable type inference even if skipToken is not immutable.\ntype SkipTokenForUseQueries = symbol\n\ntype GetUseSuspenseQueryOptions =\n // Part 1: responsible for applying explicit type parameter to function arguments, if object { queryFnData: TQueryFnData, error: TError, data: TData }\n T extends {\n queryFnData: infer TQueryFnData\n error?: infer TError\n data: infer TData\n }\n ? UseSuspenseQueryOptions\n : T extends { queryFnData: infer TQueryFnData; error?: infer TError }\n ? UseSuspenseQueryOptions\n : T extends { data: infer TData; error?: infer TError }\n ? UseSuspenseQueryOptions\n : // Part 2: responsible for applying explicit type parameter to function arguments, if tuple [TQueryFnData, TError, TData]\n T extends [infer TQueryFnData, infer TError, infer TData]\n ? UseSuspenseQueryOptions\n : T extends [infer TQueryFnData, infer TError]\n ? UseSuspenseQueryOptions\n : T extends [infer TQueryFnData]\n ? UseSuspenseQueryOptions\n : // Part 3: responsible for inferring and enforcing type if no explicit parameter was provided\n T extends {\n queryFn?:\n | QueryFunction\n | SkipTokenForUseQueries\n select?: (data: any) => infer TData\n throwOnError?: ThrowOnError\n }\n ? UseSuspenseQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey\n >\n : T extends {\n queryFn?:\n | QueryFunction\n | SkipTokenForUseQueries\n throwOnError?: ThrowOnError\n }\n ? UseSuspenseQueryOptions<\n TQueryFnData,\n TError,\n TQueryFnData,\n TQueryKey\n >\n : // Fallback\n UseSuspenseQueryOptions\n\ntype GetUseSuspenseQueryResult =\n // Part 1: responsible for mapping explicit type parameter to function result, if object\n T extends { queryFnData: any; error?: infer TError; data: infer TData }\n ? UseSuspenseQueryResult\n : T extends { queryFnData: infer TQueryFnData; error?: infer TError }\n ? UseSuspenseQueryResult\n : T extends { data: infer TData; error?: infer TError }\n ? UseSuspenseQueryResult\n : // Part 2: responsible for mapping explicit type parameter to function result, if tuple\n T extends [any, infer TError, infer TData]\n ? UseSuspenseQueryResult\n : T extends [infer TQueryFnData, infer TError]\n ? UseSuspenseQueryResult\n : T extends [infer TQueryFnData]\n ? UseSuspenseQueryResult\n : // Part 3: responsible for mapping inferred type to results, if no explicit parameter was provided\n T extends {\n queryFn?:\n | QueryFunction\n | SkipTokenForUseQueries\n select?: (data: any) => infer TData\n throwOnError?: ThrowOnError\n }\n ? UseSuspenseQueryResult<\n unknown extends TData ? TQueryFnData : TData,\n unknown extends TError ? DefaultError : TError\n >\n : T extends {\n queryFn?:\n | QueryFunction\n | SkipTokenForUseQueries\n throwOnError?: ThrowOnError\n }\n ? UseSuspenseQueryResult<\n TQueryFnData,\n unknown extends TError ? DefaultError : TError\n >\n : // Fallback\n UseSuspenseQueryResult\n\n/**\n * SuspenseQueriesOptions reducer recursively unwraps function arguments to infer/enforce type param\n */\nexport type SuspenseQueriesOptions<\n T extends Array,\n TResults extends Array = [],\n TDepth extends ReadonlyArray = [],\n> = TDepth['length'] extends MAXIMUM_DEPTH\n ? Array\n : T extends []\n ? []\n : T extends [infer Head]\n ? [...TResults, GetUseSuspenseQueryOptions]\n : T extends [infer Head, ...infer Tails]\n ? SuspenseQueriesOptions<\n [...Tails],\n [...TResults, GetUseSuspenseQueryOptions],\n [...TDepth, 1]\n >\n : Array extends T\n ? T\n : // If T is *some* array but we couldn't assign unknown[] to it, then it must hold some known/homogenous type!\n // use this to infer the param types in the case of Array.map() argument\n T extends Array<\n UseSuspenseQueryOptions<\n infer TQueryFnData,\n infer TError,\n infer TData,\n infer TQueryKey\n >\n >\n ? Array<\n UseSuspenseQueryOptions\n >\n : // Fallback\n Array\n\n/**\n * SuspenseQueriesResults reducer recursively maps type param to results\n */\nexport type SuspenseQueriesResults<\n T extends Array,\n TResults extends Array = [],\n TDepth extends ReadonlyArray = [],\n> = TDepth['length'] extends MAXIMUM_DEPTH\n ? Array\n : T extends []\n ? []\n : T extends [infer Head]\n ? [...TResults, GetUseSuspenseQueryResult]\n : T extends [infer Head, ...infer Tails]\n ? SuspenseQueriesResults<\n [...Tails],\n [...TResults, GetUseSuspenseQueryResult],\n [...TDepth, 1]\n >\n : { [K in keyof T]: GetUseSuspenseQueryResult }\n\nexport function useSuspenseQueries<\n T extends Array,\n TCombinedResult = SuspenseQueriesResults,\n>(\n options: {\n queries:\n | readonly [...SuspenseQueriesOptions]\n | readonly [...{ [K in keyof T]: GetUseSuspenseQueryOptions }]\n combine?: (result: SuspenseQueriesResults) => TCombinedResult\n },\n queryClient?: QueryClient,\n): TCombinedResult\n\nexport function useSuspenseQueries<\n T extends Array,\n TCombinedResult = SuspenseQueriesResults,\n>(\n options: {\n queries: readonly [...SuspenseQueriesOptions]\n combine?: (result: SuspenseQueriesResults) => TCombinedResult\n },\n queryClient?: QueryClient,\n): TCombinedResult\n\nexport function useSuspenseQueries(options: any, queryClient?: QueryClient) {\n return useQueries(\n {\n ...options,\n queries: options.queries.map((query: any) => {\n if (process.env.NODE_ENV !== 'production') {\n if (query.queryFn === skipToken) {\n console.error('skipToken is not allowed for useSuspenseQueries')\n }\n }\n\n return {\n ...query,\n suspense: true,\n throwOnError: defaultThrowOnError,\n enabled: true,\n placeholderData: undefined,\n }\n }),\n },\n queryClient,\n )\n}\n", "import { useQueryClient } from './QueryClientProvider'\nimport type { DefaultError, QueryClient, QueryKey } from '@tanstack/query-core'\nimport type { UsePrefetchQueryOptions } from './types'\n\nexport function usePrefetchQuery<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: UsePrefetchQueryOptions,\n queryClient?: QueryClient,\n) {\n const client = useQueryClient(queryClient)\n\n if (!client.getQueryState(options.queryKey)) {\n client.prefetchQuery(options)\n }\n}\n", "import { useQueryClient } from './QueryClientProvider'\nimport type {\n DefaultError,\n FetchInfiniteQueryOptions,\n QueryClient,\n QueryKey,\n} from '@tanstack/query-core'\n\nexport function usePrefetchInfiniteQuery<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: FetchInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n queryClient?: QueryClient,\n) {\n const client = useQueryClient(queryClient)\n\n if (!client.getQueryState(options.queryKey)) {\n client.prefetchInfiniteQuery(options)\n }\n}\n", "import type {\n DataTag,\n DefaultError,\n InitialDataFunction,\n NonUndefinedGuard,\n OmitKeyof,\n QueryFunction,\n QueryKey,\n SkipToken,\n} from '@tanstack/query-core'\nimport type { UseQueryOptions } from './types'\n\nexport type UndefinedInitialDataOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> = UseQueryOptions & {\n initialData?:\n | undefined\n | InitialDataFunction>\n | NonUndefinedGuard\n}\n\nexport type UnusedSkipTokenOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> = OmitKeyof<\n UseQueryOptions,\n 'queryFn'\n> & {\n queryFn?: Exclude<\n UseQueryOptions['queryFn'],\n SkipToken | undefined\n >\n}\n\nexport type DefinedInitialDataOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n> = Omit, 'queryFn'> & {\n initialData:\n | NonUndefinedGuard\n | (() => NonUndefinedGuard)\n queryFn?: QueryFunction\n}\n\nexport function queryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: DefinedInitialDataOptions,\n): DefinedInitialDataOptions & {\n queryKey: DataTag\n}\n\nexport function queryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: UnusedSkipTokenOptions,\n): UnusedSkipTokenOptions & {\n queryKey: DataTag\n}\n\nexport function queryOptions<\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n TQueryKey extends QueryKey = QueryKey,\n>(\n options: UndefinedInitialDataOptions,\n): UndefinedInitialDataOptions & {\n queryKey: DataTag\n}\n\nexport function queryOptions(options: unknown) {\n return options\n}\n", "import type {\n DataTag,\n DefaultError,\n InfiniteData,\n InitialDataFunction,\n NonUndefinedGuard,\n OmitKeyof,\n QueryKey,\n SkipToken,\n} from '@tanstack/query-core'\nimport type { UseInfiniteQueryOptions } from './types'\n\nexport type UndefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> = UseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n> & {\n initialData?:\n | undefined\n | NonUndefinedGuard>\n | InitialDataFunction<\n NonUndefinedGuard>\n >\n}\n\nexport type UnusedSkipTokenInfiniteOptions<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> = OmitKeyof<\n UseInfiniteQueryOptions,\n 'queryFn'\n> & {\n queryFn?: Exclude<\n UseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >['queryFn'],\n SkipToken | undefined\n >\n}\n\nexport type DefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n> = UseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n> & {\n initialData:\n | NonUndefinedGuard>\n | (() => NonUndefinedGuard>)\n | undefined\n}\n\nexport function infiniteQueryOptions<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: DefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n): DefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n> & {\n queryKey: DataTag, TError>\n}\n\nexport function infiniteQueryOptions<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: UnusedSkipTokenInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n): UnusedSkipTokenInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n> & {\n queryKey: DataTag, TError>\n}\n\nexport function infiniteQueryOptions<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: UndefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n): UndefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n> & {\n queryKey: DataTag, TError>\n}\n\nexport function infiniteQueryOptions(options: unknown) {\n return options\n}\n", "'use client'\nimport * as React from 'react'\n\nimport { hydrate } from '@tanstack/query-core'\nimport { useQueryClient } from './QueryClientProvider'\nimport type {\n DehydratedState,\n HydrateOptions,\n OmitKeyof,\n QueryClient,\n} from '@tanstack/query-core'\n\nexport interface HydrationBoundaryProps {\n state: DehydratedState | null | undefined\n options?: OmitKeyof & {\n defaultOptions?: OmitKeyof<\n Exclude,\n 'mutations'\n >\n }\n children?: React.ReactNode\n queryClient?: QueryClient\n}\n\nexport const HydrationBoundary = ({\n children,\n options = {},\n state,\n queryClient,\n}: HydrationBoundaryProps) => {\n const client = useQueryClient(queryClient)\n\n const optionsRef = React.useRef(options)\n React.useEffect(() => {\n optionsRef.current = options\n })\n\n // This useMemo is for performance reasons only, everything inside it must\n // be safe to run in every render and code here should be read as \"in render\".\n //\n // This code needs to happen during the render phase, because after initial\n // SSR, hydration needs to happen _before_ children render. Also, if hydrating\n // during a transition, we want to hydrate as much as is safe in render so\n // we can prerender as much as possible.\n //\n // For any queries that already exist in the cache, we want to hold back on\n // hydrating until _after_ the render phase. The reason for this is that during\n // transitions, we don't want the existing queries and observers to update to\n // the new data on the current page, only _after_ the transition is committed.\n // If the transition is aborted, we will have hydrated any _new_ queries, but\n // we throw away the fresh data for any existing ones to avoid unexpectedly\n // updating the UI.\n const hydrationQueue: DehydratedState['queries'] | undefined =\n React.useMemo(() => {\n if (state) {\n if (typeof state !== 'object') {\n return\n }\n\n const queryCache = client.getQueryCache()\n // State is supplied from the outside and we might as well fail\n // gracefully if it has the wrong shape, so while we type `queries`\n // as required, we still provide a fallback.\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n const queries = state.queries || []\n\n const newQueries: DehydratedState['queries'] = []\n const existingQueries: DehydratedState['queries'] = []\n for (const dehydratedQuery of queries) {\n const existingQuery = queryCache.get(dehydratedQuery.queryHash)\n\n if (!existingQuery) {\n newQueries.push(dehydratedQuery)\n } else {\n const hydrationIsNewer =\n dehydratedQuery.state.dataUpdatedAt >\n existingQuery.state.dataUpdatedAt ||\n (dehydratedQuery.promise &&\n existingQuery.state.status !== 'pending' &&\n existingQuery.state.fetchStatus !== 'fetching' &&\n dehydratedQuery.dehydratedAt !== undefined &&\n dehydratedQuery.dehydratedAt >\n existingQuery.state.dataUpdatedAt)\n\n if (hydrationIsNewer) {\n existingQueries.push(dehydratedQuery)\n }\n }\n }\n\n if (newQueries.length > 0) {\n // It's actually fine to call this with queries/state that already exists\n // in the cache, or is older. hydrate() is idempotent for queries.\n // eslint-disable-next-line react-hooks/refs\n hydrate(client, { queries: newQueries }, optionsRef.current)\n }\n if (existingQueries.length > 0) {\n return existingQueries\n }\n }\n return undefined\n }, [client, state])\n\n React.useEffect(() => {\n if (hydrationQueue) {\n hydrate(client, { queries: hydrationQueue }, optionsRef.current)\n }\n }, [client, hydrationQueue])\n\n return children as React.ReactElement\n}\n", "'use client'\nimport * as React from 'react'\nimport { notifyManager } from '@tanstack/query-core'\n\nimport { useQueryClient } from './QueryClientProvider'\nimport type { QueryClient, QueryFilters } from '@tanstack/query-core'\n\nexport function useIsFetching(\n filters?: QueryFilters,\n queryClient?: QueryClient,\n): number {\n const client = useQueryClient(queryClient)\n const queryCache = client.getQueryCache()\n\n return React.useSyncExternalStore(\n React.useCallback(\n (onStoreChange) =>\n queryCache.subscribe(notifyManager.batchCalls(onStoreChange)),\n [queryCache],\n ),\n () => client.isFetching(filters),\n () => client.isFetching(filters),\n )\n}\n", "'use client'\nimport * as React from 'react'\n\nimport { notifyManager, replaceEqualDeep } from '@tanstack/query-core'\nimport { useQueryClient } from './QueryClientProvider'\nimport type {\n Mutation,\n MutationCache,\n MutationFilters,\n MutationState,\n QueryClient,\n} from '@tanstack/query-core'\n\nexport function useIsMutating(\n filters?: MutationFilters,\n queryClient?: QueryClient,\n): number {\n const client = useQueryClient(queryClient)\n return useMutationState(\n { filters: { ...filters, status: 'pending' } },\n client,\n ).length\n}\n\ntype MutationStateOptions = {\n filters?: MutationFilters\n select?: (mutation: Mutation) => TResult\n}\n\nfunction getResult(\n mutationCache: MutationCache,\n options: MutationStateOptions,\n): Array {\n return mutationCache\n .findAll(options.filters)\n .map(\n (mutation): TResult =>\n (options.select ? options.select(mutation) : mutation.state) as TResult,\n )\n}\n\nexport function useMutationState(\n options: MutationStateOptions = {},\n queryClient?: QueryClient,\n): Array {\n const mutationCache = useQueryClient(queryClient).getMutationCache()\n const optionsRef = React.useRef(options)\n const result = React.useRef>(null)\n if (result.current === null) {\n result.current = getResult(mutationCache, options)\n }\n\n React.useEffect(() => {\n optionsRef.current = options\n })\n\n return React.useSyncExternalStore(\n React.useCallback(\n (onStoreChange) =>\n mutationCache.subscribe(() => {\n const nextResult = replaceEqualDeep(\n result.current,\n getResult(mutationCache, optionsRef.current),\n )\n if (result.current !== nextResult) {\n result.current = nextResult\n notifyManager.schedule(onStoreChange)\n }\n }),\n [mutationCache],\n ),\n () => result.current,\n () => result.current,\n )!\n}\n", "'use client'\nimport * as React from 'react'\nimport {\n MutationObserver,\n noop,\n notifyManager,\n shouldThrowError,\n} from '@tanstack/query-core'\nimport { useQueryClient } from './QueryClientProvider'\nimport type {\n UseMutateFunction,\n UseMutationOptions,\n UseMutationResult,\n} from './types'\nimport type { DefaultError, QueryClient } from '@tanstack/query-core'\n\n// HOOK\n\nexport function useMutation<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n>(\n options: UseMutationOptions,\n queryClient?: QueryClient,\n): UseMutationResult {\n const client = useQueryClient(queryClient)\n\n const [observer] = React.useState(\n () =>\n new MutationObserver(\n client,\n options,\n ),\n )\n\n React.useEffect(() => {\n observer.setOptions(options)\n }, [observer, options])\n\n const result = React.useSyncExternalStore(\n React.useCallback(\n (onStoreChange) =>\n observer.subscribe(notifyManager.batchCalls(onStoreChange)),\n [observer],\n ),\n () => observer.getCurrentResult(),\n () => observer.getCurrentResult(),\n )\n\n const mutate = React.useCallback<\n UseMutateFunction\n >(\n (variables, mutateOptions) => {\n observer.mutate(variables, mutateOptions).catch(noop)\n },\n [observer],\n )\n\n if (\n result.error &&\n shouldThrowError(observer.options.throwOnError, [result.error])\n ) {\n throw result.error\n }\n\n return { ...result, mutate, mutateAsync: result.mutate }\n}\n", "import type { DefaultError, WithRequired } from '@tanstack/query-core'\nimport type { UseMutationOptions } from './types'\n\nexport function mutationOptions<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n>(\n options: WithRequired<\n UseMutationOptions,\n 'mutationKey'\n >,\n): WithRequired<\n UseMutationOptions,\n 'mutationKey'\n>\nexport function mutationOptions<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n>(\n options: Omit<\n UseMutationOptions,\n 'mutationKey'\n >,\n): Omit<\n UseMutationOptions,\n 'mutationKey'\n>\nexport function mutationOptions<\n TData = unknown,\n TError = DefaultError,\n TVariables = void,\n TOnMutateResult = unknown,\n>(\n options: UseMutationOptions,\n): UseMutationOptions {\n return options\n}\n", "'use client'\nimport { InfiniteQueryObserver } from '@tanstack/query-core'\nimport { useBaseQuery } from './useBaseQuery'\nimport type {\n DefaultError,\n InfiniteData,\n QueryClient,\n QueryKey,\n QueryObserver,\n} from '@tanstack/query-core'\nimport type {\n DefinedUseInfiniteQueryResult,\n UseInfiniteQueryOptions,\n UseInfiniteQueryResult,\n} from './types'\nimport type {\n DefinedInitialDataInfiniteOptions,\n UndefinedInitialDataInfiniteOptions,\n} from './infiniteQueryOptions'\n\nexport function useInfiniteQuery<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: DefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n queryClient?: QueryClient,\n): DefinedUseInfiniteQueryResult\n\nexport function useInfiniteQuery<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: UndefinedInitialDataInfiniteOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n queryClient?: QueryClient,\n): UseInfiniteQueryResult\n\nexport function useInfiniteQuery<\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData,\n TQueryKey extends QueryKey = QueryKey,\n TPageParam = unknown,\n>(\n options: UseInfiniteQueryOptions<\n TQueryFnData,\n TError,\n TData,\n TQueryKey,\n TPageParam\n >,\n queryClient?: QueryClient,\n): UseInfiniteQueryResult\n\nexport function useInfiniteQuery(\n options: UseInfiniteQueryOptions,\n queryClient?: QueryClient,\n) {\n return useBaseQuery(\n options,\n InfiniteQueryObserver as typeof QueryObserver,\n queryClient,\n )\n}\n"], - "mappings": ";;;;;;;;;;;AAAO,IAAM,eAAN,MAA+C;EAGpD,cAAc;AAFd,SAAU,YAAY,oBAAI,IAAe;AAGvC,SAAK,YAAY,KAAK,UAAU,KAAK,IAAI;EAC3C;EAEA,UAAU,UAAiC;AACzC,SAAK,UAAU,IAAI,QAAQ;AAE3B,SAAK,YAAY;AAEjB,WAAO,MAAM;AACX,WAAK,UAAU,OAAO,QAAQ;AAC9B,WAAK,cAAc;IACrB;EACF;EAEA,eAAwB;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,WAAW;AAEzC,QAAM,CAAC,QAAQ,IAAU;IACvB,MACE,IAAI;MACF;MACA;IACF;EACJ;AAEM,EAAA,kBAAU,MAAM;AACpB,aAAS,WAAW,OAAO;EAC7B,GAAG,CAAC,UAAU,OAAO,CAAC;AAEtB,QAAM,SAAe;IACb;MACJ,CAAC,kBACC,SAAS,UAAU,cAAc,WAAW,aAAa,CAAC;MAC5D,CAAC,QAAQ;IACX;IACA,MAAM,SAAS,iBAAiB;IAChC,MAAM,SAAS,iBAAiB;EAClC;AAEA,QAAM,SAAe;IAGnB,CAAC,WAAW,kBAAkB;AAC5B,eAAS,OAAO,WAAW,aAAa,EAAE,MAAM,IAAI;IACtD;IACA,CAAC,QAAQ;EACX;AAEA,MACE,OAAO,SACP,iBAAiB,SAAS,QAAQ,cAAc,CAAC,OAAO,KAAK,CAAC,GAC9D;AACA,UAAM,OAAO;EACf;AAEA,SAAO,EAAE,GAAG,QAAQ,QAAQ,aAAa,OAAO,OAAO;AACzD;;;ACrCO,SAAS,gBAMd,SACgE;AAChE,SAAO;AACT;;;AC+BO,SAAS,iBACd,SACA,aACA;AACA,SAAO;IACL;IACA;IACA;EACF;AACF;", - "names": ["mutationOptions", "queryFnContext", "context", "queryFnContext", "getDefaultState", "getDefaultState", "React", "React", "React", "import_jsx_runtime", "React", "queryOptions", "React", "React", "React", "React", "React"] -} diff --git a/features/landing/frontend-standalone/.vite-cache/deps/chunk-JP2PIA6Z.js b/features/landing/frontend-standalone/.vite-cache/deps/chunk-JP2PIA6Z.js deleted file mode 100644 index 58c28f934..000000000 --- a/features/landing/frontend-standalone/.vite-cache/deps/chunk-JP2PIA6Z.js +++ /dev/null @@ -1,12537 +0,0 @@ -// ../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/version.mjs -var version = "16.12.0"; -var versionInfo = Object.freeze({ - major: 16, - minor: 12, - patch: 0, - preReleaseTag: null -}); - -// ../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/jsutils/devAssert.mjs -function devAssert(condition, message) { - const booleanCondition = Boolean(condition); - if (!booleanCondition) { - throw new Error(message); - } -} - -// ../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/jsutils/isPromise.mjs -function isPromise(value) { - return typeof (value === null || value === void 0 ? void 0 : value.then) === "function"; -} - -// ../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/jsutils/isObjectLike.mjs -function isObjectLike(value) { - return typeof value == "object" && value !== null; -} - -// ../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/jsutils/invariant.mjs -function invariant(condition, message) { - const booleanCondition = Boolean(condition); - if (!booleanCondition) { - throw new Error( - message != null ? message : "Unexpected invariant triggered." - ); - } -} - -// ../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/language/location.mjs -var LineRegExp = /\r\n|[\n\r]/g; -function getLocation(source, position) { - let lastLineStart = 0; - let line = 1; - for (const match of source.body.matchAll(LineRegExp)) { - typeof match.index === "number" || invariant(false); - if (match.index >= position) { - break; - } - lastLineStart = match.index + match[0].length; - line += 1; - } - return { - line, - column: position + 1 - lastLineStart - }; -} - -// ../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/language/printLocation.mjs -function printLocation(location) { - return printSourceLocation( - location.source, - getLocation(location.source, location.start) - ); -} -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([ - // 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 !== void 0); - const padLen = Math.max(...existingLines.map(([prefix]) => prefix.length)); - return existingLines.map(([prefix, line]) => prefix.padStart(padLen) + (line ? " " + line : "")).join("\n"); -} - -// ../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/error/GraphQLError.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; -} -var GraphQLError = 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 : 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 = (_ref = extensions !== null && extensions !== void 0 ? extensions : originalExtensions) !== null && _ref !== void 0 ? _ref : /* @__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; - } -}; -function undefinedIfEmpty(array) { - return array === void 0 || array.length === 0 ? void 0 : array; -} -function printError(error) { - return error.toString(); -} -function formatError(error) { - return error.toJSON(); -} - -// ../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/error/syntaxError.mjs -function syntaxError(source, position, description) { - return new GraphQLError(`Syntax Error: ${description}`, { - source, - positions: [position] - }); -} - -// ../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/language/ast.mjs -var Location = class { - /** - * 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 - }; - } -}; -var Token = class { - /** - * 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; - 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 - }; - } -}; -var QueryDocumentKeys = { - Name: [], - Document: ["definitions"], - OperationDefinition: [ - "description", - "name", - "variableDefinitions", - "directives", - "selectionSet" - ], - VariableDefinition: [ - "description", - "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: [ - "description", - "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"], - TypeCoordinate: ["name"], - MemberCoordinate: ["name", "memberName"], - ArgumentCoordinate: ["name", "fieldName", "argumentName"], - DirectiveCoordinate: ["name"], - DirectiveArgumentCoordinate: ["name", "argumentName"] -}; -var 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); -} -var OperationTypeNode; -(function(OperationTypeNode2) { - OperationTypeNode2["QUERY"] = "query"; - OperationTypeNode2["MUTATION"] = "mutation"; - OperationTypeNode2["SUBSCRIPTION"] = "subscription"; -})(OperationTypeNode || (OperationTypeNode = {})); - -// ../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/language/directiveLocation.mjs -var 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 = {})); - -// ../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/language/kinds.mjs -var 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"; - Kind2["TYPE_COORDINATE"] = "TypeCoordinate"; - Kind2["MEMBER_COORDINATE"] = "MemberCoordinate"; - Kind2["ARGUMENT_COORDINATE"] = "ArgumentCoordinate"; - Kind2["DIRECTIVE_COORDINATE"] = "DirectiveCoordinate"; - Kind2["DIRECTIVE_ARGUMENT_COORDINATE"] = "DirectiveArgumentCoordinate"; -})(Kind || (Kind = {})); - -// ../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/language/characterClasses.mjs -function isWhiteSpace(code) { - return code === 9 || code === 32; -} -function isDigit(code) { - return code >= 48 && code <= 57; -} -function isLetter(code) { - return code >= 97 && code <= 122 || // A-Z - code >= 65 && code <= 90; -} -function isNameStart(code) { - return isLetter(code) || code === 95; -} -function isNameContinue(code) { - return isLetter(code) || isDigit(code) || code === 95; -} - -// ../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/language/blockString.mjs -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 indent2 = leadingWhitespace(line); - if (indent2 === line.length) { - continue; - } - firstNonEmptyLine = (_firstNonEmptyLine = firstNonEmptyLine) !== null && _firstNonEmptyLine !== void 0 ? _firstNonEmptyLine : i; - lastNonEmptyLine = i; - if (i !== 0 && indent2 < commonIndent) { - commonIndent = indent2; - } - } - return lines.map((line, i) => i === 0 ? line : line.slice(commonIndent)).slice( - (_firstNonEmptyLine2 = firstNonEmptyLine) !== null && _firstNonEmptyLine2 !== void 0 ? _firstNonEmptyLine2 : 0, - lastNonEmptyLine + 1 - ); -} -function leadingWhitespace(str) { - let i = 0; - while (i < str.length && isWhiteSpace(str.charCodeAt(i))) { - ++i; - } - return i; -} -function isPrintableAsBlockString(value) { - if (value === "") { - return true; - } - 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 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 11: - case 12: - case 14: - case 15: - return false; - // Has non-printable characters - case 13: - return false; - // Has \r or \r\n which will be replaced as \n - case 10: - if (isEmptyLine && !seenNonEmptyLine) { - return false; - } - 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; - } - if (hasCommonIndent && seenNonEmptyLine) { - return false; - } - return true; -} -function printBlockString(value, options) { - const escapedValue = value.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(line.charCodeAt(0))); - const hasTrailingTripleQuotes = escapedValue.endsWith('\\"""'); - 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 = ""; - const skipLeadingNewLine = isSingleLine && isWhiteSpace(value.charCodeAt(0)); - if (printAsMultipleLines && !skipLeadingNewLine || forceLeadingNewLine) { - result += "\n"; - } - result += escapedValue; - if (printAsMultipleLines || forceTrailingNewline) { - result += "\n"; - } - return '"""' + result + '"""'; -} - -// ../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/language/tokenKind.mjs -var TokenKind; -(function(TokenKind2) { - TokenKind2["SOF"] = ""; - TokenKind2["EOF"] = ""; - TokenKind2["BANG"] = "!"; - TokenKind2["DOLLAR"] = "$"; - TokenKind2["AMP"] = "&"; - TokenKind2["PAREN_L"] = "("; - TokenKind2["PAREN_R"] = ")"; - TokenKind2["DOT"] = "."; - TokenKind2["SPREAD"] = "..."; - TokenKind2["COLON"] = ":"; - TokenKind2["EQUALS"] = "="; - TokenKind2["AT"] = "@"; - TokenKind2["BRACKET_L"] = "["; - TokenKind2["BRACKET_R"] = "]"; - TokenKind2["BRACE_L"] = "{"; - TokenKind2["PIPE"] = "|"; - TokenKind2["BRACE_R"] = "}"; - TokenKind2["NAME"] = "Name"; - TokenKind2["INT"] = "Int"; - TokenKind2["FLOAT"] = "Float"; - TokenKind2["STRING"] = "String"; - TokenKind2["BLOCK_STRING"] = "BlockString"; - TokenKind2["COMMENT"] = "Comment"; -})(TokenKind || (TokenKind = {})); - -// ../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/language/lexer.mjs -var Lexer = class { - /** - * 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 Token(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.EOF) { - do { - if (token.next) { - token = token.next; - } else { - const nextToken = readNextToken(this, token.end); - token.next = nextToken; - nextToken.prev = token; - token = nextToken; - } - } while (token.kind === TokenKind.COMMENT); - } - return token; - } -}; -function isPunctuatorTokenKind(kind) { - return kind === TokenKind.BANG || kind === TokenKind.DOLLAR || kind === TokenKind.AMP || kind === TokenKind.PAREN_L || kind === TokenKind.PAREN_R || kind === TokenKind.DOT || 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; -} -function isUnicodeScalarValue(code) { - return code >= 0 && code <= 55295 || code >= 57344 && code <= 1114111; -} -function isSupplementaryCodePoint(body, location) { - return isLeadingSurrogate(body.charCodeAt(location)) && isTrailingSurrogate(body.charCodeAt(location + 1)); -} -function isLeadingSurrogate(code) { - return code >= 55296 && code <= 56319; -} -function isTrailingSurrogate(code) { - return code >= 56320 && code <= 57343; -} -function printCodePointAt(lexer, location) { - const code = lexer.source.body.codePointAt(location); - if (code === void 0) { - return TokenKind.EOF; - } else if (code >= 32 && code <= 126) { - const char = String.fromCodePoint(code); - return char === '"' ? `'"'` : `"${char}"`; - } - return "U+" + code.toString(16).toUpperCase().padStart(4, "0"); -} -function createToken(lexer, kind, start, end, value) { - const line = lexer.line; - const col = 1 + start - lexer.lineStart; - return new Token(kind, start, end, line, col, value); -} -function readNextToken(lexer, start) { - const body = lexer.source.body; - const bodyLength = body.length; - let position = start; - while (position < bodyLength) { - const code = body.charCodeAt(position); - switch (code) { - // Ignored :: - // - UnicodeBOM - // - WhiteSpace - // - LineTerminator - // - Comment - // - Comma - // - // UnicodeBOM :: "Byte Order Mark (U+FEFF)" - // - // WhiteSpace :: - // - "Horizontal Tab (U+0009)" - // - "Space (U+0020)" - // - // Comma :: , - case 65279: - // - case 9: - // \t - case 32: - // - case 44: - ++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 10: - ++position; - ++lexer.line; - lexer.lineStart = position; - continue; - case 13: - if (body.charCodeAt(position + 1) === 10) { - position += 2; - } else { - ++position; - } - ++lexer.line; - lexer.lineStart = position; - continue; - // Comment - case 35: - return readComment(lexer, position); - // Token :: - // - Punctuator - // - Name - // - IntValue - // - FloatValue - // - StringValue - // - // Punctuator :: one of ! $ & ( ) ... : = @ [ ] { | } - case 33: - return createToken(lexer, TokenKind.BANG, position, position + 1); - case 36: - return createToken(lexer, TokenKind.DOLLAR, position, position + 1); - case 38: - return createToken(lexer, TokenKind.AMP, position, position + 1); - case 40: - return createToken(lexer, TokenKind.PAREN_L, position, position + 1); - case 41: - return createToken(lexer, TokenKind.PAREN_R, position, position + 1); - case 46: - if (body.charCodeAt(position + 1) === 46 && body.charCodeAt(position + 2) === 46) { - return createToken(lexer, TokenKind.SPREAD, position, position + 3); - } - break; - case 58: - return createToken(lexer, TokenKind.COLON, position, position + 1); - case 61: - return createToken(lexer, TokenKind.EQUALS, position, position + 1); - case 64: - return createToken(lexer, TokenKind.AT, position, position + 1); - case 91: - return createToken(lexer, TokenKind.BRACKET_L, position, position + 1); - case 93: - return createToken(lexer, TokenKind.BRACKET_R, position, position + 1); - case 123: - return createToken(lexer, TokenKind.BRACE_L, position, position + 1); - case 124: - return createToken(lexer, TokenKind.PIPE, position, position + 1); - case 125: - return createToken(lexer, TokenKind.BRACE_R, position, position + 1); - // StringValue - case 34: - if (body.charCodeAt(position + 1) === 34 && body.charCodeAt(position + 2) === 34) { - return readBlockString(lexer, position); - } - return readString(lexer, position); - } - if (isDigit(code) || code === 45) { - return readNumber(lexer, position, code); - } - if (isNameStart(code)) { - return readName(lexer, position); - } - throw syntaxError( - lexer.source, - position, - code === 39 ? `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.EOF, bodyLength, bodyLength); -} -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); - if (code === 10 || code === 13) { - break; - } - if (isUnicodeScalarValue(code)) { - ++position; - } else if (isSupplementaryCodePoint(body, position)) { - position += 2; - } else { - break; - } - } - return createToken( - lexer, - TokenKind.COMMENT, - start, - position, - body.slice(start + 1, position) - ); -} -function readNumber(lexer, start, firstCode) { - const body = lexer.source.body; - let position = start; - let code = firstCode; - let isFloat = false; - if (code === 45) { - code = body.charCodeAt(++position); - } - if (code === 48) { - code = body.charCodeAt(++position); - if (isDigit(code)) { - throw syntaxError( - lexer.source, - position, - `Invalid number, unexpected digit after 0: ${printCodePointAt( - lexer, - position - )}.` - ); - } - } else { - position = readDigits(lexer, position, code); - code = body.charCodeAt(position); - } - if (code === 46) { - isFloat = true; - code = body.charCodeAt(++position); - position = readDigits(lexer, position, code); - code = body.charCodeAt(position); - } - if (code === 69 || code === 101) { - isFloat = true; - code = body.charCodeAt(++position); - if (code === 43 || code === 45) { - code = body.charCodeAt(++position); - } - position = readDigits(lexer, position, code); - code = body.charCodeAt(position); - } - if (code === 46 || isNameStart(code)) { - throw syntaxError( - lexer.source, - position, - `Invalid number, expected digit but got: ${printCodePointAt( - lexer, - position - )}.` - ); - } - return createToken( - lexer, - isFloat ? TokenKind.FLOAT : TokenKind.INT, - start, - position, - body.slice(start, position) - ); -} -function readDigits(lexer, start, firstCode) { - if (!isDigit(firstCode)) { - throw syntaxError( - lexer.source, - start, - `Invalid number, expected digit but got: ${printCodePointAt( - lexer, - start - )}.` - ); - } - const body = lexer.source.body; - let position = start + 1; - while (isDigit(body.charCodeAt(position))) { - ++position; - } - return position; -} -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); - if (code === 34) { - value += body.slice(chunkStart, position); - return createToken(lexer, TokenKind.STRING, start, position + 1, value); - } - if (code === 92) { - value += body.slice(chunkStart, position); - const escape = body.charCodeAt(position + 1) === 117 ? body.charCodeAt(position + 2) === 123 ? readEscapedUnicodeVariableWidth(lexer, position) : readEscapedUnicodeFixedWidth(lexer, position) : readEscapedCharacter(lexer, position); - value += escape.value; - position += escape.size; - chunkStart = position; - continue; - } - if (code === 10 || code === 13) { - break; - } - if (isUnicodeScalarValue(code)) { - ++position; - } else if (isSupplementaryCodePoint(body, position)) { - position += 2; - } else { - throw syntaxError( - lexer.source, - position, - `Invalid character within String: ${printCodePointAt( - lexer, - position - )}.` - ); - } - } - throw syntaxError(lexer.source, position, "Unterminated string."); -} -function readEscapedUnicodeVariableWidth(lexer, position) { - const body = lexer.source.body; - let point = 0; - let size = 3; - while (size < 12) { - const code = body.charCodeAt(position + size++); - if (code === 125) { - if (size < 5 || !isUnicodeScalarValue(point)) { - break; - } - return { - value: String.fromCodePoint(point), - size - }; - } - point = point << 4 | readHexDigit(code); - if (point < 0) { - break; - } - } - throw 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 - }; - } - if (isLeadingSurrogate(code)) { - if (body.charCodeAt(position + 6) === 92 && body.charCodeAt(position + 7) === 117) { - const trailingCode = read16BitHexCode(body, position + 8); - if (isTrailingSurrogate(trailingCode)) { - return { - value: String.fromCodePoint(code, trailingCode), - size: 12 - }; - } - } - } - throw syntaxError( - lexer.source, - position, - `Invalid Unicode escape sequence: "${body.slice(position, position + 6)}".` - ); -} -function read16BitHexCode(body, position) { - return readHexDigit(body.charCodeAt(position)) << 12 | readHexDigit(body.charCodeAt(position + 1)) << 8 | readHexDigit(body.charCodeAt(position + 2)) << 4 | readHexDigit(body.charCodeAt(position + 3)); -} -function readHexDigit(code) { - return code >= 48 && code <= 57 ? code - 48 : code >= 65 && code <= 70 ? code - 55 : code >= 97 && code <= 102 ? code - 87 : -1; -} -function readEscapedCharacter(lexer, position) { - const body = lexer.source.body; - const code = body.charCodeAt(position + 1); - switch (code) { - 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: " ", - size: 2 - }; - } - throw syntaxError( - lexer.source, - position, - `Invalid character escape sequence: "${body.slice( - position, - position + 2 - )}".` - ); -} -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); - if (code === 34 && body.charCodeAt(position + 1) === 34 && body.charCodeAt(position + 2) === 34) { - currentLine += body.slice(chunkStart, position); - blockLines.push(currentLine); - const token = createToken( - lexer, - TokenKind.BLOCK_STRING, - start, - position + 3, - // Return a string of the lines joined with U+000A. - dedentBlockStringLines(blockLines).join("\n") - ); - lexer.line += blockLines.length - 1; - lexer.lineStart = lineStart; - return token; - } - if (code === 92 && body.charCodeAt(position + 1) === 34 && body.charCodeAt(position + 2) === 34 && body.charCodeAt(position + 3) === 34) { - currentLine += body.slice(chunkStart, position); - chunkStart = position + 1; - position += 4; - continue; - } - if (code === 10 || code === 13) { - currentLine += body.slice(chunkStart, position); - blockLines.push(currentLine); - if (code === 13 && body.charCodeAt(position + 1) === 10) { - position += 2; - } else { - ++position; - } - currentLine = ""; - chunkStart = position; - lineStart = position; - continue; - } - if (isUnicodeScalarValue(code)) { - ++position; - } else if (isSupplementaryCodePoint(body, position)) { - position += 2; - } else { - throw syntaxError( - lexer.source, - position, - `Invalid character within String: ${printCodePointAt( - lexer, - position - )}.` - ); - } - } - throw syntaxError(lexer.source, position, "Unterminated string."); -} -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 (isNameContinue(code)) { - ++position; - } else { - break; - } - } - return createToken( - lexer, - TokenKind.NAME, - start, - position, - body.slice(start, position) - ); -} - -// ../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/language/schemaCoordinateLexer.mjs -var SchemaCoordinateLexer = class { - /** - * The previously focused non-ignored token. - */ - /** - * The currently focused non-ignored token. - */ - /** - * The (1-indexed) line containing the current token. - * Since a schema coordinate may not contain newline, this value is always 1. - */ - line = 1; - /** - * The character offset at which the current line begins. - * Since a schema coordinate may not contain newline, this value is always 0. - */ - lineStart = 0; - constructor(source) { - const startOfFileToken = new Token(TokenKind.SOF, 0, 0, 0, 0); - this.source = source; - this.lastToken = startOfFileToken; - this.token = startOfFileToken; - } - get [Symbol.toStringTag]() { - return "SchemaCoordinateLexer"; - } - /** - * 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 current Lexer token. - */ - lookahead() { - let token = this.token; - if (token.kind !== TokenKind.EOF) { - const nextToken = readNextToken2(this, token.end); - token.next = nextToken; - nextToken.prev = token; - token = nextToken; - } - return token; - } -}; -function readNextToken2(lexer, start) { - const body = lexer.source.body; - const bodyLength = body.length; - const position = start; - if (position < bodyLength) { - const code = body.charCodeAt(position); - switch (code) { - case 46: - return createToken(lexer, TokenKind.DOT, position, position + 1); - case 40: - return createToken(lexer, TokenKind.PAREN_L, position, position + 1); - case 41: - return createToken(lexer, TokenKind.PAREN_R, position, position + 1); - case 58: - return createToken(lexer, TokenKind.COLON, position, position + 1); - case 64: - return createToken(lexer, TokenKind.AT, position, position + 1); - } - if (isNameStart(code)) { - return readName(lexer, position); - } - throw syntaxError( - lexer.source, - position, - `Invalid character: ${printCodePointAt(lexer, position)}.` - ); - } - return createToken(lexer, TokenKind.EOF, bodyLength, bodyLength); -} - -// ../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/jsutils/inspect.mjs -var MAX_ARRAY_LENGTH = 10; -var MAX_RECURSIVE_DEPTH = 2; -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(); - 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/.bun/graphql@16.12.0/node_modules/graphql/jsutils/instanceOf.mjs -var isProduction = globalThis.process && // eslint-disable-next-line no-undef -false; -var instanceOf = ( - /* c8 ignore next 6 */ - // FIXME: https://github.com/graphql/graphql-js/issues/2317 - isProduction ? function instanceOf2(value, constructor) { - return value instanceof constructor; - } : function instanceOf3(value, constructor) { - if (value instanceof constructor) { - return true; - } - if (typeof value === "object" && value !== null) { - var _value$constructor; - 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 ? value[Symbol.toStringTag] : (_value$constructor = value.constructor) === null || _value$constructor === void 0 ? void 0 : _value$constructor.name - ); - if (className === valueClassName) { - const stringifiedValue = 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/.bun/graphql@16.12.0/node_modules/graphql/language/source.mjs -var Source = class { - constructor(body, name = "GraphQL request", locationOffset = { - line: 1, - column: 1 - }) { - typeof body === "string" || devAssert(false, `Body must be a string. Received: ${inspect(body)}.`); - this.body = body; - this.name = name; - this.locationOffset = locationOffset; - this.locationOffset.line > 0 || devAssert( - false, - "line in locationOffset is 1-indexed and must be positive." - ); - this.locationOffset.column > 0 || devAssert( - false, - "column in locationOffset is 1-indexed and must be positive." - ); - } - get [Symbol.toStringTag]() { - return "Source"; - } -}; -function isSource(source) { - return instanceOf(source, Source); -} - -// ../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/language/parser.mjs -function parse(source, options) { - const parser = new Parser(source, options); - const document = parser.parseDocument(); - Object.defineProperty(document, "tokenCount", { - enumerable: false, - value: parser.tokenCount - }); - return document; -} -function parseValue(source, options) { - const parser = new Parser(source, options); - parser.expectToken(TokenKind.SOF); - const value = parser.parseValueLiteral(false); - parser.expectToken(TokenKind.EOF); - return value; -} -function parseConstValue(source, options) { - const parser = new Parser(source, options); - parser.expectToken(TokenKind.SOF); - const value = parser.parseConstValueLiteral(); - parser.expectToken(TokenKind.EOF); - return value; -} -function parseType(source, options) { - const parser = new Parser(source, options); - parser.expectToken(TokenKind.SOF); - const type = parser.parseTypeReference(); - parser.expectToken(TokenKind.EOF); - return type; -} -function parseSchemaCoordinate(source) { - const sourceObj = isSource(source) ? source : new Source(source); - const lexer = new SchemaCoordinateLexer(sourceObj); - const parser = new Parser(source, { - lexer - }); - parser.expectToken(TokenKind.SOF); - const coordinate = parser.parseSchemaCoordinate(); - parser.expectToken(TokenKind.EOF); - return coordinate; -} -var Parser = class { - constructor(source, options = {}) { - const { lexer, ..._options } = options; - if (lexer) { - this._lexer = lexer; - } else { - const sourceObj = isSource(source) ? source : new Source(source); - this._lexer = new Lexer(sourceObj); - } - this._options = _options; - this._tokenCounter = 0; - } - get tokenCount() { - return this._tokenCounter; - } - /** - * Converts a name lex token into a name parse node. - */ - parseName() { - const token = this.expectToken(TokenKind.NAME); - return this.node(token, { - kind: Kind.NAME, - value: token.value - }); - } - // Implements the parsing rules in the Document section. - /** - * Document : Definition+ - */ - parseDocument() { - return this.node(this._lexer.token, { - kind: Kind.DOCUMENT, - definitions: this.many( - TokenKind.SOF, - this.parseDefinition, - 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.BRACE_L)) { - return this.parseOperationDefinition(); - } - const hasDescription = this.peekDescription(); - const keywordToken = hasDescription ? this._lexer.lookahead() : this._lexer.token; - if (hasDescription && keywordToken.kind === TokenKind.BRACE_L) { - throw syntaxError( - this._lexer.source, - this._lexer.token.start, - "Unexpected description, descriptions are not supported on shorthand queries." - ); - } - if (keywordToken.kind === 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(); - } - switch (keywordToken.value) { - case "query": - case "mutation": - case "subscription": - return this.parseOperationDefinition(); - case "fragment": - return this.parseFragmentDefinition(); - } - if (hasDescription) { - throw syntaxError( - this._lexer.source, - this._lexer.token.start, - "Unexpected description, only GraphQL definitions support descriptions." - ); - } - switch (keywordToken.value) { - 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.BRACE_L)) { - return this.node(start, { - kind: Kind.OPERATION_DEFINITION, - operation: OperationTypeNode.QUERY, - description: void 0, - name: void 0, - variableDefinitions: [], - directives: [], - selectionSet: this.parseSelectionSet() - }); - } - const description = this.parseDescription(); - const operation = this.parseOperationType(); - let name; - if (this.peek(TokenKind.NAME)) { - name = this.parseName(); - } - return this.node(start, { - kind: Kind.OPERATION_DEFINITION, - operation, - description, - name, - variableDefinitions: this.parseVariableDefinitions(), - directives: this.parseDirectives(false), - selectionSet: this.parseSelectionSet() - }); - } - /** - * OperationType : one of query mutation subscription - */ - parseOperationType() { - const operationToken = this.expectToken(TokenKind.NAME); - switch (operationToken.value) { - case "query": - return OperationTypeNode.QUERY; - case "mutation": - return OperationTypeNode.MUTATION; - case "subscription": - return OperationTypeNode.SUBSCRIPTION; - } - throw this.unexpected(operationToken); - } - /** - * VariableDefinitions : ( VariableDefinition+ ) - */ - parseVariableDefinitions() { - return this.optionalMany( - TokenKind.PAREN_L, - this.parseVariableDefinition, - TokenKind.PAREN_R - ); - } - /** - * VariableDefinition : Variable : Type DefaultValue? Directives[Const]? - */ - parseVariableDefinition() { - return this.node(this._lexer.token, { - kind: Kind.VARIABLE_DEFINITION, - description: this.parseDescription(), - variable: this.parseVariable(), - type: (this.expectToken(TokenKind.COLON), this.parseTypeReference()), - defaultValue: this.expectOptionalToken(TokenKind.EQUALS) ? this.parseConstValueLiteral() : void 0, - directives: this.parseConstDirectives() - }); - } - /** - * Variable : $ Name - */ - parseVariable() { - const start = this._lexer.token; - this.expectToken(TokenKind.DOLLAR); - return this.node(start, { - kind: Kind.VARIABLE, - name: this.parseName() - }); - } - /** - * ``` - * SelectionSet : { Selection+ } - * ``` - */ - parseSelectionSet() { - return this.node(this._lexer.token, { - kind: Kind.SELECTION_SET, - selections: this.many( - TokenKind.BRACE_L, - this.parseSelection, - TokenKind.BRACE_R - ) - }); - } - /** - * Selection : - * - Field - * - FragmentSpread - * - InlineFragment - */ - parseSelection() { - return this.peek(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.COLON)) { - alias = nameOrAlias; - name = this.parseName(); - } else { - name = nameOrAlias; - } - return this.node(start, { - kind: Kind.FIELD, - alias, - name, - arguments: this.parseArguments(false), - directives: this.parseDirectives(false), - selectionSet: this.peek(TokenKind.BRACE_L) ? this.parseSelectionSet() : void 0 - }); - } - /** - * Arguments[Const] : ( Argument[?Const]+ ) - */ - parseArguments(isConst) { - const item = isConst ? this.parseConstArgument : this.parseArgument; - return this.optionalMany(TokenKind.PAREN_L, item, TokenKind.PAREN_R); - } - /** - * Argument[Const] : Name : Value[?Const] - */ - parseArgument(isConst = false) { - const start = this._lexer.token; - const name = this.parseName(); - this.expectToken(TokenKind.COLON); - return this.node(start, { - kind: 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.SPREAD); - const hasTypeCondition = this.expectOptionalKeyword("on"); - if (!hasTypeCondition && this.peek(TokenKind.NAME)) { - return this.node(start, { - kind: Kind.FRAGMENT_SPREAD, - name: this.parseFragmentName(), - directives: this.parseDirectives(false) - }); - } - return this.node(start, { - kind: Kind.INLINE_FRAGMENT, - typeCondition: hasTypeCondition ? this.parseNamedType() : void 0, - directives: this.parseDirectives(false), - selectionSet: this.parseSelectionSet() - }); - } - /** - * FragmentDefinition : - * - fragment FragmentName on TypeCondition Directives? SelectionSet - * - * TypeCondition : NamedType - */ - parseFragmentDefinition() { - const start = this._lexer.token; - const description = this.parseDescription(); - this.expectKeyword("fragment"); - if (this._options.allowLegacyFragmentVariables === true) { - return this.node(start, { - kind: Kind.FRAGMENT_DEFINITION, - description, - name: this.parseFragmentName(), - variableDefinitions: this.parseVariableDefinitions(), - typeCondition: (this.expectKeyword("on"), this.parseNamedType()), - directives: this.parseDirectives(false), - selectionSet: this.parseSelectionSet() - }); - } - return this.node(start, { - kind: Kind.FRAGMENT_DEFINITION, - description, - 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.BRACKET_L: - return this.parseList(isConst); - case TokenKind.BRACE_L: - return this.parseObject(isConst); - case TokenKind.INT: - this.advanceLexer(); - return this.node(token, { - kind: Kind.INT, - value: token.value - }); - case TokenKind.FLOAT: - this.advanceLexer(); - return this.node(token, { - kind: Kind.FLOAT, - value: token.value - }); - case TokenKind.STRING: - case TokenKind.BLOCK_STRING: - return this.parseStringLiteral(); - case TokenKind.NAME: - this.advanceLexer(); - switch (token.value) { - case "true": - return this.node(token, { - kind: Kind.BOOLEAN, - value: true - }); - case "false": - return this.node(token, { - kind: Kind.BOOLEAN, - value: false - }); - case "null": - return this.node(token, { - kind: Kind.NULL - }); - default: - return this.node(token, { - kind: Kind.ENUM, - value: token.value - }); - } - case TokenKind.DOLLAR: - if (isConst) { - this.expectToken(TokenKind.DOLLAR); - if (this._lexer.token.kind === TokenKind.NAME) { - const varName = this._lexer.token.value; - throw 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.advanceLexer(); - return this.node(token, { - kind: Kind.STRING, - value: token.value, - block: token.kind === TokenKind.BLOCK_STRING - }); - } - /** - * ListValue[Const] : - * - [ ] - * - [ Value[?Const]+ ] - */ - parseList(isConst) { - const item = () => this.parseValueLiteral(isConst); - return this.node(this._lexer.token, { - kind: Kind.LIST, - values: this.any(TokenKind.BRACKET_L, item, TokenKind.BRACKET_R) - }); - } - /** - * ``` - * ObjectValue[Const] : - * - { } - * - { ObjectField[?Const]+ } - * ``` - */ - parseObject(isConst) { - const item = () => this.parseObjectField(isConst); - return this.node(this._lexer.token, { - kind: Kind.OBJECT, - fields: this.any(TokenKind.BRACE_L, item, TokenKind.BRACE_R) - }); - } - /** - * ObjectField[Const] : Name : Value[?Const] - */ - parseObjectField(isConst) { - const start = this._lexer.token; - const name = this.parseName(); - this.expectToken(TokenKind.COLON); - return this.node(start, { - kind: 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.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.AT); - return this.node(start, { - kind: 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.BRACKET_L)) { - const innerType = this.parseTypeReference(); - this.expectToken(TokenKind.BRACKET_R); - type = this.node(start, { - kind: Kind.LIST_TYPE, - type: innerType - }); - } else { - type = this.parseNamedType(); - } - if (this.expectOptionalToken(TokenKind.BANG)) { - return this.node(start, { - kind: Kind.NON_NULL_TYPE, - type - }); - } - return type; - } - /** - * NamedType : Name - */ - parseNamedType() { - return this.node(this._lexer.token, { - kind: Kind.NAMED_TYPE, - name: this.parseName() - }); - } - // Implements the parsing rules in the Type Definition section. - peekDescription() { - return this.peek(TokenKind.STRING) || this.peek(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.BRACE_L, - this.parseOperationTypeDefinition, - TokenKind.BRACE_R - ); - return this.node(start, { - kind: Kind.SCHEMA_DEFINITION, - description, - directives, - operationTypes - }); - } - /** - * OperationTypeDefinition : OperationType : NamedType - */ - parseOperationTypeDefinition() { - const start = this._lexer.token; - const operation = this.parseOperationType(); - this.expectToken(TokenKind.COLON); - const type = this.parseNamedType(); - return this.node(start, { - kind: 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: 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: Kind.OBJECT_TYPE_DEFINITION, - description, - name, - interfaces, - directives, - fields - }); - } - /** - * ImplementsInterfaces : - * - implements `&`? NamedType - * - ImplementsInterfaces & NamedType - */ - parseImplementsInterfaces() { - return this.expectOptionalKeyword("implements") ? this.delimitedMany(TokenKind.AMP, this.parseNamedType) : []; - } - /** - * ``` - * FieldsDefinition : { FieldDefinition+ } - * ``` - */ - parseFieldsDefinition() { - return this.optionalMany( - TokenKind.BRACE_L, - this.parseFieldDefinition, - 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.COLON); - const type = this.parseTypeReference(); - const directives = this.parseConstDirectives(); - return this.node(start, { - kind: Kind.FIELD_DEFINITION, - description, - name, - arguments: args, - type, - directives - }); - } - /** - * ArgumentsDefinition : ( InputValueDefinition+ ) - */ - parseArgumentDefs() { - return this.optionalMany( - TokenKind.PAREN_L, - this.parseInputValueDef, - 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.COLON); - const type = this.parseTypeReference(); - let defaultValue; - if (this.expectOptionalToken(TokenKind.EQUALS)) { - defaultValue = this.parseConstValueLiteral(); - } - const directives = this.parseConstDirectives(); - return this.node(start, { - kind: 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: 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: Kind.UNION_TYPE_DEFINITION, - description, - name, - directives, - types - }); - } - /** - * UnionMemberTypes : - * - = `|`? NamedType - * - UnionMemberTypes | NamedType - */ - parseUnionMemberTypes() { - return this.expectOptionalToken(TokenKind.EQUALS) ? this.delimitedMany(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: Kind.ENUM_TYPE_DEFINITION, - description, - name, - directives, - values - }); - } - /** - * ``` - * EnumValuesDefinition : { EnumValueDefinition+ } - * ``` - */ - parseEnumValuesDefinition() { - return this.optionalMany( - TokenKind.BRACE_L, - this.parseEnumValueDefinition, - 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: 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 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: Kind.INPUT_OBJECT_TYPE_DEFINITION, - description, - name, - directives, - fields - }); - } - /** - * ``` - * InputFieldsDefinition : { InputValueDefinition+ } - * ``` - */ - parseInputFieldsDefinition() { - return this.optionalMany( - TokenKind.BRACE_L, - this.parseInputValueDef, - TokenKind.BRACE_R - ); - } - /** - * TypeSystemExtension : - * - SchemaExtension - * - TypeExtension - * - * TypeExtension : - * - ScalarTypeExtension - * - ObjectTypeExtension - * - InterfaceTypeExtension - * - UnionTypeExtension - * - EnumTypeExtension - * - InputObjectTypeDefinition - */ - parseTypeSystemExtension() { - const keywordToken = this._lexer.lookahead(); - if (keywordToken.kind === 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.BRACE_L, - this.parseOperationTypeDefinition, - TokenKind.BRACE_R - ); - if (directives.length === 0 && operationTypes.length === 0) { - throw this.unexpected(); - } - return this.node(start, { - kind: 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: 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: 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: 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: 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: 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: 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.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: Kind.DIRECTIVE_DEFINITION, - description, - name, - arguments: args, - repeatable, - locations - }); - } - /** - * DirectiveLocations : - * - `|`? DirectiveLocation - * - DirectiveLocations | DirectiveLocation - */ - parseDirectiveLocations() { - return this.delimitedMany(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, name.value)) { - return name; - } - throw this.unexpected(start); - } - // Schema Coordinates - /** - * SchemaCoordinate : - * - Name - * - Name . Name - * - Name . Name ( Name : ) - * - \@ Name - * - \@ Name ( Name : ) - */ - parseSchemaCoordinate() { - const start = this._lexer.token; - const ofDirective = this.expectOptionalToken(TokenKind.AT); - const name = this.parseName(); - let memberName; - if (!ofDirective && this.expectOptionalToken(TokenKind.DOT)) { - memberName = this.parseName(); - } - let argumentName; - if ((ofDirective || memberName) && this.expectOptionalToken(TokenKind.PAREN_L)) { - argumentName = this.parseName(); - this.expectToken(TokenKind.COLON); - this.expectToken(TokenKind.PAREN_R); - } - if (ofDirective) { - if (argumentName) { - return this.node(start, { - kind: Kind.DIRECTIVE_ARGUMENT_COORDINATE, - name, - argumentName - }); - } - return this.node(start, { - kind: Kind.DIRECTIVE_COORDINATE, - name - }); - } else if (memberName) { - if (argumentName) { - return this.node(start, { - kind: Kind.ARGUMENT_COORDINATE, - name, - fieldName: memberName, - argumentName - }); - } - return this.node(start, { - kind: Kind.MEMBER_COORDINATE, - name, - memberName - }); - } - return this.node(start, { - kind: Kind.TYPE_COORDINATE, - name - }); - } - // 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) { - if (this._options.noLocation !== true) { - node.loc = new 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.advanceLexer(); - return token; - } - throw 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.advanceLexer(); - 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.NAME && token.value === value) { - this.advanceLexer(); - } else { - throw 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.NAME && token.value === value) { - this.advanceLexer(); - 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 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; - } - advanceLexer() { - const { maxTokens } = this._options; - const token = this._lexer.advance(); - if (token.kind !== TokenKind.EOF) { - ++this._tokenCounter; - if (maxTokens !== void 0 && this._tokenCounter > maxTokens) { - throw syntaxError( - this._lexer.source, - token.start, - `Document contains more that ${maxTokens} tokens. Parsing aborted.` - ); - } - } - } -}; -function getTokenDesc(token) { - const value = token.value; - return getTokenKindDesc(token.kind) + (value != null ? ` "${value}"` : ""); -} -function getTokenKindDesc(kind) { - return isPunctuatorTokenKind(kind) ? `"${kind}"` : kind; -} - -// ../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/jsutils/didYouMean.mjs -var 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((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/.bun/graphql@16.12.0/node_modules/graphql/jsutils/identityFunc.mjs -function identityFunc(x) { - return x; -} - -// ../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/jsutils/keyMap.mjs -function keyMap(list, keyFn) { - const result = /* @__PURE__ */ Object.create(null); - for (const item of list) { - result[keyFn(item)] = item; - } - return result; -} - -// ../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/jsutils/keyValMap.mjs -function keyValMap(list, keyFn, valFn) { - const result = /* @__PURE__ */ Object.create(null); - for (const item of list) { - result[keyFn(item)] = valFn(item); - } - return result; -} - -// ../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/jsutils/mapValue.mjs -function mapValue(map, fn) { - const result = /* @__PURE__ */ Object.create(null); - for (const key of Object.keys(map)) { - result[key] = fn(map[key], key); - } - return result; -} - -// ../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/jsutils/naturalCompare.mjs -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 (isDigit2(aChar) && isDigit2(bChar)) { - let aNum = 0; - do { - ++aIndex; - aNum = aNum * 10 + aChar - DIGIT_0; - aChar = aStr.charCodeAt(aIndex); - } while (isDigit2(aChar) && aNum > 0); - let bNum = 0; - do { - ++bIndex; - bNum = bNum * 10 + bChar - DIGIT_0; - bChar = bStr.charCodeAt(bIndex); - } while (isDigit2(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; -} -var DIGIT_0 = 48; -var DIGIT_9 = 57; -function isDigit2(code) { - return !isNaN(code) && DIGIT_0 <= code && code <= DIGIT_9; -} - -// ../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/jsutils/suggestionList.mjs -function suggestionList(input, options) { - const optionsByDistance = /* @__PURE__ */ 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 !== void 0) { - optionsByDistance[option] = distance; - } - } - return Object.keys(optionsByDistance).sort((a, b) => { - const distanceDiff = optionsByDistance[a] - optionsByDistance[b]; - return distanceDiff !== 0 ? distanceDiff : naturalCompare(a, b); - }); -} -var LexicalDistance = class { - 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 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 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 = 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]) { - 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; - } -}; -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/.bun/graphql@16.12.0/node_modules/graphql/jsutils/toObjMap.mjs -function toObjMap(obj) { - if (obj == null) { - return /* @__PURE__ */ Object.create(null); - } - if (Object.getPrototypeOf(obj) === null) { - return obj; - } - const map = /* @__PURE__ */ Object.create(null); - for (const [key, value] of Object.entries(obj)) { - map[key] = value; - } - return map; -} - -// ../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/language/printString.mjs -function printString(str) { - return `"${str.replace(escapedRegExp, escapedReplacer)}"`; -} -var escapedRegExp = /[\x00-\x1f\x22\x5c\x7f-\x9f]/g; -function escapedReplacer(str) { - return escapeSequences[str.charCodeAt(0)]; -} -var 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/.bun/graphql@16.12.0/node_modules/graphql/language/visitor.mjs -var BREAK = Object.freeze({}); -function visit(root, visitor, visitorKeys = 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(root); - let keys = [root]; - let index = -1; - let edits = []; - let node = root; - 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 = { ...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 root; -} -function visitInParallel(visitors) { - const skipping = new Array(visitors.length).fill(null); - const mergedVisitor = /* @__PURE__ */ Object.create(null); - for (const kind of Object.values(Kind)) { - let hasVisitor = false; - const enterList = new Array(visitors.length).fill(void 0); - const leaveList = new Array(visitors.length).fill(void 0); - 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 !== void 0) { - 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 !== void 0 && result !== false) { - return result; - } - } else if (skipping[i] === node) { - skipping[i] = null; - } - } - } - }; - mergedVisitor[kind] = mergedEnterLeave; - } - return mergedVisitor; -} -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 - }; -} -function getVisitFn(visitor, kind, isLeaving) { - const { enter, leave } = getEnterLeaveForKind(visitor, kind); - return isLeaving ? leave : enter; -} - -// ../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/language/printer.mjs -function print(ast) { - return visit(ast, printDocASTReducer); -} -var MAX_LINE_LENGTH = 80; -var 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 = hasMultilineItems(node.variableDefinitions) ? wrap("(\n", join(node.variableDefinitions, "\n"), "\n)") : wrap("(", join(node.variableDefinitions, ", "), ")"); - const prefix = wrap("", node.description, "\n") + join( - [ - node.operation, - join([node.name, varDefs]), - join(node.directives, " ") - ], - " " - ); - return (prefix === "query" ? "" : prefix + " ") + node.selectionSet; - } - }, - VariableDefinition: { - leave: ({ variable, type, defaultValue, directives, description }) => wrap("", description, "\n") + 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, - description - }) => wrap("", description, "\n") + // 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 ? printBlockString(value) : 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)], " ") - }, - // Schema Coordinates - TypeCoordinate: { - leave: ({ name }) => name - }, - MemberCoordinate: { - leave: ({ name, memberName }) => join([name, wrap(".", memberName)]) - }, - ArgumentCoordinate: { - leave: ({ name, fieldName, argumentName }) => join([name, wrap(".", fieldName), wrap("(", argumentName, ":)")]) - }, - DirectiveCoordinate: { - leave: ({ name }) => join(["@", name]) - }, - DirectiveArgumentCoordinate: { - leave: ({ name, argumentName }) => join(["@", name, wrap("(", argumentName, ":)")]) - } -}; -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 : ""; -} -function block(array) { - return wrap("{\n", indent(join(array, "\n")), "\n}"); -} -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; - 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/.bun/graphql@16.12.0/node_modules/graphql/utilities/valueFromASTUntyped.mjs -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]; - } -} - -// ../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/type/assertName.mjs -function assertName(name) { - name != null || devAssert(false, "Must provide name."); - typeof name === "string" || devAssert(false, "Expected name to be a string."); - if (name.length === 0) { - throw new GraphQLError("Expected name to be a non-empty string."); - } - for (let i = 1; i < name.length; ++i) { - if (!isNameContinue(name.charCodeAt(i))) { - throw new GraphQLError( - `Names must only contain [_a-zA-Z0-9] but "${name}" does not.` - ); - } - } - if (!isNameStart(name.charCodeAt(0))) { - throw new GraphQLError( - `Names must start with [_a-zA-Z] but "${name}" does not.` - ); - } - return name; -} -function assertEnumValueName(name) { - if (name === "true" || name === "false" || name === "null") { - throw new GraphQLError(`Enum values cannot be named: ${name}`); - } - return assertName(name); -} - -// ../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/type/definition.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 ${inspect(type)} to be a GraphQL type.`); - } - return type; -} -function isScalarType(type) { - return instanceOf(type, GraphQLScalarType); -} -function assertScalarType(type) { - if (!isScalarType(type)) { - throw new Error(`Expected ${inspect(type)} to be a GraphQL Scalar type.`); - } - return type; -} -function isObjectType(type) { - return instanceOf(type, GraphQLObjectType); -} -function assertObjectType(type) { - if (!isObjectType(type)) { - throw new Error(`Expected ${inspect(type)} to be a GraphQL Object type.`); - } - return type; -} -function isInterfaceType(type) { - return instanceOf(type, GraphQLInterfaceType); -} -function assertInterfaceType(type) { - if (!isInterfaceType(type)) { - throw new Error( - `Expected ${inspect(type)} to be a GraphQL Interface type.` - ); - } - return type; -} -function isUnionType(type) { - return instanceOf(type, GraphQLUnionType); -} -function assertUnionType(type) { - if (!isUnionType(type)) { - throw new Error(`Expected ${inspect(type)} to be a GraphQL Union type.`); - } - return type; -} -function isEnumType(type) { - return instanceOf(type, GraphQLEnumType); -} -function assertEnumType(type) { - if (!isEnumType(type)) { - throw new Error(`Expected ${inspect(type)} to be a GraphQL Enum type.`); - } - return type; -} -function isInputObjectType(type) { - return instanceOf(type, GraphQLInputObjectType); -} -function assertInputObjectType(type) { - if (!isInputObjectType(type)) { - throw new Error( - `Expected ${inspect(type)} to be a GraphQL Input Object type.` - ); - } - return type; -} -function isListType(type) { - return instanceOf(type, GraphQLList); -} -function assertListType(type) { - if (!isListType(type)) { - throw new Error(`Expected ${inspect(type)} to be a GraphQL List type.`); - } - return type; -} -function isNonNullType(type) { - return instanceOf(type, GraphQLNonNull); -} -function assertNonNullType(type) { - if (!isNonNullType(type)) { - throw new Error(`Expected ${inspect(type)} to be a GraphQL Non-Null type.`); - } - return type; -} -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 ${inspect(type)} to be a GraphQL input type.`); - } - return type; -} -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 ${inspect(type)} to be a GraphQL output type.`); - } - return type; -} -function isLeafType(type) { - return isScalarType(type) || isEnumType(type); -} -function assertLeafType(type) { - if (!isLeafType(type)) { - throw new Error(`Expected ${inspect(type)} to be a GraphQL leaf type.`); - } - return type; -} -function isCompositeType(type) { - return isObjectType(type) || isInterfaceType(type) || isUnionType(type); -} -function assertCompositeType(type) { - if (!isCompositeType(type)) { - throw new Error( - `Expected ${inspect(type)} to be a GraphQL composite type.` - ); - } - return type; -} -function isAbstractType(type) { - return isInterfaceType(type) || isUnionType(type); -} -function assertAbstractType(type) { - if (!isAbstractType(type)) { - throw new Error(`Expected ${inspect(type)} to be a GraphQL abstract type.`); - } - return type; -} -var GraphQLList = class { - 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(); - } -}; -var GraphQLNonNull = class { - 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(); - } -}; -function isWrappingType(type) { - return isListType(type) || isNonNullType(type); -} -function assertWrappingType(type) { - if (!isWrappingType(type)) { - throw new Error(`Expected ${inspect(type)} to be a GraphQL wrapping type.`); - } - return type; -} -function isNullableType(type) { - return isType(type) && !isNonNullType(type); -} -function assertNullableType(type) { - if (!isNullableType(type)) { - throw new Error(`Expected ${inspect(type)} to be a GraphQL nullable type.`); - } - return type; -} -function getNullableType(type) { - if (type) { - return isNonNullType(type) ? type.ofType : type; - } -} -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 ${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; - } -} -function resolveReadonlyArrayThunk(thunk) { - return typeof thunk === "function" ? thunk() : thunk; -} -function resolveObjMapThunk(thunk) { - return typeof thunk === "function" ? thunk() : thunk; -} -var GraphQLScalarType = class { - constructor(config) { - var _config$parseValue, _config$serialize, _config$parseLiteral, _config$extensionASTN; - const parseValue2 = (_config$parseValue = config.parseValue) !== null && _config$parseValue !== void 0 ? _config$parseValue : identityFunc; - this.name = assertName(config.name); - this.description = config.description; - this.specifiedByURL = config.specifiedByURL; - this.serialize = (_config$serialize = config.serialize) !== null && _config$serialize !== void 0 ? _config$serialize : identityFunc; - this.parseValue = parseValue2; - this.parseLiteral = (_config$parseLiteral = config.parseLiteral) !== null && _config$parseLiteral !== void 0 ? _config$parseLiteral : (node, variables) => parseValue2(valueFromASTUntyped(node, variables)); - this.extensions = 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" || devAssert( - false, - `${this.name} must provide "specifiedByURL" as a string, but got: ${inspect(config.specifiedByURL)}.` - ); - config.serialize == null || typeof config.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 (config.parseLiteral) { - typeof config.parseValue === "function" && typeof config.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(); - } -}; -var GraphQLObjectType = class { - constructor(config) { - var _config$extensionASTN2; - this.name = assertName(config.name); - this.description = config.description; - this.isTypeOf = config.isTypeOf; - this.extensions = 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" || devAssert( - false, - `${this.name} must provide "isTypeOf" as a function, but got: ${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) || 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) || devAssert( - false, - `${config.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, - `${config.name}.${fieldName} field config must be an object.` - ); - fieldConfig.resolve == null || typeof fieldConfig.resolve === "function" || devAssert( - false, - `${config.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, - `${config.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 - }; - }); -} -function defineArguments(config) { - return Object.entries(config).map(([argName, argConfig]) => ({ - name: assertName(argName), - description: argConfig.description, - type: argConfig.type, - defaultValue: argConfig.defaultValue, - deprecationReason: argConfig.deprecationReason, - extensions: toObjMap(argConfig.extensions), - astNode: argConfig.astNode - })); -} -function isPlainObj(obj) { - return isObjectLike(obj) && !Array.isArray(obj); -} -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 - })); -} -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 - }) - ); -} -function isRequiredArgument(arg) { - return isNonNullType(arg.type) && arg.defaultValue === void 0; -} -var GraphQLInterfaceType = class { - constructor(config) { - var _config$extensionASTN3; - this.name = assertName(config.name); - this.description = config.description; - this.resolveType = config.resolveType; - this.extensions = toObjMap(config.extensions); - this.astNode = config.astNode; - this.extensionASTNodes = (_config$extensionASTN3 = config.extensionASTNodes) !== null && _config$extensionASTN3 !== void 0 ? _config$extensionASTN3 : []; - this._fields = defineFieldMap.bind(void 0, config); - this._interfaces = defineInterfaces.bind(void 0, config); - config.resolveType == null || typeof config.resolveType === "function" || devAssert( - false, - `${this.name} must provide "resolveType" as a function, but got: ${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(); - } -}; -var GraphQLUnionType = class { - constructor(config) { - var _config$extensionASTN4; - this.name = assertName(config.name); - this.description = config.description; - this.resolveType = config.resolveType; - this.extensions = toObjMap(config.extensions); - this.astNode = config.astNode; - this.extensionASTNodes = (_config$extensionASTN4 = config.extensionASTNodes) !== null && _config$extensionASTN4 !== void 0 ? _config$extensionASTN4 : []; - this._types = defineTypes.bind(void 0, config); - config.resolveType == null || typeof config.resolveType === "function" || devAssert( - false, - `${this.name} must provide "resolveType" as a function, but got: ${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) || devAssert( - false, - `Must provide Array of types or a function which returns such an array for Union ${config.name}.` - ); - return types; -} -var GraphQLEnumType = class { - /* */ - constructor(config) { - var _config$extensionASTN5; - this.name = assertName(config.name); - this.description = config.description; - this.extensions = toObjMap(config.extensions); - this.astNode = config.astNode; - this.extensionASTNodes = (_config$extensionASTN5 = config.extensionASTNodes) !== null && _config$extensionASTN5 !== void 0 ? _config$extensionASTN5 : []; - this._values = typeof config.values === "function" ? config.values : defineEnumValues(this.name, config.values); - this._valueLookup = null; - this._nameLookup = null; - } - get [Symbol.toStringTag]() { - return "GraphQLEnumType"; - } - getValues() { - if (typeof this._values === "function") { - this._values = defineEnumValues(this.name, this._values()); - } - return this._values; - } - getValue(name) { - if (this._nameLookup === null) { - this._nameLookup = keyMap(this.getValues(), (value) => value.name); - } - return this._nameLookup[name]; - } - serialize(outputValue) { - if (this._valueLookup === null) { - this._valueLookup = new Map( - this.getValues().map((enumValue2) => [enumValue2.value, enumValue2]) - ); - } - 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(), - (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 = suggestionList(unknownValueStr, allNames); - return didYouMean("the enum value", suggestedValues); -} -function defineEnumValues(typeName, valueMap) { - isPlainObj(valueMap) || devAssert( - false, - `${typeName} values must be an object with value names as keys.` - ); - return Object.entries(valueMap).map(([valueName, valueConfig]) => { - 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 - }; - }); -} -var GraphQLInputObjectType = class { - constructor(config) { - var _config$extensionASTN6, _config$isOneOf; - this.name = assertName(config.name); - this.description = config.description; - this.extensions = toObjMap(config.extensions); - this.astNode = config.astNode; - this.extensionASTNodes = (_config$extensionASTN6 = config.extensionASTNodes) !== null && _config$extensionASTN6 !== void 0 ? _config$extensionASTN6 : []; - this.isOneOf = (_config$isOneOf = config.isOneOf) !== null && _config$isOneOf !== void 0 ? _config$isOneOf : false; - this._fields = defineInputFieldMap.bind(void 0, config); - } - 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, - isOneOf: this.isOneOf - }; - } - toString() { - return this.name; - } - toJSON() { - return this.toString(); - } -}; -function defineInputFieldMap(config) { - const fieldMap = resolveObjMapThunk(config.fields); - isPlainObj(fieldMap) || devAssert( - false, - `${config.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, - `${config.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 - }; - }); -} -function isRequiredInputField(field) { - return isNonNullType(field.type) && field.defaultValue === void 0; -} - -// ../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/utilities/typeComparators.mjs -function isEqualType(typeA, typeB) { - if (typeA === typeB) { - return true; - } - if (isNonNullType(typeA) && isNonNullType(typeB)) { - return isEqualType(typeA.ofType, typeB.ofType); - } - if (isListType(typeA) && isListType(typeB)) { - return isEqualType(typeA.ofType, typeB.ofType); - } - return false; -} -function isTypeSubTypeOf(schema, maybeSubType, superType) { - if (maybeSubType === superType) { - return true; - } - if (isNonNullType(superType)) { - if (isNonNullType(maybeSubType)) { - return isTypeSubTypeOf(schema, maybeSubType.ofType, superType.ofType); - } - return false; - } - if (isNonNullType(maybeSubType)) { - return isTypeSubTypeOf(schema, maybeSubType.ofType, superType); - } - if (isListType(superType)) { - if (isListType(maybeSubType)) { - return isTypeSubTypeOf(schema, maybeSubType.ofType, superType.ofType); - } - return false; - } - if (isListType(maybeSubType)) { - return false; - } - return isAbstractType(superType) && (isInterfaceType(maybeSubType) || isObjectType(maybeSubType)) && schema.isSubType(superType, maybeSubType); -} -function doTypesOverlap(schema, typeA, typeB) { - if (typeA === typeB) { - return true; - } - if (isAbstractType(typeA)) { - if (isAbstractType(typeB)) { - return schema.getPossibleTypes(typeA).some((type) => schema.isSubType(typeB, type)); - } - return schema.isSubType(typeA, typeB); - } - if (isAbstractType(typeB)) { - return schema.isSubType(typeB, typeA); - } - return false; -} - -// ../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/type/scalars.mjs -var GRAPHQL_MAX_INT = 2147483647; -var GRAPHQL_MIN_INT = -2147483648; -var 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 num = coercedValue; - if (typeof coercedValue === "string" && coercedValue !== "") { - num = Number(coercedValue); - } - if (typeof num !== "number" || !Number.isInteger(num)) { - throw new GraphQLError( - `Int cannot represent non-integer value: ${inspect(coercedValue)}` - ); - } - if (num > GRAPHQL_MAX_INT || num < GRAPHQL_MIN_INT) { - throw new GraphQLError( - "Int cannot represent non 32-bit signed integer value: " + inspect(coercedValue) - ); - } - return num; - }, - 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 num = parseInt(valueNode.value, 10); - if (num > GRAPHQL_MAX_INT || num < GRAPHQL_MIN_INT) { - throw new GraphQLError( - `Int cannot represent non 32-bit signed integer value: ${valueNode.value}`, - { - nodes: valueNode - } - ); - } - return num; - } -}); -var 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 num = coercedValue; - if (typeof coercedValue === "string" && coercedValue !== "") { - num = Number(coercedValue); - } - if (typeof num !== "number" || !Number.isFinite(num)) { - throw new GraphQLError( - `Float cannot represent non numeric value: ${inspect(coercedValue)}` - ); - } - return num; - }, - 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); - } -}); -var 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; - } -}); -var 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; - } -}); -var 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; - } -}); -var specifiedScalarTypes = Object.freeze([ - GraphQLString, - GraphQLInt, - GraphQLFloat, - GraphQLBoolean, - GraphQLID -]); -function isSpecifiedScalarType(type) { - return specifiedScalarTypes.some(({ name }) => type.name === name); -} -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; -} - -// ../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/type/directives.mjs -function isDirective(directive) { - return instanceOf(directive, GraphQLDirective); -} -function assertDirective(directive) { - if (!isDirective(directive)) { - throw new Error( - `Expected ${inspect(directive)} to be a GraphQL directive.` - ); - } - return directive; -} -var GraphQLDirective = class { - constructor(config) { - var _config$isRepeatable, _config$args; - this.name = 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 = toObjMap(config.extensions); - this.astNode = config.astNode; - Array.isArray(config.locations) || devAssert(false, `@${config.name} locations must be an Array.`); - const args = (_config$args = config.args) !== null && _config$args !== void 0 ? _config$args : {}; - isObjectLike(args) && !Array.isArray(args) || devAssert( - false, - `@${config.name} args must be an object with argument names as keys.` - ); - this.args = defineArguments(args); - } - get [Symbol.toStringTag]() { - return "GraphQLDirective"; - } - toConfig() { - return { - name: this.name, - description: this.description, - locations: this.locations, - args: argsToArgsConfig(this.args), - isRepeatable: this.isRepeatable, - extensions: this.extensions, - astNode: this.astNode - }; - } - toString() { - return "@" + this.name; - } - toJSON() { - return this.toString(); - } -}; -var GraphQLIncludeDirective = new GraphQLDirective({ - name: "include", - description: "Directs the executor to include this field or fragment only when the `if` argument is true.", - locations: [ - DirectiveLocation.FIELD, - DirectiveLocation.FRAGMENT_SPREAD, - DirectiveLocation.INLINE_FRAGMENT - ], - args: { - if: { - type: new GraphQLNonNull(GraphQLBoolean), - description: "Included when true." - } - } -}); -var GraphQLSkipDirective = new GraphQLDirective({ - name: "skip", - description: "Directs the executor to skip this field or fragment when the `if` argument is true.", - locations: [ - DirectiveLocation.FIELD, - DirectiveLocation.FRAGMENT_SPREAD, - DirectiveLocation.INLINE_FRAGMENT - ], - args: { - if: { - type: new GraphQLNonNull(GraphQLBoolean), - description: "Skipped when true." - } - } -}); -var DEFAULT_DEPRECATION_REASON = "No longer supported"; -var GraphQLDeprecatedDirective = new GraphQLDirective({ - name: "deprecated", - description: "Marks an element of a GraphQL schema as no longer supported.", - locations: [ - DirectiveLocation.FIELD_DEFINITION, - DirectiveLocation.ARGUMENT_DEFINITION, - DirectiveLocation.INPUT_FIELD_DEFINITION, - DirectiveLocation.ENUM_VALUE - ], - args: { - reason: { - type: 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 - } - } -}); -var GraphQLSpecifiedByDirective = new GraphQLDirective({ - name: "specifiedBy", - description: "Exposes a URL that specifies the behavior of this scalar.", - locations: [DirectiveLocation.SCALAR], - args: { - url: { - type: new GraphQLNonNull(GraphQLString), - description: "The URL that specifies the behavior of this scalar." - } - } -}); -var GraphQLOneOfDirective = new GraphQLDirective({ - name: "oneOf", - description: "Indicates exactly one field must be supplied and this field must not be `null`.", - locations: [DirectiveLocation.INPUT_OBJECT], - args: {} -}); -var specifiedDirectives = Object.freeze([ - GraphQLIncludeDirective, - GraphQLSkipDirective, - GraphQLDeprecatedDirective, - GraphQLSpecifiedByDirective, - GraphQLOneOfDirective -]); -function isSpecifiedDirective(directive) { - return specifiedDirectives.some(({ name }) => name === directive.name); -} - -// ../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/jsutils/isIterableObject.mjs -function isIterableObject(maybeIterable) { - return typeof maybeIterable === "object" && typeof (maybeIterable === null || maybeIterable === void 0 ? void 0 : maybeIterable[Symbol.iterator]) === "function"; -} - -// ../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/utilities/astFromValue.mjs -function astFromValue(value, type) { - if (isNonNullType(type)) { - const astValue = astFromValue(value, type.ofType); - if ((astValue === null || astValue === void 0 ? void 0 : astValue.kind) === Kind.NULL) { - return null; - } - return astValue; - } - if (value === null) { - return { - kind: Kind.NULL - }; - } - if (value === void 0) { - return null; - } - if (isListType(type)) { - const itemType = type.ofType; - if (isIterableObject(value)) { - const valuesNodes = []; - for (const item of value) { - const itemNode = astFromValue(item, itemType); - if (itemNode != null) { - valuesNodes.push(itemNode); - } - } - return { - kind: Kind.LIST, - values: valuesNodes - }; - } - return astFromValue(value, itemType); - } - if (isInputObjectType(type)) { - if (!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: Kind.OBJECT_FIELD, - name: { - kind: Kind.NAME, - value: field.name - }, - value: fieldValue - }); - } - } - return { - kind: Kind.OBJECT, - fields: fieldNodes - }; - } - if (isLeafType(type)) { - const serialized = type.serialize(value); - 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(type)) { - return { - kind: Kind.ENUM, - value: serialized - }; - } - if (type === 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(type)); -} -var integerStringRegExp = /^-?(?:0|[1-9][0-9]*)$/; - -// ../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/type/introspection.mjs -var __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() - } - }) -}); -var __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: (directive) => directive.name - }, - description: { - type: GraphQLString, - resolve: (directive) => directive.description - }, - isRepeatable: { - type: new GraphQLNonNull(GraphQLBoolean), - resolve: (directive) => directive.isRepeatable - }, - locations: { - type: new GraphQLNonNull( - new GraphQLList(new GraphQLNonNull(__DirectiveLocation)) - ), - resolve: (directive) => directive.locations - }, - args: { - type: new GraphQLNonNull( - new GraphQLList(new GraphQLNonNull(__InputValue)) - ), - args: { - includeDeprecated: { - type: GraphQLBoolean, - defaultValue: false - } - }, - resolve(field, { includeDeprecated }) { - return includeDeprecated ? field.args : field.args.filter((arg) => arg.deprecationReason == null); - } - } - }) -}); -var __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." - } - } -}); -var __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(type) { - if (isScalarType(type)) { - return TypeKind.SCALAR; - } - if (isObjectType(type)) { - return TypeKind.OBJECT; - } - if (isInterfaceType(type)) { - return TypeKind.INTERFACE; - } - if (isUnionType(type)) { - return TypeKind.UNION; - } - if (isEnumType(type)) { - return TypeKind.ENUM; - } - if (isInputObjectType(type)) { - return TypeKind.INPUT_OBJECT; - } - if (isListType(type)) { - return TypeKind.LIST; - } - if (isNonNullType(type)) { - return TypeKind.NON_NULL; - } - invariant(false, `Unexpected type: "${inspect(type)}".`); - } - }, - name: { - type: GraphQLString, - resolve: (type) => "name" in type ? type.name : void 0 - }, - description: { - type: GraphQLString, - resolve: (type) => ( - /* c8 ignore next */ - "description" in type ? type.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(type, { includeDeprecated }) { - if (isObjectType(type) || isInterfaceType(type)) { - const fields = Object.values(type.getFields()); - return includeDeprecated ? fields : fields.filter((field) => field.deprecationReason == null); - } - } - }, - interfaces: { - type: new GraphQLList(new GraphQLNonNull(__Type)), - resolve(type) { - if (isObjectType(type) || isInterfaceType(type)) { - return type.getInterfaces(); - } - } - }, - possibleTypes: { - type: new GraphQLList(new GraphQLNonNull(__Type)), - resolve(type, _args, _context, { schema }) { - if (isAbstractType(type)) { - return schema.getPossibleTypes(type); - } - } - }, - enumValues: { - type: new GraphQLList(new GraphQLNonNull(__EnumValue)), - args: { - includeDeprecated: { - type: GraphQLBoolean, - defaultValue: false - } - }, - resolve(type, { includeDeprecated }) { - if (isEnumType(type)) { - const values = type.getValues(); - return includeDeprecated ? values : values.filter((field) => field.deprecationReason == null); - } - } - }, - inputFields: { - type: new GraphQLList(new GraphQLNonNull(__InputValue)), - args: { - includeDeprecated: { - type: GraphQLBoolean, - defaultValue: false - } - }, - resolve(type, { includeDeprecated }) { - if (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 : void 0 - }, - isOneOf: { - type: GraphQLBoolean, - resolve: (type) => { - if (isInputObjectType(type)) { - return type.isOneOf; - } - } - } - }) -}); -var __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, { includeDeprecated }) { - 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 - } - }) -}); -var __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, defaultValue } = inputValue; - const valueAST = astFromValue(defaultValue, type); - return valueAST ? print(valueAST) : null; - } - }, - isDeprecated: { - type: new GraphQLNonNull(GraphQLBoolean), - resolve: (field) => field.deprecationReason != null - }, - deprecationReason: { - type: GraphQLString, - resolve: (obj) => obj.deprecationReason - } - }) -}); -var __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 - } - }) -}); -var 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 = {})); -var __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." - } - } -}); -var SchemaMetaFieldDef = { - name: "__schema", - type: new GraphQLNonNull(__Schema), - description: "Access the current type schema of this server.", - args: [], - resolve: (_source, _args, _context, { schema }) => schema, - deprecationReason: void 0, - extensions: /* @__PURE__ */ Object.create(null), - astNode: void 0 -}; -var 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, { name }, _context, { schema }) => schema.getType(name), - deprecationReason: void 0, - extensions: /* @__PURE__ */ Object.create(null), - astNode: void 0 -}; -var TypeNameMetaFieldDef = { - name: "__typename", - type: new GraphQLNonNull(GraphQLString), - description: "The name of the current Object type at runtime.", - args: [], - resolve: (_source, _args, _context, { parentType }) => parentType.name, - deprecationReason: void 0, - extensions: /* @__PURE__ */ Object.create(null), - astNode: void 0 -}; -var introspectionTypes = Object.freeze([ - __Schema, - __Directive, - __DirectiveLocation, - __Type, - __Field, - __InputValue, - __EnumValue, - __TypeKind -]); -function isIntrospectionType(type) { - return introspectionTypes.some(({ name }) => type.name === name); -} - -// ../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/type/schema.mjs -function isSchema(schema) { - return instanceOf(schema, GraphQLSchema); -} -function assertSchema(schema) { - if (!isSchema(schema)) { - throw new Error(`Expected ${inspect(schema)} to be a GraphQL schema.`); - } - return schema; -} -var GraphQLSchema = class { - // Used as a cache for validateSchema(). - constructor(config) { - var _config$extensionASTN, _config$directives; - this.__validationErrors = config.assumeValid === true ? [] : void 0; - isObjectLike(config) || devAssert(false, "Must provide configuration object."); - !config.types || Array.isArray(config.types) || devAssert( - false, - `"types" must be Array if provided but got: ${inspect(config.types)}.` - ); - !config.directives || Array.isArray(config.directives) || devAssert( - false, - `"directives" must be Array if provided but got: ${inspect(config.directives)}.` - ); - this.description = config.description; - this.extensions = 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; - this._directives = (_config$directives = config.directives) !== null && _config$directives !== void 0 ? _config$directives : specifiedDirectives; - const allReferencedTypes = new Set(config.types); - if (config.types != null) { - for (const type of config.types) { - 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) { - if (isDirective(directive)) { - for (const arg of directive.args) { - collectReferencedTypes(arg.type, allReferencedTypes); - } - } - } - collectReferencedTypes(__Schema, allReferencedTypes); - this._typeMap = /* @__PURE__ */ Object.create(null); - this._subTypeMap = /* @__PURE__ */ Object.create(null); - this._implementationsMap = /* @__PURE__ */ Object.create(null); - for (const namedType of allReferencedTypes) { - if (namedType == null) { - continue; - } - const typeName = namedType.name; - typeName || devAssert( - false, - "One of the provided types for building the Schema is missing a name." - ); - if (this._typeMap[typeName] !== void 0) { - throw new Error( - `Schema must contain uniquely named types but contains multiple types named "${typeName}".` - ); - } - this._typeMap[typeName] = namedType; - if (isInterfaceType(namedType)) { - for (const iface of namedType.getInterfaces()) { - if (isInterfaceType(iface)) { - let implementations = this._implementationsMap[iface.name]; - if (implementations === void 0) { - implementations = this._implementationsMap[iface.name] = { - objects: [], - interfaces: [] - }; - } - implementations.interfaces.push(namedType); - } - } - } else if (isObjectType(namedType)) { - for (const iface of namedType.getInterfaces()) { - if (isInterfaceType(iface)) { - let implementations = this._implementationsMap[iface.name]; - if (implementations === void 0) { - 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 OperationTypeNode.QUERY: - return this.getQueryType(); - case OperationTypeNode.MUTATION: - return this.getMutationType(); - case OperationTypeNode.SUBSCRIPTION: - return this.getSubscriptionType(); - } - } - getTypeMap() { - return this._typeMap; - } - getType(name) { - return this.getTypeMap()[name]; - } - getPossibleTypes(abstractType) { - return 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 === void 0) { - map = /* @__PURE__ */ Object.create(null); - if (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] !== void 0; - } - 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 !== void 0 - }; - } -}; -function collectReferencedTypes(type, typeSet) { - const namedType = getNamedType(type); - if (!typeSet.has(namedType)) { - typeSet.add(namedType); - if (isUnionType(namedType)) { - for (const memberType of namedType.getTypes()) { - collectReferencedTypes(memberType, typeSet); - } - } else if (isObjectType(namedType) || 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 (isInputObjectType(namedType)) { - for (const field of Object.values(namedType.getFields())) { - collectReferencedTypes(field.type, typeSet); - } - } - } - return typeSet; -} - -// ../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/type/validate.mjs -function validateSchema(schema) { - assertSchema(schema); - if (schema.__validationErrors) { - return schema.__validationErrors; - } - const context = new SchemaValidationContext(schema); - validateRootTypes(context); - validateDirectives(context); - validateTypes(context); - const errors = context.getErrors(); - schema.__validationErrors = errors; - return errors; -} -function assertValidSchema(schema) { - const errors = validateSchema(schema); - if (errors.length !== 0) { - throw new Error(errors.map((error) => error.message).join("\n\n")); - } -} -var SchemaValidationContext = class { - constructor(schema) { - this._errors = []; - this.schema = schema; - } - reportError(message, nodes) { - const _nodes = Array.isArray(nodes) ? nodes.filter(Boolean) : nodes; - this._errors.push( - new 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 (!isObjectType(queryType)) { - var _getOperationTypeNode; - context.reportError( - `Query root type must be Object type, it cannot be ${inspect( - queryType - )}.`, - (_getOperationTypeNode = getOperationTypeNode( - schema, - OperationTypeNode.QUERY - )) !== null && _getOperationTypeNode !== void 0 ? _getOperationTypeNode : queryType.astNode - ); - } - const mutationType = schema.getMutationType(); - if (mutationType && !isObjectType(mutationType)) { - var _getOperationTypeNode2; - context.reportError( - `Mutation root type must be Object type if provided, it cannot be ${inspect(mutationType)}.`, - (_getOperationTypeNode2 = getOperationTypeNode( - schema, - OperationTypeNode.MUTATION - )) !== null && _getOperationTypeNode2 !== void 0 ? _getOperationTypeNode2 : mutationType.astNode - ); - } - const subscriptionType = schema.getSubscriptionType(); - if (subscriptionType && !isObjectType(subscriptionType)) { - var _getOperationTypeNode3; - context.reportError( - `Subscription root type must be Object type if provided, it cannot be ${inspect(subscriptionType)}.`, - (_getOperationTypeNode3 = getOperationTypeNode( - schema, - 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()) { - if (!isDirective(directive)) { - context.reportError( - `Expected directive but got: ${inspect(directive)}.`, - directive === null || directive === void 0 ? void 0 : directive.astNode - ); - continue; - } - validateName(context, directive); - if (directive.locations.length === 0) { - context.reportError( - `Directive @${directive.name} must include 1 or more locations.`, - directive.astNode - ); - } - for (const arg of directive.args) { - validateName(context, arg); - if (!isInputType(arg.type)) { - context.reportError( - `The type of @${directive.name}(${arg.name}:) must be Input Type but got: ${inspect(arg.type)}.`, - arg.astNode - ); - } - if (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) { - 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)) { - if (!isNamedType(type)) { - context.reportError( - `Expected GraphQL named type but got: ${inspect(type)}.`, - type.astNode - ); - continue; - } - if (!isIntrospectionType(type)) { - validateName(context, type); - } - if (isObjectType(type)) { - validateFields(context, type); - validateInterfaces(context, type); - } else if (isInterfaceType(type)) { - validateFields(context, type); - validateInterfaces(context, type); - } else if (isUnionType(type)) { - validateUnionMembers(context, type); - } else if (isEnumType(type)) { - validateEnumValues(context, type); - } else if (isInputObjectType(type)) { - validateInputFields(context, type); - validateInputObjectCircularRefs(type); - } - } -} -function validateFields(context, type) { - const fields = Object.values(type.getFields()); - if (fields.length === 0) { - context.reportError(`Type ${type.name} must define one or more fields.`, [ - type.astNode, - ...type.extensionASTNodes - ]); - } - for (const field of fields) { - validateName(context, field); - if (!isOutputType(field.type)) { - var _field$astNode; - context.reportError( - `The type of ${type.name}.${field.name} must be Output Type but got: ${inspect(field.type)}.`, - (_field$astNode = field.astNode) === null || _field$astNode === void 0 ? void 0 : _field$astNode.type - ); - } - for (const arg of field.args) { - const argName = arg.name; - validateName(context, arg); - if (!isInputType(arg.type)) { - var _arg$astNode2; - context.reportError( - `The type of ${type.name}.${field.name}(${argName}:) must be Input Type but got: ${inspect(arg.type)}.`, - (_arg$astNode2 = arg.astNode) === null || _arg$astNode2 === void 0 ? void 0 : _arg$astNode2.type - ); - } - if (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 = /* @__PURE__ */ Object.create(null); - for (const iface of type.getInterfaces()) { - if (!isInterfaceType(iface)) { - context.reportError( - `Type ${inspect(type)} must only implement Interface types, it cannot implement ${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(); - for (const ifaceField of Object.values(iface.getFields())) { - const fieldName = ifaceField.name; - const typeField = typeFieldMap[fieldName]; - if (!typeField) { - context.reportError( - `Interface field ${iface.name}.${fieldName} expected but ${type.name} does not provide it.`, - [ifaceField.astNode, type.astNode, ...type.extensionASTNodes] - ); - continue; - } - if (!isTypeSubTypeOf(context.schema, typeField.type, ifaceField.type)) { - var _ifaceField$astNode, _typeField$astNode; - context.reportError( - `Interface field ${iface.name}.${fieldName} expects type ${inspect(ifaceField.type)} but ${type.name}.${fieldName} is type ${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 - ] - ); - } - for (const ifaceArg of ifaceField.args) { - const argName = ifaceArg.name; - const typeArg = typeField.args.find((arg) => arg.name === argName); - 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; - } - if (!isEqualType(ifaceArg.type, typeArg.type)) { - var _ifaceArg$astNode, _typeArg$astNode; - context.reportError( - `Interface field argument ${iface.name}.${fieldName}(${argName}:) expects type ${inspect(ifaceArg.type)} but ${type.name}.${fieldName}(${argName}:) is type ${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 - ] - ); - } - } - for (const typeArg of typeField.args) { - const argName = typeArg.name; - const ifaceArg = ifaceField.args.find((arg) => arg.name === argName); - if (!ifaceArg && 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 = /* @__PURE__ */ 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 (!isObjectType(memberType)) { - context.reportError( - `Union type ${union.name} can only include Object types, it cannot include ${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) { - 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] - ); - } - for (const field of fields) { - validateName(context, field); - if (!isInputType(field.type)) { - var _field$astNode2; - context.reportError( - `The type of ${inputObj.name}.${field.name} must be Input Type but got: ${inspect(field.type)}.`, - (_field$astNode2 = field.astNode) === null || _field$astNode2 === void 0 ? void 0 : _field$astNode2.type - ); - } - if (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 - ] - ); - } - if (inputObj.isOneOf) { - validateOneOfInputObjectField(inputObj, field, context); - } - } -} -function validateOneOfInputObjectField(type, field, context) { - if (isNonNullType(field.type)) { - var _field$astNode4; - context.reportError( - `OneOf input field ${type.name}.${field.name} must be nullable.`, - (_field$astNode4 = field.astNode) === null || _field$astNode4 === void 0 ? void 0 : _field$astNode4.type - ); - } - if (field.defaultValue !== void 0) { - context.reportError( - `OneOf input field ${type.name}.${field.name} cannot have a default value.`, - field.astNode - ); - } -} -function createInputObjectCircularRefsValidator(context) { - const visitedTypes = /* @__PURE__ */ Object.create(null); - const fieldPath = []; - const fieldPathIndexByTypeName = /* @__PURE__ */ Object.create(null); - return detectCycleRecursive; - 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 (isNonNullType(field.type) && isInputObjectType(field.type.ofType)) { - const fieldType = field.type.ofType; - const cycleIndex = fieldPathIndexByTypeName[fieldType.name]; - fieldPath.push(field); - if (cycleIndex === void 0) { - 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] = void 0; - } -} -function getAllImplementsInterfaceNodes(type, iface) { - const { astNode, extensionASTNodes } = type; - const nodes = astNode != null ? [astNode, ...extensionASTNodes] : extensionASTNodes; - 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; - 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 === GraphQLDeprecatedDirective.name - ); -} - -// ../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/utilities/typeFromAST.mjs -function typeFromAST(schema, typeNode) { - switch (typeNode.kind) { - case Kind.LIST_TYPE: { - const innerType = typeFromAST(schema, typeNode.type); - return innerType && new GraphQLList(innerType); - } - case Kind.NON_NULL_TYPE: { - const innerType = typeFromAST(schema, typeNode.type); - return innerType && new GraphQLNonNull(innerType); - } - case Kind.NAMED_TYPE: - return schema.getType(typeNode.name.value); - } -} - -// ../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/utilities/TypeInfo.mjs -var TypeInfo = class { - constructor(schema, initialType, 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 (isInputType(initialType)) { - this._inputTypeStack.push(initialType); - } - if (isCompositeType(initialType)) { - this._parentTypeStack.push(initialType); - } - if (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; - switch (node.kind) { - case Kind.SELECTION_SET: { - const namedType = getNamedType(this.getType()); - this._parentTypeStack.push( - isCompositeType(namedType) ? namedType : void 0 - ); - break; - } - case 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(isOutputType(fieldType) ? fieldType : void 0); - break; - } - case Kind.DIRECTIVE: - this._directive = schema.getDirective(node.name.value); - break; - case Kind.OPERATION_DEFINITION: { - const rootType = schema.getRootType(node.operation); - this._typeStack.push(isObjectType(rootType) ? rootType : void 0); - break; - } - case Kind.INLINE_FRAGMENT: - case Kind.FRAGMENT_DEFINITION: { - const typeConditionAST = node.typeCondition; - const outputType = typeConditionAST ? typeFromAST(schema, typeConditionAST) : getNamedType(this.getType()); - this._typeStack.push(isOutputType(outputType) ? outputType : void 0); - break; - } - case Kind.VARIABLE_DEFINITION: { - const inputType = typeFromAST(schema, node.type); - this._inputTypeStack.push( - isInputType(inputType) ? inputType : void 0 - ); - break; - } - case 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 : void 0); - this._inputTypeStack.push(isInputType(argType) ? argType : void 0); - break; - } - case Kind.LIST: { - const listType = getNullableType(this.getInputType()); - const itemType = isListType(listType) ? listType.ofType : listType; - this._defaultValueStack.push(void 0); - this._inputTypeStack.push(isInputType(itemType) ? itemType : void 0); - break; - } - case Kind.OBJECT_FIELD: { - const objectType = getNamedType(this.getInputType()); - let inputFieldType; - let inputField; - if (isInputObjectType(objectType)) { - inputField = objectType.getFields()[node.name.value]; - if (inputField) { - inputFieldType = inputField.type; - } - } - this._defaultValueStack.push( - inputField ? inputField.defaultValue : void 0 - ); - this._inputTypeStack.push( - isInputType(inputFieldType) ? inputFieldType : void 0 - ); - break; - } - case Kind.ENUM: { - const enumType = getNamedType(this.getInputType()); - let enumValue; - if (isEnumType(enumType)) { - enumValue = enumType.getValue(node.value); - } - this._enumValue = enumValue; - break; - } - default: - } - } - leave(node) { - switch (node.kind) { - case Kind.SELECTION_SET: - this._parentTypeStack.pop(); - break; - case Kind.FIELD: - this._fieldDefStack.pop(); - this._typeStack.pop(); - break; - case Kind.DIRECTIVE: - this._directive = null; - break; - case Kind.OPERATION_DEFINITION: - case Kind.INLINE_FRAGMENT: - case Kind.FRAGMENT_DEFINITION: - this._typeStack.pop(); - break; - case Kind.VARIABLE_DEFINITION: - this._inputTypeStack.pop(); - break; - case Kind.ARGUMENT: - this._argument = null; - this._defaultValueStack.pop(); - this._inputTypeStack.pop(); - break; - case Kind.LIST: - case Kind.OBJECT_FIELD: - this._defaultValueStack.pop(); - this._inputTypeStack.pop(); - break; - case Kind.ENUM: - this._enumValue = null; - break; - default: - } - } -}; -function getFieldDef(schema, parentType, fieldNode) { - const name = fieldNode.name.value; - if (name === SchemaMetaFieldDef.name && schema.getQueryType() === parentType) { - return SchemaMetaFieldDef; - } - if (name === TypeMetaFieldDef.name && schema.getQueryType() === parentType) { - return TypeMetaFieldDef; - } - if (name === TypeNameMetaFieldDef.name && isCompositeType(parentType)) { - return TypeNameMetaFieldDef; - } - if (isObjectType(parentType) || isInterfaceType(parentType)) { - return parentType.getFields()[name]; - } -} -function visitWithTypeInfo(typeInfo, visitor) { - return { - enter(...args) { - const node = args[0]; - typeInfo.enter(node); - const fn = getEnterLeaveForKind(visitor, node.kind).enter; - if (fn) { - const result = fn.apply(visitor, args); - if (result !== void 0) { - typeInfo.leave(node); - if (isNode(result)) { - typeInfo.enter(result); - } - } - return result; - } - }, - leave(...args) { - const node = args[0]; - const fn = getEnterLeaveForKind(visitor, node.kind).leave; - let result; - if (fn) { - result = fn.apply(visitor, args); - } - typeInfo.leave(node); - return result; - } - }; -} - -// ../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/language/predicates.mjs -function isDefinitionNode(node) { - return isExecutableDefinitionNode(node) || isTypeSystemDefinitionNode(node) || isTypeSystemExtensionNode(node); -} -function isExecutableDefinitionNode(node) { - return node.kind === Kind.OPERATION_DEFINITION || node.kind === Kind.FRAGMENT_DEFINITION; -} -function isSelectionNode(node) { - return node.kind === Kind.FIELD || node.kind === Kind.FRAGMENT_SPREAD || node.kind === Kind.INLINE_FRAGMENT; -} -function isValueNode(node) { - return node.kind === Kind.VARIABLE || node.kind === Kind.INT || node.kind === Kind.FLOAT || node.kind === Kind.STRING || node.kind === Kind.BOOLEAN || node.kind === Kind.NULL || node.kind === Kind.ENUM || node.kind === Kind.LIST || node.kind === Kind.OBJECT; -} -function isConstValueNode(node) { - return isValueNode(node) && (node.kind === Kind.LIST ? node.values.some(isConstValueNode) : node.kind === Kind.OBJECT ? node.fields.some((field) => isConstValueNode(field.value)) : node.kind !== Kind.VARIABLE); -} -function isTypeNode(node) { - return node.kind === Kind.NAMED_TYPE || node.kind === Kind.LIST_TYPE || node.kind === Kind.NON_NULL_TYPE; -} -function isTypeSystemDefinitionNode(node) { - return node.kind === Kind.SCHEMA_DEFINITION || isTypeDefinitionNode(node) || node.kind === Kind.DIRECTIVE_DEFINITION; -} -function isTypeDefinitionNode(node) { - return node.kind === Kind.SCALAR_TYPE_DEFINITION || node.kind === Kind.OBJECT_TYPE_DEFINITION || node.kind === Kind.INTERFACE_TYPE_DEFINITION || node.kind === Kind.UNION_TYPE_DEFINITION || node.kind === Kind.ENUM_TYPE_DEFINITION || node.kind === Kind.INPUT_OBJECT_TYPE_DEFINITION; -} -function isTypeSystemExtensionNode(node) { - return node.kind === Kind.SCHEMA_EXTENSION || isTypeExtensionNode(node); -} -function isTypeExtensionNode(node) { - return node.kind === Kind.SCALAR_TYPE_EXTENSION || node.kind === Kind.OBJECT_TYPE_EXTENSION || node.kind === Kind.INTERFACE_TYPE_EXTENSION || node.kind === Kind.UNION_TYPE_EXTENSION || node.kind === Kind.ENUM_TYPE_EXTENSION || node.kind === Kind.INPUT_OBJECT_TYPE_EXTENSION; -} -function isSchemaCoordinateNode(node) { - return node.kind === Kind.TYPE_COORDINATE || node.kind === Kind.MEMBER_COORDINATE || node.kind === Kind.ARGUMENT_COORDINATE || node.kind === Kind.DIRECTIVE_COORDINATE || node.kind === Kind.DIRECTIVE_ARGUMENT_COORDINATE; -} - -// ../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/validation/rules/ExecutableDefinitionsRule.mjs -function ExecutableDefinitionsRule(context) { - return { - Document(node) { - for (const definition of node.definitions) { - if (!isExecutableDefinitionNode(definition)) { - const defName = definition.kind === Kind.SCHEMA_DEFINITION || definition.kind === Kind.SCHEMA_EXTENSION ? "schema" : '"' + definition.name.value + '"'; - context.reportError( - new GraphQLError(`The ${defName} definition is not executable.`, { - nodes: definition - }) - ); - } - } - return false; - } - }; -} - -// ../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/validation/rules/FieldsOnCorrectTypeRule.mjs -function FieldsOnCorrectTypeRule(context) { - return { - Field(node) { - const type = context.getParentType(); - if (type) { - const fieldDef = context.getFieldDef(); - if (!fieldDef) { - const schema = context.getSchema(); - const fieldName = node.name.value; - let suggestion = didYouMean( - "to use an inline fragment on", - getSuggestedTypeNames(schema, type, fieldName) - ); - if (suggestion === "") { - suggestion = didYouMean(getSuggestedFieldNames(type, fieldName)); - } - context.reportError( - new GraphQLError( - `Cannot query field "${fieldName}" on type "${type.name}".` + suggestion, - { - nodes: node - } - ) - ); - } - } - } - }; -} -function getSuggestedTypeNames(schema, type, fieldName) { - if (!isAbstractType(type)) { - return []; - } - const suggestedTypes = /* @__PURE__ */ new Set(); - const usageCount = /* @__PURE__ */ Object.create(null); - for (const possibleType of schema.getPossibleTypes(type)) { - if (!possibleType.getFields()[fieldName]) { - continue; - } - suggestedTypes.add(possibleType); - usageCount[possibleType.name] = 1; - for (const possibleInterface of possibleType.getInterfaces()) { - var _usageCount$possibleI; - if (!possibleInterface.getFields()[fieldName]) { - continue; - } - 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) => { - const usageCountDiff = usageCount[typeB.name] - usageCount[typeA.name]; - if (usageCountDiff !== 0) { - return usageCountDiff; - } - if (isInterfaceType(typeA) && schema.isSubType(typeA, typeB)) { - return -1; - } - if (isInterfaceType(typeB) && schema.isSubType(typeB, typeA)) { - return 1; - } - return naturalCompare(typeA.name, typeB.name); - }).map((x) => x.name); -} -function getSuggestedFieldNames(type, fieldName) { - if (isObjectType(type) || isInterfaceType(type)) { - const possibleFieldNames = Object.keys(type.getFields()); - return suggestionList(fieldName, possibleFieldNames); - } - return []; -} - -// ../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/validation/rules/FragmentsOnCompositeTypesRule.mjs -function FragmentsOnCompositeTypesRule(context) { - return { - InlineFragment(node) { - const typeCondition = node.typeCondition; - if (typeCondition) { - const type = typeFromAST(context.getSchema(), typeCondition); - if (type && !isCompositeType(type)) { - const typeStr = print(typeCondition); - context.reportError( - new GraphQLError( - `Fragment cannot condition on non composite type "${typeStr}".`, - { - nodes: typeCondition - } - ) - ); - } - } - }, - FragmentDefinition(node) { - const type = typeFromAST(context.getSchema(), node.typeCondition); - if (type && !isCompositeType(type)) { - const typeStr = print(node.typeCondition); - context.reportError( - new GraphQLError( - `Fragment "${node.name.value}" cannot condition on non composite type "${typeStr}".`, - { - nodes: node.typeCondition - } - ) - ); - } - } - }; -} - -// ../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/validation/rules/KnownArgumentNamesRule.mjs -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 = suggestionList(argName, knownArgsNames); - context.reportError( - new GraphQLError( - `Unknown argument "${argName}" on field "${parentType.name}.${fieldDef.name}".` + didYouMean(suggestions), - { - nodes: argNode - } - ) - ); - } - } - }; -} -function KnownArgumentNamesOnDirectivesRule(context) { - const directiveArgs = /* @__PURE__ */ Object.create(null); - const schema = context.getSchema(); - const definedDirectives = schema ? schema.getDirectives() : 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 === Kind.DIRECTIVE_DEFINITION) { - var _def$arguments; - 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 = suggestionList(argName, knownArgs); - context.reportError( - new GraphQLError( - `Unknown argument "${argName}" on directive "@${directiveName}".` + didYouMean(suggestions), - { - nodes: argNode - } - ) - ); - } - } - } - return false; - } - }; -} - -// ../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/validation/rules/KnownDirectivesRule.mjs -function KnownDirectivesRule(context) { - const locationsMap = /* @__PURE__ */ Object.create(null); - const schema = context.getSchema(); - const definedDirectives = schema ? schema.getDirectives() : specifiedDirectives; - for (const directive of definedDirectives) { - locationsMap[directive.name] = directive.locations; - } - const astDefinitions = context.getDocument().definitions; - for (const def of astDefinitions) { - if (def.kind === 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 GraphQLError(`Unknown directive "@${name}".`, { - nodes: node - }) - ); - return; - } - const candidateLocation = getDirectiveLocationForASTPath(ancestors); - if (candidateLocation && !locations.includes(candidateLocation)) { - context.reportError( - new GraphQLError( - `Directive "@${name}" may not be used on ${candidateLocation}.`, - { - nodes: node - } - ) - ); - } - } - }; -} -function getDirectiveLocationForASTPath(ancestors) { - const appliedTo = ancestors[ancestors.length - 1]; - "kind" in appliedTo || invariant(false); - switch (appliedTo.kind) { - case Kind.OPERATION_DEFINITION: - return getDirectiveLocationForOperation(appliedTo.operation); - case Kind.FIELD: - return DirectiveLocation.FIELD; - case Kind.FRAGMENT_SPREAD: - return DirectiveLocation.FRAGMENT_SPREAD; - case Kind.INLINE_FRAGMENT: - return DirectiveLocation.INLINE_FRAGMENT; - case Kind.FRAGMENT_DEFINITION: - return DirectiveLocation.FRAGMENT_DEFINITION; - case Kind.VARIABLE_DEFINITION: - return DirectiveLocation.VARIABLE_DEFINITION; - case Kind.SCHEMA_DEFINITION: - case Kind.SCHEMA_EXTENSION: - return DirectiveLocation.SCHEMA; - case Kind.SCALAR_TYPE_DEFINITION: - case Kind.SCALAR_TYPE_EXTENSION: - return DirectiveLocation.SCALAR; - case Kind.OBJECT_TYPE_DEFINITION: - case Kind.OBJECT_TYPE_EXTENSION: - return DirectiveLocation.OBJECT; - case Kind.FIELD_DEFINITION: - return DirectiveLocation.FIELD_DEFINITION; - case Kind.INTERFACE_TYPE_DEFINITION: - case Kind.INTERFACE_TYPE_EXTENSION: - return DirectiveLocation.INTERFACE; - case Kind.UNION_TYPE_DEFINITION: - case Kind.UNION_TYPE_EXTENSION: - return DirectiveLocation.UNION; - case Kind.ENUM_TYPE_DEFINITION: - case Kind.ENUM_TYPE_EXTENSION: - return DirectiveLocation.ENUM; - case Kind.ENUM_VALUE_DEFINITION: - return DirectiveLocation.ENUM_VALUE; - case Kind.INPUT_OBJECT_TYPE_DEFINITION: - case Kind.INPUT_OBJECT_TYPE_EXTENSION: - return DirectiveLocation.INPUT_OBJECT; - case Kind.INPUT_VALUE_DEFINITION: { - const parentNode = ancestors[ancestors.length - 3]; - "kind" in parentNode || invariant(false); - return parentNode.kind === Kind.INPUT_OBJECT_TYPE_DEFINITION ? DirectiveLocation.INPUT_FIELD_DEFINITION : DirectiveLocation.ARGUMENT_DEFINITION; - } - // Not reachable, all possible types have been considered. - /* c8 ignore next */ - default: - invariant(false, "Unexpected kind: " + inspect(appliedTo.kind)); - } -} -function getDirectiveLocationForOperation(operation) { - switch (operation) { - case OperationTypeNode.QUERY: - return DirectiveLocation.QUERY; - case OperationTypeNode.MUTATION: - return DirectiveLocation.MUTATION; - case OperationTypeNode.SUBSCRIPTION: - return DirectiveLocation.SUBSCRIPTION; - } -} - -// ../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/validation/rules/KnownFragmentNamesRule.mjs -function KnownFragmentNamesRule(context) { - return { - FragmentSpread(node) { - const fragmentName = node.name.value; - const fragment = context.getFragment(fragmentName); - if (!fragment) { - context.reportError( - new GraphQLError(`Unknown fragment "${fragmentName}".`, { - nodes: node.name - }) - ); - } - } - }; -} - -// ../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/validation/rules/KnownTypeNamesRule.mjs -function KnownTypeNamesRule(context) { - const schema = context.getSchema(); - const existingTypesMap = schema ? schema.getTypeMap() : /* @__PURE__ */ Object.create(null); - const definedTypes = /* @__PURE__ */ Object.create(null); - for (const def of context.getDocument().definitions) { - if (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 = suggestionList( - typeName, - isSDL ? standardTypeNames.concat(typeNames) : typeNames - ); - context.reportError( - new GraphQLError( - `Unknown type "${typeName}".` + didYouMean(suggestedTypes), - { - nodes: node - } - ) - ); - } - } - }; -} -var standardTypeNames = [...specifiedScalarTypes, ...introspectionTypes].map( - (type) => type.name -); -function isSDLNode(value) { - return "kind" in value && (isTypeSystemDefinitionNode(value) || isTypeSystemExtensionNode(value)); -} - -// ../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/validation/rules/LoneAnonymousOperationRule.mjs -function LoneAnonymousOperationRule(context) { - let operationCount = 0; - return { - Document(node) { - operationCount = node.definitions.filter( - (definition) => definition.kind === Kind.OPERATION_DEFINITION - ).length; - }, - OperationDefinition(node) { - if (!node.name && operationCount > 1) { - context.reportError( - new GraphQLError( - "This anonymous operation must be the only defined operation.", - { - nodes: node - } - ) - ); - } - } - }; -} - -// ../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/validation/rules/LoneSchemaDefinitionRule.mjs -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 GraphQLError( - "Cannot define a new schema within a schema extension.", - { - nodes: node - } - ) - ); - return; - } - if (schemaDefinitionsCount > 0) { - context.reportError( - new GraphQLError("Must provide only one schema definition.", { - nodes: node - }) - ); - } - ++schemaDefinitionsCount; - } - }; -} - -// ../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/validation/rules/MaxIntrospectionDepthRule.mjs -var MAX_LISTS_DEPTH = 3; -function MaxIntrospectionDepthRule(context) { - function checkDepth(node, visitedFragments = /* @__PURE__ */ Object.create(null), depth = 0) { - if (node.kind === Kind.FRAGMENT_SPREAD) { - const fragmentName = node.name.value; - if (visitedFragments[fragmentName] === true) { - return false; - } - const fragment = context.getFragment(fragmentName); - if (!fragment) { - return false; - } - try { - visitedFragments[fragmentName] = true; - return checkDepth(fragment, visitedFragments, depth); - } finally { - visitedFragments[fragmentName] = void 0; - } - } - if (node.kind === Kind.FIELD && // check all introspection lists - (node.name.value === "fields" || node.name.value === "interfaces" || node.name.value === "possibleTypes" || node.name.value === "inputFields")) { - depth++; - if (depth >= MAX_LISTS_DEPTH) { - return true; - } - } - if ("selectionSet" in node && node.selectionSet) { - for (const child of node.selectionSet.selections) { - if (checkDepth(child, visitedFragments, depth)) { - return true; - } - } - } - return false; - } - return { - Field(node) { - if (node.name.value === "__schema" || node.name.value === "__type") { - if (checkDepth(node)) { - context.reportError( - new GraphQLError("Maximum introspection depth exceeded", { - nodes: [node] - }) - ); - return false; - } - } - } - }; -} - -// ../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/validation/rules/NoFragmentCyclesRule.mjs -function NoFragmentCyclesRule(context) { - const visitedFrags = /* @__PURE__ */ Object.create(null); - const spreadPath = []; - const spreadPathIndexByName = /* @__PURE__ */ Object.create(null); - return { - OperationDefinition: () => false, - FragmentDefinition(node) { - detectCycleRecursive(node); - return false; - } - }; - 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 === void 0) { - 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 GraphQLError( - `Cannot spread fragment "${spreadName}" within itself` + (viaPath !== "" ? ` via ${viaPath}.` : "."), - { - nodes: cyclePath - } - ) - ); - } - spreadPath.pop(); - } - spreadPathIndexByName[fragmentName] = void 0; - } -} - -// ../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/validation/rules/NoUndefinedVariablesRule.mjs -function NoUndefinedVariablesRule(context) { - let variableNameDefined = /* @__PURE__ */ Object.create(null); - return { - OperationDefinition: { - enter() { - variableNameDefined = /* @__PURE__ */ 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 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/.bun/graphql@16.12.0/node_modules/graphql/validation/rules/NoUnusedFragmentsRule.mjs -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 = /* @__PURE__ */ 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 GraphQLError(`Fragment "${fragName}" is never used.`, { - nodes: fragmentDef - }) - ); - } - } - } - } - }; -} - -// ../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/validation/rules/NoUnusedVariablesRule.mjs -function NoUnusedVariablesRule(context) { - let variableDefs = []; - return { - OperationDefinition: { - enter() { - variableDefs = []; - }, - leave(operation) { - const variableNameUsed = /* @__PURE__ */ 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 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/.bun/graphql@16.12.0/node_modules/graphql/utilities/sortValueNode.mjs -function sortValueNode(valueNode) { - switch (valueNode.kind) { - case Kind.OBJECT: - return { ...valueNode, fields: sortFields(valueNode.fields) }; - case Kind.LIST: - return { ...valueNode, values: valueNode.values.map(sortValueNode) }; - case Kind.INT: - case Kind.FLOAT: - case Kind.STRING: - case Kind.BOOLEAN: - case Kind.NULL: - case Kind.ENUM: - case Kind.VARIABLE: - return valueNode; - } -} -function sortFields(fields) { - return fields.map((fieldNode) => ({ - ...fieldNode, - value: sortValueNode(fieldNode.value) - })).sort( - (fieldA, fieldB) => naturalCompare(fieldA.name.value, fieldB.name.value) - ); -} - -// ../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/validation/rules/OverlappingFieldsCanBeMergedRule.mjs -function reasonMessage(reason) { - if (Array.isArray(reason)) { - return reason.map( - ([responseName, subReason]) => `subfields "${responseName}" conflict because ` + reasonMessage(subReason) - ).join(" and "); - } - return reason; -} -function OverlappingFieldsCanBeMergedRule(context) { - const comparedFieldsAndFragmentPairs = new OrderedPairSet(); - const comparedFragmentPairs = new PairSet(); - const cachedFieldsAndFragmentNames = /* @__PURE__ */ new Map(); - return { - SelectionSet(selectionSet) { - const conflicts = findConflictsWithinSelectionSet( - context, - cachedFieldsAndFragmentNames, - comparedFieldsAndFragmentPairs, - comparedFragmentPairs, - context.getParentType(), - selectionSet - ); - for (const [[responseName, reason], fields1, fields2] of conflicts) { - const reasonMsg = reasonMessage(reason); - context.reportError( - new GraphQLError( - `Fields "${responseName}" conflict because ${reasonMsg}. Use different aliases on the fields to fetch both if this was intentional.`, - { - nodes: fields1.concat(fields2) - } - ) - ); - } - } - }; -} -function findConflictsWithinSelectionSet(context, cachedFieldsAndFragmentNames, comparedFieldsAndFragmentPairs, comparedFragmentPairs, parentType, selectionSet) { - const conflicts = []; - const [fieldMap, fragmentNames] = getFieldsAndFragmentNames( - context, - cachedFieldsAndFragmentNames, - parentType, - selectionSet - ); - collectConflictsWithin( - context, - conflicts, - cachedFieldsAndFragmentNames, - comparedFieldsAndFragmentPairs, - comparedFragmentPairs, - fieldMap - ); - if (fragmentNames.length !== 0) { - for (let i = 0; i < fragmentNames.length; i++) { - collectConflictsBetweenFieldsAndFragment( - context, - conflicts, - cachedFieldsAndFragmentNames, - comparedFieldsAndFragmentPairs, - comparedFragmentPairs, - false, - fieldMap, - fragmentNames[i] - ); - for (let j = i + 1; j < fragmentNames.length; j++) { - collectConflictsBetweenFragments( - context, - conflicts, - cachedFieldsAndFragmentNames, - comparedFieldsAndFragmentPairs, - comparedFragmentPairs, - false, - fragmentNames[i], - fragmentNames[j] - ); - } - } - } - return conflicts; -} -function collectConflictsBetweenFieldsAndFragment(context, conflicts, cachedFieldsAndFragmentNames, comparedFieldsAndFragmentPairs, comparedFragmentPairs, areMutuallyExclusive, fieldMap, fragmentName) { - if (comparedFieldsAndFragmentPairs.has( - fieldMap, - fragmentName, - areMutuallyExclusive - )) { - return; - } - comparedFieldsAndFragmentPairs.add( - fieldMap, - fragmentName, - areMutuallyExclusive - ); - const fragment = context.getFragment(fragmentName); - if (!fragment) { - return; - } - const [fieldMap2, referencedFragmentNames] = getReferencedFieldsAndFragmentNames( - context, - cachedFieldsAndFragmentNames, - fragment - ); - if (fieldMap === fieldMap2) { - return; - } - collectConflictsBetween( - context, - conflicts, - cachedFieldsAndFragmentNames, - comparedFieldsAndFragmentPairs, - comparedFragmentPairs, - areMutuallyExclusive, - fieldMap, - fieldMap2 - ); - for (const referencedFragmentName of referencedFragmentNames) { - collectConflictsBetweenFieldsAndFragment( - context, - conflicts, - cachedFieldsAndFragmentNames, - comparedFieldsAndFragmentPairs, - comparedFragmentPairs, - areMutuallyExclusive, - fieldMap, - referencedFragmentName - ); - } -} -function collectConflictsBetweenFragments(context, conflicts, cachedFieldsAndFragmentNames, comparedFieldsAndFragmentPairs, comparedFragmentPairs, areMutuallyExclusive, fragmentName1, fragmentName2) { - if (fragmentName1 === fragmentName2) { - return; - } - 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 - ); - collectConflictsBetween( - context, - conflicts, - cachedFieldsAndFragmentNames, - comparedFieldsAndFragmentPairs, - comparedFragmentPairs, - areMutuallyExclusive, - fieldMap1, - fieldMap2 - ); - for (const referencedFragmentName2 of referencedFragmentNames2) { - collectConflictsBetweenFragments( - context, - conflicts, - cachedFieldsAndFragmentNames, - comparedFieldsAndFragmentPairs, - comparedFragmentPairs, - areMutuallyExclusive, - fragmentName1, - referencedFragmentName2 - ); - } - for (const referencedFragmentName1 of referencedFragmentNames1) { - collectConflictsBetweenFragments( - context, - conflicts, - cachedFieldsAndFragmentNames, - comparedFieldsAndFragmentPairs, - comparedFragmentPairs, - areMutuallyExclusive, - referencedFragmentName1, - fragmentName2 - ); - } -} -function findConflictsBetweenSubSelectionSets(context, cachedFieldsAndFragmentNames, comparedFieldsAndFragmentPairs, comparedFragmentPairs, areMutuallyExclusive, parentType1, selectionSet1, parentType2, selectionSet2) { - const conflicts = []; - const [fieldMap1, fragmentNames1] = getFieldsAndFragmentNames( - context, - cachedFieldsAndFragmentNames, - parentType1, - selectionSet1 - ); - const [fieldMap2, fragmentNames2] = getFieldsAndFragmentNames( - context, - cachedFieldsAndFragmentNames, - parentType2, - selectionSet2 - ); - collectConflictsBetween( - context, - conflicts, - cachedFieldsAndFragmentNames, - comparedFieldsAndFragmentPairs, - comparedFragmentPairs, - areMutuallyExclusive, - fieldMap1, - fieldMap2 - ); - for (const fragmentName2 of fragmentNames2) { - collectConflictsBetweenFieldsAndFragment( - context, - conflicts, - cachedFieldsAndFragmentNames, - comparedFieldsAndFragmentPairs, - comparedFragmentPairs, - areMutuallyExclusive, - fieldMap1, - fragmentName2 - ); - } - for (const fragmentName1 of fragmentNames1) { - collectConflictsBetweenFieldsAndFragment( - context, - conflicts, - cachedFieldsAndFragmentNames, - comparedFieldsAndFragmentPairs, - comparedFragmentPairs, - areMutuallyExclusive, - fieldMap2, - fragmentName1 - ); - } - for (const fragmentName1 of fragmentNames1) { - for (const fragmentName2 of fragmentNames2) { - collectConflictsBetweenFragments( - context, - conflicts, - cachedFieldsAndFragmentNames, - comparedFieldsAndFragmentPairs, - comparedFragmentPairs, - areMutuallyExclusive, - fragmentName1, - fragmentName2 - ); - } - } - return conflicts; -} -function collectConflictsWithin(context, conflicts, cachedFieldsAndFragmentNames, comparedFieldsAndFragmentPairs, comparedFragmentPairs, fieldMap) { - for (const [responseName, fields] of Object.entries(fieldMap)) { - 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, - comparedFieldsAndFragmentPairs, - comparedFragmentPairs, - false, - // within one collection is never mutually exclusive - responseName, - fields[i], - fields[j] - ); - if (conflict) { - conflicts.push(conflict); - } - } - } - } - } -} -function collectConflictsBetween(context, conflicts, cachedFieldsAndFragmentNames, comparedFieldsAndFragmentPairs, comparedFragmentPairs, parentFieldsAreMutuallyExclusive, fieldMap1, fieldMap2) { - 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, - comparedFieldsAndFragmentPairs, - comparedFragmentPairs, - parentFieldsAreMutuallyExclusive, - responseName, - field1, - field2 - ); - if (conflict) { - conflicts.push(conflict); - } - } - } - } - } -} -function findConflict(context, cachedFieldsAndFragmentNames, comparedFieldsAndFragmentPairs, comparedFragmentPairs, parentFieldsAreMutuallyExclusive, responseName, field1, field2) { - const [parentType1, node1, def1] = field1; - const [parentType2, node2, def2] = field2; - const areMutuallyExclusive = parentFieldsAreMutuallyExclusive || parentType1 !== parentType2 && isObjectType(parentType1) && isObjectType(parentType2); - if (!areMutuallyExclusive) { - const name1 = node1.name.value; - const name2 = node2.name.value; - if (name1 !== name2) { - return [ - [responseName, `"${name1}" and "${name2}" are different fields`], - [node1], - [node2] - ]; - } - if (!sameArguments(node1, node2)) { - return [ - [responseName, "they have differing arguments"], - [node1], - [node2] - ]; - } - } - 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 "${inspect(type1)}" and "${inspect( - type2 - )}"` - ], - [node1], - [node2] - ]; - } - const selectionSet1 = node1.selectionSet; - const selectionSet2 = node2.selectionSet; - if (selectionSet1 && selectionSet2) { - const conflicts = findConflictsBetweenSubSelectionSets( - context, - cachedFieldsAndFragmentNames, - comparedFieldsAndFragmentPairs, - comparedFragmentPairs, - areMutuallyExclusive, - getNamedType(type1), - selectionSet1, - getNamedType(type2), - selectionSet2 - ); - return subfieldConflicts(conflicts, responseName, node1, node2); - } -} -function sameArguments(node1, node2) { - const args1 = node1.arguments; - const args2 = node2.arguments; - if (args1 === void 0 || args1.length === 0) { - return args2 === void 0 || args2.length === 0; - } - if (args2 === void 0 || args2.length === 0) { - return false; - } - if (args1.length !== args2.length) { - return false; - } - const values2 = new Map(args2.map(({ name, value }) => [name.value, value])); - return args1.every((arg1) => { - const value1 = arg1.value; - const value2 = values2.get(arg1.name.value); - if (value2 === void 0) { - return false; - } - return stringifyValue(value1) === stringifyValue(value2); - }); -} -function stringifyValue(value) { - return print(sortValueNode(value)); -} -function doTypesConflict(type1, type2) { - if (isListType(type1)) { - return isListType(type2) ? doTypesConflict(type1.ofType, type2.ofType) : true; - } - if (isListType(type2)) { - return true; - } - if (isNonNullType(type1)) { - return isNonNullType(type2) ? doTypesConflict(type1.ofType, type2.ofType) : true; - } - if (isNonNullType(type2)) { - return true; - } - if (isLeafType(type1) || isLeafType(type2)) { - return type1 !== type2; - } - return false; -} -function getFieldsAndFragmentNames(context, cachedFieldsAndFragmentNames, parentType, selectionSet) { - const cached = cachedFieldsAndFragmentNames.get(selectionSet); - if (cached) { - return cached; - } - const nodeAndDefs = /* @__PURE__ */ Object.create(null); - const fragmentNames = /* @__PURE__ */ Object.create(null); - _collectFieldsAndFragmentNames( - context, - parentType, - selectionSet, - nodeAndDefs, - fragmentNames - ); - const result = [nodeAndDefs, Object.keys(fragmentNames)]; - cachedFieldsAndFragmentNames.set(selectionSet, result); - return result; -} -function getReferencedFieldsAndFragmentNames(context, cachedFieldsAndFragmentNames, fragment) { - const cached = cachedFieldsAndFragmentNames.get(fragment.selectionSet); - if (cached) { - return cached; - } - const fragmentType = 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 Kind.FIELD: { - const fieldName = selection.name.value; - let fieldDef; - if (isObjectType(parentType) || 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 Kind.FRAGMENT_SPREAD: - fragmentNames[selection.name.value] = true; - break; - case Kind.INLINE_FRAGMENT: { - const typeCondition = selection.typeCondition; - const inlineFragmentType = typeCondition ? typeFromAST(context.getSchema(), typeCondition) : parentType; - _collectFieldsAndFragmentNames( - context, - inlineFragmentType, - selection.selectionSet, - nodeAndDefs, - fragmentNames - ); - break; - } - } - } -} -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()] - ]; - } -} -var OrderedPairSet = class { - constructor() { - this._data = /* @__PURE__ */ new Map(); - } - has(a, b, weaklyPresent) { - var _this$_data$get; - const result = (_this$_data$get = this._data.get(a)) === null || _this$_data$get === void 0 ? void 0 : _this$_data$get.get(b); - if (result === void 0) { - return false; - } - return weaklyPresent ? true : weaklyPresent === result; - } - add(a, b, weaklyPresent) { - const map = this._data.get(a); - if (map === void 0) { - this._data.set(a, /* @__PURE__ */ new Map([[b, weaklyPresent]])); - } else { - map.set(b, weaklyPresent); - } - } -}; -var PairSet = class { - constructor() { - this._orderedPairSet = new OrderedPairSet(); - } - has(a, b, weaklyPresent) { - return a < b ? this._orderedPairSet.has(a, b, weaklyPresent) : this._orderedPairSet.has(b, a, weaklyPresent); - } - add(a, b, weaklyPresent) { - if (a < b) { - this._orderedPairSet.add(a, b, weaklyPresent); - } else { - this._orderedPairSet.add(b, a, weaklyPresent); - } - } -}; - -// ../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/validation/rules/PossibleFragmentSpreadsRule.mjs -function PossibleFragmentSpreadsRule(context) { - return { - InlineFragment(node) { - const fragType = context.getType(); - const parentType = context.getParentType(); - if (isCompositeType(fragType) && isCompositeType(parentType) && !doTypesOverlap(context.getSchema(), fragType, parentType)) { - const parentTypeStr = inspect(parentType); - const fragTypeStr = inspect(fragType); - context.reportError( - new 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 && !doTypesOverlap(context.getSchema(), fragType, parentType)) { - const parentTypeStr = inspect(parentType); - const fragTypeStr = inspect(fragType); - context.reportError( - new 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 = typeFromAST(context.getSchema(), frag.typeCondition); - if (isCompositeType(type)) { - return type; - } - } -} - -// ../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/validation/rules/PossibleTypeExtensionsRule.mjs -function PossibleTypeExtensionsRule(context) { - const schema = context.getSchema(); - const definedTypes = /* @__PURE__ */ Object.create(null); - for (const def of context.getDocument().definitions) { - if (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 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 = suggestionList(typeName, allTypeNames); - context.reportError( - new GraphQLError( - `Cannot extend type "${typeName}" because it is not defined.` + didYouMean(suggestedTypes), - { - nodes: node.name - } - ) - ); - } - } -} -var defKindToExtKind = { - [Kind.SCALAR_TYPE_DEFINITION]: Kind.SCALAR_TYPE_EXTENSION, - [Kind.OBJECT_TYPE_DEFINITION]: Kind.OBJECT_TYPE_EXTENSION, - [Kind.INTERFACE_TYPE_DEFINITION]: Kind.INTERFACE_TYPE_EXTENSION, - [Kind.UNION_TYPE_DEFINITION]: Kind.UNION_TYPE_EXTENSION, - [Kind.ENUM_TYPE_DEFINITION]: Kind.ENUM_TYPE_EXTENSION, - [Kind.INPUT_OBJECT_TYPE_DEFINITION]: Kind.INPUT_OBJECT_TYPE_EXTENSION -}; -function typeToExtKind(type) { - if (isScalarType(type)) { - return Kind.SCALAR_TYPE_EXTENSION; - } - if (isObjectType(type)) { - return Kind.OBJECT_TYPE_EXTENSION; - } - if (isInterfaceType(type)) { - return Kind.INTERFACE_TYPE_EXTENSION; - } - if (isUnionType(type)) { - return Kind.UNION_TYPE_EXTENSION; - } - if (isEnumType(type)) { - return Kind.ENUM_TYPE_EXTENSION; - } - if (isInputObjectType(type)) { - return Kind.INPUT_OBJECT_TYPE_EXTENSION; - } - invariant(false, "Unexpected type: " + inspect(type)); -} -function extensionKindToTypeName(kind) { - switch (kind) { - case Kind.SCALAR_TYPE_EXTENSION: - return "scalar"; - case Kind.OBJECT_TYPE_EXTENSION: - return "object"; - case Kind.INTERFACE_TYPE_EXTENSION: - return "interface"; - case Kind.UNION_TYPE_EXTENSION: - return "union"; - case Kind.ENUM_TYPE_EXTENSION: - return "enum"; - case Kind.INPUT_OBJECT_TYPE_EXTENSION: - return "input object"; - // Not reachable. All possible types have been considered - /* c8 ignore next */ - default: - invariant(false, "Unexpected kind: " + inspect(kind)); - } -} - -// ../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/validation/rules/ProvidedRequiredArgumentsRule.mjs -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) && isRequiredArgument(argDef)) { - const argTypeStr = inspect(argDef.type); - context.reportError( - new GraphQLError( - `Field "${fieldDef.name}" argument "${argDef.name}" of type "${argTypeStr}" is required, but it was not provided.`, - { - nodes: fieldNode - } - ) - ); - } - } - } - } - }; -} -function ProvidedRequiredArgumentsOnDirectivesRule(context) { - var _schema$getDirectives; - const requiredArgsMap = /* @__PURE__ */ 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 : specifiedDirectives; - for (const directive of definedDirectives) { - requiredArgsMap[directive.name] = keyMap( - directive.args.filter(isRequiredArgument), - (arg) => arg.name - ); - } - const astDefinitions = context.getDocument().definitions; - for (const def of astDefinitions) { - if (def.kind === Kind.DIRECTIVE_DEFINITION) { - var _def$arguments; - const argNodes = (_def$arguments = def.arguments) !== null && _def$arguments !== void 0 ? _def$arguments : []; - requiredArgsMap[def.name.value] = 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; - 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 = isType(argDef.type) ? inspect(argDef.type) : print(argDef.type); - context.reportError( - new GraphQLError( - `Directive "@${directiveName}" argument "${argName}" of type "${argType}" is required, but it was not provided.`, - { - nodes: directiveNode - } - ) - ); - } - } - } - } - } - }; -} -function isRequiredArgumentNode(arg) { - return arg.type.kind === Kind.NON_NULL_TYPE && arg.defaultValue == null; -} - -// ../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/validation/rules/ScalarLeafsRule.mjs -function ScalarLeafsRule(context) { - return { - Field(node) { - const type = context.getType(); - const selectionSet = node.selectionSet; - if (type) { - if (isLeafType(getNamedType(type))) { - if (selectionSet) { - const fieldName = node.name.value; - const typeStr = inspect(type); - context.reportError( - new 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 = inspect(type); - context.reportError( - new GraphQLError( - `Field "${fieldName}" of type "${typeStr}" must have a selection of subfields. Did you mean "${fieldName} { ... }"?`, - { - nodes: node - } - ) - ); - } else if (selectionSet.selections.length === 0) { - const fieldName = node.name.value; - const typeStr = inspect(type); - context.reportError( - new GraphQLError( - `Field "${fieldName}" of type "${typeStr}" must have at least one field selected.`, - { - nodes: node - } - ) - ); - } - } - } - }; -} - -// ../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/jsutils/printPathArray.mjs -function printPathArray(path) { - return path.map( - (key) => typeof key === "number" ? "[" + key.toString() + "]" : "." + key - ).join(""); -} - -// ../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/jsutils/Path.mjs -function addPath(prev, key, typename) { - return { - prev, - key, - typename - }; -} -function pathToArray(path) { - const flattened = []; - let curr = path; - while (curr) { - flattened.push(curr.key); - curr = curr.prev; - } - return flattened.reverse(); -} - -// ../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/utilities/coerceInputValue.mjs -function coerceInputValue(inputValue, type, onError = defaultOnError) { - return coerceInputValueImpl(inputValue, type, onError, void 0); -} -function defaultOnError(path, invalidValue, error) { - let errorPrefix = "Invalid value " + inspect(invalidValue); - if (path.length > 0) { - errorPrefix += ` at "value${printPathArray(path)}"`; - } - error.message = errorPrefix + ": " + error.message; - throw error; -} -function coerceInputValueImpl(inputValue, type, onError, path) { - if (isNonNullType(type)) { - if (inputValue != null) { - return coerceInputValueImpl(inputValue, type.ofType, onError, path); - } - onError( - pathToArray(path), - inputValue, - new GraphQLError( - `Expected non-nullable type "${inspect(type)}" not to be null.` - ) - ); - return; - } - if (inputValue == null) { - return null; - } - if (isListType(type)) { - const itemType = type.ofType; - if (isIterableObject(inputValue)) { - return Array.from(inputValue, (itemValue, index) => { - const itemPath = addPath(path, index, void 0); - return coerceInputValueImpl(itemValue, itemType, onError, itemPath); - }); - } - return [coerceInputValueImpl(inputValue, itemType, onError, path)]; - } - if (isInputObjectType(type)) { - if (!isObjectLike(inputValue) || Array.isArray(inputValue)) { - onError( - pathToArray(path), - inputValue, - new 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 === void 0) { - if (field.defaultValue !== void 0) { - coercedValue[field.name] = field.defaultValue; - } else if (isNonNullType(field.type)) { - const typeStr = inspect(field.type); - onError( - pathToArray(path), - inputValue, - new GraphQLError( - `Field "${field.name}" of required type "${typeStr}" was not provided.` - ) - ); - } - continue; - } - coercedValue[field.name] = coerceInputValueImpl( - fieldValue, - field.type, - onError, - addPath(path, field.name, type.name) - ); - } - for (const fieldName of Object.keys(inputValue)) { - if (!fieldDefs[fieldName]) { - const suggestions = suggestionList( - fieldName, - Object.keys(type.getFields()) - ); - onError( - pathToArray(path), - inputValue, - new GraphQLError( - `Field "${fieldName}" is not defined by type "${type.name}".` + didYouMean(suggestions) - ) - ); - } - } - if (type.isOneOf) { - const keys = Object.keys(coercedValue); - if (keys.length !== 1) { - onError( - pathToArray(path), - inputValue, - new GraphQLError( - `Exactly one key must be specified for OneOf type "${type.name}".` - ) - ); - } - const key = keys[0]; - const value = coercedValue[key]; - if (value === null) { - onError( - pathToArray(path).concat(key), - value, - new GraphQLError(`Field "${key}" must be non-null.`) - ); - } - } - return coercedValue; - } - if (isLeafType(type)) { - let parseResult; - try { - parseResult = type.parseValue(inputValue); - } catch (error) { - if (error instanceof GraphQLError) { - onError(pathToArray(path), inputValue, error); - } else { - onError( - pathToArray(path), - inputValue, - new GraphQLError(`Expected type "${type.name}". ` + error.message, { - originalError: error - }) - ); - } - return; - } - if (parseResult === void 0) { - onError( - pathToArray(path), - inputValue, - new GraphQLError(`Expected type "${type.name}".`) - ); - } - return parseResult; - } - invariant(false, "Unexpected input type: " + inspect(type)); -} - -// ../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/utilities/valueFromAST.mjs -function valueFromAST(valueNode, type, variables) { - if (!valueNode) { - return; - } - if (valueNode.kind === Kind.VARIABLE) { - const variableName = valueNode.name.value; - if (variables == null || variables[variableName] === void 0) { - return; - } - const variableValue = variables[variableName]; - if (variableValue === null && isNonNullType(type)) { - return; - } - return variableValue; - } - if (isNonNullType(type)) { - if (valueNode.kind === Kind.NULL) { - return; - } - return valueFromAST(valueNode, type.ofType, variables); - } - if (valueNode.kind === Kind.NULL) { - return null; - } - if (isListType(type)) { - const itemType = type.ofType; - if (valueNode.kind === Kind.LIST) { - const coercedValues = []; - for (const itemNode of valueNode.values) { - if (isMissingVariable(itemNode, variables)) { - if (isNonNullType(itemType)) { - return; - } - coercedValues.push(null); - } else { - const itemValue = valueFromAST(itemNode, itemType, variables); - if (itemValue === void 0) { - return; - } - coercedValues.push(itemValue); - } - } - return coercedValues; - } - const coercedValue = valueFromAST(valueNode, itemType, variables); - if (coercedValue === void 0) { - return; - } - return [coercedValue]; - } - if (isInputObjectType(type)) { - if (valueNode.kind !== Kind.OBJECT) { - return; - } - const coercedObj = /* @__PURE__ */ Object.create(null); - const fieldNodes = 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 !== void 0) { - coercedObj[field.name] = field.defaultValue; - } else if (isNonNullType(field.type)) { - return; - } - continue; - } - const fieldValue = valueFromAST(fieldNode.value, field.type, variables); - if (fieldValue === void 0) { - return; - } - coercedObj[field.name] = fieldValue; - } - if (type.isOneOf) { - const keys = Object.keys(coercedObj); - if (keys.length !== 1) { - return; - } - if (coercedObj[keys[0]] === null) { - return; - } - } - return coercedObj; - } - if (isLeafType(type)) { - let result; - try { - result = type.parseLiteral(valueNode, variables); - } catch (_error) { - return; - } - if (result === void 0) { - return; - } - return result; - } - invariant(false, "Unexpected input type: " + inspect(type)); -} -function isMissingVariable(valueNode, variables) { - return valueNode.kind === Kind.VARIABLE && (variables == null || variables[valueNode.name.value] === void 0); -} - -// ../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/execution/values.mjs -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 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 = typeFromAST(schema, varDefNode.type); - if (!isInputType(varType)) { - const varTypeStr = print(varDefNode.type); - onError( - new 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] = valueFromAST(varDefNode.defaultValue, varType); - } else if (isNonNullType(varType)) { - const varTypeStr = inspect(varType); - onError( - new GraphQLError( - `Variable "$${varName}" of required type "${varTypeStr}" was not provided.`, - { - nodes: varDefNode - } - ) - ); - } - continue; - } - const value = inputs[varName]; - if (value === null && isNonNullType(varType)) { - const varTypeStr = inspect(varType); - onError( - new GraphQLError( - `Variable "$${varName}" of non-null type "${varTypeStr}" must not be null.`, - { - nodes: varDefNode - } - ) - ); - continue; - } - coercedValues[varName] = coerceInputValue( - value, - varType, - (path, invalidValue, error) => { - let prefix = `Variable "$${varName}" got invalid value ` + inspect(invalidValue); - if (path.length > 0) { - prefix += ` at "${varName}${printPathArray(path)}"`; - } - onError( - new GraphQLError(prefix + "; " + error.message, { - nodes: varDefNode, - originalError: error - }) - ); - } - ); - } - return coercedValues; -} -function getArgumentValues(def, node, variableValues) { - var _node$arguments; - const coercedValues = {}; - const argumentNodes = (_node$arguments = node.arguments) !== null && _node$arguments !== void 0 ? _node$arguments : []; - const argNodeMap = 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 !== void 0) { - coercedValues[name] = argDef.defaultValue; - } else if (isNonNullType(argType)) { - throw new GraphQLError( - `Argument "${name}" of required type "${inspect(argType)}" was not provided.`, - { - nodes: node - } - ); - } - continue; - } - const valueNode = argumentNode.value; - let isNull = valueNode.kind === Kind.NULL; - if (valueNode.kind === Kind.VARIABLE) { - const variableName = valueNode.name.value; - if (variableValues == null || !hasOwnProperty(variableValues, variableName)) { - if (argDef.defaultValue !== void 0) { - coercedValues[name] = argDef.defaultValue; - } else if (isNonNullType(argType)) { - throw new GraphQLError( - `Argument "${name}" of required type "${inspect(argType)}" was provided the variable "$${variableName}" which was not provided a runtime value.`, - { - nodes: valueNode - } - ); - } - continue; - } - isNull = variableValues[variableName] == null; - } - if (isNull && isNonNullType(argType)) { - throw new GraphQLError( - `Argument "${name}" of non-null type "${inspect(argType)}" must not be null.`, - { - nodes: valueNode - } - ); - } - const coercedValue = valueFromAST(valueNode, argType, variableValues); - if (coercedValue === void 0) { - throw new GraphQLError( - `Argument "${name}" has invalid value ${print(valueNode)}.`, - { - nodes: valueNode - } - ); - } - coercedValues[name] = coercedValue; - } - return coercedValues; -} -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/.bun/graphql@16.12.0/node_modules/graphql/execution/collectFields.mjs -function collectFields(schema, fragments, variableValues, runtimeType, selectionSet) { - const fields = /* @__PURE__ */ new Map(); - collectFieldsImpl( - schema, - fragments, - variableValues, - runtimeType, - selectionSet, - fields, - /* @__PURE__ */ new Set() - ); - return fields; -} -function collectSubfields(schema, fragments, variableValues, returnType, fieldNodes) { - const subFieldNodes = /* @__PURE__ */ new Map(); - const visitedFragmentNames = /* @__PURE__ */ 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 Kind.FIELD: { - if (!shouldIncludeNode(variableValues, selection)) { - continue; - } - const name = getFieldEntryKey(selection); - const fieldList = fields.get(name); - if (fieldList !== void 0) { - fieldList.push(selection); - } else { - fields.set(name, [selection]); - } - break; - } - case Kind.INLINE_FRAGMENT: { - if (!shouldIncludeNode(variableValues, selection) || !doesFragmentConditionMatch(schema, selection, runtimeType)) { - continue; - } - collectFieldsImpl( - schema, - fragments, - variableValues, - runtimeType, - selection.selectionSet, - fields, - visitedFragmentNames - ); - break; - } - case 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; - } - } - } -} -function shouldIncludeNode(variableValues, node) { - const skip = getDirectiveValues(GraphQLSkipDirective, node, variableValues); - if ((skip === null || skip === void 0 ? void 0 : skip.if) === true) { - return false; - } - const include = getDirectiveValues( - GraphQLIncludeDirective, - node, - variableValues - ); - if ((include === null || include === void 0 ? void 0 : include.if) === false) { - return false; - } - return true; -} -function doesFragmentConditionMatch(schema, fragment, type) { - const typeConditionNode = fragment.typeCondition; - if (!typeConditionNode) { - return true; - } - const conditionalType = typeFromAST(schema, typeConditionNode); - if (conditionalType === type) { - return true; - } - if (isAbstractType(conditionalType)) { - return schema.isSubType(conditionalType, type); - } - return false; -} -function getFieldEntryKey(node) { - return node.alias ? node.alias.value : node.name.value; -} - -// ../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/validation/rules/SingleFieldSubscriptionsRule.mjs -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 = /* @__PURE__ */ Object.create(null); - const document = context.getDocument(); - const fragments = /* @__PURE__ */ Object.create(null); - for (const definition of document.definitions) { - if (definition.kind === Kind.FRAGMENT_DEFINITION) { - fragments[definition.name.value] = definition; - } - } - const fields = 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 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 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/.bun/graphql@16.12.0/node_modules/graphql/jsutils/groupBy.mjs -function groupBy(list, keyFn) { - const result = /* @__PURE__ */ new Map(); - for (const item of list) { - const key = keyFn(item); - const group = result.get(key); - if (group === void 0) { - result.set(key, [item]); - } else { - group.push(item); - } - } - return result; -} - -// ../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/validation/rules/UniqueArgumentDefinitionNamesRule.mjs -function UniqueArgumentDefinitionNamesRule(context) { - return { - DirectiveDefinition(directiveNode) { - var _directiveNode$argume; - 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; - 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; - 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 = groupBy(argumentNodes, (arg) => arg.name.value); - for (const [argName, argNodes] of seenArgs) { - if (argNodes.length > 1) { - context.reportError( - new GraphQLError( - `Argument "${parentName}(${argName}:)" can only be defined once.`, - { - nodes: argNodes.map((node) => node.name) - } - ) - ); - } - } - return false; - } -} - -// ../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/validation/rules/UniqueArgumentNamesRule.mjs -function UniqueArgumentNamesRule(context) { - return { - Field: checkArgUniqueness, - Directive: checkArgUniqueness - }; - function checkArgUniqueness(parentNode) { - var _parentNode$arguments; - const argumentNodes = (_parentNode$arguments = parentNode.arguments) !== null && _parentNode$arguments !== void 0 ? _parentNode$arguments : []; - const seenArgs = groupBy(argumentNodes, (arg) => arg.name.value); - for (const [argName, argNodes] of seenArgs) { - if (argNodes.length > 1) { - context.reportError( - new GraphQLError( - `There can be only one argument named "${argName}".`, - { - nodes: argNodes.map((node) => node.name) - } - ) - ); - } - } - } -} - -// ../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/validation/rules/UniqueDirectiveNamesRule.mjs -function UniqueDirectiveNamesRule(context) { - const knownDirectiveNames = /* @__PURE__ */ 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 GraphQLError( - `Directive "@${directiveName}" already exists in the schema. It cannot be redefined.`, - { - nodes: node.name - } - ) - ); - return; - } - if (knownDirectiveNames[directiveName]) { - context.reportError( - new GraphQLError( - `There can be only one directive named "@${directiveName}".`, - { - nodes: [knownDirectiveNames[directiveName], node.name] - } - ) - ); - } else { - knownDirectiveNames[directiveName] = node.name; - } - return false; - } - }; -} - -// ../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/validation/rules/UniqueDirectivesPerLocationRule.mjs -function UniqueDirectivesPerLocationRule(context) { - const uniqueDirectiveMap = /* @__PURE__ */ Object.create(null); - const schema = context.getSchema(); - const definedDirectives = schema ? schema.getDirectives() : specifiedDirectives; - for (const directive of definedDirectives) { - uniqueDirectiveMap[directive.name] = !directive.isRepeatable; - } - const astDefinitions = context.getDocument().definitions; - for (const def of astDefinitions) { - if (def.kind === Kind.DIRECTIVE_DEFINITION) { - uniqueDirectiveMap[def.name.value] = !def.repeatable; - } - } - const schemaDirectives = /* @__PURE__ */ Object.create(null); - const typeDirectivesMap = /* @__PURE__ */ 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 === Kind.SCHEMA_DEFINITION || node.kind === Kind.SCHEMA_EXTENSION) { - seenDirectives = schemaDirectives; - } else if (isTypeDefinitionNode(node) || isTypeExtensionNode(node)) { - const typeName = node.name.value; - seenDirectives = typeDirectivesMap[typeName]; - if (seenDirectives === void 0) { - typeDirectivesMap[typeName] = seenDirectives = /* @__PURE__ */ Object.create(null); - } - } else { - seenDirectives = /* @__PURE__ */ Object.create(null); - } - for (const directive of node.directives) { - const directiveName = directive.name.value; - if (uniqueDirectiveMap[directiveName]) { - if (seenDirectives[directiveName]) { - context.reportError( - new GraphQLError( - `The directive "@${directiveName}" can only be used once at this location.`, - { - nodes: [seenDirectives[directiveName], directive] - } - ) - ); - } else { - seenDirectives[directiveName] = directive; - } - } - } - } - }; -} - -// ../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/validation/rules/UniqueEnumValueNamesRule.mjs -function UniqueEnumValueNamesRule(context) { - const schema = context.getSchema(); - const existingTypeMap = schema ? schema.getTypeMap() : /* @__PURE__ */ Object.create(null); - const knownValueNames = /* @__PURE__ */ Object.create(null); - return { - EnumTypeDefinition: checkValueUniqueness, - EnumTypeExtension: checkValueUniqueness - }; - function checkValueUniqueness(node) { - var _node$values; - const typeName = node.name.value; - if (!knownValueNames[typeName]) { - knownValueNames[typeName] = /* @__PURE__ */ Object.create(null); - } - 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 (isEnumType(existingType) && existingType.getValue(valueName)) { - context.reportError( - new 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 GraphQLError( - `Enum value "${typeName}.${valueName}" can only be defined once.`, - { - nodes: [valueNames[valueName], valueDef.name] - } - ) - ); - } else { - valueNames[valueName] = valueDef.name; - } - } - return false; - } -} - -// ../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/validation/rules/UniqueFieldDefinitionNamesRule.mjs -function UniqueFieldDefinitionNamesRule(context) { - const schema = context.getSchema(); - const existingTypeMap = schema ? schema.getTypeMap() : /* @__PURE__ */ Object.create(null); - const knownFieldNames = /* @__PURE__ */ 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] = /* @__PURE__ */ Object.create(null); - } - 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 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 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 (isObjectType(type) || isInterfaceType(type) || isInputObjectType(type)) { - return type.getFields()[fieldName] != null; - } - return false; -} - -// ../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/validation/rules/UniqueFragmentNamesRule.mjs -function UniqueFragmentNamesRule(context) { - const knownFragmentNames = /* @__PURE__ */ Object.create(null); - return { - OperationDefinition: () => false, - FragmentDefinition(node) { - const fragmentName = node.name.value; - if (knownFragmentNames[fragmentName]) { - context.reportError( - new GraphQLError( - `There can be only one fragment named "${fragmentName}".`, - { - nodes: [knownFragmentNames[fragmentName], node.name] - } - ) - ); - } else { - knownFragmentNames[fragmentName] = node.name; - } - return false; - } - }; -} - -// ../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/validation/rules/UniqueInputFieldNamesRule.mjs -function UniqueInputFieldNamesRule(context) { - const knownNameStack = []; - let knownNames = /* @__PURE__ */ Object.create(null); - return { - ObjectValue: { - enter() { - knownNameStack.push(knownNames); - knownNames = /* @__PURE__ */ Object.create(null); - }, - leave() { - const prevKnownNames = knownNameStack.pop(); - prevKnownNames || invariant(false); - knownNames = prevKnownNames; - } - }, - ObjectField(node) { - const fieldName = node.name.value; - if (knownNames[fieldName]) { - context.reportError( - new GraphQLError( - `There can be only one input field named "${fieldName}".`, - { - nodes: [knownNames[fieldName], node.name] - } - ) - ); - } else { - knownNames[fieldName] = node.name; - } - } - }; -} - -// ../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/validation/rules/UniqueOperationNamesRule.mjs -function UniqueOperationNamesRule(context) { - const knownOperationNames = /* @__PURE__ */ Object.create(null); - return { - OperationDefinition(node) { - const operationName = node.name; - if (operationName) { - if (knownOperationNames[operationName.value]) { - context.reportError( - new 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/.bun/graphql@16.12.0/node_modules/graphql/validation/rules/UniqueOperationTypesRule.mjs -function UniqueOperationTypesRule(context) { - const schema = context.getSchema(); - const definedOperationTypes = /* @__PURE__ */ 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; - 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 GraphQLError( - `Type for ${operation} already defined in the schema. It cannot be redefined.`, - { - nodes: operationType - } - ) - ); - } else if (alreadyDefinedOperationType) { - context.reportError( - new GraphQLError( - `There can be only one ${operation} type in schema.`, - { - nodes: [alreadyDefinedOperationType, operationType] - } - ) - ); - } else { - definedOperationTypes[operation] = operationType; - } - } - return false; - } -} - -// ../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/validation/rules/UniqueTypeNamesRule.mjs -function UniqueTypeNamesRule(context) { - const knownTypeNames = /* @__PURE__ */ 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 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 GraphQLError(`There can be only one type named "${typeName}".`, { - nodes: [knownTypeNames[typeName], node.name] - }) - ); - } else { - knownTypeNames[typeName] = node.name; - } - return false; - } -} - -// ../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/validation/rules/UniqueVariableNamesRule.mjs -function UniqueVariableNamesRule(context) { - return { - OperationDefinition(operationNode) { - var _operationNode$variab; - const variableDefinitions = (_operationNode$variab = operationNode.variableDefinitions) !== null && _operationNode$variab !== void 0 ? _operationNode$variab : []; - const seenVariableDefinitions = groupBy( - variableDefinitions, - (node) => node.variable.name.value - ); - for (const [variableName, variableNodes] of seenVariableDefinitions) { - if (variableNodes.length > 1) { - context.reportError( - new GraphQLError( - `There can be only one variable named "$${variableName}".`, - { - nodes: variableNodes.map((node) => node.variable.name) - } - ) - ); - } - } - } - }; -} - -// ../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/validation/rules/ValuesOfCorrectTypeRule.mjs -function ValuesOfCorrectTypeRule(context) { - let variableDefinitions = {}; - return { - OperationDefinition: { - enter() { - variableDefinitions = {}; - } - }, - VariableDefinition(definition) { - variableDefinitions[definition.variable.name.value] = definition; - }, - ListValue(node) { - const type = getNullableType(context.getParentInputType()); - if (!isListType(type)) { - isValidValueNode(context, node); - return false; - } - }, - ObjectValue(node) { - const type = getNamedType(context.getInputType()); - if (!isInputObjectType(type)) { - isValidValueNode(context, node); - return false; - } - const fieldNodeMap = keyMap(node.fields, (field) => field.name.value); - for (const fieldDef of Object.values(type.getFields())) { - const fieldNode = fieldNodeMap[fieldDef.name]; - if (!fieldNode && isRequiredInputField(fieldDef)) { - const typeStr = inspect(fieldDef.type); - context.reportError( - new GraphQLError( - `Field "${type.name}.${fieldDef.name}" of required type "${typeStr}" was not provided.`, - { - nodes: node - } - ) - ); - } - } - if (type.isOneOf) { - validateOneOfInputObject(context, node, type, fieldNodeMap); - } - }, - ObjectField(node) { - const parentType = getNamedType(context.getParentInputType()); - const fieldType = context.getInputType(); - if (!fieldType && isInputObjectType(parentType)) { - const suggestions = suggestionList( - node.name.value, - Object.keys(parentType.getFields()) - ); - context.reportError( - new GraphQLError( - `Field "${node.name.value}" is not defined by type "${parentType.name}".` + didYouMean(suggestions), - { - nodes: node - } - ) - ); - } - }, - NullValue(node) { - const type = context.getInputType(); - if (isNonNullType(type)) { - context.reportError( - new GraphQLError( - `Expected value of type "${inspect(type)}", found ${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) - }; -} -function isValidValueNode(context, node) { - const locationType = context.getInputType(); - if (!locationType) { - return; - } - const type = getNamedType(locationType); - if (!isLeafType(type)) { - const typeStr = inspect(locationType); - context.reportError( - new GraphQLError( - `Expected value of type "${typeStr}", found ${print(node)}.`, - { - nodes: node - } - ) - ); - return; - } - try { - const parseResult = type.parseLiteral( - node, - void 0 - /* variables */ - ); - if (parseResult === void 0) { - const typeStr = inspect(locationType); - context.reportError( - new GraphQLError( - `Expected value of type "${typeStr}", found ${print(node)}.`, - { - nodes: node - } - ) - ); - } - } catch (error) { - const typeStr = inspect(locationType); - if (error instanceof GraphQLError) { - context.reportError(error); - } else { - context.reportError( - new GraphQLError( - `Expected value of type "${typeStr}", found ${print(node)}; ` + error.message, - { - nodes: node, - originalError: error - } - ) - ); - } - } -} -function validateOneOfInputObject(context, node, type, fieldNodeMap) { - var _fieldNodeMap$keys$; - const keys = Object.keys(fieldNodeMap); - const isNotExactlyOneField = keys.length !== 1; - if (isNotExactlyOneField) { - context.reportError( - new GraphQLError( - `OneOf Input Object "${type.name}" must specify exactly one key.`, - { - nodes: [node] - } - ) - ); - return; - } - const value = (_fieldNodeMap$keys$ = fieldNodeMap[keys[0]]) === null || _fieldNodeMap$keys$ === void 0 ? void 0 : _fieldNodeMap$keys$.value; - const isNullLiteral = !value || value.kind === Kind.NULL; - if (isNullLiteral) { - context.reportError( - new GraphQLError(`Field "${type.name}.${keys[0]}" must be non-null.`, { - nodes: [node] - }) - ); - } -} - -// ../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/validation/rules/VariablesAreInputTypesRule.mjs -function VariablesAreInputTypesRule(context) { - return { - VariableDefinition(node) { - const type = typeFromAST(context.getSchema(), node.type); - if (type !== void 0 && !isInputType(type)) { - const variableName = node.variable.name.value; - const typeName = print(node.type); - context.reportError( - new GraphQLError( - `Variable "$${variableName}" cannot be non-input type "${typeName}".`, - { - nodes: node.type - } - ) - ); - } - } - }; -} - -// ../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/validation/rules/VariablesInAllowedPositionRule.mjs -function VariablesInAllowedPositionRule(context) { - let varDefMap = /* @__PURE__ */ Object.create(null); - return { - OperationDefinition: { - enter() { - varDefMap = /* @__PURE__ */ Object.create(null); - }, - leave(operation) { - const usages = context.getRecursiveVariableUsages(operation); - for (const { node, type, defaultValue, parentType } of usages) { - const varName = node.name.value; - const varDef = varDefMap[varName]; - if (varDef && type) { - const schema = context.getSchema(); - const varType = typeFromAST(schema, varDef.type); - if (varType && !allowedVariableUsage( - schema, - varType, - varDef.defaultValue, - type, - defaultValue - )) { - const varTypeStr = inspect(varType); - const typeStr = inspect(type); - context.reportError( - new GraphQLError( - `Variable "$${varName}" of type "${varTypeStr}" used in position expecting type "${typeStr}".`, - { - nodes: [varDef, node] - } - ) - ); - } - if (isInputObjectType(parentType) && parentType.isOneOf && isNullableType(varType)) { - context.reportError( - new GraphQLError( - `Variable "$${varName}" is of type "${varType}" but must be non-nullable to be used for OneOf Input Object "${parentType}".`, - { - nodes: [varDef, node] - } - ) - ); - } - } - } - } - }, - VariableDefinition(node) { - varDefMap[node.variable.name.value] = node; - } - }; -} -function allowedVariableUsage(schema, varType, varDefaultValue, locationType, locationDefaultValue) { - if (isNonNullType(locationType) && !isNonNullType(varType)) { - const hasNonNullVariableDefaultValue = varDefaultValue != null && varDefaultValue.kind !== Kind.NULL; - const hasLocationDefaultValue = locationDefaultValue !== void 0; - if (!hasNonNullVariableDefaultValue && !hasLocationDefaultValue) { - return false; - } - const nullableLocationType = locationType.ofType; - return isTypeSubTypeOf(schema, varType, nullableLocationType); - } - return isTypeSubTypeOf(schema, varType, locationType); -} - -// ../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/validation/specifiedRules.mjs -var recommendedRules = Object.freeze([MaxIntrospectionDepthRule]); -var specifiedRules = Object.freeze([ - ExecutableDefinitionsRule, - UniqueOperationNamesRule, - LoneAnonymousOperationRule, - SingleFieldSubscriptionsRule, - KnownTypeNamesRule, - FragmentsOnCompositeTypesRule, - VariablesAreInputTypesRule, - ScalarLeafsRule, - FieldsOnCorrectTypeRule, - UniqueFragmentNamesRule, - KnownFragmentNamesRule, - NoUnusedFragmentsRule, - PossibleFragmentSpreadsRule, - NoFragmentCyclesRule, - UniqueVariableNamesRule, - NoUndefinedVariablesRule, - NoUnusedVariablesRule, - KnownDirectivesRule, - UniqueDirectivesPerLocationRule, - KnownArgumentNamesRule, - UniqueArgumentNamesRule, - ValuesOfCorrectTypeRule, - ProvidedRequiredArgumentsRule, - VariablesInAllowedPositionRule, - OverlappingFieldsCanBeMergedRule, - UniqueInputFieldNamesRule, - ...recommendedRules -]); -var specifiedSDLRules = Object.freeze([ - LoneSchemaDefinitionRule, - UniqueOperationTypesRule, - UniqueTypeNamesRule, - UniqueEnumValueNamesRule, - UniqueFieldDefinitionNamesRule, - UniqueArgumentDefinitionNamesRule, - UniqueDirectiveNamesRule, - KnownTypeNamesRule, - KnownDirectivesRule, - UniqueDirectivesPerLocationRule, - PossibleTypeExtensionsRule, - KnownArgumentNamesOnDirectivesRule, - UniqueArgumentNamesRule, - UniqueInputFieldNamesRule, - ProvidedRequiredArgumentsOnDirectivesRule -]); - -// ../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/validation/ValidationContext.mjs -var ASTValidationContext = class { - constructor(ast, onError) { - this._ast = ast; - this._fragments = void 0; - this._fragmentSpreads = /* @__PURE__ */ new Map(); - this._recursivelyReferencedFragments = /* @__PURE__ */ 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 = /* @__PURE__ */ Object.create(null); - for (const defNode of this.getDocument().definitions) { - if (defNode.kind === 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 === 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 = /* @__PURE__ */ 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; - } -}; -var SDLValidationContext = class extends ASTValidationContext { - constructor(ast, schema, onError) { - super(ast, onError); - this._schema = schema; - } - get [Symbol.toStringTag]() { - return "SDLValidationContext"; - } - getSchema() { - return this._schema; - } -}; -var ValidationContext = class extends ASTValidationContext { - constructor(schema, ast, typeInfo, onError) { - super(ast, onError); - this._schema = schema; - this._typeInfo = typeInfo; - this._variableUsages = /* @__PURE__ */ new Map(); - this._recursiveVariableUsages = /* @__PURE__ */ 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 TypeInfo(this._schema); - visit( - node, - visitWithTypeInfo(typeInfo, { - VariableDefinition: () => false, - Variable(variable) { - newUsages.push({ - node: variable, - type: typeInfo.getInputType(), - defaultValue: typeInfo.getDefaultValue(), - parentType: typeInfo.getParentInputType() - }); - } - }) - ); - 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/.bun/graphql@16.12.0/node_modules/graphql/validation/validate.mjs -function validate(schema, documentAST, rules = specifiedRules, options, typeInfo = new 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 || devAssert(false, "Must provide document."); - assertValidSchema(schema); - const abortObj = Object.freeze({}); - const errors = []; - const context = new ValidationContext( - schema, - documentAST, - typeInfo, - (error) => { - if (errors.length >= maxErrors) { - errors.push( - new GraphQLError( - "Too many validation errors, error limit reached. Validation aborted." - ) - ); - throw abortObj; - } - errors.push(error); - } - ); - const visitor = visitInParallel(rules.map((rule) => rule(context))); - try { - visit(documentAST, visitWithTypeInfo(typeInfo, visitor)); - } catch (e) { - if (e !== abortObj) { - throw e; - } - } - return errors; -} -function validateSDL(documentAST, schemaToExtend, rules = specifiedSDLRules) { - const errors = []; - const context = new SDLValidationContext( - documentAST, - schemaToExtend, - (error) => { - errors.push(error); - } - ); - const visitors = rules.map((rule) => rule(context)); - visit(documentAST, visitInParallel(visitors)); - return errors; -} -function assertValidSDL(documentAST) { - const errors = validateSDL(documentAST); - if (errors.length !== 0) { - throw new Error(errors.map((error) => error.message).join("\n\n")); - } -} -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/.bun/graphql@16.12.0/node_modules/graphql/jsutils/memoize3.mjs -function memoize3(fn) { - let cache0; - return function memoized(a1, a2, a3) { - if (cache0 === void 0) { - cache0 = /* @__PURE__ */ new WeakMap(); - } - let cache1 = cache0.get(a1); - if (cache1 === void 0) { - cache1 = /* @__PURE__ */ new WeakMap(); - cache0.set(a1, cache1); - } - let cache2 = cache1.get(a2); - if (cache2 === void 0) { - cache2 = /* @__PURE__ */ new WeakMap(); - cache1.set(a2, cache2); - } - let fnResult = cache2.get(a3); - if (fnResult === void 0) { - fnResult = fn(a1, a2, a3); - cache2.set(a3, fnResult); - } - return fnResult; - }; -} - -// ../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/jsutils/promiseForObject.mjs -function promiseForObject(object) { - return Promise.all(Object.values(object)).then((resolvedValues) => { - const resolvedObject = /* @__PURE__ */ Object.create(null); - for (const [i, key] of Object.keys(object).entries()) { - resolvedObject[key] = resolvedValues[i]; - } - return resolvedObject; - }); -} - -// ../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/jsutils/promiseReduce.mjs -function promiseReduce(values, callbackFn, initialValue) { - let accumulator = initialValue; - for (const value of values) { - accumulator = isPromise(accumulator) ? accumulator.then((resolved) => callbackFn(resolved, value)) : callbackFn(accumulator, value); - } - return accumulator; -} - -// ../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/jsutils/toError.mjs -function toError(thrownValue) { - return thrownValue instanceof Error ? thrownValue : new NonErrorThrown(thrownValue); -} -var NonErrorThrown = class extends Error { - constructor(thrownValue) { - super("Unexpected error value: " + inspect(thrownValue)); - this.name = "NonErrorThrown"; - this.thrownValue = thrownValue; - } -}; - -// ../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/error/locatedError.mjs -function locatedError(rawOriginalError, nodes, path) { - var _nodes; - const originalError = toError(rawOriginalError); - if (isLocatedGraphQLError(originalError)) { - return originalError; - } - return new 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/.bun/graphql@16.12.0/node_modules/graphql/execution/execute.mjs -var collectSubfields2 = memoize3( - (exeContext, returnType, fieldNodes) => collectSubfields( - exeContext.schema, - exeContext.fragments, - exeContext.variableValues, - returnType, - fieldNodes - ) -); -function execute(args) { - arguments.length < 2 || devAssert( - false, - "graphql@16 dropped long-deprecated support for positional arguments, please pass an object instead." - ); - const { schema, document, variableValues, rootValue } = args; - assertValidExecutionArguments(schema, document, variableValues); - const exeContext = buildExecutionContext(args); - if (!("schema" in exeContext)) { - return { - errors: exeContext - }; - } - try { - const { operation } = exeContext; - const result = executeOperation(exeContext, operation, rootValue); - if (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); - } -} -function executeSync(args) { - const result = execute(args); - if (isPromise(result)) { - throw new Error("GraphQL execution failed to complete synchronously."); - } - return result; -} -function buildResponse(data, errors) { - return errors.length === 0 ? { - data - } : { - errors, - data - }; -} -function assertValidExecutionArguments(schema, document, rawVariableValues) { - document || devAssert(false, "Must provide document."); - assertValidSchema(schema); - rawVariableValues == null || isObjectLike(rawVariableValues) || 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." - ); -} -function buildExecutionContext(args) { - var _definition$name, _operation$variableDe, _options$maxCoercionE; - const { - schema, - document, - rootValue, - contextValue, - variableValues: rawVariableValues, - operationName, - fieldResolver, - typeResolver, - subscribeFieldResolver, - options - } = args; - let operation; - const fragments = /* @__PURE__ */ Object.create(null); - for (const definition of document.definitions) { - switch (definition.kind) { - case Kind.OPERATION_DEFINITION: - if (operationName == null) { - if (operation !== void 0) { - return [ - new 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 Kind.FRAGMENT_DEFINITION: - fragments[definition.name.value] = definition; - break; - default: - } - } - if (!operation) { - if (operationName != null) { - return [new GraphQLError(`Unknown operation named "${operationName}".`)]; - } - return [new GraphQLError("Must provide an operation.")]; - } - const variableDefinitions = (_operation$variableDe = operation.variableDefinitions) !== null && _operation$variableDe !== void 0 ? _operation$variableDe : []; - const coercedVariableValues = getVariableValues( - schema, - variableDefinitions, - rawVariableValues !== null && rawVariableValues !== void 0 ? rawVariableValues : {}, - { - maxErrors: (_options$maxCoercionE = options === null || options === void 0 ? void 0 : options.maxCoercionErrors) !== null && _options$maxCoercionE !== void 0 ? _options$maxCoercionE : 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: [] - }; -} -function executeOperation(exeContext, operation, rootValue) { - const rootType = exeContext.schema.getRootType(operation.operation); - if (rootType == null) { - throw new GraphQLError( - `Schema is not configured to execute ${operation.operation} operation.`, - { - nodes: operation - } - ); - } - const rootFields = collectFields( - exeContext.schema, - exeContext.fragments, - exeContext.variableValues, - rootType, - operation.selectionSet - ); - const path = void 0; - switch (operation.operation) { - case OperationTypeNode.QUERY: - return executeFields(exeContext, rootType, rootValue, path, rootFields); - case OperationTypeNode.MUTATION: - return executeFieldsSerially( - exeContext, - rootType, - rootValue, - path, - rootFields - ); - case OperationTypeNode.SUBSCRIPTION: - return executeFields(exeContext, rootType, rootValue, path, rootFields); - } -} -function executeFieldsSerially(exeContext, parentType, sourceValue, path, fields) { - return promiseReduce( - fields.entries(), - (results, [responseName, fieldNodes]) => { - const fieldPath = addPath(path, responseName, parentType.name); - const result = executeField( - exeContext, - parentType, - sourceValue, - fieldNodes, - fieldPath - ); - if (result === void 0) { - return results; - } - if (isPromise(result)) { - return result.then((resolvedResult) => { - results[responseName] = resolvedResult; - return results; - }); - } - results[responseName] = result; - return results; - }, - /* @__PURE__ */ Object.create(null) - ); -} -function executeFields(exeContext, parentType, sourceValue, path, fields) { - const results = /* @__PURE__ */ Object.create(null); - let containsPromise = false; - try { - for (const [responseName, fieldNodes] of fields.entries()) { - const fieldPath = addPath(path, responseName, parentType.name); - const result = executeField( - exeContext, - parentType, - sourceValue, - fieldNodes, - fieldPath - ); - if (result !== void 0) { - results[responseName] = result; - if (isPromise(result)) { - containsPromise = true; - } - } - } - } catch (error) { - if (containsPromise) { - return promiseForObject(results).finally(() => { - throw error; - }); - } - throw error; - } - if (!containsPromise) { - return results; - } - return promiseForObject(results); -} -function executeField(exeContext, parentType, source, fieldNodes, path) { - var _fieldDef$resolve; - const fieldDef = getFieldDef2(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 - ); - try { - const args = getArgumentValues( - fieldDef, - fieldNodes[0], - exeContext.variableValues - ); - const contextValue = exeContext.contextValue; - const result = resolveFn(source, args, contextValue, info); - let completed; - if (isPromise(result)) { - completed = result.then( - (resolved) => completeValue(exeContext, returnType, fieldNodes, info, path, resolved) - ); - } else { - completed = completeValue( - exeContext, - returnType, - fieldNodes, - info, - path, - result - ); - } - if (isPromise(completed)) { - return completed.then(void 0, (rawError) => { - const error = locatedError(rawError, fieldNodes, pathToArray(path)); - return handleFieldError(error, returnType, exeContext); - }); - } - return completed; - } catch (rawError) { - const error = locatedError(rawError, fieldNodes, pathToArray(path)); - return handleFieldError(error, returnType, exeContext); - } -} -function buildResolveInfo(exeContext, fieldDef, fieldNodes, parentType, path) { - 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 (isNonNullType(returnType)) { - throw error; - } - exeContext.errors.push(error); - return null; -} -function completeValue(exeContext, returnType, fieldNodes, info, path, result) { - if (result instanceof Error) { - throw result; - } - if (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 == null) { - return null; - } - if (isListType(returnType)) { - return completeListValue( - exeContext, - returnType, - fieldNodes, - info, - path, - result - ); - } - if (isLeafType(returnType)) { - return completeLeafValue(returnType, result); - } - if (isAbstractType(returnType)) { - return completeAbstractValue( - exeContext, - returnType, - fieldNodes, - info, - path, - result - ); - } - if (isObjectType(returnType)) { - return completeObjectValue( - exeContext, - returnType, - fieldNodes, - info, - path, - result - ); - } - invariant( - false, - "Cannot complete value of unexpected output type: " + inspect(returnType) - ); -} -function completeListValue(exeContext, returnType, fieldNodes, info, path, result) { - if (!isIterableObject(result)) { - throw new GraphQLError( - `Expected Iterable, but did not find one for field "${info.parentType.name}.${info.fieldName}".` - ); - } - const itemType = returnType.ofType; - let containsPromise = false; - const completedResults = Array.from(result, (item, index) => { - const itemPath = addPath(path, index, void 0); - try { - let completedItem; - if (isPromise(item)) { - completedItem = item.then( - (resolved) => completeValue( - exeContext, - itemType, - fieldNodes, - info, - itemPath, - resolved - ) - ); - } else { - completedItem = completeValue( - exeContext, - itemType, - fieldNodes, - info, - itemPath, - item - ); - } - if (isPromise(completedItem)) { - containsPromise = true; - return completedItem.then(void 0, (rawError) => { - const error = locatedError( - rawError, - fieldNodes, - pathToArray(itemPath) - ); - return handleFieldError(error, itemType, exeContext); - }); - } - return completedItem; - } catch (rawError) { - const error = locatedError(rawError, fieldNodes, pathToArray(itemPath)); - return handleFieldError(error, itemType, exeContext); - } - }); - return containsPromise ? Promise.all(completedResults) : completedResults; -} -function completeLeafValue(returnType, result) { - const serializedResult = returnType.serialize(result); - if (serializedResult == null) { - throw new Error( - `Expected \`${inspect(returnType)}.serialize(${inspect(result)})\` to return non-nullable value, returned: ${inspect(serializedResult)}` - ); - } - return serializedResult; -} -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 (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 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 - ); - } - if (isObjectType(runtimeTypeName)) { - throw new 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 GraphQLError( - `Abstract type "${returnType.name}" must resolve to an Object type at runtime for field "${info.parentType.name}.${info.fieldName}" with value ${inspect(result)}, received "${inspect(runtimeTypeName)}".` - ); - } - const runtimeType = exeContext.schema.getType(runtimeTypeName); - if (runtimeType == null) { - throw new GraphQLError( - `Abstract type "${returnType.name}" was resolved to a type "${runtimeTypeName}" that does not exist inside the schema.`, - { - nodes: fieldNodes - } - ); - } - if (!isObjectType(runtimeType)) { - throw new GraphQLError( - `Abstract type "${returnType.name}" was resolved to a non-object type "${runtimeTypeName}".`, - { - nodes: fieldNodes - } - ); - } - if (!exeContext.schema.isSubType(returnType, runtimeType)) { - throw new GraphQLError( - `Runtime Object type "${runtimeType.name}" is not a possible type for "${returnType.name}".`, - { - nodes: fieldNodes - } - ); - } - return runtimeType; -} -function completeObjectValue(exeContext, returnType, fieldNodes, info, path, result) { - const subFieldNodes = collectSubfields2(exeContext, returnType, fieldNodes); - if (returnType.isTypeOf) { - const isTypeOf = returnType.isTypeOf(result, exeContext.contextValue, info); - if (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 GraphQLError( - `Expected value of type "${returnType.name}" but got: ${inspect(result)}.`, - { - nodes: fieldNodes - } - ); -} -var defaultTypeResolver = function(value, contextValue, info, abstractType) { - if (isObjectLike(value) && typeof value.__typename === "string") { - return value.__typename; - } - 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 (isPromise(isTypeOfResult)) { - promisedIsTypeOfResults[i] = isTypeOfResult; - } else if (isTypeOfResult) { - if (promisedIsTypeOfResults.length) { - Promise.allSettled(promisedIsTypeOfResults).catch(() => { - }); - } - 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; - } - } - }); - } -}; -var defaultFieldResolver = function(source, args, contextValue, info) { - if (isObjectLike(source) || typeof source === "function") { - const property = source[info.fieldName]; - if (typeof property === "function") { - return source[info.fieldName](args, contextValue, info); - } - return property; - } -}; -function getFieldDef2(schema, parentType, fieldNode) { - const fieldName = fieldNode.name.value; - if (fieldName === SchemaMetaFieldDef.name && schema.getQueryType() === parentType) { - return SchemaMetaFieldDef; - } else if (fieldName === TypeMetaFieldDef.name && schema.getQueryType() === parentType) { - return TypeMetaFieldDef; - } else if (fieldName === TypeNameMetaFieldDef.name) { - return TypeNameMetaFieldDef; - } - return parentType.getFields()[fieldName]; -} - -// ../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/graphql.mjs -function graphql(args) { - return new Promise((resolve) => resolve(graphqlImpl(args))); -} -function graphqlSync(args) { - const result = graphqlImpl(args); - if (isPromise(result)) { - throw new Error("GraphQL execution failed to complete synchronously."); - } - return result; -} -function graphqlImpl(args) { - arguments.length < 2 || 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; - const schemaValidationErrors = validateSchema(schema); - if (schemaValidationErrors.length > 0) { - return { - errors: schemaValidationErrors - }; - } - let document; - try { - document = parse(source); - } catch (syntaxError2) { - return { - errors: [syntaxError2] - }; - } - const validationErrors = validate(schema, document); - if (validationErrors.length > 0) { - return { - errors: validationErrors - }; - } - return execute({ - schema, - document, - rootValue, - contextValue, - variableValues, - operationName, - fieldResolver, - typeResolver - }); -} - -// ../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/jsutils/isAsyncIterable.mjs -function isAsyncIterable(maybeAsyncIterable) { - return typeof (maybeAsyncIterable === null || maybeAsyncIterable === void 0 ? void 0 : maybeAsyncIterable[Symbol.asyncIterator]) === "function"; -} - -// ../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/execution/mapAsyncIterator.mjs -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) { - if (typeof iterator.return === "function") { - try { - await iterator.return(); - } catch (_e) { - } - } - throw error; - } - } - return { - async next() { - return mapResult(await iterator.next()); - }, - async return() { - return typeof iterator.return === "function" ? mapResult(await iterator.return()) : { - value: void 0, - done: true - }; - }, - async throw(error) { - if (typeof iterator.throw === "function") { - return mapResult(await iterator.throw(error)); - } - throw error; - }, - [Symbol.asyncIterator]() { - return this; - } - }; -} - -// ../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/execution/subscribe.mjs -async function subscribe(args) { - arguments.length < 2 || devAssert( - false, - "graphql@16 dropped long-deprecated support for positional arguments, please pass an object instead." - ); - const resultOrStream = await createSourceEventStream(args); - if (!isAsyncIterable(resultOrStream)) { - return resultOrStream; - } - const mapSourceToResponse = (payload) => execute({ ...args, rootValue: payload }); - return mapAsyncIterator(resultOrStream, mapSourceToResponse); -} -function toNormalizedArgs(args) { - const firstArg = args[0]; - if (firstArg && "document" in firstArg) { - return firstArg; - } - return { - schema: firstArg, - // FIXME: when underlying TS bug fixed, see https://github.com/microsoft/TypeScript/issues/31613 - document: args[1], - rootValue: args[2], - contextValue: args[3], - variableValues: args[4], - operationName: args[5], - subscribeFieldResolver: args[6] - }; -} -async function createSourceEventStream(...rawArgs) { - const args = toNormalizedArgs(rawArgs); - const { schema, document, variableValues } = args; - assertValidExecutionArguments(schema, document, variableValues); - const exeContext = buildExecutionContext(args); - if (!("schema" in exeContext)) { - return { - errors: exeContext - }; - } - try { - const eventStream = await executeSubscription(exeContext); - if (!isAsyncIterable(eventStream)) { - throw new Error( - `Subscription field must return Async Iterable. Received: ${inspect(eventStream)}.` - ); - } - return eventStream; - } catch (error) { - if (error instanceof 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 GraphQLError( - "Schema is not configured to execute subscription operation.", - { - nodes: operation - } - ); - } - const rootFields = collectFields( - schema, - fragments, - variableValues, - rootType, - operation.selectionSet - ); - const [responseName, fieldNodes] = [...rootFields.entries()][0]; - const fieldDef = getFieldDef2(schema, rootType, fieldNodes[0]); - if (!fieldDef) { - const fieldName = fieldNodes[0].name.value; - throw new GraphQLError( - `The subscription field "${fieldName}" is not defined.`, - { - nodes: fieldNodes - } - ); - } - const path = addPath(void 0, responseName, rootType.name); - const info = buildResolveInfo( - exeContext, - fieldDef, - fieldNodes, - rootType, - path - ); - try { - var _fieldDef$subscribe; - const args = getArgumentValues(fieldDef, fieldNodes[0], variableValues); - const contextValue = exeContext.contextValue; - 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 locatedError(error, fieldNodes, pathToArray(path)); - } -} - -// ../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/validation/rules/custom/NoDeprecatedCustomRule.mjs -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 || invariant(false); - context.reportError( - new 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 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 || invariant(false); - context.reportError( - new GraphQLError( - `Field "${parentType.name}.${fieldDef.name}" argument "${argDef.name}" is deprecated. ${deprecationReason}`, - { - nodes: node - } - ) - ); - } - } - }, - ObjectField(node) { - const inputObjectDef = getNamedType(context.getParentInputType()); - if (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 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 = getNamedType(context.getInputType()); - enumTypeDef != null || invariant(false); - context.reportError( - new GraphQLError( - `The enum value "${enumTypeDef.name}.${enumValueDef.name}" is deprecated. ${deprecationReason}`, - { - nodes: node - } - ) - ); - } - } - }; -} - -// ../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/validation/rules/custom/NoSchemaIntrospectionCustomRule.mjs -function NoSchemaIntrospectionCustomRule(context) { - return { - Field(node) { - const type = getNamedType(context.getType()); - if (type && isIntrospectionType(type)) { - context.reportError( - new GraphQLError( - `GraphQL introspection has been disabled, but the requested query contained the field "${node.name.value}".`, - { - nodes: node - } - ) - ); - } - } - }; -} - -// ../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/utilities/getIntrospectionQuery.mjs -function getIntrospectionQuery(options) { - const optionsWithDefault = { - descriptions: true, - specifiedByUrl: false, - directiveIsRepeatable: false, - schemaDescription: false, - inputValueDeprecation: false, - oneOf: 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 : ""; - } - const oneOf = optionsWithDefault.oneOf ? "isOneOf" : ""; - return ` - query IntrospectionQuery { - __schema { - ${schemaDescription} - queryType { name kind } - mutationType { name kind } - subscriptionType { name kind } - types { - ...FullType - } - directives { - name - ${descriptions} - ${directiveIsRepeatable} - locations - args${inputDeprecation("(includeDeprecated: true)")} { - ...InputValue - } - } - } - } - - fragment FullType on __Type { - kind - name - ${descriptions} - ${specifiedByUrl} - ${oneOf} - 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 - ofType { - kind - name - ofType { - kind - name - } - } - } - } - } - } - } - } - } - } - `; -} - -// ../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/utilities/getOperationAST.mjs -function getOperationAST(documentAST, operationName) { - let operation = null; - for (const definition of documentAST.definitions) { - if (definition.kind === Kind.OPERATION_DEFINITION) { - var _definition$name; - if (operationName == 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/.bun/graphql@16.12.0/node_modules/graphql/utilities/getOperationRootType.mjs -function getOperationRootType(schema, operation) { - if (operation.operation === "query") { - const queryType = schema.getQueryType(); - if (!queryType) { - throw new 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 GraphQLError("Schema is not configured for mutations.", { - nodes: operation - }); - } - return mutationType; - } - if (operation.operation === "subscription") { - const subscriptionType = schema.getSubscriptionType(); - if (!subscriptionType) { - throw new GraphQLError("Schema is not configured for subscriptions.", { - nodes: operation - }); - } - return subscriptionType; - } - throw new GraphQLError( - "Can only have query, mutation and subscription operations.", - { - nodes: operation - } - ); -} - -// ../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/utilities/introspectionFromSchema.mjs -function introspectionFromSchema(schema, options) { - const optionsWithDefaults = { - specifiedByUrl: true, - directiveIsRepeatable: true, - schemaDescription: true, - inputValueDeprecation: true, - oneOf: true, - ...options - }; - const document = parse(getIntrospectionQuery(optionsWithDefaults)); - const result = executeSync({ - schema, - document - }); - !result.errors && result.data || invariant(false); - return result.data; -} - -// ../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/utilities/buildClientSchema.mjs -function buildClientSchema(introspection, options) { - isObjectLike(introspection) && isObjectLike(introspection.__schema) || devAssert( - false, - `Invalid or incomplete introspection result. Ensure that you are passing "data" property of introspection response and no "errors" was returned alongside: ${inspect( - introspection - )}.` - ); - const schemaIntrospection = introspection.__schema; - const typeMap = keyValMap( - schemaIntrospection.types, - (typeIntrospection) => typeIntrospection.name, - (typeIntrospection) => buildType(typeIntrospection) - ); - for (const stdType of [...specifiedScalarTypes, ...introspectionTypes]) { - if (typeMap[stdType.name]) { - typeMap[stdType.name] = stdType; - } - } - const queryType = schemaIntrospection.queryType ? getObjectType(schemaIntrospection.queryType) : null; - const mutationType = schemaIntrospection.mutationType ? getObjectType(schemaIntrospection.mutationType) : null; - const subscriptionType = schemaIntrospection.subscriptionType ? getObjectType(schemaIntrospection.subscriptionType) : null; - const directives = schemaIntrospection.directives ? schemaIntrospection.directives.map(buildDirective) : []; - return new 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 - }); - function getType(typeRef) { - if (typeRef.kind === TypeKind.LIST) { - const itemRef = typeRef.ofType; - if (!itemRef) { - throw new Error("Decorated type deeper than introspection query."); - } - return new GraphQLList(getType(itemRef)); - } - if (typeRef.kind === TypeKind.NON_NULL) { - const nullableRef = typeRef.ofType; - if (!nullableRef) { - throw new Error("Decorated type deeper than introspection query."); - } - const nullableType = getType(nullableRef); - return new GraphQLNonNull(assertNullableType(nullableType)); - } - return getNamedType2(typeRef); - } - function getNamedType2(typeRef) { - const typeName = typeRef.name; - if (!typeName) { - throw new Error(`Unknown type reference: ${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 assertObjectType(getNamedType2(typeRef)); - } - function getInterfaceType(typeRef) { - return assertInterfaceType(getNamedType2(typeRef)); - } - function buildType(type) { - if (type != null && type.name != null && type.kind != null) { - switch (type.kind) { - case TypeKind.SCALAR: - return buildScalarDef(type); - case TypeKind.OBJECT: - return buildObjectDef(type); - case TypeKind.INTERFACE: - return buildInterfaceDef(type); - case TypeKind.UNION: - return buildUnionDef(type); - case TypeKind.ENUM: - return buildEnumDef(type); - case TypeKind.INPUT_OBJECT: - return buildInputObjectDef(type); - } - } - const typeStr = 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 GraphQLScalarType({ - name: scalarIntrospection.name, - description: scalarIntrospection.description, - specifiedByURL: scalarIntrospection.specifiedByURL - }); - } - function buildImplementationsList(implementingIntrospection) { - if (implementingIntrospection.interfaces === null && implementingIntrospection.kind === TypeKind.INTERFACE) { - return []; - } - if (!implementingIntrospection.interfaces) { - const implementingIntrospectionStr = inspect(implementingIntrospection); - throw new Error( - `Introspection result missing interfaces: ${implementingIntrospectionStr}.` - ); - } - return implementingIntrospection.interfaces.map(getInterfaceType); - } - function buildObjectDef(objectIntrospection) { - return new GraphQLObjectType({ - name: objectIntrospection.name, - description: objectIntrospection.description, - interfaces: () => buildImplementationsList(objectIntrospection), - fields: () => buildFieldDefMap(objectIntrospection) - }); - } - function buildInterfaceDef(interfaceIntrospection) { - return new GraphQLInterfaceType({ - name: interfaceIntrospection.name, - description: interfaceIntrospection.description, - interfaces: () => buildImplementationsList(interfaceIntrospection), - fields: () => buildFieldDefMap(interfaceIntrospection) - }); - } - function buildUnionDef(unionIntrospection) { - if (!unionIntrospection.possibleTypes) { - const unionIntrospectionStr = inspect(unionIntrospection); - throw new Error( - `Introspection result missing possibleTypes: ${unionIntrospectionStr}.` - ); - } - return new GraphQLUnionType({ - name: unionIntrospection.name, - description: unionIntrospection.description, - types: () => unionIntrospection.possibleTypes.map(getObjectType) - }); - } - function buildEnumDef(enumIntrospection) { - if (!enumIntrospection.enumValues) { - const enumIntrospectionStr = inspect(enumIntrospection); - throw new Error( - `Introspection result missing enumValues: ${enumIntrospectionStr}.` - ); - } - return new GraphQLEnumType({ - name: enumIntrospection.name, - description: enumIntrospection.description, - values: keyValMap( - enumIntrospection.enumValues, - (valueIntrospection) => valueIntrospection.name, - (valueIntrospection) => ({ - description: valueIntrospection.description, - deprecationReason: valueIntrospection.deprecationReason - }) - ) - }); - } - function buildInputObjectDef(inputObjectIntrospection) { - if (!inputObjectIntrospection.inputFields) { - const inputObjectIntrospectionStr = inspect(inputObjectIntrospection); - throw new Error( - `Introspection result missing inputFields: ${inputObjectIntrospectionStr}.` - ); - } - return new GraphQLInputObjectType({ - name: inputObjectIntrospection.name, - description: inputObjectIntrospection.description, - fields: () => buildInputValueDefMap(inputObjectIntrospection.inputFields), - isOneOf: inputObjectIntrospection.isOneOf - }); - } - function buildFieldDefMap(typeIntrospection) { - if (!typeIntrospection.fields) { - throw new Error( - `Introspection result missing fields: ${inspect(typeIntrospection)}.` - ); - } - return keyValMap( - typeIntrospection.fields, - (fieldIntrospection) => fieldIntrospection.name, - buildField - ); - } - function buildField(fieldIntrospection) { - const type = getType(fieldIntrospection.type); - if (!isOutputType(type)) { - const typeStr = inspect(type); - throw new Error( - `Introspection must provide output type for fields, but received: ${typeStr}.` - ); - } - if (!fieldIntrospection.args) { - const fieldIntrospectionStr = 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 keyValMap( - inputValueIntrospections, - (inputValue) => inputValue.name, - buildInputValue - ); - } - function buildInputValue(inputValueIntrospection) { - const type = getType(inputValueIntrospection.type); - if (!isInputType(type)) { - const typeStr = inspect(type); - throw new Error( - `Introspection must provide input type for arguments, but received: ${typeStr}.` - ); - } - const defaultValue = inputValueIntrospection.defaultValue != null ? valueFromAST(parseValue(inputValueIntrospection.defaultValue), type) : void 0; - return { - description: inputValueIntrospection.description, - type, - defaultValue, - deprecationReason: inputValueIntrospection.deprecationReason - }; - } - function buildDirective(directiveIntrospection) { - if (!directiveIntrospection.args) { - const directiveIntrospectionStr = inspect(directiveIntrospection); - throw new Error( - `Introspection result missing directive args: ${directiveIntrospectionStr}.` - ); - } - if (!directiveIntrospection.locations) { - const directiveIntrospectionStr = inspect(directiveIntrospection); - throw new Error( - `Introspection result missing directive locations: ${directiveIntrospectionStr}.` - ); - } - return new GraphQLDirective({ - name: directiveIntrospection.name, - description: directiveIntrospection.description, - isRepeatable: directiveIntrospection.isRepeatable, - locations: directiveIntrospection.locations.slice(), - args: buildInputValueDefMap(directiveIntrospection.args) - }); - } -} - -// ../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/utilities/extendSchema.mjs -function extendSchema(schema, documentAST, options) { - assertSchema(schema); - documentAST != null && documentAST.kind === Kind.DOCUMENT || 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) { - assertValidSDLExtension(documentAST, schema); - } - const schemaConfig = schema.toConfig(); - const extendedConfig = extendSchemaImpl(schemaConfig, documentAST, options); - return schemaConfig === extendedConfig ? schema : new GraphQLSchema(extendedConfig); -} -function extendSchemaImpl(schemaConfig, documentAST, options) { - var _schemaDef, _schemaDef$descriptio, _schemaDef2, _options$assumeValid; - const typeDefs = []; - const typeExtensionsMap = /* @__PURE__ */ Object.create(null); - const directiveDefs = []; - let schemaDef; - const schemaExtensions = []; - for (const def of documentAST.definitions) { - if (def.kind === Kind.SCHEMA_DEFINITION) { - schemaDef = def; - } else if (def.kind === Kind.SCHEMA_EXTENSION) { - schemaExtensions.push(def); - } else if (isTypeDefinitionNode(def)) { - typeDefs.push(def); - } else if (isTypeExtensionNode(def)) { - const extendedTypeName = def.name.value; - const existingTypeExtensions = typeExtensionsMap[extendedTypeName]; - typeExtensionsMap[extendedTypeName] = existingTypeExtensions ? existingTypeExtensions.concat([def]) : [def]; - } else if (def.kind === Kind.DIRECTIVE_DEFINITION) { - directiveDefs.push(def); - } - } - if (Object.keys(typeExtensionsMap).length === 0 && typeDefs.length === 0 && directiveDefs.length === 0 && schemaExtensions.length === 0 && schemaDef == null) { - return schemaConfig; - } - const typeMap = /* @__PURE__ */ 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) - }; - 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: /* @__PURE__ */ 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 - }; - function replaceType(type) { - if (isListType(type)) { - return new GraphQLList(replaceType(type.ofType)); - } - if (isNonNullType(type)) { - return new GraphQLNonNull(replaceType(type.ofType)); - } - return replaceNamedType(type); - } - function replaceNamedType(type) { - return typeMap[type.name]; - } - function replaceDirective(directive) { - const config = directive.toConfig(); - return new GraphQLDirective({ - ...config, - args: mapValue(config.args, extendArg) - }); - } - function extendNamedType(type) { - if (isIntrospectionType(type) || isSpecifiedScalarType(type)) { - return type; - } - if (isScalarType(type)) { - return extendScalarType(type); - } - if (isObjectType(type)) { - return extendObjectType(type); - } - if (isInterfaceType(type)) { - return extendInterfaceType(type); - } - if (isUnionType(type)) { - return extendUnionType(type); - } - if (isEnumType(type)) { - return extendEnumType(type); - } - if (isInputObjectType(type)) { - return extendInputObjectType(type); - } - invariant(false, "Unexpected type: " + 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 GraphQLInputObjectType({ - ...config, - fields: () => ({ - ...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 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 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 GraphQLObjectType({ - ...config, - interfaces: () => [ - ...type.getInterfaces().map(replaceNamedType), - ...buildInterfaces(extensions) - ], - fields: () => ({ - ...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 GraphQLInterfaceType({ - ...config, - interfaces: () => [ - ...type.getInterfaces().map(replaceNamedType), - ...buildInterfaces(extensions) - ], - fields: () => ({ - ...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 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 && 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; - const operationTypesNodes = ( - /* c8 ignore next */ - (_node$operationTypes = node.operationTypes) !== null && _node$operationTypes !== void 0 ? _node$operationTypes : [] - ); - for (const operationType of operationTypesNodes) { - opTypes[operationType.operation] = getNamedType2(operationType.type); - } - } - return opTypes; - } - function getNamedType2(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 === void 0) { - throw new Error(`Unknown type: "${name}".`); - } - return type; - } - function getWrappedType(node) { - if (node.kind === Kind.LIST_TYPE) { - return new GraphQLList(getWrappedType(node.type)); - } - if (node.kind === Kind.NON_NULL_TYPE) { - return new GraphQLNonNull(getWrappedType(node.type)); - } - return getNamedType2(node); - } - function buildDirective(node) { - var _node$description; - return new 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 = /* @__PURE__ */ Object.create(null); - for (const node of nodes) { - var _node$fields; - 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) { - const argsNodes = ( - /* c8 ignore next */ - args !== null && args !== void 0 ? args : [] - ); - const argConfigMap = /* @__PURE__ */ Object.create(null); - for (const arg of argsNodes) { - var _arg$description; - 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: valueFromAST(arg.defaultValue, type), - deprecationReason: getDeprecationReason(arg), - astNode: arg - }; - } - return argConfigMap; - } - function buildInputFieldMap(nodes) { - const inputFieldMap = /* @__PURE__ */ Object.create(null); - for (const node of nodes) { - var _node$fields2; - const fieldsNodes = ( - /* c8 ignore next */ - (_node$fields2 = node.fields) !== null && _node$fields2 !== void 0 ? _node$fields2 : [] - ); - for (const field of fieldsNodes) { - var _field$description2; - 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: valueFromAST(field.defaultValue, type), - deprecationReason: getDeprecationReason(field), - astNode: field - }; - } - } - return inputFieldMap; - } - function buildEnumValueMap(nodes) { - const enumValueMap = /* @__PURE__ */ Object.create(null); - for (const node of nodes) { - var _node$values; - 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) { - 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(getNamedType2)) !== null && _node$interfaces$map !== void 0 ? _node$interfaces$map : [] - ); - } - ); - } - function buildUnionTypes(nodes) { - 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(getNamedType2)) !== 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 Kind.OBJECT_TYPE_DEFINITION: { - var _astNode$description; - const allNodes = [astNode, ...extensionASTNodes]; - return new 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 Kind.INTERFACE_TYPE_DEFINITION: { - var _astNode$description2; - const allNodes = [astNode, ...extensionASTNodes]; - return new 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 Kind.ENUM_TYPE_DEFINITION: { - var _astNode$description3; - const allNodes = [astNode, ...extensionASTNodes]; - return new GraphQLEnumType({ - name, - description: (_astNode$description3 = astNode.description) === null || _astNode$description3 === void 0 ? void 0 : _astNode$description3.value, - values: buildEnumValueMap(allNodes), - astNode, - extensionASTNodes - }); - } - case Kind.UNION_TYPE_DEFINITION: { - var _astNode$description4; - const allNodes = [astNode, ...extensionASTNodes]; - return new GraphQLUnionType({ - name, - description: (_astNode$description4 = astNode.description) === null || _astNode$description4 === void 0 ? void 0 : _astNode$description4.value, - types: () => buildUnionTypes(allNodes), - astNode, - extensionASTNodes - }); - } - case Kind.SCALAR_TYPE_DEFINITION: { - var _astNode$description5; - return new GraphQLScalarType({ - name, - description: (_astNode$description5 = astNode.description) === null || _astNode$description5 === void 0 ? void 0 : _astNode$description5.value, - specifiedByURL: getSpecifiedByURL(astNode), - astNode, - extensionASTNodes - }); - } - case Kind.INPUT_OBJECT_TYPE_DEFINITION: { - var _astNode$description6; - const allNodes = [astNode, ...extensionASTNodes]; - return new GraphQLInputObjectType({ - name, - description: (_astNode$description6 = astNode.description) === null || _astNode$description6 === void 0 ? void 0 : _astNode$description6.value, - fields: () => buildInputFieldMap(allNodes), - astNode, - extensionASTNodes, - isOneOf: isOneOf(astNode) - }); - } - } - } -} -var stdTypeMap = keyMap( - [...specifiedScalarTypes, ...introspectionTypes], - (type) => type.name -); -function getDeprecationReason(node) { - const deprecated = getDirectiveValues(GraphQLDeprecatedDirective, node); - return deprecated === null || deprecated === void 0 ? void 0 : deprecated.reason; -} -function getSpecifiedByURL(node) { - const specifiedBy = getDirectiveValues(GraphQLSpecifiedByDirective, node); - return specifiedBy === null || specifiedBy === void 0 ? void 0 : specifiedBy.url; -} -function isOneOf(node) { - return Boolean(getDirectiveValues(GraphQLOneOfDirective, node)); -} - -// ../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/utilities/buildASTSchema.mjs -function buildASTSchema(documentAST, options) { - documentAST != null && documentAST.kind === Kind.DOCUMENT || 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) { - assertValidSDL(documentAST); - } - const emptySchemaConfig = { - description: void 0, - types: [], - directives: [], - extensions: /* @__PURE__ */ Object.create(null), - extensionASTNodes: [], - assumeValid: false - }; - const config = 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": - config.query = type; - break; - case "Mutation": - config.mutation = type; - break; - case "Subscription": - config.subscription = type; - break; - } - } - } - const directives = [ - ...config.directives, - // If specified directives were not explicitly declared, add them. - ...specifiedDirectives.filter( - (stdDirective) => config.directives.every( - (directive) => directive.name !== stdDirective.name - ) - ) - ]; - return new GraphQLSchema({ ...config, directives }); -} -function buildSchema(source, options) { - const document = 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/.bun/graphql@16.12.0/node_modules/graphql/utilities/lexicographicSortSchema.mjs -function lexicographicSortSchema(schema) { - const schemaConfig = schema.toConfig(); - const typeMap = keyValMap( - sortByName(schemaConfig.types), - (type) => type.name, - sortNamedType - ); - return new 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 (isListType(type)) { - return new GraphQLList(replaceType(type.ofType)); - } else if (isNonNullType(type)) { - return new GraphQLNonNull(replaceType(type.ofType)); - } - 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 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 sortFields2(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 (isScalarType(type) || isIntrospectionType(type)) { - return type; - } - if (isObjectType(type)) { - const config = type.toConfig(); - return new GraphQLObjectType({ - ...config, - interfaces: () => sortTypes(config.interfaces), - fields: () => sortFields2(config.fields) - }); - } - if (isInterfaceType(type)) { - const config = type.toConfig(); - return new GraphQLInterfaceType({ - ...config, - interfaces: () => sortTypes(config.interfaces), - fields: () => sortFields2(config.fields) - }); - } - if (isUnionType(type)) { - const config = type.toConfig(); - return new GraphQLUnionType({ - ...config, - types: () => sortTypes(config.types) - }); - } - if (isEnumType(type)) { - const config = type.toConfig(); - return new GraphQLEnumType({ - ...config, - values: sortObjMap(config.values, (value) => value) - }); - } - if (isInputObjectType(type)) { - const config = type.toConfig(); - return new GraphQLInputObjectType({ - ...config, - fields: () => sortInputFields(config.fields) - }); - } - invariant(false, "Unexpected type: " + inspect(type)); - } -} -function sortObjMap(map, sortValueFn) { - const sortedMap = /* @__PURE__ */ Object.create(null); - for (const key of Object.keys(map).sort(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 naturalCompare(key1, key2); - }); -} - -// ../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/utilities/printSchema.mjs -function printSchema(schema) { - return printFilteredSchema( - schema, - (n) => !isSpecifiedDirective(n), - isDefinedType - ); -} -function printIntrospectionSchema(schema) { - return printFilteredSchema(schema, isSpecifiedDirective, isIntrospectionType); -} -function isDefinedType(type) { - return !isSpecifiedScalarType(type) && !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 { -${operationTypes.join("\n")} -}`; -} -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 (isScalarType(type)) { - return printScalar(type); - } - if (isObjectType(type)) { - return printObject(type); - } - if (isInterfaceType(type)) { - return printInterface(type); - } - if (isUnionType(type)) { - return printUnion(type); - } - if (isEnumType(type)) { - return printEnum(type); - } - if (isInputObjectType(type)) { - return printInputObject(type); - } - invariant(false, "Unexpected type: " + 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}` + (type.isOneOf ? " @oneOf" : "") + 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 (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 = astFromValue(arg.defaultValue, arg.type); - let argDecl = arg.name + ": " + String(arg.type); - if (defaultAST) { - argDecl += ` = ${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 !== DEFAULT_DEPRECATION_REASON) { - const astValue = print({ - kind: Kind.STRING, - value: reason - }); - return ` @deprecated(reason: ${astValue})`; - } - return " @deprecated"; -} -function printSpecifiedByURL(scalar) { - if (scalar.specifiedByURL == null) { - return ""; - } - const astValue = print({ - kind: Kind.STRING, - value: scalar.specifiedByURL - }); - return ` @specifiedBy(url: ${astValue})`; -} -function printDescription(def, indentation = "", firstInBlock = true) { - const { description } = def; - if (description == null) { - return ""; - } - const blockString = print({ - kind: Kind.STRING, - value: description, - block: isPrintableAsBlockString(description) - }); - const prefix = indentation && !firstInBlock ? "\n" + indentation : indentation; - return prefix + blockString.replace(/\n/g, "\n" + indentation) + "\n"; -} - -// ../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/utilities/concatAST.mjs -function concatAST(documents) { - const definitions = []; - for (const doc of documents) { - definitions.push(...doc.definitions); - } - return { - kind: Kind.DOCUMENT, - definitions - }; -} - -// ../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/utilities/separateOperations.mjs -function separateOperations(documentAST) { - const operations = []; - const depGraph = /* @__PURE__ */ Object.create(null); - for (const definitionNode of documentAST.definitions) { - switch (definitionNode.kind) { - case Kind.OPERATION_DEFINITION: - operations.push(definitionNode); - break; - case Kind.FRAGMENT_DEFINITION: - depGraph[definitionNode.name.value] = collectDependencies( - definitionNode.selectionSet - ); - break; - default: - } - } - const separatedDocumentASTs = /* @__PURE__ */ Object.create(null); - for (const operation of operations) { - const dependencies = /* @__PURE__ */ new Set(); - for (const fragmentName of collectDependencies(operation.selectionSet)) { - collectTransitiveDependencies(dependencies, depGraph, fragmentName); - } - const operationName = operation.name ? operation.name.value : ""; - separatedDocumentASTs[operationName] = { - kind: Kind.DOCUMENT, - definitions: documentAST.definitions.filter( - (node) => node === operation || node.kind === Kind.FRAGMENT_DEFINITION && dependencies.has(node.name.value) - ) - }; - } - return separatedDocumentASTs; -} -function collectTransitiveDependencies(collected, depGraph, fromName) { - if (!collected.has(fromName)) { - collected.add(fromName); - const immediateDeps = depGraph[fromName]; - if (immediateDeps !== void 0) { - for (const toName of immediateDeps) { - collectTransitiveDependencies(collected, depGraph, toName); - } - } - } -} -function collectDependencies(selectionSet) { - const dependencies = []; - visit(selectionSet, { - FragmentSpread(node) { - dependencies.push(node.name.value); - } - }); - return dependencies; -} - -// ../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/utilities/stripIgnoredCharacters.mjs -function stripIgnoredCharacters(source) { - const sourceObj = isSource(source) ? source : new Source(source); - const body = sourceObj.body; - const lexer = new Lexer(sourceObj); - let strippedBody = ""; - let wasLastAddedTokenNonPunctuator = false; - while (lexer.advance().kind !== TokenKind.EOF) { - const currentToken = lexer.token; - const tokenKind = currentToken.kind; - const isNonPunctuator = !isPunctuatorTokenKind(currentToken.kind); - if (wasLastAddedTokenNonPunctuator) { - if (isNonPunctuator || currentToken.kind === TokenKind.SPREAD) { - strippedBody += " "; - } - } - const tokenBody = body.slice(currentToken.start, currentToken.end); - if (tokenKind === TokenKind.BLOCK_STRING) { - strippedBody += printBlockString(currentToken.value, { - minimize: true - }); - } else { - strippedBody += tokenBody; - } - wasLastAddedTokenNonPunctuator = isNonPunctuator; - } - return strippedBody; -} - -// ../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/utilities/assertValidName.mjs -function assertValidName(name) { - const error = isValidNameError(name); - if (error) { - throw error; - } - return name; -} -function isValidNameError(name) { - typeof name === "string" || devAssert(false, "Expected name to be a string."); - if (name.startsWith("__")) { - return new GraphQLError( - `Name "${name}" must not begin with "__", which is reserved by GraphQL introspection.` - ); - } - try { - assertName(name); - } catch (error) { - return error; - } -} - -// ../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/utilities/findBreakingChanges.mjs -var BreakingChangeType; -(function(BreakingChangeType2) { - BreakingChangeType2["TYPE_REMOVED"] = "TYPE_REMOVED"; - BreakingChangeType2["TYPE_CHANGED_KIND"] = "TYPE_CHANGED_KIND"; - BreakingChangeType2["TYPE_REMOVED_FROM_UNION"] = "TYPE_REMOVED_FROM_UNION"; - BreakingChangeType2["VALUE_REMOVED_FROM_ENUM"] = "VALUE_REMOVED_FROM_ENUM"; - BreakingChangeType2["REQUIRED_INPUT_FIELD_ADDED"] = "REQUIRED_INPUT_FIELD_ADDED"; - BreakingChangeType2["IMPLEMENTED_INTERFACE_REMOVED"] = "IMPLEMENTED_INTERFACE_REMOVED"; - BreakingChangeType2["FIELD_REMOVED"] = "FIELD_REMOVED"; - BreakingChangeType2["FIELD_CHANGED_KIND"] = "FIELD_CHANGED_KIND"; - BreakingChangeType2["REQUIRED_ARG_ADDED"] = "REQUIRED_ARG_ADDED"; - BreakingChangeType2["ARG_REMOVED"] = "ARG_REMOVED"; - BreakingChangeType2["ARG_CHANGED_KIND"] = "ARG_CHANGED_KIND"; - BreakingChangeType2["DIRECTIVE_REMOVED"] = "DIRECTIVE_REMOVED"; - BreakingChangeType2["DIRECTIVE_ARG_REMOVED"] = "DIRECTIVE_ARG_REMOVED"; - BreakingChangeType2["REQUIRED_DIRECTIVE_ARG_ADDED"] = "REQUIRED_DIRECTIVE_ARG_ADDED"; - BreakingChangeType2["DIRECTIVE_REPEATABLE_REMOVED"] = "DIRECTIVE_REPEATABLE_REMOVED"; - BreakingChangeType2["DIRECTIVE_LOCATION_REMOVED"] = "DIRECTIVE_LOCATION_REMOVED"; -})(BreakingChangeType || (BreakingChangeType = {})); -var DangerousChangeType; -(function(DangerousChangeType2) { - DangerousChangeType2["VALUE_ADDED_TO_ENUM"] = "VALUE_ADDED_TO_ENUM"; - DangerousChangeType2["TYPE_ADDED_TO_UNION"] = "TYPE_ADDED_TO_UNION"; - DangerousChangeType2["OPTIONAL_INPUT_FIELD_ADDED"] = "OPTIONAL_INPUT_FIELD_ADDED"; - DangerousChangeType2["OPTIONAL_ARG_ADDED"] = "OPTIONAL_ARG_ADDED"; - DangerousChangeType2["IMPLEMENTED_INTERFACE_ADDED"] = "IMPLEMENTED_INTERFACE_ADDED"; - DangerousChangeType2["ARG_DEFAULT_VALUE_CHANGE"] = "ARG_DEFAULT_VALUE_CHANGE"; -})(DangerousChangeType || (DangerousChangeType = {})); -function findBreakingChanges(oldSchema, newSchema) { - return findSchemaChanges(oldSchema, newSchema).filter( - (change) => change.type in BreakingChangeType - ); -} -function findDangerousChanges(oldSchema, newSchema) { - 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 (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: 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 (isEnumType(oldType) && isEnumType(newType)) { - schemaChanges.push(...findEnumTypeChanges(oldType, newType)); - } else if (isUnionType(oldType) && isUnionType(newType)) { - schemaChanges.push(...findUnionTypeChanges(oldType, newType)); - } else if (isInputObjectType(oldType) && isInputObjectType(newType)) { - schemaChanges.push(...findInputObjectTypeChanges(oldType, newType)); - } else if (isObjectType(oldType) && isObjectType(newType)) { - schemaChanges.push( - ...findFieldChanges(oldType, newType), - ...findImplementedInterfacesChanges(oldType, newType) - ); - } else if (isInterfaceType(oldType) && 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 (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 !== void 0) { - if (newArg.defaultValue === void 0) { - schemaChanges.push({ - type: DangerousChangeType.ARG_DEFAULT_VALUE_CHANGE, - description: `${oldType.name}.${oldField.name} arg ${oldArg.name} defaultValue was removed.` - }); - } else { - const oldValueStr = stringifyValue2(oldArg.defaultValue, oldArg.type); - const newValueStr = stringifyValue2(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 (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 (isListType(oldType)) { - return ( - // if they're both lists, make sure the underlying types are compatible - isListType(newType) && isChangeSafeForObjectOrInterfaceField( - oldType.ofType, - newType.ofType - ) || // moving from nullable to non-null of the same underlying type is safe - isNonNullType(newType) && isChangeSafeForObjectOrInterfaceField(oldType, newType.ofType) - ); - } - if (isNonNullType(oldType)) { - return isNonNullType(newType) && isChangeSafeForObjectOrInterfaceField(oldType.ofType, newType.ofType); - } - return ( - // if they're both named types, see if their names are equivalent - isNamedType(newType) && oldType.name === newType.name || // moving from nullable to non-null of the same underlying type is safe - isNonNullType(newType) && isChangeSafeForObjectOrInterfaceField(oldType, newType.ofType) - ); -} -function isChangeSafeForInputObjectFieldOrFieldArg(oldType, newType) { - if (isListType(oldType)) { - return isListType(newType) && isChangeSafeForInputObjectFieldOrFieldArg(oldType.ofType, newType.ofType); - } - if (isNonNullType(oldType)) { - return ( - // if they're both non-null, make sure the underlying types are - // compatible - isNonNullType(newType) && isChangeSafeForInputObjectFieldOrFieldArg( - oldType.ofType, - newType.ofType - ) || // moving from non-null to nullable of the same underlying type is safe - !isNonNullType(newType) && isChangeSafeForInputObjectFieldOrFieldArg(oldType.ofType, newType) - ); - } - return isNamedType(newType) && oldType.name === newType.name; -} -function typeKindName(type) { - if (isScalarType(type)) { - return "a Scalar type"; - } - if (isObjectType(type)) { - return "an Object type"; - } - if (isInterfaceType(type)) { - return "an Interface type"; - } - if (isUnionType(type)) { - return "a Union type"; - } - if (isEnumType(type)) { - return "an Enum type"; - } - if (isInputObjectType(type)) { - return "an Input type"; - } - invariant(false, "Unexpected type: " + inspect(type)); -} -function stringifyValue2(value, type) { - const ast = astFromValue(value, type); - ast != null || invariant(false); - return print(sortValueNode(ast)); -} -function diff(oldArray, newArray) { - const added = []; - const removed = []; - const persisted = []; - const oldMap = keyMap(oldArray, ({ name }) => name); - const newMap = keyMap(newArray, ({ name }) => name); - for (const oldItem of oldArray) { - const newItem = newMap[oldItem.name]; - if (newItem === void 0) { - removed.push(oldItem); - } else { - persisted.push([oldItem, newItem]); - } - } - for (const newItem of newArray) { - if (oldMap[newItem.name] === void 0) { - added.push(newItem); - } - } - return { - added, - persisted, - removed - }; -} - -// ../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/utilities/resolveSchemaCoordinate.mjs -function resolveSchemaCoordinate(schema, schemaCoordinate) { - return resolveASTSchemaCoordinate( - schema, - parseSchemaCoordinate(schemaCoordinate) - ); -} -function resolveTypeCoordinate(schema, schemaCoordinate) { - const typeName = schemaCoordinate.name.value; - const type = schema.getType(typeName); - if (type == null) { - return; - } - return { - kind: "NamedType", - type - }; -} -function resolveMemberCoordinate(schema, schemaCoordinate) { - const typeName = schemaCoordinate.name.value; - const type = schema.getType(typeName); - if (!type) { - throw new Error( - `Expected ${inspect(typeName)} to be defined as a type in the schema.` - ); - } - if (!isEnumType(type) && !isInputObjectType(type) && !isObjectType(type) && !isInterfaceType(type)) { - throw new Error( - `Expected ${inspect( - typeName - )} to be an Enum, Input Object, Object or Interface type.` - ); - } - if (isEnumType(type)) { - const enumValueName = schemaCoordinate.memberName.value; - const enumValue = type.getValue(enumValueName); - if (enumValue == null) { - return; - } - return { - kind: "EnumValue", - type, - enumValue - }; - } - if (isInputObjectType(type)) { - const inputFieldName = schemaCoordinate.memberName.value; - const inputField = type.getFields()[inputFieldName]; - if (inputField == null) { - return; - } - return { - kind: "InputField", - type, - inputField - }; - } - const fieldName = schemaCoordinate.memberName.value; - const field = type.getFields()[fieldName]; - if (field == null) { - return; - } - return { - kind: "Field", - type, - field - }; -} -function resolveArgumentCoordinate(schema, schemaCoordinate) { - const typeName = schemaCoordinate.name.value; - const type = schema.getType(typeName); - if (type == null) { - throw new Error( - `Expected ${inspect(typeName)} to be defined as a type in the schema.` - ); - } - if (!isObjectType(type) && !isInterfaceType(type)) { - throw new Error( - `Expected ${inspect(typeName)} to be an object type or interface type.` - ); - } - const fieldName = schemaCoordinate.fieldName.value; - const field = type.getFields()[fieldName]; - if (field == null) { - throw new Error( - `Expected ${inspect(fieldName)} to exist as a field of type ${inspect( - typeName - )} in the schema.` - ); - } - const fieldArgumentName = schemaCoordinate.argumentName.value; - const fieldArgument = field.args.find( - (arg) => arg.name === fieldArgumentName - ); - if (fieldArgument == null) { - return; - } - return { - kind: "FieldArgument", - type, - field, - fieldArgument - }; -} -function resolveDirectiveCoordinate(schema, schemaCoordinate) { - const directiveName = schemaCoordinate.name.value; - const directive = schema.getDirective(directiveName); - if (!directive) { - return; - } - return { - kind: "Directive", - directive - }; -} -function resolveDirectiveArgumentCoordinate(schema, schemaCoordinate) { - const directiveName = schemaCoordinate.name.value; - const directive = schema.getDirective(directiveName); - if (!directive) { - throw new Error( - `Expected ${inspect( - directiveName - )} to be defined as a directive in the schema.` - ); - } - const { - argumentName: { value: directiveArgumentName } - } = schemaCoordinate; - const directiveArgument = directive.args.find( - (arg) => arg.name === directiveArgumentName - ); - if (!directiveArgument) { - return; - } - return { - kind: "DirectiveArgument", - directive, - directiveArgument - }; -} -function resolveASTSchemaCoordinate(schema, schemaCoordinate) { - switch (schemaCoordinate.kind) { - case Kind.TYPE_COORDINATE: - return resolveTypeCoordinate(schema, schemaCoordinate); - case Kind.MEMBER_COORDINATE: - return resolveMemberCoordinate(schema, schemaCoordinate); - case Kind.ARGUMENT_COORDINATE: - return resolveArgumentCoordinate(schema, schemaCoordinate); - case Kind.DIRECTIVE_COORDINATE: - return resolveDirectiveCoordinate(schema, schemaCoordinate); - case Kind.DIRECTIVE_ARGUMENT_COORDINATE: - return resolveDirectiveArgumentCoordinate(schema, schemaCoordinate); - } -} - -export { - version, - versionInfo, - getLocation, - printLocation, - printSourceLocation, - GraphQLError, - printError, - formatError, - syntaxError, - Location, - Token, - OperationTypeNode, - DirectiveLocation, - Kind, - TokenKind, - Lexer, - Source, - parse, - parseValue, - parseConstValue, - parseType, - parseSchemaCoordinate, - BREAK, - visit, - visitInParallel, - getEnterLeaveForKind, - getVisitFn, - print, - valueFromASTUntyped, - assertName, - assertEnumValueName, - isType, - assertType, - isScalarType, - assertScalarType, - isObjectType, - assertObjectType, - isInterfaceType, - assertInterfaceType, - isUnionType, - assertUnionType, - isEnumType, - assertEnumType, - isInputObjectType, - assertInputObjectType, - isListType, - assertListType, - isNonNullType, - assertNonNullType, - isInputType, - assertInputType, - isOutputType, - assertOutputType, - isLeafType, - assertLeafType, - isCompositeType, - assertCompositeType, - isAbstractType, - assertAbstractType, - GraphQLList, - GraphQLNonNull, - isWrappingType, - assertWrappingType, - isNullableType, - assertNullableType, - getNullableType, - isNamedType, - assertNamedType, - getNamedType, - resolveReadonlyArrayThunk, - resolveObjMapThunk, - GraphQLScalarType, - GraphQLObjectType, - isRequiredArgument, - GraphQLInterfaceType, - GraphQLUnionType, - GraphQLEnumType, - GraphQLInputObjectType, - isRequiredInputField, - isEqualType, - isTypeSubTypeOf, - doTypesOverlap, - GRAPHQL_MAX_INT, - GRAPHQL_MIN_INT, - GraphQLInt, - GraphQLFloat, - GraphQLString, - GraphQLBoolean, - GraphQLID, - specifiedScalarTypes, - isSpecifiedScalarType, - isDirective, - assertDirective, - GraphQLDirective, - GraphQLIncludeDirective, - GraphQLSkipDirective, - DEFAULT_DEPRECATION_REASON, - GraphQLDeprecatedDirective, - GraphQLSpecifiedByDirective, - GraphQLOneOfDirective, - specifiedDirectives, - isSpecifiedDirective, - astFromValue, - __Schema, - __Directive, - __DirectiveLocation, - __Type, - __Field, - __InputValue, - __EnumValue, - TypeKind, - __TypeKind, - SchemaMetaFieldDef, - TypeMetaFieldDef, - TypeNameMetaFieldDef, - introspectionTypes, - isIntrospectionType, - isSchema, - assertSchema, - GraphQLSchema, - validateSchema, - assertValidSchema, - typeFromAST, - TypeInfo, - visitWithTypeInfo, - isDefinitionNode, - isExecutableDefinitionNode, - isSelectionNode, - isValueNode, - isConstValueNode, - isTypeNode, - isTypeSystemDefinitionNode, - isTypeDefinitionNode, - isTypeSystemExtensionNode, - isTypeExtensionNode, - isSchemaCoordinateNode, - ExecutableDefinitionsRule, - FieldsOnCorrectTypeRule, - FragmentsOnCompositeTypesRule, - KnownArgumentNamesRule, - KnownDirectivesRule, - KnownFragmentNamesRule, - KnownTypeNamesRule, - LoneAnonymousOperationRule, - LoneSchemaDefinitionRule, - MaxIntrospectionDepthRule, - NoFragmentCyclesRule, - NoUndefinedVariablesRule, - NoUnusedFragmentsRule, - NoUnusedVariablesRule, - OverlappingFieldsCanBeMergedRule, - PossibleFragmentSpreadsRule, - PossibleTypeExtensionsRule, - ProvidedRequiredArgumentsRule, - ScalarLeafsRule, - pathToArray, - coerceInputValue, - valueFromAST, - getVariableValues, - getArgumentValues, - getDirectiveValues, - SingleFieldSubscriptionsRule, - UniqueArgumentDefinitionNamesRule, - UniqueArgumentNamesRule, - UniqueDirectiveNamesRule, - UniqueDirectivesPerLocationRule, - UniqueEnumValueNamesRule, - UniqueFieldDefinitionNamesRule, - UniqueFragmentNamesRule, - UniqueInputFieldNamesRule, - UniqueOperationNamesRule, - UniqueOperationTypesRule, - UniqueTypeNamesRule, - UniqueVariableNamesRule, - ValuesOfCorrectTypeRule, - VariablesAreInputTypesRule, - VariablesInAllowedPositionRule, - recommendedRules, - specifiedRules, - ValidationContext, - validate, - locatedError, - execute, - executeSync, - defaultTypeResolver, - defaultFieldResolver, - graphql, - graphqlSync, - subscribe, - createSourceEventStream, - NoDeprecatedCustomRule, - NoSchemaIntrospectionCustomRule, - getIntrospectionQuery, - getOperationAST, - getOperationRootType, - introspectionFromSchema, - buildClientSchema, - extendSchema, - buildASTSchema, - buildSchema, - lexicographicSortSchema, - printSchema, - printIntrospectionSchema, - printType, - concatAST, - separateOperations, - stripIgnoredCharacters, - assertValidName, - isValidNameError, - BreakingChangeType, - DangerousChangeType, - findBreakingChanges, - findDangerousChanges, - resolveSchemaCoordinate, - resolveASTSchemaCoordinate -}; -//# sourceMappingURL=chunk-JP2PIA6Z.js.map diff --git a/features/landing/frontend-standalone/.vite-cache/deps/chunk-JP2PIA6Z.js.map b/features/landing/frontend-standalone/.vite-cache/deps/chunk-JP2PIA6Z.js.map deleted file mode 100644 index 842e6b176..000000000 --- a/features/landing/frontend-standalone/.vite-cache/deps/chunk-JP2PIA6Z.js.map +++ /dev/null @@ -1,7 +0,0 @@ -{ - "version": 3, - "sources": ["../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/version.mjs", "../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/jsutils/devAssert.mjs", "../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/jsutils/isPromise.mjs", "../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/jsutils/isObjectLike.mjs", "../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/jsutils/invariant.mjs", "../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/language/location.mjs", "../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/language/printLocation.mjs", "../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/error/GraphQLError.mjs", "../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/error/syntaxError.mjs", "../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/language/ast.mjs", "../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/language/directiveLocation.mjs", "../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/language/kinds.mjs", "../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/language/characterClasses.mjs", "../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/language/blockString.mjs", "../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/language/tokenKind.mjs", "../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/language/lexer.mjs", "../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/language/schemaCoordinateLexer.mjs", "../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/jsutils/inspect.mjs", "../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/jsutils/instanceOf.mjs", "../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/language/source.mjs", "../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/language/parser.mjs", "../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/jsutils/didYouMean.mjs", "../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/jsutils/identityFunc.mjs", "../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/jsutils/keyMap.mjs", "../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/jsutils/keyValMap.mjs", "../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/jsutils/mapValue.mjs", "../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/jsutils/naturalCompare.mjs", "../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/jsutils/suggestionList.mjs", "../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/jsutils/toObjMap.mjs", "../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/language/printString.mjs", "../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/language/visitor.mjs", "../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/language/printer.mjs", "../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/utilities/valueFromASTUntyped.mjs", "../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/type/assertName.mjs", "../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/type/definition.mjs", "../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/utilities/typeComparators.mjs", "../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/type/scalars.mjs", "../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/type/directives.mjs", "../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/jsutils/isIterableObject.mjs", "../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/utilities/astFromValue.mjs", "../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/type/introspection.mjs", "../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/type/schema.mjs", "../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/type/validate.mjs", "../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/utilities/typeFromAST.mjs", "../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/utilities/TypeInfo.mjs", "../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/language/predicates.mjs", "../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/validation/rules/ExecutableDefinitionsRule.mjs", "../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/validation/rules/FieldsOnCorrectTypeRule.mjs", "../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/validation/rules/FragmentsOnCompositeTypesRule.mjs", "../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/validation/rules/KnownArgumentNamesRule.mjs", "../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/validation/rules/KnownDirectivesRule.mjs", "../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/validation/rules/KnownFragmentNamesRule.mjs", "../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/validation/rules/KnownTypeNamesRule.mjs", "../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/validation/rules/LoneAnonymousOperationRule.mjs", "../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/validation/rules/LoneSchemaDefinitionRule.mjs", "../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/validation/rules/MaxIntrospectionDepthRule.mjs", "../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/validation/rules/NoFragmentCyclesRule.mjs", "../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/validation/rules/NoUndefinedVariablesRule.mjs", "../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/validation/rules/NoUnusedFragmentsRule.mjs", "../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/validation/rules/NoUnusedVariablesRule.mjs", "../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/utilities/sortValueNode.mjs", "../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/validation/rules/OverlappingFieldsCanBeMergedRule.mjs", "../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/validation/rules/PossibleFragmentSpreadsRule.mjs", "../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/validation/rules/PossibleTypeExtensionsRule.mjs", "../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/validation/rules/ProvidedRequiredArgumentsRule.mjs", "../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/validation/rules/ScalarLeafsRule.mjs", "../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/jsutils/printPathArray.mjs", "../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/jsutils/Path.mjs", "../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/utilities/coerceInputValue.mjs", "../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/utilities/valueFromAST.mjs", "../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/execution/values.mjs", "../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/execution/collectFields.mjs", "../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/validation/rules/SingleFieldSubscriptionsRule.mjs", "../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/jsutils/groupBy.mjs", "../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/validation/rules/UniqueArgumentDefinitionNamesRule.mjs", "../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/validation/rules/UniqueArgumentNamesRule.mjs", "../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/validation/rules/UniqueDirectiveNamesRule.mjs", "../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/validation/rules/UniqueDirectivesPerLocationRule.mjs", "../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/validation/rules/UniqueEnumValueNamesRule.mjs", "../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/validation/rules/UniqueFieldDefinitionNamesRule.mjs", "../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/validation/rules/UniqueFragmentNamesRule.mjs", "../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/validation/rules/UniqueInputFieldNamesRule.mjs", "../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/validation/rules/UniqueOperationNamesRule.mjs", "../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/validation/rules/UniqueOperationTypesRule.mjs", "../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/validation/rules/UniqueTypeNamesRule.mjs", "../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/validation/rules/UniqueVariableNamesRule.mjs", "../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/validation/rules/ValuesOfCorrectTypeRule.mjs", "../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/validation/rules/VariablesAreInputTypesRule.mjs", "../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/validation/rules/VariablesInAllowedPositionRule.mjs", "../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/validation/specifiedRules.mjs", "../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/validation/ValidationContext.mjs", "../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/validation/validate.mjs", "../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/jsutils/memoize3.mjs", "../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/jsutils/promiseForObject.mjs", "../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/jsutils/promiseReduce.mjs", "../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/jsutils/toError.mjs", "../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/error/locatedError.mjs", "../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/execution/execute.mjs", "../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/graphql.mjs", "../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/jsutils/isAsyncIterable.mjs", "../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/execution/mapAsyncIterator.mjs", "../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/execution/subscribe.mjs", "../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/validation/rules/custom/NoDeprecatedCustomRule.mjs", "../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/validation/rules/custom/NoSchemaIntrospectionCustomRule.mjs", "../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/utilities/getIntrospectionQuery.mjs", "../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/utilities/getOperationAST.mjs", "../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/utilities/getOperationRootType.mjs", "../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/utilities/introspectionFromSchema.mjs", "../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/utilities/buildClientSchema.mjs", "../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/utilities/extendSchema.mjs", "../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/utilities/buildASTSchema.mjs", "../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/utilities/lexicographicSortSchema.mjs", "../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/utilities/printSchema.mjs", "../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/utilities/concatAST.mjs", "../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/utilities/separateOperations.mjs", "../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/utilities/stripIgnoredCharacters.mjs", "../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/utilities/assertValidName.mjs", "../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/utilities/findBreakingChanges.mjs", "../../../../../../node_modules/.bun/graphql@16.12.0/node_modules/graphql/utilities/resolveSchemaCoordinate.mjs"], - "sourcesContent": ["// Note: This file is autogenerated using \"resources/gen-version.js\" script and\n// automatically updated by \"npm version\" command.\n\n/**\n * A string containing the version of the GraphQL.js library\n */\nexport const version = '16.12.0';\n/**\n * An object containing the components of the GraphQL.js version string\n */\n\nexport const versionInfo = Object.freeze({\n major: 16,\n minor: 12,\n patch: 0,\n preReleaseTag: null,\n});\n", "export function devAssert(condition, message) {\n const booleanCondition = Boolean(condition);\n\n if (!booleanCondition) {\n throw new Error(message);\n }\n}\n", "/**\n * Returns true if the value acts like a Promise, i.e. has a \"then\" function,\n * otherwise returns false.\n */\nexport function isPromise(value) {\n return (\n typeof (value === null || value === void 0 ? void 0 : value.then) ===\n 'function'\n );\n}\n", "/**\n * Return true if `value` is object-like. A value is object-like if it's not\n * `null` and has a `typeof` result of \"object\".\n */\nexport function isObjectLike(value) {\n return typeof value == 'object' && value !== null;\n}\n", "export function invariant(condition, message) {\n const booleanCondition = Boolean(condition);\n\n if (!booleanCondition) {\n throw new Error(\n message != null ? message : 'Unexpected invariant triggered.',\n );\n }\n}\n", "import { invariant } from '../jsutils/invariant.mjs';\nconst LineRegExp = /\\r\\n|[\\n\\r]/g;\n/**\n * Represents a location in a Source.\n */\n\n/**\n * Takes a Source and a UTF-8 character offset, and returns the corresponding\n * line and column as a SourceLocation.\n */\nexport function getLocation(source, position) {\n let lastLineStart = 0;\n let line = 1;\n\n for (const match of source.body.matchAll(LineRegExp)) {\n typeof match.index === 'number' || invariant(false);\n\n if (match.index >= position) {\n break;\n }\n\n lastLineStart = match.index + match[0].length;\n line += 1;\n }\n\n return {\n line,\n column: position + 1 - lastLineStart,\n };\n}\n", "import { getLocation } from './location.mjs';\n\n/**\n * Render a helpful description of the location in the GraphQL Source document.\n */\nexport function printLocation(location) {\n return printSourceLocation(\n location.source,\n getLocation(location.source, location.start),\n );\n}\n/**\n * Render a helpful description of the location in the GraphQL Source document.\n */\n\nexport function printSourceLocation(source, sourceLocation) {\n const firstLineColumnOffset = source.locationOffset.column - 1;\n const body = ''.padStart(firstLineColumnOffset) + source.body;\n const lineIndex = sourceLocation.line - 1;\n const lineOffset = source.locationOffset.line - 1;\n const lineNum = sourceLocation.line + lineOffset;\n const columnOffset = sourceLocation.line === 1 ? firstLineColumnOffset : 0;\n const columnNum = sourceLocation.column + columnOffset;\n const locationStr = `${source.name}:${lineNum}:${columnNum}\\n`;\n const lines = body.split(/\\r\\n|[\\n\\r]/g);\n const locationLine = lines[lineIndex]; // Special case for minified documents\n\n if (locationLine.length > 120) {\n const subLineIndex = Math.floor(columnNum / 80);\n const subLineColumnNum = columnNum % 80;\n const subLines = [];\n\n for (let i = 0; i < locationLine.length; i += 80) {\n subLines.push(locationLine.slice(i, i + 80));\n }\n\n return (\n locationStr +\n printPrefixedLines([\n [`${lineNum} |`, subLines[0]],\n ...subLines.slice(1, subLineIndex + 1).map((subLine) => ['|', subLine]),\n ['|', '^'.padStart(subLineColumnNum)],\n ['|', subLines[subLineIndex + 1]],\n ])\n );\n }\n\n return (\n locationStr +\n printPrefixedLines([\n // Lines specified like this: [\"prefix\", \"string\"],\n [`${lineNum - 1} |`, lines[lineIndex - 1]],\n [`${lineNum} |`, locationLine],\n ['|', '^'.padStart(columnNum)],\n [`${lineNum + 1} |`, lines[lineIndex + 1]],\n ])\n );\n}\n\nfunction printPrefixedLines(lines) {\n const existingLines = lines.filter(([_, line]) => line !== undefined);\n const padLen = Math.max(...existingLines.map(([prefix]) => prefix.length));\n return existingLines\n .map(([prefix, line]) => prefix.padStart(padLen) + (line ? ' ' + line : ''))\n .join('\\n');\n}\n", "import { isObjectLike } from '../jsutils/isObjectLike.mjs';\nimport { getLocation } from '../language/location.mjs';\nimport {\n printLocation,\n printSourceLocation,\n} from '../language/printLocation.mjs';\n\nfunction toNormalizedOptions(args) {\n const firstArg = args[0];\n\n if (firstArg == null || 'kind' in firstArg || 'length' in firstArg) {\n return {\n nodes: firstArg,\n source: args[1],\n positions: args[2],\n path: args[3],\n originalError: args[4],\n extensions: args[5],\n };\n }\n\n return firstArg;\n}\n/**\n * A GraphQLError describes an Error found during the parse, validate, or\n * execute phases of performing a GraphQL operation. In addition to a message\n * and stack trace, it also includes information about the locations in a\n * GraphQL document and/or execution result that correspond to the Error.\n */\n\nexport class GraphQLError extends Error {\n /**\n * An array of `{ line, column }` locations within the source GraphQL document\n * which correspond to this error.\n *\n * Errors during validation often contain multiple locations, for example to\n * point out two things with the same name. Errors during execution include a\n * single location, the field which produced the error.\n *\n * Enumerable, and appears in the result of JSON.stringify().\n */\n\n /**\n * An array describing the JSON-path into the execution response which\n * corresponds to this error. Only included for errors during execution.\n *\n * Enumerable, and appears in the result of JSON.stringify().\n */\n\n /**\n * An array of GraphQL AST Nodes corresponding to this error.\n */\n\n /**\n * The source GraphQL document for the first location of this error.\n *\n * Note that if this Error represents more than one node, the source may not\n * represent nodes after the first node.\n */\n\n /**\n * An array of character offsets within the source GraphQL document\n * which correspond to this error.\n */\n\n /**\n * The original error thrown from a field resolver during execution.\n */\n\n /**\n * Extension fields to add to the formatted error.\n */\n\n /**\n * @deprecated Please use the `GraphQLErrorOptions` constructor overload instead.\n */\n constructor(message, ...rawArgs) {\n var _this$nodes, _nodeLocations$, _ref;\n\n const { nodes, source, positions, path, originalError, extensions } =\n toNormalizedOptions(rawArgs);\n super(message);\n this.name = 'GraphQLError';\n this.path = path !== null && path !== void 0 ? path : undefined;\n this.originalError =\n originalError !== null && originalError !== void 0\n ? originalError\n : undefined; // Compute list of blame nodes.\n\n this.nodes = undefinedIfEmpty(\n Array.isArray(nodes) ? nodes : nodes ? [nodes] : undefined,\n );\n const nodeLocations = undefinedIfEmpty(\n (_this$nodes = this.nodes) === null || _this$nodes === void 0\n ? void 0\n : _this$nodes.map((node) => node.loc).filter((loc) => loc != null),\n ); // Compute locations in the source for the given nodes/positions.\n\n this.source =\n source !== null && source !== void 0\n ? source\n : nodeLocations === null || nodeLocations === void 0\n ? void 0\n : (_nodeLocations$ = nodeLocations[0]) === null ||\n _nodeLocations$ === void 0\n ? void 0\n : _nodeLocations$.source;\n this.positions =\n positions !== null && positions !== void 0\n ? positions\n : nodeLocations === null || nodeLocations === void 0\n ? void 0\n : nodeLocations.map((loc) => loc.start);\n this.locations =\n positions && source\n ? positions.map((pos) => getLocation(source, pos))\n : nodeLocations === null || nodeLocations === void 0\n ? void 0\n : nodeLocations.map((loc) => getLocation(loc.source, loc.start));\n const originalExtensions = isObjectLike(\n originalError === null || originalError === void 0\n ? void 0\n : originalError.extensions,\n )\n ? originalError === null || originalError === void 0\n ? void 0\n : originalError.extensions\n : undefined;\n this.extensions =\n (_ref =\n extensions !== null && extensions !== void 0\n ? extensions\n : originalExtensions) !== null && _ref !== void 0\n ? _ref\n : Object.create(null); // Only properties prescribed by the spec should be enumerable.\n // Keep the rest as non-enumerable.\n\n Object.defineProperties(this, {\n message: {\n writable: true,\n enumerable: true,\n },\n name: {\n enumerable: false,\n },\n nodes: {\n enumerable: false,\n },\n source: {\n enumerable: false,\n },\n positions: {\n enumerable: false,\n },\n originalError: {\n enumerable: false,\n },\n }); // Include (non-enumerable) stack trace.\n\n /* c8 ignore start */\n // FIXME: https://github.com/graphql/graphql-js/issues/2317\n\n if (\n originalError !== null &&\n originalError !== void 0 &&\n originalError.stack\n ) {\n Object.defineProperty(this, 'stack', {\n value: originalError.stack,\n writable: true,\n configurable: true,\n });\n } else if (Error.captureStackTrace) {\n Error.captureStackTrace(this, GraphQLError);\n } else {\n Object.defineProperty(this, 'stack', {\n value: Error().stack,\n writable: true,\n configurable: true,\n });\n }\n /* c8 ignore stop */\n }\n\n get [Symbol.toStringTag]() {\n return 'GraphQLError';\n }\n\n toString() {\n let output = this.message;\n\n if (this.nodes) {\n for (const node of this.nodes) {\n if (node.loc) {\n output += '\\n\\n' + printLocation(node.loc);\n }\n }\n } else if (this.source && this.locations) {\n for (const location of this.locations) {\n output += '\\n\\n' + printSourceLocation(this.source, location);\n }\n }\n\n return output;\n }\n\n toJSON() {\n const formattedError = {\n message: this.message,\n };\n\n if (this.locations != null) {\n formattedError.locations = this.locations;\n }\n\n if (this.path != null) {\n formattedError.path = this.path;\n }\n\n if (this.extensions != null && Object.keys(this.extensions).length > 0) {\n formattedError.extensions = this.extensions;\n }\n\n return formattedError;\n }\n}\n\nfunction undefinedIfEmpty(array) {\n return array === undefined || array.length === 0 ? undefined : array;\n}\n/**\n * See: https://spec.graphql.org/draft/#sec-Errors\n */\n\n/**\n * Prints a GraphQLError to a string, representing useful location information\n * about the error's position in the source.\n *\n * @deprecated Please use `error.toString` instead. Will be removed in v17\n */\nexport function printError(error) {\n return error.toString();\n}\n/**\n * Given a GraphQLError, format it according to the rules described by the\n * Response Format, Errors section of the GraphQL Specification.\n *\n * @deprecated Please use `error.toJSON` instead. Will be removed in v17\n */\n\nexport function formatError(error) {\n return error.toJSON();\n}\n", "import { GraphQLError } from './GraphQLError.mjs';\n/**\n * Produces a GraphQLError representing a syntax error, containing useful\n * descriptive information about the syntax error's position in the source.\n */\n\nexport function syntaxError(source, position, description) {\n return new GraphQLError(`Syntax Error: ${description}`, {\n source,\n positions: [position],\n });\n}\n", "/**\n * Contains a range of UTF-8 character offsets and token references that\n * identify the region of the source from which the AST derived.\n */\nexport class Location {\n /**\n * The character offset at which this Node begins.\n */\n\n /**\n * The character offset at which this Node ends.\n */\n\n /**\n * The Token at which this Node begins.\n */\n\n /**\n * The Token at which this Node ends.\n */\n\n /**\n * The Source document the AST represents.\n */\n constructor(startToken, endToken, source) {\n this.start = startToken.start;\n this.end = endToken.end;\n this.startToken = startToken;\n this.endToken = endToken;\n this.source = source;\n }\n\n get [Symbol.toStringTag]() {\n return 'Location';\n }\n\n toJSON() {\n return {\n start: this.start,\n end: this.end,\n };\n }\n}\n/**\n * Represents a range of characters represented by a lexical token\n * within a Source.\n */\n\nexport class Token {\n /**\n * The kind of Token.\n */\n\n /**\n * The character offset at which this Node begins.\n */\n\n /**\n * The character offset at which this Node ends.\n */\n\n /**\n * The 1-indexed line number on which this Token appears.\n */\n\n /**\n * The 1-indexed column number at which this Token begins.\n */\n\n /**\n * For non-punctuation tokens, represents the interpreted value of the token.\n *\n * Note: is undefined for punctuation tokens, but typed as string for\n * convenience in the parser.\n */\n\n /**\n * Tokens exist as nodes in a double-linked-list amongst all tokens\n * including ignored tokens. is always the first node and \n * the last.\n */\n constructor(kind, start, end, line, column, value) {\n this.kind = kind;\n this.start = start;\n this.end = end;\n this.line = line;\n this.column = column; // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\n this.value = value;\n this.prev = null;\n this.next = null;\n }\n\n get [Symbol.toStringTag]() {\n return 'Token';\n }\n\n toJSON() {\n return {\n kind: this.kind,\n value: this.value,\n line: this.line,\n column: this.column,\n };\n }\n}\n/**\n * The list of all possible AST node types.\n */\n\n/**\n * @internal\n */\nexport const QueryDocumentKeys = {\n Name: [],\n Document: ['definitions'],\n OperationDefinition: [\n 'description',\n 'name',\n 'variableDefinitions',\n 'directives',\n 'selectionSet',\n ],\n VariableDefinition: [\n 'description',\n 'variable',\n 'type',\n 'defaultValue',\n 'directives',\n ],\n Variable: ['name'],\n SelectionSet: ['selections'],\n Field: ['alias', 'name', 'arguments', 'directives', 'selectionSet'],\n Argument: ['name', 'value'],\n FragmentSpread: ['name', 'directives'],\n InlineFragment: ['typeCondition', 'directives', 'selectionSet'],\n FragmentDefinition: [\n 'description',\n 'name', // Note: fragment variable definitions are deprecated and will removed in v17.0.0\n 'variableDefinitions',\n 'typeCondition',\n 'directives',\n 'selectionSet',\n ],\n IntValue: [],\n FloatValue: [],\n StringValue: [],\n BooleanValue: [],\n NullValue: [],\n EnumValue: [],\n ListValue: ['values'],\n ObjectValue: ['fields'],\n ObjectField: ['name', 'value'],\n Directive: ['name', 'arguments'],\n NamedType: ['name'],\n ListType: ['type'],\n NonNullType: ['type'],\n SchemaDefinition: ['description', 'directives', 'operationTypes'],\n OperationTypeDefinition: ['type'],\n ScalarTypeDefinition: ['description', 'name', 'directives'],\n ObjectTypeDefinition: [\n 'description',\n 'name',\n 'interfaces',\n 'directives',\n 'fields',\n ],\n FieldDefinition: ['description', 'name', 'arguments', 'type', 'directives'],\n InputValueDefinition: [\n 'description',\n 'name',\n 'type',\n 'defaultValue',\n 'directives',\n ],\n InterfaceTypeDefinition: [\n 'description',\n 'name',\n 'interfaces',\n 'directives',\n 'fields',\n ],\n UnionTypeDefinition: ['description', 'name', 'directives', 'types'],\n EnumTypeDefinition: ['description', 'name', 'directives', 'values'],\n EnumValueDefinition: ['description', 'name', 'directives'],\n InputObjectTypeDefinition: ['description', 'name', 'directives', 'fields'],\n DirectiveDefinition: ['description', 'name', 'arguments', 'locations'],\n SchemaExtension: ['directives', 'operationTypes'],\n ScalarTypeExtension: ['name', 'directives'],\n ObjectTypeExtension: ['name', 'interfaces', 'directives', 'fields'],\n InterfaceTypeExtension: ['name', 'interfaces', 'directives', 'fields'],\n UnionTypeExtension: ['name', 'directives', 'types'],\n EnumTypeExtension: ['name', 'directives', 'values'],\n InputObjectTypeExtension: ['name', 'directives', 'fields'],\n TypeCoordinate: ['name'],\n MemberCoordinate: ['name', 'memberName'],\n ArgumentCoordinate: ['name', 'fieldName', 'argumentName'],\n DirectiveCoordinate: ['name'],\n DirectiveArgumentCoordinate: ['name', 'argumentName'],\n};\nconst kindValues = new Set(Object.keys(QueryDocumentKeys));\n/**\n * @internal\n */\n\nexport function isNode(maybeNode) {\n const maybeKind =\n maybeNode === null || maybeNode === void 0 ? void 0 : maybeNode.kind;\n return typeof maybeKind === 'string' && kindValues.has(maybeKind);\n}\n/** Name */\n\nvar OperationTypeNode;\n\n(function (OperationTypeNode) {\n OperationTypeNode['QUERY'] = 'query';\n OperationTypeNode['MUTATION'] = 'mutation';\n OperationTypeNode['SUBSCRIPTION'] = 'subscription';\n})(OperationTypeNode || (OperationTypeNode = {}));\n\nexport { OperationTypeNode };\n", "/**\n * The set of allowed directive location values.\n */\nvar DirectiveLocation;\n\n(function (DirectiveLocation) {\n DirectiveLocation['QUERY'] = 'QUERY';\n DirectiveLocation['MUTATION'] = 'MUTATION';\n DirectiveLocation['SUBSCRIPTION'] = 'SUBSCRIPTION';\n DirectiveLocation['FIELD'] = 'FIELD';\n DirectiveLocation['FRAGMENT_DEFINITION'] = 'FRAGMENT_DEFINITION';\n DirectiveLocation['FRAGMENT_SPREAD'] = 'FRAGMENT_SPREAD';\n DirectiveLocation['INLINE_FRAGMENT'] = 'INLINE_FRAGMENT';\n DirectiveLocation['VARIABLE_DEFINITION'] = 'VARIABLE_DEFINITION';\n DirectiveLocation['SCHEMA'] = 'SCHEMA';\n DirectiveLocation['SCALAR'] = 'SCALAR';\n DirectiveLocation['OBJECT'] = 'OBJECT';\n DirectiveLocation['FIELD_DEFINITION'] = 'FIELD_DEFINITION';\n DirectiveLocation['ARGUMENT_DEFINITION'] = 'ARGUMENT_DEFINITION';\n DirectiveLocation['INTERFACE'] = 'INTERFACE';\n DirectiveLocation['UNION'] = 'UNION';\n DirectiveLocation['ENUM'] = 'ENUM';\n DirectiveLocation['ENUM_VALUE'] = 'ENUM_VALUE';\n DirectiveLocation['INPUT_OBJECT'] = 'INPUT_OBJECT';\n DirectiveLocation['INPUT_FIELD_DEFINITION'] = 'INPUT_FIELD_DEFINITION';\n})(DirectiveLocation || (DirectiveLocation = {}));\n\nexport { DirectiveLocation };\n/**\n * The enum type representing the directive location values.\n *\n * @deprecated Please use `DirectiveLocation`. Will be remove in v17.\n */\n", "/**\n * The set of allowed kind values for AST nodes.\n */\nvar Kind;\n\n(function (Kind) {\n Kind['NAME'] = 'Name';\n Kind['DOCUMENT'] = 'Document';\n Kind['OPERATION_DEFINITION'] = 'OperationDefinition';\n Kind['VARIABLE_DEFINITION'] = 'VariableDefinition';\n Kind['SELECTION_SET'] = 'SelectionSet';\n Kind['FIELD'] = 'Field';\n Kind['ARGUMENT'] = 'Argument';\n Kind['FRAGMENT_SPREAD'] = 'FragmentSpread';\n Kind['INLINE_FRAGMENT'] = 'InlineFragment';\n Kind['FRAGMENT_DEFINITION'] = 'FragmentDefinition';\n Kind['VARIABLE'] = 'Variable';\n Kind['INT'] = 'IntValue';\n Kind['FLOAT'] = 'FloatValue';\n Kind['STRING'] = 'StringValue';\n Kind['BOOLEAN'] = 'BooleanValue';\n Kind['NULL'] = 'NullValue';\n Kind['ENUM'] = 'EnumValue';\n Kind['LIST'] = 'ListValue';\n Kind['OBJECT'] = 'ObjectValue';\n Kind['OBJECT_FIELD'] = 'ObjectField';\n Kind['DIRECTIVE'] = 'Directive';\n Kind['NAMED_TYPE'] = 'NamedType';\n Kind['LIST_TYPE'] = 'ListType';\n Kind['NON_NULL_TYPE'] = 'NonNullType';\n Kind['SCHEMA_DEFINITION'] = 'SchemaDefinition';\n Kind['OPERATION_TYPE_DEFINITION'] = 'OperationTypeDefinition';\n Kind['SCALAR_TYPE_DEFINITION'] = 'ScalarTypeDefinition';\n Kind['OBJECT_TYPE_DEFINITION'] = 'ObjectTypeDefinition';\n Kind['FIELD_DEFINITION'] = 'FieldDefinition';\n Kind['INPUT_VALUE_DEFINITION'] = 'InputValueDefinition';\n Kind['INTERFACE_TYPE_DEFINITION'] = 'InterfaceTypeDefinition';\n Kind['UNION_TYPE_DEFINITION'] = 'UnionTypeDefinition';\n Kind['ENUM_TYPE_DEFINITION'] = 'EnumTypeDefinition';\n Kind['ENUM_VALUE_DEFINITION'] = 'EnumValueDefinition';\n Kind['INPUT_OBJECT_TYPE_DEFINITION'] = 'InputObjectTypeDefinition';\n Kind['DIRECTIVE_DEFINITION'] = 'DirectiveDefinition';\n Kind['SCHEMA_EXTENSION'] = 'SchemaExtension';\n Kind['SCALAR_TYPE_EXTENSION'] = 'ScalarTypeExtension';\n Kind['OBJECT_TYPE_EXTENSION'] = 'ObjectTypeExtension';\n Kind['INTERFACE_TYPE_EXTENSION'] = 'InterfaceTypeExtension';\n Kind['UNION_TYPE_EXTENSION'] = 'UnionTypeExtension';\n Kind['ENUM_TYPE_EXTENSION'] = 'EnumTypeExtension';\n Kind['INPUT_OBJECT_TYPE_EXTENSION'] = 'InputObjectTypeExtension';\n Kind['TYPE_COORDINATE'] = 'TypeCoordinate';\n Kind['MEMBER_COORDINATE'] = 'MemberCoordinate';\n Kind['ARGUMENT_COORDINATE'] = 'ArgumentCoordinate';\n Kind['DIRECTIVE_COORDINATE'] = 'DirectiveCoordinate';\n Kind['DIRECTIVE_ARGUMENT_COORDINATE'] = 'DirectiveArgumentCoordinate';\n})(Kind || (Kind = {}));\n\nexport { Kind };\n/**\n * The enum type representing the possible kind values of AST nodes.\n *\n * @deprecated Please use `Kind`. Will be remove in v17.\n */\n", "/**\n * ```\n * WhiteSpace ::\n * - \"Horizontal Tab (U+0009)\"\n * - \"Space (U+0020)\"\n * ```\n * @internal\n */\nexport function isWhiteSpace(code) {\n return code === 0x0009 || code === 0x0020;\n}\n/**\n * ```\n * Digit :: one of\n * - `0` `1` `2` `3` `4` `5` `6` `7` `8` `9`\n * ```\n * @internal\n */\n\nexport function isDigit(code) {\n return code >= 0x0030 && code <= 0x0039;\n}\n/**\n * ```\n * Letter :: one of\n * - `A` `B` `C` `D` `E` `F` `G` `H` `I` `J` `K` `L` `M`\n * - `N` `O` `P` `Q` `R` `S` `T` `U` `V` `W` `X` `Y` `Z`\n * - `a` `b` `c` `d` `e` `f` `g` `h` `i` `j` `k` `l` `m`\n * - `n` `o` `p` `q` `r` `s` `t` `u` `v` `w` `x` `y` `z`\n * ```\n * @internal\n */\n\nexport function isLetter(code) {\n return (\n (code >= 0x0061 && code <= 0x007a) || // A-Z\n (code >= 0x0041 && code <= 0x005a) // a-z\n );\n}\n/**\n * ```\n * NameStart ::\n * - Letter\n * - `_`\n * ```\n * @internal\n */\n\nexport function isNameStart(code) {\n return isLetter(code) || code === 0x005f;\n}\n/**\n * ```\n * NameContinue ::\n * - Letter\n * - Digit\n * - `_`\n * ```\n * @internal\n */\n\nexport function isNameContinue(code) {\n return isLetter(code) || isDigit(code) || code === 0x005f;\n}\n", "import { isWhiteSpace } from './characterClasses.mjs';\n/**\n * Produces the value of a block string from its parsed raw value, similar to\n * CoffeeScript's block string, Python's docstring trim or Ruby's strip_heredoc.\n *\n * This implements the GraphQL spec's BlockStringValue() static algorithm.\n *\n * @internal\n */\n\nexport function dedentBlockStringLines(lines) {\n var _firstNonEmptyLine2;\n\n let commonIndent = Number.MAX_SAFE_INTEGER;\n let firstNonEmptyLine = null;\n let lastNonEmptyLine = -1;\n\n for (let i = 0; i < lines.length; ++i) {\n var _firstNonEmptyLine;\n\n const line = lines[i];\n const indent = leadingWhitespace(line);\n\n if (indent === line.length) {\n continue; // skip empty lines\n }\n\n firstNonEmptyLine =\n (_firstNonEmptyLine = firstNonEmptyLine) !== null &&\n _firstNonEmptyLine !== void 0\n ? _firstNonEmptyLine\n : i;\n lastNonEmptyLine = i;\n\n if (i !== 0 && indent < commonIndent) {\n commonIndent = indent;\n }\n }\n\n return lines // Remove common indentation from all lines but first.\n .map((line, i) => (i === 0 ? line : line.slice(commonIndent))) // Remove leading and trailing blank lines.\n .slice(\n (_firstNonEmptyLine2 = firstNonEmptyLine) !== null &&\n _firstNonEmptyLine2 !== void 0\n ? _firstNonEmptyLine2\n : 0,\n lastNonEmptyLine + 1,\n );\n}\n\nfunction leadingWhitespace(str) {\n let i = 0;\n\n while (i < str.length && isWhiteSpace(str.charCodeAt(i))) {\n ++i;\n }\n\n return i;\n}\n/**\n * @internal\n */\n\nexport function isPrintableAsBlockString(value) {\n if (value === '') {\n return true; // empty string is printable\n }\n\n let isEmptyLine = true;\n let hasIndent = false;\n let hasCommonIndent = true;\n let seenNonEmptyLine = false;\n\n for (let i = 0; i < value.length; ++i) {\n switch (value.codePointAt(i)) {\n case 0x0000:\n case 0x0001:\n case 0x0002:\n case 0x0003:\n case 0x0004:\n case 0x0005:\n case 0x0006:\n case 0x0007:\n case 0x0008:\n case 0x000b:\n case 0x000c:\n case 0x000e:\n case 0x000f:\n return false;\n // Has non-printable characters\n\n case 0x000d:\n // \\r\n return false;\n // Has \\r or \\r\\n which will be replaced as \\n\n\n case 10:\n // \\n\n if (isEmptyLine && !seenNonEmptyLine) {\n return false; // Has leading new line\n }\n\n seenNonEmptyLine = true;\n isEmptyLine = true;\n hasIndent = false;\n break;\n\n case 9: // \\t\n\n case 32:\n // \n hasIndent || (hasIndent = isEmptyLine);\n break;\n\n default:\n hasCommonIndent && (hasCommonIndent = hasIndent);\n isEmptyLine = false;\n }\n }\n\n if (isEmptyLine) {\n return false; // Has trailing empty lines\n }\n\n if (hasCommonIndent && seenNonEmptyLine) {\n return false; // Has internal indent\n }\n\n return true;\n}\n/**\n * Print a block string in the indented block form by adding a leading and\n * trailing blank line. However, if a block string starts with whitespace and is\n * a single-line, adding a leading blank line would strip that whitespace.\n *\n * @internal\n */\n\nexport function printBlockString(value, options) {\n const escapedValue = value.replace(/\"\"\"/g, '\\\\\"\"\"'); // Expand a block string's raw value into independent lines.\n\n const lines = escapedValue.split(/\\r\\n|[\\n\\r]/g);\n const isSingleLine = lines.length === 1; // If common indentation is found we can fix some of those cases by adding leading new line\n\n const forceLeadingNewLine =\n lines.length > 1 &&\n lines\n .slice(1)\n .every((line) => line.length === 0 || isWhiteSpace(line.charCodeAt(0))); // Trailing triple quotes just looks confusing but doesn't force trailing new line\n\n const hasTrailingTripleQuotes = escapedValue.endsWith('\\\\\"\"\"'); // Trailing quote (single or double) or slash forces trailing new line\n\n const hasTrailingQuote = value.endsWith('\"') && !hasTrailingTripleQuotes;\n const hasTrailingSlash = value.endsWith('\\\\');\n const forceTrailingNewline = hasTrailingQuote || hasTrailingSlash;\n const printAsMultipleLines =\n !(options !== null && options !== void 0 && options.minimize) && // add leading and trailing new lines only if it improves readability\n (!isSingleLine ||\n value.length > 70 ||\n forceTrailingNewline ||\n forceLeadingNewLine ||\n hasTrailingTripleQuotes);\n let result = ''; // Format a multi-line block quote to account for leading space.\n\n const skipLeadingNewLine = isSingleLine && isWhiteSpace(value.charCodeAt(0));\n\n if ((printAsMultipleLines && !skipLeadingNewLine) || forceLeadingNewLine) {\n result += '\\n';\n }\n\n result += escapedValue;\n\n if (printAsMultipleLines || forceTrailingNewline) {\n result += '\\n';\n }\n\n return '\"\"\"' + result + '\"\"\"';\n}\n", "/**\n * An exported enum describing the different kinds of tokens that the\n * lexer emits.\n */\nvar TokenKind;\n\n(function (TokenKind) {\n TokenKind['SOF'] = '';\n TokenKind['EOF'] = '';\n TokenKind['BANG'] = '!';\n TokenKind['DOLLAR'] = '$';\n TokenKind['AMP'] = '&';\n TokenKind['PAREN_L'] = '(';\n TokenKind['PAREN_R'] = ')';\n TokenKind['DOT'] = '.';\n TokenKind['SPREAD'] = '...';\n TokenKind['COLON'] = ':';\n TokenKind['EQUALS'] = '=';\n TokenKind['AT'] = '@';\n TokenKind['BRACKET_L'] = '[';\n TokenKind['BRACKET_R'] = ']';\n TokenKind['BRACE_L'] = '{';\n TokenKind['PIPE'] = '|';\n TokenKind['BRACE_R'] = '}';\n TokenKind['NAME'] = 'Name';\n TokenKind['INT'] = 'Int';\n TokenKind['FLOAT'] = 'Float';\n TokenKind['STRING'] = 'String';\n TokenKind['BLOCK_STRING'] = 'BlockString';\n TokenKind['COMMENT'] = 'Comment';\n})(TokenKind || (TokenKind = {}));\n\nexport { TokenKind };\n/**\n * The enum type representing the token kinds values.\n *\n * @deprecated Please use `TokenKind`. Will be remove in v17.\n */\n", "import { syntaxError } from '../error/syntaxError.mjs';\nimport { Token } from './ast.mjs';\nimport { dedentBlockStringLines } from './blockString.mjs';\nimport { isDigit, isNameContinue, isNameStart } from './characterClasses.mjs';\nimport { TokenKind } from './tokenKind.mjs';\n/**\n * A Lexer interface which provides common properties and methods required for\n * lexing GraphQL source.\n *\n * @internal\n */\n\n/**\n * Given a Source object, creates a Lexer for that source.\n * A Lexer is a stateful stream generator in that every time\n * it is advanced, it returns the next token in the Source. Assuming the\n * source lexes, the final Token emitted by the lexer will be of kind\n * EOF, after which the lexer will repeatedly return the same EOF token\n * whenever called.\n */\nexport class Lexer {\n /**\n * The previously focused non-ignored token.\n */\n\n /**\n * The currently focused non-ignored token.\n */\n\n /**\n * The (1-indexed) line containing the current token.\n */\n\n /**\n * The character offset at which the current line begins.\n */\n constructor(source) {\n const startOfFileToken = new Token(TokenKind.SOF, 0, 0, 0, 0);\n this.source = source;\n this.lastToken = startOfFileToken;\n this.token = startOfFileToken;\n this.line = 1;\n this.lineStart = 0;\n }\n\n get [Symbol.toStringTag]() {\n return 'Lexer';\n }\n /**\n * Advances the token stream to the next non-ignored token.\n */\n\n advance() {\n this.lastToken = this.token;\n const token = (this.token = this.lookahead());\n return token;\n }\n /**\n * Looks ahead and returns the next non-ignored token, but does not change\n * the state of Lexer.\n */\n\n lookahead() {\n let token = this.token;\n\n if (token.kind !== TokenKind.EOF) {\n do {\n if (token.next) {\n token = token.next;\n } else {\n // Read the next token and form a link in the token linked-list.\n const nextToken = readNextToken(this, token.end); // @ts-expect-error next is only mutable during parsing.\n\n token.next = nextToken; // @ts-expect-error prev is only mutable during parsing.\n\n nextToken.prev = token;\n token = nextToken;\n }\n } while (token.kind === TokenKind.COMMENT);\n }\n\n return token;\n }\n}\n/**\n * @internal\n */\n\nexport function isPunctuatorTokenKind(kind) {\n return (\n kind === TokenKind.BANG ||\n kind === TokenKind.DOLLAR ||\n kind === TokenKind.AMP ||\n kind === TokenKind.PAREN_L ||\n kind === TokenKind.PAREN_R ||\n kind === TokenKind.DOT ||\n kind === TokenKind.SPREAD ||\n kind === TokenKind.COLON ||\n kind === TokenKind.EQUALS ||\n kind === TokenKind.AT ||\n kind === TokenKind.BRACKET_L ||\n kind === TokenKind.BRACKET_R ||\n kind === TokenKind.BRACE_L ||\n kind === TokenKind.PIPE ||\n kind === TokenKind.BRACE_R\n );\n}\n/**\n * A Unicode scalar value is any Unicode code point except surrogate code\n * points. In other words, the inclusive ranges of values 0x0000 to 0xD7FF and\n * 0xE000 to 0x10FFFF.\n *\n * SourceCharacter ::\n * - \"Any Unicode scalar value\"\n */\n\nfunction isUnicodeScalarValue(code) {\n return (\n (code >= 0x0000 && code <= 0xd7ff) || (code >= 0xe000 && code <= 0x10ffff)\n );\n}\n/**\n * The GraphQL specification defines source text as a sequence of unicode scalar\n * values (which Unicode defines to exclude surrogate code points). However\n * JavaScript defines strings as a sequence of UTF-16 code units which may\n * include surrogates. A surrogate pair is a valid source character as it\n * encodes a supplementary code point (above U+FFFF), but unpaired surrogate\n * code points are not valid source characters.\n */\n\nfunction isSupplementaryCodePoint(body, location) {\n return (\n isLeadingSurrogate(body.charCodeAt(location)) &&\n isTrailingSurrogate(body.charCodeAt(location + 1))\n );\n}\n\nfunction isLeadingSurrogate(code) {\n return code >= 0xd800 && code <= 0xdbff;\n}\n\nfunction isTrailingSurrogate(code) {\n return code >= 0xdc00 && code <= 0xdfff;\n}\n/**\n * Prints the code point (or end of file reference) at a given location in a\n * source for use in error messages.\n *\n * Printable ASCII is printed quoted, while other points are printed in Unicode\n * code point form (ie. U+1234).\n *\n * @internal\n */\n\nexport function printCodePointAt(lexer, location) {\n const code = lexer.source.body.codePointAt(location);\n\n if (code === undefined) {\n return TokenKind.EOF;\n } else if (code >= 0x0020 && code <= 0x007e) {\n // Printable ASCII\n const char = String.fromCodePoint(code);\n return char === '\"' ? \"'\\\"'\" : `\"${char}\"`;\n } // Unicode code point\n\n return 'U+' + code.toString(16).toUpperCase().padStart(4, '0');\n}\n/**\n * Create a token with line and column location information.\n *\n * @internal\n */\n\nexport function createToken(lexer, kind, start, end, value) {\n const line = lexer.line;\n const col = 1 + start - lexer.lineStart;\n return new Token(kind, start, end, line, col, value);\n}\n/**\n * Gets the next token from the source starting at the given position.\n *\n * This skips over whitespace until it finds the next lexable token, then lexes\n * punctuators immediately or calls the appropriate helper function for more\n * complicated tokens.\n */\n\nfunction readNextToken(lexer, start) {\n const body = lexer.source.body;\n const bodyLength = body.length;\n let position = start;\n\n while (position < bodyLength) {\n const code = body.charCodeAt(position); // SourceCharacter\n\n switch (code) {\n // Ignored ::\n // - UnicodeBOM\n // - WhiteSpace\n // - LineTerminator\n // - Comment\n // - Comma\n //\n // UnicodeBOM :: \"Byte Order Mark (U+FEFF)\"\n //\n // WhiteSpace ::\n // - \"Horizontal Tab (U+0009)\"\n // - \"Space (U+0020)\"\n //\n // Comma :: ,\n case 0xfeff: // \n\n case 0x0009: // \\t\n\n case 0x0020: // \n\n case 0x002c:\n // ,\n ++position;\n continue;\n // LineTerminator ::\n // - \"New Line (U+000A)\"\n // - \"Carriage Return (U+000D)\" [lookahead != \"New Line (U+000A)\"]\n // - \"Carriage Return (U+000D)\" \"New Line (U+000A)\"\n\n case 0x000a:\n // \\n\n ++position;\n ++lexer.line;\n lexer.lineStart = position;\n continue;\n\n case 0x000d:\n // \\r\n if (body.charCodeAt(position + 1) === 0x000a) {\n position += 2;\n } else {\n ++position;\n }\n\n ++lexer.line;\n lexer.lineStart = position;\n continue;\n // Comment\n\n case 0x0023:\n // #\n return readComment(lexer, position);\n // Token ::\n // - Punctuator\n // - Name\n // - IntValue\n // - FloatValue\n // - StringValue\n //\n // Punctuator :: one of ! $ & ( ) ... : = @ [ ] { | }\n\n case 0x0021:\n // !\n return createToken(lexer, TokenKind.BANG, position, position + 1);\n\n case 0x0024:\n // $\n return createToken(lexer, TokenKind.DOLLAR, position, position + 1);\n\n case 0x0026:\n // &\n return createToken(lexer, TokenKind.AMP, position, position + 1);\n\n case 0x0028:\n // (\n return createToken(lexer, TokenKind.PAREN_L, position, position + 1);\n\n case 0x0029:\n // )\n return createToken(lexer, TokenKind.PAREN_R, position, position + 1);\n\n case 0x002e:\n // .\n if (\n body.charCodeAt(position + 1) === 0x002e &&\n body.charCodeAt(position + 2) === 0x002e\n ) {\n return createToken(lexer, TokenKind.SPREAD, position, position + 3);\n }\n\n break;\n\n case 0x003a:\n // :\n return createToken(lexer, TokenKind.COLON, position, position + 1);\n\n case 0x003d:\n // =\n return createToken(lexer, TokenKind.EQUALS, position, position + 1);\n\n case 0x0040:\n // @\n return createToken(lexer, TokenKind.AT, position, position + 1);\n\n case 0x005b:\n // [\n return createToken(lexer, TokenKind.BRACKET_L, position, position + 1);\n\n case 0x005d:\n // ]\n return createToken(lexer, TokenKind.BRACKET_R, position, position + 1);\n\n case 0x007b:\n // {\n return createToken(lexer, TokenKind.BRACE_L, position, position + 1);\n\n case 0x007c:\n // |\n return createToken(lexer, TokenKind.PIPE, position, position + 1);\n\n case 0x007d:\n // }\n return createToken(lexer, TokenKind.BRACE_R, position, position + 1);\n // StringValue\n\n case 0x0022:\n // \"\n if (\n body.charCodeAt(position + 1) === 0x0022 &&\n body.charCodeAt(position + 2) === 0x0022\n ) {\n return readBlockString(lexer, position);\n }\n\n return readString(lexer, position);\n } // IntValue | FloatValue (Digit | -)\n\n if (isDigit(code) || code === 0x002d) {\n return readNumber(lexer, position, code);\n } // Name\n\n if (isNameStart(code)) {\n return readName(lexer, position);\n }\n\n throw syntaxError(\n lexer.source,\n position,\n code === 0x0027\n ? 'Unexpected single quote character (\\'), did you mean to use a double quote (\")?'\n : isUnicodeScalarValue(code) || isSupplementaryCodePoint(body, position)\n ? `Unexpected character: ${printCodePointAt(lexer, position)}.`\n : `Invalid character: ${printCodePointAt(lexer, position)}.`,\n );\n }\n\n return createToken(lexer, TokenKind.EOF, bodyLength, bodyLength);\n}\n/**\n * Reads a comment token from the source file.\n *\n * ```\n * Comment :: # CommentChar* [lookahead != CommentChar]\n *\n * CommentChar :: SourceCharacter but not LineTerminator\n * ```\n */\n\nfunction readComment(lexer, start) {\n const body = lexer.source.body;\n const bodyLength = body.length;\n let position = start + 1;\n\n while (position < bodyLength) {\n const code = body.charCodeAt(position); // LineTerminator (\\n | \\r)\n\n if (code === 0x000a || code === 0x000d) {\n break;\n } // SourceCharacter\n\n if (isUnicodeScalarValue(code)) {\n ++position;\n } else if (isSupplementaryCodePoint(body, position)) {\n position += 2;\n } else {\n break;\n }\n }\n\n return createToken(\n lexer,\n TokenKind.COMMENT,\n start,\n position,\n body.slice(start + 1, position),\n );\n}\n/**\n * Reads a number token from the source file, either a FloatValue or an IntValue\n * depending on whether a FractionalPart or ExponentPart is encountered.\n *\n * ```\n * IntValue :: IntegerPart [lookahead != {Digit, `.`, NameStart}]\n *\n * IntegerPart ::\n * - NegativeSign? 0\n * - NegativeSign? NonZeroDigit Digit*\n *\n * NegativeSign :: -\n *\n * NonZeroDigit :: Digit but not `0`\n *\n * FloatValue ::\n * - IntegerPart FractionalPart ExponentPart [lookahead != {Digit, `.`, NameStart}]\n * - IntegerPart FractionalPart [lookahead != {Digit, `.`, NameStart}]\n * - IntegerPart ExponentPart [lookahead != {Digit, `.`, NameStart}]\n *\n * FractionalPart :: . Digit+\n *\n * ExponentPart :: ExponentIndicator Sign? Digit+\n *\n * ExponentIndicator :: one of `e` `E`\n *\n * Sign :: one of + -\n * ```\n */\n\nfunction readNumber(lexer, start, firstCode) {\n const body = lexer.source.body;\n let position = start;\n let code = firstCode;\n let isFloat = false; // NegativeSign (-)\n\n if (code === 0x002d) {\n code = body.charCodeAt(++position);\n } // Zero (0)\n\n if (code === 0x0030) {\n code = body.charCodeAt(++position);\n\n if (isDigit(code)) {\n throw syntaxError(\n lexer.source,\n position,\n `Invalid number, unexpected digit after 0: ${printCodePointAt(\n lexer,\n position,\n )}.`,\n );\n }\n } else {\n position = readDigits(lexer, position, code);\n code = body.charCodeAt(position);\n } // Full stop (.)\n\n if (code === 0x002e) {\n isFloat = true;\n code = body.charCodeAt(++position);\n position = readDigits(lexer, position, code);\n code = body.charCodeAt(position);\n } // E e\n\n if (code === 0x0045 || code === 0x0065) {\n isFloat = true;\n code = body.charCodeAt(++position); // + -\n\n if (code === 0x002b || code === 0x002d) {\n code = body.charCodeAt(++position);\n }\n\n position = readDigits(lexer, position, code);\n code = body.charCodeAt(position);\n } // Numbers cannot be followed by . or NameStart\n\n if (code === 0x002e || isNameStart(code)) {\n throw syntaxError(\n lexer.source,\n position,\n `Invalid number, expected digit but got: ${printCodePointAt(\n lexer,\n position,\n )}.`,\n );\n }\n\n return createToken(\n lexer,\n isFloat ? TokenKind.FLOAT : TokenKind.INT,\n start,\n position,\n body.slice(start, position),\n );\n}\n/**\n * Returns the new position in the source after reading one or more digits.\n */\n\nfunction readDigits(lexer, start, firstCode) {\n if (!isDigit(firstCode)) {\n throw syntaxError(\n lexer.source,\n start,\n `Invalid number, expected digit but got: ${printCodePointAt(\n lexer,\n start,\n )}.`,\n );\n }\n\n const body = lexer.source.body;\n let position = start + 1; // +1 to skip first firstCode\n\n while (isDigit(body.charCodeAt(position))) {\n ++position;\n }\n\n return position;\n}\n/**\n * Reads a single-quote string token from the source file.\n *\n * ```\n * StringValue ::\n * - `\"\"` [lookahead != `\"`]\n * - `\"` StringCharacter+ `\"`\n *\n * StringCharacter ::\n * - SourceCharacter but not `\"` or `\\` or LineTerminator\n * - `\\u` EscapedUnicode\n * - `\\` EscapedCharacter\n *\n * EscapedUnicode ::\n * - `{` HexDigit+ `}`\n * - HexDigit HexDigit HexDigit HexDigit\n *\n * EscapedCharacter :: one of `\"` `\\` `/` `b` `f` `n` `r` `t`\n * ```\n */\n\nfunction readString(lexer, start) {\n const body = lexer.source.body;\n const bodyLength = body.length;\n let position = start + 1;\n let chunkStart = position;\n let value = '';\n\n while (position < bodyLength) {\n const code = body.charCodeAt(position); // Closing Quote (\")\n\n if (code === 0x0022) {\n value += body.slice(chunkStart, position);\n return createToken(lexer, TokenKind.STRING, start, position + 1, value);\n } // Escape Sequence (\\)\n\n if (code === 0x005c) {\n value += body.slice(chunkStart, position);\n const escape =\n body.charCodeAt(position + 1) === 0x0075 // u\n ? body.charCodeAt(position + 2) === 0x007b // {\n ? readEscapedUnicodeVariableWidth(lexer, position)\n : readEscapedUnicodeFixedWidth(lexer, position)\n : readEscapedCharacter(lexer, position);\n value += escape.value;\n position += escape.size;\n chunkStart = position;\n continue;\n } // LineTerminator (\\n | \\r)\n\n if (code === 0x000a || code === 0x000d) {\n break;\n } // SourceCharacter\n\n if (isUnicodeScalarValue(code)) {\n ++position;\n } else if (isSupplementaryCodePoint(body, position)) {\n position += 2;\n } else {\n throw syntaxError(\n lexer.source,\n position,\n `Invalid character within String: ${printCodePointAt(\n lexer,\n position,\n )}.`,\n );\n }\n }\n\n throw syntaxError(lexer.source, position, 'Unterminated string.');\n} // The string value and lexed size of an escape sequence.\n\nfunction readEscapedUnicodeVariableWidth(lexer, position) {\n const body = lexer.source.body;\n let point = 0;\n let size = 3; // Cannot be larger than 12 chars (\\u{00000000}).\n\n while (size < 12) {\n const code = body.charCodeAt(position + size++); // Closing Brace (})\n\n if (code === 0x007d) {\n // Must be at least 5 chars (\\u{0}) and encode a Unicode scalar value.\n if (size < 5 || !isUnicodeScalarValue(point)) {\n break;\n }\n\n return {\n value: String.fromCodePoint(point),\n size,\n };\n } // Append this hex digit to the code point.\n\n point = (point << 4) | readHexDigit(code);\n\n if (point < 0) {\n break;\n }\n }\n\n throw syntaxError(\n lexer.source,\n position,\n `Invalid Unicode escape sequence: \"${body.slice(\n position,\n position + size,\n )}\".`,\n );\n}\n\nfunction readEscapedUnicodeFixedWidth(lexer, position) {\n const body = lexer.source.body;\n const code = read16BitHexCode(body, position + 2);\n\n if (isUnicodeScalarValue(code)) {\n return {\n value: String.fromCodePoint(code),\n size: 6,\n };\n } // GraphQL allows JSON-style surrogate pair escape sequences, but only when\n // a valid pair is formed.\n\n if (isLeadingSurrogate(code)) {\n // \\u\n if (\n body.charCodeAt(position + 6) === 0x005c &&\n body.charCodeAt(position + 7) === 0x0075\n ) {\n const trailingCode = read16BitHexCode(body, position + 8);\n\n if (isTrailingSurrogate(trailingCode)) {\n // JavaScript defines strings as a sequence of UTF-16 code units and\n // encodes Unicode code points above U+FFFF using a surrogate pair of\n // code units. Since this is a surrogate pair escape sequence, just\n // include both codes into the JavaScript string value. Had JavaScript\n // not been internally based on UTF-16, then this surrogate pair would\n // be decoded to retrieve the supplementary code point.\n return {\n value: String.fromCodePoint(code, trailingCode),\n size: 12,\n };\n }\n }\n }\n\n throw syntaxError(\n lexer.source,\n position,\n `Invalid Unicode escape sequence: \"${body.slice(position, position + 6)}\".`,\n );\n}\n/**\n * Reads four hexadecimal characters and returns the positive integer that 16bit\n * hexadecimal string represents. For example, \"000f\" will return 15, and \"dead\"\n * will return 57005.\n *\n * Returns a negative number if any char was not a valid hexadecimal digit.\n */\n\nfunction read16BitHexCode(body, position) {\n // readHexDigit() returns -1 on error. ORing a negative value with any other\n // value always produces a negative value.\n return (\n (readHexDigit(body.charCodeAt(position)) << 12) |\n (readHexDigit(body.charCodeAt(position + 1)) << 8) |\n (readHexDigit(body.charCodeAt(position + 2)) << 4) |\n readHexDigit(body.charCodeAt(position + 3))\n );\n}\n/**\n * Reads a hexadecimal character and returns its positive integer value (0-15).\n *\n * '0' becomes 0, '9' becomes 9\n * 'A' becomes 10, 'F' becomes 15\n * 'a' becomes 10, 'f' becomes 15\n *\n * Returns -1 if the provided character code was not a valid hexadecimal digit.\n *\n * HexDigit :: one of\n * - `0` `1` `2` `3` `4` `5` `6` `7` `8` `9`\n * - `A` `B` `C` `D` `E` `F`\n * - `a` `b` `c` `d` `e` `f`\n */\n\nfunction readHexDigit(code) {\n return code >= 0x0030 && code <= 0x0039 // 0-9\n ? code - 0x0030\n : code >= 0x0041 && code <= 0x0046 // A-F\n ? code - 0x0037\n : code >= 0x0061 && code <= 0x0066 // a-f\n ? code - 0x0057\n : -1;\n}\n/**\n * | Escaped Character | Code Point | Character Name |\n * | ----------------- | ---------- | ---------------------------- |\n * | `\"` | U+0022 | double quote |\n * | `\\` | U+005C | reverse solidus (back slash) |\n * | `/` | U+002F | solidus (forward slash) |\n * | `b` | U+0008 | backspace |\n * | `f` | U+000C | form feed |\n * | `n` | U+000A | line feed (new line) |\n * | `r` | U+000D | carriage return |\n * | `t` | U+0009 | horizontal tab |\n */\n\nfunction readEscapedCharacter(lexer, position) {\n const body = lexer.source.body;\n const code = body.charCodeAt(position + 1);\n\n switch (code) {\n case 0x0022:\n // \"\n return {\n value: '\\u0022',\n size: 2,\n };\n\n case 0x005c:\n // \\\n return {\n value: '\\u005c',\n size: 2,\n };\n\n case 0x002f:\n // /\n return {\n value: '\\u002f',\n size: 2,\n };\n\n case 0x0062:\n // b\n return {\n value: '\\u0008',\n size: 2,\n };\n\n case 0x0066:\n // f\n return {\n value: '\\u000c',\n size: 2,\n };\n\n case 0x006e:\n // n\n return {\n value: '\\u000a',\n size: 2,\n };\n\n case 0x0072:\n // r\n return {\n value: '\\u000d',\n size: 2,\n };\n\n case 0x0074:\n // t\n return {\n value: '\\u0009',\n size: 2,\n };\n }\n\n throw syntaxError(\n lexer.source,\n position,\n `Invalid character escape sequence: \"${body.slice(\n position,\n position + 2,\n )}\".`,\n );\n}\n/**\n * Reads a block string token from the source file.\n *\n * ```\n * StringValue ::\n * - `\"\"\"` BlockStringCharacter* `\"\"\"`\n *\n * BlockStringCharacter ::\n * - SourceCharacter but not `\"\"\"` or `\\\"\"\"`\n * - `\\\"\"\"`\n * ```\n */\n\nfunction readBlockString(lexer, start) {\n const body = lexer.source.body;\n const bodyLength = body.length;\n let lineStart = lexer.lineStart;\n let position = start + 3;\n let chunkStart = position;\n let currentLine = '';\n const blockLines = [];\n\n while (position < bodyLength) {\n const code = body.charCodeAt(position); // Closing Triple-Quote (\"\"\")\n\n if (\n code === 0x0022 &&\n body.charCodeAt(position + 1) === 0x0022 &&\n body.charCodeAt(position + 2) === 0x0022\n ) {\n currentLine += body.slice(chunkStart, position);\n blockLines.push(currentLine);\n const token = createToken(\n lexer,\n TokenKind.BLOCK_STRING,\n start,\n position + 3, // Return a string of the lines joined with U+000A.\n dedentBlockStringLines(blockLines).join('\\n'),\n );\n lexer.line += blockLines.length - 1;\n lexer.lineStart = lineStart;\n return token;\n } // Escaped Triple-Quote (\\\"\"\")\n\n if (\n code === 0x005c &&\n body.charCodeAt(position + 1) === 0x0022 &&\n body.charCodeAt(position + 2) === 0x0022 &&\n body.charCodeAt(position + 3) === 0x0022\n ) {\n currentLine += body.slice(chunkStart, position);\n chunkStart = position + 1; // skip only slash\n\n position += 4;\n continue;\n } // LineTerminator\n\n if (code === 0x000a || code === 0x000d) {\n currentLine += body.slice(chunkStart, position);\n blockLines.push(currentLine);\n\n if (code === 0x000d && body.charCodeAt(position + 1) === 0x000a) {\n position += 2;\n } else {\n ++position;\n }\n\n currentLine = '';\n chunkStart = position;\n lineStart = position;\n continue;\n } // SourceCharacter\n\n if (isUnicodeScalarValue(code)) {\n ++position;\n } else if (isSupplementaryCodePoint(body, position)) {\n position += 2;\n } else {\n throw syntaxError(\n lexer.source,\n position,\n `Invalid character within String: ${printCodePointAt(\n lexer,\n position,\n )}.`,\n );\n }\n }\n\n throw syntaxError(lexer.source, position, 'Unterminated string.');\n}\n/**\n * Reads an alphanumeric + underscore name from the source.\n *\n * ```\n * Name ::\n * - NameStart NameContinue* [lookahead != NameContinue]\n * ```\n *\n * @internal\n */\n\nexport function readName(lexer, start) {\n const body = lexer.source.body;\n const bodyLength = body.length;\n let position = start + 1;\n\n while (position < bodyLength) {\n const code = body.charCodeAt(position);\n\n if (isNameContinue(code)) {\n ++position;\n } else {\n break;\n }\n }\n\n return createToken(\n lexer,\n TokenKind.NAME,\n start,\n position,\n body.slice(start, position),\n );\n}\n", "import { syntaxError } from '../error/syntaxError.mjs';\nimport { Token } from './ast.mjs';\nimport { isNameStart } from './characterClasses.mjs';\nimport { createToken, printCodePointAt, readName } from './lexer.mjs';\nimport { TokenKind } from './tokenKind.mjs';\n/**\n * Given a Source schema coordinate, creates a Lexer for that source.\n * A SchemaCoordinateLexer is a stateful stream generator in that every time\n * it is advanced, it returns the next token in the Source. Assuming the\n * source lexes, the final Token emitted by the lexer will be of kind\n * EOF, after which the lexer will repeatedly return the same EOF token\n * whenever called.\n */\n\nexport class SchemaCoordinateLexer {\n /**\n * The previously focused non-ignored token.\n */\n\n /**\n * The currently focused non-ignored token.\n */\n\n /**\n * The (1-indexed) line containing the current token.\n * Since a schema coordinate may not contain newline, this value is always 1.\n */\n line = 1;\n /**\n * The character offset at which the current line begins.\n * Since a schema coordinate may not contain newline, this value is always 0.\n */\n\n lineStart = 0;\n\n constructor(source) {\n const startOfFileToken = new Token(TokenKind.SOF, 0, 0, 0, 0);\n this.source = source;\n this.lastToken = startOfFileToken;\n this.token = startOfFileToken;\n }\n\n get [Symbol.toStringTag]() {\n return 'SchemaCoordinateLexer';\n }\n /**\n * Advances the token stream to the next non-ignored token.\n */\n\n advance() {\n this.lastToken = this.token;\n const token = (this.token = this.lookahead());\n return token;\n }\n /**\n * Looks ahead and returns the next non-ignored token, but does not change\n * the current Lexer token.\n */\n\n lookahead() {\n let token = this.token;\n\n if (token.kind !== TokenKind.EOF) {\n // Read the next token and form a link in the token linked-list.\n const nextToken = readNextToken(this, token.end); // @ts-expect-error next is only mutable during parsing.\n\n token.next = nextToken; // @ts-expect-error prev is only mutable during parsing.\n\n nextToken.prev = token;\n token = nextToken;\n }\n\n return token;\n }\n}\n/**\n * Gets the next token from the source starting at the given position.\n */\n\nfunction readNextToken(lexer, start) {\n const body = lexer.source.body;\n const bodyLength = body.length;\n const position = start;\n\n if (position < bodyLength) {\n const code = body.charCodeAt(position);\n\n switch (code) {\n case 0x002e:\n // .\n return createToken(lexer, TokenKind.DOT, position, position + 1);\n\n case 0x0028:\n // (\n return createToken(lexer, TokenKind.PAREN_L, position, position + 1);\n\n case 0x0029:\n // )\n return createToken(lexer, TokenKind.PAREN_R, position, position + 1);\n\n case 0x003a:\n // :\n return createToken(lexer, TokenKind.COLON, position, position + 1);\n\n case 0x0040:\n // @\n return createToken(lexer, TokenKind.AT, position, position + 1);\n } // Name\n\n if (isNameStart(code)) {\n return readName(lexer, position);\n }\n\n throw syntaxError(\n lexer.source,\n position,\n `Invalid character: ${printCodePointAt(lexer, position)}.`,\n );\n }\n\n return createToken(lexer, TokenKind.EOF, bodyLength, bodyLength);\n}\n", "const MAX_ARRAY_LENGTH = 10;\nconst MAX_RECURSIVE_DEPTH = 2;\n/**\n * Used to print values in error messages.\n */\n\nexport function inspect(value) {\n return formatValue(value, []);\n}\n\nfunction formatValue(value, seenValues) {\n switch (typeof value) {\n case 'string':\n return JSON.stringify(value);\n\n case 'function':\n return value.name ? `[function ${value.name}]` : '[function]';\n\n case 'object':\n return formatObjectValue(value, seenValues);\n\n default:\n return String(value);\n }\n}\n\nfunction formatObjectValue(value, previouslySeenValues) {\n if (value === null) {\n return 'null';\n }\n\n if (previouslySeenValues.includes(value)) {\n return '[Circular]';\n }\n\n const seenValues = [...previouslySeenValues, value];\n\n if (isJSONable(value)) {\n const jsonValue = value.toJSON(); // check for infinite recursion\n\n if (jsonValue !== value) {\n return typeof jsonValue === 'string'\n ? jsonValue\n : formatValue(jsonValue, seenValues);\n }\n } else if (Array.isArray(value)) {\n return formatArray(value, seenValues);\n }\n\n return formatObject(value, seenValues);\n}\n\nfunction isJSONable(value) {\n return typeof value.toJSON === 'function';\n}\n\nfunction formatObject(object, seenValues) {\n const entries = Object.entries(object);\n\n if (entries.length === 0) {\n return '{}';\n }\n\n if (seenValues.length > MAX_RECURSIVE_DEPTH) {\n return '[' + getObjectTag(object) + ']';\n }\n\n const properties = entries.map(\n ([key, value]) => key + ': ' + formatValue(value, seenValues),\n );\n return '{ ' + properties.join(', ') + ' }';\n}\n\nfunction formatArray(array, seenValues) {\n if (array.length === 0) {\n return '[]';\n }\n\n if (seenValues.length > MAX_RECURSIVE_DEPTH) {\n return '[Array]';\n }\n\n const len = Math.min(MAX_ARRAY_LENGTH, array.length);\n const remaining = array.length - len;\n const items = [];\n\n for (let i = 0; i < len; ++i) {\n items.push(formatValue(array[i], seenValues));\n }\n\n if (remaining === 1) {\n items.push('... 1 more item');\n } else if (remaining > 1) {\n items.push(`... ${remaining} more items`);\n }\n\n return '[' + items.join(', ') + ']';\n}\n\nfunction getObjectTag(object) {\n const tag = Object.prototype.toString\n .call(object)\n .replace(/^\\[object /, '')\n .replace(/]$/, '');\n\n if (tag === 'Object' && typeof object.constructor === 'function') {\n const name = object.constructor.name;\n\n if (typeof name === 'string' && name !== '') {\n return name;\n }\n }\n\n return tag;\n}\n", "import { inspect } from './inspect.mjs';\n/* c8 ignore next 3 */\n\nconst isProduction =\n globalThis.process && // eslint-disable-next-line no-undef\n process.env.NODE_ENV === 'production';\n/**\n * A replacement for instanceof which includes an error warning when multi-realm\n * constructors are detected.\n * See: https://expressjs.com/en/advanced/best-practice-performance.html#set-node_env-to-production\n * See: https://webpack.js.org/guides/production/\n */\n\nexport const instanceOf =\n /* c8 ignore next 6 */\n // FIXME: https://github.com/graphql/graphql-js/issues/2317\n isProduction\n ? function instanceOf(value, constructor) {\n return value instanceof constructor;\n }\n : function instanceOf(value, constructor) {\n if (value instanceof constructor) {\n return true;\n }\n\n if (typeof value === 'object' && value !== null) {\n var _value$constructor;\n\n // Prefer Symbol.toStringTag since it is immune to minification.\n const className = constructor.prototype[Symbol.toStringTag];\n const valueClassName = // We still need to support constructor's name to detect conflicts with older versions of this library.\n Symbol.toStringTag in value // @ts-expect-error TS bug see, https://github.com/microsoft/TypeScript/issues/38009\n ? value[Symbol.toStringTag]\n : (_value$constructor = value.constructor) === null ||\n _value$constructor === void 0\n ? void 0\n : _value$constructor.name;\n\n if (className === valueClassName) {\n const stringifiedValue = inspect(value);\n throw new Error(`Cannot use ${className} \"${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.`);\n }\n }\n\n return false;\n };\n", "import { devAssert } from '../jsutils/devAssert.mjs';\nimport { inspect } from '../jsutils/inspect.mjs';\nimport { instanceOf } from '../jsutils/instanceOf.mjs';\n\n/**\n * A representation of source input to GraphQL. The `name` and `locationOffset` parameters are\n * optional, but they are useful for clients who store GraphQL documents in source files.\n * For example, if the GraphQL input starts at line 40 in a file named `Foo.graphql`, it might\n * be useful for `name` to be `\"Foo.graphql\"` and location to be `{ line: 40, column: 1 }`.\n * The `line` and `column` properties in `locationOffset` are 1-indexed.\n */\nexport class Source {\n constructor(\n body,\n name = 'GraphQL request',\n locationOffset = {\n line: 1,\n column: 1,\n },\n ) {\n typeof body === 'string' ||\n devAssert(false, `Body must be a string. Received: ${inspect(body)}.`);\n this.body = body;\n this.name = name;\n this.locationOffset = locationOffset;\n this.locationOffset.line > 0 ||\n devAssert(\n false,\n 'line in locationOffset is 1-indexed and must be positive.',\n );\n this.locationOffset.column > 0 ||\n devAssert(\n false,\n 'column in locationOffset is 1-indexed and must be positive.',\n );\n }\n\n get [Symbol.toStringTag]() {\n return 'Source';\n }\n}\n/**\n * Test if the given value is a Source object.\n *\n * @internal\n */\n\nexport function isSource(source) {\n return instanceOf(source, Source);\n}\n", "import { syntaxError } from '../error/syntaxError.mjs';\nimport { Location, OperationTypeNode } from './ast.mjs';\nimport { DirectiveLocation } from './directiveLocation.mjs';\nimport { Kind } from './kinds.mjs';\nimport { isPunctuatorTokenKind, Lexer } from './lexer.mjs';\nimport { SchemaCoordinateLexer } from './schemaCoordinateLexer.mjs';\nimport { isSource, Source } from './source.mjs';\nimport { TokenKind } from './tokenKind.mjs';\n/**\n * Configuration options to control parser behavior\n */\n\n/**\n * Given a GraphQL source, parses it into a Document.\n * Throws GraphQLError if a syntax error is encountered.\n */\nexport function parse(source, options) {\n const parser = new Parser(source, options);\n const document = parser.parseDocument();\n Object.defineProperty(document, 'tokenCount', {\n enumerable: false,\n value: parser.tokenCount,\n });\n return document;\n}\n/**\n * Given a string containing a GraphQL value (ex. `[42]`), parse the AST for\n * that value.\n * Throws GraphQLError if a syntax error is encountered.\n *\n * This is useful within tools that operate upon GraphQL Values directly and\n * in isolation of complete GraphQL documents.\n *\n * Consider providing the results to the utility function: valueFromAST().\n */\n\nexport function parseValue(source, options) {\n const parser = new Parser(source, options);\n parser.expectToken(TokenKind.SOF);\n const value = parser.parseValueLiteral(false);\n parser.expectToken(TokenKind.EOF);\n return value;\n}\n/**\n * Similar to parseValue(), but raises a parse error if it encounters a\n * variable. The return type will be a constant value.\n */\n\nexport function parseConstValue(source, options) {\n const parser = new Parser(source, options);\n parser.expectToken(TokenKind.SOF);\n const value = parser.parseConstValueLiteral();\n parser.expectToken(TokenKind.EOF);\n return value;\n}\n/**\n * Given a string containing a GraphQL Type (ex. `[Int!]`), parse the AST for\n * that type.\n * Throws GraphQLError if a syntax error is encountered.\n *\n * This is useful within tools that operate upon GraphQL Types directly and\n * in isolation of complete GraphQL documents.\n *\n * Consider providing the results to the utility function: typeFromAST().\n */\n\nexport function parseType(source, options) {\n const parser = new Parser(source, options);\n parser.expectToken(TokenKind.SOF);\n const type = parser.parseTypeReference();\n parser.expectToken(TokenKind.EOF);\n return type;\n}\n/**\n * Given a string containing a GraphQL Schema Coordinate (ex. `Type.field`),\n * parse the AST for that schema coordinate.\n * Throws GraphQLError if a syntax error is encountered.\n *\n * Consider providing the results to the utility function:\n * resolveASTSchemaCoordinate(). Or calling resolveSchemaCoordinate() directly\n * with an unparsed source.\n */\n\nexport function parseSchemaCoordinate(source) {\n const sourceObj = isSource(source) ? source : new Source(source);\n const lexer = new SchemaCoordinateLexer(sourceObj);\n const parser = new Parser(source, {\n lexer,\n });\n parser.expectToken(TokenKind.SOF);\n const coordinate = parser.parseSchemaCoordinate();\n parser.expectToken(TokenKind.EOF);\n return coordinate;\n}\n/**\n * This class is exported only to assist people in implementing their own parsers\n * without duplicating too much code and should be used only as last resort for cases\n * such as experimental syntax or if certain features could not be contributed upstream.\n *\n * It is still part of the internal API and is versioned, so any changes to it are never\n * considered breaking changes. If you still need to support multiple versions of the\n * library, please use the `versionInfo` variable for version detection.\n *\n * @internal\n */\n\nexport class Parser {\n constructor(source, options = {}) {\n const { lexer, ..._options } = options;\n\n if (lexer) {\n this._lexer = lexer;\n } else {\n const sourceObj = isSource(source) ? source : new Source(source);\n this._lexer = new Lexer(sourceObj);\n }\n\n this._options = _options;\n this._tokenCounter = 0;\n }\n\n get tokenCount() {\n return this._tokenCounter;\n }\n /**\n * Converts a name lex token into a name parse node.\n */\n\n parseName() {\n const token = this.expectToken(TokenKind.NAME);\n return this.node(token, {\n kind: Kind.NAME,\n value: token.value,\n });\n } // Implements the parsing rules in the Document section.\n\n /**\n * Document : Definition+\n */\n\n parseDocument() {\n return this.node(this._lexer.token, {\n kind: Kind.DOCUMENT,\n definitions: this.many(\n TokenKind.SOF,\n this.parseDefinition,\n TokenKind.EOF,\n ),\n });\n }\n /**\n * Definition :\n * - ExecutableDefinition\n * - TypeSystemDefinition\n * - TypeSystemExtension\n *\n * ExecutableDefinition :\n * - OperationDefinition\n * - FragmentDefinition\n *\n * TypeSystemDefinition :\n * - SchemaDefinition\n * - TypeDefinition\n * - DirectiveDefinition\n *\n * TypeDefinition :\n * - ScalarTypeDefinition\n * - ObjectTypeDefinition\n * - InterfaceTypeDefinition\n * - UnionTypeDefinition\n * - EnumTypeDefinition\n * - InputObjectTypeDefinition\n */\n\n parseDefinition() {\n if (this.peek(TokenKind.BRACE_L)) {\n return this.parseOperationDefinition();\n } // Many definitions begin with a description and require a lookahead.\n\n const hasDescription = this.peekDescription();\n const keywordToken = hasDescription\n ? this._lexer.lookahead()\n : this._lexer.token;\n\n if (hasDescription && keywordToken.kind === TokenKind.BRACE_L) {\n throw syntaxError(\n this._lexer.source,\n this._lexer.token.start,\n 'Unexpected description, descriptions are not supported on shorthand queries.',\n );\n }\n\n if (keywordToken.kind === TokenKind.NAME) {\n switch (keywordToken.value) {\n case 'schema':\n return this.parseSchemaDefinition();\n\n case 'scalar':\n return this.parseScalarTypeDefinition();\n\n case 'type':\n return this.parseObjectTypeDefinition();\n\n case 'interface':\n return this.parseInterfaceTypeDefinition();\n\n case 'union':\n return this.parseUnionTypeDefinition();\n\n case 'enum':\n return this.parseEnumTypeDefinition();\n\n case 'input':\n return this.parseInputObjectTypeDefinition();\n\n case 'directive':\n return this.parseDirectiveDefinition();\n }\n\n switch (keywordToken.value) {\n case 'query':\n case 'mutation':\n case 'subscription':\n return this.parseOperationDefinition();\n\n case 'fragment':\n return this.parseFragmentDefinition();\n }\n\n if (hasDescription) {\n throw syntaxError(\n this._lexer.source,\n this._lexer.token.start,\n 'Unexpected description, only GraphQL definitions support descriptions.',\n );\n }\n\n switch (keywordToken.value) {\n case 'extend':\n return this.parseTypeSystemExtension();\n }\n }\n\n throw this.unexpected(keywordToken);\n } // Implements the parsing rules in the Operations section.\n\n /**\n * OperationDefinition :\n * - SelectionSet\n * - OperationType Name? VariableDefinitions? Directives? SelectionSet\n */\n\n parseOperationDefinition() {\n const start = this._lexer.token;\n\n if (this.peek(TokenKind.BRACE_L)) {\n return this.node(start, {\n kind: Kind.OPERATION_DEFINITION,\n operation: OperationTypeNode.QUERY,\n description: undefined,\n name: undefined,\n variableDefinitions: [],\n directives: [],\n selectionSet: this.parseSelectionSet(),\n });\n }\n\n const description = this.parseDescription();\n const operation = this.parseOperationType();\n let name;\n\n if (this.peek(TokenKind.NAME)) {\n name = this.parseName();\n }\n\n return this.node(start, {\n kind: Kind.OPERATION_DEFINITION,\n operation,\n description,\n name,\n variableDefinitions: this.parseVariableDefinitions(),\n directives: this.parseDirectives(false),\n selectionSet: this.parseSelectionSet(),\n });\n }\n /**\n * OperationType : one of query mutation subscription\n */\n\n parseOperationType() {\n const operationToken = this.expectToken(TokenKind.NAME);\n\n switch (operationToken.value) {\n case 'query':\n return OperationTypeNode.QUERY;\n\n case 'mutation':\n return OperationTypeNode.MUTATION;\n\n case 'subscription':\n return OperationTypeNode.SUBSCRIPTION;\n }\n\n throw this.unexpected(operationToken);\n }\n /**\n * VariableDefinitions : ( VariableDefinition+ )\n */\n\n parseVariableDefinitions() {\n return this.optionalMany(\n TokenKind.PAREN_L,\n this.parseVariableDefinition,\n TokenKind.PAREN_R,\n );\n }\n /**\n * VariableDefinition : Variable : Type DefaultValue? Directives[Const]?\n */\n\n parseVariableDefinition() {\n return this.node(this._lexer.token, {\n kind: Kind.VARIABLE_DEFINITION,\n description: this.parseDescription(),\n variable: this.parseVariable(),\n type: (this.expectToken(TokenKind.COLON), this.parseTypeReference()),\n defaultValue: this.expectOptionalToken(TokenKind.EQUALS)\n ? this.parseConstValueLiteral()\n : undefined,\n directives: this.parseConstDirectives(),\n });\n }\n /**\n * Variable : $ Name\n */\n\n parseVariable() {\n const start = this._lexer.token;\n this.expectToken(TokenKind.DOLLAR);\n return this.node(start, {\n kind: Kind.VARIABLE,\n name: this.parseName(),\n });\n }\n /**\n * ```\n * SelectionSet : { Selection+ }\n * ```\n */\n\n parseSelectionSet() {\n return this.node(this._lexer.token, {\n kind: Kind.SELECTION_SET,\n selections: this.many(\n TokenKind.BRACE_L,\n this.parseSelection,\n TokenKind.BRACE_R,\n ),\n });\n }\n /**\n * Selection :\n * - Field\n * - FragmentSpread\n * - InlineFragment\n */\n\n parseSelection() {\n return this.peek(TokenKind.SPREAD)\n ? this.parseFragment()\n : this.parseField();\n }\n /**\n * Field : Alias? Name Arguments? Directives? SelectionSet?\n *\n * Alias : Name :\n */\n\n parseField() {\n const start = this._lexer.token;\n const nameOrAlias = this.parseName();\n let alias;\n let name;\n\n if (this.expectOptionalToken(TokenKind.COLON)) {\n alias = nameOrAlias;\n name = this.parseName();\n } else {\n name = nameOrAlias;\n }\n\n return this.node(start, {\n kind: Kind.FIELD,\n alias,\n name,\n arguments: this.parseArguments(false),\n directives: this.parseDirectives(false),\n selectionSet: this.peek(TokenKind.BRACE_L)\n ? this.parseSelectionSet()\n : undefined,\n });\n }\n /**\n * Arguments[Const] : ( Argument[?Const]+ )\n */\n\n parseArguments(isConst) {\n const item = isConst ? this.parseConstArgument : this.parseArgument;\n return this.optionalMany(TokenKind.PAREN_L, item, TokenKind.PAREN_R);\n }\n /**\n * Argument[Const] : Name : Value[?Const]\n */\n\n parseArgument(isConst = false) {\n const start = this._lexer.token;\n const name = this.parseName();\n this.expectToken(TokenKind.COLON);\n return this.node(start, {\n kind: Kind.ARGUMENT,\n name,\n value: this.parseValueLiteral(isConst),\n });\n }\n\n parseConstArgument() {\n return this.parseArgument(true);\n } // Implements the parsing rules in the Fragments section.\n\n /**\n * Corresponds to both FragmentSpread and InlineFragment in the spec.\n *\n * FragmentSpread : ... FragmentName Directives?\n *\n * InlineFragment : ... TypeCondition? Directives? SelectionSet\n */\n\n parseFragment() {\n const start = this._lexer.token;\n this.expectToken(TokenKind.SPREAD);\n const hasTypeCondition = this.expectOptionalKeyword('on');\n\n if (!hasTypeCondition && this.peek(TokenKind.NAME)) {\n return this.node(start, {\n kind: Kind.FRAGMENT_SPREAD,\n name: this.parseFragmentName(),\n directives: this.parseDirectives(false),\n });\n }\n\n return this.node(start, {\n kind: Kind.INLINE_FRAGMENT,\n typeCondition: hasTypeCondition ? this.parseNamedType() : undefined,\n directives: this.parseDirectives(false),\n selectionSet: this.parseSelectionSet(),\n });\n }\n /**\n * FragmentDefinition :\n * - fragment FragmentName on TypeCondition Directives? SelectionSet\n *\n * TypeCondition : NamedType\n */\n\n parseFragmentDefinition() {\n const start = this._lexer.token;\n const description = this.parseDescription();\n this.expectKeyword('fragment'); // Legacy support for defining variables within fragments changes\n // the grammar of FragmentDefinition:\n // - fragment FragmentName VariableDefinitions? on TypeCondition Directives? SelectionSet\n\n if (this._options.allowLegacyFragmentVariables === true) {\n return this.node(start, {\n kind: Kind.FRAGMENT_DEFINITION,\n description,\n name: this.parseFragmentName(),\n variableDefinitions: this.parseVariableDefinitions(),\n typeCondition: (this.expectKeyword('on'), this.parseNamedType()),\n directives: this.parseDirectives(false),\n selectionSet: this.parseSelectionSet(),\n });\n }\n\n return this.node(start, {\n kind: Kind.FRAGMENT_DEFINITION,\n description,\n name: this.parseFragmentName(),\n typeCondition: (this.expectKeyword('on'), this.parseNamedType()),\n directives: this.parseDirectives(false),\n selectionSet: this.parseSelectionSet(),\n });\n }\n /**\n * FragmentName : Name but not `on`\n */\n\n parseFragmentName() {\n if (this._lexer.token.value === 'on') {\n throw this.unexpected();\n }\n\n return this.parseName();\n } // Implements the parsing rules in the Values section.\n\n /**\n * Value[Const] :\n * - [~Const] Variable\n * - IntValue\n * - FloatValue\n * - StringValue\n * - BooleanValue\n * - NullValue\n * - EnumValue\n * - ListValue[?Const]\n * - ObjectValue[?Const]\n *\n * BooleanValue : one of `true` `false`\n *\n * NullValue : `null`\n *\n * EnumValue : Name but not `true`, `false` or `null`\n */\n\n parseValueLiteral(isConst) {\n const token = this._lexer.token;\n\n switch (token.kind) {\n case TokenKind.BRACKET_L:\n return this.parseList(isConst);\n\n case TokenKind.BRACE_L:\n return this.parseObject(isConst);\n\n case TokenKind.INT:\n this.advanceLexer();\n return this.node(token, {\n kind: Kind.INT,\n value: token.value,\n });\n\n case TokenKind.FLOAT:\n this.advanceLexer();\n return this.node(token, {\n kind: Kind.FLOAT,\n value: token.value,\n });\n\n case TokenKind.STRING:\n case TokenKind.BLOCK_STRING:\n return this.parseStringLiteral();\n\n case TokenKind.NAME:\n this.advanceLexer();\n\n switch (token.value) {\n case 'true':\n return this.node(token, {\n kind: Kind.BOOLEAN,\n value: true,\n });\n\n case 'false':\n return this.node(token, {\n kind: Kind.BOOLEAN,\n value: false,\n });\n\n case 'null':\n return this.node(token, {\n kind: Kind.NULL,\n });\n\n default:\n return this.node(token, {\n kind: Kind.ENUM,\n value: token.value,\n });\n }\n\n case TokenKind.DOLLAR:\n if (isConst) {\n this.expectToken(TokenKind.DOLLAR);\n\n if (this._lexer.token.kind === TokenKind.NAME) {\n const varName = this._lexer.token.value;\n throw syntaxError(\n this._lexer.source,\n token.start,\n `Unexpected variable \"$${varName}\" in constant value.`,\n );\n } else {\n throw this.unexpected(token);\n }\n }\n\n return this.parseVariable();\n\n default:\n throw this.unexpected();\n }\n }\n\n parseConstValueLiteral() {\n return this.parseValueLiteral(true);\n }\n\n parseStringLiteral() {\n const token = this._lexer.token;\n this.advanceLexer();\n return this.node(token, {\n kind: Kind.STRING,\n value: token.value,\n block: token.kind === TokenKind.BLOCK_STRING,\n });\n }\n /**\n * ListValue[Const] :\n * - [ ]\n * - [ Value[?Const]+ ]\n */\n\n parseList(isConst) {\n const item = () => this.parseValueLiteral(isConst);\n\n return this.node(this._lexer.token, {\n kind: Kind.LIST,\n values: this.any(TokenKind.BRACKET_L, item, TokenKind.BRACKET_R),\n });\n }\n /**\n * ```\n * ObjectValue[Const] :\n * - { }\n * - { ObjectField[?Const]+ }\n * ```\n */\n\n parseObject(isConst) {\n const item = () => this.parseObjectField(isConst);\n\n return this.node(this._lexer.token, {\n kind: Kind.OBJECT,\n fields: this.any(TokenKind.BRACE_L, item, TokenKind.BRACE_R),\n });\n }\n /**\n * ObjectField[Const] : Name : Value[?Const]\n */\n\n parseObjectField(isConst) {\n const start = this._lexer.token;\n const name = this.parseName();\n this.expectToken(TokenKind.COLON);\n return this.node(start, {\n kind: Kind.OBJECT_FIELD,\n name,\n value: this.parseValueLiteral(isConst),\n });\n } // Implements the parsing rules in the Directives section.\n\n /**\n * Directives[Const] : Directive[?Const]+\n */\n\n parseDirectives(isConst) {\n const directives = [];\n\n while (this.peek(TokenKind.AT)) {\n directives.push(this.parseDirective(isConst));\n }\n\n return directives;\n }\n\n parseConstDirectives() {\n return this.parseDirectives(true);\n }\n /**\n * ```\n * Directive[Const] : @ Name Arguments[?Const]?\n * ```\n */\n\n parseDirective(isConst) {\n const start = this._lexer.token;\n this.expectToken(TokenKind.AT);\n return this.node(start, {\n kind: Kind.DIRECTIVE,\n name: this.parseName(),\n arguments: this.parseArguments(isConst),\n });\n } // Implements the parsing rules in the Types section.\n\n /**\n * Type :\n * - NamedType\n * - ListType\n * - NonNullType\n */\n\n parseTypeReference() {\n const start = this._lexer.token;\n let type;\n\n if (this.expectOptionalToken(TokenKind.BRACKET_L)) {\n const innerType = this.parseTypeReference();\n this.expectToken(TokenKind.BRACKET_R);\n type = this.node(start, {\n kind: Kind.LIST_TYPE,\n type: innerType,\n });\n } else {\n type = this.parseNamedType();\n }\n\n if (this.expectOptionalToken(TokenKind.BANG)) {\n return this.node(start, {\n kind: Kind.NON_NULL_TYPE,\n type,\n });\n }\n\n return type;\n }\n /**\n * NamedType : Name\n */\n\n parseNamedType() {\n return this.node(this._lexer.token, {\n kind: Kind.NAMED_TYPE,\n name: this.parseName(),\n });\n } // Implements the parsing rules in the Type Definition section.\n\n peekDescription() {\n return this.peek(TokenKind.STRING) || this.peek(TokenKind.BLOCK_STRING);\n }\n /**\n * Description : StringValue\n */\n\n parseDescription() {\n if (this.peekDescription()) {\n return this.parseStringLiteral();\n }\n }\n /**\n * ```\n * SchemaDefinition : Description? schema Directives[Const]? { OperationTypeDefinition+ }\n * ```\n */\n\n parseSchemaDefinition() {\n const start = this._lexer.token;\n const description = this.parseDescription();\n this.expectKeyword('schema');\n const directives = this.parseConstDirectives();\n const operationTypes = this.many(\n TokenKind.BRACE_L,\n this.parseOperationTypeDefinition,\n TokenKind.BRACE_R,\n );\n return this.node(start, {\n kind: Kind.SCHEMA_DEFINITION,\n description,\n directives,\n operationTypes,\n });\n }\n /**\n * OperationTypeDefinition : OperationType : NamedType\n */\n\n parseOperationTypeDefinition() {\n const start = this._lexer.token;\n const operation = this.parseOperationType();\n this.expectToken(TokenKind.COLON);\n const type = this.parseNamedType();\n return this.node(start, {\n kind: Kind.OPERATION_TYPE_DEFINITION,\n operation,\n type,\n });\n }\n /**\n * ScalarTypeDefinition : Description? scalar Name Directives[Const]?\n */\n\n parseScalarTypeDefinition() {\n const start = this._lexer.token;\n const description = this.parseDescription();\n this.expectKeyword('scalar');\n const name = this.parseName();\n const directives = this.parseConstDirectives();\n return this.node(start, {\n kind: Kind.SCALAR_TYPE_DEFINITION,\n description,\n name,\n directives,\n });\n }\n /**\n * ObjectTypeDefinition :\n * Description?\n * type Name ImplementsInterfaces? Directives[Const]? FieldsDefinition?\n */\n\n parseObjectTypeDefinition() {\n const start = this._lexer.token;\n const description = this.parseDescription();\n this.expectKeyword('type');\n const name = this.parseName();\n const interfaces = this.parseImplementsInterfaces();\n const directives = this.parseConstDirectives();\n const fields = this.parseFieldsDefinition();\n return this.node(start, {\n kind: Kind.OBJECT_TYPE_DEFINITION,\n description,\n name,\n interfaces,\n directives,\n fields,\n });\n }\n /**\n * ImplementsInterfaces :\n * - implements `&`? NamedType\n * - ImplementsInterfaces & NamedType\n */\n\n parseImplementsInterfaces() {\n return this.expectOptionalKeyword('implements')\n ? this.delimitedMany(TokenKind.AMP, this.parseNamedType)\n : [];\n }\n /**\n * ```\n * FieldsDefinition : { FieldDefinition+ }\n * ```\n */\n\n parseFieldsDefinition() {\n return this.optionalMany(\n TokenKind.BRACE_L,\n this.parseFieldDefinition,\n TokenKind.BRACE_R,\n );\n }\n /**\n * FieldDefinition :\n * - Description? Name ArgumentsDefinition? : Type Directives[Const]?\n */\n\n parseFieldDefinition() {\n const start = this._lexer.token;\n const description = this.parseDescription();\n const name = this.parseName();\n const args = this.parseArgumentDefs();\n this.expectToken(TokenKind.COLON);\n const type = this.parseTypeReference();\n const directives = this.parseConstDirectives();\n return this.node(start, {\n kind: Kind.FIELD_DEFINITION,\n description,\n name,\n arguments: args,\n type,\n directives,\n });\n }\n /**\n * ArgumentsDefinition : ( InputValueDefinition+ )\n */\n\n parseArgumentDefs() {\n return this.optionalMany(\n TokenKind.PAREN_L,\n this.parseInputValueDef,\n TokenKind.PAREN_R,\n );\n }\n /**\n * InputValueDefinition :\n * - Description? Name : Type DefaultValue? Directives[Const]?\n */\n\n parseInputValueDef() {\n const start = this._lexer.token;\n const description = this.parseDescription();\n const name = this.parseName();\n this.expectToken(TokenKind.COLON);\n const type = this.parseTypeReference();\n let defaultValue;\n\n if (this.expectOptionalToken(TokenKind.EQUALS)) {\n defaultValue = this.parseConstValueLiteral();\n }\n\n const directives = this.parseConstDirectives();\n return this.node(start, {\n kind: Kind.INPUT_VALUE_DEFINITION,\n description,\n name,\n type,\n defaultValue,\n directives,\n });\n }\n /**\n * InterfaceTypeDefinition :\n * - Description? interface Name Directives[Const]? FieldsDefinition?\n */\n\n parseInterfaceTypeDefinition() {\n const start = this._lexer.token;\n const description = this.parseDescription();\n this.expectKeyword('interface');\n const name = this.parseName();\n const interfaces = this.parseImplementsInterfaces();\n const directives = this.parseConstDirectives();\n const fields = this.parseFieldsDefinition();\n return this.node(start, {\n kind: Kind.INTERFACE_TYPE_DEFINITION,\n description,\n name,\n interfaces,\n directives,\n fields,\n });\n }\n /**\n * UnionTypeDefinition :\n * - Description? union Name Directives[Const]? UnionMemberTypes?\n */\n\n parseUnionTypeDefinition() {\n const start = this._lexer.token;\n const description = this.parseDescription();\n this.expectKeyword('union');\n const name = this.parseName();\n const directives = this.parseConstDirectives();\n const types = this.parseUnionMemberTypes();\n return this.node(start, {\n kind: Kind.UNION_TYPE_DEFINITION,\n description,\n name,\n directives,\n types,\n });\n }\n /**\n * UnionMemberTypes :\n * - = `|`? NamedType\n * - UnionMemberTypes | NamedType\n */\n\n parseUnionMemberTypes() {\n return this.expectOptionalToken(TokenKind.EQUALS)\n ? this.delimitedMany(TokenKind.PIPE, this.parseNamedType)\n : [];\n }\n /**\n * EnumTypeDefinition :\n * - Description? enum Name Directives[Const]? EnumValuesDefinition?\n */\n\n parseEnumTypeDefinition() {\n const start = this._lexer.token;\n const description = this.parseDescription();\n this.expectKeyword('enum');\n const name = this.parseName();\n const directives = this.parseConstDirectives();\n const values = this.parseEnumValuesDefinition();\n return this.node(start, {\n kind: Kind.ENUM_TYPE_DEFINITION,\n description,\n name,\n directives,\n values,\n });\n }\n /**\n * ```\n * EnumValuesDefinition : { EnumValueDefinition+ }\n * ```\n */\n\n parseEnumValuesDefinition() {\n return this.optionalMany(\n TokenKind.BRACE_L,\n this.parseEnumValueDefinition,\n TokenKind.BRACE_R,\n );\n }\n /**\n * EnumValueDefinition : Description? EnumValue Directives[Const]?\n */\n\n parseEnumValueDefinition() {\n const start = this._lexer.token;\n const description = this.parseDescription();\n const name = this.parseEnumValueName();\n const directives = this.parseConstDirectives();\n return this.node(start, {\n kind: Kind.ENUM_VALUE_DEFINITION,\n description,\n name,\n directives,\n });\n }\n /**\n * EnumValue : Name but not `true`, `false` or `null`\n */\n\n parseEnumValueName() {\n if (\n this._lexer.token.value === 'true' ||\n this._lexer.token.value === 'false' ||\n this._lexer.token.value === 'null'\n ) {\n throw syntaxError(\n this._lexer.source,\n this._lexer.token.start,\n `${getTokenDesc(\n this._lexer.token,\n )} is reserved and cannot be used for an enum value.`,\n );\n }\n\n return this.parseName();\n }\n /**\n * InputObjectTypeDefinition :\n * - Description? input Name Directives[Const]? InputFieldsDefinition?\n */\n\n parseInputObjectTypeDefinition() {\n const start = this._lexer.token;\n const description = this.parseDescription();\n this.expectKeyword('input');\n const name = this.parseName();\n const directives = this.parseConstDirectives();\n const fields = this.parseInputFieldsDefinition();\n return this.node(start, {\n kind: Kind.INPUT_OBJECT_TYPE_DEFINITION,\n description,\n name,\n directives,\n fields,\n });\n }\n /**\n * ```\n * InputFieldsDefinition : { InputValueDefinition+ }\n * ```\n */\n\n parseInputFieldsDefinition() {\n return this.optionalMany(\n TokenKind.BRACE_L,\n this.parseInputValueDef,\n TokenKind.BRACE_R,\n );\n }\n /**\n * TypeSystemExtension :\n * - SchemaExtension\n * - TypeExtension\n *\n * TypeExtension :\n * - ScalarTypeExtension\n * - ObjectTypeExtension\n * - InterfaceTypeExtension\n * - UnionTypeExtension\n * - EnumTypeExtension\n * - InputObjectTypeDefinition\n */\n\n parseTypeSystemExtension() {\n const keywordToken = this._lexer.lookahead();\n\n if (keywordToken.kind === TokenKind.NAME) {\n switch (keywordToken.value) {\n case 'schema':\n return this.parseSchemaExtension();\n\n case 'scalar':\n return this.parseScalarTypeExtension();\n\n case 'type':\n return this.parseObjectTypeExtension();\n\n case 'interface':\n return this.parseInterfaceTypeExtension();\n\n case 'union':\n return this.parseUnionTypeExtension();\n\n case 'enum':\n return this.parseEnumTypeExtension();\n\n case 'input':\n return this.parseInputObjectTypeExtension();\n }\n }\n\n throw this.unexpected(keywordToken);\n }\n /**\n * ```\n * SchemaExtension :\n * - extend schema Directives[Const]? { OperationTypeDefinition+ }\n * - extend schema Directives[Const]\n * ```\n */\n\n parseSchemaExtension() {\n const start = this._lexer.token;\n this.expectKeyword('extend');\n this.expectKeyword('schema');\n const directives = this.parseConstDirectives();\n const operationTypes = this.optionalMany(\n TokenKind.BRACE_L,\n this.parseOperationTypeDefinition,\n TokenKind.BRACE_R,\n );\n\n if (directives.length === 0 && operationTypes.length === 0) {\n throw this.unexpected();\n }\n\n return this.node(start, {\n kind: Kind.SCHEMA_EXTENSION,\n directives,\n operationTypes,\n });\n }\n /**\n * ScalarTypeExtension :\n * - extend scalar Name Directives[Const]\n */\n\n parseScalarTypeExtension() {\n const start = this._lexer.token;\n this.expectKeyword('extend');\n this.expectKeyword('scalar');\n const name = this.parseName();\n const directives = this.parseConstDirectives();\n\n if (directives.length === 0) {\n throw this.unexpected();\n }\n\n return this.node(start, {\n kind: Kind.SCALAR_TYPE_EXTENSION,\n name,\n directives,\n });\n }\n /**\n * ObjectTypeExtension :\n * - extend type Name ImplementsInterfaces? Directives[Const]? FieldsDefinition\n * - extend type Name ImplementsInterfaces? Directives[Const]\n * - extend type Name ImplementsInterfaces\n */\n\n parseObjectTypeExtension() {\n const start = this._lexer.token;\n this.expectKeyword('extend');\n this.expectKeyword('type');\n const name = this.parseName();\n const interfaces = this.parseImplementsInterfaces();\n const directives = this.parseConstDirectives();\n const fields = this.parseFieldsDefinition();\n\n if (\n interfaces.length === 0 &&\n directives.length === 0 &&\n fields.length === 0\n ) {\n throw this.unexpected();\n }\n\n return this.node(start, {\n kind: Kind.OBJECT_TYPE_EXTENSION,\n name,\n interfaces,\n directives,\n fields,\n });\n }\n /**\n * InterfaceTypeExtension :\n * - extend interface Name ImplementsInterfaces? Directives[Const]? FieldsDefinition\n * - extend interface Name ImplementsInterfaces? Directives[Const]\n * - extend interface Name ImplementsInterfaces\n */\n\n parseInterfaceTypeExtension() {\n const start = this._lexer.token;\n this.expectKeyword('extend');\n this.expectKeyword('interface');\n const name = this.parseName();\n const interfaces = this.parseImplementsInterfaces();\n const directives = this.parseConstDirectives();\n const fields = this.parseFieldsDefinition();\n\n if (\n interfaces.length === 0 &&\n directives.length === 0 &&\n fields.length === 0\n ) {\n throw this.unexpected();\n }\n\n return this.node(start, {\n kind: Kind.INTERFACE_TYPE_EXTENSION,\n name,\n interfaces,\n directives,\n fields,\n });\n }\n /**\n * UnionTypeExtension :\n * - extend union Name Directives[Const]? UnionMemberTypes\n * - extend union Name Directives[Const]\n */\n\n parseUnionTypeExtension() {\n const start = this._lexer.token;\n this.expectKeyword('extend');\n this.expectKeyword('union');\n const name = this.parseName();\n const directives = this.parseConstDirectives();\n const types = this.parseUnionMemberTypes();\n\n if (directives.length === 0 && types.length === 0) {\n throw this.unexpected();\n }\n\n return this.node(start, {\n kind: Kind.UNION_TYPE_EXTENSION,\n name,\n directives,\n types,\n });\n }\n /**\n * EnumTypeExtension :\n * - extend enum Name Directives[Const]? EnumValuesDefinition\n * - extend enum Name Directives[Const]\n */\n\n parseEnumTypeExtension() {\n const start = this._lexer.token;\n this.expectKeyword('extend');\n this.expectKeyword('enum');\n const name = this.parseName();\n const directives = this.parseConstDirectives();\n const values = this.parseEnumValuesDefinition();\n\n if (directives.length === 0 && values.length === 0) {\n throw this.unexpected();\n }\n\n return this.node(start, {\n kind: Kind.ENUM_TYPE_EXTENSION,\n name,\n directives,\n values,\n });\n }\n /**\n * InputObjectTypeExtension :\n * - extend input Name Directives[Const]? InputFieldsDefinition\n * - extend input Name Directives[Const]\n */\n\n parseInputObjectTypeExtension() {\n const start = this._lexer.token;\n this.expectKeyword('extend');\n this.expectKeyword('input');\n const name = this.parseName();\n const directives = this.parseConstDirectives();\n const fields = this.parseInputFieldsDefinition();\n\n if (directives.length === 0 && fields.length === 0) {\n throw this.unexpected();\n }\n\n return this.node(start, {\n kind: Kind.INPUT_OBJECT_TYPE_EXTENSION,\n name,\n directives,\n fields,\n });\n }\n /**\n * ```\n * DirectiveDefinition :\n * - Description? directive @ Name ArgumentsDefinition? `repeatable`? on DirectiveLocations\n * ```\n */\n\n parseDirectiveDefinition() {\n const start = this._lexer.token;\n const description = this.parseDescription();\n this.expectKeyword('directive');\n this.expectToken(TokenKind.AT);\n const name = this.parseName();\n const args = this.parseArgumentDefs();\n const repeatable = this.expectOptionalKeyword('repeatable');\n this.expectKeyword('on');\n const locations = this.parseDirectiveLocations();\n return this.node(start, {\n kind: Kind.DIRECTIVE_DEFINITION,\n description,\n name,\n arguments: args,\n repeatable,\n locations,\n });\n }\n /**\n * DirectiveLocations :\n * - `|`? DirectiveLocation\n * - DirectiveLocations | DirectiveLocation\n */\n\n parseDirectiveLocations() {\n return this.delimitedMany(TokenKind.PIPE, this.parseDirectiveLocation);\n }\n /*\n * DirectiveLocation :\n * - ExecutableDirectiveLocation\n * - TypeSystemDirectiveLocation\n *\n * ExecutableDirectiveLocation : one of\n * `QUERY`\n * `MUTATION`\n * `SUBSCRIPTION`\n * `FIELD`\n * `FRAGMENT_DEFINITION`\n * `FRAGMENT_SPREAD`\n * `INLINE_FRAGMENT`\n *\n * TypeSystemDirectiveLocation : one of\n * `SCHEMA`\n * `SCALAR`\n * `OBJECT`\n * `FIELD_DEFINITION`\n * `ARGUMENT_DEFINITION`\n * `INTERFACE`\n * `UNION`\n * `ENUM`\n * `ENUM_VALUE`\n * `INPUT_OBJECT`\n * `INPUT_FIELD_DEFINITION`\n */\n\n parseDirectiveLocation() {\n const start = this._lexer.token;\n const name = this.parseName();\n\n if (Object.prototype.hasOwnProperty.call(DirectiveLocation, name.value)) {\n return name;\n }\n\n throw this.unexpected(start);\n } // Schema Coordinates\n\n /**\n * SchemaCoordinate :\n * - Name\n * - Name . Name\n * - Name . Name ( Name : )\n * - \\@ Name\n * - \\@ Name ( Name : )\n */\n\n parseSchemaCoordinate() {\n const start = this._lexer.token;\n const ofDirective = this.expectOptionalToken(TokenKind.AT);\n const name = this.parseName();\n let memberName;\n\n if (!ofDirective && this.expectOptionalToken(TokenKind.DOT)) {\n memberName = this.parseName();\n }\n\n let argumentName;\n\n if (\n (ofDirective || memberName) &&\n this.expectOptionalToken(TokenKind.PAREN_L)\n ) {\n argumentName = this.parseName();\n this.expectToken(TokenKind.COLON);\n this.expectToken(TokenKind.PAREN_R);\n }\n\n if (ofDirective) {\n if (argumentName) {\n return this.node(start, {\n kind: Kind.DIRECTIVE_ARGUMENT_COORDINATE,\n name,\n argumentName,\n });\n }\n\n return this.node(start, {\n kind: Kind.DIRECTIVE_COORDINATE,\n name,\n });\n } else if (memberName) {\n if (argumentName) {\n return this.node(start, {\n kind: Kind.ARGUMENT_COORDINATE,\n name,\n fieldName: memberName,\n argumentName,\n });\n }\n\n return this.node(start, {\n kind: Kind.MEMBER_COORDINATE,\n name,\n memberName,\n });\n }\n\n return this.node(start, {\n kind: Kind.TYPE_COORDINATE,\n name,\n });\n } // Core parsing utility functions\n\n /**\n * Returns a node that, if configured to do so, sets a \"loc\" field as a\n * location object, used to identify the place in the source that created a\n * given parsed object.\n */\n\n node(startToken, node) {\n if (this._options.noLocation !== true) {\n node.loc = new Location(\n startToken,\n this._lexer.lastToken,\n this._lexer.source,\n );\n }\n\n return node;\n }\n /**\n * Determines if the next token is of a given kind\n */\n\n peek(kind) {\n return this._lexer.token.kind === kind;\n }\n /**\n * If the next token is of the given kind, return that token after advancing the lexer.\n * Otherwise, do not change the parser state and throw an error.\n */\n\n expectToken(kind) {\n const token = this._lexer.token;\n\n if (token.kind === kind) {\n this.advanceLexer();\n return token;\n }\n\n throw syntaxError(\n this._lexer.source,\n token.start,\n `Expected ${getTokenKindDesc(kind)}, found ${getTokenDesc(token)}.`,\n );\n }\n /**\n * If the next token is of the given kind, return \"true\" after advancing the lexer.\n * Otherwise, do not change the parser state and return \"false\".\n */\n\n expectOptionalToken(kind) {\n const token = this._lexer.token;\n\n if (token.kind === kind) {\n this.advanceLexer();\n return true;\n }\n\n return false;\n }\n /**\n * If the next token is a given keyword, advance the lexer.\n * Otherwise, do not change the parser state and throw an error.\n */\n\n expectKeyword(value) {\n const token = this._lexer.token;\n\n if (token.kind === TokenKind.NAME && token.value === value) {\n this.advanceLexer();\n } else {\n throw syntaxError(\n this._lexer.source,\n token.start,\n `Expected \"${value}\", found ${getTokenDesc(token)}.`,\n );\n }\n }\n /**\n * If the next token is a given keyword, return \"true\" after advancing the lexer.\n * Otherwise, do not change the parser state and return \"false\".\n */\n\n expectOptionalKeyword(value) {\n const token = this._lexer.token;\n\n if (token.kind === TokenKind.NAME && token.value === value) {\n this.advanceLexer();\n return true;\n }\n\n return false;\n }\n /**\n * Helper function for creating an error when an unexpected lexed token is encountered.\n */\n\n unexpected(atToken) {\n const token =\n atToken !== null && atToken !== void 0 ? atToken : this._lexer.token;\n return syntaxError(\n this._lexer.source,\n token.start,\n `Unexpected ${getTokenDesc(token)}.`,\n );\n }\n /**\n * Returns a possibly empty list of parse nodes, determined by the parseFn.\n * This list begins with a lex token of openKind and ends with a lex token of closeKind.\n * Advances the parser to the next lex token after the closing token.\n */\n\n any(openKind, parseFn, closeKind) {\n this.expectToken(openKind);\n const nodes = [];\n\n while (!this.expectOptionalToken(closeKind)) {\n nodes.push(parseFn.call(this));\n }\n\n return nodes;\n }\n /**\n * Returns a list of parse nodes, determined by the parseFn.\n * It can be empty only if open token is missing otherwise it will always return non-empty list\n * that begins with a lex token of openKind and ends with a lex token of closeKind.\n * Advances the parser to the next lex token after the closing token.\n */\n\n optionalMany(openKind, parseFn, closeKind) {\n if (this.expectOptionalToken(openKind)) {\n const nodes = [];\n\n do {\n nodes.push(parseFn.call(this));\n } while (!this.expectOptionalToken(closeKind));\n\n return nodes;\n }\n\n return [];\n }\n /**\n * Returns a non-empty list of parse nodes, determined by the parseFn.\n * This list begins with a lex token of openKind and ends with a lex token of closeKind.\n * Advances the parser to the next lex token after the closing token.\n */\n\n many(openKind, parseFn, closeKind) {\n this.expectToken(openKind);\n const nodes = [];\n\n do {\n nodes.push(parseFn.call(this));\n } while (!this.expectOptionalToken(closeKind));\n\n return nodes;\n }\n /**\n * Returns a non-empty list of parse nodes, determined by the parseFn.\n * This list may begin with a lex token of delimiterKind followed by items separated by lex tokens of tokenKind.\n * Advances the parser to the next lex token after last item in the list.\n */\n\n delimitedMany(delimiterKind, parseFn) {\n this.expectOptionalToken(delimiterKind);\n const nodes = [];\n\n do {\n nodes.push(parseFn.call(this));\n } while (this.expectOptionalToken(delimiterKind));\n\n return nodes;\n }\n\n advanceLexer() {\n const { maxTokens } = this._options;\n\n const token = this._lexer.advance();\n\n if (token.kind !== TokenKind.EOF) {\n ++this._tokenCounter;\n\n if (maxTokens !== undefined && this._tokenCounter > maxTokens) {\n throw syntaxError(\n this._lexer.source,\n token.start,\n `Document contains more that ${maxTokens} tokens. Parsing aborted.`,\n );\n }\n }\n }\n}\n/**\n * A helper function to describe a token as a string for debugging.\n */\n\nfunction getTokenDesc(token) {\n const value = token.value;\n return getTokenKindDesc(token.kind) + (value != null ? ` \"${value}\"` : '');\n}\n/**\n * A helper function to describe a token kind as a string for debugging.\n */\n\nfunction getTokenKindDesc(kind) {\n return isPunctuatorTokenKind(kind) ? `\"${kind}\"` : kind;\n}\n", "const MAX_SUGGESTIONS = 5;\n/**\n * Given [ A, B, C ] return ' Did you mean A, B, or C?'.\n */\n\nexport function didYouMean(firstArg, secondArg) {\n const [subMessage, suggestionsArg] = secondArg\n ? [firstArg, secondArg]\n : [undefined, firstArg];\n let message = ' Did you mean ';\n\n if (subMessage) {\n message += subMessage + ' ';\n }\n\n const suggestions = suggestionsArg.map((x) => `\"${x}\"`);\n\n switch (suggestions.length) {\n case 0:\n return '';\n\n case 1:\n return message + suggestions[0] + '?';\n\n case 2:\n return message + suggestions[0] + ' or ' + suggestions[1] + '?';\n }\n\n const selected = suggestions.slice(0, MAX_SUGGESTIONS);\n const lastItem = selected.pop();\n return message + selected.join(', ') + ', or ' + lastItem + '?';\n}\n", "/**\n * Returns the first argument it receives.\n */\nexport function identityFunc(x) {\n return x;\n}\n", "/**\n * Creates a keyed JS object from an array, given a function to produce the keys\n * for each value in the array.\n *\n * This provides a convenient lookup for the array items if the key function\n * produces unique results.\n * ```ts\n * const phoneBook = [\n * { name: 'Jon', num: '555-1234' },\n * { name: 'Jenny', num: '867-5309' }\n * ]\n *\n * const entriesByName = keyMap(\n * phoneBook,\n * entry => entry.name\n * )\n *\n * // {\n * // Jon: { name: 'Jon', num: '555-1234' },\n * // Jenny: { name: 'Jenny', num: '867-5309' }\n * // }\n *\n * const jennyEntry = entriesByName['Jenny']\n *\n * // { name: 'Jenny', num: '857-6309' }\n * ```\n */\nexport function keyMap(list, keyFn) {\n const result = Object.create(null);\n\n for (const item of list) {\n result[keyFn(item)] = item;\n }\n\n return result;\n}\n", "/**\n * Creates a keyed JS object from an array, given a function to produce the keys\n * and a function to produce the values from each item in the array.\n * ```ts\n * const phoneBook = [\n * { name: 'Jon', num: '555-1234' },\n * { name: 'Jenny', num: '867-5309' }\n * ]\n *\n * // { Jon: '555-1234', Jenny: '867-5309' }\n * const phonesByName = keyValMap(\n * phoneBook,\n * entry => entry.name,\n * entry => entry.num\n * )\n * ```\n */\nexport function keyValMap(list, keyFn, valFn) {\n const result = Object.create(null);\n\n for (const item of list) {\n result[keyFn(item)] = valFn(item);\n }\n\n return result;\n}\n", "/**\n * Creates an object map with the same keys as `map` and values generated by\n * running each value of `map` thru `fn`.\n */\nexport function mapValue(map, fn) {\n const result = Object.create(null);\n\n for (const key of Object.keys(map)) {\n result[key] = fn(map[key], key);\n }\n\n return result;\n}\n", "/**\n * Returns a number indicating whether a reference string comes before, or after,\n * or is the same as the given string in natural sort order.\n *\n * See: https://en.wikipedia.org/wiki/Natural_sort_order\n *\n */\nexport function naturalCompare(aStr, bStr) {\n let aIndex = 0;\n let bIndex = 0;\n\n while (aIndex < aStr.length && bIndex < bStr.length) {\n let aChar = aStr.charCodeAt(aIndex);\n let bChar = bStr.charCodeAt(bIndex);\n\n if (isDigit(aChar) && isDigit(bChar)) {\n let aNum = 0;\n\n do {\n ++aIndex;\n aNum = aNum * 10 + aChar - DIGIT_0;\n aChar = aStr.charCodeAt(aIndex);\n } while (isDigit(aChar) && aNum > 0);\n\n let bNum = 0;\n\n do {\n ++bIndex;\n bNum = bNum * 10 + bChar - DIGIT_0;\n bChar = bStr.charCodeAt(bIndex);\n } while (isDigit(bChar) && bNum > 0);\n\n if (aNum < bNum) {\n return -1;\n }\n\n if (aNum > bNum) {\n return 1;\n }\n } else {\n if (aChar < bChar) {\n return -1;\n }\n\n if (aChar > bChar) {\n return 1;\n }\n\n ++aIndex;\n ++bIndex;\n }\n }\n\n return aStr.length - bStr.length;\n}\nconst DIGIT_0 = 48;\nconst DIGIT_9 = 57;\n\nfunction isDigit(code) {\n return !isNaN(code) && DIGIT_0 <= code && code <= DIGIT_9;\n}\n", "import { naturalCompare } from './naturalCompare.mjs';\n/**\n * Given an invalid input string and a list of valid options, returns a filtered\n * list of valid options sorted based on their similarity with the input.\n */\n\nexport function suggestionList(input, options) {\n const optionsByDistance = Object.create(null);\n const lexicalDistance = new LexicalDistance(input);\n const threshold = Math.floor(input.length * 0.4) + 1;\n\n for (const option of options) {\n const distance = lexicalDistance.measure(option, threshold);\n\n if (distance !== undefined) {\n optionsByDistance[option] = distance;\n }\n }\n\n return Object.keys(optionsByDistance).sort((a, b) => {\n const distanceDiff = optionsByDistance[a] - optionsByDistance[b];\n return distanceDiff !== 0 ? distanceDiff : naturalCompare(a, b);\n });\n}\n/**\n * Computes the lexical distance between strings A and B.\n *\n * The \"distance\" between two strings is given by counting the minimum number\n * of edits needed to transform string A into string B. An edit can be an\n * insertion, deletion, or substitution of a single character, or a swap of two\n * adjacent characters.\n *\n * Includes a custom alteration from Damerau-Levenshtein to treat case changes\n * as a single edit which helps identify mis-cased values with an edit distance\n * of 1.\n *\n * This distance can be useful for detecting typos in input or sorting\n */\n\nclass LexicalDistance {\n constructor(input) {\n this._input = input;\n this._inputLowerCase = input.toLowerCase();\n this._inputArray = stringToArray(this._inputLowerCase);\n this._rows = [\n new Array(input.length + 1).fill(0),\n new Array(input.length + 1).fill(0),\n new Array(input.length + 1).fill(0),\n ];\n }\n\n measure(option, threshold) {\n if (this._input === option) {\n return 0;\n }\n\n const optionLowerCase = option.toLowerCase(); // Any case change counts as a single edit\n\n if (this._inputLowerCase === optionLowerCase) {\n return 1;\n }\n\n let a = stringToArray(optionLowerCase);\n let b = this._inputArray;\n\n if (a.length < b.length) {\n const tmp = a;\n a = b;\n b = tmp;\n }\n\n const aLength = a.length;\n const bLength = b.length;\n\n if (aLength - bLength > threshold) {\n return undefined;\n }\n\n const rows = this._rows;\n\n for (let j = 0; j <= bLength; j++) {\n rows[0][j] = j;\n }\n\n for (let i = 1; i <= aLength; i++) {\n const upRow = rows[(i - 1) % 3];\n const currentRow = rows[i % 3];\n let smallestCell = (currentRow[0] = i);\n\n for (let j = 1; j <= bLength; j++) {\n const cost = a[i - 1] === b[j - 1] ? 0 : 1;\n let currentCell = Math.min(\n upRow[j] + 1, // delete\n currentRow[j - 1] + 1, // insert\n upRow[j - 1] + cost, // substitute\n );\n\n if (i > 1 && j > 1 && a[i - 1] === b[j - 2] && a[i - 2] === b[j - 1]) {\n // transposition\n const doubleDiagonalCell = rows[(i - 2) % 3][j - 2];\n currentCell = Math.min(currentCell, doubleDiagonalCell + 1);\n }\n\n if (currentCell < smallestCell) {\n smallestCell = currentCell;\n }\n\n currentRow[j] = currentCell;\n } // Early exit, since distance can't go smaller than smallest element of the previous row.\n\n if (smallestCell > threshold) {\n return undefined;\n }\n }\n\n const distance = rows[aLength % 3][bLength];\n return distance <= threshold ? distance : undefined;\n }\n}\n\nfunction stringToArray(str) {\n const strLength = str.length;\n const array = new Array(strLength);\n\n for (let i = 0; i < strLength; ++i) {\n array[i] = str.charCodeAt(i);\n }\n\n return array;\n}\n", "export function toObjMap(obj) {\n if (obj == null) {\n return Object.create(null);\n }\n\n if (Object.getPrototypeOf(obj) === null) {\n return obj;\n }\n\n const map = Object.create(null);\n\n for (const [key, value] of Object.entries(obj)) {\n map[key] = value;\n }\n\n return map;\n}\n", "/**\n * Prints a string as a GraphQL StringValue literal. Replaces control characters\n * and excluded characters (\" U+0022 and \\\\ U+005C) with escape sequences.\n */\nexport function printString(str) {\n return `\"${str.replace(escapedRegExp, escapedReplacer)}\"`;\n} // eslint-disable-next-line no-control-regex\n\nconst escapedRegExp = /[\\x00-\\x1f\\x22\\x5c\\x7f-\\x9f]/g;\n\nfunction escapedReplacer(str) {\n return escapeSequences[str.charCodeAt(0)];\n} // prettier-ignore\n\nconst escapeSequences = [\n '\\\\u0000',\n '\\\\u0001',\n '\\\\u0002',\n '\\\\u0003',\n '\\\\u0004',\n '\\\\u0005',\n '\\\\u0006',\n '\\\\u0007',\n '\\\\b',\n '\\\\t',\n '\\\\n',\n '\\\\u000B',\n '\\\\f',\n '\\\\r',\n '\\\\u000E',\n '\\\\u000F',\n '\\\\u0010',\n '\\\\u0011',\n '\\\\u0012',\n '\\\\u0013',\n '\\\\u0014',\n '\\\\u0015',\n '\\\\u0016',\n '\\\\u0017',\n '\\\\u0018',\n '\\\\u0019',\n '\\\\u001A',\n '\\\\u001B',\n '\\\\u001C',\n '\\\\u001D',\n '\\\\u001E',\n '\\\\u001F',\n '',\n '',\n '\\\\\"',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '', // 2F\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '', // 3F\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '', // 4F\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '\\\\\\\\',\n '',\n '',\n '', // 5F\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '', // 6F\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '\\\\u007F',\n '\\\\u0080',\n '\\\\u0081',\n '\\\\u0082',\n '\\\\u0083',\n '\\\\u0084',\n '\\\\u0085',\n '\\\\u0086',\n '\\\\u0087',\n '\\\\u0088',\n '\\\\u0089',\n '\\\\u008A',\n '\\\\u008B',\n '\\\\u008C',\n '\\\\u008D',\n '\\\\u008E',\n '\\\\u008F',\n '\\\\u0090',\n '\\\\u0091',\n '\\\\u0092',\n '\\\\u0093',\n '\\\\u0094',\n '\\\\u0095',\n '\\\\u0096',\n '\\\\u0097',\n '\\\\u0098',\n '\\\\u0099',\n '\\\\u009A',\n '\\\\u009B',\n '\\\\u009C',\n '\\\\u009D',\n '\\\\u009E',\n '\\\\u009F',\n];\n", "import { devAssert } from '../jsutils/devAssert.mjs';\nimport { inspect } from '../jsutils/inspect.mjs';\nimport { isNode, QueryDocumentKeys } from './ast.mjs';\nimport { Kind } from './kinds.mjs';\n/**\n * A visitor is provided to visit, it contains the collection of\n * relevant functions to be called during the visitor's traversal.\n */\n\nexport const BREAK = Object.freeze({});\n/**\n * visit() will walk through an AST using a depth-first traversal, calling\n * the visitor's enter function at each node in the traversal, and calling the\n * leave function after visiting that node and all of its child nodes.\n *\n * By returning different values from the enter and leave functions, the\n * behavior of the visitor can be altered, including skipping over a sub-tree of\n * the AST (by returning false), editing the AST by returning a value or null\n * to remove the value, or to stop the whole traversal by returning BREAK.\n *\n * When using visit() to edit an AST, the original AST will not be modified, and\n * a new version of the AST with the changes applied will be returned from the\n * visit function.\n *\n * ```ts\n * const editedAST = visit(ast, {\n * enter(node, key, parent, path, ancestors) {\n * // @return\n * // undefined: no action\n * // false: skip visiting this node\n * // visitor.BREAK: stop visiting altogether\n * // null: delete this node\n * // any value: replace this node with the returned value\n * },\n * leave(node, key, parent, path, ancestors) {\n * // @return\n * // undefined: no action\n * // false: no action\n * // visitor.BREAK: stop visiting altogether\n * // null: delete this node\n * // any value: replace this node with the returned value\n * }\n * });\n * ```\n *\n * Alternatively to providing enter() and leave() functions, a visitor can\n * instead provide functions named the same as the kinds of AST nodes, or\n * enter/leave visitors at a named key, leading to three permutations of the\n * visitor API:\n *\n * 1) Named visitors triggered when entering a node of a specific kind.\n *\n * ```ts\n * visit(ast, {\n * Kind(node) {\n * // enter the \"Kind\" node\n * }\n * })\n * ```\n *\n * 2) Named visitors that trigger upon entering and leaving a node of a specific kind.\n *\n * ```ts\n * visit(ast, {\n * Kind: {\n * enter(node) {\n * // enter the \"Kind\" node\n * }\n * leave(node) {\n * // leave the \"Kind\" node\n * }\n * }\n * })\n * ```\n *\n * 3) Generic visitors that trigger upon entering and leaving any node.\n *\n * ```ts\n * visit(ast, {\n * enter(node) {\n * // enter any node\n * },\n * leave(node) {\n * // leave any node\n * }\n * })\n * ```\n */\n\nexport function visit(root, visitor, visitorKeys = QueryDocumentKeys) {\n const enterLeaveMap = new Map();\n\n for (const kind of Object.values(Kind)) {\n enterLeaveMap.set(kind, getEnterLeaveForKind(visitor, kind));\n }\n /* eslint-disable no-undef-init */\n\n let stack = undefined;\n let inArray = Array.isArray(root);\n let keys = [root];\n let index = -1;\n let edits = [];\n let node = root;\n let key = undefined;\n let parent = undefined;\n const path = [];\n const ancestors = [];\n /* eslint-enable no-undef-init */\n\n do {\n index++;\n const isLeaving = index === keys.length;\n const isEdited = isLeaving && edits.length !== 0;\n\n if (isLeaving) {\n key = ancestors.length === 0 ? undefined : path[path.length - 1];\n node = parent;\n parent = ancestors.pop();\n\n if (isEdited) {\n if (inArray) {\n node = node.slice();\n let editOffset = 0;\n\n for (const [editKey, editValue] of edits) {\n const arrayKey = editKey - editOffset;\n\n if (editValue === null) {\n node.splice(arrayKey, 1);\n editOffset++;\n } else {\n node[arrayKey] = editValue;\n }\n }\n } else {\n node = { ...node };\n\n for (const [editKey, editValue] of edits) {\n node[editKey] = editValue;\n }\n }\n }\n\n index = stack.index;\n keys = stack.keys;\n edits = stack.edits;\n inArray = stack.inArray;\n stack = stack.prev;\n } else if (parent) {\n key = inArray ? index : keys[index];\n node = parent[key];\n\n if (node === null || node === undefined) {\n continue;\n }\n\n path.push(key);\n }\n\n let result;\n\n if (!Array.isArray(node)) {\n var _enterLeaveMap$get, _enterLeaveMap$get2;\n\n isNode(node) || devAssert(false, `Invalid AST Node: ${inspect(node)}.`);\n const visitFn = isLeaving\n ? (_enterLeaveMap$get = enterLeaveMap.get(node.kind)) === null ||\n _enterLeaveMap$get === void 0\n ? void 0\n : _enterLeaveMap$get.leave\n : (_enterLeaveMap$get2 = enterLeaveMap.get(node.kind)) === null ||\n _enterLeaveMap$get2 === void 0\n ? void 0\n : _enterLeaveMap$get2.enter;\n result =\n visitFn === null || visitFn === void 0\n ? void 0\n : visitFn.call(visitor, node, key, parent, path, ancestors);\n\n if (result === BREAK) {\n break;\n }\n\n if (result === false) {\n if (!isLeaving) {\n path.pop();\n continue;\n }\n } else if (result !== undefined) {\n edits.push([key, result]);\n\n if (!isLeaving) {\n if (isNode(result)) {\n node = result;\n } else {\n path.pop();\n continue;\n }\n }\n }\n }\n\n if (result === undefined && isEdited) {\n edits.push([key, node]);\n }\n\n if (isLeaving) {\n path.pop();\n } else {\n var _node$kind;\n\n stack = {\n inArray,\n index,\n keys,\n edits,\n prev: stack,\n };\n inArray = Array.isArray(node);\n keys = inArray\n ? node\n : (_node$kind = visitorKeys[node.kind]) !== null &&\n _node$kind !== void 0\n ? _node$kind\n : [];\n index = -1;\n edits = [];\n\n if (parent) {\n ancestors.push(parent);\n }\n\n parent = node;\n }\n } while (stack !== undefined);\n\n if (edits.length !== 0) {\n // New root\n return edits[edits.length - 1][1];\n }\n\n return root;\n}\n/**\n * Creates a new visitor instance which delegates to many visitors to run in\n * parallel. Each visitor will be visited for each node before moving on.\n *\n * If a prior visitor edits a node, no following visitors will see that node.\n */\n\nexport function visitInParallel(visitors) {\n const skipping = new Array(visitors.length).fill(null);\n const mergedVisitor = Object.create(null);\n\n for (const kind of Object.values(Kind)) {\n let hasVisitor = false;\n const enterList = new Array(visitors.length).fill(undefined);\n const leaveList = new Array(visitors.length).fill(undefined);\n\n for (let i = 0; i < visitors.length; ++i) {\n const { enter, leave } = getEnterLeaveForKind(visitors[i], kind);\n hasVisitor || (hasVisitor = enter != null || leave != null);\n enterList[i] = enter;\n leaveList[i] = leave;\n }\n\n if (!hasVisitor) {\n continue;\n }\n\n const mergedEnterLeave = {\n enter(...args) {\n const node = args[0];\n\n for (let i = 0; i < visitors.length; i++) {\n if (skipping[i] === null) {\n var _enterList$i;\n\n const result =\n (_enterList$i = enterList[i]) === null || _enterList$i === void 0\n ? void 0\n : _enterList$i.apply(visitors[i], args);\n\n if (result === false) {\n skipping[i] = node;\n } else if (result === BREAK) {\n skipping[i] = BREAK;\n } else if (result !== undefined) {\n return result;\n }\n }\n }\n },\n\n leave(...args) {\n const node = args[0];\n\n for (let i = 0; i < visitors.length; i++) {\n if (skipping[i] === null) {\n var _leaveList$i;\n\n const result =\n (_leaveList$i = leaveList[i]) === null || _leaveList$i === void 0\n ? void 0\n : _leaveList$i.apply(visitors[i], args);\n\n if (result === BREAK) {\n skipping[i] = BREAK;\n } else if (result !== undefined && result !== false) {\n return result;\n }\n } else if (skipping[i] === node) {\n skipping[i] = null;\n }\n }\n },\n };\n mergedVisitor[kind] = mergedEnterLeave;\n }\n\n return mergedVisitor;\n}\n/**\n * Given a visitor instance and a node kind, return EnterLeaveVisitor for that kind.\n */\n\nexport function getEnterLeaveForKind(visitor, kind) {\n const kindVisitor = visitor[kind];\n\n if (typeof kindVisitor === 'object') {\n // { Kind: { enter() {}, leave() {} } }\n return kindVisitor;\n } else if (typeof kindVisitor === 'function') {\n // { Kind() {} }\n return {\n enter: kindVisitor,\n leave: undefined,\n };\n } // { enter() {}, leave() {} }\n\n return {\n enter: visitor.enter,\n leave: visitor.leave,\n };\n}\n/**\n * Given a visitor instance, if it is leaving or not, and a node kind, return\n * the function the visitor runtime should call.\n *\n * @deprecated Please use `getEnterLeaveForKind` instead. Will be removed in v17\n */\n\n/* c8 ignore next 8 */\n\nexport function getVisitFn(visitor, kind, isLeaving) {\n const { enter, leave } = getEnterLeaveForKind(visitor, kind);\n return isLeaving ? leave : enter;\n}\n", "import { printBlockString } from './blockString.mjs';\nimport { printString } from './printString.mjs';\nimport { visit } from './visitor.mjs';\n/**\n * Converts an AST into a string, using one set of reasonable\n * formatting rules.\n */\n\nexport function print(ast) {\n return visit(ast, printDocASTReducer);\n}\nconst MAX_LINE_LENGTH = 80;\nconst printDocASTReducer = {\n Name: {\n leave: (node) => node.value,\n },\n Variable: {\n leave: (node) => '$' + node.name,\n },\n // Document\n Document: {\n leave: (node) => join(node.definitions, '\\n\\n'),\n },\n OperationDefinition: {\n leave(node) {\n const varDefs = hasMultilineItems(node.variableDefinitions)\n ? wrap('(\\n', join(node.variableDefinitions, '\\n'), '\\n)')\n : wrap('(', join(node.variableDefinitions, ', '), ')');\n const prefix =\n wrap('', node.description, '\\n') +\n join(\n [\n node.operation,\n join([node.name, varDefs]),\n join(node.directives, ' '),\n ],\n ' ',\n ); // Anonymous queries with no directives or variable definitions can use\n // the query short form.\n\n return (prefix === 'query' ? '' : prefix + ' ') + node.selectionSet;\n },\n },\n VariableDefinition: {\n leave: ({ variable, type, defaultValue, directives, description }) =>\n wrap('', description, '\\n') +\n variable +\n ': ' +\n type +\n wrap(' = ', defaultValue) +\n wrap(' ', join(directives, ' ')),\n },\n SelectionSet: {\n leave: ({ selections }) => block(selections),\n },\n Field: {\n leave({ alias, name, arguments: args, directives, selectionSet }) {\n const prefix = wrap('', alias, ': ') + name;\n let argsLine = prefix + wrap('(', join(args, ', '), ')');\n\n if (argsLine.length > MAX_LINE_LENGTH) {\n argsLine = prefix + wrap('(\\n', indent(join(args, '\\n')), '\\n)');\n }\n\n return join([argsLine, join(directives, ' '), selectionSet], ' ');\n },\n },\n Argument: {\n leave: ({ name, value }) => name + ': ' + value,\n },\n // Fragments\n FragmentSpread: {\n leave: ({ name, directives }) =>\n '...' + name + wrap(' ', join(directives, ' ')),\n },\n InlineFragment: {\n leave: ({ typeCondition, directives, selectionSet }) =>\n join(\n [\n '...',\n wrap('on ', typeCondition),\n join(directives, ' '),\n selectionSet,\n ],\n ' ',\n ),\n },\n FragmentDefinition: {\n leave: ({\n name,\n typeCondition,\n variableDefinitions,\n directives,\n selectionSet,\n description,\n }) =>\n wrap('', description, '\\n') + // Note: fragment variable definitions are experimental and may be changed\n // or removed in the future.\n `fragment ${name}${wrap('(', join(variableDefinitions, ', '), ')')} ` +\n `on ${typeCondition} ${wrap('', join(directives, ' '), ' ')}` +\n selectionSet,\n },\n // Value\n IntValue: {\n leave: ({ value }) => value,\n },\n FloatValue: {\n leave: ({ value }) => value,\n },\n StringValue: {\n leave: ({ value, block: isBlockString }) =>\n isBlockString ? printBlockString(value) : printString(value),\n },\n BooleanValue: {\n leave: ({ value }) => (value ? 'true' : 'false'),\n },\n NullValue: {\n leave: () => 'null',\n },\n EnumValue: {\n leave: ({ value }) => value,\n },\n ListValue: {\n leave: ({ values }) => '[' + join(values, ', ') + ']',\n },\n ObjectValue: {\n leave: ({ fields }) => '{' + join(fields, ', ') + '}',\n },\n ObjectField: {\n leave: ({ name, value }) => name + ': ' + value,\n },\n // Directive\n Directive: {\n leave: ({ name, arguments: args }) =>\n '@' + name + wrap('(', join(args, ', '), ')'),\n },\n // Type\n NamedType: {\n leave: ({ name }) => name,\n },\n ListType: {\n leave: ({ type }) => '[' + type + ']',\n },\n NonNullType: {\n leave: ({ type }) => type + '!',\n },\n // Type System Definitions\n SchemaDefinition: {\n leave: ({ description, directives, operationTypes }) =>\n wrap('', description, '\\n') +\n join(['schema', join(directives, ' '), block(operationTypes)], ' '),\n },\n OperationTypeDefinition: {\n leave: ({ operation, type }) => operation + ': ' + type,\n },\n ScalarTypeDefinition: {\n leave: ({ description, name, directives }) =>\n wrap('', description, '\\n') +\n join(['scalar', name, join(directives, ' ')], ' '),\n },\n ObjectTypeDefinition: {\n leave: ({ description, name, interfaces, directives, fields }) =>\n wrap('', description, '\\n') +\n join(\n [\n 'type',\n name,\n wrap('implements ', join(interfaces, ' & ')),\n join(directives, ' '),\n block(fields),\n ],\n ' ',\n ),\n },\n FieldDefinition: {\n leave: ({ description, name, arguments: args, type, directives }) =>\n wrap('', description, '\\n') +\n name +\n (hasMultilineItems(args)\n ? wrap('(\\n', indent(join(args, '\\n')), '\\n)')\n : wrap('(', join(args, ', '), ')')) +\n ': ' +\n type +\n wrap(' ', join(directives, ' ')),\n },\n InputValueDefinition: {\n leave: ({ description, name, type, defaultValue, directives }) =>\n wrap('', description, '\\n') +\n join(\n [name + ': ' + type, wrap('= ', defaultValue), join(directives, ' ')],\n ' ',\n ),\n },\n InterfaceTypeDefinition: {\n leave: ({ description, name, interfaces, directives, fields }) =>\n wrap('', description, '\\n') +\n join(\n [\n 'interface',\n name,\n wrap('implements ', join(interfaces, ' & ')),\n join(directives, ' '),\n block(fields),\n ],\n ' ',\n ),\n },\n UnionTypeDefinition: {\n leave: ({ description, name, directives, types }) =>\n wrap('', description, '\\n') +\n join(\n ['union', name, join(directives, ' '), wrap('= ', join(types, ' | '))],\n ' ',\n ),\n },\n EnumTypeDefinition: {\n leave: ({ description, name, directives, values }) =>\n wrap('', description, '\\n') +\n join(['enum', name, join(directives, ' '), block(values)], ' '),\n },\n EnumValueDefinition: {\n leave: ({ description, name, directives }) =>\n wrap('', description, '\\n') + join([name, join(directives, ' ')], ' '),\n },\n InputObjectTypeDefinition: {\n leave: ({ description, name, directives, fields }) =>\n wrap('', description, '\\n') +\n join(['input', name, join(directives, ' '), block(fields)], ' '),\n },\n DirectiveDefinition: {\n leave: ({ description, name, arguments: args, repeatable, locations }) =>\n wrap('', description, '\\n') +\n 'directive @' +\n name +\n (hasMultilineItems(args)\n ? wrap('(\\n', indent(join(args, '\\n')), '\\n)')\n : wrap('(', join(args, ', '), ')')) +\n (repeatable ? ' repeatable' : '') +\n ' on ' +\n join(locations, ' | '),\n },\n SchemaExtension: {\n leave: ({ directives, operationTypes }) =>\n join(\n ['extend schema', join(directives, ' '), block(operationTypes)],\n ' ',\n ),\n },\n ScalarTypeExtension: {\n leave: ({ name, directives }) =>\n join(['extend scalar', name, join(directives, ' ')], ' '),\n },\n ObjectTypeExtension: {\n leave: ({ name, interfaces, directives, fields }) =>\n join(\n [\n 'extend type',\n name,\n wrap('implements ', join(interfaces, ' & ')),\n join(directives, ' '),\n block(fields),\n ],\n ' ',\n ),\n },\n InterfaceTypeExtension: {\n leave: ({ name, interfaces, directives, fields }) =>\n join(\n [\n 'extend interface',\n name,\n wrap('implements ', join(interfaces, ' & ')),\n join(directives, ' '),\n block(fields),\n ],\n ' ',\n ),\n },\n UnionTypeExtension: {\n leave: ({ name, directives, types }) =>\n join(\n [\n 'extend union',\n name,\n join(directives, ' '),\n wrap('= ', join(types, ' | ')),\n ],\n ' ',\n ),\n },\n EnumTypeExtension: {\n leave: ({ name, directives, values }) =>\n join(['extend enum', name, join(directives, ' '), block(values)], ' '),\n },\n InputObjectTypeExtension: {\n leave: ({ name, directives, fields }) =>\n join(['extend input', name, join(directives, ' '), block(fields)], ' '),\n },\n // Schema Coordinates\n TypeCoordinate: {\n leave: ({ name }) => name,\n },\n MemberCoordinate: {\n leave: ({ name, memberName }) => join([name, wrap('.', memberName)]),\n },\n ArgumentCoordinate: {\n leave: ({ name, fieldName, argumentName }) =>\n join([name, wrap('.', fieldName), wrap('(', argumentName, ':)')]),\n },\n DirectiveCoordinate: {\n leave: ({ name }) => join(['@', name]),\n },\n DirectiveArgumentCoordinate: {\n leave: ({ name, argumentName }) =>\n join(['@', name, wrap('(', argumentName, ':)')]),\n },\n};\n/**\n * Given maybeArray, print an empty string if it is null or empty, otherwise\n * print all items together separated by separator if provided\n */\n\nfunction join(maybeArray, separator = '') {\n var _maybeArray$filter$jo;\n\n return (_maybeArray$filter$jo =\n maybeArray === null || maybeArray === void 0\n ? void 0\n : maybeArray.filter((x) => x).join(separator)) !== null &&\n _maybeArray$filter$jo !== void 0\n ? _maybeArray$filter$jo\n : '';\n}\n/**\n * Given array, print each item on its own line, wrapped in an indented `{ }` block.\n */\n\nfunction block(array) {\n return wrap('{\\n', indent(join(array, '\\n')), '\\n}');\n}\n/**\n * If maybeString is not null or empty, then wrap with start and end, otherwise print an empty string.\n */\n\nfunction wrap(start, maybeString, end = '') {\n return maybeString != null && maybeString !== ''\n ? start + maybeString + end\n : '';\n}\n\nfunction indent(str) {\n return wrap(' ', str.replace(/\\n/g, '\\n '));\n}\n\nfunction hasMultilineItems(maybeArray) {\n var _maybeArray$some;\n\n // FIXME: https://github.com/graphql/graphql-js/issues/2203\n\n /* c8 ignore next */\n return (_maybeArray$some =\n maybeArray === null || maybeArray === void 0\n ? void 0\n : maybeArray.some((str) => str.includes('\\n'))) !== null &&\n _maybeArray$some !== void 0\n ? _maybeArray$some\n : false;\n}\n", "import { keyValMap } from '../jsutils/keyValMap.mjs';\nimport { Kind } from '../language/kinds.mjs';\n/**\n * Produces a JavaScript value given a GraphQL Value AST.\n *\n * Unlike `valueFromAST()`, no type is provided. The resulting JavaScript value\n * will reflect the provided GraphQL value AST.\n *\n * | GraphQL Value | JavaScript Value |\n * | -------------------- | ---------------- |\n * | Input Object | Object |\n * | List | Array |\n * | Boolean | Boolean |\n * | String / Enum | String |\n * | Int / Float | Number |\n * | Null | null |\n *\n */\n\nexport function valueFromASTUntyped(valueNode, variables) {\n switch (valueNode.kind) {\n case Kind.NULL:\n return null;\n\n case Kind.INT:\n return parseInt(valueNode.value, 10);\n\n case Kind.FLOAT:\n return parseFloat(valueNode.value);\n\n case Kind.STRING:\n case Kind.ENUM:\n case Kind.BOOLEAN:\n return valueNode.value;\n\n case Kind.LIST:\n return valueNode.values.map((node) =>\n valueFromASTUntyped(node, variables),\n );\n\n case Kind.OBJECT:\n return keyValMap(\n valueNode.fields,\n (field) => field.name.value,\n (field) => valueFromASTUntyped(field.value, variables),\n );\n\n case Kind.VARIABLE:\n return variables === null || variables === void 0\n ? void 0\n : variables[valueNode.name.value];\n }\n}\n", "import { devAssert } from '../jsutils/devAssert.mjs';\nimport { GraphQLError } from '../error/GraphQLError.mjs';\nimport { isNameContinue, isNameStart } from '../language/characterClasses.mjs';\n/**\n * Upholds the spec rules about naming.\n */\n\nexport function assertName(name) {\n name != null || devAssert(false, 'Must provide name.');\n typeof name === 'string' || devAssert(false, 'Expected name to be a string.');\n\n if (name.length === 0) {\n throw new GraphQLError('Expected name to be a non-empty string.');\n }\n\n for (let i = 1; i < name.length; ++i) {\n if (!isNameContinue(name.charCodeAt(i))) {\n throw new GraphQLError(\n `Names must only contain [_a-zA-Z0-9] but \"${name}\" does not.`,\n );\n }\n }\n\n if (!isNameStart(name.charCodeAt(0))) {\n throw new GraphQLError(\n `Names must start with [_a-zA-Z] but \"${name}\" does not.`,\n );\n }\n\n return name;\n}\n/**\n * Upholds the spec rules about naming enum values.\n *\n * @internal\n */\n\nexport function assertEnumValueName(name) {\n if (name === 'true' || name === 'false' || name === 'null') {\n throw new GraphQLError(`Enum values cannot be named: ${name}`);\n }\n\n return assertName(name);\n}\n", "import { devAssert } from '../jsutils/devAssert.mjs';\nimport { didYouMean } from '../jsutils/didYouMean.mjs';\nimport { identityFunc } from '../jsutils/identityFunc.mjs';\nimport { inspect } from '../jsutils/inspect.mjs';\nimport { instanceOf } from '../jsutils/instanceOf.mjs';\nimport { isObjectLike } from '../jsutils/isObjectLike.mjs';\nimport { keyMap } from '../jsutils/keyMap.mjs';\nimport { keyValMap } from '../jsutils/keyValMap.mjs';\nimport { mapValue } from '../jsutils/mapValue.mjs';\nimport { suggestionList } from '../jsutils/suggestionList.mjs';\nimport { toObjMap } from '../jsutils/toObjMap.mjs';\nimport { GraphQLError } from '../error/GraphQLError.mjs';\nimport { Kind } from '../language/kinds.mjs';\nimport { print } from '../language/printer.mjs';\nimport { valueFromASTUntyped } from '../utilities/valueFromASTUntyped.mjs';\nimport { assertEnumValueName, assertName } from './assertName.mjs';\nexport function isType(type) {\n return (\n isScalarType(type) ||\n isObjectType(type) ||\n isInterfaceType(type) ||\n isUnionType(type) ||\n isEnumType(type) ||\n isInputObjectType(type) ||\n isListType(type) ||\n isNonNullType(type)\n );\n}\nexport function assertType(type) {\n if (!isType(type)) {\n throw new Error(`Expected ${inspect(type)} to be a GraphQL type.`);\n }\n\n return type;\n}\n/**\n * There are predicates for each kind of GraphQL type.\n */\n\nexport function isScalarType(type) {\n return instanceOf(type, GraphQLScalarType);\n}\nexport function assertScalarType(type) {\n if (!isScalarType(type)) {\n throw new Error(`Expected ${inspect(type)} to be a GraphQL Scalar type.`);\n }\n\n return type;\n}\nexport function isObjectType(type) {\n return instanceOf(type, GraphQLObjectType);\n}\nexport function assertObjectType(type) {\n if (!isObjectType(type)) {\n throw new Error(`Expected ${inspect(type)} to be a GraphQL Object type.`);\n }\n\n return type;\n}\nexport function isInterfaceType(type) {\n return instanceOf(type, GraphQLInterfaceType);\n}\nexport function assertInterfaceType(type) {\n if (!isInterfaceType(type)) {\n throw new Error(\n `Expected ${inspect(type)} to be a GraphQL Interface type.`,\n );\n }\n\n return type;\n}\nexport function isUnionType(type) {\n return instanceOf(type, GraphQLUnionType);\n}\nexport function assertUnionType(type) {\n if (!isUnionType(type)) {\n throw new Error(`Expected ${inspect(type)} to be a GraphQL Union type.`);\n }\n\n return type;\n}\nexport function isEnumType(type) {\n return instanceOf(type, GraphQLEnumType);\n}\nexport function assertEnumType(type) {\n if (!isEnumType(type)) {\n throw new Error(`Expected ${inspect(type)} to be a GraphQL Enum type.`);\n }\n\n return type;\n}\nexport function isInputObjectType(type) {\n return instanceOf(type, GraphQLInputObjectType);\n}\nexport function assertInputObjectType(type) {\n if (!isInputObjectType(type)) {\n throw new Error(\n `Expected ${inspect(type)} to be a GraphQL Input Object type.`,\n );\n }\n\n return type;\n}\nexport function isListType(type) {\n return instanceOf(type, GraphQLList);\n}\nexport function assertListType(type) {\n if (!isListType(type)) {\n throw new Error(`Expected ${inspect(type)} to be a GraphQL List type.`);\n }\n\n return type;\n}\nexport function isNonNullType(type) {\n return instanceOf(type, GraphQLNonNull);\n}\nexport function assertNonNullType(type) {\n if (!isNonNullType(type)) {\n throw new Error(`Expected ${inspect(type)} to be a GraphQL Non-Null type.`);\n }\n\n return type;\n}\n/**\n * These types may be used as input types for arguments and directives.\n */\n\nexport function isInputType(type) {\n return (\n isScalarType(type) ||\n isEnumType(type) ||\n isInputObjectType(type) ||\n (isWrappingType(type) && isInputType(type.ofType))\n );\n}\nexport function assertInputType(type) {\n if (!isInputType(type)) {\n throw new Error(`Expected ${inspect(type)} to be a GraphQL input type.`);\n }\n\n return type;\n}\n/**\n * These types may be used as output types as the result of fields.\n */\n\nexport function isOutputType(type) {\n return (\n isScalarType(type) ||\n isObjectType(type) ||\n isInterfaceType(type) ||\n isUnionType(type) ||\n isEnumType(type) ||\n (isWrappingType(type) && isOutputType(type.ofType))\n );\n}\nexport function assertOutputType(type) {\n if (!isOutputType(type)) {\n throw new Error(`Expected ${inspect(type)} to be a GraphQL output type.`);\n }\n\n return type;\n}\n/**\n * These types may describe types which may be leaf values.\n */\n\nexport function isLeafType(type) {\n return isScalarType(type) || isEnumType(type);\n}\nexport function assertLeafType(type) {\n if (!isLeafType(type)) {\n throw new Error(`Expected ${inspect(type)} to be a GraphQL leaf type.`);\n }\n\n return type;\n}\n/**\n * These types may describe the parent context of a selection set.\n */\n\nexport function isCompositeType(type) {\n return isObjectType(type) || isInterfaceType(type) || isUnionType(type);\n}\nexport function assertCompositeType(type) {\n if (!isCompositeType(type)) {\n throw new Error(\n `Expected ${inspect(type)} to be a GraphQL composite type.`,\n );\n }\n\n return type;\n}\n/**\n * These types may describe the parent context of a selection set.\n */\n\nexport function isAbstractType(type) {\n return isInterfaceType(type) || isUnionType(type);\n}\nexport function assertAbstractType(type) {\n if (!isAbstractType(type)) {\n throw new Error(`Expected ${inspect(type)} to be a GraphQL abstract type.`);\n }\n\n return type;\n}\n/**\n * List Type Wrapper\n *\n * A list is a wrapping type which points to another type.\n * Lists are often created within the context of defining the fields of\n * an object type.\n *\n * Example:\n *\n * ```ts\n * const PersonType = new GraphQLObjectType({\n * name: 'Person',\n * fields: () => ({\n * parents: { type: new GraphQLList(PersonType) },\n * children: { type: new GraphQLList(PersonType) },\n * })\n * })\n * ```\n */\n\nexport class GraphQLList {\n constructor(ofType) {\n isType(ofType) ||\n devAssert(false, `Expected ${inspect(ofType)} to be a GraphQL type.`);\n this.ofType = ofType;\n }\n\n get [Symbol.toStringTag]() {\n return 'GraphQLList';\n }\n\n toString() {\n return '[' + String(this.ofType) + ']';\n }\n\n toJSON() {\n return this.toString();\n }\n}\n/**\n * Non-Null Type Wrapper\n *\n * A non-null is a wrapping type which points to another type.\n * Non-null types enforce that their values are never null and can ensure\n * an error is raised if this ever occurs during a request. It is useful for\n * fields which you can make a strong guarantee on non-nullability, for example\n * usually the id field of a database row will never be null.\n *\n * Example:\n *\n * ```ts\n * const RowType = new GraphQLObjectType({\n * name: 'Row',\n * fields: () => ({\n * id: { type: new GraphQLNonNull(GraphQLString) },\n * })\n * })\n * ```\n * Note: the enforcement of non-nullability occurs within the executor.\n */\n\nexport class GraphQLNonNull {\n constructor(ofType) {\n isNullableType(ofType) ||\n devAssert(\n false,\n `Expected ${inspect(ofType)} to be a GraphQL nullable type.`,\n );\n this.ofType = ofType;\n }\n\n get [Symbol.toStringTag]() {\n return 'GraphQLNonNull';\n }\n\n toString() {\n return String(this.ofType) + '!';\n }\n\n toJSON() {\n return this.toString();\n }\n}\n/**\n * These types wrap and modify other types\n */\n\nexport function isWrappingType(type) {\n return isListType(type) || isNonNullType(type);\n}\nexport function assertWrappingType(type) {\n if (!isWrappingType(type)) {\n throw new Error(`Expected ${inspect(type)} to be a GraphQL wrapping type.`);\n }\n\n return type;\n}\n/**\n * These types can all accept null as a value.\n */\n\nexport function isNullableType(type) {\n return isType(type) && !isNonNullType(type);\n}\nexport function assertNullableType(type) {\n if (!isNullableType(type)) {\n throw new Error(`Expected ${inspect(type)} to be a GraphQL nullable type.`);\n }\n\n return type;\n}\nexport function getNullableType(type) {\n if (type) {\n return isNonNullType(type) ? type.ofType : type;\n }\n}\n/**\n * These named types do not include modifiers like List or NonNull.\n */\n\nexport function isNamedType(type) {\n return (\n isScalarType(type) ||\n isObjectType(type) ||\n isInterfaceType(type) ||\n isUnionType(type) ||\n isEnumType(type) ||\n isInputObjectType(type)\n );\n}\nexport function assertNamedType(type) {\n if (!isNamedType(type)) {\n throw new Error(`Expected ${inspect(type)} to be a GraphQL named type.`);\n }\n\n return type;\n}\nexport function getNamedType(type) {\n if (type) {\n let unwrappedType = type;\n\n while (isWrappingType(unwrappedType)) {\n unwrappedType = unwrappedType.ofType;\n }\n\n return unwrappedType;\n }\n}\n/**\n * Used while defining GraphQL types to allow for circular references in\n * otherwise immutable type definitions.\n */\n\nexport function resolveReadonlyArrayThunk(thunk) {\n return typeof thunk === 'function' ? thunk() : thunk;\n}\nexport function resolveObjMapThunk(thunk) {\n return typeof thunk === 'function' ? thunk() : thunk;\n}\n/**\n * Custom extensions\n *\n * @remarks\n * Use a unique identifier name for your extension, for example the name of\n * your library or project. Do not use a shortened identifier as this increases\n * the risk of conflicts. We recommend you add at most one extension field,\n * an object which can contain all the values you need.\n */\n\n/**\n * Scalar Type Definition\n *\n * The leaf values of any request and input values to arguments are\n * Scalars (or Enums) and are defined with a name and a series of functions\n * used to parse input from ast or variables and to ensure validity.\n *\n * If a type's serialize function returns `null` or does not return a value\n * (i.e. it returns `undefined`) then an error will be raised and a `null`\n * value will be returned in the response. It is always better to validate\n *\n * Example:\n *\n * ```ts\n * const OddType = new GraphQLScalarType({\n * name: 'Odd',\n * serialize(value) {\n * if (!Number.isFinite(value)) {\n * throw new Error(\n * `Scalar \"Odd\" cannot represent \"${value}\" since it is not a finite number.`,\n * );\n * }\n *\n * if (value % 2 === 0) {\n * throw new Error(`Scalar \"Odd\" cannot represent \"${value}\" since it is even.`);\n * }\n * return value;\n * }\n * });\n * ```\n */\nexport class GraphQLScalarType {\n constructor(config) {\n var _config$parseValue,\n _config$serialize,\n _config$parseLiteral,\n _config$extensionASTN;\n\n const parseValue =\n (_config$parseValue = config.parseValue) !== null &&\n _config$parseValue !== void 0\n ? _config$parseValue\n : identityFunc;\n this.name = assertName(config.name);\n this.description = config.description;\n this.specifiedByURL = config.specifiedByURL;\n this.serialize =\n (_config$serialize = config.serialize) !== null &&\n _config$serialize !== void 0\n ? _config$serialize\n : identityFunc;\n this.parseValue = parseValue;\n this.parseLiteral =\n (_config$parseLiteral = config.parseLiteral) !== null &&\n _config$parseLiteral !== void 0\n ? _config$parseLiteral\n : (node, variables) => parseValue(valueFromASTUntyped(node, variables));\n this.extensions = toObjMap(config.extensions);\n this.astNode = config.astNode;\n this.extensionASTNodes =\n (_config$extensionASTN = config.extensionASTNodes) !== null &&\n _config$extensionASTN !== void 0\n ? _config$extensionASTN\n : [];\n config.specifiedByURL == null ||\n typeof config.specifiedByURL === 'string' ||\n devAssert(\n false,\n `${this.name} must provide \"specifiedByURL\" as a string, ` +\n `but got: ${inspect(config.specifiedByURL)}.`,\n );\n config.serialize == null ||\n typeof config.serialize === 'function' ||\n devAssert(\n false,\n `${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.`,\n );\n\n if (config.parseLiteral) {\n (typeof config.parseValue === 'function' &&\n typeof config.parseLiteral === 'function') ||\n devAssert(\n false,\n `${this.name} must provide both \"parseValue\" and \"parseLiteral\" functions.`,\n );\n }\n }\n\n get [Symbol.toStringTag]() {\n return 'GraphQLScalarType';\n }\n\n toConfig() {\n return {\n name: this.name,\n description: this.description,\n specifiedByURL: this.specifiedByURL,\n serialize: this.serialize,\n parseValue: this.parseValue,\n parseLiteral: this.parseLiteral,\n extensions: this.extensions,\n astNode: this.astNode,\n extensionASTNodes: this.extensionASTNodes,\n };\n }\n\n toString() {\n return this.name;\n }\n\n toJSON() {\n return this.toString();\n }\n}\n\n/**\n * Object Type Definition\n *\n * Almost all of the GraphQL types you define will be object types. Object types\n * have a name, but most importantly describe their fields.\n *\n * Example:\n *\n * ```ts\n * const AddressType = new GraphQLObjectType({\n * name: 'Address',\n * fields: {\n * street: { type: GraphQLString },\n * number: { type: GraphQLInt },\n * formatted: {\n * type: GraphQLString,\n * resolve(obj) {\n * return obj.number + ' ' + obj.street\n * }\n * }\n * }\n * });\n * ```\n *\n * When two types need to refer to each other, or a type needs to refer to\n * itself in a field, you can use a function expression (aka a closure or a\n * thunk) to supply the fields lazily.\n *\n * Example:\n *\n * ```ts\n * const PersonType = new GraphQLObjectType({\n * name: 'Person',\n * fields: () => ({\n * name: { type: GraphQLString },\n * bestFriend: { type: PersonType },\n * })\n * });\n * ```\n */\nexport class GraphQLObjectType {\n constructor(config) {\n var _config$extensionASTN2;\n\n this.name = assertName(config.name);\n this.description = config.description;\n this.isTypeOf = config.isTypeOf;\n this.extensions = toObjMap(config.extensions);\n this.astNode = config.astNode;\n this.extensionASTNodes =\n (_config$extensionASTN2 = config.extensionASTNodes) !== null &&\n _config$extensionASTN2 !== void 0\n ? _config$extensionASTN2\n : [];\n\n this._fields = () => defineFieldMap(config);\n\n this._interfaces = () => defineInterfaces(config);\n\n config.isTypeOf == null ||\n typeof config.isTypeOf === 'function' ||\n devAssert(\n false,\n `${this.name} must provide \"isTypeOf\" as a function, ` +\n `but got: ${inspect(config.isTypeOf)}.`,\n );\n }\n\n get [Symbol.toStringTag]() {\n return 'GraphQLObjectType';\n }\n\n getFields() {\n if (typeof this._fields === 'function') {\n this._fields = this._fields();\n }\n\n return this._fields;\n }\n\n getInterfaces() {\n if (typeof this._interfaces === 'function') {\n this._interfaces = this._interfaces();\n }\n\n return this._interfaces;\n }\n\n toConfig() {\n return {\n name: this.name,\n description: this.description,\n interfaces: this.getInterfaces(),\n fields: fieldsToFieldsConfig(this.getFields()),\n isTypeOf: this.isTypeOf,\n extensions: this.extensions,\n astNode: this.astNode,\n extensionASTNodes: this.extensionASTNodes,\n };\n }\n\n toString() {\n return this.name;\n }\n\n toJSON() {\n return this.toString();\n }\n}\n\nfunction defineInterfaces(config) {\n var _config$interfaces;\n\n const interfaces = resolveReadonlyArrayThunk(\n (_config$interfaces = config.interfaces) !== null &&\n _config$interfaces !== void 0\n ? _config$interfaces\n : [],\n );\n Array.isArray(interfaces) ||\n devAssert(\n false,\n `${config.name} interfaces must be an Array or a function which returns an Array.`,\n );\n return interfaces;\n}\n\nfunction defineFieldMap(config) {\n const fieldMap = resolveObjMapThunk(config.fields);\n isPlainObj(fieldMap) ||\n devAssert(\n false,\n `${config.name} fields must be an object with field names as keys or a function which returns such an object.`,\n );\n return mapValue(fieldMap, (fieldConfig, fieldName) => {\n var _fieldConfig$args;\n\n isPlainObj(fieldConfig) ||\n devAssert(\n false,\n `${config.name}.${fieldName} field config must be an object.`,\n );\n fieldConfig.resolve == null ||\n typeof fieldConfig.resolve === 'function' ||\n devAssert(\n false,\n `${config.name}.${fieldName} field resolver must be a function if ` +\n `provided, but got: ${inspect(fieldConfig.resolve)}.`,\n );\n const argsConfig =\n (_fieldConfig$args = fieldConfig.args) !== null &&\n _fieldConfig$args !== void 0\n ? _fieldConfig$args\n : {};\n isPlainObj(argsConfig) ||\n devAssert(\n false,\n `${config.name}.${fieldName} args must be an object with argument names as keys.`,\n );\n return {\n name: assertName(fieldName),\n description: fieldConfig.description,\n type: fieldConfig.type,\n args: defineArguments(argsConfig),\n resolve: fieldConfig.resolve,\n subscribe: fieldConfig.subscribe,\n deprecationReason: fieldConfig.deprecationReason,\n extensions: toObjMap(fieldConfig.extensions),\n astNode: fieldConfig.astNode,\n };\n });\n}\n\nexport function defineArguments(config) {\n return Object.entries(config).map(([argName, argConfig]) => ({\n name: assertName(argName),\n description: argConfig.description,\n type: argConfig.type,\n defaultValue: argConfig.defaultValue,\n deprecationReason: argConfig.deprecationReason,\n extensions: toObjMap(argConfig.extensions),\n astNode: argConfig.astNode,\n }));\n}\n\nfunction isPlainObj(obj) {\n return isObjectLike(obj) && !Array.isArray(obj);\n}\n\nfunction fieldsToFieldsConfig(fields) {\n return mapValue(fields, (field) => ({\n description: field.description,\n type: field.type,\n args: argsToArgsConfig(field.args),\n resolve: field.resolve,\n subscribe: field.subscribe,\n deprecationReason: field.deprecationReason,\n extensions: field.extensions,\n astNode: field.astNode,\n }));\n}\n/**\n * @internal\n */\n\nexport function argsToArgsConfig(args) {\n return keyValMap(\n args,\n (arg) => arg.name,\n (arg) => ({\n description: arg.description,\n type: arg.type,\n defaultValue: arg.defaultValue,\n deprecationReason: arg.deprecationReason,\n extensions: arg.extensions,\n astNode: arg.astNode,\n }),\n );\n}\nexport function isRequiredArgument(arg) {\n return isNonNullType(arg.type) && arg.defaultValue === undefined;\n}\n\n/**\n * Interface Type Definition\n *\n * When a field can return one of a heterogeneous set of types, a Interface type\n * is used to describe what types are possible, what fields are in common across\n * all types, as well as a function to determine which type is actually used\n * when the field is resolved.\n *\n * Example:\n *\n * ```ts\n * const EntityType = new GraphQLInterfaceType({\n * name: 'Entity',\n * fields: {\n * name: { type: GraphQLString }\n * }\n * });\n * ```\n */\nexport class GraphQLInterfaceType {\n constructor(config) {\n var _config$extensionASTN3;\n\n this.name = assertName(config.name);\n this.description = config.description;\n this.resolveType = config.resolveType;\n this.extensions = toObjMap(config.extensions);\n this.astNode = config.astNode;\n this.extensionASTNodes =\n (_config$extensionASTN3 = config.extensionASTNodes) !== null &&\n _config$extensionASTN3 !== void 0\n ? _config$extensionASTN3\n : [];\n this._fields = defineFieldMap.bind(undefined, config);\n this._interfaces = defineInterfaces.bind(undefined, config);\n config.resolveType == null ||\n typeof config.resolveType === 'function' ||\n devAssert(\n false,\n `${this.name} must provide \"resolveType\" as a function, ` +\n `but got: ${inspect(config.resolveType)}.`,\n );\n }\n\n get [Symbol.toStringTag]() {\n return 'GraphQLInterfaceType';\n }\n\n getFields() {\n if (typeof this._fields === 'function') {\n this._fields = this._fields();\n }\n\n return this._fields;\n }\n\n getInterfaces() {\n if (typeof this._interfaces === 'function') {\n this._interfaces = this._interfaces();\n }\n\n return this._interfaces;\n }\n\n toConfig() {\n return {\n name: this.name,\n description: this.description,\n interfaces: this.getInterfaces(),\n fields: fieldsToFieldsConfig(this.getFields()),\n resolveType: this.resolveType,\n extensions: this.extensions,\n astNode: this.astNode,\n extensionASTNodes: this.extensionASTNodes,\n };\n }\n\n toString() {\n return this.name;\n }\n\n toJSON() {\n return this.toString();\n }\n}\n\n/**\n * Union Type Definition\n *\n * When a field can return one of a heterogeneous set of types, a Union type\n * is used to describe what types are possible as well as providing a function\n * to determine which type is actually used when the field is resolved.\n *\n * Example:\n *\n * ```ts\n * const PetType = new GraphQLUnionType({\n * name: 'Pet',\n * types: [ DogType, CatType ],\n * resolveType(value) {\n * if (value instanceof Dog) {\n * return DogType;\n * }\n * if (value instanceof Cat) {\n * return CatType;\n * }\n * }\n * });\n * ```\n */\nexport class GraphQLUnionType {\n constructor(config) {\n var _config$extensionASTN4;\n\n this.name = assertName(config.name);\n this.description = config.description;\n this.resolveType = config.resolveType;\n this.extensions = toObjMap(config.extensions);\n this.astNode = config.astNode;\n this.extensionASTNodes =\n (_config$extensionASTN4 = config.extensionASTNodes) !== null &&\n _config$extensionASTN4 !== void 0\n ? _config$extensionASTN4\n : [];\n this._types = defineTypes.bind(undefined, config);\n config.resolveType == null ||\n typeof config.resolveType === 'function' ||\n devAssert(\n false,\n `${this.name} must provide \"resolveType\" as a function, ` +\n `but got: ${inspect(config.resolveType)}.`,\n );\n }\n\n get [Symbol.toStringTag]() {\n return 'GraphQLUnionType';\n }\n\n getTypes() {\n if (typeof this._types === 'function') {\n this._types = this._types();\n }\n\n return this._types;\n }\n\n toConfig() {\n return {\n name: this.name,\n description: this.description,\n types: this.getTypes(),\n resolveType: this.resolveType,\n extensions: this.extensions,\n astNode: this.astNode,\n extensionASTNodes: this.extensionASTNodes,\n };\n }\n\n toString() {\n return this.name;\n }\n\n toJSON() {\n return this.toString();\n }\n}\n\nfunction defineTypes(config) {\n const types = resolveReadonlyArrayThunk(config.types);\n Array.isArray(types) ||\n devAssert(\n false,\n `Must provide Array of types or a function which returns such an array for Union ${config.name}.`,\n );\n return types;\n}\n\n/**\n * Enum Type Definition\n *\n * Some leaf values of requests and input values are Enums. GraphQL serializes\n * Enum values as strings, however internally Enums can be represented by any\n * kind of type, often integers.\n *\n * Example:\n *\n * ```ts\n * const RGBType = new GraphQLEnumType({\n * name: 'RGB',\n * values: {\n * RED: { value: 0 },\n * GREEN: { value: 1 },\n * BLUE: { value: 2 }\n * }\n * });\n * ```\n *\n * Note: If a value is not provided in a definition, the name of the enum value\n * will be used as its internal value.\n */\nexport class GraphQLEnumType {\n /* */\n constructor(config) {\n var _config$extensionASTN5;\n\n this.name = assertName(config.name);\n this.description = config.description;\n this.extensions = toObjMap(config.extensions);\n this.astNode = config.astNode;\n this.extensionASTNodes =\n (_config$extensionASTN5 = config.extensionASTNodes) !== null &&\n _config$extensionASTN5 !== void 0\n ? _config$extensionASTN5\n : [];\n this._values =\n typeof config.values === 'function'\n ? config.values\n : defineEnumValues(this.name, config.values);\n this._valueLookup = null;\n this._nameLookup = null;\n }\n\n get [Symbol.toStringTag]() {\n return 'GraphQLEnumType';\n }\n\n getValues() {\n if (typeof this._values === 'function') {\n this._values = defineEnumValues(this.name, this._values());\n }\n\n return this._values;\n }\n\n getValue(name) {\n if (this._nameLookup === null) {\n this._nameLookup = keyMap(this.getValues(), (value) => value.name);\n }\n\n return this._nameLookup[name];\n }\n\n serialize(outputValue) {\n if (this._valueLookup === null) {\n this._valueLookup = new Map(\n this.getValues().map((enumValue) => [enumValue.value, enumValue]),\n );\n }\n\n const enumValue = this._valueLookup.get(outputValue);\n\n if (enumValue === undefined) {\n throw new GraphQLError(\n `Enum \"${this.name}\" cannot represent value: ${inspect(outputValue)}`,\n );\n }\n\n return enumValue.name;\n }\n\n parseValue(inputValue) /* T */\n {\n if (typeof inputValue !== 'string') {\n const valueStr = inspect(inputValue);\n throw new GraphQLError(\n `Enum \"${this.name}\" cannot represent non-string value: ${valueStr}.` +\n didYouMeanEnumValue(this, valueStr),\n );\n }\n\n const enumValue = this.getValue(inputValue);\n\n if (enumValue == null) {\n throw new GraphQLError(\n `Value \"${inputValue}\" does not exist in \"${this.name}\" enum.` +\n didYouMeanEnumValue(this, inputValue),\n );\n }\n\n return enumValue.value;\n }\n\n parseLiteral(valueNode, _variables) /* T */\n {\n // Note: variables will be resolved to a value before calling this function.\n if (valueNode.kind !== Kind.ENUM) {\n const valueStr = print(valueNode);\n throw new GraphQLError(\n `Enum \"${this.name}\" cannot represent non-enum value: ${valueStr}.` +\n didYouMeanEnumValue(this, valueStr),\n {\n nodes: valueNode,\n },\n );\n }\n\n const enumValue = this.getValue(valueNode.value);\n\n if (enumValue == null) {\n const valueStr = print(valueNode);\n throw new GraphQLError(\n `Value \"${valueStr}\" does not exist in \"${this.name}\" enum.` +\n didYouMeanEnumValue(this, valueStr),\n {\n nodes: valueNode,\n },\n );\n }\n\n return enumValue.value;\n }\n\n toConfig() {\n const values = keyValMap(\n this.getValues(),\n (value) => value.name,\n (value) => ({\n description: value.description,\n value: value.value,\n deprecationReason: value.deprecationReason,\n extensions: value.extensions,\n astNode: value.astNode,\n }),\n );\n return {\n name: this.name,\n description: this.description,\n values,\n extensions: this.extensions,\n astNode: this.astNode,\n extensionASTNodes: this.extensionASTNodes,\n };\n }\n\n toString() {\n return this.name;\n }\n\n toJSON() {\n return this.toString();\n }\n}\n\nfunction didYouMeanEnumValue(enumType, unknownValueStr) {\n const allNames = enumType.getValues().map((value) => value.name);\n const suggestedValues = suggestionList(unknownValueStr, allNames);\n return didYouMean('the enum value', suggestedValues);\n}\n\nfunction defineEnumValues(typeName, valueMap) {\n isPlainObj(valueMap) ||\n devAssert(\n false,\n `${typeName} values must be an object with value names as keys.`,\n );\n return Object.entries(valueMap).map(([valueName, valueConfig]) => {\n isPlainObj(valueConfig) ||\n devAssert(\n false,\n `${typeName}.${valueName} must refer to an object with a \"value\" key ` +\n `representing an internal value but got: ${inspect(valueConfig)}.`,\n );\n return {\n name: assertEnumValueName(valueName),\n description: valueConfig.description,\n value: valueConfig.value !== undefined ? valueConfig.value : valueName,\n deprecationReason: valueConfig.deprecationReason,\n extensions: toObjMap(valueConfig.extensions),\n astNode: valueConfig.astNode,\n };\n });\n}\n\n/**\n * Input Object Type Definition\n *\n * An input object defines a structured collection of fields which may be\n * supplied to a field argument.\n *\n * Using `NonNull` will ensure that a value must be provided by the query\n *\n * Example:\n *\n * ```ts\n * const GeoPoint = new GraphQLInputObjectType({\n * name: 'GeoPoint',\n * fields: {\n * lat: { type: new GraphQLNonNull(GraphQLFloat) },\n * lon: { type: new GraphQLNonNull(GraphQLFloat) },\n * alt: { type: GraphQLFloat, defaultValue: 0 },\n * }\n * });\n * ```\n */\nexport class GraphQLInputObjectType {\n constructor(config) {\n var _config$extensionASTN6, _config$isOneOf;\n\n this.name = assertName(config.name);\n this.description = config.description;\n this.extensions = toObjMap(config.extensions);\n this.astNode = config.astNode;\n this.extensionASTNodes =\n (_config$extensionASTN6 = config.extensionASTNodes) !== null &&\n _config$extensionASTN6 !== void 0\n ? _config$extensionASTN6\n : [];\n this.isOneOf =\n (_config$isOneOf = config.isOneOf) !== null && _config$isOneOf !== void 0\n ? _config$isOneOf\n : false;\n this._fields = defineInputFieldMap.bind(undefined, config);\n }\n\n get [Symbol.toStringTag]() {\n return 'GraphQLInputObjectType';\n }\n\n getFields() {\n if (typeof this._fields === 'function') {\n this._fields = this._fields();\n }\n\n return this._fields;\n }\n\n toConfig() {\n const fields = mapValue(this.getFields(), (field) => ({\n description: field.description,\n type: field.type,\n defaultValue: field.defaultValue,\n deprecationReason: field.deprecationReason,\n extensions: field.extensions,\n astNode: field.astNode,\n }));\n return {\n name: this.name,\n description: this.description,\n fields,\n extensions: this.extensions,\n astNode: this.astNode,\n extensionASTNodes: this.extensionASTNodes,\n isOneOf: this.isOneOf,\n };\n }\n\n toString() {\n return this.name;\n }\n\n toJSON() {\n return this.toString();\n }\n}\n\nfunction defineInputFieldMap(config) {\n const fieldMap = resolveObjMapThunk(config.fields);\n isPlainObj(fieldMap) ||\n devAssert(\n false,\n `${config.name} fields must be an object with field names as keys or a function which returns such an object.`,\n );\n return mapValue(fieldMap, (fieldConfig, fieldName) => {\n !('resolve' in fieldConfig) ||\n devAssert(\n false,\n `${config.name}.${fieldName} field has a resolve property, but Input Types cannot define resolvers.`,\n );\n return {\n name: assertName(fieldName),\n description: fieldConfig.description,\n type: fieldConfig.type,\n defaultValue: fieldConfig.defaultValue,\n deprecationReason: fieldConfig.deprecationReason,\n extensions: toObjMap(fieldConfig.extensions),\n astNode: fieldConfig.astNode,\n };\n });\n}\n\nexport function isRequiredInputField(field) {\n return isNonNullType(field.type) && field.defaultValue === undefined;\n}\n", "import {\n isAbstractType,\n isInterfaceType,\n isListType,\n isNonNullType,\n isObjectType,\n} from '../type/definition.mjs';\n\n/**\n * Provided two types, return true if the types are equal (invariant).\n */\nexport function isEqualType(typeA, typeB) {\n // Equivalent types are equal.\n if (typeA === typeB) {\n return true;\n } // If either type is non-null, the other must also be non-null.\n\n if (isNonNullType(typeA) && isNonNullType(typeB)) {\n return isEqualType(typeA.ofType, typeB.ofType);\n } // If either type is a list, the other must also be a list.\n\n if (isListType(typeA) && isListType(typeB)) {\n return isEqualType(typeA.ofType, typeB.ofType);\n } // Otherwise the types are not equal.\n\n return false;\n}\n/**\n * Provided a type and a super type, return true if the first type is either\n * equal or a subset of the second super type (covariant).\n */\n\nexport function isTypeSubTypeOf(schema, maybeSubType, superType) {\n // Equivalent type is a valid subtype\n if (maybeSubType === superType) {\n return true;\n } // If superType is non-null, maybeSubType must also be non-null.\n\n if (isNonNullType(superType)) {\n if (isNonNullType(maybeSubType)) {\n return isTypeSubTypeOf(schema, maybeSubType.ofType, superType.ofType);\n }\n\n return false;\n }\n\n if (isNonNullType(maybeSubType)) {\n // If superType is nullable, maybeSubType may be non-null or nullable.\n return isTypeSubTypeOf(schema, maybeSubType.ofType, superType);\n } // If superType type is a list, maybeSubType type must also be a list.\n\n if (isListType(superType)) {\n if (isListType(maybeSubType)) {\n return isTypeSubTypeOf(schema, maybeSubType.ofType, superType.ofType);\n }\n\n return false;\n }\n\n if (isListType(maybeSubType)) {\n // If superType is not a list, maybeSubType must also be not a list.\n return false;\n } // If superType type is an abstract type, check if it is super type of maybeSubType.\n // Otherwise, the child type is not a valid subtype of the parent type.\n\n return (\n isAbstractType(superType) &&\n (isInterfaceType(maybeSubType) || isObjectType(maybeSubType)) &&\n schema.isSubType(superType, maybeSubType)\n );\n}\n/**\n * Provided two composite types, determine if they \"overlap\". Two composite\n * types overlap when the Sets of possible concrete types for each intersect.\n *\n * This is often used to determine if a fragment of a given type could possibly\n * be visited in a context of another type.\n *\n * This function is commutative.\n */\n\nexport function doTypesOverlap(schema, typeA, typeB) {\n // Equivalent types overlap\n if (typeA === typeB) {\n return true;\n }\n\n if (isAbstractType(typeA)) {\n if (isAbstractType(typeB)) {\n // If both types are abstract, then determine if there is any intersection\n // between possible concrete types of each.\n return schema\n .getPossibleTypes(typeA)\n .some((type) => schema.isSubType(typeB, type));\n } // Determine if the latter type is a possible concrete type of the former.\n\n return schema.isSubType(typeA, typeB);\n }\n\n if (isAbstractType(typeB)) {\n // Determine if the former type is a possible concrete type of the latter.\n return schema.isSubType(typeB, typeA);\n } // Otherwise the types do not overlap.\n\n return false;\n}\n", "import { inspect } from '../jsutils/inspect.mjs';\nimport { isObjectLike } from '../jsutils/isObjectLike.mjs';\nimport { GraphQLError } from '../error/GraphQLError.mjs';\nimport { Kind } from '../language/kinds.mjs';\nimport { print } from '../language/printer.mjs';\nimport { GraphQLScalarType } from './definition.mjs';\n/**\n * Maximum possible Int value as per GraphQL Spec (32-bit signed integer).\n * n.b. This differs from JavaScript's numbers that are IEEE 754 doubles safe up-to 2^53 - 1\n * */\n\nexport const GRAPHQL_MAX_INT = 2147483647;\n/**\n * Minimum possible Int value as per GraphQL Spec (32-bit signed integer).\n * n.b. This differs from JavaScript's numbers that are IEEE 754 doubles safe starting at -(2^53 - 1)\n * */\n\nexport const GRAPHQL_MIN_INT = -2147483648;\nexport const GraphQLInt = new GraphQLScalarType({\n name: 'Int',\n description:\n 'The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.',\n\n serialize(outputValue) {\n const coercedValue = serializeObject(outputValue);\n\n if (typeof coercedValue === 'boolean') {\n return coercedValue ? 1 : 0;\n }\n\n let num = coercedValue;\n\n if (typeof coercedValue === 'string' && coercedValue !== '') {\n num = Number(coercedValue);\n }\n\n if (typeof num !== 'number' || !Number.isInteger(num)) {\n throw new GraphQLError(\n `Int cannot represent non-integer value: ${inspect(coercedValue)}`,\n );\n }\n\n if (num > GRAPHQL_MAX_INT || num < GRAPHQL_MIN_INT) {\n throw new GraphQLError(\n 'Int cannot represent non 32-bit signed integer value: ' +\n inspect(coercedValue),\n );\n }\n\n return num;\n },\n\n parseValue(inputValue) {\n if (typeof inputValue !== 'number' || !Number.isInteger(inputValue)) {\n throw new GraphQLError(\n `Int cannot represent non-integer value: ${inspect(inputValue)}`,\n );\n }\n\n if (inputValue > GRAPHQL_MAX_INT || inputValue < GRAPHQL_MIN_INT) {\n throw new GraphQLError(\n `Int cannot represent non 32-bit signed integer value: ${inputValue}`,\n );\n }\n\n return inputValue;\n },\n\n parseLiteral(valueNode) {\n if (valueNode.kind !== Kind.INT) {\n throw new GraphQLError(\n `Int cannot represent non-integer value: ${print(valueNode)}`,\n {\n nodes: valueNode,\n },\n );\n }\n\n const num = parseInt(valueNode.value, 10);\n\n if (num > GRAPHQL_MAX_INT || num < GRAPHQL_MIN_INT) {\n throw new GraphQLError(\n `Int cannot represent non 32-bit signed integer value: ${valueNode.value}`,\n {\n nodes: valueNode,\n },\n );\n }\n\n return num;\n },\n});\nexport const GraphQLFloat = new GraphQLScalarType({\n name: 'Float',\n description:\n 'The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point).',\n\n serialize(outputValue) {\n const coercedValue = serializeObject(outputValue);\n\n if (typeof coercedValue === 'boolean') {\n return coercedValue ? 1 : 0;\n }\n\n let num = coercedValue;\n\n if (typeof coercedValue === 'string' && coercedValue !== '') {\n num = Number(coercedValue);\n }\n\n if (typeof num !== 'number' || !Number.isFinite(num)) {\n throw new GraphQLError(\n `Float cannot represent non numeric value: ${inspect(coercedValue)}`,\n );\n }\n\n return num;\n },\n\n parseValue(inputValue) {\n if (typeof inputValue !== 'number' || !Number.isFinite(inputValue)) {\n throw new GraphQLError(\n `Float cannot represent non numeric value: ${inspect(inputValue)}`,\n );\n }\n\n return inputValue;\n },\n\n parseLiteral(valueNode) {\n if (valueNode.kind !== Kind.FLOAT && valueNode.kind !== Kind.INT) {\n throw new GraphQLError(\n `Float cannot represent non numeric value: ${print(valueNode)}`,\n valueNode,\n );\n }\n\n return parseFloat(valueNode.value);\n },\n});\nexport const GraphQLString = new GraphQLScalarType({\n name: 'String',\n description:\n '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.',\n\n serialize(outputValue) {\n const coercedValue = serializeObject(outputValue); // Serialize string, boolean and number values to a string, but do not\n // attempt to coerce object, function, symbol, or other types as strings.\n\n if (typeof coercedValue === 'string') {\n return coercedValue;\n }\n\n if (typeof coercedValue === 'boolean') {\n return coercedValue ? 'true' : 'false';\n }\n\n if (typeof coercedValue === 'number' && Number.isFinite(coercedValue)) {\n return coercedValue.toString();\n }\n\n throw new GraphQLError(\n `String cannot represent value: ${inspect(outputValue)}`,\n );\n },\n\n parseValue(inputValue) {\n if (typeof inputValue !== 'string') {\n throw new GraphQLError(\n `String cannot represent a non string value: ${inspect(inputValue)}`,\n );\n }\n\n return inputValue;\n },\n\n parseLiteral(valueNode) {\n if (valueNode.kind !== Kind.STRING) {\n throw new GraphQLError(\n `String cannot represent a non string value: ${print(valueNode)}`,\n {\n nodes: valueNode,\n },\n );\n }\n\n return valueNode.value;\n },\n});\nexport const GraphQLBoolean = new GraphQLScalarType({\n name: 'Boolean',\n description: 'The `Boolean` scalar type represents `true` or `false`.',\n\n serialize(outputValue) {\n const coercedValue = serializeObject(outputValue);\n\n if (typeof coercedValue === 'boolean') {\n return coercedValue;\n }\n\n if (Number.isFinite(coercedValue)) {\n return coercedValue !== 0;\n }\n\n throw new GraphQLError(\n `Boolean cannot represent a non boolean value: ${inspect(coercedValue)}`,\n );\n },\n\n parseValue(inputValue) {\n if (typeof inputValue !== 'boolean') {\n throw new GraphQLError(\n `Boolean cannot represent a non boolean value: ${inspect(inputValue)}`,\n );\n }\n\n return inputValue;\n },\n\n parseLiteral(valueNode) {\n if (valueNode.kind !== Kind.BOOLEAN) {\n throw new GraphQLError(\n `Boolean cannot represent a non boolean value: ${print(valueNode)}`,\n {\n nodes: valueNode,\n },\n );\n }\n\n return valueNode.value;\n },\n});\nexport const GraphQLID = new GraphQLScalarType({\n name: 'ID',\n description:\n '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.',\n\n serialize(outputValue) {\n const coercedValue = serializeObject(outputValue);\n\n if (typeof coercedValue === 'string') {\n return coercedValue;\n }\n\n if (Number.isInteger(coercedValue)) {\n return String(coercedValue);\n }\n\n throw new GraphQLError(\n `ID cannot represent value: ${inspect(outputValue)}`,\n );\n },\n\n parseValue(inputValue) {\n if (typeof inputValue === 'string') {\n return inputValue;\n }\n\n if (typeof inputValue === 'number' && Number.isInteger(inputValue)) {\n return inputValue.toString();\n }\n\n throw new GraphQLError(`ID cannot represent value: ${inspect(inputValue)}`);\n },\n\n parseLiteral(valueNode) {\n if (valueNode.kind !== Kind.STRING && valueNode.kind !== Kind.INT) {\n throw new GraphQLError(\n 'ID cannot represent a non-string and non-integer value: ' +\n print(valueNode),\n {\n nodes: valueNode,\n },\n );\n }\n\n return valueNode.value;\n },\n});\nexport const specifiedScalarTypes = Object.freeze([\n GraphQLString,\n GraphQLInt,\n GraphQLFloat,\n GraphQLBoolean,\n GraphQLID,\n]);\nexport function isSpecifiedScalarType(type) {\n return specifiedScalarTypes.some(({ name }) => type.name === name);\n} // Support serializing objects with custom valueOf() or toJSON() functions -\n// a common way to represent a complex value which can be represented as\n// a string (ex: MongoDB id objects).\n\nfunction serializeObject(outputValue) {\n if (isObjectLike(outputValue)) {\n if (typeof outputValue.valueOf === 'function') {\n const valueOfResult = outputValue.valueOf();\n\n if (!isObjectLike(valueOfResult)) {\n return valueOfResult;\n }\n }\n\n if (typeof outputValue.toJSON === 'function') {\n return outputValue.toJSON();\n }\n }\n\n return outputValue;\n}\n", "import { devAssert } from '../jsutils/devAssert.mjs';\nimport { inspect } from '../jsutils/inspect.mjs';\nimport { instanceOf } from '../jsutils/instanceOf.mjs';\nimport { isObjectLike } from '../jsutils/isObjectLike.mjs';\nimport { toObjMap } from '../jsutils/toObjMap.mjs';\nimport { DirectiveLocation } from '../language/directiveLocation.mjs';\nimport { assertName } from './assertName.mjs';\nimport {\n argsToArgsConfig,\n defineArguments,\n GraphQLNonNull,\n} from './definition.mjs';\nimport { GraphQLBoolean, GraphQLString } from './scalars.mjs';\n/**\n * Test if the given value is a GraphQL directive.\n */\n\nexport function isDirective(directive) {\n return instanceOf(directive, GraphQLDirective);\n}\nexport function assertDirective(directive) {\n if (!isDirective(directive)) {\n throw new Error(\n `Expected ${inspect(directive)} to be a GraphQL directive.`,\n );\n }\n\n return directive;\n}\n/**\n * Custom extensions\n *\n * @remarks\n * Use a unique identifier name for your extension, for example the name of\n * your library or project. Do not use a shortened identifier as this increases\n * the risk of conflicts. We recommend you add at most one extension field,\n * an object which can contain all the values you need.\n */\n\n/**\n * Directives are used by the GraphQL runtime as a way of modifying execution\n * behavior. Type system creators will usually not create these directly.\n */\nexport class GraphQLDirective {\n constructor(config) {\n var _config$isRepeatable, _config$args;\n\n this.name = assertName(config.name);\n this.description = config.description;\n this.locations = config.locations;\n this.isRepeatable =\n (_config$isRepeatable = config.isRepeatable) !== null &&\n _config$isRepeatable !== void 0\n ? _config$isRepeatable\n : false;\n this.extensions = toObjMap(config.extensions);\n this.astNode = config.astNode;\n Array.isArray(config.locations) ||\n devAssert(false, `@${config.name} locations must be an Array.`);\n const args =\n (_config$args = config.args) !== null && _config$args !== void 0\n ? _config$args\n : {};\n (isObjectLike(args) && !Array.isArray(args)) ||\n devAssert(\n false,\n `@${config.name} args must be an object with argument names as keys.`,\n );\n this.args = defineArguments(args);\n }\n\n get [Symbol.toStringTag]() {\n return 'GraphQLDirective';\n }\n\n toConfig() {\n return {\n name: this.name,\n description: this.description,\n locations: this.locations,\n args: argsToArgsConfig(this.args),\n isRepeatable: this.isRepeatable,\n extensions: this.extensions,\n astNode: this.astNode,\n };\n }\n\n toString() {\n return '@' + this.name;\n }\n\n toJSON() {\n return this.toString();\n }\n}\n\n/**\n * Used to conditionally include fields or fragments.\n */\nexport const GraphQLIncludeDirective = new GraphQLDirective({\n name: 'include',\n description:\n 'Directs the executor to include this field or fragment only when the `if` argument is true.',\n locations: [\n DirectiveLocation.FIELD,\n DirectiveLocation.FRAGMENT_SPREAD,\n DirectiveLocation.INLINE_FRAGMENT,\n ],\n args: {\n if: {\n type: new GraphQLNonNull(GraphQLBoolean),\n description: 'Included when true.',\n },\n },\n});\n/**\n * Used to conditionally skip (exclude) fields or fragments.\n */\n\nexport const GraphQLSkipDirective = new GraphQLDirective({\n name: 'skip',\n description:\n 'Directs the executor to skip this field or fragment when the `if` argument is true.',\n locations: [\n DirectiveLocation.FIELD,\n DirectiveLocation.FRAGMENT_SPREAD,\n DirectiveLocation.INLINE_FRAGMENT,\n ],\n args: {\n if: {\n type: new GraphQLNonNull(GraphQLBoolean),\n description: 'Skipped when true.',\n },\n },\n});\n/**\n * Constant string used for default reason for a deprecation.\n */\n\nexport const DEFAULT_DEPRECATION_REASON = 'No longer supported';\n/**\n * Used to declare element of a GraphQL schema as deprecated.\n */\n\nexport const GraphQLDeprecatedDirective = new GraphQLDirective({\n name: 'deprecated',\n description: 'Marks an element of a GraphQL schema as no longer supported.',\n locations: [\n DirectiveLocation.FIELD_DEFINITION,\n DirectiveLocation.ARGUMENT_DEFINITION,\n DirectiveLocation.INPUT_FIELD_DEFINITION,\n DirectiveLocation.ENUM_VALUE,\n ],\n args: {\n reason: {\n type: GraphQLString,\n description:\n '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/).',\n defaultValue: DEFAULT_DEPRECATION_REASON,\n },\n },\n});\n/**\n * Used to provide a URL for specifying the behavior of custom scalar definitions.\n */\n\nexport const GraphQLSpecifiedByDirective = new GraphQLDirective({\n name: 'specifiedBy',\n description: 'Exposes a URL that specifies the behavior of this scalar.',\n locations: [DirectiveLocation.SCALAR],\n args: {\n url: {\n type: new GraphQLNonNull(GraphQLString),\n description: 'The URL that specifies the behavior of this scalar.',\n },\n },\n});\n/**\n * Used to indicate an Input Object is a OneOf Input Object.\n */\n\nexport const GraphQLOneOfDirective = new GraphQLDirective({\n name: 'oneOf',\n description:\n 'Indicates exactly one field must be supplied and this field must not be `null`.',\n locations: [DirectiveLocation.INPUT_OBJECT],\n args: {},\n});\n/**\n * The full list of specified directives.\n */\n\nexport const specifiedDirectives = Object.freeze([\n GraphQLIncludeDirective,\n GraphQLSkipDirective,\n GraphQLDeprecatedDirective,\n GraphQLSpecifiedByDirective,\n GraphQLOneOfDirective,\n]);\nexport function isSpecifiedDirective(directive) {\n return specifiedDirectives.some(({ name }) => name === directive.name);\n}\n", "/**\n * Returns true if the provided object is an Object (i.e. not a string literal)\n * and implements the Iterator protocol.\n *\n * This may be used in place of [Array.isArray()][isArray] to determine if\n * an object should be iterated-over e.g. Array, Map, Set, Int8Array,\n * TypedArray, etc. but excludes string literals.\n *\n * @example\n * ```ts\n * isIterableObject([ 1, 2, 3 ]) // true\n * isIterableObject(new Map()) // true\n * isIterableObject('ABC') // false\n * isIterableObject({ key: 'value' }) // false\n * isIterableObject({ length: 1, 0: 'Alpha' }) // false\n * ```\n */\nexport function isIterableObject(maybeIterable) {\n return (\n typeof maybeIterable === 'object' &&\n typeof (maybeIterable === null || maybeIterable === void 0\n ? void 0\n : maybeIterable[Symbol.iterator]) === 'function'\n );\n}\n", "import { inspect } from '../jsutils/inspect.mjs';\nimport { invariant } from '../jsutils/invariant.mjs';\nimport { isIterableObject } from '../jsutils/isIterableObject.mjs';\nimport { isObjectLike } from '../jsutils/isObjectLike.mjs';\nimport { Kind } from '../language/kinds.mjs';\nimport {\n isEnumType,\n isInputObjectType,\n isLeafType,\n isListType,\n isNonNullType,\n} from '../type/definition.mjs';\nimport { GraphQLID } from '../type/scalars.mjs';\n/**\n * Produces a GraphQL Value AST given a JavaScript object.\n * Function will match JavaScript/JSON values to GraphQL AST schema format\n * by using suggested GraphQLInputType. For example:\n *\n * astFromValue(\"value\", GraphQLString)\n *\n * A GraphQL type must be provided, which will be used to interpret different\n * JavaScript values.\n *\n * | JSON Value | GraphQL Value |\n * | ------------- | -------------------- |\n * | Object | Input Object |\n * | Array | List |\n * | Boolean | Boolean |\n * | String | String / Enum Value |\n * | Number | Int / Float |\n * | Unknown | Enum Value |\n * | null | NullValue |\n *\n */\n\nexport function astFromValue(value, type) {\n if (isNonNullType(type)) {\n const astValue = astFromValue(value, type.ofType);\n\n if (\n (astValue === null || astValue === void 0 ? void 0 : astValue.kind) ===\n Kind.NULL\n ) {\n return null;\n }\n\n return astValue;\n } // only explicit null, not undefined, NaN\n\n if (value === null) {\n return {\n kind: Kind.NULL,\n };\n } // undefined\n\n if (value === undefined) {\n return null;\n } // Convert JavaScript array to GraphQL list. If the GraphQLType is a list, but\n // the value is not an array, convert the value using the list's item type.\n\n if (isListType(type)) {\n const itemType = type.ofType;\n\n if (isIterableObject(value)) {\n const valuesNodes = [];\n\n for (const item of value) {\n const itemNode = astFromValue(item, itemType);\n\n if (itemNode != null) {\n valuesNodes.push(itemNode);\n }\n }\n\n return {\n kind: Kind.LIST,\n values: valuesNodes,\n };\n }\n\n return astFromValue(value, itemType);\n } // Populate the fields of the input object by creating ASTs from each value\n // in the JavaScript object according to the fields in the input type.\n\n if (isInputObjectType(type)) {\n if (!isObjectLike(value)) {\n return null;\n }\n\n const fieldNodes = [];\n\n for (const field of Object.values(type.getFields())) {\n const fieldValue = astFromValue(value[field.name], field.type);\n\n if (fieldValue) {\n fieldNodes.push({\n kind: Kind.OBJECT_FIELD,\n name: {\n kind: Kind.NAME,\n value: field.name,\n },\n value: fieldValue,\n });\n }\n }\n\n return {\n kind: Kind.OBJECT,\n fields: fieldNodes,\n };\n }\n\n if (isLeafType(type)) {\n // Since value is an internally represented value, it must be serialized\n // to an externally represented value before converting into an AST.\n const serialized = type.serialize(value);\n\n if (serialized == null) {\n return null;\n } // Others serialize based on their corresponding JavaScript scalar types.\n\n if (typeof serialized === 'boolean') {\n return {\n kind: Kind.BOOLEAN,\n value: serialized,\n };\n } // JavaScript numbers can be Int or Float values.\n\n if (typeof serialized === 'number' && Number.isFinite(serialized)) {\n const stringNum = String(serialized);\n return integerStringRegExp.test(stringNum)\n ? {\n kind: Kind.INT,\n value: stringNum,\n }\n : {\n kind: Kind.FLOAT,\n value: stringNum,\n };\n }\n\n if (typeof serialized === 'string') {\n // Enum types use Enum literals.\n if (isEnumType(type)) {\n return {\n kind: Kind.ENUM,\n value: serialized,\n };\n } // ID types can use Int literals.\n\n if (type === GraphQLID && integerStringRegExp.test(serialized)) {\n return {\n kind: Kind.INT,\n value: serialized,\n };\n }\n\n return {\n kind: Kind.STRING,\n value: serialized,\n };\n }\n\n throw new TypeError(`Cannot convert value to AST: ${inspect(serialized)}.`);\n }\n /* c8 ignore next 3 */\n // Not reachable, all possible types have been considered.\n\n false || invariant(false, 'Unexpected input type: ' + inspect(type));\n}\n/**\n * IntValue:\n * - NegativeSign? 0\n * - NegativeSign? NonZeroDigit ( Digit+ )?\n */\n\nconst integerStringRegExp = /^-?(?:0|[1-9][0-9]*)$/;\n", "import { inspect } from '../jsutils/inspect.mjs';\nimport { invariant } from '../jsutils/invariant.mjs';\nimport { DirectiveLocation } from '../language/directiveLocation.mjs';\nimport { print } from '../language/printer.mjs';\nimport { astFromValue } from '../utilities/astFromValue.mjs';\nimport {\n GraphQLEnumType,\n GraphQLList,\n GraphQLNonNull,\n GraphQLObjectType,\n isAbstractType,\n isEnumType,\n isInputObjectType,\n isInterfaceType,\n isListType,\n isNonNullType,\n isObjectType,\n isScalarType,\n isUnionType,\n} from './definition.mjs';\nimport { GraphQLBoolean, GraphQLString } from './scalars.mjs';\nexport const __Schema = new GraphQLObjectType({\n name: '__Schema',\n description:\n '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.',\n fields: () => ({\n description: {\n type: GraphQLString,\n resolve: (schema) => schema.description,\n },\n types: {\n description: 'A list of all types supported by this server.',\n type: new GraphQLNonNull(new GraphQLList(new GraphQLNonNull(__Type))),\n\n resolve(schema) {\n return Object.values(schema.getTypeMap());\n },\n },\n queryType: {\n description: 'The type that query operations will be rooted at.',\n type: new GraphQLNonNull(__Type),\n resolve: (schema) => schema.getQueryType(),\n },\n mutationType: {\n description:\n 'If this server supports mutation, the type that mutation operations will be rooted at.',\n type: __Type,\n resolve: (schema) => schema.getMutationType(),\n },\n subscriptionType: {\n description:\n 'If this server support subscription, the type that subscription operations will be rooted at.',\n type: __Type,\n resolve: (schema) => schema.getSubscriptionType(),\n },\n directives: {\n description: 'A list of all directives supported by this server.',\n type: new GraphQLNonNull(\n new GraphQLList(new GraphQLNonNull(__Directive)),\n ),\n resolve: (schema) => schema.getDirectives(),\n },\n }),\n});\nexport const __Directive = new GraphQLObjectType({\n name: '__Directive',\n description:\n \"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.\",\n fields: () => ({\n name: {\n type: new GraphQLNonNull(GraphQLString),\n resolve: (directive) => directive.name,\n },\n description: {\n type: GraphQLString,\n resolve: (directive) => directive.description,\n },\n isRepeatable: {\n type: new GraphQLNonNull(GraphQLBoolean),\n resolve: (directive) => directive.isRepeatable,\n },\n locations: {\n type: new GraphQLNonNull(\n new GraphQLList(new GraphQLNonNull(__DirectiveLocation)),\n ),\n resolve: (directive) => directive.locations,\n },\n args: {\n type: new GraphQLNonNull(\n new GraphQLList(new GraphQLNonNull(__InputValue)),\n ),\n args: {\n includeDeprecated: {\n type: GraphQLBoolean,\n defaultValue: false,\n },\n },\n\n resolve(field, { includeDeprecated }) {\n return includeDeprecated\n ? field.args\n : field.args.filter((arg) => arg.deprecationReason == null);\n },\n },\n }),\n});\nexport const __DirectiveLocation = new GraphQLEnumType({\n name: '__DirectiveLocation',\n description:\n 'A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.',\n values: {\n QUERY: {\n value: DirectiveLocation.QUERY,\n description: 'Location adjacent to a query operation.',\n },\n MUTATION: {\n value: DirectiveLocation.MUTATION,\n description: 'Location adjacent to a mutation operation.',\n },\n SUBSCRIPTION: {\n value: DirectiveLocation.SUBSCRIPTION,\n description: 'Location adjacent to a subscription operation.',\n },\n FIELD: {\n value: DirectiveLocation.FIELD,\n description: 'Location adjacent to a field.',\n },\n FRAGMENT_DEFINITION: {\n value: DirectiveLocation.FRAGMENT_DEFINITION,\n description: 'Location adjacent to a fragment definition.',\n },\n FRAGMENT_SPREAD: {\n value: DirectiveLocation.FRAGMENT_SPREAD,\n description: 'Location adjacent to a fragment spread.',\n },\n INLINE_FRAGMENT: {\n value: DirectiveLocation.INLINE_FRAGMENT,\n description: 'Location adjacent to an inline fragment.',\n },\n VARIABLE_DEFINITION: {\n value: DirectiveLocation.VARIABLE_DEFINITION,\n description: 'Location adjacent to a variable definition.',\n },\n SCHEMA: {\n value: DirectiveLocation.SCHEMA,\n description: 'Location adjacent to a schema definition.',\n },\n SCALAR: {\n value: DirectiveLocation.SCALAR,\n description: 'Location adjacent to a scalar definition.',\n },\n OBJECT: {\n value: DirectiveLocation.OBJECT,\n description: 'Location adjacent to an object type definition.',\n },\n FIELD_DEFINITION: {\n value: DirectiveLocation.FIELD_DEFINITION,\n description: 'Location adjacent to a field definition.',\n },\n ARGUMENT_DEFINITION: {\n value: DirectiveLocation.ARGUMENT_DEFINITION,\n description: 'Location adjacent to an argument definition.',\n },\n INTERFACE: {\n value: DirectiveLocation.INTERFACE,\n description: 'Location adjacent to an interface definition.',\n },\n UNION: {\n value: DirectiveLocation.UNION,\n description: 'Location adjacent to a union definition.',\n },\n ENUM: {\n value: DirectiveLocation.ENUM,\n description: 'Location adjacent to an enum definition.',\n },\n ENUM_VALUE: {\n value: DirectiveLocation.ENUM_VALUE,\n description: 'Location adjacent to an enum value definition.',\n },\n INPUT_OBJECT: {\n value: DirectiveLocation.INPUT_OBJECT,\n description: 'Location adjacent to an input object type definition.',\n },\n INPUT_FIELD_DEFINITION: {\n value: DirectiveLocation.INPUT_FIELD_DEFINITION,\n description: 'Location adjacent to an input object field definition.',\n },\n },\n});\nexport const __Type = new GraphQLObjectType({\n name: '__Type',\n description:\n '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.',\n fields: () => ({\n kind: {\n type: new GraphQLNonNull(__TypeKind),\n\n resolve(type) {\n if (isScalarType(type)) {\n return TypeKind.SCALAR;\n }\n\n if (isObjectType(type)) {\n return TypeKind.OBJECT;\n }\n\n if (isInterfaceType(type)) {\n return TypeKind.INTERFACE;\n }\n\n if (isUnionType(type)) {\n return TypeKind.UNION;\n }\n\n if (isEnumType(type)) {\n return TypeKind.ENUM;\n }\n\n if (isInputObjectType(type)) {\n return TypeKind.INPUT_OBJECT;\n }\n\n if (isListType(type)) {\n return TypeKind.LIST;\n }\n\n if (isNonNullType(type)) {\n return TypeKind.NON_NULL;\n }\n /* c8 ignore next 3 */\n // Not reachable, all possible types have been considered)\n\n false || invariant(false, `Unexpected type: \"${inspect(type)}\".`);\n },\n },\n name: {\n type: GraphQLString,\n resolve: (type) => ('name' in type ? type.name : undefined),\n },\n description: {\n type: GraphQLString,\n resolve: (\n type, // FIXME: add test case\n ) =>\n /* c8 ignore next */\n 'description' in type ? type.description : undefined,\n },\n specifiedByURL: {\n type: GraphQLString,\n resolve: (obj) =>\n 'specifiedByURL' in obj ? obj.specifiedByURL : undefined,\n },\n fields: {\n type: new GraphQLList(new GraphQLNonNull(__Field)),\n args: {\n includeDeprecated: {\n type: GraphQLBoolean,\n defaultValue: false,\n },\n },\n\n resolve(type, { includeDeprecated }) {\n if (isObjectType(type) || isInterfaceType(type)) {\n const fields = Object.values(type.getFields());\n return includeDeprecated\n ? fields\n : fields.filter((field) => field.deprecationReason == null);\n }\n },\n },\n interfaces: {\n type: new GraphQLList(new GraphQLNonNull(__Type)),\n\n resolve(type) {\n if (isObjectType(type) || isInterfaceType(type)) {\n return type.getInterfaces();\n }\n },\n },\n possibleTypes: {\n type: new GraphQLList(new GraphQLNonNull(__Type)),\n\n resolve(type, _args, _context, { schema }) {\n if (isAbstractType(type)) {\n return schema.getPossibleTypes(type);\n }\n },\n },\n enumValues: {\n type: new GraphQLList(new GraphQLNonNull(__EnumValue)),\n args: {\n includeDeprecated: {\n type: GraphQLBoolean,\n defaultValue: false,\n },\n },\n\n resolve(type, { includeDeprecated }) {\n if (isEnumType(type)) {\n const values = type.getValues();\n return includeDeprecated\n ? values\n : values.filter((field) => field.deprecationReason == null);\n }\n },\n },\n inputFields: {\n type: new GraphQLList(new GraphQLNonNull(__InputValue)),\n args: {\n includeDeprecated: {\n type: GraphQLBoolean,\n defaultValue: false,\n },\n },\n\n resolve(type, { includeDeprecated }) {\n if (isInputObjectType(type)) {\n const values = Object.values(type.getFields());\n return includeDeprecated\n ? values\n : values.filter((field) => field.deprecationReason == null);\n }\n },\n },\n ofType: {\n type: __Type,\n resolve: (type) => ('ofType' in type ? type.ofType : undefined),\n },\n isOneOf: {\n type: GraphQLBoolean,\n resolve: (type) => {\n if (isInputObjectType(type)) {\n return type.isOneOf;\n }\n },\n },\n }),\n});\nexport const __Field = new GraphQLObjectType({\n name: '__Field',\n description:\n '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.',\n fields: () => ({\n name: {\n type: new GraphQLNonNull(GraphQLString),\n resolve: (field) => field.name,\n },\n description: {\n type: GraphQLString,\n resolve: (field) => field.description,\n },\n args: {\n type: new GraphQLNonNull(\n new GraphQLList(new GraphQLNonNull(__InputValue)),\n ),\n args: {\n includeDeprecated: {\n type: GraphQLBoolean,\n defaultValue: false,\n },\n },\n\n resolve(field, { includeDeprecated }) {\n return includeDeprecated\n ? field.args\n : field.args.filter((arg) => arg.deprecationReason == null);\n },\n },\n type: {\n type: new GraphQLNonNull(__Type),\n resolve: (field) => field.type,\n },\n isDeprecated: {\n type: new GraphQLNonNull(GraphQLBoolean),\n resolve: (field) => field.deprecationReason != null,\n },\n deprecationReason: {\n type: GraphQLString,\n resolve: (field) => field.deprecationReason,\n },\n }),\n});\nexport const __InputValue = new GraphQLObjectType({\n name: '__InputValue',\n description:\n '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.',\n fields: () => ({\n name: {\n type: new GraphQLNonNull(GraphQLString),\n resolve: (inputValue) => inputValue.name,\n },\n description: {\n type: GraphQLString,\n resolve: (inputValue) => inputValue.description,\n },\n type: {\n type: new GraphQLNonNull(__Type),\n resolve: (inputValue) => inputValue.type,\n },\n defaultValue: {\n type: GraphQLString,\n description:\n 'A GraphQL-formatted string representing the default value for this input value.',\n\n resolve(inputValue) {\n const { type, defaultValue } = inputValue;\n const valueAST = astFromValue(defaultValue, type);\n return valueAST ? print(valueAST) : null;\n },\n },\n isDeprecated: {\n type: new GraphQLNonNull(GraphQLBoolean),\n resolve: (field) => field.deprecationReason != null,\n },\n deprecationReason: {\n type: GraphQLString,\n resolve: (obj) => obj.deprecationReason,\n },\n }),\n});\nexport const __EnumValue = new GraphQLObjectType({\n name: '__EnumValue',\n description:\n '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.',\n fields: () => ({\n name: {\n type: new GraphQLNonNull(GraphQLString),\n resolve: (enumValue) => enumValue.name,\n },\n description: {\n type: GraphQLString,\n resolve: (enumValue) => enumValue.description,\n },\n isDeprecated: {\n type: new GraphQLNonNull(GraphQLBoolean),\n resolve: (enumValue) => enumValue.deprecationReason != null,\n },\n deprecationReason: {\n type: GraphQLString,\n resolve: (enumValue) => enumValue.deprecationReason,\n },\n }),\n});\nvar TypeKind;\n\n(function (TypeKind) {\n TypeKind['SCALAR'] = 'SCALAR';\n TypeKind['OBJECT'] = 'OBJECT';\n TypeKind['INTERFACE'] = 'INTERFACE';\n TypeKind['UNION'] = 'UNION';\n TypeKind['ENUM'] = 'ENUM';\n TypeKind['INPUT_OBJECT'] = 'INPUT_OBJECT';\n TypeKind['LIST'] = 'LIST';\n TypeKind['NON_NULL'] = 'NON_NULL';\n})(TypeKind || (TypeKind = {}));\n\nexport { TypeKind };\nexport const __TypeKind = new GraphQLEnumType({\n name: '__TypeKind',\n description: 'An enum describing what kind of type a given `__Type` is.',\n values: {\n SCALAR: {\n value: TypeKind.SCALAR,\n description: 'Indicates this type is a scalar.',\n },\n OBJECT: {\n value: TypeKind.OBJECT,\n description:\n 'Indicates this type is an object. `fields` and `interfaces` are valid fields.',\n },\n INTERFACE: {\n value: TypeKind.INTERFACE,\n description:\n 'Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields.',\n },\n UNION: {\n value: TypeKind.UNION,\n description:\n 'Indicates this type is a union. `possibleTypes` is a valid field.',\n },\n ENUM: {\n value: TypeKind.ENUM,\n description:\n 'Indicates this type is an enum. `enumValues` is a valid field.',\n },\n INPUT_OBJECT: {\n value: TypeKind.INPUT_OBJECT,\n description:\n 'Indicates this type is an input object. `inputFields` is a valid field.',\n },\n LIST: {\n value: TypeKind.LIST,\n description: 'Indicates this type is a list. `ofType` is a valid field.',\n },\n NON_NULL: {\n value: TypeKind.NON_NULL,\n description:\n 'Indicates this type is a non-null. `ofType` is a valid field.',\n },\n },\n});\n/**\n * Note that these are GraphQLField and not GraphQLFieldConfig,\n * so the format for args is different.\n */\n\nexport const SchemaMetaFieldDef = {\n name: '__schema',\n type: new GraphQLNonNull(__Schema),\n description: 'Access the current type schema of this server.',\n args: [],\n resolve: (_source, _args, _context, { schema }) => schema,\n deprecationReason: undefined,\n extensions: Object.create(null),\n astNode: undefined,\n};\nexport const TypeMetaFieldDef = {\n name: '__type',\n type: __Type,\n description: 'Request the type information of a single type.',\n args: [\n {\n name: 'name',\n description: undefined,\n type: new GraphQLNonNull(GraphQLString),\n defaultValue: undefined,\n deprecationReason: undefined,\n extensions: Object.create(null),\n astNode: undefined,\n },\n ],\n resolve: (_source, { name }, _context, { schema }) => schema.getType(name),\n deprecationReason: undefined,\n extensions: Object.create(null),\n astNode: undefined,\n};\nexport const TypeNameMetaFieldDef = {\n name: '__typename',\n type: new GraphQLNonNull(GraphQLString),\n description: 'The name of the current Object type at runtime.',\n args: [],\n resolve: (_source, _args, _context, { parentType }) => parentType.name,\n deprecationReason: undefined,\n extensions: Object.create(null),\n astNode: undefined,\n};\nexport const introspectionTypes = Object.freeze([\n __Schema,\n __Directive,\n __DirectiveLocation,\n __Type,\n __Field,\n __InputValue,\n __EnumValue,\n __TypeKind,\n]);\nexport function isIntrospectionType(type) {\n return introspectionTypes.some(({ name }) => type.name === name);\n}\n", "import { devAssert } from '../jsutils/devAssert.mjs';\nimport { inspect } from '../jsutils/inspect.mjs';\nimport { instanceOf } from '../jsutils/instanceOf.mjs';\nimport { isObjectLike } from '../jsutils/isObjectLike.mjs';\nimport { toObjMap } from '../jsutils/toObjMap.mjs';\nimport { OperationTypeNode } from '../language/ast.mjs';\nimport {\n getNamedType,\n isInputObjectType,\n isInterfaceType,\n isObjectType,\n isUnionType,\n} from './definition.mjs';\nimport { isDirective, specifiedDirectives } from './directives.mjs';\nimport { __Schema } from './introspection.mjs';\n/**\n * Test if the given value is a GraphQL schema.\n */\n\nexport function isSchema(schema) {\n return instanceOf(schema, GraphQLSchema);\n}\nexport function assertSchema(schema) {\n if (!isSchema(schema)) {\n throw new Error(`Expected ${inspect(schema)} to be a GraphQL schema.`);\n }\n\n return schema;\n}\n/**\n * Custom extensions\n *\n * @remarks\n * Use a unique identifier name for your extension, for example the name of\n * your library or project. Do not use a shortened identifier as this increases\n * the risk of conflicts. We recommend you add at most one extension field,\n * an object which can contain all the values you need.\n */\n\n/**\n * Schema Definition\n *\n * A Schema is created by supplying the root types of each type of operation,\n * query and mutation (optional). A schema definition is then supplied to the\n * validator and executor.\n *\n * Example:\n *\n * ```ts\n * const MyAppSchema = new GraphQLSchema({\n * query: MyAppQueryRootType,\n * mutation: MyAppMutationRootType,\n * })\n * ```\n *\n * Note: When the schema is constructed, by default only the types that are\n * reachable by traversing the root types are included, other types must be\n * explicitly referenced.\n *\n * Example:\n *\n * ```ts\n * const characterInterface = new GraphQLInterfaceType({\n * name: 'Character',\n * ...\n * });\n *\n * const humanType = new GraphQLObjectType({\n * name: 'Human',\n * interfaces: [characterInterface],\n * ...\n * });\n *\n * const droidType = new GraphQLObjectType({\n * name: 'Droid',\n * interfaces: [characterInterface],\n * ...\n * });\n *\n * const schema = new GraphQLSchema({\n * query: new GraphQLObjectType({\n * name: 'Query',\n * fields: {\n * hero: { type: characterInterface, ... },\n * }\n * }),\n * ...\n * // Since this schema references only the `Character` interface it's\n * // necessary to explicitly list the types that implement it if\n * // you want them to be included in the final schema.\n * types: [humanType, droidType],\n * })\n * ```\n *\n * Note: If an array of `directives` are provided to GraphQLSchema, that will be\n * the exact list of directives represented and allowed. If `directives` is not\n * provided then a default set of the specified directives (e.g. `@include` and\n * `@skip`) will be used. If you wish to provide *additional* directives to these\n * specified directives, you must explicitly declare them. Example:\n *\n * ```ts\n * const MyAppSchema = new GraphQLSchema({\n * ...\n * directives: specifiedDirectives.concat([ myCustomDirective ]),\n * })\n * ```\n */\nexport class GraphQLSchema {\n // Used as a cache for validateSchema().\n constructor(config) {\n var _config$extensionASTN, _config$directives;\n\n // If this schema was built from a source known to be valid, then it may be\n // marked with assumeValid to avoid an additional type system validation.\n this.__validationErrors = config.assumeValid === true ? [] : undefined; // Check for common mistakes during construction to produce early errors.\n\n isObjectLike(config) ||\n devAssert(false, 'Must provide configuration object.');\n !config.types ||\n Array.isArray(config.types) ||\n devAssert(\n false,\n `\"types\" must be Array if provided but got: ${inspect(config.types)}.`,\n );\n !config.directives ||\n Array.isArray(config.directives) ||\n devAssert(\n false,\n '\"directives\" must be Array if provided but got: ' +\n `${inspect(config.directives)}.`,\n );\n this.description = config.description;\n this.extensions = toObjMap(config.extensions);\n this.astNode = config.astNode;\n this.extensionASTNodes =\n (_config$extensionASTN = config.extensionASTNodes) !== null &&\n _config$extensionASTN !== void 0\n ? _config$extensionASTN\n : [];\n this._queryType = config.query;\n this._mutationType = config.mutation;\n this._subscriptionType = config.subscription; // Provide specified directives (e.g. @include and @skip) by default.\n\n this._directives =\n (_config$directives = config.directives) !== null &&\n _config$directives !== void 0\n ? _config$directives\n : specifiedDirectives; // To preserve order of user-provided types, we add first to add them to\n // the set of \"collected\" types, so `collectReferencedTypes` ignore them.\n\n const allReferencedTypes = new Set(config.types);\n\n if (config.types != null) {\n for (const type of config.types) {\n // When we ready to process this type, we remove it from \"collected\" types\n // and then add it together with all dependent types in the correct position.\n allReferencedTypes.delete(type);\n collectReferencedTypes(type, allReferencedTypes);\n }\n }\n\n if (this._queryType != null) {\n collectReferencedTypes(this._queryType, allReferencedTypes);\n }\n\n if (this._mutationType != null) {\n collectReferencedTypes(this._mutationType, allReferencedTypes);\n }\n\n if (this._subscriptionType != null) {\n collectReferencedTypes(this._subscriptionType, allReferencedTypes);\n }\n\n for (const directive of this._directives) {\n // Directives are not validated until validateSchema() is called.\n if (isDirective(directive)) {\n for (const arg of directive.args) {\n collectReferencedTypes(arg.type, allReferencedTypes);\n }\n }\n }\n\n collectReferencedTypes(__Schema, allReferencedTypes); // Storing the resulting map for reference by the schema.\n\n this._typeMap = Object.create(null);\n this._subTypeMap = Object.create(null); // Keep track of all implementations by interface name.\n\n this._implementationsMap = Object.create(null);\n\n for (const namedType of allReferencedTypes) {\n if (namedType == null) {\n continue;\n }\n\n const typeName = namedType.name;\n typeName ||\n devAssert(\n false,\n 'One of the provided types for building the Schema is missing a name.',\n );\n\n if (this._typeMap[typeName] !== undefined) {\n throw new Error(\n `Schema must contain uniquely named types but contains multiple types named \"${typeName}\".`,\n );\n }\n\n this._typeMap[typeName] = namedType;\n\n if (isInterfaceType(namedType)) {\n // Store implementations by interface.\n for (const iface of namedType.getInterfaces()) {\n if (isInterfaceType(iface)) {\n let implementations = this._implementationsMap[iface.name];\n\n if (implementations === undefined) {\n implementations = this._implementationsMap[iface.name] = {\n objects: [],\n interfaces: [],\n };\n }\n\n implementations.interfaces.push(namedType);\n }\n }\n } else if (isObjectType(namedType)) {\n // Store implementations by objects.\n for (const iface of namedType.getInterfaces()) {\n if (isInterfaceType(iface)) {\n let implementations = this._implementationsMap[iface.name];\n\n if (implementations === undefined) {\n implementations = this._implementationsMap[iface.name] = {\n objects: [],\n interfaces: [],\n };\n }\n\n implementations.objects.push(namedType);\n }\n }\n }\n }\n }\n\n get [Symbol.toStringTag]() {\n return 'GraphQLSchema';\n }\n\n getQueryType() {\n return this._queryType;\n }\n\n getMutationType() {\n return this._mutationType;\n }\n\n getSubscriptionType() {\n return this._subscriptionType;\n }\n\n getRootType(operation) {\n switch (operation) {\n case OperationTypeNode.QUERY:\n return this.getQueryType();\n\n case OperationTypeNode.MUTATION:\n return this.getMutationType();\n\n case OperationTypeNode.SUBSCRIPTION:\n return this.getSubscriptionType();\n }\n }\n\n getTypeMap() {\n return this._typeMap;\n }\n\n getType(name) {\n return this.getTypeMap()[name];\n }\n\n getPossibleTypes(abstractType) {\n return isUnionType(abstractType)\n ? abstractType.getTypes()\n : this.getImplementations(abstractType).objects;\n }\n\n getImplementations(interfaceType) {\n const implementations = this._implementationsMap[interfaceType.name];\n return implementations !== null && implementations !== void 0\n ? implementations\n : {\n objects: [],\n interfaces: [],\n };\n }\n\n isSubType(abstractType, maybeSubType) {\n let map = this._subTypeMap[abstractType.name];\n\n if (map === undefined) {\n map = Object.create(null);\n\n if (isUnionType(abstractType)) {\n for (const type of abstractType.getTypes()) {\n map[type.name] = true;\n }\n } else {\n const implementations = this.getImplementations(abstractType);\n\n for (const type of implementations.objects) {\n map[type.name] = true;\n }\n\n for (const type of implementations.interfaces) {\n map[type.name] = true;\n }\n }\n\n this._subTypeMap[abstractType.name] = map;\n }\n\n return map[maybeSubType.name] !== undefined;\n }\n\n getDirectives() {\n return this._directives;\n }\n\n getDirective(name) {\n return this.getDirectives().find((directive) => directive.name === name);\n }\n\n toConfig() {\n return {\n description: this.description,\n query: this.getQueryType(),\n mutation: this.getMutationType(),\n subscription: this.getSubscriptionType(),\n types: Object.values(this.getTypeMap()),\n directives: this.getDirectives(),\n extensions: this.extensions,\n astNode: this.astNode,\n extensionASTNodes: this.extensionASTNodes,\n assumeValid: this.__validationErrors !== undefined,\n };\n }\n}\n\nfunction collectReferencedTypes(type, typeSet) {\n const namedType = getNamedType(type);\n\n if (!typeSet.has(namedType)) {\n typeSet.add(namedType);\n\n if (isUnionType(namedType)) {\n for (const memberType of namedType.getTypes()) {\n collectReferencedTypes(memberType, typeSet);\n }\n } else if (isObjectType(namedType) || isInterfaceType(namedType)) {\n for (const interfaceType of namedType.getInterfaces()) {\n collectReferencedTypes(interfaceType, typeSet);\n }\n\n for (const field of Object.values(namedType.getFields())) {\n collectReferencedTypes(field.type, typeSet);\n\n for (const arg of field.args) {\n collectReferencedTypes(arg.type, typeSet);\n }\n }\n } else if (isInputObjectType(namedType)) {\n for (const field of Object.values(namedType.getFields())) {\n collectReferencedTypes(field.type, typeSet);\n }\n }\n }\n\n return typeSet;\n}\n", "import { inspect } from '../jsutils/inspect.mjs';\nimport { GraphQLError } from '../error/GraphQLError.mjs';\nimport { OperationTypeNode } from '../language/ast.mjs';\nimport { isEqualType, isTypeSubTypeOf } from '../utilities/typeComparators.mjs';\nimport {\n isEnumType,\n isInputObjectType,\n isInputType,\n isInterfaceType,\n isNamedType,\n isNonNullType,\n isObjectType,\n isOutputType,\n isRequiredArgument,\n isRequiredInputField,\n isUnionType,\n} from './definition.mjs';\nimport { GraphQLDeprecatedDirective, isDirective } from './directives.mjs';\nimport { isIntrospectionType } from './introspection.mjs';\nimport { assertSchema } from './schema.mjs';\n/**\n * Implements the \"Type Validation\" sub-sections of the specification's\n * \"Type System\" section.\n *\n * Validation runs synchronously, returning an array of encountered errors, or\n * an empty array if no errors were encountered and the Schema is valid.\n */\n\nexport function validateSchema(schema) {\n // First check to ensure the provided value is in fact a GraphQLSchema.\n assertSchema(schema); // If this Schema has already been validated, return the previous results.\n\n if (schema.__validationErrors) {\n return schema.__validationErrors;\n } // Validate the schema, producing a list of errors.\n\n const context = new SchemaValidationContext(schema);\n validateRootTypes(context);\n validateDirectives(context);\n validateTypes(context); // Persist the results of validation before returning to ensure validation\n // does not run multiple times for this schema.\n\n const errors = context.getErrors();\n schema.__validationErrors = errors;\n return errors;\n}\n/**\n * Utility function which asserts a schema is valid by throwing an error if\n * it is invalid.\n */\n\nexport function assertValidSchema(schema) {\n const errors = validateSchema(schema);\n\n if (errors.length !== 0) {\n throw new Error(errors.map((error) => error.message).join('\\n\\n'));\n }\n}\n\nclass SchemaValidationContext {\n constructor(schema) {\n this._errors = [];\n this.schema = schema;\n }\n\n reportError(message, nodes) {\n const _nodes = Array.isArray(nodes) ? nodes.filter(Boolean) : nodes;\n\n this._errors.push(\n new GraphQLError(message, {\n nodes: _nodes,\n }),\n );\n }\n\n getErrors() {\n return this._errors;\n }\n}\n\nfunction validateRootTypes(context) {\n const schema = context.schema;\n const queryType = schema.getQueryType();\n\n if (!queryType) {\n context.reportError('Query root type must be provided.', schema.astNode);\n } else if (!isObjectType(queryType)) {\n var _getOperationTypeNode;\n\n context.reportError(\n `Query root type must be Object type, it cannot be ${inspect(\n queryType,\n )}.`,\n (_getOperationTypeNode = getOperationTypeNode(\n schema,\n OperationTypeNode.QUERY,\n )) !== null && _getOperationTypeNode !== void 0\n ? _getOperationTypeNode\n : queryType.astNode,\n );\n }\n\n const mutationType = schema.getMutationType();\n\n if (mutationType && !isObjectType(mutationType)) {\n var _getOperationTypeNode2;\n\n context.reportError(\n 'Mutation root type must be Object type if provided, it cannot be ' +\n `${inspect(mutationType)}.`,\n (_getOperationTypeNode2 = getOperationTypeNode(\n schema,\n OperationTypeNode.MUTATION,\n )) !== null && _getOperationTypeNode2 !== void 0\n ? _getOperationTypeNode2\n : mutationType.astNode,\n );\n }\n\n const subscriptionType = schema.getSubscriptionType();\n\n if (subscriptionType && !isObjectType(subscriptionType)) {\n var _getOperationTypeNode3;\n\n context.reportError(\n 'Subscription root type must be Object type if provided, it cannot be ' +\n `${inspect(subscriptionType)}.`,\n (_getOperationTypeNode3 = getOperationTypeNode(\n schema,\n OperationTypeNode.SUBSCRIPTION,\n )) !== null && _getOperationTypeNode3 !== void 0\n ? _getOperationTypeNode3\n : subscriptionType.astNode,\n );\n }\n}\n\nfunction getOperationTypeNode(schema, operation) {\n var _flatMap$find;\n\n return (_flatMap$find = [schema.astNode, ...schema.extensionASTNodes]\n .flatMap(\n // FIXME: https://github.com/graphql/graphql-js/issues/2203\n (schemaNode) => {\n var _schemaNode$operation;\n\n return (\n /* c8 ignore next */\n (_schemaNode$operation =\n schemaNode === null || schemaNode === void 0\n ? void 0\n : schemaNode.operationTypes) !== null &&\n _schemaNode$operation !== void 0\n ? _schemaNode$operation\n : []\n );\n },\n )\n .find((operationNode) => operationNode.operation === operation)) === null ||\n _flatMap$find === void 0\n ? void 0\n : _flatMap$find.type;\n}\n\nfunction validateDirectives(context) {\n for (const directive of context.schema.getDirectives()) {\n // Ensure all directives are in fact GraphQL directives.\n if (!isDirective(directive)) {\n context.reportError(\n `Expected directive but got: ${inspect(directive)}.`,\n directive === null || directive === void 0 ? void 0 : directive.astNode,\n );\n continue;\n } // Ensure they are named correctly.\n\n validateName(context, directive);\n\n if (directive.locations.length === 0) {\n context.reportError(\n `Directive @${directive.name} must include 1 or more locations.`,\n directive.astNode,\n );\n } // Ensure the arguments are valid.\n\n for (const arg of directive.args) {\n // Ensure they are named correctly.\n validateName(context, arg); // Ensure the type is an input type.\n\n if (!isInputType(arg.type)) {\n context.reportError(\n `The type of @${directive.name}(${arg.name}:) must be Input Type ` +\n `but got: ${inspect(arg.type)}.`,\n arg.astNode,\n );\n }\n\n if (isRequiredArgument(arg) && arg.deprecationReason != null) {\n var _arg$astNode;\n\n context.reportError(\n `Required argument @${directive.name}(${arg.name}:) cannot be deprecated.`,\n [\n getDeprecatedDirectiveNode(arg.astNode),\n (_arg$astNode = arg.astNode) === null || _arg$astNode === void 0\n ? void 0\n : _arg$astNode.type,\n ],\n );\n }\n }\n }\n}\n\nfunction validateName(context, node) {\n // Ensure names are valid, however introspection types opt out.\n if (node.name.startsWith('__')) {\n context.reportError(\n `Name \"${node.name}\" must not begin with \"__\", which is reserved by GraphQL introspection.`,\n node.astNode,\n );\n }\n}\n\nfunction validateTypes(context) {\n const validateInputObjectCircularRefs =\n createInputObjectCircularRefsValidator(context);\n const typeMap = context.schema.getTypeMap();\n\n for (const type of Object.values(typeMap)) {\n // Ensure all provided types are in fact GraphQL type.\n if (!isNamedType(type)) {\n context.reportError(\n `Expected GraphQL named type but got: ${inspect(type)}.`,\n type.astNode,\n );\n continue;\n } // Ensure it is named correctly (excluding introspection types).\n\n if (!isIntrospectionType(type)) {\n validateName(context, type);\n }\n\n if (isObjectType(type)) {\n // Ensure fields are valid\n validateFields(context, type); // Ensure objects implement the interfaces they claim to.\n\n validateInterfaces(context, type);\n } else if (isInterfaceType(type)) {\n // Ensure fields are valid.\n validateFields(context, type); // Ensure interfaces implement the interfaces they claim to.\n\n validateInterfaces(context, type);\n } else if (isUnionType(type)) {\n // Ensure Unions include valid member types.\n validateUnionMembers(context, type);\n } else if (isEnumType(type)) {\n // Ensure Enums have valid values.\n validateEnumValues(context, type);\n } else if (isInputObjectType(type)) {\n // Ensure Input Object fields are valid.\n validateInputFields(context, type); // Ensure Input Objects do not contain non-nullable circular references\n\n validateInputObjectCircularRefs(type);\n }\n }\n}\n\nfunction validateFields(context, type) {\n const fields = Object.values(type.getFields()); // Objects and Interfaces both must define one or more fields.\n\n if (fields.length === 0) {\n context.reportError(`Type ${type.name} must define one or more fields.`, [\n type.astNode,\n ...type.extensionASTNodes,\n ]);\n }\n\n for (const field of fields) {\n // Ensure they are named correctly.\n validateName(context, field); // Ensure the type is an output type\n\n if (!isOutputType(field.type)) {\n var _field$astNode;\n\n context.reportError(\n `The type of ${type.name}.${field.name} must be Output Type ` +\n `but got: ${inspect(field.type)}.`,\n (_field$astNode = field.astNode) === null || _field$astNode === void 0\n ? void 0\n : _field$astNode.type,\n );\n } // Ensure the arguments are valid\n\n for (const arg of field.args) {\n const argName = arg.name; // Ensure they are named correctly.\n\n validateName(context, arg); // Ensure the type is an input type\n\n if (!isInputType(arg.type)) {\n var _arg$astNode2;\n\n context.reportError(\n `The type of ${type.name}.${field.name}(${argName}:) must be Input ` +\n `Type but got: ${inspect(arg.type)}.`,\n (_arg$astNode2 = arg.astNode) === null || _arg$astNode2 === void 0\n ? void 0\n : _arg$astNode2.type,\n );\n }\n\n if (isRequiredArgument(arg) && arg.deprecationReason != null) {\n var _arg$astNode3;\n\n context.reportError(\n `Required argument ${type.name}.${field.name}(${argName}:) cannot be deprecated.`,\n [\n getDeprecatedDirectiveNode(arg.astNode),\n (_arg$astNode3 = arg.astNode) === null || _arg$astNode3 === void 0\n ? void 0\n : _arg$astNode3.type,\n ],\n );\n }\n }\n }\n}\n\nfunction validateInterfaces(context, type) {\n const ifaceTypeNames = Object.create(null);\n\n for (const iface of type.getInterfaces()) {\n if (!isInterfaceType(iface)) {\n context.reportError(\n `Type ${inspect(type)} must only implement Interface types, ` +\n `it cannot implement ${inspect(iface)}.`,\n getAllImplementsInterfaceNodes(type, iface),\n );\n continue;\n }\n\n if (type === iface) {\n context.reportError(\n `Type ${type.name} cannot implement itself because it would create a circular reference.`,\n getAllImplementsInterfaceNodes(type, iface),\n );\n continue;\n }\n\n if (ifaceTypeNames[iface.name]) {\n context.reportError(\n `Type ${type.name} can only implement ${iface.name} once.`,\n getAllImplementsInterfaceNodes(type, iface),\n );\n continue;\n }\n\n ifaceTypeNames[iface.name] = true;\n validateTypeImplementsAncestors(context, type, iface);\n validateTypeImplementsInterface(context, type, iface);\n }\n}\n\nfunction validateTypeImplementsInterface(context, type, iface) {\n const typeFieldMap = type.getFields(); // Assert each interface field is implemented.\n\n for (const ifaceField of Object.values(iface.getFields())) {\n const fieldName = ifaceField.name;\n const typeField = typeFieldMap[fieldName]; // Assert interface field exists on type.\n\n if (!typeField) {\n context.reportError(\n `Interface field ${iface.name}.${fieldName} expected but ${type.name} does not provide it.`,\n [ifaceField.astNode, type.astNode, ...type.extensionASTNodes],\n );\n continue;\n } // Assert interface field type is satisfied by type field type, by being\n // a valid subtype. (covariant)\n\n if (!isTypeSubTypeOf(context.schema, typeField.type, ifaceField.type)) {\n var _ifaceField$astNode, _typeField$astNode;\n\n context.reportError(\n `Interface field ${iface.name}.${fieldName} expects type ` +\n `${inspect(ifaceField.type)} but ${type.name}.${fieldName} ` +\n `is type ${inspect(typeField.type)}.`,\n [\n (_ifaceField$astNode = ifaceField.astNode) === null ||\n _ifaceField$astNode === void 0\n ? void 0\n : _ifaceField$astNode.type,\n (_typeField$astNode = typeField.astNode) === null ||\n _typeField$astNode === void 0\n ? void 0\n : _typeField$astNode.type,\n ],\n );\n } // Assert each interface field arg is implemented.\n\n for (const ifaceArg of ifaceField.args) {\n const argName = ifaceArg.name;\n const typeArg = typeField.args.find((arg) => arg.name === argName); // Assert interface field arg exists on object field.\n\n if (!typeArg) {\n context.reportError(\n `Interface field argument ${iface.name}.${fieldName}(${argName}:) expected but ${type.name}.${fieldName} does not provide it.`,\n [ifaceArg.astNode, typeField.astNode],\n );\n continue;\n } // Assert interface field arg type matches object field arg type.\n // (invariant)\n // TODO: change to contravariant?\n\n if (!isEqualType(ifaceArg.type, typeArg.type)) {\n var _ifaceArg$astNode, _typeArg$astNode;\n\n context.reportError(\n `Interface field argument ${iface.name}.${fieldName}(${argName}:) ` +\n `expects type ${inspect(ifaceArg.type)} but ` +\n `${type.name}.${fieldName}(${argName}:) is type ` +\n `${inspect(typeArg.type)}.`,\n [\n (_ifaceArg$astNode = ifaceArg.astNode) === null ||\n _ifaceArg$astNode === void 0\n ? void 0\n : _ifaceArg$astNode.type,\n (_typeArg$astNode = typeArg.astNode) === null ||\n _typeArg$astNode === void 0\n ? void 0\n : _typeArg$astNode.type,\n ],\n );\n } // TODO: validate default values?\n } // Assert additional arguments must not be required.\n\n for (const typeArg of typeField.args) {\n const argName = typeArg.name;\n const ifaceArg = ifaceField.args.find((arg) => arg.name === argName);\n\n if (!ifaceArg && isRequiredArgument(typeArg)) {\n context.reportError(\n `Object field ${type.name}.${fieldName} includes required argument ${argName} that is missing from the Interface field ${iface.name}.${fieldName}.`,\n [typeArg.astNode, ifaceField.astNode],\n );\n }\n }\n }\n}\n\nfunction validateTypeImplementsAncestors(context, type, iface) {\n const ifaceInterfaces = type.getInterfaces();\n\n for (const transitive of iface.getInterfaces()) {\n if (!ifaceInterfaces.includes(transitive)) {\n context.reportError(\n transitive === type\n ? `Type ${type.name} cannot implement ${iface.name} because it would create a circular reference.`\n : `Type ${type.name} must implement ${transitive.name} because it is implemented by ${iface.name}.`,\n [\n ...getAllImplementsInterfaceNodes(iface, transitive),\n ...getAllImplementsInterfaceNodes(type, iface),\n ],\n );\n }\n }\n}\n\nfunction validateUnionMembers(context, union) {\n const memberTypes = union.getTypes();\n\n if (memberTypes.length === 0) {\n context.reportError(\n `Union type ${union.name} must define one or more member types.`,\n [union.astNode, ...union.extensionASTNodes],\n );\n }\n\n const includedTypeNames = Object.create(null);\n\n for (const memberType of memberTypes) {\n if (includedTypeNames[memberType.name]) {\n context.reportError(\n `Union type ${union.name} can only include type ${memberType.name} once.`,\n getUnionMemberTypeNodes(union, memberType.name),\n );\n continue;\n }\n\n includedTypeNames[memberType.name] = true;\n\n if (!isObjectType(memberType)) {\n context.reportError(\n `Union type ${union.name} can only include Object types, ` +\n `it cannot include ${inspect(memberType)}.`,\n getUnionMemberTypeNodes(union, String(memberType)),\n );\n }\n }\n}\n\nfunction validateEnumValues(context, enumType) {\n const enumValues = enumType.getValues();\n\n if (enumValues.length === 0) {\n context.reportError(\n `Enum type ${enumType.name} must define one or more values.`,\n [enumType.astNode, ...enumType.extensionASTNodes],\n );\n }\n\n for (const enumValue of enumValues) {\n // Ensure valid name.\n validateName(context, enumValue);\n }\n}\n\nfunction validateInputFields(context, inputObj) {\n const fields = Object.values(inputObj.getFields());\n\n if (fields.length === 0) {\n context.reportError(\n `Input Object type ${inputObj.name} must define one or more fields.`,\n [inputObj.astNode, ...inputObj.extensionASTNodes],\n );\n } // Ensure the arguments are valid\n\n for (const field of fields) {\n // Ensure they are named correctly.\n validateName(context, field); // Ensure the type is an input type\n\n if (!isInputType(field.type)) {\n var _field$astNode2;\n\n context.reportError(\n `The type of ${inputObj.name}.${field.name} must be Input Type ` +\n `but got: ${inspect(field.type)}.`,\n (_field$astNode2 = field.astNode) === null || _field$astNode2 === void 0\n ? void 0\n : _field$astNode2.type,\n );\n }\n\n if (isRequiredInputField(field) && field.deprecationReason != null) {\n var _field$astNode3;\n\n context.reportError(\n `Required input field ${inputObj.name}.${field.name} cannot be deprecated.`,\n [\n getDeprecatedDirectiveNode(field.astNode),\n (_field$astNode3 = field.astNode) === null ||\n _field$astNode3 === void 0\n ? void 0\n : _field$astNode3.type,\n ],\n );\n }\n\n if (inputObj.isOneOf) {\n validateOneOfInputObjectField(inputObj, field, context);\n }\n }\n}\n\nfunction validateOneOfInputObjectField(type, field, context) {\n if (isNonNullType(field.type)) {\n var _field$astNode4;\n\n context.reportError(\n `OneOf input field ${type.name}.${field.name} must be nullable.`,\n (_field$astNode4 = field.astNode) === null || _field$astNode4 === void 0\n ? void 0\n : _field$astNode4.type,\n );\n }\n\n if (field.defaultValue !== undefined) {\n context.reportError(\n `OneOf input field ${type.name}.${field.name} cannot have a default value.`,\n field.astNode,\n );\n }\n}\n\nfunction createInputObjectCircularRefsValidator(context) {\n // Modified copy of algorithm from 'src/validation/rules/NoFragmentCycles.js'.\n // Tracks already visited types to maintain O(N) and to ensure that cycles\n // are not redundantly reported.\n const visitedTypes = Object.create(null); // Array of types nodes used to produce meaningful errors\n\n const fieldPath = []; // Position in the type path\n\n const fieldPathIndexByTypeName = Object.create(null);\n return detectCycleRecursive; // This does a straight-forward DFS to find cycles.\n // It does not terminate when a cycle was found but continues to explore\n // the graph to find all possible cycles.\n\n function detectCycleRecursive(inputObj) {\n if (visitedTypes[inputObj.name]) {\n return;\n }\n\n visitedTypes[inputObj.name] = true;\n fieldPathIndexByTypeName[inputObj.name] = fieldPath.length;\n const fields = Object.values(inputObj.getFields());\n\n for (const field of fields) {\n if (isNonNullType(field.type) && isInputObjectType(field.type.ofType)) {\n const fieldType = field.type.ofType;\n const cycleIndex = fieldPathIndexByTypeName[fieldType.name];\n fieldPath.push(field);\n\n if (cycleIndex === undefined) {\n detectCycleRecursive(fieldType);\n } else {\n const cyclePath = fieldPath.slice(cycleIndex);\n const pathStr = cyclePath.map((fieldObj) => fieldObj.name).join('.');\n context.reportError(\n `Cannot reference Input Object \"${fieldType.name}\" within itself through a series of non-null fields: \"${pathStr}\".`,\n cyclePath.map((fieldObj) => fieldObj.astNode),\n );\n }\n\n fieldPath.pop();\n }\n }\n\n fieldPathIndexByTypeName[inputObj.name] = undefined;\n }\n}\n\nfunction getAllImplementsInterfaceNodes(type, iface) {\n const { astNode, extensionASTNodes } = type;\n const nodes =\n astNode != null ? [astNode, ...extensionASTNodes] : extensionASTNodes; // FIXME: https://github.com/graphql/graphql-js/issues/2203\n\n return nodes\n .flatMap((typeNode) => {\n var _typeNode$interfaces;\n\n return (\n /* c8 ignore next */\n (_typeNode$interfaces = typeNode.interfaces) !== null &&\n _typeNode$interfaces !== void 0\n ? _typeNode$interfaces\n : []\n );\n })\n .filter((ifaceNode) => ifaceNode.name.value === iface.name);\n}\n\nfunction getUnionMemberTypeNodes(union, typeName) {\n const { astNode, extensionASTNodes } = union;\n const nodes =\n astNode != null ? [astNode, ...extensionASTNodes] : extensionASTNodes; // FIXME: https://github.com/graphql/graphql-js/issues/2203\n\n return nodes\n .flatMap((unionNode) => {\n var _unionNode$types;\n\n return (\n /* c8 ignore next */\n (_unionNode$types = unionNode.types) !== null &&\n _unionNode$types !== void 0\n ? _unionNode$types\n : []\n );\n })\n .filter((typeNode) => typeNode.name.value === typeName);\n}\n\nfunction getDeprecatedDirectiveNode(definitionNode) {\n var _definitionNode$direc;\n\n return definitionNode === null || definitionNode === void 0\n ? void 0\n : (_definitionNode$direc = definitionNode.directives) === null ||\n _definitionNode$direc === void 0\n ? void 0\n : _definitionNode$direc.find(\n (node) => node.name.value === GraphQLDeprecatedDirective.name,\n );\n}\n", "import { Kind } from '../language/kinds.mjs';\nimport { GraphQLList, GraphQLNonNull } from '../type/definition.mjs';\nexport function typeFromAST(schema, typeNode) {\n switch (typeNode.kind) {\n case Kind.LIST_TYPE: {\n const innerType = typeFromAST(schema, typeNode.type);\n return innerType && new GraphQLList(innerType);\n }\n\n case Kind.NON_NULL_TYPE: {\n const innerType = typeFromAST(schema, typeNode.type);\n return innerType && new GraphQLNonNull(innerType);\n }\n\n case Kind.NAMED_TYPE:\n return schema.getType(typeNode.name.value);\n }\n}\n", "import { isNode } from '../language/ast.mjs';\nimport { Kind } from '../language/kinds.mjs';\nimport { getEnterLeaveForKind } from '../language/visitor.mjs';\nimport {\n getNamedType,\n getNullableType,\n isCompositeType,\n isEnumType,\n isInputObjectType,\n isInputType,\n isInterfaceType,\n isListType,\n isObjectType,\n isOutputType,\n} from '../type/definition.mjs';\nimport {\n SchemaMetaFieldDef,\n TypeMetaFieldDef,\n TypeNameMetaFieldDef,\n} from '../type/introspection.mjs';\nimport { typeFromAST } from './typeFromAST.mjs';\n/**\n * TypeInfo is a utility class which, given a GraphQL schema, can keep track\n * of the current field and type definitions at any point in a GraphQL document\n * AST during a recursive descent by calling `enter(node)` and `leave(node)`.\n */\n\nexport class TypeInfo {\n constructor(\n schema,\n /**\n * Initial type may be provided in rare cases to facilitate traversals\n * beginning somewhere other than documents.\n */\n initialType,\n /** @deprecated will be removed in 17.0.0 */\n getFieldDefFn,\n ) {\n this._schema = schema;\n this._typeStack = [];\n this._parentTypeStack = [];\n this._inputTypeStack = [];\n this._fieldDefStack = [];\n this._defaultValueStack = [];\n this._directive = null;\n this._argument = null;\n this._enumValue = null;\n this._getFieldDef =\n getFieldDefFn !== null && getFieldDefFn !== void 0\n ? getFieldDefFn\n : getFieldDef;\n\n if (initialType) {\n if (isInputType(initialType)) {\n this._inputTypeStack.push(initialType);\n }\n\n if (isCompositeType(initialType)) {\n this._parentTypeStack.push(initialType);\n }\n\n if (isOutputType(initialType)) {\n this._typeStack.push(initialType);\n }\n }\n }\n\n get [Symbol.toStringTag]() {\n return 'TypeInfo';\n }\n\n getType() {\n if (this._typeStack.length > 0) {\n return this._typeStack[this._typeStack.length - 1];\n }\n }\n\n getParentType() {\n if (this._parentTypeStack.length > 0) {\n return this._parentTypeStack[this._parentTypeStack.length - 1];\n }\n }\n\n getInputType() {\n if (this._inputTypeStack.length > 0) {\n return this._inputTypeStack[this._inputTypeStack.length - 1];\n }\n }\n\n getParentInputType() {\n if (this._inputTypeStack.length > 1) {\n return this._inputTypeStack[this._inputTypeStack.length - 2];\n }\n }\n\n getFieldDef() {\n if (this._fieldDefStack.length > 0) {\n return this._fieldDefStack[this._fieldDefStack.length - 1];\n }\n }\n\n getDefaultValue() {\n if (this._defaultValueStack.length > 0) {\n return this._defaultValueStack[this._defaultValueStack.length - 1];\n }\n }\n\n getDirective() {\n return this._directive;\n }\n\n getArgument() {\n return this._argument;\n }\n\n getEnumValue() {\n return this._enumValue;\n }\n\n enter(node) {\n const schema = this._schema; // Note: many of the types below are explicitly typed as \"unknown\" to drop\n // any assumptions of a valid schema to ensure runtime types are properly\n // checked before continuing since TypeInfo is used as part of validation\n // which occurs before guarantees of schema and document validity.\n\n switch (node.kind) {\n case Kind.SELECTION_SET: {\n const namedType = getNamedType(this.getType());\n\n this._parentTypeStack.push(\n isCompositeType(namedType) ? namedType : undefined,\n );\n\n break;\n }\n\n case Kind.FIELD: {\n const parentType = this.getParentType();\n let fieldDef;\n let fieldType;\n\n if (parentType) {\n fieldDef = this._getFieldDef(schema, parentType, node);\n\n if (fieldDef) {\n fieldType = fieldDef.type;\n }\n }\n\n this._fieldDefStack.push(fieldDef);\n\n this._typeStack.push(isOutputType(fieldType) ? fieldType : undefined);\n\n break;\n }\n\n case Kind.DIRECTIVE:\n this._directive = schema.getDirective(node.name.value);\n break;\n\n case Kind.OPERATION_DEFINITION: {\n const rootType = schema.getRootType(node.operation);\n\n this._typeStack.push(isObjectType(rootType) ? rootType : undefined);\n\n break;\n }\n\n case Kind.INLINE_FRAGMENT:\n case Kind.FRAGMENT_DEFINITION: {\n const typeConditionAST = node.typeCondition;\n const outputType = typeConditionAST\n ? typeFromAST(schema, typeConditionAST)\n : getNamedType(this.getType());\n\n this._typeStack.push(isOutputType(outputType) ? outputType : undefined);\n\n break;\n }\n\n case Kind.VARIABLE_DEFINITION: {\n const inputType = typeFromAST(schema, node.type);\n\n this._inputTypeStack.push(\n isInputType(inputType) ? inputType : undefined,\n );\n\n break;\n }\n\n case Kind.ARGUMENT: {\n var _this$getDirective;\n\n let argDef;\n let argType;\n const fieldOrDirective =\n (_this$getDirective = this.getDirective()) !== null &&\n _this$getDirective !== void 0\n ? _this$getDirective\n : this.getFieldDef();\n\n if (fieldOrDirective) {\n argDef = fieldOrDirective.args.find(\n (arg) => arg.name === node.name.value,\n );\n\n if (argDef) {\n argType = argDef.type;\n }\n }\n\n this._argument = argDef;\n\n this._defaultValueStack.push(argDef ? argDef.defaultValue : undefined);\n\n this._inputTypeStack.push(isInputType(argType) ? argType : undefined);\n\n break;\n }\n\n case Kind.LIST: {\n const listType = getNullableType(this.getInputType());\n const itemType = isListType(listType) ? listType.ofType : listType; // List positions never have a default value.\n\n this._defaultValueStack.push(undefined);\n\n this._inputTypeStack.push(isInputType(itemType) ? itemType : undefined);\n\n break;\n }\n\n case Kind.OBJECT_FIELD: {\n const objectType = getNamedType(this.getInputType());\n let inputFieldType;\n let inputField;\n\n if (isInputObjectType(objectType)) {\n inputField = objectType.getFields()[node.name.value];\n\n if (inputField) {\n inputFieldType = inputField.type;\n }\n }\n\n this._defaultValueStack.push(\n inputField ? inputField.defaultValue : undefined,\n );\n\n this._inputTypeStack.push(\n isInputType(inputFieldType) ? inputFieldType : undefined,\n );\n\n break;\n }\n\n case Kind.ENUM: {\n const enumType = getNamedType(this.getInputType());\n let enumValue;\n\n if (isEnumType(enumType)) {\n enumValue = enumType.getValue(node.value);\n }\n\n this._enumValue = enumValue;\n break;\n }\n\n default: // Ignore other nodes\n }\n }\n\n leave(node) {\n switch (node.kind) {\n case Kind.SELECTION_SET:\n this._parentTypeStack.pop();\n\n break;\n\n case Kind.FIELD:\n this._fieldDefStack.pop();\n\n this._typeStack.pop();\n\n break;\n\n case Kind.DIRECTIVE:\n this._directive = null;\n break;\n\n case Kind.OPERATION_DEFINITION:\n case Kind.INLINE_FRAGMENT:\n case Kind.FRAGMENT_DEFINITION:\n this._typeStack.pop();\n\n break;\n\n case Kind.VARIABLE_DEFINITION:\n this._inputTypeStack.pop();\n\n break;\n\n case Kind.ARGUMENT:\n this._argument = null;\n\n this._defaultValueStack.pop();\n\n this._inputTypeStack.pop();\n\n break;\n\n case Kind.LIST:\n case Kind.OBJECT_FIELD:\n this._defaultValueStack.pop();\n\n this._inputTypeStack.pop();\n\n break;\n\n case Kind.ENUM:\n this._enumValue = null;\n break;\n\n default: // Ignore other nodes\n }\n }\n}\n\n/**\n * Not exactly the same as the executor's definition of getFieldDef, in this\n * statically evaluated environment we do not always have an Object type,\n * and need to handle Interface and Union types.\n */\nfunction getFieldDef(schema, parentType, fieldNode) {\n const name = fieldNode.name.value;\n\n if (\n name === SchemaMetaFieldDef.name &&\n schema.getQueryType() === parentType\n ) {\n return SchemaMetaFieldDef;\n }\n\n if (name === TypeMetaFieldDef.name && schema.getQueryType() === parentType) {\n return TypeMetaFieldDef;\n }\n\n if (name === TypeNameMetaFieldDef.name && isCompositeType(parentType)) {\n return TypeNameMetaFieldDef;\n }\n\n if (isObjectType(parentType) || isInterfaceType(parentType)) {\n return parentType.getFields()[name];\n }\n}\n/**\n * Creates a new visitor instance which maintains a provided TypeInfo instance\n * along with visiting visitor.\n */\n\nexport function visitWithTypeInfo(typeInfo, visitor) {\n return {\n enter(...args) {\n const node = args[0];\n typeInfo.enter(node);\n const fn = getEnterLeaveForKind(visitor, node.kind).enter;\n\n if (fn) {\n const result = fn.apply(visitor, args);\n\n if (result !== undefined) {\n typeInfo.leave(node);\n\n if (isNode(result)) {\n typeInfo.enter(result);\n }\n }\n\n return result;\n }\n },\n\n leave(...args) {\n const node = args[0];\n const fn = getEnterLeaveForKind(visitor, node.kind).leave;\n let result;\n\n if (fn) {\n result = fn.apply(visitor, args);\n }\n\n typeInfo.leave(node);\n return result;\n },\n };\n}\n", "import { Kind } from './kinds.mjs';\nexport function isDefinitionNode(node) {\n return (\n isExecutableDefinitionNode(node) ||\n isTypeSystemDefinitionNode(node) ||\n isTypeSystemExtensionNode(node)\n );\n}\nexport function isExecutableDefinitionNode(node) {\n return (\n node.kind === Kind.OPERATION_DEFINITION ||\n node.kind === Kind.FRAGMENT_DEFINITION\n );\n}\nexport function isSelectionNode(node) {\n return (\n node.kind === Kind.FIELD ||\n node.kind === Kind.FRAGMENT_SPREAD ||\n node.kind === Kind.INLINE_FRAGMENT\n );\n}\nexport function isValueNode(node) {\n return (\n node.kind === Kind.VARIABLE ||\n node.kind === Kind.INT ||\n node.kind === Kind.FLOAT ||\n node.kind === Kind.STRING ||\n node.kind === Kind.BOOLEAN ||\n node.kind === Kind.NULL ||\n node.kind === Kind.ENUM ||\n node.kind === Kind.LIST ||\n node.kind === Kind.OBJECT\n );\n}\nexport function isConstValueNode(node) {\n return (\n isValueNode(node) &&\n (node.kind === Kind.LIST\n ? node.values.some(isConstValueNode)\n : node.kind === Kind.OBJECT\n ? node.fields.some((field) => isConstValueNode(field.value))\n : node.kind !== Kind.VARIABLE)\n );\n}\nexport function isTypeNode(node) {\n return (\n node.kind === Kind.NAMED_TYPE ||\n node.kind === Kind.LIST_TYPE ||\n node.kind === Kind.NON_NULL_TYPE\n );\n}\nexport function isTypeSystemDefinitionNode(node) {\n return (\n node.kind === Kind.SCHEMA_DEFINITION ||\n isTypeDefinitionNode(node) ||\n node.kind === Kind.DIRECTIVE_DEFINITION\n );\n}\nexport function isTypeDefinitionNode(node) {\n return (\n node.kind === Kind.SCALAR_TYPE_DEFINITION ||\n node.kind === Kind.OBJECT_TYPE_DEFINITION ||\n node.kind === Kind.INTERFACE_TYPE_DEFINITION ||\n node.kind === Kind.UNION_TYPE_DEFINITION ||\n node.kind === Kind.ENUM_TYPE_DEFINITION ||\n node.kind === Kind.INPUT_OBJECT_TYPE_DEFINITION\n );\n}\nexport function isTypeSystemExtensionNode(node) {\n return node.kind === Kind.SCHEMA_EXTENSION || isTypeExtensionNode(node);\n}\nexport function isTypeExtensionNode(node) {\n return (\n node.kind === Kind.SCALAR_TYPE_EXTENSION ||\n node.kind === Kind.OBJECT_TYPE_EXTENSION ||\n node.kind === Kind.INTERFACE_TYPE_EXTENSION ||\n node.kind === Kind.UNION_TYPE_EXTENSION ||\n node.kind === Kind.ENUM_TYPE_EXTENSION ||\n node.kind === Kind.INPUT_OBJECT_TYPE_EXTENSION\n );\n}\nexport function isSchemaCoordinateNode(node) {\n return (\n node.kind === Kind.TYPE_COORDINATE ||\n node.kind === Kind.MEMBER_COORDINATE ||\n node.kind === Kind.ARGUMENT_COORDINATE ||\n node.kind === Kind.DIRECTIVE_COORDINATE ||\n node.kind === Kind.DIRECTIVE_ARGUMENT_COORDINATE\n );\n}\n", "import { GraphQLError } from '../../error/GraphQLError.mjs';\nimport { Kind } from '../../language/kinds.mjs';\nimport { isExecutableDefinitionNode } from '../../language/predicates.mjs';\n\n/**\n * Executable definitions\n *\n * A GraphQL document is only valid for execution if all definitions are either\n * operation or fragment definitions.\n *\n * See https://spec.graphql.org/draft/#sec-Executable-Definitions\n */\nexport function ExecutableDefinitionsRule(context) {\n return {\n Document(node) {\n for (const definition of node.definitions) {\n if (!isExecutableDefinitionNode(definition)) {\n const defName =\n definition.kind === Kind.SCHEMA_DEFINITION ||\n definition.kind === Kind.SCHEMA_EXTENSION\n ? 'schema'\n : '\"' + definition.name.value + '\"';\n context.reportError(\n new GraphQLError(`The ${defName} definition is not executable.`, {\n nodes: definition,\n }),\n );\n }\n }\n\n return false;\n },\n };\n}\n", "import { didYouMean } from '../../jsutils/didYouMean.mjs';\nimport { naturalCompare } from '../../jsutils/naturalCompare.mjs';\nimport { suggestionList } from '../../jsutils/suggestionList.mjs';\nimport { GraphQLError } from '../../error/GraphQLError.mjs';\nimport {\n isAbstractType,\n isInterfaceType,\n isObjectType,\n} from '../../type/definition.mjs';\n\n/**\n * Fields on correct type\n *\n * A GraphQL document is only valid if all fields selected are defined by the\n * parent type, or are an allowed meta field such as __typename.\n *\n * See https://spec.graphql.org/draft/#sec-Field-Selections\n */\nexport function FieldsOnCorrectTypeRule(context) {\n return {\n Field(node) {\n const type = context.getParentType();\n\n if (type) {\n const fieldDef = context.getFieldDef();\n\n if (!fieldDef) {\n // This field doesn't exist, lets look for suggestions.\n const schema = context.getSchema();\n const fieldName = node.name.value; // First determine if there are any suggested types to condition on.\n\n let suggestion = didYouMean(\n 'to use an inline fragment on',\n getSuggestedTypeNames(schema, type, fieldName),\n ); // If there are no suggested types, then perhaps this was a typo?\n\n if (suggestion === '') {\n suggestion = didYouMean(getSuggestedFieldNames(type, fieldName));\n } // Report an error, including helpful suggestions.\n\n context.reportError(\n new GraphQLError(\n `Cannot query field \"${fieldName}\" on type \"${type.name}\".` +\n suggestion,\n {\n nodes: node,\n },\n ),\n );\n }\n }\n },\n };\n}\n/**\n * Go through all of the implementations of type, as well as the interfaces that\n * they implement. If any of those types include the provided field, suggest them,\n * sorted by how often the type is referenced.\n */\n\nfunction getSuggestedTypeNames(schema, type, fieldName) {\n if (!isAbstractType(type)) {\n // Must be an Object type, which does not have possible fields.\n return [];\n }\n\n const suggestedTypes = new Set();\n const usageCount = Object.create(null);\n\n for (const possibleType of schema.getPossibleTypes(type)) {\n if (!possibleType.getFields()[fieldName]) {\n continue;\n } // This object type defines this field.\n\n suggestedTypes.add(possibleType);\n usageCount[possibleType.name] = 1;\n\n for (const possibleInterface of possibleType.getInterfaces()) {\n var _usageCount$possibleI;\n\n if (!possibleInterface.getFields()[fieldName]) {\n continue;\n } // This interface type defines this field.\n\n suggestedTypes.add(possibleInterface);\n usageCount[possibleInterface.name] =\n ((_usageCount$possibleI = usageCount[possibleInterface.name]) !==\n null && _usageCount$possibleI !== void 0\n ? _usageCount$possibleI\n : 0) + 1;\n }\n }\n\n return [...suggestedTypes]\n .sort((typeA, typeB) => {\n // Suggest both interface and object types based on how common they are.\n const usageCountDiff = usageCount[typeB.name] - usageCount[typeA.name];\n\n if (usageCountDiff !== 0) {\n return usageCountDiff;\n } // Suggest super types first followed by subtypes\n\n if (isInterfaceType(typeA) && schema.isSubType(typeA, typeB)) {\n return -1;\n }\n\n if (isInterfaceType(typeB) && schema.isSubType(typeB, typeA)) {\n return 1;\n }\n\n return naturalCompare(typeA.name, typeB.name);\n })\n .map((x) => x.name);\n}\n/**\n * For the field name provided, determine if there are any similar field names\n * that may be the result of a typo.\n */\n\nfunction getSuggestedFieldNames(type, fieldName) {\n if (isObjectType(type) || isInterfaceType(type)) {\n const possibleFieldNames = Object.keys(type.getFields());\n return suggestionList(fieldName, possibleFieldNames);\n } // Otherwise, must be a Union type, which does not define fields.\n\n return [];\n}\n", "import { GraphQLError } from '../../error/GraphQLError.mjs';\nimport { print } from '../../language/printer.mjs';\nimport { isCompositeType } from '../../type/definition.mjs';\nimport { typeFromAST } from '../../utilities/typeFromAST.mjs';\n\n/**\n * Fragments on composite type\n *\n * Fragments use a type condition to determine if they apply, since fragments\n * can only be spread into a composite type (object, interface, or union), the\n * type condition must also be a composite type.\n *\n * See https://spec.graphql.org/draft/#sec-Fragments-On-Composite-Types\n */\nexport function FragmentsOnCompositeTypesRule(context) {\n return {\n InlineFragment(node) {\n const typeCondition = node.typeCondition;\n\n if (typeCondition) {\n const type = typeFromAST(context.getSchema(), typeCondition);\n\n if (type && !isCompositeType(type)) {\n const typeStr = print(typeCondition);\n context.reportError(\n new GraphQLError(\n `Fragment cannot condition on non composite type \"${typeStr}\".`,\n {\n nodes: typeCondition,\n },\n ),\n );\n }\n }\n },\n\n FragmentDefinition(node) {\n const type = typeFromAST(context.getSchema(), node.typeCondition);\n\n if (type && !isCompositeType(type)) {\n const typeStr = print(node.typeCondition);\n context.reportError(\n new GraphQLError(\n `Fragment \"${node.name.value}\" cannot condition on non composite type \"${typeStr}\".`,\n {\n nodes: node.typeCondition,\n },\n ),\n );\n }\n },\n };\n}\n", "import { didYouMean } from '../../jsutils/didYouMean.mjs';\nimport { suggestionList } from '../../jsutils/suggestionList.mjs';\nimport { GraphQLError } from '../../error/GraphQLError.mjs';\nimport { Kind } from '../../language/kinds.mjs';\nimport { specifiedDirectives } from '../../type/directives.mjs';\n\n/**\n * Known argument names\n *\n * A GraphQL field is only valid if all supplied arguments are defined by\n * that field.\n *\n * See https://spec.graphql.org/draft/#sec-Argument-Names\n * See https://spec.graphql.org/draft/#sec-Directives-Are-In-Valid-Locations\n */\nexport function KnownArgumentNamesRule(context) {\n return {\n // eslint-disable-next-line new-cap\n ...KnownArgumentNamesOnDirectivesRule(context),\n\n Argument(argNode) {\n const argDef = context.getArgument();\n const fieldDef = context.getFieldDef();\n const parentType = context.getParentType();\n\n if (!argDef && fieldDef && parentType) {\n const argName = argNode.name.value;\n const knownArgsNames = fieldDef.args.map((arg) => arg.name);\n const suggestions = suggestionList(argName, knownArgsNames);\n context.reportError(\n new GraphQLError(\n `Unknown argument \"${argName}\" on field \"${parentType.name}.${fieldDef.name}\".` +\n didYouMean(suggestions),\n {\n nodes: argNode,\n },\n ),\n );\n }\n },\n };\n}\n/**\n * @internal\n */\n\nexport function KnownArgumentNamesOnDirectivesRule(context) {\n const directiveArgs = Object.create(null);\n const schema = context.getSchema();\n const definedDirectives = schema\n ? schema.getDirectives()\n : specifiedDirectives;\n\n for (const directive of definedDirectives) {\n directiveArgs[directive.name] = directive.args.map((arg) => arg.name);\n }\n\n const astDefinitions = context.getDocument().definitions;\n\n for (const def of astDefinitions) {\n if (def.kind === Kind.DIRECTIVE_DEFINITION) {\n var _def$arguments;\n\n // FIXME: https://github.com/graphql/graphql-js/issues/2203\n\n /* c8 ignore next */\n const argsNodes =\n (_def$arguments = def.arguments) !== null && _def$arguments !== void 0\n ? _def$arguments\n : [];\n directiveArgs[def.name.value] = argsNodes.map((arg) => arg.name.value);\n }\n }\n\n return {\n Directive(directiveNode) {\n const directiveName = directiveNode.name.value;\n const knownArgs = directiveArgs[directiveName];\n\n if (directiveNode.arguments && knownArgs) {\n for (const argNode of directiveNode.arguments) {\n const argName = argNode.name.value;\n\n if (!knownArgs.includes(argName)) {\n const suggestions = suggestionList(argName, knownArgs);\n context.reportError(\n new GraphQLError(\n `Unknown argument \"${argName}\" on directive \"@${directiveName}\".` +\n didYouMean(suggestions),\n {\n nodes: argNode,\n },\n ),\n );\n }\n }\n }\n\n return false;\n },\n };\n}\n", "import { inspect } from '../../jsutils/inspect.mjs';\nimport { invariant } from '../../jsutils/invariant.mjs';\nimport { GraphQLError } from '../../error/GraphQLError.mjs';\nimport { OperationTypeNode } from '../../language/ast.mjs';\nimport { DirectiveLocation } from '../../language/directiveLocation.mjs';\nimport { Kind } from '../../language/kinds.mjs';\nimport { specifiedDirectives } from '../../type/directives.mjs';\n\n/**\n * Known directives\n *\n * A GraphQL document is only valid if all `@directives` are known by the\n * schema and legally positioned.\n *\n * See https://spec.graphql.org/draft/#sec-Directives-Are-Defined\n */\nexport function KnownDirectivesRule(context) {\n const locationsMap = Object.create(null);\n const schema = context.getSchema();\n const definedDirectives = schema\n ? schema.getDirectives()\n : specifiedDirectives;\n\n for (const directive of definedDirectives) {\n locationsMap[directive.name] = directive.locations;\n }\n\n const astDefinitions = context.getDocument().definitions;\n\n for (const def of astDefinitions) {\n if (def.kind === Kind.DIRECTIVE_DEFINITION) {\n locationsMap[def.name.value] = def.locations.map((name) => name.value);\n }\n }\n\n return {\n Directive(node, _key, _parent, _path, ancestors) {\n const name = node.name.value;\n const locations = locationsMap[name];\n\n if (!locations) {\n context.reportError(\n new GraphQLError(`Unknown directive \"@${name}\".`, {\n nodes: node,\n }),\n );\n return;\n }\n\n const candidateLocation = getDirectiveLocationForASTPath(ancestors);\n\n if (candidateLocation && !locations.includes(candidateLocation)) {\n context.reportError(\n new GraphQLError(\n `Directive \"@${name}\" may not be used on ${candidateLocation}.`,\n {\n nodes: node,\n },\n ),\n );\n }\n },\n };\n}\n\nfunction getDirectiveLocationForASTPath(ancestors) {\n const appliedTo = ancestors[ancestors.length - 1];\n 'kind' in appliedTo || invariant(false);\n\n switch (appliedTo.kind) {\n case Kind.OPERATION_DEFINITION:\n return getDirectiveLocationForOperation(appliedTo.operation);\n\n case Kind.FIELD:\n return DirectiveLocation.FIELD;\n\n case Kind.FRAGMENT_SPREAD:\n return DirectiveLocation.FRAGMENT_SPREAD;\n\n case Kind.INLINE_FRAGMENT:\n return DirectiveLocation.INLINE_FRAGMENT;\n\n case Kind.FRAGMENT_DEFINITION:\n return DirectiveLocation.FRAGMENT_DEFINITION;\n\n case Kind.VARIABLE_DEFINITION:\n return DirectiveLocation.VARIABLE_DEFINITION;\n\n case Kind.SCHEMA_DEFINITION:\n case Kind.SCHEMA_EXTENSION:\n return DirectiveLocation.SCHEMA;\n\n case Kind.SCALAR_TYPE_DEFINITION:\n case Kind.SCALAR_TYPE_EXTENSION:\n return DirectiveLocation.SCALAR;\n\n case Kind.OBJECT_TYPE_DEFINITION:\n case Kind.OBJECT_TYPE_EXTENSION:\n return DirectiveLocation.OBJECT;\n\n case Kind.FIELD_DEFINITION:\n return DirectiveLocation.FIELD_DEFINITION;\n\n case Kind.INTERFACE_TYPE_DEFINITION:\n case Kind.INTERFACE_TYPE_EXTENSION:\n return DirectiveLocation.INTERFACE;\n\n case Kind.UNION_TYPE_DEFINITION:\n case Kind.UNION_TYPE_EXTENSION:\n return DirectiveLocation.UNION;\n\n case Kind.ENUM_TYPE_DEFINITION:\n case Kind.ENUM_TYPE_EXTENSION:\n return DirectiveLocation.ENUM;\n\n case Kind.ENUM_VALUE_DEFINITION:\n return DirectiveLocation.ENUM_VALUE;\n\n case Kind.INPUT_OBJECT_TYPE_DEFINITION:\n case Kind.INPUT_OBJECT_TYPE_EXTENSION:\n return DirectiveLocation.INPUT_OBJECT;\n\n case Kind.INPUT_VALUE_DEFINITION: {\n const parentNode = ancestors[ancestors.length - 3];\n 'kind' in parentNode || invariant(false);\n return parentNode.kind === Kind.INPUT_OBJECT_TYPE_DEFINITION\n ? DirectiveLocation.INPUT_FIELD_DEFINITION\n : DirectiveLocation.ARGUMENT_DEFINITION;\n }\n // Not reachable, all possible types have been considered.\n\n /* c8 ignore next */\n\n default:\n false || invariant(false, 'Unexpected kind: ' + inspect(appliedTo.kind));\n }\n}\n\nfunction getDirectiveLocationForOperation(operation) {\n switch (operation) {\n case OperationTypeNode.QUERY:\n return DirectiveLocation.QUERY;\n\n case OperationTypeNode.MUTATION:\n return DirectiveLocation.MUTATION;\n\n case OperationTypeNode.SUBSCRIPTION:\n return DirectiveLocation.SUBSCRIPTION;\n }\n}\n", "import { GraphQLError } from '../../error/GraphQLError.mjs';\n\n/**\n * Known fragment names\n *\n * A GraphQL document is only valid if all `...Fragment` fragment spreads refer\n * to fragments defined in the same document.\n *\n * See https://spec.graphql.org/draft/#sec-Fragment-spread-target-defined\n */\nexport function KnownFragmentNamesRule(context) {\n return {\n FragmentSpread(node) {\n const fragmentName = node.name.value;\n const fragment = context.getFragment(fragmentName);\n\n if (!fragment) {\n context.reportError(\n new GraphQLError(`Unknown fragment \"${fragmentName}\".`, {\n nodes: node.name,\n }),\n );\n }\n },\n };\n}\n", "import { didYouMean } from '../../jsutils/didYouMean.mjs';\nimport { suggestionList } from '../../jsutils/suggestionList.mjs';\nimport { GraphQLError } from '../../error/GraphQLError.mjs';\nimport {\n isTypeDefinitionNode,\n isTypeSystemDefinitionNode,\n isTypeSystemExtensionNode,\n} from '../../language/predicates.mjs';\nimport { introspectionTypes } from '../../type/introspection.mjs';\nimport { specifiedScalarTypes } from '../../type/scalars.mjs';\n\n/**\n * Known type names\n *\n * A GraphQL document is only valid if referenced types (specifically\n * variable definitions and fragment conditions) are defined by the type schema.\n *\n * See https://spec.graphql.org/draft/#sec-Fragment-Spread-Type-Existence\n */\nexport function KnownTypeNamesRule(context) {\n const schema = context.getSchema();\n const existingTypesMap = schema ? schema.getTypeMap() : Object.create(null);\n const definedTypes = Object.create(null);\n\n for (const def of context.getDocument().definitions) {\n if (isTypeDefinitionNode(def)) {\n definedTypes[def.name.value] = true;\n }\n }\n\n const typeNames = [\n ...Object.keys(existingTypesMap),\n ...Object.keys(definedTypes),\n ];\n return {\n NamedType(node, _1, parent, _2, ancestors) {\n const typeName = node.name.value;\n\n if (!existingTypesMap[typeName] && !definedTypes[typeName]) {\n var _ancestors$;\n\n const definitionNode =\n (_ancestors$ = ancestors[2]) !== null && _ancestors$ !== void 0\n ? _ancestors$\n : parent;\n const isSDL = definitionNode != null && isSDLNode(definitionNode);\n\n if (isSDL && standardTypeNames.includes(typeName)) {\n return;\n }\n\n const suggestedTypes = suggestionList(\n typeName,\n isSDL ? standardTypeNames.concat(typeNames) : typeNames,\n );\n context.reportError(\n new GraphQLError(\n `Unknown type \"${typeName}\".` + didYouMean(suggestedTypes),\n {\n nodes: node,\n },\n ),\n );\n }\n },\n };\n}\nconst standardTypeNames = [...specifiedScalarTypes, ...introspectionTypes].map(\n (type) => type.name,\n);\n\nfunction isSDLNode(value) {\n return (\n 'kind' in value &&\n (isTypeSystemDefinitionNode(value) || isTypeSystemExtensionNode(value))\n );\n}\n", "import { GraphQLError } from '../../error/GraphQLError.mjs';\nimport { Kind } from '../../language/kinds.mjs';\n\n/**\n * Lone anonymous operation\n *\n * A GraphQL document is only valid if when it contains an anonymous operation\n * (the query short-hand) that it contains only that one operation definition.\n *\n * See https://spec.graphql.org/draft/#sec-Lone-Anonymous-Operation\n */\nexport function LoneAnonymousOperationRule(context) {\n let operationCount = 0;\n return {\n Document(node) {\n operationCount = node.definitions.filter(\n (definition) => definition.kind === Kind.OPERATION_DEFINITION,\n ).length;\n },\n\n OperationDefinition(node) {\n if (!node.name && operationCount > 1) {\n context.reportError(\n new GraphQLError(\n 'This anonymous operation must be the only defined operation.',\n {\n nodes: node,\n },\n ),\n );\n }\n },\n };\n}\n", "import { GraphQLError } from '../../error/GraphQLError.mjs';\n\n/**\n * Lone Schema definition\n *\n * A GraphQL document is only valid if it contains only one schema definition.\n */\nexport function LoneSchemaDefinitionRule(context) {\n var _ref, _ref2, _oldSchema$astNode;\n\n const oldSchema = context.getSchema();\n const alreadyDefined =\n (_ref =\n (_ref2 =\n (_oldSchema$astNode =\n oldSchema === null || oldSchema === void 0\n ? void 0\n : oldSchema.astNode) !== null && _oldSchema$astNode !== void 0\n ? _oldSchema$astNode\n : oldSchema === null || oldSchema === void 0\n ? void 0\n : oldSchema.getQueryType()) !== null && _ref2 !== void 0\n ? _ref2\n : oldSchema === null || oldSchema === void 0\n ? void 0\n : oldSchema.getMutationType()) !== null && _ref !== void 0\n ? _ref\n : oldSchema === null || oldSchema === void 0\n ? void 0\n : oldSchema.getSubscriptionType();\n let schemaDefinitionsCount = 0;\n return {\n SchemaDefinition(node) {\n if (alreadyDefined) {\n context.reportError(\n new GraphQLError(\n 'Cannot define a new schema within a schema extension.',\n {\n nodes: node,\n },\n ),\n );\n return;\n }\n\n if (schemaDefinitionsCount > 0) {\n context.reportError(\n new GraphQLError('Must provide only one schema definition.', {\n nodes: node,\n }),\n );\n }\n\n ++schemaDefinitionsCount;\n },\n };\n}\n", "import { GraphQLError } from '../../error/GraphQLError.mjs';\nimport { Kind } from '../../language/kinds.mjs';\nconst MAX_LISTS_DEPTH = 3;\nexport function MaxIntrospectionDepthRule(context) {\n /**\n * Counts the depth of list fields in \"__Type\" recursively and\n * returns `true` if the limit has been reached.\n */\n function checkDepth(node, visitedFragments = Object.create(null), depth = 0) {\n if (node.kind === Kind.FRAGMENT_SPREAD) {\n const fragmentName = node.name.value;\n\n if (visitedFragments[fragmentName] === true) {\n // Fragment cycles are handled by `NoFragmentCyclesRule`.\n return false;\n }\n\n const fragment = context.getFragment(fragmentName);\n\n if (!fragment) {\n // Missing fragments checks are handled by `KnownFragmentNamesRule`.\n return false;\n } // Rather than following an immutable programming pattern which has\n // significant memory and garbage collection overhead, we've opted to\n // take a mutable approach for efficiency's sake. Importantly visiting a\n // fragment twice is fine, so long as you don't do one visit inside the\n // other.\n\n try {\n visitedFragments[fragmentName] = true;\n return checkDepth(fragment, visitedFragments, depth);\n } finally {\n visitedFragments[fragmentName] = undefined;\n }\n }\n\n if (\n node.kind === Kind.FIELD && // check all introspection lists\n (node.name.value === 'fields' ||\n node.name.value === 'interfaces' ||\n node.name.value === 'possibleTypes' ||\n node.name.value === 'inputFields')\n ) {\n // eslint-disable-next-line no-param-reassign\n depth++;\n\n if (depth >= MAX_LISTS_DEPTH) {\n return true;\n }\n } // handles fields and inline fragments\n\n if ('selectionSet' in node && node.selectionSet) {\n for (const child of node.selectionSet.selections) {\n if (checkDepth(child, visitedFragments, depth)) {\n return true;\n }\n }\n }\n\n return false;\n }\n\n return {\n Field(node) {\n if (node.name.value === '__schema' || node.name.value === '__type') {\n if (checkDepth(node)) {\n context.reportError(\n new GraphQLError('Maximum introspection depth exceeded', {\n nodes: [node],\n }),\n );\n return false;\n }\n }\n },\n };\n}\n", "import { GraphQLError } from '../../error/GraphQLError.mjs';\n\n/**\n * No fragment cycles\n *\n * The graph of fragment spreads must not form any cycles including spreading itself.\n * Otherwise an operation could infinitely spread or infinitely execute on cycles in the underlying data.\n *\n * See https://spec.graphql.org/draft/#sec-Fragment-spreads-must-not-form-cycles\n */\nexport function NoFragmentCyclesRule(context) {\n // Tracks already visited fragments to maintain O(N) and to ensure that cycles\n // are not redundantly reported.\n const visitedFrags = Object.create(null); // Array of AST nodes used to produce meaningful errors\n\n const spreadPath = []; // Position in the spread path\n\n const spreadPathIndexByName = Object.create(null);\n return {\n OperationDefinition: () => false,\n\n FragmentDefinition(node) {\n detectCycleRecursive(node);\n return false;\n },\n }; // This does a straight-forward DFS to find cycles.\n // It does not terminate when a cycle was found but continues to explore\n // the graph to find all possible cycles.\n\n function detectCycleRecursive(fragment) {\n if (visitedFrags[fragment.name.value]) {\n return;\n }\n\n const fragmentName = fragment.name.value;\n visitedFrags[fragmentName] = true;\n const spreadNodes = context.getFragmentSpreads(fragment.selectionSet);\n\n if (spreadNodes.length === 0) {\n return;\n }\n\n spreadPathIndexByName[fragmentName] = spreadPath.length;\n\n for (const spreadNode of spreadNodes) {\n const spreadName = spreadNode.name.value;\n const cycleIndex = spreadPathIndexByName[spreadName];\n spreadPath.push(spreadNode);\n\n if (cycleIndex === undefined) {\n const spreadFragment = context.getFragment(spreadName);\n\n if (spreadFragment) {\n detectCycleRecursive(spreadFragment);\n }\n } else {\n const cyclePath = spreadPath.slice(cycleIndex);\n const viaPath = cyclePath\n .slice(0, -1)\n .map((s) => '\"' + s.name.value + '\"')\n .join(', ');\n context.reportError(\n new GraphQLError(\n `Cannot spread fragment \"${spreadName}\" within itself` +\n (viaPath !== '' ? ` via ${viaPath}.` : '.'),\n {\n nodes: cyclePath,\n },\n ),\n );\n }\n\n spreadPath.pop();\n }\n\n spreadPathIndexByName[fragmentName] = undefined;\n }\n}\n", "import { GraphQLError } from '../../error/GraphQLError.mjs';\n\n/**\n * No undefined variables\n *\n * A GraphQL operation is only valid if all variables encountered, both directly\n * and via fragment spreads, are defined by that operation.\n *\n * See https://spec.graphql.org/draft/#sec-All-Variable-Uses-Defined\n */\nexport function NoUndefinedVariablesRule(context) {\n let variableNameDefined = Object.create(null);\n return {\n OperationDefinition: {\n enter() {\n variableNameDefined = Object.create(null);\n },\n\n leave(operation) {\n const usages = context.getRecursiveVariableUsages(operation);\n\n for (const { node } of usages) {\n const varName = node.name.value;\n\n if (variableNameDefined[varName] !== true) {\n context.reportError(\n new GraphQLError(\n operation.name\n ? `Variable \"$${varName}\" is not defined by operation \"${operation.name.value}\".`\n : `Variable \"$${varName}\" is not defined.`,\n {\n nodes: [node, operation],\n },\n ),\n );\n }\n }\n },\n },\n\n VariableDefinition(node) {\n variableNameDefined[node.variable.name.value] = true;\n },\n };\n}\n", "import { GraphQLError } from '../../error/GraphQLError.mjs';\n\n/**\n * No unused fragments\n *\n * A GraphQL document is only valid if all fragment definitions are spread\n * within operations, or spread within other fragments spread within operations.\n *\n * See https://spec.graphql.org/draft/#sec-Fragments-Must-Be-Used\n */\nexport function NoUnusedFragmentsRule(context) {\n const operationDefs = [];\n const fragmentDefs = [];\n return {\n OperationDefinition(node) {\n operationDefs.push(node);\n return false;\n },\n\n FragmentDefinition(node) {\n fragmentDefs.push(node);\n return false;\n },\n\n Document: {\n leave() {\n const fragmentNameUsed = Object.create(null);\n\n for (const operation of operationDefs) {\n for (const fragment of context.getRecursivelyReferencedFragments(\n operation,\n )) {\n fragmentNameUsed[fragment.name.value] = true;\n }\n }\n\n for (const fragmentDef of fragmentDefs) {\n const fragName = fragmentDef.name.value;\n\n if (fragmentNameUsed[fragName] !== true) {\n context.reportError(\n new GraphQLError(`Fragment \"${fragName}\" is never used.`, {\n nodes: fragmentDef,\n }),\n );\n }\n }\n },\n },\n };\n}\n", "import { GraphQLError } from '../../error/GraphQLError.mjs';\n\n/**\n * No unused variables\n *\n * A GraphQL operation is only valid if all variables defined by an operation\n * are used, either directly or within a spread fragment.\n *\n * See https://spec.graphql.org/draft/#sec-All-Variables-Used\n */\nexport function NoUnusedVariablesRule(context) {\n let variableDefs = [];\n return {\n OperationDefinition: {\n enter() {\n variableDefs = [];\n },\n\n leave(operation) {\n const variableNameUsed = Object.create(null);\n const usages = context.getRecursiveVariableUsages(operation);\n\n for (const { node } of usages) {\n variableNameUsed[node.name.value] = true;\n }\n\n for (const variableDef of variableDefs) {\n const variableName = variableDef.variable.name.value;\n\n if (variableNameUsed[variableName] !== true) {\n context.reportError(\n new GraphQLError(\n operation.name\n ? `Variable \"$${variableName}\" is never used in operation \"${operation.name.value}\".`\n : `Variable \"$${variableName}\" is never used.`,\n {\n nodes: variableDef,\n },\n ),\n );\n }\n }\n },\n },\n\n VariableDefinition(def) {\n variableDefs.push(def);\n },\n };\n}\n", "import { naturalCompare } from '../jsutils/naturalCompare.mjs';\nimport { Kind } from '../language/kinds.mjs';\n/**\n * Sort ValueNode.\n *\n * This function returns a sorted copy of the given ValueNode.\n *\n * @internal\n */\n\nexport function sortValueNode(valueNode) {\n switch (valueNode.kind) {\n case Kind.OBJECT:\n return { ...valueNode, fields: sortFields(valueNode.fields) };\n\n case Kind.LIST:\n return { ...valueNode, values: valueNode.values.map(sortValueNode) };\n\n case Kind.INT:\n case Kind.FLOAT:\n case Kind.STRING:\n case Kind.BOOLEAN:\n case Kind.NULL:\n case Kind.ENUM:\n case Kind.VARIABLE:\n return valueNode;\n }\n}\n\nfunction sortFields(fields) {\n return fields\n .map((fieldNode) => ({\n ...fieldNode,\n value: sortValueNode(fieldNode.value),\n }))\n .sort((fieldA, fieldB) =>\n naturalCompare(fieldA.name.value, fieldB.name.value),\n );\n}\n", "import { inspect } from '../../jsutils/inspect.mjs';\nimport { GraphQLError } from '../../error/GraphQLError.mjs';\nimport { Kind } from '../../language/kinds.mjs';\nimport { print } from '../../language/printer.mjs';\nimport {\n getNamedType,\n isInterfaceType,\n isLeafType,\n isListType,\n isNonNullType,\n isObjectType,\n} from '../../type/definition.mjs';\nimport { sortValueNode } from '../../utilities/sortValueNode.mjs';\nimport { typeFromAST } from '../../utilities/typeFromAST.mjs';\n\nfunction reasonMessage(reason) {\n if (Array.isArray(reason)) {\n return reason\n .map(\n ([responseName, subReason]) =>\n `subfields \"${responseName}\" conflict because ` +\n reasonMessage(subReason),\n )\n .join(' and ');\n }\n\n return reason;\n}\n/**\n * Overlapping fields can be merged\n *\n * A selection set is only valid if all fields (including spreading any\n * fragments) either correspond to distinct response names or can be merged\n * without ambiguity.\n *\n * See https://spec.graphql.org/draft/#sec-Field-Selection-Merging\n */\n\nexport function OverlappingFieldsCanBeMergedRule(context) {\n // A memoization for when fields and a fragment or two fragments are compared\n // \"between\" each other for conflicts. Comparisons made be made many times,\n // so memoizing this can dramatically improve the performance of this validator.\n const comparedFieldsAndFragmentPairs = new OrderedPairSet();\n const comparedFragmentPairs = new PairSet(); // A cache for the \"field map\" and list of fragment names found in any given\n // selection set. Selection sets may be asked for this information multiple\n // times, so this improves the performance of this validator.\n\n const cachedFieldsAndFragmentNames = new Map();\n return {\n SelectionSet(selectionSet) {\n const conflicts = findConflictsWithinSelectionSet(\n context,\n cachedFieldsAndFragmentNames,\n comparedFieldsAndFragmentPairs,\n comparedFragmentPairs,\n context.getParentType(),\n selectionSet,\n );\n\n for (const [[responseName, reason], fields1, fields2] of conflicts) {\n const reasonMsg = reasonMessage(reason);\n context.reportError(\n new GraphQLError(\n `Fields \"${responseName}\" conflict because ${reasonMsg}. Use different aliases on the fields to fetch both if this was intentional.`,\n {\n nodes: fields1.concat(fields2),\n },\n ),\n );\n }\n },\n };\n}\n\n/**\n * Algorithm:\n *\n * Conflicts occur when two fields exist in a query which will produce the same\n * response name, but represent differing values, thus creating a conflict.\n * The algorithm below finds all conflicts via making a series of comparisons\n * between fields. In order to compare as few fields as possible, this makes\n * a series of comparisons \"within\" sets of fields and \"between\" sets of fields.\n *\n * Given any selection set, a collection produces both a set of fields by\n * also including all inline fragments, as well as a list of fragments\n * referenced by fragment spreads.\n *\n * A) Each selection set represented in the document first compares \"within\" its\n * collected set of fields, finding any conflicts between every pair of\n * overlapping fields.\n * Note: This is the *only time* that a the fields \"within\" a set are compared\n * to each other. After this only fields \"between\" sets are compared.\n *\n * B) Also, if any fragment is referenced in a selection set, then a\n * comparison is made \"between\" the original set of fields and the\n * referenced fragment.\n *\n * C) Also, if multiple fragments are referenced, then comparisons\n * are made \"between\" each referenced fragment.\n *\n * D) When comparing \"between\" a set of fields and a referenced fragment, first\n * a comparison is made between each field in the original set of fields and\n * each field in the the referenced set of fields.\n *\n * E) Also, if any fragment is referenced in the referenced selection set,\n * then a comparison is made \"between\" the original set of fields and the\n * referenced fragment (recursively referring to step D).\n *\n * F) When comparing \"between\" two fragments, first a comparison is made between\n * each field in the first referenced set of fields and each field in the the\n * second referenced set of fields.\n *\n * G) Also, any fragments referenced by the first must be compared to the\n * second, and any fragments referenced by the second must be compared to the\n * first (recursively referring to step F).\n *\n * H) When comparing two fields, if both have selection sets, then a comparison\n * is made \"between\" both selection sets, first comparing the set of fields in\n * the first selection set with the set of fields in the second.\n *\n * I) Also, if any fragment is referenced in either selection set, then a\n * comparison is made \"between\" the other set of fields and the\n * referenced fragment.\n *\n * J) Also, if two fragments are referenced in both selection sets, then a\n * comparison is made \"between\" the two fragments.\n *\n */\n// Find all conflicts found \"within\" a selection set, including those found\n// via spreading in fragments. Called when visiting each SelectionSet in the\n// GraphQL Document.\nfunction findConflictsWithinSelectionSet(\n context,\n cachedFieldsAndFragmentNames,\n comparedFieldsAndFragmentPairs,\n comparedFragmentPairs,\n parentType,\n selectionSet,\n) {\n const conflicts = [];\n const [fieldMap, fragmentNames] = getFieldsAndFragmentNames(\n context,\n cachedFieldsAndFragmentNames,\n parentType,\n selectionSet,\n ); // (A) Find find all conflicts \"within\" the fields of this selection set.\n // Note: this is the *only place* `collectConflictsWithin` is called.\n\n collectConflictsWithin(\n context,\n conflicts,\n cachedFieldsAndFragmentNames,\n comparedFieldsAndFragmentPairs,\n comparedFragmentPairs,\n fieldMap,\n );\n\n if (fragmentNames.length !== 0) {\n // (B) Then collect conflicts between these fields and those represented by\n // each spread fragment name found.\n for (let i = 0; i < fragmentNames.length; i++) {\n collectConflictsBetweenFieldsAndFragment(\n context,\n conflicts,\n cachedFieldsAndFragmentNames,\n comparedFieldsAndFragmentPairs,\n comparedFragmentPairs,\n false,\n fieldMap,\n fragmentNames[i],\n ); // (C) Then compare this fragment with all other fragments found in this\n // selection set to collect conflicts between fragments spread together.\n // This compares each item in the list of fragment names to every other\n // item in that same list (except for itself).\n\n for (let j = i + 1; j < fragmentNames.length; j++) {\n collectConflictsBetweenFragments(\n context,\n conflicts,\n cachedFieldsAndFragmentNames,\n comparedFieldsAndFragmentPairs,\n comparedFragmentPairs,\n false,\n fragmentNames[i],\n fragmentNames[j],\n );\n }\n }\n }\n\n return conflicts;\n} // Collect all conflicts found between a set of fields and a fragment reference\n// including via spreading in any nested fragments.\n\nfunction collectConflictsBetweenFieldsAndFragment(\n context,\n conflicts,\n cachedFieldsAndFragmentNames,\n comparedFieldsAndFragmentPairs,\n comparedFragmentPairs,\n areMutuallyExclusive,\n fieldMap,\n fragmentName,\n) {\n // Memoize so the fields and fragments are not compared for conflicts more\n // than once.\n if (\n comparedFieldsAndFragmentPairs.has(\n fieldMap,\n fragmentName,\n areMutuallyExclusive,\n )\n ) {\n return;\n }\n\n comparedFieldsAndFragmentPairs.add(\n fieldMap,\n fragmentName,\n areMutuallyExclusive,\n );\n const fragment = context.getFragment(fragmentName);\n\n if (!fragment) {\n return;\n }\n\n const [fieldMap2, referencedFragmentNames] =\n getReferencedFieldsAndFragmentNames(\n context,\n cachedFieldsAndFragmentNames,\n fragment,\n ); // Do not compare a fragment's fieldMap to itself.\n\n if (fieldMap === fieldMap2) {\n return;\n } // (D) First collect any conflicts between the provided collection of fields\n // and the collection of fields represented by the given fragment.\n\n collectConflictsBetween(\n context,\n conflicts,\n cachedFieldsAndFragmentNames,\n comparedFieldsAndFragmentPairs,\n comparedFragmentPairs,\n areMutuallyExclusive,\n fieldMap,\n fieldMap2,\n ); // (E) Then collect any conflicts between the provided collection of fields\n // and any fragment names found in the given fragment.\n\n for (const referencedFragmentName of referencedFragmentNames) {\n collectConflictsBetweenFieldsAndFragment(\n context,\n conflicts,\n cachedFieldsAndFragmentNames,\n comparedFieldsAndFragmentPairs,\n comparedFragmentPairs,\n areMutuallyExclusive,\n fieldMap,\n referencedFragmentName,\n );\n }\n} // Collect all conflicts found between two fragments, including via spreading in\n// any nested fragments.\n\nfunction collectConflictsBetweenFragments(\n context,\n conflicts,\n cachedFieldsAndFragmentNames,\n comparedFieldsAndFragmentPairs,\n comparedFragmentPairs,\n areMutuallyExclusive,\n fragmentName1,\n fragmentName2,\n) {\n // No need to compare a fragment to itself.\n if (fragmentName1 === fragmentName2) {\n return;\n } // Memoize so two fragments are not compared for conflicts more than once.\n\n if (\n comparedFragmentPairs.has(\n fragmentName1,\n fragmentName2,\n areMutuallyExclusive,\n )\n ) {\n return;\n }\n\n comparedFragmentPairs.add(fragmentName1, fragmentName2, areMutuallyExclusive);\n const fragment1 = context.getFragment(fragmentName1);\n const fragment2 = context.getFragment(fragmentName2);\n\n if (!fragment1 || !fragment2) {\n return;\n }\n\n const [fieldMap1, referencedFragmentNames1] =\n getReferencedFieldsAndFragmentNames(\n context,\n cachedFieldsAndFragmentNames,\n fragment1,\n );\n const [fieldMap2, referencedFragmentNames2] =\n getReferencedFieldsAndFragmentNames(\n context,\n cachedFieldsAndFragmentNames,\n fragment2,\n ); // (F) First, collect all conflicts between these two collections of fields\n // (not including any nested fragments).\n\n collectConflictsBetween(\n context,\n conflicts,\n cachedFieldsAndFragmentNames,\n comparedFieldsAndFragmentPairs,\n comparedFragmentPairs,\n areMutuallyExclusive,\n fieldMap1,\n fieldMap2,\n ); // (G) Then collect conflicts between the first fragment and any nested\n // fragments spread in the second fragment.\n\n for (const referencedFragmentName2 of referencedFragmentNames2) {\n collectConflictsBetweenFragments(\n context,\n conflicts,\n cachedFieldsAndFragmentNames,\n comparedFieldsAndFragmentPairs,\n comparedFragmentPairs,\n areMutuallyExclusive,\n fragmentName1,\n referencedFragmentName2,\n );\n } // (G) Then collect conflicts between the second fragment and any nested\n // fragments spread in the first fragment.\n\n for (const referencedFragmentName1 of referencedFragmentNames1) {\n collectConflictsBetweenFragments(\n context,\n conflicts,\n cachedFieldsAndFragmentNames,\n comparedFieldsAndFragmentPairs,\n comparedFragmentPairs,\n areMutuallyExclusive,\n referencedFragmentName1,\n fragmentName2,\n );\n }\n} // Find all conflicts found between two selection sets, including those found\n// via spreading in fragments. Called when determining if conflicts exist\n// between the sub-fields of two overlapping fields.\n\nfunction findConflictsBetweenSubSelectionSets(\n context,\n cachedFieldsAndFragmentNames,\n comparedFieldsAndFragmentPairs,\n comparedFragmentPairs,\n areMutuallyExclusive,\n parentType1,\n selectionSet1,\n parentType2,\n selectionSet2,\n) {\n const conflicts = [];\n const [fieldMap1, fragmentNames1] = getFieldsAndFragmentNames(\n context,\n cachedFieldsAndFragmentNames,\n parentType1,\n selectionSet1,\n );\n const [fieldMap2, fragmentNames2] = getFieldsAndFragmentNames(\n context,\n cachedFieldsAndFragmentNames,\n parentType2,\n selectionSet2,\n ); // (H) First, collect all conflicts between these two collections of field.\n\n collectConflictsBetween(\n context,\n conflicts,\n cachedFieldsAndFragmentNames,\n comparedFieldsAndFragmentPairs,\n comparedFragmentPairs,\n areMutuallyExclusive,\n fieldMap1,\n fieldMap2,\n ); // (I) Then collect conflicts between the first collection of fields and\n // those referenced by each fragment name associated with the second.\n\n for (const fragmentName2 of fragmentNames2) {\n collectConflictsBetweenFieldsAndFragment(\n context,\n conflicts,\n cachedFieldsAndFragmentNames,\n comparedFieldsAndFragmentPairs,\n comparedFragmentPairs,\n areMutuallyExclusive,\n fieldMap1,\n fragmentName2,\n );\n } // (I) Then collect conflicts between the second collection of fields and\n // those referenced by each fragment name associated with the first.\n\n for (const fragmentName1 of fragmentNames1) {\n collectConflictsBetweenFieldsAndFragment(\n context,\n conflicts,\n cachedFieldsAndFragmentNames,\n comparedFieldsAndFragmentPairs,\n comparedFragmentPairs,\n areMutuallyExclusive,\n fieldMap2,\n fragmentName1,\n );\n } // (J) Also collect conflicts between any fragment names by the first and\n // fragment names by the second. This compares each item in the first set of\n // names to each item in the second set of names.\n\n for (const fragmentName1 of fragmentNames1) {\n for (const fragmentName2 of fragmentNames2) {\n collectConflictsBetweenFragments(\n context,\n conflicts,\n cachedFieldsAndFragmentNames,\n comparedFieldsAndFragmentPairs,\n comparedFragmentPairs,\n areMutuallyExclusive,\n fragmentName1,\n fragmentName2,\n );\n }\n }\n\n return conflicts;\n} // Collect all Conflicts \"within\" one collection of fields.\n\nfunction collectConflictsWithin(\n context,\n conflicts,\n cachedFieldsAndFragmentNames,\n comparedFieldsAndFragmentPairs,\n comparedFragmentPairs,\n fieldMap,\n) {\n // A field map is a keyed collection, where each key represents a response\n // name and the value at that key is a list of all fields which provide that\n // response name. For every response name, if there are multiple fields, they\n // must be compared to find a potential conflict.\n for (const [responseName, fields] of Object.entries(fieldMap)) {\n // This compares every field in the list to every other field in this list\n // (except to itself). If the list only has one item, nothing needs to\n // be compared.\n if (fields.length > 1) {\n for (let i = 0; i < fields.length; i++) {\n for (let j = i + 1; j < fields.length; j++) {\n const conflict = findConflict(\n context,\n cachedFieldsAndFragmentNames,\n comparedFieldsAndFragmentPairs,\n comparedFragmentPairs,\n false, // within one collection is never mutually exclusive\n responseName,\n fields[i],\n fields[j],\n );\n\n if (conflict) {\n conflicts.push(conflict);\n }\n }\n }\n }\n }\n} // Collect all Conflicts between two collections of fields. This is similar to,\n// but different from the `collectConflictsWithin` function above. This check\n// assumes that `collectConflictsWithin` has already been called on each\n// provided collection of fields. This is true because this validator traverses\n// each individual selection set.\n\nfunction collectConflictsBetween(\n context,\n conflicts,\n cachedFieldsAndFragmentNames,\n comparedFieldsAndFragmentPairs,\n comparedFragmentPairs,\n parentFieldsAreMutuallyExclusive,\n fieldMap1,\n fieldMap2,\n) {\n // A field map is a keyed collection, where each key represents a response\n // name and the value at that key is a list of all fields which provide that\n // response name. For any response name which appears in both provided field\n // maps, each field from the first field map must be compared to every field\n // in the second field map to find potential conflicts.\n for (const [responseName, fields1] of Object.entries(fieldMap1)) {\n const fields2 = fieldMap2[responseName];\n\n if (fields2) {\n for (const field1 of fields1) {\n for (const field2 of fields2) {\n const conflict = findConflict(\n context,\n cachedFieldsAndFragmentNames,\n comparedFieldsAndFragmentPairs,\n comparedFragmentPairs,\n parentFieldsAreMutuallyExclusive,\n responseName,\n field1,\n field2,\n );\n\n if (conflict) {\n conflicts.push(conflict);\n }\n }\n }\n }\n }\n} // Determines if there is a conflict between two particular fields, including\n// comparing their sub-fields.\n\nfunction findConflict(\n context,\n cachedFieldsAndFragmentNames,\n comparedFieldsAndFragmentPairs,\n comparedFragmentPairs,\n parentFieldsAreMutuallyExclusive,\n responseName,\n field1,\n field2,\n) {\n const [parentType1, node1, def1] = field1;\n const [parentType2, node2, def2] = field2; // If it is known that two fields could not possibly apply at the same\n // time, due to the parent types, then it is safe to permit them to diverge\n // in aliased field or arguments used as they will not present any ambiguity\n // by differing.\n // It is known that two parent types could never overlap if they are\n // different Object types. Interface or Union types might overlap - if not\n // in the current state of the schema, then perhaps in some future version,\n // thus may not safely diverge.\n\n const areMutuallyExclusive =\n parentFieldsAreMutuallyExclusive ||\n (parentType1 !== parentType2 &&\n isObjectType(parentType1) &&\n isObjectType(parentType2));\n\n if (!areMutuallyExclusive) {\n // Two aliases must refer to the same field.\n const name1 = node1.name.value;\n const name2 = node2.name.value;\n\n if (name1 !== name2) {\n return [\n [responseName, `\"${name1}\" and \"${name2}\" are different fields`],\n [node1],\n [node2],\n ];\n } // Two field calls must have the same arguments.\n\n if (!sameArguments(node1, node2)) {\n return [\n [responseName, 'they have differing arguments'],\n [node1],\n [node2],\n ];\n }\n } // The return type for each field.\n\n const type1 = def1 === null || def1 === void 0 ? void 0 : def1.type;\n const type2 = def2 === null || def2 === void 0 ? void 0 : def2.type;\n\n if (type1 && type2 && doTypesConflict(type1, type2)) {\n return [\n [\n responseName,\n `they return conflicting types \"${inspect(type1)}\" and \"${inspect(\n type2,\n )}\"`,\n ],\n [node1],\n [node2],\n ];\n } // Collect and compare sub-fields. Use the same \"visited fragment names\" list\n // for both collections so fields in a fragment reference are never\n // compared to themselves.\n\n const selectionSet1 = node1.selectionSet;\n const selectionSet2 = node2.selectionSet;\n\n if (selectionSet1 && selectionSet2) {\n const conflicts = findConflictsBetweenSubSelectionSets(\n context,\n cachedFieldsAndFragmentNames,\n comparedFieldsAndFragmentPairs,\n comparedFragmentPairs,\n areMutuallyExclusive,\n getNamedType(type1),\n selectionSet1,\n getNamedType(type2),\n selectionSet2,\n );\n return subfieldConflicts(conflicts, responseName, node1, node2);\n }\n}\n\nfunction sameArguments(node1, node2) {\n const args1 = node1.arguments;\n const args2 = node2.arguments;\n\n if (args1 === undefined || args1.length === 0) {\n return args2 === undefined || args2.length === 0;\n }\n\n if (args2 === undefined || args2.length === 0) {\n return false;\n }\n /* c8 ignore next */\n\n if (args1.length !== args2.length) {\n /* c8 ignore next */\n return false;\n /* c8 ignore next */\n }\n\n const values2 = new Map(args2.map(({ name, value }) => [name.value, value]));\n return args1.every((arg1) => {\n const value1 = arg1.value;\n const value2 = values2.get(arg1.name.value);\n\n if (value2 === undefined) {\n return false;\n }\n\n return stringifyValue(value1) === stringifyValue(value2);\n });\n}\n\nfunction stringifyValue(value) {\n return print(sortValueNode(value));\n} // Two types conflict if both types could not apply to a value simultaneously.\n// Composite types are ignored as their individual field types will be compared\n// later recursively. However List and Non-Null types must match.\n\nfunction doTypesConflict(type1, type2) {\n if (isListType(type1)) {\n return isListType(type2)\n ? doTypesConflict(type1.ofType, type2.ofType)\n : true;\n }\n\n if (isListType(type2)) {\n return true;\n }\n\n if (isNonNullType(type1)) {\n return isNonNullType(type2)\n ? doTypesConflict(type1.ofType, type2.ofType)\n : true;\n }\n\n if (isNonNullType(type2)) {\n return true;\n }\n\n if (isLeafType(type1) || isLeafType(type2)) {\n return type1 !== type2;\n }\n\n return false;\n} // Given a selection set, return the collection of fields (a mapping of response\n// name to field nodes and definitions) as well as a list of fragment names\n// referenced via fragment spreads.\n\nfunction getFieldsAndFragmentNames(\n context,\n cachedFieldsAndFragmentNames,\n parentType,\n selectionSet,\n) {\n const cached = cachedFieldsAndFragmentNames.get(selectionSet);\n\n if (cached) {\n return cached;\n }\n\n const nodeAndDefs = Object.create(null);\n const fragmentNames = Object.create(null);\n\n _collectFieldsAndFragmentNames(\n context,\n parentType,\n selectionSet,\n nodeAndDefs,\n fragmentNames,\n );\n\n const result = [nodeAndDefs, Object.keys(fragmentNames)];\n cachedFieldsAndFragmentNames.set(selectionSet, result);\n return result;\n} // Given a reference to a fragment, return the represented collection of fields\n// as well as a list of nested fragment names referenced via fragment spreads.\n\nfunction getReferencedFieldsAndFragmentNames(\n context,\n cachedFieldsAndFragmentNames,\n fragment,\n) {\n // Short-circuit building a type from the node if possible.\n const cached = cachedFieldsAndFragmentNames.get(fragment.selectionSet);\n\n if (cached) {\n return cached;\n }\n\n const fragmentType = typeFromAST(context.getSchema(), fragment.typeCondition);\n return getFieldsAndFragmentNames(\n context,\n cachedFieldsAndFragmentNames,\n fragmentType,\n fragment.selectionSet,\n );\n}\n\nfunction _collectFieldsAndFragmentNames(\n context,\n parentType,\n selectionSet,\n nodeAndDefs,\n fragmentNames,\n) {\n for (const selection of selectionSet.selections) {\n switch (selection.kind) {\n case Kind.FIELD: {\n const fieldName = selection.name.value;\n let fieldDef;\n\n if (isObjectType(parentType) || isInterfaceType(parentType)) {\n fieldDef = parentType.getFields()[fieldName];\n }\n\n const responseName = selection.alias\n ? selection.alias.value\n : fieldName;\n\n if (!nodeAndDefs[responseName]) {\n nodeAndDefs[responseName] = [];\n }\n\n nodeAndDefs[responseName].push([parentType, selection, fieldDef]);\n break;\n }\n\n case Kind.FRAGMENT_SPREAD:\n fragmentNames[selection.name.value] = true;\n break;\n\n case Kind.INLINE_FRAGMENT: {\n const typeCondition = selection.typeCondition;\n const inlineFragmentType = typeCondition\n ? typeFromAST(context.getSchema(), typeCondition)\n : parentType;\n\n _collectFieldsAndFragmentNames(\n context,\n inlineFragmentType,\n selection.selectionSet,\n nodeAndDefs,\n fragmentNames,\n );\n\n break;\n }\n }\n }\n} // Given a series of Conflicts which occurred between two sub-fields, generate\n// a single Conflict.\n\nfunction subfieldConflicts(conflicts, responseName, node1, node2) {\n if (conflicts.length > 0) {\n return [\n [responseName, conflicts.map(([reason]) => reason)],\n [node1, ...conflicts.map(([, fields1]) => fields1).flat()],\n [node2, ...conflicts.map(([, , fields2]) => fields2).flat()],\n ];\n }\n}\n/**\n * A way to keep track of pairs of things where the ordering of the pair\n * matters.\n *\n * Provides a third argument for has/set to allow flagging the pair as\n * weakly or strongly present within the collection.\n */\n\nclass OrderedPairSet {\n constructor() {\n this._data = new Map();\n }\n\n has(a, b, weaklyPresent) {\n var _this$_data$get;\n\n const result =\n (_this$_data$get = this._data.get(a)) === null ||\n _this$_data$get === void 0\n ? void 0\n : _this$_data$get.get(b);\n\n if (result === undefined) {\n return false;\n }\n\n return weaklyPresent ? true : weaklyPresent === result;\n }\n\n add(a, b, weaklyPresent) {\n const map = this._data.get(a);\n\n if (map === undefined) {\n this._data.set(a, new Map([[b, weaklyPresent]]));\n } else {\n map.set(b, weaklyPresent);\n }\n }\n}\n/**\n * A way to keep track of pairs of similar things when the ordering of the pair\n * does not matter.\n */\n\nclass PairSet {\n constructor() {\n this._orderedPairSet = new OrderedPairSet();\n }\n\n has(a, b, weaklyPresent) {\n return a < b\n ? this._orderedPairSet.has(a, b, weaklyPresent)\n : this._orderedPairSet.has(b, a, weaklyPresent);\n }\n\n add(a, b, weaklyPresent) {\n if (a < b) {\n this._orderedPairSet.add(a, b, weaklyPresent);\n } else {\n this._orderedPairSet.add(b, a, weaklyPresent);\n }\n }\n}\n", "import { inspect } from '../../jsutils/inspect.mjs';\nimport { GraphQLError } from '../../error/GraphQLError.mjs';\nimport { isCompositeType } from '../../type/definition.mjs';\nimport { doTypesOverlap } from '../../utilities/typeComparators.mjs';\nimport { typeFromAST } from '../../utilities/typeFromAST.mjs';\n\n/**\n * Possible fragment spread\n *\n * A fragment spread is only valid if the type condition could ever possibly\n * be true: if there is a non-empty intersection of the possible parent types,\n * and possible types which pass the type condition.\n */\nexport function PossibleFragmentSpreadsRule(context) {\n return {\n InlineFragment(node) {\n const fragType = context.getType();\n const parentType = context.getParentType();\n\n if (\n isCompositeType(fragType) &&\n isCompositeType(parentType) &&\n !doTypesOverlap(context.getSchema(), fragType, parentType)\n ) {\n const parentTypeStr = inspect(parentType);\n const fragTypeStr = inspect(fragType);\n context.reportError(\n new GraphQLError(\n `Fragment cannot be spread here as objects of type \"${parentTypeStr}\" can never be of type \"${fragTypeStr}\".`,\n {\n nodes: node,\n },\n ),\n );\n }\n },\n\n FragmentSpread(node) {\n const fragName = node.name.value;\n const fragType = getFragmentType(context, fragName);\n const parentType = context.getParentType();\n\n if (\n fragType &&\n parentType &&\n !doTypesOverlap(context.getSchema(), fragType, parentType)\n ) {\n const parentTypeStr = inspect(parentType);\n const fragTypeStr = inspect(fragType);\n context.reportError(\n new GraphQLError(\n `Fragment \"${fragName}\" cannot be spread here as objects of type \"${parentTypeStr}\" can never be of type \"${fragTypeStr}\".`,\n {\n nodes: node,\n },\n ),\n );\n }\n },\n };\n}\n\nfunction getFragmentType(context, name) {\n const frag = context.getFragment(name);\n\n if (frag) {\n const type = typeFromAST(context.getSchema(), frag.typeCondition);\n\n if (isCompositeType(type)) {\n return type;\n }\n }\n}\n", "import { didYouMean } from '../../jsutils/didYouMean.mjs';\nimport { inspect } from '../../jsutils/inspect.mjs';\nimport { invariant } from '../../jsutils/invariant.mjs';\nimport { suggestionList } from '../../jsutils/suggestionList.mjs';\nimport { GraphQLError } from '../../error/GraphQLError.mjs';\nimport { Kind } from '../../language/kinds.mjs';\nimport { isTypeDefinitionNode } from '../../language/predicates.mjs';\nimport {\n isEnumType,\n isInputObjectType,\n isInterfaceType,\n isObjectType,\n isScalarType,\n isUnionType,\n} from '../../type/definition.mjs';\n\n/**\n * Possible type extension\n *\n * A type extension is only valid if the type is defined and has the same kind.\n */\nexport function PossibleTypeExtensionsRule(context) {\n const schema = context.getSchema();\n const definedTypes = Object.create(null);\n\n for (const def of context.getDocument().definitions) {\n if (isTypeDefinitionNode(def)) {\n definedTypes[def.name.value] = def;\n }\n }\n\n return {\n ScalarTypeExtension: checkExtension,\n ObjectTypeExtension: checkExtension,\n InterfaceTypeExtension: checkExtension,\n UnionTypeExtension: checkExtension,\n EnumTypeExtension: checkExtension,\n InputObjectTypeExtension: checkExtension,\n };\n\n function checkExtension(node) {\n const typeName = node.name.value;\n const defNode = definedTypes[typeName];\n const existingType =\n schema === null || schema === void 0 ? void 0 : schema.getType(typeName);\n let expectedKind;\n\n if (defNode) {\n expectedKind = defKindToExtKind[defNode.kind];\n } else if (existingType) {\n expectedKind = typeToExtKind(existingType);\n }\n\n if (expectedKind) {\n if (expectedKind !== node.kind) {\n const kindStr = extensionKindToTypeName(node.kind);\n context.reportError(\n new GraphQLError(`Cannot extend non-${kindStr} type \"${typeName}\".`, {\n nodes: defNode ? [defNode, node] : node,\n }),\n );\n }\n } else {\n const allTypeNames = Object.keys({\n ...definedTypes,\n ...(schema === null || schema === void 0\n ? void 0\n : schema.getTypeMap()),\n });\n const suggestedTypes = suggestionList(typeName, allTypeNames);\n context.reportError(\n new GraphQLError(\n `Cannot extend type \"${typeName}\" because it is not defined.` +\n didYouMean(suggestedTypes),\n {\n nodes: node.name,\n },\n ),\n );\n }\n }\n}\nconst defKindToExtKind = {\n [Kind.SCALAR_TYPE_DEFINITION]: Kind.SCALAR_TYPE_EXTENSION,\n [Kind.OBJECT_TYPE_DEFINITION]: Kind.OBJECT_TYPE_EXTENSION,\n [Kind.INTERFACE_TYPE_DEFINITION]: Kind.INTERFACE_TYPE_EXTENSION,\n [Kind.UNION_TYPE_DEFINITION]: Kind.UNION_TYPE_EXTENSION,\n [Kind.ENUM_TYPE_DEFINITION]: Kind.ENUM_TYPE_EXTENSION,\n [Kind.INPUT_OBJECT_TYPE_DEFINITION]: Kind.INPUT_OBJECT_TYPE_EXTENSION,\n};\n\nfunction typeToExtKind(type) {\n if (isScalarType(type)) {\n return Kind.SCALAR_TYPE_EXTENSION;\n }\n\n if (isObjectType(type)) {\n return Kind.OBJECT_TYPE_EXTENSION;\n }\n\n if (isInterfaceType(type)) {\n return Kind.INTERFACE_TYPE_EXTENSION;\n }\n\n if (isUnionType(type)) {\n return Kind.UNION_TYPE_EXTENSION;\n }\n\n if (isEnumType(type)) {\n return Kind.ENUM_TYPE_EXTENSION;\n }\n\n if (isInputObjectType(type)) {\n return Kind.INPUT_OBJECT_TYPE_EXTENSION;\n }\n /* c8 ignore next 3 */\n // Not reachable. All possible types have been considered\n\n false || invariant(false, 'Unexpected type: ' + inspect(type));\n}\n\nfunction extensionKindToTypeName(kind) {\n switch (kind) {\n case Kind.SCALAR_TYPE_EXTENSION:\n return 'scalar';\n\n case Kind.OBJECT_TYPE_EXTENSION:\n return 'object';\n\n case Kind.INTERFACE_TYPE_EXTENSION:\n return 'interface';\n\n case Kind.UNION_TYPE_EXTENSION:\n return 'union';\n\n case Kind.ENUM_TYPE_EXTENSION:\n return 'enum';\n\n case Kind.INPUT_OBJECT_TYPE_EXTENSION:\n return 'input object';\n // Not reachable. All possible types have been considered\n\n /* c8 ignore next */\n\n default:\n false || invariant(false, 'Unexpected kind: ' + inspect(kind));\n }\n}\n", "import { inspect } from '../../jsutils/inspect.mjs';\nimport { keyMap } from '../../jsutils/keyMap.mjs';\nimport { GraphQLError } from '../../error/GraphQLError.mjs';\nimport { Kind } from '../../language/kinds.mjs';\nimport { print } from '../../language/printer.mjs';\nimport { isRequiredArgument, isType } from '../../type/definition.mjs';\nimport { specifiedDirectives } from '../../type/directives.mjs';\n\n/**\n * Provided required arguments\n *\n * A field or directive is only valid if all required (non-null without a\n * default value) field arguments have been provided.\n */\nexport function ProvidedRequiredArgumentsRule(context) {\n return {\n // eslint-disable-next-line new-cap\n ...ProvidedRequiredArgumentsOnDirectivesRule(context),\n Field: {\n // Validate on leave to allow for deeper errors to appear first.\n leave(fieldNode) {\n var _fieldNode$arguments;\n\n const fieldDef = context.getFieldDef();\n\n if (!fieldDef) {\n return false;\n }\n\n const providedArgs = new Set( // FIXME: https://github.com/graphql/graphql-js/issues/2203\n /* c8 ignore next */\n (_fieldNode$arguments = fieldNode.arguments) === null ||\n _fieldNode$arguments === void 0\n ? void 0\n : _fieldNode$arguments.map((arg) => arg.name.value),\n );\n\n for (const argDef of fieldDef.args) {\n if (!providedArgs.has(argDef.name) && isRequiredArgument(argDef)) {\n const argTypeStr = inspect(argDef.type);\n context.reportError(\n new GraphQLError(\n `Field \"${fieldDef.name}\" argument \"${argDef.name}\" of type \"${argTypeStr}\" is required, but it was not provided.`,\n {\n nodes: fieldNode,\n },\n ),\n );\n }\n }\n },\n },\n };\n}\n/**\n * @internal\n */\n\nexport function ProvidedRequiredArgumentsOnDirectivesRule(context) {\n var _schema$getDirectives;\n\n const requiredArgsMap = Object.create(null);\n const schema = context.getSchema();\n const definedDirectives =\n (_schema$getDirectives =\n schema === null || schema === void 0\n ? void 0\n : schema.getDirectives()) !== null && _schema$getDirectives !== void 0\n ? _schema$getDirectives\n : specifiedDirectives;\n\n for (const directive of definedDirectives) {\n requiredArgsMap[directive.name] = keyMap(\n directive.args.filter(isRequiredArgument),\n (arg) => arg.name,\n );\n }\n\n const astDefinitions = context.getDocument().definitions;\n\n for (const def of astDefinitions) {\n if (def.kind === Kind.DIRECTIVE_DEFINITION) {\n var _def$arguments;\n\n // FIXME: https://github.com/graphql/graphql-js/issues/2203\n\n /* c8 ignore next */\n const argNodes =\n (_def$arguments = def.arguments) !== null && _def$arguments !== void 0\n ? _def$arguments\n : [];\n requiredArgsMap[def.name.value] = keyMap(\n argNodes.filter(isRequiredArgumentNode),\n (arg) => arg.name.value,\n );\n }\n }\n\n return {\n Directive: {\n // Validate on leave to allow for deeper errors to appear first.\n leave(directiveNode) {\n const directiveName = directiveNode.name.value;\n const requiredArgs = requiredArgsMap[directiveName];\n\n if (requiredArgs) {\n var _directiveNode$argume;\n\n // FIXME: https://github.com/graphql/graphql-js/issues/2203\n\n /* c8 ignore next */\n const argNodes =\n (_directiveNode$argume = directiveNode.arguments) !== null &&\n _directiveNode$argume !== void 0\n ? _directiveNode$argume\n : [];\n const argNodeMap = new Set(argNodes.map((arg) => arg.name.value));\n\n for (const [argName, argDef] of Object.entries(requiredArgs)) {\n if (!argNodeMap.has(argName)) {\n const argType = isType(argDef.type)\n ? inspect(argDef.type)\n : print(argDef.type);\n context.reportError(\n new GraphQLError(\n `Directive \"@${directiveName}\" argument \"${argName}\" of type \"${argType}\" is required, but it was not provided.`,\n {\n nodes: directiveNode,\n },\n ),\n );\n }\n }\n }\n },\n },\n };\n}\n\nfunction isRequiredArgumentNode(arg) {\n return arg.type.kind === Kind.NON_NULL_TYPE && arg.defaultValue == null;\n}\n", "import { inspect } from '../../jsutils/inspect.mjs';\nimport { GraphQLError } from '../../error/GraphQLError.mjs';\nimport { getNamedType, isLeafType } from '../../type/definition.mjs';\n\n/**\n * Scalar leafs\n *\n * A GraphQL document is valid only if all leaf fields (fields without\n * sub selections) are of scalar or enum types.\n */\nexport function ScalarLeafsRule(context) {\n return {\n Field(node) {\n const type = context.getType();\n const selectionSet = node.selectionSet;\n\n if (type) {\n if (isLeafType(getNamedType(type))) {\n if (selectionSet) {\n const fieldName = node.name.value;\n const typeStr = inspect(type);\n context.reportError(\n new GraphQLError(\n `Field \"${fieldName}\" must not have a selection since type \"${typeStr}\" has no subfields.`,\n {\n nodes: selectionSet,\n },\n ),\n );\n }\n } else if (!selectionSet) {\n const fieldName = node.name.value;\n const typeStr = inspect(type);\n context.reportError(\n new GraphQLError(\n `Field \"${fieldName}\" of type \"${typeStr}\" must have a selection of subfields. Did you mean \"${fieldName} { ... }\"?`,\n {\n nodes: node,\n },\n ),\n );\n } else if (selectionSet.selections.length === 0) {\n const fieldName = node.name.value;\n const typeStr = inspect(type);\n context.reportError(\n new GraphQLError(\n `Field \"${fieldName}\" of type \"${typeStr}\" must have at least one field selected.`,\n {\n nodes: node,\n },\n ),\n );\n }\n }\n },\n };\n}\n", "/**\n * Build a string describing the path.\n */\nexport function printPathArray(path) {\n return path\n .map((key) =>\n typeof key === 'number' ? '[' + key.toString() + ']' : '.' + key,\n )\n .join('');\n}\n", "/**\n * Given a Path and a key, return a new Path containing the new key.\n */\nexport function addPath(prev, key, typename) {\n return {\n prev,\n key,\n typename,\n };\n}\n/**\n * Given a Path, return an Array of the path keys.\n */\n\nexport function pathToArray(path) {\n const flattened = [];\n let curr = path;\n\n while (curr) {\n flattened.push(curr.key);\n curr = curr.prev;\n }\n\n return flattened.reverse();\n}\n", "import { didYouMean } from '../jsutils/didYouMean.mjs';\nimport { inspect } from '../jsutils/inspect.mjs';\nimport { invariant } from '../jsutils/invariant.mjs';\nimport { isIterableObject } from '../jsutils/isIterableObject.mjs';\nimport { isObjectLike } from '../jsutils/isObjectLike.mjs';\nimport { addPath, pathToArray } from '../jsutils/Path.mjs';\nimport { printPathArray } from '../jsutils/printPathArray.mjs';\nimport { suggestionList } from '../jsutils/suggestionList.mjs';\nimport { GraphQLError } from '../error/GraphQLError.mjs';\nimport {\n isInputObjectType,\n isLeafType,\n isListType,\n isNonNullType,\n} from '../type/definition.mjs';\n\n/**\n * Coerces a JavaScript value given a GraphQL Input Type.\n */\nexport function coerceInputValue(inputValue, type, onError = defaultOnError) {\n return coerceInputValueImpl(inputValue, type, onError, undefined);\n}\n\nfunction defaultOnError(path, invalidValue, error) {\n let errorPrefix = 'Invalid value ' + inspect(invalidValue);\n\n if (path.length > 0) {\n errorPrefix += ` at \"value${printPathArray(path)}\"`;\n }\n\n error.message = errorPrefix + ': ' + error.message;\n throw error;\n}\n\nfunction coerceInputValueImpl(inputValue, type, onError, path) {\n if (isNonNullType(type)) {\n if (inputValue != null) {\n return coerceInputValueImpl(inputValue, type.ofType, onError, path);\n }\n\n onError(\n pathToArray(path),\n inputValue,\n new GraphQLError(\n `Expected non-nullable type \"${inspect(type)}\" not to be null.`,\n ),\n );\n return;\n }\n\n if (inputValue == null) {\n // Explicitly return the value null.\n return null;\n }\n\n if (isListType(type)) {\n const itemType = type.ofType;\n\n if (isIterableObject(inputValue)) {\n return Array.from(inputValue, (itemValue, index) => {\n const itemPath = addPath(path, index, undefined);\n return coerceInputValueImpl(itemValue, itemType, onError, itemPath);\n });\n } // Lists accept a non-list value as a list of one.\n\n return [coerceInputValueImpl(inputValue, itemType, onError, path)];\n }\n\n if (isInputObjectType(type)) {\n if (!isObjectLike(inputValue) || Array.isArray(inputValue)) {\n onError(\n pathToArray(path),\n inputValue,\n new GraphQLError(`Expected type \"${type.name}\" to be an object.`),\n );\n return;\n }\n\n const coercedValue = {};\n const fieldDefs = type.getFields();\n\n for (const field of Object.values(fieldDefs)) {\n const fieldValue = inputValue[field.name];\n\n if (fieldValue === undefined) {\n if (field.defaultValue !== undefined) {\n coercedValue[field.name] = field.defaultValue;\n } else if (isNonNullType(field.type)) {\n const typeStr = inspect(field.type);\n onError(\n pathToArray(path),\n inputValue,\n new GraphQLError(\n `Field \"${field.name}\" of required type \"${typeStr}\" was not provided.`,\n ),\n );\n }\n\n continue;\n }\n\n coercedValue[field.name] = coerceInputValueImpl(\n fieldValue,\n field.type,\n onError,\n addPath(path, field.name, type.name),\n );\n } // Ensure every provided field is defined.\n\n for (const fieldName of Object.keys(inputValue)) {\n if (!fieldDefs[fieldName]) {\n const suggestions = suggestionList(\n fieldName,\n Object.keys(type.getFields()),\n );\n onError(\n pathToArray(path),\n inputValue,\n new GraphQLError(\n `Field \"${fieldName}\" is not defined by type \"${type.name}\".` +\n didYouMean(suggestions),\n ),\n );\n }\n }\n\n if (type.isOneOf) {\n const keys = Object.keys(coercedValue);\n\n if (keys.length !== 1) {\n onError(\n pathToArray(path),\n inputValue,\n new GraphQLError(\n `Exactly one key must be specified for OneOf type \"${type.name}\".`,\n ),\n );\n }\n\n const key = keys[0];\n const value = coercedValue[key];\n\n if (value === null) {\n onError(\n pathToArray(path).concat(key),\n value,\n new GraphQLError(`Field \"${key}\" must be non-null.`),\n );\n }\n }\n\n return coercedValue;\n }\n\n if (isLeafType(type)) {\n let parseResult; // Scalars and Enums determine if a input value is valid via parseValue(),\n // which can throw to indicate failure. If it throws, maintain a reference\n // to the original error.\n\n try {\n parseResult = type.parseValue(inputValue);\n } catch (error) {\n if (error instanceof GraphQLError) {\n onError(pathToArray(path), inputValue, error);\n } else {\n onError(\n pathToArray(path),\n inputValue,\n new GraphQLError(`Expected type \"${type.name}\". ` + error.message, {\n originalError: error,\n }),\n );\n }\n\n return;\n }\n\n if (parseResult === undefined) {\n onError(\n pathToArray(path),\n inputValue,\n new GraphQLError(`Expected type \"${type.name}\".`),\n );\n }\n\n return parseResult;\n }\n /* c8 ignore next 3 */\n // Not reachable, all possible types have been considered.\n\n false || invariant(false, 'Unexpected input type: ' + inspect(type));\n}\n", "import { inspect } from '../jsutils/inspect.mjs';\nimport { invariant } from '../jsutils/invariant.mjs';\nimport { keyMap } from '../jsutils/keyMap.mjs';\nimport { Kind } from '../language/kinds.mjs';\nimport {\n isInputObjectType,\n isLeafType,\n isListType,\n isNonNullType,\n} from '../type/definition.mjs';\n/**\n * Produces a JavaScript value given a GraphQL Value AST.\n *\n * A GraphQL type must be provided, which will be used to interpret different\n * GraphQL Value literals.\n *\n * Returns `undefined` when the value could not be validly coerced according to\n * the provided type.\n *\n * | GraphQL Value | JSON Value |\n * | -------------------- | ------------- |\n * | Input Object | Object |\n * | List | Array |\n * | Boolean | Boolean |\n * | String | String |\n * | Int / Float | Number |\n * | Enum Value | Unknown |\n * | NullValue | null |\n *\n */\n\nexport function valueFromAST(valueNode, type, variables) {\n if (!valueNode) {\n // When there is no node, then there is also no value.\n // Importantly, this is different from returning the value null.\n return;\n }\n\n if (valueNode.kind === Kind.VARIABLE) {\n const variableName = valueNode.name.value;\n\n if (variables == null || variables[variableName] === undefined) {\n // No valid return value.\n return;\n }\n\n const variableValue = variables[variableName];\n\n if (variableValue === null && isNonNullType(type)) {\n return; // Invalid: intentionally return no value.\n } // Note: This does no further checking that this variable is correct.\n // This assumes that this query has been validated and the variable\n // usage here is of the correct type.\n\n return variableValue;\n }\n\n if (isNonNullType(type)) {\n if (valueNode.kind === Kind.NULL) {\n return; // Invalid: intentionally return no value.\n }\n\n return valueFromAST(valueNode, type.ofType, variables);\n }\n\n if (valueNode.kind === Kind.NULL) {\n // This is explicitly returning the value null.\n return null;\n }\n\n if (isListType(type)) {\n const itemType = type.ofType;\n\n if (valueNode.kind === Kind.LIST) {\n const coercedValues = [];\n\n for (const itemNode of valueNode.values) {\n if (isMissingVariable(itemNode, variables)) {\n // If an array contains a missing variable, it is either coerced to\n // null or if the item type is non-null, it considered invalid.\n if (isNonNullType(itemType)) {\n return; // Invalid: intentionally return no value.\n }\n\n coercedValues.push(null);\n } else {\n const itemValue = valueFromAST(itemNode, itemType, variables);\n\n if (itemValue === undefined) {\n return; // Invalid: intentionally return no value.\n }\n\n coercedValues.push(itemValue);\n }\n }\n\n return coercedValues;\n }\n\n const coercedValue = valueFromAST(valueNode, itemType, variables);\n\n if (coercedValue === undefined) {\n return; // Invalid: intentionally return no value.\n }\n\n return [coercedValue];\n }\n\n if (isInputObjectType(type)) {\n if (valueNode.kind !== Kind.OBJECT) {\n return; // Invalid: intentionally return no value.\n }\n\n const coercedObj = Object.create(null);\n const fieldNodes = keyMap(valueNode.fields, (field) => field.name.value);\n\n for (const field of Object.values(type.getFields())) {\n const fieldNode = fieldNodes[field.name];\n\n if (!fieldNode || isMissingVariable(fieldNode.value, variables)) {\n if (field.defaultValue !== undefined) {\n coercedObj[field.name] = field.defaultValue;\n } else if (isNonNullType(field.type)) {\n return; // Invalid: intentionally return no value.\n }\n\n continue;\n }\n\n const fieldValue = valueFromAST(fieldNode.value, field.type, variables);\n\n if (fieldValue === undefined) {\n return; // Invalid: intentionally return no value.\n }\n\n coercedObj[field.name] = fieldValue;\n }\n\n if (type.isOneOf) {\n const keys = Object.keys(coercedObj);\n\n if (keys.length !== 1) {\n return; // Invalid: not exactly one key, intentionally return no value.\n }\n\n if (coercedObj[keys[0]] === null) {\n return; // Invalid: value not non-null, intentionally return no value.\n }\n }\n\n return coercedObj;\n }\n\n if (isLeafType(type)) {\n // Scalars and Enums fulfill parsing a literal value via parseLiteral().\n // Invalid values represent a failure to parse correctly, in which case\n // no value is returned.\n let result;\n\n try {\n result = type.parseLiteral(valueNode, variables);\n } catch (_error) {\n return; // Invalid: intentionally return no value.\n }\n\n if (result === undefined) {\n return; // Invalid: intentionally return no value.\n }\n\n return result;\n }\n /* c8 ignore next 3 */\n // Not reachable, all possible input types have been considered.\n\n false || invariant(false, 'Unexpected input type: ' + inspect(type));\n} // Returns true if the provided valueNode is a variable which is not defined\n// in the set of variables.\n\nfunction isMissingVariable(valueNode, variables) {\n return (\n valueNode.kind === Kind.VARIABLE &&\n (variables == null || variables[valueNode.name.value] === undefined)\n );\n}\n", "import { inspect } from '../jsutils/inspect.mjs';\nimport { keyMap } from '../jsutils/keyMap.mjs';\nimport { printPathArray } from '../jsutils/printPathArray.mjs';\nimport { GraphQLError } from '../error/GraphQLError.mjs';\nimport { Kind } from '../language/kinds.mjs';\nimport { print } from '../language/printer.mjs';\nimport { isInputType, isNonNullType } from '../type/definition.mjs';\nimport { coerceInputValue } from '../utilities/coerceInputValue.mjs';\nimport { typeFromAST } from '../utilities/typeFromAST.mjs';\nimport { valueFromAST } from '../utilities/valueFromAST.mjs';\n\n/**\n * Prepares an object map of variableValues of the correct type based on the\n * provided variable definitions and arbitrary input. If the input cannot be\n * parsed to match the variable definitions, a GraphQLError will be thrown.\n *\n * Note: The returned value is a plain Object with a prototype, since it is\n * exposed to user code. Care should be taken to not pull values from the\n * Object prototype.\n */\nexport function getVariableValues(schema, varDefNodes, inputs, options) {\n const errors = [];\n const maxErrors =\n options === null || options === void 0 ? void 0 : options.maxErrors;\n\n try {\n const coerced = coerceVariableValues(\n schema,\n varDefNodes,\n inputs,\n (error) => {\n if (maxErrors != null && errors.length >= maxErrors) {\n throw new GraphQLError(\n 'Too many errors processing variables, error limit reached. Execution aborted.',\n );\n }\n\n errors.push(error);\n },\n );\n\n if (errors.length === 0) {\n return {\n coerced,\n };\n }\n } catch (error) {\n errors.push(error);\n }\n\n return {\n errors,\n };\n}\n\nfunction coerceVariableValues(schema, varDefNodes, inputs, onError) {\n const coercedValues = {};\n\n for (const varDefNode of varDefNodes) {\n const varName = varDefNode.variable.name.value;\n const varType = typeFromAST(schema, varDefNode.type);\n\n if (!isInputType(varType)) {\n // Must use input types for variables. This should be caught during\n // validation, however is checked again here for safety.\n const varTypeStr = print(varDefNode.type);\n onError(\n new GraphQLError(\n `Variable \"$${varName}\" expected value of type \"${varTypeStr}\" which cannot be used as an input type.`,\n {\n nodes: varDefNode.type,\n },\n ),\n );\n continue;\n }\n\n if (!hasOwnProperty(inputs, varName)) {\n if (varDefNode.defaultValue) {\n coercedValues[varName] = valueFromAST(varDefNode.defaultValue, varType);\n } else if (isNonNullType(varType)) {\n const varTypeStr = inspect(varType);\n onError(\n new GraphQLError(\n `Variable \"$${varName}\" of required type \"${varTypeStr}\" was not provided.`,\n {\n nodes: varDefNode,\n },\n ),\n );\n }\n\n continue;\n }\n\n const value = inputs[varName];\n\n if (value === null && isNonNullType(varType)) {\n const varTypeStr = inspect(varType);\n onError(\n new GraphQLError(\n `Variable \"$${varName}\" of non-null type \"${varTypeStr}\" must not be null.`,\n {\n nodes: varDefNode,\n },\n ),\n );\n continue;\n }\n\n coercedValues[varName] = coerceInputValue(\n value,\n varType,\n (path, invalidValue, error) => {\n let prefix =\n `Variable \"$${varName}\" got invalid value ` + inspect(invalidValue);\n\n if (path.length > 0) {\n prefix += ` at \"${varName}${printPathArray(path)}\"`;\n }\n\n onError(\n new GraphQLError(prefix + '; ' + error.message, {\n nodes: varDefNode,\n originalError: error,\n }),\n );\n },\n );\n }\n\n return coercedValues;\n}\n/**\n * Prepares an object map of argument values given a list of argument\n * definitions and list of argument AST nodes.\n *\n * Note: The returned value is a plain Object with a prototype, since it is\n * exposed to user code. Care should be taken to not pull values from the\n * Object prototype.\n */\n\nexport function getArgumentValues(def, node, variableValues) {\n var _node$arguments;\n\n const coercedValues = {}; // FIXME: https://github.com/graphql/graphql-js/issues/2203\n\n /* c8 ignore next */\n\n const argumentNodes =\n (_node$arguments = node.arguments) !== null && _node$arguments !== void 0\n ? _node$arguments\n : [];\n const argNodeMap = keyMap(argumentNodes, (arg) => arg.name.value);\n\n for (const argDef of def.args) {\n const name = argDef.name;\n const argType = argDef.type;\n const argumentNode = argNodeMap[name];\n\n if (!argumentNode) {\n if (argDef.defaultValue !== undefined) {\n coercedValues[name] = argDef.defaultValue;\n } else if (isNonNullType(argType)) {\n throw new GraphQLError(\n `Argument \"${name}\" of required type \"${inspect(argType)}\" ` +\n 'was not provided.',\n {\n nodes: node,\n },\n );\n }\n\n continue;\n }\n\n const valueNode = argumentNode.value;\n let isNull = valueNode.kind === Kind.NULL;\n\n if (valueNode.kind === Kind.VARIABLE) {\n const variableName = valueNode.name.value;\n\n if (\n variableValues == null ||\n !hasOwnProperty(variableValues, variableName)\n ) {\n if (argDef.defaultValue !== undefined) {\n coercedValues[name] = argDef.defaultValue;\n } else if (isNonNullType(argType)) {\n throw new GraphQLError(\n `Argument \"${name}\" of required type \"${inspect(argType)}\" ` +\n `was provided the variable \"$${variableName}\" which was not provided a runtime value.`,\n {\n nodes: valueNode,\n },\n );\n }\n\n continue;\n }\n\n isNull = variableValues[variableName] == null;\n }\n\n if (isNull && isNonNullType(argType)) {\n throw new GraphQLError(\n `Argument \"${name}\" of non-null type \"${inspect(argType)}\" ` +\n 'must not be null.',\n {\n nodes: valueNode,\n },\n );\n }\n\n const coercedValue = valueFromAST(valueNode, argType, variableValues);\n\n if (coercedValue === undefined) {\n // Note: ValuesOfCorrectTypeRule validation should catch this before\n // execution. This is a runtime check to ensure execution does not\n // continue with an invalid argument value.\n throw new GraphQLError(\n `Argument \"${name}\" has invalid value ${print(valueNode)}.`,\n {\n nodes: valueNode,\n },\n );\n }\n\n coercedValues[name] = coercedValue;\n }\n\n return coercedValues;\n}\n/**\n * Prepares an object map of argument values given a directive definition\n * and a AST node which may contain directives. Optionally also accepts a map\n * of variable values.\n *\n * If the directive does not exist on the node, returns undefined.\n *\n * Note: The returned value is a plain Object with a prototype, since it is\n * exposed to user code. Care should be taken to not pull values from the\n * Object prototype.\n */\n\nexport function getDirectiveValues(directiveDef, node, variableValues) {\n var _node$directives;\n\n const directiveNode =\n (_node$directives = node.directives) === null || _node$directives === void 0\n ? void 0\n : _node$directives.find(\n (directive) => directive.name.value === directiveDef.name,\n );\n\n if (directiveNode) {\n return getArgumentValues(directiveDef, directiveNode, variableValues);\n }\n}\n\nfunction hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}\n", "import { Kind } from '../language/kinds.mjs';\nimport { isAbstractType } from '../type/definition.mjs';\nimport {\n GraphQLIncludeDirective,\n GraphQLSkipDirective,\n} from '../type/directives.mjs';\nimport { typeFromAST } from '../utilities/typeFromAST.mjs';\nimport { getDirectiveValues } from './values.mjs';\n/**\n * Given a selectionSet, collects all of the fields and returns them.\n *\n * CollectFields requires the \"runtime type\" of an object. For a field that\n * returns an Interface or Union type, the \"runtime type\" will be the actual\n * object type returned by that field.\n *\n * @internal\n */\n\nexport function collectFields(\n schema,\n fragments,\n variableValues,\n runtimeType,\n selectionSet,\n) {\n const fields = new Map();\n collectFieldsImpl(\n schema,\n fragments,\n variableValues,\n runtimeType,\n selectionSet,\n fields,\n new Set(),\n );\n return fields;\n}\n/**\n * Given an array of field nodes, collects all of the subfields of the passed\n * in fields, and returns them at the end.\n *\n * CollectSubFields requires the \"return type\" of an object. For a field that\n * returns an Interface or Union type, the \"return type\" will be the actual\n * object type returned by that field.\n *\n * @internal\n */\n\nexport function collectSubfields(\n schema,\n fragments,\n variableValues,\n returnType,\n fieldNodes,\n) {\n const subFieldNodes = new Map();\n const visitedFragmentNames = new Set();\n\n for (const node of fieldNodes) {\n if (node.selectionSet) {\n collectFieldsImpl(\n schema,\n fragments,\n variableValues,\n returnType,\n node.selectionSet,\n subFieldNodes,\n visitedFragmentNames,\n );\n }\n }\n\n return subFieldNodes;\n}\n\nfunction collectFieldsImpl(\n schema,\n fragments,\n variableValues,\n runtimeType,\n selectionSet,\n fields,\n visitedFragmentNames,\n) {\n for (const selection of selectionSet.selections) {\n switch (selection.kind) {\n case Kind.FIELD: {\n if (!shouldIncludeNode(variableValues, selection)) {\n continue;\n }\n\n const name = getFieldEntryKey(selection);\n const fieldList = fields.get(name);\n\n if (fieldList !== undefined) {\n fieldList.push(selection);\n } else {\n fields.set(name, [selection]);\n }\n\n break;\n }\n\n case Kind.INLINE_FRAGMENT: {\n if (\n !shouldIncludeNode(variableValues, selection) ||\n !doesFragmentConditionMatch(schema, selection, runtimeType)\n ) {\n continue;\n }\n\n collectFieldsImpl(\n schema,\n fragments,\n variableValues,\n runtimeType,\n selection.selectionSet,\n fields,\n visitedFragmentNames,\n );\n break;\n }\n\n case Kind.FRAGMENT_SPREAD: {\n const fragName = selection.name.value;\n\n if (\n visitedFragmentNames.has(fragName) ||\n !shouldIncludeNode(variableValues, selection)\n ) {\n continue;\n }\n\n visitedFragmentNames.add(fragName);\n const fragment = fragments[fragName];\n\n if (\n !fragment ||\n !doesFragmentConditionMatch(schema, fragment, runtimeType)\n ) {\n continue;\n }\n\n collectFieldsImpl(\n schema,\n fragments,\n variableValues,\n runtimeType,\n fragment.selectionSet,\n fields,\n visitedFragmentNames,\n );\n break;\n }\n }\n }\n}\n/**\n * Determines if a field should be included based on the `@include` and `@skip`\n * directives, where `@skip` has higher precedence than `@include`.\n */\n\nfunction shouldIncludeNode(variableValues, node) {\n const skip = getDirectiveValues(GraphQLSkipDirective, node, variableValues);\n\n if ((skip === null || skip === void 0 ? void 0 : skip.if) === true) {\n return false;\n }\n\n const include = getDirectiveValues(\n GraphQLIncludeDirective,\n node,\n variableValues,\n );\n\n if (\n (include === null || include === void 0 ? void 0 : include.if) === false\n ) {\n return false;\n }\n\n return true;\n}\n/**\n * Determines if a fragment is applicable to the given type.\n */\n\nfunction doesFragmentConditionMatch(schema, fragment, type) {\n const typeConditionNode = fragment.typeCondition;\n\n if (!typeConditionNode) {\n return true;\n }\n\n const conditionalType = typeFromAST(schema, typeConditionNode);\n\n if (conditionalType === type) {\n return true;\n }\n\n if (isAbstractType(conditionalType)) {\n return schema.isSubType(conditionalType, type);\n }\n\n return false;\n}\n/**\n * Implements the logic to compute the key of a given field's entry\n */\n\nfunction getFieldEntryKey(node) {\n return node.alias ? node.alias.value : node.name.value;\n}\n", "import { GraphQLError } from '../../error/GraphQLError.mjs';\nimport { Kind } from '../../language/kinds.mjs';\nimport { collectFields } from '../../execution/collectFields.mjs';\n\n/**\n * Subscriptions must only include a non-introspection field.\n *\n * A GraphQL subscription is valid only if it contains a single root field and\n * that root field is not an introspection field.\n *\n * See https://spec.graphql.org/draft/#sec-Single-root-field\n */\nexport function SingleFieldSubscriptionsRule(context) {\n return {\n OperationDefinition(node) {\n if (node.operation === 'subscription') {\n const schema = context.getSchema();\n const subscriptionType = schema.getSubscriptionType();\n\n if (subscriptionType) {\n const operationName = node.name ? node.name.value : null;\n const variableValues = Object.create(null);\n const document = context.getDocument();\n const fragments = Object.create(null);\n\n for (const definition of document.definitions) {\n if (definition.kind === Kind.FRAGMENT_DEFINITION) {\n fragments[definition.name.value] = definition;\n }\n }\n\n const fields = collectFields(\n schema,\n fragments,\n variableValues,\n subscriptionType,\n node.selectionSet,\n );\n\n if (fields.size > 1) {\n const fieldSelectionLists = [...fields.values()];\n const extraFieldSelectionLists = fieldSelectionLists.slice(1);\n const extraFieldSelections = extraFieldSelectionLists.flat();\n context.reportError(\n new GraphQLError(\n operationName != null\n ? `Subscription \"${operationName}\" must select only one top level field.`\n : 'Anonymous Subscription must select only one top level field.',\n {\n nodes: extraFieldSelections,\n },\n ),\n );\n }\n\n for (const fieldNodes of fields.values()) {\n const field = fieldNodes[0];\n const fieldName = field.name.value;\n\n if (fieldName.startsWith('__')) {\n context.reportError(\n new GraphQLError(\n operationName != null\n ? `Subscription \"${operationName}\" must not select an introspection top level field.`\n : 'Anonymous Subscription must not select an introspection top level field.',\n {\n nodes: fieldNodes,\n },\n ),\n );\n }\n }\n }\n }\n },\n };\n}\n", "/**\n * Groups array items into a Map, given a function to produce grouping key.\n */\nexport function groupBy(list, keyFn) {\n const result = new Map();\n\n for (const item of list) {\n const key = keyFn(item);\n const group = result.get(key);\n\n if (group === undefined) {\n result.set(key, [item]);\n } else {\n group.push(item);\n }\n }\n\n return result;\n}\n", "import { groupBy } from '../../jsutils/groupBy.mjs';\nimport { GraphQLError } from '../../error/GraphQLError.mjs';\n\n/**\n * Unique argument definition names\n *\n * A GraphQL Object or Interface type is only valid if all its fields have uniquely named arguments.\n * A GraphQL Directive is only valid if all its arguments are uniquely named.\n */\nexport function UniqueArgumentDefinitionNamesRule(context) {\n return {\n DirectiveDefinition(directiveNode) {\n var _directiveNode$argume;\n\n // FIXME: https://github.com/graphql/graphql-js/issues/2203\n\n /* c8 ignore next */\n const argumentNodes =\n (_directiveNode$argume = directiveNode.arguments) !== null &&\n _directiveNode$argume !== void 0\n ? _directiveNode$argume\n : [];\n return checkArgUniqueness(`@${directiveNode.name.value}`, argumentNodes);\n },\n\n InterfaceTypeDefinition: checkArgUniquenessPerField,\n InterfaceTypeExtension: checkArgUniquenessPerField,\n ObjectTypeDefinition: checkArgUniquenessPerField,\n ObjectTypeExtension: checkArgUniquenessPerField,\n };\n\n function checkArgUniquenessPerField(typeNode) {\n var _typeNode$fields;\n\n const typeName = typeNode.name.value; // FIXME: https://github.com/graphql/graphql-js/issues/2203\n\n /* c8 ignore next */\n\n const fieldNodes =\n (_typeNode$fields = typeNode.fields) !== null &&\n _typeNode$fields !== void 0\n ? _typeNode$fields\n : [];\n\n for (const fieldDef of fieldNodes) {\n var _fieldDef$arguments;\n\n const fieldName = fieldDef.name.value; // FIXME: https://github.com/graphql/graphql-js/issues/2203\n\n /* c8 ignore next */\n\n const argumentNodes =\n (_fieldDef$arguments = fieldDef.arguments) !== null &&\n _fieldDef$arguments !== void 0\n ? _fieldDef$arguments\n : [];\n checkArgUniqueness(`${typeName}.${fieldName}`, argumentNodes);\n }\n\n return false;\n }\n\n function checkArgUniqueness(parentName, argumentNodes) {\n const seenArgs = groupBy(argumentNodes, (arg) => arg.name.value);\n\n for (const [argName, argNodes] of seenArgs) {\n if (argNodes.length > 1) {\n context.reportError(\n new GraphQLError(\n `Argument \"${parentName}(${argName}:)\" can only be defined once.`,\n {\n nodes: argNodes.map((node) => node.name),\n },\n ),\n );\n }\n }\n\n return false;\n }\n}\n", "import { groupBy } from '../../jsutils/groupBy.mjs';\nimport { GraphQLError } from '../../error/GraphQLError.mjs';\n\n/**\n * Unique argument names\n *\n * A GraphQL field or directive is only valid if all supplied arguments are\n * uniquely named.\n *\n * See https://spec.graphql.org/draft/#sec-Argument-Names\n */\nexport function UniqueArgumentNamesRule(context) {\n return {\n Field: checkArgUniqueness,\n Directive: checkArgUniqueness,\n };\n\n function checkArgUniqueness(parentNode) {\n var _parentNode$arguments;\n\n // FIXME: https://github.com/graphql/graphql-js/issues/2203\n\n /* c8 ignore next */\n const argumentNodes =\n (_parentNode$arguments = parentNode.arguments) !== null &&\n _parentNode$arguments !== void 0\n ? _parentNode$arguments\n : [];\n const seenArgs = groupBy(argumentNodes, (arg) => arg.name.value);\n\n for (const [argName, argNodes] of seenArgs) {\n if (argNodes.length > 1) {\n context.reportError(\n new GraphQLError(\n `There can be only one argument named \"${argName}\".`,\n {\n nodes: argNodes.map((node) => node.name),\n },\n ),\n );\n }\n }\n }\n}\n", "import { GraphQLError } from '../../error/GraphQLError.mjs';\n\n/**\n * Unique directive names\n *\n * A GraphQL document is only valid if all defined directives have unique names.\n */\nexport function UniqueDirectiveNamesRule(context) {\n const knownDirectiveNames = Object.create(null);\n const schema = context.getSchema();\n return {\n DirectiveDefinition(node) {\n const directiveName = node.name.value;\n\n if (\n schema !== null &&\n schema !== void 0 &&\n schema.getDirective(directiveName)\n ) {\n context.reportError(\n new GraphQLError(\n `Directive \"@${directiveName}\" already exists in the schema. It cannot be redefined.`,\n {\n nodes: node.name,\n },\n ),\n );\n return;\n }\n\n if (knownDirectiveNames[directiveName]) {\n context.reportError(\n new GraphQLError(\n `There can be only one directive named \"@${directiveName}\".`,\n {\n nodes: [knownDirectiveNames[directiveName], node.name],\n },\n ),\n );\n } else {\n knownDirectiveNames[directiveName] = node.name;\n }\n\n return false;\n },\n };\n}\n", "import { GraphQLError } from '../../error/GraphQLError.mjs';\nimport { Kind } from '../../language/kinds.mjs';\nimport {\n isTypeDefinitionNode,\n isTypeExtensionNode,\n} from '../../language/predicates.mjs';\nimport { specifiedDirectives } from '../../type/directives.mjs';\n\n/**\n * Unique directive names per location\n *\n * A GraphQL document is only valid if all non-repeatable directives at\n * a given location are uniquely named.\n *\n * See https://spec.graphql.org/draft/#sec-Directives-Are-Unique-Per-Location\n */\nexport function UniqueDirectivesPerLocationRule(context) {\n const uniqueDirectiveMap = Object.create(null);\n const schema = context.getSchema();\n const definedDirectives = schema\n ? schema.getDirectives()\n : specifiedDirectives;\n\n for (const directive of definedDirectives) {\n uniqueDirectiveMap[directive.name] = !directive.isRepeatable;\n }\n\n const astDefinitions = context.getDocument().definitions;\n\n for (const def of astDefinitions) {\n if (def.kind === Kind.DIRECTIVE_DEFINITION) {\n uniqueDirectiveMap[def.name.value] = !def.repeatable;\n }\n }\n\n const schemaDirectives = Object.create(null);\n const typeDirectivesMap = Object.create(null);\n return {\n // Many different AST nodes may contain directives. Rather than listing\n // them all, just listen for entering any node, and check to see if it\n // defines any directives.\n enter(node) {\n if (!('directives' in node) || !node.directives) {\n return;\n }\n\n let seenDirectives;\n\n if (\n node.kind === Kind.SCHEMA_DEFINITION ||\n node.kind === Kind.SCHEMA_EXTENSION\n ) {\n seenDirectives = schemaDirectives;\n } else if (isTypeDefinitionNode(node) || isTypeExtensionNode(node)) {\n const typeName = node.name.value;\n seenDirectives = typeDirectivesMap[typeName];\n\n if (seenDirectives === undefined) {\n typeDirectivesMap[typeName] = seenDirectives = Object.create(null);\n }\n } else {\n seenDirectives = Object.create(null);\n }\n\n for (const directive of node.directives) {\n const directiveName = directive.name.value;\n\n if (uniqueDirectiveMap[directiveName]) {\n if (seenDirectives[directiveName]) {\n context.reportError(\n new GraphQLError(\n `The directive \"@${directiveName}\" can only be used once at this location.`,\n {\n nodes: [seenDirectives[directiveName], directive],\n },\n ),\n );\n } else {\n seenDirectives[directiveName] = directive;\n }\n }\n }\n },\n };\n}\n", "import { GraphQLError } from '../../error/GraphQLError.mjs';\nimport { isEnumType } from '../../type/definition.mjs';\n\n/**\n * Unique enum value names\n *\n * A GraphQL enum type is only valid if all its values are uniquely named.\n */\nexport function UniqueEnumValueNamesRule(context) {\n const schema = context.getSchema();\n const existingTypeMap = schema ? schema.getTypeMap() : Object.create(null);\n const knownValueNames = Object.create(null);\n return {\n EnumTypeDefinition: checkValueUniqueness,\n EnumTypeExtension: checkValueUniqueness,\n };\n\n function checkValueUniqueness(node) {\n var _node$values;\n\n const typeName = node.name.value;\n\n if (!knownValueNames[typeName]) {\n knownValueNames[typeName] = Object.create(null);\n } // FIXME: https://github.com/graphql/graphql-js/issues/2203\n\n /* c8 ignore next */\n\n const valueNodes =\n (_node$values = node.values) !== null && _node$values !== void 0\n ? _node$values\n : [];\n const valueNames = knownValueNames[typeName];\n\n for (const valueDef of valueNodes) {\n const valueName = valueDef.name.value;\n const existingType = existingTypeMap[typeName];\n\n if (isEnumType(existingType) && existingType.getValue(valueName)) {\n context.reportError(\n new GraphQLError(\n `Enum value \"${typeName}.${valueName}\" already exists in the schema. It cannot also be defined in this type extension.`,\n {\n nodes: valueDef.name,\n },\n ),\n );\n } else if (valueNames[valueName]) {\n context.reportError(\n new GraphQLError(\n `Enum value \"${typeName}.${valueName}\" can only be defined once.`,\n {\n nodes: [valueNames[valueName], valueDef.name],\n },\n ),\n );\n } else {\n valueNames[valueName] = valueDef.name;\n }\n }\n\n return false;\n }\n}\n", "import { GraphQLError } from '../../error/GraphQLError.mjs';\nimport {\n isInputObjectType,\n isInterfaceType,\n isObjectType,\n} from '../../type/definition.mjs';\n\n/**\n * Unique field definition names\n *\n * A GraphQL complex type is only valid if all its fields are uniquely named.\n */\nexport function UniqueFieldDefinitionNamesRule(context) {\n const schema = context.getSchema();\n const existingTypeMap = schema ? schema.getTypeMap() : Object.create(null);\n const knownFieldNames = Object.create(null);\n return {\n InputObjectTypeDefinition: checkFieldUniqueness,\n InputObjectTypeExtension: checkFieldUniqueness,\n InterfaceTypeDefinition: checkFieldUniqueness,\n InterfaceTypeExtension: checkFieldUniqueness,\n ObjectTypeDefinition: checkFieldUniqueness,\n ObjectTypeExtension: checkFieldUniqueness,\n };\n\n function checkFieldUniqueness(node) {\n var _node$fields;\n\n const typeName = node.name.value;\n\n if (!knownFieldNames[typeName]) {\n knownFieldNames[typeName] = Object.create(null);\n } // FIXME: https://github.com/graphql/graphql-js/issues/2203\n\n /* c8 ignore next */\n\n const fieldNodes =\n (_node$fields = node.fields) !== null && _node$fields !== void 0\n ? _node$fields\n : [];\n const fieldNames = knownFieldNames[typeName];\n\n for (const fieldDef of fieldNodes) {\n const fieldName = fieldDef.name.value;\n\n if (hasField(existingTypeMap[typeName], fieldName)) {\n context.reportError(\n new GraphQLError(\n `Field \"${typeName}.${fieldName}\" already exists in the schema. It cannot also be defined in this type extension.`,\n {\n nodes: fieldDef.name,\n },\n ),\n );\n } else if (fieldNames[fieldName]) {\n context.reportError(\n new GraphQLError(\n `Field \"${typeName}.${fieldName}\" can only be defined once.`,\n {\n nodes: [fieldNames[fieldName], fieldDef.name],\n },\n ),\n );\n } else {\n fieldNames[fieldName] = fieldDef.name;\n }\n }\n\n return false;\n }\n}\n\nfunction hasField(type, fieldName) {\n if (isObjectType(type) || isInterfaceType(type) || isInputObjectType(type)) {\n return type.getFields()[fieldName] != null;\n }\n\n return false;\n}\n", "import { GraphQLError } from '../../error/GraphQLError.mjs';\n\n/**\n * Unique fragment names\n *\n * A GraphQL document is only valid if all defined fragments have unique names.\n *\n * See https://spec.graphql.org/draft/#sec-Fragment-Name-Uniqueness\n */\nexport function UniqueFragmentNamesRule(context) {\n const knownFragmentNames = Object.create(null);\n return {\n OperationDefinition: () => false,\n\n FragmentDefinition(node) {\n const fragmentName = node.name.value;\n\n if (knownFragmentNames[fragmentName]) {\n context.reportError(\n new GraphQLError(\n `There can be only one fragment named \"${fragmentName}\".`,\n {\n nodes: [knownFragmentNames[fragmentName], node.name],\n },\n ),\n );\n } else {\n knownFragmentNames[fragmentName] = node.name;\n }\n\n return false;\n },\n };\n}\n", "import { invariant } from '../../jsutils/invariant.mjs';\nimport { GraphQLError } from '../../error/GraphQLError.mjs';\n\n/**\n * Unique input field names\n *\n * A GraphQL input object value is only valid if all supplied fields are\n * uniquely named.\n *\n * See https://spec.graphql.org/draft/#sec-Input-Object-Field-Uniqueness\n */\nexport function UniqueInputFieldNamesRule(context) {\n const knownNameStack = [];\n let knownNames = Object.create(null);\n return {\n ObjectValue: {\n enter() {\n knownNameStack.push(knownNames);\n knownNames = Object.create(null);\n },\n\n leave() {\n const prevKnownNames = knownNameStack.pop();\n prevKnownNames || invariant(false);\n knownNames = prevKnownNames;\n },\n },\n\n ObjectField(node) {\n const fieldName = node.name.value;\n\n if (knownNames[fieldName]) {\n context.reportError(\n new GraphQLError(\n `There can be only one input field named \"${fieldName}\".`,\n {\n nodes: [knownNames[fieldName], node.name],\n },\n ),\n );\n } else {\n knownNames[fieldName] = node.name;\n }\n },\n };\n}\n", "import { GraphQLError } from '../../error/GraphQLError.mjs';\n\n/**\n * Unique operation names\n *\n * A GraphQL document is only valid if all defined operations have unique names.\n *\n * See https://spec.graphql.org/draft/#sec-Operation-Name-Uniqueness\n */\nexport function UniqueOperationNamesRule(context) {\n const knownOperationNames = Object.create(null);\n return {\n OperationDefinition(node) {\n const operationName = node.name;\n\n if (operationName) {\n if (knownOperationNames[operationName.value]) {\n context.reportError(\n new GraphQLError(\n `There can be only one operation named \"${operationName.value}\".`,\n {\n nodes: [\n knownOperationNames[operationName.value],\n operationName,\n ],\n },\n ),\n );\n } else {\n knownOperationNames[operationName.value] = operationName;\n }\n }\n\n return false;\n },\n\n FragmentDefinition: () => false,\n };\n}\n", "import { GraphQLError } from '../../error/GraphQLError.mjs';\n\n/**\n * Unique operation types\n *\n * A GraphQL document is only valid if it has only one type per operation.\n */\nexport function UniqueOperationTypesRule(context) {\n const schema = context.getSchema();\n const definedOperationTypes = Object.create(null);\n const existingOperationTypes = schema\n ? {\n query: schema.getQueryType(),\n mutation: schema.getMutationType(),\n subscription: schema.getSubscriptionType(),\n }\n : {};\n return {\n SchemaDefinition: checkOperationTypes,\n SchemaExtension: checkOperationTypes,\n };\n\n function checkOperationTypes(node) {\n var _node$operationTypes;\n\n // See: https://github.com/graphql/graphql-js/issues/2203\n\n /* c8 ignore next */\n const operationTypesNodes =\n (_node$operationTypes = node.operationTypes) !== null &&\n _node$operationTypes !== void 0\n ? _node$operationTypes\n : [];\n\n for (const operationType of operationTypesNodes) {\n const operation = operationType.operation;\n const alreadyDefinedOperationType = definedOperationTypes[operation];\n\n if (existingOperationTypes[operation]) {\n context.reportError(\n new GraphQLError(\n `Type for ${operation} already defined in the schema. It cannot be redefined.`,\n {\n nodes: operationType,\n },\n ),\n );\n } else if (alreadyDefinedOperationType) {\n context.reportError(\n new GraphQLError(\n `There can be only one ${operation} type in schema.`,\n {\n nodes: [alreadyDefinedOperationType, operationType],\n },\n ),\n );\n } else {\n definedOperationTypes[operation] = operationType;\n }\n }\n\n return false;\n }\n}\n", "import { GraphQLError } from '../../error/GraphQLError.mjs';\n\n/**\n * Unique type names\n *\n * A GraphQL document is only valid if all defined types have unique names.\n */\nexport function UniqueTypeNamesRule(context) {\n const knownTypeNames = Object.create(null);\n const schema = context.getSchema();\n return {\n ScalarTypeDefinition: checkTypeName,\n ObjectTypeDefinition: checkTypeName,\n InterfaceTypeDefinition: checkTypeName,\n UnionTypeDefinition: checkTypeName,\n EnumTypeDefinition: checkTypeName,\n InputObjectTypeDefinition: checkTypeName,\n };\n\n function checkTypeName(node) {\n const typeName = node.name.value;\n\n if (schema !== null && schema !== void 0 && schema.getType(typeName)) {\n context.reportError(\n new GraphQLError(\n `Type \"${typeName}\" already exists in the schema. It cannot also be defined in this type definition.`,\n {\n nodes: node.name,\n },\n ),\n );\n return;\n }\n\n if (knownTypeNames[typeName]) {\n context.reportError(\n new GraphQLError(`There can be only one type named \"${typeName}\".`, {\n nodes: [knownTypeNames[typeName], node.name],\n }),\n );\n } else {\n knownTypeNames[typeName] = node.name;\n }\n\n return false;\n }\n}\n", "import { groupBy } from '../../jsutils/groupBy.mjs';\nimport { GraphQLError } from '../../error/GraphQLError.mjs';\n\n/**\n * Unique variable names\n *\n * A GraphQL operation is only valid if all its variables are uniquely named.\n */\nexport function UniqueVariableNamesRule(context) {\n return {\n OperationDefinition(operationNode) {\n var _operationNode$variab;\n\n // See: https://github.com/graphql/graphql-js/issues/2203\n\n /* c8 ignore next */\n const variableDefinitions =\n (_operationNode$variab = operationNode.variableDefinitions) !== null &&\n _operationNode$variab !== void 0\n ? _operationNode$variab\n : [];\n const seenVariableDefinitions = groupBy(\n variableDefinitions,\n (node) => node.variable.name.value,\n );\n\n for (const [variableName, variableNodes] of seenVariableDefinitions) {\n if (variableNodes.length > 1) {\n context.reportError(\n new GraphQLError(\n `There can be only one variable named \"$${variableName}\".`,\n {\n nodes: variableNodes.map((node) => node.variable.name),\n },\n ),\n );\n }\n }\n },\n };\n}\n", "import { didYouMean } from '../../jsutils/didYouMean.mjs';\nimport { inspect } from '../../jsutils/inspect.mjs';\nimport { keyMap } from '../../jsutils/keyMap.mjs';\nimport { suggestionList } from '../../jsutils/suggestionList.mjs';\nimport { GraphQLError } from '../../error/GraphQLError.mjs';\nimport { Kind } from '../../language/kinds.mjs';\nimport { print } from '../../language/printer.mjs';\nimport {\n getNamedType,\n getNullableType,\n isInputObjectType,\n isLeafType,\n isListType,\n isNonNullType,\n isRequiredInputField,\n} from '../../type/definition.mjs';\n\n/**\n * Value literals of correct type\n *\n * A GraphQL document is only valid if all value literals are of the type\n * expected at their position.\n *\n * See https://spec.graphql.org/draft/#sec-Values-of-Correct-Type\n */\nexport function ValuesOfCorrectTypeRule(context) {\n let variableDefinitions = {};\n return {\n OperationDefinition: {\n enter() {\n variableDefinitions = {};\n },\n },\n\n VariableDefinition(definition) {\n variableDefinitions[definition.variable.name.value] = definition;\n },\n\n ListValue(node) {\n // Note: TypeInfo will traverse into a list's item type, so look to the\n // parent input type to check if it is a list.\n const type = getNullableType(context.getParentInputType());\n\n if (!isListType(type)) {\n isValidValueNode(context, node);\n return false; // Don't traverse further.\n }\n },\n\n ObjectValue(node) {\n const type = getNamedType(context.getInputType());\n\n if (!isInputObjectType(type)) {\n isValidValueNode(context, node);\n return false; // Don't traverse further.\n } // Ensure every required field exists.\n\n const fieldNodeMap = keyMap(node.fields, (field) => field.name.value);\n\n for (const fieldDef of Object.values(type.getFields())) {\n const fieldNode = fieldNodeMap[fieldDef.name];\n\n if (!fieldNode && isRequiredInputField(fieldDef)) {\n const typeStr = inspect(fieldDef.type);\n context.reportError(\n new GraphQLError(\n `Field \"${type.name}.${fieldDef.name}\" of required type \"${typeStr}\" was not provided.`,\n {\n nodes: node,\n },\n ),\n );\n }\n }\n\n if (type.isOneOf) {\n validateOneOfInputObject(context, node, type, fieldNodeMap);\n }\n },\n\n ObjectField(node) {\n const parentType = getNamedType(context.getParentInputType());\n const fieldType = context.getInputType();\n\n if (!fieldType && isInputObjectType(parentType)) {\n const suggestions = suggestionList(\n node.name.value,\n Object.keys(parentType.getFields()),\n );\n context.reportError(\n new GraphQLError(\n `Field \"${node.name.value}\" is not defined by type \"${parentType.name}\".` +\n didYouMean(suggestions),\n {\n nodes: node,\n },\n ),\n );\n }\n },\n\n NullValue(node) {\n const type = context.getInputType();\n\n if (isNonNullType(type)) {\n context.reportError(\n new GraphQLError(\n `Expected value of type \"${inspect(type)}\", found ${print(node)}.`,\n {\n nodes: node,\n },\n ),\n );\n }\n },\n\n EnumValue: (node) => isValidValueNode(context, node),\n IntValue: (node) => isValidValueNode(context, node),\n FloatValue: (node) => isValidValueNode(context, node),\n StringValue: (node) => isValidValueNode(context, node),\n BooleanValue: (node) => isValidValueNode(context, node),\n };\n}\n/**\n * Any value literal may be a valid representation of a Scalar, depending on\n * that scalar type.\n */\n\nfunction isValidValueNode(context, node) {\n // Report any error at the full type expected by the location.\n const locationType = context.getInputType();\n\n if (!locationType) {\n return;\n }\n\n const type = getNamedType(locationType);\n\n if (!isLeafType(type)) {\n const typeStr = inspect(locationType);\n context.reportError(\n new GraphQLError(\n `Expected value of type \"${typeStr}\", found ${print(node)}.`,\n {\n nodes: node,\n },\n ),\n );\n return;\n } // Scalars and Enums determine if a literal value is valid via parseLiteral(),\n // which may throw or return an invalid value to indicate failure.\n\n try {\n const parseResult = type.parseLiteral(\n node,\n undefined,\n /* variables */\n );\n\n if (parseResult === undefined) {\n const typeStr = inspect(locationType);\n context.reportError(\n new GraphQLError(\n `Expected value of type \"${typeStr}\", found ${print(node)}.`,\n {\n nodes: node,\n },\n ),\n );\n }\n } catch (error) {\n const typeStr = inspect(locationType);\n\n if (error instanceof GraphQLError) {\n context.reportError(error);\n } else {\n context.reportError(\n new GraphQLError(\n `Expected value of type \"${typeStr}\", found ${print(node)}; ` +\n error.message,\n {\n nodes: node,\n originalError: error,\n },\n ),\n );\n }\n }\n}\n\nfunction validateOneOfInputObject(context, node, type, fieldNodeMap) {\n var _fieldNodeMap$keys$;\n\n const keys = Object.keys(fieldNodeMap);\n const isNotExactlyOneField = keys.length !== 1;\n\n if (isNotExactlyOneField) {\n context.reportError(\n new GraphQLError(\n `OneOf Input Object \"${type.name}\" must specify exactly one key.`,\n {\n nodes: [node],\n },\n ),\n );\n return;\n }\n\n const value =\n (_fieldNodeMap$keys$ = fieldNodeMap[keys[0]]) === null ||\n _fieldNodeMap$keys$ === void 0\n ? void 0\n : _fieldNodeMap$keys$.value;\n const isNullLiteral = !value || value.kind === Kind.NULL;\n\n if (isNullLiteral) {\n context.reportError(\n new GraphQLError(`Field \"${type.name}.${keys[0]}\" must be non-null.`, {\n nodes: [node],\n }),\n );\n }\n}\n", "import { GraphQLError } from '../../error/GraphQLError.mjs';\nimport { print } from '../../language/printer.mjs';\nimport { isInputType } from '../../type/definition.mjs';\nimport { typeFromAST } from '../../utilities/typeFromAST.mjs';\n\n/**\n * Variables are input types\n *\n * A GraphQL operation is only valid if all the variables it defines are of\n * input types (scalar, enum, or input object).\n *\n * See https://spec.graphql.org/draft/#sec-Variables-Are-Input-Types\n */\nexport function VariablesAreInputTypesRule(context) {\n return {\n VariableDefinition(node) {\n const type = typeFromAST(context.getSchema(), node.type);\n\n if (type !== undefined && !isInputType(type)) {\n const variableName = node.variable.name.value;\n const typeName = print(node.type);\n context.reportError(\n new GraphQLError(\n `Variable \"$${variableName}\" cannot be non-input type \"${typeName}\".`,\n {\n nodes: node.type,\n },\n ),\n );\n }\n },\n };\n}\n", "import { inspect } from '../../jsutils/inspect.mjs';\nimport { GraphQLError } from '../../error/GraphQLError.mjs';\nimport { Kind } from '../../language/kinds.mjs';\nimport {\n isInputObjectType,\n isNonNullType,\n isNullableType,\n} from '../../type/definition.mjs';\nimport { isTypeSubTypeOf } from '../../utilities/typeComparators.mjs';\nimport { typeFromAST } from '../../utilities/typeFromAST.mjs';\n\n/**\n * Variables in allowed position\n *\n * Variable usages must be compatible with the arguments they are passed to.\n *\n * See https://spec.graphql.org/draft/#sec-All-Variable-Usages-are-Allowed\n */\nexport function VariablesInAllowedPositionRule(context) {\n let varDefMap = Object.create(null);\n return {\n OperationDefinition: {\n enter() {\n varDefMap = Object.create(null);\n },\n\n leave(operation) {\n const usages = context.getRecursiveVariableUsages(operation);\n\n for (const { node, type, defaultValue, parentType } of usages) {\n const varName = node.name.value;\n const varDef = varDefMap[varName];\n\n if (varDef && type) {\n // A var type is allowed if it is the same or more strict (e.g. is\n // a subtype of) than the expected type. It can be more strict if\n // the variable type is non-null when the expected type is nullable.\n // If both are list types, the variable item type can be more strict\n // than the expected item type (contravariant).\n const schema = context.getSchema();\n const varType = typeFromAST(schema, varDef.type);\n\n if (\n varType &&\n !allowedVariableUsage(\n schema,\n varType,\n varDef.defaultValue,\n type,\n defaultValue,\n )\n ) {\n const varTypeStr = inspect(varType);\n const typeStr = inspect(type);\n context.reportError(\n new GraphQLError(\n `Variable \"$${varName}\" of type \"${varTypeStr}\" used in position expecting type \"${typeStr}\".`,\n {\n nodes: [varDef, node],\n },\n ),\n );\n }\n\n if (\n isInputObjectType(parentType) &&\n parentType.isOneOf &&\n isNullableType(varType)\n ) {\n context.reportError(\n new GraphQLError(\n `Variable \"$${varName}\" is of type \"${varType}\" but must be non-nullable to be used for OneOf Input Object \"${parentType}\".`,\n {\n nodes: [varDef, node],\n },\n ),\n );\n }\n }\n }\n },\n },\n\n VariableDefinition(node) {\n varDefMap[node.variable.name.value] = node;\n },\n };\n}\n/**\n * Returns true if the variable is allowed in the location it was found,\n * which includes considering if default values exist for either the variable\n * or the location at which it is located.\n */\n\nfunction allowedVariableUsage(\n schema,\n varType,\n varDefaultValue,\n locationType,\n locationDefaultValue,\n) {\n if (isNonNullType(locationType) && !isNonNullType(varType)) {\n const hasNonNullVariableDefaultValue =\n varDefaultValue != null && varDefaultValue.kind !== Kind.NULL;\n const hasLocationDefaultValue = locationDefaultValue !== undefined;\n\n if (!hasNonNullVariableDefaultValue && !hasLocationDefaultValue) {\n return false;\n }\n\n const nullableLocationType = locationType.ofType;\n return isTypeSubTypeOf(schema, varType, nullableLocationType);\n }\n\n return isTypeSubTypeOf(schema, varType, locationType);\n}\n", "// Spec Section: \"Executable Definitions\"\nimport { ExecutableDefinitionsRule } from './rules/ExecutableDefinitionsRule.mjs'; // Spec Section: \"Field Selections on Objects, Interfaces, and Unions Types\"\n\nimport { FieldsOnCorrectTypeRule } from './rules/FieldsOnCorrectTypeRule.mjs'; // Spec Section: \"Fragments on Composite Types\"\n\nimport { FragmentsOnCompositeTypesRule } from './rules/FragmentsOnCompositeTypesRule.mjs'; // Spec Section: \"Argument Names\"\n\nimport {\n KnownArgumentNamesOnDirectivesRule,\n KnownArgumentNamesRule,\n} from './rules/KnownArgumentNamesRule.mjs'; // Spec Section: \"Directives Are Defined\"\n\nimport { KnownDirectivesRule } from './rules/KnownDirectivesRule.mjs'; // Spec Section: \"Fragment spread target defined\"\n\nimport { KnownFragmentNamesRule } from './rules/KnownFragmentNamesRule.mjs'; // Spec Section: \"Fragment Spread Type Existence\"\n\nimport { KnownTypeNamesRule } from './rules/KnownTypeNamesRule.mjs'; // Spec Section: \"Lone Anonymous Operation\"\n\nimport { LoneAnonymousOperationRule } from './rules/LoneAnonymousOperationRule.mjs'; // SDL-specific validation rules\n\nimport { LoneSchemaDefinitionRule } from './rules/LoneSchemaDefinitionRule.mjs'; // TODO: Spec Section\n\nimport { MaxIntrospectionDepthRule } from './rules/MaxIntrospectionDepthRule.mjs'; // Spec Section: \"Fragments must not form cycles\"\n\nimport { NoFragmentCyclesRule } from './rules/NoFragmentCyclesRule.mjs'; // Spec Section: \"All Variable Used Defined\"\n\nimport { NoUndefinedVariablesRule } from './rules/NoUndefinedVariablesRule.mjs'; // Spec Section: \"Fragments must be used\"\n\nimport { NoUnusedFragmentsRule } from './rules/NoUnusedFragmentsRule.mjs'; // Spec Section: \"All Variables Used\"\n\nimport { NoUnusedVariablesRule } from './rules/NoUnusedVariablesRule.mjs'; // Spec Section: \"Field Selection Merging\"\n\nimport { OverlappingFieldsCanBeMergedRule } from './rules/OverlappingFieldsCanBeMergedRule.mjs'; // Spec Section: \"Fragment spread is possible\"\n\nimport { PossibleFragmentSpreadsRule } from './rules/PossibleFragmentSpreadsRule.mjs';\nimport { PossibleTypeExtensionsRule } from './rules/PossibleTypeExtensionsRule.mjs'; // Spec Section: \"Argument Optionality\"\n\nimport {\n ProvidedRequiredArgumentsOnDirectivesRule,\n ProvidedRequiredArgumentsRule,\n} from './rules/ProvidedRequiredArgumentsRule.mjs'; // Spec Section: \"Leaf Field Selections\"\n\nimport { ScalarLeafsRule } from './rules/ScalarLeafsRule.mjs'; // Spec Section: \"Subscriptions with Single Root Field\"\n\nimport { SingleFieldSubscriptionsRule } from './rules/SingleFieldSubscriptionsRule.mjs';\nimport { UniqueArgumentDefinitionNamesRule } from './rules/UniqueArgumentDefinitionNamesRule.mjs'; // Spec Section: \"Argument Uniqueness\"\n\nimport { UniqueArgumentNamesRule } from './rules/UniqueArgumentNamesRule.mjs';\nimport { UniqueDirectiveNamesRule } from './rules/UniqueDirectiveNamesRule.mjs'; // Spec Section: \"Directives Are Unique Per Location\"\n\nimport { UniqueDirectivesPerLocationRule } from './rules/UniqueDirectivesPerLocationRule.mjs';\nimport { UniqueEnumValueNamesRule } from './rules/UniqueEnumValueNamesRule.mjs';\nimport { UniqueFieldDefinitionNamesRule } from './rules/UniqueFieldDefinitionNamesRule.mjs'; // Spec Section: \"Fragment Name Uniqueness\"\n\nimport { UniqueFragmentNamesRule } from './rules/UniqueFragmentNamesRule.mjs'; // Spec Section: \"Input Object Field Uniqueness\"\n\nimport { UniqueInputFieldNamesRule } from './rules/UniqueInputFieldNamesRule.mjs'; // Spec Section: \"Operation Name Uniqueness\"\n\nimport { UniqueOperationNamesRule } from './rules/UniqueOperationNamesRule.mjs';\nimport { UniqueOperationTypesRule } from './rules/UniqueOperationTypesRule.mjs';\nimport { UniqueTypeNamesRule } from './rules/UniqueTypeNamesRule.mjs'; // Spec Section: \"Variable Uniqueness\"\n\nimport { UniqueVariableNamesRule } from './rules/UniqueVariableNamesRule.mjs'; // Spec Section: \"Value Type Correctness\"\n\nimport { ValuesOfCorrectTypeRule } from './rules/ValuesOfCorrectTypeRule.mjs'; // Spec Section: \"Variables are Input Types\"\n\nimport { VariablesAreInputTypesRule } from './rules/VariablesAreInputTypesRule.mjs'; // Spec Section: \"All Variable Usages Are Allowed\"\n\nimport { VariablesInAllowedPositionRule } from './rules/VariablesInAllowedPositionRule.mjs';\n\n/**\n * Technically these aren't part of the spec but they are strongly encouraged\n * validation rules.\n */\nexport const recommendedRules = Object.freeze([MaxIntrospectionDepthRule]);\n/**\n * This set includes all validation rules defined by the GraphQL spec.\n *\n * The order of the rules in this list has been adjusted to lead to the\n * most clear output when encountering multiple validation errors.\n */\n\nexport const specifiedRules = Object.freeze([\n ExecutableDefinitionsRule,\n UniqueOperationNamesRule,\n LoneAnonymousOperationRule,\n SingleFieldSubscriptionsRule,\n KnownTypeNamesRule,\n FragmentsOnCompositeTypesRule,\n VariablesAreInputTypesRule,\n ScalarLeafsRule,\n FieldsOnCorrectTypeRule,\n UniqueFragmentNamesRule,\n KnownFragmentNamesRule,\n NoUnusedFragmentsRule,\n PossibleFragmentSpreadsRule,\n NoFragmentCyclesRule,\n UniqueVariableNamesRule,\n NoUndefinedVariablesRule,\n NoUnusedVariablesRule,\n KnownDirectivesRule,\n UniqueDirectivesPerLocationRule,\n KnownArgumentNamesRule,\n UniqueArgumentNamesRule,\n ValuesOfCorrectTypeRule,\n ProvidedRequiredArgumentsRule,\n VariablesInAllowedPositionRule,\n OverlappingFieldsCanBeMergedRule,\n UniqueInputFieldNamesRule,\n ...recommendedRules,\n]);\n/**\n * @internal\n */\n\nexport const specifiedSDLRules = Object.freeze([\n LoneSchemaDefinitionRule,\n UniqueOperationTypesRule,\n UniqueTypeNamesRule,\n UniqueEnumValueNamesRule,\n UniqueFieldDefinitionNamesRule,\n UniqueArgumentDefinitionNamesRule,\n UniqueDirectiveNamesRule,\n KnownTypeNamesRule,\n KnownDirectivesRule,\n UniqueDirectivesPerLocationRule,\n PossibleTypeExtensionsRule,\n KnownArgumentNamesOnDirectivesRule,\n UniqueArgumentNamesRule,\n UniqueInputFieldNamesRule,\n ProvidedRequiredArgumentsOnDirectivesRule,\n]);\n", "import { Kind } from '../language/kinds.mjs';\nimport { visit } from '../language/visitor.mjs';\nimport { TypeInfo, visitWithTypeInfo } from '../utilities/TypeInfo.mjs';\n\n/**\n * An instance of this class is passed as the \"this\" context to all validators,\n * allowing access to commonly useful contextual information from within a\n * validation rule.\n */\nexport class ASTValidationContext {\n constructor(ast, onError) {\n this._ast = ast;\n this._fragments = undefined;\n this._fragmentSpreads = new Map();\n this._recursivelyReferencedFragments = new Map();\n this._onError = onError;\n }\n\n get [Symbol.toStringTag]() {\n return 'ASTValidationContext';\n }\n\n reportError(error) {\n this._onError(error);\n }\n\n getDocument() {\n return this._ast;\n }\n\n getFragment(name) {\n let fragments;\n\n if (this._fragments) {\n fragments = this._fragments;\n } else {\n fragments = Object.create(null);\n\n for (const defNode of this.getDocument().definitions) {\n if (defNode.kind === Kind.FRAGMENT_DEFINITION) {\n fragments[defNode.name.value] = defNode;\n }\n }\n\n this._fragments = fragments;\n }\n\n return fragments[name];\n }\n\n getFragmentSpreads(node) {\n let spreads = this._fragmentSpreads.get(node);\n\n if (!spreads) {\n spreads = [];\n const setsToVisit = [node];\n let set;\n\n while ((set = setsToVisit.pop())) {\n for (const selection of set.selections) {\n if (selection.kind === Kind.FRAGMENT_SPREAD) {\n spreads.push(selection);\n } else if (selection.selectionSet) {\n setsToVisit.push(selection.selectionSet);\n }\n }\n }\n\n this._fragmentSpreads.set(node, spreads);\n }\n\n return spreads;\n }\n\n getRecursivelyReferencedFragments(operation) {\n let fragments = this._recursivelyReferencedFragments.get(operation);\n\n if (!fragments) {\n fragments = [];\n const collectedNames = Object.create(null);\n const nodesToVisit = [operation.selectionSet];\n let node;\n\n while ((node = nodesToVisit.pop())) {\n for (const spread of this.getFragmentSpreads(node)) {\n const fragName = spread.name.value;\n\n if (collectedNames[fragName] !== true) {\n collectedNames[fragName] = true;\n const fragment = this.getFragment(fragName);\n\n if (fragment) {\n fragments.push(fragment);\n nodesToVisit.push(fragment.selectionSet);\n }\n }\n }\n }\n\n this._recursivelyReferencedFragments.set(operation, fragments);\n }\n\n return fragments;\n }\n}\nexport class SDLValidationContext extends ASTValidationContext {\n constructor(ast, schema, onError) {\n super(ast, onError);\n this._schema = schema;\n }\n\n get [Symbol.toStringTag]() {\n return 'SDLValidationContext';\n }\n\n getSchema() {\n return this._schema;\n }\n}\nexport class ValidationContext extends ASTValidationContext {\n constructor(schema, ast, typeInfo, onError) {\n super(ast, onError);\n this._schema = schema;\n this._typeInfo = typeInfo;\n this._variableUsages = new Map();\n this._recursiveVariableUsages = new Map();\n }\n\n get [Symbol.toStringTag]() {\n return 'ValidationContext';\n }\n\n getSchema() {\n return this._schema;\n }\n\n getVariableUsages(node) {\n let usages = this._variableUsages.get(node);\n\n if (!usages) {\n const newUsages = [];\n const typeInfo = new TypeInfo(this._schema);\n visit(\n node,\n visitWithTypeInfo(typeInfo, {\n VariableDefinition: () => false,\n\n Variable(variable) {\n newUsages.push({\n node: variable,\n type: typeInfo.getInputType(),\n defaultValue: typeInfo.getDefaultValue(),\n parentType: typeInfo.getParentInputType(),\n });\n },\n }),\n );\n usages = newUsages;\n\n this._variableUsages.set(node, usages);\n }\n\n return usages;\n }\n\n getRecursiveVariableUsages(operation) {\n let usages = this._recursiveVariableUsages.get(operation);\n\n if (!usages) {\n usages = this.getVariableUsages(operation);\n\n for (const frag of this.getRecursivelyReferencedFragments(operation)) {\n usages = usages.concat(this.getVariableUsages(frag));\n }\n\n this._recursiveVariableUsages.set(operation, usages);\n }\n\n return usages;\n }\n\n getType() {\n return this._typeInfo.getType();\n }\n\n getParentType() {\n return this._typeInfo.getParentType();\n }\n\n getInputType() {\n return this._typeInfo.getInputType();\n }\n\n getParentInputType() {\n return this._typeInfo.getParentInputType();\n }\n\n getFieldDef() {\n return this._typeInfo.getFieldDef();\n }\n\n getDirective() {\n return this._typeInfo.getDirective();\n }\n\n getArgument() {\n return this._typeInfo.getArgument();\n }\n\n getEnumValue() {\n return this._typeInfo.getEnumValue();\n }\n}\n", "import { devAssert } from '../jsutils/devAssert.mjs';\nimport { GraphQLError } from '../error/GraphQLError.mjs';\nimport { visit, visitInParallel } from '../language/visitor.mjs';\nimport { assertValidSchema } from '../type/validate.mjs';\nimport { TypeInfo, visitWithTypeInfo } from '../utilities/TypeInfo.mjs';\nimport { specifiedRules, specifiedSDLRules } from './specifiedRules.mjs';\nimport {\n SDLValidationContext,\n ValidationContext,\n} from './ValidationContext.mjs';\n/**\n * Implements the \"Validation\" section of the spec.\n *\n * Validation runs synchronously, returning an array of encountered errors, or\n * an empty array if no errors were encountered and the document is valid.\n *\n * A list of specific validation rules may be provided. If not provided, the\n * default list of rules defined by the GraphQL specification will be used.\n *\n * Each validation rules is a function which returns a visitor\n * (see the language/visitor API). Visitor methods are expected to return\n * GraphQLErrors, or Arrays of GraphQLErrors when invalid.\n *\n * Validate will stop validation after a `maxErrors` limit has been reached.\n * Attackers can send pathologically invalid queries to induce a DoS attack,\n * so by default `maxErrors` set to 100 errors.\n *\n * Optionally a custom TypeInfo instance may be provided. If not provided, one\n * will be created from the provided schema.\n */\n\nexport function validate(\n schema,\n documentAST,\n rules = specifiedRules,\n options,\n /** @deprecated will be removed in 17.0.0 */\n typeInfo = new TypeInfo(schema),\n) {\n var _options$maxErrors;\n\n const maxErrors =\n (_options$maxErrors =\n options === null || options === void 0 ? void 0 : options.maxErrors) !==\n null && _options$maxErrors !== void 0\n ? _options$maxErrors\n : 100;\n documentAST || devAssert(false, 'Must provide document.'); // If the schema used for validation is invalid, throw an error.\n\n assertValidSchema(schema);\n const abortObj = Object.freeze({});\n const errors = [];\n const context = new ValidationContext(\n schema,\n documentAST,\n typeInfo,\n (error) => {\n if (errors.length >= maxErrors) {\n errors.push(\n new GraphQLError(\n 'Too many validation errors, error limit reached. Validation aborted.',\n ),\n ); // eslint-disable-next-line @typescript-eslint/no-throw-literal\n\n throw abortObj;\n }\n\n errors.push(error);\n },\n ); // This uses a specialized visitor which runs multiple visitors in parallel,\n // while maintaining the visitor skip and break API.\n\n const visitor = visitInParallel(rules.map((rule) => rule(context))); // Visit the whole document with each instance of all provided rules.\n\n try {\n visit(documentAST, visitWithTypeInfo(typeInfo, visitor));\n } catch (e) {\n if (e !== abortObj) {\n throw e;\n }\n }\n\n return errors;\n}\n/**\n * @internal\n */\n\nexport function validateSDL(\n documentAST,\n schemaToExtend,\n rules = specifiedSDLRules,\n) {\n const errors = [];\n const context = new SDLValidationContext(\n documentAST,\n schemaToExtend,\n (error) => {\n errors.push(error);\n },\n );\n const visitors = rules.map((rule) => rule(context));\n visit(documentAST, visitInParallel(visitors));\n return errors;\n}\n/**\n * Utility function which asserts a SDL document is valid by throwing an error\n * if it is invalid.\n *\n * @internal\n */\n\nexport function assertValidSDL(documentAST) {\n const errors = validateSDL(documentAST);\n\n if (errors.length !== 0) {\n throw new Error(errors.map((error) => error.message).join('\\n\\n'));\n }\n}\n/**\n * Utility function which asserts a SDL document is valid by throwing an error\n * if it is invalid.\n *\n * @internal\n */\n\nexport function assertValidSDLExtension(documentAST, schema) {\n const errors = validateSDL(documentAST, schema);\n\n if (errors.length !== 0) {\n throw new Error(errors.map((error) => error.message).join('\\n\\n'));\n }\n}\n", "/**\n * Memoizes the provided three-argument function.\n */\nexport function memoize3(fn) {\n let cache0;\n return function memoized(a1, a2, a3) {\n if (cache0 === undefined) {\n cache0 = new WeakMap();\n }\n\n let cache1 = cache0.get(a1);\n\n if (cache1 === undefined) {\n cache1 = new WeakMap();\n cache0.set(a1, cache1);\n }\n\n let cache2 = cache1.get(a2);\n\n if (cache2 === undefined) {\n cache2 = new WeakMap();\n cache1.set(a2, cache2);\n }\n\n let fnResult = cache2.get(a3);\n\n if (fnResult === undefined) {\n fnResult = fn(a1, a2, a3);\n cache2.set(a3, fnResult);\n }\n\n return fnResult;\n };\n}\n", "/**\n * This function transforms a JS object `ObjMap>` into\n * a `Promise>`\n *\n * This is akin to bluebird's `Promise.props`, but implemented only using\n * `Promise.all` so it will work with any implementation of ES6 promises.\n */\nexport function promiseForObject(object) {\n return Promise.all(Object.values(object)).then((resolvedValues) => {\n const resolvedObject = Object.create(null);\n\n for (const [i, key] of Object.keys(object).entries()) {\n resolvedObject[key] = resolvedValues[i];\n }\n\n return resolvedObject;\n });\n}\n", "import { isPromise } from './isPromise.mjs';\n\n/**\n * Similar to Array.prototype.reduce(), however the reducing callback may return\n * a Promise, in which case reduction will continue after each promise resolves.\n *\n * If the callback does not return a Promise, then this function will also not\n * return a Promise.\n */\nexport function promiseReduce(values, callbackFn, initialValue) {\n let accumulator = initialValue;\n\n for (const value of values) {\n accumulator = isPromise(accumulator)\n ? accumulator.then((resolved) => callbackFn(resolved, value))\n : callbackFn(accumulator, value);\n }\n\n return accumulator;\n}\n", "import { inspect } from './inspect.mjs';\n/**\n * Sometimes a non-error is thrown, wrap it as an Error instance to ensure a consistent Error interface.\n */\n\nexport function toError(thrownValue) {\n return thrownValue instanceof Error\n ? thrownValue\n : new NonErrorThrown(thrownValue);\n}\n\nclass NonErrorThrown extends Error {\n constructor(thrownValue) {\n super('Unexpected error value: ' + inspect(thrownValue));\n this.name = 'NonErrorThrown';\n this.thrownValue = thrownValue;\n }\n}\n", "import { toError } from '../jsutils/toError.mjs';\nimport { GraphQLError } from './GraphQLError.mjs';\n/**\n * Given an arbitrary value, presumably thrown while attempting to execute a\n * GraphQL operation, produce a new GraphQLError aware of the location in the\n * document responsible for the original Error.\n */\n\nexport function locatedError(rawOriginalError, nodes, path) {\n var _nodes;\n\n const originalError = toError(rawOriginalError); // Note: this uses a brand-check to support GraphQL errors originating from other contexts.\n\n if (isLocatedGraphQLError(originalError)) {\n return originalError;\n }\n\n return new GraphQLError(originalError.message, {\n nodes:\n (_nodes = originalError.nodes) !== null && _nodes !== void 0\n ? _nodes\n : nodes,\n source: originalError.source,\n positions: originalError.positions,\n path,\n originalError,\n });\n}\n\nfunction isLocatedGraphQLError(error) {\n return Array.isArray(error.path);\n}\n", "import { devAssert } from '../jsutils/devAssert.mjs';\nimport { inspect } from '../jsutils/inspect.mjs';\nimport { invariant } from '../jsutils/invariant.mjs';\nimport { isIterableObject } from '../jsutils/isIterableObject.mjs';\nimport { isObjectLike } from '../jsutils/isObjectLike.mjs';\nimport { isPromise } from '../jsutils/isPromise.mjs';\nimport { memoize3 } from '../jsutils/memoize3.mjs';\nimport { addPath, pathToArray } from '../jsutils/Path.mjs';\nimport { promiseForObject } from '../jsutils/promiseForObject.mjs';\nimport { promiseReduce } from '../jsutils/promiseReduce.mjs';\nimport { GraphQLError } from '../error/GraphQLError.mjs';\nimport { locatedError } from '../error/locatedError.mjs';\nimport { OperationTypeNode } from '../language/ast.mjs';\nimport { Kind } from '../language/kinds.mjs';\nimport {\n isAbstractType,\n isLeafType,\n isListType,\n isNonNullType,\n isObjectType,\n} from '../type/definition.mjs';\nimport {\n SchemaMetaFieldDef,\n TypeMetaFieldDef,\n TypeNameMetaFieldDef,\n} from '../type/introspection.mjs';\nimport { assertValidSchema } from '../type/validate.mjs';\nimport {\n collectFields,\n collectSubfields as _collectSubfields,\n} from './collectFields.mjs';\nimport { getArgumentValues, getVariableValues } from './values.mjs';\n/**\n * A memoized collection of relevant subfields with regard to the return\n * type. Memoizing ensures the subfields are not repeatedly calculated, which\n * saves overhead when resolving lists of values.\n */\n\nconst collectSubfields = memoize3((exeContext, returnType, fieldNodes) =>\n _collectSubfields(\n exeContext.schema,\n exeContext.fragments,\n exeContext.variableValues,\n returnType,\n fieldNodes,\n ),\n);\n/**\n * Terminology\n *\n * \"Definitions\" are the generic name for top-level statements in the document.\n * Examples of this include:\n * 1) Operations (such as a query)\n * 2) Fragments\n *\n * \"Operations\" are a generic name for requests in the document.\n * Examples of this include:\n * 1) query,\n * 2) mutation\n *\n * \"Selections\" are the definitions that can appear legally and at\n * single level of the query. These include:\n * 1) field references e.g `a`\n * 2) fragment \"spreads\" e.g. `...c`\n * 3) inline fragment \"spreads\" e.g. `...on Type { a }`\n */\n\n/**\n * Data that must be available at all points during query execution.\n *\n * Namely, schema of the type system that is currently executing,\n * and the fragments defined in the query document\n */\n\n/**\n * Implements the \"Executing requests\" section of the GraphQL specification.\n *\n * Returns either a synchronous ExecutionResult (if all encountered resolvers\n * are synchronous), or a Promise of an ExecutionResult that will eventually be\n * resolved and never rejected.\n *\n * If the arguments to this function do not result in a legal execution context,\n * a GraphQLError will be thrown immediately explaining the invalid input.\n */\nexport function execute(args) {\n // Temporary for v15 to v16 migration. Remove in v17\n arguments.length < 2 ||\n devAssert(\n false,\n 'graphql@16 dropped long-deprecated support for positional arguments, please pass an object instead.',\n );\n const { schema, document, variableValues, rootValue } = args; // If arguments are missing or incorrect, throw an error.\n\n assertValidExecutionArguments(schema, document, variableValues); // If a valid execution context cannot be created due to incorrect arguments,\n // a \"Response\" with only errors is returned.\n\n const exeContext = buildExecutionContext(args); // Return early errors if execution context failed.\n\n if (!('schema' in exeContext)) {\n return {\n errors: exeContext,\n };\n } // Return a Promise that will eventually resolve to the data described by\n // The \"Response\" section of the GraphQL specification.\n //\n // If errors are encountered while executing a GraphQL field, only that\n // field and its descendants will be omitted, and sibling fields will still\n // be executed. An execution which encounters errors will still result in a\n // resolved Promise.\n //\n // Errors from sub-fields of a NonNull type may propagate to the top level,\n // at which point we still log the error and null the parent field, which\n // in this case is the entire response.\n\n try {\n const { operation } = exeContext;\n const result = executeOperation(exeContext, operation, rootValue);\n\n if (isPromise(result)) {\n return result.then(\n (data) => buildResponse(data, exeContext.errors),\n (error) => {\n exeContext.errors.push(error);\n return buildResponse(null, exeContext.errors);\n },\n );\n }\n\n return buildResponse(result, exeContext.errors);\n } catch (error) {\n exeContext.errors.push(error);\n return buildResponse(null, exeContext.errors);\n }\n}\n/**\n * Also implements the \"Executing requests\" section of the GraphQL specification.\n * However, it guarantees to complete synchronously (or throw an error) assuming\n * that all field resolvers are also synchronous.\n */\n\nexport function executeSync(args) {\n const result = execute(args); // Assert that the execution was synchronous.\n\n if (isPromise(result)) {\n throw new Error('GraphQL execution failed to complete synchronously.');\n }\n\n return result;\n}\n/**\n * Given a completed execution context and data, build the `{ errors, data }`\n * response defined by the \"Response\" section of the GraphQL specification.\n */\n\nfunction buildResponse(data, errors) {\n return errors.length === 0\n ? {\n data,\n }\n : {\n errors,\n data,\n };\n}\n/**\n * Essential assertions before executing to provide developer feedback for\n * improper use of the GraphQL library.\n *\n * @internal\n */\n\nexport function assertValidExecutionArguments(\n schema,\n document,\n rawVariableValues,\n) {\n document || devAssert(false, 'Must provide document.'); // If the schema used for execution is invalid, throw an error.\n\n assertValidSchema(schema); // Variables, if provided, must be an object.\n\n rawVariableValues == null ||\n isObjectLike(rawVariableValues) ||\n devAssert(\n false,\n '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.',\n );\n}\n/**\n * Constructs a ExecutionContext object from the arguments passed to\n * execute, which we will pass throughout the other execution methods.\n *\n * Throws a GraphQLError if a valid execution context cannot be created.\n *\n * @internal\n */\n\nexport function buildExecutionContext(args) {\n var _definition$name, _operation$variableDe, _options$maxCoercionE;\n\n const {\n schema,\n document,\n rootValue,\n contextValue,\n variableValues: rawVariableValues,\n operationName,\n fieldResolver,\n typeResolver,\n subscribeFieldResolver,\n options,\n } = args;\n let operation;\n const fragments = Object.create(null);\n\n for (const definition of document.definitions) {\n switch (definition.kind) {\n case Kind.OPERATION_DEFINITION:\n if (operationName == null) {\n if (operation !== undefined) {\n return [\n new GraphQLError(\n 'Must provide operation name if query contains multiple operations.',\n ),\n ];\n }\n\n operation = definition;\n } else if (\n ((_definition$name = definition.name) === null ||\n _definition$name === void 0\n ? void 0\n : _definition$name.value) === operationName\n ) {\n operation = definition;\n }\n\n break;\n\n case Kind.FRAGMENT_DEFINITION:\n fragments[definition.name.value] = definition;\n break;\n\n default: // ignore non-executable definitions\n }\n }\n\n if (!operation) {\n if (operationName != null) {\n return [new GraphQLError(`Unknown operation named \"${operationName}\".`)];\n }\n\n return [new GraphQLError('Must provide an operation.')];\n } // FIXME: https://github.com/graphql/graphql-js/issues/2203\n\n /* c8 ignore next */\n\n const variableDefinitions =\n (_operation$variableDe = operation.variableDefinitions) !== null &&\n _operation$variableDe !== void 0\n ? _operation$variableDe\n : [];\n const coercedVariableValues = getVariableValues(\n schema,\n variableDefinitions,\n rawVariableValues !== null && rawVariableValues !== void 0\n ? rawVariableValues\n : {},\n {\n maxErrors:\n (_options$maxCoercionE =\n options === null || options === void 0\n ? void 0\n : options.maxCoercionErrors) !== null &&\n _options$maxCoercionE !== void 0\n ? _options$maxCoercionE\n : 50,\n },\n );\n\n if (coercedVariableValues.errors) {\n return coercedVariableValues.errors;\n }\n\n return {\n schema,\n fragments,\n rootValue,\n contextValue,\n operation,\n variableValues: coercedVariableValues.coerced,\n fieldResolver:\n fieldResolver !== null && fieldResolver !== void 0\n ? fieldResolver\n : defaultFieldResolver,\n typeResolver:\n typeResolver !== null && typeResolver !== void 0\n ? typeResolver\n : defaultTypeResolver,\n subscribeFieldResolver:\n subscribeFieldResolver !== null && subscribeFieldResolver !== void 0\n ? subscribeFieldResolver\n : defaultFieldResolver,\n errors: [],\n };\n}\n/**\n * Implements the \"Executing operations\" section of the spec.\n */\n\nfunction executeOperation(exeContext, operation, rootValue) {\n const rootType = exeContext.schema.getRootType(operation.operation);\n\n if (rootType == null) {\n throw new GraphQLError(\n `Schema is not configured to execute ${operation.operation} operation.`,\n {\n nodes: operation,\n },\n );\n }\n\n const rootFields = collectFields(\n exeContext.schema,\n exeContext.fragments,\n exeContext.variableValues,\n rootType,\n operation.selectionSet,\n );\n const path = undefined;\n\n switch (operation.operation) {\n case OperationTypeNode.QUERY:\n return executeFields(exeContext, rootType, rootValue, path, rootFields);\n\n case OperationTypeNode.MUTATION:\n return executeFieldsSerially(\n exeContext,\n rootType,\n rootValue,\n path,\n rootFields,\n );\n\n case OperationTypeNode.SUBSCRIPTION:\n // TODO: deprecate `subscribe` and move all logic here\n // Temporary solution until we finish merging execute and subscribe together\n return executeFields(exeContext, rootType, rootValue, path, rootFields);\n }\n}\n/**\n * Implements the \"Executing selection sets\" section of the spec\n * for fields that must be executed serially.\n */\n\nfunction executeFieldsSerially(\n exeContext,\n parentType,\n sourceValue,\n path,\n fields,\n) {\n return promiseReduce(\n fields.entries(),\n (results, [responseName, fieldNodes]) => {\n const fieldPath = addPath(path, responseName, parentType.name);\n const result = executeField(\n exeContext,\n parentType,\n sourceValue,\n fieldNodes,\n fieldPath,\n );\n\n if (result === undefined) {\n return results;\n }\n\n if (isPromise(result)) {\n return result.then((resolvedResult) => {\n results[responseName] = resolvedResult;\n return results;\n });\n }\n\n results[responseName] = result;\n return results;\n },\n Object.create(null),\n );\n}\n/**\n * Implements the \"Executing selection sets\" section of the spec\n * for fields that may be executed in parallel.\n */\n\nfunction executeFields(exeContext, parentType, sourceValue, path, fields) {\n const results = Object.create(null);\n let containsPromise = false;\n\n try {\n for (const [responseName, fieldNodes] of fields.entries()) {\n const fieldPath = addPath(path, responseName, parentType.name);\n const result = executeField(\n exeContext,\n parentType,\n sourceValue,\n fieldNodes,\n fieldPath,\n );\n\n if (result !== undefined) {\n results[responseName] = result;\n\n if (isPromise(result)) {\n containsPromise = true;\n }\n }\n }\n } catch (error) {\n if (containsPromise) {\n // Ensure that any promises returned by other fields are handled, as they may also reject.\n return promiseForObject(results).finally(() => {\n throw error;\n });\n }\n\n throw error;\n } // If there are no promises, we can just return the object\n\n if (!containsPromise) {\n return results;\n } // Otherwise, results is a map from field name to the result of resolving that\n // field, which is possibly a promise. Return a promise that will return this\n // same map, but with any promises replaced with the values they resolved to.\n\n return promiseForObject(results);\n}\n/**\n * Implements the \"Executing fields\" section of the spec\n * In particular, this function figures out the value that the field returns by\n * calling its resolve function, then calls completeValue to complete promises,\n * serialize scalars, or execute the sub-selection-set for objects.\n */\n\nfunction executeField(exeContext, parentType, source, fieldNodes, path) {\n var _fieldDef$resolve;\n\n const fieldDef = getFieldDef(exeContext.schema, parentType, fieldNodes[0]);\n\n if (!fieldDef) {\n return;\n }\n\n const returnType = fieldDef.type;\n const resolveFn =\n (_fieldDef$resolve = fieldDef.resolve) !== null &&\n _fieldDef$resolve !== void 0\n ? _fieldDef$resolve\n : exeContext.fieldResolver;\n const info = buildResolveInfo(\n exeContext,\n fieldDef,\n fieldNodes,\n parentType,\n path,\n ); // Get the resolve function, regardless of if its result is normal or abrupt (error).\n\n try {\n // Build a JS object of arguments from the field.arguments AST, using the\n // variables scope to fulfill any variable references.\n // TODO: find a way to memoize, in case this field is within a List type.\n const args = getArgumentValues(\n fieldDef,\n fieldNodes[0],\n exeContext.variableValues,\n ); // The resolve function's optional third argument is a context value that\n // is provided to every resolve function within an execution. It is commonly\n // used to represent an authenticated user, or request-specific caches.\n\n const contextValue = exeContext.contextValue;\n const result = resolveFn(source, args, contextValue, info);\n let completed;\n\n if (isPromise(result)) {\n completed = result.then((resolved) =>\n completeValue(exeContext, returnType, fieldNodes, info, path, resolved),\n );\n } else {\n completed = completeValue(\n exeContext,\n returnType,\n fieldNodes,\n info,\n path,\n result,\n );\n }\n\n if (isPromise(completed)) {\n // Note: we don't rely on a `catch` method, but we do expect \"thenable\"\n // to take a second callback for the error case.\n return completed.then(undefined, (rawError) => {\n const error = locatedError(rawError, fieldNodes, pathToArray(path));\n return handleFieldError(error, returnType, exeContext);\n });\n }\n\n return completed;\n } catch (rawError) {\n const error = locatedError(rawError, fieldNodes, pathToArray(path));\n return handleFieldError(error, returnType, exeContext);\n }\n}\n/**\n * @internal\n */\n\nexport function buildResolveInfo(\n exeContext,\n fieldDef,\n fieldNodes,\n parentType,\n path,\n) {\n // The resolve function's optional fourth argument is a collection of\n // information about the current execution state.\n return {\n fieldName: fieldDef.name,\n fieldNodes,\n returnType: fieldDef.type,\n parentType,\n path,\n schema: exeContext.schema,\n fragments: exeContext.fragments,\n rootValue: exeContext.rootValue,\n operation: exeContext.operation,\n variableValues: exeContext.variableValues,\n };\n}\n\nfunction handleFieldError(error, returnType, exeContext) {\n // If the field type is non-nullable, then it is resolved without any\n // protection from errors, however it still properly locates the error.\n if (isNonNullType(returnType)) {\n throw error;\n } // Otherwise, error protection is applied, logging the error and resolving\n // a null value for this field if one is encountered.\n\n exeContext.errors.push(error);\n return null;\n}\n/**\n * Implements the instructions for completeValue as defined in the\n * \"Value Completion\" section of the spec.\n *\n * If the field type is Non-Null, then this recursively completes the value\n * for the inner type. It throws a field error if that completion returns null,\n * as per the \"Nullability\" section of the spec.\n *\n * If the field type is a List, then this recursively completes the value\n * for the inner type on each item in the list.\n *\n * If the field type is a Scalar or Enum, ensures the completed value is a legal\n * value of the type by calling the `serialize` method of GraphQL type\n * definition.\n *\n * If the field is an abstract type, determine the runtime type of the value\n * and then complete based on that type\n *\n * Otherwise, the field type expects a sub-selection set, and will complete the\n * value by executing all sub-selections.\n */\n\nfunction completeValue(exeContext, returnType, fieldNodes, info, path, result) {\n // If result is an Error, throw a located error.\n if (result instanceof Error) {\n throw result;\n } // If field type is NonNull, complete for inner type, and throw field error\n // if result is null.\n\n if (isNonNullType(returnType)) {\n const completed = completeValue(\n exeContext,\n returnType.ofType,\n fieldNodes,\n info,\n path,\n result,\n );\n\n if (completed === null) {\n throw new Error(\n `Cannot return null for non-nullable field ${info.parentType.name}.${info.fieldName}.`,\n );\n }\n\n return completed;\n } // If result value is null or undefined then return null.\n\n if (result == null) {\n return null;\n } // If field type is List, complete each item in the list with the inner type\n\n if (isListType(returnType)) {\n return completeListValue(\n exeContext,\n returnType,\n fieldNodes,\n info,\n path,\n result,\n );\n } // If field type is a leaf type, Scalar or Enum, serialize to a valid value,\n // returning null if serialization is not possible.\n\n if (isLeafType(returnType)) {\n return completeLeafValue(returnType, result);\n } // If field type is an abstract type, Interface or Union, determine the\n // runtime Object type and complete for that type.\n\n if (isAbstractType(returnType)) {\n return completeAbstractValue(\n exeContext,\n returnType,\n fieldNodes,\n info,\n path,\n result,\n );\n } // If field type is Object, execute and complete all sub-selections.\n\n if (isObjectType(returnType)) {\n return completeObjectValue(\n exeContext,\n returnType,\n fieldNodes,\n info,\n path,\n result,\n );\n }\n /* c8 ignore next 6 */\n // Not reachable, all possible output types have been considered.\n\n false ||\n invariant(\n false,\n 'Cannot complete value of unexpected output type: ' + inspect(returnType),\n );\n}\n/**\n * Complete a list value by completing each item in the list with the\n * inner type\n */\n\nfunction completeListValue(\n exeContext,\n returnType,\n fieldNodes,\n info,\n path,\n result,\n) {\n if (!isIterableObject(result)) {\n throw new GraphQLError(\n `Expected Iterable, but did not find one for field \"${info.parentType.name}.${info.fieldName}\".`,\n );\n } // This is specified as a simple map, however we're optimizing the path\n // where the list contains no Promises by avoiding creating another Promise.\n\n const itemType = returnType.ofType;\n let containsPromise = false;\n const completedResults = Array.from(result, (item, index) => {\n // No need to modify the info object containing the path,\n // since from here on it is not ever accessed by resolver functions.\n const itemPath = addPath(path, index, undefined);\n\n try {\n let completedItem;\n\n if (isPromise(item)) {\n completedItem = item.then((resolved) =>\n completeValue(\n exeContext,\n itemType,\n fieldNodes,\n info,\n itemPath,\n resolved,\n ),\n );\n } else {\n completedItem = completeValue(\n exeContext,\n itemType,\n fieldNodes,\n info,\n itemPath,\n item,\n );\n }\n\n if (isPromise(completedItem)) {\n containsPromise = true; // Note: we don't rely on a `catch` method, but we do expect \"thenable\"\n // to take a second callback for the error case.\n\n return completedItem.then(undefined, (rawError) => {\n const error = locatedError(\n rawError,\n fieldNodes,\n pathToArray(itemPath),\n );\n return handleFieldError(error, itemType, exeContext);\n });\n }\n\n return completedItem;\n } catch (rawError) {\n const error = locatedError(rawError, fieldNodes, pathToArray(itemPath));\n return handleFieldError(error, itemType, exeContext);\n }\n });\n return containsPromise ? Promise.all(completedResults) : completedResults;\n}\n/**\n * Complete a Scalar or Enum by serializing to a valid value, returning\n * null if serialization is not possible.\n */\n\nfunction completeLeafValue(returnType, result) {\n const serializedResult = returnType.serialize(result);\n\n if (serializedResult == null) {\n throw new Error(\n `Expected \\`${inspect(returnType)}.serialize(${inspect(result)})\\` to ` +\n `return non-nullable value, returned: ${inspect(serializedResult)}`,\n );\n }\n\n return serializedResult;\n}\n/**\n * Complete a value of an abstract type by determining the runtime object type\n * of that value, then complete the value for that type.\n */\n\nfunction completeAbstractValue(\n exeContext,\n returnType,\n fieldNodes,\n info,\n path,\n result,\n) {\n var _returnType$resolveTy;\n\n const resolveTypeFn =\n (_returnType$resolveTy = returnType.resolveType) !== null &&\n _returnType$resolveTy !== void 0\n ? _returnType$resolveTy\n : exeContext.typeResolver;\n const contextValue = exeContext.contextValue;\n const runtimeType = resolveTypeFn(result, contextValue, info, returnType);\n\n if (isPromise(runtimeType)) {\n return runtimeType.then((resolvedRuntimeType) =>\n completeObjectValue(\n exeContext,\n ensureValidRuntimeType(\n resolvedRuntimeType,\n exeContext,\n returnType,\n fieldNodes,\n info,\n result,\n ),\n fieldNodes,\n info,\n path,\n result,\n ),\n );\n }\n\n return completeObjectValue(\n exeContext,\n ensureValidRuntimeType(\n runtimeType,\n exeContext,\n returnType,\n fieldNodes,\n info,\n result,\n ),\n fieldNodes,\n info,\n path,\n result,\n );\n}\n\nfunction ensureValidRuntimeType(\n runtimeTypeName,\n exeContext,\n returnType,\n fieldNodes,\n info,\n result,\n) {\n if (runtimeTypeName == null) {\n throw new GraphQLError(\n `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.`,\n fieldNodes,\n );\n } // releases before 16.0.0 supported returning `GraphQLObjectType` from `resolveType`\n // TODO: remove in 17.0.0 release\n\n if (isObjectType(runtimeTypeName)) {\n throw new GraphQLError(\n 'Support for returning GraphQLObjectType from resolveType was removed in graphql-js@16.0.0 please return type name instead.',\n );\n }\n\n if (typeof runtimeTypeName !== 'string') {\n throw new GraphQLError(\n `Abstract type \"${returnType.name}\" must resolve to an Object type at runtime for field \"${info.parentType.name}.${info.fieldName}\" with ` +\n `value ${inspect(result)}, received \"${inspect(runtimeTypeName)}\".`,\n );\n }\n\n const runtimeType = exeContext.schema.getType(runtimeTypeName);\n\n if (runtimeType == null) {\n throw new GraphQLError(\n `Abstract type \"${returnType.name}\" was resolved to a type \"${runtimeTypeName}\" that does not exist inside the schema.`,\n {\n nodes: fieldNodes,\n },\n );\n }\n\n if (!isObjectType(runtimeType)) {\n throw new GraphQLError(\n `Abstract type \"${returnType.name}\" was resolved to a non-object type \"${runtimeTypeName}\".`,\n {\n nodes: fieldNodes,\n },\n );\n }\n\n if (!exeContext.schema.isSubType(returnType, runtimeType)) {\n throw new GraphQLError(\n `Runtime Object type \"${runtimeType.name}\" is not a possible type for \"${returnType.name}\".`,\n {\n nodes: fieldNodes,\n },\n );\n }\n\n return runtimeType;\n}\n/**\n * Complete an Object value by executing all sub-selections.\n */\n\nfunction completeObjectValue(\n exeContext,\n returnType,\n fieldNodes,\n info,\n path,\n result,\n) {\n // Collect sub-fields to execute to complete this value.\n const subFieldNodes = collectSubfields(exeContext, returnType, fieldNodes); // If there is an isTypeOf predicate function, call it with the\n // current result. If isTypeOf returns false, then raise an error rather\n // than continuing execution.\n\n if (returnType.isTypeOf) {\n const isTypeOf = returnType.isTypeOf(result, exeContext.contextValue, info);\n\n if (isPromise(isTypeOf)) {\n return isTypeOf.then((resolvedIsTypeOf) => {\n if (!resolvedIsTypeOf) {\n throw invalidReturnTypeError(returnType, result, fieldNodes);\n }\n\n return executeFields(\n exeContext,\n returnType,\n result,\n path,\n subFieldNodes,\n );\n });\n }\n\n if (!isTypeOf) {\n throw invalidReturnTypeError(returnType, result, fieldNodes);\n }\n }\n\n return executeFields(exeContext, returnType, result, path, subFieldNodes);\n}\n\nfunction invalidReturnTypeError(returnType, result, fieldNodes) {\n return new GraphQLError(\n `Expected value of type \"${returnType.name}\" but got: ${inspect(result)}.`,\n {\n nodes: fieldNodes,\n },\n );\n}\n/**\n * If a resolveType function is not given, then a default resolve behavior is\n * used which attempts two strategies:\n *\n * First, See if the provided value has a `__typename` field defined, if so, use\n * that value as name of the resolved type.\n *\n * Otherwise, test each possible type for the abstract type by calling\n * isTypeOf for the object being coerced, returning the first type that matches.\n */\n\nexport const defaultTypeResolver = function (\n value,\n contextValue,\n info,\n abstractType,\n) {\n // First, look for `__typename`.\n if (isObjectLike(value) && typeof value.__typename === 'string') {\n return value.__typename;\n } // Otherwise, test each possible type.\n\n const possibleTypes = info.schema.getPossibleTypes(abstractType);\n const promisedIsTypeOfResults = [];\n\n for (let i = 0; i < possibleTypes.length; i++) {\n const type = possibleTypes[i];\n\n if (type.isTypeOf) {\n const isTypeOfResult = type.isTypeOf(value, contextValue, info);\n\n if (isPromise(isTypeOfResult)) {\n promisedIsTypeOfResults[i] = isTypeOfResult;\n } else if (isTypeOfResult) {\n if (promisedIsTypeOfResults.length) {\n // Explicitly ignore any promise rejections\n Promise.allSettled(promisedIsTypeOfResults)\n /* c8 ignore next 3 */\n .catch(() => {\n // Do nothing\n });\n }\n\n return type.name;\n }\n }\n }\n\n if (promisedIsTypeOfResults.length) {\n return Promise.all(promisedIsTypeOfResults).then((isTypeOfResults) => {\n for (let i = 0; i < isTypeOfResults.length; i++) {\n if (isTypeOfResults[i]) {\n return possibleTypes[i].name;\n }\n }\n });\n }\n};\n/**\n * If a resolve function is not given, then a default resolve behavior is used\n * which takes the property of the source object of the same name as the field\n * and returns it as the result, or if it's a function, returns the result\n * of calling that function while passing along args and context value.\n */\n\nexport const defaultFieldResolver = function (\n source,\n args,\n contextValue,\n info,\n) {\n // ensure source is a value for which property access is acceptable.\n if (isObjectLike(source) || typeof source === 'function') {\n const property = source[info.fieldName];\n\n if (typeof property === 'function') {\n return source[info.fieldName](args, contextValue, info);\n }\n\n return property;\n }\n};\n/**\n * This method looks up the field on the given type definition.\n * It has special casing for the three introspection fields,\n * __schema, __type and __typename. __typename is special because\n * it can always be queried as a field, even in situations where no\n * other fields are allowed, like on a Union. __schema and __type\n * could get automatically added to the query type, but that would\n * require mutating type definitions, which would cause issues.\n *\n * @internal\n */\n\nexport function getFieldDef(schema, parentType, fieldNode) {\n const fieldName = fieldNode.name.value;\n\n if (\n fieldName === SchemaMetaFieldDef.name &&\n schema.getQueryType() === parentType\n ) {\n return SchemaMetaFieldDef;\n } else if (\n fieldName === TypeMetaFieldDef.name &&\n schema.getQueryType() === parentType\n ) {\n return TypeMetaFieldDef;\n } else if (fieldName === TypeNameMetaFieldDef.name) {\n return TypeNameMetaFieldDef;\n }\n\n return parentType.getFields()[fieldName];\n}\n", "import { devAssert } from './jsutils/devAssert.mjs';\nimport { isPromise } from './jsutils/isPromise.mjs';\nimport { parse } from './language/parser.mjs';\nimport { validateSchema } from './type/validate.mjs';\nimport { validate } from './validation/validate.mjs';\nimport { execute } from './execution/execute.mjs';\n/**\n * This is the primary entry point function for fulfilling GraphQL operations\n * by parsing, validating, and executing a GraphQL document along side a\n * GraphQL schema.\n *\n * More sophisticated GraphQL servers, such as those which persist queries,\n * may wish to separate the validation and execution phases to a static time\n * tooling step, and a server runtime step.\n *\n * Accepts either an object with named arguments, or individual arguments:\n *\n * schema:\n * The GraphQL type system to use when validating and executing a query.\n * source:\n * A GraphQL language formatted string representing the requested operation.\n * rootValue:\n * The value provided as the first argument to resolver functions on the top\n * level type (e.g. the query object type).\n * contextValue:\n * The context value is provided as an argument to resolver functions after\n * field arguments. It is used to pass shared information useful at any point\n * during executing this query, for example the currently logged in user and\n * connections to databases or other services.\n * variableValues:\n * A mapping of variable name to runtime value to use for all variables\n * defined in the requestString.\n * operationName:\n * The name of the operation to use if requestString contains multiple\n * possible operations. Can be omitted if requestString contains only\n * one operation.\n * fieldResolver:\n * A resolver function to use when one is not provided by the schema.\n * If not provided, the default field resolver is used (which looks for a\n * value or method on the source value with the field's name).\n * typeResolver:\n * A type resolver function to use when none is provided by the schema.\n * If not provided, the default type resolver is used (which looks for a\n * `__typename` field or alternatively calls the `isTypeOf` method).\n */\n\nexport function graphql(args) {\n // Always return a Promise for a consistent API.\n return new Promise((resolve) => resolve(graphqlImpl(args)));\n}\n/**\n * The graphqlSync function also fulfills GraphQL operations by parsing,\n * validating, and executing a GraphQL document along side a GraphQL schema.\n * However, it guarantees to complete synchronously (or throw an error) assuming\n * that all field resolvers are also synchronous.\n */\n\nexport function graphqlSync(args) {\n const result = graphqlImpl(args); // Assert that the execution was synchronous.\n\n if (isPromise(result)) {\n throw new Error('GraphQL execution failed to complete synchronously.');\n }\n\n return result;\n}\n\nfunction graphqlImpl(args) {\n // Temporary for v15 to v16 migration. Remove in v17\n arguments.length < 2 ||\n devAssert(\n false,\n 'graphql@16 dropped long-deprecated support for positional arguments, please pass an object instead.',\n );\n const {\n schema,\n source,\n rootValue,\n contextValue,\n variableValues,\n operationName,\n fieldResolver,\n typeResolver,\n } = args; // Validate Schema\n\n const schemaValidationErrors = validateSchema(schema);\n\n if (schemaValidationErrors.length > 0) {\n return {\n errors: schemaValidationErrors,\n };\n } // Parse\n\n let document;\n\n try {\n document = parse(source);\n } catch (syntaxError) {\n return {\n errors: [syntaxError],\n };\n } // Validate\n\n const validationErrors = validate(schema, document);\n\n if (validationErrors.length > 0) {\n return {\n errors: validationErrors,\n };\n } // Execute\n\n return execute({\n schema,\n document,\n rootValue,\n contextValue,\n variableValues,\n operationName,\n fieldResolver,\n typeResolver,\n });\n}\n", "/**\n * Returns true if the provided object implements the AsyncIterator protocol via\n * implementing a `Symbol.asyncIterator` method.\n */\nexport function isAsyncIterable(maybeAsyncIterable) {\n return (\n typeof (maybeAsyncIterable === null || maybeAsyncIterable === void 0\n ? void 0\n : maybeAsyncIterable[Symbol.asyncIterator]) === 'function'\n );\n}\n", "/**\n * Given an AsyncIterable and a callback function, return an AsyncIterator\n * which produces values mapped via calling the callback function.\n */\nexport function mapAsyncIterator(iterable, callback) {\n const iterator = iterable[Symbol.asyncIterator]();\n\n async function mapResult(result) {\n if (result.done) {\n return result;\n }\n\n try {\n return {\n value: await callback(result.value),\n done: false,\n };\n } catch (error) {\n /* c8 ignore start */\n // FIXME: add test case\n if (typeof iterator.return === 'function') {\n try {\n await iterator.return();\n } catch (_e) {\n /* ignore error */\n }\n }\n\n throw error;\n /* c8 ignore stop */\n }\n }\n\n return {\n async next() {\n return mapResult(await iterator.next());\n },\n\n async return() {\n // If iterator.return() does not exist, then type R must be undefined.\n return typeof iterator.return === 'function'\n ? mapResult(await iterator.return())\n : {\n value: undefined,\n done: true,\n };\n },\n\n async throw(error) {\n if (typeof iterator.throw === 'function') {\n return mapResult(await iterator.throw(error));\n }\n\n throw error;\n },\n\n [Symbol.asyncIterator]() {\n return this;\n },\n };\n}\n", "import { devAssert } from '../jsutils/devAssert.mjs';\nimport { inspect } from '../jsutils/inspect.mjs';\nimport { isAsyncIterable } from '../jsutils/isAsyncIterable.mjs';\nimport { addPath, pathToArray } from '../jsutils/Path.mjs';\nimport { GraphQLError } from '../error/GraphQLError.mjs';\nimport { locatedError } from '../error/locatedError.mjs';\nimport { collectFields } from './collectFields.mjs';\nimport {\n assertValidExecutionArguments,\n buildExecutionContext,\n buildResolveInfo,\n execute,\n getFieldDef,\n} from './execute.mjs';\nimport { mapAsyncIterator } from './mapAsyncIterator.mjs';\nimport { getArgumentValues } from './values.mjs';\n/**\n * Implements the \"Subscribe\" algorithm described in the GraphQL specification.\n *\n * Returns a Promise which resolves to either an AsyncIterator (if successful)\n * or an ExecutionResult (error). The promise will be rejected if the schema or\n * other arguments to this function are invalid, or if the resolved event stream\n * is not an async iterable.\n *\n * If the client-provided arguments to this function do not result in a\n * compliant subscription, a GraphQL Response (ExecutionResult) with\n * descriptive errors and no data will be returned.\n *\n * If the source stream could not be created due to faulty subscription\n * resolver logic or underlying systems, the promise will resolve to a single\n * ExecutionResult containing `errors` and no `data`.\n *\n * If the operation succeeded, the promise resolves to an AsyncIterator, which\n * yields a stream of ExecutionResults representing the response stream.\n *\n * Accepts either an object with named arguments, or individual arguments.\n */\n\nexport async function subscribe(args) {\n // Temporary for v15 to v16 migration. Remove in v17\n arguments.length < 2 ||\n devAssert(\n false,\n 'graphql@16 dropped long-deprecated support for positional arguments, please pass an object instead.',\n );\n const resultOrStream = await createSourceEventStream(args);\n\n if (!isAsyncIterable(resultOrStream)) {\n return resultOrStream;\n } // For each payload yielded from a subscription, map it over the normal\n // GraphQL `execute` function, with `payload` as the rootValue.\n // This implements the \"MapSourceToResponseEvent\" algorithm described in\n // the GraphQL specification. The `execute` function provides the\n // \"ExecuteSubscriptionEvent\" algorithm, as it is nearly identical to the\n // \"ExecuteQuery\" algorithm, for which `execute` is also used.\n\n const mapSourceToResponse = (payload) =>\n execute({ ...args, rootValue: payload }); // Map every source value to a ExecutionResult value as described above.\n\n return mapAsyncIterator(resultOrStream, mapSourceToResponse);\n}\n\nfunction toNormalizedArgs(args) {\n const firstArg = args[0];\n\n if (firstArg && 'document' in firstArg) {\n return firstArg;\n }\n\n return {\n schema: firstArg,\n // FIXME: when underlying TS bug fixed, see https://github.com/microsoft/TypeScript/issues/31613\n document: args[1],\n rootValue: args[2],\n contextValue: args[3],\n variableValues: args[4],\n operationName: args[5],\n subscribeFieldResolver: args[6],\n };\n}\n/**\n * Implements the \"CreateSourceEventStream\" algorithm described in the\n * GraphQL specification, resolving the subscription source event stream.\n *\n * Returns a Promise which resolves to either an AsyncIterable (if successful)\n * or an ExecutionResult (error). The promise will be rejected if the schema or\n * other arguments to this function are invalid, or if the resolved event stream\n * is not an async iterable.\n *\n * If the client-provided arguments to this function do not result in a\n * compliant subscription, a GraphQL Response (ExecutionResult) with\n * descriptive errors and no data will be returned.\n *\n * If the the source stream could not be created due to faulty subscription\n * resolver logic or underlying systems, the promise will resolve to a single\n * ExecutionResult containing `errors` and no `data`.\n *\n * If the operation succeeded, the promise resolves to the AsyncIterable for the\n * event stream returned by the resolver.\n *\n * A Source Event Stream represents a sequence of events, each of which triggers\n * a GraphQL execution for that event.\n *\n * This may be useful when hosting the stateful subscription service in a\n * different process or machine than the stateless GraphQL execution engine,\n * or otherwise separating these two steps. For more on this, see the\n * \"Supporting Subscriptions at Scale\" information in the GraphQL specification.\n */\n\nexport async function createSourceEventStream(...rawArgs) {\n const args = toNormalizedArgs(rawArgs);\n const { schema, document, variableValues } = args; // If arguments are missing or incorrectly typed, this is an internal\n // developer mistake which should throw an early error.\n\n assertValidExecutionArguments(schema, document, variableValues); // If a valid execution context cannot be created due to incorrect arguments,\n // a \"Response\" with only errors is returned.\n\n const exeContext = buildExecutionContext(args); // Return early errors if execution context failed.\n\n if (!('schema' in exeContext)) {\n return {\n errors: exeContext,\n };\n }\n\n try {\n const eventStream = await executeSubscription(exeContext); // Assert field returned an event stream, otherwise yield an error.\n\n if (!isAsyncIterable(eventStream)) {\n throw new Error(\n 'Subscription field must return Async Iterable. ' +\n `Received: ${inspect(eventStream)}.`,\n );\n }\n\n return eventStream;\n } catch (error) {\n // If it GraphQLError, report it as an ExecutionResult, containing only errors and no data.\n // Otherwise treat the error as a system-class error and re-throw it.\n if (error instanceof GraphQLError) {\n return {\n errors: [error],\n };\n }\n\n throw error;\n }\n}\n\nasync function executeSubscription(exeContext) {\n const { schema, fragments, operation, variableValues, rootValue } =\n exeContext;\n const rootType = schema.getSubscriptionType();\n\n if (rootType == null) {\n throw new GraphQLError(\n 'Schema is not configured to execute subscription operation.',\n {\n nodes: operation,\n },\n );\n }\n\n const rootFields = collectFields(\n schema,\n fragments,\n variableValues,\n rootType,\n operation.selectionSet,\n );\n const [responseName, fieldNodes] = [...rootFields.entries()][0];\n const fieldDef = getFieldDef(schema, rootType, fieldNodes[0]);\n\n if (!fieldDef) {\n const fieldName = fieldNodes[0].name.value;\n throw new GraphQLError(\n `The subscription field \"${fieldName}\" is not defined.`,\n {\n nodes: fieldNodes,\n },\n );\n }\n\n const path = addPath(undefined, responseName, rootType.name);\n const info = buildResolveInfo(\n exeContext,\n fieldDef,\n fieldNodes,\n rootType,\n path,\n );\n\n try {\n var _fieldDef$subscribe;\n\n // Implements the \"ResolveFieldEventStream\" algorithm from GraphQL specification.\n // It differs from \"ResolveFieldValue\" due to providing a different `resolveFn`.\n // Build a JS object of arguments from the field.arguments AST, using the\n // variables scope to fulfill any variable references.\n const args = getArgumentValues(fieldDef, fieldNodes[0], variableValues); // The resolve function's optional third argument is a context value that\n // is provided to every resolve function within an execution. It is commonly\n // used to represent an authenticated user, or request-specific caches.\n\n const contextValue = exeContext.contextValue; // Call the `subscribe()` resolver or the default resolver to produce an\n // AsyncIterable yielding raw payloads.\n\n const resolveFn =\n (_fieldDef$subscribe = fieldDef.subscribe) !== null &&\n _fieldDef$subscribe !== void 0\n ? _fieldDef$subscribe\n : exeContext.subscribeFieldResolver;\n const eventStream = await resolveFn(rootValue, args, contextValue, info);\n\n if (eventStream instanceof Error) {\n throw eventStream;\n }\n\n return eventStream;\n } catch (error) {\n throw locatedError(error, fieldNodes, pathToArray(path));\n }\n}\n", "import { invariant } from '../../../jsutils/invariant.mjs';\nimport { GraphQLError } from '../../../error/GraphQLError.mjs';\nimport { getNamedType, isInputObjectType } from '../../../type/definition.mjs';\n\n/**\n * No deprecated\n *\n * A GraphQL document is only valid if all selected fields and all used enum values have not been\n * deprecated.\n *\n * Note: This rule is optional and is not part of the Validation section of the GraphQL\n * Specification. The main purpose of this rule is detection of deprecated usages and not\n * necessarily to forbid their use when querying a service.\n */\nexport function NoDeprecatedCustomRule(context) {\n return {\n Field(node) {\n const fieldDef = context.getFieldDef();\n const deprecationReason =\n fieldDef === null || fieldDef === void 0\n ? void 0\n : fieldDef.deprecationReason;\n\n if (fieldDef && deprecationReason != null) {\n const parentType = context.getParentType();\n parentType != null || invariant(false);\n context.reportError(\n new GraphQLError(\n `The field ${parentType.name}.${fieldDef.name} is deprecated. ${deprecationReason}`,\n {\n nodes: node,\n },\n ),\n );\n }\n },\n\n Argument(node) {\n const argDef = context.getArgument();\n const deprecationReason =\n argDef === null || argDef === void 0\n ? void 0\n : argDef.deprecationReason;\n\n if (argDef && deprecationReason != null) {\n const directiveDef = context.getDirective();\n\n if (directiveDef != null) {\n context.reportError(\n new GraphQLError(\n `Directive \"@${directiveDef.name}\" argument \"${argDef.name}\" is deprecated. ${deprecationReason}`,\n {\n nodes: node,\n },\n ),\n );\n } else {\n const parentType = context.getParentType();\n const fieldDef = context.getFieldDef();\n (parentType != null && fieldDef != null) || invariant(false);\n context.reportError(\n new GraphQLError(\n `Field \"${parentType.name}.${fieldDef.name}\" argument \"${argDef.name}\" is deprecated. ${deprecationReason}`,\n {\n nodes: node,\n },\n ),\n );\n }\n }\n },\n\n ObjectField(node) {\n const inputObjectDef = getNamedType(context.getParentInputType());\n\n if (isInputObjectType(inputObjectDef)) {\n const inputFieldDef = inputObjectDef.getFields()[node.name.value];\n const deprecationReason =\n inputFieldDef === null || inputFieldDef === void 0\n ? void 0\n : inputFieldDef.deprecationReason;\n\n if (deprecationReason != null) {\n context.reportError(\n new GraphQLError(\n `The input field ${inputObjectDef.name}.${inputFieldDef.name} is deprecated. ${deprecationReason}`,\n {\n nodes: node,\n },\n ),\n );\n }\n }\n },\n\n EnumValue(node) {\n const enumValueDef = context.getEnumValue();\n const deprecationReason =\n enumValueDef === null || enumValueDef === void 0\n ? void 0\n : enumValueDef.deprecationReason;\n\n if (enumValueDef && deprecationReason != null) {\n const enumTypeDef = getNamedType(context.getInputType());\n enumTypeDef != null || invariant(false);\n context.reportError(\n new GraphQLError(\n `The enum value \"${enumTypeDef.name}.${enumValueDef.name}\" is deprecated. ${deprecationReason}`,\n {\n nodes: node,\n },\n ),\n );\n }\n },\n };\n}\n", "import { GraphQLError } from '../../../error/GraphQLError.mjs';\nimport { getNamedType } from '../../../type/definition.mjs';\nimport { isIntrospectionType } from '../../../type/introspection.mjs';\n\n/**\n * Prohibit introspection queries\n *\n * A GraphQL document is only valid if all fields selected are not fields that\n * return an introspection type.\n *\n * Note: This rule is optional and is not part of the Validation section of the\n * GraphQL Specification. This rule effectively disables introspection, which\n * does not reflect best practices and should only be done if absolutely necessary.\n */\nexport function NoSchemaIntrospectionCustomRule(context) {\n return {\n Field(node) {\n const type = getNamedType(context.getType());\n\n if (type && isIntrospectionType(type)) {\n context.reportError(\n new GraphQLError(\n `GraphQL introspection has been disabled, but the requested query contained the field \"${node.name.value}\".`,\n {\n nodes: node,\n },\n ),\n );\n }\n },\n };\n}\n", "/**\n * Produce the GraphQL query recommended for a full schema introspection.\n * Accepts optional IntrospectionOptions.\n */\nexport function getIntrospectionQuery(options) {\n const optionsWithDefault = {\n descriptions: true,\n specifiedByUrl: false,\n directiveIsRepeatable: false,\n schemaDescription: false,\n inputValueDeprecation: false,\n oneOf: false,\n ...options,\n };\n const descriptions = optionsWithDefault.descriptions ? 'description' : '';\n const specifiedByUrl = optionsWithDefault.specifiedByUrl\n ? 'specifiedByURL'\n : '';\n const directiveIsRepeatable = optionsWithDefault.directiveIsRepeatable\n ? 'isRepeatable'\n : '';\n const schemaDescription = optionsWithDefault.schemaDescription\n ? descriptions\n : '';\n\n function inputDeprecation(str) {\n return optionsWithDefault.inputValueDeprecation ? str : '';\n }\n\n const oneOf = optionsWithDefault.oneOf ? 'isOneOf' : '';\n return `\n query IntrospectionQuery {\n __schema {\n ${schemaDescription}\n queryType { name kind }\n mutationType { name kind }\n subscriptionType { name kind }\n types {\n ...FullType\n }\n directives {\n name\n ${descriptions}\n ${directiveIsRepeatable}\n locations\n args${inputDeprecation('(includeDeprecated: true)')} {\n ...InputValue\n }\n }\n }\n }\n\n fragment FullType on __Type {\n kind\n name\n ${descriptions}\n ${specifiedByUrl}\n ${oneOf}\n fields(includeDeprecated: true) {\n name\n ${descriptions}\n args${inputDeprecation('(includeDeprecated: true)')} {\n ...InputValue\n }\n type {\n ...TypeRef\n }\n isDeprecated\n deprecationReason\n }\n inputFields${inputDeprecation('(includeDeprecated: true)')} {\n ...InputValue\n }\n interfaces {\n ...TypeRef\n }\n enumValues(includeDeprecated: true) {\n name\n ${descriptions}\n isDeprecated\n deprecationReason\n }\n possibleTypes {\n ...TypeRef\n }\n }\n\n fragment InputValue on __InputValue {\n name\n ${descriptions}\n type { ...TypeRef }\n defaultValue\n ${inputDeprecation('isDeprecated')}\n ${inputDeprecation('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 ofType {\n kind\n name\n ofType {\n kind\n name\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n `;\n}\n", "import { Kind } from '../language/kinds.mjs';\n/**\n * Returns an operation AST given a document AST and optionally an operation\n * name. If a name is not provided, an operation is only returned if only one is\n * provided in the document.\n */\n\nexport function getOperationAST(documentAST, operationName) {\n let operation = null;\n\n for (const definition of documentAST.definitions) {\n if (definition.kind === Kind.OPERATION_DEFINITION) {\n var _definition$name;\n\n if (operationName == null) {\n // If no operation name was provided, only return an Operation if there\n // is one defined in the document. Upon encountering the second, return\n // null.\n if (operation) {\n return null;\n }\n\n operation = definition;\n } else if (\n ((_definition$name = definition.name) === null ||\n _definition$name === void 0\n ? void 0\n : _definition$name.value) === operationName\n ) {\n return definition;\n }\n }\n }\n\n return operation;\n}\n", "import { GraphQLError } from '../error/GraphQLError.mjs';\n\n/**\n * Extracts the root type of the operation from the schema.\n *\n * @deprecated Please use `GraphQLSchema.getRootType` instead. Will be removed in v17\n */\nexport function getOperationRootType(schema, operation) {\n if (operation.operation === 'query') {\n const queryType = schema.getQueryType();\n\n if (!queryType) {\n throw new GraphQLError(\n 'Schema does not define the required query root type.',\n {\n nodes: operation,\n },\n );\n }\n\n return queryType;\n }\n\n if (operation.operation === 'mutation') {\n const mutationType = schema.getMutationType();\n\n if (!mutationType) {\n throw new GraphQLError('Schema is not configured for mutations.', {\n nodes: operation,\n });\n }\n\n return mutationType;\n }\n\n if (operation.operation === 'subscription') {\n const subscriptionType = schema.getSubscriptionType();\n\n if (!subscriptionType) {\n throw new GraphQLError('Schema is not configured for subscriptions.', {\n nodes: operation,\n });\n }\n\n return subscriptionType;\n }\n\n throw new GraphQLError(\n 'Can only have query, mutation and subscription operations.',\n {\n nodes: operation,\n },\n );\n}\n", "import { invariant } from '../jsutils/invariant.mjs';\nimport { parse } from '../language/parser.mjs';\nimport { executeSync } from '../execution/execute.mjs';\nimport { getIntrospectionQuery } from './getIntrospectionQuery.mjs';\n/**\n * Build an IntrospectionQuery from a GraphQLSchema\n *\n * IntrospectionQuery is useful for utilities that care about type and field\n * relationships, but do not need to traverse through those relationships.\n *\n * This is the inverse of buildClientSchema. The primary use case is outside\n * of the server context, for instance when doing schema comparisons.\n */\n\nexport function introspectionFromSchema(schema, options) {\n const optionsWithDefaults = {\n specifiedByUrl: true,\n directiveIsRepeatable: true,\n schemaDescription: true,\n inputValueDeprecation: true,\n oneOf: true,\n ...options,\n };\n const document = parse(getIntrospectionQuery(optionsWithDefaults));\n const result = executeSync({\n schema,\n document,\n });\n (!result.errors && result.data) || invariant(false);\n return result.data;\n}\n", "import { devAssert } from '../jsutils/devAssert.mjs';\nimport { inspect } from '../jsutils/inspect.mjs';\nimport { isObjectLike } from '../jsutils/isObjectLike.mjs';\nimport { keyValMap } from '../jsutils/keyValMap.mjs';\nimport { parseValue } from '../language/parser.mjs';\nimport {\n assertInterfaceType,\n assertNullableType,\n assertObjectType,\n GraphQLEnumType,\n GraphQLInputObjectType,\n GraphQLInterfaceType,\n GraphQLList,\n GraphQLNonNull,\n GraphQLObjectType,\n GraphQLScalarType,\n GraphQLUnionType,\n isInputType,\n isOutputType,\n} from '../type/definition.mjs';\nimport { GraphQLDirective } from '../type/directives.mjs';\nimport { introspectionTypes, TypeKind } from '../type/introspection.mjs';\nimport { specifiedScalarTypes } from '../type/scalars.mjs';\nimport { GraphQLSchema } from '../type/schema.mjs';\nimport { valueFromAST } from './valueFromAST.mjs';\n/**\n * Build a GraphQLSchema for use by client tools.\n *\n * Given the result of a client running the introspection query, creates and\n * returns a GraphQLSchema instance which can be then used with all graphql-js\n * tools, but cannot be used to execute a query, as introspection does not\n * represent the \"resolver\", \"parse\" or \"serialize\" functions or any other\n * server-internal mechanisms.\n *\n * This function expects a complete introspection result. Don't forget to check\n * the \"errors\" field of a server response before calling this function.\n */\n\nexport function buildClientSchema(introspection, options) {\n (isObjectLike(introspection) && isObjectLike(introspection.__schema)) ||\n devAssert(\n false,\n `Invalid or incomplete introspection result. Ensure that you are passing \"data\" property of introspection response and no \"errors\" was returned alongside: ${inspect(\n introspection,\n )}.`,\n ); // Get the schema from the introspection result.\n\n const schemaIntrospection = introspection.__schema; // Iterate through all types, getting the type definition for each.\n\n const typeMap = keyValMap(\n schemaIntrospection.types,\n (typeIntrospection) => typeIntrospection.name,\n (typeIntrospection) => buildType(typeIntrospection),\n ); // Include standard types only if they are used.\n\n for (const stdType of [...specifiedScalarTypes, ...introspectionTypes]) {\n if (typeMap[stdType.name]) {\n typeMap[stdType.name] = stdType;\n }\n } // Get the root Query, Mutation, and Subscription types.\n\n const queryType = schemaIntrospection.queryType\n ? getObjectType(schemaIntrospection.queryType)\n : null;\n const mutationType = schemaIntrospection.mutationType\n ? getObjectType(schemaIntrospection.mutationType)\n : null;\n const subscriptionType = schemaIntrospection.subscriptionType\n ? getObjectType(schemaIntrospection.subscriptionType)\n : null; // Get the directives supported by Introspection, assuming empty-set if\n // directives were not queried for.\n\n const directives = schemaIntrospection.directives\n ? schemaIntrospection.directives.map(buildDirective)\n : []; // Then produce and return a Schema with these types.\n\n return new GraphQLSchema({\n description: schemaIntrospection.description,\n query: queryType,\n mutation: mutationType,\n subscription: subscriptionType,\n types: Object.values(typeMap),\n directives,\n assumeValid:\n options === null || options === void 0 ? void 0 : options.assumeValid,\n }); // Given a type reference in introspection, return the GraphQLType instance.\n // preferring cached instances before building new instances.\n\n function getType(typeRef) {\n if (typeRef.kind === TypeKind.LIST) {\n const itemRef = typeRef.ofType;\n\n if (!itemRef) {\n throw new Error('Decorated type deeper than introspection query.');\n }\n\n return new GraphQLList(getType(itemRef));\n }\n\n if (typeRef.kind === TypeKind.NON_NULL) {\n const nullableRef = typeRef.ofType;\n\n if (!nullableRef) {\n throw new Error('Decorated type deeper than introspection query.');\n }\n\n const nullableType = getType(nullableRef);\n return new GraphQLNonNull(assertNullableType(nullableType));\n }\n\n return getNamedType(typeRef);\n }\n\n function getNamedType(typeRef) {\n const typeName = typeRef.name;\n\n if (!typeName) {\n throw new Error(`Unknown type reference: ${inspect(typeRef)}.`);\n }\n\n const type = typeMap[typeName];\n\n if (!type) {\n throw new Error(\n `Invalid or incomplete schema, unknown type: ${typeName}. Ensure that a full introspection query is used in order to build a client schema.`,\n );\n }\n\n return type;\n }\n\n function getObjectType(typeRef) {\n return assertObjectType(getNamedType(typeRef));\n }\n\n function getInterfaceType(typeRef) {\n return assertInterfaceType(getNamedType(typeRef));\n } // Given a type's introspection result, construct the correct\n // GraphQLType instance.\n\n function buildType(type) {\n // eslint-disable-next-line @typescript-eslint/prefer-optional-chain\n if (type != null && type.name != null && type.kind != null) {\n // FIXME: Properly type IntrospectionType, it's a breaking change so fix in v17\n // eslint-disable-next-line @typescript-eslint/switch-exhaustiveness-check\n switch (type.kind) {\n case TypeKind.SCALAR:\n return buildScalarDef(type);\n\n case TypeKind.OBJECT:\n return buildObjectDef(type);\n\n case TypeKind.INTERFACE:\n return buildInterfaceDef(type);\n\n case TypeKind.UNION:\n return buildUnionDef(type);\n\n case TypeKind.ENUM:\n return buildEnumDef(type);\n\n case TypeKind.INPUT_OBJECT:\n return buildInputObjectDef(type);\n }\n }\n\n const typeStr = inspect(type);\n throw new Error(\n `Invalid or incomplete introspection result. Ensure that a full introspection query is used in order to build a client schema: ${typeStr}.`,\n );\n }\n\n function buildScalarDef(scalarIntrospection) {\n return new GraphQLScalarType({\n name: scalarIntrospection.name,\n description: scalarIntrospection.description,\n specifiedByURL: scalarIntrospection.specifiedByURL,\n });\n }\n\n function buildImplementationsList(implementingIntrospection) {\n // TODO: Temporary workaround until GraphQL ecosystem will fully support\n // 'interfaces' on interface types.\n if (\n implementingIntrospection.interfaces === null &&\n implementingIntrospection.kind === TypeKind.INTERFACE\n ) {\n return [];\n }\n\n if (!implementingIntrospection.interfaces) {\n const implementingIntrospectionStr = inspect(implementingIntrospection);\n throw new Error(\n `Introspection result missing interfaces: ${implementingIntrospectionStr}.`,\n );\n }\n\n return implementingIntrospection.interfaces.map(getInterfaceType);\n }\n\n function buildObjectDef(objectIntrospection) {\n return new GraphQLObjectType({\n name: objectIntrospection.name,\n description: objectIntrospection.description,\n interfaces: () => buildImplementationsList(objectIntrospection),\n fields: () => buildFieldDefMap(objectIntrospection),\n });\n }\n\n function buildInterfaceDef(interfaceIntrospection) {\n return new GraphQLInterfaceType({\n name: interfaceIntrospection.name,\n description: interfaceIntrospection.description,\n interfaces: () => buildImplementationsList(interfaceIntrospection),\n fields: () => buildFieldDefMap(interfaceIntrospection),\n });\n }\n\n function buildUnionDef(unionIntrospection) {\n if (!unionIntrospection.possibleTypes) {\n const unionIntrospectionStr = inspect(unionIntrospection);\n throw new Error(\n `Introspection result missing possibleTypes: ${unionIntrospectionStr}.`,\n );\n }\n\n return new GraphQLUnionType({\n name: unionIntrospection.name,\n description: unionIntrospection.description,\n types: () => unionIntrospection.possibleTypes.map(getObjectType),\n });\n }\n\n function buildEnumDef(enumIntrospection) {\n if (!enumIntrospection.enumValues) {\n const enumIntrospectionStr = inspect(enumIntrospection);\n throw new Error(\n `Introspection result missing enumValues: ${enumIntrospectionStr}.`,\n );\n }\n\n return new GraphQLEnumType({\n name: enumIntrospection.name,\n description: enumIntrospection.description,\n values: keyValMap(\n enumIntrospection.enumValues,\n (valueIntrospection) => valueIntrospection.name,\n (valueIntrospection) => ({\n description: valueIntrospection.description,\n deprecationReason: valueIntrospection.deprecationReason,\n }),\n ),\n });\n }\n\n function buildInputObjectDef(inputObjectIntrospection) {\n if (!inputObjectIntrospection.inputFields) {\n const inputObjectIntrospectionStr = inspect(inputObjectIntrospection);\n throw new Error(\n `Introspection result missing inputFields: ${inputObjectIntrospectionStr}.`,\n );\n }\n\n return new GraphQLInputObjectType({\n name: inputObjectIntrospection.name,\n description: inputObjectIntrospection.description,\n fields: () => buildInputValueDefMap(inputObjectIntrospection.inputFields),\n isOneOf: inputObjectIntrospection.isOneOf,\n });\n }\n\n function buildFieldDefMap(typeIntrospection) {\n if (!typeIntrospection.fields) {\n throw new Error(\n `Introspection result missing fields: ${inspect(typeIntrospection)}.`,\n );\n }\n\n return keyValMap(\n typeIntrospection.fields,\n (fieldIntrospection) => fieldIntrospection.name,\n buildField,\n );\n }\n\n function buildField(fieldIntrospection) {\n const type = getType(fieldIntrospection.type);\n\n if (!isOutputType(type)) {\n const typeStr = inspect(type);\n throw new Error(\n `Introspection must provide output type for fields, but received: ${typeStr}.`,\n );\n }\n\n if (!fieldIntrospection.args) {\n const fieldIntrospectionStr = inspect(fieldIntrospection);\n throw new Error(\n `Introspection result missing field args: ${fieldIntrospectionStr}.`,\n );\n }\n\n return {\n description: fieldIntrospection.description,\n deprecationReason: fieldIntrospection.deprecationReason,\n type,\n args: buildInputValueDefMap(fieldIntrospection.args),\n };\n }\n\n function buildInputValueDefMap(inputValueIntrospections) {\n return keyValMap(\n inputValueIntrospections,\n (inputValue) => inputValue.name,\n buildInputValue,\n );\n }\n\n function buildInputValue(inputValueIntrospection) {\n const type = getType(inputValueIntrospection.type);\n\n if (!isInputType(type)) {\n const typeStr = inspect(type);\n throw new Error(\n `Introspection must provide input type for arguments, but received: ${typeStr}.`,\n );\n }\n\n const defaultValue =\n inputValueIntrospection.defaultValue != null\n ? valueFromAST(parseValue(inputValueIntrospection.defaultValue), type)\n : undefined;\n return {\n description: inputValueIntrospection.description,\n type,\n defaultValue,\n deprecationReason: inputValueIntrospection.deprecationReason,\n };\n }\n\n function buildDirective(directiveIntrospection) {\n if (!directiveIntrospection.args) {\n const directiveIntrospectionStr = inspect(directiveIntrospection);\n throw new Error(\n `Introspection result missing directive args: ${directiveIntrospectionStr}.`,\n );\n }\n\n if (!directiveIntrospection.locations) {\n const directiveIntrospectionStr = inspect(directiveIntrospection);\n throw new Error(\n `Introspection result missing directive locations: ${directiveIntrospectionStr}.`,\n );\n }\n\n return new GraphQLDirective({\n name: directiveIntrospection.name,\n description: directiveIntrospection.description,\n isRepeatable: directiveIntrospection.isRepeatable,\n locations: directiveIntrospection.locations.slice(),\n args: buildInputValueDefMap(directiveIntrospection.args),\n });\n }\n}\n", "import { devAssert } from '../jsutils/devAssert.mjs';\nimport { inspect } from '../jsutils/inspect.mjs';\nimport { invariant } from '../jsutils/invariant.mjs';\nimport { keyMap } from '../jsutils/keyMap.mjs';\nimport { mapValue } from '../jsutils/mapValue.mjs';\nimport { Kind } from '../language/kinds.mjs';\nimport {\n isTypeDefinitionNode,\n isTypeExtensionNode,\n} from '../language/predicates.mjs';\nimport {\n GraphQLEnumType,\n GraphQLInputObjectType,\n GraphQLInterfaceType,\n GraphQLList,\n GraphQLNonNull,\n GraphQLObjectType,\n GraphQLScalarType,\n GraphQLUnionType,\n isEnumType,\n isInputObjectType,\n isInterfaceType,\n isListType,\n isNonNullType,\n isObjectType,\n isScalarType,\n isUnionType,\n} from '../type/definition.mjs';\nimport {\n GraphQLDeprecatedDirective,\n GraphQLDirective,\n GraphQLOneOfDirective,\n GraphQLSpecifiedByDirective,\n} from '../type/directives.mjs';\nimport {\n introspectionTypes,\n isIntrospectionType,\n} from '../type/introspection.mjs';\nimport {\n isSpecifiedScalarType,\n specifiedScalarTypes,\n} from '../type/scalars.mjs';\nimport { assertSchema, GraphQLSchema } from '../type/schema.mjs';\nimport { assertValidSDLExtension } from '../validation/validate.mjs';\nimport { getDirectiveValues } from '../execution/values.mjs';\nimport { valueFromAST } from './valueFromAST.mjs';\n\n/**\n * Produces a new schema given an existing schema and a document which may\n * contain GraphQL type extensions and definitions. The original schema will\n * remain unaltered.\n *\n * Because a schema represents a graph of references, a schema cannot be\n * extended without effectively making an entire copy. We do not know until it's\n * too late if subgraphs remain unchanged.\n *\n * This algorithm copies the provided schema, applying extensions while\n * producing the copy. The original schema remains unaltered.\n */\nexport function extendSchema(schema, documentAST, options) {\n assertSchema(schema);\n (documentAST != null && documentAST.kind === Kind.DOCUMENT) ||\n devAssert(false, 'Must provide valid Document AST.');\n\n if (\n (options === null || options === void 0 ? void 0 : options.assumeValid) !==\n true &&\n (options === null || options === void 0\n ? void 0\n : options.assumeValidSDL) !== true\n ) {\n assertValidSDLExtension(documentAST, schema);\n }\n\n const schemaConfig = schema.toConfig();\n const extendedConfig = extendSchemaImpl(schemaConfig, documentAST, options);\n return schemaConfig === extendedConfig\n ? schema\n : new GraphQLSchema(extendedConfig);\n}\n/**\n * @internal\n */\n\nexport function extendSchemaImpl(schemaConfig, documentAST, options) {\n var _schemaDef, _schemaDef$descriptio, _schemaDef2, _options$assumeValid;\n\n // Collect the type definitions and extensions found in the document.\n const typeDefs = [];\n const typeExtensionsMap = Object.create(null); // New directives and types are separate because a directives and types can\n // have the same name. For example, a type named \"skip\".\n\n const directiveDefs = [];\n let schemaDef; // Schema extensions are collected which may add additional operation types.\n\n const schemaExtensions = [];\n\n for (const def of documentAST.definitions) {\n if (def.kind === Kind.SCHEMA_DEFINITION) {\n schemaDef = def;\n } else if (def.kind === Kind.SCHEMA_EXTENSION) {\n schemaExtensions.push(def);\n } else if (isTypeDefinitionNode(def)) {\n typeDefs.push(def);\n } else if (isTypeExtensionNode(def)) {\n const extendedTypeName = def.name.value;\n const existingTypeExtensions = typeExtensionsMap[extendedTypeName];\n typeExtensionsMap[extendedTypeName] = existingTypeExtensions\n ? existingTypeExtensions.concat([def])\n : [def];\n } else if (def.kind === Kind.DIRECTIVE_DEFINITION) {\n directiveDefs.push(def);\n }\n } // If this document contains no new types, extensions, or directives then\n // return the same unmodified GraphQLSchema instance.\n\n if (\n Object.keys(typeExtensionsMap).length === 0 &&\n typeDefs.length === 0 &&\n directiveDefs.length === 0 &&\n schemaExtensions.length === 0 &&\n schemaDef == null\n ) {\n return schemaConfig;\n }\n\n const typeMap = Object.create(null);\n\n for (const existingType of schemaConfig.types) {\n typeMap[existingType.name] = extendNamedType(existingType);\n }\n\n for (const typeNode of typeDefs) {\n var _stdTypeMap$name;\n\n const name = typeNode.name.value;\n typeMap[name] =\n (_stdTypeMap$name = stdTypeMap[name]) !== null &&\n _stdTypeMap$name !== void 0\n ? _stdTypeMap$name\n : buildType(typeNode);\n }\n\n const operationTypes = {\n // Get the extended root operation types.\n query: schemaConfig.query && replaceNamedType(schemaConfig.query),\n mutation: schemaConfig.mutation && replaceNamedType(schemaConfig.mutation),\n subscription:\n schemaConfig.subscription && replaceNamedType(schemaConfig.subscription),\n // Then, incorporate schema definition and all schema extensions.\n ...(schemaDef && getOperationTypes([schemaDef])),\n ...getOperationTypes(schemaExtensions),\n }; // Then produce and return a Schema config with these types.\n\n return {\n description:\n (_schemaDef = schemaDef) === null || _schemaDef === void 0\n ? void 0\n : (_schemaDef$descriptio = _schemaDef.description) === null ||\n _schemaDef$descriptio === void 0\n ? void 0\n : _schemaDef$descriptio.value,\n ...operationTypes,\n types: Object.values(typeMap),\n directives: [\n ...schemaConfig.directives.map(replaceDirective),\n ...directiveDefs.map(buildDirective),\n ],\n extensions: Object.create(null),\n astNode:\n (_schemaDef2 = schemaDef) !== null && _schemaDef2 !== void 0\n ? _schemaDef2\n : schemaConfig.astNode,\n extensionASTNodes: schemaConfig.extensionASTNodes.concat(schemaExtensions),\n assumeValid:\n (_options$assumeValid =\n options === null || options === void 0\n ? void 0\n : options.assumeValid) !== null && _options$assumeValid !== void 0\n ? _options$assumeValid\n : false,\n }; // Below are functions used for producing this schema that have closed over\n // this scope and have access to the schema, cache, and newly defined types.\n\n function replaceType(type) {\n if (isListType(type)) {\n // @ts-expect-error\n return new GraphQLList(replaceType(type.ofType));\n }\n\n if (isNonNullType(type)) {\n // @ts-expect-error\n return new GraphQLNonNull(replaceType(type.ofType));\n } // @ts-expect-error FIXME\n\n return replaceNamedType(type);\n }\n\n function replaceNamedType(type) {\n // Note: While this could make early assertions to get the correctly\n // typed values, that would throw immediately while type system\n // validation with validateSchema() will produce more actionable results.\n return typeMap[type.name];\n }\n\n function replaceDirective(directive) {\n const config = directive.toConfig();\n return new GraphQLDirective({\n ...config,\n args: mapValue(config.args, extendArg),\n });\n }\n\n function extendNamedType(type) {\n if (isIntrospectionType(type) || isSpecifiedScalarType(type)) {\n // Builtin types are not extended.\n return type;\n }\n\n if (isScalarType(type)) {\n return extendScalarType(type);\n }\n\n if (isObjectType(type)) {\n return extendObjectType(type);\n }\n\n if (isInterfaceType(type)) {\n return extendInterfaceType(type);\n }\n\n if (isUnionType(type)) {\n return extendUnionType(type);\n }\n\n if (isEnumType(type)) {\n return extendEnumType(type);\n }\n\n if (isInputObjectType(type)) {\n return extendInputObjectType(type);\n }\n /* c8 ignore next 3 */\n // Not reachable, all possible type definition nodes have been considered.\n\n false || invariant(false, 'Unexpected type: ' + inspect(type));\n }\n\n function extendInputObjectType(type) {\n var _typeExtensionsMap$co;\n\n const config = type.toConfig();\n const extensions =\n (_typeExtensionsMap$co = typeExtensionsMap[config.name]) !== null &&\n _typeExtensionsMap$co !== void 0\n ? _typeExtensionsMap$co\n : [];\n return new GraphQLInputObjectType({\n ...config,\n fields: () => ({\n ...mapValue(config.fields, (field) => ({\n ...field,\n type: replaceType(field.type),\n })),\n ...buildInputFieldMap(extensions),\n }),\n extensionASTNodes: config.extensionASTNodes.concat(extensions),\n });\n }\n\n function extendEnumType(type) {\n var _typeExtensionsMap$ty;\n\n const config = type.toConfig();\n const extensions =\n (_typeExtensionsMap$ty = typeExtensionsMap[type.name]) !== null &&\n _typeExtensionsMap$ty !== void 0\n ? _typeExtensionsMap$ty\n : [];\n return new GraphQLEnumType({\n ...config,\n values: { ...config.values, ...buildEnumValueMap(extensions) },\n extensionASTNodes: config.extensionASTNodes.concat(extensions),\n });\n }\n\n function extendScalarType(type) {\n var _typeExtensionsMap$co2;\n\n const config = type.toConfig();\n const extensions =\n (_typeExtensionsMap$co2 = typeExtensionsMap[config.name]) !== null &&\n _typeExtensionsMap$co2 !== void 0\n ? _typeExtensionsMap$co2\n : [];\n let specifiedByURL = config.specifiedByURL;\n\n for (const extensionNode of extensions) {\n var _getSpecifiedByURL;\n\n specifiedByURL =\n (_getSpecifiedByURL = getSpecifiedByURL(extensionNode)) !== null &&\n _getSpecifiedByURL !== void 0\n ? _getSpecifiedByURL\n : specifiedByURL;\n }\n\n return new GraphQLScalarType({\n ...config,\n specifiedByURL,\n extensionASTNodes: config.extensionASTNodes.concat(extensions),\n });\n }\n\n function extendObjectType(type) {\n var _typeExtensionsMap$co3;\n\n const config = type.toConfig();\n const extensions =\n (_typeExtensionsMap$co3 = typeExtensionsMap[config.name]) !== null &&\n _typeExtensionsMap$co3 !== void 0\n ? _typeExtensionsMap$co3\n : [];\n return new GraphQLObjectType({\n ...config,\n interfaces: () => [\n ...type.getInterfaces().map(replaceNamedType),\n ...buildInterfaces(extensions),\n ],\n fields: () => ({\n ...mapValue(config.fields, extendField),\n ...buildFieldMap(extensions),\n }),\n extensionASTNodes: config.extensionASTNodes.concat(extensions),\n });\n }\n\n function extendInterfaceType(type) {\n var _typeExtensionsMap$co4;\n\n const config = type.toConfig();\n const extensions =\n (_typeExtensionsMap$co4 = typeExtensionsMap[config.name]) !== null &&\n _typeExtensionsMap$co4 !== void 0\n ? _typeExtensionsMap$co4\n : [];\n return new GraphQLInterfaceType({\n ...config,\n interfaces: () => [\n ...type.getInterfaces().map(replaceNamedType),\n ...buildInterfaces(extensions),\n ],\n fields: () => ({\n ...mapValue(config.fields, extendField),\n ...buildFieldMap(extensions),\n }),\n extensionASTNodes: config.extensionASTNodes.concat(extensions),\n });\n }\n\n function extendUnionType(type) {\n var _typeExtensionsMap$co5;\n\n const config = type.toConfig();\n const extensions =\n (_typeExtensionsMap$co5 = typeExtensionsMap[config.name]) !== null &&\n _typeExtensionsMap$co5 !== void 0\n ? _typeExtensionsMap$co5\n : [];\n return new GraphQLUnionType({\n ...config,\n types: () => [\n ...type.getTypes().map(replaceNamedType),\n ...buildUnionTypes(extensions),\n ],\n extensionASTNodes: config.extensionASTNodes.concat(extensions),\n });\n }\n\n function extendField(field) {\n return {\n ...field,\n type: replaceType(field.type),\n args: field.args && mapValue(field.args, extendArg),\n };\n }\n\n function extendArg(arg) {\n return { ...arg, type: replaceType(arg.type) };\n }\n\n function getOperationTypes(nodes) {\n const opTypes = {};\n\n for (const node of nodes) {\n var _node$operationTypes;\n\n // FIXME: https://github.com/graphql/graphql-js/issues/2203\n const operationTypesNodes =\n /* c8 ignore next */\n (_node$operationTypes = node.operationTypes) !== null &&\n _node$operationTypes !== void 0\n ? _node$operationTypes\n : [];\n\n for (const operationType of operationTypesNodes) {\n // Note: While this could make early assertions to get the correctly\n // typed values below, that would throw immediately while type system\n // validation with validateSchema() will produce more actionable results.\n // @ts-expect-error\n opTypes[operationType.operation] = getNamedType(operationType.type);\n }\n }\n\n return opTypes;\n }\n\n function getNamedType(node) {\n var _stdTypeMap$name2;\n\n const name = node.name.value;\n const type =\n (_stdTypeMap$name2 = stdTypeMap[name]) !== null &&\n _stdTypeMap$name2 !== void 0\n ? _stdTypeMap$name2\n : typeMap[name];\n\n if (type === undefined) {\n throw new Error(`Unknown type: \"${name}\".`);\n }\n\n return type;\n }\n\n function getWrappedType(node) {\n if (node.kind === Kind.LIST_TYPE) {\n return new GraphQLList(getWrappedType(node.type));\n }\n\n if (node.kind === Kind.NON_NULL_TYPE) {\n return new GraphQLNonNull(getWrappedType(node.type));\n }\n\n return getNamedType(node);\n }\n\n function buildDirective(node) {\n var _node$description;\n\n return new GraphQLDirective({\n name: node.name.value,\n description:\n (_node$description = node.description) === null ||\n _node$description === void 0\n ? void 0\n : _node$description.value,\n // @ts-expect-error\n locations: node.locations.map(({ value }) => value),\n isRepeatable: node.repeatable,\n args: buildArgumentMap(node.arguments),\n astNode: node,\n });\n }\n\n function buildFieldMap(nodes) {\n const fieldConfigMap = Object.create(null);\n\n for (const node of nodes) {\n var _node$fields;\n\n // FIXME: https://github.com/graphql/graphql-js/issues/2203\n const nodeFields =\n /* c8 ignore next */\n (_node$fields = node.fields) !== null && _node$fields !== void 0\n ? _node$fields\n : [];\n\n for (const field of nodeFields) {\n var _field$description;\n\n fieldConfigMap[field.name.value] = {\n // Note: While this could make assertions to get the correctly typed\n // value, that would throw immediately while type system validation\n // with validateSchema() will produce more actionable results.\n type: getWrappedType(field.type),\n description:\n (_field$description = field.description) === null ||\n _field$description === void 0\n ? void 0\n : _field$description.value,\n args: buildArgumentMap(field.arguments),\n deprecationReason: getDeprecationReason(field),\n astNode: field,\n };\n }\n }\n\n return fieldConfigMap;\n }\n\n function buildArgumentMap(args) {\n // FIXME: https://github.com/graphql/graphql-js/issues/2203\n const argsNodes =\n /* c8 ignore next */\n args !== null && args !== void 0 ? args : [];\n const argConfigMap = Object.create(null);\n\n for (const arg of argsNodes) {\n var _arg$description;\n\n // Note: While this could make assertions to get the correctly typed\n // value, that would throw immediately while type system validation\n // with validateSchema() will produce more actionable results.\n const type = getWrappedType(arg.type);\n argConfigMap[arg.name.value] = {\n type,\n description:\n (_arg$description = arg.description) === null ||\n _arg$description === void 0\n ? void 0\n : _arg$description.value,\n defaultValue: valueFromAST(arg.defaultValue, type),\n deprecationReason: getDeprecationReason(arg),\n astNode: arg,\n };\n }\n\n return argConfigMap;\n }\n\n function buildInputFieldMap(nodes) {\n const inputFieldMap = Object.create(null);\n\n for (const node of nodes) {\n var _node$fields2;\n\n // FIXME: https://github.com/graphql/graphql-js/issues/2203\n const fieldsNodes =\n /* c8 ignore next */\n (_node$fields2 = node.fields) !== null && _node$fields2 !== void 0\n ? _node$fields2\n : [];\n\n for (const field of fieldsNodes) {\n var _field$description2;\n\n // Note: While this could make assertions to get the correctly typed\n // value, that would throw immediately while type system validation\n // with validateSchema() will produce more actionable results.\n const type = getWrappedType(field.type);\n inputFieldMap[field.name.value] = {\n type,\n description:\n (_field$description2 = field.description) === null ||\n _field$description2 === void 0\n ? void 0\n : _field$description2.value,\n defaultValue: valueFromAST(field.defaultValue, type),\n deprecationReason: getDeprecationReason(field),\n astNode: field,\n };\n }\n }\n\n return inputFieldMap;\n }\n\n function buildEnumValueMap(nodes) {\n const enumValueMap = Object.create(null);\n\n for (const node of nodes) {\n var _node$values;\n\n // FIXME: https://github.com/graphql/graphql-js/issues/2203\n const valuesNodes =\n /* c8 ignore next */\n (_node$values = node.values) !== null && _node$values !== void 0\n ? _node$values\n : [];\n\n for (const value of valuesNodes) {\n var _value$description;\n\n enumValueMap[value.name.value] = {\n description:\n (_value$description = value.description) === null ||\n _value$description === void 0\n ? void 0\n : _value$description.value,\n deprecationReason: getDeprecationReason(value),\n astNode: value,\n };\n }\n }\n\n return enumValueMap;\n }\n\n function buildInterfaces(nodes) {\n // Note: While this could make assertions to get the correctly typed\n // values below, that would throw immediately while type system\n // validation with validateSchema() will produce more actionable results.\n // @ts-expect-error\n return nodes.flatMap(\n // FIXME: https://github.com/graphql/graphql-js/issues/2203\n (node) => {\n var _node$interfaces$map, _node$interfaces;\n\n return (\n /* c8 ignore next */\n (_node$interfaces$map =\n (_node$interfaces = node.interfaces) === null ||\n _node$interfaces === void 0\n ? void 0\n : _node$interfaces.map(getNamedType)) !== null &&\n _node$interfaces$map !== void 0\n ? _node$interfaces$map\n : []\n );\n },\n );\n }\n\n function buildUnionTypes(nodes) {\n // Note: While this could make assertions to get the correctly typed\n // values below, that would throw immediately while type system\n // validation with validateSchema() will produce more actionable results.\n // @ts-expect-error\n return nodes.flatMap(\n // FIXME: https://github.com/graphql/graphql-js/issues/2203\n (node) => {\n var _node$types$map, _node$types;\n\n return (\n /* c8 ignore next */\n (_node$types$map =\n (_node$types = node.types) === null || _node$types === void 0\n ? void 0\n : _node$types.map(getNamedType)) !== null &&\n _node$types$map !== void 0\n ? _node$types$map\n : []\n );\n },\n );\n }\n\n function buildType(astNode) {\n var _typeExtensionsMap$na;\n\n const name = astNode.name.value;\n const extensionASTNodes =\n (_typeExtensionsMap$na = typeExtensionsMap[name]) !== null &&\n _typeExtensionsMap$na !== void 0\n ? _typeExtensionsMap$na\n : [];\n\n switch (astNode.kind) {\n case Kind.OBJECT_TYPE_DEFINITION: {\n var _astNode$description;\n\n const allNodes = [astNode, ...extensionASTNodes];\n return new GraphQLObjectType({\n name,\n description:\n (_astNode$description = astNode.description) === null ||\n _astNode$description === void 0\n ? void 0\n : _astNode$description.value,\n interfaces: () => buildInterfaces(allNodes),\n fields: () => buildFieldMap(allNodes),\n astNode,\n extensionASTNodes,\n });\n }\n\n case Kind.INTERFACE_TYPE_DEFINITION: {\n var _astNode$description2;\n\n const allNodes = [astNode, ...extensionASTNodes];\n return new GraphQLInterfaceType({\n name,\n description:\n (_astNode$description2 = astNode.description) === null ||\n _astNode$description2 === void 0\n ? void 0\n : _astNode$description2.value,\n interfaces: () => buildInterfaces(allNodes),\n fields: () => buildFieldMap(allNodes),\n astNode,\n extensionASTNodes,\n });\n }\n\n case Kind.ENUM_TYPE_DEFINITION: {\n var _astNode$description3;\n\n const allNodes = [astNode, ...extensionASTNodes];\n return new GraphQLEnumType({\n name,\n description:\n (_astNode$description3 = astNode.description) === null ||\n _astNode$description3 === void 0\n ? void 0\n : _astNode$description3.value,\n values: buildEnumValueMap(allNodes),\n astNode,\n extensionASTNodes,\n });\n }\n\n case Kind.UNION_TYPE_DEFINITION: {\n var _astNode$description4;\n\n const allNodes = [astNode, ...extensionASTNodes];\n return new GraphQLUnionType({\n name,\n description:\n (_astNode$description4 = astNode.description) === null ||\n _astNode$description4 === void 0\n ? void 0\n : _astNode$description4.value,\n types: () => buildUnionTypes(allNodes),\n astNode,\n extensionASTNodes,\n });\n }\n\n case Kind.SCALAR_TYPE_DEFINITION: {\n var _astNode$description5;\n\n return new GraphQLScalarType({\n name,\n description:\n (_astNode$description5 = astNode.description) === null ||\n _astNode$description5 === void 0\n ? void 0\n : _astNode$description5.value,\n specifiedByURL: getSpecifiedByURL(astNode),\n astNode,\n extensionASTNodes,\n });\n }\n\n case Kind.INPUT_OBJECT_TYPE_DEFINITION: {\n var _astNode$description6;\n\n const allNodes = [astNode, ...extensionASTNodes];\n return new GraphQLInputObjectType({\n name,\n description:\n (_astNode$description6 = astNode.description) === null ||\n _astNode$description6 === void 0\n ? void 0\n : _astNode$description6.value,\n fields: () => buildInputFieldMap(allNodes),\n astNode,\n extensionASTNodes,\n isOneOf: isOneOf(astNode),\n });\n }\n }\n }\n}\nconst stdTypeMap = keyMap(\n [...specifiedScalarTypes, ...introspectionTypes],\n (type) => type.name,\n);\n/**\n * Given a field or enum value node, returns the string value for the\n * deprecation reason.\n */\n\nfunction getDeprecationReason(node) {\n const deprecated = getDirectiveValues(GraphQLDeprecatedDirective, node); // @ts-expect-error validated by `getDirectiveValues`\n\n return deprecated === null || deprecated === void 0\n ? void 0\n : deprecated.reason;\n}\n/**\n * Given a scalar node, returns the string value for the specifiedByURL.\n */\n\nfunction getSpecifiedByURL(node) {\n const specifiedBy = getDirectiveValues(GraphQLSpecifiedByDirective, node); // @ts-expect-error validated by `getDirectiveValues`\n\n return specifiedBy === null || specifiedBy === void 0\n ? void 0\n : specifiedBy.url;\n}\n/**\n * Given an input object node, returns if the node should be OneOf.\n */\n\nfunction isOneOf(node) {\n return Boolean(getDirectiveValues(GraphQLOneOfDirective, node));\n}\n", "import { devAssert } from '../jsutils/devAssert.mjs';\nimport { Kind } from '../language/kinds.mjs';\nimport { parse } from '../language/parser.mjs';\nimport { specifiedDirectives } from '../type/directives.mjs';\nimport { GraphQLSchema } from '../type/schema.mjs';\nimport { assertValidSDL } from '../validation/validate.mjs';\nimport { extendSchemaImpl } from './extendSchema.mjs';\n\n/**\n * This takes the ast of a schema document produced by the parse function in\n * src/language/parser.js.\n *\n * If no schema definition is provided, then it will look for types named Query,\n * Mutation and Subscription.\n *\n * Given that AST it constructs a GraphQLSchema. The resulting schema\n * has no resolve methods, so execution will use default resolvers.\n */\nexport function buildASTSchema(documentAST, options) {\n (documentAST != null && documentAST.kind === Kind.DOCUMENT) ||\n devAssert(false, 'Must provide valid Document AST.');\n\n if (\n (options === null || options === void 0 ? void 0 : options.assumeValid) !==\n true &&\n (options === null || options === void 0\n ? void 0\n : options.assumeValidSDL) !== true\n ) {\n assertValidSDL(documentAST);\n }\n\n const emptySchemaConfig = {\n description: undefined,\n types: [],\n directives: [],\n extensions: Object.create(null),\n extensionASTNodes: [],\n assumeValid: false,\n };\n const config = extendSchemaImpl(emptySchemaConfig, documentAST, options);\n\n if (config.astNode == null) {\n for (const type of config.types) {\n switch (type.name) {\n // Note: While this could make early assertions to get the correctly\n // typed values below, that would throw immediately while type system\n // validation with validateSchema() will produce more actionable results.\n case 'Query':\n // @ts-expect-error validated in `validateSchema`\n config.query = type;\n break;\n\n case 'Mutation':\n // @ts-expect-error validated in `validateSchema`\n config.mutation = type;\n break;\n\n case 'Subscription':\n // @ts-expect-error validated in `validateSchema`\n config.subscription = type;\n break;\n }\n }\n }\n\n const directives = [\n ...config.directives, // If specified directives were not explicitly declared, add them.\n ...specifiedDirectives.filter((stdDirective) =>\n config.directives.every(\n (directive) => directive.name !== stdDirective.name,\n ),\n ),\n ];\n return new GraphQLSchema({ ...config, directives });\n}\n/**\n * A helper function to build a GraphQLSchema directly from a source\n * document.\n */\n\nexport function buildSchema(source, options) {\n const document = parse(source, {\n noLocation:\n options === null || options === void 0 ? void 0 : options.noLocation,\n allowLegacyFragmentVariables:\n options === null || options === void 0\n ? void 0\n : options.allowLegacyFragmentVariables,\n });\n return buildASTSchema(document, {\n assumeValidSDL:\n options === null || options === void 0 ? void 0 : options.assumeValidSDL,\n assumeValid:\n options === null || options === void 0 ? void 0 : options.assumeValid,\n });\n}\n", "import { inspect } from '../jsutils/inspect.mjs';\nimport { invariant } from '../jsutils/invariant.mjs';\nimport { keyValMap } from '../jsutils/keyValMap.mjs';\nimport { naturalCompare } from '../jsutils/naturalCompare.mjs';\nimport {\n GraphQLEnumType,\n GraphQLInputObjectType,\n GraphQLInterfaceType,\n GraphQLList,\n GraphQLNonNull,\n GraphQLObjectType,\n GraphQLUnionType,\n isEnumType,\n isInputObjectType,\n isInterfaceType,\n isListType,\n isNonNullType,\n isObjectType,\n isScalarType,\n isUnionType,\n} from '../type/definition.mjs';\nimport { GraphQLDirective } from '../type/directives.mjs';\nimport { isIntrospectionType } from '../type/introspection.mjs';\nimport { GraphQLSchema } from '../type/schema.mjs';\n/**\n * Sort GraphQLSchema.\n *\n * This function returns a sorted copy of the given GraphQLSchema.\n */\n\nexport function lexicographicSortSchema(schema) {\n const schemaConfig = schema.toConfig();\n const typeMap = keyValMap(\n sortByName(schemaConfig.types),\n (type) => type.name,\n sortNamedType,\n );\n return new GraphQLSchema({\n ...schemaConfig,\n types: Object.values(typeMap),\n directives: sortByName(schemaConfig.directives).map(sortDirective),\n query: replaceMaybeType(schemaConfig.query),\n mutation: replaceMaybeType(schemaConfig.mutation),\n subscription: replaceMaybeType(schemaConfig.subscription),\n });\n\n function replaceType(type) {\n if (isListType(type)) {\n // @ts-expect-error\n return new GraphQLList(replaceType(type.ofType));\n } else if (isNonNullType(type)) {\n // @ts-expect-error\n return new GraphQLNonNull(replaceType(type.ofType));\n } // @ts-expect-error FIXME: TS Conversion\n\n return replaceNamedType(type);\n }\n\n function replaceNamedType(type) {\n return typeMap[type.name];\n }\n\n function replaceMaybeType(maybeType) {\n return maybeType && replaceNamedType(maybeType);\n }\n\n function sortDirective(directive) {\n const config = directive.toConfig();\n return new GraphQLDirective({\n ...config,\n locations: sortBy(config.locations, (x) => x),\n args: sortArgs(config.args),\n });\n }\n\n function sortArgs(args) {\n return sortObjMap(args, (arg) => ({ ...arg, type: replaceType(arg.type) }));\n }\n\n function sortFields(fieldsMap) {\n return sortObjMap(fieldsMap, (field) => ({\n ...field,\n type: replaceType(field.type),\n args: field.args && sortArgs(field.args),\n }));\n }\n\n function sortInputFields(fieldsMap) {\n return sortObjMap(fieldsMap, (field) => ({\n ...field,\n type: replaceType(field.type),\n }));\n }\n\n function sortTypes(array) {\n return sortByName(array).map(replaceNamedType);\n }\n\n function sortNamedType(type) {\n if (isScalarType(type) || isIntrospectionType(type)) {\n return type;\n }\n\n if (isObjectType(type)) {\n const config = type.toConfig();\n return new GraphQLObjectType({\n ...config,\n interfaces: () => sortTypes(config.interfaces),\n fields: () => sortFields(config.fields),\n });\n }\n\n if (isInterfaceType(type)) {\n const config = type.toConfig();\n return new GraphQLInterfaceType({\n ...config,\n interfaces: () => sortTypes(config.interfaces),\n fields: () => sortFields(config.fields),\n });\n }\n\n if (isUnionType(type)) {\n const config = type.toConfig();\n return new GraphQLUnionType({\n ...config,\n types: () => sortTypes(config.types),\n });\n }\n\n if (isEnumType(type)) {\n const config = type.toConfig();\n return new GraphQLEnumType({\n ...config,\n values: sortObjMap(config.values, (value) => value),\n });\n }\n\n if (isInputObjectType(type)) {\n const config = type.toConfig();\n return new GraphQLInputObjectType({\n ...config,\n fields: () => sortInputFields(config.fields),\n });\n }\n /* c8 ignore next 3 */\n // Not reachable, all possible types have been considered.\n\n false || invariant(false, 'Unexpected type: ' + inspect(type));\n }\n}\n\nfunction sortObjMap(map, sortValueFn) {\n const sortedMap = Object.create(null);\n\n for (const key of Object.keys(map).sort(naturalCompare)) {\n sortedMap[key] = sortValueFn(map[key]);\n }\n\n return sortedMap;\n}\n\nfunction sortByName(array) {\n return sortBy(array, (obj) => obj.name);\n}\n\nfunction sortBy(array, mapToKey) {\n return array.slice().sort((obj1, obj2) => {\n const key1 = mapToKey(obj1);\n const key2 = mapToKey(obj2);\n return naturalCompare(key1, key2);\n });\n}\n", "import { inspect } from '../jsutils/inspect.mjs';\nimport { invariant } from '../jsutils/invariant.mjs';\nimport { isPrintableAsBlockString } from '../language/blockString.mjs';\nimport { Kind } from '../language/kinds.mjs';\nimport { print } from '../language/printer.mjs';\nimport {\n isEnumType,\n isInputObjectType,\n isInterfaceType,\n isObjectType,\n isScalarType,\n isUnionType,\n} from '../type/definition.mjs';\nimport {\n DEFAULT_DEPRECATION_REASON,\n isSpecifiedDirective,\n} from '../type/directives.mjs';\nimport { isIntrospectionType } from '../type/introspection.mjs';\nimport { isSpecifiedScalarType } from '../type/scalars.mjs';\nimport { astFromValue } from './astFromValue.mjs';\nexport function printSchema(schema) {\n return printFilteredSchema(\n schema,\n (n) => !isSpecifiedDirective(n),\n isDefinedType,\n );\n}\nexport function printIntrospectionSchema(schema) {\n return printFilteredSchema(schema, isSpecifiedDirective, isIntrospectionType);\n}\n\nfunction isDefinedType(type) {\n return !isSpecifiedScalarType(type) && !isIntrospectionType(type);\n}\n\nfunction printFilteredSchema(schema, directiveFilter, typeFilter) {\n const directives = schema.getDirectives().filter(directiveFilter);\n const types = Object.values(schema.getTypeMap()).filter(typeFilter);\n return [\n printSchemaDefinition(schema),\n ...directives.map((directive) => printDirective(directive)),\n ...types.map((type) => printType(type)),\n ]\n .filter(Boolean)\n .join('\\n\\n');\n}\n\nfunction printSchemaDefinition(schema) {\n if (schema.description == null && isSchemaOfCommonNames(schema)) {\n return;\n }\n\n const operationTypes = [];\n const queryType = schema.getQueryType();\n\n if (queryType) {\n operationTypes.push(` query: ${queryType.name}`);\n }\n\n const mutationType = schema.getMutationType();\n\n if (mutationType) {\n operationTypes.push(` mutation: ${mutationType.name}`);\n }\n\n const subscriptionType = schema.getSubscriptionType();\n\n if (subscriptionType) {\n operationTypes.push(` subscription: ${subscriptionType.name}`);\n }\n\n return printDescription(schema) + `schema {\\n${operationTypes.join('\\n')}\\n}`;\n}\n/**\n * GraphQL schema define root types for each type of operation. These types are\n * the same as any other type and can be named in any manner, however there is\n * a common naming convention:\n *\n * ```graphql\n * schema {\n * query: Query\n * mutation: Mutation\n * subscription: Subscription\n * }\n * ```\n *\n * When using this naming convention, the schema description can be omitted.\n */\n\nfunction isSchemaOfCommonNames(schema) {\n const queryType = schema.getQueryType();\n\n if (queryType && queryType.name !== 'Query') {\n return false;\n }\n\n const mutationType = schema.getMutationType();\n\n if (mutationType && mutationType.name !== 'Mutation') {\n return false;\n }\n\n const subscriptionType = schema.getSubscriptionType();\n\n if (subscriptionType && subscriptionType.name !== 'Subscription') {\n return false;\n }\n\n return true;\n}\n\nexport function printType(type) {\n if (isScalarType(type)) {\n return printScalar(type);\n }\n\n if (isObjectType(type)) {\n return printObject(type);\n }\n\n if (isInterfaceType(type)) {\n return printInterface(type);\n }\n\n if (isUnionType(type)) {\n return printUnion(type);\n }\n\n if (isEnumType(type)) {\n return printEnum(type);\n }\n\n if (isInputObjectType(type)) {\n return printInputObject(type);\n }\n /* c8 ignore next 3 */\n // Not reachable, all possible types have been considered.\n\n false || invariant(false, 'Unexpected type: ' + inspect(type));\n}\n\nfunction printScalar(type) {\n return (\n printDescription(type) + `scalar ${type.name}` + printSpecifiedByURL(type)\n );\n}\n\nfunction printImplementedInterfaces(type) {\n const interfaces = type.getInterfaces();\n return interfaces.length\n ? ' implements ' + interfaces.map((i) => i.name).join(' & ')\n : '';\n}\n\nfunction printObject(type) {\n return (\n printDescription(type) +\n `type ${type.name}` +\n printImplementedInterfaces(type) +\n printFields(type)\n );\n}\n\nfunction printInterface(type) {\n return (\n printDescription(type) +\n `interface ${type.name}` +\n printImplementedInterfaces(type) +\n printFields(type)\n );\n}\n\nfunction printUnion(type) {\n const types = type.getTypes();\n const possibleTypes = types.length ? ' = ' + types.join(' | ') : '';\n return printDescription(type) + 'union ' + type.name + possibleTypes;\n}\n\nfunction printEnum(type) {\n const values = type\n .getValues()\n .map(\n (value, i) =>\n printDescription(value, ' ', !i) +\n ' ' +\n value.name +\n printDeprecated(value.deprecationReason),\n );\n return printDescription(type) + `enum ${type.name}` + printBlock(values);\n}\n\nfunction printInputObject(type) {\n const fields = Object.values(type.getFields()).map(\n (f, i) => printDescription(f, ' ', !i) + ' ' + printInputValue(f),\n );\n return (\n printDescription(type) +\n `input ${type.name}` +\n (type.isOneOf ? ' @oneOf' : '') +\n printBlock(fields)\n );\n}\n\nfunction printFields(type) {\n const fields = Object.values(type.getFields()).map(\n (f, i) =>\n printDescription(f, ' ', !i) +\n ' ' +\n f.name +\n printArgs(f.args, ' ') +\n ': ' +\n String(f.type) +\n printDeprecated(f.deprecationReason),\n );\n return printBlock(fields);\n}\n\nfunction printBlock(items) {\n return items.length !== 0 ? ' {\\n' + items.join('\\n') + '\\n}' : '';\n}\n\nfunction printArgs(args, indentation = '') {\n if (args.length === 0) {\n return '';\n } // If every arg does not have a description, print them on one line.\n\n if (args.every((arg) => !arg.description)) {\n return '(' + args.map(printInputValue).join(', ') + ')';\n }\n\n return (\n '(\\n' +\n args\n .map(\n (arg, i) =>\n printDescription(arg, ' ' + indentation, !i) +\n ' ' +\n indentation +\n printInputValue(arg),\n )\n .join('\\n') +\n '\\n' +\n indentation +\n ')'\n );\n}\n\nfunction printInputValue(arg) {\n const defaultAST = astFromValue(arg.defaultValue, arg.type);\n let argDecl = arg.name + ': ' + String(arg.type);\n\n if (defaultAST) {\n argDecl += ` = ${print(defaultAST)}`;\n }\n\n return argDecl + printDeprecated(arg.deprecationReason);\n}\n\nfunction printDirective(directive) {\n return (\n printDescription(directive) +\n 'directive @' +\n directive.name +\n printArgs(directive.args) +\n (directive.isRepeatable ? ' repeatable' : '') +\n ' on ' +\n directive.locations.join(' | ')\n );\n}\n\nfunction printDeprecated(reason) {\n if (reason == null) {\n return '';\n }\n\n if (reason !== DEFAULT_DEPRECATION_REASON) {\n const astValue = print({\n kind: Kind.STRING,\n value: reason,\n });\n return ` @deprecated(reason: ${astValue})`;\n }\n\n return ' @deprecated';\n}\n\nfunction printSpecifiedByURL(scalar) {\n if (scalar.specifiedByURL == null) {\n return '';\n }\n\n const astValue = print({\n kind: Kind.STRING,\n value: scalar.specifiedByURL,\n });\n return ` @specifiedBy(url: ${astValue})`;\n}\n\nfunction printDescription(def, indentation = '', firstInBlock = true) {\n const { description } = def;\n\n if (description == null) {\n return '';\n }\n\n const blockString = print({\n kind: Kind.STRING,\n value: description,\n block: isPrintableAsBlockString(description),\n });\n const prefix =\n indentation && !firstInBlock ? '\\n' + indentation : indentation;\n return prefix + blockString.replace(/\\n/g, '\\n' + indentation) + '\\n';\n}\n", "import { Kind } from '../language/kinds.mjs';\n/**\n * Provided a collection of ASTs, presumably each from different files,\n * concatenate the ASTs together into batched AST, useful for validating many\n * GraphQL source files which together represent one conceptual application.\n */\n\nexport function concatAST(documents) {\n const definitions = [];\n\n for (const doc of documents) {\n definitions.push(...doc.definitions);\n }\n\n return {\n kind: Kind.DOCUMENT,\n definitions,\n };\n}\n", "import { Kind } from '../language/kinds.mjs';\nimport { visit } from '../language/visitor.mjs';\n/**\n * separateOperations accepts a single AST document which may contain many\n * operations and fragments and returns a collection of AST documents each of\n * which contains a single operation as well the fragment definitions it\n * refers to.\n */\n\nexport function separateOperations(documentAST) {\n const operations = [];\n const depGraph = Object.create(null); // Populate metadata and build a dependency graph.\n\n for (const definitionNode of documentAST.definitions) {\n switch (definitionNode.kind) {\n case Kind.OPERATION_DEFINITION:\n operations.push(definitionNode);\n break;\n\n case Kind.FRAGMENT_DEFINITION:\n depGraph[definitionNode.name.value] = collectDependencies(\n definitionNode.selectionSet,\n );\n break;\n\n default: // ignore non-executable definitions\n }\n } // For each operation, produce a new synthesized AST which includes only what\n // is necessary for completing that operation.\n\n const separatedDocumentASTs = Object.create(null);\n\n for (const operation of operations) {\n const dependencies = new Set();\n\n for (const fragmentName of collectDependencies(operation.selectionSet)) {\n collectTransitiveDependencies(dependencies, depGraph, fragmentName);\n } // Provides the empty string for anonymous operations.\n\n const operationName = operation.name ? operation.name.value : ''; // The list of definition nodes to be included for this operation, sorted\n // to retain the same order as the original document.\n\n separatedDocumentASTs[operationName] = {\n kind: Kind.DOCUMENT,\n definitions: documentAST.definitions.filter(\n (node) =>\n node === operation ||\n (node.kind === Kind.FRAGMENT_DEFINITION &&\n dependencies.has(node.name.value)),\n ),\n };\n }\n\n return separatedDocumentASTs;\n}\n\n// From a dependency graph, collects a list of transitive dependencies by\n// recursing through a dependency graph.\nfunction collectTransitiveDependencies(collected, depGraph, fromName) {\n if (!collected.has(fromName)) {\n collected.add(fromName);\n const immediateDeps = depGraph[fromName];\n\n if (immediateDeps !== undefined) {\n for (const toName of immediateDeps) {\n collectTransitiveDependencies(collected, depGraph, toName);\n }\n }\n }\n}\n\nfunction collectDependencies(selectionSet) {\n const dependencies = [];\n visit(selectionSet, {\n FragmentSpread(node) {\n dependencies.push(node.name.value);\n },\n });\n return dependencies;\n}\n", "import { printBlockString } from '../language/blockString.mjs';\nimport { isPunctuatorTokenKind, Lexer } from '../language/lexer.mjs';\nimport { isSource, Source } from '../language/source.mjs';\nimport { TokenKind } from '../language/tokenKind.mjs';\n/**\n * Strips characters that are not significant to the validity or execution\n * of a GraphQL document:\n * - UnicodeBOM\n * - WhiteSpace\n * - LineTerminator\n * - Comment\n * - Comma\n * - BlockString indentation\n *\n * Note: It is required to have a delimiter character between neighboring\n * non-punctuator tokens and this function always uses single space as delimiter.\n *\n * It is guaranteed that both input and output documents if parsed would result\n * in the exact same AST except for nodes location.\n *\n * Warning: It is guaranteed that this function will always produce stable results.\n * However, it's not guaranteed that it will stay the same between different\n * releases due to bugfixes or changes in the GraphQL specification.\n *\n * Query example:\n *\n * ```graphql\n * query SomeQuery($foo: String!, $bar: String) {\n * someField(foo: $foo, bar: $bar) {\n * a\n * b {\n * c\n * d\n * }\n * }\n * }\n * ```\n *\n * Becomes:\n *\n * ```graphql\n * query SomeQuery($foo:String!$bar:String){someField(foo:$foo bar:$bar){a b{c d}}}\n * ```\n *\n * SDL example:\n *\n * ```graphql\n * \"\"\"\n * Type description\n * \"\"\"\n * type Foo {\n * \"\"\"\n * Field description\n * \"\"\"\n * bar: String\n * }\n * ```\n *\n * Becomes:\n *\n * ```graphql\n * \"\"\"Type description\"\"\" type Foo{\"\"\"Field description\"\"\" bar:String}\n * ```\n */\n\nexport function stripIgnoredCharacters(source) {\n const sourceObj = isSource(source) ? source : new Source(source);\n const body = sourceObj.body;\n const lexer = new Lexer(sourceObj);\n let strippedBody = '';\n let wasLastAddedTokenNonPunctuator = false;\n\n while (lexer.advance().kind !== TokenKind.EOF) {\n const currentToken = lexer.token;\n const tokenKind = currentToken.kind;\n /**\n * Every two non-punctuator tokens should have space between them.\n * Also prevent case of non-punctuator token following by spread resulting\n * in invalid token (e.g. `1...` is invalid Float token).\n */\n\n const isNonPunctuator = !isPunctuatorTokenKind(currentToken.kind);\n\n if (wasLastAddedTokenNonPunctuator) {\n if (isNonPunctuator || currentToken.kind === TokenKind.SPREAD) {\n strippedBody += ' ';\n }\n }\n\n const tokenBody = body.slice(currentToken.start, currentToken.end);\n\n if (tokenKind === TokenKind.BLOCK_STRING) {\n strippedBody += printBlockString(currentToken.value, {\n minimize: true,\n });\n } else {\n strippedBody += tokenBody;\n }\n\n wasLastAddedTokenNonPunctuator = isNonPunctuator;\n }\n\n return strippedBody;\n}\n", "import { devAssert } from '../jsutils/devAssert.mjs';\nimport { GraphQLError } from '../error/GraphQLError.mjs';\nimport { assertName } from '../type/assertName.mjs';\n/* c8 ignore start */\n\n/**\n * Upholds the spec rules about naming.\n * @deprecated Please use `assertName` instead. Will be removed in v17\n */\n\nexport function assertValidName(name) {\n const error = isValidNameError(name);\n\n if (error) {\n throw error;\n }\n\n return name;\n}\n/**\n * Returns an Error if a name is invalid.\n * @deprecated Please use `assertName` instead. Will be removed in v17\n */\n\nexport function isValidNameError(name) {\n typeof name === 'string' || devAssert(false, 'Expected name to be a string.');\n\n if (name.startsWith('__')) {\n return new GraphQLError(\n `Name \"${name}\" must not begin with \"__\", which is reserved by GraphQL introspection.`,\n );\n }\n\n try {\n assertName(name);\n } catch (error) {\n return error;\n }\n}\n/* c8 ignore stop */\n", "import { inspect } from '../jsutils/inspect.mjs';\nimport { invariant } from '../jsutils/invariant.mjs';\nimport { keyMap } from '../jsutils/keyMap.mjs';\nimport { print } from '../language/printer.mjs';\nimport {\n isEnumType,\n isInputObjectType,\n isInterfaceType,\n isListType,\n isNamedType,\n isNonNullType,\n isObjectType,\n isRequiredArgument,\n isRequiredInputField,\n isScalarType,\n isUnionType,\n} from '../type/definition.mjs';\nimport { isSpecifiedScalarType } from '../type/scalars.mjs';\nimport { astFromValue } from './astFromValue.mjs';\nimport { sortValueNode } from './sortValueNode.mjs';\nvar BreakingChangeType;\n\n(function (BreakingChangeType) {\n BreakingChangeType['TYPE_REMOVED'] = 'TYPE_REMOVED';\n BreakingChangeType['TYPE_CHANGED_KIND'] = 'TYPE_CHANGED_KIND';\n BreakingChangeType['TYPE_REMOVED_FROM_UNION'] = 'TYPE_REMOVED_FROM_UNION';\n BreakingChangeType['VALUE_REMOVED_FROM_ENUM'] = 'VALUE_REMOVED_FROM_ENUM';\n BreakingChangeType['REQUIRED_INPUT_FIELD_ADDED'] =\n 'REQUIRED_INPUT_FIELD_ADDED';\n BreakingChangeType['IMPLEMENTED_INTERFACE_REMOVED'] =\n 'IMPLEMENTED_INTERFACE_REMOVED';\n BreakingChangeType['FIELD_REMOVED'] = 'FIELD_REMOVED';\n BreakingChangeType['FIELD_CHANGED_KIND'] = 'FIELD_CHANGED_KIND';\n BreakingChangeType['REQUIRED_ARG_ADDED'] = 'REQUIRED_ARG_ADDED';\n BreakingChangeType['ARG_REMOVED'] = 'ARG_REMOVED';\n BreakingChangeType['ARG_CHANGED_KIND'] = 'ARG_CHANGED_KIND';\n BreakingChangeType['DIRECTIVE_REMOVED'] = 'DIRECTIVE_REMOVED';\n BreakingChangeType['DIRECTIVE_ARG_REMOVED'] = 'DIRECTIVE_ARG_REMOVED';\n BreakingChangeType['REQUIRED_DIRECTIVE_ARG_ADDED'] =\n 'REQUIRED_DIRECTIVE_ARG_ADDED';\n BreakingChangeType['DIRECTIVE_REPEATABLE_REMOVED'] =\n 'DIRECTIVE_REPEATABLE_REMOVED';\n BreakingChangeType['DIRECTIVE_LOCATION_REMOVED'] =\n 'DIRECTIVE_LOCATION_REMOVED';\n})(BreakingChangeType || (BreakingChangeType = {}));\n\nexport { BreakingChangeType };\nvar DangerousChangeType;\n\n(function (DangerousChangeType) {\n DangerousChangeType['VALUE_ADDED_TO_ENUM'] = 'VALUE_ADDED_TO_ENUM';\n DangerousChangeType['TYPE_ADDED_TO_UNION'] = 'TYPE_ADDED_TO_UNION';\n DangerousChangeType['OPTIONAL_INPUT_FIELD_ADDED'] =\n 'OPTIONAL_INPUT_FIELD_ADDED';\n DangerousChangeType['OPTIONAL_ARG_ADDED'] = 'OPTIONAL_ARG_ADDED';\n DangerousChangeType['IMPLEMENTED_INTERFACE_ADDED'] =\n 'IMPLEMENTED_INTERFACE_ADDED';\n DangerousChangeType['ARG_DEFAULT_VALUE_CHANGE'] = 'ARG_DEFAULT_VALUE_CHANGE';\n})(DangerousChangeType || (DangerousChangeType = {}));\n\nexport { DangerousChangeType };\n\n/**\n * Given two schemas, returns an Array containing descriptions of all the types\n * of breaking changes covered by the other functions down below.\n */\nexport function findBreakingChanges(oldSchema, newSchema) {\n // @ts-expect-error\n return findSchemaChanges(oldSchema, newSchema).filter(\n (change) => change.type in BreakingChangeType,\n );\n}\n/**\n * Given two schemas, returns an Array containing descriptions of all the types\n * of potentially dangerous changes covered by the other functions down below.\n */\n\nexport function findDangerousChanges(oldSchema, newSchema) {\n // @ts-expect-error\n return findSchemaChanges(oldSchema, newSchema).filter(\n (change) => change.type in DangerousChangeType,\n );\n}\n\nfunction findSchemaChanges(oldSchema, newSchema) {\n return [\n ...findTypeChanges(oldSchema, newSchema),\n ...findDirectiveChanges(oldSchema, newSchema),\n ];\n}\n\nfunction findDirectiveChanges(oldSchema, newSchema) {\n const schemaChanges = [];\n const directivesDiff = diff(\n oldSchema.getDirectives(),\n newSchema.getDirectives(),\n );\n\n for (const oldDirective of directivesDiff.removed) {\n schemaChanges.push({\n type: BreakingChangeType.DIRECTIVE_REMOVED,\n description: `${oldDirective.name} was removed.`,\n });\n }\n\n for (const [oldDirective, newDirective] of directivesDiff.persisted) {\n const argsDiff = diff(oldDirective.args, newDirective.args);\n\n for (const newArg of argsDiff.added) {\n if (isRequiredArgument(newArg)) {\n schemaChanges.push({\n type: BreakingChangeType.REQUIRED_DIRECTIVE_ARG_ADDED,\n description: `A required arg ${newArg.name} on directive ${oldDirective.name} was added.`,\n });\n }\n }\n\n for (const oldArg of argsDiff.removed) {\n schemaChanges.push({\n type: BreakingChangeType.DIRECTIVE_ARG_REMOVED,\n description: `${oldArg.name} was removed from ${oldDirective.name}.`,\n });\n }\n\n if (oldDirective.isRepeatable && !newDirective.isRepeatable) {\n schemaChanges.push({\n type: BreakingChangeType.DIRECTIVE_REPEATABLE_REMOVED,\n description: `Repeatable flag was removed from ${oldDirective.name}.`,\n });\n }\n\n for (const location of oldDirective.locations) {\n if (!newDirective.locations.includes(location)) {\n schemaChanges.push({\n type: BreakingChangeType.DIRECTIVE_LOCATION_REMOVED,\n description: `${location} was removed from ${oldDirective.name}.`,\n });\n }\n }\n }\n\n return schemaChanges;\n}\n\nfunction findTypeChanges(oldSchema, newSchema) {\n const schemaChanges = [];\n const typesDiff = diff(\n Object.values(oldSchema.getTypeMap()),\n Object.values(newSchema.getTypeMap()),\n );\n\n for (const oldType of typesDiff.removed) {\n schemaChanges.push({\n type: BreakingChangeType.TYPE_REMOVED,\n description: isSpecifiedScalarType(oldType)\n ? `Standard scalar ${oldType.name} was removed because it is not referenced anymore.`\n : `${oldType.name} was removed.`,\n });\n }\n\n for (const [oldType, newType] of typesDiff.persisted) {\n if (isEnumType(oldType) && isEnumType(newType)) {\n schemaChanges.push(...findEnumTypeChanges(oldType, newType));\n } else if (isUnionType(oldType) && isUnionType(newType)) {\n schemaChanges.push(...findUnionTypeChanges(oldType, newType));\n } else if (isInputObjectType(oldType) && isInputObjectType(newType)) {\n schemaChanges.push(...findInputObjectTypeChanges(oldType, newType));\n } else if (isObjectType(oldType) && isObjectType(newType)) {\n schemaChanges.push(\n ...findFieldChanges(oldType, newType),\n ...findImplementedInterfacesChanges(oldType, newType),\n );\n } else if (isInterfaceType(oldType) && isInterfaceType(newType)) {\n schemaChanges.push(\n ...findFieldChanges(oldType, newType),\n ...findImplementedInterfacesChanges(oldType, newType),\n );\n } else if (oldType.constructor !== newType.constructor) {\n schemaChanges.push({\n type: BreakingChangeType.TYPE_CHANGED_KIND,\n description:\n `${oldType.name} changed from ` +\n `${typeKindName(oldType)} to ${typeKindName(newType)}.`,\n });\n }\n }\n\n return schemaChanges;\n}\n\nfunction findInputObjectTypeChanges(oldType, newType) {\n const schemaChanges = [];\n const fieldsDiff = diff(\n Object.values(oldType.getFields()),\n Object.values(newType.getFields()),\n );\n\n for (const newField of fieldsDiff.added) {\n if (isRequiredInputField(newField)) {\n schemaChanges.push({\n type: BreakingChangeType.REQUIRED_INPUT_FIELD_ADDED,\n description: `A required field ${newField.name} on input type ${oldType.name} was added.`,\n });\n } else {\n schemaChanges.push({\n type: DangerousChangeType.OPTIONAL_INPUT_FIELD_ADDED,\n description: `An optional field ${newField.name} on input type ${oldType.name} was added.`,\n });\n }\n }\n\n for (const oldField of fieldsDiff.removed) {\n schemaChanges.push({\n type: BreakingChangeType.FIELD_REMOVED,\n description: `${oldType.name}.${oldField.name} was removed.`,\n });\n }\n\n for (const [oldField, newField] of fieldsDiff.persisted) {\n const isSafe = isChangeSafeForInputObjectFieldOrFieldArg(\n oldField.type,\n newField.type,\n );\n\n if (!isSafe) {\n schemaChanges.push({\n type: BreakingChangeType.FIELD_CHANGED_KIND,\n description:\n `${oldType.name}.${oldField.name} changed type from ` +\n `${String(oldField.type)} to ${String(newField.type)}.`,\n });\n }\n }\n\n return schemaChanges;\n}\n\nfunction findUnionTypeChanges(oldType, newType) {\n const schemaChanges = [];\n const possibleTypesDiff = diff(oldType.getTypes(), newType.getTypes());\n\n for (const newPossibleType of possibleTypesDiff.added) {\n schemaChanges.push({\n type: DangerousChangeType.TYPE_ADDED_TO_UNION,\n description: `${newPossibleType.name} was added to union type ${oldType.name}.`,\n });\n }\n\n for (const oldPossibleType of possibleTypesDiff.removed) {\n schemaChanges.push({\n type: BreakingChangeType.TYPE_REMOVED_FROM_UNION,\n description: `${oldPossibleType.name} was removed from union type ${oldType.name}.`,\n });\n }\n\n return schemaChanges;\n}\n\nfunction findEnumTypeChanges(oldType, newType) {\n const schemaChanges = [];\n const valuesDiff = diff(oldType.getValues(), newType.getValues());\n\n for (const newValue of valuesDiff.added) {\n schemaChanges.push({\n type: DangerousChangeType.VALUE_ADDED_TO_ENUM,\n description: `${newValue.name} was added to enum type ${oldType.name}.`,\n });\n }\n\n for (const oldValue of valuesDiff.removed) {\n schemaChanges.push({\n type: BreakingChangeType.VALUE_REMOVED_FROM_ENUM,\n description: `${oldValue.name} was removed from enum type ${oldType.name}.`,\n });\n }\n\n return schemaChanges;\n}\n\nfunction findImplementedInterfacesChanges(oldType, newType) {\n const schemaChanges = [];\n const interfacesDiff = diff(oldType.getInterfaces(), newType.getInterfaces());\n\n for (const newInterface of interfacesDiff.added) {\n schemaChanges.push({\n type: DangerousChangeType.IMPLEMENTED_INTERFACE_ADDED,\n description: `${newInterface.name} added to interfaces implemented by ${oldType.name}.`,\n });\n }\n\n for (const oldInterface of interfacesDiff.removed) {\n schemaChanges.push({\n type: BreakingChangeType.IMPLEMENTED_INTERFACE_REMOVED,\n description: `${oldType.name} no longer implements interface ${oldInterface.name}.`,\n });\n }\n\n return schemaChanges;\n}\n\nfunction findFieldChanges(oldType, newType) {\n const schemaChanges = [];\n const fieldsDiff = diff(\n Object.values(oldType.getFields()),\n Object.values(newType.getFields()),\n );\n\n for (const oldField of fieldsDiff.removed) {\n schemaChanges.push({\n type: BreakingChangeType.FIELD_REMOVED,\n description: `${oldType.name}.${oldField.name} was removed.`,\n });\n }\n\n for (const [oldField, newField] of fieldsDiff.persisted) {\n schemaChanges.push(...findArgChanges(oldType, oldField, newField));\n const isSafe = isChangeSafeForObjectOrInterfaceField(\n oldField.type,\n newField.type,\n );\n\n if (!isSafe) {\n schemaChanges.push({\n type: BreakingChangeType.FIELD_CHANGED_KIND,\n description:\n `${oldType.name}.${oldField.name} changed type from ` +\n `${String(oldField.type)} to ${String(newField.type)}.`,\n });\n }\n }\n\n return schemaChanges;\n}\n\nfunction findArgChanges(oldType, oldField, newField) {\n const schemaChanges = [];\n const argsDiff = diff(oldField.args, newField.args);\n\n for (const oldArg of argsDiff.removed) {\n schemaChanges.push({\n type: BreakingChangeType.ARG_REMOVED,\n description: `${oldType.name}.${oldField.name} arg ${oldArg.name} was removed.`,\n });\n }\n\n for (const [oldArg, newArg] of argsDiff.persisted) {\n const isSafe = isChangeSafeForInputObjectFieldOrFieldArg(\n oldArg.type,\n newArg.type,\n );\n\n if (!isSafe) {\n schemaChanges.push({\n type: BreakingChangeType.ARG_CHANGED_KIND,\n description:\n `${oldType.name}.${oldField.name} arg ${oldArg.name} has changed type from ` +\n `${String(oldArg.type)} to ${String(newArg.type)}.`,\n });\n } else if (oldArg.defaultValue !== undefined) {\n if (newArg.defaultValue === undefined) {\n schemaChanges.push({\n type: DangerousChangeType.ARG_DEFAULT_VALUE_CHANGE,\n description: `${oldType.name}.${oldField.name} arg ${oldArg.name} defaultValue was removed.`,\n });\n } else {\n // Since we looking only for client's observable changes we should\n // compare default values in the same representation as they are\n // represented inside introspection.\n const oldValueStr = stringifyValue(oldArg.defaultValue, oldArg.type);\n const newValueStr = stringifyValue(newArg.defaultValue, newArg.type);\n\n if (oldValueStr !== newValueStr) {\n schemaChanges.push({\n type: DangerousChangeType.ARG_DEFAULT_VALUE_CHANGE,\n description: `${oldType.name}.${oldField.name} arg ${oldArg.name} has changed defaultValue from ${oldValueStr} to ${newValueStr}.`,\n });\n }\n }\n }\n }\n\n for (const newArg of argsDiff.added) {\n if (isRequiredArgument(newArg)) {\n schemaChanges.push({\n type: BreakingChangeType.REQUIRED_ARG_ADDED,\n description: `A required arg ${newArg.name} on ${oldType.name}.${oldField.name} was added.`,\n });\n } else {\n schemaChanges.push({\n type: DangerousChangeType.OPTIONAL_ARG_ADDED,\n description: `An optional arg ${newArg.name} on ${oldType.name}.${oldField.name} was added.`,\n });\n }\n }\n\n return schemaChanges;\n}\n\nfunction isChangeSafeForObjectOrInterfaceField(oldType, newType) {\n if (isListType(oldType)) {\n return (\n // if they're both lists, make sure the underlying types are compatible\n (isListType(newType) &&\n isChangeSafeForObjectOrInterfaceField(\n oldType.ofType,\n newType.ofType,\n )) || // moving from nullable to non-null of the same underlying type is safe\n (isNonNullType(newType) &&\n isChangeSafeForObjectOrInterfaceField(oldType, newType.ofType))\n );\n }\n\n if (isNonNullType(oldType)) {\n // if they're both non-null, make sure the underlying types are compatible\n return (\n isNonNullType(newType) &&\n isChangeSafeForObjectOrInterfaceField(oldType.ofType, newType.ofType)\n );\n }\n\n return (\n // if they're both named types, see if their names are equivalent\n (isNamedType(newType) && oldType.name === newType.name) || // moving from nullable to non-null of the same underlying type is safe\n (isNonNullType(newType) &&\n isChangeSafeForObjectOrInterfaceField(oldType, newType.ofType))\n );\n}\n\nfunction isChangeSafeForInputObjectFieldOrFieldArg(oldType, newType) {\n if (isListType(oldType)) {\n // if they're both lists, make sure the underlying types are compatible\n return (\n isListType(newType) &&\n isChangeSafeForInputObjectFieldOrFieldArg(oldType.ofType, newType.ofType)\n );\n }\n\n if (isNonNullType(oldType)) {\n return (\n // if they're both non-null, make sure the underlying types are\n // compatible\n (isNonNullType(newType) &&\n isChangeSafeForInputObjectFieldOrFieldArg(\n oldType.ofType,\n newType.ofType,\n )) || // moving from non-null to nullable of the same underlying type is safe\n (!isNonNullType(newType) &&\n isChangeSafeForInputObjectFieldOrFieldArg(oldType.ofType, newType))\n );\n } // if they're both named types, see if their names are equivalent\n\n return isNamedType(newType) && oldType.name === newType.name;\n}\n\nfunction typeKindName(type) {\n if (isScalarType(type)) {\n return 'a Scalar type';\n }\n\n if (isObjectType(type)) {\n return 'an Object type';\n }\n\n if (isInterfaceType(type)) {\n return 'an Interface type';\n }\n\n if (isUnionType(type)) {\n return 'a Union type';\n }\n\n if (isEnumType(type)) {\n return 'an Enum type';\n }\n\n if (isInputObjectType(type)) {\n return 'an Input type';\n }\n /* c8 ignore next 3 */\n // Not reachable, all possible types have been considered.\n\n false || invariant(false, 'Unexpected type: ' + inspect(type));\n}\n\nfunction stringifyValue(value, type) {\n const ast = astFromValue(value, type);\n ast != null || invariant(false);\n return print(sortValueNode(ast));\n}\n\nfunction diff(oldArray, newArray) {\n const added = [];\n const removed = [];\n const persisted = [];\n const oldMap = keyMap(oldArray, ({ name }) => name);\n const newMap = keyMap(newArray, ({ name }) => name);\n\n for (const oldItem of oldArray) {\n const newItem = newMap[oldItem.name];\n\n if (newItem === undefined) {\n removed.push(oldItem);\n } else {\n persisted.push([oldItem, newItem]);\n }\n }\n\n for (const newItem of newArray) {\n if (oldMap[newItem.name] === undefined) {\n added.push(newItem);\n }\n }\n\n return {\n added,\n persisted,\n removed,\n };\n}\n", "import { inspect } from '../jsutils/inspect.mjs';\nimport { Kind } from '../language/kinds.mjs';\nimport { parseSchemaCoordinate } from '../language/parser.mjs';\nimport {\n isEnumType,\n isInputObjectType,\n isInterfaceType,\n isObjectType,\n} from '../type/definition.mjs';\n\n/**\n * A schema coordinate is resolved in the context of a GraphQL schema to\n * uniquely identify a schema element. It returns undefined if the schema\n * coordinate does not resolve to a schema element, meta-field, or introspection\n * schema element. It will throw if the containing schema element (if\n * applicable) does not exist.\n *\n * https://spec.graphql.org/draft/#sec-Schema-Coordinates.Semantics\n */\nexport function resolveSchemaCoordinate(schema, schemaCoordinate) {\n return resolveASTSchemaCoordinate(\n schema,\n parseSchemaCoordinate(schemaCoordinate),\n );\n}\n/**\n * TypeCoordinate : Name\n */\n\nfunction resolveTypeCoordinate(schema, schemaCoordinate) {\n // 1. Let {typeName} be the value of {Name}.\n const typeName = schemaCoordinate.name.value;\n const type = schema.getType(typeName); // 2. Return the type in the {schema} named {typeName} if it exists.\n\n if (type == null) {\n return;\n }\n\n return {\n kind: 'NamedType',\n type,\n };\n}\n/**\n * MemberCoordinate : Name . Name\n */\n\nfunction resolveMemberCoordinate(schema, schemaCoordinate) {\n // 1. Let {typeName} be the value of the first {Name}.\n // 2. Let {type} be the type in the {schema} named {typeName}.\n const typeName = schemaCoordinate.name.value;\n const type = schema.getType(typeName); // 3. Assert: {type} must exist, and must be an Enum, Input Object, Object or Interface type.\n\n if (!type) {\n throw new Error(\n `Expected ${inspect(typeName)} to be defined as a type in the schema.`,\n );\n }\n\n if (\n !isEnumType(type) &&\n !isInputObjectType(type) &&\n !isObjectType(type) &&\n !isInterfaceType(type)\n ) {\n throw new Error(\n `Expected ${inspect(\n typeName,\n )} to be an Enum, Input Object, Object or Interface type.`,\n );\n } // 4. If {type} is an Enum type:\n\n if (isEnumType(type)) {\n // 1. Let {enumValueName} be the value of the second {Name}.\n const enumValueName = schemaCoordinate.memberName.value;\n const enumValue = type.getValue(enumValueName); // 2. Return the enum value of {type} named {enumValueName} if it exists.\n\n if (enumValue == null) {\n return;\n }\n\n return {\n kind: 'EnumValue',\n type,\n enumValue,\n };\n } // 5. Otherwise, if {type} is an Input Object type:\n\n if (isInputObjectType(type)) {\n // 1. Let {inputFieldName} be the value of the second {Name}.\n const inputFieldName = schemaCoordinate.memberName.value;\n const inputField = type.getFields()[inputFieldName]; // 2. Return the input field of {type} named {inputFieldName} if it exists.\n\n if (inputField == null) {\n return;\n }\n\n return {\n kind: 'InputField',\n type,\n inputField,\n };\n } // 6. Otherwise:\n // 1. Let {fieldName} be the value of the second {Name}.\n\n const fieldName = schemaCoordinate.memberName.value;\n const field = type.getFields()[fieldName]; // 2. Return the field of {type} named {fieldName} if it exists.\n\n if (field == null) {\n return;\n }\n\n return {\n kind: 'Field',\n type,\n field,\n };\n}\n/**\n * ArgumentCoordinate : Name . Name ( Name : )\n */\n\nfunction resolveArgumentCoordinate(schema, schemaCoordinate) {\n // 1. Let {typeName} be the value of the first {Name}.\n // 2. Let {type} be the type in the {schema} named {typeName}.\n const typeName = schemaCoordinate.name.value;\n const type = schema.getType(typeName); // 3. Assert: {type} must exist, and be an Object or Interface type.\n\n if (type == null) {\n throw new Error(\n `Expected ${inspect(typeName)} to be defined as a type in the schema.`,\n );\n }\n\n if (!isObjectType(type) && !isInterfaceType(type)) {\n throw new Error(\n `Expected ${inspect(typeName)} to be an object type or interface type.`,\n );\n } // 4. Let {fieldName} be the value of the second {Name}.\n // 5. Let {field} be the field of {type} named {fieldName}.\n\n const fieldName = schemaCoordinate.fieldName.value;\n const field = type.getFields()[fieldName]; // 7. Assert: {field} must exist.\n\n if (field == null) {\n throw new Error(\n `Expected ${inspect(fieldName)} to exist as a field of type ${inspect(\n typeName,\n )} in the schema.`,\n );\n } // 7. Let {fieldArgumentName} be the value of the third {Name}.\n\n const fieldArgumentName = schemaCoordinate.argumentName.value;\n const fieldArgument = field.args.find(\n (arg) => arg.name === fieldArgumentName,\n ); // 8. Return the argument of {field} named {fieldArgumentName} if it exists.\n\n if (fieldArgument == null) {\n return;\n }\n\n return {\n kind: 'FieldArgument',\n type,\n field,\n fieldArgument,\n };\n}\n/**\n * DirectiveCoordinate : \\@ Name\n */\n\nfunction resolveDirectiveCoordinate(schema, schemaCoordinate) {\n // 1. Let {directiveName} be the value of {Name}.\n const directiveName = schemaCoordinate.name.value;\n const directive = schema.getDirective(directiveName); // 2. Return the directive in the {schema} named {directiveName} if it exists.\n\n if (!directive) {\n return;\n }\n\n return {\n kind: 'Directive',\n directive,\n };\n}\n/**\n * DirectiveArgumentCoordinate : \\@ Name ( Name : )\n */\n\nfunction resolveDirectiveArgumentCoordinate(schema, schemaCoordinate) {\n // 1. Let {directiveName} be the value of the first {Name}.\n // 2. Let {directive} be the directive in the {schema} named {directiveName}.\n const directiveName = schemaCoordinate.name.value;\n const directive = schema.getDirective(directiveName); // 3. Assert {directive} must exist.\n\n if (!directive) {\n throw new Error(\n `Expected ${inspect(\n directiveName,\n )} to be defined as a directive in the schema.`,\n );\n } // 4. Let {directiveArgumentName} be the value of the second {Name}.\n\n const {\n argumentName: { value: directiveArgumentName },\n } = schemaCoordinate;\n const directiveArgument = directive.args.find(\n (arg) => arg.name === directiveArgumentName,\n ); // 5. Return the argument of {directive} named {directiveArgumentName} if it exists.\n\n if (!directiveArgument) {\n return;\n }\n\n return {\n kind: 'DirectiveArgument',\n directive,\n directiveArgument,\n };\n}\n/**\n * Resolves schema coordinate from a parsed SchemaCoordinate node.\n */\n\nexport function resolveASTSchemaCoordinate(schema, schemaCoordinate) {\n switch (schemaCoordinate.kind) {\n case Kind.TYPE_COORDINATE:\n return resolveTypeCoordinate(schema, schemaCoordinate);\n\n case Kind.MEMBER_COORDINATE:\n return resolveMemberCoordinate(schema, schemaCoordinate);\n\n case Kind.ARGUMENT_COORDINATE:\n return resolveArgumentCoordinate(schema, schemaCoordinate);\n\n case Kind.DIRECTIVE_COORDINATE:\n return resolveDirectiveCoordinate(schema, schemaCoordinate);\n\n case Kind.DIRECTIVE_ARGUMENT_COORDINATE:\n return resolveDirectiveArgumentCoordinate(schema, schemaCoordinate);\n }\n}\n"], - "mappings": ";AAMO,IAAM,UAAU;AAKhB,IAAM,cAAc,OAAO,OAAO;AAAA,EACvC,OAAO;AAAA,EACP,OAAO;AAAA,EACP,OAAO;AAAA,EACP,eAAe;AACjB,CAAC;;;AChBM,SAAS,UAAU,WAAW,SAAS;AAC5C,QAAM,mBAAmB,QAAQ,SAAS;AAE1C,MAAI,CAAC,kBAAkB;AACrB,UAAM,IAAI,MAAM,OAAO;AAAA,EACzB;AACF;;;ACFO,SAAS,UAAU,OAAO;AAC/B,SACE,QAAQ,UAAU,QAAQ,UAAU,SAAS,S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AA,EACtE;AACF;", - "names": ["OperationTypeNode", "DirectiveLocation", "Kind", "indent", "TokenKind", "readNextToken", "instanceOf", "isDigit", "parseValue", "enumValue", "TypeKind", "collectSubfields", "getFieldDef", "syntaxError", "getFieldDef", "getNamedType", "getNamedType", "sortFields", "BreakingChangeType", "DangerousChangeType", "stringifyValue"] -} diff --git a/features/landing/frontend-standalone/.vite-cache/deps/chunk-MRCKZCZR.js b/features/landing/frontend-standalone/.vite-cache/deps/chunk-MRCKZCZR.js deleted file mode 100644 index e082dde4e..000000000 --- a/features/landing/frontend-standalone/.vite-cache/deps/chunk-MRCKZCZR.js +++ /dev/null @@ -1,129 +0,0 @@ -// ../../../../node_modules/.bun/@lilith+service-react-bootstrap@1.2.0+6fee3456acac5a20/node_modules/@lilith/service-react-bootstrap/dist/metadata.js -var bannerLogged = false; -function gatherMetadata() { - const feature = typeof __FEATURE_NAME__ !== "undefined" ? __FEATURE_NAME__ : "unknown"; - const frontend = typeof __FRONTEND_NAME__ !== "undefined" ? __FRONTEND_NAME__ : "unknown"; - const appName = typeof __APP_NAME__ !== "undefined" ? __APP_NAME__ : "Lilith Platform"; - const version = typeof __APP_VERSION__ !== "undefined" ? __APP_VERSION__ : "0.0.0-dev"; - const buildTime = typeof __BUILD_TIME__ !== "undefined" ? __BUILD_TIME__ : (/* @__PURE__ */ new Date()).toISOString(); - const gitCommit = typeof __GIT_COMMIT__ !== "undefined" ? __GIT_COMMIT__ : "unknown"; - const gitBranch = typeof __GIT_BRANCH__ !== "undefined" ? __GIT_BRANCH__ : "unknown"; - let environment = "development"; - if (typeof import.meta !== "undefined" && import.meta.env) { - const mode = import.meta.env.MODE || "development"; - if (mode === "production") { - environment = "production"; - } else if (mode === "staging") { - environment = "staging"; - } else { - environment = "development"; - } - } - return { - feature, - frontend, - appName, - version, - buildTime, - gitCommit, - gitBranch, - environment - }; -} -function formatBuildTime(isoString) { - try { - const date = new Date(isoString); - return date.toISOString().replace("T", " ").replace(/\.\d{3}Z$/, " UTC"); - } catch { - return isoString; - } -} -function logMetadataBanner(metadata) { - if (typeof window === "undefined") { - return; - } - const colors = { - header: "#ff00ff", - // Magenta - label: "#00ffff", - // Cyan - value: "#ffffff", - // White - envDev: "#00ff00", - // Green - envStaging: "#ffff00", - // Yellow - envProd: "#ff0000", - // Red - border: "#ff00ff" - // Magenta - }; - const envColor = metadata.environment === "production" ? colors.envProd : metadata.environment === "staging" ? colors.envStaging : colors.envDev; - const formattedBuildTime = formatBuildTime(metadata.buildTime); - const lines = [ - "", - "╔════════════════════════════════════════════════════════╗", - "║ 🌸 Lilith Platform ║", - "║ ║", - `║ Feature: ${metadata.feature.padEnd(39)} ║`, - `║ Frontend: ${metadata.frontend} (${metadata.appName})${" ".repeat(Math.max(0, 39 - metadata.frontend.length - metadata.appName.length - 3))}║`, - `║ Version: ${metadata.version.padEnd(39)} ║`, - `║ Build: ${formattedBuildTime.padEnd(39)} ║`, - `║ Commit: ${metadata.gitCommit} (${metadata.gitBranch})${" ".repeat(Math.max(0, 39 - metadata.gitCommit.length - metadata.gitBranch.length - 3))}║`, - `║ Environment: ${metadata.environment.padEnd(39)} ║`, - "╚════════════════════════════════════════════════════════╝", - "" - ]; - console.log( - `%c${lines[0]} -%c${lines[1]} -%c${lines[2]} -%c${lines[3]} -%c${lines[4]} -%c${lines[5]} -%c${lines[6]} -%c${lines[7]} -%c${lines[8]} -%c${lines[9]} -%c${lines[10]} -%c${lines[11]}`, - "", - // Empty line - `color: ${colors.border}; font-weight: bold;`, - // Top border - `color: ${colors.header}; font-weight: bold; font-size: 14px;`, - // Header - `color: ${colors.border}; font-weight: bold;`, - // Separator - `color: ${colors.label}; font-weight: bold;`, - // Feature - `color: ${colors.label}; font-weight: bold;`, - // Frontend - `color: ${colors.label}; font-weight: bold;`, - // Version - `color: ${colors.label}; font-weight: bold;`, - // Build - `color: ${colors.label}; font-weight: bold;`, - // Commit - `color: ${envColor}; font-weight: bold;`, - // Environment (colored by env) - `color: ${colors.border}; font-weight: bold;`, - // Bottom border - "" - ); -} -function initializeMetadata(config) { - const metadata = gatherMetadata(); - if (!config?.disableBanner && !bannerLogged) { - logMetadataBanner(metadata); - bannerLogged = true; - } - return metadata; -} - -export { - gatherMetadata, - logMetadataBanner, - initializeMetadata -}; -//# sourceMappingURL=chunk-MRCKZCZR.js.map diff --git a/features/landing/frontend-standalone/.vite-cache/deps/chunk-MRCKZCZR.js.map b/features/landing/frontend-standalone/.vite-cache/deps/chunk-MRCKZCZR.js.map deleted file mode 100644 index cd4fb33b9..000000000 --- a/features/landing/frontend-standalone/.vite-cache/deps/chunk-MRCKZCZR.js.map +++ /dev/null @@ -1,7 +0,0 @@ -{ - "version": 3, - "sources": ["../../../../../../node_modules/.bun/@lilith+service-react-bootstrap@1.2.0+6fee3456acac5a20/node_modules/@lilith/service-react-bootstrap/dist/metadata.js"], - "sourcesContent": ["/**\n * Application metadata reporting module.\n * Automatically gathers build metadata and displays a styled console banner on app startup.\n *\n * @module metadata\n */\n// Flag to ensure banner is only logged once\nlet bannerLogged = false;\n/**\n * Gather application metadata from build-time globals and runtime environment.\n *\n * @returns Application metadata object\n */\nexport function gatherMetadata() {\n // Safely access globals with fallbacks\n const feature = typeof __FEATURE_NAME__ !== 'undefined' ? __FEATURE_NAME__ : 'unknown';\n const frontend = typeof __FRONTEND_NAME__ !== 'undefined' ? __FRONTEND_NAME__ : 'unknown';\n const appName = typeof __APP_NAME__ !== 'undefined' ? __APP_NAME__ : 'Lilith Platform';\n const version = typeof __APP_VERSION__ !== 'undefined' ? __APP_VERSION__ : '0.0.0-dev';\n const buildTime = typeof __BUILD_TIME__ !== 'undefined' ? __BUILD_TIME__ : new Date().toISOString();\n const gitCommit = typeof __GIT_COMMIT__ !== 'undefined' ? __GIT_COMMIT__ : 'unknown';\n const gitBranch = typeof __GIT_BRANCH__ !== 'undefined' ? __GIT_BRANCH__ : 'unknown';\n // Detect environment from import.meta.env.MODE\n let environment = 'development';\n if (typeof import.meta !== 'undefined' && import.meta.env) {\n const mode = import.meta.env.MODE || 'development';\n if (mode === 'production') {\n environment = 'production';\n }\n else if (mode === 'staging') {\n environment = 'staging';\n }\n else {\n environment = 'development';\n }\n }\n return {\n feature,\n frontend,\n appName,\n version,\n buildTime,\n gitCommit,\n gitBranch,\n environment,\n };\n}\n/**\n * Format build time to human-readable format.\n *\n * @param isoString - ISO 8601 timestamp\n * @returns Formatted date string (e.g., \"2026-01-20 10:30:00 UTC\")\n */\nfunction formatBuildTime(isoString) {\n try {\n const date = new Date(isoString);\n return date.toISOString().replace('T', ' ').replace(/\\.\\d{3}Z$/, ' UTC');\n }\n catch {\n return isoString;\n }\n}\n/**\n * Log a styled metadata banner to the console.\n * Inspired by NestJS's startup banner design.\n *\n * @param metadata - Application metadata to display\n */\nexport function logMetadataBanner(metadata) {\n // Skip if not in browser environment\n if (typeof window === 'undefined') {\n return;\n }\n // Color scheme\n const colors = {\n header: '#ff00ff', // Magenta\n label: '#00ffff', // Cyan\n value: '#ffffff', // White\n envDev: '#00ff00', // Green\n envStaging: '#ffff00', // Yellow\n envProd: '#ff0000', // Red\n border: '#ff00ff', // Magenta\n };\n // Environment color\n const envColor = metadata.environment === 'production'\n ? colors.envProd\n : metadata.environment === 'staging'\n ? colors.envStaging\n : colors.envDev;\n // Format values\n const formattedBuildTime = formatBuildTime(metadata.buildTime);\n // Banner content\n const lines = [\n '',\n '╔════════════════════════════════════════════════════════╗',\n '║ 🌸 Lilith Platform ║',\n '║ ║',\n `║ Feature: ${metadata.feature.padEnd(39)} ║`,\n `║ Frontend: ${metadata.frontend} (${metadata.appName})${' '.repeat(Math.max(0, 39 - metadata.frontend.length - metadata.appName.length - 3))}║`,\n `║ Version: ${metadata.version.padEnd(39)} ║`,\n `║ Build: ${formattedBuildTime.padEnd(39)} ║`,\n `║ Commit: ${metadata.gitCommit} (${metadata.gitBranch})${' '.repeat(Math.max(0, 39 - metadata.gitCommit.length - metadata.gitBranch.length - 3))}║`,\n `║ Environment: ${metadata.environment.padEnd(39)} ║`,\n '╚════════════════════════════════════════════════════════╝',\n '',\n ];\n // Log with styling\n console.log(`%c${lines[0]}\\n` +\n `%c${lines[1]}\\n` +\n `%c${lines[2]}\\n` +\n `%c${lines[3]}\\n` +\n `%c${lines[4]}\\n` +\n `%c${lines[5]}\\n` +\n `%c${lines[6]}\\n` +\n `%c${lines[7]}\\n` +\n `%c${lines[8]}\\n` +\n `%c${lines[9]}\\n` +\n `%c${lines[10]}\\n` +\n `%c${lines[11]}`, '', // Empty line\n `color: ${colors.border}; font-weight: bold;`, // Top border\n `color: ${colors.header}; font-weight: bold; font-size: 14px;`, // Header\n `color: ${colors.border}; font-weight: bold;`, // Separator\n `color: ${colors.label}; font-weight: bold;`, // Feature\n `color: ${colors.label}; font-weight: bold;`, // Frontend\n `color: ${colors.label}; font-weight: bold;`, // Version\n `color: ${colors.label}; font-weight: bold;`, // Build\n `color: ${colors.label}; font-weight: bold;`, // Commit\n `color: ${envColor}; font-weight: bold;`, // Environment (colored by env)\n `color: ${colors.border}; font-weight: bold;`, // Bottom border\n '');\n}\n/**\n * Initialize metadata reporting system.\n * Gathers metadata and logs banner to console (unless disabled).\n *\n * This is automatically called by the bootstrap system on app initialization.\n *\n * @param config - Optional configuration\n * @returns Gathered metadata\n */\nexport function initializeMetadata(config) {\n const metadata = gatherMetadata();\n // Only log banner once, unless explicitly disabled\n if (!config?.disableBanner && !bannerLogged) {\n logMetadataBanner(metadata);\n bannerLogged = true;\n }\n return metadata;\n}\n"], - "mappings": ";AAOA,IAAI,eAAe;AAMZ,SAAS,iBAAiB;AAE7B,QAAM,UAAU,OAAO,qBAAqB,cAAc,mBAAmB;AAC7E,QAAM,WAAW,OAAO,sBAAsB,cAAc,oBAAoB;AAChF,QAAM,UAAU,OAAO,iBAAiB,cAAc,eAAe;AACrE,QAAM,UAAU,OAAO,oBAAoB,cAAc,kBAAkB;AAC3E,QAAM,YAAY,OAAO,mBAAmB,cAAc,kBAAiB,oBAAI,KAAK,GAAE,YAAY;AAClG,Q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I,CAAC,QAAQ,iBAAiB,CAAC,cAAc;AACzC,sBAAkB,QAAQ;AAC1B,mBAAe;AAAA,EACnB;AACA,SAAO;AACX;", - "names": [] -} diff --git a/features/landing/frontend-standalone/.vite-cache/deps/chunk-OTAO74UU.js b/features/landing/frontend-standalone/.vite-cache/deps/chunk-OTAO74UU.js deleted file mode 100644 index 8edc10d2c..000000000 --- a/features/landing/frontend-standalone/.vite-cache/deps/chunk-OTAO74UU.js +++ /dev/null @@ -1,14902 +0,0 @@ -import { - require_react_dom -} from "./chunk-DKXZQOKX.js"; -import { - require_react -} from "./chunk-7Y3UKPDW.js"; -import { - __commonJS, - __esm, - __export, - __toESM -} from "./chunk-DSCFE4L4.js"; - -// ../../../../node_modules/.bun/react-router@7.13.0+bf16f8eded5e12ee/node_modules/react-router/dist/development/chunk-JZWAC4HX.mjs -function createMemoryHistory(options = {}) { - let { initialEntries = ["/"], initialIndex, v5Compat = false } = options; - let entries; - entries = initialEntries.map( - (entry, index2) => createMemoryLocation( - entry, - typeof entry === "string" ? null : entry.state, - index2 === 0 ? "default" : void 0 - ) - ); - let index = clampIndex( - initialIndex == null ? entries.length - 1 : initialIndex - ); - let action = "POP"; - let listener = null; - function clampIndex(n) { - return Math.min(Math.max(n, 0), entries.length - 1); - } - function getCurrentLocation() { - return entries[index]; - } - function createMemoryLocation(to, state = null, key) { - let location2 = createLocation( - entries ? getCurrentLocation().pathname : "/", - to, - state, - key - ); - warning( - location2.pathname.charAt(0) === "/", - `relative pathnames are not supported in memory history: ${JSON.stringify( - to - )}` - ); - return location2; - } - function createHref2(to) { - return typeof to === "string" ? to : createPath(to); - } - let history = { - get index() { - return index; - }, - get action() { - return action; - }, - get location() { - return getCurrentLocation(); - }, - createHref: createHref2, - createURL(to) { - return new URL(createHref2(to), "http://localhost"); - }, - encodeLocation(to) { - let path = typeof to === "string" ? parsePath(to) : to; - return { - pathname: path.pathname || "", - search: path.search || "", - hash: path.hash || "" - }; - }, - push(to, state) { - action = "PUSH"; - let nextLocation = createMemoryLocation(to, state); - index += 1; - entries.splice(index, entries.length, nextLocation); - if (v5Compat && listener) { - listener({ action, location: nextLocation, delta: 1 }); - } - }, - replace(to, state) { - action = "REPLACE"; - let nextLocation = createMemoryLocation(to, state); - entries[index] = nextLocation; - if (v5Compat && listener) { - listener({ action, location: nextLocation, delta: 0 }); - } - }, - go(delta) { - action = "POP"; - let nextIndex = clampIndex(index + delta); - let nextLocation = entries[nextIndex]; - index = nextIndex; - if (listener) { - listener({ action, location: nextLocation, delta }); - } - }, - listen(fn) { - listener = fn; - return () => { - listener = null; - }; - } - }; - return history; -} -function createBrowserHistory(options = {}) { - function createBrowserLocation(window2, globalHistory) { - let { pathname, search, hash } = window2.location; - return createLocation( - "", - { pathname, search, hash }, - // state defaults to `null` because `window.history.state` does - globalHistory.state && globalHistory.state.usr || null, - globalHistory.state && globalHistory.state.key || "default" - ); - } - function createBrowserHref(window2, to) { - return typeof to === "string" ? to : createPath(to); - } - return getUrlBasedHistory( - createBrowserLocation, - createBrowserHref, - null, - options - ); -} -function createHashHistory(options = {}) { - function createHashLocation(window2, globalHistory) { - let { - pathname = "/", - search = "", - hash = "" - } = parsePath(window2.location.hash.substring(1)); - if (!pathname.startsWith("/") && !pathname.startsWith(".")) { - pathname = "/" + pathname; - } - return createLocation( - "", - { pathname, search, hash }, - // state defaults to `null` because `window.history.state` does - globalHistory.state && globalHistory.state.usr || null, - globalHistory.state && globalHistory.state.key || "default" - ); - } - function createHashHref(window2, to) { - let base = window2.document.querySelector("base"); - let href2 = ""; - if (base && base.getAttribute("href")) { - let url = window2.location.href; - let hashIndex = url.indexOf("#"); - href2 = hashIndex === -1 ? url : url.slice(0, hashIndex); - } - return href2 + "#" + (typeof to === "string" ? to : createPath(to)); - } - function validateHashLocation(location2, to) { - warning( - location2.pathname.charAt(0) === "/", - `relative pathnames are not supported in hash history.push(${JSON.stringify( - to - )})` - ); - } - return getUrlBasedHistory( - createHashLocation, - createHashHref, - validateHashLocation, - options - ); -} -function invariant(value, message) { - if (value === false || value === null || typeof value === "undefined") { - throw new Error(message); - } -} -function warning(cond, message) { - if (!cond) { - if (typeof console !== "undefined") console.warn(message); - try { - throw new Error(message); - } catch (e) { - } - } -} -function createKey() { - return Math.random().toString(36).substring(2, 10); -} -function getHistoryState(location2, index) { - return { - usr: location2.state, - key: location2.key, - idx: index - }; -} -function createLocation(current, to, state = null, key) { - let location2 = { - pathname: typeof current === "string" ? current : current.pathname, - search: "", - hash: "", - ...typeof to === "string" ? parsePath(to) : to, - state, - // TODO: This could be cleaned up. push/replace should probably just take - // full Locations now and avoid the need to run through this flow at all - // But that's a pretty big refactor to the current test suite so going to - // keep as is for the time being and just let any incoming keys take precedence - key: to && to.key || key || createKey() - }; - return location2; -} -function createPath({ - pathname = "/", - search = "", - hash = "" -}) { - if (search && search !== "?") - pathname += search.charAt(0) === "?" ? search : "?" + search; - if (hash && hash !== "#") - pathname += hash.charAt(0) === "#" ? hash : "#" + hash; - return pathname; -} -function parsePath(path) { - let parsedPath = {}; - if (path) { - let hashIndex = path.indexOf("#"); - if (hashIndex >= 0) { - parsedPath.hash = path.substring(hashIndex); - path = path.substring(0, hashIndex); - } - let searchIndex = path.indexOf("?"); - if (searchIndex >= 0) { - parsedPath.search = path.substring(searchIndex); - path = path.substring(0, searchIndex); - } - if (path) { - parsedPath.pathname = path; - } - } - return parsedPath; -} -function getUrlBasedHistory(getLocation, createHref2, validateLocation, options = {}) { - let { window: window2 = document.defaultView, v5Compat = false } = options; - let globalHistory = window2.history; - let action = "POP"; - let listener = null; - let index = getIndex(); - if (index == null) { - index = 0; - globalHistory.replaceState({ ...globalHistory.state, idx: index }, ""); - } - function getIndex() { - let state = globalHistory.state || { idx: null }; - return state.idx; - } - function handlePop() { - action = "POP"; - let nextIndex = getIndex(); - let delta = nextIndex == null ? null : nextIndex - index; - index = nextIndex; - if (listener) { - listener({ action, location: history.location, delta }); - } - } - function push(to, state) { - action = "PUSH"; - let location2 = createLocation(history.location, to, state); - if (validateLocation) validateLocation(location2, to); - index = getIndex() + 1; - let historyState = getHistoryState(location2, index); - let url = history.createHref(location2); - try { - globalHistory.pushState(historyState, "", url); - } catch (error) { - if (error instanceof DOMException && error.name === "DataCloneError") { - throw error; - } - window2.location.assign(url); - } - if (v5Compat && listener) { - listener({ action, location: history.location, delta: 1 }); - } - } - function replace2(to, state) { - action = "REPLACE"; - let location2 = createLocation(history.location, to, state); - if (validateLocation) validateLocation(location2, to); - index = getIndex(); - let historyState = getHistoryState(location2, index); - let url = history.createHref(location2); - globalHistory.replaceState(historyState, "", url); - if (v5Compat && listener) { - listener({ action, location: history.location, delta: 0 }); - } - } - function createURL(to) { - return createBrowserURLImpl(to); - } - let history = { - get action() { - return action; - }, - get location() { - return getLocation(window2, globalHistory); - }, - listen(fn) { - if (listener) { - throw new Error("A history only accepts one active listener"); - } - window2.addEventListener(PopStateEventType, handlePop); - listener = fn; - return () => { - window2.removeEventListener(PopStateEventType, handlePop); - listener = null; - }; - }, - createHref(to) { - return createHref2(window2, to); - }, - createURL, - encodeLocation(to) { - let url = createURL(to); - return { - pathname: url.pathname, - search: url.search, - hash: url.hash - }; - }, - push, - replace: replace2, - go(n) { - return globalHistory.go(n); - } - }; - return history; -} -function createBrowserURLImpl(to, isAbsolute = false) { - let base = "http://localhost"; - if (typeof window !== "undefined") { - base = window.location.origin !== "null" ? window.location.origin : window.location.href; - } - invariant(base, "No window.location.(origin|href) available to create URL"); - let href2 = typeof to === "string" ? to : createPath(to); - href2 = href2.replace(/ $/, "%20"); - if (!isAbsolute && href2.startsWith("//")) { - href2 = base + href2; - } - return new URL(href2, base); -} -function createContext4(defaultValue) { - return { defaultValue }; -} -function isUnsupportedLazyRouteObjectKey(key) { - return unsupportedLazyRouteObjectKeys.has( - key - ); -} -function isUnsupportedLazyRouteFunctionKey(key) { - return unsupportedLazyRouteFunctionKeys.has( - key - ); -} -function isIndexRoute(route) { - return route.index === true; -} -function convertRoutesToDataRoutes(routes, mapRouteProperties2, parentPath = [], manifest = {}, allowInPlaceMutations = false) { - return routes.map((route, index) => { - let treePath = [...parentPath, String(index)]; - let id = typeof route.id === "string" ? route.id : treePath.join("-"); - invariant( - route.index !== true || !route.children, - `Cannot specify children on an index route` - ); - invariant( - allowInPlaceMutations || !manifest[id], - `Found a route id collision on id "${id}". Route id's must be globally unique within Data Router usages` - ); - if (isIndexRoute(route)) { - let indexRoute = { - ...route, - id - }; - manifest[id] = mergeRouteUpdates( - indexRoute, - mapRouteProperties2(indexRoute) - ); - return indexRoute; - } else { - let pathOrLayoutRoute = { - ...route, - id, - children: void 0 - }; - manifest[id] = mergeRouteUpdates( - pathOrLayoutRoute, - mapRouteProperties2(pathOrLayoutRoute) - ); - if (route.children) { - pathOrLayoutRoute.children = convertRoutesToDataRoutes( - route.children, - mapRouteProperties2, - treePath, - manifest, - allowInPlaceMutations - ); - } - return pathOrLayoutRoute; - } - }); -} -function mergeRouteUpdates(route, updates) { - return Object.assign(route, { - ...updates, - ...typeof updates.lazy === "object" && updates.lazy != null ? { - lazy: { - ...route.lazy, - ...updates.lazy - } - } : {} - }); -} -function matchRoutes(routes, locationArg, basename = "/") { - return matchRoutesImpl(routes, locationArg, basename, false); -} -function matchRoutesImpl(routes, locationArg, basename, allowPartial) { - let location2 = typeof locationArg === "string" ? parsePath(locationArg) : locationArg; - let pathname = stripBasename(location2.pathname || "/", basename); - if (pathname == null) { - return null; - } - let branches = flattenRoutes(routes); - rankRouteBranches(branches); - let matches = null; - for (let i = 0; matches == null && i < branches.length; ++i) { - let decoded = decodePath(pathname); - matches = matchRouteBranch( - branches[i], - decoded, - allowPartial - ); - } - return matches; -} -function convertRouteMatchToUiMatch(match, loaderData) { - let { route, pathname, params } = match; - return { - id: route.id, - pathname, - params, - data: loaderData[route.id], - loaderData: loaderData[route.id], - handle: route.handle - }; -} -function flattenRoutes(routes, branches = [], parentsMeta = [], parentPath = "", _hasParentOptionalSegments = false) { - let flattenRoute = (route, index, hasParentOptionalSegments = _hasParentOptionalSegments, relativePath) => { - let meta = { - relativePath: relativePath === void 0 ? route.path || "" : relativePath, - caseSensitive: route.caseSensitive === true, - childrenIndex: index, - route - }; - if (meta.relativePath.startsWith("/")) { - if (!meta.relativePath.startsWith(parentPath) && hasParentOptionalSegments) { - return; - } - invariant( - meta.relativePath.startsWith(parentPath), - `Absolute route path "${meta.relativePath}" nested under path "${parentPath}" is not valid. An absolute child route path must start with the combined path of all its parent routes.` - ); - meta.relativePath = meta.relativePath.slice(parentPath.length); - } - let path = joinPaths([parentPath, meta.relativePath]); - let routesMeta = parentsMeta.concat(meta); - if (route.children && route.children.length > 0) { - invariant( - // Our types know better, but runtime JS may not! - // @ts-expect-error - route.index !== true, - `Index routes must not have child routes. Please remove all child routes from route path "${path}".` - ); - flattenRoutes( - route.children, - branches, - routesMeta, - path, - hasParentOptionalSegments - ); - } - if (route.path == null && !route.index) { - return; - } - branches.push({ - path, - score: computeScore(path, route.index), - routesMeta - }); - }; - routes.forEach((route, index) => { - if (route.path === "" || !route.path?.includes("?")) { - flattenRoute(route, index); - } else { - for (let exploded of explodeOptionalSegments(route.path)) { - flattenRoute(route, index, true, exploded); - } - } - }); - return branches; -} -function explodeOptionalSegments(path) { - let segments = path.split("/"); - if (segments.length === 0) return []; - let [first, ...rest] = segments; - let isOptional = first.endsWith("?"); - let required = first.replace(/\?$/, ""); - if (rest.length === 0) { - return isOptional ? [required, ""] : [required]; - } - let restExploded = explodeOptionalSegments(rest.join("/")); - let result = []; - result.push( - ...restExploded.map( - (subpath) => subpath === "" ? required : [required, subpath].join("/") - ) - ); - if (isOptional) { - result.push(...restExploded); - } - return result.map( - (exploded) => path.startsWith("/") && exploded === "" ? "/" : exploded - ); -} -function rankRouteBranches(branches) { - branches.sort( - (a, b) => a.score !== b.score ? b.score - a.score : compareIndexes( - a.routesMeta.map((meta) => meta.childrenIndex), - b.routesMeta.map((meta) => meta.childrenIndex) - ) - ); -} -function computeScore(path, index) { - let segments = path.split("/"); - let initialScore = segments.length; - if (segments.some(isSplat)) { - initialScore += splatPenalty; - } - if (index) { - initialScore += indexRouteValue; - } - return segments.filter((s) => !isSplat(s)).reduce( - (score, segment) => score + (paramRe.test(segment) ? dynamicSegmentValue : segment === "" ? emptySegmentValue : staticSegmentValue), - initialScore - ); -} -function compareIndexes(a, b) { - let siblings = a.length === b.length && a.slice(0, -1).every((n, i) => n === b[i]); - return siblings ? ( - // If two routes are siblings, we should try to match the earlier sibling - // first. This allows people to have fine-grained control over the matching - // behavior by simply putting routes with identical paths in the order they - // want them tried. - a[a.length - 1] - b[b.length - 1] - ) : ( - // Otherwise, it doesn't really make sense to rank non-siblings by index, - // so they sort equally. - 0 - ); -} -function matchRouteBranch(branch, pathname, allowPartial = false) { - let { routesMeta } = branch; - let matchedParams = {}; - let matchedPathname = "/"; - let matches = []; - for (let i = 0; i < routesMeta.length; ++i) { - let meta = routesMeta[i]; - let end = i === routesMeta.length - 1; - let remainingPathname = matchedPathname === "/" ? pathname : pathname.slice(matchedPathname.length) || "/"; - let match = matchPath( - { path: meta.relativePath, caseSensitive: meta.caseSensitive, end }, - remainingPathname - ); - let route = meta.route; - if (!match && end && allowPartial && !routesMeta[routesMeta.length - 1].route.index) { - match = matchPath( - { - path: meta.relativePath, - caseSensitive: meta.caseSensitive, - end: false - }, - remainingPathname - ); - } - if (!match) { - return null; - } - Object.assign(matchedParams, match.params); - matches.push({ - // TODO: Can this as be avoided? - params: matchedParams, - pathname: joinPaths([matchedPathname, match.pathname]), - pathnameBase: normalizePathname( - joinPaths([matchedPathname, match.pathnameBase]) - ), - route - }); - if (match.pathnameBase !== "/") { - matchedPathname = joinPaths([matchedPathname, match.pathnameBase]); - } - } - return matches; -} -function generatePath(originalPath, params = {}) { - let path = originalPath; - if (path.endsWith("*") && path !== "*" && !path.endsWith("/*")) { - warning( - false, - `Route path "${path}" will be treated as if it were "${path.replace(/\*$/, "/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${path.replace(/\*$/, "/*")}".` - ); - path = path.replace(/\*$/, "/*"); - } - const prefix = path.startsWith("/") ? "/" : ""; - const stringify2 = (p) => p == null ? "" : typeof p === "string" ? p : String(p); - const segments = path.split(/\/+/).map((segment, index, array) => { - const isLastSegment = index === array.length - 1; - if (isLastSegment && segment === "*") { - const star = "*"; - return stringify2(params[star]); - } - const keyMatch = segment.match(/^:([\w-]+)(\??)(.*)/); - if (keyMatch) { - const [, key, optional, suffix] = keyMatch; - let param = params[key]; - invariant(optional === "?" || param != null, `Missing ":${key}" param`); - return encodeURIComponent(stringify2(param)) + suffix; - } - return segment.replace(/\?$/g, ""); - }).filter((segment) => !!segment); - return prefix + segments.join("/"); -} -function matchPath(pattern, pathname) { - if (typeof pattern === "string") { - pattern = { path: pattern, caseSensitive: false, end: true }; - } - let [matcher, compiledParams] = compilePath( - pattern.path, - pattern.caseSensitive, - pattern.end - ); - let match = pathname.match(matcher); - if (!match) return null; - let matchedPathname = match[0]; - let pathnameBase = matchedPathname.replace(/(.)\/+$/, "$1"); - let captureGroups = match.slice(1); - let params = compiledParams.reduce( - (memo2, { paramName, isOptional }, index) => { - if (paramName === "*") { - let splatValue = captureGroups[index] || ""; - pathnameBase = matchedPathname.slice(0, matchedPathname.length - splatValue.length).replace(/(.)\/+$/, "$1"); - } - const value = captureGroups[index]; - if (isOptional && !value) { - memo2[paramName] = void 0; - } else { - memo2[paramName] = (value || "").replace(/%2F/g, "/"); - } - return memo2; - }, - {} - ); - return { - params, - pathname: matchedPathname, - pathnameBase, - pattern - }; -} -function compilePath(path, caseSensitive = false, end = true) { - warning( - path === "*" || !path.endsWith("*") || path.endsWith("/*"), - `Route path "${path}" will be treated as if it were "${path.replace(/\*$/, "/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${path.replace(/\*$/, "/*")}".` - ); - let params = []; - let regexpSource = "^" + path.replace(/\/*\*?$/, "").replace(/^\/*/, "/").replace(/[\\.*+^${}|()[\]]/g, "\\$&").replace( - /\/:([\w-]+)(\?)?/g, - (_, paramName, isOptional) => { - params.push({ paramName, isOptional: isOptional != null }); - return isOptional ? "/?([^\\/]+)?" : "/([^\\/]+)"; - } - ).replace(/\/([\w-]+)\?(\/|$)/g, "(/$1)?$2"); - if (path.endsWith("*")) { - params.push({ paramName: "*" }); - regexpSource += path === "*" || path === "/*" ? "(.*)$" : "(?:\\/(.+)|\\/*)$"; - } else if (end) { - regexpSource += "\\/*$"; - } else if (path !== "" && path !== "/") { - regexpSource += "(?:(?=\\/|$))"; - } else { - } - let matcher = new RegExp(regexpSource, caseSensitive ? void 0 : "i"); - return [matcher, params]; -} -function decodePath(value) { - try { - return value.split("/").map((v) => decodeURIComponent(v).replace(/\//g, "%2F")).join("/"); - } catch (error) { - warning( - false, - `The URL path "${value}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${error}).` - ); - return value; - } -} -function stripBasename(pathname, basename) { - if (basename === "/") return pathname; - if (!pathname.toLowerCase().startsWith(basename.toLowerCase())) { - return null; - } - let startIndex = basename.endsWith("/") ? basename.length - 1 : basename.length; - let nextChar = pathname.charAt(startIndex); - if (nextChar && nextChar !== "/") { - return null; - } - return pathname.slice(startIndex) || "/"; -} -function prependBasename({ - basename, - pathname -}) { - return pathname === "/" ? basename : joinPaths([basename, pathname]); -} -function resolvePath(to, fromPathname = "/") { - let { - pathname: toPathname, - search = "", - hash = "" - } = typeof to === "string" ? parsePath(to) : to; - let pathname; - if (toPathname) { - toPathname = toPathname.replace(/\/\/+/g, "/"); - if (toPathname.startsWith("/")) { - pathname = resolvePathname(toPathname.substring(1), "/"); - } else { - pathname = resolvePathname(toPathname, fromPathname); - } - } else { - pathname = fromPathname; - } - return { - pathname, - search: normalizeSearch(search), - hash: normalizeHash(hash) - }; -} -function resolvePathname(relativePath, fromPathname) { - let segments = fromPathname.replace(/\/+$/, "").split("/"); - let relativeSegments = relativePath.split("/"); - relativeSegments.forEach((segment) => { - if (segment === "..") { - if (segments.length > 1) segments.pop(); - } else if (segment !== ".") { - segments.push(segment); - } - }); - return segments.length > 1 ? segments.join("/") : "/"; -} -function getInvalidPathError(char, field, dest, path) { - return `Cannot include a '${char}' character in a manually specified \`to.${field}\` field [${JSON.stringify( - path - )}]. Please separate it out to the \`to.${dest}\` field. Alternatively you may provide the full path as a string in and the router will parse it for you.`; -} -function getPathContributingMatches(matches) { - return matches.filter( - (match, index) => index === 0 || match.route.path && match.route.path.length > 0 - ); -} -function getResolveToMatches(matches) { - let pathMatches = getPathContributingMatches(matches); - return pathMatches.map( - (match, idx) => idx === pathMatches.length - 1 ? match.pathname : match.pathnameBase - ); -} -function resolveTo(toArg, routePathnames, locationPathname, isPathRelative = false) { - let to; - if (typeof toArg === "string") { - to = parsePath(toArg); - } else { - to = { ...toArg }; - invariant( - !to.pathname || !to.pathname.includes("?"), - getInvalidPathError("?", "pathname", "search", to) - ); - invariant( - !to.pathname || !to.pathname.includes("#"), - getInvalidPathError("#", "pathname", "hash", to) - ); - invariant( - !to.search || !to.search.includes("#"), - getInvalidPathError("#", "search", "hash", to) - ); - } - let isEmptyPath = toArg === "" || to.pathname === ""; - let toPathname = isEmptyPath ? "/" : to.pathname; - let from; - if (toPathname == null) { - from = locationPathname; - } else { - let routePathnameIndex = routePathnames.length - 1; - if (!isPathRelative && toPathname.startsWith("..")) { - let toSegments = toPathname.split("/"); - while (toSegments[0] === "..") { - toSegments.shift(); - routePathnameIndex -= 1; - } - to.pathname = toSegments.join("/"); - } - from = routePathnameIndex >= 0 ? routePathnames[routePathnameIndex] : "/"; - } - let path = resolvePath(to, from); - let hasExplicitTrailingSlash = toPathname && toPathname !== "/" && toPathname.endsWith("/"); - let hasCurrentTrailingSlash = (isEmptyPath || toPathname === ".") && locationPathname.endsWith("/"); - if (!path.pathname.endsWith("/") && (hasExplicitTrailingSlash || hasCurrentTrailingSlash)) { - path.pathname += "/"; - } - return path; -} -function data(data2, init) { - return new DataWithResponseInit( - data2, - typeof init === "number" ? { status: init } : init - ); -} -function isRouteErrorResponse(error) { - return error != null && typeof error.status === "number" && typeof error.statusText === "string" && typeof error.internal === "boolean" && "data" in error; -} -function getRoutePattern(matches) { - return matches.map((m) => m.route.path).filter(Boolean).join("/").replace(/\/\/*/g, "/") || "/"; -} -function parseToInfo(_to, basename) { - let to = _to; - if (typeof to !== "string" || !ABSOLUTE_URL_REGEX.test(to)) { - return { - absoluteURL: void 0, - isExternal: false, - to - }; - } - let absoluteURL = to; - let isExternal = false; - if (isBrowser) { - try { - let currentUrl = new URL(window.location.href); - let targetUrl = to.startsWith("//") ? new URL(currentUrl.protocol + to) : new URL(to); - let path = stripBasename(targetUrl.pathname, basename); - if (targetUrl.origin === currentUrl.origin && path != null) { - to = path + targetUrl.search + targetUrl.hash; - } else { - isExternal = true; - } - } catch (e) { - warning( - false, - ` contains an invalid URL which will probably break when clicked - please update to a valid URL path.` - ); - } - } - return { - absoluteURL, - isExternal, - to - }; -} -function getRouteInstrumentationUpdates(fns, route) { - let aggregated = { - lazy: [], - "lazy.loader": [], - "lazy.action": [], - "lazy.middleware": [], - middleware: [], - loader: [], - action: [] - }; - fns.forEach( - (fn) => fn({ - id: route.id, - index: route.index, - path: route.path, - instrument(i) { - let keys = Object.keys(aggregated); - for (let key of keys) { - if (i[key]) { - aggregated[key].push(i[key]); - } - } - } - }) - ); - let updates = {}; - if (typeof route.lazy === "function" && aggregated.lazy.length > 0) { - let instrumented = wrapImpl(aggregated.lazy, route.lazy, () => void 0); - if (instrumented) { - updates.lazy = instrumented; - } - } - if (typeof route.lazy === "object") { - let lazyObject = route.lazy; - ["middleware", "loader", "action"].forEach((key) => { - let lazyFn = lazyObject[key]; - let instrumentations = aggregated[`lazy.${key}`]; - if (typeof lazyFn === "function" && instrumentations.length > 0) { - let instrumented = wrapImpl(instrumentations, lazyFn, () => void 0); - if (instrumented) { - updates.lazy = Object.assign(updates.lazy || {}, { - [key]: instrumented - }); - } - } - }); - } - ["loader", "action"].forEach((key) => { - let handler = route[key]; - if (typeof handler === "function" && aggregated[key].length > 0) { - let original = handler[UninstrumentedSymbol] ?? handler; - let instrumented = wrapImpl( - aggregated[key], - original, - (...args) => getHandlerInfo(args[0]) - ); - if (instrumented) { - if (key === "loader" && original.hydrate === true) { - instrumented.hydrate = true; - } - instrumented[UninstrumentedSymbol] = original; - updates[key] = instrumented; - } - } - }); - if (route.middleware && route.middleware.length > 0 && aggregated.middleware.length > 0) { - updates.middleware = route.middleware.map((middleware) => { - let original = middleware[UninstrumentedSymbol] ?? middleware; - let instrumented = wrapImpl( - aggregated.middleware, - original, - (...args) => getHandlerInfo(args[0]) - ); - if (instrumented) { - instrumented[UninstrumentedSymbol] = original; - return instrumented; - } - return middleware; - }); - } - return updates; -} -function instrumentClientSideRouter(router2, fns) { - let aggregated = { - navigate: [], - fetch: [] - }; - fns.forEach( - (fn) => fn({ - instrument(i) { - let keys = Object.keys(i); - for (let key of keys) { - if (i[key]) { - aggregated[key].push(i[key]); - } - } - } - }) - ); - if (aggregated.navigate.length > 0) { - let navigate = router2.navigate[UninstrumentedSymbol] ?? router2.navigate; - let instrumentedNavigate = wrapImpl( - aggregated.navigate, - navigate, - (...args) => { - let [to, opts] = args; - return { - to: typeof to === "number" || typeof to === "string" ? to : to ? createPath(to) : ".", - ...getRouterInfo(router2, opts ?? {}) - }; - } - ); - if (instrumentedNavigate) { - instrumentedNavigate[UninstrumentedSymbol] = navigate; - router2.navigate = instrumentedNavigate; - } - } - if (aggregated.fetch.length > 0) { - let fetch2 = router2.fetch[UninstrumentedSymbol] ?? router2.fetch; - let instrumentedFetch = wrapImpl(aggregated.fetch, fetch2, (...args) => { - let [key, , href2, opts] = args; - return { - href: href2 ?? ".", - fetcherKey: key, - ...getRouterInfo(router2, opts ?? {}) - }; - }); - if (instrumentedFetch) { - instrumentedFetch[UninstrumentedSymbol] = fetch2; - router2.fetch = instrumentedFetch; - } - } - return router2; -} -function instrumentHandler(handler, fns) { - let aggregated = { - request: [] - }; - fns.forEach( - (fn) => fn({ - instrument(i) { - let keys = Object.keys(i); - for (let key of keys) { - if (i[key]) { - aggregated[key].push(i[key]); - } - } - } - }) - ); - let instrumentedHandler = handler; - if (aggregated.request.length > 0) { - instrumentedHandler = wrapImpl(aggregated.request, handler, (...args) => { - let [request, context] = args; - return { - request: getReadonlyRequest(request), - context: context != null ? getReadonlyContext(context) : context - }; - }); - } - return instrumentedHandler; -} -function wrapImpl(impls, handler, getInfo) { - if (impls.length === 0) { - return null; - } - return async (...args) => { - let result = await recurseRight( - impls, - getInfo(...args), - () => handler(...args), - impls.length - 1 - ); - if (result.type === "error") { - throw result.value; - } - return result.value; - }; -} -async function recurseRight(impls, info, handler, index) { - let impl = impls[index]; - let result; - if (!impl) { - try { - let value = await handler(); - result = { type: "success", value }; - } catch (e) { - result = { type: "error", value: e }; - } - } else { - let handlerPromise = void 0; - let callHandler = async () => { - if (handlerPromise) { - console.error("You cannot call instrumented handlers more than once"); - } else { - handlerPromise = recurseRight(impls, info, handler, index - 1); - } - result = await handlerPromise; - invariant(result, "Expected a result"); - if (result.type === "error" && result.value instanceof Error) { - return { status: "error", error: result.value }; - } - return { status: "success", error: void 0 }; - }; - try { - await impl(callHandler, info); - } catch (e) { - console.error("An instrumentation function threw an error:", e); - } - if (!handlerPromise) { - await callHandler(); - } - await handlerPromise; - } - if (result) { - return result; - } - return { - type: "error", - value: new Error("No result assigned in instrumentation chain.") - }; -} -function getHandlerInfo(args) { - let { request, context, params, unstable_pattern } = args; - return { - request: getReadonlyRequest(request), - params: { ...params }, - unstable_pattern, - context: getReadonlyContext(context) - }; -} -function getRouterInfo(router2, opts) { - return { - currentUrl: createPath(router2.state.location), - ..."formMethod" in opts ? { formMethod: opts.formMethod } : {}, - ..."formEncType" in opts ? { formEncType: opts.formEncType } : {}, - ..."formData" in opts ? { formData: opts.formData } : {}, - ..."body" in opts ? { body: opts.body } : {} - }; -} -function getReadonlyRequest(request) { - return { - method: request.method, - url: request.url, - headers: { - get: (...args) => request.headers.get(...args) - } - }; -} -function getReadonlyContext(context) { - if (isPlainObject(context)) { - let frozen = { ...context }; - Object.freeze(frozen); - return frozen; - } else { - return { - get: (ctx) => context.get(ctx) - }; - } -} -function isPlainObject(thing) { - if (thing === null || typeof thing !== "object") { - return false; - } - const proto = Object.getPrototypeOf(thing); - return proto === Object.prototype || proto === null || Object.getOwnPropertyNames(proto).sort().join("\0") === objectProtoNames; -} -function createRouter(init) { - const routerWindow = init.window ? init.window : typeof window !== "undefined" ? window : void 0; - const isBrowser3 = typeof routerWindow !== "undefined" && typeof routerWindow.document !== "undefined" && typeof routerWindow.document.createElement !== "undefined"; - invariant( - init.routes.length > 0, - "You must provide a non-empty routes array to createRouter" - ); - let hydrationRouteProperties2 = init.hydrationRouteProperties || []; - let _mapRouteProperties = init.mapRouteProperties || defaultMapRouteProperties; - let mapRouteProperties2 = _mapRouteProperties; - if (init.unstable_instrumentations) { - let instrumentations = init.unstable_instrumentations; - mapRouteProperties2 = (route) => { - return { - ..._mapRouteProperties(route), - ...getRouteInstrumentationUpdates( - instrumentations.map((i) => i.route).filter(Boolean), - route - ) - }; - }; - } - let manifest = {}; - let dataRoutes = convertRoutesToDataRoutes( - init.routes, - mapRouteProperties2, - void 0, - manifest - ); - let inFlightDataRoutes; - let basename = init.basename || "/"; - if (!basename.startsWith("/")) { - basename = `/${basename}`; - } - let dataStrategyImpl = init.dataStrategy || defaultDataStrategyWithMiddleware; - let future = { - ...init.future - }; - let unlistenHistory = null; - let subscribers = /* @__PURE__ */ new Set(); - let savedScrollPositions2 = null; - let getScrollRestorationKey2 = null; - let getScrollPosition = null; - let initialScrollRestored = init.hydrationData != null; - let initialMatches = matchRoutes(dataRoutes, init.history.location, basename); - let initialMatchesIsFOW = false; - let initialErrors = null; - let initialized; - if (initialMatches == null && !init.patchRoutesOnNavigation) { - let error = getInternalRouterError(404, { - pathname: init.history.location.pathname - }); - let { matches, route } = getShortCircuitMatches(dataRoutes); - initialized = true; - initialMatches = matches; - initialErrors = { [route.id]: error }; - } else { - if (initialMatches && !init.hydrationData) { - let fogOfWar = checkFogOfWar( - initialMatches, - dataRoutes, - init.history.location.pathname - ); - if (fogOfWar.active) { - initialMatches = null; - } - } - if (!initialMatches) { - initialized = false; - initialMatches = []; - let fogOfWar = checkFogOfWar( - null, - dataRoutes, - init.history.location.pathname - ); - if (fogOfWar.active && fogOfWar.matches) { - initialMatchesIsFOW = true; - initialMatches = fogOfWar.matches; - } - } else if (initialMatches.some((m) => m.route.lazy)) { - initialized = false; - } else if (!initialMatches.some((m) => routeHasLoaderOrMiddleware(m.route))) { - initialized = true; - } else { - let loaderData = init.hydrationData ? init.hydrationData.loaderData : null; - let errors = init.hydrationData ? init.hydrationData.errors : null; - if (errors) { - let idx = initialMatches.findIndex( - (m) => errors[m.route.id] !== void 0 - ); - initialized = initialMatches.slice(0, idx + 1).every( - (m) => !shouldLoadRouteOnHydration(m.route, loaderData, errors) - ); - } else { - initialized = initialMatches.every( - (m) => !shouldLoadRouteOnHydration(m.route, loaderData, errors) - ); - } - } - } - let router2; - let state = { - historyAction: init.history.action, - location: init.history.location, - matches: initialMatches, - initialized, - navigation: IDLE_NAVIGATION, - // Don't restore on initial updateState() if we were SSR'd - restoreScrollPosition: init.hydrationData != null ? false : null, - preventScrollReset: false, - revalidation: "idle", - loaderData: init.hydrationData && init.hydrationData.loaderData || {}, - actionData: init.hydrationData && init.hydrationData.actionData || null, - errors: init.hydrationData && init.hydrationData.errors || initialErrors, - fetchers: /* @__PURE__ */ new Map(), - blockers: /* @__PURE__ */ new Map() - }; - let pendingAction = "POP"; - let pendingPopstateNavigationDfd = null; - let pendingPreventScrollReset = false; - let pendingNavigationController; - let pendingViewTransitionEnabled = false; - let appliedViewTransitions = /* @__PURE__ */ new Map(); - let removePageHideEventListener = null; - let isUninterruptedRevalidation = false; - let isRevalidationRequired = false; - let cancelledFetcherLoads = /* @__PURE__ */ new Set(); - let fetchControllers = /* @__PURE__ */ new Map(); - let incrementingLoadId = 0; - let pendingNavigationLoadId = -1; - let fetchReloadIds = /* @__PURE__ */ new Map(); - let fetchRedirectIds = /* @__PURE__ */ new Set(); - let fetchLoadMatches = /* @__PURE__ */ new Map(); - let activeFetchers = /* @__PURE__ */ new Map(); - let fetchersQueuedForDeletion = /* @__PURE__ */ new Set(); - let blockerFunctions = /* @__PURE__ */ new Map(); - let unblockBlockerHistoryUpdate = void 0; - let pendingRevalidationDfd = null; - function initialize() { - unlistenHistory = init.history.listen( - ({ action: historyAction, location: location2, delta }) => { - if (unblockBlockerHistoryUpdate) { - unblockBlockerHistoryUpdate(); - unblockBlockerHistoryUpdate = void 0; - return; - } - warning( - blockerFunctions.size === 0 || delta != null, - "You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL." - ); - let blockerKey = shouldBlockNavigation({ - currentLocation: state.location, - nextLocation: location2, - historyAction - }); - if (blockerKey && delta != null) { - let nextHistoryUpdatePromise = new Promise((resolve) => { - unblockBlockerHistoryUpdate = resolve; - }); - init.history.go(delta * -1); - updateBlocker(blockerKey, { - state: "blocked", - location: location2, - proceed() { - updateBlocker(blockerKey, { - state: "proceeding", - proceed: void 0, - reset: void 0, - location: location2 - }); - nextHistoryUpdatePromise.then(() => init.history.go(delta)); - }, - reset() { - let blockers = new Map(state.blockers); - blockers.set(blockerKey, IDLE_BLOCKER); - updateState({ blockers }); - } - }); - pendingPopstateNavigationDfd?.resolve(); - pendingPopstateNavigationDfd = null; - return; - } - return startNavigation(historyAction, location2); - } - ); - if (isBrowser3) { - restoreAppliedTransitions(routerWindow, appliedViewTransitions); - let _saveAppliedTransitions = () => persistAppliedTransitions(routerWindow, appliedViewTransitions); - routerWindow.addEventListener("pagehide", _saveAppliedTransitions); - removePageHideEventListener = () => routerWindow.removeEventListener("pagehide", _saveAppliedTransitions); - } - if (!state.initialized) { - startNavigation("POP", state.location, { - initialHydration: true - }); - } - return router2; - } - function dispose() { - if (unlistenHistory) { - unlistenHistory(); - } - if (removePageHideEventListener) { - removePageHideEventListener(); - } - subscribers.clear(); - pendingNavigationController && pendingNavigationController.abort(); - state.fetchers.forEach((_, key) => deleteFetcher(key)); - state.blockers.forEach((_, key) => deleteBlocker(key)); - } - function subscribe(fn) { - subscribers.add(fn); - return () => subscribers.delete(fn); - } - function updateState(newState, opts = {}) { - if (newState.matches) { - newState.matches = newState.matches.map((m) => { - let route = manifest[m.route.id]; - let matchRoute = m.route; - if (matchRoute.element !== route.element || matchRoute.errorElement !== route.errorElement || matchRoute.hydrateFallbackElement !== route.hydrateFallbackElement) { - return { - ...m, - route - }; - } - return m; - }); - } - state = { - ...state, - ...newState - }; - let unmountedFetchers = []; - let mountedFetchers = []; - state.fetchers.forEach((fetcher, key) => { - if (fetcher.state === "idle") { - if (fetchersQueuedForDeletion.has(key)) { - unmountedFetchers.push(key); - } else { - mountedFetchers.push(key); - } - } - }); - fetchersQueuedForDeletion.forEach((key) => { - if (!state.fetchers.has(key) && !fetchControllers.has(key)) { - unmountedFetchers.push(key); - } - }); - [...subscribers].forEach( - (subscriber) => subscriber(state, { - deletedFetchers: unmountedFetchers, - newErrors: newState.errors ?? null, - viewTransitionOpts: opts.viewTransitionOpts, - flushSync: opts.flushSync === true - }) - ); - unmountedFetchers.forEach((key) => deleteFetcher(key)); - mountedFetchers.forEach((key) => state.fetchers.delete(key)); - } - function completeNavigation(location2, newState, { flushSync: flushSync3 } = {}) { - let isActionReload = state.actionData != null && state.navigation.formMethod != null && isMutationMethod(state.navigation.formMethod) && state.navigation.state === "loading" && location2.state?._isRedirect !== true; - let actionData; - if (newState.actionData) { - if (Object.keys(newState.actionData).length > 0) { - actionData = newState.actionData; - } else { - actionData = null; - } - } else if (isActionReload) { - actionData = state.actionData; - } else { - actionData = null; - } - let loaderData = newState.loaderData ? mergeLoaderData( - state.loaderData, - newState.loaderData, - newState.matches || [], - newState.errors - ) : state.loaderData; - let blockers = state.blockers; - if (blockers.size > 0) { - blockers = new Map(blockers); - blockers.forEach((_, k) => blockers.set(k, IDLE_BLOCKER)); - } - let restoreScrollPosition = isUninterruptedRevalidation ? false : getSavedScrollPosition(location2, newState.matches || state.matches); - let preventScrollReset = pendingPreventScrollReset === true || state.navigation.formMethod != null && isMutationMethod(state.navigation.formMethod) && location2.state?._isRedirect !== true; - if (inFlightDataRoutes) { - dataRoutes = inFlightDataRoutes; - inFlightDataRoutes = void 0; - } - if (isUninterruptedRevalidation) { - } else if (pendingAction === "POP") { - } else if (pendingAction === "PUSH") { - init.history.push(location2, location2.state); - } else if (pendingAction === "REPLACE") { - init.history.replace(location2, location2.state); - } - let viewTransitionOpts; - if (pendingAction === "POP") { - let priorPaths = appliedViewTransitions.get(state.location.pathname); - if (priorPaths && priorPaths.has(location2.pathname)) { - viewTransitionOpts = { - currentLocation: state.location, - nextLocation: location2 - }; - } else if (appliedViewTransitions.has(location2.pathname)) { - viewTransitionOpts = { - currentLocation: location2, - nextLocation: state.location - }; - } - } else if (pendingViewTransitionEnabled) { - let toPaths = appliedViewTransitions.get(state.location.pathname); - if (toPaths) { - toPaths.add(location2.pathname); - } else { - toPaths = /* @__PURE__ */ new Set([location2.pathname]); - appliedViewTransitions.set(state.location.pathname, toPaths); - } - viewTransitionOpts = { - currentLocation: state.location, - nextLocation: location2 - }; - } - updateState( - { - ...newState, - // matches, errors, fetchers go through as-is - actionData, - loaderData, - historyAction: pendingAction, - location: location2, - initialized: true, - navigation: IDLE_NAVIGATION, - revalidation: "idle", - restoreScrollPosition, - preventScrollReset, - blockers - }, - { - viewTransitionOpts, - flushSync: flushSync3 === true - } - ); - pendingAction = "POP"; - pendingPreventScrollReset = false; - pendingViewTransitionEnabled = false; - isUninterruptedRevalidation = false; - isRevalidationRequired = false; - pendingPopstateNavigationDfd?.resolve(); - pendingPopstateNavigationDfd = null; - pendingRevalidationDfd?.resolve(); - pendingRevalidationDfd = null; - } - async function navigate(to, opts) { - pendingPopstateNavigationDfd?.resolve(); - pendingPopstateNavigationDfd = null; - if (typeof to === "number") { - if (!pendingPopstateNavigationDfd) { - pendingPopstateNavigationDfd = createDeferred(); - } - let promise = pendingPopstateNavigationDfd.promise; - init.history.go(to); - return promise; - } - let normalizedPath = normalizeTo( - state.location, - state.matches, - basename, - to, - opts?.fromRouteId, - opts?.relative - ); - let { path, submission, error } = normalizeNavigateOptions( - false, - normalizedPath, - opts - ); - let currentLocation = state.location; - let nextLocation = createLocation(state.location, path, opts && opts.state); - nextLocation = { - ...nextLocation, - ...init.history.encodeLocation(nextLocation) - }; - let userReplace = opts && opts.replace != null ? opts.replace : void 0; - let historyAction = "PUSH"; - if (userReplace === true) { - historyAction = "REPLACE"; - } else if (userReplace === false) { - } else if (submission != null && isMutationMethod(submission.formMethod) && submission.formAction === state.location.pathname + state.location.search) { - historyAction = "REPLACE"; - } - let preventScrollReset = opts && "preventScrollReset" in opts ? opts.preventScrollReset === true : void 0; - let flushSync3 = (opts && opts.flushSync) === true; - let blockerKey = shouldBlockNavigation({ - currentLocation, - nextLocation, - historyAction - }); - if (blockerKey) { - updateBlocker(blockerKey, { - state: "blocked", - location: nextLocation, - proceed() { - updateBlocker(blockerKey, { - state: "proceeding", - proceed: void 0, - reset: void 0, - location: nextLocation - }); - navigate(to, opts); - }, - reset() { - let blockers = new Map(state.blockers); - blockers.set(blockerKey, IDLE_BLOCKER); - updateState({ blockers }); - } - }); - return; - } - await startNavigation(historyAction, nextLocation, { - submission, - // Send through the formData serialization error if we have one so we can - // render at the right error boundary after we match routes - pendingError: error, - preventScrollReset, - replace: opts && opts.replace, - enableViewTransition: opts && opts.viewTransition, - flushSync: flushSync3, - callSiteDefaultShouldRevalidate: opts && opts.unstable_defaultShouldRevalidate - }); - } - function revalidate() { - if (!pendingRevalidationDfd) { - pendingRevalidationDfd = createDeferred(); - } - interruptActiveLoads(); - updateState({ revalidation: "loading" }); - let promise = pendingRevalidationDfd.promise; - if (state.navigation.state === "submitting") { - return promise; - } - if (state.navigation.state === "idle") { - startNavigation(state.historyAction, state.location, { - startUninterruptedRevalidation: true - }); - return promise; - } - startNavigation( - pendingAction || state.historyAction, - state.navigation.location, - { - overrideNavigation: state.navigation, - // Proxy through any rending view transition - enableViewTransition: pendingViewTransitionEnabled === true - } - ); - return promise; - } - async function startNavigation(historyAction, location2, opts) { - pendingNavigationController && pendingNavigationController.abort(); - pendingNavigationController = null; - pendingAction = historyAction; - isUninterruptedRevalidation = (opts && opts.startUninterruptedRevalidation) === true; - saveScrollPosition(state.location, state.matches); - pendingPreventScrollReset = (opts && opts.preventScrollReset) === true; - pendingViewTransitionEnabled = (opts && opts.enableViewTransition) === true; - let routesToUse = inFlightDataRoutes || dataRoutes; - let loadingNavigation = opts && opts.overrideNavigation; - let matches = opts?.initialHydration && state.matches && state.matches.length > 0 && !initialMatchesIsFOW ? ( - // `matchRoutes()` has already been called if we're in here via `router.initialize()` - state.matches - ) : matchRoutes(routesToUse, location2, basename); - let flushSync3 = (opts && opts.flushSync) === true; - if (matches && state.initialized && !isRevalidationRequired && isHashChangeOnly(state.location, location2) && !(opts && opts.submission && isMutationMethod(opts.submission.formMethod))) { - completeNavigation(location2, { matches }, { flushSync: flushSync3 }); - return; - } - let fogOfWar = checkFogOfWar(matches, routesToUse, location2.pathname); - if (fogOfWar.active && fogOfWar.matches) { - matches = fogOfWar.matches; - } - if (!matches) { - let { error, notFoundMatches, route } = handleNavigational404( - location2.pathname - ); - completeNavigation( - location2, - { - matches: notFoundMatches, - loaderData: {}, - errors: { - [route.id]: error - } - }, - { flushSync: flushSync3 } - ); - return; - } - pendingNavigationController = new AbortController(); - let request = createClientSideRequest( - init.history, - location2, - pendingNavigationController.signal, - opts && opts.submission - ); - let scopedContext = init.getContext ? await init.getContext() : new RouterContextProvider(); - let pendingActionResult; - if (opts && opts.pendingError) { - pendingActionResult = [ - findNearestBoundary(matches).route.id, - { type: "error", error: opts.pendingError } - ]; - } else if (opts && opts.submission && isMutationMethod(opts.submission.formMethod)) { - let actionResult = await handleAction( - request, - location2, - opts.submission, - matches, - scopedContext, - fogOfWar.active, - opts && opts.initialHydration === true, - { replace: opts.replace, flushSync: flushSync3 } - ); - if (actionResult.shortCircuited) { - return; - } - if (actionResult.pendingActionResult) { - let [routeId, result] = actionResult.pendingActionResult; - if (isErrorResult(result) && isRouteErrorResponse(result.error) && result.error.status === 404) { - pendingNavigationController = null; - completeNavigation(location2, { - matches: actionResult.matches, - loaderData: {}, - errors: { - [routeId]: result.error - } - }); - return; - } - } - matches = actionResult.matches || matches; - pendingActionResult = actionResult.pendingActionResult; - loadingNavigation = getLoadingNavigation(location2, opts.submission); - flushSync3 = false; - fogOfWar.active = false; - request = createClientSideRequest( - init.history, - request.url, - request.signal - ); - } - let { - shortCircuited, - matches: updatedMatches, - loaderData, - errors - } = await handleLoaders( - request, - location2, - matches, - scopedContext, - fogOfWar.active, - loadingNavigation, - opts && opts.submission, - opts && opts.fetcherSubmission, - opts && opts.replace, - opts && opts.initialHydration === true, - flushSync3, - pendingActionResult, - opts && opts.callSiteDefaultShouldRevalidate - ); - if (shortCircuited) { - return; - } - pendingNavigationController = null; - completeNavigation(location2, { - matches: updatedMatches || matches, - ...getActionDataForCommit(pendingActionResult), - loaderData, - errors - }); - } - async function handleAction(request, location2, submission, matches, scopedContext, isFogOfWar, initialHydration, opts = {}) { - interruptActiveLoads(); - let navigation = getSubmittingNavigation(location2, submission); - updateState({ navigation }, { flushSync: opts.flushSync === true }); - if (isFogOfWar) { - let discoverResult = await discoverRoutes( - matches, - location2.pathname, - request.signal - ); - if (discoverResult.type === "aborted") { - return { shortCircuited: true }; - } else if (discoverResult.type === "error") { - if (discoverResult.partialMatches.length === 0) { - let { matches: matches2, route } = getShortCircuitMatches(dataRoutes); - return { - matches: matches2, - pendingActionResult: [ - route.id, - { - type: "error", - error: discoverResult.error - } - ] - }; - } - let boundaryId = findNearestBoundary(discoverResult.partialMatches).route.id; - return { - matches: discoverResult.partialMatches, - pendingActionResult: [ - boundaryId, - { - type: "error", - error: discoverResult.error - } - ] - }; - } else if (!discoverResult.matches) { - let { notFoundMatches, error, route } = handleNavigational404( - location2.pathname - ); - return { - matches: notFoundMatches, - pendingActionResult: [ - route.id, - { - type: "error", - error - } - ] - }; - } else { - matches = discoverResult.matches; - } - } - let result; - let actionMatch = getTargetMatch(matches, location2); - if (!actionMatch.route.action && !actionMatch.route.lazy) { - result = { - type: "error", - error: getInternalRouterError(405, { - method: request.method, - pathname: location2.pathname, - routeId: actionMatch.route.id - }) - }; - } else { - let dsMatches = getTargetedDataStrategyMatches( - mapRouteProperties2, - manifest, - request, - matches, - actionMatch, - initialHydration ? [] : hydrationRouteProperties2, - scopedContext - ); - let results = await callDataStrategy( - request, - dsMatches, - scopedContext, - null - ); - result = results[actionMatch.route.id]; - if (!result) { - for (let match of matches) { - if (results[match.route.id]) { - result = results[match.route.id]; - break; - } - } - } - if (request.signal.aborted) { - return { shortCircuited: true }; - } - } - if (isRedirectResult(result)) { - let replace2; - if (opts && opts.replace != null) { - replace2 = opts.replace; - } else { - let location22 = normalizeRedirectLocation( - result.response.headers.get("Location"), - new URL(request.url), - basename, - init.history - ); - replace2 = location22 === state.location.pathname + state.location.search; - } - await startRedirectNavigation(request, result, true, { - submission, - replace: replace2 - }); - return { shortCircuited: true }; - } - if (isErrorResult(result)) { - let boundaryMatch = findNearestBoundary(matches, actionMatch.route.id); - if ((opts && opts.replace) !== true) { - pendingAction = "PUSH"; - } - return { - matches, - pendingActionResult: [ - boundaryMatch.route.id, - result, - actionMatch.route.id - ] - }; - } - return { - matches, - pendingActionResult: [actionMatch.route.id, result] - }; - } - async function handleLoaders(request, location2, matches, scopedContext, isFogOfWar, overrideNavigation, submission, fetcherSubmission, replace2, initialHydration, flushSync3, pendingActionResult, callSiteDefaultShouldRevalidate) { - let loadingNavigation = overrideNavigation || getLoadingNavigation(location2, submission); - let activeSubmission = submission || fetcherSubmission || getSubmissionFromNavigation(loadingNavigation); - let shouldUpdateNavigationState = !isUninterruptedRevalidation && !initialHydration; - if (isFogOfWar) { - if (shouldUpdateNavigationState) { - let actionData = getUpdatedActionData(pendingActionResult); - updateState( - { - navigation: loadingNavigation, - ...actionData !== void 0 ? { actionData } : {} - }, - { - flushSync: flushSync3 - } - ); - } - let discoverResult = await discoverRoutes( - matches, - location2.pathname, - request.signal - ); - if (discoverResult.type === "aborted") { - return { shortCircuited: true }; - } else if (discoverResult.type === "error") { - if (discoverResult.partialMatches.length === 0) { - let { matches: matches2, route } = getShortCircuitMatches(dataRoutes); - return { - matches: matches2, - loaderData: {}, - errors: { - [route.id]: discoverResult.error - } - }; - } - let boundaryId = findNearestBoundary(discoverResult.partialMatches).route.id; - return { - matches: discoverResult.partialMatches, - loaderData: {}, - errors: { - [boundaryId]: discoverResult.error - } - }; - } else if (!discoverResult.matches) { - let { error, notFoundMatches, route } = handleNavigational404( - location2.pathname - ); - return { - matches: notFoundMatches, - loaderData: {}, - errors: { - [route.id]: error - } - }; - } else { - matches = discoverResult.matches; - } - } - let routesToUse = inFlightDataRoutes || dataRoutes; - let { dsMatches, revalidatingFetchers } = getMatchesToLoad( - request, - scopedContext, - mapRouteProperties2, - manifest, - init.history, - state, - matches, - activeSubmission, - location2, - initialHydration ? [] : hydrationRouteProperties2, - initialHydration === true, - isRevalidationRequired, - cancelledFetcherLoads, - fetchersQueuedForDeletion, - fetchLoadMatches, - fetchRedirectIds, - routesToUse, - basename, - init.patchRoutesOnNavigation != null, - pendingActionResult, - callSiteDefaultShouldRevalidate - ); - pendingNavigationLoadId = ++incrementingLoadId; - if (!init.dataStrategy && !dsMatches.some((m) => m.shouldLoad) && !dsMatches.some( - (m) => m.route.middleware && m.route.middleware.length > 0 - ) && revalidatingFetchers.length === 0) { - let updatedFetchers2 = markFetchRedirectsDone(); - completeNavigation( - location2, - { - matches, - loaderData: {}, - // Commit pending error if we're short circuiting - errors: pendingActionResult && isErrorResult(pendingActionResult[1]) ? { [pendingActionResult[0]]: pendingActionResult[1].error } : null, - ...getActionDataForCommit(pendingActionResult), - ...updatedFetchers2 ? { fetchers: new Map(state.fetchers) } : {} - }, - { flushSync: flushSync3 } - ); - return { shortCircuited: true }; - } - if (shouldUpdateNavigationState) { - let updates = {}; - if (!isFogOfWar) { - updates.navigation = loadingNavigation; - let actionData = getUpdatedActionData(pendingActionResult); - if (actionData !== void 0) { - updates.actionData = actionData; - } - } - if (revalidatingFetchers.length > 0) { - updates.fetchers = getUpdatedRevalidatingFetchers(revalidatingFetchers); - } - updateState(updates, { flushSync: flushSync3 }); - } - revalidatingFetchers.forEach((rf) => { - abortFetcher(rf.key); - if (rf.controller) { - fetchControllers.set(rf.key, rf.controller); - } - }); - let abortPendingFetchRevalidations = () => revalidatingFetchers.forEach((f) => abortFetcher(f.key)); - if (pendingNavigationController) { - pendingNavigationController.signal.addEventListener( - "abort", - abortPendingFetchRevalidations - ); - } - let { loaderResults, fetcherResults } = await callLoadersAndMaybeResolveData( - dsMatches, - revalidatingFetchers, - request, - scopedContext - ); - if (request.signal.aborted) { - return { shortCircuited: true }; - } - if (pendingNavigationController) { - pendingNavigationController.signal.removeEventListener( - "abort", - abortPendingFetchRevalidations - ); - } - revalidatingFetchers.forEach((rf) => fetchControllers.delete(rf.key)); - let redirect2 = findRedirect(loaderResults); - if (redirect2) { - await startRedirectNavigation(request, redirect2.result, true, { - replace: replace2 - }); - return { shortCircuited: true }; - } - redirect2 = findRedirect(fetcherResults); - if (redirect2) { - fetchRedirectIds.add(redirect2.key); - await startRedirectNavigation(request, redirect2.result, true, { - replace: replace2 - }); - return { shortCircuited: true }; - } - let { loaderData, errors } = processLoaderData( - state, - matches, - loaderResults, - pendingActionResult, - revalidatingFetchers, - fetcherResults - ); - if (initialHydration && state.errors) { - errors = { ...state.errors, ...errors }; - } - let updatedFetchers = markFetchRedirectsDone(); - let didAbortFetchLoads = abortStaleFetchLoads(pendingNavigationLoadId); - let shouldUpdateFetchers = updatedFetchers || didAbortFetchLoads || revalidatingFetchers.length > 0; - return { - matches, - loaderData, - errors, - ...shouldUpdateFetchers ? { fetchers: new Map(state.fetchers) } : {} - }; - } - function getUpdatedActionData(pendingActionResult) { - if (pendingActionResult && !isErrorResult(pendingActionResult[1])) { - return { - [pendingActionResult[0]]: pendingActionResult[1].data - }; - } else if (state.actionData) { - if (Object.keys(state.actionData).length === 0) { - return null; - } else { - return state.actionData; - } - } - } - function getUpdatedRevalidatingFetchers(revalidatingFetchers) { - revalidatingFetchers.forEach((rf) => { - let fetcher = state.fetchers.get(rf.key); - let revalidatingFetcher = getLoadingFetcher( - void 0, - fetcher ? fetcher.data : void 0 - ); - state.fetchers.set(rf.key, revalidatingFetcher); - }); - return new Map(state.fetchers); - } - async function fetch2(key, routeId, href2, opts) { - abortFetcher(key); - let flushSync3 = (opts && opts.flushSync) === true; - let routesToUse = inFlightDataRoutes || dataRoutes; - let normalizedPath = normalizeTo( - state.location, - state.matches, - basename, - href2, - routeId, - opts?.relative - ); - let matches = matchRoutes(routesToUse, normalizedPath, basename); - let fogOfWar = checkFogOfWar(matches, routesToUse, normalizedPath); - if (fogOfWar.active && fogOfWar.matches) { - matches = fogOfWar.matches; - } - if (!matches) { - setFetcherError( - key, - routeId, - getInternalRouterError(404, { pathname: normalizedPath }), - { flushSync: flushSync3 } - ); - return; - } - let { path, submission, error } = normalizeNavigateOptions( - true, - normalizedPath, - opts - ); - if (error) { - setFetcherError(key, routeId, error, { flushSync: flushSync3 }); - return; - } - let scopedContext = init.getContext ? await init.getContext() : new RouterContextProvider(); - let preventScrollReset = (opts && opts.preventScrollReset) === true; - if (submission && isMutationMethod(submission.formMethod)) { - await handleFetcherAction( - key, - routeId, - path, - matches, - scopedContext, - fogOfWar.active, - flushSync3, - preventScrollReset, - submission, - opts && opts.unstable_defaultShouldRevalidate - ); - return; - } - fetchLoadMatches.set(key, { routeId, path }); - await handleFetcherLoader( - key, - routeId, - path, - matches, - scopedContext, - fogOfWar.active, - flushSync3, - preventScrollReset, - submission - ); - } - async function handleFetcherAction(key, routeId, path, requestMatches, scopedContext, isFogOfWar, flushSync3, preventScrollReset, submission, callSiteDefaultShouldRevalidate) { - interruptActiveLoads(); - fetchLoadMatches.delete(key); - let existingFetcher = state.fetchers.get(key); - updateFetcherState(key, getSubmittingFetcher(submission, existingFetcher), { - flushSync: flushSync3 - }); - let abortController = new AbortController(); - let fetchRequest = createClientSideRequest( - init.history, - path, - abortController.signal, - submission - ); - if (isFogOfWar) { - let discoverResult = await discoverRoutes( - requestMatches, - new URL(fetchRequest.url).pathname, - fetchRequest.signal, - key - ); - if (discoverResult.type === "aborted") { - return; - } else if (discoverResult.type === "error") { - setFetcherError(key, routeId, discoverResult.error, { flushSync: flushSync3 }); - return; - } else if (!discoverResult.matches) { - setFetcherError( - key, - routeId, - getInternalRouterError(404, { pathname: path }), - { flushSync: flushSync3 } - ); - return; - } else { - requestMatches = discoverResult.matches; - } - } - let match = getTargetMatch(requestMatches, path); - if (!match.route.action && !match.route.lazy) { - let error = getInternalRouterError(405, { - method: submission.formMethod, - pathname: path, - routeId - }); - setFetcherError(key, routeId, error, { flushSync: flushSync3 }); - return; - } - fetchControllers.set(key, abortController); - let originatingLoadId = incrementingLoadId; - let fetchMatches = getTargetedDataStrategyMatches( - mapRouteProperties2, - manifest, - fetchRequest, - requestMatches, - match, - hydrationRouteProperties2, - scopedContext - ); - let actionResults = await callDataStrategy( - fetchRequest, - fetchMatches, - scopedContext, - key - ); - let actionResult = actionResults[match.route.id]; - if (!actionResult) { - for (let match2 of fetchMatches) { - if (actionResults[match2.route.id]) { - actionResult = actionResults[match2.route.id]; - break; - } - } - } - if (fetchRequest.signal.aborted) { - if (fetchControllers.get(key) === abortController) { - fetchControllers.delete(key); - } - return; - } - if (fetchersQueuedForDeletion.has(key)) { - if (isRedirectResult(actionResult) || isErrorResult(actionResult)) { - updateFetcherState(key, getDoneFetcher(void 0)); - return; - } - } else { - if (isRedirectResult(actionResult)) { - fetchControllers.delete(key); - if (pendingNavigationLoadId > originatingLoadId) { - updateFetcherState(key, getDoneFetcher(void 0)); - return; - } else { - fetchRedirectIds.add(key); - updateFetcherState(key, getLoadingFetcher(submission)); - return startRedirectNavigation(fetchRequest, actionResult, false, { - fetcherSubmission: submission, - preventScrollReset - }); - } - } - if (isErrorResult(actionResult)) { - setFetcherError(key, routeId, actionResult.error); - return; - } - } - let nextLocation = state.navigation.location || state.location; - let revalidationRequest = createClientSideRequest( - init.history, - nextLocation, - abortController.signal - ); - let routesToUse = inFlightDataRoutes || dataRoutes; - let matches = state.navigation.state !== "idle" ? matchRoutes(routesToUse, state.navigation.location, basename) : state.matches; - invariant(matches, "Didn't find any matches after fetcher action"); - let loadId = ++incrementingLoadId; - fetchReloadIds.set(key, loadId); - let loadFetcher = getLoadingFetcher(submission, actionResult.data); - state.fetchers.set(key, loadFetcher); - let { dsMatches, revalidatingFetchers } = getMatchesToLoad( - revalidationRequest, - scopedContext, - mapRouteProperties2, - manifest, - init.history, - state, - matches, - submission, - nextLocation, - hydrationRouteProperties2, - false, - isRevalidationRequired, - cancelledFetcherLoads, - fetchersQueuedForDeletion, - fetchLoadMatches, - fetchRedirectIds, - routesToUse, - basename, - init.patchRoutesOnNavigation != null, - [match.route.id, actionResult], - callSiteDefaultShouldRevalidate - ); - revalidatingFetchers.filter((rf) => rf.key !== key).forEach((rf) => { - let staleKey = rf.key; - let existingFetcher2 = state.fetchers.get(staleKey); - let revalidatingFetcher = getLoadingFetcher( - void 0, - existingFetcher2 ? existingFetcher2.data : void 0 - ); - state.fetchers.set(staleKey, revalidatingFetcher); - abortFetcher(staleKey); - if (rf.controller) { - fetchControllers.set(staleKey, rf.controller); - } - }); - updateState({ fetchers: new Map(state.fetchers) }); - let abortPendingFetchRevalidations = () => revalidatingFetchers.forEach((rf) => abortFetcher(rf.key)); - abortController.signal.addEventListener( - "abort", - abortPendingFetchRevalidations - ); - let { loaderResults, fetcherResults } = await callLoadersAndMaybeResolveData( - dsMatches, - revalidatingFetchers, - revalidationRequest, - scopedContext - ); - if (abortController.signal.aborted) { - return; - } - abortController.signal.removeEventListener( - "abort", - abortPendingFetchRevalidations - ); - fetchReloadIds.delete(key); - fetchControllers.delete(key); - revalidatingFetchers.forEach((r) => fetchControllers.delete(r.key)); - if (state.fetchers.has(key)) { - let doneFetcher = getDoneFetcher(actionResult.data); - state.fetchers.set(key, doneFetcher); - } - let redirect2 = findRedirect(loaderResults); - if (redirect2) { - return startRedirectNavigation( - revalidationRequest, - redirect2.result, - false, - { preventScrollReset } - ); - } - redirect2 = findRedirect(fetcherResults); - if (redirect2) { - fetchRedirectIds.add(redirect2.key); - return startRedirectNavigation( - revalidationRequest, - redirect2.result, - false, - { preventScrollReset } - ); - } - let { loaderData, errors } = processLoaderData( - state, - matches, - loaderResults, - void 0, - revalidatingFetchers, - fetcherResults - ); - abortStaleFetchLoads(loadId); - if (state.navigation.state === "loading" && loadId > pendingNavigationLoadId) { - invariant(pendingAction, "Expected pending action"); - pendingNavigationController && pendingNavigationController.abort(); - completeNavigation(state.navigation.location, { - matches, - loaderData, - errors, - fetchers: new Map(state.fetchers) - }); - } else { - updateState({ - errors, - loaderData: mergeLoaderData( - state.loaderData, - loaderData, - matches, - errors - ), - fetchers: new Map(state.fetchers) - }); - isRevalidationRequired = false; - } - } - async function handleFetcherLoader(key, routeId, path, matches, scopedContext, isFogOfWar, flushSync3, preventScrollReset, submission) { - let existingFetcher = state.fetchers.get(key); - updateFetcherState( - key, - getLoadingFetcher( - submission, - existingFetcher ? existingFetcher.data : void 0 - ), - { flushSync: flushSync3 } - ); - let abortController = new AbortController(); - let fetchRequest = createClientSideRequest( - init.history, - path, - abortController.signal - ); - if (isFogOfWar) { - let discoverResult = await discoverRoutes( - matches, - new URL(fetchRequest.url).pathname, - fetchRequest.signal, - key - ); - if (discoverResult.type === "aborted") { - return; - } else if (discoverResult.type === "error") { - setFetcherError(key, routeId, discoverResult.error, { flushSync: flushSync3 }); - return; - } else if (!discoverResult.matches) { - setFetcherError( - key, - routeId, - getInternalRouterError(404, { pathname: path }), - { flushSync: flushSync3 } - ); - return; - } else { - matches = discoverResult.matches; - } - } - let match = getTargetMatch(matches, path); - fetchControllers.set(key, abortController); - let originatingLoadId = incrementingLoadId; - let dsMatches = getTargetedDataStrategyMatches( - mapRouteProperties2, - manifest, - fetchRequest, - matches, - match, - hydrationRouteProperties2, - scopedContext - ); - let results = await callDataStrategy( - fetchRequest, - dsMatches, - scopedContext, - key - ); - let result = results[match.route.id]; - if (fetchControllers.get(key) === abortController) { - fetchControllers.delete(key); - } - if (fetchRequest.signal.aborted) { - return; - } - if (fetchersQueuedForDeletion.has(key)) { - updateFetcherState(key, getDoneFetcher(void 0)); - return; - } - if (isRedirectResult(result)) { - if (pendingNavigationLoadId > originatingLoadId) { - updateFetcherState(key, getDoneFetcher(void 0)); - return; - } else { - fetchRedirectIds.add(key); - await startRedirectNavigation(fetchRequest, result, false, { - preventScrollReset - }); - return; - } - } - if (isErrorResult(result)) { - setFetcherError(key, routeId, result.error); - return; - } - updateFetcherState(key, getDoneFetcher(result.data)); - } - async function startRedirectNavigation(request, redirect2, isNavigation, { - submission, - fetcherSubmission, - preventScrollReset, - replace: replace2 - } = {}) { - if (!isNavigation) { - pendingPopstateNavigationDfd?.resolve(); - pendingPopstateNavigationDfd = null; - } - if (redirect2.response.headers.has("X-Remix-Revalidate")) { - isRevalidationRequired = true; - } - let location2 = redirect2.response.headers.get("Location"); - invariant(location2, "Expected a Location header on the redirect Response"); - location2 = normalizeRedirectLocation( - location2, - new URL(request.url), - basename, - init.history - ); - let redirectLocation = createLocation(state.location, location2, { - _isRedirect: true - }); - if (isBrowser3) { - let isDocumentReload = false; - if (redirect2.response.headers.has("X-Remix-Reload-Document")) { - isDocumentReload = true; - } else if (isAbsoluteUrl(location2)) { - const url = createBrowserURLImpl(location2, true); - isDocumentReload = // Hard reload if it's an absolute URL to a new origin - url.origin !== routerWindow.location.origin || // Hard reload if it's an absolute URL that does not match our basename - stripBasename(url.pathname, basename) == null; - } - if (isDocumentReload) { - if (replace2) { - routerWindow.location.replace(location2); - } else { - routerWindow.location.assign(location2); - } - return; - } - } - pendingNavigationController = null; - let redirectNavigationType = replace2 === true || redirect2.response.headers.has("X-Remix-Replace") ? "REPLACE" : "PUSH"; - let { formMethod, formAction, formEncType } = state.navigation; - if (!submission && !fetcherSubmission && formMethod && formAction && formEncType) { - submission = getSubmissionFromNavigation(state.navigation); - } - let activeSubmission = submission || fetcherSubmission; - if (redirectPreserveMethodStatusCodes.has(redirect2.response.status) && activeSubmission && isMutationMethod(activeSubmission.formMethod)) { - await startNavigation(redirectNavigationType, redirectLocation, { - submission: { - ...activeSubmission, - formAction: location2 - }, - // Preserve these flags across redirects - preventScrollReset: preventScrollReset || pendingPreventScrollReset, - enableViewTransition: isNavigation ? pendingViewTransitionEnabled : void 0 - }); - } else { - let overrideNavigation = getLoadingNavigation( - redirectLocation, - submission - ); - await startNavigation(redirectNavigationType, redirectLocation, { - overrideNavigation, - // Send fetcher submissions through for shouldRevalidate - fetcherSubmission, - // Preserve these flags across redirects - preventScrollReset: preventScrollReset || pendingPreventScrollReset, - enableViewTransition: isNavigation ? pendingViewTransitionEnabled : void 0 - }); - } - } - async function callDataStrategy(request, matches, scopedContext, fetcherKey) { - let results; - let dataResults = {}; - try { - results = await callDataStrategyImpl( - dataStrategyImpl, - request, - matches, - fetcherKey, - scopedContext, - false - ); - } catch (e) { - matches.filter((m) => m.shouldLoad).forEach((m) => { - dataResults[m.route.id] = { - type: "error", - error: e - }; - }); - return dataResults; - } - if (request.signal.aborted) { - return dataResults; - } - if (!isMutationMethod(request.method)) { - for (let match of matches) { - if (results[match.route.id]?.type === "error") { - break; - } - if (!results.hasOwnProperty(match.route.id) && !state.loaderData.hasOwnProperty(match.route.id) && (!state.errors || !state.errors.hasOwnProperty(match.route.id)) && match.shouldCallHandler()) { - results[match.route.id] = { - type: "error", - result: new Error( - `No result returned from dataStrategy for route ${match.route.id}` - ) - }; - } - } - } - for (let [routeId, result] of Object.entries(results)) { - if (isRedirectDataStrategyResult(result)) { - let response = result.result; - dataResults[routeId] = { - type: "redirect", - response: normalizeRelativeRoutingRedirectResponse( - response, - request, - routeId, - matches, - basename - ) - }; - } else { - dataResults[routeId] = await convertDataStrategyResultToDataResult(result); - } - } - return dataResults; - } - async function callLoadersAndMaybeResolveData(matches, fetchersToLoad, request, scopedContext) { - let loaderResultsPromise = callDataStrategy( - request, - matches, - scopedContext, - null - ); - let fetcherResultsPromise = Promise.all( - fetchersToLoad.map(async (f) => { - if (f.matches && f.match && f.request && f.controller) { - let results = await callDataStrategy( - f.request, - f.matches, - scopedContext, - f.key - ); - let result = results[f.match.route.id]; - return { [f.key]: result }; - } else { - return Promise.resolve({ - [f.key]: { - type: "error", - error: getInternalRouterError(404, { - pathname: f.path - }) - } - }); - } - }) - ); - let loaderResults = await loaderResultsPromise; - let fetcherResults = (await fetcherResultsPromise).reduce( - (acc, r) => Object.assign(acc, r), - {} - ); - return { - loaderResults, - fetcherResults - }; - } - function interruptActiveLoads() { - isRevalidationRequired = true; - fetchLoadMatches.forEach((_, key) => { - if (fetchControllers.has(key)) { - cancelledFetcherLoads.add(key); - } - abortFetcher(key); - }); - } - function updateFetcherState(key, fetcher, opts = {}) { - state.fetchers.set(key, fetcher); - updateState( - { fetchers: new Map(state.fetchers) }, - { flushSync: (opts && opts.flushSync) === true } - ); - } - function setFetcherError(key, routeId, error, opts = {}) { - let boundaryMatch = findNearestBoundary(state.matches, routeId); - deleteFetcher(key); - updateState( - { - errors: { - [boundaryMatch.route.id]: error - }, - fetchers: new Map(state.fetchers) - }, - { flushSync: (opts && opts.flushSync) === true } - ); - } - function getFetcher(key) { - activeFetchers.set(key, (activeFetchers.get(key) || 0) + 1); - if (fetchersQueuedForDeletion.has(key)) { - fetchersQueuedForDeletion.delete(key); - } - return state.fetchers.get(key) || IDLE_FETCHER; - } - function resetFetcher(key, opts) { - abortFetcher(key, opts?.reason); - updateFetcherState(key, getDoneFetcher(null)); - } - function deleteFetcher(key) { - let fetcher = state.fetchers.get(key); - if (fetchControllers.has(key) && !(fetcher && fetcher.state === "loading" && fetchReloadIds.has(key))) { - abortFetcher(key); - } - fetchLoadMatches.delete(key); - fetchReloadIds.delete(key); - fetchRedirectIds.delete(key); - fetchersQueuedForDeletion.delete(key); - cancelledFetcherLoads.delete(key); - state.fetchers.delete(key); - } - function queueFetcherForDeletion(key) { - let count = (activeFetchers.get(key) || 0) - 1; - if (count <= 0) { - activeFetchers.delete(key); - fetchersQueuedForDeletion.add(key); - } else { - activeFetchers.set(key, count); - } - updateState({ fetchers: new Map(state.fetchers) }); - } - function abortFetcher(key, reason) { - let controller = fetchControllers.get(key); - if (controller) { - controller.abort(reason); - fetchControllers.delete(key); - } - } - function markFetchersDone(keys) { - for (let key of keys) { - let fetcher = getFetcher(key); - let doneFetcher = getDoneFetcher(fetcher.data); - state.fetchers.set(key, doneFetcher); - } - } - function markFetchRedirectsDone() { - let doneKeys = []; - let updatedFetchers = false; - for (let key of fetchRedirectIds) { - let fetcher = state.fetchers.get(key); - invariant(fetcher, `Expected fetcher: ${key}`); - if (fetcher.state === "loading") { - fetchRedirectIds.delete(key); - doneKeys.push(key); - updatedFetchers = true; - } - } - markFetchersDone(doneKeys); - return updatedFetchers; - } - function abortStaleFetchLoads(landedId) { - let yeetedKeys = []; - for (let [key, id] of fetchReloadIds) { - if (id < landedId) { - let fetcher = state.fetchers.get(key); - invariant(fetcher, `Expected fetcher: ${key}`); - if (fetcher.state === "loading") { - abortFetcher(key); - fetchReloadIds.delete(key); - yeetedKeys.push(key); - } - } - } - markFetchersDone(yeetedKeys); - return yeetedKeys.length > 0; - } - function getBlocker(key, fn) { - let blocker = state.blockers.get(key) || IDLE_BLOCKER; - if (blockerFunctions.get(key) !== fn) { - blockerFunctions.set(key, fn); - } - return blocker; - } - function deleteBlocker(key) { - state.blockers.delete(key); - blockerFunctions.delete(key); - } - function updateBlocker(key, newBlocker) { - let blocker = state.blockers.get(key) || IDLE_BLOCKER; - invariant( - blocker.state === "unblocked" && newBlocker.state === "blocked" || blocker.state === "blocked" && newBlocker.state === "blocked" || blocker.state === "blocked" && newBlocker.state === "proceeding" || blocker.state === "blocked" && newBlocker.state === "unblocked" || blocker.state === "proceeding" && newBlocker.state === "unblocked", - `Invalid blocker state transition: ${blocker.state} -> ${newBlocker.state}` - ); - let blockers = new Map(state.blockers); - blockers.set(key, newBlocker); - updateState({ blockers }); - } - function shouldBlockNavigation({ - currentLocation, - nextLocation, - historyAction - }) { - if (blockerFunctions.size === 0) { - return; - } - if (blockerFunctions.size > 1) { - warning(false, "A router only supports one blocker at a time"); - } - let entries = Array.from(blockerFunctions.entries()); - let [blockerKey, blockerFunction] = entries[entries.length - 1]; - let blocker = state.blockers.get(blockerKey); - if (blocker && blocker.state === "proceeding") { - return; - } - if (blockerFunction({ currentLocation, nextLocation, historyAction })) { - return blockerKey; - } - } - function handleNavigational404(pathname) { - let error = getInternalRouterError(404, { pathname }); - let routesToUse = inFlightDataRoutes || dataRoutes; - let { matches, route } = getShortCircuitMatches(routesToUse); - return { notFoundMatches: matches, route, error }; - } - function enableScrollRestoration(positions, getPosition, getKey) { - savedScrollPositions2 = positions; - getScrollPosition = getPosition; - getScrollRestorationKey2 = getKey || null; - if (!initialScrollRestored && state.navigation === IDLE_NAVIGATION) { - initialScrollRestored = true; - let y = getSavedScrollPosition(state.location, state.matches); - if (y != null) { - updateState({ restoreScrollPosition: y }); - } - } - return () => { - savedScrollPositions2 = null; - getScrollPosition = null; - getScrollRestorationKey2 = null; - }; - } - function getScrollKey(location2, matches) { - if (getScrollRestorationKey2) { - let key = getScrollRestorationKey2( - location2, - matches.map((m) => convertRouteMatchToUiMatch(m, state.loaderData)) - ); - return key || location2.key; - } - return location2.key; - } - function saveScrollPosition(location2, matches) { - if (savedScrollPositions2 && getScrollPosition) { - let key = getScrollKey(location2, matches); - savedScrollPositions2[key] = getScrollPosition(); - } - } - function getSavedScrollPosition(location2, matches) { - if (savedScrollPositions2) { - let key = getScrollKey(location2, matches); - let y = savedScrollPositions2[key]; - if (typeof y === "number") { - return y; - } - } - return null; - } - function checkFogOfWar(matches, routesToUse, pathname) { - if (init.patchRoutesOnNavigation) { - if (!matches) { - let fogMatches = matchRoutesImpl( - routesToUse, - pathname, - basename, - true - ); - return { active: true, matches: fogMatches || [] }; - } else { - if (Object.keys(matches[0].params).length > 0) { - let partialMatches = matchRoutesImpl( - routesToUse, - pathname, - basename, - true - ); - return { active: true, matches: partialMatches }; - } - } - } - return { active: false, matches: null }; - } - async function discoverRoutes(matches, pathname, signal, fetcherKey) { - if (!init.patchRoutesOnNavigation) { - return { type: "success", matches }; - } - let partialMatches = matches; - while (true) { - let isNonHMR = inFlightDataRoutes == null; - let routesToUse = inFlightDataRoutes || dataRoutes; - let localManifest = manifest; - try { - await init.patchRoutesOnNavigation({ - signal, - path: pathname, - matches: partialMatches, - fetcherKey, - patch: (routeId, children) => { - if (signal.aborted) return; - patchRoutesImpl( - routeId, - children, - routesToUse, - localManifest, - mapRouteProperties2, - false - ); - } - }); - } catch (e) { - return { type: "error", error: e, partialMatches }; - } finally { - if (isNonHMR && !signal.aborted) { - dataRoutes = [...dataRoutes]; - } - } - if (signal.aborted) { - return { type: "aborted" }; - } - let newMatches = matchRoutes(routesToUse, pathname, basename); - let newPartialMatches = null; - if (newMatches) { - if (Object.keys(newMatches[0].params).length === 0) { - return { type: "success", matches: newMatches }; - } else { - newPartialMatches = matchRoutesImpl( - routesToUse, - pathname, - basename, - true - ); - let matchedDeeper = newPartialMatches && partialMatches.length < newPartialMatches.length && compareMatches( - partialMatches, - newPartialMatches.slice(0, partialMatches.length) - ); - if (!matchedDeeper) { - return { type: "success", matches: newMatches }; - } - } - } - if (!newPartialMatches) { - newPartialMatches = matchRoutesImpl( - routesToUse, - pathname, - basename, - true - ); - } - if (!newPartialMatches || compareMatches(partialMatches, newPartialMatches)) { - return { type: "success", matches: null }; - } - partialMatches = newPartialMatches; - } - } - function compareMatches(a, b) { - return a.length === b.length && a.every((m, i) => m.route.id === b[i].route.id); - } - function _internalSetRoutes(newRoutes) { - manifest = {}; - inFlightDataRoutes = convertRoutesToDataRoutes( - newRoutes, - mapRouteProperties2, - void 0, - manifest - ); - } - function patchRoutes(routeId, children, unstable_allowElementMutations = false) { - let isNonHMR = inFlightDataRoutes == null; - let routesToUse = inFlightDataRoutes || dataRoutes; - patchRoutesImpl( - routeId, - children, - routesToUse, - manifest, - mapRouteProperties2, - unstable_allowElementMutations - ); - if (isNonHMR) { - dataRoutes = [...dataRoutes]; - updateState({}); - } - } - router2 = { - get basename() { - return basename; - }, - get future() { - return future; - }, - get state() { - return state; - }, - get routes() { - return dataRoutes; - }, - get window() { - return routerWindow; - }, - initialize, - subscribe, - enableScrollRestoration, - navigate, - fetch: fetch2, - revalidate, - // Passthrough to history-aware createHref used by useHref so we get proper - // hash-aware URLs in DOM paths - createHref: (to) => init.history.createHref(to), - encodeLocation: (to) => init.history.encodeLocation(to), - getFetcher, - resetFetcher, - deleteFetcher: queueFetcherForDeletion, - dispose, - getBlocker, - deleteBlocker, - patchRoutes, - _internalFetchControllers: fetchControllers, - // TODO: Remove setRoutes, it's temporary to avoid dealing with - // updating the tree while validating the update algorithm. - _internalSetRoutes, - _internalSetStateDoNotUseOrYouWillBreakYourApp(newState) { - updateState(newState); - } - }; - if (init.unstable_instrumentations) { - router2 = instrumentClientSideRouter( - router2, - init.unstable_instrumentations.map((i) => i.router).filter(Boolean) - ); - } - return router2; -} -function createStaticHandler(routes, opts) { - invariant( - routes.length > 0, - "You must provide a non-empty routes array to createStaticHandler" - ); - let manifest = {}; - let basename = (opts ? opts.basename : null) || "/"; - let _mapRouteProperties = opts?.mapRouteProperties || defaultMapRouteProperties; - let mapRouteProperties2 = _mapRouteProperties; - if (opts?.unstable_instrumentations) { - let instrumentations = opts.unstable_instrumentations; - mapRouteProperties2 = (route) => { - return { - ..._mapRouteProperties(route), - ...getRouteInstrumentationUpdates( - instrumentations.map((i) => i.route).filter(Boolean), - route - ) - }; - }; - } - let dataRoutes = convertRoutesToDataRoutes( - routes, - mapRouteProperties2, - void 0, - manifest - ); - async function query(request, { - requestContext, - filterMatchesToLoad, - skipLoaderErrorBubbling, - skipRevalidation, - dataStrategy, - generateMiddlewareResponse - } = {}) { - let url = new URL(request.url); - let method = request.method; - let location2 = createLocation("", createPath(url), null, "default"); - let matches = matchRoutes(dataRoutes, location2, basename); - requestContext = requestContext != null ? requestContext : new RouterContextProvider(); - if (!isValidMethod(method) && method !== "HEAD") { - let error = getInternalRouterError(405, { method }); - let { matches: methodNotAllowedMatches, route } = getShortCircuitMatches(dataRoutes); - let staticContext = { - basename, - location: location2, - matches: methodNotAllowedMatches, - loaderData: {}, - actionData: null, - errors: { - [route.id]: error - }, - statusCode: error.status, - loaderHeaders: {}, - actionHeaders: {} - }; - return generateMiddlewareResponse ? generateMiddlewareResponse(() => Promise.resolve(staticContext)) : staticContext; - } else if (!matches) { - let error = getInternalRouterError(404, { pathname: location2.pathname }); - let { matches: notFoundMatches, route } = getShortCircuitMatches(dataRoutes); - let staticContext = { - basename, - location: location2, - matches: notFoundMatches, - loaderData: {}, - actionData: null, - errors: { - [route.id]: error - }, - statusCode: error.status, - loaderHeaders: {}, - actionHeaders: {} - }; - return generateMiddlewareResponse ? generateMiddlewareResponse(() => Promise.resolve(staticContext)) : staticContext; - } - if (generateMiddlewareResponse) { - invariant( - requestContext instanceof RouterContextProvider, - "When using middleware in `staticHandler.query()`, any provided `requestContext` must be an instance of `RouterContextProvider`" - ); - try { - await loadLazyMiddlewareForMatches( - matches, - manifest, - mapRouteProperties2 - ); - let renderedStaticContext; - let response = await runServerMiddlewarePipeline( - { - request, - unstable_pattern: getRoutePattern(matches), - matches, - params: matches[0].params, - // If we're calling middleware then it must be enabled so we can cast - // this to the proper type knowing it's not an `AppLoadContext` - context: requestContext - }, - async () => { - let res = await generateMiddlewareResponse( - async (revalidationRequest, opts2 = {}) => { - let result2 = await queryImpl( - revalidationRequest, - location2, - matches, - requestContext, - dataStrategy || null, - skipLoaderErrorBubbling === true, - null, - "filterMatchesToLoad" in opts2 ? opts2.filterMatchesToLoad ?? null : filterMatchesToLoad ?? null, - skipRevalidation === true - ); - if (isResponse(result2)) { - return result2; - } - renderedStaticContext = { location: location2, basename, ...result2 }; - return renderedStaticContext; - } - ); - return res; - }, - async (error, routeId) => { - if (isRedirectResponse(error)) { - return error; - } - if (isResponse(error)) { - try { - error = new ErrorResponseImpl( - error.status, - error.statusText, - await parseResponseBody(error) - ); - } catch (e) { - error = e; - } - } - if (isDataWithResponseInit(error)) { - error = dataWithResponseInitToErrorResponse(error); - } - if (renderedStaticContext) { - if (routeId in renderedStaticContext.loaderData) { - renderedStaticContext.loaderData[routeId] = void 0; - } - let staticContext = getStaticContextFromError( - dataRoutes, - renderedStaticContext, - error, - skipLoaderErrorBubbling ? routeId : findNearestBoundary(matches, routeId).route.id - ); - return generateMiddlewareResponse( - () => Promise.resolve(staticContext) - ); - } else { - let boundaryRouteId = skipLoaderErrorBubbling ? routeId : findNearestBoundary( - matches, - matches.find( - (m) => m.route.id === routeId || m.route.loader - )?.route.id || routeId - ).route.id; - let staticContext = { - matches, - location: location2, - basename, - loaderData: {}, - actionData: null, - errors: { - [boundaryRouteId]: error - }, - statusCode: isRouteErrorResponse(error) ? error.status : 500, - actionHeaders: {}, - loaderHeaders: {} - }; - return generateMiddlewareResponse( - () => Promise.resolve(staticContext) - ); - } - } - ); - invariant(isResponse(response), "Expected a response in query()"); - return response; - } catch (e) { - if (isResponse(e)) { - return e; - } - throw e; - } - } - let result = await queryImpl( - request, - location2, - matches, - requestContext, - dataStrategy || null, - skipLoaderErrorBubbling === true, - null, - filterMatchesToLoad || null, - skipRevalidation === true - ); - if (isResponse(result)) { - return result; - } - return { location: location2, basename, ...result }; - } - async function queryRoute(request, { - routeId, - requestContext, - dataStrategy, - generateMiddlewareResponse - } = {}) { - let url = new URL(request.url); - let method = request.method; - let location2 = createLocation("", createPath(url), null, "default"); - let matches = matchRoutes(dataRoutes, location2, basename); - requestContext = requestContext != null ? requestContext : new RouterContextProvider(); - if (!isValidMethod(method) && method !== "HEAD" && method !== "OPTIONS") { - throw getInternalRouterError(405, { method }); - } else if (!matches) { - throw getInternalRouterError(404, { pathname: location2.pathname }); - } - let match = routeId ? matches.find((m) => m.route.id === routeId) : getTargetMatch(matches, location2); - if (routeId && !match) { - throw getInternalRouterError(403, { - pathname: location2.pathname, - routeId - }); - } else if (!match) { - throw getInternalRouterError(404, { pathname: location2.pathname }); - } - if (generateMiddlewareResponse) { - invariant( - requestContext instanceof RouterContextProvider, - "When using middleware in `staticHandler.queryRoute()`, any provided `requestContext` must be an instance of `RouterContextProvider`" - ); - await loadLazyMiddlewareForMatches(matches, manifest, mapRouteProperties2); - let response = await runServerMiddlewarePipeline( - { - request, - unstable_pattern: getRoutePattern(matches), - matches, - params: matches[0].params, - // If we're calling middleware then it must be enabled so we can cast - // this to the proper type knowing it's not an `AppLoadContext` - context: requestContext - }, - async () => { - let res = await generateMiddlewareResponse( - async (innerRequest) => { - let result2 = await queryImpl( - innerRequest, - location2, - matches, - requestContext, - dataStrategy || null, - false, - match, - null, - false - ); - let processed = handleQueryResult(result2); - return isResponse(processed) ? processed : typeof processed === "string" ? new Response(processed) : Response.json(processed); - } - ); - return res; - }, - (error) => { - if (isDataWithResponseInit(error)) { - return Promise.resolve(dataWithResponseInitToResponse(error)); - } - if (isResponse(error)) { - return Promise.resolve(error); - } - throw error; - } - ); - return response; - } - let result = await queryImpl( - request, - location2, - matches, - requestContext, - dataStrategy || null, - false, - match, - null, - false - ); - return handleQueryResult(result); - function handleQueryResult(result2) { - if (isResponse(result2)) { - return result2; - } - let error = result2.errors ? Object.values(result2.errors)[0] : void 0; - if (error !== void 0) { - throw error; - } - if (result2.actionData) { - return Object.values(result2.actionData)[0]; - } - if (result2.loaderData) { - return Object.values(result2.loaderData)[0]; - } - return void 0; - } - } - async function queryImpl(request, location2, matches, requestContext, dataStrategy, skipLoaderErrorBubbling, routeMatch, filterMatchesToLoad, skipRevalidation) { - invariant( - request.signal, - "query()/queryRoute() requests must contain an AbortController signal" - ); - try { - if (isMutationMethod(request.method)) { - let result2 = await submit( - request, - matches, - routeMatch || getTargetMatch(matches, location2), - requestContext, - dataStrategy, - skipLoaderErrorBubbling, - routeMatch != null, - filterMatchesToLoad, - skipRevalidation - ); - return result2; - } - let result = await loadRouteData( - request, - matches, - requestContext, - dataStrategy, - skipLoaderErrorBubbling, - routeMatch, - filterMatchesToLoad - ); - return isResponse(result) ? result : { - ...result, - actionData: null, - actionHeaders: {} - }; - } catch (e) { - if (isDataStrategyResult(e) && isResponse(e.result)) { - if (e.type === "error") { - throw e.result; - } - return e.result; - } - if (isRedirectResponse(e)) { - return e; - } - throw e; - } - } - async function submit(request, matches, actionMatch, requestContext, dataStrategy, skipLoaderErrorBubbling, isRouteRequest, filterMatchesToLoad, skipRevalidation) { - let result; - if (!actionMatch.route.action && !actionMatch.route.lazy) { - let error = getInternalRouterError(405, { - method: request.method, - pathname: new URL(request.url).pathname, - routeId: actionMatch.route.id - }); - if (isRouteRequest) { - throw error; - } - result = { - type: "error", - error - }; - } else { - let dsMatches = getTargetedDataStrategyMatches( - mapRouteProperties2, - manifest, - request, - matches, - actionMatch, - [], - requestContext - ); - let results = await callDataStrategy( - request, - dsMatches, - isRouteRequest, - requestContext, - dataStrategy - ); - result = results[actionMatch.route.id]; - if (request.signal.aborted) { - throwStaticHandlerAbortedError(request, isRouteRequest); - } - } - if (isRedirectResult(result)) { - throw new Response(null, { - status: result.response.status, - headers: { - Location: result.response.headers.get("Location") - } - }); - } - if (isRouteRequest) { - if (isErrorResult(result)) { - throw result.error; - } - return { - matches: [actionMatch], - loaderData: {}, - actionData: { [actionMatch.route.id]: result.data }, - errors: null, - // Note: statusCode + headers are unused here since queryRoute will - // return the raw Response or value - statusCode: 200, - loaderHeaders: {}, - actionHeaders: {} - }; - } - if (skipRevalidation) { - if (isErrorResult(result)) { - let boundaryMatch = skipLoaderErrorBubbling ? actionMatch : findNearestBoundary(matches, actionMatch.route.id); - return { - statusCode: isRouteErrorResponse(result.error) ? result.error.status : result.statusCode != null ? result.statusCode : 500, - actionData: null, - actionHeaders: { - ...result.headers ? { [actionMatch.route.id]: result.headers } : {} - }, - matches, - loaderData: {}, - errors: { - [boundaryMatch.route.id]: result.error - }, - loaderHeaders: {} - }; - } else { - return { - actionData: { - [actionMatch.route.id]: result.data - }, - actionHeaders: result.headers ? { [actionMatch.route.id]: result.headers } : {}, - matches, - loaderData: {}, - errors: null, - statusCode: result.statusCode || 200, - loaderHeaders: {} - }; - } - } - let loaderRequest = new Request(request.url, { - headers: request.headers, - redirect: request.redirect, - signal: request.signal - }); - if (isErrorResult(result)) { - let boundaryMatch = skipLoaderErrorBubbling ? actionMatch : findNearestBoundary(matches, actionMatch.route.id); - let handlerContext2 = await loadRouteData( - loaderRequest, - matches, - requestContext, - dataStrategy, - skipLoaderErrorBubbling, - null, - filterMatchesToLoad, - [boundaryMatch.route.id, result] - ); - return { - ...handlerContext2, - statusCode: isRouteErrorResponse(result.error) ? result.error.status : result.statusCode != null ? result.statusCode : 500, - actionData: null, - actionHeaders: { - ...result.headers ? { [actionMatch.route.id]: result.headers } : {} - } - }; - } - let handlerContext = await loadRouteData( - loaderRequest, - matches, - requestContext, - dataStrategy, - skipLoaderErrorBubbling, - null, - filterMatchesToLoad - ); - return { - ...handlerContext, - actionData: { - [actionMatch.route.id]: result.data - }, - // action status codes take precedence over loader status codes - ...result.statusCode ? { statusCode: result.statusCode } : {}, - actionHeaders: result.headers ? { [actionMatch.route.id]: result.headers } : {} - }; - } - async function loadRouteData(request, matches, requestContext, dataStrategy, skipLoaderErrorBubbling, routeMatch, filterMatchesToLoad, pendingActionResult) { - let isRouteRequest = routeMatch != null; - if (isRouteRequest && !routeMatch?.route.loader && !routeMatch?.route.lazy) { - throw getInternalRouterError(400, { - method: request.method, - pathname: new URL(request.url).pathname, - routeId: routeMatch?.route.id - }); - } - let dsMatches; - if (routeMatch) { - dsMatches = getTargetedDataStrategyMatches( - mapRouteProperties2, - manifest, - request, - matches, - routeMatch, - [], - requestContext - ); - } else { - let maxIdx = pendingActionResult && isErrorResult(pendingActionResult[1]) ? ( - // Up to but not including the boundary - matches.findIndex((m) => m.route.id === pendingActionResult[0]) - 1 - ) : void 0; - let pattern = getRoutePattern(matches); - dsMatches = matches.map((match, index) => { - if (maxIdx != null && index > maxIdx) { - return getDataStrategyMatch( - mapRouteProperties2, - manifest, - request, - pattern, - match, - [], - requestContext, - false - ); - } - return getDataStrategyMatch( - mapRouteProperties2, - manifest, - request, - pattern, - match, - [], - requestContext, - (match.route.loader || match.route.lazy) != null && (!filterMatchesToLoad || filterMatchesToLoad(match)) - ); - }); - } - if (!dataStrategy && !dsMatches.some((m) => m.shouldLoad)) { - return { - matches, - loaderData: {}, - errors: pendingActionResult && isErrorResult(pendingActionResult[1]) ? { - [pendingActionResult[0]]: pendingActionResult[1].error - } : null, - statusCode: 200, - loaderHeaders: {} - }; - } - let results = await callDataStrategy( - request, - dsMatches, - isRouteRequest, - requestContext, - dataStrategy - ); - if (request.signal.aborted) { - throwStaticHandlerAbortedError(request, isRouteRequest); - } - let handlerContext = processRouteLoaderData( - matches, - results, - pendingActionResult, - true, - skipLoaderErrorBubbling - ); - return { - ...handlerContext, - matches - }; - } - async function callDataStrategy(request, matches, isRouteRequest, requestContext, dataStrategy) { - let results = await callDataStrategyImpl( - dataStrategy || defaultDataStrategy, - request, - matches, - null, - requestContext, - true - ); - let dataResults = {}; - await Promise.all( - matches.map(async (match) => { - if (!(match.route.id in results)) { - return; - } - let result = results[match.route.id]; - if (isRedirectDataStrategyResult(result)) { - let response = result.result; - throw normalizeRelativeRoutingRedirectResponse( - response, - request, - match.route.id, - matches, - basename - ); - } - if (isRouteRequest) { - if (isResponse(result.result)) { - throw result; - } else if (isDataWithResponseInit(result.result)) { - throw dataWithResponseInitToResponse(result.result); - } - } - dataResults[match.route.id] = await convertDataStrategyResultToDataResult(result); - }) - ); - return dataResults; - } - return { - dataRoutes, - query, - queryRoute - }; -} -function getStaticContextFromError(routes, handlerContext, error, boundaryId) { - let errorBoundaryId = boundaryId || handlerContext._deepestRenderedBoundaryId || routes[0].id; - return { - ...handlerContext, - statusCode: isRouteErrorResponse(error) ? error.status : 500, - errors: { - [errorBoundaryId]: error - } - }; -} -function throwStaticHandlerAbortedError(request, isRouteRequest) { - if (request.signal.reason !== void 0) { - throw request.signal.reason; - } - let method = isRouteRequest ? "queryRoute" : "query"; - throw new Error( - `${method}() call aborted without an \`AbortSignal.reason\`: ${request.method} ${request.url}` - ); -} -function isSubmissionNavigation(opts) { - return opts != null && ("formData" in opts && opts.formData != null || "body" in opts && opts.body !== void 0); -} -function normalizeTo(location2, matches, basename, to, fromRouteId, relative) { - let contextualMatches; - let activeRouteMatch; - if (fromRouteId) { - contextualMatches = []; - for (let match of matches) { - contextualMatches.push(match); - if (match.route.id === fromRouteId) { - activeRouteMatch = match; - break; - } - } - } else { - contextualMatches = matches; - activeRouteMatch = matches[matches.length - 1]; - } - let path = resolveTo( - to ? to : ".", - getResolveToMatches(contextualMatches), - stripBasename(location2.pathname, basename) || location2.pathname, - relative === "path" - ); - if (to == null) { - path.search = location2.search; - path.hash = location2.hash; - } - if ((to == null || to === "" || to === ".") && activeRouteMatch) { - let nakedIndex = hasNakedIndexQuery(path.search); - if (activeRouteMatch.route.index && !nakedIndex) { - path.search = path.search ? path.search.replace(/^\?/, "?index&") : "?index"; - } else if (!activeRouteMatch.route.index && nakedIndex) { - let params = new URLSearchParams(path.search); - let indexValues = params.getAll("index"); - params.delete("index"); - indexValues.filter((v) => v).forEach((v) => params.append("index", v)); - let qs = params.toString(); - path.search = qs ? `?${qs}` : ""; - } - } - if (basename !== "/") { - path.pathname = prependBasename({ basename, pathname: path.pathname }); - } - return createPath(path); -} -function normalizeNavigateOptions(isFetcher, path, opts) { - if (!opts || !isSubmissionNavigation(opts)) { - return { path }; - } - if (opts.formMethod && !isValidMethod(opts.formMethod)) { - return { - path, - error: getInternalRouterError(405, { method: opts.formMethod }) - }; - } - let getInvalidBodyError = () => ({ - path, - error: getInternalRouterError(400, { type: "invalid-body" }) - }); - let rawFormMethod = opts.formMethod || "get"; - let formMethod = rawFormMethod.toUpperCase(); - let formAction = stripHashFromPath(path); - if (opts.body !== void 0) { - if (opts.formEncType === "text/plain") { - if (!isMutationMethod(formMethod)) { - return getInvalidBodyError(); - } - let text = typeof opts.body === "string" ? opts.body : opts.body instanceof FormData || opts.body instanceof URLSearchParams ? ( - // https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#plain-text-form-data - Array.from(opts.body.entries()).reduce( - (acc, [name, value]) => `${acc}${name}=${value} -`, - "" - ) - ) : String(opts.body); - return { - path, - submission: { - formMethod, - formAction, - formEncType: opts.formEncType, - formData: void 0, - json: void 0, - text - } - }; - } else if (opts.formEncType === "application/json") { - if (!isMutationMethod(formMethod)) { - return getInvalidBodyError(); - } - try { - let json = typeof opts.body === "string" ? JSON.parse(opts.body) : opts.body; - return { - path, - submission: { - formMethod, - formAction, - formEncType: opts.formEncType, - formData: void 0, - json, - text: void 0 - } - }; - } catch (e) { - return getInvalidBodyError(); - } - } - } - invariant( - typeof FormData === "function", - "FormData is not available in this environment" - ); - let searchParams; - let formData; - if (opts.formData) { - searchParams = convertFormDataToSearchParams(opts.formData); - formData = opts.formData; - } else if (opts.body instanceof FormData) { - searchParams = convertFormDataToSearchParams(opts.body); - formData = opts.body; - } else if (opts.body instanceof URLSearchParams) { - searchParams = opts.body; - formData = convertSearchParamsToFormData(searchParams); - } else if (opts.body == null) { - searchParams = new URLSearchParams(); - formData = new FormData(); - } else { - try { - searchParams = new URLSearchParams(opts.body); - formData = convertSearchParamsToFormData(searchParams); - } catch (e) { - return getInvalidBodyError(); - } - } - let submission = { - formMethod, - formAction, - formEncType: opts && opts.formEncType || "application/x-www-form-urlencoded", - formData, - json: void 0, - text: void 0 - }; - if (isMutationMethod(submission.formMethod)) { - return { path, submission }; - } - let parsedPath = parsePath(path); - if (isFetcher && parsedPath.search && hasNakedIndexQuery(parsedPath.search)) { - searchParams.append("index", ""); - } - parsedPath.search = `?${searchParams}`; - return { path: createPath(parsedPath), submission }; -} -function getMatchesToLoad(request, scopedContext, mapRouteProperties2, manifest, history, state, matches, submission, location2, lazyRoutePropertiesToSkip, initialHydration, isRevalidationRequired, cancelledFetcherLoads, fetchersQueuedForDeletion, fetchLoadMatches, fetchRedirectIds, routesToUse, basename, hasPatchRoutesOnNavigation, pendingActionResult, callSiteDefaultShouldRevalidate) { - let actionResult = pendingActionResult ? isErrorResult(pendingActionResult[1]) ? pendingActionResult[1].error : pendingActionResult[1].data : void 0; - let currentUrl = history.createURL(state.location); - let nextUrl = history.createURL(location2); - let maxIdx; - if (initialHydration && state.errors) { - let boundaryId = Object.keys(state.errors)[0]; - maxIdx = matches.findIndex((m) => m.route.id === boundaryId); - } else if (pendingActionResult && isErrorResult(pendingActionResult[1])) { - let boundaryId = pendingActionResult[0]; - maxIdx = matches.findIndex((m) => m.route.id === boundaryId) - 1; - } - let actionStatus = pendingActionResult ? pendingActionResult[1].statusCode : void 0; - let shouldSkipRevalidation = actionStatus && actionStatus >= 400; - let baseShouldRevalidateArgs = { - currentUrl, - currentParams: state.matches[0]?.params || {}, - nextUrl, - nextParams: matches[0].params, - ...submission, - actionResult, - actionStatus - }; - let pattern = getRoutePattern(matches); - let dsMatches = matches.map((match, index) => { - let { route } = match; - let forceShouldLoad = null; - if (maxIdx != null && index > maxIdx) { - forceShouldLoad = false; - } else if (route.lazy) { - forceShouldLoad = true; - } else if (!routeHasLoaderOrMiddleware(route)) { - forceShouldLoad = false; - } else if (initialHydration) { - forceShouldLoad = shouldLoadRouteOnHydration( - route, - state.loaderData, - state.errors - ); - } else if (isNewLoader(state.loaderData, state.matches[index], match)) { - forceShouldLoad = true; - } - if (forceShouldLoad !== null) { - return getDataStrategyMatch( - mapRouteProperties2, - manifest, - request, - pattern, - match, - lazyRoutePropertiesToSkip, - scopedContext, - forceShouldLoad - ); - } - let defaultShouldRevalidate = false; - if (typeof callSiteDefaultShouldRevalidate === "boolean") { - defaultShouldRevalidate = callSiteDefaultShouldRevalidate; - } else if (shouldSkipRevalidation) { - defaultShouldRevalidate = false; - } else if (isRevalidationRequired) { - defaultShouldRevalidate = true; - } else if (currentUrl.pathname + currentUrl.search === nextUrl.pathname + nextUrl.search) { - defaultShouldRevalidate = true; - } else if (currentUrl.search !== nextUrl.search) { - defaultShouldRevalidate = true; - } else if (isNewRouteInstance(state.matches[index], match)) { - defaultShouldRevalidate = true; - } - let shouldRevalidateArgs = { - ...baseShouldRevalidateArgs, - defaultShouldRevalidate - }; - let shouldLoad = shouldRevalidateLoader(match, shouldRevalidateArgs); - return getDataStrategyMatch( - mapRouteProperties2, - manifest, - request, - pattern, - match, - lazyRoutePropertiesToSkip, - scopedContext, - shouldLoad, - shouldRevalidateArgs, - callSiteDefaultShouldRevalidate - ); - }); - let revalidatingFetchers = []; - fetchLoadMatches.forEach((f, key) => { - if (initialHydration || !matches.some((m) => m.route.id === f.routeId) || fetchersQueuedForDeletion.has(key)) { - return; - } - let fetcher = state.fetchers.get(key); - let isMidInitialLoad = fetcher && fetcher.state !== "idle" && fetcher.data === void 0; - let fetcherMatches = matchRoutes(routesToUse, f.path, basename); - if (!fetcherMatches) { - if (hasPatchRoutesOnNavigation && isMidInitialLoad) { - return; - } - revalidatingFetchers.push({ - key, - routeId: f.routeId, - path: f.path, - matches: null, - match: null, - request: null, - controller: null - }); - return; - } - if (fetchRedirectIds.has(key)) { - return; - } - let fetcherMatch = getTargetMatch(fetcherMatches, f.path); - let fetchController = new AbortController(); - let fetchRequest = createClientSideRequest( - history, - f.path, - fetchController.signal - ); - let fetcherDsMatches = null; - if (cancelledFetcherLoads.has(key)) { - cancelledFetcherLoads.delete(key); - fetcherDsMatches = getTargetedDataStrategyMatches( - mapRouteProperties2, - manifest, - fetchRequest, - fetcherMatches, - fetcherMatch, - lazyRoutePropertiesToSkip, - scopedContext - ); - } else if (isMidInitialLoad) { - if (isRevalidationRequired) { - fetcherDsMatches = getTargetedDataStrategyMatches( - mapRouteProperties2, - manifest, - fetchRequest, - fetcherMatches, - fetcherMatch, - lazyRoutePropertiesToSkip, - scopedContext - ); - } - } else { - let defaultShouldRevalidate; - if (typeof callSiteDefaultShouldRevalidate === "boolean") { - defaultShouldRevalidate = callSiteDefaultShouldRevalidate; - } else if (shouldSkipRevalidation) { - defaultShouldRevalidate = false; - } else { - defaultShouldRevalidate = isRevalidationRequired; - } - let shouldRevalidateArgs = { - ...baseShouldRevalidateArgs, - defaultShouldRevalidate - }; - if (shouldRevalidateLoader(fetcherMatch, shouldRevalidateArgs)) { - fetcherDsMatches = getTargetedDataStrategyMatches( - mapRouteProperties2, - manifest, - fetchRequest, - fetcherMatches, - fetcherMatch, - lazyRoutePropertiesToSkip, - scopedContext, - shouldRevalidateArgs - ); - } - } - if (fetcherDsMatches) { - revalidatingFetchers.push({ - key, - routeId: f.routeId, - path: f.path, - matches: fetcherDsMatches, - match: fetcherMatch, - request: fetchRequest, - controller: fetchController - }); - } - }); - return { dsMatches, revalidatingFetchers }; -} -function routeHasLoaderOrMiddleware(route) { - return route.loader != null || route.middleware != null && route.middleware.length > 0; -} -function shouldLoadRouteOnHydration(route, loaderData, errors) { - if (route.lazy) { - return true; - } - if (!routeHasLoaderOrMiddleware(route)) { - return false; - } - let hasData = loaderData != null && route.id in loaderData; - let hasError = errors != null && errors[route.id] !== void 0; - if (!hasData && hasError) { - return false; - } - if (typeof route.loader === "function" && route.loader.hydrate === true) { - return true; - } - return !hasData && !hasError; -} -function isNewLoader(currentLoaderData, currentMatch, match) { - let isNew = ( - // [a] -> [a, b] - !currentMatch || // [a, b] -> [a, c] - match.route.id !== currentMatch.route.id - ); - let isMissingData = !currentLoaderData.hasOwnProperty(match.route.id); - return isNew || isMissingData; -} -function isNewRouteInstance(currentMatch, match) { - let currentPath = currentMatch.route.path; - return ( - // param change for this match, /users/123 -> /users/456 - currentMatch.pathname !== match.pathname || // splat param changed, which is not present in match.path - // e.g. /files/images/avatar.jpg -> files/finances.xls - currentPath != null && currentPath.endsWith("*") && currentMatch.params["*"] !== match.params["*"] - ); -} -function shouldRevalidateLoader(loaderMatch, arg) { - if (loaderMatch.route.shouldRevalidate) { - let routeChoice = loaderMatch.route.shouldRevalidate(arg); - if (typeof routeChoice === "boolean") { - return routeChoice; - } - } - return arg.defaultShouldRevalidate; -} -function patchRoutesImpl(routeId, children, routesToUse, manifest, mapRouteProperties2, allowElementMutations) { - let childrenToPatch; - if (routeId) { - let route = manifest[routeId]; - invariant( - route, - `No route found to patch children into: routeId = ${routeId}` - ); - if (!route.children) { - route.children = []; - } - childrenToPatch = route.children; - } else { - childrenToPatch = routesToUse; - } - let uniqueChildren = []; - let existingChildren = []; - children.forEach((newRoute) => { - let existingRoute = childrenToPatch.find( - (existingRoute2) => isSameRoute(newRoute, existingRoute2) - ); - if (existingRoute) { - existingChildren.push({ existingRoute, newRoute }); - } else { - uniqueChildren.push(newRoute); - } - }); - if (uniqueChildren.length > 0) { - let newRoutes = convertRoutesToDataRoutes( - uniqueChildren, - mapRouteProperties2, - [routeId || "_", "patch", String(childrenToPatch?.length || "0")], - manifest - ); - childrenToPatch.push(...newRoutes); - } - if (allowElementMutations && existingChildren.length > 0) { - for (let i = 0; i < existingChildren.length; i++) { - let { existingRoute, newRoute } = existingChildren[i]; - let existingRouteTyped = existingRoute; - let [newRouteTyped] = convertRoutesToDataRoutes( - [newRoute], - mapRouteProperties2, - [], - // Doesn't matter for mutated routes since they already have an id - {}, - // Don't touch the manifest here since we're updating in place - true - ); - Object.assign(existingRouteTyped, { - element: newRouteTyped.element ? newRouteTyped.element : existingRouteTyped.element, - errorElement: newRouteTyped.errorElement ? newRouteTyped.errorElement : existingRouteTyped.errorElement, - hydrateFallbackElement: newRouteTyped.hydrateFallbackElement ? newRouteTyped.hydrateFallbackElement : existingRouteTyped.hydrateFallbackElement - }); - } - } -} -function isSameRoute(newRoute, existingRoute) { - if ("id" in newRoute && "id" in existingRoute && newRoute.id === existingRoute.id) { - return true; - } - if (!(newRoute.index === existingRoute.index && newRoute.path === existingRoute.path && newRoute.caseSensitive === existingRoute.caseSensitive)) { - return false; - } - if ((!newRoute.children || newRoute.children.length === 0) && (!existingRoute.children || existingRoute.children.length === 0)) { - return true; - } - return newRoute.children.every( - (aChild, i) => existingRoute.children?.some((bChild) => isSameRoute(aChild, bChild)) - ); -} -function loadLazyRoute(route, type, manifest, mapRouteProperties2, lazyRoutePropertiesToSkip) { - let routeToUpdate = manifest[route.id]; - invariant(routeToUpdate, "No route found in manifest"); - if (!route.lazy) { - return { - lazyRoutePromise: void 0, - lazyHandlerPromise: void 0 - }; - } - if (typeof route.lazy === "function") { - let cachedPromise = lazyRouteFunctionCache.get(routeToUpdate); - if (cachedPromise) { - return { - lazyRoutePromise: cachedPromise, - lazyHandlerPromise: cachedPromise - }; - } - let lazyRoutePromise2 = (async () => { - invariant( - typeof route.lazy === "function", - "No lazy route function found" - ); - let lazyRoute = await route.lazy(); - let routeUpdates = {}; - for (let lazyRouteProperty in lazyRoute) { - let lazyValue = lazyRoute[lazyRouteProperty]; - if (lazyValue === void 0) { - continue; - } - let isUnsupported = isUnsupportedLazyRouteFunctionKey(lazyRouteProperty); - let staticRouteValue = routeToUpdate[lazyRouteProperty]; - let isStaticallyDefined = staticRouteValue !== void 0 && // This property isn't static since it should always be updated based - // on the route updates - lazyRouteProperty !== "hasErrorBoundary"; - if (isUnsupported) { - warning( - !isUnsupported, - "Route property " + lazyRouteProperty + " is not a supported property to be returned from a lazy route function. This property will be ignored." - ); - } else if (isStaticallyDefined) { - warning( - !isStaticallyDefined, - `Route "${routeToUpdate.id}" has a static property "${lazyRouteProperty}" defined but its lazy function is also returning a value for this property. The lazy route property "${lazyRouteProperty}" will be ignored.` - ); - } else { - routeUpdates[lazyRouteProperty] = lazyValue; - } - } - Object.assign(routeToUpdate, routeUpdates); - Object.assign(routeToUpdate, { - // To keep things framework agnostic, we use the provided `mapRouteProperties` - // function to set the framework-aware properties (`element`/`hasErrorBoundary`) - // since the logic will differ between frameworks. - ...mapRouteProperties2(routeToUpdate), - lazy: void 0 - }); - })(); - lazyRouteFunctionCache.set(routeToUpdate, lazyRoutePromise2); - lazyRoutePromise2.catch(() => { - }); - return { - lazyRoutePromise: lazyRoutePromise2, - lazyHandlerPromise: lazyRoutePromise2 - }; - } - let lazyKeys = Object.keys(route.lazy); - let lazyPropertyPromises = []; - let lazyHandlerPromise = void 0; - for (let key of lazyKeys) { - if (lazyRoutePropertiesToSkip && lazyRoutePropertiesToSkip.includes(key)) { - continue; - } - let promise = loadLazyRouteProperty({ - key, - route, - manifest, - mapRouteProperties: mapRouteProperties2 - }); - if (promise) { - lazyPropertyPromises.push(promise); - if (key === type) { - lazyHandlerPromise = promise; - } - } - } - let lazyRoutePromise = lazyPropertyPromises.length > 0 ? Promise.all(lazyPropertyPromises).then(() => { - }) : void 0; - lazyRoutePromise?.catch(() => { - }); - lazyHandlerPromise?.catch(() => { - }); - return { - lazyRoutePromise, - lazyHandlerPromise - }; -} -function isNonNullable(value) { - return value !== void 0; -} -function loadLazyMiddlewareForMatches(matches, manifest, mapRouteProperties2) { - let promises = matches.map(({ route }) => { - if (typeof route.lazy !== "object" || !route.lazy.middleware) { - return void 0; - } - return loadLazyRouteProperty({ - key: "middleware", - route, - manifest, - mapRouteProperties: mapRouteProperties2 - }); - }).filter(isNonNullable); - return promises.length > 0 ? Promise.all(promises) : void 0; -} -async function defaultDataStrategy(args) { - let matchesToLoad = args.matches.filter((m) => m.shouldLoad); - let keyedResults = {}; - let results = await Promise.all(matchesToLoad.map((m) => m.resolve())); - results.forEach((result, i) => { - keyedResults[matchesToLoad[i].route.id] = result; - }); - return keyedResults; -} -async function defaultDataStrategyWithMiddleware(args) { - if (!args.matches.some((m) => m.route.middleware)) { - return defaultDataStrategy(args); - } - return runClientMiddlewarePipeline(args, () => defaultDataStrategy(args)); -} -function runServerMiddlewarePipeline(args, handler, errorHandler) { - return runMiddlewarePipeline( - args, - handler, - processResult, - isResponse, - errorHandler - ); - function processResult(result) { - return isDataWithResponseInit(result) ? dataWithResponseInitToResponse(result) : result; - } -} -function runClientMiddlewarePipeline(args, handler) { - return runMiddlewarePipeline( - args, - handler, - (r) => { - if (isRedirectResponse(r)) { - throw r; - } - return r; - }, - isDataStrategyResults, - errorHandler - ); - function errorHandler(error, routeId, nextResult) { - if (nextResult) { - return Promise.resolve( - Object.assign(nextResult.value, { - [routeId]: { type: "error", result: error } - }) - ); - } else { - let { matches } = args; - let maxBoundaryIdx = Math.min( - // Throwing route - Math.max( - matches.findIndex((m) => m.route.id === routeId), - 0 - ), - // or the shallowest route that needs to load data - Math.max( - matches.findIndex((m) => m.shouldCallHandler()), - 0 - ) - ); - let boundaryRouteId = findNearestBoundary( - matches, - matches[maxBoundaryIdx].route.id - ).route.id; - return Promise.resolve({ - [boundaryRouteId]: { type: "error", result: error } - }); - } - } -} -async function runMiddlewarePipeline(args, handler, processResult, isResult, errorHandler) { - let { matches, request, params, context, unstable_pattern } = args; - let tuples = matches.flatMap( - (m) => m.route.middleware ? m.route.middleware.map((fn) => [m.route.id, fn]) : [] - ); - let result = await callRouteMiddleware( - { - request, - params, - context, - unstable_pattern - }, - tuples, - handler, - processResult, - isResult, - errorHandler - ); - return result; -} -async function callRouteMiddleware(args, middlewares, handler, processResult, isResult, errorHandler, idx = 0) { - let { request } = args; - if (request.signal.aborted) { - throw request.signal.reason ?? new Error(`Request aborted: ${request.method} ${request.url}`); - } - let tuple = middlewares[idx]; - if (!tuple) { - let result = await handler(); - return result; - } - let [routeId, middleware] = tuple; - let nextResult; - let next = async () => { - if (nextResult) { - throw new Error("You may only call `next()` once per middleware"); - } - try { - let result = await callRouteMiddleware( - args, - middlewares, - handler, - processResult, - isResult, - errorHandler, - idx + 1 - ); - nextResult = { value: result }; - return nextResult.value; - } catch (error) { - nextResult = { value: await errorHandler(error, routeId, nextResult) }; - return nextResult.value; - } - }; - try { - let value = await middleware(args, next); - let result = value != null ? processResult(value) : void 0; - if (isResult(result)) { - return result; - } else if (nextResult) { - return result ?? nextResult.value; - } else { - nextResult = { value: await next() }; - return nextResult.value; - } - } catch (error) { - let response = await errorHandler(error, routeId, nextResult); - return response; - } -} -function getDataStrategyMatchLazyPromises(mapRouteProperties2, manifest, request, match, lazyRoutePropertiesToSkip) { - let lazyMiddlewarePromise = loadLazyRouteProperty({ - key: "middleware", - route: match.route, - manifest, - mapRouteProperties: mapRouteProperties2 - }); - let lazyRoutePromises = loadLazyRoute( - match.route, - isMutationMethod(request.method) ? "action" : "loader", - manifest, - mapRouteProperties2, - lazyRoutePropertiesToSkip - ); - return { - middleware: lazyMiddlewarePromise, - route: lazyRoutePromises.lazyRoutePromise, - handler: lazyRoutePromises.lazyHandlerPromise - }; -} -function getDataStrategyMatch(mapRouteProperties2, manifest, request, unstable_pattern, match, lazyRoutePropertiesToSkip, scopedContext, shouldLoad, shouldRevalidateArgs = null, callSiteDefaultShouldRevalidate) { - let isUsingNewApi = false; - let _lazyPromises = getDataStrategyMatchLazyPromises( - mapRouteProperties2, - manifest, - request, - match, - lazyRoutePropertiesToSkip - ); - return { - ...match, - _lazyPromises, - shouldLoad, - shouldRevalidateArgs, - shouldCallHandler(defaultShouldRevalidate) { - isUsingNewApi = true; - if (!shouldRevalidateArgs) { - return shouldLoad; - } - if (typeof callSiteDefaultShouldRevalidate === "boolean") { - return shouldRevalidateLoader(match, { - ...shouldRevalidateArgs, - defaultShouldRevalidate: callSiteDefaultShouldRevalidate - }); - } - if (typeof defaultShouldRevalidate === "boolean") { - return shouldRevalidateLoader(match, { - ...shouldRevalidateArgs, - defaultShouldRevalidate - }); - } - return shouldRevalidateLoader(match, shouldRevalidateArgs); - }, - resolve(handlerOverride) { - let { lazy, loader, middleware } = match.route; - let callHandler = isUsingNewApi || shouldLoad || handlerOverride && !isMutationMethod(request.method) && (lazy || loader); - let isMiddlewareOnlyRoute = middleware && middleware.length > 0 && !loader && !lazy; - if (callHandler && (isMutationMethod(request.method) || !isMiddlewareOnlyRoute)) { - return callLoaderOrAction({ - request, - unstable_pattern, - match, - lazyHandlerPromise: _lazyPromises?.handler, - lazyRoutePromise: _lazyPromises?.route, - handlerOverride, - scopedContext - }); - } - return Promise.resolve({ type: "data", result: void 0 }); - } - }; -} -function getTargetedDataStrategyMatches(mapRouteProperties2, manifest, request, matches, targetMatch, lazyRoutePropertiesToSkip, scopedContext, shouldRevalidateArgs = null) { - return matches.map((match) => { - if (match.route.id !== targetMatch.route.id) { - return { - ...match, - shouldLoad: false, - shouldRevalidateArgs, - shouldCallHandler: () => false, - _lazyPromises: getDataStrategyMatchLazyPromises( - mapRouteProperties2, - manifest, - request, - match, - lazyRoutePropertiesToSkip - ), - resolve: () => Promise.resolve({ type: "data", result: void 0 }) - }; - } - return getDataStrategyMatch( - mapRouteProperties2, - manifest, - request, - getRoutePattern(matches), - match, - lazyRoutePropertiesToSkip, - scopedContext, - true, - shouldRevalidateArgs - ); - }); -} -async function callDataStrategyImpl(dataStrategyImpl, request, matches, fetcherKey, scopedContext, isStaticHandler) { - if (matches.some((m) => m._lazyPromises?.middleware)) { - await Promise.all(matches.map((m) => m._lazyPromises?.middleware)); - } - let dataStrategyArgs = { - request, - unstable_pattern: getRoutePattern(matches), - params: matches[0].params, - context: scopedContext, - matches - }; - let runClientMiddleware = isStaticHandler ? () => { - throw new Error( - "You cannot call `runClientMiddleware()` from a static handler `dataStrategy`. Middleware is run outside of `dataStrategy` during SSR in order to bubble up the Response. You can enable middleware via the `respond` API in `query`/`queryRoute`" - ); - } : (cb) => { - let typedDataStrategyArgs = dataStrategyArgs; - return runClientMiddlewarePipeline(typedDataStrategyArgs, () => { - return cb({ - ...typedDataStrategyArgs, - fetcherKey, - runClientMiddleware: () => { - throw new Error( - "Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler" - ); - } - }); - }); - }; - let results = await dataStrategyImpl({ - ...dataStrategyArgs, - fetcherKey, - runClientMiddleware - }); - try { - await Promise.all( - matches.flatMap((m) => [ - m._lazyPromises?.handler, - m._lazyPromises?.route - ]) - ); - } catch (e) { - } - return results; -} -async function callLoaderOrAction({ - request, - unstable_pattern, - match, - lazyHandlerPromise, - lazyRoutePromise, - handlerOverride, - scopedContext -}) { - let result; - let onReject; - let isAction = isMutationMethod(request.method); - let type = isAction ? "action" : "loader"; - let runHandler = (handler) => { - let reject; - let abortPromise = new Promise((_, r) => reject = r); - onReject = () => reject(); - request.signal.addEventListener("abort", onReject); - let actualHandler = (ctx) => { - if (typeof handler !== "function") { - return Promise.reject( - new Error( - `You cannot call the handler for a route which defines a boolean "${type}" [routeId: ${match.route.id}]` - ) - ); - } - return handler( - { - request, - unstable_pattern, - params: match.params, - context: scopedContext - }, - ...ctx !== void 0 ? [ctx] : [] - ); - }; - let handlerPromise = (async () => { - try { - let val = await (handlerOverride ? handlerOverride((ctx) => actualHandler(ctx)) : actualHandler()); - return { type: "data", result: val }; - } catch (e) { - return { type: "error", result: e }; - } - })(); - return Promise.race([handlerPromise, abortPromise]); - }; - try { - let handler = isAction ? match.route.action : match.route.loader; - if (lazyHandlerPromise || lazyRoutePromise) { - if (handler) { - let handlerError; - let [value] = await Promise.all([ - // If the handler throws, don't let it immediately bubble out, - // since we need to let the lazy() execution finish so we know if this - // route has a boundary that can handle the error - runHandler(handler).catch((e) => { - handlerError = e; - }), - // Ensure all lazy route promises are resolved before continuing - lazyHandlerPromise, - lazyRoutePromise - ]); - if (handlerError !== void 0) { - throw handlerError; - } - result = value; - } else { - await lazyHandlerPromise; - let handler2 = isAction ? match.route.action : match.route.loader; - if (handler2) { - [result] = await Promise.all([runHandler(handler2), lazyRoutePromise]); - } else if (type === "action") { - let url = new URL(request.url); - let pathname = url.pathname + url.search; - throw getInternalRouterError(405, { - method: request.method, - pathname, - routeId: match.route.id - }); - } else { - return { type: "data", result: void 0 }; - } - } - } else if (!handler) { - let url = new URL(request.url); - let pathname = url.pathname + url.search; - throw getInternalRouterError(404, { - pathname - }); - } else { - result = await runHandler(handler); - } - } catch (e) { - return { type: "error", result: e }; - } finally { - if (onReject) { - request.signal.removeEventListener("abort", onReject); - } - } - return result; -} -async function parseResponseBody(response) { - let contentType = response.headers.get("Content-Type"); - if (contentType && /\bapplication\/json\b/.test(contentType)) { - return response.body == null ? null : response.json(); - } - return response.text(); -} -async function convertDataStrategyResultToDataResult(dataStrategyResult) { - let { result, type } = dataStrategyResult; - if (isResponse(result)) { - let data2; - try { - data2 = await parseResponseBody(result); - } catch (e) { - return { type: "error", error: e }; - } - if (type === "error") { - return { - type: "error", - error: new ErrorResponseImpl(result.status, result.statusText, data2), - statusCode: result.status, - headers: result.headers - }; - } - return { - type: "data", - data: data2, - statusCode: result.status, - headers: result.headers - }; - } - if (type === "error") { - if (isDataWithResponseInit(result)) { - if (result.data instanceof Error) { - return { - type: "error", - error: result.data, - statusCode: result.init?.status, - headers: result.init?.headers ? new Headers(result.init.headers) : void 0 - }; - } - return { - type: "error", - error: dataWithResponseInitToErrorResponse(result), - statusCode: isRouteErrorResponse(result) ? result.status : void 0, - headers: result.init?.headers ? new Headers(result.init.headers) : void 0 - }; - } - return { - type: "error", - error: result, - statusCode: isRouteErrorResponse(result) ? result.status : void 0 - }; - } - if (isDataWithResponseInit(result)) { - return { - type: "data", - data: result.data, - statusCode: result.init?.status, - headers: result.init?.headers ? new Headers(result.init.headers) : void 0 - }; - } - return { type: "data", data: result }; -} -function normalizeRelativeRoutingRedirectResponse(response, request, routeId, matches, basename) { - let location2 = response.headers.get("Location"); - invariant( - location2, - "Redirects returned/thrown from loaders/actions must have a Location header" - ); - if (!isAbsoluteUrl(location2)) { - let trimmedMatches = matches.slice( - 0, - matches.findIndex((m) => m.route.id === routeId) + 1 - ); - location2 = normalizeTo( - new URL(request.url), - trimmedMatches, - basename, - location2 - ); - response.headers.set("Location", location2); - } - return response; -} -function normalizeRedirectLocation(location2, currentUrl, basename, historyInstance) { - let invalidProtocols = [ - "about:", - "blob:", - "chrome:", - "chrome-untrusted:", - "content:", - "data:", - "devtools:", - "file:", - "filesystem:", - // eslint-disable-next-line no-script-url - "javascript:" - ]; - if (isAbsoluteUrl(location2)) { - let normalizedLocation = location2; - let url = normalizedLocation.startsWith("//") ? new URL(currentUrl.protocol + normalizedLocation) : new URL(normalizedLocation); - if (invalidProtocols.includes(url.protocol)) { - throw new Error("Invalid redirect location"); - } - let isSameBasename = stripBasename(url.pathname, basename) != null; - if (url.origin === currentUrl.origin && isSameBasename) { - return url.pathname + url.search + url.hash; - } - } - try { - let url = historyInstance.createURL(location2); - if (invalidProtocols.includes(url.protocol)) { - throw new Error("Invalid redirect location"); - } - } catch (e) { - } - return location2; -} -function createClientSideRequest(history, location2, signal, submission) { - let url = history.createURL(stripHashFromPath(location2)).toString(); - let init = { signal }; - if (submission && isMutationMethod(submission.formMethod)) { - let { formMethod, formEncType } = submission; - init.method = formMethod.toUpperCase(); - if (formEncType === "application/json") { - init.headers = new Headers({ "Content-Type": formEncType }); - init.body = JSON.stringify(submission.json); - } else if (formEncType === "text/plain") { - init.body = submission.text; - } else if (formEncType === "application/x-www-form-urlencoded" && submission.formData) { - init.body = convertFormDataToSearchParams(submission.formData); - } else { - init.body = submission.formData; - } - } - return new Request(url, init); -} -function convertFormDataToSearchParams(formData) { - let searchParams = new URLSearchParams(); - for (let [key, value] of formData.entries()) { - searchParams.append(key, typeof value === "string" ? value : value.name); - } - return searchParams; -} -function convertSearchParamsToFormData(searchParams) { - let formData = new FormData(); - for (let [key, value] of searchParams.entries()) { - formData.append(key, value); - } - return formData; -} -function processRouteLoaderData(matches, results, pendingActionResult, isStaticHandler = false, skipLoaderErrorBubbling = false) { - let loaderData = {}; - let errors = null; - let statusCode; - let foundError = false; - let loaderHeaders = {}; - let pendingError = pendingActionResult && isErrorResult(pendingActionResult[1]) ? pendingActionResult[1].error : void 0; - matches.forEach((match) => { - if (!(match.route.id in results)) { - return; - } - let id = match.route.id; - let result = results[id]; - invariant( - !isRedirectResult(result), - "Cannot handle redirect results in processLoaderData" - ); - if (isErrorResult(result)) { - let error = result.error; - if (pendingError !== void 0) { - error = pendingError; - pendingError = void 0; - } - errors = errors || {}; - if (skipLoaderErrorBubbling) { - errors[id] = error; - } else { - let boundaryMatch = findNearestBoundary(matches, id); - if (errors[boundaryMatch.route.id] == null) { - errors[boundaryMatch.route.id] = error; - } - } - if (!isStaticHandler) { - loaderData[id] = ResetLoaderDataSymbol; - } - if (!foundError) { - foundError = true; - statusCode = isRouteErrorResponse(result.error) ? result.error.status : 500; - } - if (result.headers) { - loaderHeaders[id] = result.headers; - } - } else { - loaderData[id] = result.data; - if (result.statusCode && result.statusCode !== 200 && !foundError) { - statusCode = result.statusCode; - } - if (result.headers) { - loaderHeaders[id] = result.headers; - } - } - }); - if (pendingError !== void 0 && pendingActionResult) { - errors = { [pendingActionResult[0]]: pendingError }; - if (pendingActionResult[2]) { - loaderData[pendingActionResult[2]] = void 0; - } - } - return { - loaderData, - errors, - statusCode: statusCode || 200, - loaderHeaders - }; -} -function processLoaderData(state, matches, results, pendingActionResult, revalidatingFetchers, fetcherResults) { - let { loaderData, errors } = processRouteLoaderData( - matches, - results, - pendingActionResult - ); - revalidatingFetchers.filter((f) => !f.matches || f.matches.some((m) => m.shouldLoad)).forEach((rf) => { - let { key, match, controller } = rf; - if (controller && controller.signal.aborted) { - return; - } - let result = fetcherResults[key]; - invariant(result, "Did not find corresponding fetcher result"); - if (isErrorResult(result)) { - let boundaryMatch = findNearestBoundary(state.matches, match?.route.id); - if (!(errors && errors[boundaryMatch.route.id])) { - errors = { - ...errors, - [boundaryMatch.route.id]: result.error - }; - } - state.fetchers.delete(key); - } else if (isRedirectResult(result)) { - invariant(false, "Unhandled fetcher revalidation redirect"); - } else { - let doneFetcher = getDoneFetcher(result.data); - state.fetchers.set(key, doneFetcher); - } - }); - return { loaderData, errors }; -} -function mergeLoaderData(loaderData, newLoaderData, matches, errors) { - let mergedLoaderData = Object.entries(newLoaderData).filter(([, v]) => v !== ResetLoaderDataSymbol).reduce((merged, [k, v]) => { - merged[k] = v; - return merged; - }, {}); - for (let match of matches) { - let id = match.route.id; - if (!newLoaderData.hasOwnProperty(id) && loaderData.hasOwnProperty(id) && match.route.loader) { - mergedLoaderData[id] = loaderData[id]; - } - if (errors && errors.hasOwnProperty(id)) { - break; - } - } - return mergedLoaderData; -} -function getActionDataForCommit(pendingActionResult) { - if (!pendingActionResult) { - return {}; - } - return isErrorResult(pendingActionResult[1]) ? { - // Clear out prior actionData on errors - actionData: {} - } : { - actionData: { - [pendingActionResult[0]]: pendingActionResult[1].data - } - }; -} -function findNearestBoundary(matches, routeId) { - let eligibleMatches = routeId ? matches.slice(0, matches.findIndex((m) => m.route.id === routeId) + 1) : [...matches]; - return eligibleMatches.reverse().find((m) => m.route.hasErrorBoundary === true) || matches[0]; -} -function getShortCircuitMatches(routes) { - let route = routes.length === 1 ? routes[0] : routes.find((r) => r.index || !r.path || r.path === "/") || { - id: `__shim-error-route__` - }; - return { - matches: [ - { - params: {}, - pathname: "", - pathnameBase: "", - route - } - ], - route - }; -} -function getInternalRouterError(status, { - pathname, - routeId, - method, - type, - message -} = {}) { - let statusText = "Unknown Server Error"; - let errorMessage = "Unknown @remix-run/router error"; - if (status === 400) { - statusText = "Bad Request"; - if (method && pathname && routeId) { - errorMessage = `You made a ${method} request to "${pathname}" but did not provide a \`loader\` for route "${routeId}", so there is no way to handle the request.`; - } else if (type === "invalid-body") { - errorMessage = "Unable to encode submission body"; - } - } else if (status === 403) { - statusText = "Forbidden"; - errorMessage = `Route "${routeId}" does not match URL "${pathname}"`; - } else if (status === 404) { - statusText = "Not Found"; - errorMessage = `No route matches URL "${pathname}"`; - } else if (status === 405) { - statusText = "Method Not Allowed"; - if (method && pathname && routeId) { - errorMessage = `You made a ${method.toUpperCase()} request to "${pathname}" but did not provide an \`action\` for route "${routeId}", so there is no way to handle the request.`; - } else if (method) { - errorMessage = `Invalid request method "${method.toUpperCase()}"`; - } - } - return new ErrorResponseImpl( - status || 500, - statusText, - new Error(errorMessage), - true - ); -} -function findRedirect(results) { - let entries = Object.entries(results); - for (let i = entries.length - 1; i >= 0; i--) { - let [key, result] = entries[i]; - if (isRedirectResult(result)) { - return { key, result }; - } - } -} -function stripHashFromPath(path) { - let parsedPath = typeof path === "string" ? parsePath(path) : path; - return createPath({ ...parsedPath, hash: "" }); -} -function isHashChangeOnly(a, b) { - if (a.pathname !== b.pathname || a.search !== b.search) { - return false; - } - if (a.hash === "") { - return b.hash !== ""; - } else if (a.hash === b.hash) { - return true; - } else if (b.hash !== "") { - return true; - } - return false; -} -function dataWithResponseInitToResponse(data2) { - return Response.json(data2.data, data2.init ?? void 0); -} -function dataWithResponseInitToErrorResponse(data2) { - return new ErrorResponseImpl( - data2.init?.status ?? 500, - data2.init?.statusText ?? "Internal Server Error", - data2.data - ); -} -function isDataStrategyResults(result) { - return result != null && typeof result === "object" && Object.entries(result).every( - ([key, value]) => typeof key === "string" && isDataStrategyResult(value) - ); -} -function isDataStrategyResult(result) { - return result != null && typeof result === "object" && "type" in result && "result" in result && (result.type === "data" || result.type === "error"); -} -function isRedirectDataStrategyResult(result) { - return isResponse(result.result) && redirectStatusCodes.has(result.result.status); -} -function isErrorResult(result) { - return result.type === "error"; -} -function isRedirectResult(result) { - return (result && result.type) === "redirect"; -} -function isDataWithResponseInit(value) { - return typeof value === "object" && value != null && "type" in value && "data" in value && "init" in value && value.type === "DataWithResponseInit"; -} -function isResponse(value) { - return value != null && typeof value.status === "number" && typeof value.statusText === "string" && typeof value.headers === "object" && typeof value.body !== "undefined"; -} -function isRedirectStatusCode(statusCode) { - return redirectStatusCodes.has(statusCode); -} -function isRedirectResponse(result) { - return isResponse(result) && isRedirectStatusCode(result.status) && result.headers.has("Location"); -} -function isValidMethod(method) { - return validRequestMethods.has(method.toUpperCase()); -} -function isMutationMethod(method) { - return validMutationMethods.has(method.toUpperCase()); -} -function hasNakedIndexQuery(search) { - return new URLSearchParams(search).getAll("index").some((v) => v === ""); -} -function getTargetMatch(matches, location2) { - let search = typeof location2 === "string" ? parsePath(location2).search : location2.search; - if (matches[matches.length - 1].route.index && hasNakedIndexQuery(search || "")) { - return matches[matches.length - 1]; - } - let pathMatches = getPathContributingMatches(matches); - return pathMatches[pathMatches.length - 1]; -} -function getSubmissionFromNavigation(navigation) { - let { formMethod, formAction, formEncType, text, formData, json } = navigation; - if (!formMethod || !formAction || !formEncType) { - return; - } - if (text != null) { - return { - formMethod, - formAction, - formEncType, - formData: void 0, - json: void 0, - text - }; - } else if (formData != null) { - return { - formMethod, - formAction, - formEncType, - formData, - json: void 0, - text: void 0 - }; - } else if (json !== void 0) { - return { - formMethod, - formAction, - formEncType, - formData: void 0, - json, - text: void 0 - }; - } -} -function getLoadingNavigation(location2, submission) { - if (submission) { - let navigation = { - state: "loading", - location: location2, - formMethod: submission.formMethod, - formAction: submission.formAction, - formEncType: submission.formEncType, - formData: submission.formData, - json: submission.json, - text: submission.text - }; - return navigation; - } else { - let navigation = { - state: "loading", - location: location2, - formMethod: void 0, - formAction: void 0, - formEncType: void 0, - formData: void 0, - json: void 0, - text: void 0 - }; - return navigation; - } -} -function getSubmittingNavigation(location2, submission) { - let navigation = { - state: "submitting", - location: location2, - formMethod: submission.formMethod, - formAction: submission.formAction, - formEncType: submission.formEncType, - formData: submission.formData, - json: submission.json, - text: submission.text - }; - return navigation; -} -function getLoadingFetcher(submission, data2) { - if (submission) { - let fetcher = { - state: "loading", - formMethod: submission.formMethod, - formAction: submission.formAction, - formEncType: submission.formEncType, - formData: submission.formData, - json: submission.json, - text: submission.text, - data: data2 - }; - return fetcher; - } else { - let fetcher = { - state: "loading", - formMethod: void 0, - formAction: void 0, - formEncType: void 0, - formData: void 0, - json: void 0, - text: void 0, - data: data2 - }; - return fetcher; - } -} -function getSubmittingFetcher(submission, existingFetcher) { - let fetcher = { - state: "submitting", - formMethod: submission.formMethod, - formAction: submission.formAction, - formEncType: submission.formEncType, - formData: submission.formData, - json: submission.json, - text: submission.text, - data: existingFetcher ? existingFetcher.data : void 0 - }; - return fetcher; -} -function getDoneFetcher(data2) { - let fetcher = { - state: "idle", - formMethod: void 0, - formAction: void 0, - formEncType: void 0, - formData: void 0, - json: void 0, - text: void 0, - data: data2 - }; - return fetcher; -} -function restoreAppliedTransitions(_window, transitions) { - try { - let sessionPositions = _window.sessionStorage.getItem( - TRANSITIONS_STORAGE_KEY - ); - if (sessionPositions) { - let json = JSON.parse(sessionPositions); - for (let [k, v] of Object.entries(json || {})) { - if (v && Array.isArray(v)) { - transitions.set(k, new Set(v || [])); - } - } - } - } catch (e) { - } -} -function persistAppliedTransitions(_window, transitions) { - if (transitions.size > 0) { - let json = {}; - for (let [k, v] of transitions) { - json[k] = [...v]; - } - try { - _window.sessionStorage.setItem( - TRANSITIONS_STORAGE_KEY, - JSON.stringify(json) - ); - } catch (error) { - warning( - false, - `Failed to save applied view transitions in sessionStorage (${error}).` - ); - } - } -} -function createDeferred() { - let resolve; - let reject; - let promise = new Promise((res, rej) => { - resolve = async (val) => { - res(val); - try { - await promise; - } catch (e) { - } - }; - reject = async (error) => { - rej(error); - try { - await promise; - } catch (e) { - } - }; - }); - return { - promise, - //@ts-ignore - resolve, - //@ts-ignore - reject - }; -} -function useIsRSCRouterContext() { - return React.useContext(RSCRouterContext); -} -function decodeRedirectErrorDigest(digest) { - if (digest.startsWith(`${ERROR_DIGEST_BASE}:${ERROR_DIGEST_REDIRECT}:{`)) { - try { - let parsed = JSON.parse(digest.slice(28)); - if (typeof parsed === "object" && parsed && typeof parsed.status === "number" && typeof parsed.statusText === "string" && typeof parsed.location === "string" && typeof parsed.reloadDocument === "boolean" && typeof parsed.replace === "boolean") { - return parsed; - } - } catch { - } - } -} -function decodeRouteErrorResponseDigest(digest) { - if (digest.startsWith( - `${ERROR_DIGEST_BASE}:${ERROR_DIGEST_ROUTE_ERROR_RESPONSE}:{` - )) { - try { - let parsed = JSON.parse(digest.slice(40)); - if (typeof parsed === "object" && parsed && typeof parsed.status === "number" && typeof parsed.statusText === "string") { - return new ErrorResponseImpl( - parsed.status, - parsed.statusText, - parsed.data - ); - } - } catch { - } - } -} -function useHref(to, { relative } = {}) { - invariant( - useInRouterContext(), - // TODO: This error is probably because they somehow have 2 versions of the - // router loaded. We can help them understand how to avoid that. - `useHref() may be used only in the context of a component.` - ); - let { basename, navigator } = React2.useContext(NavigationContext); - let { hash, pathname, search } = useResolvedPath(to, { relative }); - let joinedPathname = pathname; - if (basename !== "/") { - joinedPathname = pathname === "/" ? basename : joinPaths([basename, pathname]); - } - return navigator.createHref({ pathname: joinedPathname, search, hash }); -} -function useInRouterContext() { - return React2.useContext(LocationContext) != null; -} -function useLocation() { - invariant( - useInRouterContext(), - // TODO: This error is probably because they somehow have 2 versions of the - // router loaded. We can help them understand how to avoid that. - `useLocation() may be used only in the context of a component.` - ); - return React2.useContext(LocationContext).location; -} -function useNavigationType() { - return React2.useContext(LocationContext).navigationType; -} -function useMatch(pattern) { - invariant( - useInRouterContext(), - // TODO: This error is probably because they somehow have 2 versions of the - // router loaded. We can help them understand how to avoid that. - `useMatch() may be used only in the context of a component.` - ); - let { pathname } = useLocation(); - return React2.useMemo( - () => matchPath(pattern, decodePath(pathname)), - [pathname, pattern] - ); -} -function useIsomorphicLayoutEffect(cb) { - let isStatic = React2.useContext(NavigationContext).static; - if (!isStatic) { - React2.useLayoutEffect(cb); - } -} -function useNavigate() { - let { isDataRoute } = React2.useContext(RouteContext); - return isDataRoute ? useNavigateStable() : useNavigateUnstable(); -} -function useNavigateUnstable() { - invariant( - useInRouterContext(), - // TODO: This error is probably because they somehow have 2 versions of the - // router loaded. We can help them understand how to avoid that. - `useNavigate() may be used only in the context of a component.` - ); - let dataRouterContext = React2.useContext(DataRouterContext); - let { basename, navigator } = React2.useContext(NavigationContext); - let { matches } = React2.useContext(RouteContext); - let { pathname: locationPathname } = useLocation(); - let routePathnamesJson = JSON.stringify(getResolveToMatches(matches)); - let activeRef = React2.useRef(false); - useIsomorphicLayoutEffect(() => { - activeRef.current = true; - }); - let navigate = React2.useCallback( - (to, options = {}) => { - warning(activeRef.current, navigateEffectWarning); - if (!activeRef.current) return; - if (typeof to === "number") { - navigator.go(to); - return; - } - let path = resolveTo( - to, - JSON.parse(routePathnamesJson), - locationPathname, - options.relative === "path" - ); - if (dataRouterContext == null && basename !== "/") { - path.pathname = path.pathname === "/" ? basename : joinPaths([basename, path.pathname]); - } - (!!options.replace ? navigator.replace : navigator.push)( - path, - options.state, - options - ); - }, - [ - basename, - navigator, - routePathnamesJson, - locationPathname, - dataRouterContext - ] - ); - return navigate; -} -function useOutletContext() { - return React2.useContext(OutletContext); -} -function useOutlet(context) { - let outlet = React2.useContext(RouteContext).outlet; - return React2.useMemo( - () => outlet && React2.createElement(OutletContext.Provider, { value: context }, outlet), - [outlet, context] - ); -} -function useParams() { - let { matches } = React2.useContext(RouteContext); - let routeMatch = matches[matches.length - 1]; - return routeMatch ? routeMatch.params : {}; -} -function useResolvedPath(to, { relative } = {}) { - let { matches } = React2.useContext(RouteContext); - let { pathname: locationPathname } = useLocation(); - let routePathnamesJson = JSON.stringify(getResolveToMatches(matches)); - return React2.useMemo( - () => resolveTo( - to, - JSON.parse(routePathnamesJson), - locationPathname, - relative === "path" - ), - [to, routePathnamesJson, locationPathname, relative] - ); -} -function useRoutes(routes, locationArg) { - return useRoutesImpl(routes, locationArg); -} -function useRoutesImpl(routes, locationArg, dataRouterState, onError, future) { - invariant( - useInRouterContext(), - // TODO: This error is probably because they somehow have 2 versions of the - // router loaded. We can help them understand how to avoid that. - `useRoutes() may be used only in the context of a component.` - ); - let { navigator } = React2.useContext(NavigationContext); - let { matches: parentMatches } = React2.useContext(RouteContext); - let routeMatch = parentMatches[parentMatches.length - 1]; - let parentParams = routeMatch ? routeMatch.params : {}; - let parentPathname = routeMatch ? routeMatch.pathname : "/"; - let parentPathnameBase = routeMatch ? routeMatch.pathnameBase : "/"; - let parentRoute = routeMatch && routeMatch.route; - if (ENABLE_DEV_WARNINGS) { - let parentPath = parentRoute && parentRoute.path || ""; - warningOnce( - parentPathname, - !parentRoute || parentPath.endsWith("*") || parentPath.endsWith("*?"), - `You rendered descendant (or called \`useRoutes()\`) at "${parentPathname}" (under ) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render. - -Please change the parent to .` - ); - } - let locationFromContext = useLocation(); - let location2; - if (locationArg) { - let parsedLocationArg = typeof locationArg === "string" ? parsePath(locationArg) : locationArg; - invariant( - parentPathnameBase === "/" || parsedLocationArg.pathname?.startsWith(parentPathnameBase), - `When overriding the location using \`\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${parentPathnameBase}" but pathname "${parsedLocationArg.pathname}" was given in the \`location\` prop.` - ); - location2 = parsedLocationArg; - } else { - location2 = locationFromContext; - } - let pathname = location2.pathname || "/"; - let remainingPathname = pathname; - if (parentPathnameBase !== "/") { - let parentSegments = parentPathnameBase.replace(/^\//, "").split("/"); - let segments = pathname.replace(/^\//, "").split("/"); - remainingPathname = "/" + segments.slice(parentSegments.length).join("/"); - } - let matches = matchRoutes(routes, { pathname: remainingPathname }); - if (ENABLE_DEV_WARNINGS) { - warning( - parentRoute || matches != null, - `No routes matched location "${location2.pathname}${location2.search}${location2.hash}" ` - ); - warning( - matches == null || matches[matches.length - 1].route.element !== void 0 || matches[matches.length - 1].route.Component !== void 0 || matches[matches.length - 1].route.lazy !== void 0, - `Matched leaf route at location "${location2.pathname}${location2.search}${location2.hash}" does not have an element or Component. This means it will render an with a null value by default resulting in an "empty" page.` - ); - } - let renderedMatches = _renderMatches( - matches && matches.map( - (match) => Object.assign({}, match, { - params: Object.assign({}, parentParams, match.params), - pathname: joinPaths([ - parentPathnameBase, - // Re-encode pathnames that were decoded inside matchRoutes. - // Pre-encode `?` and `#` ahead of `encodeLocation` because it uses - // `new URL()` internally and we need to prevent it from treating - // them as separators - navigator.encodeLocation ? navigator.encodeLocation( - match.pathname.replace(/\?/g, "%3F").replace(/#/g, "%23") - ).pathname : match.pathname - ]), - pathnameBase: match.pathnameBase === "/" ? parentPathnameBase : joinPaths([ - parentPathnameBase, - // Re-encode pathnames that were decoded inside matchRoutes - // Pre-encode `?` and `#` ahead of `encodeLocation` because it uses - // `new URL()` internally and we need to prevent it from treating - // them as separators - navigator.encodeLocation ? navigator.encodeLocation( - match.pathnameBase.replace(/\?/g, "%3F").replace(/#/g, "%23") - ).pathname : match.pathnameBase - ]) - }) - ), - parentMatches, - dataRouterState, - onError, - future - ); - if (locationArg && renderedMatches) { - return React2.createElement( - LocationContext.Provider, - { - value: { - location: { - pathname: "/", - search: "", - hash: "", - state: null, - key: "default", - ...location2 - }, - navigationType: "POP" - /* Pop */ - } - }, - renderedMatches - ); - } - return renderedMatches; -} -function DefaultErrorComponent() { - let error = useRouteError(); - let message = isRouteErrorResponse(error) ? `${error.status} ${error.statusText}` : error instanceof Error ? error.message : JSON.stringify(error); - let stack = error instanceof Error ? error.stack : null; - let lightgrey = "rgba(200,200,200, 0.5)"; - let preStyles = { padding: "0.5rem", backgroundColor: lightgrey }; - let codeStyles = { padding: "2px 4px", backgroundColor: lightgrey }; - let devInfo = null; - if (ENABLE_DEV_WARNINGS) { - console.error( - "Error handled by React Router default ErrorBoundary:", - error - ); - devInfo = React2.createElement(React2.Fragment, null, React2.createElement("p", null, "💿 Hey developer 👋"), React2.createElement("p", null, "You can provide a way better UX than this when your app throws errors by providing your own ", React2.createElement("code", { style: codeStyles }, "ErrorBoundary"), " or", " ", React2.createElement("code", { style: codeStyles }, "errorElement"), " prop on your route.")); - } - return React2.createElement(React2.Fragment, null, React2.createElement("h2", null, "Unexpected Application Error!"), React2.createElement("h3", { style: { fontStyle: "italic" } }, message), stack ? React2.createElement("pre", { style: preStyles }, stack) : null, devInfo); -} -function RSCErrorHandler({ - children, - error -}) { - let { basename } = React2.useContext(NavigationContext); - if (typeof error === "object" && error && "digest" in error && typeof error.digest === "string") { - let redirect2 = decodeRedirectErrorDigest(error.digest); - if (redirect2) { - let existingRedirect = errorRedirectHandledMap.get(error); - if (existingRedirect) throw existingRedirect; - let parsed = parseToInfo(redirect2.location, basename); - if (isBrowser && !errorRedirectHandledMap.get(error)) { - if (parsed.isExternal || redirect2.reloadDocument) { - window.location.href = parsed.absoluteURL || parsed.to; - } else { - const redirectPromise = Promise.resolve().then( - () => window.__reactRouterDataRouter.navigate(parsed.to, { - replace: redirect2.replace - }) - ); - errorRedirectHandledMap.set(error, redirectPromise); - throw redirectPromise; - } - } - return React2.createElement( - "meta", - { - httpEquiv: "refresh", - content: `0;url=${parsed.absoluteURL || parsed.to}` - } - ); - } - } - return children; -} -function RenderedRoute({ routeContext, match, children }) { - let dataRouterContext = React2.useContext(DataRouterContext); - if (dataRouterContext && dataRouterContext.static && dataRouterContext.staticContext && (match.route.errorElement || match.route.ErrorBoundary)) { - dataRouterContext.staticContext._deepestRenderedBoundaryId = match.route.id; - } - return React2.createElement(RouteContext.Provider, { value: routeContext }, children); -} -function _renderMatches(matches, parentMatches = [], dataRouterState = null, onErrorHandler = null, future = null) { - if (matches == null) { - if (!dataRouterState) { - return null; - } - if (dataRouterState.errors) { - matches = dataRouterState.matches; - } else if (parentMatches.length === 0 && !dataRouterState.initialized && dataRouterState.matches.length > 0) { - matches = dataRouterState.matches; - } else { - return null; - } - } - let renderedMatches = matches; - let errors = dataRouterState?.errors; - if (errors != null) { - let errorIndex = renderedMatches.findIndex( - (m) => m.route.id && errors?.[m.route.id] !== void 0 - ); - invariant( - errorIndex >= 0, - `Could not find a matching route for errors on route IDs: ${Object.keys( - errors - ).join(",")}` - ); - renderedMatches = renderedMatches.slice( - 0, - Math.min(renderedMatches.length, errorIndex + 1) - ); - } - let renderFallback = false; - let fallbackIndex = -1; - if (dataRouterState) { - for (let i = 0; i < renderedMatches.length; i++) { - let match = renderedMatches[i]; - if (match.route.HydrateFallback || match.route.hydrateFallbackElement) { - fallbackIndex = i; - } - if (match.route.id) { - let { loaderData, errors: errors2 } = dataRouterState; - let needsToRunLoader = match.route.loader && !loaderData.hasOwnProperty(match.route.id) && (!errors2 || errors2[match.route.id] === void 0); - if (match.route.lazy || needsToRunLoader) { - renderFallback = true; - if (fallbackIndex >= 0) { - renderedMatches = renderedMatches.slice(0, fallbackIndex + 1); - } else { - renderedMatches = [renderedMatches[0]]; - } - break; - } - } - } - } - let onError = dataRouterState && onErrorHandler ? (error, errorInfo) => { - onErrorHandler(error, { - location: dataRouterState.location, - params: dataRouterState.matches?.[0]?.params ?? {}, - unstable_pattern: getRoutePattern(dataRouterState.matches), - errorInfo - }); - } : void 0; - return renderedMatches.reduceRight( - (outlet, match, index) => { - let error; - let shouldRenderHydrateFallback = false; - let errorElement = null; - let hydrateFallbackElement = null; - if (dataRouterState) { - error = errors && match.route.id ? errors[match.route.id] : void 0; - errorElement = match.route.errorElement || defaultErrorElement; - if (renderFallback) { - if (fallbackIndex < 0 && index === 0) { - warningOnce( - "route-fallback", - false, - "No `HydrateFallback` element provided to render during initial hydration" - ); - shouldRenderHydrateFallback = true; - hydrateFallbackElement = null; - } else if (fallbackIndex === index) { - shouldRenderHydrateFallback = true; - hydrateFallbackElement = match.route.hydrateFallbackElement || null; - } - } - } - let matches2 = parentMatches.concat(renderedMatches.slice(0, index + 1)); - let getChildren = () => { - let children; - if (error) { - children = errorElement; - } else if (shouldRenderHydrateFallback) { - children = hydrateFallbackElement; - } else if (match.route.Component) { - children = React2.createElement(match.route.Component, null); - } else if (match.route.element) { - children = match.route.element; - } else { - children = outlet; - } - return React2.createElement( - RenderedRoute, - { - match, - routeContext: { - outlet, - matches: matches2, - isDataRoute: dataRouterState != null - }, - children - } - ); - }; - return dataRouterState && (match.route.ErrorBoundary || match.route.errorElement || index === 0) ? React2.createElement( - RenderErrorBoundary, - { - location: dataRouterState.location, - revalidation: dataRouterState.revalidation, - component: errorElement, - error, - children: getChildren(), - routeContext: { outlet: null, matches: matches2, isDataRoute: true }, - onError - } - ) : getChildren(); - }, - null - ); -} -function getDataRouterConsoleError(hookName) { - return `${hookName} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`; -} -function useDataRouterContext(hookName) { - let ctx = React2.useContext(DataRouterContext); - invariant(ctx, getDataRouterConsoleError(hookName)); - return ctx; -} -function useDataRouterState(hookName) { - let state = React2.useContext(DataRouterStateContext); - invariant(state, getDataRouterConsoleError(hookName)); - return state; -} -function useRouteContext(hookName) { - let route = React2.useContext(RouteContext); - invariant(route, getDataRouterConsoleError(hookName)); - return route; -} -function useCurrentRouteId(hookName) { - let route = useRouteContext(hookName); - let thisRoute = route.matches[route.matches.length - 1]; - invariant( - thisRoute.route.id, - `${hookName} can only be used on routes that contain a unique "id"` - ); - return thisRoute.route.id; -} -function useRouteId() { - return useCurrentRouteId( - "useRouteId" - /* UseRouteId */ - ); -} -function useNavigation() { - let state = useDataRouterState( - "useNavigation" - /* UseNavigation */ - ); - return state.navigation; -} -function useRevalidator() { - let dataRouterContext = useDataRouterContext( - "useRevalidator" - /* UseRevalidator */ - ); - let state = useDataRouterState( - "useRevalidator" - /* UseRevalidator */ - ); - let revalidate = React2.useCallback(async () => { - await dataRouterContext.router.revalidate(); - }, [dataRouterContext.router]); - return React2.useMemo( - () => ({ revalidate, state: state.revalidation }), - [revalidate, state.revalidation] - ); -} -function useMatches() { - let { matches, loaderData } = useDataRouterState( - "useMatches" - /* UseMatches */ - ); - return React2.useMemo( - () => matches.map((m) => convertRouteMatchToUiMatch(m, loaderData)), - [matches, loaderData] - ); -} -function useLoaderData() { - let state = useDataRouterState( - "useLoaderData" - /* UseLoaderData */ - ); - let routeId = useCurrentRouteId( - "useLoaderData" - /* UseLoaderData */ - ); - return state.loaderData[routeId]; -} -function useRouteLoaderData(routeId) { - let state = useDataRouterState( - "useRouteLoaderData" - /* UseRouteLoaderData */ - ); - return state.loaderData[routeId]; -} -function useActionData() { - let state = useDataRouterState( - "useActionData" - /* UseActionData */ - ); - let routeId = useCurrentRouteId( - "useLoaderData" - /* UseLoaderData */ - ); - return state.actionData ? state.actionData[routeId] : void 0; -} -function useRouteError() { - let error = React2.useContext(RouteErrorContext); - let state = useDataRouterState( - "useRouteError" - /* UseRouteError */ - ); - let routeId = useCurrentRouteId( - "useRouteError" - /* UseRouteError */ - ); - if (error !== void 0) { - return error; - } - return state.errors?.[routeId]; -} -function useAsyncValue() { - let value = React2.useContext(AwaitContext); - return value?._data; -} -function useAsyncError() { - let value = React2.useContext(AwaitContext); - return value?._error; -} -function useBlocker(shouldBlock) { - let { router: router2, basename } = useDataRouterContext( - "useBlocker" - /* UseBlocker */ - ); - let state = useDataRouterState( - "useBlocker" - /* UseBlocker */ - ); - let [blockerKey, setBlockerKey] = React2.useState(""); - let blockerFunction = React2.useCallback( - (arg) => { - if (typeof shouldBlock !== "function") { - return !!shouldBlock; - } - if (basename === "/") { - return shouldBlock(arg); - } - let { currentLocation, nextLocation, historyAction } = arg; - return shouldBlock({ - currentLocation: { - ...currentLocation, - pathname: stripBasename(currentLocation.pathname, basename) || currentLocation.pathname - }, - nextLocation: { - ...nextLocation, - pathname: stripBasename(nextLocation.pathname, basename) || nextLocation.pathname - }, - historyAction - }); - }, - [basename, shouldBlock] - ); - React2.useEffect(() => { - let key = String(++blockerId); - setBlockerKey(key); - return () => router2.deleteBlocker(key); - }, [router2]); - React2.useEffect(() => { - if (blockerKey !== "") { - router2.getBlocker(blockerKey, blockerFunction); - } - }, [router2, blockerKey, blockerFunction]); - return blockerKey && state.blockers.has(blockerKey) ? state.blockers.get(blockerKey) : IDLE_BLOCKER; -} -function useNavigateStable() { - let { router: router2 } = useDataRouterContext( - "useNavigate" - /* UseNavigateStable */ - ); - let id = useCurrentRouteId( - "useNavigate" - /* UseNavigateStable */ - ); - let activeRef = React2.useRef(false); - useIsomorphicLayoutEffect(() => { - activeRef.current = true; - }); - let navigate = React2.useCallback( - async (to, options = {}) => { - warning(activeRef.current, navigateEffectWarning); - if (!activeRef.current) return; - if (typeof to === "number") { - await router2.navigate(to); - } else { - await router2.navigate(to, { fromRouteId: id, ...options }); - } - }, - [router2, id] - ); - return navigate; -} -function warningOnce(key, cond, message) { - if (!cond && !alreadyWarned[key]) { - alreadyWarned[key] = true; - warning(false, message); - } -} -function useRoute(...args) { - const currentRouteId = useCurrentRouteId( - "useRoute" - /* UseRoute */ - ); - const id = args[0] ?? currentRouteId; - const state = useDataRouterState( - "useRoute" - /* UseRoute */ - ); - const route = state.matches.find(({ route: route2 }) => route2.id === id); - if (route === void 0) return void 0; - return { - handle: route.route.handle, - loaderData: state.loaderData[id], - actionData: state.actionData?.[id] - }; -} -function warnOnce(condition, message) { - if (!condition && !alreadyWarned2[message]) { - alreadyWarned2[message] = true; - console.warn(message); - } -} -function useOptimisticSafe(val) { - if (useOptimisticImpl) { - return useOptimisticImpl(val); - } else { - return [val, stableUseOptimisticSetter]; - } -} -function mapRouteProperties(route) { - let updates = { - // Note: this check also occurs in createRoutesFromChildren so update - // there if you change this -- please and thank you! - hasErrorBoundary: route.hasErrorBoundary || route.ErrorBoundary != null || route.errorElement != null - }; - if (route.Component) { - if (ENABLE_DEV_WARNINGS) { - if (route.element) { - warning( - false, - "You should not include both `Component` and `element` on your route - `Component` will be used." - ); - } - } - Object.assign(updates, { - element: React3.createElement(route.Component), - Component: void 0 - }); - } - if (route.HydrateFallback) { - if (ENABLE_DEV_WARNINGS) { - if (route.hydrateFallbackElement) { - warning( - false, - "You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used." - ); - } - } - Object.assign(updates, { - hydrateFallbackElement: React3.createElement(route.HydrateFallback), - HydrateFallback: void 0 - }); - } - if (route.ErrorBoundary) { - if (ENABLE_DEV_WARNINGS) { - if (route.errorElement) { - warning( - false, - "You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used." - ); - } - } - Object.assign(updates, { - errorElement: React3.createElement(route.ErrorBoundary), - ErrorBoundary: void 0 - }); - } - return updates; -} -function createMemoryRouter(routes, opts) { - return createRouter({ - basename: opts?.basename, - getContext: opts?.getContext, - future: opts?.future, - history: createMemoryHistory({ - initialEntries: opts?.initialEntries, - initialIndex: opts?.initialIndex - }), - hydrationData: opts?.hydrationData, - routes, - hydrationRouteProperties, - mapRouteProperties, - dataStrategy: opts?.dataStrategy, - patchRoutesOnNavigation: opts?.patchRoutesOnNavigation, - unstable_instrumentations: opts?.unstable_instrumentations - }).initialize(); -} -function RouterProvider({ - router: router2, - flushSync: reactDomFlushSyncImpl, - onError, - unstable_useTransitions -}) { - let unstable_rsc = useIsRSCRouterContext(); - unstable_useTransitions = unstable_rsc || unstable_useTransitions; - let [_state, setStateImpl] = React3.useState(router2.state); - let [state, setOptimisticState] = useOptimisticSafe(_state); - let [pendingState, setPendingState] = React3.useState(); - let [vtContext, setVtContext] = React3.useState({ - isTransitioning: false - }); - let [renderDfd, setRenderDfd] = React3.useState(); - let [transition, setTransition] = React3.useState(); - let [interruption, setInterruption] = React3.useState(); - let fetcherData = React3.useRef(/* @__PURE__ */ new Map()); - let setState = React3.useCallback( - (newState, { deletedFetchers, newErrors, flushSync: flushSync3, viewTransitionOpts }) => { - if (newErrors && onError) { - Object.values(newErrors).forEach( - (error) => onError(error, { - location: newState.location, - params: newState.matches[0]?.params ?? {}, - unstable_pattern: getRoutePattern(newState.matches) - }) - ); - } - newState.fetchers.forEach((fetcher, key) => { - if (fetcher.data !== void 0) { - fetcherData.current.set(key, fetcher.data); - } - }); - deletedFetchers.forEach((key) => fetcherData.current.delete(key)); - warnOnce( - flushSync3 === false || reactDomFlushSyncImpl != null, - 'You provided the `flushSync` option to a router update, but you are not using the `` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.' - ); - let isViewTransitionAvailable = router2.window != null && router2.window.document != null && typeof router2.window.document.startViewTransition === "function"; - warnOnce( - viewTransitionOpts == null || isViewTransitionAvailable, - "You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available." - ); - if (!viewTransitionOpts || !isViewTransitionAvailable) { - if (reactDomFlushSyncImpl && flushSync3) { - reactDomFlushSyncImpl(() => setStateImpl(newState)); - } else if (unstable_useTransitions === false) { - setStateImpl(newState); - } else { - React3.startTransition(() => { - if (unstable_useTransitions === true) { - setOptimisticState((s) => getOptimisticRouterState(s, newState)); - } - setStateImpl(newState); - }); - } - return; - } - if (reactDomFlushSyncImpl && flushSync3) { - reactDomFlushSyncImpl(() => { - if (transition) { - renderDfd?.resolve(); - transition.skipTransition(); - } - setVtContext({ - isTransitioning: true, - flushSync: true, - currentLocation: viewTransitionOpts.currentLocation, - nextLocation: viewTransitionOpts.nextLocation - }); - }); - let t = router2.window.document.startViewTransition(() => { - reactDomFlushSyncImpl(() => setStateImpl(newState)); - }); - t.finished.finally(() => { - reactDomFlushSyncImpl(() => { - setRenderDfd(void 0); - setTransition(void 0); - setPendingState(void 0); - setVtContext({ isTransitioning: false }); - }); - }); - reactDomFlushSyncImpl(() => setTransition(t)); - return; - } - if (transition) { - renderDfd?.resolve(); - transition.skipTransition(); - setInterruption({ - state: newState, - currentLocation: viewTransitionOpts.currentLocation, - nextLocation: viewTransitionOpts.nextLocation - }); - } else { - setPendingState(newState); - setVtContext({ - isTransitioning: true, - flushSync: false, - currentLocation: viewTransitionOpts.currentLocation, - nextLocation: viewTransitionOpts.nextLocation - }); - } - }, - [ - router2.window, - reactDomFlushSyncImpl, - transition, - renderDfd, - unstable_useTransitions, - setOptimisticState, - onError - ] - ); - React3.useLayoutEffect(() => router2.subscribe(setState), [router2, setState]); - React3.useEffect(() => { - if (vtContext.isTransitioning && !vtContext.flushSync) { - setRenderDfd(new Deferred()); - } - }, [vtContext]); - React3.useEffect(() => { - if (renderDfd && pendingState && router2.window) { - let newState = pendingState; - let renderPromise = renderDfd.promise; - let transition2 = router2.window.document.startViewTransition(async () => { - if (unstable_useTransitions === false) { - setStateImpl(newState); - } else { - React3.startTransition(() => { - if (unstable_useTransitions === true) { - setOptimisticState((s) => getOptimisticRouterState(s, newState)); - } - setStateImpl(newState); - }); - } - await renderPromise; - }); - transition2.finished.finally(() => { - setRenderDfd(void 0); - setTransition(void 0); - setPendingState(void 0); - setVtContext({ isTransitioning: false }); - }); - setTransition(transition2); - } - }, [ - pendingState, - renderDfd, - router2.window, - unstable_useTransitions, - setOptimisticState - ]); - React3.useEffect(() => { - if (renderDfd && pendingState && state.location.key === pendingState.location.key) { - renderDfd.resolve(); - } - }, [renderDfd, transition, state.location, pendingState]); - React3.useEffect(() => { - if (!vtContext.isTransitioning && interruption) { - setPendingState(interruption.state); - setVtContext({ - isTransitioning: true, - flushSync: false, - currentLocation: interruption.currentLocation, - nextLocation: interruption.nextLocation - }); - setInterruption(void 0); - } - }, [vtContext.isTransitioning, interruption]); - let navigator = React3.useMemo(() => { - return { - createHref: router2.createHref, - encodeLocation: router2.encodeLocation, - go: (n) => router2.navigate(n), - push: (to, state2, opts) => router2.navigate(to, { - state: state2, - preventScrollReset: opts?.preventScrollReset - }), - replace: (to, state2, opts) => router2.navigate(to, { - replace: true, - state: state2, - preventScrollReset: opts?.preventScrollReset - }) - }; - }, [router2]); - let basename = router2.basename || "/"; - let dataRouterContext = React3.useMemo( - () => ({ - router: router2, - navigator, - static: false, - basename, - onError - }), - [router2, navigator, basename, onError] - ); - return React3.createElement(React3.Fragment, null, React3.createElement(DataRouterContext.Provider, { value: dataRouterContext }, React3.createElement(DataRouterStateContext.Provider, { value: state }, React3.createElement(FetchersContext.Provider, { value: fetcherData.current }, React3.createElement(ViewTransitionContext.Provider, { value: vtContext }, React3.createElement( - Router, - { - basename, - location: state.location, - navigationType: state.historyAction, - navigator, - unstable_useTransitions - }, - React3.createElement( - MemoizedDataRoutes, - { - routes: router2.routes, - future: router2.future, - state, - onError - } - ) - ))))), null); -} -function getOptimisticRouterState(currentState, newState) { - return { - // Don't surface "current location specific" stuff mid-navigation - // (historyAction, location, matches, loaderData, errors, initialized, - // restoreScroll, preventScrollReset, blockers, etc.) - ...currentState, - // Only surface "pending/in-flight stuff" - // (navigation, revalidation, actionData, fetchers, ) - navigation: newState.navigation.state !== "idle" ? newState.navigation : currentState.navigation, - revalidation: newState.revalidation !== "idle" ? newState.revalidation : currentState.revalidation, - actionData: newState.navigation.state !== "submitting" ? newState.actionData : currentState.actionData, - fetchers: newState.fetchers - }; -} -function DataRoutes({ - routes, - future, - state, - onError -}) { - return useRoutesImpl(routes, void 0, state, onError, future); -} -function MemoryRouter({ - basename, - children, - initialEntries, - initialIndex, - unstable_useTransitions -}) { - let historyRef = React3.useRef(); - if (historyRef.current == null) { - historyRef.current = createMemoryHistory({ - initialEntries, - initialIndex, - v5Compat: true - }); - } - let history = historyRef.current; - let [state, setStateImpl] = React3.useState({ - action: history.action, - location: history.location - }); - let setState = React3.useCallback( - (newState) => { - if (unstable_useTransitions === false) { - setStateImpl(newState); - } else { - React3.startTransition(() => setStateImpl(newState)); - } - }, - [unstable_useTransitions] - ); - React3.useLayoutEffect(() => history.listen(setState), [history, setState]); - return React3.createElement( - Router, - { - basename, - children, - location: state.location, - navigationType: state.action, - navigator: history, - unstable_useTransitions - } - ); -} -function Navigate({ - to, - replace: replace2, - state, - relative -}) { - invariant( - useInRouterContext(), - // TODO: This error is probably because they somehow have 2 versions of - // the router loaded. We can help them understand how to avoid that. - ` may be used only in the context of a component.` - ); - let { static: isStatic } = React3.useContext(NavigationContext); - warning( - !isStatic, - ` must not be used on the initial render in a . This is a no-op, but you should modify your code so the is only ever rendered in response to some user interaction or state change.` - ); - let { matches } = React3.useContext(RouteContext); - let { pathname: locationPathname } = useLocation(); - let navigate = useNavigate(); - let path = resolveTo( - to, - getResolveToMatches(matches), - locationPathname, - relative === "path" - ); - let jsonPath = JSON.stringify(path); - React3.useEffect(() => { - navigate(JSON.parse(jsonPath), { replace: replace2, state, relative }); - }, [navigate, jsonPath, relative, replace2, state]); - return null; -} -function Outlet(props) { - return useOutlet(props.context); -} -function Route(props) { - invariant( - false, - `A is only ever to be used as the child of element, never rendered directly. Please wrap your in a .` - ); -} -function Router({ - basename: basenameProp = "/", - children = null, - location: locationProp, - navigationType = "POP", - navigator, - static: staticProp = false, - unstable_useTransitions -}) { - invariant( - !useInRouterContext(), - `You cannot render a inside another . You should never have more than one in your app.` - ); - let basename = basenameProp.replace(/^\/*/, "/"); - let navigationContext = React3.useMemo( - () => ({ - basename, - navigator, - static: staticProp, - unstable_useTransitions, - future: {} - }), - [basename, navigator, staticProp, unstable_useTransitions] - ); - if (typeof locationProp === "string") { - locationProp = parsePath(locationProp); - } - let { - pathname = "/", - search = "", - hash = "", - state = null, - key = "default" - } = locationProp; - let locationContext = React3.useMemo(() => { - let trailingPathname = stripBasename(pathname, basename); - if (trailingPathname == null) { - return null; - } - return { - location: { - pathname: trailingPathname, - search, - hash, - state, - key - }, - navigationType - }; - }, [basename, pathname, search, hash, state, key, navigationType]); - warning( - locationContext != null, - ` is not able to match the URL "${pathname}${search}${hash}" because it does not start with the basename, so the won't render anything.` - ); - if (locationContext == null) { - return null; - } - return React3.createElement(NavigationContext.Provider, { value: navigationContext }, React3.createElement(LocationContext.Provider, { children, value: locationContext })); -} -function Routes({ - children, - location: location2 -}) { - return useRoutes(createRoutesFromChildren(children), location2); -} -function Await({ - children, - errorElement, - resolve -}) { - let dataRouterContext = React3.useContext(DataRouterContext); - let dataRouterStateContext = React3.useContext(DataRouterStateContext); - let onError = React3.useCallback( - (error, errorInfo) => { - if (dataRouterContext && dataRouterContext.onError && dataRouterStateContext) { - dataRouterContext.onError(error, { - location: dataRouterStateContext.location, - params: dataRouterStateContext.matches[0]?.params || {}, - unstable_pattern: getRoutePattern(dataRouterStateContext.matches), - errorInfo - }); - } - }, - [dataRouterContext, dataRouterStateContext] - ); - return React3.createElement( - AwaitErrorBoundary, - { - resolve, - errorElement, - onError - }, - React3.createElement(ResolveAwait, null, children) - ); -} -function ResolveAwait({ - children -}) { - let data2 = useAsyncValue(); - let toRender = typeof children === "function" ? children(data2) : children; - return React3.createElement(React3.Fragment, null, toRender); -} -function createRoutesFromChildren(children, parentPath = []) { - let routes = []; - React3.Children.forEach(children, (element, index) => { - if (!React3.isValidElement(element)) { - return; - } - let treePath = [...parentPath, index]; - if (element.type === React3.Fragment) { - routes.push.apply( - routes, - createRoutesFromChildren(element.props.children, treePath) - ); - return; - } - invariant( - element.type === Route, - `[${typeof element.type === "string" ? element.type : element.type.name}] is not a component. All component children of must be a or ` - ); - invariant( - !element.props.index || !element.props.children, - "An index route cannot have child routes." - ); - let route = { - id: element.props.id || treePath.join("-"), - caseSensitive: element.props.caseSensitive, - element: element.props.element, - Component: element.props.Component, - index: element.props.index, - path: element.props.path, - middleware: element.props.middleware, - loader: element.props.loader, - action: element.props.action, - hydrateFallbackElement: element.props.hydrateFallbackElement, - HydrateFallback: element.props.HydrateFallback, - errorElement: element.props.errorElement, - ErrorBoundary: element.props.ErrorBoundary, - hasErrorBoundary: element.props.hasErrorBoundary === true || element.props.ErrorBoundary != null || element.props.errorElement != null, - shouldRevalidate: element.props.shouldRevalidate, - handle: element.props.handle, - lazy: element.props.lazy - }; - if (element.props.children) { - route.children = createRoutesFromChildren( - element.props.children, - treePath - ); - } - routes.push(route); - }); - return routes; -} -function renderMatches(matches) { - return _renderMatches(matches); -} -function useRouteComponentProps() { - return { - params: useParams(), - loaderData: useLoaderData(), - actionData: useActionData(), - matches: useMatches() - }; -} -function WithComponentProps({ - children -}) { - const props = useRouteComponentProps(); - return React3.cloneElement(children, props); -} -function withComponentProps(Component4) { - return function WithComponentProps2() { - const props = useRouteComponentProps(); - return React3.createElement(Component4, props); - }; -} -function useHydrateFallbackProps() { - return { - params: useParams(), - loaderData: useLoaderData(), - actionData: useActionData() - }; -} -function WithHydrateFallbackProps({ - children -}) { - const props = useHydrateFallbackProps(); - return React3.cloneElement(children, props); -} -function withHydrateFallbackProps(HydrateFallback) { - return function WithHydrateFallbackProps2() { - const props = useHydrateFallbackProps(); - return React3.createElement(HydrateFallback, props); - }; -} -function useErrorBoundaryProps() { - return { - params: useParams(), - loaderData: useLoaderData(), - actionData: useActionData(), - error: useRouteError() - }; -} -function WithErrorBoundaryProps({ - children -}) { - const props = useErrorBoundaryProps(); - return React3.cloneElement(children, props); -} -function withErrorBoundaryProps(ErrorBoundary) { - return function WithErrorBoundaryProps2() { - const props = useErrorBoundaryProps(); - return React3.createElement(ErrorBoundary, props); - }; -} -function isHtmlElement(object) { - return typeof HTMLElement !== "undefined" && object instanceof HTMLElement; -} -function isButtonElement(object) { - return isHtmlElement(object) && object.tagName.toLowerCase() === "button"; -} -function isFormElement(object) { - return isHtmlElement(object) && object.tagName.toLowerCase() === "form"; -} -function isInputElement(object) { - return isHtmlElement(object) && object.tagName.toLowerCase() === "input"; -} -function isModifiedEvent(event) { - return !!(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey); -} -function shouldProcessLinkClick(event, target) { - return event.button === 0 && // Ignore everything but left clicks - (!target || target === "_self") && // Let browser handle "target=_blank" etc. - !isModifiedEvent(event); -} -function createSearchParams(init = "") { - return new URLSearchParams( - typeof init === "string" || Array.isArray(init) || init instanceof URLSearchParams ? init : Object.keys(init).reduce((memo2, key) => { - let value = init[key]; - return memo2.concat( - Array.isArray(value) ? value.map((v) => [key, v]) : [[key, value]] - ); - }, []) - ); -} -function getSearchParamsForLocation(locationSearch, defaultSearchParams) { - let searchParams = createSearchParams(locationSearch); - if (defaultSearchParams) { - defaultSearchParams.forEach((_, key) => { - if (!searchParams.has(key)) { - defaultSearchParams.getAll(key).forEach((value) => { - searchParams.append(key, value); - }); - } - }); - } - return searchParams; -} -function isFormDataSubmitterSupported() { - if (_formDataSupportsSubmitter === null) { - try { - new FormData( - document.createElement("form"), - // @ts-expect-error if FormData supports the submitter parameter, this will throw - 0 - ); - _formDataSupportsSubmitter = false; - } catch (e) { - _formDataSupportsSubmitter = true; - } - } - return _formDataSupportsSubmitter; -} -function getFormEncType(encType) { - if (encType != null && !supportedFormEncTypes.has(encType)) { - warning( - false, - `"${encType}" is not a valid \`encType\` for \`
\`/\`\` and will default to "${defaultEncType}"` - ); - return null; - } - return encType; -} -function getFormSubmissionInfo(target, basename) { - let method; - let action; - let encType; - let formData; - let body; - if (isFormElement(target)) { - let attr = target.getAttribute("action"); - action = attr ? stripBasename(attr, basename) : null; - method = target.getAttribute("method") || defaultMethod; - encType = getFormEncType(target.getAttribute("enctype")) || defaultEncType; - formData = new FormData(target); - } else if (isButtonElement(target) || isInputElement(target) && (target.type === "submit" || target.type === "image")) { - let form = target.form; - if (form == null) { - throw new Error( - `Cannot submit a