@croz/nrich-form-configuration-core
Version:
Contains core utilities related to the nrich-form-configuration module
1 lines • 65 kB
Source Map (JSON)
{"version":3,"sources":["../../../../node_modules/lodash/_defineProperty.js","../../../../node_modules/lodash/_baseAssignValue.js","../../../../node_modules/lodash/_assignMergeValue.js","../../../../node_modules/lodash/_createBaseFor.js","../../../../node_modules/lodash/_baseFor.js","../../../../node_modules/lodash/_cloneBuffer.js","../../../../node_modules/lodash/_cloneArrayBuffer.js","../../../../node_modules/lodash/_cloneTypedArray.js","../../../../node_modules/lodash/_copyArray.js","../../../../node_modules/lodash/_baseCreate.js","../../../../node_modules/lodash/_getPrototype.js","../../../../node_modules/lodash/_initCloneObject.js","../../../../node_modules/lodash/isArrayLikeObject.js","../../../../node_modules/lodash/isPlainObject.js","../../../../node_modules/lodash/_safeGet.js","../../../../node_modules/lodash/_assignValue.js","../../../../node_modules/lodash/_copyObject.js","../../../../node_modules/lodash/_nativeKeysIn.js","../../../../node_modules/lodash/_baseKeysIn.js","../../../../node_modules/lodash/keysIn.js","../../../../node_modules/lodash/toPlainObject.js","../../../../node_modules/lodash/_baseMergeDeep.js","../../../../node_modules/lodash/_baseMerge.js","../../../../node_modules/lodash/_apply.js","../../../../node_modules/lodash/_overRest.js","../../../../node_modules/lodash/constant.js","../../../../node_modules/lodash/_baseSetToString.js","../../../../node_modules/lodash/_shortOut.js","../../../../node_modules/lodash/_setToString.js","../../../../node_modules/lodash/_baseRest.js","../../../../node_modules/lodash/_isIterateeCall.js","../../../../node_modules/lodash/_createAssigner.js","../../../../node_modules/lodash/mergeWith.js","../src/yup/store/form-configuration-store.ts","../src/yup/hook/use-form-configuration.ts","../src/yup/component/FormConfigurationProvider.tsx","../src/yup/loader/fetch-form-configurations.ts","../src/yup/converter/FormConfigurationValidationYupConverter.ts"],"sourcesContent":["var getNative = require('./_getNative');\n\nvar defineProperty = (function() {\n try {\n var func = getNative(Object, 'defineProperty');\n func({}, '', {});\n return func;\n } catch (e) {}\n}());\n\nmodule.exports = defineProperty;\n","var defineProperty = require('./_defineProperty');\n\n/**\n * The base implementation of `assignValue` and `assignMergeValue` without\n * value checks.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction baseAssignValue(object, key, value) {\n if (key == '__proto__' && defineProperty) {\n defineProperty(object, key, {\n 'configurable': true,\n 'enumerable': true,\n 'value': value,\n 'writable': true\n });\n } else {\n object[key] = value;\n }\n}\n\nmodule.exports = baseAssignValue;\n","var baseAssignValue = require('./_baseAssignValue'),\n eq = require('./eq');\n\n/**\n * This function is like `assignValue` except that it doesn't assign\n * `undefined` values.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction assignMergeValue(object, key, value) {\n if ((value !== undefined && !eq(object[key], value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n}\n\nmodule.exports = assignMergeValue;\n","/**\n * Creates a base function for methods like `_.forIn` and `_.forOwn`.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\nfunction createBaseFor(fromRight) {\n return function(object, iteratee, keysFunc) {\n var index = -1,\n iterable = Object(object),\n props = keysFunc(object),\n length = props.length;\n\n while (length--) {\n var key = props[fromRight ? length : ++index];\n if (iteratee(iterable[key], key, iterable) === false) {\n break;\n }\n }\n return object;\n };\n}\n\nmodule.exports = createBaseFor;\n","var createBaseFor = require('./_createBaseFor');\n\n/**\n * The base implementation of `baseForOwn` which iterates over `object`\n * properties returned by `keysFunc` and invokes `iteratee` for each property.\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @returns {Object} Returns `object`.\n */\nvar baseFor = createBaseFor();\n\nmodule.exports = baseFor;\n","var root = require('./_root');\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined,\n allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined;\n\n/**\n * Creates a clone of `buffer`.\n *\n * @private\n * @param {Buffer} buffer The buffer to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Buffer} Returns the cloned buffer.\n */\nfunction cloneBuffer(buffer, isDeep) {\n if (isDeep) {\n return buffer.slice();\n }\n var length = buffer.length,\n result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);\n\n buffer.copy(result);\n return result;\n}\n\nmodule.exports = cloneBuffer;\n","var Uint8Array = require('./_Uint8Array');\n\n/**\n * Creates a clone of `arrayBuffer`.\n *\n * @private\n * @param {ArrayBuffer} arrayBuffer The array buffer to clone.\n * @returns {ArrayBuffer} Returns the cloned array buffer.\n */\nfunction cloneArrayBuffer(arrayBuffer) {\n var result = new arrayBuffer.constructor(arrayBuffer.byteLength);\n new Uint8Array(result).set(new Uint8Array(arrayBuffer));\n return result;\n}\n\nmodule.exports = cloneArrayBuffer;\n","var cloneArrayBuffer = require('./_cloneArrayBuffer');\n\n/**\n * Creates a clone of `typedArray`.\n *\n * @private\n * @param {Object} typedArray The typed array to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned typed array.\n */\nfunction cloneTypedArray(typedArray, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;\n return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);\n}\n\nmodule.exports = cloneTypedArray;\n","/**\n * Copies the values of `source` to `array`.\n *\n * @private\n * @param {Array} source The array to copy values from.\n * @param {Array} [array=[]] The array to copy values to.\n * @returns {Array} Returns `array`.\n */\nfunction copyArray(source, array) {\n var index = -1,\n length = source.length;\n\n array || (array = Array(length));\n while (++index < length) {\n array[index] = source[index];\n }\n return array;\n}\n\nmodule.exports = copyArray;\n","var isObject = require('./isObject');\n\n/** Built-in value references. */\nvar objectCreate = Object.create;\n\n/**\n * The base implementation of `_.create` without support for assigning\n * properties to the created object.\n *\n * @private\n * @param {Object} proto The object to inherit from.\n * @returns {Object} Returns the new object.\n */\nvar baseCreate = (function() {\n function object() {}\n return function(proto) {\n if (!isObject(proto)) {\n return {};\n }\n if (objectCreate) {\n return objectCreate(proto);\n }\n object.prototype = proto;\n var result = new object;\n object.prototype = undefined;\n return result;\n };\n}());\n\nmodule.exports = baseCreate;\n","var overArg = require('./_overArg');\n\n/** Built-in value references. */\nvar getPrototype = overArg(Object.getPrototypeOf, Object);\n\nmodule.exports = getPrototype;\n","var baseCreate = require('./_baseCreate'),\n getPrototype = require('./_getPrototype'),\n isPrototype = require('./_isPrototype');\n\n/**\n * Initializes an object clone.\n *\n * @private\n * @param {Object} object The object to clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneObject(object) {\n return (typeof object.constructor == 'function' && !isPrototype(object))\n ? baseCreate(getPrototype(object))\n : {};\n}\n\nmodule.exports = initCloneObject;\n","var isArrayLike = require('./isArrayLike'),\n isObjectLike = require('./isObjectLike');\n\n/**\n * This method is like `_.isArrayLike` except that it also checks if `value`\n * is an object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array-like object,\n * else `false`.\n * @example\n *\n * _.isArrayLikeObject([1, 2, 3]);\n * // => true\n *\n * _.isArrayLikeObject(document.body.children);\n * // => true\n *\n * _.isArrayLikeObject('abc');\n * // => false\n *\n * _.isArrayLikeObject(_.noop);\n * // => false\n */\nfunction isArrayLikeObject(value) {\n return isObjectLike(value) && isArrayLike(value);\n}\n\nmodule.exports = isArrayLikeObject;\n","var baseGetTag = require('./_baseGetTag'),\n getPrototype = require('./_getPrototype'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar objectTag = '[object Object]';\n\n/** Used for built-in method references. */\nvar funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to infer the `Object` constructor. */\nvar objectCtorString = funcToString.call(Object);\n\n/**\n * Checks if `value` is a plain object, that is, an object created by the\n * `Object` constructor or one with a `[[Prototype]]` of `null`.\n *\n * @static\n * @memberOf _\n * @since 0.8.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * _.isPlainObject(new Foo);\n * // => false\n *\n * _.isPlainObject([1, 2, 3]);\n * // => false\n *\n * _.isPlainObject({ 'x': 0, 'y': 0 });\n * // => true\n *\n * _.isPlainObject(Object.create(null));\n * // => true\n */\nfunction isPlainObject(value) {\n if (!isObjectLike(value) || baseGetTag(value) != objectTag) {\n return false;\n }\n var proto = getPrototype(value);\n if (proto === null) {\n return true;\n }\n var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;\n return typeof Ctor == 'function' && Ctor instanceof Ctor &&\n funcToString.call(Ctor) == objectCtorString;\n}\n\nmodule.exports = isPlainObject;\n","/**\n * Gets the value at `key`, unless `key` is \"__proto__\" or \"constructor\".\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction safeGet(object, key) {\n if (key === 'constructor' && typeof object[key] === 'function') {\n return;\n }\n\n if (key == '__proto__') {\n return;\n }\n\n return object[key];\n}\n\nmodule.exports = safeGet;\n","var baseAssignValue = require('./_baseAssignValue'),\n eq = require('./eq');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Assigns `value` to `key` of `object` if the existing value is not equivalent\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction assignValue(object, key, value) {\n var objValue = object[key];\n if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n}\n\nmodule.exports = assignValue;\n","var assignValue = require('./_assignValue'),\n baseAssignValue = require('./_baseAssignValue');\n\n/**\n * Copies properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property identifiers to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @param {Function} [customizer] The function to customize copied values.\n * @returns {Object} Returns `object`.\n */\nfunction copyObject(source, props, object, customizer) {\n var isNew = !object;\n object || (object = {});\n\n var index = -1,\n length = props.length;\n\n while (++index < length) {\n var key = props[index];\n\n var newValue = customizer\n ? customizer(object[key], source[key], key, object, source)\n : undefined;\n\n if (newValue === undefined) {\n newValue = source[key];\n }\n if (isNew) {\n baseAssignValue(object, key, newValue);\n } else {\n assignValue(object, key, newValue);\n }\n }\n return object;\n}\n\nmodule.exports = copyObject;\n","/**\n * This function is like\n * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * except that it includes inherited enumerable properties.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction nativeKeysIn(object) {\n var result = [];\n if (object != null) {\n for (var key in Object(object)) {\n result.push(key);\n }\n }\n return result;\n}\n\nmodule.exports = nativeKeysIn;\n","var isObject = require('./isObject'),\n isPrototype = require('./_isPrototype'),\n nativeKeysIn = require('./_nativeKeysIn');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeysIn(object) {\n if (!isObject(object)) {\n return nativeKeysIn(object);\n }\n var isProto = isPrototype(object),\n result = [];\n\n for (var key in object) {\n if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {\n result.push(key);\n }\n }\n return result;\n}\n\nmodule.exports = baseKeysIn;\n","var arrayLikeKeys = require('./_arrayLikeKeys'),\n baseKeysIn = require('./_baseKeysIn'),\n isArrayLike = require('./isArrayLike');\n\n/**\n * Creates an array of the own and inherited enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keysIn(new Foo);\n * // => ['a', 'b', 'c'] (iteration order is not guaranteed)\n */\nfunction keysIn(object) {\n return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);\n}\n\nmodule.exports = keysIn;\n","var copyObject = require('./_copyObject'),\n keysIn = require('./keysIn');\n\n/**\n * Converts `value` to a plain object flattening inherited enumerable string\n * keyed properties of `value` to own properties of the plain object.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {Object} Returns the converted plain object.\n * @example\n *\n * function Foo() {\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.assign({ 'a': 1 }, new Foo);\n * // => { 'a': 1, 'b': 2 }\n *\n * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));\n * // => { 'a': 1, 'b': 2, 'c': 3 }\n */\nfunction toPlainObject(value) {\n return copyObject(value, keysIn(value));\n}\n\nmodule.exports = toPlainObject;\n","var assignMergeValue = require('./_assignMergeValue'),\n cloneBuffer = require('./_cloneBuffer'),\n cloneTypedArray = require('./_cloneTypedArray'),\n copyArray = require('./_copyArray'),\n initCloneObject = require('./_initCloneObject'),\n isArguments = require('./isArguments'),\n isArray = require('./isArray'),\n isArrayLikeObject = require('./isArrayLikeObject'),\n isBuffer = require('./isBuffer'),\n isFunction = require('./isFunction'),\n isObject = require('./isObject'),\n isPlainObject = require('./isPlainObject'),\n isTypedArray = require('./isTypedArray'),\n safeGet = require('./_safeGet'),\n toPlainObject = require('./toPlainObject');\n\n/**\n * A specialized version of `baseMerge` for arrays and objects which performs\n * deep merges and tracks traversed objects enabling objects with circular\n * references to be merged.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {string} key The key of the value to merge.\n * @param {number} srcIndex The index of `source`.\n * @param {Function} mergeFunc The function to merge values.\n * @param {Function} [customizer] The function to customize assigned values.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n */\nfunction baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {\n var objValue = safeGet(object, key),\n srcValue = safeGet(source, key),\n stacked = stack.get(srcValue);\n\n if (stacked) {\n assignMergeValue(object, key, stacked);\n return;\n }\n var newValue = customizer\n ? customizer(objValue, srcValue, (key + ''), object, source, stack)\n : undefined;\n\n var isCommon = newValue === undefined;\n\n if (isCommon) {\n var isArr = isArray(srcValue),\n isBuff = !isArr && isBuffer(srcValue),\n isTyped = !isArr && !isBuff && isTypedArray(srcValue);\n\n newValue = srcValue;\n if (isArr || isBuff || isTyped) {\n if (isArray(objValue)) {\n newValue = objValue;\n }\n else if (isArrayLikeObject(objValue)) {\n newValue = copyArray(objValue);\n }\n else if (isBuff) {\n isCommon = false;\n newValue = cloneBuffer(srcValue, true);\n }\n else if (isTyped) {\n isCommon = false;\n newValue = cloneTypedArray(srcValue, true);\n }\n else {\n newValue = [];\n }\n }\n else if (isPlainObject(srcValue) || isArguments(srcValue)) {\n newValue = objValue;\n if (isArguments(objValue)) {\n newValue = toPlainObject(objValue);\n }\n else if (!isObject(objValue) || isFunction(objValue)) {\n newValue = initCloneObject(srcValue);\n }\n }\n else {\n isCommon = false;\n }\n }\n if (isCommon) {\n // Recursively merge objects and arrays (susceptible to call stack limits).\n stack.set(srcValue, newValue);\n mergeFunc(newValue, srcValue, srcIndex, customizer, stack);\n stack['delete'](srcValue);\n }\n assignMergeValue(object, key, newValue);\n}\n\nmodule.exports = baseMergeDeep;\n","var Stack = require('./_Stack'),\n assignMergeValue = require('./_assignMergeValue'),\n baseFor = require('./_baseFor'),\n baseMergeDeep = require('./_baseMergeDeep'),\n isObject = require('./isObject'),\n keysIn = require('./keysIn'),\n safeGet = require('./_safeGet');\n\n/**\n * The base implementation of `_.merge` without support for multiple sources.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {number} srcIndex The index of `source`.\n * @param {Function} [customizer] The function to customize merged values.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n */\nfunction baseMerge(object, source, srcIndex, customizer, stack) {\n if (object === source) {\n return;\n }\n baseFor(source, function(srcValue, key) {\n stack || (stack = new Stack);\n if (isObject(srcValue)) {\n baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);\n }\n else {\n var newValue = customizer\n ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)\n : undefined;\n\n if (newValue === undefined) {\n newValue = srcValue;\n }\n assignMergeValue(object, key, newValue);\n }\n }, keysIn);\n}\n\nmodule.exports = baseMerge;\n","/**\n * A faster alternative to `Function#apply`, this function invokes `func`\n * with the `this` binding of `thisArg` and the arguments of `args`.\n *\n * @private\n * @param {Function} func The function to invoke.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {Array} args The arguments to invoke `func` with.\n * @returns {*} Returns the result of `func`.\n */\nfunction apply(func, thisArg, args) {\n switch (args.length) {\n case 0: return func.call(thisArg);\n case 1: return func.call(thisArg, args[0]);\n case 2: return func.call(thisArg, args[0], args[1]);\n case 3: return func.call(thisArg, args[0], args[1], args[2]);\n }\n return func.apply(thisArg, args);\n}\n\nmodule.exports = apply;\n","var apply = require('./_apply');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max;\n\n/**\n * A specialized version of `baseRest` which transforms the rest array.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @param {Function} transform The rest array transform.\n * @returns {Function} Returns the new function.\n */\nfunction overRest(func, start, transform) {\n start = nativeMax(start === undefined ? (func.length - 1) : start, 0);\n return function() {\n var args = arguments,\n index = -1,\n length = nativeMax(args.length - start, 0),\n array = Array(length);\n\n while (++index < length) {\n array[index] = args[start + index];\n }\n index = -1;\n var otherArgs = Array(start + 1);\n while (++index < start) {\n otherArgs[index] = args[index];\n }\n otherArgs[start] = transform(array);\n return apply(func, this, otherArgs);\n };\n}\n\nmodule.exports = overRest;\n","/**\n * Creates a function that returns `value`.\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Util\n * @param {*} value The value to return from the new function.\n * @returns {Function} Returns the new constant function.\n * @example\n *\n * var objects = _.times(2, _.constant({ 'a': 1 }));\n *\n * console.log(objects);\n * // => [{ 'a': 1 }, { 'a': 1 }]\n *\n * console.log(objects[0] === objects[1]);\n * // => true\n */\nfunction constant(value) {\n return function() {\n return value;\n };\n}\n\nmodule.exports = constant;\n","var constant = require('./constant'),\n defineProperty = require('./_defineProperty'),\n identity = require('./identity');\n\n/**\n * The base implementation of `setToString` without support for hot loop shorting.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\nvar baseSetToString = !defineProperty ? identity : function(func, string) {\n return defineProperty(func, 'toString', {\n 'configurable': true,\n 'enumerable': false,\n 'value': constant(string),\n 'writable': true\n });\n};\n\nmodule.exports = baseSetToString;\n","/** Used to detect hot functions by number of calls within a span of milliseconds. */\nvar HOT_COUNT = 800,\n HOT_SPAN = 16;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeNow = Date.now;\n\n/**\n * Creates a function that'll short out and invoke `identity` instead\n * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`\n * milliseconds.\n *\n * @private\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new shortable function.\n */\nfunction shortOut(func) {\n var count = 0,\n lastCalled = 0;\n\n return function() {\n var stamp = nativeNow(),\n remaining = HOT_SPAN - (stamp - lastCalled);\n\n lastCalled = stamp;\n if (remaining > 0) {\n if (++count >= HOT_COUNT) {\n return arguments[0];\n }\n } else {\n count = 0;\n }\n return func.apply(undefined, arguments);\n };\n}\n\nmodule.exports = shortOut;\n","var baseSetToString = require('./_baseSetToString'),\n shortOut = require('./_shortOut');\n\n/**\n * Sets the `toString` method of `func` to return `string`.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\nvar setToString = shortOut(baseSetToString);\n\nmodule.exports = setToString;\n","var identity = require('./identity'),\n overRest = require('./_overRest'),\n setToString = require('./_setToString');\n\n/**\n * The base implementation of `_.rest` which doesn't validate or coerce arguments.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @returns {Function} Returns the new function.\n */\nfunction baseRest(func, start) {\n return setToString(overRest(func, start, identity), func + '');\n}\n\nmodule.exports = baseRest;\n","var eq = require('./eq'),\n isArrayLike = require('./isArrayLike'),\n isIndex = require('./_isIndex'),\n isObject = require('./isObject');\n\n/**\n * Checks if the given arguments are from an iteratee call.\n *\n * @private\n * @param {*} value The potential iteratee value argument.\n * @param {*} index The potential iteratee index or key argument.\n * @param {*} object The potential iteratee object argument.\n * @returns {boolean} Returns `true` if the arguments are from an iteratee call,\n * else `false`.\n */\nfunction isIterateeCall(value, index, object) {\n if (!isObject(object)) {\n return false;\n }\n var type = typeof index;\n if (type == 'number'\n ? (isArrayLike(object) && isIndex(index, object.length))\n : (type == 'string' && index in object)\n ) {\n return eq(object[index], value);\n }\n return false;\n}\n\nmodule.exports = isIterateeCall;\n","var baseRest = require('./_baseRest'),\n isIterateeCall = require('./_isIterateeCall');\n\n/**\n * Creates a function like `_.assign`.\n *\n * @private\n * @param {Function} assigner The function to assign values.\n * @returns {Function} Returns the new assigner function.\n */\nfunction createAssigner(assigner) {\n return baseRest(function(object, sources) {\n var index = -1,\n length = sources.length,\n customizer = length > 1 ? sources[length - 1] : undefined,\n guard = length > 2 ? sources[2] : undefined;\n\n customizer = (assigner.length > 3 && typeof customizer == 'function')\n ? (length--, customizer)\n : undefined;\n\n if (guard && isIterateeCall(sources[0], sources[1], guard)) {\n customizer = length < 3 ? undefined : customizer;\n length = 1;\n }\n object = Object(object);\n while (++index < length) {\n var source = sources[index];\n if (source) {\n assigner(object, source, index, customizer);\n }\n }\n return object;\n });\n}\n\nmodule.exports = createAssigner;\n","var baseMerge = require('./_baseMerge'),\n createAssigner = require('./_createAssigner');\n\n/**\n * This method is like `_.merge` except that it accepts `customizer` which\n * is invoked to produce the merged values of the destination and source\n * properties. If `customizer` returns `undefined`, merging is handled by the\n * method instead. The `customizer` is invoked with six arguments:\n * (objValue, srcValue, key, object, source, stack).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} sources The source objects.\n * @param {Function} customizer The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @example\n *\n * function customizer(objValue, srcValue) {\n * if (_.isArray(objValue)) {\n * return objValue.concat(srcValue);\n * }\n * }\n *\n * var object = { 'a': [1], 'b': [2] };\n * var other = { 'a': [3], 'b': [4] };\n *\n * _.mergeWith(object, other, customizer);\n * // => { 'a': [1, 3], 'b': [2, 4] }\n */\nvar mergeWith = createAssigner(function(object, source, srcIndex, customizer) {\n baseMerge(object, source, srcIndex, customizer);\n});\n\nmodule.exports = mergeWith;\n","/*\n * Copyright 2022 CROZ d.o.o, the original author or authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\n\nimport { create } from \"zustand\";\n\nimport { FormYupConfiguration } from \"../api\";\n\nexport interface FormConfigurationState {\n\n /**\n * Array of current state form configurations.\n */\n yupFormConfigurations: FormYupConfiguration[];\n\n /**\n * Flag that indicates weather form configuration is fetched from API.\n */\n formConfigurationLoaded: boolean;\n\n /**\n * Sets form configurations to state.\n * Use on initial call to find-all endpoint.\n * @param formConfigurations formConfigurations to set\n */\n set: (formYupConfigurations: FormYupConfiguration[]) => void;\n\n /**\n * Adds form configuration to state.\n * @param formConfiguration formConfiguration to add\n */\n add: (formYupConfiguration: FormYupConfiguration) => void;\n\n /**\n * Removes form configuration to state.\n * @param formConfiguration formConfiguration to add\n */\n remove: (formYupConfiguration: FormYupConfiguration) => void;\n\n /**\n * Sets form configuration loaded to state.\n * @param isLoaded loaded flag to set\n */\n setFormConfigurationLoaded: (formConfigurationLoaded: boolean) => void;\n}\n\n/**\n * Creation of the API for managing internal form configuration state.\n * Used internally in the {@link useFormConfiguration} hook.\n *\n * @returns A hook for managing form configuration state usable in a React environment.\n */\nexport const useYupFormConfigurationStore = create<FormConfigurationState>((set) => ({\n yupFormConfigurations: [],\n formConfigurationLoaded: false,\n set: ((yupFormConfigurations) => set((state) => ({\n ...state, yupFormConfigurations,\n }))),\n add: (yupFormConfigurations) => set((state) => ({\n yupFormConfigurations: [...state.yupFormConfigurations, { ...yupFormConfigurations }],\n })),\n remove: (yupFormConfigurations) => set((state) => ({\n yupFormConfigurations: state.yupFormConfigurations.filter((currentFormConfiguration) => currentFormConfiguration !== yupFormConfigurations),\n })),\n setFormConfigurationLoaded: (formConfigurationLoaded) => set((state) => ({ ...state, formConfigurationLoaded })),\n}));\n","/*\n * Copyright 2022 CROZ d.o.o, the original author or authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\n\nimport { ObjectSchema } from \"yup\";\n\nimport { FormYupConfiguration } from \"../api\";\nimport { useYupFormConfigurationStore } from \"../store\";\n\nexport type FormConfigurationOptions = {\n /**\n * Array of current state form configurations.\n */\n formYupConfigurations: FormYupConfiguration[],\n /**\n * Flag that indicates whether form configuration is fetched from API.\n */\n formConfigurationLoaded: boolean;\n /**\n * Sets form configurations to state.\n * Use on initial call to find-all endpoint.\n * @param formConfigurations formConfigurations to set\n */\n set: (formConfigurations: FormYupConfiguration[]) => void,\n\n /**\n * Adds form configuration to state.\n * @param formConfiguration formConfiguration to add\n */\n add: (formConfiguration: FormYupConfiguration) => void,\n /**\n * Removes form configuration to state.\n * @param formConfiguration formConfiguration to add\n */\n remove: (formConfiguration: FormYupConfiguration) => void\n /**\n * Sets form configuration loaded to state.\n * @param isLoaded loaded flag to set\n */\n setFormConfigurationLoaded: (formConfigurationLoaded: boolean) => void;\n};\n\nexport type UseFormConfiguration = () => FormConfigurationOptions;\n\n/**\n * A hook which simplifies the usage of the form configuration state.\n * Uses the internal {@link useYupFormConfigurationStore} hook for managing the form configuration state.\n *\n * @returns An array of options to access and set the form configuration state and remove or add a single form configuration.\n */\nexport const useFormConfiguration: UseFormConfiguration = () => {\n const formYupConfigurations = useYupFormConfigurationStore((state) => state.yupFormConfigurations);\n const formConfigurationLoaded = useYupFormConfigurationStore((state) => state.formConfigurationLoaded);\n const set = useYupFormConfigurationStore((state) => state.set);\n const add = useYupFormConfigurationStore((state) => state.add);\n const remove = useYupFormConfigurationStore((state) => state.remove);\n const setFormConfigurationLoaded = useYupFormConfigurationStore((state) => state.setFormConfigurationLoaded);\n\n return {\n formYupConfigurations, formConfigurationLoaded, set, add, remove, setFormConfigurationLoaded,\n };\n};\n\n/**\n * A hook which extracts a specific Yup configuration from the form configuration identified by the form id.\n * Uses the internal {@link useYupFormConfigurationStore} hook for managing the form configuration state.\n *\n * @param formId Registered form id for a specific form configuration.\n *\n * @returns Mapped Yup configuration from the form configuration identified by the form id, or undefined if no matching form configuration is found.\n */\nexport const useYupFormConfiguration = <T extends Record<string, any> = any>(formId: string) => {\n const { formYupConfigurations } = useFormConfiguration();\n\n const searchedFormConfiguration = formYupConfigurations.find((formYupConfiguration) => formYupConfiguration.formId === formId);\n\n if (!searchedFormConfiguration) {\n return undefined;\n }\n\n return searchedFormConfiguration.yupSchema as ObjectSchema<T>;\n};\n","/*\n * Copyright 2022 CROZ d.o.o, the original author or authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\n\nimport React, { useEffect } from \"react\";\n\nimport { FormConfigurationConfiguration } from \"../../shared/api\";\nimport { useFormConfiguration } from \"../hook\";\nimport { fetchFormConfigurations } from \"../loader\";\n\nexport type Props = {\n\n /**\n * Content to show conditionally\n */\n children?: React.ReactNode;\n\n /**\n * Custom loader to show until content loads\n */\n loader?: React.ReactNode;\n} & FormConfigurationConfiguration;\n\n/**\n * Should be used to wrap the whole app that includes forms, so it doesn't render them without loading form configuration from API first.\n * @param children content to show conditionally\n * @param loader custom loader to show until content loads\n */\nexport const FormConfigurationProvider = ({ children, loader, ...fetchProps }: Props) => {\n useEffect(() => {\n fetchFormConfigurations({ ...fetchProps });\n }, []);\n\n const { formConfigurationLoaded } = useFormConfiguration();\n\n return <div>{formConfigurationLoaded ? children : loader ?? null}</div>;\n};\n","/*\n * Copyright 2022 CROZ d.o.o, the original author or authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\n\nimport _uniqBy from \"lodash/uniqBy\";\n\nimport { FormConfiguration, FormConfigurationConfiguration } from \"../../shared/api\";\nimport { FormYupConfiguration } from \"../api\";\nimport { FormConfigurationValidationYupConverter } from \"../converter\";\nimport { useYupFormConfigurationStore } from \"../store\";\n\nconst mergeYupFormConfigurationsWithoutDuplicates = (oldFormConfiguration: FormYupConfiguration[], newFormConfiguration: FormYupConfiguration[]) => {\n const mergedYupFormConfigurations = [...oldFormConfiguration, ...newFormConfiguration];\n\n return _uniqBy(mergedYupFormConfigurations, \"formId\");\n};\n\nexport const fetchFormConfigurations = async ({ url, requestOptionsResolver, additionalValidatorConverters }: FormConfigurationConfiguration): Promise<FormConfiguration[]> => {\n const formConfigurationValidationConverter = new FormConfigurationValidationYupConverter(additionalValidatorConverters);\n const additionalOptions = requestOptionsResolver?.() || {};\n const finalUrl = url || \"/nrich/form/configuration\";\n\n const response = await fetch(`${finalUrl}/fetch-all`, {\n method: \"POST\",\n ...additionalOptions,\n });\n const body = await response.json() as FormConfiguration[];\n\n const formYupConfigurations: FormYupConfiguration[] = [];\n\n // set the response to the form configuration store\n if (response.ok) {\n body.forEach((item) => {\n formYupConfigurations.push({\n formId: item.formId,\n yupSchema: formConfigurationValidationConverter.convertFormConfigurationToYupSchema(item.constrainedPropertyConfigurationList),\n });\n });\n useYupFormConfigurationStore.getState().set(mergeYupFormConfigurationsWithoutDuplicates(useYupFormConfigurationStore.getState().yupFormConfigurations, formYupConfigurations));\n useYupFormConfigurationStore.getState().setFormConfigurationLoaded(true);\n }\n\n return body;\n};\n","/*\n * Copyright 2022 CROZ d.o.o, the original author or authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\n\nimport _mergeWith from \"lodash/mergeWith\";\nimport * as yup from \"yup\";\n\nimport { ConstrainedPropertyClientValidatorConfiguration, ConstrainedPropertyConfiguration, ValidatorConverter } from \"../../shared/api\";\n\n/**\n * Converter responsible for conversion between ConstrainedPropertyConfiguration array (that contains validations specified and received from the backend)\n * and Yup's ObjectSchema that can be applied on the frontend. The list of supported conversions is in given in {@link FormConfigurationValidationYupConverter.DEFAULT_CONVERTER_LIST} but\n * users can also provide their own by using {@link ValidatorConverter} interface and supplying them in the constructor.\n * The last validator converter will match any backend constraint and try to map it directly to Yup.\n */\nexport class FormConfigurationValidationYupConverter {\n private static PATH_SEPARATOR = \".\";\n\n private static DEFAULT_CONVERTER_LIST: ValidatorConverter[] = [\n {\n supports: (configuration) => [\"NotNull\", \"NotBlank\", \"NotEmpty\"].includes(configuration.name),\n convert: (configuration, validator) => validator.required(configuration.errorMessage),\n },\n {\n supports: (configuration) => [\"Size\", \"Length\"].includes(configuration.name),\n convert: (configuration, validator) => validator.min(configuration.argumentMap.min, configuration.errorMessage).max(configuration.argumentMap.max, configuration.errorMessage),\n },\n {\n supports: (configuration) => [\"Pattern\"].includes(configuration.name),\n convert: (configuration, validator) => validator.matches(configuration.argumentMap.pattern, configuration.errorMessage),\n },\n {\n supports: (configuration) => [\"Min\", \"Max\"].includes(configuration.name),\n convert: (configuration, validator) => validator[configuration.name.toLowerCase()](configuration.argumentMap.value, configuration.errorMessage),\n },\n {\n supports: (configuration) => [\"InList\"].includes(configuration.name),\n convert: (configuration, validator) => validator.test(\"inList\", configuration.errorMessage, (value) => (configuration.argumentMap.value as string[]).includes(value)),\n },\n {\n supports: () => true,\n convert: (configuration, validator) => validator[configuration.name.toLowerCase()](configuration.errorMessage),\n },\n ];\n\n /**\n * Additional converters that can be registered for unsupported conversion or to change one of the existing conversions (they take precedence to builtin converters).\n * @private\n */\n private readonly additionalConverters: ValidatorConverter[];\n\n constructor(additionalConverters: ValidatorConverter[] = []) {\n this.additionalConverters = additionalConverters;\n }\n\n /**\n * Converts {@link ConstrainedPropertyConfiguration} array to Yup's schema using builtin and provided converters.\n * @param constrainedPropertyConfigurationList array of {@link ConstrainedPropertyConfiguration} to convert\n */\n convertFormConfigurationToYupSchema(constrainedPropertyConfigurationList: ConstrainedPropertyConfiguration[]): yup.ObjectSchema<any> {\n return this.convertFormConfigurationToYupSchemaInternal(constrainedPropertyConfigurationList);\n }\n\n private convertFormConfigurationToYupSchemaInternal(constrainedPropertyConfigurationList: ConstrainedPropertyConfiguration[]) {\n let schema = yup.object().shape({});\n\n constrainedPropertyConfigurationList.forEach((property) => {\n const yupValidation = yup[property.javascriptType];\n\n if (!yupValidation) {\n return;\n }\n\n const validator = property.validatorList\n .reduce((previousValidator, validatorConfiguration) => this.applyConverter(validatorConfiguration, previousValidator), yupValidation().default(undefined).nullable());\n const [propertyName, restOfPathList] = FormConfigurationValidationYupConverter.convertPath(property.path);\n\n if (restOfPathList.length > 0) {\n const currentPathSchema = [...restOfPathList].reverse()\n .reduce((currentShape, path) => ({ [path]: yup.object().shape(currentShape).default(undefined).nullable() }), { [propertyName]: validator });\n\n schema = this.mergeSchemas(schema, yup.object().shape(currentPathSchema));\n }\n else {\n const currentPropertySchema = yup.object().shape({ [propertyName]: validator });\n\n schema = schema.concat(currentPropertySchema);\n }\n });\n\n return schema;\n }\n\n // Function to recursively merge two Yup schemas\n mergeSchemas(schema1: yup.ObjectSchema<any>, schema2: yup.ObjectSchema<any>) {\n // Recursive helper function to merge two schema objects\n const mergeObjects = (obj1, obj2) => {\n const merged = { ...obj1 };\n\n Object.keys(obj2).forEach((key) => {\n if (Object.prototype.hasOwnProperty.call(merged, key)) {\n // If both properties are objects, merge recursively\n if (obj1[key].type === \"object\" && obj2[key].type === \"object\") {\n merged[key] = this.mergeSchemas(obj1[key], obj2[key]);\n merged[key].spec = _mergeWith(obj1[key].spec, obj2[key].spec, (field1, field2) => (typeof field1 === \"boolean\" ? field1 && field2 : field1 ?? field2));\n merged[key].internalTests = { ...obj1[key].internalTests, ...obj2[key].internalTests };\n }\n else if (obj1[key].type === \"array\" && obj2[key].type === \"array\") {\n if (obj1[key].innerType.type === \"object\" && obj2[key].innerType.type === \"object\") {\n merged[key] = yup.array().of(this.mergeSchemas(obj1[key].innerType, obj2[key].innerType));\n }\n else {\n merged[key] = yup.array().of(obj2[key].innerType);\n }\n }\n else {\n merged[key] = obj2[key];\n }\n }\n else {\n // Otherwise, add the property to the merged object\n merged[key] = obj2[key];\n }\n });\n\n return merged;\n };\n\n // Extract the fields of schema1\n const fields1 = schema1.fields;\n\n // Extract the fields of schema2\n const fields2 = schema2.fields;\n\n // Merge the fields recursively\n const mergedFields = mergeObjects(fields1, fields2);\n\n // Create a new merged schema\n return yup.object().shape(mergedFields);\n }\n\n private applyConverter(validatorConfiguration: ConstrainedPropertyClientValidatorConfiguration, validator: any): any {\n const converter = this.resolveConverter(validatorConfiguration);\n let resolvedValidator = validator;\n\n if (converter) {\n try {\n resolvedValidator = converter.convert(validatorConfiguration, validator);\n }\n catch (ignore) {\n // constraint is not registered so skip evaluation\n }\n }\n\n return resolvedValidator;\n }\n\n private resolveConverter(validatorConfiguration: ConstrainedPropertyClientValidatorConfiguration) {\n const allConverters = this.additionalConverters.concat(FormConfigurationValidationYupConverter.DEFAULT_CONVERTER_LIST);\n\n return allConverters.find((additionalConverter) => additionalConverter.supports(validatorConfiguration));\n }\n\n private static convertPath(path: string): [string, string[]] {\n const pathList = path.split(this.PATH_SEPARATOR);\n const propertyName = pathList[pathList.length - 1];\n\n pathList.pop();\n\n return [propertyName, pathList];\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,QAAI,YAAY;AAEhB,QAAI,iBAAkB,WAAW;AAC/B,UAAI;AACF,YAAI,OAAO,UAAU,QAAQ,gBAAgB;AAC7C,aAAK,CAAC,GAAG,IAAI,CAAC,CAAC;AACf,eAAO;AAAA,MACT,SAAS,GAAP;AAAA,MAAW;AAAA,IACf,EAAE;AAEF,WAAO,UAAU;AAAA;AAAA;;;ACVjB;AAAA;AAAA,QAAI,iBAAiB;AAWrB,aAAS,gBAAgBA,SAAQ,KAAK,OAAO;AAC3C,UAAI,OAAO,eAAe,gBAAgB;AACxC,uBAAeA,SAAQ,KAAK;AAAA,UAC1B,gBAAgB;AAAA,UAChB,cAAc;AAAA,UACd,SAAS;AAAA,UACT,YAAY;AAAA,QACd,CAAC;AAAA,MACH,OAAO;AACL,QAAAA,QAAO,GAAG,IAAI;AAAA,MAChB;AAAA,IACF;AAEA,WAAO,UAAU;AAAA;AAAA;;;ACxBjB;AAAA;AAAA,QAAI,kBAAkB;AAAtB,QACI,KAAK;AAWT,aAAS,iBAAiBC,SAAQ,KAAK,OAAO;AAC5C,UAAK,UAAU,UAAa,CAAC,GAAGA,QAAO,GAAG,GAAG,KAAK,KAC7C,UAAU,UAAa,EAAE,OAAOA,UAAU;AAC7C,wBAAgBA,SAAQ,KAAK,KAAK;AAAA,MACpC;AAAA,IACF;AAEA,WAAO,UAAU;AAAA;AAAA;;;ACnBjB;AAAA;AAOA,aAAS,cAAc,WAAW;AAChC,aAAO,SAASC,SAAQ,UAAU,UAAU;AAC1C,YAAI,QAAQ,IACR,WAAW,OAAOA,OAAM,GACxB,QAAQ,SAASA,OAAM,GACvB,SAAS,MAAM;AAEnB,eAAO,UAAU;AACf,cAAI,MAAM,MAAM,YAAY,SAAS,EAAE,KAAK;AAC5C,cAAI,SAAS,SAAS,GAAG,GAAG,KAAK,QAAQ,MAAM,OAAO;AACpD;AAAA,UACF;AAAA,QACF;AACA,eAAOA;AAAA,MACT;AAAA,IACF;AAEA,WAAO,UAAU;AAAA;AAAA;;;ACxBjB;AAAA;AAAA,QAAI,gBAAgB;AAapB,QAAI,UAAU,cAAc;AAE5B,WAAO,UAAU;AAAA;