@linkurious/ogma-linkurious-parser 4.1.13 → 4.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../node_modules/lodash/_listCacheClear.js","../node_modules/lodash/eq.js","../node_modules/lodash/_assocIndexOf.js","../node_modules/lodash/_listCacheDelete.js","../node_modules/lodash/_listCacheGet.js","../node_modules/lodash/_listCacheHas.js","../node_modules/lodash/_listCacheSet.js","../node_modules/lodash/_ListCache.js","../node_modules/lodash/_stackClear.js","../node_modules/lodash/_stackDelete.js","../node_modules/lodash/_stackGet.js","../node_modules/lodash/_stackHas.js","../node_modules/lodash/_freeGlobal.js","../node_modules/lodash/_root.js","../node_modules/lodash/_Symbol.js","../node_modules/lodash/_getRawTag.js","../node_modules/lodash/_objectToString.js","../node_modules/lodash/_baseGetTag.js","../node_modules/lodash/isObject.js","../node_modules/lodash/isFunction.js","../node_modules/lodash/_coreJsData.js","../node_modules/lodash/_isMasked.js","../node_modules/lodash/_toSource.js","../node_modules/lodash/_baseIsNative.js","../node_modules/lodash/_getValue.js","../node_modules/lodash/_getNative.js","../node_modules/lodash/_Map.js","../node_modules/lodash/_nativeCreate.js","../node_modules/lodash/_hashClear.js","../node_modules/lodash/_hashDelete.js","../node_modules/lodash/_hashGet.js","../node_modules/lodash/_hashHas.js","../node_modules/lodash/_hashSet.js","../node_modules/lodash/_Hash.js","../node_modules/lodash/_mapCacheClear.js","../node_modules/lodash/_isKeyable.js","../node_modules/lodash/_getMapData.js","../node_modules/lodash/_mapCacheDelete.js","../node_modules/lodash/_mapCacheGet.js","../node_modules/lodash/_mapCacheHas.js","../node_modules/lodash/_mapCacheSet.js","../node_modules/lodash/_MapCache.js","../node_modules/lodash/_stackSet.js","../node_modules/lodash/_Stack.js","../node_modules/lodash/_setCacheAdd.js","../node_modules/lodash/_setCacheHas.js","../node_modules/lodash/_SetCache.js","../node_modules/lodash/_arraySome.js","../node_modules/lodash/_cacheHas.js","../node_modules/lodash/_equalArrays.js","../node_modules/lodash/_Uint8Array.js","../node_modules/lodash/_mapToArray.js","../node_modules/lodash/_setToArray.js","../node_modules/lodash/_equalByTag.js","../node_modules/lodash/_arrayPush.js","../node_modules/lodash/isArray.js","../node_modules/lodash/_baseGetAllKeys.js","../node_modules/lodash/_arrayFilter.js","../node_modules/lodash/stubArray.js","../node_modules/lodash/_getSymbols.js","../node_modules/lodash/_baseTimes.js","../node_modules/lodash/isObjectLike.js","../node_modules/lodash/_baseIsArguments.js","../node_modules/lodash/isArguments.js","../node_modules/lodash/stubFalse.js","../node_modules/lodash/isBuffer.js","../node_modules/lodash/_isIndex.js","../node_modules/lodash/isLength.js","../node_modules/lodash/_baseIsTypedArray.js","../node_modules/lodash/_baseUnary.js","../node_modules/lodash/_nodeUtil.js","../node_modules/lodash/isTypedArray.js","../node_modules/lodash/_arrayLikeKeys.js","../node_modules/lodash/_isPrototype.js","../node_modules/lodash/_overArg.js","../node_modules/lodash/_nativeKeys.js","../node_modules/lodash/_baseKeys.js","../node_modules/lodash/isArrayLike.js","../node_modules/lodash/keys.js","../node_modules/lodash/_getAllKeys.js","../node_modules/lodash/_equalObjects.js","../node_modules/lodash/_DataView.js","../node_modules/lodash/_Promise.js","../node_modules/lodash/_Set.js","../node_modules/lodash/_WeakMap.js","../node_modules/lodash/_getTag.js","../node_modules/lodash/_baseIsEqualDeep.js","../node_modules/lodash/_baseIsEqual.js","../node_modules/lodash/isEqual.js","../node_modules/lodash/_isFlattenable.js","../node_modules/lodash/_baseFlatten.js","../node_modules/lodash/_arrayMap.js","../node_modules/lodash/isSymbol.js","../node_modules/lodash/_isKey.js","../node_modules/lodash/memoize.js","../node_modules/lodash/_memoizeCapped.js","../node_modules/lodash/_stringToPath.js","../node_modules/lodash/_baseToString.js","../node_modules/lodash/toString.js","../node_modules/lodash/_castPath.js","../node_modules/lodash/_toKey.js","../node_modules/lodash/_baseGet.js","../node_modules/lodash/_baseIsMatch.js","../node_modules/lodash/_isStrictComparable.js","../node_modules/lodash/_getMatchData.js","../node_modules/lodash/_matchesStrictComparable.js","../node_modules/lodash/_baseMatches.js","../node_modules/lodash/get.js","../node_modules/lodash/_baseHasIn.js","../node_modules/lodash/_hasPath.js","../node_modules/lodash/hasIn.js","../node_modules/lodash/_baseMatchesProperty.js","../node_modules/lodash/identity.js","../node_modules/lodash/_baseProperty.js","../node_modules/lodash/_basePropertyDeep.js","../node_modules/lodash/property.js","../node_modules/lodash/_baseIteratee.js","../node_modules/lodash/_createBaseFor.js","../node_modules/lodash/_baseFor.js","../node_modules/lodash/_baseForOwn.js","../node_modules/lodash/_createBaseEach.js","../node_modules/lodash/_baseEach.js","../node_modules/lodash/_baseMap.js","../node_modules/lodash/_baseSortBy.js","../node_modules/lodash/_compareAscending.js","../node_modules/lodash/_compareMultiple.js","../node_modules/lodash/_baseOrderBy.js","../node_modules/lodash/_apply.js","../node_modules/lodash/_overRest.js","../node_modules/lodash/constant.js","../node_modules/lodash/_defineProperty.js","../node_modules/lodash/_baseSetToString.js","../node_modules/lodash/_shortOut.js","../node_modules/lodash/_setToString.js","../node_modules/lodash/_baseRest.js","../node_modules/lodash/_isIterateeCall.js","../node_modules/lodash/sortBy.js","../src/tools/tools.ts","../src/captions/captions.ts","../node_modules/crypt/crypt.js","../node_modules/charenc/charenc.js","../node_modules/sha1/sha1.js","../src/styles/itemAttributes.ts","../src/styles/edgeAttributes.ts","../src/styles/nodeAttributes.ts","../src/styles/styleRule.ts","../src/styles/styleRules.ts","../src/ogma/features/styles.ts","../src/ogma/features/captions.ts","../node_modules/rxjs/dist/esm5/internal/util/isFunction.js","../node_modules/rxjs/dist/esm5/internal/util/lift.js","../node_modules/tslib/tslib.es6.mjs","../node_modules/rxjs/dist/esm5/internal/util/createErrorClass.js","../node_modules/rxjs/dist/esm5/internal/util/UnsubscriptionError.js","../node_modules/rxjs/dist/esm5/internal/util/arrRemove.js","../node_modules/rxjs/dist/esm5/internal/Subscription.js","../node_modules/rxjs/dist/esm5/internal/config.js","../node_modules/rxjs/dist/esm5/internal/scheduler/timeoutProvider.js","../node_modules/rxjs/dist/esm5/internal/util/reportUnhandledError.js","../node_modules/rxjs/dist/esm5/internal/util/noop.js","../node_modules/rxjs/dist/esm5/internal/Subscriber.js","../node_modules/rxjs/dist/esm5/internal/util/identity.js","../node_modules/rxjs/dist/esm5/internal/operators/OperatorSubscriber.js","../node_modules/rxjs/dist/esm5/internal/operators/map.js","../node_modules/rxjs/dist/esm5/internal/operators/distinctUntilChanged.js","../src/ogma/features/OgmaStore.ts","../src/ogma/features/reactive.ts","../src/ogma/index.ts","../src/tools/colorPalette.ts","../src/tools/ogmaTool.ts","../src/ogma/features/nodeGrouping.ts","../src/ogma/features/transformations.ts","../src/filters/filters.ts","../src/ogma/features/selectors.ts"],"sourcesContent":["/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n}\n\nmodule.exports = listCacheClear;\n","/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n return value === other || (value !== value && other !== other);\n}\n\nmodule.exports = eq;\n","var eq = require('./eq');\n\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n}\n\nmodule.exports = assocIndexOf;\n","var assocIndexOf = require('./_assocIndexOf');\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype;\n\n/** Built-in value references. */\nvar splice = arrayProto.splice;\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n --this.size;\n return true;\n}\n\nmodule.exports = listCacheDelete;\n","var assocIndexOf = require('./_assocIndexOf');\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n}\n\nmodule.exports = listCacheGet;\n","var assocIndexOf = require('./_assocIndexOf');\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n}\n\nmodule.exports = listCacheHas;\n","var assocIndexOf = require('./_assocIndexOf');\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n ++this.size;\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n}\n\nmodule.exports = listCacheSet;\n","var listCacheClear = require('./_listCacheClear'),\n listCacheDelete = require('./_listCacheDelete'),\n listCacheGet = require('./_listCacheGet'),\n listCacheHas = require('./_listCacheHas'),\n listCacheSet = require('./_listCacheSet');\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\nmodule.exports = ListCache;\n","var ListCache = require('./_ListCache');\n\n/**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\nfunction stackClear() {\n this.__data__ = new ListCache;\n this.size = 0;\n}\n\nmodule.exports = stackClear;\n","/**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction stackDelete(key) {\n var data = this.__data__,\n result = data['delete'](key);\n\n this.size = data.size;\n return result;\n}\n\nmodule.exports = stackDelete;\n","/**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction stackGet(key) {\n return this.__data__.get(key);\n}\n\nmodule.exports = stackGet;\n","/**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction stackHas(key) {\n return this.__data__.has(key);\n}\n\nmodule.exports = stackHas;\n","/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\nmodule.exports = freeGlobal;\n","var freeGlobal = require('./_freeGlobal');\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\nmodule.exports = root;\n","var root = require('./_root');\n\n/** Built-in value references. */\nvar Symbol = root.Symbol;\n\nmodule.exports = Symbol;\n","var Symbol = require('./_Symbol');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\nmodule.exports = getRawTag;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\nmodule.exports = objectToString;\n","var Symbol = require('./_Symbol'),\n getRawTag = require('./_getRawTag'),\n objectToString = require('./_objectToString');\n\n/** `Object#toString` result references. */\nvar nullTag = '[object Null]',\n undefinedTag = '[object Undefined]';\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\nmodule.exports = baseGetTag;\n","/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n}\n\nmodule.exports = isObject;\n","var baseGetTag = require('./_baseGetTag'),\n isObject = require('./isObject');\n\n/** `Object#toString` result references. */\nvar asyncTag = '[object AsyncFunction]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n proxyTag = '[object Proxy]';\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n if (!isObject(value)) {\n return false;\n }\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 9 which returns 'object' for typed arrays and other constructors.\n var tag = baseGetTag(value);\n return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;\n}\n\nmodule.exports = isFunction;\n","var root = require('./_root');\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\nmodule.exports = coreJsData;\n","var coreJsData = require('./_coreJsData');\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n}\n\nmodule.exports = isMasked;\n","/** Used for built-in method references. */\nvar funcProto = Function.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to convert.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n}\n\nmodule.exports = toSource;\n","var isFunction = require('./isFunction'),\n isMasked = require('./_isMasked'),\n isObject = require('./isObject'),\n toSource = require('./_toSource');\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used for built-in method references. */\nvar funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\nfunction baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = isFunction(value) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n}\n\nmodule.exports = baseIsNative;\n","/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n return object == null ? undefined : object[key];\n}\n\nmodule.exports = getValue;\n","var baseIsNative = require('./_baseIsNative'),\n getValue = require('./_getValue');\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n}\n\nmodule.exports = getNative;\n","var getNative = require('./_getNative'),\n root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar Map = getNative(root, 'Map');\n\nmodule.exports = Map;\n","var getNative = require('./_getNative');\n\n/* Built-in method references that are verified to be native. */\nvar nativeCreate = getNative(Object, 'create');\n\nmodule.exports = nativeCreate;\n","var nativeCreate = require('./_nativeCreate');\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n}\n\nmodule.exports = hashClear;\n","/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n var result = this.has(key) && delete this.__data__[key];\n this.size -= result ? 1 : 0;\n return result;\n}\n\nmodule.exports = hashDelete;\n","var nativeCreate = require('./_nativeCreate');\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\nmodule.exports = hashGet;\n","var nativeCreate = require('./_nativeCreate');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);\n}\n\nmodule.exports = hashHas;\n","var nativeCreate = require('./_nativeCreate');\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n var data = this.__data__;\n this.size += this.has(key) ? 0 : 1;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n}\n\nmodule.exports = hashSet;\n","var hashClear = require('./_hashClear'),\n hashDelete = require('./_hashDelete'),\n hashGet = require('./_hashGet'),\n hashHas = require('./_hashHas'),\n hashSet = require('./_hashSet');\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\nmodule.exports = Hash;\n","var Hash = require('./_Hash'),\n ListCache = require('./_ListCache'),\n Map = require('./_Map');\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n}\n\nmodule.exports = mapCacheClear;\n","/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n}\n\nmodule.exports = isKeyable;\n","var isKeyable = require('./_isKeyable');\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n}\n\nmodule.exports = getMapData;\n","var getMapData = require('./_getMapData');\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n var result = getMapData(this, key)['delete'](key);\n this.size -= result ? 1 : 0;\n return result;\n}\n\nmodule.exports = mapCacheDelete;\n","var getMapData = require('./_getMapData');\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n return getMapData(this, key).get(key);\n}\n\nmodule.exports = mapCacheGet;\n","var getMapData = require('./_getMapData');\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas(key) {\n return getMapData(this, key).has(key);\n}\n\nmodule.exports = mapCacheHas;\n","var getMapData = require('./_getMapData');\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n var data = getMapData(this, key),\n size = data.size;\n\n data.set(key, value);\n this.size += data.size == size ? 0 : 1;\n return this;\n}\n\nmodule.exports = mapCacheSet;\n","var mapCacheClear = require('./_mapCacheClear'),\n mapCacheDelete = require('./_mapCacheDelete'),\n mapCacheGet = require('./_mapCacheGet'),\n mapCacheHas = require('./_mapCacheHas'),\n mapCacheSet = require('./_mapCacheSet');\n\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction MapCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `MapCache`.\nMapCache.prototype.clear = mapCacheClear;\nMapCache.prototype['delete'] = mapCacheDelete;\nMapCache.prototype.get = mapCacheGet;\nMapCache.prototype.has = mapCacheHas;\nMapCache.prototype.set = mapCacheSet;\n\nmodule.exports = MapCache;\n","var ListCache = require('./_ListCache'),\n Map = require('./_Map'),\n MapCache = require('./_MapCache');\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\nfunction stackSet(key, value) {\n var data = this.__data__;\n if (data instanceof ListCache) {\n var pairs = data.__data__;\n if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n pairs.push([key, value]);\n this.size = ++data.size;\n return this;\n }\n data = this.__data__ = new MapCache(pairs);\n }\n data.set(key, value);\n this.size = data.size;\n return this;\n}\n\nmodule.exports = stackSet;\n","var ListCache = require('./_ListCache'),\n stackClear = require('./_stackClear'),\n stackDelete = require('./_stackDelete'),\n stackGet = require('./_stackGet'),\n stackHas = require('./_stackHas'),\n stackSet = require('./_stackSet');\n\n/**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Stack(entries) {\n var data = this.__data__ = new ListCache(entries);\n this.size = data.size;\n}\n\n// Add methods to `Stack`.\nStack.prototype.clear = stackClear;\nStack.prototype['delete'] = stackDelete;\nStack.prototype.get = stackGet;\nStack.prototype.has = stackHas;\nStack.prototype.set = stackSet;\n\nmodule.exports = Stack;\n","/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/**\n * Adds `value` to the array cache.\n *\n * @private\n * @name add\n * @memberOf SetCache\n * @alias push\n * @param {*} value The value to cache.\n * @returns {Object} Returns the cache instance.\n */\nfunction setCacheAdd(value) {\n this.__data__.set(value, HASH_UNDEFINED);\n return this;\n}\n\nmodule.exports = setCacheAdd;\n","/**\n * Checks if `value` is in the array cache.\n *\n * @private\n * @name has\n * @memberOf SetCache\n * @param {*} value The value to search for.\n * @returns {number} Returns `true` if `value` is found, else `false`.\n */\nfunction setCacheHas(value) {\n return this.__data__.has(value);\n}\n\nmodule.exports = setCacheHas;\n","var MapCache = require('./_MapCache'),\n setCacheAdd = require('./_setCacheAdd'),\n setCacheHas = require('./_setCacheHas');\n\n/**\n *\n * Creates an array cache object to store unique values.\n *\n * @private\n * @constructor\n * @param {Array} [values] The values to cache.\n */\nfunction SetCache(values) {\n var index = -1,\n length = values == null ? 0 : values.length;\n\n this.__data__ = new MapCache;\n while (++index < length) {\n this.add(values[index]);\n }\n}\n\n// Add methods to `SetCache`.\nSetCache.prototype.add = SetCache.prototype.push = setCacheAdd;\nSetCache.prototype.has = setCacheHas;\n\nmodule.exports = SetCache;\n","/**\n * A specialized version of `_.some` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n */\nfunction arraySome(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (predicate(array[index], index, array)) {\n return true;\n }\n }\n return false;\n}\n\nmodule.exports = arraySome;\n","/**\n * Checks if a `cache` value for `key` exists.\n *\n * @private\n * @param {Object} cache The cache to query.\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction cacheHas(cache, key) {\n return cache.has(key);\n}\n\nmodule.exports = cacheHas;\n","var SetCache = require('./_SetCache'),\n arraySome = require('./_arraySome'),\n cacheHas = require('./_cacheHas');\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/**\n * A specialized version of `baseIsEqualDeep` for arrays with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Array} array The array to compare.\n * @param {Array} other The other array to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `array` and `other` objects.\n * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.\n */\nfunction equalArrays(array, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n arrLength = array.length,\n othLength = other.length;\n\n if (arrLength != othLength && !(isPartial && othLength > arrLength)) {\n return false;\n }\n // Check that cyclic values are equal.\n var arrStacked = stack.get(array);\n var othStacked = stack.get(other);\n if (arrStacked && othStacked) {\n return arrStacked == other && othStacked == array;\n }\n var index = -1,\n result = true,\n seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;\n\n stack.set(array, other);\n stack.set(other, array);\n\n // Ignore non-index properties.\n while (++index < arrLength) {\n var arrValue = array[index],\n othValue = other[index];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, arrValue, index, other, array, stack)\n : customizer(arrValue, othValue, index, array, other, stack);\n }\n if (compared !== undefined) {\n if (compared) {\n continue;\n }\n result = false;\n break;\n }\n // Recursively compare arrays (susceptible to call stack limits).\n if (seen) {\n if (!arraySome(other, function(othValue, othIndex) {\n if (!cacheHas(seen, othIndex) &&\n (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {\n return seen.push(othIndex);\n }\n })) {\n result = false;\n break;\n }\n } else if (!(\n arrValue === othValue ||\n equalFunc(arrValue, othValue, bitmask, customizer, stack)\n )) {\n result = false;\n break;\n }\n }\n stack['delete'](array);\n stack['delete'](other);\n return result;\n}\n\nmodule.exports = equalArrays;\n","var root = require('./_root');\n\n/** Built-in value references. */\nvar Uint8Array = root.Uint8Array;\n\nmodule.exports = Uint8Array;\n","/**\n * Converts `map` to its key-value pairs.\n *\n * @private\n * @param {Object} map The map to convert.\n * @returns {Array} Returns the key-value pairs.\n */\nfunction mapToArray(map) {\n var index = -1,\n result = Array(map.size);\n\n map.forEach(function(value, key) {\n result[++index] = [key, value];\n });\n return result;\n}\n\nmodule.exports = mapToArray;\n","/**\n * Converts `set` to an array of its values.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the values.\n */\nfunction setToArray(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = value;\n });\n return result;\n}\n\nmodule.exports = setToArray;\n","var Symbol = require('./_Symbol'),\n Uint8Array = require('./_Uint8Array'),\n eq = require('./eq'),\n equalArrays = require('./_equalArrays'),\n mapToArray = require('./_mapToArray'),\n setToArray = require('./_setToArray');\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/** `Object#toString` result references. */\nvar boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]';\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * A specialized version of `baseIsEqualDeep` for comparing objects of\n * the same `toStringTag`.\n *\n * **Note:** This function only supports comparing values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {string} tag The `toStringTag` of the objects to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {\n switch (tag) {\n case dataViewTag:\n if ((object.byteLength != other.byteLength) ||\n (object.byteOffset != other.byteOffset)) {\n return false;\n }\n object = object.buffer;\n other = other.buffer;\n\n case arrayBufferTag:\n if ((object.byteLength != other.byteLength) ||\n !equalFunc(new Uint8Array(object), new Uint8Array(other))) {\n return false;\n }\n return true;\n\n case boolTag:\n case dateTag:\n case numberTag:\n // Coerce booleans to `1` or `0` and dates to milliseconds.\n // Invalid dates are coerced to `NaN`.\n return eq(+object, +other);\n\n case errorTag:\n return object.name == other.name && object.message == other.message;\n\n case regexpTag:\n case stringTag:\n // Coerce regexes to strings and treat strings, primitives and objects,\n // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring\n // for more details.\n return object == (other + '');\n\n case mapTag:\n var convert = mapToArray;\n\n case setTag:\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG;\n convert || (convert = setToArray);\n\n if (object.size != other.size && !isPartial) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked) {\n return stacked == other;\n }\n bitmask |= COMPARE_UNORDERED_FLAG;\n\n // Recursively compare objects (susceptible to call stack limits).\n stack.set(object, other);\n var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);\n stack['delete'](object);\n return result;\n\n case symbolTag:\n if (symbolValueOf) {\n return symbolValueOf.call(object) == symbolValueOf.call(other);\n }\n }\n return false;\n}\n\nmodule.exports = equalByTag;\n","/**\n * Appends the elements of `values` to `array`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to append.\n * @returns {Array} Returns `array`.\n */\nfunction arrayPush(array, values) {\n var index = -1,\n length = values.length,\n offset = array.length;\n\n while (++index < length) {\n array[offset + index] = values[index];\n }\n return array;\n}\n\nmodule.exports = arrayPush;\n","/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\nmodule.exports = isArray;\n","var arrayPush = require('./_arrayPush'),\n isArray = require('./isArray');\n\n/**\n * The base implementation of `getAllKeys` and `getAllKeysIn` which uses\n * `keysFunc` and `symbolsFunc` to get the enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @param {Function} symbolsFunc The function to get the symbols of `object`.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction baseGetAllKeys(object, keysFunc, symbolsFunc) {\n var result = keysFunc(object);\n return isArray(object) ? result : arrayPush(result, symbolsFunc(object));\n}\n\nmodule.exports = baseGetAllKeys;\n","/**\n * A specialized version of `_.filter` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\nfunction arrayFilter(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (predicate(value, index, array)) {\n result[resIndex++] = value;\n }\n }\n return result;\n}\n\nmodule.exports = arrayFilter;\n","/**\n * This method returns a new empty array.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {Array} Returns the new empty array.\n * @example\n *\n * var arrays = _.times(2, _.stubArray);\n *\n * console.log(arrays);\n * // => [[], []]\n *\n * console.log(arrays[0] === arrays[1]);\n * // => false\n */\nfunction stubArray() {\n return [];\n}\n\nmodule.exports = stubArray;\n","var arrayFilter = require('./_arrayFilter'),\n stubArray = require('./stubArray');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols;\n\n/**\n * Creates an array of the own enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbols = !nativeGetSymbols ? stubArray : function(object) {\n if (object == null) {\n return [];\n }\n object = Object(object);\n return arrayFilter(nativeGetSymbols(object), function(symbol) {\n return propertyIsEnumerable.call(object, symbol);\n });\n};\n\nmodule.exports = getSymbols;\n","/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n}\n\nmodule.exports = baseTimes;\n","/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\nmodule.exports = isObjectLike;\n","var baseGetTag = require('./_baseGetTag'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]';\n\n/**\n * The base implementation of `_.isArguments`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n */\nfunction baseIsArguments(value) {\n return isObjectLike(value) && baseGetTag(value) == argsTag;\n}\n\nmodule.exports = baseIsArguments;\n","var baseIsArguments = require('./_baseIsArguments'),\n isObjectLike = require('./isObjectLike');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nvar isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {\n return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&\n !propertyIsEnumerable.call(value, 'callee');\n};\n\nmodule.exports = isArguments;\n","/**\n * This method returns `false`.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {boolean} Returns `false`.\n * @example\n *\n * _.times(2, _.stubFalse);\n * // => [false, false]\n */\nfunction stubFalse() {\n return false;\n}\n\nmodule.exports = stubFalse;\n","var root = require('./_root'),\n stubFalse = require('./stubFalse');\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;\n\n/**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\nvar isBuffer = nativeIsBuffer || stubFalse;\n\nmodule.exports = isBuffer;\n","/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n var type = typeof value;\n length = length == null ? MAX_SAFE_INTEGER : length;\n\n return !!length &&\n (type == 'number' ||\n (type != 'symbol' && reIsUint.test(value))) &&\n (value > -1 && value % 1 == 0 && value < length);\n}\n\nmodule.exports = isIndex;\n","/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\nmodule.exports = isLength;\n","var baseGetTag = require('./_baseGetTag'),\n isLength = require('./isLength'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/** Used to identify `toStringTag` values of typed arrays. */\nvar typedArrayTags = {};\ntypedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\ntypedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\ntypedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\ntypedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\ntypedArrayTags[uint32Tag] = true;\ntypedArrayTags[argsTag] = typedArrayTags[arrayTag] =\ntypedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\ntypedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\ntypedArrayTags[errorTag] = typedArrayTags[funcTag] =\ntypedArrayTags[mapTag] = typedArrayTags[numberTag] =\ntypedArrayTags[objectTag] = typedArrayTags[regexpTag] =\ntypedArrayTags[setTag] = typedArrayTags[stringTag] =\ntypedArrayTags[weakMapTag] = false;\n\n/**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\nfunction baseIsTypedArray(value) {\n return isObjectLike(value) &&\n isLength(value.length) && !!typedArrayTags[baseGetTag(value)];\n}\n\nmodule.exports = baseIsTypedArray;\n","/**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\nfunction baseUnary(func) {\n return function(value) {\n return func(value);\n };\n}\n\nmodule.exports = baseUnary;\n","var freeGlobal = require('./_freeGlobal');\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Detect free variable `process` from Node.js. */\nvar freeProcess = moduleExports && freeGlobal.process;\n\n/** Used to access faster Node.js helpers. */\nvar nodeUtil = (function() {\n try {\n // Use `util.types` for Node.js 10+.\n var types = freeModule && freeModule.require && freeModule.require('util').types;\n\n if (types) {\n return types;\n }\n\n // Legacy `process.binding('util')` for Node.js < 10.\n return freeProcess && freeProcess.binding && freeProcess.binding('util');\n } catch (e) {}\n}());\n\nmodule.exports = nodeUtil;\n","var baseIsTypedArray = require('./_baseIsTypedArray'),\n baseUnary = require('./_baseUnary'),\n nodeUtil = require('./_nodeUtil');\n\n/* Node.js helper references. */\nvar nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n/**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\nvar isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\nmodule.exports = isTypedArray;\n","var baseTimes = require('./_baseTimes'),\n isArguments = require('./isArguments'),\n isArray = require('./isArray'),\n isBuffer = require('./isBuffer'),\n isIndex = require('./_isIndex'),\n isTypedArray = require('./isTypedArray');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n var isArr = isArray(value),\n isArg = !isArr && isArguments(value),\n isBuff = !isArr && !isArg && isBuffer(value),\n isType = !isArr && !isArg && !isBuff && isTypedArray(value),\n skipIndexes = isArr || isArg || isBuff || isType,\n result = skipIndexes ? baseTimes(value.length, String) : [],\n length = result.length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (\n // Safari 9 has enumerable `arguments.length` in strict mode.\n key == 'length' ||\n // Node.js 0.10 has enumerable non-index properties on buffers.\n (isBuff && (key == 'offset' || key == 'parent')) ||\n // PhantomJS 2 has enumerable non-index properties on typed arrays.\n (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||\n // Skip index properties.\n isIndex(key, length)\n ))) {\n result.push(key);\n }\n }\n return result;\n}\n\nmodule.exports = arrayLikeKeys;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n}\n\nmodule.exports = isPrototype;\n","/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\nmodule.exports = overArg;\n","var overArg = require('./_overArg');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeKeys = overArg(Object.keys, Object);\n\nmodule.exports = nativeKeys;\n","var isPrototype = require('./_isPrototype'),\n nativeKeys = require('./_nativeKeys');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n}\n\nmodule.exports = baseKeys;\n","var isFunction = require('./isFunction'),\n isLength = require('./isLength');\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n}\n\nmodule.exports = isArrayLike;\n","var arrayLikeKeys = require('./_arrayLikeKeys'),\n baseKeys = require('./_baseKeys'),\n isArrayLike = require('./isArrayLike');\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nfunction keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n}\n\nmodule.exports = keys;\n","var baseGetAllKeys = require('./_baseGetAllKeys'),\n getSymbols = require('./_getSymbols'),\n keys = require('./keys');\n\n/**\n * Creates an array of own enumerable property names and symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeys(object) {\n return baseGetAllKeys(object, keys, getSymbols);\n}\n\nmodule.exports = getAllKeys;\n","var getAllKeys = require('./_getAllKeys');\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1;\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * A specialized version of `baseIsEqualDeep` for objects with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalObjects(object, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n objProps = getAllKeys(object),\n objLength = objProps.length,\n othProps = getAllKeys(other),\n othLength = othProps.length;\n\n if (objLength != othLength && !isPartial) {\n return false;\n }\n var index = objLength;\n while (index--) {\n var key = objProps[index];\n if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {\n return false;\n }\n }\n // Check that cyclic values are equal.\n var objStacked = stack.get(object);\n var othStacked = stack.get(other);\n if (objStacked && othStacked) {\n return objStacked == other && othStacked == object;\n }\n var result = true;\n stack.set(object, other);\n stack.set(other, object);\n\n var skipCtor = isPartial;\n while (++index < objLength) {\n key = objProps[index];\n var objValue = object[key],\n othValue = other[key];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, objValue, key, other, object, stack)\n : customizer(objValue, othValue, key, object, other, stack);\n }\n // Recursively compare objects (susceptible to call stack limits).\n if (!(compared === undefined\n ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))\n : compared\n )) {\n result = false;\n break;\n }\n skipCtor || (skipCtor = key == 'constructor');\n }\n if (result && !skipCtor) {\n var objCtor = object.constructor,\n othCtor = other.constructor;\n\n // Non `Object` object instances with different constructors are not equal.\n if (objCtor != othCtor &&\n ('constructor' in object && 'constructor' in other) &&\n !(typeof objCtor == 'function' && objCtor instanceof objCtor &&\n typeof othCtor == 'function' && othCtor instanceof othCtor)) {\n result = false;\n }\n }\n stack['delete'](object);\n stack['delete'](other);\n return result;\n}\n\nmodule.exports = equalObjects;\n","var getNative = require('./_getNative'),\n root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar DataView = getNative(root, 'DataView');\n\nmodule.exports = DataView;\n","var getNative = require('./_getNative'),\n root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar Promise = getNative(root, 'Promise');\n\nmodule.exports = Promise;\n","var getNative = require('./_getNative'),\n root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar Set = getNative(root, 'Set');\n\nmodule.exports = Set;\n","var getNative = require('./_getNative'),\n root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar WeakMap = getNative(root, 'WeakMap');\n\nmodule.exports = WeakMap;\n","var DataView = require('./_DataView'),\n Map = require('./_Map'),\n Promise = require('./_Promise'),\n Set = require('./_Set'),\n WeakMap = require('./_WeakMap'),\n baseGetTag = require('./_baseGetTag'),\n toSource = require('./_toSource');\n\n/** `Object#toString` result references. */\nvar mapTag = '[object Map]',\n objectTag = '[object Object]',\n promiseTag = '[object Promise]',\n setTag = '[object Set]',\n weakMapTag = '[object WeakMap]';\n\nvar dataViewTag = '[object DataView]';\n\n/** Used to detect maps, sets, and weakmaps. */\nvar dataViewCtorString = toSource(DataView),\n mapCtorString = toSource(Map),\n promiseCtorString = toSource(Promise),\n setCtorString = toSource(Set),\n weakMapCtorString = toSource(WeakMap);\n\n/**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nvar getTag = baseGetTag;\n\n// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.\nif ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||\n (Map && getTag(new Map) != mapTag) ||\n (Promise && getTag(Promise.resolve()) != promiseTag) ||\n (Set && getTag(new Set) != setTag) ||\n (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n getTag = function(value) {\n var result = baseGetTag(value),\n Ctor = result == objectTag ? value.constructor : undefined,\n ctorString = Ctor ? toSource(Ctor) : '';\n\n if (ctorString) {\n switch (ctorString) {\n case dataViewCtorString: return dataViewTag;\n case mapCtorString: return mapTag;\n case promiseCtorString: return promiseTag;\n case setCtorString: return setTag;\n case weakMapCtorString: return weakMapTag;\n }\n }\n return result;\n };\n}\n\nmodule.exports = getTag;\n","var Stack = require('./_Stack'),\n equalArrays = require('./_equalArrays'),\n equalByTag = require('./_equalByTag'),\n equalObjects = require('./_equalObjects'),\n getTag = require('./_getTag'),\n isArray = require('./isArray'),\n isBuffer = require('./isBuffer'),\n isTypedArray = require('./isTypedArray');\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n objectTag = '[object Object]';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * A specialized version of `baseIsEqual` for arrays and objects which performs\n * deep comparisons and tracks traversed objects enabling objects with circular\n * references to be compared.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} [stack] Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {\n var objIsArr = isArray(object),\n othIsArr = isArray(other),\n objTag = objIsArr ? arrayTag : getTag(object),\n othTag = othIsArr ? arrayTag : getTag(other);\n\n objTag = objTag == argsTag ? objectTag : objTag;\n othTag = othTag == argsTag ? objectTag : othTag;\n\n var objIsObj = objTag == objectTag,\n othIsObj = othTag == objectTag,\n isSameTag = objTag == othTag;\n\n if (isSameTag && isBuffer(object)) {\n if (!isBuffer(other)) {\n return false;\n }\n objIsArr = true;\n objIsObj = false;\n }\n if (isSameTag && !objIsObj) {\n stack || (stack = new Stack);\n return (objIsArr || isTypedArray(object))\n ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)\n : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);\n }\n if (!(bitmask & COMPARE_PARTIAL_FLAG)) {\n var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),\n othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');\n\n if (objIsWrapped || othIsWrapped) {\n var objUnwrapped = objIsWrapped ? object.value() : object,\n othUnwrapped = othIsWrapped ? other.value() : other;\n\n stack || (stack = new Stack);\n return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);\n }\n }\n if (!isSameTag) {\n return false;\n }\n stack || (stack = new Stack);\n return equalObjects(object, other, bitmask, customizer, equalFunc, stack);\n}\n\nmodule.exports = baseIsEqualDeep;\n","var baseIsEqualDeep = require('./_baseIsEqualDeep'),\n isObjectLike = require('./isObjectLike');\n\n/**\n * The base implementation of `_.isEqual` which supports partial comparisons\n * and tracks traversed objects.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Unordered comparison\n * 2 - Partial comparison\n * @param {Function} [customizer] The function to customize comparisons.\n * @param {Object} [stack] Tracks traversed `value` and `other` objects.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n */\nfunction baseIsEqual(value, other, bitmask, customizer, stack) {\n if (value === other) {\n return true;\n }\n if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {\n return value !== value && other !== other;\n }\n return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);\n}\n\nmodule.exports = baseIsEqual;\n","var baseIsEqual = require('./_baseIsEqual');\n\n/**\n * Performs a deep comparison between two values to determine if they are\n * equivalent.\n *\n * **Note:** This method supports comparing arrays, array buffers, booleans,\n * date objects, error objects, maps, numbers, `Object` objects, regexes,\n * sets, strings, symbols, and typed arrays. `Object` objects are compared\n * by their own, not inherited, enumerable properties. Functions and DOM\n * nodes are compared by strict equality, i.e. `===`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.isEqual(object, other);\n * // => true\n *\n * object === other;\n * // => false\n */\nfunction isEqual(value, other) {\n return baseIsEqual(value, other);\n}\n\nmodule.exports = isEqual;\n","var Symbol = require('./_Symbol'),\n isArguments = require('./isArguments'),\n isArray = require('./isArray');\n\n/** Built-in value references. */\nvar spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined;\n\n/**\n * Checks if `value` is a flattenable `arguments` object or array.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.\n */\nfunction isFlattenable(value) {\n return isArray(value) || isArguments(value) ||\n !!(spreadableSymbol && value && value[spreadableSymbol]);\n}\n\nmodule.exports = isFlattenable;\n","var arrayPush = require('./_arrayPush'),\n isFlattenable = require('./_isFlattenable');\n\n/**\n * The base implementation of `_.flatten` with support for restricting flattening.\n *\n * @private\n * @param {Array} array The array to flatten.\n * @param {number} depth The maximum recursion depth.\n * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.\n * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.\n * @param {Array} [result=[]] The initial result value.\n * @returns {Array} Returns the new flattened array.\n */\nfunction baseFlatten(array, depth, predicate, isStrict, result) {\n var index = -1,\n length = array.length;\n\n predicate || (predicate = isFlattenable);\n result || (result = []);\n\n while (++index < length) {\n var value = array[index];\n if (depth > 0 && predicate(value)) {\n if (depth > 1) {\n // Recursively flatten arrays (susceptible to call stack limits).\n baseFlatten(value, depth - 1, predicate, isStrict, result);\n } else {\n arrayPush(result, value);\n }\n } else if (!isStrict) {\n result[result.length] = value;\n }\n }\n return result;\n}\n\nmodule.exports = baseFlatten;\n","/**\n * A specialized version of `_.map` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\nfunction arrayMap(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length,\n result = Array(length);\n\n while (++index < length) {\n result[index] = iteratee(array[index], index, array);\n }\n return result;\n}\n\nmodule.exports = arrayMap;\n","var baseGetTag = require('./_baseGetTag'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar symbolTag = '[object Symbol]';\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && baseGetTag(value) == symbolTag);\n}\n\nmodule.exports = isSymbol;\n","var isArray = require('./isArray'),\n isSymbol = require('./isSymbol');\n\n/** Used to match property names within property paths. */\nvar reIsDeepProp = /\\.|\\[(?:[^[\\]]*|([\"'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/,\n reIsPlainProp = /^\\w*$/;\n\n/**\n * Checks if `value` is a property name and not a property path.\n *\n * @private\n * @param {*} value The value to check.\n * @param {Object} [object] The object to query keys on.\n * @returns {boolean} Returns `true` if `value` is a property name, else `false`.\n */\nfunction isKey(value, object) {\n if (isArray(value)) {\n return false;\n }\n var type = typeof value;\n if (type == 'number' || type == 'symbol' || type == 'boolean' ||\n value == null || isSymbol(value)) {\n return true;\n }\n return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||\n (object != null && value in Object(object));\n}\n\nmodule.exports = isKey;\n","var MapCache = require('./_MapCache');\n\n/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/**\n * Creates a function that memoizes the result of `func`. If `resolver` is\n * provided, it determines the cache key for storing the result based on the\n * arguments provided to the memoized function. By default, the first argument\n * provided to the memoized function is used as the map cache key. The `func`\n * is invoked with the `this` binding of the memoized function.\n *\n * **Note:** The cache is exposed as the `cache` property on the memoized\n * function. Its creation may be customized by replacing the `_.memoize.Cache`\n * constructor with one whose instances implement the\n * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)\n * method interface of `clear`, `delete`, `get`, `has`, and `set`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to have its output memoized.\n * @param {Function} [resolver] The function to resolve the cache key.\n * @returns {Function} Returns the new memoized function.\n * @example\n *\n * var object = { 'a': 1, 'b': 2 };\n * var other = { 'c': 3, 'd': 4 };\n *\n * var values = _.memoize(_.values);\n * values(object);\n * // => [1, 2]\n *\n * values(other);\n * // => [3, 4]\n *\n * object.a = 2;\n * values(object);\n * // => [1, 2]\n *\n * // Modify the result cache.\n * values.cache.set(object, ['a', 'b']);\n * values(object);\n * // => ['a', 'b']\n *\n * // Replace `_.memoize.Cache`.\n * _.memoize.Cache = WeakMap;\n */\nfunction memoize(func, resolver) {\n if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n var memoized = function() {\n var args = arguments,\n key = resolver ? resolver.apply(this, args) : args[0],\n cache = memoized.cache;\n\n if (cache.has(key)) {\n return cache.get(key);\n }\n var result = func.apply(this, args);\n memoized.cache = cache.set(key, result) || cache;\n return result;\n };\n memoized.cache = new (memoize.Cache || MapCache);\n return memoized;\n}\n\n// Expose `MapCache`.\nmemoize.Cache = MapCache;\n\nmodule.exports = memoize;\n","var memoize = require('./memoize');\n\n/** Used as the maximum memoize cache size. */\nvar MAX_MEMOIZE_SIZE = 500;\n\n/**\n * A specialized version of `_.memoize` which clears the memoized function's\n * cache when it exceeds `MAX_MEMOIZE_SIZE`.\n *\n * @private\n * @param {Function} func The function to have its output memoized.\n * @returns {Function} Returns the new memoized function.\n */\nfunction memoizeCapped(func) {\n var result = memoize(func, function(key) {\n if (cache.size === MAX_MEMOIZE_SIZE) {\n cache.clear();\n }\n return key;\n });\n\n var cache = result.cache;\n return result;\n}\n\nmodule.exports = memoizeCapped;\n","var memoizeCapped = require('./_memoizeCapped');\n\n/** Used to match property names within property paths. */\nvar rePropName = /[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))/g;\n\n/** Used to match backslashes in property paths. */\nvar reEscapeChar = /\\\\(\\\\)?/g;\n\n/**\n * Converts `string` to a property path array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the property path array.\n */\nvar stringToPath = memoizeCapped(function(string) {\n var result = [];\n if (string.charCodeAt(0) === 46 /* . */) {\n result.push('');\n }\n string.replace(rePropName, function(match, number, quote, subString) {\n result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));\n });\n return result;\n});\n\nmodule.exports = stringToPath;\n","var Symbol = require('./_Symbol'),\n arrayMap = require('./_arrayMap'),\n isArray = require('./isArray'),\n isSymbol = require('./isSymbol');\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolToString = symbolProto ? symbolProto.toString : undefined;\n\n/**\n * The base implementation of `_.toString` which doesn't convert nullish\n * values to empty strings.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n */\nfunction baseToString(value) {\n // Exit early for strings to avoid a performance hit in some environments.\n if (typeof value == 'string') {\n return value;\n }\n if (isArray(value)) {\n // Recursively convert values (susceptible to call stack limits).\n return arrayMap(value, baseToString) + '';\n }\n if (isSymbol(value)) {\n return symbolToString ? symbolToString.call(value) : '';\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\nmodule.exports = baseToString;\n","var baseToString = require('./_baseToString');\n\n/**\n * Converts `value` to a string. An empty string is returned for `null`\n * and `undefined` values. The sign of `-0` is preserved.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n * @example\n *\n * _.toString(null);\n * // => ''\n *\n * _.toString(-0);\n * // => '-0'\n *\n * _.toString([1, 2, 3]);\n * // => '1,2,3'\n */\nfunction toString(value) {\n return value == null ? '' : baseToString(value);\n}\n\nmodule.exports = toString;\n","var isArray = require('./isArray'),\n isKey = require('./_isKey'),\n stringToPath = require('./_stringToPath'),\n toString = require('./toString');\n\n/**\n * Casts `value` to a path array if it's not one.\n *\n * @private\n * @param {*} value The value to inspect.\n * @param {Object} [object] The object to query keys on.\n * @returns {Array} Returns the cast property path array.\n */\nfunction castPath(value, object) {\n if (isArray(value)) {\n return value;\n }\n return isKey(value, object) ? [value] : stringToPath(toString(value));\n}\n\nmodule.exports = castPath;\n","var isSymbol = require('./isSymbol');\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/**\n * Converts `value` to a string key if it's not a string or symbol.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {string|symbol} Returns the key.\n */\nfunction toKey(value) {\n if (typeof value == 'string' || isSymbol(value)) {\n return value;\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\nmodule.exports = toKey;\n","var castPath = require('./_castPath'),\n toKey = require('./_toKey');\n\n/**\n * The base implementation of `_.get` without support for default values.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @returns {*} Returns the resolved value.\n */\nfunction baseGet(object, path) {\n path = castPath(path, object);\n\n var index = 0,\n length = path.length;\n\n while (object != null && index < length) {\n object = object[toKey(path[index++])];\n }\n return (index && index == length) ? object : undefined;\n}\n\nmodule.exports = baseGet;\n","var Stack = require('./_Stack'),\n baseIsEqual = require('./_baseIsEqual');\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/**\n * The base implementation of `_.isMatch` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property values to match.\n * @param {Array} matchData The property names, values, and compare flags to match.\n * @param {Function} [customizer] The function to customize comparisons.\n * @returns {boolean} Returns `true` if `object` is a match, else `false`.\n */\nfunction baseIsMatch(object, source, matchData, customizer) {\n var index = matchData.length,\n length = index,\n noCustomizer = !customizer;\n\n if (object == null) {\n return !length;\n }\n object = Object(object);\n while (index--) {\n var data = matchData[index];\n if ((noCustomizer && data[2])\n ? data[1] !== object[data[0]]\n : !(data[0] in object)\n ) {\n return false;\n }\n }\n while (++index < length) {\n data = matchData[index];\n var key = data[0],\n objValue = object[key],\n srcValue = data[1];\n\n if (noCustomizer && data[2]) {\n if (objValue === undefined && !(key in object)) {\n return false;\n }\n } else {\n var stack = new Stack;\n if (customizer) {\n var result = customizer(objValue, srcValue, key, object, source, stack);\n }\n if (!(result === undefined\n ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)\n : result\n )) {\n return false;\n }\n }\n }\n return true;\n}\n\nmodule.exports = baseIsMatch;\n","var isObject = require('./isObject');\n\n/**\n * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` if suitable for strict\n * equality comparisons, else `false`.\n */\nfunction isStrictComparable(value) {\n return value === value && !isObject(value);\n}\n\nmodule.exports = isStrictComparable;\n","var isStrictComparable = require('./_isStrictComparable'),\n keys = require('./keys');\n\n/**\n * Gets the property names, values, and compare flags of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the match data of `object`.\n */\nfunction getMatchData(object) {\n var result = keys(object),\n length = result.length;\n\n while (length--) {\n var key = result[length],\n value = object[key];\n\n result[length] = [key, value, isStrictComparable(value)];\n }\n return result;\n}\n\nmodule.exports = getMatchData;\n","/**\n * A specialized version of `matchesProperty` for source values suitable\n * for strict equality comparisons, i.e. `===`.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new spec function.\n */\nfunction matchesStrictComparable(key, srcValue) {\n return function(object) {\n if (object == null) {\n return false;\n }\n return object[key] === srcValue &&\n (srcValue !== undefined || (key in Object(object)));\n };\n}\n\nmodule.exports = matchesStrictComparable;\n","var baseIsMatch = require('./_baseIsMatch'),\n getMatchData = require('./_getMatchData'),\n matchesStrictComparable = require('./_matchesStrictComparable');\n\n/**\n * The base implementation of `_.matches` which doesn't clone `source`.\n *\n * @private\n * @param {Object} source The object of property values to match.\n * @returns {Function} Returns the new spec function.\n */\nfunction baseMatches(source) {\n var matchData = getMatchData(source);\n if (matchData.length == 1 && matchData[0][2]) {\n return matchesStrictComparable(matchData[0][0], matchData[0][1]);\n }\n return function(object) {\n return object === source || baseIsMatch(object, source, matchData);\n };\n}\n\nmodule.exports = baseMatches;\n","var baseGet = require('./_baseGet');\n\n/**\n * Gets the value at `path` of `object`. If the resolved value is\n * `undefined`, the `defaultValue` is returned in its place.\n *\n * @static\n * @memberOf _\n * @since 3.7.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @param {*} [defaultValue] The value returned for `undefined` resolved values.\n * @returns {*} Returns the resolved value.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.get(object, 'a[0].b.c');\n * // => 3\n *\n * _.get(object, ['a', '0', 'b', 'c']);\n * // => 3\n *\n * _.get(object, 'a.b.c', 'default');\n * // => 'default'\n */\nfunction get(object, path, defaultValue) {\n var result = object == null ? undefined : baseGet(object, path);\n return result === undefined ? defaultValue : result;\n}\n\nmodule.exports = get;\n","/**\n * The base implementation of `_.hasIn` without support for deep paths.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {Array|string} key The key to check.\n * @returns {boolean} Returns `true` if `key` exists, else `false`.\n */\nfunction baseHasIn(object, key) {\n return object != null && key in Object(object);\n}\n\nmodule.exports = baseHasIn;\n","var castPath = require('./_castPath'),\n isArguments = require('./isArguments'),\n isArray = require('./isArray'),\n isIndex = require('./_isIndex'),\n isLength = require('./isLength'),\n toKey = require('./_toKey');\n\n/**\n * Checks if `path` exists on `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @param {Function} hasFunc The function to check properties.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n */\nfunction hasPath(object, path, hasFunc) {\n path = castPath(path, object);\n\n var index = -1,\n length = path.length,\n result = false;\n\n while (++index < length) {\n var key = toKey(path[index]);\n if (!(result = object != null && hasFunc(object, key))) {\n break;\n }\n object = object[key];\n }\n if (result || ++index != length) {\n return result;\n }\n length = object == null ? 0 : object.length;\n return !!length && isLength(length) && isIndex(key, length) &&\n (isArray(object) || isArguments(object));\n}\n\nmodule.exports = hasPath;\n","var baseHasIn = require('./_baseHasIn'),\n hasPath = require('./_hasPath');\n\n/**\n * Checks if `path` is a direct or inherited property of `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n * @example\n *\n * var object = _.create({ 'a': _.create({ 'b': 2 }) });\n *\n * _.hasIn(object, 'a');\n * // => true\n *\n * _.hasIn(object, 'a.b');\n * // => true\n *\n * _.hasIn(object, ['a', 'b']);\n * // => true\n *\n * _.hasIn(object, 'b');\n * // => false\n */\nfunction hasIn(object, path) {\n return object != null && hasPath(object, path, baseHasIn);\n}\n\nmodule.exports = hasIn;\n","var baseIsEqual = require('./_baseIsEqual'),\n get = require('./get'),\n hasIn = require('./hasIn'),\n isKey = require('./_isKey'),\n isStrictComparable = require('./_isStrictComparable'),\n matchesStrictComparable = require('./_matchesStrictComparable'),\n toKey = require('./_toKey');\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/**\n * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.\n *\n * @private\n * @param {string} path The path of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new spec function.\n */\nfunction baseMatchesProperty(path, srcValue) {\n if (isKey(path) && isStrictComparable(srcValue)) {\n return matchesStrictComparable(toKey(path), srcValue);\n }\n return function(object) {\n var objValue = get(object, path);\n return (objValue === undefined && objValue === srcValue)\n ? hasIn(object, path)\n : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);\n };\n}\n\nmodule.exports = baseMatchesProperty;\n","/**\n * This method returns the first argument it receives.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {*} value Any value.\n * @returns {*} Returns `value`.\n * @example\n *\n * var object = { 'a': 1 };\n *\n * console.log(_.identity(object) === object);\n * // => true\n */\nfunction identity(value) {\n return value;\n}\n\nmodule.exports = identity;\n","/**\n * The base implementation of `_.property` without support for deep paths.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @returns {Function} Returns the new accessor function.\n */\nfunction baseProperty(key) {\n return function(object) {\n return object == null ? undefined : object[key];\n };\n}\n\nmodule.exports = baseProperty;\n","var baseGet = require('./_baseGet');\n\n/**\n * A specialized version of `baseProperty` which supports deep paths.\n *\n * @private\n * @param {Array|string} path The path of the property to get.\n * @returns {Function} Returns the new accessor function.\n */\nfunction basePropertyDeep(path) {\n return function(object) {\n return baseGet(object, path);\n };\n}\n\nmodule.exports = basePropertyDeep;\n","var baseProperty = require('./_baseProperty'),\n basePropertyDeep = require('./_basePropertyDeep'),\n isKey = require('./_isKey'),\n toKey = require('./_toKey');\n\n/**\n * Creates a function that returns the value at `path` of a given object.\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Util\n * @param {Array|string} path The path of the property to get.\n * @returns {Function} Returns the new accessor function.\n * @example\n *\n * var objects = [\n * { 'a': { 'b': 2 } },\n * { 'a': { 'b': 1 } }\n * ];\n *\n * _.map(objects, _.property('a.b'));\n * // => [2, 1]\n *\n * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');\n * // => [1, 2]\n */\nfunction property(path) {\n return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);\n}\n\nmodule.exports = property;\n","var baseMatches = require('./_baseMatches'),\n baseMatchesProperty = require('./_baseMatchesProperty'),\n identity = require('./identity'),\n isArray = require('./isArray'),\n property = require('./property');\n\n/**\n * The base implementation of `_.iteratee`.\n *\n * @private\n * @param {*} [value=_.identity] The value to convert to an iteratee.\n * @returns {Function} Returns the iteratee.\n */\nfunction baseIteratee(value) {\n // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.\n // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.\n if (typeof value == 'function') {\n return value;\n }\n if (value == null) {\n return identity;\n }\n if (typeof value == 'object') {\n return isArray(value)\n ? baseMatchesProperty(value[0], value[1])\n : baseMatches(value);\n }\n return property(value);\n}\n\nmodule.exports = baseIteratee;\n","/**\n * Creates a base function for methods like `_.forIn` and `_.forOwn`.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\nfunction createBaseFor(fromRight) {\n return function(object, iteratee, keysFunc) {\n var index = -1,\n iterable = Object(object),\n props = keysFunc(object),\n length = props.length;\n\n while (length--) {\n var key = props[fromRight ? length : ++index];\n if (iteratee(iterable[key], key, iterable) === false) {\n break;\n }\n }\n return object;\n };\n}\n\nmodule.exports = createBaseFor;\n","var createBaseFor = require('./_createBaseFor');\n\n/**\n * The base implementation of `baseForOwn` which iterates over `object`\n * properties returned by `keysFunc` and invokes `iteratee` for each property.\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @returns {Object} Returns `object`.\n */\nvar baseFor = createBaseFor();\n\nmodule.exports = baseFor;\n","var baseFor = require('./_baseFor'),\n keys = require('./keys');\n\n/**\n * The base implementation of `_.forOwn` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Object} Returns `object`.\n */\nfunction baseForOwn(object, iteratee) {\n return object && baseFor(object, iteratee, keys);\n}\n\nmodule.exports = baseForOwn;\n","var isArrayLike = require('./isArrayLike');\n\n/**\n * Creates a `baseEach` or `baseEachRight` function.\n *\n * @private\n * @param {Function} eachFunc The function to iterate over a collection.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\nfunction createBaseEach(eachFunc, fromRight) {\n return function(collection, iteratee) {\n if (collection == null) {\n return collection;\n }\n if (!isArrayLike(collection)) {\n return eachFunc(collection, iteratee);\n }\n var length = collection.length,\n index = fromRight ? length : -1,\n iterable = Object(collection);\n\n while ((fromRight ? index-- : ++index < length)) {\n if (iteratee(iterable[index], index, iterable) === false) {\n break;\n }\n }\n return collection;\n };\n}\n\nmodule.exports = createBaseEach;\n","var baseForOwn = require('./_baseForOwn'),\n createBaseEach = require('./_createBaseEach');\n\n/**\n * The base implementation of `_.forEach` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n */\nvar baseEach = createBaseEach(baseForOwn);\n\nmodule.exports = baseEach;\n","var baseEach = require('./_baseEach'),\n isArrayLike = require('./isArrayLike');\n\n/**\n * The base implementation of `_.map` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\nfunction baseMap(collection, iteratee) {\n var index = -1,\n result = isArrayLike(collection) ? Array(collection.length) : [];\n\n baseEach(collection, function(value, key, collection) {\n result[++index] = iteratee(value, key, collection);\n });\n return result;\n}\n\nmodule.exports = baseMap;\n","/**\n * The base implementation of `_.sortBy` which uses `comparer` to define the\n * sort order of `array` and replaces criteria objects with their corresponding\n * values.\n *\n * @private\n * @param {Array} array The array to sort.\n * @param {Function} comparer The function to define sort order.\n * @returns {Array} Returns `array`.\n */\nfunction baseSortBy(array, comparer) {\n var length = array.length;\n\n array.sort(comparer);\n while (length--) {\n array[length] = array[length].value;\n }\n return array;\n}\n\nmodule.exports = baseSortBy;\n","var isSymbol = require('./isSymbol');\n\n/**\n * Compares values to sort them in ascending order.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {number} Returns the sort order indicator for `value`.\n */\nfunction compareAscending(value, other) {\n if (value !== other) {\n var valIsDefined = value !== undefined,\n valIsNull = value === null,\n valIsReflexive = value === value,\n valIsSymbol = isSymbol(value);\n\n var othIsDefined = other !== undefined,\n othIsNull = other === null,\n othIsReflexive = other === other,\n othIsSymbol = isSymbol(other);\n\n if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||\n (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||\n (valIsNull && othIsDefined && othIsReflexive) ||\n (!valIsDefined && othIsReflexive) ||\n !valIsReflexive) {\n return 1;\n }\n if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||\n (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||\n (othIsNull && valIsDefined && valIsReflexive) ||\n (!othIsDefined && valIsReflexive) ||\n !othIsReflexive) {\n return -1;\n }\n }\n return 0;\n}\n\nmodule.exports = compareAscending;\n","var compareAscending = require('./_compareAscending');\n\n/**\n * Used by `_.orderBy` to compare multiple properties of a value to another\n * and stable sort them.\n *\n * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,\n * specify an order of \"desc\" for descending or \"asc\" for ascending sort order\n * of corresponding values.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {boolean[]|string[]} orders The order to sort by for each property.\n * @returns {number} Returns the sort order indicator for `object`.\n */\nfunction compareMultiple(object, other, orders) {\n var index = -1,\n objCriteria = object.criteria,\n othCriteria = other.criteria,\n length = objCriteria.length,\n ordersLength = orders.length;\n\n while (++index < length) {\n var result = compareAscending(objCriteria[index], othCriteria[index]);\n if (result) {\n if (index >= ordersLength) {\n return result;\n }\n var order = orders[index];\n return result * (order == 'desc' ? -1 : 1);\n }\n }\n // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications\n // that causes it, under certain circumstances, to provide the same value for\n // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247\n // for more details.\n //\n // This also ensures a stable sort in V8 and other engines.\n // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.\n return object.index - other.index;\n}\n\nmodule.exports = compareMultiple;\n","var arrayMap = require('./_arrayMap'),\n baseGet = require('./_baseGet'),\n baseIteratee = require('./_baseIteratee'),\n baseMap = require('./_baseMap'),\n baseSortBy = require('./_baseSortBy'),\n baseUnary = require('./_baseUnary'),\n compareMultiple = require('./_compareMultiple'),\n identity = require('./identity'),\n isArray = require('./isArray');\n\n/**\n * The base implementation of `_.orderBy` without param guards.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.\n * @param {string[]} orders The sort orders of `iteratees`.\n * @returns {Array} Returns the new sorted array.\n */\nfunction baseOrderBy(collection, iteratees, orders) {\n if (iteratees.length) {\n iteratees = arrayMap(iteratees, function(iteratee) {\n if (isArray(iteratee)) {\n return function(value) {\n return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);\n }\n }\n return iteratee;\n });\n } else {\n iteratees = [identity];\n }\n\n var index = -1;\n iteratees = arrayMap(iteratees, baseUnary(baseIteratee));\n\n var result = baseMap(collection, function(value, key, collection) {\n var criteria = arrayMap(iteratees, function(iteratee) {\n return iteratee(value);\n });\n return { 'criteria': criteria, 'index': ++index, 'value': value };\n });\n\n return baseSortBy(result, function(object, other) {\n return compareMultiple(object, other, orders);\n });\n}\n\nmodule.exports = baseOrderBy;\n","/**\n * A faster alternative to `Function#apply`, this function invokes `func`\n * with the `this` binding of `thisArg` and the arguments of `args`.\n *\n * @private\n * @param {Function} func The function to invoke.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {Array} args The arguments to invoke `func` with.\n * @returns {*} Returns the result of `func`.\n */\nfunction apply(func, thisArg, args) {\n switch (args.length) {\n case 0: return func.call(thisArg);\n case 1: return func.call(thisArg, args[0]);\n case 2: return func.call(thisArg, args[0], args[1]);\n case 3: return func.call(thisArg, args[0], args[1], args[2]);\n }\n return func.apply(thisArg, args);\n}\n\nmodule.exports = apply;\n","var apply = require('./_apply');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max;\n\n/**\n * A specialized version of `baseRest` which transforms the rest array.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @param {Function} transform The rest array transform.\n * @returns {Function} Returns the new function.\n */\nfunction overRest(func, start, transform) {\n start = nativeMax(start === undefined ? (func.length - 1) : start, 0);\n return function() {\n var args = arguments,\n index = -1,\n length = nativeMax(args.length - start, 0),\n array = Array(length);\n\n while (++index < length) {\n array[index] = args[start + index];\n }\n index = -1;\n var otherArgs = Array(start + 1);\n while (++index < start) {\n otherArgs[index] = args[index];\n }\n otherArgs[start] = transform(array);\n return apply(func, this, otherArgs);\n };\n}\n\nmodule.exports = overRest;\n","/**\n * Creates a function that returns `value`.\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Util\n * @param {*} value The value to return from the new function.\n * @returns {Function} Returns the new constant function.\n * @example\n *\n * var objects = _.times(2, _.constant({ 'a': 1 }));\n *\n * console.log(objects);\n * // => [{ 'a': 1 }, { 'a': 1 }]\n *\n * console.log(objects[0] === objects[1]);\n * // => true\n */\nfunction constant(value) {\n return function() {\n return value;\n };\n}\n\nmodule.exports = constant;\n","var getNative = require('./_getNative');\n\nvar defineProperty = (function() {\n try {\n var func = getNative(Object, 'defineProperty');\n func({}, '', {});\n return func;\n } catch (e) {}\n}());\n\nmodule.exports = defineProperty;\n","var constant = require('./constant'),\n defineProperty = require('./_defineProperty'),\n identity = require('./identity');\n\n/**\n * The base implementation of `setToString` without support for hot loop shorting.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\nvar baseSetToString = !defineProperty ? identity : function(func, string) {\n return defineProperty(func, 'toString', {\n 'configurable': true,\n 'enumerable': false,\n 'value': constant(string),\n 'writable': true\n });\n};\n\nmodule.exports = baseSetToString;\n","/** Used to detect hot functions by number of calls within a span of milliseconds. */\nvar HOT_COUNT = 800,\n HOT_SPAN = 16;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeNow = Date.now;\n\n/**\n * Creates a function that'll short out and invoke `identity` instead\n * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`\n * milliseconds.\n *\n * @private\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new shortable function.\n */\nfunction shortOut(func) {\n var count = 0,\n lastCalled = 0;\n\n return function() {\n var stamp = nativeNow(),\n remaining = HOT_SPAN - (stamp - lastCalled);\n\n lastCalled = stamp;\n if (remaining > 0) {\n if (++count >= HOT_COUNT) {\n return arguments[0];\n }\n } else {\n count = 0;\n }\n return func.apply(undefined, arguments);\n };\n}\n\nmodule.exports = shortOut;\n","var baseSetToString = require('./_baseSetToString'),\n shortOut = require('./_shortOut');\n\n/**\n * Sets the `toString` method of `func` to return `string`.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\nvar setToString = shortOut(baseSetToString);\n\nmodule.exports = setToString;\n","var identity = require('./identity'),\n overRest = require('./_overRest'),\n setToString = require('./_setToString');\n\n/**\n * The base implementation of `_.rest` which doesn't validate or coerce arguments.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @returns {Function} Returns the new function.\n */\nfunction baseRest(func, start) {\n return setToString(overRest(func, start, identity), func + '');\n}\n\nmodule.exports = baseRest;\n","var eq = require('./eq'),\n isArrayLike = require('./isArrayLike'),\n isIndex = require('./_isIndex'),\n isObject = require('./isObject');\n\n/**\n * Checks if the given arguments are from an iteratee call.\n *\n * @private\n * @param {*} value The potential iteratee value argument.\n * @param {*} index The potential iteratee index or key argument.\n * @param {*} object The potential iteratee object argument.\n * @returns {boolean} Returns `true` if the arguments are from an iteratee call,\n * else `false`.\n */\nfunction isIterateeCall(value, index, object) {\n if (!isObject(object)) {\n return false;\n }\n var type = typeof index;\n if (type == 'number'\n ? (isArrayLike(object) && isIndex(index, object.length))\n : (type == 'string' && index in object)\n ) {\n return eq(object[index], value);\n }\n return false;\n}\n\nmodule.exports = isIterateeCall;\n","var baseFlatten = require('./_baseFlatten'),\n baseOrderBy = require('./_baseOrderBy'),\n baseRest = require('./_baseRest'),\n isIterateeCall = require('./_isIterateeCall');\n\n/**\n * Creates an array of elements, sorted in ascending order by the results of\n * running each element in a collection thru each iteratee. This method\n * performs a stable sort, that is, it preserves the original sort order of\n * equal elements. The iteratees are invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {...(Function|Function[])} [iteratees=[_.identity]]\n * The iteratees to sort by.\n * @returns {Array} Returns the new sorted array.\n * @example\n *\n * var users = [\n * { 'user': 'fred', 'age': 48 },\n * { 'user': 'barney', 'age': 36 },\n * { 'user': 'fred', 'age': 30 },\n * { 'user': 'barney', 'age': 34 }\n * ];\n *\n * _.sortBy(users, [function(o) { return o.user; }]);\n * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]]\n *\n * _.sortBy(users, ['user', 'age']);\n * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]]\n */\nvar sortBy = baseRest(function(collection, iteratees) {\n if (collection == null) {\n return [];\n }\n var length = iteratees.length;\n if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {\n iteratees = [];\n } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {\n iteratees = [iteratees[0]];\n }\n return baseOrderBy(collection, baseFlatten(iteratees, 1), []);\n});\n\nmodule.exports = sortBy;\n","'use strict';\n\nimport isEqual from 'lodash/isEqual';\nimport sortBy from 'lodash/sortBy';\nimport {Node, NodeList} from '@linkurious/ogma';\nimport {CurrencyFormat, ICurrencyOptions, LkNodeData, LkProperty} from '@linkurious/rest-client';\n\nexport {sortBy};\nconst IMAGE_PATTERN = /\\S+\\.(gif|jpe?g|tiff|png|bmp|svg)$/i;\nexport const CAPTION_HEURISTIC: string[] = [\n 'label',\n 'Label',\n 'name',\n 'Name',\n 'title',\n 'Title',\n 'rdfs:label'\n];\n\nexport class Tools {\n public static isEqual(v1: unknown, v2: unknown): boolean {\n return isEqual(v1, v2);\n }\n\n /**\n * Check that a value is defined : not null and not undefined\n *\n * @param {any} value\n * @return {boolean}\n */\n public static isDefined<T>(value: T): value is NonNullable<T> {\n return value !== undefined && value !== null;\n }\n\n /**\n * Truncate a text\n */\n public static truncate(value: unknown, position: 'middle' | 'end', limit = 0): string {\n const suffix = '\\u2026';\n if (!Tools.isDefined(value)) {\n return ``;\n }\n const valueToTruncate = `${value}`;\n if (valueToTruncate.length <= limit + 1) {\n return valueToTruncate;\n }\n const fixedLimit = limit - 1;\n switch (position) {\n case 'middle':\n return (\n valueToTruncate.substring(0, Math.ceil(fixedLimit / 2)) +\n suffix +\n valueToTruncate.substring(valueToTruncate.length - Math.floor(fixedLimit / 2))\n );\n\n case 'end':\n return valueToTruncate.substring(0, fixedLimit) + suffix;\n }\n }\n\n /**\n * Return a value from a nested object depending on a keyPath\n */\n public static getIn(ref: any, path: Array<string | number>): any {\n return path.reduce((p, c) => (p && p[c] !== undefined ? p[c] : undefined), ref);\n }\n\n /**\n * Return a clone of an object\n */\n public static clone(o: any) {\n return typeof o === 'object'\n ? JSON.parse(\n JSON.stringify(o, (k, v) => {\n return v instanceof Set ? {} : v;\n })\n )\n : o;\n }\n\n /**\n * Get the amount of hidden neighbors from a list of nodes\n *\n * @param nodes\n */\n public static getHiddenNeighbors(nodes: NodeList<LkNodeData>): number {\n return nodes.reduce((result: number, node: Node<LkNodeData>) => {\n const statistics = node.getData('statistics');\n if (statistics !== undefined) {\n const hiddenNeighbors =\n statistics.degree !== undefined && !statistics.supernode\n ? statistics.degree - Tools.getDegreeWithoutSelfConnection(node)\n : statistics.supernodeDegree;\n if (hiddenNeighbors !== undefined && hiddenNeighbors > 0) {\n return (result += hiddenNeighbors);\n }\n }\n return result;\n }, 0);\n }\n\n /**\n * Return the visible degree of a node without self connection (self edge)\n *\n * @param {Node} node\n * @return {number}\n */\n public static getDegreeWithoutSelfConnection(node: Node<LkNodeData>): number {\n return node.getAdjacentNodes({policy: 'exclude-sources', filter: 'raw'}).size;\n }\n\n /**\n * Return a formatted version of a number\n */\n public static formatNumber(number: number): string {\n let div = 1;\n let suffix = '';\n const sign = number < 0 ? '-' : '';\n number = Math.abs(number);\n\n if (number >= 1000000) {\n div = 1000000;\n suffix = 'M';\n } else if (number >= 1000) {\n div = 1000;\n suffix = 'k';\n }\n const nn = number / div;\n // if there is a decimal value and nn < 10\n if (nn < 10 && nn % 1 !== 0) {\n return sign + nn.toFixed(1) + suffix;\n } else {\n return sign + Math.floor(nn) + suffix;\n }\n }\n\n /**\n * Return true if a string is not composed only by invisible char\n *\n * @param {string} value\n * @return {boolean}\n */\n public static isStringFilled(value: string): boolean {\n return value.trim() !== '';\n }\n\n public static getValueFromLkProperty(property: LkProperty): null | string | number | boolean {\n if (typeof property === 'object' && 'type' in property) {\n if (!('original' in property) && !('value' in property)) {\n return null;\n }\n if ('original' in property) {\n return `${property.original}`;\n }\n if ('value' in property) {\n return Tools.formatDate(\n new Date(\n new Date(property.value).getTime() + Tools.timezoneToMilliseconds(property.timezone)\n ).toISOString()\n );\n }\n }\n return property;\n }\n\n /**\n * Return a formatted date as a string\n */\n public static formatDate(\n isoString: string,\n isDatetime?: boolean,\n timezone?: number\n ): string | null {\n // The date received from the server will be always in seconds\n let offsetDate: string | number = isoString;\n if (timezone !== undefined) {\n offsetDate = new Date(isoString).getTime() + timezone * 1000;\n }\n const dateObject = new Date(offsetDate);\n\n if (isNaN(dateObject.getUTCFullYear())) {\n return null;\n }\n let formattedDate =\n dateObject.getFullYear() +\n '-' +\n ((dateObject.getUTCMonth() + 1).toString().length === 1\n ? '0' + (dateObject.getUTCMonth() + 1)\n : dateObject.getUTCMonth() + 1) +\n '-' +\n (dateObject.getUTCDate().toString().length === 1\n ? '0' + dateObject.getUTCDate()\n : dateObject.getUTCDate());\n\n if (isDatetime) {\n formattedDate +=\n ' ' +\n (dateObject.getUTCHours().toString().length === 1\n ? '0' + dateObject.getUTCHours()\n : dateObject.getUTCHours()) +\n ':' +\n (dateObject.getUTCMinutes().toString().length === 1\n ? '0' + dateObject.getUTCMinutes()\n : dateObject.getUTCMinutes()) +\n ':' +\n (dateObject.getUTCSeconds().toString().length === 1\n ? '0' + dateObject.getUTCSeconds()\n : dateObject.getUTCSeconds());\n }\n return formattedDate;\n }\n\n /**\n * From \"+03:00\" return the offset in milliseconds\n * @param timezone\n */\n public static timezoneToMilliseconds(timezone: string | undefined): number {\n if (timezone === undefined) {\n return 0;\n }\n if (timezone === 'Z') {\n return 0;\n }\n const sign = timezone[0];\n const [hours, minutes] = timezone.slice(1).split(':');\n return sign === '+'\n ? this.sanitizeFormattedNumber(hours) * 3.6e6 + this.sanitizeFormattedNumber(minutes) * 60000\n : (this.sanitizeFormattedNumber(hours) * 3.6e6 +\n this.sanitizeFormattedNumber(minutes) * 60000) *\n -1;\n }\n\n public static sanitizeFormattedNumber(str: string): number {\n if (str.length === 2 && str.startsWith('0')) {\n return Tools.parseNumber(str[1]);\n }\n return Tools.parseNumber(str);\n }\n\n /**\n * Return true if `n` is (or can be parsed as) a float, but is NOT an integer\n *\n * @param {any} n\n * @return {number} a number (NaN is `n` cannot be parsed as a number)\n */\n public static parseNumber(n: unknown): number {\n // string: try to parse as number (allow ',' as decimal separator)\n if (typeof n === 'string') {\n // prevent the empty string to be parsed as 0\n if (n.trim() === '') {\n return Number.NaN;\n }\n\n n = +n.replace(',', '.').replace(' ', '');\n }\n\n // (the string could not be parsed) OR (it was neither string nor number)\n if (typeof n !== 'number') {\n return Number.NaN;\n }\n\n // false for NaN, +Infinity, -Infinity\n if (!isFinite(n)) {\n return Number.NaN;\n }\n\n return n;\n }\n\n /**\n * Return an Array without duplicated keys\n *\n * @param {Array<any>} arr\n * @param {string} key\n * @return {Array<any>}\n */\n public static uniqBy(arr: Array<any>, key?: string): Array<any> {\n const seen = new Set();\n if (key) {\n const result = [];\n for (let i = 0; i < arr.length; ++i) {\n if (arr[i] && arr[i][key] && !seen.has(arr[i][key])) {\n seen.add(arr[i][key]);\n result.push(arr[i]);\n } else if (!arr[i][key]) {\n result.push(arr[i]);\n }\n }\n return result;\n }\n return typeof arr[0] === 'object'\n ? Array.from(new Set(arr.map((v) => JSON.stringify(v)))).map((v) => JSON.parse(v))\n : Array.from(new Set(arr));\n }\n\n /**\n * Return 'image' or 'url' depending on the given string\n *\n * @param {string} value\n * @return {\"image\" | \"url\"}\n */\n public static getType(value: string): 'image' | 'url' | 'imageUrl' | undefined {\n if (Tools.isURLImage(value)) {\n return 'imageUrl';\n }\n\n if (Tools.isImage(value)) {\n return 'image';\n }\n\n if (Tools.isUrl(value)) {\n return 'url';\n }\n\n return undefined;\n }\n\n /**\n * Return true if the given string is an url that match the schema handled by LKE\n *\n * @param {string} value\n * @return {boolean}\n */\n private static isUrl(value: string): boolean {\n try {\n new URL(value);\n return true;\n } catch (e) {\n return false;\n }\n }\n\n /**\n * Return true if the given string is an image extension\n *\n * @param {string} value\n * @return {boolean}\n */\n private static isImage(value: string): boolean {\n return IMAGE_PATTERN.test(value);\n }\n\n /**\n * Return true if the given string is an url with an image extension\n *\n * @param {string} value\n * @return {boolean}\n */\n private static isURLImage(value: string): boolean {\n if (Tools.isUrl(value)) {\n const url = new URL(value);\n return Tools.isImage(url.pathname);\n }\n return false;\n }\n\n /**\n * Return true if a value is not undefined, not null and not an empty string\n */\n public static valueExists(value: LkProperty): boolean {\n return Tools.isDefined(value) && (typeof value !== 'string' || Tools.isStringFilled(value));\n }\n\n /**\n * Return true if `n` is (or can be parsed as) a number\n */\n public static isNumber(n: unknown): boolean {\n n = Tools.parseNumber(n);\n return Tools.isDefined(n) && n === n;\n }\n\n /**\n * return the correct property value\n */\n public static getPropertyValue(\n property: LkProperty,\n invalidAsString?: boolean,\n formattedDates?: boolean\n ): undefined | null | string | number | boolean | Array<string> {\n if (typeof property === 'object' && !Array.isArray(property)) {\n if (!('status' in property)) {\n if ((property.type === 'date' || property.type === 'datetime') && formattedDates) {\n return Tools.formatDate(property.value, property.type === 'datetime');\n } else if (property.type === 'date' || property.type === 'datetime') {\n return new Date(property.value).getTime();\n }\n } else if (invalidAsString) {\n return 'original' in property ? property.original : undefined;\n } else {\n return undefined;\n }\n }\n return property;\n }\n\n /**\n * Parse the given value and return a float number or NaN\n *\n * @param {any} n\n * @return {number}\n */\n public static parseFloat(n: unknown): number {\n return Tools.parseNumber(n);\n }\n\n /**\n * Format a currency value to string.\n *\n * eg: 4123 -> 4.123,00 $\n */\n public static formatCurrencyValue(value: number, options: ICurrencyOptions): string {\n const sign = value < 0 ? '- ' : '';\n switch (options.format) {\n case CurrencyFormat.SYMBOL_COMMAS_DOT:\n return `${sign}${\n options.symbol !== undefined ? options.symbol + ' ' : ''\n }${Tools.formatNumberToCurrency(value, ',', '.')}`;\n\n case CurrencyFormat.SYMBOL_COMMAS:\n return `${sign}${\n options.symbol !== undefined ? options.symbol + ' ' : ''\n }${Tools.formatNumberToCurrency(value, ',')}`;\n\n case CurrencyFormat.DOTS_COMMA_SYMBOL:\n return `${sign}${Tools.formatNumberToCurrency(value, '.', ',')}${\n options.symbol !== undefined ? ' ' + options.symbol : ''\n }`;\n\n case CurrencyFormat.DOTS_SYMBOL:\n return `${sign}${Tools.formatNumberToCurrency(value, '.')}${\n options.symbol !== undefined ? ' ' + options.symbol : ''\n }`;\n\n case CurrencyFormat.SPACES_COMMA_SYMBOL:\n return `${sign}${Tools.formatNumberToCurrency(value, ' ', ',')}${\n options.symbol !== undefined ? ' ' + options.symbol : ''\n }`;\n\n case CurrencyFormat.SPACES_SYMBOL:\n return `${sign}${Tools.formatNumberToCurrency(value, ' ')}${\n options.symbol !== undefined ? ' ' + options.symbol : ''\n }`;\n\n default:\n throw Error(`Cannot format property value ${value}, unknown format ${options.format}.`);\n }\n }\n\n private static formatNumberToCurrency(\n value: number,\n thousandSeparator: string,\n decimalSeparator?: string\n ): string {\n if (!Number.isFinite(value)) {\n return value.toString();\n }\n\n const [integerPart, fractionalPart] = decimalSeparator\n ? Math.abs(value).toFixed(2).split('.')\n : [Math.abs(value).toFixed(0), undefined];\n\n let i = -1;\n const formattedIntegerPart = integerPart\n .split('')\n .reverse()\n .map((digit) => {\n i++;\n return i > 0 && i % 3 === 0 ? digit + thousandSeparator : digit;\n })\n .reverse()\n .join('');\n\n return decimalSeparator\n ? formattedIntegerPart + decimalSeparator + fractionalPart\n : formattedIntegerPart;\n }\n}\n","'use strict';\n\nimport {\n GraphSchemaTypeWithAccess,\n ICaptionConfig,\n ItemFieldsCaptions,\n LkEdgeData,\n LkNodeData,\n LkProperty,\n PropertyType,\n PropertyTypeName,\n GraphSchemaPropertyWithAccess\n} from '@linkurious/rest-client';\n\nimport {CAPTION_HEURISTIC, Tools} from '../tools/tools';\n\nexport class Captions {\n /**\n * Return label for each node\n */\n public static getText(\n itemData: LkNodeData | LkEdgeData,\n schema: ItemFieldsCaptions,\n graphSchema?: GraphSchemaTypeWithAccess[]\n ): string | null {\n const types = 'categories' in itemData ? itemData.categories : [itemData.type];\n if (Captions.captionExist(types, schema)) {\n return 'categories' in itemData\n ? Captions.generateNodeCaption(itemData, schema, graphSchema) || null\n : Captions.generateEdgeCaption(itemData, schema, graphSchema) || null;\n }\n if (itemData.properties !== undefined) {\n const heuristicCaptionElement = CAPTION_HEURISTIC.find((value) => {\n return itemData.properties[value] !== undefined;\n });\n if (\n heuristicCaptionElement !== undefined &&\n Tools.isDefined(itemData.properties[heuristicCaptionElement])\n ) {\n return `${Tools.getValueFromLkProperty(\n itemData.properties[heuristicCaptionElement]\n )}`.trim();\n }\n }\n return null;\n }\n\n /**\n * Return a readable string from an LkProperty\n */\n private static getLabel(\n propertyValue: LkProperty,\n propertyType?: PropertyType | undefined\n ): string | null {\n if (typeof propertyValue === 'object' && 'type' in propertyValue) {\n if (!('original' in propertyValue) && !('value' in propertyValue)) {\n return null;\n }\n if ('original' in propertyValue) {\n return `${propertyValue.original}`;\n }\n if ('value' in propertyValue) {\n return Tools.formatDate(\n new Date(\n new Date(propertyValue.value).getTime() +\n Tools.timezoneToMilliseconds(propertyValue.timezone)\n ).toISOString()\n );\n }\n } else if (\n propertyType?.name === PropertyTypeName.NUMBER &&\n propertyType.options !== undefined\n ) {\n return Tools.formatCurrencyValue(propertyValue as number, propertyType.options);\n }\n return `${propertyValue}`.trim();\n }\n\n /**\n * Return true if caption configuration exists in schema\n */\n public static captionExist(itemTypes: Array<string>, schema: ItemFieldsCaptions): boolean {\n return itemTypes.some((type) => Tools.isDefined(schema[type]));\n }\n\n /**\n * Generate text from node data and captions schema\n */\n public static generateNodeCaption(\n itemData: LkNodeData,\n schema: {[key: string]: ICaptionConfig},\n graphSchema?: GraphSchemaTypeWithAccess[]\n ): string {\n const categories = itemData.categories;\n const caption: Array<string | null> = [];\n let captionProps: Array<string | null> = [];\n categories.forEach((category) => {\n if (schema[category] && schema[category].active) {\n if (schema[category].displayName) {\n caption.push(category);\n }\n captionProps = [...captionProps, ...schema[category].properties];\n }\n });\n Tools.uniqBy(captionProps).forEach((propertyKey) => {\n if (itemData.properties[propertyKey] !== undefined) {\n const propertyType = graphSchema\n ? Captions.getPropertyType(graphSchema, propertyKey, categories[0])\n : undefined;\n caption.push(this.getLabel(itemData.properties[propertyKey], propertyType));\n }\n });\n return caption\n .filter((c) => c !== null)\n .join(' - ')\n .trim();\n }\n\n public static getPropertyType(\n graphSchema: GraphSchemaTypeWithAccess[],\n propertyKey: string,\n itemType: string\n ): PropertyType | undefined {\n const typeGraphSchema = graphSchema.find((schemaType) => schemaType.itemType === itemType);\n const property = typeGraphSchema?.properties.find(\n (property) => property.propertyKey === propertyKey\n );\n return (property as unknown as GraphSchemaPropertyWithAccess)?.propertyType;\n }\n\n /**\n * Generate text from edge data and captions schema\n */\n public static generateEdgeCaption(\n itemData: LkEdgeData,\n schema: {[key: string]: ICaptionConfig},\n graphSchema?: GraphSchemaTypeWithAccess[]\n ): string {\n const type = itemData.type;\n const caption: Array<string | null> = [];\n let captionProps: Array<string | null> = [];\n if (schema[type] && schema[type].active) {\n if (schema[type].displayName) {\n caption.push(type);\n }\n captionProps = [...captionProps, ...schema[type].properties];\n Tools.uniqBy(captionProps).forEach((propertyKey) => {\n if (Tools.isDefined(itemData.properties[propertyKey])) {\n const propertyType = graphSchema\n ? Captions.getPropertyType(graphSchema, propertyKey, type)\n : undefined;\n caption.push(Captions.getLabel(itemData.properties[propertyKey], propertyType));\n }\n });\n return caption.join(' - ').trim();\n }\n return '';\n }\n}\n","(function() {\n var base64map\n = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/',\n\n crypt = {\n // Bit-wise rotation left\n rotl: function(n, b) {\n return (n << b) | (n >>> (32 - b));\n },\n\n // Bit-wise rotation right\n rotr: function(n, b) {\n return (n << (32 - b)) | (n >>> b);\n },\n\n // Swap big-endian to little-endian and vice versa\n endian: function(n) {\n // If number given, swap endian\n if (n.constructor == Number) {\n return crypt.rotl(n, 8) & 0x00FF00FF | crypt.rotl(n, 24) & 0xFF00FF00;\n }\n\n // Else, assume array and swap all items\n for (var i = 0; i < n.length; i++)\n n[i] = crypt.endian(n[i]);\n return n;\n },\n\n // Generate an array of any length of random bytes\n randomBytes: function(n) {\n for (var bytes = []; n > 0; n--)\n bytes.push(Math.floor(Math.random() * 256));\n return bytes;\n },\n\n // Convert a byte array to big-endian 32-bit words\n bytesToWords: function(bytes) {\n for (var words = [], i = 0, b = 0; i < bytes.length; i++, b += 8)\n words[b >>> 5] |= bytes[i] << (24 - b % 32);\n return words;\n },\n\n // Convert big-endian 32-bit words to a byte array\n wordsToBytes: function(words) {\n for (var bytes = [], b = 0; b < words.length * 32; b += 8)\n bytes.push((words[b >>> 5] >>> (24 - b % 32)) & 0xFF);\n return bytes;\n },\n\n // Convert a byte array to a hex string\n bytesToHex: function(bytes) {\n for (var hex = [], i = 0; i < bytes.length; i++) {\n hex.push((bytes[i] >>> 4).toString(16));\n hex.push((bytes[i] & 0xF).toString(16));\n }\n return hex.join('');\n },\n\n // Convert a hex string to a byte array\n hexToBytes: function(hex) {\n for (var bytes = [], c = 0; c < hex.length; c += 2)\n bytes.push(parseInt(hex.substr(c, 2), 16));\n return bytes;\n },\n\n // Convert a byte array to a base-64 string\n bytesToBase64: function(bytes) {\n for (var base64 = [], i = 0; i < bytes.length; i += 3) {\n var triplet = (bytes[i] << 16) | (bytes[i + 1] << 8) | bytes[i + 2];\n for (var j = 0; j < 4; j++)\n if (i * 8 + j * 6 <= bytes.length * 8)\n base64.push(base64map.charAt((triplet >>> 6 * (3 - j)) & 0x3F));\n else\n base64.push('=');\n }\n return base64.join('');\n },\n\n // Convert a base-64 string to a byte array\n base64ToBytes: function(base64) {\n // Remove non-base-64 characters\n base64 = base64.replace(/[^A-Z0-9+\\/]/ig, '');\n\n for (var bytes = [], i = 0, imod4 = 0; i < base64.length;\n imod4 = ++i % 4) {\n if (imod4 == 0) continue;\n bytes.push(((base64map.indexOf(base64.charAt(i - 1))\n & (Math.pow(2, -2 * imod4 + 8) - 1)) << (imod4 * 2))\n | (base64map.indexOf(base64.charAt(i)) >>> (6 - imod4 * 2)));\n }\n return bytes;\n }\n };\n\n module.exports = crypt;\n})();\n","var charenc = {\n // UTF-8 encoding\n utf8: {\n // Convert a string to a byte array\n stringToBytes: function(str) {\n return charenc.bin.stringToBytes(unescape(encodeURIComponent(str)));\n },\n\n // Convert a byte array to a string\n bytesToString: function(bytes) {\n return decodeURIComponent(escape(charenc.bin.bytesToString(bytes)));\n }\n },\n\n // Binary encoding\n bin: {\n // Convert a string to a byte array\n stringToBytes: function(str) {\n for (var bytes = [], i = 0; i < str.length; i++)\n bytes.push(str.charCodeAt(i) & 0xFF);\n return bytes;\n },\n\n // Convert a byte array to a string\n bytesToString: function(bytes) {\n for (var str = [], i = 0; i < bytes.length; i++)\n str.push(String.fromCharCode(bytes[i]));\n return str.join('');\n }\n }\n};\n\nmodule.exports = charenc;\n","(function() {\n var crypt = require('crypt'),\n utf8 = require('charenc').utf8,\n bin = require('charenc').bin,\n\n // The core\n sha1 = function (message) {\n // Convert to byte array\n if (message.constructor == String)\n message = utf8.stringToBytes(message);\n else if (typeof Buffer !== 'undefined' && typeof Buffer.isBuffer == 'function' && Buffer.isBuffer(message))\n message = Array.prototype.slice.call(message, 0);\n else if (!Array.isArray(message))\n message = message.toString();\n\n // otherwise assume byte array\n\n var m = crypt.bytesToWords(message),\n l = message.length * 8,\n w = [],\n H0 = 1732584193,\n H1 = -271733879,\n H2 = -1732584194,\n H3 = 271733878,\n H4 = -1009589776;\n\n // Padding\n m[l >> 5] |= 0x80 << (24 - l % 32);\n m[((l + 64 >>> 9) << 4) + 15] = l;\n\n for (var i = 0; i < m.length; i += 16) {\n var a = H0,\n b = H1,\n c = H2,\n d = H3,\n e = H4;\n\n for (var j = 0; j < 80; j++) {\n\n if (j < 16)\n w[j] = m[i + j];\n else {\n var n = w[j - 3] ^ w[j - 8] ^ w[j - 14] ^ w[j - 16];\n w[j] = (n << 1) | (n >>> 31);\n }\n\n var t = ((H0 << 5) | (H0 >>> 27)) + H4 + (w[j] >>> 0) + (\n j < 20 ? (H1 & H2 | ~H1 & H3) + 1518500249 :\n j < 40 ? (H1 ^ H2 ^ H3) + 1859775393 :\n j < 60 ? (H1 & H2 | H1 & H3 | H2 & H3) - 1894007588 :\n (H1 ^ H2 ^ H3) - 899497514);\n\n H4 = H3;\n H3 = H2;\n H2 = (H1 << 30) | (H1 >>> 2);\n H1 = H0;\n H0 = t;\n }\n\n H0 += a;\n H1 += b;\n H2 += c;\n H3 += d;\n H4 += e;\n }\n\n return [H0, H1, H2, H3, H4];\n },\n\n // Public API\n api = function (message, options) {\n var digestbytes = crypt.wordsToBytes(sha1(message));\n return options && options.asBytes ? digestbytes :\n options && options.asString ? bin.bytesToString(digestbytes) :\n crypt.bytesToHex(digestbytes);\n };\n\n api._blocksize = 16;\n api._digestsize = 20;\n\n module.exports = api;\n})();\n","'use strict';\n\nimport sha1 from 'sha1';\nimport {Color} from '@linkurious/ogma';\nimport {IEdgeStyle, INodeStyle, IStyleAutoRange} from '@linkurious/rest-client';\n\nimport {Tools} from '../tools/tools';\n\nimport {StyleRule} from './styleRule';\nimport {NodeSizeExtrema} from './nodeAttributes';\nimport {EdgeWidthExtrema} from './edgeAttributes';\n\nexport const BASE_GREY = '#7f7f7f';\nexport const PALETTE = [\n '#9467bd',\n '#e377c2',\n '#1f77b4',\n '#17becf',\n '#2ca02c',\n '#bcbd22',\n '#d62728',\n '#ff7f0e',\n '#8c564b',\n '#c5b0d5',\n '#f7b6d2',\n '#aec7e8',\n '#9edae5',\n '#98df8a',\n '#dbdb8d',\n '#ff9896',\n '#ffbb78',\n '#c49c94'\n];\n\nexport class ItemAttributes<T extends INodeStyle | IEdgeStyle> {\n protected colorsCache: Map<string, Color | Array<Color>> = new Map();\n protected _rulesMap: {\n color?: Array<StyleRule<T>>;\n icon?: Array<StyleRule<T>>;\n image?: Array<StyleRule<T>>;\n shape?: Array<StyleRule<T>>;\n size?: Array<StyleRule<T>>;\n width?: Array<StyleRule<T>>;\n } = {};\n\n constructor(rulesMap: {\n color?: Array<StyleRule<T>>;\n icon?: Array<StyleRule<T>>;\n image?: Array<StyleRule<T>>;\n shape?: Array<StyleRule<T>>;\n size?: Array<StyleRule<T>>;\n width?: Array<StyleRule<T>>;\n }) {\n this.refresh(rulesMap);\n }\n\n /**\n * Refresh the rules\n */\n public refresh(rulesMap: {\n color?: Array<StyleRule<T>>;\n icon?: Array<StyleRule<T>>;\n image?: Array<StyleRule<T>>;\n shape?: Array<StyleRule<T>>;\n size?: Array<StyleRule<T>>;\n width?: Array<StyleRule<T>>;\n }): void {\n if (rulesMap.color !== undefined) {\n this.colorsCache = new Map();\n }\n this._rulesMap = {\n color: rulesMap.color ? [...rulesMap.color].reverse() : this._rulesMap.color,\n icon: rulesMap.icon ? [...rulesMap.icon].reverse() : this._rulesMap.icon,\n image: rulesMap.image ? [...rulesMap.image].reverse() : this._rulesMap.image,\n shape: rulesMap.shape ? [...rulesMap.shape].reverse() : this._rulesMap.shape,\n size: rulesMap.size ? [...rulesMap.size].reverse() : this._rulesMap.size,\n width: rulesMap.width ? [...rulesMap.width].reverse() : this._rulesMap.width\n };\n }\n\n /**\n * Return the color for a node when style color is auto\n */\n public static autoColor(value: string | undefined, ignoreCase?: boolean): string {\n if (!Tools.isDefined(value)) {\n return BASE_GREY;\n }\n return PALETTE[\n ItemAttributes.getRandomUniqueColorPaletteIndex(value, PALETTE.length, ignoreCase)\n ];\n }\n\n /**\n * Return a number from 0 to number of occurrence in a palette based on a property\n */\n private static getRandomUniqueColorPaletteIndex(\n input: string,\n modulo: number,\n ignoreCase: boolean | undefined\n ): number {\n if (ignoreCase) {\n input = input.toLowerCase();\n }\n return +('0x' + sha1(input).substr(-4)) % modulo;\n }\n\n /**\n * Get color of a type\n */\n public static getTypeColor(\n rule: StyleRule<IEdgeStyle | INodeStyle>,\n type: string\n ): string | undefined | null {\n if (typeof rule.style.color === 'object' && rule.style.color.input[0] !== 'properties') {\n return ItemAttributes.autoColor(type, rule.style.color.ignoreCase);\n }\n if (!Tools.isDefined(rule.input) && typeof rule.style.color !== 'object') {\n return rule.style.color;\n }\n return null;\n }\n\n /**\n * return the corresponding size to the value with a linear function\n * @param value\n * @param lower\n * @param higher\n * @param extrema\n */\n public static getAutomaticRangeStyleLinear(\n value: number,\n {max, min}: IStyleAutoRange,\n lower: EdgeWidthExtrema | NodeSizeExtrema,\n higher: EdgeWidthExtrema | NodeSizeExtrema\n ): string | undefined {\n if (max !== undefined && min !== undefined) {\n // apply default style when min equal max\n if (max === min || isNaN(value)) {\n return '100%';\n }\n\n // calculate the linear function f(x) = ax + b\n const a = (higher - lower) / (max - min);\n const b = (lower * max - higher * min) / (max - min);\n const size = Math.floor(value * a + b);\n\n return `${size}%`;\n }\n }\n\n /**\n * return the corresponding size to the value with a logarithmic function\n * @param value\n * @param lower\n * @param higher\n * @param extrema\n */\n public static getAutomaticRangeStyleLog(\n value: number,\n {max, min}: IStyleAutoRange,\n lower: EdgeWidthExtrema | NodeSizeExtrema,\n higher: EdgeWidthExtrema | NodeSizeExtrema\n ): string | undefined {\n if (min !== undefined && max !== undefined) {\n // apply default style when min equal max\n if (max === min || isNaN(value)) {\n return '100%';\n }\n // apply an offset for all the values (including min and max)\n if (min < 1) {\n value += Math.abs(min) + 1;\n max += Math.abs(min) + 1;\n min += Math.abs(min) + 1;\n }\n // calculate the logarithmic function f(x) = Math.floor(a*log(x) + b)\n const a = (higher - lower) / (Math.log(max) - Math.log(min));\n const b = (lower * Math.log(max) - higher * Math.log(min)) / (Math.log(max) - Math.log(min));\n const size = Math.floor(a * Math.log(value) + b);\n\n return `${size}%`;\n }\n }\n\n public isAutoRange(value: string | number | IStyleAutoRange): value is IStyleAutoRange {\n return typeof value === 'object' && value?.type === 'autoRange';\n }\n}\n","'use strict';\nimport {Color} from '@linkurious/ogma';\nimport {\n AutoRangeScale,\n IEdgeStyle,\n LkEdgeData,\n OgmaEdgeShape,\n IStyleAutoRange\n} from '@linkurious/rest-client';\n\nimport {Tools} from '../tools/tools';\n\nimport {StyleRule} from './styleRule';\nimport {BASE_GREY, ItemAttributes} from './itemAttributes';\n\nexport enum EdgeWidthExtrema {\n MIN = 50,\n MAX = 200\n}\n\nexport class EdgeAttributes extends ItemAttributes<IEdgeStyle> {\n constructor(rulesMap: {\n color?: Array<StyleRule<IEdgeStyle>>;\n shape?: Array<StyleRule<IEdgeStyle>>;\n width?: Array<StyleRule<IEdgeStyle>>;\n }) {\n super(rulesMap);\n }\n\n /**\n * Return rule that can be applied to the data\n */\n private static matchStyle(\n styleRules: Array<StyleRule<IEdgeStyle>>,\n data: LkEdgeData\n ): StyleRule<IEdgeStyle> | undefined {\n if (data === undefined) {\n return;\n }\n for (let i = 0; i < styleRules.length; ++i) {\n if (styleRules[i].canApplyTo(data)) {\n return styleRules[i];\n }\n }\n }\n\n /**\n * Generate color for a given edge (call only if _rulesMap.color exists)\n */\n public color(data: LkEdgeData): Color {\n if (!Tools.isDefined(data)) {\n return BASE_GREY;\n }\n let color;\n for (let j = 0; j < this._rulesMap.color!.length; ++j) {\n const rule = this._rulesMap.color![j];\n if (rule.canApplyTo(data)) {\n if (typeof rule.style.color === 'string') {\n color = rule.style.color;\n } else if (typeof rule.style.color === 'object') {\n const propValue = Tools.getIn(data, rule.style.color.input);\n color = ItemAttributes.autoColor(`${propValue}`, rule.style.color.ignoreCase);\n }\n break;\n }\n }\n return Tools.isDefined(color) ? color : BASE_GREY;\n }\n\n /**\n * Generate shape for a given node\n */\n public shape(data: LkEdgeData): OgmaEdgeShape | undefined {\n if (this._rulesMap.shape !== undefined) {\n return EdgeAttributes.matchStyle(this._rulesMap.shape, data)?.style.shape;\n }\n }\n\n /**\n * Generate size for a given node\n */\n public width(data: LkEdgeData): string | number | undefined {\n if (this._rulesMap.width !== undefined) {\n const styleRule = EdgeAttributes.matchStyle(this._rulesMap.width, data);\n if (styleRule !== undefined) {\n const widthStyle = styleRule?.style.width;\n if (widthStyle !== undefined && this.isAutoRange(widthStyle)) {\n if (\n widthStyle.input !== undefined &&\n widthStyle.max !== undefined &&\n widthStyle.min !== undefined\n ) {\n const propertyName: string = widthStyle.input[1];\n const propertyValue = Tools.parseNumber(data.properties[propertyName]);\n const isLog = widthStyle.scale && widthStyle.scale === AutoRangeScale.LOGARITHMIC;\n return EdgeAttributes.getAutomaticRangeWidth(propertyValue, styleRule, isLog);\n }\n } else {\n return widthStyle;\n }\n }\n }\n }\n\n /**\n * return the corresponding width to the value\n * @param value\n * @param rule\n * @param isLog\n */\n public static getAutomaticRangeWidth(\n value: number,\n rule: StyleRule<IEdgeStyle>,\n isLog = false\n ): string | undefined {\n return isLog\n ? this.getAutomaticRangeStyleLog(\n value,\n rule.style.width as IStyleAutoRange,\n EdgeWidthExtrema.MIN,\n EdgeWidthExtrema.MAX\n )\n : this.getAutomaticRangeStyleLinear(\n value,\n rule.style.width as IStyleAutoRange,\n EdgeWidthExtrema.MIN,\n EdgeWidthExtrema.MAX\n );\n }\n\n /**\n * Return an object containing all node attributes needed by Ogma to style a node\n */\n public all(data: LkEdgeData): {\n color: Color;\n shape: OgmaEdgeShape | undefined;\n width: string | undefined | number;\n } {\n if (!Tools.isDefined(data)) {\n return {\n color: BASE_GREY,\n shape: OgmaEdgeShape.ARROW,\n width: '100%'\n };\n }\n return {\n color: this.color(data),\n shape: this.shape(data),\n width: this.width(data)\n };\n }\n}\n","'use strict';\nimport {Color} from '@linkurious/ogma';\nimport {\n AutoRangeScale,\n IImageDataValue,\n INodeStyle,\n IStyleAutoRange,\n IStyleIcon,\n IStyleImage,\n LkNodeData,\n OgmaNodeShape\n} from '@linkurious/rest-client';\nimport sha1 from 'sha1';\n\nimport {Tools} from '../tools/tools';\nimport {OgmaTools} from '..';\n\nimport {StyleRule} from './styleRule';\nimport {BASE_GREY, ItemAttributes} from './itemAttributes';\n\nexport interface OgmaImage extends IStyleImage {\n url?: string;\n}\n\nexport enum NodeSizeExtrema {\n MIN = 50,\n MAX = 500\n}\n\nexport class NodeAttributes extends ItemAttributes<INodeStyle> {\n // Base url, used for image urls\n private _baseUrl?: string;\n\n constructor(rulesMap: {\n color?: Array<StyleRule<INodeStyle>>;\n icon?: Array<StyleRule<INodeStyle>>;\n image?: Array<StyleRule<INodeStyle>>;\n shape?: Array<StyleRule<INodeStyle>>;\n size?: Array<StyleRule<INodeStyle>>;\n }) {\n super(rulesMap);\n }\n\n /**\n * Run the callback if an item match with a style in the array of rules\n */\n private static matchStyle(\n styleRules: Array<StyleRule<INodeStyle>>,\n itemData: LkNodeData,\n callback: (style: StyleRule<INodeStyle>) => unknown\n ): void {\n if (!Tools.isDefined(itemData)) {\n return;\n }\n if (!Tools.isDefined(styleRules)) {\n return;\n }\n for (let i = 0; i < styleRules.length; ++i) {\n if (styleRules[i].canApplyTo(itemData)) {\n callback(styleRules[i]);\n break;\n }\n }\n }\n\n /**\n * Generate color for a given node (call only if _rulesMap.color is defined\n */\n public color(itemData: LkNodeData): Color | Array<Color> {\n if (!Tools.isDefined(itemData)) {\n return [BASE_GREY];\n }\n const hash = sha1(JSON.stringify(itemData));\n const cachedColor = this.colorsCache.get(hash);\n if (cachedColor !== undefined) {\n return cachedColor;\n }\n let colors: Array<string | null> = [];\n for (let i = 0; i < itemData.categories.length; ++i) {\n let color = null;\n for (let j = 0; j < this._rulesMap.color!.length; ++j) {\n const rule = this._rulesMap.color![j];\n if (\n rule.itemType !== undefined &&\n rule.itemType !== null &&\n rule.itemType !== itemData.categories[i]\n ) {\n continue;\n }\n if (rule.canApplyTo(itemData)) {\n if (typeof rule.style.color === 'object') {\n const propValue = Tools.getIn(itemData, rule.style.color.input);\n if (Array.isArray(propValue)) {\n color = ItemAttributes.autoColor(itemData.categories[i], rule.style.color.ignoreCase);\n } else {\n color = ItemAttributes.autoColor(`${propValue}`, rule.style.color.ignoreCase);\n }\n } else {\n color = rule.style.color as string;\n }\n break;\n }\n }\n colors.push(color);\n }\n colors = colors.filter((c) => Tools.isDefined(c));\n if (colors.length === 0) {\n colors = [BASE_GREY];\n }\n const finalColor = colors.length === 1 ? colors[0] : colors;\n this.colorsCache.set(hash, finalColor);\n return finalColor;\n }\n\n /**\n * Generate icon for a given node\n */\n public icon(itemData: LkNodeData): {\n icon?: IStyleIcon;\n image?: OgmaImage | null;\n } {\n const rawColors = this.color(itemData);\n const color = Array.isArray(rawColors) ? rawColors[0] : rawColors;\n let result = {};\n const rules = [...(this._rulesMap.image || []), ...(this._rulesMap.icon || [])];\n if (!Tools.isDefined(itemData)) {\n return {\n icon: {},\n image: {}\n };\n }\n for (let i = 0; i < rules.length; ++i) {\n if (rules[i].canApplyTo(itemData)) {\n const style = rules[i].style;\n if ('icon' in style && typeof style.icon === 'object') {\n result = {\n icon: {\n content: style.icon?.content as string,\n font: style.icon?.font,\n scale: 0.5,\n color: OgmaTools.isBright(color) ? '#000000' : '#FFFFFF'\n }\n };\n } else if ('image' in style && typeof style.image === 'object') {\n const imageUrlValue = NodeAttributes.getImageUrlFromStyleRule(\n style.image.url,\n itemData,\n this._baseUrl\n );\n if (imageUrlValue !== undefined) {\n result = {\n image: {\n url: imageUrlValue,\n scale: style.image.scale,\n fit: style.image.fit,\n tile: style.image.tile,\n minVisibleSize: 0\n }\n };\n }\n }\n break;\n }\n }\n\n return result;\n }\n\n /**\n * Generate shape for a given node\n */\n public shape(itemData: LkNodeData): OgmaNodeShape | undefined {\n let result = undefined;\n if (this._rulesMap.shape !== undefined) {\n NodeAttributes.matchStyle(this._rulesMap.shape, itemData, (styleRule) => {\n result = styleRule.style.shape;\n });\n }\n return result;\n }\n\n /**\n * Generate size for a given node\n */\n public size(itemData: LkNodeData): number | undefined {\n let result = undefined;\n if (this._rulesMap.size !== undefined) {\n NodeAttributes.matchStyle(\n this._rulesMap.size,\n itemData,\n (styleRule: StyleRule<INodeStyle>) => {\n const sizeStyle = styleRule.style.size as string | number | IStyleAutoRange;\n if (this.isAutoRange(sizeStyle)) {\n if (\n sizeStyle.input !== undefined &&\n sizeStyle.max !== undefined &&\n sizeStyle.min !== undefined\n ) {\n const propertyName: string = sizeStyle.input[1];\n const propertyValue = Tools.parseNumber(itemData.properties[propertyName]);\n const isLog = sizeStyle.scale && sizeStyle.scale === AutoRangeScale.LOGARITHMIC;\n result = NodeAttributes.getAutomaticRangeSize(propertyValue, styleRule, isLog);\n }\n } else {\n result = sizeStyle;\n }\n }\n );\n }\n return result;\n }\n\n /**\n * return the corresponding size to the value\n * @param value\n * @param rule\n * @param isLog\n */\n public static getAutomaticRangeSize(\n value: number,\n rule: StyleRule<INodeStyle>,\n isLog = false\n ): string | undefined {\n return isLog\n ? this.getAutomaticRangeStyleLog(\n value,\n rule.style.size as IStyleAutoRange,\n NodeSizeExtrema.MIN,\n NodeSizeExtrema.MAX\n )\n : this.getAutomaticRangeStyleLinear(\n value,\n rule.style.size as IStyleAutoRange,\n NodeSizeExtrema.MIN,\n NodeSizeExtrema.MAX\n );\n }\n\n /**\n * Return an object containing all node attributes needed by Ogma to style a node\n */\n public all(itemData: LkNodeData): {\n radius?: number | undefined;\n color: Color | Array<Color>;\n shape?: OgmaNodeShape | undefined;\n icon?: IStyleIcon;\n image?: IStyleImage | null;\n } {\n if (!Tools.isDefined(itemData)) {\n return {\n color: BASE_GREY\n };\n }\n const generatedIcon = this.icon(itemData);\n return {\n radius: this.size(itemData),\n color: this.color(itemData),\n shape: this.shape(itemData),\n icon: generatedIcon.icon,\n image: generatedIcon.image\n };\n }\n\n /**\n * Return the value of the image url from a style rule or undefined\n * @param value\n * @param itemData\n * @param baseUrl\n */\n public static getImageUrlFromStyleRule(\n value: string | IImageDataValue | undefined,\n itemData: LkNodeData,\n baseUrl?: string\n ): string | undefined {\n let imageUrl: string | undefined;\n if (typeof value === 'string' && ['imageUrl', 'image'].includes(Tools.getType(value)!)) {\n imageUrl = value;\n } else if (typeof value === 'object') {\n imageUrl = Tools.getIn(itemData, value.path);\n }\n\n // if base url is defined, we need to create a new URL to get the absolute path\n if (imageUrl !== undefined && baseUrl !== undefined) {\n return new URL(imageUrl, baseUrl).href;\n }\n return imageUrl;\n }\n\n /**\n * Set the base url (it will be used for image url while styling nodes)\n * @param baseUrl bse url\n */\n public setBaseUrl(baseUrl?: string): void {\n this._baseUrl = baseUrl;\n }\n}\n","'use strict';\n\nimport {\n IEdgeStyle,\n IStyleRule,\n LkEdgeData,\n LkNodeData,\n INodeStyle,\n IRangeValues,\n SelectorType,\n IStyleAutoRange\n} from '@linkurious/rest-client';\n\nimport {ItemAttributes} from '..';\nimport {Tools} from '../tools/tools';\n\nexport enum StyleRuleType {\n AUTO_RANGE = 'autoRange'\n}\n\nexport class StyleRule<T extends INodeStyle | IEdgeStyle = INodeStyle | IEdgeStyle>\n implements IStyleRule<T>\n{\n public type: SelectorType;\n public input: string[] | undefined;\n public index: number;\n public style: T;\n public itemType?: string;\n public value: IRangeValues | number | string | boolean;\n\n constructor(model: IStyleRule<T>) {\n this.type = model.type;\n this.input = model.input;\n this.index = model.index;\n this.itemType = model.itemType;\n this.style = model.style;\n // cast to remove undefined from type\n this.value = model.value as IRangeValues | number | string | boolean;\n }\n\n public static isAutomaticRange(rule: IStyleRule<IEdgeStyle | INodeStyle>): boolean {\n return (\n rule.style !== undefined &&\n (((rule.style as IEdgeStyle).width !== undefined &&\n ((rule.style as IEdgeStyle).width as IStyleAutoRange).type === StyleRuleType.AUTO_RANGE) ||\n ((rule.style as INodeStyle).size !== undefined &&\n ((rule.style as INodeStyle).size as IStyleAutoRange).type === StyleRuleType.AUTO_RANGE))\n );\n }\n\n /**\n * Return an int describing specificity of the style. 4 = very specific / 1 = not specific\n *\n * @return {number}\n */\n get specificity(): 1 | 2 | 3 | 4 {\n if (this.itemType !== undefined && this.input !== undefined) {\n return 4;\n }\n if (this.itemType === undefined && this.input !== undefined) {\n return 3;\n }\n if (this.itemType !== undefined && this.input === undefined) {\n return 2;\n }\n return 1;\n }\n\n /**\n * Return true if this style match values\n */\n public matchValues(\n itemType: string | undefined,\n input: Array<string> | undefined,\n value: string | undefined\n ): boolean {\n if (Tools.isDefined(input)) {\n return (\n ((itemType === this.itemType || !Tools.isDefined(this.itemType)) &&\n Tools.isEqual(['properties', ...input], this.input) &&\n Tools.isEqual(value, this.value)) ||\n (this.type === 'any' &&\n !Tools.isDefined(this.input) &&\n typeof this.style.color === 'object' &&\n this.style.color.input[1] === input[0])\n );\n }\n\n if (Tools.isDefined(this.itemType)) {\n return itemType === this.itemType && !Tools.isDefined(this.input);\n }\n\n return !Tools.isDefined(this.input);\n }\n\n public static inputExists(\n type: SelectorType,\n input: Array<string> | undefined\n ): input is Array<string> {\n return type !== SelectorType.ANY;\n }\n\n /**\n * Return true if a style can apply to a node\n */\n public canApplyTo(data: LkNodeData | LkEdgeData): boolean {\n const types = 'categories' in data ? data.categories : [data.type];\n let typePredicate = false;\n switch (this.type) {\n case SelectorType.ANY:\n typePredicate = StyleRule.checkAny(data, this.style);\n break;\n\n case SelectorType.NO_VALUE:\n if (StyleRule.inputExists(this.type, this.input)) {\n typePredicate = StyleRule.checkNoValue(data, this.input);\n }\n break;\n\n case SelectorType.NAN:\n if (StyleRule.inputExists(this.type, this.input)) {\n typePredicate = StyleRule.checkNan(data, this.input);\n }\n break;\n\n case SelectorType.RANGE:\n if (StyleRule.inputExists(this.type, this.input)) {\n typePredicate = StyleRule.checkRange(\n Tools.getIn(data, this.input),\n this.value as IRangeValues\n );\n }\n break;\n\n case SelectorType.IS:\n if (StyleRule.inputExists(this.type, this.input)) {\n typePredicate = StyleRule.checkIs(data, this.input, this.value);\n }\n break;\n }\n return typePredicate && StyleRule.checkItemType(types, this.itemType);\n }\n\n /**\n * Return true or false on rule type 'any' if the current node match the rule\n */\n public static checkAny(data: LkNodeData | LkEdgeData, style: INodeStyle | IEdgeStyle): boolean {\n // return true if autoColor by a property and this property exists in node\n if (typeof style.color === 'object') {\n return Tools.isDefined(Tools.getIn(data, style.color.input));\n }\n return true;\n }\n\n /**\n * Return true or false on rule type 'noValue' if the current node match the rule\n */\n public static checkNoValue(data: LkNodeData | LkEdgeData, input: Array<string>): boolean {\n return !Tools.valueExists(Tools.getIn(data, input));\n }\n\n /**\n * Return true or false on rule type 'NaN' if the current node match the rule\n */\n public static checkNan(data: LkNodeData | LkEdgeData, input: Array<string>): boolean {\n return !Tools.isNumber(Tools.getIn(data, input));\n }\n\n /**\n * Return true if predicate is true for the node value\n *\n * @param value\n * @param comparator\n * @return {boolean}\n */\n public static checkRange(\n value: number,\n comparator: {[key in '<=' | '<' | '>' | '>=']?: number}\n ): boolean {\n return (\n (comparator['<='] === undefined || value <= comparator['<=']) &&\n (comparator['<'] === undefined || value < comparator['<']) &&\n (comparator['>'] === undefined || value > comparator['>']) &&\n (comparator['>='] === undefined || value >= comparator['>='])\n );\n }\n\n /**\n * Return true or false on rule type 'is' if the current node match the rule\n */\n public static checkIs(\n data: LkNodeData | LkEdgeData,\n input: Array<string>,\n value: IRangeValues | number | string | boolean\n ): boolean {\n if (!Tools.isDefined(input)) {\n return false;\n }\n const itemValue = Tools.getIn(data, input);\n let formattedValue = itemValue;\n if (\n Tools.isDefined(itemValue) &&\n typeof itemValue === 'object' &&\n (itemValue.type === 'date' || itemValue.type === 'datetime')\n ) {\n let timezone = itemValue.timezone;\n if (itemValue.timezone === 'Z') {\n timezone = '+00:00';\n }\n formattedValue = Tools.formatDate(\n itemValue.value,\n itemValue.type === 'datetime',\n Tools.timezoneToMilliseconds(timezone) / 1000\n );\n }\n return Tools.isEqual(formattedValue, value);\n }\n\n /**\n * Check that value of itemType match for the node\n */\n public static checkItemType(types: Array<string>, itemType: string | undefined): boolean {\n return StyleRule.matchCategory(types, itemType) || StyleRule.matchAny(itemType);\n }\n\n /**\n * Return true if itemType is defined and category exists in an array of categories\n *\n * @param {Array<string> | string} types\n * @param {string} itemType\n * @return {boolean}\n */\n public static matchCategory(\n types: Array<string> | string,\n itemType: string | undefined\n ): boolean {\n return (\n Tools.isDefined(itemType) &&\n (Array.isArray(types) ? types.includes(itemType) : Tools.isEqual(types, itemType))\n );\n }\n\n /**\n * Return true if itemType is undefined\n *\n * @param {string} itemType\n * @return {boolean}\n */\n public static matchAny(itemType: string | null | undefined): boolean {\n return itemType === undefined;\n }\n\n /**\n * Return the color for a type\n */\n public getTypeColor(type: string): string | undefined | null {\n let color;\n if (\n StyleRule.checkItemType([type], this.itemType) &&\n this.type === SelectorType.ANY &&\n !Tools.isDefined(this.input)\n ) {\n color = ItemAttributes.getTypeColor(this, type);\n }\n return color;\n }\n}\n","'use strict';\n\nimport {\n IEdgeStyle,\n IStyleRule,\n LkEdgeData,\n LkNodeData,\n INodeStyle,\n SelectorType,\n IStyleIcon,\n IStyleImage,\n IStyles,\n IStyleColor,\n IRangeValues\n} from '@linkurious/rest-client';\n\nimport {sortBy, Tools} from '../tools/tools';\n\nimport {StyleRule} from './styleRule';\nimport {BASE_GREY, ItemAttributes} from './itemAttributes';\n\nexport enum StyleType {\n COLOR = 'color',\n ICON = 'icon',\n SIZE = 'size',\n IMAGE = 'image',\n SHAPE = 'shape',\n WIDTH = 'width'\n}\n\nexport interface Legend {\n [key: string]: Array<{label: string; value: string | IStyleIcon | IStyleImage | number}>;\n}\n\nexport const SORTING_RULE = ['specificity', 'itemType', 'index'];\n\nexport class StyleRules {\n private _rules: Array<IStyleRule<INodeStyle | IEdgeStyle>>;\n\n constructor(rules: Array<IStyleRule<INodeStyle | IEdgeStyle>>) {\n this._rules = rules;\n }\n\n /**\n * Return an array of StyleRule with only 'color' rules and sorted by specificity, itemType and index\n *\n * @return {Array<StyleRule>}\n */\n public get color(): Array<StyleRule> {\n return sortBy(StyleRules.getBy(StyleType.COLOR, this._rules), SORTING_RULE);\n }\n\n /**\n * Return an array of StyleRule with only 'icon' rules and sorted by specificity, itemType and index\n *\n * @return {Array<StyleRule>}\n */\n public get icon(): Array<StyleRule> {\n return sortBy(\n [\n ...(StyleRules.getBy(StyleType.ICON, this._rules) || []),\n ...(StyleRules.getBy(StyleType.IMAGE, this._rules) || [])\n ],\n SORTING_RULE\n );\n }\n\n /**\n * Return an array of StyleRule with only 'image' rules and sorted by specificity, itemType and index\n *\n * @return {Array<StyleRule>}\n */\n public get image(): Array<StyleRule> {\n return sortBy(StyleRules.getBy(StyleType.IMAGE, this._rules), SORTING_RULE);\n }\n\n /**\n * Return an array of StyleRule with only 'shape' rules and sorted by specificity, itemType and index\n *\n * @return {Array<StyleRule>}\n */\n public get shape(): Array<StyleRule> {\n return sortBy(StyleRules.getBy(StyleType.SHAPE, this._rules), SORTING_RULE);\n }\n\n /**\n * Return an array of StyleRule with only 'size' rules and sorted by specificity, itemType and index\n *\n * @return {Array<StyleRule>}\n */\n public get size(): Array<StyleRule> {\n return sortBy(StyleRules.getBy(StyleType.SIZE, this._rules), SORTING_RULE);\n }\n\n /**\n * Return an array of StyleRule with only 'width' rules and sorted by specificity, itemType and index\n *\n * @return {Array<StyleRule>}\n */\n public get width(): Array<StyleRule> {\n return sortBy(StyleRules.getBy(StyleType.WIDTH, this._rules), SORTING_RULE);\n }\n\n /**\n * Return an object containing for each node style a sorted array of StyleRule\n *\n * @return {{[key: string]: Array<StyleRule>} }\n */\n public get nodeRules(): {[key: string]: Array<StyleRule>} {\n return {\n color: this.color,\n icon: this.icon,\n image: this.image,\n shape: this.shape,\n size: this.size\n };\n }\n\n /**\n * Return an object containing for each edge style a sorted array of StyleRule\n *\n * @return { {[key: string]: Array<StyleRule>}}\n */\n public get edgeRules(): {[key: string]: Array<StyleRule>} {\n return {\n color: this.color,\n shape: this.shape,\n width: this.width\n };\n }\n\n /**\n * Generate a legend with an array of style rules and existing items in visualization\n */\n public generateLegend(itemsData: Array<LkNodeData | LkEdgeData>): Legend {\n const result: Legend = {};\n if (itemsData.length === 0) {\n return result;\n }\n\n if ('categories' in itemsData[0]) {\n Object.keys(this.nodeRules).forEach((style: string) => {\n result[style] = StyleRules.getLegendForStyle(\n style as StyleType,\n this.nodeRules[style],\n itemsData\n );\n });\n } else {\n Object.keys(this.edgeRules).forEach((style: string) => {\n result[style] = StyleRules.getLegendForStyle(\n style as StyleType,\n this.edgeRules[style],\n itemsData\n );\n });\n }\n return result;\n }\n\n /**\n * Return the legend for a specific style type (color, icon, image...)\n */\n public static getLegendForStyle(\n styleType: StyleType,\n styles: Array<StyleRule>,\n itemsData: Array<LkNodeData | LkEdgeData>\n ): Array<{label: string; value: string | number | IStyleIcon | IStyleImage}> {\n const result: Array<{label: string; value: string | number | IStyleIcon | IStyleImage}> = [];\n const data = itemsData.filter((i) => i);\n for (let i = 0; i < styles.length; i++) {\n const styleRule = new StyleRule(styles[i]);\n const ruleExistsInViz = data.some((itemData) => {\n return styleRule.canApplyTo(itemData);\n });\n if (ruleExistsInViz) {\n if (styleType === StyleType.COLOR && typeof styleRule.style.color === 'object') {\n StyleRules.addLegendAutoColors(data, styleRule, result);\n } else if (styleType === StyleType.ICON && 'image' in styleRule.style) {\n // style is a custom icon\n const label = Tools.isDefined(styleRule.input)\n ? `${StyleRules.getTypeLabel(styleRule.itemType)}.${\n styleRule.input[1]\n } ${StyleRules.sanitizeValue(styleRule.type, styleRule.value)}`\n : `${StyleRules.getTypeLabel(styleRule.itemType)}`;\n const imageStyle = styleRule.style.image as IStyleImage;\n if (\n imageStyle.url &&\n typeof imageStyle.url === 'object' &&\n imageStyle.url.type === 'data'\n ) {\n // If the custom icon is read from a node property-value dynamically, then we\n // skip it from the legend, because it could be a different image for each node,\n // thus bloating the legend.\n } else {\n const value = styleRule.style.image;\n StyleRules.updateLegend(result, {label: label, value: value as string});\n }\n } else {\n const label = Tools.isDefined(styleRule.input)\n ? `${StyleRules.getTypeLabel(styleRule.itemType)}.${\n styleRule.input[1]\n } ${StyleRules.sanitizeValue(styleRule.type, styleRule.value)}`\n : `${StyleRules.getTypeLabel(styleRule.itemType)}`;\n const value =\n styleType === StyleType.WIDTH\n ? (styleRule.style as IEdgeStyle)[styleType]\n : (styleRule.style as INodeStyle)[styleType];\n StyleRules.updateLegend(result, {label: label, value: value as string});\n }\n }\n }\n\n return result;\n }\n\n /**\n * Sanitize value for legend\n */\n public static sanitizeValue(\n styleType: SelectorType,\n value: IRangeValues | number | string | boolean\n ): string {\n let template = '';\n switch (styleType) {\n case SelectorType.NO_VALUE:\n return 'is undefined';\n\n case SelectorType.NAN:\n return 'is not an number';\n\n case SelectorType.RANGE:\n Object.keys(value).forEach((k, i) => {\n if (i > 0) {\n template += ' and ';\n }\n template += `${k} ${(value as IRangeValues)[k as keyof IRangeValues]}`;\n });\n return template;\n }\n\n return typeof value === 'object' ? `= ${JSON.stringify(value)}` : `= ${value}`;\n }\n\n /**\n * Add items in legend for automatic coloring\n */\n public static addLegendAutoColors(\n itemsData: Array<LkNodeData | LkEdgeData>,\n styleRule: StyleRule,\n currentLegend: Array<{label: string; value: string | number | IStyleIcon | IStyleImage}>\n ): void {\n const colorStyle = styleRule.style.color as IStyleColor;\n const propertyKey: string = colorStyle.input[1];\n itemsData.forEach((data) => {\n const propValue = Tools.getIn(data, colorStyle.input);\n if (Array.isArray(propValue)) {\n propValue.forEach((value) => {\n const label = colorStyle.input.includes('properties')\n ? `${StyleRules.getTypeLabel(styleRule.itemType)}.${propertyKey} = ${value}`\n : `${StyleRules.getTypeLabel(value)}`;\n const color = ItemAttributes.autoColor(value, colorStyle.ignoreCase);\n StyleRules.updateLegend(currentLegend, {label: label, value: color});\n });\n } else {\n const label = colorStyle.input.includes('properties')\n ? `${StyleRules.getTypeLabel(styleRule.itemType)}.${propertyKey} = ${propValue}`\n : `${StyleRules.getTypeLabel(propValue)}`;\n const value = ItemAttributes.autoColor(propValue, colorStyle.ignoreCase);\n StyleRules.updateLegend(currentLegend, {label: label, value: value});\n }\n });\n }\n\n /**\n * Return the label of item type for a legend item\n */\n public static getTypeLabel(type: string | undefined | null): string {\n return type === undefined ? 'All' : type === null ? 'Others' : type;\n }\n\n /**\n * Return the color of item type from the list of styles\n */\n public getColorForType(type: string): string {\n const colors = this.color\n .map((rule) => rule.getTypeColor(type))\n .filter((type) => Tools.isDefined(type));\n\n return colors.length > 0 ? colors[colors.length - 1] : BASE_GREY;\n }\n\n /**\n * Return the icon of item type from the list of styles\n */\n public getIconForType(type: string): string | number | undefined {\n // icon is only used for nodes\n const icons = (this.icon as StyleRule<INodeStyle>[])\n .filter((rule) => !Tools.isDefined(rule.input) && rule.itemType === type)\n .map((rule) => {\n // rule.style.icon can be undefined as it is optional in INodeStyle interface\n return (rule.style.icon as IStyleIcon)?.content;\n })\n .filter((type) => Tools.isDefined(type));\n\n return icons.length > 0 ? icons[icons.length - 1] : undefined;\n }\n\n /**\n * Check if a legend item already exists and overwrite it / push it\n */\n public static updateLegend(\n legend: Array<{label: string; value: string | number | IStyleIcon | IStyleImage}>,\n {label, value}: {[key: string]: string}\n ): void {\n const indexOfLegendItem = legend.map((r) => r.label).indexOf(label);\n if (indexOfLegendItem < 0) {\n legend.push({label: label, value: value});\n } else {\n legend[indexOfLegendItem] = {label: label, value: value};\n }\n }\n\n /**\n * return an array of StyleRule, containing only the desired style\n */\n public static getBy(\n styleType: StyleType,\n rules: Array<IStyleRule<INodeStyle | IEdgeStyle>>\n ): Array<StyleRule> {\n return rules\n .filter((style: IStyleRule<INodeStyle | IEdgeStyle>) => {\n switch (styleType) {\n case StyleType.COLOR:\n return style.style.color !== undefined;\n\n case StyleType.ICON:\n return 'icon' in style.style && style.style.icon !== undefined;\n\n case StyleType.IMAGE:\n return 'image' in style.style && style.style.image !== undefined;\n\n case StyleType.SHAPE:\n return style.style.shape !== undefined;\n\n case StyleType.SIZE:\n return 'size' in style.style && style.style.size !== undefined;\n\n case StyleType.WIDTH:\n return 'width' in style.style && style.style.width !== undefined;\n }\n })\n .map((style: IStyleRule<INodeStyle | IEdgeStyle>) => StyleRules.getRule(style, styleType));\n }\n\n /**\n * From a RawStyle, generate a StyleRule of a specific style\n */\n public static getRule(\n rawRule: IStyleRule<INodeStyle | IEdgeStyle>,\n styleType: StyleType\n ): StyleRule {\n const rule = Tools.clone(rawRule);\n rule.style = {[styleType]: rule.style[styleType]};\n return new StyleRule(rule);\n }\n\n /**\n * Check for non unique index in styles rules and update them if exists\n */\n public static sanitizeStylesIndex(styles: IStyles): IStyles {\n const seenIndex: Array<number> = [];\n const sanitizedStyles: IStyles = Tools.clone(styles);\n let maxIndex =\n Math.max(...[...styles.node.map((s) => s.index), ...styles.edge.map((s) => s.index)]) + 1;\n sanitizedStyles.node = sanitizedStyles.node.map((style) => {\n if (seenIndex.includes(style.index)) {\n style.index = maxIndex;\n maxIndex++;\n } else {\n seenIndex.push(style.index);\n }\n return style;\n });\n sanitizedStyles.edge = sanitizedStyles.edge.map((style) => {\n if (seenIndex.includes(style.index)) {\n style.index = maxIndex;\n maxIndex++;\n } else {\n seenIndex.push(style.index);\n }\n return style;\n });\n return sanitizedStyles;\n }\n}\n","'use strict';\n\nimport * as o from '@linkurious/ogma';\nimport {\n Badge,\n Edge,\n EdgeAttributesValue,\n Node,\n NodeAttributesValue,\n StyleClass,\n StyleRule\n} from '@linkurious/ogma';\nimport {\n GenericObject,\n IEdgeStyle,\n INodeStyle,\n IStyleIcon,\n IStyleRule,\n LkEdgeData,\n LkNodeData,\n OgmaEdgeShape,\n OgmaNodeShape,\n TextOptions\n} from '@linkurious/rest-client';\n\nimport {\n BASE_GREY,\n EdgeAttributes,\n LKOgma,\n NodeAttributes,\n OgmaTools,\n StyleRule as LKStyleRule,\n StyleRules,\n StyleType\n} from '../..';\nimport {Tools} from '../../tools/tools';\nimport {OgmaImage} from '../../styles/nodeAttributes';\n\nexport interface StylesConfig {\n nodeColorStyleRules: Array<LKStyleRule>;\n nodeIconStyleRules: Array<LKStyleRule>;\n nodeSizeStyleRules: Array<LKStyleRule>;\n nodeShapeStyleRules?: Array<LKStyleRule>;\n edgeColorStyleRules: Array<LKStyleRule>;\n edgeWidthStyleRules: Array<LKStyleRule>;\n edgeShapeStyleRules?: Array<LKStyleRule>;\n}\n\nconst HOVERED_SELECTED_NODE_STYLE: NodeAttributesValue<LkNodeData, LkEdgeData> = {\n text: {\n style: 'bold',\n backgroundColor: '#fff',\n minVisibleSize: 0\n },\n outerStroke: {width: 2},\n outline: false\n};\n\nconst HOVERED_SELECTED_EDGE_STYLE: EdgeAttributesValue<LkEdgeData, LkNodeData> = {\n text: {\n style: 'bold',\n backgroundColor: '#fff',\n minVisibleSize: 0\n },\n outline: false\n};\n\nconst NODE_HALO_CONFIGURATION = {\n color: '#FFF',\n width: 7,\n scalingMethod: 'scaled',\n strokeWidth: 0,\n hideNonAdjacentEdges: false\n} as {\n color: '#FFF';\n width: 7;\n strokeWidth: 0;\n};\n\nconst EDGE_HALO_CONFIGURATION = {\n color: '#FFF',\n scalingMethod: 'scaled',\n width: 4\n} as {\n color: '#FFF';\n width: 4;\n};\n\nconst DEFAULT_OGMA_FONT = \"'roboto', sans-serif\";\nconst DARK_FONT_COLOR = '#000';\nconst CLEAR_FONT_COLOR = '#FFF';\nconst ITEM_DEFAULT_COLOR = '#7f7f7f';\nexport const FILTER_OPACITY = 0.2;\n\nexport class StylesViz {\n private _ogma: LKOgma;\n private _exportClass!: StyleClass;\n private _nodeDefaultStylesRules!: StyleRule<LkNodeData, LkEdgeData>;\n // @ts-ignore\n private _nodeDefaultHaloRules!: StyleRule<LkNodeData, LkEdgeData>;\n private _edgeDefaultStylesRules!: StyleRule<LkNodeData, LkEdgeData>;\n // @ts-ignore\n private _edgeDefaultHaloRules!: StyleRule<LkNodeData, LkEdgeData>;\n\n private _nodeAttributes: NodeAttributes = new NodeAttributes({});\n private _edgeAttributes: EdgeAttributes = new EdgeAttributes({});\n\n private _ogmaNodeColor!: StyleRule;\n private _ogmaNodeIcon!: StyleRule;\n private _ogmaNodeSize!: StyleRule;\n private _ogmaNodeShape!: StyleRule;\n private _ogmaEdgeColor!: StyleRule;\n private _ogmaEdgeWidth!: StyleRule;\n private _ogmaEdgeShape!: StyleRule;\n private _defaultConfiguration: {\n node: {\n nodeRadius?: number;\n shape?: OgmaNodeShape;\n text?: TextOptions & {\n nodePosition?: 'right' | 'left' | 'top' | 'bottom' | 'center';\n };\n };\n edge: {\n edgeWidth?: number;\n shape?: OgmaEdgeShape;\n text?: TextOptions;\n };\n };\n\n constructor(\n ogma: LKOgma,\n configuration: {\n node: {\n nodeRadius?: number;\n shape?: OgmaNodeShape;\n text?: TextOptions & {\n nodePosition?: 'right' | 'left' | 'top' | 'bottom' | 'center';\n };\n };\n edge: {\n edgeWidth?: number;\n shape?: OgmaEdgeShape;\n text?: TextOptions;\n };\n baseUrl?: string;\n }\n ) {\n this._ogma = ogma;\n this._defaultConfiguration = configuration;\n this._nodeAttributes.setBaseUrl(configuration.baseUrl);\n }\n\n /**\n * Set nodes default styles based on the configuration\n */\n public setNodesDefaultStyles(): void {\n // setting selection and hover attributes\n this._ogma.styles.setHoveredNodeAttributes(HOVERED_SELECTED_NODE_STYLE);\n this._ogma.styles.setSelectedNodeAttributes(HOVERED_SELECTED_NODE_STYLE);\n // setting default styles\n this._nodeDefaultStylesRules = this._ogma.styles.addRule({\n nodeAttributes: {\n text: {\n padding: 5,\n minVisibleSize:\n this._defaultConfiguration.node.text !== undefined &&\n this._defaultConfiguration.node.text.minVisibleSize\n ? this._defaultConfiguration.node.text.minVisibleSize\n : 12,\n maxLineLength:\n this._defaultConfiguration.node.text !== undefined &&\n this._defaultConfiguration.node.text.maxLineLength !== undefined\n ? this._defaultConfiguration.node.text.maxLineLength\n : 30,\n position:\n this._defaultConfiguration.node.text !== undefined &&\n this._defaultConfiguration.node.text.nodePosition !== undefined\n ? this._defaultConfiguration.node.text.nodePosition\n : 'bottom',\n backgroundColor:\n this._defaultConfiguration.node.text !== undefined &&\n this._defaultConfiguration.node.text.backgroundColor !== undefined\n ? this._defaultConfiguration.node.text.backgroundColor\n : undefined,\n font:\n this._defaultConfiguration.node.text !== undefined &&\n this._defaultConfiguration.node.text.font !== undefined\n ? this._defaultConfiguration.node.text.font\n : \"'roboto', sans-serif\",\n color:\n this._defaultConfiguration.node.text !== undefined &&\n this._defaultConfiguration.node.text.color !== undefined\n ? this._defaultConfiguration.node.text.color\n : 'black',\n size:\n this._defaultConfiguration.node.text !== undefined &&\n this._defaultConfiguration.node.text.size !== undefined\n ? this._defaultConfiguration.node.text.size\n : 14,\n margin: 5\n },\n radius: this.defaultNodeRadius(this._defaultConfiguration.node),\n icon: {\n minVisibleSize: 15\n },\n color: ITEM_DEFAULT_COLOR,\n shape:\n this._defaultConfiguration.node.shape !== undefined\n ? this._defaultConfiguration.node.shape\n : ('circle' as OgmaNodeShape),\n innerStroke: {\n width: 3\n },\n outline: false\n }\n });\n }\n\n /**\n * Set edges default styles based on the configuration\n */\n public setEdgesDefaultStyles(): void {\n // setting selection and hover attributes\n this._ogma.styles.setHoveredEdgeAttributes(HOVERED_SELECTED_EDGE_STYLE);\n this._ogma.styles.setSelectedEdgeAttributes(HOVERED_SELECTED_EDGE_STYLE);\n // setting default styles\n this._edgeDefaultStylesRules = this._ogma.styles.addRule({\n edgeAttributes: {\n text: {\n minVisibleSize:\n this._defaultConfiguration.edge.text !== undefined &&\n this._defaultConfiguration.edge.text.minVisibleSize\n ? this._defaultConfiguration.edge.text.minVisibleSize\n : 3,\n maxLineLength:\n this._defaultConfiguration.edge.text !== undefined &&\n this._defaultConfiguration.edge.text.maxLineLength !== undefined\n ? this._defaultConfiguration.edge.text.maxLineLength\n : 30,\n backgroundColor:\n this._defaultConfiguration.edge.text !== undefined &&\n this._defaultConfiguration.edge.text.backgroundColor !== undefined\n ? this._defaultConfiguration.edge.text.backgroundColor\n : undefined,\n font:\n this._defaultConfiguration.edge.text !== undefined &&\n this._defaultConfiguration.edge.text.font !== undefined\n ? this._defaultConfiguration.edge.text.font\n : \"'roboto', sans-serif\",\n color:\n this._defaultConfiguration.edge?.text !== undefined &&\n this._defaultConfiguration.edge.text.color !== undefined\n ? this._defaultConfiguration.edge.text.color\n : 'black',\n size:\n this._defaultConfiguration.edge.text !== undefined &&\n this._defaultConfiguration.edge.text.size !== undefined\n ? this._defaultConfiguration.edge.text.size\n : 14\n },\n width: this.defaultEdgeWidth(this._defaultConfiguration.edge),\n shape:\n this._defaultConfiguration.edge.shape !== undefined\n ? this._defaultConfiguration.edge.shape\n : 'arrow',\n color: ITEM_DEFAULT_COLOR\n }\n });\n }\n\n /**\n * Set nodes default styles based on the configuration\n */\n public setNodesDefaultHalo(): void {\n // setting default halo style\n this._nodeDefaultHaloRules = this._ogma.styles.addRule({\n nodeSelector: (node) => node && !node.hasClass('filtered'),\n nodeAttributes: {\n halo: (node) => {\n if (\n node !== undefined &&\n !node.hasClass('filtered') &&\n (node.isSelected() ||\n node.getAdjacentNodes({}).isSelected().includes(true) ||\n node.getAdjacentEdges().isSelected().includes(true))\n ) {\n return {\n ...NODE_HALO_CONFIGURATION,\n scalingMethod: this._ogma.geo.enabled() ? 'fixed' : 'scaled'\n };\n }\n return null;\n }\n },\n // recalculate the rule *only* when itself or adjacent\n // elements change their selection status\n nodeDependencies: {\n self: {\n selection: true\n },\n adjacentNodes: {\n selection: true\n },\n adjacentEdges: {\n selection: true\n }\n }\n });\n }\n\n /**\n * Set edges default styles based on the configuration\n */\n public setEdgesDefaultHalo(): void {\n // setting default halo styles\n this._edgeDefaultHaloRules = this._ogma.styles.addRule({\n edgeSelector: (edge: Edge) =>\n edge && edge.getSource() && edge.getTarget() && !edge.hasClass('filtered'),\n edgeAttributes: {\n halo: (edge) => {\n if (\n edge &&\n !edge.hasClass('filtered') &&\n (edge.isSelected() || edge.getSource().isSelected() || edge.getTarget().isSelected())\n ) {\n return {\n ...EDGE_HALO_CONFIGURATION,\n scalingMethod: this._ogma.geo.enabled() ? 'fixed' : 'scaled'\n };\n }\n return null;\n }\n },\n // this rule will only be invoked when the selection status\n // of the edge or it's extremities is changed\n edgeDependencies: {\n self: {\n selection: true\n },\n extremities: {\n selection: true\n }\n }\n });\n }\n\n /**\n * Return the default node radius set in configuration or 5\n *\n * @returns {number}\n */\n private defaultNodeRadius(styles: {nodeRadius?: number}): number {\n return this.defaultStylesHas(styles, ['nodeRadius']) ? styles.nodeRadius! : 5;\n }\n\n /**\n * Return the default edge width set in configuration or 1\n *\n * @returns {number}\n */\n private defaultEdgeWidth(styles: {edgeWidth?: number}): number {\n return this.defaultStylesHas(styles, ['edgeWidth']) ? styles.edgeWidth! : 1;\n }\n\n /**\n * Check if a style property exists in the default styles object\n */\n private defaultStylesHas(styles: GenericObject<unknown>, propertyPath: Array<string>): boolean {\n if (!Tools.isDefined(styles)) {\n return false;\n }\n return Tools.getIn(styles, propertyPath) !== undefined;\n }\n\n /**\n * Set styles for the class \"filtered\"\n */\n public setFilterClass(): void {\n this._ogma.styles.createClass({\n name: 'filtered',\n nodeAttributes: {\n opacity: FILTER_OPACITY,\n layer: (node): number => {\n // if the node is part of a virtual node, it should be on top\n if (node.getMetaNode() !== null) {\n return 1;\n }\n return -1;\n },\n detectable: false,\n badges: {\n topRight: {\n text: null\n },\n bottomRight: {\n text: null\n }\n },\n text: null,\n color: 'rgb(240, 240, 240)',\n innerStroke: {\n width: 1,\n color: BASE_GREY,\n minVisibleSize: 1\n },\n shape: 'circle',\n image: null,\n icon: null,\n radius: '50%'\n },\n edgeAttributes: {\n opacity: FILTER_OPACITY,\n layer: (edge): number => {\n const isEdgeInsideNodeGroup = edge\n .getExtremities()\n .getMetaNode()\n .some((node) => node !== null);\n // if the edge is part of a virtual node, it should be on top\n if (!edge.isVirtual() && isEdgeInsideNodeGroup) {\n return 1;\n }\n return -1;\n },\n detectable: false,\n text: null,\n color: BASE_GREY,\n shape: 'line',\n width: 0.2\n }\n });\n }\n\n /**\n * Set the class for exported nodes and edges\n */\n public setExportClass(textWrappingLength?: boolean): void {\n if (!this._exportClass) {\n this._exportClass = this._ogma.styles.createClass({\n name: 'exported',\n nodeAttributes: {\n text: {\n minVisibleSize: 0,\n size: 12,\n maxLineLength: textWrappingLength ? 30 : 0\n },\n halo: null\n },\n edgeAttributes: {\n text: {\n minVisibleSize: 0,\n size: 12\n },\n halo: null\n }\n });\n } else {\n this._exportClass.update({\n nodeAttributes: {\n text: {\n maxLineLength: textWrappingLength ? 30 : 0\n },\n halo: null\n }\n });\n }\n }\n\n /**\n * Set the rule to display badges\n */\n public setBadgeRule() {\n this._ogma.styles.createClass({\n name: 'degreeIndicator',\n nodeAttributes: {\n badges: {\n topRight: (node) => {\n if (node !== undefined) {\n const degree = Tools.getHiddenNeighbors(node.toList());\n const badgeContent = Tools.formatNumber(degree);\n if (degree > 0) {\n const nodeColor = Array.isArray(node.getAttribute('color'))\n ? node.getAttribute('color')![0]\n : node.getAttribute('color');\n const textColor = OgmaTools.isBright(nodeColor as o.Color)\n ? DARK_FONT_COLOR\n : CLEAR_FONT_COLOR;\n const isSupernode = node.getData(['statistics', 'supernode']);\n let content = null;\n if (+badgeContent !== 0) {\n content = isSupernode ? badgeContent + '+' : badgeContent;\n }\n return {\n color: 'inherit',\n minVisibleSize: 20,\n stroke: {\n width: 0,\n color: null\n },\n text: {\n font:\n this._defaultConfiguration.node.text !== undefined &&\n this._defaultConfiguration.node.text.font !== undefined\n ? this._defaultConfiguration.node.text.font\n : DEFAULT_OGMA_FONT,\n scale: 0.4,\n color: textColor,\n content: content\n }\n };\n }\n }\n }\n }\n }\n });\n this._ogma.styles.createClass({\n name: 'pinnedIndicator',\n nodeAttributes: {\n badges: {\n bottomRight: (node): Badge | undefined => {\n if (node !== undefined && !node.getAttribute('layoutable')) {\n return {\n color: this._findPinBadgeBackgroundColor(node),\n minVisibleSize: 20,\n scale: this._findPinBadgeScale(node),\n stroke: {\n width: 0,\n color: null\n },\n text: {\n font: 'FontAwesome',\n scale: 0.4,\n color: this._findPinBadgeTextColor(node),\n content: node.getAttribute('layoutable') ? null : '\\uf08d'\n }\n };\n }\n }\n }\n },\n nodeDependencies: {\n self: {attributes: ['layoutable']}\n }\n });\n this._ogma.events.on('addNodes', (nodesEvent) => nodesEvent.nodes.addClass('degreeIndicator'));\n this._ogma.events.on('addNodes', (nodesEvent) => nodesEvent.nodes.addClass('pinnedIndicator'));\n }\n\n /**\n * Delete the rule to display badges\n */\n public deleteBadgeRule() {\n this._ogma.getNodes().removeClasses(['degreeIndicator', 'pinnedIndicator'], 0);\n }\n\n /**\n * set text overlap to true or false\n *\n * @param {boolean} overlap\n */\n public toggleTextOverlap(overlap?: boolean): void {\n this._ogma.setOptions({texts: {preventOverlap: overlap}});\n }\n\n /**\n * refresh nodes and edge rules\n *\n */\n public refreshRules(): void {\n this._nodeDefaultStylesRules.refresh();\n this._edgeDefaultStylesRules.refresh();\n }\n\n /**\n * Create / refresh an ogma rule for node colors\n */\n public refreshNodeColors(colorStyleRules: Array<LKStyleRule<INodeStyle>>): void {\n if (!Tools.isDefined(this._ogmaNodeColor)) {\n this._nodeAttributes.refresh({color: colorStyleRules});\n this._ogmaNodeColor = this._ogma.styles.addRule({\n nodeAttributes: {\n color: (node: o.Node | undefined) => {\n if (node !== undefined) {\n return this._nodeAttributes.color(node.getData());\n }\n }\n },\n nodeDependencies: {self: {data: true}}\n });\n } else {\n this._nodeAttributes.refresh({color: colorStyleRules});\n this._ogmaNodeColor.refresh();\n // TODO refresh node icons when moving the code from LKE\n // this.refreshIconsColor();\n }\n }\n\n /**\n * Return an array of StyleRules with only the style that need to be applied\n */\n public getStyleRule(\n state: Array<IStyleRule<INodeStyle | IEdgeStyle>>,\n styleType: StyleType\n ): LKStyleRule[] {\n return new StyleRules(state)[styleType];\n }\n\n public initNodeColors(nodeRules: Array<IStyleRule<INodeStyle | IEdgeStyle>>): void {\n const nodeColorRules = this.getStyleRule(\n nodeRules,\n StyleType.COLOR\n ) as LKStyleRule<INodeStyle>[];\n this.refreshNodeColors(nodeColorRules);\n }\n\n public initNodesIcons(nodeRules: Array<IStyleRule<INodeStyle | IEdgeStyle>>) {\n const nodeIconsRules = this.getStyleRule(\n nodeRules,\n StyleType.ICON\n ) as LKStyleRule<INodeStyle>[];\n this.refreshNodeIcons(nodeIconsRules);\n }\n\n public initNodesSizes(nodeRules: Array<IStyleRule<INodeStyle | IEdgeStyle>>): void {\n const nodeSizeRules = this.getStyleRule(nodeRules, StyleType.SIZE) as LKStyleRule<INodeStyle>[];\n this.refreshNodeSize(nodeSizeRules);\n }\n\n public initNodesShapes(nodeRules: Array<IStyleRule<INodeStyle | IEdgeStyle>>) {\n const nodeShapesRules = this.getStyleRule(\n nodeRules,\n StyleType.SHAPE\n ) as LKStyleRule<INodeStyle>[];\n this.refreshNodeShape(nodeShapesRules);\n }\n\n public initEdgesWidth(edgeRules: Array<IStyleRule<INodeStyle | IEdgeStyle>>) {\n const edgesWidthRules = this.getStyleRule(\n edgeRules,\n StyleType.WIDTH\n ) as LKStyleRule<IEdgeStyle>[];\n this.refreshEdgeWidth(edgesWidthRules);\n }\n\n public initEdgesShape(edgeRules: Array<IStyleRule<INodeStyle | IEdgeStyle>>) {\n const edgesShapeRules = this.getStyleRule(\n edgeRules,\n StyleType.SHAPE\n ) as LKStyleRule<IEdgeStyle>[];\n this.refreshEdgeShape(edgesShapeRules);\n }\n\n public initEdgesColor(edgeRules: Array<IStyleRule<INodeStyle | IEdgeStyle>>): void {\n const edgesColorRules = this.getStyleRule(\n edgeRules,\n StyleType.COLOR\n ) as LKStyleRule<IEdgeStyle>[];\n this.refreshEdgeColors(edgesColorRules);\n }\n\n /**\n * Create / refresh an ogma rule for node icons\n *\n * @param {Array<any>} iconStyleRules\n */\n public refreshNodeIcons(iconStyleRules: Array<LKStyleRule<INodeStyle>>): void {\n if (!Tools.isDefined(this._ogmaNodeIcon)) {\n this._nodeAttributes.refresh({icon: iconStyleRules});\n this._ogmaNodeIcon = this._ogma.styles.addRule({\n nodeAttributes: {\n icon: (node: o.Node | undefined): IStyleIcon | undefined => {\n if (node !== undefined) {\n return this._nodeAttributes.icon(node.getData()).icon;\n }\n },\n image: (node: o.Node | undefined): OgmaImage | null | undefined => {\n if (node !== undefined && !node.isVirtual()) {\n return this._nodeAttributes.icon(node.getData()).image;\n }\n }\n },\n nodeDependencies: {self: {data: true}}\n });\n } else {\n this._nodeAttributes.refresh({icon: iconStyleRules});\n void this._ogmaNodeIcon.refresh();\n }\n }\n\n /**\n * Create / refresh an ogma rule for node sizes\n *\n * @param {Array<any>} sizeStyleRules\n */\n public refreshNodeSize(sizeStyleRules: Array<LKStyleRule<INodeStyle>>): void {\n if (!Tools.isDefined(this._ogmaNodeSize)) {\n this._nodeAttributes.refresh({size: sizeStyleRules});\n this._ogmaNodeSize = this._ogma.styles.addRule({\n nodeAttributes: {\n radius: (node: o.Node | undefined) => {\n if (node !== undefined) {\n return this._nodeAttributes.size(node.getData());\n }\n }\n },\n nodeDependencies: {self: {data: true}}\n });\n } else {\n this._nodeAttributes.refresh({size: sizeStyleRules});\n this._ogmaNodeSize.refresh();\n }\n }\n\n /**\n * Create / refresh an ogma rule for node images\n *\n * @param {Array<any>} shapeStyleRules\n */\n public refreshNodeShape(shapeStyleRules: Array<LKStyleRule<INodeStyle>>): void {\n if (!Tools.isDefined(this._ogmaNodeShape)) {\n this._nodeAttributes.refresh({shape: shapeStyleRules});\n this._ogmaNodeShape = this._ogma.styles.addRule({\n nodeAttributes: {\n shape: (node: o.Node | undefined) => {\n if (node !== undefined) {\n return this._nodeAttributes.shape(node.getData());\n }\n }\n },\n nodeSelector: (node: o.Node | undefined) => node !== undefined && !node.isVirtual(),\n nodeDependencies: {self: {data: true}}\n });\n } else {\n this._nodeAttributes.refresh({shape: shapeStyleRules});\n this._ogmaNodeShape.refresh();\n }\n }\n\n /**\n * Create / refresh an ogma rule for edge colors\n */\n public refreshEdgeColors(colorStyleRules: Array<LKStyleRule<IEdgeStyle>>): void {\n if (!Tools.isDefined(this._ogmaEdgeColor)) {\n this._edgeAttributes.refresh({color: colorStyleRules});\n this._ogmaEdgeColor = this._ogma.styles.addRule({\n edgeAttributes: {\n color: (edge: o.Edge | undefined) => {\n if (edge !== undefined) {\n return this._edgeAttributes.color(edge.getData());\n }\n }\n },\n edgeDependencies: {self: {data: true}}\n });\n } else {\n this._edgeAttributes.refresh({color: colorStyleRules});\n this._ogmaEdgeColor.refresh();\n }\n }\n\n /**\n * Create / refresh an ogma rule for edge width\n *\n * @param {Array<LKStyleRule>} widthStyleRules\n */\n public refreshEdgeWidth(widthStyleRules: Array<LKStyleRule<IEdgeStyle>>): void {\n if (!Tools.isDefined(this._ogmaEdgeWidth)) {\n this._edgeAttributes.refresh({width: widthStyleRules});\n this._ogmaEdgeWidth = this._ogma.styles.addRule({\n edgeAttributes: {\n width: (edge: o.Edge | undefined) => {\n if (edge !== undefined) {\n return this._edgeAttributes.width(edge.getData());\n }\n }\n },\n edgeDependencies: {\n self: {data: true}\n }\n });\n } else {\n this._edgeAttributes.refresh({width: widthStyleRules});\n this._ogmaEdgeWidth.refresh();\n }\n }\n\n /**\n * Create / refresh an ogma rule for edge width\n *\n * @param {Array<LKStyleRule>} shapeStyleRules\n */\n public refreshEdgeShape(shapeStyleRules: Array<LKStyleRule<IEdgeStyle>>): void {\n if (!Tools.isDefined(this._ogmaEdgeShape)) {\n this._edgeAttributes.refresh({shape: shapeStyleRules});\n this._ogmaEdgeShape = this._ogma.styles.addRule({\n edgeAttributes: {\n shape: (edge: o.Edge | undefined) => {\n if (edge !== undefined) {\n return this._edgeAttributes.shape(edge.getData());\n }\n }\n },\n edgeDependencies: {self: {data: true}}\n });\n } else {\n this._edgeAttributes.refresh({shape: shapeStyleRules});\n this._ogmaEdgeShape.refresh();\n }\n }\n\n /**\n * Get node radius\n * This is a workaround for an ogma issue where the radius of virtual nodes is always set to 5\n * TODO: check if this is still needed after ogma release the new improvement for transformation v5.X\n */\n private _getNodeRadius(node: Node<LkNodeData, LkEdgeData>): number {\n if (!node.isVirtual()) {\n return node.getAttribute('radius') as number;\n } else {\n // get the width and height of the box that contains the nodes inside the virtual node\n const {width, height} = node.getSubNodes()?.getBoundingBox()!;\n return Math.max(width, height);\n }\n }\n\n /**\n * Calculate the scale of the pin badge related to the node radius\n * This is useful when dealing wih huge nodes, and we don't want the badge to be big\n * If the node is small enough, the badge will be 0.46 of the node radius\n * Else it will be 5 / radius\n */\n private _findPinBadgeScale(node: Node<LkNodeData, LkEdgeData>): number {\n // the maximum radius for the badge\n const MAX = 5;\n const defaultRatio = 0.46;\n const bigNodeRatio = 0.17;\n const radius = this._getNodeRadius(node);\n return radius * defaultRatio > MAX ? bigNodeRatio : defaultRatio;\n }\n\n /**\n * Find the color of the pin badge text\n */\n private _findPinBadgeTextColor(node: Node<LkNodeData, LkEdgeData>): string {\n if (node.isVirtual()) {\n return CLEAR_FONT_COLOR;\n }\n const nodeColor = Array.isArray(node.getAttribute('color'))\n ? node.getAttribute('color')![0]\n : node.getAttribute('color');\n return OgmaTools.isBright(nodeColor as o.Color) ? DARK_FONT_COLOR : CLEAR_FONT_COLOR;\n }\n\n /**\n * Find the color of the pin badge background\n */\n private _findPinBadgeBackgroundColor(node: Node<LkNodeData, LkEdgeData>): string {\n return node.isVirtual() ? BASE_GREY : 'inherit';\n }\n}\n","'use strict';\n\nimport * as Ogma from '@linkurious/ogma';\nimport {GraphSchemaTypeWithAccess, ItemFieldsCaptions} from '@linkurious/rest-client';\n\nimport {Captions, LKOgma} from '../..';\nimport {Tools} from '../../tools/tools';\n\nexport interface CaptionState {\n node: ItemFieldsCaptions;\n edge: ItemFieldsCaptions;\n}\n\nexport class CaptionsViz {\n public nodesCaptionsRule!: Ogma.StyleRule;\n public edgesCaptionsRule!: Ogma.StyleRule;\n private _ogma: LKOgma;\n private _captionSchema: CaptionState = {node: {}, edge: {}};\n private _graphSchema: {\n node: Array<GraphSchemaTypeWithAccess>;\n edge: Array<GraphSchemaTypeWithAccess>;\n } = {node: [], edge: []};\n\n constructor(\n ogma: LKOgma,\n private _nodeMaxTextLength: number | undefined,\n private _edgeMaxTextLength: number | undefined\n ) {\n this._ogma = ogma;\n }\n\n public set graphSchema(graphSchema: {\n node: Array<GraphSchemaTypeWithAccess>;\n edge: Array<GraphSchemaTypeWithAccess>;\n }) {\n this._graphSchema = graphSchema;\n }\n\n /**\n * Refresh the schema\n */\n public refreshSchema(schema: CaptionState): void {\n this._captionSchema = schema;\n }\n\n /**\n * Refresh visualization captions rules\n */\n public async initVizCaptions(schema: CaptionState): Promise<void> {\n if (this._ogma.LKCaptions.nodesCaptionsRule) {\n this._ogma.LKCaptions.refreshSchema(schema);\n await this._ogma.LKCaptions.updateNodeCaptions();\n } else {\n this._ogma.LKCaptions.updateNodeCaptions(schema.node);\n }\n if (this._ogma.LKCaptions.edgesCaptionsRule) {\n this._ogma.LKCaptions.refreshSchema(schema);\n await this._ogma.LKCaptions.updateEdgeCaptions();\n } else {\n this._ogma.LKCaptions.updateEdgeCaptions(schema.edge);\n }\n }\n\n /**\n * Create or update nodeCaptionRule\n */\n public updateNodeCaptions(schema?: ItemFieldsCaptions): Promise<void> | void {\n if (schema) {\n this._captionSchema.node = schema;\n }\n if (!Tools.isDefined(this.nodesCaptionsRule)) {\n this.nodesCaptionsRule = this._ogma.styles.addRule({\n nodeAttributes: {\n text: {\n content: (node: Ogma.Node | undefined) => {\n if (node === undefined) {\n return ``;\n }\n const value = Captions.getText(\n node.getData(),\n this._captionSchema.node,\n this._graphSchema.node\n );\n return Tools.isDefined(this._nodeMaxTextLength)\n ? Tools.truncate(value, 'middle', this._nodeMaxTextLength)\n : value;\n }\n }\n },\n // We ignore virtual nodes as they have their proper caption\n nodeSelector: (node) => !node.isVirtual(),\n nodeDependencies: {self: {data: true}}\n });\n } else {\n return this.nodesCaptionsRule.refresh();\n }\n }\n\n /**\n * Create or update edgeCaptionRule\n */\n public updateEdgeCaptions(schema?: ItemFieldsCaptions): Promise<void> | void {\n if (schema) {\n this._captionSchema.edge = schema;\n }\n if (!Tools.isDefined(this.edgesCaptionsRule)) {\n this.edgesCaptionsRule = this._ogma.styles.addRule({\n edgeAttributes: {\n text: {\n content: (edge: Ogma.Edge | undefined) => {\n if (edge === undefined || edge.getData() === undefined) {\n return ``;\n }\n const value = Captions.getText(\n edge.getData(),\n this._captionSchema.edge,\n this._graphSchema.edge\n );\n return Tools.isDefined(this._edgeMaxTextLength)\n ? Tools.truncate(value, 'middle', this._edgeMaxTextLength)\n : value;\n }\n }\n },\n edgeSelector: (edge) => !edge.isVirtual(),\n // ogma will trigger the rendering if data change or the shape change (to trigger the rendering when edges are grouped)\n edgeDependencies: {self: {data: true, attributes: ['shape.style']}}\n });\n } else {\n return this.edgesCaptionsRule.refresh();\n }\n }\n}\n","export function isFunction(value) {\n return typeof value === 'function';\n}\n//# sourceMappingURL=isFunction.js.map","import { isFunction } from './isFunction';\nexport function hasLift(source) {\n return isFunction(source === null || source === void 0 ? void 0 : source.lift);\n}\nexport function operate(init) {\n return function (source) {\n if (hasLift(source)) {\n return source.lift(function (liftedSource) {\n try {\n return init(liftedSource, this);\n }\n catch (err) {\n this.error(err);\n }\n });\n }\n throw new TypeError('Unable to lift unknown Observable type');\n };\n}\n//# sourceMappingURL=lift.js.map","/******************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\n\nvar extendStatics = function(d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n};\n\nexport function __extends(d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\nexport var __assign = function() {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n }\n return __assign.apply(this, arguments);\n}\n\nexport function __rest(s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n}\n\nexport function __decorate(decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\n\nexport function __param(paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n}\n\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\n var _, done = false;\n for (var i = decorators.length - 1; i >= 0; i--) {\n var context = {};\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\n if (kind === \"accessor\") {\n if (result === void 0) continue;\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\n if (_ = accept(result.get)) descriptor.get = _;\n if (_ = accept(result.set)) descriptor.set = _;\n if (_ = accept(result.init)) initializers.unshift(_);\n }\n else if (_ = accept(result)) {\n if (kind === \"field\") initializers.unshift(_);\n else descriptor[key] = _;\n }\n }\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\n done = true;\n};\n\nexport function __runInitializers(thisArg, initializers, value) {\n var useValue = arguments.length > 2;\n for (var i = 0; i < initializers.length; i++) {\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\n }\n return useValue ? value : void 0;\n};\n\nexport function __propKey(x) {\n return typeof x === \"symbol\" ? x : \"\".concat(x);\n};\n\nexport function __setFunctionName(f, name, prefix) {\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\n};\n\nexport function __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\n}\n\nexport function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n}\n\nexport function __generator(thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n}\n\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\n\nexport function __exportStar(m, o) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\n}\n\nexport function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\n\nexport function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n}\n\n/** @deprecated */\nexport function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++)\n ar = ar.concat(__read(arguments[i]));\n return ar;\n}\n\n/** @deprecated */\nexport function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n}\n\nexport function __spreadArray(to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n}\n\nexport function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n}\n\nexport function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n}\n\nexport function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\n}\n\nexport function __asyncValues(o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n}\n\nexport function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\n\nvar __setModuleDefault = Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n};\n\nexport function __importStar(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n}\n\nexport function __importDefault(mod) {\n return (mod && mod.__esModule) ? mod : { default: mod };\n}\n\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n}\n\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n}\n\nexport function __classPrivateFieldIn(state, receiver) {\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\n}\n\nexport function __addDisposableResource(env, value, async) {\n if (value !== null && value !== void 0) {\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\n var dispose, inner;\n if (async) {\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\n dispose = value[Symbol.asyncDispose];\n }\n if (dispose === void 0) {\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\n dispose = value[Symbol.dispose];\n if (async) inner = dispose;\n }\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\n env.stack.push({ value: value, dispose: dispose, async: async });\n }\n else if (async) {\n env.stack.push({ async: true });\n }\n return value;\n}\n\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\n var e = new Error(message);\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\n};\n\nexport function __disposeResources(env) {\n function fail(e) {\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\n env.hasError = true;\n }\n var r, s = 0;\n function next() {\n while (r = env.stack.pop()) {\n try {\n if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\n if (r.dispose) {\n var result = r.dispose.call(r.value);\n if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\n }\n else s |= 1;\n }\n catch (e) {\n fail(e);\n }\n }\n if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\n if (env.hasError) throw env.error;\n }\n return next();\n}\n\nexport function __rewriteRelativeImportExtension(path, preserveJsx) {\n if (typeof path === \"string\" && /^\\.\\.?\\//.test(path)) {\n return path.replace(/\\.(tsx)$|((?:\\.d)?)((?:\\.[^./]+?)?)\\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {\n return tsx ? preserveJsx ? \".jsx\" : \".js\" : d && (!ext || !cm) ? m : (d + ext + \".\" + cm.toLowerCase() + \"js\");\n });\n }\n return path;\n}\n\nexport default {\n __extends,\n __assign,\n __rest,\n __decorate,\n __param,\n __esDecorate,\n __runInitializers,\n __propKey,\n __setFunctionName,\n __metadata,\n __awaiter,\n __generator,\n __createBinding,\n __exportStar,\n __values,\n __read,\n __spread,\n __spreadArrays,\n __spreadArray,\n __await,\n __asyncGenerator,\n __asyncDelegator,\n __asyncValues,\n __makeTemplateObject,\n __importStar,\n __importDefault,\n __classPrivateFieldGet,\n __classPrivateFieldSet,\n __classPrivateFieldIn,\n __addDisposableResource,\n __disposeResources,\n __rewriteRelativeImportExtension,\n};\n","export function createErrorClass(createImpl) {\n var _super = function (instance) {\n Error.call(instance);\n instance.stack = new Error().stack;\n };\n var ctorFunc = createImpl(_super);\n ctorFunc.prototype = Object.create(Error.prototype);\n ctorFunc.prototype.constructor = ctorFunc;\n return ctorFunc;\n}\n//# sourceMappingURL=createErrorClass.js.map","import { createErrorClass } from './createErrorClass';\nexport var UnsubscriptionError = createErrorClass(function (_super) {\n return function UnsubscriptionErrorImpl(errors) {\n _super(this);\n this.message = errors\n ? errors.length + \" errors occurred during unsubscription:\\n\" + errors.map(function (err, i) { return i + 1 + \") \" + err.toString(); }).join('\\n ')\n : '';\n this.name = 'UnsubscriptionError';\n this.errors = errors;\n };\n});\n//# sourceMappingURL=UnsubscriptionError.js.map","export function arrRemove(arr, item) {\n if (arr) {\n var index = arr.indexOf(item);\n 0 <= index && arr.splice(index, 1);\n }\n}\n//# sourceMappingURL=arrRemove.js.map","import { __read, __spreadArray, __values } from \"tslib\";\nimport { isFunction } from './util/isFunction';\nimport { UnsubscriptionError } from './util/UnsubscriptionError';\nimport { arrRemove } from './util/arrRemove';\nvar Subscription = (function () {\n function Subscription(initialTeardown) {\n this.initialTeardown = initialTeardown;\n this.closed = false;\n this._parentage = null;\n this._finalizers = null;\n }\n Subscription.prototype.unsubscribe = function () {\n var e_1, _a, e_2, _b;\n var errors;\n if (!this.closed) {\n this.closed = true;\n var _parentage = this._parentage;\n if (_parentage) {\n this._parentage = null;\n if (Array.isArray(_parentage)) {\n try {\n for (var _parentage_1 = __values(_parentage), _parentage_1_1 = _parentage_1.next(); !_parentage_1_1.done; _parentage_1_1 = _parentage_1.next()) {\n var parent_1 = _parentage_1_1.value;\n parent_1.remove(this);\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_parentage_1_1 && !_parentage_1_1.done && (_a = _parentage_1.return)) _a.call(_parentage_1);\n }\n finally { if (e_1) throw e_1.error; }\n }\n }\n else {\n _parentage.remove(this);\n }\n }\n var initialFinalizer = this.initialTeardown;\n if (isFunction(initialFinalizer)) {\n try {\n initialFinalizer();\n }\n catch (e) {\n errors = e instanceof UnsubscriptionError ? e.errors : [e];\n }\n }\n var _finalizers = this._finalizers;\n if (_finalizers) {\n this._finalizers = null;\n try {\n for (var _finalizers_1 = __values(_finalizers), _finalizers_1_1 = _finalizers_1.next(); !_finalizers_1_1.done; _finalizers_1_1 = _finalizers_1.next()) {\n var finalizer = _finalizers_1_1.value;\n try {\n execFinalizer(finalizer);\n }\n catch (err) {\n errors = errors !== null && errors !== void 0 ? errors : [];\n if (err instanceof UnsubscriptionError) {\n errors = __spreadArray(__spreadArray([], __read(errors)), __read(err.errors));\n }\n else {\n errors.push(err);\n }\n }\n }\n }\n catch (e_2_1) { e_2 = { error: e_2_1 }; }\n finally {\n try {\n if (_finalizers_1_1 && !_finalizers_1_1.done && (_b = _finalizers_1.return)) _b.call(_finalizers_1);\n }\n finally { if (e_2) throw e_2.error; }\n }\n }\n if (errors) {\n throw new UnsubscriptionError(errors);\n }\n }\n };\n Subscription.prototype.add = function (teardown) {\n var _a;\n if (teardown && teardown !== this) {\n if (this.closed) {\n execFinalizer(teardown);\n }\n else {\n if (teardown instanceof Subscription) {\n if (teardown.closed || teardown._hasParent(this)) {\n return;\n }\n teardown._addParent(this);\n }\n (this._finalizers = (_a = this._finalizers) !== null && _a !== void 0 ? _a : []).push(teardown);\n }\n }\n };\n Subscription.prototype._hasParent = function (parent) {\n var _parentage = this._parentage;\n return _parentage === parent || (Array.isArray(_parentage) && _parentage.includes(parent));\n };\n Subscription.prototype._addParent = function (parent) {\n var _parentage = this._parentage;\n this._parentage = Array.isArray(_parentage) ? (_parentage.push(parent), _parentage) : _parentage ? [_parentage, parent] : parent;\n };\n Subscription.prototype._removeParent = function (parent) {\n var _parentage = this._parentage;\n if (_parentage === parent) {\n this._parentage = null;\n }\n else if (Array.isArray(_parentage)) {\n arrRemove(_parentage, parent);\n }\n };\n Subscription.prototype.remove = function (teardown) {\n var _finalizers = this._finalizers;\n _finalizers && arrRemove(_finalizers, teardown);\n if (teardown instanceof Subscription) {\n teardown._removeParent(this);\n }\n };\n Subscription.EMPTY = (function () {\n var empty = new Subscription();\n empty.closed = true;\n return empty;\n })();\n return Subscription;\n}());\nexport { Subscription };\nexport var EMPTY_SUBSCRIPTION = Subscription.EMPTY;\nexport function isSubscription(value) {\n return (value instanceof Subscription ||\n (value && 'closed' in value && isFunction(value.remove) && isFunction(value.add) && isFunction(value.unsubscribe)));\n}\nfunction execFinalizer(finalizer) {\n if (isFunction(finalizer)) {\n finalizer();\n }\n else {\n finalizer.unsubscribe();\n }\n}\n//# sourceMappingURL=Subscription.js.map","export var config = {\n onUnhandledError: null,\n onStoppedNotification: null,\n Promise: undefined,\n useDeprecatedSynchronousErrorHandling: false,\n useDeprecatedNextContext: false,\n};\n//# sourceMappingURL=config.js.map","import { __read, __spreadArray } from \"tslib\";\nexport var timeoutProvider = {\n setTimeout: function (handler, timeout) {\n var args = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n args[_i - 2] = arguments[_i];\n }\n var delegate = timeoutProvider.delegate;\n if (delegate === null || delegate === void 0 ? void 0 : delegate.setTimeout) {\n return delegate.setTimeout.apply(delegate, __spreadArray([handler, timeout], __read(args)));\n }\n return setTimeout.apply(void 0, __spreadArray([handler, timeout], __read(args)));\n },\n clearTimeout: function (handle) {\n var delegate = timeoutProvider.delegate;\n return ((delegate === null || delegate === void 0 ? void 0 : delegate.clearTimeout) || clearTimeout)(handle);\n },\n delegate: undefined,\n};\n//# sourceMappingURL=timeoutProvider.js.map","import { config } from '../config';\nimport { timeoutProvider } from '../scheduler/timeoutProvider';\nexport function reportUnhandledError(err) {\n timeoutProvider.setTimeout(function () {\n var onUnhandledError = config.onUnhandledError;\n if (onUnhandledError) {\n onUnhandledError(err);\n }\n else {\n throw err;\n }\n });\n}\n//# sourceMappingURL=reportUnhandledError.js.map","export function noop() { }\n//# sourceMappingURL=noop.js.map","import { __extends } from \"tslib\";\nimport { isFunction } from './util/isFunction';\nimport { isSubscription, Subscription } from './Subscription';\nimport { config } from './config';\nimport { reportUnhandledError } from './util/reportUnhandledError';\nimport { noop } from './util/noop';\nimport { nextNotification, errorNotification, COMPLETE_NOTIFICATION } from './NotificationFactories';\nimport { timeoutProvider } from './scheduler/timeoutProvider';\nimport { captureError } from './util/errorContext';\nvar Subscriber = (function (_super) {\n __extends(Subscriber, _super);\n function Subscriber(destination) {\n var _this = _super.call(this) || this;\n _this.isStopped = false;\n if (destination) {\n _this.destination = destination;\n if (isSubscription(destination)) {\n destination.add(_this);\n }\n }\n else {\n _this.destination = EMPTY_OBSERVER;\n }\n return _this;\n }\n Subscriber.create = function (next, error, complete) {\n return new SafeSubscriber(next, error, complete);\n };\n Subscriber.prototype.next = function (value) {\n if (this.isStopped) {\n handleStoppedNotification(nextNotification(value), this);\n }\n else {\n this._next(value);\n }\n };\n Subscriber.prototype.error = function (err) {\n if (this.isStopped) {\n handleStoppedNotification(errorNotification(err), this);\n }\n else {\n this.isStopped = true;\n this._error(err);\n }\n };\n Subscriber.prototype.complete = function () {\n if (this.isStopped) {\n handleStoppedNotification(COMPLETE_NOTIFICATION, this);\n }\n else {\n this.isStopped = true;\n this._complete();\n }\n };\n Subscriber.prototype.unsubscribe = function () {\n if (!this.closed) {\n this.isStopped = true;\n _super.prototype.unsubscribe.call(this);\n this.destination = null;\n }\n };\n Subscriber.prototype._next = function (value) {\n this.destination.next(value);\n };\n Subscriber.prototype._error = function (err) {\n try {\n this.destination.error(err);\n }\n finally {\n this.unsubscribe();\n }\n };\n Subscriber.prototype._complete = function () {\n try {\n this.destination.complete();\n }\n finally {\n this.unsubscribe();\n }\n };\n return Subscriber;\n}(Subscription));\nexport { Subscriber };\nvar _bind = Function.prototype.bind;\nfunction bind(fn, thisArg) {\n return _bind.call(fn, thisArg);\n}\nvar ConsumerObserver = (function () {\n function ConsumerObserver(partialObserver) {\n this.partialObserver = partialObserver;\n }\n ConsumerObserver.prototype.next = function (value) {\n var partialObserver = this.partialObserver;\n if (partialObserver.next) {\n try {\n partialObserver.next(value);\n }\n catch (error) {\n handleUnhandledError(error);\n }\n }\n };\n ConsumerObserver.prototype.error = function (err) {\n var partialObserver = this.partialObserver;\n if (partialObserver.error) {\n try {\n partialObserver.error(err);\n }\n catch (error) {\n handleUnhandledError(error);\n }\n }\n else {\n handleUnhandledError(err);\n }\n };\n ConsumerObserver.prototype.complete = function () {\n var partialObserver = this.partialObserver;\n if (partialObserver.complete) {\n try {\n partialObserver.complete();\n }\n catch (error) {\n handleUnhandledError(error);\n }\n }\n };\n return ConsumerObserver;\n}());\nvar SafeSubscriber = (function (_super) {\n __extends(SafeSubscriber, _super);\n function SafeSubscriber(observerOrNext, error, complete) {\n var _this = _super.call(this) || this;\n var partialObserver;\n if (isFunction(observerOrNext) || !observerOrNext) {\n partialObserver = {\n next: (observerOrNext !== null && observerOrNext !== void 0 ? observerOrNext : undefined),\n error: error !== null && error !== void 0 ? error : undefined,\n complete: complete !== null && complete !== void 0 ? complete : undefined,\n };\n }\n else {\n var context_1;\n if (_this && config.useDeprecatedNextContext) {\n context_1 = Object.create(observerOrNext);\n context_1.unsubscribe = function () { return _this.unsubscribe(); };\n partialObserver = {\n next: observerOrNext.next && bind(observerOrNext.next, context_1),\n error: observerOrNext.error && bind(observerOrNext.error, context_1),\n complete: observerOrNext.complete && bind(observerOrNext.complete, context_1),\n };\n }\n else {\n partialObserver = observerOrNext;\n }\n }\n _this.destination = new ConsumerObserver(partialObserver);\n return _this;\n }\n return SafeSubscriber;\n}(Subscriber));\nexport { SafeSubscriber };\nfunction handleUnhandledError(error) {\n if (config.useDeprecatedSynchronousErrorHandling) {\n captureError(error);\n }\n else {\n reportUnhandledError(error);\n }\n}\nfunction defaultErrorHandler(err) {\n throw err;\n}\nfunction handleStoppedNotification(notification, subscriber) {\n var onStoppedNotification = config.onStoppedNotification;\n onStoppedNotification && timeoutProvider.setTimeout(function () { return onStoppedNotification(notification, subscriber); });\n}\nexport var EMPTY_OBSERVER = {\n closed: true,\n next: noop,\n error: defaultErrorHandler,\n complete: noop,\n};\n//# sourceMappingURL=Subscriber.js.map","export function identity(x) {\n return x;\n}\n//# sourceMappingURL=identity.js.map","import { __extends } from \"tslib\";\nimport { Subscriber } from '../Subscriber';\nexport function createOperatorSubscriber(destination, onNext, onComplete, onError, onFinalize) {\n return new OperatorSubscriber(destination, onNext, onComplete, onError, onFinalize);\n}\nvar OperatorSubscriber = (function (_super) {\n __extends(OperatorSubscriber, _super);\n function OperatorSubscriber(destination, onNext, onComplete, onError, onFinalize, shouldUnsubscribe) {\n var _this = _super.call(this, destination) || this;\n _this.onFinalize = onFinalize;\n _this.shouldUnsubscribe = shouldUnsubscribe;\n _this._next = onNext\n ? function (value) {\n try {\n onNext(value);\n }\n catch (err) {\n destination.error(err);\n }\n }\n : _super.prototype._next;\n _this._error = onError\n ? function (err) {\n try {\n onError(err);\n }\n catch (err) {\n destination.error(err);\n }\n finally {\n this.unsubscribe();\n }\n }\n : _super.prototype._error;\n _this._complete = onComplete\n ? function () {\n try {\n onComplete();\n }\n catch (err) {\n destination.error(err);\n }\n finally {\n this.unsubscribe();\n }\n }\n : _super.prototype._complete;\n return _this;\n }\n OperatorSubscriber.prototype.unsubscribe = function () {\n var _a;\n if (!this.shouldUnsubscribe || this.shouldUnsubscribe()) {\n var closed_1 = this.closed;\n _super.prototype.unsubscribe.call(this);\n !closed_1 && ((_a = this.onFinalize) === null || _a === void 0 ? void 0 : _a.call(this));\n }\n };\n return OperatorSubscriber;\n}(Subscriber));\nexport { OperatorSubscriber };\n//# sourceMappingURL=OperatorSubscriber.js.map","import { operate } from '../util/lift';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\nexport function map(project, thisArg) {\n return operate(function (source, subscriber) {\n var index = 0;\n source.subscribe(createOperatorSubscriber(subscriber, function (value) {\n subscriber.next(project.call(thisArg, value, index++));\n }));\n });\n}\n//# sourceMappingURL=map.js.map","import { identity } from '../util/identity';\nimport { operate } from '../util/lift';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\nexport function distinctUntilChanged(comparator, keySelector) {\n if (keySelector === void 0) { keySelector = identity; }\n comparator = comparator !== null && comparator !== void 0 ? comparator : defaultCompare;\n return operate(function (source, subscriber) {\n var previousKey;\n var first = true;\n source.subscribe(createOperatorSubscriber(subscriber, function (value) {\n var currentKey = keySelector(value);\n if (first || !comparator(previousKey, currentKey)) {\n first = false;\n previousKey = currentKey;\n subscriber.next(value);\n }\n }));\n });\n}\nfunction defaultCompare(a, b) {\n return a === b;\n}\n//# sourceMappingURL=distinctUntilChanged.js.map","'use strict';\n\nimport {BehaviorSubject, Observable} from 'rxjs';\nimport {distinctUntilChanged, map} from 'rxjs/operators';\n\nimport {Tools} from '../../tools/tools';\n\nimport {DummyNodeList, OgmaState} from './reactive';\n\nexport class OgmaStore extends BehaviorSubject<OgmaState> {\n constructor(d: OgmaState) {\n super(d);\n }\n\n /**\n * Modify Ogma state based on a method\n */\n public dispatch(mapFn: (state: OgmaState) => OgmaState): void {\n this.next(mapFn(this.value));\n }\n\n /**\n * Return a piece of state\n */\n public selectStore<K>(mapFn: (state: OgmaState) => K): Observable<K> {\n return this.pipe(\n map(mapFn),\n distinctUntilChanged((p, n) => Tools.isEqual(p, n))\n );\n }\n\n /**\n * Clear the state of Ogma\n */\n public clear(): void {\n this.next({\n selection: new DummyNodeList() as any,\n items: {node: [], edge: []},\n changes: undefined,\n animation: false\n });\n }\n}\n","'use strict';\n\nimport Ogma, {NodeList, EdgeList} from '@linkurious/ogma';\nimport {LkEdgeData, LkNodeData} from '@linkurious/rest-client';\n\nimport {LKOgma} from '../index';\n\nimport {OgmaStore} from './OgmaStore';\n\nexport interface OgmaState {\n selection: NodeList<LkNodeData, LkEdgeData> | EdgeList<LkEdgeData, LkNodeData>;\n items: {node: Array<string | number>; edge: Array<string | number>};\n changes: {entityType: 'node' | 'edge'; input: string | string[] | null; value: any} | undefined;\n /**\n * Indicates whether the positions of nodes or edges are currently transitioning.\n */\n animation: boolean;\n}\n\nexport class RxViz {\n private _ogma: Ogma;\n private _store: OgmaStore = new OgmaStore({\n selection: new DummyNodeList() as any,\n items: {node: [], edge: []},\n changes: undefined,\n animation: false\n });\n private _animationThrottle: any;\n\n constructor(ogma: LKOgma) {\n this._ogma = ogma;\n this.listenToSelectionEvents();\n }\n\n public get store(): OgmaStore {\n return this._store;\n }\n\n /**\n * Listen to ogma events and update the state\n */\n public listenToSelectionEvents(): void {\n let currentAnimationEnd = Date.now();\n let isCurrentlyAnimating = false;\n this._ogma.events.on('animate', (e: {duration: number; updatesPositions: boolean}) => {\n if (e.updatesPositions === false) {\n // ignore animations that don't change the node/edge positions, e.g: Hover\n return;\n }\n if (!isCurrentlyAnimating) {\n isCurrentlyAnimating = true;\n this._store.dispatch((state) => ({...state, animation: true}));\n }\n const nextAnimationEnd = Math.max(currentAnimationEnd, Date.now() + e.duration);\n if (nextAnimationEnd === currentAnimationEnd) {\n // Say animation 2 fires after animation 1 but has a much shorter duration\n // In such a way that animation 1 will still complete after animation 2\n // In that case we can safely ignore animation 2\n return;\n }\n currentAnimationEnd = nextAnimationEnd;\n const safeAnimationTimeoutMs = currentAnimationEnd - Date.now() + 16; // animation duration + duration of a single frame at 60 fps = 16ms\n clearTimeout(this._animationThrottle);\n this._animationThrottle = setTimeout(() => {\n isCurrentlyAnimating = false;\n this._store.dispatch((state) => ({...state, animation: false}));\n }, safeAnimationTimeoutMs);\n });\n\n this._ogma.events.on('dragStart', () => {\n this._store.dispatch((state) => ({...state, animation: true}));\n });\n\n this._ogma.events.on('dragEnd', () => {\n this._store.dispatch((state) => ({...state, animation: false}));\n });\n\n this._ogma.events.on('addNodes', () => {\n this._store.dispatch(this.storeItems.bind(this));\n });\n this._ogma.events.on('removeNodes', () => {\n this._store.dispatch(this.storeItems.bind(this));\n });\n this._ogma.events.on('addEdges', () => {\n this._store.dispatch(this.storeItems.bind(this));\n });\n this._ogma.events.on('removeEdges', () => {\n this._store.dispatch(this.storeItems.bind(this));\n });\n\n this._ogma.events.on('nodesSelected', () => {\n this._store.dispatch(this.storeNodeSelection.bind(this));\n });\n\n this._ogma.events.on('edgesSelected', () => {\n this._store.dispatch(this.storeEdgeSelection.bind(this));\n });\n\n this._ogma.events.on('nodesUnselected', () => {\n this._store.dispatch(this.storeNodeSelection.bind(this));\n });\n\n this._ogma.events.on('edgesUnselected', () => {\n this._store.dispatch(this.storeEdgeSelection.bind(this));\n });\n\n this._ogma.events.on('updateNodeData', (evt) => {\n if (evt !== undefined) {\n evt.changes.forEach((change) => {\n this._store.dispatch((state) => ({\n ...state,\n changes: {\n entityType: 'node',\n input: change.property,\n value: change.newValues[0]\n }\n }));\n });\n }\n });\n\n this._ogma.events.on('updateEdgeData', (evt) => {\n if (evt !== undefined) {\n evt.changes.forEach((change) => {\n this._store.dispatch((state) => ({\n ...state,\n changes: {\n entityType: 'edge',\n input: change.property,\n value: change.newValues[0]\n }\n }));\n });\n }\n });\n }\n\n /**\n * Store new items in state\n */\n private storeItems(state: OgmaState): OgmaState {\n return {\n ...state,\n items: {\n node: this._ogma.getNodes().getId(),\n edge: this._ogma.getEdges().getId()\n }\n };\n }\n\n /**\n * Store new node selection in state\n */\n private storeNodeSelection(state: OgmaState): OgmaState {\n return {\n ...state,\n selection: this._ogma.getSelectedNodes()\n };\n }\n\n /**\n * store new edge selection in state\n */\n private storeEdgeSelection(state: OgmaState): OgmaState {\n return {\n ...state,\n selection: this._ogma.getSelectedEdges()\n };\n }\n}\n\nexport class DummyNodeList {\n public size = 0;\n public isNode = true;\n}\n","import {\n EntityType,\n ForceLayoutMode,\n HierarchicalLayoutMode,\n IOgmaConfig,\n LkEdgeData,\n LkNodeData,\n PopulatedVisualization,\n VizEdge,\n VizNode\n} from '@linkurious/rest-client';\nimport Ogma, {\n EdgeList,\n ForceLayoutOptions,\n HierarchicalLayoutOptions,\n NodeId,\n NodeList,\n NonObjectPropertyWatcher,\n RadialLayoutOptions,\n RawEdge,\n RawGraph,\n RawNode\n} from '@linkurious/ogma';\n\nimport {StyleRules} from '..';\nimport {Tools} from '../tools/tools';\n\nimport {StylesViz} from './features/styles';\nimport {TransformationsViz} from './features/transformations';\nimport {CaptionsViz} from './features/captions';\nimport {RxViz} from './features/reactive';\nimport {OgmaStore} from './features/OgmaStore';\nimport {NodeGroupingTransformation} from './features/nodeGrouping';\n\nexport {default as Ogma} from '@linkurious/ogma';\nexport const ANIMATION_DURATION = 750;\n\ninterface AddItemOptions {\n batchSize?: number;\n virtual?: boolean;\n}\n\nexport const FORCE_LAYOUT_CONFIG = {\n steps: 40,\n alignSiblings: true,\n charge: 5,\n theta: 0.34,\n duration: ANIMATION_DURATION\n};\n\nexport class LKOgma extends Ogma<LkNodeData, LkEdgeData> {\n public LKStyles!: StylesViz;\n public LKCaptions!: CaptionsViz;\n public LKTransformation!: TransformationsViz;\n // Trigger an event with node category changes\n public nodeCategoriesWatcher!: NonObjectPropertyWatcher<LkNodeData, LkEdgeData>;\n // Trigger an event with edge type changes\n public edgeTypeWatcher!: NonObjectPropertyWatcher<LkNodeData, LkEdgeData>;\n public store!: OgmaStore;\n // Node Grouping transformation instance\n public LkNodeGroupingTransformation!: NodeGroupingTransformation;\n private _reactive!: RxViz;\n\n constructor(\n private _configuration: IOgmaConfig,\n _baseUrl?: string\n ) {\n // set Ogma global configuration\n super(_configuration);\n Object.setPrototypeOf(this, new.target.prototype);\n this.initOgmaLinkuriousParser(true, _baseUrl);\n }\n\n /**\n * Initialize the Ogma instance with the configuration and the base url\n * @param init used to know if the instance is initialized for the first time (used in setConfigOgma)\n * @param baseUrl base url used for relative image urls\n * @private\n */\n private initOgmaLinkuriousParser(init?: boolean, baseUrl?: string): void {\n this.nodeCategoriesWatcher = this.schema.watchNodeNonObjectProperty({\n path: 'categories',\n unwindArrays: true,\n filter: 'all'\n });\n this.edgeTypeWatcher = this.schema.watchEdgeNonObjectProperty({\n path: 'type',\n filter: 'all'\n });\n // set ogma max zoom value and selection with mouse option (false?)\n this.setOptions({\n interactions: {\n zoom: {\n maxValue: (params) => {\n return 128 / params.smallestNodeSize;\n }\n },\n selection: {\n enabled: false\n }\n }\n });\n\n // only instantiate the store once when app is starting\n if (this._reactive === undefined) {\n this._reactive = new RxViz(this);\n this.store = this._reactive.store;\n } else {\n // if store already exist, but ogma was reset, create new ogma event listener\n this._reactive.listenToSelectionEvents();\n }\n this.initSelection();\n this.setConfigOgma(this._configuration, init, baseUrl);\n this.LKTransformation = new TransformationsViz(this);\n this.LkNodeGroupingTransformation = new NodeGroupingTransformation(this);\n\n this.LKStyles.setNodesDefaultHalo();\n this.LKStyles.setEdgesDefaultHalo();\n this.LKStyles.setBadgeRule();\n this.LKStyles.setFilterClass();\n }\n\n /**\n * Initialize selection behavior\n */\n public initSelection(): void {\n this.events.onClick((e) => {\n if (e !== undefined && e.button === 'left') {\n if (e.target !== null) {\n const multiSelectionKey = navigator.platform === 'MacIntel' ? 'cmd' : 'ctrl';\n if (this.keyboard.isKeyPressed(multiSelectionKey)) {\n if (e.target.isNode && this.getSelectedEdges().size > 0) {\n this.getSelectedEdges().setSelected(false);\n }\n if (!e.target.isNode && this.getSelectedNodes().size > 0) {\n this.getSelectedNodes().setSelected(false);\n }\n if (e.target.isSelected()) {\n e.target.setSelected(false);\n } else {\n e.target.setSelected(true);\n }\n } else {\n this.getSelectedNodes().setSelected(false);\n this.getSelectedEdges().setSelected(false);\n e.target.setSelected(true);\n }\n } else {\n this.getSelectedNodes().setSelected(false);\n this.getSelectedEdges().setSelected(false);\n }\n }\n });\n }\n\n private setStyles(configuration: IOgmaConfig, baseUrl?: string): void {\n this.LKStyles = new StylesViz(this, {\n node: configuration?.options?.styles?.node || {},\n edge: configuration?.options?.styles?.edge || {},\n baseUrl: baseUrl\n });\n this.LKStyles.setNodesDefaultStyles();\n this.LKStyles.setEdgesDefaultStyles();\n }\n\n private setCaptions(configuration: IOgmaConfig): void {\n const nodeMaxTextLength = configuration?.options?.styles?.node?.text?.maxTextLength;\n const edgeMaxTextLength = configuration?.options?.styles?.edge?.text?.maxTextLength;\n this.LKCaptions = new CaptionsViz(this, nodeMaxTextLength, edgeMaxTextLength);\n }\n\n /**\n * Returns Ogma Layout parameters according to visualization layout settings\n * */\n public getForceLayoutParams(mode: ForceLayoutMode, duration = 0): ForceLayoutOptions {\n let dynamicSteps = 300 - ((300 - 40) / 5000) * this.getNodes().size;\n if (dynamicSteps < 40) {\n dynamicSteps = 40;\n }\n return {\n steps: mode === ForceLayoutMode.FAST ? dynamicSteps : 300,\n alignSiblings: this.getNodes().size > 3,\n duration: duration,\n charge: 20,\n gravity: 0.08,\n theta: this.getNodes().size > 100 ? 0.8 : 0.34\n };\n }\n\n public getRadialLayoutParams(\n rootNode: string,\n duration = 0\n ): RadialLayoutOptions<unknown, unknown> {\n return {\n centralNode: rootNode,\n radiusDelta: 1,\n nodeGap: 10,\n repulsion: this.getNodes().size > 80 ? 1 : 6,\n duration: duration\n };\n }\n\n public getHierarchicalLayoutParams(\n mode: HierarchicalLayoutMode,\n rootNode: string,\n duration = 0\n ): HierarchicalLayoutOptions {\n return {\n direction: mode,\n roots: [rootNode],\n duration: duration\n };\n }\n\n /**\n * Initialize graph.\n * add nodes and edges to the viz and init the selection.\n */\n public async init(visualization: {nodes: Array<VizNode>; edges: Array<VizEdge>}): Promise<void> {\n this.clearGraph();\n let selectedEntityType: EntityType | undefined = undefined;\n let selectedElements: Array<string> = [];\n // need to remove selected in every items before adding them to Ogma\n const fixedNodes = visualization.nodes.map((node) => {\n if (node.attributes.selected) {\n selectedEntityType = EntityType.NODE;\n selectedElements.push(node.id);\n }\n delete node.attributes.selected;\n return node;\n });\n const fixedEdges = visualization.edges.map((edge) => {\n if (edge.attributes !== undefined) {\n if (edge.attributes.selected) {\n if (selectedEntityType === undefined || selectedEntityType === EntityType.NODE) {\n selectedEntityType = EntityType.EDGE;\n selectedElements = [];\n }\n selectedElements.push(edge.id);\n }\n delete edge.attributes.selected;\n }\n return edge;\n });\n await this.addGraphAfterValidation({\n nodes: fixedNodes as Array<RawNode<LkNodeData>>,\n edges: fixedEdges as Array<RawEdge<LkEdgeData>>\n });\n if (selectedEntityType === EntityType.NODE) {\n this.getNodes(selectedElements).setSelected(true);\n } else if (selectedEntityType === EntityType.EDGE) {\n this.getEdges(selectedElements).setSelected(true);\n }\n }\n\n public async initVisualization(visualization: PopulatedVisualization): Promise<void> {\n await this.init(visualization);\n const styles = StyleRules.sanitizeStylesIndex(visualization.design.styles);\n this.LKStyles.initNodeColors(styles.node);\n this.LKStyles.initNodesIcons(styles.node);\n this.LKStyles.initNodesSizes(styles.node);\n this.LKStyles.initNodesShapes(styles.node);\n this.LKStyles.initEdgesWidth(styles.edge);\n this.LKStyles.initEdgesShape(styles.edge);\n this.LKStyles.initEdgesColor(styles.edge);\n await this.LKCaptions.initVizCaptions({\n node: visualization.nodeFields.captions || {},\n edge: visualization.edgeFields.captions || {}\n });\n this.LKTransformation.groupedEdges = visualization.edgeGrouping;\n await this.LKTransformation.initTransformation();\n this.LKTransformation.initEdgeGroupingStyle();\n }\n\n /**\n * Adding nodes then adding edges to the graph\n */\n public async addGraphAfterValidation(graph: RawGraph<LkNodeData, LkEdgeData>): Promise<{\n nodes: NodeList<LkNodeData>;\n edges: EdgeList<LkEdgeData>;\n }> {\n const addedNodes = await this.addNodes(graph.nodes);\n const addedEdges = await this.addEdges(graph.edges);\n return {\n nodes: addedNodes,\n edges: addedEdges\n };\n }\n\n /**\n * Adding edges to the graph after filtering disconnected ones\n */\n public addEdges(edges: Array<RawEdge<LkEdgeData>>, options?: AddItemOptions): Promise<EdgeList> {\n return super.addEdges(edges, {...options, ignoreInvalid: true});\n }\n\n /**\n * Return the list of non filtered nodes\n */\n public getNonFilteredNodes(items?: Array<NodeId>): NodeList<LkNodeData, LkEdgeData> {\n return Tools.isDefined(items)\n ? this.getNodes(items).filter((i) => !i.hasClass('filtered'))\n : // take only none virtual nodes\n this.getNodes('raw').filter((i) => !i.hasClass('filtered'));\n }\n\n /**\n * Return the list of filtered nodes\n * @param items items to check if they are filtered\n * @param filter type of nodes to check if they are filtered ( nodes that are visible, raw nodes (none virtual) or all nodes)\n */\n public getFilteredNodes(\n items?: Array<NodeId>,\n filter: 'visible' | 'raw' | 'all' = 'raw'\n ): NodeList<LkNodeData, LkEdgeData> {\n return Tools.isDefined(items)\n ? this.getNodes(items).filter((i) => i.hasClass('filtered'))\n : this.getNodes(filter).filter((i) => i.hasClass('filtered'));\n }\n\n /**\n * Return the list of non filtered edges\n */\n public getNonFilteredEdges(items?: Array<any>): EdgeList<LkEdgeData, LkNodeData> {\n return Tools.isDefined(items)\n ? this.getEdges(items).filter((i) => !i.hasClass('filtered'))\n : this.getEdges('raw').filter((i) => !i.hasClass('filtered'));\n }\n\n /**\n * Return the list of filtered edges\n */\n public getFilteredEdges(\n items?: Array<any>,\n filter: 'visible' | 'raw' | 'all' = 'raw'\n ): EdgeList<LkEdgeData, LkNodeData> {\n return Tools.isDefined(items)\n ? this.getEdges(items).filter((i) => i.hasClass('filtered'))\n : this.getEdges(filter).filter((i) => i.hasClass('filtered'));\n }\n\n /**\n * Do a full reset on ogma and streams of ogma\n */\n public shutDown(): void {\n this.destroy();\n if (this.store) {\n this.store.clear();\n }\n }\n\n /**\n * Reset the Ogma instance so that it can be used fresh in the next visulization\n */\n public clearOgmaState(): void {\n this.reset();\n if (this.store) {\n this.store.clear();\n }\n this.initOgmaLinkuriousParser();\n }\n\n /**\n * Updates the Ogma config when config changes in LKE. If init, options were already set by the Ogma.reset()\n */\n public setConfigOgma(configuration?: IOgmaConfig, init?: boolean, baseUrl?: string): void {\n if (configuration) {\n // here we make sure that the internal config object is updated and we have the correct one when resetting\n this._configuration = configuration;\n }\n if (!init) {\n this.setOptions({\n ...this._configuration.options,\n renderer: this._configuration.renderer\n });\n }\n this.setStyles(this._configuration, baseUrl);\n this.setCaptions(this._configuration);\n }\n}\n","import {GenericObject} from '@linkurious/rest-client';\n\nexport const HTML_COLORS: GenericObject<{hex: string; rgb: string}> = {\n lightsalmon: {hex: '#FFA07A', rgb: 'rbg(255,160,122)'},\n salmon: {hex: '#FA8072', rgb: 'rgb(250,128,114)'},\n darksalmon: {hex: '#E9967A', rgb: 'rgb(233,150,122)'},\n lightcoral: {hex: '#F08080', rgb: 'rgb(240,128,128)'},\n indianred: {hex: '#CD5C5C', rgb: 'rgb(205,92,92)'},\n crimson: {hex: '#DC143C', rgb: 'rgb(220,20,60)'},\n firebrick: {hex: '#B22222', rgb: 'rgb(178,34,34)'},\n red: {hex: '#FF0000', rgb: 'rgb(255,0,0)'},\n darkred: {hex: '#8B0000', rgb: 'rgb(139,0,0)'},\n coral: {hex: '#FF7F50', rgb: 'rgb(255,127,80)'},\n tomato: {hex: '#FF6347', rgb: 'rgb(255,99,71)'},\n orangered: {hex: '#FF4500', rgb: 'rgb(255,69,0)'},\n gold: {hex: '#FFD700', rgb: 'rgb(255,215,0)'},\n orange: {hex: '#FFA500', rgb: 'rgb(255,165,0)'},\n darkorange: {hex: '#FF8C00', rgb: 'rgb(255,140,0)'},\n lightyellow: {hex: '#FFFFE0', rgb: 'rgb(255,255,224)'},\n lemonchiffon: {hex: '#FFFACD', rgb: 'rgb(255,250,205)'},\n lightgoldenrodyellow: {hex: '#FAFAD2', rgb: 'rgb(250,250,210)'},\n papayawhip: {hex: '#FFEFD5', rgb: 'rgb(255,239,213)'},\n moccasin: {hex: '#FFE4B5', rgb: 'rgb(255,228,181)'},\n peachpuff: {hex: '#FFDAB9', rgb: 'rgb(255,218,185)'},\n palegoldenrod: {hex: '#EEE8AA', rgb: 'rgb(238,232,170)'},\n khaki: {hex: '#F0E68C', rgb: 'rgb(240,230,140)'},\n darkkhaki: {hex: '#BDB76B', rgb: 'rgb(189,183,107)'},\n yellow: {hex: '#FFFF00', rgb: 'rgb(255,255,0)'},\n lawngreen: {hex: '#7CFC00', rgb: 'rgb(124,252,0)'},\n chartreuse: {hex: '#7FFF00', rgb: 'rgb(127,255,0)'},\n limegreen: {hex: '#32CD32', rgb: 'rgb(50,205,50)'},\n lime: {hex: '#00FF00', rgb: 'rgb(0.255.0)'},\n forestgreen: {hex: '#228B22', rgb: 'rgb(34,139,34)'},\n green: {hex: '#008000', rgb: 'rgb(0,128,0)'},\n darkgreen: {hex: '#006400', rgb: 'rgb(0,100,0)'},\n greenyellow: {hex: '#ADFF2F', rgb: 'rgb(173,255,47)'},\n yellowgreen: {hex: '#9ACD32', rgb: 'rgb(154,205,50)'},\n springgreen: {hex: '#00FF7F', rgb: 'rgb(0,255,127)'},\n mediumspringgreen: {hex: '#00FA9A', rgb: 'rgb(0,250,154)'},\n lightgreen: {hex: '#90EE90', rgb: 'rgb(144,238,144)'},\n palegreen: {hex: '#98FB98', rgb: 'rgb(152,251,152)'},\n darkseagreen: {hex: '#8FBC8F', rgb: 'rgb(143,188,143)'},\n mediumseagreen: {hex: '#3CB371', rgb: 'rgb(60,179,113)'},\n seagreen: {hex: '#2E8B57', rgb: 'rgb(46,139,87)'},\n olive: {hex: '#808000', rgb: 'rgb(128,128,0)'},\n darkolivegreen: {hex: '#556B2F', rgb: 'rgb(85,107,47)'},\n olivedrab: {hex: '#6B8E23', rgb: 'rgb(107,142,35)'},\n lightcyan: {hex: '#E0FFFF', rgb: 'rgb(224,255,255)'},\n cyan: {hex: '#00FFFF', rgb: 'rgb(0,255,255)'},\n aqua: {hex: '#00FFFF', rgb: 'rgb(0,255,255)'},\n aquamarine: {hex: '#7FFFD4', rgb: 'rgb(127,255,212)'},\n mediumaquamarine: {hex: '#66CDAA', rgb: 'rgb(102,205,170)'},\n paleturquoise: {hex: '#AFEEEE', rgb: 'rgb(175,238,238)'},\n turquoise: {hex: '#40E0D0', rgb: 'rgb(64,224,208)'},\n mediumturquoise: {hex: '#48D1CC', rgb: 'rgb(72,209,204)'},\n darkturquoise: {hex: '#00CED1', rgb: 'rgb(0,206,209)'},\n lightseagreen: {hex: '#20B2AA', rgb: 'rgb(32,178,170)'},\n cadetblue: {hex: '#5F9EA0', rgb: 'rgb(95,158,160)'},\n darkcyan: {hex: '#008B8B', rgb: 'rgb(0,139,139)'},\n teal: {hex: '#008080', rgb: 'rgb(0,128,128)'},\n powderblue: {hex: '#B0E0E6', rgb: 'rgb(176,224,230)'},\n lightblue: {hex: '#ADD8E6', rgb: 'rgb(173,216,230)'},\n lightskyblue: {hex: '#87CEFA', rgb: 'rgb(135,206,250)'},\n skyblue: {hex: '#87CEEB', rgb: 'rgb(135,206,235)'},\n deepskyblue: {hex: '#00BFFF', rgb: 'rgb(0,191,255)'},\n lightsteelblue: {hex: '#B0C4DE', rgb: 'rgb(176,196,222)'},\n dodgerblue: {hex: '#1E90FF', rgb: 'rgb(30,144,255)'},\n cornflowerblue: {hex: '#6495ED', rgb: 'rgb(100,149,237)'},\n steelblue: {hex: '#4682B4', rgb: 'rgb(70,130,180)'},\n royalblue: {hex: '#4169E1', rgb: 'rgb(65,105,225)'},\n blue: {hex: '#0000FF', rgb: 'rgb(0,0,255)'},\n mediumblue: {hex: '#0000CD', rgb: 'rgb(0,0,205)'},\n darkblue: {hex: '#00008B', rgb: 'rgb(0,0,139)'},\n navy: {hex: '#000080', rgb: 'rgb(0,0,128)'},\n midnightblue: {hex: '#191970', rgb: 'rgb(25,25,112)'},\n mediumslateblue: {hex: '#7B68EE', rgb: 'rgb(123,104,238)'},\n slateblue: {hex: '#6A5ACD', rgb: 'rgb(106,90,205)'},\n darkslateblue: {hex: '#483D8B', rgb: 'rgb(72,61,139)'},\n lavender: {hex: '#E6E6FA', rgb: 'rgb(230,230,250)'},\n thistle: {hex: '#D8BFD8', rgb: 'rgb(216,191,216)'},\n plum: {hex: '#DDA0DD', rgb: 'rgb(221,160,221)'},\n violet: {hex: '#EE82EE', rgb: 'rgb(238,130,238)'},\n orchid: {hex: '#DA70D6', rgb: 'rgb(218,112,214)'},\n fuchsia: {hex: '#FF00FF', rgb: 'rgb(255,0,255)'},\n magenta: {hex: '#FF00FF', rgb: 'rgb(255,0,255)'},\n mediumorchid: {hex: '#BA55D3', rgb: 'rgb(186,85,211)'},\n mediumpurple: {hex: '#9370DB', rgb: 'rgb(147,112,219)'},\n blueviolet: {hex: '#8A2BE2', rgb: 'rgb(138,43,226)'},\n darkviolet: {hex: '#9400D3', rgb: 'rgb(148,0,211)'},\n darkorchid: {hex: '#9932CC', rgb: 'rgb(153,50,204)'},\n darkmagenta: {hex: '#8B008B', rgb: 'rgb(139,0,139)'},\n purple: {hex: '#800080', rgb: 'rgb(128,0,128)'},\n indigo: {hex: '#4B0082', rgb: 'rgb(75,0,130)'},\n pink: {hex: '#FFC0CB', rgb: 'rgb(255,192,203)'},\n lightpink: {hex: '#FFB6C1', rgb: 'rgb(255,182,193)'},\n hotpink: {hex: '#FF69B4', rgb: 'rgb(255,105,180)'},\n deeppink: {hex: '#FF1493', rgb: 'rgb(255,20,147)'},\n palevioletred: {hex: '#DB7093', rgb: 'rgb(219,112,147)'},\n mediumvioletred: {hex: '#C71585', rgb: 'rgb(199,21,133)'},\n white: {hex: '#FFFFFF', rgb: 'rgb(255,255,255)'},\n snow: {hex: '#FFFAFA', rgb: 'rgb(255,250,250)'},\n honeydew: {hex: '#F0FFF0', rgb: 'rgb(240,255,240)'},\n mintcream: {hex: '#F5FFFA', rgb: 'rgb(245,255,250)'},\n azure: {hex: '#F0FFFF', rgb: 'rgb(240,255,255)'},\n aliceblue: {hex: '#F0F8FF', rgb: 'rgb(240,248,255)'},\n ghostwhite: {hex: '#F8F8FF', rgb: 'rgb(248,248,255)'},\n whitesmoke: {hex: '#F5F5F5', rgb: 'rgb(245,245,245)'},\n seashell: {hex: '#FFF5EE', rgb: 'rgb(255,245,238)'},\n beige: {hex: '#F5F5DC', rgb: 'rgb(245,245,220)'},\n oldlace: {hex: '#FDF5E6', rgb: 'rgb(253,245,230)'},\n floralwhite: {hex: '#FFFAF0', rgb: 'rgb(255,250,240)'},\n ivory: {hex: '#FFFFF0', rgb: 'rgb(255,255,240)'},\n antiquewhite: {hex: '#FAEBD7', rgb: 'rgb(250,235,215)'},\n linen: {hex: '#FAF0E6', rgb: 'rgb(250,240,230)'},\n lavenderblush: {hex: '#FFF0F5', rgb: 'rgb(255,240,245)'},\n mistyrose: {hex: '#FFE4E1', rgb: 'rgb(255,228,225)'},\n gainsboro: {hex: '#DCDCDC', rgb: 'rgb(220,220,220)'},\n lightgray: {hex: '#D3D3D3', rgb: 'rgb(211,211,211)'},\n silver: {hex: '#C0C0C0', rgb: 'rgb(192,192,192)'},\n darkgray: {hex: '#A9A9A9', rgb: 'rgb(169,169,169)'},\n gray: {hex: '#808080', rgb: 'rgb(128,128,128)'},\n dimgray: {hex: '#696969', rgb: 'rgb(105,105,105)'},\n lightslategray: {hex: '#778899', rgb: 'rgb(119,136,153)'},\n slategray: {hex: '#708090', rgb: 'rgb(112,128,144)'},\n darkslategray: {hex: '#2F4F4F', rgb: 'rgb(47,79,79)'},\n black: {hex: '#000000', rgb: 'rgb(0,0,0)'},\n cornsilk: {hex: '#FFF8DC', rgb: 'rgb(255,248,220)'},\n blanchedalmond: {hex: '#FFEBCD', rgb: 'rgb(255,235,205)'},\n bisque: {hex: '#FFE4C4', rgb: 'rgb(255,228,196)'},\n navajowhite: {hex: '#FFDEAD', rgb: 'rgb(255,222,173)'},\n wheat: {hex: '#F5DEB3', rgb: 'rgb(245,222,179)'},\n burlywood: {hex: '#DEB887', rgb: 'rgb(222,184,135)'},\n tan: {hex: '#D2B48C', rgb: 'rgb(210,180,140)'},\n rosybrown: {hex: '#BC8F8F', rgb: 'rgb(188,143,143)'},\n sandybrown: {hex: '#F4A460', rgb: 'rgb(244,164,96)'},\n goldenrod: {hex: '#DAA520', rgb: 'rgb(218,165,32)'},\n peru: {hex: '#CD853F', rgb: 'rgb(205,133,63)'},\n chocolate: {hex: '#D2691E', rgb: 'rgb(210,105,30)'},\n saddlebrown: {hex: '#8B4513', rgb: 'rgb(139,69,19)'},\n sienna: {hex: '#A0522D', rgb: 'rgb(160,82,45)'},\n brown: {hex: '#A52A2A', rgb: 'rgb(165,42,42)'},\n maroon: {hex: '#800000', rgb: 'rgb(128,0,0)'}\n};\n","'use strict';\nimport {Color, NodeList, Node, EdgeList, Edge, NodeId} from '@linkurious/ogma';\nimport {LkEdgeData, LkNodeData} from '@linkurious/rest-client';\n\nimport {Tools} from './tools';\nimport {HTML_COLORS} from './colorPalette';\n\nexport class OgmaTools {\n /**\n * Get the amount of hidden neighbors from a list of nodes\n *\n * @param nodes\n */\n public static getHiddenNeighbors(nodes: NodeList<LkNodeData, LkEdgeData>): number {\n return nodes.reduce((result: number, node: Node<LkNodeData, LkEdgeData>) => {\n const statistics = node.getData('statistics');\n if (statistics !== undefined) {\n const hiddenNeighbors =\n statistics.degree !== undefined && !statistics.supernode\n ? statistics.degree - Tools.getDegreeWithoutSelfConnection(node)\n : statistics.supernodeDegree;\n if (hiddenNeighbors !== undefined && hiddenNeighbors > 0) {\n return (result += hiddenNeighbors);\n }\n }\n return result;\n }, 0);\n }\n\n /**\n * Return the visible degree of a node without self connection (self edge)\n *\n * @param {Node} node\n * @return {number}\n */\n public static getDegreeWithoutSelfConnection(node: Node<LkNodeData, LkEdgeData>): number {\n return node.getAdjacentNodes({policy: 'exclude-sources', filter: 'all'}).size;\n }\n\n /**\n * Return true if the color tone is \"bright\"\n *\n * @param {string} color\n * @returns {boolean}\n */\n public static isBright(color: Color): boolean {\n if (color === null || !Tools.isStringFilled(color)) {\n return true;\n }\n const hexRegExp = /#[A-Fa-f0-9]{3,6}/;\n const rgbRegExp =\n /^rgb\\(\\s*([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\s*,\\s*([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\s*,\\s*([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\s*\\)$/i;\n const rgbaRegExp =\n /^rgba\\(\\s*([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\s*,\\s*([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\s*,\\s*([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\s*,\\s*(?:0|1|0?\\.\\d+)\\s*\\)$/i;\n let rgb: string;\n\n if (hexRegExp.test(color)) {\n if (color.length < 5) {\n color += color.slice(1);\n }\n color = color.replace('#', '');\n const r = parseInt(color[0].toString() + color[1].toString(), 16);\n const g = parseInt(color[2].toString() + color[3].toString(), 16);\n const b = parseInt(color[4].toString() + color[5].toString(), 16);\n rgb = `rgb(${r}, ${g}, ${b})`;\n } else if (\n rgbRegExp.test(color) ||\n rgbaRegExp.test(color) ||\n HTML_COLORS[color.toLowerCase()] !== undefined\n ) {\n rgb = Tools.isDefined(HTML_COLORS[color.toLowerCase()])\n ? HTML_COLORS[color.toLowerCase()]['rgb']\n : color;\n } else {\n return true;\n }\n\n const [r, g, b] = /rgba?\\((\\d{1,3}),(\\d{1,3}),(\\d{1,3})(,\\d{1,3})?\\)/\n .exec(rgb.replace(/\\s/g, ''))!\n .slice(1, 4);\n\n if (!Tools.isDefined(r) || !Tools.isDefined(g) || !Tools.isDefined(b)) {\n console.warn('The given color is not a valid rgb formatted color');\n return true;\n }\n return (+r * 299 + +g * 587 + +b * 114) / 1000 > 255 * 0.7;\n }\n\n public static isNode(\n item: Node<LkNodeData, LkEdgeData> | Edge<LkEdgeData, LkNodeData>\n ): item is Node<LkNodeData, LkEdgeData> {\n return item.isNode;\n }\n\n public static isNodeList(\n items: NodeList<LkNodeData, LkEdgeData> | EdgeList<LkEdgeData, LkNodeData>\n ): items is NodeList<LkNodeData, LkEdgeData> {\n return items.isNode;\n }\n\n public static topologicalSort(nodes: NodeList): NodeId[] {\n const nodesArray = nodes.toArray();\n let currentNode: Node | null = nodesArray.find((n) => n.getDegree() === 1)!;\n const visited = new Set();\n const stack: Node[] = [];\n while (currentNode) {\n stack.push(currentNode);\n visited.add(currentNode);\n\n const nextNode = currentNode\n .getAdjacentNodes()\n .filter((neighbor) => !visited.has(neighbor))\n .get(0);\n currentNode = nextNode === undefined ? null : nextNode;\n }\n return stack.map((n) => n.getId());\n }\n\n public static isStar(nodes: NodeList) {\n for (const node of nodes.toArray()) {\n const adjacent = node.getAdjacentNodes();\n const isStar = node.getDegree() > 2 && adjacent.getDegree().every((d) => d === 1);\n if (isStar && adjacent.size + 1 === nodes.size) return node;\n }\n return false;\n }\n}\n","import {Transformation, Node, NodeList, StyleRule, PixelSize, Point} from '@linkurious/ogma';\nimport {\n IVizNodeGroupInfo,\n LkEdgeData,\n LkNodeData,\n MissingValue,\n NodeGroupingRule\n} from '@linkurious/rest-client';\nimport sha1 from 'sha1';\n\nimport {FORCE_LAYOUT_CONFIG, LKOgma} from '../index';\nimport {Tools} from '../../tools/tools';\nimport {OgmaTools} from '../../tools/ogmaTool';\n\nexport const LKE_NODE_GROUPING_EDGE = 'LKE_NODE_GROUPING_EDGE';\nexport const LKE_NODE_GROUPING_NODE = 'LKE_NODE_GROUPING_NODE';\n\ninterface CircularLayoutOptions {\n radii: PixelSize[] | number[];\n cx?: number;\n cy?: number;\n startAngle?: number;\n clockwise?: boolean;\n getRadius?: (radius: PixelSize) => number;\n distanceRatio?: number;\n}\n\nexport class NodeGroupingTransformation {\n public transformation?: Transformation<LkNodeData, LkEdgeData>;\n public groupRule?: NodeGroupingRule;\n public nodeGroupingStyleRule?: StyleRule<LkNodeData, LkEdgeData>;\n private _ogma: LKOgma;\n\n constructor(ogma: LKOgma) {\n this._ogma = ogma;\n }\n\n /**\n * Set the grouping rule\n * @param rule of grouping\n */\n public setGroupingRule(rule: NodeGroupingRule | undefined): void {\n this.groupRule = rule;\n }\n\n /**\n * create a node grouping transformation\n * It uses groupRule to define the rule\n * Group the nodes based on a category type and a property value\n */\n public async initTransformation(): Promise<void> {\n if (this.transformation === undefined) {\n this.transformation = this._ogma.transformations.addNodeGrouping({\n groupIdFunction: (node) => {\n if (this._isRuleNotApplicableToNode(node)) {\n return undefined;\n } else {\n const propertyValue = this._findGroupingPropertyValue(node);\n // groupRule is defined if not we returned undefined\n // node with same value will be part of the same group\n return `${this.groupRule?.groupingOptions.itemTypes.join('-')}-${propertyValue}`\n .toLowerCase()\n .trim();\n }\n },\n nodeGenerator: (nodes) => {\n return {\n data: {\n categories: [LKE_NODE_GROUPING_NODE],\n properties: {},\n nodeGroupId: this._findNodeGroupId(nodes)\n }\n };\n },\n edgeGenerator: () => {\n return {\n data: {\n type: LKE_NODE_GROUPING_EDGE\n }\n };\n },\n showContents: true,\n padding: 10\n });\n } else {\n await this.refreshTransformation();\n }\n }\n\n /**\n * refresh the transformation\n * Called when there is a change in the rule\n */\n public async refreshTransformation(): Promise<void> {\n if (this.transformation !== undefined) {\n await this.transformation.refresh();\n await this._unpinNodes(this._getAllTransformationRawNodes());\n } else {\n await this.initTransformation();\n }\n }\n\n /**\n * init node grouping style\n */\n public initNodeGroupingStyle(): void {\n this.nodeGroupingStyleRule = this._ogma.styles.addRule({\n nodeAttributes: {\n // Any default style will go here\n text: {\n content: (node: Node<LkNodeData> | undefined): string | undefined => {\n return this._getNodeGroupingCaption(node);\n },\n style: 'bold'\n },\n layer: -1,\n color: 'rgba(240, 240, 240)',\n innerStroke: {\n color: '#7f7f7f',\n width: 2\n }\n },\n nodeSelector: (node) => {\n // TODO: Tools.isDefined(node.getSubNodes()) is a work around for an ogma issue visible when using image export plugin with Node grouping\n // remove when updating to Ogma v5.1.x\n return node.isVirtual() && Tools.isDefined(node.getSubNodes());\n },\n // the style will be updated when data object is updated\n nodeDependencies: {self: {data: true}}\n });\n }\n\n public async refreshNodeGroupingStyle(): Promise<void> {\n await this.nodeGroupingStyleRule?.refresh();\n }\n\n /**\n * run layout on all subnodes of virtual nodes\n */\n public async runLayoutOnAllSubNodes(): Promise<void> {\n await this._ogma.transformations.afterNextUpdate();\n const rawNodesList = this._getAllTransformationRawNodes();\n const promisesList: Promise<void>[] = [];\n for (let i = 0; i < rawNodesList.length; i++) {\n // rawNodesList[i] is not null because each group has at least one node\n const subNodes = rawNodesList[i]!;\n promisesList.push(this.runSubNodesLayout(subNodes));\n }\n await Promise.all(promisesList);\n }\n\n /**\n * Run the layout on the subnodes of the virtual node\n * @param subNodes nodes part of a virtual node\n */\n public async runSubNodesLayout(subNodes: NodeList<LkNodeData, LkEdgeData>): Promise<void> {\n if (subNodes.size === 0 || subNodes.size === 1) {\n return;\n }\n\n // 2 nodes\n if (subNodes.size === 2) {\n await this._runTwoNodesLayout(subNodes);\n return;\n }\n\n const noEdges = subNodes.getAdjacentEdges({bothExtremities: true}).size === 0;\n if (noEdges) return this._runCirclePack(subNodes);\n // stars\n const center = this.isStar(subNodes);\n if (center) {\n const satellites = subNodes.filter((n) => n !== center);\n const positions = this._runCircularLayout({\n radii: satellites.getAttribute('radius'),\n cx: center.getAttribute('x'),\n cy: center.getAttribute('y'),\n clockwise: false,\n distanceRatio: 5\n });\n const list = center.toList().concat(satellites);\n await list.setAttributes([center.getPosition(), ...positions]);\n return;\n }\n // Chains: if al nodes have degree 1 or 2, place them in a line\n const degrees = subNodes.getDegree();\n if (degrees.every((d) => d > 0 && d <= 2)) {\n await this._runChainLayout(subNodes);\n return;\n }\n\n return await this._runForceLayout(subNodes);\n }\n\n /**\n * Get the virtual nodes of the transformation\n * @private\n */\n public getVirtualNodesOfTransformation(): NodeList<LkNodeData, LkEdgeData> {\n // @ts-ignore getContext exists on the transformation but hidden by the types\n return this.transformation.getContext().metaNodes;\n }\n\n /**\n * Set the node group pin\n * @param nodeGroups object containing the node group id and the layoutable attribute\n */\n public async setNodeGroupPin(nodeGroups: IVizNodeGroupInfo[]): Promise<void> {\n this._ogma\n .getNodes()\n .filter((node) => node.isVirtual())\n .forEach((node) => {\n const nodeGroupInfo = nodeGroups.find(\n (nodeGroup) => nodeGroup.id === node.getData('nodeGroupId')\n );\n if (nodeGroupInfo !== undefined) {\n void node.setAttribute('layoutable', nodeGroupInfo.attributes.layoutable ?? false);\n }\n });\n }\n\n /**\n * Return the caption of a virtual node\n * @param node reference to the virtual node\n */\n private _getNodeGroupingCaption(node: Node<LkNodeData> | undefined): string | undefined {\n // TODO: Normally there is no need to check if getSubNodes return a value, Ogma issue\n //https://github.com/Linkurious/ogma/issues/3876\n if (node !== undefined && node.isVirtual() && node.getSubNodes()?.get(0) !== undefined) {\n // get the property value of the first node of the group (all nodes share the same property value)\n const lkPropertyValue = node\n .getSubNodes()!\n .get(0)\n .getData(['properties', this.groupRule!.groupingOptions.propertyKey]);\n const propertyValue = Tools.getValueFromLkProperty(lkPropertyValue);\n const size = node.getSubNodes()!.filter((e) => !e.hasClass('filtered')).size;\n return `${propertyValue} (${size})`;\n }\n }\n\n /**\n * Run the circle pack layout on the subnodes\n * @param subNodes\n */\n private async _runCirclePack(subNodes: NodeList<LkNodeData, LkEdgeData>): Promise<void> {\n await this._ogma.algorithms.circlePack({\n nodes: subNodes,\n margin: 10,\n sort: 'asc'\n });\n }\n\n private async _runChainLayout(subNodes: NodeList<LkNodeData, LkEdgeData>): Promise<void> {\n // straighten the chain\n const sortedNodes = this._ogma.getNodes(OgmaTools.topologicalSort(subNodes));\n // we also need to sort the nodes so that they are following the chain\n await this._ogma.layouts.grid({\n nodes: sortedNodes,\n // TODO: test that visually\n colDistance: Math.max(...subNodes.getAttribute('radius').map(Number)) * 4,\n rows: 1\n });\n }\n\n private async _runForceLayout(subNodes: NodeList<LkNodeData, LkEdgeData>): Promise<void> {\n await this._ogma.layouts.force({\n nodes: subNodes,\n ...FORCE_LAYOUT_CONFIG\n });\n }\n\n private _isRuleNotApplicableToNode(node: Node<LkNodeData>): boolean {\n const propertyValue = node.getData([\n 'properties',\n this.groupRule?.groupingOptions.propertyKey ?? ''\n ]);\n return (\n // if the group rule is not defined\n this.groupRule === undefined ||\n // if rule is applied to a different category\n this.groupRule.groupingOptions.itemTypes.every(\n (itemType) => !node.getData('categories').includes(itemType)\n ) ||\n // if the property value is not defined\n !Tools.isDefined(propertyValue) ||\n // if the property value is missing\n (typeof propertyValue === 'object' && (propertyValue as MissingValue).status === 'missing')\n );\n }\n\n /**\n * Unpin list of nodes\n * @param nodes\n * @private\n */\n private async _unpinNodes(nodes: Array<NodeList | null>): Promise<void> {\n await Promise.all(\n nodes.map((nodeList) => {\n if (nodeList !== null) {\n return nodeList.setAttribute('layoutable', true);\n }\n })\n );\n }\n\n /**\n * Get all the raw nodes part of the transformation\n * @private\n */\n private _getAllTransformationRawNodes(): Array<NodeList | null> {\n const virtualNodes = this.getVirtualNodesOfTransformation();\n return virtualNodes.getSubNodes();\n }\n\n private _findGroupingPropertyValue(node: Node<LkNodeData>): string {\n const propertyValue = node.getData([\n 'properties',\n this.groupRule?.groupingOptions.propertyKey ?? ''\n ]);\n return `${Tools.getValueFromLkProperty(propertyValue)}`;\n }\n\n /**\n * Return a hashed string that represents the group id\n */\n private _findNodeGroupId(nodes: NodeList<LkNodeData, LkEdgeData>): string {\n const propertyValue = this._findGroupingPropertyValue(nodes.get(0));\n return sha1(\n `${this.groupRule?.name}-${this.groupRule?.groupingOptions.itemTypes.join(\n '-'\n )}-${propertyValue}`\n );\n }\n\n public _runCircularLayout({\n radii,\n clockwise = true,\n cx = 0,\n cy = 0,\n startAngle = (3 / 2) * Math.PI,\n getRadius = (radius: PixelSize) => Number(radius),\n distanceRatio = 0.0\n }: CircularLayoutOptions): Point[] {\n const N = radii.length;\n // dummy checks\n if (N === 0) return [];\n if (N === 1) return [{x: cx, y: cy}];\n\n // minDistance\n const minDistance =\n radii.map(getRadius).reduce((acc, r) => Math.max(acc, r), 0) * (2 + distanceRatio);\n\n const sweep = 2 * Math.PI - (2 * Math.PI) / N;\n const deltaAngle = sweep / Math.max(1, N - 1);\n\n const dcos = Math.cos(deltaAngle) - Math.cos(0);\n const dsin = Math.sin(deltaAngle) - Math.sin(0);\n\n const rMin = Math.sqrt((minDistance * minDistance) / (dcos * dcos + dsin * dsin));\n const r = Math.max(rMin, 0);\n\n return radii.map((_, i) => {\n const angle = startAngle + i * deltaAngle * (clockwise ? 1 : -1);\n\n const rx = r * Math.cos(angle);\n const ry = r * Math.sin(angle);\n return {\n x: cx + rx,\n y: cy + ry\n };\n });\n }\n\n private async _runTwoNodesLayout(nodes: NodeList<LkNodeData, LkEdgeData>) {\n const radii = nodes.getAttribute('radius').map(Number);\n const positions = nodes.getPosition();\n const gap = Math.min(...radii);\n await nodes.setAttributes([\n positions[0],\n {x: positions[0].x + gap + radii[0] + radii[1], y: positions[0].y}\n ]);\n }\n\n private isStar(nodes: NodeList) {\n for (const id of nodes.getId()) {\n const node = this._ogma.getNode(id)!;\n const adjacent = node.getAdjacentNodes();\n const isStar = node.getDegree() > 2 && adjacent.getDegree().every((d) => d === 1);\n if (isStar && adjacent.size + 1 === nodes.size) return node;\n }\n return false;\n }\n}\n","'use strict';\n\nimport {GenericObject, IEdgeGroupStyle, LkEdgeData, LkNodeData} from '@linkurious/rest-client';\nimport {\n Edge,\n EdgeAttributesValue,\n EdgeExtremity,\n EdgeStyle,\n EdgeType,\n PixelSize,\n StyleRule,\n Transformation\n} from '@linkurious/ogma';\n\nimport {LKOgma} from '../index';\n\nimport {LKE_NODE_GROUPING_EDGE} from './nodeGrouping';\n\nconst DEFAULT_EDGE_GROUP_STYLE: {\n color: string;\n shape: {\n body?: EdgeType;\n head?: EdgeExtremity;\n tail?: EdgeExtremity;\n style?: EdgeStyle;\n };\n width: PixelSize;\n} = {\n color: '#000000',\n shape: {\n style: 'dashed',\n head: 'arrow'\n },\n width: 1.5\n};\n\nexport class TransformationsViz {\n private _ogma: LKOgma;\n public groupedEdges: GenericObject<boolean>;\n public edgeGroupStyle!: IEdgeGroupStyle;\n public transformation!: Transformation<LkNodeData, LkEdgeData>;\n public edgeGroupingStyleRule!: StyleRule<LkNodeData, LkEdgeData>;\n\n constructor(ogma: LKOgma) {\n this._ogma = ogma;\n this.groupedEdges = {};\n }\n\n /**\n * create an edge grouping transformation by edge type\n */\n public async initTransformation(): Promise<void> {\n if (this.transformation === undefined) {\n this.transformation = this._ogma.transformations.addEdgeGrouping({\n separateEdgesByDirection: true,\n selector: (edge) => {\n return this.groupedEdges[edge.getData('type')];\n },\n groupIdFunction: (edge) => edge.getData('type'),\n generator: (edges) => {\n return {\n data: {\n properties: {\n originalType: edges.getData('type')[0]\n }\n }\n };\n }\n });\n } else {\n await this.transformation.refresh();\n }\n }\n\n /**\n * init edge grouping style\n */\n public initEdgeGroupingStyle(): void {\n this.edgeGroupingStyleRule = this._ogma.styles.addRule({\n edgeAttributes: {\n ...DEFAULT_EDGE_GROUP_STYLE,\n ...(this.edgeGroupStyle as EdgeAttributesValue<LkEdgeData, LkNodeData>),\n text: {\n content: (edge: Edge<LkEdgeData> | undefined): string | undefined => {\n // check it the edge is virtual and was not created by node grouping\n if (\n edge !== undefined &&\n edge.getSubEdges() !== null &&\n edge.getData('type') !== LKE_NODE_GROUPING_EDGE\n ) {\n const size = edge.getSubEdges()!.filter((e) => !e.hasClass('filtered')).size;\n return `${edge.getData(['properties', 'originalType'])} (${size})`;\n }\n },\n style: 'bold'\n }\n },\n edgeSelector: (edge) =>\n edge.isVirtual() &&\n edge.getSubEdges() &&\n edge.getSubEdges()!.filter((e) => !e.hasClass('filtered')).size > 0 &&\n edge.getData('type') !== LKE_NODE_GROUPING_EDGE,\n edgeDependencies: {self: {data: true}}\n });\n }\n\n public refreshEdgeGroupingStyle(): void {\n if (this.edgeGroupingStyleRule !== undefined) {\n this.edgeGroupingStyleRule.refresh();\n }\n }\n}\n","import {\n ItemSelector,\n LkEdgeData,\n LkNodeData,\n IRangeValues,\n SelectorType,\n ISelectorAny,\n ISelectorIs,\n ISelectorNoValue,\n ISelectorNaN,\n ISelectorRange,\n LkItemData\n} from '@linkurious/rest-client';\n\nimport {Tools} from '../tools/tools';\n\ntype FilterFunction<T extends LkItemData> = (itemData: T) => boolean;\n\nexport class Filters {\n private static nodeCache: Map<string, FilterFunction<LkNodeData>> = new Map();\n private static edgeCache: Map<string, FilterFunction<LkEdgeData>> = new Map();\n private static FILTER_CACHE_SIZE = 5;\n\n /**\n * Returns whether the node/edge should be *filtered* (a.k.a. *hidden*).\n *\n * Notes:\n * 1. `filterRules` are rules that match what should be filtered/hidden.\n * 2. `filterRules` are combined inclusively: as soon as one rule returns `true` for\n * an item, the item can be hidden/filtered.\n *\n * @param filterRules\n * @param itemData\n */\n public static isFiltered(\n filterRules: Array<ItemSelector>,\n itemData: LkNodeData | LkEdgeData\n ): boolean {\n if (!Tools.isDefined(itemData)) {\n return false;\n }\n\n if ('categories' in itemData) {\n return Filters.getFilterFunction(filterRules, true)(itemData);\n } else {\n return Filters.getFilterFunction(filterRules, false)(itemData);\n }\n }\n\n private static getFilterFunction<T extends LkNodeData | LkEdgeData>(\n filterRules: Array<ItemSelector>,\n isNode: boolean\n ): FilterFunction<T> {\n const filterKey = JSON.stringify(filterRules, null, '');\n\n // This cast is needed to tell the TypeScript compiler to trust us that \"isNode\" and \"T\" are dependent.\n const filterCache = (isNode ? Filters.nodeCache : Filters.edgeCache) as Map<\n string,\n FilterFunction<T>\n >;\n\n let filterFunc = filterCache.get(filterKey);\n if (!filterFunc) {\n filterFunc = Filters.createFilterFunction(filterRules, isNode);\n if (filterCache.size > Filters.FILTER_CACHE_SIZE) {\n filterCache.clear();\n }\n filterCache.set(filterKey, filterFunc);\n }\n return filterFunc;\n }\n\n private static createFilterFunction<T extends LkNodeData | LkEdgeData>(\n filterRules: Array<ItemSelector>,\n isNode: boolean\n ): FilterFunction<T> {\n const filterFunctions = filterRules.map((filter: ItemSelector) =>\n Filters.filterToFilterFunction(filter, isNode)\n );\n\n /**\n * For each filterFunction, as soon as we find a filterFunction that says that a given\n * node/edge should be filtered/hidden, we return `true` for the node/edge.\n */\n return (itemData: T): boolean => {\n for (const filterFunction of filterFunctions) {\n if (filterFunction(itemData)) {\n return true;\n }\n }\n return false;\n };\n }\n\n private static filterToFilterFunction<T extends LkNodeData | LkEdgeData>(\n filter: ItemSelector,\n isNode: boolean\n ): FilterFunction<T> {\n switch (filter.type) {\n case SelectorType.ANY:\n return Filters.createAnyFilterFunction(filter, isNode);\n case SelectorType.IS:\n return Filters.createIsFilterFunction(filter, isNode);\n case SelectorType.NO_VALUE:\n return Filters.createNoValueFilterFunction(filter, isNode);\n case SelectorType.RANGE:\n return Filters.createRangeFilterFunction(filter, isNode);\n case SelectorType.NAN:\n return Filters.createNaNFilterFunction(filter, isNode);\n }\n }\n\n private static createAnyFilterFunction<T extends LkNodeData | LkEdgeData>(\n filter: ISelectorAny,\n isNode: boolean\n ): FilterFunction<T> {\n if (isNode) {\n return (itemData: T) => {\n if (filter.itemType === undefined) {\n return true;\n }\n return (itemData as LkNodeData).categories.includes(filter.itemType);\n };\n } else {\n // isEdge\n return (itemData: T) => (itemData as LkEdgeData).type === filter.itemType;\n }\n }\n\n private static createIsFilterFunction<T extends LkNodeData | LkEdgeData>(\n filter: ISelectorIs,\n isNode: boolean\n ): FilterFunction<T> {\n if (isNode) {\n return (itemData: T) =>\n (itemData as LkNodeData).categories.includes(filter.itemType) &&\n Tools.getPropertyValue(Tools.getIn(itemData, filter.input), true) === filter.value;\n } else {\n // isEdge\n return (itemData: T) =>\n (itemData as LkEdgeData).type === filter.itemType &&\n Tools.getPropertyValue(Tools.getIn(itemData, filter.input), true) === filter.value;\n }\n }\n\n private static createNoValueFilterFunction<T extends LkNodeData | LkEdgeData>(\n filter: ISelectorNoValue,\n isNode: boolean\n ): FilterFunction<T> {\n if (isNode) {\n return (itemData: T) =>\n (itemData as LkNodeData).categories.includes(filter.itemType) &&\n !Tools.isDefined(Tools.getPropertyValue(Tools.getIn(itemData, filter.input), true));\n } else {\n // isEdge\n return (itemData: T) =>\n (itemData as LkEdgeData).type === filter.itemType &&\n !Tools.isDefined(Tools.getPropertyValue(Tools.getIn(itemData, filter.input), true));\n }\n }\n\n private static createNaNFilterFunction<T extends LkNodeData | LkEdgeData>(\n filter: ISelectorNaN,\n isNode: boolean\n ): FilterFunction<T> {\n if (isNode) {\n return (itemData: T) =>\n (itemData as LkNodeData).categories.includes(filter.itemType) &&\n Filters.isNotANumber(Tools.getPropertyValue(Tools.getIn(itemData, filter.input), true));\n } else {\n // isEdge\n return (itemData: T) =>\n (itemData as LkEdgeData).type === filter.itemType &&\n Filters.isNotANumber(Tools.getPropertyValue(Tools.getIn(itemData, filter.input), true));\n }\n }\n\n private static isNotANumber(value: unknown) {\n return Tools.isDefined(value) && !Tools.isNumber(value);\n }\n\n public static createRangeFilterFunction<T extends LkNodeData | LkEdgeData>(\n filter: ISelectorRange,\n isNode: boolean\n ): FilterFunction<T> {\n if (isNode) {\n return (itemData: T) =>\n (itemData as LkNodeData).categories.includes(filter.itemType) &&\n Filters.valueShouldBeHidden(\n Tools.getPropertyValue(Tools.getIn(itemData, filter.input), false),\n filter.value\n );\n } else {\n // isEdge\n return (itemData: T) =>\n (itemData as LkEdgeData).type === filter.itemType &&\n Filters.valueShouldBeHidden(\n Tools.getPropertyValue(Tools.getIn(itemData, filter.input), false),\n filter.value\n );\n }\n }\n\n /**\n * Returns true if `value` should be filtered/hidden.\n *\n * `range` describes what should be filtered/hidden:\n * - e.g. {\"<\":10, \">=\":20} => hide any value in ]-inf, 10[ *OR* in [20, +inf[\n * - e.g. {\"<=\":10} => hide any value in ]-inf, 10]\n * - e.g. {\">=\":20} => hide any value in [20, +inf[\n *\n * Returns false (i.e. will not filter/hide) if `value` is not a number.\n */\n public static valueShouldBeHidden(value: unknown, range: IRangeValues): boolean {\n const n = Tools.parseFloat(value);\n if (Number.isNaN(n)) {\n return false;\n }\n\n /**\n * As soon as we find a condition that says that `value` should be filtered/hidden,\n * we return `true`.\n *\n * If `range` contains multiple conditions, all are checked and if any condition causes\n * `value` to be in the filtered/hidden range, we return `true`.\n *\n * If no condition causes `value` to be filtered/hidden, we return `false`.\n */\n return (\n (range['<'] !== undefined && n < range['<']) ||\n (range['<='] !== undefined && n <= range['<=']) ||\n (range['>'] !== undefined && n > range['>']) ||\n (range['>='] !== undefined && n >= range['>='])\n );\n }\n}\n","'use strict';\n\nimport {EntityType, LkEdgeData, LkNodeData} from '@linkurious/rest-client';\nimport {Edge, ItemList, Node} from '@linkurious/ogma';\n\nimport {OgmaState} from './reactive';\n\nexport type SelectionState = 'selection' | 'multiSelection' | 'noSelection';\n\n/**\n * Return the current size of the selection\n */\nexport const getSelectionSize = (state: OgmaState): number => {\n return (state.selection as ItemList<LkNodeData>).size;\n};\n\n/**\n * Return the current state of the selection\n */\nexport const getSelectionState = (state: OgmaState): SelectionState => {\n switch ((state.selection as ItemList<LkNodeData>).size) {\n case 1:\n return 'selection';\n\n case 0:\n return 'noSelection';\n\n default:\n return 'multiSelection';\n }\n};\n\n/**\n * Get the entityType of the current selection\n */\nexport const getSelectionEntity = (state: OgmaState): EntityType | undefined => {\n if (state.selection.size === 0) {\n return undefined;\n }\n return (state.selection as ItemList<LkNodeData>).isNode ? EntityType.NODE : EntityType.EDGE;\n};\n\n/**\n * Return the item selection if there's only one item selected\n */\nexport const getUniqSelection = (\n state: OgmaState\n): Node<LkNodeData, LkEdgeData> | Edge<LkEdgeData, LkNodeData> | undefined => {\n return state.selection.size === 1 ? state.selection.get(0) : undefined;\n};\n\n/**\n * Return the types of the current selection (if only one item is selected)\n */\nexport const getUniqSelectionTypes = (state: OgmaState): Array<string> | undefined => {\n const uniqSelection = getUniqSelection(state);\n if (uniqSelection === undefined) {\n return undefined;\n }\n if (uniqSelection.isNode) {\n return uniqSelection.getData('categories');\n } else {\n return [uniqSelection.getData('type')];\n }\n};\n\n/**\n * Return the entityType of the current selection if there's only one item selected\n */\nexport const getUniqSelectionEntity = (state: OgmaState): 'node' | 'edge' | undefined => {\n const uniqSelection = getUniqSelection(state);\n if (uniqSelection === undefined) {\n return undefined;\n }\n if (uniqSelection.isNode) {\n return 'node';\n }\n return 'edge';\n};\n\n/**\n * Return the properties of the current selection if there's only one item selected\n */\nexport const getSelectionProperties = (state: OgmaState): Array<{key: string; value: any}> => {\n const uniqSelection = getUniqSelection(state);\n if (uniqSelection !== undefined) {\n const properties = uniqSelection.getData().properties;\n return Object.keys(properties).map((propKey) => {\n return {\n key: propKey,\n value: properties[propKey]\n };\n });\n }\n return [];\n};\n\n/**\n * Return true if the current selection has properties\n */\nexport const hasSelectionProperties = (state: OgmaState): boolean => {\n return getSelectionProperties(state).length > 0;\n};\n"],"names":["listCacheClear","_listCacheClear","eq","value","other","eq_1","require$$0","assocIndexOf","array","key","length","_assocIndexOf","arrayProto","splice","listCacheDelete","data","index","lastIndex","_listCacheDelete","listCacheGet","_listCacheGet","listCacheHas","_listCacheHas","listCacheSet","_listCacheSet","require$$1","require$$2","require$$3","require$$4","ListCache","entries","entry","_ListCache","stackClear","_stackClear","stackDelete","result","_stackDelete","stackGet","_stackGet","stackHas","_stackHas","freeGlobal","global","_freeGlobal","freeSelf","root","_root","Symbol","_Symbol","objectProto","hasOwnProperty","nativeObjectToString","symToStringTag","getRawTag","isOwn","tag","unmasked","_getRawTag","objectToString","_objectToString","nullTag","undefinedTag","baseGetTag","_baseGetTag","isObject","type","isObject_1","asyncTag","funcTag","genTag","proxyTag","isFunction","isFunction_1","coreJsData","_coreJsData","maskSrcKey","uid","isMasked","func","_isMasked","funcProto","funcToString","toSource","_toSource","reRegExpChar","reIsHostCtor","reIsNative","baseIsNative","pattern","_baseIsNative","getValue","object","_getValue","getNative","_getNative","Map","_Map","nativeCreate","_nativeCreate","hashClear","_hashClear","hashDelete","_hashDelete","HASH_UNDEFINED","hashGet","_hashGet","hashHas","_hashHas","hashSet","_hashSet","Hash","_Hash","mapCacheClear","_mapCacheClear","isKeyable","_isKeyable","getMapData","map","_getMapData","mapCacheDelete","_mapCacheDelete","mapCacheGet","_mapCacheGet","mapCacheHas","_mapCacheHas","mapCacheSet","size","_mapCacheSet","MapCache","_MapCache","LARGE_ARRAY_SIZE","stackSet","pairs","_stackSet","require$$5","Stack","_Stack","setCacheAdd","_setCacheAdd","setCacheHas","_setCacheHas","SetCache","values","_SetCache","arraySome","predicate","_arraySome","cacheHas","cache","_cacheHas","COMPARE_PARTIAL_FLAG","COMPARE_UNORDERED_FLAG","equalArrays","bitmask","customizer","equalFunc","stack","isPartial","arrLength","othLength","arrStacked","othStacked","seen","arrValue","othValue","compared","othIndex","_equalArrays","Uint8Array","_Uint8Array","mapToArray","_mapToArray","setToArray","set","_setToArray","boolTag","dateTag","errorTag","mapTag","numberTag","regexpTag","setTag","stringTag","symbolTag","arrayBufferTag","dataViewTag","symbolProto","symbolValueOf","equalByTag","convert","stacked","_equalByTag","arrayPush","offset","_arrayPush","isArray","isArray_1","baseGetAllKeys","keysFunc","symbolsFunc","_baseGetAllKeys","arrayFilter","resIndex","_arrayFilter","stubArray","stubArray_1","propertyIsEnumerable","nativeGetSymbols","getSymbols","symbol","_getSymbols","baseTimes","n","iteratee","_baseTimes","isObjectLike","isObjectLike_1","argsTag","baseIsArguments","_baseIsArguments","isArguments","isArguments_1","stubFalse","stubFalse_1","freeExports","exports","freeModule","module","moduleExports","Buffer","nativeIsBuffer","isBuffer","MAX_SAFE_INTEGER","reIsUint","isIndex","_isIndex","isLength","isLength_1","arrayTag","objectTag","weakMapTag","float32Tag","float64Tag","int8Tag","int16Tag","int32Tag","uint8Tag","uint8ClampedTag","uint16Tag","uint32Tag","typedArrayTags","baseIsTypedArray","_baseIsTypedArray","baseUnary","_baseUnary","freeProcess","nodeUtil","types","nodeIsTypedArray","isTypedArray","isTypedArray_1","arrayLikeKeys","inherited","isArr","isArg","isBuff","isType","skipIndexes","_arrayLikeKeys","isPrototype","Ctor","proto","_isPrototype","overArg","transform","arg","_overArg","nativeKeys","_nativeKeys","baseKeys","_baseKeys","isArrayLike","isArrayLike_1","keys","keys_1","getAllKeys","_getAllKeys","equalObjects","objProps","objLength","othProps","objStacked","skipCtor","objValue","objCtor","othCtor","_equalObjects","DataView","_DataView","Promise","_Promise","Set","_Set","WeakMap","_WeakMap","require$$6","promiseTag","dataViewCtorString","mapCtorString","promiseCtorString","setCtorString","weakMapCtorString","getTag","ctorString","_getTag","require$$7","baseIsEqualDeep","objIsArr","othIsArr","objTag","othTag","objIsObj","othIsObj","isSameTag","objIsWrapped","othIsWrapped","objUnwrapped","othUnwrapped","_baseIsEqualDeep","baseIsEqual","_baseIsEqual","isEqual","isEqual_1","spreadableSymbol","isFlattenable","_isFlattenable","baseFlatten","depth","isStrict","_baseFlatten","arrayMap","_arrayMap","isSymbol","isSymbol_1","reIsDeepProp","reIsPlainProp","isKey","_isKey","FUNC_ERROR_TEXT","memoize","resolver","memoized","args","memoize_1","MAX_MEMOIZE_SIZE","memoizeCapped","_memoizeCapped","rePropName","reEscapeChar","stringToPath","string","match","number","quote","subString","_stringToPath","INFINITY","symbolToString","baseToString","_baseToString","toString","toString_1","castPath","_castPath","toKey","_toKey","baseGet","path","_baseGet","baseIsMatch","source","matchData","noCustomizer","srcValue","_baseIsMatch","isStrictComparable","_isStrictComparable","getMatchData","_getMatchData","matchesStrictComparable","_matchesStrictComparable","baseMatches","_baseMatches","get","defaultValue","get_1","baseHasIn","_baseHasIn","hasPath","hasFunc","_hasPath","hasIn","hasIn_1","baseMatchesProperty","_baseMatchesProperty","identity","identity_1","baseProperty","_baseProperty","basePropertyDeep","_basePropertyDeep","property","property_1","baseIteratee","_baseIteratee","createBaseFor","fromRight","iterable","props","_createBaseFor","baseFor","_baseFor","baseForOwn","_baseForOwn","createBaseEach","eachFunc","collection","_createBaseEach","baseEach","_baseEach","baseMap","_baseMap","baseSortBy","comparer","_baseSortBy","compareAscending","valIsDefined","valIsNull","valIsReflexive","valIsSymbol","othIsDefined","othIsNull","othIsReflexive","othIsSymbol","_compareAscending","compareMultiple","orders","objCriteria","othCriteria","ordersLength","order","_compareMultiple","require$$8","baseOrderBy","iteratees","criteria","_baseOrderBy","apply","thisArg","_apply","nativeMax","overRest","start","otherArgs","_overRest","constant","constant_1","defineProperty","_defineProperty","baseSetToString","_baseSetToString","HOT_COUNT","HOT_SPAN","nativeNow","shortOut","count","lastCalled","stamp","remaining","_shortOut","setToString","_setToString","baseRest","_baseRest","isIterateeCall","_isIterateeCall","sortBy","sortBy_1","IMAGE_PATTERN","CAPTION_HEURISTIC","Tools","v1","v2","position","limit","suffix","valueToTruncate","fixedLimit","ref","p","c","o","k","v","nodes","node","statistics","hiddenNeighbors","div","sign","nn","isoString","isDatetime","timezone","offsetDate","dateObject","formattedDate","hours","minutes","str","arr","i","url","invalidAsString","formattedDates","options","CurrencyFormat","thousandSeparator","decimalSeparator","integerPart","fractionalPart","formattedIntegerPart","digit","Captions","itemData","schema","graphSchema","heuristicCaptionElement","propertyValue","propertyType","PropertyTypeName","itemTypes","categories","caption","captionProps","category","propertyKey","itemType","typeGraphSchema","schemaType","base64map","crypt","b","bytes","words","hex","base64","triplet","j","imod4","cryptModule","charenc","charenc_1","utf8","bin","sha1","message","m","l","w","H0","H1","H2","H3","H4","a","d","e","t","api","digestbytes","sha1Module","BASE_GREY","PALETTE","ItemAttributes","rulesMap","ignoreCase","input","modulo","rule","max","min","lower","higher","EdgeAttributes","styleRules","color","propValue","_a","styleRule","widthStyle","propertyName","isLog","AutoRangeScale","OgmaEdgeShape","NodeAttributes","callback","hash","cachedColor","colors","finalColor","rawColors","rules","style","_b","OgmaTools","imageUrlValue","sizeStyle","generatedIcon","baseUrl","imageUrl","StyleRuleType","StyleRule","model","SelectorType","typePredicate","comparator","itemValue","formattedValue","StyleType","SORTING_RULE","StyleRules","itemsData","styleType","styles","label","imageStyle","template","currentLegend","colorStyle","icons","legend","indexOfLegendItem","r","rawRule","seenIndex","sanitizedStyles","maxIndex","HOVERED_SELECTED_NODE_STYLE","HOVERED_SELECTED_EDGE_STYLE","NODE_HALO_CONFIGURATION","EDGE_HALO_CONFIGURATION","DEFAULT_OGMA_FONT","DARK_FONT_COLOR","CLEAR_FONT_COLOR","ITEM_DEFAULT_COLOR","FILTER_OPACITY","StylesViz","ogma","configuration","edge","propertyPath","isEdgeInsideNodeGroup","textWrappingLength","degree","badgeContent","nodeColor","textColor","isSupernode","content","nodesEvent","overlap","colorStyleRules","state","nodeRules","nodeColorRules","nodeIconsRules","nodeSizeRules","nodeShapesRules","edgeRules","edgesWidthRules","edgesShapeRules","edgesColorRules","iconStyleRules","sizeStyleRules","shapeStyleRules","widthStyleRules","width","height","CaptionsViz","_nodeMaxTextLength","_edgeMaxTextLength","hasLift","operate","init","liftedSource","err","extendStatics","__extends","__","__values","s","__read","ar","error","__spreadArray","to","from","pack","createErrorClass","createImpl","_super","instance","ctorFunc","UnsubscriptionError","errors","arrRemove","item","Subscription","initialTeardown","e_1","e_2","_parentage","_parentage_1","_parentage_1_1","parent_1","e_1_1","initialFinalizer","_finalizers","_finalizers_1","_finalizers_1_1","finalizer","execFinalizer","e_2_1","teardown","parent","empty","isSubscription","config","timeoutProvider","handler","timeout","_i","handle","reportUnhandledError","noop","Subscriber","destination","_this","EMPTY_OBSERVER","next","complete","SafeSubscriber","_bind","bind","fn","ConsumerObserver","partialObserver","handleUnhandledError","observerOrNext","context_1","defaultErrorHandler","x","createOperatorSubscriber","onNext","onComplete","onError","onFinalize","OperatorSubscriber","shouldUnsubscribe","closed_1","project","subscriber","distinctUntilChanged","keySelector","defaultCompare","previousKey","first","currentKey","OgmaStore","BehaviorSubject","mapFn","DummyNodeList","RxViz","currentAnimationEnd","isCurrentlyAnimating","nextAnimationEnd","safeAnimationTimeoutMs","evt","change","ANIMATION_DURATION","FORCE_LAYOUT_CONFIG","LKOgma","Ogma","_configuration","_baseUrl","params","TransformationsViz","NodeGroupingTransformation","multiSelectionKey","_d","_c","nodeMaxTextLength","edgeMaxTextLength","_h","_g","_f","_e","mode","duration","dynamicSteps","ForceLayoutMode","rootNode","visualization","selectedEntityType","selectedElements","fixedNodes","EntityType","fixedEdges","graph","addedNodes","addedEdges","edges","items","filter","HTML_COLORS","hexRegExp","rgbRegExp","rgbaRegExp","rgb","g","currentNode","visited","nextNode","neighbor","adjacent","LKE_NODE_GROUPING_EDGE","LKE_NODE_GROUPING_NODE","rawNodesList","promisesList","subNodes","center","satellites","positions","nodeGroups","nodeGroupInfo","nodeGroup","lkPropertyValue","sortedNodes","nodeList","radii","clockwise","cx","cy","startAngle","getRadius","radius","distanceRatio","N","minDistance","acc","deltaAngle","dcos","dsin","rMin","_","angle","rx","ry","gap","id","DEFAULT_EDGE_GROUP_STYLE","_Filters","filterRules","isNode","filterKey","filterCache","filterFunc","filterFunctions","filterFunction","range","Filters","getSelectionSize","getSelectionState","getSelectionEntity","getUniqSelection","getUniqSelectionTypes","uniqSelection","getUniqSelectionEntity","getSelectionProperties","properties","propKey","hasSelectionProperties"],"mappings":";;;;;;;AAOA,SAASA,KAAiB;AACxB,OAAK,WAAW,CAAE,GAClB,KAAK,OAAO;AACd;AAEA,IAAAC,KAAiBD;ACoBjB,SAASE,GAAGC,GAAOC,GAAO;AACxB,SAAOD,MAAUC,KAAUD,MAAUA,KAASC,MAAUA;AAC1D;AAEA,IAAAC,KAAiBH,ICpCbA,KAAKI;AAUT,SAASC,GAAaC,GAAOC,GAAK;AAEhC,WADIC,IAASF,EAAM,QACZE;AACL,QAAIR,GAAGM,EAAME,CAAM,EAAE,CAAC,GAAGD,CAAG;AAC1B,aAAOC;AAGX,SAAO;AACT;AAEA,IAAAC,KAAiBJ,ICpBbA,KAAeD,IAGfM,KAAa,MAAM,WAGnBC,KAAS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AW;AACzB,UAAAG,IAAaH,EAAc,QAAA,EAAU;AAC3C,WAAO,OAAO,KAAKG,CAAU,EAAE,IAAI,CAACC,OAC3B;AAAA,MACL,KAAKA;AAAA,MACL,OAAOD,EAAWC,CAAO;AAAA,IAC3B,EACD;AAAA,EAAA;AAEH,SAAO,CAAC;AACV,GAKaC,KAAyB,CAAC3N,MAC9BwN,GAAuBxN,CAAK,EAAE,SAAS;","x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,139,140,141,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164]}
1
+ {"version":3,"file":"index.mjs","sources":["../node_modules/lodash/_listCacheClear.js","../node_modules/lodash/eq.js","../node_modules/lodash/_assocIndexOf.js","../node_modules/lodash/_listCacheDelete.js","../node_modules/lodash/_listCacheGet.js","../node_modules/lodash/_listCacheHas.js","../node_modules/lodash/_listCacheSet.js","../node_modules/lodash/_ListCache.js","../node_modules/lodash/_stackClear.js","../node_modules/lodash/_stackDelete.js","../node_modules/lodash/_stackGet.js","../node_modules/lodash/_stackHas.js","../node_modules/lodash/_freeGlobal.js","../node_modules/lodash/_root.js","../node_modules/lodash/_Symbol.js","../node_modules/lodash/_getRawTag.js","../node_modules/lodash/_objectToString.js","../node_modules/lodash/_baseGetTag.js","../node_modules/lodash/isObject.js","../node_modules/lodash/isFunction.js","../node_modules/lodash/_coreJsData.js","../node_modules/lodash/_isMasked.js","../node_modules/lodash/_toSource.js","../node_modules/lodash/_baseIsNative.js","../node_modules/lodash/_getValue.js","../node_modules/lodash/_getNative.js","../node_modules/lodash/_Map.js","../node_modules/lodash/_nativeCreate.js","../node_modules/lodash/_hashClear.js","../node_modules/lodash/_hashDelete.js","../node_modules/lodash/_hashGet.js","../node_modules/lodash/_hashHas.js","../node_modules/lodash/_hashSet.js","../node_modules/lodash/_Hash.js","../node_modules/lodash/_mapCacheClear.js","../node_modules/lodash/_isKeyable.js","../node_modules/lodash/_getMapData.js","../node_modules/lodash/_mapCacheDelete.js","../node_modules/lodash/_mapCacheGet.js","../node_modules/lodash/_mapCacheHas.js","../node_modules/lodash/_mapCacheSet.js","../node_modules/lodash/_MapCache.js","../node_modules/lodash/_stackSet.js","../node_modules/lodash/_Stack.js","../node_modules/lodash/_setCacheAdd.js","../node_modules/lodash/_setCacheHas.js","../node_modules/lodash/_SetCache.js","../node_modules/lodash/_arraySome.js","../node_modules/lodash/_cacheHas.js","../node_modules/lodash/_equalArrays.js","../node_modules/lodash/_Uint8Array.js","../node_modules/lodash/_mapToArray.js","../node_modules/lodash/_setToArray.js","../node_modules/lodash/_equalByTag.js","../node_modules/lodash/_arrayPush.js","../node_modules/lodash/isArray.js","../node_modules/lodash/_baseGetAllKeys.js","../node_modules/lodash/_arrayFilter.js","../node_modules/lodash/stubArray.js","../node_modules/lodash/_getSymbols.js","../node_modules/lodash/_baseTimes.js","../node_modules/lodash/isObjectLike.js","../node_modules/lodash/_baseIsArguments.js","../node_modules/lodash/isArguments.js","../node_modules/lodash/stubFalse.js","../node_modules/lodash/isBuffer.js","../node_modules/lodash/_isIndex.js","../node_modules/lodash/isLength.js","../node_modules/lodash/_baseIsTypedArray.js","../node_modules/lodash/_baseUnary.js","../node_modules/lodash/_nodeUtil.js","../node_modules/lodash/isTypedArray.js","../node_modules/lodash/_arrayLikeKeys.js","../node_modules/lodash/_isPrototype.js","../node_modules/lodash/_overArg.js","../node_modules/lodash/_nativeKeys.js","../node_modules/lodash/_baseKeys.js","../node_modules/lodash/isArrayLike.js","../node_modules/lodash/keys.js","../node_modules/lodash/_getAllKeys.js","../node_modules/lodash/_equalObjects.js","../node_modules/lodash/_DataView.js","../node_modules/lodash/_Promise.js","../node_modules/lodash/_Set.js","../node_modules/lodash/_WeakMap.js","../node_modules/lodash/_getTag.js","../node_modules/lodash/_baseIsEqualDeep.js","../node_modules/lodash/_baseIsEqual.js","../node_modules/lodash/isEqual.js","../node_modules/lodash/_isFlattenable.js","../node_modules/lodash/_baseFlatten.js","../node_modules/lodash/_arrayMap.js","../node_modules/lodash/isSymbol.js","../node_modules/lodash/_isKey.js","../node_modules/lodash/memoize.js","../node_modules/lodash/_memoizeCapped.js","../node_modules/lodash/_stringToPath.js","../node_modules/lodash/_baseToString.js","../node_modules/lodash/toString.js","../node_modules/lodash/_castPath.js","../node_modules/lodash/_toKey.js","../node_modules/lodash/_baseGet.js","../node_modules/lodash/_baseIsMatch.js","../node_modules/lodash/_isStrictComparable.js","../node_modules/lodash/_getMatchData.js","../node_modules/lodash/_matchesStrictComparable.js","../node_modules/lodash/_baseMatches.js","../node_modules/lodash/get.js","../node_modules/lodash/_baseHasIn.js","../node_modules/lodash/_hasPath.js","../node_modules/lodash/hasIn.js","../node_modules/lodash/_baseMatchesProperty.js","../node_modules/lodash/identity.js","../node_modules/lodash/_baseProperty.js","../node_modules/lodash/_basePropertyDeep.js","../node_modules/lodash/property.js","../node_modules/lodash/_baseIteratee.js","../node_modules/lodash/_createBaseFor.js","../node_modules/lodash/_baseFor.js","../node_modules/lodash/_baseForOwn.js","../node_modules/lodash/_createBaseEach.js","../node_modules/lodash/_baseEach.js","../node_modules/lodash/_baseMap.js","../node_modules/lodash/_baseSortBy.js","../node_modules/lodash/_compareAscending.js","../node_modules/lodash/_compareMultiple.js","../node_modules/lodash/_baseOrderBy.js","../node_modules/lodash/_apply.js","../node_modules/lodash/_overRest.js","../node_modules/lodash/constant.js","../node_modules/lodash/_defineProperty.js","../node_modules/lodash/_baseSetToString.js","../node_modules/lodash/_shortOut.js","../node_modules/lodash/_setToString.js","../node_modules/lodash/_baseRest.js","../node_modules/lodash/_isIterateeCall.js","../node_modules/lodash/sortBy.js","../src/tools/tools.ts","../src/captions/captions.ts","../node_modules/crypt/crypt.js","../node_modules/charenc/charenc.js","../node_modules/sha1/sha1.js","../src/styles/itemAttributes.ts","../src/styles/edgeAttributes.ts","../src/styles/nodeAttributes.ts","../src/styles/styleRule.ts","../src/styles/styleRules.ts","../src/ogma/features/styles.ts","../src/ogma/features/captions.ts","../node_modules/rxjs/dist/esm5/internal/util/isFunction.js","../node_modules/rxjs/dist/esm5/internal/util/lift.js","../node_modules/tslib/tslib.es6.mjs","../node_modules/rxjs/dist/esm5/internal/util/createErrorClass.js","../node_modules/rxjs/dist/esm5/internal/util/UnsubscriptionError.js","../node_modules/rxjs/dist/esm5/internal/util/arrRemove.js","../node_modules/rxjs/dist/esm5/internal/Subscription.js","../node_modules/rxjs/dist/esm5/internal/config.js","../node_modules/rxjs/dist/esm5/internal/scheduler/timeoutProvider.js","../node_modules/rxjs/dist/esm5/internal/util/reportUnhandledError.js","../node_modules/rxjs/dist/esm5/internal/util/noop.js","../node_modules/rxjs/dist/esm5/internal/Subscriber.js","../node_modules/rxjs/dist/esm5/internal/util/identity.js","../node_modules/rxjs/dist/esm5/internal/operators/OperatorSubscriber.js","../node_modules/rxjs/dist/esm5/internal/operators/map.js","../node_modules/rxjs/dist/esm5/internal/operators/distinctUntilChanged.js","../src/ogma/features/OgmaStore.ts","../src/ogma/features/reactive.ts","../src/ogma/index.ts","../src/tools/colorPalette.ts","../src/tools/ogmaTool.ts","../src/ogma/features/nodeGrouping.ts","../src/ogma/features/transformations.ts","../src/filters/filters.ts","../src/ogma/features/selectors.ts"],"sourcesContent":["/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n}\n\nmodule.exports = listCacheClear;\n","/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n return value === other || (value !== value && other !== other);\n}\n\nmodule.exports = eq;\n","var eq = require('./eq');\n\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n}\n\nmodule.exports = assocIndexOf;\n","var assocIndexOf = require('./_assocIndexOf');\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype;\n\n/** Built-in value references. */\nvar splice = arrayProto.splice;\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n --this.size;\n return true;\n}\n\nmodule.exports = listCacheDelete;\n","var assocIndexOf = require('./_assocIndexOf');\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n}\n\nmodule.exports = listCacheGet;\n","var assocIndexOf = require('./_assocIndexOf');\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n}\n\nmodule.exports = listCacheHas;\n","var assocIndexOf = require('./_assocIndexOf');\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n ++this.size;\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n}\n\nmodule.exports = listCacheSet;\n","var listCacheClear = require('./_listCacheClear'),\n listCacheDelete = require('./_listCacheDelete'),\n listCacheGet = require('./_listCacheGet'),\n listCacheHas = require('./_listCacheHas'),\n listCacheSet = require('./_listCacheSet');\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\nmodule.exports = ListCache;\n","var ListCache = require('./_ListCache');\n\n/**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\nfunction stackClear() {\n this.__data__ = new ListCache;\n this.size = 0;\n}\n\nmodule.exports = stackClear;\n","/**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction stackDelete(key) {\n var data = this.__data__,\n result = data['delete'](key);\n\n this.size = data.size;\n return result;\n}\n\nmodule.exports = stackDelete;\n","/**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction stackGet(key) {\n return this.__data__.get(key);\n}\n\nmodule.exports = stackGet;\n","/**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction stackHas(key) {\n return this.__data__.has(key);\n}\n\nmodule.exports = stackHas;\n","/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\nmodule.exports = freeGlobal;\n","var freeGlobal = require('./_freeGlobal');\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\nmodule.exports = root;\n","var root = require('./_root');\n\n/** Built-in value references. */\nvar Symbol = root.Symbol;\n\nmodule.exports = Symbol;\n","var Symbol = require('./_Symbol');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\nmodule.exports = getRawTag;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\nmodule.exports = objectToString;\n","var Symbol = require('./_Symbol'),\n getRawTag = require('./_getRawTag'),\n objectToString = require('./_objectToString');\n\n/** `Object#toString` result references. */\nvar nullTag = '[object Null]',\n undefinedTag = '[object Undefined]';\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\nmodule.exports = baseGetTag;\n","/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n}\n\nmodule.exports = isObject;\n","var baseGetTag = require('./_baseGetTag'),\n isObject = require('./isObject');\n\n/** `Object#toString` result references. */\nvar asyncTag = '[object AsyncFunction]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n proxyTag = '[object Proxy]';\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n if (!isObject(value)) {\n return false;\n }\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 9 which returns 'object' for typed arrays and other constructors.\n var tag = baseGetTag(value);\n return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;\n}\n\nmodule.exports = isFunction;\n","var root = require('./_root');\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\nmodule.exports = coreJsData;\n","var coreJsData = require('./_coreJsData');\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n}\n\nmodule.exports = isMasked;\n","/** Used for built-in method references. */\nvar funcProto = Function.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to convert.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n}\n\nmodule.exports = toSource;\n","var isFunction = require('./isFunction'),\n isMasked = require('./_isMasked'),\n isObject = require('./isObject'),\n toSource = require('./_toSource');\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used for built-in method references. */\nvar funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\nfunction baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = isFunction(value) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n}\n\nmodule.exports = baseIsNative;\n","/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n return object == null ? undefined : object[key];\n}\n\nmodule.exports = getValue;\n","var baseIsNative = require('./_baseIsNative'),\n getValue = require('./_getValue');\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n}\n\nmodule.exports = getNative;\n","var getNative = require('./_getNative'),\n root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar Map = getNative(root, 'Map');\n\nmodule.exports = Map;\n","var getNative = require('./_getNative');\n\n/* Built-in method references that are verified to be native. */\nvar nativeCreate = getNative(Object, 'create');\n\nmodule.exports = nativeCreate;\n","var nativeCreate = require('./_nativeCreate');\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n}\n\nmodule.exports = hashClear;\n","/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n var result = this.has(key) && delete this.__data__[key];\n this.size -= result ? 1 : 0;\n return result;\n}\n\nmodule.exports = hashDelete;\n","var nativeCreate = require('./_nativeCreate');\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\nmodule.exports = hashGet;\n","var nativeCreate = require('./_nativeCreate');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);\n}\n\nmodule.exports = hashHas;\n","var nativeCreate = require('./_nativeCreate');\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n var data = this.__data__;\n this.size += this.has(key) ? 0 : 1;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n}\n\nmodule.exports = hashSet;\n","var hashClear = require('./_hashClear'),\n hashDelete = require('./_hashDelete'),\n hashGet = require('./_hashGet'),\n hashHas = require('./_hashHas'),\n hashSet = require('./_hashSet');\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\nmodule.exports = Hash;\n","var Hash = require('./_Hash'),\n ListCache = require('./_ListCache'),\n Map = require('./_Map');\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n}\n\nmodule.exports = mapCacheClear;\n","/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n}\n\nmodule.exports = isKeyable;\n","var isKeyable = require('./_isKeyable');\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n}\n\nmodule.exports = getMapData;\n","var getMapData = require('./_getMapData');\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n var result = getMapData(this, key)['delete'](key);\n this.size -= result ? 1 : 0;\n return result;\n}\n\nmodule.exports = mapCacheDelete;\n","var getMapData = require('./_getMapData');\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n return getMapData(this, key).get(key);\n}\n\nmodule.exports = mapCacheGet;\n","var getMapData = require('./_getMapData');\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas(key) {\n return getMapData(this, key).has(key);\n}\n\nmodule.exports = mapCacheHas;\n","var getMapData = require('./_getMapData');\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n var data = getMapData(this, key),\n size = data.size;\n\n data.set(key, value);\n this.size += data.size == size ? 0 : 1;\n return this;\n}\n\nmodule.exports = mapCacheSet;\n","var mapCacheClear = require('./_mapCacheClear'),\n mapCacheDelete = require('./_mapCacheDelete'),\n mapCacheGet = require('./_mapCacheGet'),\n mapCacheHas = require('./_mapCacheHas'),\n mapCacheSet = require('./_mapCacheSet');\n\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction MapCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `MapCache`.\nMapCache.prototype.clear = mapCacheClear;\nMapCache.prototype['delete'] = mapCacheDelete;\nMapCache.prototype.get = mapCacheGet;\nMapCache.prototype.has = mapCacheHas;\nMapCache.prototype.set = mapCacheSet;\n\nmodule.exports = MapCache;\n","var ListCache = require('./_ListCache'),\n Map = require('./_Map'),\n MapCache = require('./_MapCache');\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\nfunction stackSet(key, value) {\n var data = this.__data__;\n if (data instanceof ListCache) {\n var pairs = data.__data__;\n if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n pairs.push([key, value]);\n this.size = ++data.size;\n return this;\n }\n data = this.__data__ = new MapCache(pairs);\n }\n data.set(key, value);\n this.size = data.size;\n return this;\n}\n\nmodule.exports = stackSet;\n","var ListCache = require('./_ListCache'),\n stackClear = require('./_stackClear'),\n stackDelete = require('./_stackDelete'),\n stackGet = require('./_stackGet'),\n stackHas = require('./_stackHas'),\n stackSet = require('./_stackSet');\n\n/**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Stack(entries) {\n var data = this.__data__ = new ListCache(entries);\n this.size = data.size;\n}\n\n// Add methods to `Stack`.\nStack.prototype.clear = stackClear;\nStack.prototype['delete'] = stackDelete;\nStack.prototype.get = stackGet;\nStack.prototype.has = stackHas;\nStack.prototype.set = stackSet;\n\nmodule.exports = Stack;\n","/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/**\n * Adds `value` to the array cache.\n *\n * @private\n * @name add\n * @memberOf SetCache\n * @alias push\n * @param {*} value The value to cache.\n * @returns {Object} Returns the cache instance.\n */\nfunction setCacheAdd(value) {\n this.__data__.set(value, HASH_UNDEFINED);\n return this;\n}\n\nmodule.exports = setCacheAdd;\n","/**\n * Checks if `value` is in the array cache.\n *\n * @private\n * @name has\n * @memberOf SetCache\n * @param {*} value The value to search for.\n * @returns {number} Returns `true` if `value` is found, else `false`.\n */\nfunction setCacheHas(value) {\n return this.__data__.has(value);\n}\n\nmodule.exports = setCacheHas;\n","var MapCache = require('./_MapCache'),\n setCacheAdd = require('./_setCacheAdd'),\n setCacheHas = require('./_setCacheHas');\n\n/**\n *\n * Creates an array cache object to store unique values.\n *\n * @private\n * @constructor\n * @param {Array} [values] The values to cache.\n */\nfunction SetCache(values) {\n var index = -1,\n length = values == null ? 0 : values.length;\n\n this.__data__ = new MapCache;\n while (++index < length) {\n this.add(values[index]);\n }\n}\n\n// Add methods to `SetCache`.\nSetCache.prototype.add = SetCache.prototype.push = setCacheAdd;\nSetCache.prototype.has = setCacheHas;\n\nmodule.exports = SetCache;\n","/**\n * A specialized version of `_.some` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n */\nfunction arraySome(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (predicate(array[index], index, array)) {\n return true;\n }\n }\n return false;\n}\n\nmodule.exports = arraySome;\n","/**\n * Checks if a `cache` value for `key` exists.\n *\n * @private\n * @param {Object} cache The cache to query.\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction cacheHas(cache, key) {\n return cache.has(key);\n}\n\nmodule.exports = cacheHas;\n","var SetCache = require('./_SetCache'),\n arraySome = require('./_arraySome'),\n cacheHas = require('./_cacheHas');\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/**\n * A specialized version of `baseIsEqualDeep` for arrays with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Array} array The array to compare.\n * @param {Array} other The other array to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `array` and `other` objects.\n * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.\n */\nfunction equalArrays(array, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n arrLength = array.length,\n othLength = other.length;\n\n if (arrLength != othLength && !(isPartial && othLength > arrLength)) {\n return false;\n }\n // Check that cyclic values are equal.\n var arrStacked = stack.get(array);\n var othStacked = stack.get(other);\n if (arrStacked && othStacked) {\n return arrStacked == other && othStacked == array;\n }\n var index = -1,\n result = true,\n seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;\n\n stack.set(array, other);\n stack.set(other, array);\n\n // Ignore non-index properties.\n while (++index < arrLength) {\n var arrValue = array[index],\n othValue = other[index];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, arrValue, index, other, array, stack)\n : customizer(arrValue, othValue, index, array, other, stack);\n }\n if (compared !== undefined) {\n if (compared) {\n continue;\n }\n result = false;\n break;\n }\n // Recursively compare arrays (susceptible to call stack limits).\n if (seen) {\n if (!arraySome(other, function(othValue, othIndex) {\n if (!cacheHas(seen, othIndex) &&\n (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {\n return seen.push(othIndex);\n }\n })) {\n result = false;\n break;\n }\n } else if (!(\n arrValue === othValue ||\n equalFunc(arrValue, othValue, bitmask, customizer, stack)\n )) {\n result = false;\n break;\n }\n }\n stack['delete'](array);\n stack['delete'](other);\n return result;\n}\n\nmodule.exports = equalArrays;\n","var root = require('./_root');\n\n/** Built-in value references. */\nvar Uint8Array = root.Uint8Array;\n\nmodule.exports = Uint8Array;\n","/**\n * Converts `map` to its key-value pairs.\n *\n * @private\n * @param {Object} map The map to convert.\n * @returns {Array} Returns the key-value pairs.\n */\nfunction mapToArray(map) {\n var index = -1,\n result = Array(map.size);\n\n map.forEach(function(value, key) {\n result[++index] = [key, value];\n });\n return result;\n}\n\nmodule.exports = mapToArray;\n","/**\n * Converts `set` to an array of its values.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the values.\n */\nfunction setToArray(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = value;\n });\n return result;\n}\n\nmodule.exports = setToArray;\n","var Symbol = require('./_Symbol'),\n Uint8Array = require('./_Uint8Array'),\n eq = require('./eq'),\n equalArrays = require('./_equalArrays'),\n mapToArray = require('./_mapToArray'),\n setToArray = require('./_setToArray');\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/** `Object#toString` result references. */\nvar boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]';\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * A specialized version of `baseIsEqualDeep` for comparing objects of\n * the same `toStringTag`.\n *\n * **Note:** This function only supports comparing values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {string} tag The `toStringTag` of the objects to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {\n switch (tag) {\n case dataViewTag:\n if ((object.byteLength != other.byteLength) ||\n (object.byteOffset != other.byteOffset)) {\n return false;\n }\n object = object.buffer;\n other = other.buffer;\n\n case arrayBufferTag:\n if ((object.byteLength != other.byteLength) ||\n !equalFunc(new Uint8Array(object), new Uint8Array(other))) {\n return false;\n }\n return true;\n\n case boolTag:\n case dateTag:\n case numberTag:\n // Coerce booleans to `1` or `0` and dates to milliseconds.\n // Invalid dates are coerced to `NaN`.\n return eq(+object, +other);\n\n case errorTag:\n return object.name == other.name && object.message == other.message;\n\n case regexpTag:\n case stringTag:\n // Coerce regexes to strings and treat strings, primitives and objects,\n // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring\n // for more details.\n return object == (other + '');\n\n case mapTag:\n var convert = mapToArray;\n\n case setTag:\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG;\n convert || (convert = setToArray);\n\n if (object.size != other.size && !isPartial) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked) {\n return stacked == other;\n }\n bitmask |= COMPARE_UNORDERED_FLAG;\n\n // Recursively compare objects (susceptible to call stack limits).\n stack.set(object, other);\n var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);\n stack['delete'](object);\n return result;\n\n case symbolTag:\n if (symbolValueOf) {\n return symbolValueOf.call(object) == symbolValueOf.call(other);\n }\n }\n return false;\n}\n\nmodule.exports = equalByTag;\n","/**\n * Appends the elements of `values` to `array`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to append.\n * @returns {Array} Returns `array`.\n */\nfunction arrayPush(array, values) {\n var index = -1,\n length = values.length,\n offset = array.length;\n\n while (++index < length) {\n array[offset + index] = values[index];\n }\n return array;\n}\n\nmodule.exports = arrayPush;\n","/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\nmodule.exports = isArray;\n","var arrayPush = require('./_arrayPush'),\n isArray = require('./isArray');\n\n/**\n * The base implementation of `getAllKeys` and `getAllKeysIn` which uses\n * `keysFunc` and `symbolsFunc` to get the enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @param {Function} symbolsFunc The function to get the symbols of `object`.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction baseGetAllKeys(object, keysFunc, symbolsFunc) {\n var result = keysFunc(object);\n return isArray(object) ? result : arrayPush(result, symbolsFunc(object));\n}\n\nmodule.exports = baseGetAllKeys;\n","/**\n * A specialized version of `_.filter` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\nfunction arrayFilter(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (predicate(value, index, array)) {\n result[resIndex++] = value;\n }\n }\n return result;\n}\n\nmodule.exports = arrayFilter;\n","/**\n * This method returns a new empty array.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {Array} Returns the new empty array.\n * @example\n *\n * var arrays = _.times(2, _.stubArray);\n *\n * console.log(arrays);\n * // => [[], []]\n *\n * console.log(arrays[0] === arrays[1]);\n * // => false\n */\nfunction stubArray() {\n return [];\n}\n\nmodule.exports = stubArray;\n","var arrayFilter = require('./_arrayFilter'),\n stubArray = require('./stubArray');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols;\n\n/**\n * Creates an array of the own enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbols = !nativeGetSymbols ? stubArray : function(object) {\n if (object == null) {\n return [];\n }\n object = Object(object);\n return arrayFilter(nativeGetSymbols(object), function(symbol) {\n return propertyIsEnumerable.call(object, symbol);\n });\n};\n\nmodule.exports = getSymbols;\n","/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n}\n\nmodule.exports = baseTimes;\n","/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\nmodule.exports = isObjectLike;\n","var baseGetTag = require('./_baseGetTag'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]';\n\n/**\n * The base implementation of `_.isArguments`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n */\nfunction baseIsArguments(value) {\n return isObjectLike(value) && baseGetTag(value) == argsTag;\n}\n\nmodule.exports = baseIsArguments;\n","var baseIsArguments = require('./_baseIsArguments'),\n isObjectLike = require('./isObjectLike');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nvar isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {\n return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&\n !propertyIsEnumerable.call(value, 'callee');\n};\n\nmodule.exports = isArguments;\n","/**\n * This method returns `false`.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {boolean} Returns `false`.\n * @example\n *\n * _.times(2, _.stubFalse);\n * // => [false, false]\n */\nfunction stubFalse() {\n return false;\n}\n\nmodule.exports = stubFalse;\n","var root = require('./_root'),\n stubFalse = require('./stubFalse');\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;\n\n/**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\nvar isBuffer = nativeIsBuffer || stubFalse;\n\nmodule.exports = isBuffer;\n","/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n var type = typeof value;\n length = length == null ? MAX_SAFE_INTEGER : length;\n\n return !!length &&\n (type == 'number' ||\n (type != 'symbol' && reIsUint.test(value))) &&\n (value > -1 && value % 1 == 0 && value < length);\n}\n\nmodule.exports = isIndex;\n","/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\nmodule.exports = isLength;\n","var baseGetTag = require('./_baseGetTag'),\n isLength = require('./isLength'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/** Used to identify `toStringTag` values of typed arrays. */\nvar typedArrayTags = {};\ntypedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\ntypedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\ntypedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\ntypedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\ntypedArrayTags[uint32Tag] = true;\ntypedArrayTags[argsTag] = typedArrayTags[arrayTag] =\ntypedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\ntypedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\ntypedArrayTags[errorTag] = typedArrayTags[funcTag] =\ntypedArrayTags[mapTag] = typedArrayTags[numberTag] =\ntypedArrayTags[objectTag] = typedArrayTags[regexpTag] =\ntypedArrayTags[setTag] = typedArrayTags[stringTag] =\ntypedArrayTags[weakMapTag] = false;\n\n/**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\nfunction baseIsTypedArray(value) {\n return isObjectLike(value) &&\n isLength(value.length) && !!typedArrayTags[baseGetTag(value)];\n}\n\nmodule.exports = baseIsTypedArray;\n","/**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\nfunction baseUnary(func) {\n return function(value) {\n return func(value);\n };\n}\n\nmodule.exports = baseUnary;\n","var freeGlobal = require('./_freeGlobal');\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Detect free variable `process` from Node.js. */\nvar freeProcess = moduleExports && freeGlobal.process;\n\n/** Used to access faster Node.js helpers. */\nvar nodeUtil = (function() {\n try {\n // Use `util.types` for Node.js 10+.\n var types = freeModule && freeModule.require && freeModule.require('util').types;\n\n if (types) {\n return types;\n }\n\n // Legacy `process.binding('util')` for Node.js < 10.\n return freeProcess && freeProcess.binding && freeProcess.binding('util');\n } catch (e) {}\n}());\n\nmodule.exports = nodeUtil;\n","var baseIsTypedArray = require('./_baseIsTypedArray'),\n baseUnary = require('./_baseUnary'),\n nodeUtil = require('./_nodeUtil');\n\n/* Node.js helper references. */\nvar nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n/**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\nvar isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\nmodule.exports = isTypedArray;\n","var baseTimes = require('./_baseTimes'),\n isArguments = require('./isArguments'),\n isArray = require('./isArray'),\n isBuffer = require('./isBuffer'),\n isIndex = require('./_isIndex'),\n isTypedArray = require('./isTypedArray');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n var isArr = isArray(value),\n isArg = !isArr && isArguments(value),\n isBuff = !isArr && !isArg && isBuffer(value),\n isType = !isArr && !isArg && !isBuff && isTypedArray(value),\n skipIndexes = isArr || isArg || isBuff || isType,\n result = skipIndexes ? baseTimes(value.length, String) : [],\n length = result.length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (\n // Safari 9 has enumerable `arguments.length` in strict mode.\n key == 'length' ||\n // Node.js 0.10 has enumerable non-index properties on buffers.\n (isBuff && (key == 'offset' || key == 'parent')) ||\n // PhantomJS 2 has enumerable non-index properties on typed arrays.\n (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||\n // Skip index properties.\n isIndex(key, length)\n ))) {\n result.push(key);\n }\n }\n return result;\n}\n\nmodule.exports = arrayLikeKeys;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n}\n\nmodule.exports = isPrototype;\n","/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\nmodule.exports = overArg;\n","var overArg = require('./_overArg');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeKeys = overArg(Object.keys, Object);\n\nmodule.exports = nativeKeys;\n","var isPrototype = require('./_isPrototype'),\n nativeKeys = require('./_nativeKeys');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n}\n\nmodule.exports = baseKeys;\n","var isFunction = require('./isFunction'),\n isLength = require('./isLength');\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n}\n\nmodule.exports = isArrayLike;\n","var arrayLikeKeys = require('./_arrayLikeKeys'),\n baseKeys = require('./_baseKeys'),\n isArrayLike = require('./isArrayLike');\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nfunction keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n}\n\nmodule.exports = keys;\n","var baseGetAllKeys = require('./_baseGetAllKeys'),\n getSymbols = require('./_getSymbols'),\n keys = require('./keys');\n\n/**\n * Creates an array of own enumerable property names and symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeys(object) {\n return baseGetAllKeys(object, keys, getSymbols);\n}\n\nmodule.exports = getAllKeys;\n","var getAllKeys = require('./_getAllKeys');\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1;\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * A specialized version of `baseIsEqualDeep` for objects with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalObjects(object, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n objProps = getAllKeys(object),\n objLength = objProps.length,\n othProps = getAllKeys(other),\n othLength = othProps.length;\n\n if (objLength != othLength && !isPartial) {\n return false;\n }\n var index = objLength;\n while (index--) {\n var key = objProps[index];\n if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {\n return false;\n }\n }\n // Check that cyclic values are equal.\n var objStacked = stack.get(object);\n var othStacked = stack.get(other);\n if (objStacked && othStacked) {\n return objStacked == other && othStacked == object;\n }\n var result = true;\n stack.set(object, other);\n stack.set(other, object);\n\n var skipCtor = isPartial;\n while (++index < objLength) {\n key = objProps[index];\n var objValue = object[key],\n othValue = other[key];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, objValue, key, other, object, stack)\n : customizer(objValue, othValue, key, object, other, stack);\n }\n // Recursively compare objects (susceptible to call stack limits).\n if (!(compared === undefined\n ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))\n : compared\n )) {\n result = false;\n break;\n }\n skipCtor || (skipCtor = key == 'constructor');\n }\n if (result && !skipCtor) {\n var objCtor = object.constructor,\n othCtor = other.constructor;\n\n // Non `Object` object instances with different constructors are not equal.\n if (objCtor != othCtor &&\n ('constructor' in object && 'constructor' in other) &&\n !(typeof objCtor == 'function' && objCtor instanceof objCtor &&\n typeof othCtor == 'function' && othCtor instanceof othCtor)) {\n result = false;\n }\n }\n stack['delete'](object);\n stack['delete'](other);\n return result;\n}\n\nmodule.exports = equalObjects;\n","var getNative = require('./_getNative'),\n root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar DataView = getNative(root, 'DataView');\n\nmodule.exports = DataView;\n","var getNative = require('./_getNative'),\n root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar Promise = getNative(root, 'Promise');\n\nmodule.exports = Promise;\n","var getNative = require('./_getNative'),\n root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar Set = getNative(root, 'Set');\n\nmodule.exports = Set;\n","var getNative = require('./_getNative'),\n root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar WeakMap = getNative(root, 'WeakMap');\n\nmodule.exports = WeakMap;\n","var DataView = require('./_DataView'),\n Map = require('./_Map'),\n Promise = require('./_Promise'),\n Set = require('./_Set'),\n WeakMap = require('./_WeakMap'),\n baseGetTag = require('./_baseGetTag'),\n toSource = require('./_toSource');\n\n/** `Object#toString` result references. */\nvar mapTag = '[object Map]',\n objectTag = '[object Object]',\n promiseTag = '[object Promise]',\n setTag = '[object Set]',\n weakMapTag = '[object WeakMap]';\n\nvar dataViewTag = '[object DataView]';\n\n/** Used to detect maps, sets, and weakmaps. */\nvar dataViewCtorString = toSource(DataView),\n mapCtorString = toSource(Map),\n promiseCtorString = toSource(Promise),\n setCtorString = toSource(Set),\n weakMapCtorString = toSource(WeakMap);\n\n/**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nvar getTag = baseGetTag;\n\n// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.\nif ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||\n (Map && getTag(new Map) != mapTag) ||\n (Promise && getTag(Promise.resolve()) != promiseTag) ||\n (Set && getTag(new Set) != setTag) ||\n (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n getTag = function(value) {\n var result = baseGetTag(value),\n Ctor = result == objectTag ? value.constructor : undefined,\n ctorString = Ctor ? toSource(Ctor) : '';\n\n if (ctorString) {\n switch (ctorString) {\n case dataViewCtorString: return dataViewTag;\n case mapCtorString: return mapTag;\n case promiseCtorString: return promiseTag;\n case setCtorString: return setTag;\n case weakMapCtorString: return weakMapTag;\n }\n }\n return result;\n };\n}\n\nmodule.exports = getTag;\n","var Stack = require('./_Stack'),\n equalArrays = require('./_equalArrays'),\n equalByTag = require('./_equalByTag'),\n equalObjects = require('./_equalObjects'),\n getTag = require('./_getTag'),\n isArray = require('./isArray'),\n isBuffer = require('./isBuffer'),\n isTypedArray = require('./isTypedArray');\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n objectTag = '[object Object]';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * A specialized version of `baseIsEqual` for arrays and objects which performs\n * deep comparisons and tracks traversed objects enabling objects with circular\n * references to be compared.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} [stack] Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {\n var objIsArr = isArray(object),\n othIsArr = isArray(other),\n objTag = objIsArr ? arrayTag : getTag(object),\n othTag = othIsArr ? arrayTag : getTag(other);\n\n objTag = objTag == argsTag ? objectTag : objTag;\n othTag = othTag == argsTag ? objectTag : othTag;\n\n var objIsObj = objTag == objectTag,\n othIsObj = othTag == objectTag,\n isSameTag = objTag == othTag;\n\n if (isSameTag && isBuffer(object)) {\n if (!isBuffer(other)) {\n return false;\n }\n objIsArr = true;\n objIsObj = false;\n }\n if (isSameTag && !objIsObj) {\n stack || (stack = new Stack);\n return (objIsArr || isTypedArray(object))\n ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)\n : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);\n }\n if (!(bitmask & COMPARE_PARTIAL_FLAG)) {\n var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),\n othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');\n\n if (objIsWrapped || othIsWrapped) {\n var objUnwrapped = objIsWrapped ? object.value() : object,\n othUnwrapped = othIsWrapped ? other.value() : other;\n\n stack || (stack = new Stack);\n return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);\n }\n }\n if (!isSameTag) {\n return false;\n }\n stack || (stack = new Stack);\n return equalObjects(object, other, bitmask, customizer, equalFunc, stack);\n}\n\nmodule.exports = baseIsEqualDeep;\n","var baseIsEqualDeep = require('./_baseIsEqualDeep'),\n isObjectLike = require('./isObjectLike');\n\n/**\n * The base implementation of `_.isEqual` which supports partial comparisons\n * and tracks traversed objects.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Unordered comparison\n * 2 - Partial comparison\n * @param {Function} [customizer] The function to customize comparisons.\n * @param {Object} [stack] Tracks traversed `value` and `other` objects.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n */\nfunction baseIsEqual(value, other, bitmask, customizer, stack) {\n if (value === other) {\n return true;\n }\n if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {\n return value !== value && other !== other;\n }\n return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);\n}\n\nmodule.exports = baseIsEqual;\n","var baseIsEqual = require('./_baseIsEqual');\n\n/**\n * Performs a deep comparison between two values to determine if they are\n * equivalent.\n *\n * **Note:** This method supports comparing arrays, array buffers, booleans,\n * date objects, error objects, maps, numbers, `Object` objects, regexes,\n * sets, strings, symbols, and typed arrays. `Object` objects are compared\n * by their own, not inherited, enumerable properties. Functions and DOM\n * nodes are compared by strict equality, i.e. `===`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.isEqual(object, other);\n * // => true\n *\n * object === other;\n * // => false\n */\nfunction isEqual(value, other) {\n return baseIsEqual(value, other);\n}\n\nmodule.exports = isEqual;\n","var Symbol = require('./_Symbol'),\n isArguments = require('./isArguments'),\n isArray = require('./isArray');\n\n/** Built-in value references. */\nvar spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined;\n\n/**\n * Checks if `value` is a flattenable `arguments` object or array.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.\n */\nfunction isFlattenable(value) {\n return isArray(value) || isArguments(value) ||\n !!(spreadableSymbol && value && value[spreadableSymbol]);\n}\n\nmodule.exports = isFlattenable;\n","var arrayPush = require('./_arrayPush'),\n isFlattenable = require('./_isFlattenable');\n\n/**\n * The base implementation of `_.flatten` with support for restricting flattening.\n *\n * @private\n * @param {Array} array The array to flatten.\n * @param {number} depth The maximum recursion depth.\n * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.\n * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.\n * @param {Array} [result=[]] The initial result value.\n * @returns {Array} Returns the new flattened array.\n */\nfunction baseFlatten(array, depth, predicate, isStrict, result) {\n var index = -1,\n length = array.length;\n\n predicate || (predicate = isFlattenable);\n result || (result = []);\n\n while (++index < length) {\n var value = array[index];\n if (depth > 0 && predicate(value)) {\n if (depth > 1) {\n // Recursively flatten arrays (susceptible to call stack limits).\n baseFlatten(value, depth - 1, predicate, isStrict, result);\n } else {\n arrayPush(result, value);\n }\n } else if (!isStrict) {\n result[result.length] = value;\n }\n }\n return result;\n}\n\nmodule.exports = baseFlatten;\n","/**\n * A specialized version of `_.map` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\nfunction arrayMap(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length,\n result = Array(length);\n\n while (++index < length) {\n result[index] = iteratee(array[index], index, array);\n }\n return result;\n}\n\nmodule.exports = arrayMap;\n","var baseGetTag = require('./_baseGetTag'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar symbolTag = '[object Symbol]';\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && baseGetTag(value) == symbolTag);\n}\n\nmodule.exports = isSymbol;\n","var isArray = require('./isArray'),\n isSymbol = require('./isSymbol');\n\n/** Used to match property names within property paths. */\nvar reIsDeepProp = /\\.|\\[(?:[^[\\]]*|([\"'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/,\n reIsPlainProp = /^\\w*$/;\n\n/**\n * Checks if `value` is a property name and not a property path.\n *\n * @private\n * @param {*} value The value to check.\n * @param {Object} [object] The object to query keys on.\n * @returns {boolean} Returns `true` if `value` is a property name, else `false`.\n */\nfunction isKey(value, object) {\n if (isArray(value)) {\n return false;\n }\n var type = typeof value;\n if (type == 'number' || type == 'symbol' || type == 'boolean' ||\n value == null || isSymbol(value)) {\n return true;\n }\n return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||\n (object != null && value in Object(object));\n}\n\nmodule.exports = isKey;\n","var MapCache = require('./_MapCache');\n\n/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/**\n * Creates a function that memoizes the result of `func`. If `resolver` is\n * provided, it determines the cache key for storing the result based on the\n * arguments provided to the memoized function. By default, the first argument\n * provided to the memoized function is used as the map cache key. The `func`\n * is invoked with the `this` binding of the memoized function.\n *\n * **Note:** The cache is exposed as the `cache` property on the memoized\n * function. Its creation may be customized by replacing the `_.memoize.Cache`\n * constructor with one whose instances implement the\n * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)\n * method interface of `clear`, `delete`, `get`, `has`, and `set`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to have its output memoized.\n * @param {Function} [resolver] The function to resolve the cache key.\n * @returns {Function} Returns the new memoized function.\n * @example\n *\n * var object = { 'a': 1, 'b': 2 };\n * var other = { 'c': 3, 'd': 4 };\n *\n * var values = _.memoize(_.values);\n * values(object);\n * // => [1, 2]\n *\n * values(other);\n * // => [3, 4]\n *\n * object.a = 2;\n * values(object);\n * // => [1, 2]\n *\n * // Modify the result cache.\n * values.cache.set(object, ['a', 'b']);\n * values(object);\n * // => ['a', 'b']\n *\n * // Replace `_.memoize.Cache`.\n * _.memoize.Cache = WeakMap;\n */\nfunction memoize(func, resolver) {\n if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n var memoized = function() {\n var args = arguments,\n key = resolver ? resolver.apply(this, args) : args[0],\n cache = memoized.cache;\n\n if (cache.has(key)) {\n return cache.get(key);\n }\n var result = func.apply(this, args);\n memoized.cache = cache.set(key, result) || cache;\n return result;\n };\n memoized.cache = new (memoize.Cache || MapCache);\n return memoized;\n}\n\n// Expose `MapCache`.\nmemoize.Cache = MapCache;\n\nmodule.exports = memoize;\n","var memoize = require('./memoize');\n\n/** Used as the maximum memoize cache size. */\nvar MAX_MEMOIZE_SIZE = 500;\n\n/**\n * A specialized version of `_.memoize` which clears the memoized function's\n * cache when it exceeds `MAX_MEMOIZE_SIZE`.\n *\n * @private\n * @param {Function} func The function to have its output memoized.\n * @returns {Function} Returns the new memoized function.\n */\nfunction memoizeCapped(func) {\n var result = memoize(func, function(key) {\n if (cache.size === MAX_MEMOIZE_SIZE) {\n cache.clear();\n }\n return key;\n });\n\n var cache = result.cache;\n return result;\n}\n\nmodule.exports = memoizeCapped;\n","var memoizeCapped = require('./_memoizeCapped');\n\n/** Used to match property names within property paths. */\nvar rePropName = /[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))/g;\n\n/** Used to match backslashes in property paths. */\nvar reEscapeChar = /\\\\(\\\\)?/g;\n\n/**\n * Converts `string` to a property path array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the property path array.\n */\nvar stringToPath = memoizeCapped(function(string) {\n var result = [];\n if (string.charCodeAt(0) === 46 /* . */) {\n result.push('');\n }\n string.replace(rePropName, function(match, number, quote, subString) {\n result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));\n });\n return result;\n});\n\nmodule.exports = stringToPath;\n","var Symbol = require('./_Symbol'),\n arrayMap = require('./_arrayMap'),\n isArray = require('./isArray'),\n isSymbol = require('./isSymbol');\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolToString = symbolProto ? symbolProto.toString : undefined;\n\n/**\n * The base implementation of `_.toString` which doesn't convert nullish\n * values to empty strings.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n */\nfunction baseToString(value) {\n // Exit early for strings to avoid a performance hit in some environments.\n if (typeof value == 'string') {\n return value;\n }\n if (isArray(value)) {\n // Recursively convert values (susceptible to call stack limits).\n return arrayMap(value, baseToString) + '';\n }\n if (isSymbol(value)) {\n return symbolToString ? symbolToString.call(value) : '';\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\nmodule.exports = baseToString;\n","var baseToString = require('./_baseToString');\n\n/**\n * Converts `value` to a string. An empty string is returned for `null`\n * and `undefined` values. The sign of `-0` is preserved.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n * @example\n *\n * _.toString(null);\n * // => ''\n *\n * _.toString(-0);\n * // => '-0'\n *\n * _.toString([1, 2, 3]);\n * // => '1,2,3'\n */\nfunction toString(value) {\n return value == null ? '' : baseToString(value);\n}\n\nmodule.exports = toString;\n","var isArray = require('./isArray'),\n isKey = require('./_isKey'),\n stringToPath = require('./_stringToPath'),\n toString = require('./toString');\n\n/**\n * Casts `value` to a path array if it's not one.\n *\n * @private\n * @param {*} value The value to inspect.\n * @param {Object} [object] The object to query keys on.\n * @returns {Array} Returns the cast property path array.\n */\nfunction castPath(value, object) {\n if (isArray(value)) {\n return value;\n }\n return isKey(value, object) ? [value] : stringToPath(toString(value));\n}\n\nmodule.exports = castPath;\n","var isSymbol = require('./isSymbol');\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/**\n * Converts `value` to a string key if it's not a string or symbol.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {string|symbol} Returns the key.\n */\nfunction toKey(value) {\n if (typeof value == 'string' || isSymbol(value)) {\n return value;\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\nmodule.exports = toKey;\n","var castPath = require('./_castPath'),\n toKey = require('./_toKey');\n\n/**\n * The base implementation of `_.get` without support for default values.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @returns {*} Returns the resolved value.\n */\nfunction baseGet(object, path) {\n path = castPath(path, object);\n\n var index = 0,\n length = path.length;\n\n while (object != null && index < length) {\n object = object[toKey(path[index++])];\n }\n return (index && index == length) ? object : undefined;\n}\n\nmodule.exports = baseGet;\n","var Stack = require('./_Stack'),\n baseIsEqual = require('./_baseIsEqual');\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/**\n * The base implementation of `_.isMatch` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property values to match.\n * @param {Array} matchData The property names, values, and compare flags to match.\n * @param {Function} [customizer] The function to customize comparisons.\n * @returns {boolean} Returns `true` if `object` is a match, else `false`.\n */\nfunction baseIsMatch(object, source, matchData, customizer) {\n var index = matchData.length,\n length = index,\n noCustomizer = !customizer;\n\n if (object == null) {\n return !length;\n }\n object = Object(object);\n while (index--) {\n var data = matchData[index];\n if ((noCustomizer && data[2])\n ? data[1] !== object[data[0]]\n : !(data[0] in object)\n ) {\n return false;\n }\n }\n while (++index < length) {\n data = matchData[index];\n var key = data[0],\n objValue = object[key],\n srcValue = data[1];\n\n if (noCustomizer && data[2]) {\n if (objValue === undefined && !(key in object)) {\n return false;\n }\n } else {\n var stack = new Stack;\n if (customizer) {\n var result = customizer(objValue, srcValue, key, object, source, stack);\n }\n if (!(result === undefined\n ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)\n : result\n )) {\n return false;\n }\n }\n }\n return true;\n}\n\nmodule.exports = baseIsMatch;\n","var isObject = require('./isObject');\n\n/**\n * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` if suitable for strict\n * equality comparisons, else `false`.\n */\nfunction isStrictComparable(value) {\n return value === value && !isObject(value);\n}\n\nmodule.exports = isStrictComparable;\n","var isStrictComparable = require('./_isStrictComparable'),\n keys = require('./keys');\n\n/**\n * Gets the property names, values, and compare flags of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the match data of `object`.\n */\nfunction getMatchData(object) {\n var result = keys(object),\n length = result.length;\n\n while (length--) {\n var key = result[length],\n value = object[key];\n\n result[length] = [key, value, isStrictComparable(value)];\n }\n return result;\n}\n\nmodule.exports = getMatchData;\n","/**\n * A specialized version of `matchesProperty` for source values suitable\n * for strict equality comparisons, i.e. `===`.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new spec function.\n */\nfunction matchesStrictComparable(key, srcValue) {\n return function(object) {\n if (object == null) {\n return false;\n }\n return object[key] === srcValue &&\n (srcValue !== undefined || (key in Object(object)));\n };\n}\n\nmodule.exports = matchesStrictComparable;\n","var baseIsMatch = require('./_baseIsMatch'),\n getMatchData = require('./_getMatchData'),\n matchesStrictComparable = require('./_matchesStrictComparable');\n\n/**\n * The base implementation of `_.matches` which doesn't clone `source`.\n *\n * @private\n * @param {Object} source The object of property values to match.\n * @returns {Function} Returns the new spec function.\n */\nfunction baseMatches(source) {\n var matchData = getMatchData(source);\n if (matchData.length == 1 && matchData[0][2]) {\n return matchesStrictComparable(matchData[0][0], matchData[0][1]);\n }\n return function(object) {\n return object === source || baseIsMatch(object, source, matchData);\n };\n}\n\nmodule.exports = baseMatches;\n","var baseGet = require('./_baseGet');\n\n/**\n * Gets the value at `path` of `object`. If the resolved value is\n * `undefined`, the `defaultValue` is returned in its place.\n *\n * @static\n * @memberOf _\n * @since 3.7.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @param {*} [defaultValue] The value returned for `undefined` resolved values.\n * @returns {*} Returns the resolved value.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.get(object, 'a[0].b.c');\n * // => 3\n *\n * _.get(object, ['a', '0', 'b', 'c']);\n * // => 3\n *\n * _.get(object, 'a.b.c', 'default');\n * // => 'default'\n */\nfunction get(object, path, defaultValue) {\n var result = object == null ? undefined : baseGet(object, path);\n return result === undefined ? defaultValue : result;\n}\n\nmodule.exports = get;\n","/**\n * The base implementation of `_.hasIn` without support for deep paths.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {Array|string} key The key to check.\n * @returns {boolean} Returns `true` if `key` exists, else `false`.\n */\nfunction baseHasIn(object, key) {\n return object != null && key in Object(object);\n}\n\nmodule.exports = baseHasIn;\n","var castPath = require('./_castPath'),\n isArguments = require('./isArguments'),\n isArray = require('./isArray'),\n isIndex = require('./_isIndex'),\n isLength = require('./isLength'),\n toKey = require('./_toKey');\n\n/**\n * Checks if `path` exists on `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @param {Function} hasFunc The function to check properties.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n */\nfunction hasPath(object, path, hasFunc) {\n path = castPath(path, object);\n\n var index = -1,\n length = path.length,\n result = false;\n\n while (++index < length) {\n var key = toKey(path[index]);\n if (!(result = object != null && hasFunc(object, key))) {\n break;\n }\n object = object[key];\n }\n if (result || ++index != length) {\n return result;\n }\n length = object == null ? 0 : object.length;\n return !!length && isLength(length) && isIndex(key, length) &&\n (isArray(object) || isArguments(object));\n}\n\nmodule.exports = hasPath;\n","var baseHasIn = require('./_baseHasIn'),\n hasPath = require('./_hasPath');\n\n/**\n * Checks if `path` is a direct or inherited property of `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n * @example\n *\n * var object = _.create({ 'a': _.create({ 'b': 2 }) });\n *\n * _.hasIn(object, 'a');\n * // => true\n *\n * _.hasIn(object, 'a.b');\n * // => true\n *\n * _.hasIn(object, ['a', 'b']);\n * // => true\n *\n * _.hasIn(object, 'b');\n * // => false\n */\nfunction hasIn(object, path) {\n return object != null && hasPath(object, path, baseHasIn);\n}\n\nmodule.exports = hasIn;\n","var baseIsEqual = require('./_baseIsEqual'),\n get = require('./get'),\n hasIn = require('./hasIn'),\n isKey = require('./_isKey'),\n isStrictComparable = require('./_isStrictComparable'),\n matchesStrictComparable = require('./_matchesStrictComparable'),\n toKey = require('./_toKey');\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/**\n * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.\n *\n * @private\n * @param {string} path The path of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new spec function.\n */\nfunction baseMatchesProperty(path, srcValue) {\n if (isKey(path) && isStrictComparable(srcValue)) {\n return matchesStrictComparable(toKey(path), srcValue);\n }\n return function(object) {\n var objValue = get(object, path);\n return (objValue === undefined && objValue === srcValue)\n ? hasIn(object, path)\n : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);\n };\n}\n\nmodule.exports = baseMatchesProperty;\n","/**\n * This method returns the first argument it receives.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {*} value Any value.\n * @returns {*} Returns `value`.\n * @example\n *\n * var object = { 'a': 1 };\n *\n * console.log(_.identity(object) === object);\n * // => true\n */\nfunction identity(value) {\n return value;\n}\n\nmodule.exports = identity;\n","/**\n * The base implementation of `_.property` without support for deep paths.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @returns {Function} Returns the new accessor function.\n */\nfunction baseProperty(key) {\n return function(object) {\n return object == null ? undefined : object[key];\n };\n}\n\nmodule.exports = baseProperty;\n","var baseGet = require('./_baseGet');\n\n/**\n * A specialized version of `baseProperty` which supports deep paths.\n *\n * @private\n * @param {Array|string} path The path of the property to get.\n * @returns {Function} Returns the new accessor function.\n */\nfunction basePropertyDeep(path) {\n return function(object) {\n return baseGet(object, path);\n };\n}\n\nmodule.exports = basePropertyDeep;\n","var baseProperty = require('./_baseProperty'),\n basePropertyDeep = require('./_basePropertyDeep'),\n isKey = require('./_isKey'),\n toKey = require('./_toKey');\n\n/**\n * Creates a function that returns the value at `path` of a given object.\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Util\n * @param {Array|string} path The path of the property to get.\n * @returns {Function} Returns the new accessor function.\n * @example\n *\n * var objects = [\n * { 'a': { 'b': 2 } },\n * { 'a': { 'b': 1 } }\n * ];\n *\n * _.map(objects, _.property('a.b'));\n * // => [2, 1]\n *\n * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');\n * // => [1, 2]\n */\nfunction property(path) {\n return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);\n}\n\nmodule.exports = property;\n","var baseMatches = require('./_baseMatches'),\n baseMatchesProperty = require('./_baseMatchesProperty'),\n identity = require('./identity'),\n isArray = require('./isArray'),\n property = require('./property');\n\n/**\n * The base implementation of `_.iteratee`.\n *\n * @private\n * @param {*} [value=_.identity] The value to convert to an iteratee.\n * @returns {Function} Returns the iteratee.\n */\nfunction baseIteratee(value) {\n // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.\n // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.\n if (typeof value == 'function') {\n return value;\n }\n if (value == null) {\n return identity;\n }\n if (typeof value == 'object') {\n return isArray(value)\n ? baseMatchesProperty(value[0], value[1])\n : baseMatches(value);\n }\n return property(value);\n}\n\nmodule.exports = baseIteratee;\n","/**\n * Creates a base function for methods like `_.forIn` and `_.forOwn`.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\nfunction createBaseFor(fromRight) {\n return function(object, iteratee, keysFunc) {\n var index = -1,\n iterable = Object(object),\n props = keysFunc(object),\n length = props.length;\n\n while (length--) {\n var key = props[fromRight ? length : ++index];\n if (iteratee(iterable[key], key, iterable) === false) {\n break;\n }\n }\n return object;\n };\n}\n\nmodule.exports = createBaseFor;\n","var createBaseFor = require('./_createBaseFor');\n\n/**\n * The base implementation of `baseForOwn` which iterates over `object`\n * properties returned by `keysFunc` and invokes `iteratee` for each property.\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @returns {Object} Returns `object`.\n */\nvar baseFor = createBaseFor();\n\nmodule.exports = baseFor;\n","var baseFor = require('./_baseFor'),\n keys = require('./keys');\n\n/**\n * The base implementation of `_.forOwn` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Object} Returns `object`.\n */\nfunction baseForOwn(object, iteratee) {\n return object && baseFor(object, iteratee, keys);\n}\n\nmodule.exports = baseForOwn;\n","var isArrayLike = require('./isArrayLike');\n\n/**\n * Creates a `baseEach` or `baseEachRight` function.\n *\n * @private\n * @param {Function} eachFunc The function to iterate over a collection.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\nfunction createBaseEach(eachFunc, fromRight) {\n return function(collection, iteratee) {\n if (collection == null) {\n return collection;\n }\n if (!isArrayLike(collection)) {\n return eachFunc(collection, iteratee);\n }\n var length = collection.length,\n index = fromRight ? length : -1,\n iterable = Object(collection);\n\n while ((fromRight ? index-- : ++index < length)) {\n if (iteratee(iterable[index], index, iterable) === false) {\n break;\n }\n }\n return collection;\n };\n}\n\nmodule.exports = createBaseEach;\n","var baseForOwn = require('./_baseForOwn'),\n createBaseEach = require('./_createBaseEach');\n\n/**\n * The base implementation of `_.forEach` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n */\nvar baseEach = createBaseEach(baseForOwn);\n\nmodule.exports = baseEach;\n","var baseEach = require('./_baseEach'),\n isArrayLike = require('./isArrayLike');\n\n/**\n * The base implementation of `_.map` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\nfunction baseMap(collection, iteratee) {\n var index = -1,\n result = isArrayLike(collection) ? Array(collection.length) : [];\n\n baseEach(collection, function(value, key, collection) {\n result[++index] = iteratee(value, key, collection);\n });\n return result;\n}\n\nmodule.exports = baseMap;\n","/**\n * The base implementation of `_.sortBy` which uses `comparer` to define the\n * sort order of `array` and replaces criteria objects with their corresponding\n * values.\n *\n * @private\n * @param {Array} array The array to sort.\n * @param {Function} comparer The function to define sort order.\n * @returns {Array} Returns `array`.\n */\nfunction baseSortBy(array, comparer) {\n var length = array.length;\n\n array.sort(comparer);\n while (length--) {\n array[length] = array[length].value;\n }\n return array;\n}\n\nmodule.exports = baseSortBy;\n","var isSymbol = require('./isSymbol');\n\n/**\n * Compares values to sort them in ascending order.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {number} Returns the sort order indicator for `value`.\n */\nfunction compareAscending(value, other) {\n if (value !== other) {\n var valIsDefined = value !== undefined,\n valIsNull = value === null,\n valIsReflexive = value === value,\n valIsSymbol = isSymbol(value);\n\n var othIsDefined = other !== undefined,\n othIsNull = other === null,\n othIsReflexive = other === other,\n othIsSymbol = isSymbol(other);\n\n if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||\n (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||\n (valIsNull && othIsDefined && othIsReflexive) ||\n (!valIsDefined && othIsReflexive) ||\n !valIsReflexive) {\n return 1;\n }\n if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||\n (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||\n (othIsNull && valIsDefined && valIsReflexive) ||\n (!othIsDefined && valIsReflexive) ||\n !othIsReflexive) {\n return -1;\n }\n }\n return 0;\n}\n\nmodule.exports = compareAscending;\n","var compareAscending = require('./_compareAscending');\n\n/**\n * Used by `_.orderBy` to compare multiple properties of a value to another\n * and stable sort them.\n *\n * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,\n * specify an order of \"desc\" for descending or \"asc\" for ascending sort order\n * of corresponding values.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {boolean[]|string[]} orders The order to sort by for each property.\n * @returns {number} Returns the sort order indicator for `object`.\n */\nfunction compareMultiple(object, other, orders) {\n var index = -1,\n objCriteria = object.criteria,\n othCriteria = other.criteria,\n length = objCriteria.length,\n ordersLength = orders.length;\n\n while (++index < length) {\n var result = compareAscending(objCriteria[index], othCriteria[index]);\n if (result) {\n if (index >= ordersLength) {\n return result;\n }\n var order = orders[index];\n return result * (order == 'desc' ? -1 : 1);\n }\n }\n // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications\n // that causes it, under certain circumstances, to provide the same value for\n // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247\n // for more details.\n //\n // This also ensures a stable sort in V8 and other engines.\n // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.\n return object.index - other.index;\n}\n\nmodule.exports = compareMultiple;\n","var arrayMap = require('./_arrayMap'),\n baseGet = require('./_baseGet'),\n baseIteratee = require('./_baseIteratee'),\n baseMap = require('./_baseMap'),\n baseSortBy = require('./_baseSortBy'),\n baseUnary = require('./_baseUnary'),\n compareMultiple = require('./_compareMultiple'),\n identity = require('./identity'),\n isArray = require('./isArray');\n\n/**\n * The base implementation of `_.orderBy` without param guards.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.\n * @param {string[]} orders The sort orders of `iteratees`.\n * @returns {Array} Returns the new sorted array.\n */\nfunction baseOrderBy(collection, iteratees, orders) {\n if (iteratees.length) {\n iteratees = arrayMap(iteratees, function(iteratee) {\n if (isArray(iteratee)) {\n return function(value) {\n return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);\n }\n }\n return iteratee;\n });\n } else {\n iteratees = [identity];\n }\n\n var index = -1;\n iteratees = arrayMap(iteratees, baseUnary(baseIteratee));\n\n var result = baseMap(collection, function(value, key, collection) {\n var criteria = arrayMap(iteratees, function(iteratee) {\n return iteratee(value);\n });\n return { 'criteria': criteria, 'index': ++index, 'value': value };\n });\n\n return baseSortBy(result, function(object, other) {\n return compareMultiple(object, other, orders);\n });\n}\n\nmodule.exports = baseOrderBy;\n","/**\n * A faster alternative to `Function#apply`, this function invokes `func`\n * with the `this` binding of `thisArg` and the arguments of `args`.\n *\n * @private\n * @param {Function} func The function to invoke.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {Array} args The arguments to invoke `func` with.\n * @returns {*} Returns the result of `func`.\n */\nfunction apply(func, thisArg, args) {\n switch (args.length) {\n case 0: return func.call(thisArg);\n case 1: return func.call(thisArg, args[0]);\n case 2: return func.call(thisArg, args[0], args[1]);\n case 3: return func.call(thisArg, args[0], args[1], args[2]);\n }\n return func.apply(thisArg, args);\n}\n\nmodule.exports = apply;\n","var apply = require('./_apply');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max;\n\n/**\n * A specialized version of `baseRest` which transforms the rest array.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @param {Function} transform The rest array transform.\n * @returns {Function} Returns the new function.\n */\nfunction overRest(func, start, transform) {\n start = nativeMax(start === undefined ? (func.length - 1) : start, 0);\n return function() {\n var args = arguments,\n index = -1,\n length = nativeMax(args.length - start, 0),\n array = Array(length);\n\n while (++index < length) {\n array[index] = args[start + index];\n }\n index = -1;\n var otherArgs = Array(start + 1);\n while (++index < start) {\n otherArgs[index] = args[index];\n }\n otherArgs[start] = transform(array);\n return apply(func, this, otherArgs);\n };\n}\n\nmodule.exports = overRest;\n","/**\n * Creates a function that returns `value`.\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Util\n * @param {*} value The value to return from the new function.\n * @returns {Function} Returns the new constant function.\n * @example\n *\n * var objects = _.times(2, _.constant({ 'a': 1 }));\n *\n * console.log(objects);\n * // => [{ 'a': 1 }, { 'a': 1 }]\n *\n * console.log(objects[0] === objects[1]);\n * // => true\n */\nfunction constant(value) {\n return function() {\n return value;\n };\n}\n\nmodule.exports = constant;\n","var getNative = require('./_getNative');\n\nvar defineProperty = (function() {\n try {\n var func = getNative(Object, 'defineProperty');\n func({}, '', {});\n return func;\n } catch (e) {}\n}());\n\nmodule.exports = defineProperty;\n","var constant = require('./constant'),\n defineProperty = require('./_defineProperty'),\n identity = require('./identity');\n\n/**\n * The base implementation of `setToString` without support for hot loop shorting.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\nvar baseSetToString = !defineProperty ? identity : function(func, string) {\n return defineProperty(func, 'toString', {\n 'configurable': true,\n 'enumerable': false,\n 'value': constant(string),\n 'writable': true\n });\n};\n\nmodule.exports = baseSetToString;\n","/** Used to detect hot functions by number of calls within a span of milliseconds. */\nvar HOT_COUNT = 800,\n HOT_SPAN = 16;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeNow = Date.now;\n\n/**\n * Creates a function that'll short out and invoke `identity` instead\n * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`\n * milliseconds.\n *\n * @private\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new shortable function.\n */\nfunction shortOut(func) {\n var count = 0,\n lastCalled = 0;\n\n return function() {\n var stamp = nativeNow(),\n remaining = HOT_SPAN - (stamp - lastCalled);\n\n lastCalled = stamp;\n if (remaining > 0) {\n if (++count >= HOT_COUNT) {\n return arguments[0];\n }\n } else {\n count = 0;\n }\n return func.apply(undefined, arguments);\n };\n}\n\nmodule.exports = shortOut;\n","var baseSetToString = require('./_baseSetToString'),\n shortOut = require('./_shortOut');\n\n/**\n * Sets the `toString` method of `func` to return `string`.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\nvar setToString = shortOut(baseSetToString);\n\nmodule.exports = setToString;\n","var identity = require('./identity'),\n overRest = require('./_overRest'),\n setToString = require('./_setToString');\n\n/**\n * The base implementation of `_.rest` which doesn't validate or coerce arguments.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @returns {Function} Returns the new function.\n */\nfunction baseRest(func, start) {\n return setToString(overRest(func, start, identity), func + '');\n}\n\nmodule.exports = baseRest;\n","var eq = require('./eq'),\n isArrayLike = require('./isArrayLike'),\n isIndex = require('./_isIndex'),\n isObject = require('./isObject');\n\n/**\n * Checks if the given arguments are from an iteratee call.\n *\n * @private\n * @param {*} value The potential iteratee value argument.\n * @param {*} index The potential iteratee index or key argument.\n * @param {*} object The potential iteratee object argument.\n * @returns {boolean} Returns `true` if the arguments are from an iteratee call,\n * else `false`.\n */\nfunction isIterateeCall(value, index, object) {\n if (!isObject(object)) {\n return false;\n }\n var type = typeof index;\n if (type == 'number'\n ? (isArrayLike(object) && isIndex(index, object.length))\n : (type == 'string' && index in object)\n ) {\n return eq(object[index], value);\n }\n return false;\n}\n\nmodule.exports = isIterateeCall;\n","var baseFlatten = require('./_baseFlatten'),\n baseOrderBy = require('./_baseOrderBy'),\n baseRest = require('./_baseRest'),\n isIterateeCall = require('./_isIterateeCall');\n\n/**\n * Creates an array of elements, sorted in ascending order by the results of\n * running each element in a collection thru each iteratee. This method\n * performs a stable sort, that is, it preserves the original sort order of\n * equal elements. The iteratees are invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {...(Function|Function[])} [iteratees=[_.identity]]\n * The iteratees to sort by.\n * @returns {Array} Returns the new sorted array.\n * @example\n *\n * var users = [\n * { 'user': 'fred', 'age': 48 },\n * { 'user': 'barney', 'age': 36 },\n * { 'user': 'fred', 'age': 30 },\n * { 'user': 'barney', 'age': 34 }\n * ];\n *\n * _.sortBy(users, [function(o) { return o.user; }]);\n * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]]\n *\n * _.sortBy(users, ['user', 'age']);\n * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]]\n */\nvar sortBy = baseRest(function(collection, iteratees) {\n if (collection == null) {\n return [];\n }\n var length = iteratees.length;\n if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {\n iteratees = [];\n } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {\n iteratees = [iteratees[0]];\n }\n return baseOrderBy(collection, baseFlatten(iteratees, 1), []);\n});\n\nmodule.exports = sortBy;\n","'use strict';\n\nimport isEqual from 'lodash/isEqual';\nimport sortBy from 'lodash/sortBy';\nimport {Node, NodeList} from '@linkurious/ogma';\nimport {CurrencyFormat, ICurrencyOptions, LkNodeData, LkProperty} from '@linkurious/rest-client';\n\nexport {sortBy};\nconst IMAGE_PATTERN = /\\S+\\.(gif|jpe?g|tiff|png|bmp|svg)$/i;\nexport const CAPTION_HEURISTIC: string[] = [\n 'label',\n 'Label',\n 'name',\n 'Name',\n 'title',\n 'Title',\n 'rdfs:label'\n];\n\nexport class Tools {\n public static isEqual(v1: unknown, v2: unknown): boolean {\n return isEqual(v1, v2);\n }\n\n /**\n * Check that a value is defined : not null and not undefined\n *\n * @param {any} value\n * @return {boolean}\n */\n public static isDefined<T>(value: T): value is NonNullable<T> {\n return value !== undefined && value !== null;\n }\n\n /**\n * Truncate a text\n */\n public static truncate(value: unknown, position: 'middle' | 'end', limit = 0): string {\n const suffix = '\\u2026';\n if (!Tools.isDefined(value)) {\n return ``;\n }\n const valueToTruncate = `${value}`;\n if (valueToTruncate.length <= limit + 1) {\n return valueToTruncate;\n }\n const fixedLimit = limit - 1;\n switch (position) {\n case 'middle':\n return (\n valueToTruncate.substring(0, Math.ceil(fixedLimit / 2)) +\n suffix +\n valueToTruncate.substring(valueToTruncate.length - Math.floor(fixedLimit / 2))\n );\n\n case 'end':\n return valueToTruncate.substring(0, fixedLimit) + suffix;\n }\n }\n\n /**\n * Return a value from a nested object depending on a keyPath\n */\n public static getIn(ref: any, path: Array<string | number>): any {\n return path.reduce((p, c) => (p && p[c] !== undefined ? p[c] : undefined), ref);\n }\n\n /**\n * Return a clone of an object\n */\n public static clone(o: any) {\n return typeof o === 'object'\n ? JSON.parse(\n JSON.stringify(o, (k, v) => {\n return v instanceof Set ? {} : v;\n })\n )\n : o;\n }\n\n /**\n * Get the amount of hidden neighbors from a list of nodes\n *\n * @param nodes\n */\n public static getHiddenNeighbors(nodes: NodeList<LkNodeData>): number {\n return nodes.reduce((result: number, node: Node<LkNodeData>) => {\n const statistics = node.getData('statistics');\n if (statistics !== undefined) {\n const hiddenNeighbors =\n statistics.degree !== undefined && !statistics.supernode\n ? statistics.degree - Tools.getDegreeWithoutSelfConnection(node)\n : statistics.supernodeDegree;\n if (hiddenNeighbors !== undefined && hiddenNeighbors > 0) {\n return (result += hiddenNeighbors);\n }\n }\n return result;\n }, 0);\n }\n\n /**\n * Return the visible degree of a node without self connection (self edge)\n *\n * @param {Node} node\n * @return {number}\n */\n public static getDegreeWithoutSelfConnection(node: Node<LkNodeData>): number {\n return node.getAdjacentNodes({policy: 'exclude-sources', filter: 'raw'}).size;\n }\n\n /**\n * Return a formatted version of a number\n */\n public static formatNumber(number: number): string {\n let div = 1;\n let suffix = '';\n const sign = number < 0 ? '-' : '';\n number = Math.abs(number);\n\n if (number >= 1000000) {\n div = 1000000;\n suffix = 'M';\n } else if (number >= 1000) {\n div = 1000;\n suffix = 'k';\n }\n const nn = number / div;\n // if there is a decimal value and nn < 10\n if (nn < 10 && nn % 1 !== 0) {\n return sign + nn.toFixed(1) + suffix;\n } else {\n return sign + Math.floor(nn) + suffix;\n }\n }\n\n /**\n * Return true if a string is not composed only by invisible char\n *\n * @param {string} value\n * @return {boolean}\n */\n public static isStringFilled(value: string): boolean {\n return value.trim() !== '';\n }\n\n public static getValueFromLkProperty(property: LkProperty): null | string | number | boolean {\n if (typeof property === 'object' && 'type' in property) {\n if (!('original' in property) && !('value' in property)) {\n return null;\n }\n if ('original' in property) {\n return `${property.original}`;\n }\n if ('value' in property) {\n return Tools.formatDate(\n new Date(\n new Date(property.value).getTime() + Tools.timezoneToMilliseconds(property.timezone)\n ).toISOString()\n );\n }\n }\n return property;\n }\n\n /**\n * Return a formatted date as a string\n */\n public static formatDate(\n isoString: string,\n isDatetime?: boolean,\n timezone?: number\n ): string | null {\n // The date received from the server will be always in seconds\n let offsetDate: string | number = isoString;\n if (timezone !== undefined) {\n offsetDate = new Date(isoString).getTime() + timezone * 1000;\n }\n const dateObject = new Date(offsetDate);\n\n if (isNaN(dateObject.getUTCFullYear())) {\n return null;\n }\n let formattedDate =\n dateObject.getFullYear() +\n '-' +\n ((dateObject.getUTCMonth() + 1).toString().length === 1\n ? '0' + (dateObject.getUTCMonth() + 1)\n : dateObject.getUTCMonth() + 1) +\n '-' +\n (dateObject.getUTCDate().toString().length === 1\n ? '0' + dateObject.getUTCDate()\n : dateObject.getUTCDate());\n\n if (isDatetime) {\n formattedDate +=\n ' ' +\n (dateObject.getUTCHours().toString().length === 1\n ? '0' + dateObject.getUTCHours()\n : dateObject.getUTCHours()) +\n ':' +\n (dateObject.getUTCMinutes().toString().length === 1\n ? '0' + dateObject.getUTCMinutes()\n : dateObject.getUTCMinutes()) +\n ':' +\n (dateObject.getUTCSeconds().toString().length === 1\n ? '0' + dateObject.getUTCSeconds()\n : dateObject.getUTCSeconds());\n }\n return formattedDate;\n }\n\n /**\n * From \"+03:00\" return the offset in milliseconds\n * @param timezone\n */\n public static timezoneToMilliseconds(timezone: string | undefined): number {\n if (timezone === undefined) {\n return 0;\n }\n if (timezone === 'Z') {\n return 0;\n }\n const sign = timezone[0];\n const [hours, minutes] = timezone.slice(1).split(':');\n return sign === '+'\n ? this.sanitizeFormattedNumber(hours) * 3.6e6 + this.sanitizeFormattedNumber(minutes) * 60000\n : (this.sanitizeFormattedNumber(hours) * 3.6e6 +\n this.sanitizeFormattedNumber(minutes) * 60000) *\n -1;\n }\n\n public static sanitizeFormattedNumber(str: string): number {\n if (str.length === 2 && str.startsWith('0')) {\n return Tools.parseNumber(str[1]);\n }\n return Tools.parseNumber(str);\n }\n\n /**\n * Return true if `n` is (or can be parsed as) a float, but is NOT an integer\n *\n * @param {any} n\n * @return {number} a number (NaN is `n` cannot be parsed as a number)\n */\n public static parseNumber(n: unknown): number {\n // string: try to parse as number (allow ',' as decimal separator)\n if (typeof n === 'string') {\n // prevent the empty string to be parsed as 0\n if (n.trim() === '') {\n return Number.NaN;\n }\n\n n = +n.replace(',', '.').replace(' ', '');\n }\n\n // (the string could not be parsed) OR (it was neither string nor number)\n if (typeof n !== 'number') {\n return Number.NaN;\n }\n\n // false for NaN, +Infinity, -Infinity\n if (!isFinite(n)) {\n return Number.NaN;\n }\n\n return n;\n }\n\n /**\n * Return an Array without duplicated keys\n *\n * @param {Array<any>} arr\n * @param {string} key\n * @return {Array<any>}\n */\n public static uniqBy(arr: Array<any>, key?: string): Array<any> {\n const seen = new Set();\n if (key) {\n const result = [];\n for (let i = 0; i < arr.length; ++i) {\n if (arr[i] && arr[i][key] && !seen.has(arr[i][key])) {\n seen.add(arr[i][key]);\n result.push(arr[i]);\n } else if (!arr[i][key]) {\n result.push(arr[i]);\n }\n }\n return result;\n }\n return typeof arr[0] === 'object'\n ? Array.from(new Set(arr.map((v) => JSON.stringify(v)))).map((v) => JSON.parse(v))\n : Array.from(new Set(arr));\n }\n\n /**\n * Return 'image' or 'url' depending on the given string\n *\n * @param {string} value\n * @return {\"image\" | \"url\"}\n */\n public static getType(value: string): 'image' | 'url' | 'imageUrl' | undefined {\n if (Tools.isURLImage(value)) {\n return 'imageUrl';\n }\n\n if (Tools.isImage(value)) {\n return 'image';\n }\n\n if (Tools.isUrl(value)) {\n return 'url';\n }\n\n return undefined;\n }\n\n /**\n * Return true if the given string is an url that match the schema handled by LKE\n *\n * @param {string} value\n * @return {boolean}\n */\n private static isUrl(value: string): boolean {\n try {\n new URL(value);\n return true;\n } catch (e) {\n return false;\n }\n }\n\n /**\n * Return true if the given string is an image extension\n *\n * @param {string} value\n * @return {boolean}\n */\n private static isImage(value: string): boolean {\n return IMAGE_PATTERN.test(value);\n }\n\n /**\n * Return true if the given string is an url with an image extension\n *\n * @param {string} value\n * @return {boolean}\n */\n private static isURLImage(value: string): boolean {\n if (Tools.isUrl(value)) {\n const url = new URL(value);\n return Tools.isImage(url.pathname);\n }\n return false;\n }\n\n /**\n * Return true if a value is not undefined, not null and not an empty string\n */\n public static valueExists(value: LkProperty): boolean {\n return Tools.isDefined(value) && (typeof value !== 'string' || Tools.isStringFilled(value));\n }\n\n /**\n * Return true if `n` is (or can be parsed as) a number\n */\n public static isNumber(n: unknown): boolean {\n n = Tools.parseNumber(n);\n return Tools.isDefined(n) && n === n;\n }\n\n /**\n * return the correct property value\n */\n public static getPropertyValue(\n property: LkProperty,\n invalidAsString?: boolean,\n formattedDates?: boolean\n ): undefined | null | string | number | boolean | Array<string> {\n if (typeof property === 'object' && !Array.isArray(property)) {\n if (!('status' in property)) {\n if ((property.type === 'date' || property.type === 'datetime') && formattedDates) {\n return Tools.formatDate(property.value, property.type === 'datetime');\n } else if (property.type === 'date' || property.type === 'datetime') {\n return new Date(property.value).getTime();\n }\n } else if (invalidAsString) {\n return 'original' in property ? property.original : undefined;\n } else {\n return undefined;\n }\n }\n return property;\n }\n\n /**\n * Parse the given value and return a float number or NaN\n *\n * @param {any} n\n * @return {number}\n */\n public static parseFloat(n: unknown): number {\n return Tools.parseNumber(n);\n }\n\n /**\n * Format a currency value to string.\n *\n * eg: 4123 -> 4.123,00 $\n */\n public static formatCurrencyValue(value: number, options: ICurrencyOptions): string {\n const sign = value < 0 ? '- ' : '';\n switch (options.format) {\n case CurrencyFormat.SYMBOL_COMMAS_DOT:\n return `${sign}${\n options.symbol !== undefined ? options.symbol + ' ' : ''\n }${Tools.formatNumberToCurrency(value, ',', '.')}`;\n\n case CurrencyFormat.SYMBOL_COMMAS:\n return `${sign}${\n options.symbol !== undefined ? options.symbol + ' ' : ''\n }${Tools.formatNumberToCurrency(value, ',')}`;\n\n case CurrencyFormat.DOTS_COMMA_SYMBOL:\n return `${sign}${Tools.formatNumberToCurrency(value, '.', ',')}${\n options.symbol !== undefined ? ' ' + options.symbol : ''\n }`;\n\n case CurrencyFormat.DOTS_SYMBOL:\n return `${sign}${Tools.formatNumberToCurrency(value, '.')}${\n options.symbol !== undefined ? ' ' + options.symbol : ''\n }`;\n\n case CurrencyFormat.SPACES_COMMA_SYMBOL:\n return `${sign}${Tools.formatNumberToCurrency(value, ' ', ',')}${\n options.symbol !== undefined ? ' ' + options.symbol : ''\n }`;\n\n case CurrencyFormat.SPACES_SYMBOL:\n return `${sign}${Tools.formatNumberToCurrency(value, ' ')}${\n options.symbol !== undefined ? ' ' + options.symbol : ''\n }`;\n\n default:\n throw Error(`Cannot format property value ${value}, unknown format ${options.format}.`);\n }\n }\n\n private static formatNumberToCurrency(\n value: number,\n thousandSeparator: string,\n decimalSeparator?: string\n ): string {\n if (!Number.isFinite(value)) {\n return value.toString();\n }\n\n const [integerPart, fractionalPart] = decimalSeparator\n ? Math.abs(value).toFixed(2).split('.')\n : [Math.abs(value).toFixed(0), undefined];\n\n let i = -1;\n const formattedIntegerPart = integerPart\n .split('')\n .reverse()\n .map((digit) => {\n i++;\n return i > 0 && i % 3 === 0 ? digit + thousandSeparator : digit;\n })\n .reverse()\n .join('');\n\n return decimalSeparator\n ? formattedIntegerPart + decimalSeparator + fractionalPart\n : formattedIntegerPart;\n }\n}\n","'use strict';\n\nimport {\n GraphSchemaTypeWithAccess,\n ICaptionConfig,\n ItemFieldsCaptions,\n LkEdgeData,\n LkNodeData,\n LkProperty,\n PropertyType,\n PropertyTypeName,\n GraphSchemaPropertyWithAccess\n} from '@linkurious/rest-client';\n\nimport {CAPTION_HEURISTIC, Tools} from '../tools/tools';\n\nexport class Captions {\n /**\n * Return label for each node\n */\n public static getText(\n itemData: LkNodeData | LkEdgeData,\n schema: ItemFieldsCaptions,\n graphSchema?: GraphSchemaTypeWithAccess[]\n ): string | null {\n const types = 'categories' in itemData ? itemData.categories : [itemData.type];\n if (Captions.captionExist(types, schema)) {\n return 'categories' in itemData\n ? Captions.generateNodeCaption(itemData, schema, graphSchema) || null\n : Captions.generateEdgeCaption(itemData, schema, graphSchema) || null;\n }\n if (itemData.properties !== undefined) {\n const heuristicCaptionElement = CAPTION_HEURISTIC.find((value) => {\n return itemData.properties[value] !== undefined;\n });\n if (\n heuristicCaptionElement !== undefined &&\n Tools.isDefined(itemData.properties[heuristicCaptionElement])\n ) {\n return `${Tools.getValueFromLkProperty(\n itemData.properties[heuristicCaptionElement]\n )}`.trim();\n }\n }\n return null;\n }\n\n /**\n * Return a readable string from an LkProperty\n */\n private static getLabel(\n propertyValue: LkProperty,\n propertyType?: PropertyType | undefined\n ): string | null {\n if (typeof propertyValue === 'object' && 'type' in propertyValue) {\n if (!('original' in propertyValue) && !('value' in propertyValue)) {\n return null;\n }\n if ('original' in propertyValue) {\n return `${propertyValue.original}`;\n }\n if ('value' in propertyValue) {\n return Tools.formatDate(\n new Date(\n new Date(propertyValue.value).getTime() +\n Tools.timezoneToMilliseconds(propertyValue.timezone)\n ).toISOString()\n );\n }\n } else if (\n propertyType?.name === PropertyTypeName.NUMBER &&\n propertyType.options !== undefined\n ) {\n return Tools.formatCurrencyValue(propertyValue as number, propertyType.options);\n }\n return `${propertyValue}`.trim();\n }\n\n /**\n * Return true if caption configuration exists in schema\n */\n public static captionExist(itemTypes: Array<string>, schema: ItemFieldsCaptions): boolean {\n return itemTypes.some((type) => Tools.isDefined(schema[type]));\n }\n\n /**\n * Generate text from node data and captions schema\n */\n public static generateNodeCaption(\n itemData: LkNodeData,\n schema: {[key: string]: ICaptionConfig},\n graphSchema?: GraphSchemaTypeWithAccess[]\n ): string {\n const categories = itemData.categories;\n const caption: Array<string | null> = [];\n let captionProps: Array<string | null> = [];\n categories.forEach((category) => {\n if (schema[category] && schema[category].active) {\n if (schema[category].displayName) {\n caption.push(category);\n }\n captionProps = [...captionProps, ...schema[category].properties];\n }\n });\n Tools.uniqBy(captionProps).forEach((propertyKey) => {\n if (itemData.properties[propertyKey] !== undefined) {\n const propertyType = graphSchema\n ? Captions.getPropertyType(graphSchema, propertyKey, categories[0])\n : undefined;\n caption.push(this.getLabel(itemData.properties[propertyKey], propertyType));\n }\n });\n return caption\n .filter((c) => c !== null)\n .join(' - ')\n .trim();\n }\n\n public static getPropertyType(\n graphSchema: GraphSchemaTypeWithAccess[],\n propertyKey: string,\n itemType: string\n ): PropertyType | undefined {\n const typeGraphSchema = graphSchema.find((schemaType) => schemaType.itemType === itemType);\n const property = typeGraphSchema?.properties.find(\n (property) => property.propertyKey === propertyKey\n );\n return (property as unknown as GraphSchemaPropertyWithAccess)?.propertyType;\n }\n\n /**\n * Generate text from edge data and captions schema\n */\n public static generateEdgeCaption(\n itemData: LkEdgeData,\n schema: {[key: string]: ICaptionConfig},\n graphSchema?: GraphSchemaTypeWithAccess[]\n ): string {\n const type = itemData.type;\n const caption: Array<string | null> = [];\n let captionProps: Array<string | null> = [];\n if (schema[type] && schema[type].active) {\n if (schema[type].displayName) {\n caption.push(type);\n }\n captionProps = [...captionProps, ...schema[type].properties];\n Tools.uniqBy(captionProps).forEach((propertyKey) => {\n if (Tools.isDefined(itemData.properties[propertyKey])) {\n const propertyType = graphSchema\n ? Captions.getPropertyType(graphSchema, propertyKey, type)\n : undefined;\n caption.push(Captions.getLabel(itemData.properties[propertyKey], propertyType));\n }\n });\n return caption.join(' - ').trim();\n }\n return '';\n }\n}\n","(function() {\n var base64map\n = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/',\n\n crypt = {\n // Bit-wise rotation left\n rotl: function(n, b) {\n return (n << b) | (n >>> (32 - b));\n },\n\n // Bit-wise rotation right\n rotr: function(n, b) {\n return (n << (32 - b)) | (n >>> b);\n },\n\n // Swap big-endian to little-endian and vice versa\n endian: function(n) {\n // If number given, swap endian\n if (n.constructor == Number) {\n return crypt.rotl(n, 8) & 0x00FF00FF | crypt.rotl(n, 24) & 0xFF00FF00;\n }\n\n // Else, assume array and swap all items\n for (var i = 0; i < n.length; i++)\n n[i] = crypt.endian(n[i]);\n return n;\n },\n\n // Generate an array of any length of random bytes\n randomBytes: function(n) {\n for (var bytes = []; n > 0; n--)\n bytes.push(Math.floor(Math.random() * 256));\n return bytes;\n },\n\n // Convert a byte array to big-endian 32-bit words\n bytesToWords: function(bytes) {\n for (var words = [], i = 0, b = 0; i < bytes.length; i++, b += 8)\n words[b >>> 5] |= bytes[i] << (24 - b % 32);\n return words;\n },\n\n // Convert big-endian 32-bit words to a byte array\n wordsToBytes: function(words) {\n for (var bytes = [], b = 0; b < words.length * 32; b += 8)\n bytes.push((words[b >>> 5] >>> (24 - b % 32)) & 0xFF);\n return bytes;\n },\n\n // Convert a byte array to a hex string\n bytesToHex: function(bytes) {\n for (var hex = [], i = 0; i < bytes.length; i++) {\n hex.push((bytes[i] >>> 4).toString(16));\n hex.push((bytes[i] & 0xF).toString(16));\n }\n return hex.join('');\n },\n\n // Convert a hex string to a byte array\n hexToBytes: function(hex) {\n for (var bytes = [], c = 0; c < hex.length; c += 2)\n bytes.push(parseInt(hex.substr(c, 2), 16));\n return bytes;\n },\n\n // Convert a byte array to a base-64 string\n bytesToBase64: function(bytes) {\n for (var base64 = [], i = 0; i < bytes.length; i += 3) {\n var triplet = (bytes[i] << 16) | (bytes[i + 1] << 8) | bytes[i + 2];\n for (var j = 0; j < 4; j++)\n if (i * 8 + j * 6 <= bytes.length * 8)\n base64.push(base64map.charAt((triplet >>> 6 * (3 - j)) & 0x3F));\n else\n base64.push('=');\n }\n return base64.join('');\n },\n\n // Convert a base-64 string to a byte array\n base64ToBytes: function(base64) {\n // Remove non-base-64 characters\n base64 = base64.replace(/[^A-Z0-9+\\/]/ig, '');\n\n for (var bytes = [], i = 0, imod4 = 0; i < base64.length;\n imod4 = ++i % 4) {\n if (imod4 == 0) continue;\n bytes.push(((base64map.indexOf(base64.charAt(i - 1))\n & (Math.pow(2, -2 * imod4 + 8) - 1)) << (imod4 * 2))\n | (base64map.indexOf(base64.charAt(i)) >>> (6 - imod4 * 2)));\n }\n return bytes;\n }\n };\n\n module.exports = crypt;\n})();\n","var charenc = {\n // UTF-8 encoding\n utf8: {\n // Convert a string to a byte array\n stringToBytes: function(str) {\n return charenc.bin.stringToBytes(unescape(encodeURIComponent(str)));\n },\n\n // Convert a byte array to a string\n bytesToString: function(bytes) {\n return decodeURIComponent(escape(charenc.bin.bytesToString(bytes)));\n }\n },\n\n // Binary encoding\n bin: {\n // Convert a string to a byte array\n stringToBytes: function(str) {\n for (var bytes = [], i = 0; i < str.length; i++)\n bytes.push(str.charCodeAt(i) & 0xFF);\n return bytes;\n },\n\n // Convert a byte array to a string\n bytesToString: function(bytes) {\n for (var str = [], i = 0; i < bytes.length; i++)\n str.push(String.fromCharCode(bytes[i]));\n return str.join('');\n }\n }\n};\n\nmodule.exports = charenc;\n","(function() {\n var crypt = require('crypt'),\n utf8 = require('charenc').utf8,\n bin = require('charenc').bin,\n\n // The core\n sha1 = function (message) {\n // Convert to byte array\n if (message.constructor == String)\n message = utf8.stringToBytes(message);\n else if (typeof Buffer !== 'undefined' && typeof Buffer.isBuffer == 'function' && Buffer.isBuffer(message))\n message = Array.prototype.slice.call(message, 0);\n else if (!Array.isArray(message))\n message = message.toString();\n\n // otherwise assume byte array\n\n var m = crypt.bytesToWords(message),\n l = message.length * 8,\n w = [],\n H0 = 1732584193,\n H1 = -271733879,\n H2 = -1732584194,\n H3 = 271733878,\n H4 = -1009589776;\n\n // Padding\n m[l >> 5] |= 0x80 << (24 - l % 32);\n m[((l + 64 >>> 9) << 4) + 15] = l;\n\n for (var i = 0; i < m.length; i += 16) {\n var a = H0,\n b = H1,\n c = H2,\n d = H3,\n e = H4;\n\n for (var j = 0; j < 80; j++) {\n\n if (j < 16)\n w[j] = m[i + j];\n else {\n var n = w[j - 3] ^ w[j - 8] ^ w[j - 14] ^ w[j - 16];\n w[j] = (n << 1) | (n >>> 31);\n }\n\n var t = ((H0 << 5) | (H0 >>> 27)) + H4 + (w[j] >>> 0) + (\n j < 20 ? (H1 & H2 | ~H1 & H3) + 1518500249 :\n j < 40 ? (H1 ^ H2 ^ H3) + 1859775393 :\n j < 60 ? (H1 & H2 | H1 & H3 | H2 & H3) - 1894007588 :\n (H1 ^ H2 ^ H3) - 899497514);\n\n H4 = H3;\n H3 = H2;\n H2 = (H1 << 30) | (H1 >>> 2);\n H1 = H0;\n H0 = t;\n }\n\n H0 += a;\n H1 += b;\n H2 += c;\n H3 += d;\n H4 += e;\n }\n\n return [H0, H1, H2, H3, H4];\n },\n\n // Public API\n api = function (message, options) {\n var digestbytes = crypt.wordsToBytes(sha1(message));\n return options && options.asBytes ? digestbytes :\n options && options.asString ? bin.bytesToString(digestbytes) :\n crypt.bytesToHex(digestbytes);\n };\n\n api._blocksize = 16;\n api._digestsize = 20;\n\n module.exports = api;\n})();\n","'use strict';\n\nimport sha1 from 'sha1';\nimport {Color} from '@linkurious/ogma';\nimport {IEdgeStyle, INodeStyle, IStyleAutoRange} from '@linkurious/rest-client';\n\nimport {Tools} from '../tools/tools';\n\nimport {StyleRule} from './styleRule';\nimport {NodeSizeExtrema} from './nodeAttributes';\nimport {EdgeWidthExtrema} from './edgeAttributes';\n\nexport const BASE_GREY = '#7f7f7f';\nexport const PALETTE = [\n '#9467bd',\n '#e377c2',\n '#1f77b4',\n '#17becf',\n '#2ca02c',\n '#bcbd22',\n '#d62728',\n '#ff7f0e',\n '#8c564b',\n '#c5b0d5',\n '#f7b6d2',\n '#aec7e8',\n '#9edae5',\n '#98df8a',\n '#dbdb8d',\n '#ff9896',\n '#ffbb78',\n '#c49c94'\n];\n\nexport class ItemAttributes<T extends INodeStyle | IEdgeStyle> {\n protected colorsCache: Map<string, Color | Array<Color>> = new Map();\n protected _rulesMap: {\n color?: Array<StyleRule<T>>;\n icon?: Array<StyleRule<T>>;\n image?: Array<StyleRule<T>>;\n shape?: Array<StyleRule<T>>;\n size?: Array<StyleRule<T>>;\n width?: Array<StyleRule<T>>;\n } = {};\n\n constructor(rulesMap: {\n color?: Array<StyleRule<T>>;\n icon?: Array<StyleRule<T>>;\n image?: Array<StyleRule<T>>;\n shape?: Array<StyleRule<T>>;\n size?: Array<StyleRule<T>>;\n width?: Array<StyleRule<T>>;\n }) {\n this.refresh(rulesMap);\n }\n\n /**\n * Refresh the rules\n */\n public refresh(rulesMap: {\n color?: Array<StyleRule<T>>;\n icon?: Array<StyleRule<T>>;\n image?: Array<StyleRule<T>>;\n shape?: Array<StyleRule<T>>;\n size?: Array<StyleRule<T>>;\n width?: Array<StyleRule<T>>;\n }): void {\n if (rulesMap.color !== undefined) {\n this.colorsCache = new Map();\n }\n this._rulesMap = {\n color: rulesMap.color ? [...rulesMap.color].reverse() : this._rulesMap.color,\n icon: rulesMap.icon ? [...rulesMap.icon].reverse() : this._rulesMap.icon,\n image: rulesMap.image ? [...rulesMap.image].reverse() : this._rulesMap.image,\n shape: rulesMap.shape ? [...rulesMap.shape].reverse() : this._rulesMap.shape,\n size: rulesMap.size ? [...rulesMap.size].reverse() : this._rulesMap.size,\n width: rulesMap.width ? [...rulesMap.width].reverse() : this._rulesMap.width\n };\n }\n\n /**\n * Return the color for a node when style color is auto\n */\n public static autoColor(value: string | undefined, ignoreCase?: boolean): string {\n if (!Tools.isDefined(value)) {\n return BASE_GREY;\n }\n return PALETTE[\n ItemAttributes.getRandomUniqueColorPaletteIndex(value, PALETTE.length, ignoreCase)\n ];\n }\n\n /**\n * Return a number from 0 to number of occurrence in a palette based on a property\n */\n private static getRandomUniqueColorPaletteIndex(\n input: string,\n modulo: number,\n ignoreCase: boolean | undefined\n ): number {\n if (ignoreCase) {\n input = input.toLowerCase();\n }\n return +('0x' + sha1(input).substr(-4)) % modulo;\n }\n\n /**\n * Get color of a type\n */\n public static getTypeColor(\n rule: StyleRule<IEdgeStyle | INodeStyle>,\n type: string\n ): string | undefined | null {\n if (typeof rule.style.color === 'object' && rule.style.color.input[0] !== 'properties') {\n return ItemAttributes.autoColor(type, rule.style.color.ignoreCase);\n }\n if (!Tools.isDefined(rule.input) && typeof rule.style.color !== 'object') {\n return rule.style.color;\n }\n return null;\n }\n\n /**\n * return the corresponding size to the value with a linear function\n * @param value\n * @param lower\n * @param higher\n * @param extrema\n */\n public static getAutomaticRangeStyleLinear(\n value: number,\n {max, min}: IStyleAutoRange,\n lower: EdgeWidthExtrema | NodeSizeExtrema,\n higher: EdgeWidthExtrema | NodeSizeExtrema\n ): string | undefined {\n if (max !== undefined && min !== undefined) {\n // apply default style when min equal max\n if (max === min || isNaN(value)) {\n return '100%';\n }\n\n // calculate the linear function f(x) = ax + b\n const a = (higher - lower) / (max - min);\n const b = (lower * max - higher * min) / (max - min);\n const size = Math.floor(value * a + b);\n\n return `${size}%`;\n }\n }\n\n /**\n * return the corresponding size to the value with a logarithmic function\n * @param value\n * @param lower\n * @param higher\n * @param extrema\n */\n public static getAutomaticRangeStyleLog(\n value: number,\n {max, min}: IStyleAutoRange,\n lower: EdgeWidthExtrema | NodeSizeExtrema,\n higher: EdgeWidthExtrema | NodeSizeExtrema\n ): string | undefined {\n if (min !== undefined && max !== undefined) {\n // apply default style when min equal max\n if (max === min || isNaN(value)) {\n return '100%';\n }\n // apply an offset for all the values (including min and max)\n if (min < 1) {\n value += Math.abs(min) + 1;\n max += Math.abs(min) + 1;\n min += Math.abs(min) + 1;\n }\n // calculate the logarithmic function f(x) = Math.floor(a*log(x) + b)\n const a = (higher - lower) / (Math.log(max) - Math.log(min));\n const b = (lower * Math.log(max) - higher * Math.log(min)) / (Math.log(max) - Math.log(min));\n const size = Math.floor(a * Math.log(value) + b);\n\n return `${size}%`;\n }\n }\n\n public isAutoRange(value: string | number | IStyleAutoRange): value is IStyleAutoRange {\n return typeof value === 'object' && value?.type === 'autoRange';\n }\n}\n","'use strict';\nimport {Color} from '@linkurious/ogma';\nimport {\n AutoRangeScale,\n IEdgeStyle,\n LkEdgeData,\n OgmaEdgeShape,\n IStyleAutoRange\n} from '@linkurious/rest-client';\n\nimport {Tools} from '../tools/tools';\n\nimport {StyleRule} from './styleRule';\nimport {BASE_GREY, ItemAttributes} from './itemAttributes';\n\nexport enum EdgeWidthExtrema {\n MIN = 50,\n MAX = 200\n}\n\nexport class EdgeAttributes extends ItemAttributes<IEdgeStyle> {\n constructor(rulesMap: {\n color?: Array<StyleRule<IEdgeStyle>>;\n shape?: Array<StyleRule<IEdgeStyle>>;\n width?: Array<StyleRule<IEdgeStyle>>;\n }) {\n super(rulesMap);\n }\n\n /**\n * Return rule that can be applied to the data\n */\n private static matchStyle(\n styleRules: Array<StyleRule<IEdgeStyle>>,\n data: LkEdgeData\n ): StyleRule<IEdgeStyle> | undefined {\n if (data === undefined) {\n return;\n }\n for (let i = 0; i < styleRules.length; ++i) {\n if (styleRules[i].canApplyTo(data)) {\n return styleRules[i];\n }\n }\n }\n\n /**\n * Generate color for a given edge (call only if _rulesMap.color exists)\n */\n public color(data: LkEdgeData): Color {\n if (!Tools.isDefined(data)) {\n return BASE_GREY;\n }\n let color;\n for (let j = 0; j < this._rulesMap.color!.length; ++j) {\n const rule = this._rulesMap.color![j];\n if (rule.canApplyTo(data)) {\n if (typeof rule.style.color === 'string') {\n color = rule.style.color;\n } else if (typeof rule.style.color === 'object') {\n const propValue = Tools.getIn(data, rule.style.color.input);\n color = ItemAttributes.autoColor(`${propValue}`, rule.style.color.ignoreCase);\n }\n break;\n }\n }\n return Tools.isDefined(color) ? color : BASE_GREY;\n }\n\n /**\n * Generate shape for a given node\n */\n public shape(data: LkEdgeData): OgmaEdgeShape | undefined {\n if (this._rulesMap.shape !== undefined) {\n return EdgeAttributes.matchStyle(this._rulesMap.shape, data)?.style.shape;\n }\n }\n\n /**\n * Generate size for a given node\n */\n public width(data: LkEdgeData): string | number | undefined {\n if (this._rulesMap.width !== undefined) {\n const styleRule = EdgeAttributes.matchStyle(this._rulesMap.width, data);\n if (styleRule !== undefined) {\n const widthStyle = styleRule?.style.width;\n if (widthStyle !== undefined && this.isAutoRange(widthStyle)) {\n if (\n widthStyle.input !== undefined &&\n widthStyle.max !== undefined &&\n widthStyle.min !== undefined\n ) {\n const propertyName: string = widthStyle.input[1];\n const propertyValue = Tools.parseNumber(data.properties[propertyName]);\n const isLog = widthStyle.scale && widthStyle.scale === AutoRangeScale.LOGARITHMIC;\n return EdgeAttributes.getAutomaticRangeWidth(propertyValue, styleRule, isLog);\n }\n } else {\n return widthStyle;\n }\n }\n }\n }\n\n /**\n * return the corresponding width to the value\n * @param value\n * @param rule\n * @param isLog\n */\n public static getAutomaticRangeWidth(\n value: number,\n rule: StyleRule<IEdgeStyle>,\n isLog = false\n ): string | undefined {\n return isLog\n ? this.getAutomaticRangeStyleLog(\n value,\n rule.style.width as IStyleAutoRange,\n EdgeWidthExtrema.MIN,\n EdgeWidthExtrema.MAX\n )\n : this.getAutomaticRangeStyleLinear(\n value,\n rule.style.width as IStyleAutoRange,\n EdgeWidthExtrema.MIN,\n EdgeWidthExtrema.MAX\n );\n }\n\n /**\n * Return an object containing all node attributes needed by Ogma to style a node\n */\n public all(data: LkEdgeData): {\n color: Color;\n shape: OgmaEdgeShape | undefined;\n width: string | undefined | number;\n } {\n if (!Tools.isDefined(data)) {\n return {\n color: BASE_GREY,\n shape: OgmaEdgeShape.ARROW,\n width: '100%'\n };\n }\n return {\n color: this.color(data),\n shape: this.shape(data),\n width: this.width(data)\n };\n }\n}\n","'use strict';\nimport {Color} from '@linkurious/ogma';\nimport {\n AutoRangeScale,\n IImageDataValue,\n INodeStyle,\n IStyleAutoRange,\n IStyleIcon,\n IStyleImage,\n LkNodeData,\n OgmaNodeShape\n} from '@linkurious/rest-client';\nimport sha1 from 'sha1';\n\nimport {Tools} from '../tools/tools';\nimport {OgmaTools} from '..';\n\nimport {StyleRule} from './styleRule';\nimport {BASE_GREY, ItemAttributes} from './itemAttributes';\n\nexport interface OgmaImage extends IStyleImage {\n url?: string;\n}\n\nexport enum NodeSizeExtrema {\n MIN = 50,\n MAX = 500\n}\n\nexport class NodeAttributes extends ItemAttributes<INodeStyle> {\n // Base url, used for image urls\n private _baseUrl?: string;\n\n constructor(rulesMap: {\n color?: Array<StyleRule<INodeStyle>>;\n icon?: Array<StyleRule<INodeStyle>>;\n image?: Array<StyleRule<INodeStyle>>;\n shape?: Array<StyleRule<INodeStyle>>;\n size?: Array<StyleRule<INodeStyle>>;\n }) {\n super(rulesMap);\n }\n\n /**\n * Run the callback if an item match with a style in the array of rules\n */\n private static matchStyle(\n styleRules: Array<StyleRule<INodeStyle>>,\n itemData: LkNodeData,\n callback: (style: StyleRule<INodeStyle>) => unknown\n ): void {\n if (!Tools.isDefined(itemData)) {\n return;\n }\n if (!Tools.isDefined(styleRules)) {\n return;\n }\n for (let i = 0; i < styleRules.length; ++i) {\n if (styleRules[i].canApplyTo(itemData)) {\n callback(styleRules[i]);\n break;\n }\n }\n }\n\n /**\n * Generate color for a given node (call only if _rulesMap.color is defined\n */\n public color(itemData: LkNodeData): Color | Array<Color> {\n if (!Tools.isDefined(itemData)) {\n return [BASE_GREY];\n }\n const hash = sha1(JSON.stringify(itemData));\n const cachedColor = this.colorsCache.get(hash);\n if (cachedColor !== undefined) {\n return cachedColor;\n }\n let colors: Array<string | null> = [];\n for (let i = 0; i < itemData.categories.length; ++i) {\n let color = null;\n for (let j = 0; j < this._rulesMap.color!.length; ++j) {\n const rule = this._rulesMap.color![j];\n if (\n rule.itemType !== undefined &&\n rule.itemType !== null &&\n rule.itemType !== itemData.categories[i]\n ) {\n continue;\n }\n if (rule.canApplyTo(itemData)) {\n if (typeof rule.style.color === 'object') {\n const propValue = Tools.getIn(itemData, rule.style.color.input);\n if (Array.isArray(propValue)) {\n color = ItemAttributes.autoColor(itemData.categories[i], rule.style.color.ignoreCase);\n } else {\n color = ItemAttributes.autoColor(`${propValue}`, rule.style.color.ignoreCase);\n }\n } else {\n color = rule.style.color as string;\n }\n break;\n }\n }\n colors.push(color);\n }\n colors = colors.filter((c) => Tools.isDefined(c));\n if (colors.length === 0) {\n colors = [BASE_GREY];\n }\n const finalColor = colors.length === 1 ? colors[0] : colors;\n this.colorsCache.set(hash, finalColor);\n return finalColor;\n }\n\n /**\n * Generate icon for a given node\n */\n public icon(itemData: LkNodeData): {\n icon?: IStyleIcon;\n image?: OgmaImage | null;\n } {\n const rawColors = this.color(itemData);\n const color = Array.isArray(rawColors) ? rawColors[0] : rawColors;\n let result = {};\n const rules = [...(this._rulesMap.image || []), ...(this._rulesMap.icon || [])];\n if (!Tools.isDefined(itemData)) {\n return {\n icon: {},\n image: {}\n };\n }\n for (let i = 0; i < rules.length; ++i) {\n if (rules[i].canApplyTo(itemData)) {\n const style = rules[i].style;\n if ('icon' in style && typeof style.icon === 'object') {\n result = {\n icon: {\n content: style.icon?.content as string,\n font: style.icon?.font,\n scale: 0.5,\n color: OgmaTools.isBright(color) ? '#000000' : '#FFFFFF'\n }\n };\n } else if ('image' in style && typeof style.image === 'object') {\n const imageUrlValue = NodeAttributes.getImageUrlFromStyleRule(\n style.image.url,\n itemData,\n this._baseUrl\n );\n if (imageUrlValue !== undefined) {\n result = {\n image: {\n url: imageUrlValue,\n scale: style.image.scale,\n fit: style.image.fit,\n tile: style.image.tile,\n minVisibleSize: 0\n }\n };\n }\n }\n break;\n }\n }\n\n return result;\n }\n\n /**\n * Generate shape for a given node\n */\n public shape(itemData: LkNodeData): OgmaNodeShape | undefined {\n let result = undefined;\n if (this._rulesMap.shape !== undefined) {\n NodeAttributes.matchStyle(this._rulesMap.shape, itemData, (styleRule) => {\n result = styleRule.style.shape;\n });\n }\n return result;\n }\n\n /**\n * Generate size for a given node\n */\n public size(itemData: LkNodeData): number | undefined {\n let result = undefined;\n if (this._rulesMap.size !== undefined) {\n NodeAttributes.matchStyle(\n this._rulesMap.size,\n itemData,\n (styleRule: StyleRule<INodeStyle>) => {\n const sizeStyle = styleRule.style.size as string | number | IStyleAutoRange;\n if (this.isAutoRange(sizeStyle)) {\n if (\n sizeStyle.input !== undefined &&\n sizeStyle.max !== undefined &&\n sizeStyle.min !== undefined\n ) {\n const propertyName: string = sizeStyle.input[1];\n const propertyValue = Tools.parseNumber(itemData.properties[propertyName]);\n const isLog = sizeStyle.scale && sizeStyle.scale === AutoRangeScale.LOGARITHMIC;\n result = NodeAttributes.getAutomaticRangeSize(propertyValue, styleRule, isLog);\n }\n } else {\n result = sizeStyle;\n }\n }\n );\n }\n return result;\n }\n\n /**\n * return the corresponding size to the value\n * @param value\n * @param rule\n * @param isLog\n */\n public static getAutomaticRangeSize(\n value: number,\n rule: StyleRule<INodeStyle>,\n isLog = false\n ): string | undefined {\n return isLog\n ? this.getAutomaticRangeStyleLog(\n value,\n rule.style.size as IStyleAutoRange,\n NodeSizeExtrema.MIN,\n NodeSizeExtrema.MAX\n )\n : this.getAutomaticRangeStyleLinear(\n value,\n rule.style.size as IStyleAutoRange,\n NodeSizeExtrema.MIN,\n NodeSizeExtrema.MAX\n );\n }\n\n /**\n * Return an object containing all node attributes needed by Ogma to style a node\n */\n public all(itemData: LkNodeData): {\n radius?: number | undefined;\n color: Color | Array<Color>;\n shape?: OgmaNodeShape | undefined;\n icon?: IStyleIcon;\n image?: IStyleImage | null;\n } {\n if (!Tools.isDefined(itemData)) {\n return {\n color: BASE_GREY\n };\n }\n const generatedIcon = this.icon(itemData);\n return {\n radius: this.size(itemData),\n color: this.color(itemData),\n shape: this.shape(itemData),\n icon: generatedIcon.icon,\n image: generatedIcon.image\n };\n }\n\n /**\n * Return the value of the image url from a style rule or undefined\n * @param value\n * @param itemData\n * @param baseUrl\n */\n public static getImageUrlFromStyleRule(\n value: string | IImageDataValue | undefined,\n itemData: LkNodeData,\n baseUrl?: string\n ): string | undefined {\n let imageUrl: string | undefined;\n if (typeof value === 'string' && ['imageUrl', 'image'].includes(Tools.getType(value)!)) {\n imageUrl = value;\n } else if (typeof value === 'object') {\n imageUrl = Tools.getIn(itemData, value.path);\n }\n\n // if base url is defined, we need to create a new URL to get the absolute path\n if (imageUrl !== undefined && baseUrl !== undefined) {\n return new URL(imageUrl, baseUrl).href;\n }\n return imageUrl;\n }\n\n /**\n * Set the base url (it will be used for image url while styling nodes)\n * @param baseUrl bse url\n */\n public setBaseUrl(baseUrl?: string): void {\n this._baseUrl = baseUrl;\n }\n}\n","'use strict';\n\nimport {\n IEdgeStyle,\n IStyleRule,\n LkEdgeData,\n LkNodeData,\n INodeStyle,\n IRangeValues,\n SelectorType,\n IStyleAutoRange\n} from '@linkurious/rest-client';\n\nimport {ItemAttributes} from '..';\nimport {Tools} from '../tools/tools';\n\nexport enum StyleRuleType {\n AUTO_RANGE = 'autoRange'\n}\n\nexport class StyleRule<T extends INodeStyle | IEdgeStyle = INodeStyle | IEdgeStyle>\n implements IStyleRule<T>\n{\n public type: SelectorType;\n public input: string[] | undefined;\n public index: number;\n public style: T;\n public itemType?: string;\n public value: IRangeValues | number | string | boolean;\n\n constructor(model: IStyleRule<T>) {\n this.type = model.type;\n this.input = model.input;\n this.index = model.index;\n this.itemType = model.itemType;\n this.style = model.style;\n // cast to remove undefined from type\n this.value = model.value as IRangeValues | number | string | boolean;\n }\n\n public static isAutomaticRange(rule: IStyleRule<IEdgeStyle | INodeStyle>): boolean {\n return (\n rule.style !== undefined &&\n (((rule.style as IEdgeStyle).width !== undefined &&\n ((rule.style as IEdgeStyle).width as IStyleAutoRange).type === StyleRuleType.AUTO_RANGE) ||\n ((rule.style as INodeStyle).size !== undefined &&\n ((rule.style as INodeStyle).size as IStyleAutoRange).type === StyleRuleType.AUTO_RANGE))\n );\n }\n\n /**\n * Return an int describing specificity of the style. 4 = very specific / 1 = not specific\n *\n * @return {number}\n */\n get specificity(): 1 | 2 | 3 | 4 {\n if (this.itemType !== undefined && this.input !== undefined) {\n return 4;\n }\n if (this.itemType === undefined && this.input !== undefined) {\n return 3;\n }\n if (this.itemType !== undefined && this.input === undefined) {\n return 2;\n }\n return 1;\n }\n\n /**\n * Return true if this style match values\n */\n public matchValues(\n itemType: string | undefined,\n input: Array<string> | undefined,\n value: string | undefined\n ): boolean {\n if (Tools.isDefined(input)) {\n return (\n ((itemType === this.itemType || !Tools.isDefined(this.itemType)) &&\n Tools.isEqual(['properties', ...input], this.input) &&\n Tools.isEqual(value, this.value)) ||\n (this.type === 'any' &&\n !Tools.isDefined(this.input) &&\n typeof this.style.color === 'object' &&\n this.style.color.input[1] === input[0])\n );\n }\n\n if (Tools.isDefined(this.itemType)) {\n return itemType === this.itemType && !Tools.isDefined(this.input);\n }\n\n return !Tools.isDefined(this.input);\n }\n\n public static inputExists(\n type: SelectorType,\n input: Array<string> | undefined\n ): input is Array<string> {\n return type !== SelectorType.ANY;\n }\n\n /**\n * Return true if a style can apply to a node\n */\n public canApplyTo(data: LkNodeData | LkEdgeData): boolean {\n const types = 'categories' in data ? data.categories : [data.type];\n let typePredicate = false;\n switch (this.type) {\n case SelectorType.ANY:\n typePredicate = StyleRule.checkAny(data, this.style);\n break;\n\n case SelectorType.NO_VALUE:\n if (StyleRule.inputExists(this.type, this.input)) {\n typePredicate = StyleRule.checkNoValue(data, this.input);\n }\n break;\n\n case SelectorType.NAN:\n if (StyleRule.inputExists(this.type, this.input)) {\n typePredicate = StyleRule.checkNan(data, this.input);\n }\n break;\n\n case SelectorType.RANGE:\n if (StyleRule.inputExists(this.type, this.input)) {\n typePredicate = StyleRule.checkRange(\n Tools.getIn(data, this.input),\n this.value as IRangeValues\n );\n }\n break;\n\n case SelectorType.IS:\n if (StyleRule.inputExists(this.type, this.input)) {\n typePredicate = StyleRule.checkIs(data, this.input, this.value);\n }\n break;\n }\n return typePredicate && StyleRule.checkItemType(types, this.itemType);\n }\n\n /**\n * Return true or false on rule type 'any' if the current node match the rule\n */\n public static checkAny(data: LkNodeData | LkEdgeData, style: INodeStyle | IEdgeStyle): boolean {\n // return true if autoColor by a property and this property exists in node\n if (typeof style.color === 'object') {\n return Tools.isDefined(Tools.getIn(data, style.color.input));\n }\n return true;\n }\n\n /**\n * Return true or false on rule type 'noValue' if the current node match the rule\n */\n public static checkNoValue(data: LkNodeData | LkEdgeData, input: Array<string>): boolean {\n return !Tools.valueExists(Tools.getIn(data, input));\n }\n\n /**\n * Return true or false on rule type 'NaN' if the current node match the rule\n */\n public static checkNan(data: LkNodeData | LkEdgeData, input: Array<string>): boolean {\n return !Tools.isNumber(Tools.getIn(data, input));\n }\n\n /**\n * Return true if predicate is true for the node value\n *\n * @param value\n * @param comparator\n * @return {boolean}\n */\n public static checkRange(\n value: number,\n comparator: {[key in '<=' | '<' | '>' | '>=']?: number}\n ): boolean {\n return (\n (comparator['<='] === undefined || value <= comparator['<=']) &&\n (comparator['<'] === undefined || value < comparator['<']) &&\n (comparator['>'] === undefined || value > comparator['>']) &&\n (comparator['>='] === undefined || value >= comparator['>='])\n );\n }\n\n /**\n * Return true or false on rule type 'is' if the current node match the rule\n */\n public static checkIs(\n data: LkNodeData | LkEdgeData,\n input: Array<string>,\n value: IRangeValues | number | string | boolean\n ): boolean {\n if (!Tools.isDefined(input)) {\n return false;\n }\n const itemValue = Tools.getIn(data, input);\n let formattedValue = itemValue;\n if (\n Tools.isDefined(itemValue) &&\n typeof itemValue === 'object' &&\n (itemValue.type === 'date' || itemValue.type === 'datetime')\n ) {\n let timezone = itemValue.timezone;\n if (itemValue.timezone === 'Z') {\n timezone = '+00:00';\n }\n formattedValue = Tools.formatDate(\n itemValue.value,\n itemValue.type === 'datetime',\n Tools.timezoneToMilliseconds(timezone) / 1000\n );\n }\n return Tools.isEqual(formattedValue, value);\n }\n\n /**\n * Check that value of itemType match for the node\n */\n public static checkItemType(types: Array<string>, itemType: string | undefined): boolean {\n return StyleRule.matchCategory(types, itemType) || StyleRule.matchAny(itemType);\n }\n\n /**\n * Return true if itemType is defined and category exists in an array of categories\n *\n * @param {Array<string> | string} types\n * @param {string} itemType\n * @return {boolean}\n */\n public static matchCategory(\n types: Array<string> | string,\n itemType: string | undefined\n ): boolean {\n return (\n Tools.isDefined(itemType) &&\n (Array.isArray(types) ? types.includes(itemType) : Tools.isEqual(types, itemType))\n );\n }\n\n /**\n * Return true if itemType is undefined\n *\n * @param {string} itemType\n * @return {boolean}\n */\n public static matchAny(itemType: string | null | undefined): boolean {\n return itemType === undefined;\n }\n\n /**\n * Return the color for a type\n */\n public getTypeColor(type: string): string | undefined | null {\n let color;\n if (\n StyleRule.checkItemType([type], this.itemType) &&\n this.type === SelectorType.ANY &&\n !Tools.isDefined(this.input)\n ) {\n color = ItemAttributes.getTypeColor(this, type);\n }\n return color;\n }\n}\n","'use strict';\n\nimport {\n IEdgeStyle,\n IStyleRule,\n LkEdgeData,\n LkNodeData,\n INodeStyle,\n SelectorType,\n IStyleIcon,\n IStyleImage,\n IStyles,\n IStyleColor,\n IRangeValues\n} from '@linkurious/rest-client';\n\nimport {sortBy, Tools} from '../tools/tools';\n\nimport {StyleRule} from './styleRule';\nimport {BASE_GREY, ItemAttributes} from './itemAttributes';\n\nexport enum StyleType {\n COLOR = 'color',\n ICON = 'icon',\n SIZE = 'size',\n IMAGE = 'image',\n SHAPE = 'shape',\n WIDTH = 'width'\n}\n\nexport interface Legend {\n [key: string]: Array<{label: string; value: string | IStyleIcon | IStyleImage | number}>;\n}\n\nexport const SORTING_RULE = ['specificity', 'itemType', 'index'];\n\nexport class StyleRules {\n private _rules: Array<IStyleRule<INodeStyle | IEdgeStyle>>;\n\n constructor(rules: Array<IStyleRule<INodeStyle | IEdgeStyle>>) {\n this._rules = rules;\n }\n\n /**\n * Return an array of StyleRule with only 'color' rules and sorted by specificity, itemType and index\n *\n * @return {Array<StyleRule>}\n */\n public get color(): Array<StyleRule> {\n return sortBy(StyleRules.getBy(StyleType.COLOR, this._rules), SORTING_RULE);\n }\n\n /**\n * Return an array of StyleRule with only 'icon' rules and sorted by specificity, itemType and index\n *\n * @return {Array<StyleRule>}\n */\n public get icon(): Array<StyleRule> {\n return sortBy(\n [\n ...(StyleRules.getBy(StyleType.ICON, this._rules) || []),\n ...(StyleRules.getBy(StyleType.IMAGE, this._rules) || [])\n ],\n SORTING_RULE\n );\n }\n\n /**\n * Return an array of StyleRule with only 'image' rules and sorted by specificity, itemType and index\n *\n * @return {Array<StyleRule>}\n */\n public get image(): Array<StyleRule> {\n return sortBy(StyleRules.getBy(StyleType.IMAGE, this._rules), SORTING_RULE);\n }\n\n /**\n * Return an array of StyleRule with only 'shape' rules and sorted by specificity, itemType and index\n *\n * @return {Array<StyleRule>}\n */\n public get shape(): Array<StyleRule> {\n return sortBy(StyleRules.getBy(StyleType.SHAPE, this._rules), SORTING_RULE);\n }\n\n /**\n * Return an array of StyleRule with only 'size' rules and sorted by specificity, itemType and index\n *\n * @return {Array<StyleRule>}\n */\n public get size(): Array<StyleRule> {\n return sortBy(StyleRules.getBy(StyleType.SIZE, this._rules), SORTING_RULE);\n }\n\n /**\n * Return an array of StyleRule with only 'width' rules and sorted by specificity, itemType and index\n *\n * @return {Array<StyleRule>}\n */\n public get width(): Array<StyleRule> {\n return sortBy(StyleRules.getBy(StyleType.WIDTH, this._rules), SORTING_RULE);\n }\n\n /**\n * Return an object containing for each node style a sorted array of StyleRule\n *\n * @return {{[key: string]: Array<StyleRule>} }\n */\n public get nodeRules(): {[key: string]: Array<StyleRule>} {\n return {\n color: this.color,\n icon: this.icon,\n image: this.image,\n shape: this.shape,\n size: this.size\n };\n }\n\n /**\n * Return an object containing for each edge style a sorted array of StyleRule\n *\n * @return { {[key: string]: Array<StyleRule>}}\n */\n public get edgeRules(): {[key: string]: Array<StyleRule>} {\n return {\n color: this.color,\n shape: this.shape,\n width: this.width\n };\n }\n\n /**\n * Generate a legend with an array of style rules and existing items in visualization\n */\n public generateLegend(itemsData: Array<LkNodeData | LkEdgeData>): Legend {\n const result: Legend = {};\n if (itemsData.length === 0) {\n return result;\n }\n\n if ('categories' in itemsData[0]) {\n Object.keys(this.nodeRules).forEach((style: string) => {\n result[style] = StyleRules.getLegendForStyle(\n style as StyleType,\n this.nodeRules[style],\n itemsData\n );\n });\n } else {\n Object.keys(this.edgeRules).forEach((style: string) => {\n result[style] = StyleRules.getLegendForStyle(\n style as StyleType,\n this.edgeRules[style],\n itemsData\n );\n });\n }\n return result;\n }\n\n /**\n * Return the legend for a specific style type (color, icon, image...)\n */\n public static getLegendForStyle(\n styleType: StyleType,\n styles: Array<StyleRule>,\n itemsData: Array<LkNodeData | LkEdgeData>\n ): Array<{label: string; value: string | number | IStyleIcon | IStyleImage}> {\n const result: Array<{label: string; value: string | number | IStyleIcon | IStyleImage}> = [];\n const data = itemsData.filter((i) => i);\n for (let i = 0; i < styles.length; i++) {\n const styleRule = new StyleRule(styles[i]);\n const ruleExistsInViz = data.some((itemData) => {\n return styleRule.canApplyTo(itemData);\n });\n if (ruleExistsInViz) {\n if (styleType === StyleType.COLOR && typeof styleRule.style.color === 'object') {\n StyleRules.addLegendAutoColors(data, styleRule, result);\n } else if (styleType === StyleType.ICON && 'image' in styleRule.style) {\n // style is a custom icon\n const label = Tools.isDefined(styleRule.input)\n ? `${StyleRules.getTypeLabel(styleRule.itemType)}.${\n styleRule.input[1]\n } ${StyleRules.sanitizeValue(styleRule.type, styleRule.value)}`\n : `${StyleRules.getTypeLabel(styleRule.itemType)}`;\n const imageStyle = styleRule.style.image as IStyleImage;\n if (\n imageStyle.url &&\n typeof imageStyle.url === 'object' &&\n imageStyle.url.type === 'data'\n ) {\n // If the custom icon is read from a node property-value dynamically, then we\n // skip it from the legend, because it could be a different image for each node,\n // thus bloating the legend.\n } else {\n const value = styleRule.style.image;\n StyleRules.updateLegend(result, {label: label, value: value as string});\n }\n } else {\n const label = Tools.isDefined(styleRule.input)\n ? `${StyleRules.getTypeLabel(styleRule.itemType)}.${\n styleRule.input[1]\n } ${StyleRules.sanitizeValue(styleRule.type, styleRule.value)}`\n : `${StyleRules.getTypeLabel(styleRule.itemType)}`;\n const value =\n styleType === StyleType.WIDTH\n ? (styleRule.style as IEdgeStyle)[styleType]\n : (styleRule.style as INodeStyle)[styleType];\n StyleRules.updateLegend(result, {label: label, value: value as string});\n }\n }\n }\n\n return result;\n }\n\n /**\n * Sanitize value for legend\n */\n public static sanitizeValue(\n styleType: SelectorType,\n value: IRangeValues | number | string | boolean\n ): string {\n let template = '';\n switch (styleType) {\n case SelectorType.NO_VALUE:\n return 'is undefined';\n\n case SelectorType.NAN:\n return 'is not an number';\n\n case SelectorType.RANGE:\n Object.keys(value).forEach((k, i) => {\n if (i > 0) {\n template += ' and ';\n }\n template += `${k} ${(value as IRangeValues)[k as keyof IRangeValues]}`;\n });\n return template;\n }\n\n return typeof value === 'object' ? `= ${JSON.stringify(value)}` : `= ${value}`;\n }\n\n /**\n * Add items in legend for automatic coloring\n */\n public static addLegendAutoColors(\n itemsData: Array<LkNodeData | LkEdgeData>,\n styleRule: StyleRule,\n currentLegend: Array<{label: string; value: string | number | IStyleIcon | IStyleImage}>\n ): void {\n const colorStyle = styleRule.style.color as IStyleColor;\n const propertyKey: string = colorStyle.input[1];\n itemsData.forEach((data) => {\n const propValue = Tools.getIn(data, colorStyle.input);\n if (Array.isArray(propValue)) {\n propValue.forEach((value) => {\n const label = colorStyle.input.includes('properties')\n ? `${StyleRules.getTypeLabel(styleRule.itemType)}.${propertyKey} = ${value}`\n : `${StyleRules.getTypeLabel(value)}`;\n const color = ItemAttributes.autoColor(value, colorStyle.ignoreCase);\n StyleRules.updateLegend(currentLegend, {label: label, value: color});\n });\n } else {\n const label = colorStyle.input.includes('properties')\n ? `${StyleRules.getTypeLabel(styleRule.itemType)}.${propertyKey} = ${propValue}`\n : `${StyleRules.getTypeLabel(propValue)}`;\n const value = ItemAttributes.autoColor(propValue, colorStyle.ignoreCase);\n StyleRules.updateLegend(currentLegend, {label: label, value: value});\n }\n });\n }\n\n /**\n * Return the label of item type for a legend item\n */\n public static getTypeLabel(type: string | undefined | null): string {\n return type === undefined ? 'All' : type === null ? 'Others' : type;\n }\n\n /**\n * Return the color of item type from the list of styles\n */\n public getColorForType(type: string): string {\n const colors = this.color\n .map((rule) => rule.getTypeColor(type))\n .filter((type) => Tools.isDefined(type));\n\n return colors.length > 0 ? colors[colors.length - 1] : BASE_GREY;\n }\n\n /**\n * Return the icon of item type from the list of styles\n */\n public getIconForType(type: string): string | number | undefined {\n // icon is only used for nodes\n const icons = (this.icon as StyleRule<INodeStyle>[])\n .filter((rule) => !Tools.isDefined(rule.input) && rule.itemType === type)\n .map((rule) => {\n // rule.style.icon can be undefined as it is optional in INodeStyle interface\n return (rule.style.icon as IStyleIcon)?.content;\n })\n .filter((type) => Tools.isDefined(type));\n\n return icons.length > 0 ? icons[icons.length - 1] : undefined;\n }\n\n /**\n * Check if a legend item already exists and overwrite it / push it\n */\n public static updateLegend(\n legend: Array<{label: string; value: string | number | IStyleIcon | IStyleImage}>,\n {label, value}: {[key: string]: string}\n ): void {\n const indexOfLegendItem = legend.map((r) => r.label).indexOf(label);\n if (indexOfLegendItem < 0) {\n legend.push({label: label, value: value});\n } else {\n legend[indexOfLegendItem] = {label: label, value: value};\n }\n }\n\n /**\n * return an array of StyleRule, containing only the desired style\n */\n public static getBy(\n styleType: StyleType,\n rules: Array<IStyleRule<INodeStyle | IEdgeStyle>>\n ): Array<StyleRule> {\n return rules\n .filter((style: IStyleRule<INodeStyle | IEdgeStyle>) => {\n switch (styleType) {\n case StyleType.COLOR:\n return style.style.color !== undefined;\n\n case StyleType.ICON:\n return 'icon' in style.style && style.style.icon !== undefined;\n\n case StyleType.IMAGE:\n return 'image' in style.style && style.style.image !== undefined;\n\n case StyleType.SHAPE:\n return style.style.shape !== undefined;\n\n case StyleType.SIZE:\n return 'size' in style.style && style.style.size !== undefined;\n\n case StyleType.WIDTH:\n return 'width' in style.style && style.style.width !== undefined;\n }\n })\n .map((style: IStyleRule<INodeStyle | IEdgeStyle>) => StyleRules.getRule(style, styleType));\n }\n\n /**\n * From a RawStyle, generate a StyleRule of a specific style\n */\n public static getRule(\n rawRule: IStyleRule<INodeStyle | IEdgeStyle>,\n styleType: StyleType\n ): StyleRule {\n const rule = Tools.clone(rawRule);\n rule.style = {[styleType]: rule.style[styleType]};\n return new StyleRule(rule);\n }\n\n /**\n * Check for non unique index in styles rules and update them if exists\n */\n public static sanitizeStylesIndex(styles: IStyles): IStyles {\n const seenIndex: Array<number> = [];\n const sanitizedStyles: IStyles = Tools.clone(styles);\n let maxIndex =\n Math.max(...[...styles.node.map((s) => s.index), ...styles.edge.map((s) => s.index)]) + 1;\n sanitizedStyles.node = sanitizedStyles.node.map((style) => {\n if (seenIndex.includes(style.index)) {\n style.index = maxIndex;\n maxIndex++;\n } else {\n seenIndex.push(style.index);\n }\n return style;\n });\n sanitizedStyles.edge = sanitizedStyles.edge.map((style) => {\n if (seenIndex.includes(style.index)) {\n style.index = maxIndex;\n maxIndex++;\n } else {\n seenIndex.push(style.index);\n }\n return style;\n });\n return sanitizedStyles;\n }\n}\n","'use strict';\n\nimport * as o from '@linkurious/ogma';\nimport {\n Badge,\n Edge,\n EdgeAttributesValue,\n Node,\n NodeAttributesValue,\n StyleClass,\n StyleRule\n} from '@linkurious/ogma';\nimport {\n GenericObject,\n IEdgeStyle,\n INodeStyle,\n IStyleIcon,\n IStyleRule,\n LkEdgeData,\n LkNodeData,\n OgmaEdgeShape,\n OgmaNodeShape,\n TextOptions\n} from '@linkurious/rest-client';\n\nimport {\n BASE_GREY,\n EdgeAttributes,\n LKOgma,\n NodeAttributes,\n OgmaTools,\n StyleRule as LKStyleRule,\n StyleRules,\n StyleType\n} from '../..';\nimport {Tools} from '../../tools/tools';\nimport {OgmaImage} from '../../styles/nodeAttributes';\n\nexport interface StylesConfig {\n nodeColorStyleRules: Array<LKStyleRule>;\n nodeIconStyleRules: Array<LKStyleRule>;\n nodeSizeStyleRules: Array<LKStyleRule>;\n nodeShapeStyleRules?: Array<LKStyleRule>;\n edgeColorStyleRules: Array<LKStyleRule>;\n edgeWidthStyleRules: Array<LKStyleRule>;\n edgeShapeStyleRules?: Array<LKStyleRule>;\n}\nexport const DEFAULT_OGMA_FONT = \"'roboto', sans-serif\";\nexport const CLEAR_FONT_COLOR = '#FFF';\nexport const FILTER_OPACITY = 0.2;\n\nconst HOVERED_SELECTED_NODE_STYLE: NodeAttributesValue<LkNodeData, LkEdgeData> = {\n text: {\n style: 'bold',\n backgroundColor: '#fff',\n minVisibleSize: 0\n },\n outerStroke: {width: 2},\n outline: false\n};\n\nconst HOVERED_SELECTED_EDGE_STYLE: EdgeAttributesValue<LkEdgeData, LkNodeData> = {\n text: {\n style: 'bold',\n backgroundColor: '#fff',\n minVisibleSize: 0\n },\n outline: false\n};\n\nconst NODE_HALO_CONFIGURATION = {\n color: '#FFF',\n width: 7,\n scalingMethod: 'scaled',\n strokeWidth: 0,\n hideNonAdjacentEdges: false\n} as {\n color: '#FFF';\n width: 7;\n strokeWidth: 0;\n};\n\nconst EDGE_HALO_CONFIGURATION = {\n color: '#FFF',\n scalingMethod: 'scaled',\n width: 4\n} as {\n color: '#FFF';\n width: 4;\n};\n\nconst DARK_FONT_COLOR = '#000';\nconst ITEM_DEFAULT_COLOR = '#7f7f7f';\n\nexport class StylesViz {\n private _ogma: LKOgma;\n private _exportClass!: StyleClass;\n private _nodeDefaultStylesRules!: StyleRule<LkNodeData, LkEdgeData>;\n // @ts-ignore\n private _nodeDefaultHaloRules!: StyleRule<LkNodeData, LkEdgeData>;\n private _edgeDefaultStylesRules!: StyleRule<LkNodeData, LkEdgeData>;\n // @ts-ignore\n private _edgeDefaultHaloRules!: StyleRule<LkNodeData, LkEdgeData>;\n\n private _nodeAttributes: NodeAttributes = new NodeAttributes({});\n private _edgeAttributes: EdgeAttributes = new EdgeAttributes({});\n\n private _ogmaNodeColor!: StyleRule;\n private _ogmaNodeIcon!: StyleRule;\n private _ogmaNodeSize!: StyleRule;\n private _ogmaNodeShape!: StyleRule;\n private _ogmaEdgeColor!: StyleRule;\n private _ogmaEdgeWidth!: StyleRule;\n private _ogmaEdgeShape!: StyleRule;\n private _defaultConfiguration: {\n node: {\n nodeRadius?: number;\n shape?: OgmaNodeShape;\n text?: TextOptions & {\n nodePosition?: 'right' | 'left' | 'top' | 'bottom' | 'center';\n };\n };\n edge: {\n edgeWidth?: number;\n shape?: OgmaEdgeShape;\n text?: TextOptions;\n };\n };\n\n constructor(\n ogma: LKOgma,\n configuration: {\n node: {\n nodeRadius?: number;\n shape?: OgmaNodeShape;\n text?: TextOptions & {\n nodePosition?: 'right' | 'left' | 'top' | 'bottom' | 'center';\n };\n };\n edge: {\n edgeWidth?: number;\n shape?: OgmaEdgeShape;\n text?: TextOptions;\n };\n baseUrl?: string;\n }\n ) {\n this._ogma = ogma;\n this._defaultConfiguration = configuration;\n this._nodeAttributes.setBaseUrl(configuration.baseUrl);\n }\n\n public get nodeAttributes(): NodeAttributes {\n return this._nodeAttributes;\n }\n\n public get nodeFont(): string | undefined {\n return this._defaultConfiguration.node?.text?.font;\n }\n\n /**\n * Set nodes default styles based on the configuration\n */\n public setNodesDefaultStyles(): void {\n // setting selection and hover attributes\n this._ogma.styles.setHoveredNodeAttributes(HOVERED_SELECTED_NODE_STYLE);\n this._ogma.styles.setSelectedNodeAttributes(HOVERED_SELECTED_NODE_STYLE);\n // setting default styles\n this._nodeDefaultStylesRules = this._ogma.styles.addRule({\n nodeAttributes: {\n text: {\n padding: 5,\n minVisibleSize:\n this._defaultConfiguration.node.text !== undefined &&\n this._defaultConfiguration.node.text.minVisibleSize\n ? this._defaultConfiguration.node.text.minVisibleSize\n : 12,\n maxLineLength:\n this._defaultConfiguration.node.text !== undefined &&\n this._defaultConfiguration.node.text.maxLineLength !== undefined\n ? this._defaultConfiguration.node.text.maxLineLength\n : 30,\n position:\n this._defaultConfiguration.node.text !== undefined &&\n this._defaultConfiguration.node.text.nodePosition !== undefined\n ? this._defaultConfiguration.node.text.nodePosition\n : 'bottom',\n backgroundColor:\n this._defaultConfiguration.node.text !== undefined &&\n this._defaultConfiguration.node.text.backgroundColor !== undefined\n ? this._defaultConfiguration.node.text.backgroundColor\n : undefined,\n font:\n this._defaultConfiguration.node.text !== undefined &&\n this._defaultConfiguration.node.text.font !== undefined\n ? this._defaultConfiguration.node.text.font\n : \"'roboto', sans-serif\",\n color:\n this._defaultConfiguration.node.text !== undefined &&\n this._defaultConfiguration.node.text.color !== undefined\n ? this._defaultConfiguration.node.text.color\n : 'black',\n size:\n this._defaultConfiguration.node.text !== undefined &&\n this._defaultConfiguration.node.text.size !== undefined\n ? this._defaultConfiguration.node.text.size\n : 14,\n margin: 5\n },\n radius: this.defaultNodeRadius(this._defaultConfiguration.node),\n icon: {\n minVisibleSize: 15\n },\n color: ITEM_DEFAULT_COLOR,\n shape:\n this._defaultConfiguration.node.shape !== undefined\n ? this._defaultConfiguration.node.shape\n : ('circle' as OgmaNodeShape),\n innerStroke: {\n width: 3\n },\n outline: false\n },\n nodeSelector: (node) => !node.isVirtual()\n });\n }\n\n /**\n * Set edges default styles based on the configuration\n */\n public setEdgesDefaultStyles(): void {\n // setting selection and hover attributes\n this._ogma.styles.setHoveredEdgeAttributes(HOVERED_SELECTED_EDGE_STYLE);\n this._ogma.styles.setSelectedEdgeAttributes(HOVERED_SELECTED_EDGE_STYLE);\n // setting default styles\n this._edgeDefaultStylesRules = this._ogma.styles.addRule({\n edgeAttributes: {\n text: {\n minVisibleSize:\n this._defaultConfiguration.edge.text !== undefined &&\n this._defaultConfiguration.edge.text.minVisibleSize\n ? this._defaultConfiguration.edge.text.minVisibleSize\n : 3,\n maxLineLength:\n this._defaultConfiguration.edge.text !== undefined &&\n this._defaultConfiguration.edge.text.maxLineLength !== undefined\n ? this._defaultConfiguration.edge.text.maxLineLength\n : 30,\n backgroundColor:\n this._defaultConfiguration.edge.text !== undefined &&\n this._defaultConfiguration.edge.text.backgroundColor !== undefined\n ? this._defaultConfiguration.edge.text.backgroundColor\n : undefined,\n font:\n this._defaultConfiguration.edge.text !== undefined &&\n this._defaultConfiguration.edge.text.font !== undefined\n ? this._defaultConfiguration.edge.text.font\n : \"'roboto', sans-serif\",\n color:\n this._defaultConfiguration.edge?.text !== undefined &&\n this._defaultConfiguration.edge.text.color !== undefined\n ? this._defaultConfiguration.edge.text.color\n : 'black',\n size:\n this._defaultConfiguration.edge.text !== undefined &&\n this._defaultConfiguration.edge.text.size !== undefined\n ? this._defaultConfiguration.edge.text.size\n : 14\n },\n width: this.defaultEdgeWidth(this._defaultConfiguration.edge),\n shape:\n this._defaultConfiguration.edge.shape !== undefined\n ? this._defaultConfiguration.edge.shape\n : 'arrow',\n color: ITEM_DEFAULT_COLOR\n }\n });\n }\n\n /**\n * Set nodes default styles based on the configuration\n */\n public setNodesDefaultHalo(): void {\n // setting default halo style\n this._nodeDefaultHaloRules = this._ogma.styles.addRule({\n nodeSelector: (node) => node && !node.hasClass('filtered') && !node.isVirtual(),\n nodeAttributes: {\n halo: (node) => {\n if (\n node !== undefined &&\n !node.hasClass('filtered') &&\n (node.isSelected() ||\n node.getAdjacentNodes({}).isSelected().includes(true) ||\n node.getAdjacentEdges().isSelected().includes(true))\n ) {\n return {\n ...NODE_HALO_CONFIGURATION,\n scalingMethod: this._ogma.geo.enabled() ? 'fixed' : 'scaled'\n };\n }\n return null;\n }\n },\n // recalculate the rule *only* when itself or adjacent\n // elements change their selection status\n nodeDependencies: {\n self: {\n selection: true\n },\n adjacentNodes: {\n selection: true\n },\n adjacentEdges: {\n selection: true\n }\n }\n });\n }\n\n /**\n * Set edges default styles based on the configuration\n */\n public setEdgesDefaultHalo(): void {\n // setting default halo styles\n this._edgeDefaultHaloRules = this._ogma.styles.addRule({\n edgeSelector: (edge: Edge) =>\n edge && edge.getSource() && edge.getTarget() && !edge.hasClass('filtered'),\n edgeAttributes: {\n halo: (edge) => {\n if (\n edge &&\n !edge.hasClass('filtered') &&\n (edge.isSelected() || edge.getSource().isSelected() || edge.getTarget().isSelected())\n ) {\n return {\n ...EDGE_HALO_CONFIGURATION,\n scalingMethod: this._ogma.geo.enabled() ? 'fixed' : 'scaled'\n };\n }\n return null;\n }\n },\n // this rule will only be invoked when the selection status\n // of the edge or it's extremities is changed\n edgeDependencies: {\n self: {\n selection: true\n },\n extremities: {\n selection: true\n }\n }\n });\n }\n\n /**\n * Return the default node radius set in configuration or 5\n *\n * @returns {number}\n */\n private defaultNodeRadius(styles: {nodeRadius?: number}): number {\n return this.defaultStylesHas(styles, ['nodeRadius']) ? styles.nodeRadius! : 5;\n }\n\n /**\n * Return the default edge width set in configuration or 1\n *\n * @returns {number}\n */\n private defaultEdgeWidth(styles: {edgeWidth?: number}): number {\n return this.defaultStylesHas(styles, ['edgeWidth']) ? styles.edgeWidth! : 1;\n }\n\n /**\n * Check if a style property exists in the default styles object\n */\n private defaultStylesHas(styles: GenericObject<unknown>, propertyPath: Array<string>): boolean {\n if (!Tools.isDefined(styles)) {\n return false;\n }\n return Tools.getIn(styles, propertyPath) !== undefined;\n }\n\n /**\n * Set styles for the class \"filtered\"\n */\n public setFilterClass(): void {\n this._ogma.styles.createClass({\n name: 'filtered',\n nodeAttributes: {\n opacity: FILTER_OPACITY,\n layer: (node): number => {\n // if the node is part of a virtual node, it should be on top\n if (node.getMetaNode() !== null) {\n return 1;\n }\n return -1;\n },\n detectable: false,\n badges: {\n topRight: {\n text: null\n },\n bottomRight: {\n text: null\n }\n },\n text: null,\n color: 'rgb(240, 240, 240)',\n innerStroke: {\n width: 1,\n color: BASE_GREY,\n minVisibleSize: 1\n },\n shape: 'circle',\n image: null,\n icon: null,\n radius: '50%'\n },\n edgeAttributes: {\n opacity: FILTER_OPACITY,\n layer: (edge): number => {\n const isEdgeInsideNodeGroup = edge\n .getExtremities()\n .getMetaNode()\n .some((node) => node !== null);\n // if the edge is part of a virtual node, it should be on top\n if (!edge.isVirtual() && isEdgeInsideNodeGroup) {\n return 1;\n }\n return -1;\n },\n detectable: false,\n text: null,\n color: BASE_GREY,\n shape: 'line',\n width: 0.2\n }\n });\n }\n\n /**\n * Set the class for exported nodes and edges\n */\n public setExportClass(textWrappingLength?: boolean): void {\n if (!this._exportClass) {\n this._exportClass = this._ogma.styles.createClass({\n name: 'exported',\n nodeAttributes: {\n text: {\n minVisibleSize: 0,\n size: 12,\n maxLineLength: textWrappingLength ? 30 : 0\n },\n halo: null\n },\n edgeAttributes: {\n text: {\n minVisibleSize: 0,\n size: 12\n },\n halo: null\n }\n });\n } else {\n this._exportClass.update({\n nodeAttributes: {\n text: {\n maxLineLength: textWrappingLength ? 30 : 0\n },\n halo: null\n }\n });\n }\n }\n\n /**\n * Set the rule to display badges\n */\n public setBadgeRule() {\n this._ogma.styles.createClass({\n name: 'degreeIndicator',\n nodeAttributes: {\n badges: {\n topRight: (node) => {\n if (node !== undefined) {\n const degree = Tools.getHiddenNeighbors(node.toList());\n const badgeContent = Tools.formatNumber(degree);\n if (degree > 0) {\n const nodeColor = Array.isArray(node.getAttribute('color'))\n ? node.getAttribute('color')![0]\n : node.getAttribute('color');\n const textColor = OgmaTools.isBright(nodeColor as o.Color)\n ? DARK_FONT_COLOR\n : CLEAR_FONT_COLOR;\n const isSupernode = node.getData(['statistics', 'supernode']);\n let content = null;\n if (+badgeContent !== 0) {\n content = isSupernode ? badgeContent + '+' : badgeContent;\n }\n return {\n color: 'inherit',\n minVisibleSize: 20,\n stroke: {\n width: 0,\n color: null\n },\n text: {\n font:\n this._defaultConfiguration.node.text !== undefined &&\n this._defaultConfiguration.node.text.font !== undefined\n ? this._defaultConfiguration.node.text.font\n : DEFAULT_OGMA_FONT,\n scale: 0.4,\n color: textColor,\n content: content\n }\n };\n }\n }\n }\n }\n }\n });\n this._ogma.styles.createClass({\n name: 'pinnedIndicator',\n nodeAttributes: {\n badges: {\n bottomRight: (node): Badge | undefined => {\n if (node !== undefined && !node.getAttribute('layoutable')) {\n return {\n color: this._findPinBadgeBackgroundColor(node),\n minVisibleSize: 20,\n scale: this._findPinBadgeScale(node),\n stroke: {\n width: 0,\n color: null\n },\n text: {\n font: 'FontAwesome',\n scale: 0.4,\n color: this._findPinBadgeTextColor(node),\n content: node.getAttribute('layoutable') ? null : '\\uf08d'\n }\n };\n }\n }\n }\n },\n nodeDependencies: {\n self: {attributes: ['layoutable']}\n }\n });\n this._ogma.events.on('addNodes', (nodesEvent) => nodesEvent.nodes.addClass('degreeIndicator'));\n this._ogma.events.on('addNodes', (nodesEvent) => nodesEvent.nodes.addClass('pinnedIndicator'));\n }\n\n /**\n * Delete the rule to display badges\n */\n public deleteBadgeRule() {\n this._ogma.getNodes().removeClasses(['degreeIndicator', 'pinnedIndicator'], 0);\n }\n\n /**\n * set text overlap to true or false\n *\n * @param {boolean} overlap\n */\n public toggleTextOverlap(overlap?: boolean): void {\n this._ogma.setOptions({texts: {preventOverlap: overlap}});\n }\n\n /**\n * refresh nodes and edge rules\n *\n */\n public refreshRules(): void {\n this._nodeDefaultStylesRules.refresh();\n this._edgeDefaultStylesRules.refresh();\n }\n\n /**\n * Create / refresh an ogma rule for node colors\n */\n public refreshNodeColors(colorStyleRules: Array<LKStyleRule<INodeStyle>>): void {\n if (!Tools.isDefined(this._ogmaNodeColor)) {\n this._nodeAttributes.refresh({color: colorStyleRules});\n this._ogmaNodeColor = this._ogma.styles.addRule({\n nodeAttributes: {\n color: (node: o.Node | undefined) => {\n if (node !== undefined) {\n return this._nodeAttributes.color(node.getData());\n }\n }\n },\n nodeDependencies: {self: {data: true}},\n nodeSelector: (node) => !node.isVirtual()\n });\n } else {\n this._nodeAttributes.refresh({color: colorStyleRules});\n this._ogmaNodeColor.refresh();\n // TODO refresh node icons when moving the code from LKE\n // this.refreshIconsColor();\n }\n }\n\n /**\n * Return an array of StyleRules with only the style that need to be applied\n */\n public getStyleRule(\n state: Array<IStyleRule<INodeStyle | IEdgeStyle>>,\n styleType: StyleType\n ): LKStyleRule[] {\n return new StyleRules(state)[styleType];\n }\n\n public initNodeColors(nodeRules: Array<IStyleRule<INodeStyle | IEdgeStyle>>): void {\n const nodeColorRules = this.getStyleRule(\n nodeRules,\n StyleType.COLOR\n ) as LKStyleRule<INodeStyle>[];\n this.refreshNodeColors(nodeColorRules);\n }\n\n public initNodesIcons(nodeRules: Array<IStyleRule<INodeStyle | IEdgeStyle>>) {\n const nodeIconsRules = this.getStyleRule(\n nodeRules,\n StyleType.ICON\n ) as LKStyleRule<INodeStyle>[];\n this.refreshNodeIcons(nodeIconsRules);\n }\n\n public initNodesSizes(nodeRules: Array<IStyleRule<INodeStyle | IEdgeStyle>>): void {\n const nodeSizeRules = this.getStyleRule(nodeRules, StyleType.SIZE) as LKStyleRule<INodeStyle>[];\n this.refreshNodeSize(nodeSizeRules);\n }\n\n public initNodesShapes(nodeRules: Array<IStyleRule<INodeStyle | IEdgeStyle>>) {\n const nodeShapesRules = this.getStyleRule(\n nodeRules,\n StyleType.SHAPE\n ) as LKStyleRule<INodeStyle>[];\n this.refreshNodeShape(nodeShapesRules);\n }\n\n public initEdgesWidth(edgeRules: Array<IStyleRule<INodeStyle | IEdgeStyle>>) {\n const edgesWidthRules = this.getStyleRule(\n edgeRules,\n StyleType.WIDTH\n ) as LKStyleRule<IEdgeStyle>[];\n this.refreshEdgeWidth(edgesWidthRules);\n }\n\n public initEdgesShape(edgeRules: Array<IStyleRule<INodeStyle | IEdgeStyle>>) {\n const edgesShapeRules = this.getStyleRule(\n edgeRules,\n StyleType.SHAPE\n ) as LKStyleRule<IEdgeStyle>[];\n this.refreshEdgeShape(edgesShapeRules);\n }\n\n public initEdgesColor(edgeRules: Array<IStyleRule<INodeStyle | IEdgeStyle>>): void {\n const edgesColorRules = this.getStyleRule(\n edgeRules,\n StyleType.COLOR\n ) as LKStyleRule<IEdgeStyle>[];\n this.refreshEdgeColors(edgesColorRules);\n }\n\n /**\n * Create / refresh an ogma rule for node icons\n *\n * @param {Array<any>} iconStyleRules\n */\n public refreshNodeIcons(iconStyleRules: Array<LKStyleRule<INodeStyle>>): void {\n if (!Tools.isDefined(this._ogmaNodeIcon)) {\n this._nodeAttributes.refresh({icon: iconStyleRules});\n this._ogmaNodeIcon = this._ogma.styles.addRule({\n nodeAttributes: {\n icon: (node: o.Node | undefined): IStyleIcon | undefined => {\n if (node !== undefined) {\n return this._nodeAttributes.icon(node.getData()).icon;\n }\n },\n image: (node: o.Node | undefined): OgmaImage | null | undefined => {\n if (node !== undefined && !node.isVirtual()) {\n return this._nodeAttributes.icon(node.getData()).image;\n }\n }\n },\n nodeDependencies: {self: {data: true}},\n nodeSelector: (node) => !node.isVirtual()\n });\n } else {\n this._nodeAttributes.refresh({icon: iconStyleRules});\n void this._ogmaNodeIcon.refresh();\n }\n }\n\n /**\n * Create / refresh an ogma rule for node sizes\n *\n * @param {Array<any>} sizeStyleRules\n */\n public refreshNodeSize(sizeStyleRules: Array<LKStyleRule<INodeStyle>>): void {\n if (!Tools.isDefined(this._ogmaNodeSize)) {\n this._nodeAttributes.refresh({size: sizeStyleRules});\n this._ogmaNodeSize = this._ogma.styles.addRule({\n nodeAttributes: {\n radius: (node: o.Node | undefined) => {\n if (node !== undefined) {\n return this._nodeAttributes.size(node.getData());\n }\n }\n },\n nodeDependencies: {self: {data: true}},\n nodeSelector: (node) => !node.isVirtual()\n });\n } else {\n this._nodeAttributes.refresh({size: sizeStyleRules});\n this._ogmaNodeSize.refresh();\n }\n }\n\n /**\n * Create / refresh an ogma rule for node images\n *\n * @param {Array<any>} shapeStyleRules\n */\n public refreshNodeShape(shapeStyleRules: Array<LKStyleRule<INodeStyle>>): void {\n if (!Tools.isDefined(this._ogmaNodeShape)) {\n this._nodeAttributes.refresh({shape: shapeStyleRules});\n this._ogmaNodeShape = this._ogma.styles.addRule({\n nodeAttributes: {\n shape: (node: o.Node | undefined) => {\n if (node !== undefined) {\n return this._nodeAttributes.shape(node.getData());\n }\n }\n },\n nodeSelector: (node: o.Node | undefined) => node !== undefined && !node.isVirtual(),\n nodeDependencies: {self: {data: true}}\n });\n } else {\n this._nodeAttributes.refresh({shape: shapeStyleRules});\n this._ogmaNodeShape.refresh();\n }\n }\n\n /**\n * Create / refresh an ogma rule for edge colors\n */\n public refreshEdgeColors(colorStyleRules: Array<LKStyleRule<IEdgeStyle>>): void {\n if (!Tools.isDefined(this._ogmaEdgeColor)) {\n this._edgeAttributes.refresh({color: colorStyleRules});\n this._ogmaEdgeColor = this._ogma.styles.addRule({\n edgeAttributes: {\n color: (edge: o.Edge | undefined) => {\n if (edge !== undefined) {\n return this._edgeAttributes.color(edge.getData());\n }\n }\n },\n edgeDependencies: {self: {data: true}}\n });\n } else {\n this._edgeAttributes.refresh({color: colorStyleRules});\n this._ogmaEdgeColor.refresh();\n }\n }\n\n /**\n * Create / refresh an ogma rule for edge width\n *\n * @param {Array<LKStyleRule>} widthStyleRules\n */\n public refreshEdgeWidth(widthStyleRules: Array<LKStyleRule<IEdgeStyle>>): void {\n if (!Tools.isDefined(this._ogmaEdgeWidth)) {\n this._edgeAttributes.refresh({width: widthStyleRules});\n this._ogmaEdgeWidth = this._ogma.styles.addRule({\n edgeAttributes: {\n width: (edge: o.Edge | undefined) => {\n if (edge !== undefined) {\n return this._edgeAttributes.width(edge.getData());\n }\n }\n },\n edgeDependencies: {\n self: {data: true}\n }\n });\n } else {\n this._edgeAttributes.refresh({width: widthStyleRules});\n this._ogmaEdgeWidth.refresh();\n }\n }\n\n /**\n * Create / refresh an ogma rule for edge width\n *\n * @param {Array<LKStyleRule>} shapeStyleRules\n */\n public refreshEdgeShape(shapeStyleRules: Array<LKStyleRule<IEdgeStyle>>): void {\n if (!Tools.isDefined(this._ogmaEdgeShape)) {\n this._edgeAttributes.refresh({shape: shapeStyleRules});\n this._ogmaEdgeShape = this._ogma.styles.addRule({\n edgeAttributes: {\n shape: (edge: o.Edge | undefined) => {\n if (edge !== undefined) {\n return this._edgeAttributes.shape(edge.getData());\n }\n }\n },\n edgeDependencies: {self: {data: true}}\n });\n } else {\n this._edgeAttributes.refresh({shape: shapeStyleRules});\n this._ogmaEdgeShape.refresh();\n }\n }\n\n /**\n * Get node radius\n * This is a workaround for an ogma issue where the radius of virtual nodes is always set to 5\n * TODO: check if this is still needed after ogma release the new improvement for transformation v5.X\n */\n private _getNodeRadius(node: Node<LkNodeData, LkEdgeData>): number {\n if (!node.isVirtual()) {\n return node.getAttribute('radius') as number;\n } else {\n // get the width and height of the box that contains the nodes inside the virtual node\n const {width, height} = node.getSubNodes()?.getBoundingBox()!;\n return Math.max(width, height);\n }\n }\n\n /**\n * Calculate the scale of the pin badge related to the node radius\n * This is useful when dealing wih huge nodes, and we don't want the badge to be big\n * If the node is small enough, the badge will be 0.46 of the node radius\n * Else it will be 5 / radius\n */\n private _findPinBadgeScale(node: Node<LkNodeData, LkEdgeData>): number {\n // the maximum radius for the badge\n const MAX = 5;\n const defaultRatio = 0.46;\n const bigNodeRatio = 0.17;\n const radius = this._getNodeRadius(node);\n return radius * defaultRatio > MAX ? bigNodeRatio : defaultRatio;\n }\n\n /**\n * Find the color of the pin badge text\n */\n private _findPinBadgeTextColor(node: Node<LkNodeData, LkEdgeData>): string {\n if (node.isVirtual()) {\n return CLEAR_FONT_COLOR;\n }\n const nodeColor = Array.isArray(node.getAttribute('color'))\n ? node.getAttribute('color')![0]\n : node.getAttribute('color');\n return OgmaTools.isBright(nodeColor as o.Color) ? DARK_FONT_COLOR : CLEAR_FONT_COLOR;\n }\n\n /**\n * Find the color of the pin badge background\n */\n private _findPinBadgeBackgroundColor(node: Node<LkNodeData, LkEdgeData>): string {\n return node.isVirtual() ? BASE_GREY : 'inherit';\n }\n}\n","'use strict';\n\nimport * as Ogma from '@linkurious/ogma';\nimport {GraphSchemaTypeWithAccess, ItemFieldsCaptions} from '@linkurious/rest-client';\n\nimport {Captions, LKOgma} from '../..';\nimport {Tools} from '../../tools/tools';\n\nexport interface CaptionState {\n node: ItemFieldsCaptions;\n edge: ItemFieldsCaptions;\n}\n\nexport class CaptionsViz {\n public nodesCaptionsRule!: Ogma.StyleRule;\n public edgesCaptionsRule!: Ogma.StyleRule;\n private _ogma: LKOgma;\n private _captionSchema: CaptionState = {node: {}, edge: {}};\n private _graphSchema: {\n node: Array<GraphSchemaTypeWithAccess>;\n edge: Array<GraphSchemaTypeWithAccess>;\n } = {node: [], edge: []};\n\n constructor(\n ogma: LKOgma,\n private _nodeMaxTextLength: number | undefined,\n private _edgeMaxTextLength: number | undefined\n ) {\n this._ogma = ogma;\n }\n\n public set graphSchema(graphSchema: {\n node: Array<GraphSchemaTypeWithAccess>;\n edge: Array<GraphSchemaTypeWithAccess>;\n }) {\n this._graphSchema = graphSchema;\n }\n\n /**\n * Refresh the schema\n */\n public refreshSchema(schema: CaptionState): void {\n this._captionSchema = schema;\n }\n\n /**\n * Refresh visualization captions rules\n */\n public async initVizCaptions(schema: CaptionState): Promise<void> {\n if (this._ogma.LKCaptions.nodesCaptionsRule) {\n this._ogma.LKCaptions.refreshSchema(schema);\n await this._ogma.LKCaptions.updateNodeCaptions();\n } else {\n this._ogma.LKCaptions.updateNodeCaptions(schema.node);\n }\n if (this._ogma.LKCaptions.edgesCaptionsRule) {\n this._ogma.LKCaptions.refreshSchema(schema);\n await this._ogma.LKCaptions.updateEdgeCaptions();\n } else {\n this._ogma.LKCaptions.updateEdgeCaptions(schema.edge);\n }\n }\n\n /**\n * Create or update nodeCaptionRule\n */\n public updateNodeCaptions(schema?: ItemFieldsCaptions): Promise<void> | void {\n if (schema) {\n this._captionSchema.node = schema;\n }\n if (!Tools.isDefined(this.nodesCaptionsRule)) {\n this.nodesCaptionsRule = this._ogma.styles.addRule({\n nodeAttributes: {\n text: {\n content: (node: Ogma.Node | undefined) => {\n if (node === undefined) {\n return ``;\n }\n const value = Captions.getText(\n node.getData(),\n this._captionSchema.node,\n this._graphSchema.node\n );\n return Tools.isDefined(this._nodeMaxTextLength)\n ? Tools.truncate(value, 'middle', this._nodeMaxTextLength)\n : value;\n }\n }\n },\n // We ignore virtual nodes as they have their proper caption\n nodeSelector: (node) => !node.isVirtual(),\n nodeDependencies: {self: {data: true}}\n });\n } else {\n return this.nodesCaptionsRule.refresh();\n }\n }\n\n /**\n * Create or update edgeCaptionRule\n */\n public updateEdgeCaptions(schema?: ItemFieldsCaptions): Promise<void> | void {\n if (schema) {\n this._captionSchema.edge = schema;\n }\n if (!Tools.isDefined(this.edgesCaptionsRule)) {\n this.edgesCaptionsRule = this._ogma.styles.addRule({\n edgeAttributes: {\n text: {\n content: (edge: Ogma.Edge | undefined) => {\n if (edge === undefined || edge.getData() === undefined) {\n return ``;\n }\n const value = Captions.getText(\n edge.getData(),\n this._captionSchema.edge,\n this._graphSchema.edge\n );\n return Tools.isDefined(this._edgeMaxTextLength)\n ? Tools.truncate(value, 'middle', this._edgeMaxTextLength)\n : value;\n }\n }\n },\n edgeSelector: (edge) => !edge.isVirtual(),\n // ogma will trigger the rendering if data change or the shape change (to trigger the rendering when edges are grouped)\n edgeDependencies: {self: {data: true, attributes: ['shape.style']}}\n });\n } else {\n return this.edgesCaptionsRule.refresh();\n }\n }\n}\n","export function isFunction(value) {\n return typeof value === 'function';\n}\n//# sourceMappingURL=isFunction.js.map","import { isFunction } from './isFunction';\nexport function hasLift(source) {\n return isFunction(source === null || source === void 0 ? void 0 : source.lift);\n}\nexport function operate(init) {\n return function (source) {\n if (hasLift(source)) {\n return source.lift(function (liftedSource) {\n try {\n return init(liftedSource, this);\n }\n catch (err) {\n this.error(err);\n }\n });\n }\n throw new TypeError('Unable to lift unknown Observable type');\n };\n}\n//# sourceMappingURL=lift.js.map","/******************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\n\nvar extendStatics = function(d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n};\n\nexport function __extends(d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\nexport var __assign = function() {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n }\n return __assign.apply(this, arguments);\n}\n\nexport function __rest(s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n}\n\nexport function __decorate(decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\n\nexport function __param(paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n}\n\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\n var _, done = false;\n for (var i = decorators.length - 1; i >= 0; i--) {\n var context = {};\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\n if (kind === \"accessor\") {\n if (result === void 0) continue;\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\n if (_ = accept(result.get)) descriptor.get = _;\n if (_ = accept(result.set)) descriptor.set = _;\n if (_ = accept(result.init)) initializers.unshift(_);\n }\n else if (_ = accept(result)) {\n if (kind === \"field\") initializers.unshift(_);\n else descriptor[key] = _;\n }\n }\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\n done = true;\n};\n\nexport function __runInitializers(thisArg, initializers, value) {\n var useValue = arguments.length > 2;\n for (var i = 0; i < initializers.length; i++) {\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\n }\n return useValue ? value : void 0;\n};\n\nexport function __propKey(x) {\n return typeof x === \"symbol\" ? x : \"\".concat(x);\n};\n\nexport function __setFunctionName(f, name, prefix) {\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\n};\n\nexport function __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\n}\n\nexport function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n}\n\nexport function __generator(thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n}\n\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\n\nexport function __exportStar(m, o) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\n}\n\nexport function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\n\nexport function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n}\n\n/** @deprecated */\nexport function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++)\n ar = ar.concat(__read(arguments[i]));\n return ar;\n}\n\n/** @deprecated */\nexport function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n}\n\nexport function __spreadArray(to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n}\n\nexport function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n}\n\nexport function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n}\n\nexport function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\n}\n\nexport function __asyncValues(o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n}\n\nexport function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\n\nvar __setModuleDefault = Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n};\n\nexport function __importStar(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n}\n\nexport function __importDefault(mod) {\n return (mod && mod.__esModule) ? mod : { default: mod };\n}\n\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n}\n\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n}\n\nexport function __classPrivateFieldIn(state, receiver) {\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\n}\n\nexport function __addDisposableResource(env, value, async) {\n if (value !== null && value !== void 0) {\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\n var dispose, inner;\n if (async) {\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\n dispose = value[Symbol.asyncDispose];\n }\n if (dispose === void 0) {\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\n dispose = value[Symbol.dispose];\n if (async) inner = dispose;\n }\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\n env.stack.push({ value: value, dispose: dispose, async: async });\n }\n else if (async) {\n env.stack.push({ async: true });\n }\n return value;\n}\n\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\n var e = new Error(message);\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\n};\n\nexport function __disposeResources(env) {\n function fail(e) {\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\n env.hasError = true;\n }\n var r, s = 0;\n function next() {\n while (r = env.stack.pop()) {\n try {\n if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\n if (r.dispose) {\n var result = r.dispose.call(r.value);\n if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\n }\n else s |= 1;\n }\n catch (e) {\n fail(e);\n }\n }\n if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\n if (env.hasError) throw env.error;\n }\n return next();\n}\n\nexport function __rewriteRelativeImportExtension(path, preserveJsx) {\n if (typeof path === \"string\" && /^\\.\\.?\\//.test(path)) {\n return path.replace(/\\.(tsx)$|((?:\\.d)?)((?:\\.[^./]+?)?)\\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {\n return tsx ? preserveJsx ? \".jsx\" : \".js\" : d && (!ext || !cm) ? m : (d + ext + \".\" + cm.toLowerCase() + \"js\");\n });\n }\n return path;\n}\n\nexport default {\n __extends,\n __assign,\n __rest,\n __decorate,\n __param,\n __esDecorate,\n __runInitializers,\n __propKey,\n __setFunctionName,\n __metadata,\n __awaiter,\n __generator,\n __createBinding,\n __exportStar,\n __values,\n __read,\n __spread,\n __spreadArrays,\n __spreadArray,\n __await,\n __asyncGenerator,\n __asyncDelegator,\n __asyncValues,\n __makeTemplateObject,\n __importStar,\n __importDefault,\n __classPrivateFieldGet,\n __classPrivateFieldSet,\n __classPrivateFieldIn,\n __addDisposableResource,\n __disposeResources,\n __rewriteRelativeImportExtension,\n};\n","export function createErrorClass(createImpl) {\n var _super = function (instance) {\n Error.call(instance);\n instance.stack = new Error().stack;\n };\n var ctorFunc = createImpl(_super);\n ctorFunc.prototype = Object.create(Error.prototype);\n ctorFunc.prototype.constructor = ctorFunc;\n return ctorFunc;\n}\n//# sourceMappingURL=createErrorClass.js.map","import { createErrorClass } from './createErrorClass';\nexport var UnsubscriptionError = createErrorClass(function (_super) {\n return function UnsubscriptionErrorImpl(errors) {\n _super(this);\n this.message = errors\n ? errors.length + \" errors occurred during unsubscription:\\n\" + errors.map(function (err, i) { return i + 1 + \") \" + err.toString(); }).join('\\n ')\n : '';\n this.name = 'UnsubscriptionError';\n this.errors = errors;\n };\n});\n//# sourceMappingURL=UnsubscriptionError.js.map","export function arrRemove(arr, item) {\n if (arr) {\n var index = arr.indexOf(item);\n 0 <= index && arr.splice(index, 1);\n }\n}\n//# sourceMappingURL=arrRemove.js.map","import { __read, __spreadArray, __values } from \"tslib\";\nimport { isFunction } from './util/isFunction';\nimport { UnsubscriptionError } from './util/UnsubscriptionError';\nimport { arrRemove } from './util/arrRemove';\nvar Subscription = (function () {\n function Subscription(initialTeardown) {\n this.initialTeardown = initialTeardown;\n this.closed = false;\n this._parentage = null;\n this._finalizers = null;\n }\n Subscription.prototype.unsubscribe = function () {\n var e_1, _a, e_2, _b;\n var errors;\n if (!this.closed) {\n this.closed = true;\n var _parentage = this._parentage;\n if (_parentage) {\n this._parentage = null;\n if (Array.isArray(_parentage)) {\n try {\n for (var _parentage_1 = __values(_parentage), _parentage_1_1 = _parentage_1.next(); !_parentage_1_1.done; _parentage_1_1 = _parentage_1.next()) {\n var parent_1 = _parentage_1_1.value;\n parent_1.remove(this);\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_parentage_1_1 && !_parentage_1_1.done && (_a = _parentage_1.return)) _a.call(_parentage_1);\n }\n finally { if (e_1) throw e_1.error; }\n }\n }\n else {\n _parentage.remove(this);\n }\n }\n var initialFinalizer = this.initialTeardown;\n if (isFunction(initialFinalizer)) {\n try {\n initialFinalizer();\n }\n catch (e) {\n errors = e instanceof UnsubscriptionError ? e.errors : [e];\n }\n }\n var _finalizers = this._finalizers;\n if (_finalizers) {\n this._finalizers = null;\n try {\n for (var _finalizers_1 = __values(_finalizers), _finalizers_1_1 = _finalizers_1.next(); !_finalizers_1_1.done; _finalizers_1_1 = _finalizers_1.next()) {\n var finalizer = _finalizers_1_1.value;\n try {\n execFinalizer(finalizer);\n }\n catch (err) {\n errors = errors !== null && errors !== void 0 ? errors : [];\n if (err instanceof UnsubscriptionError) {\n errors = __spreadArray(__spreadArray([], __read(errors)), __read(err.errors));\n }\n else {\n errors.push(err);\n }\n }\n }\n }\n catch (e_2_1) { e_2 = { error: e_2_1 }; }\n finally {\n try {\n if (_finalizers_1_1 && !_finalizers_1_1.done && (_b = _finalizers_1.return)) _b.call(_finalizers_1);\n }\n finally { if (e_2) throw e_2.error; }\n }\n }\n if (errors) {\n throw new UnsubscriptionError(errors);\n }\n }\n };\n Subscription.prototype.add = function (teardown) {\n var _a;\n if (teardown && teardown !== this) {\n if (this.closed) {\n execFinalizer(teardown);\n }\n else {\n if (teardown instanceof Subscription) {\n if (teardown.closed || teardown._hasParent(this)) {\n return;\n }\n teardown._addParent(this);\n }\n (this._finalizers = (_a = this._finalizers) !== null && _a !== void 0 ? _a : []).push(teardown);\n }\n }\n };\n Subscription.prototype._hasParent = function (parent) {\n var _parentage = this._parentage;\n return _parentage === parent || (Array.isArray(_parentage) && _parentage.includes(parent));\n };\n Subscription.prototype._addParent = function (parent) {\n var _parentage = this._parentage;\n this._parentage = Array.isArray(_parentage) ? (_parentage.push(parent), _parentage) : _parentage ? [_parentage, parent] : parent;\n };\n Subscription.prototype._removeParent = function (parent) {\n var _parentage = this._parentage;\n if (_parentage === parent) {\n this._parentage = null;\n }\n else if (Array.isArray(_parentage)) {\n arrRemove(_parentage, parent);\n }\n };\n Subscription.prototype.remove = function (teardown) {\n var _finalizers = this._finalizers;\n _finalizers && arrRemove(_finalizers, teardown);\n if (teardown instanceof Subscription) {\n teardown._removeParent(this);\n }\n };\n Subscription.EMPTY = (function () {\n var empty = new Subscription();\n empty.closed = true;\n return empty;\n })();\n return Subscription;\n}());\nexport { Subscription };\nexport var EMPTY_SUBSCRIPTION = Subscription.EMPTY;\nexport function isSubscription(value) {\n return (value instanceof Subscription ||\n (value && 'closed' in value && isFunction(value.remove) && isFunction(value.add) && isFunction(value.unsubscribe)));\n}\nfunction execFinalizer(finalizer) {\n if (isFunction(finalizer)) {\n finalizer();\n }\n else {\n finalizer.unsubscribe();\n }\n}\n//# sourceMappingURL=Subscription.js.map","export var config = {\n onUnhandledError: null,\n onStoppedNotification: null,\n Promise: undefined,\n useDeprecatedSynchronousErrorHandling: false,\n useDeprecatedNextContext: false,\n};\n//# sourceMappingURL=config.js.map","import { __read, __spreadArray } from \"tslib\";\nexport var timeoutProvider = {\n setTimeout: function (handler, timeout) {\n var args = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n args[_i - 2] = arguments[_i];\n }\n var delegate = timeoutProvider.delegate;\n if (delegate === null || delegate === void 0 ? void 0 : delegate.setTimeout) {\n return delegate.setTimeout.apply(delegate, __spreadArray([handler, timeout], __read(args)));\n }\n return setTimeout.apply(void 0, __spreadArray([handler, timeout], __read(args)));\n },\n clearTimeout: function (handle) {\n var delegate = timeoutProvider.delegate;\n return ((delegate === null || delegate === void 0 ? void 0 : delegate.clearTimeout) || clearTimeout)(handle);\n },\n delegate: undefined,\n};\n//# sourceMappingURL=timeoutProvider.js.map","import { config } from '../config';\nimport { timeoutProvider } from '../scheduler/timeoutProvider';\nexport function reportUnhandledError(err) {\n timeoutProvider.setTimeout(function () {\n var onUnhandledError = config.onUnhandledError;\n if (onUnhandledError) {\n onUnhandledError(err);\n }\n else {\n throw err;\n }\n });\n}\n//# sourceMappingURL=reportUnhandledError.js.map","export function noop() { }\n//# sourceMappingURL=noop.js.map","import { __extends } from \"tslib\";\nimport { isFunction } from './util/isFunction';\nimport { isSubscription, Subscription } from './Subscription';\nimport { config } from './config';\nimport { reportUnhandledError } from './util/reportUnhandledError';\nimport { noop } from './util/noop';\nimport { nextNotification, errorNotification, COMPLETE_NOTIFICATION } from './NotificationFactories';\nimport { timeoutProvider } from './scheduler/timeoutProvider';\nimport { captureError } from './util/errorContext';\nvar Subscriber = (function (_super) {\n __extends(Subscriber, _super);\n function Subscriber(destination) {\n var _this = _super.call(this) || this;\n _this.isStopped = false;\n if (destination) {\n _this.destination = destination;\n if (isSubscription(destination)) {\n destination.add(_this);\n }\n }\n else {\n _this.destination = EMPTY_OBSERVER;\n }\n return _this;\n }\n Subscriber.create = function (next, error, complete) {\n return new SafeSubscriber(next, error, complete);\n };\n Subscriber.prototype.next = function (value) {\n if (this.isStopped) {\n handleStoppedNotification(nextNotification(value), this);\n }\n else {\n this._next(value);\n }\n };\n Subscriber.prototype.error = function (err) {\n if (this.isStopped) {\n handleStoppedNotification(errorNotification(err), this);\n }\n else {\n this.isStopped = true;\n this._error(err);\n }\n };\n Subscriber.prototype.complete = function () {\n if (this.isStopped) {\n handleStoppedNotification(COMPLETE_NOTIFICATION, this);\n }\n else {\n this.isStopped = true;\n this._complete();\n }\n };\n Subscriber.prototype.unsubscribe = function () {\n if (!this.closed) {\n this.isStopped = true;\n _super.prototype.unsubscribe.call(this);\n this.destination = null;\n }\n };\n Subscriber.prototype._next = function (value) {\n this.destination.next(value);\n };\n Subscriber.prototype._error = function (err) {\n try {\n this.destination.error(err);\n }\n finally {\n this.unsubscribe();\n }\n };\n Subscriber.prototype._complete = function () {\n try {\n this.destination.complete();\n }\n finally {\n this.unsubscribe();\n }\n };\n return Subscriber;\n}(Subscription));\nexport { Subscriber };\nvar _bind = Function.prototype.bind;\nfunction bind(fn, thisArg) {\n return _bind.call(fn, thisArg);\n}\nvar ConsumerObserver = (function () {\n function ConsumerObserver(partialObserver) {\n this.partialObserver = partialObserver;\n }\n ConsumerObserver.prototype.next = function (value) {\n var partialObserver = this.partialObserver;\n if (partialObserver.next) {\n try {\n partialObserver.next(value);\n }\n catch (error) {\n handleUnhandledError(error);\n }\n }\n };\n ConsumerObserver.prototype.error = function (err) {\n var partialObserver = this.partialObserver;\n if (partialObserver.error) {\n try {\n partialObserver.error(err);\n }\n catch (error) {\n handleUnhandledError(error);\n }\n }\n else {\n handleUnhandledError(err);\n }\n };\n ConsumerObserver.prototype.complete = function () {\n var partialObserver = this.partialObserver;\n if (partialObserver.complete) {\n try {\n partialObserver.complete();\n }\n catch (error) {\n handleUnhandledError(error);\n }\n }\n };\n return ConsumerObserver;\n}());\nvar SafeSubscriber = (function (_super) {\n __extends(SafeSubscriber, _super);\n function SafeSubscriber(observerOrNext, error, complete) {\n var _this = _super.call(this) || this;\n var partialObserver;\n if (isFunction(observerOrNext) || !observerOrNext) {\n partialObserver = {\n next: (observerOrNext !== null && observerOrNext !== void 0 ? observerOrNext : undefined),\n error: error !== null && error !== void 0 ? error : undefined,\n complete: complete !== null && complete !== void 0 ? complete : undefined,\n };\n }\n else {\n var context_1;\n if (_this && config.useDeprecatedNextContext) {\n context_1 = Object.create(observerOrNext);\n context_1.unsubscribe = function () { return _this.unsubscribe(); };\n partialObserver = {\n next: observerOrNext.next && bind(observerOrNext.next, context_1),\n error: observerOrNext.error && bind(observerOrNext.error, context_1),\n complete: observerOrNext.complete && bind(observerOrNext.complete, context_1),\n };\n }\n else {\n partialObserver = observerOrNext;\n }\n }\n _this.destination = new ConsumerObserver(partialObserver);\n return _this;\n }\n return SafeSubscriber;\n}(Subscriber));\nexport { SafeSubscriber };\nfunction handleUnhandledError(error) {\n if (config.useDeprecatedSynchronousErrorHandling) {\n captureError(error);\n }\n else {\n reportUnhandledError(error);\n }\n}\nfunction defaultErrorHandler(err) {\n throw err;\n}\nfunction handleStoppedNotification(notification, subscriber) {\n var onStoppedNotification = config.onStoppedNotification;\n onStoppedNotification && timeoutProvider.setTimeout(function () { return onStoppedNotification(notification, subscriber); });\n}\nexport var EMPTY_OBSERVER = {\n closed: true,\n next: noop,\n error: defaultErrorHandler,\n complete: noop,\n};\n//# sourceMappingURL=Subscriber.js.map","export function identity(x) {\n return x;\n}\n//# sourceMappingURL=identity.js.map","import { __extends } from \"tslib\";\nimport { Subscriber } from '../Subscriber';\nexport function createOperatorSubscriber(destination, onNext, onComplete, onError, onFinalize) {\n return new OperatorSubscriber(destination, onNext, onComplete, onError, onFinalize);\n}\nvar OperatorSubscriber = (function (_super) {\n __extends(OperatorSubscriber, _super);\n function OperatorSubscriber(destination, onNext, onComplete, onError, onFinalize, shouldUnsubscribe) {\n var _this = _super.call(this, destination) || this;\n _this.onFinalize = onFinalize;\n _this.shouldUnsubscribe = shouldUnsubscribe;\n _this._next = onNext\n ? function (value) {\n try {\n onNext(value);\n }\n catch (err) {\n destination.error(err);\n }\n }\n : _super.prototype._next;\n _this._error = onError\n ? function (err) {\n try {\n onError(err);\n }\n catch (err) {\n destination.error(err);\n }\n finally {\n this.unsubscribe();\n }\n }\n : _super.prototype._error;\n _this._complete = onComplete\n ? function () {\n try {\n onComplete();\n }\n catch (err) {\n destination.error(err);\n }\n finally {\n this.unsubscribe();\n }\n }\n : _super.prototype._complete;\n return _this;\n }\n OperatorSubscriber.prototype.unsubscribe = function () {\n var _a;\n if (!this.shouldUnsubscribe || this.shouldUnsubscribe()) {\n var closed_1 = this.closed;\n _super.prototype.unsubscribe.call(this);\n !closed_1 && ((_a = this.onFinalize) === null || _a === void 0 ? void 0 : _a.call(this));\n }\n };\n return OperatorSubscriber;\n}(Subscriber));\nexport { OperatorSubscriber };\n//# sourceMappingURL=OperatorSubscriber.js.map","import { operate } from '../util/lift';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\nexport function map(project, thisArg) {\n return operate(function (source, subscriber) {\n var index = 0;\n source.subscribe(createOperatorSubscriber(subscriber, function (value) {\n subscriber.next(project.call(thisArg, value, index++));\n }));\n });\n}\n//# sourceMappingURL=map.js.map","import { identity } from '../util/identity';\nimport { operate } from '../util/lift';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\nexport function distinctUntilChanged(comparator, keySelector) {\n if (keySelector === void 0) { keySelector = identity; }\n comparator = comparator !== null && comparator !== void 0 ? comparator : defaultCompare;\n return operate(function (source, subscriber) {\n var previousKey;\n var first = true;\n source.subscribe(createOperatorSubscriber(subscriber, function (value) {\n var currentKey = keySelector(value);\n if (first || !comparator(previousKey, currentKey)) {\n first = false;\n previousKey = currentKey;\n subscriber.next(value);\n }\n }));\n });\n}\nfunction defaultCompare(a, b) {\n return a === b;\n}\n//# sourceMappingURL=distinctUntilChanged.js.map","'use strict';\n\nimport {BehaviorSubject, Observable} from 'rxjs';\nimport {distinctUntilChanged, map} from 'rxjs/operators';\n\nimport {Tools} from '../../tools/tools';\n\nimport {OgmaState} from './reactive';\n\nexport class OgmaStore extends BehaviorSubject<OgmaState> {\n constructor(d: OgmaState) {\n super(d);\n }\n\n /**\n * Modify Ogma state based on a method\n */\n public dispatch(mapFn: (state: OgmaState) => OgmaState): void {\n this.next(mapFn(this.value));\n }\n\n /**\n * Return a piece of state\n */\n public selectStore<K>(mapFn: (state: OgmaState) => K): Observable<K> {\n return this.pipe(\n map(mapFn),\n distinctUntilChanged((p, n) => Tools.isEqual(p, n))\n );\n }\n\n /**\n * Clear the state of Ogma\n */\n public clear(): void {\n this.next({\n selection: undefined,\n items: {node: [], edge: []},\n changes: undefined,\n animation: false\n });\n }\n}\n","'use strict';\n\nimport Ogma, {NodeList, EdgeList} from '@linkurious/ogma';\nimport {LkEdgeData, LkNodeData} from '@linkurious/rest-client';\n\nimport {LKOgma} from '../index';\n\nimport {OgmaStore} from './OgmaStore';\n\nexport interface OgmaState {\n selection: NodeList<LkNodeData, LkEdgeData> | EdgeList<LkEdgeData, LkNodeData> | undefined;\n items: {node: Array<string | number>; edge: Array<string | number>};\n changes: {entityType: 'node' | 'edge'; input: string | string[] | null; value: any} | undefined;\n /**\n * Indicates whether the positions of nodes or edges are currently transitioning.\n */\n animation: boolean;\n}\n\nexport class RxViz {\n private _ogma: Ogma;\n private _store: OgmaStore = new OgmaStore({\n selection: undefined,\n items: {node: [], edge: []},\n changes: undefined,\n animation: false\n });\n private _animationThrottle: any;\n\n constructor(ogma: LKOgma) {\n this._ogma = ogma;\n this.listenToSelectionEvents();\n }\n\n public get store(): OgmaStore {\n return this._store;\n }\n\n /**\n * Listen to ogma events and update the state\n */\n public listenToSelectionEvents(): void {\n let currentAnimationEnd = Date.now();\n let isCurrentlyAnimating = false;\n this._ogma.events.on('animate', (e: {duration: number; updatesPositions: boolean}) => {\n if (e.updatesPositions === false) {\n // ignore animations that don't change the node/edge positions, e.g: Hover\n return;\n }\n if (!isCurrentlyAnimating) {\n isCurrentlyAnimating = true;\n this._store.dispatch((state) => ({...state, animation: true}));\n }\n const nextAnimationEnd = Math.max(currentAnimationEnd, Date.now() + e.duration);\n if (nextAnimationEnd === currentAnimationEnd) {\n // Say animation 2 fires after animation 1 but has a much shorter duration\n // In such a way that animation 1 will still complete after animation 2\n // In that case we can safely ignore animation 2\n return;\n }\n currentAnimationEnd = nextAnimationEnd;\n const safeAnimationTimeoutMs = currentAnimationEnd - Date.now() + 16; // animation duration + duration of a single frame at 60 fps = 16ms\n clearTimeout(this._animationThrottle);\n this._animationThrottle = setTimeout(() => {\n isCurrentlyAnimating = false;\n this._store.dispatch((state) => ({...state, animation: false}));\n }, safeAnimationTimeoutMs);\n });\n\n this._ogma.events.on('dragStart', () => {\n this._store.dispatch((state) => ({...state, animation: true}));\n });\n\n this._ogma.events.on('dragEnd', () => {\n this._store.dispatch((state) => ({...state, animation: false}));\n });\n\n this._ogma.events.on('addNodes', () => {\n this._store.dispatch(this.storeItems.bind(this));\n });\n this._ogma.events.on('removeNodes', () => {\n this._store.dispatch(this.storeItems.bind(this));\n });\n this._ogma.events.on('addEdges', () => {\n this._store.dispatch(this.storeItems.bind(this));\n });\n this._ogma.events.on('removeEdges', () => {\n this._store.dispatch(this.storeItems.bind(this));\n });\n this._ogma.events.on('geoDisabled', () => {\n this._store.dispatch(this.storeItems.bind(this));\n });\n this._ogma.events.on('geoEnabled', () => {\n this._store.dispatch(this.storeItems.bind(this));\n });\n\n this._ogma.events.on('nodesSelected', () => {\n this._store.dispatch(this.storeNodeSelection.bind(this));\n });\n\n this._ogma.events.on('edgesSelected', () => {\n this._store.dispatch(this.storeEdgeSelection.bind(this));\n });\n\n this._ogma.events.on('nodesUnselected', () => {\n this._store.dispatch(this.storeNodeSelection.bind(this));\n });\n\n this._ogma.events.on('edgesUnselected', () => {\n this._store.dispatch(this.storeEdgeSelection.bind(this));\n });\n\n this._ogma.events.on('updateNodeData', (evt) => {\n if (evt !== undefined) {\n evt.changes.forEach((change) => {\n this._store.dispatch((state) => ({\n ...state,\n changes: {\n entityType: 'node',\n input: change.property,\n value: change.newValues[0]\n }\n }));\n });\n }\n });\n\n this._ogma.events.on('updateEdgeData', (evt) => {\n if (evt !== undefined) {\n evt.changes.forEach((change) => {\n this._store.dispatch((state) => ({\n ...state,\n changes: {\n entityType: 'edge',\n input: change.property,\n value: change.newValues[0]\n }\n }));\n });\n }\n });\n }\n\n /**\n * Store new items in state\n */\n private storeItems(state: OgmaState): OgmaState {\n return {\n ...state,\n items: {\n node: this._ogma.getNodes().getId(),\n edge: this._ogma.getEdges().getId()\n }\n };\n }\n\n /**\n * Store new node selection in state\n */\n private storeNodeSelection(state: OgmaState): OgmaState {\n return {\n ...state,\n selection: this._ogma.getSelectedNodes()\n };\n }\n\n /**\n * store new edge selection in state\n */\n private storeEdgeSelection(state: OgmaState): OgmaState {\n return {\n ...state,\n selection: this._ogma.getSelectedEdges()\n };\n }\n}\n","import {\n EntityType,\n ForceLayoutMode,\n HierarchicalLayoutMode,\n IOgmaConfig,\n LkEdgeData,\n LkNodeData,\n PopulatedVisualization,\n VizEdge,\n VizNode\n} from '@linkurious/rest-client';\nimport Ogma, {\n EdgeList,\n ForceLayoutOptions,\n HierarchicalLayoutOptions,\n NodeId,\n NodeList,\n NonObjectPropertyWatcher,\n RadialLayoutOptions,\n RawEdge,\n RawGraph,\n RawNode\n} from '@linkurious/ogma';\n\nimport {StyleRules} from '..';\nimport {Tools} from '../tools/tools';\n\nimport {StylesViz} from './features/styles';\nimport {TransformationsViz} from './features/transformations';\nimport {CaptionsViz} from './features/captions';\nimport {RxViz} from './features/reactive';\nimport {OgmaStore} from './features/OgmaStore';\nimport {NodeGroupingTransformation} from './features/nodeGrouping';\n\nexport {default as Ogma} from '@linkurious/ogma';\nexport const ANIMATION_DURATION = 750;\n\ninterface AddItemOptions {\n batchSize?: number;\n virtual?: boolean;\n}\n\nexport class LKOgma extends Ogma<LkNodeData, LkEdgeData> {\n public LKStyles!: StylesViz;\n public LKCaptions!: CaptionsViz;\n public LKTransformation!: TransformationsViz;\n // Trigger an event with node category changes\n public nodeCategoriesWatcher!: NonObjectPropertyWatcher<LkNodeData, LkEdgeData>;\n // Trigger an event with edge type changes\n public edgeTypeWatcher!: NonObjectPropertyWatcher<LkNodeData, LkEdgeData>;\n public store!: OgmaStore;\n // Node Grouping transformation instance\n public LkNodeGroupingTransformation!: NodeGroupingTransformation;\n private _reactive!: RxViz;\n\n constructor(\n private _configuration: IOgmaConfig,\n _baseUrl?: string\n ) {\n // set Ogma global configuration\n super(_configuration);\n Object.setPrototypeOf(this, new.target.prototype);\n this.initOgmaLinkuriousParser(true, _baseUrl);\n }\n\n /**\n * Initialize the Ogma instance with the configuration and the base url\n * @param init used to know if the instance is initialized for the first time (used in setConfigOgma)\n * @param baseUrl base url used for relative image urls\n * @private\n */\n private initOgmaLinkuriousParser(init?: boolean, baseUrl?: string): void {\n this.nodeCategoriesWatcher = this.schema.watchNodeNonObjectProperty({\n path: 'categories',\n unwindArrays: true,\n filter: 'all'\n });\n this.edgeTypeWatcher = this.schema.watchEdgeNonObjectProperty({\n path: 'type',\n filter: 'all'\n });\n // set ogma max zoom value and selection with mouse option (false?)\n this.setOptions({\n interactions: {\n zoom: {\n maxValue: (params) => {\n return 128 / params.smallestNodeSize;\n }\n },\n selection: {\n enabled: false\n }\n }\n });\n\n // only instantiate the store once when app is starting\n if (this._reactive === undefined) {\n this._reactive = new RxViz(this);\n this.store = this._reactive.store;\n } else {\n // if store already exist, but ogma was reset, create new ogma event listener\n this._reactive.listenToSelectionEvents();\n }\n this.initSelection();\n this.setConfigOgma(this._configuration, init, baseUrl);\n this.LKTransformation = new TransformationsViz(this);\n this.LkNodeGroupingTransformation = new NodeGroupingTransformation(this);\n\n this.LKStyles.setNodesDefaultHalo();\n this.LKStyles.setEdgesDefaultHalo();\n this.LKStyles.setBadgeRule();\n this.LKStyles.setFilterClass();\n }\n\n /**\n * Initialize selection behavior\n */\n public initSelection(): void {\n this.events.onClick((e) => {\n if (e !== undefined && e.button === 'left') {\n if (e.target !== null) {\n const multiSelectionKey = navigator.platform === 'MacIntel' ? 'cmd' : 'ctrl';\n if (this.keyboard.isKeyPressed(multiSelectionKey)) {\n if (e.target.isNode && this.getSelectedEdges().size > 0) {\n this.getSelectedEdges().setSelected(false);\n }\n if (!e.target.isNode && this.getSelectedNodes().size > 0) {\n this.getSelectedNodes().setSelected(false);\n }\n if (e.target.isSelected()) {\n e.target.setSelected(false);\n } else {\n e.target.setSelected(true);\n }\n } else {\n this.getSelectedNodes().setSelected(false);\n this.getSelectedEdges().setSelected(false);\n e.target.setSelected(true);\n }\n } else {\n this.getSelectedNodes().setSelected(false);\n this.getSelectedEdges().setSelected(false);\n }\n }\n });\n }\n\n private setStyles(configuration: IOgmaConfig, baseUrl?: string): void {\n this.LKStyles = new StylesViz(this, {\n node: configuration?.options?.styles?.node || {},\n edge: configuration?.options?.styles?.edge || {},\n baseUrl: baseUrl\n });\n this.LKStyles.setNodesDefaultStyles();\n this.LKStyles.setEdgesDefaultStyles();\n }\n\n private setCaptions(configuration: IOgmaConfig): void {\n const nodeMaxTextLength = configuration?.options?.styles?.node?.text?.maxTextLength;\n const edgeMaxTextLength = configuration?.options?.styles?.edge?.text?.maxTextLength;\n this.LKCaptions = new CaptionsViz(this, nodeMaxTextLength, edgeMaxTextLength);\n }\n\n /**\n * Returns Ogma Layout parameters according to visualization layout settings\n * */\n public getForceLayoutParams(mode: ForceLayoutMode, duration = 0): ForceLayoutOptions {\n let dynamicSteps = 300 - ((300 - 40) / 5000) * this.getNodes().size;\n if (dynamicSteps < 40) {\n dynamicSteps = 40;\n }\n return {\n steps: mode === ForceLayoutMode.FAST ? dynamicSteps : 300,\n alignSiblings: this.getNodes().size > 3,\n duration: duration,\n charge: 20,\n gravity: 0.08,\n theta: this.getNodes().size > 100 ? 0.8 : 0.34\n };\n }\n\n public getRadialLayoutParams(\n rootNode: string,\n duration = 0\n ): RadialLayoutOptions<unknown, unknown> {\n return {\n centralNode: rootNode,\n radiusDelta: 1,\n nodeGap: 10,\n repulsion: this.getNodes().size > 80 ? 1 : 6,\n duration: duration\n };\n }\n\n public getHierarchicalLayoutParams(\n mode: HierarchicalLayoutMode,\n rootNode: string,\n duration = 0\n ): HierarchicalLayoutOptions {\n return {\n direction: mode,\n roots: [rootNode],\n duration: duration\n };\n }\n\n /**\n * Initialize graph.\n * add nodes and edges to the viz and init the selection.\n */\n public async init(visualization: {nodes: Array<VizNode>; edges: Array<VizEdge>}): Promise<void> {\n this.clearGraph();\n let selectedEntityType: EntityType | undefined = undefined;\n let selectedElements: Array<string> = [];\n // need to remove selected in every items before adding them to Ogma\n const fixedNodes = visualization.nodes.map((node) => {\n if (node.attributes.selected) {\n selectedEntityType = EntityType.NODE;\n selectedElements.push(node.id);\n }\n delete node.attributes.selected;\n return node;\n });\n const fixedEdges = visualization.edges.map((edge) => {\n if (edge.attributes !== undefined) {\n if (edge.attributes.selected) {\n if (selectedEntityType === undefined || selectedEntityType === EntityType.NODE) {\n selectedEntityType = EntityType.EDGE;\n selectedElements = [];\n }\n selectedElements.push(edge.id);\n }\n delete edge.attributes.selected;\n }\n return edge;\n });\n await this.addGraphAfterValidation({\n nodes: fixedNodes as Array<RawNode<LkNodeData>>,\n edges: fixedEdges as Array<RawEdge<LkEdgeData>>\n });\n if (selectedEntityType === EntityType.NODE) {\n this.getNodes(selectedElements).setSelected(true);\n } else if (selectedEntityType === EntityType.EDGE) {\n this.getEdges(selectedElements).setSelected(true);\n }\n }\n\n public async initVisualization(visualization: PopulatedVisualization): Promise<void> {\n await this.init(visualization);\n const styles = StyleRules.sanitizeStylesIndex(visualization.design.styles);\n this.LKStyles.initNodeColors(styles.node);\n this.LKStyles.initNodesIcons(styles.node);\n this.LKStyles.initNodesSizes(styles.node);\n this.LKStyles.initNodesShapes(styles.node);\n this.LKStyles.initEdgesWidth(styles.edge);\n this.LKStyles.initEdgesShape(styles.edge);\n this.LKStyles.initEdgesColor(styles.edge);\n await this.LKCaptions.initVizCaptions({\n node: visualization.nodeFields.captions || {},\n edge: visualization.edgeFields.captions || {}\n });\n this.LKTransformation.groupedEdges = visualization.edgeGrouping;\n await this.LKTransformation.initTransformation();\n this.LKTransformation.initEdgeGroupingStyle();\n }\n\n /**\n * Adding nodes then adding edges to the graph\n */\n public async addGraphAfterValidation(graph: RawGraph<LkNodeData, LkEdgeData>): Promise<{\n nodes: NodeList<LkNodeData>;\n edges: EdgeList<LkEdgeData>;\n }> {\n const addedNodes = await this.addNodes(graph.nodes);\n const addedEdges = await this.addEdges(graph.edges);\n return {\n nodes: addedNodes,\n edges: addedEdges\n };\n }\n\n /**\n * Adding edges to the graph after filtering disconnected ones\n */\n public addEdges(edges: Array<RawEdge<LkEdgeData>>, options?: AddItemOptions): Promise<EdgeList> {\n return super.addEdges(edges, {...options, ignoreInvalid: true});\n }\n\n /**\n * Return the list of non filtered nodes\n */\n public getNonFilteredNodes(items?: Array<NodeId>): NodeList<LkNodeData, LkEdgeData> {\n return Tools.isDefined(items)\n ? this.getNodes(items).filter((i) => !i.hasClass('filtered'))\n : // take only none virtual nodes\n this.getNodes('raw').filter((i) => !i.hasClass('filtered'));\n }\n\n /**\n * Return the list of filtered nodes\n * @param items items to check if they are filtered\n * @param filter type of nodes to check if they are filtered ( nodes that are visible, raw nodes (none virtual) or all nodes)\n */\n public getFilteredNodes(\n items?: Array<NodeId>,\n filter: 'visible' | 'raw' | 'all' = 'raw'\n ): NodeList<LkNodeData, LkEdgeData> {\n return Tools.isDefined(items)\n ? this.getNodes(items).filter((i) => i.hasClass('filtered'))\n : this.getNodes(filter).filter((i) => i.hasClass('filtered'));\n }\n\n /**\n * Return the list of non filtered edges\n */\n public getNonFilteredEdges(items?: Array<any>): EdgeList<LkEdgeData, LkNodeData> {\n return Tools.isDefined(items)\n ? this.getEdges(items).filter((i) => !i.hasClass('filtered'))\n : this.getEdges('raw').filter((i) => !i.hasClass('filtered'));\n }\n\n /**\n * Return the list of filtered edges\n */\n public getFilteredEdges(\n items?: Array<any>,\n filter: 'visible' | 'raw' | 'all' = 'raw'\n ): EdgeList<LkEdgeData, LkNodeData> {\n return Tools.isDefined(items)\n ? this.getEdges(items).filter((i) => i.hasClass('filtered'))\n : this.getEdges(filter).filter((i) => i.hasClass('filtered'));\n }\n\n /**\n * Do a full reset on ogma and streams of ogma\n */\n public shutDown(): void {\n this.destroy();\n if (this.store) {\n this.store.clear();\n }\n }\n\n /**\n * Reset the Ogma instance so that it can be used fresh in the next visulization\n */\n public clearOgmaState(): void {\n this.reset();\n if (this.store) {\n this.store.clear();\n }\n this.initOgmaLinkuriousParser();\n }\n\n /**\n * Updates the Ogma config when config changes in LKE. If init, options were already set by the Ogma.reset()\n */\n public setConfigOgma(configuration?: IOgmaConfig, init?: boolean, baseUrl?: string): void {\n if (configuration) {\n // here we make sure that the internal config object is updated and we have the correct one when resetting\n this._configuration = configuration;\n }\n if (!init) {\n this.setOptions({\n ...this._configuration.options,\n renderer: this._configuration.renderer\n });\n }\n this.setStyles(this._configuration, baseUrl);\n this.setCaptions(this._configuration);\n }\n}\n","import {GenericObject} from '@linkurious/rest-client';\n\nexport const HTML_COLORS: GenericObject<{hex: string; rgb: string}> = {\n lightsalmon: {hex: '#FFA07A', rgb: 'rbg(255,160,122)'},\n salmon: {hex: '#FA8072', rgb: 'rgb(250,128,114)'},\n darksalmon: {hex: '#E9967A', rgb: 'rgb(233,150,122)'},\n lightcoral: {hex: '#F08080', rgb: 'rgb(240,128,128)'},\n indianred: {hex: '#CD5C5C', rgb: 'rgb(205,92,92)'},\n crimson: {hex: '#DC143C', rgb: 'rgb(220,20,60)'},\n firebrick: {hex: '#B22222', rgb: 'rgb(178,34,34)'},\n red: {hex: '#FF0000', rgb: 'rgb(255,0,0)'},\n darkred: {hex: '#8B0000', rgb: 'rgb(139,0,0)'},\n coral: {hex: '#FF7F50', rgb: 'rgb(255,127,80)'},\n tomato: {hex: '#FF6347', rgb: 'rgb(255,99,71)'},\n orangered: {hex: '#FF4500', rgb: 'rgb(255,69,0)'},\n gold: {hex: '#FFD700', rgb: 'rgb(255,215,0)'},\n orange: {hex: '#FFA500', rgb: 'rgb(255,165,0)'},\n darkorange: {hex: '#FF8C00', rgb: 'rgb(255,140,0)'},\n lightyellow: {hex: '#FFFFE0', rgb: 'rgb(255,255,224)'},\n lemonchiffon: {hex: '#FFFACD', rgb: 'rgb(255,250,205)'},\n lightgoldenrodyellow: {hex: '#FAFAD2', rgb: 'rgb(250,250,210)'},\n papayawhip: {hex: '#FFEFD5', rgb: 'rgb(255,239,213)'},\n moccasin: {hex: '#FFE4B5', rgb: 'rgb(255,228,181)'},\n peachpuff: {hex: '#FFDAB9', rgb: 'rgb(255,218,185)'},\n palegoldenrod: {hex: '#EEE8AA', rgb: 'rgb(238,232,170)'},\n khaki: {hex: '#F0E68C', rgb: 'rgb(240,230,140)'},\n darkkhaki: {hex: '#BDB76B', rgb: 'rgb(189,183,107)'},\n yellow: {hex: '#FFFF00', rgb: 'rgb(255,255,0)'},\n lawngreen: {hex: '#7CFC00', rgb: 'rgb(124,252,0)'},\n chartreuse: {hex: '#7FFF00', rgb: 'rgb(127,255,0)'},\n limegreen: {hex: '#32CD32', rgb: 'rgb(50,205,50)'},\n lime: {hex: '#00FF00', rgb: 'rgb(0.255.0)'},\n forestgreen: {hex: '#228B22', rgb: 'rgb(34,139,34)'},\n green: {hex: '#008000', rgb: 'rgb(0,128,0)'},\n darkgreen: {hex: '#006400', rgb: 'rgb(0,100,0)'},\n greenyellow: {hex: '#ADFF2F', rgb: 'rgb(173,255,47)'},\n yellowgreen: {hex: '#9ACD32', rgb: 'rgb(154,205,50)'},\n springgreen: {hex: '#00FF7F', rgb: 'rgb(0,255,127)'},\n mediumspringgreen: {hex: '#00FA9A', rgb: 'rgb(0,250,154)'},\n lightgreen: {hex: '#90EE90', rgb: 'rgb(144,238,144)'},\n palegreen: {hex: '#98FB98', rgb: 'rgb(152,251,152)'},\n darkseagreen: {hex: '#8FBC8F', rgb: 'rgb(143,188,143)'},\n mediumseagreen: {hex: '#3CB371', rgb: 'rgb(60,179,113)'},\n seagreen: {hex: '#2E8B57', rgb: 'rgb(46,139,87)'},\n olive: {hex: '#808000', rgb: 'rgb(128,128,0)'},\n darkolivegreen: {hex: '#556B2F', rgb: 'rgb(85,107,47)'},\n olivedrab: {hex: '#6B8E23', rgb: 'rgb(107,142,35)'},\n lightcyan: {hex: '#E0FFFF', rgb: 'rgb(224,255,255)'},\n cyan: {hex: '#00FFFF', rgb: 'rgb(0,255,255)'},\n aqua: {hex: '#00FFFF', rgb: 'rgb(0,255,255)'},\n aquamarine: {hex: '#7FFFD4', rgb: 'rgb(127,255,212)'},\n mediumaquamarine: {hex: '#66CDAA', rgb: 'rgb(102,205,170)'},\n paleturquoise: {hex: '#AFEEEE', rgb: 'rgb(175,238,238)'},\n turquoise: {hex: '#40E0D0', rgb: 'rgb(64,224,208)'},\n mediumturquoise: {hex: '#48D1CC', rgb: 'rgb(72,209,204)'},\n darkturquoise: {hex: '#00CED1', rgb: 'rgb(0,206,209)'},\n lightseagreen: {hex: '#20B2AA', rgb: 'rgb(32,178,170)'},\n cadetblue: {hex: '#5F9EA0', rgb: 'rgb(95,158,160)'},\n darkcyan: {hex: '#008B8B', rgb: 'rgb(0,139,139)'},\n teal: {hex: '#008080', rgb: 'rgb(0,128,128)'},\n powderblue: {hex: '#B0E0E6', rgb: 'rgb(176,224,230)'},\n lightblue: {hex: '#ADD8E6', rgb: 'rgb(173,216,230)'},\n lightskyblue: {hex: '#87CEFA', rgb: 'rgb(135,206,250)'},\n skyblue: {hex: '#87CEEB', rgb: 'rgb(135,206,235)'},\n deepskyblue: {hex: '#00BFFF', rgb: 'rgb(0,191,255)'},\n lightsteelblue: {hex: '#B0C4DE', rgb: 'rgb(176,196,222)'},\n dodgerblue: {hex: '#1E90FF', rgb: 'rgb(30,144,255)'},\n cornflowerblue: {hex: '#6495ED', rgb: 'rgb(100,149,237)'},\n steelblue: {hex: '#4682B4', rgb: 'rgb(70,130,180)'},\n royalblue: {hex: '#4169E1', rgb: 'rgb(65,105,225)'},\n blue: {hex: '#0000FF', rgb: 'rgb(0,0,255)'},\n mediumblue: {hex: '#0000CD', rgb: 'rgb(0,0,205)'},\n darkblue: {hex: '#00008B', rgb: 'rgb(0,0,139)'},\n navy: {hex: '#000080', rgb: 'rgb(0,0,128)'},\n midnightblue: {hex: '#191970', rgb: 'rgb(25,25,112)'},\n mediumslateblue: {hex: '#7B68EE', rgb: 'rgb(123,104,238)'},\n slateblue: {hex: '#6A5ACD', rgb: 'rgb(106,90,205)'},\n darkslateblue: {hex: '#483D8B', rgb: 'rgb(72,61,139)'},\n lavender: {hex: '#E6E6FA', rgb: 'rgb(230,230,250)'},\n thistle: {hex: '#D8BFD8', rgb: 'rgb(216,191,216)'},\n plum: {hex: '#DDA0DD', rgb: 'rgb(221,160,221)'},\n violet: {hex: '#EE82EE', rgb: 'rgb(238,130,238)'},\n orchid: {hex: '#DA70D6', rgb: 'rgb(218,112,214)'},\n fuchsia: {hex: '#FF00FF', rgb: 'rgb(255,0,255)'},\n magenta: {hex: '#FF00FF', rgb: 'rgb(255,0,255)'},\n mediumorchid: {hex: '#BA55D3', rgb: 'rgb(186,85,211)'},\n mediumpurple: {hex: '#9370DB', rgb: 'rgb(147,112,219)'},\n blueviolet: {hex: '#8A2BE2', rgb: 'rgb(138,43,226)'},\n darkviolet: {hex: '#9400D3', rgb: 'rgb(148,0,211)'},\n darkorchid: {hex: '#9932CC', rgb: 'rgb(153,50,204)'},\n darkmagenta: {hex: '#8B008B', rgb: 'rgb(139,0,139)'},\n purple: {hex: '#800080', rgb: 'rgb(128,0,128)'},\n indigo: {hex: '#4B0082', rgb: 'rgb(75,0,130)'},\n pink: {hex: '#FFC0CB', rgb: 'rgb(255,192,203)'},\n lightpink: {hex: '#FFB6C1', rgb: 'rgb(255,182,193)'},\n hotpink: {hex: '#FF69B4', rgb: 'rgb(255,105,180)'},\n deeppink: {hex: '#FF1493', rgb: 'rgb(255,20,147)'},\n palevioletred: {hex: '#DB7093', rgb: 'rgb(219,112,147)'},\n mediumvioletred: {hex: '#C71585', rgb: 'rgb(199,21,133)'},\n white: {hex: '#FFFFFF', rgb: 'rgb(255,255,255)'},\n snow: {hex: '#FFFAFA', rgb: 'rgb(255,250,250)'},\n honeydew: {hex: '#F0FFF0', rgb: 'rgb(240,255,240)'},\n mintcream: {hex: '#F5FFFA', rgb: 'rgb(245,255,250)'},\n azure: {hex: '#F0FFFF', rgb: 'rgb(240,255,255)'},\n aliceblue: {hex: '#F0F8FF', rgb: 'rgb(240,248,255)'},\n ghostwhite: {hex: '#F8F8FF', rgb: 'rgb(248,248,255)'},\n whitesmoke: {hex: '#F5F5F5', rgb: 'rgb(245,245,245)'},\n seashell: {hex: '#FFF5EE', rgb: 'rgb(255,245,238)'},\n beige: {hex: '#F5F5DC', rgb: 'rgb(245,245,220)'},\n oldlace: {hex: '#FDF5E6', rgb: 'rgb(253,245,230)'},\n floralwhite: {hex: '#FFFAF0', rgb: 'rgb(255,250,240)'},\n ivory: {hex: '#FFFFF0', rgb: 'rgb(255,255,240)'},\n antiquewhite: {hex: '#FAEBD7', rgb: 'rgb(250,235,215)'},\n linen: {hex: '#FAF0E6', rgb: 'rgb(250,240,230)'},\n lavenderblush: {hex: '#FFF0F5', rgb: 'rgb(255,240,245)'},\n mistyrose: {hex: '#FFE4E1', rgb: 'rgb(255,228,225)'},\n gainsboro: {hex: '#DCDCDC', rgb: 'rgb(220,220,220)'},\n lightgray: {hex: '#D3D3D3', rgb: 'rgb(211,211,211)'},\n silver: {hex: '#C0C0C0', rgb: 'rgb(192,192,192)'},\n darkgray: {hex: '#A9A9A9', rgb: 'rgb(169,169,169)'},\n gray: {hex: '#808080', rgb: 'rgb(128,128,128)'},\n dimgray: {hex: '#696969', rgb: 'rgb(105,105,105)'},\n lightslategray: {hex: '#778899', rgb: 'rgb(119,136,153)'},\n slategray: {hex: '#708090', rgb: 'rgb(112,128,144)'},\n darkslategray: {hex: '#2F4F4F', rgb: 'rgb(47,79,79)'},\n black: {hex: '#000000', rgb: 'rgb(0,0,0)'},\n cornsilk: {hex: '#FFF8DC', rgb: 'rgb(255,248,220)'},\n blanchedalmond: {hex: '#FFEBCD', rgb: 'rgb(255,235,205)'},\n bisque: {hex: '#FFE4C4', rgb: 'rgb(255,228,196)'},\n navajowhite: {hex: '#FFDEAD', rgb: 'rgb(255,222,173)'},\n wheat: {hex: '#F5DEB3', rgb: 'rgb(245,222,179)'},\n burlywood: {hex: '#DEB887', rgb: 'rgb(222,184,135)'},\n tan: {hex: '#D2B48C', rgb: 'rgb(210,180,140)'},\n rosybrown: {hex: '#BC8F8F', rgb: 'rgb(188,143,143)'},\n sandybrown: {hex: '#F4A460', rgb: 'rgb(244,164,96)'},\n goldenrod: {hex: '#DAA520', rgb: 'rgb(218,165,32)'},\n peru: {hex: '#CD853F', rgb: 'rgb(205,133,63)'},\n chocolate: {hex: '#D2691E', rgb: 'rgb(210,105,30)'},\n saddlebrown: {hex: '#8B4513', rgb: 'rgb(139,69,19)'},\n sienna: {hex: '#A0522D', rgb: 'rgb(160,82,45)'},\n brown: {hex: '#A52A2A', rgb: 'rgb(165,42,42)'},\n maroon: {hex: '#800000', rgb: 'rgb(128,0,0)'}\n};\n","import {Color, NodeList, Node, EdgeList, Edge, NodeId} from '@linkurious/ogma';\nimport {LkEdgeData, LkNodeData} from '@linkurious/rest-client';\n\nimport {ANIMATION_DURATION} from '../ogma';\n\nimport {Tools} from './tools';\nimport {HTML_COLORS} from './colorPalette';\n\nexport const FORCE_LAYOUT_CONFIG = {\n steps: 250,\n alignSiblings: true,\n charge: 20,\n theta: 0.34,\n duration: ANIMATION_DURATION,\n gravity: 0.0475\n};\n\nexport class OgmaTools {\n /**\n * Get the amount of hidden neighbors from a list of nodes\n *\n * @param nodes\n */\n public static getHiddenNeighbors(nodes: NodeList<LkNodeData, LkEdgeData>): number {\n return nodes.reduce((result: number, node: Node<LkNodeData, LkEdgeData>) => {\n const statistics = node.getData('statistics');\n if (statistics !== undefined) {\n const hiddenNeighbors =\n statistics.degree !== undefined && !statistics.supernode\n ? statistics.degree - Tools.getDegreeWithoutSelfConnection(node)\n : statistics.supernodeDegree;\n if (hiddenNeighbors !== undefined && hiddenNeighbors > 0) {\n return (result += hiddenNeighbors);\n }\n }\n return result;\n }, 0);\n }\n\n /**\n * Return the visible degree of a node without self connection (self edge)\n *\n * @param {Node} node\n * @return {number}\n */\n public static getDegreeWithoutSelfConnection(node: Node<LkNodeData, LkEdgeData>): number {\n return node.getAdjacentNodes({policy: 'exclude-sources', filter: 'all'}).size;\n }\n\n /**\n * Return true if the color tone is \"bright\"\n *\n * @param {string} color\n * @returns {boolean}\n */\n public static isBright(color: Color): boolean {\n if (color === null || !Tools.isStringFilled(color)) {\n return true;\n }\n const hexRegExp = /#[A-Fa-f0-9]{3,6}/;\n const rgbRegExp =\n /^rgb\\(\\s*([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\s*,\\s*([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\s*,\\s*([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\s*\\)$/i;\n const rgbaRegExp =\n /^rgba\\(\\s*([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\s*,\\s*([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\s*,\\s*([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\s*,\\s*(?:0|1|0?\\.\\d+)\\s*\\)$/i;\n let rgb: string;\n\n if (hexRegExp.test(color)) {\n if (color.length < 5) {\n color += color.slice(1);\n }\n color = color.replace('#', '');\n const r = parseInt(color[0].toString() + color[1].toString(), 16);\n const g = parseInt(color[2].toString() + color[3].toString(), 16);\n const b = parseInt(color[4].toString() + color[5].toString(), 16);\n rgb = `rgb(${r}, ${g}, ${b})`;\n } else if (\n rgbRegExp.test(color) ||\n rgbaRegExp.test(color) ||\n HTML_COLORS[color.toLowerCase()] !== undefined\n ) {\n rgb = Tools.isDefined(HTML_COLORS[color.toLowerCase()])\n ? HTML_COLORS[color.toLowerCase()]['rgb']\n : color;\n } else {\n return true;\n }\n\n const [r, g, b] = /rgba?\\((\\d{1,3}),(\\d{1,3}),(\\d{1,3})(,\\d{1,3})?\\)/\n .exec(rgb.replace(/\\s/g, ''))!\n .slice(1, 4);\n\n if (!Tools.isDefined(r) || !Tools.isDefined(g) || !Tools.isDefined(b)) {\n console.warn('The given color is not a valid rgb formatted color');\n return true;\n }\n return (+r * 299 + +g * 587 + +b * 114) / 1000 > 255 * 0.7;\n }\n\n public static isNode(\n item: Node<LkNodeData, LkEdgeData> | Edge<LkEdgeData, LkNodeData>\n ): item is Node<LkNodeData, LkEdgeData> {\n return item.isNode;\n }\n\n public static isNodeList(\n items: NodeList<LkNodeData, LkEdgeData> | EdgeList<LkEdgeData, LkNodeData>\n ): items is NodeList<LkNodeData, LkEdgeData> {\n return items.isNode;\n }\n\n /**\n * Transform a nodelist to an array of node ids sorted by position in a chain and the length of the chain\n * A chain is: (a)-(b)-(c)-(d)\n */\n public static topologicalSort(nodes: NodeList): {chain: NodeId[]; numberOfChain: number} {\n const nodesArray = nodes.toArray();\n const startOfChains = nodesArray.filter((n) => n.getDegree() === 1);\n const visited = new Set();\n const stacks: Node[][] = [];\n startOfChains.forEach((node) => {\n let currentNode: Node<LkNodeData, LkEdgeData> | null = node;\n if (visited.has(currentNode)) {\n return;\n }\n const stack = [];\n while (currentNode) {\n stack.push(currentNode);\n visited.add(currentNode);\n\n const nextNode = currentNode\n .getAdjacentNodes()\n .filter((neighbor) => !visited.has(neighbor))\n .get(0);\n currentNode = nextNode === undefined ? null : nextNode;\n }\n stacks.push(stack);\n });\n stacks.sort((a, b) => b.length - a.length);\n return {chain: stacks.flat().map((n) => n.getId()), numberOfChain: startOfChains.length / 2};\n }\n\n public static isStar(nodes: NodeList) {\n for (const node of nodes.toArray()) {\n const adjacent = node.getAdjacentNodes();\n const isStar = node.getDegree() > 2 && adjacent.getDegree().every((d) => d === 1);\n if (isStar && adjacent.size + 1 === nodes.size) return node;\n }\n return false;\n }\n\n /**\n * Return true if the group is collapsed\n */\n public static isGroupCollapsed(node: Node): boolean {\n return node.getData('collapsed') as boolean;\n }\n\n public static setCollapsedGroupProperty(node: Node<LkNodeData>, collapsed: boolean): void {\n node.setData('collapsed', collapsed);\n }\n}\n","import {Node, NodeList, PixelSize, Point, StyleRule, Transformation} from '@linkurious/ogma';\nimport {\n IVizNodeGroupInfo,\n LkEdgeData,\n LkNodeData,\n MissingValue,\n NodeGroupingByAdjacentEdgeType,\n NodeGroupingByPropertyValue,\n NodeGroupingRule,\n NodeGroupingType\n} from '@linkurious/rest-client';\nimport sha1 from 'sha1';\n\nimport {LKOgma} from '../index';\nimport {Tools} from '../../tools/tools';\nimport {FORCE_LAYOUT_CONFIG, OgmaTools} from '../../tools/ogmaTool';\n\nimport {CLEAR_FONT_COLOR, DEFAULT_OGMA_FONT} from './styles';\n\nexport const LKE_NODE_GROUPING_EDGE = 'LKE_NODE_GROUPING_EDGE';\n\ninterface CircularLayoutOptions {\n radii: PixelSize[] | number[];\n cx?: number;\n cy?: number;\n startAngle?: number;\n clockwise?: boolean;\n getRadius?: (radius: PixelSize) => number;\n distanceRatio?: number;\n}\n\nexport class NodeGroupingTransformation {\n public transformation?: Transformation<LkNodeData, LkEdgeData>;\n public groupRule?: NodeGroupingRule;\n private _nodeGroupingStyleRule?: StyleRule<LkNodeData, LkEdgeData>;\n private _ogma: LKOgma;\n private _nodeGroupingCollapsedStyleRule?: StyleRule<LkNodeData, LkEdgeData>;\n private _collapsedDefaultValue = false;\n private _nodeGroupingAttributes: IVizNodeGroupInfo[] = [];\n\n constructor(ogma: LKOgma) {\n this._ogma = ogma;\n }\n\n /**\n * Set the grouping rule\n * @param rule of grouping\n */\n public setGroupingRule(rule?: NodeGroupingRule): void {\n this.groupRule = rule;\n }\n\n /**\n * create a node grouping transformation\n * It uses groupRule to define the rule\n * Group the nodes based on a category type and a property value\n */\n public async initTransformation(): Promise<void> {\n if (this.transformation === undefined) {\n this.transformation = this._ogma.transformations.addNodeGrouping({\n // node with same value will be part of the same group\n groupIdFunction: (node) => {\n if (this._isRuleNotApplicableToNode(node)) {\n return undefined;\n }\n // if groupRule is undefined, the early return would have catch it\n const rule = this.groupRule!;\n if (rule.groupingType === NodeGroupingType.BY_ADJACENT_EDGE_TYPE) {\n return this._getAdjacentEdgeGroupId(node, rule);\n } else {\n return this._getPropertyValueGroupId(node, rule);\n }\n },\n nodeGenerator: (nodes) => {\n const categories = new Set(nodes.getData('categories').flat());\n const nodeGroupId = this._findNodeGroupId(nodes);\n return {\n data: {\n categories: [],\n subCategories: Array.from(categories),\n collapsed: this._getDefaultCollapsedState(nodeGroupId),\n nodeGroupId: nodeGroupId\n },\n attributes: {\n layoutable: this._getDefaultLayoutableValue(nodeGroupId)\n }\n };\n },\n onGroupUpdate: async (_, subNodes) => {\n return await this.runSubNodesLayout(subNodes);\n },\n edgeGenerator: () => {\n return {\n data: {\n type: LKE_NODE_GROUPING_EDGE\n }\n };\n },\n showContents: (metaNode) => {\n return !OgmaTools.isGroupCollapsed(metaNode);\n },\n duration: 300,\n padding: 10\n });\n } else {\n await this.refreshTransformation();\n }\n }\n\n /**\n * refresh the transformation\n * Called when there is a change in the rule\n */\n public async refreshTransformation(): Promise<void> {\n if (this.transformation !== undefined) {\n await this.transformation.refresh();\n await this._unpinNodes(this._getAllTransformationRawNodes());\n } else {\n await this.initTransformation();\n }\n }\n\n /**\n * init node grouping style\n */\n public initNodeGroupingStyle(): void {\n this._nodeGroupingStyleRule = this._ogma.styles.addRule({\n nodeAttributes: {\n // Any default style will go here\n text: {\n content: (node: Node<LkNodeData> | undefined): string | undefined => {\n return this._getNodeGroupingCaption(node);\n },\n style: 'bold'\n },\n layer: -1,\n color: 'rgba(240, 240, 240)',\n innerStroke: {\n color: '#7f7f7f',\n width: 2\n }\n },\n nodeSelector: (node) => {\n return node.isVirtual() && !OgmaTools.isGroupCollapsed(node);\n },\n // the style will be updated when data object is updated\n nodeDependencies: {self: {data: true}}\n });\n\n this._initIntermediateGroupStyle();\n\n this._nodeGroupingCollapsedStyleRule = this._ogma.styles.addRule({\n nodeAttributes: {\n text: {\n content: (node: Node<LkNodeData> | undefined): string | undefined => {\n return this._getNodeGroupingCaption(node);\n },\n style: 'bold'\n },\n halo: {\n width: 4,\n color: '#e4ebea',\n strokeColor: '#ccc'\n },\n badges: {\n bottomLeft: (node) => {\n const numberOfSubNodes = node\n .getSubNodes()!\n .filter((node) => !node.hasClass('filtered'))?.size;\n\n return {\n color: '#3F3D5F',\n minVisibleSize: 20,\n stroke: {\n width: 2,\n color: '#FFFFFF'\n },\n text: {\n font: Tools.isDefined(this._ogma.LKStyles.nodeFont)\n ? this._ogma.LKStyles.nodeFont\n : DEFAULT_OGMA_FONT,\n scale: 0.4,\n color: CLEAR_FONT_COLOR,\n content: `x${numberOfSubNodes}`\n }\n };\n },\n topLeft: () => {\n return {\n color: '#3F3D5F',\n minVisibleSize: 20,\n stroke: {\n width: 2,\n color: '#FFFFFF'\n },\n text: {\n font: 'FontAwesome',\n scale: 0.4,\n color: CLEAR_FONT_COLOR,\n content: ''\n }\n };\n }\n },\n color: (node: Node | undefined) => {\n if (node !== undefined) {\n // get the colors of the sub-nodes, passing a fake itemData to nodeAttributes.color\n return this._ogma.LKStyles.nodeAttributes.color({\n geo: {},\n isVirtual: false,\n properties: {},\n readAt: 0,\n categories: node.getData('subCategories')\n });\n }\n },\n icon: (node: Node | undefined) => {\n const categories = node?.getData('subCategories') as Array<string>;\n if (!Tools.isDefined(node) || categories.length > 1) {\n return;\n }\n // get the icon of the sub-nodes, passing a fake itemData to nodeAttributes.icon\n return this._ogma.LKStyles.nodeAttributes.icon({\n geo: {},\n isVirtual: false,\n properties: {},\n readAt: 0,\n categories: categories\n }).icon;\n }\n },\n nodeSelector: (node) => {\n return node.isVirtual() && OgmaTools.isGroupCollapsed(node) && !node.hasClass('filtered');\n },\n nodeDependencies: {self: {attributes: ['styleRefreshIndex']}}\n });\n }\n\n public async refreshNodeGroupingStyle(): Promise<void> {\n await this._nodeGroupingStyleRule?.refresh();\n await this._nodeGroupingCollapsedStyleRule?.refresh();\n }\n\n /**\n * Run the layout on the subnodes of the virtual node\n * @param subNodes nodes part of a virtual node\n */\n public async runSubNodesLayout(\n subNodes: NodeList<LkNodeData, LkEdgeData>\n ): Promise<Point[] | undefined | void> {\n if (subNodes.size === 0 || subNodes.size === 1) {\n return;\n }\n\n // 2 nodes\n if (subNodes.size === 2) {\n return this._runTwoNodesLayout(subNodes);\n }\n\n const noEdges = subNodes.getAdjacentEdges({bothExtremities: true}).size === 0;\n if (noEdges) return this._runCirclePack(subNodes);\n // stars\n const center = OgmaTools.isStar(subNodes);\n if (center) {\n const satellites = subNodes.filter((n) => n !== center);\n const positions = this._runCircularLayout({\n radii: satellites.getAttribute('radius'),\n cx: center.getAttribute('x'),\n cy: center.getAttribute('y'),\n clockwise: false,\n distanceRatio: 5\n });\n return [center.getPosition(), ...positions];\n }\n // Chains: if al nodes have degree 1 or 2, place them in a line\n const degrees = subNodes.getDegree();\n const isEachNodeDegree1Or2 = degrees.every((d) => d === 1 || d === 2);\n const isNotATriangle = degrees.some((d) => d === 1);\n if (isEachNodeDegree1Or2 && isNotATriangle) {\n await this._runChainLayout(subNodes);\n return;\n }\n\n return await this._runForceLayout(subNodes);\n }\n\n /**\n * Get the virtual nodes of the transformation\n * @private\n */\n public getVirtualNodesOfTransformation(): NodeList<LkNodeData, LkEdgeData> {\n // @ts-ignore getContext exists on the transformation but hidden by the types\n return this.transformation.getContext().metaNodes;\n }\n\n /**\n * Set node initial attributes\n * @param nodeGroups object containing the node group id and the layoutable attribute\n */\n public setNodeGroupingAttributes(nodeGroups: IVizNodeGroupInfo[]): void {\n this._nodeGroupingAttributes = nodeGroups;\n }\n\n /**\n * set collapse default value, this will be the state of newly created groups\n */\n public setCollapseDefaultValue(value: boolean) {\n this._collapsedDefaultValue = value;\n }\n\n /**\n * Return the caption of a virtual node\n * @param node reference to the virtual node\n */\n private _getNodeGroupingCaption(node: Node<LkNodeData> | undefined): string | undefined {\n if (!Tools.isDefined(node) || !Tools.isDefined(this.groupRule)) {\n return undefined;\n }\n if (this.groupRule.groupingType === NodeGroupingType.BY_ADJACENT_EDGE_TYPE) {\n return this._getAdjacentEdgeNodeGroupingCaption(node, this.groupRule);\n }\n return this._getPropertyValueNodeGroupingCaption(node, this.groupRule);\n }\n\n private _getAdjacentEdgeNodeGroupingCaption(\n node: Node<LkNodeData>,\n rule: NodeGroupingByAdjacentEdgeType\n ): string | undefined {\n const subNodes = node.getSubNodes();\n if (!Tools.isDefined(subNodes) || !Tools.isDefined(subNodes.get(0))) {\n return undefined;\n }\n const centralNode = NodeGroupingTransformation._getGroupCentralNode(subNodes.get(0), rule);\n return centralNode.getData(['properties', 'name']) as string;\n }\n\n private _getPropertyValueNodeGroupingCaption(\n node: Node<LkNodeData>,\n rule: NodeGroupingByPropertyValue\n ): string | undefined {\n // TODO: Normally there is no need to check if getSubNodes return a value, Ogma issue\n //https://github.com/Linkurious/ogma/issues/3876\n if (node.isVirtual() && node.getSubNodes()?.get(0) !== undefined) {\n // get the property value of the first node of the group (all nodes share the same property value)\n const lkPropertyValue = node\n .getSubNodes()!\n .get(0)\n .getData(['properties', rule.groupingOptions.propertyKey]);\n const propertyValue = Tools.getValueFromLkProperty(lkPropertyValue);\n const size = node.getSubNodes()!.filter((e) => !e.hasClass('filtered')).size;\n return `${propertyValue} (${size})`;\n }\n }\n\n /**\n * Run the circle pack layout on the subnodes\n * @param subNodes\n */\n private _runCirclePack(subNodes: NodeList<LkNodeData, LkEdgeData>): Promise<Point[]> {\n return Promise.resolve(\n this._ogma.algorithms.circlePack({\n nodes: subNodes,\n margin: 10,\n sort: 'asc',\n dryRun: true\n })\n );\n }\n\n /**\n * return a grid layout when nodes are represented by multiple chains (a)-(b)-(c)-(d)\n */\n private async _runChainLayout(subNodes: NodeList<LkNodeData, LkEdgeData>): Promise<void> {\n // straighten the chain\n const chain = OgmaTools.topologicalSort(subNodes);\n const sortedNodes = this._ogma.getNodes(chain.chain);\n // we also need to sort the nodes so that they are following the chain\n await this._ogma.layouts.grid({\n nodes: sortedNodes,\n // TODO: test that visually\n colDistance: Math.max(...subNodes.getAttribute('radius').map(Number)) * 4,\n rows: chain.numberOfChain ?? 1\n });\n }\n\n private async _runForceLayout(subNodes: NodeList<LkNodeData, LkEdgeData>): Promise<void> {\n await this._ogma.layouts.force({\n nodes: subNodes,\n ...FORCE_LAYOUT_CONFIG\n });\n }\n\n private _isRuleNotApplicableToNode(node: Node<LkNodeData>): boolean {\n const rule = this.groupRule;\n if (rule === undefined) {\n return true;\n }\n if (rule.groupingType === NodeGroupingType.BY_PROPERTY_VALUE) {\n return this._isPropertyRuleNotApplicableToNode(node, rule);\n } else if (rule.groupingType === NodeGroupingType.BY_ADJACENT_EDGE_TYPE) {\n return this._isRelationshipRuleNotApplicableToNode(node, rule);\n }\n return true;\n }\n\n private _isRelationshipRuleNotApplicableToNode(\n node: Node<LkNodeData>,\n rule: NodeGroupingByAdjacentEdgeType\n ): boolean {\n // if the node does not have the relationship\n return !this.hasEdgeOfType(node, rule.groupingOptions.edgeType);\n }\n\n private hasEdgeOfType(node: Node<LkNodeData>, type: string): boolean {\n let hasEdge = false;\n node.getAdjacentEdges().forEach((edge) => {\n if (edge.getData('type') === type) {\n hasEdge = true;\n }\n });\n return hasEdge;\n }\n\n private _isPropertyRuleNotApplicableToNode(\n node: Node<LkNodeData>,\n rule: NodeGroupingByPropertyValue\n ): boolean {\n const propertyValue = node.getData(['properties', rule.groupingOptions.propertyKey ?? '']);\n return (\n // if rule is applied to a different category\n rule.groupingOptions.itemTypes.every(\n (itemType: string) => !node.getData('categories').includes(itemType)\n ) ||\n // if the property value is not defined\n !Tools.isDefined(propertyValue) ||\n // if the property value is missing\n (typeof propertyValue === 'object' && (propertyValue as MissingValue).status === 'missing')\n );\n }\n\n /**\n * Unpin list of nodes\n * @param nodes\n * @private\n */\n private async _unpinNodes(nodes: Array<NodeList | null>): Promise<void> {\n await Promise.all(\n nodes.map((nodeList) => {\n if (nodeList !== null) {\n return nodeList.setAttribute('layoutable', true);\n }\n })\n );\n }\n\n /**\n * Get all the raw nodes part of the transformation\n * @private\n */\n private _getAllTransformationRawNodes(): Array<NodeList | null> {\n const virtualNodes = this.getVirtualNodesOfTransformation();\n return virtualNodes.getSubNodes();\n }\n\n private _findGroupingPropertyValue(node: Node<LkNodeData>): string {\n // we only use this method when the grouping type is property key\n const rule = this.groupRule as NodeGroupingByPropertyValue;\n const propertyValue = node.getData(['properties', rule.groupingOptions.propertyKey ?? '']);\n return `${Tools.getValueFromLkProperty(propertyValue)}`;\n }\n\n /**\n * Return a hashed string that represents the group id\n */\n private _findNodeGroupId(nodes: NodeList<LkNodeData, LkEdgeData>): string {\n const rule = this.groupRule!;\n if (rule.groupingType === NodeGroupingType.BY_ADJACENT_EDGE_TYPE) {\n const centralNode = NodeGroupingTransformation._getGroupCentralNode(nodes.get(0), rule);\n return sha1(`${this.groupRule?.name}-${centralNode.getId()}`);\n } else {\n const propertyValue = this._findGroupingPropertyValue(nodes.get(0));\n return sha1(`${rule.name}-${rule.groupingOptions.itemTypes.join('-')}-${propertyValue}`);\n }\n }\n\n /**\n * For a relation type grouping rule, return the central node from one of the nodes in the group\n */\n private static _getGroupCentralNode(\n node: Node<LkNodeData, LkEdgeData>,\n rule: NodeGroupingByAdjacentEdgeType\n ): Node<LkNodeData, LkEdgeData> {\n const firstAdjacentEdge = node\n // 'raw' will get edges hidden by transformations\n // Use case: in ER, 2 created entities are pointing to the same node\n // node A RESOLVED node C\n // node B RESOLVED node C\n // when grouping by relationship, node A and C will be grouped together\n // node B should also be grouped with node C but since it's already part of a group,\n // it will be alone in a group and point to the other group by a virtual edge\n // impact: without using 'raw', the firstAdjacentEdge will be the virtual edge which is not of the correct type 'RESOLVED'\n // firstAdjacentEdge will be undefined and next line will throw an error\n // Note: this should not happen but in case it happens due to some inconsistency, this fix will prevent this method to throw an error\n .getAdjacentEdges({filter: 'raw'})\n .filter((edge) => edge.getData('type') === rule.groupingOptions.edgeType)\n .get(0);\n const centralNode =\n rule.groupingOptions.centralNodeIs === 'source'\n ? firstAdjacentEdge.getSource()\n : firstAdjacentEdge.getTarget();\n return centralNode;\n }\n\n public _runCircularLayout({\n radii,\n clockwise = true,\n cx = 0,\n cy = 0,\n startAngle = (3 / 2) * Math.PI,\n getRadius = (radius: PixelSize) => Number(radius),\n distanceRatio = 0.0\n }: CircularLayoutOptions): Point[] {\n const N = radii.length;\n // dummy checks\n if (N === 0) return [];\n if (N === 1) return [{x: cx, y: cy}];\n\n // minDistance\n const minDistance =\n radii.map(getRadius).reduce((acc, r) => Math.max(acc, r), 0) * (2 + distanceRatio);\n\n const sweep = 2 * Math.PI - (2 * Math.PI) / N;\n const deltaAngle = sweep / Math.max(1, N - 1);\n\n const dcos = Math.cos(deltaAngle) - Math.cos(0);\n const dsin = Math.sin(deltaAngle) - Math.sin(0);\n\n const rMin = Math.sqrt((minDistance * minDistance) / (dcos * dcos + dsin * dsin));\n const r = Math.max(rMin, 0);\n\n return radii.map((_, i) => {\n const angle = startAngle + i * deltaAngle * (clockwise ? 1 : -1);\n\n const rx = r * Math.cos(angle);\n const ry = r * Math.sin(angle);\n return {\n x: cx + rx,\n y: cy + ry\n };\n });\n }\n\n private async _runTwoNodesLayout(nodes: NodeList<LkNodeData, LkEdgeData>) {\n const radii = nodes.getAttribute('radius').map(Number);\n const positions = nodes.getPosition();\n const gap = Math.min(...radii);\n return [positions[0], {x: positions[0].x + gap + radii[0] + radii[1], y: positions[0].y}];\n }\n\n private _getPropertyValueGroupId(\n node: Node<LkNodeData, LkEdgeData>,\n rule: NodeGroupingByPropertyValue\n ) {\n const propertyValue = this._findGroupingPropertyValue(node);\n return `${rule.groupingOptions.itemTypes.join('-')}-${propertyValue}`.toLowerCase().trim();\n }\n\n private _getAdjacentEdgeGroupId(\n node: Node<LkNodeData, LkEdgeData>,\n rule: NodeGroupingByAdjacentEdgeType\n ) {\n const centralNode = NodeGroupingTransformation._getGroupCentralNode(node, rule);\n return centralNode.getId().toString();\n }\n\n /**\n * Initialize the style for the intermediate group state, when transitioning from expanded to collapsed\n */\n private _initIntermediateGroupStyle() {\n this._ogma.styles.addRule({\n nodeAttributes: {\n color: 'rgba(240, 240, 240)'\n },\n nodeSelector: (node) => {\n return node.isVirtual() && OgmaTools.isGroupCollapsed(node);\n },\n // the style will be updated when data object is updated\n nodeDependencies: {self: {data: true}}\n });\n }\n\n private _getDefaultCollapsedState(nodeGroupId: string): boolean {\n const nodeAttributes = this._nodeGroupingAttributes.find((node) => {\n return node.id === nodeGroupId;\n });\n if (Tools.isDefined(nodeAttributes) && Tools.isDefined(nodeAttributes.attributes.collapsed)) {\n return nodeAttributes.attributes.collapsed;\n }\n return this._collapsedDefaultValue;\n }\n\n private _getDefaultLayoutableValue(nodeGroupId: string): boolean {\n const nodeAttributes = this._nodeGroupingAttributes.find((node) => {\n return node.id === nodeGroupId;\n });\n if (Tools.isDefined(nodeAttributes) && Tools.isDefined(nodeAttributes.attributes.layoutable)) {\n return nodeAttributes.attributes.layoutable;\n }\n return true;\n }\n}\n","'use strict';\n\nimport {GenericObject, IEdgeGroupStyle, LkEdgeData, LkNodeData} from '@linkurious/rest-client';\nimport {\n Edge,\n EdgeAttributesValue,\n EdgeExtremity,\n EdgeStyle,\n EdgeType,\n PixelSize,\n StyleRule,\n Transformation\n} from '@linkurious/ogma';\n\nimport {LKOgma} from '../index';\n\nimport {LKE_NODE_GROUPING_EDGE} from './nodeGrouping';\n\nconst DEFAULT_EDGE_GROUP_STYLE: {\n color: string;\n shape: {\n body?: EdgeType;\n head?: EdgeExtremity;\n tail?: EdgeExtremity;\n style?: EdgeStyle;\n };\n width: PixelSize;\n} = {\n color: '#000000',\n shape: {\n style: 'dashed',\n head: 'arrow'\n },\n width: 1.5\n};\n\nexport class TransformationsViz {\n private _ogma: LKOgma;\n public groupedEdges: GenericObject<boolean>;\n public edgeGroupStyle!: IEdgeGroupStyle;\n public transformation!: Transformation<LkNodeData, LkEdgeData>;\n public edgeGroupingStyleRule!: StyleRule<LkNodeData, LkEdgeData>;\n\n constructor(ogma: LKOgma) {\n this._ogma = ogma;\n this.groupedEdges = {};\n }\n\n /**\n * create an edge grouping transformation by edge type\n */\n public async initTransformation(): Promise<void> {\n if (this.transformation === undefined) {\n this.transformation = this._ogma.transformations.addEdgeGrouping({\n separateEdgesByDirection: true,\n selector: (edge) => {\n return this.groupedEdges[edge.getData('type')];\n },\n groupIdFunction: (edge) => edge.getData('type'),\n generator: (edges) => {\n return {\n data: {\n properties: {\n originalType: edges.getData('type')[0]\n }\n }\n };\n }\n });\n } else {\n await this.transformation.refresh();\n }\n }\n\n /**\n * init edge grouping style\n */\n public initEdgeGroupingStyle(): void {\n this.edgeGroupingStyleRule = this._ogma.styles.addRule({\n edgeAttributes: {\n ...DEFAULT_EDGE_GROUP_STYLE,\n ...(this.edgeGroupStyle as EdgeAttributesValue<LkEdgeData, LkNodeData>),\n text: {\n content: (edge: Edge<LkEdgeData> | undefined): string | undefined => {\n // check it the edge is virtual and was not created by node grouping\n if (\n edge !== undefined &&\n edge.getSubEdges() !== null &&\n edge.getData('type') !== LKE_NODE_GROUPING_EDGE\n ) {\n const size = edge.getSubEdges()!.filter((e) => !e.hasClass('filtered')).size;\n return `${edge.getData(['properties', 'originalType'])} (${size})`;\n }\n },\n style: 'bold'\n }\n },\n edgeSelector: (edge) =>\n edge.isVirtual() &&\n edge.getSubEdges() &&\n edge.getSubEdges()!.filter((e) => !e.hasClass('filtered')).size > 0 &&\n edge.getData('type') !== LKE_NODE_GROUPING_EDGE,\n edgeDependencies: {self: {data: true}}\n });\n }\n\n public refreshEdgeGroupingStyle(): void {\n if (this.edgeGroupingStyleRule !== undefined) {\n this.edgeGroupingStyleRule.refresh();\n }\n }\n}\n","import {\n ItemSelector,\n LkEdgeData,\n LkNodeData,\n IRangeValues,\n SelectorType,\n ISelectorAny,\n ISelectorIs,\n ISelectorNoValue,\n ISelectorNaN,\n ISelectorRange,\n LkItemData\n} from '@linkurious/rest-client';\n\nimport {Tools} from '../tools/tools';\n\ntype FilterFunction<T extends LkItemData> = (itemData: T) => boolean;\n\nexport class Filters {\n private static nodeCache: Map<string, FilterFunction<LkNodeData>> = new Map();\n private static edgeCache: Map<string, FilterFunction<LkEdgeData>> = new Map();\n private static FILTER_CACHE_SIZE = 5;\n\n /**\n * Returns whether the node/edge should be *filtered* (a.k.a. *hidden*).\n *\n * Notes:\n * 1. `filterRules` are rules that match what should be filtered/hidden.\n * 2. `filterRules` are combined inclusively: as soon as one rule returns `true` for\n * an item, the item can be hidden/filtered.\n *\n * @param filterRules\n * @param itemData\n */\n public static isFiltered(\n filterRules: Array<ItemSelector>,\n itemData: LkNodeData | LkEdgeData\n ): boolean {\n if (!Tools.isDefined(itemData)) {\n return false;\n }\n\n if ('categories' in itemData) {\n return Filters.getFilterFunction(filterRules, true)(itemData);\n } else {\n return Filters.getFilterFunction(filterRules, false)(itemData);\n }\n }\n\n private static getFilterFunction<T extends LkNodeData | LkEdgeData>(\n filterRules: Array<ItemSelector>,\n isNode: boolean\n ): FilterFunction<T> {\n const filterKey = JSON.stringify(filterRules, null, '');\n\n // This cast is needed to tell the TypeScript compiler to trust us that \"isNode\" and \"T\" are dependent.\n const filterCache = (isNode ? Filters.nodeCache : Filters.edgeCache) as Map<\n string,\n FilterFunction<T>\n >;\n\n let filterFunc = filterCache.get(filterKey);\n if (!filterFunc) {\n filterFunc = Filters.createFilterFunction(filterRules, isNode);\n if (filterCache.size > Filters.FILTER_CACHE_SIZE) {\n filterCache.clear();\n }\n filterCache.set(filterKey, filterFunc);\n }\n return filterFunc;\n }\n\n private static createFilterFunction<T extends LkNodeData | LkEdgeData>(\n filterRules: Array<ItemSelector>,\n isNode: boolean\n ): FilterFunction<T> {\n const filterFunctions = filterRules.map((filter: ItemSelector) =>\n Filters.filterToFilterFunction(filter, isNode)\n );\n\n /**\n * For each filterFunction, as soon as we find a filterFunction that says that a given\n * node/edge should be filtered/hidden, we return `true` for the node/edge.\n */\n return (itemData: T): boolean => {\n for (const filterFunction of filterFunctions) {\n if (filterFunction(itemData)) {\n return true;\n }\n }\n return false;\n };\n }\n\n private static filterToFilterFunction<T extends LkNodeData | LkEdgeData>(\n filter: ItemSelector,\n isNode: boolean\n ): FilterFunction<T> {\n switch (filter.type) {\n case SelectorType.ANY:\n return Filters.createAnyFilterFunction(filter, isNode);\n case SelectorType.IS:\n return Filters.createIsFilterFunction(filter, isNode);\n case SelectorType.NO_VALUE:\n return Filters.createNoValueFilterFunction(filter, isNode);\n case SelectorType.RANGE:\n return Filters.createRangeFilterFunction(filter, isNode);\n case SelectorType.NAN:\n return Filters.createNaNFilterFunction(filter, isNode);\n }\n }\n\n private static createAnyFilterFunction<T extends LkNodeData | LkEdgeData>(\n filter: ISelectorAny,\n isNode: boolean\n ): FilterFunction<T> {\n if (isNode) {\n return (itemData: T) => {\n if (filter.itemType === undefined) {\n return true;\n }\n return (itemData as LkNodeData).categories.includes(filter.itemType);\n };\n } else {\n // isEdge\n return (itemData: T) => (itemData as LkEdgeData).type === filter.itemType;\n }\n }\n\n private static createIsFilterFunction<T extends LkNodeData | LkEdgeData>(\n filter: ISelectorIs,\n isNode: boolean\n ): FilterFunction<T> {\n if (isNode) {\n return (itemData: T) =>\n (itemData as LkNodeData).categories.includes(filter.itemType) &&\n Tools.getPropertyValue(Tools.getIn(itemData, filter.input), true) === filter.value;\n } else {\n // isEdge\n return (itemData: T) =>\n (itemData as LkEdgeData).type === filter.itemType &&\n Tools.getPropertyValue(Tools.getIn(itemData, filter.input), true) === filter.value;\n }\n }\n\n private static createNoValueFilterFunction<T extends LkNodeData | LkEdgeData>(\n filter: ISelectorNoValue,\n isNode: boolean\n ): FilterFunction<T> {\n if (isNode) {\n return (itemData: T) =>\n (itemData as LkNodeData).categories.includes(filter.itemType) &&\n !Tools.isDefined(Tools.getPropertyValue(Tools.getIn(itemData, filter.input), true));\n } else {\n // isEdge\n return (itemData: T) =>\n (itemData as LkEdgeData).type === filter.itemType &&\n !Tools.isDefined(Tools.getPropertyValue(Tools.getIn(itemData, filter.input), true));\n }\n }\n\n private static createNaNFilterFunction<T extends LkNodeData | LkEdgeData>(\n filter: ISelectorNaN,\n isNode: boolean\n ): FilterFunction<T> {\n if (isNode) {\n return (itemData: T) =>\n (itemData as LkNodeData).categories.includes(filter.itemType) &&\n Filters.isNotANumber(Tools.getPropertyValue(Tools.getIn(itemData, filter.input), true));\n } else {\n // isEdge\n return (itemData: T) =>\n (itemData as LkEdgeData).type === filter.itemType &&\n Filters.isNotANumber(Tools.getPropertyValue(Tools.getIn(itemData, filter.input), true));\n }\n }\n\n private static isNotANumber(value: unknown) {\n return Tools.isDefined(value) && !Tools.isNumber(value);\n }\n\n public static createRangeFilterFunction<T extends LkNodeData | LkEdgeData>(\n filter: ISelectorRange,\n isNode: boolean\n ): FilterFunction<T> {\n if (isNode) {\n return (itemData: T) =>\n (itemData as LkNodeData).categories.includes(filter.itemType) &&\n Filters.valueShouldBeHidden(\n Tools.getPropertyValue(Tools.getIn(itemData, filter.input), false),\n filter.value\n );\n } else {\n // isEdge\n return (itemData: T) =>\n (itemData as LkEdgeData).type === filter.itemType &&\n Filters.valueShouldBeHidden(\n Tools.getPropertyValue(Tools.getIn(itemData, filter.input), false),\n filter.value\n );\n }\n }\n\n /**\n * Returns true if `value` should be filtered/hidden.\n *\n * `range` describes what should be filtered/hidden:\n * - e.g. {\"<\":10, \">=\":20} => hide any value in ]-inf, 10[ *OR* in [20, +inf[\n * - e.g. {\"<=\":10} => hide any value in ]-inf, 10]\n * - e.g. {\">=\":20} => hide any value in [20, +inf[\n *\n * Returns false (i.e. will not filter/hide) if `value` is not a number.\n */\n public static valueShouldBeHidden(value: unknown, range: IRangeValues): boolean {\n const n = Tools.parseFloat(value);\n if (Number.isNaN(n)) {\n return false;\n }\n\n /**\n * As soon as we find a condition that says that `value` should be filtered/hidden,\n * we return `true`.\n *\n * If `range` contains multiple conditions, all are checked and if any condition causes\n * `value` to be in the filtered/hidden range, we return `true`.\n *\n * If no condition causes `value` to be filtered/hidden, we return `false`.\n */\n return (\n (range['<'] !== undefined && n < range['<']) ||\n (range['<='] !== undefined && n <= range['<=']) ||\n (range['>'] !== undefined && n > range['>']) ||\n (range['>='] !== undefined && n >= range['>='])\n );\n }\n}\n","'use strict';\n\nimport {EntityType, LkEdgeData, LkNodeData} from '@linkurious/rest-client';\nimport {Edge, ItemList, Node} from '@linkurious/ogma';\n\nimport {Tools} from '../../tools/tools';\n\nimport {OgmaState} from './reactive';\n\nexport type SelectionState = 'selection' | 'multiSelection' | 'noSelection';\n\n/**\n * Return the current size of the selection\n */\nexport const getSelectionSize = (state: OgmaState): number => {\n return (state.selection as ItemList<LkNodeData>).size;\n};\n\n/**\n * Return the current state of the selection\n */\nexport const getSelectionState = (state: OgmaState): SelectionState => {\n switch ((state.selection as ItemList<LkNodeData>).size) {\n case 1:\n return 'selection';\n\n case 0:\n return 'noSelection';\n\n default:\n return 'multiSelection';\n }\n};\n\n/**\n * Get the entityType of the current selection\n */\nexport const getSelectionEntity = (state: OgmaState): EntityType | undefined => {\n if (!Tools.isDefined(state.selection) || state.selection.size === 0) {\n return undefined;\n }\n return (state.selection as ItemList<LkNodeData>).isNode ? EntityType.NODE : EntityType.EDGE;\n};\n\n/**\n * Return the item selection if there's only one item selected\n */\nexport const getUniqSelection = (\n state: OgmaState\n): Node<LkNodeData, LkEdgeData> | Edge<LkEdgeData, LkNodeData> | undefined => {\n return Tools.isDefined(state.selection) && state.selection.size === 1\n ? state.selection.get(0)\n : undefined;\n};\n\n/**\n * Return the types of the current selection (if only one item is selected)\n */\nexport const getUniqSelectionTypes = (state: OgmaState): Array<string> | undefined => {\n const uniqSelection = getUniqSelection(state);\n if (uniqSelection === undefined) {\n return undefined;\n }\n if (uniqSelection.isNode) {\n return uniqSelection.getData('categories');\n } else {\n return [uniqSelection.getData('type')];\n }\n};\n\n/**\n * Return the entityType of the current selection if there's only one item selected\n */\nexport const getUniqSelectionEntity = (state: OgmaState): 'node' | 'edge' | undefined => {\n const uniqSelection = getUniqSelection(state);\n if (uniqSelection === undefined) {\n return undefined;\n }\n if (uniqSelection.isNode) {\n return 'node';\n }\n return 'edge';\n};\n\n/**\n * Return the properties of the current selection if there's only one item selected\n */\nexport const getSelectionProperties = (state: OgmaState): Array<{key: string; value: any}> => {\n const uniqSelection = getUniqSelection(state);\n if (uniqSelection !== undefined) {\n const properties = uniqSelection.getData().properties;\n return Object.keys(properties).map((propKey) => {\n return {\n key: propKey,\n value: properties[propKey]\n };\n });\n }\n return [];\n};\n\n/**\n * Return true if the current selection has properties\n */\nexport const hasSelectionProperties = (state: OgmaState): boolean => {\n return getSelectionProperties(state).length > 0;\n};\n"],"names":["listCacheClear","_listCacheClear","eq","value","other","eq_1","require$$0","assocIndexOf","array","key","length","_assocIndexOf","arrayProto","splice","listCacheDelete","data","index","lastIndex","_listCacheDelete","listCacheGet","_listCacheGet","listCacheHas","_listCacheHas","listCacheSet","_listCacheSet","require$$1","require$$2","require$$3","require$$4","ListCache","entries","entry","_ListCache","stackClear","_stackClear","stackDelete","result","_stackDelete","stackGet","_stackGet","stackHas","_stackHas","freeGlobal","global","_freeGlobal","freeSelf","root","_root","Symbol","_Symbol","objectProto","hasOwnProperty","nativeObjectToString","symToStringTag","getRawTag","isOwn","tag","unmasked","_getRawTag","objectToString","_objectToString","nullTag","undefinedTag","baseGetTag","_baseGetTag","isObject","type","isObject_1","asyncTag","funcTag","genTag","proxyTag","isFunction","isFunction_1","coreJsData","_coreJsData","maskSrcKey","uid","isMasked","func","_isMasked","funcProto","funcToString","toSource","_toSource","reRegExpChar","reIsHostCtor","reIsNative","baseIsNative","pattern","_baseIsNative","getValue","object","_getValue","getNative","_getNative","Map","_Map","nativeCreate","_nativeCreate","hashClear","_hashClear","hashDelete","_hashDelete","HASH_UNDEFINED","hashGet","_hashGet","hashHas","_hashHas","hashSet","_hashSet","Hash","_Hash","mapCacheClear","_mapCacheClear","isKeyable","_isKeyable","getMapData","map","_getMapData","mapCacheDelete","_mapCacheDelete","mapCacheGet","_mapCacheGet","mapCacheHas","_mapCacheHas","mapCacheSet","size","_mapCacheSet","MapCache","_MapCache","LARGE_ARRAY_SIZE","stackSet","pairs","_stackSet","require$$5","Stack","_Stack","setCacheAdd","_setCacheAdd","setCacheHas","_setCacheHas","SetCache","values","_SetCache","arraySome","predicate","_arraySome","cacheHas","cache","_cacheHas","COMPARE_PARTIAL_FLAG","COMPARE_UNORDERED_FLAG","equalArrays","bitmask","customizer","equalFunc","stack","isPartial","arrLength","othLength","arrStacked","othStacked","seen","arrValue","othValue","compared","othIndex","_equalArrays","Uint8Array","_Uint8Array","mapToArray","_mapToArray","setToArray","set","_setToArray","boolTag","dateTag","errorTag","mapTag","numberTag","regexpTag","setTag","stringTag","symbolTag","arrayBufferTag","dataViewTag","symbolProto","symbolValueOf","equalByTag","convert","stacked","_equalByTag","arrayPush","offset","_arrayPush","isArray","isArray_1","baseGetAllKeys","keysFunc","symbolsFunc","_baseGetAllKeys","arrayFilter","resIndex","_arrayFilter","stubArray","stubArray_1","propertyIsEnumerable","nativeGetSymbols","getSymbols","symbol","_getSymbols","baseTimes","n","iteratee","_baseTimes","isObjectLike","isObjectLike_1","argsTag","baseIsArguments","_baseIsArguments","isArguments","isArguments_1","stubFalse","stubFalse_1","freeExports","exports","freeModule","module","moduleExports","Buffer","nativeIsBuffer","isBuffer","MAX_SAFE_INTEGER","reIsUint","isIndex","_isIndex","isLength","isLength_1","arrayTag","objectTag","weakMapTag","float32Tag","float64Tag","int8Tag","int16Tag","int32Tag","uint8Tag","uint8ClampedTag","uint16Tag","uint32Tag","typedArrayTags","baseIsTypedArray","_baseIsTypedArray","baseUnary","_baseUnary","freeProcess","nodeUtil","types","nodeIsTypedArray","isTypedArray","isTypedArray_1","arrayLikeKeys","inherited","isArr","isArg","isBuff","isType","skipIndexes","_arrayLikeKeys","isPrototype","Ctor","proto","_isPrototype","overArg","transform","arg","_overArg","nativeKeys","_nativeKeys","baseKeys","_baseKeys","isArrayLike","isArrayLike_1","keys","keys_1","getAllKeys","_getAllKeys","equalObjects","objProps","objLength","othProps","objStacked","skipCtor","objValue","objCtor","othCtor","_equalObjects","DataView","_DataView","Promise","_Promise","Set","_Set","WeakMap","_WeakMap","require$$6","promiseTag","dataViewCtorString","mapCtorString","promiseCtorString","setCtorString","weakMapCtorString","getTag","ctorString","_getTag","require$$7","baseIsEqualDeep","objIsArr","othIsArr","objTag","othTag","objIsObj","othIsObj","isSameTag","objIsWrapped","othIsWrapped","objUnwrapped","othUnwrapped","_baseIsEqualDeep","baseIsEqual","_baseIsEqual","isEqual","isEqual_1","spreadableSymbol","isFlattenable","_isFlattenable","baseFlatten","depth","isStrict","_baseFlatten","arrayMap","_arrayMap","isSymbol","isSymbol_1","reIsDeepProp","reIsPlainProp","isKey","_isKey","FUNC_ERROR_TEXT","memoize","resolver","memoized","args","memoize_1","MAX_MEMOIZE_SIZE","memoizeCapped","_memoizeCapped","rePropName","reEscapeChar","stringToPath","string","match","number","quote","subString","_stringToPath","INFINITY","symbolToString","baseToString","_baseToString","toString","toString_1","castPath","_castPath","toKey","_toKey","baseGet","path","_baseGet","baseIsMatch","source","matchData","noCustomizer","srcValue","_baseIsMatch","isStrictComparable","_isStrictComparable","getMatchData","_getMatchData","matchesStrictComparable","_matchesStrictComparable","baseMatches","_baseMatches","get","defaultValue","get_1","baseHasIn","_baseHasIn","hasPath","hasFunc","_hasPath","hasIn","hasIn_1","baseMatchesProperty","_baseMatchesProperty","identity","identity_1","baseProperty","_baseProperty","basePropertyDeep","_basePropertyDeep","property","property_1","baseIteratee","_baseIteratee","createBaseFor","fromRight","iterable","props","_createBaseFor","baseFor","_baseFor","baseForOwn","_baseForOwn","createBaseEach","eachFunc","collection","_createBaseEach","baseEach","_baseEach","baseMap","_baseMap","baseSortBy","comparer","_baseSortBy","compareAscending","valIsDefined","valIsNull","valIsReflexive","valIsSymbol","othIsDefined","othIsNull","othIsReflexive","othIsSymbol","_compareAscending","compareMultiple","orders","objCriteria","othCriteria","ordersLength","order","_compareMultiple","require$$8","baseOrderBy","iteratees","criteria","_baseOrderBy","apply","thisArg","_apply","nativeMax","overRest","start","otherArgs","_overRest","constant","constant_1","defineProperty","_defineProperty","baseSetToString","_baseSetToString","HOT_COUNT","HOT_SPAN","nativeNow","shortOut","count","lastCalled","stamp","remaining","_shortOut","setToString","_setToString","baseRest","_baseRest","isIterateeCall","_isIterateeCall","sortBy","sortBy_1","IMAGE_PATTERN","CAPTION_HEURISTIC","Tools","v1","v2","position","limit","suffix","valueToTruncate","fixedLimit","ref","p","c","o","k","v","nodes","node","statistics","hiddenNeighbors","div","sign","nn","isoString","isDatetime","timezone","offsetDate","dateObject","formattedDate","hours","minutes","str","arr","i","url","invalidAsString","formattedDates","options","CurrencyFormat","thousandSeparator","decimalSeparator","integerPart","fractionalPart","formattedIntegerPart","digit","Captions","itemData","schema","graphSchema","heuristicCaptionElement","propertyValue","propertyType","PropertyTypeName","itemTypes","categories","caption","captionProps","category","propertyKey","itemType","typeGraphSchema","schemaType","base64map","crypt","b","bytes","words","hex","base64","triplet","j","imod4","cryptModule","charenc","charenc_1","utf8","bin","sha1","message","m","l","w","H0","H1","H2","H3","H4","a","d","e","t","api","digestbytes","sha1Module","BASE_GREY","PALETTE","ItemAttributes","rulesMap","ignoreCase","input","modulo","rule","max","min","lower","higher","EdgeAttributes","styleRules","color","propValue","_a","styleRule","widthStyle","propertyName","isLog","AutoRangeScale","OgmaEdgeShape","NodeAttributes","callback","hash","cachedColor","colors","finalColor","rawColors","rules","style","_b","OgmaTools","imageUrlValue","sizeStyle","generatedIcon","baseUrl","imageUrl","StyleRuleType","StyleRule","model","SelectorType","typePredicate","comparator","itemValue","formattedValue","StyleType","SORTING_RULE","StyleRules","itemsData","styleType","styles","label","imageStyle","template","currentLegend","colorStyle","icons","legend","indexOfLegendItem","r","rawRule","seenIndex","sanitizedStyles","maxIndex","DEFAULT_OGMA_FONT","CLEAR_FONT_COLOR","FILTER_OPACITY","HOVERED_SELECTED_NODE_STYLE","HOVERED_SELECTED_EDGE_STYLE","NODE_HALO_CONFIGURATION","EDGE_HALO_CONFIGURATION","DARK_FONT_COLOR","ITEM_DEFAULT_COLOR","StylesViz","ogma","configuration","edge","propertyPath","isEdgeInsideNodeGroup","textWrappingLength","degree","badgeContent","nodeColor","textColor","isSupernode","content","nodesEvent","overlap","colorStyleRules","state","nodeRules","nodeColorRules","nodeIconsRules","nodeSizeRules","nodeShapesRules","edgeRules","edgesWidthRules","edgesShapeRules","edgesColorRules","iconStyleRules","sizeStyleRules","shapeStyleRules","widthStyleRules","width","height","CaptionsViz","_nodeMaxTextLength","_edgeMaxTextLength","hasLift","operate","init","liftedSource","err","extendStatics","__extends","__","__values","s","__read","ar","error","__spreadArray","to","from","pack","createErrorClass","createImpl","_super","instance","ctorFunc","UnsubscriptionError","errors","arrRemove","item","Subscription","initialTeardown","e_1","e_2","_parentage","_parentage_1","_parentage_1_1","parent_1","e_1_1","initialFinalizer","_finalizers","_finalizers_1","_finalizers_1_1","finalizer","execFinalizer","e_2_1","teardown","parent","empty","isSubscription","config","timeoutProvider","handler","timeout","_i","handle","reportUnhandledError","noop","Subscriber","destination","_this","EMPTY_OBSERVER","next","complete","SafeSubscriber","_bind","bind","fn","ConsumerObserver","partialObserver","handleUnhandledError","observerOrNext","context_1","defaultErrorHandler","x","createOperatorSubscriber","onNext","onComplete","onError","onFinalize","OperatorSubscriber","shouldUnsubscribe","closed_1","project","subscriber","distinctUntilChanged","keySelector","defaultCompare","previousKey","first","currentKey","OgmaStore","BehaviorSubject","mapFn","RxViz","currentAnimationEnd","isCurrentlyAnimating","nextAnimationEnd","safeAnimationTimeoutMs","evt","change","ANIMATION_DURATION","LKOgma","Ogma","_configuration","_baseUrl","params","TransformationsViz","NodeGroupingTransformation","multiSelectionKey","_d","_c","nodeMaxTextLength","edgeMaxTextLength","_h","_g","_f","_e","mode","duration","dynamicSteps","ForceLayoutMode","rootNode","visualization","selectedEntityType","selectedElements","fixedNodes","EntityType","fixedEdges","graph","addedNodes","addedEdges","edges","items","filter","HTML_COLORS","FORCE_LAYOUT_CONFIG","hexRegExp","rgbRegExp","rgbaRegExp","rgb","g","startOfChains","visited","stacks","currentNode","nextNode","neighbor","adjacent","collapsed","LKE_NODE_GROUPING_EDGE","NodeGroupingType","nodeGroupId","_","subNodes","metaNode","numberOfSubNodes","center","satellites","positions","degrees","isEachNodeDegree1Or2","isNotATriangle","nodeGroups","lkPropertyValue","chain","sortedNodes","hasEdge","nodeList","centralNode","firstAdjacentEdge","radii","clockwise","cx","cy","startAngle","getRadius","radius","distanceRatio","N","minDistance","acc","deltaAngle","dcos","dsin","rMin","angle","rx","ry","gap","nodeAttributes","DEFAULT_EDGE_GROUP_STYLE","_Filters","filterRules","isNode","filterKey","filterCache","filterFunc","filterFunctions","filterFunction","range","Filters","getSelectionSize","getSelectionState","getSelectionEntity","getUniqSelection","getUniqSelectionTypes","uniqSelection","getUniqSelectionEntity","getSelectionProperties","properties","propKey","hasSelectionProper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AAS,KAAKA,EAAM,UAAU,SAAS;AAGlE,WAAQA,EAAM,UAAmC,SAAS8I,EAAW,OAAOA,EAAW;AACzF,GAKa8E,KAAmB,CAC9B5N,MAEOvL,EAAM,UAAUuL,EAAM,SAAS,KAAKA,EAAM,UAAU,SAAS,IAChEA,EAAM,UAAU,IAAI,CAAC,IACrB,QAMO6N,KAAwB,CAAC7N,MAAgD;AAC9E,QAAA8N,IAAgBF,GAAiB5N,CAAK;AAC5C,MAAI8N,MAAkB;AAGtB,WAAIA,EAAc,SACTA,EAAc,QAAQ,YAAY,IAElC,CAACA,EAAc,QAAQ,MAAM,CAAC;AAEzC,GAKaC,KAAyB,CAAC/N,MAAkD;AACjF,QAAA8N,IAAgBF,GAAiB5N,CAAK;AAC5C,MAAI8N,MAAkB;AAGtB,WAAIA,EAAc,SACT,SAEF;AACT,GAKaE,KAAyB,CAAChO,MAAuD;AACtF,QAAA8N,IAAgBF,GAAiB5N,CAAK;AAC5C,MAAI8N,MAAkB,QAAW;AACzB,UAAAG,IAAaH,EAAc,QAAA,EAAU;AAC3C,WAAO,OAAO,KAAKG,CAAU,EAAE,IAAI,CAACC,OAC3B;AAAA,MACL,KAAKA;AAAA,MACL,OAAOD,EAAWC,CAAO;AAAA,IAC3B,EACD;AAAA,EAAA;AAEH,SAAO,CAAC;AACV,GAKaC,KAAyB,CAACnO,MAC9BgO,GAAuBhO,CAAK,EAAE,SAAS;","x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,139,140,141,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164]}