Enhance some features of the Self-managed Gitlab

Enhance some features of the Self-managed Gitlab, such as the CI/CD settings page, the merge request create/edit page etc.

  1. // ==UserScript==
  2. // @name Enhance some features of the Self-managed Gitlab
  3. // @name:zh-CN 强化自托管 Gitlab 能力
  4. // @namespace https://greasyfork.org/users/1133279
  5. // @description Enhance some features of the Self-managed Gitlab, such as the CI/CD settings page, the merge request create/edit page etc.
  6. // @description:zh-CN 强化自托管 Gitlab 的一些功能,如 CI/CD 设置页面、合并请求创建/编辑页面等。
  7. // @icon data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/PjwhRE9DVFlQRSBzdmcgIFBVQkxJQyAnLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4nICAnaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkJz48c3ZnIGhlaWdodD0iNTEycHgiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDUxMiA1MTI7IiB2ZXJzaW9uPSIxLjEiIHZpZXdCb3g9IjAgMCA1MTIgNTEyIiB3aWR0aD0iNTEycHgiIHhtbDpzcGFjZT0icHJlc2VydmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPjxnIGlkPSJfeDMxXzQ0LWdpdGxhYiI+PGc+PGcgaWQ9IlhNTElEXzZfIj48Zz48Zz48cGF0aCBkPSJNNTIuNzUyLDIwNS41MDFsMjAzLjE4LDI2NC4wN2wtMjIyLjctMTY1LjI5Yy02LjExLTQuNTktOC43Mi0xMi41OC02LjM4LTE5Ljc3MWwyNS44Ny03OS4wNSAgICAgICBMNTIuNzUyLDIwNS41MDF6IiBzdHlsZT0iZmlsbDojRkNBMzI2OyIvPjwvZz48Zz48cG9seWdvbiBwb2ludHM9IjE3MS4zMDIsMjA1LjQ2MSAyNTYuMDEyLDQ2OS41NDEgMjU1LjkzMiw0NjkuNTcxIDUyLjc1MiwyMDUuNTAxIDUyLjgxMiwyMDUuNDYxICAgICAgICAgICAgICIgc3R5bGU9ImZpbGw6I0ZDNkQyNjsiLz48L2c+PGc+PHBvbHlnb24gcG9pbnRzPSIzNDAuNzMxLDIwNS40NjEgMjU2LjAyMSw0NjkuNTcxIDI1Ni4wMTIsNDY5LjU0MSAxNzEuMzAyLDIwNS40NjEgMTcxLjM5MiwyMDUuNDYxICAgICAgICAzNDAuNjQyLDIwNS40NjEgICAgICAiIHN0eWxlPSJmaWxsOiNFMjQzMjk7Ii8+PC9nPjxnPjxwb2x5Z29uIHBvaW50cz0iNDU5LjI5MiwyMDUuNTAxIDI1Ni4wMjEsNDY5LjU3MSAzNDAuNzMxLDIwNS40NjEgNDU5LjIzMSwyMDUuNDYxICAgICAgIiBzdHlsZT0iZmlsbDojRkM2RDI2OyIvPjwvZz48Zz48cGF0aCBkPSJNNDg1LjE5MSwyODQuNTExYzIuMjQsNy4xOS0wLjI3LDE1LjE4MS02LjQ3LDE5Ljc3MWwtMjIyLjcsMTY1LjI5bDIwMy4yNzEtMjY0LjA3bDAuMDI5LTAuMDQgICAgICAgTDQ4NS4xOTEsMjg0LjUxMXoiIHN0eWxlPSJmaWxsOiNGQ0EzMjY7Ii8+PC9nPjxnPjxwYXRoIGQ9Ik00MDguNDcyLDQ4LjQyMWw1MC43NiwxNTcuMDRoLTExOC41aC0wLjA5bDUwLjg1LTE1Ny4wNCAgICAgICBDMzk0LjM2MSw0MC40MzEsNDA1LjY4Miw0MC40MzEsNDA4LjQ3Miw0OC40MjF6IiBzdHlsZT0iZmlsbDojRTI0MzI5OyIvPjwvZz48Zz48cGF0aCBkPSJNMTcxLjM5MiwyMDUuNDYxaC0wLjA5SDUyLjgxMmw1MC43Ni0xNTcuMDRjMi44Ny03Ljk5LDE0LjE5LTcuOTksMTYuOTgsMCAgICAgICBDMTIwLjU1Miw0OC40MjEsMTcxLjMwMiwyMDUuNDYxLDE3MS4zOTIsMjA1LjQ2MXoiIHN0eWxlPSJmaWxsOiNFMjQzMjk7Ii8+PC9nPjwvZz48L2c+PC9nPjwvZz48ZyBpZD0iTGF5ZXJfMSIvPjwvc3ZnPg==
  8. // @version 10
  9. // @author Arylo
  10. // @include /^https:\/\/(git(lab)?|code)\.[^/]+\/.*\/-\/settings\/ci_cd$/
  11. // @include /^https:\/\/(git(lab)?|code)\.[^/]+\/.*\/-\/merge_requests\/new\b/
  12. // @include /^https:\/\/(git(lab)?|code)\.[^/]+\/.*\/-\/merge_requests\/\d+/edit\b/
  13. // @include /^https:\/\/(git(lab)?|code)\.[^/]+\/dashboard\/merge_requests\b/
  14. // @license MIT
  15. // @homepage https://greasyfork.org/zh-CN/scripts/519026
  16. // @supportURL https://greasyfork.org/zh-CN/scripts/519026/feedback
  17. // @run-at document-end
  18. // @grant GM_addStyle
  19. // @grant GM_setClipboard
  20. // ==/UserScript==
  21. "use strict";
  22. (() => {
  23. var __create = Object.create;
  24. var __defProp = Object.defineProperty;
  25. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  26. var __getOwnPropNames = Object.getOwnPropertyNames;
  27. var __getProtoOf = Object.getPrototypeOf;
  28. var __hasOwnProp = Object.prototype.hasOwnProperty;
  29. var __esm = (fn, res) => function __init() {
  30. return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
  31. };
  32. var __commonJS = (cb, mod) => function __require() {
  33. return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
  34. };
  35. var __copyProps = (to, from, except, desc) => {
  36. if (from && typeof from === "object" || typeof from === "function") {
  37. for (let key of __getOwnPropNames(from))
  38. if (!__hasOwnProp.call(to, key) && key !== except)
  39. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  40. }
  41. return to;
  42. };
  43. var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
  44. // If the importer is in node compatibility mode or this is not an ESM
  45. // file that has been converted to a CommonJS file using a Babel-
  46. // compatible transform (i.e. "__esModule" has not been set), then set
  47. // "default" to the CommonJS "module.exports" for node compatibility.
  48. isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
  49. mod
  50. ));
  51.  
  52. // src/monkey/polyfill/GM.ts
  53. function getGMWindow() {
  54. return thisGlobal;
  55. }
  56. var thisGlobal;
  57. var init_GM = __esm({
  58. "src/monkey/polyfill/GM.ts"() {
  59. "use strict";
  60. init_GM_addStyle();
  61. thisGlobal = window;
  62. if (typeof thisGlobal.GM === "undefined") {
  63. thisGlobal.GM = {};
  64. }
  65. }
  66. });
  67.  
  68. // src/monkey/polyfill/GM_addStyle.ts
  69. var w;
  70. var init_GM_addStyle = __esm({
  71. "src/monkey/polyfill/GM_addStyle.ts"() {
  72. "use strict";
  73. init_GM();
  74. w = getGMWindow();
  75. if (typeof w.GM_addStyle === "undefined") {
  76. w.GM_addStyle = function GM_addStyle2(cssContent) {
  77. const head = document.getElementsByTagName("head")[0];
  78. if (head) {
  79. const styleElement = document.createElement("style");
  80. styleElement.setAttribute("type", "text/css");
  81. styleElement.textContent = cssContent;
  82. head.appendChild(styleElement);
  83. return styleElement;
  84. }
  85. return null;
  86. };
  87. }
  88. if (typeof w.GM.addStyle === "undefined") {
  89. w.GM.addStyle = GM_addStyle;
  90. }
  91. }
  92. });
  93.  
  94. // node_modules/lodash/lodash.js
  95. var require_lodash = __commonJS({
  96. "node_modules/lodash/lodash.js"(exports, module) {
  97. init_GM_addStyle();
  98. (function() {
  99. var undefined;
  100. var VERSION = "4.17.21";
  101. var LARGE_ARRAY_SIZE = 200;
  102. var CORE_ERROR_TEXT = "Unsupported core-js use. Try https://npms.io/search?q=ponyfill.", FUNC_ERROR_TEXT = "Expected a function", INVALID_TEMPL_VAR_ERROR_TEXT = "Invalid `variable` option passed into `_.template`";
  103. var HASH_UNDEFINED = "__lodash_hash_undefined__";
  104. var MAX_MEMOIZE_SIZE = 500;
  105. var PLACEHOLDER = "__lodash_placeholder__";
  106. var CLONE_DEEP_FLAG = 1, CLONE_FLAT_FLAG = 2, CLONE_SYMBOLS_FLAG = 4;
  107. var COMPARE_PARTIAL_FLAG = 1, COMPARE_UNORDERED_FLAG = 2;
  108. var WRAP_BIND_FLAG = 1, WRAP_BIND_KEY_FLAG = 2, WRAP_CURRY_BOUND_FLAG = 4, WRAP_CURRY_FLAG = 8, WRAP_CURRY_RIGHT_FLAG = 16, WRAP_PARTIAL_FLAG = 32, WRAP_PARTIAL_RIGHT_FLAG = 64, WRAP_ARY_FLAG = 128, WRAP_REARG_FLAG = 256, WRAP_FLIP_FLAG = 512;
  109. var DEFAULT_TRUNC_LENGTH = 30, DEFAULT_TRUNC_OMISSION = "...";
  110. var HOT_COUNT = 800, HOT_SPAN = 16;
  111. var LAZY_FILTER_FLAG = 1, LAZY_MAP_FLAG = 2, LAZY_WHILE_FLAG = 3;
  112. var INFINITY = 1 / 0, MAX_SAFE_INTEGER = 9007199254740991, MAX_INTEGER = 17976931348623157e292, NAN = 0 / 0;
  113. var MAX_ARRAY_LENGTH = 4294967295, MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1, HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
  114. var wrapFlags = [
  115. ["ary", WRAP_ARY_FLAG],
  116. ["bind", WRAP_BIND_FLAG],
  117. ["bindKey", WRAP_BIND_KEY_FLAG],
  118. ["curry", WRAP_CURRY_FLAG],
  119. ["curryRight", WRAP_CURRY_RIGHT_FLAG],
  120. ["flip", WRAP_FLIP_FLAG],
  121. ["partial", WRAP_PARTIAL_FLAG],
  122. ["partialRight", WRAP_PARTIAL_RIGHT_FLAG],
  123. ["rearg", WRAP_REARG_FLAG]
  124. ];
  125. var argsTag = "[object Arguments]", arrayTag = "[object Array]", asyncTag = "[object AsyncFunction]", boolTag = "[object Boolean]", dateTag = "[object Date]", domExcTag = "[object DOMException]", errorTag = "[object Error]", funcTag = "[object Function]", genTag = "[object GeneratorFunction]", mapTag = "[object Map]", numberTag = "[object Number]", nullTag = "[object Null]", objectTag = "[object Object]", promiseTag = "[object Promise]", proxyTag = "[object Proxy]", regexpTag = "[object RegExp]", setTag = "[object Set]", stringTag = "[object String]", symbolTag = "[object Symbol]", undefinedTag = "[object Undefined]", weakMapTag = "[object WeakMap]", weakSetTag = "[object WeakSet]";
  126. var arrayBufferTag = "[object ArrayBuffer]", dataViewTag = "[object DataView]", float32Tag = "[object Float32Array]", float64Tag = "[object Float64Array]", int8Tag = "[object Int8Array]", int16Tag = "[object Int16Array]", int32Tag = "[object Int32Array]", uint8Tag = "[object Uint8Array]", uint8ClampedTag = "[object Uint8ClampedArray]", uint16Tag = "[object Uint16Array]", uint32Tag = "[object Uint32Array]";
  127. var reEmptyStringLeading = /\b__p \+= '';/g, reEmptyStringMiddle = /\b(__p \+=) '' \+/g, reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
  128. var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g, reUnescapedHtml = /[&<>"']/g, reHasEscapedHtml = RegExp(reEscapedHtml.source), reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
  129. var reEscape = /<%-([\s\S]+?)%>/g, reEvaluate = /<%([\s\S]+?)%>/g, reInterpolate = /<%=([\s\S]+?)%>/g;
  130. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, reIsPlainProp = /^\w*$/, rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  131. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g, reHasRegExpChar = RegExp(reRegExpChar.source);
  132. var reTrimStart = /^\s+/;
  133. var reWhitespace = /\s/;
  134. var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/, reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/, reSplitDetails = /,? & /;
  135. var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
  136. var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/;
  137. var reEscapeChar = /\\(\\)?/g;
  138. var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
  139. var reFlags = /\w*$/;
  140. var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
  141. var reIsBinary = /^0b[01]+$/i;
  142. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  143. var reIsOctal = /^0o[0-7]+$/i;
  144. var reIsUint = /^(?:0|[1-9]\d*)$/;
  145. var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
  146. var reNoMatch = /($^)/;
  147. var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
  148. var rsAstralRange = "\\ud800-\\udfff", rsComboMarksRange = "\\u0300-\\u036f", reComboHalfMarksRange = "\\ufe20-\\ufe2f", rsComboSymbolsRange = "\\u20d0-\\u20ff", rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange, rsDingbatRange = "\\u2700-\\u27bf", rsLowerRange = "a-z\\xdf-\\xf6\\xf8-\\xff", rsMathOpRange = "\\xac\\xb1\\xd7\\xf7", rsNonCharRange = "\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf", rsPunctuationRange = "\\u2000-\\u206f", rsSpaceRange = " \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000", rsUpperRange = "A-Z\\xc0-\\xd6\\xd8-\\xde", rsVarRange = "\\ufe0e\\ufe0f", rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
  149. var rsApos = "['\u2019]", rsAstral = "[" + rsAstralRange + "]", rsBreak = "[" + rsBreakRange + "]", rsCombo = "[" + rsComboRange + "]", rsDigits = "\\d+", rsDingbat = "[" + rsDingbatRange + "]", rsLower = "[" + rsLowerRange + "]", rsMisc = "[^" + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + "]", rsFitz = "\\ud83c[\\udffb-\\udfff]", rsModifier = "(?:" + rsCombo + "|" + rsFitz + ")", rsNonAstral = "[^" + rsAstralRange + "]", rsRegional = "(?:\\ud83c[\\udde6-\\uddff]){2}", rsSurrPair = "[\\ud800-\\udbff][\\udc00-\\udfff]", rsUpper = "[" + rsUpperRange + "]", rsZWJ = "\\u200d";
  150. var rsMiscLower = "(?:" + rsLower + "|" + rsMisc + ")", rsMiscUpper = "(?:" + rsUpper + "|" + rsMisc + ")", rsOptContrLower = "(?:" + rsApos + "(?:d|ll|m|re|s|t|ve))?", rsOptContrUpper = "(?:" + rsApos + "(?:D|LL|M|RE|S|T|VE))?", reOptMod = rsModifier + "?", rsOptVar = "[" + rsVarRange + "]?", rsOptJoin = "(?:" + rsZWJ + "(?:" + [rsNonAstral, rsRegional, rsSurrPair].join("|") + ")" + rsOptVar + reOptMod + ")*", rsOrdLower = "\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])", rsOrdUpper = "\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])", rsSeq = rsOptVar + reOptMod + rsOptJoin, rsEmoji = "(?:" + [rsDingbat, rsRegional, rsSurrPair].join("|") + ")" + rsSeq, rsSymbol = "(?:" + [rsNonAstral + rsCombo + "?", rsCombo, rsRegional, rsSurrPair, rsAstral].join("|") + ")";
  151. var reApos = RegExp(rsApos, "g");
  152. var reComboMark = RegExp(rsCombo, "g");
  153. var reUnicode = RegExp(rsFitz + "(?=" + rsFitz + ")|" + rsSymbol + rsSeq, "g");
  154. var reUnicodeWord = RegExp([
  155. rsUpper + "?" + rsLower + "+" + rsOptContrLower + "(?=" + [rsBreak, rsUpper, "$"].join("|") + ")",
  156. rsMiscUpper + "+" + rsOptContrUpper + "(?=" + [rsBreak, rsUpper + rsMiscLower, "$"].join("|") + ")",
  157. rsUpper + "?" + rsMiscLower + "+" + rsOptContrLower,
  158. rsUpper + "+" + rsOptContrUpper,
  159. rsOrdUpper,
  160. rsOrdLower,
  161. rsDigits,
  162. rsEmoji
  163. ].join("|"), "g");
  164. var reHasUnicode = RegExp("[" + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + "]");
  165. var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;
  166. var contextProps = [
  167. "Array",
  168. "Buffer",
  169. "DataView",
  170. "Date",
  171. "Error",
  172. "Float32Array",
  173. "Float64Array",
  174. "Function",
  175. "Int8Array",
  176. "Int16Array",
  177. "Int32Array",
  178. "Map",
  179. "Math",
  180. "Object",
  181. "Promise",
  182. "RegExp",
  183. "Set",
  184. "String",
  185. "Symbol",
  186. "TypeError",
  187. "Uint8Array",
  188. "Uint8ClampedArray",
  189. "Uint16Array",
  190. "Uint32Array",
  191. "WeakMap",
  192. "_",
  193. "clearTimeout",
  194. "isFinite",
  195. "parseInt",
  196. "setTimeout"
  197. ];
  198. var templateCounter = -1;
  199. var typedArrayTags = {};
  200. typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true;
  201. typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;
  202. var cloneableTags = {};
  203. cloneableTags[argsTag] = cloneableTags[arrayTag] = cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = cloneableTags[boolTag] = cloneableTags[dateTag] = cloneableTags[float32Tag] = cloneableTags[float64Tag] = cloneableTags[int8Tag] = cloneableTags[int16Tag] = cloneableTags[int32Tag] = cloneableTags[mapTag] = cloneableTags[numberTag] = cloneableTags[objectTag] = cloneableTags[regexpTag] = cloneableTags[setTag] = cloneableTags[stringTag] = cloneableTags[symbolTag] = cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
  204. cloneableTags[errorTag] = cloneableTags[funcTag] = cloneableTags[weakMapTag] = false;
  205. var deburredLetters = {
  206. // Latin-1 Supplement block.
  207. "\xC0": "A",
  208. "\xC1": "A",
  209. "\xC2": "A",
  210. "\xC3": "A",
  211. "\xC4": "A",
  212. "\xC5": "A",
  213. "\xE0": "a",
  214. "\xE1": "a",
  215. "\xE2": "a",
  216. "\xE3": "a",
  217. "\xE4": "a",
  218. "\xE5": "a",
  219. "\xC7": "C",
  220. "\xE7": "c",
  221. "\xD0": "D",
  222. "\xF0": "d",
  223. "\xC8": "E",
  224. "\xC9": "E",
  225. "\xCA": "E",
  226. "\xCB": "E",
  227. "\xE8": "e",
  228. "\xE9": "e",
  229. "\xEA": "e",
  230. "\xEB": "e",
  231. "\xCC": "I",
  232. "\xCD": "I",
  233. "\xCE": "I",
  234. "\xCF": "I",
  235. "\xEC": "i",
  236. "\xED": "i",
  237. "\xEE": "i",
  238. "\xEF": "i",
  239. "\xD1": "N",
  240. "\xF1": "n",
  241. "\xD2": "O",
  242. "\xD3": "O",
  243. "\xD4": "O",
  244. "\xD5": "O",
  245. "\xD6": "O",
  246. "\xD8": "O",
  247. "\xF2": "o",
  248. "\xF3": "o",
  249. "\xF4": "o",
  250. "\xF5": "o",
  251. "\xF6": "o",
  252. "\xF8": "o",
  253. "\xD9": "U",
  254. "\xDA": "U",
  255. "\xDB": "U",
  256. "\xDC": "U",
  257. "\xF9": "u",
  258. "\xFA": "u",
  259. "\xFB": "u",
  260. "\xFC": "u",
  261. "\xDD": "Y",
  262. "\xFD": "y",
  263. "\xFF": "y",
  264. "\xC6": "Ae",
  265. "\xE6": "ae",
  266. "\xDE": "Th",
  267. "\xFE": "th",
  268. "\xDF": "ss",
  269. // Latin Extended-A block.
  270. "\u0100": "A",
  271. "\u0102": "A",
  272. "\u0104": "A",
  273. "\u0101": "a",
  274. "\u0103": "a",
  275. "\u0105": "a",
  276. "\u0106": "C",
  277. "\u0108": "C",
  278. "\u010A": "C",
  279. "\u010C": "C",
  280. "\u0107": "c",
  281. "\u0109": "c",
  282. "\u010B": "c",
  283. "\u010D": "c",
  284. "\u010E": "D",
  285. "\u0110": "D",
  286. "\u010F": "d",
  287. "\u0111": "d",
  288. "\u0112": "E",
  289. "\u0114": "E",
  290. "\u0116": "E",
  291. "\u0118": "E",
  292. "\u011A": "E",
  293. "\u0113": "e",
  294. "\u0115": "e",
  295. "\u0117": "e",
  296. "\u0119": "e",
  297. "\u011B": "e",
  298. "\u011C": "G",
  299. "\u011E": "G",
  300. "\u0120": "G",
  301. "\u0122": "G",
  302. "\u011D": "g",
  303. "\u011F": "g",
  304. "\u0121": "g",
  305. "\u0123": "g",
  306. "\u0124": "H",
  307. "\u0126": "H",
  308. "\u0125": "h",
  309. "\u0127": "h",
  310. "\u0128": "I",
  311. "\u012A": "I",
  312. "\u012C": "I",
  313. "\u012E": "I",
  314. "\u0130": "I",
  315. "\u0129": "i",
  316. "\u012B": "i",
  317. "\u012D": "i",
  318. "\u012F": "i",
  319. "\u0131": "i",
  320. "\u0134": "J",
  321. "\u0135": "j",
  322. "\u0136": "K",
  323. "\u0137": "k",
  324. "\u0138": "k",
  325. "\u0139": "L",
  326. "\u013B": "L",
  327. "\u013D": "L",
  328. "\u013F": "L",
  329. "\u0141": "L",
  330. "\u013A": "l",
  331. "\u013C": "l",
  332. "\u013E": "l",
  333. "\u0140": "l",
  334. "\u0142": "l",
  335. "\u0143": "N",
  336. "\u0145": "N",
  337. "\u0147": "N",
  338. "\u014A": "N",
  339. "\u0144": "n",
  340. "\u0146": "n",
  341. "\u0148": "n",
  342. "\u014B": "n",
  343. "\u014C": "O",
  344. "\u014E": "O",
  345. "\u0150": "O",
  346. "\u014D": "o",
  347. "\u014F": "o",
  348. "\u0151": "o",
  349. "\u0154": "R",
  350. "\u0156": "R",
  351. "\u0158": "R",
  352. "\u0155": "r",
  353. "\u0157": "r",
  354. "\u0159": "r",
  355. "\u015A": "S",
  356. "\u015C": "S",
  357. "\u015E": "S",
  358. "\u0160": "S",
  359. "\u015B": "s",
  360. "\u015D": "s",
  361. "\u015F": "s",
  362. "\u0161": "s",
  363. "\u0162": "T",
  364. "\u0164": "T",
  365. "\u0166": "T",
  366. "\u0163": "t",
  367. "\u0165": "t",
  368. "\u0167": "t",
  369. "\u0168": "U",
  370. "\u016A": "U",
  371. "\u016C": "U",
  372. "\u016E": "U",
  373. "\u0170": "U",
  374. "\u0172": "U",
  375. "\u0169": "u",
  376. "\u016B": "u",
  377. "\u016D": "u",
  378. "\u016F": "u",
  379. "\u0171": "u",
  380. "\u0173": "u",
  381. "\u0174": "W",
  382. "\u0175": "w",
  383. "\u0176": "Y",
  384. "\u0177": "y",
  385. "\u0178": "Y",
  386. "\u0179": "Z",
  387. "\u017B": "Z",
  388. "\u017D": "Z",
  389. "\u017A": "z",
  390. "\u017C": "z",
  391. "\u017E": "z",
  392. "\u0132": "IJ",
  393. "\u0133": "ij",
  394. "\u0152": "Oe",
  395. "\u0153": "oe",
  396. "\u0149": "'n",
  397. "\u017F": "s"
  398. };
  399. var htmlEscapes = {
  400. "&": "&amp;",
  401. "<": "&lt;",
  402. ">": "&gt;",
  403. '"': "&quot;",
  404. "'": "&#39;"
  405. };
  406. var htmlUnescapes = {
  407. "&amp;": "&",
  408. "&lt;": "<",
  409. "&gt;": ">",
  410. "&quot;": '"',
  411. "&#39;": "'"
  412. };
  413. var stringEscapes = {
  414. "\\": "\\",
  415. "'": "'",
  416. "\n": "n",
  417. "\r": "r",
  418. "\u2028": "u2028",
  419. "\u2029": "u2029"
  420. };
  421. var freeParseFloat = parseFloat, freeParseInt = parseInt;
  422. var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
  423. var freeSelf = typeof self == "object" && self && self.Object === Object && self;
  424. var root = freeGlobal || freeSelf || Function("return this")();
  425. var freeExports = typeof exports == "object" && exports && !exports.nodeType && exports;
  426. var freeModule = freeExports && typeof module == "object" && module && !module.nodeType && module;
  427. var moduleExports = freeModule && freeModule.exports === freeExports;
  428. var freeProcess = moduleExports && freeGlobal.process;
  429. var nodeUtil = function() {
  430. try {
  431. var types = freeModule && freeModule.require && freeModule.require("util").types;
  432. if (types) {
  433. return types;
  434. }
  435. return freeProcess && freeProcess.binding && freeProcess.binding("util");
  436. } catch (e) {
  437. }
  438. }();
  439. var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer, nodeIsDate = nodeUtil && nodeUtil.isDate, nodeIsMap = nodeUtil && nodeUtil.isMap, nodeIsRegExp = nodeUtil && nodeUtil.isRegExp, nodeIsSet = nodeUtil && nodeUtil.isSet, nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
  440. function apply(func, thisArg, args) {
  441. switch (args.length) {
  442. case 0:
  443. return func.call(thisArg);
  444. case 1:
  445. return func.call(thisArg, args[0]);
  446. case 2:
  447. return func.call(thisArg, args[0], args[1]);
  448. case 3:
  449. return func.call(thisArg, args[0], args[1], args[2]);
  450. }
  451. return func.apply(thisArg, args);
  452. }
  453. function arrayAggregator(array, setter, iteratee, accumulator) {
  454. var index = -1, length = array == null ? 0 : array.length;
  455. while (++index < length) {
  456. var value = array[index];
  457. setter(accumulator, value, iteratee(value), array);
  458. }
  459. return accumulator;
  460. }
  461. function arrayEach(array, iteratee) {
  462. var index = -1, length = array == null ? 0 : array.length;
  463. while (++index < length) {
  464. if (iteratee(array[index], index, array) === false) {
  465. break;
  466. }
  467. }
  468. return array;
  469. }
  470. function arrayEachRight(array, iteratee) {
  471. var length = array == null ? 0 : array.length;
  472. while (length--) {
  473. if (iteratee(array[length], length, array) === false) {
  474. break;
  475. }
  476. }
  477. return array;
  478. }
  479. function arrayEvery(array, predicate) {
  480. var index = -1, length = array == null ? 0 : array.length;
  481. while (++index < length) {
  482. if (!predicate(array[index], index, array)) {
  483. return false;
  484. }
  485. }
  486. return true;
  487. }
  488. function arrayFilter(array, predicate) {
  489. var index = -1, length = array == null ? 0 : array.length, resIndex = 0, result = [];
  490. while (++index < length) {
  491. var value = array[index];
  492. if (predicate(value, index, array)) {
  493. result[resIndex++] = value;
  494. }
  495. }
  496. return result;
  497. }
  498. function arrayIncludes(array, value) {
  499. var length = array == null ? 0 : array.length;
  500. return !!length && baseIndexOf(array, value, 0) > -1;
  501. }
  502. function arrayIncludesWith(array, value, comparator) {
  503. var index = -1, length = array == null ? 0 : array.length;
  504. while (++index < length) {
  505. if (comparator(value, array[index])) {
  506. return true;
  507. }
  508. }
  509. return false;
  510. }
  511. function arrayMap(array, iteratee) {
  512. var index = -1, length = array == null ? 0 : array.length, result = Array(length);
  513. while (++index < length) {
  514. result[index] = iteratee(array[index], index, array);
  515. }
  516. return result;
  517. }
  518. function arrayPush(array, values) {
  519. var index = -1, length = values.length, offset = array.length;
  520. while (++index < length) {
  521. array[offset + index] = values[index];
  522. }
  523. return array;
  524. }
  525. function arrayReduce(array, iteratee, accumulator, initAccum) {
  526. var index = -1, length = array == null ? 0 : array.length;
  527. if (initAccum && length) {
  528. accumulator = array[++index];
  529. }
  530. while (++index < length) {
  531. accumulator = iteratee(accumulator, array[index], index, array);
  532. }
  533. return accumulator;
  534. }
  535. function arrayReduceRight(array, iteratee, accumulator, initAccum) {
  536. var length = array == null ? 0 : array.length;
  537. if (initAccum && length) {
  538. accumulator = array[--length];
  539. }
  540. while (length--) {
  541. accumulator = iteratee(accumulator, array[length], length, array);
  542. }
  543. return accumulator;
  544. }
  545. function arraySome(array, predicate) {
  546. var index = -1, length = array == null ? 0 : array.length;
  547. while (++index < length) {
  548. if (predicate(array[index], index, array)) {
  549. return true;
  550. }
  551. }
  552. return false;
  553. }
  554. var asciiSize = baseProperty("length");
  555. function asciiToArray(string) {
  556. return string.split("");
  557. }
  558. function asciiWords(string) {
  559. return string.match(reAsciiWord) || [];
  560. }
  561. function baseFindKey(collection, predicate, eachFunc) {
  562. var result;
  563. eachFunc(collection, function(value, key, collection2) {
  564. if (predicate(value, key, collection2)) {
  565. result = key;
  566. return false;
  567. }
  568. });
  569. return result;
  570. }
  571. function baseFindIndex(array, predicate, fromIndex, fromRight) {
  572. var length = array.length, index = fromIndex + (fromRight ? 1 : -1);
  573. while (fromRight ? index-- : ++index < length) {
  574. if (predicate(array[index], index, array)) {
  575. return index;
  576. }
  577. }
  578. return -1;
  579. }
  580. function baseIndexOf(array, value, fromIndex) {
  581. return value === value ? strictIndexOf(array, value, fromIndex) : baseFindIndex(array, baseIsNaN, fromIndex);
  582. }
  583. function baseIndexOfWith(array, value, fromIndex, comparator) {
  584. var index = fromIndex - 1, length = array.length;
  585. while (++index < length) {
  586. if (comparator(array[index], value)) {
  587. return index;
  588. }
  589. }
  590. return -1;
  591. }
  592. function baseIsNaN(value) {
  593. return value !== value;
  594. }
  595. function baseMean(array, iteratee) {
  596. var length = array == null ? 0 : array.length;
  597. return length ? baseSum(array, iteratee) / length : NAN;
  598. }
  599. function baseProperty(key) {
  600. return function(object) {
  601. return object == null ? undefined : object[key];
  602. };
  603. }
  604. function basePropertyOf(object) {
  605. return function(key) {
  606. return object == null ? undefined : object[key];
  607. };
  608. }
  609. function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {
  610. eachFunc(collection, function(value, index, collection2) {
  611. accumulator = initAccum ? (initAccum = false, value) : iteratee(accumulator, value, index, collection2);
  612. });
  613. return accumulator;
  614. }
  615. function baseSortBy(array, comparer) {
  616. var length = array.length;
  617. array.sort(comparer);
  618. while (length--) {
  619. array[length] = array[length].value;
  620. }
  621. return array;
  622. }
  623. function baseSum(array, iteratee) {
  624. var result, index = -1, length = array.length;
  625. while (++index < length) {
  626. var current = iteratee(array[index]);
  627. if (current !== undefined) {
  628. result = result === undefined ? current : result + current;
  629. }
  630. }
  631. return result;
  632. }
  633. function baseTimes(n, iteratee) {
  634. var index = -1, result = Array(n);
  635. while (++index < n) {
  636. result[index] = iteratee(index);
  637. }
  638. return result;
  639. }
  640. function baseToPairs(object, props) {
  641. return arrayMap(props, function(key) {
  642. return [key, object[key]];
  643. });
  644. }
  645. function baseTrim(string) {
  646. return string ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, "") : string;
  647. }
  648. function baseUnary(func) {
  649. return function(value) {
  650. return func(value);
  651. };
  652. }
  653. function baseValues(object, props) {
  654. return arrayMap(props, function(key) {
  655. return object[key];
  656. });
  657. }
  658. function cacheHas(cache, key) {
  659. return cache.has(key);
  660. }
  661. function charsStartIndex(strSymbols, chrSymbols) {
  662. var index = -1, length = strSymbols.length;
  663. while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {
  664. }
  665. return index;
  666. }
  667. function charsEndIndex(strSymbols, chrSymbols) {
  668. var index = strSymbols.length;
  669. while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {
  670. }
  671. return index;
  672. }
  673. function countHolders(array, placeholder) {
  674. var length = array.length, result = 0;
  675. while (length--) {
  676. if (array[length] === placeholder) {
  677. ++result;
  678. }
  679. }
  680. return result;
  681. }
  682. var deburrLetter = basePropertyOf(deburredLetters);
  683. var escapeHtmlChar = basePropertyOf(htmlEscapes);
  684. function escapeStringChar(chr) {
  685. return "\\" + stringEscapes[chr];
  686. }
  687. function getValue(object, key) {
  688. return object == null ? undefined : object[key];
  689. }
  690. function hasUnicode(string) {
  691. return reHasUnicode.test(string);
  692. }
  693. function hasUnicodeWord(string) {
  694. return reHasUnicodeWord.test(string);
  695. }
  696. function iteratorToArray(iterator) {
  697. var data, result = [];
  698. while (!(data = iterator.next()).done) {
  699. result.push(data.value);
  700. }
  701. return result;
  702. }
  703. function mapToArray(map) {
  704. var index = -1, result = Array(map.size);
  705. map.forEach(function(value, key) {
  706. result[++index] = [key, value];
  707. });
  708. return result;
  709. }
  710. function overArg(func, transform) {
  711. return function(arg) {
  712. return func(transform(arg));
  713. };
  714. }
  715. function replaceHolders(array, placeholder) {
  716. var index = -1, length = array.length, resIndex = 0, result = [];
  717. while (++index < length) {
  718. var value = array[index];
  719. if (value === placeholder || value === PLACEHOLDER) {
  720. array[index] = PLACEHOLDER;
  721. result[resIndex++] = index;
  722. }
  723. }
  724. return result;
  725. }
  726. function setToArray(set) {
  727. var index = -1, result = Array(set.size);
  728. set.forEach(function(value) {
  729. result[++index] = value;
  730. });
  731. return result;
  732. }
  733. function setToPairs(set) {
  734. var index = -1, result = Array(set.size);
  735. set.forEach(function(value) {
  736. result[++index] = [value, value];
  737. });
  738. return result;
  739. }
  740. function strictIndexOf(array, value, fromIndex) {
  741. var index = fromIndex - 1, length = array.length;
  742. while (++index < length) {
  743. if (array[index] === value) {
  744. return index;
  745. }
  746. }
  747. return -1;
  748. }
  749. function strictLastIndexOf(array, value, fromIndex) {
  750. var index = fromIndex + 1;
  751. while (index--) {
  752. if (array[index] === value) {
  753. return index;
  754. }
  755. }
  756. return index;
  757. }
  758. function stringSize(string) {
  759. return hasUnicode(string) ? unicodeSize(string) : asciiSize(string);
  760. }
  761. function stringToArray(string) {
  762. return hasUnicode(string) ? unicodeToArray(string) : asciiToArray(string);
  763. }
  764. function trimmedEndIndex(string) {
  765. var index = string.length;
  766. while (index-- && reWhitespace.test(string.charAt(index))) {
  767. }
  768. return index;
  769. }
  770. var unescapeHtmlChar = basePropertyOf(htmlUnescapes);
  771. function unicodeSize(string) {
  772. var result = reUnicode.lastIndex = 0;
  773. while (reUnicode.test(string)) {
  774. ++result;
  775. }
  776. return result;
  777. }
  778. function unicodeToArray(string) {
  779. return string.match(reUnicode) || [];
  780. }
  781. function unicodeWords(string) {
  782. return string.match(reUnicodeWord) || [];
  783. }
  784. var runInContext = function runInContext2(context) {
  785. context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));
  786. var Array2 = context.Array, Date = context.Date, Error2 = context.Error, Function2 = context.Function, Math2 = context.Math, Object2 = context.Object, RegExp2 = context.RegExp, String = context.String, TypeError2 = context.TypeError;
  787. var arrayProto = Array2.prototype, funcProto = Function2.prototype, objectProto = Object2.prototype;
  788. var coreJsData = context["__core-js_shared__"];
  789. var funcToString = funcProto.toString;
  790. var hasOwnProperty = objectProto.hasOwnProperty;
  791. var idCounter = 0;
  792. var maskSrcKey = function() {
  793. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || "");
  794. return uid ? "Symbol(src)_1." + uid : "";
  795. }();
  796. var nativeObjectToString = objectProto.toString;
  797. var objectCtorString = funcToString.call(Object2);
  798. var oldDash = root._;
  799. var reIsNative = RegExp2(
  800. "^" + funcToString.call(hasOwnProperty).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
  801. );
  802. var Buffer2 = moduleExports ? context.Buffer : undefined, Symbol2 = context.Symbol, Uint8Array2 = context.Uint8Array, allocUnsafe = Buffer2 ? Buffer2.allocUnsafe : undefined, getPrototype = overArg(Object2.getPrototypeOf, Object2), objectCreate = Object2.create, propertyIsEnumerable = objectProto.propertyIsEnumerable, splice = arrayProto.splice, spreadableSymbol = Symbol2 ? Symbol2.isConcatSpreadable : undefined, symIterator = Symbol2 ? Symbol2.iterator : undefined, symToStringTag = Symbol2 ? Symbol2.toStringTag : undefined;
  803. var defineProperty = function() {
  804. try {
  805. var func = getNative(Object2, "defineProperty");
  806. func({}, "", {});
  807. return func;
  808. } catch (e) {
  809. }
  810. }();
  811. var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout, ctxNow = Date && Date.now !== root.Date.now && Date.now, ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;
  812. var nativeCeil = Math2.ceil, nativeFloor = Math2.floor, nativeGetSymbols = Object2.getOwnPropertySymbols, nativeIsBuffer = Buffer2 ? Buffer2.isBuffer : undefined, nativeIsFinite = context.isFinite, nativeJoin = arrayProto.join, nativeKeys = overArg(Object2.keys, Object2), nativeMax = Math2.max, nativeMin = Math2.min, nativeNow = Date.now, nativeParseInt = context.parseInt, nativeRandom = Math2.random, nativeReverse = arrayProto.reverse;
  813. var DataView = getNative(context, "DataView"), Map = getNative(context, "Map"), Promise2 = getNative(context, "Promise"), Set = getNative(context, "Set"), WeakMap = getNative(context, "WeakMap"), nativeCreate = getNative(Object2, "create");
  814. var metaMap = WeakMap && new WeakMap();
  815. var realNames = {};
  816. var dataViewCtorString = toSource(DataView), mapCtorString = toSource(Map), promiseCtorString = toSource(Promise2), setCtorString = toSource(Set), weakMapCtorString = toSource(WeakMap);
  817. var symbolProto = Symbol2 ? Symbol2.prototype : undefined, symbolValueOf = symbolProto ? symbolProto.valueOf : undefined, symbolToString = symbolProto ? symbolProto.toString : undefined;
  818. function lodash2(value) {
  819. if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
  820. if (value instanceof LodashWrapper) {
  821. return value;
  822. }
  823. if (hasOwnProperty.call(value, "__wrapped__")) {
  824. return wrapperClone(value);
  825. }
  826. }
  827. return new LodashWrapper(value);
  828. }
  829. var baseCreate = /* @__PURE__ */ function() {
  830. function object() {
  831. }
  832. return function(proto) {
  833. if (!isObject(proto)) {
  834. return {};
  835. }
  836. if (objectCreate) {
  837. return objectCreate(proto);
  838. }
  839. object.prototype = proto;
  840. var result2 = new object();
  841. object.prototype = undefined;
  842. return result2;
  843. };
  844. }();
  845. function baseLodash() {
  846. }
  847. function LodashWrapper(value, chainAll) {
  848. this.__wrapped__ = value;
  849. this.__actions__ = [];
  850. this.__chain__ = !!chainAll;
  851. this.__index__ = 0;
  852. this.__values__ = undefined;
  853. }
  854. lodash2.templateSettings = {
  855. /**
  856. * Used to detect `data` property values to be HTML-escaped.
  857. *
  858. * @memberOf _.templateSettings
  859. * @type {RegExp}
  860. */
  861. "escape": reEscape,
  862. /**
  863. * Used to detect code to be evaluated.
  864. *
  865. * @memberOf _.templateSettings
  866. * @type {RegExp}
  867. */
  868. "evaluate": reEvaluate,
  869. /**
  870. * Used to detect `data` property values to inject.
  871. *
  872. * @memberOf _.templateSettings
  873. * @type {RegExp}
  874. */
  875. "interpolate": reInterpolate,
  876. /**
  877. * Used to reference the data object in the template text.
  878. *
  879. * @memberOf _.templateSettings
  880. * @type {string}
  881. */
  882. "variable": "",
  883. /**
  884. * Used to import variables into the compiled template.
  885. *
  886. * @memberOf _.templateSettings
  887. * @type {Object}
  888. */
  889. "imports": {
  890. /**
  891. * A reference to the `lodash` function.
  892. *
  893. * @memberOf _.templateSettings.imports
  894. * @type {Function}
  895. */
  896. "_": lodash2
  897. }
  898. };
  899. lodash2.prototype = baseLodash.prototype;
  900. lodash2.prototype.constructor = lodash2;
  901. LodashWrapper.prototype = baseCreate(baseLodash.prototype);
  902. LodashWrapper.prototype.constructor = LodashWrapper;
  903. function LazyWrapper(value) {
  904. this.__wrapped__ = value;
  905. this.__actions__ = [];
  906. this.__dir__ = 1;
  907. this.__filtered__ = false;
  908. this.__iteratees__ = [];
  909. this.__takeCount__ = MAX_ARRAY_LENGTH;
  910. this.__views__ = [];
  911. }
  912. function lazyClone() {
  913. var result2 = new LazyWrapper(this.__wrapped__);
  914. result2.__actions__ = copyArray(this.__actions__);
  915. result2.__dir__ = this.__dir__;
  916. result2.__filtered__ = this.__filtered__;
  917. result2.__iteratees__ = copyArray(this.__iteratees__);
  918. result2.__takeCount__ = this.__takeCount__;
  919. result2.__views__ = copyArray(this.__views__);
  920. return result2;
  921. }
  922. function lazyReverse() {
  923. if (this.__filtered__) {
  924. var result2 = new LazyWrapper(this);
  925. result2.__dir__ = -1;
  926. result2.__filtered__ = true;
  927. } else {
  928. result2 = this.clone();
  929. result2.__dir__ *= -1;
  930. }
  931. return result2;
  932. }
  933. function lazyValue() {
  934. var array = this.__wrapped__.value(), dir = this.__dir__, isArr = isArray(array), isRight = dir < 0, arrLength = isArr ? array.length : 0, view = getView(0, arrLength, this.__views__), start = view.start, end = view.end, length = end - start, index = isRight ? end : start - 1, iteratees = this.__iteratees__, iterLength = iteratees.length, resIndex = 0, takeCount = nativeMin(length, this.__takeCount__);
  935. if (!isArr || !isRight && arrLength == length && takeCount == length) {
  936. return baseWrapperValue(array, this.__actions__);
  937. }
  938. var result2 = [];
  939. outer:
  940. while (length-- && resIndex < takeCount) {
  941. index += dir;
  942. var iterIndex = -1, value = array[index];
  943. while (++iterIndex < iterLength) {
  944. var data = iteratees[iterIndex], iteratee2 = data.iteratee, type = data.type, computed = iteratee2(value);
  945. if (type == LAZY_MAP_FLAG) {
  946. value = computed;
  947. } else if (!computed) {
  948. if (type == LAZY_FILTER_FLAG) {
  949. continue outer;
  950. } else {
  951. break outer;
  952. }
  953. }
  954. }
  955. result2[resIndex++] = value;
  956. }
  957. return result2;
  958. }
  959. LazyWrapper.prototype = baseCreate(baseLodash.prototype);
  960. LazyWrapper.prototype.constructor = LazyWrapper;
  961. function Hash(entries) {
  962. var index = -1, length = entries == null ? 0 : entries.length;
  963. this.clear();
  964. while (++index < length) {
  965. var entry = entries[index];
  966. this.set(entry[0], entry[1]);
  967. }
  968. }
  969. function hashClear() {
  970. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  971. this.size = 0;
  972. }
  973. function hashDelete(key) {
  974. var result2 = this.has(key) && delete this.__data__[key];
  975. this.size -= result2 ? 1 : 0;
  976. return result2;
  977. }
  978. function hashGet(key) {
  979. var data = this.__data__;
  980. if (nativeCreate) {
  981. var result2 = data[key];
  982. return result2 === HASH_UNDEFINED ? undefined : result2;
  983. }
  984. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  985. }
  986. function hashHas(key) {
  987. var data = this.__data__;
  988. return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
  989. }
  990. function hashSet(key, value) {
  991. var data = this.__data__;
  992. this.size += this.has(key) ? 0 : 1;
  993. data[key] = nativeCreate && value === undefined ? HASH_UNDEFINED : value;
  994. return this;
  995. }
  996. Hash.prototype.clear = hashClear;
  997. Hash.prototype["delete"] = hashDelete;
  998. Hash.prototype.get = hashGet;
  999. Hash.prototype.has = hashHas;
  1000. Hash.prototype.set = hashSet;
  1001. function ListCache(entries) {
  1002. var index = -1, length = entries == null ? 0 : entries.length;
  1003. this.clear();
  1004. while (++index < length) {
  1005. var entry = entries[index];
  1006. this.set(entry[0], entry[1]);
  1007. }
  1008. }
  1009. function listCacheClear() {
  1010. this.__data__ = [];
  1011. this.size = 0;
  1012. }
  1013. function listCacheDelete(key) {
  1014. var data = this.__data__, index = assocIndexOf(data, key);
  1015. if (index < 0) {
  1016. return false;
  1017. }
  1018. var lastIndex = data.length - 1;
  1019. if (index == lastIndex) {
  1020. data.pop();
  1021. } else {
  1022. splice.call(data, index, 1);
  1023. }
  1024. --this.size;
  1025. return true;
  1026. }
  1027. function listCacheGet(key) {
  1028. var data = this.__data__, index = assocIndexOf(data, key);
  1029. return index < 0 ? undefined : data[index][1];
  1030. }
  1031. function listCacheHas(key) {
  1032. return assocIndexOf(this.__data__, key) > -1;
  1033. }
  1034. function listCacheSet(key, value) {
  1035. var data = this.__data__, index = assocIndexOf(data, key);
  1036. if (index < 0) {
  1037. ++this.size;
  1038. data.push([key, value]);
  1039. } else {
  1040. data[index][1] = value;
  1041. }
  1042. return this;
  1043. }
  1044. ListCache.prototype.clear = listCacheClear;
  1045. ListCache.prototype["delete"] = listCacheDelete;
  1046. ListCache.prototype.get = listCacheGet;
  1047. ListCache.prototype.has = listCacheHas;
  1048. ListCache.prototype.set = listCacheSet;
  1049. function MapCache(entries) {
  1050. var index = -1, length = entries == null ? 0 : entries.length;
  1051. this.clear();
  1052. while (++index < length) {
  1053. var entry = entries[index];
  1054. this.set(entry[0], entry[1]);
  1055. }
  1056. }
  1057. function mapCacheClear() {
  1058. this.size = 0;
  1059. this.__data__ = {
  1060. "hash": new Hash(),
  1061. "map": new (Map || ListCache)(),
  1062. "string": new Hash()
  1063. };
  1064. }
  1065. function mapCacheDelete(key) {
  1066. var result2 = getMapData(this, key)["delete"](key);
  1067. this.size -= result2 ? 1 : 0;
  1068. return result2;
  1069. }
  1070. function mapCacheGet(key) {
  1071. return getMapData(this, key).get(key);
  1072. }
  1073. function mapCacheHas(key) {
  1074. return getMapData(this, key).has(key);
  1075. }
  1076. function mapCacheSet(key, value) {
  1077. var data = getMapData(this, key), size2 = data.size;
  1078. data.set(key, value);
  1079. this.size += data.size == size2 ? 0 : 1;
  1080. return this;
  1081. }
  1082. MapCache.prototype.clear = mapCacheClear;
  1083. MapCache.prototype["delete"] = mapCacheDelete;
  1084. MapCache.prototype.get = mapCacheGet;
  1085. MapCache.prototype.has = mapCacheHas;
  1086. MapCache.prototype.set = mapCacheSet;
  1087. function SetCache(values2) {
  1088. var index = -1, length = values2 == null ? 0 : values2.length;
  1089. this.__data__ = new MapCache();
  1090. while (++index < length) {
  1091. this.add(values2[index]);
  1092. }
  1093. }
  1094. function setCacheAdd(value) {
  1095. this.__data__.set(value, HASH_UNDEFINED);
  1096. return this;
  1097. }
  1098. function setCacheHas(value) {
  1099. return this.__data__.has(value);
  1100. }
  1101. SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
  1102. SetCache.prototype.has = setCacheHas;
  1103. function Stack(entries) {
  1104. var data = this.__data__ = new ListCache(entries);
  1105. this.size = data.size;
  1106. }
  1107. function stackClear() {
  1108. this.__data__ = new ListCache();
  1109. this.size = 0;
  1110. }
  1111. function stackDelete(key) {
  1112. var data = this.__data__, result2 = data["delete"](key);
  1113. this.size = data.size;
  1114. return result2;
  1115. }
  1116. function stackGet(key) {
  1117. return this.__data__.get(key);
  1118. }
  1119. function stackHas(key) {
  1120. return this.__data__.has(key);
  1121. }
  1122. function stackSet(key, value) {
  1123. var data = this.__data__;
  1124. if (data instanceof ListCache) {
  1125. var pairs = data.__data__;
  1126. if (!Map || pairs.length < LARGE_ARRAY_SIZE - 1) {
  1127. pairs.push([key, value]);
  1128. this.size = ++data.size;
  1129. return this;
  1130. }
  1131. data = this.__data__ = new MapCache(pairs);
  1132. }
  1133. data.set(key, value);
  1134. this.size = data.size;
  1135. return this;
  1136. }
  1137. Stack.prototype.clear = stackClear;
  1138. Stack.prototype["delete"] = stackDelete;
  1139. Stack.prototype.get = stackGet;
  1140. Stack.prototype.has = stackHas;
  1141. Stack.prototype.set = stackSet;
  1142. function arrayLikeKeys(value, inherited) {
  1143. var isArr = isArray(value), isArg = !isArr && isArguments(value), isBuff = !isArr && !isArg && isBuffer(value), isType = !isArr && !isArg && !isBuff && isTypedArray(value), skipIndexes = isArr || isArg || isBuff || isType, result2 = skipIndexes ? baseTimes(value.length, String) : [], length = result2.length;
  1144. for (var key in value) {
  1145. if ((inherited || hasOwnProperty.call(value, key)) && !(skipIndexes && // Safari 9 has enumerable `arguments.length` in strict mode.
  1146. (key == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
  1147. isBuff && (key == "offset" || key == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
  1148. isType && (key == "buffer" || key == "byteLength" || key == "byteOffset") || // Skip index properties.
  1149. isIndex(key, length)))) {
  1150. result2.push(key);
  1151. }
  1152. }
  1153. return result2;
  1154. }
  1155. function arraySample(array) {
  1156. var length = array.length;
  1157. return length ? array[baseRandom(0, length - 1)] : undefined;
  1158. }
  1159. function arraySampleSize(array, n) {
  1160. return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length));
  1161. }
  1162. function arrayShuffle(array) {
  1163. return shuffleSelf(copyArray(array));
  1164. }
  1165. function assignMergeValue(object, key, value) {
  1166. if (value !== undefined && !eq(object[key], value) || value === undefined && !(key in object)) {
  1167. baseAssignValue(object, key, value);
  1168. }
  1169. }
  1170. function assignValue(object, key, value) {
  1171. var objValue = object[key];
  1172. if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || value === undefined && !(key in object)) {
  1173. baseAssignValue(object, key, value);
  1174. }
  1175. }
  1176. function assocIndexOf(array, key) {
  1177. var length = array.length;
  1178. while (length--) {
  1179. if (eq(array[length][0], key)) {
  1180. return length;
  1181. }
  1182. }
  1183. return -1;
  1184. }
  1185. function baseAggregator(collection, setter, iteratee2, accumulator) {
  1186. baseEach(collection, function(value, key, collection2) {
  1187. setter(accumulator, value, iteratee2(value), collection2);
  1188. });
  1189. return accumulator;
  1190. }
  1191. function baseAssign(object, source) {
  1192. return object && copyObject(source, keys(source), object);
  1193. }
  1194. function baseAssignIn(object, source) {
  1195. return object && copyObject(source, keysIn(source), object);
  1196. }
  1197. function baseAssignValue(object, key, value) {
  1198. if (key == "__proto__" && defineProperty) {
  1199. defineProperty(object, key, {
  1200. "configurable": true,
  1201. "enumerable": true,
  1202. "value": value,
  1203. "writable": true
  1204. });
  1205. } else {
  1206. object[key] = value;
  1207. }
  1208. }
  1209. function baseAt(object, paths) {
  1210. var index = -1, length = paths.length, result2 = Array2(length), skip = object == null;
  1211. while (++index < length) {
  1212. result2[index] = skip ? undefined : get(object, paths[index]);
  1213. }
  1214. return result2;
  1215. }
  1216. function baseClamp(number, lower, upper) {
  1217. if (number === number) {
  1218. if (upper !== undefined) {
  1219. number = number <= upper ? number : upper;
  1220. }
  1221. if (lower !== undefined) {
  1222. number = number >= lower ? number : lower;
  1223. }
  1224. }
  1225. return number;
  1226. }
  1227. function baseClone(value, bitmask, customizer, key, object, stack) {
  1228. var result2, isDeep = bitmask & CLONE_DEEP_FLAG, isFlat = bitmask & CLONE_FLAT_FLAG, isFull = bitmask & CLONE_SYMBOLS_FLAG;
  1229. if (customizer) {
  1230. result2 = object ? customizer(value, key, object, stack) : customizer(value);
  1231. }
  1232. if (result2 !== undefined) {
  1233. return result2;
  1234. }
  1235. if (!isObject(value)) {
  1236. return value;
  1237. }
  1238. var isArr = isArray(value);
  1239. if (isArr) {
  1240. result2 = initCloneArray(value);
  1241. if (!isDeep) {
  1242. return copyArray(value, result2);
  1243. }
  1244. } else {
  1245. var tag = getTag(value), isFunc = tag == funcTag || tag == genTag;
  1246. if (isBuffer(value)) {
  1247. return cloneBuffer(value, isDeep);
  1248. }
  1249. if (tag == objectTag || tag == argsTag || isFunc && !object) {
  1250. result2 = isFlat || isFunc ? {} : initCloneObject(value);
  1251. if (!isDeep) {
  1252. return isFlat ? copySymbolsIn(value, baseAssignIn(result2, value)) : copySymbols(value, baseAssign(result2, value));
  1253. }
  1254. } else {
  1255. if (!cloneableTags[tag]) {
  1256. return object ? value : {};
  1257. }
  1258. result2 = initCloneByTag(value, tag, isDeep);
  1259. }
  1260. }
  1261. stack || (stack = new Stack());
  1262. var stacked = stack.get(value);
  1263. if (stacked) {
  1264. return stacked;
  1265. }
  1266. stack.set(value, result2);
  1267. if (isSet(value)) {
  1268. value.forEach(function(subValue) {
  1269. result2.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
  1270. });
  1271. } else if (isMap(value)) {
  1272. value.forEach(function(subValue, key2) {
  1273. result2.set(key2, baseClone(subValue, bitmask, customizer, key2, value, stack));
  1274. });
  1275. }
  1276. var keysFunc = isFull ? isFlat ? getAllKeysIn : getAllKeys : isFlat ? keysIn : keys;
  1277. var props = isArr ? undefined : keysFunc(value);
  1278. arrayEach(props || value, function(subValue, key2) {
  1279. if (props) {
  1280. key2 = subValue;
  1281. subValue = value[key2];
  1282. }
  1283. assignValue(result2, key2, baseClone(subValue, bitmask, customizer, key2, value, stack));
  1284. });
  1285. return result2;
  1286. }
  1287. function baseConforms(source) {
  1288. var props = keys(source);
  1289. return function(object) {
  1290. return baseConformsTo(object, source, props);
  1291. };
  1292. }
  1293. function baseConformsTo(object, source, props) {
  1294. var length = props.length;
  1295. if (object == null) {
  1296. return !length;
  1297. }
  1298. object = Object2(object);
  1299. while (length--) {
  1300. var key = props[length], predicate = source[key], value = object[key];
  1301. if (value === undefined && !(key in object) || !predicate(value)) {
  1302. return false;
  1303. }
  1304. }
  1305. return true;
  1306. }
  1307. function baseDelay(func, wait, args) {
  1308. if (typeof func != "function") {
  1309. throw new TypeError2(FUNC_ERROR_TEXT);
  1310. }
  1311. return setTimeout2(function() {
  1312. func.apply(undefined, args);
  1313. }, wait);
  1314. }
  1315. function baseDifference(array, values2, iteratee2, comparator) {
  1316. var index = -1, includes2 = arrayIncludes, isCommon = true, length = array.length, result2 = [], valuesLength = values2.length;
  1317. if (!length) {
  1318. return result2;
  1319. }
  1320. if (iteratee2) {
  1321. values2 = arrayMap(values2, baseUnary(iteratee2));
  1322. }
  1323. if (comparator) {
  1324. includes2 = arrayIncludesWith;
  1325. isCommon = false;
  1326. } else if (values2.length >= LARGE_ARRAY_SIZE) {
  1327. includes2 = cacheHas;
  1328. isCommon = false;
  1329. values2 = new SetCache(values2);
  1330. }
  1331. outer:
  1332. while (++index < length) {
  1333. var value = array[index], computed = iteratee2 == null ? value : iteratee2(value);
  1334. value = comparator || value !== 0 ? value : 0;
  1335. if (isCommon && computed === computed) {
  1336. var valuesIndex = valuesLength;
  1337. while (valuesIndex--) {
  1338. if (values2[valuesIndex] === computed) {
  1339. continue outer;
  1340. }
  1341. }
  1342. result2.push(value);
  1343. } else if (!includes2(values2, computed, comparator)) {
  1344. result2.push(value);
  1345. }
  1346. }
  1347. return result2;
  1348. }
  1349. var baseEach = createBaseEach(baseForOwn);
  1350. var baseEachRight = createBaseEach(baseForOwnRight, true);
  1351. function baseEvery(collection, predicate) {
  1352. var result2 = true;
  1353. baseEach(collection, function(value, index, collection2) {
  1354. result2 = !!predicate(value, index, collection2);
  1355. return result2;
  1356. });
  1357. return result2;
  1358. }
  1359. function baseExtremum(array, iteratee2, comparator) {
  1360. var index = -1, length = array.length;
  1361. while (++index < length) {
  1362. var value = array[index], current = iteratee2(value);
  1363. if (current != null && (computed === undefined ? current === current && !isSymbol(current) : comparator(current, computed))) {
  1364. var computed = current, result2 = value;
  1365. }
  1366. }
  1367. return result2;
  1368. }
  1369. function baseFill(array, value, start, end) {
  1370. var length = array.length;
  1371. start = toInteger(start);
  1372. if (start < 0) {
  1373. start = -start > length ? 0 : length + start;
  1374. }
  1375. end = end === undefined || end > length ? length : toInteger(end);
  1376. if (end < 0) {
  1377. end += length;
  1378. }
  1379. end = start > end ? 0 : toLength(end);
  1380. while (start < end) {
  1381. array[start++] = value;
  1382. }
  1383. return array;
  1384. }
  1385. function baseFilter(collection, predicate) {
  1386. var result2 = [];
  1387. baseEach(collection, function(value, index, collection2) {
  1388. if (predicate(value, index, collection2)) {
  1389. result2.push(value);
  1390. }
  1391. });
  1392. return result2;
  1393. }
  1394. function baseFlatten(array, depth, predicate, isStrict, result2) {
  1395. var index = -1, length = array.length;
  1396. predicate || (predicate = isFlattenable);
  1397. result2 || (result2 = []);
  1398. while (++index < length) {
  1399. var value = array[index];
  1400. if (depth > 0 && predicate(value)) {
  1401. if (depth > 1) {
  1402. baseFlatten(value, depth - 1, predicate, isStrict, result2);
  1403. } else {
  1404. arrayPush(result2, value);
  1405. }
  1406. } else if (!isStrict) {
  1407. result2[result2.length] = value;
  1408. }
  1409. }
  1410. return result2;
  1411. }
  1412. var baseFor = createBaseFor();
  1413. var baseForRight = createBaseFor(true);
  1414. function baseForOwn(object, iteratee2) {
  1415. return object && baseFor(object, iteratee2, keys);
  1416. }
  1417. function baseForOwnRight(object, iteratee2) {
  1418. return object && baseForRight(object, iteratee2, keys);
  1419. }
  1420. function baseFunctions(object, props) {
  1421. return arrayFilter(props, function(key) {
  1422. return isFunction(object[key]);
  1423. });
  1424. }
  1425. function baseGet(object, path) {
  1426. path = castPath(path, object);
  1427. var index = 0, length = path.length;
  1428. while (object != null && index < length) {
  1429. object = object[toKey(path[index++])];
  1430. }
  1431. return index && index == length ? object : undefined;
  1432. }
  1433. function baseGetAllKeys(object, keysFunc, symbolsFunc) {
  1434. var result2 = keysFunc(object);
  1435. return isArray(object) ? result2 : arrayPush(result2, symbolsFunc(object));
  1436. }
  1437. function baseGetTag(value) {
  1438. if (value == null) {
  1439. return value === undefined ? undefinedTag : nullTag;
  1440. }
  1441. return symToStringTag && symToStringTag in Object2(value) ? getRawTag(value) : objectToString(value);
  1442. }
  1443. function baseGt(value, other) {
  1444. return value > other;
  1445. }
  1446. function baseHas(object, key) {
  1447. return object != null && hasOwnProperty.call(object, key);
  1448. }
  1449. function baseHasIn(object, key) {
  1450. return object != null && key in Object2(object);
  1451. }
  1452. function baseInRange(number, start, end) {
  1453. return number >= nativeMin(start, end) && number < nativeMax(start, end);
  1454. }
  1455. function baseIntersection(arrays, iteratee2, comparator) {
  1456. var includes2 = comparator ? arrayIncludesWith : arrayIncludes, length = arrays[0].length, othLength = arrays.length, othIndex = othLength, caches = Array2(othLength), maxLength = Infinity, result2 = [];
  1457. while (othIndex--) {
  1458. var array = arrays[othIndex];
  1459. if (othIndex && iteratee2) {
  1460. array = arrayMap(array, baseUnary(iteratee2));
  1461. }
  1462. maxLength = nativeMin(array.length, maxLength);
  1463. caches[othIndex] = !comparator && (iteratee2 || length >= 120 && array.length >= 120) ? new SetCache(othIndex && array) : undefined;
  1464. }
  1465. array = arrays[0];
  1466. var index = -1, seen = caches[0];
  1467. outer:
  1468. while (++index < length && result2.length < maxLength) {
  1469. var value = array[index], computed = iteratee2 ? iteratee2(value) : value;
  1470. value = comparator || value !== 0 ? value : 0;
  1471. if (!(seen ? cacheHas(seen, computed) : includes2(result2, computed, comparator))) {
  1472. othIndex = othLength;
  1473. while (--othIndex) {
  1474. var cache = caches[othIndex];
  1475. if (!(cache ? cacheHas(cache, computed) : includes2(arrays[othIndex], computed, comparator))) {
  1476. continue outer;
  1477. }
  1478. }
  1479. if (seen) {
  1480. seen.push(computed);
  1481. }
  1482. result2.push(value);
  1483. }
  1484. }
  1485. return result2;
  1486. }
  1487. function baseInverter(object, setter, iteratee2, accumulator) {
  1488. baseForOwn(object, function(value, key, object2) {
  1489. setter(accumulator, iteratee2(value), key, object2);
  1490. });
  1491. return accumulator;
  1492. }
  1493. function baseInvoke(object, path, args) {
  1494. path = castPath(path, object);
  1495. object = parent(object, path);
  1496. var func = object == null ? object : object[toKey(last(path))];
  1497. return func == null ? undefined : apply(func, object, args);
  1498. }
  1499. function baseIsArguments(value) {
  1500. return isObjectLike(value) && baseGetTag(value) == argsTag;
  1501. }
  1502. function baseIsArrayBuffer(value) {
  1503. return isObjectLike(value) && baseGetTag(value) == arrayBufferTag;
  1504. }
  1505. function baseIsDate(value) {
  1506. return isObjectLike(value) && baseGetTag(value) == dateTag;
  1507. }
  1508. function baseIsEqual(value, other, bitmask, customizer, stack) {
  1509. if (value === other) {
  1510. return true;
  1511. }
  1512. if (value == null || other == null || !isObjectLike(value) && !isObjectLike(other)) {
  1513. return value !== value && other !== other;
  1514. }
  1515. return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
  1516. }
  1517. function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
  1518. var objIsArr = isArray(object), othIsArr = isArray(other), objTag = objIsArr ? arrayTag : getTag(object), othTag = othIsArr ? arrayTag : getTag(other);
  1519. objTag = objTag == argsTag ? objectTag : objTag;
  1520. othTag = othTag == argsTag ? objectTag : othTag;
  1521. var objIsObj = objTag == objectTag, othIsObj = othTag == objectTag, isSameTag = objTag == othTag;
  1522. if (isSameTag && isBuffer(object)) {
  1523. if (!isBuffer(other)) {
  1524. return false;
  1525. }
  1526. objIsArr = true;
  1527. objIsObj = false;
  1528. }
  1529. if (isSameTag && !objIsObj) {
  1530. stack || (stack = new Stack());
  1531. return objIsArr || isTypedArray(object) ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
  1532. }
  1533. if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
  1534. var objIsWrapped = objIsObj && hasOwnProperty.call(object, "__wrapped__"), othIsWrapped = othIsObj && hasOwnProperty.call(other, "__wrapped__");
  1535. if (objIsWrapped || othIsWrapped) {
  1536. var objUnwrapped = objIsWrapped ? object.value() : object, othUnwrapped = othIsWrapped ? other.value() : other;
  1537. stack || (stack = new Stack());
  1538. return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
  1539. }
  1540. }
  1541. if (!isSameTag) {
  1542. return false;
  1543. }
  1544. stack || (stack = new Stack());
  1545. return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
  1546. }
  1547. function baseIsMap(value) {
  1548. return isObjectLike(value) && getTag(value) == mapTag;
  1549. }
  1550. function baseIsMatch(object, source, matchData, customizer) {
  1551. var index = matchData.length, length = index, noCustomizer = !customizer;
  1552. if (object == null) {
  1553. return !length;
  1554. }
  1555. object = Object2(object);
  1556. while (index--) {
  1557. var data = matchData[index];
  1558. if (noCustomizer && data[2] ? data[1] !== object[data[0]] : !(data[0] in object)) {
  1559. return false;
  1560. }
  1561. }
  1562. while (++index < length) {
  1563. data = matchData[index];
  1564. var key = data[0], objValue = object[key], srcValue = data[1];
  1565. if (noCustomizer && data[2]) {
  1566. if (objValue === undefined && !(key in object)) {
  1567. return false;
  1568. }
  1569. } else {
  1570. var stack = new Stack();
  1571. if (customizer) {
  1572. var result2 = customizer(objValue, srcValue, key, object, source, stack);
  1573. }
  1574. if (!(result2 === undefined ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack) : result2)) {
  1575. return false;
  1576. }
  1577. }
  1578. }
  1579. return true;
  1580. }
  1581. function baseIsNative(value) {
  1582. if (!isObject(value) || isMasked(value)) {
  1583. return false;
  1584. }
  1585. var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
  1586. return pattern.test(toSource(value));
  1587. }
  1588. function baseIsRegExp(value) {
  1589. return isObjectLike(value) && baseGetTag(value) == regexpTag;
  1590. }
  1591. function baseIsSet(value) {
  1592. return isObjectLike(value) && getTag(value) == setTag;
  1593. }
  1594. function baseIsTypedArray(value) {
  1595. return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
  1596. }
  1597. function baseIteratee(value) {
  1598. if (typeof value == "function") {
  1599. return value;
  1600. }
  1601. if (value == null) {
  1602. return identity;
  1603. }
  1604. if (typeof value == "object") {
  1605. return isArray(value) ? baseMatchesProperty(value[0], value[1]) : baseMatches(value);
  1606. }
  1607. return property(value);
  1608. }
  1609. function baseKeys(object) {
  1610. if (!isPrototype(object)) {
  1611. return nativeKeys(object);
  1612. }
  1613. var result2 = [];
  1614. for (var key in Object2(object)) {
  1615. if (hasOwnProperty.call(object, key) && key != "constructor") {
  1616. result2.push(key);
  1617. }
  1618. }
  1619. return result2;
  1620. }
  1621. function baseKeysIn(object) {
  1622. if (!isObject(object)) {
  1623. return nativeKeysIn(object);
  1624. }
  1625. var isProto = isPrototype(object), result2 = [];
  1626. for (var key in object) {
  1627. if (!(key == "constructor" && (isProto || !hasOwnProperty.call(object, key)))) {
  1628. result2.push(key);
  1629. }
  1630. }
  1631. return result2;
  1632. }
  1633. function baseLt(value, other) {
  1634. return value < other;
  1635. }
  1636. function baseMap(collection, iteratee2) {
  1637. var index = -1, result2 = isArrayLike(collection) ? Array2(collection.length) : [];
  1638. baseEach(collection, function(value, key, collection2) {
  1639. result2[++index] = iteratee2(value, key, collection2);
  1640. });
  1641. return result2;
  1642. }
  1643. function baseMatches(source) {
  1644. var matchData = getMatchData(source);
  1645. if (matchData.length == 1 && matchData[0][2]) {
  1646. return matchesStrictComparable(matchData[0][0], matchData[0][1]);
  1647. }
  1648. return function(object) {
  1649. return object === source || baseIsMatch(object, source, matchData);
  1650. };
  1651. }
  1652. function baseMatchesProperty(path, srcValue) {
  1653. if (isKey(path) && isStrictComparable(srcValue)) {
  1654. return matchesStrictComparable(toKey(path), srcValue);
  1655. }
  1656. return function(object) {
  1657. var objValue = get(object, path);
  1658. return objValue === undefined && objValue === srcValue ? hasIn(object, path) : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
  1659. };
  1660. }
  1661. function baseMerge(object, source, srcIndex, customizer, stack) {
  1662. if (object === source) {
  1663. return;
  1664. }
  1665. baseFor(source, function(srcValue, key) {
  1666. stack || (stack = new Stack());
  1667. if (isObject(srcValue)) {
  1668. baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
  1669. } else {
  1670. var newValue = customizer ? customizer(safeGet(object, key), srcValue, key + "", object, source, stack) : undefined;
  1671. if (newValue === undefined) {
  1672. newValue = srcValue;
  1673. }
  1674. assignMergeValue(object, key, newValue);
  1675. }
  1676. }, keysIn);
  1677. }
  1678. function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
  1679. var objValue = safeGet(object, key), srcValue = safeGet(source, key), stacked = stack.get(srcValue);
  1680. if (stacked) {
  1681. assignMergeValue(object, key, stacked);
  1682. return;
  1683. }
  1684. var newValue = customizer ? customizer(objValue, srcValue, key + "", object, source, stack) : undefined;
  1685. var isCommon = newValue === undefined;
  1686. if (isCommon) {
  1687. var isArr = isArray(srcValue), isBuff = !isArr && isBuffer(srcValue), isTyped = !isArr && !isBuff && isTypedArray(srcValue);
  1688. newValue = srcValue;
  1689. if (isArr || isBuff || isTyped) {
  1690. if (isArray(objValue)) {
  1691. newValue = objValue;
  1692. } else if (isArrayLikeObject(objValue)) {
  1693. newValue = copyArray(objValue);
  1694. } else if (isBuff) {
  1695. isCommon = false;
  1696. newValue = cloneBuffer(srcValue, true);
  1697. } else if (isTyped) {
  1698. isCommon = false;
  1699. newValue = cloneTypedArray(srcValue, true);
  1700. } else {
  1701. newValue = [];
  1702. }
  1703. } else if (isPlainObject(srcValue) || isArguments(srcValue)) {
  1704. newValue = objValue;
  1705. if (isArguments(objValue)) {
  1706. newValue = toPlainObject(objValue);
  1707. } else if (!isObject(objValue) || isFunction(objValue)) {
  1708. newValue = initCloneObject(srcValue);
  1709. }
  1710. } else {
  1711. isCommon = false;
  1712. }
  1713. }
  1714. if (isCommon) {
  1715. stack.set(srcValue, newValue);
  1716. mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
  1717. stack["delete"](srcValue);
  1718. }
  1719. assignMergeValue(object, key, newValue);
  1720. }
  1721. function baseNth(array, n) {
  1722. var length = array.length;
  1723. if (!length) {
  1724. return;
  1725. }
  1726. n += n < 0 ? length : 0;
  1727. return isIndex(n, length) ? array[n] : undefined;
  1728. }
  1729. function baseOrderBy(collection, iteratees, orders) {
  1730. if (iteratees.length) {
  1731. iteratees = arrayMap(iteratees, function(iteratee2) {
  1732. if (isArray(iteratee2)) {
  1733. return function(value) {
  1734. return baseGet(value, iteratee2.length === 1 ? iteratee2[0] : iteratee2);
  1735. };
  1736. }
  1737. return iteratee2;
  1738. });
  1739. } else {
  1740. iteratees = [identity];
  1741. }
  1742. var index = -1;
  1743. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  1744. var result2 = baseMap(collection, function(value, key, collection2) {
  1745. var criteria = arrayMap(iteratees, function(iteratee2) {
  1746. return iteratee2(value);
  1747. });
  1748. return { "criteria": criteria, "index": ++index, "value": value };
  1749. });
  1750. return baseSortBy(result2, function(object, other) {
  1751. return compareMultiple(object, other, orders);
  1752. });
  1753. }
  1754. function basePick(object, paths) {
  1755. return basePickBy(object, paths, function(value, path) {
  1756. return hasIn(object, path);
  1757. });
  1758. }
  1759. function basePickBy(object, paths, predicate) {
  1760. var index = -1, length = paths.length, result2 = {};
  1761. while (++index < length) {
  1762. var path = paths[index], value = baseGet(object, path);
  1763. if (predicate(value, path)) {
  1764. baseSet(result2, castPath(path, object), value);
  1765. }
  1766. }
  1767. return result2;
  1768. }
  1769. function basePropertyDeep(path) {
  1770. return function(object) {
  1771. return baseGet(object, path);
  1772. };
  1773. }
  1774. function basePullAll(array, values2, iteratee2, comparator) {
  1775. var indexOf2 = comparator ? baseIndexOfWith : baseIndexOf, index = -1, length = values2.length, seen = array;
  1776. if (array === values2) {
  1777. values2 = copyArray(values2);
  1778. }
  1779. if (iteratee2) {
  1780. seen = arrayMap(array, baseUnary(iteratee2));
  1781. }
  1782. while (++index < length) {
  1783. var fromIndex = 0, value = values2[index], computed = iteratee2 ? iteratee2(value) : value;
  1784. while ((fromIndex = indexOf2(seen, computed, fromIndex, comparator)) > -1) {
  1785. if (seen !== array) {
  1786. splice.call(seen, fromIndex, 1);
  1787. }
  1788. splice.call(array, fromIndex, 1);
  1789. }
  1790. }
  1791. return array;
  1792. }
  1793. function basePullAt(array, indexes) {
  1794. var length = array ? indexes.length : 0, lastIndex = length - 1;
  1795. while (length--) {
  1796. var index = indexes[length];
  1797. if (length == lastIndex || index !== previous) {
  1798. var previous = index;
  1799. if (isIndex(index)) {
  1800. splice.call(array, index, 1);
  1801. } else {
  1802. baseUnset(array, index);
  1803. }
  1804. }
  1805. }
  1806. return array;
  1807. }
  1808. function baseRandom(lower, upper) {
  1809. return lower + nativeFloor(nativeRandom() * (upper - lower + 1));
  1810. }
  1811. function baseRange(start, end, step, fromRight) {
  1812. var index = -1, length = nativeMax(nativeCeil((end - start) / (step || 1)), 0), result2 = Array2(length);
  1813. while (length--) {
  1814. result2[fromRight ? length : ++index] = start;
  1815. start += step;
  1816. }
  1817. return result2;
  1818. }
  1819. function baseRepeat(string, n) {
  1820. var result2 = "";
  1821. if (!string || n < 1 || n > MAX_SAFE_INTEGER) {
  1822. return result2;
  1823. }
  1824. do {
  1825. if (n % 2) {
  1826. result2 += string;
  1827. }
  1828. n = nativeFloor(n / 2);
  1829. if (n) {
  1830. string += string;
  1831. }
  1832. } while (n);
  1833. return result2;
  1834. }
  1835. function baseRest(func, start) {
  1836. return setToString(overRest(func, start, identity), func + "");
  1837. }
  1838. function baseSample(collection) {
  1839. return arraySample(values(collection));
  1840. }
  1841. function baseSampleSize(collection, n) {
  1842. var array = values(collection);
  1843. return shuffleSelf(array, baseClamp(n, 0, array.length));
  1844. }
  1845. function baseSet(object, path, value, customizer) {
  1846. if (!isObject(object)) {
  1847. return object;
  1848. }
  1849. path = castPath(path, object);
  1850. var index = -1, length = path.length, lastIndex = length - 1, nested = object;
  1851. while (nested != null && ++index < length) {
  1852. var key = toKey(path[index]), newValue = value;
  1853. if (key === "__proto__" || key === "constructor" || key === "prototype") {
  1854. return object;
  1855. }
  1856. if (index != lastIndex) {
  1857. var objValue = nested[key];
  1858. newValue = customizer ? customizer(objValue, key, nested) : undefined;
  1859. if (newValue === undefined) {
  1860. newValue = isObject(objValue) ? objValue : isIndex(path[index + 1]) ? [] : {};
  1861. }
  1862. }
  1863. assignValue(nested, key, newValue);
  1864. nested = nested[key];
  1865. }
  1866. return object;
  1867. }
  1868. var baseSetData = !metaMap ? identity : function(func, data) {
  1869. metaMap.set(func, data);
  1870. return func;
  1871. };
  1872. var baseSetToString = !defineProperty ? identity : function(func, string) {
  1873. return defineProperty(func, "toString", {
  1874. "configurable": true,
  1875. "enumerable": false,
  1876. "value": constant(string),
  1877. "writable": true
  1878. });
  1879. };
  1880. function baseShuffle(collection) {
  1881. return shuffleSelf(values(collection));
  1882. }
  1883. function baseSlice(array, start, end) {
  1884. var index = -1, length = array.length;
  1885. if (start < 0) {
  1886. start = -start > length ? 0 : length + start;
  1887. }
  1888. end = end > length ? length : end;
  1889. if (end < 0) {
  1890. end += length;
  1891. }
  1892. length = start > end ? 0 : end - start >>> 0;
  1893. start >>>= 0;
  1894. var result2 = Array2(length);
  1895. while (++index < length) {
  1896. result2[index] = array[index + start];
  1897. }
  1898. return result2;
  1899. }
  1900. function baseSome(collection, predicate) {
  1901. var result2;
  1902. baseEach(collection, function(value, index, collection2) {
  1903. result2 = predicate(value, index, collection2);
  1904. return !result2;
  1905. });
  1906. return !!result2;
  1907. }
  1908. function baseSortedIndex(array, value, retHighest) {
  1909. var low = 0, high = array == null ? low : array.length;
  1910. if (typeof value == "number" && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
  1911. while (low < high) {
  1912. var mid = low + high >>> 1, computed = array[mid];
  1913. if (computed !== null && !isSymbol(computed) && (retHighest ? computed <= value : computed < value)) {
  1914. low = mid + 1;
  1915. } else {
  1916. high = mid;
  1917. }
  1918. }
  1919. return high;
  1920. }
  1921. return baseSortedIndexBy(array, value, identity, retHighest);
  1922. }
  1923. function baseSortedIndexBy(array, value, iteratee2, retHighest) {
  1924. var low = 0, high = array == null ? 0 : array.length;
  1925. if (high === 0) {
  1926. return 0;
  1927. }
  1928. value = iteratee2(value);
  1929. var valIsNaN = value !== value, valIsNull = value === null, valIsSymbol = isSymbol(value), valIsUndefined = value === undefined;
  1930. while (low < high) {
  1931. var mid = nativeFloor((low + high) / 2), computed = iteratee2(array[mid]), othIsDefined = computed !== undefined, othIsNull = computed === null, othIsReflexive = computed === computed, othIsSymbol = isSymbol(computed);
  1932. if (valIsNaN) {
  1933. var setLow = retHighest || othIsReflexive;
  1934. } else if (valIsUndefined) {
  1935. setLow = othIsReflexive && (retHighest || othIsDefined);
  1936. } else if (valIsNull) {
  1937. setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);
  1938. } else if (valIsSymbol) {
  1939. setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);
  1940. } else if (othIsNull || othIsSymbol) {
  1941. setLow = false;
  1942. } else {
  1943. setLow = retHighest ? computed <= value : computed < value;
  1944. }
  1945. if (setLow) {
  1946. low = mid + 1;
  1947. } else {
  1948. high = mid;
  1949. }
  1950. }
  1951. return nativeMin(high, MAX_ARRAY_INDEX);
  1952. }
  1953. function baseSortedUniq(array, iteratee2) {
  1954. var index = -1, length = array.length, resIndex = 0, result2 = [];
  1955. while (++index < length) {
  1956. var value = array[index], computed = iteratee2 ? iteratee2(value) : value;
  1957. if (!index || !eq(computed, seen)) {
  1958. var seen = computed;
  1959. result2[resIndex++] = value === 0 ? 0 : value;
  1960. }
  1961. }
  1962. return result2;
  1963. }
  1964. function baseToNumber(value) {
  1965. if (typeof value == "number") {
  1966. return value;
  1967. }
  1968. if (isSymbol(value)) {
  1969. return NAN;
  1970. }
  1971. return +value;
  1972. }
  1973. function baseToString(value) {
  1974. if (typeof value == "string") {
  1975. return value;
  1976. }
  1977. if (isArray(value)) {
  1978. return arrayMap(value, baseToString) + "";
  1979. }
  1980. if (isSymbol(value)) {
  1981. return symbolToString ? symbolToString.call(value) : "";
  1982. }
  1983. var result2 = value + "";
  1984. return result2 == "0" && 1 / value == -INFINITY ? "-0" : result2;
  1985. }
  1986. function baseUniq(array, iteratee2, comparator) {
  1987. var index = -1, includes2 = arrayIncludes, length = array.length, isCommon = true, result2 = [], seen = result2;
  1988. if (comparator) {
  1989. isCommon = false;
  1990. includes2 = arrayIncludesWith;
  1991. } else if (length >= LARGE_ARRAY_SIZE) {
  1992. var set2 = iteratee2 ? null : createSet(array);
  1993. if (set2) {
  1994. return setToArray(set2);
  1995. }
  1996. isCommon = false;
  1997. includes2 = cacheHas;
  1998. seen = new SetCache();
  1999. } else {
  2000. seen = iteratee2 ? [] : result2;
  2001. }
  2002. outer:
  2003. while (++index < length) {
  2004. var value = array[index], computed = iteratee2 ? iteratee2(value) : value;
  2005. value = comparator || value !== 0 ? value : 0;
  2006. if (isCommon && computed === computed) {
  2007. var seenIndex = seen.length;
  2008. while (seenIndex--) {
  2009. if (seen[seenIndex] === computed) {
  2010. continue outer;
  2011. }
  2012. }
  2013. if (iteratee2) {
  2014. seen.push(computed);
  2015. }
  2016. result2.push(value);
  2017. } else if (!includes2(seen, computed, comparator)) {
  2018. if (seen !== result2) {
  2019. seen.push(computed);
  2020. }
  2021. result2.push(value);
  2022. }
  2023. }
  2024. return result2;
  2025. }
  2026. function baseUnset(object, path) {
  2027. path = castPath(path, object);
  2028. object = parent(object, path);
  2029. return object == null || delete object[toKey(last(path))];
  2030. }
  2031. function baseUpdate(object, path, updater, customizer) {
  2032. return baseSet(object, path, updater(baseGet(object, path)), customizer);
  2033. }
  2034. function baseWhile(array, predicate, isDrop, fromRight) {
  2035. var length = array.length, index = fromRight ? length : -1;
  2036. while ((fromRight ? index-- : ++index < length) && predicate(array[index], index, array)) {
  2037. }
  2038. return isDrop ? baseSlice(array, fromRight ? 0 : index, fromRight ? index + 1 : length) : baseSlice(array, fromRight ? index + 1 : 0, fromRight ? length : index);
  2039. }
  2040. function baseWrapperValue(value, actions) {
  2041. var result2 = value;
  2042. if (result2 instanceof LazyWrapper) {
  2043. result2 = result2.value();
  2044. }
  2045. return arrayReduce(actions, function(result3, action) {
  2046. return action.func.apply(action.thisArg, arrayPush([result3], action.args));
  2047. }, result2);
  2048. }
  2049. function baseXor(arrays, iteratee2, comparator) {
  2050. var length = arrays.length;
  2051. if (length < 2) {
  2052. return length ? baseUniq(arrays[0]) : [];
  2053. }
  2054. var index = -1, result2 = Array2(length);
  2055. while (++index < length) {
  2056. var array = arrays[index], othIndex = -1;
  2057. while (++othIndex < length) {
  2058. if (othIndex != index) {
  2059. result2[index] = baseDifference(result2[index] || array, arrays[othIndex], iteratee2, comparator);
  2060. }
  2061. }
  2062. }
  2063. return baseUniq(baseFlatten(result2, 1), iteratee2, comparator);
  2064. }
  2065. function baseZipObject(props, values2, assignFunc) {
  2066. var index = -1, length = props.length, valsLength = values2.length, result2 = {};
  2067. while (++index < length) {
  2068. var value = index < valsLength ? values2[index] : undefined;
  2069. assignFunc(result2, props[index], value);
  2070. }
  2071. return result2;
  2072. }
  2073. function castArrayLikeObject(value) {
  2074. return isArrayLikeObject(value) ? value : [];
  2075. }
  2076. function castFunction(value) {
  2077. return typeof value == "function" ? value : identity;
  2078. }
  2079. function castPath(value, object) {
  2080. if (isArray(value)) {
  2081. return value;
  2082. }
  2083. return isKey(value, object) ? [value] : stringToPath(toString(value));
  2084. }
  2085. var castRest = baseRest;
  2086. function castSlice(array, start, end) {
  2087. var length = array.length;
  2088. end = end === undefined ? length : end;
  2089. return !start && end >= length ? array : baseSlice(array, start, end);
  2090. }
  2091. var clearTimeout2 = ctxClearTimeout || function(id) {
  2092. return root.clearTimeout(id);
  2093. };
  2094. function cloneBuffer(buffer, isDeep) {
  2095. if (isDeep) {
  2096. return buffer.slice();
  2097. }
  2098. var length = buffer.length, result2 = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
  2099. buffer.copy(result2);
  2100. return result2;
  2101. }
  2102. function cloneArrayBuffer(arrayBuffer) {
  2103. var result2 = new arrayBuffer.constructor(arrayBuffer.byteLength);
  2104. new Uint8Array2(result2).set(new Uint8Array2(arrayBuffer));
  2105. return result2;
  2106. }
  2107. function cloneDataView(dataView, isDeep) {
  2108. var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
  2109. return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
  2110. }
  2111. function cloneRegExp(regexp) {
  2112. var result2 = new regexp.constructor(regexp.source, reFlags.exec(regexp));
  2113. result2.lastIndex = regexp.lastIndex;
  2114. return result2;
  2115. }
  2116. function cloneSymbol(symbol) {
  2117. return symbolValueOf ? Object2(symbolValueOf.call(symbol)) : {};
  2118. }
  2119. function cloneTypedArray(typedArray, isDeep) {
  2120. var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
  2121. return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
  2122. }
  2123. function compareAscending(value, other) {
  2124. if (value !== other) {
  2125. var valIsDefined = value !== undefined, valIsNull = value === null, valIsReflexive = value === value, valIsSymbol = isSymbol(value);
  2126. var othIsDefined = other !== undefined, othIsNull = other === null, othIsReflexive = other === other, othIsSymbol = isSymbol(other);
  2127. if (!othIsNull && !othIsSymbol && !valIsSymbol && value > other || valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol || valIsNull && othIsDefined && othIsReflexive || !valIsDefined && othIsReflexive || !valIsReflexive) {
  2128. return 1;
  2129. }
  2130. if (!valIsNull && !valIsSymbol && !othIsSymbol && value < other || othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol || othIsNull && valIsDefined && valIsReflexive || !othIsDefined && valIsReflexive || !othIsReflexive) {
  2131. return -1;
  2132. }
  2133. }
  2134. return 0;
  2135. }
  2136. function compareMultiple(object, other, orders) {
  2137. var index = -1, objCriteria = object.criteria, othCriteria = other.criteria, length = objCriteria.length, ordersLength = orders.length;
  2138. while (++index < length) {
  2139. var result2 = compareAscending(objCriteria[index], othCriteria[index]);
  2140. if (result2) {
  2141. if (index >= ordersLength) {
  2142. return result2;
  2143. }
  2144. var order = orders[index];
  2145. return result2 * (order == "desc" ? -1 : 1);
  2146. }
  2147. }
  2148. return object.index - other.index;
  2149. }
  2150. function composeArgs(args, partials, holders, isCurried) {
  2151. var argsIndex = -1, argsLength = args.length, holdersLength = holders.length, leftIndex = -1, leftLength = partials.length, rangeLength = nativeMax(argsLength - holdersLength, 0), result2 = Array2(leftLength + rangeLength), isUncurried = !isCurried;
  2152. while (++leftIndex < leftLength) {
  2153. result2[leftIndex] = partials[leftIndex];
  2154. }
  2155. while (++argsIndex < holdersLength) {
  2156. if (isUncurried || argsIndex < argsLength) {
  2157. result2[holders[argsIndex]] = args[argsIndex];
  2158. }
  2159. }
  2160. while (rangeLength--) {
  2161. result2[leftIndex++] = args[argsIndex++];
  2162. }
  2163. return result2;
  2164. }
  2165. function composeArgsRight(args, partials, holders, isCurried) {
  2166. var argsIndex = -1, argsLength = args.length, holdersIndex = -1, holdersLength = holders.length, rightIndex = -1, rightLength = partials.length, rangeLength = nativeMax(argsLength - holdersLength, 0), result2 = Array2(rangeLength + rightLength), isUncurried = !isCurried;
  2167. while (++argsIndex < rangeLength) {
  2168. result2[argsIndex] = args[argsIndex];
  2169. }
  2170. var offset = argsIndex;
  2171. while (++rightIndex < rightLength) {
  2172. result2[offset + rightIndex] = partials[rightIndex];
  2173. }
  2174. while (++holdersIndex < holdersLength) {
  2175. if (isUncurried || argsIndex < argsLength) {
  2176. result2[offset + holders[holdersIndex]] = args[argsIndex++];
  2177. }
  2178. }
  2179. return result2;
  2180. }
  2181. function copyArray(source, array) {
  2182. var index = -1, length = source.length;
  2183. array || (array = Array2(length));
  2184. while (++index < length) {
  2185. array[index] = source[index];
  2186. }
  2187. return array;
  2188. }
  2189. function copyObject(source, props, object, customizer) {
  2190. var isNew = !object;
  2191. object || (object = {});
  2192. var index = -1, length = props.length;
  2193. while (++index < length) {
  2194. var key = props[index];
  2195. var newValue = customizer ? customizer(object[key], source[key], key, object, source) : undefined;
  2196. if (newValue === undefined) {
  2197. newValue = source[key];
  2198. }
  2199. if (isNew) {
  2200. baseAssignValue(object, key, newValue);
  2201. } else {
  2202. assignValue(object, key, newValue);
  2203. }
  2204. }
  2205. return object;
  2206. }
  2207. function copySymbols(source, object) {
  2208. return copyObject(source, getSymbols(source), object);
  2209. }
  2210. function copySymbolsIn(source, object) {
  2211. return copyObject(source, getSymbolsIn(source), object);
  2212. }
  2213. function createAggregator(setter, initializer) {
  2214. return function(collection, iteratee2) {
  2215. var func = isArray(collection) ? arrayAggregator : baseAggregator, accumulator = initializer ? initializer() : {};
  2216. return func(collection, setter, getIteratee(iteratee2, 2), accumulator);
  2217. };
  2218. }
  2219. function createAssigner(assigner) {
  2220. return baseRest(function(object, sources) {
  2221. var index = -1, length = sources.length, customizer = length > 1 ? sources[length - 1] : undefined, guard = length > 2 ? sources[2] : undefined;
  2222. customizer = assigner.length > 3 && typeof customizer == "function" ? (length--, customizer) : undefined;
  2223. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  2224. customizer = length < 3 ? undefined : customizer;
  2225. length = 1;
  2226. }
  2227. object = Object2(object);
  2228. while (++index < length) {
  2229. var source = sources[index];
  2230. if (source) {
  2231. assigner(object, source, index, customizer);
  2232. }
  2233. }
  2234. return object;
  2235. });
  2236. }
  2237. function createBaseEach(eachFunc, fromRight) {
  2238. return function(collection, iteratee2) {
  2239. if (collection == null) {
  2240. return collection;
  2241. }
  2242. if (!isArrayLike(collection)) {
  2243. return eachFunc(collection, iteratee2);
  2244. }
  2245. var length = collection.length, index = fromRight ? length : -1, iterable = Object2(collection);
  2246. while (fromRight ? index-- : ++index < length) {
  2247. if (iteratee2(iterable[index], index, iterable) === false) {
  2248. break;
  2249. }
  2250. }
  2251. return collection;
  2252. };
  2253. }
  2254. function createBaseFor(fromRight) {
  2255. return function(object, iteratee2, keysFunc) {
  2256. var index = -1, iterable = Object2(object), props = keysFunc(object), length = props.length;
  2257. while (length--) {
  2258. var key = props[fromRight ? length : ++index];
  2259. if (iteratee2(iterable[key], key, iterable) === false) {
  2260. break;
  2261. }
  2262. }
  2263. return object;
  2264. };
  2265. }
  2266. function createBind(func, bitmask, thisArg) {
  2267. var isBind = bitmask & WRAP_BIND_FLAG, Ctor = createCtor(func);
  2268. function wrapper() {
  2269. var fn = this && this !== root && this instanceof wrapper ? Ctor : func;
  2270. return fn.apply(isBind ? thisArg : this, arguments);
  2271. }
  2272. return wrapper;
  2273. }
  2274. function createCaseFirst(methodName) {
  2275. return function(string) {
  2276. string = toString(string);
  2277. var strSymbols = hasUnicode(string) ? stringToArray(string) : undefined;
  2278. var chr = strSymbols ? strSymbols[0] : string.charAt(0);
  2279. var trailing = strSymbols ? castSlice(strSymbols, 1).join("") : string.slice(1);
  2280. return chr[methodName]() + trailing;
  2281. };
  2282. }
  2283. function createCompounder(callback) {
  2284. return function(string) {
  2285. return arrayReduce(words(deburr(string).replace(reApos, "")), callback, "");
  2286. };
  2287. }
  2288. function createCtor(Ctor) {
  2289. return function() {
  2290. var args = arguments;
  2291. switch (args.length) {
  2292. case 0:
  2293. return new Ctor();
  2294. case 1:
  2295. return new Ctor(args[0]);
  2296. case 2:
  2297. return new Ctor(args[0], args[1]);
  2298. case 3:
  2299. return new Ctor(args[0], args[1], args[2]);
  2300. case 4:
  2301. return new Ctor(args[0], args[1], args[2], args[3]);
  2302. case 5:
  2303. return new Ctor(args[0], args[1], args[2], args[3], args[4]);
  2304. case 6:
  2305. return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
  2306. case 7:
  2307. return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
  2308. }
  2309. var thisBinding = baseCreate(Ctor.prototype), result2 = Ctor.apply(thisBinding, args);
  2310. return isObject(result2) ? result2 : thisBinding;
  2311. };
  2312. }
  2313. function createCurry(func, bitmask, arity) {
  2314. var Ctor = createCtor(func);
  2315. function wrapper() {
  2316. var length = arguments.length, args = Array2(length), index = length, placeholder = getHolder(wrapper);
  2317. while (index--) {
  2318. args[index] = arguments[index];
  2319. }
  2320. var holders = length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder ? [] : replaceHolders(args, placeholder);
  2321. length -= holders.length;
  2322. if (length < arity) {
  2323. return createRecurry(
  2324. func,
  2325. bitmask,
  2326. createHybrid,
  2327. wrapper.placeholder,
  2328. undefined,
  2329. args,
  2330. holders,
  2331. undefined,
  2332. undefined,
  2333. arity - length
  2334. );
  2335. }
  2336. var fn = this && this !== root && this instanceof wrapper ? Ctor : func;
  2337. return apply(fn, this, args);
  2338. }
  2339. return wrapper;
  2340. }
  2341. function createFind(findIndexFunc) {
  2342. return function(collection, predicate, fromIndex) {
  2343. var iterable = Object2(collection);
  2344. if (!isArrayLike(collection)) {
  2345. var iteratee2 = getIteratee(predicate, 3);
  2346. collection = keys(collection);
  2347. predicate = function(key) {
  2348. return iteratee2(iterable[key], key, iterable);
  2349. };
  2350. }
  2351. var index = findIndexFunc(collection, predicate, fromIndex);
  2352. return index > -1 ? iterable[iteratee2 ? collection[index] : index] : undefined;
  2353. };
  2354. }
  2355. function createFlow(fromRight) {
  2356. return flatRest(function(funcs) {
  2357. var length = funcs.length, index = length, prereq = LodashWrapper.prototype.thru;
  2358. if (fromRight) {
  2359. funcs.reverse();
  2360. }
  2361. while (index--) {
  2362. var func = funcs[index];
  2363. if (typeof func != "function") {
  2364. throw new TypeError2(FUNC_ERROR_TEXT);
  2365. }
  2366. if (prereq && !wrapper && getFuncName(func) == "wrapper") {
  2367. var wrapper = new LodashWrapper([], true);
  2368. }
  2369. }
  2370. index = wrapper ? index : length;
  2371. while (++index < length) {
  2372. func = funcs[index];
  2373. var funcName = getFuncName(func), data = funcName == "wrapper" ? getData(func) : undefined;
  2374. if (data && isLaziable(data[0]) && data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) && !data[4].length && data[9] == 1) {
  2375. wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);
  2376. } else {
  2377. wrapper = func.length == 1 && isLaziable(func) ? wrapper[funcName]() : wrapper.thru(func);
  2378. }
  2379. }
  2380. return function() {
  2381. var args = arguments, value = args[0];
  2382. if (wrapper && args.length == 1 && isArray(value)) {
  2383. return wrapper.plant(value).value();
  2384. }
  2385. var index2 = 0, result2 = length ? funcs[index2].apply(this, args) : value;
  2386. while (++index2 < length) {
  2387. result2 = funcs[index2].call(this, result2);
  2388. }
  2389. return result2;
  2390. };
  2391. });
  2392. }
  2393. function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary2, arity) {
  2394. var isAry = bitmask & WRAP_ARY_FLAG, isBind = bitmask & WRAP_BIND_FLAG, isBindKey = bitmask & WRAP_BIND_KEY_FLAG, isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG), isFlip = bitmask & WRAP_FLIP_FLAG, Ctor = isBindKey ? undefined : createCtor(func);
  2395. function wrapper() {
  2396. var length = arguments.length, args = Array2(length), index = length;
  2397. while (index--) {
  2398. args[index] = arguments[index];
  2399. }
  2400. if (isCurried) {
  2401. var placeholder = getHolder(wrapper), holdersCount = countHolders(args, placeholder);
  2402. }
  2403. if (partials) {
  2404. args = composeArgs(args, partials, holders, isCurried);
  2405. }
  2406. if (partialsRight) {
  2407. args = composeArgsRight(args, partialsRight, holdersRight, isCurried);
  2408. }
  2409. length -= holdersCount;
  2410. if (isCurried && length < arity) {
  2411. var newHolders = replaceHolders(args, placeholder);
  2412. return createRecurry(
  2413. func,
  2414. bitmask,
  2415. createHybrid,
  2416. wrapper.placeholder,
  2417. thisArg,
  2418. args,
  2419. newHolders,
  2420. argPos,
  2421. ary2,
  2422. arity - length
  2423. );
  2424. }
  2425. var thisBinding = isBind ? thisArg : this, fn = isBindKey ? thisBinding[func] : func;
  2426. length = args.length;
  2427. if (argPos) {
  2428. args = reorder(args, argPos);
  2429. } else if (isFlip && length > 1) {
  2430. args.reverse();
  2431. }
  2432. if (isAry && ary2 < length) {
  2433. args.length = ary2;
  2434. }
  2435. if (this && this !== root && this instanceof wrapper) {
  2436. fn = Ctor || createCtor(fn);
  2437. }
  2438. return fn.apply(thisBinding, args);
  2439. }
  2440. return wrapper;
  2441. }
  2442. function createInverter(setter, toIteratee) {
  2443. return function(object, iteratee2) {
  2444. return baseInverter(object, setter, toIteratee(iteratee2), {});
  2445. };
  2446. }
  2447. function createMathOperation(operator, defaultValue) {
  2448. return function(value, other) {
  2449. var result2;
  2450. if (value === undefined && other === undefined) {
  2451. return defaultValue;
  2452. }
  2453. if (value !== undefined) {
  2454. result2 = value;
  2455. }
  2456. if (other !== undefined) {
  2457. if (result2 === undefined) {
  2458. return other;
  2459. }
  2460. if (typeof value == "string" || typeof other == "string") {
  2461. value = baseToString(value);
  2462. other = baseToString(other);
  2463. } else {
  2464. value = baseToNumber(value);
  2465. other = baseToNumber(other);
  2466. }
  2467. result2 = operator(value, other);
  2468. }
  2469. return result2;
  2470. };
  2471. }
  2472. function createOver(arrayFunc) {
  2473. return flatRest(function(iteratees) {
  2474. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  2475. return baseRest(function(args) {
  2476. var thisArg = this;
  2477. return arrayFunc(iteratees, function(iteratee2) {
  2478. return apply(iteratee2, thisArg, args);
  2479. });
  2480. });
  2481. });
  2482. }
  2483. function createPadding(length, chars) {
  2484. chars = chars === undefined ? " " : baseToString(chars);
  2485. var charsLength = chars.length;
  2486. if (charsLength < 2) {
  2487. return charsLength ? baseRepeat(chars, length) : chars;
  2488. }
  2489. var result2 = baseRepeat(chars, nativeCeil(length / stringSize(chars)));
  2490. return hasUnicode(chars) ? castSlice(stringToArray(result2), 0, length).join("") : result2.slice(0, length);
  2491. }
  2492. function createPartial(func, bitmask, thisArg, partials) {
  2493. var isBind = bitmask & WRAP_BIND_FLAG, Ctor = createCtor(func);
  2494. function wrapper() {
  2495. var argsIndex = -1, argsLength = arguments.length, leftIndex = -1, leftLength = partials.length, args = Array2(leftLength + argsLength), fn = this && this !== root && this instanceof wrapper ? Ctor : func;
  2496. while (++leftIndex < leftLength) {
  2497. args[leftIndex] = partials[leftIndex];
  2498. }
  2499. while (argsLength--) {
  2500. args[leftIndex++] = arguments[++argsIndex];
  2501. }
  2502. return apply(fn, isBind ? thisArg : this, args);
  2503. }
  2504. return wrapper;
  2505. }
  2506. function createRange(fromRight) {
  2507. return function(start, end, step) {
  2508. if (step && typeof step != "number" && isIterateeCall(start, end, step)) {
  2509. end = step = undefined;
  2510. }
  2511. start = toFinite(start);
  2512. if (end === undefined) {
  2513. end = start;
  2514. start = 0;
  2515. } else {
  2516. end = toFinite(end);
  2517. }
  2518. step = step === undefined ? start < end ? 1 : -1 : toFinite(step);
  2519. return baseRange(start, end, step, fromRight);
  2520. };
  2521. }
  2522. function createRelationalOperation(operator) {
  2523. return function(value, other) {
  2524. if (!(typeof value == "string" && typeof other == "string")) {
  2525. value = toNumber(value);
  2526. other = toNumber(other);
  2527. }
  2528. return operator(value, other);
  2529. };
  2530. }
  2531. function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary2, arity) {
  2532. var isCurry = bitmask & WRAP_CURRY_FLAG, newHolders = isCurry ? holders : undefined, newHoldersRight = isCurry ? undefined : holders, newPartials = isCurry ? partials : undefined, newPartialsRight = isCurry ? undefined : partials;
  2533. bitmask |= isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG;
  2534. bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);
  2535. if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {
  2536. bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);
  2537. }
  2538. var newData = [
  2539. func,
  2540. bitmask,
  2541. thisArg,
  2542. newPartials,
  2543. newHolders,
  2544. newPartialsRight,
  2545. newHoldersRight,
  2546. argPos,
  2547. ary2,
  2548. arity
  2549. ];
  2550. var result2 = wrapFunc.apply(undefined, newData);
  2551. if (isLaziable(func)) {
  2552. setData(result2, newData);
  2553. }
  2554. result2.placeholder = placeholder;
  2555. return setWrapToString(result2, func, bitmask);
  2556. }
  2557. function createRound(methodName) {
  2558. var func = Math2[methodName];
  2559. return function(number, precision) {
  2560. number = toNumber(number);
  2561. precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);
  2562. if (precision && nativeIsFinite(number)) {
  2563. var pair = (toString(number) + "e").split("e"), value = func(pair[0] + "e" + (+pair[1] + precision));
  2564. pair = (toString(value) + "e").split("e");
  2565. return +(pair[0] + "e" + (+pair[1] - precision));
  2566. }
  2567. return func(number);
  2568. };
  2569. }
  2570. var createSet = !(Set && 1 / setToArray(new Set([, -0]))[1] == INFINITY) ? noop : function(values2) {
  2571. return new Set(values2);
  2572. };
  2573. function createToPairs(keysFunc) {
  2574. return function(object) {
  2575. var tag = getTag(object);
  2576. if (tag == mapTag) {
  2577. return mapToArray(object);
  2578. }
  2579. if (tag == setTag) {
  2580. return setToPairs(object);
  2581. }
  2582. return baseToPairs(object, keysFunc(object));
  2583. };
  2584. }
  2585. function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary2, arity) {
  2586. var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;
  2587. if (!isBindKey && typeof func != "function") {
  2588. throw new TypeError2(FUNC_ERROR_TEXT);
  2589. }
  2590. var length = partials ? partials.length : 0;
  2591. if (!length) {
  2592. bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);
  2593. partials = holders = undefined;
  2594. }
  2595. ary2 = ary2 === undefined ? ary2 : nativeMax(toInteger(ary2), 0);
  2596. arity = arity === undefined ? arity : toInteger(arity);
  2597. length -= holders ? holders.length : 0;
  2598. if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {
  2599. var partialsRight = partials, holdersRight = holders;
  2600. partials = holders = undefined;
  2601. }
  2602. var data = isBindKey ? undefined : getData(func);
  2603. var newData = [
  2604. func,
  2605. bitmask,
  2606. thisArg,
  2607. partials,
  2608. holders,
  2609. partialsRight,
  2610. holdersRight,
  2611. argPos,
  2612. ary2,
  2613. arity
  2614. ];
  2615. if (data) {
  2616. mergeData(newData, data);
  2617. }
  2618. func = newData[0];
  2619. bitmask = newData[1];
  2620. thisArg = newData[2];
  2621. partials = newData[3];
  2622. holders = newData[4];
  2623. arity = newData[9] = newData[9] === undefined ? isBindKey ? 0 : func.length : nativeMax(newData[9] - length, 0);
  2624. if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {
  2625. bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);
  2626. }
  2627. if (!bitmask || bitmask == WRAP_BIND_FLAG) {
  2628. var result2 = createBind(func, bitmask, thisArg);
  2629. } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {
  2630. result2 = createCurry(func, bitmask, arity);
  2631. } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {
  2632. result2 = createPartial(func, bitmask, thisArg, partials);
  2633. } else {
  2634. result2 = createHybrid.apply(undefined, newData);
  2635. }
  2636. var setter = data ? baseSetData : setData;
  2637. return setWrapToString(setter(result2, newData), func, bitmask);
  2638. }
  2639. function customDefaultsAssignIn(objValue, srcValue, key, object) {
  2640. if (objValue === undefined || eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key)) {
  2641. return srcValue;
  2642. }
  2643. return objValue;
  2644. }
  2645. function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {
  2646. if (isObject(objValue) && isObject(srcValue)) {
  2647. stack.set(srcValue, objValue);
  2648. baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack);
  2649. stack["delete"](srcValue);
  2650. }
  2651. return objValue;
  2652. }
  2653. function customOmitClone(value) {
  2654. return isPlainObject(value) ? undefined : value;
  2655. }
  2656. function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
  2657. var isPartial = bitmask & COMPARE_PARTIAL_FLAG, arrLength = array.length, othLength = other.length;
  2658. if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
  2659. return false;
  2660. }
  2661. var arrStacked = stack.get(array);
  2662. var othStacked = stack.get(other);
  2663. if (arrStacked && othStacked) {
  2664. return arrStacked == other && othStacked == array;
  2665. }
  2666. var index = -1, result2 = true, seen = bitmask & COMPARE_UNORDERED_FLAG ? new SetCache() : undefined;
  2667. stack.set(array, other);
  2668. stack.set(other, array);
  2669. while (++index < arrLength) {
  2670. var arrValue = array[index], othValue = other[index];
  2671. if (customizer) {
  2672. var compared = isPartial ? customizer(othValue, arrValue, index, other, array, stack) : customizer(arrValue, othValue, index, array, other, stack);
  2673. }
  2674. if (compared !== undefined) {
  2675. if (compared) {
  2676. continue;
  2677. }
  2678. result2 = false;
  2679. break;
  2680. }
  2681. if (seen) {
  2682. if (!arraySome(other, function(othValue2, othIndex) {
  2683. if (!cacheHas(seen, othIndex) && (arrValue === othValue2 || equalFunc(arrValue, othValue2, bitmask, customizer, stack))) {
  2684. return seen.push(othIndex);
  2685. }
  2686. })) {
  2687. result2 = false;
  2688. break;
  2689. }
  2690. } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
  2691. result2 = false;
  2692. break;
  2693. }
  2694. }
  2695. stack["delete"](array);
  2696. stack["delete"](other);
  2697. return result2;
  2698. }
  2699. function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
  2700. switch (tag) {
  2701. case dataViewTag:
  2702. if (object.byteLength != other.byteLength || object.byteOffset != other.byteOffset) {
  2703. return false;
  2704. }
  2705. object = object.buffer;
  2706. other = other.buffer;
  2707. case arrayBufferTag:
  2708. if (object.byteLength != other.byteLength || !equalFunc(new Uint8Array2(object), new Uint8Array2(other))) {
  2709. return false;
  2710. }
  2711. return true;
  2712. case boolTag:
  2713. case dateTag:
  2714. case numberTag:
  2715. return eq(+object, +other);
  2716. case errorTag:
  2717. return object.name == other.name && object.message == other.message;
  2718. case regexpTag:
  2719. case stringTag:
  2720. return object == other + "";
  2721. case mapTag:
  2722. var convert = mapToArray;
  2723. case setTag:
  2724. var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
  2725. convert || (convert = setToArray);
  2726. if (object.size != other.size && !isPartial) {
  2727. return false;
  2728. }
  2729. var stacked = stack.get(object);
  2730. if (stacked) {
  2731. return stacked == other;
  2732. }
  2733. bitmask |= COMPARE_UNORDERED_FLAG;
  2734. stack.set(object, other);
  2735. var result2 = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
  2736. stack["delete"](object);
  2737. return result2;
  2738. case symbolTag:
  2739. if (symbolValueOf) {
  2740. return symbolValueOf.call(object) == symbolValueOf.call(other);
  2741. }
  2742. }
  2743. return false;
  2744. }
  2745. function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
  2746. var isPartial = bitmask & COMPARE_PARTIAL_FLAG, objProps = getAllKeys(object), objLength = objProps.length, othProps = getAllKeys(other), othLength = othProps.length;
  2747. if (objLength != othLength && !isPartial) {
  2748. return false;
  2749. }
  2750. var index = objLength;
  2751. while (index--) {
  2752. var key = objProps[index];
  2753. if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
  2754. return false;
  2755. }
  2756. }
  2757. var objStacked = stack.get(object);
  2758. var othStacked = stack.get(other);
  2759. if (objStacked && othStacked) {
  2760. return objStacked == other && othStacked == object;
  2761. }
  2762. var result2 = true;
  2763. stack.set(object, other);
  2764. stack.set(other, object);
  2765. var skipCtor = isPartial;
  2766. while (++index < objLength) {
  2767. key = objProps[index];
  2768. var objValue = object[key], othValue = other[key];
  2769. if (customizer) {
  2770. var compared = isPartial ? customizer(othValue, objValue, key, other, object, stack) : customizer(objValue, othValue, key, object, other, stack);
  2771. }
  2772. if (!(compared === undefined ? objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack) : compared)) {
  2773. result2 = false;
  2774. break;
  2775. }
  2776. skipCtor || (skipCtor = key == "constructor");
  2777. }
  2778. if (result2 && !skipCtor) {
  2779. var objCtor = object.constructor, othCtor = other.constructor;
  2780. if (objCtor != othCtor && ("constructor" in object && "constructor" in other) && !(typeof objCtor == "function" && objCtor instanceof objCtor && typeof othCtor == "function" && othCtor instanceof othCtor)) {
  2781. result2 = false;
  2782. }
  2783. }
  2784. stack["delete"](object);
  2785. stack["delete"](other);
  2786. return result2;
  2787. }
  2788. function flatRest(func) {
  2789. return setToString(overRest(func, undefined, flatten), func + "");
  2790. }
  2791. function getAllKeys(object) {
  2792. return baseGetAllKeys(object, keys, getSymbols);
  2793. }
  2794. function getAllKeysIn(object) {
  2795. return baseGetAllKeys(object, keysIn, getSymbolsIn);
  2796. }
  2797. var getData = !metaMap ? noop : function(func) {
  2798. return metaMap.get(func);
  2799. };
  2800. function getFuncName(func) {
  2801. var result2 = func.name + "", array = realNames[result2], length = hasOwnProperty.call(realNames, result2) ? array.length : 0;
  2802. while (length--) {
  2803. var data = array[length], otherFunc = data.func;
  2804. if (otherFunc == null || otherFunc == func) {
  2805. return data.name;
  2806. }
  2807. }
  2808. return result2;
  2809. }
  2810. function getHolder(func) {
  2811. var object = hasOwnProperty.call(lodash2, "placeholder") ? lodash2 : func;
  2812. return object.placeholder;
  2813. }
  2814. function getIteratee() {
  2815. var result2 = lodash2.iteratee || iteratee;
  2816. result2 = result2 === iteratee ? baseIteratee : result2;
  2817. return arguments.length ? result2(arguments[0], arguments[1]) : result2;
  2818. }
  2819. function getMapData(map2, key) {
  2820. var data = map2.__data__;
  2821. return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
  2822. }
  2823. function getMatchData(object) {
  2824. var result2 = keys(object), length = result2.length;
  2825. while (length--) {
  2826. var key = result2[length], value = object[key];
  2827. result2[length] = [key, value, isStrictComparable(value)];
  2828. }
  2829. return result2;
  2830. }
  2831. function getNative(object, key) {
  2832. var value = getValue(object, key);
  2833. return baseIsNative(value) ? value : undefined;
  2834. }
  2835. function getRawTag(value) {
  2836. var isOwn = hasOwnProperty.call(value, symToStringTag), tag = value[symToStringTag];
  2837. try {
  2838. value[symToStringTag] = undefined;
  2839. var unmasked = true;
  2840. } catch (e) {
  2841. }
  2842. var result2 = nativeObjectToString.call(value);
  2843. if (unmasked) {
  2844. if (isOwn) {
  2845. value[symToStringTag] = tag;
  2846. } else {
  2847. delete value[symToStringTag];
  2848. }
  2849. }
  2850. return result2;
  2851. }
  2852. var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
  2853. if (object == null) {
  2854. return [];
  2855. }
  2856. object = Object2(object);
  2857. return arrayFilter(nativeGetSymbols(object), function(symbol) {
  2858. return propertyIsEnumerable.call(object, symbol);
  2859. });
  2860. };
  2861. var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
  2862. var result2 = [];
  2863. while (object) {
  2864. arrayPush(result2, getSymbols(object));
  2865. object = getPrototype(object);
  2866. }
  2867. return result2;
  2868. };
  2869. var getTag = baseGetTag;
  2870. if (DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag || Map && getTag(new Map()) != mapTag || Promise2 && getTag(Promise2.resolve()) != promiseTag || Set && getTag(new Set()) != setTag || WeakMap && getTag(new WeakMap()) != weakMapTag) {
  2871. getTag = function(value) {
  2872. var result2 = baseGetTag(value), Ctor = result2 == objectTag ? value.constructor : undefined, ctorString = Ctor ? toSource(Ctor) : "";
  2873. if (ctorString) {
  2874. switch (ctorString) {
  2875. case dataViewCtorString:
  2876. return dataViewTag;
  2877. case mapCtorString:
  2878. return mapTag;
  2879. case promiseCtorString:
  2880. return promiseTag;
  2881. case setCtorString:
  2882. return setTag;
  2883. case weakMapCtorString:
  2884. return weakMapTag;
  2885. }
  2886. }
  2887. return result2;
  2888. };
  2889. }
  2890. function getView(start, end, transforms) {
  2891. var index = -1, length = transforms.length;
  2892. while (++index < length) {
  2893. var data = transforms[index], size2 = data.size;
  2894. switch (data.type) {
  2895. case "drop":
  2896. start += size2;
  2897. break;
  2898. case "dropRight":
  2899. end -= size2;
  2900. break;
  2901. case "take":
  2902. end = nativeMin(end, start + size2);
  2903. break;
  2904. case "takeRight":
  2905. start = nativeMax(start, end - size2);
  2906. break;
  2907. }
  2908. }
  2909. return { "start": start, "end": end };
  2910. }
  2911. function getWrapDetails(source) {
  2912. var match = source.match(reWrapDetails);
  2913. return match ? match[1].split(reSplitDetails) : [];
  2914. }
  2915. function hasPath(object, path, hasFunc) {
  2916. path = castPath(path, object);
  2917. var index = -1, length = path.length, result2 = false;
  2918. while (++index < length) {
  2919. var key = toKey(path[index]);
  2920. if (!(result2 = object != null && hasFunc(object, key))) {
  2921. break;
  2922. }
  2923. object = object[key];
  2924. }
  2925. if (result2 || ++index != length) {
  2926. return result2;
  2927. }
  2928. length = object == null ? 0 : object.length;
  2929. return !!length && isLength(length) && isIndex(key, length) && (isArray(object) || isArguments(object));
  2930. }
  2931. function initCloneArray(array) {
  2932. var length = array.length, result2 = new array.constructor(length);
  2933. if (length && typeof array[0] == "string" && hasOwnProperty.call(array, "index")) {
  2934. result2.index = array.index;
  2935. result2.input = array.input;
  2936. }
  2937. return result2;
  2938. }
  2939. function initCloneObject(object) {
  2940. return typeof object.constructor == "function" && !isPrototype(object) ? baseCreate(getPrototype(object)) : {};
  2941. }
  2942. function initCloneByTag(object, tag, isDeep) {
  2943. var Ctor = object.constructor;
  2944. switch (tag) {
  2945. case arrayBufferTag:
  2946. return cloneArrayBuffer(object);
  2947. case boolTag:
  2948. case dateTag:
  2949. return new Ctor(+object);
  2950. case dataViewTag:
  2951. return cloneDataView(object, isDeep);
  2952. case float32Tag:
  2953. case float64Tag:
  2954. case int8Tag:
  2955. case int16Tag:
  2956. case int32Tag:
  2957. case uint8Tag:
  2958. case uint8ClampedTag:
  2959. case uint16Tag:
  2960. case uint32Tag:
  2961. return cloneTypedArray(object, isDeep);
  2962. case mapTag:
  2963. return new Ctor();
  2964. case numberTag:
  2965. case stringTag:
  2966. return new Ctor(object);
  2967. case regexpTag:
  2968. return cloneRegExp(object);
  2969. case setTag:
  2970. return new Ctor();
  2971. case symbolTag:
  2972. return cloneSymbol(object);
  2973. }
  2974. }
  2975. function insertWrapDetails(source, details) {
  2976. var length = details.length;
  2977. if (!length) {
  2978. return source;
  2979. }
  2980. var lastIndex = length - 1;
  2981. details[lastIndex] = (length > 1 ? "& " : "") + details[lastIndex];
  2982. details = details.join(length > 2 ? ", " : " ");
  2983. return source.replace(reWrapComment, "{\n/* [wrapped with " + details + "] */\n");
  2984. }
  2985. function isFlattenable(value) {
  2986. return isArray(value) || isArguments(value) || !!(spreadableSymbol && value && value[spreadableSymbol]);
  2987. }
  2988. function isIndex(value, length) {
  2989. var type = typeof value;
  2990. length = length == null ? MAX_SAFE_INTEGER : length;
  2991. return !!length && (type == "number" || type != "symbol" && reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length);
  2992. }
  2993. function isIterateeCall(value, index, object) {
  2994. if (!isObject(object)) {
  2995. return false;
  2996. }
  2997. var type = typeof index;
  2998. if (type == "number" ? isArrayLike(object) && isIndex(index, object.length) : type == "string" && index in object) {
  2999. return eq(object[index], value);
  3000. }
  3001. return false;
  3002. }
  3003. function isKey(value, object) {
  3004. if (isArray(value)) {
  3005. return false;
  3006. }
  3007. var type = typeof value;
  3008. if (type == "number" || type == "symbol" || type == "boolean" || value == null || isSymbol(value)) {
  3009. return true;
  3010. }
  3011. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || object != null && value in Object2(object);
  3012. }
  3013. function isKeyable(value) {
  3014. var type = typeof value;
  3015. return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null;
  3016. }
  3017. function isLaziable(func) {
  3018. var funcName = getFuncName(func), other = lodash2[funcName];
  3019. if (typeof other != "function" || !(funcName in LazyWrapper.prototype)) {
  3020. return false;
  3021. }
  3022. if (func === other) {
  3023. return true;
  3024. }
  3025. var data = getData(other);
  3026. return !!data && func === data[0];
  3027. }
  3028. function isMasked(func) {
  3029. return !!maskSrcKey && maskSrcKey in func;
  3030. }
  3031. var isMaskable = coreJsData ? isFunction : stubFalse;
  3032. function isPrototype(value) {
  3033. var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto;
  3034. return value === proto;
  3035. }
  3036. function isStrictComparable(value) {
  3037. return value === value && !isObject(value);
  3038. }
  3039. function matchesStrictComparable(key, srcValue) {
  3040. return function(object) {
  3041. if (object == null) {
  3042. return false;
  3043. }
  3044. return object[key] === srcValue && (srcValue !== undefined || key in Object2(object));
  3045. };
  3046. }
  3047. function memoizeCapped(func) {
  3048. var result2 = memoize(func, function(key) {
  3049. if (cache.size === MAX_MEMOIZE_SIZE) {
  3050. cache.clear();
  3051. }
  3052. return key;
  3053. });
  3054. var cache = result2.cache;
  3055. return result2;
  3056. }
  3057. function mergeData(data, source) {
  3058. var bitmask = data[1], srcBitmask = source[1], newBitmask = bitmask | srcBitmask, isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);
  3059. var isCombo = srcBitmask == WRAP_ARY_FLAG && bitmask == WRAP_CURRY_FLAG || srcBitmask == WRAP_ARY_FLAG && bitmask == WRAP_REARG_FLAG && data[7].length <= source[8] || srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG) && source[7].length <= source[8] && bitmask == WRAP_CURRY_FLAG;
  3060. if (!(isCommon || isCombo)) {
  3061. return data;
  3062. }
  3063. if (srcBitmask & WRAP_BIND_FLAG) {
  3064. data[2] = source[2];
  3065. newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;
  3066. }
  3067. var value = source[3];
  3068. if (value) {
  3069. var partials = data[3];
  3070. data[3] = partials ? composeArgs(partials, value, source[4]) : value;
  3071. data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];
  3072. }
  3073. value = source[5];
  3074. if (value) {
  3075. partials = data[5];
  3076. data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;
  3077. data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];
  3078. }
  3079. value = source[7];
  3080. if (value) {
  3081. data[7] = value;
  3082. }
  3083. if (srcBitmask & WRAP_ARY_FLAG) {
  3084. data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
  3085. }
  3086. if (data[9] == null) {
  3087. data[9] = source[9];
  3088. }
  3089. data[0] = source[0];
  3090. data[1] = newBitmask;
  3091. return data;
  3092. }
  3093. function nativeKeysIn(object) {
  3094. var result2 = [];
  3095. if (object != null) {
  3096. for (var key in Object2(object)) {
  3097. result2.push(key);
  3098. }
  3099. }
  3100. return result2;
  3101. }
  3102. function objectToString(value) {
  3103. return nativeObjectToString.call(value);
  3104. }
  3105. function overRest(func, start, transform2) {
  3106. start = nativeMax(start === undefined ? func.length - 1 : start, 0);
  3107. return function() {
  3108. var args = arguments, index = -1, length = nativeMax(args.length - start, 0), array = Array2(length);
  3109. while (++index < length) {
  3110. array[index] = args[start + index];
  3111. }
  3112. index = -1;
  3113. var otherArgs = Array2(start + 1);
  3114. while (++index < start) {
  3115. otherArgs[index] = args[index];
  3116. }
  3117. otherArgs[start] = transform2(array);
  3118. return apply(func, this, otherArgs);
  3119. };
  3120. }
  3121. function parent(object, path) {
  3122. return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));
  3123. }
  3124. function reorder(array, indexes) {
  3125. var arrLength = array.length, length = nativeMin(indexes.length, arrLength), oldArray = copyArray(array);
  3126. while (length--) {
  3127. var index = indexes[length];
  3128. array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;
  3129. }
  3130. return array;
  3131. }
  3132. function safeGet(object, key) {
  3133. if (key === "constructor" && typeof object[key] === "function") {
  3134. return;
  3135. }
  3136. if (key == "__proto__") {
  3137. return;
  3138. }
  3139. return object[key];
  3140. }
  3141. var setData = shortOut(baseSetData);
  3142. var setTimeout2 = ctxSetTimeout || function(func, wait) {
  3143. return root.setTimeout(func, wait);
  3144. };
  3145. var setToString = shortOut(baseSetToString);
  3146. function setWrapToString(wrapper, reference, bitmask) {
  3147. var source = reference + "";
  3148. return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));
  3149. }
  3150. function shortOut(func) {
  3151. var count = 0, lastCalled = 0;
  3152. return function() {
  3153. var stamp = nativeNow(), remaining = HOT_SPAN - (stamp - lastCalled);
  3154. lastCalled = stamp;
  3155. if (remaining > 0) {
  3156. if (++count >= HOT_COUNT) {
  3157. return arguments[0];
  3158. }
  3159. } else {
  3160. count = 0;
  3161. }
  3162. return func.apply(undefined, arguments);
  3163. };
  3164. }
  3165. function shuffleSelf(array, size2) {
  3166. var index = -1, length = array.length, lastIndex = length - 1;
  3167. size2 = size2 === undefined ? length : size2;
  3168. while (++index < size2) {
  3169. var rand = baseRandom(index, lastIndex), value = array[rand];
  3170. array[rand] = array[index];
  3171. array[index] = value;
  3172. }
  3173. array.length = size2;
  3174. return array;
  3175. }
  3176. var stringToPath = memoizeCapped(function(string) {
  3177. var result2 = [];
  3178. if (string.charCodeAt(0) === 46) {
  3179. result2.push("");
  3180. }
  3181. string.replace(rePropName, function(match, number, quote, subString) {
  3182. result2.push(quote ? subString.replace(reEscapeChar, "$1") : number || match);
  3183. });
  3184. return result2;
  3185. });
  3186. function toKey(value) {
  3187. if (typeof value == "string" || isSymbol(value)) {
  3188. return value;
  3189. }
  3190. var result2 = value + "";
  3191. return result2 == "0" && 1 / value == -INFINITY ? "-0" : result2;
  3192. }
  3193. function toSource(func) {
  3194. if (func != null) {
  3195. try {
  3196. return funcToString.call(func);
  3197. } catch (e) {
  3198. }
  3199. try {
  3200. return func + "";
  3201. } catch (e) {
  3202. }
  3203. }
  3204. return "";
  3205. }
  3206. function updateWrapDetails(details, bitmask) {
  3207. arrayEach(wrapFlags, function(pair) {
  3208. var value = "_." + pair[0];
  3209. if (bitmask & pair[1] && !arrayIncludes(details, value)) {
  3210. details.push(value);
  3211. }
  3212. });
  3213. return details.sort();
  3214. }
  3215. function wrapperClone(wrapper) {
  3216. if (wrapper instanceof LazyWrapper) {
  3217. return wrapper.clone();
  3218. }
  3219. var result2 = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);
  3220. result2.__actions__ = copyArray(wrapper.__actions__);
  3221. result2.__index__ = wrapper.__index__;
  3222. result2.__values__ = wrapper.__values__;
  3223. return result2;
  3224. }
  3225. function chunk(array, size2, guard) {
  3226. if (guard ? isIterateeCall(array, size2, guard) : size2 === undefined) {
  3227. size2 = 1;
  3228. } else {
  3229. size2 = nativeMax(toInteger(size2), 0);
  3230. }
  3231. var length = array == null ? 0 : array.length;
  3232. if (!length || size2 < 1) {
  3233. return [];
  3234. }
  3235. var index = 0, resIndex = 0, result2 = Array2(nativeCeil(length / size2));
  3236. while (index < length) {
  3237. result2[resIndex++] = baseSlice(array, index, index += size2);
  3238. }
  3239. return result2;
  3240. }
  3241. function compact(array) {
  3242. var index = -1, length = array == null ? 0 : array.length, resIndex = 0, result2 = [];
  3243. while (++index < length) {
  3244. var value = array[index];
  3245. if (value) {
  3246. result2[resIndex++] = value;
  3247. }
  3248. }
  3249. return result2;
  3250. }
  3251. function concat() {
  3252. var length = arguments.length;
  3253. if (!length) {
  3254. return [];
  3255. }
  3256. var args = Array2(length - 1), array = arguments[0], index = length;
  3257. while (index--) {
  3258. args[index - 1] = arguments[index];
  3259. }
  3260. return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1));
  3261. }
  3262. var difference = baseRest(function(array, values2) {
  3263. return isArrayLikeObject(array) ? baseDifference(array, baseFlatten(values2, 1, isArrayLikeObject, true)) : [];
  3264. });
  3265. var differenceBy = baseRest(function(array, values2) {
  3266. var iteratee2 = last(values2);
  3267. if (isArrayLikeObject(iteratee2)) {
  3268. iteratee2 = undefined;
  3269. }
  3270. return isArrayLikeObject(array) ? baseDifference(array, baseFlatten(values2, 1, isArrayLikeObject, true), getIteratee(iteratee2, 2)) : [];
  3271. });
  3272. var differenceWith = baseRest(function(array, values2) {
  3273. var comparator = last(values2);
  3274. if (isArrayLikeObject(comparator)) {
  3275. comparator = undefined;
  3276. }
  3277. return isArrayLikeObject(array) ? baseDifference(array, baseFlatten(values2, 1, isArrayLikeObject, true), undefined, comparator) : [];
  3278. });
  3279. function drop(array, n, guard) {
  3280. var length = array == null ? 0 : array.length;
  3281. if (!length) {
  3282. return [];
  3283. }
  3284. n = guard || n === undefined ? 1 : toInteger(n);
  3285. return baseSlice(array, n < 0 ? 0 : n, length);
  3286. }
  3287. function dropRight(array, n, guard) {
  3288. var length = array == null ? 0 : array.length;
  3289. if (!length) {
  3290. return [];
  3291. }
  3292. n = guard || n === undefined ? 1 : toInteger(n);
  3293. n = length - n;
  3294. return baseSlice(array, 0, n < 0 ? 0 : n);
  3295. }
  3296. function dropRightWhile(array, predicate) {
  3297. return array && array.length ? baseWhile(array, getIteratee(predicate, 3), true, true) : [];
  3298. }
  3299. function dropWhile(array, predicate) {
  3300. return array && array.length ? baseWhile(array, getIteratee(predicate, 3), true) : [];
  3301. }
  3302. function fill(array, value, start, end) {
  3303. var length = array == null ? 0 : array.length;
  3304. if (!length) {
  3305. return [];
  3306. }
  3307. if (start && typeof start != "number" && isIterateeCall(array, value, start)) {
  3308. start = 0;
  3309. end = length;
  3310. }
  3311. return baseFill(array, value, start, end);
  3312. }
  3313. function findIndex(array, predicate, fromIndex) {
  3314. var length = array == null ? 0 : array.length;
  3315. if (!length) {
  3316. return -1;
  3317. }
  3318. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  3319. if (index < 0) {
  3320. index = nativeMax(length + index, 0);
  3321. }
  3322. return baseFindIndex(array, getIteratee(predicate, 3), index);
  3323. }
  3324. function findLastIndex(array, predicate, fromIndex) {
  3325. var length = array == null ? 0 : array.length;
  3326. if (!length) {
  3327. return -1;
  3328. }
  3329. var index = length - 1;
  3330. if (fromIndex !== undefined) {
  3331. index = toInteger(fromIndex);
  3332. index = fromIndex < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);
  3333. }
  3334. return baseFindIndex(array, getIteratee(predicate, 3), index, true);
  3335. }
  3336. function flatten(array) {
  3337. var length = array == null ? 0 : array.length;
  3338. return length ? baseFlatten(array, 1) : [];
  3339. }
  3340. function flattenDeep(array) {
  3341. var length = array == null ? 0 : array.length;
  3342. return length ? baseFlatten(array, INFINITY) : [];
  3343. }
  3344. function flattenDepth(array, depth) {
  3345. var length = array == null ? 0 : array.length;
  3346. if (!length) {
  3347. return [];
  3348. }
  3349. depth = depth === undefined ? 1 : toInteger(depth);
  3350. return baseFlatten(array, depth);
  3351. }
  3352. function fromPairs(pairs) {
  3353. var index = -1, length = pairs == null ? 0 : pairs.length, result2 = {};
  3354. while (++index < length) {
  3355. var pair = pairs[index];
  3356. result2[pair[0]] = pair[1];
  3357. }
  3358. return result2;
  3359. }
  3360. function head(array) {
  3361. return array && array.length ? array[0] : undefined;
  3362. }
  3363. function indexOf(array, value, fromIndex) {
  3364. var length = array == null ? 0 : array.length;
  3365. if (!length) {
  3366. return -1;
  3367. }
  3368. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  3369. if (index < 0) {
  3370. index = nativeMax(length + index, 0);
  3371. }
  3372. return baseIndexOf(array, value, index);
  3373. }
  3374. function initial(array) {
  3375. var length = array == null ? 0 : array.length;
  3376. return length ? baseSlice(array, 0, -1) : [];
  3377. }
  3378. var intersection = baseRest(function(arrays) {
  3379. var mapped = arrayMap(arrays, castArrayLikeObject);
  3380. return mapped.length && mapped[0] === arrays[0] ? baseIntersection(mapped) : [];
  3381. });
  3382. var intersectionBy = baseRest(function(arrays) {
  3383. var iteratee2 = last(arrays), mapped = arrayMap(arrays, castArrayLikeObject);
  3384. if (iteratee2 === last(mapped)) {
  3385. iteratee2 = undefined;
  3386. } else {
  3387. mapped.pop();
  3388. }
  3389. return mapped.length && mapped[0] === arrays[0] ? baseIntersection(mapped, getIteratee(iteratee2, 2)) : [];
  3390. });
  3391. var intersectionWith = baseRest(function(arrays) {
  3392. var comparator = last(arrays), mapped = arrayMap(arrays, castArrayLikeObject);
  3393. comparator = typeof comparator == "function" ? comparator : undefined;
  3394. if (comparator) {
  3395. mapped.pop();
  3396. }
  3397. return mapped.length && mapped[0] === arrays[0] ? baseIntersection(mapped, undefined, comparator) : [];
  3398. });
  3399. function join(array, separator) {
  3400. return array == null ? "" : nativeJoin.call(array, separator);
  3401. }
  3402. function last(array) {
  3403. var length = array == null ? 0 : array.length;
  3404. return length ? array[length - 1] : undefined;
  3405. }
  3406. function lastIndexOf(array, value, fromIndex) {
  3407. var length = array == null ? 0 : array.length;
  3408. if (!length) {
  3409. return -1;
  3410. }
  3411. var index = length;
  3412. if (fromIndex !== undefined) {
  3413. index = toInteger(fromIndex);
  3414. index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);
  3415. }
  3416. return value === value ? strictLastIndexOf(array, value, index) : baseFindIndex(array, baseIsNaN, index, true);
  3417. }
  3418. function nth(array, n) {
  3419. return array && array.length ? baseNth(array, toInteger(n)) : undefined;
  3420. }
  3421. var pull = baseRest(pullAll);
  3422. function pullAll(array, values2) {
  3423. return array && array.length && values2 && values2.length ? basePullAll(array, values2) : array;
  3424. }
  3425. function pullAllBy(array, values2, iteratee2) {
  3426. return array && array.length && values2 && values2.length ? basePullAll(array, values2, getIteratee(iteratee2, 2)) : array;
  3427. }
  3428. function pullAllWith(array, values2, comparator) {
  3429. return array && array.length && values2 && values2.length ? basePullAll(array, values2, undefined, comparator) : array;
  3430. }
  3431. var pullAt = flatRest(function(array, indexes) {
  3432. var length = array == null ? 0 : array.length, result2 = baseAt(array, indexes);
  3433. basePullAt(array, arrayMap(indexes, function(index) {
  3434. return isIndex(index, length) ? +index : index;
  3435. }).sort(compareAscending));
  3436. return result2;
  3437. });
  3438. function remove(array, predicate) {
  3439. var result2 = [];
  3440. if (!(array && array.length)) {
  3441. return result2;
  3442. }
  3443. var index = -1, indexes = [], length = array.length;
  3444. predicate = getIteratee(predicate, 3);
  3445. while (++index < length) {
  3446. var value = array[index];
  3447. if (predicate(value, index, array)) {
  3448. result2.push(value);
  3449. indexes.push(index);
  3450. }
  3451. }
  3452. basePullAt(array, indexes);
  3453. return result2;
  3454. }
  3455. function reverse(array) {
  3456. return array == null ? array : nativeReverse.call(array);
  3457. }
  3458. function slice(array, start, end) {
  3459. var length = array == null ? 0 : array.length;
  3460. if (!length) {
  3461. return [];
  3462. }
  3463. if (end && typeof end != "number" && isIterateeCall(array, start, end)) {
  3464. start = 0;
  3465. end = length;
  3466. } else {
  3467. start = start == null ? 0 : toInteger(start);
  3468. end = end === undefined ? length : toInteger(end);
  3469. }
  3470. return baseSlice(array, start, end);
  3471. }
  3472. function sortedIndex(array, value) {
  3473. return baseSortedIndex(array, value);
  3474. }
  3475. function sortedIndexBy(array, value, iteratee2) {
  3476. return baseSortedIndexBy(array, value, getIteratee(iteratee2, 2));
  3477. }
  3478. function sortedIndexOf(array, value) {
  3479. var length = array == null ? 0 : array.length;
  3480. if (length) {
  3481. var index = baseSortedIndex(array, value);
  3482. if (index < length && eq(array[index], value)) {
  3483. return index;
  3484. }
  3485. }
  3486. return -1;
  3487. }
  3488. function sortedLastIndex(array, value) {
  3489. return baseSortedIndex(array, value, true);
  3490. }
  3491. function sortedLastIndexBy(array, value, iteratee2) {
  3492. return baseSortedIndexBy(array, value, getIteratee(iteratee2, 2), true);
  3493. }
  3494. function sortedLastIndexOf(array, value) {
  3495. var length = array == null ? 0 : array.length;
  3496. if (length) {
  3497. var index = baseSortedIndex(array, value, true) - 1;
  3498. if (eq(array[index], value)) {
  3499. return index;
  3500. }
  3501. }
  3502. return -1;
  3503. }
  3504. function sortedUniq(array) {
  3505. return array && array.length ? baseSortedUniq(array) : [];
  3506. }
  3507. function sortedUniqBy(array, iteratee2) {
  3508. return array && array.length ? baseSortedUniq(array, getIteratee(iteratee2, 2)) : [];
  3509. }
  3510. function tail(array) {
  3511. var length = array == null ? 0 : array.length;
  3512. return length ? baseSlice(array, 1, length) : [];
  3513. }
  3514. function take(array, n, guard) {
  3515. if (!(array && array.length)) {
  3516. return [];
  3517. }
  3518. n = guard || n === undefined ? 1 : toInteger(n);
  3519. return baseSlice(array, 0, n < 0 ? 0 : n);
  3520. }
  3521. function takeRight(array, n, guard) {
  3522. var length = array == null ? 0 : array.length;
  3523. if (!length) {
  3524. return [];
  3525. }
  3526. n = guard || n === undefined ? 1 : toInteger(n);
  3527. n = length - n;
  3528. return baseSlice(array, n < 0 ? 0 : n, length);
  3529. }
  3530. function takeRightWhile(array, predicate) {
  3531. return array && array.length ? baseWhile(array, getIteratee(predicate, 3), false, true) : [];
  3532. }
  3533. function takeWhile(array, predicate) {
  3534. return array && array.length ? baseWhile(array, getIteratee(predicate, 3)) : [];
  3535. }
  3536. var union = baseRest(function(arrays) {
  3537. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));
  3538. });
  3539. var unionBy = baseRest(function(arrays) {
  3540. var iteratee2 = last(arrays);
  3541. if (isArrayLikeObject(iteratee2)) {
  3542. iteratee2 = undefined;
  3543. }
  3544. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee2, 2));
  3545. });
  3546. var unionWith = baseRest(function(arrays) {
  3547. var comparator = last(arrays);
  3548. comparator = typeof comparator == "function" ? comparator : undefined;
  3549. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator);
  3550. });
  3551. function uniq(array) {
  3552. return array && array.length ? baseUniq(array) : [];
  3553. }
  3554. function uniqBy(array, iteratee2) {
  3555. return array && array.length ? baseUniq(array, getIteratee(iteratee2, 2)) : [];
  3556. }
  3557. function uniqWith(array, comparator) {
  3558. comparator = typeof comparator == "function" ? comparator : undefined;
  3559. return array && array.length ? baseUniq(array, undefined, comparator) : [];
  3560. }
  3561. function unzip(array) {
  3562. if (!(array && array.length)) {
  3563. return [];
  3564. }
  3565. var length = 0;
  3566. array = arrayFilter(array, function(group) {
  3567. if (isArrayLikeObject(group)) {
  3568. length = nativeMax(group.length, length);
  3569. return true;
  3570. }
  3571. });
  3572. return baseTimes(length, function(index) {
  3573. return arrayMap(array, baseProperty(index));
  3574. });
  3575. }
  3576. function unzipWith(array, iteratee2) {
  3577. if (!(array && array.length)) {
  3578. return [];
  3579. }
  3580. var result2 = unzip(array);
  3581. if (iteratee2 == null) {
  3582. return result2;
  3583. }
  3584. return arrayMap(result2, function(group) {
  3585. return apply(iteratee2, undefined, group);
  3586. });
  3587. }
  3588. var without = baseRest(function(array, values2) {
  3589. return isArrayLikeObject(array) ? baseDifference(array, values2) : [];
  3590. });
  3591. var xor = baseRest(function(arrays) {
  3592. return baseXor(arrayFilter(arrays, isArrayLikeObject));
  3593. });
  3594. var xorBy = baseRest(function(arrays) {
  3595. var iteratee2 = last(arrays);
  3596. if (isArrayLikeObject(iteratee2)) {
  3597. iteratee2 = undefined;
  3598. }
  3599. return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee2, 2));
  3600. });
  3601. var xorWith = baseRest(function(arrays) {
  3602. var comparator = last(arrays);
  3603. comparator = typeof comparator == "function" ? comparator : undefined;
  3604. return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator);
  3605. });
  3606. var zip = baseRest(unzip);
  3607. function zipObject(props, values2) {
  3608. return baseZipObject(props || [], values2 || [], assignValue);
  3609. }
  3610. function zipObjectDeep(props, values2) {
  3611. return baseZipObject(props || [], values2 || [], baseSet);
  3612. }
  3613. var zipWith = baseRest(function(arrays) {
  3614. var length = arrays.length, iteratee2 = length > 1 ? arrays[length - 1] : undefined;
  3615. iteratee2 = typeof iteratee2 == "function" ? (arrays.pop(), iteratee2) : undefined;
  3616. return unzipWith(arrays, iteratee2);
  3617. });
  3618. function chain(value) {
  3619. var result2 = lodash2(value);
  3620. result2.__chain__ = true;
  3621. return result2;
  3622. }
  3623. function tap(value, interceptor) {
  3624. interceptor(value);
  3625. return value;
  3626. }
  3627. function thru(value, interceptor) {
  3628. return interceptor(value);
  3629. }
  3630. var wrapperAt = flatRest(function(paths) {
  3631. var length = paths.length, start = length ? paths[0] : 0, value = this.__wrapped__, interceptor = function(object) {
  3632. return baseAt(object, paths);
  3633. };
  3634. if (length > 1 || this.__actions__.length || !(value instanceof LazyWrapper) || !isIndex(start)) {
  3635. return this.thru(interceptor);
  3636. }
  3637. value = value.slice(start, +start + (length ? 1 : 0));
  3638. value.__actions__.push({
  3639. "func": thru,
  3640. "args": [interceptor],
  3641. "thisArg": undefined
  3642. });
  3643. return new LodashWrapper(value, this.__chain__).thru(function(array) {
  3644. if (length && !array.length) {
  3645. array.push(undefined);
  3646. }
  3647. return array;
  3648. });
  3649. });
  3650. function wrapperChain() {
  3651. return chain(this);
  3652. }
  3653. function wrapperCommit() {
  3654. return new LodashWrapper(this.value(), this.__chain__);
  3655. }
  3656. function wrapperNext() {
  3657. if (this.__values__ === undefined) {
  3658. this.__values__ = toArray(this.value());
  3659. }
  3660. var done = this.__index__ >= this.__values__.length, value = done ? undefined : this.__values__[this.__index__++];
  3661. return { "done": done, "value": value };
  3662. }
  3663. function wrapperToIterator() {
  3664. return this;
  3665. }
  3666. function wrapperPlant(value) {
  3667. var result2, parent2 = this;
  3668. while (parent2 instanceof baseLodash) {
  3669. var clone2 = wrapperClone(parent2);
  3670. clone2.__index__ = 0;
  3671. clone2.__values__ = undefined;
  3672. if (result2) {
  3673. previous.__wrapped__ = clone2;
  3674. } else {
  3675. result2 = clone2;
  3676. }
  3677. var previous = clone2;
  3678. parent2 = parent2.__wrapped__;
  3679. }
  3680. previous.__wrapped__ = value;
  3681. return result2;
  3682. }
  3683. function wrapperReverse() {
  3684. var value = this.__wrapped__;
  3685. if (value instanceof LazyWrapper) {
  3686. var wrapped = value;
  3687. if (this.__actions__.length) {
  3688. wrapped = new LazyWrapper(this);
  3689. }
  3690. wrapped = wrapped.reverse();
  3691. wrapped.__actions__.push({
  3692. "func": thru,
  3693. "args": [reverse],
  3694. "thisArg": undefined
  3695. });
  3696. return new LodashWrapper(wrapped, this.__chain__);
  3697. }
  3698. return this.thru(reverse);
  3699. }
  3700. function wrapperValue() {
  3701. return baseWrapperValue(this.__wrapped__, this.__actions__);
  3702. }
  3703. var countBy = createAggregator(function(result2, value, key) {
  3704. if (hasOwnProperty.call(result2, key)) {
  3705. ++result2[key];
  3706. } else {
  3707. baseAssignValue(result2, key, 1);
  3708. }
  3709. });
  3710. function every(collection, predicate, guard) {
  3711. var func = isArray(collection) ? arrayEvery : baseEvery;
  3712. if (guard && isIterateeCall(collection, predicate, guard)) {
  3713. predicate = undefined;
  3714. }
  3715. return func(collection, getIteratee(predicate, 3));
  3716. }
  3717. function filter(collection, predicate) {
  3718. var func = isArray(collection) ? arrayFilter : baseFilter;
  3719. return func(collection, getIteratee(predicate, 3));
  3720. }
  3721. var find = createFind(findIndex);
  3722. var findLast = createFind(findLastIndex);
  3723. function flatMap(collection, iteratee2) {
  3724. return baseFlatten(map(collection, iteratee2), 1);
  3725. }
  3726. function flatMapDeep(collection, iteratee2) {
  3727. return baseFlatten(map(collection, iteratee2), INFINITY);
  3728. }
  3729. function flatMapDepth(collection, iteratee2, depth) {
  3730. depth = depth === undefined ? 1 : toInteger(depth);
  3731. return baseFlatten(map(collection, iteratee2), depth);
  3732. }
  3733. function forEach(collection, iteratee2) {
  3734. var func = isArray(collection) ? arrayEach : baseEach;
  3735. return func(collection, getIteratee(iteratee2, 3));
  3736. }
  3737. function forEachRight(collection, iteratee2) {
  3738. var func = isArray(collection) ? arrayEachRight : baseEachRight;
  3739. return func(collection, getIteratee(iteratee2, 3));
  3740. }
  3741. var groupBy = createAggregator(function(result2, value, key) {
  3742. if (hasOwnProperty.call(result2, key)) {
  3743. result2[key].push(value);
  3744. } else {
  3745. baseAssignValue(result2, key, [value]);
  3746. }
  3747. });
  3748. function includes(collection, value, fromIndex, guard) {
  3749. collection = isArrayLike(collection) ? collection : values(collection);
  3750. fromIndex = fromIndex && !guard ? toInteger(fromIndex) : 0;
  3751. var length = collection.length;
  3752. if (fromIndex < 0) {
  3753. fromIndex = nativeMax(length + fromIndex, 0);
  3754. }
  3755. return isString(collection) ? fromIndex <= length && collection.indexOf(value, fromIndex) > -1 : !!length && baseIndexOf(collection, value, fromIndex) > -1;
  3756. }
  3757. var invokeMap = baseRest(function(collection, path, args) {
  3758. var index = -1, isFunc = typeof path == "function", result2 = isArrayLike(collection) ? Array2(collection.length) : [];
  3759. baseEach(collection, function(value) {
  3760. result2[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args);
  3761. });
  3762. return result2;
  3763. });
  3764. var keyBy = createAggregator(function(result2, value, key) {
  3765. baseAssignValue(result2, key, value);
  3766. });
  3767. function map(collection, iteratee2) {
  3768. var func = isArray(collection) ? arrayMap : baseMap;
  3769. return func(collection, getIteratee(iteratee2, 3));
  3770. }
  3771. function orderBy(collection, iteratees, orders, guard) {
  3772. if (collection == null) {
  3773. return [];
  3774. }
  3775. if (!isArray(iteratees)) {
  3776. iteratees = iteratees == null ? [] : [iteratees];
  3777. }
  3778. orders = guard ? undefined : orders;
  3779. if (!isArray(orders)) {
  3780. orders = orders == null ? [] : [orders];
  3781. }
  3782. return baseOrderBy(collection, iteratees, orders);
  3783. }
  3784. var partition = createAggregator(function(result2, value, key) {
  3785. result2[key ? 0 : 1].push(value);
  3786. }, function() {
  3787. return [[], []];
  3788. });
  3789. function reduce(collection, iteratee2, accumulator) {
  3790. var func = isArray(collection) ? arrayReduce : baseReduce, initAccum = arguments.length < 3;
  3791. return func(collection, getIteratee(iteratee2, 4), accumulator, initAccum, baseEach);
  3792. }
  3793. function reduceRight(collection, iteratee2, accumulator) {
  3794. var func = isArray(collection) ? arrayReduceRight : baseReduce, initAccum = arguments.length < 3;
  3795. return func(collection, getIteratee(iteratee2, 4), accumulator, initAccum, baseEachRight);
  3796. }
  3797. function reject(collection, predicate) {
  3798. var func = isArray(collection) ? arrayFilter : baseFilter;
  3799. return func(collection, negate(getIteratee(predicate, 3)));
  3800. }
  3801. function sample(collection) {
  3802. var func = isArray(collection) ? arraySample : baseSample;
  3803. return func(collection);
  3804. }
  3805. function sampleSize(collection, n, guard) {
  3806. if (guard ? isIterateeCall(collection, n, guard) : n === undefined) {
  3807. n = 1;
  3808. } else {
  3809. n = toInteger(n);
  3810. }
  3811. var func = isArray(collection) ? arraySampleSize : baseSampleSize;
  3812. return func(collection, n);
  3813. }
  3814. function shuffle(collection) {
  3815. var func = isArray(collection) ? arrayShuffle : baseShuffle;
  3816. return func(collection);
  3817. }
  3818. function size(collection) {
  3819. if (collection == null) {
  3820. return 0;
  3821. }
  3822. if (isArrayLike(collection)) {
  3823. return isString(collection) ? stringSize(collection) : collection.length;
  3824. }
  3825. var tag = getTag(collection);
  3826. if (tag == mapTag || tag == setTag) {
  3827. return collection.size;
  3828. }
  3829. return baseKeys(collection).length;
  3830. }
  3831. function some(collection, predicate, guard) {
  3832. var func = isArray(collection) ? arraySome : baseSome;
  3833. if (guard && isIterateeCall(collection, predicate, guard)) {
  3834. predicate = undefined;
  3835. }
  3836. return func(collection, getIteratee(predicate, 3));
  3837. }
  3838. var sortBy = baseRest(function(collection, iteratees) {
  3839. if (collection == null) {
  3840. return [];
  3841. }
  3842. var length = iteratees.length;
  3843. if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {
  3844. iteratees = [];
  3845. } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
  3846. iteratees = [iteratees[0]];
  3847. }
  3848. return baseOrderBy(collection, baseFlatten(iteratees, 1), []);
  3849. });
  3850. var now = ctxNow || function() {
  3851. return root.Date.now();
  3852. };
  3853. function after(n, func) {
  3854. if (typeof func != "function") {
  3855. throw new TypeError2(FUNC_ERROR_TEXT);
  3856. }
  3857. n = toInteger(n);
  3858. return function() {
  3859. if (--n < 1) {
  3860. return func.apply(this, arguments);
  3861. }
  3862. };
  3863. }
  3864. function ary(func, n, guard) {
  3865. n = guard ? undefined : n;
  3866. n = func && n == null ? func.length : n;
  3867. return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n);
  3868. }
  3869. function before(n, func) {
  3870. var result2;
  3871. if (typeof func != "function") {
  3872. throw new TypeError2(FUNC_ERROR_TEXT);
  3873. }
  3874. n = toInteger(n);
  3875. return function() {
  3876. if (--n > 0) {
  3877. result2 = func.apply(this, arguments);
  3878. }
  3879. if (n <= 1) {
  3880. func = undefined;
  3881. }
  3882. return result2;
  3883. };
  3884. }
  3885. var bind = baseRest(function(func, thisArg, partials) {
  3886. var bitmask = WRAP_BIND_FLAG;
  3887. if (partials.length) {
  3888. var holders = replaceHolders(partials, getHolder(bind));
  3889. bitmask |= WRAP_PARTIAL_FLAG;
  3890. }
  3891. return createWrap(func, bitmask, thisArg, partials, holders);
  3892. });
  3893. var bindKey = baseRest(function(object, key, partials) {
  3894. var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG;
  3895. if (partials.length) {
  3896. var holders = replaceHolders(partials, getHolder(bindKey));
  3897. bitmask |= WRAP_PARTIAL_FLAG;
  3898. }
  3899. return createWrap(key, bitmask, object, partials, holders);
  3900. });
  3901. function curry(func, arity, guard) {
  3902. arity = guard ? undefined : arity;
  3903. var result2 = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  3904. result2.placeholder = curry.placeholder;
  3905. return result2;
  3906. }
  3907. function curryRight(func, arity, guard) {
  3908. arity = guard ? undefined : arity;
  3909. var result2 = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  3910. result2.placeholder = curryRight.placeholder;
  3911. return result2;
  3912. }
  3913. function debounce(func, wait, options) {
  3914. var lastArgs, lastThis, maxWait, result2, timerId, lastCallTime, lastInvokeTime = 0, leading = false, maxing = false, trailing = true;
  3915. if (typeof func != "function") {
  3916. throw new TypeError2(FUNC_ERROR_TEXT);
  3917. }
  3918. wait = toNumber(wait) || 0;
  3919. if (isObject(options)) {
  3920. leading = !!options.leading;
  3921. maxing = "maxWait" in options;
  3922. maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
  3923. trailing = "trailing" in options ? !!options.trailing : trailing;
  3924. }
  3925. function invokeFunc(time) {
  3926. var args = lastArgs, thisArg = lastThis;
  3927. lastArgs = lastThis = undefined;
  3928. lastInvokeTime = time;
  3929. result2 = func.apply(thisArg, args);
  3930. return result2;
  3931. }
  3932. function leadingEdge(time) {
  3933. lastInvokeTime = time;
  3934. timerId = setTimeout2(timerExpired, wait);
  3935. return leading ? invokeFunc(time) : result2;
  3936. }
  3937. function remainingWait(time) {
  3938. var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime, timeWaiting = wait - timeSinceLastCall;
  3939. return maxing ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) : timeWaiting;
  3940. }
  3941. function shouldInvoke(time) {
  3942. var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime;
  3943. return lastCallTime === undefined || timeSinceLastCall >= wait || timeSinceLastCall < 0 || maxing && timeSinceLastInvoke >= maxWait;
  3944. }
  3945. function timerExpired() {
  3946. var time = now();
  3947. if (shouldInvoke(time)) {
  3948. return trailingEdge(time);
  3949. }
  3950. timerId = setTimeout2(timerExpired, remainingWait(time));
  3951. }
  3952. function trailingEdge(time) {
  3953. timerId = undefined;
  3954. if (trailing && lastArgs) {
  3955. return invokeFunc(time);
  3956. }
  3957. lastArgs = lastThis = undefined;
  3958. return result2;
  3959. }
  3960. function cancel() {
  3961. if (timerId !== undefined) {
  3962. clearTimeout2(timerId);
  3963. }
  3964. lastInvokeTime = 0;
  3965. lastArgs = lastCallTime = lastThis = timerId = undefined;
  3966. }
  3967. function flush() {
  3968. return timerId === undefined ? result2 : trailingEdge(now());
  3969. }
  3970. function debounced() {
  3971. var time = now(), isInvoking = shouldInvoke(time);
  3972. lastArgs = arguments;
  3973. lastThis = this;
  3974. lastCallTime = time;
  3975. if (isInvoking) {
  3976. if (timerId === undefined) {
  3977. return leadingEdge(lastCallTime);
  3978. }
  3979. if (maxing) {
  3980. clearTimeout2(timerId);
  3981. timerId = setTimeout2(timerExpired, wait);
  3982. return invokeFunc(lastCallTime);
  3983. }
  3984. }
  3985. if (timerId === undefined) {
  3986. timerId = setTimeout2(timerExpired, wait);
  3987. }
  3988. return result2;
  3989. }
  3990. debounced.cancel = cancel;
  3991. debounced.flush = flush;
  3992. return debounced;
  3993. }
  3994. var defer = baseRest(function(func, args) {
  3995. return baseDelay(func, 1, args);
  3996. });
  3997. var delay = baseRest(function(func, wait, args) {
  3998. return baseDelay(func, toNumber(wait) || 0, args);
  3999. });
  4000. function flip(func) {
  4001. return createWrap(func, WRAP_FLIP_FLAG);
  4002. }
  4003. function memoize(func, resolver) {
  4004. if (typeof func != "function" || resolver != null && typeof resolver != "function") {
  4005. throw new TypeError2(FUNC_ERROR_TEXT);
  4006. }
  4007. var memoized = function() {
  4008. var args = arguments, key = resolver ? resolver.apply(this, args) : args[0], cache = memoized.cache;
  4009. if (cache.has(key)) {
  4010. return cache.get(key);
  4011. }
  4012. var result2 = func.apply(this, args);
  4013. memoized.cache = cache.set(key, result2) || cache;
  4014. return result2;
  4015. };
  4016. memoized.cache = new (memoize.Cache || MapCache)();
  4017. return memoized;
  4018. }
  4019. memoize.Cache = MapCache;
  4020. function negate(predicate) {
  4021. if (typeof predicate != "function") {
  4022. throw new TypeError2(FUNC_ERROR_TEXT);
  4023. }
  4024. return function() {
  4025. var args = arguments;
  4026. switch (args.length) {
  4027. case 0:
  4028. return !predicate.call(this);
  4029. case 1:
  4030. return !predicate.call(this, args[0]);
  4031. case 2:
  4032. return !predicate.call(this, args[0], args[1]);
  4033. case 3:
  4034. return !predicate.call(this, args[0], args[1], args[2]);
  4035. }
  4036. return !predicate.apply(this, args);
  4037. };
  4038. }
  4039. function once(func) {
  4040. return before(2, func);
  4041. }
  4042. var overArgs = castRest(function(func, transforms) {
  4043. transforms = transforms.length == 1 && isArray(transforms[0]) ? arrayMap(transforms[0], baseUnary(getIteratee())) : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee()));
  4044. var funcsLength = transforms.length;
  4045. return baseRest(function(args) {
  4046. var index = -1, length = nativeMin(args.length, funcsLength);
  4047. while (++index < length) {
  4048. args[index] = transforms[index].call(this, args[index]);
  4049. }
  4050. return apply(func, this, args);
  4051. });
  4052. });
  4053. var partial = baseRest(function(func, partials) {
  4054. var holders = replaceHolders(partials, getHolder(partial));
  4055. return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders);
  4056. });
  4057. var partialRight = baseRest(function(func, partials) {
  4058. var holders = replaceHolders(partials, getHolder(partialRight));
  4059. return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders);
  4060. });
  4061. var rearg = flatRest(function(func, indexes) {
  4062. return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes);
  4063. });
  4064. function rest(func, start) {
  4065. if (typeof func != "function") {
  4066. throw new TypeError2(FUNC_ERROR_TEXT);
  4067. }
  4068. start = start === undefined ? start : toInteger(start);
  4069. return baseRest(func, start);
  4070. }
  4071. function spread(func, start) {
  4072. if (typeof func != "function") {
  4073. throw new TypeError2(FUNC_ERROR_TEXT);
  4074. }
  4075. start = start == null ? 0 : nativeMax(toInteger(start), 0);
  4076. return baseRest(function(args) {
  4077. var array = args[start], otherArgs = castSlice(args, 0, start);
  4078. if (array) {
  4079. arrayPush(otherArgs, array);
  4080. }
  4081. return apply(func, this, otherArgs);
  4082. });
  4083. }
  4084. function throttle(func, wait, options) {
  4085. var leading = true, trailing = true;
  4086. if (typeof func != "function") {
  4087. throw new TypeError2(FUNC_ERROR_TEXT);
  4088. }
  4089. if (isObject(options)) {
  4090. leading = "leading" in options ? !!options.leading : leading;
  4091. trailing = "trailing" in options ? !!options.trailing : trailing;
  4092. }
  4093. return debounce(func, wait, {
  4094. "leading": leading,
  4095. "maxWait": wait,
  4096. "trailing": trailing
  4097. });
  4098. }
  4099. function unary(func) {
  4100. return ary(func, 1);
  4101. }
  4102. function wrap(value, wrapper) {
  4103. return partial(castFunction(wrapper), value);
  4104. }
  4105. function castArray() {
  4106. if (!arguments.length) {
  4107. return [];
  4108. }
  4109. var value = arguments[0];
  4110. return isArray(value) ? value : [value];
  4111. }
  4112. function clone(value) {
  4113. return baseClone(value, CLONE_SYMBOLS_FLAG);
  4114. }
  4115. function cloneWith(value, customizer) {
  4116. customizer = typeof customizer == "function" ? customizer : undefined;
  4117. return baseClone(value, CLONE_SYMBOLS_FLAG, customizer);
  4118. }
  4119. function cloneDeep(value) {
  4120. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
  4121. }
  4122. function cloneDeepWith(value, customizer) {
  4123. customizer = typeof customizer == "function" ? customizer : undefined;
  4124. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);
  4125. }
  4126. function conformsTo(object, source) {
  4127. return source == null || baseConformsTo(object, source, keys(source));
  4128. }
  4129. function eq(value, other) {
  4130. return value === other || value !== value && other !== other;
  4131. }
  4132. var gt = createRelationalOperation(baseGt);
  4133. var gte = createRelationalOperation(function(value, other) {
  4134. return value >= other;
  4135. });
  4136. var isArguments = baseIsArguments(/* @__PURE__ */ function() {
  4137. return arguments;
  4138. }()) ? baseIsArguments : function(value) {
  4139. return isObjectLike(value) && hasOwnProperty.call(value, "callee") && !propertyIsEnumerable.call(value, "callee");
  4140. };
  4141. var isArray = Array2.isArray;
  4142. var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;
  4143. function isArrayLike(value) {
  4144. return value != null && isLength(value.length) && !isFunction(value);
  4145. }
  4146. function isArrayLikeObject(value) {
  4147. return isObjectLike(value) && isArrayLike(value);
  4148. }
  4149. function isBoolean(value) {
  4150. return value === true || value === false || isObjectLike(value) && baseGetTag(value) == boolTag;
  4151. }
  4152. var isBuffer = nativeIsBuffer || stubFalse;
  4153. var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;
  4154. function isElement(value) {
  4155. return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);
  4156. }
  4157. function isEmpty(value) {
  4158. if (value == null) {
  4159. return true;
  4160. }
  4161. if (isArrayLike(value) && (isArray(value) || typeof value == "string" || typeof value.splice == "function" || isBuffer(value) || isTypedArray(value) || isArguments(value))) {
  4162. return !value.length;
  4163. }
  4164. var tag = getTag(value);
  4165. if (tag == mapTag || tag == setTag) {
  4166. return !value.size;
  4167. }
  4168. if (isPrototype(value)) {
  4169. return !baseKeys(value).length;
  4170. }
  4171. for (var key in value) {
  4172. if (hasOwnProperty.call(value, key)) {
  4173. return false;
  4174. }
  4175. }
  4176. return true;
  4177. }
  4178. function isEqual(value, other) {
  4179. return baseIsEqual(value, other);
  4180. }
  4181. function isEqualWith(value, other, customizer) {
  4182. customizer = typeof customizer == "function" ? customizer : undefined;
  4183. var result2 = customizer ? customizer(value, other) : undefined;
  4184. return result2 === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result2;
  4185. }
  4186. function isError(value) {
  4187. if (!isObjectLike(value)) {
  4188. return false;
  4189. }
  4190. var tag = baseGetTag(value);
  4191. return tag == errorTag || tag == domExcTag || typeof value.message == "string" && typeof value.name == "string" && !isPlainObject(value);
  4192. }
  4193. function isFinite(value) {
  4194. return typeof value == "number" && nativeIsFinite(value);
  4195. }
  4196. function isFunction(value) {
  4197. if (!isObject(value)) {
  4198. return false;
  4199. }
  4200. var tag = baseGetTag(value);
  4201. return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
  4202. }
  4203. function isInteger(value) {
  4204. return typeof value == "number" && value == toInteger(value);
  4205. }
  4206. function isLength(value) {
  4207. return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
  4208. }
  4209. function isObject(value) {
  4210. var type = typeof value;
  4211. return value != null && (type == "object" || type == "function");
  4212. }
  4213. function isObjectLike(value) {
  4214. return value != null && typeof value == "object";
  4215. }
  4216. var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
  4217. function isMatch(object, source) {
  4218. return object === source || baseIsMatch(object, source, getMatchData(source));
  4219. }
  4220. function isMatchWith(object, source, customizer) {
  4221. customizer = typeof customizer == "function" ? customizer : undefined;
  4222. return baseIsMatch(object, source, getMatchData(source), customizer);
  4223. }
  4224. function isNaN(value) {
  4225. return isNumber(value) && value != +value;
  4226. }
  4227. function isNative(value) {
  4228. if (isMaskable(value)) {
  4229. throw new Error2(CORE_ERROR_TEXT);
  4230. }
  4231. return baseIsNative(value);
  4232. }
  4233. function isNull(value) {
  4234. return value === null;
  4235. }
  4236. function isNil(value) {
  4237. return value == null;
  4238. }
  4239. function isNumber(value) {
  4240. return typeof value == "number" || isObjectLike(value) && baseGetTag(value) == numberTag;
  4241. }
  4242. function isPlainObject(value) {
  4243. if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
  4244. return false;
  4245. }
  4246. var proto = getPrototype(value);
  4247. if (proto === null) {
  4248. return true;
  4249. }
  4250. var Ctor = hasOwnProperty.call(proto, "constructor") && proto.constructor;
  4251. return typeof Ctor == "function" && Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString;
  4252. }
  4253. var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;
  4254. function isSafeInteger(value) {
  4255. return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;
  4256. }
  4257. var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
  4258. function isString(value) {
  4259. return typeof value == "string" || !isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag;
  4260. }
  4261. function isSymbol(value) {
  4262. return typeof value == "symbol" || isObjectLike(value) && baseGetTag(value) == symbolTag;
  4263. }
  4264. var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
  4265. function isUndefined(value) {
  4266. return value === undefined;
  4267. }
  4268. function isWeakMap(value) {
  4269. return isObjectLike(value) && getTag(value) == weakMapTag;
  4270. }
  4271. function isWeakSet(value) {
  4272. return isObjectLike(value) && baseGetTag(value) == weakSetTag;
  4273. }
  4274. var lt = createRelationalOperation(baseLt);
  4275. var lte = createRelationalOperation(function(value, other) {
  4276. return value <= other;
  4277. });
  4278. function toArray(value) {
  4279. if (!value) {
  4280. return [];
  4281. }
  4282. if (isArrayLike(value)) {
  4283. return isString(value) ? stringToArray(value) : copyArray(value);
  4284. }
  4285. if (symIterator && value[symIterator]) {
  4286. return iteratorToArray(value[symIterator]());
  4287. }
  4288. var tag = getTag(value), func = tag == mapTag ? mapToArray : tag == setTag ? setToArray : values;
  4289. return func(value);
  4290. }
  4291. function toFinite(value) {
  4292. if (!value) {
  4293. return value === 0 ? value : 0;
  4294. }
  4295. value = toNumber(value);
  4296. if (value === INFINITY || value === -INFINITY) {
  4297. var sign = value < 0 ? -1 : 1;
  4298. return sign * MAX_INTEGER;
  4299. }
  4300. return value === value ? value : 0;
  4301. }
  4302. function toInteger(value) {
  4303. var result2 = toFinite(value), remainder = result2 % 1;
  4304. return result2 === result2 ? remainder ? result2 - remainder : result2 : 0;
  4305. }
  4306. function toLength(value) {
  4307. return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0;
  4308. }
  4309. function toNumber(value) {
  4310. if (typeof value == "number") {
  4311. return value;
  4312. }
  4313. if (isSymbol(value)) {
  4314. return NAN;
  4315. }
  4316. if (isObject(value)) {
  4317. var other = typeof value.valueOf == "function" ? value.valueOf() : value;
  4318. value = isObject(other) ? other + "" : other;
  4319. }
  4320. if (typeof value != "string") {
  4321. return value === 0 ? value : +value;
  4322. }
  4323. value = baseTrim(value);
  4324. var isBinary = reIsBinary.test(value);
  4325. return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value;
  4326. }
  4327. function toPlainObject(value) {
  4328. return copyObject(value, keysIn(value));
  4329. }
  4330. function toSafeInteger(value) {
  4331. return value ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER) : value === 0 ? value : 0;
  4332. }
  4333. function toString(value) {
  4334. return value == null ? "" : baseToString(value);
  4335. }
  4336. var assign = createAssigner(function(object, source) {
  4337. if (isPrototype(source) || isArrayLike(source)) {
  4338. copyObject(source, keys(source), object);
  4339. return;
  4340. }
  4341. for (var key in source) {
  4342. if (hasOwnProperty.call(source, key)) {
  4343. assignValue(object, key, source[key]);
  4344. }
  4345. }
  4346. });
  4347. var assignIn = createAssigner(function(object, source) {
  4348. copyObject(source, keysIn(source), object);
  4349. });
  4350. var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {
  4351. copyObject(source, keysIn(source), object, customizer);
  4352. });
  4353. var assignWith = createAssigner(function(object, source, srcIndex, customizer) {
  4354. copyObject(source, keys(source), object, customizer);
  4355. });
  4356. var at = flatRest(baseAt);
  4357. function create(prototype, properties) {
  4358. var result2 = baseCreate(prototype);
  4359. return properties == null ? result2 : baseAssign(result2, properties);
  4360. }
  4361. var defaults = baseRest(function(object, sources) {
  4362. object = Object2(object);
  4363. var index = -1;
  4364. var length = sources.length;
  4365. var guard = length > 2 ? sources[2] : undefined;
  4366. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  4367. length = 1;
  4368. }
  4369. while (++index < length) {
  4370. var source = sources[index];
  4371. var props = keysIn(source);
  4372. var propsIndex = -1;
  4373. var propsLength = props.length;
  4374. while (++propsIndex < propsLength) {
  4375. var key = props[propsIndex];
  4376. var value = object[key];
  4377. if (value === undefined || eq(value, objectProto[key]) && !hasOwnProperty.call(object, key)) {
  4378. object[key] = source[key];
  4379. }
  4380. }
  4381. }
  4382. return object;
  4383. });
  4384. var defaultsDeep = baseRest(function(args) {
  4385. args.push(undefined, customDefaultsMerge);
  4386. return apply(mergeWith, undefined, args);
  4387. });
  4388. function findKey(object, predicate) {
  4389. return baseFindKey(object, getIteratee(predicate, 3), baseForOwn);
  4390. }
  4391. function findLastKey(object, predicate) {
  4392. return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight);
  4393. }
  4394. function forIn(object, iteratee2) {
  4395. return object == null ? object : baseFor(object, getIteratee(iteratee2, 3), keysIn);
  4396. }
  4397. function forInRight(object, iteratee2) {
  4398. return object == null ? object : baseForRight(object, getIteratee(iteratee2, 3), keysIn);
  4399. }
  4400. function forOwn(object, iteratee2) {
  4401. return object && baseForOwn(object, getIteratee(iteratee2, 3));
  4402. }
  4403. function forOwnRight(object, iteratee2) {
  4404. return object && baseForOwnRight(object, getIteratee(iteratee2, 3));
  4405. }
  4406. function functions(object) {
  4407. return object == null ? [] : baseFunctions(object, keys(object));
  4408. }
  4409. function functionsIn(object) {
  4410. return object == null ? [] : baseFunctions(object, keysIn(object));
  4411. }
  4412. function get(object, path, defaultValue) {
  4413. var result2 = object == null ? undefined : baseGet(object, path);
  4414. return result2 === undefined ? defaultValue : result2;
  4415. }
  4416. function has(object, path) {
  4417. return object != null && hasPath(object, path, baseHas);
  4418. }
  4419. function hasIn(object, path) {
  4420. return object != null && hasPath(object, path, baseHasIn);
  4421. }
  4422. var invert = createInverter(function(result2, value, key) {
  4423. if (value != null && typeof value.toString != "function") {
  4424. value = nativeObjectToString.call(value);
  4425. }
  4426. result2[value] = key;
  4427. }, constant(identity));
  4428. var invertBy = createInverter(function(result2, value, key) {
  4429. if (value != null && typeof value.toString != "function") {
  4430. value = nativeObjectToString.call(value);
  4431. }
  4432. if (hasOwnProperty.call(result2, value)) {
  4433. result2[value].push(key);
  4434. } else {
  4435. result2[value] = [key];
  4436. }
  4437. }, getIteratee);
  4438. var invoke = baseRest(baseInvoke);
  4439. function keys(object) {
  4440. return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
  4441. }
  4442. function keysIn(object) {
  4443. return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
  4444. }
  4445. function mapKeys(object, iteratee2) {
  4446. var result2 = {};
  4447. iteratee2 = getIteratee(iteratee2, 3);
  4448. baseForOwn(object, function(value, key, object2) {
  4449. baseAssignValue(result2, iteratee2(value, key, object2), value);
  4450. });
  4451. return result2;
  4452. }
  4453. function mapValues(object, iteratee2) {
  4454. var result2 = {};
  4455. iteratee2 = getIteratee(iteratee2, 3);
  4456. baseForOwn(object, function(value, key, object2) {
  4457. baseAssignValue(result2, key, iteratee2(value, key, object2));
  4458. });
  4459. return result2;
  4460. }
  4461. var merge = createAssigner(function(object, source, srcIndex) {
  4462. baseMerge(object, source, srcIndex);
  4463. });
  4464. var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {
  4465. baseMerge(object, source, srcIndex, customizer);
  4466. });
  4467. var omit = flatRest(function(object, paths) {
  4468. var result2 = {};
  4469. if (object == null) {
  4470. return result2;
  4471. }
  4472. var isDeep = false;
  4473. paths = arrayMap(paths, function(path) {
  4474. path = castPath(path, object);
  4475. isDeep || (isDeep = path.length > 1);
  4476. return path;
  4477. });
  4478. copyObject(object, getAllKeysIn(object), result2);
  4479. if (isDeep) {
  4480. result2 = baseClone(result2, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);
  4481. }
  4482. var length = paths.length;
  4483. while (length--) {
  4484. baseUnset(result2, paths[length]);
  4485. }
  4486. return result2;
  4487. });
  4488. function omitBy(object, predicate) {
  4489. return pickBy(object, negate(getIteratee(predicate)));
  4490. }
  4491. var pick = flatRest(function(object, paths) {
  4492. return object == null ? {} : basePick(object, paths);
  4493. });
  4494. function pickBy(object, predicate) {
  4495. if (object == null) {
  4496. return {};
  4497. }
  4498. var props = arrayMap(getAllKeysIn(object), function(prop) {
  4499. return [prop];
  4500. });
  4501. predicate = getIteratee(predicate);
  4502. return basePickBy(object, props, function(value, path) {
  4503. return predicate(value, path[0]);
  4504. });
  4505. }
  4506. function result(object, path, defaultValue) {
  4507. path = castPath(path, object);
  4508. var index = -1, length = path.length;
  4509. if (!length) {
  4510. length = 1;
  4511. object = undefined;
  4512. }
  4513. while (++index < length) {
  4514. var value = object == null ? undefined : object[toKey(path[index])];
  4515. if (value === undefined) {
  4516. index = length;
  4517. value = defaultValue;
  4518. }
  4519. object = isFunction(value) ? value.call(object) : value;
  4520. }
  4521. return object;
  4522. }
  4523. function set(object, path, value) {
  4524. return object == null ? object : baseSet(object, path, value);
  4525. }
  4526. function setWith(object, path, value, customizer) {
  4527. customizer = typeof customizer == "function" ? customizer : undefined;
  4528. return object == null ? object : baseSet(object, path, value, customizer);
  4529. }
  4530. var toPairs = createToPairs(keys);
  4531. var toPairsIn = createToPairs(keysIn);
  4532. function transform(object, iteratee2, accumulator) {
  4533. var isArr = isArray(object), isArrLike = isArr || isBuffer(object) || isTypedArray(object);
  4534. iteratee2 = getIteratee(iteratee2, 4);
  4535. if (accumulator == null) {
  4536. var Ctor = object && object.constructor;
  4537. if (isArrLike) {
  4538. accumulator = isArr ? new Ctor() : [];
  4539. } else if (isObject(object)) {
  4540. accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};
  4541. } else {
  4542. accumulator = {};
  4543. }
  4544. }
  4545. (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object2) {
  4546. return iteratee2(accumulator, value, index, object2);
  4547. });
  4548. return accumulator;
  4549. }
  4550. function unset(object, path) {
  4551. return object == null ? true : baseUnset(object, path);
  4552. }
  4553. function update(object, path, updater) {
  4554. return object == null ? object : baseUpdate(object, path, castFunction(updater));
  4555. }
  4556. function updateWith(object, path, updater, customizer) {
  4557. customizer = typeof customizer == "function" ? customizer : undefined;
  4558. return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);
  4559. }
  4560. function values(object) {
  4561. return object == null ? [] : baseValues(object, keys(object));
  4562. }
  4563. function valuesIn(object) {
  4564. return object == null ? [] : baseValues(object, keysIn(object));
  4565. }
  4566. function clamp(number, lower, upper) {
  4567. if (upper === undefined) {
  4568. upper = lower;
  4569. lower = undefined;
  4570. }
  4571. if (upper !== undefined) {
  4572. upper = toNumber(upper);
  4573. upper = upper === upper ? upper : 0;
  4574. }
  4575. if (lower !== undefined) {
  4576. lower = toNumber(lower);
  4577. lower = lower === lower ? lower : 0;
  4578. }
  4579. return baseClamp(toNumber(number), lower, upper);
  4580. }
  4581. function inRange(number, start, end) {
  4582. start = toFinite(start);
  4583. if (end === undefined) {
  4584. end = start;
  4585. start = 0;
  4586. } else {
  4587. end = toFinite(end);
  4588. }
  4589. number = toNumber(number);
  4590. return baseInRange(number, start, end);
  4591. }
  4592. function random(lower, upper, floating) {
  4593. if (floating && typeof floating != "boolean" && isIterateeCall(lower, upper, floating)) {
  4594. upper = floating = undefined;
  4595. }
  4596. if (floating === undefined) {
  4597. if (typeof upper == "boolean") {
  4598. floating = upper;
  4599. upper = undefined;
  4600. } else if (typeof lower == "boolean") {
  4601. floating = lower;
  4602. lower = undefined;
  4603. }
  4604. }
  4605. if (lower === undefined && upper === undefined) {
  4606. lower = 0;
  4607. upper = 1;
  4608. } else {
  4609. lower = toFinite(lower);
  4610. if (upper === undefined) {
  4611. upper = lower;
  4612. lower = 0;
  4613. } else {
  4614. upper = toFinite(upper);
  4615. }
  4616. }
  4617. if (lower > upper) {
  4618. var temp = lower;
  4619. lower = upper;
  4620. upper = temp;
  4621. }
  4622. if (floating || lower % 1 || upper % 1) {
  4623. var rand = nativeRandom();
  4624. return nativeMin(lower + rand * (upper - lower + freeParseFloat("1e-" + ((rand + "").length - 1))), upper);
  4625. }
  4626. return baseRandom(lower, upper);
  4627. }
  4628. var camelCase = createCompounder(function(result2, word, index) {
  4629. word = word.toLowerCase();
  4630. return result2 + (index ? capitalize(word) : word);
  4631. });
  4632. function capitalize(string) {
  4633. return upperFirst(toString(string).toLowerCase());
  4634. }
  4635. function deburr(string) {
  4636. string = toString(string);
  4637. return string && string.replace(reLatin, deburrLetter).replace(reComboMark, "");
  4638. }
  4639. function endsWith(string, target, position) {
  4640. string = toString(string);
  4641. target = baseToString(target);
  4642. var length = string.length;
  4643. position = position === undefined ? length : baseClamp(toInteger(position), 0, length);
  4644. var end = position;
  4645. position -= target.length;
  4646. return position >= 0 && string.slice(position, end) == target;
  4647. }
  4648. function escape(string) {
  4649. string = toString(string);
  4650. return string && reHasUnescapedHtml.test(string) ? string.replace(reUnescapedHtml, escapeHtmlChar) : string;
  4651. }
  4652. function escapeRegExp(string) {
  4653. string = toString(string);
  4654. return string && reHasRegExpChar.test(string) ? string.replace(reRegExpChar, "\\$&") : string;
  4655. }
  4656. var kebabCase = createCompounder(function(result2, word, index) {
  4657. return result2 + (index ? "-" : "") + word.toLowerCase();
  4658. });
  4659. var lowerCase = createCompounder(function(result2, word, index) {
  4660. return result2 + (index ? " " : "") + word.toLowerCase();
  4661. });
  4662. var lowerFirst = createCaseFirst("toLowerCase");
  4663. function pad(string, length, chars) {
  4664. string = toString(string);
  4665. length = toInteger(length);
  4666. var strLength = length ? stringSize(string) : 0;
  4667. if (!length || strLength >= length) {
  4668. return string;
  4669. }
  4670. var mid = (length - strLength) / 2;
  4671. return createPadding(nativeFloor(mid), chars) + string + createPadding(nativeCeil(mid), chars);
  4672. }
  4673. function padEnd(string, length, chars) {
  4674. string = toString(string);
  4675. length = toInteger(length);
  4676. var strLength = length ? stringSize(string) : 0;
  4677. return length && strLength < length ? string + createPadding(length - strLength, chars) : string;
  4678. }
  4679. function padStart(string, length, chars) {
  4680. string = toString(string);
  4681. length = toInteger(length);
  4682. var strLength = length ? stringSize(string) : 0;
  4683. return length && strLength < length ? createPadding(length - strLength, chars) + string : string;
  4684. }
  4685. function parseInt2(string, radix, guard) {
  4686. if (guard || radix == null) {
  4687. radix = 0;
  4688. } else if (radix) {
  4689. radix = +radix;
  4690. }
  4691. return nativeParseInt(toString(string).replace(reTrimStart, ""), radix || 0);
  4692. }
  4693. function repeat(string, n, guard) {
  4694. if (guard ? isIterateeCall(string, n, guard) : n === undefined) {
  4695. n = 1;
  4696. } else {
  4697. n = toInteger(n);
  4698. }
  4699. return baseRepeat(toString(string), n);
  4700. }
  4701. function replace() {
  4702. var args = arguments, string = toString(args[0]);
  4703. return args.length < 3 ? string : string.replace(args[1], args[2]);
  4704. }
  4705. var snakeCase = createCompounder(function(result2, word, index) {
  4706. return result2 + (index ? "_" : "") + word.toLowerCase();
  4707. });
  4708. function split(string, separator, limit) {
  4709. if (limit && typeof limit != "number" && isIterateeCall(string, separator, limit)) {
  4710. separator = limit = undefined;
  4711. }
  4712. limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0;
  4713. if (!limit) {
  4714. return [];
  4715. }
  4716. string = toString(string);
  4717. if (string && (typeof separator == "string" || separator != null && !isRegExp(separator))) {
  4718. separator = baseToString(separator);
  4719. if (!separator && hasUnicode(string)) {
  4720. return castSlice(stringToArray(string), 0, limit);
  4721. }
  4722. }
  4723. return string.split(separator, limit);
  4724. }
  4725. var startCase = createCompounder(function(result2, word, index) {
  4726. return result2 + (index ? " " : "") + upperFirst(word);
  4727. });
  4728. function startsWith(string, target, position) {
  4729. string = toString(string);
  4730. position = position == null ? 0 : baseClamp(toInteger(position), 0, string.length);
  4731. target = baseToString(target);
  4732. return string.slice(position, position + target.length) == target;
  4733. }
  4734. function template(string, options, guard) {
  4735. var settings = lodash2.templateSettings;
  4736. if (guard && isIterateeCall(string, options, guard)) {
  4737. options = undefined;
  4738. }
  4739. string = toString(string);
  4740. options = assignInWith({}, options, settings, customDefaultsAssignIn);
  4741. var imports = assignInWith({}, options.imports, settings.imports, customDefaultsAssignIn), importsKeys = keys(imports), importsValues = baseValues(imports, importsKeys);
  4742. var isEscaping, isEvaluating, index = 0, interpolate = options.interpolate || reNoMatch, source = "__p += '";
  4743. var reDelimiters = RegExp2(
  4744. (options.escape || reNoMatch).source + "|" + interpolate.source + "|" + (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + "|" + (options.evaluate || reNoMatch).source + "|$",
  4745. "g"
  4746. );
  4747. var sourceURL = "//# sourceURL=" + (hasOwnProperty.call(options, "sourceURL") ? (options.sourceURL + "").replace(/\s/g, " ") : "lodash.templateSources[" + ++templateCounter + "]") + "\n";
  4748. string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {
  4749. interpolateValue || (interpolateValue = esTemplateValue);
  4750. source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar);
  4751. if (escapeValue) {
  4752. isEscaping = true;
  4753. source += "' +\n__e(" + escapeValue + ") +\n'";
  4754. }
  4755. if (evaluateValue) {
  4756. isEvaluating = true;
  4757. source += "';\n" + evaluateValue + ";\n__p += '";
  4758. }
  4759. if (interpolateValue) {
  4760. source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'";
  4761. }
  4762. index = offset + match.length;
  4763. return match;
  4764. });
  4765. source += "';\n";
  4766. var variable = hasOwnProperty.call(options, "variable") && options.variable;
  4767. if (!variable) {
  4768. source = "with (obj) {\n" + source + "\n}\n";
  4769. } else if (reForbiddenIdentifierChars.test(variable)) {
  4770. throw new Error2(INVALID_TEMPL_VAR_ERROR_TEXT);
  4771. }
  4772. source = (isEvaluating ? source.replace(reEmptyStringLeading, "") : source).replace(reEmptyStringMiddle, "$1").replace(reEmptyStringTrailing, "$1;");
  4773. source = "function(" + (variable || "obj") + ") {\n" + (variable ? "" : "obj || (obj = {});\n") + "var __t, __p = ''" + (isEscaping ? ", __e = _.escape" : "") + (isEvaluating ? ", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n" : ";\n") + source + "return __p\n}";
  4774. var result2 = attempt(function() {
  4775. return Function2(importsKeys, sourceURL + "return " + source).apply(undefined, importsValues);
  4776. });
  4777. result2.source = source;
  4778. if (isError(result2)) {
  4779. throw result2;
  4780. }
  4781. return result2;
  4782. }
  4783. function toLower(value) {
  4784. return toString(value).toLowerCase();
  4785. }
  4786. function toUpper(value) {
  4787. return toString(value).toUpperCase();
  4788. }
  4789. function trim(string, chars, guard) {
  4790. string = toString(string);
  4791. if (string && (guard || chars === undefined)) {
  4792. return baseTrim(string);
  4793. }
  4794. if (!string || !(chars = baseToString(chars))) {
  4795. return string;
  4796. }
  4797. var strSymbols = stringToArray(string), chrSymbols = stringToArray(chars), start = charsStartIndex(strSymbols, chrSymbols), end = charsEndIndex(strSymbols, chrSymbols) + 1;
  4798. return castSlice(strSymbols, start, end).join("");
  4799. }
  4800. function trimEnd(string, chars, guard) {
  4801. string = toString(string);
  4802. if (string && (guard || chars === undefined)) {
  4803. return string.slice(0, trimmedEndIndex(string) + 1);
  4804. }
  4805. if (!string || !(chars = baseToString(chars))) {
  4806. return string;
  4807. }
  4808. var strSymbols = stringToArray(string), end = charsEndIndex(strSymbols, stringToArray(chars)) + 1;
  4809. return castSlice(strSymbols, 0, end).join("");
  4810. }
  4811. function trimStart(string, chars, guard) {
  4812. string = toString(string);
  4813. if (string && (guard || chars === undefined)) {
  4814. return string.replace(reTrimStart, "");
  4815. }
  4816. if (!string || !(chars = baseToString(chars))) {
  4817. return string;
  4818. }
  4819. var strSymbols = stringToArray(string), start = charsStartIndex(strSymbols, stringToArray(chars));
  4820. return castSlice(strSymbols, start).join("");
  4821. }
  4822. function truncate(string, options) {
  4823. var length = DEFAULT_TRUNC_LENGTH, omission = DEFAULT_TRUNC_OMISSION;
  4824. if (isObject(options)) {
  4825. var separator = "separator" in options ? options.separator : separator;
  4826. length = "length" in options ? toInteger(options.length) : length;
  4827. omission = "omission" in options ? baseToString(options.omission) : omission;
  4828. }
  4829. string = toString(string);
  4830. var strLength = string.length;
  4831. if (hasUnicode(string)) {
  4832. var strSymbols = stringToArray(string);
  4833. strLength = strSymbols.length;
  4834. }
  4835. if (length >= strLength) {
  4836. return string;
  4837. }
  4838. var end = length - stringSize(omission);
  4839. if (end < 1) {
  4840. return omission;
  4841. }
  4842. var result2 = strSymbols ? castSlice(strSymbols, 0, end).join("") : string.slice(0, end);
  4843. if (separator === undefined) {
  4844. return result2 + omission;
  4845. }
  4846. if (strSymbols) {
  4847. end += result2.length - end;
  4848. }
  4849. if (isRegExp(separator)) {
  4850. if (string.slice(end).search(separator)) {
  4851. var match, substring = result2;
  4852. if (!separator.global) {
  4853. separator = RegExp2(separator.source, toString(reFlags.exec(separator)) + "g");
  4854. }
  4855. separator.lastIndex = 0;
  4856. while (match = separator.exec(substring)) {
  4857. var newEnd = match.index;
  4858. }
  4859. result2 = result2.slice(0, newEnd === undefined ? end : newEnd);
  4860. }
  4861. } else if (string.indexOf(baseToString(separator), end) != end) {
  4862. var index = result2.lastIndexOf(separator);
  4863. if (index > -1) {
  4864. result2 = result2.slice(0, index);
  4865. }
  4866. }
  4867. return result2 + omission;
  4868. }
  4869. function unescape(string) {
  4870. string = toString(string);
  4871. return string && reHasEscapedHtml.test(string) ? string.replace(reEscapedHtml, unescapeHtmlChar) : string;
  4872. }
  4873. var upperCase = createCompounder(function(result2, word, index) {
  4874. return result2 + (index ? " " : "") + word.toUpperCase();
  4875. });
  4876. var upperFirst = createCaseFirst("toUpperCase");
  4877. function words(string, pattern, guard) {
  4878. string = toString(string);
  4879. pattern = guard ? undefined : pattern;
  4880. if (pattern === undefined) {
  4881. return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);
  4882. }
  4883. return string.match(pattern) || [];
  4884. }
  4885. var attempt = baseRest(function(func, args) {
  4886. try {
  4887. return apply(func, undefined, args);
  4888. } catch (e) {
  4889. return isError(e) ? e : new Error2(e);
  4890. }
  4891. });
  4892. var bindAll = flatRest(function(object, methodNames) {
  4893. arrayEach(methodNames, function(key) {
  4894. key = toKey(key);
  4895. baseAssignValue(object, key, bind(object[key], object));
  4896. });
  4897. return object;
  4898. });
  4899. function cond(pairs) {
  4900. var length = pairs == null ? 0 : pairs.length, toIteratee = getIteratee();
  4901. pairs = !length ? [] : arrayMap(pairs, function(pair) {
  4902. if (typeof pair[1] != "function") {
  4903. throw new TypeError2(FUNC_ERROR_TEXT);
  4904. }
  4905. return [toIteratee(pair[0]), pair[1]];
  4906. });
  4907. return baseRest(function(args) {
  4908. var index = -1;
  4909. while (++index < length) {
  4910. var pair = pairs[index];
  4911. if (apply(pair[0], this, args)) {
  4912. return apply(pair[1], this, args);
  4913. }
  4914. }
  4915. });
  4916. }
  4917. function conforms(source) {
  4918. return baseConforms(baseClone(source, CLONE_DEEP_FLAG));
  4919. }
  4920. function constant(value) {
  4921. return function() {
  4922. return value;
  4923. };
  4924. }
  4925. function defaultTo(value, defaultValue) {
  4926. return value == null || value !== value ? defaultValue : value;
  4927. }
  4928. var flow = createFlow();
  4929. var flowRight = createFlow(true);
  4930. function identity(value) {
  4931. return value;
  4932. }
  4933. function iteratee(func) {
  4934. return baseIteratee(typeof func == "function" ? func : baseClone(func, CLONE_DEEP_FLAG));
  4935. }
  4936. function matches(source) {
  4937. return baseMatches(baseClone(source, CLONE_DEEP_FLAG));
  4938. }
  4939. function matchesProperty(path, srcValue) {
  4940. return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG));
  4941. }
  4942. var method = baseRest(function(path, args) {
  4943. return function(object) {
  4944. return baseInvoke(object, path, args);
  4945. };
  4946. });
  4947. var methodOf = baseRest(function(object, args) {
  4948. return function(path) {
  4949. return baseInvoke(object, path, args);
  4950. };
  4951. });
  4952. function mixin(object, source, options) {
  4953. var props = keys(source), methodNames = baseFunctions(source, props);
  4954. if (options == null && !(isObject(source) && (methodNames.length || !props.length))) {
  4955. options = source;
  4956. source = object;
  4957. object = this;
  4958. methodNames = baseFunctions(source, keys(source));
  4959. }
  4960. var chain2 = !(isObject(options) && "chain" in options) || !!options.chain, isFunc = isFunction(object);
  4961. arrayEach(methodNames, function(methodName) {
  4962. var func = source[methodName];
  4963. object[methodName] = func;
  4964. if (isFunc) {
  4965. object.prototype[methodName] = function() {
  4966. var chainAll = this.__chain__;
  4967. if (chain2 || chainAll) {
  4968. var result2 = object(this.__wrapped__), actions = result2.__actions__ = copyArray(this.__actions__);
  4969. actions.push({ "func": func, "args": arguments, "thisArg": object });
  4970. result2.__chain__ = chainAll;
  4971. return result2;
  4972. }
  4973. return func.apply(object, arrayPush([this.value()], arguments));
  4974. };
  4975. }
  4976. });
  4977. return object;
  4978. }
  4979. function noConflict() {
  4980. if (root._ === this) {
  4981. root._ = oldDash;
  4982. }
  4983. return this;
  4984. }
  4985. function noop() {
  4986. }
  4987. function nthArg(n) {
  4988. n = toInteger(n);
  4989. return baseRest(function(args) {
  4990. return baseNth(args, n);
  4991. });
  4992. }
  4993. var over = createOver(arrayMap);
  4994. var overEvery = createOver(arrayEvery);
  4995. var overSome = createOver(arraySome);
  4996. function property(path) {
  4997. return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
  4998. }
  4999. function propertyOf(object) {
  5000. return function(path) {
  5001. return object == null ? undefined : baseGet(object, path);
  5002. };
  5003. }
  5004. var range = createRange();
  5005. var rangeRight = createRange(true);
  5006. function stubArray() {
  5007. return [];
  5008. }
  5009. function stubFalse() {
  5010. return false;
  5011. }
  5012. function stubObject() {
  5013. return {};
  5014. }
  5015. function stubString() {
  5016. return "";
  5017. }
  5018. function stubTrue() {
  5019. return true;
  5020. }
  5021. function times(n, iteratee2) {
  5022. n = toInteger(n);
  5023. if (n < 1 || n > MAX_SAFE_INTEGER) {
  5024. return [];
  5025. }
  5026. var index = MAX_ARRAY_LENGTH, length = nativeMin(n, MAX_ARRAY_LENGTH);
  5027. iteratee2 = getIteratee(iteratee2);
  5028. n -= MAX_ARRAY_LENGTH;
  5029. var result2 = baseTimes(length, iteratee2);
  5030. while (++index < n) {
  5031. iteratee2(index);
  5032. }
  5033. return result2;
  5034. }
  5035. function toPath(value) {
  5036. if (isArray(value)) {
  5037. return arrayMap(value, toKey);
  5038. }
  5039. return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value)));
  5040. }
  5041. function uniqueId(prefix) {
  5042. var id = ++idCounter;
  5043. return toString(prefix) + id;
  5044. }
  5045. var add = createMathOperation(function(augend, addend) {
  5046. return augend + addend;
  5047. }, 0);
  5048. var ceil = createRound("ceil");
  5049. var divide = createMathOperation(function(dividend, divisor) {
  5050. return dividend / divisor;
  5051. }, 1);
  5052. var floor = createRound("floor");
  5053. function max(array) {
  5054. return array && array.length ? baseExtremum(array, identity, baseGt) : undefined;
  5055. }
  5056. function maxBy(array, iteratee2) {
  5057. return array && array.length ? baseExtremum(array, getIteratee(iteratee2, 2), baseGt) : undefined;
  5058. }
  5059. function mean(array) {
  5060. return baseMean(array, identity);
  5061. }
  5062. function meanBy(array, iteratee2) {
  5063. return baseMean(array, getIteratee(iteratee2, 2));
  5064. }
  5065. function min(array) {
  5066. return array && array.length ? baseExtremum(array, identity, baseLt) : undefined;
  5067. }
  5068. function minBy(array, iteratee2) {
  5069. return array && array.length ? baseExtremum(array, getIteratee(iteratee2, 2), baseLt) : undefined;
  5070. }
  5071. var multiply = createMathOperation(function(multiplier, multiplicand) {
  5072. return multiplier * multiplicand;
  5073. }, 1);
  5074. var round = createRound("round");
  5075. var subtract = createMathOperation(function(minuend, subtrahend) {
  5076. return minuend - subtrahend;
  5077. }, 0);
  5078. function sum(array) {
  5079. return array && array.length ? baseSum(array, identity) : 0;
  5080. }
  5081. function sumBy(array, iteratee2) {
  5082. return array && array.length ? baseSum(array, getIteratee(iteratee2, 2)) : 0;
  5083. }
  5084. lodash2.after = after;
  5085. lodash2.ary = ary;
  5086. lodash2.assign = assign;
  5087. lodash2.assignIn = assignIn;
  5088. lodash2.assignInWith = assignInWith;
  5089. lodash2.assignWith = assignWith;
  5090. lodash2.at = at;
  5091. lodash2.before = before;
  5092. lodash2.bind = bind;
  5093. lodash2.bindAll = bindAll;
  5094. lodash2.bindKey = bindKey;
  5095. lodash2.castArray = castArray;
  5096. lodash2.chain = chain;
  5097. lodash2.chunk = chunk;
  5098. lodash2.compact = compact;
  5099. lodash2.concat = concat;
  5100. lodash2.cond = cond;
  5101. lodash2.conforms = conforms;
  5102. lodash2.constant = constant;
  5103. lodash2.countBy = countBy;
  5104. lodash2.create = create;
  5105. lodash2.curry = curry;
  5106. lodash2.curryRight = curryRight;
  5107. lodash2.debounce = debounce;
  5108. lodash2.defaults = defaults;
  5109. lodash2.defaultsDeep = defaultsDeep;
  5110. lodash2.defer = defer;
  5111. lodash2.delay = delay;
  5112. lodash2.difference = difference;
  5113. lodash2.differenceBy = differenceBy;
  5114. lodash2.differenceWith = differenceWith;
  5115. lodash2.drop = drop;
  5116. lodash2.dropRight = dropRight;
  5117. lodash2.dropRightWhile = dropRightWhile;
  5118. lodash2.dropWhile = dropWhile;
  5119. lodash2.fill = fill;
  5120. lodash2.filter = filter;
  5121. lodash2.flatMap = flatMap;
  5122. lodash2.flatMapDeep = flatMapDeep;
  5123. lodash2.flatMapDepth = flatMapDepth;
  5124. lodash2.flatten = flatten;
  5125. lodash2.flattenDeep = flattenDeep;
  5126. lodash2.flattenDepth = flattenDepth;
  5127. lodash2.flip = flip;
  5128. lodash2.flow = flow;
  5129. lodash2.flowRight = flowRight;
  5130. lodash2.fromPairs = fromPairs;
  5131. lodash2.functions = functions;
  5132. lodash2.functionsIn = functionsIn;
  5133. lodash2.groupBy = groupBy;
  5134. lodash2.initial = initial;
  5135. lodash2.intersection = intersection;
  5136. lodash2.intersectionBy = intersectionBy;
  5137. lodash2.intersectionWith = intersectionWith;
  5138. lodash2.invert = invert;
  5139. lodash2.invertBy = invertBy;
  5140. lodash2.invokeMap = invokeMap;
  5141. lodash2.iteratee = iteratee;
  5142. lodash2.keyBy = keyBy;
  5143. lodash2.keys = keys;
  5144. lodash2.keysIn = keysIn;
  5145. lodash2.map = map;
  5146. lodash2.mapKeys = mapKeys;
  5147. lodash2.mapValues = mapValues;
  5148. lodash2.matches = matches;
  5149. lodash2.matchesProperty = matchesProperty;
  5150. lodash2.memoize = memoize;
  5151. lodash2.merge = merge;
  5152. lodash2.mergeWith = mergeWith;
  5153. lodash2.method = method;
  5154. lodash2.methodOf = methodOf;
  5155. lodash2.mixin = mixin;
  5156. lodash2.negate = negate;
  5157. lodash2.nthArg = nthArg;
  5158. lodash2.omit = omit;
  5159. lodash2.omitBy = omitBy;
  5160. lodash2.once = once;
  5161. lodash2.orderBy = orderBy;
  5162. lodash2.over = over;
  5163. lodash2.overArgs = overArgs;
  5164. lodash2.overEvery = overEvery;
  5165. lodash2.overSome = overSome;
  5166. lodash2.partial = partial;
  5167. lodash2.partialRight = partialRight;
  5168. lodash2.partition = partition;
  5169. lodash2.pick = pick;
  5170. lodash2.pickBy = pickBy;
  5171. lodash2.property = property;
  5172. lodash2.propertyOf = propertyOf;
  5173. lodash2.pull = pull;
  5174. lodash2.pullAll = pullAll;
  5175. lodash2.pullAllBy = pullAllBy;
  5176. lodash2.pullAllWith = pullAllWith;
  5177. lodash2.pullAt = pullAt;
  5178. lodash2.range = range;
  5179. lodash2.rangeRight = rangeRight;
  5180. lodash2.rearg = rearg;
  5181. lodash2.reject = reject;
  5182. lodash2.remove = remove;
  5183. lodash2.rest = rest;
  5184. lodash2.reverse = reverse;
  5185. lodash2.sampleSize = sampleSize;
  5186. lodash2.set = set;
  5187. lodash2.setWith = setWith;
  5188. lodash2.shuffle = shuffle;
  5189. lodash2.slice = slice;
  5190. lodash2.sortBy = sortBy;
  5191. lodash2.sortedUniq = sortedUniq;
  5192. lodash2.sortedUniqBy = sortedUniqBy;
  5193. lodash2.split = split;
  5194. lodash2.spread = spread;
  5195. lodash2.tail = tail;
  5196. lodash2.take = take;
  5197. lodash2.takeRight = takeRight;
  5198. lodash2.takeRightWhile = takeRightWhile;
  5199. lodash2.takeWhile = takeWhile;
  5200. lodash2.tap = tap;
  5201. lodash2.throttle = throttle;
  5202. lodash2.thru = thru;
  5203. lodash2.toArray = toArray;
  5204. lodash2.toPairs = toPairs;
  5205. lodash2.toPairsIn = toPairsIn;
  5206. lodash2.toPath = toPath;
  5207. lodash2.toPlainObject = toPlainObject;
  5208. lodash2.transform = transform;
  5209. lodash2.unary = unary;
  5210. lodash2.union = union;
  5211. lodash2.unionBy = unionBy;
  5212. lodash2.unionWith = unionWith;
  5213. lodash2.uniq = uniq;
  5214. lodash2.uniqBy = uniqBy;
  5215. lodash2.uniqWith = uniqWith;
  5216. lodash2.unset = unset;
  5217. lodash2.unzip = unzip;
  5218. lodash2.unzipWith = unzipWith;
  5219. lodash2.update = update;
  5220. lodash2.updateWith = updateWith;
  5221. lodash2.values = values;
  5222. lodash2.valuesIn = valuesIn;
  5223. lodash2.without = without;
  5224. lodash2.words = words;
  5225. lodash2.wrap = wrap;
  5226. lodash2.xor = xor;
  5227. lodash2.xorBy = xorBy;
  5228. lodash2.xorWith = xorWith;
  5229. lodash2.zip = zip;
  5230. lodash2.zipObject = zipObject;
  5231. lodash2.zipObjectDeep = zipObjectDeep;
  5232. lodash2.zipWith = zipWith;
  5233. lodash2.entries = toPairs;
  5234. lodash2.entriesIn = toPairsIn;
  5235. lodash2.extend = assignIn;
  5236. lodash2.extendWith = assignInWith;
  5237. mixin(lodash2, lodash2);
  5238. lodash2.add = add;
  5239. lodash2.attempt = attempt;
  5240. lodash2.camelCase = camelCase;
  5241. lodash2.capitalize = capitalize;
  5242. lodash2.ceil = ceil;
  5243. lodash2.clamp = clamp;
  5244. lodash2.clone = clone;
  5245. lodash2.cloneDeep = cloneDeep;
  5246. lodash2.cloneDeepWith = cloneDeepWith;
  5247. lodash2.cloneWith = cloneWith;
  5248. lodash2.conformsTo = conformsTo;
  5249. lodash2.deburr = deburr;
  5250. lodash2.defaultTo = defaultTo;
  5251. lodash2.divide = divide;
  5252. lodash2.endsWith = endsWith;
  5253. lodash2.eq = eq;
  5254. lodash2.escape = escape;
  5255. lodash2.escapeRegExp = escapeRegExp;
  5256. lodash2.every = every;
  5257. lodash2.find = find;
  5258. lodash2.findIndex = findIndex;
  5259. lodash2.findKey = findKey;
  5260. lodash2.findLast = findLast;
  5261. lodash2.findLastIndex = findLastIndex;
  5262. lodash2.findLastKey = findLastKey;
  5263. lodash2.floor = floor;
  5264. lodash2.forEach = forEach;
  5265. lodash2.forEachRight = forEachRight;
  5266. lodash2.forIn = forIn;
  5267. lodash2.forInRight = forInRight;
  5268. lodash2.forOwn = forOwn;
  5269. lodash2.forOwnRight = forOwnRight;
  5270. lodash2.get = get;
  5271. lodash2.gt = gt;
  5272. lodash2.gte = gte;
  5273. lodash2.has = has;
  5274. lodash2.hasIn = hasIn;
  5275. lodash2.head = head;
  5276. lodash2.identity = identity;
  5277. lodash2.includes = includes;
  5278. lodash2.indexOf = indexOf;
  5279. lodash2.inRange = inRange;
  5280. lodash2.invoke = invoke;
  5281. lodash2.isArguments = isArguments;
  5282. lodash2.isArray = isArray;
  5283. lodash2.isArrayBuffer = isArrayBuffer;
  5284. lodash2.isArrayLike = isArrayLike;
  5285. lodash2.isArrayLikeObject = isArrayLikeObject;
  5286. lodash2.isBoolean = isBoolean;
  5287. lodash2.isBuffer = isBuffer;
  5288. lodash2.isDate = isDate;
  5289. lodash2.isElement = isElement;
  5290. lodash2.isEmpty = isEmpty;
  5291. lodash2.isEqual = isEqual;
  5292. lodash2.isEqualWith = isEqualWith;
  5293. lodash2.isError = isError;
  5294. lodash2.isFinite = isFinite;
  5295. lodash2.isFunction = isFunction;
  5296. lodash2.isInteger = isInteger;
  5297. lodash2.isLength = isLength;
  5298. lodash2.isMap = isMap;
  5299. lodash2.isMatch = isMatch;
  5300. lodash2.isMatchWith = isMatchWith;
  5301. lodash2.isNaN = isNaN;
  5302. lodash2.isNative = isNative;
  5303. lodash2.isNil = isNil;
  5304. lodash2.isNull = isNull;
  5305. lodash2.isNumber = isNumber;
  5306. lodash2.isObject = isObject;
  5307. lodash2.isObjectLike = isObjectLike;
  5308. lodash2.isPlainObject = isPlainObject;
  5309. lodash2.isRegExp = isRegExp;
  5310. lodash2.isSafeInteger = isSafeInteger;
  5311. lodash2.isSet = isSet;
  5312. lodash2.isString = isString;
  5313. lodash2.isSymbol = isSymbol;
  5314. lodash2.isTypedArray = isTypedArray;
  5315. lodash2.isUndefined = isUndefined;
  5316. lodash2.isWeakMap = isWeakMap;
  5317. lodash2.isWeakSet = isWeakSet;
  5318. lodash2.join = join;
  5319. lodash2.kebabCase = kebabCase;
  5320. lodash2.last = last;
  5321. lodash2.lastIndexOf = lastIndexOf;
  5322. lodash2.lowerCase = lowerCase;
  5323. lodash2.lowerFirst = lowerFirst;
  5324. lodash2.lt = lt;
  5325. lodash2.lte = lte;
  5326. lodash2.max = max;
  5327. lodash2.maxBy = maxBy;
  5328. lodash2.mean = mean;
  5329. lodash2.meanBy = meanBy;
  5330. lodash2.min = min;
  5331. lodash2.minBy = minBy;
  5332. lodash2.stubArray = stubArray;
  5333. lodash2.stubFalse = stubFalse;
  5334. lodash2.stubObject = stubObject;
  5335. lodash2.stubString = stubString;
  5336. lodash2.stubTrue = stubTrue;
  5337. lodash2.multiply = multiply;
  5338. lodash2.nth = nth;
  5339. lodash2.noConflict = noConflict;
  5340. lodash2.noop = noop;
  5341. lodash2.now = now;
  5342. lodash2.pad = pad;
  5343. lodash2.padEnd = padEnd;
  5344. lodash2.padStart = padStart;
  5345. lodash2.parseInt = parseInt2;
  5346. lodash2.random = random;
  5347. lodash2.reduce = reduce;
  5348. lodash2.reduceRight = reduceRight;
  5349. lodash2.repeat = repeat;
  5350. lodash2.replace = replace;
  5351. lodash2.result = result;
  5352. lodash2.round = round;
  5353. lodash2.runInContext = runInContext2;
  5354. lodash2.sample = sample;
  5355. lodash2.size = size;
  5356. lodash2.snakeCase = snakeCase;
  5357. lodash2.some = some;
  5358. lodash2.sortedIndex = sortedIndex;
  5359. lodash2.sortedIndexBy = sortedIndexBy;
  5360. lodash2.sortedIndexOf = sortedIndexOf;
  5361. lodash2.sortedLastIndex = sortedLastIndex;
  5362. lodash2.sortedLastIndexBy = sortedLastIndexBy;
  5363. lodash2.sortedLastIndexOf = sortedLastIndexOf;
  5364. lodash2.startCase = startCase;
  5365. lodash2.startsWith = startsWith;
  5366. lodash2.subtract = subtract;
  5367. lodash2.sum = sum;
  5368. lodash2.sumBy = sumBy;
  5369. lodash2.template = template;
  5370. lodash2.times = times;
  5371. lodash2.toFinite = toFinite;
  5372. lodash2.toInteger = toInteger;
  5373. lodash2.toLength = toLength;
  5374. lodash2.toLower = toLower;
  5375. lodash2.toNumber = toNumber;
  5376. lodash2.toSafeInteger = toSafeInteger;
  5377. lodash2.toString = toString;
  5378. lodash2.toUpper = toUpper;
  5379. lodash2.trim = trim;
  5380. lodash2.trimEnd = trimEnd;
  5381. lodash2.trimStart = trimStart;
  5382. lodash2.truncate = truncate;
  5383. lodash2.unescape = unescape;
  5384. lodash2.uniqueId = uniqueId;
  5385. lodash2.upperCase = upperCase;
  5386. lodash2.upperFirst = upperFirst;
  5387. lodash2.each = forEach;
  5388. lodash2.eachRight = forEachRight;
  5389. lodash2.first = head;
  5390. mixin(lodash2, function() {
  5391. var source = {};
  5392. baseForOwn(lodash2, function(func, methodName) {
  5393. if (!hasOwnProperty.call(lodash2.prototype, methodName)) {
  5394. source[methodName] = func;
  5395. }
  5396. });
  5397. return source;
  5398. }(), { "chain": false });
  5399. lodash2.VERSION = VERSION;
  5400. arrayEach(["bind", "bindKey", "curry", "curryRight", "partial", "partialRight"], function(methodName) {
  5401. lodash2[methodName].placeholder = lodash2;
  5402. });
  5403. arrayEach(["drop", "take"], function(methodName, index) {
  5404. LazyWrapper.prototype[methodName] = function(n) {
  5405. n = n === undefined ? 1 : nativeMax(toInteger(n), 0);
  5406. var result2 = this.__filtered__ && !index ? new LazyWrapper(this) : this.clone();
  5407. if (result2.__filtered__) {
  5408. result2.__takeCount__ = nativeMin(n, result2.__takeCount__);
  5409. } else {
  5410. result2.__views__.push({
  5411. "size": nativeMin(n, MAX_ARRAY_LENGTH),
  5412. "type": methodName + (result2.__dir__ < 0 ? "Right" : "")
  5413. });
  5414. }
  5415. return result2;
  5416. };
  5417. LazyWrapper.prototype[methodName + "Right"] = function(n) {
  5418. return this.reverse()[methodName](n).reverse();
  5419. };
  5420. });
  5421. arrayEach(["filter", "map", "takeWhile"], function(methodName, index) {
  5422. var type = index + 1, isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG;
  5423. LazyWrapper.prototype[methodName] = function(iteratee2) {
  5424. var result2 = this.clone();
  5425. result2.__iteratees__.push({
  5426. "iteratee": getIteratee(iteratee2, 3),
  5427. "type": type
  5428. });
  5429. result2.__filtered__ = result2.__filtered__ || isFilter;
  5430. return result2;
  5431. };
  5432. });
  5433. arrayEach(["head", "last"], function(methodName, index) {
  5434. var takeName = "take" + (index ? "Right" : "");
  5435. LazyWrapper.prototype[methodName] = function() {
  5436. return this[takeName](1).value()[0];
  5437. };
  5438. });
  5439. arrayEach(["initial", "tail"], function(methodName, index) {
  5440. var dropName = "drop" + (index ? "" : "Right");
  5441. LazyWrapper.prototype[methodName] = function() {
  5442. return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1);
  5443. };
  5444. });
  5445. LazyWrapper.prototype.compact = function() {
  5446. return this.filter(identity);
  5447. };
  5448. LazyWrapper.prototype.find = function(predicate) {
  5449. return this.filter(predicate).head();
  5450. };
  5451. LazyWrapper.prototype.findLast = function(predicate) {
  5452. return this.reverse().find(predicate);
  5453. };
  5454. LazyWrapper.prototype.invokeMap = baseRest(function(path, args) {
  5455. if (typeof path == "function") {
  5456. return new LazyWrapper(this);
  5457. }
  5458. return this.map(function(value) {
  5459. return baseInvoke(value, path, args);
  5460. });
  5461. });
  5462. LazyWrapper.prototype.reject = function(predicate) {
  5463. return this.filter(negate(getIteratee(predicate)));
  5464. };
  5465. LazyWrapper.prototype.slice = function(start, end) {
  5466. start = toInteger(start);
  5467. var result2 = this;
  5468. if (result2.__filtered__ && (start > 0 || end < 0)) {
  5469. return new LazyWrapper(result2);
  5470. }
  5471. if (start < 0) {
  5472. result2 = result2.takeRight(-start);
  5473. } else if (start) {
  5474. result2 = result2.drop(start);
  5475. }
  5476. if (end !== undefined) {
  5477. end = toInteger(end);
  5478. result2 = end < 0 ? result2.dropRight(-end) : result2.take(end - start);
  5479. }
  5480. return result2;
  5481. };
  5482. LazyWrapper.prototype.takeRightWhile = function(predicate) {
  5483. return this.reverse().takeWhile(predicate).reverse();
  5484. };
  5485. LazyWrapper.prototype.toArray = function() {
  5486. return this.take(MAX_ARRAY_LENGTH);
  5487. };
  5488. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  5489. var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName), isTaker = /^(?:head|last)$/.test(methodName), lodashFunc = lodash2[isTaker ? "take" + (methodName == "last" ? "Right" : "") : methodName], retUnwrapped = isTaker || /^find/.test(methodName);
  5490. if (!lodashFunc) {
  5491. return;
  5492. }
  5493. lodash2.prototype[methodName] = function() {
  5494. var value = this.__wrapped__, args = isTaker ? [1] : arguments, isLazy = value instanceof LazyWrapper, iteratee2 = args[0], useLazy = isLazy || isArray(value);
  5495. var interceptor = function(value2) {
  5496. var result3 = lodashFunc.apply(lodash2, arrayPush([value2], args));
  5497. return isTaker && chainAll ? result3[0] : result3;
  5498. };
  5499. if (useLazy && checkIteratee && typeof iteratee2 == "function" && iteratee2.length != 1) {
  5500. isLazy = useLazy = false;
  5501. }
  5502. var chainAll = this.__chain__, isHybrid = !!this.__actions__.length, isUnwrapped = retUnwrapped && !chainAll, onlyLazy = isLazy && !isHybrid;
  5503. if (!retUnwrapped && useLazy) {
  5504. value = onlyLazy ? value : new LazyWrapper(this);
  5505. var result2 = func.apply(value, args);
  5506. result2.__actions__.push({ "func": thru, "args": [interceptor], "thisArg": undefined });
  5507. return new LodashWrapper(result2, chainAll);
  5508. }
  5509. if (isUnwrapped && onlyLazy) {
  5510. return func.apply(this, args);
  5511. }
  5512. result2 = this.thru(interceptor);
  5513. return isUnwrapped ? isTaker ? result2.value()[0] : result2.value() : result2;
  5514. };
  5515. });
  5516. arrayEach(["pop", "push", "shift", "sort", "splice", "unshift"], function(methodName) {
  5517. var func = arrayProto[methodName], chainName = /^(?:push|sort|unshift)$/.test(methodName) ? "tap" : "thru", retUnwrapped = /^(?:pop|shift)$/.test(methodName);
  5518. lodash2.prototype[methodName] = function() {
  5519. var args = arguments;
  5520. if (retUnwrapped && !this.__chain__) {
  5521. var value = this.value();
  5522. return func.apply(isArray(value) ? value : [], args);
  5523. }
  5524. return this[chainName](function(value2) {
  5525. return func.apply(isArray(value2) ? value2 : [], args);
  5526. });
  5527. };
  5528. });
  5529. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  5530. var lodashFunc = lodash2[methodName];
  5531. if (lodashFunc) {
  5532. var key = lodashFunc.name + "";
  5533. if (!hasOwnProperty.call(realNames, key)) {
  5534. realNames[key] = [];
  5535. }
  5536. realNames[key].push({ "name": methodName, "func": lodashFunc });
  5537. }
  5538. });
  5539. realNames[createHybrid(undefined, WRAP_BIND_KEY_FLAG).name] = [{
  5540. "name": "wrapper",
  5541. "func": undefined
  5542. }];
  5543. LazyWrapper.prototype.clone = lazyClone;
  5544. LazyWrapper.prototype.reverse = lazyReverse;
  5545. LazyWrapper.prototype.value = lazyValue;
  5546. lodash2.prototype.at = wrapperAt;
  5547. lodash2.prototype.chain = wrapperChain;
  5548. lodash2.prototype.commit = wrapperCommit;
  5549. lodash2.prototype.next = wrapperNext;
  5550. lodash2.prototype.plant = wrapperPlant;
  5551. lodash2.prototype.reverse = wrapperReverse;
  5552. lodash2.prototype.toJSON = lodash2.prototype.valueOf = lodash2.prototype.value = wrapperValue;
  5553. lodash2.prototype.first = lodash2.prototype.head;
  5554. if (symIterator) {
  5555. lodash2.prototype[symIterator] = wrapperToIterator;
  5556. }
  5557. return lodash2;
  5558. };
  5559. var _ = runInContext();
  5560. if (typeof define == "function" && typeof define.amd == "object" && define.amd) {
  5561. root._ = _;
  5562. define(function() {
  5563. return _;
  5564. });
  5565. } else if (freeModule) {
  5566. (freeModule.exports = _)._ = _;
  5567. freeExports._ = _;
  5568. } else {
  5569. root._ = _;
  5570. }
  5571. }).call(exports);
  5572. }
  5573. });
  5574.  
  5575. // src/monkey/gitlab-enhance/index.ts
  5576. init_GM_addStyle();
  5577.  
  5578. // src/monkey/gitlab-enhance/settings/ci_cd.ts
  5579. init_GM_addStyle();
  5580.  
  5581. // src/monkey/gitlab-enhance/settings/ci_cd.css
  5582. var ci_cd_default = ".content-wrapper nav{max-width:100%}.content-wrapper .container-fluid{max-width:100%}.ci-variable-table table colgroup col:nth-child(3){width:100px}.ci-variable-table table colgroup col:nth-child(4){width:200px}.ci-variable-table table colgroup col:nth-child(5){width:50px}\n";
  5583.  
  5584. // src/monkey/gitlab-enhance/settings/ci_cd.ts
  5585. if (location.pathname.endsWith("/-/settings/ci_cd")) {
  5586. setTimeout(() => GM_addStyle(ci_cd_default), 25);
  5587. }
  5588.  
  5589. // src/monkey/gitlab-enhance/dashboard/merge_requests.ts
  5590. init_GM_addStyle();
  5591. var hyperlinkResource = () => {
  5592. const mergeRequests = $(".merge-request:not([hyperlinked])");
  5593. mergeRequests.each((_, mergeRequestEle) => {
  5594. const href = $(".js-prefetch-document", mergeRequestEle).attr("href");
  5595. if (!href) return;
  5596. const resourceUrl = href.replace(/\/-\/merge_requests\/\d+$/, "");
  5597. const rawRefEle = $(".issuable-reference", mergeRequestEle);
  5598. const rawRefName = rawRefEle.text();
  5599. const [resourceName, number] = rawRefName.split("!");
  5600. rawRefEle.html(`<a href="${resourceUrl}">${resourceName}</a>!${number}`);
  5601. $(mergeRequestEle).attr("hyperlinked", "");
  5602. });
  5603. };
  5604. if (location.pathname.endsWith("/dashboard/merge_requests")) {
  5605. $(".issuable-list").on("mouseenter", hyperlinkResource);
  5606. setTimeout(hyperlinkResource, 1e3);
  5607. }
  5608.  
  5609. // src/monkey/gitlab-enhance/merge_requests/new.ts
  5610. init_GM_addStyle();
  5611.  
  5612. // src/monkey/gitlab-enhance/utils.ts
  5613. init_GM_addStyle();
  5614. var getButtonElement = (text2) => {
  5615. const classnames = "gl-font-sm! gl-ml-3 gl-button btn btn-default btn-sm";
  5616. return $(`<a class="${classnames}">${text2}</a>`);
  5617. };
  5618.  
  5619. // src/monkey/gitlab-enhance/merge_requests/template.ts
  5620. init_GM_addStyle();
  5621.  
  5622. // packages/MdGenerator/index.ts
  5623. init_GM_addStyle();
  5624. var import_lodash = __toESM(require_lodash());
  5625.  
  5626. // packages/MdGenerator/MdTools.ts
  5627. init_GM_addStyle();
  5628. var INDENT_SPACE_LENGTH = 2;
  5629. function indent(level, content = "") {
  5630. return `${Array((level - 1) * INDENT_SPACE_LENGTH).fill(" ").join("")}${content}`;
  5631. }
  5632. function enter() {
  5633. return "\n";
  5634. }
  5635. var header = (level) => (text2 = "") => `${Array(level).fill("#").join("")} ${text2}`.trim();
  5636. function h1(...args) {
  5637. return header(1)(...args);
  5638. }
  5639. function h2(...args) {
  5640. return header(2)(...args);
  5641. }
  5642. function h3(...args) {
  5643. return header(3)(...args);
  5644. }
  5645. function h4(...args) {
  5646. return header(4)(...args);
  5647. }
  5648. function h5(...args) {
  5649. return header(5)(...args);
  5650. }
  5651. function text(content = "") {
  5652. return content;
  5653. }
  5654. function anchor(key, url) {
  5655. return `[${key}]: ${url}`;
  5656. }
  5657. function hyperlink(label, url) {
  5658. return `[${label}](${url})`;
  5659. }
  5660. function hyperlinkWithKey(label, key) {
  5661. return `[${label}][${key}]`;
  5662. }
  5663. function image(url, alt = "") {
  5664. return `!${hyperlink(alt, url)}`;
  5665. }
  5666. function imageByKey(key, alt = "") {
  5667. return `!${hyperlinkWithKey(alt, key)}`;
  5668. }
  5669. function listItem(text2 = "") {
  5670. return `- ${text2}`.trimEnd();
  5671. }
  5672. function taskItem(text2 = "", { selected = false } = {}) {
  5673. return `[${selected ? "x" : " "}] ${text2}`.trimEnd();
  5674. }
  5675.  
  5676. // packages/MdGenerator/index.ts
  5677. function getOption(options, key, defaultValue) {
  5678. return options[key] ?? defaultValue;
  5679. }
  5680. function getLevelFromOptions(options = {}) {
  5681. const { level = 1 } = options;
  5682. return level;
  5683. }
  5684. var Template = class {
  5685. constructor(text2) {
  5686. this.anchorMap = {};
  5687. this.templateContent = text2;
  5688. this.headerNextUtils = {
  5689. text: this.text.bind(this),
  5690. image: this.image.bind(this),
  5691. hyperlink: this.hyperlink.bind(this),
  5692. listItem: this.listItem.bind(this),
  5693. taskItem: this.taskItem.bind(this)
  5694. };
  5695. this.contentNextUtils = {
  5696. ...this.headerNextUtils,
  5697. end: this.emptyLine.bind(this)
  5698. };
  5699. }
  5700. h1(text2) {
  5701. this.text(h1(text2));
  5702. this.emptyLine();
  5703. return this.headerNextUtils;
  5704. }
  5705. h2(text2) {
  5706. this.text(h2(text2));
  5707. this.emptyLine();
  5708. return this.headerNextUtils;
  5709. }
  5710. h3(text2) {
  5711. this.text(h3(text2));
  5712. this.emptyLine();
  5713. return this.headerNextUtils;
  5714. }
  5715. h4(text2) {
  5716. this.text(h4(text2));
  5717. this.emptyLine();
  5718. return this.headerNextUtils;
  5719. }
  5720. h5(text2) {
  5721. this.text(h5(text2));
  5722. this.emptyLine();
  5723. return this.headerNextUtils;
  5724. }
  5725. [Symbol.toStringTag]() {
  5726. return [
  5727. this.templateContent,
  5728. this.templateContent && !/\n$/.test(this.templateContent) && enter(),
  5729. Object.keys(this.anchorMap).length && enter(),
  5730. Object.entries(this.anchorMap).map(([key, value]) => anchor(key, value)).join(enter()),
  5731. Object.keys(this.anchorMap).length && enter()
  5732. ].filter(Boolean).join("").replace(/\n(\s*\n){2,}/g, "\n\n");
  5733. }
  5734. text(content = "", opts) {
  5735. this.templateContent += indent(getLevelFromOptions(opts), `${text(content)}${enter()}`);
  5736. return this.contentNextUtils;
  5737. }
  5738. listItem(text2 = "", opts) {
  5739. return this.text(listItem(text2), { level: getLevelFromOptions(opts) });
  5740. }
  5741. taskItem(text2 = "", opts) {
  5742. return this.listItem(taskItem(text2, { selected: getOption(opts || {}, "selected", false) }), { level: getLevelFromOptions(opts) });
  5743. }
  5744. hyperlink(text2, link, opts) {
  5745. let content;
  5746. const anchorKey = getOption(opts || {}, "anchorKey", "");
  5747. if (typeof anchorKey === "string" && anchorKey.length) {
  5748. anchor(anchorKey, link);
  5749. content = hyperlinkWithKey(text2, anchorKey);
  5750. } else {
  5751. content = hyperlink(text2, link);
  5752. }
  5753. return this.text(content, { level: getLevelFromOptions(opts) });
  5754. }
  5755. image(url, opts) {
  5756. let content;
  5757. const anchorKey = getOption(opts || {}, "anchorKey", "");
  5758. const alt = getOption(opts || {}, "alt", "");
  5759. if (typeof anchorKey === "string" && anchorKey.length) {
  5760. this.anchor(anchorKey, url);
  5761. content = imageByKey(alt, anchorKey);
  5762. } else {
  5763. content = image(alt, url);
  5764. }
  5765. return this.text(content, { level: getLevelFromOptions(opts) });
  5766. }
  5767. table(opts) {
  5768. const tableMap = { header: [], body: [] };
  5769. const actionMap = {
  5770. header: (row) => {
  5771. row.forEach(({ key, title }) => {
  5772. tableMap.header.push({ key, title });
  5773. });
  5774. return actionMap;
  5775. },
  5776. body: (row) => {
  5777. tableMap.body.push(row);
  5778. return actionMap;
  5779. },
  5780. end: () => {
  5781. if (!tableMap.header.length) return "";
  5782. const { header: header2, body } = tableMap;
  5783. const headerContent = header2.map(({ title }) => `|${title}`).join("") + "|";
  5784. this.text(headerContent, { level: getLevelFromOptions(opts) });
  5785. const separator = header2.map(() => "|--").join("") + "|";
  5786. this.text(separator, { level: getLevelFromOptions(opts) });
  5787. body.forEach((row) => {
  5788. const content = header2.map(({ key }) => `|${(row[key] ?? "").toString().replace(/\|/g, "|")}`).join("") + "|";
  5789. this.text(content, { level: getLevelFromOptions(opts) });
  5790. });
  5791. }
  5792. };
  5793. return actionMap;
  5794. }
  5795. anchor(key, link) {
  5796. this.anchorMap[key] = link;
  5797. }
  5798. emptyLine() {
  5799. if (!this.templateContent.endsWith(enter())) {
  5800. this.templateContent += enter();
  5801. }
  5802. this.templateContent += enter();
  5803. }
  5804. modify(callback) {
  5805. this.templateContent = callback(import_lodash.default.cloneDeep(this.templateContent));
  5806. return this.contentNextUtils;
  5807. }
  5808. };
  5809. var genTemplate = (callback = () => {
  5810. }) => {
  5811. return readTemplate("", callback);
  5812. };
  5813. var readTemplate = (text2, callback = () => {
  5814. }) => {
  5815. const templateInst = new Template(import_lodash.default.cloneDeep(text2));
  5816. callback(templateInst);
  5817. return templateInst[Symbol.toStringTag]();
  5818. };
  5819.  
  5820. // src/monkey/gitlab-enhance/merge_requests/template.css
  5821. var template_default = ".gl-display-flex:has([for=merge_request_description]){align-items:baseline}\n";
  5822.  
  5823. // src/monkey/gitlab-enhance/merge_requests/template.ts
  5824. var getBranchType = () => {
  5825. const fromBranchName = $(".align-self-center code:not([data-branch-name])").text();
  5826. const prefixBranchName = fromBranchName.split("/")[0].toLowerCase();
  5827. switch (prefixBranchName) {
  5828. case "feature":
  5829. case "feat":
  5830. return 0 /* FEATURE */;
  5831. case "fix":
  5832. case "bugfix":
  5833. return 1 /* BUGFIX */;
  5834. case "hotfix":
  5835. return 2 /* HOTFIX */;
  5836. case "devops":
  5837. case "chore":
  5838. case "test":
  5839. case "doc":
  5840. case "docs":
  5841. return 3 /* TASKS */;
  5842. default:
  5843. return 4 /* OTHERS */;
  5844. }
  5845. };
  5846. var generateTemplate = () => {
  5847. const branchType = getBranchType();
  5848. return genTemplate((utils) => {
  5849. utils.h2("Type").taskItem("Feature (Story/Refactor)", { selected: branchType === 0 /* FEATURE */ }).taskItem(`Bugfix`, { selected: branchType === 1 /* BUGFIX */ }).taskItem(`Hotfix (Production Issues)`, { selected: branchType === 2 /* HOTFIX */ }).taskItem(`Tasks (DevOps / Unit Test / Document Update)`, { selected: branchType === 3 /* TASKS */ }).taskItem(`Others`, { selected: branchType === 4 /* OTHERS */ }).end();
  5850. utils.h2("Description");
  5851. if (branchType !== 0 /* FEATURE */) {
  5852. utils.h3("Why (Why does this happen?)").listItem().end();
  5853. utils.h3("How (How can we avoid or solve it?)").listItem().end();
  5854. }
  5855. utils.h3("What (What did you do this time?)").listItem().end();
  5856. if (branchType !== 3 /* TASKS */) {
  5857. utils.h3("Results (Screenshot, etc)");
  5858. utils.h4("Before modification");
  5859. utils.h4("After modification");
  5860. utils.h2("Affected Zone").listItem("Affected Module(s):").listItem("Affected URL(s):").end();
  5861. }
  5862. utils.h2("External resources (Mention, Resolves, or Closes)");
  5863. });
  5864. };
  5865. var appendTemplateButton = () => {
  5866. GM_addStyle(template_default);
  5867. const text2 = "Copy Template";
  5868. const btnElement = getButtonElement(text2);
  5869. const templateContent = generateTemplate();
  5870. const hint = $('<span class="gl-font-sm! gl-ml-3 gl-text-secondary"></span>');
  5871. let setTimeoutId;
  5872. btnElement.on("click", async () => {
  5873. hint.remove();
  5874. setTimeoutId && clearTimeout(setTimeoutId);
  5875. hint.text("Copying...");
  5876. btnElement.after(hint);
  5877. await GM_setClipboard(templateContent, "text", () => {
  5878. hint.text("Copied!");
  5879. setTimeoutId = setTimeout(() => hint.remove(), 3e3);
  5880. });
  5881. });
  5882. $(".gl-display-flex:has([for=merge_request_description])").append(btnElement);
  5883. };
  5884.  
  5885. // src/monkey/gitlab-enhance/merge_requests/new.ts
  5886. var appendAsTitleButton = () => {
  5887. $(".commit-content").each((_, el) => {
  5888. const titleElements = $(".item-title", el);
  5889. const title = titleElements.text();
  5890. const btnElement = getButtonElement("As title");
  5891. btnElement.on("click", () => {
  5892. $("input[data-testid=issuable-form-title-field]").val(title);
  5893. $("input[data-testid=issuable-form-title-field]").focus();
  5894. });
  5895. $(".committer", el).before(btnElement);
  5896. });
  5897. };
  5898. if (location.pathname.endsWith("/-/merge_requests/new")) {
  5899. setTimeout(() => {
  5900. appendTemplateButton();
  5901. appendAsTitleButton();
  5902. }, 1e3);
  5903. }
  5904.  
  5905. // src/monkey/gitlab-enhance/merge_requests/edit.ts
  5906. init_GM_addStyle();
  5907. if (/\/-\/merge_requests\/\d+\/edit$/.test(location.pathname)) {
  5908. setTimeout(() => {
  5909. appendTemplateButton();
  5910. }, 1e3);
  5911. }
  5912. })();
  5913. /*! Bundled license information:
  5914.  
  5915. lodash/lodash.js:
  5916. (**
  5917. * @license
  5918. * Lodash <https://lodash.com/>
  5919. * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
  5920. * Released under MIT license <https://lodash.com/license>
  5921. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  5922. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  5923. *)
  5924. */