@openmrs/esm-config 4.1.1-pre.556 → 4.1.1-pre.557

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.
@@ -1,9 +1,9 @@
1
- @openmrs/esm-config:build: cache hit, replaying output a017aac19a7d9fc5
2
- @openmrs/esm-config:build: asset openmrs-esm-module-config.js 26.2 KiB [emitted] [minimized] (name: main) 1 related asset
3
- @openmrs/esm-config:build: orphan modules 380 KiB [orphan] 337 modules
4
- @openmrs/esm-config:build: runtime modules 670 bytes 3 modules
5
- @openmrs/esm-config:build: built modules 82.4 KiB [built]
6
- @openmrs/esm-config:build:  ./src/index.ts + 38 modules 82.3 KiB [built] [code generated]
7
- @openmrs/esm-config:build:  external "@openmrs/esm-state" 42 bytes [built] [code generated]
8
- @openmrs/esm-config:build:  external "single-spa" 42 bytes [built] [code generated]
9
- @openmrs/esm-config:build: webpack 5.74.0 compiled successfully in 11572 ms
1
+ @openmrs/esm-config:build: cache hit, replaying output a7c7eecd3b4bda2d
2
+ @openmrs/esm-config:build: asset openmrs-esm-module-config.js 26.2 KiB [emitted] [minimized] (name: main) 1 related asset
3
+ @openmrs/esm-config:build: orphan modules 380 KiB [orphan] 337 modules
4
+ @openmrs/esm-config:build: runtime modules 670 bytes 3 modules
5
+ @openmrs/esm-config:build: built modules 82.4 KiB [built]
6
+ @openmrs/esm-config:build:  ./src/index.ts + 38 modules 82.3 KiB [built] [code generated]
7
+ @openmrs/esm-config:build:  external "@openmrs/esm-state" 42 bytes [built] [code generated]
8
+ @openmrs/esm-config:build:  external "single-spa" 42 bytes [built] [code generated]
9
+ @openmrs/esm-config:build: webpack 5.74.0 compiled successfully in 13584 ms
@@ -1 +1 @@
1
- {"version":3,"file":"openmrs-esm-module-config.js","mappings":"6RAAAA,EAAOC,QAAUC,C,UCAjBF,EAAOC,QAAUE,C,GCCbC,EAA2B,CAAC,EAGhC,SAASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,G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A6D,OAA3B6R,EAAcjE,KAAK,QAAQ,MAEjE,EAEa0B,GAAa,CACxB4B,QAAAA,GACAS,MAAAA,GACAN,4BAAAA,GACAO,MAAAA,G","sources":["webpack://@openmrs/esm-config/external system \"@openmrs/esm-state\"","webpack://@openmrs/esm-config/external system \"single-spa\"","webpack://@openmrs/esm-config/webpack/bootstrap","webpack://@openmrs/esm-config/webpack/runtime/define property getters","webpack://@openmrs/esm-config/webpack/runtime/hasOwnProperty shorthand","webpack://@openmrs/esm-config/webpack/runtime/make namespace object","webpack://@openmrs/esm-config/../../../node_modules/ramda/es/internal/_isPlaceholder.js","webpack://@openmrs/esm-config/../../../node_modules/ramda/es/internal/_curry1.js","webpack://@openmrs/esm-config/../../../node_modules/ramda/es/internal/_curry2.js","webpack://@openmrs/esm-config/../../../node_modules/ramda/es/internal/_arrayFromIterator.js","webpack://@openmrs/esm-config/../../../node_modules/ramda/es/internal/_includesWith.js","webpack://@openmrs/esm-config/../../../node_modules/ramda/es/internal/_has.js","webpack://@openmrs/esm-config/../../../node_modules/ramda/es/internal/_objectIs.js","webpack://@openmrs/esm-config/../../../node_modules/ramda/es/internal/_isArguments.js","webpack://@openmrs/esm-config/../../../node_modules/ramda/es/keys.js","webpack://@openmrs/esm-config/../../../node_modules/ramda/es/type.js","webpack://@openmrs/esm-config/../../../node_modules/ramda/es/internal/_equals.js","webpack://@openmrs/esm-config/../../../node_modules/ramda/es/internal/_functionName.js","webpack://@openmrs/esm-config/../../../node_modules/ramda/es/equals.js","webpack://@openmrs/esm-config/../../../node_modules/ramda/es/internal/_curry3.js","webpack://@openmrs/esm-config/../../../node_modules/ramda/es/internal/_isObject.js","webpack://@openmrs/esm-config/../../../node_modules/ramda/es/mergeWithKey.js","webpack://@openmrs/esm-config/../../../node_modules/ramda/es/mergeDeepWithKey.js","webpack://@openmrs/esm-config/../../../node_modules/ramda/es/mergeDeepRight.js","webpack://@openmrs/esm-config/../../../node_modules/ramda/es/omit.js","webpack://@openmrs/esm-config/../../../node_modules/ramda/es/internal/_clone.js","webpack://@openmrs/esm-config/../../../node_modules/ramda/es/internal/_cloneRegExp.js","webpack://@openmrs/esm-config/../../../node_modules/ramda/es/clone.js","webpack://@openmrs/esm-config/../../../node_modules/ramda/es/internal/_isArray.js","webpack://@openmrs/esm-config/../../../node_modules/ramda/es/internal/_isArrayLike.js","webpack://@openmrs/esm-config/../../../node_modules/ramda/es/internal/_isString.js","webpack://@openmrs/esm-config/../../../node_modules/ramda/es/internal/_xwrap.js","webpack://@openmrs/esm-config/../../../node_modules/ramda/es/bind.js","webpack://@openmrs/esm-config/../../../node_modules/ramda/es/internal/_arity.js","webpack://@openmrs/esm-config/../../../node_modules/ramda/es/internal/_reduce.js","webpack://@openmrs/esm-config/../../../node_modules/ramda/es/reduce.js","webpack://@openmrs/esm-config/./src/types.ts","webpack://@openmrs/esm-config/./src/validators/validator.ts","webpack://@openmrs/esm-config/./src/validators/type-validators.ts","webpack://@openmrs/esm-config/./src/module-config/state.ts","webpack://@openmrs/esm-config/./src/module-config/module-config.ts","webpack://@openmrs/esm-config/./src/navigation/interpolate-string.ts","webpack://@openmrs/esm-config/./src/navigation/navigate.ts","webpack://@openmrs/esm-config/./src/validators/validators.ts"],"sourcesContent":["module.exports = __WEBPACK_EXTERNAL_MODULE__685__;","module.exports = __WEBPACK_EXTERNAL_MODULE__645__;","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","export default function _isPlaceholder(a) {\n return a != null && typeof a === 'object' && a['@@functional/placeholder'] === true;\n}","import _isPlaceholder from './_isPlaceholder.js';\n\n/**\n * Optimized internal one-arity curry function.\n *\n * @private\n * @category Function\n * @param {Function} fn The function to curry.\n * @return {Function} The curried function.\n */\nexport default function _curry1(fn) {\n return function f1(a) {\n if (arguments.length === 0 || _isPlaceholder(a)) {\n return f1;\n } else {\n return fn.apply(this, arguments);\n }\n };\n}","import _curry1 from './_curry1.js';\nimport _isPlaceholder from './_isPlaceholder.js';\n\n/**\n * Optimized internal two-arity curry function.\n *\n * @private\n * @category Function\n * @param {Function} fn The function to curry.\n * @return {Function} The curried function.\n */\nexport default function _curry2(fn) {\n return function f2(a, b) {\n switch (arguments.length) {\n case 0:\n return f2;\n case 1:\n return _isPlaceholder(a) ? f2 : _curry1(function (_b) {\n return fn(a, _b);\n });\n default:\n return _isPlaceholder(a) && _isPlaceholder(b) ? f2 : _isPlaceholder(a) ? _curry1(function (_a) {\n return fn(_a, b);\n }) : _isPlaceholder(b) ? _curry1(function (_b) {\n return fn(a, _b);\n }) : fn(a, b);\n }\n };\n}","export default function _arrayFromIterator(iter) {\n var list = [];\n var next;\n while (!(next = iter.next()).done) {\n list.push(next.value);\n }\n return list;\n}","export default function _includesWith(pred, x, list) {\n var idx = 0;\n var len = list.length;\n\n while (idx < len) {\n if (pred(x, list[idx])) {\n return true;\n }\n idx += 1;\n }\n return false;\n}","export default function _has(prop, obj) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}","// Based on https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is\nfunction _objectIs(a, b) {\n // SameValue algorithm\n if (a === b) {\n // Steps 1-5, 7-10\n // Steps 6.b-6.e: +0 != -0\n return a !== 0 || 1 / a === 1 / b;\n } else {\n // Step 6.a: NaN == NaN\n return a !== a && b !== b;\n }\n}\n\nexport default typeof Object.is === 'function' ? Object.is : _objectIs;","import _has from './_has.js';\n\nvar toString = Object.prototype.toString;\nvar _isArguments = /*#__PURE__*/function () {\n return toString.call(arguments) === '[object Arguments]' ? function _isArguments(x) {\n return toString.call(x) === '[object Arguments]';\n } : function _isArguments(x) {\n return _has('callee', x);\n };\n}();\n\nexport default _isArguments;","import _curry1 from './internal/_curry1.js';\nimport _has from './internal/_has.js';\nimport _isArguments from './internal/_isArguments.js';\n\n// cover IE < 9 keys issues\nvar hasEnumBug = ! /*#__PURE__*/{ toString: null }.propertyIsEnumerable('toString');\nvar nonEnumerableProps = ['constructor', 'valueOf', 'isPrototypeOf', 'toString', 'propertyIsEnumerable', 'hasOwnProperty', 'toLocaleString'];\n// Safari bug\nvar hasArgsEnumBug = /*#__PURE__*/function () {\n 'use strict';\n\n return arguments.propertyIsEnumerable('length');\n}();\n\nvar contains = function contains(list, item) {\n var idx = 0;\n while (idx < list.length) {\n if (list[idx] === item) {\n return true;\n }\n idx += 1;\n }\n return false;\n};\n\n/**\n * Returns a list containing the names of all the enumerable own properties of\n * the supplied object.\n * Note that the order of the output array is not guaranteed to be consistent\n * across different JS platforms.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Object\n * @sig {k: v} -> [k]\n * @param {Object} obj The object to extract properties from\n * @return {Array} An array of the object's own properties.\n * @see R.keysIn, R.values\n * @example\n *\n * R.keys({a: 1, b: 2, c: 3}); //=> ['a', 'b', 'c']\n */\nvar keys = typeof Object.keys === 'function' && !hasArgsEnumBug ? /*#__PURE__*/_curry1(function keys(obj) {\n return Object(obj) !== obj ? [] : Object.keys(obj);\n}) : /*#__PURE__*/_curry1(function keys(obj) {\n if (Object(obj) !== obj) {\n return [];\n }\n var prop, nIdx;\n var ks = [];\n var checkArgsLength = hasArgsEnumBug && _isArguments(obj);\n for (prop in obj) {\n if (_has(prop, obj) && (!checkArgsLength || prop !== 'length')) {\n ks[ks.length] = prop;\n }\n }\n if (hasEnumBug) {\n nIdx = nonEnumerableProps.length - 1;\n while (nIdx >= 0) {\n prop = nonEnumerableProps[nIdx];\n if (_has(prop, obj) && !contains(ks, prop)) {\n ks[ks.length] = prop;\n }\n nIdx -= 1;\n }\n }\n return ks;\n});\nexport default keys;","import _curry1 from './internal/_curry1.js';\n\n/**\n * Gives a single-word string description of the (native) type of a value,\n * returning such answers as 'Object', 'Number', 'Array', or 'Null'. Does not\n * attempt to distinguish user Object types any further, reporting them all as\n * 'Object'.\n *\n * @func\n * @memberOf R\n * @since v0.8.0\n * @category Type\n * @sig (* -> {*}) -> String\n * @param {*} val The value to test\n * @return {String}\n * @example\n *\n * R.type({}); //=> \"Object\"\n * R.type(1); //=> \"Number\"\n * R.type(false); //=> \"Boolean\"\n * R.type('s'); //=> \"String\"\n * R.type(null); //=> \"Null\"\n * R.type([]); //=> \"Array\"\n * R.type(/[A-z]/); //=> \"RegExp\"\n * R.type(() => {}); //=> \"Function\"\n * R.type(undefined); //=> \"Undefined\"\n */\nvar type = /*#__PURE__*/_curry1(function type(val) {\n return val === null ? 'Null' : val === undefined ? 'Undefined' : Object.prototype.toString.call(val).slice(8, -1);\n});\nexport default type;","import _arrayFromIterator from './_arrayFromIterator.js';\nimport _includesWith from './_includesWith.js';\nimport _functionName from './_functionName.js';\nimport _has from './_has.js';\nimport _objectIs from './_objectIs.js';\nimport keys from '../keys.js';\nimport type from '../type.js';\n\n/**\n * private _uniqContentEquals function.\n * That function is checking equality of 2 iterator contents with 2 assumptions\n * - iterators lengths are the same\n * - iterators values are unique\n *\n * false-positive result will be returned for comparision of, e.g.\n * - [1,2,3] and [1,2,3,4]\n * - [1,1,1] and [1,2,3]\n * */\n\nfunction _uniqContentEquals(aIterator, bIterator, stackA, stackB) {\n var a = _arrayFromIterator(aIterator);\n var b = _arrayFromIterator(bIterator);\n\n function eq(_a, _b) {\n return _equals(_a, _b, stackA.slice(), stackB.slice());\n }\n\n // if *a* array contains any element that is not included in *b*\n return !_includesWith(function (b, aItem) {\n return !_includesWith(eq, aItem, b);\n }, b, a);\n}\n\nexport default function _equals(a, b, stackA, stackB) {\n if (_objectIs(a, b)) {\n return true;\n }\n\n var typeA = type(a);\n\n if (typeA !== type(b)) {\n return false;\n }\n\n if (a == null || b == null) {\n return false;\n }\n\n if (typeof a['fantasy-land/equals'] === 'function' || typeof b['fantasy-land/equals'] === 'function') {\n return typeof a['fantasy-land/equals'] === 'function' && a['fantasy-land/equals'](b) && typeof b['fantasy-land/equals'] === 'function' && b['fantasy-land/equals'](a);\n }\n\n if (typeof a.equals === 'function' || typeof b.equals === 'function') {\n return typeof a.equals === 'function' && a.equals(b) && typeof b.equals === 'function' && b.equals(a);\n }\n\n switch (typeA) {\n case 'Arguments':\n case 'Array':\n case 'Object':\n if (typeof a.constructor === 'function' && _functionName(a.constructor) === 'Promise') {\n return a === b;\n }\n break;\n case 'Boolean':\n case 'Number':\n case 'String':\n if (!(typeof a === typeof b && _objectIs(a.valueOf(), b.valueOf()))) {\n return false;\n }\n break;\n case 'Date':\n if (!_objectIs(a.valueOf(), b.valueOf())) {\n return false;\n }\n break;\n case 'Error':\n return a.name === b.name && a.message === b.message;\n case 'RegExp':\n if (!(a.source === b.source && a.global === b.global && a.ignoreCase === b.ignoreCase && a.multiline === b.multiline && a.sticky === b.sticky && a.unicode === b.unicode)) {\n return false;\n }\n break;\n }\n\n var idx = stackA.length - 1;\n while (idx >= 0) {\n if (stackA[idx] === a) {\n return stackB[idx] === b;\n }\n idx -= 1;\n }\n\n switch (typeA) {\n case 'Map':\n if (a.size !== b.size) {\n return false;\n }\n\n return _uniqContentEquals(a.entries(), b.entries(), stackA.concat([a]), stackB.concat([b]));\n case 'Set':\n if (a.size !== b.size) {\n return false;\n }\n\n return _uniqContentEquals(a.values(), b.values(), stackA.concat([a]), stackB.concat([b]));\n case 'Arguments':\n case 'Array':\n case 'Object':\n case 'Boolean':\n case 'Number':\n case 'String':\n case 'Date':\n case 'Error':\n case 'RegExp':\n case 'Int8Array':\n case 'Uint8Array':\n case 'Uint8ClampedArray':\n case 'Int16Array':\n case 'Uint16Array':\n case 'Int32Array':\n case 'Uint32Array':\n case 'Float32Array':\n case 'Float64Array':\n case 'ArrayBuffer':\n break;\n default:\n // Values of other types are only equal if identical.\n return false;\n }\n\n var keysA = keys(a);\n if (keysA.length !== keys(b).length) {\n return false;\n }\n\n var extendedStackA = stackA.concat([a]);\n var extendedStackB = stackB.concat([b]);\n\n idx = keysA.length - 1;\n while (idx >= 0) {\n var key = keysA[idx];\n if (!(_has(key, b) && _equals(b[key], a[key], extendedStackA, extendedStackB))) {\n return false;\n }\n idx -= 1;\n }\n return true;\n}","export default function _functionName(f) {\n // String(x => x) evaluates to \"x => x\", so the pattern may not match.\n var match = String(f).match(/^function (\\w*)/);\n return match == null ? '' : match[1];\n}","import _curry2 from './internal/_curry2.js';\nimport _equals from './internal/_equals.js';\n\n/**\n * Returns `true` if its arguments are equivalent, `false` otherwise. Handles\n * cyclical data structures.\n *\n * Dispatches symmetrically to the `equals` methods of both arguments, if\n * present.\n *\n * @func\n * @memberOf R\n * @since v0.15.0\n * @category Relation\n * @sig a -> b -> Boolean\n * @param {*} a\n * @param {*} b\n * @return {Boolean}\n * @example\n *\n * R.equals(1, 1); //=> true\n * R.equals(1, '1'); //=> false\n * R.equals([1, 2, 3], [1, 2, 3]); //=> true\n *\n * const a = {}; a.v = a;\n * const b = {}; b.v = b;\n * R.equals(a, b); //=> true\n */\nvar equals = /*#__PURE__*/_curry2(function equals(a, b) {\n return _equals(a, b, [], []);\n});\nexport default equals;","import _curry1 from './_curry1.js';\nimport _curry2 from './_curry2.js';\nimport _isPlaceholder from './_isPlaceholder.js';\n\n/**\n * Optimized internal three-arity curry function.\n *\n * @private\n * @category Function\n * @param {Function} fn The function to curry.\n * @return {Function} The curried function.\n */\nexport default function _curry3(fn) {\n return function f3(a, b, c) {\n switch (arguments.length) {\n case 0:\n return f3;\n case 1:\n return _isPlaceholder(a) ? f3 : _curry2(function (_b, _c) {\n return fn(a, _b, _c);\n });\n case 2:\n return _isPlaceholder(a) && _isPlaceholder(b) ? f3 : _isPlaceholder(a) ? _curry2(function (_a, _c) {\n return fn(_a, b, _c);\n }) : _isPlaceholder(b) ? _curry2(function (_b, _c) {\n return fn(a, _b, _c);\n }) : _curry1(function (_c) {\n return fn(a, b, _c);\n });\n default:\n return _isPlaceholder(a) && _isPlaceholder(b) && _isPlaceholder(c) ? f3 : _isPlaceholder(a) && _isPlaceholder(b) ? _curry2(function (_a, _b) {\n return fn(_a, _b, c);\n }) : _isPlaceholder(a) && _isPlaceholder(c) ? _curry2(function (_a, _c) {\n return fn(_a, b, _c);\n }) : _isPlaceholder(b) && _isPlaceholder(c) ? _curry2(function (_b, _c) {\n return fn(a, _b, _c);\n }) : _isPlaceholder(a) ? _curry1(function (_a) {\n return fn(_a, b, c);\n }) : _isPlaceholder(b) ? _curry1(function (_b) {\n return fn(a, _b, c);\n }) : _isPlaceholder(c) ? _curry1(function (_c) {\n return fn(a, b, _c);\n }) : fn(a, b, c);\n }\n };\n}","export default function _isObject(x) {\n return Object.prototype.toString.call(x) === '[object Object]';\n}","import _curry3 from './internal/_curry3.js';\nimport _has from './internal/_has.js';\n\n/**\n * Creates a new object with the own properties of the two provided objects. If\n * a key exists in both objects, the provided function is applied to the key\n * and the values associated with the key in each object, with the result being\n * used as the value associated with the key in the returned object.\n *\n * @func\n * @memberOf R\n * @since v0.19.0\n * @category Object\n * @sig ((String, a, a) -> a) -> {a} -> {a} -> {a}\n * @param {Function} fn\n * @param {Object} l\n * @param {Object} r\n * @return {Object}\n * @see R.mergeDeepWithKey, R.merge, R.mergeWith\n * @example\n *\n * let concatValues = (k, l, r) => k == 'values' ? R.concat(l, r) : r\n * R.mergeWithKey(concatValues,\n * { a: true, thing: 'foo', values: [10, 20] },\n * { b: true, thing: 'bar', values: [15, 35] });\n * //=> { a: true, b: true, thing: 'bar', values: [10, 20, 15, 35] }\n * @symb R.mergeWithKey(f, { x: 1, y: 2 }, { y: 5, z: 3 }) = { x: 1, y: f('y', 2, 5), z: 3 }\n */\nvar mergeWithKey = /*#__PURE__*/_curry3(function mergeWithKey(fn, l, r) {\n var result = {};\n var k;\n\n for (k in l) {\n if (_has(k, l)) {\n result[k] = _has(k, r) ? fn(k, l[k], r[k]) : l[k];\n }\n }\n\n for (k in r) {\n if (_has(k, r) && !_has(k, result)) {\n result[k] = r[k];\n }\n }\n\n return result;\n});\nexport default mergeWithKey;","import _curry3 from './internal/_curry3.js';\nimport _isObject from './internal/_isObject.js';\nimport mergeWithKey from './mergeWithKey.js';\n\n/**\n * Creates a new object with the own properties of the two provided objects.\n * If a key exists in both objects:\n * - and both associated values are also objects then the values will be\n * recursively merged.\n * - otherwise the provided function is applied to the key and associated values\n * using the resulting value as the new value associated with the key.\n * If a key only exists in one object, the value will be associated with the key\n * of the resulting object.\n *\n * @func\n * @memberOf R\n * @since v0.24.0\n * @category Object\n * @sig ((String, a, a) -> a) -> {a} -> {a} -> {a}\n * @param {Function} fn\n * @param {Object} lObj\n * @param {Object} rObj\n * @return {Object}\n * @see R.mergeWithKey, R.mergeDeepWith\n * @example\n *\n * let concatValues = (k, l, r) => k == 'values' ? R.concat(l, r) : r\n * R.mergeDeepWithKey(concatValues,\n * { a: true, c: { thing: 'foo', values: [10, 20] }},\n * { b: true, c: { thing: 'bar', values: [15, 35] }});\n * //=> { a: true, b: true, c: { thing: 'bar', values: [10, 20, 15, 35] }}\n */\nvar mergeDeepWithKey = /*#__PURE__*/_curry3(function mergeDeepWithKey(fn, lObj, rObj) {\n return mergeWithKey(function (k, lVal, rVal) {\n if (_isObject(lVal) && _isObject(rVal)) {\n return mergeDeepWithKey(fn, lVal, rVal);\n } else {\n return fn(k, lVal, rVal);\n }\n }, lObj, rObj);\n});\nexport default mergeDeepWithKey;","import _curry2 from './internal/_curry2.js';\nimport mergeDeepWithKey from './mergeDeepWithKey.js';\n\n/**\n * Creates a new object with the own properties of the first object merged with\n * the own properties of the second object. If a key exists in both objects:\n * - and both values are objects, the two values will be recursively merged\n * - otherwise the value from the second object will be used.\n *\n * @func\n * @memberOf R\n * @since v0.24.0\n * @category Object\n * @sig {a} -> {a} -> {a}\n * @param {Object} lObj\n * @param {Object} rObj\n * @return {Object}\n * @see R.merge, R.mergeDeepLeft, R.mergeDeepWith, R.mergeDeepWithKey\n * @example\n *\n * R.mergeDeepRight({ name: 'fred', age: 10, contact: { email: 'moo@example.com' }},\n * { age: 40, contact: { email: 'baa@example.com' }});\n * //=> { name: 'fred', age: 40, contact: { email: 'baa@example.com' }}\n */\nvar mergeDeepRight = /*#__PURE__*/_curry2(function mergeDeepRight(lObj, rObj) {\n return mergeDeepWithKey(function (k, lVal, rVal) {\n return rVal;\n }, lObj, rObj);\n});\nexport default mergeDeepRight;","import _curry2 from './internal/_curry2.js';\n\n/**\n * Returns a partial copy of an object omitting the keys specified.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Object\n * @sig [String] -> {String: *} -> {String: *}\n * @param {Array} names an array of String property names to omit from the new object\n * @param {Object} obj The object to copy from\n * @return {Object} A new object with properties from `names` not on it.\n * @see R.pick\n * @example\n *\n * R.omit(['a', 'd'], {a: 1, b: 2, c: 3, d: 4}); //=> {b: 2, c: 3}\n */\nvar omit = /*#__PURE__*/_curry2(function omit(names, obj) {\n var result = {};\n var index = {};\n var idx = 0;\n var len = names.length;\n\n while (idx < len) {\n index[names[idx]] = 1;\n idx += 1;\n }\n\n for (var prop in obj) {\n if (!index.hasOwnProperty(prop)) {\n result[prop] = obj[prop];\n }\n }\n return result;\n});\nexport default omit;","import _cloneRegExp from './_cloneRegExp.js';\nimport type from '../type.js';\n\n/**\n * Copies an object.\n *\n * @private\n * @param {*} value The value to be copied\n * @param {Array} refFrom Array containing the source references\n * @param {Array} refTo Array containing the copied source references\n * @param {Boolean} deep Whether or not to perform deep cloning.\n * @return {*} The copied value.\n */\nexport default function _clone(value, refFrom, refTo, deep) {\n var copy = function copy(copiedValue) {\n var len = refFrom.length;\n var idx = 0;\n while (idx < len) {\n if (value === refFrom[idx]) {\n return refTo[idx];\n }\n idx += 1;\n }\n refFrom[idx + 1] = value;\n refTo[idx + 1] = copiedValue;\n for (var key in value) {\n copiedValue[key] = deep ? _clone(value[key], refFrom, refTo, true) : value[key];\n }\n return copiedValue;\n };\n switch (type(value)) {\n case 'Object':\n return copy({});\n case 'Array':\n return copy([]);\n case 'Date':\n return new Date(value.valueOf());\n case 'RegExp':\n return _cloneRegExp(value);\n default:\n return value;\n }\n}","export default function _cloneRegExp(pattern) {\n return new RegExp(pattern.source, (pattern.global ? 'g' : '') + (pattern.ignoreCase ? 'i' : '') + (pattern.multiline ? 'm' : '') + (pattern.sticky ? 'y' : '') + (pattern.unicode ? 'u' : ''));\n}","import _clone from './internal/_clone.js';\nimport _curry1 from './internal/_curry1.js';\n\n/**\n * Creates a deep copy of the value which may contain (nested) `Array`s and\n * `Object`s, `Number`s, `String`s, `Boolean`s and `Date`s. `Function`s are\n * assigned by reference rather than copied\n *\n * Dispatches to a `clone` method if present.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Object\n * @sig {*} -> {*}\n * @param {*} value The object or array to clone\n * @return {*} A deeply cloned copy of `val`\n * @example\n *\n * const objects = [{}, {}, {}];\n * const objectsClone = R.clone(objects);\n * objects === objectsClone; //=> false\n * objects[0] === objectsClone[0]; //=> false\n */\nvar clone = /*#__PURE__*/_curry1(function clone(value) {\n return value != null && typeof value.clone === 'function' ? value.clone() : _clone(value, [], [], true);\n});\nexport default clone;","/**\n * Tests whether or not an object is an array.\n *\n * @private\n * @param {*} val The object to test.\n * @return {Boolean} `true` if `val` is an array, `false` otherwise.\n * @example\n *\n * _isArray([]); //=> true\n * _isArray(null); //=> false\n * _isArray({}); //=> false\n */\nexport default Array.isArray || function _isArray(val) {\n return val != null && val.length >= 0 && Object.prototype.toString.call(val) === '[object Array]';\n};","import _curry1 from './_curry1.js';\nimport _isArray from './_isArray.js';\nimport _isString from './_isString.js';\n\n/**\n * Tests whether or not an object is similar to an array.\n *\n * @private\n * @category Type\n * @category List\n * @sig * -> Boolean\n * @param {*} x The object to test.\n * @return {Boolean} `true` if `x` has a numeric length property and extreme indices defined; `false` otherwise.\n * @example\n *\n * _isArrayLike([]); //=> true\n * _isArrayLike(true); //=> false\n * _isArrayLike({}); //=> false\n * _isArrayLike({length: 10}); //=> false\n * _isArrayLike({0: 'zero', 9: 'nine', length: 10}); //=> true\n */\nvar _isArrayLike = /*#__PURE__*/_curry1(function isArrayLike(x) {\n if (_isArray(x)) {\n return true;\n }\n if (!x) {\n return false;\n }\n if (typeof x !== 'object') {\n return false;\n }\n if (_isString(x)) {\n return false;\n }\n if (x.nodeType === 1) {\n return !!x.length;\n }\n if (x.length === 0) {\n return true;\n }\n if (x.length > 0) {\n return x.hasOwnProperty(0) && x.hasOwnProperty(x.length - 1);\n }\n return false;\n});\nexport default _isArrayLike;","export default function _isString(x) {\n return Object.prototype.toString.call(x) === '[object String]';\n}","var XWrap = /*#__PURE__*/function () {\n function XWrap(fn) {\n this.f = fn;\n }\n XWrap.prototype['@@transducer/init'] = function () {\n throw new Error('init not implemented on XWrap');\n };\n XWrap.prototype['@@transducer/result'] = function (acc) {\n return acc;\n };\n XWrap.prototype['@@transducer/step'] = function (acc, x) {\n return this.f(acc, x);\n };\n\n return XWrap;\n}();\n\nexport default function _xwrap(fn) {\n return new XWrap(fn);\n}","import _arity from './internal/_arity.js';\nimport _curry2 from './internal/_curry2.js';\n\n/**\n * Creates a function that is bound to a context.\n * Note: `R.bind` does not provide the additional argument-binding capabilities of\n * [Function.prototype.bind](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind).\n *\n * @func\n * @memberOf R\n * @since v0.6.0\n * @category Function\n * @category Object\n * @sig (* -> *) -> {*} -> (* -> *)\n * @param {Function} fn The function to bind to context\n * @param {Object} thisObj The context to bind `fn` to\n * @return {Function} A function that will execute in the context of `thisObj`.\n * @see R.partial\n * @example\n *\n * const log = R.bind(console.log, console);\n * R.pipe(R.assoc('a', 2), R.tap(log), R.assoc('a', 3))({a: 1}); //=> {a: 3}\n * // logs {a: 2}\n * @symb R.bind(f, o)(a, b) = f.call(o, a, b)\n */\nvar bind = /*#__PURE__*/_curry2(function bind(fn, thisObj) {\n return _arity(fn.length, function () {\n return fn.apply(thisObj, arguments);\n });\n});\nexport default bind;","export default function _arity(n, fn) {\n /* eslint-disable no-unused-vars */\n switch (n) {\n case 0:\n return function () {\n return fn.apply(this, arguments);\n };\n case 1:\n return function (a0) {\n return fn.apply(this, arguments);\n };\n case 2:\n return function (a0, a1) {\n return fn.apply(this, arguments);\n };\n case 3:\n return function (a0, a1, a2) {\n return fn.apply(this, arguments);\n };\n case 4:\n return function (a0, a1, a2, a3) {\n return fn.apply(this, arguments);\n };\n case 5:\n return function (a0, a1, a2, a3, a4) {\n return fn.apply(this, arguments);\n };\n case 6:\n return function (a0, a1, a2, a3, a4, a5) {\n return fn.apply(this, arguments);\n };\n case 7:\n return function (a0, a1, a2, a3, a4, a5, a6) {\n return fn.apply(this, arguments);\n };\n case 8:\n return function (a0, a1, a2, a3, a4, a5, a6, a7) {\n return fn.apply(this, arguments);\n };\n case 9:\n return function (a0, a1, a2, a3, a4, a5, a6, a7, a8) {\n return fn.apply(this, arguments);\n };\n case 10:\n return function (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9) {\n return fn.apply(this, arguments);\n };\n default:\n throw new Error('First argument to _arity must be a non-negative integer no greater than ten');\n }\n}","import _isArrayLike from './_isArrayLike.js';\nimport _xwrap from './_xwrap.js';\nimport bind from '../bind.js';\n\nfunction _arrayReduce(xf, acc, list) {\n var idx = 0;\n var len = list.length;\n while (idx < len) {\n acc = xf['@@transducer/step'](acc, list[idx]);\n if (acc && acc['@@transducer/reduced']) {\n acc = acc['@@transducer/value'];\n break;\n }\n idx += 1;\n }\n return xf['@@transducer/result'](acc);\n}\n\nfunction _iterableReduce(xf, acc, iter) {\n var step = iter.next();\n while (!step.done) {\n acc = xf['@@transducer/step'](acc, step.value);\n if (acc && acc['@@transducer/reduced']) {\n acc = acc['@@transducer/value'];\n break;\n }\n step = iter.next();\n }\n return xf['@@transducer/result'](acc);\n}\n\nfunction _methodReduce(xf, acc, obj, methodName) {\n return xf['@@transducer/result'](obj[methodName](bind(xf['@@transducer/step'], xf), acc));\n}\n\nvar symIterator = typeof Symbol !== 'undefined' ? Symbol.iterator : '@@iterator';\n\nexport default function _reduce(fn, acc, list) {\n if (typeof fn === 'function') {\n fn = _xwrap(fn);\n }\n if (_isArrayLike(list)) {\n return _arrayReduce(fn, acc, list);\n }\n if (typeof list['fantasy-land/reduce'] === 'function') {\n return _methodReduce(fn, acc, list, 'fantasy-land/reduce');\n }\n if (list[symIterator] != null) {\n return _iterableReduce(fn, acc, list[symIterator]());\n }\n if (typeof list.next === 'function') {\n return _iterableReduce(fn, acc, list);\n }\n if (typeof list.reduce === 'function') {\n return _methodReduce(fn, acc, list, 'reduce');\n }\n\n throw new TypeError('reduce: list must be array or iterable');\n}","import _curry3 from './internal/_curry3.js';\nimport _reduce from './internal/_reduce.js';\n\n/**\n * Returns a single item by iterating through the list, successively calling\n * the iterator function and passing it an accumulator value and the current\n * value from the array, and then passing the result to the next call.\n *\n * The iterator function receives two values: *(acc, value)*. It may use\n * [`R.reduced`](#reduced) to shortcut the iteration.\n *\n * The arguments' order of [`reduceRight`](#reduceRight)'s iterator function\n * is *(value, acc)*.\n *\n * Note: `R.reduce` does not skip deleted or unassigned indices (sparse\n * arrays), unlike the native `Array.prototype.reduce` method. For more details\n * on this behavior, see:\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce#Description\n *\n * Dispatches to the `reduce` method of the third argument, if present. When\n * doing so, it is up to the user to handle the [`R.reduced`](#reduced)\n * shortcuting, as this is not implemented by `reduce`.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category List\n * @sig ((a, b) -> a) -> a -> [b] -> a\n * @param {Function} fn The iterator function. Receives two values, the accumulator and the\n * current element from the array.\n * @param {*} acc The accumulator value.\n * @param {Array} list The list to iterate over.\n * @return {*} The final, accumulated value.\n * @see R.reduced, R.addIndex, R.reduceRight\n * @example\n *\n * R.reduce(R.subtract, 0, [1, 2, 3, 4]) // => ((((0 - 1) - 2) - 3) - 4) = -10\n * // - -10\n * // / \\ / \\\n * // - 4 -6 4\n * // / \\ / \\\n * // - 3 ==> -3 3\n * // / \\ / \\\n * // - 2 -1 2\n * // / \\ / \\\n * // 0 1 0 1\n *\n * @symb R.reduce(f, a, [b, c, d]) = f(f(f(a, b), c), d)\n */\nvar reduce = /*#__PURE__*/_curry3(_reduce);\nexport default reduce;","export enum Type {\n Array = \"Array\",\n Boolean = \"Boolean\",\n ConceptUuid = \"ConceptUuid\",\n Number = \"Number\",\n Object = \"Object\",\n String = \"String\",\n UUID = \"UUID\",\n PersonAttributeTypeUuid = \"PersonAttributeTypeUuid\",\n PatientIdentifierTypeUuid = \"PatientIdentifierTypeUuid\",\n}\n\n// Full-powered typing for Config and Schema trees depends on being able to\n// have types like `string not \"_default\"`. There is an experimental PR\n// for this feature, https://github.com/microsoft/TypeScript/pull/29317\n// But it is not likely to be merged any time terribly soon. (Nov 11, 2020)\nexport interface ConfigSchema {\n [key: string]: ConfigSchema | ConfigValue;\n _type?: Type;\n _validators?: Array<Validator>;\n _elements?: ConfigSchema;\n}\n\nexport interface Config extends Object {\n [moduleName: string]: { [key: string]: any };\n}\n\nexport interface ConfigObject extends Object {\n [key: string]: any;\n \"Display conditions\"?: DisplayConditionsConfigObject;\n \"Translation overrides\"?: Record<string, Record<string, string>>;\n}\n\nexport interface DisplayConditionsConfigObject {\n privileges?: string[];\n}\n\nexport type ConfigValue =\n | string\n | number\n | boolean\n | void\n | Array<any>\n | object;\n\nexport interface ExtensionSlotConfig {\n add?: Array<string>;\n remove?: Array<string>;\n order?: Array<string>;\n configure?: ExtensionSlotConfigureValueObject;\n}\n\nexport interface ExtensionSlotConfigureValueObject {\n [key: string]: object;\n}\n\nexport interface ExtensionSlotConfigObject {\n /** Additional extension IDs to assign to this slot, in addition to those `attach`ed in code. */\n add?: Array<string>;\n /** Extension IDs which were `attach`ed to the slot but which should not be assigned. */\n remove?: Array<string>;\n /** Overrides the default ordering of extensions. */\n order?: Array<string>;\n}\n\nexport type ProvidedConfig = {\n source: string;\n config: Config;\n};\n\nexport type ValidatorFunction = (value: any) => boolean;\n\nexport type Validator = (value: any) => void | string;\n","/** @module @category Config Validation */\nimport { Validator, ValidatorFunction } from \"../types\";\n\n/**\n * Constructs a custom validator.\n *\n * ### Example\n *\n * ```typescript\n * {\n * foo: {\n * _default: 0,\n * _validators: [\n * validator(val => val >= 0, \"Must not be negative.\")\n * ]\n * }\n * }\n * ```\n * @param validationFunction Takes the configured value as input. Returns true\n * if it is valid, false otherwise.\n * @param message A string message that explains why the value is invalid. Can\n * also be a function that takes the value as input and returns a string.\n * @returns A validator ready for use in a config schema\n */\nexport function validator(\n validationFunction: ValidatorFunction,\n message: string | ((value: any) => string)\n): Validator {\n return (value) => {\n if (!validationFunction(value)) {\n if (typeof message === \"function\") {\n return message(value);\n } else {\n return message;\n }\n }\n };\n}\n","import { validator } from \"./validator\";\n\nexport const isArray = validator(\n (val) => Array.isArray(val),\n \"must be an array\"\n);\n\nexport const isBoolean = validator(\n (val) => typeof val === \"boolean\",\n \"must be a boolean\"\n);\n\nexport const isNumber = validator(\n (val) => typeof val === \"number\",\n \"must be a number\"\n);\n\nexport const isString = validator(\n (val) => typeof val === \"string\",\n \"must be a string\"\n);\n\nexport const isObject = validator(\n (val) => typeof val === \"object\" && !Array.isArray(val) && val !== null,\n \"must be an object (not an array or null)\"\n);\n\nexport const isUuid = validator(\n (val) =>\n /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(\n val\n ) || /^[0-9a-f]{36}$/i.test(val),\n \"must be a valid UUID or a 36-character hexadecimal string\"\n);\n","/** @module @category Config */\nimport { createGlobalStore, getGlobalStore } from \"@openmrs/esm-state\";\nimport { omit } from \"ramda\";\nimport {\n Config,\n ConfigObject,\n ConfigSchema,\n ExtensionSlotConfigObject,\n ProvidedConfig,\n} from \"../types\";\n\n/**\n * Internal store\n * A store of the inputs and internal state\n * @internal\n */\nexport interface ConfigInternalStore {\n /** Configs added using the `provide` function */\n providedConfigs: Array<ProvidedConfig>;\n /** An object with module names for keys and schemas for values */\n schemas: Record<string, ConfigSchema>;\n /** Whether to use dev defaults or not */\n}\n\nconst configInternalStoreInitialValue = {\n providedConfigs: [],\n schemas: {},\n};\n\n/**\n * @internal\n */\nexport const configInternalStore = createGlobalStore<ConfigInternalStore>(\n \"config-internal\",\n configInternalStoreInitialValue\n);\n\n/**\n * Temporary config\n * LocalStorage-based config used by the implementer tools\n * @internal\n */\nexport interface TemporaryConfigStore {\n config: Config;\n}\n\n/** @internal */\nexport const temporaryConfigStore = createGlobalStore<TemporaryConfigStore>(\n \"temporary-config\",\n { config: getTemporaryConfig() }\n);\n\ntemporaryConfigStore.subscribe((state) => {\n setTemporaryConfig(state.config);\n});\n\nfunction setTemporaryConfig(value: Config) {\n localStorage.setItem(\"openmrs:temporaryConfig\", JSON.stringify(value));\n}\n\nfunction getTemporaryConfig(): Config {\n try {\n return JSON.parse(localStorage.getItem(\"openmrs:temporaryConfig\") || \"{}\");\n } catch (e) {\n return {};\n }\n}\n\n/**\n * Config-side extension store\n * Just what esm-config needs to know about extension state. This\n * is to avoid having esm-config depend on esm-extensions, which would\n * create a circular dependency.\n * @internal\n */\nexport interface ConfigExtensionStore {\n mountedExtensions: Array<ConfigExtensionStoreElement>;\n}\n\n/** @internal */\nexport interface ConfigExtensionStoreElement {\n slotModuleName: string;\n extensionModuleName: string;\n slotName: string;\n extensionId: string;\n}\n\n/** @internal */\nexport const configExtensionStore = createGlobalStore<ConfigExtensionStore>(\n \"config-store-of-extension-state\",\n { mountedExtensions: [] }\n);\n\n/**\n * Output configs\n *\n * Each module has its own stores for its config and its extension slots' configs.\n * @internal\n */\nexport interface ConfigStore {\n config: ConfigObject | null;\n loaded: boolean;\n}\n\nfunction initializeConfigStore() {\n return {\n config: null,\n loaded: false,\n };\n}\n\n/** @internal */\nexport function getConfigStore(moduleName: string) {\n // We use a store for each module's config, named `config-${moduleName}`\n return getGlobalStore<ConfigStore>(\n `config-module-${moduleName}`,\n initializeConfigStore()\n );\n}\n\n/**\n * Configuration for all the specific extension slots\n * @internal\n */\nexport interface ExtensionSlotsConfigStore {\n slots: {\n [slotName: string]: {\n config: ExtensionSlotConfigObject;\n loaded: boolean;\n };\n };\n}\n\n/** @internal */\nexport function getExtensionSlotsConfigStore() {\n return getGlobalStore<ExtensionSlotsConfigStore>(`config-extension-slots`, {\n slots: {},\n });\n}\n\n/** @internal */\nexport function getExtensionSlotConfig(slotName: string) {\n return getExtensionSlotConfigFromStore(\n getExtensionSlotsConfigStore().getState(),\n slotName\n );\n}\n\n/** @internal */\nexport function getExtensionSlotConfigFromStore(\n state: ExtensionSlotsConfigStore,\n slotName: string\n) {\n const slotConfig = state.slots[slotName];\n return slotConfig ?? { loaded: false, config: {} };\n}\n\n/** @internal */\nexport interface ExtensionsConfigStore {\n configs: {\n [slotName: string]: {\n [extensionId: string]: ConfigStore;\n };\n };\n}\n\n/**\n * One store for all the extensions\n * @internal\n */\nexport function getExtensionsConfigStore() {\n return getGlobalStore<ExtensionsConfigStore>(`config-extensions`, {\n configs: {},\n });\n}\n\n/** @internal */\nexport function getExtensionConfig(slotName: string, extensionId: string) {\n const extensionConfig = Object.assign(\n {},\n getExtensionConfigFromStore(\n getExtensionsConfigStore().getState(),\n slotName,\n extensionId\n )\n );\n extensionConfig.config = omit(\n [\"Display conditions\", \"Translation overrides\"],\n extensionConfig.config\n );\n return extensionConfig;\n}\n\n/** @internal */\nexport function getExtensionConfigFromStore(\n state: ExtensionsConfigStore,\n slotName: string,\n extensionId: string\n) {\n const extensionConfig = state.configs[slotName]?.[extensionId];\n return extensionConfig ?? { loaded: false, config: null };\n}\n\n/**\n * A store of the implementer tools output config\n * @internal\n */\nexport interface ImplementerToolsConfigStore {\n config: Config;\n}\n\n/** @internal */\nexport const implementerToolsConfigStore =\n createGlobalStore<ImplementerToolsConfigStore>(\"config-implementer-tools\", {\n config: {},\n });\n","/** @module @category Config */\nimport { clone, reduce, mergeDeepRight, equals, omit } from \"ramda\";\nimport {\n Config,\n ConfigObject,\n ConfigSchema,\n ExtensionSlotConfig,\n ExtensionSlotConfigObject,\n Type,\n} from \"../types\";\nimport {\n isArray,\n isBoolean,\n isUuid,\n isNumber,\n isObject,\n isString,\n} from \"../validators/type-validators\";\nimport {\n ConfigExtensionStore,\n ConfigInternalStore,\n configInternalStore,\n ConfigStore,\n configExtensionStore,\n getConfigStore,\n getExtensionsConfigStore,\n implementerToolsConfigStore,\n temporaryConfigStore,\n getExtensionSlotsConfigStore,\n} from \"./state\";\nimport type {} from \"@openmrs/esm-globals\";\nimport { TemporaryConfigStore } from \"..\";\n\n/**\n * Store setup\n *\n *\n * Set up stores and subscriptions so that inputs get processed appropriately.\n *\n * There are *input* stores and *output* stores. The *input* stores\n * are configInternalStore, temporaryConfigStore, and configExtensionStore. The\n * output stores are set in the `compute...` functions. They are the module\n * config stores, the extension slot config stores (by module), the extension\n * config stores, and the implementer tools config store.\n *\n * This code sets up the subscriptions so that when an input store changes,\n * the correct set of output stores are updated.\n *\n * All `compute...` functions except `computeExtensionConfigs` are pure\n * (or are supposed to be), other than the fact that they all `setState`\n * store values at the end. `computeExtensionConfigs` calls `getGlobalStore`,\n * which creates stores.\n */\ncomputeModuleConfig(\n configInternalStore.getState(),\n temporaryConfigStore.getState()\n);\nconfigInternalStore.subscribe((configState) =>\n computeModuleConfig(configState, temporaryConfigStore.getState())\n);\ntemporaryConfigStore.subscribe((tempConfigState) =>\n computeModuleConfig(configInternalStore.getState(), tempConfigState)\n);\n\ncomputeImplementerToolsConfig(\n configInternalStore.getState(),\n temporaryConfigStore.getState()\n);\nconfigInternalStore.subscribe((configState) =>\n computeImplementerToolsConfig(configState, temporaryConfigStore.getState())\n);\ntemporaryConfigStore.subscribe((tempConfigState) =>\n computeImplementerToolsConfig(configInternalStore.getState(), tempConfigState)\n);\n\ncomputeExtensionSlotConfigs(\n configInternalStore.getState(),\n temporaryConfigStore.getState()\n);\nconfigInternalStore.subscribe((configState) =>\n computeExtensionSlotConfigs(configState, temporaryConfigStore.getState())\n);\ntemporaryConfigStore.subscribe((tempConfigState) =>\n computeExtensionSlotConfigs(configInternalStore.getState(), tempConfigState)\n);\n\ncomputeExtensionConfigs(\n configInternalStore.getState(),\n configExtensionStore.getState(),\n temporaryConfigStore.getState()\n);\nconfigInternalStore.subscribe((configState) => {\n computeExtensionConfigs(\n configState,\n configExtensionStore.getState(),\n temporaryConfigStore.getState()\n );\n});\nconfigExtensionStore.subscribe((extensionState) => {\n computeExtensionConfigs(\n configInternalStore.getState(),\n extensionState,\n temporaryConfigStore.getState()\n );\n});\ntemporaryConfigStore.subscribe((tempConfigState) => {\n computeExtensionConfigs(\n configInternalStore.getState(),\n configExtensionStore.getState(),\n tempConfigState\n );\n});\n\nfunction computeModuleConfig(\n state: ConfigInternalStore,\n tempState: TemporaryConfigStore\n) {\n for (let moduleName of Object.keys(state.schemas)) {\n const config = getConfigForModule(moduleName, state, tempState);\n const moduleStore = getConfigStore(moduleName);\n moduleStore.setState({ loaded: true, config });\n }\n}\n\nfunction computeExtensionSlotConfigs(\n state: ConfigInternalStore,\n tempState: TemporaryConfigStore\n) {\n const slotConfigs = getExtensionSlotConfigs(state, tempState);\n const newSlotStoreEntries = Object.fromEntries(\n Object.entries(slotConfigs).map(([slotName, config]) => [\n slotName,\n { loaded: true, config },\n ])\n );\n const slotStore = getExtensionSlotsConfigStore();\n const oldState = slotStore.getState();\n const newState = { slots: { ...oldState.slots, ...newSlotStoreEntries } };\n if (!equals(oldState, newState)) {\n slotStore.setState(newState);\n }\n}\n\nfunction computeImplementerToolsConfig(\n state: ConfigInternalStore,\n tempConfigState: TemporaryConfigStore\n) {\n const config = getImplementerToolsConfig(state, tempConfigState);\n implementerToolsConfigStore.setState({ config });\n}\n\nfunction computeExtensionConfigs(\n configState: ConfigInternalStore,\n extensionState: ConfigExtensionStore,\n tempConfigState: TemporaryConfigStore\n) {\n const configs = {};\n for (let extension of extensionState.mountedExtensions) {\n const config = computeExtensionConfig(\n extension.slotModuleName,\n extension.extensionModuleName,\n extension.slotName,\n extension.extensionId,\n configState,\n tempConfigState\n );\n configs[extension.slotName] = {\n ...configs[extension.slotName],\n [extension.extensionId]: { config, loaded: true },\n };\n }\n getExtensionsConfigStore().setState({ configs });\n}\n\n/*\n * API\n *\n */\n\n/**\n * This defines a configuration schema for a module. The schema tells the\n * configuration system how the module can be configured. It specifies\n * what makes configuration valid or invalid.\n *\n * See [Configuration System](http://o3-dev.docs.openmrs.org/#/main/config)\n * for more information about defining a config schema.\n *\n * @param moduleName Name of the module the schema is being defined for. Generally\n * should be the one in which the `defineConfigSchema` call takes place.\n * @param schema The config schema for the module\n */\nexport function defineConfigSchema(moduleName: string, schema: ConfigSchema) {\n validateConfigSchema(moduleName, schema);\n const enhancedSchema = mergeDeepRight(\n schema,\n implicitConfigSchema\n ) as ConfigSchema;\n\n const state = configInternalStore.getState();\n configInternalStore.setState({\n schemas: { ...state.schemas, [moduleName]: enhancedSchema },\n });\n}\n\n/**\n * This defines a configuration schema for an extension. When a schema is defined\n * for an extension, that extension will receive the configuration corresponding\n * to that schema, rather than the configuration corresponding to the module\n * in which it is defined.\n *\n * The schema tells the configuration system how the module can be configured.\n * It specifies what makes configuration valid or invalid.\n *\n * See [Configuration System](http://o3-dev.docs.openmrs.org/#/main/config)\n * for more information about defining a config schema.\n *\n * @param extensionName Name of the extension the schema is being defined for.\n * Should match the `name` of one of the `extensions` entries being returned\n * by `setupOpenMRS`.\n * @param schema The config schema for the extension\n */\nexport function defineExtensionConfigSchema(\n extensionName: string,\n schema: ConfigSchema\n) {\n validateConfigSchema(extensionName, schema);\n const enhancedSchema = mergeDeepRight(\n schema,\n implicitConfigSchema\n ) as ConfigSchema;\n\n const state = configInternalStore.getState();\n if (state.schemas[extensionName]) {\n console.warn(\n `Config schema for extension ${extensionName} already exists. If there are multiple extensions with this same name, one will probably crash.`\n );\n }\n\n configInternalStore.setState({\n schemas: { ...state.schemas, [extensionName]: enhancedSchema },\n });\n}\n\nexport function provide(config: Config, sourceName = \"provided\") {\n const state = configInternalStore.getState();\n configInternalStore.setState({\n providedConfigs: [...state.providedConfigs, { source: sourceName, config }],\n });\n}\n\n/**\n * A promise-based way to access the config as soon as it is fully loaded.\n * If it is already loaded, resolves the config in its present state.\n *\n * This is a useful function if you need to get the config in the course\n * of the execution of a function.\n *\n * @param moduleName The name of the module for which to look up the config\n */\nexport function getConfig(moduleName: string): Promise<Config> {\n return new Promise<Config>((resolve) => {\n const store = getConfigStore(moduleName);\n function update(state: ConfigStore) {\n if (state.loaded && state.config) {\n const config = omit(\n [\"Display conditions\", \"Translation overrides\"],\n state.config\n );\n resolve(config);\n unsubscribe && unsubscribe();\n }\n }\n update(store.getState());\n const unsubscribe = store.subscribe(update);\n });\n}\n\n/** @internal */\nexport function getConfigInternal(moduleName: string): Promise<Config> {\n return new Promise<Config>((resolve) => {\n const store = getConfigStore(moduleName);\n function update(state: ConfigStore) {\n if (state.loaded && state.config) {\n const config = state.config;\n resolve(config);\n unsubscribe && unsubscribe();\n }\n }\n update(store.getState());\n const unsubscribe = store.subscribe(update);\n });\n}\n\n/**\n * Validate and interpolate defaults for `providedConfig` according to `schema`\n *\n * @param schema a configuration schema\n * @param providedConfig an object of config values (without the top-level module name)\n * @param keyPathContext a dot-deparated string which helps the user figure out where\n * the provided config came from\n * @internal\n */\nexport function processConfig(\n schema: ConfigSchema,\n providedConfig: ConfigObject,\n keyPathContext: string\n) {\n validateStructure(schema, providedConfig, keyPathContext);\n const config = setDefaults(schema, providedConfig);\n runAllValidatorsInConfigTree(schema, config, keyPathContext);\n return config;\n}\n\n/*\n * Helper functions\n *\n */\n\n/**\n * Returns the configuration for an extension. This configuration is specific\n * to the slot in which it is mounted, and its ID within that slot.\n *\n * The schema for that configuration is the extension schema. If no extension\n * schema has been provided, the schema used is the schema of the module in\n * which the extension is defined.\n *\n * @param slotModuleName The name of the module which defines the extension slot\n * @param extensionModuleName The name of the module which defines the extension (and therefore the config schema)\n * @param slotName The name of the extension slot where the extension is mounted\n * @param extensionId The ID of the extension in its slot\n */\nfunction computeExtensionConfig(\n slotModuleName: string,\n extensionModuleName: string,\n slotName: string,\n extensionId: string,\n configState: ConfigInternalStore,\n tempConfigState: TemporaryConfigStore\n) {\n const extensionName = getExtensionNameFromId(extensionId);\n const extensionConfigSchema = configState.schemas[extensionName];\n const nameOfSchemaSource = extensionConfigSchema\n ? extensionName\n : extensionModuleName;\n const providedConfigs = getProvidedConfigs(configState, tempConfigState);\n const slotModuleConfig = mergeConfigsFor(slotModuleName, providedConfigs);\n const configOverride =\n slotModuleConfig?.extensionSlots?.[slotName]?.configure?.[extensionId] ??\n {};\n const extensionConfig = mergeConfigsFor(nameOfSchemaSource, providedConfigs);\n const combinedConfig = mergeConfigs([extensionConfig, configOverride]);\n // TODO: validate that a schema exists for the module\n const schema =\n extensionConfigSchema ?? configState.schemas[extensionModuleName];\n validateStructure(schema, combinedConfig, nameOfSchemaSource);\n const config = setDefaults(schema, combinedConfig);\n runAllValidatorsInConfigTree(schema, config, nameOfSchemaSource);\n delete config.extensionSlots;\n return config;\n}\n\nfunction getImplementerToolsConfig(\n configState: ConfigInternalStore,\n tempConfigState: TemporaryConfigStore\n): Record<string, Config> {\n let result = getSchemaWithValuesAndSources(clone(configState.schemas));\n const configsAndSources = [\n ...configState.providedConfigs.map((c) => [c.config, c.source]),\n [tempConfigState.config, \"temporary config\"],\n ] as Array<[Config, string]>;\n for (let [config, source] of configsAndSources) {\n result = mergeConfigs([result, createValuesAndSourcesTree(config, source)]);\n }\n return result;\n}\n\nfunction getSchemaWithValuesAndSources(schema) {\n if (schema.hasOwnProperty(\"_default\")) {\n return { ...schema, _value: schema._default, _source: \"default\" };\n } else if (isOrdinaryObject(schema)) {\n return Object.keys(schema).reduce((obj, key) => {\n obj[key] = getSchemaWithValuesAndSources(schema[key]);\n return obj;\n }, {});\n } else {\n // at this point, the schema is bad and an error will have been logged during schema validation\n return {};\n }\n}\n\nfunction createValuesAndSourcesTree(config: ConfigObject, source: string) {\n if (isOrdinaryObject(config)) {\n return Object.keys(config).reduce((obj, key) => {\n obj[key] = createValuesAndSourcesTree(config[key], source);\n return obj;\n }, {});\n } else {\n return { _value: config, _source: source };\n }\n}\n\nfunction getExtensionSlotConfigs(\n configState: ConfigInternalStore,\n tempConfigState: TemporaryConfigStore\n): Record<string, ExtensionSlotConfigObject> {\n const allConfigs = mergeConfigs(\n getProvidedConfigs(configState, tempConfigState)\n );\n const slotConfigPerModule: Record<\n string,\n Record<string, ExtensionSlotConfig>\n > = Object.keys(allConfigs).reduce((obj, key) => {\n if (allConfigs[key]?.extensionSlots) {\n obj[key] = allConfigs[key]?.extensionSlots;\n }\n return obj;\n }, {});\n validateAllExtensionSlotConfigs(slotConfigPerModule);\n const slotConfigs = Object.keys(slotConfigPerModule).reduce((obj, key) => {\n obj = { ...obj, ...slotConfigPerModule[key] };\n return obj;\n }, {});\n return slotConfigs;\n}\n\nfunction validateAllExtensionSlotConfigs(\n slotConfigPerModule: Record<string, Record<string, ExtensionSlotConfig>>\n) {\n for (let [moduleName, configBySlotName] of Object.entries(\n slotConfigPerModule\n )) {\n for (let [slotName, config] of Object.entries(configBySlotName)) {\n validateExtensionSlotConfig(config, moduleName, slotName);\n }\n }\n}\n\nfunction validateExtensionSlotConfig(\n config: ExtensionSlotConfig,\n moduleName: string,\n slotName: string\n): void {\n const errorPrefix = `Extension slot config '${moduleName}.extensionSlots.${slotName}`;\n const invalidKeys = Object.keys(config).filter(\n (k) => ![\"add\", \"remove\", \"order\", \"configure\"].includes(k)\n );\n if (invalidKeys.length) {\n console.error(\n errorPrefix + `' contains invalid keys '${invalidKeys.join(\"', '\")}'`\n );\n }\n if (config.add) {\n if (\n !Array.isArray(config.add) ||\n !config.add.every((n) => typeof n === \"string\")\n ) {\n console.error(\n errorPrefix +\n `.add' is invalid. Must be an array of strings (extension IDs)`\n );\n }\n }\n if (config.remove) {\n if (\n !Array.isArray(config.remove) ||\n !config.remove.every((n) => typeof n === \"string\")\n ) {\n console.error(\n errorPrefix +\n `.remove' is invalid. Must be an array of strings (extension IDs)`\n );\n }\n }\n if (config.order) {\n if (\n !Array.isArray(config.order) ||\n !config.order.every((n) => typeof n === \"string\")\n ) {\n console.error(\n errorPrefix +\n `.order' is invalid. Must be an array of strings (extension IDs)`\n );\n }\n }\n if (config.configure) {\n if (!isOrdinaryObject(config.configure)) {\n console.error(\n errorPrefix +\n `.configure' is invalid. Must be an object with extension IDs for keys`\n );\n }\n }\n}\n\nfunction getProvidedConfigs(\n configState: ConfigInternalStore,\n tempConfigState: TemporaryConfigStore\n): Array<Config> {\n return [\n ...configState.providedConfigs.map((c) => c.config),\n tempConfigState.config,\n ];\n}\n\nfunction validateConfigSchema(\n moduleName: string,\n schema: ConfigSchema,\n keyPath = \"\"\n) {\n const updateMessage = `Please verify that you are running the latest version and, if so, alert the maintainer.`;\n\n for (const key of Object.keys(schema).filter((k) => !k.startsWith(\"_\"))) {\n const thisKeyPath = keyPath + (keyPath && \".\") + key;\n const schemaPart = schema[key] as ConfigSchema;\n\n if (thisKeyPath === \"Display conditions\") {\n console.error(\n `${moduleName} declares a configuration option called \"Display conditions\"; the \"Display conditions\" option is a reserved name. ${updateMessage}`\n );\n }\n\n if (thisKeyPath === \"Translation overrides\") {\n console.error(\n `${moduleName} declares a configuration option called \"Translation overrides\"; the \"Translation overrides\" option is a reserved name. ${updateMessage}`\n );\n }\n\n if (!isOrdinaryObject(schemaPart)) {\n console.error(\n `${moduleName} has bad config schema definition for key '${thisKeyPath}'. ${updateMessage}`\n );\n continue;\n }\n\n if (!schemaPart.hasOwnProperty(\"_default\")) {\n // recurse for nested config keys\n validateConfigSchema(moduleName, schemaPart, thisKeyPath);\n }\n\n const elements = schemaPart._elements;\n if (hasObjectSchema(elements)) {\n validateConfigSchema(moduleName, elements, thisKeyPath + \"._elements\");\n }\n\n if (schemaPart._validators) {\n for (let validator of schemaPart._validators) {\n if (typeof validator !== \"function\") {\n console.error(\n `${moduleName} has invalid validator for key '${thisKeyPath}' ${updateMessage}.` +\n `\\n\\nIf you're the maintainer: validators must be functions that return either ` +\n `undefined or an error string. Received ${validator}.`\n );\n }\n }\n }\n\n const valueType = schemaPart._type;\n if (valueType && !Object.values(Type).includes(valueType)) {\n console.error(\n `${moduleName} has invalid type for key '${thisKeyPath}' ${updateMessage}.` +\n `\\n\\nIf you're the maintainer: the allowed types are ${Object.values(\n Type\n ).join(\", \")}. ` +\n `Received '${valueType}'`\n );\n }\n\n if (\n Object.keys(schemaPart).every((k) =>\n [\"_description\", \"_validators\", \"_elements\", \"_type\"].includes(k)\n ) &&\n !keyPath.includes(\"._elements\")\n ) {\n console.error(\n `${moduleName} has bad config schema definition for key '${thisKeyPath}'. ${updateMessage}.` +\n `\\n\\nIf you're the maintainer: all config elements must have a default. ` +\n `Received ${JSON.stringify(schemaPart)}`\n );\n }\n\n if (\n elements &&\n valueType &&\n ![Type.Array, Type.Object].includes(valueType)\n ) {\n console.error(\n `${moduleName} has bad config schema definition for key '${thisKeyPath}'. ${updateMessage}.` +\n `\\n\\nIf you're the maintainer: the 'elements' key only works with '_type' equal to 'Array' or 'Object'. ` +\n `Received ${JSON.stringify(valueType)}`\n );\n }\n }\n}\n\nfunction getConfigForModule(\n moduleName: string,\n configState: ConfigInternalStore,\n tempConfigState: TemporaryConfigStore\n): ConfigObject {\n if (!configState.schemas.hasOwnProperty(moduleName)) {\n throw Error(\"No config schema has been defined for \" + moduleName);\n }\n\n const schema = configState.schemas[moduleName];\n const inputConfig = mergeConfigsFor(\n moduleName,\n getProvidedConfigs(configState, tempConfigState)\n );\n validateStructure(schema, inputConfig, moduleName);\n const config = setDefaults(schema, inputConfig);\n runAllValidatorsInConfigTree(schema, config, moduleName);\n delete config.extensionSlots;\n return config;\n}\n\nfunction mergeConfigsFor(\n moduleName: string,\n allConfigs: Array<Config>\n): ConfigObject {\n const allConfigsForModule = allConfigs\n .map(({ [moduleName]: c }) => c)\n .filter((c) => !!c);\n\n return mergeConfigs(allConfigsForModule);\n}\n\nfunction mergeConfigs(configs: Array<Config>) {\n const mergeDeepAll = reduce(mergeDeepRight);\n return mergeDeepAll({}, configs) as Config;\n}\n\n/**\n * Recursively check the provided config tree to make sure that all\n * of the provided properties exist in the schema, and that types are\n * correct. Does not run validators yet, since those will be run on\n * the config with the defaults filled in.\n */\nfunction validateStructure(\n schema: ConfigSchema,\n config: ConfigObject,\n keyPath = \"\"\n) {\n // validate each constituent element\n for (const key of Object.keys(config)) {\n const value = config[key];\n const thisKeyPath = keyPath + \".\" + key;\n const schemaPart = schema[key] as ConfigSchema;\n\n if (!schema.hasOwnProperty(key)) {\n if (!(key === \"extensionSlots\" && keyPath !== \"\")) {\n console.error(\n `Unknown config key '${thisKeyPath}' provided. Ignoring.`\n );\n }\n\n continue;\n }\n\n validateBranchStructure(schemaPart, value, thisKeyPath);\n }\n}\n\nfunction validateBranchStructure(\n schemaPart: ConfigSchema,\n value: any,\n keyPath: string\n) {\n checkType(keyPath, schemaPart._type, value);\n\n if (isOrdinaryObject(value)) {\n // structurally validate only if there's elements specified\n // or there's no `_default` value (which would indicate a freeform object)\n if (schemaPart._type === Type.Object) {\n validateDictionaryStructure(schemaPart, value, keyPath);\n } else if (!schemaPart.hasOwnProperty(\"_default\")) {\n // recurse to validate nested object structure\n validateStructure(schemaPart, value, keyPath);\n }\n } else {\n if (schemaPart._type === Type.Array) {\n validateArrayStructure(schemaPart, value, keyPath);\n }\n }\n}\n\nfunction validateDictionaryStructure(\n dictionarySchema: ConfigSchema,\n config: ConfigObject,\n keyPath: string\n) {\n if (dictionarySchema._elements) {\n for (const key of Object.keys(config)) {\n const value = config[key];\n validateStructure(dictionarySchema._elements, value, `${keyPath}.${key}`);\n }\n }\n}\n\nfunction validateArrayStructure(\n arraySchema: ConfigSchema,\n value: ConfigObject,\n keyPath: string\n) {\n // if there is an array element object schema, verify that elements match it\n if (hasObjectSchema(arraySchema._elements)) {\n for (let i = 0; i < value.length; i++) {\n validateBranchStructure(\n arraySchema._elements,\n value[i],\n `${keyPath}[${i}]`\n );\n }\n }\n\n for (let i = 0; i < value.length; i++) {\n checkType(`${keyPath}[${i}]`, arraySchema._elements?._type, value[i]);\n }\n}\n\n/**\n * Run all the validators in the config tree. This should be run\n * on the config object after it has been filled in with all the defaults, since\n * higher-level validators may refer to default values.\n */\nfunction runAllValidatorsInConfigTree(\n schema: ConfigSchema,\n config: ConfigObject,\n keyPath = \"\"\n) {\n // If `!schema`, there should have been a structural validation error printed already.\n if (schema) {\n if (config !== schema._default) {\n runValidators(keyPath, schema._validators, config);\n }\n\n if (isOrdinaryObject(config)) {\n for (const key of Object.keys(config)) {\n const value = config[key];\n const thisKeyPath = keyPath + \".\" + key;\n const schemaPart = schema[key] as ConfigSchema;\n if (schema._type === Type.Object && schema._elements) {\n runAllValidatorsInConfigTree(schema._elements, value, thisKeyPath);\n } else {\n runAllValidatorsInConfigTree(schemaPart, value, thisKeyPath);\n }\n }\n } else if (Array.isArray(config) && schema._elements) {\n for (let i = 0; i < config.length; i++) {\n runAllValidatorsInConfigTree(\n schema._elements,\n config[i],\n `${keyPath}[${i}]`\n );\n }\n }\n }\n}\n\nfunction checkType(keyPath: string, _type: Type | undefined, value: any) {\n if (_type) {\n const validator: Record<string, Function> = {\n Array: isArray,\n Boolean: isBoolean,\n ConceptUuid: isUuid,\n Number: isNumber,\n Object: isObject,\n String: isString,\n UUID: isUuid,\n PersonAttributeTypeUuid: isUuid,\n PatientIdentifierTypeUuid: isUuid,\n };\n runValidators(keyPath, [validator[_type]], value);\n }\n}\n\nfunction runValidators(\n keyPath: string,\n validators: Array<Function> | undefined,\n value: any\n) {\n if (validators) {\n try {\n for (let validator of validators) {\n const validatorResult = validator(value);\n\n if (typeof validatorResult === \"string\") {\n if (typeof value === \"object\") {\n console.error(\n `Invalid configuration for ${keyPath}: ${validatorResult}`\n );\n } else {\n console.error(\n `Invalid configuration value ${value} for ${keyPath}: ${validatorResult}`\n );\n }\n }\n }\n } catch (e) {\n console.error(\n `Skipping invalid validator at \"${keyPath}\". Encountered error\\n\\t${e}`\n );\n }\n }\n}\n\n// Recursively fill in the config with values from the schema.\nconst setDefaults = (schema: ConfigSchema, inputConfig: Config) => {\n const config = clone(inputConfig);\n\n if (!schema) {\n return config;\n }\n\n for (const key of Object.keys(schema)) {\n const configPart = config[key];\n const schemaPart = schema[key] as ConfigSchema;\n\n // The `schemaPart &&` clause of this `if` statement will only fail\n // if the schema is very invalid. It is there to prevent the app from\n // crashing completely, though it will produce unexpected behavior.\n // If this happens, there should be legible errors in the console from\n // the schema validator.\n if (schemaPart && schemaPart.hasOwnProperty(\"_default\")) {\n // We assume that schemaPart defines a config value, since it has\n // a property `_default`.\n if (!config.hasOwnProperty(key)) {\n (config[key] as any) = schemaPart[\"_default\"];\n }\n\n // We also check if it is an object or array with object elements, in which case we recurse\n const elements = schemaPart._elements;\n\n if (configPart && hasObjectSchema(elements)) {\n if (schemaPart._type === Type.Array && Array.isArray(configPart)) {\n const configWithDefaults = configPart.map((conf: Config) =>\n setDefaults(elements, conf)\n );\n config[key] = configWithDefaults;\n } else if (schemaPart._type === Type.Object) {\n for (let objectKey of Object.keys(configPart)) {\n configPart[objectKey] = setDefaults(\n elements,\n configPart[objectKey]\n );\n }\n }\n }\n } else if (isOrdinaryObject(schemaPart)) {\n // Since schemaPart has no property \"_default\", if it's an ordinary object\n // (unlike, importantly, the validators array), we assume it is a parent config property.\n // We recurse to config[key] and schema[key]. Default config[key] to {}.\n const selectedConfigPart = config.hasOwnProperty(key) ? configPart : {};\n\n if (isOrdinaryObject(selectedConfigPart)) {\n config[key] = setDefaults(schemaPart, selectedConfigPart);\n }\n }\n }\n\n return config;\n};\n\nfunction hasObjectSchema(\n elementsSchema: Object | undefined\n): elementsSchema is ConfigSchema {\n return (\n !!elementsSchema &&\n Object.keys(elementsSchema).filter(\n (e) => ![\"_default\", \"_validators\"].includes(e)\n ).length > 0\n );\n}\n\nfunction isOrdinaryObject(value) {\n return typeof value === \"object\" && !Array.isArray(value) && value !== null;\n}\n\n/**\n * Copied over from esm-extensions. It rightly belongs to that module, but esm-config\n * cannot depend on esm-extensions.\n */\nfunction getExtensionNameFromId(extensionId: string) {\n const [extensionName] = extensionId.split(\"#\");\n return extensionName;\n}\n\n/**\n * The implicitConfigSchema is implicitly included in every configuration schema\n */\nconst implicitConfigSchema: ConfigSchema = {\n \"Display conditions\": {\n privileges: {\n _description: \"The privilege(s) the user must have to use this extension\",\n _type: Type.Array,\n _default: [],\n },\n },\n \"Translation overrides\": {\n _description:\n \"Per-language overrides for frontend translations should be keyed by language code and each language dictionary contains the translation key and the display value\",\n _type: Type.Object,\n _default: {},\n },\n};\n","/** @module @category Navigation */\n\nfunction trimTrailingSlash(str: string) {\n return str.replace(/\\/$/, \"\");\n}\n\n/**\n * Interpolates a string with openmrsBase and openmrsSpaBase.\n *\n * Useful for accepting `${openmrsBase}` or `${openmrsSpaBase}`plus additional template\n * parameters in configurable URLs.\n *\n * Example usage:\n * ```js\n * interpolateUrl(\"test ${openmrsBase} ${openmrsSpaBase} ok\");\n * // will return \"test /openmrs /openmrs/spa ok\"\n *\n * interpolateUrl(\"${openmrsSpaBase}/patient/${patientUuid}\", {\n * patientUuid: \"4fcb7185-c6c9-450f-8828-ccae9436bd82\",\n * }); // will return \"/openmrs/spa/patient/4fcb7185-c6c9-450f-8828-ccae9436bd82\"\n * ```\n *\n * This can be used in conjunction with the `navigate` function like so\n * ```js\n * navigate({\n * to: interpolateUrl(\n * \"${openmrsSpaBase}/patient/${patientUuid}\",\n * { patientUuid: patient.uuid }\n * )\n * }); // will navigate to \"/openmrs/spa/patient/4fcb7185-c6c9-450f-8828-ccae9436bd82\"\n * ```\n *\n * @param template A string to interpolate\n * @param additionalParams Additional values to interpolate into the string template\n */\nexport function interpolateUrl(\n template: string,\n additionalParams?: { [key: string]: string }\n): string {\n const openmrsSpaBase = trimTrailingSlash(window.getOpenmrsSpaBase());\n return interpolateString(template, {\n openmrsBase: window.openmrsBase,\n openmrsSpaBase: openmrsSpaBase,\n ...additionalParams,\n }).replace(/^\\/\\//, \"/\"); // remove extra initial slash if present\n}\n\n/**\n * Interpolates values of `params` into the `template` string.\n *\n * Example usage:\n * ```js\n * interpolateString(\"test ${one} ${two} 3\", {\n * one: \"1\",\n * two: \"2\",\n * }); // will return \"test 1 2 3\"\n * interpolateString(\"test ok\", { one: \"1\", two: \"2\" }) // will return \"test ok\"\n * ```\n *\n * @param template With optional params wrapped in `${ }`\n * @param params Values to interpolate into the string template\n */\nexport function interpolateString(\n template: string,\n params: { [key: string]: string }\n): string {\n const names = Object.keys(params);\n return names.reduce(\n (prev, curr) => prev.split(\"${\" + curr + \"}\").join(params[curr]),\n template\n );\n}\n","/** @module @category Navigation */\nimport { navigateToUrl } from \"single-spa\";\nimport { interpolateUrl } from \"./interpolate-string\";\nimport type {} from \"@openmrs/esm-globals\";\n\nfunction trimTrailingSlash(str: string) {\n return str.replace(/\\/$/, \"\");\n}\n\nexport type TemplateParams = { [key: string]: string };\n\nexport interface NavigateOptions {\n to: string;\n templateParams?: TemplateParams;\n}\n\n/**\n * Calls `location.assign` for non-SPA paths and [navigateToUrl](https://single-spa.js.org/docs/api/#navigatetourl) for SPA paths\n *\n * #### Example usage:\n * ```js\n * @example\n * const config = useConfig();\n * const submitHandler = () => {\n * navigate({ to: config.links.submitSuccess });\n * };\n * ```\n * #### Example return values:\n * ```js\n * @example\n * navigate({ to: \"/some/path\" }); // => window.location.assign(\"/some/path\")\n * navigate({ to: \"https://single-spa.js.org/\" }); // => window.location.assign(\"https://single-spa.js.org/\")\n * navigate({ to: \"${openmrsBase}/some/path\" }); // => window.location.assign(\"/openmrs/some/path\")\n * navigate({ to: \"/openmrs/spa/foo/page\" }); // => navigateToUrl(\"/openmrs/spa/foo/page\")\n * navigate({ to: \"${openmrsSpaBase}/bar/page\" }); // => navigateToUrl(\"/openmrs/spa/bar/page\")\n * navigate({ to: \"/${openmrsSpaBase}/baz/page\" }) // => navigateToUrl(\"/openmrs/spa/baz/page\")\n * ```\n *\n * @param to The target path or URL. Supports templating with 'openmrsBase', 'openmrsSpaBase',\n * and any additional template parameters defined in `templateParams`.\n * For example, `${openmrsSpaBase}/home` will resolve to `/openmrs/spa/home`\n * for implementations using the standard OpenMRS and SPA base paths.\n * If `templateParams` contains `{ foo: \"bar\" }`, then the URL `${openmrsBase}/${foo}`\n * will become `/openmrs/bar`.\n */\nexport function navigate({ to, templateParams }: NavigateOptions): void {\n const openmrsSpaBase = trimTrailingSlash(window.getOpenmrsSpaBase());\n const target = interpolateUrl(to, templateParams);\n const isSpaPath = target.startsWith(openmrsSpaBase);\n\n if (isSpaPath) {\n navigateToUrl(target);\n } else {\n window.location.assign(target);\n }\n}\n","/** @module @category Config Validation */\nimport { validator } from \"./validator\";\n\n/**\n * Verifies that the value is between the provided minimum and maximum\n *\n * @param min Minimum acceptable value\n * @param max Maximum acceptable value\n */\nexport const inRange = (min: number, max: number) => {\n return validator(\n (val) => min <= val && val <= max,\n `must be between ${min} and ${max}`\n );\n};\n\n/**\n * Verifies that a string contains only the default URL template\n * parameters, plus any specified in `allowedTemplateParameters`.\n *\n * @param allowedTemplateParameters To be added to `openmrsBase` and `openmrsSpaBase`\n * @category Navigation\n */\nexport const isUrlWithTemplateParameters = (\n allowedTemplateParameters: string[]\n) => {\n const allowedParams = allowedTemplateParameters.concat([\n \"openmrsBase\",\n \"openmrsSpaBase\",\n ]);\n return validator((val) => {\n if (!val || typeof val != \"string\") {\n return false;\n }\n\n const rx = /\\${(.*?)}/g;\n let match = rx.exec(val);\n\n while (match) {\n if (!allowedParams.includes(match[1])) {\n return false;\n }\n\n match = rx.exec(val);\n }\n\n return true;\n }, \"Should be a URL or path. The allowed template parameters are \" + allowedParams.map((p) => \"${\" + p + \"}\").join(\", \"));\n};\n\n/**\n * Verifies that a string contains only the default URL template parameters.\n *\n * @category Navigation\n */\nexport const isUrl = isUrlWithTemplateParameters([]);\n\n/**\n * Verifies that the value is one of the allowed options.\n * @param allowedValues The list of allowable values\n */\nexport const oneOf = (allowedValues: Array<any>) => {\n return validator(\n (val) => allowedValues.includes(val),\n `Must be one of the following: '${allowedValues.join(\"', '\")}'.`\n );\n};\n\nexport const validators = {\n inRange,\n isUrl,\n isUrlWithTemplateParameters,\n oneOf,\n};\n"],"names":["module","exports","__WEBPACK_EXTERNAL_MODULE__685__","__WEBPACK_EXTERNAL_MODULE__645__","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","d","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","r","Symbol","toStringTag","value","_isPlaceholder","a","_curry1","fn","f1","arguments","length","apply","this","_curry2","f2","b","_b","_a","_arrayFromIterator","iter","next","list","done","push","_includesWith","pred","x","idx","len","_has","is","toString","_isArguments","hasEnumBug","propertyIsEnumerable","nonEnumerableProps","hasArgsEnumBug","contains","item","keys","nIdx","ks","checkArgsLength","val","slice","_uniqContentEquals","aIterator","bIterator","stackA","stackB","eq","_equals","aItem","f","match","typeA","equals","constructor","String","valueOf","name","message","source","global","ignoreCase","multiline","sticky","unicode","size","entries","concat","values","keysA","extendedStackA","extendedStackB","_curry3","f3","c","_c","_isObject","l","k","result","mergeDeepWithKey","lObj","rObj","lVal","rVal","names","index","_clone","refFrom","refTo","deep","pattern","copy","copiedValue","Date","RegExp","clone","Array","isArray","_isArray","_isString","nodeType","XWrap","Error","acc","bind","thisObj","n","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","_arity","_iterableReduce","xf","step","_methodReduce","methodName","symIterator","iterator","_reduce","_xwrap","_arrayReduce","reduce","TypeError","validator","validationFunction","Type","Boolean","ConceptUuid","Number","UUID","PersonAttributeTypeUuid","PatientIdentifierTypeUuid","isBoolean","isNumber","isString","isObject","isUuid","test","configInternalStore","createGlobalStore","providedConfigs","schemas","temporaryConfigStore","config","JSON","parse","localStorage","getItem","e","getTemporaryConfig","subscribe","state","setItem","stringify","configExtensionStore","mountedExtensions","getConfigStore","moduleName","getGlobalStore","loaded","getExtensionSlotsConfigStore","slots","getExtensionSlotConfig","slotName","getExtensionSlotConfigFromStore","getState","slotConfig","getExtensionsConfigStore","configs","getExtensionConfig","extensionId","extensionConfig","assign","getExtensionConfigFromStore","omit","implementerToolsConfigStore","computeModuleConfig","tempState","getConfigForModule","setState","computeExtensionSlotConfigs","allConfigs","slotConfigPerModule","slotConfigs","mergeConfigs","getProvidedConfigs","configBySlotName","validateExtensionSlotConfig","validateAllExtensionSlotConfigs","extensionSlots","newSlotStoreEntries","fromEntries","map","slotStore","oldState","newState","computeImplementerToolsConfig","tempConfigState","configState","getSchemaWithValuesAndSources","configsAndSources","createValuesAndSourcesTree","getImplementerToolsConfig","computeExtensionConfigs","extensionState","extension","computeExtensionConfig","slotModuleName","extensionModuleName","defineConfigSchema","schema","validateConfigSchema","enhancedSchema","mergeDeepRight","implicitConfigSchema","defineExtensionConfigSchema","extensionName","console","warn","provide","sourceName","getConfig","Promise","resolve","update","unsubscribe","store","getConfigInternal","processConfig","providedConfig","keyPathContext","validateStructure","setDefaults","runAllValidatorsInConfigTree","slotModuleConfig","split","getExtensionNameFromId","extensionConfigSchema","nameOfSchemaSource","mergeConfigsFor","configOverride","configure","combinedConfig","_value","_default","_source","isOrdinaryObject","errorPrefix","invalidKeys","filter","includes","error","join","add","every","remove","order","keyPath","updateMessage","thisKeyPath","schemaPart","elements","_elements","hasObjectSchema","_validators","valueType","_type","startsWith","inputConfig","mergeDeepAll","validateBranchStructure","checkType","dictionarySchema","validateDictionaryStructure","arraySchema","i","validateArrayStructure","runValidators","validators","validatorResult","configPart","configWithDefaults","conf","objectKey","selectedConfigPart","elementsSchema","privileges","_description","interpolateUrl","template","additionalParams","openmrsSpaBase","window","getOpenmrsSpaBase","replace","interpolateString","openmrsBase","params","prev","curr","navigate","to","templateParams","target","navigateToUrl","location","inRange","min","max","isUrlWithTemplateParameters","allowedTemplateParameters","allowedParams","rx","exec","p","isUrl","oneOf","allowedValues"],"sourceRoot":""}
1
+ {"version":3,"file":"openmrs-esm-module-config.js","mappings":"6RAAAA,EAAOC,QAAUC,C,UCAjBF,EAAOC,QAAUE,C,GCCbC,EAA2B,CAAC,EAGhC,SAASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqBE,IAAjBD,EACH,OAAOA,EAAaN,QAGrB,IAAID,EAASI,EAAyBE,GAAY,CAGjDL,QAAS,CAAC,GAOX,OAHAQ,EAAoBH,GAAUN,EAAQA,EAAOC,QAASI,GAG/CL,EAAOC,OACf,CCrBAI,EAAoBK,EAAI,CAACT,EAASU,KACjC,IAAI,IAAIC,KAAOD,EACXN,EAAoBQ,EAAEF,EAAYC,KAASP,EAAoBQ,EAAEZ,EAASW,IAC5EE,OAAOC,eAAed,EAASW,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDP,EAAoBQ,EAAI,CAACK,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFd,EAAoBkB,EAAKtB,IACH,oBAAXuB,QAA0BA,OAAOC,aAC1CX,OAAOC,eAAed,EAASuB,OAAOC,YAAa,CAAEC,MAAO,WAE7DZ,OAAOC,eAAed,EAAS,aAAc,CAAEyB,OA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nC,OAAOzL,GACL,SAAC3F,G,OAAQmR,GAAOnR,GAAOA,GAAOoR,C,GAC9B,mBAA8BA,OAAXD,EAAI,SAAW,OAAJC,GAElC,EASaC,GAA8B,SACzCC,GAEA,IAAMC,EAAgBD,EAA0B3P,OAAO,CACrD,cACA,mBAEF,OAAOgE,GAAU,SAAC3F,GAChB,IAAKA,GAAqB,iBAAPA,EACjB,OAAO,EAMT,IAHA,IAAMwR,EAAK,aACP7Q,EAAQ6Q,EAAGC,KAAKzR,GAEbW,GAAO,CACZ,IAAK4Q,EAAc7D,SAAS/M,EAAM,IAChC,OAAO,EAGTA,EAAQ6Q,EAAGC,KAAKzR,EAClB,CAEA,OAAO,CACT,GAAG,gEAAkEuR,EAAcvH,KAAI,SAAC0H,G,MAAM,KAAOA,EAAI,G,IAAK9D,KAAK,MACrH,EAOa+D,GAAQN,GAA4B,IAMpCO,GAAQ,SAACC,GACpB,OAAOlM,GACL,SAAC3F,G,OAAQ6R,EAAcnE,SAAS1N,E,GAChC,kCAA6D,OAA3B6R,EAAcjE,KAAK,QAAQ,MAEjE,EAEa0B,GAAa,CACxB4B,QAAAA,GACAS,MAAAA,GACAN,4BAAAA,GACAO,MAAAA,G","sources":["webpack://@openmrs/esm-config/external system \"@openmrs/esm-state\"","webpack://@openmrs/esm-config/external system \"single-spa\"","webpack://@openmrs/esm-config/webpack/bootstrap","webpack://@openmrs/esm-config/webpack/runtime/define property getters","webpack://@openmrs/esm-config/webpack/runtime/hasOwnProperty shorthand","webpack://@openmrs/esm-config/webpack/runtime/make namespace object","webpack://@openmrs/esm-config/../../../node_modules/ramda/es/internal/_isPlaceholder.js","webpack://@openmrs/esm-config/../../../node_modules/ramda/es/internal/_curry1.js","webpack://@openmrs/esm-config/../../../node_modules/ramda/es/internal/_curry2.js","webpack://@openmrs/esm-config/../../../node_modules/ramda/es/internal/_arrayFromIterator.js","webpack://@openmrs/esm-config/../../../node_modules/ramda/es/internal/_includesWith.js","webpack://@openmrs/esm-config/../../../node_modules/ramda/es/internal/_has.js","webpack://@openmrs/esm-config/../../../node_modules/ramda/es/internal/_objectIs.js","webpack://@openmrs/esm-config/../../../node_modules/ramda/es/internal/_isArguments.js","webpack://@openmrs/esm-config/../../../node_modules/ramda/es/keys.js","webpack://@openmrs/esm-config/../../../node_modules/ramda/es/type.js","webpack://@openmrs/esm-config/../../../node_modules/ramda/es/internal/_equals.js","webpack://@openmrs/esm-config/../../../node_modules/ramda/es/internal/_functionName.js","webpack://@openmrs/esm-config/../../../node_modules/ramda/es/equals.js","webpack://@openmrs/esm-config/../../../node_modules/ramda/es/internal/_curry3.js","webpack://@openmrs/esm-config/../../../node_modules/ramda/es/internal/_isObject.js","webpack://@openmrs/esm-config/../../../node_modules/ramda/es/mergeWithKey.js","webpack://@openmrs/esm-config/../../../node_modules/ramda/es/mergeDeepWithKey.js","webpack://@openmrs/esm-config/../../../node_modules/ramda/es/mergeDeepRight.js","webpack://@openmrs/esm-config/../../../node_modules/ramda/es/omit.js","webpack://@openmrs/esm-config/../../../node_modules/ramda/es/internal/_clone.js","webpack://@openmrs/esm-config/../../../node_modules/ramda/es/internal/_cloneRegExp.js","webpack://@openmrs/esm-config/../../../node_modules/ramda/es/clone.js","webpack://@openmrs/esm-config/../../../node_modules/ramda/es/internal/_isArray.js","webpack://@openmrs/esm-config/../../../node_modules/ramda/es/internal/_isArrayLike.js","webpack://@openmrs/esm-config/../../../node_modules/ramda/es/internal/_isString.js","webpack://@openmrs/esm-config/../../../node_modules/ramda/es/internal/_xwrap.js","webpack://@openmrs/esm-config/../../../node_modules/ramda/es/bind.js","webpack://@openmrs/esm-config/../../../node_modules/ramda/es/internal/_arity.js","webpack://@openmrs/esm-config/../../../node_modules/ramda/es/internal/_reduce.js","webpack://@openmrs/esm-config/../../../node_modules/ramda/es/reduce.js","webpack://@openmrs/esm-config/./src/types.ts","webpack://@openmrs/esm-config/./src/validators/validator.ts","webpack://@openmrs/esm-config/./src/validators/type-validators.ts","webpack://@openmrs/esm-config/./src/module-config/state.ts","webpack://@openmrs/esm-config/./src/module-config/module-config.ts","webpack://@openmrs/esm-config/./src/navigation/interpolate-string.ts","webpack://@openmrs/esm-config/./src/navigation/navigate.ts","webpack://@openmrs/esm-config/./src/validators/validators.ts"],"sourcesContent":["module.exports = __WEBPACK_EXTERNAL_MODULE__685__;","module.exports = __WEBPACK_EXTERNAL_MODULE__645__;","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","export default function _isPlaceholder(a) {\n return a != null && typeof a === 'object' && a['@@functional/placeholder'] === true;\n}","import _isPlaceholder from './_isPlaceholder.js';\n\n/**\n * Optimized internal one-arity curry function.\n *\n * @private\n * @category Function\n * @param {Function} fn The function to curry.\n * @return {Function} The curried function.\n */\nexport default function _curry1(fn) {\n return function f1(a) {\n if (arguments.length === 0 || _isPlaceholder(a)) {\n return f1;\n } else {\n return fn.apply(this, arguments);\n }\n };\n}","import _curry1 from './_curry1.js';\nimport _isPlaceholder from './_isPlaceholder.js';\n\n/**\n * Optimized internal two-arity curry function.\n *\n * @private\n * @category Function\n * @param {Function} fn The function to curry.\n * @return {Function} The curried function.\n */\nexport default function _curry2(fn) {\n return function f2(a, b) {\n switch (arguments.length) {\n case 0:\n return f2;\n case 1:\n return _isPlaceholder(a) ? f2 : _curry1(function (_b) {\n return fn(a, _b);\n });\n default:\n return _isPlaceholder(a) && _isPlaceholder(b) ? f2 : _isPlaceholder(a) ? _curry1(function (_a) {\n return fn(_a, b);\n }) : _isPlaceholder(b) ? _curry1(function (_b) {\n return fn(a, _b);\n }) : fn(a, b);\n }\n };\n}","export default function _arrayFromIterator(iter) {\n var list = [];\n var next;\n while (!(next = iter.next()).done) {\n list.push(next.value);\n }\n return list;\n}","export default function _includesWith(pred, x, list) {\n var idx = 0;\n var len = list.length;\n\n while (idx < len) {\n if (pred(x, list[idx])) {\n return true;\n }\n idx += 1;\n }\n return false;\n}","export default function _has(prop, obj) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}","// Based on https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is\nfunction _objectIs(a, b) {\n // SameValue algorithm\n if (a === b) {\n // Steps 1-5, 7-10\n // Steps 6.b-6.e: +0 != -0\n return a !== 0 || 1 / a === 1 / b;\n } else {\n // Step 6.a: NaN == NaN\n return a !== a && b !== b;\n }\n}\n\nexport default typeof Object.is === 'function' ? Object.is : _objectIs;","import _has from './_has.js';\n\nvar toString = Object.prototype.toString;\nvar _isArguments = /*#__PURE__*/function () {\n return toString.call(arguments) === '[object Arguments]' ? function _isArguments(x) {\n return toString.call(x) === '[object Arguments]';\n } : function _isArguments(x) {\n return _has('callee', x);\n };\n}();\n\nexport default _isArguments;","import _curry1 from './internal/_curry1.js';\nimport _has from './internal/_has.js';\nimport _isArguments from './internal/_isArguments.js';\n\n// cover IE < 9 keys issues\nvar hasEnumBug = ! /*#__PURE__*/{ toString: null }.propertyIsEnumerable('toString');\nvar nonEnumerableProps = ['constructor', 'valueOf', 'isPrototypeOf', 'toString', 'propertyIsEnumerable', 'hasOwnProperty', 'toLocaleString'];\n// Safari bug\nvar hasArgsEnumBug = /*#__PURE__*/function () {\n 'use strict';\n\n return arguments.propertyIsEnumerable('length');\n}();\n\nvar contains = function contains(list, item) {\n var idx = 0;\n while (idx < list.length) {\n if (list[idx] === item) {\n return true;\n }\n idx += 1;\n }\n return false;\n};\n\n/**\n * Returns a list containing the names of all the enumerable own properties of\n * the supplied object.\n * Note that the order of the output array is not guaranteed to be consistent\n * across different JS platforms.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Object\n * @sig {k: v} -> [k]\n * @param {Object} obj The object to extract properties from\n * @return {Array} An array of the object's own properties.\n * @see R.keysIn, R.values\n * @example\n *\n * R.keys({a: 1, b: 2, c: 3}); //=> ['a', 'b', 'c']\n */\nvar keys = typeof Object.keys === 'function' && !hasArgsEnumBug ? /*#__PURE__*/_curry1(function keys(obj) {\n return Object(obj) !== obj ? [] : Object.keys(obj);\n}) : /*#__PURE__*/_curry1(function keys(obj) {\n if (Object(obj) !== obj) {\n return [];\n }\n var prop, nIdx;\n var ks = [];\n var checkArgsLength = hasArgsEnumBug && _isArguments(obj);\n for (prop in obj) {\n if (_has(prop, obj) && (!checkArgsLength || prop !== 'length')) {\n ks[ks.length] = prop;\n }\n }\n if (hasEnumBug) {\n nIdx = nonEnumerableProps.length - 1;\n while (nIdx >= 0) {\n prop = nonEnumerableProps[nIdx];\n if (_has(prop, obj) && !contains(ks, prop)) {\n ks[ks.length] = prop;\n }\n nIdx -= 1;\n }\n }\n return ks;\n});\nexport default keys;","import _curry1 from './internal/_curry1.js';\n\n/**\n * Gives a single-word string description of the (native) type of a value,\n * returning such answers as 'Object', 'Number', 'Array', or 'Null'. Does not\n * attempt to distinguish user Object types any further, reporting them all as\n * 'Object'.\n *\n * @func\n * @memberOf R\n * @since v0.8.0\n * @category Type\n * @sig (* -> {*}) -> String\n * @param {*} val The value to test\n * @return {String}\n * @example\n *\n * R.type({}); //=> \"Object\"\n * R.type(1); //=> \"Number\"\n * R.type(false); //=> \"Boolean\"\n * R.type('s'); //=> \"String\"\n * R.type(null); //=> \"Null\"\n * R.type([]); //=> \"Array\"\n * R.type(/[A-z]/); //=> \"RegExp\"\n * R.type(() => {}); //=> \"Function\"\n * R.type(undefined); //=> \"Undefined\"\n */\nvar type = /*#__PURE__*/_curry1(function type(val) {\n return val === null ? 'Null' : val === undefined ? 'Undefined' : Object.prototype.toString.call(val).slice(8, -1);\n});\nexport default type;","import _arrayFromIterator from './_arrayFromIterator.js';\nimport _includesWith from './_includesWith.js';\nimport _functionName from './_functionName.js';\nimport _has from './_has.js';\nimport _objectIs from './_objectIs.js';\nimport keys from '../keys.js';\nimport type from '../type.js';\n\n/**\n * private _uniqContentEquals function.\n * That function is checking equality of 2 iterator contents with 2 assumptions\n * - iterators lengths are the same\n * - iterators values are unique\n *\n * false-positive result will be returned for comparision of, e.g.\n * - [1,2,3] and [1,2,3,4]\n * - [1,1,1] and [1,2,3]\n * */\n\nfunction _uniqContentEquals(aIterator, bIterator, stackA, stackB) {\n var a = _arrayFromIterator(aIterator);\n var b = _arrayFromIterator(bIterator);\n\n function eq(_a, _b) {\n return _equals(_a, _b, stackA.slice(), stackB.slice());\n }\n\n // if *a* array contains any element that is not included in *b*\n return !_includesWith(function (b, aItem) {\n return !_includesWith(eq, aItem, b);\n }, b, a);\n}\n\nexport default function _equals(a, b, stackA, stackB) {\n if (_objectIs(a, b)) {\n return true;\n }\n\n var typeA = type(a);\n\n if (typeA !== type(b)) {\n return false;\n }\n\n if (a == null || b == null) {\n return false;\n }\n\n if (typeof a['fantasy-land/equals'] === 'function' || typeof b['fantasy-land/equals'] === 'function') {\n return typeof a['fantasy-land/equals'] === 'function' && a['fantasy-land/equals'](b) && typeof b['fantasy-land/equals'] === 'function' && b['fantasy-land/equals'](a);\n }\n\n if (typeof a.equals === 'function' || typeof b.equals === 'function') {\n return typeof a.equals === 'function' && a.equals(b) && typeof b.equals === 'function' && b.equals(a);\n }\n\n switch (typeA) {\n case 'Arguments':\n case 'Array':\n case 'Object':\n if (typeof a.constructor === 'function' && _functionName(a.constructor) === 'Promise') {\n return a === b;\n }\n break;\n case 'Boolean':\n case 'Number':\n case 'String':\n if (!(typeof a === typeof b && _objectIs(a.valueOf(), b.valueOf()))) {\n return false;\n }\n break;\n case 'Date':\n if (!_objectIs(a.valueOf(), b.valueOf())) {\n return false;\n }\n break;\n case 'Error':\n return a.name === b.name && a.message === b.message;\n case 'RegExp':\n if (!(a.source === b.source && a.global === b.global && a.ignoreCase === b.ignoreCase && a.multiline === b.multiline && a.sticky === b.sticky && a.unicode === b.unicode)) {\n return false;\n }\n break;\n }\n\n var idx = stackA.length - 1;\n while (idx >= 0) {\n if (stackA[idx] === a) {\n return stackB[idx] === b;\n }\n idx -= 1;\n }\n\n switch (typeA) {\n case 'Map':\n if (a.size !== b.size) {\n return false;\n }\n\n return _uniqContentEquals(a.entries(), b.entries(), stackA.concat([a]), stackB.concat([b]));\n case 'Set':\n if (a.size !== b.size) {\n return false;\n }\n\n return _uniqContentEquals(a.values(), b.values(), stackA.concat([a]), stackB.concat([b]));\n case 'Arguments':\n case 'Array':\n case 'Object':\n case 'Boolean':\n case 'Number':\n case 'String':\n case 'Date':\n case 'Error':\n case 'RegExp':\n case 'Int8Array':\n case 'Uint8Array':\n case 'Uint8ClampedArray':\n case 'Int16Array':\n case 'Uint16Array':\n case 'Int32Array':\n case 'Uint32Array':\n case 'Float32Array':\n case 'Float64Array':\n case 'ArrayBuffer':\n break;\n default:\n // Values of other types are only equal if identical.\n return false;\n }\n\n var keysA = keys(a);\n if (keysA.length !== keys(b).length) {\n return false;\n }\n\n var extendedStackA = stackA.concat([a]);\n var extendedStackB = stackB.concat([b]);\n\n idx = keysA.length - 1;\n while (idx >= 0) {\n var key = keysA[idx];\n if (!(_has(key, b) && _equals(b[key], a[key], extendedStackA, extendedStackB))) {\n return false;\n }\n idx -= 1;\n }\n return true;\n}","export default function _functionName(f) {\n // String(x => x) evaluates to \"x => x\", so the pattern may not match.\n var match = String(f).match(/^function (\\w*)/);\n return match == null ? '' : match[1];\n}","import _curry2 from './internal/_curry2.js';\nimport _equals from './internal/_equals.js';\n\n/**\n * Returns `true` if its arguments are equivalent, `false` otherwise. Handles\n * cyclical data structures.\n *\n * Dispatches symmetrically to the `equals` methods of both arguments, if\n * present.\n *\n * @func\n * @memberOf R\n * @since v0.15.0\n * @category Relation\n * @sig a -> b -> Boolean\n * @param {*} a\n * @param {*} b\n * @return {Boolean}\n * @example\n *\n * R.equals(1, 1); //=> true\n * R.equals(1, '1'); //=> false\n * R.equals([1, 2, 3], [1, 2, 3]); //=> true\n *\n * const a = {}; a.v = a;\n * const b = {}; b.v = b;\n * R.equals(a, b); //=> true\n */\nvar equals = /*#__PURE__*/_curry2(function equals(a, b) {\n return _equals(a, b, [], []);\n});\nexport default equals;","import _curry1 from './_curry1.js';\nimport _curry2 from './_curry2.js';\nimport _isPlaceholder from './_isPlaceholder.js';\n\n/**\n * Optimized internal three-arity curry function.\n *\n * @private\n * @category Function\n * @param {Function} fn The function to curry.\n * @return {Function} The curried function.\n */\nexport default function _curry3(fn) {\n return function f3(a, b, c) {\n switch (arguments.length) {\n case 0:\n return f3;\n case 1:\n return _isPlaceholder(a) ? f3 : _curry2(function (_b, _c) {\n return fn(a, _b, _c);\n });\n case 2:\n return _isPlaceholder(a) && _isPlaceholder(b) ? f3 : _isPlaceholder(a) ? _curry2(function (_a, _c) {\n return fn(_a, b, _c);\n }) : _isPlaceholder(b) ? _curry2(function (_b, _c) {\n return fn(a, _b, _c);\n }) : _curry1(function (_c) {\n return fn(a, b, _c);\n });\n default:\n return _isPlaceholder(a) && _isPlaceholder(b) && _isPlaceholder(c) ? f3 : _isPlaceholder(a) && _isPlaceholder(b) ? _curry2(function (_a, _b) {\n return fn(_a, _b, c);\n }) : _isPlaceholder(a) && _isPlaceholder(c) ? _curry2(function (_a, _c) {\n return fn(_a, b, _c);\n }) : _isPlaceholder(b) && _isPlaceholder(c) ? _curry2(function (_b, _c) {\n return fn(a, _b, _c);\n }) : _isPlaceholder(a) ? _curry1(function (_a) {\n return fn(_a, b, c);\n }) : _isPlaceholder(b) ? _curry1(function (_b) {\n return fn(a, _b, c);\n }) : _isPlaceholder(c) ? _curry1(function (_c) {\n return fn(a, b, _c);\n }) : fn(a, b, c);\n }\n };\n}","export default function _isObject(x) {\n return Object.prototype.toString.call(x) === '[object Object]';\n}","import _curry3 from './internal/_curry3.js';\nimport _has from './internal/_has.js';\n\n/**\n * Creates a new object with the own properties of the two provided objects. If\n * a key exists in both objects, the provided function is applied to the key\n * and the values associated with the key in each object, with the result being\n * used as the value associated with the key in the returned object.\n *\n * @func\n * @memberOf R\n * @since v0.19.0\n * @category Object\n * @sig ((String, a, a) -> a) -> {a} -> {a} -> {a}\n * @param {Function} fn\n * @param {Object} l\n * @param {Object} r\n * @return {Object}\n * @see R.mergeDeepWithKey, R.merge, R.mergeWith\n * @example\n *\n * let concatValues = (k, l, r) => k == 'values' ? R.concat(l, r) : r\n * R.mergeWithKey(concatValues,\n * { a: true, thing: 'foo', values: [10, 20] },\n * { b: true, thing: 'bar', values: [15, 35] });\n * //=> { a: true, b: true, thing: 'bar', values: [10, 20, 15, 35] }\n * @symb R.mergeWithKey(f, { x: 1, y: 2 }, { y: 5, z: 3 }) = { x: 1, y: f('y', 2, 5), z: 3 }\n */\nvar mergeWithKey = /*#__PURE__*/_curry3(function mergeWithKey(fn, l, r) {\n var result = {};\n var k;\n\n for (k in l) {\n if (_has(k, l)) {\n result[k] = _has(k, r) ? fn(k, l[k], r[k]) : l[k];\n }\n }\n\n for (k in r) {\n if (_has(k, r) && !_has(k, result)) {\n result[k] = r[k];\n }\n }\n\n return result;\n});\nexport default mergeWithKey;","import _curry3 from './internal/_curry3.js';\nimport _isObject from './internal/_isObject.js';\nimport mergeWithKey from './mergeWithKey.js';\n\n/**\n * Creates a new object with the own properties of the two provided objects.\n * If a key exists in both objects:\n * - and both associated values are also objects then the values will be\n * recursively merged.\n * - otherwise the provided function is applied to the key and associated values\n * using the resulting value as the new value associated with the key.\n * If a key only exists in one object, the value will be associated with the key\n * of the resulting object.\n *\n * @func\n * @memberOf R\n * @since v0.24.0\n * @category Object\n * @sig ((String, a, a) -> a) -> {a} -> {a} -> {a}\n * @param {Function} fn\n * @param {Object} lObj\n * @param {Object} rObj\n * @return {Object}\n * @see R.mergeWithKey, R.mergeDeepWith\n * @example\n *\n * let concatValues = (k, l, r) => k == 'values' ? R.concat(l, r) : r\n * R.mergeDeepWithKey(concatValues,\n * { a: true, c: { thing: 'foo', values: [10, 20] }},\n * { b: true, c: { thing: 'bar', values: [15, 35] }});\n * //=> { a: true, b: true, c: { thing: 'bar', values: [10, 20, 15, 35] }}\n */\nvar mergeDeepWithKey = /*#__PURE__*/_curry3(function mergeDeepWithKey(fn, lObj, rObj) {\n return mergeWithKey(function (k, lVal, rVal) {\n if (_isObject(lVal) && _isObject(rVal)) {\n return mergeDeepWithKey(fn, lVal, rVal);\n } else {\n return fn(k, lVal, rVal);\n }\n }, lObj, rObj);\n});\nexport default mergeDeepWithKey;","import _curry2 from './internal/_curry2.js';\nimport mergeDeepWithKey from './mergeDeepWithKey.js';\n\n/**\n * Creates a new object with the own properties of the first object merged with\n * the own properties of the second object. If a key exists in both objects:\n * - and both values are objects, the two values will be recursively merged\n * - otherwise the value from the second object will be used.\n *\n * @func\n * @memberOf R\n * @since v0.24.0\n * @category Object\n * @sig {a} -> {a} -> {a}\n * @param {Object} lObj\n * @param {Object} rObj\n * @return {Object}\n * @see R.merge, R.mergeDeepLeft, R.mergeDeepWith, R.mergeDeepWithKey\n * @example\n *\n * R.mergeDeepRight({ name: 'fred', age: 10, contact: { email: 'moo@example.com' }},\n * { age: 40, contact: { email: 'baa@example.com' }});\n * //=> { name: 'fred', age: 40, contact: { email: 'baa@example.com' }}\n */\nvar mergeDeepRight = /*#__PURE__*/_curry2(function mergeDeepRight(lObj, rObj) {\n return mergeDeepWithKey(function (k, lVal, rVal) {\n return rVal;\n }, lObj, rObj);\n});\nexport default mergeDeepRight;","import _curry2 from './internal/_curry2.js';\n\n/**\n * Returns a partial copy of an object omitting the keys specified.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Object\n * @sig [String] -> {String: *} -> {String: *}\n * @param {Array} names an array of String property names to omit from the new object\n * @param {Object} obj The object to copy from\n * @return {Object} A new object with properties from `names` not on it.\n * @see R.pick\n * @example\n *\n * R.omit(['a', 'd'], {a: 1, b: 2, c: 3, d: 4}); //=> {b: 2, c: 3}\n */\nvar omit = /*#__PURE__*/_curry2(function omit(names, obj) {\n var result = {};\n var index = {};\n var idx = 0;\n var len = names.length;\n\n while (idx < len) {\n index[names[idx]] = 1;\n idx += 1;\n }\n\n for (var prop in obj) {\n if (!index.hasOwnProperty(prop)) {\n result[prop] = obj[prop];\n }\n }\n return result;\n});\nexport default omit;","import _cloneRegExp from './_cloneRegExp.js';\nimport type from '../type.js';\n\n/**\n * Copies an object.\n *\n * @private\n * @param {*} value The value to be copied\n * @param {Array} refFrom Array containing the source references\n * @param {Array} refTo Array containing the copied source references\n * @param {Boolean} deep Whether or not to perform deep cloning.\n * @return {*} The copied value.\n */\nexport default function _clone(value, refFrom, refTo, deep) {\n var copy = function copy(copiedValue) {\n var len = refFrom.length;\n var idx = 0;\n while (idx < len) {\n if (value === refFrom[idx]) {\n return refTo[idx];\n }\n idx += 1;\n }\n refFrom[idx + 1] = value;\n refTo[idx + 1] = copiedValue;\n for (var key in value) {\n copiedValue[key] = deep ? _clone(value[key], refFrom, refTo, true) : value[key];\n }\n return copiedValue;\n };\n switch (type(value)) {\n case 'Object':\n return copy({});\n case 'Array':\n return copy([]);\n case 'Date':\n return new Date(value.valueOf());\n case 'RegExp':\n return _cloneRegExp(value);\n default:\n return value;\n }\n}","export default function _cloneRegExp(pattern) {\n return new RegExp(pattern.source, (pattern.global ? 'g' : '') + (pattern.ignoreCase ? 'i' : '') + (pattern.multiline ? 'm' : '') + (pattern.sticky ? 'y' : '') + (pattern.unicode ? 'u' : ''));\n}","import _clone from './internal/_clone.js';\nimport _curry1 from './internal/_curry1.js';\n\n/**\n * Creates a deep copy of the value which may contain (nested) `Array`s and\n * `Object`s, `Number`s, `String`s, `Boolean`s and `Date`s. `Function`s are\n * assigned by reference rather than copied\n *\n * Dispatches to a `clone` method if present.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Object\n * @sig {*} -> {*}\n * @param {*} value The object or array to clone\n * @return {*} A deeply cloned copy of `val`\n * @example\n *\n * const objects = [{}, {}, {}];\n * const objectsClone = R.clone(objects);\n * objects === objectsClone; //=> false\n * objects[0] === objectsClone[0]; //=> false\n */\nvar clone = /*#__PURE__*/_curry1(function clone(value) {\n return value != null && typeof value.clone === 'function' ? value.clone() : _clone(value, [], [], true);\n});\nexport default clone;","/**\n * Tests whether or not an object is an array.\n *\n * @private\n * @param {*} val The object to test.\n * @return {Boolean} `true` if `val` is an array, `false` otherwise.\n * @example\n *\n * _isArray([]); //=> true\n * _isArray(null); //=> false\n * _isArray({}); //=> false\n */\nexport default Array.isArray || function _isArray(val) {\n return val != null && val.length >= 0 && Object.prototype.toString.call(val) === '[object Array]';\n};","import _curry1 from './_curry1.js';\nimport _isArray from './_isArray.js';\nimport _isString from './_isString.js';\n\n/**\n * Tests whether or not an object is similar to an array.\n *\n * @private\n * @category Type\n * @category List\n * @sig * -> Boolean\n * @param {*} x The object to test.\n * @return {Boolean} `true` if `x` has a numeric length property and extreme indices defined; `false` otherwise.\n * @example\n *\n * _isArrayLike([]); //=> true\n * _isArrayLike(true); //=> false\n * _isArrayLike({}); //=> false\n * _isArrayLike({length: 10}); //=> false\n * _isArrayLike({0: 'zero', 9: 'nine', length: 10}); //=> true\n */\nvar _isArrayLike = /*#__PURE__*/_curry1(function isArrayLike(x) {\n if (_isArray(x)) {\n return true;\n }\n if (!x) {\n return false;\n }\n if (typeof x !== 'object') {\n return false;\n }\n if (_isString(x)) {\n return false;\n }\n if (x.nodeType === 1) {\n return !!x.length;\n }\n if (x.length === 0) {\n return true;\n }\n if (x.length > 0) {\n return x.hasOwnProperty(0) && x.hasOwnProperty(x.length - 1);\n }\n return false;\n});\nexport default _isArrayLike;","export default function _isString(x) {\n return Object.prototype.toString.call(x) === '[object String]';\n}","var XWrap = /*#__PURE__*/function () {\n function XWrap(fn) {\n this.f = fn;\n }\n XWrap.prototype['@@transducer/init'] = function () {\n throw new Error('init not implemented on XWrap');\n };\n XWrap.prototype['@@transducer/result'] = function (acc) {\n return acc;\n };\n XWrap.prototype['@@transducer/step'] = function (acc, x) {\n return this.f(acc, x);\n };\n\n return XWrap;\n}();\n\nexport default function _xwrap(fn) {\n return new XWrap(fn);\n}","import _arity from './internal/_arity.js';\nimport _curry2 from './internal/_curry2.js';\n\n/**\n * Creates a function that is bound to a context.\n * Note: `R.bind` does not provide the additional argument-binding capabilities of\n * [Function.prototype.bind](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind).\n *\n * @func\n * @memberOf R\n * @since v0.6.0\n * @category Function\n * @category Object\n * @sig (* -> *) -> {*} -> (* -> *)\n * @param {Function} fn The function to bind to context\n * @param {Object} thisObj The context to bind `fn` to\n * @return {Function} A function that will execute in the context of `thisObj`.\n * @see R.partial\n * @example\n *\n * const log = R.bind(console.log, console);\n * R.pipe(R.assoc('a', 2), R.tap(log), R.assoc('a', 3))({a: 1}); //=> {a: 3}\n * // logs {a: 2}\n * @symb R.bind(f, o)(a, b) = f.call(o, a, b)\n */\nvar bind = /*#__PURE__*/_curry2(function bind(fn, thisObj) {\n return _arity(fn.length, function () {\n return fn.apply(thisObj, arguments);\n });\n});\nexport default bind;","export default function _arity(n, fn) {\n /* eslint-disable no-unused-vars */\n switch (n) {\n case 0:\n return function () {\n return fn.apply(this, arguments);\n };\n case 1:\n return function (a0) {\n return fn.apply(this, arguments);\n };\n case 2:\n return function (a0, a1) {\n return fn.apply(this, arguments);\n };\n case 3:\n return function (a0, a1, a2) {\n return fn.apply(this, arguments);\n };\n case 4:\n return function (a0, a1, a2, a3) {\n return fn.apply(this, arguments);\n };\n case 5:\n return function (a0, a1, a2, a3, a4) {\n return fn.apply(this, arguments);\n };\n case 6:\n return function (a0, a1, a2, a3, a4, a5) {\n return fn.apply(this, arguments);\n };\n case 7:\n return function (a0, a1, a2, a3, a4, a5, a6) {\n return fn.apply(this, arguments);\n };\n case 8:\n return function (a0, a1, a2, a3, a4, a5, a6, a7) {\n return fn.apply(this, arguments);\n };\n case 9:\n return function (a0, a1, a2, a3, a4, a5, a6, a7, a8) {\n return fn.apply(this, arguments);\n };\n case 10:\n return function (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9) {\n return fn.apply(this, arguments);\n };\n default:\n throw new Error('First argument to _arity must be a non-negative integer no greater than ten');\n }\n}","import _isArrayLike from './_isArrayLike.js';\nimport _xwrap from './_xwrap.js';\nimport bind from '../bind.js';\n\nfunction _arrayReduce(xf, acc, list) {\n var idx = 0;\n var len = list.length;\n while (idx < len) {\n acc = xf['@@transducer/step'](acc, list[idx]);\n if (acc && acc['@@transducer/reduced']) {\n acc = acc['@@transducer/value'];\n break;\n }\n idx += 1;\n }\n return xf['@@transducer/result'](acc);\n}\n\nfunction _iterableReduce(xf, acc, iter) {\n var step = iter.next();\n while (!step.done) {\n acc = xf['@@transducer/step'](acc, step.value);\n if (acc && acc['@@transducer/reduced']) {\n acc = acc['@@transducer/value'];\n break;\n }\n step = iter.next();\n }\n return xf['@@transducer/result'](acc);\n}\n\nfunction _methodReduce(xf, acc, obj, methodName) {\n return xf['@@transducer/result'](obj[methodName](bind(xf['@@transducer/step'], xf), acc));\n}\n\nvar symIterator = typeof Symbol !== 'undefined' ? Symbol.iterator : '@@iterator';\n\nexport default function _reduce(fn, acc, list) {\n if (typeof fn === 'function') {\n fn = _xwrap(fn);\n }\n if (_isArrayLike(list)) {\n return _arrayReduce(fn, acc, list);\n }\n if (typeof list['fantasy-land/reduce'] === 'function') {\n return _methodReduce(fn, acc, list, 'fantasy-land/reduce');\n }\n if (list[symIterator] != null) {\n return _iterableReduce(fn, acc, list[symIterator]());\n }\n if (typeof list.next === 'function') {\n return _iterableReduce(fn, acc, list);\n }\n if (typeof list.reduce === 'function') {\n return _methodReduce(fn, acc, list, 'reduce');\n }\n\n throw new TypeError('reduce: list must be array or iterable');\n}","import _curry3 from './internal/_curry3.js';\nimport _reduce from './internal/_reduce.js';\n\n/**\n * Returns a single item by iterating through the list, successively calling\n * the iterator function and passing it an accumulator value and the current\n * value from the array, and then passing the result to the next call.\n *\n * The iterator function receives two values: *(acc, value)*. It may use\n * [`R.reduced`](#reduced) to shortcut the iteration.\n *\n * The arguments' order of [`reduceRight`](#reduceRight)'s iterator function\n * is *(value, acc)*.\n *\n * Note: `R.reduce` does not skip deleted or unassigned indices (sparse\n * arrays), unlike the native `Array.prototype.reduce` method. For more details\n * on this behavior, see:\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce#Description\n *\n * Dispatches to the `reduce` method of the third argument, if present. When\n * doing so, it is up to the user to handle the [`R.reduced`](#reduced)\n * shortcuting, as this is not implemented by `reduce`.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category List\n * @sig ((a, b) -> a) -> a -> [b] -> a\n * @param {Function} fn The iterator function. Receives two values, the accumulator and the\n * current element from the array.\n * @param {*} acc The accumulator value.\n * @param {Array} list The list to iterate over.\n * @return {*} The final, accumulated value.\n * @see R.reduced, R.addIndex, R.reduceRight\n * @example\n *\n * R.reduce(R.subtract, 0, [1, 2, 3, 4]) // => ((((0 - 1) - 2) - 3) - 4) = -10\n * // - -10\n * // / \\ / \\\n * // - 4 -6 4\n * // / \\ / \\\n * // - 3 ==> -3 3\n * // / \\ / \\\n * // - 2 -1 2\n * // / \\ / \\\n * // 0 1 0 1\n *\n * @symb R.reduce(f, a, [b, c, d]) = f(f(f(a, b), c), d)\n */\nvar reduce = /*#__PURE__*/_curry3(_reduce);\nexport default reduce;","export enum Type {\n Array = \"Array\",\n Boolean = \"Boolean\",\n ConceptUuid = \"ConceptUuid\",\n Number = \"Number\",\n Object = \"Object\",\n String = \"String\",\n UUID = \"UUID\",\n PersonAttributeTypeUuid = \"PersonAttributeTypeUuid\",\n PatientIdentifierTypeUuid = \"PatientIdentifierTypeUuid\",\n}\n\n// Full-powered typing for Config and Schema trees depends on being able to\n// have types like `string not \"_default\"`. There is an experimental PR\n// for this feature, https://github.com/microsoft/TypeScript/pull/29317\n// But it is not likely to be merged any time terribly soon. (Nov 11, 2020)\nexport interface ConfigSchema {\n [key: string]: ConfigSchema | ConfigValue;\n _type?: Type;\n _validators?: Array<Validator>;\n _elements?: ConfigSchema;\n}\n\nexport interface Config {\n [moduleName: string]: { [key: string]: any };\n}\n\nexport interface ConfigObject {\n [key: string]: any;\n \"Display conditions\"?: DisplayConditionsConfigObject;\n \"Translation overrides\"?: Record<string, Record<string, string>>;\n}\n\nexport interface DisplayConditionsConfigObject {\n privileges?: string[];\n}\n\nexport type ConfigValue =\n | string\n | number\n | boolean\n | void\n | Array<any>\n | object;\n\nexport interface ExtensionSlotConfig {\n add?: Array<string>;\n remove?: Array<string>;\n order?: Array<string>;\n configure?: ExtensionSlotConfigureValueObject;\n}\n\nexport interface ExtensionSlotConfigureValueObject {\n [key: string]: object;\n}\n\nexport interface ExtensionSlotConfigObject {\n /** Additional extension IDs to assign to this slot, in addition to those `attach`ed in code. */\n add?: Array<string>;\n /** Extension IDs which were `attach`ed to the slot but which should not be assigned. */\n remove?: Array<string>;\n /** Overrides the default ordering of extensions. */\n order?: Array<string>;\n}\n\nexport type ProvidedConfig = {\n source: string;\n config: Config;\n};\n\nexport type ValidatorFunction = (value: any) => boolean;\n\nexport type Validator = (value: any) => void | string;\n","/** @module @category Config Validation */\nimport { Validator, ValidatorFunction } from \"../types\";\n\n/**\n * Constructs a custom validator.\n *\n * ### Example\n *\n * ```typescript\n * {\n * foo: {\n * _default: 0,\n * _validators: [\n * validator(val => val >= 0, \"Must not be negative.\")\n * ]\n * }\n * }\n * ```\n * @param validationFunction Takes the configured value as input. Returns true\n * if it is valid, false otherwise.\n * @param message A string message that explains why the value is invalid. Can\n * also be a function that takes the value as input and returns a string.\n * @returns A validator ready for use in a config schema\n */\nexport function validator(\n validationFunction: ValidatorFunction,\n message: string | ((value: any) => string)\n): Validator {\n return (value) => {\n if (!validationFunction(value)) {\n if (typeof message === \"function\") {\n return message(value);\n } else {\n return message;\n }\n }\n };\n}\n","import { validator } from \"./validator\";\n\nexport const isArray = validator(\n (val) => Array.isArray(val),\n \"must be an array\"\n);\n\nexport const isBoolean = validator(\n (val) => typeof val === \"boolean\",\n \"must be a boolean\"\n);\n\nexport const isNumber = validator(\n (val) => typeof val === \"number\",\n \"must be a number\"\n);\n\nexport const isString = validator(\n (val) => typeof val === \"string\",\n \"must be a string\"\n);\n\nexport const isObject = validator(\n (val) => typeof val === \"object\" && !Array.isArray(val) && val !== null,\n \"must be an object (not an array or null)\"\n);\n\nexport const isUuid = validator(\n (val) =>\n /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(\n val\n ) || /^[0-9a-f]{36}$/i.test(val),\n \"must be a valid UUID or a 36-character hexadecimal string\"\n);\n","/** @module @category Config */\nimport { createGlobalStore, getGlobalStore } from \"@openmrs/esm-state\";\nimport { omit } from \"ramda\";\nimport {\n Config,\n ConfigObject,\n ConfigSchema,\n ExtensionSlotConfigObject,\n ProvidedConfig,\n} from \"../types\";\n\n/**\n * Internal store\n * A store of the inputs and internal state\n * @internal\n */\nexport interface ConfigInternalStore {\n /** Configs added using the `provide` function */\n providedConfigs: Array<ProvidedConfig>;\n /** An object with module names for keys and schemas for values */\n schemas: Record<string, ConfigSchema>;\n /** Whether to use dev defaults or not */\n}\n\nconst configInternalStoreInitialValue = {\n providedConfigs: [],\n schemas: {},\n};\n\n/**\n * @internal\n */\nexport const configInternalStore = createGlobalStore<ConfigInternalStore>(\n \"config-internal\",\n configInternalStoreInitialValue\n);\n\n/**\n * Temporary config\n * LocalStorage-based config used by the implementer tools\n * @internal\n */\nexport interface TemporaryConfigStore {\n config: Config;\n}\n\n/** @internal */\nexport const temporaryConfigStore = createGlobalStore<TemporaryConfigStore>(\n \"temporary-config\",\n { config: getTemporaryConfig() }\n);\n\ntemporaryConfigStore.subscribe((state) => {\n setTemporaryConfig(state.config);\n});\n\nfunction setTemporaryConfig(value: Config) {\n localStorage.setItem(\"openmrs:temporaryConfig\", JSON.stringify(value));\n}\n\nfunction getTemporaryConfig(): Config {\n try {\n return JSON.parse(localStorage.getItem(\"openmrs:temporaryConfig\") || \"{}\");\n } catch (e) {\n return {};\n }\n}\n\n/**\n * Config-side extension store\n * Just what esm-config needs to know about extension state. This\n * is to avoid having esm-config depend on esm-extensions, which would\n * create a circular dependency.\n * @internal\n */\nexport interface ConfigExtensionStore {\n mountedExtensions: Array<ConfigExtensionStoreElement>;\n}\n\n/** @internal */\nexport interface ConfigExtensionStoreElement {\n slotModuleName: string;\n extensionModuleName: string;\n slotName: string;\n extensionId: string;\n}\n\n/** @internal */\nexport const configExtensionStore = createGlobalStore<ConfigExtensionStore>(\n \"config-store-of-extension-state\",\n { mountedExtensions: [] }\n);\n\n/**\n * Output configs\n *\n * Each module has its own stores for its config and its extension slots' configs.\n * @internal\n */\nexport interface ConfigStore {\n config: ConfigObject | null;\n loaded: boolean;\n}\n\nfunction initializeConfigStore() {\n return {\n config: null,\n loaded: false,\n };\n}\n\n/** @internal */\nexport function getConfigStore(moduleName: string) {\n // We use a store for each module's config, named `config-${moduleName}`\n return getGlobalStore<ConfigStore>(\n `config-module-${moduleName}`,\n initializeConfigStore()\n );\n}\n\n/**\n * Configuration for all the specific extension slots\n * @internal\n */\nexport interface ExtensionSlotsConfigStore {\n slots: {\n [slotName: string]: {\n config: ExtensionSlotConfigObject;\n loaded: boolean;\n };\n };\n}\n\n/** @internal */\nexport function getExtensionSlotsConfigStore() {\n return getGlobalStore<ExtensionSlotsConfigStore>(`config-extension-slots`, {\n slots: {},\n });\n}\n\n/** @internal */\nexport function getExtensionSlotConfig(slotName: string) {\n return getExtensionSlotConfigFromStore(\n getExtensionSlotsConfigStore().getState(),\n slotName\n );\n}\n\n/** @internal */\nexport function getExtensionSlotConfigFromStore(\n state: ExtensionSlotsConfigStore,\n slotName: string\n) {\n const slotConfig = state.slots[slotName];\n return slotConfig ?? { loaded: false, config: {} };\n}\n\n/** @internal */\nexport interface ExtensionsConfigStore {\n configs: {\n [slotName: string]: {\n [extensionId: string]: ConfigStore;\n };\n };\n}\n\n/**\n * One store for all the extensions\n * @internal\n */\nexport function getExtensionsConfigStore() {\n return getGlobalStore<ExtensionsConfigStore>(`config-extensions`, {\n configs: {},\n });\n}\n\n/** @internal */\nexport function getExtensionConfig(slotName: string, extensionId: string) {\n const extensionConfig = Object.assign(\n {},\n getExtensionConfigFromStore(\n getExtensionsConfigStore().getState(),\n slotName,\n extensionId\n )\n );\n extensionConfig.config = omit(\n [\"Display conditions\", \"Translation overrides\"],\n extensionConfig.config\n );\n return extensionConfig;\n}\n\n/** @internal */\nexport function getExtensionConfigFromStore(\n state: ExtensionsConfigStore,\n slotName: string,\n extensionId: string\n) {\n const extensionConfig = state.configs[slotName]?.[extensionId];\n return extensionConfig ?? { loaded: false, config: null };\n}\n\n/**\n * A store of the implementer tools output config\n * @internal\n */\nexport interface ImplementerToolsConfigStore {\n config: Config;\n}\n\n/** @internal */\nexport const implementerToolsConfigStore =\n createGlobalStore<ImplementerToolsConfigStore>(\"config-implementer-tools\", {\n config: {},\n });\n","/** @module @category Config */\nimport { clone, reduce, mergeDeepRight, equals, omit } from \"ramda\";\nimport {\n Config,\n ConfigObject,\n ConfigSchema,\n ExtensionSlotConfig,\n ExtensionSlotConfigObject,\n Type,\n} from \"../types\";\nimport {\n isArray,\n isBoolean,\n isUuid,\n isNumber,\n isObject,\n isString,\n} from \"../validators/type-validators\";\nimport {\n ConfigExtensionStore,\n ConfigInternalStore,\n configInternalStore,\n ConfigStore,\n configExtensionStore,\n getConfigStore,\n getExtensionsConfigStore,\n implementerToolsConfigStore,\n temporaryConfigStore,\n getExtensionSlotsConfigStore,\n} from \"./state\";\nimport type {} from \"@openmrs/esm-globals\";\nimport { TemporaryConfigStore } from \"..\";\n\n/**\n * Store setup\n *\n *\n * Set up stores and subscriptions so that inputs get processed appropriately.\n *\n * There are *input* stores and *output* stores. The *input* stores\n * are configInternalStore, temporaryConfigStore, and configExtensionStore. The\n * output stores are set in the `compute...` functions. They are the module\n * config stores, the extension slot config stores (by module), the extension\n * config stores, and the implementer tools config store.\n *\n * This code sets up the subscriptions so that when an input store changes,\n * the correct set of output stores are updated.\n *\n * All `compute...` functions except `computeExtensionConfigs` are pure\n * (or are supposed to be), other than the fact that they all `setState`\n * store values at the end. `computeExtensionConfigs` calls `getGlobalStore`,\n * which creates stores.\n */\ncomputeModuleConfig(\n configInternalStore.getState(),\n temporaryConfigStore.getState()\n);\nconfigInternalStore.subscribe((configState) =>\n computeModuleConfig(configState, temporaryConfigStore.getState())\n);\ntemporaryConfigStore.subscribe((tempConfigState) =>\n computeModuleConfig(configInternalStore.getState(), tempConfigState)\n);\n\ncomputeImplementerToolsConfig(\n configInternalStore.getState(),\n temporaryConfigStore.getState()\n);\nconfigInternalStore.subscribe((configState) =>\n computeImplementerToolsConfig(configState, temporaryConfigStore.getState())\n);\ntemporaryConfigStore.subscribe((tempConfigState) =>\n computeImplementerToolsConfig(configInternalStore.getState(), tempConfigState)\n);\n\ncomputeExtensionSlotConfigs(\n configInternalStore.getState(),\n temporaryConfigStore.getState()\n);\nconfigInternalStore.subscribe((configState) =>\n computeExtensionSlotConfigs(configState, temporaryConfigStore.getState())\n);\ntemporaryConfigStore.subscribe((tempConfigState) =>\n computeExtensionSlotConfigs(configInternalStore.getState(), tempConfigState)\n);\n\ncomputeExtensionConfigs(\n configInternalStore.getState(),\n configExtensionStore.getState(),\n temporaryConfigStore.getState()\n);\nconfigInternalStore.subscribe((configState) => {\n computeExtensionConfigs(\n configState,\n configExtensionStore.getState(),\n temporaryConfigStore.getState()\n );\n});\nconfigExtensionStore.subscribe((extensionState) => {\n computeExtensionConfigs(\n configInternalStore.getState(),\n extensionState,\n temporaryConfigStore.getState()\n );\n});\ntemporaryConfigStore.subscribe((tempConfigState) => {\n computeExtensionConfigs(\n configInternalStore.getState(),\n configExtensionStore.getState(),\n tempConfigState\n );\n});\n\nfunction computeModuleConfig(\n state: ConfigInternalStore,\n tempState: TemporaryConfigStore\n) {\n for (let moduleName of Object.keys(state.schemas)) {\n const config = getConfigForModule(moduleName, state, tempState);\n const moduleStore = getConfigStore(moduleName);\n moduleStore.setState({ loaded: true, config });\n }\n}\n\nfunction computeExtensionSlotConfigs(\n state: ConfigInternalStore,\n tempState: TemporaryConfigStore\n) {\n const slotConfigs = getExtensionSlotConfigs(state, tempState);\n const newSlotStoreEntries = Object.fromEntries(\n Object.entries(slotConfigs).map(([slotName, config]) => [\n slotName,\n { loaded: true, config },\n ])\n );\n const slotStore = getExtensionSlotsConfigStore();\n const oldState = slotStore.getState();\n const newState = { slots: { ...oldState.slots, ...newSlotStoreEntries } };\n if (!equals(oldState, newState)) {\n slotStore.setState(newState);\n }\n}\n\nfunction computeImplementerToolsConfig(\n state: ConfigInternalStore,\n tempConfigState: TemporaryConfigStore\n) {\n const config = getImplementerToolsConfig(state, tempConfigState);\n implementerToolsConfigStore.setState({ config });\n}\n\nfunction computeExtensionConfigs(\n configState: ConfigInternalStore,\n extensionState: ConfigExtensionStore,\n tempConfigState: TemporaryConfigStore\n) {\n const configs = {};\n for (let extension of extensionState.mountedExtensions) {\n const config = computeExtensionConfig(\n extension.slotModuleName,\n extension.extensionModuleName,\n extension.slotName,\n extension.extensionId,\n configState,\n tempConfigState\n );\n configs[extension.slotName] = {\n ...configs[extension.slotName],\n [extension.extensionId]: { config, loaded: true },\n };\n }\n getExtensionsConfigStore().setState({ configs });\n}\n\n/*\n * API\n *\n */\n\n/**\n * This defines a configuration schema for a module. The schema tells the\n * configuration system how the module can be configured. It specifies\n * what makes configuration valid or invalid.\n *\n * See [Configuration System](http://o3-dev.docs.openmrs.org/#/main/config)\n * for more information about defining a config schema.\n *\n * @param moduleName Name of the module the schema is being defined for. Generally\n * should be the one in which the `defineConfigSchema` call takes place.\n * @param schema The config schema for the module\n */\nexport function defineConfigSchema(moduleName: string, schema: ConfigSchema) {\n validateConfigSchema(moduleName, schema);\n const enhancedSchema = mergeDeepRight(\n schema,\n implicitConfigSchema\n ) as ConfigSchema;\n\n const state = configInternalStore.getState();\n configInternalStore.setState({\n schemas: { ...state.schemas, [moduleName]: enhancedSchema },\n });\n}\n\n/**\n * This defines a configuration schema for an extension. When a schema is defined\n * for an extension, that extension will receive the configuration corresponding\n * to that schema, rather than the configuration corresponding to the module\n * in which it is defined.\n *\n * The schema tells the configuration system how the module can be configured.\n * It specifies what makes configuration valid or invalid.\n *\n * See [Configuration System](http://o3-dev.docs.openmrs.org/#/main/config)\n * for more information about defining a config schema.\n *\n * @param extensionName Name of the extension the schema is being defined for.\n * Should match the `name` of one of the `extensions` entries being returned\n * by `setupOpenMRS`.\n * @param schema The config schema for the extension\n */\nexport function defineExtensionConfigSchema(\n extensionName: string,\n schema: ConfigSchema\n) {\n validateConfigSchema(extensionName, schema);\n const enhancedSchema = mergeDeepRight(\n schema,\n implicitConfigSchema\n ) as ConfigSchema;\n\n const state = configInternalStore.getState();\n if (state.schemas[extensionName]) {\n console.warn(\n `Config schema for extension ${extensionName} already exists. If there are multiple extensions with this same name, one will probably crash.`\n );\n }\n\n configInternalStore.setState({\n schemas: { ...state.schemas, [extensionName]: enhancedSchema },\n });\n}\n\nexport function provide(config: Config, sourceName = \"provided\") {\n const state = configInternalStore.getState();\n configInternalStore.setState({\n providedConfigs: [...state.providedConfigs, { source: sourceName, config }],\n });\n}\n\n/**\n * A promise-based way to access the config as soon as it is fully loaded.\n * If it is already loaded, resolves the config in its present state.\n *\n * This is a useful function if you need to get the config in the course\n * of the execution of a function.\n *\n * @param moduleName The name of the module for which to look up the config\n */\nexport function getConfig(moduleName: string): Promise<Config> {\n return new Promise<Config>((resolve) => {\n const store = getConfigStore(moduleName);\n function update(state: ConfigStore) {\n if (state.loaded && state.config) {\n const config = omit(\n [\"Display conditions\", \"Translation overrides\"],\n state.config\n );\n resolve(config);\n unsubscribe && unsubscribe();\n }\n }\n update(store.getState());\n const unsubscribe = store.subscribe(update);\n });\n}\n\n/** @internal */\nexport function getConfigInternal(moduleName: string): Promise<Config> {\n return new Promise<Config>((resolve) => {\n const store = getConfigStore(moduleName);\n function update(state: ConfigStore) {\n if (state.loaded && state.config) {\n const config = state.config;\n resolve(config);\n unsubscribe && unsubscribe();\n }\n }\n update(store.getState());\n const unsubscribe = store.subscribe(update);\n });\n}\n\n/**\n * Validate and interpolate defaults for `providedConfig` according to `schema`\n *\n * @param schema a configuration schema\n * @param providedConfig an object of config values (without the top-level module name)\n * @param keyPathContext a dot-deparated string which helps the user figure out where\n * the provided config came from\n * @internal\n */\nexport function processConfig(\n schema: ConfigSchema,\n providedConfig: ConfigObject,\n keyPathContext: string\n) {\n validateStructure(schema, providedConfig, keyPathContext);\n const config = setDefaults(schema, providedConfig);\n runAllValidatorsInConfigTree(schema, config, keyPathContext);\n return config;\n}\n\n/*\n * Helper functions\n *\n */\n\n/**\n * Returns the configuration for an extension. This configuration is specific\n * to the slot in which it is mounted, and its ID within that slot.\n *\n * The schema for that configuration is the extension schema. If no extension\n * schema has been provided, the schema used is the schema of the module in\n * which the extension is defined.\n *\n * @param slotModuleName The name of the module which defines the extension slot\n * @param extensionModuleName The name of the module which defines the extension (and therefore the config schema)\n * @param slotName The name of the extension slot where the extension is mounted\n * @param extensionId The ID of the extension in its slot\n */\nfunction computeExtensionConfig(\n slotModuleName: string,\n extensionModuleName: string,\n slotName: string,\n extensionId: string,\n configState: ConfigInternalStore,\n tempConfigState: TemporaryConfigStore\n) {\n const extensionName = getExtensionNameFromId(extensionId);\n const extensionConfigSchema = configState.schemas[extensionName];\n const nameOfSchemaSource = extensionConfigSchema\n ? extensionName\n : extensionModuleName;\n const providedConfigs = getProvidedConfigs(configState, tempConfigState);\n const slotModuleConfig = mergeConfigsFor(slotModuleName, providedConfigs);\n const configOverride =\n slotModuleConfig?.extensionSlots?.[slotName]?.configure?.[extensionId] ??\n {};\n const extensionConfig = mergeConfigsFor(nameOfSchemaSource, providedConfigs);\n const combinedConfig = mergeConfigs([extensionConfig, configOverride]);\n // TODO: validate that a schema exists for the module\n const schema =\n extensionConfigSchema ?? configState.schemas[extensionModuleName];\n validateStructure(schema, combinedConfig, nameOfSchemaSource);\n const config = setDefaults(schema, combinedConfig);\n runAllValidatorsInConfigTree(schema, config, nameOfSchemaSource);\n delete config.extensionSlots;\n return config;\n}\n\nfunction getImplementerToolsConfig(\n configState: ConfigInternalStore,\n tempConfigState: TemporaryConfigStore\n): Record<string, Config> {\n let result = getSchemaWithValuesAndSources(clone(configState.schemas));\n const configsAndSources = [\n ...configState.providedConfigs.map((c) => [c.config, c.source]),\n [tempConfigState.config, \"temporary config\"],\n ] as Array<[Config, string]>;\n for (let [config, source] of configsAndSources) {\n result = mergeConfigs([result, createValuesAndSourcesTree(config, source)]);\n }\n return result;\n}\n\nfunction getSchemaWithValuesAndSources(schema) {\n if (schema.hasOwnProperty(\"_default\")) {\n return { ...schema, _value: schema._default, _source: \"default\" };\n } else if (isOrdinaryObject(schema)) {\n return Object.keys(schema).reduce((obj, key) => {\n obj[key] = getSchemaWithValuesAndSources(schema[key]);\n return obj;\n }, {});\n } else {\n // at this point, the schema is bad and an error will have been logged during schema validation\n return {};\n }\n}\n\nfunction createValuesAndSourcesTree(config: ConfigObject, source: string) {\n if (isOrdinaryObject(config)) {\n return Object.keys(config).reduce((obj, key) => {\n obj[key] = createValuesAndSourcesTree(config[key], source);\n return obj;\n }, {});\n } else {\n return { _value: config, _source: source };\n }\n}\n\nfunction getExtensionSlotConfigs(\n configState: ConfigInternalStore,\n tempConfigState: TemporaryConfigStore\n): Record<string, ExtensionSlotConfigObject> {\n const allConfigs = mergeConfigs(\n getProvidedConfigs(configState, tempConfigState)\n );\n const slotConfigPerModule: Record<\n string,\n Record<string, ExtensionSlotConfig>\n > = Object.keys(allConfigs).reduce((obj, key) => {\n if (allConfigs[key]?.extensionSlots) {\n obj[key] = allConfigs[key]?.extensionSlots;\n }\n return obj;\n }, {});\n validateAllExtensionSlotConfigs(slotConfigPerModule);\n const slotConfigs = Object.keys(slotConfigPerModule).reduce((obj, key) => {\n obj = { ...obj, ...slotConfigPerModule[key] };\n return obj;\n }, {});\n return slotConfigs;\n}\n\nfunction validateAllExtensionSlotConfigs(\n slotConfigPerModule: Record<string, Record<string, ExtensionSlotConfig>>\n) {\n for (let [moduleName, configBySlotName] of Object.entries(\n slotConfigPerModule\n )) {\n for (let [slotName, config] of Object.entries(configBySlotName)) {\n validateExtensionSlotConfig(config, moduleName, slotName);\n }\n }\n}\n\nfunction validateExtensionSlotConfig(\n config: ExtensionSlotConfig,\n moduleName: string,\n slotName: string\n): void {\n const errorPrefix = `Extension slot config '${moduleName}.extensionSlots.${slotName}`;\n const invalidKeys = Object.keys(config).filter(\n (k) => ![\"add\", \"remove\", \"order\", \"configure\"].includes(k)\n );\n if (invalidKeys.length) {\n console.error(\n errorPrefix + `' contains invalid keys '${invalidKeys.join(\"', '\")}'`\n );\n }\n if (config.add) {\n if (\n !Array.isArray(config.add) ||\n !config.add.every((n) => typeof n === \"string\")\n ) {\n console.error(\n errorPrefix +\n `.add' is invalid. Must be an array of strings (extension IDs)`\n );\n }\n }\n if (config.remove) {\n if (\n !Array.isArray(config.remove) ||\n !config.remove.every((n) => typeof n === \"string\")\n ) {\n console.error(\n errorPrefix +\n `.remove' is invalid. Must be an array of strings (extension IDs)`\n );\n }\n }\n if (config.order) {\n if (\n !Array.isArray(config.order) ||\n !config.order.every((n) => typeof n === \"string\")\n ) {\n console.error(\n errorPrefix +\n `.order' is invalid. Must be an array of strings (extension IDs)`\n );\n }\n }\n if (config.configure) {\n if (!isOrdinaryObject(config.configure)) {\n console.error(\n errorPrefix +\n `.configure' is invalid. Must be an object with extension IDs for keys`\n );\n }\n }\n}\n\nfunction getProvidedConfigs(\n configState: ConfigInternalStore,\n tempConfigState: TemporaryConfigStore\n): Array<Config> {\n return [\n ...configState.providedConfigs.map((c) => c.config),\n tempConfigState.config,\n ];\n}\n\nfunction validateConfigSchema(\n moduleName: string,\n schema: ConfigSchema,\n keyPath = \"\"\n) {\n const updateMessage = `Please verify that you are running the latest version and, if so, alert the maintainer.`;\n\n for (const key of Object.keys(schema).filter((k) => !k.startsWith(\"_\"))) {\n const thisKeyPath = keyPath + (keyPath && \".\") + key;\n const schemaPart = schema[key] as ConfigSchema;\n\n if (thisKeyPath === \"Display conditions\") {\n console.error(\n `${moduleName} declares a configuration option called \"Display conditions\"; the \"Display conditions\" option is a reserved name. ${updateMessage}`\n );\n }\n\n if (thisKeyPath === \"Translation overrides\") {\n console.error(\n `${moduleName} declares a configuration option called \"Translation overrides\"; the \"Translation overrides\" option is a reserved name. ${updateMessage}`\n );\n }\n\n if (!isOrdinaryObject(schemaPart)) {\n console.error(\n `${moduleName} has bad config schema definition for key '${thisKeyPath}'. ${updateMessage}`\n );\n continue;\n }\n\n if (!schemaPart.hasOwnProperty(\"_default\")) {\n // recurse for nested config keys\n validateConfigSchema(moduleName, schemaPart, thisKeyPath);\n }\n\n const elements = schemaPart._elements;\n if (hasObjectSchema(elements)) {\n validateConfigSchema(moduleName, elements, thisKeyPath + \"._elements\");\n }\n\n if (schemaPart._validators) {\n for (let validator of schemaPart._validators) {\n if (typeof validator !== \"function\") {\n console.error(\n `${moduleName} has invalid validator for key '${thisKeyPath}' ${updateMessage}.` +\n `\\n\\nIf you're the maintainer: validators must be functions that return either ` +\n `undefined or an error string. Received ${validator}.`\n );\n }\n }\n }\n\n const valueType = schemaPart._type;\n if (valueType && !Object.values(Type).includes(valueType)) {\n console.error(\n `${moduleName} has invalid type for key '${thisKeyPath}' ${updateMessage}.` +\n `\\n\\nIf you're the maintainer: the allowed types are ${Object.values(\n Type\n ).join(\", \")}. ` +\n `Received '${valueType}'`\n );\n }\n\n if (\n Object.keys(schemaPart).every((k) =>\n [\"_description\", \"_validators\", \"_elements\", \"_type\"].includes(k)\n ) &&\n !keyPath.includes(\"._elements\")\n ) {\n console.error(\n `${moduleName} has bad config schema definition for key '${thisKeyPath}'. ${updateMessage}.` +\n `\\n\\nIf you're the maintainer: all config elements must have a default. ` +\n `Received ${JSON.stringify(schemaPart)}`\n );\n }\n\n if (\n elements &&\n valueType &&\n ![Type.Array, Type.Object].includes(valueType)\n ) {\n console.error(\n `${moduleName} has bad config schema definition for key '${thisKeyPath}'. ${updateMessage}.` +\n `\\n\\nIf you're the maintainer: the 'elements' key only works with '_type' equal to 'Array' or 'Object'. ` +\n `Received ${JSON.stringify(valueType)}`\n );\n }\n }\n}\n\nfunction getConfigForModule(\n moduleName: string,\n configState: ConfigInternalStore,\n tempConfigState: TemporaryConfigStore\n): ConfigObject {\n if (!configState.schemas.hasOwnProperty(moduleName)) {\n throw Error(\"No config schema has been defined for \" + moduleName);\n }\n\n const schema = configState.schemas[moduleName];\n const inputConfig = mergeConfigsFor(\n moduleName,\n getProvidedConfigs(configState, tempConfigState)\n );\n validateStructure(schema, inputConfig, moduleName);\n const config = setDefaults(schema, inputConfig);\n runAllValidatorsInConfigTree(schema, config, moduleName);\n delete config.extensionSlots;\n return config;\n}\n\nfunction mergeConfigsFor(\n moduleName: string,\n allConfigs: Array<Config>\n): ConfigObject {\n const allConfigsForModule = allConfigs\n .map(({ [moduleName]: c }) => c)\n .filter((c) => !!c);\n\n return mergeConfigs(allConfigsForModule);\n}\n\nfunction mergeConfigs(configs: Array<Config>) {\n const mergeDeepAll = reduce(mergeDeepRight);\n return mergeDeepAll({}, configs) as Config;\n}\n\n/**\n * Recursively check the provided config tree to make sure that all\n * of the provided properties exist in the schema, and that types are\n * correct. Does not run validators yet, since those will be run on\n * the config with the defaults filled in.\n */\nfunction validateStructure(\n schema: ConfigSchema,\n config: ConfigObject,\n keyPath = \"\"\n) {\n // validate each constituent element\n for (const key of Object.keys(config)) {\n const value = config[key];\n const thisKeyPath = keyPath + \".\" + key;\n const schemaPart = schema[key] as ConfigSchema;\n\n if (!schema.hasOwnProperty(key)) {\n if (!(key === \"extensionSlots\" && keyPath !== \"\")) {\n console.error(\n `Unknown config key '${thisKeyPath}' provided. Ignoring.`\n );\n }\n\n continue;\n }\n\n validateBranchStructure(schemaPart, value, thisKeyPath);\n }\n}\n\nfunction validateBranchStructure(\n schemaPart: ConfigSchema,\n value: any,\n keyPath: string\n) {\n checkType(keyPath, schemaPart._type, value);\n\n if (isOrdinaryObject(value)) {\n // structurally validate only if there's elements specified\n // or there's no `_default` value (which would indicate a freeform object)\n if (schemaPart._type === Type.Object) {\n validateDictionaryStructure(schemaPart, value, keyPath);\n } else if (!schemaPart.hasOwnProperty(\"_default\")) {\n // recurse to validate nested object structure\n validateStructure(schemaPart, value, keyPath);\n }\n } else {\n if (schemaPart._type === Type.Array) {\n validateArrayStructure(schemaPart, value, keyPath);\n }\n }\n}\n\nfunction validateDictionaryStructure(\n dictionarySchema: ConfigSchema,\n config: ConfigObject,\n keyPath: string\n) {\n if (dictionarySchema._elements) {\n for (const key of Object.keys(config)) {\n const value = config[key];\n validateStructure(dictionarySchema._elements, value, `${keyPath}.${key}`);\n }\n }\n}\n\nfunction validateArrayStructure(\n arraySchema: ConfigSchema,\n value: ConfigObject,\n keyPath: string\n) {\n // if there is an array element object schema, verify that elements match it\n if (hasObjectSchema(arraySchema._elements)) {\n for (let i = 0; i < value.length; i++) {\n validateBranchStructure(\n arraySchema._elements,\n value[i],\n `${keyPath}[${i}]`\n );\n }\n }\n\n for (let i = 0; i < value.length; i++) {\n checkType(`${keyPath}[${i}]`, arraySchema._elements?._type, value[i]);\n }\n}\n\n/**\n * Run all the validators in the config tree. This should be run\n * on the config object after it has been filled in with all the defaults, since\n * higher-level validators may refer to default values.\n */\nfunction runAllValidatorsInConfigTree(\n schema: ConfigSchema,\n config: ConfigObject,\n keyPath = \"\"\n) {\n // If `!schema`, there should have been a structural validation error printed already.\n if (schema) {\n if (config !== schema._default) {\n runValidators(keyPath, schema._validators, config);\n }\n\n if (isOrdinaryObject(config)) {\n for (const key of Object.keys(config)) {\n const value = config[key];\n const thisKeyPath = keyPath + \".\" + key;\n const schemaPart = schema[key] as ConfigSchema;\n if (schema._type === Type.Object && schema._elements) {\n runAllValidatorsInConfigTree(schema._elements, value, thisKeyPath);\n } else {\n runAllValidatorsInConfigTree(schemaPart, value, thisKeyPath);\n }\n }\n } else if (Array.isArray(config) && schema._elements) {\n for (let i = 0; i < config.length; i++) {\n runAllValidatorsInConfigTree(\n schema._elements,\n config[i],\n `${keyPath}[${i}]`\n );\n }\n }\n }\n}\n\nfunction checkType(keyPath: string, _type: Type | undefined, value: any) {\n if (_type) {\n const validator: Record<string, Function> = {\n Array: isArray,\n Boolean: isBoolean,\n ConceptUuid: isUuid,\n Number: isNumber,\n Object: isObject,\n String: isString,\n UUID: isUuid,\n PersonAttributeTypeUuid: isUuid,\n PatientIdentifierTypeUuid: isUuid,\n };\n runValidators(keyPath, [validator[_type]], value);\n }\n}\n\nfunction runValidators(\n keyPath: string,\n validators: Array<Function> | undefined,\n value: any\n) {\n if (validators) {\n try {\n for (let validator of validators) {\n const validatorResult = validator(value);\n\n if (typeof validatorResult === \"string\") {\n if (typeof value === \"object\") {\n console.error(\n `Invalid configuration for ${keyPath}: ${validatorResult}`\n );\n } else {\n console.error(\n `Invalid configuration value ${value} for ${keyPath}: ${validatorResult}`\n );\n }\n }\n }\n } catch (e) {\n console.error(\n `Skipping invalid validator at \"${keyPath}\". Encountered error\\n\\t${e}`\n );\n }\n }\n}\n\n// Recursively fill in the config with values from the schema.\nconst setDefaults = (schema: ConfigSchema, inputConfig: Config) => {\n const config = clone(inputConfig);\n\n if (!schema) {\n return config;\n }\n\n for (const key of Object.keys(schema)) {\n const configPart = config[key];\n const schemaPart = schema[key] as ConfigSchema;\n\n // The `schemaPart &&` clause of this `if` statement will only fail\n // if the schema is very invalid. It is there to prevent the app from\n // crashing completely, though it will produce unexpected behavior.\n // If this happens, there should be legible errors in the console from\n // the schema validator.\n if (schemaPart && schemaPart.hasOwnProperty(\"_default\")) {\n // We assume that schemaPart defines a config value, since it has\n // a property `_default`.\n if (!config.hasOwnProperty(key)) {\n (config[key] as any) = schemaPart[\"_default\"];\n }\n\n // We also check if it is an object or array with object elements, in which case we recurse\n const elements = schemaPart._elements;\n\n if (configPart && hasObjectSchema(elements)) {\n if (schemaPart._type === Type.Array && Array.isArray(configPart)) {\n const configWithDefaults = configPart.map((conf: Config) =>\n setDefaults(elements, conf)\n );\n config[key] = configWithDefaults;\n } else if (schemaPart._type === Type.Object) {\n for (let objectKey of Object.keys(configPart)) {\n configPart[objectKey] = setDefaults(\n elements,\n configPart[objectKey]\n );\n }\n }\n }\n } else if (isOrdinaryObject(schemaPart)) {\n // Since schemaPart has no property \"_default\", if it's an ordinary object\n // (unlike, importantly, the validators array), we assume it is a parent config property.\n // We recurse to config[key] and schema[key]. Default config[key] to {}.\n const selectedConfigPart = config.hasOwnProperty(key) ? configPart : {};\n\n if (isOrdinaryObject(selectedConfigPart)) {\n config[key] = setDefaults(schemaPart, selectedConfigPart);\n }\n }\n }\n\n return config;\n};\n\nfunction hasObjectSchema(\n elementsSchema: Object | undefined\n): elementsSchema is ConfigSchema {\n return (\n !!elementsSchema &&\n Object.keys(elementsSchema).filter(\n (e) => ![\"_default\", \"_validators\"].includes(e)\n ).length > 0\n );\n}\n\nfunction isOrdinaryObject(value) {\n return typeof value === \"object\" && !Array.isArray(value) && value !== null;\n}\n\n/**\n * Copied over from esm-extensions. It rightly belongs to that module, but esm-config\n * cannot depend on esm-extensions.\n */\nfunction getExtensionNameFromId(extensionId: string) {\n const [extensionName] = extensionId.split(\"#\");\n return extensionName;\n}\n\n/**\n * The implicitConfigSchema is implicitly included in every configuration schema\n */\nconst implicitConfigSchema: ConfigSchema = {\n \"Display conditions\": {\n privileges: {\n _description: \"The privilege(s) the user must have to use this extension\",\n _type: Type.Array,\n _default: [],\n },\n },\n \"Translation overrides\": {\n _description:\n \"Per-language overrides for frontend translations should be keyed by language code and each language dictionary contains the translation key and the display value\",\n _type: Type.Object,\n _default: {},\n },\n};\n","/** @module @category Navigation */\n\nfunction trimTrailingSlash(str: string) {\n return str.replace(/\\/$/, \"\");\n}\n\n/**\n * Interpolates a string with openmrsBase and openmrsSpaBase.\n *\n * Useful for accepting `${openmrsBase}` or `${openmrsSpaBase}`plus additional template\n * parameters in configurable URLs.\n *\n * Example usage:\n * ```js\n * interpolateUrl(\"test ${openmrsBase} ${openmrsSpaBase} ok\");\n * // will return \"test /openmrs /openmrs/spa ok\"\n *\n * interpolateUrl(\"${openmrsSpaBase}/patient/${patientUuid}\", {\n * patientUuid: \"4fcb7185-c6c9-450f-8828-ccae9436bd82\",\n * }); // will return \"/openmrs/spa/patient/4fcb7185-c6c9-450f-8828-ccae9436bd82\"\n * ```\n *\n * This can be used in conjunction with the `navigate` function like so\n * ```js\n * navigate({\n * to: interpolateUrl(\n * \"${openmrsSpaBase}/patient/${patientUuid}\",\n * { patientUuid: patient.uuid }\n * )\n * }); // will navigate to \"/openmrs/spa/patient/4fcb7185-c6c9-450f-8828-ccae9436bd82\"\n * ```\n *\n * @param template A string to interpolate\n * @param additionalParams Additional values to interpolate into the string template\n */\nexport function interpolateUrl(\n template: string,\n additionalParams?: { [key: string]: string }\n): string {\n const openmrsSpaBase = trimTrailingSlash(window.getOpenmrsSpaBase());\n return interpolateString(template, {\n openmrsBase: window.openmrsBase,\n openmrsSpaBase: openmrsSpaBase,\n ...additionalParams,\n }).replace(/^\\/\\//, \"/\"); // remove extra initial slash if present\n}\n\n/**\n * Interpolates values of `params` into the `template` string.\n *\n * Example usage:\n * ```js\n * interpolateString(\"test ${one} ${two} 3\", {\n * one: \"1\",\n * two: \"2\",\n * }); // will return \"test 1 2 3\"\n * interpolateString(\"test ok\", { one: \"1\", two: \"2\" }) // will return \"test ok\"\n * ```\n *\n * @param template With optional params wrapped in `${ }`\n * @param params Values to interpolate into the string template\n */\nexport function interpolateString(\n template: string,\n params: { [key: string]: string }\n): string {\n const names = Object.keys(params);\n return names.reduce(\n (prev, curr) => prev.split(\"${\" + curr + \"}\").join(params[curr]),\n template\n );\n}\n","/** @module @category Navigation */\nimport { navigateToUrl } from \"single-spa\";\nimport { interpolateUrl } from \"./interpolate-string\";\nimport type {} from \"@openmrs/esm-globals\";\n\nfunction trimTrailingSlash(str: string) {\n return str.replace(/\\/$/, \"\");\n}\n\nexport type TemplateParams = { [key: string]: string };\n\nexport interface NavigateOptions {\n to: string;\n templateParams?: TemplateParams;\n}\n\n/**\n * Calls `location.assign` for non-SPA paths and [navigateToUrl](https://single-spa.js.org/docs/api/#navigatetourl) for SPA paths\n *\n * #### Example usage:\n * ```js\n * @example\n * const config = useConfig();\n * const submitHandler = () => {\n * navigate({ to: config.links.submitSuccess });\n * };\n * ```\n * #### Example return values:\n * ```js\n * @example\n * navigate({ to: \"/some/path\" }); // => window.location.assign(\"/some/path\")\n * navigate({ to: \"https://single-spa.js.org/\" }); // => window.location.assign(\"https://single-spa.js.org/\")\n * navigate({ to: \"${openmrsBase}/some/path\" }); // => window.location.assign(\"/openmrs/some/path\")\n * navigate({ to: \"/openmrs/spa/foo/page\" }); // => navigateToUrl(\"/openmrs/spa/foo/page\")\n * navigate({ to: \"${openmrsSpaBase}/bar/page\" }); // => navigateToUrl(\"/openmrs/spa/bar/page\")\n * navigate({ to: \"/${openmrsSpaBase}/baz/page\" }) // => navigateToUrl(\"/openmrs/spa/baz/page\")\n * ```\n *\n * @param to The target path or URL. Supports templating with 'openmrsBase', 'openmrsSpaBase',\n * and any additional template parameters defined in `templateParams`.\n * For example, `${openmrsSpaBase}/home` will resolve to `/openmrs/spa/home`\n * for implementations using the standard OpenMRS and SPA base paths.\n * If `templateParams` contains `{ foo: \"bar\" }`, then the URL `${openmrsBase}/${foo}`\n * will become `/openmrs/bar`.\n */\nexport function navigate({ to, templateParams }: NavigateOptions): void {\n const openmrsSpaBase = trimTrailingSlash(window.getOpenmrsSpaBase());\n const target = interpolateUrl(to, templateParams);\n const isSpaPath = target.startsWith(openmrsSpaBase);\n\n if (isSpaPath) {\n navigateToUrl(target);\n } else {\n window.location.assign(target);\n }\n}\n","/** @module @category Config Validation */\nimport { validator } from \"./validator\";\n\n/**\n * Verifies that the value is between the provided minimum and maximum\n *\n * @param min Minimum acceptable value\n * @param max Maximum acceptable value\n */\nexport const inRange = (min: number, max: number) => {\n return validator(\n (val) => min <= val && val <= max,\n `must be between ${min} and ${max}`\n );\n};\n\n/**\n * Verifies that a string contains only the default URL template\n * parameters, plus any specified in `allowedTemplateParameters`.\n *\n * @param allowedTemplateParameters To be added to `openmrsBase` and `openmrsSpaBase`\n * @category Navigation\n */\nexport const isUrlWithTemplateParameters = (\n allowedTemplateParameters: string[]\n) => {\n const allowedParams = allowedTemplateParameters.concat([\n \"openmrsBase\",\n \"openmrsSpaBase\",\n ]);\n return validator((val) => {\n if (!val || typeof val != \"string\") {\n return false;\n }\n\n const rx = /\\${(.*?)}/g;\n let match = rx.exec(val);\n\n while (match) {\n if (!allowedParams.includes(match[1])) {\n return false;\n }\n\n match = rx.exec(val);\n }\n\n return true;\n }, \"Should be a URL or path. The allowed template parameters are \" + allowedParams.map((p) => \"${\" + p + \"}\").join(\", \"));\n};\n\n/**\n * Verifies that a string contains only the default URL template parameters.\n *\n * @category Navigation\n */\nexport const isUrl = isUrlWithTemplateParameters([]);\n\n/**\n * Verifies that the value is one of the allowed options.\n * @param allowedValues The list of allowable values\n */\nexport const oneOf = (allowedValues: Array<any>) => {\n return validator(\n (val) => allowedValues.includes(val),\n `Must be one of the following: '${allowedValues.join(\"', '\")}'.`\n );\n};\n\nexport const validators = {\n inRange,\n isUrl,\n isUrlWithTemplateParameters,\n oneOf,\n};\n"],"names":["module","exports","__WEBPACK_EXTERNAL_MODULE__685__","__WEBPACK_EXTERNAL_MODULE__645__","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","d","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","r","Symbol","toStringTag","value","_isPlaceholder","a","_curry1","fn","f1","arguments","length","apply","this","_curry2","f2","b","_b","_a","_arrayFromIterator","iter","next","list","done","push","_includesWith","pred","x","idx","len","_has","is","toString","_isArguments","hasEnumBug","propertyIsEnumerable","nonEnumerableProps","hasArgsEnumBug","contains","item","keys","nIdx","ks","checkArgsLength","val","slice","_uniqContentEquals","aIterator","bIterator","stackA","stackB","eq","_equals","aItem","f","match","typeA","equals","constructor","String","valueOf","name","message","source","global","ignoreCase","multiline","sticky","unicode","size","entries","concat","values","keysA","extendedStackA","extendedStackB","_curry3","f3","c","_c","_isObject","l","k","result","mergeDeepWithKey","lObj","rObj","lVal","rVal","names","index","_clone","refFrom","refTo","deep","pattern","copy","copiedValue","Date","RegExp","clone","Array","isArray","_isArray","_isString","nodeType","XWrap","Error","acc","bind","thisObj","n","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","_arity","_iterableReduce","xf","step","_methodReduce","methodName","symIterator","iterator","_reduce","_xwrap","_arrayReduce","reduce","TypeError","validator","validationFunction","Type","Boolean","ConceptUuid","Number","UUID","PersonAttributeTypeUuid","PatientIdentifierTypeUuid","isBoolean","isNumber","isString","isObject","isUuid","test","configInternalStore","createGlobalStore","providedConfigs","schemas","temporaryConfigStore","config","JSON","parse","localStorage","getItem","e","getTemporaryConfig","subscribe","state","setItem","stringify","configExtensionStore","mountedExtensions","getConfigStore","moduleName","getGlobalStore","loaded","getExtensionSlotsConfigStore","slots","getExtensionSlotConfig","slotName","getExtensionSlotConfigFromStore","getState","slotConfig","getExtensionsConfigStore","configs","getExtensionConfig","extensionId","extensionConfig","assign","getExtensionConfigFromStore","omit","implementerToolsConfigStore","computeModuleConfig","tempState","getConfigForModule","setState","computeExtensionSlotConfigs","allConfigs","slotConfigPerModule","slotConfigs","mergeConfigs","getProvidedConfigs","configBySlotName","validateExtensionSlotConfig","validateAllExtensionSlotConfigs","extensionSlots","newSlotStoreEntries","fromEntries","map","slotStore","oldState","newState","computeImplementerToolsConfig","tempConfigState","configState","getSchemaWithValuesAndSources","configsAndSources","createValuesAndSourcesTree","getImplementerToolsConfig","computeExtensionConfigs","extensionState","extension","computeExtensionConfig","slotModuleName","extensionModuleName","defineConfigSchema","schema","validateConfigSchema","enhancedSchema","mergeDeepRight","implicitConfigSchema","defineExtensionConfigSchema","extensionName","console","warn","provide","sourceName","getConfig","Promise","resolve","update","unsubscribe","store","getConfigInternal","processConfig","providedConfig","keyPathContext","validateStructure","setDefaults","runAllValidatorsInConfigTree","slotModuleConfig","split","getExtensionNameFromId","extensionConfigSchema","nameOfSchemaSource","mergeConfigsFor","configOverride","configure","combinedConfig","_value","_default","_source","isOrdinaryObject","errorPrefix","invalidKeys","filter","includes","error","join","add","every","remove","order","keyPath","updateMessage","thisKeyPath","schemaPart","elements","_elements","hasObjectSchema","_validators","valueType","_type","startsWith","inputConfig","mergeDeepAll","validateBranchStructure","checkType","dictionarySchema","validateDictionaryStructure","arraySchema","i","validateArrayStructure","runValidators","validators","validatorResult","configPart","configWithDefaults","conf","objectKey","selectedConfigPart","elementsSchema","privileges","_description","interpolateUrl","template","additionalParams","openmrsSpaBase","window","getOpenmrsSpaBase","replace","interpolateString","openmrsBase","params","prev","curr","navigate","to","templateParams","target","navigateToUrl","location","inRange","min","max","isUrlWithTemplateParameters","allowedTemplateParameters","allowedParams","rx","exec","p","isUrl","oneOf","allowedValues"],"sourceRoot":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openmrs/esm-config",
3
- "version": "4.1.1-pre.556",
3
+ "version": "4.1.1-pre.557",
4
4
  "license": "MPL-2.0",
5
5
  "description": "A configuration library for the OpenMRS Single-Spa framework.",
6
6
  "browser": "dist/openmrs-esm-module-config.js",
@@ -45,12 +45,12 @@
45
45
  "systemjs": "6.x"
46
46
  },
47
47
  "devDependencies": {
48
- "@openmrs/esm-globals": "^4.1.1-pre.556",
49
- "@openmrs/esm-state": "^4.1.1-pre.556",
48
+ "@openmrs/esm-globals": "^4.1.1-pre.557",
49
+ "@openmrs/esm-state": "^4.1.1-pre.557",
50
50
  "@types/ramda": "^0.26.44",
51
51
  "@types/systemjs": "^6.1.0",
52
52
  "babel-plugin-ramda": "^2.0.0",
53
53
  "single-spa": "^5.9.2"
54
54
  },
55
- "gitHead": "add26751e8e84bcc4a4301b4378c8c79e49f7cf8"
55
+ "gitHead": "34fdcf29979501096ec3e0dda472852935b0d525"
56
56
  }
package/src/types.ts CHANGED
@@ -21,11 +21,11 @@ export interface ConfigSchema {
21
21
  _elements?: ConfigSchema;
22
22
  }
23
23
 
24
- export interface Config extends Object {
24
+ export interface Config {
25
25
  [moduleName: string]: { [key: string]: any };
26
26
  }
27
27
 
28
- export interface ConfigObject extends Object {
28
+ export interface ConfigObject {
29
29
  [key: string]: any;
30
30
  "Display conditions"?: DisplayConditionsConfigObject;
31
31
  "Translation overrides"?: Record<string, Record<string, string>>;