@vulcanjs/react-ui 0.6.6-y.8 → 0.6.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. package/dist/components/VulcanComponents/Consumer.d.ts.map +0 -0
  2. package/dist/components/VulcanComponents/Context.d.ts.map +0 -0
  3. package/dist/components/VulcanComponents/Dummy.d.ts.map +0 -0
  4. package/dist/components/VulcanComponents/Provider.d.ts.map +0 -0
  5. package/dist/components/VulcanComponents/defaultVulcanComponents/index.d.ts.map +0 -0
  6. package/dist/components/VulcanComponents/index.d.ts.map +0 -0
  7. package/dist/components/VulcanComponents/typings.d.ts.map +0 -0
  8. package/dist/components/VulcanCurrentUser/Consumer.d.ts.map +0 -0
  9. package/dist/components/VulcanCurrentUser/Context.d.ts.map +0 -0
  10. package/dist/components/VulcanCurrentUser/Provider.d.ts.map +0 -0
  11. package/dist/components/VulcanCurrentUser/index.d.ts.map +0 -0
  12. package/dist/components/core/LoadingButton.d.ts.map +0 -0
  13. package/dist/components/core/MutationButton.d.ts.map +0 -0
  14. package/dist/components/core/typings.d.ts.map +0 -0
  15. package/dist/components/form/core/Form/Form.d.ts.map +0 -0
  16. package/dist/components/form/core/Form/fields.d.ts.map +0 -0
  17. package/dist/components/form/core/Form/index.d.ts.map +0 -0
  18. package/dist/components/form/core/Form/typings.d.ts.map +0 -0
  19. package/dist/components/form/core/Form/utils.d.ts.map +0 -0
  20. package/dist/components/form/core/FormContainer.d.ts.map +1 -1
  21. package/dist/components/form/core/FormContext.d.ts.map +1 -1
  22. package/dist/components/form/core/index.d.ts.map +0 -0
  23. package/dist/components/form/hooks/useBlockTransition/block.d.ts.map +0 -0
  24. package/dist/components/form/hooks/useBlockTransition/useBlockTransition.d.ts.map +0 -0
  25. package/dist/components/form/hooks/useWarnOnUnsaved/index.d.ts.map +0 -0
  26. package/dist/components/form/hooks/useWarnOnUnsaved/useWarnOnUnsaved.d.ts.map +0 -0
  27. package/dist/components/form/index.d.ts +1 -0
  28. package/dist/components/form/index.d.ts.map +1 -1
  29. package/dist/components/form/typings.d.ts.map +0 -0
  30. package/dist/components/form/utils/formFragments.d.ts.map +0 -0
  31. package/dist/components/form/utils/index.d.ts +6 -0
  32. package/dist/components/form/utils/index.d.ts.map +1 -0
  33. package/dist/components/form/utils/path_utils.d.ts.map +0 -0
  34. package/dist/components/form/utils/schema_utils.d.ts.map +0 -0
  35. package/dist/components/form/utils/ui_utils.d.ts.map +1 -0
  36. package/dist/components/form/utils/utils.d.ts.map +0 -0
  37. package/dist/componentsHelpers.d.ts.map +0 -0
  38. package/dist/index.d.ts.map +0 -0
  39. package/dist/index.js +1104 -931
  40. package/dist/index.js.map +1 -1
  41. package/dist/testing/ExpectedErrorBoundary.d.ts +14 -0
  42. package/dist/testing/ExpectedErrorBoundary.d.ts.map +1 -0
  43. package/dist/testing.d.ts +2 -0
  44. package/dist/testing.d.ts.map +1 -0
  45. package/dist/testing.js +34 -0
  46. package/dist/testing.js.map +1 -0
  47. package/package.json +13 -5
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../node_modules/tslib/tslib.js","../index.ts","../components/core/typings.ts","../components/form/index.ts","../components/form/core/FormContext.tsx","../components/form/core/Form/index.ts","../components/form/core/Form/Form.tsx","../components/form/utils/schema_utils.ts","../components/form/utils/utils.ts","../components/form/utils/path_utils.ts","../components/form/core/Form/fields.ts","../components/form/core/Form/utils.ts","../components/form/hooks/useWarnOnUnsaved/index.ts","../components/form/hooks/useWarnOnUnsaved/useWarnOnUnsaved.ts","../components/form/hooks/useBlockTransition/useBlockTransition.ts","../components/form/hooks/useBlockTransition/block.ts","../components/VulcanComponents/index.ts","../components/VulcanComponents/Provider.tsx","../components/VulcanComponents/Context.ts","../components/VulcanComponents/Dummy.tsx","../components/VulcanComponents/Consumer.tsx","../components/VulcanComponents/typings.ts","../components/VulcanComponents/defaultVulcanComponents/index.ts","../components/core/LoadingButton.tsx","../components/core/MutationButton.tsx","../../../node_modules/graphql-tag/lib/index.js","../../../node_modules/tslib/modules/index.js","../../../node_modules/graphql/index.mjs","../../../node_modules/graphql/language/parser.mjs","../../../node_modules/graphql/error/syntaxError.mjs","../../../node_modules/graphql/error/GraphQLError.mjs","../../../node_modules/graphql/jsutils/isObjectLike.mjs","../../../node_modules/graphql/polyfills/symbols.mjs","../../../node_modules/graphql/language/location.mjs","../../../node_modules/graphql/language/printLocation.mjs","../../../node_modules/graphql/language/kinds.mjs","../../../node_modules/graphql/language/ast.mjs","../../../node_modules/graphql/jsutils/defineInspect.mjs","../../../node_modules/graphql/jsutils/invariant.mjs","../../../node_modules/graphql/jsutils/nodejsCustomInspectSymbol.mjs","../../../node_modules/graphql/language/tokenKind.mjs","../../../node_modules/graphql/language/source.mjs","../../../node_modules/graphql/jsutils/inspect.mjs","../../../node_modules/graphql/jsutils/devAssert.mjs","../../../node_modules/graphql/jsutils/instanceOf.mjs","../../../node_modules/graphql/language/directiveLocation.mjs","../../../node_modules/graphql/language/lexer.mjs","../../../node_modules/graphql/language/blockString.mjs","../../../node_modules/graphql/language/index.mjs","../components/form/core/index.ts","../components/form/core/FormContainer.tsx","../components/form/utils/formFragments.ts","../components/VulcanCurrentUser/index.ts","../components/VulcanCurrentUser/Consumer.tsx","../components/VulcanCurrentUser/Context.ts","../components/VulcanCurrentUser/Provider.tsx","../components/form/core/Form/typings.ts","../componentsHelpers.tsx"],"sourcesContent":["/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global global, define, System, Reflect, Promise */\r\nvar __extends;\r\nvar __assign;\r\nvar __rest;\r\nvar __decorate;\r\nvar __param;\r\nvar __metadata;\r\nvar __awaiter;\r\nvar __generator;\r\nvar __exportStar;\r\nvar __values;\r\nvar __read;\r\nvar __spread;\r\nvar __spreadArrays;\r\nvar __spreadArray;\r\nvar __await;\r\nvar __asyncGenerator;\r\nvar __asyncDelegator;\r\nvar __asyncValues;\r\nvar __makeTemplateObject;\r\nvar __importStar;\r\nvar __importDefault;\r\nvar __classPrivateFieldGet;\r\nvar __classPrivateFieldSet;\r\nvar __classPrivateFieldIn;\r\nvar __createBinding;\r\n(function (factory) {\r\n var root = typeof global === \"object\" ? global : typeof self === \"object\" ? self : typeof this === \"object\" ? this : {};\r\n if (typeof define === \"function\" && define.amd) {\r\n define(\"tslib\", [\"exports\"], function (exports) { factory(createExporter(root, createExporter(exports))); });\r\n }\r\n else if (typeof module === \"object\" && typeof module.exports === \"object\") {\r\n factory(createExporter(root, createExporter(module.exports)));\r\n }\r\n else {\r\n factory(createExporter(root));\r\n }\r\n function createExporter(exports, previous) {\r\n if (exports !== root) {\r\n if (typeof Object.create === \"function\") {\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n }\r\n else {\r\n exports.__esModule = true;\r\n }\r\n }\r\n return function (id, v) { return exports[id] = previous ? previous(id, v) : v; };\r\n }\r\n})\r\n(function (exporter) {\r\n var extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n\r\n __extends = function (d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n };\r\n\r\n __assign = Object.assign || function (t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n };\r\n\r\n __rest = function (s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n };\r\n\r\n __decorate = function (decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n };\r\n\r\n __param = function (paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n };\r\n\r\n __metadata = function (metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n };\r\n\r\n __awaiter = function (thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n };\r\n\r\n __generator = function (thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n };\r\n\r\n __exportStar = function(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n };\r\n\r\n __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n }) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n });\r\n\r\n __values = function (o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n };\r\n\r\n __read = function (o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n };\r\n\r\n /** @deprecated */\r\n __spread = function () {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n };\r\n\r\n /** @deprecated */\r\n __spreadArrays = function () {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n };\r\n\r\n __spreadArray = function (to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n };\r\n\r\n __await = function (v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n };\r\n\r\n __asyncGenerator = function (thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n };\r\n\r\n __asyncDelegator = function (o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n };\r\n\r\n __asyncValues = function (o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n };\r\n\r\n __makeTemplateObject = function (cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n };\r\n\r\n var __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n }) : function(o, v) {\r\n o[\"default\"] = v;\r\n };\r\n\r\n __importStar = function (mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n };\r\n\r\n __importDefault = function (mod) {\r\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\r\n };\r\n\r\n __classPrivateFieldGet = function (receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n };\r\n\r\n __classPrivateFieldSet = function (receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n };\r\n\r\n __classPrivateFieldIn = function (state, receiver) {\r\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\r\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\r\n };\r\n\r\n exporter(\"__extends\", __extends);\r\n exporter(\"__assign\", __assign);\r\n exporter(\"__rest\", __rest);\r\n exporter(\"__decorate\", __decorate);\r\n exporter(\"__param\", __param);\r\n exporter(\"__metadata\", __metadata);\r\n exporter(\"__awaiter\", __awaiter);\r\n exporter(\"__generator\", __generator);\r\n exporter(\"__exportStar\", __exportStar);\r\n exporter(\"__createBinding\", __createBinding);\r\n exporter(\"__values\", __values);\r\n exporter(\"__read\", __read);\r\n exporter(\"__spread\", __spread);\r\n exporter(\"__spreadArrays\", __spreadArrays);\r\n exporter(\"__spreadArray\", __spreadArray);\r\n exporter(\"__await\", __await);\r\n exporter(\"__asyncGenerator\", __asyncGenerator);\r\n exporter(\"__asyncDelegator\", __asyncDelegator);\r\n exporter(\"__asyncValues\", __asyncValues);\r\n exporter(\"__makeTemplateObject\", __makeTemplateObject);\r\n exporter(\"__importStar\", __importStar);\r\n exporter(\"__importDefault\", __importDefault);\r\n exporter(\"__classPrivateFieldGet\", __classPrivateFieldGet);\r\n exporter(\"__classPrivateFieldSet\", __classPrivateFieldSet);\r\n exporter(\"__classPrivateFieldIn\", __classPrivateFieldIn);\r\n});\r\n","export * from \"./components/core/typings\";\nexport * from \"./components/form\";\nexport * from \"./components/VulcanComponents\";\nexport * from \"./components/VulcanCurrentUser\";\nexport * from \"./componentsHelpers\";\n","// @see https://stackoverflow.com/questions/51835611/specify-specific-props-and-accept-general-html-props-in-typescript-react-app\nexport type ButtonProps = React.DetailedHTMLProps<\n React.HTMLAttributes<HTMLButtonElement>,\n HTMLButtonElement\n> &\n // The any is important here: we allow end-application to \"hack\" the component with a custom replacement implementation,\n // so we authorize them to pass additionnal unknown props\n any;\n","export * from \"./core/FormContext\";\nexport * from \"./core/Form\";\nexport * from \"./core/FormContainer\";\n\nexport type { FormInputProps } from \"./typings\";\n","import React, { useContext } from \"react\";\n\ninterface FormContextValue {\n addToDeletedValues: Function;\n addToFailureForm: Function;\n addToSubmitForm: Function;\n addToSuccessForm: Function;\n clearForm: Function;\n clearFormCallbacks: Function;\n clearFieldErrors: Function;\n currentValues: object;\n deletedValues: Array<any>;\n errors: Array<any>;\n getDocument: Function;\n getLabel: (fieldName: string, fieldLocale?: string) => string;\n initialDocument: object;\n isChanged: boolean;\n refetchForm: Function;\n // TODO: we deprecate this, it doesn't make sense to allow a child to setState this way\n // setFormState: Function;\n // FIXME: this type doesn't work, it doesn't necessarily have the event + it has to be defined\n submitForm: Function; //React.HTMLAttributes<HTMLFormElement>[\"onSubmit\"];\n throwError: Function;\n updateCurrentValues: Function;\n}\n\nexport const FormContext =\n React.createContext<FormContextValue | undefined>(undefined);\n\nexport const useFormContext = () => {\n const formContext = useContext(FormContext);\n if (!formContext)\n throw new Error(\n \"A component is trying to access form context but it is undefined. Please wrap your component with a <Form>.\"\n );\n return formContext;\n};\n","export * from \"./Form\";\nexport * from \"./typings\";\n","/*\n\nMain form component.\n\nThis component expects:\n\n### All Forms:\n\n- collection\n- currentUser\n- client (Apollo client)\n\n*/\n\nimport React, { useEffect, useRef, useState } from \"react\";\nimport { runCallbacks, getErrors } from \"@vulcanjs/core\";\nimport { useIntlContext } from \"@vulcanjs/react-i18n\";\nimport { removeProperty } from \"@vulcanjs/utils\";\nimport _filter from \"lodash/filter.js\";\nimport cloneDeep from \"lodash/cloneDeep.js\";\nimport compact from \"lodash/compact.js\";\nimport get from \"lodash/get.js\";\nimport isObject from \"lodash/isObject.js\";\nimport mapValues from \"lodash/mapValues.js\";\nimport merge from \"lodash/merge.js\";\nimport omit from \"lodash/omit.js\";\nimport omitBy from \"lodash/omitBy.js\";\nimport pick from \"lodash/pick.js\";\nimport pickBy from \"lodash/pickBy.js\";\nimport set from \"lodash/set.js\";\nimport unset from \"lodash/unset.js\";\nimport update from \"lodash/update.js\";\nimport without from \"lodash/without.js\";\nimport isEmpty from \"lodash/isEmpty.js\";\n//import type { FormLayoutProps } from \"../../elements/FormLayout\";\n//import type { FormSubmitProps } from \"../../elements/FormSubmit\";\n\nimport {\n convertSchema,\n getEditableFields,\n getInsertableFields,\n} from \"../../utils/schema_utils\";\nimport { isEmptyValue } from \"../../utils/utils\";\nimport { getParentPath } from \"../../utils/path_utils\";\n// import withCollectionProps from \"./withCollectionProps\";\nimport { FormContext } from \"../FormContext\";\nimport { getFieldGroups, getFieldNames, getLabel } from \"./fields\";\nimport { isNotSameDocument } from \"./utils\";\nimport { useWarnOnUnsaved } from \"../../hooks/useWarnOnUnsaved\";\n\nimport type { FormType } from \"../../typings\";\nimport {\n CreateDocumentResult,\n FormProps,\n FormState,\n UpdateDocumentResult,\n} from \"./typings\";\nimport { MutationResult } from \"@apollo/client\";\nimport { useVulcanComponents } from \"../../../VulcanComponents\";\n\n// props that should trigger a form reset\nconst RESET_PROPS = [\n \"model\",\n // \"collection\",\n // \"collectionName\",\n \"document\",\n \"schema\",\n \"currentUser\",\n \"fields\",\n \"removeFields\",\n \"prefilledProps\", // TODO: prefilledProps should be merged instead?\n];\n\nconst compactParent = (object, path) => {\n const parentPath = getParentPath(path);\n\n // note: we only want to compact arrays, not objects\n const compactIfArray = (x) => (Array.isArray(x) ? compact(x) : x);\n\n update(object, parentPath, compactIfArray);\n};\n\nconst getDefaultValues = (convertedSchema) => {\n // TODO: make this work with nested schemas, too\n return pickBy(\n mapValues(convertedSchema, (field) => field.defaultValue),\n (value) => value\n );\n};\n\nconst compactObject = (o) => omitBy(o, (f) => f === null || f === undefined);\n\nconst getInitialStateFromProps = (nextProps: FormProps): FormState => {\n const schema = nextProps.schema || nextProps.model.schema;\n const convertedSchema = convertSchema(schema);\n const formType: FormType = nextProps.document ? \"edit\" : \"new\";\n // for new document forms, add default values to initial document\n const defaultValues =\n formType === \"new\" ? getDefaultValues(convertedSchema) : {};\n // note: we remove null/undefined values from the loaded document so they don't overwrite possible prefilledProps\n const initialDocument = merge(\n {},\n defaultValues,\n nextProps.prefilledProps,\n compactObject(nextProps.document)\n );\n\n //if minCount is specified, go ahead and create empty nested documents\n Object.keys(convertedSchema).forEach((key) => {\n let minCount = convertedSchema[key].minCount;\n if (minCount) {\n initialDocument[key] = initialDocument[key] || [];\n while (initialDocument[key].length < minCount)\n initialDocument[key].push({});\n }\n });\n\n // remove all instances of the `__typename` property from document\n removeProperty(initialDocument, \"__typename\");\n\n return {\n disabled: nextProps.disabled,\n errors: [],\n deletedValues: [],\n currentValues: {},\n originalSchema: convertSchema(schema, { removeArrays: false }),\n // convert SimpleSchema schema into JSON object\n schema: convertedSchema,\n // Also store all field schemas (including nested schemas) in a flat structure\n flatSchema: convertSchema(schema, { flatten: true }),\n // the initial document passed as props\n initialDocument,\n // initialize the current document to be the same as the initial document\n currentDocument: initialDocument,\n };\n};\n\nconst getChildrenProps = (\n props: FormProps,\n state: Pick<FormState, \"disabled\" | \"currentDocument\">,\n options: { formType: FormType },\n // TODO: that belongs to the context instead\n callbacks: { deleteDocument: Function }\n): {\n formLayoutProps: any;//FormLayoutProps;\n formGroupProps: Function;\n commonProps: any;\n formSubmitProps: any;// FormSubmitProps;\n} => {\n const {\n currentUser,\n repeatErrors,\n submitLabel,\n cancelLabel,\n revertLabel,\n cancelCallback,\n revertCallback,\n id,\n model,\n prefilledProps,\n itemProperties,\n contextName,\n showRemove,\n showDelete,\n } = props;\n const { disabled, currentDocument } = state;\n const { formType } = options;\n const { deleteDocument } = callbacks;\n const commonProps = {\n document: currentDocument,\n formType,\n currentUser,\n disabled,\n prefilledProps,\n itemProperties,\n contextName,\n };\n\n const docClassName = `document-${formType}`;\n const modelName = model.name.toLowerCase();\n const formProps = {\n className: `${docClassName} ${docClassName}-${modelName}`,\n id: id,\n // It's the form element responsibility to get submitForm from context\n // onSubmit: this.submitForm(formType),\n // TODO: update to useRef\n //ref: (e) => {\n // this.form = e;\n //},\n };\n\n const formGroupProps = (group) => ({\n key: group.name,\n ...group,\n group: omit(group, [\"fields\"]),\n ...commonProps,\n });\n\n const formSubmitProps = {\n model,\n currentUser,\n submitLabel,\n cancelLabel,\n revertLabel,\n cancelCallback,\n revertCallback,\n document: currentDocument,\n // TODO: should probably be passed through context\n deleteDocument:\n (formType === \"edit\" && showRemove && showDelete && deleteDocument) ||\n null,\n };\n\n const formLayoutProps = {\n formProps: formProps,\n repeatErrors: repeatErrors,\n submitProps: formSubmitProps,\n commonProps,\n };\n return {\n commonProps,\n formSubmitProps,\n formGroupProps,\n formLayoutProps,\n };\n};\n\n// component form until we go stateless\nconst FormWarnUnsaved = ({\n isChanged,\n warnUnsavedChanges,\n children,\n}: {\n isChanged: boolean;\n warnUnsavedChanges?: boolean;\n children: React.ReactNode;\n}) => {\n useWarnOnUnsaved({\n isChanged,\n warnUnsavedChanges,\n });\n return <>{children}</>;\n};\n\n/*\n\n Like getDocument, but cross-reference with getFieldNames()\n to only return fields that actually need to be submitted\n\n Also remove any deleted values.\n\n */\nconst getData = (\n customArgs,\n props: FormProps,\n state: Pick<FormState, \"currentDocument\" | \"deletedValues\">,\n // previously from \"this\" object\n { submitFormCallbacks, form }: any\n) => {\n const { currentDocument } = state;\n const { model, prefilledProps } = props;\n // we want to keep prefilled data even for hidden/removed fields\n let data = prefilledProps || {};\n\n // omit prefilled props for nested fields\n data = omitBy(data, (value, key) => key.endsWith(\".$\"));\n\n const args = {\n schema: model.schema,\n excludeRemovedFields: false,\n excludeHiddenFields: false,\n replaceIntlFields: true,\n addExtraFields: false,\n ...customArgs,\n };\n\n // only keep relevant fields\n // for intl fields, make sure we look in foo_intl and not foo\n const fields = getFieldNames(props, currentDocument, args);\n data = { ...data, ...pick(currentDocument, ...fields) };\n\n // compact deleted values\n state.deletedValues.forEach((path) => {\n if (path.includes(\".\")) {\n /*\n\n If deleted field is a nested field, nested array, or nested array item, try to compact its parent array\n\n - Nested field: 'address.city'\n - Nested array: 'addresses.1'\n - Nested array item: 'addresses.1.city'\n\n */\n compactParent(data, path);\n }\n });\n\n // run data object through submitForm callbacks\n data = runCallbacks({\n callbacks: submitFormCallbacks,\n iterator: data,\n args: [\n {\n /*form: this*/\n },\n ],\n });\n\n return data;\n};\n\nexport const Form = (props: FormProps) => {\n const { initCallback, createDocument, updateDocument, deleteDocument } =\n props;\n const initialState = getInitialStateFromProps(props);\n const { schema, originalSchema, flatSchema, initialDocument } = initialState;\n const isFirstRender = useRef(true);\n useEffect(() => {\n if (isFirstRender.current) {\n isFirstRender.current = false; // toggle flag after first render/mounting\n return;\n }\n if (initCallback) initCallback(initialState.currentDocument);\n }, [initCallback]);\n const defaultProps = {\n layout: \"horizontal\",\n prefilledProps: {},\n repeatErrors: false,\n showRemove: true,\n showDelete: true,\n };\n const allProps = { ...defaultProps, ...props };\n const defaultValues = {};\n const submitFormCallbacks: Array<Function> = [];\n const successFormCallbacks: Array<Function> = [];\n const failureFormCallbacks: Array<Function> = [];\n const intl = useIntlContext();\n\n // --------------------------------------------------------------------- //\n // ------------------------------- Errors ------------------------------ //\n // --------------------------------------------------------------------- //\n\n /*\n\n Add error to form state\n\n Errors can have the following properties:\n - id: used as an internationalization key, for example `errors.required`\n - path: for field-specific errors, the path of the field with the issue\n - properties: additional data. Will be passed to vulcan-i18n as values\n - message: if id cannot be used as i81n key, message will be used\n\n */\n const [errors, setErrors] = useState<Array<any>>([]);\n const throwError = (error) => {\n let formErrors = getErrors(error);\n\n // eslint-disable-next-line no-console\n console.log(formErrors);\n\n // add error(s) to state\n setErrors((prevErrors) => [...prevErrors, ...formErrors]);\n };\n\n /*\n\n Clear errors for a field\n\n */\n const clearFieldErrors = (path) => {\n setErrors((prevErrors) =>\n prevErrors.filter((error) => error.path !== path)\n );\n };\n\n // --------------------------------------------------------------------- //\n // ------------------------------- Context ----------------------------- //\n // --------------------------------------------------------------------- //\n\n const [deletedValues, setDeletedValues] = useState<Array<any>>([]);\n\n // add something to deleted values\n const addToDeletedValues = (name) => {\n setDeletedValues((prevDeletedValues) => [...prevDeletedValues, name]);\n };\n\n interface Callbacks {\n submitFormCallbacks: Array<any>;\n successFormCallbacks: Array<any>;\n failureFormCallbacks: Array<any>;\n }\n const [callbacks, setCallbacks] = useState<Callbacks>({\n submitFormCallbacks: [],\n successFormCallbacks: [],\n failureFormCallbacks: [],\n });\n // add a callback to the form submission\n const addToSubmitForm = (callback) => {\n setCallbacks((cbs) => ({\n ...cbs,\n // submitFormCallbacks: [...cbs.submitFormCallbacks, callback],\n }));\n };\n\n // add a callback to form submission success\n const addToSuccessForm = (callback) => {\n setCallbacks((cbs) => ({\n ...cbs,\n successFormCallbacks: [...cbs.successFormCallbacks, callback],\n }));\n };\n\n // add a callback to form submission failure\n const addToFailureForm = (callback) => {\n setCallbacks((cbs) => ({\n ...cbs,\n failureFormCallbacks: [...cbs.failureFormCallbacks, callback],\n }));\n };\n\n const clearFormCallbacks = () => {\n setCallbacks({\n submitFormCallbacks: [],\n successFormCallbacks: [],\n failureFormCallbacks: [],\n });\n };\n\n /*\n setFormState = (fn) => {\n this.setState(fn);\n };\n */\n\n const [currentValues, setCurrentValues] = useState<Object>({});\n\n const submitFormContext = (formType: FormType) => (event /*newValues*/) => {\n /*\n TODO: previously this callback was updating the current values with new values after this call\n Need to check how this worked in Vulcan initially\n setCurrentValues((prevCurrentValues) => ({\n ...prevCurrentValues,\n ...newValues,\n }));\n */\n // TODO: previously, this was using a callback from setCurrentValues\n // this needs to be rearchitectured to work without, will need some check\n // https://stackoverflow.com/questions/56247433/how-to-use-setstate-callback-on-react-hooks\n submitForm(formType)(event);\n };\n\n // --------------------------------------------------------------------- //\n // ------------------------------ Lifecycle ---------------------------- //\n // --------------------------------------------------------------------- //\n\n /*\n\n When props change, reinitialize the form state\n Triggered only for data related props (collection, document, currentUser etc.)\n\n @see https://reactjs.org/blog/2018/06/07/you-probably-dont-need-derived-state.html\n\n */\n /*\n UNSAFE_componentWillReceiveProps(nextProps) {\n const needReset = !!RESET_PROPS.find(\n (prop) => !isEqual(this.props[prop], nextProps[prop])\n );\n if (needReset) {\n const newState = getInitialStateFromProps(nextProps);\n this.setState(newState);\n if (nextProps.initCallback)\n nextProps.initCallback(newState.currentDocument);\n }\n }*/\n\n const [currentDocument, setCurrentDocument] = useState<{\n title?: string;\n _id?: string;\n name?: string;\n }>(initialDocument);\n\n /*\n\n Manually update the current values of one or more fields(i.e. on change or blur).\n\n */\n const updateCurrentValues = (newValues, options: { mode?: string } = {}) => {\n // default to overwriting old value with new\n const { mode = \"overwrite\" } = options;\n const { changeCallback } = props;\n\n // keep the previous ones and extend (with possible replacement) with new ones\n // keep only the relevant properties\n const newState = {\n currentValues: cloneDeep(currentValues),\n currentDocument: cloneDeep(currentDocument),\n deletedValues: cloneDeep(deletedValues),\n };\n\n Object.keys(newValues).forEach((key) => {\n const path = key;\n let value = newValues[key];\n\n if (isEmptyValue(value)) {\n // delete value\n unset(newState.currentValues, path);\n set(newState.currentDocument, path, null);\n newState.deletedValues = [...newState.deletedValues, path];\n } else {\n // 1. update currentValues\n set(newState.currentValues, path, value);\n\n // 2. update currentDocument\n // For arrays and objects, give option to merge instead of overwrite\n if (mode === \"merge\" && (Array.isArray(value) || isObject(value))) {\n const oldValue = get(newState.currentDocument, path);\n set(newState.currentDocument, path, merge(oldValue, value));\n } else {\n set(newState.currentDocument, path, value);\n }\n\n // 3. in case value had previously been deleted, \"undelete\" it\n newState.deletedValues = without(newState.deletedValues, path);\n }\n });\n if (changeCallback) changeCallback(newState.currentDocument);\n\n // TODO: prefer a reducer\n setCurrentValues(newState.currentValues);\n setCurrentDocument(newState.currentDocument);\n setDeletedValues(newState.deletedValues);\n };\n\n /*\n\n Refetch the document from the database (in case it was updated by another process or to reset the form)\n\n */\n const refetchForm = () => {\n if (props.refetch) {\n props.refetch();\n }\n };\n\n const [disabled, setDisabled] = useState<boolean>(false); // TODO\n const [success, setSuccess] = useState<boolean>(false); // TODO\n /**\n * Clears form errors and values.\n *\n * @example Clear form\n * // form will be fully emptied, with exception of prefilled values\n * clearForm({ document: {} });\n *\n * @example Reset/revert form\n * // form will be reverted to its initial state\n * clearForm();\n *\n * @example Clear with new values\n * // form will be cleared but initialized with the new document\n * const document = {\n * // ... some values\n * };\n * clearForm({ document });\n *\n * @param {Object=} options\n * @param {Object=} options.document\n * Document to use as new initial document when values are cleared instead of\n * the existing one. Note that prefilled props will be merged\n */\n const clearForm = (options: { document?: any } = {}) => {\n const { document: optionsDocument } = options;\n const document = optionsDocument\n ? merge({}, props.prefilledProps, optionsDocument)\n : null;\n // TODO: prefer a reducer\n setErrors([]);\n setCurrentValues({});\n setDeletedValues([]);\n setCurrentDocument(document || initialDocument);\n // setInitialDocument(document || initialDocument);\n setDisabled(false);\n };\n\n const newMutationSuccessCallback = function <TModel = Object>(\n result: CreateDocumentResult<TModel>\n ) {\n mutationSuccessCallback(result, \"new\");\n };\n\n const editMutationSuccessCallback = function <TModel = Object>(\n result: UpdateDocumentResult<TModel>\n ) {\n mutationSuccessCallback(result, \"edit\");\n };\n\n const formRef = useRef(null);\n const mutationSuccessCallback = function <TModel = Object>(\n // must be called only on valid results\n result: CreateDocumentResult<TModel>,\n mutationType: FormType\n ) {\n // TODO: use a reducer\n setDisabled(false);\n setSuccess(true);\n // for new mutation, run refetch function if it exists\n // TODO: the create mutation should already return the freshest value, do we really need that?\n // instead we might want to update currentResult with the result of the creation\n if (mutationType === \"new\") refetchForm();\n let { document } = result;\n\n // call the clear form method (i.e. trigger setState) only if the form has not been unmounted\n // (we are in an async callback, everything can happen!)\n // TODO: this should rely on a ref\n if (formRef.current) {\n clearForm({\n document: mutationType === \"edit\" ? document : undefined,\n });\n }\n\n // run document through mutation success callbacks\n document = runCallbacks({\n callbacks: successFormCallbacks,\n iterator: document,\n args: [{ form: formRef.current }],\n });\n\n // run success callback if it exists\n if (props.successCallback) props.successCallback(document, { form: this });\n };\n\n // catch graphql errors\n const mutationErrorCallback = (document, error) => {\n setDisabled(false);\n\n // eslint-disable-next-line no-console\n console.error(\"// graphQL Error\");\n // eslint-disable-next-line no-console\n console.error(error);\n\n // run mutation failure callbacks on error, we do not allow the callbacks to change the error\n runCallbacks({\n callbacks: failureFormCallbacks,\n iterator: error,\n args: [{ error, form: formRef.current }],\n });\n\n if (!isEmpty(error)) {\n // add error to state\n throwError(error);\n }\n\n // run error callback if it exists\n if (props.errorCallback)\n props.errorCallback(document, error, { form: this });\n\n // scroll back up to show error messages\n // TODO: migrate this to scroll on top of the form\n //Utils.scrollIntoView(\".flash-message\");\n };\n\n /*\n\n Submit form handler\n\n */\n const submitForm = (formType: FormType) => async (event?: Event) => {\n event && event.preventDefault();\n event && event.stopPropagation();\n\n const { contextName } = props;\n\n // if form is disabled (there is already a submit handler running) don't do anything\n if (disabled) {\n return;\n }\n\n // clear errors and disable form while it's submitting\n setErrors([]);\n setDisabled(true);\n\n // complete the data with values from custom components\n // note: it follows the same logic as SmartForm's getDocument method\n let data = getData(\n { replaceIntlFields: true, addExtraFields: false, mutableFields },\n props,\n {\n currentDocument,\n deletedValues,\n },\n { form: formRef.current, submitFormCallbacks }\n );\n\n // if there's a submit callback, run it\n if (props.submitCallback) {\n data = props.submitCallback(data) || data;\n }\n\n if (formType === \"new\") {\n // create document form\n try {\n const result = await createDocument({\n input: {\n data,\n contextName,\n },\n });\n if (result.errors?.length) {\n // TODO: previously got from meta, we could have more than 1 error\n mutationErrorCallback(document, result.errors[0]);\n } else {\n newMutationSuccessCallback(result);\n }\n } catch (error) {\n mutationErrorCallback(document, error);\n }\n } else {\n // update document form\n try {\n const documentId = currentDocument._id;\n const result = await updateDocument({\n input: {\n id: documentId,\n data,\n contextName,\n },\n });\n // TODO: handle more than 1 error\n if (result.errors?.length) {\n mutationErrorCallback(document, result.errors[0]);\n } else {\n editMutationSuccessCallback(result);\n }\n } catch (error) {\n mutationErrorCallback(document, error);\n }\n }\n };\n\n /*\n\n Delete document handler\n\n */\n const deleteDocumentWithConfirm = () => {\n const document = currentDocument;\n const documentId = props.document._id;\n const documentTitle = document.title || document.name || \"\";\n\n const deleteDocumentConfirm = intl.formatMessage(\n { id: \"forms.delete_confirm\" },\n { title: documentTitle }\n );\n\n if (window.confirm(deleteDocumentConfirm)) {\n deleteDocument({ input: { id: documentId } })\n .then((mutationResult) => {\n // the mutation result looks like {data:{collectionRemove: null}} if succeeded\n if (props.removeSuccessCallback)\n props.removeSuccessCallback({ documentId, documentTitle });\n refetchForm();\n })\n .catch((error) => {\n // eslint-disable-next-line no-console\n console.log(error);\n });\n }\n };\n\n // --------------------------------------------------------------------- //\n // ------------------------- Props to Pass ----------------------------- //\n // --------------------------------------------------------------------- //\n\n // --------------------------------------------------------------------- //\n // ----------------------------- Render -------------------------------- //\n // --------------------------------------------------------------------- //\n\n const { successComponent, document, currentUser, model, warnUnsavedChanges } =\n props;\n const FormComponents = useVulcanComponents();\n\n const formType: \"edit\" | \"new\" = document ? \"edit\" : \"new\";\n\n // Fields computation\n const mutableFields =\n formType === \"edit\"\n ? getEditableFields(schema, currentUser, initialDocument)\n : getInsertableFields(schema, currentUser);\n\n const { formLayoutProps, formGroupProps } = getChildrenProps(\n props,\n { disabled, currentDocument },\n {\n formType,\n },\n {\n deleteDocument: deleteDocumentWithConfirm,\n }\n );\n const isChanged = isNotSameDocument(initialDocument, currentDocument);\n\n return success && successComponent ? (\n successComponent\n ) : (\n <FormWarnUnsaved\n isChanged={isChanged}\n warnUnsavedChanges={warnUnsavedChanges}\n >\n <FormContext.Provider\n value={{\n throwError,\n clearForm,\n refetchForm,\n isChanged,\n submitForm: submitFormContext(formType), //Change in name because we already have a function\n // called submitForm, but no reason for the user to know\n // about that\n addToDeletedValues: addToDeletedValues,\n updateCurrentValues: updateCurrentValues,\n getDocument: () => currentDocument,\n getLabel: (fieldName, fieldLocale) =>\n getLabel(model, flatSchema, intl, fieldName, fieldLocale),\n initialDocument: initialDocument,\n // TODO BAD: check where used\n //setFormState: this.setFormState,\n addToSubmitForm,\n addToSuccessForm,\n addToFailureForm,\n clearFormCallbacks,\n errors,\n currentValues,\n deletedValues,\n clearFieldErrors,\n }}\n >\n <FormComponents.FormLayout {...formLayoutProps}>\n {getFieldGroups(\n props,\n {\n currentDocument,\n schema,\n flatSchema,\n originalSchema,\n },\n intl,\n mutableFields,\n intl.formatMessage\n ).map((group, i) => (\n <FormComponents.FormGroup key={i} {...formGroupProps(group)} />\n ))}\n </FormComponents.FormLayout>\n </FormContext.Provider>\n </FormWarnUnsaved>\n );\n};\n\n// Mutation that yield a success result\ntype SuccessfulMutationResult<TData = Object> = MutationResult<TData> & {\n data: TData;\n};\n/**\n * Typeguared to allow considering the request as successful\n */\nconst isSuccessful = function <T = any>(\n result: MutationResult<T> | undefined\n): result is SuccessfulMutationResult<T> {\n return !!result?.data;\n};\n\nexport default Form;\n","/*\n * Schema converter/getters\n */\nimport { canCreateField, canUpdateField } from \"@vulcanjs/permissions\";\nimport { VulcanFieldSchema, VulcanSchema } from \"@vulcanjs/schema\";\nimport { getFieldType } from \"./utils\";\n\n/* getters */\n// filter out fields with \".\" or \"$\"\nexport const getValidFields = (schema) => {\n return Object.keys(schema).filter(\n (fieldName) => !fieldName.includes(\"$\") && !fieldName.includes(\".\")\n );\n};\n\n/*\n\nConvert a nested SimpleSchema schema into a JSON object\nIf flatten = true, will create a flat object instead of nested tree\n\n/* permissions */\n\n/**\n * @method Mongo.Collection.getInsertableFields\n * Get an array of all fields editable by a specific user for a given collection\n * @param {Object} user – the user for which to check field permissions\n */\nexport const getInsertableFields = function (schema, user) {\n const fields = Object.keys(schema).filter(function (fieldName) {\n var field = schema[fieldName];\n return canCreateField(user, field);\n });\n return fields;\n};\n\n/**\n * @method Mongo.Collection.getEditableFields\n * Get an array of all fields editable by a specific user for a given collection (and optionally document)\n * @param {Object} user – the user for which to check field permissions\n */\nexport const getEditableFields = function (schema, user, document) {\n const fields = Object.keys(schema).filter(function (fieldName) {\n var field = schema[fieldName];\n return canUpdateField(user, field, document);\n });\n return fields;\n};\n\nconst isNestedSchema = (schema: any): schema is VulcanSchema => {\n return typeof schema === \"object\";\n};\n\n/**\n * Vulcan Schema => Form Schema\n * TODO: type this better\n * @param schema\n * @param options\n * @returns\n */\nexport const convertSchema = (\n schema: VulcanSchema,\n options: { flatten?: boolean; removeArrays?: boolean } = {}\n) => {\n const { flatten = false, removeArrays = true } = options;\n\n let jsonSchema = {};\n\n Object.keys(schema).forEach((fieldName) => {\n // exclude array fields\n if (removeArrays && fieldName.includes(\"$\")) {\n return;\n }\n\n // extract schema\n jsonSchema[fieldName] = getFieldSchema(fieldName, schema);\n\n // check for existence of nested field\n // and get its schema if possible or its type otherwise\n const subSchemaOrType = getNestedFieldSchemaOrType(fieldName, schema);\n if (subSchemaOrType) {\n // remember the subschema if it exists, allow to customize labels for each group of items for arrays of objects\n jsonSchema[fieldName].arrayFieldSchema = getFieldSchema(\n `${fieldName}.$`,\n schema\n );\n\n // nested schema can be a field schema ({type, canRead, etc.}) (convertedSchema will be null)\n // or a schema on its own with subfields (convertedSchema will return smth)\n if (isNestedSchema(subSchemaOrType)) {\n // call convertSchema recursively on the subSchema\n const convertedSubSchema = convertSchema(subSchemaOrType, options);\n // subSchema is a full schema with multiple fields (eg array of objects)\n if (flatten) {\n jsonSchema = { ...jsonSchema, ...convertedSubSchema };\n } else {\n jsonSchema[fieldName].schema = convertedSubSchema;\n }\n } else {\n // subSchema is a simple field in this case (eg array of numbers)\n jsonSchema[fieldName].isSimpleArrayField = true; //getFieldSchema(`${fieldName}.$`, schema);\n }\n }\n });\n return jsonSchema;\n};\n\n/*\n\nGet a JSON object representing a field's schema\n\n*/\nexport const getFieldSchema = (fieldName: string, schema: VulcanSchema) => {\n let fieldSchema = {};\n schemaProperties.forEach((property) => {\n const propertyValue = schema[fieldName]?.[property];\n if (propertyValue) {\n fieldSchema[property] = propertyValue;\n }\n });\n return fieldSchema;\n};\n\n// type is an array due to the possibility of using SimpleSchema.oneOf\n// right now we support only fields with one type\nexport const getSchemaType = (fieldSchema: VulcanFieldSchema) =>\n getFieldType(fieldSchema);\n\nconst getArrayNestedSchema = (fieldName: string, schema: VulcanSchema) => {\n const arrayItemSchema = schema[`${fieldName}.$`];\n const nestedSchema = arrayItemSchema && getSchemaType(arrayItemSchema);\n return nestedSchema;\n};\n\n// TODO: not 100% it's valid with current implementation\nconst isNestedSchemaField = (fieldSchema: VulcanFieldSchema) => {\n const fieldType = getSchemaType(fieldSchema);\n return fieldType && typeof fieldType === \"object\";\n};\nconst getObjectNestedSchema = (fieldName: string, schema: VulcanSchema) => {\n const fieldSchema = schema[fieldName];\n if (!isNestedSchemaField(fieldSchema)) return null;\n const nestedSchema = fieldSchema && getSchemaType(fieldSchema);\n return nestedSchema;\n};\n/*\n\nGiven an array field, get its nested schema\nIf the field is not an object, this will return the subfield type instead\n*/\nexport const getNestedFieldSchemaOrType = (fieldName, schema) => {\n const arrayItemSchema = getArrayNestedSchema(fieldName, schema);\n if (!arrayItemSchema) {\n // look for an object schema\n const objectItemSchema = getObjectNestedSchema(fieldName, schema);\n // no schema was found\n if (!objectItemSchema) return null;\n return objectItemSchema;\n }\n return arrayItemSchema;\n};\n\nexport const schemaProperties = [\n \"type\",\n \"label\",\n \"optional\",\n \"required\",\n \"min\",\n \"max\",\n \"exclusiveMin\",\n \"exclusiveMax\",\n \"minCount\",\n \"maxCount\",\n \"allowedValues\",\n \"regEx\",\n \"blackbox\",\n \"trim\",\n \"custom\",\n \"defaultValue\",\n \"autoValue\",\n \"hidden\", // hidden: true means the field is never shown in a form no matter what\n \"mustComplete\", // mustComplete: true means the field is required to have a complete profile\n \"form\", // form placeholder\n \"inputProperties\", // form placeholder\n \"itemProperties\",\n \"control\", // SmartForm control (String or React component)\n \"input\", // SmartForm control (String or React component)\n \"autoform\", // legacy form placeholder; backward compatibility (not used anymore)\n \"order\", // position in the form\n \"group\", // form fieldset group\n \"onCreate\", // field insert callback\n \"onUpdate\", // field edit callback\n \"onDelete\", // field remove callback\n \"onInsert\", // OpenCRUD backwards compatibility\n \"onEdit\", // OpenCRUD backwards compatibility\n \"onRemove\", // OpenCRUD backwards compatibility\n \"canRead\",\n \"canCreate\",\n \"canUpdate\",\n \"viewableBy\", // OpenCRUD backwards compatibility\n \"insertableBy\", // OpenCRUD backwards compatibility\n \"editableBy\", // OpenCRUD backwards compatibility\n \"resolveAs\",\n \"searchable\",\n \"description\",\n \"beforeComponent\",\n \"afterComponent\",\n \"placeholder\",\n \"options\",\n \"query\",\n \"queryWaitsForValue\",\n \"autocompleteQuery\",\n \"fieldProperties\",\n \"intl\",\n \"intlId\",\n];\n\nexport const formProperties = [\n \"optional\",\n \"required\",\n \"min\",\n \"max\",\n \"exclusiveMin\",\n \"exclusiveMax\",\n \"minCount\",\n \"maxCount\",\n \"allowedValues\",\n \"regEx\",\n \"blackbox\",\n \"trim\",\n \"custom\",\n \"defaultValue\",\n \"autoValue\",\n \"mustComplete\", // mustComplete: true means the field is required to have a complete profile\n \"form\", // form placeholder\n \"inputProperties\", // form placeholder\n \"itemProperties\",\n \"control\", // SmartForm control (String or React component)\n \"input\", // SmartForm control (String or React component)\n \"order\", // position in the form\n \"group\", // form fieldset group\n \"description\",\n \"beforeComponent\",\n \"afterComponent\",\n \"placeholder\",\n \"options\",\n \"query\",\n \"queryWaitsForValue\",\n \"autocompleteQuery\",\n \"fieldProperties\",\n];\n","import merge from \"lodash/merge.js\";\nimport find from \"lodash/find.js\";\nimport isPlainObject from \"lodash/isPlainObject.js\";\nimport set from \"lodash/set.js\";\nimport size from \"lodash/size.js\";\n\nimport { removePrefix, filterPathsByPrefix } from \"./path_utils\";\nimport { VulcanFieldSchema } from \"@vulcanjs/schema\";\n\n// add support for nested properties\nexport const deepValue = function (obj, path) {\n const pathArray = path.split(\".\");\n\n for (var i = 0; i < pathArray.length; i++) {\n obj = obj[pathArray[i]];\n }\n\n return obj;\n};\n\n// see http://stackoverflow.com/questions/19098797/fastest-way-to-flatten-un-flatten-nested-json-objects\nexport const flatten = function (data) {\n var result = {};\n function recurse(cur, prop) {\n if (Object.prototype.toString.call(cur) !== \"[object Object]\") {\n result[prop] = cur;\n } else if (Array.isArray(cur)) {\n for (var i = 0, l = cur.length; i < l; i++)\n recurse(cur[i], prop + \"[\" + i + \"]\");\n if (l == 0) result[prop] = [];\n } else {\n var isEmpty = true;\n for (var p in cur) {\n isEmpty = false;\n recurse(cur[p], prop ? prop + \".\" + p : p);\n }\n if (isEmpty && prop) result[prop] = {};\n }\n }\n recurse(data, \"\");\n return result;\n};\n\nexport const isEmptyValue = (value) =>\n typeof value === \"undefined\" ||\n value === null ||\n value === \"\" ||\n (Array.isArray(value) && value.length === 0);\n\n/**\n * Merges values. It takes into account the current, original and deleted values,\n * and the merge produces the proper type for simple objects or arrays.\n *\n * @param {Object} props\n * Form component props. Only specific properties for this function are documented.\n * @param {*} props.currentValue\n * Current value of the field\n * @param {*} props.documentValue\n * Original value of the field\n * @return {*|undefined}\n * Merged value or undefined if no merge was performed\n */\nexport const mergeValue = ({\n currentValue,\n documentValue,\n deletedValues: deletedFields,\n path,\n locale,\n datatype,\n}) => {\n if (locale) {\n // note: intl fields are of type Object but should be treated as Strings\n return currentValue || documentValue || \"\";\n }\n\n // note: retrieve nested deleted values is performed here to avoid skipping\n // the merge in case the current field is not in `currentValues` but a nested\n // property has been removed directly by path\n const deletedValues = getNestedDeletedValues(path, deletedFields);\n const hasDeletedValues = !!size(deletedValues);\n if (\n (Array.isArray(currentValue) || hasDeletedValues) &&\n find(datatype, [\"type\", Array])\n ) {\n return merge([], documentValue, currentValue, deletedValues);\n } else if (\n (isPlainObject(currentValue) || hasDeletedValues) &&\n find(datatype, [\"type\", Object])\n ) {\n return merge({}, documentValue, currentValue, deletedValues);\n }\n return undefined;\n};\n\n/**\n * Converts a list of field names to an object of deleted values.\n *\n * @param {string[]|Object.<string|string>} deletedFields\n * List of deleted field names or paths\n * @param {Object|Array=} accumulator={}\n * Value to reduce the values to\n * @return {Object|Array}\n * Deleted values, with the structure defined by taking the received deleted\n * fields as paths\n * @example\n * const deletedFields = [\n * 'field.subField',\n * 'field.subFieldArray[0]',\n * 'fieldArray[0]',\n * 'fieldArray[2].name',\n * ];\n * getNestedDeletedValues(deletedFields);\n * // => { 'field': { 'subField': null, 'subFieldArray': [null] }, 'fieldArray': [null, undefined, { name: null } }\n */\nexport const getDeletedValues = (deletedFields, accumulator = {}) =>\n deletedFields.reduce(\n (deletedValues, path) => set(deletedValues, path, null),\n accumulator\n );\n\n/**\n * Filters the given field names by prefix, removes it from each one of them\n * and convert the list to an object of deleted values.\n *\n * @param {string=} prefix\n * Prefix to filter and remove from deleted fields\n * @param {string[]|Object.<string|string>} deletedFields\n * List of deleted field names or paths\n * @param {Object|Array=} accumulator={}\n * Value to reduce the values to\n * @return {Object.<string, null>}\n * Object keyed with the given deleted fields, valued with `null`\n * @example\n * const deletedFields = [\n * 'field.subField',\n * 'field.subFieldArray[0]',\n * 'fieldArray[0]',\n * 'fieldArray[2].name',\n * ];\n * getNestedDeletedValues('field', deletedFields);\n * // => { 'subField': null, 'subFieldArray': [null] }\n * getNestedDeletedValues('fieldArray', deletedFields);\n * // => { '0': null, '2': { 'name': null } }\n * getNestedDeletedValues('fieldArray', deletedFields, []);\n * // => [null, undefined, { 'name': null } ]\n */\nexport const getNestedDeletedValues = (\n prefix,\n deletedFields,\n accumulator = {}\n) =>\n getDeletedValues(\n removePrefix(prefix, filterPathsByPrefix(prefix, deletedFields)),\n accumulator\n );\n\n//TODO: check if it still works as expected\n// previously was dataType[0].type\nexport const getFieldType = (fieldSchema: VulcanFieldSchema) =>\n fieldSchema.type;\n/**\n * Get appropriate null value for various field types\n *\n * @param {Array} datatype\n * Field's datatype property\n */\nexport const getNullValue = (datatype) => {\n const fieldType = getFieldType(datatype);\n if (fieldType === Array) {\n return [];\n } else if (fieldType === Boolean) {\n return false;\n } else if (fieldType === String) {\n return \"\";\n } else if (fieldType === Number) {\n return \"\";\n } else {\n // normalize to null\n return null;\n }\n};\n","import toPath from \"lodash/toPath.js\";\nimport initial from \"lodash/initial.js\";\nimport flow from \"lodash/fp/flow.js\";\nimport takeRight from \"lodash/takeRight.js\";\n\n/**\n * Splits a path in string format into an array.\n */\nexport const splitPath = (string: string) => toPath(string);\n\n/**\n * Joins a path in array format into a string.\n */\nexport const joinPath = (array: Array<string | number>): string =>\n array.reduce<string>(\n (string, item) =>\n string +\n (Number.isNaN(Number(item))\n ? `${string === \"\" ? \"\" : \".\"}${item}`\n : `[${item}]`),\n \"\"\n );\n\n/**\n * Retrieves parent path from the given one.\n *\n * @param {String} string\n * Path in string format\n * @return {String}\n */\nexport const getParentPath = flow(splitPath, initial, joinPath);\n\n/**\n * Removes prefix from the given paths.\n *\n * @param {String} prefix\n * @param {String[]} paths\n * @return {String[]}\n */\nexport const removePrefix = (\n prefix: string,\n paths: Array<string>\n): Array<string> => {\n const explodedPrefix = splitPath(prefix);\n return paths.map((path) => {\n if (path === prefix) {\n return path;\n }\n const explodedPath = splitPath(path);\n const explodedSuffix = takeRight(\n explodedPath,\n explodedPath.length - explodedPrefix.length\n );\n return joinPath(explodedSuffix);\n });\n};\n\n/**\n * Filters paths that have the given prefix.\n *\n * @param {String} prefix\n * @param {String[]} paths\n * @return {String[]}\n */\nexport const filterPathsByPrefix = (prefix: string, paths: Array<string>) =>\n paths.filter(\n (path) =>\n path === prefix ||\n path.startsWith(`${prefix}.`) ||\n path.startsWith(`${prefix}[`)\n );\n","/**\n * Field processing functions that computes groups and add relevant props for i18n\n */\nimport { formProperties } from \"../../utils/schema_utils\";\nimport { FieldGroup } from \"@vulcanjs/schema\";\nimport { FormField } from \"../../typings\";\nimport { FormProps, FormState } from \"./typings\";\n\n/**\n * Field related functions\n */\n\nimport { VulcanSchema } from \"@vulcanjs/schema\";\nimport uniq from \"lodash/uniq.js\";\nimport compact from \"lodash/compact.js\";\nimport get from \"lodash/get.js\";\nimport pick from \"lodash/pick.js\";\nimport {\n isIntlField,\n formatLabel,\n getIntlKeys,\n getIntlLabel,\n} from \"@vulcanjs/i18n\";\n\nimport { IntlProviderContextValue } from \"@vulcanjs/react-i18n\";\nimport map from \"lodash/map.js\";\nimport sortBy from \"lodash/sortBy.js\";\nimport uniqBy from \"lodash/uniqBy.js\";\nimport difference from \"lodash/difference.js\";\nimport reject from \"lodash/reject.js\";\nimport intersection from \"lodash/intersection.js\";\nimport _filter from \"lodash/filter.js\";\nimport { capitalize } from \"@vulcanjs/utils\";\nimport { VulcanFieldSchema } from \"@vulcanjs/schema\";\nimport { VulcanModel } from \"@vulcanjs/model\";\n\n/*\n\n Get a field's intl keys (useful for debugging)\n\n */\nconst getModelIntlKeys = (\n model: VulcanModel,\n flatSchema: any,\n fieldName: string\n) => {\n return getIntlKeys({\n fieldName: fieldName,\n modelName: model.name,\n schema: flatSchema,\n });\n};\n\n/*\n\n Get a field's label\n\n */\nexport const getLabel = (\n model: VulcanModel,\n flatSchema: any,\n context: IntlProviderContextValue,\n fieldName: string,\n fieldLocale?: string\n) => {\n const collectionName = model.name.toLowerCase();\n const label = formatLabel({\n intl: context,\n fieldName: fieldName,\n collectionName: collectionName,\n schema: flatSchema,\n });\n if (fieldLocale) {\n const intlFieldLocale = context.formatMessage({\n id: `locales.${fieldLocale}`,\n defaultMessage: fieldLocale,\n });\n return `${label} (${intlFieldLocale})`;\n } else {\n return label;\n }\n};\n\n/*\n\n Get a field's description\n\n (Same as getLabel but pass isDescription: true )\n */\nconst getDescription = (\n model: VulcanModel,\n flatSchema: any,\n context: any,\n fieldName: string\n) => {\n const collectionName = model.name.toLowerCase();\n const description = getIntlLabel({\n intl: context,\n fieldName: fieldName,\n collectionName: collectionName,\n schema: flatSchema,\n isDescription: true,\n });\n return description || null;\n};\n\n/*\n\n Get a field option's label\n\n */\nconst getOptionLabel = (\n model: VulcanModel,\n context: { formatMessage: Function },\n fieldName: string,\n option: { intlId?: string; label: string; value?: any }\n) => {\n const collectionName = model.name.toLowerCase();\n const intlId =\n option.intlId || `${collectionName}.${fieldName}.${option.value}`;\n return context.formatMessage({\n id: intlId,\n defaultMessage: option.label,\n });\n};\n\n/*\n\n Get a list of the fields to be included in the current form\n\n Note: when submitting the form (getData()), do not include any extra fields.\n\n */\nexport const getFieldNames = (\n props: Pick<FormProps, \"fields\" | \"addFields\" | \"removeFields\">,\n currentDocument,\n optionsFromArgs: {\n excludeHiddenFields?: boolean;\n excludeRemovedFields?: boolean;\n replaceIntlFields?: boolean;\n addExtraFields?: boolean;\n schema?: VulcanSchema;\n mutableFields?: Array<any>;\n }\n) => {\n const { fields, addFields, removeFields } = props;\n const defaultOptions = {\n excludeHiddenFields: true,\n excludeRemovedFields: true,\n replaceIntlFields: false,\n addExtraFields: false,\n };\n const options = {\n ...defaultOptions,\n ...optionsFromArgs,\n };\n const {\n schema,\n mutableFields,\n excludeRemovedFields,\n excludeHiddenFields,\n addExtraFields,\n replaceIntlFields,\n } = options;\n\n // get all editable/insertable fields (depending on current form type)\n let relevantFields = mutableFields;\n\n // if \"fields\" prop is specified, restrict list of fields to it\n if (typeof fields !== \"undefined\" && fields.length > 0) {\n relevantFields = intersection(relevantFields, fields);\n }\n\n // if \"hideFields\" prop is specified, remove its fields\n if (excludeRemovedFields) {\n // OpenCRUD backwards compatibility\n //const removeFields = removeFields || hideFields;\n if (typeof removeFields !== \"undefined\" && removeFields.length > 0) {\n relevantFields = difference(relevantFields, removeFields);\n }\n }\n\n // if \"addFields\" prop is specified, add its fields\n if (\n addExtraFields &&\n typeof addFields !== \"undefined\" &&\n addFields.length > 0\n ) {\n relevantFields = relevantFields?.concat(addFields);\n }\n\n // remove all hidden fields\n if (excludeHiddenFields) {\n const document = currentDocument;\n relevantFields = reject(relevantFields, (fieldName) => {\n const hidden = schema?.[fieldName].hidden;\n return typeof hidden === \"function\"\n ? hidden({ props, document })\n : hidden;\n });\n }\n\n // replace intl fields\n if (replaceIntlFields) {\n relevantFields = relevantFields?.map((fieldName) =>\n isIntlField(schema?.[fieldName]) ? `${fieldName}_intl` : fieldName\n );\n }\n\n // remove any duplicates\n relevantFields = uniq(relevantFields);\n\n return relevantFields;\n};\n\n// --------------------------------------------------------------------- //\n// -------------------------------- Fields ----------------------------- //\n// --------------------------------------------------------------------- //\n\nconst initField = (\n props: { model: VulcanModel; layout?: \"horizontal\" | \"vertical\" },\n state: Pick<FormState, \"currentDocument\" | \"flatSchema\" | \"originalSchema\">,\n context: any,\n fieldName: string,\n fieldSchema: VulcanFieldSchema\n) => {\n const { model } = props;\n const { currentDocument, flatSchema } = state;\n const isArray = fieldSchema.type === Array;\n\n // intialize properties\n let field: Partial<FormField> = {\n ...pick(fieldSchema, formProperties),\n name: fieldName,\n datatype: fieldSchema.type,\n layout: props.layout, // A layout property used to control how the form fields are displayed. Defaults to horizontal.\n input: fieldSchema.input || fieldSchema.control, // TODO\n };\n\n // if this is an array field also store its array item type\n if (isArray) {\n const itemFieldSchema = state.originalSchema[`${fieldName}.$`];\n field.itemDatatype = get(itemFieldSchema, \"type.0.type\");\n }\n\n field.label = getLabel(model, flatSchema, context, fieldName);\n field.intlKeys = getIntlKeys({\n fieldName,\n modelName: model.name,\n schema: model.schema,\n });\n // // replace value by prefilled value if value is empty\n // const prefill = fieldSchema.prefill || (fieldSchema.form && fieldSchema.form.prefill);\n // if (prefill) {\n // const prefilledValue = typeof prefill === 'function' ? prefill.call(fieldSchema) : prefill;\n // if (!!prefilledValue && !field.value) {\n // field.prefilledValue = prefilledValue;\n // field.value = prefilledValue;\n // }\n // }\n\n const document = currentDocument;\n field.document = document;\n\n // internationalize field options labels\n if (field.options && Array.isArray(field.options)) {\n field.options = field.options.map((option) => ({\n ...option,\n label: getOptionLabel(model, context, fieldName, option),\n }));\n }\n\n // if this an intl'd field, use a special intlInput\n if (isIntlField(fieldSchema)) {\n field.intlInput = true;\n }\n\n // add any properties specified in fieldSchema.form as extra props passed on\n // to the form component, calling them if they are functions\n const inputProperties = fieldSchema.form || fieldSchema.inputProperties || {};\n for (const prop in inputProperties) {\n const property = inputProperties[prop];\n field[prop] =\n typeof property === \"function\"\n ? property.call(fieldSchema, {\n ...props,\n fieldName,\n document,\n intl: context,\n })\n : property;\n }\n\n // add description as help prop\n const description = getDescription(model, flatSchema, context, fieldName);\n if (description) {\n field.help = description;\n }\n\n return field as FormField;\n};\nconst handleFieldPath = (\n field: FormField,\n fieldName: string,\n parentPath?: string\n) => {\n const fieldPath = parentPath ? `${parentPath}.${fieldName}` : fieldName;\n field.path = fieldPath;\n // TODO: reintroduce this side effect to correctly set the default values\n // (previously was in Form.tsx)\n // Note sure if this is actually needed\n // if (field.defaultValue) {\n // set(this.defaultValues, fieldPath, field.defaultValue);\n // }\n return field;\n};\nconst handleFieldParent = (field: FormField, parentFieldName?: string) => {\n // if field has a parent field, pass it on\n if (parentFieldName) {\n field.parentFieldName = parentFieldName;\n }\n\n return field;\n};\nconst handlePermissions = (\n field: FormField,\n fieldName: string,\n mutableFields: Array<any>\n) => {\n // if field is not creatable/updatable, disable it\n if (!mutableFields.includes(fieldName)) {\n field.disabled = true;\n }\n return field;\n};\nconst handleFieldChildren = (\n props: FormProps,\n state: Pick<FormState, \"currentDocument\" | \"flatSchema\" | \"originalSchema\">,\n context: any,\n field: FormField,\n fieldName: string,\n fieldSchema: any, // TODO: not a VulcanField, more a FormField\n schema: VulcanSchema,\n mutableFields: Array<any>\n) => {\n const { currentDocument } = state;\n // array field\n if (fieldSchema.arrayFieldSchema) {\n field.arrayFieldSchema = fieldSchema.arrayFieldSchema;\n // create a field that can be exploited by the form\n field.arrayField = createArraySubField(\n props,\n state,\n context,\n fieldName,\n field.arrayFieldSchema,\n schema,\n mutableFields\n );\n //field.nestedInput = true\n }\n // nested fields: set input to \"nested\"\n if (fieldSchema.schema) {\n field.nestedSchema = fieldSchema.schema;\n field.nestedInput = true;\n\n // get nested schema\n // for each nested field, get field object by calling createField recursively\n field.nestedFields = getFieldNames(props, currentDocument, {\n schema: field.nestedSchema,\n addExtraFields: false,\n }).map((subFieldName) => {\n return createField(\n props,\n state,\n context,\n subFieldName,\n field.nestedSchema,\n mutableFields,\n fieldName,\n field.path\n );\n });\n }\n return field;\n};\n\n/*\n Given a field's name, the containing schema, and parent, create the\n complete field object to be passed to the component\n\n */\nconst createField = (\n props: FormProps,\n state: Pick<FormState, \"currentDocument\" | \"flatSchema\" | \"originalSchema\">,\n context: any,\n fieldName: string,\n schema: any,\n mutableFields: Array<any>,\n parentFieldName?: string,\n parentPath?: string\n): FormField => {\n const fieldSchema = schema[fieldName];\n let field = initField(props, state, context, fieldName, fieldSchema);\n field = handleFieldPath(field, fieldName, parentPath);\n field = handleFieldParent(field, parentFieldName);\n field = handlePermissions(field, fieldName, mutableFields);\n field = handleFieldChildren(\n props,\n state,\n context,\n field,\n fieldName,\n fieldSchema,\n schema,\n mutableFields\n );\n return field;\n};\nconst createArraySubField = (\n props: FormProps,\n state: Pick<FormState, \"currentDocument\" | \"flatSchema\" | \"originalSchema\">,\n context: any,\n fieldName: string,\n subFieldSchema: VulcanFieldSchema,\n schema: VulcanSchema,\n mutableFields: Array<string>\n) => {\n const subFieldName = `${fieldName}.$`;\n let subField = initField(props, state, context, subFieldName, subFieldSchema);\n // array subfield has the same path and permissions as its parent\n // so we use parent name (fieldName) and not subfieldName\n subField = handleFieldPath(subField, fieldName);\n subField = handlePermissions(subField, fieldName, mutableFields /*schema*/);\n // we do not allow nesting yet\n //subField = this.handleFieldChildren(field, fieldSchema)\n return subField;\n};\n\n// Group of multiple fields (obtained by parsing the whole schema)\ninterface GroupWithFields extends FieldGroup {\n fields: Array<FormField>;\n}\n\ntype FormSchemaState = Pick<\n FormState,\n \"currentDocument\" | \"schema\" | \"flatSchema\" | \"originalSchema\"\n>;\n\n/*\n\n Get all field groups\n\n */\nexport const getFieldGroups = (\n props: FormProps,\n state: FormSchemaState,\n context: IntlProviderContextValue,\n mutableFields: Array<string>,\n formatMessage: any\n) => {\n const { schema, currentDocument } = state;\n // build fields array by iterating over the list of field names\n let fields = getFieldNames(props, currentDocument, {\n mutableFields,\n schema,\n }).map((fieldName) => {\n // get schema for the current field\n return createField(props, state, context, fieldName, schema, mutableFields);\n });\n\n fields = sortBy(fields, \"order\");\n\n // get list of all unique groups (based on their name) used in current fields, remove \"empty\" group\n let groups = compact(uniqBy(map(fields, \"group\"), (g) => (g ? g.name : \"\")));\n\n // for each group, add relevant fields\n let groupsWithFields = groups.map((group) => {\n const label =\n group.label ||\n //this.context.formatMessage({ id: group.name }) ||\n capitalize(group.name);\n const groupFields = _filter<FormField>(fields, (field) => {\n return field.group && field.group.name === group.name;\n });\n const groupWithFields: GroupWithFields = {\n ...group,\n label,\n fields: groupFields,\n };\n return groupWithFields;\n });\n\n // add default group if necessary\n const defaultGroupFields = _filter(fields, (field) => !field.group);\n if (defaultGroupFields.length) {\n const defaultGroup: GroupWithFields = {\n name: \"default\",\n label: \"default\",\n order: 0,\n fields: defaultGroupFields,\n };\n groupsWithFields = [defaultGroup].concat(groupsWithFields);\n }\n\n // sort by order\n groupsWithFields = sortBy(groupsWithFields, \"order\");\n\n // console.log(groups);\n\n return groupsWithFields;\n};\n","import find from \"lodash/find.js\";\nimport isEqualWith from \"lodash/isEqualWith.js\";\nexport const isNotSameDocument = (initialDocument, changedDocument) => {\n const changedValue = find(changedDocument, (value, key, collection) => {\n return !isEqualWith(value, initialDocument[key], (objValue, othValue) => {\n if (!objValue && !othValue) return true;\n });\n });\n return typeof changedValue !== \"undefined\";\n};\n","export * from \"./useWarnOnUnsaved\";\n","import { useBlockTransition } from \"../useBlockTransition/useBlockTransition\";\nimport debug from \"debug\";\nimport { useIntlContext } from \"@vulcanjs/react-i18n\";\nconst debugTransitions = debug(\"vn:route-transitions\");\n\n/**\n * Can trigger an alert on unsaved changes\n *\n * Triggers event so you can also block SPA transition (implementation is NOT provided by this hook, you\n * need listeners whose implementation depends on your router (React Router, Next Router...), see block.ts)\n *\n * @see https://github.com/ReactTraining/history/blob/master/docs/blocking-transitions.md\n *\n * @param param0\n */\nexport const useWarnOnUnsaved = ({\n isChanged,\n warnUnsavedChanges,\n}: {\n isChanged: boolean;\n warnUnsavedChanges?: boolean;\n}) => {\n const context = useIntlContext();\n /**\n * To be passed to onbeforeunload event. The returned message will be displayed\n * by the prompt.\n *\n * see https://developer.mozilla.org/en-US/docs/Web/API/WindowEventHandlers/onbeforeunload\n * the message returned is actually ignored by most browsers and a default message 'Are you sure you want to leave this page? You might have unsaved changes' is displayed. See the Notes section on the mozilla docs above\n */\n const getBlockedMessage = (event?: BeforeUnloadEvent) => {\n debugTransitions(\"running handlePageLeave\", event);\n const message = context.formatMessage({\n id: \"forms.confirm_discard\",\n defaultMessage: \"Are you sure you want to discard your changes?\",\n });\n return message;\n };\n useBlockTransition({\n shouldBlock: !!(warnUnsavedChanges && isChanged),\n getBlockedMessage: getBlockedMessage,\n });\n};\n","import { useEffect, useRef } from \"react\";\nimport { block } from \"./block\";\nimport debug from \"debug\";\nconst debugTransitions = debug(\"vn:router-transitions\");\n\n/**\n * Can trigger an alert on unsaved changes\n *\n * Triggers event so you can also block SPA transition (implementation is NOT provided by this hook, you\n * need listeners whose implementation depends on your router (React Router, Next Router...), see block.ts)\n *\n * @see https://github.com/ReactTraining/history/blob/master/docs/blocking-transitions.md\n *\n * @param param0\n */\nexport const useBlockTransition = ({\n shouldBlock,\n getBlockedMessage,\n}: {\n shouldBlock: boolean;\n getBlockedMessage: (evt?: BeforeUnloadEvent) => string;\n}) => {\n // function to unblock the form\n const unblockRef = useRef<Function | undefined>();\n\n useEffect(() => {\n const isBlocking = !!unblockRef.current;\n debugTransitions(\n \"running effect\",\n \"should block\",\n shouldBlock,\n \"currently blocked\",\n isBlocking\n );\n\n const onUnblock = () => {\n debugTransitions(\"running unblock from effect\");\n if (!shouldBlock) {\n if (unblockRef.current) {\n unblockRef.current();\n }\n }\n };\n // block\n const onBlocked = (evt?: BeforeUnloadEvent): string => {\n const message = getBlockedMessage(evt);\n debugTransitions(\n \"user is being blocked after trying to leave the page, with message: \" +\n message\n );\n if (evt) {\n evt.returnValue = message;\n }\n return message;\n };\n if (shouldBlock) {\n debugTransitions(\n \"should block transition, setting up relevant event listener\"\n );\n unblockRef.current = block(onBlocked, onUnblock);\n }\n // unblock if not blocking anymore and was blocking previously\n if (!shouldBlock && isBlocking) {\n debugTransitions(\"should unblock (state has been reinitialized)\");\n if (unblockRef.current) {\n unblockRef.current();\n }\n }\n // trigger the potentially registered unblock function when component unmounts\n //return onUnblock;\n }, [shouldBlock]);\n};\n","import debug from \"debug\";\nconst debugTransitions = debug(\"vn:route-transition\");\nconst BeforeUnloadEventType = \"beforeunload\";\n/**\n * Event triggered when a warning on unsaved changes is necessary\n * The app should listen for this event to setup relevant blocking methods depending on the framework\n *\n * For instance with React Router:\n *\n * let unblock\n * window.addEventListener(\"blocktransition\", () => {\n * unblock = router.history.block(...)\n * })\n * window.addEventListener(\"unblocktransition\", () => {\n * unblock()\n * })\n *\n * For Next.js, you would do something similar\n * Check https://github.com/vercel/next.js/discussions/12348\n *\n */\nexport const BLOCK_TRANSITION_EVENT_TYPE = \"blocktransition\";\n/**\n * Called when blocking is not necessary anymore:\n * - there are no unsaved changes anymore\n * - user has confirmed they want to leave\n */\nexport const UNBLOCK_TRANSITION_EVENT_TYPE = \"unblocktransition\";\n/**\n * Intercepts the beforeunload event\n *\n * Code taken from React Router history feature\n * @see https://github.com/ReactTraining/history/blob/master/docs/blocking-transitions.md\n */\nfunction blockBeforeUnload(event: BeforeUnloadEvent) {\n // Cancel the event.\n event.preventDefault();\n // Chrome (and legacy IE) requires returnValue to be set.\n event.returnValue = \"\";\n}\n\n/**\n * Blocks transition\n *\n * /!\\ In order to catch SPA transition, you need to implement\n * an event listener in your own app.\n *\n *\n * @param onUnblock Callback to call on unblock, for custom behaviour\n * @returns A function to unblock the transition (eg if the form is back to\n * its original state)\n */\nexport const block = (\n setConfirmationMessage: (event?: BeforeUnloadEvent) => string,\n onUnblock?: Function\n) => {\n debugTransitions(\"running block function\");\n // trigger a block event, to be handled at the framework level\n // TODO: setConfirmationMessage should be passed as well\n const blockEvent = new Event(BLOCK_TRANSITION_EVENT_TYPE);\n window.dispatchEvent(blockEvent);\n // block at browser level\n window.addEventListener(BeforeUnloadEventType, blockBeforeUnload);\n window.addEventListener(BeforeUnloadEventType, setConfirmationMessage);\n // return an unblock function to cancel\n const unblock = () => {\n debugTransitions(\"running unblock function\");\n if (onUnblock) {\n debugTransitions(\"running user defined function\");\n onUnblock(); // callback from user land\n }\n // trigger an unblock event, to be handled at the framework level\n const unblockEvent = new Event(UNBLOCK_TRANSITION_EVENT_TYPE);\n window.dispatchEvent(unblockEvent);\n // remove the browser level events\n window.removeEventListener(BeforeUnloadEventType, blockBeforeUnload);\n window.removeEventListener(BeforeUnloadEventType, setConfirmationMessage);\n // unblock browser change\n // @ts-ignore\n window.onbeforeunload = undefined; //undefined instead of null to support IE\n };\n return unblock;\n};\n","export * from \"./Provider\";\nexport * from \"./Context\";\nexport * from \"./Consumer\";\nexport * from \"./typings\";\n\nexport * from \"./defaultVulcanComponents/index\";\n","/**\n * NOTE: KEEP SEPARATED FROM THE HOOKS TO CONSUME THE CONTEXT\n * otherwise you'll end up with circular dependencies because of the default components\n */\n// TODO: we might need to adapt the provider to merge its value with a potentially higher up context\nimport React from \"react\";\n\nimport { PossibleVulcanComponents } from \"./typings\";\nimport { VulcanComponentsContext } from \"./Context\";\nimport { useVulcanComponents } from \"./Consumer\";\nimport { debugVulcan } from \"@vulcanjs/utils\";\nconst debugComponents = debugVulcan(\"components\"); //console.log;\n\n/**\n *\n * @param options.value An object of Vulcan components to be overriden.\n */\nexport const VulcanComponentsProvider = ({\n value,\n ...props\n}: {\n value?: Partial<PossibleVulcanComponents>;\n children: React.ReactNode;\n}) => {\n const currentComponents = useVulcanComponents();\n debugComponents(\n \"Current components __not_initialized?\",\n currentComponents.__not_initialized\n );\n const mergedComponents = {\n // merge with a parent Provider if needed\n ...(currentComponents?.__not_initialized ? {} : currentComponents || {}),\n ...(value || {}),\n };\n debugComponents(\"Merged components\", mergedComponents);\n // For preserving displayName, that is lost after build somehow\n Object.keys(mergedComponents).forEach((componentName) => {\n if (mergedComponents[componentName]) {\n mergedComponents[componentName].displayName = \"Vulcan.\" + componentName;\n } else {\n console.warn(`Encountered an undefined component: ${componentName}.\n The component may not be registered, or import failed.\n For instance due to an infinite import loop when importing\n \"useVulcanComponents\" from index instead of Consumer.`);\n }\n });\n return (\n <VulcanComponentsContext.Provider\n // We make the assumption that all components are there, user is responsible\n // for adding them correctly in the context where necessary\n value={mergedComponents as PossibleVulcanComponents} // merge provided components so the user can provide only a partial replacement\n {...props}\n />\n );\n};\n","import React from \"react\";\nimport type { PossibleVulcanComponents } from \"./typings\";\nimport { Dummy } from \"./Dummy\";\n\nconst dummyHandler = {\n get(target, property) {\n //console.log(\"target\", property);\n if (property in target) {\n return target[property];\n }\n console.log(\n `Property ${property} not in possible Vulcan components, returning Dummy`\n );\n return Dummy;\n },\n};\n// We need this to shut TypeScript up\n// You should use the Provider to get the right default values\nexport const VulcanComponentsContext =\n React.createContext<PossibleVulcanComponents>(\n // @ts-ignore\n new Proxy(\n {\n __not_initialized: true,\n },\n dummyHandler\n )\n );\n\n// Needed to guarantee that the exports stays named\nVulcanComponentsContext.displayName = \"VulcanComponentsContext\";\n","import React from \"react\";\nexport interface DummyProps { }\n\nexport const Dummy = () => (\n <span>\n You have not setup VulcanComponentsProvider. Please add following code in\n your app:{\" \"}\n <code>{`import { VulcanComponentsProvider } from \"@vulcanjs/react-ui\"; const YourApp = <VulcanComponentsProvider>{/* your app */}</VulcanComponentsProvider>;}`}</code>\n </span>\n);\n","import { deprecate } from \"@vulcanjs/utils\";\nimport React, { useContext, useEffect } from \"react\";\nimport { VulcanComponentsContext } from \"./Context\";\n\nexport const VulcanComponentsConsumer = VulcanComponentsContext.Consumer;\n\nexport const useVulcanComponents = () => {\n const val = useContext(VulcanComponentsContext);\n return val;\n};\n\nexport const withVulcanComponents = (C) => (props) => {\n const vulcanComponents = useVulcanComponents();\n deprecate(\n \"0.0.0\",\n \"Using withVulcanComponents HOC => prefer useVulcanComponents with hooks\"\n );\n return <C vulcanComponents={vulcanComponents} {...props} />;\n};\n","import React from \"react\";\n\n// Creating a dependency with the raw\n// implemention is actually a bad idea\n// An \"any\" type is acceptable as long as we\n// do expose reusable hooks and\n// enough typings for common things, such as\n// \"FormInputProps\" or useFormContext, typings for some events and so on\n/*\n import type { FormSubmitProps } from \"../form/elements\";\n import type { ButtonProps } from \"../core/Button\";\n */\n// We keep this import because it barely have any HTML, you are\n// not supposed to restyle it in each package\n// import type { MutationButtonProps } from \"../MutationButton\";\n// datatable\n/*\nimport type {\n Datatable,\n DatatableAbove,\n DatatableAboveLayout,\n DatatableAboveLeft,\n DatatableAboveRight,\n DatatableAboveSearchInput,\n DatatableLayout,\n} from \"../Datatable/Datatable\";\nimport type {\n DatatableContents,\n DatatableContentsBodyLayout,\n DatatableContentsHeadLayout,\n DatatableContentsInnerLayout,\n DatatableContentsLayout,\n DatatableContentsMoreLayout,\n DatatableEmpty,\n DatatableLoadMoreButton,\n DatatableTitle,\n} from \"../Datatable/DatatableContents\";\nimport type {\n DatatableHeader,\n DatatableHeaderCellLayout,\n} from \"../Datatable/DatatableHeader\";\nimport type {\n DatatableRow,\n DatatableRowLayout,\n} from \"../Datatable/DatatableRow\";\nimport type {\n DatatableCell,\n DatatableCellLayout,\n DatatableDefaultCell,\n} from \"../Datatable/DatatableCell\";\nimport type {\n DatatableFilter,\n DatatableFilterBooleans,\n DatatableFilterCheckboxes,\n DatatableFilterContents,\n DatatableFilterContentsWithData,\n DatatableFilterDates,\n DatatableFilterNumbers,\n} from \"../Datatable/DatatableFilter\";\nimport type { DatatableSorter } from \"../Datatable/DatatableSorter\";\nimport type { DatatableSelect } from \"../Datatable/DatatableSelect\";\nimport type { DatatableSubmitSelected } from \"../Datatable/DatatableSubmitSelected\";\nimport type { EditButton, EditForm } from \"../Datatable/others/EditButton\";\nimport type { NewButton, NewForm } from \"../Datatable/others/NewButton\";\nimport type { DeleteButton } from \"../Datatable/others/DeleteButton\";\n*/\n//import type { BootstrapModal as Modal } from \"../bootstrap/Modal\";\n// Cell\n/*\nimport type { CardItemSwitcher } from \"../cell/CardItem\";\nimport type {\n CardItemRelationItem,\n DefaultCell,\n UserCell,\n} from \"../cell/CardItemRelationItem\";\nimport type { CardItemArray } from \"../cell/CardItemArray\";\nimport type { CardItemDate } from \"../cell/CardItemDate\";\nimport type { CardItemDefault } from \"../cell/CardItemDefault\";\nimport type { CardItemHTML } from \"../cell/CardItemHTML\";\nimport type { CardItemImage } from \"../cell/CardItemImage\";\nimport type { CardItemNumber } from \"../cell/CardItemNumber\";\nimport type { CardItemObject } from \"../cell/CardItemObject\";\nimport type { CardItemRelationHasMany } from \"../cell/CardItemRelationHasMany\";\nimport type { CardItemRelationHasOne } from \"../cell/CardItemRelationHasOne\";\nimport type { CardItemString } from \"../cell/CardItemString\";\nimport type { CardItemURL } from \"../cell/CardItemURL\";\n*/\n//import type { ModalTrigger } from \"../bootstrap/ModalTrigger\";\n//import type { FormOptionLabelProps } from \"../form/inputs/FormOptionLabel\";\n\nexport interface PossibleCoreComponents {\n Loading: any;\n FormattedMessage: any;\n Alert: any;\n Button: any; //React.ComponentType<ButtonProps>;\n Icon: any;\n // TODO: define props more precisely\n MutationButton: any; //React.ComponentType<MutationButtonProps>;\n LoadingButton: React.ComponentType<any>;\n HeadTags: React.ComponentType<any>;\n // Previously from Bootstrap and Mui\n TooltipTrigger: React.ComponentType<any>;\n Dropdown: React.ComponentType<any>;\n Modal: any; // typeof Modal;\n ModalTrigger: any; // typeof ModalTrigger;\n}\n// TODO: differentiate components that are provided out of the box and those that require a UI frameworK?\nexport interface PossibleFormComponents {\n FormError: any; // FieldErrors\n // From FormComponent\n FormComponentDefault: any;\n /** Alias of the default FormComponent */\n FormComponentText: any;\n FormComponentPassword: any;\n FormComponentNumber: any;\n FormComponentUrl: any;\n FormComponentEmail: any;\n FormComponentTextarea: any;\n FormComponentCheckbox: any;\n FormComponentCheckboxGroup: any;\n FormComponentRadioGroup: any;\n FormComponentSelect: any;\n FormComponentSelectMultiple: any;\n FormComponentDateTime: any;\n FormComponentDate: any;\n // FormComponentDate2: any;\n FormComponentTime: any;\n FormComponentStaticText: any;\n FormComponentLikert: any;\n FormComponentAutocomplete: any;\n FormComponentMultiAutocomplete: any;\n //\n FormComponent: any;\n FormComponentInner: any;\n FormComponentLoader: any;\n FormElement: any;\n FormGroup: any;\n FormGroupLayout: any;\n FormGroupHeader: any;\n // intl\n FormIntlLayout: any;\n FormIntlItemLayout: any;\n FormIntl: any;\n // Layout\n FormErrors: any;\n FormSubmit: any; //React.ComponentType<FormSubmitProps>;\n FormLayout: any;\n\n // arrays and objects\n FormNestedArray: any;\n FormNestedArrayInnerLayout: any;\n FormNestedArrayLayout: any;\n FormNestedItem: any;\n IconAdd: any;\n IconRemove: any;\n FieldErrors: any;\n FormNestedDivider: any;\n //\n FormNestedItemLayout: any;\n FormNestedObjectLayout: any;\n FormNestedObject: any;\n FormOptionLabel: any; //React.ComponentType<FormOptionLabelProps>;\n // Form\n Form: any;\n SmartForm: any;\n // Used by ui-boostrap and ui-material\n FormItem;\n // flag to detect parent state\n __not_initialized?: boolean;\n}\n\nexport interface DatatableComponents {\n Datatable: any; // typeof Datatable;\n // DatatableContents: any; // typeof DatatableContents\n DatatableAbove: any; // typeof DatatableAbove;\n DatatableAboveLayout: any; // typeof DatatableAboveLayout;\n DatatableAboveLeft: any; // typeof DatatableAboveLeft;\n DatatableAboveRight: any; // typeof DatatableAboveRight;\n DatatableAboveSearchInput: any; // typeof DatatableAboveSearchInput;\n DatatableLayout: any; // typeof DatatableLayout;\n // Contents\n DatatableContents: any; // typeof DatatableContents;\n DatatableContentsBodyLayout: any; // typeof DatatableContentsBodyLayout;\n DatatableContentsHeadLayout: any; // typeof DatatableContentsHeadLayout;\n DatatableContentsInnerLayout: any; // typeof DatatableContentsInnerLayout;\n DatatableContentsLayout: any; // typeof DatatableContentsLayout;\n DatatableContentsMoreLayout: any; // typeof DatatableContentsMoreLayout;\n DatatableEmpty: any; // typeof DatatableEmpty;\n DatatableLoadMoreButton: any; // typeof DatatableLoadMoreButton;\n DatatableTitle: any; // typeof DatatableTitle;\n // Header\n DatatableHeader: any; // typeof DatatableHeader;\n DatatableHeaderCellLayout: any; // typeof DatatableHeaderCellLayout;\n // Row\n DatatableRow: any; // typeof DatatableRow;\n DatatableRowLayout: any; // typeof DatatableRowLayout;\n // Cell\n DatatableCell: any; // typeof DatatableCell;\n DatatableCellLayout: any; // typeof DatatableCellLayout;\n DatatableDefaultCell: any; // typeof DatatableDefaultCell;\n // Filter\n DatatableFilter: any; // typeof DatatableFilter;\n DatatableFilterBooleans: any; // typeof DatatableFilterBooleans;\n DatatableFilterCheckboxes: any; // typeof DatatableFilterCheckboxes;\n DatatableFilterContents: any; // typeof DatatableFilterContents;\n DatatableFilterContentsWithData: any; // typeof DatatableFilterContentsWithData;\n DatatableFilterDates: any; // typeof DatatableFilterDates;\n DatatableFilterNumbers: any; // typeof DatatableFilterNumbers;\n // Sort\n DatatableSorter: any; // typeof DatatableSorter;\n // Select\n DatatableSelect: any; // typeof DatatableSelect;\n // SubmitSelect\n DatatableSubmitSelected: any; // typeof DatatableSubmitSelected;\n // Core\n EditButton: any; // typeof EditButton;\n EditForm: any; // typeof EditForm;\n NewButton: any; // typeof NewButton;\n NewForm: any; // typeof NewForm;\n DeleteButton: any; // typeof DeleteButton;\n}\n\nexport interface CellComponents {\n CardItemSwitcher: any; // typeof CardItemSwitcher;\n CardItem: any; // any; // typeof CardItemSwitcher;\n DefaultCell: any; // typeof DefaultCell;\n UserCell: any; // typeof UserCell;\n CardItemArray: any; // typeof CardItemArray;\n CardItemDate: any; // typeof CardItemDate;\n CardItemDefault: any; // typeof CardItemDefault;\n CardItemHTML: any; // typeof CardItemHTML;\n CardItemImage: any; // typeof CardItemImage;\n CardItemNumber: any; // typeof CardItemNumber;\n CardItemObject: any; // typeof CardItemObject;\n CardItemRelationHasMany: any; // typeof CardItemRelationHasMany;\n CardItemRelationHasOne: any; // typeof CardItemRelationHasOne;\n CardItemRelationItem: any; // typeof CardItemRelationItem;\n CardItemString: any; // typeof CardItemString;\n CardItemURL: any; // typeof CardItemURL;\n}\n\nexport type PossibleVulcanComponents = PossibleCoreComponents &\n PossibleFormComponents &\n DatatableComponents &\n CellComponents;\n","import { LoadingButton } from \"../../core/LoadingButton\";\nimport { MutationButton } from \"../../core/MutationButton\";\nimport { Form, FormContainer } from \"../../form/core/index\";\nimport { PossibleFormComponents } from \"../typings\";\n\nexport const defaultFormComponents: Partial<PossibleFormComponents> = {\n Form,\n SmartForm: FormContainer,\n};\n// All those components are defined in each relevant package instead\nexport const defaultDatatableComponents = {};\nexport const defaultCellComponents = {};\nexport const defaultCoreComponents = {\n MutationButton,\n LoadingButton,\n};\n","import React, { CSSProperties } from \"react\";\nimport { useVulcanComponents } from \"../VulcanComponents\";\nimport type { ButtonProps } from \"./typings\";\nexport interface LoadingButtonProps extends ButtonProps {\n loading?: boolean;\n label?: string | React.ReactNode;\n onClick?: any;\n children?: React.ReactNode;\n className?: string;\n}\nexport const LoadingButton = ({\n loading,\n label,\n onClick,\n children,\n className = \"\",\n ...rest\n}: LoadingButtonProps & any) => {\n const Components = useVulcanComponents();\n\n const wrapperStyle: CSSProperties = {\n position: \"relative\",\n };\n\n const labelStyle = loading ? { opacity: 0.5 } : {};\n\n const loadingStyle: CSSProperties = loading\n ? {\n position: \"absolute\",\n top: 0,\n bottom: 0,\n left: 0,\n right: 0,\n display: \"flex\",\n justifyContent: \"center\",\n alignItems: \"center\",\n }\n : { display: \"none\" };\n\n return (\n <Components.Button\n className={`loading-button ${loading ? \"loading-button-loading\" : \"loading-button-notloading\"\n } ${className}`}\n onClick={onClick}\n {...rest}\n >\n <span style={wrapperStyle}>\n <span style={labelStyle}>{label || children}</span>\n <span style={loadingStyle}>\n <Components.Loading />\n </span>\n </span>\n </Components.Button>\n );\n};\n","/*\n\nExample Usage\n\n<Components.MutationButton\n label=\"Cancel Subscription\"\n variant=\"primary\"\n mutationOptions={{\n name: 'cancelSubscription',\n args: { bookingId: 'String' },\n fragmentName: 'BookingsStripeDataFragment',\n }}\n mutationArguments={{ bookingId: booking._id }}\n submitCallback={() => {}}\n successCallback={result => { console.log(result) }}\n/>\n\n*/\nimport React, { useState } from \"react\";\nimport { DocumentNode } from \"graphql\";\nimport { MutationHookOptions, useMutation } from \"@apollo/client\";\nimport gql from \"graphql-tag\";\nimport { useVulcanComponents } from \"../VulcanComponents\";\nimport { LoadingButtonProps } from \"./LoadingButton\";\n// import withMutation from '../containers/registeredMutation';\n\n// TODO:\n/**\n * Difference with Vulcan Meteor: there is no\n * registered mutation anymore,\n * so you need to pass your mutations explicitely, using graphql\n */\n/*\nexport class MutationButton extends PureComponent {\n constructor(props) {\n super(props);\n this.button = withMutation(props.mutationOptions)(MutationButtonInner);\n }\n\n render() {\n const Component = this.button;\n return <Component {...this.props} />;\n }\n}*/\n\nexport interface MutationButtonProps {\n /**\n * NOTE: in Vulcan Meteor you had to write:\n * mutationOptions: { name: \"foobar\", mutationOptions: {refetchQueries:[\"hello\"]}}\n *\n * In Vulcan Next, you can only pass the \"mutationOptions\" object:\n * mutationOptions: { refetchQueries:[\"hello\"]}\n * and the mutation is provided via the new \"mutation\" prop\n */\n mutationOptions?: MutationHookOptions;\n /**\n * @example\n mutation: gql`\n mutation sampleMutation($input: Input) {\n hello\n }\n `,\n */\n mutation: string | DocumentNode;\n /** Variables passed to the mutation (NOTE: we can't pass other options at the moment) */\n mutationArguments?: MutationHookOptions<any>[\"variables\"];\n /** Callback run before submitting. Can optionnaly return mutationArguments that will override current ones. */\n submitCallback?: (\n mutationArgumentsFromProps: MutationHookOptions<any>[\"variables\"]\n ) =>\n | void\n | { mutationArguments: MutationHookOptions<any>[\"variables\"] }\n | Promise<void | {\n mutationArguments: MutationHookOptions<any>[\"variables\"];\n }>;\n successCallback?: (res: any) => void | Promise<void>;\n errorCallback?: (err: any) => void | Promise<void>;\n /** Now isolated into their own object to avoid needed to explicitely pick/omit */\n loadingButtonProps?: LoadingButtonProps;\n /** Shortcut for loadingButtonProps.label */\n label?: string | React.ReactNode;\n}\nexport const MutationButton = (props: MutationButtonProps) => {\n const Components = useVulcanComponents();\n const [loading, setLoading] = useState<boolean>(false);\n const [error, setError] = useState<any | undefined>();\n\n const {\n //mutationOptions,\n mutation,\n loadingButtonProps = {},\n label,\n } = props;\n let { mutationArguments } = props;\n const mutationAsNode =\n typeof mutation === \"string\"\n ? gql`\n ${mutation}\n `\n : mutation;\n const [mutationFunc] = useMutation(mutationAsNode);\n\n const handleClick = async (e) => {\n e.preventDefault();\n setLoading(true);\n setError(undefined);\n const {\n //mutationOptions,\n submitCallback,\n successCallback,\n errorCallback,\n } = props;\n //const mutationName = mutationOptions.name;\n //const mutation = this.props[mutationName];\n\n try {\n if (submitCallback) {\n const callbackReturn = await submitCallback(mutationArguments);\n if (callbackReturn && callbackReturn.mutationArguments) {\n mutationArguments = callbackReturn.mutationArguments;\n }\n }\n const result = await mutationFunc({ variables: mutationArguments });\n if (successCallback) {\n await successCallback(result);\n }\n } catch (error) {\n // TODO: may not work because the mutationFunc may not throw in case of error\n setError(error);\n if (errorCallback) {\n await errorCallback(error);\n }\n } finally {\n setLoading(false);\n }\n\n // mutation(mutationArguments)\n // .then(result => {\n // this.setState({ loading: false });\n // if (successCallback) {\n // successCallback(result);\n // }\n // })\n // .catch(error => {\n // this.setState({ loading: false });\n // if (errorCallback) {\n // errorCallback(error);\n // }\n // });\n };\n\n //const mutationName = this.props.mutationOptions.name;\n\n const loadingButton = (\n <Components.LoadingButton\n loading={loading}\n onClick={handleClick}\n label={label}\n {...loadingButtonProps}\n />\n );\n\n if (error) {\n return (\n <Components.TooltipTrigger trigger={loadingButton} defaultShow={true}>\n {error.message.replace(\"GraphQL error: \", \"\")}\n </Components.TooltipTrigger>\n );\n }\n return loadingButton;\n};\n","import { __assign } from \"tslib\";\nimport { parse } from 'graphql';\nvar docCache = new Map();\nvar fragmentSourceMap = new Map();\nvar printFragmentWarnings = true;\nvar experimentalFragmentVariables = false;\nfunction normalize(string) {\n return string.replace(/[\\s,]+/g, ' ').trim();\n}\nfunction cacheKeyFromLoc(loc) {\n return normalize(loc.source.body.substring(loc.start, loc.end));\n}\nfunction processFragments(ast) {\n var seenKeys = new Set();\n var definitions = [];\n ast.definitions.forEach(function (fragmentDefinition) {\n if (fragmentDefinition.kind === 'FragmentDefinition') {\n var fragmentName = fragmentDefinition.name.value;\n var sourceKey = cacheKeyFromLoc(fragmentDefinition.loc);\n var sourceKeySet = fragmentSourceMap.get(fragmentName);\n if (sourceKeySet && !sourceKeySet.has(sourceKey)) {\n if (printFragmentWarnings) {\n console.warn(\"Warning: fragment with name \" + fragmentName + \" already exists.\\n\"\n + \"graphql-tag enforces all fragment names across your application to be unique; read more about\\n\"\n + \"this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names\");\n }\n }\n else if (!sourceKeySet) {\n fragmentSourceMap.set(fragmentName, sourceKeySet = new Set);\n }\n sourceKeySet.add(sourceKey);\n if (!seenKeys.has(sourceKey)) {\n seenKeys.add(sourceKey);\n definitions.push(fragmentDefinition);\n }\n }\n else {\n definitions.push(fragmentDefinition);\n }\n });\n return __assign(__assign({}, ast), { definitions: definitions });\n}\nfunction stripLoc(doc) {\n var workSet = new Set(doc.definitions);\n workSet.forEach(function (node) {\n if (node.loc)\n delete node.loc;\n Object.keys(node).forEach(function (key) {\n var value = node[key];\n if (value && typeof value === 'object') {\n workSet.add(value);\n }\n });\n });\n var loc = doc.loc;\n if (loc) {\n delete loc.startToken;\n delete loc.endToken;\n }\n return doc;\n}\nfunction parseDocument(source) {\n var cacheKey = normalize(source);\n if (!docCache.has(cacheKey)) {\n var parsed = parse(source, {\n experimentalFragmentVariables: experimentalFragmentVariables,\n allowLegacyFragmentVariables: experimentalFragmentVariables\n });\n if (!parsed || parsed.kind !== 'Document') {\n throw new Error('Not a valid GraphQL document.');\n }\n docCache.set(cacheKey, stripLoc(processFragments(parsed)));\n }\n return docCache.get(cacheKey);\n}\nexport function gql(literals) {\n var args = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n args[_i - 1] = arguments[_i];\n }\n if (typeof literals === 'string') {\n literals = [literals];\n }\n var result = literals[0];\n args.forEach(function (arg, i) {\n if (arg && arg.kind === 'Document') {\n result += arg.loc.source.body;\n }\n else {\n result += arg;\n }\n result += literals[i + 1];\n });\n return parseDocument(result);\n}\nexport function resetCaches() {\n docCache.clear();\n fragmentSourceMap.clear();\n}\nexport function disableFragmentWarnings() {\n printFragmentWarnings = false;\n}\nexport function enableExperimentalFragmentVariables() {\n experimentalFragmentVariables = true;\n}\nexport function disableExperimentalFragmentVariables() {\n experimentalFragmentVariables = false;\n}\nvar extras = {\n gql: gql,\n resetCaches: resetCaches,\n disableFragmentWarnings: disableFragmentWarnings,\n enableExperimentalFragmentVariables: enableExperimentalFragmentVariables,\n disableExperimentalFragmentVariables: disableExperimentalFragmentVariables\n};\n(function (gql_1) {\n gql_1.gql = extras.gql, gql_1.resetCaches = extras.resetCaches, gql_1.disableFragmentWarnings = extras.disableFragmentWarnings, gql_1.enableExperimentalFragmentVariables = extras.enableExperimentalFragmentVariables, gql_1.disableExperimentalFragmentVariables = extras.disableExperimentalFragmentVariables;\n})(gql || (gql = {}));\ngql[\"default\"] = gql;\nexport default gql;\n//# sourceMappingURL=index.js.map","import tslib from '../tslib.js';\r\nconst {\r\n __extends,\r\n __assign,\r\n __rest,\r\n __decorate,\r\n __param,\r\n __metadata,\r\n __awaiter,\r\n __generator,\r\n __exportStar,\r\n __createBinding,\r\n __values,\r\n __read,\r\n __spread,\r\n __spreadArrays,\r\n __spreadArray,\r\n __await,\r\n __asyncGenerator,\r\n __asyncDelegator,\r\n __asyncValues,\r\n __makeTemplateObject,\r\n __importStar,\r\n __importDefault,\r\n __classPrivateFieldGet,\r\n __classPrivateFieldSet,\r\n __classPrivateFieldIn,\r\n} = tslib;\r\nexport {\r\n __extends,\r\n __assign,\r\n __rest,\r\n __decorate,\r\n __param,\r\n __metadata,\r\n __awaiter,\r\n __generator,\r\n __exportStar,\r\n __createBinding,\r\n __values,\r\n __read,\r\n __spread,\r\n __spreadArrays,\r\n __spreadArray,\r\n __await,\r\n __asyncGenerator,\r\n __asyncDelegator,\r\n __asyncValues,\r\n __makeTemplateObject,\r\n __importStar,\r\n __importDefault,\r\n __classPrivateFieldGet,\r\n __classPrivateFieldSet,\r\n __classPrivateFieldIn,\r\n};\r\n","/**\n * GraphQL.js provides a reference implementation for the GraphQL specification\n * but is also a useful utility for operating on GraphQL files and building\n * sophisticated tools.\n *\n * This primary module exports a general purpose function for fulfilling all\n * steps of the GraphQL specification in a single operation, but also includes\n * utilities for every part of the GraphQL specification:\n *\n * - Parsing the GraphQL language.\n * - Building a GraphQL type schema.\n * - Validating a GraphQL request against a type schema.\n * - Executing a GraphQL request against a type schema.\n *\n * This also includes utility functions for operating on GraphQL types and\n * GraphQL documents to facilitate building tools.\n *\n * You may also import from each sub-directory directly. For example, the\n * following two import statements are equivalent:\n *\n * import { parse } from 'graphql';\n * import { parse } from 'graphql/language';\n */\n// The GraphQL.js version info.\nexport { version, versionInfo } from \"./version.mjs\"; // The primary entry point into fulfilling a GraphQL request.\n\nexport { graphql, graphqlSync } from \"./graphql.mjs\"; // Create and operate on GraphQL type definitions and schema.\n\nexport { // Definitions\nGraphQLSchema, GraphQLDirective, GraphQLScalarType, GraphQLObjectType, GraphQLInterfaceType, GraphQLUnionType, GraphQLEnumType, GraphQLInputObjectType, GraphQLList, GraphQLNonNull // Standard GraphQL Scalars\n, specifiedScalarTypes, GraphQLInt, GraphQLFloat, GraphQLString, GraphQLBoolean, GraphQLID // Built-in Directives defined by the Spec\n, specifiedDirectives, GraphQLIncludeDirective, GraphQLSkipDirective, GraphQLDeprecatedDirective, GraphQLSpecifiedByDirective // \"Enum\" of Type Kinds\n, TypeKind // Constant Deprecation Reason\n, DEFAULT_DEPRECATION_REASON // GraphQL Types for introspection.\n, introspectionTypes, __Schema, __Directive, __DirectiveLocation, __Type, __Field, __InputValue, __EnumValue, __TypeKind // Meta-field definitions.\n, SchemaMetaFieldDef, TypeMetaFieldDef, TypeNameMetaFieldDef // Predicates\n, isSchema, isDirective, isType, isScalarType, isObjectType, isInterfaceType, isUnionType, isEnumType, isInputObjectType, isListType, isNonNullType, isInputType, isOutputType, isLeafType, isCompositeType, isAbstractType, isWrappingType, isNullableType, isNamedType, isRequiredArgument, isRequiredInputField, isSpecifiedScalarType, isIntrospectionType, isSpecifiedDirective // Assertions\n, assertSchema, assertDirective, assertType, assertScalarType, assertObjectType, assertInterfaceType, assertUnionType, assertEnumType, assertInputObjectType, assertListType, assertNonNullType, assertInputType, assertOutputType, assertLeafType, assertCompositeType, assertAbstractType, assertWrappingType, assertNullableType, assertNamedType // Un-modifiers\n, getNullableType, getNamedType // Validate GraphQL schema.\n, validateSchema, assertValidSchema } from \"./type/index.mjs\";\n// Parse and operate on GraphQL language source files.\nexport { Token, Source, Location, getLocation // Print source location\n, printLocation, printSourceLocation // Lex\n, Lexer, TokenKind // Parse\n, parse, parseValue, parseType // Print\n, print // Visit\n, visit, visitInParallel, getVisitFn, BREAK, Kind, DirectiveLocation // Predicates\n, isDefinitionNode, isExecutableDefinitionNode, isSelectionNode, isValueNode, isTypeNode, isTypeSystemDefinitionNode, isTypeDefinitionNode, isTypeSystemExtensionNode, isTypeExtensionNode } from \"./language/index.mjs\";\n// Execute GraphQL queries.\nexport { execute, executeSync, defaultFieldResolver, defaultTypeResolver, responsePathAsArray, getDirectiveValues } from \"./execution/index.mjs\";\nexport { subscribe, createSourceEventStream } from \"./subscription/index.mjs\";\n// Validate GraphQL documents.\nexport { validate, ValidationContext // All validation rules in the GraphQL Specification.\n, specifiedRules // Individual validation rules.\n, ExecutableDefinitionsRule, FieldsOnCorrectTypeRule, FragmentsOnCompositeTypesRule, KnownArgumentNamesRule, KnownDirectivesRule, KnownFragmentNamesRule, KnownTypeNamesRule, LoneAnonymousOperationRule, NoFragmentCyclesRule, NoUndefinedVariablesRule, NoUnusedFragmentsRule, NoUnusedVariablesRule, OverlappingFieldsCanBeMergedRule, PossibleFragmentSpreadsRule, ProvidedRequiredArgumentsRule, ScalarLeafsRule, SingleFieldSubscriptionsRule, UniqueArgumentNamesRule, UniqueDirectivesPerLocationRule, UniqueFragmentNamesRule, UniqueInputFieldNamesRule, UniqueOperationNamesRule, UniqueVariableNamesRule, ValuesOfCorrectTypeRule, VariablesAreInputTypesRule, VariablesInAllowedPositionRule // SDL-specific validation rules\n, LoneSchemaDefinitionRule, UniqueOperationTypesRule, UniqueTypeNamesRule, UniqueEnumValueNamesRule, UniqueFieldDefinitionNamesRule, UniqueDirectiveNamesRule, PossibleTypeExtensionsRule // Custom validation rules\n, NoDeprecatedCustomRule, NoSchemaIntrospectionCustomRule } from \"./validation/index.mjs\";\n// Create, format, and print GraphQL errors.\nexport { GraphQLError, syntaxError, locatedError, printError, formatError } from \"./error/index.mjs\";\n// Utilities for operating on GraphQL type schema and parsed sources.\nexport { // Produce the GraphQL query recommended for a full schema introspection.\n// Accepts optional IntrospectionOptions.\ngetIntrospectionQuery // Gets the target Operation from a Document.\n, getOperationAST // Gets the Type for the target Operation AST.\n, getOperationRootType // Convert a GraphQLSchema to an IntrospectionQuery.\n, introspectionFromSchema // Build a GraphQLSchema from an introspection result.\n, buildClientSchema // Build a GraphQLSchema from a parsed GraphQL Schema language AST.\n, buildASTSchema // Build a GraphQLSchema from a GraphQL schema language document.\n, buildSchema // @deprecated: Get the description from a schema AST node and supports legacy\n// syntax for specifying descriptions - will be removed in v16.\n, getDescription // Extends an existing GraphQLSchema from a parsed GraphQL Schema\n// language AST.\n, extendSchema // Sort a GraphQLSchema.\n, lexicographicSortSchema // Print a GraphQLSchema to GraphQL Schema language.\n, printSchema // Print a GraphQLType to GraphQL Schema language.\n, printType // Prints the built-in introspection schema in the Schema Language\n// format.\n, printIntrospectionSchema // Create a GraphQLType from a GraphQL language AST.\n, typeFromAST // Create a JavaScript value from a GraphQL language AST with a Type.\n, valueFromAST // Create a JavaScript value from a GraphQL language AST without a Type.\n, valueFromASTUntyped // Create a GraphQL language AST from a JavaScript value.\n, astFromValue // A helper to use within recursive-descent visitors which need to be aware of\n// the GraphQL type system.\n, TypeInfo, visitWithTypeInfo // Coerces a JavaScript value to a GraphQL type, or produces errors.\n, coerceInputValue // Concatenates multiple AST together.\n, concatAST // Separates an AST into an AST per Operation.\n, separateOperations // Strips characters that are not significant to the validity or execution\n// of a GraphQL document.\n, stripIgnoredCharacters // Comparators for types\n, isEqualType, isTypeSubTypeOf, doTypesOverlap // Asserts a string is a valid GraphQL name.\n, assertValidName // Determine if a string is a valid GraphQL name.\n, isValidNameError // Compares two GraphQLSchemas and detects breaking changes.\n, BreakingChangeType, DangerousChangeType, findBreakingChanges, findDangerousChanges // @deprecated: Report all deprecated usage within a GraphQL document.\n, findDeprecatedUsages } from \"./utilities/index.mjs\";\n","import { syntaxError } from \"../error/syntaxError.mjs\";\nimport { Kind } from \"./kinds.mjs\";\nimport { Location } from \"./ast.mjs\";\nimport { TokenKind } from \"./tokenKind.mjs\";\nimport { Source, isSource } from \"./source.mjs\";\nimport { DirectiveLocation } from \"./directiveLocation.mjs\";\nimport { Lexer, isPunctuatorTokenKind } from \"./lexer.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 var parser = new Parser(source, options);\n return parser.parseDocument();\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 var parser = new Parser(source, options);\n parser.expectToken(TokenKind.SOF);\n var value = parser.parseValueLiteral(false);\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 var parser = new Parser(source, options);\n parser.expectToken(TokenKind.SOF);\n var type = parser.parseTypeReference();\n parser.expectToken(TokenKind.EOF);\n return type;\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 var Parser = /*#__PURE__*/function () {\n function Parser(source, options) {\n var sourceObj = isSource(source) ? source : new Source(source);\n this._lexer = new Lexer(sourceObj);\n this._options = options;\n }\n /**\n * Converts a name lex token into a name parse node.\n */\n\n\n var _proto = Parser.prototype;\n\n _proto.parseName = function parseName() {\n var token = this.expectToken(TokenKind.NAME);\n return {\n kind: Kind.NAME,\n value: token.value,\n loc: this.loc(token)\n };\n } // Implements the parsing rules in the Document section.\n\n /**\n * Document : Definition+\n */\n ;\n\n _proto.parseDocument = function parseDocument() {\n var start = this._lexer.token;\n return {\n kind: Kind.DOCUMENT,\n definitions: this.many(TokenKind.SOF, this.parseDefinition, TokenKind.EOF),\n loc: this.loc(start)\n };\n }\n /**\n * Definition :\n * - ExecutableDefinition\n * - TypeSystemDefinition\n * - TypeSystemExtension\n *\n * ExecutableDefinition :\n * - OperationDefinition\n * - FragmentDefinition\n */\n ;\n\n _proto.parseDefinition = function parseDefinition() {\n if (this.peek(TokenKind.NAME)) {\n switch (this._lexer.token.value) {\n case 'query':\n case 'mutation':\n case 'subscription':\n return this.parseOperationDefinition();\n\n case 'fragment':\n return this.parseFragmentDefinition();\n\n case 'schema':\n case 'scalar':\n case 'type':\n case 'interface':\n case 'union':\n case 'enum':\n case 'input':\n case 'directive':\n return this.parseTypeSystemDefinition();\n\n case 'extend':\n return this.parseTypeSystemExtension();\n }\n } else if (this.peek(TokenKind.BRACE_L)) {\n return this.parseOperationDefinition();\n } else if (this.peekDescription()) {\n return this.parseTypeSystemDefinition();\n }\n\n throw this.unexpected();\n } // Implements the parsing rules in the Operations section.\n\n /**\n * OperationDefinition :\n * - SelectionSet\n * - OperationType Name? VariableDefinitions? Directives? SelectionSet\n */\n ;\n\n _proto.parseOperationDefinition = function parseOperationDefinition() {\n var start = this._lexer.token;\n\n if (this.peek(TokenKind.BRACE_L)) {\n return {\n kind: Kind.OPERATION_DEFINITION,\n operation: 'query',\n name: undefined,\n variableDefinitions: [],\n directives: [],\n selectionSet: this.parseSelectionSet(),\n loc: this.loc(start)\n };\n }\n\n var operation = this.parseOperationType();\n var name;\n\n if (this.peek(TokenKind.NAME)) {\n name = this.parseName();\n }\n\n return {\n kind: Kind.OPERATION_DEFINITION,\n operation: operation,\n name: name,\n variableDefinitions: this.parseVariableDefinitions(),\n directives: this.parseDirectives(false),\n selectionSet: this.parseSelectionSet(),\n loc: this.loc(start)\n };\n }\n /**\n * OperationType : one of query mutation subscription\n */\n ;\n\n _proto.parseOperationType = function parseOperationType() {\n var operationToken = this.expectToken(TokenKind.NAME);\n\n switch (operationToken.value) {\n case 'query':\n return 'query';\n\n case 'mutation':\n return 'mutation';\n\n case 'subscription':\n return 'subscription';\n }\n\n throw this.unexpected(operationToken);\n }\n /**\n * VariableDefinitions : ( VariableDefinition+ )\n */\n ;\n\n _proto.parseVariableDefinitions = function parseVariableDefinitions() {\n return this.optionalMany(TokenKind.PAREN_L, this.parseVariableDefinition, TokenKind.PAREN_R);\n }\n /**\n * VariableDefinition : Variable : Type DefaultValue? Directives[Const]?\n */\n ;\n\n _proto.parseVariableDefinition = function parseVariableDefinition() {\n var start = this._lexer.token;\n return {\n kind: Kind.VARIABLE_DEFINITION,\n variable: this.parseVariable(),\n type: (this.expectToken(TokenKind.COLON), this.parseTypeReference()),\n defaultValue: this.expectOptionalToken(TokenKind.EQUALS) ? this.parseValueLiteral(true) : undefined,\n directives: this.parseDirectives(true),\n loc: this.loc(start)\n };\n }\n /**\n * Variable : $ Name\n */\n ;\n\n _proto.parseVariable = function parseVariable() {\n var start = this._lexer.token;\n this.expectToken(TokenKind.DOLLAR);\n return {\n kind: Kind.VARIABLE,\n name: this.parseName(),\n loc: this.loc(start)\n };\n }\n /**\n * SelectionSet : { Selection+ }\n */\n ;\n\n _proto.parseSelectionSet = function parseSelectionSet() {\n var start = this._lexer.token;\n return {\n kind: Kind.SELECTION_SET,\n selections: this.many(TokenKind.BRACE_L, this.parseSelection, TokenKind.BRACE_R),\n loc: this.loc(start)\n };\n }\n /**\n * Selection :\n * - Field\n * - FragmentSpread\n * - InlineFragment\n */\n ;\n\n _proto.parseSelection = function parseSelection() {\n return this.peek(TokenKind.SPREAD) ? this.parseFragment() : this.parseField();\n }\n /**\n * Field : Alias? Name Arguments? Directives? SelectionSet?\n *\n * Alias : Name :\n */\n ;\n\n _proto.parseField = function parseField() {\n var start = this._lexer.token;\n var nameOrAlias = this.parseName();\n var alias;\n var name;\n\n if (this.expectOptionalToken(TokenKind.COLON)) {\n alias = nameOrAlias;\n name = this.parseName();\n } else {\n name = nameOrAlias;\n }\n\n return {\n kind: Kind.FIELD,\n alias: alias,\n name: name,\n arguments: this.parseArguments(false),\n directives: this.parseDirectives(false),\n selectionSet: this.peek(TokenKind.BRACE_L) ? this.parseSelectionSet() : undefined,\n loc: this.loc(start)\n };\n }\n /**\n * Arguments[Const] : ( Argument[?Const]+ )\n */\n ;\n\n _proto.parseArguments = function parseArguments(isConst) {\n var 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\n _proto.parseArgument = function parseArgument() {\n var start = this._lexer.token;\n var name = this.parseName();\n this.expectToken(TokenKind.COLON);\n return {\n kind: Kind.ARGUMENT,\n name: name,\n value: this.parseValueLiteral(false),\n loc: this.loc(start)\n };\n };\n\n _proto.parseConstArgument = function parseConstArgument() {\n var start = this._lexer.token;\n return {\n kind: Kind.ARGUMENT,\n name: this.parseName(),\n value: (this.expectToken(TokenKind.COLON), this.parseValueLiteral(true)),\n loc: this.loc(start)\n };\n } // Implements the parsing rules in the Fragments section.\n\n /**\n * Corresponds to both FragmentSpread and InlineFragment in the spec.\n *\n * FragmentSpread : ... FragmentName Directives?\n *\n * InlineFragment : ... TypeCondition? Directives? SelectionSet\n */\n ;\n\n _proto.parseFragment = function parseFragment() {\n var start = this._lexer.token;\n this.expectToken(TokenKind.SPREAD);\n var hasTypeCondition = this.expectOptionalKeyword('on');\n\n if (!hasTypeCondition && this.peek(TokenKind.NAME)) {\n return {\n kind: Kind.FRAGMENT_SPREAD,\n name: this.parseFragmentName(),\n directives: this.parseDirectives(false),\n loc: this.loc(start)\n };\n }\n\n return {\n kind: Kind.INLINE_FRAGMENT,\n typeCondition: hasTypeCondition ? this.parseNamedType() : undefined,\n directives: this.parseDirectives(false),\n selectionSet: this.parseSelectionSet(),\n loc: this.loc(start)\n };\n }\n /**\n * FragmentDefinition :\n * - fragment FragmentName on TypeCondition Directives? SelectionSet\n *\n * TypeCondition : NamedType\n */\n ;\n\n _proto.parseFragmentDefinition = function parseFragmentDefinition() {\n var _this$_options;\n\n var start = this._lexer.token;\n this.expectKeyword('fragment'); // Experimental 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 = this._options) === null || _this$_options === void 0 ? void 0 : _this$_options.experimentalFragmentVariables) === true) {\n return {\n kind: Kind.FRAGMENT_DEFINITION,\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 loc: this.loc(start)\n };\n }\n\n return {\n kind: Kind.FRAGMENT_DEFINITION,\n name: this.parseFragmentName(),\n typeCondition: (this.expectKeyword('on'), this.parseNamedType()),\n directives: this.parseDirectives(false),\n selectionSet: this.parseSelectionSet(),\n loc: this.loc(start)\n };\n }\n /**\n * FragmentName : Name but not `on`\n */\n ;\n\n _proto.parseFragmentName = function 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\n _proto.parseValueLiteral = function parseValueLiteral(isConst) {\n var 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._lexer.advance();\n\n return {\n kind: Kind.INT,\n value: token.value,\n loc: this.loc(token)\n };\n\n case TokenKind.FLOAT:\n this._lexer.advance();\n\n return {\n kind: Kind.FLOAT,\n value: token.value,\n loc: this.loc(token)\n };\n\n case TokenKind.STRING:\n case TokenKind.BLOCK_STRING:\n return this.parseStringLiteral();\n\n case TokenKind.NAME:\n this._lexer.advance();\n\n switch (token.value) {\n case 'true':\n return {\n kind: Kind.BOOLEAN,\n value: true,\n loc: this.loc(token)\n };\n\n case 'false':\n return {\n kind: Kind.BOOLEAN,\n value: false,\n loc: this.loc(token)\n };\n\n case 'null':\n return {\n kind: Kind.NULL,\n loc: this.loc(token)\n };\n\n default:\n return {\n kind: Kind.ENUM,\n value: token.value,\n loc: this.loc(token)\n };\n }\n\n case TokenKind.DOLLAR:\n if (!isConst) {\n return this.parseVariable();\n }\n\n break;\n }\n\n throw this.unexpected();\n };\n\n _proto.parseStringLiteral = function parseStringLiteral() {\n var token = this._lexer.token;\n\n this._lexer.advance();\n\n return {\n kind: Kind.STRING,\n value: token.value,\n block: token.kind === TokenKind.BLOCK_STRING,\n loc: this.loc(token)\n };\n }\n /**\n * ListValue[Const] :\n * - [ ]\n * - [ Value[?Const]+ ]\n */\n ;\n\n _proto.parseList = function parseList(isConst) {\n var _this = this;\n\n var start = this._lexer.token;\n\n var item = function item() {\n return _this.parseValueLiteral(isConst);\n };\n\n return {\n kind: Kind.LIST,\n values: this.any(TokenKind.BRACKET_L, item, TokenKind.BRACKET_R),\n loc: this.loc(start)\n };\n }\n /**\n * ObjectValue[Const] :\n * - { }\n * - { ObjectField[?Const]+ }\n */\n ;\n\n _proto.parseObject = function parseObject(isConst) {\n var _this2 = this;\n\n var start = this._lexer.token;\n\n var item = function item() {\n return _this2.parseObjectField(isConst);\n };\n\n return {\n kind: Kind.OBJECT,\n fields: this.any(TokenKind.BRACE_L, item, TokenKind.BRACE_R),\n loc: this.loc(start)\n };\n }\n /**\n * ObjectField[Const] : Name : Value[?Const]\n */\n ;\n\n _proto.parseObjectField = function parseObjectField(isConst) {\n var start = this._lexer.token;\n var name = this.parseName();\n this.expectToken(TokenKind.COLON);\n return {\n kind: Kind.OBJECT_FIELD,\n name: name,\n value: this.parseValueLiteral(isConst),\n loc: this.loc(start)\n };\n } // Implements the parsing rules in the Directives section.\n\n /**\n * Directives[Const] : Directive[?Const]+\n */\n ;\n\n _proto.parseDirectives = function parseDirectives(isConst) {\n var directives = [];\n\n while (this.peek(TokenKind.AT)) {\n directives.push(this.parseDirective(isConst));\n }\n\n return directives;\n }\n /**\n * Directive[Const] : @ Name Arguments[?Const]?\n */\n ;\n\n _proto.parseDirective = function parseDirective(isConst) {\n var start = this._lexer.token;\n this.expectToken(TokenKind.AT);\n return {\n kind: Kind.DIRECTIVE,\n name: this.parseName(),\n arguments: this.parseArguments(isConst),\n loc: this.loc(start)\n };\n } // Implements the parsing rules in the Types section.\n\n /**\n * Type :\n * - NamedType\n * - ListType\n * - NonNullType\n */\n ;\n\n _proto.parseTypeReference = function parseTypeReference() {\n var start = this._lexer.token;\n var type;\n\n if (this.expectOptionalToken(TokenKind.BRACKET_L)) {\n type = this.parseTypeReference();\n this.expectToken(TokenKind.BRACKET_R);\n type = {\n kind: Kind.LIST_TYPE,\n type: type,\n loc: this.loc(start)\n };\n } else {\n type = this.parseNamedType();\n }\n\n if (this.expectOptionalToken(TokenKind.BANG)) {\n return {\n kind: Kind.NON_NULL_TYPE,\n type: type,\n loc: this.loc(start)\n };\n }\n\n return type;\n }\n /**\n * NamedType : Name\n */\n ;\n\n _proto.parseNamedType = function parseNamedType() {\n var start = this._lexer.token;\n return {\n kind: Kind.NAMED_TYPE,\n name: this.parseName(),\n loc: this.loc(start)\n };\n } // Implements the parsing rules in the Type Definition section.\n\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\n _proto.parseTypeSystemDefinition = function parseTypeSystemDefinition() {\n // Many definitions begin with a description and require a lookahead.\n var keywordToken = this.peekDescription() ? this._lexer.lookahead() : this._lexer.token;\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\n throw this.unexpected(keywordToken);\n };\n\n _proto.peekDescription = function peekDescription() {\n return this.peek(TokenKind.STRING) || this.peek(TokenKind.BLOCK_STRING);\n }\n /**\n * Description : StringValue\n */\n ;\n\n _proto.parseDescription = function parseDescription() {\n if (this.peekDescription()) {\n return this.parseStringLiteral();\n }\n }\n /**\n * SchemaDefinition : Description? schema Directives[Const]? { OperationTypeDefinition+ }\n */\n ;\n\n _proto.parseSchemaDefinition = function parseSchemaDefinition() {\n var start = this._lexer.token;\n var description = this.parseDescription();\n this.expectKeyword('schema');\n var directives = this.parseDirectives(true);\n var operationTypes = this.many(TokenKind.BRACE_L, this.parseOperationTypeDefinition, TokenKind.BRACE_R);\n return {\n kind: Kind.SCHEMA_DEFINITION,\n description: description,\n directives: directives,\n operationTypes: operationTypes,\n loc: this.loc(start)\n };\n }\n /**\n * OperationTypeDefinition : OperationType : NamedType\n */\n ;\n\n _proto.parseOperationTypeDefinition = function parseOperationTypeDefinition() {\n var start = this._lexer.token;\n var operation = this.parseOperationType();\n this.expectToken(TokenKind.COLON);\n var type = this.parseNamedType();\n return {\n kind: Kind.OPERATION_TYPE_DEFINITION,\n operation: operation,\n type: type,\n loc: this.loc(start)\n };\n }\n /**\n * ScalarTypeDefinition : Description? scalar Name Directives[Const]?\n */\n ;\n\n _proto.parseScalarTypeDefinition = function parseScalarTypeDefinition() {\n var start = this._lexer.token;\n var description = this.parseDescription();\n this.expectKeyword('scalar');\n var name = this.parseName();\n var directives = this.parseDirectives(true);\n return {\n kind: Kind.SCALAR_TYPE_DEFINITION,\n description: description,\n name: name,\n directives: directives,\n loc: this.loc(start)\n };\n }\n /**\n * ObjectTypeDefinition :\n * Description?\n * type Name ImplementsInterfaces? Directives[Const]? FieldsDefinition?\n */\n ;\n\n _proto.parseObjectTypeDefinition = function parseObjectTypeDefinition() {\n var start = this._lexer.token;\n var description = this.parseDescription();\n this.expectKeyword('type');\n var name = this.parseName();\n var interfaces = this.parseImplementsInterfaces();\n var directives = this.parseDirectives(true);\n var fields = this.parseFieldsDefinition();\n return {\n kind: Kind.OBJECT_TYPE_DEFINITION,\n description: description,\n name: name,\n interfaces: interfaces,\n directives: directives,\n fields: fields,\n loc: this.loc(start)\n };\n }\n /**\n * ImplementsInterfaces :\n * - implements `&`? NamedType\n * - ImplementsInterfaces & NamedType\n */\n ;\n\n _proto.parseImplementsInterfaces = function parseImplementsInterfaces() {\n var _this$_options2;\n\n if (!this.expectOptionalKeyword('implements')) {\n return [];\n }\n\n if (((_this$_options2 = this._options) === null || _this$_options2 === void 0 ? void 0 : _this$_options2.allowLegacySDLImplementsInterfaces) === true) {\n var types = []; // Optional leading ampersand\n\n this.expectOptionalToken(TokenKind.AMP);\n\n do {\n types.push(this.parseNamedType());\n } while (this.expectOptionalToken(TokenKind.AMP) || this.peek(TokenKind.NAME));\n\n return types;\n }\n\n return this.delimitedMany(TokenKind.AMP, this.parseNamedType);\n }\n /**\n * FieldsDefinition : { FieldDefinition+ }\n */\n ;\n\n _proto.parseFieldsDefinition = function parseFieldsDefinition() {\n var _this$_options3;\n\n // Legacy support for the SDL?\n if (((_this$_options3 = this._options) === null || _this$_options3 === void 0 ? void 0 : _this$_options3.allowLegacySDLEmptyFields) === true && this.peek(TokenKind.BRACE_L) && this._lexer.lookahead().kind === TokenKind.BRACE_R) {\n this._lexer.advance();\n\n this._lexer.advance();\n\n return [];\n }\n\n return this.optionalMany(TokenKind.BRACE_L, this.parseFieldDefinition, TokenKind.BRACE_R);\n }\n /**\n * FieldDefinition :\n * - Description? Name ArgumentsDefinition? : Type Directives[Const]?\n */\n ;\n\n _proto.parseFieldDefinition = function parseFieldDefinition() {\n var start = this._lexer.token;\n var description = this.parseDescription();\n var name = this.parseName();\n var args = this.parseArgumentDefs();\n this.expectToken(TokenKind.COLON);\n var type = this.parseTypeReference();\n var directives = this.parseDirectives(true);\n return {\n kind: Kind.FIELD_DEFINITION,\n description: description,\n name: name,\n arguments: args,\n type: type,\n directives: directives,\n loc: this.loc(start)\n };\n }\n /**\n * ArgumentsDefinition : ( InputValueDefinition+ )\n */\n ;\n\n _proto.parseArgumentDefs = function parseArgumentDefs() {\n return this.optionalMany(TokenKind.PAREN_L, this.parseInputValueDef, TokenKind.PAREN_R);\n }\n /**\n * InputValueDefinition :\n * - Description? Name : Type DefaultValue? Directives[Const]?\n */\n ;\n\n _proto.parseInputValueDef = function parseInputValueDef() {\n var start = this._lexer.token;\n var description = this.parseDescription();\n var name = this.parseName();\n this.expectToken(TokenKind.COLON);\n var type = this.parseTypeReference();\n var defaultValue;\n\n if (this.expectOptionalToken(TokenKind.EQUALS)) {\n defaultValue = this.parseValueLiteral(true);\n }\n\n var directives = this.parseDirectives(true);\n return {\n kind: Kind.INPUT_VALUE_DEFINITION,\n description: description,\n name: name,\n type: type,\n defaultValue: defaultValue,\n directives: directives,\n loc: this.loc(start)\n };\n }\n /**\n * InterfaceTypeDefinition :\n * - Description? interface Name Directives[Const]? FieldsDefinition?\n */\n ;\n\n _proto.parseInterfaceTypeDefinition = function parseInterfaceTypeDefinition() {\n var start = this._lexer.token;\n var description = this.parseDescription();\n this.expectKeyword('interface');\n var name = this.parseName();\n var interfaces = this.parseImplementsInterfaces();\n var directives = this.parseDirectives(true);\n var fields = this.parseFieldsDefinition();\n return {\n kind: Kind.INTERFACE_TYPE_DEFINITION,\n description: description,\n name: name,\n interfaces: interfaces,\n directives: directives,\n fields: fields,\n loc: this.loc(start)\n };\n }\n /**\n * UnionTypeDefinition :\n * - Description? union Name Directives[Const]? UnionMemberTypes?\n */\n ;\n\n _proto.parseUnionTypeDefinition = function parseUnionTypeDefinition() {\n var start = this._lexer.token;\n var description = this.parseDescription();\n this.expectKeyword('union');\n var name = this.parseName();\n var directives = this.parseDirectives(true);\n var types = this.parseUnionMemberTypes();\n return {\n kind: Kind.UNION_TYPE_DEFINITION,\n description: description,\n name: name,\n directives: directives,\n types: types,\n loc: this.loc(start)\n };\n }\n /**\n * UnionMemberTypes :\n * - = `|`? NamedType\n * - UnionMemberTypes | NamedType\n */\n ;\n\n _proto.parseUnionMemberTypes = function parseUnionMemberTypes() {\n return this.expectOptionalToken(TokenKind.EQUALS) ? this.delimitedMany(TokenKind.PIPE, this.parseNamedType) : [];\n }\n /**\n * EnumTypeDefinition :\n * - Description? enum Name Directives[Const]? EnumValuesDefinition?\n */\n ;\n\n _proto.parseEnumTypeDefinition = function parseEnumTypeDefinition() {\n var start = this._lexer.token;\n var description = this.parseDescription();\n this.expectKeyword('enum');\n var name = this.parseName();\n var directives = this.parseDirectives(true);\n var values = this.parseEnumValuesDefinition();\n return {\n kind: Kind.ENUM_TYPE_DEFINITION,\n description: description,\n name: name,\n directives: directives,\n values: values,\n loc: this.loc(start)\n };\n }\n /**\n * EnumValuesDefinition : { EnumValueDefinition+ }\n */\n ;\n\n _proto.parseEnumValuesDefinition = function parseEnumValuesDefinition() {\n return this.optionalMany(TokenKind.BRACE_L, this.parseEnumValueDefinition, TokenKind.BRACE_R);\n }\n /**\n * EnumValueDefinition : Description? EnumValue Directives[Const]?\n *\n * EnumValue : Name\n */\n ;\n\n _proto.parseEnumValueDefinition = function parseEnumValueDefinition() {\n var start = this._lexer.token;\n var description = this.parseDescription();\n var name = this.parseName();\n var directives = this.parseDirectives(true);\n return {\n kind: Kind.ENUM_VALUE_DEFINITION,\n description: description,\n name: name,\n directives: directives,\n loc: this.loc(start)\n };\n }\n /**\n * InputObjectTypeDefinition :\n * - Description? input Name Directives[Const]? InputFieldsDefinition?\n */\n ;\n\n _proto.parseInputObjectTypeDefinition = function parseInputObjectTypeDefinition() {\n var start = this._lexer.token;\n var description = this.parseDescription();\n this.expectKeyword('input');\n var name = this.parseName();\n var directives = this.parseDirectives(true);\n var fields = this.parseInputFieldsDefinition();\n return {\n kind: Kind.INPUT_OBJECT_TYPE_DEFINITION,\n description: description,\n name: name,\n directives: directives,\n fields: fields,\n loc: this.loc(start)\n };\n }\n /**\n * InputFieldsDefinition : { InputValueDefinition+ }\n */\n ;\n\n _proto.parseInputFieldsDefinition = function parseInputFieldsDefinition() {\n return this.optionalMany(TokenKind.BRACE_L, this.parseInputValueDef, TokenKind.BRACE_R);\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\n _proto.parseTypeSystemExtension = function parseTypeSystemExtension() {\n var 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 * SchemaExtension :\n * - extend schema Directives[Const]? { OperationTypeDefinition+ }\n * - extend schema Directives[Const]\n */\n ;\n\n _proto.parseSchemaExtension = function parseSchemaExtension() {\n var start = this._lexer.token;\n this.expectKeyword('extend');\n this.expectKeyword('schema');\n var directives = this.parseDirectives(true);\n var operationTypes = this.optionalMany(TokenKind.BRACE_L, this.parseOperationTypeDefinition, TokenKind.BRACE_R);\n\n if (directives.length === 0 && operationTypes.length === 0) {\n throw this.unexpected();\n }\n\n return {\n kind: Kind.SCHEMA_EXTENSION,\n directives: directives,\n operationTypes: operationTypes,\n loc: this.loc(start)\n };\n }\n /**\n * ScalarTypeExtension :\n * - extend scalar Name Directives[Const]\n */\n ;\n\n _proto.parseScalarTypeExtension = function parseScalarTypeExtension() {\n var start = this._lexer.token;\n this.expectKeyword('extend');\n this.expectKeyword('scalar');\n var name = this.parseName();\n var directives = this.parseDirectives(true);\n\n if (directives.length === 0) {\n throw this.unexpected();\n }\n\n return {\n kind: Kind.SCALAR_TYPE_EXTENSION,\n name: name,\n directives: directives,\n loc: this.loc(start)\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\n _proto.parseObjectTypeExtension = function parseObjectTypeExtension() {\n var start = this._lexer.token;\n this.expectKeyword('extend');\n this.expectKeyword('type');\n var name = this.parseName();\n var interfaces = this.parseImplementsInterfaces();\n var directives = this.parseDirectives(true);\n var fields = this.parseFieldsDefinition();\n\n if (interfaces.length === 0 && directives.length === 0 && fields.length === 0) {\n throw this.unexpected();\n }\n\n return {\n kind: Kind.OBJECT_TYPE_EXTENSION,\n name: name,\n interfaces: interfaces,\n directives: directives,\n fields: fields,\n loc: this.loc(start)\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\n _proto.parseInterfaceTypeExtension = function parseInterfaceTypeExtension() {\n var start = this._lexer.token;\n this.expectKeyword('extend');\n this.expectKeyword('interface');\n var name = this.parseName();\n var interfaces = this.parseImplementsInterfaces();\n var directives = this.parseDirectives(true);\n var fields = this.parseFieldsDefinition();\n\n if (interfaces.length === 0 && directives.length === 0 && fields.length === 0) {\n throw this.unexpected();\n }\n\n return {\n kind: Kind.INTERFACE_TYPE_EXTENSION,\n name: name,\n interfaces: interfaces,\n directives: directives,\n fields: fields,\n loc: this.loc(start)\n };\n }\n /**\n * UnionTypeExtension :\n * - extend union Name Directives[Const]? UnionMemberTypes\n * - extend union Name Directives[Const]\n */\n ;\n\n _proto.parseUnionTypeExtension = function parseUnionTypeExtension() {\n var start = this._lexer.token;\n this.expectKeyword('extend');\n this.expectKeyword('union');\n var name = this.parseName();\n var directives = this.parseDirectives(true);\n var types = this.parseUnionMemberTypes();\n\n if (directives.length === 0 && types.length === 0) {\n throw this.unexpected();\n }\n\n return {\n kind: Kind.UNION_TYPE_EXTENSION,\n name: name,\n directives: directives,\n types: types,\n loc: this.loc(start)\n };\n }\n /**\n * EnumTypeExtension :\n * - extend enum Name Directives[Const]? EnumValuesDefinition\n * - extend enum Name Directives[Const]\n */\n ;\n\n _proto.parseEnumTypeExtension = function parseEnumTypeExtension() {\n var start = this._lexer.token;\n this.expectKeyword('extend');\n this.expectKeyword('enum');\n var name = this.parseName();\n var directives = this.parseDirectives(true);\n var values = this.parseEnumValuesDefinition();\n\n if (directives.length === 0 && values.length === 0) {\n throw this.unexpected();\n }\n\n return {\n kind: Kind.ENUM_TYPE_EXTENSION,\n name: name,\n directives: directives,\n values: values,\n loc: this.loc(start)\n };\n }\n /**\n * InputObjectTypeExtension :\n * - extend input Name Directives[Const]? InputFieldsDefinition\n * - extend input Name Directives[Const]\n */\n ;\n\n _proto.parseInputObjectTypeExtension = function parseInputObjectTypeExtension() {\n var start = this._lexer.token;\n this.expectKeyword('extend');\n this.expectKeyword('input');\n var name = this.parseName();\n var directives = this.parseDirectives(true);\n var fields = this.parseInputFieldsDefinition();\n\n if (directives.length === 0 && fields.length === 0) {\n throw this.unexpected();\n }\n\n return {\n kind: Kind.INPUT_OBJECT_TYPE_EXTENSION,\n name: name,\n directives: directives,\n fields: fields,\n loc: this.loc(start)\n };\n }\n /**\n * DirectiveDefinition :\n * - Description? directive @ Name ArgumentsDefinition? `repeatable`? on DirectiveLocations\n */\n ;\n\n _proto.parseDirectiveDefinition = function parseDirectiveDefinition() {\n var start = this._lexer.token;\n var description = this.parseDescription();\n this.expectKeyword('directive');\n this.expectToken(TokenKind.AT);\n var name = this.parseName();\n var args = this.parseArgumentDefs();\n var repeatable = this.expectOptionalKeyword('repeatable');\n this.expectKeyword('on');\n var locations = this.parseDirectiveLocations();\n return {\n kind: Kind.DIRECTIVE_DEFINITION,\n description: description,\n name: name,\n arguments: args,\n repeatable: repeatable,\n locations: locations,\n loc: this.loc(start)\n };\n }\n /**\n * DirectiveLocations :\n * - `|`? DirectiveLocation\n * - DirectiveLocations | DirectiveLocation\n */\n ;\n\n _proto.parseDirectiveLocations = function 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\n _proto.parseDirectiveLocation = function parseDirectiveLocation() {\n var start = this._lexer.token;\n var name = this.parseName();\n\n if (DirectiveLocation[name.value] !== undefined) {\n return name;\n }\n\n throw this.unexpected(start);\n } // Core parsing utility functions\n\n /**\n * Returns a location object, used to identify the place in the source that created a given parsed object.\n */\n ;\n\n _proto.loc = function loc(startToken) {\n var _this$_options4;\n\n if (((_this$_options4 = this._options) === null || _this$_options4 === void 0 ? void 0 : _this$_options4.noLocation) !== true) {\n return new Location(startToken, this._lexer.lastToken, this._lexer.source);\n }\n }\n /**\n * Determines if the next token is of a given kind\n */\n ;\n\n _proto.peek = function 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\n _proto.expectToken = function expectToken(kind) {\n var token = this._lexer.token;\n\n if (token.kind === kind) {\n this._lexer.advance();\n\n return token;\n }\n\n throw syntaxError(this._lexer.source, token.start, \"Expected \".concat(getTokenKindDesc(kind), \", found \").concat(getTokenDesc(token), \".\"));\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 return undefined.\n */\n ;\n\n _proto.expectOptionalToken = function expectOptionalToken(kind) {\n var token = this._lexer.token;\n\n if (token.kind === kind) {\n this._lexer.advance();\n\n return token;\n }\n\n return undefined;\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\n _proto.expectKeyword = function expectKeyword(value) {\n var token = this._lexer.token;\n\n if (token.kind === TokenKind.NAME && token.value === value) {\n this._lexer.advance();\n } else {\n throw syntaxError(this._lexer.source, token.start, \"Expected \\\"\".concat(value, \"\\\", found \").concat(getTokenDesc(token), \".\"));\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\n _proto.expectOptionalKeyword = function expectOptionalKeyword(value) {\n var token = this._lexer.token;\n\n if (token.kind === TokenKind.NAME && token.value === value) {\n this._lexer.advance();\n\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\n _proto.unexpected = function unexpected(atToken) {\n var token = atToken !== null && atToken !== void 0 ? atToken : this._lexer.token;\n return syntaxError(this._lexer.source, token.start, \"Unexpected \".concat(getTokenDesc(token), \".\"));\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\n _proto.any = function any(openKind, parseFn, closeKind) {\n this.expectToken(openKind);\n var 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\n _proto.optionalMany = function optionalMany(openKind, parseFn, closeKind) {\n if (this.expectOptionalToken(openKind)) {\n var 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\n _proto.many = function many(openKind, parseFn, closeKind) {\n this.expectToken(openKind);\n var 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\n _proto.delimitedMany = function delimitedMany(delimiterKind, parseFn) {\n this.expectOptionalToken(delimiterKind);\n var nodes = [];\n\n do {\n nodes.push(parseFn.call(this));\n } while (this.expectOptionalToken(delimiterKind));\n\n return nodes;\n };\n\n return Parser;\n}();\n/**\n * A helper function to describe a token as a string for debugging.\n */\n\nfunction getTokenDesc(token) {\n var value = token.value;\n return getTokenKindDesc(token.kind) + (value != null ? \" \\\"\".concat(value, \"\\\"\") : '');\n}\n/**\n * A helper function to describe a token kind as a string for debugging.\n */\n\n\nfunction getTokenKindDesc(kind) {\n return isPunctuatorTokenKind(kind) ? \"\\\"\".concat(kind, \"\\\"\") : kind;\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: \".concat(description), undefined, source, [position]);\n}\n","function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _wrapNativeSuper(Class) { var _cache = typeof Map === \"function\" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== \"function\") { throw new TypeError(\"Super expression must either be null or a function\"); } if (typeof _cache !== \"undefined\") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); }\n\nfunction _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct; } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _isNativeFunction(fn) { return Function.toString.call(fn).indexOf(\"[native code]\") !== -1; }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nimport isObjectLike from \"../jsutils/isObjectLike.mjs\";\nimport { SYMBOL_TO_STRING_TAG } from \"../polyfills/symbols.mjs\";\nimport { getLocation } from \"../language/location.mjs\";\nimport { printLocation, printSourceLocation } from \"../language/printLocation.mjs\";\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 var GraphQLError = /*#__PURE__*/function (_Error) {\n _inherits(GraphQLError, _Error);\n\n var _super = _createSuper(GraphQLError);\n\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 function GraphQLError(message, nodes, source, positions, path, originalError, extensions) {\n var _nodeLocations, _nodeLocations2, _nodeLocations3;\n\n var _this;\n\n _classCallCheck(this, GraphQLError);\n\n _this = _super.call(this, message);\n _this.name = 'GraphQLError';\n _this.originalError = originalError !== null && originalError !== void 0 ? originalError : undefined; // Compute list of blame nodes.\n\n _this.nodes = undefinedIfEmpty(Array.isArray(nodes) ? nodes : nodes ? [nodes] : undefined);\n var nodeLocations = [];\n\n for (var _i2 = 0, _ref3 = (_this$nodes = _this.nodes) !== null && _this$nodes !== void 0 ? _this$nodes : []; _i2 < _ref3.length; _i2++) {\n var _this$nodes;\n\n var _ref4 = _ref3[_i2];\n var loc = _ref4.loc;\n\n if (loc != null) {\n nodeLocations.push(loc);\n }\n }\n\n nodeLocations = undefinedIfEmpty(nodeLocations); // Compute locations in the source for the given nodes/positions.\n\n _this.source = source !== null && source !== void 0 ? source : (_nodeLocations = nodeLocations) === null || _nodeLocations === void 0 ? void 0 : _nodeLocations[0].source;\n _this.positions = positions !== null && positions !== void 0 ? positions : (_nodeLocations2 = nodeLocations) === null || _nodeLocations2 === void 0 ? void 0 : _nodeLocations2.map(function (loc) {\n return loc.start;\n });\n _this.locations = positions && source ? positions.map(function (pos) {\n return getLocation(source, pos);\n }) : (_nodeLocations3 = nodeLocations) === null || _nodeLocations3 === void 0 ? void 0 : _nodeLocations3.map(function (loc) {\n return getLocation(loc.source, loc.start);\n });\n _this.path = path !== null && path !== void 0 ? path : undefined;\n var originalExtensions = originalError === null || originalError === void 0 ? void 0 : originalError.extensions;\n\n if (extensions == null && isObjectLike(originalExtensions)) {\n _this.extensions = _objectSpread({}, originalExtensions);\n } else {\n _this.extensions = extensions !== null && extensions !== void 0 ? extensions : {};\n } // By being enumerable, JSON.stringify will include bellow properties in the resulting output.\n // This ensures that the simplest possible GraphQL service adheres to the spec.\n\n\n Object.defineProperties(_assertThisInitialized(_this), {\n message: {\n enumerable: true\n },\n locations: {\n enumerable: _this.locations != null\n },\n path: {\n enumerable: _this.path != null\n },\n extensions: {\n enumerable: _this.extensions != null && Object.keys(_this.extensions).length > 0\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 if (originalError !== null && originalError !== void 0 && originalError.stack) {\n Object.defineProperty(_assertThisInitialized(_this), 'stack', {\n value: originalError.stack,\n writable: true,\n configurable: true\n });\n return _possibleConstructorReturn(_this);\n } // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2317')\n\n\n if (Error.captureStackTrace) {\n Error.captureStackTrace(_assertThisInitialized(_this), GraphQLError);\n } else {\n Object.defineProperty(_assertThisInitialized(_this), 'stack', {\n value: Error().stack,\n writable: true,\n configurable: true\n });\n }\n\n return _this;\n }\n\n _createClass(GraphQLError, [{\n key: \"toString\",\n value: function toString() {\n return printError(this);\n } // FIXME: workaround to not break chai comparisons, should be remove in v16\n // $FlowFixMe[unsupported-syntax] Flow doesn't support computed properties yet\n\n }, {\n key: SYMBOL_TO_STRING_TAG,\n get: function get() {\n return 'Object';\n }\n }]);\n\n return GraphQLError;\n}( /*#__PURE__*/_wrapNativeSuper(Error));\n\nfunction undefinedIfEmpty(array) {\n return array === undefined || array.length === 0 ? undefined : array;\n}\n/**\n * Prints a GraphQLError to a string, representing useful location information\n * about the error's position in the source.\n */\n\n\nexport function printError(error) {\n var output = error.message;\n\n if (error.nodes) {\n for (var _i4 = 0, _error$nodes2 = error.nodes; _i4 < _error$nodes2.length; _i4++) {\n var node = _error$nodes2[_i4];\n\n if (node.loc) {\n output += '\\n\\n' + printLocation(node.loc);\n }\n }\n } else if (error.source && error.locations) {\n for (var _i6 = 0, _error$locations2 = error.locations; _i6 < _error$locations2.length; _i6++) {\n var location = _error$locations2[_i6];\n output += '\\n\\n' + printSourceLocation(error.source, location);\n }\n }\n\n return output;\n}\n","function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\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 default function isObjectLike(value) {\n return _typeof(value) == 'object' && value !== null;\n}\n","// In ES2015 (or a polyfilled) environment, this will be Symbol.iterator\n// istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2317')\nexport var SYMBOL_ITERATOR = typeof Symbol === 'function' && Symbol.iterator != null ? Symbol.iterator : '@@iterator'; // In ES2017 (or a polyfilled) environment, this will be Symbol.asyncIterator\n// istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2317')\n\nexport var SYMBOL_ASYNC_ITERATOR = typeof Symbol === 'function' && Symbol.asyncIterator != null ? Symbol.asyncIterator : '@@asyncIterator'; // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2317')\n\nexport var SYMBOL_TO_STRING_TAG = typeof Symbol === 'function' && Symbol.toStringTag != null ? Symbol.toStringTag : '@@toStringTag';\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 var lineRegexp = /\\r\\n|[\\n\\r]/g;\n var line = 1;\n var column = position + 1;\n var match;\n\n while ((match = lineRegexp.exec(source.body)) && match.index < position) {\n line += 1;\n column = position + 1 - (match.index + match[0].length);\n }\n\n return {\n line: line,\n column: column\n };\n}\n","import { getLocation } from \"./location.mjs\";\n/**\n * Render a helpful description of the location in the GraphQL Source document.\n */\n\nexport function printLocation(location) {\n return printSourceLocation(location.source, getLocation(location.source, location.start));\n}\n/**\n * Render a helpful description of the location in the GraphQL Source document.\n */\n\nexport function printSourceLocation(source, sourceLocation) {\n var firstLineColumnOffset = source.locationOffset.column - 1;\n var body = whitespace(firstLineColumnOffset) + source.body;\n var lineIndex = sourceLocation.line - 1;\n var lineOffset = source.locationOffset.line - 1;\n var lineNum = sourceLocation.line + lineOffset;\n var columnOffset = sourceLocation.line === 1 ? firstLineColumnOffset : 0;\n var columnNum = sourceLocation.column + columnOffset;\n var locationStr = \"\".concat(source.name, \":\").concat(lineNum, \":\").concat(columnNum, \"\\n\");\n var lines = body.split(/\\r\\n|[\\n\\r]/g);\n var locationLine = lines[lineIndex]; // Special case for minified documents\n\n if (locationLine.length > 120) {\n var subLineIndex = Math.floor(columnNum / 80);\n var subLineColumnNum = columnNum % 80;\n var subLines = [];\n\n for (var i = 0; i < locationLine.length; i += 80) {\n subLines.push(locationLine.slice(i, i + 80));\n }\n\n return locationStr + printPrefixedLines([[\"\".concat(lineNum), subLines[0]]].concat(subLines.slice(1, subLineIndex + 1).map(function (subLine) {\n return ['', subLine];\n }), [[' ', whitespace(subLineColumnNum - 1) + '^'], ['', subLines[subLineIndex + 1]]]));\n }\n\n return locationStr + printPrefixedLines([// Lines specified like this: [\"prefix\", \"string\"],\n [\"\".concat(lineNum - 1), lines[lineIndex - 1]], [\"\".concat(lineNum), locationLine], ['', whitespace(columnNum - 1) + '^'], [\"\".concat(lineNum + 1), lines[lineIndex + 1]]]);\n}\n\nfunction printPrefixedLines(lines) {\n var existingLines = lines.filter(function (_ref) {\n var _ = _ref[0],\n line = _ref[1];\n return line !== undefined;\n });\n var padLen = Math.max.apply(Math, existingLines.map(function (_ref2) {\n var prefix = _ref2[0];\n return prefix.length;\n }));\n return existingLines.map(function (_ref3) {\n var prefix = _ref3[0],\n line = _ref3[1];\n return leftPad(padLen, prefix) + (line ? ' | ' + line : ' |');\n }).join('\\n');\n}\n\nfunction whitespace(len) {\n return Array(len + 1).join(' ');\n}\n\nfunction leftPad(len, str) {\n return whitespace(len - str.length) + str;\n}\n","/**\n * The set of allowed kind values for AST nodes.\n */\nexport var Kind = Object.freeze({\n // Name\n NAME: 'Name',\n // Document\n DOCUMENT: 'Document',\n OPERATION_DEFINITION: 'OperationDefinition',\n VARIABLE_DEFINITION: 'VariableDefinition',\n SELECTION_SET: 'SelectionSet',\n FIELD: 'Field',\n ARGUMENT: 'Argument',\n // Fragments\n FRAGMENT_SPREAD: 'FragmentSpread',\n INLINE_FRAGMENT: 'InlineFragment',\n FRAGMENT_DEFINITION: 'FragmentDefinition',\n // Values\n VARIABLE: 'Variable',\n INT: 'IntValue',\n FLOAT: 'FloatValue',\n STRING: 'StringValue',\n BOOLEAN: 'BooleanValue',\n NULL: 'NullValue',\n ENUM: 'EnumValue',\n LIST: 'ListValue',\n OBJECT: 'ObjectValue',\n OBJECT_FIELD: 'ObjectField',\n // Directives\n DIRECTIVE: 'Directive',\n // Types\n NAMED_TYPE: 'NamedType',\n LIST_TYPE: 'ListType',\n NON_NULL_TYPE: 'NonNullType',\n // Type System Definitions\n SCHEMA_DEFINITION: 'SchemaDefinition',\n OPERATION_TYPE_DEFINITION: 'OperationTypeDefinition',\n // Type Definitions\n SCALAR_TYPE_DEFINITION: 'ScalarTypeDefinition',\n OBJECT_TYPE_DEFINITION: 'ObjectTypeDefinition',\n FIELD_DEFINITION: 'FieldDefinition',\n INPUT_VALUE_DEFINITION: 'InputValueDefinition',\n INTERFACE_TYPE_DEFINITION: 'InterfaceTypeDefinition',\n UNION_TYPE_DEFINITION: 'UnionTypeDefinition',\n ENUM_TYPE_DEFINITION: 'EnumTypeDefinition',\n ENUM_VALUE_DEFINITION: 'EnumValueDefinition',\n INPUT_OBJECT_TYPE_DEFINITION: 'InputObjectTypeDefinition',\n // Directive Definitions\n DIRECTIVE_DEFINITION: 'DirectiveDefinition',\n // Type System Extensions\n SCHEMA_EXTENSION: 'SchemaExtension',\n // Type Extensions\n SCALAR_TYPE_EXTENSION: 'ScalarTypeExtension',\n OBJECT_TYPE_EXTENSION: 'ObjectTypeExtension',\n INTERFACE_TYPE_EXTENSION: 'InterfaceTypeExtension',\n UNION_TYPE_EXTENSION: 'UnionTypeExtension',\n ENUM_TYPE_EXTENSION: 'EnumTypeExtension',\n INPUT_OBJECT_TYPE_EXTENSION: 'InputObjectTypeExtension'\n});\n/**\n * The enum type representing the possible kind values of AST nodes.\n */\n","import defineInspect from \"../jsutils/defineInspect.mjs\";\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 var Location = /*#__PURE__*/function () {\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 function Location(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 var _proto = Location.prototype;\n\n _proto.toJSON = function toJSON() {\n return {\n start: this.start,\n end: this.end\n };\n };\n\n return Location;\n}(); // Print a simplified form when appearing in `inspect` and `util.inspect`.\n\ndefineInspect(Location);\n/**\n * Represents a range of characters represented by a lexical token\n * within a Source.\n */\n\nexport var Token = /*#__PURE__*/function () {\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\n /**\n * Tokens exist as nodes in a double-linked-list amongst all tokens\n * including ignored tokens. <SOF> is always the first node and <EOF>\n * the last.\n */\n function Token(kind, start, end, line, column, prev, value) {\n this.kind = kind;\n this.start = start;\n this.end = end;\n this.line = line;\n this.column = column;\n this.value = value;\n this.prev = prev;\n this.next = null;\n }\n\n var _proto2 = Token.prototype;\n\n _proto2.toJSON = function toJSON() {\n return {\n kind: this.kind,\n value: this.value,\n line: this.line,\n column: this.column\n };\n };\n\n return Token;\n}(); // Print a simplified form when appearing in `inspect` and `util.inspect`.\n\ndefineInspect(Token);\n/**\n * @internal\n */\n\nexport function isNode(maybeNode) {\n return maybeNode != null && typeof maybeNode.kind === 'string';\n}\n/**\n * The list of all possible AST node types.\n */\n","import invariant from \"./invariant.mjs\";\nimport nodejsCustomInspectSymbol from \"./nodejsCustomInspectSymbol.mjs\";\n/**\n * The `defineInspect()` function defines `inspect()` prototype method as alias of `toJSON`\n */\n\nexport default function defineInspect(classObject) {\n var fn = classObject.prototype.toJSON;\n typeof fn === 'function' || invariant(0);\n classObject.prototype.inspect = fn; // istanbul ignore else (See: 'https://github.com/graphql/graphql-js/issues/2317')\n\n if (nodejsCustomInspectSymbol) {\n classObject.prototype[nodejsCustomInspectSymbol] = fn;\n }\n}\n","export default function invariant(condition, message) {\n var booleanCondition = Boolean(condition); // istanbul ignore else (See transformation done in './resources/inlineInvariant.js')\n\n if (!booleanCondition) {\n throw new Error(message != null ? message : 'Unexpected invariant triggered.');\n }\n}\n","// istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2317')\nvar nodejsCustomInspectSymbol = typeof Symbol === 'function' && typeof Symbol.for === 'function' ? Symbol.for('nodejs.util.inspect.custom') : undefined;\nexport default nodejsCustomInspectSymbol;\n","/**\n * An exported enum describing the different kinds of tokens that the\n * lexer emits.\n */\nexport var TokenKind = Object.freeze({\n SOF: '<SOF>',\n EOF: '<EOF>',\n BANG: '!',\n DOLLAR: '$',\n AMP: '&',\n PAREN_L: '(',\n PAREN_R: ')',\n SPREAD: '...',\n COLON: ':',\n EQUALS: '=',\n AT: '@',\n BRACKET_L: '[',\n BRACKET_R: ']',\n BRACE_L: '{',\n PIPE: '|',\n BRACE_R: '}',\n NAME: 'Name',\n INT: 'Int',\n FLOAT: 'Float',\n STRING: 'String',\n BLOCK_STRING: 'BlockString',\n COMMENT: 'Comment'\n});\n/**\n * The enum type representing the token kinds values.\n */\n","function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nimport { SYMBOL_TO_STRING_TAG } from \"../polyfills/symbols.mjs\";\nimport inspect from \"../jsutils/inspect.mjs\";\nimport devAssert from \"../jsutils/devAssert.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 var Source = /*#__PURE__*/function () {\n function Source(body) {\n var name = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'GraphQL request';\n var locationOffset = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {\n line: 1,\n column: 1\n };\n typeof body === 'string' || devAssert(0, \"Body must be a string. Received: \".concat(inspect(body), \".\"));\n this.body = body;\n this.name = name;\n this.locationOffset = locationOffset;\n this.locationOffset.line > 0 || devAssert(0, 'line in locationOffset is 1-indexed and must be positive.');\n this.locationOffset.column > 0 || devAssert(0, 'column in locationOffset is 1-indexed and must be positive.');\n } // $FlowFixMe[unsupported-syntax] Flow doesn't support computed properties yet\n\n\n _createClass(Source, [{\n key: SYMBOL_TO_STRING_TAG,\n get: function get() {\n return 'Source';\n }\n }]);\n\n return Source;\n}();\n/**\n * Test if the given value is a Source object.\n *\n * @internal\n */\n\n// eslint-disable-next-line no-redeclare\nexport function isSource(source) {\n return instanceOf(source, Source);\n}\n","function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\n/* eslint-disable flowtype/no-weak-types */\nimport nodejsCustomInspectSymbol from \"./nodejsCustomInspectSymbol.mjs\";\nvar MAX_ARRAY_LENGTH = 10;\nvar MAX_RECURSIVE_DEPTH = 2;\n/**\n * Used to print values in error messages.\n */\n\nexport default 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 \".concat(value.name, \"]\") : '[function]';\n\n case 'object':\n if (value === null) {\n return 'null';\n }\n\n return formatObjectValue(value, seenValues);\n\n default:\n return String(value);\n }\n}\n\nfunction formatObjectValue(value, previouslySeenValues) {\n if (previouslySeenValues.indexOf(value) !== -1) {\n return '[Circular]';\n }\n\n var seenValues = [].concat(previouslySeenValues, [value]);\n var customInspectFn = getCustomFn(value);\n\n if (customInspectFn !== undefined) {\n var customValue = customInspectFn.call(value); // check for infinite recursion\n\n if (customValue !== value) {\n return typeof customValue === 'string' ? customValue : formatValue(customValue, seenValues);\n }\n } else if (Array.isArray(value)) {\n return formatArray(value, seenValues);\n }\n\n return formatObject(value, seenValues);\n}\n\nfunction formatObject(object, seenValues) {\n var keys = Object.keys(object);\n\n if (keys.length === 0) {\n return '{}';\n }\n\n if (seenValues.length > MAX_RECURSIVE_DEPTH) {\n return '[' + getObjectTag(object) + ']';\n }\n\n var properties = keys.map(function (key) {\n var value = formatValue(object[key], seenValues);\n return key + ': ' + value;\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 var len = Math.min(MAX_ARRAY_LENGTH, array.length);\n var remaining = array.length - len;\n var items = [];\n\n for (var 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(\"... \".concat(remaining, \" more items\"));\n }\n\n return '[' + items.join(', ') + ']';\n}\n\nfunction getCustomFn(object) {\n var customInspectFn = object[String(nodejsCustomInspectSymbol)];\n\n if (typeof customInspectFn === 'function') {\n return customInspectFn;\n }\n\n if (typeof object.inspect === 'function') {\n return object.inspect;\n }\n}\n\nfunction getObjectTag(object) {\n var tag = Object.prototype.toString.call(object).replace(/^\\[object /, '').replace(/]$/, '');\n\n if (tag === 'Object' && typeof object.constructor === 'function') {\n var name = object.constructor.name;\n\n if (typeof name === 'string' && name !== '') {\n return name;\n }\n }\n\n return tag;\n}\n","export default function devAssert(condition, message) {\n var booleanCondition = Boolean(condition); // istanbul ignore else (See transformation done in './resources/inlineInvariant.js')\n\n if (!booleanCondition) {\n throw new Error(message);\n }\n}\n","function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nimport inspect from \"./inspect.mjs\";\n/**\n * A replacement for instanceof which includes an error warning when multi-realm\n * constructors are detected.\n */\n\n// See: https://expressjs.com/en/advanced/best-practice-performance.html#set-node_env-to-production\n// See: https://webpack.js.org/guides/production/\nexport default process.env.NODE_ENV === 'production' ? // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2317')\n// eslint-disable-next-line no-shadow\nfunction instanceOf(value, constructor) {\n return value instanceof constructor;\n} : // eslint-disable-next-line no-shadow\nfunction 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 var className = constructor.prototype[Symbol.toStringTag];\n var valueClassName = // We still need to support constructor's name to detect conflicts with older versions of this library.\n Symbol.toStringTag in value ? value[Symbol.toStringTag] : (_value$constructor = value.constructor) === null || _value$constructor === void 0 ? void 0 : _value$constructor.name;\n\n if (className === valueClassName) {\n var stringifiedValue = inspect(value);\n throw new Error(\"Cannot use \".concat(className, \" \\\"\").concat(stringifiedValue, \"\\\" from another module or realm.\\n\\nEnsure that there is only one instance of \\\"graphql\\\" in the node_modules\\ndirectory. If different versions of \\\"graphql\\\" are the dependencies of other\\nrelied on modules, use \\\"resolutions\\\" to ensure only one version is installed.\\n\\nhttps://yarnpkg.com/en/docs/selective-version-resolutions\\n\\nDuplicate \\\"graphql\\\" modules cannot be used at the same time since different\\nversions may have different capabilities and behavior. The data from one\\nversion used in the function from another could produce confusing and\\nspurious results.\"));\n }\n }\n\n return false;\n};\n","/**\n * The set of allowed directive location values.\n */\nexport var DirectiveLocation = Object.freeze({\n // Request Definitions\n QUERY: 'QUERY',\n MUTATION: 'MUTATION',\n SUBSCRIPTION: 'SUBSCRIPTION',\n FIELD: 'FIELD',\n FRAGMENT_DEFINITION: 'FRAGMENT_DEFINITION',\n FRAGMENT_SPREAD: 'FRAGMENT_SPREAD',\n INLINE_FRAGMENT: 'INLINE_FRAGMENT',\n VARIABLE_DEFINITION: 'VARIABLE_DEFINITION',\n // Type System Definitions\n SCHEMA: 'SCHEMA',\n SCALAR: 'SCALAR',\n OBJECT: 'OBJECT',\n FIELD_DEFINITION: 'FIELD_DEFINITION',\n ARGUMENT_DEFINITION: 'ARGUMENT_DEFINITION',\n INTERFACE: 'INTERFACE',\n UNION: 'UNION',\n ENUM: 'ENUM',\n ENUM_VALUE: 'ENUM_VALUE',\n INPUT_OBJECT: 'INPUT_OBJECT',\n INPUT_FIELD_DEFINITION: 'INPUT_FIELD_DEFINITION'\n});\n/**\n * The enum type representing the directive location values.\n */\n","import { syntaxError } from \"../error/syntaxError.mjs\";\nimport { Token } from \"./ast.mjs\";\nimport { TokenKind } from \"./tokenKind.mjs\";\nimport { dedentBlockStringValue } from \"./blockString.mjs\";\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 */\n\nexport var Lexer = /*#__PURE__*/function () {\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 function Lexer(source) {\n var startOfFileToken = new Token(TokenKind.SOF, 0, 0, 0, 0, null);\n this.source = source;\n this.lastToken = startOfFileToken;\n this.token = startOfFileToken;\n this.line = 1;\n this.lineStart = 0;\n }\n /**\n * Advances the token stream to the next non-ignored token.\n */\n\n\n var _proto = Lexer.prototype;\n\n _proto.advance = function advance() {\n this.lastToken = this.token;\n var 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\n _proto.lookahead = function lookahead() {\n var token = this.token;\n\n if (token.kind !== TokenKind.EOF) {\n do {\n var _token$next;\n\n // Note: next is only mutable during parsing, so we cast to allow this.\n token = (_token$next = token.next) !== null && _token$next !== void 0 ? _token$next : token.next = readToken(this, token);\n } while (token.kind === TokenKind.COMMENT);\n }\n\n return token;\n };\n\n return Lexer;\n}();\n/**\n * @internal\n */\n\nexport function isPunctuatorTokenKind(kind) {\n return kind === TokenKind.BANG || kind === TokenKind.DOLLAR || kind === TokenKind.AMP || kind === TokenKind.PAREN_L || kind === TokenKind.PAREN_R || kind === TokenKind.SPREAD || kind === TokenKind.COLON || kind === TokenKind.EQUALS || kind === TokenKind.AT || kind === TokenKind.BRACKET_L || kind === TokenKind.BRACKET_R || kind === TokenKind.BRACE_L || kind === TokenKind.PIPE || kind === TokenKind.BRACE_R;\n}\n\nfunction printCharCode(code) {\n return (// NaN/undefined represents access beyond the end of the file.\n isNaN(code) ? TokenKind.EOF : // Trust JSON for ASCII.\n code < 0x007f ? JSON.stringify(String.fromCharCode(code)) : // Otherwise print the escaped form.\n \"\\\"\\\\u\".concat(('00' + code.toString(16).toUpperCase()).slice(-4), \"\\\"\")\n );\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\n\nfunction readToken(lexer, prev) {\n var source = lexer.source;\n var body = source.body;\n var bodyLength = body.length;\n var pos = prev.end;\n\n while (pos < bodyLength) {\n var code = body.charCodeAt(pos);\n var _line = lexer.line;\n\n var _col = 1 + pos - lexer.lineStart; // SourceCharacter\n\n\n switch (code) {\n case 0xfeff: // <BOM>\n\n case 9: // \\t\n\n case 32: // <space>\n\n case 44:\n // ,\n ++pos;\n continue;\n\n case 10:\n // \\n\n ++pos;\n ++lexer.line;\n lexer.lineStart = pos;\n continue;\n\n case 13:\n // \\r\n if (body.charCodeAt(pos + 1) === 10) {\n pos += 2;\n } else {\n ++pos;\n }\n\n ++lexer.line;\n lexer.lineStart = pos;\n continue;\n\n case 33:\n // !\n return new Token(TokenKind.BANG, pos, pos + 1, _line, _col, prev);\n\n case 35:\n // #\n return readComment(source, pos, _line, _col, prev);\n\n case 36:\n // $\n return new Token(TokenKind.DOLLAR, pos, pos + 1, _line, _col, prev);\n\n case 38:\n // &\n return new Token(TokenKind.AMP, pos, pos + 1, _line, _col, prev);\n\n case 40:\n // (\n return new Token(TokenKind.PAREN_L, pos, pos + 1, _line, _col, prev);\n\n case 41:\n // )\n return new Token(TokenKind.PAREN_R, pos, pos + 1, _line, _col, prev);\n\n case 46:\n // .\n if (body.charCodeAt(pos + 1) === 46 && body.charCodeAt(pos + 2) === 46) {\n return new Token(TokenKind.SPREAD, pos, pos + 3, _line, _col, prev);\n }\n\n break;\n\n case 58:\n // :\n return new Token(TokenKind.COLON, pos, pos + 1, _line, _col, prev);\n\n case 61:\n // =\n return new Token(TokenKind.EQUALS, pos, pos + 1, _line, _col, prev);\n\n case 64:\n // @\n return new Token(TokenKind.AT, pos, pos + 1, _line, _col, prev);\n\n case 91:\n // [\n return new Token(TokenKind.BRACKET_L, pos, pos + 1, _line, _col, prev);\n\n case 93:\n // ]\n return new Token(TokenKind.BRACKET_R, pos, pos + 1, _line, _col, prev);\n\n case 123:\n // {\n return new Token(TokenKind.BRACE_L, pos, pos + 1, _line, _col, prev);\n\n case 124:\n // |\n return new Token(TokenKind.PIPE, pos, pos + 1, _line, _col, prev);\n\n case 125:\n // }\n return new Token(TokenKind.BRACE_R, pos, pos + 1, _line, _col, prev);\n\n case 34:\n // \"\n if (body.charCodeAt(pos + 1) === 34 && body.charCodeAt(pos + 2) === 34) {\n return readBlockString(source, pos, _line, _col, prev, lexer);\n }\n\n return readString(source, pos, _line, _col, prev);\n\n case 45: // -\n\n case 48: // 0\n\n case 49: // 1\n\n case 50: // 2\n\n case 51: // 3\n\n case 52: // 4\n\n case 53: // 5\n\n case 54: // 6\n\n case 55: // 7\n\n case 56: // 8\n\n case 57:\n // 9\n return readNumber(source, pos, code, _line, _col, prev);\n\n case 65: // A\n\n case 66: // B\n\n case 67: // C\n\n case 68: // D\n\n case 69: // E\n\n case 70: // F\n\n case 71: // G\n\n case 72: // H\n\n case 73: // I\n\n case 74: // J\n\n case 75: // K\n\n case 76: // L\n\n case 77: // M\n\n case 78: // N\n\n case 79: // O\n\n case 80: // P\n\n case 81: // Q\n\n case 82: // R\n\n case 83: // S\n\n case 84: // T\n\n case 85: // U\n\n case 86: // V\n\n case 87: // W\n\n case 88: // X\n\n case 89: // Y\n\n case 90: // Z\n\n case 95: // _\n\n case 97: // a\n\n case 98: // b\n\n case 99: // c\n\n case 100: // d\n\n case 101: // e\n\n case 102: // f\n\n case 103: // g\n\n case 104: // h\n\n case 105: // i\n\n case 106: // j\n\n case 107: // k\n\n case 108: // l\n\n case 109: // m\n\n case 110: // n\n\n case 111: // o\n\n case 112: // p\n\n case 113: // q\n\n case 114: // r\n\n case 115: // s\n\n case 116: // t\n\n case 117: // u\n\n case 118: // v\n\n case 119: // w\n\n case 120: // x\n\n case 121: // y\n\n case 122:\n // z\n return readName(source, pos, _line, _col, prev);\n }\n\n throw syntaxError(source, pos, unexpectedCharacterMessage(code));\n }\n\n var line = lexer.line;\n var col = 1 + pos - lexer.lineStart;\n return new Token(TokenKind.EOF, bodyLength, bodyLength, line, col, prev);\n}\n/**\n * Report a message that an unexpected character was encountered.\n */\n\n\nfunction unexpectedCharacterMessage(code) {\n if (code < 0x0020 && code !== 0x0009 && code !== 0x000a && code !== 0x000d) {\n return \"Cannot contain the invalid character \".concat(printCharCode(code), \".\");\n }\n\n if (code === 39) {\n // '\n return 'Unexpected single quote character (\\'), did you mean to use a double quote (\")?';\n }\n\n return \"Cannot parse the unexpected character \".concat(printCharCode(code), \".\");\n}\n/**\n * Reads a comment token from the source file.\n *\n * #[\\u0009\\u0020-\\uFFFF]*\n */\n\n\nfunction readComment(source, start, line, col, prev) {\n var body = source.body;\n var code;\n var position = start;\n\n do {\n code = body.charCodeAt(++position);\n } while (!isNaN(code) && ( // SourceCharacter but not LineTerminator\n code > 0x001f || code === 0x0009));\n\n return new Token(TokenKind.COMMENT, start, position, line, col, prev, body.slice(start + 1, position));\n}\n/**\n * Reads a number token from the source file, either a float\n * or an int depending on whether a decimal point appears.\n *\n * Int: -?(0|[1-9][0-9]*)\n * Float: -?(0|[1-9][0-9]*)(\\.[0-9]+)?((E|e)(+|-)?[0-9]+)?\n */\n\n\nfunction readNumber(source, start, firstCode, line, col, prev) {\n var body = source.body;\n var code = firstCode;\n var position = start;\n var isFloat = false;\n\n if (code === 45) {\n // -\n code = body.charCodeAt(++position);\n }\n\n if (code === 48) {\n // 0\n code = body.charCodeAt(++position);\n\n if (code >= 48 && code <= 57) {\n throw syntaxError(source, position, \"Invalid number, unexpected digit after 0: \".concat(printCharCode(code), \".\"));\n }\n } else {\n position = readDigits(source, position, code);\n code = body.charCodeAt(position);\n }\n\n if (code === 46) {\n // .\n isFloat = true;\n code = body.charCodeAt(++position);\n position = readDigits(source, position, code);\n code = body.charCodeAt(position);\n }\n\n if (code === 69 || code === 101) {\n // E e\n isFloat = true;\n code = body.charCodeAt(++position);\n\n if (code === 43 || code === 45) {\n // + -\n code = body.charCodeAt(++position);\n }\n\n position = readDigits(source, position, code);\n code = body.charCodeAt(position);\n } // Numbers cannot be followed by . or NameStart\n\n\n if (code === 46 || isNameStart(code)) {\n throw syntaxError(source, position, \"Invalid number, expected digit but got: \".concat(printCharCode(code), \".\"));\n }\n\n return new Token(isFloat ? TokenKind.FLOAT : TokenKind.INT, start, position, line, col, prev, body.slice(start, position));\n}\n/**\n * Returns the new position in the source after reading digits.\n */\n\n\nfunction readDigits(source, start, firstCode) {\n var body = source.body;\n var position = start;\n var code = firstCode;\n\n if (code >= 48 && code <= 57) {\n // 0 - 9\n do {\n code = body.charCodeAt(++position);\n } while (code >= 48 && code <= 57); // 0 - 9\n\n\n return position;\n }\n\n throw syntaxError(source, position, \"Invalid number, expected digit but got: \".concat(printCharCode(code), \".\"));\n}\n/**\n * Reads a string token from the source file.\n *\n * \"([^\"\\\\\\u000A\\u000D]|(\\\\(u[0-9a-fA-F]{4}|[\"\\\\/bfnrt])))*\"\n */\n\n\nfunction readString(source, start, line, col, prev) {\n var body = source.body;\n var position = start + 1;\n var chunkStart = position;\n var code = 0;\n var value = '';\n\n while (position < body.length && !isNaN(code = body.charCodeAt(position)) && // not LineTerminator\n code !== 0x000a && code !== 0x000d) {\n // Closing Quote (\")\n if (code === 34) {\n value += body.slice(chunkStart, position);\n return new Token(TokenKind.STRING, start, position + 1, line, col, prev, value);\n } // SourceCharacter\n\n\n if (code < 0x0020 && code !== 0x0009) {\n throw syntaxError(source, position, \"Invalid character within String: \".concat(printCharCode(code), \".\"));\n }\n\n ++position;\n\n if (code === 92) {\n // \\\n value += body.slice(chunkStart, position - 1);\n code = body.charCodeAt(position);\n\n switch (code) {\n case 34:\n value += '\"';\n break;\n\n case 47:\n value += '/';\n break;\n\n case 92:\n value += '\\\\';\n break;\n\n case 98:\n value += '\\b';\n break;\n\n case 102:\n value += '\\f';\n break;\n\n case 110:\n value += '\\n';\n break;\n\n case 114:\n value += '\\r';\n break;\n\n case 116:\n value += '\\t';\n break;\n\n case 117:\n {\n // uXXXX\n var charCode = uniCharCode(body.charCodeAt(position + 1), body.charCodeAt(position + 2), body.charCodeAt(position + 3), body.charCodeAt(position + 4));\n\n if (charCode < 0) {\n var invalidSequence = body.slice(position + 1, position + 5);\n throw syntaxError(source, position, \"Invalid character escape sequence: \\\\u\".concat(invalidSequence, \".\"));\n }\n\n value += String.fromCharCode(charCode);\n position += 4;\n break;\n }\n\n default:\n throw syntaxError(source, position, \"Invalid character escape sequence: \\\\\".concat(String.fromCharCode(code), \".\"));\n }\n\n ++position;\n chunkStart = position;\n }\n }\n\n throw syntaxError(source, position, 'Unterminated string.');\n}\n/**\n * Reads a block string token from the source file.\n *\n * \"\"\"(\"?\"?(\\\\\"\"\"|\\\\(?!=\"\"\")|[^\"\\\\]))*\"\"\"\n */\n\n\nfunction readBlockString(source, start, line, col, prev, lexer) {\n var body = source.body;\n var position = start + 3;\n var chunkStart = position;\n var code = 0;\n var rawValue = '';\n\n while (position < body.length && !isNaN(code = body.charCodeAt(position))) {\n // Closing Triple-Quote (\"\"\")\n if (code === 34 && body.charCodeAt(position + 1) === 34 && body.charCodeAt(position + 2) === 34) {\n rawValue += body.slice(chunkStart, position);\n return new Token(TokenKind.BLOCK_STRING, start, position + 3, line, col, prev, dedentBlockStringValue(rawValue));\n } // SourceCharacter\n\n\n if (code < 0x0020 && code !== 0x0009 && code !== 0x000a && code !== 0x000d) {\n throw syntaxError(source, position, \"Invalid character within String: \".concat(printCharCode(code), \".\"));\n }\n\n if (code === 10) {\n // new line\n ++position;\n ++lexer.line;\n lexer.lineStart = position;\n } else if (code === 13) {\n // carriage return\n if (body.charCodeAt(position + 1) === 10) {\n position += 2;\n } else {\n ++position;\n }\n\n ++lexer.line;\n lexer.lineStart = position;\n } else if ( // Escape Triple-Quote (\\\"\"\")\n code === 92 && body.charCodeAt(position + 1) === 34 && body.charCodeAt(position + 2) === 34 && body.charCodeAt(position + 3) === 34) {\n rawValue += body.slice(chunkStart, position) + '\"\"\"';\n position += 4;\n chunkStart = position;\n } else {\n ++position;\n }\n }\n\n throw syntaxError(source, position, 'Unterminated string.');\n}\n/**\n * Converts four hexadecimal chars to the integer that the\n * string represents. For example, uniCharCode('0','0','0','f')\n * will return 15, and uniCharCode('0','0','f','f') returns 255.\n *\n * Returns a negative number on error, if a char was invalid.\n *\n * This is implemented by noting that char2hex() returns -1 on error,\n * which means the result of ORing the char2hex() will also be negative.\n */\n\n\nfunction uniCharCode(a, b, c, d) {\n return char2hex(a) << 12 | char2hex(b) << 8 | char2hex(c) << 4 | char2hex(d);\n}\n/**\n * Converts a hex character to its integer value.\n * '0' becomes 0, '9' becomes 9\n * 'A' becomes 10, 'F' becomes 15\n * 'a' becomes 10, 'f' becomes 15\n *\n * Returns -1 on error.\n */\n\n\nfunction char2hex(a) {\n return a >= 48 && a <= 57 ? a - 48 // 0-9\n : a >= 65 && a <= 70 ? a - 55 // A-F\n : a >= 97 && a <= 102 ? a - 87 // a-f\n : -1;\n}\n/**\n * Reads an alphanumeric + underscore name from the source.\n *\n * [_A-Za-z][_0-9A-Za-z]*\n */\n\n\nfunction readName(source, start, line, col, prev) {\n var body = source.body;\n var bodyLength = body.length;\n var position = start + 1;\n var code = 0;\n\n while (position !== bodyLength && !isNaN(code = body.charCodeAt(position)) && (code === 95 || // _\n code >= 48 && code <= 57 || // 0-9\n code >= 65 && code <= 90 || // A-Z\n code >= 97 && code <= 122) // a-z\n ) {\n ++position;\n }\n\n return new Token(TokenKind.NAME, start, position, line, col, prev, body.slice(start, position));\n} // _ A-Z a-z\n\n\nfunction isNameStart(code) {\n return code === 95 || code >= 65 && code <= 90 || code >= 97 && code <= 122;\n}\n","/**\n * Produces the value of a block string from its parsed raw value, similar to\n * CoffeeScript's block string, Python's docstring trim or Ruby's strip_heredoc.\n *\n * This implements the GraphQL spec's BlockStringValue() static algorithm.\n *\n * @internal\n */\nexport function dedentBlockStringValue(rawString) {\n // Expand a block string's raw value into independent lines.\n var lines = rawString.split(/\\r\\n|[\\n\\r]/g); // Remove common indentation from all lines but first.\n\n var commonIndent = getBlockStringIndentation(rawString);\n\n if (commonIndent !== 0) {\n for (var i = 1; i < lines.length; i++) {\n lines[i] = lines[i].slice(commonIndent);\n }\n } // Remove leading and trailing blank lines.\n\n\n var startLine = 0;\n\n while (startLine < lines.length && isBlank(lines[startLine])) {\n ++startLine;\n }\n\n var endLine = lines.length;\n\n while (endLine > startLine && isBlank(lines[endLine - 1])) {\n --endLine;\n } // Return a string of the lines joined with U+000A.\n\n\n return lines.slice(startLine, endLine).join('\\n');\n}\n\nfunction isBlank(str) {\n for (var i = 0; i < str.length; ++i) {\n if (str[i] !== ' ' && str[i] !== '\\t') {\n return false;\n }\n }\n\n return true;\n}\n/**\n * @internal\n */\n\n\nexport function getBlockStringIndentation(value) {\n var _commonIndent;\n\n var isFirstLine = true;\n var isEmptyLine = true;\n var indent = 0;\n var commonIndent = null;\n\n for (var i = 0; i < value.length; ++i) {\n switch (value.charCodeAt(i)) {\n case 13:\n // \\r\n if (value.charCodeAt(i + 1) === 10) {\n ++i; // skip \\r\\n as one symbol\n }\n\n // falls through\n\n case 10:\n // \\n\n isFirstLine = false;\n isEmptyLine = true;\n indent = 0;\n break;\n\n case 9: // \\t\n\n case 32:\n // <space>\n ++indent;\n break;\n\n default:\n if (isEmptyLine && !isFirstLine && (commonIndent === null || indent < commonIndent)) {\n commonIndent = indent;\n }\n\n isEmptyLine = false;\n }\n }\n\n return (_commonIndent = commonIndent) !== null && _commonIndent !== void 0 ? _commonIndent : 0;\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) {\n var indentation = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n var preferMultipleLines = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n var isSingleLine = value.indexOf('\\n') === -1;\n var hasLeadingSpace = value[0] === ' ' || value[0] === '\\t';\n var hasTrailingQuote = value[value.length - 1] === '\"';\n var hasTrailingSlash = value[value.length - 1] === '\\\\';\n var printAsMultipleLines = !isSingleLine || hasTrailingQuote || hasTrailingSlash || preferMultipleLines;\n var result = ''; // Format a multi-line block quote to account for leading space.\n\n if (printAsMultipleLines && !(isSingleLine && hasLeadingSpace)) {\n result += '\\n' + indentation;\n }\n\n result += indentation ? value.replace(/\\n/g, '\\n' + indentation) : value;\n\n if (printAsMultipleLines) {\n result += '\\n';\n }\n\n return '\"\"\"' + result.replace(/\"\"\"/g, '\\\\\"\"\"') + '\"\"\"';\n}\n","export { Source } from \"./source.mjs\";\nexport { getLocation } from \"./location.mjs\";\nexport { printLocation, printSourceLocation } from \"./printLocation.mjs\";\nexport { Kind } from \"./kinds.mjs\";\nexport { TokenKind } from \"./tokenKind.mjs\";\nexport { Lexer } from \"./lexer.mjs\";\nexport { parse, parseValue, parseType } from \"./parser.mjs\";\nexport { print } from \"./printer.mjs\";\nexport { visit, visitInParallel, getVisitFn, BREAK } from \"./visitor.mjs\";\nexport { Location, Token } from \"./ast.mjs\";\nexport { isDefinitionNode, isExecutableDefinitionNode, isSelectionNode, isValueNode, isTypeNode, isTypeSystemDefinitionNode, isTypeDefinitionNode, isTypeSystemExtensionNode, isTypeExtensionNode } from \"./predicates.mjs\";\nexport { DirectiveLocation } from \"./directiveLocation.mjs\";\n","export * from \"./Form\";\nexport * from \"./FormContainer\";\nexport * from \"./FormContext\";\n","/*\n\nFormContainer aka SmartForm\n\nChanges compared to Vulcan Meteor:\n\n- previously was named FormWrapper\n- accepts a model instead of collection\n- no queryFragmentName (resp. mutation name), instead you need to pass the fragment explicitely\n\nTechnically, this is a GraphqlSmartForm, while Form.tsx is the more\ngeneric SmartForm, or a \"ModelForm\".\n\n\n---\n\nGenerate the appropriate fragment for the current form, then\nwrap the main Form component with the necessary HoCs while passing\nthem the fragment.\n\nThis component is itself wrapped with:\n\n- withCurrentUser\n- withApollo (used to access the Apollo client for form pre-population)\n\nAnd wraps the Form component with:\n\n- withNew\n\nOr:\n\n- withSingle\n- withUpdate\n- withDelete\n\n(When wrapping with withSingle, withUpdate, and withDelete, a special Loader\ncomponent is also added to wait for withSingle's loading prop to be false)\n\n*/\nimport React, { useRef } from \"react\";\n// import // withCurrentUser,\n// Utils,\n// getFragment,\n//\"meteor/vulcan:core\";\nimport { DocumentNode } from \"@apollo/client\";\nimport gql from \"graphql-tag\";\n\nimport getFormFragments from \"../utils/formFragments\";\n// import { VulcanModel } from \"@vulcanjs/model\";\nimport { VulcanGraphqlModel, getFragmentName } from \"@vulcanjs/graphql\";\nimport type {\n CreateVariables,\n UpdateVariables,\n DeleteVariables,\n} from \"@vulcanjs/crud\";\nimport { capitalize } from \"@vulcanjs/utils\";\nimport {\n useSingle,\n useCreate,\n useUpdate,\n useDelete,\n UseSingleOptions,\n} from \"@vulcanjs/react-hooks\";\nimport { FetchResult } from \"@apollo/client\";\n// import { FormType } from \"./typings\";\nimport { debugVulcan } from \"@vulcanjs/utils\";\nimport { VulcanUser } from \"@vulcanjs/permissions\";\nimport { PassedDownFormProps } from \"./Form/typings\";\nimport { useVulcanComponents } from \"../../VulcanComponents\";\nimport { useVulcanCurrentUser } from \"../../VulcanCurrentUser\";\nconst debugForm = debugVulcan(\"form\");\n\n// Mutation that yield a success result\ntype SuccessfulFetchResult<TData = Object> = FetchResult<TData> & {\n data: TData;\n};\n/**\n * Typeguared to allow considering the request as successful\n */\nconst isSuccessful = function <T = any>(\n result: FetchResult<T> | undefined\n): result is SuccessfulFetchResult<T> {\n return !!result?.data;\n};\n\nexport interface FormContainerProps extends PassedDownFormProps {\n model: VulcanGraphqlModel;\n /** Document id for edition mode, will automatically fetch the document */\n documentId?: string;\n /** Slug (= human readable unique id) for edition mode, will automatically fetch the document */\n slug?: string;\n /**\n * List only those fields in the form\n */\n fields?: Array<string>;\n /**\n * List default fields + those additional fields as well\n */\n addFields?: Array<string>;\n /**\n * Force a currentUser, overriding the currentUser obtained\n * via Context\n *\n * If you use many forms in your app,\n * it might be better to set VulcanCurrentUserContext\n * at the top-level of your app\n * (eg in \"pages/_app.js\" for Next.js)\n */\n currentUser?: VulcanUser | null;\n loadingCurrentUser?: boolean;\n}\nexport type SmartFormProps = FormContainerProps;\n\nconst useFragments = (\n props: Pick<\n FormContainerProps,\n | \"mutationFragment\"\n | \"mutationFragmentName\"\n | \"queryFragment\"\n | \"queryFragmentName\"\n // for auto generation\n | \"model\"\n | \"fields\"\n | \"addFields\"\n >,\n formType: \"edit\" | \"new\"\n) => {\n // get fragment used to decide what data to load from the server to populate the form,\n // as well as what data to ask for as return value for the mutation\n // TODO: move out of the component\n //const getFragments = () => {\n let queryFragment: DocumentNode | undefined;\n let queryFragmentName: string | undefined;\n let mutationFragment: DocumentNode | undefined;\n let mutationFragmentName: string | undefined;\n\n // if queryFragment or mutationFragment props are specified, accept either fragment object or fragment string\n // TODO: not sure we actually need that, gApollo accepts fragments or string normally\n if (props.queryFragment) {\n if (typeof props.queryFragment === \"string\") {\n queryFragment = gql`\n ${props.queryFragment}\n `;\n if (!props.queryFragmentName)\n throw new Error(\n \"When using a string queryFragment, queryFragmentName is mandatory\"\n );\n queryFragmentName = props.queryFragmentName;\n } else {\n // DocumentNode\n queryFragment = props.queryFragment;\n // automatically compute the fragment name\n queryFragmentName =\n props.queryFragmentName || getFragmentName(props.queryFragment);\n }\n }\n if (props.mutationFragment) {\n if (typeof props.mutationFragment === \"string\") {\n mutationFragment = gql`\n ${props.mutationFragment}\n `;\n if (!props.mutationFragmentName)\n throw new Error(\n \"When using a string mutationFragment, mutationFragmentName is mandatory\"\n );\n queryFragmentName = props.mutationFragmentName;\n } else {\n // DocumentNode\n mutationFragment = props.mutationFragment;\n // automatically compute the fragment name\n mutationFragmentName =\n props.mutationFragmentName || getFragmentName(props.mutationFragment);\n }\n }\n // auto generate fragments\n let autoFormFragments;\n if (!props.queryFragment || !props.mutationFragment) {\n const { model, fields, addFields } = props;\n // autogenerated fragments\n autoFormFragments = getFormFragments({\n formType,\n model,\n fields,\n addFields,\n });\n }\n // use autogenerated value if necessary\n if (!props.queryFragment) {\n queryFragment = autoFormFragments.queryFragment;\n queryFragmentName = autoFormFragments.queryFragmentName;\n }\n if (!props.mutationFragment) {\n mutationFragment = autoFormFragments.mutationFragment;\n mutationFragmentName = autoFormFragments.mutationFragmentName;\n }\n return {\n mutationFragment: mutationFragment as DocumentNode,\n mutationFragmentName: mutationFragmentName as string,\n queryFragment: queryFragment as DocumentNode,\n queryFragmentName: queryFragmentName as string,\n };\n};\n// Fonctionnal version to be able to use hooks\nexport const FormContainer = (props: FormContainerProps) => {\n const {\n model,\n documentId,\n slug,\n fields,\n addFields,\n currentUser: currentUserFromProps,\n loadingCurrentUser: loadingCurrentUserFromProps,\n } = props;\n const { schema } = model;\n // if a document is being passed, this is an edit form\n const isEdit = documentId || slug;\n const selector = {\n documentId,\n slug,\n };\n const formType = isEdit ? \"edit\" : \"new\";\n const VulcanComponents = useVulcanComponents();\n\n // get query & mutation fragments from props or else default to same as generatedFragment\n //return {\n // queryFragment,\n // mutationFragment,\n //};\n //}\n\n const prefix = `${model.name}${capitalize(formType)}`;\n // props to pass on to child component (i.e. <Form />)\n const childProps = {\n formType,\n schema,\n };\n\n const {\n mutationFragment,\n mutationFragmentName,\n queryFragment,\n queryFragmentName,\n } = useFragments(props, formType);\n\n // options for useCreate, useUpdate and useDelete\n const mutationOptions = {\n model,\n // collection: this.props.collection,\n fragment: mutationFragment,\n fragmentName: mutationFragmentName,\n };\n\n const queryOptions: UseSingleOptions<any> = {\n model,\n // TODO: what this option does?\n // queryName: `${prefix}FormQuery`,\n fragment: queryFragment,\n fragmentName: queryFragmentName,\n // fragmentName?\n input: {\n id: documentId,\n enableCache: false,\n // TODO: support slug\n },\n queryOptions: {\n // we always want to load a fresh copy of the document\n fetchPolicy: \"network-only\" as \"network-only\", // cast is for fixing annoying TS issue... https://github.com/vuejs/vue-apollo/issues/936\n pollInterval: 0, // no polling, only load data once\n skip: formType === \"new\",\n },\n };\n /* debug\n console.log(\n \"MUT\",\n (mutationFragment as any).loc.source.body,\n mutationFragmentName\n );\n console.log(\n \"QUERY\",\n (queryFragment as any).loc.source.body,\n queryFragmentName\n );*/\n const { data, document, loading, refetch } = useSingle(queryOptions);\n if (formType !== \"new\") {\n debugForm(\n \"useSingle result\",\n \"data\",\n data,\n \"document\",\n document,\n \"loading\",\n loading\n );\n }\n // TODO: pass the creation functions down to the Form\n const [createDocument] = useCreate(mutationOptions);\n const [updateDocument] = useUpdate(mutationOptions);\n const [deleteDocument] = useDelete(mutationOptions);\n\n const {\n currentUser: currentUserFromContext,\n loading: loadingCurrentUserFromContext,\n } = useVulcanCurrentUser();\n const shouldGetCurrentUserFromProps =\n typeof currentUserFromProps !== \"undefined\";\n const currentUser = shouldGetCurrentUserFromProps\n ? currentUserFromProps\n : currentUserFromContext;\n const loadingCurrentUser = shouldGetCurrentUserFromProps\n ? loadingCurrentUserFromProps\n : loadingCurrentUserFromContext;\n\n // callbacks\n /*\n const formRef = useRef(null);\n const newMutationSuccessCallback = function <TData = Object>(\n result: SuccessfulFetchResult<TData>\n ) {\n getDocumentFromResult(result, \"new\");\n };\n const editMutationSuccessCallback = function <TData = Object>(\n result: SuccessfulFetchResult<TData>\n ) {\n getDocumentFromResult(result, \"edit\");\n };\n */\n\n /*\n The create hook already creates a document prop in a more stable way\n const getDocumentFromResult = function <TData = Object>(\n // must be called only on valid results\n result: SuccessfulFetchResult<TData> | undefined\n ) {\n if (!result) return undefined;\n // TODO: quite risky... we should have a better way to get the document\n let document = result.data[Object.keys(result.data)[0]].data; // document is always on first property\n\n return document;\n };*/\n // for new mutation, run refetch function if it exists\n /*\n if (mutationType === \"new\" && refetch) refetch();\n */\n\n const createAndReturnDocument = async (variables: CreateVariables) => {\n const result = await createDocument(variables);\n const { errors, document } = result;\n return {\n document,\n errors,\n };\n };\n const updateAndReturnDocument = async (variables: UpdateVariables) => {\n const result = await updateDocument(variables);\n const { errors, document } = result;\n return {\n document,\n errors,\n };\n };\n\n const deleteDocumentAndRefetch = async (variables: DeleteVariables) => {\n await deleteDocument(variables as any);\n };\n\n if (isEdit && loading) {\n return <VulcanComponents.Loading />;\n }\n return (\n <VulcanComponents.Form\n document={document}\n loading={loading || loadingCurrentUser}\n createDocument={createAndReturnDocument /*createDocument*/}\n updateDocument={updateAndReturnDocument}\n deleteDocument={deleteDocumentAndRefetch}\n refetch={refetch}\n currentUser={currentUser}\n {...childProps}\n {...props}\n />\n );\n};\n\n/*\nFormContainer.propTypes = {\n // main options\n documentId: PropTypes.string, // if a document is passed, this will be an edit form\n mutationFragment: PropTypes.object,\n mutationFragmentName: PropTypes.string,\n\n // graphQL\n // createFoo, deleteFoo, updateFoo\n // newMutation: PropTypes.func, // the new mutation\n // editMutation: PropTypes.func, // the edit mutation\n // removeMutation: PropTypes.func, // the remove mutation\n\n // form\n prefilledProps: PropTypes.object,\n layout: PropTypes.string,\n fields: PropTypes.arrayOf(PropTypes.string),\n hideFields: PropTypes.arrayOf(PropTypes.string),\n addFields: PropTypes.arrayOf(PropTypes.string),\n showRemove: PropTypes.bool,\n submitLabel: PropTypes.node,\n cancelLabel: PropTypes.node,\n revertLabel: PropTypes.node,\n repeatErrors: PropTypes.bool,\n warnUnsavedChanges: PropTypes.bool,\n formComponents: PropTypes.object,\n disabled: PropTypes.bool,\n itemProperties: PropTypes.object,\n successComponent: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),\n contextName: PropTypes.string,\n\n // callbacks\n ...callbackProps,\n\n currentUser: PropTypes.object,\n client: PropTypes.object,\n};\n\nFormContainer.defaultProps = {\n layout: \"horizontal\",\n};\n*/\n\n/*\nregisterComponent({\n name: 'SmartForm',\n component: FormContainer,\n hocs: [withCurrentUser, withApollo, withRouter, withCollectionProps],\n});\n*/\n\nexport const SmartForm = FormContainer;\n\nexport default FormContainer;\n","/**\n * Generate mutation and query fragments for a form based on the schema\n * TODO: refactor to mutualize more code with vulcan-core defaultFragment functions\n * TODO: move to lib when refactored\n */\nimport _uniq from \"lodash/uniq.js\";\nimport _intersection from \"lodash/intersection.js\";\nimport gql from \"graphql-tag\";\nimport {\n getCreateableFields,\n getUpdateableFields,\n getFragmentFieldNames,\n //isBlackbox,\n} from \"@vulcanjs/schema\";\nimport {\n getFieldFragment,\n VulcanGraphqlModel,\n //isBlackbox,\n} from \"@vulcanjs/graphql\";\nimport { capitalize } from \"@vulcanjs/utils\";\nimport type { FormType } from \"../typings\";\nimport compact from \"lodash/compact.js\";\n// getFieldFragment,\nconst intlSuffix = \"_intl\";\n\n// PostsEditFormQueryFragment/PostsNewFormMutationFragment/etc.\nconst getFragmentName = (\n formType: FormType,\n multiTypeName: string,\n fragmentType: \"mutation\" | \"query\"\n) =>\n [multiTypeName, formType, \"form\", fragmentType, \"fragment\"]\n .map(capitalize)\n .join(\"\");\n\n// get modifiable fields in the query either for update or create operations\nconst getQueryFieldNames = ({ schema, options }) => {\n const queryFields =\n options.formType === \"new\"\n ? getCreateableFields(schema)\n : getUpdateableFields(schema);\n return queryFields;\n};\n// add readable fields to mutation fields\nconst getMutationFieldNames = ({ readableFieldNames, queryFieldNames }) => {\n return _uniq(queryFieldNames.concat(readableFieldNames));\n};\n\n/*\nconst getFieldFragment = ({ schema, fieldName, options }) => {\n let fieldFragment = fieldName;\n const field = schema[fieldName];\n if (!(field && field.type)) return fieldName;\n const fieldType = field.type.singleType;\n const fieldTypeName =\n typeof fieldType === 'object'\n ? 'Object'\n : typeof fieldType === 'function'\n ? fieldType.name\n : fieldType;\n\n if (fieldName.slice(-5) === intlSuffix) {\n fieldFragment = `${fieldName}{ locale value }`;\n } else {\n switch (fieldTypeName) {\n // recursive call for nested arrays and objects\n case 'Object':\n if (!isBlackbox(field) && fieldType._schema) {\n fieldFragment =\n getSchemaFragment({\n fragmentName: fieldName,\n schema: fieldType._schema,\n options,\n }) || null;\n }\n break;\n case 'Array':\n const arrayItemFieldName = `${fieldName}.$`;\n const arrayItemField = schema[arrayItemFieldName];\n // note: make sure field has an associated array item field\n if (arrayItemField) {\n // child will either be native value or a an object (first case)\n const arrayItemFieldType = arrayItemField.type.singleType;\n if (!arrayItemField.blackbox && arrayItemFieldType._schema) {\n fieldFragment =\n getSchemaFragment({\n fragmentName: fieldName,\n schema: arrayItemFieldType._schema,\n options,\n }) || null;\n }\n }\n break;\n default:\n // handle intl or return fieldName\n fieldFragment = fieldName;\n break;\n }\n }\n return fieldFragment;\n};\n*/\n\n// get fragment for a whole schema (root schema or nested schema of an object or an array)\nconst getSchemaFragment = ({\n schema,\n fragmentName,\n options,\n fieldNames: providedFieldNames,\n}) => {\n // differentiate mutation/query and create/update cases\n // respect provided fieldNames if any (needed for the root schema)\n const fieldNames =\n providedFieldNames ||\n (options.isMutation\n ? getMutationFieldNames({\n queryFieldNames: getQueryFieldNames({ schema, options }),\n readableFieldNames: getFragmentFieldNames({\n schema,\n options: { onlyViewable: true },\n }),\n })\n : getQueryFieldNames({ schema, options }));\n\n const childFragments =\n fieldNames.length &&\n fieldNames\n .map((fieldName) =>\n getFieldFragment({\n schema,\n fieldName,\n options,\n getObjectFragment: getSchemaFragment, // allow to reuse the code from defaultFragment with another behaviour\n })\n )\n // remove empty values\n .filter((f) => !!f);\n if (childFragments.length) {\n return `${fragmentName} { ${childFragments.join(\"\\n\")} }`;\n }\n return null;\n};\n\n/**\n * Generate query and mutation fragments for forms, dynamically based on the selected fields\n */\nconst getFormFragments = ({\n formType = \"new\",\n model,\n fields, // restrict on certain fields\n addFields, // add additional fields (eg to display static fields)\n}: {\n model: VulcanGraphqlModel;\n formType: FormType;\n fields?: Array<string>; // restrict on certain fields\n addFields?: Array<string>; // add additional fields (eg to display static fields)\n}) => {\n const { schema, name, graphql } = model;\n const { typeName, multiTypeName } = graphql;\n // get the root schema fieldNames\n let queryFieldNames = getQueryFieldNames({ schema, options: { formType } });\n let mutationFieldNames = getMutationFieldNames({\n queryFieldNames,\n readableFieldNames: getFragmentFieldNames({\n schema,\n options: { onlyViewable: true },\n }),\n });\n\n // if \"fields\" prop is specified, restrict list of fields to it\n if (fields && fields?.length > 0) {\n // add \"_intl\" suffix to all fields in case some of them are intl fields\n const fieldsWithIntlSuffix = fields.map((field) => `${field}${intlSuffix}`);\n const allFields = [...fields, ...fieldsWithIntlSuffix];\n queryFieldNames = _intersection(queryFieldNames, allFields);\n mutationFieldNames = _intersection(mutationFieldNames, allFields);\n }\n\n // add \"addFields\" prop contents to list of fields\n if (addFields?.length) {\n queryFieldNames = queryFieldNames.concat(addFields);\n mutationFieldNames = mutationFieldNames.concat(addFields);\n }\n\n // userId is used to check for permissions, so add it to fragments if possible\n if (schema.userId) {\n queryFieldNames.unshift(\"userId\");\n mutationFieldNames.unshift(\"userId\");\n }\n\n if (schema._id) {\n queryFieldNames.unshift(\"_id\");\n mutationFieldNames.unshift(\"_id\");\n }\n\n // check unicity (_id can be added twice)\n queryFieldNames = _uniq(queryFieldNames);\n mutationFieldNames = _uniq(mutationFieldNames);\n\n if (queryFieldNames.length === 0)\n // NOTE: in theory, you could have no queriable fields, but mutable fields =>\n // a form for data that you can create but can never see...\n // Since that doesn't make much sense, we throw an error to secure the end user\n throw new Error(\n `Model \"${model.name}\" has no queryable fields, cannot create a form for it. Please add readable/createable/updateable fields to the model schema.`\n );\n if (mutationFieldNames.length === 0)\n throw new Error(\n `Model \"${model.name}\" has no mutable fields, cannot create a form for it. Please add createable/updateable fields to model schema.`\n );\n\n const queryFragmentName = getFragmentName(\n formType,\n multiTypeName, // previously collectionName //name,\n \"query\"\n );\n // generate query fragment based on the fields that can be edited. Note: always add _id, and userId if possible.\n // TODO: support nesting\n const queryFragmentText = getSchemaFragment({\n schema,\n fragmentName: `fragment ${queryFragmentName} on ${typeName}`,\n options: { formType, isMutation: false },\n fieldNames: queryFieldNames,\n });\n if (!queryFragmentText) {\n // NOTE: this should never happen if we don't have an empty array for field names\n throw new Error(\n `Model ${model.name} with fields ${queryFieldNames} yield an empty query fragment.`\n );\n }\n const generatedQueryFragment = gql(queryFragmentText);\n\n const mutationFragmentName = getFragmentName(\n formType,\n multiTypeName, // previously collectionName,\n \"mutation\"\n );\n const mutationFragmentText = getSchemaFragment({\n schema,\n fragmentName: `fragment ${mutationFragmentName} on ${typeName}`,\n options: { formType, isMutation: true },\n fieldNames: mutationFieldNames,\n });\n if (!mutationFragmentText) {\n // NOTE: this should never happen if we don't have an empty array for field names\n throw new Error(\n `Model ${model.name} with fields ${mutationFieldNames} yield an empty mutation fragment.`\n );\n }\n // generate mutation fragment based on the fields that can be edited and/or viewed. Note: always add _id, and userId if possible.\n // TODO: support nesting\n const generatedMutationFragment = gql(mutationFragmentText);\n\n // if any field specifies extra queries, add them\n const extraQueries = compact(\n getQueryFieldNames({ schema, options: { formType } }).map((fieldName) => {\n const field = schema[fieldName];\n return field.query;\n })\n );\n // get query & mutation fragments from props or else default to same as generatedFragment\n return {\n queryFragment: generatedQueryFragment,\n mutationFragment: generatedMutationFragment,\n queryFragmentName,\n mutationFragmentName,\n extraQueries,\n };\n};\n\nexport default getFormFragments;\n","export * from \"./Consumer\";\nexport * from \"./Provider\";\n","import { useContext } from \"react\";\nimport { VulcanCurrentUserContext } from \"./Context\";\n\nexport const VulcanCurrentUserConsumer = VulcanCurrentUserContext.Consumer;\n\nexport const useVulcanCurrentUser = () => useContext(VulcanCurrentUserContext);\n","import React from \"react\";\nimport type { VulcanUser } from \"@vulcanjs/permissions\";\n\nexport type VulcanCurrentUserContextType =\n | { currentUser: VulcanUser | null; loading: false }\n | { loading: true; currentUser: any };\n// We need this to shut TypeScript up\n// You should use the Provider to get the right default values\nexport const VulcanCurrentUserContext =\n React.createContext<VulcanCurrentUserContextType>({\n currentUser: null,\n loading: false,\n });\n","/**\n * NOTE: KEEP SEPARATED FROM THE HOOKS TO CONSUME THE CONTEXT\n * otherwise you'll end up with circular dependencies because of the default components\n */\n// TODO: we might need to adapt the provider to merge its value with a potentially higher up context\nimport React from \"react\";\n\nimport {\n VulcanCurrentUserContext,\n VulcanCurrentUserContextType,\n} from \"./Context\";\n\n// So that you can override only some components by adding an additional context while keeping the defaults\nexport const VulcanCurrentUserProvider = ({\n value,\n ...props\n}: {\n value: VulcanCurrentUserContextType;\n children: React.ReactNode;\n}) => (\n <VulcanCurrentUserContext.Provider\n value={value} // merge provided components so the user can provide only a partial replacement\n {...props}\n />\n);\n","import type {\n CreateVariables,\n UpdateVariables,\n DeleteVariables,\n} from \"@vulcanjs/crud\";\nimport { VulcanModel } from \"@vulcanjs/model\";\nimport { VulcanUser } from \"@vulcanjs/permissions\";\nimport { VulcanSchema } from \"@vulcanjs/schema\";\nimport { DocumentNode } from \"graphql\";\n\nexport interface FormState {\n schema: any;\n initialDocument: Object;\n currentDocument: Object;\n deletedValues: any;\n errors: any;\n currentValues: any;\n disabled: any;\n success?: any;\n flatSchema: any;\n originalSchema: any;\n}\n\n/**\n * Props that can be passed to the FormContainer (= SmartForm)\n * and will be passed down to the Form\n *\n * TODO: this might not be complete yet. We need to move relevant props from \"FormProps\" to this type,\n * based on current usage of the SmartForm in existing apps\n */\nexport interface PassedDownFormProps {\n itemProperties?: Object;\n showDelete?: boolean;\n /**\n * Disable the form\n */\n disabled?: boolean;\n /**\n * Will prevent leaving the page/unmounting the form on unsaved changes\n */\n warnUnsavedChanges?: boolean;\n /*A callback called on form submission on the form data. Can return the submitted data object as well.*/\n submitCallback?: (data) => any;\n /*A callback called on mutation success.*/\n successCallback?: (document, meta: { form: any }) => void;\n /*A callback called on mutation failure.*/\n errorCallback?: (document, error, meta: { form: any }) => void;\n\n // Fragments\n /**\n * A GraphQL fragment used to specify the data to fetch to populate edit forms.\n * If no fragment is passed, SmartForm will do its best to figure out what data to load based on the fields included in the form.\n *\n * Can be either a string or a DocumentNode (using \"gql\" tag)\n */\n queryFragment?: DocumentNode | string;\n /**\n * A GraphQL fragment used to specify the data to return once a mutation is complete.\n\nIf no fragment is passed, SmartForm will only return fields used in the form, but note that this might sometimes lead to discrepancies when compared with documents already loaded on the client.\n\nAn example would be a createdAt date added automatically on creation even though it’s not part of the actual form. If you’d like that field to be returned after the mutation, you can define a custom mutationFragment that includes it explicitly.\n\n * Can be either a string or a DocumentNode (using \"gql\" tag)\n*/\n mutationFragment?: DocumentNode | string;\n /** Force a query fragment name\n *\n * NOTE: needed only for string fragments\n * If you use a DocumentNode (with \"gql\" tag), it will be computed automatically\n *\n * @deprecated Prefer using DocumentNode fragment, using the gql tag\n */\n queryFragmentName?: string;\n /** Force a mutation fragment name\n *\n *NOTE: needed only for string fragments\n *If you use a DocumentNode (with \"gql\" tag), it will be computed automatically\n *\n * @deprecated Prefer using DocumentNode fragment, using the gql tag\n */\n mutationFragmentName?: string;\n}\n\nexport interface FormProps<TModel = { [key in string]: any }>\n extends PassedDownFormProps {\n /**\n * Function that retriggers data fetching in edit mode\n * Usually provided by the useSingle but could be any function\n */\n refetch?: () => void;\n /**\n * Document id in update mode\n */\n id?: string;\n /* The model in which to edit or insert a document. */\n model: VulcanModel;\n /** Passing directly a raw schema (TODO: model is still mandatory atm) */\n schema?: VulcanSchema;\n /**\n * Passing directly a document (TODO: not yet tested in the new version)\n */\n document?: any;\n /**\n * currentUser to check authorizations to update/create some fields\n */\n currentUser?: VulcanUser;\n addFields?: Array<string>;\n removeFields?: Array<string>;\n // deprecated\n //hideFields?: any;\n /**\n * Label so that graphql queries are contextualized\n */\n contextName?: string;\n // labels\n cancelLabel?: string;\n revertLabel?: string;\n //\n revertCallback?: Function;\n // TODO: probably should be removed\n successComponent?: any;\n /* Instead of passing collection you can pass the name of the collection.*/\n // collectionName?: string;\n /*If present, the document to edit. If not present, the form will be a “new document” form.*/\n documentId?: string;\n /*An array of field names, if you want to restrict the form to a specific set of fields.*/\n fields?: Array<keyof TModel>;\n /*The text inside the submit button of the form.*/\n submitLabel?: string;\n /*A layout property used to control how the form fields are displayed. Defaults to horizontal.*/\n layout?: \"horizontal\" | \"vertical\";\n /*Whether to show a “delete document” link on edit forms.*/\n showRemove?: boolean;\n /*A set of props used to prefill the form. */\n prefilledProps?: TModel & Object; // TODO: should it allow only fields from the Model or also additional fields?\n /*Whether to repeat validation errors at the bottom of the form.*/\n repeatErrors?: boolean;\n //Callbacks\n /** Callback ran on first render */\n initCallback?: Function;\n /*If a cancelCallback function is provided, a “cancel” link will be shown next to the form’s submit button and the callback will be called on click.*/\n cancelCallback?: (document) => void;\n /*A callback to call when a document is successfully removed (deleted).*/\n removeSuccessCallback?: (document) => void;\n\n /*A callback called a every change or blur event inside the form.*/\n changeCallback: (currentDocument) => void;\n\n // mutations from container\n // => replace the \"onSubmit\" of a normal form\n /**\n * The result is usually extracted from a graphql mutation\n * But we have a simplified abstracted API, so we could also use the Form without graphql\n */\n createDocument: <TModel = any>(\n createVars: CreateVariables\n ) => Promise<CreateDocumentResult<TModel>>;\n updateDocument: <TModel = any>(\n vars: UpdateVariables\n ) => Promise<UpdateDocumentResult<TModel>>;\n deleteDocument: (vars: DeleteVariables) => Promise<void>;\n // Other results from the Apollo query => should be ignored, in order to avoid dependency to graphql in the Form\n // instead the container is responsible for passing errors and stuff\n // createDocumentMeta?: { error?: any };\n // updateDocumentMeta?: { error?: any };\n // EXPERIMENTAL: allowing to manually set the form children\n children?: React.ReactNode;\n}\n\nexport interface CreateDocumentResult<TDocument = any> {\n document: TDocument;\n errors: Array<any>;\n}\n\nexport interface UpdateDocumentResult<TDocument = any> {\n document: TDocument;\n errors: Array<any>;\n}\n","// import { compose } from \"recompose\";\nimport React from \"react\";\n\nexport const Components = {}; // will be populated on startup\nexport const ComponentsTable = {}; // storage for infos about components\n\nexport const coreComponents = [\n \"Alert\",\n \"Button\",\n \"Modal\",\n \"ModalTrigger\",\n \"Table\",\n \"FormComponentCheckbox\",\n \"FormComponentCheckboxGroup\",\n \"FormComponentDate\",\n \"FormComponentDate2\",\n \"FormComponentDateTime\",\n \"FormComponentDefault\",\n \"FormComponentText\",\n \"FormComponentEmail\",\n \"FormComponentNumber\",\n \"FormComponentRadioGroup\",\n \"FormComponentSelect\",\n \"FormComponentSelectMultiple\",\n \"FormComponentStaticText\",\n \"FormComponentTextarea\",\n \"FormComponentTime\",\n \"FormComponentUrl\",\n \"FormComponentInner\",\n \"FormControl\",\n \"FormElement\",\n];\n\n/**\n * Register a Vulcan component with a name, a raw component than can be extended\n * and one or more optional higher order components.\n *\n * @param {String} name The name of the component to register.\n * @param {Component} rawComponent Interchangeable/extendable react component.\n * @param {...(Function|Array)} hocs The HOCs to compose with the raw component.\n *\n * Note: when a component is registered without higher order component, `hocs` will be\n * an empty array, and it's ok!\n * See https://github.com/reactjs/redux/blob/master/src/compose.js#L13-L15\n *\n * @returns Structure of a component in the list:\n *\n * ComponentsTable.Foo = {\n * name: 'Foo',\n * hocs: [fn1, fn2],\n * rawComponent: React.Component,\n * call: () => compose(...hocs)(rawComponent),\n * }\n *\n */\n/*\nexport function registerComponent(name, rawComponent, ...hocs) {\n // support single-argument syntax\n if (typeof arguments[0] === \"object\") {\n // note: cannot use `const` because name, components, hocs are already defined\n // as arguments so destructuring cannot work\n // eslint-disable-next-line no-redeclare\n var {\n name,\n component,\n // @ts-ignore\n hocs = [],\n } = arguments[0];\n rawComponent = component;\n }\n // store the component in the table\n ComponentsTable[name] = {\n name,\n rawComponent,\n hocs,\n };\n}\n*/\n\n/**\n * Returns true if a component with the given name has been registered with\n * registerComponent(name, component, ...hocs).\n *\n * @param {String} name The name of the component to get.\n * @returns {Boolean}\n */\nexport const componentExists = (name) => {\n const component = ComponentsTable[name];\n return !!component;\n};\n\n/**\n * Get a component registered with registerComponent(name, component, ...hocs).\n *\n * @param {String} name The name of the component to get.\n * @returns {Function|React Component} A (wrapped) React component\n */\n/*\nexport const getComponent = (name) => {\n const component = ComponentsTable[name];\n if (!component) {\n throw new Error(`Component ${name} not registered.`);\n }\n if (component.hocs && component.hocs.length) {\n const hocs = component.hocs.map((hoc) => {\n if (!Array.isArray(hoc)) {\n if (typeof hoc !== \"function\") {\n throw new Error(\n `In registered component ${name}, an hoc is of type ${typeof hoc}`\n );\n }\n return hoc;\n }\n const [actualHoc, ...args] = hoc;\n if (typeof actualHoc !== \"function\") {\n throw new Error(\n `In registered component ${name}, an hoc is of type ${typeof actualHoc}`\n );\n }\n return actualHoc(...args);\n });\n return compose(...hocs)(component.rawComponent);\n } else {\n return component.rawComponent;\n }\n};\n*/\n\n/**\n * Populate the lookup table for components to be callable\n * ℹ️ Called once on app startup\n **/\n/*\nexport const populateComponentsApp = () => {\n const registeredComponents = Object.keys(ComponentsTable);\n\n // loop over each component in the list\n registeredComponents.map((name) => {\n // populate an entry in the lookup table\n Components[name] = getComponent(name);\n\n // uncomment for debug\n // console.log('init component:', name);\n });\n\n const missingComponents = difference(coreComponents, registeredComponents);\n\n if (missingComponents.length) {\n // eslint-disable-next-line no-console\n console.warn(\n `Found the following missing core components: ${missingComponents.join(\n \", \"\n )}. Include a UI package such as vulcan:ui-bootstrap to add them.`\n );\n }\n};\n*/\n/**\n * Get the **raw** (original) component registered with registerComponent\n * without the possible HOCs wrapping it.\n *\n * @param {String} name The name of the component to get.\n * @returns {Function|React Component} An interchangeable/extendable React component\n */\nexport const getRawComponent = (name) => {\n return ComponentsTable[name].rawComponent;\n};\n\n/**\n * Replace a Vulcan component with the same name with a new component or\n * an extension of the raw component and one or more optional higher order components.\n * This function keeps track of the previous HOCs and wrap the new HOCs around previous ones\n *\n * @param {String} name The name of the component to register.\n * @param {React Component} newComponent Interchangeable/extendable component.\n * @param {...Function} newHocs The HOCs to compose with the raw component.\n * @returns {Function|React Component} A component callable with Components[name]\n *\n * Note: when a component is registered without higher order component, `hocs` will be\n * an empty array, and it's ok!\n * See https://github.com/reactjs/redux/blob/master/src/compose.js#L13-L15\n */\n/*\nexport function replaceComponent(name, newComponent, ...newHocs) {\n // support single argument syntax\n if (typeof arguments[0] === \"object\") {\n // eslint-disable-next-line no-redeclare\n var { name, component, hocs = [] } = arguments[0];\n newComponent = component;\n newHocs = hocs;\n }\n\n const previousComponent = ComponentsTable[name];\n const previousHocs = (previousComponent && previousComponent.hocs) || [];\n\n if (!previousComponent) {\n // eslint-disable-next-line no-console\n console.warn(\n `Trying to replace non-registered component ${name}. The component is ` +\n \"being registered. If you were trying to replace a component defined by \" +\n \"another package, make sure that you haven't misspelled the name. Check \" +\n \"also if the original component is still being registered or that it \" +\n \"hasn't been renamed.\"\n );\n }\n\n return registerComponent(name, newComponent, ...newHocs, ...previousHocs);\n}\n*/\n\n/*\nexport const copyHoCs = (sourceComponent, targetComponent) => {\n return compose(...sourceComponent.hocs)(targetComponent);\n};\n*/\n\n/**\n * Returns an instance of the given component name of function\n * @param {string|function} component A component, the name of a component, or a react element\n * @param {Object} [props] Optional properties to pass to the component\n */\n//eslint-disable-next-line react/display-name\n// legacy\nexport const instantiateComponent = (\n component?: React.ComponentType | Function | any,\n props?: any\n) => {\n if (!component) {\n return null;\n } /*else if (typeof component === \"string\") {\n const Component = Components[component];\n return <Component {...props} />;\n } */ else if (React.isValidElement(component)) {\n return React.cloneElement(component, props);\n } else if (\n typeof component === \"function\" &&\n component.prototype &&\n component.prototype.isReactComponent\n ) {\n const Component = component as React.ComponentType<any>;\n return <Component {...props} />;\n } else if (typeof component === \"function\") {\n return component(props);\n } else if (\n typeof component === \"object\" &&\n component.$$typeof &&\n component.render\n ) {\n const Component = component as React.ComponentType<any>;\n return <Component {...props} />;\n } else {\n return component;\n }\n};\n\n/**\n * Creates a component that will render the registered component with the given name.\n *\n * This function may be useful when in need for some registered component, but in contexts\n * where they have not yet been initialized, for example at compile time execution. In other\n * words, when using `Components.ComponentName` is not allowed (because it has not yet been\n * populated, hence would be `undefined`), then `delayedComponent('ComponentName')` can be\n * used instead.\n *\n * @example Create a container for a registered component\n * // SomeContainer.js\n * import compose from 'recompose/compose';\n * import { delayedComponent } from 'meteor/vulcan:core';\n *\n * export default compose(\n * // ...some hocs with container logic\n * )(delayedComponent('ComponentName')); // cannot use Components.ComponentName in this context!\n *\n * @example {@link dynamicLoader}\n * @param {String} name Component name\n * @return {Function}\n * Functional component that will render the given registered component\n */\nexport const delayedComponent = (name) => {\n return (props) => {\n const Component = Components[name] || null;\n return Component && <Component {...props} />;\n };\n};\n\n// Example with Proxy (might be unstable/hard to reason about)\n//const mergeWithComponents = (myComponents = {}) => {\n// const handler = {\n// get: function(target, name) {\n// return name in target ? target[name] : Components[name];\n// }\n// };\n// const proxy = new Proxy(myComponents, handler);\n// return proxy;\n//};\nexport const mergeWithComponents = (myComponents) =>\n myComponents ? { ...Components, ...myComponents } : Components;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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OAAO;AAC3B,MAAI,CAAC,oBAAoB,WAAW;AAAG,WAAO;AAC9C,QAAM,eAAe,eAAe,cAAc,WAAW;AAC7D,SAAO;GAJqB;AAWvB,IAAM,6BAA6B,wBAAC,WAAW,WAAW;AAC/D,QAAM,kBAAkB,qBAAqB,WAAW,MAAM;AAC9D,MAAI,CAAC,iBAAiB;AAEpB,UAAM,mBAAmB,sBAAsB,WAAW,MAAM;AAEhE,QAAI,CAAC;AAAkB,aAAO;AAC9B,WAAO;;AAET,SAAO;GATiC;AAYnC,IAAM,mBAAmB;EAC9B;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAGK,IAAM,iBAAiB;EAC5B;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;;AGxPF;AAaA;AACA;AACA;AACA;AACA;AAQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA0BO,IAAM,WAAW,wBACtB,OACA,YACA,SACA,WACA,gBACG;AACH,QAAM,iBAAiB,MAAM,KAAK,YAAW;AAC7C,QAAM,QAAQ,YAAY;IACxB,MAAM;IACN;IACA;IACA,QAAQ;GACT;AACD,MAAI,aAAa;AACf,UAAM,kBAAkB,QAAQ,cAAc;MAC5C,IAAI,WAAW;MACf,gBAAgB;KACjB;AACD,WAAO,GAAG,UAAU;SACf;AACL,WAAO;;GArBa;AA+BxB,IAAM,iBAAiB,wBACrB,OACA,YACA,SACA,cACG;AACH,QAAM,iBAAiB,MAAM,KAAK,YAAW;AAC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iBzB,IAAM,sBAAsB,wBAAC,iBAClC,eAAe,kCAAK,aAAe,gBAAiB,YADnB;","names":[]}
1
+ {"version":3,"sources":["../../../node_modules/tslib/tslib.js","../index.ts","../components/core/typings.ts","../components/form/index.ts","../components/form/core/FormContext.tsx","../components/form/core/Form/index.ts","../components/form/core/Form/Form.tsx","../components/form/utils/schema_utils.ts","../components/form/utils/utils.ts","../components/form/utils/path_utils.ts","../components/form/core/Form/fields.ts","../components/form/core/Form/utils.ts","../components/form/hooks/useWarnOnUnsaved/index.ts","../components/form/hooks/useWarnOnUnsaved/useWarnOnUnsaved.ts","../components/form/hooks/useBlockTransition/useBlockTransition.ts","../components/form/hooks/useBlockTransition/block.ts","../components/VulcanComponents/Consumer.tsx","../components/VulcanComponents/Context.ts","../components/VulcanComponents/Dummy.tsx","../components/form/core/Form/typings.ts","../components/form/core/FormContainer.tsx","../../../node_modules/graphql-tag/lib/index.js","../../../node_modules/tslib/modules/index.js","../../../node_modules/graphql/index.mjs","../../../node_modules/graphql/language/parser.mjs","../../../node_modules/graphql/error/syntaxError.mjs","../../../node_modules/graphql/error/GraphQLError.mjs","../../../node_modules/graphql/jsutils/isObjectLike.mjs","../../../node_modules/graphql/polyfills/symbols.mjs","../../../node_modules/graphql/language/location.mjs","../../../node_modules/graphql/language/printLocation.mjs","../../../node_modules/graphql/language/kinds.mjs","../../../node_modules/graphql/language/ast.mjs","../../../node_modules/graphql/jsutils/defineInspect.mjs","../../../node_modules/graphql/jsutils/invariant.mjs","../../../node_modules/graphql/jsutils/nodejsCustomInspectSymbol.mjs","../../../node_modules/graphql/language/tokenKind.mjs","../../../node_modules/graphql/language/source.mjs","../../../node_modules/graphql/jsutils/inspect.mjs","../../../node_modules/graphql/jsutils/devAssert.mjs","../../../node_modules/graphql/jsutils/instanceOf.mjs","../../../node_modules/graphql/language/directiveLocation.mjs","../../../node_modules/graphql/language/lexer.mjs","../../../node_modules/graphql/language/blockString.mjs","../../../node_modules/graphql/language/index.mjs","../components/form/utils/formFragments.ts","../components/VulcanCurrentUser/index.ts","../components/VulcanCurrentUser/Consumer.tsx","../components/VulcanCurrentUser/Context.ts","../components/VulcanCurrentUser/Provider.tsx","../components/form/utils/index.ts","../components/form/utils/ui_utils.ts","../components/VulcanComponents/index.ts","../components/VulcanComponents/Provider.tsx","../components/VulcanComponents/typings.ts","../components/VulcanComponents/defaultVulcanComponents/index.ts","../components/core/LoadingButton.tsx","../components/core/MutationButton.tsx","../components/form/core/index.ts","../componentsHelpers.tsx"],"sourcesContent":["/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global global, define, System, Reflect, Promise */\r\nvar __extends;\r\nvar __assign;\r\nvar __rest;\r\nvar __decorate;\r\nvar __param;\r\nvar __metadata;\r\nvar __awaiter;\r\nvar __generator;\r\nvar __exportStar;\r\nvar __values;\r\nvar __read;\r\nvar __spread;\r\nvar __spreadArrays;\r\nvar __spreadArray;\r\nvar __await;\r\nvar __asyncGenerator;\r\nvar __asyncDelegator;\r\nvar __asyncValues;\r\nvar __makeTemplateObject;\r\nvar __importStar;\r\nvar __importDefault;\r\nvar __classPrivateFieldGet;\r\nvar __classPrivateFieldSet;\r\nvar __classPrivateFieldIn;\r\nvar __createBinding;\r\n(function (factory) {\r\n var root = typeof global === \"object\" ? global : typeof self === \"object\" ? self : typeof this === \"object\" ? this : {};\r\n if (typeof define === \"function\" && define.amd) {\r\n define(\"tslib\", [\"exports\"], function (exports) { factory(createExporter(root, createExporter(exports))); });\r\n }\r\n else if (typeof module === \"object\" && typeof module.exports === \"object\") {\r\n factory(createExporter(root, createExporter(module.exports)));\r\n }\r\n else {\r\n factory(createExporter(root));\r\n }\r\n function createExporter(exports, previous) {\r\n if (exports !== root) {\r\n if (typeof Object.create === \"function\") {\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n }\r\n else {\r\n exports.__esModule = true;\r\n }\r\n }\r\n return function (id, v) { return exports[id] = previous ? previous(id, v) : v; };\r\n }\r\n})\r\n(function (exporter) {\r\n var extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n\r\n __extends = function (d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n };\r\n\r\n __assign = Object.assign || function (t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n };\r\n\r\n __rest = function (s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n };\r\n\r\n __decorate = function (decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n };\r\n\r\n __param = function (paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n };\r\n\r\n __metadata = function (metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n };\r\n\r\n __awaiter = function (thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n };\r\n\r\n __generator = function (thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n };\r\n\r\n __exportStar = function(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n };\r\n\r\n __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n }) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n });\r\n\r\n __values = function (o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n };\r\n\r\n __read = function (o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n };\r\n\r\n /** @deprecated */\r\n __spread = function () {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n };\r\n\r\n /** @deprecated */\r\n __spreadArrays = function () {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n };\r\n\r\n __spreadArray = function (to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n };\r\n\r\n __await = function (v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n };\r\n\r\n __asyncGenerator = function (thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n };\r\n\r\n __asyncDelegator = function (o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n };\r\n\r\n __asyncValues = function (o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n };\r\n\r\n __makeTemplateObject = function (cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n };\r\n\r\n var __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n }) : function(o, v) {\r\n o[\"default\"] = v;\r\n };\r\n\r\n __importStar = function (mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n };\r\n\r\n __importDefault = function (mod) {\r\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\r\n };\r\n\r\n __classPrivateFieldGet = function (receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n };\r\n\r\n __classPrivateFieldSet = function (receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n };\r\n\r\n __classPrivateFieldIn = function (state, receiver) {\r\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\r\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\r\n };\r\n\r\n exporter(\"__extends\", __extends);\r\n exporter(\"__assign\", __assign);\r\n exporter(\"__rest\", __rest);\r\n exporter(\"__decorate\", __decorate);\r\n exporter(\"__param\", __param);\r\n exporter(\"__metadata\", __metadata);\r\n exporter(\"__awaiter\", __awaiter);\r\n exporter(\"__generator\", __generator);\r\n exporter(\"__exportStar\", __exportStar);\r\n exporter(\"__createBinding\", __createBinding);\r\n exporter(\"__values\", __values);\r\n exporter(\"__read\", __read);\r\n exporter(\"__spread\", __spread);\r\n exporter(\"__spreadArrays\", __spreadArrays);\r\n exporter(\"__spreadArray\", __spreadArray);\r\n exporter(\"__await\", __await);\r\n exporter(\"__asyncGenerator\", __asyncGenerator);\r\n exporter(\"__asyncDelegator\", __asyncDelegator);\r\n exporter(\"__asyncValues\", __asyncValues);\r\n exporter(\"__makeTemplateObject\", __makeTemplateObject);\r\n exporter(\"__importStar\", __importStar);\r\n exporter(\"__importDefault\", __importDefault);\r\n exporter(\"__classPrivateFieldGet\", __classPrivateFieldGet);\r\n exporter(\"__classPrivateFieldSet\", __classPrivateFieldSet);\r\n exporter(\"__classPrivateFieldIn\", __classPrivateFieldIn);\r\n});\r\n","export * from \"./components/core/typings\";\nexport * from \"./components/form\";\nexport * from \"./components/VulcanComponents\";\nexport * from \"./components/VulcanCurrentUser\";\nexport * from \"./componentsHelpers\";\n","// @see https://stackoverflow.com/questions/51835611/specify-specific-props-and-accept-general-html-props-in-typescript-react-app\nexport type ButtonProps = React.DetailedHTMLProps<\n React.HTMLAttributes<HTMLButtonElement>,\n HTMLButtonElement\n> &\n // The any is important here: we allow end-application to \"hack\" the component with a custom replacement implementation,\n // so we authorize them to pass additionnal unknown props\n any;\n","export * from \"./core/FormContext\";\nexport * from \"./core/Form\";\nexport * from \"./core/FormContainer\";\n\nexport type { FormInputProps } from \"./typings\";\n\nexport * from \"./utils\";\n","import React, { useContext } from \"react\";\n\ninterface FormContextValue {\n addToDeletedValues: Function;\n addToFailureForm: Function;\n addToSubmitForm: Function;\n addToSuccessForm: Function;\n clearForm: Function;\n clearFormCallbacks: Function;\n clearFieldErrors: Function;\n currentValues: object;\n deletedValues: Array<any>;\n errors: Array<any>;\n getDocument: Function;\n getLabel: (fieldName: string, fieldLocale?: string) => string;\n initialDocument: object;\n isChanged: boolean;\n refetchForm: Function;\n // TODO: we deprecate this, it doesn't make sense to allow a child to setState this way\n // setFormState: Function;\n // FIXME: this type doesn't work, it doesn't necessarily have the event + it has to be defined\n submitForm: Function; //React.HTMLAttributes<HTMLFormElement>[\"onSubmit\"];\n throwError: Function;\n updateCurrentValues: Function;\n}\n\nexport const FormContext =\n React.createContext<FormContextValue | undefined>(undefined);\n\nexport const useFormContext = () => {\n const formContext = useContext(FormContext);\n if (!formContext)\n throw new Error(\n `A component is trying to access form context but it is undefined. Please wrap your component with a <Form>.\n You may be importing \"FormContext\" from different packages or have accidentaly made a copy of it?\n FormContext is exposed by \"@vulcanjs/react-ui\".`\n );\n return formContext;\n};\n","export * from \"./Form\";\nexport * from \"./typings\";\n","/*\n\nMain form component.\n\nThis component expects:\n\n### All Forms:\n\n- collection\n- currentUser\n- client (Apollo client)\n\n*/\n\nimport React, { useEffect, useRef, useState } from \"react\";\nimport { runCallbacks, getErrors } from \"@vulcanjs/core\";\nimport { useIntlContext } from \"@vulcanjs/react-i18n\";\nimport { removeProperty } from \"@vulcanjs/utils\";\nimport _filter from \"lodash/filter.js\";\nimport cloneDeep from \"lodash/cloneDeep.js\";\nimport compact from \"lodash/compact.js\";\nimport get from \"lodash/get.js\";\nimport isObject from \"lodash/isObject.js\";\nimport mapValues from \"lodash/mapValues.js\";\nimport merge from \"lodash/merge.js\";\nimport omit from \"lodash/omit.js\";\nimport omitBy from \"lodash/omitBy.js\";\nimport pick from \"lodash/pick.js\";\nimport pickBy from \"lodash/pickBy.js\";\nimport set from \"lodash/set.js\";\nimport unset from \"lodash/unset.js\";\nimport update from \"lodash/update.js\";\nimport without from \"lodash/without.js\";\nimport isEmpty from \"lodash/isEmpty.js\";\n//import type { FormLayoutProps } from \"../../elements/FormLayout\";\n//import type { FormSubmitProps } from \"../../elements/FormSubmit\";\n\nimport {\n convertSchema,\n getEditableFields,\n getInsertableFields,\n} from \"../../utils/schema_utils\";\nimport { isEmptyValue } from \"../../utils/utils\";\nimport { getParentPath } from \"../../utils/path_utils\";\n// import withCollectionProps from \"./withCollectionProps\";\nimport { FormContext } from \"../FormContext\";\nimport { getFieldGroups, getFieldNames, getLabel } from \"./fields\";\nimport { isNotSameDocument } from \"./utils\";\nimport { useWarnOnUnsaved } from \"../../hooks/useWarnOnUnsaved\";\n\nimport type { FormType } from \"../../typings\";\nimport {\n CreateDocumentResult,\n FormProps,\n FormState,\n UpdateDocumentResult,\n} from \"./typings\";\nimport { MutationResult } from \"@apollo/client\";\nimport { useVulcanComponents } from \"../../../VulcanComponents/Consumer\";\n\n// props that should trigger a form reset\nconst RESET_PROPS = [\n \"model\",\n // \"collection\",\n // \"collectionName\",\n \"document\",\n \"schema\",\n \"currentUser\",\n \"fields\",\n \"removeFields\",\n \"prefilledProps\", // TODO: prefilledProps should be merged instead?\n];\n\nconst compactParent = (object, path) => {\n const parentPath = getParentPath(path);\n\n // note: we only want to compact arrays, not objects\n const compactIfArray = (x) => (Array.isArray(x) ? compact(x) : x);\n\n update(object, parentPath, compactIfArray);\n};\n\nconst getDefaultValues = (convertedSchema) => {\n // TODO: make this work with nested schemas, too\n return pickBy(\n mapValues(convertedSchema, (field) => field.defaultValue),\n (value) => value\n );\n};\n\nconst compactObject = (o) => omitBy(o, (f) => f === null || f === undefined);\n\nconst getInitialStateFromProps = (nextProps: FormProps): FormState => {\n const schema = nextProps.schema || nextProps.model.schema;\n const convertedSchema = convertSchema(schema);\n const formType: FormType = nextProps.document ? \"edit\" : \"new\";\n // for new document forms, add default values to initial document\n const defaultValues =\n formType === \"new\" ? getDefaultValues(convertedSchema) : {};\n // note: we remove null/undefined values from the loaded document so they don't overwrite possible prefilledProps\n const initialDocument = merge(\n {},\n defaultValues,\n nextProps.prefilledProps,\n compactObject(nextProps.document)\n );\n\n //if minCount is specified, go ahead and create empty nested documents\n Object.keys(convertedSchema).forEach((key) => {\n let minCount = convertedSchema[key].minCount;\n if (minCount) {\n initialDocument[key] = initialDocument[key] || [];\n while (initialDocument[key].length < minCount)\n initialDocument[key].push({});\n }\n });\n\n // remove all instances of the `__typename` property from document\n removeProperty(initialDocument, \"__typename\");\n\n return {\n disabled: nextProps.disabled,\n errors: [],\n deletedValues: [],\n currentValues: {},\n originalSchema: convertSchema(schema, { removeArrays: false }),\n // convert SimpleSchema schema into JSON object\n schema: convertedSchema,\n // Also store all field schemas (including nested schemas) in a flat structure\n flatSchema: convertSchema(schema, { flatten: true }),\n // the initial document passed as props\n initialDocument,\n // initialize the current document to be the same as the initial document\n currentDocument: initialDocument,\n };\n};\n\nconst getChildrenProps = (\n props: FormProps,\n state: Pick<FormState, \"disabled\" | \"currentDocument\">,\n options: { formType: FormType },\n // TODO: that belongs to the context instead\n callbacks: { deleteDocument: Function }\n): {\n formLayoutProps: any;//FormLayoutProps;\n formGroupProps: Function;\n commonProps: any;\n formSubmitProps: any;// FormSubmitProps;\n} => {\n const {\n currentUser,\n repeatErrors,\n submitLabel,\n cancelLabel,\n revertLabel,\n cancelCallback,\n revertCallback,\n id,\n model,\n prefilledProps,\n itemProperties,\n contextName,\n showRemove,\n showDelete,\n } = props;\n const { disabled, currentDocument } = state;\n const { formType } = options;\n const { deleteDocument } = callbacks;\n const commonProps = {\n document: currentDocument,\n formType,\n currentUser,\n disabled,\n prefilledProps,\n itemProperties,\n contextName,\n };\n\n const docClassName = `document-${formType}`;\n const modelName = model.name.toLowerCase();\n const formProps = {\n className: `${docClassName} ${docClassName}-${modelName}`,\n id: id,\n // It's the form element responsibility to get submitForm from context\n // onSubmit: this.submitForm(formType),\n // TODO: update to useRef\n //ref: (e) => {\n // this.form = e;\n //},\n };\n\n const formGroupProps = (group) => ({\n key: group.name,\n ...group,\n group: omit(group, [\"fields\"]),\n ...commonProps,\n });\n\n const formSubmitProps = {\n model,\n currentUser,\n submitLabel,\n cancelLabel,\n revertLabel,\n cancelCallback,\n revertCallback,\n document: currentDocument,\n // TODO: should probably be passed through context\n deleteDocument:\n (formType === \"edit\" && showRemove && showDelete && deleteDocument) ||\n null,\n };\n\n const formLayoutProps = {\n formProps: formProps,\n repeatErrors: repeatErrors,\n submitProps: formSubmitProps,\n commonProps,\n };\n return {\n commonProps,\n formSubmitProps,\n formGroupProps,\n formLayoutProps,\n };\n};\n\n// component form until we go stateless\nconst FormWarnUnsaved = ({\n isChanged,\n warnUnsavedChanges,\n children,\n}: {\n isChanged: boolean;\n warnUnsavedChanges?: boolean;\n children: React.ReactNode;\n}) => {\n useWarnOnUnsaved({\n isChanged,\n warnUnsavedChanges,\n });\n return <>{children}</>;\n};\n\n/*\n\n Like getDocument, but cross-reference with getFieldNames()\n to only return fields that actually need to be submitted\n\n Also remove any deleted values.\n\n */\nconst getData = (\n customArgs,\n props: FormProps,\n state: Pick<FormState, \"currentDocument\" | \"deletedValues\">,\n // previously from \"this\" object\n { submitFormCallbacks, form }: any\n) => {\n const { currentDocument } = state;\n const { model, prefilledProps } = props;\n // we want to keep prefilled data even for hidden/removed fields\n let data = prefilledProps || {};\n\n // omit prefilled props for nested fields\n data = omitBy(data, (value, key) => key.endsWith(\".$\"));\n\n const args = {\n schema: model.schema,\n excludeRemovedFields: false,\n excludeHiddenFields: false,\n replaceIntlFields: true,\n addExtraFields: false,\n ...customArgs,\n };\n\n // only keep relevant fields\n // for intl fields, make sure we look in foo_intl and not foo\n const fields = getFieldNames(props, currentDocument, args);\n data = { ...data, ...pick(currentDocument, ...fields) };\n\n // compact deleted values\n state.deletedValues.forEach((path) => {\n if (path.includes(\".\")) {\n /*\n\n If deleted field is a nested field, nested array, or nested array item, try to compact its parent array\n\n - Nested field: 'address.city'\n - Nested array: 'addresses.1'\n - Nested array item: 'addresses.1.city'\n\n */\n compactParent(data, path);\n }\n });\n\n // run data object through submitForm callbacks\n data = runCallbacks({\n callbacks: submitFormCallbacks,\n iterator: data,\n args: [\n {\n /*form: this*/\n },\n ],\n });\n\n return data;\n};\n\nexport const Form = (props: FormProps) => {\n const { initCallback, createDocument, updateDocument, deleteDocument } =\n props;\n const initialState = getInitialStateFromProps(props);\n const { schema, originalSchema, flatSchema, initialDocument } = initialState;\n const isFirstRender = useRef(true);\n useEffect(() => {\n if (isFirstRender.current) {\n isFirstRender.current = false; // toggle flag after first render/mounting\n return;\n }\n if (initCallback) initCallback(initialState.currentDocument);\n }, [initCallback]);\n const defaultProps = {\n layout: \"horizontal\",\n prefilledProps: {},\n repeatErrors: false,\n showRemove: true,\n showDelete: true,\n };\n const allProps = { ...defaultProps, ...props };\n const defaultValues = {};\n const submitFormCallbacks: Array<Function> = [];\n const successFormCallbacks: Array<Function> = [];\n const failureFormCallbacks: Array<Function> = [];\n const intl = useIntlContext();\n\n // --------------------------------------------------------------------- //\n // ------------------------------- Errors ------------------------------ //\n // --------------------------------------------------------------------- //\n\n /*\n\n Add error to form state\n\n Errors can have the following properties:\n - id: used as an internationalization key, for example `errors.required`\n - path: for field-specific errors, the path of the field with the issue\n - properties: additional data. Will be passed to vulcan-i18n as values\n - message: if id cannot be used as i81n key, message will be used\n\n */\n const [errors, setErrors] = useState<Array<any>>([]);\n const throwError = (error) => {\n let formErrors = getErrors(error);\n\n // eslint-disable-next-line no-console\n console.log(formErrors);\n\n // add error(s) to state\n setErrors((prevErrors) => [...prevErrors, ...formErrors]);\n };\n\n /*\n\n Clear errors for a field\n\n */\n const clearFieldErrors = (path) => {\n setErrors((prevErrors) =>\n prevErrors.filter((error) => error.path !== path)\n );\n };\n\n // --------------------------------------------------------------------- //\n // ------------------------------- Context ----------------------------- //\n // --------------------------------------------------------------------- //\n\n const [deletedValues, setDeletedValues] = useState<Array<any>>([]);\n\n // add something to deleted values\n const addToDeletedValues = (name) => {\n setDeletedValues((prevDeletedValues) => [...prevDeletedValues, name]);\n };\n\n interface Callbacks {\n submitFormCallbacks: Array<any>;\n successFormCallbacks: Array<any>;\n failureFormCallbacks: Array<any>;\n }\n const [callbacks, setCallbacks] = useState<Callbacks>({\n submitFormCallbacks: [],\n successFormCallbacks: [],\n failureFormCallbacks: [],\n });\n // add a callback to the form submission\n const addToSubmitForm = (callback) => {\n setCallbacks((cbs) => ({\n ...cbs,\n // submitFormCallbacks: [...cbs.submitFormCallbacks, callback],\n }));\n };\n\n // add a callback to form submission success\n const addToSuccessForm = (callback) => {\n setCallbacks((cbs) => ({\n ...cbs,\n successFormCallbacks: [...cbs.successFormCallbacks, callback],\n }));\n };\n\n // add a callback to form submission failure\n const addToFailureForm = (callback) => {\n setCallbacks((cbs) => ({\n ...cbs,\n failureFormCallbacks: [...cbs.failureFormCallbacks, callback],\n }));\n };\n\n const clearFormCallbacks = () => {\n setCallbacks({\n submitFormCallbacks: [],\n successFormCallbacks: [],\n failureFormCallbacks: [],\n });\n };\n\n /*\n setFormState = (fn) => {\n this.setState(fn);\n };\n */\n\n const [currentValues, setCurrentValues] = useState<Object>({});\n\n const submitFormContext = (formType: FormType) => (event /*newValues*/) => {\n /*\n TODO: previously this callback was updating the current values with new values after this call\n Need to check how this worked in Vulcan initially\n setCurrentValues((prevCurrentValues) => ({\n ...prevCurrentValues,\n ...newValues,\n }));\n */\n // TODO: previously, this was using a callback from setCurrentValues\n // this needs to be rearchitectured to work without, will need some check\n // https://stackoverflow.com/questions/56247433/how-to-use-setstate-callback-on-react-hooks\n submitForm(formType)(event);\n };\n\n // --------------------------------------------------------------------- //\n // ------------------------------ Lifecycle ---------------------------- //\n // --------------------------------------------------------------------- //\n\n /*\n\n When props change, reinitialize the form state\n Triggered only for data related props (collection, document, currentUser etc.)\n\n @see https://reactjs.org/blog/2018/06/07/you-probably-dont-need-derived-state.html\n\n */\n /*\n UNSAFE_componentWillReceiveProps(nextProps) {\n const needReset = !!RESET_PROPS.find(\n (prop) => !isEqual(this.props[prop], nextProps[prop])\n );\n if (needReset) {\n const newState = getInitialStateFromProps(nextProps);\n this.setState(newState);\n if (nextProps.initCallback)\n nextProps.initCallback(newState.currentDocument);\n }\n }*/\n\n const [currentDocument, setCurrentDocument] = useState<{\n title?: string;\n _id?: string;\n name?: string;\n }>(initialDocument);\n\n /*\n\n Manually update the current values of one or more fields(i.e. on change or blur).\n\n */\n const updateCurrentValues = (newValues, options: { mode?: string } = {}) => {\n // default to overwriting old value with new\n const { mode = \"overwrite\" } = options;\n const { changeCallback } = props;\n\n // keep the previous ones and extend (with possible replacement) with new ones\n // keep only the relevant properties\n const newState = {\n currentValues: cloneDeep(currentValues),\n currentDocument: cloneDeep(currentDocument),\n deletedValues: cloneDeep(deletedValues),\n };\n\n Object.keys(newValues).forEach((key) => {\n const path = key;\n let value = newValues[key];\n\n if (isEmptyValue(value)) {\n // delete value\n unset(newState.currentValues, path);\n set(newState.currentDocument, path, null);\n newState.deletedValues = [...newState.deletedValues, path];\n } else {\n // 1. update currentValues\n set(newState.currentValues, path, value);\n\n // 2. update currentDocument\n // For arrays and objects, give option to merge instead of overwrite\n if (mode === \"merge\" && (Array.isArray(value) || isObject(value))) {\n const oldValue = get(newState.currentDocument, path);\n set(newState.currentDocument, path, merge(oldValue, value));\n } else {\n set(newState.currentDocument, path, value);\n }\n\n // 3. in case value had previously been deleted, \"undelete\" it\n newState.deletedValues = without(newState.deletedValues, path);\n }\n });\n if (changeCallback) changeCallback(newState.currentDocument);\n\n // TODO: prefer a reducer\n setCurrentValues(newState.currentValues);\n setCurrentDocument(newState.currentDocument);\n setDeletedValues(newState.deletedValues);\n };\n\n /*\n\n Refetch the document from the database (in case it was updated by another process or to reset the form)\n\n */\n const refetchForm = () => {\n if (props.refetch) {\n props.refetch();\n }\n };\n\n const [disabled, setDisabled] = useState<boolean>(false); // TODO\n const [success, setSuccess] = useState<boolean>(false); // TODO\n /**\n * Clears form errors and values.\n *\n * @example Clear form\n * // form will be fully emptied, with exception of prefilled values\n * clearForm({ document: {} });\n *\n * @example Reset/revert form\n * // form will be reverted to its initial state\n * clearForm();\n *\n * @example Clear with new values\n * // form will be cleared but initialized with the new document\n * const document = {\n * // ... some values\n * };\n * clearForm({ document });\n *\n * @param {Object=} options\n * @param {Object=} options.document\n * Document to use as new initial document when values are cleared instead of\n * the existing one. Note that prefilled props will be merged\n */\n const clearForm = (options: { document?: any } = {}) => {\n const { document: optionsDocument } = options;\n const document = optionsDocument\n ? merge({}, props.prefilledProps, optionsDocument)\n : null;\n // TODO: prefer a reducer\n setErrors([]);\n setCurrentValues({});\n setDeletedValues([]);\n setCurrentDocument(document || initialDocument);\n // setInitialDocument(document || initialDocument);\n setDisabled(false);\n };\n\n const newMutationSuccessCallback = function <TModel = Object>(\n result: CreateDocumentResult<TModel>\n ) {\n mutationSuccessCallback(result, \"new\");\n };\n\n const editMutationSuccessCallback = function <TModel = Object>(\n result: UpdateDocumentResult<TModel>\n ) {\n mutationSuccessCallback(result, \"edit\");\n };\n\n const formRef = useRef(null);\n const mutationSuccessCallback = function <TModel = Object>(\n // must be called only on valid results\n result: CreateDocumentResult<TModel>,\n mutationType: FormType\n ) {\n // TODO: use a reducer\n setDisabled(false);\n setSuccess(true);\n // for new mutation, run refetch function if it exists\n // TODO: the create mutation should already return the freshest value, do we really need that?\n // instead we might want to update currentResult with the result of the creation\n if (mutationType === \"new\") refetchForm();\n let { document } = result;\n\n // call the clear form method (i.e. trigger setState) only if the form has not been unmounted\n // (we are in an async callback, everything can happen!)\n // TODO: this should rely on a ref\n if (formRef.current) {\n clearForm({\n document: mutationType === \"edit\" ? document : undefined,\n });\n }\n\n // run document through mutation success callbacks\n document = runCallbacks({\n callbacks: successFormCallbacks,\n iterator: document,\n args: [{ form: formRef.current }],\n });\n\n // run success callback if it exists\n if (props.successCallback) props.successCallback(document, { form: this });\n };\n\n // catch graphql errors\n const mutationErrorCallback = (document, error) => {\n setDisabled(false);\n\n // eslint-disable-next-line no-console\n console.error(\"// graphQL Error\");\n // eslint-disable-next-line no-console\n console.error(error);\n\n // run mutation failure callbacks on error, we do not allow the callbacks to change the error\n runCallbacks({\n callbacks: failureFormCallbacks,\n iterator: error,\n args: [{ error, form: formRef.current }],\n });\n\n if (!isEmpty(error)) {\n // add error to state\n throwError(error);\n }\n\n // run error callback if it exists\n if (props.errorCallback)\n props.errorCallback(document, error, { form: this });\n\n // scroll back up to show error messages\n // TODO: migrate this to scroll on top of the form\n //Utils.scrollIntoView(\".flash-message\");\n };\n\n /*\n\n Submit form handler\n\n */\n const submitForm = (formType: FormType) => async (event?: Event) => {\n event && event.preventDefault();\n event && event.stopPropagation();\n\n const { contextName } = props;\n\n // if form is disabled (there is already a submit handler running) don't do anything\n if (disabled) {\n return;\n }\n\n // clear errors and disable form while it's submitting\n setErrors([]);\n setDisabled(true);\n\n // complete the data with values from custom components\n // note: it follows the same logic as SmartForm's getDocument method\n let data = getData(\n { replaceIntlFields: true, addExtraFields: false, mutableFields },\n props,\n {\n currentDocument,\n deletedValues,\n },\n { form: formRef.current, submitFormCallbacks }\n );\n\n // if there's a submit callback, run it\n if (props.submitCallback) {\n data = props.submitCallback(data) || data;\n }\n\n if (formType === \"new\") {\n // create document form\n try {\n const result = await createDocument({\n input: {\n data,\n contextName,\n },\n });\n if (result.errors?.length) {\n // TODO: previously got from meta, we could have more than 1 error\n mutationErrorCallback(document, result.errors[0]);\n } else {\n newMutationSuccessCallback(result);\n }\n } catch (error) {\n mutationErrorCallback(document, error);\n }\n } else {\n // update document form\n try {\n const documentId = currentDocument._id;\n const result = await updateDocument({\n input: {\n id: documentId,\n data,\n contextName,\n },\n });\n // TODO: handle more than 1 error\n if (result.errors?.length) {\n mutationErrorCallback(document, result.errors[0]);\n } else {\n editMutationSuccessCallback(result);\n }\n } catch (error) {\n mutationErrorCallback(document, error);\n }\n }\n };\n\n /*\n\n Delete document handler\n\n */\n const deleteDocumentWithConfirm = () => {\n const document = currentDocument;\n const documentId = props.document._id;\n const documentTitle = document.title || document.name || \"\";\n\n const deleteDocumentConfirm = intl.formatMessage(\n { id: \"forms.delete_confirm\" },\n { title: documentTitle }\n );\n\n if (window.confirm(deleteDocumentConfirm)) {\n deleteDocument({ input: { id: documentId } })\n .then((mutationResult) => {\n // the mutation result looks like {data:{collectionRemove: null}} if succeeded\n if (props.removeSuccessCallback)\n props.removeSuccessCallback({ documentId, documentTitle });\n refetchForm();\n })\n .catch((error) => {\n // eslint-disable-next-line no-console\n console.log(error);\n });\n }\n };\n\n // --------------------------------------------------------------------- //\n // ------------------------- Props to Pass ----------------------------- //\n // --------------------------------------------------------------------- //\n\n // --------------------------------------------------------------------- //\n // ----------------------------- Render -------------------------------- //\n // --------------------------------------------------------------------- //\n\n const { successComponent, document, currentUser, model, warnUnsavedChanges } =\n props;\n const FormComponents = useVulcanComponents();\n\n const formType: \"edit\" | \"new\" = document ? \"edit\" : \"new\";\n\n // Fields computation\n const mutableFields =\n formType === \"edit\"\n ? getEditableFields(schema, currentUser, initialDocument)\n : getInsertableFields(schema, currentUser);\n\n const { formLayoutProps, formGroupProps } = getChildrenProps(\n props,\n { disabled, currentDocument },\n {\n formType,\n },\n {\n deleteDocument: deleteDocumentWithConfirm,\n }\n );\n const isChanged = isNotSameDocument(initialDocument, currentDocument);\n\n return success && successComponent ? (\n successComponent\n ) : (\n <FormWarnUnsaved\n isChanged={isChanged}\n warnUnsavedChanges={warnUnsavedChanges}\n >\n <FormContext.Provider\n value={{\n throwError,\n clearForm,\n refetchForm,\n isChanged,\n submitForm: submitFormContext(formType), //Change in name because we already have a function\n // called submitForm, but no reason for the user to know\n // about that\n addToDeletedValues: addToDeletedValues,\n updateCurrentValues: updateCurrentValues,\n getDocument: () => currentDocument,\n getLabel: (fieldName, fieldLocale) =>\n getLabel(model, flatSchema, intl, fieldName, fieldLocale),\n initialDocument: initialDocument,\n // TODO BAD: check where used\n //setFormState: this.setFormState,\n addToSubmitForm,\n addToSuccessForm,\n addToFailureForm,\n clearFormCallbacks,\n errors,\n currentValues,\n deletedValues,\n clearFieldErrors,\n }}\n >\n <FormComponents.FormLayout {...formLayoutProps}>\n {getFieldGroups(\n props,\n {\n currentDocument,\n schema,\n flatSchema,\n originalSchema,\n },\n intl,\n mutableFields,\n intl.formatMessage\n ).map((group, i) => (\n <FormComponents.FormGroup key={i} {...formGroupProps(group)} />\n ))}\n </FormComponents.FormLayout>\n </FormContext.Provider>\n </FormWarnUnsaved>\n );\n};\n\n// Mutation that yield a success result\ntype SuccessfulMutationResult<TData = Object> = MutationResult<TData> & {\n data: TData;\n};\n/**\n * Typeguared to allow considering the request as successful\n */\nconst isSuccessful = function <T = any>(\n result: MutationResult<T> | undefined\n): result is SuccessfulMutationResult<T> {\n return !!result?.data;\n};\n\nexport default Form;\n","/*\n * Schema converter/getters\n */\nimport { canCreateField, canUpdateField } from \"@vulcanjs/permissions\";\nimport { VulcanFieldSchema, VulcanSchema } from \"@vulcanjs/schema\";\nimport { getFieldType } from \"./utils\";\n\n/* getters */\n// filter out fields with \".\" or \"$\"\nexport const getValidFields = (schema) => {\n return Object.keys(schema).filter(\n (fieldName) => !fieldName.includes(\"$\") && !fieldName.includes(\".\")\n );\n};\n\n/*\n\nConvert a nested SimpleSchema schema into a JSON object\nIf flatten = true, will create a flat object instead of nested tree\n\n/* permissions */\n\n/**\n * @method Mongo.Collection.getInsertableFields\n * Get an array of all fields editable by a specific user for a given collection\n * @param {Object} user – the user for which to check field permissions\n */\nexport const getInsertableFields = function (schema, user) {\n const fields = Object.keys(schema).filter(function (fieldName) {\n var field = schema[fieldName];\n return canCreateField(user, field);\n });\n return fields;\n};\n\n/**\n * @method Mongo.Collection.getEditableFields\n * Get an array of all fields editable by a specific user for a given collection (and optionally document)\n * @param {Object} user – the user for which to check field permissions\n */\nexport const getEditableFields = function (schema, user, document) {\n const fields = Object.keys(schema).filter(function (fieldName) {\n var field = schema[fieldName];\n return canUpdateField(user, field, document);\n });\n return fields;\n};\n\nconst isNestedSchema = (schema: any): schema is VulcanSchema => {\n return typeof schema === \"object\";\n};\n\n/**\n * Vulcan Schema => Form Schema\n * TODO: type this better\n * @param schema\n * @param options\n * @returns\n */\nexport const convertSchema = (\n schema: VulcanSchema,\n options: { flatten?: boolean; removeArrays?: boolean } = {}\n) => {\n const { flatten = false, removeArrays = true } = options;\n\n let jsonSchema = {};\n\n Object.keys(schema).forEach((fieldName) => {\n // exclude array fields\n if (removeArrays && fieldName.includes(\"$\")) {\n return;\n }\n\n // extract schema\n jsonSchema[fieldName] = getFieldSchema(fieldName, schema);\n\n // check for existence of nested field\n // and get its schema if possible or its type otherwise\n const subSchemaOrType = getNestedFieldSchemaOrType(fieldName, schema);\n if (subSchemaOrType) {\n // remember the subschema if it exists, allow to customize labels for each group of items for arrays of objects\n jsonSchema[fieldName].arrayFieldSchema = getFieldSchema(\n `${fieldName}.$`,\n schema\n );\n\n // nested schema can be a field schema ({type, canRead, etc.}) (convertedSchema will be null)\n // or a schema on its own with subfields (convertedSchema will return smth)\n if (isNestedSchema(subSchemaOrType)) {\n // call convertSchema recursively on the subSchema\n const convertedSubSchema = convertSchema(subSchemaOrType, options);\n // subSchema is a full schema with multiple fields (eg array of objects)\n if (flatten) {\n jsonSchema = { ...jsonSchema, ...convertedSubSchema };\n } else {\n jsonSchema[fieldName].schema = convertedSubSchema;\n }\n } else {\n // subSchema is a simple field in this case (eg array of numbers)\n jsonSchema[fieldName].isSimpleArrayField = true; //getFieldSchema(`${fieldName}.$`, schema);\n }\n }\n });\n return jsonSchema;\n};\n\n/*\n\nGet a JSON object representing a field's schema\n\n*/\nexport const getFieldSchema = (fieldName: string, schema: VulcanSchema) => {\n let fieldSchema = {};\n schemaProperties.forEach((property) => {\n const propertyValue = schema[fieldName]?.[property];\n if (propertyValue) {\n fieldSchema[property] = propertyValue;\n }\n });\n return fieldSchema;\n};\n\n// type is an array due to the possibility of using SimpleSchema.oneOf\n// right now we support only fields with one type\nexport const getSchemaType = (fieldSchema: VulcanFieldSchema) =>\n getFieldType(fieldSchema);\n\nconst getArrayNestedSchema = (fieldName: string, schema: VulcanSchema) => {\n const arrayItemSchema = schema[`${fieldName}.$`];\n const nestedSchema = arrayItemSchema && getSchemaType(arrayItemSchema);\n return nestedSchema;\n};\n\n// TODO: not 100% it's valid with current implementation\nconst isNestedSchemaField = (fieldSchema: VulcanFieldSchema) => {\n const fieldType = getSchemaType(fieldSchema);\n return fieldType && typeof fieldType === \"object\";\n};\nconst getObjectNestedSchema = (fieldName: string, schema: VulcanSchema) => {\n const fieldSchema = schema[fieldName];\n if (!isNestedSchemaField(fieldSchema)) return null;\n const nestedSchema = fieldSchema && getSchemaType(fieldSchema);\n return nestedSchema;\n};\n/*\n\nGiven an array field, get its nested schema\nIf the field is not an object, this will return the subfield type instead\n*/\nexport const getNestedFieldSchemaOrType = (fieldName, schema) => {\n const arrayItemSchema = getArrayNestedSchema(fieldName, schema);\n if (!arrayItemSchema) {\n // look for an object schema\n const objectItemSchema = getObjectNestedSchema(fieldName, schema);\n // no schema was found\n if (!objectItemSchema) return null;\n return objectItemSchema;\n }\n return arrayItemSchema;\n};\n\nexport const schemaProperties = [\n \"type\",\n \"label\",\n \"optional\",\n \"required\",\n \"min\",\n \"max\",\n \"exclusiveMin\",\n \"exclusiveMax\",\n \"minCount\",\n \"maxCount\",\n \"allowedValues\",\n \"regEx\",\n \"blackbox\",\n \"trim\",\n \"custom\",\n \"defaultValue\",\n \"autoValue\",\n \"hidden\", // hidden: true means the field is never shown in a form no matter what\n \"mustComplete\", // mustComplete: true means the field is required to have a complete profile\n \"form\", // form placeholder\n \"inputProperties\", // form placeholder\n \"itemProperties\",\n \"control\", // SmartForm control (String or React component)\n \"input\", // SmartForm control (String or React component)\n \"autoform\", // legacy form placeholder; backward compatibility (not used anymore)\n \"order\", // position in the form\n \"group\", // form fieldset group\n \"onCreate\", // field insert callback\n \"onUpdate\", // field edit callback\n \"onDelete\", // field remove callback\n \"onInsert\", // OpenCRUD backwards compatibility\n \"onEdit\", // OpenCRUD backwards compatibility\n \"onRemove\", // OpenCRUD backwards compatibility\n \"canRead\",\n \"canCreate\",\n \"canUpdate\",\n \"viewableBy\", // OpenCRUD backwards compatibility\n \"insertableBy\", // OpenCRUD backwards compatibility\n \"editableBy\", // OpenCRUD backwards compatibility\n \"resolveAs\",\n \"searchable\",\n \"description\",\n \"beforeComponent\",\n \"afterComponent\",\n \"placeholder\",\n \"options\",\n \"query\",\n \"queryWaitsForValue\",\n \"autocompleteQuery\",\n \"fieldProperties\",\n \"intl\",\n \"intlId\",\n];\n\nexport const formProperties = [\n \"optional\",\n \"required\",\n \"min\",\n \"max\",\n \"exclusiveMin\",\n \"exclusiveMax\",\n \"minCount\",\n \"maxCount\",\n \"allowedValues\",\n \"regEx\",\n \"blackbox\",\n \"trim\",\n \"custom\",\n \"defaultValue\",\n \"autoValue\",\n \"mustComplete\", // mustComplete: true means the field is required to have a complete profile\n \"form\", // form placeholder\n \"inputProperties\", // form placeholder\n \"itemProperties\",\n \"control\", // SmartForm control (String or React component)\n \"input\", // SmartForm control (String or React component)\n \"order\", // position in the form\n \"group\", // form fieldset group\n \"description\",\n \"beforeComponent\",\n \"afterComponent\",\n \"placeholder\",\n \"options\",\n \"query\",\n \"queryWaitsForValue\",\n \"autocompleteQuery\",\n \"fieldProperties\",\n];\n","import merge from \"lodash/merge.js\";\nimport find from \"lodash/find.js\";\nimport isPlainObject from \"lodash/isPlainObject.js\";\nimport set from \"lodash/set.js\";\nimport size from \"lodash/size.js\";\n\nimport { removePrefix, filterPathsByPrefix } from \"./path_utils\";\nimport { VulcanFieldSchema } from \"@vulcanjs/schema\";\n\n// add support for nested properties\nexport const deepValue = function (obj, path) {\n const pathArray = path.split(\".\");\n\n for (var i = 0; i < pathArray.length; i++) {\n obj = obj[pathArray[i]];\n }\n\n return obj;\n};\n\n// see http://stackoverflow.com/questions/19098797/fastest-way-to-flatten-un-flatten-nested-json-objects\nexport const flatten = function (data) {\n var result = {};\n function recurse(cur, prop) {\n if (Object.prototype.toString.call(cur) !== \"[object Object]\") {\n result[prop] = cur;\n } else if (Array.isArray(cur)) {\n for (var i = 0, l = cur.length; i < l; i++)\n recurse(cur[i], prop + \"[\" + i + \"]\");\n if (l == 0) result[prop] = [];\n } else {\n var isEmpty = true;\n for (var p in cur) {\n isEmpty = false;\n recurse(cur[p], prop ? prop + \".\" + p : p);\n }\n if (isEmpty && prop) result[prop] = {};\n }\n }\n recurse(data, \"\");\n return result;\n};\n\nexport const isEmptyValue = (value) =>\n typeof value === \"undefined\" ||\n value === null ||\n value === \"\" ||\n (Array.isArray(value) && value.length === 0);\n\n/**\n * Merges values. It takes into account the current, original and deleted values,\n * and the merge produces the proper type for simple objects or arrays.\n *\n * @param {Object} props\n * Form component props. Only specific properties for this function are documented.\n * @param {*} props.currentValue\n * Current value of the field\n * @param {*} props.documentValue\n * Original value of the field\n * @return {*|undefined}\n * Merged value or undefined if no merge was performed\n */\nexport const mergeValue = ({\n currentValue,\n documentValue,\n deletedValues: deletedFields,\n path,\n locale,\n datatype,\n}) => {\n if (locale) {\n // note: intl fields are of type Object but should be treated as Strings\n return currentValue || documentValue || \"\";\n }\n\n // note: retrieve nested deleted values is performed here to avoid skipping\n // the merge in case the current field is not in `currentValues` but a nested\n // property has been removed directly by path\n const deletedValues = getNestedDeletedValues(path, deletedFields);\n const hasDeletedValues = !!size(deletedValues);\n if (\n (Array.isArray(currentValue) || hasDeletedValues) &&\n find(datatype, [\"type\", Array])\n ) {\n return merge([], documentValue, currentValue, deletedValues);\n } else if (\n (isPlainObject(currentValue) || hasDeletedValues) &&\n find(datatype, [\"type\", Object])\n ) {\n return merge({}, documentValue, currentValue, deletedValues);\n }\n return undefined;\n};\n\n/**\n * Converts a list of field names to an object of deleted values.\n *\n * @param {string[]|Object.<string|string>} deletedFields\n * List of deleted field names or paths\n * @param {Object|Array=} accumulator={}\n * Value to reduce the values to\n * @return {Object|Array}\n * Deleted values, with the structure defined by taking the received deleted\n * fields as paths\n * @example\n * const deletedFields = [\n * 'field.subField',\n * 'field.subFieldArray[0]',\n * 'fieldArray[0]',\n * 'fieldArray[2].name',\n * ];\n * getNestedDeletedValues(deletedFields);\n * // => { 'field': { 'subField': null, 'subFieldArray': [null] }, 'fieldArray': [null, undefined, { name: null } }\n */\nexport const getDeletedValues = (deletedFields, accumulator = {}) =>\n deletedFields.reduce(\n (deletedValues, path) => set(deletedValues, path, null),\n accumulator\n );\n\n/**\n * Filters the given field names by prefix, removes it from each one of them\n * and convert the list to an object of deleted values.\n *\n * @param {string=} prefix\n * Prefix to filter and remove from deleted fields\n * @param {string[]|Object.<string|string>} deletedFields\n * List of deleted field names or paths\n * @param {Object|Array=} accumulator={}\n * Value to reduce the values to\n * @return {Object.<string, null>}\n * Object keyed with the given deleted fields, valued with `null`\n * @example\n * const deletedFields = [\n * 'field.subField',\n * 'field.subFieldArray[0]',\n * 'fieldArray[0]',\n * 'fieldArray[2].name',\n * ];\n * getNestedDeletedValues('field', deletedFields);\n * // => { 'subField': null, 'subFieldArray': [null] }\n * getNestedDeletedValues('fieldArray', deletedFields);\n * // => { '0': null, '2': { 'name': null } }\n * getNestedDeletedValues('fieldArray', deletedFields, []);\n * // => [null, undefined, { 'name': null } ]\n */\nexport const getNestedDeletedValues = (\n prefix,\n deletedFields,\n accumulator = {}\n) =>\n getDeletedValues(\n removePrefix(prefix, filterPathsByPrefix(prefix, deletedFields)),\n accumulator\n );\n\n//TODO: check if it still works as expected\n// previously was dataType[0].type\nexport const getFieldType = (fieldSchema: VulcanFieldSchema) =>\n fieldSchema.type;\n/**\n * Get appropriate null value for various field types\n *\n * @param {Array} datatype\n * Field's datatype property\n */\nexport const getNullValue = (datatype) => {\n const fieldType = getFieldType(datatype);\n if (fieldType === Array) {\n return [];\n } else if (fieldType === Boolean) {\n return false;\n } else if (fieldType === String) {\n return \"\";\n } else if (fieldType === Number) {\n return \"\";\n } else {\n // normalize to null\n return null;\n }\n};\n","import toPath from \"lodash/toPath.js\";\nimport initial from \"lodash/initial.js\";\nimport flow from \"lodash/fp/flow.js\";\nimport takeRight from \"lodash/takeRight.js\";\n\n/**\n * Splits a path in string format into an array.\n */\nexport const splitPath = (string: string) => toPath(string);\n\n/**\n * Joins a path in array format into a string.\n */\nexport const joinPath = (array: Array<string | number>): string =>\n array.reduce<string>(\n (string, item) =>\n string +\n (Number.isNaN(Number(item))\n ? `${string === \"\" ? \"\" : \".\"}${item}`\n : `[${item}]`),\n \"\"\n );\n\n/**\n * Retrieves parent path from the given one.\n *\n * @param {String} string\n * Path in string format\n * @return {String}\n */\nexport const getParentPath = flow(splitPath, initial, joinPath);\n\n/**\n * Removes prefix from the given paths.\n *\n * @param {String} prefix\n * @param {String[]} paths\n * @return {String[]}\n */\nexport const removePrefix = (\n prefix: string,\n paths: Array<string>\n): Array<string> => {\n const explodedPrefix = splitPath(prefix);\n return paths.map((path) => {\n if (path === prefix) {\n return path;\n }\n const explodedPath = splitPath(path);\n const explodedSuffix = takeRight(\n explodedPath,\n explodedPath.length - explodedPrefix.length\n );\n return joinPath(explodedSuffix);\n });\n};\n\n/**\n * Filters paths that have the given prefix.\n *\n * @param {String} prefix\n * @param {String[]} paths\n * @return {String[]}\n */\nexport const filterPathsByPrefix = (prefix: string, paths: Array<string>) =>\n paths.filter(\n (path) =>\n path === prefix ||\n path.startsWith(`${prefix}.`) ||\n path.startsWith(`${prefix}[`)\n );\n","/**\n * Field processing functions that computes groups and add relevant props for i18n\n */\nimport { formProperties } from \"../../utils/schema_utils\";\nimport { FieldGroup } from \"@vulcanjs/schema\";\nimport { FormField } from \"../../typings\";\nimport { FormProps, FormState } from \"./typings\";\n\n/**\n * Field related functions\n */\n\nimport { VulcanSchema } from \"@vulcanjs/schema\";\nimport uniq from \"lodash/uniq.js\";\nimport compact from \"lodash/compact.js\";\nimport get from \"lodash/get.js\";\nimport pick from \"lodash/pick.js\";\nimport {\n isIntlField,\n formatLabel,\n getIntlKeys,\n getIntlLabel,\n} from \"@vulcanjs/i18n\";\n\nimport { IntlProviderContextValue } from \"@vulcanjs/react-i18n\";\nimport map from \"lodash/map.js\";\nimport sortBy from \"lodash/sortBy.js\";\nimport uniqBy from \"lodash/uniqBy.js\";\nimport difference from \"lodash/difference.js\";\nimport reject from \"lodash/reject.js\";\nimport intersection from \"lodash/intersection.js\";\nimport _filter from \"lodash/filter.js\";\nimport { capitalize } from \"@vulcanjs/utils\";\nimport { VulcanFieldSchema } from \"@vulcanjs/schema\";\nimport { VulcanModel } from \"@vulcanjs/model\";\n\n/*\n\n Get a field's intl keys (useful for debugging)\n\n */\nconst getModelIntlKeys = (\n model: VulcanModel,\n flatSchema: any,\n fieldName: string\n) => {\n return getIntlKeys({\n fieldName: fieldName,\n modelName: model.name,\n schema: flatSchema,\n });\n};\n\n/*\n\n Get a field's label\n\n */\nexport const getLabel = (\n model: VulcanModel,\n flatSchema: any,\n context: IntlProviderContextValue,\n fieldName: string,\n fieldLocale?: string\n) => {\n const collectionName = model.name.toLowerCase();\n const label = formatLabel({\n intl: context,\n fieldName: fieldName,\n collectionName: collectionName,\n schema: flatSchema,\n });\n if (fieldLocale) {\n const intlFieldLocale = context.formatMessage({\n id: `locales.${fieldLocale}`,\n defaultMessage: fieldLocale,\n });\n return `${label} (${intlFieldLocale})`;\n } else {\n return label;\n }\n};\n\n/*\n\n Get a field's description\n\n (Same as getLabel but pass isDescription: true )\n */\nconst getDescription = (\n model: VulcanModel,\n flatSchema: any,\n context: any,\n fieldName: string\n) => {\n const collectionName = model.name.toLowerCase();\n const description = getIntlLabel({\n intl: context,\n fieldName: fieldName,\n collectionName: collectionName,\n schema: flatSchema,\n isDescription: true,\n });\n return description || null;\n};\n\n/*\n\n Get a field option's label\n\n */\nconst getOptionLabel = (\n model: VulcanModel,\n context: { formatMessage: Function },\n fieldName: string,\n option: { intlId?: string; label: string; value?: any }\n) => {\n const collectionName = model.name.toLowerCase();\n const intlId =\n option.intlId || `${collectionName}.${fieldName}.${option.value}`;\n return context.formatMessage({\n id: intlId,\n defaultMessage: option.label,\n });\n};\n\n/*\n\n Get a list of the fields to be included in the current form\n\n Note: when submitting the form (getData()), do not include any extra fields.\n\n */\nexport const getFieldNames = (\n props: Pick<FormProps, \"fields\" | \"addFields\" | \"removeFields\">,\n currentDocument,\n optionsFromArgs: {\n excludeHiddenFields?: boolean;\n excludeRemovedFields?: boolean;\n replaceIntlFields?: boolean;\n addExtraFields?: boolean;\n schema?: VulcanSchema;\n mutableFields?: Array<any>;\n }\n) => {\n const { fields, addFields, removeFields } = props;\n const defaultOptions = {\n excludeHiddenFields: true,\n excludeRemovedFields: true,\n replaceIntlFields: false,\n addExtraFields: false,\n };\n const options = {\n ...defaultOptions,\n ...optionsFromArgs,\n };\n const {\n schema,\n mutableFields,\n excludeRemovedFields,\n excludeHiddenFields,\n addExtraFields,\n replaceIntlFields,\n } = options;\n\n // get all editable/insertable fields (depending on current form type)\n let relevantFields = mutableFields;\n\n // if \"fields\" prop is specified, restrict list of fields to it\n if (typeof fields !== \"undefined\" && fields.length > 0) {\n relevantFields = intersection(relevantFields, fields);\n }\n\n // if \"hideFields\" prop is specified, remove its fields\n if (excludeRemovedFields) {\n // OpenCRUD backwards compatibility\n //const removeFields = removeFields || hideFields;\n if (typeof removeFields !== \"undefined\" && removeFields.length > 0) {\n relevantFields = difference(relevantFields, removeFields);\n }\n }\n\n // if \"addFields\" prop is specified, add its fields\n if (\n addExtraFields &&\n typeof addFields !== \"undefined\" &&\n addFields.length > 0\n ) {\n relevantFields = relevantFields?.concat(addFields);\n }\n\n // remove all hidden fields\n if (excludeHiddenFields) {\n const document = currentDocument;\n relevantFields = reject(relevantFields, (fieldName) => {\n const hidden = schema?.[fieldName].hidden;\n return typeof hidden === \"function\"\n ? hidden({ props, document })\n : hidden;\n });\n }\n\n // replace intl fields\n if (replaceIntlFields) {\n relevantFields = relevantFields?.map((fieldName) =>\n isIntlField(schema?.[fieldName]) ? `${fieldName}_intl` : fieldName\n );\n }\n\n // remove any duplicates\n relevantFields = uniq(relevantFields);\n\n return relevantFields;\n};\n\n// --------------------------------------------------------------------- //\n// -------------------------------- Fields ----------------------------- //\n// --------------------------------------------------------------------- //\n\nconst initField = (\n props: { model: VulcanModel; layout?: \"horizontal\" | \"vertical\" },\n state: Pick<FormState, \"currentDocument\" | \"flatSchema\" | \"originalSchema\">,\n context: any,\n fieldName: string,\n fieldSchema: VulcanFieldSchema\n) => {\n const { model } = props;\n const { currentDocument, flatSchema } = state;\n const isArray = fieldSchema.type === Array;\n\n // intialize properties\n let field: Partial<FormField> = {\n ...pick(fieldSchema, formProperties),\n name: fieldName,\n datatype: fieldSchema.type,\n layout: props.layout, // A layout property used to control how the form fields are displayed. Defaults to horizontal.\n input: fieldSchema.input || fieldSchema.control, // TODO\n };\n\n // if this is an array field also store its array item type\n if (isArray) {\n const itemFieldSchema = state.originalSchema[`${fieldName}.$`];\n field.itemDatatype = get(itemFieldSchema, \"type.0.type\");\n }\n\n field.label = getLabel(model, flatSchema, context, fieldName);\n field.intlKeys = getIntlKeys({\n fieldName,\n modelName: model.name,\n schema: model.schema,\n });\n // // replace value by prefilled value if value is empty\n // const prefill = fieldSchema.prefill || (fieldSchema.form && fieldSchema.form.prefill);\n // if (prefill) {\n // const prefilledValue = typeof prefill === 'function' ? prefill.call(fieldSchema) : prefill;\n // if (!!prefilledValue && !field.value) {\n // field.prefilledValue = prefilledValue;\n // field.value = prefilledValue;\n // }\n // }\n\n const document = currentDocument;\n field.document = document;\n\n // internationalize field options labels\n if (field.options && Array.isArray(field.options)) {\n field.options = field.options.map((option) => ({\n ...option,\n label: getOptionLabel(model, context, fieldName, option),\n }));\n }\n\n // if this an intl'd field, use a special intlInput\n if (isIntlField(fieldSchema)) {\n field.intlInput = true;\n }\n\n // add any properties specified in fieldSchema.form as extra props passed on\n // to the form component, calling them if they are functions\n const inputProperties = fieldSchema.form || fieldSchema.inputProperties || {};\n for (const prop in inputProperties) {\n const property = inputProperties[prop];\n field[prop] =\n typeof property === \"function\"\n ? property.call(fieldSchema, {\n ...props,\n fieldName,\n document,\n intl: context,\n })\n : property;\n }\n\n // add description as help prop\n const description = getDescription(model, flatSchema, context, fieldName);\n if (description) {\n field.help = description;\n }\n\n return field as FormField;\n};\nconst handleFieldPath = (\n field: FormField,\n fieldName: string,\n parentPath?: string\n) => {\n const fieldPath = parentPath ? `${parentPath}.${fieldName}` : fieldName;\n field.path = fieldPath;\n // TODO: reintroduce this side effect to correctly set the default values\n // (previously was in Form.tsx)\n // Note sure if this is actually needed\n // if (field.defaultValue) {\n // set(this.defaultValues, fieldPath, field.defaultValue);\n // }\n return field;\n};\nconst handleFieldParent = (field: FormField, parentFieldName?: string) => {\n // if field has a parent field, pass it on\n if (parentFieldName) {\n field.parentFieldName = parentFieldName;\n }\n\n return field;\n};\nconst handlePermissions = (\n field: FormField,\n fieldName: string,\n mutableFields: Array<any>\n) => {\n // if field is not creatable/updatable, disable it\n if (!mutableFields.includes(fieldName)) {\n field.disabled = true;\n }\n return field;\n};\nconst handleFieldChildren = (\n props: FormProps,\n state: Pick<FormState, \"currentDocument\" | \"flatSchema\" | \"originalSchema\">,\n context: any,\n field: FormField,\n fieldName: string,\n fieldSchema: any, // TODO: not a VulcanField, more a FormField\n schema: VulcanSchema,\n mutableFields: Array<any>\n) => {\n const { currentDocument } = state;\n // array field\n if (fieldSchema.arrayFieldSchema) {\n field.arrayFieldSchema = fieldSchema.arrayFieldSchema;\n // create a field that can be exploited by the form\n field.arrayField = createArraySubField(\n props,\n state,\n context,\n fieldName,\n field.arrayFieldSchema,\n schema,\n mutableFields\n );\n //field.nestedInput = true\n }\n // nested fields: set input to \"nested\"\n if (fieldSchema.schema) {\n field.nestedSchema = fieldSchema.schema;\n field.nestedInput = true;\n\n // get nested schema\n // for each nested field, get field object by calling createField recursively\n field.nestedFields = getFieldNames(props, currentDocument, {\n schema: field.nestedSchema,\n addExtraFields: false,\n }).map((subFieldName) => {\n return createField(\n props,\n state,\n context,\n subFieldName,\n field.nestedSchema,\n mutableFields,\n fieldName,\n field.path\n );\n });\n }\n return field;\n};\n\n/*\n Given a field's name, the containing schema, and parent, create the\n complete field object to be passed to the component\n\n */\nconst createField = (\n props: FormProps,\n state: Pick<FormState, \"currentDocument\" | \"flatSchema\" | \"originalSchema\">,\n context: any,\n fieldName: string,\n schema: any,\n mutableFields: Array<any>,\n parentFieldName?: string,\n parentPath?: string\n): FormField => {\n const fieldSchema = schema[fieldName];\n let field = initField(props, state, context, fieldName, fieldSchema);\n field = handleFieldPath(field, fieldName, parentPath);\n field = handleFieldParent(field, parentFieldName);\n field = handlePermissions(field, fieldName, mutableFields);\n field = handleFieldChildren(\n props,\n state,\n context,\n field,\n fieldName,\n fieldSchema,\n schema,\n mutableFields\n );\n return field;\n};\nconst createArraySubField = (\n props: FormProps,\n state: Pick<FormState, \"currentDocument\" | \"flatSchema\" | \"originalSchema\">,\n context: any,\n fieldName: string,\n subFieldSchema: VulcanFieldSchema,\n schema: VulcanSchema,\n mutableFields: Array<string>\n) => {\n const subFieldName = `${fieldName}.$`;\n let subField = initField(props, state, context, subFieldName, subFieldSchema);\n // array subfield has the same path and permissions as its parent\n // so we use parent name (fieldName) and not subfieldName\n subField = handleFieldPath(subField, fieldName);\n subField = handlePermissions(subField, fieldName, mutableFields /*schema*/);\n // we do not allow nesting yet\n //subField = this.handleFieldChildren(field, fieldSchema)\n return subField;\n};\n\n// Group of multiple fields (obtained by parsing the whole schema)\ninterface GroupWithFields extends FieldGroup {\n fields: Array<FormField>;\n}\n\ntype FormSchemaState = Pick<\n FormState,\n \"currentDocument\" | \"schema\" | \"flatSchema\" | \"originalSchema\"\n>;\n\n/*\n\n Get all field groups\n\n */\nexport const getFieldGroups = (\n props: FormProps,\n state: FormSchemaState,\n context: IntlProviderContextValue,\n mutableFields: Array<string>,\n formatMessage: any\n) => {\n const { schema, currentDocument } = state;\n // build fields array by iterating over the list of field names\n let fields = getFieldNames(props, currentDocument, {\n mutableFields,\n schema,\n }).map((fieldName) => {\n // get schema for the current field\n return createField(props, state, context, fieldName, schema, mutableFields);\n });\n\n fields = sortBy(fields, \"order\");\n\n // get list of all unique groups (based on their name) used in current fields, remove \"empty\" group\n let groups = compact(uniqBy(map(fields, \"group\"), (g) => (g ? g.name : \"\")));\n\n // for each group, add relevant fields\n let groupsWithFields = groups.map((group) => {\n const label =\n group.label ||\n //this.context.formatMessage({ id: group.name }) ||\n capitalize(group.name);\n const groupFields = _filter<FormField>(fields, (field) => {\n return field.group && field.group.name === group.name;\n });\n const groupWithFields: GroupWithFields = {\n ...group,\n label,\n fields: groupFields,\n };\n return groupWithFields;\n });\n\n // add default group if necessary\n const defaultGroupFields = _filter(fields, (field) => !field.group);\n if (defaultGroupFields.length) {\n const defaultGroup: GroupWithFields = {\n name: \"default\",\n label: \"default\",\n order: 0,\n fields: defaultGroupFields,\n };\n groupsWithFields = [defaultGroup].concat(groupsWithFields);\n }\n\n // sort by order\n groupsWithFields = sortBy(groupsWithFields, \"order\");\n\n // console.log(groups);\n\n return groupsWithFields;\n};\n","import find from \"lodash/find.js\";\nimport isEqualWith from \"lodash/isEqualWith.js\";\nexport const isNotSameDocument = (initialDocument, changedDocument) => {\n const changedValue = find(changedDocument, (value, key, collection) => {\n return !isEqualWith(value, initialDocument[key], (objValue, othValue) => {\n if (!objValue && !othValue) return true;\n });\n });\n return typeof changedValue !== \"undefined\";\n};\n","export * from \"./useWarnOnUnsaved\";\n","import { useBlockTransition } from \"../useBlockTransition/useBlockTransition\";\nimport debug from \"debug\";\nimport { useIntlContext } from \"@vulcanjs/react-i18n\";\nconst debugTransitions = debug(\"vn:route-transitions\");\n\n/**\n * Can trigger an alert on unsaved changes\n *\n * Triggers event so you can also block SPA transition (implementation is NOT provided by this hook, you\n * need listeners whose implementation depends on your router (React Router, Next Router...), see block.ts)\n *\n * @see https://github.com/ReactTraining/history/blob/master/docs/blocking-transitions.md\n *\n * @param param0\n */\nexport const useWarnOnUnsaved = ({\n isChanged,\n warnUnsavedChanges,\n}: {\n isChanged: boolean;\n warnUnsavedChanges?: boolean;\n}) => {\n const context = useIntlContext();\n /**\n * To be passed to onbeforeunload event. The returned message will be displayed\n * by the prompt.\n *\n * see https://developer.mozilla.org/en-US/docs/Web/API/WindowEventHandlers/onbeforeunload\n * the message returned is actually ignored by most browsers and a default message 'Are you sure you want to leave this page? You might have unsaved changes' is displayed. See the Notes section on the mozilla docs above\n */\n const getBlockedMessage = (event?: BeforeUnloadEvent) => {\n debugTransitions(\"running handlePageLeave\", event);\n const message = context.formatMessage({\n id: \"forms.confirm_discard\",\n defaultMessage: \"Are you sure you want to discard your changes?\",\n });\n return message;\n };\n useBlockTransition({\n shouldBlock: !!(warnUnsavedChanges && isChanged),\n getBlockedMessage: getBlockedMessage,\n });\n};\n","import { useEffect, useRef } from \"react\";\nimport { block } from \"./block\";\nimport debug from \"debug\";\nconst debugTransitions = debug(\"vn:router-transitions\");\n\n/**\n * Can trigger an alert on unsaved changes\n *\n * Triggers event so you can also block SPA transition (implementation is NOT provided by this hook, you\n * need listeners whose implementation depends on your router (React Router, Next Router...), see block.ts)\n *\n * @see https://github.com/ReactTraining/history/blob/master/docs/blocking-transitions.md\n *\n * @param param0\n */\nexport const useBlockTransition = ({\n shouldBlock,\n getBlockedMessage,\n}: {\n shouldBlock: boolean;\n getBlockedMessage: (evt?: BeforeUnloadEvent) => string;\n}) => {\n // function to unblock the form\n const unblockRef = useRef<Function | undefined>();\n\n useEffect(() => {\n const isBlocking = !!unblockRef.current;\n debugTransitions(\n \"running effect\",\n \"should block\",\n shouldBlock,\n \"currently blocked\",\n isBlocking\n );\n\n const onUnblock = () => {\n debugTransitions(\"running unblock from effect\");\n if (!shouldBlock) {\n if (unblockRef.current) {\n unblockRef.current();\n }\n }\n };\n // block\n const onBlocked = (evt?: BeforeUnloadEvent): string => {\n const message = getBlockedMessage(evt);\n debugTransitions(\n \"user is being blocked after trying to leave the page, with message: \" +\n message\n );\n if (evt) {\n evt.returnValue = message;\n }\n return message;\n };\n if (shouldBlock) {\n debugTransitions(\n \"should block transition, setting up relevant event listener\"\n );\n unblockRef.current = block(onBlocked, onUnblock);\n }\n // unblock if not blocking anymore and was blocking previously\n if (!shouldBlock && isBlocking) {\n debugTransitions(\"should unblock (state has been reinitialized)\");\n if (unblockRef.current) {\n unblockRef.current();\n }\n }\n // trigger the potentially registered unblock function when component unmounts\n //return onUnblock;\n }, [shouldBlock]);\n};\n","import debug from \"debug\";\nconst debugTransitions = debug(\"vn:route-transition\");\nconst BeforeUnloadEventType = \"beforeunload\";\n/**\n * Event triggered when a warning on unsaved changes is necessary\n * The app should listen for this event to setup relevant blocking methods depending on the framework\n *\n * For instance with React Router:\n *\n * let unblock\n * window.addEventListener(\"blocktransition\", () => {\n * unblock = router.history.block(...)\n * })\n * window.addEventListener(\"unblocktransition\", () => {\n * unblock()\n * })\n *\n * For Next.js, you would do something similar\n * Check https://github.com/vercel/next.js/discussions/12348\n *\n */\nexport const BLOCK_TRANSITION_EVENT_TYPE = \"blocktransition\";\n/**\n * Called when blocking is not necessary anymore:\n * - there are no unsaved changes anymore\n * - user has confirmed they want to leave\n */\nexport const UNBLOCK_TRANSITION_EVENT_TYPE = \"unblocktransition\";\n/**\n * Intercepts the beforeunload event\n *\n * Code taken from React Router history feature\n * @see https://github.com/ReactTraining/history/blob/master/docs/blocking-transitions.md\n */\nfunction blockBeforeUnload(event: BeforeUnloadEvent) {\n // Cancel the event.\n event.preventDefault();\n // Chrome (and legacy IE) requires returnValue to be set.\n event.returnValue = \"\";\n}\n\n/**\n * Blocks transition\n *\n * /!\\ In order to catch SPA transition, you need to implement\n * an event listener in your own app.\n *\n *\n * @param onUnblock Callback to call on unblock, for custom behaviour\n * @returns A function to unblock the transition (eg if the form is back to\n * its original state)\n */\nexport const block = (\n setConfirmationMessage: (event?: BeforeUnloadEvent) => string,\n onUnblock?: Function\n) => {\n debugTransitions(\"running block function\");\n // trigger a block event, to be handled at the framework level\n // TODO: setConfirmationMessage should be passed as well\n const blockEvent = new Event(BLOCK_TRANSITION_EVENT_TYPE);\n window.dispatchEvent(blockEvent);\n // block at browser level\n window.addEventListener(BeforeUnloadEventType, blockBeforeUnload);\n window.addEventListener(BeforeUnloadEventType, setConfirmationMessage);\n // return an unblock function to cancel\n const unblock = () => {\n debugTransitions(\"running unblock function\");\n if (onUnblock) {\n debugTransitions(\"running user defined function\");\n onUnblock(); // callback from user land\n }\n // trigger an unblock event, to be handled at the framework level\n const unblockEvent = new Event(UNBLOCK_TRANSITION_EVENT_TYPE);\n window.dispatchEvent(unblockEvent);\n // remove the browser level events\n window.removeEventListener(BeforeUnloadEventType, blockBeforeUnload);\n window.removeEventListener(BeforeUnloadEventType, setConfirmationMessage);\n // unblock browser change\n // @ts-ignore\n window.onbeforeunload = undefined; //undefined instead of null to support IE\n };\n return unblock;\n};\n","import { deprecate } from \"@vulcanjs/utils\";\nimport React, { useContext, useEffect } from \"react\";\nimport { VulcanComponentsContext } from \"./Context\";\n\nexport const VulcanComponentsConsumer = VulcanComponentsContext.Consumer;\n\nexport const useVulcanComponents = () => {\n const val = useContext(VulcanComponentsContext);\n return val;\n};\n\nexport const withVulcanComponents = (C) => (props) => {\n const vulcanComponents = useVulcanComponents();\n deprecate(\n \"0.0.0\",\n \"Using withVulcanComponents HOC => prefer useVulcanComponents with hooks\"\n );\n return <C vulcanComponents={vulcanComponents} {...props} />;\n};\n","import React from \"react\";\nimport type { PossibleVulcanComponents } from \"./typings\";\nimport { Dummy } from \"./Dummy\";\n\nconst dummyHandler = {\n get(target, property) {\n //console.log(\"target\", property);\n if (property in target) {\n return target[property];\n }\n console.log(\n `Property ${property} not in possible Vulcan components, returning Dummy`\n );\n return Dummy;\n },\n};\n// We need this to shut TypeScript up\n// You should use the Provider to get the right default values\nexport const VulcanComponentsContext =\n React.createContext<PossibleVulcanComponents>(\n // @ts-ignore\n new Proxy(\n {\n __not_initialized: true,\n },\n dummyHandler\n )\n );\n\n// Needed to guarantee that the exports stays named\nVulcanComponentsContext.displayName = \"VulcanComponentsContext\";\n","import React from \"react\";\nexport interface DummyProps { }\n\nexport const Dummy = () => (\n <span>\n You have not setup VulcanComponentsProvider. Please add following code in\n your app:{\" \"}\n <code>{`import { VulcanComponentsProvider } from \"@vulcanjs/react-ui\"; const YourApp = <VulcanComponentsProvider>{/* your app */}</VulcanComponentsProvider>;}`}</code>\n </span>\n);\n","import type {\n CreateVariables,\n UpdateVariables,\n DeleteVariables,\n} from \"@vulcanjs/crud\";\nimport { VulcanModel } from \"@vulcanjs/model\";\nimport { VulcanUser } from \"@vulcanjs/permissions\";\nimport { VulcanSchema } from \"@vulcanjs/schema\";\nimport { DocumentNode } from \"graphql\";\n\nexport interface FormState {\n schema: any;\n initialDocument: Object;\n currentDocument: Object;\n deletedValues: any;\n errors: any;\n currentValues: any;\n disabled: any;\n success?: any;\n flatSchema: any;\n originalSchema: any;\n}\n\n/**\n * Props that can be passed to the FormContainer (= SmartForm)\n * and will be passed down to the Form\n *\n * TODO: this might not be complete yet. We need to move relevant props from \"FormProps\" to this type,\n * based on current usage of the SmartForm in existing apps\n */\nexport interface PassedDownFormProps {\n itemProperties?: Object;\n showDelete?: boolean;\n /**\n * Disable the form\n */\n disabled?: boolean;\n /**\n * Will prevent leaving the page/unmounting the form on unsaved changes\n */\n warnUnsavedChanges?: boolean;\n /*A callback called on form submission on the form data. Can return the submitted data object as well.*/\n submitCallback?: (data) => any;\n /*A callback called on mutation success.*/\n successCallback?: (document, meta: { form: any }) => void;\n /*A callback called on mutation failure.*/\n errorCallback?: (document, error, meta: { form: any }) => void;\n\n // Fragments\n /**\n * A GraphQL fragment used to specify the data to fetch to populate edit forms.\n * If no fragment is passed, SmartForm will do its best to figure out what data to load based on the fields included in the form.\n *\n * Can be either a string or a DocumentNode (using \"gql\" tag)\n */\n queryFragment?: DocumentNode | string;\n /**\n * A GraphQL fragment used to specify the data to return once a mutation is complete.\n\nIf no fragment is passed, SmartForm will only return fields used in the form, but note that this might sometimes lead to discrepancies when compared with documents already loaded on the client.\n\nAn example would be a createdAt date added automatically on creation even though it’s not part of the actual form. If you’d like that field to be returned after the mutation, you can define a custom mutationFragment that includes it explicitly.\n\n * Can be either a string or a DocumentNode (using \"gql\" tag)\n*/\n mutationFragment?: DocumentNode | string;\n /** Force a query fragment name\n *\n * NOTE: needed only for string fragments\n * If you use a DocumentNode (with \"gql\" tag), it will be computed automatically\n *\n * @deprecated Prefer using DocumentNode fragment, using the gql tag\n */\n queryFragmentName?: string;\n /** Force a mutation fragment name\n *\n *NOTE: needed only for string fragments\n *If you use a DocumentNode (with \"gql\" tag), it will be computed automatically\n *\n * @deprecated Prefer using DocumentNode fragment, using the gql tag\n */\n mutationFragmentName?: string;\n}\n\nexport interface FormProps<TModel = { [key in string]: any }>\n extends PassedDownFormProps {\n /**\n * Function that retriggers data fetching in edit mode\n * Usually provided by the useSingle but could be any function\n */\n refetch?: () => void;\n /**\n * Document id in update mode\n */\n id?: string;\n /* The model in which to edit or insert a document. */\n model: VulcanModel;\n /** Passing directly a raw schema (TODO: model is still mandatory atm) */\n schema?: VulcanSchema;\n /**\n * Passing directly a document (TODO: not yet tested in the new version)\n */\n document?: any;\n /**\n * currentUser to check authorizations to update/create some fields\n */\n currentUser?: VulcanUser;\n addFields?: Array<string>;\n removeFields?: Array<string>;\n // deprecated\n //hideFields?: any;\n /**\n * Label so that graphql queries are contextualized\n */\n contextName?: string;\n // labels\n cancelLabel?: string;\n revertLabel?: string;\n //\n revertCallback?: Function;\n // TODO: probably should be removed\n successComponent?: any;\n /* Instead of passing collection you can pass the name of the collection.*/\n // collectionName?: string;\n /*If present, the document to edit. If not present, the form will be a “new document” form.*/\n documentId?: string;\n /*An array of field names, if you want to restrict the form to a specific set of fields.*/\n fields?: Array<keyof TModel>;\n /*The text inside the submit button of the form.*/\n submitLabel?: string;\n /*A layout property used to control how the form fields are displayed. Defaults to horizontal.*/\n layout?: \"horizontal\" | \"vertical\";\n /*Whether to show a “delete document” link on edit forms.*/\n showRemove?: boolean;\n /*A set of props used to prefill the form. */\n prefilledProps?: TModel & Object; // TODO: should it allow only fields from the Model or also additional fields?\n /*Whether to repeat validation errors at the bottom of the form.*/\n repeatErrors?: boolean;\n //Callbacks\n /** Callback ran on first render */\n initCallback?: Function;\n /*If a cancelCallback function is provided, a “cancel” link will be shown next to the form’s submit button and the callback will be called on click.*/\n cancelCallback?: (document) => void;\n /*A callback to call when a document is successfully removed (deleted).*/\n removeSuccessCallback?: (document) => void;\n\n /*A callback called a every change or blur event inside the form.*/\n changeCallback: (currentDocument) => void;\n\n // mutations from container\n // => replace the \"onSubmit\" of a normal form\n /**\n * The result is usually extracted from a graphql mutation\n * But we have a simplified abstracted API, so we could also use the Form without graphql\n */\n createDocument: <TModel = any>(\n createVars: CreateVariables\n ) => Promise<CreateDocumentResult<TModel>>;\n updateDocument: <TModel = any>(\n vars: UpdateVariables\n ) => Promise<UpdateDocumentResult<TModel>>;\n deleteDocument: (vars: DeleteVariables) => Promise<void>;\n // Other results from the Apollo query => should be ignored, in order to avoid dependency to graphql in the Form\n // instead the container is responsible for passing errors and stuff\n // createDocumentMeta?: { error?: any };\n // updateDocumentMeta?: { error?: any };\n // EXPERIMENTAL: allowing to manually set the form children\n children?: React.ReactNode;\n}\n\nexport interface CreateDocumentResult<TDocument = any> {\n document: TDocument;\n errors: Array<any>;\n}\n\nexport interface UpdateDocumentResult<TDocument = any> {\n document: TDocument;\n errors: Array<any>;\n}\n","/*\n\nFormContainer aka SmartForm\n\nChanges compared to Vulcan Meteor:\n\n- previously was named FormWrapper\n- accepts a model instead of collection\n- no queryFragmentName (resp. mutation name), instead you need to pass the fragment explicitely\n\nTechnically, this is a GraphqlSmartForm, while Form.tsx is the more\ngeneric SmartForm, or a \"ModelForm\".\n\n\n---\n\nGenerate the appropriate fragment for the current form, then\nwrap the main Form component with the necessary HoCs while passing\nthem the fragment.\n\nThis component is itself wrapped with:\n\n- withCurrentUser\n- withApollo (used to access the Apollo client for form pre-population)\n\nAnd wraps the Form component with:\n\n- withNew\n\nOr:\n\n- withSingle\n- withUpdate\n- withDelete\n\n(When wrapping with withSingle, withUpdate, and withDelete, a special Loader\ncomponent is also added to wait for withSingle's loading prop to be false)\n\n*/\nimport React, { useRef } from \"react\";\n// import // withCurrentUser,\n// Utils,\n// getFragment,\n//\"meteor/vulcan:core\";\nimport { DocumentNode } from \"@apollo/client\";\nimport gql from \"graphql-tag\";\n\nimport getFormFragments from \"../utils/formFragments\";\n// import { VulcanModel } from \"@vulcanjs/model\";\nimport { VulcanGraphqlModel, getFragmentName } from \"@vulcanjs/graphql\";\nimport type {\n CreateVariables,\n UpdateVariables,\n DeleteVariables,\n} from \"@vulcanjs/crud\";\nimport { capitalize } from \"@vulcanjs/utils\";\nimport {\n useSingle,\n useCreate,\n useUpdate,\n useDelete,\n UseSingleOptions,\n} from \"@vulcanjs/react-hooks\";\nimport { FetchResult } from \"@apollo/client\";\n// import { FormType } from \"./typings\";\nimport { debugVulcan } from \"@vulcanjs/utils\";\nimport { VulcanUser } from \"@vulcanjs/permissions\";\nimport { PassedDownFormProps } from \"./Form/typings\";\n// Be careful to import from the Consumer!\nimport { useVulcanComponents } from \"../../VulcanComponents/Consumer\";\nimport { useVulcanCurrentUser } from \"../../VulcanCurrentUser\";\nconst debugForm = debugVulcan(\"form\");\n\n// Mutation that yield a success result\ntype SuccessfulFetchResult<TData = Object> = FetchResult<TData> & {\n data: TData;\n};\n/**\n * Typeguared to allow considering the request as successful\n */\nconst isSuccessful = function <T = any>(\n result: FetchResult<T> | undefined\n): result is SuccessfulFetchResult<T> {\n return !!result?.data;\n};\n\nexport interface FormContainerProps extends PassedDownFormProps {\n model: VulcanGraphqlModel;\n /** Document id for edition mode, will automatically fetch the document */\n documentId?: string;\n /** Slug (= human readable unique id) for edition mode, will automatically fetch the document */\n slug?: string;\n /**\n * List only those fields in the form\n */\n fields?: Array<string>;\n /**\n * List default fields + those additional fields as well\n */\n addFields?: Array<string>;\n /**\n * Force a currentUser, overriding the currentUser obtained\n * via Context\n *\n * If you use many forms in your app,\n * it might be better to set VulcanCurrentUserContext\n * at the top-level of your app\n * (eg in \"pages/_app.js\" for Next.js)\n */\n currentUser?: VulcanUser | null;\n loadingCurrentUser?: boolean;\n}\nexport type SmartFormProps = FormContainerProps;\n\nconst useFragments = (\n props: Pick<\n FormContainerProps,\n | \"mutationFragment\"\n | \"mutationFragmentName\"\n | \"queryFragment\"\n | \"queryFragmentName\"\n // for auto generation\n | \"model\"\n | \"fields\"\n | \"addFields\"\n >,\n formType: \"edit\" | \"new\"\n) => {\n // get fragment used to decide what data to load from the server to populate the form,\n // as well as what data to ask for as return value for the mutation\n // TODO: move out of the component\n //const getFragments = () => {\n let queryFragment: DocumentNode | undefined;\n let queryFragmentName: string | undefined;\n let mutationFragment: DocumentNode | undefined;\n let mutationFragmentName: string | undefined;\n\n // if queryFragment or mutationFragment props are specified, accept either fragment object or fragment string\n // TODO: not sure we actually need that, gApollo accepts fragments or string normally\n if (props.queryFragment) {\n if (typeof props.queryFragment === \"string\") {\n queryFragment = gql`\n ${props.queryFragment}\n `;\n if (!props.queryFragmentName)\n throw new Error(\n \"When using a string queryFragment, queryFragmentName is mandatory\"\n );\n queryFragmentName = props.queryFragmentName;\n } else {\n // DocumentNode\n queryFragment = props.queryFragment;\n // automatically compute the fragment name\n queryFragmentName =\n props.queryFragmentName || getFragmentName(props.queryFragment);\n }\n }\n if (props.mutationFragment) {\n if (typeof props.mutationFragment === \"string\") {\n mutationFragment = gql`\n ${props.mutationFragment}\n `;\n if (!props.mutationFragmentName)\n throw new Error(\n \"When using a string mutationFragment, mutationFragmentName is mandatory\"\n );\n queryFragmentName = props.mutationFragmentName;\n } else {\n // DocumentNode\n mutationFragment = props.mutationFragment;\n // automatically compute the fragment name\n mutationFragmentName =\n props.mutationFragmentName || getFragmentName(props.mutationFragment);\n }\n }\n // auto generate fragments\n let autoFormFragments;\n if (!props.queryFragment || !props.mutationFragment) {\n const { model, fields, addFields } = props;\n // autogenerated fragments\n autoFormFragments = getFormFragments({\n formType,\n model,\n fields,\n addFields,\n });\n }\n // use autogenerated value if necessary\n if (!props.queryFragment) {\n queryFragment = autoFormFragments.queryFragment;\n queryFragmentName = autoFormFragments.queryFragmentName;\n }\n if (!props.mutationFragment) {\n mutationFragment = autoFormFragments.mutationFragment;\n mutationFragmentName = autoFormFragments.mutationFragmentName;\n }\n return {\n mutationFragment: mutationFragment as DocumentNode,\n mutationFragmentName: mutationFragmentName as string,\n queryFragment: queryFragment as DocumentNode,\n queryFragmentName: queryFragmentName as string,\n };\n};\n// Fonctionnal version to be able to use hooks\nexport const FormContainer = (props: FormContainerProps) => {\n const {\n model,\n documentId,\n slug,\n fields,\n addFields,\n currentUser: currentUserFromProps,\n loadingCurrentUser: loadingCurrentUserFromProps,\n } = props;\n const { schema } = model;\n // if a document is being passed, this is an edit form\n const isEdit = documentId || slug;\n const selector = {\n documentId,\n slug,\n };\n const formType = isEdit ? \"edit\" : \"new\";\n const VulcanComponents = useVulcanComponents();\n\n // get query & mutation fragments from props or else default to same as generatedFragment\n //return {\n // queryFragment,\n // mutationFragment,\n //};\n //}\n\n const prefix = `${model.name}${capitalize(formType)}`;\n // props to pass on to child component (i.e. <Form />)\n const childProps = {\n formType,\n schema,\n };\n\n const {\n mutationFragment,\n mutationFragmentName,\n queryFragment,\n queryFragmentName,\n } = useFragments(props, formType);\n\n // options for useCreate, useUpdate and useDelete\n const mutationOptions = {\n model,\n // collection: this.props.collection,\n fragment: mutationFragment,\n fragmentName: mutationFragmentName,\n };\n\n const queryOptions: UseSingleOptions<any> = {\n model,\n // TODO: what this option does?\n // queryName: `${prefix}FormQuery`,\n fragment: queryFragment,\n fragmentName: queryFragmentName,\n // fragmentName?\n input: {\n id: documentId,\n enableCache: false,\n // TODO: support slug\n },\n queryOptions: {\n // we always want to load a fresh copy of the document\n fetchPolicy: \"network-only\" as \"network-only\", // cast is for fixing annoying TS issue... https://github.com/vuejs/vue-apollo/issues/936\n pollInterval: 0, // no polling, only load data once\n skip: formType === \"new\",\n },\n };\n /* debug\n console.log(\n \"MUT\",\n (mutationFragment as any).loc.source.body,\n mutationFragmentName\n );\n console.log(\n \"QUERY\",\n (queryFragment as any).loc.source.body,\n queryFragmentName\n );*/\n const { data, document, loading, refetch } = useSingle(queryOptions);\n if (formType !== \"new\") {\n debugForm(\n \"useSingle result\",\n \"data\",\n data,\n \"document\",\n document,\n \"loading\",\n loading\n );\n }\n // TODO: pass the creation functions down to the Form\n const [createDocument] = useCreate(mutationOptions);\n const [updateDocument] = useUpdate(mutationOptions);\n const [deleteDocument] = useDelete(mutationOptions);\n\n const {\n currentUser: currentUserFromContext,\n loading: loadingCurrentUserFromContext,\n } = useVulcanCurrentUser();\n const shouldGetCurrentUserFromProps =\n typeof currentUserFromProps !== \"undefined\";\n const currentUser = shouldGetCurrentUserFromProps\n ? currentUserFromProps\n : currentUserFromContext;\n const loadingCurrentUser = shouldGetCurrentUserFromProps\n ? loadingCurrentUserFromProps\n : loadingCurrentUserFromContext;\n\n // callbacks\n /*\n const formRef = useRef(null);\n const newMutationSuccessCallback = function <TData = Object>(\n result: SuccessfulFetchResult<TData>\n ) {\n getDocumentFromResult(result, \"new\");\n };\n const editMutationSuccessCallback = function <TData = Object>(\n result: SuccessfulFetchResult<TData>\n ) {\n getDocumentFromResult(result, \"edit\");\n };\n */\n\n /*\n The create hook already creates a document prop in a more stable way\n const getDocumentFromResult = function <TData = Object>(\n // must be called only on valid results\n result: SuccessfulFetchResult<TData> | undefined\n ) {\n if (!result) return undefined;\n // TODO: quite risky... we should have a better way to get the document\n let document = result.data[Object.keys(result.data)[0]].data; // document is always on first property\n\n return document;\n };*/\n // for new mutation, run refetch function if it exists\n /*\n if (mutationType === \"new\" && refetch) refetch();\n */\n\n const createAndReturnDocument = async (variables: CreateVariables) => {\n const result = await createDocument(variables);\n const { errors, document } = result;\n return {\n document,\n errors,\n };\n };\n const updateAndReturnDocument = async (variables: UpdateVariables) => {\n const result = await updateDocument(variables);\n const { errors, document } = result;\n return {\n document,\n errors,\n };\n };\n\n const deleteDocumentAndRefetch = async (variables: DeleteVariables) => {\n await deleteDocument(variables as any);\n };\n\n if (isEdit && loading) {\n return <VulcanComponents.Loading />;\n }\n return (\n <VulcanComponents.Form\n document={document}\n loading={loading || loadingCurrentUser}\n createDocument={createAndReturnDocument /*createDocument*/}\n updateDocument={updateAndReturnDocument}\n deleteDocument={deleteDocumentAndRefetch}\n refetch={refetch}\n currentUser={currentUser}\n {...childProps}\n {...props}\n />\n );\n};\n\n/*\nFormContainer.propTypes = {\n // main options\n documentId: PropTypes.string, // if a document is passed, this will be an edit form\n mutationFragment: PropTypes.object,\n mutationFragmentName: PropTypes.string,\n\n // graphQL\n // createFoo, deleteFoo, updateFoo\n // newMutation: PropTypes.func, // the new mutation\n // editMutation: PropTypes.func, // the edit mutation\n // removeMutation: PropTypes.func, // the remove mutation\n\n // form\n prefilledProps: PropTypes.object,\n layout: PropTypes.string,\n fields: PropTypes.arrayOf(PropTypes.string),\n hideFields: PropTypes.arrayOf(PropTypes.string),\n addFields: PropTypes.arrayOf(PropTypes.string),\n showRemove: PropTypes.bool,\n submitLabel: PropTypes.node,\n cancelLabel: PropTypes.node,\n revertLabel: PropTypes.node,\n repeatErrors: PropTypes.bool,\n warnUnsavedChanges: PropTypes.bool,\n formComponents: PropTypes.object,\n disabled: PropTypes.bool,\n itemProperties: PropTypes.object,\n successComponent: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),\n contextName: PropTypes.string,\n\n // callbacks\n ...callbackProps,\n\n currentUser: PropTypes.object,\n client: PropTypes.object,\n};\n\nFormContainer.defaultProps = {\n layout: \"horizontal\",\n};\n*/\n\n/*\nregisterComponent({\n name: 'SmartForm',\n component: FormContainer,\n hocs: [withCurrentUser, withApollo, withRouter, withCollectionProps],\n});\n*/\n\nexport const SmartForm = FormContainer;\n\nexport default FormContainer;\n","import { __assign } from \"tslib\";\nimport { parse } from 'graphql';\nvar docCache = new Map();\nvar fragmentSourceMap = new Map();\nvar printFragmentWarnings = true;\nvar experimentalFragmentVariables = false;\nfunction normalize(string) {\n return string.replace(/[\\s,]+/g, ' ').trim();\n}\nfunction cacheKeyFromLoc(loc) {\n return normalize(loc.source.body.substring(loc.start, loc.end));\n}\nfunction processFragments(ast) {\n var seenKeys = new Set();\n var definitions = [];\n ast.definitions.forEach(function (fragmentDefinition) {\n if (fragmentDefinition.kind === 'FragmentDefinition') {\n var fragmentName = fragmentDefinition.name.value;\n var sourceKey = cacheKeyFromLoc(fragmentDefinition.loc);\n var sourceKeySet = fragmentSourceMap.get(fragmentName);\n if (sourceKeySet && !sourceKeySet.has(sourceKey)) {\n if (printFragmentWarnings) {\n console.warn(\"Warning: fragment with name \" + fragmentName + \" already exists.\\n\"\n + \"graphql-tag enforces all fragment names across your application to be unique; read more about\\n\"\n + \"this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names\");\n }\n }\n else if (!sourceKeySet) {\n fragmentSourceMap.set(fragmentName, sourceKeySet = new Set);\n }\n sourceKeySet.add(sourceKey);\n if (!seenKeys.has(sourceKey)) {\n seenKeys.add(sourceKey);\n definitions.push(fragmentDefinition);\n }\n }\n else {\n definitions.push(fragmentDefinition);\n }\n });\n return __assign(__assign({}, ast), { definitions: definitions });\n}\nfunction stripLoc(doc) {\n var workSet = new Set(doc.definitions);\n workSet.forEach(function (node) {\n if (node.loc)\n delete node.loc;\n Object.keys(node).forEach(function (key) {\n var value = node[key];\n if (value && typeof value === 'object') {\n workSet.add(value);\n }\n });\n });\n var loc = doc.loc;\n if (loc) {\n delete loc.startToken;\n delete loc.endToken;\n }\n return doc;\n}\nfunction parseDocument(source) {\n var cacheKey = normalize(source);\n if (!docCache.has(cacheKey)) {\n var parsed = parse(source, {\n experimentalFragmentVariables: experimentalFragmentVariables,\n allowLegacyFragmentVariables: experimentalFragmentVariables\n });\n if (!parsed || parsed.kind !== 'Document') {\n throw new Error('Not a valid GraphQL document.');\n }\n docCache.set(cacheKey, stripLoc(processFragments(parsed)));\n }\n return docCache.get(cacheKey);\n}\nexport function gql(literals) {\n var args = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n args[_i - 1] = arguments[_i];\n }\n if (typeof literals === 'string') {\n literals = [literals];\n }\n var result = literals[0];\n args.forEach(function (arg, i) {\n if (arg && arg.kind === 'Document') {\n result += arg.loc.source.body;\n }\n else {\n result += arg;\n }\n result += literals[i + 1];\n });\n return parseDocument(result);\n}\nexport function resetCaches() {\n docCache.clear();\n fragmentSourceMap.clear();\n}\nexport function disableFragmentWarnings() {\n printFragmentWarnings = false;\n}\nexport function enableExperimentalFragmentVariables() {\n experimentalFragmentVariables = true;\n}\nexport function disableExperimentalFragmentVariables() {\n experimentalFragmentVariables = false;\n}\nvar extras = {\n gql: gql,\n resetCaches: resetCaches,\n disableFragmentWarnings: disableFragmentWarnings,\n enableExperimentalFragmentVariables: enableExperimentalFragmentVariables,\n disableExperimentalFragmentVariables: disableExperimentalFragmentVariables\n};\n(function (gql_1) {\n gql_1.gql = extras.gql, gql_1.resetCaches = extras.resetCaches, gql_1.disableFragmentWarnings = extras.disableFragmentWarnings, gql_1.enableExperimentalFragmentVariables = extras.enableExperimentalFragmentVariables, gql_1.disableExperimentalFragmentVariables = extras.disableExperimentalFragmentVariables;\n})(gql || (gql = {}));\ngql[\"default\"] = gql;\nexport default gql;\n//# sourceMappingURL=index.js.map","import tslib from '../tslib.js';\r\nconst {\r\n __extends,\r\n __assign,\r\n __rest,\r\n __decorate,\r\n __param,\r\n __metadata,\r\n __awaiter,\r\n __generator,\r\n __exportStar,\r\n __createBinding,\r\n __values,\r\n __read,\r\n __spread,\r\n __spreadArrays,\r\n __spreadArray,\r\n __await,\r\n __asyncGenerator,\r\n __asyncDelegator,\r\n __asyncValues,\r\n __makeTemplateObject,\r\n __importStar,\r\n __importDefault,\r\n __classPrivateFieldGet,\r\n __classPrivateFieldSet,\r\n __classPrivateFieldIn,\r\n} = tslib;\r\nexport {\r\n __extends,\r\n __assign,\r\n __rest,\r\n __decorate,\r\n __param,\r\n __metadata,\r\n __awaiter,\r\n __generator,\r\n __exportStar,\r\n __createBinding,\r\n __values,\r\n __read,\r\n __spread,\r\n __spreadArrays,\r\n __spreadArray,\r\n __await,\r\n __asyncGenerator,\r\n __asyncDelegator,\r\n __asyncValues,\r\n __makeTemplateObject,\r\n __importStar,\r\n __importDefault,\r\n __classPrivateFieldGet,\r\n __classPrivateFieldSet,\r\n __classPrivateFieldIn,\r\n};\r\n","/**\n * GraphQL.js provides a reference implementation for the GraphQL specification\n * but is also a useful utility for operating on GraphQL files and building\n * sophisticated tools.\n *\n * This primary module exports a general purpose function for fulfilling all\n * steps of the GraphQL specification in a single operation, but also includes\n * utilities for every part of the GraphQL specification:\n *\n * - Parsing the GraphQL language.\n * - Building a GraphQL type schema.\n * - Validating a GraphQL request against a type schema.\n * - Executing a GraphQL request against a type schema.\n *\n * This also includes utility functions for operating on GraphQL types and\n * GraphQL documents to facilitate building tools.\n *\n * You may also import from each sub-directory directly. For example, the\n * following two import statements are equivalent:\n *\n * import { parse } from 'graphql';\n * import { parse } from 'graphql/language';\n */\n// The GraphQL.js version info.\nexport { version, versionInfo } from \"./version.mjs\"; // The primary entry point into fulfilling a GraphQL request.\n\nexport { graphql, graphqlSync } from \"./graphql.mjs\"; // Create and operate on GraphQL type definitions and schema.\n\nexport { // Definitions\nGraphQLSchema, GraphQLDirective, GraphQLScalarType, GraphQLObjectType, GraphQLInterfaceType, GraphQLUnionType, GraphQLEnumType, GraphQLInputObjectType, GraphQLList, GraphQLNonNull // Standard GraphQL Scalars\n, specifiedScalarTypes, GraphQLInt, GraphQLFloat, GraphQLString, GraphQLBoolean, GraphQLID // Built-in Directives defined by the Spec\n, specifiedDirectives, GraphQLIncludeDirective, GraphQLSkipDirective, GraphQLDeprecatedDirective, GraphQLSpecifiedByDirective // \"Enum\" of Type Kinds\n, TypeKind // Constant Deprecation Reason\n, DEFAULT_DEPRECATION_REASON // GraphQL Types for introspection.\n, introspectionTypes, __Schema, __Directive, __DirectiveLocation, __Type, __Field, __InputValue, __EnumValue, __TypeKind // Meta-field definitions.\n, SchemaMetaFieldDef, TypeMetaFieldDef, TypeNameMetaFieldDef // Predicates\n, isSchema, isDirective, isType, isScalarType, isObjectType, isInterfaceType, isUnionType, isEnumType, isInputObjectType, isListType, isNonNullType, isInputType, isOutputType, isLeafType, isCompositeType, isAbstractType, isWrappingType, isNullableType, isNamedType, isRequiredArgument, isRequiredInputField, isSpecifiedScalarType, isIntrospectionType, isSpecifiedDirective // Assertions\n, assertSchema, assertDirective, assertType, assertScalarType, assertObjectType, assertInterfaceType, assertUnionType, assertEnumType, assertInputObjectType, assertListType, assertNonNullType, assertInputType, assertOutputType, assertLeafType, assertCompositeType, assertAbstractType, assertWrappingType, assertNullableType, assertNamedType // Un-modifiers\n, getNullableType, getNamedType // Validate GraphQL schema.\n, validateSchema, assertValidSchema } from \"./type/index.mjs\";\n// Parse and operate on GraphQL language source files.\nexport { Token, Source, Location, getLocation // Print source location\n, printLocation, printSourceLocation // Lex\n, Lexer, TokenKind // Parse\n, parse, parseValue, parseType // Print\n, print // Visit\n, visit, visitInParallel, getVisitFn, BREAK, Kind, DirectiveLocation // Predicates\n, isDefinitionNode, isExecutableDefinitionNode, isSelectionNode, isValueNode, isTypeNode, isTypeSystemDefinitionNode, isTypeDefinitionNode, isTypeSystemExtensionNode, isTypeExtensionNode } from \"./language/index.mjs\";\n// Execute GraphQL queries.\nexport { execute, executeSync, defaultFieldResolver, defaultTypeResolver, responsePathAsArray, getDirectiveValues } from \"./execution/index.mjs\";\nexport { subscribe, createSourceEventStream } from \"./subscription/index.mjs\";\n// Validate GraphQL documents.\nexport { validate, ValidationContext // All validation rules in the GraphQL Specification.\n, specifiedRules // Individual validation rules.\n, ExecutableDefinitionsRule, FieldsOnCorrectTypeRule, FragmentsOnCompositeTypesRule, KnownArgumentNamesRule, KnownDirectivesRule, KnownFragmentNamesRule, KnownTypeNamesRule, LoneAnonymousOperationRule, NoFragmentCyclesRule, NoUndefinedVariablesRule, NoUnusedFragmentsRule, NoUnusedVariablesRule, OverlappingFieldsCanBeMergedRule, PossibleFragmentSpreadsRule, ProvidedRequiredArgumentsRule, ScalarLeafsRule, SingleFieldSubscriptionsRule, UniqueArgumentNamesRule, UniqueDirectivesPerLocationRule, UniqueFragmentNamesRule, UniqueInputFieldNamesRule, UniqueOperationNamesRule, UniqueVariableNamesRule, ValuesOfCorrectTypeRule, VariablesAreInputTypesRule, VariablesInAllowedPositionRule // SDL-specific validation rules\n, LoneSchemaDefinitionRule, UniqueOperationTypesRule, UniqueTypeNamesRule, UniqueEnumValueNamesRule, UniqueFieldDefinitionNamesRule, UniqueDirectiveNamesRule, PossibleTypeExtensionsRule // Custom validation rules\n, NoDeprecatedCustomRule, NoSchemaIntrospectionCustomRule } from \"./validation/index.mjs\";\n// Create, format, and print GraphQL errors.\nexport { GraphQLError, syntaxError, locatedError, printError, formatError } from \"./error/index.mjs\";\n// Utilities for operating on GraphQL type schema and parsed sources.\nexport { // Produce the GraphQL query recommended for a full schema introspection.\n// Accepts optional IntrospectionOptions.\ngetIntrospectionQuery // Gets the target Operation from a Document.\n, getOperationAST // Gets the Type for the target Operation AST.\n, getOperationRootType // Convert a GraphQLSchema to an IntrospectionQuery.\n, introspectionFromSchema // Build a GraphQLSchema from an introspection result.\n, buildClientSchema // Build a GraphQLSchema from a parsed GraphQL Schema language AST.\n, buildASTSchema // Build a GraphQLSchema from a GraphQL schema language document.\n, buildSchema // @deprecated: Get the description from a schema AST node and supports legacy\n// syntax for specifying descriptions - will be removed in v16.\n, getDescription // Extends an existing GraphQLSchema from a parsed GraphQL Schema\n// language AST.\n, extendSchema // Sort a GraphQLSchema.\n, lexicographicSortSchema // Print a GraphQLSchema to GraphQL Schema language.\n, printSchema // Print a GraphQLType to GraphQL Schema language.\n, printType // Prints the built-in introspection schema in the Schema Language\n// format.\n, printIntrospectionSchema // Create a GraphQLType from a GraphQL language AST.\n, typeFromAST // Create a JavaScript value from a GraphQL language AST with a Type.\n, valueFromAST // Create a JavaScript value from a GraphQL language AST without a Type.\n, valueFromASTUntyped // Create a GraphQL language AST from a JavaScript value.\n, astFromValue // A helper to use within recursive-descent visitors which need to be aware of\n// the GraphQL type system.\n, TypeInfo, visitWithTypeInfo // Coerces a JavaScript value to a GraphQL type, or produces errors.\n, coerceInputValue // Concatenates multiple AST together.\n, concatAST // Separates an AST into an AST per Operation.\n, separateOperations // Strips characters that are not significant to the validity or execution\n// of a GraphQL document.\n, stripIgnoredCharacters // Comparators for types\n, isEqualType, isTypeSubTypeOf, doTypesOverlap // Asserts a string is a valid GraphQL name.\n, assertValidName // Determine if a string is a valid GraphQL name.\n, isValidNameError // Compares two GraphQLSchemas and detects breaking changes.\n, BreakingChangeType, DangerousChangeType, findBreakingChanges, findDangerousChanges // @deprecated: Report all deprecated usage within a GraphQL document.\n, findDeprecatedUsages } from \"./utilities/index.mjs\";\n","import { syntaxError } from \"../error/syntaxError.mjs\";\nimport { Kind } from \"./kinds.mjs\";\nimport { Location } from \"./ast.mjs\";\nimport { TokenKind } from \"./tokenKind.mjs\";\nimport { Source, isSource } from \"./source.mjs\";\nimport { DirectiveLocation } from \"./directiveLocation.mjs\";\nimport { Lexer, isPunctuatorTokenKind } from \"./lexer.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 var parser = new Parser(source, options);\n return parser.parseDocument();\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 var parser = new Parser(source, options);\n parser.expectToken(TokenKind.SOF);\n var value = parser.parseValueLiteral(false);\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 var parser = new Parser(source, options);\n parser.expectToken(TokenKind.SOF);\n var type = parser.parseTypeReference();\n parser.expectToken(TokenKind.EOF);\n return type;\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 var Parser = /*#__PURE__*/function () {\n function Parser(source, options) {\n var sourceObj = isSource(source) ? source : new Source(source);\n this._lexer = new Lexer(sourceObj);\n this._options = options;\n }\n /**\n * Converts a name lex token into a name parse node.\n */\n\n\n var _proto = Parser.prototype;\n\n _proto.parseName = function parseName() {\n var token = this.expectToken(TokenKind.NAME);\n return {\n kind: Kind.NAME,\n value: token.value,\n loc: this.loc(token)\n };\n } // Implements the parsing rules in the Document section.\n\n /**\n * Document : Definition+\n */\n ;\n\n _proto.parseDocument = function parseDocument() {\n var start = this._lexer.token;\n return {\n kind: Kind.DOCUMENT,\n definitions: this.many(TokenKind.SOF, this.parseDefinition, TokenKind.EOF),\n loc: this.loc(start)\n };\n }\n /**\n * Definition :\n * - ExecutableDefinition\n * - TypeSystemDefinition\n * - TypeSystemExtension\n *\n * ExecutableDefinition :\n * - OperationDefinition\n * - FragmentDefinition\n */\n ;\n\n _proto.parseDefinition = function parseDefinition() {\n if (this.peek(TokenKind.NAME)) {\n switch (this._lexer.token.value) {\n case 'query':\n case 'mutation':\n case 'subscription':\n return this.parseOperationDefinition();\n\n case 'fragment':\n return this.parseFragmentDefinition();\n\n case 'schema':\n case 'scalar':\n case 'type':\n case 'interface':\n case 'union':\n case 'enum':\n case 'input':\n case 'directive':\n return this.parseTypeSystemDefinition();\n\n case 'extend':\n return this.parseTypeSystemExtension();\n }\n } else if (this.peek(TokenKind.BRACE_L)) {\n return this.parseOperationDefinition();\n } else if (this.peekDescription()) {\n return this.parseTypeSystemDefinition();\n }\n\n throw this.unexpected();\n } // Implements the parsing rules in the Operations section.\n\n /**\n * OperationDefinition :\n * - SelectionSet\n * - OperationType Name? VariableDefinitions? Directives? SelectionSet\n */\n ;\n\n _proto.parseOperationDefinition = function parseOperationDefinition() {\n var start = this._lexer.token;\n\n if (this.peek(TokenKind.BRACE_L)) {\n return {\n kind: Kind.OPERATION_DEFINITION,\n operation: 'query',\n name: undefined,\n variableDefinitions: [],\n directives: [],\n selectionSet: this.parseSelectionSet(),\n loc: this.loc(start)\n };\n }\n\n var operation = this.parseOperationType();\n var name;\n\n if (this.peek(TokenKind.NAME)) {\n name = this.parseName();\n }\n\n return {\n kind: Kind.OPERATION_DEFINITION,\n operation: operation,\n name: name,\n variableDefinitions: this.parseVariableDefinitions(),\n directives: this.parseDirectives(false),\n selectionSet: this.parseSelectionSet(),\n loc: this.loc(start)\n };\n }\n /**\n * OperationType : one of query mutation subscription\n */\n ;\n\n _proto.parseOperationType = function parseOperationType() {\n var operationToken = this.expectToken(TokenKind.NAME);\n\n switch (operationToken.value) {\n case 'query':\n return 'query';\n\n case 'mutation':\n return 'mutation';\n\n case 'subscription':\n return 'subscription';\n }\n\n throw this.unexpected(operationToken);\n }\n /**\n * VariableDefinitions : ( VariableDefinition+ )\n */\n ;\n\n _proto.parseVariableDefinitions = function parseVariableDefinitions() {\n return this.optionalMany(TokenKind.PAREN_L, this.parseVariableDefinition, TokenKind.PAREN_R);\n }\n /**\n * VariableDefinition : Variable : Type DefaultValue? Directives[Const]?\n */\n ;\n\n _proto.parseVariableDefinition = function parseVariableDefinition() {\n var start = this._lexer.token;\n return {\n kind: Kind.VARIABLE_DEFINITION,\n variable: this.parseVariable(),\n type: (this.expectToken(TokenKind.COLON), this.parseTypeReference()),\n defaultValue: this.expectOptionalToken(TokenKind.EQUALS) ? this.parseValueLiteral(true) : undefined,\n directives: this.parseDirectives(true),\n loc: this.loc(start)\n };\n }\n /**\n * Variable : $ Name\n */\n ;\n\n _proto.parseVariable = function parseVariable() {\n var start = this._lexer.token;\n this.expectToken(TokenKind.DOLLAR);\n return {\n kind: Kind.VARIABLE,\n name: this.parseName(),\n loc: this.loc(start)\n };\n }\n /**\n * SelectionSet : { Selection+ }\n */\n ;\n\n _proto.parseSelectionSet = function parseSelectionSet() {\n var start = this._lexer.token;\n return {\n kind: Kind.SELECTION_SET,\n selections: this.many(TokenKind.BRACE_L, this.parseSelection, TokenKind.BRACE_R),\n loc: this.loc(start)\n };\n }\n /**\n * Selection :\n * - Field\n * - FragmentSpread\n * - InlineFragment\n */\n ;\n\n _proto.parseSelection = function parseSelection() {\n return this.peek(TokenKind.SPREAD) ? this.parseFragment() : this.parseField();\n }\n /**\n * Field : Alias? Name Arguments? Directives? SelectionSet?\n *\n * Alias : Name :\n */\n ;\n\n _proto.parseField = function parseField() {\n var start = this._lexer.token;\n var nameOrAlias = this.parseName();\n var alias;\n var name;\n\n if (this.expectOptionalToken(TokenKind.COLON)) {\n alias = nameOrAlias;\n name = this.parseName();\n } else {\n name = nameOrAlias;\n }\n\n return {\n kind: Kind.FIELD,\n alias: alias,\n name: name,\n arguments: this.parseArguments(false),\n directives: this.parseDirectives(false),\n selectionSet: this.peek(TokenKind.BRACE_L) ? this.parseSelectionSet() : undefined,\n loc: this.loc(start)\n };\n }\n /**\n * Arguments[Const] : ( Argument[?Const]+ )\n */\n ;\n\n _proto.parseArguments = function parseArguments(isConst) {\n var 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\n _proto.parseArgument = function parseArgument() {\n var start = this._lexer.token;\n var name = this.parseName();\n this.expectToken(TokenKind.COLON);\n return {\n kind: Kind.ARGUMENT,\n name: name,\n value: this.parseValueLiteral(false),\n loc: this.loc(start)\n };\n };\n\n _proto.parseConstArgument = function parseConstArgument() {\n var start = this._lexer.token;\n return {\n kind: Kind.ARGUMENT,\n name: this.parseName(),\n value: (this.expectToken(TokenKind.COLON), this.parseValueLiteral(true)),\n loc: this.loc(start)\n };\n } // Implements the parsing rules in the Fragments section.\n\n /**\n * Corresponds to both FragmentSpread and InlineFragment in the spec.\n *\n * FragmentSpread : ... FragmentName Directives?\n *\n * InlineFragment : ... TypeCondition? Directives? SelectionSet\n */\n ;\n\n _proto.parseFragment = function parseFragment() {\n var start = this._lexer.token;\n this.expectToken(TokenKind.SPREAD);\n var hasTypeCondition = this.expectOptionalKeyword('on');\n\n if (!hasTypeCondition && this.peek(TokenKind.NAME)) {\n return {\n kind: Kind.FRAGMENT_SPREAD,\n name: this.parseFragmentName(),\n directives: this.parseDirectives(false),\n loc: this.loc(start)\n };\n }\n\n return {\n kind: Kind.INLINE_FRAGMENT,\n typeCondition: hasTypeCondition ? this.parseNamedType() : undefined,\n directives: this.parseDirectives(false),\n selectionSet: this.parseSelectionSet(),\n loc: this.loc(start)\n };\n }\n /**\n * FragmentDefinition :\n * - fragment FragmentName on TypeCondition Directives? SelectionSet\n *\n * TypeCondition : NamedType\n */\n ;\n\n _proto.parseFragmentDefinition = function parseFragmentDefinition() {\n var _this$_options;\n\n var start = this._lexer.token;\n this.expectKeyword('fragment'); // Experimental 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 = this._options) === null || _this$_options === void 0 ? void 0 : _this$_options.experimentalFragmentVariables) === true) {\n return {\n kind: Kind.FRAGMENT_DEFINITION,\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 loc: this.loc(start)\n };\n }\n\n return {\n kind: Kind.FRAGMENT_DEFINITION,\n name: this.parseFragmentName(),\n typeCondition: (this.expectKeyword('on'), this.parseNamedType()),\n directives: this.parseDirectives(false),\n selectionSet: this.parseSelectionSet(),\n loc: this.loc(start)\n };\n }\n /**\n * FragmentName : Name but not `on`\n */\n ;\n\n _proto.parseFragmentName = function 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\n _proto.parseValueLiteral = function parseValueLiteral(isConst) {\n var 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._lexer.advance();\n\n return {\n kind: Kind.INT,\n value: token.value,\n loc: this.loc(token)\n };\n\n case TokenKind.FLOAT:\n this._lexer.advance();\n\n return {\n kind: Kind.FLOAT,\n value: token.value,\n loc: this.loc(token)\n };\n\n case TokenKind.STRING:\n case TokenKind.BLOCK_STRING:\n return this.parseStringLiteral();\n\n case TokenKind.NAME:\n this._lexer.advance();\n\n switch (token.value) {\n case 'true':\n return {\n kind: Kind.BOOLEAN,\n value: true,\n loc: this.loc(token)\n };\n\n case 'false':\n return {\n kind: Kind.BOOLEAN,\n value: false,\n loc: this.loc(token)\n };\n\n case 'null':\n return {\n kind: Kind.NULL,\n loc: this.loc(token)\n };\n\n default:\n return {\n kind: Kind.ENUM,\n value: token.value,\n loc: this.loc(token)\n };\n }\n\n case TokenKind.DOLLAR:\n if (!isConst) {\n return this.parseVariable();\n }\n\n break;\n }\n\n throw this.unexpected();\n };\n\n _proto.parseStringLiteral = function parseStringLiteral() {\n var token = this._lexer.token;\n\n this._lexer.advance();\n\n return {\n kind: Kind.STRING,\n value: token.value,\n block: token.kind === TokenKind.BLOCK_STRING,\n loc: this.loc(token)\n };\n }\n /**\n * ListValue[Const] :\n * - [ ]\n * - [ Value[?Const]+ ]\n */\n ;\n\n _proto.parseList = function parseList(isConst) {\n var _this = this;\n\n var start = this._lexer.token;\n\n var item = function item() {\n return _this.parseValueLiteral(isConst);\n };\n\n return {\n kind: Kind.LIST,\n values: this.any(TokenKind.BRACKET_L, item, TokenKind.BRACKET_R),\n loc: this.loc(start)\n };\n }\n /**\n * ObjectValue[Const] :\n * - { }\n * - { ObjectField[?Const]+ }\n */\n ;\n\n _proto.parseObject = function parseObject(isConst) {\n var _this2 = this;\n\n var start = this._lexer.token;\n\n var item = function item() {\n return _this2.parseObjectField(isConst);\n };\n\n return {\n kind: Kind.OBJECT,\n fields: this.any(TokenKind.BRACE_L, item, TokenKind.BRACE_R),\n loc: this.loc(start)\n };\n }\n /**\n * ObjectField[Const] : Name : Value[?Const]\n */\n ;\n\n _proto.parseObjectField = function parseObjectField(isConst) {\n var start = this._lexer.token;\n var name = this.parseName();\n this.expectToken(TokenKind.COLON);\n return {\n kind: Kind.OBJECT_FIELD,\n name: name,\n value: this.parseValueLiteral(isConst),\n loc: this.loc(start)\n };\n } // Implements the parsing rules in the Directives section.\n\n /**\n * Directives[Const] : Directive[?Const]+\n */\n ;\n\n _proto.parseDirectives = function parseDirectives(isConst) {\n var directives = [];\n\n while (this.peek(TokenKind.AT)) {\n directives.push(this.parseDirective(isConst));\n }\n\n return directives;\n }\n /**\n * Directive[Const] : @ Name Arguments[?Const]?\n */\n ;\n\n _proto.parseDirective = function parseDirective(isConst) {\n var start = this._lexer.token;\n this.expectToken(TokenKind.AT);\n return {\n kind: Kind.DIRECTIVE,\n name: this.parseName(),\n arguments: this.parseArguments(isConst),\n loc: this.loc(start)\n };\n } // Implements the parsing rules in the Types section.\n\n /**\n * Type :\n * - NamedType\n * - ListType\n * - NonNullType\n */\n ;\n\n _proto.parseTypeReference = function parseTypeReference() {\n var start = this._lexer.token;\n var type;\n\n if (this.expectOptionalToken(TokenKind.BRACKET_L)) {\n type = this.parseTypeReference();\n this.expectToken(TokenKind.BRACKET_R);\n type = {\n kind: Kind.LIST_TYPE,\n type: type,\n loc: this.loc(start)\n };\n } else {\n type = this.parseNamedType();\n }\n\n if (this.expectOptionalToken(TokenKind.BANG)) {\n return {\n kind: Kind.NON_NULL_TYPE,\n type: type,\n loc: this.loc(start)\n };\n }\n\n return type;\n }\n /**\n * NamedType : Name\n */\n ;\n\n _proto.parseNamedType = function parseNamedType() {\n var start = this._lexer.token;\n return {\n kind: Kind.NAMED_TYPE,\n name: this.parseName(),\n loc: this.loc(start)\n };\n } // Implements the parsing rules in the Type Definition section.\n\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\n _proto.parseTypeSystemDefinition = function parseTypeSystemDefinition() {\n // Many definitions begin with a description and require a lookahead.\n var keywordToken = this.peekDescription() ? this._lexer.lookahead() : this._lexer.token;\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\n throw this.unexpected(keywordToken);\n };\n\n _proto.peekDescription = function peekDescription() {\n return this.peek(TokenKind.STRING) || this.peek(TokenKind.BLOCK_STRING);\n }\n /**\n * Description : StringValue\n */\n ;\n\n _proto.parseDescription = function parseDescription() {\n if (this.peekDescription()) {\n return this.parseStringLiteral();\n }\n }\n /**\n * SchemaDefinition : Description? schema Directives[Const]? { OperationTypeDefinition+ }\n */\n ;\n\n _proto.parseSchemaDefinition = function parseSchemaDefinition() {\n var start = this._lexer.token;\n var description = this.parseDescription();\n this.expectKeyword('schema');\n var directives = this.parseDirectives(true);\n var operationTypes = this.many(TokenKind.BRACE_L, this.parseOperationTypeDefinition, TokenKind.BRACE_R);\n return {\n kind: Kind.SCHEMA_DEFINITION,\n description: description,\n directives: directives,\n operationTypes: operationTypes,\n loc: this.loc(start)\n };\n }\n /**\n * OperationTypeDefinition : OperationType : NamedType\n */\n ;\n\n _proto.parseOperationTypeDefinition = function parseOperationTypeDefinition() {\n var start = this._lexer.token;\n var operation = this.parseOperationType();\n this.expectToken(TokenKind.COLON);\n var type = this.parseNamedType();\n return {\n kind: Kind.OPERATION_TYPE_DEFINITION,\n operation: operation,\n type: type,\n loc: this.loc(start)\n };\n }\n /**\n * ScalarTypeDefinition : Description? scalar Name Directives[Const]?\n */\n ;\n\n _proto.parseScalarTypeDefinition = function parseScalarTypeDefinition() {\n var start = this._lexer.token;\n var description = this.parseDescription();\n this.expectKeyword('scalar');\n var name = this.parseName();\n var directives = this.parseDirectives(true);\n return {\n kind: Kind.SCALAR_TYPE_DEFINITION,\n description: description,\n name: name,\n directives: directives,\n loc: this.loc(start)\n };\n }\n /**\n * ObjectTypeDefinition :\n * Description?\n * type Name ImplementsInterfaces? Directives[Const]? FieldsDefinition?\n */\n ;\n\n _proto.parseObjectTypeDefinition = function parseObjectTypeDefinition() {\n var start = this._lexer.token;\n var description = this.parseDescription();\n this.expectKeyword('type');\n var name = this.parseName();\n var interfaces = this.parseImplementsInterfaces();\n var directives = this.parseDirectives(true);\n var fields = this.parseFieldsDefinition();\n return {\n kind: Kind.OBJECT_TYPE_DEFINITION,\n description: description,\n name: name,\n interfaces: interfaces,\n directives: directives,\n fields: fields,\n loc: this.loc(start)\n };\n }\n /**\n * ImplementsInterfaces :\n * - implements `&`? NamedType\n * - ImplementsInterfaces & NamedType\n */\n ;\n\n _proto.parseImplementsInterfaces = function parseImplementsInterfaces() {\n var _this$_options2;\n\n if (!this.expectOptionalKeyword('implements')) {\n return [];\n }\n\n if (((_this$_options2 = this._options) === null || _this$_options2 === void 0 ? void 0 : _this$_options2.allowLegacySDLImplementsInterfaces) === true) {\n var types = []; // Optional leading ampersand\n\n this.expectOptionalToken(TokenKind.AMP);\n\n do {\n types.push(this.parseNamedType());\n } while (this.expectOptionalToken(TokenKind.AMP) || this.peek(TokenKind.NAME));\n\n return types;\n }\n\n return this.delimitedMany(TokenKind.AMP, this.parseNamedType);\n }\n /**\n * FieldsDefinition : { FieldDefinition+ }\n */\n ;\n\n _proto.parseFieldsDefinition = function parseFieldsDefinition() {\n var _this$_options3;\n\n // Legacy support for the SDL?\n if (((_this$_options3 = this._options) === null || _this$_options3 === void 0 ? void 0 : _this$_options3.allowLegacySDLEmptyFields) === true && this.peek(TokenKind.BRACE_L) && this._lexer.lookahead().kind === TokenKind.BRACE_R) {\n this._lexer.advance();\n\n this._lexer.advance();\n\n return [];\n }\n\n return this.optionalMany(TokenKind.BRACE_L, this.parseFieldDefinition, TokenKind.BRACE_R);\n }\n /**\n * FieldDefinition :\n * - Description? Name ArgumentsDefinition? : Type Directives[Const]?\n */\n ;\n\n _proto.parseFieldDefinition = function parseFieldDefinition() {\n var start = this._lexer.token;\n var description = this.parseDescription();\n var name = this.parseName();\n var args = this.parseArgumentDefs();\n this.expectToken(TokenKind.COLON);\n var type = this.parseTypeReference();\n var directives = this.parseDirectives(true);\n return {\n kind: Kind.FIELD_DEFINITION,\n description: description,\n name: name,\n arguments: args,\n type: type,\n directives: directives,\n loc: this.loc(start)\n };\n }\n /**\n * ArgumentsDefinition : ( InputValueDefinition+ )\n */\n ;\n\n _proto.parseArgumentDefs = function parseArgumentDefs() {\n return this.optionalMany(TokenKind.PAREN_L, this.parseInputValueDef, TokenKind.PAREN_R);\n }\n /**\n * InputValueDefinition :\n * - Description? Name : Type DefaultValue? Directives[Const]?\n */\n ;\n\n _proto.parseInputValueDef = function parseInputValueDef() {\n var start = this._lexer.token;\n var description = this.parseDescription();\n var name = this.parseName();\n this.expectToken(TokenKind.COLON);\n var type = this.parseTypeReference();\n var defaultValue;\n\n if (this.expectOptionalToken(TokenKind.EQUALS)) {\n defaultValue = this.parseValueLiteral(true);\n }\n\n var directives = this.parseDirectives(true);\n return {\n kind: Kind.INPUT_VALUE_DEFINITION,\n description: description,\n name: name,\n type: type,\n defaultValue: defaultValue,\n directives: directives,\n loc: this.loc(start)\n };\n }\n /**\n * InterfaceTypeDefinition :\n * - Description? interface Name Directives[Const]? FieldsDefinition?\n */\n ;\n\n _proto.parseInterfaceTypeDefinition = function parseInterfaceTypeDefinition() {\n var start = this._lexer.token;\n var description = this.parseDescription();\n this.expectKeyword('interface');\n var name = this.parseName();\n var interfaces = this.parseImplementsInterfaces();\n var directives = this.parseDirectives(true);\n var fields = this.parseFieldsDefinition();\n return {\n kind: Kind.INTERFACE_TYPE_DEFINITION,\n description: description,\n name: name,\n interfaces: interfaces,\n directives: directives,\n fields: fields,\n loc: this.loc(start)\n };\n }\n /**\n * UnionTypeDefinition :\n * - Description? union Name Directives[Const]? UnionMemberTypes?\n */\n ;\n\n _proto.parseUnionTypeDefinition = function parseUnionTypeDefinition() {\n var start = this._lexer.token;\n var description = this.parseDescription();\n this.expectKeyword('union');\n var name = this.parseName();\n var directives = this.parseDirectives(true);\n var types = this.parseUnionMemberTypes();\n return {\n kind: Kind.UNION_TYPE_DEFINITION,\n description: description,\n name: name,\n directives: directives,\n types: types,\n loc: this.loc(start)\n };\n }\n /**\n * UnionMemberTypes :\n * - = `|`? NamedType\n * - UnionMemberTypes | NamedType\n */\n ;\n\n _proto.parseUnionMemberTypes = function parseUnionMemberTypes() {\n return this.expectOptionalToken(TokenKind.EQUALS) ? this.delimitedMany(TokenKind.PIPE, this.parseNamedType) : [];\n }\n /**\n * EnumTypeDefinition :\n * - Description? enum Name Directives[Const]? EnumValuesDefinition?\n */\n ;\n\n _proto.parseEnumTypeDefinition = function parseEnumTypeDefinition() {\n var start = this._lexer.token;\n var description = this.parseDescription();\n this.expectKeyword('enum');\n var name = this.parseName();\n var directives = this.parseDirectives(true);\n var values = this.parseEnumValuesDefinition();\n return {\n kind: Kind.ENUM_TYPE_DEFINITION,\n description: description,\n name: name,\n directives: directives,\n values: values,\n loc: this.loc(start)\n };\n }\n /**\n * EnumValuesDefinition : { EnumValueDefinition+ }\n */\n ;\n\n _proto.parseEnumValuesDefinition = function parseEnumValuesDefinition() {\n return this.optionalMany(TokenKind.BRACE_L, this.parseEnumValueDefinition, TokenKind.BRACE_R);\n }\n /**\n * EnumValueDefinition : Description? EnumValue Directives[Const]?\n *\n * EnumValue : Name\n */\n ;\n\n _proto.parseEnumValueDefinition = function parseEnumValueDefinition() {\n var start = this._lexer.token;\n var description = this.parseDescription();\n var name = this.parseName();\n var directives = this.parseDirectives(true);\n return {\n kind: Kind.ENUM_VALUE_DEFINITION,\n description: description,\n name: name,\n directives: directives,\n loc: this.loc(start)\n };\n }\n /**\n * InputObjectTypeDefinition :\n * - Description? input Name Directives[Const]? InputFieldsDefinition?\n */\n ;\n\n _proto.parseInputObjectTypeDefinition = function parseInputObjectTypeDefinition() {\n var start = this._lexer.token;\n var description = this.parseDescription();\n this.expectKeyword('input');\n var name = this.parseName();\n var directives = this.parseDirectives(true);\n var fields = this.parseInputFieldsDefinition();\n return {\n kind: Kind.INPUT_OBJECT_TYPE_DEFINITION,\n description: description,\n name: name,\n directives: directives,\n fields: fields,\n loc: this.loc(start)\n };\n }\n /**\n * InputFieldsDefinition : { InputValueDefinition+ }\n */\n ;\n\n _proto.parseInputFieldsDefinition = function parseInputFieldsDefinition() {\n return this.optionalMany(TokenKind.BRACE_L, this.parseInputValueDef, TokenKind.BRACE_R);\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\n _proto.parseTypeSystemExtension = function parseTypeSystemExtension() {\n var 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 * SchemaExtension :\n * - extend schema Directives[Const]? { OperationTypeDefinition+ }\n * - extend schema Directives[Const]\n */\n ;\n\n _proto.parseSchemaExtension = function parseSchemaExtension() {\n var start = this._lexer.token;\n this.expectKeyword('extend');\n this.expectKeyword('schema');\n var directives = this.parseDirectives(true);\n var operationTypes = this.optionalMany(TokenKind.BRACE_L, this.parseOperationTypeDefinition, TokenKind.BRACE_R);\n\n if (directives.length === 0 && operationTypes.length === 0) {\n throw this.unexpected();\n }\n\n return {\n kind: Kind.SCHEMA_EXTENSION,\n directives: directives,\n operationTypes: operationTypes,\n loc: this.loc(start)\n };\n }\n /**\n * ScalarTypeExtension :\n * - extend scalar Name Directives[Const]\n */\n ;\n\n _proto.parseScalarTypeExtension = function parseScalarTypeExtension() {\n var start = this._lexer.token;\n this.expectKeyword('extend');\n this.expectKeyword('scalar');\n var name = this.parseName();\n var directives = this.parseDirectives(true);\n\n if (directives.length === 0) {\n throw this.unexpected();\n }\n\n return {\n kind: Kind.SCALAR_TYPE_EXTENSION,\n name: name,\n directives: directives,\n loc: this.loc(start)\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\n _proto.parseObjectTypeExtension = function parseObjectTypeExtension() {\n var start = this._lexer.token;\n this.expectKeyword('extend');\n this.expectKeyword('type');\n var name = this.parseName();\n var interfaces = this.parseImplementsInterfaces();\n var directives = this.parseDirectives(true);\n var fields = this.parseFieldsDefinition();\n\n if (interfaces.length === 0 && directives.length === 0 && fields.length === 0) {\n throw this.unexpected();\n }\n\n return {\n kind: Kind.OBJECT_TYPE_EXTENSION,\n name: name,\n interfaces: interfaces,\n directives: directives,\n fields: fields,\n loc: this.loc(start)\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\n _proto.parseInterfaceTypeExtension = function parseInterfaceTypeExtension() {\n var start = this._lexer.token;\n this.expectKeyword('extend');\n this.expectKeyword('interface');\n var name = this.parseName();\n var interfaces = this.parseImplementsInterfaces();\n var directives = this.parseDirectives(true);\n var fields = this.parseFieldsDefinition();\n\n if (interfaces.length === 0 && directives.length === 0 && fields.length === 0) {\n throw this.unexpected();\n }\n\n return {\n kind: Kind.INTERFACE_TYPE_EXTENSION,\n name: name,\n interfaces: interfaces,\n directives: directives,\n fields: fields,\n loc: this.loc(start)\n };\n }\n /**\n * UnionTypeExtension :\n * - extend union Name Directives[Const]? UnionMemberTypes\n * - extend union Name Directives[Const]\n */\n ;\n\n _proto.parseUnionTypeExtension = function parseUnionTypeExtension() {\n var start = this._lexer.token;\n this.expectKeyword('extend');\n this.expectKeyword('union');\n var name = this.parseName();\n var directives = this.parseDirectives(true);\n var types = this.parseUnionMemberTypes();\n\n if (directives.length === 0 && types.length === 0) {\n throw this.unexpected();\n }\n\n return {\n kind: Kind.UNION_TYPE_EXTENSION,\n name: name,\n directives: directives,\n types: types,\n loc: this.loc(start)\n };\n }\n /**\n * EnumTypeExtension :\n * - extend enum Name Directives[Const]? EnumValuesDefinition\n * - extend enum Name Directives[Const]\n */\n ;\n\n _proto.parseEnumTypeExtension = function parseEnumTypeExtension() {\n var start = this._lexer.token;\n this.expectKeyword('extend');\n this.expectKeyword('enum');\n var name = this.parseName();\n var directives = this.parseDirectives(true);\n var values = this.parseEnumValuesDefinition();\n\n if (directives.length === 0 && values.length === 0) {\n throw this.unexpected();\n }\n\n return {\n kind: Kind.ENUM_TYPE_EXTENSION,\n name: name,\n directives: directives,\n values: values,\n loc: this.loc(start)\n };\n }\n /**\n * InputObjectTypeExtension :\n * - extend input Name Directives[Const]? InputFieldsDefinition\n * - extend input Name Directives[Const]\n */\n ;\n\n _proto.parseInputObjectTypeExtension = function parseInputObjectTypeExtension() {\n var start = this._lexer.token;\n this.expectKeyword('extend');\n this.expectKeyword('input');\n var name = this.parseName();\n var directives = this.parseDirectives(true);\n var fields = this.parseInputFieldsDefinition();\n\n if (directives.length === 0 && fields.length === 0) {\n throw this.unexpected();\n }\n\n return {\n kind: Kind.INPUT_OBJECT_TYPE_EXTENSION,\n name: name,\n directives: directives,\n fields: fields,\n loc: this.loc(start)\n };\n }\n /**\n * DirectiveDefinition :\n * - Description? directive @ Name ArgumentsDefinition? `repeatable`? on DirectiveLocations\n */\n ;\n\n _proto.parseDirectiveDefinition = function parseDirectiveDefinition() {\n var start = this._lexer.token;\n var description = this.parseDescription();\n this.expectKeyword('directive');\n this.expectToken(TokenKind.AT);\n var name = this.parseName();\n var args = this.parseArgumentDefs();\n var repeatable = this.expectOptionalKeyword('repeatable');\n this.expectKeyword('on');\n var locations = this.parseDirectiveLocations();\n return {\n kind: Kind.DIRECTIVE_DEFINITION,\n description: description,\n name: name,\n arguments: args,\n repeatable: repeatable,\n locations: locations,\n loc: this.loc(start)\n };\n }\n /**\n * DirectiveLocations :\n * - `|`? DirectiveLocation\n * - DirectiveLocations | DirectiveLocation\n */\n ;\n\n _proto.parseDirectiveLocations = function 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\n _proto.parseDirectiveLocation = function parseDirectiveLocation() {\n var start = this._lexer.token;\n var name = this.parseName();\n\n if (DirectiveLocation[name.value] !== undefined) {\n return name;\n }\n\n throw this.unexpected(start);\n } // Core parsing utility functions\n\n /**\n * Returns a location object, used to identify the place in the source that created a given parsed object.\n */\n ;\n\n _proto.loc = function loc(startToken) {\n var _this$_options4;\n\n if (((_this$_options4 = this._options) === null || _this$_options4 === void 0 ? void 0 : _this$_options4.noLocation) !== true) {\n return new Location(startToken, this._lexer.lastToken, this._lexer.source);\n }\n }\n /**\n * Determines if the next token is of a given kind\n */\n ;\n\n _proto.peek = function 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\n _proto.expectToken = function expectToken(kind) {\n var token = this._lexer.token;\n\n if (token.kind === kind) {\n this._lexer.advance();\n\n return token;\n }\n\n throw syntaxError(this._lexer.source, token.start, \"Expected \".concat(getTokenKindDesc(kind), \", found \").concat(getTokenDesc(token), \".\"));\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 return undefined.\n */\n ;\n\n _proto.expectOptionalToken = function expectOptionalToken(kind) {\n var token = this._lexer.token;\n\n if (token.kind === kind) {\n this._lexer.advance();\n\n return token;\n }\n\n return undefined;\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\n _proto.expectKeyword = function expectKeyword(value) {\n var token = this._lexer.token;\n\n if (token.kind === TokenKind.NAME && token.value === value) {\n this._lexer.advance();\n } else {\n throw syntaxError(this._lexer.source, token.start, \"Expected \\\"\".concat(value, \"\\\", found \").concat(getTokenDesc(token), \".\"));\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\n _proto.expectOptionalKeyword = function expectOptionalKeyword(value) {\n var token = this._lexer.token;\n\n if (token.kind === TokenKind.NAME && token.value === value) {\n this._lexer.advance();\n\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\n _proto.unexpected = function unexpected(atToken) {\n var token = atToken !== null && atToken !== void 0 ? atToken : this._lexer.token;\n return syntaxError(this._lexer.source, token.start, \"Unexpected \".concat(getTokenDesc(token), \".\"));\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\n _proto.any = function any(openKind, parseFn, closeKind) {\n this.expectToken(openKind);\n var 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\n _proto.optionalMany = function optionalMany(openKind, parseFn, closeKind) {\n if (this.expectOptionalToken(openKind)) {\n var 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\n _proto.many = function many(openKind, parseFn, closeKind) {\n this.expectToken(openKind);\n var 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\n _proto.delimitedMany = function delimitedMany(delimiterKind, parseFn) {\n this.expectOptionalToken(delimiterKind);\n var nodes = [];\n\n do {\n nodes.push(parseFn.call(this));\n } while (this.expectOptionalToken(delimiterKind));\n\n return nodes;\n };\n\n return Parser;\n}();\n/**\n * A helper function to describe a token as a string for debugging.\n */\n\nfunction getTokenDesc(token) {\n var value = token.value;\n return getTokenKindDesc(token.kind) + (value != null ? \" \\\"\".concat(value, \"\\\"\") : '');\n}\n/**\n * A helper function to describe a token kind as a string for debugging.\n */\n\n\nfunction getTokenKindDesc(kind) {\n return isPunctuatorTokenKind(kind) ? \"\\\"\".concat(kind, \"\\\"\") : kind;\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: \".concat(description), undefined, source, [position]);\n}\n","function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _wrapNativeSuper(Class) { var _cache = typeof Map === \"function\" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== \"function\") { throw new TypeError(\"Super expression must either be null or a function\"); } if (typeof _cache !== \"undefined\") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); }\n\nfunction _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct; } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _isNativeFunction(fn) { return Function.toString.call(fn).indexOf(\"[native code]\") !== -1; }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nimport isObjectLike from \"../jsutils/isObjectLike.mjs\";\nimport { SYMBOL_TO_STRING_TAG } from \"../polyfills/symbols.mjs\";\nimport { getLocation } from \"../language/location.mjs\";\nimport { printLocation, printSourceLocation } from \"../language/printLocation.mjs\";\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 var GraphQLError = /*#__PURE__*/function (_Error) {\n _inherits(GraphQLError, _Error);\n\n var _super = _createSuper(GraphQLError);\n\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 function GraphQLError(message, nodes, source, positions, path, originalError, extensions) {\n var _nodeLocations, _nodeLocations2, _nodeLocations3;\n\n var _this;\n\n _classCallCheck(this, GraphQLError);\n\n _this = _super.call(this, message);\n _this.name = 'GraphQLError';\n _this.originalError = originalError !== null && originalError !== void 0 ? originalError : undefined; // Compute list of blame nodes.\n\n _this.nodes = undefinedIfEmpty(Array.isArray(nodes) ? nodes : nodes ? [nodes] : undefined);\n var nodeLocations = [];\n\n for (var _i2 = 0, _ref3 = (_this$nodes = _this.nodes) !== null && _this$nodes !== void 0 ? _this$nodes : []; _i2 < _ref3.length; _i2++) {\n var _this$nodes;\n\n var _ref4 = _ref3[_i2];\n var loc = _ref4.loc;\n\n if (loc != null) {\n nodeLocations.push(loc);\n }\n }\n\n nodeLocations = undefinedIfEmpty(nodeLocations); // Compute locations in the source for the given nodes/positions.\n\n _this.source = source !== null && source !== void 0 ? source : (_nodeLocations = nodeLocations) === null || _nodeLocations === void 0 ? void 0 : _nodeLocations[0].source;\n _this.positions = positions !== null && positions !== void 0 ? positions : (_nodeLocations2 = nodeLocations) === null || _nodeLocations2 === void 0 ? void 0 : _nodeLocations2.map(function (loc) {\n return loc.start;\n });\n _this.locations = positions && source ? positions.map(function (pos) {\n return getLocation(source, pos);\n }) : (_nodeLocations3 = nodeLocations) === null || _nodeLocations3 === void 0 ? void 0 : _nodeLocations3.map(function (loc) {\n return getLocation(loc.source, loc.start);\n });\n _this.path = path !== null && path !== void 0 ? path : undefined;\n var originalExtensions = originalError === null || originalError === void 0 ? void 0 : originalError.extensions;\n\n if (extensions == null && isObjectLike(originalExtensions)) {\n _this.extensions = _objectSpread({}, originalExtensions);\n } else {\n _this.extensions = extensions !== null && extensions !== void 0 ? extensions : {};\n } // By being enumerable, JSON.stringify will include bellow properties in the resulting output.\n // This ensures that the simplest possible GraphQL service adheres to the spec.\n\n\n Object.defineProperties(_assertThisInitialized(_this), {\n message: {\n enumerable: true\n },\n locations: {\n enumerable: _this.locations != null\n },\n path: {\n enumerable: _this.path != null\n },\n extensions: {\n enumerable: _this.extensions != null && Object.keys(_this.extensions).length > 0\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 if (originalError !== null && originalError !== void 0 && originalError.stack) {\n Object.defineProperty(_assertThisInitialized(_this), 'stack', {\n value: originalError.stack,\n writable: true,\n configurable: true\n });\n return _possibleConstructorReturn(_this);\n } // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2317')\n\n\n if (Error.captureStackTrace) {\n Error.captureStackTrace(_assertThisInitialized(_this), GraphQLError);\n } else {\n Object.defineProperty(_assertThisInitialized(_this), 'stack', {\n value: Error().stack,\n writable: true,\n configurable: true\n });\n }\n\n return _this;\n }\n\n _createClass(GraphQLError, [{\n key: \"toString\",\n value: function toString() {\n return printError(this);\n } // FIXME: workaround to not break chai comparisons, should be remove in v16\n // $FlowFixMe[unsupported-syntax] Flow doesn't support computed properties yet\n\n }, {\n key: SYMBOL_TO_STRING_TAG,\n get: function get() {\n return 'Object';\n }\n }]);\n\n return GraphQLError;\n}( /*#__PURE__*/_wrapNativeSuper(Error));\n\nfunction undefinedIfEmpty(array) {\n return array === undefined || array.length === 0 ? undefined : array;\n}\n/**\n * Prints a GraphQLError to a string, representing useful location information\n * about the error's position in the source.\n */\n\n\nexport function printError(error) {\n var output = error.message;\n\n if (error.nodes) {\n for (var _i4 = 0, _error$nodes2 = error.nodes; _i4 < _error$nodes2.length; _i4++) {\n var node = _error$nodes2[_i4];\n\n if (node.loc) {\n output += '\\n\\n' + printLocation(node.loc);\n }\n }\n } else if (error.source && error.locations) {\n for (var _i6 = 0, _error$locations2 = error.locations; _i6 < _error$locations2.length; _i6++) {\n var location = _error$locations2[_i6];\n output += '\\n\\n' + printSourceLocation(error.source, location);\n }\n }\n\n return output;\n}\n","function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\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 default function isObjectLike(value) {\n return _typeof(value) == 'object' && value !== null;\n}\n","// In ES2015 (or a polyfilled) environment, this will be Symbol.iterator\n// istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2317')\nexport var SYMBOL_ITERATOR = typeof Symbol === 'function' && Symbol.iterator != null ? Symbol.iterator : '@@iterator'; // In ES2017 (or a polyfilled) environment, this will be Symbol.asyncIterator\n// istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2317')\n\nexport var SYMBOL_ASYNC_ITERATOR = typeof Symbol === 'function' && Symbol.asyncIterator != null ? Symbol.asyncIterator : '@@asyncIterator'; // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2317')\n\nexport var SYMBOL_TO_STRING_TAG = typeof Symbol === 'function' && Symbol.toStringTag != null ? Symbol.toStringTag : '@@toStringTag';\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 var lineRegexp = /\\r\\n|[\\n\\r]/g;\n var line = 1;\n var column = position + 1;\n var match;\n\n while ((match = lineRegexp.exec(source.body)) && match.index < position) {\n line += 1;\n column = position + 1 - (match.index + match[0].length);\n }\n\n return {\n line: line,\n column: column\n };\n}\n","import { getLocation } from \"./location.mjs\";\n/**\n * Render a helpful description of the location in the GraphQL Source document.\n */\n\nexport function printLocation(location) {\n return printSourceLocation(location.source, getLocation(location.source, location.start));\n}\n/**\n * Render a helpful description of the location in the GraphQL Source document.\n */\n\nexport function printSourceLocation(source, sourceLocation) {\n var firstLineColumnOffset = source.locationOffset.column - 1;\n var body = whitespace(firstLineColumnOffset) + source.body;\n var lineIndex = sourceLocation.line - 1;\n var lineOffset = source.locationOffset.line - 1;\n var lineNum = sourceLocation.line + lineOffset;\n var columnOffset = sourceLocation.line === 1 ? firstLineColumnOffset : 0;\n var columnNum = sourceLocation.column + columnOffset;\n var locationStr = \"\".concat(source.name, \":\").concat(lineNum, \":\").concat(columnNum, \"\\n\");\n var lines = body.split(/\\r\\n|[\\n\\r]/g);\n var locationLine = lines[lineIndex]; // Special case for minified documents\n\n if (locationLine.length > 120) {\n var subLineIndex = Math.floor(columnNum / 80);\n var subLineColumnNum = columnNum % 80;\n var subLines = [];\n\n for (var i = 0; i < locationLine.length; i += 80) {\n subLines.push(locationLine.slice(i, i + 80));\n }\n\n return locationStr + printPrefixedLines([[\"\".concat(lineNum), subLines[0]]].concat(subLines.slice(1, subLineIndex + 1).map(function (subLine) {\n return ['', subLine];\n }), [[' ', whitespace(subLineColumnNum - 1) + '^'], ['', subLines[subLineIndex + 1]]]));\n }\n\n return locationStr + printPrefixedLines([// Lines specified like this: [\"prefix\", \"string\"],\n [\"\".concat(lineNum - 1), lines[lineIndex - 1]], [\"\".concat(lineNum), locationLine], ['', whitespace(columnNum - 1) + '^'], [\"\".concat(lineNum + 1), lines[lineIndex + 1]]]);\n}\n\nfunction printPrefixedLines(lines) {\n var existingLines = lines.filter(function (_ref) {\n var _ = _ref[0],\n line = _ref[1];\n return line !== undefined;\n });\n var padLen = Math.max.apply(Math, existingLines.map(function (_ref2) {\n var prefix = _ref2[0];\n return prefix.length;\n }));\n return existingLines.map(function (_ref3) {\n var prefix = _ref3[0],\n line = _ref3[1];\n return leftPad(padLen, prefix) + (line ? ' | ' + line : ' |');\n }).join('\\n');\n}\n\nfunction whitespace(len) {\n return Array(len + 1).join(' ');\n}\n\nfunction leftPad(len, str) {\n return whitespace(len - str.length) + str;\n}\n","/**\n * The set of allowed kind values for AST nodes.\n */\nexport var Kind = Object.freeze({\n // Name\n NAME: 'Name',\n // Document\n DOCUMENT: 'Document',\n OPERATION_DEFINITION: 'OperationDefinition',\n VARIABLE_DEFINITION: 'VariableDefinition',\n SELECTION_SET: 'SelectionSet',\n FIELD: 'Field',\n ARGUMENT: 'Argument',\n // Fragments\n FRAGMENT_SPREAD: 'FragmentSpread',\n INLINE_FRAGMENT: 'InlineFragment',\n FRAGMENT_DEFINITION: 'FragmentDefinition',\n // Values\n VARIABLE: 'Variable',\n INT: 'IntValue',\n FLOAT: 'FloatValue',\n STRING: 'StringValue',\n BOOLEAN: 'BooleanValue',\n NULL: 'NullValue',\n ENUM: 'EnumValue',\n LIST: 'ListValue',\n OBJECT: 'ObjectValue',\n OBJECT_FIELD: 'ObjectField',\n // Directives\n DIRECTIVE: 'Directive',\n // Types\n NAMED_TYPE: 'NamedType',\n LIST_TYPE: 'ListType',\n NON_NULL_TYPE: 'NonNullType',\n // Type System Definitions\n SCHEMA_DEFINITION: 'SchemaDefinition',\n OPERATION_TYPE_DEFINITION: 'OperationTypeDefinition',\n // Type Definitions\n SCALAR_TYPE_DEFINITION: 'ScalarTypeDefinition',\n OBJECT_TYPE_DEFINITION: 'ObjectTypeDefinition',\n FIELD_DEFINITION: 'FieldDefinition',\n INPUT_VALUE_DEFINITION: 'InputValueDefinition',\n INTERFACE_TYPE_DEFINITION: 'InterfaceTypeDefinition',\n UNION_TYPE_DEFINITION: 'UnionTypeDefinition',\n ENUM_TYPE_DEFINITION: 'EnumTypeDefinition',\n ENUM_VALUE_DEFINITION: 'EnumValueDefinition',\n INPUT_OBJECT_TYPE_DEFINITION: 'InputObjectTypeDefinition',\n // Directive Definitions\n DIRECTIVE_DEFINITION: 'DirectiveDefinition',\n // Type System Extensions\n SCHEMA_EXTENSION: 'SchemaExtension',\n // Type Extensions\n SCALAR_TYPE_EXTENSION: 'ScalarTypeExtension',\n OBJECT_TYPE_EXTENSION: 'ObjectTypeExtension',\n INTERFACE_TYPE_EXTENSION: 'InterfaceTypeExtension',\n UNION_TYPE_EXTENSION: 'UnionTypeExtension',\n ENUM_TYPE_EXTENSION: 'EnumTypeExtension',\n INPUT_OBJECT_TYPE_EXTENSION: 'InputObjectTypeExtension'\n});\n/**\n * The enum type representing the possible kind values of AST nodes.\n */\n","import defineInspect from \"../jsutils/defineInspect.mjs\";\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 var Location = /*#__PURE__*/function () {\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 function Location(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 var _proto = Location.prototype;\n\n _proto.toJSON = function toJSON() {\n return {\n start: this.start,\n end: this.end\n };\n };\n\n return Location;\n}(); // Print a simplified form when appearing in `inspect` and `util.inspect`.\n\ndefineInspect(Location);\n/**\n * Represents a range of characters represented by a lexical token\n * within a Source.\n */\n\nexport var Token = /*#__PURE__*/function () {\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\n /**\n * Tokens exist as nodes in a double-linked-list amongst all tokens\n * including ignored tokens. <SOF> is always the first node and <EOF>\n * the last.\n */\n function Token(kind, start, end, line, column, prev, value) {\n this.kind = kind;\n this.start = start;\n this.end = end;\n this.line = line;\n this.column = column;\n this.value = value;\n this.prev = prev;\n this.next = null;\n }\n\n var _proto2 = Token.prototype;\n\n _proto2.toJSON = function toJSON() {\n return {\n kind: this.kind,\n value: this.value,\n line: this.line,\n column: this.column\n };\n };\n\n return Token;\n}(); // Print a simplified form when appearing in `inspect` and `util.inspect`.\n\ndefineInspect(Token);\n/**\n * @internal\n */\n\nexport function isNode(maybeNode) {\n return maybeNode != null && typeof maybeNode.kind === 'string';\n}\n/**\n * The list of all possible AST node types.\n */\n","import invariant from \"./invariant.mjs\";\nimport nodejsCustomInspectSymbol from \"./nodejsCustomInspectSymbol.mjs\";\n/**\n * The `defineInspect()` function defines `inspect()` prototype method as alias of `toJSON`\n */\n\nexport default function defineInspect(classObject) {\n var fn = classObject.prototype.toJSON;\n typeof fn === 'function' || invariant(0);\n classObject.prototype.inspect = fn; // istanbul ignore else (See: 'https://github.com/graphql/graphql-js/issues/2317')\n\n if (nodejsCustomInspectSymbol) {\n classObject.prototype[nodejsCustomInspectSymbol] = fn;\n }\n}\n","export default function invariant(condition, message) {\n var booleanCondition = Boolean(condition); // istanbul ignore else (See transformation done in './resources/inlineInvariant.js')\n\n if (!booleanCondition) {\n throw new Error(message != null ? message : 'Unexpected invariant triggered.');\n }\n}\n","// istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2317')\nvar nodejsCustomInspectSymbol = typeof Symbol === 'function' && typeof Symbol.for === 'function' ? Symbol.for('nodejs.util.inspect.custom') : undefined;\nexport default nodejsCustomInspectSymbol;\n","/**\n * An exported enum describing the different kinds of tokens that the\n * lexer emits.\n */\nexport var TokenKind = Object.freeze({\n SOF: '<SOF>',\n EOF: '<EOF>',\n BANG: '!',\n DOLLAR: '$',\n AMP: '&',\n PAREN_L: '(',\n PAREN_R: ')',\n SPREAD: '...',\n COLON: ':',\n EQUALS: '=',\n AT: '@',\n BRACKET_L: '[',\n BRACKET_R: ']',\n BRACE_L: '{',\n PIPE: '|',\n BRACE_R: '}',\n NAME: 'Name',\n INT: 'Int',\n FLOAT: 'Float',\n STRING: 'String',\n BLOCK_STRING: 'BlockString',\n COMMENT: 'Comment'\n});\n/**\n * The enum type representing the token kinds values.\n */\n","function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nimport { SYMBOL_TO_STRING_TAG } from \"../polyfills/symbols.mjs\";\nimport inspect from \"../jsutils/inspect.mjs\";\nimport devAssert from \"../jsutils/devAssert.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 var Source = /*#__PURE__*/function () {\n function Source(body) {\n var name = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'GraphQL request';\n var locationOffset = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {\n line: 1,\n column: 1\n };\n typeof body === 'string' || devAssert(0, \"Body must be a string. Received: \".concat(inspect(body), \".\"));\n this.body = body;\n this.name = name;\n this.locationOffset = locationOffset;\n this.locationOffset.line > 0 || devAssert(0, 'line in locationOffset is 1-indexed and must be positive.');\n this.locationOffset.column > 0 || devAssert(0, 'column in locationOffset is 1-indexed and must be positive.');\n } // $FlowFixMe[unsupported-syntax] Flow doesn't support computed properties yet\n\n\n _createClass(Source, [{\n key: SYMBOL_TO_STRING_TAG,\n get: function get() {\n return 'Source';\n }\n }]);\n\n return Source;\n}();\n/**\n * Test if the given value is a Source object.\n *\n * @internal\n */\n\n// eslint-disable-next-line no-redeclare\nexport function isSource(source) {\n return instanceOf(source, Source);\n}\n","function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\n/* eslint-disable flowtype/no-weak-types */\nimport nodejsCustomInspectSymbol from \"./nodejsCustomInspectSymbol.mjs\";\nvar MAX_ARRAY_LENGTH = 10;\nvar MAX_RECURSIVE_DEPTH = 2;\n/**\n * Used to print values in error messages.\n */\n\nexport default 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 \".concat(value.name, \"]\") : '[function]';\n\n case 'object':\n if (value === null) {\n return 'null';\n }\n\n return formatObjectValue(value, seenValues);\n\n default:\n return String(value);\n }\n}\n\nfunction formatObjectValue(value, previouslySeenValues) {\n if (previouslySeenValues.indexOf(value) !== -1) {\n return '[Circular]';\n }\n\n var seenValues = [].concat(previouslySeenValues, [value]);\n var customInspectFn = getCustomFn(value);\n\n if (customInspectFn !== undefined) {\n var customValue = customInspectFn.call(value); // check for infinite recursion\n\n if (customValue !== value) {\n return typeof customValue === 'string' ? customValue : formatValue(customValue, seenValues);\n }\n } else if (Array.isArray(value)) {\n return formatArray(value, seenValues);\n }\n\n return formatObject(value, seenValues);\n}\n\nfunction formatObject(object, seenValues) {\n var keys = Object.keys(object);\n\n if (keys.length === 0) {\n return '{}';\n }\n\n if (seenValues.length > MAX_RECURSIVE_DEPTH) {\n return '[' + getObjectTag(object) + ']';\n }\n\n var properties = keys.map(function (key) {\n var value = formatValue(object[key], seenValues);\n return key + ': ' + value;\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 var len = Math.min(MAX_ARRAY_LENGTH, array.length);\n var remaining = array.length - len;\n var items = [];\n\n for (var 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(\"... \".concat(remaining, \" more items\"));\n }\n\n return '[' + items.join(', ') + ']';\n}\n\nfunction getCustomFn(object) {\n var customInspectFn = object[String(nodejsCustomInspectSymbol)];\n\n if (typeof customInspectFn === 'function') {\n return customInspectFn;\n }\n\n if (typeof object.inspect === 'function') {\n return object.inspect;\n }\n}\n\nfunction getObjectTag(object) {\n var tag = Object.prototype.toString.call(object).replace(/^\\[object /, '').replace(/]$/, '');\n\n if (tag === 'Object' && typeof object.constructor === 'function') {\n var name = object.constructor.name;\n\n if (typeof name === 'string' && name !== '') {\n return name;\n }\n }\n\n return tag;\n}\n","export default function devAssert(condition, message) {\n var booleanCondition = Boolean(condition); // istanbul ignore else (See transformation done in './resources/inlineInvariant.js')\n\n if (!booleanCondition) {\n throw new Error(message);\n }\n}\n","function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nimport inspect from \"./inspect.mjs\";\n/**\n * A replacement for instanceof which includes an error warning when multi-realm\n * constructors are detected.\n */\n\n// See: https://expressjs.com/en/advanced/best-practice-performance.html#set-node_env-to-production\n// See: https://webpack.js.org/guides/production/\nexport default process.env.NODE_ENV === 'production' ? // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2317')\n// eslint-disable-next-line no-shadow\nfunction instanceOf(value, constructor) {\n return value instanceof constructor;\n} : // eslint-disable-next-line no-shadow\nfunction 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 var className = constructor.prototype[Symbol.toStringTag];\n var valueClassName = // We still need to support constructor's name to detect conflicts with older versions of this library.\n Symbol.toStringTag in value ? value[Symbol.toStringTag] : (_value$constructor = value.constructor) === null || _value$constructor === void 0 ? void 0 : _value$constructor.name;\n\n if (className === valueClassName) {\n var stringifiedValue = inspect(value);\n throw new Error(\"Cannot use \".concat(className, \" \\\"\").concat(stringifiedValue, \"\\\" from another module or realm.\\n\\nEnsure that there is only one instance of \\\"graphql\\\" in the node_modules\\ndirectory. If different versions of \\\"graphql\\\" are the dependencies of other\\nrelied on modules, use \\\"resolutions\\\" to ensure only one version is installed.\\n\\nhttps://yarnpkg.com/en/docs/selective-version-resolutions\\n\\nDuplicate \\\"graphql\\\" modules cannot be used at the same time since different\\nversions may have different capabilities and behavior. The data from one\\nversion used in the function from another could produce confusing and\\nspurious results.\"));\n }\n }\n\n return false;\n};\n","/**\n * The set of allowed directive location values.\n */\nexport var DirectiveLocation = Object.freeze({\n // Request Definitions\n QUERY: 'QUERY',\n MUTATION: 'MUTATION',\n SUBSCRIPTION: 'SUBSCRIPTION',\n FIELD: 'FIELD',\n FRAGMENT_DEFINITION: 'FRAGMENT_DEFINITION',\n FRAGMENT_SPREAD: 'FRAGMENT_SPREAD',\n INLINE_FRAGMENT: 'INLINE_FRAGMENT',\n VARIABLE_DEFINITION: 'VARIABLE_DEFINITION',\n // Type System Definitions\n SCHEMA: 'SCHEMA',\n SCALAR: 'SCALAR',\n OBJECT: 'OBJECT',\n FIELD_DEFINITION: 'FIELD_DEFINITION',\n ARGUMENT_DEFINITION: 'ARGUMENT_DEFINITION',\n INTERFACE: 'INTERFACE',\n UNION: 'UNION',\n ENUM: 'ENUM',\n ENUM_VALUE: 'ENUM_VALUE',\n INPUT_OBJECT: 'INPUT_OBJECT',\n INPUT_FIELD_DEFINITION: 'INPUT_FIELD_DEFINITION'\n});\n/**\n * The enum type representing the directive location values.\n */\n","import { syntaxError } from \"../error/syntaxError.mjs\";\nimport { Token } from \"./ast.mjs\";\nimport { TokenKind } from \"./tokenKind.mjs\";\nimport { dedentBlockStringValue } from \"./blockString.mjs\";\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 */\n\nexport var Lexer = /*#__PURE__*/function () {\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 function Lexer(source) {\n var startOfFileToken = new Token(TokenKind.SOF, 0, 0, 0, 0, null);\n this.source = source;\n this.lastToken = startOfFileToken;\n this.token = startOfFileToken;\n this.line = 1;\n this.lineStart = 0;\n }\n /**\n * Advances the token stream to the next non-ignored token.\n */\n\n\n var _proto = Lexer.prototype;\n\n _proto.advance = function advance() {\n this.lastToken = this.token;\n var 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\n _proto.lookahead = function lookahead() {\n var token = this.token;\n\n if (token.kind !== TokenKind.EOF) {\n do {\n var _token$next;\n\n // Note: next is only mutable during parsing, so we cast to allow this.\n token = (_token$next = token.next) !== null && _token$next !== void 0 ? _token$next : token.next = readToken(this, token);\n } while (token.kind === TokenKind.COMMENT);\n }\n\n return token;\n };\n\n return Lexer;\n}();\n/**\n * @internal\n */\n\nexport function isPunctuatorTokenKind(kind) {\n return kind === TokenKind.BANG || kind === TokenKind.DOLLAR || kind === TokenKind.AMP || kind === TokenKind.PAREN_L || kind === TokenKind.PAREN_R || kind === TokenKind.SPREAD || kind === TokenKind.COLON || kind === TokenKind.EQUALS || kind === TokenKind.AT || kind === TokenKind.BRACKET_L || kind === TokenKind.BRACKET_R || kind === TokenKind.BRACE_L || kind === TokenKind.PIPE || kind === TokenKind.BRACE_R;\n}\n\nfunction printCharCode(code) {\n return (// NaN/undefined represents access beyond the end of the file.\n isNaN(code) ? TokenKind.EOF : // Trust JSON for ASCII.\n code < 0x007f ? JSON.stringify(String.fromCharCode(code)) : // Otherwise print the escaped form.\n \"\\\"\\\\u\".concat(('00' + code.toString(16).toUpperCase()).slice(-4), \"\\\"\")\n );\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\n\nfunction readToken(lexer, prev) {\n var source = lexer.source;\n var body = source.body;\n var bodyLength = body.length;\n var pos = prev.end;\n\n while (pos < bodyLength) {\n var code = body.charCodeAt(pos);\n var _line = lexer.line;\n\n var _col = 1 + pos - lexer.lineStart; // SourceCharacter\n\n\n switch (code) {\n case 0xfeff: // <BOM>\n\n case 9: // \\t\n\n case 32: // <space>\n\n case 44:\n // ,\n ++pos;\n continue;\n\n case 10:\n // \\n\n ++pos;\n ++lexer.line;\n lexer.lineStart = pos;\n continue;\n\n case 13:\n // \\r\n if (body.charCodeAt(pos + 1) === 10) {\n pos += 2;\n } else {\n ++pos;\n }\n\n ++lexer.line;\n lexer.lineStart = pos;\n continue;\n\n case 33:\n // !\n return new Token(TokenKind.BANG, pos, pos + 1, _line, _col, prev);\n\n case 35:\n // #\n return readComment(source, pos, _line, _col, prev);\n\n case 36:\n // $\n return new Token(TokenKind.DOLLAR, pos, pos + 1, _line, _col, prev);\n\n case 38:\n // &\n return new Token(TokenKind.AMP, pos, pos + 1, _line, _col, prev);\n\n case 40:\n // (\n return new Token(TokenKind.PAREN_L, pos, pos + 1, _line, _col, prev);\n\n case 41:\n // )\n return new Token(TokenKind.PAREN_R, pos, pos + 1, _line, _col, prev);\n\n case 46:\n // .\n if (body.charCodeAt(pos + 1) === 46 && body.charCodeAt(pos + 2) === 46) {\n return new Token(TokenKind.SPREAD, pos, pos + 3, _line, _col, prev);\n }\n\n break;\n\n case 58:\n // :\n return new Token(TokenKind.COLON, pos, pos + 1, _line, _col, prev);\n\n case 61:\n // =\n return new Token(TokenKind.EQUALS, pos, pos + 1, _line, _col, prev);\n\n case 64:\n // @\n return new Token(TokenKind.AT, pos, pos + 1, _line, _col, prev);\n\n case 91:\n // [\n return new Token(TokenKind.BRACKET_L, pos, pos + 1, _line, _col, prev);\n\n case 93:\n // ]\n return new Token(TokenKind.BRACKET_R, pos, pos + 1, _line, _col, prev);\n\n case 123:\n // {\n return new Token(TokenKind.BRACE_L, pos, pos + 1, _line, _col, prev);\n\n case 124:\n // |\n return new Token(TokenKind.PIPE, pos, pos + 1, _line, _col, prev);\n\n case 125:\n // }\n return new Token(TokenKind.BRACE_R, pos, pos + 1, _line, _col, prev);\n\n case 34:\n // \"\n if (body.charCodeAt(pos + 1) === 34 && body.charCodeAt(pos + 2) === 34) {\n return readBlockString(source, pos, _line, _col, prev, lexer);\n }\n\n return readString(source, pos, _line, _col, prev);\n\n case 45: // -\n\n case 48: // 0\n\n case 49: // 1\n\n case 50: // 2\n\n case 51: // 3\n\n case 52: // 4\n\n case 53: // 5\n\n case 54: // 6\n\n case 55: // 7\n\n case 56: // 8\n\n case 57:\n // 9\n return readNumber(source, pos, code, _line, _col, prev);\n\n case 65: // A\n\n case 66: // B\n\n case 67: // C\n\n case 68: // D\n\n case 69: // E\n\n case 70: // F\n\n case 71: // G\n\n case 72: // H\n\n case 73: // I\n\n case 74: // J\n\n case 75: // K\n\n case 76: // L\n\n case 77: // M\n\n case 78: // N\n\n case 79: // O\n\n case 80: // P\n\n case 81: // Q\n\n case 82: // R\n\n case 83: // S\n\n case 84: // T\n\n case 85: // U\n\n case 86: // V\n\n case 87: // W\n\n case 88: // X\n\n case 89: // Y\n\n case 90: // Z\n\n case 95: // _\n\n case 97: // a\n\n case 98: // b\n\n case 99: // c\n\n case 100: // d\n\n case 101: // e\n\n case 102: // f\n\n case 103: // g\n\n case 104: // h\n\n case 105: // i\n\n case 106: // j\n\n case 107: // k\n\n case 108: // l\n\n case 109: // m\n\n case 110: // n\n\n case 111: // o\n\n case 112: // p\n\n case 113: // q\n\n case 114: // r\n\n case 115: // s\n\n case 116: // t\n\n case 117: // u\n\n case 118: // v\n\n case 119: // w\n\n case 120: // x\n\n case 121: // y\n\n case 122:\n // z\n return readName(source, pos, _line, _col, prev);\n }\n\n throw syntaxError(source, pos, unexpectedCharacterMessage(code));\n }\n\n var line = lexer.line;\n var col = 1 + pos - lexer.lineStart;\n return new Token(TokenKind.EOF, bodyLength, bodyLength, line, col, prev);\n}\n/**\n * Report a message that an unexpected character was encountered.\n */\n\n\nfunction unexpectedCharacterMessage(code) {\n if (code < 0x0020 && code !== 0x0009 && code !== 0x000a && code !== 0x000d) {\n return \"Cannot contain the invalid character \".concat(printCharCode(code), \".\");\n }\n\n if (code === 39) {\n // '\n return 'Unexpected single quote character (\\'), did you mean to use a double quote (\")?';\n }\n\n return \"Cannot parse the unexpected character \".concat(printCharCode(code), \".\");\n}\n/**\n * Reads a comment token from the source file.\n *\n * #[\\u0009\\u0020-\\uFFFF]*\n */\n\n\nfunction readComment(source, start, line, col, prev) {\n var body = source.body;\n var code;\n var position = start;\n\n do {\n code = body.charCodeAt(++position);\n } while (!isNaN(code) && ( // SourceCharacter but not LineTerminator\n code > 0x001f || code === 0x0009));\n\n return new Token(TokenKind.COMMENT, start, position, line, col, prev, body.slice(start + 1, position));\n}\n/**\n * Reads a number token from the source file, either a float\n * or an int depending on whether a decimal point appears.\n *\n * Int: -?(0|[1-9][0-9]*)\n * Float: -?(0|[1-9][0-9]*)(\\.[0-9]+)?((E|e)(+|-)?[0-9]+)?\n */\n\n\nfunction readNumber(source, start, firstCode, line, col, prev) {\n var body = source.body;\n var code = firstCode;\n var position = start;\n var isFloat = false;\n\n if (code === 45) {\n // -\n code = body.charCodeAt(++position);\n }\n\n if (code === 48) {\n // 0\n code = body.charCodeAt(++position);\n\n if (code >= 48 && code <= 57) {\n throw syntaxError(source, position, \"Invalid number, unexpected digit after 0: \".concat(printCharCode(code), \".\"));\n }\n } else {\n position = readDigits(source, position, code);\n code = body.charCodeAt(position);\n }\n\n if (code === 46) {\n // .\n isFloat = true;\n code = body.charCodeAt(++position);\n position = readDigits(source, position, code);\n code = body.charCodeAt(position);\n }\n\n if (code === 69 || code === 101) {\n // E e\n isFloat = true;\n code = body.charCodeAt(++position);\n\n if (code === 43 || code === 45) {\n // + -\n code = body.charCodeAt(++position);\n }\n\n position = readDigits(source, position, code);\n code = body.charCodeAt(position);\n } // Numbers cannot be followed by . or NameStart\n\n\n if (code === 46 || isNameStart(code)) {\n throw syntaxError(source, position, \"Invalid number, expected digit but got: \".concat(printCharCode(code), \".\"));\n }\n\n return new Token(isFloat ? TokenKind.FLOAT : TokenKind.INT, start, position, line, col, prev, body.slice(start, position));\n}\n/**\n * Returns the new position in the source after reading digits.\n */\n\n\nfunction readDigits(source, start, firstCode) {\n var body = source.body;\n var position = start;\n var code = firstCode;\n\n if (code >= 48 && code <= 57) {\n // 0 - 9\n do {\n code = body.charCodeAt(++position);\n } while (code >= 48 && code <= 57); // 0 - 9\n\n\n return position;\n }\n\n throw syntaxError(source, position, \"Invalid number, expected digit but got: \".concat(printCharCode(code), \".\"));\n}\n/**\n * Reads a string token from the source file.\n *\n * \"([^\"\\\\\\u000A\\u000D]|(\\\\(u[0-9a-fA-F]{4}|[\"\\\\/bfnrt])))*\"\n */\n\n\nfunction readString(source, start, line, col, prev) {\n var body = source.body;\n var position = start + 1;\n var chunkStart = position;\n var code = 0;\n var value = '';\n\n while (position < body.length && !isNaN(code = body.charCodeAt(position)) && // not LineTerminator\n code !== 0x000a && code !== 0x000d) {\n // Closing Quote (\")\n if (code === 34) {\n value += body.slice(chunkStart, position);\n return new Token(TokenKind.STRING, start, position + 1, line, col, prev, value);\n } // SourceCharacter\n\n\n if (code < 0x0020 && code !== 0x0009) {\n throw syntaxError(source, position, \"Invalid character within String: \".concat(printCharCode(code), \".\"));\n }\n\n ++position;\n\n if (code === 92) {\n // \\\n value += body.slice(chunkStart, position - 1);\n code = body.charCodeAt(position);\n\n switch (code) {\n case 34:\n value += '\"';\n break;\n\n case 47:\n value += '/';\n break;\n\n case 92:\n value += '\\\\';\n break;\n\n case 98:\n value += '\\b';\n break;\n\n case 102:\n value += '\\f';\n break;\n\n case 110:\n value += '\\n';\n break;\n\n case 114:\n value += '\\r';\n break;\n\n case 116:\n value += '\\t';\n break;\n\n case 117:\n {\n // uXXXX\n var charCode = uniCharCode(body.charCodeAt(position + 1), body.charCodeAt(position + 2), body.charCodeAt(position + 3), body.charCodeAt(position + 4));\n\n if (charCode < 0) {\n var invalidSequence = body.slice(position + 1, position + 5);\n throw syntaxError(source, position, \"Invalid character escape sequence: \\\\u\".concat(invalidSequence, \".\"));\n }\n\n value += String.fromCharCode(charCode);\n position += 4;\n break;\n }\n\n default:\n throw syntaxError(source, position, \"Invalid character escape sequence: \\\\\".concat(String.fromCharCode(code), \".\"));\n }\n\n ++position;\n chunkStart = position;\n }\n }\n\n throw syntaxError(source, position, 'Unterminated string.');\n}\n/**\n * Reads a block string token from the source file.\n *\n * \"\"\"(\"?\"?(\\\\\"\"\"|\\\\(?!=\"\"\")|[^\"\\\\]))*\"\"\"\n */\n\n\nfunction readBlockString(source, start, line, col, prev, lexer) {\n var body = source.body;\n var position = start + 3;\n var chunkStart = position;\n var code = 0;\n var rawValue = '';\n\n while (position < body.length && !isNaN(code = body.charCodeAt(position))) {\n // Closing Triple-Quote (\"\"\")\n if (code === 34 && body.charCodeAt(position + 1) === 34 && body.charCodeAt(position + 2) === 34) {\n rawValue += body.slice(chunkStart, position);\n return new Token(TokenKind.BLOCK_STRING, start, position + 3, line, col, prev, dedentBlockStringValue(rawValue));\n } // SourceCharacter\n\n\n if (code < 0x0020 && code !== 0x0009 && code !== 0x000a && code !== 0x000d) {\n throw syntaxError(source, position, \"Invalid character within String: \".concat(printCharCode(code), \".\"));\n }\n\n if (code === 10) {\n // new line\n ++position;\n ++lexer.line;\n lexer.lineStart = position;\n } else if (code === 13) {\n // carriage return\n if (body.charCodeAt(position + 1) === 10) {\n position += 2;\n } else {\n ++position;\n }\n\n ++lexer.line;\n lexer.lineStart = position;\n } else if ( // Escape Triple-Quote (\\\"\"\")\n code === 92 && body.charCodeAt(position + 1) === 34 && body.charCodeAt(position + 2) === 34 && body.charCodeAt(position + 3) === 34) {\n rawValue += body.slice(chunkStart, position) + '\"\"\"';\n position += 4;\n chunkStart = position;\n } else {\n ++position;\n }\n }\n\n throw syntaxError(source, position, 'Unterminated string.');\n}\n/**\n * Converts four hexadecimal chars to the integer that the\n * string represents. For example, uniCharCode('0','0','0','f')\n * will return 15, and uniCharCode('0','0','f','f') returns 255.\n *\n * Returns a negative number on error, if a char was invalid.\n *\n * This is implemented by noting that char2hex() returns -1 on error,\n * which means the result of ORing the char2hex() will also be negative.\n */\n\n\nfunction uniCharCode(a, b, c, d) {\n return char2hex(a) << 12 | char2hex(b) << 8 | char2hex(c) << 4 | char2hex(d);\n}\n/**\n * Converts a hex character to its integer value.\n * '0' becomes 0, '9' becomes 9\n * 'A' becomes 10, 'F' becomes 15\n * 'a' becomes 10, 'f' becomes 15\n *\n * Returns -1 on error.\n */\n\n\nfunction char2hex(a) {\n return a >= 48 && a <= 57 ? a - 48 // 0-9\n : a >= 65 && a <= 70 ? a - 55 // A-F\n : a >= 97 && a <= 102 ? a - 87 // a-f\n : -1;\n}\n/**\n * Reads an alphanumeric + underscore name from the source.\n *\n * [_A-Za-z][_0-9A-Za-z]*\n */\n\n\nfunction readName(source, start, line, col, prev) {\n var body = source.body;\n var bodyLength = body.length;\n var position = start + 1;\n var code = 0;\n\n while (position !== bodyLength && !isNaN(code = body.charCodeAt(position)) && (code === 95 || // _\n code >= 48 && code <= 57 || // 0-9\n code >= 65 && code <= 90 || // A-Z\n code >= 97 && code <= 122) // a-z\n ) {\n ++position;\n }\n\n return new Token(TokenKind.NAME, start, position, line, col, prev, body.slice(start, position));\n} // _ A-Z a-z\n\n\nfunction isNameStart(code) {\n return code === 95 || code >= 65 && code <= 90 || code >= 97 && code <= 122;\n}\n","/**\n * Produces the value of a block string from its parsed raw value, similar to\n * CoffeeScript's block string, Python's docstring trim or Ruby's strip_heredoc.\n *\n * This implements the GraphQL spec's BlockStringValue() static algorithm.\n *\n * @internal\n */\nexport function dedentBlockStringValue(rawString) {\n // Expand a block string's raw value into independent lines.\n var lines = rawString.split(/\\r\\n|[\\n\\r]/g); // Remove common indentation from all lines but first.\n\n var commonIndent = getBlockStringIndentation(rawString);\n\n if (commonIndent !== 0) {\n for (var i = 1; i < lines.length; i++) {\n lines[i] = lines[i].slice(commonIndent);\n }\n } // Remove leading and trailing blank lines.\n\n\n var startLine = 0;\n\n while (startLine < lines.length && isBlank(lines[startLine])) {\n ++startLine;\n }\n\n var endLine = lines.length;\n\n while (endLine > startLine && isBlank(lines[endLine - 1])) {\n --endLine;\n } // Return a string of the lines joined with U+000A.\n\n\n return lines.slice(startLine, endLine).join('\\n');\n}\n\nfunction isBlank(str) {\n for (var i = 0; i < str.length; ++i) {\n if (str[i] !== ' ' && str[i] !== '\\t') {\n return false;\n }\n }\n\n return true;\n}\n/**\n * @internal\n */\n\n\nexport function getBlockStringIndentation(value) {\n var _commonIndent;\n\n var isFirstLine = true;\n var isEmptyLine = true;\n var indent = 0;\n var commonIndent = null;\n\n for (var i = 0; i < value.length; ++i) {\n switch (value.charCodeAt(i)) {\n case 13:\n // \\r\n if (value.charCodeAt(i + 1) === 10) {\n ++i; // skip \\r\\n as one symbol\n }\n\n // falls through\n\n case 10:\n // \\n\n isFirstLine = false;\n isEmptyLine = true;\n indent = 0;\n break;\n\n case 9: // \\t\n\n case 32:\n // <space>\n ++indent;\n break;\n\n default:\n if (isEmptyLine && !isFirstLine && (commonIndent === null || indent < commonIndent)) {\n commonIndent = indent;\n }\n\n isEmptyLine = false;\n }\n }\n\n return (_commonIndent = commonIndent) !== null && _commonIndent !== void 0 ? _commonIndent : 0;\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) {\n var indentation = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n var preferMultipleLines = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n var isSingleLine = value.indexOf('\\n') === -1;\n var hasLeadingSpace = value[0] === ' ' || value[0] === '\\t';\n var hasTrailingQuote = value[value.length - 1] === '\"';\n var hasTrailingSlash = value[value.length - 1] === '\\\\';\n var printAsMultipleLines = !isSingleLine || hasTrailingQuote || hasTrailingSlash || preferMultipleLines;\n var result = ''; // Format a multi-line block quote to account for leading space.\n\n if (printAsMultipleLines && !(isSingleLine && hasLeadingSpace)) {\n result += '\\n' + indentation;\n }\n\n result += indentation ? value.replace(/\\n/g, '\\n' + indentation) : value;\n\n if (printAsMultipleLines) {\n result += '\\n';\n }\n\n return '\"\"\"' + result.replace(/\"\"\"/g, '\\\\\"\"\"') + '\"\"\"';\n}\n","export { Source } from \"./source.mjs\";\nexport { getLocation } from \"./location.mjs\";\nexport { printLocation, printSourceLocation } from \"./printLocation.mjs\";\nexport { Kind } from \"./kinds.mjs\";\nexport { TokenKind } from \"./tokenKind.mjs\";\nexport { Lexer } from \"./lexer.mjs\";\nexport { parse, parseValue, parseType } from \"./parser.mjs\";\nexport { print } from \"./printer.mjs\";\nexport { visit, visitInParallel, getVisitFn, BREAK } from \"./visitor.mjs\";\nexport { Location, Token } from \"./ast.mjs\";\nexport { isDefinitionNode, isExecutableDefinitionNode, isSelectionNode, isValueNode, isTypeNode, isTypeSystemDefinitionNode, isTypeDefinitionNode, isTypeSystemExtensionNode, isTypeExtensionNode } from \"./predicates.mjs\";\nexport { DirectiveLocation } from \"./directiveLocation.mjs\";\n","/**\n * Generate mutation and query fragments for a form based on the schema\n * TODO: refactor to mutualize more code with vulcan-core defaultFragment functions\n * TODO: move to lib when refactored\n */\nimport _uniq from \"lodash/uniq.js\";\nimport _intersection from \"lodash/intersection.js\";\nimport gql from \"graphql-tag\";\nimport {\n getCreateableFields,\n getUpdateableFields,\n getFragmentFieldNames,\n //isBlackbox,\n} from \"@vulcanjs/schema\";\nimport {\n getFieldFragment,\n VulcanGraphqlModel,\n //isBlackbox,\n} from \"@vulcanjs/graphql\";\nimport { capitalize } from \"@vulcanjs/utils\";\nimport type { FormType } from \"../typings\";\nimport compact from \"lodash/compact.js\";\n// getFieldFragment,\nconst intlSuffix = \"_intl\";\n\n// PostsEditFormQueryFragment/PostsNewFormMutationFragment/etc.\nconst getFragmentName = (\n formType: FormType,\n multiTypeName: string,\n fragmentType: \"mutation\" | \"query\"\n) =>\n [multiTypeName, formType, \"form\", fragmentType, \"fragment\"]\n .map(capitalize)\n .join(\"\");\n\n// get modifiable fields in the query either for update or create operations\nconst getQueryFieldNames = ({ schema, options }) => {\n const queryFields =\n options.formType === \"new\"\n ? getCreateableFields(schema)\n : getUpdateableFields(schema);\n return queryFields;\n};\n// add readable fields to mutation fields\nconst getMutationFieldNames = ({ readableFieldNames, queryFieldNames }) => {\n return _uniq(queryFieldNames.concat(readableFieldNames));\n};\n\n/*\nconst getFieldFragment = ({ schema, fieldName, options }) => {\n let fieldFragment = fieldName;\n const field = schema[fieldName];\n if (!(field && field.type)) return fieldName;\n const fieldType = field.type.singleType;\n const fieldTypeName =\n typeof fieldType === 'object'\n ? 'Object'\n : typeof fieldType === 'function'\n ? fieldType.name\n : fieldType;\n\n if (fieldName.slice(-5) === intlSuffix) {\n fieldFragment = `${fieldName}{ locale value }`;\n } else {\n switch (fieldTypeName) {\n // recursive call for nested arrays and objects\n case 'Object':\n if (!isBlackbox(field) && fieldType._schema) {\n fieldFragment =\n getSchemaFragment({\n fragmentName: fieldName,\n schema: fieldType._schema,\n options,\n }) || null;\n }\n break;\n case 'Array':\n const arrayItemFieldName = `${fieldName}.$`;\n const arrayItemField = schema[arrayItemFieldName];\n // note: make sure field has an associated array item field\n if (arrayItemField) {\n // child will either be native value or a an object (first case)\n const arrayItemFieldType = arrayItemField.type.singleType;\n if (!arrayItemField.blackbox && arrayItemFieldType._schema) {\n fieldFragment =\n getSchemaFragment({\n fragmentName: fieldName,\n schema: arrayItemFieldType._schema,\n options,\n }) || null;\n }\n }\n break;\n default:\n // handle intl or return fieldName\n fieldFragment = fieldName;\n break;\n }\n }\n return fieldFragment;\n};\n*/\n\n// get fragment for a whole schema (root schema or nested schema of an object or an array)\nconst getSchemaFragment = ({\n schema,\n fragmentName,\n options,\n fieldNames: providedFieldNames,\n}) => {\n // differentiate mutation/query and create/update cases\n // respect provided fieldNames if any (needed for the root schema)\n const fieldNames =\n providedFieldNames ||\n (options.isMutation\n ? getMutationFieldNames({\n queryFieldNames: getQueryFieldNames({ schema, options }),\n readableFieldNames: getFragmentFieldNames({\n schema,\n options: { onlyViewable: true },\n }),\n })\n : getQueryFieldNames({ schema, options }));\n\n const childFragments =\n fieldNames.length &&\n fieldNames\n .map((fieldName) =>\n getFieldFragment({\n schema,\n fieldName,\n options,\n getObjectFragment: getSchemaFragment, // allow to reuse the code from defaultFragment with another behaviour\n })\n )\n // remove empty values\n .filter((f) => !!f);\n if (childFragments.length) {\n return `${fragmentName} { ${childFragments.join(\"\\n\")} }`;\n }\n return null;\n};\n\n/**\n * Generate query and mutation fragments for forms, dynamically based on the selected fields\n */\nconst getFormFragments = ({\n formType = \"new\",\n model,\n fields, // restrict on certain fields\n addFields, // add additional fields (eg to display static fields)\n}: {\n model: VulcanGraphqlModel;\n formType: FormType;\n fields?: Array<string>; // restrict on certain fields\n addFields?: Array<string>; // add additional fields (eg to display static fields)\n}) => {\n const { schema, name, graphql } = model;\n const { typeName, multiTypeName } = graphql;\n // get the root schema fieldNames\n let queryFieldNames = getQueryFieldNames({ schema, options: { formType } });\n let mutationFieldNames = getMutationFieldNames({\n queryFieldNames,\n readableFieldNames: getFragmentFieldNames({\n schema,\n options: { onlyViewable: true },\n }),\n });\n\n // if \"fields\" prop is specified, restrict list of fields to it\n if (fields && fields?.length > 0) {\n // add \"_intl\" suffix to all fields in case some of them are intl fields\n const fieldsWithIntlSuffix = fields.map((field) => `${field}${intlSuffix}`);\n const allFields = [...fields, ...fieldsWithIntlSuffix];\n queryFieldNames = _intersection(queryFieldNames, allFields);\n mutationFieldNames = _intersection(mutationFieldNames, allFields);\n }\n\n // add \"addFields\" prop contents to list of fields\n if (addFields?.length) {\n queryFieldNames = queryFieldNames.concat(addFields);\n mutationFieldNames = mutationFieldNames.concat(addFields);\n }\n\n // userId is used to check for permissions, so add it to fragments if possible\n if (schema.userId) {\n queryFieldNames.unshift(\"userId\");\n mutationFieldNames.unshift(\"userId\");\n }\n\n if (schema._id) {\n queryFieldNames.unshift(\"_id\");\n mutationFieldNames.unshift(\"_id\");\n }\n\n // check unicity (_id can be added twice)\n queryFieldNames = _uniq(queryFieldNames);\n mutationFieldNames = _uniq(mutationFieldNames);\n\n if (queryFieldNames.length === 0)\n // NOTE: in theory, you could have no queriable fields, but mutable fields =>\n // a form for data that you can create but can never see...\n // Since that doesn't make much sense, we throw an error to secure the end user\n throw new Error(\n `Model \"${model.name}\" has no queryable fields, cannot create a form for it. Please add readable/createable/updateable fields to the model schema.`\n );\n if (mutationFieldNames.length === 0)\n throw new Error(\n `Model \"${model.name}\" has no mutable fields, cannot create a form for it. Please add createable/updateable fields to model schema.`\n );\n\n const queryFragmentName = getFragmentName(\n formType,\n multiTypeName, // previously collectionName //name,\n \"query\"\n );\n // generate query fragment based on the fields that can be edited. Note: always add _id, and userId if possible.\n // TODO: support nesting\n const queryFragmentText = getSchemaFragment({\n schema,\n fragmentName: `fragment ${queryFragmentName} on ${typeName}`,\n options: { formType, isMutation: false },\n fieldNames: queryFieldNames,\n });\n if (!queryFragmentText) {\n // NOTE: this should never happen if we don't have an empty array for field names\n throw new Error(\n `Model ${model.name} with fields ${queryFieldNames} yield an empty query fragment.`\n );\n }\n const generatedQueryFragment = gql(queryFragmentText);\n\n const mutationFragmentName = getFragmentName(\n formType,\n multiTypeName, // previously collectionName,\n \"mutation\"\n );\n const mutationFragmentText = getSchemaFragment({\n schema,\n fragmentName: `fragment ${mutationFragmentName} on ${typeName}`,\n options: { formType, isMutation: true },\n fieldNames: mutationFieldNames,\n });\n if (!mutationFragmentText) {\n // NOTE: this should never happen if we don't have an empty array for field names\n throw new Error(\n `Model ${model.name} with fields ${mutationFieldNames} yield an empty mutation fragment.`\n );\n }\n // generate mutation fragment based on the fields that can be edited and/or viewed. Note: always add _id, and userId if possible.\n // TODO: support nesting\n const generatedMutationFragment = gql(mutationFragmentText);\n\n // if any field specifies extra queries, add them\n const extraQueries = compact(\n getQueryFieldNames({ schema, options: { formType } }).map((fieldName) => {\n const field = schema[fieldName];\n return field.query;\n })\n );\n // get query & mutation fragments from props or else default to same as generatedFragment\n return {\n queryFragment: generatedQueryFragment,\n mutationFragment: generatedMutationFragment,\n queryFragmentName,\n mutationFragmentName,\n extraQueries,\n };\n};\n\nexport default getFormFragments;\n","export * from \"./Consumer\";\nexport * from \"./Provider\";\n","import { useContext } from \"react\";\nimport { VulcanCurrentUserContext } from \"./Context\";\n\nexport const VulcanCurrentUserConsumer = VulcanCurrentUserContext.Consumer;\n\nexport const useVulcanCurrentUser = () => useContext(VulcanCurrentUserContext);\n","import React from \"react\";\nimport type { VulcanUser } from \"@vulcanjs/permissions\";\n\nexport type VulcanCurrentUserContextType =\n | { currentUser: VulcanUser | null; loading: false }\n | { loading: true; currentUser: any };\n// We need this to shut TypeScript up\n// You should use the Provider to get the right default values\nexport const VulcanCurrentUserContext =\n React.createContext<VulcanCurrentUserContextType>({\n currentUser: null,\n loading: false,\n });\n","/**\n * NOTE: KEEP SEPARATED FROM THE HOOKS TO CONSUME THE CONTEXT\n * otherwise you'll end up with circular dependencies because of the default components\n */\n// TODO: we might need to adapt the provider to merge its value with a potentially higher up context\nimport React from \"react\";\n\nimport {\n VulcanCurrentUserContext,\n VulcanCurrentUserContextType,\n} from \"./Context\";\n\n// So that you can override only some components by adding an additional context while keeping the defaults\nexport const VulcanCurrentUserProvider = ({\n value,\n ...props\n}: {\n value: VulcanCurrentUserContextType;\n children: React.ReactNode;\n}) => (\n <VulcanCurrentUserContext.Provider\n value={value} // merge provided components so the user can provide only a partial replacement\n {...props}\n />\n);\n","export * as pathUtils from \"./path_utils\";\nexport * as utils from \"./utils\";\nexport * as schemaUtils from \"./schema_utils\";\nexport * as formFragmentsUtils from \"./formFragments\";\nexport * as uiUtils from \"./ui_utils\";\n","import pick from \"lodash/pick.js\";\n\n/**\n * Extract input props for the FormComponentInner\n * @param {*} props All component props\n * @returns Initial props + props specific to the HTML input in an inputProperties object\n */\nexport const getHtmlInputProps = (props) => {\n const { name, path, options, label, onChange, onBlur, value, disabled } =\n props;\n\n // these properties are whitelisted so that they can be safely passed to the actual form input\n // and avoid https://facebook.github.io/react/warnings/unknown-prop.html warnings\n const inputProperties = {\n ...props.inputProperties,\n name,\n path,\n options,\n label,\n onChange,\n onBlur,\n value,\n disabled,\n };\n\n return {\n ...props,\n inputProperties,\n };\n};\n\n/**\n * Extract input props for the FormComponentInner\n * @param {*} props All component props\n * @returns Initial props + props specific to the HTML input in an inputProperties object\n */\nexport const whitelistInputProps = (\n props: any\n): React.HTMLProps<HTMLInputElement> => {\n const whitelist = [\n \"name\",\n \"path\",\n \"options\",\n \"label\",\n \"onChange\",\n \"onBlur\",\n \"value\",\n \"disabled\",\n \"placeholder\",\n ];\n const value = props.value;\n let safeValue = value;\n // No null values in HTML inputs\n if (value === null) safeValue = undefined;\n // if value is null, return undefined\n return { ...pick(props, whitelist), value: safeValue };\n};\n","export * from \"./Provider\";\nexport * from \"./Context\";\nexport * from \"./Consumer\";\nexport * from \"./typings\";\n\nexport * from \"./defaultVulcanComponents/index\";\n","/**\n * NOTE: KEEP SEPARATED FROM THE HOOKS TO CONSUME THE CONTEXT\n * otherwise you'll end up with circular dependencies because of the default components\n */\n// TODO: we might need to adapt the provider to merge its value with a potentially higher up context\nimport React from \"react\";\n\nimport { PossibleVulcanComponents } from \"./typings\";\nimport { VulcanComponentsContext } from \"./Context\";\nimport { useVulcanComponents } from \"./Consumer\";\nimport { debugVulcan } from \"@vulcanjs/utils\";\nconst debugComponents = debugVulcan(\"components\"); //console.log;\n\n/**\n *\n * @param options.value An object of Vulcan components to be overriden.\n */\nexport const VulcanComponentsProvider = ({\n value,\n ...props\n}: {\n value?: Partial<PossibleVulcanComponents>;\n children: React.ReactNode;\n}) => {\n const currentComponents = useVulcanComponents();\n debugComponents(\n \"Current components __not_initialized?\",\n currentComponents.__not_initialized\n );\n const mergedComponents = {\n // merge with a parent Provider if needed\n ...(currentComponents?.__not_initialized ? {} : currentComponents || {}),\n ...(value || {}),\n };\n debugComponents(\"Merged components\", mergedComponents);\n // For preserving displayName, that is lost after build somehow\n Object.keys(mergedComponents).forEach((componentName) => {\n if (mergedComponents[componentName]) {\n mergedComponents[componentName].displayName = \"Vulcan.\" + componentName;\n } else {\n console.warn(`Encountered an undefined component: ${componentName}.\n The component may not be registered, or import failed.\n For instance due to an infinite import loop when importing\n \"useVulcanComponents\" from index instead of Consumer.`);\n }\n });\n return (\n <VulcanComponentsContext.Provider\n // We make the assumption that all components are there, user is responsible\n // for adding them correctly in the context where necessary\n value={mergedComponents as PossibleVulcanComponents} // merge provided components so the user can provide only a partial replacement\n {...props}\n />\n );\n};\n","import React from \"react\";\n\n// Creating a dependency with the raw\n// implemention is actually a bad idea\n// An \"any\" type is acceptable as long as we\n// do expose reusable hooks and\n// enough typings for common things, such as\n// \"FormInputProps\" or useFormContext, typings for some events and so on\n/*\n import type { FormSubmitProps } from \"../form/elements\";\n import type { ButtonProps } from \"../core/Button\";\n */\n// We keep this import because it barely have any HTML, you are\n// not supposed to restyle it in each package\n// import type { MutationButtonProps } from \"../MutationButton\";\n// datatable\n/*\nimport type {\n Datatable,\n DatatableAbove,\n DatatableAboveLayout,\n DatatableAboveLeft,\n DatatableAboveRight,\n DatatableAboveSearchInput,\n DatatableLayout,\n} from \"../Datatable/Datatable\";\nimport type {\n DatatableContents,\n DatatableContentsBodyLayout,\n DatatableContentsHeadLayout,\n DatatableContentsInnerLayout,\n DatatableContentsLayout,\n DatatableContentsMoreLayout,\n DatatableEmpty,\n DatatableLoadMoreButton,\n DatatableTitle,\n} from \"../Datatable/DatatableContents\";\nimport type {\n DatatableHeader,\n DatatableHeaderCellLayout,\n} from \"../Datatable/DatatableHeader\";\nimport type {\n DatatableRow,\n DatatableRowLayout,\n} from \"../Datatable/DatatableRow\";\nimport type {\n DatatableCell,\n DatatableCellLayout,\n DatatableDefaultCell,\n} from \"../Datatable/DatatableCell\";\nimport type {\n DatatableFilter,\n DatatableFilterBooleans,\n DatatableFilterCheckboxes,\n DatatableFilterContents,\n DatatableFilterContentsWithData,\n DatatableFilterDates,\n DatatableFilterNumbers,\n} from \"../Datatable/DatatableFilter\";\nimport type { DatatableSorter } from \"../Datatable/DatatableSorter\";\nimport type { DatatableSelect } from \"../Datatable/DatatableSelect\";\nimport type { DatatableSubmitSelected } from \"../Datatable/DatatableSubmitSelected\";\nimport type { EditButton, EditForm } from \"../Datatable/others/EditButton\";\nimport type { NewButton, NewForm } from \"../Datatable/others/NewButton\";\nimport type { DeleteButton } from \"../Datatable/others/DeleteButton\";\n*/\n//import type { BootstrapModal as Modal } from \"../bootstrap/Modal\";\n// Cell\n/*\nimport type { CardItemSwitcher } from \"../cell/CardItem\";\nimport type {\n CardItemRelationItem,\n DefaultCell,\n UserCell,\n} from \"../cell/CardItemRelationItem\";\nimport type { CardItemArray } from \"../cell/CardItemArray\";\nimport type { CardItemDate } from \"../cell/CardItemDate\";\nimport type { CardItemDefault } from \"../cell/CardItemDefault\";\nimport type { CardItemHTML } from \"../cell/CardItemHTML\";\nimport type { CardItemImage } from \"../cell/CardItemImage\";\nimport type { CardItemNumber } from \"../cell/CardItemNumber\";\nimport type { CardItemObject } from \"../cell/CardItemObject\";\nimport type { CardItemRelationHasMany } from \"../cell/CardItemRelationHasMany\";\nimport type { CardItemRelationHasOne } from \"../cell/CardItemRelationHasOne\";\nimport type { CardItemString } from \"../cell/CardItemString\";\nimport type { CardItemURL } from \"../cell/CardItemURL\";\n*/\n//import type { ModalTrigger } from \"../bootstrap/ModalTrigger\";\n//import type { FormOptionLabelProps } from \"../form/inputs/FormOptionLabel\";\n\nexport interface PossibleCoreComponents {\n Loading: any;\n FormattedMessage: any;\n Alert: any;\n Button: any; //React.ComponentType<ButtonProps>;\n Icon: any;\n // TODO: define props more precisely\n MutationButton: any; //React.ComponentType<MutationButtonProps>;\n LoadingButton: React.ComponentType<any>;\n HeadTags: React.ComponentType<any>;\n // Previously from Bootstrap and Mui\n TooltipTrigger: React.ComponentType<any>;\n Dropdown: React.ComponentType<any>;\n Modal: any; // typeof Modal;\n ModalTrigger: any; // typeof ModalTrigger;\n}\n// TODO: differentiate components that are provided out of the box and those that require a UI frameworK?\nexport interface PossibleFormComponents {\n FormError: any; // FieldErrors\n // From FormComponent\n FormComponentDefault: any;\n /** Alias of the default FormComponent */\n FormComponentText: any;\n FormComponentPassword: any;\n FormComponentNumber: any;\n FormComponentUrl: any;\n FormComponentEmail: any;\n FormComponentTextarea: any;\n FormComponentCheckbox: any;\n FormComponentCheckboxGroup: any;\n FormComponentRadioGroup: any;\n FormComponentSelect: any;\n FormComponentSelectMultiple: any;\n FormComponentDateTime: any;\n FormComponentDate: any;\n // FormComponentDate2: any;\n FormComponentTime: any;\n FormComponentStaticText: any;\n FormComponentLikert: any;\n FormComponentAutocomplete: any;\n FormComponentMultiAutocomplete: any;\n //\n FormComponent: any;\n FormComponentInner: any;\n FormComponentLoader: any;\n FormElement: any;\n FormGroup: any;\n FormGroupLayout: any;\n FormGroupHeader: any;\n // intl\n FormIntlLayout: any;\n FormIntlItemLayout: any;\n FormIntl: any;\n // Layout\n FormErrors: any;\n FormSubmit: any; //React.ComponentType<FormSubmitProps>;\n FormLayout: any;\n\n // arrays and objects\n FormNestedArray: any;\n FormNestedArrayInnerLayout: any;\n FormNestedArrayLayout: any;\n FormNestedItem: any;\n IconAdd: any;\n IconRemove: any;\n FieldErrors: any;\n FormNestedDivider: any;\n //\n FormNestedItemLayout: any;\n FormNestedObjectLayout: any;\n FormNestedObject: any;\n FormOptionLabel: any; //React.ComponentType<FormOptionLabelProps>;\n // Form\n Form: any;\n SmartForm: any;\n // Used by ui-boostrap and ui-material\n FormItem;\n // flag to detect parent state\n __not_initialized?: boolean;\n}\n\nexport interface DatatableComponents {\n Datatable: any; // typeof Datatable;\n // DatatableContents: any; // typeof DatatableContents\n DatatableAbove: any; // typeof DatatableAbove;\n DatatableAboveLayout: any; // typeof DatatableAboveLayout;\n DatatableAboveLeft: any; // typeof DatatableAboveLeft;\n DatatableAboveRight: any; // typeof DatatableAboveRight;\n DatatableAboveSearchInput: any; // typeof DatatableAboveSearchInput;\n DatatableLayout: any; // typeof DatatableLayout;\n // Contents\n DatatableContents: any; // typeof DatatableContents;\n DatatableContentsBodyLayout: any; // typeof DatatableContentsBodyLayout;\n DatatableContentsHeadLayout: any; // typeof DatatableContentsHeadLayout;\n DatatableContentsInnerLayout: any; // typeof DatatableContentsInnerLayout;\n DatatableContentsLayout: any; // typeof DatatableContentsLayout;\n DatatableContentsMoreLayout: any; // typeof DatatableContentsMoreLayout;\n DatatableEmpty: any; // typeof DatatableEmpty;\n DatatableLoadMoreButton: any; // typeof DatatableLoadMoreButton;\n DatatableTitle: any; // typeof DatatableTitle;\n // Header\n DatatableHeader: any; // typeof DatatableHeader;\n DatatableHeaderCellLayout: any; // typeof DatatableHeaderCellLayout;\n // Row\n DatatableRow: any; // typeof DatatableRow;\n DatatableRowLayout: any; // typeof DatatableRowLayout;\n // Cell\n DatatableCell: any; // typeof DatatableCell;\n DatatableCellLayout: any; // typeof DatatableCellLayout;\n DatatableDefaultCell: any; // typeof DatatableDefaultCell;\n // Filter\n DatatableFilter: any; // typeof DatatableFilter;\n DatatableFilterBooleans: any; // typeof DatatableFilterBooleans;\n DatatableFilterCheckboxes: any; // typeof DatatableFilterCheckboxes;\n DatatableFilterContents: any; // typeof DatatableFilterContents;\n DatatableFilterContentsWithData: any; // typeof DatatableFilterContentsWithData;\n DatatableFilterDates: any; // typeof DatatableFilterDates;\n DatatableFilterNumbers: any; // typeof DatatableFilterNumbers;\n // Sort\n DatatableSorter: any; // typeof DatatableSorter;\n // Select\n DatatableSelect: any; // typeof DatatableSelect;\n // SubmitSelect\n DatatableSubmitSelected: any; // typeof DatatableSubmitSelected;\n // Core\n EditButton: any; // typeof EditButton;\n EditForm: any; // typeof EditForm;\n NewButton: any; // typeof NewButton;\n NewForm: any; // typeof NewForm;\n DeleteButton: any; // typeof DeleteButton;\n}\n\nexport interface CellComponents {\n CardItemSwitcher: any; // typeof CardItemSwitcher;\n CardItem: any; // any; // typeof CardItemSwitcher;\n DefaultCell: any; // typeof DefaultCell;\n UserCell: any; // typeof UserCell;\n CardItemArray: any; // typeof CardItemArray;\n CardItemDate: any; // typeof CardItemDate;\n CardItemDefault: any; // typeof CardItemDefault;\n CardItemHTML: any; // typeof CardItemHTML;\n CardItemImage: any; // typeof CardItemImage;\n CardItemNumber: any; // typeof CardItemNumber;\n CardItemObject: any; // typeof CardItemObject;\n CardItemRelationHasMany: any; // typeof CardItemRelationHasMany;\n CardItemRelationHasOne: any; // typeof CardItemRelationHasOne;\n CardItemRelationItem: any; // typeof CardItemRelationItem;\n CardItemString: any; // typeof CardItemString;\n CardItemURL: any; // typeof CardItemURL;\n}\n\nexport type PossibleVulcanComponents = PossibleCoreComponents &\n PossibleFormComponents &\n DatatableComponents &\n CellComponents;\n","import { LoadingButton } from \"../../core/LoadingButton\";\nimport { MutationButton } from \"../../core/MutationButton\";\nimport { Form, FormContainer } from \"../../form/core\";\nimport { PossibleFormComponents } from \"../typings\";\n\nexport const defaultFormComponents: Partial<PossibleFormComponents> = {\n Form,\n SmartForm: FormContainer,\n};\n// All those components are defined in each relevant package instead\nexport const defaultDatatableComponents = {};\nexport const defaultCellComponents = {};\nexport const defaultCoreComponents = {\n MutationButton,\n LoadingButton,\n};\n","import React, { CSSProperties } from \"react\";\nimport { useVulcanComponents } from \"../VulcanComponents/Consumer\";\nimport type { ButtonProps } from \"./typings\";\nexport interface LoadingButtonProps extends ButtonProps {\n loading?: boolean;\n label?: string | React.ReactNode;\n onClick?: any;\n children?: React.ReactNode;\n className?: string;\n}\nexport const LoadingButton = ({\n loading,\n label,\n onClick,\n children,\n className = \"\",\n ...rest\n}: LoadingButtonProps & any) => {\n const Components = useVulcanComponents();\n\n const wrapperStyle: CSSProperties = {\n position: \"relative\",\n };\n\n const labelStyle = loading ? { opacity: 0.5 } : {};\n\n const loadingStyle: CSSProperties = loading\n ? {\n position: \"absolute\",\n top: 0,\n bottom: 0,\n left: 0,\n right: 0,\n display: \"flex\",\n justifyContent: \"center\",\n alignItems: \"center\",\n }\n : { display: \"none\" };\n\n return (\n <Components.Button\n className={`loading-button ${loading ? \"loading-button-loading\" : \"loading-button-notloading\"\n } ${className}`}\n onClick={onClick}\n {...rest}\n >\n <span style={wrapperStyle}>\n <span style={labelStyle}>{label || children}</span>\n <span style={loadingStyle}>\n <Components.Loading />\n </span>\n </span>\n </Components.Button>\n );\n};\n","/*\n\nExample Usage\n\n<Components.MutationButton\n label=\"Cancel Subscription\"\n variant=\"primary\"\n mutationOptions={{\n name: 'cancelSubscription',\n args: { bookingId: 'String' },\n fragmentName: 'BookingsStripeDataFragment',\n }}\n mutationArguments={{ bookingId: booking._id }}\n submitCallback={() => {}}\n successCallback={result => { console.log(result) }}\n/>\n\n*/\nimport React, { useState } from \"react\";\nimport { DocumentNode } from \"graphql\";\nimport { MutationHookOptions, useMutation } from \"@apollo/client\";\nimport gql from \"graphql-tag\";\nimport { useVulcanComponents } from \"../VulcanComponents/Consumer\";\nimport { LoadingButtonProps } from \"./LoadingButton\";\n// import withMutation from '../containers/registeredMutation';\n\n// TODO:\n/**\n * Difference with Vulcan Meteor: there is no\n * registered mutation anymore,\n * so you need to pass your mutations explicitely, using graphql\n */\n/*\nexport class MutationButton extends PureComponent {\n constructor(props) {\n super(props);\n this.button = withMutation(props.mutationOptions)(MutationButtonInner);\n }\n\n render() {\n const Component = this.button;\n return <Component {...this.props} />;\n }\n}*/\n\nexport interface MutationButtonProps {\n /**\n * NOTE: in Vulcan Meteor you had to write:\n * mutationOptions: { name: \"foobar\", mutationOptions: {refetchQueries:[\"hello\"]}}\n *\n * In Vulcan Next, you can only pass the \"mutationOptions\" object:\n * mutationOptions: { refetchQueries:[\"hello\"]}\n * and the mutation is provided via the new \"mutation\" prop\n */\n mutationOptions?: MutationHookOptions;\n /**\n * @example\n mutation: gql`\n mutation sampleMutation($input: Input) {\n hello\n }\n `,\n */\n mutation: string | DocumentNode;\n /** Variables passed to the mutation (NOTE: we can't pass other options at the moment) */\n mutationArguments?: MutationHookOptions<any>[\"variables\"];\n /** Callback run before submitting. Can optionnaly return mutationArguments that will override current ones. */\n submitCallback?: (\n mutationArgumentsFromProps: MutationHookOptions<any>[\"variables\"]\n ) =>\n | void\n | { mutationArguments: MutationHookOptions<any>[\"variables\"] }\n | Promise<void | {\n mutationArguments: MutationHookOptions<any>[\"variables\"];\n }>;\n successCallback?: (res: any) => void | Promise<void>;\n errorCallback?: (err: any) => void | Promise<void>;\n /** Now isolated into their own object to avoid needed to explicitely pick/omit */\n loadingButtonProps?: LoadingButtonProps;\n /** Shortcut for loadingButtonProps.label */\n label?: string | React.ReactNode;\n}\nexport const MutationButton = (props: MutationButtonProps) => {\n const Components = useVulcanComponents();\n const [loading, setLoading] = useState<boolean>(false);\n const [error, setError] = useState<any | undefined>();\n\n const {\n //mutationOptions,\n mutation,\n loadingButtonProps = {},\n label,\n } = props;\n let { mutationArguments } = props;\n const mutationAsNode =\n typeof mutation === \"string\"\n ? gql`\n ${mutation}\n `\n : mutation;\n const [mutationFunc] = useMutation(mutationAsNode);\n\n const handleClick = async (e) => {\n e.preventDefault();\n setLoading(true);\n setError(undefined);\n const {\n //mutationOptions,\n submitCallback,\n successCallback,\n errorCallback,\n } = props;\n //const mutationName = mutationOptions.name;\n //const mutation = this.props[mutationName];\n\n try {\n if (submitCallback) {\n const callbackReturn = await submitCallback(mutationArguments);\n if (callbackReturn && callbackReturn.mutationArguments) {\n mutationArguments = callbackReturn.mutationArguments;\n }\n }\n const result = await mutationFunc({ variables: mutationArguments });\n if (successCallback) {\n await successCallback(result);\n }\n } catch (error) {\n // TODO: may not work because the mutationFunc may not throw in case of error\n setError(error);\n if (errorCallback) {\n await errorCallback(error);\n }\n } finally {\n setLoading(false);\n }\n\n // mutation(mutationArguments)\n // .then(result => {\n // this.setState({ loading: false });\n // if (successCallback) {\n // successCallback(result);\n // }\n // })\n // .catch(error => {\n // this.setState({ loading: false });\n // if (errorCallback) {\n // errorCallback(error);\n // }\n // });\n };\n\n //const mutationName = this.props.mutationOptions.name;\n\n const loadingButton = (\n <Components.LoadingButton\n loading={loading}\n onClick={handleClick}\n label={label}\n {...loadingButtonProps}\n />\n );\n\n if (error) {\n return (\n <Components.TooltipTrigger trigger={loadingButton} defaultShow={true}>\n {error.message.replace(\"GraphQL error: \", \"\")}\n </Components.TooltipTrigger>\n );\n }\n return loadingButton;\n};\n","export * from \"./Form\";\nexport * from \"./FormContainer\";\nexport * from \"./FormContext\";\n","// import { compose } from \"recompose\";\nimport React from \"react\";\n\nexport const Components = {}; // will be populated on startup\nexport const ComponentsTable = {}; // storage for infos about components\n\nexport const coreComponents = [\n \"Alert\",\n \"Button\",\n \"Modal\",\n \"ModalTrigger\",\n \"Table\",\n \"FormComponentCheckbox\",\n \"FormComponentCheckboxGroup\",\n \"FormComponentDate\",\n \"FormComponentDate2\",\n \"FormComponentDateTime\",\n \"FormComponentDefault\",\n \"FormComponentText\",\n \"FormComponentEmail\",\n \"FormComponentNumber\",\n \"FormComponentRadioGroup\",\n \"FormComponentSelect\",\n \"FormComponentSelectMultiple\",\n \"FormComponentStaticText\",\n \"FormComponentTextarea\",\n \"FormComponentTime\",\n \"FormComponentUrl\",\n \"FormComponentInner\",\n \"FormControl\",\n \"FormElement\",\n];\n\n/**\n * Register a Vulcan component with a name, a raw component than can be extended\n * and one or more optional higher order components.\n *\n * @param {String} name The name of the component to register.\n * @param {Component} rawComponent Interchangeable/extendable react component.\n * @param {...(Function|Array)} hocs The HOCs to compose with the raw component.\n *\n * Note: when a component is registered without higher order component, `hocs` will be\n * an empty array, and it's ok!\n * See https://github.com/reactjs/redux/blob/master/src/compose.js#L13-L15\n *\n * @returns Structure of a component in the list:\n *\n * ComponentsTable.Foo = {\n * name: 'Foo',\n * hocs: [fn1, fn2],\n * rawComponent: React.Component,\n * call: () => compose(...hocs)(rawComponent),\n * }\n *\n */\n/*\nexport function registerComponent(name, rawComponent, ...hocs) {\n // support single-argument syntax\n if (typeof arguments[0] === \"object\") {\n // note: cannot use `const` because name, components, hocs are already defined\n // as arguments so destructuring cannot work\n // eslint-disable-next-line no-redeclare\n var {\n name,\n component,\n // @ts-ignore\n hocs = [],\n } = arguments[0];\n rawComponent = component;\n }\n // store the component in the table\n ComponentsTable[name] = {\n name,\n rawComponent,\n hocs,\n };\n}\n*/\n\n/**\n * Returns true if a component with the given name has been registered with\n * registerComponent(name, component, ...hocs).\n *\n * @param {String} name The name of the component to get.\n * @returns {Boolean}\n */\nexport const componentExists = (name) => {\n const component = ComponentsTable[name];\n return !!component;\n};\n\n/**\n * Get a component registered with registerComponent(name, component, ...hocs).\n *\n * @param {String} name The name of the component to get.\n * @returns {Function|React Component} A (wrapped) React component\n */\n/*\nexport const getComponent = (name) => {\n const component = ComponentsTable[name];\n if (!component) {\n throw new Error(`Component ${name} not registered.`);\n }\n if (component.hocs && component.hocs.length) {\n const hocs = component.hocs.map((hoc) => {\n if (!Array.isArray(hoc)) {\n if (typeof hoc !== \"function\") {\n throw new Error(\n `In registered component ${name}, an hoc is of type ${typeof hoc}`\n );\n }\n return hoc;\n }\n const [actualHoc, ...args] = hoc;\n if (typeof actualHoc !== \"function\") {\n throw new Error(\n `In registered component ${name}, an hoc is of type ${typeof actualHoc}`\n );\n }\n return actualHoc(...args);\n });\n return compose(...hocs)(component.rawComponent);\n } else {\n return component.rawComponent;\n }\n};\n*/\n\n/**\n * Populate the lookup table for components to be callable\n * ℹ️ Called once on app startup\n **/\n/*\nexport const populateComponentsApp = () => {\n const registeredComponents = Object.keys(ComponentsTable);\n\n // loop over each component in the list\n registeredComponents.map((name) => {\n // populate an entry in the lookup table\n Components[name] = getComponent(name);\n\n // uncomment for debug\n // console.log('init component:', name);\n });\n\n const missingComponents = difference(coreComponents, registeredComponents);\n\n if (missingComponents.length) {\n // eslint-disable-next-line no-console\n console.warn(\n `Found the following missing core components: ${missingComponents.join(\n \", \"\n )}. Include a UI package such as vulcan:ui-bootstrap to add them.`\n );\n }\n};\n*/\n/**\n * Get the **raw** (original) component registered with registerComponent\n * without the possible HOCs wrapping it.\n *\n * @param {String} name The name of the component to get.\n * @returns {Function|React Component} An interchangeable/extendable React component\n */\nexport const getRawComponent = (name) => {\n return ComponentsTable[name].rawComponent;\n};\n\n/**\n * Replace a Vulcan component with the same name with a new component or\n * an extension of the raw component and one or more optional higher order components.\n * This function keeps track of the previous HOCs and wrap the new HOCs around previous ones\n *\n * @param {String} name The name of the component to register.\n * @param {React Component} newComponent Interchangeable/extendable component.\n * @param {...Function} newHocs The HOCs to compose with the raw component.\n * @returns {Function|React Component} A component callable with Components[name]\n *\n * Note: when a component is registered without higher order component, `hocs` will be\n * an empty array, and it's ok!\n * See https://github.com/reactjs/redux/blob/master/src/compose.js#L13-L15\n */\n/*\nexport function replaceComponent(name, newComponent, ...newHocs) {\n // support single argument syntax\n if (typeof arguments[0] === \"object\") {\n // eslint-disable-next-line no-redeclare\n var { name, component, hocs = [] } = arguments[0];\n newComponent = component;\n newHocs = hocs;\n }\n\n const previousComponent = ComponentsTable[name];\n const previousHocs = (previousComponent && previousComponent.hocs) || [];\n\n if (!previousComponent) {\n // eslint-disable-next-line no-console\n console.warn(\n `Trying to replace non-registered component ${name}. The component is ` +\n \"being registered. If you were trying to replace a component defined by \" +\n \"another package, make sure that you haven't misspelled the name. Check \" +\n \"also if the original component is still being registered or that it \" +\n \"hasn't been renamed.\"\n );\n }\n\n return registerComponent(name, newComponent, ...newHocs, ...previousHocs);\n}\n*/\n\n/*\nexport const copyHoCs = (sourceComponent, targetComponent) => {\n return compose(...sourceComponent.hocs)(targetComponent);\n};\n*/\n\n/**\n * Returns an instance of the given component name of function\n * @param {string|function} component A component, the name of a component, or a react element\n * @param {Object} [props] Optional properties to pass to the component\n */\n//eslint-disable-next-line react/display-name\n// legacy\nexport const instantiateComponent = (\n component?: React.ComponentType | Function | any,\n props?: any\n) => {\n if (!component) {\n return null;\n } /*else if (typeof component === \"string\") {\n const Component = Components[component];\n return <Component {...props} />;\n } */ else if (React.isValidElement(component)) {\n return React.cloneElement(component, props);\n } else if (\n typeof component === \"function\" &&\n component.prototype &&\n component.prototype.isReactComponent\n ) {\n const Component = component as React.ComponentType<any>;\n return <Component {...props} />;\n } else if (typeof component === \"function\") {\n return component(props);\n } else if (\n typeof component === \"object\" &&\n component.$$typeof &&\n component.render\n ) {\n const Component = component as React.ComponentType<any>;\n return <Component {...props} />;\n } else {\n return component;\n }\n};\n\n/**\n * Creates a component that will render the registered component with the given name.\n *\n * This function may be useful when in need for some registered component, but in contexts\n * where they have not yet been initialized, for example at compile time execution. In other\n * words, when using `Components.ComponentName` is not allowed (because it has not yet been\n * populated, hence would be `undefined`), then `delayedComponent('ComponentName')` can be\n * used instead.\n *\n * @example Create a container for a registered component\n * // SomeContainer.js\n * import compose from 'recompose/compose';\n * import { delayedComponent } from 'meteor/vulcan:core';\n *\n * export default compose(\n * // ...some hocs with container logic\n * )(delayedComponent('ComponentName')); // cannot use Components.ComponentName in this context!\n *\n * @example {@link dynamicLoader}\n * @param {String} name Component name\n * @return {Function}\n * Functional component that will render the given registered component\n */\nexport const delayedComponent = (name) => {\n return (props) => {\n const Component = Components[name] || null;\n return Component && <Component {...props} />;\n };\n};\n\n// Example with Proxy (might be unstable/hard to reason about)\n//const mergeWithComponents = (myComponents = {}) => {\n// const handler = {\n// get: function(target, name) {\n// return name in target ? target[name] : Components[name];\n// }\n// };\n// const proxy = new Proxy(myComponents, handler);\n// return proxy;\n//};\nexport const mergeWithComponents = (myComponents) =>\n myComponents ? { ...Components, ...myComponents } : Components;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;AA4BkB,QAAA;AAClB,QAAI;AACJ,QAAI;AACJ,QAAI;AACJ,QAAI;AACJ,QAAI;AACJ,QAAI;AACJ,QAAI;AACJ,QAAI;AACJ,QAAI;AACJ,QAAI;AACJ,QAAI;AACJ,QAAC;QACG;QACA;;;;;;;;;;;cASA,SAAS;UACL,OAAI,OAAO,WAAW,WAAA,SAAA,OAAA,SAAA,WAAA,OAAA,OAAA,SAAA,WAAA,OAAA,CAAA;iBAClB,WAAW,cAAa,OAAK,KAAU;wBAC5B;;oBAAuD,UAAA;kBAE7D,eAAA,MAAA,eAAA,QAAA,CAAA,CAAA;;iBAEJ,OAAA,WAAA,YAAA,OAAA,OAAA,YAAA,UAAA;gBACJ,eAAA,MAAA,eAAA,OAAA,OAAA,CAAA,CAAA;aACD;gBAA0B,eAAkB,IAAG,CAAA;;8BAClD,UAAA,UAAA;AAEJ,YAAU,aAAU,MAAA;AACb,cAAA,OAAa,OAAS,WAAC,YACtB;AAAE,mBAAa,eAAA,UAAA,cAAA;cAAc,OAAS;YAAoB,CAAA;UAC3D,OAAW;AAAgB,qBAAQ,aAAW;UAAoD;QAEtG;AACI,eAAI,SAAQ,IAAK,GAAA;AAEjB,iBAAA,SAAm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,WAAyB;AACxE,QAAM,kBAAkB,OAAO,GAAG;AAClC,QAAM,eAAe,mBAAmB,cAAc,eAAe;AACrE,SAAO;GAHoB;AAO7B,IAAM,sBAAsB,wBAAC,gBAAmC;AAC9D,QAAM,YAAY,cAAc,WAAW;AAC3C,SAAO,aAAa,OAAO,cAAc;GAFf;AAI5B,IAAM,wBAAwB,wBAAC,WAAmB,WAAyB;AACzE,QAAM,cAAc,OAAO;AAC3B,MAAI,CAAC,oBAAoB,WAAW;AAAG,WAAO;AAC9C,QAAM,eAAe,eAAe,cAAc,WAAW;AAC7D,SAAO;GAJqB;AAWvB,IAAM,6BAA6B,wBAAC,WAAW,WAAW;AAC/D,QAAM,kBAAkB,qBAAqB,WAAW,MAAM;AAC9D,MAAI,CAAC,iBAAiB;AAEpB,UAAM,mBAAmB,sBAAsB,WAAW,MAAM;AAEhE,QAAI,CAAC;AAAkB,aAAO;AAC9B,WAAO;;AAET,SAAO;GATiC;AAYnC,IAAM,mBAAmB;EAC9B;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAGK,IAAM,iBAAiB;EAC5B;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;;AGxPF;AAaA;AACA;AACA;AACA;AACA;AAQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA0BO,IAAM,WAAW,wBACtB,OACA,YACA,SACA,WACA,gBACG;AACH,QAAM,iBAAiB,MAAM,KAAK,YAAW;AAC7C,QAAM,QAAQ,YA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