@verbb/plugin-kit-forms 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["../src/FormStateStore.ts","../src/normalizeSchema.ts","../../node_modules/@babel/runtime/helpers/interopRequireDefault.js","../../node_modules/@babel/runtime/helpers/typeof.js","../../node_modules/@babel/runtime/helpers/toPrimitive.js","../../node_modules/@babel/runtime/helpers/toPropertyKey.js","../../node_modules/@babel/runtime/helpers/defineProperty.js","../../node_modules/@babel/runtime/helpers/classCallCheck.js","../../node_modules/@babel/runtime/helpers/createClass.js","../../node_modules/@babel/runtime/helpers/arrayLikeToArray.js","../../node_modules/@babel/runtime/helpers/arrayWithoutHoles.js","../../node_modules/@babel/runtime/helpers/iterableToArray.js","../../node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js","../../node_modules/@babel/runtime/helpers/nonIterableSpread.js","../../node_modules/@babel/runtime/helpers/toConsumableArray.js","../../node_modules/jexl/dist/evaluator/handlers.js","../../node_modules/jexl/dist/evaluator/Evaluator.js","../../node_modules/jexl/dist/Lexer.js","../../node_modules/jexl/dist/parser/handlers.js","../../node_modules/jexl/dist/parser/states.js","../../node_modules/jexl/dist/parser/Parser.js","../../node_modules/jexl/dist/PromiseSync.js","../../node_modules/jexl/dist/Expression.js","../../node_modules/jexl/dist/grammar.js","../../node_modules/jexl/dist/Jexl.js","../src/schema.ts","../src/buildGroupedMessage.ts","../src/translate.ts","../src/rules/email.ts","../src/rules/emailOrVariable.ts","../src/rules/handle.ts","../src/rules/utils.ts","../src/rules/max.ts","../src/rules/min.ts","../src/rules/required.ts","../src/rules/requiredRichText.ts","../src/rules/requiredRules.ts","../src/rules/uniqueHandle.ts","../src/rules/index.ts","../src/ValidationEngine.ts"],"sourcesContent":["import { get, set } from 'lodash-es';\n\ntype FormSubscriber = () => void;\n\nexport type FormState = {\n values: Record<string, unknown>;\n errors: Record<string, string[]>;\n touched: Set<string>;\n dirty: Set<string>;\n};\n\nexport class FormStateStore {\n state: FormState;\n\n private listeners: Set<FormSubscriber> = new Set();\n\n private initialValues: Record<string, unknown>;\n\n constructor(initialValues: Record<string, unknown> = {}) {\n this.initialValues = { ...initialValues };\n this.state = {\n values: { ...initialValues },\n errors: {},\n touched: new Set(),\n dirty: new Set(),\n };\n }\n\n subscribe(listener: FormSubscriber): () => void {\n this.listeners.add(listener);\n return () => {\n this.listeners.delete(listener);\n };\n }\n\n notify() {\n this.listeners.forEach((listener) => { listener(); });\n }\n\n getValue(path: string): unknown {\n return get(this.state.values, path);\n }\n\n setValue(path: string, value: unknown) {\n const nextErrors = { ...this.state.errors };\n if (path in nextErrors) {\n delete nextErrors[path];\n }\n // When replacing an array (e.g. options), clear errors for descendant paths\n // so indices stay in sync after add/remove/reorder\n if (Array.isArray(value)) {\n const descendantPrefix = `${path}.`;\n Object.keys(nextErrors).forEach((key) => {\n if (key.startsWith(descendantPrefix)) {\n delete nextErrors[key];\n }\n });\n }\n\n this.state = {\n ...this.state,\n values: (() => {\n const cloneRoot: Record<string, unknown> = Array.isArray(this.state.values)\n ? ([...this.state.values] as unknown as Record<string, unknown>)\n : { ...(this.state.values ?? {}) };\n set(cloneRoot, path, value);\n return cloneRoot;\n })(),\n dirty: new Set(this.state.dirty).add(path),\n errors: nextErrors,\n };\n this.notify();\n }\n\n setValues(values: Record<string, unknown>) {\n this.state = {\n ...this.state,\n values: { ...values },\n };\n this.notify();\n }\n\n setErrors(errors: Record<string, string[]>) {\n this.state = {\n ...this.state,\n errors: { ...errors },\n };\n this.notify();\n }\n\n clearErrors() {\n this.state = {\n ...this.state,\n errors: {},\n };\n this.notify();\n }\n\n setTouched(path: string, touched = true) {\n const currentlyTouched = this.state.touched.has(path);\n if (currentlyTouched === touched) {\n return;\n }\n\n const nextTouched = new Set(this.state.touched);\n if (touched) {\n nextTouched.add(path);\n } else {\n nextTouched.delete(path);\n }\n\n this.state = {\n ...this.state,\n touched: nextTouched,\n };\n this.notify();\n }\n\n reset(values: Record<string, unknown> = this.initialValues) {\n this.initialValues = { ...values };\n this.state = {\n values: { ...values },\n errors: {},\n touched: new Set(),\n dirty: new Set(),\n };\n this.notify();\n }\n}\n","import type { SchemaNode, SchemaRenderable } from './types';\n\nexport const normalizeSchema = (items: SchemaRenderable, path = 'root'): SchemaRenderable => {\n if (Array.isArray(items)) {\n return items.map((item, index) => {\n return normalizeSchema(item, `${path}.${index}`);\n });\n }\n\n if (!items || typeof items !== 'object') {\n return items;\n }\n\n const itemWithId: SchemaNode = { ...items };\n const itemPath = path || 'root';\n\n if (!itemWithId._id) {\n itemWithId._id = `schema_${itemPath}`;\n }\n\n if (Array.isArray(itemWithId.children)) {\n itemWithId.children = itemWithId.children.map((child, index) => {\n return normalizeSchema(child, `${itemPath}.children.${index}`);\n });\n }\n\n if (Array.isArray(itemWithId.schema)) {\n itemWithId.schema = itemWithId.schema.map((child, index) => {\n return normalizeSchema(child, `${itemPath}.schema.${index}`);\n });\n }\n\n return itemWithId;\n};\n","function _interopRequireDefault(e) {\n return e && e.__esModule ? e : {\n \"default\": e\n };\n}\nmodule.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return module.exports = _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports, _typeof(o);\n}\nmodule.exports = _typeof, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var _typeof = require(\"./typeof.js\")[\"default\"];\nfunction toPrimitive(t, r) {\n if (\"object\" != _typeof(t) || !t) return t;\n var e = t[Symbol.toPrimitive];\n if (void 0 !== e) {\n var i = e.call(t, r || \"default\");\n if (\"object\" != _typeof(i)) return i;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (\"string\" === r ? String : Number)(t);\n}\nmodule.exports = toPrimitive, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var _typeof = require(\"./typeof.js\")[\"default\"];\nvar toPrimitive = require(\"./toPrimitive.js\");\nfunction toPropertyKey(t) {\n var i = toPrimitive(t, \"string\");\n return \"symbol\" == _typeof(i) ? i : i + \"\";\n}\nmodule.exports = toPropertyKey, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var toPropertyKey = require(\"./toPropertyKey.js\");\nfunction _defineProperty(e, r, t) {\n return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {\n value: t,\n enumerable: !0,\n configurable: !0,\n writable: !0\n }) : e[r] = t, e;\n}\nmodule.exports = _defineProperty, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _classCallCheck(a, n) {\n if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\");\n}\nmodule.exports = _classCallCheck, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var toPropertyKey = require(\"./toPropertyKey.js\");\nfunction _defineProperties(e, r) {\n for (var t = 0; t < r.length; t++) {\n var o = r[t];\n o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, toPropertyKey(o.key), o);\n }\n}\nfunction _createClass(e, r, t) {\n return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", {\n writable: !1\n }), e;\n}\nmodule.exports = _createClass, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _arrayLikeToArray(r, a) {\n (null == a || a > r.length) && (a = r.length);\n for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];\n return n;\n}\nmodule.exports = _arrayLikeToArray, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var arrayLikeToArray = require(\"./arrayLikeToArray.js\");\nfunction _arrayWithoutHoles(r) {\n if (Array.isArray(r)) return arrayLikeToArray(r);\n}\nmodule.exports = _arrayWithoutHoles, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _iterableToArray(r) {\n if (\"undefined\" != typeof Symbol && null != r[Symbol.iterator] || null != r[\"@@iterator\"]) return Array.from(r);\n}\nmodule.exports = _iterableToArray, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var arrayLikeToArray = require(\"./arrayLikeToArray.js\");\nfunction _unsupportedIterableToArray(r, a) {\n if (r) {\n if (\"string\" == typeof r) return arrayLikeToArray(r, a);\n var t = {}.toString.call(r).slice(8, -1);\n return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? arrayLikeToArray(r, a) : void 0;\n }\n}\nmodule.exports = _unsupportedIterableToArray, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\nmodule.exports = _nonIterableSpread, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var arrayWithoutHoles = require(\"./arrayWithoutHoles.js\");\nvar iterableToArray = require(\"./iterableToArray.js\");\nvar unsupportedIterableToArray = require(\"./unsupportedIterableToArray.js\");\nvar nonIterableSpread = require(\"./nonIterableSpread.js\");\nfunction _toConsumableArray(r) {\n return arrayWithoutHoles(r) || iterableToArray(r) || unsupportedIterableToArray(r) || nonIterableSpread();\n}\nmodule.exports = _toConsumableArray, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\n\nvar _toConsumableArray2 = _interopRequireDefault(require(\"@babel/runtime/helpers/toConsumableArray\"));\n\n/*\n * Jexl\n * Copyright 2020 Tom Shawver\n */\nvar poolNames = {\n functions: 'Jexl Function',\n transforms: 'Transform'\n};\n/**\n * Evaluates an ArrayLiteral by returning its value, with each element\n * independently run through the evaluator.\n * @param {{type: 'ObjectLiteral', value: <{}>}} ast An expression tree with an\n * ObjectLiteral as the top node\n * @returns {Promise.<[]>} resolves to a map contained evaluated values.\n * @private\n */\n\nexports.ArrayLiteral = function (ast) {\n return this.evalArray(ast.value);\n};\n/**\n * Evaluates a BinaryExpression node by running the Grammar's evaluator for\n * the given operator. Note that binary expressions support two types of\n * evaluators: `eval` is called with the left and right operands pre-evaluated.\n * `evalOnDemand`, if it exists, will be called with the left and right operands\n * each individually wrapped in an object with an \"eval\" function that returns\n * a promise with the resulting value. This allows the binary expression to\n * evaluate the operands conditionally.\n * @param {{type: 'BinaryExpression', operator: <string>, left: {},\n * right: {}}} ast An expression tree with a BinaryExpression as the top\n * node\n * @returns {Promise<*>} resolves with the value of the BinaryExpression.\n * @private\n */\n\n\nexports.BinaryExpression = function (ast) {\n var _this = this;\n\n var grammarOp = this._grammar.elements[ast.operator];\n\n if (grammarOp.evalOnDemand) {\n var wrap = function wrap(subAst) {\n return {\n eval: function _eval() {\n return _this.eval(subAst);\n }\n };\n };\n\n return grammarOp.evalOnDemand(wrap(ast.left), wrap(ast.right));\n }\n\n return this.Promise.all([this.eval(ast.left), this.eval(ast.right)]).then(function (arr) {\n return grammarOp.eval(arr[0], arr[1]);\n });\n};\n/**\n * Evaluates a ConditionalExpression node by first evaluating its test branch,\n * and resolving with the consequent branch if the test is truthy, or the\n * alternate branch if it is not. If there is no consequent branch, the test\n * result will be used instead.\n * @param {{type: 'ConditionalExpression', test: {}, consequent: {},\n * alternate: {}}} ast An expression tree with a ConditionalExpression as\n * the top node\n * @private\n */\n\n\nexports.ConditionalExpression = function (ast) {\n var _this2 = this;\n\n return this.eval(ast.test).then(function (res) {\n if (res) {\n if (ast.consequent) {\n return _this2.eval(ast.consequent);\n }\n\n return res;\n }\n\n return _this2.eval(ast.alternate);\n });\n};\n/**\n * Evaluates a FilterExpression by applying it to the subject value.\n * @param {{type: 'FilterExpression', relative: <boolean>, expr: {},\n * subject: {}}} ast An expression tree with a FilterExpression as the top\n * node\n * @returns {Promise<*>} resolves with the value of the FilterExpression.\n * @private\n */\n\n\nexports.FilterExpression = function (ast) {\n var _this3 = this;\n\n return this.eval(ast.subject).then(function (subject) {\n if (ast.relative) {\n return _this3._filterRelative(subject, ast.expr);\n }\n\n return _this3._filterStatic(subject, ast.expr);\n });\n};\n/**\n * Evaluates an Identifier by either stemming from the evaluated 'from'\n * expression tree or accessing the context provided when this Evaluator was\n * constructed.\n * @param {{type: 'Identifier', value: <string>, [from]: {}}} ast An expression\n * tree with an Identifier as the top node\n * @returns {Promise<*>|*} either the identifier's value, or a Promise that\n * will resolve with the identifier's value.\n * @private\n */\n\n\nexports.Identifier = function (ast) {\n if (!ast.from) {\n return ast.relative ? this._relContext[ast.value] : this._context[ast.value];\n }\n\n return this.eval(ast.from).then(function (context) {\n if (context === undefined || context === null) {\n return undefined;\n }\n\n if (Array.isArray(context)) {\n context = context[0];\n }\n\n return context[ast.value];\n });\n};\n/**\n * Evaluates a Literal by returning its value property.\n * @param {{type: 'Literal', value: <string|number|boolean>}} ast An expression\n * tree with a Literal as its only node\n * @returns {string|number|boolean} The value of the Literal node\n * @private\n */\n\n\nexports.Literal = function (ast) {\n return ast.value;\n};\n/**\n * Evaluates an ObjectLiteral by returning its value, with each key\n * independently run through the evaluator.\n * @param {{type: 'ObjectLiteral', value: <{}>}} ast An expression tree with an\n * ObjectLiteral as the top node\n * @returns {Promise<{}>} resolves to a map contained evaluated values.\n * @private\n */\n\n\nexports.ObjectLiteral = function (ast) {\n return this.evalMap(ast.value);\n};\n/**\n * Evaluates a FunctionCall node by applying the supplied arguments to a\n * function defined in one of the grammar's function pools.\n * @param {{type: 'FunctionCall', name: <string>}} ast An\n * expression tree with a FunctionCall as the top node\n * @returns {Promise<*>|*} the value of the function call, or a Promise that\n * will resolve with the resulting value.\n * @private\n */\n\n\nexports.FunctionCall = function (ast) {\n var poolName = poolNames[ast.pool];\n\n if (!poolName) {\n throw new Error(\"Corrupt AST: Pool '\".concat(ast.pool, \"' not found\"));\n }\n\n var pool = this._grammar[ast.pool];\n var func = pool[ast.name];\n\n if (!func) {\n throw new Error(\"\".concat(poolName, \" \").concat(ast.name, \" is not defined.\"));\n }\n\n return this.evalArray(ast.args || []).then(function (args) {\n return func.apply(void 0, (0, _toConsumableArray2.default)(args));\n });\n};\n/**\n * Evaluates a Unary expression by passing the right side through the\n * operator's eval function.\n * @param {{type: 'UnaryExpression', operator: <string>, right: {}}} ast An\n * expression tree with a UnaryExpression as the top node\n * @returns {Promise<*>} resolves with the value of the UnaryExpression.\n * @constructor\n */\n\n\nexports.UnaryExpression = function (ast) {\n var _this4 = this;\n\n return this.eval(ast.right).then(function (right) {\n return _this4._grammar.elements[ast.operator].eval(right);\n });\n};","\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\n\nvar _classCallCheck2 = _interopRequireDefault(require(\"@babel/runtime/helpers/classCallCheck\"));\n\nvar _createClass2 = _interopRequireDefault(require(\"@babel/runtime/helpers/createClass\"));\n\n/*\n * Jexl\n * Copyright 2020 Tom Shawver\n */\nvar handlers = require('./handlers');\n/**\n * The Evaluator takes a Jexl expression tree as generated by the\n * {@link Parser} and calculates its value within a given context. The\n * collection of transforms, context, and a relative context to be used as the\n * root for relative identifiers, are all specific to an Evaluator instance.\n * When any of these things change, a new instance is required. However, a\n * single instance can be used to simultaneously evaluate many different\n * expressions, and does not have to be reinstantiated for each.\n * @param {{}} grammar A grammar object against which to evaluate the expression\n * tree\n * @param {{}} [context] A map of variable keys to their values. This will be\n * accessed to resolve the value of each non-relative identifier. Any\n * Promise values will be passed to the expression as their resolved\n * value.\n * @param {{}|Array<{}|Array>} [relativeContext] A map or array to be accessed\n * to resolve the value of a relative identifier.\n * @param {function} promise A constructor for the Promise class to be used;\n * probably either Promise or PromiseSync.\n */\n\n\nvar Evaluator = /*#__PURE__*/function () {\n function Evaluator(grammar, context, relativeContext) {\n var promise = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : Promise;\n (0, _classCallCheck2.default)(this, Evaluator);\n this._grammar = grammar;\n this._context = context || {};\n this._relContext = relativeContext || this._context;\n this.Promise = promise;\n }\n /**\n * Evaluates an expression tree within the configured context.\n * @param {{}} ast An expression tree object\n * @returns {Promise<*>} resolves with the resulting value of the expression.\n */\n\n\n (0, _createClass2.default)(Evaluator, [{\n key: \"eval\",\n value: function _eval(ast) {\n var _this = this;\n\n return this.Promise.resolve().then(function () {\n return handlers[ast.type].call(_this, ast);\n });\n }\n /**\n * Simultaneously evaluates each expression within an array, and delivers the\n * response as an array with the resulting values at the same indexes as their\n * originating expressions.\n * @param {Array<string>} arr An array of expression strings to be evaluated\n * @returns {Promise<Array<{}>>} resolves with the result array\n */\n\n }, {\n key: \"evalArray\",\n value: function evalArray(arr) {\n var _this2 = this;\n\n return this.Promise.all(arr.map(function (elem) {\n return _this2.eval(elem);\n }));\n }\n /**\n * Simultaneously evaluates each expression within a map, and delivers the\n * response as a map with the same keys, but with the evaluated result for each\n * as their value.\n * @param {{}} map A map of expression names to expression trees to be\n * evaluated\n * @returns {Promise<{}>} resolves with the result map.\n */\n\n }, {\n key: \"evalMap\",\n value: function evalMap(map) {\n var _this3 = this;\n\n var keys = Object.keys(map);\n var result = {};\n var asts = keys.map(function (key) {\n return _this3.eval(map[key]);\n });\n return this.Promise.all(asts).then(function (vals) {\n vals.forEach(function (val, idx) {\n result[keys[idx]] = val;\n });\n return result;\n });\n }\n /**\n * Applies a filter expression with relative identifier elements to a subject.\n * The intent is for the subject to be an array of subjects that will be\n * individually used as the relative context against the provided expression\n * tree. Only the elements whose expressions result in a truthy value will be\n * included in the resulting array.\n *\n * If the subject is not an array of values, it will be converted to a single-\n * element array before running the filter.\n * @param {*} subject The value to be filtered usually an array. If this value is\n * not an array, it will be converted to an array with this value as the\n * only element.\n * @param {{}} expr The expression tree to run against each subject. If the\n * tree evaluates to a truthy result, then the value will be included in\n * the returned array otherwise, it will be eliminated.\n * @returns {Promise<Array>} resolves with an array of values that passed the\n * expression filter.\n * @private\n */\n\n }, {\n key: \"_filterRelative\",\n value: function _filterRelative(subject, expr) {\n var _this4 = this;\n\n var promises = [];\n\n if (!Array.isArray(subject)) {\n subject = subject === undefined ? [] : [subject];\n }\n\n subject.forEach(function (elem) {\n var evalInst = new Evaluator(_this4._grammar, _this4._context, elem, _this4.Promise);\n promises.push(evalInst.eval(expr));\n });\n return this.Promise.all(promises).then(function (values) {\n var results = [];\n values.forEach(function (value, idx) {\n if (value) {\n results.push(subject[idx]);\n }\n });\n return results;\n });\n }\n /**\n * Applies a static filter expression to a subject value. If the filter\n * expression evaluates to boolean true, the subject is returned if false,\n * undefined.\n *\n * For any other resulting value of the expression, this function will attempt\n * to respond with the property at that name or index of the subject.\n * @param {*} subject The value to be filtered. Usually an Array (for which\n * the expression would generally resolve to a numeric index) or an\n * Object (for which the expression would generally resolve to a string\n * indicating a property name)\n * @param {{}} expr The expression tree to run against the subject\n * @returns {Promise<*>} resolves with the value of the drill-down.\n * @private\n */\n\n }, {\n key: \"_filterStatic\",\n value: function _filterStatic(subject, expr) {\n return this.eval(expr).then(function (res) {\n if (typeof res === 'boolean') {\n return res ? subject : undefined;\n }\n\n return subject[res];\n });\n }\n }]);\n return Evaluator;\n}();\n\nmodule.exports = Evaluator;","\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\n\nvar _classCallCheck2 = _interopRequireDefault(require(\"@babel/runtime/helpers/classCallCheck\"));\n\nvar _createClass2 = _interopRequireDefault(require(\"@babel/runtime/helpers/createClass\"));\n\n/*\n * Jexl\n * Copyright 2020 Tom Shawver\n */\nvar numericRegex = /^-?(?:(?:[0-9]*\\.[0-9]+)|[0-9]+)$/;\nvar identRegex = /^[a-zA-Zа-яА-Я_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u00FF$][a-zA-Zа-яА-Я0-9_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u00FF$]*$/;\nvar escEscRegex = /\\\\\\\\/;\nvar whitespaceRegex = /^\\s*$/;\nvar preOpRegexElems = [// Strings\n\"'(?:(?:\\\\\\\\')|[^'])*'\", '\"(?:(?:\\\\\\\\\")|[^\"])*\"', // Whitespace\n'\\\\s+', // Booleans\n'\\\\btrue\\\\b', '\\\\bfalse\\\\b'];\nvar postOpRegexElems = [// Identifiers\n\"[a-zA-Z\\u0430-\\u044F\\u0410-\\u042F_\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\xFF\\\\$][a-zA-Z0-9\\u0430-\\u044F\\u0410-\\u042F_\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\xFF\\\\$]*\", // Numerics (without negative symbol)\n'(?:(?:[0-9]*\\\\.[0-9]+)|[0-9]+)'];\nvar minusNegatesAfter = ['binaryOp', 'unaryOp', 'openParen', 'openBracket', 'question', 'colon'];\n/**\n * Lexer is a collection of stateless, statically-accessed functions for the\n * lexical parsing of a Jexl string. Its responsibility is to identify the\n * \"parts of speech\" of a Jexl expression, and tokenize and label each, but\n * to do only the most minimal syntax checking; the only errors the Lexer\n * should be concerned with are if it's unable to identify the utility of\n * any of its tokens. Errors stemming from these tokens not being in a\n * sensible configuration should be left for the Parser to handle.\n * @type {{}}\n */\n\nvar Lexer = /*#__PURE__*/function () {\n function Lexer(grammar) {\n (0, _classCallCheck2.default)(this, Lexer);\n this._grammar = grammar;\n }\n /**\n * Splits a Jexl expression string into an array of expression elements.\n * @param {string} str A Jexl expression string\n * @returns {Array<string>} An array of substrings defining the functional\n * elements of the expression.\n */\n\n\n (0, _createClass2.default)(Lexer, [{\n key: \"getElements\",\n value: function getElements(str) {\n var regex = this._getSplitRegex();\n\n return str.split(regex).filter(function (elem) {\n // Remove empty strings\n return elem;\n });\n }\n /**\n * Converts an array of expression elements into an array of tokens. Note that\n * the resulting array may not equal the element array in length, as any\n * elements that consist only of whitespace get appended to the previous\n * token's \"raw\" property. For the structure of a token object, please see\n * {@link Lexer#tokenize}.\n * @param {Array<string>} elements An array of Jexl expression elements to be\n * converted to tokens\n * @returns {Array<{type, value, raw}>} an array of token objects.\n */\n\n }, {\n key: \"getTokens\",\n value: function getTokens(elements) {\n var tokens = [];\n var negate = false;\n\n for (var i = 0; i < elements.length; i++) {\n if (this._isWhitespace(elements[i])) {\n if (tokens.length) {\n tokens[tokens.length - 1].raw += elements[i];\n }\n } else if (elements[i] === '-' && this._isNegative(tokens)) {\n negate = true;\n } else {\n if (negate) {\n elements[i] = '-' + elements[i];\n negate = false;\n }\n\n tokens.push(this._createToken(elements[i]));\n }\n } // Catch a - at the end of the string. Let the parser handle that issue.\n\n\n if (negate) {\n tokens.push(this._createToken('-'));\n }\n\n return tokens;\n }\n /**\n * Converts a Jexl string into an array of tokens. Each token is an object\n * in the following format:\n *\n * {\n * type: <string>,\n * [name]: <string>,\n * value: <boolean|number|string>,\n * raw: <string>\n * }\n *\n * Type is one of the following:\n *\n * literal, identifier, binaryOp, unaryOp\n *\n * OR, if the token is a control character its type is the name of the element\n * defined in the Grammar.\n *\n * Name appears only if the token is a control string found in\n * {@link grammar#elements}, and is set to the name of the element.\n *\n * Value is the value of the token in the correct type (boolean or numeric as\n * appropriate). Raw is the string representation of this value taken directly\n * from the expression string, including any trailing spaces.\n * @param {string} str The Jexl string to be tokenized\n * @returns {Array<{type, value, raw}>} an array of token objects.\n * @throws {Error} if the provided string contains an invalid token.\n */\n\n }, {\n key: \"tokenize\",\n value: function tokenize(str) {\n var elements = this.getElements(str);\n return this.getTokens(elements);\n }\n /**\n * Creates a new token object from an element of a Jexl string. See\n * {@link Lexer#tokenize} for a description of the token object.\n * @param {string} element The element from which a token should be made\n * @returns {{value: number|boolean|string, [name]: string, type: string,\n * raw: string}} a token object describing the provided element.\n * @throws {Error} if the provided string is not a valid expression element.\n * @private\n */\n\n }, {\n key: \"_createToken\",\n value: function _createToken(element) {\n var token = {\n type: 'literal',\n value: element,\n raw: element\n };\n\n if (element[0] === '\"' || element[0] === \"'\") {\n token.value = this._unquote(element);\n } else if (element.match(numericRegex)) {\n token.value = parseFloat(element);\n } else if (element === 'true' || element === 'false') {\n token.value = element === 'true';\n } else if (this._grammar.elements[element]) {\n token.type = this._grammar.elements[element].type;\n } else if (element.match(identRegex)) {\n token.type = 'identifier';\n } else {\n throw new Error(\"Invalid expression token: \".concat(element));\n }\n\n return token;\n }\n /**\n * Escapes a string so that it can be treated as a string literal within a\n * regular expression.\n * @param {string} str The string to be escaped\n * @returns {string} the RegExp-escaped string.\n * @see https://developer.mozilla.org/en/docs/Web/JavaScript/Guide/Regular_Expressions\n * @private\n */\n\n }, {\n key: \"_escapeRegExp\",\n value: function _escapeRegExp(str) {\n str = str.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n\n if (str.match(identRegex)) {\n str = '\\\\b' + str + '\\\\b';\n }\n\n return str;\n }\n /**\n * Gets a RegEx object appropriate for splitting a Jexl string into its core\n * elements.\n * @returns {RegExp} An element-splitting RegExp object\n * @private\n */\n\n }, {\n key: \"_getSplitRegex\",\n value: function _getSplitRegex() {\n var _this = this;\n\n if (!this._splitRegex) {\n // Sort by most characters to least, then regex escape each\n var elemArray = Object.keys(this._grammar.elements).sort(function (a, b) {\n return b.length - a.length;\n }).map(function (elem) {\n return _this._escapeRegExp(elem);\n }, this);\n this._splitRegex = new RegExp('(' + [preOpRegexElems.join('|'), elemArray.join('|'), postOpRegexElems.join('|')].join('|') + ')');\n }\n\n return this._splitRegex;\n }\n /**\n * Determines whether the addition of a '-' token should be interpreted as a\n * negative symbol for an upcoming number, given an array of tokens already\n * processed.\n * @param {Array<Object>} tokens An array of tokens already processed\n * @returns {boolean} true if adding a '-' should be considered a negative\n * symbol; false otherwise\n * @private\n */\n\n }, {\n key: \"_isNegative\",\n value: function _isNegative(tokens) {\n if (!tokens.length) return true;\n return minusNegatesAfter.some(function (type) {\n return type === tokens[tokens.length - 1].type;\n });\n }\n /**\n * A utility function to determine if a string consists of only space\n * characters.\n * @param {string} str A string to be tested\n * @returns {boolean} true if the string is empty or consists of only spaces;\n * false otherwise.\n * @private\n */\n\n }, {\n key: \"_isWhitespace\",\n value: function _isWhitespace(str) {\n return !!str.match(whitespaceRegex);\n }\n /**\n * Removes the beginning and trailing quotes from a string, unescapes any\n * escaped quotes on its interior, and unescapes any escaped escape\n * characters. Note that this function is not defensive; it assumes that the\n * provided string is not empty, and that its first and last characters are\n * actually quotes.\n * @param {string} str A string whose first and last characters are quotes\n * @returns {string} a string with the surrounding quotes stripped and escapes\n * properly processed.\n * @private\n */\n\n }, {\n key: \"_unquote\",\n value: function _unquote(str) {\n var quote = str[0];\n var escQuoteRegex = new RegExp('\\\\\\\\' + quote, 'g');\n return str.substr(1, str.length - 2).replace(escQuoteRegex, quote).replace(escEscRegex, '\\\\');\n }\n }]);\n return Lexer;\n}();\n\nmodule.exports = Lexer;","\"use strict\";\n\n/*\n * Jexl\n * Copyright 2020 Tom Shawver\n */\n\n/**\n * Handles a subexpression that's used to define a transform argument's value.\n * @param {{type: <string>}} ast The subexpression tree\n */\nexports.argVal = function (ast) {\n if (ast) this._cursor.args.push(ast);\n};\n/**\n * Handles new array literals by adding them as a new node in the AST,\n * initialized with an empty array.\n */\n\n\nexports.arrayStart = function () {\n this._placeAtCursor({\n type: 'ArrayLiteral',\n value: []\n });\n};\n/**\n * Handles a subexpression representing an element of an array literal.\n * @param {{type: <string>}} ast The subexpression tree\n */\n\n\nexports.arrayVal = function (ast) {\n if (ast) {\n this._cursor.value.push(ast);\n }\n};\n/**\n * Handles tokens of type 'binaryOp', indicating an operation that has two\n * inputs: a left side and a right side.\n * @param {{type: <string>}} token A token object\n */\n\n\nexports.binaryOp = function (token) {\n var precedence = this._grammar.elements[token.value].precedence || 0;\n var parent = this._cursor._parent;\n\n while (parent && parent.operator && this._grammar.elements[parent.operator].precedence >= precedence) {\n this._cursor = parent;\n parent = parent._parent;\n }\n\n var node = {\n type: 'BinaryExpression',\n operator: token.value,\n left: this._cursor\n };\n\n this._setParent(this._cursor, node);\n\n this._cursor = parent;\n\n this._placeAtCursor(node);\n};\n/**\n * Handles successive nodes in an identifier chain. More specifically, it\n * sets values that determine how the following identifier gets placed in the\n * AST.\n */\n\n\nexports.dot = function () {\n this._nextIdentEncapsulate = this._cursor && this._cursor.type !== 'UnaryExpression' && (this._cursor.type !== 'BinaryExpression' || this._cursor.type === 'BinaryExpression' && this._cursor.right);\n this._nextIdentRelative = !this._cursor || this._cursor && !this._nextIdentEncapsulate;\n\n if (this._nextIdentRelative) {\n this._relative = true;\n }\n};\n/**\n * Handles a subexpression used for filtering an array returned by an\n * identifier chain.\n * @param {{type: <string>}} ast The subexpression tree\n */\n\n\nexports.filter = function (ast) {\n this._placeBeforeCursor({\n type: 'FilterExpression',\n expr: ast,\n relative: this._subParser.isRelative(),\n subject: this._cursor\n });\n};\n/**\n * Handles identifier tokens when used to indicate the name of a function to\n * be called.\n * @param {{type: <string>}} token A token object\n */\n\n\nexports.functionCall = function () {\n this._placeBeforeCursor({\n type: 'FunctionCall',\n name: this._cursor.value,\n args: [],\n pool: 'functions'\n });\n};\n/**\n * Handles identifier tokens by adding them as a new node in the AST.\n * @param {{type: <string>}} token A token object\n */\n\n\nexports.identifier = function (token) {\n var node = {\n type: 'Identifier',\n value: token.value\n };\n\n if (this._nextIdentEncapsulate) {\n node.from = this._cursor;\n\n this._placeBeforeCursor(node);\n\n this._nextIdentEncapsulate = false;\n } else {\n if (this._nextIdentRelative) {\n node.relative = true;\n this._nextIdentRelative = false;\n }\n\n this._placeAtCursor(node);\n }\n};\n/**\n * Handles literal values, such as strings, booleans, and numerics, by adding\n * them as a new node in the AST.\n * @param {{type: <string>}} token A token object\n */\n\n\nexports.literal = function (token) {\n this._placeAtCursor({\n type: 'Literal',\n value: token.value\n });\n};\n/**\n * Queues a new object literal key to be written once a value is collected.\n * @param {{type: <string>}} token A token object\n */\n\n\nexports.objKey = function (token) {\n this._curObjKey = token.value;\n};\n/**\n * Handles new object literals by adding them as a new node in the AST,\n * initialized with an empty object.\n */\n\n\nexports.objStart = function () {\n this._placeAtCursor({\n type: 'ObjectLiteral',\n value: {}\n });\n};\n/**\n * Handles an object value by adding its AST to the queued key on the object\n * literal node currently at the cursor.\n * @param {{type: <string>}} ast The subexpression tree\n */\n\n\nexports.objVal = function (ast) {\n this._cursor.value[this._curObjKey] = ast;\n};\n/**\n * Handles traditional subexpressions, delineated with the groupStart and\n * groupEnd elements.\n * @param {{type: <string>}} ast The subexpression tree\n */\n\n\nexports.subExpression = function (ast) {\n this._placeAtCursor(ast);\n};\n/**\n * Handles a completed alternate subexpression of a ternary operator.\n * @param {{type: <string>}} ast The subexpression tree\n */\n\n\nexports.ternaryEnd = function (ast) {\n this._cursor.alternate = ast;\n};\n/**\n * Handles a completed consequent subexpression of a ternary operator.\n * @param {{type: <string>}} ast The subexpression tree\n */\n\n\nexports.ternaryMid = function (ast) {\n this._cursor.consequent = ast;\n};\n/**\n * Handles the start of a new ternary expression by encapsulating the entire\n * AST in a ConditionalExpression node, and using the existing tree as the\n * test element.\n */\n\n\nexports.ternaryStart = function () {\n this._tree = {\n type: 'ConditionalExpression',\n test: this._tree\n };\n this._cursor = this._tree;\n};\n/**\n * Handles identifier tokens when used to indicate the name of a transform to\n * be applied.\n * @param {{type: <string>}} token A token object\n */\n\n\nexports.transform = function (token) {\n this._placeBeforeCursor({\n type: 'FunctionCall',\n name: token.value,\n args: [this._cursor],\n pool: 'transforms'\n });\n};\n/**\n * Handles token of type 'unaryOp', indicating that the operation has only\n * one input: a right side.\n * @param {{type: <string>}} token A token object\n */\n\n\nexports.unaryOp = function (token) {\n this._placeAtCursor({\n type: 'UnaryExpression',\n operator: token.value\n });\n};","\"use strict\";\n\n/*\n * Jexl\n * Copyright 2020 Tom Shawver\n */\nvar h = require('./handlers');\n/**\n * A mapping of all states in the finite state machine to a set of instructions\n * for handling or transitioning into other states. Each state can be handled\n * in one of two schemes: a tokenType map, or a subHandler.\n *\n * Standard expression elements are handled through the tokenType object. This\n * is an object map of all legal token types to encounter in this state (and\n * any unexpected token types will generate a thrown error) to an options\n * object that defines how they're handled. The available options are:\n *\n * {string} toState: The name of the state to which to transition\n * immediately after handling this token\n * {string} handler: The handler function to call when this token type is\n * encountered in this state. If omitted, the default handler\n * matching the token's \"type\" property will be called. If the handler\n * function does not exist, no call will be made and no error will be\n * generated. This is useful for tokens whose sole purpose is to\n * transition to other states.\n *\n * States that consume a subexpression should define a subHandler, the\n * function to be called with an expression tree argument when the\n * subexpression is complete. Completeness is determined through the\n * endStates object, which maps tokens on which an expression should end to the\n * state to which to transition once the subHandler function has been called.\n *\n * Additionally, any state in which it is legal to mark the AST as completed\n * should have a 'completable' property set to boolean true. Attempting to\n * call {@link Parser#complete} in any state without this property will result\n * in a thrown Error.\n *\n * @type {{}}\n */\n\n\nexports.states = {\n expectOperand: {\n tokenTypes: {\n literal: {\n toState: 'expectBinOp'\n },\n identifier: {\n toState: 'identifier'\n },\n unaryOp: {},\n openParen: {\n toState: 'subExpression'\n },\n openCurl: {\n toState: 'expectObjKey',\n handler: h.objStart\n },\n dot: {\n toState: 'traverse'\n },\n openBracket: {\n toState: 'arrayVal',\n handler: h.arrayStart\n }\n }\n },\n expectBinOp: {\n tokenTypes: {\n binaryOp: {\n toState: 'expectOperand'\n },\n pipe: {\n toState: 'expectTransform'\n },\n dot: {\n toState: 'traverse'\n },\n question: {\n toState: 'ternaryMid',\n handler: h.ternaryStart\n }\n },\n completable: true\n },\n expectTransform: {\n tokenTypes: {\n identifier: {\n toState: 'postTransform',\n handler: h.transform\n }\n }\n },\n expectObjKey: {\n tokenTypes: {\n identifier: {\n toState: 'expectKeyValSep',\n handler: h.objKey\n },\n closeCurl: {\n toState: 'expectBinOp'\n }\n }\n },\n expectKeyValSep: {\n tokenTypes: {\n colon: {\n toState: 'objVal'\n }\n }\n },\n postTransform: {\n tokenTypes: {\n openParen: {\n toState: 'argVal'\n },\n binaryOp: {\n toState: 'expectOperand'\n },\n dot: {\n toState: 'traverse'\n },\n openBracket: {\n toState: 'filter'\n },\n pipe: {\n toState: 'expectTransform'\n }\n },\n completable: true\n },\n postArgs: {\n tokenTypes: {\n binaryOp: {\n toState: 'expectOperand'\n },\n dot: {\n toState: 'traverse'\n },\n openBracket: {\n toState: 'filter'\n },\n pipe: {\n toState: 'expectTransform'\n }\n },\n completable: true\n },\n identifier: {\n tokenTypes: {\n binaryOp: {\n toState: 'expectOperand'\n },\n dot: {\n toState: 'traverse'\n },\n openBracket: {\n toState: 'filter'\n },\n openParen: {\n toState: 'argVal',\n handler: h.functionCall\n },\n pipe: {\n toState: 'expectTransform'\n },\n question: {\n toState: 'ternaryMid',\n handler: h.ternaryStart\n }\n },\n completable: true\n },\n traverse: {\n tokenTypes: {\n identifier: {\n toState: 'identifier'\n }\n }\n },\n filter: {\n subHandler: h.filter,\n endStates: {\n closeBracket: 'identifier'\n }\n },\n subExpression: {\n subHandler: h.subExpression,\n endStates: {\n closeParen: 'expectBinOp'\n }\n },\n argVal: {\n subHandler: h.argVal,\n endStates: {\n comma: 'argVal',\n closeParen: 'postArgs'\n }\n },\n objVal: {\n subHandler: h.objVal,\n endStates: {\n comma: 'expectObjKey',\n closeCurl: 'expectBinOp'\n }\n },\n arrayVal: {\n subHandler: h.arrayVal,\n endStates: {\n comma: 'arrayVal',\n closeBracket: 'expectBinOp'\n }\n },\n ternaryMid: {\n subHandler: h.ternaryMid,\n endStates: {\n colon: 'ternaryEnd'\n }\n },\n ternaryEnd: {\n subHandler: h.ternaryEnd,\n completable: true\n }\n};","\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\n\nvar _classCallCheck2 = _interopRequireDefault(require(\"@babel/runtime/helpers/classCallCheck\"));\n\nvar _createClass2 = _interopRequireDefault(require(\"@babel/runtime/helpers/createClass\"));\n\n/*\n * Jexl\n * Copyright 2020 Tom Shawver\n */\nvar handlers = require('./handlers');\n\nvar states = require('./states').states;\n/**\n * The Parser is a state machine that converts tokens from the {@link Lexer}\n * into an Abstract Syntax Tree (AST), capable of being evaluated in any\n * context by the {@link Evaluator}. The Parser expects that all tokens\n * provided to it are legal and typed properly according to the grammar, but\n * accepts that the tokens may still be in an invalid order or in some other\n * unparsable configuration that requires it to throw an Error.\n * @param {{}} grammar The grammar object to use to parse Jexl strings\n * @param {string} [prefix] A string prefix to prepend to the expression string\n * for error messaging purposes. This is useful for when a new Parser is\n * instantiated to parse an subexpression, as the parent Parser's\n * expression string thus far can be passed for a more user-friendly\n * error message.\n * @param {{}} [stopMap] A mapping of token types to any truthy value. When the\n * token type is encountered, the parser will return the mapped value\n * instead of boolean false.\n */\n\n\nvar Parser = /*#__PURE__*/function () {\n function Parser(grammar, prefix, stopMap) {\n (0, _classCallCheck2.default)(this, Parser);\n this._grammar = grammar;\n this._state = 'expectOperand';\n this._tree = null;\n this._exprStr = prefix || '';\n this._relative = false;\n this._stopMap = stopMap || {};\n }\n /**\n * Processes a new token into the AST and manages the transitions of the state\n * machine.\n * @param {{type: <string>}} token A token object, as provided by the\n * {@link Lexer#tokenize} function.\n * @throws {Error} if a token is added when the Parser has been marked as\n * complete by {@link #complete}, or if an unexpected token type is added.\n * @returns {boolean|*} the stopState value if this parser encountered a token\n * in the stopState mapb false if tokens can continue.\n */\n\n\n (0, _createClass2.default)(Parser, [{\n key: \"addToken\",\n value: function addToken(token) {\n if (this._state === 'complete') {\n throw new Error('Cannot add a new token to a completed Parser');\n }\n\n var state = states[this._state];\n var startExpr = this._exprStr;\n this._exprStr += token.raw;\n\n if (state.subHandler) {\n if (!this._subParser) {\n this._startSubExpression(startExpr);\n }\n\n var stopState = this._subParser.addToken(token);\n\n if (stopState) {\n this._endSubExpression();\n\n if (this._parentStop) return stopState;\n this._state = stopState;\n }\n } else if (state.tokenTypes[token.type]) {\n var typeOpts = state.tokenTypes[token.type];\n var handleFunc = handlers[token.type];\n\n if (typeOpts.handler) {\n handleFunc = typeOpts.handler;\n }\n\n if (handleFunc) {\n handleFunc.call(this, token);\n }\n\n if (typeOpts.toState) {\n this._state = typeOpts.toState;\n }\n } else if (this._stopMap[token.type]) {\n return this._stopMap[token.type];\n } else {\n throw new Error(\"Token \".concat(token.raw, \" (\").concat(token.type, \") unexpected in expression: \").concat(this._exprStr));\n }\n\n return false;\n }\n /**\n * Processes an array of tokens iteratively through the {@link #addToken}\n * function.\n * @param {Array<{type: <string>}>} tokens An array of tokens, as provided by\n * the {@link Lexer#tokenize} function.\n */\n\n }, {\n key: \"addTokens\",\n value: function addTokens(tokens) {\n tokens.forEach(this.addToken, this);\n }\n /**\n * Marks this Parser instance as completed and retrieves the full AST.\n * @returns {{}|null} a full expression tree, ready for evaluation by the\n * {@link Evaluator#eval} function, or null if no tokens were passed to\n * the parser before complete was called\n * @throws {Error} if the parser is not in a state where it's legal to end\n * the expression, indicating that the expression is incomplete\n */\n\n }, {\n key: \"complete\",\n value: function complete() {\n if (this._cursor && !states[this._state].completable) {\n throw new Error(\"Unexpected end of expression: \".concat(this._exprStr));\n }\n\n if (this._subParser) {\n this._endSubExpression();\n }\n\n this._state = 'complete';\n return this._cursor ? this._tree : null;\n }\n /**\n * Indicates whether the expression tree contains a relative path identifier.\n * @returns {boolean} true if a relative identifier exists false otherwise.\n */\n\n }, {\n key: \"isRelative\",\n value: function isRelative() {\n return this._relative;\n }\n /**\n * Ends a subexpression by completing the subParser and passing its result\n * to the subHandler configured in the current state.\n * @private\n */\n\n }, {\n key: \"_endSubExpression\",\n value: function _endSubExpression() {\n states[this._state].subHandler.call(this, this._subParser.complete());\n\n this._subParser = null;\n }\n /**\n * Places a new tree node at the current position of the cursor (to the 'right'\n * property) and then advances the cursor to the new node. This function also\n * handles setting the parent of the new node.\n * @param {{type: <string>}} node A node to be added to the AST\n * @private\n */\n\n }, {\n key: \"_placeAtCursor\",\n value: function _placeAtCursor(node) {\n if (!this._cursor) {\n this._tree = node;\n } else {\n this._cursor.right = node;\n\n this._setParent(node, this._cursor);\n }\n\n this._cursor = node;\n }\n /**\n * Places a tree node before the current position of the cursor, replacing\n * the node that the cursor currently points to. This should only be called in\n * cases where the cursor is known to exist, and the provided node already\n * contains a pointer to what's at the cursor currently.\n * @param {{type: <string>}} node A node to be added to the AST\n * @private\n */\n\n }, {\n key: \"_placeBeforeCursor\",\n value: function _placeBeforeCursor(node) {\n this._cursor = this._cursor._parent;\n\n this._placeAtCursor(node);\n }\n /**\n * Sets the parent of a node by creating a non-enumerable _parent property\n * that points to the supplied parent argument.\n * @param {{type: <string>}} node A node of the AST on which to set a new\n * parent\n * @param {{type: <string>}} parent An existing node of the AST to serve as the\n * parent of the new node\n * @private\n */\n\n }, {\n key: \"_setParent\",\n value: function _setParent(node, parent) {\n Object.defineProperty(node, '_parent', {\n value: parent,\n writable: true\n });\n }\n /**\n * Prepares the Parser to accept a subexpression by (re)instantiating the\n * subParser.\n * @param {string} [exprStr] The expression string to prefix to the new Parser\n * @private\n */\n\n }, {\n key: \"_startSubExpression\",\n value: function _startSubExpression(exprStr) {\n var endStates = states[this._state].endStates;\n\n if (!endStates) {\n this._parentStop = true;\n endStates = this._stopMap;\n }\n\n this._subParser = new Parser(this._grammar, exprStr, endStates);\n }\n }]);\n return Parser;\n}();\n\nmodule.exports = Parser;","\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\n\nvar _classCallCheck2 = _interopRequireDefault(require(\"@babel/runtime/helpers/classCallCheck\"));\n\nvar _createClass2 = _interopRequireDefault(require(\"@babel/runtime/helpers/createClass\"));\n\n/*\n * Jexl\n * Copyright 2020 Tom Shawver\n */\nvar PromiseSync = /*#__PURE__*/function () {\n function PromiseSync(fn) {\n (0, _classCallCheck2.default)(this, PromiseSync);\n fn(this._resolve.bind(this), this._reject.bind(this));\n }\n\n (0, _createClass2.default)(PromiseSync, [{\n key: \"catch\",\n value: function _catch(rejected) {\n if (this.error) {\n try {\n this._resolve(rejected(this.error));\n } catch (e) {\n this._reject(e);\n }\n }\n\n return this;\n }\n }, {\n key: \"then\",\n value: function then(resolved, rejected) {\n if (!this.error) {\n try {\n this._resolve(resolved(this.value));\n } catch (e) {\n this._reject(e);\n }\n }\n\n if (rejected) this.catch(rejected);\n return this;\n }\n }, {\n key: \"_reject\",\n value: function _reject(error) {\n this.value = undefined;\n this.error = error;\n }\n }, {\n key: \"_resolve\",\n value: function _resolve(val) {\n if (val instanceof PromiseSync) {\n if (val.error) {\n this._reject(val.error);\n } else {\n this._resolve(val.value);\n }\n } else {\n this.value = val;\n this.error = undefined;\n }\n }\n }]);\n return PromiseSync;\n}();\n\nPromiseSync.all = function (vals) {\n return new PromiseSync(function (resolve) {\n var resolved = vals.map(function (val) {\n while (val instanceof PromiseSync) {\n if (val.error) throw Error(val.error);\n val = val.value;\n }\n\n return val;\n });\n resolve(resolved);\n });\n};\n\nPromiseSync.resolve = function (val) {\n return new PromiseSync(function (resolve) {\n return resolve(val);\n });\n};\n\nPromiseSync.reject = function (error) {\n return new PromiseSync(function (resolve, reject) {\n return reject(error);\n });\n};\n\nmodule.exports = PromiseSync;","\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\n\nvar _classCallCheck2 = _interopRequireDefault(require(\"@babel/runtime/helpers/classCallCheck\"));\n\nvar _createClass2 = _interopRequireDefault(require(\"@babel/runtime/helpers/createClass\"));\n\n/*\n * Jexl\n * Copyright 2020 Tom Shawver\n */\nvar Evaluator = require('./evaluator/Evaluator');\n\nvar Lexer = require('./Lexer');\n\nvar Parser = require('./parser/Parser');\n\nvar PromiseSync = require('./PromiseSync');\n\nvar Expression = /*#__PURE__*/function () {\n function Expression(grammar, exprStr) {\n (0, _classCallCheck2.default)(this, Expression);\n this._grammar = grammar;\n this._exprStr = exprStr;\n this._ast = null;\n }\n /**\n * Forces a compilation of the expression string that this Expression object\n * was constructed with. This function can be called multiple times; useful\n * if the language elements of the associated Jexl instance change.\n * @returns {Expression} this Expression instance, for convenience\n */\n\n\n (0, _createClass2.default)(Expression, [{\n key: \"compile\",\n value: function compile() {\n var lexer = new Lexer(this._grammar);\n var parser = new Parser(this._grammar);\n var tokens = lexer.tokenize(this._exprStr);\n parser.addTokens(tokens);\n this._ast = parser.complete();\n return this;\n }\n /**\n * Asynchronously evaluates the expression within an optional context.\n * @param {Object} [context] A mapping of variables to values, which will be\n * made accessible to the Jexl expression when evaluating it\n * @returns {Promise<*>} resolves with the result of the evaluation.\n */\n\n }, {\n key: \"eval\",\n value: function _eval() {\n var context = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n return this._eval(context, Promise);\n }\n /**\n * Synchronously evaluates the expression within an optional context.\n * @param {Object} [context] A mapping of variables to values, which will be\n * made accessible to the Jexl expression when evaluating it\n * @returns {*} the result of the evaluation.\n * @throws {*} on error\n */\n\n }, {\n key: \"evalSync\",\n value: function evalSync() {\n var context = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n var res = this._eval(context, PromiseSync);\n\n if (res.error) throw res.error;\n return res.value;\n }\n }, {\n key: \"_eval\",\n value: function _eval(context, promise) {\n var _this = this;\n\n return promise.resolve().then(function () {\n var ast = _this._getAst();\n\n var evaluator = new Evaluator(_this._grammar, context, undefined, promise);\n return evaluator.eval(ast);\n });\n }\n }, {\n key: \"_getAst\",\n value: function _getAst() {\n if (!this._ast) this.compile();\n return this._ast;\n }\n }]);\n return Expression;\n}();\n\nmodule.exports = Expression;","\"use strict\";\n\n/*\n * Jexl\n * Copyright 2020 Tom Shawver\n */\n\n/* eslint eqeqeq:0 */\nexports.getGrammar = function () {\n return {\n /**\n * A map of all expression elements to their properties. Note that changes\n * here may require changes in the Lexer or Parser.\n * @type {{}}\n */\n elements: {\n '.': {\n type: 'dot'\n },\n '[': {\n type: 'openBracket'\n },\n ']': {\n type: 'closeBracket'\n },\n '|': {\n type: 'pipe'\n },\n '{': {\n type: 'openCurl'\n },\n '}': {\n type: 'closeCurl'\n },\n ':': {\n type: 'colon'\n },\n ',': {\n type: 'comma'\n },\n '(': {\n type: 'openParen'\n },\n ')': {\n type: 'closeParen'\n },\n '?': {\n type: 'question'\n },\n '+': {\n type: 'binaryOp',\n precedence: 30,\n eval: function _eval(left, right) {\n return left + right;\n }\n },\n '-': {\n type: 'binaryOp',\n precedence: 30,\n eval: function _eval(left, right) {\n return left - right;\n }\n },\n '*': {\n type: 'binaryOp',\n precedence: 40,\n eval: function _eval(left, right) {\n return left * right;\n }\n },\n '/': {\n type: 'binaryOp',\n precedence: 40,\n eval: function _eval(left, right) {\n return left / right;\n }\n },\n '//': {\n type: 'binaryOp',\n precedence: 40,\n eval: function _eval(left, right) {\n return Math.floor(left / right);\n }\n },\n '%': {\n type: 'binaryOp',\n precedence: 50,\n eval: function _eval(left, right) {\n return left % right;\n }\n },\n '^': {\n type: 'binaryOp',\n precedence: 50,\n eval: function _eval(left, right) {\n return Math.pow(left, right);\n }\n },\n '==': {\n type: 'binaryOp',\n precedence: 20,\n eval: function _eval(left, right) {\n return left == right;\n }\n },\n '!=': {\n type: 'binaryOp',\n precedence: 20,\n eval: function _eval(left, right) {\n return left != right;\n }\n },\n '>': {\n type: 'binaryOp',\n precedence: 20,\n eval: function _eval(left, right) {\n return left > right;\n }\n },\n '>=': {\n type: 'binaryOp',\n precedence: 20,\n eval: function _eval(left, right) {\n return left >= right;\n }\n },\n '<': {\n type: 'binaryOp',\n precedence: 20,\n eval: function _eval(left, right) {\n return left < right;\n }\n },\n '<=': {\n type: 'binaryOp',\n precedence: 20,\n eval: function _eval(left, right) {\n return left <= right;\n }\n },\n '&&': {\n type: 'binaryOp',\n precedence: 10,\n evalOnDemand: function evalOnDemand(left, right) {\n return left.eval().then(function (leftVal) {\n if (!leftVal) return leftVal;\n return right.eval();\n });\n }\n },\n '||': {\n type: 'binaryOp',\n precedence: 10,\n evalOnDemand: function evalOnDemand(left, right) {\n return left.eval().then(function (leftVal) {\n if (leftVal) return leftVal;\n return right.eval();\n });\n }\n },\n in: {\n type: 'binaryOp',\n precedence: 20,\n eval: function _eval(left, right) {\n if (typeof right === 'string') {\n return right.indexOf(left) !== -1;\n }\n\n if (Array.isArray(right)) {\n return right.some(function (elem) {\n return elem === left;\n });\n }\n\n return false;\n }\n },\n '!': {\n type: 'unaryOp',\n precedence: Infinity,\n eval: function _eval(right) {\n return !right;\n }\n }\n },\n\n /**\n * A map of function names to javascript functions. A Jexl function\n * takes zero ore more arguemnts:\n *\n * - {*} ...args: A variable number of arguments passed to this function.\n * All of these are pre-evaluated to their actual values before calling\n * the function.\n *\n * The Jexl function should return either the transformed value, or\n * a Promises/A+ Promise object that resolves with the value and rejects\n * or throws only when an unrecoverable error occurs. Functions should\n * generally return undefined when they don't make sense to be used on the\n * given value type, rather than throw/reject. An error is only\n * appropriate when the function would normally return a value, but\n * cannot due to some other failure.\n */\n functions: {},\n\n /**\n * A map of transform names to transform functions. A transform function\n * takes one ore more arguemnts:\n *\n * - {*} val: A value to be transformed\n * - {*} ...args: A variable number of arguments passed to this transform.\n * All of these are pre-evaluated to their actual values before calling\n * the function.\n *\n * The transform function should return either the transformed value, or\n * a Promises/A+ Promise object that resolves with the value and rejects\n * or throws only when an unrecoverable error occurs. Transforms should\n * generally return undefined when they don't make sense to be used on the\n * given value type, rather than throw/reject. An error is only\n * appropriate when the transform would normally return a value, but\n * cannot due to some other failure.\n */\n transforms: {}\n };\n};","\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\n\nvar _defineProperty2 = _interopRequireDefault(require(\"@babel/runtime/helpers/defineProperty\"));\n\nvar _classCallCheck2 = _interopRequireDefault(require(\"@babel/runtime/helpers/classCallCheck\"));\n\nvar _createClass2 = _interopRequireDefault(require(\"@babel/runtime/helpers/createClass\"));\n\n/*\n * Jexl\n * Copyright 2020 Tom Shawver\n */\nvar Expression = require('./Expression');\n\nvar _require = require('./grammar'),\n getGrammar = _require.getGrammar;\n/**\n * Jexl is the Javascript Expression Language, capable of parsing and\n * evaluating basic to complex expression strings, combined with advanced\n * xpath-like drilldown into native Javascript objects.\n * @constructor\n */\n\n\nvar Jexl = /*#__PURE__*/function () {\n function Jexl() {\n (0, _classCallCheck2.default)(this, Jexl);\n // Allow expr to be called outside of the jexl context\n this.expr = this.expr.bind(this);\n this._grammar = getGrammar();\n }\n /**\n * Adds a binary operator to Jexl at the specified precedence. The higher the\n * precedence, the earlier the operator is applied in the order of operations.\n * For example, * has a higher precedence than +, because multiplication comes\n * before division.\n *\n * Please see grammar.js for a listing of all default operators and their\n * precedence values in order to choose the appropriate precedence for the\n * new operator.\n * @param {string} operator The operator string to be added\n * @param {number} precedence The operator's precedence\n * @param {function} fn A function to run to calculate the result. The function\n * will be called with two arguments: left and right, denoting the values\n * on either side of the operator. It should return either the resulting\n * value, or a Promise that resolves with the resulting value.\n * @param {boolean} [manualEval] If true, the `left` and `right` arguments\n * will be wrapped in objects with an `eval` function. Calling\n * left.eval() or right.eval() will return a promise that resolves to\n * that operand's actual value. This is useful to conditionally evaluate\n * operands.\n */\n\n\n (0, _createClass2.default)(Jexl, [{\n key: \"addBinaryOp\",\n value: function addBinaryOp(operator, precedence, fn, manualEval) {\n this._addGrammarElement(operator, (0, _defineProperty2.default)({\n type: 'binaryOp',\n precedence: precedence\n }, manualEval ? 'evalOnDemand' : 'eval', fn));\n }\n /**\n * Adds or replaces an expression function in this Jexl instance.\n * @param {string} name The name of the expression function, as it will be\n * used within Jexl expressions\n * @param {function} fn The javascript function to be executed when this\n * expression function is invoked. It will be provided with each argument\n * supplied in the expression, in the same order.\n */\n\n }, {\n key: \"addFunction\",\n value: function addFunction(name, fn) {\n this._grammar.functions[name] = fn;\n }\n /**\n * Syntactic sugar for calling {@link #addFunction} repeatedly. This function\n * accepts a map of one or more expression function names to their javascript\n * function counterpart.\n * @param {{}} map A map of expression function names to javascript functions\n */\n\n }, {\n key: \"addFunctions\",\n value: function addFunctions(map) {\n for (var key in map) {\n this._grammar.functions[key] = map[key];\n }\n }\n /**\n * Adds a unary operator to Jexl. Unary operators are currently only supported\n * on the left side of the value on which it will operate.\n * @param {string} operator The operator string to be added\n * @param {function} fn A function to run to calculate the result. The function\n * will be called with one argument: the literal value to the right of the\n * operator. It should return either the resulting value, or a Promise\n * that resolves with the resulting value.\n */\n\n }, {\n key: \"addUnaryOp\",\n value: function addUnaryOp(operator, fn) {\n this._addGrammarElement(operator, {\n type: 'unaryOp',\n weight: Infinity,\n eval: fn\n });\n }\n /**\n * Adds or replaces a transform function in this Jexl instance.\n * @param {string} name The name of the transform function, as it will be used\n * within Jexl expressions\n * @param {function} fn The function to be executed when this transform is\n * invoked. It will be provided with at least one argument:\n * - {*} value: The value to be transformed\n * - {...*} args: The arguments for this transform\n */\n\n }, {\n key: \"addTransform\",\n value: function addTransform(name, fn) {\n this._grammar.transforms[name] = fn;\n }\n /**\n * Syntactic sugar for calling {@link #addTransform} repeatedly. This function\n * accepts a map of one or more transform names to their transform function.\n * @param {{}} map A map of transform names to transform functions\n */\n\n }, {\n key: \"addTransforms\",\n value: function addTransforms(map) {\n for (var key in map) {\n this._grammar.transforms[key] = map[key];\n }\n }\n /**\n * Creates an Expression object from the given Jexl expression string, and\n * immediately compiles it. The returned Expression object can then be\n * evaluated multiple times with new contexts, without generating any\n * additional string processing overhead.\n * @param {string} expression The Jexl expression to be compiled\n * @returns {Expression} The compiled Expression object\n */\n\n }, {\n key: \"compile\",\n value: function compile(expression) {\n var exprObj = this.createExpression(expression);\n return exprObj.compile();\n }\n /**\n * Constructs an Expression object from a Jexl expression string.\n * @param {string} expression The Jexl expression to be wrapped in an\n * Expression object\n * @returns {Expression} The Expression object representing the given string\n */\n\n }, {\n key: \"createExpression\",\n value: function createExpression(expression) {\n return new Expression(this._grammar, expression);\n }\n /**\n * Retrieves a previously set expression function.\n * @param {string} name The name of the expression function\n * @returns {function} The expression function\n */\n\n }, {\n key: \"getFunction\",\n value: function getFunction(name) {\n return this._grammar.functions[name];\n }\n /**\n * Retrieves a previously set transform function.\n * @param {string} name The name of the transform function\n * @returns {function} The transform function\n */\n\n }, {\n key: \"getTransform\",\n value: function getTransform(name) {\n return this._grammar.transforms[name];\n }\n /**\n * Asynchronously evaluates a Jexl string within an optional context.\n * @param {string} expression The Jexl expression to be evaluated\n * @param {Object} [context] A mapping of variables to values, which will be\n * made accessible to the Jexl expression when evaluating it\n * @returns {Promise<*>} resolves with the result of the evaluation.\n */\n\n }, {\n key: \"eval\",\n value: function _eval(expression) {\n var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var exprObj = this.createExpression(expression);\n return exprObj.eval(context);\n }\n /**\n * Synchronously evaluates a Jexl string within an optional context.\n * @param {string} expression The Jexl expression to be evaluated\n * @param {Object} [context] A mapping of variables to values, which will be\n * made accessible to the Jexl expression when evaluating it\n * @returns {*} the result of the evaluation.\n * @throws {*} on error\n */\n\n }, {\n key: \"evalSync\",\n value: function evalSync(expression) {\n var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var exprObj = this.createExpression(expression);\n return exprObj.evalSync(context);\n }\n /**\n * A JavaScript template literal to allow expressions to be defined by the\n * syntax: expr`40 + 2`\n * @param {Array<string>} strs\n * @param {...any} args\n */\n\n }, {\n key: \"expr\",\n value: function expr(strs) {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n var exprStr = strs.reduce(function (acc, str, idx) {\n var arg = idx < args.length ? args[idx] : '';\n acc += str + arg;\n return acc;\n }, '');\n return this.createExpression(exprStr);\n }\n /**\n * Removes a binary or unary operator from the Jexl grammar.\n * @param {string} operator The operator string to be removed\n */\n\n }, {\n key: \"removeOp\",\n value: function removeOp(operator) {\n if (this._grammar.elements[operator] && (this._grammar.elements[operator].type === 'binaryOp' || this._grammar.elements[operator].type === 'unaryOp')) {\n delete this._grammar.elements[operator];\n }\n }\n /**\n * Adds an element to the grammar map used by this Jexl instance.\n * @param {string} str The key string to be added\n * @param {{type: <string>}} obj A map of configuration options for this\n * grammar element\n * @private\n */\n\n }, {\n key: \"_addGrammarElement\",\n value: function _addGrammarElement(str, obj) {\n this._grammar.elements[str] = obj;\n }\n }]);\n return Jexl;\n}();\n\nmodule.exports = new Jexl();\nmodule.exports.Jexl = Jexl;","import * as JexlModule from 'jexl';\n\nconst Jexl = 'default' in JexlModule ? JexlModule.default : JexlModule;\n\nconst warnedConditions = new Set<string>();\n\ntype TraversalNode = Record<string, unknown> & {\n $field?: string;\n name?: string;\n children?: TraversalValue;\n schema?: TraversalValue;\n};\ntype TraversalValue = TraversalNode | TraversalNode[] | null | undefined;\n\n// Evaluate a conditional expression (Formie-style \"field == 'x'\") using Jexl.\nexport const evaluateCondition = (condition: string | undefined, data: Record<string, unknown>) => {\n if (!condition) { return true; }\n\n try {\n return Jexl.evalSync(condition, data);\n } catch (error) {\n if (typeof condition === 'string' && !warnedConditions.has(condition)) {\n warnedConditions.add(condition);\n console.warn('Condition evaluation error:', error, 'Condition:', condition, 'Data:', data);\n }\n\n return false;\n }\n};\n\n// Shared traversal function for schema nodes.\nexport const traverseSchema = (node: TraversalValue, visitor: (node: TraversalNode) => void) => {\n if (Array.isArray(node)) {\n node.forEach((child) => { return traverseSchema(child, visitor); });\n } else if (node && typeof node === 'object') {\n visitor(node);\n\n // Skip iterating through children if this is a list field.\n if (node.$field === 'list') {\n return;\n }\n\n Object.values(node).forEach((value) => {\n if (value && (typeof value === 'object' || Array.isArray(value))) {\n traverseSchema(value as TraversalValue, visitor);\n }\n });\n }\n};\n\n// Extract fields from schema for validation - generic recursive approach.\nexport const extractFields = (nodes: TraversalValue): TraversalNode[] => {\n const fields: TraversalNode[] = [];\n\n traverseSchema(nodes, (node) => {\n if (node.$field) {\n fields.push(node);\n }\n });\n\n return fields;\n};\n\n// Extract field names from schema content - generic recursive approach.\nexport const extractFieldNames = (content: TraversalValue): string[] => {\n return extractFields(content)\n .map((field) => { return field.name; })\n .filter((name): name is string => { return typeof name === 'string'; });\n};\n\nconst fieldNamesCache = new WeakMap<object, string[]>();\n\nexport const getSchemaFieldNames = (node: unknown): string[] => {\n if (!node || (typeof node !== 'object' && !Array.isArray(node))) {\n return [];\n }\n\n const key = node as object;\n const cached = fieldNamesCache.get(key);\n if (cached) {\n return cached;\n }\n\n const fieldNames = extractFieldNames(node as TraversalValue);\n fieldNamesCache.set(key, fieldNames);\n return fieldNames;\n};\n\nconst hasErrorValue = (value: unknown) => {\n if (Array.isArray(value)) {\n return value.length > 0;\n }\n if (!value) {\n return false;\n }\n if (typeof value === 'object') {\n const entry = value as { errors?: unknown[] };\n if (Array.isArray(entry.errors)) {\n return entry.errors.length > 0;\n }\n }\n return Boolean(value);\n};\n\nexport const createSchemaFieldIndex = (node: unknown) => {\n const fieldNames = getSchemaFieldNames(node);\n const fieldNameSet = new Set(fieldNames);\n return {\n fieldNames,\n hasField: (fieldName: string) => { return fieldNameSet.has(fieldName); },\n };\n};\n\nexport const hasSchemaErrors = (errors: Record<string, unknown> | undefined, node: unknown) => {\n if (!errors || !node) {\n return false;\n }\n const fieldNames = getSchemaFieldNames(node);\n return fieldNames.some((fieldName) => {\n return hasErrorValue(errors[fieldName]);\n });\n};\n","const buildGroupLabel = (parentLabel?: string, childLabel?: string) => {\n if (parentLabel && childLabel) {\n return `${parentLabel}: ${childLabel}`;\n }\n\n return parentLabel || childLabel || '';\n};\n\n// Matches \"{attribute} cannot be blank.\" and similar validation messages\nconst ATTRIBUTE_MESSAGE_PATTERN = /^(.+?) (cannot be blank\\.|must be .+)$/;\n\nexport const buildGroupedMessage = (\n message: string,\n parentLabel?: string,\n childLabel?: string,\n) => {\n const groupLabel = buildGroupLabel(parentLabel, childLabel);\n if (!groupLabel) {\n return message;\n }\n\n const match = String(message).match(ATTRIBUTE_MESSAGE_PATTERN);\n if (match) {\n const [, attribute, suffix] = match;\n // Use attribute in groupLabel (fixes \"label\" -> \"Option Label\") and only append suffix\n // to avoid \"Options: Option Label Option Label cannot be blank.\"\n const displayLabel = (childLabel && attribute !== childLabel) ? attribute : childLabel;\n const finalGroupLabel = buildGroupLabel(parentLabel, displayLabel || attribute);\n return `${finalGroupLabel} ${suffix}`;\n }\n\n return `${groupLabel} ${message}`;\n};\n","export type TranslateParams = Record<string, string>;\n\nlet translationCategory = 'plugin-handle';\nlet translateFn: ((category: string, message: string, params?: TranslateParams) => string) | undefined;\n\nexport const setTranslationCategory = (category: string): void => {\n translationCategory = category.trim() || 'plugin-handle';\n};\n\nexport const setTranslateFunction = (fn?: (category: string, message: string, params?: TranslateParams) => string): void => {\n translateFn = fn;\n};\n\nexport const translate = (message: string, params?: TranslateParams): string => {\n if (translateFn) {\n return translateFn(translationCategory, message, params);\n }\n\n if (typeof window !== 'undefined') {\n const craft = (window as { Craft?: { t?: (category: string, message: string, params?: TranslateParams) => string } }).Craft;\n\n if (craft?.t) {\n return craft.t(translationCategory, message, params);\n }\n }\n\n return message;\n};\n","import { translate } from '../translate';\n\nconst emailRegex = /(^$|^(([^<>()[\\]\\\\.,;:\\s@\"]+(\\.[^<>()[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$)/;\n\nexport const emailRule = (value: unknown, label: string) => {\n if (!emailRegex.test(String(value))) {\n return translate('{attribute} must be a valid email address.', { attribute: label });\n }\n return null;\n};\n","import { translate } from '../translate';\n\nconst emailRegex = /(^$|^(([^<>()[\\]\\\\.,;:\\s@\"]+(\\.[^<>()[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$)/;\nconst variableRegex = /({.*?})/;\n\nexport const emailOrVariableRule = (value: unknown, label: string) => {\n const text = String(value);\n if (!variableRegex.test(text) && !emailRegex.test(text)) {\n return translate('{attribute} must be a valid email address or variable.', { attribute: label });\n }\n return null;\n};\n","import { translate } from '../translate';\n\nconst handleRegex = /^[a-zA-Z][a-zA-Z0-9_]*$/;\n\nexport const handleRule = (value: unknown) => {\n const handle = String(value ?? '');\n\n if (!handleRegex.test(handle)) {\n return translate('“{handle}” isn’t a valid handle.', { handle });\n }\n\n return null;\n};\n","const INVISIBLE_CHAR_PATTERN = /[\\u200B\\u200C\\u200D\\u2060\\uFEFF]/g;\n\nconst isRecord = (value: unknown): value is Record<string, unknown> => {\n return Boolean(value) && typeof value === 'object' && !Array.isArray(value);\n};\n\n/** TipTap JSON nodes always carry a string `type` (paragraph, text, variableTag, …). */\nconst isTipTapNode = (value: unknown): value is Record<string, unknown> => {\n return isRecord(value) && typeof value.type === 'string';\n};\n\n/**\n * True for TipTap document payloads: content arrays, `{ type: 'doc' }`, or JSON\n * strings of those. Avoids treating arbitrary object arrays (e.g. option rows) as docs.\n */\nconst isTipTapContent = (value: unknown): boolean => {\n if (Array.isArray(value)) {\n return value.length === 0 || value.every(isTipTapNode);\n }\n\n if (isTipTapNode(value) && value.type === 'doc') {\n return true;\n }\n\n return false;\n};\n\nconst collectTipTapPlainText = (nodes: unknown[]): string => {\n let text = '';\n\n const visit = (node: unknown) => {\n if (!isRecord(node)) {\n return;\n }\n\n if (node.type === 'text' && typeof node.text === 'string') {\n text += node.text.replace(INVISIBLE_CHAR_PATTERN, '');\n return;\n }\n\n // Variable chips are meaningful content even without surrounding text.\n if (node.type === 'variableTag') {\n const attrs = isRecord(node.attrs) ? node.attrs : {};\n const label = typeof attrs.label === 'string' ? attrs.label : '';\n const variableValue = typeof attrs.value === 'string' ? attrs.value : '';\n text += (label || variableValue).replace(INVISIBLE_CHAR_PATTERN, '');\n return;\n }\n\n if (Array.isArray(node.content)) {\n node.content.forEach(visit);\n }\n };\n\n nodes.forEach(visit);\n\n return text.trim();\n};\n\n/**\n * TipTap editors persist empty docs as JSON (`[]`, `[{type:'paragraph'}]`, …),\n * which must count as blank for `required` — not as a filled string/object.\n */\nconst isEmptyTipTapValue = (value: unknown): boolean => {\n let parsed: unknown = value;\n\n if (typeof value === 'string') {\n const trimmed = value.trim();\n if (!trimmed) {\n return true;\n }\n\n // Only attempt TipTap empty detection on JSON-looking strings.\n if (trimmed[0] !== '[' && trimmed[0] !== '{') {\n return false;\n }\n\n try {\n parsed = JSON.parse(trimmed);\n } catch {\n return false;\n }\n }\n\n if (!isTipTapContent(parsed)) {\n return false;\n }\n\n let nodes: unknown[];\n if (Array.isArray(parsed)) {\n nodes = parsed;\n } else if (isRecord(parsed) && Array.isArray(parsed.content)) {\n nodes = parsed.content;\n } else {\n nodes = [parsed];\n }\n\n if (!nodes.length) {\n return true;\n }\n\n return collectTipTapPlainText(nodes).length === 0;\n};\n\nexport const isEmptyValue = (value: unknown) => {\n if (value === undefined || value === null) {\n return true;\n }\n\n if (typeof value === 'string') {\n if (value === '') {\n return true;\n }\n\n // Empty TipTap JSON strings (e.g. \"[]\", \"[{type:\\\"paragraph\\\"}]\").\n return isEmptyTipTapValue(value);\n }\n\n if (Array.isArray(value)) {\n if (value.length === 0) {\n return true;\n }\n\n // Empty TipTap content arrays still have length (default empty paragraph).\n return isEmptyTipTapValue(value);\n }\n\n // TipTap `{ type: 'doc', content: [...] }` objects.\n if (isTipTapContent(value)) {\n return isEmptyTipTapValue(value);\n }\n\n return false;\n};\n\nexport const getValueSize = (value: unknown) => {\n if (typeof value === 'number') {\n return value;\n }\n\n if (typeof value === 'string') {\n const trimmed = value.trim();\n if (trimmed !== '' && Number.isFinite(Number(trimmed))) {\n return Number(trimmed);\n }\n\n return value.length;\n }\n\n if (Array.isArray(value)) {\n return value.length;\n }\n\n return NaN;\n};\n","import { translate } from '../translate';\nimport { getValueSize } from './utils';\n\nexport const maxRule = (value: unknown, label: string, args: string[]) => {\n const max = Number(args[0]);\n const size = getValueSize(value);\n if (!Number.isFinite(size) || size > max) {\n return translate('{attribute} must be at most {max}.', { attribute: label, max: String(args[0]) });\n }\n return null;\n};\n","import { translate } from '../translate';\nimport { getValueSize } from './utils';\n\nexport const minRule = (value: unknown, label: string, args: string[]) => {\n const min = Number(args[0]);\n const size = getValueSize(value);\n if (!Number.isFinite(size) || size < min) {\n return translate('{attribute} must be at least {min}.', { attribute: label, min: String(args[0]) });\n }\n return null;\n};\n","import { translate } from '../translate';\nimport { isEmptyValue } from './utils';\n\nexport const requiredRule = (value: unknown, label: string) => {\n if (isEmptyValue(value)) {\n return translate('{attribute} cannot be blank.', { attribute: label });\n }\n return null;\n};\n","import { translate } from '../translate';\nimport { isEmptyValue } from './utils';\n\n/**\n * Required check for TipTap/ProseMirror JSON fields (`validation: 'requiredRichText'`).\n * Empty docs are JSON (`[]` / bare paragraphs), not `''` — handled via `isEmptyValue`.\n */\nexport const requiredRichTextRule = (value: unknown, label: string) => {\n if (isEmptyValue(value)) {\n return translate('{attribute} cannot be blank.', { attribute: label });\n }\n\n return null;\n};\n","export const REQUIRED_RULE_NAMES = new Set(['required', 'requiredRichText']);\n\nexport const isRequiredRuleName = (ruleName: string) => {\n return REQUIRED_RULE_NAMES.has(ruleName);\n};\n","import { get } from 'lodash-es';\nimport { translate } from '../translate';\nimport type { SchemaNode } from '../types';\n\ntype RuleContext = {\n path: string;\n values: Record<string, unknown>;\n field: SchemaNode;\n};\n\ntype HandleEntry = {\n path: string;\n handle: string;\n};\n\nconst isRecord = (value: unknown): value is Record<string, unknown> => {\n return Boolean(value) && typeof value === 'object' && !Array.isArray(value);\n};\n\nconst getHandleValue = (value: unknown) => {\n if (!isRecord(value)) {\n return '';\n }\n\n const settings = isRecord(value.settings) ? value.settings : {};\n return String(value.handle || settings.handle || '').trim();\n};\n\nconst collectTopLevelFieldHandles = (values: Record<string, unknown>) => {\n const entries: HandleEntry[] = [];\n const pages = Array.isArray(values?.pages) ? values.pages : [];\n\n pages.forEach((page, pageIndex) => {\n const rows = Array.isArray(page?.rows) ? page.rows : [];\n\n rows.forEach((row, rowIndex) => {\n const fields = Array.isArray(row?.fields) ? row.fields : [];\n\n fields.forEach((field, fieldIndex) => {\n const handle = getHandleValue(field);\n if (!handle) {\n return;\n }\n\n entries.push({\n path: `pages.${pageIndex}.rows.${rowIndex}.fields.${fieldIndex}.handle`,\n handle,\n });\n });\n });\n });\n\n return entries;\n};\n\nconst collectNestedFieldHandles = (values: Record<string, unknown>, parentFieldPath: string) => {\n const entries: HandleEntry[] = [];\n const rows = get(values, `${parentFieldPath}.rows`, []);\n const nestedRows = Array.isArray(rows) ? rows : [];\n\n nestedRows.forEach((row, nestedRowIndex) => {\n const fields = Array.isArray(row?.fields) ? row.fields : [];\n\n fields.forEach((field, nestedFieldIndex) => {\n const handle = getHandleValue(field);\n if (!handle) {\n return;\n }\n\n entries.push({\n path: `${parentFieldPath}.rows.${nestedRowIndex}.fields.${nestedFieldIndex}.handle`,\n handle,\n });\n });\n });\n\n return entries;\n};\n\nconst collectNotificationHandles = (values: Record<string, unknown>) => {\n const entries: HandleEntry[] = [];\n const notifications = Array.isArray(values?.notifications) ? values.notifications : [];\n\n notifications.forEach((notification, index) => {\n const handle = String(notification?.handle || '').trim();\n if (!handle) {\n return;\n }\n\n entries.push({\n path: `notifications.${index}.handle`,\n handle,\n });\n });\n\n return entries;\n};\n\nconst getScopedHandleEntries = (context: RuleContext) => {\n const { path, values } = context;\n const explicitScope = context?.field?.uniqueHandleScope;\n\n if (explicitScope === 'topLevelFields') {\n return collectTopLevelFieldHandles(values);\n }\n\n if (explicitScope === 'notifications') {\n return collectNotificationHandles(values);\n }\n\n if (explicitScope === 'nestedSiblings') {\n const parentFieldPath = context?.field?.uniqueHandleScopePath;\n\n if (typeof parentFieldPath === 'string' && parentFieldPath.trim() !== '') {\n return collectNestedFieldHandles(values, parentFieldPath);\n }\n }\n\n const nestedMatch = path.match(/^(pages\\.\\d+\\.rows\\.\\d+\\.fields\\.\\d+(?:\\.rows\\.\\d+\\.fields\\.\\d+)*)\\.rows\\.\\d+\\.fields\\.\\d+\\.handle$/);\n if (nestedMatch) {\n const [, parentFieldPath] = nestedMatch;\n return collectNestedFieldHandles(values, parentFieldPath);\n }\n\n if (/^pages\\.\\d+\\.rows\\.\\d+\\.fields\\.\\d+\\.handle$/.test(path)) {\n return collectTopLevelFieldHandles(values);\n }\n\n if (/^notifications\\.\\d+\\.handle$/.test(path)) {\n return collectNotificationHandles(values);\n }\n\n return [];\n};\n\nexport const uniqueHandleRule = (value: unknown, label: string, args: string[], context?: RuleContext) => {\n if (!context?.path || !context?.values) {\n return null;\n }\n\n const handle = String(value ?? '').trim();\n if (!handle) {\n return null;\n }\n\n const entries = getScopedHandleEntries(context);\n const normalizedHandle = handle.toLowerCase();\n const scopedDuplicate = entries.some((entry) => {\n if (entry.path === context.path) {\n return false;\n }\n\n return entry.handle.toLowerCase() === normalizedHandle;\n });\n\n const reservedHandles = Array.isArray(context.field?.reservedHandles) ? context.field.reservedHandles : [];\n const reservedDuplicate = reservedHandles.some((reservedHandle) => {\n return String(reservedHandle || '').toLowerCase() === normalizedHandle;\n });\n\n const duplicate = scopedDuplicate || reservedDuplicate;\n\n if (!duplicate) {\n return null;\n }\n\n return translate('{attribute} \"{value}\" has already been taken.', {\n attribute: label,\n value: handle,\n });\n};\n","import { emailRule } from './email';\nimport { emailOrVariableRule } from './emailOrVariable';\nimport { handleRule } from './handle';\nimport { maxRule } from './max';\nimport { minRule } from './min';\nimport { requiredRule } from './required';\nimport { requiredRichTextRule } from './requiredRichText';\nimport { isRequiredRuleName, REQUIRED_RULE_NAMES } from './requiredRules';\nimport { uniqueHandleRule } from './uniqueHandle';\n\nimport type { SchemaNode } from '../types';\n\nexport type RuleHandlerContext = {\n path: string;\n values: Record<string, unknown>;\n field: SchemaNode;\n};\n\nexport type RuleHandler = (value: unknown, label: string, args: string[], context?: RuleHandlerContext) => string | null;\n\nexport const ruleHandlers: Record<string, RuleHandler> = {\n required: (value, label) => { return requiredRule(value, label); },\n requiredRichText: (value, label) => { return requiredRichTextRule(value, label); },\n min: (value, label, args) => { return minRule(value, label, args); },\n max: (value, label, args) => { return maxRule(value, label, args); },\n email: (value, label) => { return emailRule(value, label); },\n emailOrVariable: (value, label) => { return emailOrVariableRule(value, label); },\n handle: (value) => { return handleRule(value); },\n uniqueHandle: (value, label, args, context) => { return uniqueHandleRule(value, label, args, context); },\n};\n\nexport {\n emailRule,\n emailOrVariableRule,\n handleRule,\n maxRule,\n minRule,\n requiredRule,\n requiredRichTextRule,\n isRequiredRuleName,\n REQUIRED_RULE_NAMES,\n uniqueHandleRule,\n};\n","import { get } from 'lodash-es';\n\nimport { evaluateCondition } from './schema';\nimport { ruleHandlers } from './rules';\nimport type { RuleHandlerContext } from './rules';\nimport { isRequiredRuleName } from './rules/requiredRules';\nimport { isEmptyValue } from './rules/utils';\nimport type {\n ConditionDataResolver,\n FieldEntry,\n FormValues,\n SchemaIndex,\n SchemaNode,\n SchemaRenderable,\n ValidationResult,\n} from './types';\n\ntype RuleToken = {\n name: string;\n args: string[];\n};\ntype ConditionContext = {\n condition: string;\n field: SchemaNode;\n};\n\nconst isRecord = (value: unknown): value is Record<string, unknown> => {\n return Boolean(value) && typeof value === 'object' && !Array.isArray(value);\n};\n\nconst parseRules = (field: { validation?: string; required?: boolean }): RuleToken[] => {\n const rawRules = typeof field.validation === 'string' ? field.validation : '';\n const tokens = rawRules\n .split('|')\n .map((token) => { return token.trim(); })\n .filter(Boolean);\n\n const hasRequiredRule = tokens.some((rule) => {\n const name = rule.split(':')[0];\n return isRequiredRuleName(name);\n });\n if (field.required && !hasRequiredRule) {\n tokens.unshift('required');\n }\n\n return tokens.map((token) => {\n const [name, ...rest] = token.split(':');\n const args = rest.length > 0 ? rest.join(':').split(',') : [];\n return { name, args };\n });\n};\n\nconst expandWildcardPaths = (values: FormValues, path: string) => {\n if (!path.includes('*')) {\n return [path];\n }\n\n const parts = path.split('.');\n const results: string[] = [];\n\n const walk = (current: unknown, index: number, acc: string[]) => {\n if (index >= parts.length) {\n results.push(acc.join('.'));\n return;\n }\n\n const part = parts[index];\n if (part === '*') {\n if (Array.isArray(current)) {\n current.forEach((item, idx) => {\n walk(item, index + 1, [...acc, String(idx)]);\n });\n }\n return;\n }\n\n if (isRecord(current) && part in current) {\n walk(current[part], index + 1, [...acc, part]);\n return;\n }\n\n walk(undefined, index + 1, [...acc, part]);\n };\n\n walk(values, 0, []);\n return results;\n};\n\nconst validateValue = (\n field: SchemaNode,\n rules: RuleToken[],\n value: unknown,\n context: RuleHandlerContext,\n) => {\n const label = String(field.label || field.name || '');\n // `requiredRichText` is also a required-field rule (empty TipTap JSON must not skip it).\n const isRequired = rules.some((rule) => { return isRequiredRuleName(rule.name); });\n\n for (const rule of rules) {\n const { name, args } = rule;\n const shouldSkip = !isRequired && isEmptyValue(value);\n\n if (shouldSkip) {\n continue;\n }\n\n const handler = ruleHandlers[name];\n if (!handler) {\n continue;\n }\n\n const message = handler(value, label, args, context);\n if (message) {\n return message;\n }\n }\n\n return null;\n};\n\nconst buildConditionData = (\n field: SchemaNode,\n values: FormValues,\n conditionDataResolver?: ConditionDataResolver,\n) => {\n const scopePath = typeof field?._scopePath === 'string' ? field._scopePath : '';\n const scopedValues = scopePath ? get(values, scopePath) : null;\n const scopedObject = isRecord(scopedValues) ? scopedValues : {};\n const conditionContext = conditionDataResolver?.(values, field);\n const normalizedConditionContext = isRecord(conditionContext) ? conditionContext : {};\n const fieldData = isRecord(field._data) ? field._data : {};\n\n return {\n ...values,\n ...scopedObject,\n ...fieldData,\n ...normalizedConditionContext,\n };\n};\n\nconst shouldValidateField = (\n field: SchemaNode,\n values: FormValues,\n conditionDataResolver?: ConditionDataResolver,\n) => {\n const condition = field?.if;\n\n if (!condition) {\n return true;\n }\n\n try {\n return evaluateCondition(condition, buildConditionData(field, values, conditionDataResolver));\n } catch {\n // Fail-open to avoid accidentally blocking saves due to malformed conditions.\n return true;\n }\n};\n\nconst collectPathConditions = (schema: SchemaRenderable) => {\n const pathConditions = new Map<string, ConditionContext[]>();\n\n const walk = (node: SchemaRenderable, currentPath = '', inherited: ConditionContext[] = []) => {\n if (Array.isArray(node)) {\n node.forEach((child) => {\n walk(child, currentPath, inherited);\n });\n return;\n }\n\n if (!isRecord(node)) {\n return;\n }\n\n const name = typeof node.name === 'string' && node.name ? node.name : '';\n let nodePath = currentPath;\n if (name) {\n nodePath = currentPath ? `${currentPath}.${name}` : name;\n }\n\n const ownCondition = typeof node.if === 'string' && node.if\n ? [{ condition: node.if, field: node as SchemaNode }]\n : [];\n const nextInherited = [...inherited, ...ownCondition];\n\n if (nodePath && nextInherited.length) {\n pathConditions.set(nodePath, nextInherited);\n }\n\n if (Array.isArray(node.children)) {\n walk(node.children as SchemaRenderable, nodePath, nextInherited);\n }\n\n if (Array.isArray(node.schema)) {\n walk(node.schema as SchemaRenderable, nodePath, nextInherited);\n }\n };\n\n walk(schema, '', []);\n\n return pathConditions;\n};\n\nconst shouldValidatePathConditions = (\n path: string,\n fallbackField: SchemaNode,\n values: FormValues,\n pathConditions: Map<string, ConditionContext[]>,\n conditionDataResolver?: ConditionDataResolver,\n) => {\n const conditions = pathConditions.get(path) || [];\n\n if (!conditions.length) {\n return true;\n }\n\n return conditions.every(({ condition, field }) => {\n try {\n return evaluateCondition(condition, buildConditionData(field || fallbackField, values, conditionDataResolver));\n } catch {\n // Fail-open to avoid accidental save blocking on malformed conditions.\n return true;\n }\n });\n};\n\nexport const createValidationEngine = (\n index: SchemaIndex,\n options: { conditionDataResolver?: ConditionDataResolver } = {},\n) => {\n const { conditionDataResolver } = options;\n const fieldRules = new Map<FieldEntry, RuleToken[]>();\n const pathConditions = collectPathConditions(index.schema);\n\n index.fieldEntries.forEach((entry) => {\n fieldRules.set(entry, parseRules(entry.field));\n });\n\n const validate = (values: FormValues): ValidationResult => {\n const fieldErrors: Record<string, string[]> = {};\n index.fieldEntries.forEach((entry) => {\n const rules = fieldRules.get(entry) || [];\n if (!rules.length) {\n return;\n }\n\n if (!shouldValidateField(entry.field, values, conditionDataResolver)) {\n return;\n }\n\n const paths = expandWildcardPaths(values, entry.path);\n paths.forEach((path) => {\n if (!shouldValidatePathConditions(path, entry.field, values, pathConditions, conditionDataResolver)) {\n return;\n }\n\n const value = get(values, path);\n const message = validateValue(entry.field, rules, value, {\n path,\n values,\n field: entry.field,\n });\n if (message) {\n fieldErrors[path] = [message];\n }\n });\n });\n\n return Object.keys(fieldErrors).length > 0 ? { fields: fieldErrors } : undefined;\n };\n\n return { validate };\n};\n"],"x_google_ignoreList":[2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAWA,IAAa,iBAAb,MAA4B;CACxB;CAEA,4BAAyC,IAAI,KAAK;CAElD;CAEA,YAAY,gBAAyC,EAAE,EAAE;AACrD,OAAK,gBAAgB,EAAE,GAAG,eAAe;AACzC,OAAK,QAAQ;GACT,QAAQ,EAAE,GAAG,eAAe;GAC5B,QAAQ,EAAE;GACV,yBAAS,IAAI,KAAK;GAClB,uBAAO,IAAI,KAAK;GACnB;;CAGL,UAAU,UAAsC;AAC5C,OAAK,UAAU,IAAI,SAAS;AAC5B,eAAa;AACT,QAAK,UAAU,OAAO,SAAS;;;CAIvC,SAAS;AACL,OAAK,UAAU,SAAS,aAAa;AAAE,aAAU;IAAI;;CAGzD,SAAS,MAAuB;AAC5B,SAAO,IAAI,KAAK,MAAM,QAAQ,KAAK;;CAGvC,SAAS,MAAc,OAAgB;EACnC,MAAM,aAAa,EAAE,GAAG,KAAK,MAAM,QAAQ;AAC3C,MAAI,QAAQ,WACR,QAAO,WAAW;AAItB,MAAI,MAAM,QAAQ,MAAM,EAAE;GACtB,MAAM,mBAAmB,GAAG,KAAK;AACjC,UAAO,KAAK,WAAW,CAAC,SAAS,QAAQ;AACrC,QAAI,IAAI,WAAW,iBAAiB,CAChC,QAAO,WAAW;KAExB;;AAGN,OAAK,QAAQ;GACT,GAAG,KAAK;GACR,eAAe;IACX,MAAM,YAAqC,MAAM,QAAQ,KAAK,MAAM,OAAO,GACpE,CAAC,GAAG,KAAK,MAAM,OAAO,GACvB,EAAE,GAAI,KAAK,MAAM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OAAO;AAE1D,OAAM,aAAa,SAAS,UAAU;AAClC,aAAW,IAAI,OAAO,WAAW,MAAM,MAAM,CAAC;GAChD;CAEF,MAAM,YAAY,WAAyC;EACvD,MAAM,cAAwC,EAAE;AAChD,QAAM,aAAa,SAAS,UAAU;GAClC,MAAM,QAAQ,WAAW,IAAI,MAAM,IAAI,EAAE;AACzC,OAAI,CAAC,MAAM,OACP;AAGJ,OAAI,CAAC,oBAAoB,MAAM,OAAO,QAAQ,sBAAsB,CAChE;AAGU,uBAAoB,QAAQ,MAAM,KAChD,CAAM,SAAS,SAAS;AACpB,QAAI,CAAC,6BAA6B,MAAM,MAAM,OAAO,QAAQ,gBAAgB,sBAAsB,CAC/F;IAGJ,MAAM,QAAQ,IAAI,QAAQ,KAAK;IAC/B,MAAM,UAAU,cAAc,MAAM,OAAO,OAAO,OAAO;KACrD;KACA;KACA,OAAO,MAAM;KAChB,CAAC;AACF,QAAI,QACA,aAAY,QAAQ,CAAC,QAAQ;KAEnC;IACJ;AAEF,SAAO,OAAO,KAAK,YAAY,CAAC,SAAS,IAAI,EAAE,QAAQ,aAAa,GAAG,KAAA;;AAG3E,QAAO,EAAE,UAAU"}
package/package.json ADDED
@@ -0,0 +1,41 @@
1
+ {
2
+ "name": "@verbb/plugin-kit-forms",
3
+ "version": "2.0.0",
4
+ "description": "Framework-agnostic SchemaForm engine (state, validation, schema) for Plugin Kit",
5
+ "type": "module",
6
+ "types": "dist/index.d.ts",
7
+ "files": [
8
+ "dist",
9
+ "LICENSE.md",
10
+ "CHANGELOG.md"
11
+ ],
12
+ "publishConfig": {
13
+ "access": "public"
14
+ },
15
+ "exports": {
16
+ ".": {
17
+ "types": "./dist/index.d.ts",
18
+ "import": "./dist/index.js"
19
+ },
20
+ "./package.json": "./package.json"
21
+ },
22
+ "scripts": {
23
+ "build": "vite build",
24
+ "dev": "vite build --watch"
25
+ },
26
+ "license": "MIT",
27
+ "dependencies": {
28
+ "jexl": "^2.3.0",
29
+ "lodash-es": "^4.18.1"
30
+ },
31
+ "devDependencies": {
32
+ "@types/lodash-es": "^4.17.12",
33
+ "@types/node": "^25.6.0",
34
+ "typescript": "^6.0.3",
35
+ "vite": "^8.0.10",
36
+ "vite-plugin-dts": "^4.5.4"
37
+ },
38
+ "engines": {
39
+ "node": ">=20.0.0"
40
+ }
41
+ }