1 line
360 KiB
Plaintext
1 line
360 KiB
Plaintext
{"version":3,"file":"layout-10a68736.js","sources":["../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isSymbol.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_arrayMap.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseToString.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_trimmedEndIndex.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseTrim.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/toNumber.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/toFinite.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/toInteger.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/identity.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseCreate.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_apply.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/noop.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_copyArray.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_shortOut.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/constant.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_defineProperty.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseSetToString.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_setToString.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_arrayEach.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseFindIndex.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIsNaN.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_strictIndexOf.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIndexOf.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_arrayIncludes.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_isIndex.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseAssignValue.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_assignValue.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_copyObject.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_overRest.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseRest.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_isIterateeCall.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_createAssigner.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseTimes.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_arrayLikeKeys.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/keys.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_nativeKeysIn.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseKeysIn.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/keysIn.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_isKey.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_memoizeCapped.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_stringToPath.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/toString.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_castPath.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_toKey.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseGet.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/get.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_arrayPush.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_isFlattenable.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseFlatten.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/flatten.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_flatRest.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_arrayReduce.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_stackClear.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_stackDelete.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_stackGet.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_stackHas.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_stackSet.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_Stack.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseAssign.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseAssignIn.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_cloneBuffer.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_arrayFilter.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/stubArray.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getSymbols.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_copySymbols.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getSymbolsIn.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_copySymbolsIn.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseGetAllKeys.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getAllKeys.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getAllKeysIn.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_initCloneArray.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_Uint8Array.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_cloneArrayBuffer.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_cloneDataView.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_cloneRegExp.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_cloneSymbol.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_cloneTypedArray.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_initCloneByTag.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_initCloneObject.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIsMap.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isMap.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIsSet.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isSet.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseClone.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/cloneDeep.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_setCacheAdd.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_setCacheHas.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_SetCache.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_arraySome.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_cacheHas.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_equalArrays.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_mapToArray.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_setToArray.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_equalByTag.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_equalObjects.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIsEqualDeep.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIsEqual.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIsMatch.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_isStrictComparable.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getMatchData.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_matchesStrictComparable.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseMatches.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseHasIn.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_hasPath.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/hasIn.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseMatchesProperty.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseProperty.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_basePropertyDeep.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/property.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIteratee.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_createBaseFor.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseFor.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseForOwn.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_createBaseEach.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseEach.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/now.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/defaults.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_assignMergeValue.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isArrayLikeObject.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_safeGet.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/toPlainObject.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseMergeDeep.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseMerge.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_arrayIncludesWith.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/last.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_castFunction.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/forEach.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseFilter.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/filter.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_createFind.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/findIndex.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/find.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseMap.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/map.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/forIn.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseGt.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseHas.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/has.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseValues.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/values.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isUndefined.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseLt.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/mapValues.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseExtremum.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/max.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/merge.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/min.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/minBy.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseSet.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_basePickBy.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseSortBy.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_compareAscending.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_compareMultiple.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseOrderBy.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_basePick.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/pick.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseRange.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_createRange.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/range.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseReduce.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/reduce.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/sortBy.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_createSet.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseUniq.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/union.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/uniqueId.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseZipObject.js","../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/zipObject.js","../../../node_modules/.pnpm/dagre-d3-es@7.0.9/node_modules/dagre-d3-es/src/graphlib/graph.js","../../../node_modules/.pnpm/dagre-d3-es@7.0.9/node_modules/dagre-d3-es/src/dagre/data/list.js","../../../node_modules/.pnpm/dagre-d3-es@7.0.9/node_modules/dagre-d3-es/src/dagre/greedy-fas.js","../../../node_modules/.pnpm/dagre-d3-es@7.0.9/node_modules/dagre-d3-es/src/dagre/acyclic.js","../../../node_modules/.pnpm/dagre-d3-es@7.0.9/node_modules/dagre-d3-es/src/dagre/util.js","../../../node_modules/.pnpm/dagre-d3-es@7.0.9/node_modules/dagre-d3-es/src/dagre/add-border-segments.js","../../../node_modules/.pnpm/dagre-d3-es@7.0.9/node_modules/dagre-d3-es/src/dagre/coordinate-system.js","../../../node_modules/.pnpm/dagre-d3-es@7.0.9/node_modules/dagre-d3-es/src/dagre/normalize.js","../../../node_modules/.pnpm/dagre-d3-es@7.0.9/node_modules/dagre-d3-es/src/dagre/rank/util.js","../../../node_modules/.pnpm/dagre-d3-es@7.0.9/node_modules/dagre-d3-es/src/dagre/rank/feasible-tree.js","../../../node_modules/.pnpm/dagre-d3-es@7.0.9/node_modules/dagre-d3-es/src/graphlib/alg/topsort.js","../../../node_modules/.pnpm/dagre-d3-es@7.0.9/node_modules/dagre-d3-es/src/graphlib/alg/dfs.js","../../../node_modules/.pnpm/dagre-d3-es@7.0.9/node_modules/dagre-d3-es/src/graphlib/alg/postorder.js","../../../node_modules/.pnpm/dagre-d3-es@7.0.9/node_modules/dagre-d3-es/src/graphlib/alg/preorder.js","../../../node_modules/.pnpm/dagre-d3-es@7.0.9/node_modules/dagre-d3-es/src/dagre/rank/network-simplex.js","../../../node_modules/.pnpm/dagre-d3-es@7.0.9/node_modules/dagre-d3-es/src/dagre/rank/index.js","../../../node_modules/.pnpm/dagre-d3-es@7.0.9/node_modules/dagre-d3-es/src/dagre/nesting-graph.js","../../../node_modules/.pnpm/dagre-d3-es@7.0.9/node_modules/dagre-d3-es/src/dagre/order/add-subgraph-constraints.js","../../../node_modules/.pnpm/dagre-d3-es@7.0.9/node_modules/dagre-d3-es/src/dagre/order/build-layer-graph.js","../../../node_modules/.pnpm/dagre-d3-es@7.0.9/node_modules/dagre-d3-es/src/dagre/order/cross-count.js","../../../node_modules/.pnpm/dagre-d3-es@7.0.9/node_modules/dagre-d3-es/src/dagre/order/init-order.js","../../../node_modules/.pnpm/dagre-d3-es@7.0.9/node_modules/dagre-d3-es/src/dagre/order/barycenter.js","../../../node_modules/.pnpm/dagre-d3-es@7.0.9/node_modules/dagre-d3-es/src/dagre/order/resolve-conflicts.js","../../../node_modules/.pnpm/dagre-d3-es@7.0.9/node_modules/dagre-d3-es/src/dagre/order/sort.js","../../../node_modules/.pnpm/dagre-d3-es@7.0.9/node_modules/dagre-d3-es/src/dagre/order/sort-subgraph.js","../../../node_modules/.pnpm/dagre-d3-es@7.0.9/node_modules/dagre-d3-es/src/dagre/order/index.js","../../../node_modules/.pnpm/dagre-d3-es@7.0.9/node_modules/dagre-d3-es/src/dagre/parent-dummy-chains.js","../../../node_modules/.pnpm/dagre-d3-es@7.0.9/node_modules/dagre-d3-es/src/dagre/position/bk.js","../../../node_modules/.pnpm/dagre-d3-es@7.0.9/node_modules/dagre-d3-es/src/dagre/position/index.js","../../../node_modules/.pnpm/dagre-d3-es@7.0.9/node_modules/dagre-d3-es/src/dagre/layout.js"],"sourcesContent":["import baseGetTag from './_baseGetTag.js';\nimport isObjectLike from './isObjectLike.js';\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\nexport default isSymbol;\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\nexport default arrayMap;\n","import Symbol from './_Symbol.js';\nimport arrayMap from './_arrayMap.js';\nimport isArray from './isArray.js';\nimport isSymbol from './isSymbol.js';\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\nexport default baseToString;\n","/** Used to match a single whitespace character. */\nvar reWhitespace = /\\s/;\n\n/**\n * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace\n * character of `string`.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {number} Returns the index of the last non-whitespace character.\n */\nfunction trimmedEndIndex(string) {\n var index = string.length;\n\n while (index-- && reWhitespace.test(string.charAt(index))) {}\n return index;\n}\n\nexport default trimmedEndIndex;\n","import trimmedEndIndex from './_trimmedEndIndex.js';\n\n/** Used to match leading whitespace. */\nvar reTrimStart = /^\\s+/;\n\n/**\n * The base implementation of `_.trim`.\n *\n * @private\n * @param {string} string The string to trim.\n * @returns {string} Returns the trimmed string.\n */\nfunction baseTrim(string) {\n return string\n ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')\n : string;\n}\n\nexport default baseTrim;\n","import baseTrim from './_baseTrim.js';\nimport isObject from './isObject.js';\nimport isSymbol from './isSymbol.js';\n\n/** Used as references for various `Number` constants. */\nvar NAN = 0 / 0;\n\n/** Used to detect bad signed hexadecimal string values. */\nvar reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\n/** Used to detect binary string values. */\nvar reIsBinary = /^0b[01]+$/i;\n\n/** Used to detect octal string values. */\nvar reIsOctal = /^0o[0-7]+$/i;\n\n/** Built-in method references without a dependency on `root`. */\nvar freeParseInt = parseInt;\n\n/**\n * Converts `value` to a number.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n * @example\n *\n * _.toNumber(3.2);\n * // => 3.2\n *\n * _.toNumber(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toNumber(Infinity);\n * // => Infinity\n *\n * _.toNumber('3.2');\n * // => 3.2\n */\nfunction toNumber(value) {\n if (typeof value == 'number') {\n return value;\n }\n if (isSymbol(value)) {\n return NAN;\n }\n if (isObject(value)) {\n var other = typeof value.valueOf == 'function' ? value.valueOf() : value;\n value = isObject(other) ? (other + '') : other;\n }\n if (typeof value != 'string') {\n return value === 0 ? value : +value;\n }\n value = baseTrim(value);\n var isBinary = reIsBinary.test(value);\n return (isBinary || reIsOctal.test(value))\n ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n : (reIsBadHex.test(value) ? NAN : +value);\n}\n\nexport default toNumber;\n","import toNumber from './toNumber.js';\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0,\n MAX_INTEGER = 1.7976931348623157e+308;\n\n/**\n * Converts `value` to a finite number.\n *\n * @static\n * @memberOf _\n * @since 4.12.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted number.\n * @example\n *\n * _.toFinite(3.2);\n * // => 3.2\n *\n * _.toFinite(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toFinite(Infinity);\n * // => 1.7976931348623157e+308\n *\n * _.toFinite('3.2');\n * // => 3.2\n */\nfunction toFinite(value) {\n if (!value) {\n return value === 0 ? value : 0;\n }\n value = toNumber(value);\n if (value === INFINITY || value === -INFINITY) {\n var sign = (value < 0 ? -1 : 1);\n return sign * MAX_INTEGER;\n }\n return value === value ? value : 0;\n}\n\nexport default toFinite;\n","import toFinite from './toFinite.js';\n\n/**\n * Converts `value` to an integer.\n *\n * **Note:** This method is loosely based on\n * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted integer.\n * @example\n *\n * _.toInteger(3.2);\n * // => 3\n *\n * _.toInteger(Number.MIN_VALUE);\n * // => 0\n *\n * _.toInteger(Infinity);\n * // => 1.7976931348623157e+308\n *\n * _.toInteger('3.2');\n * // => 3\n */\nfunction toInteger(value) {\n var result = toFinite(value),\n remainder = result % 1;\n\n return result === result ? (remainder ? result - remainder : result) : 0;\n}\n\nexport default toInteger;\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\nexport default identity;\n","import isObject from './isObject.js';\n\n/** Built-in value references. */\nvar objectCreate = Object.create;\n\n/**\n * The base implementation of `_.create` without support for assigning\n * properties to the created object.\n *\n * @private\n * @param {Object} proto The object to inherit from.\n * @returns {Object} Returns the new object.\n */\nvar baseCreate = (function() {\n function object() {}\n return function(proto) {\n if (!isObject(proto)) {\n return {};\n }\n if (objectCreate) {\n return objectCreate(proto);\n }\n object.prototype = proto;\n var result = new object;\n object.prototype = undefined;\n return result;\n };\n}());\n\nexport default baseCreate;\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\nexport default apply;\n","/**\n * This method returns `undefined`.\n *\n * @static\n * @memberOf _\n * @since 2.3.0\n * @category Util\n * @example\n *\n * _.times(2, _.noop);\n * // => [undefined, undefined]\n */\nfunction noop() {\n // No operation performed.\n}\n\nexport default noop;\n","/**\n * Copies the values of `source` to `array`.\n *\n * @private\n * @param {Array} source The array to copy values from.\n * @param {Array} [array=[]] The array to copy values to.\n * @returns {Array} Returns `array`.\n */\nfunction copyArray(source, array) {\n var index = -1,\n length = source.length;\n\n array || (array = Array(length));\n while (++index < length) {\n array[index] = source[index];\n }\n return array;\n}\n\nexport default copyArray;\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\nexport default shortOut;\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\nexport default constant;\n","import getNative from './_getNative.js';\n\nvar defineProperty = (function() {\n try {\n var func = getNative(Object, 'defineProperty');\n func({}, '', {});\n return func;\n } catch (e) {}\n}());\n\nexport default defineProperty;\n","import constant from './constant.js';\nimport defineProperty from './_defineProperty.js';\nimport identity from './identity.js';\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\nexport default baseSetToString;\n","import baseSetToString from './_baseSetToString.js';\nimport shortOut from './_shortOut.js';\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\nexport default setToString;\n","/**\n * A specialized version of `_.forEach` for arrays without support for\n * iteratee 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 `array`.\n */\nfunction arrayEach(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (iteratee(array[index], index, array) === false) {\n break;\n }\n }\n return array;\n}\n\nexport default arrayEach;\n","/**\n * The base implementation of `_.findIndex` and `_.findLastIndex` without\n * support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} predicate The function invoked per iteration.\n * @param {number} fromIndex The index to search from.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction baseFindIndex(array, predicate, fromIndex, fromRight) {\n var length = array.length,\n index = fromIndex + (fromRight ? 1 : -1);\n\n while ((fromRight ? index-- : ++index < length)) {\n if (predicate(array[index], index, array)) {\n return index;\n }\n }\n return -1;\n}\n\nexport default baseFindIndex;\n","/**\n * The base implementation of `_.isNaN` without support for number objects.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.\n */\nfunction baseIsNaN(value) {\n return value !== value;\n}\n\nexport default baseIsNaN;\n","/**\n * A specialized version of `_.indexOf` which performs strict equality\n * comparisons of values, i.e. `===`.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction strictIndexOf(array, value, fromIndex) {\n var index = fromIndex - 1,\n length = array.length;\n\n while (++index < length) {\n if (array[index] === value) {\n return index;\n }\n }\n return -1;\n}\n\nexport default strictIndexOf;\n","import baseFindIndex from './_baseFindIndex.js';\nimport baseIsNaN from './_baseIsNaN.js';\nimport strictIndexOf from './_strictIndexOf.js';\n\n/**\n * The base implementation of `_.indexOf` without `fromIndex` bounds checks.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction baseIndexOf(array, value, fromIndex) {\n return value === value\n ? strictIndexOf(array, value, fromIndex)\n : baseFindIndex(array, baseIsNaN, fromIndex);\n}\n\nexport default baseIndexOf;\n","import baseIndexOf from './_baseIndexOf.js';\n\n/**\n * A specialized version of `_.includes` for arrays without support for\n * specifying an index to search from.\n *\n * @private\n * @param {Array} [array] The array to inspect.\n * @param {*} target The value to search for.\n * @returns {boolean} Returns `true` if `target` is found, else `false`.\n */\nfunction arrayIncludes(array, value) {\n var length = array == null ? 0 : array.length;\n return !!length && baseIndexOf(array, value, 0) > -1;\n}\n\nexport default arrayIncludes;\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\nexport default isIndex;\n","import defineProperty from './_defineProperty.js';\n\n/**\n * The base implementation of `assignValue` and `assignMergeValue` without\n * value checks.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction baseAssignValue(object, key, value) {\n if (key == '__proto__' && defineProperty) {\n defineProperty(object, key, {\n 'configurable': true,\n 'enumerable': true,\n 'value': value,\n 'writable': true\n });\n } else {\n object[key] = value;\n }\n}\n\nexport default baseAssignValue;\n","import baseAssignValue from './_baseAssignValue.js';\nimport eq from './eq.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Assigns `value` to `key` of `object` if the existing value is not equivalent\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction assignValue(object, key, value) {\n var objValue = object[key];\n if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n}\n\nexport default assignValue;\n","import assignValue from './_assignValue.js';\nimport baseAssignValue from './_baseAssignValue.js';\n\n/**\n * Copies properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property identifiers to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @param {Function} [customizer] The function to customize copied values.\n * @returns {Object} Returns `object`.\n */\nfunction copyObject(source, props, object, customizer) {\n var isNew = !object;\n object || (object = {});\n\n var index = -1,\n length = props.length;\n\n while (++index < length) {\n var key = props[index];\n\n var newValue = customizer\n ? customizer(object[key], source[key], key, object, source)\n : undefined;\n\n if (newValue === undefined) {\n newValue = source[key];\n }\n if (isNew) {\n baseAssignValue(object, key, newValue);\n } else {\n assignValue(object, key, newValue);\n }\n }\n return object;\n}\n\nexport default copyObject;\n","import apply from './_apply.js';\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\nexport default overRest;\n","import identity from './identity.js';\nimport overRest from './_overRest.js';\nimport setToString from './_setToString.js';\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\nexport default baseRest;\n","import eq from './eq.js';\nimport isArrayLike from './isArrayLike.js';\nimport isIndex from './_isIndex.js';\nimport isObject from './isObject.js';\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\nexport default isIterateeCall;\n","import baseRest from './_baseRest.js';\nimport isIterateeCall from './_isIterateeCall.js';\n\n/**\n * Creates a function like `_.assign`.\n *\n * @private\n * @param {Function} assigner The function to assign values.\n * @returns {Function} Returns the new assigner function.\n */\nfunction createAssigner(assigner) {\n return baseRest(function(object, sources) {\n var index = -1,\n length = sources.length,\n customizer = length > 1 ? sources[length - 1] : undefined,\n guard = length > 2 ? sources[2] : undefined;\n\n customizer = (assigner.length > 3 && typeof customizer == 'function')\n ? (length--, customizer)\n : undefined;\n\n if (guard && isIterateeCall(sources[0], sources[1], guard)) {\n customizer = length < 3 ? undefined : customizer;\n length = 1;\n }\n object = Object(object);\n while (++index < length) {\n var source = sources[index];\n if (source) {\n assigner(object, source, index, customizer);\n }\n }\n return object;\n });\n}\n\nexport default createAssigner;\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\nexport default baseTimes;\n","import baseTimes from './_baseTimes.js';\nimport isArguments from './isArguments.js';\nimport isArray from './isArray.js';\nimport isBuffer from './isBuffer.js';\nimport isIndex from './_isIndex.js';\nimport isTypedArray from './isTypedArray.js';\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\nexport default arrayLikeKeys;\n","import arrayLikeKeys from './_arrayLikeKeys.js';\nimport baseKeys from './_baseKeys.js';\nimport isArrayLike from './isArrayLike.js';\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\nexport default keys;\n","/**\n * This function is like\n * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * except that it includes inherited enumerable properties.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction nativeKeysIn(object) {\n var result = [];\n if (object != null) {\n for (var key in Object(object)) {\n result.push(key);\n }\n }\n return result;\n}\n\nexport default nativeKeysIn;\n","import isObject from './isObject.js';\nimport isPrototype from './_isPrototype.js';\nimport nativeKeysIn from './_nativeKeysIn.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeysIn(object) {\n if (!isObject(object)) {\n return nativeKeysIn(object);\n }\n var isProto = isPrototype(object),\n result = [];\n\n for (var key in object) {\n if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {\n result.push(key);\n }\n }\n return result;\n}\n\nexport default baseKeysIn;\n","import arrayLikeKeys from './_arrayLikeKeys.js';\nimport baseKeysIn from './_baseKeysIn.js';\nimport isArrayLike from './isArrayLike.js';\n\n/**\n * Creates an array of the own and inherited enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keysIn(new Foo);\n * // => ['a', 'b', 'c'] (iteration order is not guaranteed)\n */\nfunction keysIn(object) {\n return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);\n}\n\nexport default keysIn;\n","import isArray from './isArray.js';\nimport isSymbol from './isSymbol.js';\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\nexport default isKey;\n","import memoize from './memoize.js';\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\nexport default memoizeCapped;\n","import memoizeCapped from './_memoizeCapped.js';\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\nexport default stringToPath;\n","import baseToString from './_baseToString.js';\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\nexport default toString;\n","import isArray from './isArray.js';\nimport isKey from './_isKey.js';\nimport stringToPath from './_stringToPath.js';\nimport toString from './toString.js';\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\nexport default castPath;\n","import isSymbol from './isSymbol.js';\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\nexport default toKey;\n","import castPath from './_castPath.js';\nimport toKey from './_toKey.js';\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\nexport default baseGet;\n","import baseGet from './_baseGet.js';\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\nexport default get;\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\nexport default arrayPush;\n","import Symbol from './_Symbol.js';\nimport isArguments from './isArguments.js';\nimport isArray from './isArray.js';\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\nexport default isFlattenable;\n","import arrayPush from './_arrayPush.js';\nimport isFlattenable from './_isFlattenable.js';\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\nexport default baseFlatten;\n","import baseFlatten from './_baseFlatten.js';\n\n/**\n * Flattens `array` a single level deep.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to flatten.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * _.flatten([1, [2, [3, [4]], 5]]);\n * // => [1, 2, [3, [4]], 5]\n */\nfunction flatten(array) {\n var length = array == null ? 0 : array.length;\n return length ? baseFlatten(array, 1) : [];\n}\n\nexport default flatten;\n","import flatten from './flatten.js';\nimport overRest from './_overRest.js';\nimport setToString from './_setToString.js';\n\n/**\n * A specialized version of `baseRest` which flattens the rest array.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @returns {Function} Returns the new function.\n */\nfunction flatRest(func) {\n return setToString(overRest(func, undefined, flatten), func + '');\n}\n\nexport default flatRest;\n","/**\n * A specialized version of `_.reduce` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @param {boolean} [initAccum] Specify using the first element of `array` as\n * the initial value.\n * @returns {*} Returns the accumulated value.\n */\nfunction arrayReduce(array, iteratee, accumulator, initAccum) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n if (initAccum && length) {\n accumulator = array[++index];\n }\n while (++index < length) {\n accumulator = iteratee(accumulator, array[index], index, array);\n }\n return accumulator;\n}\n\nexport default arrayReduce;\n","import ListCache from './_ListCache.js';\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\nexport default 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\nexport default 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\nexport default 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\nexport default stackHas;\n","import ListCache from './_ListCache.js';\nimport Map from './_Map.js';\nimport MapCache from './_MapCache.js';\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\nexport default stackSet;\n","import ListCache from './_ListCache.js';\nimport stackClear from './_stackClear.js';\nimport stackDelete from './_stackDelete.js';\nimport stackGet from './_stackGet.js';\nimport stackHas from './_stackHas.js';\nimport stackSet from './_stackSet.js';\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\nexport default Stack;\n","import copyObject from './_copyObject.js';\nimport keys from './keys.js';\n\n/**\n * The base implementation of `_.assign` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\nfunction baseAssign(object, source) {\n return object && copyObject(source, keys(source), object);\n}\n\nexport default baseAssign;\n","import copyObject from './_copyObject.js';\nimport keysIn from './keysIn.js';\n\n/**\n * The base implementation of `_.assignIn` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\nfunction baseAssignIn(object, source) {\n return object && copyObject(source, keysIn(source), object);\n}\n\nexport default baseAssignIn;\n","import root from './_root.js';\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined,\n allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined;\n\n/**\n * Creates a clone of `buffer`.\n *\n * @private\n * @param {Buffer} buffer The buffer to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Buffer} Returns the cloned buffer.\n */\nfunction cloneBuffer(buffer, isDeep) {\n if (isDeep) {\n return buffer.slice();\n }\n var length = buffer.length,\n result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);\n\n buffer.copy(result);\n return result;\n}\n\nexport default cloneBuffer;\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\nexport default 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\nexport default stubArray;\n","import arrayFilter from './_arrayFilter.js';\nimport stubArray from './stubArray.js';\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\nexport default getSymbols;\n","import copyObject from './_copyObject.js';\nimport getSymbols from './_getSymbols.js';\n\n/**\n * Copies own symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\nfunction copySymbols(source, object) {\n return copyObject(source, getSymbols(source), object);\n}\n\nexport default copySymbols;\n","import arrayPush from './_arrayPush.js';\nimport getPrototype from './_getPrototype.js';\nimport getSymbols from './_getSymbols.js';\nimport stubArray from './stubArray.js';\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 and inherited 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 getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {\n var result = [];\n while (object) {\n arrayPush(result, getSymbols(object));\n object = getPrototype(object);\n }\n return result;\n};\n\nexport default getSymbolsIn;\n","import copyObject from './_copyObject.js';\nimport getSymbolsIn from './_getSymbolsIn.js';\n\n/**\n * Copies own and inherited symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\nfunction copySymbolsIn(source, object) {\n return copyObject(source, getSymbolsIn(source), object);\n}\n\nexport default copySymbolsIn;\n","import arrayPush from './_arrayPush.js';\nimport isArray from './isArray.js';\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\nexport default baseGetAllKeys;\n","import baseGetAllKeys from './_baseGetAllKeys.js';\nimport getSymbols from './_getSymbols.js';\nimport keys from './keys.js';\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\nexport default getAllKeys;\n","import baseGetAllKeys from './_baseGetAllKeys.js';\nimport getSymbolsIn from './_getSymbolsIn.js';\nimport keysIn from './keysIn.js';\n\n/**\n * Creates an array of own and inherited enumerable property names and\n * 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 getAllKeysIn(object) {\n return baseGetAllKeys(object, keysIn, getSymbolsIn);\n}\n\nexport default getAllKeysIn;\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 * Initializes an array clone.\n *\n * @private\n * @param {Array} array The array to clone.\n * @returns {Array} Returns the initialized clone.\n */\nfunction initCloneArray(array) {\n var length = array.length,\n result = new array.constructor(length);\n\n // Add properties assigned by `RegExp#exec`.\n if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {\n result.index = array.index;\n result.input = array.input;\n }\n return result;\n}\n\nexport default initCloneArray;\n","import root from './_root.js';\n\n/** Built-in value references. */\nvar Uint8Array = root.Uint8Array;\n\nexport default Uint8Array;\n","import Uint8Array from './_Uint8Array.js';\n\n/**\n * Creates a clone of `arrayBuffer`.\n *\n * @private\n * @param {ArrayBuffer} arrayBuffer The array buffer to clone.\n * @returns {ArrayBuffer} Returns the cloned array buffer.\n */\nfunction cloneArrayBuffer(arrayBuffer) {\n var result = new arrayBuffer.constructor(arrayBuffer.byteLength);\n new Uint8Array(result).set(new Uint8Array(arrayBuffer));\n return result;\n}\n\nexport default cloneArrayBuffer;\n","import cloneArrayBuffer from './_cloneArrayBuffer.js';\n\n/**\n * Creates a clone of `dataView`.\n *\n * @private\n * @param {Object} dataView The data view to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned data view.\n */\nfunction cloneDataView(dataView, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;\n return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);\n}\n\nexport default cloneDataView;\n","/** Used to match `RegExp` flags from their coerced string values. */\nvar reFlags = /\\w*$/;\n\n/**\n * Creates a clone of `regexp`.\n *\n * @private\n * @param {Object} regexp The regexp to clone.\n * @returns {Object} Returns the cloned regexp.\n */\nfunction cloneRegExp(regexp) {\n var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));\n result.lastIndex = regexp.lastIndex;\n return result;\n}\n\nexport default cloneRegExp;\n","import Symbol from './_Symbol.js';\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 * Creates a clone of the `symbol` object.\n *\n * @private\n * @param {Object} symbol The symbol object to clone.\n * @returns {Object} Returns the cloned symbol object.\n */\nfunction cloneSymbol(symbol) {\n return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};\n}\n\nexport default cloneSymbol;\n","import cloneArrayBuffer from './_cloneArrayBuffer.js';\n\n/**\n * Creates a clone of `typedArray`.\n *\n * @private\n * @param {Object} typedArray The typed array to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned typed array.\n */\nfunction cloneTypedArray(typedArray, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;\n return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);\n}\n\nexport default cloneTypedArray;\n","import cloneArrayBuffer from './_cloneArrayBuffer.js';\nimport cloneDataView from './_cloneDataView.js';\nimport cloneRegExp from './_cloneRegExp.js';\nimport cloneSymbol from './_cloneSymbol.js';\nimport cloneTypedArray from './_cloneTypedArray.js';\n\n/** `Object#toString` result references. */\nvar boolTag = '[object Boolean]',\n dateTag = '[object Date]',\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 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/**\n * Initializes an object clone based on its `toStringTag`.\n *\n * **Note:** This function only supports cloning values with tags of\n * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.\n *\n * @private\n * @param {Object} object The object to clone.\n * @param {string} tag The `toStringTag` of the object to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneByTag(object, tag, isDeep) {\n var Ctor = object.constructor;\n switch (tag) {\n case arrayBufferTag:\n return cloneArrayBuffer(object);\n\n case boolTag:\n case dateTag:\n return new Ctor(+object);\n\n case dataViewTag:\n return cloneDataView(object, isDeep);\n\n case float32Tag: case float64Tag:\n case int8Tag: case int16Tag: case int32Tag:\n case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:\n return cloneTypedArray(object, isDeep);\n\n case mapTag:\n return new Ctor;\n\n case numberTag:\n case stringTag:\n return new Ctor(object);\n\n case regexpTag:\n return cloneRegExp(object);\n\n case setTag:\n return new Ctor;\n\n case symbolTag:\n return cloneSymbol(object);\n }\n}\n\nexport default initCloneByTag;\n","import baseCreate from './_baseCreate.js';\nimport getPrototype from './_getPrototype.js';\nimport isPrototype from './_isPrototype.js';\n\n/**\n * Initializes an object clone.\n *\n * @private\n * @param {Object} object The object to clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneObject(object) {\n return (typeof object.constructor == 'function' && !isPrototype(object))\n ? baseCreate(getPrototype(object))\n : {};\n}\n\nexport default initCloneObject;\n","import getTag from './_getTag.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar mapTag = '[object Map]';\n\n/**\n * The base implementation of `_.isMap` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a map, else `false`.\n */\nfunction baseIsMap(value) {\n return isObjectLike(value) && getTag(value) == mapTag;\n}\n\nexport default baseIsMap;\n","import baseIsMap from './_baseIsMap.js';\nimport baseUnary from './_baseUnary.js';\nimport nodeUtil from './_nodeUtil.js';\n\n/* Node.js helper references. */\nvar nodeIsMap = nodeUtil && nodeUtil.isMap;\n\n/**\n * Checks if `value` is classified as a `Map` object.\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 map, else `false`.\n * @example\n *\n * _.isMap(new Map);\n * // => true\n *\n * _.isMap(new WeakMap);\n * // => false\n */\nvar isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;\n\nexport default isMap;\n","import getTag from './_getTag.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar setTag = '[object Set]';\n\n/**\n * The base implementation of `_.isSet` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a set, else `false`.\n */\nfunction baseIsSet(value) {\n return isObjectLike(value) && getTag(value) == setTag;\n}\n\nexport default baseIsSet;\n","import baseIsSet from './_baseIsSet.js';\nimport baseUnary from './_baseUnary.js';\nimport nodeUtil from './_nodeUtil.js';\n\n/* Node.js helper references. */\nvar nodeIsSet = nodeUtil && nodeUtil.isSet;\n\n/**\n * Checks if `value` is classified as a `Set` object.\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 set, else `false`.\n * @example\n *\n * _.isSet(new Set);\n * // => true\n *\n * _.isSet(new WeakSet);\n * // => false\n */\nvar isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;\n\nexport default isSet;\n","import Stack from './_Stack.js';\nimport arrayEach from './_arrayEach.js';\nimport assignValue from './_assignValue.js';\nimport baseAssign from './_baseAssign.js';\nimport baseAssignIn from './_baseAssignIn.js';\nimport cloneBuffer from './_cloneBuffer.js';\nimport copyArray from './_copyArray.js';\nimport copySymbols from './_copySymbols.js';\nimport copySymbolsIn from './_copySymbolsIn.js';\nimport getAllKeys from './_getAllKeys.js';\nimport getAllKeysIn from './_getAllKeysIn.js';\nimport getTag from './_getTag.js';\nimport initCloneArray from './_initCloneArray.js';\nimport initCloneByTag from './_initCloneByTag.js';\nimport initCloneObject from './_initCloneObject.js';\nimport isArray from './isArray.js';\nimport isBuffer from './isBuffer.js';\nimport isMap from './isMap.js';\nimport isObject from './isObject.js';\nimport isSet from './isSet.js';\nimport keys from './keys.js';\nimport keysIn from './keysIn.js';\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_DEEP_FLAG = 1,\n CLONE_FLAT_FLAG = 2,\n CLONE_SYMBOLS_FLAG = 4;\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 genTag = '[object GeneratorFunction]',\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 symbolTag = '[object Symbol]',\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 supported by `_.clone`. */\nvar cloneableTags = {};\ncloneableTags[argsTag] = cloneableTags[arrayTag] =\ncloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =\ncloneableTags[boolTag] = cloneableTags[dateTag] =\ncloneableTags[float32Tag] = cloneableTags[float64Tag] =\ncloneableTags[int8Tag] = cloneableTags[int16Tag] =\ncloneableTags[int32Tag] = cloneableTags[mapTag] =\ncloneableTags[numberTag] = cloneableTags[objectTag] =\ncloneableTags[regexpTag] = cloneableTags[setTag] =\ncloneableTags[stringTag] = cloneableTags[symbolTag] =\ncloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =\ncloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;\ncloneableTags[errorTag] = cloneableTags[funcTag] =\ncloneableTags[weakMapTag] = false;\n\n/**\n * The base implementation of `_.clone` and `_.cloneDeep` which tracks\n * traversed objects.\n *\n * @private\n * @param {*} value The value to clone.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Deep clone\n * 2 - Flatten inherited properties\n * 4 - Clone symbols\n * @param {Function} [customizer] The function to customize cloning.\n * @param {string} [key] The key of `value`.\n * @param {Object} [object] The parent object of `value`.\n * @param {Object} [stack] Tracks traversed objects and their clone counterparts.\n * @returns {*} Returns the cloned value.\n */\nfunction baseClone(value, bitmask, customizer, key, object, stack) {\n var result,\n isDeep = bitmask & CLONE_DEEP_FLAG,\n isFlat = bitmask & CLONE_FLAT_FLAG,\n isFull = bitmask & CLONE_SYMBOLS_FLAG;\n\n if (customizer) {\n result = object ? customizer(value, key, object, stack) : customizer(value);\n }\n if (result !== undefined) {\n return result;\n }\n if (!isObject(value)) {\n return value;\n }\n var isArr = isArray(value);\n if (isArr) {\n result = initCloneArray(value);\n if (!isDeep) {\n return copyArray(value, result);\n }\n } else {\n var tag = getTag(value),\n isFunc = tag == funcTag || tag == genTag;\n\n if (isBuffer(value)) {\n return cloneBuffer(value, isDeep);\n }\n if (tag == objectTag || tag == argsTag || (isFunc && !object)) {\n result = (isFlat || isFunc) ? {} : initCloneObject(value);\n if (!isDeep) {\n return isFlat\n ? copySymbolsIn(value, baseAssignIn(result, value))\n : copySymbols(value, baseAssign(result, value));\n }\n } else {\n if (!cloneableTags[tag]) {\n return object ? value : {};\n }\n result = initCloneByTag(value, tag, isDeep);\n }\n }\n // Check for circular references and return its corresponding clone.\n stack || (stack = new Stack);\n var stacked = stack.get(value);\n if (stacked) {\n return stacked;\n }\n stack.set(value, result);\n\n if (isSet(value)) {\n value.forEach(function(subValue) {\n result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));\n });\n } else if (isMap(value)) {\n value.forEach(function(subValue, key) {\n result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));\n });\n }\n\n var keysFunc = isFull\n ? (isFlat ? getAllKeysIn : getAllKeys)\n : (isFlat ? keysIn : keys);\n\n var props = isArr ? undefined : keysFunc(value);\n arrayEach(props || value, function(subValue, key) {\n if (props) {\n key = subValue;\n subValue = value[key];\n }\n // Recursively populate clone (susceptible to call stack limits).\n assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));\n });\n return result;\n}\n\nexport default baseClone;\n","import baseClone from './_baseClone.js';\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_DEEP_FLAG = 1,\n CLONE_SYMBOLS_FLAG = 4;\n\n/**\n * This method is like `_.clone` except that it recursively clones `value`.\n *\n * @static\n * @memberOf _\n * @since 1.0.0\n * @category Lang\n * @param {*} value The value to recursively clone.\n * @returns {*} Returns the deep cloned value.\n * @see _.clone\n * @example\n *\n * var objects = [{ 'a': 1 }, { 'b': 2 }];\n *\n * var deep = _.cloneDeep(objects);\n * console.log(deep[0] === objects[0]);\n * // => false\n */\nfunction cloneDeep(value) {\n return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);\n}\n\nexport default cloneDeep;\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\nexport default 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\nexport default setCacheHas;\n","import MapCache from './_MapCache.js';\nimport setCacheAdd from './_setCacheAdd.js';\nimport setCacheHas from './_setCacheHas.js';\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\nexport default 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\nexport default 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\nexport default cacheHas;\n","import SetCache from './_SetCache.js';\nimport arraySome from './_arraySome.js';\nimport cacheHas from './_cacheHas.js';\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\nexport default equalArrays;\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\nexport default 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\nexport default setToArray;\n","import Symbol from './_Symbol.js';\nimport Uint8Array from './_Uint8Array.js';\nimport eq from './eq.js';\nimport equalArrays from './_equalArrays.js';\nimport mapToArray from './_mapToArray.js';\nimport setToArray from './_setToArray.js';\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\nexport default equalByTag;\n","import getAllKeys from './_getAllKeys.js';\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\nexport default equalObjects;\n","import Stack from './_Stack.js';\nimport equalArrays from './_equalArrays.js';\nimport equalByTag from './_equalByTag.js';\nimport equalObjects from './_equalObjects.js';\nimport getTag from './_getTag.js';\nimport isArray from './isArray.js';\nimport isBuffer from './isBuffer.js';\nimport isTypedArray from './isTypedArray.js';\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\nexport default baseIsEqualDeep;\n","import baseIsEqualDeep from './_baseIsEqualDeep.js';\nimport isObjectLike from './isObjectLike.js';\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\nexport default baseIsEqual;\n","import Stack from './_Stack.js';\nimport baseIsEqual from './_baseIsEqual.js';\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\nexport default baseIsMatch;\n","import isObject from './isObject.js';\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\nexport default isStrictComparable;\n","import isStrictComparable from './_isStrictComparable.js';\nimport keys from './keys.js';\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\nexport default 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\nexport default matchesStrictComparable;\n","import baseIsMatch from './_baseIsMatch.js';\nimport getMatchData from './_getMatchData.js';\nimport matchesStrictComparable from './_matchesStrictComparable.js';\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\nexport default baseMatches;\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\nexport default baseHasIn;\n","import castPath from './_castPath.js';\nimport isArguments from './isArguments.js';\nimport isArray from './isArray.js';\nimport isIndex from './_isIndex.js';\nimport isLength from './isLength.js';\nimport toKey from './_toKey.js';\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\nexport default hasPath;\n","import baseHasIn from './_baseHasIn.js';\nimport hasPath from './_hasPath.js';\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\nexport default hasIn;\n","import baseIsEqual from './_baseIsEqual.js';\nimport get from './get.js';\nimport hasIn from './hasIn.js';\nimport isKey from './_isKey.js';\nimport isStrictComparable from './_isStrictComparable.js';\nimport matchesStrictComparable from './_matchesStrictComparable.js';\nimport toKey from './_toKey.js';\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\nexport default baseMatchesProperty;\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\nexport default baseProperty;\n","import baseGet from './_baseGet.js';\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\nexport default basePropertyDeep;\n","import baseProperty from './_baseProperty.js';\nimport basePropertyDeep from './_basePropertyDeep.js';\nimport isKey from './_isKey.js';\nimport toKey from './_toKey.js';\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\nexport default property;\n","import baseMatches from './_baseMatches.js';\nimport baseMatchesProperty from './_baseMatchesProperty.js';\nimport identity from './identity.js';\nimport isArray from './isArray.js';\nimport property from './property.js';\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\nexport default 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\nexport default createBaseFor;\n","import createBaseFor from './_createBaseFor.js';\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\nexport default baseFor;\n","import baseFor from './_baseFor.js';\nimport keys from './keys.js';\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\nexport default baseForOwn;\n","import isArrayLike from './isArrayLike.js';\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\nexport default createBaseEach;\n","import baseForOwn from './_baseForOwn.js';\nimport createBaseEach from './_createBaseEach.js';\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\nexport default baseEach;\n","import root from './_root.js';\n\n/**\n * Gets the timestamp of the number of milliseconds that have elapsed since\n * the Unix epoch (1 January 1970 00:00:00 UTC).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Date\n * @returns {number} Returns the timestamp.\n * @example\n *\n * _.defer(function(stamp) {\n * console.log(_.now() - stamp);\n * }, _.now());\n * // => Logs the number of milliseconds it took for the deferred invocation.\n */\nvar now = function() {\n return root.Date.now();\n};\n\nexport default now;\n","import baseRest from './_baseRest.js';\nimport eq from './eq.js';\nimport isIterateeCall from './_isIterateeCall.js';\nimport keysIn from './keysIn.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Assigns own and inherited enumerable string keyed properties of source\n * objects to the destination object for all destination properties that\n * resolve to `undefined`. Source objects are applied from left to right.\n * Once a property is set, additional values of the same property are ignored.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.defaultsDeep\n * @example\n *\n * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });\n * // => { 'a': 1, 'b': 2 }\n */\nvar defaults = baseRest(function(object, sources) {\n object = Object(object);\n\n var index = -1;\n var length = sources.length;\n var guard = length > 2 ? sources[2] : undefined;\n\n if (guard && isIterateeCall(sources[0], sources[1], guard)) {\n length = 1;\n }\n\n while (++index < length) {\n var source = sources[index];\n var props = keysIn(source);\n var propsIndex = -1;\n var propsLength = props.length;\n\n while (++propsIndex < propsLength) {\n var key = props[propsIndex];\n var value = object[key];\n\n if (value === undefined ||\n (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) {\n object[key] = source[key];\n }\n }\n }\n\n return object;\n});\n\nexport default defaults;\n","import baseAssignValue from './_baseAssignValue.js';\nimport eq from './eq.js';\n\n/**\n * This function is like `assignValue` except that it doesn't assign\n * `undefined` values.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction assignMergeValue(object, key, value) {\n if ((value !== undefined && !eq(object[key], value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n}\n\nexport default assignMergeValue;\n","import isArrayLike from './isArrayLike.js';\nimport isObjectLike from './isObjectLike.js';\n\n/**\n * This method is like `_.isArrayLike` except that it also checks if `value`\n * is an object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array-like object,\n * else `false`.\n * @example\n *\n * _.isArrayLikeObject([1, 2, 3]);\n * // => true\n *\n * _.isArrayLikeObject(document.body.children);\n * // => true\n *\n * _.isArrayLikeObject('abc');\n * // => false\n *\n * _.isArrayLikeObject(_.noop);\n * // => false\n */\nfunction isArrayLikeObject(value) {\n return isObjectLike(value) && isArrayLike(value);\n}\n\nexport default isArrayLikeObject;\n","/**\n * Gets the value at `key`, unless `key` is \"__proto__\" or \"constructor\".\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction safeGet(object, key) {\n if (key === 'constructor' && typeof object[key] === 'function') {\n return;\n }\n\n if (key == '__proto__') {\n return;\n }\n\n return object[key];\n}\n\nexport default safeGet;\n","import copyObject from './_copyObject.js';\nimport keysIn from './keysIn.js';\n\n/**\n * Converts `value` to a plain object flattening inherited enumerable string\n * keyed properties of `value` to own properties of the plain object.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {Object} Returns the converted plain object.\n * @example\n *\n * function Foo() {\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.assign({ 'a': 1 }, new Foo);\n * // => { 'a': 1, 'b': 2 }\n *\n * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));\n * // => { 'a': 1, 'b': 2, 'c': 3 }\n */\nfunction toPlainObject(value) {\n return copyObject(value, keysIn(value));\n}\n\nexport default toPlainObject;\n","import assignMergeValue from './_assignMergeValue.js';\nimport cloneBuffer from './_cloneBuffer.js';\nimport cloneTypedArray from './_cloneTypedArray.js';\nimport copyArray from './_copyArray.js';\nimport initCloneObject from './_initCloneObject.js';\nimport isArguments from './isArguments.js';\nimport isArray from './isArray.js';\nimport isArrayLikeObject from './isArrayLikeObject.js';\nimport isBuffer from './isBuffer.js';\nimport isFunction from './isFunction.js';\nimport isObject from './isObject.js';\nimport isPlainObject from './isPlainObject.js';\nimport isTypedArray from './isTypedArray.js';\nimport safeGet from './_safeGet.js';\nimport toPlainObject from './toPlainObject.js';\n\n/**\n * A specialized version of `baseMerge` for arrays and objects which performs\n * deep merges and tracks traversed objects enabling objects with circular\n * references to be merged.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {string} key The key of the value to merge.\n * @param {number} srcIndex The index of `source`.\n * @param {Function} mergeFunc The function to merge values.\n * @param {Function} [customizer] The function to customize assigned values.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n */\nfunction baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {\n var objValue = safeGet(object, key),\n srcValue = safeGet(source, key),\n stacked = stack.get(srcValue);\n\n if (stacked) {\n assignMergeValue(object, key, stacked);\n return;\n }\n var newValue = customizer\n ? customizer(objValue, srcValue, (key + ''), object, source, stack)\n : undefined;\n\n var isCommon = newValue === undefined;\n\n if (isCommon) {\n var isArr = isArray(srcValue),\n isBuff = !isArr && isBuffer(srcValue),\n isTyped = !isArr && !isBuff && isTypedArray(srcValue);\n\n newValue = srcValue;\n if (isArr || isBuff || isTyped) {\n if (isArray(objValue)) {\n newValue = objValue;\n }\n else if (isArrayLikeObject(objValue)) {\n newValue = copyArray(objValue);\n }\n else if (isBuff) {\n isCommon = false;\n newValue = cloneBuffer(srcValue, true);\n }\n else if (isTyped) {\n isCommon = false;\n newValue = cloneTypedArray(srcValue, true);\n }\n else {\n newValue = [];\n }\n }\n else if (isPlainObject(srcValue) || isArguments(srcValue)) {\n newValue = objValue;\n if (isArguments(objValue)) {\n newValue = toPlainObject(objValue);\n }\n else if (!isObject(objValue) || isFunction(objValue)) {\n newValue = initCloneObject(srcValue);\n }\n }\n else {\n isCommon = false;\n }\n }\n if (isCommon) {\n // Recursively merge objects and arrays (susceptible to call stack limits).\n stack.set(srcValue, newValue);\n mergeFunc(newValue, srcValue, srcIndex, customizer, stack);\n stack['delete'](srcValue);\n }\n assignMergeValue(object, key, newValue);\n}\n\nexport default baseMergeDeep;\n","import Stack from './_Stack.js';\nimport assignMergeValue from './_assignMergeValue.js';\nimport baseFor from './_baseFor.js';\nimport baseMergeDeep from './_baseMergeDeep.js';\nimport isObject from './isObject.js';\nimport keysIn from './keysIn.js';\nimport safeGet from './_safeGet.js';\n\n/**\n * The base implementation of `_.merge` without support for multiple sources.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {number} srcIndex The index of `source`.\n * @param {Function} [customizer] The function to customize merged values.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n */\nfunction baseMerge(object, source, srcIndex, customizer, stack) {\n if (object === source) {\n return;\n }\n baseFor(source, function(srcValue, key) {\n stack || (stack = new Stack);\n if (isObject(srcValue)) {\n baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);\n }\n else {\n var newValue = customizer\n ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)\n : undefined;\n\n if (newValue === undefined) {\n newValue = srcValue;\n }\n assignMergeValue(object, key, newValue);\n }\n }, keysIn);\n}\n\nexport default baseMerge;\n","/**\n * This function is like `arrayIncludes` except that it accepts a comparator.\n *\n * @private\n * @param {Array} [array] The array to inspect.\n * @param {*} target The value to search for.\n * @param {Function} comparator The comparator invoked per element.\n * @returns {boolean} Returns `true` if `target` is found, else `false`.\n */\nfunction arrayIncludesWith(array, value, comparator) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (comparator(value, array[index])) {\n return true;\n }\n }\n return false;\n}\n\nexport default arrayIncludesWith;\n","/**\n * Gets the last element of `array`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to query.\n * @returns {*} Returns the last element of `array`.\n * @example\n *\n * _.last([1, 2, 3]);\n * // => 3\n */\nfunction last(array) {\n var length = array == null ? 0 : array.length;\n return length ? array[length - 1] : undefined;\n}\n\nexport default last;\n","import identity from './identity.js';\n\n/**\n * Casts `value` to `identity` if it's not a function.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {Function} Returns cast function.\n */\nfunction castFunction(value) {\n return typeof value == 'function' ? value : identity;\n}\n\nexport default castFunction;\n","import arrayEach from './_arrayEach.js';\nimport baseEach from './_baseEach.js';\nimport castFunction from './_castFunction.js';\nimport isArray from './isArray.js';\n\n/**\n * Iterates over elements of `collection` and invokes `iteratee` for each element.\n * The iteratee is invoked with three arguments: (value, index|key, collection).\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * **Note:** As with other \"Collections\" methods, objects with a \"length\"\n * property are iterated like arrays. To avoid this behavior use `_.forIn`\n * or `_.forOwn` for object iteration.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @alias each\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n * @see _.forEachRight\n * @example\n *\n * _.forEach([1, 2], function(value) {\n * console.log(value);\n * });\n * // => Logs `1` then `2`.\n *\n * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'a' then 'b' (iteration order is not guaranteed).\n */\nfunction forEach(collection, iteratee) {\n var func = isArray(collection) ? arrayEach : baseEach;\n return func(collection, castFunction(iteratee));\n}\n\nexport default forEach;\n","import baseEach from './_baseEach.js';\n\n/**\n * The base implementation of `_.filter` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\nfunction baseFilter(collection, predicate) {\n var result = [];\n baseEach(collection, function(value, index, collection) {\n if (predicate(value, index, collection)) {\n result.push(value);\n }\n });\n return result;\n}\n\nexport default baseFilter;\n","import arrayFilter from './_arrayFilter.js';\nimport baseFilter from './_baseFilter.js';\nimport baseIteratee from './_baseIteratee.js';\nimport isArray from './isArray.js';\n\n/**\n * Iterates over elements of `collection`, returning an array of all elements\n * `predicate` returns truthy for. The predicate is invoked with three\n * arguments: (value, index|key, collection).\n *\n * **Note:** Unlike `_.remove`, this method returns a new array.\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} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n * @see _.reject\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': true },\n * { 'user': 'fred', 'age': 40, 'active': false }\n * ];\n *\n * _.filter(users, function(o) { return !o.active; });\n * // => objects for ['fred']\n *\n * // The `_.matches` iteratee shorthand.\n * _.filter(users, { 'age': 36, 'active': true });\n * // => objects for ['barney']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.filter(users, ['active', false]);\n * // => objects for ['fred']\n *\n * // The `_.property` iteratee shorthand.\n * _.filter(users, 'active');\n * // => objects for ['barney']\n *\n * // Combining several predicates using `_.overEvery` or `_.overSome`.\n * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]]));\n * // => objects for ['fred', 'barney']\n */\nfunction filter(collection, predicate) {\n var func = isArray(collection) ? arrayFilter : baseFilter;\n return func(collection, baseIteratee(predicate, 3));\n}\n\nexport default filter;\n","import baseIteratee from './_baseIteratee.js';\nimport isArrayLike from './isArrayLike.js';\nimport keys from './keys.js';\n\n/**\n * Creates a `_.find` or `_.findLast` function.\n *\n * @private\n * @param {Function} findIndexFunc The function to find the collection index.\n * @returns {Function} Returns the new find function.\n */\nfunction createFind(findIndexFunc) {\n return function(collection, predicate, fromIndex) {\n var iterable = Object(collection);\n if (!isArrayLike(collection)) {\n var iteratee = baseIteratee(predicate, 3);\n collection = keys(collection);\n predicate = function(key) { return iteratee(iterable[key], key, iterable); };\n }\n var index = findIndexFunc(collection, predicate, fromIndex);\n return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;\n };\n}\n\nexport default createFind;\n","import baseFindIndex from './_baseFindIndex.js';\nimport baseIteratee from './_baseIteratee.js';\nimport toInteger from './toInteger.js';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max;\n\n/**\n * This method is like `_.find` except that it returns the index of the first\n * element `predicate` returns truthy for instead of the element itself.\n *\n * @static\n * @memberOf _\n * @since 1.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param {number} [fromIndex=0] The index to search from.\n * @returns {number} Returns the index of the found element, else `-1`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': false },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': true }\n * ];\n *\n * _.findIndex(users, function(o) { return o.user == 'barney'; });\n * // => 0\n *\n * // The `_.matches` iteratee shorthand.\n * _.findIndex(users, { 'user': 'fred', 'active': false });\n * // => 1\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.findIndex(users, ['active', false]);\n * // => 0\n *\n * // The `_.property` iteratee shorthand.\n * _.findIndex(users, 'active');\n * // => 2\n */\nfunction findIndex(array, predicate, fromIndex) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return -1;\n }\n var index = fromIndex == null ? 0 : toInteger(fromIndex);\n if (index < 0) {\n index = nativeMax(length + index, 0);\n }\n return baseFindIndex(array, baseIteratee(predicate, 3), index);\n}\n\nexport default findIndex;\n","import createFind from './_createFind.js';\nimport findIndex from './findIndex.js';\n\n/**\n * Iterates over elements of `collection`, returning the first element\n * `predicate` returns truthy for. The predicate is invoked with three\n * arguments: (value, index|key, collection).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param {number} [fromIndex=0] The index to search from.\n * @returns {*} Returns the matched element, else `undefined`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': true },\n * { 'user': 'fred', 'age': 40, 'active': false },\n * { 'user': 'pebbles', 'age': 1, 'active': true }\n * ];\n *\n * _.find(users, function(o) { return o.age < 40; });\n * // => object for 'barney'\n *\n * // The `_.matches` iteratee shorthand.\n * _.find(users, { 'age': 1, 'active': true });\n * // => object for 'pebbles'\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.find(users, ['active', false]);\n * // => object for 'fred'\n *\n * // The `_.property` iteratee shorthand.\n * _.find(users, 'active');\n * // => object for 'barney'\n */\nvar find = createFind(findIndex);\n\nexport default find;\n","import baseEach from './_baseEach.js';\nimport isArrayLike from './isArrayLike.js';\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\nexport default baseMap;\n","import arrayMap from './_arrayMap.js';\nimport baseIteratee from './_baseIteratee.js';\nimport baseMap from './_baseMap.js';\nimport isArray from './isArray.js';\n\n/**\n * Creates an array of values by running each element in `collection` thru\n * `iteratee`. The iteratee is invoked with three arguments:\n * (value, index|key, collection).\n *\n * Many lodash methods are guarded to work as iteratees for methods like\n * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.\n *\n * The guarded methods are:\n * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,\n * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,\n * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,\n * `template`, `trim`, `trimEnd`, `trimStart`, and `words`\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} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n * @example\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * _.map([4, 8], square);\n * // => [16, 64]\n *\n * _.map({ 'a': 4, 'b': 8 }, square);\n * // => [16, 64] (iteration order is not guaranteed)\n *\n * var users = [\n * { 'user': 'barney' },\n * { 'user': 'fred' }\n * ];\n *\n * // The `_.property` iteratee shorthand.\n * _.map(users, 'user');\n * // => ['barney', 'fred']\n */\nfunction map(collection, iteratee) {\n var func = isArray(collection) ? arrayMap : baseMap;\n return func(collection, baseIteratee(iteratee, 3));\n}\n\nexport default map;\n","import baseFor from './_baseFor.js';\nimport castFunction from './_castFunction.js';\nimport keysIn from './keysIn.js';\n\n/**\n * Iterates over own and inherited enumerable string keyed properties of an\n * object and invokes `iteratee` for each property. The iteratee is invoked\n * with three arguments: (value, key, object). Iteratee functions may exit\n * iteration early by explicitly returning `false`.\n *\n * @static\n * @memberOf _\n * @since 0.3.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns `object`.\n * @see _.forInRight\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.forIn(new Foo, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).\n */\nfunction forIn(object, iteratee) {\n return object == null\n ? object\n : baseFor(object, castFunction(iteratee), keysIn);\n}\n\nexport default forIn;\n","/**\n * The base implementation of `_.gt` which doesn't coerce arguments.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is greater than `other`,\n * else `false`.\n */\nfunction baseGt(value, other) {\n return value > other;\n}\n\nexport default baseGt;\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 `_.has` 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 baseHas(object, key) {\n return object != null && hasOwnProperty.call(object, key);\n}\n\nexport default baseHas;\n","import baseHas from './_baseHas.js';\nimport hasPath from './_hasPath.js';\n\n/**\n * Checks if `path` is a direct property of `object`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\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 = { 'a': { 'b': 2 } };\n * var other = _.create({ 'a': _.create({ 'b': 2 }) });\n *\n * _.has(object, 'a');\n * // => true\n *\n * _.has(object, 'a.b');\n * // => true\n *\n * _.has(object, ['a', 'b']);\n * // => true\n *\n * _.has(other, 'a');\n * // => false\n */\nfunction has(object, path) {\n return object != null && hasPath(object, path, baseHas);\n}\n\nexport default has;\n","import arrayMap from './_arrayMap.js';\n\n/**\n * The base implementation of `_.values` and `_.valuesIn` which creates an\n * array of `object` property values corresponding to the property names\n * of `props`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} props The property names to get values for.\n * @returns {Object} Returns the array of property values.\n */\nfunction baseValues(object, props) {\n return arrayMap(props, function(key) {\n return object[key];\n });\n}\n\nexport default baseValues;\n","import baseValues from './_baseValues.js';\nimport keys from './keys.js';\n\n/**\n * Creates an array of the own enumerable string keyed property values of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\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 values.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.values(new Foo);\n * // => [1, 2] (iteration order is not guaranteed)\n *\n * _.values('hi');\n * // => ['h', 'i']\n */\nfunction values(object) {\n return object == null ? [] : baseValues(object, keys(object));\n}\n\nexport default values;\n","/**\n * Checks if `value` is `undefined`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.\n * @example\n *\n * _.isUndefined(void 0);\n * // => true\n *\n * _.isUndefined(null);\n * // => false\n */\nfunction isUndefined(value) {\n return value === undefined;\n}\n\nexport default isUndefined;\n","/**\n * The base implementation of `_.lt` which doesn't coerce arguments.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is less than `other`,\n * else `false`.\n */\nfunction baseLt(value, other) {\n return value < other;\n}\n\nexport default baseLt;\n","import baseAssignValue from './_baseAssignValue.js';\nimport baseForOwn from './_baseForOwn.js';\nimport baseIteratee from './_baseIteratee.js';\n\n/**\n * Creates an object with the same keys as `object` and values generated\n * by running each own enumerable string keyed property of `object` thru\n * `iteratee`. The iteratee is invoked with three arguments:\n * (value, key, object).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns the new mapped object.\n * @see _.mapKeys\n * @example\n *\n * var users = {\n * 'fred': { 'user': 'fred', 'age': 40 },\n * 'pebbles': { 'user': 'pebbles', 'age': 1 }\n * };\n *\n * _.mapValues(users, function(o) { return o.age; });\n * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)\n *\n * // The `_.property` iteratee shorthand.\n * _.mapValues(users, 'age');\n * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)\n */\nfunction mapValues(object, iteratee) {\n var result = {};\n iteratee = baseIteratee(iteratee, 3);\n\n baseForOwn(object, function(value, key, object) {\n baseAssignValue(result, key, iteratee(value, key, object));\n });\n return result;\n}\n\nexport default mapValues;\n","import isSymbol from './isSymbol.js';\n\n/**\n * The base implementation of methods like `_.max` and `_.min` which accepts a\n * `comparator` to determine the extremum value.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} iteratee The iteratee invoked per iteration.\n * @param {Function} comparator The comparator used to compare values.\n * @returns {*} Returns the extremum value.\n */\nfunction baseExtremum(array, iteratee, comparator) {\n var index = -1,\n length = array.length;\n\n while (++index < length) {\n var value = array[index],\n current = iteratee(value);\n\n if (current != null && (computed === undefined\n ? (current === current && !isSymbol(current))\n : comparator(current, computed)\n )) {\n var computed = current,\n result = value;\n }\n }\n return result;\n}\n\nexport default baseExtremum;\n","import baseExtremum from './_baseExtremum.js';\nimport baseGt from './_baseGt.js';\nimport identity from './identity.js';\n\n/**\n * Computes the maximum value of `array`. If `array` is empty or falsey,\n * `undefined` is returned.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Math\n * @param {Array} array The array to iterate over.\n * @returns {*} Returns the maximum value.\n * @example\n *\n * _.max([4, 2, 8, 6]);\n * // => 8\n *\n * _.max([]);\n * // => undefined\n */\nfunction max(array) {\n return (array && array.length)\n ? baseExtremum(array, identity, baseGt)\n : undefined;\n}\n\nexport default max;\n","import baseMerge from './_baseMerge.js';\nimport createAssigner from './_createAssigner.js';\n\n/**\n * This method is like `_.assign` except that it recursively merges own and\n * inherited enumerable string keyed properties of source objects into the\n * destination object. Source properties that resolve to `undefined` are\n * skipped if a destination value exists. Array and plain object properties\n * are merged recursively. Other objects and value types are overridden by\n * assignment. Source objects are applied from left to right. Subsequent\n * sources overwrite property assignments of previous sources.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 0.5.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = {\n * 'a': [{ 'b': 2 }, { 'd': 4 }]\n * };\n *\n * var other = {\n * 'a': [{ 'c': 3 }, { 'e': 5 }]\n * };\n *\n * _.merge(object, other);\n * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }\n */\nvar merge = createAssigner(function(object, source, srcIndex) {\n baseMerge(object, source, srcIndex);\n});\n\nexport default merge;\n","import baseExtremum from './_baseExtremum.js';\nimport baseLt from './_baseLt.js';\nimport identity from './identity.js';\n\n/**\n * Computes the minimum value of `array`. If `array` is empty or falsey,\n * `undefined` is returned.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Math\n * @param {Array} array The array to iterate over.\n * @returns {*} Returns the minimum value.\n * @example\n *\n * _.min([4, 2, 8, 6]);\n * // => 2\n *\n * _.min([]);\n * // => undefined\n */\nfunction min(array) {\n return (array && array.length)\n ? baseExtremum(array, identity, baseLt)\n : undefined;\n}\n\nexport default min;\n","import baseExtremum from './_baseExtremum.js';\nimport baseIteratee from './_baseIteratee.js';\nimport baseLt from './_baseLt.js';\n\n/**\n * This method is like `_.min` except that it accepts `iteratee` which is\n * invoked for each element in `array` to generate the criterion by which\n * the value is ranked. The iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Math\n * @param {Array} array The array to iterate over.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {*} Returns the minimum value.\n * @example\n *\n * var objects = [{ 'n': 1 }, { 'n': 2 }];\n *\n * _.minBy(objects, function(o) { return o.n; });\n * // => { 'n': 1 }\n *\n * // The `_.property` iteratee shorthand.\n * _.minBy(objects, 'n');\n * // => { 'n': 1 }\n */\nfunction minBy(array, iteratee) {\n return (array && array.length)\n ? baseExtremum(array, baseIteratee(iteratee, 2), baseLt)\n : undefined;\n}\n\nexport default minBy;\n","import assignValue from './_assignValue.js';\nimport castPath from './_castPath.js';\nimport isIndex from './_isIndex.js';\nimport isObject from './isObject.js';\nimport toKey from './_toKey.js';\n\n/**\n * The base implementation of `_.set`.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {*} value The value to set.\n * @param {Function} [customizer] The function to customize path creation.\n * @returns {Object} Returns `object`.\n */\nfunction baseSet(object, path, value, customizer) {\n if (!isObject(object)) {\n return object;\n }\n path = castPath(path, object);\n\n var index = -1,\n length = path.length,\n lastIndex = length - 1,\n nested = object;\n\n while (nested != null && ++index < length) {\n var key = toKey(path[index]),\n newValue = value;\n\n if (key === '__proto__' || key === 'constructor' || key === 'prototype') {\n return object;\n }\n\n if (index != lastIndex) {\n var objValue = nested[key];\n newValue = customizer ? customizer(objValue, key, nested) : undefined;\n if (newValue === undefined) {\n newValue = isObject(objValue)\n ? objValue\n : (isIndex(path[index + 1]) ? [] : {});\n }\n }\n assignValue(nested, key, newValue);\n nested = nested[key];\n }\n return object;\n}\n\nexport default baseSet;\n","import baseGet from './_baseGet.js';\nimport baseSet from './_baseSet.js';\nimport castPath from './_castPath.js';\n\n/**\n * The base implementation of `_.pickBy` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The source object.\n * @param {string[]} paths The property paths to pick.\n * @param {Function} predicate The function invoked per property.\n * @returns {Object} Returns the new object.\n */\nfunction basePickBy(object, paths, predicate) {\n var index = -1,\n length = paths.length,\n result = {};\n\n while (++index < length) {\n var path = paths[index],\n value = baseGet(object, path);\n\n if (predicate(value, path)) {\n baseSet(result, castPath(path, object), value);\n }\n }\n return result;\n}\n\nexport default basePickBy;\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\nexport default baseSortBy;\n","import isSymbol from './isSymbol.js';\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\nexport default compareAscending;\n","import compareAscending from './_compareAscending.js';\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\nexport default compareMultiple;\n","import arrayMap from './_arrayMap.js';\nimport baseGet from './_baseGet.js';\nimport baseIteratee from './_baseIteratee.js';\nimport baseMap from './_baseMap.js';\nimport baseSortBy from './_baseSortBy.js';\nimport baseUnary from './_baseUnary.js';\nimport compareMultiple from './_compareMultiple.js';\nimport identity from './identity.js';\nimport isArray from './isArray.js';\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\nexport default baseOrderBy;\n","import basePickBy from './_basePickBy.js';\nimport hasIn from './hasIn.js';\n\n/**\n * The base implementation of `_.pick` without support for individual\n * property identifiers.\n *\n * @private\n * @param {Object} object The source object.\n * @param {string[]} paths The property paths to pick.\n * @returns {Object} Returns the new object.\n */\nfunction basePick(object, paths) {\n return basePickBy(object, paths, function(value, path) {\n return hasIn(object, path);\n });\n}\n\nexport default basePick;\n","import basePick from './_basePick.js';\nimport flatRest from './_flatRest.js';\n\n/**\n * Creates an object composed of the picked `object` properties.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The source object.\n * @param {...(string|string[])} [paths] The property paths to pick.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.pick(object, ['a', 'c']);\n * // => { 'a': 1, 'c': 3 }\n */\nvar pick = flatRest(function(object, paths) {\n return object == null ? {} : basePick(object, paths);\n});\n\nexport default pick;\n","/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeCeil = Math.ceil,\n nativeMax = Math.max;\n\n/**\n * The base implementation of `_.range` and `_.rangeRight` which doesn't\n * coerce arguments.\n *\n * @private\n * @param {number} start The start of the range.\n * @param {number} end The end of the range.\n * @param {number} step The value to increment or decrement by.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Array} Returns the range of numbers.\n */\nfunction baseRange(start, end, step, fromRight) {\n var index = -1,\n length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),\n result = Array(length);\n\n while (length--) {\n result[fromRight ? length : ++index] = start;\n start += step;\n }\n return result;\n}\n\nexport default baseRange;\n","import baseRange from './_baseRange.js';\nimport isIterateeCall from './_isIterateeCall.js';\nimport toFinite from './toFinite.js';\n\n/**\n * Creates a `_.range` or `_.rangeRight` function.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new range function.\n */\nfunction createRange(fromRight) {\n return function(start, end, step) {\n if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {\n end = step = undefined;\n }\n // Ensure the sign of `-0` is preserved.\n start = toFinite(start);\n if (end === undefined) {\n end = start;\n start = 0;\n } else {\n end = toFinite(end);\n }\n step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);\n return baseRange(start, end, step, fromRight);\n };\n}\n\nexport default createRange;\n","import createRange from './_createRange.js';\n\n/**\n * Creates an array of numbers (positive and/or negative) progressing from\n * `start` up to, but not including, `end`. A step of `-1` is used if a negative\n * `start` is specified without an `end` or `step`. If `end` is not specified,\n * it's set to `start` with `start` then set to `0`.\n *\n * **Note:** JavaScript follows the IEEE-754 standard for resolving\n * floating-point values which can produce unexpected results.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {number} [start=0] The start of the range.\n * @param {number} end The end of the range.\n * @param {number} [step=1] The value to increment or decrement by.\n * @returns {Array} Returns the range of numbers.\n * @see _.inRange, _.rangeRight\n * @example\n *\n * _.range(4);\n * // => [0, 1, 2, 3]\n *\n * _.range(-4);\n * // => [0, -1, -2, -3]\n *\n * _.range(1, 5);\n * // => [1, 2, 3, 4]\n *\n * _.range(0, 20, 5);\n * // => [0, 5, 10, 15]\n *\n * _.range(0, -4, -1);\n * // => [0, -1, -2, -3]\n *\n * _.range(1, 4, 0);\n * // => [1, 1, 1]\n *\n * _.range(0);\n * // => []\n */\nvar range = createRange();\n\nexport default range;\n","/**\n * The base implementation of `_.reduce` and `_.reduceRight`, without support\n * for iteratee shorthands, which iterates over `collection` using `eachFunc`.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} accumulator The initial value.\n * @param {boolean} initAccum Specify using the first or last element of\n * `collection` as the initial value.\n * @param {Function} eachFunc The function to iterate over `collection`.\n * @returns {*} Returns the accumulated value.\n */\nfunction baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {\n eachFunc(collection, function(value, index, collection) {\n accumulator = initAccum\n ? (initAccum = false, value)\n : iteratee(accumulator, value, index, collection);\n });\n return accumulator;\n}\n\nexport default baseReduce;\n","import arrayReduce from './_arrayReduce.js';\nimport baseEach from './_baseEach.js';\nimport baseIteratee from './_baseIteratee.js';\nimport baseReduce from './_baseReduce.js';\nimport isArray from './isArray.js';\n\n/**\n * Reduces `collection` to a value which is the accumulated result of running\n * each element in `collection` thru `iteratee`, where each successive\n * invocation is supplied the return value of the previous. If `accumulator`\n * is not given, the first element of `collection` is used as the initial\n * value. The iteratee is invoked with four arguments:\n * (accumulator, value, index|key, collection).\n *\n * Many lodash methods are guarded to work as iteratees for methods like\n * `_.reduce`, `_.reduceRight`, and `_.transform`.\n *\n * The guarded methods are:\n * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,\n * and `sortBy`\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} [iteratee=_.identity] The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @returns {*} Returns the accumulated value.\n * @see _.reduceRight\n * @example\n *\n * _.reduce([1, 2], function(sum, n) {\n * return sum + n;\n * }, 0);\n * // => 3\n *\n * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {\n * (result[value] || (result[value] = [])).push(key);\n * return result;\n * }, {});\n * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)\n */\nfunction reduce(collection, iteratee, accumulator) {\n var func = isArray(collection) ? arrayReduce : baseReduce,\n initAccum = arguments.length < 3;\n\n return func(collection, baseIteratee(iteratee, 4), accumulator, initAccum, baseEach);\n}\n\nexport default reduce;\n","import baseFlatten from './_baseFlatten.js';\nimport baseOrderBy from './_baseOrderBy.js';\nimport baseRest from './_baseRest.js';\nimport isIterateeCall from './_isIterateeCall.js';\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\nexport default sortBy;\n","import Set from './_Set.js';\nimport noop from './noop.js';\nimport setToArray from './_setToArray.js';\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/**\n * Creates a set object of `values`.\n *\n * @private\n * @param {Array} values The values to add to the set.\n * @returns {Object} Returns the new set.\n */\nvar createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {\n return new Set(values);\n};\n\nexport default createSet;\n","import SetCache from './_SetCache.js';\nimport arrayIncludes from './_arrayIncludes.js';\nimport arrayIncludesWith from './_arrayIncludesWith.js';\nimport cacheHas from './_cacheHas.js';\nimport createSet from './_createSet.js';\nimport setToArray from './_setToArray.js';\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/**\n * The base implementation of `_.uniqBy` without support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n */\nfunction baseUniq(array, iteratee, comparator) {\n var index = -1,\n includes = arrayIncludes,\n length = array.length,\n isCommon = true,\n result = [],\n seen = result;\n\n if (comparator) {\n isCommon = false;\n includes = arrayIncludesWith;\n }\n else if (length >= LARGE_ARRAY_SIZE) {\n var set = iteratee ? null : createSet(array);\n if (set) {\n return setToArray(set);\n }\n isCommon = false;\n includes = cacheHas;\n seen = new SetCache;\n }\n else {\n seen = iteratee ? [] : result;\n }\n outer:\n while (++index < length) {\n var value = array[index],\n computed = iteratee ? iteratee(value) : value;\n\n value = (comparator || value !== 0) ? value : 0;\n if (isCommon && computed === computed) {\n var seenIndex = seen.length;\n while (seenIndex--) {\n if (seen[seenIndex] === computed) {\n continue outer;\n }\n }\n if (iteratee) {\n seen.push(computed);\n }\n result.push(value);\n }\n else if (!includes(seen, computed, comparator)) {\n if (seen !== result) {\n seen.push(computed);\n }\n result.push(value);\n }\n }\n return result;\n}\n\nexport default baseUniq;\n","import baseFlatten from './_baseFlatten.js';\nimport baseRest from './_baseRest.js';\nimport baseUniq from './_baseUniq.js';\nimport isArrayLikeObject from './isArrayLikeObject.js';\n\n/**\n * Creates an array of unique values, in order, from all given arrays using\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @returns {Array} Returns the new array of combined values.\n * @example\n *\n * _.union([2], [1, 2]);\n * // => [2, 1]\n */\nvar union = baseRest(function(arrays) {\n return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));\n});\n\nexport default union;\n","import toString from './toString.js';\n\n/** Used to generate unique IDs. */\nvar idCounter = 0;\n\n/**\n * Generates a unique ID. If `prefix` is given, the ID is appended to it.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {string} [prefix=''] The value to prefix the ID with.\n * @returns {string} Returns the unique ID.\n * @example\n *\n * _.uniqueId('contact_');\n * // => 'contact_104'\n *\n * _.uniqueId();\n * // => '105'\n */\nfunction uniqueId(prefix) {\n var id = ++idCounter;\n return toString(prefix) + id;\n}\n\nexport default uniqueId;\n","/**\n * This base implementation of `_.zipObject` which assigns values using `assignFunc`.\n *\n * @private\n * @param {Array} props The property identifiers.\n * @param {Array} values The property values.\n * @param {Function} assignFunc The function to assign values.\n * @returns {Object} Returns the new object.\n */\nfunction baseZipObject(props, values, assignFunc) {\n var index = -1,\n length = props.length,\n valsLength = values.length,\n result = {};\n\n while (++index < length) {\n var value = index < valsLength ? values[index] : undefined;\n assignFunc(result, props[index], value);\n }\n return result;\n}\n\nexport default baseZipObject;\n","import assignValue from './_assignValue.js';\nimport baseZipObject from './_baseZipObject.js';\n\n/**\n * This method is like `_.fromPairs` except that it accepts two arrays,\n * one of property identifiers and one of corresponding values.\n *\n * @static\n * @memberOf _\n * @since 0.4.0\n * @category Array\n * @param {Array} [props=[]] The property identifiers.\n * @param {Array} [values=[]] The property values.\n * @returns {Object} Returns the new object.\n * @example\n *\n * _.zipObject(['a', 'b'], [1, 2]);\n * // => { 'a': 1, 'b': 2 }\n */\nfunction zipObject(props, values) {\n return baseZipObject(props || [], values || [], assignValue);\n}\n\nexport default zipObject;\n","import * as _ from 'lodash-es';\n\nvar DEFAULT_EDGE_NAME = '\\x00';\nvar GRAPH_NODE = '\\x00';\nvar EDGE_KEY_DELIM = '\\x01';\n\n// Implementation notes:\n//\n// * Node id query functions should return string ids for the nodes\n// * Edge id query functions should return an \"edgeObj\", edge object, that is\n// composed of enough information to uniquely identify an edge: {v, w, name}.\n// * Internally we use an \"edgeId\", a stringified form of the edgeObj, to\n// reference edges. This is because we need a performant way to look these\n// edges up and, object properties, which have string keys, are the closest\n// we're going to get to a performant hashtable in JavaScript.\n\n// Implementation notes:\n//\n// * Node id query functions should return string ids for the nodes\n// * Edge id query functions should return an \"edgeObj\", edge object, that is\n// composed of enough information to uniquely identify an edge: {v, w, name}.\n// * Internally we use an \"edgeId\", a stringified form of the edgeObj, to\n// reference edges. This is because we need a performant way to look these\n// edges up and, object properties, which have string keys, are the closest\n// we're going to get to a performant hashtable in JavaScript.\nexport class Graph {\n constructor(opts = {}) {\n this._isDirected = _.has(opts, 'directed') ? opts.directed : true;\n this._isMultigraph = _.has(opts, 'multigraph') ? opts.multigraph : false;\n this._isCompound = _.has(opts, 'compound') ? opts.compound : false;\n\n // Label for the graph itself\n this._label = undefined;\n\n // Defaults to be set when creating a new node\n this._defaultNodeLabelFn = _.constant(undefined);\n\n // Defaults to be set when creating a new edge\n this._defaultEdgeLabelFn = _.constant(undefined);\n\n // v -> label\n this._nodes = {};\n\n if (this._isCompound) {\n // v -> parent\n this._parent = {};\n\n // v -> children\n this._children = {};\n this._children[GRAPH_NODE] = {};\n }\n\n // v -> edgeObj\n this._in = {};\n\n // u -> v -> Number\n this._preds = {};\n\n // v -> edgeObj\n this._out = {};\n\n // v -> w -> Number\n this._sucs = {};\n\n // e -> edgeObj\n this._edgeObjs = {};\n\n // e -> label\n this._edgeLabels = {};\n }\n /* === Graph functions ========= */\n isDirected() {\n return this._isDirected;\n }\n isMultigraph() {\n return this._isMultigraph;\n }\n isCompound() {\n return this._isCompound;\n }\n setGraph(label) {\n this._label = label;\n return this;\n }\n graph() {\n return this._label;\n }\n /* === Node functions ========== */\n setDefaultNodeLabel(newDefault) {\n if (!_.isFunction(newDefault)) {\n newDefault = _.constant(newDefault);\n }\n this._defaultNodeLabelFn = newDefault;\n return this;\n }\n nodeCount() {\n return this._nodeCount;\n }\n nodes() {\n return _.keys(this._nodes);\n }\n sources() {\n var self = this;\n return _.filter(this.nodes(), function (v) {\n return _.isEmpty(self._in[v]);\n });\n }\n sinks() {\n var self = this;\n return _.filter(this.nodes(), function (v) {\n return _.isEmpty(self._out[v]);\n });\n }\n setNodes(vs, value) {\n var args = arguments;\n var self = this;\n _.each(vs, function (v) {\n if (args.length > 1) {\n self.setNode(v, value);\n } else {\n self.setNode(v);\n }\n });\n return this;\n }\n setNode(v, value) {\n if (_.has(this._nodes, v)) {\n if (arguments.length > 1) {\n this._nodes[v] = value;\n }\n return this;\n }\n\n // @ts-expect-error\n this._nodes[v] = arguments.length > 1 ? value : this._defaultNodeLabelFn(v);\n if (this._isCompound) {\n this._parent[v] = GRAPH_NODE;\n this._children[v] = {};\n this._children[GRAPH_NODE][v] = true;\n }\n this._in[v] = {};\n this._preds[v] = {};\n this._out[v] = {};\n this._sucs[v] = {};\n ++this._nodeCount;\n return this;\n }\n node(v) {\n return this._nodes[v];\n }\n hasNode(v) {\n return _.has(this._nodes, v);\n }\n removeNode(v) {\n var self = this;\n if (_.has(this._nodes, v)) {\n var removeEdge = function (e) {\n self.removeEdge(self._edgeObjs[e]);\n };\n delete this._nodes[v];\n if (this._isCompound) {\n this._removeFromParentsChildList(v);\n delete this._parent[v];\n _.each(this.children(v), function (child) {\n self.setParent(child);\n });\n delete this._children[v];\n }\n _.each(_.keys(this._in[v]), removeEdge);\n delete this._in[v];\n delete this._preds[v];\n _.each(_.keys(this._out[v]), removeEdge);\n delete this._out[v];\n delete this._sucs[v];\n --this._nodeCount;\n }\n return this;\n }\n setParent(v, parent) {\n if (!this._isCompound) {\n throw new Error('Cannot set parent in a non-compound graph');\n }\n\n if (_.isUndefined(parent)) {\n parent = GRAPH_NODE;\n } else {\n // Coerce parent to string\n parent += '';\n for (var ancestor = parent; !_.isUndefined(ancestor); ancestor = this.parent(ancestor)) {\n if (ancestor === v) {\n throw new Error('Setting ' + parent + ' as parent of ' + v + ' would create a cycle');\n }\n }\n\n this.setNode(parent);\n }\n\n this.setNode(v);\n this._removeFromParentsChildList(v);\n this._parent[v] = parent;\n this._children[parent][v] = true;\n return this;\n }\n _removeFromParentsChildList(v) {\n delete this._children[this._parent[v]][v];\n }\n parent(v) {\n if (this._isCompound) {\n var parent = this._parent[v];\n if (parent !== GRAPH_NODE) {\n return parent;\n }\n }\n }\n children(v) {\n if (_.isUndefined(v)) {\n v = GRAPH_NODE;\n }\n\n if (this._isCompound) {\n var children = this._children[v];\n if (children) {\n return _.keys(children);\n }\n } else if (v === GRAPH_NODE) {\n return this.nodes();\n } else if (this.hasNode(v)) {\n return [];\n }\n }\n predecessors(v) {\n var predsV = this._preds[v];\n if (predsV) {\n return _.keys(predsV);\n }\n }\n successors(v) {\n var sucsV = this._sucs[v];\n if (sucsV) {\n return _.keys(sucsV);\n }\n }\n neighbors(v) {\n var preds = this.predecessors(v);\n if (preds) {\n return _.union(preds, this.successors(v));\n }\n }\n isLeaf(v) {\n var neighbors;\n if (this.isDirected()) {\n neighbors = this.successors(v);\n } else {\n neighbors = this.neighbors(v);\n }\n return neighbors.length === 0;\n }\n filterNodes(filter) {\n // @ts-expect-error\n var copy = new this.constructor({\n directed: this._isDirected,\n multigraph: this._isMultigraph,\n compound: this._isCompound,\n });\n\n copy.setGraph(this.graph());\n\n var self = this;\n _.each(this._nodes, function (value, v) {\n if (filter(v)) {\n copy.setNode(v, value);\n }\n });\n\n _.each(this._edgeObjs, function (e) {\n // @ts-expect-error\n if (copy.hasNode(e.v) && copy.hasNode(e.w)) {\n copy.setEdge(e, self.edge(e));\n }\n });\n\n var parents = {};\n function findParent(v) {\n var parent = self.parent(v);\n if (parent === undefined || copy.hasNode(parent)) {\n parents[v] = parent;\n return parent;\n } else if (parent in parents) {\n return parents[parent];\n } else {\n return findParent(parent);\n }\n }\n\n if (this._isCompound) {\n _.each(copy.nodes(), function (v) {\n copy.setParent(v, findParent(v));\n });\n }\n\n return copy;\n }\n /* === Edge functions ========== */\n setDefaultEdgeLabel(newDefault) {\n if (!_.isFunction(newDefault)) {\n newDefault = _.constant(newDefault);\n }\n this._defaultEdgeLabelFn = newDefault;\n return this;\n }\n edgeCount() {\n return this._edgeCount;\n }\n edges() {\n return _.values(this._edgeObjs);\n }\n setPath(vs, value) {\n var self = this;\n var args = arguments;\n _.reduce(vs, function (v, w) {\n if (args.length > 1) {\n self.setEdge(v, w, value);\n } else {\n self.setEdge(v, w);\n }\n return w;\n });\n return this;\n }\n /*\n * setEdge(v, w, [value, [name]])\n * setEdge({ v, w, [name] }, [value])\n */\n setEdge() {\n var v, w, name, value;\n var valueSpecified = false;\n var arg0 = arguments[0];\n\n if (typeof arg0 === 'object' && arg0 !== null && 'v' in arg0) {\n v = arg0.v;\n w = arg0.w;\n name = arg0.name;\n if (arguments.length === 2) {\n value = arguments[1];\n valueSpecified = true;\n }\n } else {\n v = arg0;\n w = arguments[1];\n name = arguments[3];\n if (arguments.length > 2) {\n value = arguments[2];\n valueSpecified = true;\n }\n }\n\n v = '' + v;\n w = '' + w;\n if (!_.isUndefined(name)) {\n name = '' + name;\n }\n\n var e = edgeArgsToId(this._isDirected, v, w, name);\n if (_.has(this._edgeLabels, e)) {\n if (valueSpecified) {\n this._edgeLabels[e] = value;\n }\n return this;\n }\n\n if (!_.isUndefined(name) && !this._isMultigraph) {\n throw new Error('Cannot set a named edge when isMultigraph = false');\n }\n\n // It didn't exist, so we need to create it.\n // First ensure the nodes exist.\n this.setNode(v);\n this.setNode(w);\n\n // @ts-expect-error\n this._edgeLabels[e] = valueSpecified ? value : this._defaultEdgeLabelFn(v, w, name);\n\n var edgeObj = edgeArgsToObj(this._isDirected, v, w, name);\n // Ensure we add undirected edges in a consistent way.\n v = edgeObj.v;\n w = edgeObj.w;\n\n Object.freeze(edgeObj);\n this._edgeObjs[e] = edgeObj;\n incrementOrInitEntry(this._preds[w], v);\n incrementOrInitEntry(this._sucs[v], w);\n this._in[w][e] = edgeObj;\n this._out[v][e] = edgeObj;\n this._edgeCount++;\n return this;\n }\n edge(v, w, name) {\n var e =\n arguments.length === 1\n ? edgeObjToId(this._isDirected, arguments[0])\n : edgeArgsToId(this._isDirected, v, w, name);\n return this._edgeLabels[e];\n }\n hasEdge(v, w, name) {\n var e =\n arguments.length === 1\n ? edgeObjToId(this._isDirected, arguments[0])\n : edgeArgsToId(this._isDirected, v, w, name);\n return _.has(this._edgeLabels, e);\n }\n removeEdge(v, w, name) {\n var e =\n arguments.length === 1\n ? edgeObjToId(this._isDirected, arguments[0])\n : edgeArgsToId(this._isDirected, v, w, name);\n var edge = this._edgeObjs[e];\n if (edge) {\n v = edge.v;\n w = edge.w;\n delete this._edgeLabels[e];\n delete this._edgeObjs[e];\n decrementOrRemoveEntry(this._preds[w], v);\n decrementOrRemoveEntry(this._sucs[v], w);\n delete this._in[w][e];\n delete this._out[v][e];\n this._edgeCount--;\n }\n return this;\n }\n inEdges(v, u) {\n var inV = this._in[v];\n if (inV) {\n var edges = _.values(inV);\n if (!u) {\n return edges;\n }\n return _.filter(edges, function (edge) {\n return edge.v === u;\n });\n }\n }\n outEdges(v, w) {\n var outV = this._out[v];\n if (outV) {\n var edges = _.values(outV);\n if (!w) {\n return edges;\n }\n return _.filter(edges, function (edge) {\n return edge.w === w;\n });\n }\n }\n nodeEdges(v, w) {\n var inEdges = this.inEdges(v, w);\n if (inEdges) {\n return inEdges.concat(this.outEdges(v, w));\n }\n }\n}\n\n/* Number of nodes in the graph. Should only be changed by the implementation. */\nGraph.prototype._nodeCount = 0;\n\n/* Number of edges in the graph. Should only be changed by the implementation. */\nGraph.prototype._edgeCount = 0;\n\nfunction incrementOrInitEntry(map, k) {\n if (map[k]) {\n map[k]++;\n } else {\n map[k] = 1;\n }\n}\n\nfunction decrementOrRemoveEntry(map, k) {\n if (!--map[k]) {\n delete map[k];\n }\n}\n\nfunction edgeArgsToId(isDirected, v_, w_, name) {\n var v = '' + v_;\n var w = '' + w_;\n if (!isDirected && v > w) {\n var tmp = v;\n v = w;\n w = tmp;\n }\n return v + EDGE_KEY_DELIM + w + EDGE_KEY_DELIM + (_.isUndefined(name) ? DEFAULT_EDGE_NAME : name);\n}\n\nfunction edgeArgsToObj(isDirected, v_, w_, name) {\n var v = '' + v_;\n var w = '' + w_;\n if (!isDirected && v > w) {\n var tmp = v;\n v = w;\n w = tmp;\n }\n var edgeObj = { v: v, w: w };\n if (name) {\n edgeObj.name = name;\n }\n return edgeObj;\n}\n\nfunction edgeObjToId(isDirected, edgeObj) {\n return edgeArgsToId(isDirected, edgeObj.v, edgeObj.w, edgeObj.name);\n}\n","/*\n * Simple doubly linked list implementation derived from Cormen, et al.,\n * \"Introduction to Algorithms\".\n */\n\nexport { List };\n\nclass List {\n constructor() {\n var sentinel = {};\n sentinel._next = sentinel._prev = sentinel;\n this._sentinel = sentinel;\n }\n dequeue() {\n var sentinel = this._sentinel;\n var entry = sentinel._prev;\n if (entry !== sentinel) {\n unlink(entry);\n return entry;\n }\n }\n enqueue(entry) {\n var sentinel = this._sentinel;\n if (entry._prev && entry._next) {\n unlink(entry);\n }\n entry._next = sentinel._next;\n sentinel._next._prev = entry;\n sentinel._next = entry;\n entry._prev = sentinel;\n }\n toString() {\n var strs = [];\n var sentinel = this._sentinel;\n var curr = sentinel._prev;\n while (curr !== sentinel) {\n strs.push(JSON.stringify(curr, filterOutLinks));\n curr = curr._prev;\n }\n return '[' + strs.join(', ') + ']';\n }\n}\n\nfunction unlink(entry) {\n entry._prev._next = entry._next;\n entry._next._prev = entry._prev;\n delete entry._next;\n delete entry._prev;\n}\n\nfunction filterOutLinks(k, v) {\n if (k !== '_next' && k !== '_prev') {\n return v;\n }\n}\n","import * as _ from 'lodash-es';\nimport { Graph } from '../graphlib/index.js';\nimport { List } from './data/list.js';\n\n/*\n * A greedy heuristic for finding a feedback arc set for a graph. A feedback\n * arc set is a set of edges that can be removed to make a graph acyclic.\n * The algorithm comes from: P. Eades, X. Lin, and W. F. Smyth, \"A fast and\n * effective heuristic for the feedback arc set problem.\" This implementation\n * adjusts that from the paper to allow for weighted edges.\n */\nexport { greedyFAS };\n\nvar DEFAULT_WEIGHT_FN = _.constant(1);\n\nfunction greedyFAS(g, weightFn) {\n if (g.nodeCount() <= 1) {\n return [];\n }\n var state = buildState(g, weightFn || DEFAULT_WEIGHT_FN);\n var results = doGreedyFAS(state.graph, state.buckets, state.zeroIdx);\n\n // Expand multi-edges\n return _.flatten(\n _.map(results, function (e) {\n return g.outEdges(e.v, e.w);\n })\n );\n}\n\nfunction doGreedyFAS(g, buckets, zeroIdx) {\n var results = [];\n var sources = buckets[buckets.length - 1];\n var sinks = buckets[0];\n\n var entry;\n while (g.nodeCount()) {\n while ((entry = sinks.dequeue())) {\n removeNode(g, buckets, zeroIdx, entry);\n }\n while ((entry = sources.dequeue())) {\n removeNode(g, buckets, zeroIdx, entry);\n }\n if (g.nodeCount()) {\n for (var i = buckets.length - 2; i > 0; --i) {\n entry = buckets[i].dequeue();\n if (entry) {\n results = results.concat(removeNode(g, buckets, zeroIdx, entry, true));\n break;\n }\n }\n }\n }\n\n return results;\n}\n\nfunction removeNode(g, buckets, zeroIdx, entry, collectPredecessors) {\n var results = collectPredecessors ? [] : undefined;\n\n _.forEach(g.inEdges(entry.v), function (edge) {\n var weight = g.edge(edge);\n var uEntry = g.node(edge.v);\n\n if (collectPredecessors) {\n results.push({ v: edge.v, w: edge.w });\n }\n\n uEntry.out -= weight;\n assignBucket(buckets, zeroIdx, uEntry);\n });\n\n _.forEach(g.outEdges(entry.v), function (edge) {\n var weight = g.edge(edge);\n var w = edge.w;\n var wEntry = g.node(w);\n wEntry['in'] -= weight;\n assignBucket(buckets, zeroIdx, wEntry);\n });\n\n g.removeNode(entry.v);\n\n return results;\n}\n\nfunction buildState(g, weightFn) {\n var fasGraph = new Graph();\n var maxIn = 0;\n var maxOut = 0;\n\n _.forEach(g.nodes(), function (v) {\n fasGraph.setNode(v, { v: v, in: 0, out: 0 });\n });\n\n // Aggregate weights on nodes, but also sum the weights across multi-edges\n // into a single edge for the fasGraph.\n _.forEach(g.edges(), function (e) {\n var prevWeight = fasGraph.edge(e.v, e.w) || 0;\n var weight = weightFn(e);\n var edgeWeight = prevWeight + weight;\n fasGraph.setEdge(e.v, e.w, edgeWeight);\n maxOut = Math.max(maxOut, (fasGraph.node(e.v).out += weight));\n maxIn = Math.max(maxIn, (fasGraph.node(e.w)['in'] += weight));\n });\n\n var buckets = _.range(maxOut + maxIn + 3).map(function () {\n return new List();\n });\n var zeroIdx = maxIn + 1;\n\n _.forEach(fasGraph.nodes(), function (v) {\n assignBucket(buckets, zeroIdx, fasGraph.node(v));\n });\n\n return { graph: fasGraph, buckets: buckets, zeroIdx: zeroIdx };\n}\n\nfunction assignBucket(buckets, zeroIdx, entry) {\n if (!entry.out) {\n buckets[0].enqueue(entry);\n } else if (!entry['in']) {\n buckets[buckets.length - 1].enqueue(entry);\n } else {\n buckets[entry.out - entry['in'] + zeroIdx].enqueue(entry);\n }\n}\n","import * as _ from 'lodash-es';\nimport { greedyFAS } from './greedy-fas.js';\n\nexport { run, undo };\n\nfunction run(g) {\n var fas = g.graph().acyclicer === 'greedy' ? greedyFAS(g, weightFn(g)) : dfsFAS(g);\n _.forEach(fas, function (e) {\n var label = g.edge(e);\n g.removeEdge(e);\n label.forwardName = e.name;\n label.reversed = true;\n g.setEdge(e.w, e.v, label, _.uniqueId('rev'));\n });\n\n function weightFn(g) {\n return function (e) {\n return g.edge(e).weight;\n };\n }\n}\n\nfunction dfsFAS(g) {\n var fas = [];\n var stack = {};\n var visited = {};\n\n function dfs(v) {\n if (_.has(visited, v)) {\n return;\n }\n visited[v] = true;\n stack[v] = true;\n _.forEach(g.outEdges(v), function (e) {\n if (_.has(stack, e.w)) {\n fas.push(e);\n } else {\n dfs(e.w);\n }\n });\n delete stack[v];\n }\n\n _.forEach(g.nodes(), dfs);\n return fas;\n}\n\nfunction undo(g) {\n _.forEach(g.edges(), function (e) {\n var label = g.edge(e);\n if (label.reversed) {\n g.removeEdge(e);\n\n var forwardName = label.forwardName;\n delete label.reversed;\n delete label.forwardName;\n g.setEdge(e.w, e.v, label, forwardName);\n }\n });\n}\n","import * as _ from 'lodash-es';\nimport { Graph } from '../graphlib/index.js';\n\nexport {\n addDummyNode,\n simplify,\n asNonCompoundGraph,\n successorWeights,\n predecessorWeights,\n intersectRect,\n buildLayerMatrix,\n normalizeRanks,\n removeEmptyRanks,\n addBorderNode,\n maxRank,\n partition,\n time,\n notime,\n};\n\n/*\n * Adds a dummy node to the graph and return v.\n */\nfunction addDummyNode(g, type, attrs, name) {\n var v;\n do {\n v = _.uniqueId(name);\n } while (g.hasNode(v));\n\n attrs.dummy = type;\n g.setNode(v, attrs);\n return v;\n}\n\n/*\n * Returns a new graph with only simple edges. Handles aggregation of data\n * associated with multi-edges.\n */\nfunction simplify(g) {\n var simplified = new Graph().setGraph(g.graph());\n _.forEach(g.nodes(), function (v) {\n simplified.setNode(v, g.node(v));\n });\n _.forEach(g.edges(), function (e) {\n var simpleLabel = simplified.edge(e.v, e.w) || { weight: 0, minlen: 1 };\n var label = g.edge(e);\n simplified.setEdge(e.v, e.w, {\n weight: simpleLabel.weight + label.weight,\n minlen: Math.max(simpleLabel.minlen, label.minlen),\n });\n });\n return simplified;\n}\n\nfunction asNonCompoundGraph(g) {\n var simplified = new Graph({ multigraph: g.isMultigraph() }).setGraph(g.graph());\n _.forEach(g.nodes(), function (v) {\n if (!g.children(v).length) {\n simplified.setNode(v, g.node(v));\n }\n });\n _.forEach(g.edges(), function (e) {\n simplified.setEdge(e, g.edge(e));\n });\n return simplified;\n}\n\nfunction successorWeights(g) {\n var weightMap = _.map(g.nodes(), function (v) {\n var sucs = {};\n _.forEach(g.outEdges(v), function (e) {\n sucs[e.w] = (sucs[e.w] || 0) + g.edge(e).weight;\n });\n return sucs;\n });\n return _.zipObject(g.nodes(), weightMap);\n}\n\nfunction predecessorWeights(g) {\n var weightMap = _.map(g.nodes(), function (v) {\n var preds = {};\n _.forEach(g.inEdges(v), function (e) {\n preds[e.v] = (preds[e.v] || 0) + g.edge(e).weight;\n });\n return preds;\n });\n return _.zipObject(g.nodes(), weightMap);\n}\n\n/*\n * Finds where a line starting at point ({x, y}) would intersect a rectangle\n * ({x, y, width, height}) if it were pointing at the rectangle's center.\n */\nfunction intersectRect(rect, point) {\n var x = rect.x;\n var y = rect.y;\n\n // Rectangle intersection algorithm from:\n // http://math.stackexchange.com/questions/108113/find-edge-between-two-boxes\n var dx = point.x - x;\n var dy = point.y - y;\n var w = rect.width / 2;\n var h = rect.height / 2;\n\n if (!dx && !dy) {\n throw new Error('Not possible to find intersection inside of the rectangle');\n }\n\n var sx, sy;\n if (Math.abs(dy) * w > Math.abs(dx) * h) {\n // Intersection is top or bottom of rect.\n if (dy < 0) {\n h = -h;\n }\n sx = (h * dx) / dy;\n sy = h;\n } else {\n // Intersection is left or right of rect.\n if (dx < 0) {\n w = -w;\n }\n sx = w;\n sy = (w * dy) / dx;\n }\n\n return { x: x + sx, y: y + sy };\n}\n\n/*\n * Given a DAG with each node assigned \"rank\" and \"order\" properties, this\n * function will produce a matrix with the ids of each node.\n */\nfunction buildLayerMatrix(g) {\n var layering = _.map(_.range(maxRank(g) + 1), function () {\n return [];\n });\n _.forEach(g.nodes(), function (v) {\n var node = g.node(v);\n var rank = node.rank;\n if (!_.isUndefined(rank)) {\n layering[rank][node.order] = v;\n }\n });\n return layering;\n}\n\n/*\n * Adjusts the ranks for all nodes in the graph such that all nodes v have\n * rank(v) >= 0 and at least one node w has rank(w) = 0.\n */\nfunction normalizeRanks(g) {\n var min = _.min(\n _.map(g.nodes(), function (v) {\n return g.node(v).rank;\n })\n );\n _.forEach(g.nodes(), function (v) {\n var node = g.node(v);\n if (_.has(node, 'rank')) {\n node.rank -= min;\n }\n });\n}\n\nfunction removeEmptyRanks(g) {\n // Ranks may not start at 0, so we need to offset them\n var offset = _.min(\n _.map(g.nodes(), function (v) {\n return g.node(v).rank;\n })\n );\n\n var layers = [];\n _.forEach(g.nodes(), function (v) {\n var rank = g.node(v).rank - offset;\n if (!layers[rank]) {\n layers[rank] = [];\n }\n layers[rank].push(v);\n });\n\n var delta = 0;\n var nodeRankFactor = g.graph().nodeRankFactor;\n _.forEach(layers, function (vs, i) {\n if (_.isUndefined(vs) && i % nodeRankFactor !== 0) {\n --delta;\n } else if (delta) {\n _.forEach(vs, function (v) {\n g.node(v).rank += delta;\n });\n }\n });\n}\n\nfunction addBorderNode(g, prefix, rank, order) {\n var node = {\n width: 0,\n height: 0,\n };\n if (arguments.length >= 4) {\n node.rank = rank;\n node.order = order;\n }\n return addDummyNode(g, 'border', node, prefix);\n}\n\nfunction maxRank(g) {\n return _.max(\n _.map(g.nodes(), function (v) {\n var rank = g.node(v).rank;\n if (!_.isUndefined(rank)) {\n return rank;\n }\n })\n );\n}\n\n/*\n * Partition a collection into two groups: `lhs` and `rhs`. If the supplied\n * function returns true for an entry it goes into `lhs`. Otherwise it goes\n * into `rhs.\n */\nfunction partition(collection, fn) {\n var result = { lhs: [], rhs: [] };\n _.forEach(collection, function (value) {\n if (fn(value)) {\n result.lhs.push(value);\n } else {\n result.rhs.push(value);\n }\n });\n return result;\n}\n\n/*\n * Returns a new function that wraps `fn` with a timer. The wrapper logs the\n * time it takes to execute the function.\n */\nfunction time(name, fn) {\n var start = _.now();\n try {\n return fn();\n } finally {\n console.log(name + ' time: ' + (_.now() - start) + 'ms');\n }\n}\n\nfunction notime(name, fn) {\n return fn();\n}\n","import * as _ from 'lodash-es';\nimport * as util from './util.js';\n\nexport { addBorderSegments };\n\nfunction addBorderSegments(g) {\n function dfs(v) {\n var children = g.children(v);\n var node = g.node(v);\n if (children.length) {\n _.forEach(children, dfs);\n }\n\n if (_.has(node, 'minRank')) {\n node.borderLeft = [];\n node.borderRight = [];\n for (var rank = node.minRank, maxRank = node.maxRank + 1; rank < maxRank; ++rank) {\n addBorderNode(g, 'borderLeft', '_bl', v, node, rank);\n addBorderNode(g, 'borderRight', '_br', v, node, rank);\n }\n }\n }\n\n _.forEach(g.children(), dfs);\n}\n\nfunction addBorderNode(g, prop, prefix, sg, sgNode, rank) {\n var label = { width: 0, height: 0, rank: rank, borderType: prop };\n var prev = sgNode[prop][rank - 1];\n var curr = util.addDummyNode(g, 'border', label, prefix);\n sgNode[prop][rank] = curr;\n g.setParent(curr, sg);\n if (prev) {\n g.setEdge(prev, curr, { weight: 1 });\n }\n}\n","import * as _ from 'lodash-es';\n\nexport { adjust, undo };\n\nfunction adjust(g) {\n var rankDir = g.graph().rankdir.toLowerCase();\n if (rankDir === 'lr' || rankDir === 'rl') {\n swapWidthHeight(g);\n }\n}\n\nfunction undo(g) {\n var rankDir = g.graph().rankdir.toLowerCase();\n if (rankDir === 'bt' || rankDir === 'rl') {\n reverseY(g);\n }\n\n if (rankDir === 'lr' || rankDir === 'rl') {\n swapXY(g);\n swapWidthHeight(g);\n }\n}\n\nfunction swapWidthHeight(g) {\n _.forEach(g.nodes(), function (v) {\n swapWidthHeightOne(g.node(v));\n });\n _.forEach(g.edges(), function (e) {\n swapWidthHeightOne(g.edge(e));\n });\n}\n\nfunction swapWidthHeightOne(attrs) {\n var w = attrs.width;\n attrs.width = attrs.height;\n attrs.height = w;\n}\n\nfunction reverseY(g) {\n _.forEach(g.nodes(), function (v) {\n reverseYOne(g.node(v));\n });\n\n _.forEach(g.edges(), function (e) {\n var edge = g.edge(e);\n _.forEach(edge.points, reverseYOne);\n if (_.has(edge, 'y')) {\n reverseYOne(edge);\n }\n });\n}\n\nfunction reverseYOne(attrs) {\n attrs.y = -attrs.y;\n}\n\nfunction swapXY(g) {\n _.forEach(g.nodes(), function (v) {\n swapXYOne(g.node(v));\n });\n\n _.forEach(g.edges(), function (e) {\n var edge = g.edge(e);\n _.forEach(edge.points, swapXYOne);\n if (_.has(edge, 'x')) {\n swapXYOne(edge);\n }\n });\n}\n\nfunction swapXYOne(attrs) {\n var x = attrs.x;\n attrs.x = attrs.y;\n attrs.y = x;\n}\n","import * as _ from 'lodash-es';\nimport * as util from './util.js';\n\nexport { run, undo };\n\n/*\n * Breaks any long edges in the graph into short segments that span 1 layer\n * each. This operation is undoable with the denormalize function.\n *\n * Pre-conditions:\n *\n * 1. The input graph is a DAG.\n * 2. Each node in the graph has a \"rank\" property.\n *\n * Post-condition:\n *\n * 1. All edges in the graph have a length of 1.\n * 2. Dummy nodes are added where edges have been split into segments.\n * 3. The graph is augmented with a \"dummyChains\" attribute which contains\n * the first dummy in each chain of dummy nodes produced.\n */\nfunction run(g) {\n g.graph().dummyChains = [];\n _.forEach(g.edges(), function (edge) {\n normalizeEdge(g, edge);\n });\n}\n\nfunction normalizeEdge(g, e) {\n var v = e.v;\n var vRank = g.node(v).rank;\n var w = e.w;\n var wRank = g.node(w).rank;\n var name = e.name;\n var edgeLabel = g.edge(e);\n var labelRank = edgeLabel.labelRank;\n\n if (wRank === vRank + 1) return;\n\n g.removeEdge(e);\n\n var dummy, attrs, i;\n for (i = 0, ++vRank; vRank < wRank; ++i, ++vRank) {\n edgeLabel.points = [];\n attrs = {\n width: 0,\n height: 0,\n edgeLabel: edgeLabel,\n edgeObj: e,\n rank: vRank,\n };\n dummy = util.addDummyNode(g, 'edge', attrs, '_d');\n if (vRank === labelRank) {\n attrs.width = edgeLabel.width;\n attrs.height = edgeLabel.height;\n // @ts-expect-error\n attrs.dummy = 'edge-label';\n // @ts-expect-error\n attrs.labelpos = edgeLabel.labelpos;\n }\n g.setEdge(v, dummy, { weight: edgeLabel.weight }, name);\n if (i === 0) {\n g.graph().dummyChains.push(dummy);\n }\n v = dummy;\n }\n\n g.setEdge(v, w, { weight: edgeLabel.weight }, name);\n}\n\nfunction undo(g) {\n _.forEach(g.graph().dummyChains, function (v) {\n var node = g.node(v);\n var origLabel = node.edgeLabel;\n var w;\n g.setEdge(node.edgeObj, origLabel);\n while (node.dummy) {\n w = g.successors(v)[0];\n g.removeNode(v);\n origLabel.points.push({ x: node.x, y: node.y });\n if (node.dummy === 'edge-label') {\n origLabel.x = node.x;\n origLabel.y = node.y;\n origLabel.width = node.width;\n origLabel.height = node.height;\n }\n v = w;\n node = g.node(v);\n }\n });\n}\n","import * as _ from 'lodash-es';\n\nexport { longestPath, slack };\n\n/*\n * Initializes ranks for the input graph using the longest path algorithm. This\n * algorithm scales well and is fast in practice, it yields rather poor\n * solutions. Nodes are pushed to the lowest layer possible, leaving the bottom\n * ranks wide and leaving edges longer than necessary. However, due to its\n * speed, this algorithm is good for getting an initial ranking that can be fed\n * into other algorithms.\n *\n * This algorithm does not normalize layers because it will be used by other\n * algorithms in most cases. If using this algorithm directly, be sure to\n * run normalize at the end.\n *\n * Pre-conditions:\n *\n * 1. Input graph is a DAG.\n * 2. Input graph node labels can be assigned properties.\n *\n * Post-conditions:\n *\n * 1. Each node will be assign an (unnormalized) \"rank\" property.\n */\nfunction longestPath(g) {\n var visited = {};\n\n function dfs(v) {\n var label = g.node(v);\n if (_.has(visited, v)) {\n return label.rank;\n }\n visited[v] = true;\n\n var rank = _.min(\n _.map(g.outEdges(v), function (e) {\n return dfs(e.w) - g.edge(e).minlen;\n })\n );\n\n if (\n rank === Number.POSITIVE_INFINITY || // return value of _.map([]) for Lodash 3\n rank === undefined || // return value of _.map([]) for Lodash 4\n rank === null\n ) {\n // return value of _.map([null])\n rank = 0;\n }\n\n return (label.rank = rank);\n }\n\n _.forEach(g.sources(), dfs);\n}\n\n/*\n * Returns the amount of slack for the given edge. The slack is defined as the\n * difference between the length of the edge and its minimum length.\n */\nfunction slack(g, e) {\n return g.node(e.w).rank - g.node(e.v).rank - g.edge(e).minlen;\n}\n","import * as _ from 'lodash-es';\nimport { Graph } from '../../graphlib/index.js';\nimport { slack } from './util.js';\n\nexport { feasibleTree };\n\n/*\n * Constructs a spanning tree with tight edges and adjusted the input node's\n * ranks to achieve this. A tight edge is one that is has a length that matches\n * its \"minlen\" attribute.\n *\n * The basic structure for this function is derived from Gansner, et al., \"A\n * Technique for Drawing Directed Graphs.\"\n *\n * Pre-conditions:\n *\n * 1. Graph must be a DAG.\n * 2. Graph must be connected.\n * 3. Graph must have at least one node.\n * 5. Graph nodes must have been previously assigned a \"rank\" property that\n * respects the \"minlen\" property of incident edges.\n * 6. Graph edges must have a \"minlen\" property.\n *\n * Post-conditions:\n *\n * - Graph nodes will have their rank adjusted to ensure that all edges are\n * tight.\n *\n * Returns a tree (undirected graph) that is constructed using only \"tight\"\n * edges.\n */\nfunction feasibleTree(g) {\n var t = new Graph({ directed: false });\n\n // Choose arbitrary node from which to start our tree\n var start = g.nodes()[0];\n var size = g.nodeCount();\n t.setNode(start, {});\n\n var edge, delta;\n while (tightTree(t, g) < size) {\n edge = findMinSlackEdge(t, g);\n delta = t.hasNode(edge.v) ? slack(g, edge) : -slack(g, edge);\n shiftRanks(t, g, delta);\n }\n\n return t;\n}\n\n/*\n * Finds a maximal tree of tight edges and returns the number of nodes in the\n * tree.\n */\nfunction tightTree(t, g) {\n function dfs(v) {\n _.forEach(g.nodeEdges(v), function (e) {\n var edgeV = e.v,\n w = v === edgeV ? e.w : edgeV;\n if (!t.hasNode(w) && !slack(g, e)) {\n t.setNode(w, {});\n t.setEdge(v, w, {});\n dfs(w);\n }\n });\n }\n\n _.forEach(t.nodes(), dfs);\n return t.nodeCount();\n}\n\n/*\n * Finds the edge with the smallest slack that is incident on tree and returns\n * it.\n */\nfunction findMinSlackEdge(t, g) {\n return _.minBy(g.edges(), function (e) {\n if (t.hasNode(e.v) !== t.hasNode(e.w)) {\n return slack(g, e);\n }\n });\n}\n\nfunction shiftRanks(t, g, delta) {\n _.forEach(t.nodes(), function (v) {\n g.node(v).rank += delta;\n });\n}\n","import * as _ from 'lodash-es';\n\nexport { topsort, CycleException };\n\ntopsort.CycleException = CycleException;\n\nfunction topsort(g) {\n var visited = {};\n var stack = {};\n var results = [];\n\n function visit(node) {\n if (_.has(stack, node)) {\n throw new CycleException();\n }\n\n if (!_.has(visited, node)) {\n stack[node] = true;\n visited[node] = true;\n _.each(g.predecessors(node), visit);\n delete stack[node];\n results.push(node);\n }\n }\n\n _.each(g.sinks(), visit);\n\n if (_.size(visited) !== g.nodeCount()) {\n throw new CycleException();\n }\n\n return results;\n}\n\nfunction CycleException() {}\nCycleException.prototype = new Error(); // must be an instance of Error to pass testing\n","import * as _ from 'lodash-es';\n\nexport { dfs };\n\n/*\n * A helper that preforms a pre- or post-order traversal on the input graph\n * and returns the nodes in the order they were visited. If the graph is\n * undirected then this algorithm will navigate using neighbors. If the graph\n * is directed then this algorithm will navigate using successors.\n *\n * Order must be one of \"pre\" or \"post\".\n */\nfunction dfs(g, vs, order) {\n if (!_.isArray(vs)) {\n vs = [vs];\n }\n\n var navigation = (g.isDirected() ? g.successors : g.neighbors).bind(g);\n\n var acc = [];\n var visited = {};\n _.each(vs, function (v) {\n if (!g.hasNode(v)) {\n throw new Error('Graph does not have node: ' + v);\n }\n\n doDfs(g, v, order === 'post', visited, navigation, acc);\n });\n return acc;\n}\n\nfunction doDfs(g, v, postorder, visited, navigation, acc) {\n if (!_.has(visited, v)) {\n visited[v] = true;\n\n if (!postorder) {\n acc.push(v);\n }\n _.each(navigation(v), function (w) {\n doDfs(g, w, postorder, visited, navigation, acc);\n });\n if (postorder) {\n acc.push(v);\n }\n }\n}\n","import { dfs } from './dfs.js';\n\nexport { postorder };\n\nfunction postorder(g, vs) {\n return dfs(g, vs, 'post');\n}\n","import { dfs } from './dfs.js';\n\nexport { preorder };\n\nfunction preorder(g, vs) {\n return dfs(g, vs, 'pre');\n}\n","import * as _ from 'lodash-es';\nimport * as alg from '../../graphlib/alg/index.js';\nimport { simplify } from '../util.js';\nimport { feasibleTree } from './feasible-tree.js';\nimport { longestPath, slack } from './util.js';\n\nexport { networkSimplex };\n\n// Expose some internals for testing purposes\nnetworkSimplex.initLowLimValues = initLowLimValues;\nnetworkSimplex.initCutValues = initCutValues;\nnetworkSimplex.calcCutValue = calcCutValue;\nnetworkSimplex.leaveEdge = leaveEdge;\nnetworkSimplex.enterEdge = enterEdge;\nnetworkSimplex.exchangeEdges = exchangeEdges;\n\n/*\n * The network simplex algorithm assigns ranks to each node in the input graph\n * and iteratively improves the ranking to reduce the length of edges.\n *\n * Preconditions:\n *\n * 1. The input graph must be a DAG.\n * 2. All nodes in the graph must have an object value.\n * 3. All edges in the graph must have \"minlen\" and \"weight\" attributes.\n *\n * Postconditions:\n *\n * 1. All nodes in the graph will have an assigned \"rank\" attribute that has\n * been optimized by the network simplex algorithm. Ranks start at 0.\n *\n *\n * A rough sketch of the algorithm is as follows:\n *\n * 1. Assign initial ranks to each node. We use the longest path algorithm,\n * which assigns ranks to the lowest position possible. In general this\n * leads to very wide bottom ranks and unnecessarily long edges.\n * 2. Construct a feasible tight tree. A tight tree is one such that all\n * edges in the tree have no slack (difference between length of edge\n * and minlen for the edge). This by itself greatly improves the assigned\n * rankings by shorting edges.\n * 3. Iteratively find edges that have negative cut values. Generally a\n * negative cut value indicates that the edge could be removed and a new\n * tree edge could be added to produce a more compact graph.\n *\n * Much of the algorithms here are derived from Gansner, et al., \"A Technique\n * for Drawing Directed Graphs.\" The structure of the file roughly follows the\n * structure of the overall algorithm.\n */\nfunction networkSimplex(g) {\n g = simplify(g);\n longestPath(g);\n var t = feasibleTree(g);\n initLowLimValues(t);\n initCutValues(t, g);\n\n var e, f;\n while ((e = leaveEdge(t))) {\n f = enterEdge(t, g, e);\n exchangeEdges(t, g, e, f);\n }\n}\n\n/*\n * Initializes cut values for all edges in the tree.\n */\nfunction initCutValues(t, g) {\n var vs = alg.postorder(t, t.nodes());\n vs = vs.slice(0, vs.length - 1);\n _.forEach(vs, function (v) {\n assignCutValue(t, g, v);\n });\n}\n\nfunction assignCutValue(t, g, child) {\n var childLab = t.node(child);\n var parent = childLab.parent;\n t.edge(child, parent).cutvalue = calcCutValue(t, g, child);\n}\n\n/*\n * Given the tight tree, its graph, and a child in the graph calculate and\n * return the cut value for the edge between the child and its parent.\n */\nfunction calcCutValue(t, g, child) {\n var childLab = t.node(child);\n var parent = childLab.parent;\n // True if the child is on the tail end of the edge in the directed graph\n var childIsTail = true;\n // The graph's view of the tree edge we're inspecting\n var graphEdge = g.edge(child, parent);\n // The accumulated cut value for the edge between this node and its parent\n var cutValue = 0;\n\n if (!graphEdge) {\n childIsTail = false;\n graphEdge = g.edge(parent, child);\n }\n\n cutValue = graphEdge.weight;\n\n _.forEach(g.nodeEdges(child), function (e) {\n var isOutEdge = e.v === child,\n other = isOutEdge ? e.w : e.v;\n\n if (other !== parent) {\n var pointsToHead = isOutEdge === childIsTail,\n otherWeight = g.edge(e).weight;\n\n cutValue += pointsToHead ? otherWeight : -otherWeight;\n if (isTreeEdge(t, child, other)) {\n var otherCutValue = t.edge(child, other).cutvalue;\n cutValue += pointsToHead ? -otherCutValue : otherCutValue;\n }\n }\n });\n\n return cutValue;\n}\n\nfunction initLowLimValues(tree, root) {\n if (arguments.length < 2) {\n root = tree.nodes()[0];\n }\n dfsAssignLowLim(tree, {}, 1, root);\n}\n\nfunction dfsAssignLowLim(tree, visited, nextLim, v, parent) {\n var low = nextLim;\n var label = tree.node(v);\n\n visited[v] = true;\n _.forEach(tree.neighbors(v), function (w) {\n if (!_.has(visited, w)) {\n nextLim = dfsAssignLowLim(tree, visited, nextLim, w, v);\n }\n });\n\n label.low = low;\n label.lim = nextLim++;\n if (parent) {\n label.parent = parent;\n } else {\n // TODO should be able to remove this when we incrementally update low lim\n delete label.parent;\n }\n\n return nextLim;\n}\n\nfunction leaveEdge(tree) {\n return _.find(tree.edges(), function (e) {\n return tree.edge(e).cutvalue < 0;\n });\n}\n\nfunction enterEdge(t, g, edge) {\n var v = edge.v;\n var w = edge.w;\n\n // For the rest of this function we assume that v is the tail and w is the\n // head, so if we don't have this edge in the graph we should flip it to\n // match the correct orientation.\n if (!g.hasEdge(v, w)) {\n v = edge.w;\n w = edge.v;\n }\n\n var vLabel = t.node(v);\n var wLabel = t.node(w);\n var tailLabel = vLabel;\n var flip = false;\n\n // If the root is in the tail of the edge then we need to flip the logic that\n // checks for the head and tail nodes in the candidates function below.\n if (vLabel.lim > wLabel.lim) {\n tailLabel = wLabel;\n flip = true;\n }\n\n var candidates = _.filter(g.edges(), function (edge) {\n return (\n flip === isDescendant(t, t.node(edge.v), tailLabel) &&\n flip !== isDescendant(t, t.node(edge.w), tailLabel)\n );\n });\n\n return _.minBy(candidates, function (edge) {\n return slack(g, edge);\n });\n}\n\nfunction exchangeEdges(t, g, e, f) {\n var v = e.v;\n var w = e.w;\n t.removeEdge(v, w);\n t.setEdge(f.v, f.w, {});\n initLowLimValues(t);\n initCutValues(t, g);\n updateRanks(t, g);\n}\n\nfunction updateRanks(t, g) {\n var root = _.find(t.nodes(), function (v) {\n return !g.node(v).parent;\n });\n var vs = alg.preorder(t, root);\n vs = vs.slice(1);\n _.forEach(vs, function (v) {\n var parent = t.node(v).parent,\n edge = g.edge(v, parent),\n flipped = false;\n\n if (!edge) {\n edge = g.edge(parent, v);\n flipped = true;\n }\n\n g.node(v).rank = g.node(parent).rank + (flipped ? edge.minlen : -edge.minlen);\n });\n}\n\n/*\n * Returns true if the edge is in the tree.\n */\nfunction isTreeEdge(tree, u, v) {\n return tree.hasEdge(u, v);\n}\n\n/*\n * Returns true if the specified node is descendant of the root node per the\n * assigned low and lim attributes in the tree.\n */\nfunction isDescendant(tree, vLabel, rootLabel) {\n return rootLabel.low <= vLabel.lim && vLabel.lim <= rootLabel.lim;\n}\n","import { feasibleTree } from './feasible-tree.js';\nimport { networkSimplex } from './network-simplex.js';\nimport { longestPath } from './util.js';\n\nexport { rank };\n\n/*\n * Assigns a rank to each node in the input graph that respects the \"minlen\"\n * constraint specified on edges between nodes.\n *\n * This basic structure is derived from Gansner, et al., \"A Technique for\n * Drawing Directed Graphs.\"\n *\n * Pre-conditions:\n *\n * 1. Graph must be a connected DAG\n * 2. Graph nodes must be objects\n * 3. Graph edges must have \"weight\" and \"minlen\" attributes\n *\n * Post-conditions:\n *\n * 1. Graph nodes will have a \"rank\" attribute based on the results of the\n * algorithm. Ranks can start at any index (including negative), we'll\n * fix them up later.\n */\nfunction rank(g) {\n switch (g.graph().ranker) {\n case 'network-simplex':\n networkSimplexRanker(g);\n break;\n case 'tight-tree':\n tightTreeRanker(g);\n break;\n case 'longest-path':\n longestPathRanker(g);\n break;\n default:\n networkSimplexRanker(g);\n }\n}\n\n// A fast and simple ranker, but results are far from optimal.\nvar longestPathRanker = longestPath;\n\nfunction tightTreeRanker(g) {\n longestPath(g);\n feasibleTree(g);\n}\n\nfunction networkSimplexRanker(g) {\n networkSimplex(g);\n}\n","import * as _ from 'lodash-es';\nimport * as util from './util.js';\n\nexport { run, cleanup };\n\n/*\n * A nesting graph creates dummy nodes for the tops and bottoms of subgraphs,\n * adds appropriate edges to ensure that all cluster nodes are placed between\n * these boundries, and ensures that the graph is connected.\n *\n * In addition we ensure, through the use of the minlen property, that nodes\n * and subgraph border nodes to not end up on the same rank.\n *\n * Preconditions:\n *\n * 1. Input graph is a DAG\n * 2. Nodes in the input graph has a minlen attribute\n *\n * Postconditions:\n *\n * 1. Input graph is connected.\n * 2. Dummy nodes are added for the tops and bottoms of subgraphs.\n * 3. The minlen attribute for nodes is adjusted to ensure nodes do not\n * get placed on the same rank as subgraph border nodes.\n *\n * The nesting graph idea comes from Sander, \"Layout of Compound Directed\n * Graphs.\"\n */\nfunction run(g) {\n var root = util.addDummyNode(g, 'root', {}, '_root');\n var depths = treeDepths(g);\n var height = _.max(_.values(depths)) - 1; // Note: depths is an Object not an array\n var nodeSep = 2 * height + 1;\n\n g.graph().nestingRoot = root;\n\n // Multiply minlen by nodeSep to align nodes on non-border ranks.\n _.forEach(g.edges(), function (e) {\n g.edge(e).minlen *= nodeSep;\n });\n\n // Calculate a weight that is sufficient to keep subgraphs vertically compact\n var weight = sumWeights(g) + 1;\n\n // Create border nodes and link them up\n _.forEach(g.children(), function (child) {\n dfs(g, root, nodeSep, weight, height, depths, child);\n });\n\n // Save the multiplier for node layers for later removal of empty border\n // layers.\n g.graph().nodeRankFactor = nodeSep;\n}\n\nfunction dfs(g, root, nodeSep, weight, height, depths, v) {\n var children = g.children(v);\n if (!children.length) {\n if (v !== root) {\n g.setEdge(root, v, { weight: 0, minlen: nodeSep });\n }\n return;\n }\n\n var top = util.addBorderNode(g, '_bt');\n var bottom = util.addBorderNode(g, '_bb');\n var label = g.node(v);\n\n g.setParent(top, v);\n label.borderTop = top;\n g.setParent(bottom, v);\n label.borderBottom = bottom;\n\n _.forEach(children, function (child) {\n dfs(g, root, nodeSep, weight, height, depths, child);\n\n var childNode = g.node(child);\n var childTop = childNode.borderTop ? childNode.borderTop : child;\n var childBottom = childNode.borderBottom ? childNode.borderBottom : child;\n var thisWeight = childNode.borderTop ? weight : 2 * weight;\n var minlen = childTop !== childBottom ? 1 : height - depths[v] + 1;\n\n g.setEdge(top, childTop, {\n weight: thisWeight,\n minlen: minlen,\n nestingEdge: true,\n });\n\n g.setEdge(childBottom, bottom, {\n weight: thisWeight,\n minlen: minlen,\n nestingEdge: true,\n });\n });\n\n if (!g.parent(v)) {\n g.setEdge(root, top, { weight: 0, minlen: height + depths[v] });\n }\n}\n\nfunction treeDepths(g) {\n var depths = {};\n function dfs(v, depth) {\n var children = g.children(v);\n if (children && children.length) {\n _.forEach(children, function (child) {\n dfs(child, depth + 1);\n });\n }\n depths[v] = depth;\n }\n _.forEach(g.children(), function (v) {\n dfs(v, 1);\n });\n return depths;\n}\n\nfunction sumWeights(g) {\n return _.reduce(\n g.edges(),\n function (acc, e) {\n return acc + g.edge(e).weight;\n },\n 0\n );\n}\n\nfunction cleanup(g) {\n var graphLabel = g.graph();\n g.removeNode(graphLabel.nestingRoot);\n delete graphLabel.nestingRoot;\n _.forEach(g.edges(), function (e) {\n var edge = g.edge(e);\n if (edge.nestingEdge) {\n g.removeEdge(e);\n }\n });\n}\n","import * as _ from 'lodash-es';\n\nexport { addSubgraphConstraints };\n\nfunction addSubgraphConstraints(g, cg, vs) {\n var prev = {},\n rootPrev;\n\n _.forEach(vs, function (v) {\n var child = g.parent(v),\n parent,\n prevChild;\n while (child) {\n parent = g.parent(child);\n if (parent) {\n prevChild = prev[parent];\n prev[parent] = child;\n } else {\n prevChild = rootPrev;\n rootPrev = child;\n }\n if (prevChild && prevChild !== child) {\n cg.setEdge(prevChild, child);\n return;\n }\n child = parent;\n }\n });\n\n /*\n function dfs(v) {\n var children = v ? g.children(v) : g.children();\n if (children.length) {\n var min = Number.POSITIVE_INFINITY,\n subgraphs = [];\n _.each(children, function(child) {\n var childMin = dfs(child);\n if (g.children(child).length) {\n subgraphs.push({ v: child, order: childMin });\n }\n min = Math.min(min, childMin);\n });\n _.reduce(_.sortBy(subgraphs, \"order\"), function(prev, curr) {\n cg.setEdge(prev.v, curr.v);\n return curr;\n });\n return min;\n }\n return g.node(v).order;\n }\n dfs(undefined);\n */\n}\n","import * as _ from 'lodash-es';\nimport { Graph } from '../../graphlib/index.js';\n\nexport { buildLayerGraph };\n\n/*\n * Constructs a graph that can be used to sort a layer of nodes. The graph will\n * contain all base and subgraph nodes from the request layer in their original\n * hierarchy and any edges that are incident on these nodes and are of the type\n * requested by the \"relationship\" parameter.\n *\n * Nodes from the requested rank that do not have parents are assigned a root\n * node in the output graph, which is set in the root graph attribute. This\n * makes it easy to walk the hierarchy of movable nodes during ordering.\n *\n * Pre-conditions:\n *\n * 1. Input graph is a DAG\n * 2. Base nodes in the input graph have a rank attribute\n * 3. Subgraph nodes in the input graph has minRank and maxRank attributes\n * 4. Edges have an assigned weight\n *\n * Post-conditions:\n *\n * 1. Output graph has all nodes in the movable rank with preserved\n * hierarchy.\n * 2. Root nodes in the movable layer are made children of the node\n * indicated by the root attribute of the graph.\n * 3. Non-movable nodes incident on movable nodes, selected by the\n * relationship parameter, are included in the graph (without hierarchy).\n * 4. Edges incident on movable nodes, selected by the relationship\n * parameter, are added to the output graph.\n * 5. The weights for copied edges are aggregated as need, since the output\n * graph is not a multi-graph.\n */\nfunction buildLayerGraph(g, rank, relationship) {\n var root = createRootNode(g),\n result = new Graph({ compound: true })\n .setGraph({ root: root })\n .setDefaultNodeLabel(function (v) {\n return g.node(v);\n });\n\n _.forEach(g.nodes(), function (v) {\n var node = g.node(v),\n parent = g.parent(v);\n\n if (node.rank === rank || (node.minRank <= rank && rank <= node.maxRank)) {\n result.setNode(v);\n result.setParent(v, parent || root);\n\n // This assumes we have only short edges!\n _.forEach(g[relationship](v), function (e) {\n var u = e.v === v ? e.w : e.v,\n edge = result.edge(u, v),\n weight = !_.isUndefined(edge) ? edge.weight : 0;\n result.setEdge(u, v, { weight: g.edge(e).weight + weight });\n });\n\n if (_.has(node, 'minRank')) {\n result.setNode(v, {\n borderLeft: node.borderLeft[rank],\n borderRight: node.borderRight[rank],\n });\n }\n }\n });\n\n return result;\n}\n\nfunction createRootNode(g) {\n var v;\n while (g.hasNode((v = _.uniqueId('_root'))));\n return v;\n}\n","import * as _ from 'lodash-es';\n\nexport { crossCount };\n\n/*\n * A function that takes a layering (an array of layers, each with an array of\n * ordererd nodes) and a graph and returns a weighted crossing count.\n *\n * Pre-conditions:\n *\n * 1. Input graph must be simple (not a multigraph), directed, and include\n * only simple edges.\n * 2. Edges in the input graph must have assigned weights.\n *\n * Post-conditions:\n *\n * 1. The graph and layering matrix are left unchanged.\n *\n * This algorithm is derived from Barth, et al., \"Bilayer Cross Counting.\"\n */\nfunction crossCount(g, layering) {\n var cc = 0;\n for (var i = 1; i < layering.length; ++i) {\n cc += twoLayerCrossCount(g, layering[i - 1], layering[i]);\n }\n return cc;\n}\n\nfunction twoLayerCrossCount(g, northLayer, southLayer) {\n // Sort all of the edges between the north and south layers by their position\n // in the north layer and then the south. Map these edges to the position of\n // their head in the south layer.\n var southPos = _.zipObject(\n southLayer,\n _.map(southLayer, function (v, i) {\n return i;\n })\n );\n var southEntries = _.flatten(\n _.map(northLayer, function (v) {\n return _.sortBy(\n _.map(g.outEdges(v), function (e) {\n return { pos: southPos[e.w], weight: g.edge(e).weight };\n }),\n 'pos'\n );\n })\n );\n\n // Build the accumulator tree\n var firstIndex = 1;\n while (firstIndex < southLayer.length) firstIndex <<= 1;\n var treeSize = 2 * firstIndex - 1;\n firstIndex -= 1;\n var tree = _.map(new Array(treeSize), function () {\n return 0;\n });\n\n // Calculate the weighted crossings\n var cc = 0;\n _.forEach(\n // @ts-expect-error\n southEntries.forEach(function (entry) {\n var index = entry.pos + firstIndex;\n tree[index] += entry.weight;\n var weightSum = 0;\n // @ts-expect-error\n while (index > 0) {\n // @ts-expect-error\n if (index % 2) {\n weightSum += tree[index + 1];\n }\n // @ts-expect-error\n index = (index - 1) >> 1;\n tree[index] += entry.weight;\n }\n cc += entry.weight * weightSum;\n })\n );\n\n return cc;\n}\n","import * as _ from 'lodash-es';\n\nexport { initOrder };\n\n/*\n * Assigns an initial order value for each node by performing a DFS search\n * starting from nodes in the first rank. Nodes are assigned an order in their\n * rank as they are first visited.\n *\n * This approach comes from Gansner, et al., \"A Technique for Drawing Directed\n * Graphs.\"\n *\n * Returns a layering matrix with an array per layer and each layer sorted by\n * the order of its nodes.\n */\nfunction initOrder(g) {\n var visited = {};\n var simpleNodes = _.filter(g.nodes(), function (v) {\n return !g.children(v).length;\n });\n var maxRank = _.max(\n _.map(simpleNodes, function (v) {\n return g.node(v).rank;\n })\n );\n var layers = _.map(_.range(maxRank + 1), function () {\n return [];\n });\n\n function dfs(v) {\n if (_.has(visited, v)) return;\n visited[v] = true;\n var node = g.node(v);\n layers[node.rank].push(v);\n _.forEach(g.successors(v), dfs);\n }\n\n var orderedVs = _.sortBy(simpleNodes, function (v) {\n return g.node(v).rank;\n });\n _.forEach(orderedVs, dfs);\n\n return layers;\n}\n","import * as _ from 'lodash-es';\n\nexport { barycenter };\n\nfunction barycenter(g, movable) {\n return _.map(movable, function (v) {\n var inV = g.inEdges(v);\n if (!inV.length) {\n return { v: v };\n } else {\n var result = _.reduce(\n inV,\n function (acc, e) {\n var edge = g.edge(e),\n nodeU = g.node(e.v);\n return {\n sum: acc.sum + edge.weight * nodeU.order,\n weight: acc.weight + edge.weight,\n };\n },\n { sum: 0, weight: 0 }\n );\n\n return {\n v: v,\n barycenter: result.sum / result.weight,\n weight: result.weight,\n };\n }\n });\n}\n","import * as _ from 'lodash-es';\n\nexport { resolveConflicts };\n\n/*\n * Given a list of entries of the form {v, barycenter, weight} and a\n * constraint graph this function will resolve any conflicts between the\n * constraint graph and the barycenters for the entries. If the barycenters for\n * an entry would violate a constraint in the constraint graph then we coalesce\n * the nodes in the conflict into a new node that respects the contraint and\n * aggregates barycenter and weight information.\n *\n * This implementation is based on the description in Forster, \"A Fast and\n * Simple Hueristic for Constrained Two-Level Crossing Reduction,\" thought it\n * differs in some specific details.\n *\n * Pre-conditions:\n *\n * 1. Each entry has the form {v, barycenter, weight}, or if the node has\n * no barycenter, then {v}.\n *\n * Returns:\n *\n * A new list of entries of the form {vs, i, barycenter, weight}. The list\n * `vs` may either be a singleton or it may be an aggregation of nodes\n * ordered such that they do not violate constraints from the constraint\n * graph. The property `i` is the lowest original index of any of the\n * elements in `vs`.\n */\nfunction resolveConflicts(entries, cg) {\n var mappedEntries = {};\n _.forEach(entries, function (entry, i) {\n var tmp = (mappedEntries[entry.v] = {\n indegree: 0,\n in: [],\n out: [],\n vs: [entry.v],\n i: i,\n });\n if (!_.isUndefined(entry.barycenter)) {\n // @ts-expect-error\n tmp.barycenter = entry.barycenter;\n // @ts-expect-error\n tmp.weight = entry.weight;\n }\n });\n\n _.forEach(cg.edges(), function (e) {\n var entryV = mappedEntries[e.v];\n var entryW = mappedEntries[e.w];\n if (!_.isUndefined(entryV) && !_.isUndefined(entryW)) {\n entryW.indegree++;\n entryV.out.push(mappedEntries[e.w]);\n }\n });\n\n var sourceSet = _.filter(mappedEntries, function (entry) {\n // @ts-expect-error\n return !entry.indegree;\n });\n\n return doResolveConflicts(sourceSet);\n}\n\nfunction doResolveConflicts(sourceSet) {\n var entries = [];\n\n function handleIn(vEntry) {\n return function (uEntry) {\n if (uEntry.merged) {\n return;\n }\n if (\n _.isUndefined(uEntry.barycenter) ||\n _.isUndefined(vEntry.barycenter) ||\n uEntry.barycenter >= vEntry.barycenter\n ) {\n mergeEntries(vEntry, uEntry);\n }\n };\n }\n\n function handleOut(vEntry) {\n return function (wEntry) {\n wEntry['in'].push(vEntry);\n if (--wEntry.indegree === 0) {\n sourceSet.push(wEntry);\n }\n };\n }\n\n while (sourceSet.length) {\n var entry = sourceSet.pop();\n entries.push(entry);\n _.forEach(entry['in'].reverse(), handleIn(entry));\n _.forEach(entry.out, handleOut(entry));\n }\n\n return _.map(\n _.filter(entries, function (entry) {\n return !entry.merged;\n }),\n function (entry) {\n return _.pick(entry, ['vs', 'i', 'barycenter', 'weight']);\n }\n );\n}\n\nfunction mergeEntries(target, source) {\n var sum = 0;\n var weight = 0;\n\n if (target.weight) {\n sum += target.barycenter * target.weight;\n weight += target.weight;\n }\n\n if (source.weight) {\n sum += source.barycenter * source.weight;\n weight += source.weight;\n }\n\n target.vs = source.vs.concat(target.vs);\n target.barycenter = sum / weight;\n target.weight = weight;\n target.i = Math.min(source.i, target.i);\n source.merged = true;\n}\n","import * as _ from 'lodash-es';\nimport * as util from '../util.js';\n\nexport { sort };\n\nfunction sort(entries, biasRight) {\n var parts = util.partition(entries, function (entry) {\n return _.has(entry, 'barycenter');\n });\n var sortable = parts.lhs,\n unsortable = _.sortBy(parts.rhs, function (entry) {\n return -entry.i;\n }),\n vs = [],\n sum = 0,\n weight = 0,\n vsIndex = 0;\n\n sortable.sort(compareWithBias(!!biasRight));\n\n vsIndex = consumeUnsortable(vs, unsortable, vsIndex);\n\n _.forEach(sortable, function (entry) {\n vsIndex += entry.vs.length;\n vs.push(entry.vs);\n sum += entry.barycenter * entry.weight;\n weight += entry.weight;\n vsIndex = consumeUnsortable(vs, unsortable, vsIndex);\n });\n\n var result = { vs: _.flatten(vs) };\n if (weight) {\n result.barycenter = sum / weight;\n result.weight = weight;\n }\n return result;\n}\n\nfunction consumeUnsortable(vs, unsortable, index) {\n var last;\n while (unsortable.length && (last = _.last(unsortable)).i <= index) {\n unsortable.pop();\n vs.push(last.vs);\n index++;\n }\n return index;\n}\n\nfunction compareWithBias(bias) {\n return function (entryV, entryW) {\n if (entryV.barycenter < entryW.barycenter) {\n return -1;\n } else if (entryV.barycenter > entryW.barycenter) {\n return 1;\n }\n\n return !bias ? entryV.i - entryW.i : entryW.i - entryV.i;\n };\n}\n","import * as _ from 'lodash-es';\nimport { barycenter } from './barycenter.js';\nimport { resolveConflicts } from './resolve-conflicts.js';\nimport { sort } from './sort.js';\n\nexport { sortSubgraph };\n\nfunction sortSubgraph(g, v, cg, biasRight) {\n var movable = g.children(v);\n var node = g.node(v);\n var bl = node ? node.borderLeft : undefined;\n var br = node ? node.borderRight : undefined;\n var subgraphs = {};\n\n if (bl) {\n movable = _.filter(movable, function (w) {\n return w !== bl && w !== br;\n });\n }\n\n var barycenters = barycenter(g, movable);\n _.forEach(barycenters, function (entry) {\n if (g.children(entry.v).length) {\n var subgraphResult = sortSubgraph(g, entry.v, cg, biasRight);\n subgraphs[entry.v] = subgraphResult;\n if (_.has(subgraphResult, 'barycenter')) {\n mergeBarycenters(entry, subgraphResult);\n }\n }\n });\n\n var entries = resolveConflicts(barycenters, cg);\n expandSubgraphs(entries, subgraphs);\n\n var result = sort(entries, biasRight);\n\n if (bl) {\n result.vs = _.flatten([bl, result.vs, br]);\n if (g.predecessors(bl).length) {\n var blPred = g.node(g.predecessors(bl)[0]),\n brPred = g.node(g.predecessors(br)[0]);\n if (!_.has(result, 'barycenter')) {\n result.barycenter = 0;\n result.weight = 0;\n }\n result.barycenter =\n (result.barycenter * result.weight + blPred.order + brPred.order) / (result.weight + 2);\n result.weight += 2;\n }\n }\n\n return result;\n}\n\nfunction expandSubgraphs(entries, subgraphs) {\n _.forEach(entries, function (entry) {\n entry.vs = _.flatten(\n entry.vs.map(function (v) {\n if (subgraphs[v]) {\n return subgraphs[v].vs;\n }\n return v;\n })\n );\n });\n}\n\nfunction mergeBarycenters(target, other) {\n if (!_.isUndefined(target.barycenter)) {\n target.barycenter =\n (target.barycenter * target.weight + other.barycenter * other.weight) /\n (target.weight + other.weight);\n target.weight += other.weight;\n } else {\n target.barycenter = other.barycenter;\n target.weight = other.weight;\n }\n}\n","import * as _ from 'lodash-es';\nimport { Graph } from '../../graphlib/index.js';\nimport * as util from '../util.js';\nimport { addSubgraphConstraints } from './add-subgraph-constraints.js';\nimport { buildLayerGraph } from './build-layer-graph.js';\nimport { crossCount } from './cross-count.js';\nimport { initOrder } from './init-order.js';\nimport { sortSubgraph } from './sort-subgraph.js';\n\nexport { order };\n\n/*\n * Applies heuristics to minimize edge crossings in the graph and sets the best\n * order solution as an order attribute on each node.\n *\n * Pre-conditions:\n *\n * 1. Graph must be DAG\n * 2. Graph nodes must be objects with a \"rank\" attribute\n * 3. Graph edges must have the \"weight\" attribute\n *\n * Post-conditions:\n *\n * 1. Graph nodes will have an \"order\" attribute based on the results of the\n * algorithm.\n */\nfunction order(g) {\n var maxRank = util.maxRank(g),\n downLayerGraphs = buildLayerGraphs(g, _.range(1, maxRank + 1), 'inEdges'),\n upLayerGraphs = buildLayerGraphs(g, _.range(maxRank - 1, -1, -1), 'outEdges');\n\n var layering = initOrder(g);\n assignOrder(g, layering);\n\n var bestCC = Number.POSITIVE_INFINITY,\n best;\n\n for (var i = 0, lastBest = 0; lastBest < 4; ++i, ++lastBest) {\n sweepLayerGraphs(i % 2 ? downLayerGraphs : upLayerGraphs, i % 4 >= 2);\n\n layering = util.buildLayerMatrix(g);\n var cc = crossCount(g, layering);\n if (cc < bestCC) {\n lastBest = 0;\n best = _.cloneDeep(layering);\n bestCC = cc;\n }\n }\n\n assignOrder(g, best);\n}\n\nfunction buildLayerGraphs(g, ranks, relationship) {\n return _.map(ranks, function (rank) {\n return buildLayerGraph(g, rank, relationship);\n });\n}\n\nfunction sweepLayerGraphs(layerGraphs, biasRight) {\n var cg = new Graph();\n _.forEach(layerGraphs, function (lg) {\n var root = lg.graph().root;\n var sorted = sortSubgraph(lg, root, cg, biasRight);\n _.forEach(sorted.vs, function (v, i) {\n lg.node(v).order = i;\n });\n addSubgraphConstraints(lg, cg, sorted.vs);\n });\n}\n\nfunction assignOrder(g, layering) {\n _.forEach(layering, function (layer) {\n _.forEach(layer, function (v, i) {\n g.node(v).order = i;\n });\n });\n}\n","import * as _ from 'lodash-es';\n\nexport { parentDummyChains };\n\nfunction parentDummyChains(g) {\n var postorderNums = postorder(g);\n\n _.forEach(g.graph().dummyChains, function (v) {\n var node = g.node(v);\n var edgeObj = node.edgeObj;\n var pathData = findPath(g, postorderNums, edgeObj.v, edgeObj.w);\n var path = pathData.path;\n var lca = pathData.lca;\n var pathIdx = 0;\n var pathV = path[pathIdx];\n var ascending = true;\n\n while (v !== edgeObj.w) {\n node = g.node(v);\n\n if (ascending) {\n while ((pathV = path[pathIdx]) !== lca && g.node(pathV).maxRank < node.rank) {\n pathIdx++;\n }\n\n if (pathV === lca) {\n ascending = false;\n }\n }\n\n if (!ascending) {\n while (\n pathIdx < path.length - 1 &&\n g.node((pathV = path[pathIdx + 1])).minRank <= node.rank\n ) {\n pathIdx++;\n }\n pathV = path[pathIdx];\n }\n\n g.setParent(v, pathV);\n v = g.successors(v)[0];\n }\n });\n}\n\n// Find a path from v to w through the lowest common ancestor (LCA). Return the\n// full path and the LCA.\nfunction findPath(g, postorderNums, v, w) {\n var vPath = [];\n var wPath = [];\n var low = Math.min(postorderNums[v].low, postorderNums[w].low);\n var lim = Math.max(postorderNums[v].lim, postorderNums[w].lim);\n var parent;\n var lca;\n\n // Traverse up from v to find the LCA\n parent = v;\n do {\n parent = g.parent(parent);\n vPath.push(parent);\n } while (parent && (postorderNums[parent].low > low || lim > postorderNums[parent].lim));\n lca = parent;\n\n // Traverse from w to LCA\n parent = w;\n while ((parent = g.parent(parent)) !== lca) {\n wPath.push(parent);\n }\n\n return { path: vPath.concat(wPath.reverse()), lca: lca };\n}\n\nfunction postorder(g) {\n var result = {};\n var lim = 0;\n\n function dfs(v) {\n var low = lim;\n _.forEach(g.children(v), dfs);\n result[v] = { low: low, lim: lim++ };\n }\n _.forEach(g.children(), dfs);\n\n return result;\n}\n","import * as _ from 'lodash-es';\nimport { Graph } from '../../graphlib/index.js';\nimport * as util from '../util.js';\n\n/*\n * This module provides coordinate assignment based on Brandes and Köpf, \"Fast\n * and Simple Horizontal Coordinate Assignment.\"\n */\n\nexport {\n positionX,\n findType1Conflicts,\n findType2Conflicts,\n addConflict,\n hasConflict,\n verticalAlignment,\n horizontalCompaction,\n alignCoordinates,\n findSmallestWidthAlignment,\n balance,\n};\n\n/*\n * Marks all edges in the graph with a type-1 conflict with the \"type1Conflict\"\n * property. A type-1 conflict is one where a non-inner segment crosses an\n * inner segment. An inner segment is an edge with both incident nodes marked\n * with the \"dummy\" property.\n *\n * This algorithm scans layer by layer, starting with the second, for type-1\n * conflicts between the current layer and the previous layer. For each layer\n * it scans the nodes from left to right until it reaches one that is incident\n * on an inner segment. It then scans predecessors to determine if they have\n * edges that cross that inner segment. At the end a final scan is done for all\n * nodes on the current rank to see if they cross the last visited inner\n * segment.\n *\n * This algorithm (safely) assumes that a dummy node will only be incident on a\n * single node in the layers being scanned.\n */\nfunction findType1Conflicts(g, layering) {\n var conflicts = {};\n\n function visitLayer(prevLayer, layer) {\n var // last visited node in the previous layer that is incident on an inner\n // segment.\n k0 = 0,\n // Tracks the last node in this layer scanned for crossings with a type-1\n // segment.\n scanPos = 0,\n prevLayerLength = prevLayer.length,\n lastNode = _.last(layer);\n\n _.forEach(layer, function (v, i) {\n var w = findOtherInnerSegmentNode(g, v),\n k1 = w ? g.node(w).order : prevLayerLength;\n\n if (w || v === lastNode) {\n _.forEach(layer.slice(scanPos, i + 1), function (scanNode) {\n _.forEach(g.predecessors(scanNode), function (u) {\n var uLabel = g.node(u),\n uPos = uLabel.order;\n if ((uPos < k0 || k1 < uPos) && !(uLabel.dummy && g.node(scanNode).dummy)) {\n addConflict(conflicts, u, scanNode);\n }\n });\n });\n // @ts-expect-error\n scanPos = i + 1;\n k0 = k1;\n }\n });\n\n return layer;\n }\n\n _.reduce(layering, visitLayer);\n return conflicts;\n}\n\nfunction findType2Conflicts(g, layering) {\n var conflicts = {};\n\n function scan(south, southPos, southEnd, prevNorthBorder, nextNorthBorder) {\n var v;\n _.forEach(_.range(southPos, southEnd), function (i) {\n v = south[i];\n if (g.node(v).dummy) {\n _.forEach(g.predecessors(v), function (u) {\n var uNode = g.node(u);\n if (uNode.dummy && (uNode.order < prevNorthBorder || uNode.order > nextNorthBorder)) {\n addConflict(conflicts, u, v);\n }\n });\n }\n });\n }\n\n function visitLayer(north, south) {\n var prevNorthPos = -1,\n nextNorthPos,\n southPos = 0;\n\n _.forEach(south, function (v, southLookahead) {\n if (g.node(v).dummy === 'border') {\n var predecessors = g.predecessors(v);\n if (predecessors.length) {\n nextNorthPos = g.node(predecessors[0]).order;\n scan(south, southPos, southLookahead, prevNorthPos, nextNorthPos);\n // @ts-expect-error\n southPos = southLookahead;\n prevNorthPos = nextNorthPos;\n }\n }\n scan(south, southPos, south.length, nextNorthPos, north.length);\n });\n\n return south;\n }\n\n _.reduce(layering, visitLayer);\n return conflicts;\n}\n\nfunction findOtherInnerSegmentNode(g, v) {\n if (g.node(v).dummy) {\n return _.find(g.predecessors(v), function (u) {\n return g.node(u).dummy;\n });\n }\n}\n\nfunction addConflict(conflicts, v, w) {\n if (v > w) {\n var tmp = v;\n v = w;\n w = tmp;\n }\n\n var conflictsV = conflicts[v];\n if (!conflictsV) {\n conflicts[v] = conflictsV = {};\n }\n conflictsV[w] = true;\n}\n\nfunction hasConflict(conflicts, v, w) {\n if (v > w) {\n var tmp = v;\n v = w;\n w = tmp;\n }\n return _.has(conflicts[v], w);\n}\n\n/*\n * Try to align nodes into vertical \"blocks\" where possible. This algorithm\n * attempts to align a node with one of its median neighbors. If the edge\n * connecting a neighbor is a type-1 conflict then we ignore that possibility.\n * If a previous node has already formed a block with a node after the node\n * we're trying to form a block with, we also ignore that possibility - our\n * blocks would be split in that scenario.\n */\nfunction verticalAlignment(g, layering, conflicts, neighborFn) {\n var root = {},\n align = {},\n pos = {};\n\n // We cache the position here based on the layering because the graph and\n // layering may be out of sync. The layering matrix is manipulated to\n // generate different extreme alignments.\n _.forEach(layering, function (layer) {\n _.forEach(layer, function (v, order) {\n root[v] = v;\n align[v] = v;\n pos[v] = order;\n });\n });\n\n _.forEach(layering, function (layer) {\n var prevIdx = -1;\n _.forEach(layer, function (v) {\n var ws = neighborFn(v);\n if (ws.length) {\n ws = _.sortBy(ws, function (w) {\n return pos[w];\n });\n var mp = (ws.length - 1) / 2;\n for (var i = Math.floor(mp), il = Math.ceil(mp); i <= il; ++i) {\n var w = ws[i];\n if (align[v] === v && prevIdx < pos[w] && !hasConflict(conflicts, v, w)) {\n align[w] = v;\n align[v] = root[v] = root[w];\n prevIdx = pos[w];\n }\n }\n }\n });\n });\n\n return { root: root, align: align };\n}\n\nfunction horizontalCompaction(g, layering, root, align, reverseSep) {\n // This portion of the algorithm differs from BK due to a number of problems.\n // Instead of their algorithm we construct a new block graph and do two\n // sweeps. The first sweep places blocks with the smallest possible\n // coordinates. The second sweep removes unused space by moving blocks to the\n // greatest coordinates without violating separation.\n var xs = {},\n blockG = buildBlockGraph(g, layering, root, reverseSep),\n borderType = reverseSep ? 'borderLeft' : 'borderRight';\n\n function iterate(setXsFunc, nextNodesFunc) {\n var stack = blockG.nodes();\n var elem = stack.pop();\n var visited = {};\n while (elem) {\n if (visited[elem]) {\n setXsFunc(elem);\n } else {\n visited[elem] = true;\n stack.push(elem);\n stack = stack.concat(nextNodesFunc(elem));\n }\n\n elem = stack.pop();\n }\n }\n\n // First pass, assign smallest coordinates\n function pass1(elem) {\n xs[elem] = blockG.inEdges(elem).reduce(function (acc, e) {\n return Math.max(acc, xs[e.v] + blockG.edge(e));\n }, 0);\n }\n\n // Second pass, assign greatest coordinates\n function pass2(elem) {\n var min = blockG.outEdges(elem).reduce(function (acc, e) {\n return Math.min(acc, xs[e.w] - blockG.edge(e));\n }, Number.POSITIVE_INFINITY);\n\n var node = g.node(elem);\n if (min !== Number.POSITIVE_INFINITY && node.borderType !== borderType) {\n xs[elem] = Math.max(xs[elem], min);\n }\n }\n\n iterate(pass1, blockG.predecessors.bind(blockG));\n iterate(pass2, blockG.successors.bind(blockG));\n\n // Assign x coordinates to all nodes\n _.forEach(align, function (v) {\n xs[v] = xs[root[v]];\n });\n\n return xs;\n}\n\nfunction buildBlockGraph(g, layering, root, reverseSep) {\n var blockGraph = new Graph(),\n graphLabel = g.graph(),\n sepFn = sep(graphLabel.nodesep, graphLabel.edgesep, reverseSep);\n\n _.forEach(layering, function (layer) {\n var u;\n _.forEach(layer, function (v) {\n var vRoot = root[v];\n blockGraph.setNode(vRoot);\n if (u) {\n var uRoot = root[u],\n prevMax = blockGraph.edge(uRoot, vRoot);\n blockGraph.setEdge(uRoot, vRoot, Math.max(sepFn(g, v, u), prevMax || 0));\n }\n u = v;\n });\n });\n\n return blockGraph;\n}\n\n/*\n * Returns the alignment that has the smallest width of the given alignments.\n */\nfunction findSmallestWidthAlignment(g, xss) {\n return _.minBy(_.values(xss), function (xs) {\n var max = Number.NEGATIVE_INFINITY;\n var min = Number.POSITIVE_INFINITY;\n\n _.forIn(xs, function (x, v) {\n var halfWidth = width(g, v) / 2;\n\n max = Math.max(x + halfWidth, max);\n min = Math.min(x - halfWidth, min);\n });\n\n return max - min;\n });\n}\n\n/*\n * Align the coordinates of each of the layout alignments such that\n * left-biased alignments have their minimum coordinate at the same point as\n * the minimum coordinate of the smallest width alignment and right-biased\n * alignments have their maximum coordinate at the same point as the maximum\n * coordinate of the smallest width alignment.\n */\nfunction alignCoordinates(xss, alignTo) {\n var alignToVals = _.values(alignTo),\n alignToMin = _.min(alignToVals),\n alignToMax = _.max(alignToVals);\n\n _.forEach(['u', 'd'], function (vert) {\n _.forEach(['l', 'r'], function (horiz) {\n var alignment = vert + horiz,\n xs = xss[alignment],\n delta;\n if (xs === alignTo) return;\n\n var xsVals = _.values(xs);\n delta = horiz === 'l' ? alignToMin - _.min(xsVals) : alignToMax - _.max(xsVals);\n\n if (delta) {\n xss[alignment] = _.mapValues(xs, function (x) {\n return x + delta;\n });\n }\n });\n });\n}\n\nfunction balance(xss, align) {\n return _.mapValues(xss.ul, function (ignore, v) {\n if (align) {\n return xss[align.toLowerCase()][v];\n } else {\n var xs = _.sortBy(_.map(xss, v));\n return (xs[1] + xs[2]) / 2;\n }\n });\n}\n\nfunction positionX(g) {\n var layering = util.buildLayerMatrix(g);\n var conflicts = _.merge(findType1Conflicts(g, layering), findType2Conflicts(g, layering));\n\n var xss = {};\n var adjustedLayering;\n _.forEach(['u', 'd'], function (vert) {\n adjustedLayering = vert === 'u' ? layering : _.values(layering).reverse();\n _.forEach(['l', 'r'], function (horiz) {\n if (horiz === 'r') {\n adjustedLayering = _.map(adjustedLayering, function (inner) {\n return _.values(inner).reverse();\n });\n }\n\n var neighborFn = (vert === 'u' ? g.predecessors : g.successors).bind(g);\n var align = verticalAlignment(g, adjustedLayering, conflicts, neighborFn);\n var xs = horizontalCompaction(g, adjustedLayering, align.root, align.align, horiz === 'r');\n if (horiz === 'r') {\n xs = _.mapValues(xs, function (x) {\n return -x;\n });\n }\n xss[vert + horiz] = xs;\n });\n });\n\n var smallestWidth = findSmallestWidthAlignment(g, xss);\n alignCoordinates(xss, smallestWidth);\n return balance(xss, g.graph().align);\n}\n\nfunction sep(nodeSep, edgeSep, reverseSep) {\n return function (g, v, w) {\n var vLabel = g.node(v);\n var wLabel = g.node(w);\n var sum = 0;\n var delta;\n\n sum += vLabel.width / 2;\n if (_.has(vLabel, 'labelpos')) {\n switch (vLabel.labelpos.toLowerCase()) {\n case 'l':\n delta = -vLabel.width / 2;\n break;\n case 'r':\n delta = vLabel.width / 2;\n break;\n }\n }\n if (delta) {\n sum += reverseSep ? delta : -delta;\n }\n delta = 0;\n\n sum += (vLabel.dummy ? edgeSep : nodeSep) / 2;\n sum += (wLabel.dummy ? edgeSep : nodeSep) / 2;\n\n sum += wLabel.width / 2;\n if (_.has(wLabel, 'labelpos')) {\n switch (wLabel.labelpos.toLowerCase()) {\n case 'l':\n delta = wLabel.width / 2;\n break;\n case 'r':\n delta = -wLabel.width / 2;\n break;\n }\n }\n if (delta) {\n sum += reverseSep ? delta : -delta;\n }\n delta = 0;\n\n return sum;\n };\n}\n\nfunction width(g, v) {\n return g.node(v).width;\n}\n","import * as _ from 'lodash-es';\nimport * as util from '../util.js';\nimport { positionX } from './bk.js';\n\nexport { position };\n\nfunction position(g) {\n g = util.asNonCompoundGraph(g);\n\n positionY(g);\n _.forEach(positionX(g), function (x, v) {\n g.node(v).x = x;\n });\n}\n\nfunction positionY(g) {\n var layering = util.buildLayerMatrix(g);\n var rankSep = g.graph().ranksep;\n var prevY = 0;\n _.forEach(layering, function (layer) {\n var maxHeight = _.max(\n _.map(layer, function (v) {\n return g.node(v).height;\n })\n );\n _.forEach(layer, function (v) {\n g.node(v).y = prevY + maxHeight / 2;\n });\n prevY += maxHeight + rankSep;\n });\n}\n","import * as _ from 'lodash-es';\nimport { Graph } from '../graphlib/index.js';\nimport { addBorderSegments } from './add-border-segments.js';\nimport * as coordinateSystem from './coordinate-system.js';\nimport * as acyclic from './acyclic.js';\nimport * as normalize from './normalize.js';\nimport { rank } from './rank/index.js';\nimport * as nestingGraph from './nesting-graph.js';\nimport { order } from './order/index.js';\nimport { parentDummyChains } from './parent-dummy-chains.js';\nimport { position } from './position/index.js';\nimport * as util from './util.js';\n\nexport { layout };\n\nfunction layout(g, opts) {\n var time = opts && opts.debugTiming ? util.time : util.notime;\n time('layout', function () {\n var layoutGraph = time(' buildLayoutGraph', function () {\n return buildLayoutGraph(g);\n });\n time(' runLayout', function () {\n runLayout(layoutGraph, time);\n });\n time(' updateInputGraph', function () {\n updateInputGraph(g, layoutGraph);\n });\n });\n}\n\nfunction runLayout(g, time) {\n time(' makeSpaceForEdgeLabels', function () {\n makeSpaceForEdgeLabels(g);\n });\n time(' removeSelfEdges', function () {\n removeSelfEdges(g);\n });\n time(' acyclic', function () {\n acyclic.run(g);\n });\n time(' nestingGraph.run', function () {\n nestingGraph.run(g);\n });\n time(' rank', function () {\n rank(util.asNonCompoundGraph(g));\n });\n time(' injectEdgeLabelProxies', function () {\n injectEdgeLabelProxies(g);\n });\n time(' removeEmptyRanks', function () {\n util.removeEmptyRanks(g);\n });\n time(' nestingGraph.cleanup', function () {\n nestingGraph.cleanup(g);\n });\n time(' normalizeRanks', function () {\n util.normalizeRanks(g);\n });\n time(' assignRankMinMax', function () {\n assignRankMinMax(g);\n });\n time(' removeEdgeLabelProxies', function () {\n removeEdgeLabelProxies(g);\n });\n time(' normalize.run', function () {\n normalize.run(g);\n });\n time(' parentDummyChains', function () {\n parentDummyChains(g);\n });\n time(' addBorderSegments', function () {\n addBorderSegments(g);\n });\n time(' order', function () {\n order(g);\n });\n time(' insertSelfEdges', function () {\n insertSelfEdges(g);\n });\n time(' adjustCoordinateSystem', function () {\n coordinateSystem.adjust(g);\n });\n time(' position', function () {\n position(g);\n });\n time(' positionSelfEdges', function () {\n positionSelfEdges(g);\n });\n time(' removeBorderNodes', function () {\n removeBorderNodes(g);\n });\n time(' normalize.undo', function () {\n normalize.undo(g);\n });\n time(' fixupEdgeLabelCoords', function () {\n fixupEdgeLabelCoords(g);\n });\n time(' undoCoordinateSystem', function () {\n coordinateSystem.undo(g);\n });\n time(' translateGraph', function () {\n translateGraph(g);\n });\n time(' assignNodeIntersects', function () {\n assignNodeIntersects(g);\n });\n time(' reversePoints', function () {\n reversePointsForReversedEdges(g);\n });\n time(' acyclic.undo', function () {\n acyclic.undo(g);\n });\n}\n\n/*\n * Copies final layout information from the layout graph back to the input\n * graph. This process only copies whitelisted attributes from the layout graph\n * to the input graph, so it serves as a good place to determine what\n * attributes can influence layout.\n */\nfunction updateInputGraph(inputGraph, layoutGraph) {\n _.forEach(inputGraph.nodes(), function (v) {\n var inputLabel = inputGraph.node(v);\n var layoutLabel = layoutGraph.node(v);\n\n if (inputLabel) {\n inputLabel.x = layoutLabel.x;\n inputLabel.y = layoutLabel.y;\n\n if (layoutGraph.children(v).length) {\n inputLabel.width = layoutLabel.width;\n inputLabel.height = layoutLabel.height;\n }\n }\n });\n\n _.forEach(inputGraph.edges(), function (e) {\n var inputLabel = inputGraph.edge(e);\n var layoutLabel = layoutGraph.edge(e);\n\n inputLabel.points = layoutLabel.points;\n if (_.has(layoutLabel, 'x')) {\n inputLabel.x = layoutLabel.x;\n inputLabel.y = layoutLabel.y;\n }\n });\n\n inputGraph.graph().width = layoutGraph.graph().width;\n inputGraph.graph().height = layoutGraph.graph().height;\n}\n\nvar graphNumAttrs = ['nodesep', 'edgesep', 'ranksep', 'marginx', 'marginy'];\nvar graphDefaults = { ranksep: 50, edgesep: 20, nodesep: 50, rankdir: 'tb' };\nvar graphAttrs = ['acyclicer', 'ranker', 'rankdir', 'align'];\nvar nodeNumAttrs = ['width', 'height'];\nvar nodeDefaults = { width: 0, height: 0 };\nvar edgeNumAttrs = ['minlen', 'weight', 'width', 'height', 'labeloffset'];\nvar edgeDefaults = {\n minlen: 1,\n weight: 1,\n width: 0,\n height: 0,\n labeloffset: 10,\n labelpos: 'r',\n};\nvar edgeAttrs = ['labelpos'];\n\n/*\n * Constructs a new graph from the input graph, which can be used for layout.\n * This process copies only whitelisted attributes from the input graph to the\n * layout graph. Thus this function serves as a good place to determine what\n * attributes can influence layout.\n */\nfunction buildLayoutGraph(inputGraph) {\n var g = new Graph({ multigraph: true, compound: true });\n var graph = canonicalize(inputGraph.graph());\n\n g.setGraph(\n _.merge({}, graphDefaults, selectNumberAttrs(graph, graphNumAttrs), _.pick(graph, graphAttrs))\n );\n\n _.forEach(inputGraph.nodes(), function (v) {\n var node = canonicalize(inputGraph.node(v));\n g.setNode(v, _.defaults(selectNumberAttrs(node, nodeNumAttrs), nodeDefaults));\n g.setParent(v, inputGraph.parent(v));\n });\n\n _.forEach(inputGraph.edges(), function (e) {\n var edge = canonicalize(inputGraph.edge(e));\n g.setEdge(\n e,\n _.merge({}, edgeDefaults, selectNumberAttrs(edge, edgeNumAttrs), _.pick(edge, edgeAttrs))\n );\n });\n\n return g;\n}\n\n/*\n * This idea comes from the Gansner paper: to account for edge labels in our\n * layout we split each rank in half by doubling minlen and halving ranksep.\n * Then we can place labels at these mid-points between nodes.\n *\n * We also add some minimal padding to the width to push the label for the edge\n * away from the edge itself a bit.\n */\nfunction makeSpaceForEdgeLabels(g) {\n var graph = g.graph();\n graph.ranksep /= 2;\n _.forEach(g.edges(), function (e) {\n var edge = g.edge(e);\n edge.minlen *= 2;\n if (edge.labelpos.toLowerCase() !== 'c') {\n if (graph.rankdir === 'TB' || graph.rankdir === 'BT') {\n edge.width += edge.labeloffset;\n } else {\n edge.height += edge.labeloffset;\n }\n }\n });\n}\n\n/*\n * Creates temporary dummy nodes that capture the rank in which each edge's\n * label is going to, if it has one of non-zero width and height. We do this\n * so that we can safely remove empty ranks while preserving balance for the\n * label's position.\n */\nfunction injectEdgeLabelProxies(g) {\n _.forEach(g.edges(), function (e) {\n var edge = g.edge(e);\n if (edge.width && edge.height) {\n var v = g.node(e.v);\n var w = g.node(e.w);\n var label = { rank: (w.rank - v.rank) / 2 + v.rank, e: e };\n util.addDummyNode(g, 'edge-proxy', label, '_ep');\n }\n });\n}\n\nfunction assignRankMinMax(g) {\n var maxRank = 0;\n _.forEach(g.nodes(), function (v) {\n var node = g.node(v);\n if (node.borderTop) {\n node.minRank = g.node(node.borderTop).rank;\n node.maxRank = g.node(node.borderBottom).rank;\n // @ts-expect-error\n maxRank = _.max(maxRank, node.maxRank);\n }\n });\n g.graph().maxRank = maxRank;\n}\n\nfunction removeEdgeLabelProxies(g) {\n _.forEach(g.nodes(), function (v) {\n var node = g.node(v);\n if (node.dummy === 'edge-proxy') {\n g.edge(node.e).labelRank = node.rank;\n g.removeNode(v);\n }\n });\n}\n\nfunction translateGraph(g) {\n var minX = Number.POSITIVE_INFINITY;\n var maxX = 0;\n var minY = Number.POSITIVE_INFINITY;\n var maxY = 0;\n var graphLabel = g.graph();\n var marginX = graphLabel.marginx || 0;\n var marginY = graphLabel.marginy || 0;\n\n function getExtremes(attrs) {\n var x = attrs.x;\n var y = attrs.y;\n var w = attrs.width;\n var h = attrs.height;\n minX = Math.min(minX, x - w / 2);\n maxX = Math.max(maxX, x + w / 2);\n minY = Math.min(minY, y - h / 2);\n maxY = Math.max(maxY, y + h / 2);\n }\n\n _.forEach(g.nodes(), function (v) {\n getExtremes(g.node(v));\n });\n _.forEach(g.edges(), function (e) {\n var edge = g.edge(e);\n if (_.has(edge, 'x')) {\n getExtremes(edge);\n }\n });\n\n minX -= marginX;\n minY -= marginY;\n\n _.forEach(g.nodes(), function (v) {\n var node = g.node(v);\n node.x -= minX;\n node.y -= minY;\n });\n\n _.forEach(g.edges(), function (e) {\n var edge = g.edge(e);\n _.forEach(edge.points, function (p) {\n p.x -= minX;\n p.y -= minY;\n });\n if (_.has(edge, 'x')) {\n edge.x -= minX;\n }\n if (_.has(edge, 'y')) {\n edge.y -= minY;\n }\n });\n\n graphLabel.width = maxX - minX + marginX;\n graphLabel.height = maxY - minY + marginY;\n}\n\nfunction assignNodeIntersects(g) {\n _.forEach(g.edges(), function (e) {\n var edge = g.edge(e);\n var nodeV = g.node(e.v);\n var nodeW = g.node(e.w);\n var p1, p2;\n if (!edge.points) {\n edge.points = [];\n p1 = nodeW;\n p2 = nodeV;\n } else {\n p1 = edge.points[0];\n p2 = edge.points[edge.points.length - 1];\n }\n edge.points.unshift(util.intersectRect(nodeV, p1));\n edge.points.push(util.intersectRect(nodeW, p2));\n });\n}\n\nfunction fixupEdgeLabelCoords(g) {\n _.forEach(g.edges(), function (e) {\n var edge = g.edge(e);\n if (_.has(edge, 'x')) {\n if (edge.labelpos === 'l' || edge.labelpos === 'r') {\n edge.width -= edge.labeloffset;\n }\n switch (edge.labelpos) {\n case 'l':\n edge.x -= edge.width / 2 + edge.labeloffset;\n break;\n case 'r':\n edge.x += edge.width / 2 + edge.labeloffset;\n break;\n }\n }\n });\n}\n\nfunction reversePointsForReversedEdges(g) {\n _.forEach(g.edges(), function (e) {\n var edge = g.edge(e);\n if (edge.reversed) {\n edge.points.reverse();\n }\n });\n}\n\nfunction removeBorderNodes(g) {\n _.forEach(g.nodes(), function (v) {\n if (g.children(v).length) {\n var node = g.node(v);\n var t = g.node(node.borderTop);\n var b = g.node(node.borderBottom);\n var l = g.node(_.last(node.borderLeft));\n var r = g.node(_.last(node.borderRight));\n\n node.width = Math.abs(r.x - l.x);\n node.height = Math.abs(b.y - t.y);\n node.x = l.x + node.width / 2;\n node.y = t.y + node.height / 2;\n }\n });\n\n _.forEach(g.nodes(), function (v) {\n if (g.node(v).dummy === 'border') {\n g.removeNode(v);\n }\n });\n}\n\nfunction removeSelfEdges(g) {\n _.forEach(g.edges(), function (e) {\n if (e.v === e.w) {\n var node = g.node(e.v);\n if (!node.selfEdges) {\n node.selfEdges = [];\n }\n node.selfEdges.push({ e: e, label: g.edge(e) });\n g.removeEdge(e);\n }\n });\n}\n\nfunction insertSelfEdges(g) {\n var layers = util.buildLayerMatrix(g);\n _.forEach(layers, function (layer) {\n var orderShift = 0;\n _.forEach(layer, function (v, i) {\n var node = g.node(v);\n node.order = i + orderShift;\n _.forEach(node.selfEdges, function (selfEdge) {\n util.addDummyNode(\n g,\n 'selfedge',\n {\n width: selfEdge.label.width,\n height: selfEdge.label.height,\n rank: node.rank,\n order: i + ++orderShift,\n e: selfEdge.e,\n label: selfEdge.label,\n },\n '_se'\n );\n });\n delete node.selfEdges;\n });\n });\n}\n\nfunction positionSelfEdges(g) {\n _.forEach(g.nodes(), function (v) {\n var node = g.node(v);\n if (node.dummy === 'selfedge') {\n var selfNode = g.node(node.e.v);\n var x = selfNode.x + selfNode.width / 2;\n var y = selfNode.y;\n var dx = node.x - x;\n var dy = selfNode.height / 2;\n g.setEdge(node.e, node.label);\n g.removeNode(v);\n node.label.points = [\n { x: x + (2 * dx) / 3, y: y - dy },\n { x: x + (5 * dx) / 6, y: y - dy },\n { x: x + dx, y: y },\n { x: x + (5 * dx) / 6, y: y + dy },\n { x: x + (2 * dx) / 3, y: y + dy },\n ];\n node.label.x = node.x;\n node.label.y = node.y;\n }\n });\n}\n\nfunction selectNumberAttrs(obj, attrs) {\n return _.mapValues(_.pick(obj, attrs), Number);\n}\n\nfunction canonicalize(attrs) {\n var newAttrs = {};\n _.forEach(attrs, function (v, k) {\n newAttrs[k.toLowerCase()] = v;\n });\n return newAttrs;\n}\n"],"names":["symbolTag","isSymbol","value","isObjectLike","baseGetTag","arrayMap","array","iteratee","index","length","result","INFINITY","symbolProto","Symbol","symbolToString","baseToString","isArray","reWhitespace","trimmedEndIndex","string","reTrimStart","baseTrim","NAN","reIsBadHex","reIsBinary","reIsOctal","freeParseInt","toNumber","isObject","other","isBinary","MAX_INTEGER","toFinite","sign","toInteger","remainder","identity","objectCreate","baseCreate","object","proto","baseCreate$1","apply","func","thisArg","args","noop","copyArray","source","HOT_COUNT","HOT_SPAN","nativeNow","shortOut","count","lastCalled","stamp","remaining","constant","defineProperty","getNative","defineProperty$1","baseSetToString","baseSetToString$1","setToString","setToString$1","arrayEach","baseFindIndex","predicate","fromIndex","fromRight","baseIsNaN","strictIndexOf","baseIndexOf","arrayIncludes","MAX_SAFE_INTEGER","reIsUint","isIndex","type","baseAssignValue","key","objectProto","hasOwnProperty","assignValue","objValue","eq","copyObject","props","customizer","isNew","newValue","nativeMax","overRest","start","transform","otherArgs","baseRest","isIterateeCall","isArrayLike","createAssigner","assigner","sources","guard","baseTimes","arrayLikeKeys","inherited","isArr","isArg","isArguments","isBuff","isBuffer","isType","isTypedArray","skipIndexes","keys","baseKeys","nativeKeysIn","baseKeysIn","isProto","isPrototype","keysIn","reIsDeepProp","reIsPlainProp","isKey","MAX_MEMOIZE_SIZE","memoizeCapped","memoize","cache","rePropName","reEscapeChar","stringToPath","match","number","quote","subString","stringToPath$1","toString","castPath","toKey","baseGet","path","get","defaultValue","arrayPush","values","offset","spreadableSymbol","isFlattenable","baseFlatten","depth","isStrict","flatten","flatRest","arrayReduce","accumulator","initAccum","stackClear","ListCache","stackDelete","data","stackGet","stackHas","LARGE_ARRAY_SIZE","stackSet","pairs","Map","MapCache","Stack","entries","baseAssign","baseAssignIn","freeExports","freeModule","moduleExports","Buffer","root","allocUnsafe","cloneBuffer","buffer","isDeep","arrayFilter","resIndex","stubArray","propertyIsEnumerable","nativeGetSymbols","getSymbols","symbol","getSymbols$1","copySymbols","getSymbolsIn","getPrototype","getSymbolsIn$1","copySymbolsIn","baseGetAllKeys","keysFunc","symbolsFunc","getAllKeys","getAllKeysIn","initCloneArray","Uint8Array","Uint8Array$1","cloneArrayBuffer","arrayBuffer","cloneDataView","dataView","reFlags","cloneRegExp","regexp","symbolValueOf","cloneSymbol","cloneTypedArray","typedArray","boolTag","dateTag","mapTag","numberTag","regexpTag","setTag","stringTag","arrayBufferTag","dataViewTag","float32Tag","float64Tag","int8Tag","int16Tag","int32Tag","uint8Tag","uint8ClampedTag","uint16Tag","uint32Tag","initCloneByTag","tag","Ctor","initCloneObject","baseIsMap","getTag","nodeIsMap","nodeUtil","isMap","baseUnary","isMap$1","baseIsSet","nodeIsSet","isSet","isSet$1","CLONE_DEEP_FLAG","CLONE_FLAT_FLAG","CLONE_SYMBOLS_FLAG","argsTag","arrayTag","errorTag","funcTag","genTag","objectTag","weakMapTag","cloneableTags","baseClone","bitmask","stack","isFlat","isFull","isFunc","stacked","subValue","cloneDeep","HASH_UNDEFINED","setCacheAdd","setCacheHas","SetCache","arraySome","cacheHas","COMPARE_PARTIAL_FLAG","COMPARE_UNORDERED_FLAG","equalArrays","equalFunc","isPartial","arrLength","othLength","arrStacked","othStacked","seen","arrValue","othValue","compared","othIndex","mapToArray","map","setToArray","set","equalByTag","convert","equalObjects","objProps","objLength","othProps","objStacked","skipCtor","objCtor","othCtor","baseIsEqualDeep","objIsArr","othIsArr","objTag","othTag","objIsObj","othIsObj","isSameTag","objIsWrapped","othIsWrapped","objUnwrapped","othUnwrapped","baseIsEqual","baseIsMatch","matchData","noCustomizer","srcValue","isStrictComparable","getMatchData","matchesStrictComparable","baseMatches","baseHasIn","hasPath","hasFunc","isLength","hasIn","baseMatchesProperty","baseProperty","basePropertyDeep","property","baseIteratee","createBaseFor","iterable","baseFor","baseFor$1","baseForOwn","createBaseEach","eachFunc","collection","baseEach","baseEach$1","now","now$1","defaults","propsIndex","propsLength","defaults$1","assignMergeValue","isArrayLikeObject","safeGet","toPlainObject","baseMergeDeep","srcIndex","mergeFunc","isCommon","isTyped","isPlainObject","isFunction","baseMerge","arrayIncludesWith","comparator","last","castFunction","forEach","baseFilter","filter","createFind","findIndexFunc","findIndex","find","find$1","baseMap","forIn","baseGt","baseHas","has","baseValues","isUndefined","baseLt","mapValues","baseExtremum","current","computed","max","merge","merge$1","min","minBy","baseSet","lastIndex","nested","basePickBy","paths","baseSortBy","comparer","compareAscending","valIsDefined","valIsNull","valIsReflexive","valIsSymbol","othIsDefined","othIsNull","othIsReflexive","othIsSymbol","compareMultiple","orders","objCriteria","othCriteria","ordersLength","order","baseOrderBy","iteratees","criteria","basePick","pick","pick$1","nativeCeil","baseRange","end","step","createRange","range","range$1","baseReduce","reduce","sortBy","sortBy$1","createSet","Set","createSet$1","baseUniq","includes","outer","seenIndex","union","arrays","union$1","idCounter","uniqueId","prefix","id","baseZipObject","assignFunc","valsLength","zipObject","DEFAULT_EDGE_NAME","GRAPH_NODE","EDGE_KEY_DELIM","Graph","opts","_.has","_.constant","label","newDefault","_.isFunction","_.keys","self","_.filter","v","_.isEmpty","vs","_.each","removeEdge","e","child","parent","_.isUndefined","ancestor","children","predsV","sucsV","preds","_.union","neighbors","copy","parents","findParent","_.values","_.reduce","w","name","valueSpecified","arg0","edgeArgsToId","edgeObj","edgeArgsToObj","incrementOrInitEntry","edgeObjToId","edge","decrementOrRemoveEntry","u","inV","edges","outV","inEdges","k","isDirected","v_","w_","tmp","List","sentinel","entry","unlink","strs","curr","filterOutLinks","DEFAULT_WEIGHT_FN","greedyFAS","g","weightFn","state","buildState","results","doGreedyFAS","_.flatten","_.map","buckets","zeroIdx","sinks","removeNode","i","collectPredecessors","_.forEach","weight","uEntry","assignBucket","wEntry","fasGraph","maxIn","maxOut","prevWeight","edgeWeight","_.range","run","fas","dfsFAS","_.uniqueId","visited","dfs","undo","forwardName","addDummyNode","attrs","simplify","simplified","simpleLabel","asNonCompoundGraph","intersectRect","rect","point","x","y","dx","dy","h","sx","sy","buildLayerMatrix","layering","maxRank","node","rank","normalizeRanks","_.min","removeEmptyRanks","layers","delta","nodeRankFactor","addBorderNode","_.max","partition","fn","time","_.now","notime","addBorderSegments","prop","sg","sgNode","prev","util.addDummyNode","adjust","rankDir","swapWidthHeight","reverseY","swapXY","swapWidthHeightOne","reverseYOne","swapXYOne","normalizeEdge","vRank","wRank","edgeLabel","labelRank","dummy","origLabel","longestPath","slack","feasibleTree","t","size","tightTree","findMinSlackEdge","shiftRanks","edgeV","_.minBy","CycleException","_.isArray","navigation","acc","doDfs","postorder","preorder","networkSimplex","initLowLimValues","initCutValues","calcCutValue","leaveEdge","enterEdge","exchangeEdges","f","alg.postorder","assignCutValue","childLab","childIsTail","graphEdge","cutValue","isOutEdge","pointsToHead","otherWeight","isTreeEdge","otherCutValue","tree","dfsAssignLowLim","nextLim","low","_.find","vLabel","wLabel","tailLabel","flip","candidates","isDescendant","updateRanks","alg.preorder","flipped","rootLabel","networkSimplexRanker","tightTreeRanker","longestPathRanker","depths","treeDepths","height","nodeSep","sumWeights","top","util.addBorderNode","bottom","childNode","childTop","childBottom","thisWeight","minlen","cleanup","graphLabel","addSubgraphConstraints","cg","rootPrev","prevChild","buildLayerGraph","relationship","createRootNode","crossCount","cc","twoLayerCrossCount","northLayer","southLayer","southPos","_.zipObject","southEntries","_.sortBy","firstIndex","treeSize","weightSum","initOrder","simpleNodes","orderedVs","barycenter","movable","nodeU","resolveConflicts","mappedEntries","entryV","entryW","sourceSet","doResolveConflicts","handleIn","vEntry","mergeEntries","handleOut","_.pick","target","sum","sort","biasRight","parts","util.partition","sortable","unsortable","vsIndex","compareWithBias","consumeUnsortable","_.last","bias","sortSubgraph","bl","br","subgraphs","barycenters","subgraphResult","mergeBarycenters","expandSubgraphs","blPred","brPred","util.maxRank","downLayerGraphs","buildLayerGraphs","upLayerGraphs","assignOrder","bestCC","best","lastBest","sweepLayerGraphs","util.buildLayerMatrix","_.cloneDeep","ranks","layerGraphs","lg","sorted","layer","parentDummyChains","postorderNums","pathData","findPath","lca","pathIdx","pathV","ascending","vPath","wPath","lim","findType1Conflicts","conflicts","visitLayer","prevLayer","k0","scanPos","prevLayerLength","lastNode","findOtherInnerSegmentNode","k1","scanNode","uLabel","uPos","addConflict","findType2Conflicts","scan","south","southEnd","prevNorthBorder","nextNorthBorder","uNode","north","prevNorthPos","nextNorthPos","southLookahead","predecessors","conflictsV","hasConflict","verticalAlignment","neighborFn","align","pos","prevIdx","ws","mp","il","horizontalCompaction","reverseSep","xs","blockG","buildBlockGraph","borderType","iterate","setXsFunc","nextNodesFunc","elem","pass1","pass2","blockGraph","sepFn","sep","vRoot","uRoot","prevMax","findSmallestWidthAlignment","xss","_.forIn","halfWidth","width","alignCoordinates","alignTo","alignToVals","alignToMin","alignToMax","vert","horiz","alignment","xsVals","_.mapValues","balance","ignore","positionX","_.merge","adjustedLayering","inner","smallestWidth","edgeSep","position","util.asNonCompoundGraph","positionY","rankSep","prevY","maxHeight","layout","util.time","util.notime","layoutGraph","buildLayoutGraph","runLayout","updateInputGraph","makeSpaceForEdgeLabels","removeSelfEdges","acyclic.run","nestingGraph.run","injectEdgeLabelProxies","util.removeEmptyRanks","nestingGraph.cleanup","util.normalizeRanks","assignRankMinMax","removeEdgeLabelProxies","normalize.run","insertSelfEdges","coordinateSystem.adjust","positionSelfEdges","removeBorderNodes","normalize.undo","fixupEdgeLabelCoords","coordinateSystem.undo","translateGraph","assignNodeIntersects","reversePointsForReversedEdges","acyclic.undo","inputGraph","inputLabel","layoutLabel","graphNumAttrs","graphDefaults","graphAttrs","nodeNumAttrs","nodeDefaults","edgeNumAttrs","edgeDefaults","edgeAttrs","graph","canonicalize","selectNumberAttrs","_.defaults","minX","maxX","minY","maxY","marginX","marginY","getExtremes","p","nodeV","nodeW","p1","p2","util.intersectRect","b","l","r","orderShift","selfEdge","selfNode","obj","newAttrs"],"mappings":";;;AAIA,IAAIA,KAAY;AAmBhB,SAASC,EAASC,GAAO;AACvB,SAAO,OAAOA,KAAS,YACpBC,EAAaD,CAAK,KAAKE,GAAWF,CAAK,KAAKF;AACjD;ACjBA,SAASK,EAASC,GAAOC,GAAU;AAKjC,WAJIC,IAAQ,IACRC,IAASH,KAAS,OAAO,IAAIA,EAAM,QACnCI,IAAS,MAAMD,CAAM,GAElB,EAAED,IAAQC;AACf,IAAAC,EAAOF,CAAK,IAAID,EAASD,EAAME,CAAK,GAAGA,GAAOF,CAAK;AAErD,SAAOI;AACT;ACZA,IAAIC,KAAW,IAAI,GAGfC,KAAcC,IAASA,EAAO,YAAY,QAC1CC,KAAiBF,KAAcA,GAAY,WAAW;AAU1D,SAASG,GAAab,GAAO;AAE3B,MAAI,OAAOA,KAAS;AAClB,WAAOA;AAET,MAAIc,EAAQd,CAAK;AAEf,WAAOG,EAASH,GAAOa,EAAY,IAAI;AAEzC,MAAId,EAASC,CAAK;AAChB,WAAOY,KAAiBA,GAAe,KAAKZ,CAAK,IAAI;AAEvD,MAAIQ,IAAUR,IAAQ;AACtB,SAAQQ,KAAU,OAAQ,IAAIR,KAAU,CAACS,KAAY,OAAOD;AAC9D;ACjCA,IAAIO,KAAe;AAUnB,SAASC,GAAgBC,GAAQ;AAG/B,WAFIX,IAAQW,EAAO,QAE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