Compare commits

..

119 Commits
1.2.1 ... 1.3.0

Author SHA1 Message Date
Benjamin Tan
7ac57c2785 Update v1.3.0 docs 2015-01-23 15:50:13 +08:00
John-David Dalton
f90f2e051a Bump to v1.3.0.
Former-commit-id: 4b8a4e90b97d2960445073cd4288af19dadc9266
2013-06-11 08:33:35 -07:00
John-David Dalton
24f49c8d83 Ensure _.throttle passes underscore unit tests in all environments.
Former-commit-id: 5867875313995ed02a94cd879d537c295b8a5c5f
2013-06-11 08:19:54 -07:00
John-David Dalton
a4ebaf15ab Remove lodash.js from .npmignore.
Former-commit-id: 437fe2fa2e19d4de8f83e2f760cf9da854ded128
2013-06-10 23:55:13 -07:00
John-David Dalton
54a46dccc3 Correct _.throttle method dependencies.
Former-commit-id: 2118e1789803a042675fcc8acb19f1904a102578
2013-06-10 12:37:24 -07:00
John-David Dalton
9747d5057d Update builds and docs.
Former-commit-id: 413e8a906dee3407baf848c4607d9887f57fac85
2013-06-10 11:55:51 -07:00
John-David Dalton
7f5c97d0be Avoid Array.prototype issues in Narwhal.
Former-commit-id: 47627a187d59fb83f4a5b84b03158432d5216395
2013-06-10 11:54:09 -07:00
John-David Dalton
1933a76631 Add maxWait option to _.debounce and implement _.throttle by way of _.debounce. [closes #285]
Former-commit-id: 63b41aac298e5fa89f7922e84b2ed0d5c6545bd3
2013-06-10 11:16:14 -07:00
John-David Dalton
c20d7f9754 Tweak free variable module detection so it will work with Component's polyfill. [closes #296]
Former-commit-id: bda6c962dc5e8299689e4c5cf003f6a6c9a4369d
2013-06-10 09:32:33 -07:00
John-David Dalton
6b46dc7e89 Ensure more private properties are minified correctly.
Former-commit-id: dbebbb088768f04a8252029ad709bad9f01c88bb
2013-06-09 17:21:50 -07:00
John-David Dalton
0c1a26170c Remove build source ./lodash.js from components.
Former-commit-id: 4d7f56385b288b396182020aed07eec285c37815
2013-06-08 09:23:20 -07:00
John-David Dalton
244ee08d7d Remove ./ path prefix to avoid issues with Component's build. [closes #294]
Former-commit-id: 93ba9214538b0f30fde75bff96b75c83f3b96f1f
2013-06-07 18:44:15 -07:00
John-David Dalton
a3acbca24b Rename typod test/run-test.sh.
Former-commit-id: bb982a51c5ceb123e83d98c3201e969607f990b8
2013-06-07 13:33:12 -07:00
John-David Dalton
d77e4ed581 Rebuild files and docs.
Former-commit-id: 1e3b1e236e15e4248247a4b20288ab2e153ce753
2013-06-07 08:39:08 -07:00
John-David Dalton
b928abb956 Tweak _.intersection to still hit fast paths in engines.
Former-commit-id: e8cb944bd6223bb30d58da343c4b5a3f296a4956
2013-06-07 08:24:30 -07:00
John-David Dalton
a46ef8d1a6 When chaining, _.max and _.min should resolve the correct value when passed an array containing only one value. [closes #292]
Former-commit-id: 79c71c1851a73c23919a28aadd56490ded91166c
2013-06-06 09:07:14 -07:00
John-David Dalton
a5d459749f Update dependency maps and remove properties in pre-compile.js that no longer exist.
Former-commit-id: d24f0ac4575ab1c2d12f3e8b4bc5f089424407ca
2013-06-06 08:44:20 -07:00
John-David Dalton
7dfa383968 Move some functions out of runInContext and cleanup _.intersection.
Former-commit-id: dfefa6e202b3cd5a7925ddef6ac73dcab5bef8d1
2013-06-06 08:43:24 -07:00
John-David Dalton
036483d195 Simplify the object pool and large array cache.
Former-commit-id: d15df51efe575cd6fa773622f135ccfb6f675545
2013-06-05 08:06:05 -07:00
John-David Dalton
2c950f74bc Remove props related to _.sortBy if the method isn't included in a given build.
Former-commit-id: b3da4dab8257b9001b7458263a28bf22b0a2c831
2013-06-04 09:12:11 -07:00
John-David Dalton
2c59dcd929 Rebuild docs and files.
Former-commit-id: 94d3e29ccf0ba47599a9d662e5d4068713009c9b
2013-06-04 08:37:12 -07:00
John-David Dalton
658d14f31d Cleanup var names and properties.
Former-commit-id: a3455f40184b61a7abe3f5749ea1c0a141c0e574
2013-06-04 08:36:45 -07:00
John-David Dalton
819f4d2151 Add maxPoolSize to limit array and object pools.
Former-commit-id: 677cdb053c7ef60274d71d9ecf4d6f866ef6a8eb
2013-06-03 08:43:04 -07:00
John-David Dalton
9b214d75df Update DocDown.
Former-commit-id: ecb4c7428007bfb6b721000c81254a03c826b1ff
2013-06-03 08:00:46 -07:00
John-David Dalton
e0891a2d71 Clarify lodash underscore test name in test-build.js.
Former-commit-id: 4723604102d38ea252f867aeab16ce167b1d1a49
2013-06-03 08:00:29 -07:00
John-David Dalton
34a4876761 Cleanup .travis and .ignore files.
Former-commit-id: 268e1eb34f30581ed1a36236970673f389f94bb3
2013-06-03 07:59:44 -07:00
John-David Dalton
13ead0085d Add array and object pools to lodash.
Former-commit-id: f038284d6a544e146dc271ed0fbea0d7401593d4
2013-06-03 07:09:04 -07:00
John-David Dalton
9e63270fc5 Add Volo ignore entry to package.json.
Former-commit-id: 9fe60cf0dcfeb4f688f53ffb1995a619d420d586
2013-06-02 17:29:57 -07:00
John-David Dalton
eccab3cd57 Fix build test for older Node versions w/o setImmediate.
Former-commit-id: 9f21f174626cd86eefd0a26cf0b36a60858ba501
2013-05-30 09:37:09 -04:00
John-David Dalton
6446daf1a6 Remove Instanbul note from README and devDependency from package.json.
Former-commit-id: 891c387534df492f9e4d836daac7adc930205fb3
2013-05-30 08:23:08 -04:00
Mathias Bynens
821602ef1c package.json: Remove Grunt devDependencies
Follow-up commit to dc3512de9f [formerly 6d38406eafbfc880c0b5aabf853c987c65f03482].


Former-commit-id: f8c310cad3fe165b6005312bad74a9abc5148a47
2013-05-30 10:44:08 +02:00
John-David Dalton
dc3512de9f Move istanbul to travis.yml.
Former-commit-id: 6d38406eafbfc880c0b5aabf853c987c65f03482
2013-05-30 03:38:55 -04:00
John-David Dalton
36e9cb7108 Merge branch 'master' of github.com:bestiejs/lodash
Former-commit-id: 629fdb25b4727f8dbf870457196af9a4c43b562d
2013-05-29 17:25:09 -04:00
John-David Dalton
42f4531720 Remove unneeded method from the backbone build and fix build tests.
Former-commit-id: ee463a4af4d458a556f5be666b71b464bae32e6b
2013-05-29 17:06:01 -04:00
Mathias Bynens
d1fb379a40 Enable code coverage
Former-commit-id: 9b52247b6e880f15895842e4ff34c15fc99fd1eb
2013-05-29 17:51:57 +02:00
John-David Dalton
e27bdb965c Add a note about the exposed cache to _.memoize docs.
Former-commit-id: 75939e3ed38fe8447c2f9e45b965a837901bcc4c
2013-05-29 10:30:58 -05:00
John-David Dalton
54fc6df3da Update _.transform docs.
Former-commit-id: ff26ef26e906410787a8819b9c653f20bbdeff38
2013-05-29 09:21:45 -05:00
John-David Dalton
9dd8f62c8a Make Error.prototype unit tests pass in Firefox.
Former-commit-id: 1ff097e7947ba206bc58fe0c319bf36bb64b5387
2013-05-29 09:05:21 -05:00
John-David Dalton
1db19148e7 Update vendors.
Former-commit-id: 6be90c53f9b69d500485492ea2a0ebd288b92abe
2013-05-29 08:56:53 -05:00
John-David Dalton
93a01506e4 Add/fix build tests for mixed method builds.
Former-commit-id: 2b97810ca6960670ea646c6eda962bd4585fda04
2013-05-29 08:30:13 -05:00
John-David Dalton
4767ed790c Add _.findWhere alias.
Former-commit-id: 2c70e59b71c22d902e499747444a196a85691554
2013-05-28 16:08:24 -05:00
John-David Dalton
e39211347c Fix build.
Former-commit-id: f8c32906f46a747b1d610c1c9ca8a8ee3b095d90
2013-05-27 23:54:16 -07:00
John-David Dalton
a8cdbb65fe Move code block to a more related part of build.js.
Former-commit-id: c138608bdff2937c51127e129955143ad7a3caec
2013-05-27 23:21:18 -07:00
John-David Dalton
ff74ff4149 Tweak _.transform docs.
Former-commit-id: dc7100411a403be4cce6b3784e1dd81cc9423b76
2013-05-27 22:31:41 -07:00
John-David Dalton
96e47f3d27 Avoid incorrectly converting local variables to boolean values.
Former-commit-id: 322f6dec4c669bdc1ef534f7786cf12aee580e53
2013-05-27 15:38:11 -07:00
John-David Dalton
be52c181ea Ensure converted !0 and !1 have leading whitespace if needed.
Former-commit-id: 930001f35111d47a51c011c47d6c2608b0bb7e2d
2013-05-27 13:47:01 -07:00
John-David Dalton
507f2ec544 Avoid minifier tricks for boolean literals in expressions.
Former-commit-id: a02445f97a81c330018247140784818be830595f
2013-05-27 13:04:26 -07:00
John-David Dalton
fe00c628f4 Fix build.
Former-commit-id: 8dfb12b5883e59111857360ee5392c62e5e9146f
2013-05-26 23:19:10 -07:00
John-David Dalton
e9387d322c Disable use of basicIndexOf optimization if _.indexOf is customized.
Former-commit-id: 5b2273b36934581e34c6f6042de95bf556c61ca2
2013-05-26 22:46:52 -07:00
John-David Dalton
2e3b135fe9 Rebuild docs and files.
Former-commit-id: 3f0dd7d8a07e2a3694619ce7277573ffb6f88ef6
2013-05-25 01:08:38 -07:00
John-David Dalton
d28cc15be2 Ensure _.isPlainObject returns true for empty objects in older browsers. [closes #283]
Former-commit-id: d01d32b1cbd87d08bc8014d07eaa1842e3118a40
2013-05-25 01:08:08 -07:00
John-David Dalton
d15bd23800 Add *.template.* to .ignore files.
Former-commit-id: d4c34dccb521890de2ced7482628f4796b55dcc1
2013-05-24 09:11:34 -07:00
John-David Dalton
90fe45c52d Tweak regexp in build/post-compile.js used to repair whitespace detection.
Former-commit-id: 7bfe6a6bc0b5e2258c56588d8aacad1e5176d8ba
2013-05-24 09:10:45 -07:00
John-David Dalton
8f7be71905 Avoid escaping existing non-ascii characters in templates. [closes #278]
Former-commit-id: a56581f3e323c0c47e4f26ef8dce13e90fb6c15c
2013-05-24 08:42:11 -07:00
John-David Dalton
5d583637c4 Clarify _.uniq doc example and rebuild files. [closes #282]
Former-commit-id: b3ab9ae81af219dfb75b3f4339555530a6301f6e
2013-05-24 07:53:03 -07:00
John-David Dalton
0efb4285c1 Make capitalize in test/test-build.js consistent with other areas.
Former-commit-id: 2a4b6a2f394e474af2c3ca9376ec0ac2580e9bb9
2013-05-23 20:23:48 -07:00
John-David Dalton
6dc543ca18 Rename internal each to basicEach and add internal overloadWrapper function.
Former-commit-id: b12ea9977ab7b6da877aca5925a9fc59019bec93
2013-05-23 20:23:10 -07:00
John-David Dalton
e93e1ddeb9 Add private function dependencies to help reduce dead code in non-minified builds and allow turning them into modules as part of the modularize build option.
Former-commit-id: e9118c47ae2b66e86332a02b4279999b99b8c429
2013-05-23 20:22:12 -07:00
John-David Dalton
d5459f5996 Reduce test/test-build.js travis-ci time limit.
Former-commit-id: c71f8dec6e7cbd81d8693bd52f1f2d0ef78149a7
2013-05-21 10:46:07 -07:00
John-David Dalton
c6420a910d Cleanup getJavaOptions in build/minify.js.
Former-commit-id: 74a6ddf40eadcfd66c0da243d2496b45bc89d8a1
2013-05-21 09:14:37 -07:00
John-David Dalton
f8e67b8e68 Remove the binding optimization from all but the modern build.
Former-commit-id: 1023ccc976e180425dabaa1b61e873e542aa3c2a
2013-05-21 08:42:13 -07:00
John-David Dalton
9ffcd382b4 Have build.js remove createCache if it's not called in the source.
Former-commit-id: 399d1e19b96b2084cc8cd459d297129db1bda071
2013-05-21 00:30:49 -07:00
John-David Dalton
725746badf Merge branch 'master' of github.com:bestiejs/lodash
Former-commit-id: f3bd8611110e0656b448fd5e7bd6fb88dc7a7213
2013-05-20 22:58:22 -07:00
John-David Dalton
9d5290de91 Rebuild docs and files.
Former-commit-id: 00c9d39304630bf650d7f1c80496c383cdac0ba7
2013-05-20 22:58:08 -07:00
John-David Dalton
1bb0b58cce Rename cachedContains reference in build.js to createCache.
Former-commit-id: 3b8cee53f3b7cadc5350c4261794cec72e704427
2013-05-20 22:57:31 -07:00
John-David Dalton
32f0ebbe61 Avoid issues with Titanium, clearTimeout, and an undefined timer id.
Former-commit-id: 18813fcebbab5185164c236a647b0b6436d495ff
2013-05-20 22:53:27 -07:00
John-David Dalton
25a1d74627 Update test/underscore.html and test/backbone.html to account for chain existing in Lo-Dash.
Former-commit-id: f815e7a3ac6e9cc6c048eab82acc32e462dbb021
2013-05-20 22:52:34 -07:00
John-David Dalton
355b2f09bf Make getDependants work with an array of method names.
Former-commit-id: 55f3721735d93e95da10bb3367f8478d861e683c
2013-05-20 22:10:11 -07:00
John-David Dalton
01621f75b6 Avoid binding functions in _.createCallback if they don't reference this.
Former-commit-id: d491414e7e1536d3241a607ba07120f629ff2410
2013-05-20 09:20:51 -07:00
John-David Dalton
242e8a3bd6 Fix typo left out of the "legacy include=defer" patch.
Former-commit-id: cf8f3e072534a925bdf6a0ebdee65d1280f7d29e
2013-05-20 08:44:12 -07:00
John-David Dalton
010c26e716 Replace cachedContains with createCache and further optimize linear array searches.
Former-commit-id: bfe905985c9125cbadfcf111ffd97b6f8ecdd58d
2013-05-19 19:21:11 -07:00
John-David Dalton
e7bad10663 Ensure mobile builds pass unit tests.
Former-commit-id: 31b4eb76c90f375069ef4a73aa7e3fdbcbda069d
2013-05-19 14:28:23 -07:00
John-David Dalton
16242f98ce Ensure each is converted to forEach when used in a ternary operation.
Former-commit-id: ff42e367f9987726fd561037337081c63c7a5100
2013-05-19 14:23:35 -07:00
Kit Cambridge
14a447b3d8 Ensure that the javaOptions are set correctly, as exec is asynchronous.
Previously, the `java` command would execute on the next tick and update the
`javaOptions` array, which could occur prior to the invocation of the Closure
Compiler on the current tick. This has now been refactored into a separate
`getJavaOptions` function, which passes the `javaOptions` array to a callback.

`getJavaOptions` is defined lazily; after the first invocation, the options
are cached and passed to all subsequent callbacks. The callbacks are invoked
on the next tick for compatibility with `exec`.


Former-commit-id: 89ca63c9edb3df3d4fcbbaa64e06075495febfd0
2013-05-19 14:16:35 -07:00
John-David Dalton
a2088fa500 Rebuild docs, files, and update minifiers.
Former-commit-id: 65b04c3efc7677c8ec5cc7ce6e5840fed23b3716
2013-05-19 13:11:57 -07:00
John-David Dalton
87af68c092 Add Java options for faster Closure Compiler minification to minify.js.
Former-commit-id: b493d461e78d0df80c80805a570220fdff93d487
2013-05-19 11:45:24 -07:00
John-David Dalton
06daad87ca Remove unnecessary semicolons from compiled strings.
Former-commit-id: d4f31dafd3335878469babc5daac45957c6d4e80
2013-05-19 11:36:04 -07:00
John-David Dalton
0b4b86f6c9 Remove ctorByClass from the minified vars list in pre-compile.js.
Former-commit-id: 5f5fe90d6a1a9726a07ee7b4c2c9b9b23b6700d3
2013-05-19 10:58:36 -07:00
John-David Dalton
10626904af Add _.transform unit tests.
Former-commit-id: 34e844950f5c003eeeaf2daea7a5ef6247fbfdab
2013-05-19 10:57:50 -07:00
John-David Dalton
90cca8a3eb Remove Error enum fixes/code from builds that don't need them.
Former-commit-id: db060ff3571ef656709447970b62f4af753ea0cb
2013-05-19 10:52:56 -07:00
John-David Dalton
8da0141cac Fix legacy include=defer build test.
Former-commit-id: 49d0598ad3a979796cd07b6819c0aa08642c93a1
2013-05-19 00:37:40 -07:00
John-David Dalton
39e123aaf4 Rebuild files.
Former-commit-id: ab61934d0b097036dc4cab968d92bfd1450fe8c7
2013-05-18 19:33:17 -07:00
John-David Dalton
24fd17f072 Replace _.isPlainObject with shimIsPlainObject.
Former-commit-id: c1c273a352387e25ae5a6a22dfda8871beac8400
2013-05-18 19:32:16 -07:00
John-David Dalton
9270cc47b5 Add _.transform.
Former-commit-id: 6c040fedd130e8436ff99b1d70892ac8cebbb996
2013-05-18 19:12:22 -07:00
John-David Dalton
3721db34ab Avoid writing a minified file when --stdout is used. [closes #273]
Former-commit-id: 75068b4a92f3a98d4c47ad049e88ef764154bcc1
2013-05-18 09:21:23 -07:00
John-David Dalton
e85ae351c7 Ensure --output paths containing build commands are processed w/o problems.
Former-commit-id: 4790e4e2ea2eba6af8c93e3576858d1f6ff45e70
2013-05-17 08:41:55 -07:00
John-David Dalton
a56ba245ea Fix _.support.enumErrorProps docs.
Former-commit-id: f7aa45537b1e4d173f966a78f89b183c444faaeb
2013-05-16 09:12:56 -07:00
John-David Dalton
d162eed4c7 Rebuild files.
Former-commit-id: dd3db7be0213bfada5ab7d8593e233a9af4a9dd0
2013-05-16 08:48:28 -07:00
John-David Dalton
43fea34f61 Ensure _.chain works as expected.
Former-commit-id: ed176702dc08deeb35d94bb7b40623ab06142848
2013-05-16 08:47:52 -07:00
John-David Dalton
f7c960fc0d Ensure Error is escaped for advanced Closure Compiler minification.
Former-commit-id: 7a9cfbe464afa9e52ec3ed23692965d07db51d32
2013-05-14 22:49:15 -07:00
John-David Dalton
ee1933389a Add _.chain tests and ensure they pass.
Former-commit-id: e365b65da8a740383c975c7b904ad2156d1cc8ab
2013-05-14 22:48:34 -07:00
John-David Dalton
fdc9d5f1fd Rebuild docs and files.
Former-commit-id: 59596707224acabb767b87078d69363c293eec2d
2013-05-14 09:15:48 -07:00
John-David Dalton
bad40b6125 Ensure snippet in iteratorTemplate is minifiable and remove unneeded references from iteratorTemplate.
Former-commit-id: f8c96f63f1a50644c0d2074e5419e68d1a247d46
2013-05-14 09:15:26 -07:00
John-David Dalton
d76ce85327 Add better _.forIn support for legacy browsers.
Former-commit-id: a03ce4662021d6ac8ca12c4885a9c4718c227a30
2013-05-14 09:04:15 -07:00
John-David Dalton
d3df072a22 Make build.js remove extraneous semicolons from inlined methods.
Former-commit-id: 061ed370a4c95a64669335c6b2a5da7ebc1015fd
2013-05-14 08:11:56 -07:00
John-David Dalton
4b3009a195 Ensure _.clone, _.flatten, and _.uniq can be used as a callback for methods like _.map. [closes #270]
Former-commit-id: fb62b5bbdad844cb04c3259c323e27fb81932809
2013-05-14 00:50:57 -07:00
John-David Dalton
b72b0d60cb Add support for floating point numbers to _.random. [closes #263]
Former-commit-id: ef356bb180b163fc936ef69ac2ef33186983eaa7
2013-05-12 15:48:01 -07:00
John-David Dalton
5841e62c66 Add _.chain alias of _. [closes #267]
Former-commit-id: 580e4346444096c7fa77cfc5cf2c68b6cf891fcf
2013-05-11 00:59:48 -07:00
John-David Dalton
9bd0c01702 Expose memoized function's cache. [closes #265]
Former-commit-id: fc44676386854ec9d5fd7a4fac8583508d63949f
2013-05-10 23:22:04 -07:00
John-David Dalton
6d86b3a950 Add _.has unit test.
Former-commit-id: 3334651f8d29e6aa006184846b128acd006157ef
2013-05-10 22:57:08 -07:00
John-David Dalton
5ff9b02c89 Rebuild files and docs.
Former-commit-id: 697fc5842bb6099f48e3731940c9e329452850d2
2013-05-08 01:05:03 -07:00
John-David Dalton
80934ea232 Fix build.
Former-commit-id: 114ddcfec3e9bd4bccf481e8ec943ffdead2bb24
2013-05-08 00:59:37 -07:00
John-David Dalton
5acfa2bf3a Remove _.unzip from the underscore build.
Former-commit-id: 6d0accb64f39b08b72e3165c49a8c844a7a99cd3
2013-05-07 23:49:30 -07:00
John-David Dalton
4fada52e04 Remove nonEnumProps from the modernish builds.
Former-commit-id: 38592e1ee24524b223b801ede8033d7b4ccb8a36
2013-05-07 23:34:17 -07:00
John-David Dalton
e1c8e95e11 Tweak whitespace in iteratorTemplate.
Former-commit-id: 2f9fdbd72d316a1668d34fa95a3f1ecb325d625b
2013-05-07 23:33:04 -07:00
John-David Dalton
1dfebad790 Add a space before define in the minified files so Dojo builder will detect it properly.
Former-commit-id: 3c656ba3b2dd4771eab97c259840c2f426e2454c
2013-05-07 22:14:47 -07:00
John-David Dalton
37ffe63d13 Rename arrayRef to arrayProto in build.js.
Former-commit-id: fec054f96a4972173cb638ee77a7a0d1813c9ad4
2013-05-07 09:24:12 -07:00
John-David Dalton
cc14c34dc2 Allow the underscore build to opt-in to more lodash build methods.
Former-commit-id: 3f685fe1ced25ba37ea9d09e2ed8fa59acb5b8b7
2013-05-07 09:22:31 -07:00
John-David Dalton
e0cf4e644b Add more _.forIn iteration tests and prep support for Error object iteration.
Former-commit-id: 3676681717d0648c9f96570a4952f7c35e6a9bec
2013-05-07 01:38:13 -07:00
John-David Dalton
aad55fc3db Fix trailing parenthesis typo.
Former-commit-id: a9b4fe7408aa9faa7079656c3cb31a4c655544e6
2013-05-06 07:02:53 -07:00
John-David Dalton
ba2b459220 Tweak wiki wording in README.md.
Former-commit-id: 86b1377b1e0eb09bf9e50ac66b988548b022cf96
2013-05-05 23:59:13 -07:00
John-David Dalton
086669fbe0 Ensure _.forIn works over objects with longer inheritance chains in IE < 9.
Former-commit-id: 226223454e71dd8cb6c38a543f1accd915eef3cb
2013-05-05 23:58:33 -07:00
John-David Dalton
4cc3fcb6e8 Ensure unknown objectTypes return false.
Former-commit-id: a60236ecd8908a91c0268d71d5710665986f1ceb
2013-05-05 23:49:37 -07:00
John-David Dalton
8781053dbe Simplify arrays iterator options.
Former-commit-id: 7ea81c03f791615bcfec24d8574162c190d49c7d
2013-05-03 08:51:10 -07:00
John-David Dalton
bdac8974d8 Realign _.assign and _.defaults with ES6 Object.assign. [closes #259]
Former-commit-id: e8c89e4a130ed286ce07e1a2e848f50b182effae
2013-05-03 08:33:51 -07:00
John-David Dalton
9ae24141a3 Cleanup _.debounce.
Former-commit-id: 0212c6b31222a8e215d6f60e906fbad074f424a9
2013-05-02 00:06:55 -07:00
John-David Dalton
e773efdc59 Ensure _.debounce with leading and trailing will call the func on the leading edge after a trailing call is performed. [closes #257]
Former-commit-id: 97afe842b2b4c3eb20c9557298e01ec268386ea2
2013-05-01 09:03:52 -07:00
John-David Dalton
8f94bd1fbd Reduce _.unzip and _.zip.
Former-commit-id: f388c50817910eee510f33b22fd4904fd648a6f0
2013-04-30 09:18:26 -07:00
John-David Dalton
d24d83d52a Ensure remove of the "exit early" feature is handled properly when mixing lodash methods into the underscore build.
Former-commit-id: 973c3e188076ca4403f59684b82bee3049370d5a
2013-04-30 09:12:57 -07:00
37 changed files with 5061 additions and 2755 deletions

2
.gitignore vendored
View File

@@ -1,5 +1,7 @@
.DS_Store
*.custom.*
*.template.*
*.d.ts
*.map
node_modules
vendor/closure-compiler

View File

@@ -1,10 +1,12 @@
.*
*.custom.*
*.template.*
*.d.ts
*.map
*.md
*.txt
build.js
lodash.js
index.js
bower.json
component.json

View File

@@ -1,12 +1,12 @@
.*
*.custom.*
*.template.*
*.d.ts
*.map
*.md
bower.json
component.json
doc
node_modules
perf
test
vendor/*.gz

View File

@@ -2,12 +2,14 @@ language: node_js
node_js:
- 0.6
- 0.9
- 0.10
env:
- TEST_COMMAND="istanbul cover ./test/test.js"
- TEST_COMMAND="phantomjs ./test/test.js ../dist/lodash.compat.js"
- TEST_COMMAND="phantomjs ./test/test.js ../dist/lodash.compat.min.js"
- TEST_COMMAND="node ./test/test.js ../dist/lodash.js"
- TEST_COMMAND="node ./test/test.js ../dist/lodash.min.js"
- TEST_COMMAND="node ./test/test-build.js --time-limit 49m30s"
- TEST_COMMAND="node ./test/test-build.js --time-limit 48m"
git:
depth: 1
branches:
@@ -16,5 +18,6 @@ branches:
before_script:
- "tar -xzvf vendor/closure-compiler.tar.gz -C vendor"
- "tar -xzvf vendor/uglifyjs.tar.gz -C vendor"
- "npm install -g istanbul"
script:
$TEST_COMMAND

View File

@@ -1,28 +1,28 @@
# Lo-Dash <sup>v1.2.1</sup>
# Lo-Dash <sup>v1.3.0</sup>
A low-level utility library delivering consistency, [customization](https://github.com/bestiejs/lodash#custom-builds), [performance](http://lodash.com/benchmarks), and [extra features](https://github.com/bestiejs/lodash#features).
## Download
* Lo-Dash builds (for modern environments):<br>
[Development](https://raw.github.com/bestiejs/lodash/v1.2.1/dist/lodash.js) and
[Production](https://raw.github.com/bestiejs/lodash/v1.2.1/dist/lodash.min.js)
[Development](https://raw.github.com/bestiejs/lodash/v1.3.0/dist/lodash.js) and
[Production](https://raw.github.com/bestiejs/lodash/v1.3.0/dist/lodash.min.js)
* Lo-Dash compatibility builds (for legacy and modern environments):<br>
[Development](https://raw.github.com/bestiejs/lodash/v1.2.1/dist/lodash.compat.js) and
[Production](https://raw.github.com/bestiejs/lodash/v1.2.1/dist/lodash.compat.min.js)
[Development](https://raw.github.com/bestiejs/lodash/v1.3.0/dist/lodash.compat.js) and
[Production](https://raw.github.com/bestiejs/lodash/v1.3.0/dist/lodash.compat.min.js)
* Underscore compatibility builds:<br>
[Development](https://raw.github.com/bestiejs/lodash/v1.2.1/dist/lodash.underscore.js) and
[Production](https://raw.github.com/bestiejs/lodash/v1.2.1/dist/lodash.underscore.min.js)
[Development](https://raw.github.com/bestiejs/lodash/v1.3.0/dist/lodash.underscore.js) and
[Production](https://raw.github.com/bestiejs/lodash/v1.3.0/dist/lodash.underscore.min.js)
* CDN copies of ≤ v1.2.1s builds are available on [cdnjs](http://cdnjs.com/) thanks to [CloudFlare](http://www.cloudflare.com/):<br>
[Lo-Dash dev](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.2.1/lodash.js),
[Lo-Dash prod](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.2.1/lodash.min.js),<br>
[Lo-Dash compat-dev](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.2.1/lodash.compat.js),
[Lo-Dash compat-prod](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.2.1/lodash.compat.min.js),<br>
[Underscore compat-dev](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.2.1/lodash.underscore.js), and
[Underscore compat-prod](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.2.1/lodash.underscore.min.js)
* CDN copies of ≤ v1.3.0s builds are available on [cdnjs](http://cdnjs.com/) thanks to [CloudFlare](http://www.cloudflare.com/):<br>
[Lo-Dash dev](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.3.0/lodash.js),
[Lo-Dash prod](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.3.0/lodash.min.js),<br>
[Lo-Dash compat-dev](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.3.0/lodash.compat.js),
[Lo-Dash compat-prod](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.3.0/lodash.compat.min.js),<br>
[Underscore compat-dev](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.3.0/lodash.underscore.js), and
[Underscore compat-prod](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.3.0/lodash.underscore.min.js)
* For optimal file size, [create a custom build](https://github.com/bestiejs/lodash#custom-builds) with only the features you need
@@ -68,6 +68,7 @@ For more information check out these articles, screencasts, and other videos ove
* [_.runInContext](http://lodash.com/docs#runInContext) for easier mocking and extended environment support
* [_.support](http://lodash.com/docs#support) to flag environment features
* [_.template](http://lodash.com/docs#template) supports [*“imports”* options](http://lodash.com/docs#templateSettings_imports), [ES6 template delimiters](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-7.8.6), and [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
* [_.transform](http://lodash.com/docs#transform) as a powerful alternative to [_.reduce](http://lodash.com/docs#reduce) for transforming objects
* [_.unzip](http://lodash.com/docs#unzip) as the inverse of [_.zip](http://lodash.com/docs#zip)
* [_.where](http://lodash.com/docs#where) supports deep object comparisons
* [_.clone](http://lodash.com/docs#clone), [_.omit](http://lodash.com/docs#omit), [_.pick](http://lodash.com/docs#pick),
@@ -79,13 +80,13 @@ For more information check out these articles, screencasts, and other videos ove
## Support
Lo-Dash has been tested in at least Chrome 5~26, Firefox 2~20, IE 6-10, Opera 9.25~12, Safari 3-6, Node.js 0.4.8-0.10.5, Narwhal 0.3.2, PhantomJS 1.9.0, RingoJS 0.9, and Rhino 1.7RC5.
Lo-Dash has been tested in at least Chrome 5~27, Firefox 2~21, IE 6-10, Opera 9.25~12, Safari 3-6, Node.js 0.4.8-0.10.7 (Node bug [#5622](https://github.com/joyent/node/issues/5622) prevents 0.10.8-0.10.10 from working), Narwhal 0.3.2, PhantomJS 1.9.0, RingoJS 0.9, and Rhino 1.7RC5.
## Custom builds
Custom builds make it easy to create lightweight versions of Lo-Dash containing only the methods you need.
To top it off, we handle all method dependency and alias mapping for you.
For a more detailed summary over the differences between various builds, check out our [wiki entry](https://github.com/bestiejs/lodash/wiki/build-differences).
For a more detailed summary over the differences between various builds, check out the [wiki page](https://github.com/bestiejs/lodash/wiki/build-differences).
* Backbone builds, with only methods required by Backbone, may be created using the `backbone` modifier argument.
```bash
@@ -248,14 +249,39 @@ require({
## Release Notes
### <sup>v1.2.1</sup>
### <sup>v1.3.0</sup>
* Added Component package support
* Updated the build utility to work with changes in GitHubs API
* Ensured `_.isPlainObject` works with objects created by `Object.create(null)`
* Ensured *“isType”* methods return `false` for subclassed values
* Ensured debounced functions, with `leading` and `trailing` calls enabled,<br>
only perform trailing calls after theyre called more than once
* Added `_.transform` method
* Added `_.chain` and `_.findWhere` aliases
* Added internal array and object pooling
* Added Istanbul test coverage reports to Travis CI
* Added `maxWait` option to `_.debounce`
* Added support for floating point numbers to `_.random`
* Added Volo configuration to package.json
* Adjusted UMD for `component build`
* Allowed more stable mixing of `lodash` and `underscore` build methods
* Ensured debounced function with, `leading` and `trailing` options, works as expected
* Ensured minified builds work with the Dojo builder
* Ensured minification avoids deoptimizing expressions containing boolean values
* Ensured unknown types return `false` in `_.isObject` and `_.isRegExp`
* Ensured `_.clone`, `_.flatten`, and `_.uniq` can be used as a `callback` for methods like `_.map`
* Ensured `_.forIn` works on objects with longer inheritance chains in IE < 9
* Ensured `_.isPlainObject` returns `true` for empty objects in IE < 9
* Ensured `_.max` and `_.min` chain correctly
* Ensured `clearTimeout` use doesnt cause errors in Titanium
* Ensured that the `--stdout` build option doesn't write to a file
* Exposed memoized functions `cache`
* Fixed `Error.prototype` iteration bugs
* Fixed "scripts" paths in component.json
* Made methods support customizing `_.indexOf`
* Made the build track dependencies of private functions
* Made the `template` pre-compiler build option avoid escaping non-ascii characters
* Made `_.createCallback` avoid binding functions if they dont reference `this`
* Optimized the Closure Compiler minification process
* Optimized the large array cache for `_.difference`, `_.intersection`, and `_.uniq`
* Optimized internal `_.flatten` and `_.indexOf` use
* Reduced `_.unzip` and `_.zip`
* Removed special handling of arrays in `_.assign` and `_.defaults`
The full changelog is available [here](https://github.com/bestiejs/lodash/wiki/Changelog).

View File

@@ -1,10 +1,11 @@
{
"name": "lodash",
"version": "1.2.1",
"version": "1.3.0",
"main": "./dist/lodash.compat.js",
"ignore": [
".*",
"*.custom.*",
"*.template.*",
"*.d.ts",
"*.map",
"*.md",

2104
build.js

File diff suppressed because it is too large Load Diff

View File

@@ -3,8 +3,8 @@
'use strict';
/** Load Node.js modules */
var https = require('https'),
spawn = require('child_process').spawn,
var cp = require('child_process'),
https = require('https'),
zlib = require('zlib');
/** Load other modules */
@@ -19,10 +19,10 @@
path = util.path;
/** The Git object ID of `closure-compiler.tar.gz` */
var closureId = '7815712f73ccb21f587bf3fb72a2f50be788515d';
var closureId = '9fd5d61c1b706e7505aeb5187941c2c5497e5fd8';
/** The Git object ID of `uglifyjs.tar.gz` */
var uglifyId = 'fb620e8672ad194b3ab501790e19c40c8ac79286';
var uglifyId = '7de2795a3af58d1b293e3b0e83cdbc994f4941dc';
/** The path of the directory that is the base of the repository */
var basePath = fs.realpathSync(path.join(__dirname, '..'));
@@ -324,6 +324,30 @@
});
}
/**
* Retrieves the Java command-line options used for faster minification by
* the Closure Compiler, invoking the `callback` when finished. Subsequent
* calls will lazily return the previously retrieved options. The `callback`
* is invoked with one argument; (options).
*
* See https://code.google.com/p/closure-compiler/wiki/FAQ#What_are_the_recommended_Java_VM_command-line_options?.
*
* @private
* @param {Function} callback The function called once the options have been retrieved.
*/
function getJavaOptions(callback) {
var result = [];
cp.exec('java -version -client -d32', function(error) {
if (!error && process.platform != 'win32') {
result.push('-client', '-d32');
}
getJavaOptions = function(callback) {
_.defer(callback, result);
};
callback(result);
});
}
/**
* Resolves the source map path from the given output path.
*
@@ -350,6 +374,8 @@
var filePath = this.filePath,
isAdvanced = mode == 'advanced',
isMapped = this.isMapped,
isSilent = this.isSilent,
isTemplate = this.isTemplate,
options = closureOptions.slice(),
outputPath = this.outputPath,
mapPath = getMapPath(outputPath),
@@ -375,58 +401,63 @@
if (isMapped) {
options.push('--create_source_map=' + mapPath, '--source_map_format=V3');
}
var compiler = spawn('java', ['-jar', closurePath].concat(options));
if (!this.isSilent) {
console.log('Compressing ' + path.basename(outputPath, '.js') + ' using the Closure Compiler (' + mode + ')...');
if (isTemplate) {
options.push('--charset=UTF-8');
}
var error = '';
compiler.stderr.on('data', function(data) {
error += data;
getJavaOptions(function(javaOptions) {
var compiler = cp.spawn('java', javaOptions.concat('-jar', closurePath, options));
if (!isSilent) {
console.log('Compressing ' + path.basename(outputPath, '.js') + ' using the Closure Compiler (' + mode + ')...');
}
var error = '';
compiler.stderr.on('data', function(data) {
error += data;
});
var output = '';
compiler.stdout.on('data', function(data) {
output += data;
});
compiler.on('exit', function(status) {
// `status` contains the process exit code
if (status) {
var exception = new Error(error);
exception.status = status;
}
// restore IIFE and move exposed vars inside the IIFE
if (hasIIFE && isAdvanced) {
output = output
.replace(/__iife__\(/, '(')
.replace(/,\s*this\)([\s;]*(\n\/\/.+)?)$/, '(this))$1')
.replace(/^((?:var (?:\w+=(?:!0|!1|null)[,;])+)?)([\s\S]*?function[^{]+{)/, '$2$1');
}
// inject "use strict" directive
if (isStrict) {
output = output.replace(/^[\s\S]*?function[^{]+{/, '$&"use strict";');
}
// restore copyright header
if (license) {
output = license + output;
}
if (isMapped) {
var mapOutput = fs.readFileSync(mapPath, 'utf8');
fs.unlinkSync(mapPath);
output = output.replace(/[\s;]*$/, '\n/*\n//@ sourceMappingURL=' + sourceMapURL) + '\n*/';
mapOutput = JSON.parse(mapOutput);
mapOutput.file = path.basename(outputPath);
mapOutput.sources = [path.basename(filePath)];
mapOutput = JSON.stringify(mapOutput, null, 2);
}
callback(exception, output, mapOutput);
});
// proxy the standard input to the Closure Compiler
compiler.stdin.end(source);
});
var output = '';
compiler.stdout.on('data', function(data) {
output += data;
});
compiler.on('exit', function(status) {
// `status` contains the process exit code
if (status) {
var exception = new Error(error);
exception.status = status;
}
// restore IIFE and move exposed vars inside the IIFE
if (hasIIFE && isAdvanced) {
output = output
.replace(/__iife__\(/, '(')
.replace(/,\s*this\)([\s;]*(\n\/\/.+)?)$/, '(this))$1')
.replace(/^((?:var (?:\w+=(?:!0|!1|null)[,;])+)?)([\s\S]*?function[^{]+{)/, '$2$1');
}
// inject "use strict" directive
if (isStrict) {
output = output.replace(/^[\s\S]*?function[^{]+{/, '$&"use strict";');
}
// restore copyright header
if (license) {
output = license + output;
}
if (isMapped) {
var mapOutput = fs.readFileSync(mapPath, 'utf8');
fs.unlinkSync(mapPath);
output = output.replace(/[\s;]*$/, '\n/*\n//@ sourceMappingURL=' + sourceMapURL) + '\n*/';
mapOutput = JSON.parse(mapOutput);
mapOutput.file = path.basename(outputPath);
mapOutput.sources = [path.basename(filePath)];
mapOutput = JSON.stringify(mapOutput, null, 2);
}
callback(exception, output, mapOutput);
});
// proxy the standard input to the Closure Compiler
compiler.stdin.end(source);
}
/**
@@ -470,7 +501,7 @@
// 4. output
// restrict lines to 500 characters for consistency with the Closure Compiler
var stream = uglifyJS.OutputStream({
'ascii_only': true,
'ascii_only': !this.isTemplate,
'comments': /@cc_on|@license|@preserve/i,
'max_line_len': 500,
});

View File

@@ -2,8 +2,9 @@
;(function() {
'use strict';
/** The Node.js filesystem module */
var fs = require('fs');
/** Load Node.js modules */
var fs = require('fs'),
vm = require('vm');
/** The minimal license/copyright template */
var licenseTemplate = [
@@ -24,19 +25,44 @@
* @returns {String} Returns the processed source.
*/
function postprocess(source) {
// remove copyright header
source = source.replace(/^\/\**[\s\S]+?\*\/\n/, '');
// correct overly aggressive Closure Compiler advanced optimization
source = source
.replace(/(document[^&]+&&)\s*(?:\w+|!\d)/, '$1!({toString:0}+"")')
.replace(/"\t"/g, '"\\t"')
.replace(/"[^"]*?\\u180e[^"]*?"/g,
.replace(/"[^"]*?\\f[^"]*?"/g,
'" \\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"'
);
try {
var context = vm.createContext({});
vm.runInContext(source, context);
} catch(e) { }
['forEach', 'forIn', 'forOwn'].forEach(function(methodName) {
var pairs = /[!=]==\s*([a-zA-Z]+)(?!\()|([a-zA-Z]+)\s*[!=]==/.exec((context._ || {})[methodName]),
varName = pairs && (pairs[1] || pairs[2]),
value = (value = varName && RegExp('\\b' + varName + '\\s*=\\s*!([01])\\b').exec(source)) && !+value[1];
if (typeof value == 'boolean') {
// replace vars for `false` and `true` with boolean literals
source = source.replace(RegExp('([!=]==\\s*)' + varName + '\\b(?!\\()|\\b' + varName + '(\\s*[!=]==)', 'g'), function(match, prelude, postlude, at) {
// avoid replacing local variables with the same name
return RegExp('\\b' + varName + '\\s*(?:,|=[^=])').test(source.slice(at - 10, at))
? match
: (prelude || '') + value + (postlude || '');
});
}
});
// replace `!1` and `!0` in expressions with `false` and `true` values
[/([!=]==)\s*!1\b|(.)!1\s*([!=]==)/g, /([!=]==)\s*!0\b|(.)!0\s*([!=]==)/g].forEach(function(regexp, index) {
source = source.replace(regexp, function(match, prelude, chr, postlude) {
return (prelude || chr + (/\w/.test(chr) ? ' ' : '')) + !!index + (postlude || '');
});
});
// flip `typeof` expressions to help optimize Safari and
// correct the AMD module definition for AMD build optimizers
// (e.g. from `"number" == typeof x` to `typeof x == "number")
@@ -44,6 +70,11 @@
return (other ? other + ' ' : '') + expression + equality + type;
});
// add a space so `define` is detected by the Dojo builder
source = source.replace(/(.)(define\()/, function(match, prelude, define) {
return prelude + (/^\S/.test(prelude) ? ' ' : '') + define;
});
// add trailing semicolon
if (source) {
source = source.replace(/[\s;]*?(\s*\/\/.*\s*|\s*\/\*[^*]*\*+(?:[^\/][^*]*\*+)*\/\s*)*$/, ';$1');
@@ -53,6 +84,9 @@
if (!snippet) {
return source;
}
// remove copyright header
source = source.replace(/^\/\**[\s\S]+?\*\/\n/, '');
// add new copyright header
var version = snippet[2];
source = licenseTemplate.replace('<%= VERSION %>', version) + '\n;' + source;

View File

@@ -11,32 +11,44 @@
'argsIndex',
'argsLength',
'callback',
'className',
'collection',
'conditions',
'ctor',
'errorClass',
'errorProto',
'guard',
'hasOwnProperty',
'index',
'isArguments',
'isArray',
'isProto',
'isString',
'iterable',
'length',
'keys',
'lodash',
'nonEnum',
'nonEnumProps',
'object',
'objectProto',
'objectTypes',
'ownIndex',
'ownProps',
'result',
'skipErrorProps',
'skipProto',
'source',
'thisArg'
'stringClass',
'stringProto',
'thisArg',
'toString'
];
/** Used to minify `iteratorTemplate` data properties */
var iteratorOptions = [
'args',
'arrays',
'array',
'bottom',
'firstArg',
'init',
@@ -58,6 +70,7 @@
'Array',
'Boolean',
'Date',
'Error',
'Function',
'Math',
'Number',
@@ -74,12 +87,14 @@
'any',
'argsClass',
'argsObject',
'array',
'assign',
'at',
'attachEvent',
'bind',
'bindAll',
'bindKey',
'cache',
'clearTimeout',
'clone',
'cloneDeep',
@@ -98,6 +113,7 @@
'difference',
'drop',
'each',
'enumErrorProps',
'enumPrototypes',
'environment',
'escape',
@@ -118,6 +134,7 @@
'forEach',
'forIn',
'forOwn',
'function',
'functions',
'global',
'groupBy',
@@ -159,6 +176,7 @@
'leading',
'map',
'max',
'maxWait',
'memoize',
'merge',
'methods',
@@ -168,6 +186,8 @@
'nodeClass',
'nonEnumArgs',
'nonEnumShadows',
'null',
'number',
'object',
'omit',
'once',
@@ -196,6 +216,7 @@
'sortedIndex',
'source',
'spliceObjects',
'string',
'support',
'tail',
'take',
@@ -206,6 +227,8 @@
'times',
'toArray',
'trailing',
'transform',
'undefined',
'unescape',
'unindexedChars',
'union',
@@ -276,7 +299,7 @@
string = string.slice(left.length);
}
// avoids removing the '\n' of the `stringEscapes` object
string = string.replace(/\[object |delete |else (?!{)|function | in |return\s+[\w"']|throw |typeof |use strict|var |@ |(["'])\\n\1|\\\\n|\\n|\s+/g, function(match) {
string = string.replace(/\[object |delete |else (?!{)|function | in | instanceof |return\s+[\w"']|throw |typeof |use strict|var |@ |(["'])\\n\1|\\\\n|\\n|\s+/g, function(match) {
return match == false || match == '\\n' ? '' : match;
});
// unclip
@@ -296,11 +319,27 @@
// remove debug sourceURL use in `_.template`
source = source.replace(/(?:\s*\/\/.*\n)* *var sourceURL[^;]+;|\+ *sourceURL/g, '');
// minify internal properties used by 'compareAscending' and `_.sortBy`
// minify internal properties
(function() {
var properties = ['criteria', 'index', 'value'],
snippets = source.match(/( +)function (?:compareAscending|sortBy)\b[\s\S]+?\n\1}/g);
var methods = [
'cacheIndexOf',
'cachePush',
'compareAscending',
'createCache',
'getObject',
'releaseObject',
'sortBy',
'uniq'
];
var props = [
'cache',
'criteria',
'index',
'value'
];
var snippets = source.match(RegExp('^( *)(?:var|function) +(?:' + methods.join('|') + ')\\b[\\s\\S]+?\\n\\1}', 'gm'));
if (!snippets) {
return;
}
@@ -308,11 +347,12 @@
var modified = snippet;
// minify properties
properties.forEach(function(property, index) {
var minName = minNames[index],
reBracketProp = RegExp("\\['(" + property + ")'\\]", 'g'),
reDotProp = RegExp('\\.' + property + '\\b', 'g'),
rePropColon = RegExp("([^?\\s])\\s*([\"'])?\\b" + property + "\\2 *:", 'g');
props.forEach(function(prop, index) {
// use minified names different than those chosen for `iteratorOptions`
var minName = minNames[iteratorOptions.length + index],
reBracketProp = RegExp("\\['(" + prop + ")'\\]", 'g'),
reDotProp = RegExp('\\.' + prop + '\\b', 'g'),
rePropColon = RegExp("([^?\\s])\\s*([\"'])?\\b" + prop + "\\2 *:", 'g');
modified = modified
.replace(reBracketProp, "['" + minName + "']")
@@ -331,14 +371,14 @@
var snippets = source.match(
RegExp([
// match the `iteratorTemplate`
'( +)var iteratorTemplate\\b[\\s\\S]+?\\n\\1}',
'^( *)var iteratorTemplate\\b[\\s\\S]+?\\n\\1}',
// match methods created by `createIterator` calls
'createIterator\\((?:{|[a-zA-Z]+)[\\s\\S]*?\\);\\n',
// match variables storing `createIterator` options
'( +)var [a-zA-Z]+IteratorOptions\\b[\\s\\S]+?\\n\\2}',
// match the the `createIterator` function
'( +)function createIterator\\b[\\s\\S]+?\\n\\3}'
].join('|'), 'g')
'^( *)var [a-zA-Z]+IteratorOptions\\b[\\s\\S]+?\\n\\2}',
// match `cachePush`, `createCache`, `createIterator`, `getObject`, `releaseObject`, and `uniq` functions
'^( *)(?:var|function) +(?:cachePush|createCache|createIterator|getObject|releaseObject|uniq)\\b[\\s\\S]+?\\n\\3}'
].join('|'), 'gm')
);
// exit early if no compilable snippets
@@ -347,7 +387,7 @@
}
snippets.forEach(function(snippet, index) {
var isCreateIterator = /function createIterator\b/.test(snippet),
var isFunc = /\bfunction *[ \w]*\(/.test(snippet),
isIteratorTemplate = /var iteratorTemplate\b/.test(snippet),
modified = snippet;
@@ -356,6 +396,11 @@
return "['" + prop.replace(/['\n\r\t]/g, '\\$&') + "']";
});
// remove unnecessary semicolons in strings
modified = modified.replace(/;(?:}["']|(?:\\n|\s)*["']\s*\+\s*["'](?:\\n|\s)*})/g, function(match) {
return match.slice(1);
});
// minify `createIterator` option property names
iteratorOptions.forEach(function(property, index) {
var minName = minNames[index];
@@ -371,16 +416,24 @@
var minName = minNames[index];
// minify variable names present in strings
if (isCreateIterator) {
modified = modified.replace(RegExp('(([\'"])[^\\n\\2]*?)\\b' + varName + '\\b(?=[^\\n\\2]*\\2[ ,+]+$)', 'gm'), '$1' + minName);
if (isFunc && !isIteratorTemplate) {
modified = modified.replace(RegExp('((["\'])[^\\n\\2]*?)\\b' + varName + '\\b(?=[^\\n\\2]*\\2[ ,+;]+$)', 'gm'), function(match, prelude) {
return prelude + minName;
});
}
// ensure properties in compiled strings aren't minified
else {
modified = modified.replace(RegExp('([^.])\\b' + varName + '\\b(?!\' *[\\]:])', 'g'), '$1' + minName);
modified = modified.replace(RegExp('([^.])\\b' + varName + '\\b(?!\' *[\\]:])', 'g'), function(match, prelude) {
return prelude + minName;
});
}
// correct `typeof` values
// correct `typeof` string values
if (/^(?:boolean|function|object|number|string|undefined)$/.test(varName)) {
modified = modified.replace(RegExp("(typeof [^']+')" + minName + "'", 'g'), '$1' + varName + "'");
modified = modified.replace(RegExp('(= *)(["\'])' + minName + '\\2|(["\'])' + minName + '\\3( *=)', 'g'), function(match, prelude, preQuote, postQuote, postlude) {
return prelude
? prelude + preQuote + varName + preQuote
: postQuote + varName + postQuote + postlude;
});
}
});

View File

@@ -1,12 +1,12 @@
{
"name": "lodash",
"repo": "bestiejs/lodash",
"version": "1.2.1",
"version": "1.3.0",
"description": "A low-level utility library delivering consistency, customization, performance, and extra features.",
"license": "MIT",
"scripts": [
"./index.js",
"./dist/lodash.compat.js"
"index.js",
"dist/lodash.compat.js"
],
"keywords": [
"browser",

1239
dist/lodash.compat.js vendored

File diff suppressed because it is too large Load Diff

View File

@@ -1,47 +1,51 @@
/**
* @license
* Lo-Dash 1.2.1 (Custom Build) lodash.com/license
* Lo-Dash 1.3.0 (Custom Build) lodash.com/license
* Build: `lodash -o ./dist/lodash.compat.js`
* Underscore.js 1.4.4 underscorejs.org/LICENSE
*/
;(function(n){function t(r){function a(n){return n&&typeof n=="object"&&!me(n)&&Qt.call(n,"__wrapped__")?n:new V(n)}function R(n){var t=n.length,e=t>=l;if(e)for(var r={},u=-1;++u<t;){var a=f+n[u];(r[a]||(r[a]=[])).push(n[u])}return function(t){if(e){var u=f+t;return r[u]&&-1<_t(r[u],t)}return-1<_t(n,t)}}function T(n){return n.charCodeAt(0)}function D(n,t){var e=n.b,r=t.b;if(n=n.a,t=t.a,n!==t){if(n>t||typeof n=="undefined")return 1;if(n<t||typeof t=="undefined")return-1}return e<r?-1:1}function z(n,t,e,r){function u(){var r=arguments,l=o?this:t;
return a||(n=t[i]),e.length&&(r=r.length?(r=le.call(r),f?r.concat(e):e.concat(r)):e),this instanceof u?(G.prototype=n.prototype,l=new G,G.prototype=null,r=n.apply(l,r),et(r)?r:l):n.apply(l,r)}var a=tt(n),o=!e,i=t;if(o){var f=r;e=t}else if(!a){if(!r)throw new Dt;t=n}return u}function L(){for(var n,t={g:j,b:"k(m)",c:"",e:"m",f:"",h:"",i:!0,j:!!be},e=0;n=arguments[e];e++)for(var r in n)t[r]=n[r];if(n=t.a,t.d=/^[^,]+/.exec(n)[0],e=$t,r="var i,m="+t.d+",u="+t.e+";if(!m)return u;"+t.h+";",t.b?(r+="var n=m.length;i=-1;if("+t.b+"){",ve.unindexedChars&&(r+="if(l(m)){m=m.split('')}"),r+="while(++i<n){"+t.f+"}}else{"):ve.nonEnumArgs&&(r+="var n=m.length;i=-1;if(n&&j(m)){while(++i<n){i+='';"+t.f+"}}else{"),ve.enumPrototypes&&(r+="var v=typeof m=='function';"),t.i&&t.j)r+="var s=-1,t=r[typeof m]?o(m):[],n=t.length;while(++s<n){i=t[s];",ve.enumPrototypes&&(r+="if(!(v&&i=='prototype')){"),r+=t.f,ve.enumPrototypes&&(r+="}"),r+="}";
else if(r+="for(i in m){",(ve.enumPrototypes||t.i)&&(r+="if(",ve.enumPrototypes&&(r+="!(v&&i=='prototype')"),ve.enumPrototypes&&t.i&&(r+="&&"),t.i&&(r+="h.call(m,i)"),r+="){"),r+=t.f+";",(ve.enumPrototypes||t.i)&&(r+="}"),r+="}",ve.nonEnumShadows){r+="var f=m.constructor;";for(var u=0;7>u;u++)r+="i='"+t.g[u]+"';if(","constructor"==t.g[u]&&(r+="!(f&&f.prototype===m)&&"),r+="h.call(m,i)){"+t.f+"}"}return(t.b||ve.nonEnumArgs)&&(r+="}"),r+=t.c+";return u",e("h,j,k,l,o,p,r","return function("+n+"){"+r+"}")(Qt,W,me,ut,be,a,q)
}function K(n){return"\\"+B[n]}function M(n){return we[n]}function U(n){return typeof n.toString!="function"&&typeof(n+"")=="string"}function V(n){this.__wrapped__=n}function G(){}function H(n){var t=!1;if(!n||Zt.call(n)!=I||!ve.argsClass&&W(n))return t;var e=n.constructor;return(tt(e)?e instanceof e:ve.nodeClass||!U(n))?ve.ownLast?(xe(n,function(n,e,r){return t=Qt.call(r,e),!1}),!0===t):(xe(n,function(n,e){t=e}),!1===t||Qt.call(n,t)):t}function J(n,t,e){t||(t=0),typeof e=="undefined"&&(e=n?n.length:0);
var r=-1;e=e-t||0;for(var u=It(0>e?0:e);++r<e;)u[r]=n[t+r];return u}function Q(n){return Ce[n]}function W(n){return Zt.call(n)==k}function X(n,t,r,u,o,i){var f=n;if(typeof t=="function"&&(u=r,r=t,t=!1),typeof r=="function"){if(r=typeof u=="undefined"?r:a.createCallback(r,u,1),f=r(f),typeof f!="undefined")return f;f=n}if(u=et(f)){var l=Zt.call(f);if(!$[l]||!ve.nodeClass&&U(f))return f;var c=me(f)}if(!u||!t)return u?c?J(f):je({},f):f;switch(u=se[l],l){case O:case E:return new u(+f);case A:case N:return new u(f);
case P:return u(f.source,y.exec(f))}for(o||(o=[]),i||(i=[]),l=o.length;l--;)if(o[l]==n)return i[l];return f=c?u(f.length):{},c&&(Qt.call(n,"index")&&(f.index=n.index),Qt.call(n,"input")&&(f.input=n.input)),o.push(n),i.push(f),(c?pt:Oe)(n,function(n,u){f[u]=X(n,t,r,e,o,i)}),f}function Y(n){var t=[];return xe(n,function(n,e){tt(n)&&t.push(e)}),t.sort()}function Z(n){for(var t=-1,e=be(n),r=e.length,u={};++t<r;){var a=e[t];u[n[a]]=a}return u}function nt(n,t,e,r,u,o){var f=e===i;if(typeof e=="function"&&!f){e=a.createCallback(e,r,2);
var l=e(n,t);if(typeof l!="undefined")return!!l}if(n===t)return 0!==n||1/n==1/t;var c=typeof n,p=typeof t;if(n===n&&(!n||"function"!=c&&"object"!=c)&&(!t||"function"!=p&&"object"!=p))return!1;if(null==n||null==t)return n===t;if(p=Zt.call(n),c=Zt.call(t),p==k&&(p=I),c==k&&(c=I),p!=c)return!1;switch(p){case O:case E:return+n==+t;case A:return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;case P:case N:return n==Tt(t)}if(c=p==x,!c){if(Qt.call(n,"__wrapped__")||Qt.call(t,"__wrapped__"))return nt(n.__wrapped__||n,t.__wrapped__||t,e,r,u,o);
if(p!=I||!ve.nodeClass&&(U(n)||U(t)))return!1;var p=!ve.argsObject&&W(n)?Ft:n.constructor,s=!ve.argsObject&&W(t)?Ft:t.constructor;if(p!=s&&(!tt(p)||!(p instanceof p&&tt(s)&&s instanceof s)))return!1}for(u||(u=[]),o||(o=[]),p=u.length;p--;)if(u[p]==n)return o[p]==t;var v=0,l=!0;if(u.push(n),o.push(t),c){if(p=n.length,v=t.length,l=v==n.length,!l&&!f)return l;for(;v--;)if(c=p,s=t[v],f)for(;c--&&!(l=nt(n[c],s,e,r,u,o)););else if(!(l=nt(n[v],s,e,r,u,o)))break;return l}return xe(t,function(t,a,i){return Qt.call(i,a)?(v++,l=Qt.call(n,a)&&nt(n[a],t,e,r,u,o)):void 0
}),l&&!f&&xe(n,function(n,t,e){return Qt.call(e,t)?l=-1<--v:void 0}),l}function tt(n){return typeof n=="function"}function et(n){return n?q[typeof n]:!1}function rt(n){return typeof n=="number"||Zt.call(n)==A}function ut(n){return typeof n=="string"||Zt.call(n)==N}function at(n,t,e){var r=arguments,u=0,o=2;if(!et(n))return n;if(e===i)var f=r[3],l=r[4],c=r[5];else l=[],c=[],typeof e!="number"&&(o=r.length),3<o&&"function"==typeof r[o-2]?f=a.createCallback(r[--o-1],r[o--],2):2<o&&"function"==typeof r[o-1]&&(f=r[--o]);
for(;++u<o;)(me(r[u])?pt:Oe)(r[u],function(t,e){var r,u,a=t,o=n[e];if(t&&((u=me(t))||Ee(t))){for(a=l.length;a--;)if(r=l[a]==t){o=c[a];break}if(!r){var p;f&&(a=f(o,t),p=typeof a!="undefined")&&(o=a),p||(o=u?me(o)?o:[]:Ee(o)?o:{}),l.push(t),c.push(o),p||(o=at(o,t,i,f,l,c))}}else f&&(a=f(o,t),typeof a=="undefined"&&(a=t)),typeof a!="undefined"&&(o=a);n[e]=o});return n}function ot(n){for(var t=-1,e=be(n),r=e.length,u=It(r);++t<r;)u[t]=n[e[t]];return u}function it(n,t,e){var r=-1,u=n?n.length:0,a=!1;return e=(0>e?ae(0,u+e):e)||0,typeof u=="number"?a=-1<(ut(n)?n.indexOf(t,e):_t(n,t,e)):_e(n,function(n){return++r<e?void 0:!(a=n===t)
}),a}function ft(n,t,e){var r=!0;if(t=a.createCallback(t,e),me(n)){e=-1;for(var u=n.length;++e<u&&(r=!!t(n[e],e,n)););}else _e(n,function(n,e,u){return r=!!t(n,e,u)});return r}function lt(n,t,e){var r=[];if(t=a.createCallback(t,e),me(n)){e=-1;for(var u=n.length;++e<u;){var o=n[e];t(o,e,n)&&r.push(o)}}else _e(n,function(n,e,u){t(n,e,u)&&r.push(n)});return r}function ct(n,t,e){if(t=a.createCallback(t,e),!me(n)){var r;return _e(n,function(n,e,u){return t(n,e,u)?(r=n,!1):void 0}),r}e=-1;for(var u=n.length;++e<u;){var o=n[e];
if(t(o,e,n))return o}}function pt(n,t,e){if(t&&typeof e=="undefined"&&me(n)){e=-1;for(var r=n.length;++e<r&&!1!==t(n[e],e,n););}else _e(n,t,e);return n}function st(n,t,e){var r=-1,u=n?n.length:0,o=It(typeof u=="number"?u:0);if(t=a.createCallback(t,e),me(n))for(;++r<u;)o[r]=t(n[r],r,n);else _e(n,function(n,e,u){o[++r]=t(n,e,u)});return o}function vt(n,t,e){var r=-1/0,u=r;if(!t&&me(n)){e=-1;for(var o=n.length;++e<o;){var i=n[e];i>u&&(u=i)}}else t=!t&&ut(n)?T:a.createCallback(t,e),_e(n,function(n,e,a){e=t(n,e,a),e>r&&(r=e,u=n)
});return u}function gt(n,t,e,r){var u=3>arguments.length;if(t=a.createCallback(t,r,4),me(n)){var o=-1,i=n.length;for(u&&(e=n[++o]);++o<i;)e=t(e,n[o],o,n)}else _e(n,function(n,r,a){e=u?(u=!1,n):t(e,n,r,a)});return e}function yt(n,t,e,r){var u=n,o=n?n.length:0,i=3>arguments.length;if(typeof o!="number")var f=be(n),o=f.length;else ve.unindexedChars&&ut(n)&&(u=n.split(""));return t=a.createCallback(t,r,4),pt(n,function(n,r,a){r=f?f[--o]:--o,e=i?(i=!1,u[r]):t(e,u[r],r,a)}),e}function ht(n,t,e){var r;
if(t=a.createCallback(t,e),me(n)){e=-1;for(var u=n.length;++e<u&&!(r=t(n[e],e,n)););}else _e(n,function(n,e,u){return!(r=t(n,e,u))});return!!r}function mt(n){for(var t=-1,e=n?n.length:0,r=Gt.apply(zt,le.call(arguments,1)),r=R(r),u=[];++t<e;){var a=n[t];r(a)||u.push(a)}return u}function dt(n,t,e){if(n){var r=0,u=n.length;if(typeof t!="number"&&null!=t){var o=-1;for(t=a.createCallback(t,e);++o<u&&t(n[o],o,n);)r++}else if(r=t,null==r||e)return n[0];return J(n,0,oe(ae(0,r),u))}}function bt(n,t,e,r){var u=-1,o=n?n.length:0,i=[];
for(typeof t!="boolean"&&null!=t&&(r=e,e=t,t=!1),null!=e&&(e=a.createCallback(e,r));++u<o;)r=n[u],e&&(r=e(r,u,n)),me(r)?Wt.apply(i,t?r:bt(r)):i.push(r);return i}function _t(n,t,e){var r=-1,u=n?n.length:0;if(typeof e=="number")r=(0>e?ae(0,u+e):e||0)-1;else if(e)return r=Ct(n,t),n[r]===t?r:-1;for(;++r<u;)if(n[r]===t)return r;return-1}function wt(n,t,e){if(typeof t!="number"&&null!=t){var r=0,u=-1,o=n?n.length:0;for(t=a.createCallback(t,e);++u<o&&t(n[u],u,n);)r++}else r=null==t||e?1:ae(0,t);return J(n,r)
}function Ct(n,t,e,r){var u=0,o=n?n.length:u;for(e=e?a.createCallback(e,r,1):Et,t=e(t);u<o;)r=u+o>>>1,e(n[r])<t?u=r+1:o=r;return u}function jt(n,t,e,r){var u=-1,o=n?n.length:0,i=[],c=i;typeof t!="boolean"&&null!=t&&(r=e,e=t,t=!1);var p=!t&&o>=l;if(p)var s={};for(null!=e&&(c=[],e=a.createCallback(e,r));++u<o;){r=n[u];var v=e?e(r,u,n):r;if(p)var g=f+v,g=s[g]?!(c=s[g]):c=s[g]=[];(t?!u||c[c.length-1]!==v:g||0>_t(c,v))&&((e||p)&&c.push(v),i.push(r))}return i}function kt(n,t){for(var e=-1,r=n?n.length:0,u={};++e<r;){var a=n[e];
t?u[a]=t[e]:u[a[0]]=a[1]}return u}function xt(n,t){return ve.fastBind||ne&&2<arguments.length?ne.call.apply(ne,arguments):z(n,t,le.call(arguments,2))}function Ot(n){var t=le.call(arguments,1);return Yt(function(){n.apply(e,t)},1)}function Et(n){return n}function St(n){pt(Y(n),function(t){var e=a[t]=n[t];a.prototype[t]=function(){var n=this.__wrapped__,t=[n];return Wt.apply(t,arguments),t=e.apply(a,t),n&&typeof n=="object"&&n==t?this:new V(t)}})}function At(){return this.__wrapped__}r=r?F.defaults(n.Object(),r,F.pick(n,C)):n;
var It=r.Array,Pt=r.Boolean,Nt=r.Date,$t=r.Function,qt=r.Math,Bt=r.Number,Ft=r.Object,Rt=r.RegExp,Tt=r.String,Dt=r.TypeError,zt=It(),Lt=Ft(),Kt=r._,Mt=Rt("^"+Tt(Lt.valueOf).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),Ut=qt.ceil,Vt=r.clearTimeout,Gt=zt.concat,Ht=qt.floor,Jt=Mt.test(Jt=Ft.getPrototypeOf)&&Jt,Qt=Lt.hasOwnProperty,Wt=zt.push,Xt=r.setImmediate,Yt=r.setTimeout,Zt=Lt.toString,ne=Mt.test(ne=Zt.bind)&&ne,te=Mt.test(te=It.isArray)&&te,ee=r.isFinite,re=r.isNaN,ue=Mt.test(ue=Ft.keys)&&ue,ae=qt.max,oe=qt.min,ie=r.parseInt,fe=qt.random,le=zt.slice,ce=Mt.test(r.attachEvent),pe=ne&&!/\n|true/.test(ne+ce),se={};
se[x]=It,se[O]=Pt,se[E]=Nt,se[I]=Ft,se[A]=Bt,se[P]=Rt,se[N]=Tt;var ve=a.support={};(function(){var n=function(){this.x=1},t={0:1,length:1},e=[];n.prototype={valueOf:1,y:1};for(var r in new n)e.push(r);for(r in arguments);ve.argsObject=arguments.constructor==Ft&&!(arguments instanceof It),ve.argsClass=W(arguments),ve.enumPrototypes=n.propertyIsEnumerable("prototype"),ve.fastBind=ne&&!pe,ve.ownLast="x"!=e[0],ve.nonEnumArgs=0!=r,ve.nonEnumShadows=!/valueOf/.test(e),ve.spliceObjects=(zt.splice.call(t,0,1),!t[0]),ve.unindexedChars="xx"!="x"[0]+Ft("x")[0];
try{ve.nodeClass=!(Zt.call(document)==I&&!({toString:0}+""))}catch(u){ve.nodeClass=!0}})(1),a.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:h,variable:"",imports:{_:a}};var ge={a:"q,w,g",h:"var a=arguments,b=0,c=typeof g=='number'?2:a.length;while(++b<c){m=a[b];if(m&&r[typeof m]){",f:"if(typeof u[i]=='undefined')u[i]=m[i]",c:"}}"},ye={a:"e,d,x",h:"d=d&&typeof x=='undefined'?d:p.createCallback(d,x)",b:"typeof n=='number'",f:"if(d(m[i],i,e)===false)return u"},he={h:"if(!r[typeof m])return u;"+ye.h,b:!1};
V.prototype=a.prototype,ve.argsClass||(W=function(n){return n?Qt.call(n,"callee"):!1});var me=te||function(n){return n?typeof n=="object"&&Zt.call(n)==x:!1},de=L({a:"q",e:"[]",h:"if(!(r[typeof q]))return u",f:"u.push(i)",b:!1}),be=ue?function(n){return et(n)?ve.enumPrototypes&&typeof n=="function"||ve.nonEnumArgs&&n.length&&W(n)?de(n):ue(n):[]}:de,_e=L(ye),we={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Ce=Z(we),je=L(ge,{h:ge.h.replace(";",";if(c>3&&typeof a[c-2]=='function'){var d=p.createCallback(a[--c-1],a[c--],2);}else if(c>2&&typeof a[c-1]=='function'){d=a[--c];}"),f:"u[i]=d?d(u[i],m[i]):m[i]"}),ke=L(ge),xe=L(ye,he,{i:!1}),Oe=L(ye,he);
tt(/x/)&&(tt=function(n){return typeof n=="function"&&Zt.call(n)==S});var Ee=Jt?function(n){if(!n||Zt.call(n)!=I||!ve.argsClass&&W(n))return!1;var t=n.valueOf,e=typeof t=="function"&&(e=Jt(t))&&Jt(e);return e?n==e||Jt(n)==e:H(n)}:H;pe&&u&&typeof Xt=="function"&&(Ot=xt(Xt,r));var Se=8==ie(m+"08")?ie:function(n,t){return ie(ut(n)?n.replace(d,""):n,t||0)};return a.after=function(n,t){return 1>n?t():function(){return 1>--n?t.apply(this,arguments):void 0}},a.assign=je,a.at=function(n){var t=-1,e=Gt.apply(zt,le.call(arguments,1)),r=e.length,u=It(r);
for(ve.unindexedChars&&ut(n)&&(n=n.split(""));++t<r;)u[t]=n[e[t]];return u},a.bind=xt,a.bindAll=function(n){for(var t=1<arguments.length?Gt.apply(zt,le.call(arguments,1)):Y(n),e=-1,r=t.length;++e<r;){var u=t[e];n[u]=xt(n[u],n)}return n},a.bindKey=function(n,t){return z(n,t,le.call(arguments,2),i)},a.compact=function(n){for(var t=-1,e=n?n.length:0,r=[];++t<e;){var u=n[t];u&&r.push(u)}return r},a.compose=function(){var n=arguments;return function(){for(var t=arguments,e=n.length;e--;)t=[n[e].apply(this,t)];
return t[0]}},a.countBy=function(n,t,e){var r={};return t=a.createCallback(t,e),pt(n,function(n,e,u){e=Tt(t(n,e,u)),Qt.call(r,e)?r[e]++:r[e]=1}),r},a.createCallback=function(n,t,e){if(null==n)return Et;var r=typeof n;if("function"!=r){if("object"!=r)return function(t){return t[n]};var u=be(n);return function(t){for(var e=u.length,r=!1;e--&&(r=nt(t[u[e]],n[u[e]],i)););return r}}return typeof t!="undefined"?1===e?function(e){return n.call(t,e)}:2===e?function(e,r){return n.call(t,e,r)}:4===e?function(e,r,u,a){return n.call(t,e,r,u,a)
}:function(e,r,u){return n.call(t,e,r,u)}:n},a.debounce=function(n,t,e){function r(){a=f=null,l&&(o=n.apply(i,u))}var u,a,o,i,f,l=!0;if(!0===e)var c=!0,l=!1;else e&&q[typeof e]&&(c=e.leading,l="trailing"in e?e.trailing:l);return function(){return u=arguments,i=this,Vt(f),!a&&c?(a=!0,o=n.apply(i,u)):f=Yt(r,t),o}},a.defaults=ke,a.defer=Ot,a.delay=function(n,t){var r=le.call(arguments,2);return Yt(function(){n.apply(e,r)},t)},a.difference=mt,a.filter=lt,a.flatten=bt,a.forEach=pt,a.forIn=xe,a.forOwn=Oe,a.functions=Y,a.groupBy=function(n,t,e){var r={};
return t=a.createCallback(t,e),pt(n,function(n,e,u){e=Tt(t(n,e,u)),(Qt.call(r,e)?r[e]:r[e]=[]).push(n)}),r},a.initial=function(n,t,e){if(!n)return[];var r=0,u=n.length;if(typeof t!="number"&&null!=t){var o=u;for(t=a.createCallback(t,e);o--&&t(n[o],o,n);)r++}else r=null==t||e?1:t||r;return J(n,0,oe(ae(0,u-r),u))},a.intersection=function(n){var t=arguments,e=t.length,r={0:{}},u=-1,a=n?n.length:0,o=a>=l,i=[],c=i;n:for(;++u<a;){var p=n[u];if(o)var s=f+p,s=r[0][s]?!(c=r[0][s]):c=r[0][s]=[];if(s||0>_t(c,p)){o&&c.push(p);
for(var v=e;--v;)if(!(r[v]||(r[v]=R(t[v])))(p))continue n;i.push(p)}}return i},a.invert=Z,a.invoke=function(n,t){var e=le.call(arguments,2),r=-1,u=typeof t=="function",a=n?n.length:0,o=It(typeof a=="number"?a:0);return pt(n,function(n){o[++r]=(u?t:n[t]).apply(n,e)}),o},a.keys=be,a.map=st,a.max=vt,a.memoize=function(n,t){var e={};return function(){var r=f+(t?t.apply(this,arguments):arguments[0]);return Qt.call(e,r)?e[r]:e[r]=n.apply(this,arguments)}},a.merge=at,a.min=function(n,t,e){var r=1/0,u=r;
if(!t&&me(n)){e=-1;for(var o=n.length;++e<o;){var i=n[e];i<u&&(u=i)}}else t=!t&&ut(n)?T:a.createCallback(t,e),_e(n,function(n,e,a){e=t(n,e,a),e<r&&(r=e,u=n)});return u},a.omit=function(n,t,e){var r=typeof t=="function",u={};if(r)t=a.createCallback(t,e);else var o=Gt.apply(zt,le.call(arguments,1));return xe(n,function(n,e,a){(r?!t(n,e,a):0>_t(o,e))&&(u[e]=n)}),u},a.once=function(n){var t,e;return function(){return t?e:(t=!0,e=n.apply(this,arguments),n=null,e)}},a.pairs=function(n){for(var t=-1,e=be(n),r=e.length,u=It(r);++t<r;){var a=e[t];
u[t]=[a,n[a]]}return u},a.partial=function(n){return z(n,le.call(arguments,1))},a.partialRight=function(n){return z(n,le.call(arguments,1),null,i)},a.pick=function(n,t,e){var r={};if(typeof t!="function")for(var u=-1,o=Gt.apply(zt,le.call(arguments,1)),i=et(n)?o.length:0;++u<i;){var f=o[u];f in n&&(r[f]=n[f])}else t=a.createCallback(t,e),xe(n,function(n,e,u){t(n,e,u)&&(r[e]=n)});return r},a.pluck=st,a.range=function(n,t,e){n=+n||0,e=+e||1,null==t&&(t=n,n=0);var r=-1;t=ae(0,Ut((t-n)/e));for(var u=It(t);++r<t;)u[r]=n,n+=e;
return u},a.reject=function(n,t,e){return t=a.createCallback(t,e),lt(n,function(n,e,r){return!t(n,e,r)})},a.rest=wt,a.shuffle=function(n){var t=-1,e=n?n.length:0,r=It(typeof e=="number"?e:0);return pt(n,function(n){var e=Ht(fe()*(++t+1));r[t]=r[e],r[e]=n}),r},a.sortBy=function(n,t,e){var r=-1,u=n?n.length:0,o=It(typeof u=="number"?u:0);for(t=a.createCallback(t,e),pt(n,function(n,e,u){o[++r]={a:t(n,e,u),b:r,c:n}}),u=o.length,o.sort(D);u--;)o[u]=o[u].c;return o},a.tap=function(n,t){return t(n),n},a.throttle=function(n,t,e){function r(){i=null,c&&(f=new Nt,a=n.apply(o,u))
}var u,a,o,i,f=0,l=!0,c=!0;return!1===e?l=!1:e&&q[typeof e]&&(l="leading"in e?e.leading:l,c="trailing"in e?e.trailing:c),function(){var e=new Nt;!i&&!l&&(f=e);var c=t-(e-f);return u=arguments,o=this,0<c?i||(i=Yt(r,c)):(Vt(i),i=null,f=e,a=n.apply(o,u)),a}},a.times=function(n,t,e){n=-1<(n=+n)?n:0;var r=-1,u=It(n);for(t=a.createCallback(t,e,1);++r<n;)u[r]=t(r);return u},a.toArray=function(n){return n&&typeof n.length=="number"?ve.unindexedChars&&ut(n)?n.split(""):J(n):ot(n)},a.union=function(n){return me(n)||(arguments[0]=n?le.call(n):zt),jt(Gt.apply(zt,arguments))
},a.uniq=jt,a.unzip=function(n){for(var t=-1,e=n?n.length:0,r=e?vt(st(n,"length")):0,u=It(r);++t<e;)for(var a=-1,o=n[t];++a<r;)(u[a]||(u[a]=It(e)))[t]=o[a];return u},a.values=ot,a.where=lt,a.without=function(n){return mt(n,le.call(arguments,1))},a.wrap=function(n,t){return function(){var e=[n];return Wt.apply(e,arguments),t.apply(this,e)}},a.zip=function(n){for(var t=-1,e=n?vt(st(arguments,"length")):0,r=It(e);++t<e;)r[t]=st(arguments,t);return r},a.zipObject=kt,a.collect=st,a.drop=wt,a.each=pt,a.extend=je,a.methods=Y,a.object=kt,a.select=lt,a.tail=wt,a.unique=jt,St(a),a.clone=X,a.cloneDeep=function(n,t,e){return X(n,!0,t,e)
},a.contains=it,a.escape=function(n){return null==n?"":Tt(n).replace(_,M)},a.every=ft,a.find=ct,a.findIndex=function(n,t,e){var r=-1,u=n?n.length:0;for(t=a.createCallback(t,e);++r<u;)if(t(n[r],r,n))return r;return-1},a.findKey=function(n,t,e){var r;return t=a.createCallback(t,e),Oe(n,function(n,e,u){return t(n,e,u)?(r=e,!1):void 0}),r},a.has=function(n,t){return n?Qt.call(n,t):!1},a.identity=Et,a.indexOf=_t,a.isArguments=W,a.isArray=me,a.isBoolean=function(n){return!0===n||!1===n||Zt.call(n)==O},a.isDate=function(n){return n?typeof n=="object"&&Zt.call(n)==E:!1
},a.isElement=function(n){return n?1===n.nodeType:!1},a.isEmpty=function(n){var t=!0;if(!n)return t;var e=Zt.call(n),r=n.length;return e==x||e==N||(ve.argsClass?e==k:W(n))||e==I&&typeof r=="number"&&tt(n.splice)?!r:(Oe(n,function(){return t=!1}),t)},a.isEqual=nt,a.isFinite=function(n){return ee(n)&&!re(parseFloat(n))},a.isFunction=tt,a.isNaN=function(n){return rt(n)&&n!=+n},a.isNull=function(n){return null===n},a.isNumber=rt,a.isObject=et,a.isPlainObject=Ee,a.isRegExp=function(n){return n?q[typeof n]&&Zt.call(n)==P:!1
},a.isString=ut,a.isUndefined=function(n){return typeof n=="undefined"},a.lastIndexOf=function(n,t,e){var r=n?n.length:0;for(typeof e=="number"&&(r=(0>e?ae(0,r+e):oe(e,r-1))+1);r--;)if(n[r]===t)return r;return-1},a.mixin=St,a.noConflict=function(){return r._=Kt,this},a.parseInt=Se,a.random=function(n,t){return null==n&&null==t&&(t=1),n=+n||0,null==t&&(t=n,n=0),n+Ht(fe()*((+t||0)-n+1))},a.reduce=gt,a.reduceRight=yt,a.result=function(n,t){var r=n?n[t]:e;return tt(r)?n[t]():r},a.runInContext=t,a.size=function(n){var t=n?n.length:0;
return typeof t=="number"?t:be(n).length},a.some=ht,a.sortedIndex=Ct,a.template=function(n,t,r){var u=a.templateSettings;n||(n=""),r=ke({},r,u);var o,i=ke({},r.imports,u.imports),u=be(i),i=ot(i),f=0,l=r.interpolate||b,v="__p+='",l=Rt((r.escape||b).source+"|"+l.source+"|"+(l===h?g:b).source+"|"+(r.evaluate||b).source+"|$","g");n.replace(l,function(t,e,r,u,a,i){return r||(r=u),v+=n.slice(f,i).replace(w,K),e&&(v+="'+__e("+e+")+'"),a&&(o=!0,v+="';"+a+";__p+='"),r&&(v+="'+((__t=("+r+"))==null?'':__t)+'"),f=i+t.length,t
}),v+="';\n",l=r=r.variable,l||(r="obj",v="with("+r+"){"+v+"}"),v=(o?v.replace(c,""):v).replace(p,"$1").replace(s,"$1;"),v="function("+r+"){"+(l?"":r+"||("+r+"={});")+"var __t,__p='',__e=_.escape"+(o?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+v+"return __p}";try{var y=$t(u,"return "+v).apply(e,i)}catch(m){throw m.source=v,m}return t?y(t):(y.source=v,y)},a.unescape=function(n){return null==n?"":Tt(n).replace(v,Q)},a.uniqueId=function(n){var t=++o;return Tt(null==n?"":n)+t
},a.all=ft,a.any=ht,a.detect=ct,a.foldl=gt,a.foldr=yt,a.include=it,a.inject=gt,Oe(a,function(n,t){a.prototype[t]||(a.prototype[t]=function(){var t=[this.__wrapped__];return Wt.apply(t,arguments),n.apply(a,t)})}),a.first=dt,a.last=function(n,t,e){if(n){var r=0,u=n.length;if(typeof t!="number"&&null!=t){var o=u;for(t=a.createCallback(t,e);o--&&t(n[o],o,n);)r++}else if(r=t,null==r||e)return n[u-1];return J(n,ae(0,u-r))}},a.take=dt,a.head=dt,Oe(a,function(n,t){a.prototype[t]||(a.prototype[t]=function(t,e){var r=n(this.__wrapped__,t,e);
return null==t||e&&typeof t!="function"?r:new V(r)})}),a.VERSION="1.2.1",a.prototype.toString=function(){return Tt(this.__wrapped__)},a.prototype.value=At,a.prototype.valueOf=At,_e(["join","pop","shift"],function(n){var t=zt[n];a.prototype[n]=function(){return t.apply(this.__wrapped__,arguments)}}),_e(["push","reverse","sort","unshift"],function(n){var t=zt[n];a.prototype[n]=function(){return t.apply(this.__wrapped__,arguments),this}}),_e(["concat","slice","splice"],function(n){var t=zt[n];a.prototype[n]=function(){return new V(t.apply(this.__wrapped__,arguments))
}}),ve.spliceObjects||_e(["pop","shift","splice"],function(n){var t=zt[n],e="splice"==n;a.prototype[n]=function(){var n=this.__wrapped__,r=t.apply(n,arguments);return 0===n.length&&delete n[0],e?new V(r):r}}),a}var e,r=typeof exports=="object"&&exports,u=typeof module=="object"&&module&&module.exports==r&&module,a=typeof global=="object"&&global;(a.global===a||a.window===a)&&(n=a);var o=0,i={},f=+new Date+"",l=200,c=/\b__p\+='';/g,p=/\b(__p\+=)''\+/g,s=/(__e\(.*?\)|\b__t\))\+'';/g,v=/&(?:amp|lt|gt|quot|#39);/g,g=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,y=/\w*$/,h=/<%=([\s\S]+?)%>/g,m=" \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",d=RegExp("^["+m+"]*0+(?=.$)"),b=/($^)/,_=/[&<>"']/g,w=/['\n\r\t\u2028\u2029\\]/g,C="Array Boolean Date Function Math Number Object RegExp String _ attachEvent clearTimeout isFinite isNaN parseInt setImmediate setTimeout".split(" "),j="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),k="[object Arguments]",x="[object Array]",O="[object Boolean]",E="[object Date]",S="[object Function]",A="[object Number]",I="[object Object]",P="[object RegExp]",N="[object String]",$={};
$[S]=!1,$[k]=$[x]=$[O]=$[E]=$[A]=$[I]=$[P]=$[N]=!0;var q={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},B={"\\":"\\","'":"'","\n":"n","\r":"r","\t":"t","\u2028":"u2028","\u2029":"u2029"},F=t();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(n._=F,define(function(){return F})):r&&!r.nodeType?u?(u.exports=F)._=F:r._=F:n._=F})(this);
;!function(n){function t(n,t,r){r=(r||0)-1;for(var e=n.length;++r<e;)if(n[r]===t)return r;return-1}function r(n,r){var e=typeof r;if(n=n.k,"boolean"==e||r==d)return n[r];"number"!=e&&"string"!=e&&(e="object");var u="number"==e?r:x+r;return n=n[e]||(n[e]={}),"object"==e?n[u]&&-1<t(n[u],r)?0:-1:n[u]?0:-1}function e(n){var t=this.k,r=typeof n;if("boolean"==r||n==d)t[n]=y;else{"number"!=r&&"string"!=r&&(r="object");var e="number"==r?n:x+n,u=t[r]||(t[r]={});"object"==r?(u[e]||(u[e]=[])).push(n)==this.b.length&&(t[r]=b):u[e]=y
}}function u(n){return n.charCodeAt(0)}function a(n,t){var r=n.m,e=t.m;if(n=n.l,t=t.l,n!==t){if(n>t||typeof n=="undefined")return 1;if(n<t||typeof t=="undefined")return-1}return r<e?-1:1}function o(n){var t=-1,r=n.length,u=c();u["false"]=u["null"]=u["true"]=u.undefined=b;var a=c();for(a.b=n,a.k=u,a.push=e;++t<r;)a.push(n[t]);return u.object===false?(g(a),d):a}function i(n){return"\\"+tt[n]}function l(){return _.pop()||[]}function c(){return C.pop()||{a:"",b:d,c:"",l:d,"false":b,d:"",m:0,e:"",leading:b,f:"",maxWait:0,"null":b,number:d,object:d,push:d,g:d,string:d,h:"",trailing:b,"true":b,undefined:b,i:b,j:b,n:d}
}function f(n){return typeof n.toString!="function"&&typeof(n+"")=="string"}function p(){}function s(n){_.length==E&&(_.length=E-1),n.length=0,_.push(n)}function g(n){var t=n.k;t&&g(t),C.length==E&&(C.length=E-1),n.b=n.k=n.l=n.object=n.number=n.string=n.n=d,C.push(n)}function v(n,t,r){t||(t=0),typeof r=="undefined"&&(r=n?n.length:0);var e=-1;r=r-t||0;for(var u=Array(0>r?0:r);++e<r;)u[e]=n[t+e];return u}function h(e){function _(n){return n&&typeof n=="object"&&!qr(n)&&sr.call(n,"__wrapped__")?n:new C(n)
}function C(n){this.__wrapped__=n}function E(n,t,r,e){function u(){var e=arguments,c=o?this:t;return a||(n=t[i]),r.length&&(e=e.length?(e=Sr.call(e),l?e.concat(r):r.concat(e)):r),this instanceof u?(c=rt(n.prototype),e=n.apply(c,e),mt(e)?e:c):n.apply(c,e)}var a=ht(n),o=!r,i=t;if(o){var l=e;r=t}else if(!a){if(!e)throw new Zt;t=n}return u}function tt(){var n=c();n.g=L,n.b=n.c=n.f=n.h="",n.e="r",n.i=y,n.j=!!Rr;for(var t,r=0;t=arguments[r];r++)for(var e in t)n[e]=t[e];r=n.a,n.d=/^[^,]+/.exec(r)[0],t=Mt,r="return function("+r+"){",e="var m,r="+n.d+",C="+n.e+";if(!r)return C;"+n.h+";",n.b?(e+="var s=r.length;m=-1;if("+n.b+"){",Pr.unindexedChars&&(e+="if(q(r)){r=r.split('')}"),e+="while(++m<s){"+n.f+";}}else{"):Pr.nonEnumArgs&&(e+="var s=r.length;m=-1;if(s&&n(r)){while(++m<s){m+='';"+n.f+";}}else{"),Pr.enumPrototypes&&(e+="var E=typeof r=='function';"),Pr.enumErrorProps&&(e+="var D=r===j||r instanceof Error;");
var u=[];if(Pr.enumPrototypes&&u.push('!(E&&m=="prototype")'),Pr.enumErrorProps&&u.push('!(D&&(m=="message"||m=="name"))'),n.i&&n.j)e+="var A=-1,B=z[typeof r]&&t(r),s=B?B.length:0;while(++A<s){m=B[A];",u.length&&(e+="if("+u.join("&&")+"){"),e+=n.f+";",u.length&&(e+="}"),e+="}";else if(e+="for(m in r){",n.i&&u.push("l.call(r, m)"),u.length&&(e+="if("+u.join("&&")+"){"),e+=n.f+";",u.length&&(e+="}"),e+="}",Pr.nonEnumShadows){for(e+="if(r!==y){var h=r.constructor,p=r===(h&&h.prototype),e=r===H?G:r===j?i:J.call(r),v=w[e];",k=0;7>k;k++)e+="m='"+n.g[k]+"';if((!(p&&v[m])&&l.call(r,m))",n.i||(e+="||(!v[m]&&r[m]!==y[m])"),e+="){"+n.f+"}";
e+="}"}return(n.b||Pr.nonEnumArgs)&&(e+="}"),e+=n.c+";return C",t=t("i,j,l,n,o,q,t,u,y,z,w,G,H,J",r+e+"}"),g(n),t(M,tr,sr,ft,qr,dt,Rr,_,rr,nt,Nr,Y,er,yr)}function rt(n){return mt(n)?br(n):{}}function ut(n){return Wr[n]}function ot(){var n=(n=_.indexOf)===Pt?t:n;return n}function it(n){return function(t,r,e,u){return typeof r!="boolean"&&r!=d&&(u=e,e=u&&u[r]===t?m:r,r=b),e!=d&&(e=_.createCallback(e,u)),n(t,r,e,u)}}function lt(n){var t,r;return!n||yr.call(n)!=Q||(t=n.constructor,ht(t)&&!(t instanceof t))||!Pr.argsClass&&ft(n)||!Pr.nodeClass&&f(n)?b:Pr.ownLast?(Jr(n,function(n,t,e){return r=sr.call(e,t),b
}),r!==false):(Jr(n,function(n,t){r=t}),r===m||sr.call(n,r))}function ct(n){return Lr[n]}function ft(n){return yr.call(n)==G}function pt(n,t,r,e,u,a){var o=n;if(typeof t!="boolean"&&t!=d&&(e=r,r=t,t=b),typeof r=="function"){if(r=typeof e=="undefined"?r:_.createCallback(r,e,1),o=r(o),typeof o!="undefined")return o;o=n}if(e=mt(o)){var i=yr.call(o);if(!Z[i]||!Pr.nodeClass&&f(o))return o;var c=qr(o)}if(!e||!t)return e?c?v(o):Gr({},o):o;switch(e=Br[i],i){case J:case K:return new e(+o);case V:case Y:return new e(o);
case X:return e(o.source,P.exec(o))}i=!u,u||(u=l()),a||(a=l());for(var p=u.length;p--;)if(u[p]==n)return a[p];return o=c?e(o.length):{},c&&(sr.call(n,"index")&&(o.index=n.index),sr.call(n,"input")&&(o.input=n.input)),u.push(n),a.push(o),(c?Tr:Kr)(n,function(n,e){o[e]=pt(n,t,r,m,u,a)}),i&&(s(u),s(a)),o}function st(n){var t=[];return Jr(n,function(n,r){ht(n)&&t.push(r)}),t.sort()}function gt(n){for(var t=-1,r=Rr(n),e=r.length,u={};++t<e;){var a=r[t];u[n[a]]=a}return u}function vt(n,t,r,e,u,a){var o=r===w;
if(typeof r=="function"&&!o){r=_.createCallback(r,e,2);var i=r(n,t);if(typeof i!="undefined")return!!i}if(n===t)return 0!==n||1/n==1/t;var c=typeof n,p=typeof t;if(n===n&&(!n||"function"!=c&&"object"!=c)&&(!t||"function"!=p&&"object"!=p))return b;if(n==d||t==d)return n===t;if(p=yr.call(n),c=yr.call(t),p==G&&(p=Q),c==G&&(c=Q),p!=c)return b;switch(p){case J:case K:return+n==+t;case V:return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;case X:case Y:return n==Yt(t)}if(c=p==H,!c){if(sr.call(n,"__wrapped__")||sr.call(t,"__wrapped__"))return vt(n.__wrapped__||n,t.__wrapped__||t,r,e,u,a);
if(p!=Q||!Pr.nodeClass&&(f(n)||f(t)))return b;var p=!Pr.argsObject&&ft(n)?Qt:n.constructor,g=!Pr.argsObject&&ft(t)?Qt:t.constructor;if(p!=g&&(!ht(p)||!(p instanceof p&&ht(g)&&g instanceof g)))return b}for(g=!u,u||(u=l()),a||(a=l()),p=u.length;p--;)if(u[p]==n)return a[p]==t;var v=0,i=y;if(u.push(n),a.push(t),c){if(p=n.length,v=t.length,i=v==n.length,!i&&!o)return i;for(;v--;)if(c=p,g=t[v],o)for(;c--&&!(i=vt(n[c],g,r,e,u,a)););else if(!(i=vt(n[v],g,r,e,u,a)))break;return i}return Jr(t,function(t,o,l){return sr.call(l,o)?(v++,i=sr.call(n,o)&&vt(n[o],t,r,e,u,a)):void 0
}),i&&!o&&Jr(n,function(n,t,r){return sr.call(r,t)?i=-1<--v:void 0}),g&&(s(u),s(a)),i}function ht(n){return typeof n=="function"}function mt(n){return!(!n||!nt[typeof n])}function yt(n){return typeof n=="number"||yr.call(n)==V}function dt(n){return typeof n=="string"||yr.call(n)==Y}function bt(n,t,r){var e=arguments,u=0,a=2;if(!mt(n))return n;if(r===w)var o=e[3],i=e[4],c=e[5];else{var f=y,i=l(),c=l();typeof r!="number"&&(a=e.length),3<a&&"function"==typeof e[a-2]?o=_.createCallback(e[--a-1],e[a--],2):2<a&&"function"==typeof e[a-1]&&(o=e[--a])
}for(;++u<a;)(qr(e[u])?xt:Kr)(e[u],function(t,r){var e,u,a=t,l=n[r];if(t&&((u=qr(t))||Mr(t))){for(a=i.length;a--;)if(e=i[a]==t){l=c[a];break}if(!e){var f;o&&(a=o(l,t),f=typeof a!="undefined")&&(l=a),f||(l=u?qr(l)?l:[]:Mr(l)?l:{}),i.push(t),c.push(l),f||(l=bt(l,t,w,o,i,c))}}else o&&(a=o(l,t),typeof a=="undefined"&&(a=t)),typeof a!="undefined"&&(l=a);n[r]=l});return f&&(s(i),s(c)),n}function _t(n){for(var t=-1,r=Rr(n),e=r.length,u=Ht(e);++t<e;)u[t]=n[r[t]];return u}function Ct(n,t,r){var e=-1,u=ot(),a=n?n.length:0,o=b;
return r=(0>r?kr(0,a+r):r)||0,a&&typeof a=="number"?o=-1<(dt(n)?n.indexOf(t,r):u(n,t,r)):Tr(n,function(n){return++e<r?void 0:!(o=n===t)}),o}function jt(n,t,r){var e=y;if(t=_.createCallback(t,r),qr(n)){r=-1;for(var u=n.length;++r<u&&(e=!!t(n[r],r,n)););}else Tr(n,function(n,r,u){return e=!!t(n,r,u)});return e}function wt(n,t,r){var e=[];if(t=_.createCallback(t,r),qr(n)){r=-1;for(var u=n.length;++r<u;){var a=n[r];t(a,r,n)&&e.push(a)}}else Tr(n,function(n,r,u){t(n,r,u)&&e.push(n)});return e}function kt(n,t,r){if(t=_.createCallback(t,r),!qr(n)){var e;
return Tr(n,function(n,r,u){return t(n,r,u)?(e=n,b):void 0}),e}r=-1;for(var u=n.length;++r<u;){var a=n[r];if(t(a,r,n))return a}}function xt(n,t,r){if(t&&typeof r=="undefined"&&qr(n)){r=-1;for(var e=n.length;++r<e&&t(n[r],r,n)!==false;);}else Tr(n,t,r);return n}function Ot(n,t,r){var e=-1,u=n?n.length:0,a=Ht(typeof u=="number"?u:0);if(t=_.createCallback(t,r),qr(n))for(;++e<u;)a[e]=t(n[e],e,n);else Tr(n,function(n,r,u){a[++e]=t(n,r,u)});return a}function Et(n,t,r){var e=-1/0,a=e;if(!t&&qr(n)){r=-1;for(var o=n.length;++r<o;){var i=n[r];
i>a&&(a=i)}}else t=!t&&dt(n)?u:_.createCallback(t,r),Tr(n,function(n,r,u){r=t(n,r,u),r>e&&(e=r,a=n)});return a}function St(n,t,r,e){var u=3>arguments.length;if(t=_.createCallback(t,e,4),qr(n)){var a=-1,o=n.length;for(u&&(r=n[++a]);++a<o;)r=t(r,n[a],a,n)}else Tr(n,function(n,e,a){r=u?(u=b,n):t(r,n,e,a)});return r}function At(n,t,r,e){var u=n,a=n?n.length:0,o=3>arguments.length;if(typeof a!="number")var i=Rr(n),a=i.length;else Pr.unindexedChars&&dt(n)&&(u=n.split(""));return t=_.createCallback(t,e,4),xt(n,function(n,e,l){e=i?i[--a]:--a,r=o?(o=b,u[e]):t(r,u[e],e,l)
}),r}function It(n,t,r){var e;if(t=_.createCallback(t,r),qr(n)){r=-1;for(var u=n.length;++r<u&&!(e=t(n[r],r,n)););}else Tr(n,function(n,r,u){return!(e=t(n,r,u))});return!!e}function Bt(n){var e=-1,u=ot(),a=n?n.length:0,i=lr.apply(nr,Sr.call(arguments,1)),l=[],c=a>=O&&u===t;if(c){var f=o(i);f?(u=r,i=f):c=b}for(;++e<a;)f=n[e],0>u(i,f)&&l.push(f);return c&&g(i),l}function Nt(n,t,r){if(n){var e=0,u=n.length;if(typeof t!="number"&&t!=d){var a=-1;for(t=_.createCallback(t,r);++a<u&&t(n[a],a,n);)e++}else if(e=t,e==d||r)return n[0];
return v(n,0,xr(kr(0,e),u))}}function Pt(n,r,e){if(typeof e=="number"){var u=n?n.length:0;e=0>e?kr(0,u+e):e||0}else if(e)return e=Ft(n,r),n[e]===r?e:-1;return n?t(n,r,e):-1}function zt(n,t,r){if(typeof t!="number"&&t!=d){var e=0,u=-1,a=n?n.length:0;for(t=_.createCallback(t,r);++u<a&&t(n[u],u,n);)e++}else e=t==d||r?1:kr(0,t);return v(n,e)}function Ft(n,t,r,e){var u=0,a=n?n.length:u;for(r=r?_.createCallback(r,e,1):Wt,t=r(t);u<a;)e=u+a>>>1,r(n[e])<t?u=e+1:a=e;return u}function $t(n){for(var t=-1,r=n?Et(Ur(n,"length")):0,e=Ht(0>r?0:r);++t<r;)e[t]=Ur(n,t);
return e}function qt(n,t){for(var r=-1,e=n?n.length:0,u={};++r<e;){var a=n[r];t?u[a]=t[r]:u[a[0]]=a[1]}return u}function Dt(n,t){return Pr.fastBind||dr&&2<arguments.length?dr.call.apply(dr,arguments):E(n,t,Sr.call(arguments,2))}function Rt(n,t,r){function e(){ir(s),ir(g),c=0,s=g=d}function u(){var t=v&&(!h||1<c);e(),t&&(p!==false&&(f=new Kt),i=n.apply(l,o))}function a(){e(),(v||p!==t)&&(f=new Kt,i=n.apply(l,o))}var o,i,l,c=0,f=0,p=b,s=d,g=d,v=y;if(t=kr(0,t||0),r===y)var h=y,v=b;else mt(r)&&(h=r.leading,p="maxWait"in r&&kr(t,r.maxWait||0),v="trailing"in r?r.trailing:v);
return function(){if(o=arguments,l=this,c++,ir(g),p===false)h&&2>c&&(i=n.apply(l,o));else{var r=new Kt;!s&&!h&&(f=r);var e=p-(r-f);0<e?s||(s=mr(a,e)):(ir(s),s=d,f=r,i=n.apply(l,o))}return t!==p&&(g=mr(u,t)),i}}function Tt(n){var t=Sr.call(arguments,1);return mr(function(){n.apply(m,t)},1)}function Wt(n){return n}function Lt(n){xt(st(n),function(t){var r=_[t]=n[t];_.prototype[t]=function(){var n=this.__wrapped__,t=[n];return gr.apply(t,arguments),t=r.apply(_,t),n&&typeof n=="object"&&n===t?this:new C(t)
}})}function Gt(){return this.__wrapped__}e=e?at.defaults(n.Object(),e,at.pick(n,W)):n;var Ht=e.Array,Jt=e.Boolean,Kt=e.Date,Mt=e.Function,Ut=e.Math,Vt=e.Number,Qt=e.Object,Xt=e.RegExp,Yt=e.String,Zt=e.TypeError,nr=[],tr=e.Error.prototype,rr=Qt.prototype,er=Yt.prototype,ur=e._,ar=Xt("^"+Yt(rr.valueOf).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),or=Ut.ceil,ir=e.clearTimeout,lr=nr.concat,cr=Ut.floor,fr=Mt.prototype.toString,pr=ar.test(pr=Qt.getPrototypeOf)&&pr,sr=rr.hasOwnProperty,gr=nr.push,vr=rr.propertyIsEnumerable,hr=e.setImmediate,mr=e.setTimeout,yr=rr.toString,dr=ar.test(dr=yr.bind)&&dr,br=ar.test(br=Qt.create)&&br,_r=ar.test(_r=Ht.isArray)&&_r,Cr=e.isFinite,jr=e.isNaN,wr=ar.test(wr=Qt.keys)&&wr,kr=Ut.max,xr=Ut.min,Or=e.parseInt,Er=Ut.random,Sr=nr.slice,Ar=ar.test(e.attachEvent),Ir=dr&&!/\n|true/.test(dr+Ar),Br={};
Br[H]=Ht,Br[J]=Jt,Br[K]=Kt,Br[U]=Mt,Br[Q]=Qt,Br[V]=Vt,Br[X]=Xt,Br[Y]=Yt;var Nr={};Nr[H]=Nr[K]=Nr[V]={constructor:y,toLocaleString:y,toString:y,valueOf:y},Nr[J]=Nr[Y]={constructor:y,toString:y,valueOf:y},Nr[M]=Nr[U]=Nr[X]={constructor:y,toString:y},Nr[Q]={constructor:y},function(){for(var n=L.length;n--;){var t,r=L[n];for(t in Nr)sr.call(Nr,t)&&!sr.call(Nr[t],r)&&(Nr[t][r]=b)}}(),C.prototype=_.prototype;var Pr=_.support={};!function(){function n(){this.x=1}var t={0:1,length:1},r=[];n.prototype={valueOf:1};
for(var e in new n)r.push(e);for(e in arguments);Pr.argsObject=arguments.constructor==Qt&&!(arguments instanceof Ht),Pr.argsClass=ft(arguments),Pr.enumErrorProps=vr.call(tr,"message")||vr.call(tr,"name"),Pr.enumPrototypes=vr.call(n,"prototype"),Pr.fastBind=dr&&!Ir,Pr.ownLast="x"!=r[0],Pr.nonEnumArgs=0!=e,Pr.nonEnumShadows=!/valueOf/.test(r),Pr.spliceObjects=(nr.splice.call(t,0,1),!t[0]),Pr.unindexedChars="xx"!="x"[0]+Qt("x")[0];try{Pr.nodeClass=!(yr.call(document)==Q&&!({toString:0}+""))}catch(u){Pr.nodeClass=y
}}(1),_.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:z,variable:"",imports:{_:_}};var zr={a:"x,F,k",h:"var a=arguments,b=0,c=typeof k=='number'?2:a.length;while(++b<c){r=a[b];if(r&&z[typeof r]){",f:"if(typeof C[m]=='undefined')C[m]=r[m]",c:"}}"},Fr={a:"f,d,I",h:"d=d&&typeof I=='undefined'?d:u.createCallback(d,I)",b:"typeof s=='number'",f:"if(d(r[m],m,f)===false)return C"},$r={h:"if(!z[typeof r])return C;"+Fr.h,b:b};br||(rt=function(n){if(mt(n)){p.prototype=n;
var t=new p;p.prototype=d}return t||{}}),Pr.argsClass||(ft=function(n){return n?sr.call(n,"callee"):b});var qr=_r||function(n){return n?typeof n=="object"&&yr.call(n)==H:b},Dr=tt({a:"x",e:"[]",h:"if(!(z[typeof x]))return C",f:"C.push(m)"}),Rr=wr?function(n){return mt(n)?Pr.enumPrototypes&&typeof n=="function"||Pr.nonEnumArgs&&n.length&&ft(n)?Dr(n):wr(n):[]}:Dr,Tr=tt(Fr),Wr={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Lr=gt(Wr),Gr=tt(zr,{h:zr.h.replace(";",";if(c>3&&typeof a[c-2]=='function'){var d=u.createCallback(a[--c-1],a[c--],2)}else if(c>2&&typeof a[c-1]=='function'){d=a[--c]}"),f:"C[m]=d?d(C[m],r[m]):r[m]"}),Hr=tt(zr),Jr=tt(Fr,$r,{i:b}),Kr=tt(Fr,$r);
ht(/x/)&&(ht=function(n){return typeof n=="function"&&yr.call(n)==U});var Mr=pr?function(n){if(!n||yr.call(n)!=Q||!Pr.argsClass&&ft(n))return b;var t=n.valueOf,r=typeof t=="function"&&(r=pr(t))&&pr(r);return r?n==r||pr(n)==r:lt(n)}:lt,Ur=Ot,Vr=it(function Yr(n,t,r){for(var e=-1,u=n?n.length:0,a=[];++e<u;){var o=n[e];r&&(o=r(o,e,n)),qr(o)?gr.apply(a,t?o:Yr(o)):a.push(o)}return a}),Qr=it(function(n,e,u){var a=-1,i=ot(),c=n?n.length:0,f=[],p=!e&&c>=O&&i===t,v=u||p?l():f;if(p){var h=o(v);h?(i=r,v=h):(p=b,v=u?v:(s(v),f))
}for(;++a<c;){var h=n[a],m=u?u(h,a,n):h;(e?!a||v[v.length-1]!==m:0>i(v,m))&&((u||p)&&v.push(m),f.push(h))}return p?(s(v.b),g(v)):u&&s(v),f});Ir&&et&&typeof hr=="function"&&(Tt=Dt(hr,e));var Xr=8==Or($+"08")?Or:function(n,t){return Or(dt(n)?n.replace(q,""):n,t||0)};return _.after=function(n,t){return 1>n?t():function(){return 1>--n?t.apply(this,arguments):void 0}},_.assign=Gr,_.at=function(n){var t=-1,r=lr.apply(nr,Sr.call(arguments,1)),e=r.length,u=Ht(e);for(Pr.unindexedChars&&dt(n)&&(n=n.split(""));++t<e;)u[t]=n[r[t]];
return u},_.bind=Dt,_.bindAll=function(n){for(var t=1<arguments.length?lr.apply(nr,Sr.call(arguments,1)):st(n),r=-1,e=t.length;++r<e;){var u=t[r];n[u]=Dt(n[u],n)}return n},_.bindKey=function(n,t){return E(n,t,Sr.call(arguments,2),w)},_.compact=function(n){for(var t=-1,r=n?n.length:0,e=[];++t<r;){var u=n[t];u&&e.push(u)}return e},_.compose=function(){var n=arguments;return function(){for(var t=arguments,r=n.length;r--;)t=[n[r].apply(this,t)];return t[0]}},_.countBy=function(n,t,r){var e={};return t=_.createCallback(t,r),xt(n,function(n,r,u){r=Yt(t(n,r,u)),sr.call(e,r)?e[r]++:e[r]=1
}),e},_.createCallback=function(n,t,r){if(n==d)return Wt;var e=typeof n;if("function"!=e){if("object"!=e)return function(t){return t[n]};var u=Rr(n);return function(t){for(var r=u.length,e=b;r--&&(e=vt(t[u[r]],n[u[r]],w)););return e}}return typeof t=="undefined"||F&&!F.test(fr.call(n))?n:1===r?function(r){return n.call(t,r)}:2===r?function(r,e){return n.call(t,r,e)}:4===r?function(r,e,u,a){return n.call(t,r,e,u,a)}:function(r,e,u){return n.call(t,r,e,u)}},_.debounce=Rt,_.defaults=Hr,_.defer=Tt,_.delay=function(n,t){var r=Sr.call(arguments,2);
return mr(function(){n.apply(m,r)},t)},_.difference=Bt,_.filter=wt,_.flatten=Vr,_.forEach=xt,_.forIn=Jr,_.forOwn=Kr,_.functions=st,_.groupBy=function(n,t,r){var e={};return t=_.createCallback(t,r),xt(n,function(n,r,u){r=Yt(t(n,r,u)),(sr.call(e,r)?e[r]:e[r]=[]).push(n)}),e},_.initial=function(n,t,r){if(!n)return[];var e=0,u=n.length;if(typeof t!="number"&&t!=d){var a=u;for(t=_.createCallback(t,r);a--&&t(n[a],a,n);)e++}else e=t==d||r?1:t||e;return v(n,0,xr(kr(0,u-e),u))},_.intersection=function(n){for(var e=arguments,u=e.length,a=-1,i=l(),c=-1,f=ot(),p=n?n.length:0,v=[],h=l();++a<u;){var m=e[a];
i[a]=f===t&&(m?m.length:0)>=O&&o(a?e[a]:h)}n:for(;++c<p;){var y=i[0],m=n[c];if(0>(y?r(y,m):f(h,m))){for(a=u,(y||h).push(m);--a;)if(y=i[a],0>(y?r(y,m):f(e[a],m)))continue n;v.push(m)}}for(;u--;)(y=i[u])&&g(y);return s(i),s(h),v},_.invert=gt,_.invoke=function(n,t){var r=Sr.call(arguments,2),e=-1,u=typeof t=="function",a=n?n.length:0,o=Ht(typeof a=="number"?a:0);return xt(n,function(n){o[++e]=(u?t:n[t]).apply(n,r)}),o},_.keys=Rr,_.map=Ot,_.max=Et,_.memoize=function(n,t){function r(){var e=r.cache,u=x+(t?t.apply(this,arguments):arguments[0]);
return sr.call(e,u)?e[u]:e[u]=n.apply(this,arguments)}return r.cache={},r},_.merge=bt,_.min=function(n,t,r){var e=1/0,a=e;if(!t&&qr(n)){r=-1;for(var o=n.length;++r<o;){var i=n[r];i<a&&(a=i)}}else t=!t&&dt(n)?u:_.createCallback(t,r),Tr(n,function(n,r,u){r=t(n,r,u),r<e&&(e=r,a=n)});return a},_.omit=function(n,t,r){var e=ot(),u=typeof t=="function",a={};if(u)t=_.createCallback(t,r);else var o=lr.apply(nr,Sr.call(arguments,1));return Jr(n,function(n,r,i){(u?!t(n,r,i):0>e(o,r))&&(a[r]=n)}),a},_.once=function(n){var t,r;
return function(){return t?r:(t=y,r=n.apply(this,arguments),n=d,r)}},_.pairs=function(n){for(var t=-1,r=Rr(n),e=r.length,u=Ht(e);++t<e;){var a=r[t];u[t]=[a,n[a]]}return u},_.partial=function(n){return E(n,Sr.call(arguments,1))},_.partialRight=function(n){return E(n,Sr.call(arguments,1),d,w)},_.pick=function(n,t,r){var e={};if(typeof t!="function")for(var u=-1,a=lr.apply(nr,Sr.call(arguments,1)),o=mt(n)?a.length:0;++u<o;){var i=a[u];i in n&&(e[i]=n[i])}else t=_.createCallback(t,r),Jr(n,function(n,r,u){t(n,r,u)&&(e[r]=n)
});return e},_.pluck=Ur,_.range=function(n,t,r){n=+n||0,r=+r||1,t==d&&(t=n,n=0);var e=-1;t=kr(0,or((t-n)/r));for(var u=Ht(t);++e<t;)u[e]=n,n+=r;return u},_.reject=function(n,t,r){return t=_.createCallback(t,r),wt(n,function(n,r,e){return!t(n,r,e)})},_.rest=zt,_.shuffle=function(n){var t=-1,r=n?n.length:0,e=Ht(typeof r=="number"?r:0);return xt(n,function(n){var r=cr(Er()*(++t+1));e[t]=e[r],e[r]=n}),e},_.sortBy=function(n,t,r){var e=-1,u=n?n.length:0,o=Ht(typeof u=="number"?u:0);for(t=_.createCallback(t,r),xt(n,function(n,r,u){var a=o[++e]=c();
a.l=t(n,r,u),a.m=e,a.n=n}),u=o.length,o.sort(a);u--;)n=o[u],o[u]=n.n,g(n);return o},_.tap=function(n,t){return t(n),n},_.throttle=function(n,t,r){var e=y,u=y;return r===false?e=b:mt(r)&&(e="leading"in r?r.leading:e,u="trailing"in r?r.trailing:u),r=c(),r.leading=e,r.maxWait=t,r.trailing=u,n=Rt(n,t,r),g(r),n},_.times=function(n,t,r){n=-1<(n=+n)?n:0;var e=-1,u=Ht(n);for(t=_.createCallback(t,r,1);++e<n;)u[e]=t(e);return u},_.toArray=function(n){return n&&typeof n.length=="number"?Pr.unindexedChars&&dt(n)?n.split(""):v(n):_t(n)
},_.transform=function(n,t,r,e){var u=qr(n);return t=_.createCallback(t,e,4),r==d&&(u?r=[]:(e=n&&n.constructor,r=rt(e&&e.prototype))),(u?Tr:Kr)(n,function(n,e,u){return t(r,n,e,u)}),r},_.union=function(n){return qr(n)||(arguments[0]=n?Sr.call(n):nr),Qr(lr.apply(nr,arguments))},_.uniq=Qr,_.unzip=$t,_.values=_t,_.where=wt,_.without=function(n){return Bt(n,Sr.call(arguments,1))},_.wrap=function(n,t){return function(){var r=[n];return gr.apply(r,arguments),t.apply(this,r)}},_.zip=function(n){return n?$t(arguments):[]
},_.zipObject=qt,_.collect=Ot,_.drop=zt,_.each=xt,_.extend=Gr,_.methods=st,_.object=qt,_.select=wt,_.tail=zt,_.unique=Qr,Lt(_),_.chain=_,_.prototype.chain=function(){return this},_.clone=pt,_.cloneDeep=function(n,t,r){return pt(n,y,t,r)},_.contains=Ct,_.escape=function(n){return n==d?"":Yt(n).replace(R,ut)},_.every=jt,_.find=kt,_.findIndex=function(n,t,r){var e=-1,u=n?n.length:0;for(t=_.createCallback(t,r);++e<u;)if(t(n[e],e,n))return e;return-1},_.findKey=function(n,t,r){var e;return t=_.createCallback(t,r),Kr(n,function(n,r,u){return t(n,r,u)?(e=r,b):void 0
}),e},_.has=function(n,t){return n?sr.call(n,t):b},_.identity=Wt,_.indexOf=Pt,_.isArguments=ft,_.isArray=qr,_.isBoolean=function(n){return n===y||n===false||yr.call(n)==J},_.isDate=function(n){return n?typeof n=="object"&&yr.call(n)==K:b},_.isElement=function(n){return n?1===n.nodeType:b},_.isEmpty=function(n){var t=y;if(!n)return t;var r=yr.call(n),e=n.length;return r==H||r==Y||(Pr.argsClass?r==G:ft(n))||r==Q&&typeof e=="number"&&ht(n.splice)?!e:(Kr(n,function(){return t=b}),t)},_.isEqual=vt,_.isFinite=function(n){return Cr(n)&&!jr(parseFloat(n))
},_.isFunction=ht,_.isNaN=function(n){return yt(n)&&n!=+n},_.isNull=function(n){return n===d},_.isNumber=yt,_.isObject=mt,_.isPlainObject=Mr,_.isRegExp=function(n){return!(!n||!nt[typeof n])&&yr.call(n)==X},_.isString=dt,_.isUndefined=function(n){return typeof n=="undefined"},_.lastIndexOf=function(n,t,r){var e=n?n.length:0;for(typeof r=="number"&&(e=(0>r?kr(0,e+r):xr(r,e-1))+1);e--;)if(n[e]===t)return e;return-1},_.mixin=Lt,_.noConflict=function(){return e._=ur,this},_.parseInt=Xr,_.random=function(n,t){n==d&&t==d&&(t=1),n=+n||0,t==d?(t=n,n=0):t=+t||0;
var r=Er();return n%1||t%1?n+xr(r*(t-n+parseFloat("1e-"+((r+"").length-1))),t):n+cr(r*(t-n+1))},_.reduce=St,_.reduceRight=At,_.result=function(n,t){var r=n?n[t]:m;return ht(r)?n[t]():r},_.runInContext=h,_.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:Rr(n).length},_.some=It,_.sortedIndex=Ft,_.template=function(n,t,r){var e=_.templateSettings;n||(n=""),r=Hr({},r,e);var u,a=Hr({},r.imports,e.imports),e=Rr(a),a=_t(a),o=0,l=r.interpolate||D,c="__p+='",l=Xt((r.escape||D).source+"|"+l.source+"|"+(l===z?N:D).source+"|"+(r.evaluate||D).source+"|$","g");
n.replace(l,function(t,r,e,a,l,f){return e||(e=a),c+=n.slice(o,f).replace(T,i),r&&(c+="'+__e("+r+")+'"),l&&(u=y,c+="';"+l+";__p+='"),e&&(c+="'+((__t=("+e+"))==null?'':__t)+'"),o=f+t.length,t}),c+="';\n",l=r=r.variable,l||(r="obj",c="with("+r+"){"+c+"}"),c=(u?c.replace(S,""):c).replace(A,"$1").replace(I,"$1;"),c="function("+r+"){"+(l?"":r+"||("+r+"={});")+"var __t,__p='',__e=_.escape"+(u?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+c+"return __p}";try{var f=Mt(e,"return "+c).apply(m,a)
}catch(p){throw p.source=c,p}return t?f(t):(f.source=c,f)},_.unescape=function(n){return n==d?"":Yt(n).replace(B,ct)},_.uniqueId=function(n){var t=++j;return Yt(n==d?"":n)+t},_.all=jt,_.any=It,_.detect=kt,_.findWhere=kt,_.foldl=St,_.foldr=At,_.include=Ct,_.inject=St,Kr(_,function(n,t){_.prototype[t]||(_.prototype[t]=function(){var t=[this.__wrapped__];return gr.apply(t,arguments),n.apply(_,t)})}),_.first=Nt,_.last=function(n,t,r){if(n){var e=0,u=n.length;if(typeof t!="number"&&t!=d){var a=u;for(t=_.createCallback(t,r);a--&&t(n[a],a,n);)e++
}else if(e=t,e==d||r)return n[u-1];return v(n,kr(0,u-e))}},_.take=Nt,_.head=Nt,Kr(_,function(n,t){_.prototype[t]||(_.prototype[t]=function(t,r){var e=n(this.__wrapped__,t,r);return t==d||r&&typeof t!="function"?e:new C(e)})}),_.VERSION="1.3.0",_.prototype.toString=function(){return Yt(this.__wrapped__)},_.prototype.value=Gt,_.prototype.valueOf=Gt,Tr(["join","pop","shift"],function(n){var t=nr[n];_.prototype[n]=function(){return t.apply(this.__wrapped__,arguments)}}),Tr(["push","reverse","sort","unshift"],function(n){var t=nr[n];
_.prototype[n]=function(){return t.apply(this.__wrapped__,arguments),this}}),Tr(["concat","slice","splice"],function(n){var t=nr[n];_.prototype[n]=function(){return new C(t.apply(this.__wrapped__,arguments))}}),Pr.spliceObjects||Tr(["pop","shift","splice"],function(n){var t=nr[n],r="splice"==n;_.prototype[n]=function(){var n=this.__wrapped__,e=t.apply(n,arguments);return 0===n.length&&delete n[0],r?new C(e):e}}),_}var m,y=!0,d=null,b=!1,_=[],C=[],j=0,w={},x=+new Date+"",O=75,E=10,S=/\b__p\+='';/g,A=/\b(__p\+=)''\+/g,I=/(__e\(.*?\)|\b__t\))\+'';/g,B=/&(?:amp|lt|gt|quot|#39);/g,N=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,P=/\w*$/,z=/<%=([\s\S]+?)%>/g,F=(F=/\bthis\b/)&&F.test(h)&&F,$=" \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",q=RegExp("^["+$+"]*0+(?=.$)"),D=/($^)/,R=/[&<>"']/g,T=/['\n\r\t\u2028\u2029\\]/g,W="Array Boolean Date Error Function Math Number Object RegExp String _ attachEvent clearTimeout isFinite isNaN parseInt setImmediate setTimeout".split(" "),L="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),G="[object Arguments]",H="[object Array]",J="[object Boolean]",K="[object Date]",M="[object Error]",U="[object Function]",V="[object Number]",Q="[object Object]",X="[object RegExp]",Y="[object String]",Z={};
Z[U]=b,Z[G]=Z[H]=Z[J]=Z[K]=Z[V]=Z[Q]=Z[X]=Z[Y]=y;var nt={"boolean":b,"function":y,object:y,number:b,string:b,undefined:b},tt={"\\":"\\","'":"'","\n":"n","\r":"r","\t":"t","\u2028":"u2028","\u2029":"u2029"},rt=nt[typeof exports]&&exports,et=nt[typeof module]&&module&&module.exports==rt&&module,ut=nt[typeof global]&&global;!ut||ut.global!==ut&&ut.window!==ut||(n=ut);var at=h();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(n._=at, define(function(){return at})):rt&&!rt.nodeType?et?(et.exports=at)._=at:rt._=at:n._=at
}(this);

1032
dist/lodash.js vendored

File diff suppressed because it is too large Load Diff

82
dist/lodash.min.js vendored
View File

@@ -1,44 +1,48 @@
/**
* @license
* Lo-Dash 1.2.1 (Custom Build) lodash.com/license
* Lo-Dash 1.3.0 (Custom Build) lodash.com/license
* Build: `lodash modern -o ./dist/lodash.js`
* Underscore.js 1.4.4 underscorejs.org/LICENSE
*/
;(function(n){function t(o){function f(n){if(!n||ue.call(n)!=A)return a;var t=n.valueOf,e=typeof t=="function"&&(e=Zt(t))&&Zt(e);return e?n==e||Zt(n)==e:Y(n)}function D(n,t,e){if(!n||!R[typeof n])return n;t=t&&typeof e=="undefined"?t:U.createCallback(t,e);for(var r=-1,u=R[typeof n]?be(n):[],o=u.length;++r<o&&(e=u[r],!(t(n[e],e,n)===a)););return n}function z(n,t,e){var r;if(!n||!R[typeof n])return n;t=t&&typeof e=="undefined"?t:U.createCallback(t,e);for(r in n)if(t(n[r],r,n)===a)break;return n}function P(n,t,e){var r,u=n,a=u;
if(!u)return a;for(var o=arguments,i=0,f=typeof e=="number"?2:o.length;++i<f;)if((u=o[i])&&R[typeof u]){var c=u.length;if(r=-1,me(u))for(;++r<c;)"undefined"==typeof a[r]&&(a[r]=u[r]);else for(var l=-1,p=R[typeof u]?be(u):[],c=p.length;++l<c;)r=p[l],"undefined"==typeof a[r]&&(a[r]=u[r])}return a}function K(n,t,e){var r,u=n,a=u;if(!u)return a;var o=arguments,i=0,f=typeof e=="number"?2:o.length;if(3<f&&"function"==typeof o[f-2])var c=U.createCallback(o[--f-1],o[f--],2);else 2<f&&"function"==typeof o[f-1]&&(c=o[--f]);
for(;++i<f;)if((u=o[i])&&R[typeof u]){var l=u.length;if(r=-1,me(u))for(;++r<l;)a[r]=c?c(a[r],u[r]):u[r];else for(var p=-1,s=R[typeof u]?be(u):[],l=s.length;++p<l;)r=s[p],a[r]=c?c(a[r],u[r]):u[r]}return a}function M(n){var t,e=[];if(!n||!R[typeof n])return e;for(t in n)ne.call(n,t)&&e.push(t);return e}function U(n){return n&&typeof n=="object"&&!me(n)&&ne.call(n,"__wrapped__")?n:new W(n)}function V(n){var t=n.length,e=t>=s;if(e)for(var r={},u=-1;++u<t;){var a=p+n[u];(r[a]||(r[a]=[])).push(n[u])}return function(t){if(e){var u=p+t;
return r[u]&&-1<xt(r[u],t)}return-1<xt(n,t)}}function G(n){return n.charCodeAt(0)}function H(n,t){var e=n.b,r=t.b;if(n=n.a,t=t.a,n!==t){if(n>t||typeof n=="undefined")return 1;if(n<t||typeof t=="undefined")return-1}return e<r?-1:1}function J(n,t,e,r){function a(){var r=arguments,l=i?this:t;return o||(n=t[f]),e.length&&(r=r.length?(r=ge.call(r),c?r.concat(e):e.concat(r)):e),this instanceof a?(X.prototype=n.prototype,l=new X,X.prototype=u,r=n.apply(l,r),ot(r)?r:l):n.apply(l,r)}var o=at(n),i=!e,f=t;if(i){var c=r;
e=t}else if(!o){if(!r)throw new Vt;t=n}return a}function L(n){return"\\"+T[n]}function Q(n){return de[n]}function W(n){this.__wrapped__=n}function X(){}function Y(n){var t=a;if(!n||ue.call(n)!=A)return t;var e=n.constructor;return(at(e)?e instanceof e:1)?(z(n,function(n,e){t=e}),t===a||ne.call(n,t)):t}function Z(n,t,e){t||(t=0),typeof e=="undefined"&&(e=n?n.length:0);var r=-1;e=e-t||0;for(var u=Rt(0>e?0:e);++r<e;)u[r]=n[t+r];return u}function nt(n){return _e[n]}function tt(n,t,r,u,o,i){var f=n;if(typeof t=="function"&&(u=r,r=t,t=a),typeof r=="function"){if(r=typeof u=="undefined"?r:U.createCallback(r,u,1),f=r(f),typeof f!="undefined")return f;
f=n}if(u=ot(f)){var c=ue.call(f);if(!F[c])return f;var l=me(f)}if(!u||!t)return u?l?Z(f):K({},f):f;switch(u=ye[c],c){case I:case N:return new u(+f);case S:case B:return new u(f);case $:return u(f.source,b.exec(f))}for(o||(o=[]),i||(i=[]),c=o.length;c--;)if(o[c]==n)return i[c];return f=l?u(f.length):{},l&&(ne.call(n,"index")&&(f.index=n.index),ne.call(n,"input")&&(f.input=n.input)),o.push(n),i.push(f),(l?yt:D)(n,function(n,u){f[u]=tt(n,t,r,e,o,i)}),f}function et(n){var t=[];return z(n,function(n,e){at(n)&&t.push(e)
}),t.sort()}function rt(n){for(var t=-1,e=be(n),r=e.length,u={};++t<r;){var a=e[t];u[n[a]]=a}return u}function ut(n,t,e,o,i,f){var c=e===l;if(typeof e=="function"&&!c){e=U.createCallback(e,o,2);var p=e(n,t);if(typeof p!="undefined")return!!p}if(n===t)return 0!==n||1/n==1/t;var s=typeof n,v=typeof t;if(n===n&&(!n||"function"!=s&&"object"!=s)&&(!t||"function"!=v&&"object"!=v))return a;if(n==u||t==u)return n===t;if(v=ue.call(n),s=ue.call(t),v==O&&(v=A),s==O&&(s=A),v!=s)return a;switch(v){case I:case N:return+n==+t;
case S:return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;case $:case B:return n==Ut(t)}if(s=v==E,!s){if(ne.call(n,"__wrapped__")||ne.call(t,"__wrapped__"))return ut(n.__wrapped__||n,t.__wrapped__||t,e,o,i,f);if(v!=A)return a;var v=n.constructor,g=t.constructor;if(v!=g&&(!at(v)||!(v instanceof v&&at(g)&&g instanceof g)))return a}for(i||(i=[]),f||(f=[]),v=i.length;v--;)if(i[v]==n)return f[v]==t;var y=0,p=r;if(i.push(n),f.push(t),s){if(v=n.length,y=t.length,p=y==n.length,!p&&!c)return p;for(;y--;)if(s=v,g=t[y],c)for(;s--&&!(p=ut(n[s],g,e,o,i,f)););else if(!(p=ut(n[y],g,e,o,i,f)))break;
return p}return z(t,function(t,r,u){return ne.call(u,r)?(y++,p=ne.call(n,r)&&ut(n[r],t,e,o,i,f)):void 0}),p&&!c&&z(n,function(n,t,e){return ne.call(e,t)?p=-1<--y:void 0}),p}function at(n){return typeof n=="function"}function ot(n){return n?R[typeof n]:a}function it(n){return typeof n=="number"||ue.call(n)==S}function ft(n){return typeof n=="string"||ue.call(n)==B}function ct(n,t,e){var r=arguments,u=0,a=2;if(!ot(n))return n;if(e===l)var o=r[3],i=r[4],c=r[5];else i=[],c=[],typeof e!="number"&&(a=r.length),3<a&&"function"==typeof r[a-2]?o=U.createCallback(r[--a-1],r[a--],2):2<a&&"function"==typeof r[a-1]&&(o=r[--a]);
for(;++u<a;)(me(r[u])?yt:D)(r[u],function(t,e){var r,u,a=t,p=n[e];if(t&&((u=me(t))||f(t))){for(a=i.length;a--;)if(r=i[a]==t){p=c[a];break}if(!r){var s;o&&(a=o(p,t),s=typeof a!="undefined")&&(p=a),s||(p=u?me(p)?p:[]:f(p)?p:{}),i.push(t),c.push(p),s||(p=ct(p,t,l,o,i,c))}}else o&&(a=o(p,t),typeof a=="undefined"&&(a=t)),typeof a!="undefined"&&(p=a);n[e]=p});return n}function lt(n){for(var t=-1,e=be(n),r=e.length,u=Rt(r);++t<r;)u[t]=n[e[t]];return u}function pt(n,t,e){var r=-1,u=n?n.length:0,o=a;return e=(0>e?le(0,u+e):e)||0,typeof u=="number"?o=-1<(ft(n)?n.indexOf(t,e):xt(n,t,e)):D(n,function(n){return++r<e?void 0:!(o=n===t)
}),o}function st(n,t,e){var u=r;t=U.createCallback(t,e),e=-1;var a=n?n.length:0;if(typeof a=="number")for(;++e<a&&(u=!!t(n[e],e,n)););else D(n,function(n,e,r){return u=!!t(n,e,r)});return u}function vt(n,t,e){var r=[];t=U.createCallback(t,e),e=-1;var u=n?n.length:0;if(typeof u=="number")for(;++e<u;){var a=n[e];t(a,e,n)&&r.push(a)}else D(n,function(n,e,u){t(n,e,u)&&r.push(n)});return r}function gt(n,t,e){t=U.createCallback(t,e),e=-1;var r=n?n.length:0;if(typeof r!="number"){var u;return D(n,function(n,e,r){return t(n,e,r)?(u=n,a):void 0
}),u}for(;++e<r;){var o=n[e];if(t(o,e,n))return o}}function yt(n,t,e){var r=-1,u=n?n.length:0;if(t=t&&typeof e=="undefined"?t:U.createCallback(t,e),typeof u=="number")for(;++r<u&&t(n[r],r,n)!==a;);else D(n,t);return n}function ht(n,t,e){var r=-1,u=n?n.length:0;if(t=U.createCallback(t,e),typeof u=="number")for(var a=Rt(u);++r<u;)a[r]=t(n[r],r,n);else a=[],D(n,function(n,e,u){a[++r]=t(n,e,u)});return a}function mt(n,t,e){var r=-1/0,u=r;if(!t&&me(n)){e=-1;for(var a=n.length;++e<a;){var o=n[e];o>u&&(u=o)
}}else t=!t&&ft(n)?G:U.createCallback(t,e),yt(n,function(n,e,a){e=t(n,e,a),e>r&&(r=e,u=n)});return u}function bt(n,t){var e=-1,r=n?n.length:0;if(typeof r=="number")for(var u=Rt(r);++e<r;)u[e]=n[e][t];return u||ht(n,t)}function dt(n,t,e,r){if(!n)return e;var u=3>arguments.length;t=U.createCallback(t,r,4);var o=-1,i=n.length;if(typeof i=="number")for(u&&(e=n[++o]);++o<i;)e=t(e,n[o],o,n);else D(n,function(n,r,o){e=u?(u=a,n):t(e,n,r,o)});return e}function _t(n,t,e,r){var u=n?n.length:0,o=3>arguments.length;
if(typeof u!="number")var i=be(n),u=i.length;return t=U.createCallback(t,r,4),yt(n,function(r,f,c){f=i?i[--u]:--u,e=o?(o=a,n[f]):t(e,n[f],f,c)}),e}function kt(n,t,e){var r;t=U.createCallback(t,e),e=-1;var u=n?n.length:0;if(typeof u=="number")for(;++e<u&&!(r=t(n[e],e,n)););else D(n,function(n,e,u){return!(r=t(n,e,u))});return!!r}function wt(n){for(var t=-1,e=n?n.length:0,r=Xt.apply(Gt,ge.call(arguments,1)),r=V(r),u=[];++t<e;){var a=n[t];r(a)||u.push(a)}return u}function jt(n,t,e){if(n){var r=0,a=n.length;
if(typeof t!="number"&&t!=u){var o=-1;for(t=U.createCallback(t,e);++o<a&&t(n[o],o,n);)r++}else if(r=t,r==u||e)return n[0];return Z(n,0,pe(le(0,r),a))}}function Ct(n,t,e,r){var o=-1,i=n?n.length:0,f=[];for(typeof t!="boolean"&&t!=u&&(r=e,e=t,t=a),e!=u&&(e=U.createCallback(e,r));++o<i;)r=n[o],e&&(r=e(r,o,n)),me(r)?te.apply(f,t?r:Ct(r)):f.push(r);return f}function xt(n,t,e){var r=-1,u=n?n.length:0;if(typeof e=="number")r=(0>e?le(0,u+e):e||0)-1;else if(e)return r=Et(n,t),n[r]===t?r:-1;for(;++r<u;)if(n[r]===t)return r;
return-1}function Ot(n,t,e){if(typeof t!="number"&&t!=u){var r=0,a=-1,o=n?n.length:0;for(t=U.createCallback(t,e);++a<o&&t(n[a],a,n);)r++}else r=t==u||e?1:le(0,t);return Z(n,r)}function Et(n,t,e,r){var u=0,a=n?n.length:u;for(e=e?U.createCallback(e,r,1):$t,t=e(t);u<a;)r=u+a>>>1,e(n[r])<t?u=r+1:a=r;return u}function It(n,t,e,r){var o=-1,i=n?n.length:0,f=[],c=f;typeof t!="boolean"&&t!=u&&(r=e,e=t,t=a);var l=!t&&i>=s;if(l)var v={};for(e!=u&&(c=[],e=U.createCallback(e,r));++o<i;){r=n[o];var g=e?e(r,o,n):r;
if(l)var y=p+g,y=v[y]?!(c=v[y]):c=v[y]=[];(t?!o||c[c.length-1]!==g:y||0>xt(c,g))&&((e||l)&&c.push(g),f.push(r))}return f}function Nt(n,t){for(var e=-1,r=n?n.length:0,u={};++e<r;){var a=n[e];t?u[a]=t[e]:u[a[0]]=a[1]}return u}function St(n,t){return he.fastBind||ae&&2<arguments.length?ae.call.apply(ae,arguments):J(n,t,ge.call(arguments,2))}function At(n){var t=ge.call(arguments,1);return re(function(){n.apply(e,t)},1)}function $t(n){return n}function Bt(n){yt(et(n),function(t){var e=U[t]=n[t];U.prototype[t]=function(){var n=this.__wrapped__,t=[n];
return te.apply(t,arguments),t=e.apply(U,t),n&&typeof n=="object"&&n==t?this:new W(t)}})}function Ft(){return this.__wrapped__}o=o?q.defaults(n.Object(),o,q.pick(n,x)):n;var Rt=o.Array,Tt=o.Boolean,qt=o.Date,Dt=o.Function,zt=o.Math,Pt=o.Number,Kt=o.Object,Mt=o.RegExp,Ut=o.String,Vt=o.TypeError,Gt=Rt(),Ht=Kt(),Jt=o._,Lt=Mt("^"+Ut(Ht.valueOf).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),Qt=zt.ceil,Wt=o.clearTimeout,Xt=Gt.concat,Yt=zt.floor,Zt=Lt.test(Zt=Kt.getPrototypeOf)&&Zt,ne=Ht.hasOwnProperty,te=Gt.push,ee=o.setImmediate,re=o.setTimeout,ue=Ht.toString,ae=Lt.test(ae=ue.bind)&&ae,oe=Lt.test(oe=Rt.isArray)&&oe,ie=o.isFinite,fe=o.isNaN,ce=Lt.test(ce=Kt.keys)&&ce,le=zt.max,pe=zt.min,se=o.parseInt,ve=zt.random,ge=Gt.slice,zt=Lt.test(o.attachEvent),zt=ae&&!/\n|true/.test(ae+zt),ye={};
ye[E]=Rt,ye[I]=Tt,ye[N]=qt,ye[A]=Kt,ye[S]=Pt,ye[$]=Mt,ye[B]=Ut;var he=U.support={};he.fastBind=ae&&!zt,U.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:d,variable:"",imports:{_:U}},W.prototype=U.prototype;var me=oe,be=ce?function(n){return ot(n)?ce(n):[]}:M,de={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},_e=rt(de);return zt&&i&&typeof ee=="function"&&(At=St(ee,o)),Tt=8==se(_+"08")?se:function(n,t){return se(ft(n)?n.replace(k,""):n,t||0)},U.after=function(n,t){return 1>n?t():function(){return 1>--n?t.apply(this,arguments):void 0
}},U.assign=K,U.at=function(n){for(var t=-1,e=Xt.apply(Gt,ge.call(arguments,1)),r=e.length,u=Rt(r);++t<r;)u[t]=n[e[t]];return u},U.bind=St,U.bindAll=function(n){for(var t=1<arguments.length?Xt.apply(Gt,ge.call(arguments,1)):et(n),e=-1,r=t.length;++e<r;){var u=t[e];n[u]=St(n[u],n)}return n},U.bindKey=function(n,t){return J(n,t,ge.call(arguments,2),l)},U.compact=function(n){for(var t=-1,e=n?n.length:0,r=[];++t<e;){var u=n[t];u&&r.push(u)}return r},U.compose=function(){var n=arguments;return function(){for(var t=arguments,e=n.length;e--;)t=[n[e].apply(this,t)];
return t[0]}},U.countBy=function(n,t,e){var r={};return t=U.createCallback(t,e),yt(n,function(n,e,u){e=Ut(t(n,e,u)),ne.call(r,e)?r[e]++:r[e]=1}),r},U.createCallback=function(n,t,e){if(n==u)return $t;var r=typeof n;if("function"!=r){if("object"!=r)return function(t){return t[n]};var o=be(n);return function(t){for(var e=o.length,r=a;e--&&(r=ut(t[o[e]],n[o[e]],l)););return r}}return typeof t!="undefined"?1===e?function(e){return n.call(t,e)}:2===e?function(e,r){return n.call(t,e,r)}:4===e?function(e,r,u,a){return n.call(t,e,r,u,a)
}:function(e,r,u){return n.call(t,e,r,u)}:n},U.debounce=function(n,t,e){function o(){f=p=u,s&&(c=n.apply(l,i))}var i,f,c,l,p,s=r;if(e===r)var v=r,s=a;else e&&R[typeof e]&&(v=e.leading,s="trailing"in e?e.trailing:s);return function(){return i=arguments,l=this,Wt(p),!f&&v?(f=r,c=n.apply(l,i)):p=re(o,t),c}},U.defaults=P,U.defer=At,U.delay=function(n,t){var r=ge.call(arguments,2);return re(function(){n.apply(e,r)},t)},U.difference=wt,U.filter=vt,U.flatten=Ct,U.forEach=yt,U.forIn=z,U.forOwn=D,U.functions=et,U.groupBy=function(n,t,e){var r={};
return t=U.createCallback(t,e),yt(n,function(n,e,u){e=Ut(t(n,e,u)),(ne.call(r,e)?r[e]:r[e]=[]).push(n)}),r},U.initial=function(n,t,e){if(!n)return[];var r=0,a=n.length;if(typeof t!="number"&&t!=u){var o=a;for(t=U.createCallback(t,e);o--&&t(n[o],o,n);)r++}else r=t==u||e?1:t||r;return Z(n,0,pe(le(0,a-r),a))},U.intersection=function(n){var t=arguments,e=t.length,r={0:{}},u=-1,a=n?n.length:0,o=a>=s,i=[],f=i;n:for(;++u<a;){var c=n[u];if(o)var l=p+c,l=r[0][l]?!(f=r[0][l]):f=r[0][l]=[];if(l||0>xt(f,c)){o&&f.push(c);
for(var v=e;--v;)if(!(r[v]||(r[v]=V(t[v])))(c))continue n;i.push(c)}}return i},U.invert=rt,U.invoke=function(n,t){var e=ge.call(arguments,2),r=-1,u=typeof t=="function",a=n?n.length:0,o=Rt(typeof a=="number"?a:0);return yt(n,function(n){o[++r]=(u?t:n[t]).apply(n,e)}),o},U.keys=be,U.map=ht,U.max=mt,U.memoize=function(n,t){var e={};return function(){var r=p+(t?t.apply(this,arguments):arguments[0]);return ne.call(e,r)?e[r]:e[r]=n.apply(this,arguments)}},U.merge=ct,U.min=function(n,t,e){var r=1/0,u=r;
if(!t&&me(n)){e=-1;for(var a=n.length;++e<a;){var o=n[e];o<u&&(u=o)}}else t=!t&&ft(n)?G:U.createCallback(t,e),yt(n,function(n,e,a){e=t(n,e,a),e<r&&(r=e,u=n)});return u},U.omit=function(n,t,e){var r=typeof t=="function",u={};if(r)t=U.createCallback(t,e);else var a=Xt.apply(Gt,ge.call(arguments,1));return z(n,function(n,e,o){(r?!t(n,e,o):0>xt(a,e))&&(u[e]=n)}),u},U.once=function(n){var t,e;return function(){return t?e:(t=r,e=n.apply(this,arguments),n=u,e)}},U.pairs=function(n){for(var t=-1,e=be(n),r=e.length,u=Rt(r);++t<r;){var a=e[t];
u[t]=[a,n[a]]}return u},U.partial=function(n){return J(n,ge.call(arguments,1))},U.partialRight=function(n){return J(n,ge.call(arguments,1),u,l)},U.pick=function(n,t,e){var r={};if(typeof t!="function")for(var u=-1,a=Xt.apply(Gt,ge.call(arguments,1)),o=ot(n)?a.length:0;++u<o;){var i=a[u];i in n&&(r[i]=n[i])}else t=U.createCallback(t,e),z(n,function(n,e,u){t(n,e,u)&&(r[e]=n)});return r},U.pluck=bt,U.range=function(n,t,e){n=+n||0,e=+e||1,t==u&&(t=n,n=0);var r=-1;t=le(0,Qt((t-n)/e));for(var a=Rt(t);++r<t;)a[r]=n,n+=e;
return a},U.reject=function(n,t,e){return t=U.createCallback(t,e),vt(n,function(n,e,r){return!t(n,e,r)})},U.rest=Ot,U.shuffle=function(n){var t=-1,e=n?n.length:0,r=Rt(typeof e=="number"?e:0);return yt(n,function(n){var e=Yt(ve()*(++t+1));r[t]=r[e],r[e]=n}),r},U.sortBy=function(n,t,e){var r=-1,u=n?n.length:0,a=Rt(typeof u=="number"?u:0);for(t=U.createCallback(t,e),yt(n,function(n,e,u){a[++r]={a:t(n,e,u),b:r,c:n}}),u=a.length,a.sort(H);u--;)a[u]=a[u].c;return a},U.tap=function(n,t){return t(n),n},U.throttle=function(n,t,e){function o(){l=u,v&&(p=new qt,f=n.apply(c,i))
}var i,f,c,l,p=0,s=r,v=r;return e===a?s=a:e&&R[typeof e]&&(s="leading"in e?e.leading:s,v="trailing"in e?e.trailing:v),function(){var e=new qt;!l&&!s&&(p=e);var r=t-(e-p);return i=arguments,c=this,0<r?l||(l=re(o,r)):(Wt(l),l=u,p=e,f=n.apply(c,i)),f}},U.times=function(n,t,e){n=-1<(n=+n)?n:0;var r=-1,u=Rt(n);for(t=U.createCallback(t,e,1);++r<n;)u[r]=t(r);return u},U.toArray=function(n){return n&&typeof n.length=="number"?Z(n):lt(n)},U.union=function(n){return me(n)||(arguments[0]=n?ge.call(n):Gt),It(Xt.apply(Gt,arguments))
},U.uniq=It,U.unzip=function(n){for(var t=-1,e=n?n.length:0,r=e?mt(bt(n,"length")):0,u=Rt(r);++t<e;)for(var a=-1,o=n[t];++a<r;)(u[a]||(u[a]=Rt(e)))[t]=o[a];return u},U.values=lt,U.where=vt,U.without=function(n){return wt(n,ge.call(arguments,1))},U.wrap=function(n,t){return function(){var e=[n];return te.apply(e,arguments),t.apply(this,e)}},U.zip=function(n){for(var t=-1,e=n?mt(bt(arguments,"length")):0,r=Rt(e);++t<e;)r[t]=bt(arguments,t);return r},U.zipObject=Nt,U.collect=ht,U.drop=Ot,U.each=yt,U.extend=K,U.methods=et,U.object=Nt,U.select=vt,U.tail=Ot,U.unique=It,Bt(U),U.clone=tt,U.cloneDeep=function(n,t,e){return tt(n,r,t,e)
},U.contains=pt,U.escape=function(n){return n==u?"":Ut(n).replace(j,Q)},U.every=st,U.find=gt,U.findIndex=function(n,t,e){var r=-1,u=n?n.length:0;for(t=U.createCallback(t,e);++r<u;)if(t(n[r],r,n))return r;return-1},U.findKey=function(n,t,e){var r;return t=U.createCallback(t,e),D(n,function(n,e,u){return t(n,e,u)?(r=e,a):void 0}),r},U.has=function(n,t){return n?ne.call(n,t):a},U.identity=$t,U.indexOf=xt,U.isArguments=function(n){return ue.call(n)==O},U.isArray=me,U.isBoolean=function(n){return n===r||n===a||ue.call(n)==I
},U.isDate=function(n){return n?typeof n=="object"&&ue.call(n)==N:a},U.isElement=function(n){return n?1===n.nodeType:a},U.isEmpty=function(n){var t=r;if(!n)return t;var e=ue.call(n),u=n.length;return e==E||e==B||e==O||e==A&&typeof u=="number"&&at(n.splice)?!u:(D(n,function(){return t=a}),t)},U.isEqual=ut,U.isFinite=function(n){return ie(n)&&!fe(parseFloat(n))},U.isFunction=at,U.isNaN=function(n){return it(n)&&n!=+n},U.isNull=function(n){return n===u},U.isNumber=it,U.isObject=ot,U.isPlainObject=f,U.isRegExp=function(n){return n?typeof n=="object"&&ue.call(n)==$:a
},U.isString=ft,U.isUndefined=function(n){return typeof n=="undefined"},U.lastIndexOf=function(n,t,e){var r=n?n.length:0;for(typeof e=="number"&&(r=(0>e?le(0,r+e):pe(e,r-1))+1);r--;)if(n[r]===t)return r;return-1},U.mixin=Bt,U.noConflict=function(){return o._=Jt,this},U.parseInt=Tt,U.random=function(n,t){return n==u&&t==u&&(t=1),n=+n||0,t==u&&(t=n,n=0),n+Yt(ve()*((+t||0)-n+1))},U.reduce=dt,U.reduceRight=_t,U.result=function(n,t){var r=n?n[t]:e;return at(r)?n[t]():r},U.runInContext=t,U.size=function(n){var t=n?n.length:0;
return typeof t=="number"?t:be(n).length},U.some=kt,U.sortedIndex=Et,U.template=function(n,t,u){var a=U.templateSettings;n||(n=""),u=P({},u,a);var o,i=P({},u.imports,a.imports),a=be(i),i=lt(i),f=0,c=u.interpolate||w,l="__p+='",c=Mt((u.escape||w).source+"|"+c.source+"|"+(c===d?m:w).source+"|"+(u.evaluate||w).source+"|$","g");n.replace(c,function(t,e,u,a,i,c){return u||(u=a),l+=n.slice(f,c).replace(C,L),e&&(l+="'+__e("+e+")+'"),i&&(o=r,l+="';"+i+";__p+='"),u&&(l+="'+((__t=("+u+"))==null?'':__t)+'"),f=c+t.length,t
}),l+="';\n",c=u=u.variable,c||(u="obj",l="with("+u+"){"+l+"}"),l=(o?l.replace(v,""):l).replace(g,"$1").replace(y,"$1;"),l="function("+u+"){"+(c?"":u+"||("+u+"={});")+"var __t,__p='',__e=_.escape"+(o?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+l+"return __p}";try{var p=Dt(a,"return "+l).apply(e,i)}catch(s){throw s.source=l,s}return t?p(t):(p.source=l,p)},U.unescape=function(n){return n==u?"":Ut(n).replace(h,nt)},U.uniqueId=function(n){var t=++c;return Ut(n==u?"":n)+t
},U.all=st,U.any=kt,U.detect=gt,U.foldl=dt,U.foldr=_t,U.include=pt,U.inject=dt,D(U,function(n,t){U.prototype[t]||(U.prototype[t]=function(){var t=[this.__wrapped__];return te.apply(t,arguments),n.apply(U,t)})}),U.first=jt,U.last=function(n,t,e){if(n){var r=0,a=n.length;if(typeof t!="number"&&t!=u){var o=a;for(t=U.createCallback(t,e);o--&&t(n[o],o,n);)r++}else if(r=t,r==u||e)return n[a-1];return Z(n,le(0,a-r))}},U.take=jt,U.head=jt,D(U,function(n,t){U.prototype[t]||(U.prototype[t]=function(t,e){var r=n(this.__wrapped__,t,e);
return t==u||e&&typeof t!="function"?r:new W(r)})}),U.VERSION="1.2.1",U.prototype.toString=function(){return Ut(this.__wrapped__)},U.prototype.value=Ft,U.prototype.valueOf=Ft,yt(["join","pop","shift"],function(n){var t=Gt[n];U.prototype[n]=function(){return t.apply(this.__wrapped__,arguments)}}),yt(["push","reverse","sort","unshift"],function(n){var t=Gt[n];U.prototype[n]=function(){return t.apply(this.__wrapped__,arguments),this}}),yt(["concat","slice","splice"],function(n){var t=Gt[n];U.prototype[n]=function(){return new W(t.apply(this.__wrapped__,arguments))
}}),U}var e,r=!0,u=null,a=!1,o=typeof exports=="object"&&exports,i=typeof module=="object"&&module&&module.exports==o&&module,f=typeof global=="object"&&global;(f.global===f||f.window===f)&&(n=f);var c=0,l={},p=+new Date+"",s=200,v=/\b__p\+='';/g,g=/\b(__p\+=)''\+/g,y=/(__e\(.*?\)|\b__t\))\+'';/g,h=/&(?:amp|lt|gt|quot|#39);/g,m=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,b=/\w*$/,d=/<%=([\s\S]+?)%>/g,_=" \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",k=RegExp("^["+_+"]*0+(?=.$)"),w=/($^)/,j=/[&<>"']/g,C=/['\n\r\t\u2028\u2029\\]/g,x="Array Boolean Date Function Math Number Object RegExp String _ attachEvent clearTimeout isFinite isNaN parseInt setImmediate setTimeout".split(" "),O="[object Arguments]",E="[object Array]",I="[object Boolean]",N="[object Date]",S="[object Number]",A="[object Object]",$="[object RegExp]",B="[object String]",F={"[object Function]":a};
F[O]=F[E]=F[I]=F[N]=F[S]=F[A]=F[$]=F[B]=r;var R={"boolean":a,"function":r,object:r,number:a,string:a,undefined:a},T={"\\":"\\","'":"'","\n":"n","\r":"r","\t":"t","\u2028":"u2028","\u2029":"u2029"},q=t();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(n._=q,define(function(){return q})):o&&!o.nodeType?i?(i.exports=q)._=q:o._=q:n._=q})(this);
;!function(n){function t(n,t,e){e=(e||0)-1;for(var r=n.length;++e<r;)if(n[e]===t)return e;return-1}function e(n,e){var r=typeof e;if(n=n.k,"boolean"==r||e==y)return n[e];"number"!=r&&"string"!=r&&(r="object");var u="number"==r?e:j+e;return n=n[r]||(n[r]={}),"object"==r?n[u]&&-1<t(n[u],e)?0:-1:n[u]?0:-1}function r(n){var t=this.k,e=typeof n;if("boolean"==e||n==y)t[n]=h;else{"number"!=e&&"string"!=e&&(e="object");var r="number"==e?n:j+n,u=t[e]||(t[e]={});"object"==e?(u[r]||(u[r]=[])).push(n)==this.b.length&&(t[e]=b):u[r]=h
}}function u(n){return n.charCodeAt(0)}function a(n,t){var e=n.m,r=t.m;if(n=n.l,t=t.l,n!==t){if(n>t||typeof n=="undefined")return 1;if(n<t||typeof t=="undefined")return-1}return e<r?-1:1}function o(n){var t=-1,e=n.length,u=l();u["false"]=u["null"]=u["true"]=u.undefined=b;var a=l();for(a.b=n,a.k=u,a.push=r;++t<e;)a.push(n[t]);return u.object===false?(p(a),y):a}function i(n){return"\\"+Q[n]}function f(){return m.pop()||[]}function l(){return d.pop()||{b:y,l:y,"false":b,m:0,leading:b,maxWait:0,"null":b,number:y,object:y,push:y,string:y,trailing:b,"true":b,undefined:b,n:y}
}function c(n){m.length==C&&(m.length=C-1),n.length=0,m.push(n)}function p(n){var t=n.k;t&&p(t),d.length==C&&(d.length=C-1),n.b=n.k=n.l=n.object=n.number=n.string=n.n=y,d.push(n)}function s(n,t,e){t||(t=0),typeof e=="undefined"&&(e=n?n.length:0);var r=-1;e=e-t||0;for(var u=Array(0>e?0:e);++r<e;)u[r]=n[t+r];return u}function v(r){function m(n){if(!n||ve.call(n)!=V)return b;var t=n.valueOf,e=typeof t=="function"&&(e=fe(t))&&fe(e);return e?n==e||fe(n)==e:it(n)}function d(n,t,e){if(!n||!L[typeof n])return n;
t=t&&typeof e=="undefined"?t:tt.createCallback(t,e);for(var r=-1,u=L[typeof n]&&Se(n),a=u?u.length:0;++r<a&&(e=u[r],!(t(n[e],e,n)===false)););return n}function C(n,t,e){var r;if(!n||!L[typeof n])return n;t=t&&typeof e=="undefined"?t:tt.createCallback(t,e);for(r in n)if(t(n[r],r,n)===false)break;return n}function Q(n,t,e){var r,u=n,a=u;if(!u)return a;for(var o=arguments,i=0,f=typeof e=="number"?2:o.length;++i<f;)if((u=o[i])&&L[typeof u])for(var l=-1,c=L[typeof u]&&Se(u),p=c?c.length:0;++l<p;)r=c[l],"undefined"==typeof a[r]&&(a[r]=u[r]);
return a}function X(n,t,e){var r,u=n,a=u;if(!u)return a;var o=arguments,i=0,f=typeof e=="number"?2:o.length;if(3<f&&"function"==typeof o[f-2])var l=tt.createCallback(o[--f-1],o[f--],2);else 2<f&&"function"==typeof o[f-1]&&(l=o[--f]);for(;++i<f;)if((u=o[i])&&L[typeof u])for(var c=-1,p=L[typeof u]&&Se(u),s=p?p.length:0;++c<s;)r=p[c],a[r]=l?l(a[r],u[r]):u[r];return a}function Z(n){var t,e=[];if(!n||!L[typeof n])return e;for(t in n)le.call(n,t)&&e.push(t);return e}function tt(n){return n&&typeof n=="object"&&!Ee(n)&&le.call(n,"__wrapped__")?n:new et(n)
}function et(n){this.__wrapped__=n}function rt(n,t,e,r){function u(){var r=arguments,l=o?this:t;return a||(n=t[i]),e.length&&(r=r.length?(r=Ce.call(r),f?r.concat(e):e.concat(r)):e),this instanceof u?(l=gt(n.prototype)?he(n.prototype):{},r=n.apply(l,r),gt(r)?r:l):n.apply(l,r)}var a=vt(n),o=!e,i=t;if(o){var f=r;e=t}else if(!a){if(!r)throw new Yt;t=n}return u}function ut(n){return Ie[n]}function at(){var n=(n=tt.indexOf)===$t?t:n;return n}function ot(n){return function(t,e,r,u){return typeof e!="boolean"&&e!=y&&(u=r,r=u&&u[e]===t?g:e,e=b),r!=y&&(r=tt.createCallback(r,u)),n(t,e,r,u)
}}function it(n){var t,e;return n&&ve.call(n)==V&&(t=n.constructor,!vt(t)||t instanceof t)?(C(n,function(n,t){e=t}),e===g||le.call(n,e)):b}function ft(n){return Ae[n]}function lt(n,t,e,r,u,a){var o=n;if(typeof t!="boolean"&&t!=y&&(r=e,e=t,t=b),typeof e=="function"){if(e=typeof r=="undefined"?e:tt.createCallback(e,r,1),o=e(o),typeof o!="undefined")return o;o=n}if(r=gt(o)){var i=ve.call(o);if(!J[i])return o;var l=Ee(o)}if(!r||!t)return r?l?s(o):X({},o):o;switch(r=xe[i],i){case P:case K:return new r(+o);
case U:case H:return new r(o);case G:return r(o.source,A.exec(o))}i=!u,u||(u=f()),a||(a=f());for(var p=u.length;p--;)if(u[p]==n)return a[p];return o=l?r(o.length):{},l&&(le.call(n,"index")&&(o.index=n.index),le.call(n,"input")&&(o.input=n.input)),u.push(n),a.push(o),(l?wt:d)(n,function(n,r){o[r]=lt(n,t,e,g,u,a)}),i&&(c(u),c(a)),o}function ct(n){var t=[];return C(n,function(n,e){vt(n)&&t.push(e)}),t.sort()}function pt(n){for(var t=-1,e=Se(n),r=e.length,u={};++t<r;){var a=e[t];u[n[a]]=a}return u}function st(n,t,e,r,u,a){var o=e===k;
if(typeof e=="function"&&!o){e=tt.createCallback(e,r,2);var i=e(n,t);if(typeof i!="undefined")return!!i}if(n===t)return 0!==n||1/n==1/t;var l=typeof n,p=typeof t;if(n===n&&(!n||"function"!=l&&"object"!=l)&&(!t||"function"!=p&&"object"!=p))return b;if(n==y||t==y)return n===t;if(p=ve.call(n),l=ve.call(t),p==z&&(p=V),l==z&&(l=V),p!=l)return b;switch(p){case P:case K:return+n==+t;case U:return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;case G:case H:return n==Xt(t)}if(l=p==W,!l){if(le.call(n,"__wrapped__")||le.call(t,"__wrapped__"))return st(n.__wrapped__||n,t.__wrapped__||t,e,r,u,a);
if(p!=V)return b;var p=n.constructor,s=t.constructor;if(p!=s&&(!vt(p)||!(p instanceof p&&vt(s)&&s instanceof s)))return b}for(s=!u,u||(u=f()),a||(a=f()),p=u.length;p--;)if(u[p]==n)return a[p]==t;var v=0,i=h;if(u.push(n),a.push(t),l){if(p=n.length,v=t.length,i=v==n.length,!i&&!o)return i;for(;v--;)if(l=p,s=t[v],o)for(;l--&&!(i=st(n[l],s,e,r,u,a)););else if(!(i=st(n[v],s,e,r,u,a)))break;return i}return C(t,function(t,o,f){return le.call(f,o)?(v++,i=le.call(n,o)&&st(n[o],t,e,r,u,a)):void 0}),i&&!o&&C(n,function(n,t,e){return le.call(e,t)?i=-1<--v:void 0
}),s&&(c(u),c(a)),i}function vt(n){return typeof n=="function"}function gt(n){return!(!n||!L[typeof n])}function ht(n){return typeof n=="number"||ve.call(n)==U}function yt(n){return typeof n=="string"||ve.call(n)==H}function bt(n,t,e){var r=arguments,u=0,a=2;if(!gt(n))return n;if(e===k)var o=r[3],i=r[4],l=r[5];else{var p=h,i=f(),l=f();typeof e!="number"&&(a=r.length),3<a&&"function"==typeof r[a-2]?o=tt.createCallback(r[--a-1],r[a--],2):2<a&&"function"==typeof r[a-1]&&(o=r[--a])}for(;++u<a;)(Ee(r[u])?wt:d)(r[u],function(t,e){var r,u,a=t,f=n[e];
if(t&&((u=Ee(t))||m(t))){for(a=i.length;a--;)if(r=i[a]==t){f=l[a];break}if(!r){var c;o&&(a=o(f,t),c=typeof a!="undefined")&&(f=a),c||(f=u?Ee(f)?f:[]:m(f)?f:{}),i.push(t),l.push(f),c||(f=bt(f,t,k,o,i,l))}}else o&&(a=o(f,t),typeof a=="undefined"&&(a=t)),typeof a!="undefined"&&(f=a);n[e]=f});return p&&(c(i),c(l)),n}function mt(n){for(var t=-1,e=Se(n),r=e.length,u=Mt(r);++t<r;)u[t]=n[e[t]];return u}function dt(n,t,e){var r=-1,u=at(),a=n?n.length:0,o=b;return e=(0>e?_e(0,a+e):e)||0,a&&typeof a=="number"?o=-1<(yt(n)?n.indexOf(t,e):u(n,t,e)):d(n,function(n){return++r<e?void 0:!(o=n===t)
}),o}function _t(n,t,e){var r=h;t=tt.createCallback(t,e),e=-1;var u=n?n.length:0;if(typeof u=="number")for(;++e<u&&(r=!!t(n[e],e,n)););else d(n,function(n,e,u){return r=!!t(n,e,u)});return r}function kt(n,t,e){var r=[];t=tt.createCallback(t,e),e=-1;var u=n?n.length:0;if(typeof u=="number")for(;++e<u;){var a=n[e];t(a,e,n)&&r.push(a)}else d(n,function(n,e,u){t(n,e,u)&&r.push(n)});return r}function jt(n,t,e){t=tt.createCallback(t,e),e=-1;var r=n?n.length:0;if(typeof r!="number"){var u;return d(n,function(n,e,r){return t(n,e,r)?(u=n,b):void 0
}),u}for(;++e<r;){var a=n[e];if(t(a,e,n))return a}}function wt(n,t,e){var r=-1,u=n?n.length:0;if(t=t&&typeof e=="undefined"?t:tt.createCallback(t,e),typeof u=="number")for(;++r<u&&t(n[r],r,n)!==false;);else d(n,t);return n}function Ct(n,t,e){var r=-1,u=n?n.length:0;if(t=tt.createCallback(t,e),typeof u=="number")for(var a=Mt(u);++r<u;)a[r]=t(n[r],r,n);else a=[],d(n,function(n,e,u){a[++r]=t(n,e,u)});return a}function xt(n,t,e){var r=-1/0,a=r;if(!t&&Ee(n)){e=-1;for(var o=n.length;++e<o;){var i=n[e];i>a&&(a=i)
}}else t=!t&&yt(n)?u:tt.createCallback(t,e),wt(n,function(n,e,u){e=t(n,e,u),e>r&&(r=e,a=n)});return a}function Ot(n,t){var e=-1,r=n?n.length:0;if(typeof r=="number")for(var u=Mt(r);++e<r;)u[e]=n[e][t];return u||Ct(n,t)}function Et(n,t,e,r){if(!n)return e;var u=3>arguments.length;t=tt.createCallback(t,r,4);var a=-1,o=n.length;if(typeof o=="number")for(u&&(e=n[++a]);++a<o;)e=t(e,n[a],a,n);else d(n,function(n,r,a){e=u?(u=b,n):t(e,n,r,a)});return e}function St(n,t,e,r){var u=n?n.length:0,a=3>arguments.length;
if(typeof u!="number")var o=Se(n),u=o.length;return t=tt.createCallback(t,r,4),wt(n,function(r,i,f){i=o?o[--u]:--u,e=a?(a=b,n[i]):t(e,n[i],i,f)}),e}function It(n,t,e){var r;t=tt.createCallback(t,e),e=-1;var u=n?n.length:0;if(typeof u=="number")for(;++e<u&&!(r=t(n[e],e,n)););else d(n,function(n,e,u){return!(r=t(n,e,u))});return!!r}function At(n){var r=-1,u=at(),a=n?n.length:0,i=ae.apply(Zt,Ce.call(arguments,1)),f=[],l=a>=w&&u===t;if(l){var c=o(i);c?(u=e,i=c):l=b}for(;++r<a;)c=n[r],0>u(i,c)&&f.push(c);
return l&&p(i),f}function Nt(n,t,e){if(n){var r=0,u=n.length;if(typeof t!="number"&&t!=y){var a=-1;for(t=tt.createCallback(t,e);++a<u&&t(n[a],a,n);)r++}else if(r=t,r==y||e)return n[0];return s(n,0,ke(_e(0,r),u))}}function $t(n,e,r){if(typeof r=="number"){var u=n?n.length:0;r=0>r?_e(0,u+r):r||0}else if(r)return r=Ft(n,e),n[r]===e?r:-1;return n?t(n,e,r):-1}function Bt(n,t,e){if(typeof t!="number"&&t!=y){var r=0,u=-1,a=n?n.length:0;for(t=tt.createCallback(t,e);++u<a&&t(n[u],u,n);)r++}else r=t==y||e?1:_e(0,t);
return s(n,r)}function Ft(n,t,e,r){var u=0,a=n?n.length:u;for(e=e?tt.createCallback(e,r,1):Wt,t=e(t);u<a;)r=u+a>>>1,e(n[r])<t?u=r+1:a=r;return u}function Rt(n){for(var t=-1,e=n?xt(Ot(n,"length")):0,r=Mt(0>e?0:e);++t<e;)r[t]=Ot(n,t);return r}function Tt(n,t){for(var e=-1,r=n?n.length:0,u={};++e<r;){var a=n[e];t?u[a]=t[e]:u[a[0]]=a[1]}return u}function qt(n,t){return Oe.fastBind||ge&&2<arguments.length?ge.call.apply(ge,arguments):rt(n,t,Ce.call(arguments,2))}function Dt(n,t,e){function r(){ue(s),ue(v),l=0,s=v=y
}function u(){var t=g&&(!m||1<l);r(),t&&(p!==false&&(c=new Vt),i=n.apply(f,o))}function a(){r(),(g||p!==t)&&(c=new Vt,i=n.apply(f,o))}var o,i,f,l=0,c=0,p=b,s=y,v=y,g=h;if(t=_e(0,t||0),e===h)var m=h,g=b;else gt(e)&&(m=e.leading,p="maxWait"in e&&_e(t,e.maxWait||0),g="trailing"in e?e.trailing:g);return function(){if(o=arguments,f=this,l++,ue(v),p===false)m&&2>l&&(i=n.apply(f,o));else{var e=new Vt;!s&&!m&&(c=e);var r=p-(e-c);0<r?s||(s=se(a,r)):(ue(s),s=y,c=e,i=n.apply(f,o))}return t!==p&&(v=se(u,t)),i}}function zt(n){var t=Ce.call(arguments,1);
return se(function(){n.apply(g,t)},1)}function Wt(n){return n}function Pt(n){wt(ct(n),function(t){var e=tt[t]=n[t];tt.prototype[t]=function(){var n=this.__wrapped__,t=[n];return ce.apply(t,arguments),t=e.apply(tt,t),n&&typeof n=="object"&&n===t?this:new et(t)}})}function Kt(){return this.__wrapped__}r=r?nt.defaults(n.Object(),r,nt.pick(n,D)):n;var Mt=r.Array,Ut=r.Boolean,Vt=r.Date,Gt=r.Function,Ht=r.Math,Jt=r.Number,Lt=r.Object,Qt=r.RegExp,Xt=r.String,Yt=r.TypeError,Zt=[],ne=Lt.prototype,te=r._,ee=Qt("^"+Xt(ne.valueOf).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),re=Ht.ceil,ue=r.clearTimeout,ae=Zt.concat,oe=Ht.floor,ie=Gt.prototype.toString,fe=ee.test(fe=Lt.getPrototypeOf)&&fe,le=ne.hasOwnProperty,ce=Zt.push,pe=r.setImmediate,se=r.setTimeout,ve=ne.toString,ge=ee.test(ge=ve.bind)&&ge,he=ee.test(he=Lt.create)&&he,ye=ee.test(ye=Mt.isArray)&&ye,be=r.isFinite,me=r.isNaN,de=ee.test(de=Lt.keys)&&de,_e=Ht.max,ke=Ht.min,je=r.parseInt,we=Ht.random,Ce=Zt.slice,Ht=ee.test(r.attachEvent),Ht=ge&&!/\n|true/.test(ge+Ht),xe={};
xe[W]=Mt,xe[P]=Ut,xe[K]=Vt,xe[M]=Gt,xe[V]=Lt,xe[U]=Jt,xe[G]=Qt,xe[H]=Xt,et.prototype=tt.prototype;var Oe=tt.support={};Oe.fastBind=ge&&!Ht,tt.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:N,variable:"",imports:{_:tt}};var Ee=ye,Se=de?function(n){return gt(n)?de(n):[]}:Z,Ie={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Ae=pt(Ie),Ut=ot(function $e(n,t,e){for(var r=-1,u=n?n.length:0,a=[];++r<u;){var o=n[r];e&&(o=e(o,r,n)),Ee(o)?ce.apply(a,t?o:$e(o)):a.push(o)
}return a}),Ne=ot(function(n,r,u){var a=-1,i=at(),l=n?n.length:0,s=[],v=!r&&l>=w&&i===t,g=u||v?f():s;if(v){var h=o(g);h?(i=e,g=h):(v=b,g=u?g:(c(g),s))}for(;++a<l;){var h=n[a],y=u?u(h,a,n):h;(r?!a||g[g.length-1]!==y:0>i(g,y))&&((u||v)&&g.push(y),s.push(h))}return v?(c(g.b),p(g)):u&&c(g),s});return Ht&&Y&&typeof pe=="function"&&(zt=qt(pe,r)),pe=8==je(B+"08")?je:function(n,t){return je(yt(n)?n.replace(F,""):n,t||0)},tt.after=function(n,t){return 1>n?t():function(){return 1>--n?t.apply(this,arguments):void 0
}},tt.assign=X,tt.at=function(n){for(var t=-1,e=ae.apply(Zt,Ce.call(arguments,1)),r=e.length,u=Mt(r);++t<r;)u[t]=n[e[t]];return u},tt.bind=qt,tt.bindAll=function(n){for(var t=1<arguments.length?ae.apply(Zt,Ce.call(arguments,1)):ct(n),e=-1,r=t.length;++e<r;){var u=t[e];n[u]=qt(n[u],n)}return n},tt.bindKey=function(n,t){return rt(n,t,Ce.call(arguments,2),k)},tt.compact=function(n){for(var t=-1,e=n?n.length:0,r=[];++t<e;){var u=n[t];u&&r.push(u)}return r},tt.compose=function(){var n=arguments;return function(){for(var t=arguments,e=n.length;e--;)t=[n[e].apply(this,t)];
return t[0]}},tt.countBy=function(n,t,e){var r={};return t=tt.createCallback(t,e),wt(n,function(n,e,u){e=Xt(t(n,e,u)),le.call(r,e)?r[e]++:r[e]=1}),r},tt.createCallback=function(n,t,e){if(n==y)return Wt;var r=typeof n;if("function"!=r){if("object"!=r)return function(t){return t[n]};var u=Se(n);return function(t){for(var e=u.length,r=b;e--&&(r=st(t[u[e]],n[u[e]],k)););return r}}return typeof t=="undefined"||$&&!$.test(ie.call(n))?n:1===e?function(e){return n.call(t,e)}:2===e?function(e,r){return n.call(t,e,r)
}:4===e?function(e,r,u,a){return n.call(t,e,r,u,a)}:function(e,r,u){return n.call(t,e,r,u)}},tt.debounce=Dt,tt.defaults=Q,tt.defer=zt,tt.delay=function(n,t){var e=Ce.call(arguments,2);return se(function(){n.apply(g,e)},t)},tt.difference=At,tt.filter=kt,tt.flatten=Ut,tt.forEach=wt,tt.forIn=C,tt.forOwn=d,tt.functions=ct,tt.groupBy=function(n,t,e){var r={};return t=tt.createCallback(t,e),wt(n,function(n,e,u){e=Xt(t(n,e,u)),(le.call(r,e)?r[e]:r[e]=[]).push(n)}),r},tt.initial=function(n,t,e){if(!n)return[];
var r=0,u=n.length;if(typeof t!="number"&&t!=y){var a=u;for(t=tt.createCallback(t,e);a--&&t(n[a],a,n);)r++}else r=t==y||e?1:t||r;return s(n,0,ke(_e(0,u-r),u))},tt.intersection=function(n){for(var r=arguments,u=r.length,a=-1,i=f(),l=-1,s=at(),v=n?n.length:0,g=[],h=f();++a<u;){var y=r[a];i[a]=s===t&&(y?y.length:0)>=w&&o(a?r[a]:h)}n:for(;++l<v;){var b=i[0],y=n[l];if(0>(b?e(b,y):s(h,y))){for(a=u,(b||h).push(y);--a;)if(b=i[a],0>(b?e(b,y):s(r[a],y)))continue n;g.push(y)}}for(;u--;)(b=i[u])&&p(b);return c(i),c(h),g
},tt.invert=pt,tt.invoke=function(n,t){var e=Ce.call(arguments,2),r=-1,u=typeof t=="function",a=n?n.length:0,o=Mt(typeof a=="number"?a:0);return wt(n,function(n){o[++r]=(u?t:n[t]).apply(n,e)}),o},tt.keys=Se,tt.map=Ct,tt.max=xt,tt.memoize=function(n,t){function e(){var r=e.cache,u=j+(t?t.apply(this,arguments):arguments[0]);return le.call(r,u)?r[u]:r[u]=n.apply(this,arguments)}return e.cache={},e},tt.merge=bt,tt.min=function(n,t,e){var r=1/0,a=r;if(!t&&Ee(n)){e=-1;for(var o=n.length;++e<o;){var i=n[e];
i<a&&(a=i)}}else t=!t&&yt(n)?u:tt.createCallback(t,e),wt(n,function(n,e,u){e=t(n,e,u),e<r&&(r=e,a=n)});return a},tt.omit=function(n,t,e){var r=at(),u=typeof t=="function",a={};if(u)t=tt.createCallback(t,e);else var o=ae.apply(Zt,Ce.call(arguments,1));return C(n,function(n,e,i){(u?!t(n,e,i):0>r(o,e))&&(a[e]=n)}),a},tt.once=function(n){var t,e;return function(){return t?e:(t=h,e=n.apply(this,arguments),n=y,e)}},tt.pairs=function(n){for(var t=-1,e=Se(n),r=e.length,u=Mt(r);++t<r;){var a=e[t];u[t]=[a,n[a]]
}return u},tt.partial=function(n){return rt(n,Ce.call(arguments,1))},tt.partialRight=function(n){return rt(n,Ce.call(arguments,1),y,k)},tt.pick=function(n,t,e){var r={};if(typeof t!="function")for(var u=-1,a=ae.apply(Zt,Ce.call(arguments,1)),o=gt(n)?a.length:0;++u<o;){var i=a[u];i in n&&(r[i]=n[i])}else t=tt.createCallback(t,e),C(n,function(n,e,u){t(n,e,u)&&(r[e]=n)});return r},tt.pluck=Ot,tt.range=function(n,t,e){n=+n||0,e=+e||1,t==y&&(t=n,n=0);var r=-1;t=_e(0,re((t-n)/e));for(var u=Mt(t);++r<t;)u[r]=n,n+=e;
return u},tt.reject=function(n,t,e){return t=tt.createCallback(t,e),kt(n,function(n,e,r){return!t(n,e,r)})},tt.rest=Bt,tt.shuffle=function(n){var t=-1,e=n?n.length:0,r=Mt(typeof e=="number"?e:0);return wt(n,function(n){var e=oe(we()*(++t+1));r[t]=r[e],r[e]=n}),r},tt.sortBy=function(n,t,e){var r=-1,u=n?n.length:0,o=Mt(typeof u=="number"?u:0);for(t=tt.createCallback(t,e),wt(n,function(n,e,u){var a=o[++r]=l();a.l=t(n,e,u),a.m=r,a.n=n}),u=o.length,o.sort(a);u--;)n=o[u],o[u]=n.n,p(n);return o},tt.tap=function(n,t){return t(n),n
},tt.throttle=function(n,t,e){var r=h,u=h;return e===false?r=b:gt(e)&&(r="leading"in e?e.leading:r,u="trailing"in e?e.trailing:u),e=l(),e.leading=r,e.maxWait=t,e.trailing=u,n=Dt(n,t,e),p(e),n},tt.times=function(n,t,e){n=-1<(n=+n)?n:0;var r=-1,u=Mt(n);for(t=tt.createCallback(t,e,1);++r<n;)u[r]=t(r);return u},tt.toArray=function(n){return n&&typeof n.length=="number"?s(n):mt(n)},tt.transform=function(n,t,e,r){var u=Ee(n);return t=tt.createCallback(t,r,4),e==y&&(u?e=[]:(r=n&&n.constructor,e=gt(r&&r.prototype)?he(r&&r.prototype):{})),(u?wt:d)(n,function(n,r,u){return t(e,n,r,u)
}),e},tt.union=function(n){return Ee(n)||(arguments[0]=n?Ce.call(n):Zt),Ne(ae.apply(Zt,arguments))},tt.uniq=Ne,tt.unzip=Rt,tt.values=mt,tt.where=kt,tt.without=function(n){return At(n,Ce.call(arguments,1))},tt.wrap=function(n,t){return function(){var e=[n];return ce.apply(e,arguments),t.apply(this,e)}},tt.zip=function(n){return n?Rt(arguments):[]},tt.zipObject=Tt,tt.collect=Ct,tt.drop=Bt,tt.each=wt,tt.extend=X,tt.methods=ct,tt.object=Tt,tt.select=kt,tt.tail=Bt,tt.unique=Ne,Pt(tt),tt.chain=tt,tt.prototype.chain=function(){return this
},tt.clone=lt,tt.cloneDeep=function(n,t,e){return lt(n,h,t,e)},tt.contains=dt,tt.escape=function(n){return n==y?"":Xt(n).replace(T,ut)},tt.every=_t,tt.find=jt,tt.findIndex=function(n,t,e){var r=-1,u=n?n.length:0;for(t=tt.createCallback(t,e);++r<u;)if(t(n[r],r,n))return r;return-1},tt.findKey=function(n,t,e){var r;return t=tt.createCallback(t,e),d(n,function(n,e,u){return t(n,e,u)?(r=e,b):void 0}),r},tt.has=function(n,t){return n?le.call(n,t):b},tt.identity=Wt,tt.indexOf=$t,tt.isArguments=function(n){return ve.call(n)==z
},tt.isArray=Ee,tt.isBoolean=function(n){return n===h||n===false||ve.call(n)==P},tt.isDate=function(n){return n?typeof n=="object"&&ve.call(n)==K:b},tt.isElement=function(n){return n?1===n.nodeType:b},tt.isEmpty=function(n){var t=h;if(!n)return t;var e=ve.call(n),r=n.length;return e==W||e==H||e==z||e==V&&typeof r=="number"&&vt(n.splice)?!r:(d(n,function(){return t=b}),t)},tt.isEqual=st,tt.isFinite=function(n){return be(n)&&!me(parseFloat(n))},tt.isFunction=vt,tt.isNaN=function(n){return ht(n)&&n!=+n
},tt.isNull=function(n){return n===y},tt.isNumber=ht,tt.isObject=gt,tt.isPlainObject=m,tt.isRegExp=function(n){return n?typeof n=="object"&&ve.call(n)==G:b},tt.isString=yt,tt.isUndefined=function(n){return typeof n=="undefined"},tt.lastIndexOf=function(n,t,e){var r=n?n.length:0;for(typeof e=="number"&&(r=(0>e?_e(0,r+e):ke(e,r-1))+1);r--;)if(n[r]===t)return r;return-1},tt.mixin=Pt,tt.noConflict=function(){return r._=te,this},tt.parseInt=pe,tt.random=function(n,t){n==y&&t==y&&(t=1),n=+n||0,t==y?(t=n,n=0):t=+t||0;
var e=we();return n%1||t%1?n+ke(e*(t-n+parseFloat("1e-"+((e+"").length-1))),t):n+oe(e*(t-n+1))},tt.reduce=Et,tt.reduceRight=St,tt.result=function(n,t){var e=n?n[t]:g;return vt(e)?n[t]():e},tt.runInContext=v,tt.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:Se(n).length},tt.some=It,tt.sortedIndex=Ft,tt.template=function(n,t,e){var r=tt.templateSettings;n||(n=""),e=Q({},e,r);var u,a=Q({},e.imports,r.imports),r=Se(a),a=mt(a),o=0,f=e.interpolate||R,l="__p+='",f=Qt((e.escape||R).source+"|"+f.source+"|"+(f===N?I:R).source+"|"+(e.evaluate||R).source+"|$","g");
n.replace(f,function(t,e,r,a,f,c){return r||(r=a),l+=n.slice(o,c).replace(q,i),e&&(l+="'+__e("+e+")+'"),f&&(u=h,l+="';"+f+";__p+='"),r&&(l+="'+((__t=("+r+"))==null?'':__t)+'"),o=c+t.length,t}),l+="';\n",f=e=e.variable,f||(e="obj",l="with("+e+"){"+l+"}"),l=(u?l.replace(x,""):l).replace(O,"$1").replace(E,"$1;"),l="function("+e+"){"+(f?"":e+"||("+e+"={});")+"var __t,__p='',__e=_.escape"+(u?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+l+"return __p}";try{var c=Gt(r,"return "+l).apply(g,a)
}catch(p){throw p.source=l,p}return t?c(t):(c.source=l,c)},tt.unescape=function(n){return n==y?"":Xt(n).replace(S,ft)},tt.uniqueId=function(n){var t=++_;return Xt(n==y?"":n)+t},tt.all=_t,tt.any=It,tt.detect=jt,tt.findWhere=jt,tt.foldl=Et,tt.foldr=St,tt.include=dt,tt.inject=Et,d(tt,function(n,t){tt.prototype[t]||(tt.prototype[t]=function(){var t=[this.__wrapped__];return ce.apply(t,arguments),n.apply(tt,t)})}),tt.first=Nt,tt.last=function(n,t,e){if(n){var r=0,u=n.length;if(typeof t!="number"&&t!=y){var a=u;
for(t=tt.createCallback(t,e);a--&&t(n[a],a,n);)r++}else if(r=t,r==y||e)return n[u-1];return s(n,_e(0,u-r))}},tt.take=Nt,tt.head=Nt,d(tt,function(n,t){tt.prototype[t]||(tt.prototype[t]=function(t,e){var r=n(this.__wrapped__,t,e);return t==y||e&&typeof t!="function"?r:new et(r)})}),tt.VERSION="1.3.0",tt.prototype.toString=function(){return Xt(this.__wrapped__)},tt.prototype.value=Kt,tt.prototype.valueOf=Kt,wt(["join","pop","shift"],function(n){var t=Zt[n];tt.prototype[n]=function(){return t.apply(this.__wrapped__,arguments)
}}),wt(["push","reverse","sort","unshift"],function(n){var t=Zt[n];tt.prototype[n]=function(){return t.apply(this.__wrapped__,arguments),this}}),wt(["concat","slice","splice"],function(n){var t=Zt[n];tt.prototype[n]=function(){return new et(t.apply(this.__wrapped__,arguments))}}),tt}var g,h=!0,y=null,b=!1,m=[],d=[],_=0,k={},j=+new Date+"",w=75,C=10,x=/\b__p\+='';/g,O=/\b(__p\+=)''\+/g,E=/(__e\(.*?\)|\b__t\))\+'';/g,S=/&(?:amp|lt|gt|quot|#39);/g,I=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,A=/\w*$/,N=/<%=([\s\S]+?)%>/g,$=($=/\bthis\b/)&&$.test(v)&&$,B=" \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",F=RegExp("^["+B+"]*0+(?=.$)"),R=/($^)/,T=/[&<>"']/g,q=/['\n\r\t\u2028\u2029\\]/g,D="Array Boolean Date Function Math Number Object RegExp String _ attachEvent clearTimeout isFinite isNaN parseInt setImmediate setTimeout".split(" "),z="[object Arguments]",W="[object Array]",P="[object Boolean]",K="[object Date]",M="[object Function]",U="[object Number]",V="[object Object]",G="[object RegExp]",H="[object String]",J={};
J[M]=b,J[z]=J[W]=J[P]=J[K]=J[U]=J[V]=J[G]=J[H]=h;var L={"boolean":b,"function":h,object:h,number:b,string:b,undefined:b},Q={"\\":"\\","'":"'","\n":"n","\r":"r","\t":"t","\u2028":"u2028","\u2029":"u2029"},X=L[typeof exports]&&exports,Y=L[typeof module]&&module&&module.exports==X&&module,Z=L[typeof global]&&global;!Z||Z.global!==Z&&Z.window!==Z||(n=Z);var nt=v();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(n._=nt, define(function(){return nt})):X&&!X.nodeType?Y?(Y.exports=nt)._=nt:X._=nt:n._=nt
}(this);

View File

@@ -1,6 +1,6 @@
/**
* @license
* Lo-Dash 1.2.1 (Custom Build) <http://lodash.com/>
* Lo-Dash 1.3.0 (Custom Build) <http://lodash.com/>
* Build: `lodash underscore exports="amd,commonjs,global,node" -o ./dist/lodash.underscore.js`
* Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/>
* Based on Underscore.js 1.4.4 <http://underscorejs.org/>
@@ -12,18 +12,6 @@
/** Used as a safe reference for `undefined` in pre ES5 environments */
var undefined;
/** Detect free variable `exports` */
var freeExports = typeof exports == 'object' && exports;
/** Detect free variable `module` */
var freeModule = typeof module == 'object' && module && module.exports == freeExports && module;
/** Detect free variable `global`, from Node.js or Browserified code, and use it as `window` */
var freeGlobal = typeof global == 'object' && global;
if (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal) {
window = freeGlobal;
}
/** Used to generate unique IDs */
var idCounter = 0;
@@ -34,7 +22,7 @@
var keyPrefix = +new Date + '';
/** Used as the size when optimizations are enabled for large arrays */
var largeArraySize = 200;
var largeArraySize = 75;
/** Used to match empty string literals in compiled template source */
var reEmptyStringLeading = /\b__p \+= '';/g,
@@ -73,6 +61,7 @@
arrayClass = '[object Array]',
boolClass = '[object Boolean]',
dateClass = '[object Date]',
errorClass = '[object Error]',
funcClass = '[object Function]',
numberClass = '[object Number]',
objectClass = '[object Object]',
@@ -100,18 +89,112 @@
'\u2029': 'u2029'
};
/** Detect free variable `exports` */
var freeExports = objectTypes[typeof exports] && exports;
/** Detect free variable `module` */
var freeModule = objectTypes[typeof module] && module && module.exports == freeExports && module;
/** Detect free variable `global`, from Node.js or Browserified code, and use it as `window` */
var freeGlobal = objectTypes[typeof global] && global;
if (freeGlobal && (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal)) {
window = freeGlobal;
}
/*--------------------------------------------------------------------------*/
/** Used for `Array` and `Object` method references */
var arrayRef = Array(),
objectRef = Object();
/**
* A basic implementation of `_.indexOf` without support for binary searches
* or `fromIndex` constraints.
*
* @private
* @param {Array} array The array to search.
* @param {Mixed} value The value to search for.
* @param {Number} [fromIndex=0] The index to search from.
* @returns {Number} Returns the index of the matched value or `-1`.
*/
function basicIndexOf(array, value, fromIndex) {
var index = (fromIndex || 0) - 1,
length = array.length;
while (++index < length) {
if (array[index] === value) {
return index;
}
}
return -1;
}
/**
* Used by `sortBy` to compare transformed `collection` values, stable sorting
* them in ascending order.
*
* @private
* @param {Object} a The object to compare to `b`.
* @param {Object} b The object to compare to `a`.
* @returns {Number} Returns the sort order indicator of `1` or `-1`.
*/
function compareAscending(a, b) {
var ai = a.index,
bi = b.index;
a = a.criteria;
b = b.criteria;
// ensure a stable sort in V8 and other engines
// http://code.google.com/p/v8/issues/detail?id=90
if (a !== b) {
if (a > b || typeof a == 'undefined') {
return 1;
}
if (a < b || typeof b == 'undefined') {
return -1;
}
}
return ai < bi ? -1 : 1;
}
/**
* Used by `template` to escape characters for inclusion in compiled
* string literals.
*
* @private
* @param {String} match The matched character to escape.
* @returns {String} Returns the escaped character.
*/
function escapeStringChar(match) {
return '\\' + stringEscapes[match];
}
/**
* A no-operation function.
*
* @private
*/
function noop() {
// no operation performed
}
/*--------------------------------------------------------------------------*/
/**
* Used for `Array` method references.
*
* Normally `Array.prototype` would suffice, however, using an array literal
* avoids issues in Narwhal.
*/
var arrayRef = [];
/** Used for native method references */
var objectProto = Object.prototype,
stringProto = String.prototype;
/** Used to restore the original `_` reference in `noConflict` */
var oldDash = window._;
/** Used to detect if a method is native */
var reNative = RegExp('^' +
String(objectRef.valueOf)
String(objectProto.valueOf)
.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')
.replace(/valueOf|for [^\]]+/g, '.+?') + '$'
);
@@ -121,13 +204,15 @@
clearTimeout = window.clearTimeout,
concat = arrayRef.concat,
floor = Math.floor,
hasOwnProperty = objectRef.hasOwnProperty,
hasOwnProperty = objectProto.hasOwnProperty,
push = arrayRef.push,
propertyIsEnumerable = objectProto.propertyIsEnumerable,
setTimeout = window.setTimeout,
toString = objectRef.toString;
toString = objectProto.toString;
/* Native method shortcuts for methods with the same name as other `lodash` methods */
var nativeBind = reNative.test(nativeBind = toString.bind) && nativeBind,
nativeCreate = reNative.test(nativeCreate = Object.create) && nativeCreate,
nativeIsArray = reNative.test(nativeIsArray = Array.isArray) && nativeIsArray,
nativeIsFinite = window.isFinite,
nativeIsNaN = window.isNaN,
@@ -162,8 +247,8 @@
* `invoke`, `keys`, `map`, `max`, `memoize`, `merge`, `min`, `object`, `omit`,
* `once`, `pairs`, `partial`, `partialRight`, `pick`, `pluck`, `push`, `range`,
* `reject`, `rest`, `reverse`, `shuffle`, `slice`, `sort`, `sortBy`, `splice`,
* `tap`, `throttle`, `times`, `toArray`, `union`, `uniq`, `unshift`, `unzip`,
* `values`, `where`, `without`, `wrap`, and `zip`
* `tap`, `throttle`, `times`, `toArray`, `transform`, `union`, `uniq`, `unshift`,
* `unzip`, `values`, `where`, `without`, `wrap`, and `zip`
*
* The non-chainable wrapper functions are:
* `clone`, `cloneDeep`, `contains`, `escape`, `every`, `find`, `has`,
@@ -179,6 +264,7 @@
*
* @name _
* @constructor
* @alias chain
* @category Chaining
* @param {Mixed} value The value to wrap in a `lodash` instance.
* @returns {Object} Returns a `lodash` instance.
@@ -209,6 +295,19 @@
: new lodashWrapper(value);
}
/**
* A fast path for creating `lodash` wrapper objects.
*
* @private
* @param {Mixed} value The value to wrap in a `lodash` instance.
* @returns {Object} Returns a `lodash` instance.
*/
function lodashWrapper(value) {
this.__wrapped__ = value;
}
// ensure `new lodashWrapper` is an instance of `lodash`
lodashWrapper.prototype = lodash.prototype;
/**
* An object used to flag environments features.
*
@@ -290,47 +389,6 @@
/*--------------------------------------------------------------------------*/
/**
* Used by `_.max` and `_.min` as the default `callback` when a given
* `collection` is a string value.
*
* @private
* @param {String} value The character to inspect.
* @returns {Number} Returns the code unit of given character.
*/
function charAtCallback(value) {
return value.charCodeAt(0);
}
/**
* Used by `sortBy` to compare transformed `collection` values, stable sorting
* them in ascending order.
*
* @private
* @param {Object} a The object to compare to `b`.
* @param {Object} b The object to compare to `a`.
* @returns {Number} Returns the sort order indicator of `1` or `-1`.
*/
function compareAscending(a, b) {
var ai = a.index,
bi = b.index;
a = a.criteria;
b = b.criteria;
// ensure a stable sort in V8 and other engines
// http://code.google.com/p/v8/issues/detail?id=90
if (a !== b) {
if (a > b || typeof a == 'undefined') {
return 1;
}
if (a < b || typeof b == 'undefined') {
return -1;
}
}
return ai < bi ? -1 : 1;
}
/**
* Creates a function that, when called, invokes `func` with the `this` binding
* of `thisArg` and prepends any `partialArgs` to the arguments passed to the
@@ -377,9 +435,7 @@
}
if (this instanceof bound) {
// ensure `new bound` is an instance of `func`
noop.prototype = func.prototype;
thisBinding = new noop;
noop.prototype = null;
thisBinding = createObject(func.prototype);
// mimic the constructor's `return` behavior
// http://es5.github.com/#x13.2.2
@@ -392,15 +448,25 @@
}
/**
* Used by `template` to escape characters for inclusion in compiled
* string literals.
* Creates a new object with the specified `prototype`.
*
* @private
* @param {String} match The matched character to escape.
* @returns {String} Returns the escaped character.
* @param {Object} prototype The prototype object.
* @returns {Object} Returns the new object.
*/
function escapeStringChar(match) {
return '\\' + stringEscapes[match];
function createObject(prototype) {
return isObject(prototype) ? nativeCreate(prototype) : {};
}
// fallback for browsers without `Object.create`
if (!nativeCreate) {
var createObject = function(prototype) {
if (isObject(prototype)) {
noop.prototype = prototype;
var result = new noop;
noop.prototype = null;
}
return result || {};
};
}
/**
@@ -415,25 +481,16 @@
}
/**
* A fast path for creating `lodash` wrapper objects.
* Gets the appropriate "indexOf" function. If the `_.indexOf` method is
* customized, this method returns the custom method, otherwise it returns
* the `basicIndexOf` function.
*
* @private
* @param {Mixed} value The value to wrap in a `lodash` instance.
* @returns {Object} Returns a `lodash` instance.
* @returns {Function} Returns the "indexOf" function.
*/
function lodashWrapper(value) {
this.__wrapped__ = value;
}
// ensure `new lodashWrapper` is an instance of `lodash`
lodashWrapper.prototype = lodash.prototype;
/**
* A no-operation function.
*
* @private
*/
function noop() {
// no operation performed
function getIndexOf(array, value, fromIndex) {
var result = (result = lodash.indexOf) === indexOf ? basicIndexOf : result;
return result;
}
/**
@@ -507,11 +564,10 @@
var shimKeys = function (object) {
var index, iterable = object, result = [];
if (!iterable) return result;
if (!(objectTypes[typeof object])) return result;
if (!(objectTypes[typeof object])) return result;
for (index in iterable) {
if (hasOwnProperty.call(iterable, index)) {
result.push(index);
if (hasOwnProperty.call(iterable, index)) {
result.push(index);
}
}
return result
@@ -721,7 +777,6 @@
var index, iterable = collection, result = iterable;
if (!iterable) return result;
if (!objectTypes[typeof iterable]) return result;
for (index in iterable) {
if (callback(iterable[index], index, collection) === indicatorObject) return result;
}
@@ -753,10 +808,9 @@
var index, iterable = collection, result = iterable;
if (!iterable) return result;
if (!objectTypes[typeof iterable]) return result;
for (index in iterable) {
if (hasOwnProperty.call(iterable, index)) {
if (callback(iterable[index], index, collection) === indicatorObject) return result;
if (hasOwnProperty.call(iterable, index)) {
if (callback(iterable[index], index, collection) === indicatorObject) return result;
}
}
return result
@@ -1137,7 +1191,7 @@
// http://es5.github.com/#x8
// and avoid a V8 bug
// http://code.google.com/p/v8/issues/detail?id=2291
return value ? objectTypes[typeof value] : false;
return !!(value && objectTypes[typeof value]);
}
/**
@@ -1222,7 +1276,7 @@
* // => true
*/
function isRegExp(value) {
return value ? (objectTypes[typeof value] && toString.call(value) == regexpClass) : false;
return !!(value && objectTypes[typeof value]) && toString.call(value) == regexpClass;
}
/**
@@ -1286,7 +1340,8 @@
* // => { 'name': 'moe' }
*/
function omit(object) {
var props = concat.apply(arrayRef, nativeSlice.call(arguments, 1)),
var indexOf = getIndexOf(),
props = concat.apply(arrayRef, nativeSlice.call(arguments, 1)),
result = {};
forIn(object, function(value, key) {
@@ -1419,9 +1474,10 @@
* // => true
*/
function contains(collection, target) {
var length = collection ? collection.length : 0,
var indexOf = getIndexOf(),
length = collection ? collection.length : 0,
result = false;
if (typeof length == 'number') {
if (length && typeof length == 'number') {
result = indexOf(collection, target) > -1;
} else {
forOwn(collection, function(value) {
@@ -1615,7 +1671,7 @@
*
* @static
* @memberOf _
* @alias detect
* @alias detect, findWhere
* @category Collections
* @param {Array|Object|String} collection The collection to iterate over.
* @param {Function|Object|String} [callback=identity] The function called per
@@ -2450,6 +2506,7 @@
*/
function difference(array) {
var index = -1,
indexOf = getIndexOf(),
length = array.length,
flattened = concat.apply(arrayRef, nativeSlice.call(arguments, 1)),
result = [];
@@ -2623,21 +2680,14 @@
* // => 2
*/
function indexOf(array, value, fromIndex) {
var index = -1,
length = array ? array.length : 0;
if (typeof fromIndex == 'number') {
index = (fromIndex < 0 ? nativeMax(0, length + fromIndex) : fromIndex || 0) - 1;
var length = array ? array.length : 0;
fromIndex = (fromIndex < 0 ? nativeMax(0, length + fromIndex) : fromIndex || 0);
} else if (fromIndex) {
index = sortedIndex(array, value);
var index = sortedIndex(array, value);
return array[index] === value ? index : -1;
}
while (++index < length) {
if (array[index] === value) {
return index;
}
}
return -1;
return array ? basicIndexOf(array, value, fromIndex) : -1;
}
/**
@@ -2734,6 +2784,7 @@
var args = arguments,
argsLength = args.length,
index = -1,
indexOf = getIndexOf(),
length = array ? array.length : 0,
result = [];
@@ -3078,7 +3129,7 @@
* Creates a duplicate-value-free version of the `array` using strict equality
* for comparisons, i.e. `===`. If the `array` is already sorted, passing `true`
* for `isSorted` will run a faster algorithm. If `callback` is passed, each
* element of `array` is passed through a `callback` before uniqueness is computed.
* element of `array` is passed through the `callback` before uniqueness is computed.
* The `callback` is bound to `thisArg` and invoked with three arguments; (value, index, array).
*
* If a property name is passed for `callback`, the created "_.pluck" style
@@ -3107,11 +3158,11 @@
* _.uniq([1, 1, 2, 2, 3], true);
* // => [1, 2, 3]
*
* _.uniq([1, 2, 1.5, 3, 2.5], function(num) { return Math.floor(num); });
* // => [1, 2, 3]
* _.uniq(['A', 'b', 'C', 'a', 'B', 'c'], function(letter) { return letter.toLowerCase(); });
* // => ['A', 'b', 'C']
*
* _.uniq([1, 2, 1.5, 3, 2.5], function(num) { return this.floor(num); }, Math);
* // => [1, 2, 3]
* _.uniq([1, 2.5, 3, 1.5, 2, 3.5], function(num) { return this.floor(num); }, Math);
* // => [1, 2.5, 3]
*
* // using "_.pluck" callback shorthand
* _.uniq([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
@@ -3119,6 +3170,7 @@
*/
function uniq(array, isSorted, callback, thisArg) {
var index = -1,
indexOf = getIndexOf(),
length = array ? array.length : 0,
result = [],
seen = result;
@@ -3149,6 +3201,31 @@
return result;
}
/**
* The inverse of `_.zip`, this method splits groups of elements into arrays
* composed of elements from each group at their corresponding indexes.
*
* @static
* @memberOf _
* @category Arrays
* @param {Array} array The array to process.
* @returns {Array} Returns a new array of the composed arrays.
* @example
*
* _.unzip([['moe', 30, true], ['larry', 40, false]]);
* // => [['moe', 'larry'], [30, 40], [true, false]];
*/
function unzip(array) {
var index = -1,
length = array ? max(pluck(array, 'length')) : 0,
result = Array(length < 0 ? 0 : length);
while (++index < length) {
result[index] = pluck(array, index);
}
return result;
}
/**
* Creates an array with all occurrences of the passed values removed using
* strict equality for comparisons, i.e. `===`.
@@ -3187,7 +3264,7 @@
function zip(array) {
var index = -1,
length = array ? max(pluck(arguments, 'length')) : 0,
result = Array(length);
result = Array(length < 0 ? 0 : length);
while (++index < length) {
result[index] = pluck(arguments, index);
@@ -3430,27 +3507,27 @@
return result;
};
}
if (typeof thisArg != 'undefined') {
if (argCount === 1) {
return function(value) {
return func.call(thisArg, value);
};
}
if (argCount === 2) {
return function(a, b) {
return func.call(thisArg, a, b);
};
}
if (argCount === 4) {
return function(accumulator, value, index, collection) {
return func.call(thisArg, accumulator, value, index, collection);
};
}
return function(value, index, collection) {
return func.call(thisArg, value, index, collection);
if (typeof thisArg == 'undefined') {
return func;
}
if (argCount === 1) {
return function(value) {
return func.call(thisArg, value);
};
}
return func;
if (argCount === 2) {
return function(a, b) {
return func.call(thisArg, a, b);
};
}
if (argCount === 4) {
return function(accumulator, value, index, collection) {
return func.call(thisArg, accumulator, value, index, collection);
};
}
return function(value, index, collection) {
return func.call(thisArg, value, index, collection);
};
}
/**
@@ -3471,6 +3548,7 @@
* @param {Number} wait The number of milliseconds to delay.
* @param {Object} options The options object.
* [leading=false] A boolean to specify execution on the leading edge of the timeout.
* [maxWait] The maximum time `func` is allowed to be delayed before it's called.
* [trailing=true] A boolean to specify execution on the trailing edge of the timeout.
* @returns {Function} Returns the new debounced function.
* @example
@@ -3487,7 +3565,7 @@
var args,
result,
thisArg,
timeoutId;
timeoutId = null;
function delayed() {
timeoutId = null;
@@ -3557,7 +3635,8 @@
* passed, it will be used to determine the cache key for storing the result
* based on the arguments passed to the memoized function. By default, the first
* argument passed to the memoized function is used as the cache key. The `func`
* is executed with the `this` binding of the memoized function.
* is executed with the `this` binding of the memoized function. The result
* cache is exposed as the `cache` property on the memoized function.
*
* @static
* @memberOf _
@@ -3670,8 +3749,8 @@
var args,
result,
thisArg,
timeoutId,
lastCalled = 0;
lastCalled = 0,
timeoutId = null;
function trailingCall() {
lastCalled = new Date;
@@ -3748,7 +3827,7 @@
}
/**
* This function returns the first argument passed to it.
* This method returns the first argument passed to it.
*
* @static
* @memberOf _
@@ -3848,8 +3927,13 @@
if (max == null) {
max = min;
min = 0;
} else {
max = +max || 0;
}
return min + floor(nativeRandom() * ((+max || 0) - min + 1));
var rand = nativeRandom();
return (min % 1 || max % 1)
? min + nativeMin(rand * (max - min + parseFloat('1e-' + ((rand +'').length - 1))), max)
: min + floor(rand * (max - min + 1));
}
/**
@@ -3964,8 +4048,9 @@
* ');
*/
function template(text, data, options) {
var settings = lodash.templateSettings;
text || (text = '');
options = defaults({}, options, lodash.templateSettings);
options = defaults({}, options, settings);
var index = 0,
source = "__p += '",
@@ -4260,6 +4345,9 @@
lodash.tail = rest;
lodash.unique = uniq;
// add Underscore compat
lodash.chain = chain;
/*--------------------------------------------------------------------------*/
// add functions that return unwrapped values when chaining
@@ -4268,7 +4356,6 @@
lodash.escape = escape;
lodash.every = every;
lodash.find = find;
lodash.findWhere = findWhere;
lodash.has = has;
lodash.identity = identity;
lodash.indexOf = indexOf;
@@ -4306,6 +4393,7 @@
lodash.all = every;
lodash.any = some;
lodash.detect = find;
lodash.findWhere = findWhere;
lodash.foldl = reduce;
lodash.foldr = reduceRight;
lodash.include = contains;
@@ -4323,8 +4411,6 @@
/*--------------------------------------------------------------------------*/
lodash.chain = chain;
/**
* The semantic version number.
*
@@ -4332,7 +4418,7 @@
* @memberOf _
* @type String
*/
lodash.VERSION = '1.2.1';
lodash.VERSION = '1.3.0';
// add functions to `lodash.prototype`
mixin(lodash);

View File

@@ -1,35 +1,35 @@
/**
* @license
* Lo-Dash 1.2.1 (Custom Build) lodash.com/license
* Lo-Dash 1.3.0 (Custom Build) lodash.com/license
* Build: `lodash underscore exports="amd,commonjs,global,node" -o ./dist/lodash.underscore.js`
* Underscore.js 1.4.4 underscorejs.org/LICENSE
*/
;(function(n){function t(n){return n instanceof t?n:new i(n)}function r(n,t){var r=n.b,e=t.b;if(n=n.a,t=t.a,n!==t){if(n>t||typeof n=="undefined")return 1;if(n<t||typeof t=="undefined")return-1}return r<e?-1:1}function e(n,t,r,e){function u(){var e=arguments,c=i?this:t;return o||(n=t[f]),r.length&&(e=e.length?(e=Bt.call(e),l?e.concat(r):r.concat(e)):r),this instanceof u?(a.prototype=n.prototype,c=new a,a.prototype=null,e=n.apply(c,e),m(e)?e:c):n.apply(c,e)}var o=y(n),i=!r,f=t;if(i){var l=e;r=t}else if(!o){if(!e)throw new TypeError;
t=n}return u}function u(n){return"\\"+lt[n]}function o(n){return Dt[n]}function i(n){this.__wrapped__=n}function a(){}function f(n){return Mt[n]}function l(n){return dt.call(n)==nt}function c(n){if(!n)return n;for(var t=1,r=arguments.length;t<r;t++){var e=arguments[t];if(e)for(var u in e)n[u]=e[u]}return n}function p(n){if(!n)return n;for(var t=1,r=arguments.length;t<r;t++){var e=arguments[t];if(e)for(var u in e)null==n[u]&&(n[u]=e[u])}return n}function s(n){var t=[];return Tt(n,function(n,r){y(n)&&t.push(r)
}),t.sort()}function v(n){for(var t=-1,r=Rt(n),e=r.length,u={};++t<e;){var o=r[t];u[n[o]]=o}return u}function g(n){if(!n)return!0;if(Ft(n)||b(n))return!n.length;for(var t in n)if(mt.call(n,t))return!1;return!0}function h(n,r,e,u){if(n===r)return 0!==n||1/n==1/r;var o=typeof n,i=typeof r;if(n===n&&(!n||"function"!=o&&"object"!=o)&&(!r||"function"!=i&&"object"!=i))return!1;if(null==n||null==r)return n===r;if(i=dt.call(n),o=dt.call(r),i!=o)return!1;switch(i){case rt:case et:return+n==+r;case ut:return n!=+n?r!=+r:0==n?1/n==1/r:n==+r;
case it:case at:return n==r+""}if(o=i==tt,!o){if(n instanceof t||r instanceof t)return h(n.__wrapped__||n,r.__wrapped__||r,e,u);if(i!=ot)return!1;var i=n.constructor,a=r.constructor;if(i!=a&&(!y(i)||!(i instanceof i&&y(a)&&a instanceof a)))return!1}for(e||(e=[]),u||(u=[]),i=e.length;i--;)if(e[i]==n)return u[i]==r;var f=!0,l=0;if(e.push(n),u.push(r),o){if(l=r.length,f=l==n.length)for(;l--&&(f=h(n[l],r[l],e,u)););return f}return Tt(r,function(t,r,o){return mt.call(o,r)?(l++,!(f=mt.call(n,r)&&h(n[r],t,e,u))&&K):void 0
}),f&&Tt(n,function(n,t,r){return mt.call(r,t)?!(f=-1<--l)&&K:void 0}),f}function y(n){return typeof n=="function"}function m(n){return n?ft[typeof n]:!1}function _(n){return typeof n=="number"||dt.call(n)==ut}function b(n){return typeof n=="string"||dt.call(n)==at}function d(n){for(var t=-1,r=Rt(n),e=r.length,u=Array(e);++t<e;)u[t]=n[r[t]];return u}function j(n,t){var r=!1;return typeof(n?n.length:0)=="number"?r=-1<T(n,t):$t(n,function(n){return(r=n===t)&&K}),r}function w(n,t,r){var e=!0;t=P(t,r),r=-1;
var u=n?n.length:0;if(typeof u=="number")for(;++r<u&&(e=!!t(n[r],r,n)););else $t(n,function(n,r,u){return!(e=!!t(n,r,u))&&K});return e}function A(n,t,r){var e=[];t=P(t,r),r=-1;var u=n?n.length:0;if(typeof u=="number")for(;++r<u;){var o=n[r];t(o,r,n)&&e.push(o)}else $t(n,function(n,r,u){t(n,r,u)&&e.push(n)});return e}function x(n,t,r){t=P(t,r),r=-1;var e=n?n.length:0;if(typeof e!="number"){var u;return $t(n,function(n,r,e){return t(n,r,e)?(u=n,K):void 0}),u}for(;++r<e;){var o=n[r];if(t(o,r,n))return o
}}function E(n,t,r){var e=-1,u=n?n.length:0;if(t=t&&typeof r=="undefined"?t:P(t,r),typeof u=="number")for(;++e<u&&t(n[e],e,n)!==K;);else $t(n,t)}function O(n,t,r){var e=-1,u=n?n.length:0;if(t=P(t,r),typeof u=="number")for(var o=Array(u);++e<u;)o[e]=t(n[e],e,n);else o=[],$t(n,function(n,r,u){o[++e]=t(n,r,u)});return o}function S(n,t,r){var e=-1/0,u=e,o=-1,i=n?n.length:0;if(t||typeof i!="number")t=P(t,r),E(n,function(n,r,o){r=t(n,r,o),r>e&&(e=r,u=n)});else for(;++o<i;)r=n[o],r>u&&(u=r);return u}function N(n,t){var r=-1,e=n?n.length:0;
if(typeof e=="number")for(var u=Array(e);++r<e;)u[r]=n[r][t];return u||O(n,t)}function B(n,t,r,e){if(!n)return r;var u=3>arguments.length;t=P(t,e,4);var o=-1,i=n.length;if(typeof i=="number")for(u&&(r=n[++o]);++o<i;)r=t(r,n[o],o,n);else $t(n,function(n,e,o){r=u?(u=!1,n):t(r,n,e,o)});return r}function k(n,t,r,e){var u=n?n.length:0,o=3>arguments.length;if(typeof u!="number")var i=Rt(n),u=i.length;return t=P(t,e,4),E(n,function(e,a,f){a=i?i[--u]:--u,r=o?(o=!1,n[a]):t(r,n[a],a,f)}),r}function q(n,t,r){var e;
t=P(t,r),r=-1;var u=n?n.length:0;if(typeof u=="number")for(;++r<u&&!(e=t(n[r],r,n)););else $t(n,function(n,r,u){return(e=t(n,r,u))&&K});return!!e}function F(n,t,r){return r&&g(t)?null:(r?x:A)(n,t)}function R(n){for(var t=-1,r=n.length,e=ht.apply(ct,Bt.call(arguments,1)),u=[];++t<r;){var o=n[t];0>T(e,o)&&u.push(o)}return u}function D(n,t,r){if(n){var e=0,u=n.length;if(typeof t!="number"&&null!=t){var o=-1;for(t=P(t,r);++o<u&&t(n[o],o,n);)e++}else if(e=t,null==e||r)return n[0];return Bt.call(n,0,St(Ot(0,e),u))
}}function M(n,t){for(var r=-1,e=n?n.length:0,u=[];++r<e;){var o=n[r];Ft(o)?_t.apply(u,t?o:M(o)):u.push(o)}return u}function T(n,t,r){var e=-1,u=n?n.length:0;if(typeof r=="number")e=(0>r?Ot(0,u+r):r||0)-1;else if(r)return e=I(n,t),n[e]===t?e:-1;for(;++e<u;)if(n[e]===t)return e;return-1}function $(n,t,r){if(typeof t!="number"&&null!=t){var e=0,u=-1,o=n?n.length:0;for(t=P(t,r);++u<o&&t(n[u],u,n);)e++}else e=null==t||r?1:Ot(0,t);return Bt.call(n,e)}function I(n,t,r,e){var u=0,o=n?n.length:u;for(r=r?P(r,e,1):U,t=r(t);u<o;)e=u+o>>>1,r(n[e])<t?u=e+1:o=e;
return u}function z(n,t,r,e){var u=-1,o=n?n.length:0,i=[],a=i;for(typeof t!="boolean"&&null!=t&&(e=r,r=t,t=!1),null!=r&&(a=[],r=P(r,e));++u<o;){e=n[u];var f=r?r(e,u,n):e;(t?!u||a[a.length-1]!==f:0>T(a,f))&&(r&&a.push(f),i.push(e))}return i}function C(n,t){return qt.fastBind||jt&&2<arguments.length?jt.call.apply(jt,arguments):e(n,t,Bt.call(arguments,2))}function P(n,t,r){if(null==n)return U;var e=typeof n;if("function"!=e){if("object"!=e)return function(t){return t[n]};var u=Rt(n);return function(t){for(var r=u.length,e=!1;r--&&(e=t[u[r]]===n[u[r]]););return e
}}return typeof t!="undefined"?1===r?function(r){return n.call(t,r)}:2===r?function(r,e){return n.call(t,r,e)}:4===r?function(r,e,u,o){return n.call(t,r,e,u,o)}:function(r,e,u){return n.call(t,r,e,u)}:n}function U(n){return n}function V(n){E(s(n),function(r){var e=t[r]=n[r];t.prototype[r]=function(){var n=[this.__wrapped__];return _t.apply(n,arguments),n=e.apply(t,n),this.__chain__&&(n=new i(n),n.__chain__=!0),n}})}var W=typeof exports=="object"&&exports,G=typeof module=="object"&&module&&module.exports==W&&module,H=typeof global=="object"&&global;
(H.global===H||H.window===H)&&(n=H);var J=0,K={},L=+new Date+"",Q=/&(?:amp|lt|gt|quot|#39);/g,X=/($^)/,Y=/[&<>"']/g,Z=/['\n\r\t\u2028\u2029\\]/g,nt="[object Arguments]",tt="[object Array]",rt="[object Boolean]",et="[object Date]",ut="[object Number]",ot="[object Object]",it="[object RegExp]",at="[object String]",ft={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},lt={"\\":"\\","'":"'","\n":"n","\r":"r","\t":"t","\u2028":"u2028","\u2029":"u2029"},ct=[],H={},pt=n._,st=RegExp("^"+(H.valueOf+"").replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),vt=Math.ceil,gt=n.clearTimeout,ht=ct.concat,yt=Math.floor,mt=H.hasOwnProperty,_t=ct.push,bt=n.setTimeout,dt=H.toString,jt=st.test(jt=dt.bind)&&jt,wt=st.test(wt=Array.isArray)&&wt,At=n.isFinite,xt=n.isNaN,Et=st.test(Et=Object.keys)&&Et,Ot=Math.max,St=Math.min,Nt=Math.random,Bt=ct.slice,H=st.test(n.attachEvent),kt=jt&&!/\n|true/.test(jt+H),qt={};
(function(){var n={0:1,length:1};qt.fastBind=jt&&!kt,qt.spliceObjects=(ct.splice.call(n,0,1),!n[0])})(1),t.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,variable:""},i.prototype=t.prototype,l(arguments)||(l=function(n){return n?mt.call(n,"callee"):!1});var Ft=wt||function(n){return n?typeof n=="object"&&dt.call(n)==tt:!1},wt=function(n){var t,r=[];if(!n||!ft[typeof n])return r;for(t in n)mt.call(n,t)&&r.push(t);return r},Rt=Et?function(n){return m(n)?Et(n):[]
}:wt,Dt={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Mt=v(Dt),Tt=function(n,t){var r;if(!n||!ft[typeof n])return n;for(r in n)if(t(n[r],r,n)===K)break;return n},$t=function(n,t){var r;if(!n||!ft[typeof n])return n;for(r in n)if(mt.call(n,r)&&t(n[r],r,n)===K)break;return n};y(/x/)&&(y=function(n){return typeof n=="function"&&"[object Function]"==dt.call(n)}),t.after=function(n,t){return 1>n?t():function(){return 1>--n?t.apply(this,arguments):void 0}},t.bind=C,t.bindAll=function(n){for(var t=1<arguments.length?ht.apply(ct,Bt.call(arguments,1)):s(n),r=-1,e=t.length;++r<e;){var u=t[r];
n[u]=C(n[u],n)}return n},t.compact=function(n){for(var t=-1,r=n?n.length:0,e=[];++t<r;){var u=n[t];u&&e.push(u)}return e},t.compose=function(){var n=arguments;return function(){for(var t=arguments,r=n.length;r--;)t=[n[r].apply(this,t)];return t[0]}},t.countBy=function(n,t,r){var e={};return t=P(t,r),E(n,function(n,r,u){r=t(n,r,u)+"",mt.call(e,r)?e[r]++:e[r]=1}),e},t.debounce=function(n,t,r){function e(){a=null,r||(o=n.apply(i,u))}var u,o,i,a;return function(){var f=r&&!a;return u=arguments,i=this,gt(a),a=bt(e,t),f&&(o=n.apply(i,u)),o
}},t.defaults=p,t.defer=function(n){var t=Bt.call(arguments,1);return bt(function(){n.apply(void 0,t)},1)},t.delay=function(n,t){var r=Bt.call(arguments,2);return bt(function(){n.apply(void 0,r)},t)},t.difference=R,t.filter=A,t.flatten=M,t.forEach=E,t.functions=s,t.groupBy=function(n,t,r){var e={};return t=P(t,r),E(n,function(n,r,u){r=t(n,r,u)+"",(mt.call(e,r)?e[r]:e[r]=[]).push(n)}),e},t.initial=function(n,t,r){if(!n)return[];var e=0,u=n.length;if(typeof t!="number"&&null!=t){var o=u;for(t=P(t,r);o--&&t(n[o],o,n);)e++
}else e=null==t||r?1:t||e;return Bt.call(n,0,St(Ot(0,u-e),u))},t.intersection=function(n){var t=arguments,r=t.length,e=-1,u=n?n.length:0,o=[];n:for(;++e<u;){var i=n[e];if(0>T(o,i)){for(var a=r;--a;)if(0>T(t[a],i))continue n;o.push(i)}}return o},t.invert=v,t.invoke=function(n,t){var r=Bt.call(arguments,2),e=-1,u=typeof t=="function",o=n?n.length:0,i=Array(typeof o=="number"?o:0);return E(n,function(n){i[++e]=(u?t:n[t]).apply(n,r)}),i},t.keys=Rt,t.map=O,t.max=S,t.memoize=function(n,t){var r={};return function(){var e=L+(t?t.apply(this,arguments):arguments[0]);
return mt.call(r,e)?r[e]:r[e]=n.apply(this,arguments)}},t.min=function(n,t,r){var e=1/0,u=e,o=-1,i=n?n.length:0;if(t||typeof i!="number")t=P(t,r),E(n,function(n,r,o){r=t(n,r,o),r<e&&(e=r,u=n)});else for(;++o<i;)r=n[o],r<u&&(u=r);return u},t.omit=function(n){var t=ht.apply(ct,Bt.call(arguments,1)),r={};return Tt(n,function(n,e){0>T(t,e)&&(r[e]=n)}),r},t.once=function(n){var t,r;return function(){return t?r:(t=!0,r=n.apply(this,arguments),n=null,r)}},t.pairs=function(n){for(var t=-1,r=Rt(n),e=r.length,u=Array(e);++t<e;){var o=r[t];
u[t]=[o,n[o]]}return u},t.partial=function(n){return e(n,Bt.call(arguments,1))},t.pick=function(n){for(var t=-1,r=ht.apply(ct,Bt.call(arguments,1)),e=r.length,u={};++t<e;){var o=r[t];o in n&&(u[o]=n[o])}return u},t.pluck=N,t.range=function(n,t,r){n=+n||0,r=+r||1,null==t&&(t=n,n=0);var e=-1;t=Ot(0,vt((t-n)/r));for(var u=Array(t);++e<t;)u[e]=n,n+=r;return u},t.reject=function(n,t,r){return t=P(t,r),A(n,function(n,r,e){return!t(n,r,e)})},t.rest=$,t.shuffle=function(n){var t=-1,r=n?n.length:0,e=Array(typeof r=="number"?r:0);
return E(n,function(n){var r=yt(Nt()*(++t+1));e[t]=e[r],e[r]=n}),e},t.sortBy=function(n,t,e){var u=-1,o=n?n.length:0,i=Array(typeof o=="number"?o:0);for(t=P(t,e),E(n,function(n,r,e){i[++u]={a:t(n,r,e),b:u,c:n}}),o=i.length,i.sort(r);o--;)i[o]=i[o].c;return i},t.tap=function(n,t){return t(n),n},t.throttle=function(n,t){function r(){a=new Date,i=null,u=n.apply(o,e)}var e,u,o,i,a=0;return function(){var f=new Date,l=t-(f-a);return e=arguments,o=this,0<l?i||(i=bt(r,l)):(gt(i),i=null,a=f,u=n.apply(o,e)),u
}},t.times=function(n,t,r){for(var e=-1,u=Array(-1<n?n:0);++e<n;)u[e]=t.call(r,e);return u},t.toArray=function(n){return Ft(n)?Bt.call(n):n&&typeof n.length=="number"?O(n):d(n)},t.union=function(n){return Ft(n)||(arguments[0]=n?Bt.call(n):ct),z(ht.apply(ct,arguments))},t.uniq=z,t.values=d,t.where=F,t.without=function(n){return R(n,Bt.call(arguments,1))},t.wrap=function(n,t){return function(){var r=[n];return _t.apply(r,arguments),t.apply(this,r)}},t.zip=function(n){for(var t=-1,r=n?S(N(arguments,"length")):0,e=Array(r);++t<r;)e[t]=N(arguments,t);
return e},t.collect=O,t.drop=$,t.each=E,t.extend=c,t.methods=s,t.object=function(n,t){for(var r=-1,e=n?n.length:0,u={};++r<e;){var o=n[r];t?u[o]=t[r]:u[o[0]]=o[1]}return u},t.select=A,t.tail=$,t.unique=z,t.clone=function(n){return m(n)?Ft(n)?Bt.call(n):c({},n):n},t.contains=j,t.escape=function(n){return null==n?"":(n+"").replace(Y,o)},t.every=w,t.find=x,t.findWhere=function(n,t){return F(n,t,!0)},t.has=function(n,t){return n?mt.call(n,t):!1},t.identity=U,t.indexOf=T,t.isArguments=l,t.isArray=Ft,t.isBoolean=function(n){return!0===n||!1===n||dt.call(n)==rt
},t.isDate=function(n){return n?typeof n=="object"&&dt.call(n)==et:!1},t.isElement=function(n){return n?1===n.nodeType:!1},t.isEmpty=g,t.isEqual=h,t.isFinite=function(n){return At(n)&&!xt(parseFloat(n))},t.isFunction=y,t.isNaN=function(n){return _(n)&&n!=+n},t.isNull=function(n){return null===n},t.isNumber=_,t.isObject=m,t.isRegExp=function(n){return n?ft[typeof n]&&dt.call(n)==it:!1},t.isString=b,t.isUndefined=function(n){return typeof n=="undefined"},t.lastIndexOf=function(n,t,r){var e=n?n.length:0;
for(typeof r=="number"&&(e=(0>r?Ot(0,e+r):St(r,e-1))+1);e--;)if(n[e]===t)return e;return-1},t.mixin=V,t.noConflict=function(){return n._=pt,this},t.random=function(n,t){return null==n&&null==t&&(t=1),n=+n||0,null==t&&(t=n,n=0),n+yt(Nt()*((+t||0)-n+1))},t.reduce=B,t.reduceRight=k,t.result=function(n,t){var r=n?n[t]:null;return y(r)?n[t]():r},t.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:Rt(n).length},t.some=q,t.sortedIndex=I,t.template=function(n,r,e){n||(n=""),e=p({},e,t.templateSettings);
var o=0,i="__p+='",a=e.variable;n.replace(RegExp((e.escape||X).source+"|"+(e.interpolate||X).source+"|"+(e.evaluate||X).source+"|$","g"),function(t,r,e,a,f){return i+=n.slice(o,f).replace(Z,u),r&&(i+="'+_['escape']("+r+")+'"),a&&(i+="';"+a+";__p+='"),e&&(i+="'+((__t=("+e+"))==null?'':__t)+'"),o=f+t.length,t}),i+="';\n",a||(a="obj",i="with("+a+"||{}){"+i+"}"),i="function("+a+"){var __t,__p='',__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}"+i+"return __p}";try{var f=Function("_","return "+i)(t)
}catch(l){throw l.source=i,l}return r?f(r):(f.source=i,f)},t.unescape=function(n){return null==n?"":(n+"").replace(Q,f)},t.uniqueId=function(n){var t=++J+"";return n?n+t:t},t.all=w,t.any=q,t.detect=x,t.foldl=B,t.foldr=k,t.include=j,t.inject=B,t.first=D,t.last=function(n,t,r){if(n){var e=0,u=n.length;if(typeof t!="number"&&null!=t){var o=u;for(t=P(t,r);o--&&t(n[o],o,n);)e++}else if(e=t,null==e||r)return n[u-1];return Bt.call(n,Ot(0,u-e))}},t.take=D,t.head=D,t.chain=function(n){return n=new i(n),n.__chain__=!0,n
},t.VERSION="1.2.1",V(t),t.prototype.chain=function(){return this.__chain__=!0,this},t.prototype.value=function(){return this.__wrapped__},E("pop push reverse shift sort splice unshift".split(" "),function(n){var r=ct[n];t.prototype[n]=function(){var n=this.__wrapped__;return r.apply(n,arguments),!qt.spliceObjects&&0===n.length&&delete n[0],this}}),E(["concat","join","slice"],function(n){var r=ct[n];t.prototype[n]=function(){var n=r.apply(this.__wrapped__,arguments);return this.__chain__&&(n=new i(n),n.__chain__=!0),n
}}),typeof define=="function"&&typeof define.amd=="object"&&define.amd?(n._=t,define(function(){return t})):W&&!W.nodeType?G?(G.exports=t)._=t:W._=t:n._=t})(this);
;!function(n){function t(n,t){var r;if(n&&gt[typeof n])for(r in n)if(Et.call(n,r)&&t(n[r],r,n)===nt)break}function r(n,t){var r;if(n&&gt[typeof n])for(r in n)if(t(n[r],r,n)===nt)break}function e(n){var t,r=[];if(!n||!gt[typeof n])return r;for(t in n)Et.call(n,t)&&r.push(t);return r}function u(n,t,r){r=(r||0)-1;for(var e=n.length;++r<e;)if(n[r]===t)return r;return-1}function o(n,t){var r=n.m,e=t.m;if(n=n.l,t=t.l,n!==t){if(n>t||typeof n=="undefined")return 1;if(n<t||typeof t=="undefined")return-1}return r<e?-1:1
}function i(n){return"\\"+ht[n]}function a(){}function f(n){return n instanceof f?n:new c(n)}function c(n){this.__wrapped__=n}function l(n,t,r){function e(){var f=arguments,c=o?this:t;return u||(n=t[i]),r.length&&(f=f.length?(f=zt.call(f),a?f.concat(r):r.concat(f)):r),this instanceof e?(c=p(n.prototype),f=n.apply(c,f),A(f)?f:c):n.apply(c,f)}var u=w(n),o=!r,i=t;if(o){var a=void 0;r=t}else if(!u)throw new TypeError;return e}function p(n){return A(n)?Ft(n):{}}function s(n){return Wt[n]}function v(){var n=(n=f.indexOf)===U?u:n;
return n}function g(n){return Gt[n]}function h(n){return kt.call(n)==it}function y(n){if(!n)return n;for(var t=1,r=arguments.length;t<r;t++){var e=arguments[t];if(e)for(var u in e)n[u]=e[u]}return n}function m(n){if(!n)return n;for(var t=1,r=arguments.length;t<r;t++){var e=arguments[t];if(e)for(var u in e)n[u]==X&&(n[u]=e[u])}return n}function _(n){var t=[];return r(n,function(n,r){w(n)&&t.push(r)}),t.sort()}function d(n){for(var t=-1,r=Vt(n),e=r.length,u={};++t<e;){var o=r[t];u[n[o]]=o}return u}function b(n){if(!n)return Q;
if(Ut(n)||O(n))return!n.length;for(var t in n)if(Et.call(n,t))return Y;return Q}function j(n,t,e,u){if(n===t)return 0!==n||1/n==1/t;var o=typeof n,i=typeof t;if(n===n&&(!n||"function"!=o&&"object"!=o)&&(!t||"function"!=i&&"object"!=i))return Y;if(n==X||t==X)return n===t;if(i=kt.call(n),o=kt.call(t),i!=o)return Y;switch(i){case ft:case ct:return+n==+t;case lt:return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;case st:case vt:return n==t+""}if(o=i==at,!o){if(n instanceof f||t instanceof f)return j(n.__wrapped__||n,t.__wrapped__||t,e,u);
if(i!=pt)return Y;var i=n.constructor,a=t.constructor;if(i!=a&&(!w(i)||!(i instanceof i&&w(a)&&a instanceof a)))return Y}for(e||(e=[]),u||(u=[]),i=e.length;i--;)if(e[i]==n)return u[i]==t;var c=Q,l=0;if(e.push(n),u.push(t),o){if(l=t.length,c=l==n.length)for(;l--&&(c=j(n[l],t[l],e,u)););return c}return r(t,function(t,r,o){return Et.call(o,r)?(l++,!(c=Et.call(n,r)&&j(n[r],t,e,u))&&nt):void 0}),c&&r(n,function(n,t,r){return Et.call(r,t)?!(c=-1<--l)&&nt:void 0}),c}function w(n){return typeof n=="function"
}function A(n){return!(!n||!gt[typeof n])}function x(n){return typeof n=="number"||kt.call(n)==lt}function O(n){return typeof n=="string"||kt.call(n)==vt}function E(n){for(var t=-1,r=Vt(n),e=r.length,u=Array(e);++t<e;)u[t]=n[r[t]];return u}function S(n,r){var e=v(),u=n?n.length:0,o=Y;return u&&typeof u=="number"?o=-1<e(n,r):t(n,function(n){return(o=n===r)&&nt}),o}function N(n,r,e){var u=Q;r=J(r,e),e=-1;var o=n?n.length:0;if(typeof o=="number")for(;++e<o&&(u=!!r(n[e],e,n)););else t(n,function(n,t,e){return!(u=!!r(n,t,e))&&nt
});return u}function k(n,r,e){var u=[];r=J(r,e),e=-1;var o=n?n.length:0;if(typeof o=="number")for(;++e<o;){var i=n[e];r(i,e,n)&&u.push(i)}else t(n,function(n,t,e){r(n,t,e)&&u.push(n)});return u}function B(n,r,e){r=J(r,e),e=-1;var u=n?n.length:0;if(typeof u!="number"){var o;return t(n,function(n,t,e){return r(n,t,e)?(o=n,nt):void 0}),o}for(;++e<u;){var i=n[e];if(r(i,e,n))return i}}function F(n,r,e){var u=-1,o=n?n.length:0;if(r=r&&typeof e=="undefined"?r:J(r,e),typeof o=="number")for(;++u<o&&r(n[u],u,n)!==nt;);else t(n,r)
}function q(n,r,e){var u=-1,o=n?n.length:0;if(r=J(r,e),typeof o=="number")for(var i=Array(o);++u<o;)i[u]=r(n[u],u,n);else i=[],t(n,function(n,t,e){i[++u]=r(n,t,e)});return i}function R(n,t,r){var e=-1/0,u=e,o=-1,i=n?n.length:0;if(t||typeof i!="number")t=J(t,r),F(n,function(n,r,o){r=t(n,r,o),r>e&&(e=r,u=n)});else for(;++o<i;)r=n[o],r>u&&(u=r);return u}function D(n,t){var r=-1,e=n?n.length:0;if(typeof e=="number")for(var u=Array(e);++r<e;)u[r]=n[r][t];return u||q(n,t)}function M(n,r,e,u){if(!n)return e;
var o=3>arguments.length;r=J(r,u,4);var i=-1,a=n.length;if(typeof a=="number")for(o&&(e=n[++i]);++i<a;)e=r(e,n[i],i,n);else t(n,function(n,t,u){e=o?(o=Y,n):r(e,n,t,u)});return e}function T(n,t,r,e){var u=n?n.length:0,o=3>arguments.length;if(typeof u!="number")var i=Vt(n),u=i.length;return t=J(t,e,4),F(n,function(e,a,f){a=i?i[--u]:--u,r=o?(o=Y,n[a]):t(r,n[a],a,f)}),r}function $(n,r,e){var u;r=J(r,e),e=-1;var o=n?n.length:0;if(typeof o=="number")for(;++e<o&&!(u=r(n[e],e,n)););else t(n,function(n,t,e){return(u=r(n,t,e))&&nt
});return!!u}function I(n,t,r){return r&&b(t)?X:(r?B:k)(n,t)}function z(n){for(var t=-1,r=v(),e=n.length,u=xt.apply(dt,zt.call(arguments,1)),o=[];++t<e;){var i=n[t];0>r(u,i)&&o.push(i)}return o}function C(n,t,r){if(n){var e=0,u=n.length;if(typeof t!="number"&&t!=X){var o=-1;for(t=J(t,r);++o<u&&t(n[o],o,n);)e++}else if(e=t,e==X||r)return n[0];return zt.call(n,0,$t(Tt(0,e),u))}}function P(n,t){for(var r=-1,e=n?n.length:0,u=[];++r<e;){var o=n[r];Ut(o)?St.apply(u,t?o:P(o)):u.push(o)}return u}function U(n,t,r){if(typeof r=="number"){var e=n?n.length:0;
r=0>r?Tt(0,e+r):r||0}else if(r)return r=W(n,t),n[r]===t?r:-1;return n?u(n,t,r):-1}function V(n,t,r){if(typeof t!="number"&&t!=X){var e=0,u=-1,o=n?n.length:0;for(t=J(t,r);++u<o&&t(n[u],u,n);)e++}else e=t==X||r?1:Tt(0,t);return zt.call(n,e)}function W(n,t,r,e){var u=0,o=n?n.length:u;for(r=r?J(r,e,1):K,t=r(t);u<o;)e=u+o>>>1,r(n[e])<t?u=e+1:o=e;return u}function G(n,t,r,e){var u=-1,o=v(),i=n?n.length:0,a=[],f=a;for(typeof t!="boolean"&&t!=X&&(e=r,r=t,t=Y),r!=X&&(f=[],r=J(r,e));++u<i;){e=n[u];var c=r?r(e,u,n):e;
(t?!u||f[f.length-1]!==c:0>o(f,c))&&(r&&f.push(c),a.push(e))}return a}function H(n,t){return Pt.fastBind||Bt&&2<arguments.length?Bt.call.apply(Bt,arguments):l(n,t,zt.call(arguments,2))}function J(n,t,r){if(n==X)return K;var e=typeof n;if("function"!=e){if("object"!=e)return function(t){return t[n]};var u=Vt(n);return function(t){for(var r=u.length,e=Y;r--&&(e=t[u[r]]===n[u[r]]););return e}}return typeof t=="undefined"?n:1===r?function(r){return n.call(t,r)}:2===r?function(r,e){return n.call(t,r,e)
}:4===r?function(r,e,u,o){return n.call(t,r,e,u,o)}:function(r,e,u){return n.call(t,r,e,u)}}function K(n){return n}function L(n){F(_(n),function(t){var r=f[t]=n[t];f.prototype[t]=function(){var n=[this.__wrapped__];return St.apply(n,arguments),n=r.apply(f,n),this.__chain__&&(n=new c(n),n.__chain__=Q),n}})}var Q=!0,X=null,Y=!1,Z=0,nt={},tt=+new Date+"",rt=/&(?:amp|lt|gt|quot|#39);/g,et=/($^)/,ut=/[&<>"']/g,ot=/['\n\r\t\u2028\u2029\\]/g,it="[object Arguments]",at="[object Array]",ft="[object Boolean]",ct="[object Date]",lt="[object Number]",pt="[object Object]",st="[object RegExp]",vt="[object String]",gt={"boolean":Y,"function":Q,object:Q,number:Y,string:Y,undefined:Y},ht={"\\":"\\","'":"'","\n":"n","\r":"r","\t":"t","\u2028":"u2028","\u2029":"u2029"},yt=gt[typeof exports]&&exports,mt=gt[typeof module]&&module&&module.exports==yt&&module,_t=gt[typeof global]&&global;
!_t||_t.global!==_t&&_t.window!==_t||(n=_t);var dt=[],_t=Object.prototype,bt=n._,jt=RegExp("^"+(_t.valueOf+"").replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),wt=Math.ceil,At=n.clearTimeout,xt=dt.concat,Ot=Math.floor,Et=_t.hasOwnProperty,St=dt.push,Nt=n.setTimeout,kt=_t.toString,Bt=jt.test(Bt=kt.bind)&&Bt,Ft=jt.test(Ft=Object.create)&&Ft,qt=jt.test(qt=Array.isArray)&&qt,Rt=n.isFinite,Dt=n.isNaN,Mt=jt.test(Mt=Object.keys)&&Mt,Tt=Math.max,$t=Math.min,It=Math.random,zt=dt.slice,_t=jt.test(n.attachEvent),Ct=Bt&&!/\n|true/.test(Bt+_t);
c.prototype=f.prototype;var Pt={};!function(){var n={0:1,length:1};Pt.fastBind=Bt&&!Ct,Pt.spliceObjects=(dt.splice.call(n,0,1),!n[0])}(1),f.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,variable:""},Ft||(p=function(n){if(A(n)){a.prototype=n;var t=new a;a.prototype=X}return t||{}}),h(arguments)||(h=function(n){return n?Et.call(n,"callee"):Y});var Ut=qt||function(n){return n?typeof n=="object"&&kt.call(n)==at:Y},Vt=Mt?function(n){return A(n)?Mt(n):[]
}:e,Wt={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Gt=d(Wt);w(/x/)&&(w=function(n){return typeof n=="function"&&"[object Function]"==kt.call(n)}),f.after=function(n,t){return 1>n?t():function(){return 1>--n?t.apply(this,arguments):void 0}},f.bind=H,f.bindAll=function(n){for(var t=1<arguments.length?xt.apply(dt,zt.call(arguments,1)):_(n),r=-1,e=t.length;++r<e;){var u=t[r];n[u]=H(n[u],n)}return n},f.compact=function(n){for(var t=-1,r=n?n.length:0,e=[];++t<r;){var u=n[t];u&&e.push(u)
}return e},f.compose=function(){var n=arguments;return function(){for(var t=arguments,r=n.length;r--;)t=[n[r].apply(this,t)];return t[0]}},f.countBy=function(n,t,r){var e={};return t=J(t,r),F(n,function(n,r,u){r=t(n,r,u)+"",Et.call(e,r)?e[r]++:e[r]=1}),e},f.debounce=function(n,t,r){function e(){a=X,r||(o=n.apply(i,u))}var u,o,i,a=X;return function(){var f=r&&!a;return u=arguments,i=this,At(a),a=Nt(e,t),f&&(o=n.apply(i,u)),o}},f.defaults=m,f.defer=function(n){var t=zt.call(arguments,1);return Nt(function(){n.apply(void 0,t)
},1)},f.delay=function(n,t){var r=zt.call(arguments,2);return Nt(function(){n.apply(void 0,r)},t)},f.difference=z,f.filter=k,f.flatten=P,f.forEach=F,f.functions=_,f.groupBy=function(n,t,r){var e={};return t=J(t,r),F(n,function(n,r,u){r=t(n,r,u)+"",(Et.call(e,r)?e[r]:e[r]=[]).push(n)}),e},f.initial=function(n,t,r){if(!n)return[];var e=0,u=n.length;if(typeof t!="number"&&t!=X){var o=u;for(t=J(t,r);o--&&t(n[o],o,n);)e++}else e=t==X||r?1:t||e;return zt.call(n,0,$t(Tt(0,u-e),u))},f.intersection=function(n){var t=arguments,r=t.length,e=-1,u=v(),o=n?n.length:0,i=[];
n:for(;++e<o;){var a=n[e];if(0>u(i,a)){for(var f=r;--f;)if(0>u(t[f],a))continue n;i.push(a)}}return i},f.invert=d,f.invoke=function(n,t){var r=zt.call(arguments,2),e=-1,u=typeof t=="function",o=n?n.length:0,i=Array(typeof o=="number"?o:0);return F(n,function(n){i[++e]=(u?t:n[t]).apply(n,r)}),i},f.keys=Vt,f.map=q,f.max=R,f.memoize=function(n,t){var r={};return function(){var e=tt+(t?t.apply(this,arguments):arguments[0]);return Et.call(r,e)?r[e]:r[e]=n.apply(this,arguments)}},f.min=function(n,t,r){var e=1/0,u=e,o=-1,i=n?n.length:0;
if(t||typeof i!="number")t=J(t,r),F(n,function(n,r,o){r=t(n,r,o),r<e&&(e=r,u=n)});else for(;++o<i;)r=n[o],r<u&&(u=r);return u},f.omit=function(n){var t=v(),e=xt.apply(dt,zt.call(arguments,1)),u={};return r(n,function(n,r){0>t(e,r)&&(u[r]=n)}),u},f.once=function(n){var t,r;return function(){return t?r:(t=Q,r=n.apply(this,arguments),n=X,r)}},f.pairs=function(n){for(var t=-1,r=Vt(n),e=r.length,u=Array(e);++t<e;){var o=r[t];u[t]=[o,n[o]]}return u},f.partial=function(n){return l(n,zt.call(arguments,1))
},f.pick=function(n){for(var t=-1,r=xt.apply(dt,zt.call(arguments,1)),e=r.length,u={};++t<e;){var o=r[t];o in n&&(u[o]=n[o])}return u},f.pluck=D,f.range=function(n,t,r){n=+n||0,r=+r||1,t==X&&(t=n,n=0);var e=-1;t=Tt(0,wt((t-n)/r));for(var u=Array(t);++e<t;)u[e]=n,n+=r;return u},f.reject=function(n,t,r){return t=J(t,r),k(n,function(n,r,e){return!t(n,r,e)})},f.rest=V,f.shuffle=function(n){var t=-1,r=n?n.length:0,e=Array(typeof r=="number"?r:0);return F(n,function(n){var r=Ot(It()*(++t+1));e[t]=e[r],e[r]=n
}),e},f.sortBy=function(n,t,r){var e=-1,u=n?n.length:0,i=Array(typeof u=="number"?u:0);for(t=J(t,r),F(n,function(n,r,u){i[++e]={l:t(n,r,u),m:e,n:n}}),u=i.length,i.sort(o);u--;)i[u]=i[u].n;return i},f.tap=function(n,t){return t(n),n},f.throttle=function(n,t){function r(){i=new Date,a=X,u=n.apply(o,e)}var e,u,o,i=0,a=X;return function(){var f=new Date,c=t-(f-i);return e=arguments,o=this,0<c?a||(a=Nt(r,c)):(At(a),a=X,i=f,u=n.apply(o,e)),u}},f.times=function(n,t,r){for(var e=-1,u=Array(-1<n?n:0);++e<n;)u[e]=t.call(r,e);
return u},f.toArray=function(n){return Ut(n)?zt.call(n):n&&typeof n.length=="number"?q(n):E(n)},f.union=function(n){return Ut(n)||(arguments[0]=n?zt.call(n):dt),G(xt.apply(dt,arguments))},f.uniq=G,f.values=E,f.where=I,f.without=function(n){return z(n,zt.call(arguments,1))},f.wrap=function(n,t){return function(){var r=[n];return St.apply(r,arguments),t.apply(this,r)}},f.zip=function(n){for(var t=-1,r=n?R(D(arguments,"length")):0,e=Array(0>r?0:r);++t<r;)e[t]=D(arguments,t);return e},f.collect=q,f.drop=V,f.each=F,f.extend=y,f.methods=_,f.object=function(n,t){for(var r=-1,e=n?n.length:0,u={};++r<e;){var o=n[r];
t?u[o]=t[r]:u[o[0]]=o[1]}return u},f.select=k,f.tail=V,f.unique=G,f.chain=function(n){return n=new c(n),n.__chain__=Q,n},f.clone=function(n){return A(n)?Ut(n)?zt.call(n):y({},n):n},f.contains=S,f.escape=function(n){return n==X?"":(n+"").replace(ut,s)},f.every=N,f.find=B,f.has=function(n,t){return n?Et.call(n,t):Y},f.identity=K,f.indexOf=U,f.isArguments=h,f.isArray=Ut,f.isBoolean=function(n){return n===Q||n===Y||kt.call(n)==ft},f.isDate=function(n){return n?typeof n=="object"&&kt.call(n)==ct:Y},f.isElement=function(n){return n?1===n.nodeType:Y
},f.isEmpty=b,f.isEqual=j,f.isFinite=function(n){return Rt(n)&&!Dt(parseFloat(n))},f.isFunction=w,f.isNaN=function(n){return x(n)&&n!=+n},f.isNull=function(n){return n===X},f.isNumber=x,f.isObject=A,f.isRegExp=function(n){return!(!n||!gt[typeof n])&&kt.call(n)==st},f.isString=O,f.isUndefined=function(n){return typeof n=="undefined"},f.lastIndexOf=function(n,t,r){var e=n?n.length:0;for(typeof r=="number"&&(e=(0>r?Tt(0,e+r):$t(r,e-1))+1);e--;)if(n[e]===t)return e;return-1},f.mixin=L,f.noConflict=function(){return n._=bt,this
},f.random=function(n,t){n==X&&t==X&&(t=1),n=+n||0,t==X?(t=n,n=0):t=+t||0;var r=It();return n%1||t%1?n+$t(r*(t-n+parseFloat("1e-"+((r+"").length-1))),t):n+Ot(r*(t-n+1))},f.reduce=M,f.reduceRight=T,f.result=function(n,t){var r=n?n[t]:X;return w(r)?n[t]():r},f.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:Vt(n).length},f.some=$,f.sortedIndex=W,f.template=function(n,t,r){var e=f.templateSettings;n||(n=""),r=m({},r,e);var u=0,o="__p+='",e=r.variable;n.replace(RegExp((r.escape||et).source+"|"+(r.interpolate||et).source+"|"+(r.evaluate||et).source+"|$","g"),function(t,r,e,a,f){return o+=n.slice(u,f).replace(ot,i),r&&(o+="'+_['escape']("+r+")+'"),a&&(o+="';"+a+";__p+='"),e&&(o+="'+((__t=("+e+"))==null?'':__t)+'"),u=f+t.length,t
}),o+="';\n",e||(e="obj",o="with("+e+"||{}){"+o+"}"),o="function("+e+"){var __t,__p='',__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}"+o+"return __p}";try{var a=Function("_","return "+o)(f)}catch(c){throw c.source=o,c}return t?a(t):(a.source=o,a)},f.unescape=function(n){return n==X?"":(n+"").replace(rt,g)},f.uniqueId=function(n){var t=++Z+"";return n?n+t:t},f.all=N,f.any=$,f.detect=B,f.findWhere=function(n,t){return I(n,t,Q)},f.foldl=M,f.foldr=T,f.include=S,f.inject=M,f.first=C,f.last=function(n,t,r){if(n){var e=0,u=n.length;
if(typeof t!="number"&&t!=X){var o=u;for(t=J(t,r);o--&&t(n[o],o,n);)e++}else if(e=t,e==X||r)return n[u-1];return zt.call(n,Tt(0,u-e))}},f.take=C,f.head=C,f.VERSION="1.3.0",L(f),f.prototype.chain=function(){return this.__chain__=Q,this},f.prototype.value=function(){return this.__wrapped__},F("pop push reverse shift sort splice unshift".split(" "),function(n){var t=dt[n];f.prototype[n]=function(){var n=this.__wrapped__;return t.apply(n,arguments),!Pt.spliceObjects&&0===n.length&&delete n[0],this}}),F(["concat","join","slice"],function(n){var t=dt[n];
f.prototype[n]=function(){var n=t.apply(this.__wrapped__,arguments);return this.__chain__&&(n=new c(n),n.__chain__=Q),n}}),typeof define=="function"&&typeof define.amd=="object"&&define.amd?(n._=f, define(function(){return f})):yt&&!yt.nodeType?mt?(mt.exports=f)._=f:yt._=f:n._=f}(this);

File diff suppressed because it is too large Load Diff

View File

@@ -21,9 +21,9 @@
// generate Markdown
$markdown = docdown(array(
'path' => '../' . $file,
'title' => 'Lo-Dash <sup>v1.2.1</sup>',
'title' => 'Lo-Dash <sup>v1.3.0</sup>',
'toc' => 'categories',
'url' => 'https://github.com/lodash/lodash/blob/1.2.1/lodash.js'
'url' => 'https://github.com/lodash/lodash/blob/1.3.0/lodash.js'
));
// save to a .md file

1231
lodash.js

File diff suppressed because it is too large Load Diff

View File

@@ -1,8 +1,8 @@
{
"name": "lodash",
"version": "1.2.1",
"version": "1.3.0",
"description": "A low-level utility library delivering consistency, customization, performance, and extra features.",
"homepage": "http://lodash.com",
"homepage": "http://lodash.com/",
"license": "MIT",
"main": "./dist/lodash.js",
"keywords": [
@@ -35,5 +35,28 @@
],
"jam": {
"main": "./dist/lodash.compat.js"
},
"volo": {
"type": "directory",
"ignore": [
".*",
"*.custom.*",
"*.template.*",
"*.d.ts",
"*.map",
"*.md",
"*.txt",
"build.js",
"lodash.js",
"index.js",
"bower.json",
"component.json",
"build",
"doc",
"node_modules",
"perf",
"test",
"vendor"
]
}
}

View File

@@ -775,6 +775,18 @@
)
);
suites.push(
Benchmark.Suite('`_.difference` iterating 75 elements')
.add(buildName, {
'fn': 'lodash.difference(seventyFiveValues, seventyFiveValues2)',
'teardown': 'function multiArrays(){}'
})
.add(otherName, {
'fn': '_.difference(seventyFiveValues, seventyFiveValues2)',
'teardown': 'function multiArrays(){}'
})
);
suites.push(
Benchmark.Suite('`_.difference` iterating 200 elements')
.add(buildName, {
@@ -1076,6 +1088,18 @@
)
);
suites.push(
Benchmark.Suite('`_.intersection` iterating 75 elements')
.add(buildName, {
'fn': 'lodash.intersection(seventyFiveValues, seventyFiveValues2)',
'teardown': 'function multiArrays(){}'
})
.add(otherName, {
'fn': '_.intersection(seventyFiveValues, seventyFiveValues2)',
'teardown': 'function multiArrays(){}'
})
);
suites.push(
Benchmark.Suite('`_.intersection` iterating 200 elements')
.add(buildName, {
@@ -1731,11 +1755,23 @@
suites.push(
Benchmark.Suite('`_.union` iterating an array of 75 elements')
.add(buildName, {
'fn': 'lodash.union(fiftyValues, twentyFiveValues2)',
'fn': 'lodash.union(twentyFiveValues, fiftyValues2)',
'teardown': 'function multiArrays(){}'
})
.add(otherName, {
'fn': '_.union(fiftyValues, twentyFiveValues2)',
'fn': '_.union(twentyFiveValues, fiftyValues2)',
'teardown': 'function multiArrays(){}'
})
);
suites.push(
Benchmark.Suite('`_.union` iterating an array of 200 elements')
.add(buildName, {
'fn': 'lodash.union(oneHundredValues, oneHundredValues2)',
'teardown': 'function multiArrays(){}'
})
.add(otherName, {
'fn': '_.union(oneHundredValues, oneHundredValues2)',
'teardown': 'function multiArrays(){}'
})
);
@@ -1766,6 +1802,18 @@
)
);
suites.push(
Benchmark.Suite('`_.uniq` iterating an array of 75 elements')
.add(buildName, {
'fn': 'lodash.uniq(twentyFiveValues.concat(fiftyValues2))',
'teardown': 'function multiArrays(){}'
})
.add(otherName, {
'fn': '_.uniq(twentyFiveValues.concat(fiftyValues2))',
'teardown': 'function multiArrays(){}'
})
);
suites.push(
Benchmark.Suite('`_.uniq` iterating an array of 200 elements')
.add(buildName, {

View File

@@ -33,13 +33,6 @@
'debounce': lodash.debounce,
'defer': lodash.defer
});
if (!_.chain) {
_.mixin({
'chain': function(value) {
return new _(value);
}
});
}
</script>
<script src="../vendor/backbone/backbone.js"></script>
<script src="../vendor/backbone/test/environment.js"></script>

0
test/run-test.sh Executable file → Normal file
View File

View File

@@ -1 +1 @@
Hello {{ name }}!
Hallå {{ name }}!

View File

@@ -6,7 +6,7 @@
var vm = require('vm');
/** Load other modules */
var _ = require('../lodash.js'),
var _ = require('../dist/lodash.js'),
build = require('../build.js'),
minify = require('../build/minify.js'),
util = require('../build/util.js');
@@ -89,13 +89,13 @@
'zipObject': ['object']
};
/** List of all Lo-Dash methods */
var lodashMethods = _.functions(_).filter(function(methodName) {
/** List of all methods */
var allMethods = _.functions(_).filter(function(methodName) {
return !/^_/.test(methodName);
});
/** List of all methods */
var allMethods = lodashMethods.concat('chain', 'findWhere');
/** List of all Lo-Dash methods */
var lodashMethods = _.without(allMethods, 'findWhere');
/** List of "Arrays" category methods */
var arraysMethods = [
@@ -225,6 +225,7 @@
'omit',
'pairs',
'pick',
'transform',
'values'
];
@@ -316,6 +317,7 @@
'parseInt',
'partialRight',
'runInContext',
'transform',
'unzip'
];
@@ -332,7 +334,7 @@
* @returns {String} Returns the capitalized string.
*/
function capitalize(string) {
return string[0].toUpperCase() + string.toLowerCase().slice(1);
return string[0].toUpperCase() + string.slice(1);
}
/**
@@ -461,7 +463,7 @@
func(array, 'slice');
func(object, 'toFixed');
}
else if (methodName == 'where') {
else if (methodName == 'findWhere' || methodName == 'where') {
func(array, object);
func(object, object);
}
@@ -650,7 +652,7 @@
vm.runInContext(data.source, context);
equal(moduleId, expectedId, basename);
equal(_.templates.d(object.d), 'Hello Mustache!', basename);
equal(_.templates.d(object.d), 'Hallå Mustache!', basename);
delete _.templates;
start();
});
@@ -1054,7 +1056,7 @@
];
commands.forEach(function(command, index) {
asyncTest('`lodash ' + command +'`', function() {
asyncTest('`lodash underscore ' + command +'`', function() {
var start = _.after(2, _.once(QUnit.start));
build(['-s', 'underscore', command], function(data) {
@@ -1127,6 +1129,80 @@
/*--------------------------------------------------------------------------*/
QUnit.module('exclude command');
(function() {
var commands = [
'exclude',
'minus'
];
commands.forEach(function(command) {
asyncTest('`lodash ' + command + '=runInContext`', function() {
var start = _.after(2, _.once(QUnit.start));
build(['-s', command + '=runInContext'], function(data) {
var basename = path.basename(data.outputPath, '.js'),
context = createContext(),
source = data.source;
vm.runInContext(data.source, context);
var lodash = context._,
array = [0];
var actual = lodash.map(array, function() {
return String(this[0]);
}, array);
deepEqual(actual, ['0'], basename);
equal('runInContext' in lodash, false, basename);
start();
});
});
asyncTest('`lodash ' + command + '=mixin`', function() {
var start = _.after(2, _.once(QUnit.start));
build(['-s', command + '=mixin'], function(data) {
var basename = path.basename(data.outputPath, '.js'),
context = createContext(),
source = data.source;
vm.runInContext(data.source, context);
var lodash = context._;
var actual = lodash([1, 2, 3])
.map(function(num) { return num * num; })
.value();
deepEqual(actual, [1, 4, 9], basename);
equal('mixin' in lodash, false, basename);
start();
});
});
asyncTest('`lodash ' + command + '=value`', function() {
var start = _.after(2, _.once(QUnit.start));
build(['-s', command + '=value'], function(data) {
var basename = path.basename(data.outputPath, '.js'),
context = createContext(),
source = data.source;
vm.runInContext(data.source, context);
var lodash = context._;
strictEqual(lodash([1]), undefined, basename);
deepEqual(_.keys(lodash.prototype), [], basename);
start();
});
});
});
}());
/*--------------------------------------------------------------------------*/
QUnit.module('exports command');
(function() {
@@ -1265,37 +1341,6 @@
/*--------------------------------------------------------------------------*/
QUnit.module('commands with findWhere');
(function() {
var commands = [
'underscore include=findWhere',
'modern include=findWhere',
'plus=findWhere'
];
commands.forEach(function(command) {
asyncTest('`lodash ' + command + '`', function() {
var start = _.after(2, _.once(QUnit.start));
build(['-s'].concat(command.split(' ')), function(data) {
var basename = path.basename(data.outputPath, '.js'),
context = createContext();
vm.runInContext(data.source, context);
var lodash = context._;
var collection = [{ 'a': 1 }, { 'a': 1 }];
deepEqual(lodash.findWhere(collection, { 'a': 1 }), collection[0], '_.findWhere: ' + basename);
start();
});
});
});
}());
/*--------------------------------------------------------------------------*/
QUnit.module('no-dep option');
(function() {
@@ -1334,7 +1379,8 @@
'--output b.js',
'-o ' + path.join('a', 'b', 'c.js'),
'-o ' + relativePrefix + path.join('a', 'b', 'c.js'),
'-o ' + path.join(nestedPath, 'c.js')
'-o ' + path.join(nestedPath, 'c.js'),
'-o name_with_keywords_like_category_include_exclude_plus_minus.js'
];
commands.forEach(function(command) {
@@ -1386,6 +1432,8 @@
build(['exports=', 'include='].concat(command.split(' ')), function(data) {
process.stdout.write = write;
strictEqual('outputPath' in data, false);
equal(written, data.source);
equal(arguments.length, 1);
start();
@@ -1396,6 +1444,111 @@
/*--------------------------------------------------------------------------*/
QUnit.module('underscore builds with lodash methods');
(function() {
var methodNames = [
'assign',
'bindKey',
'clone',
'contains',
'debouce',
'defaults',
'defer',
'difference',
'every',
'filter',
'find',
'findWhere',
'first',
'flatten',
'forEach',
'forOwn',
'intersection',
'initial',
'isEmpty',
'isEqual',
'isPlainObject',
'isRegExp',
'last',
'map',
'max',
'memoize',
'min',
'omit',
'partial',
'partialRight',
'pick',
'pluck',
'reduce',
'reduceRight',
'result',
'rest',
'some',
'tap',
'template',
'throttle',
'times',
'toArray',
'transform',
'uniq',
'uniqueId',
'value',
'where',
'zip'
];
function strip(value) {
return String(value)
.replace(/^ *\/\/.*/gm, '')
.replace(/\b(?:basicEach|context|forEach|forOwn|window)\b/g, '')
.replace(/\blodash\.(createCallback\()\b/g, '$1')
.replace(/[\s;]/g, '');
}
methodNames.forEach(function(methodName) {
var command = 'underscore plus=' + methodName;
if (methodName == 'createCallback') {
command += ',where';
}
if (methodName == 'zip') {
command += ',unzip';
}
if (methodName != 'chain' && _.contains(chainingMethods.concat('mixin'), methodName)) {
command += ',chain';
}
if (_.contains(['isEqual', 'isPlainObject'], methodName)) {
command += ',forIn';
}
if (_.contains(['contains', 'every', 'find', 'some', 'transform'], methodName)) {
command += ',forOwn';
}
asyncTest('`lodash ' + command +'`', function() {
var start = _.after(2, _.once(QUnit.start));
build(['-s'].concat(command.split(' ')), function(data) {
var array = [{ 'value': 1 }],
basename = path.basename(data.outputPath, '.js'),
context = createContext();
vm.runInContext(data.source, context, true);
var lodash = context._;
if (methodName == 'chain' || methodName == 'findWhere' || (methodName == 'defer' && global.setImmediate)) {
notEqual(strip(lodash[methodName]), strip(_[methodName]), basename);
} else if (!/\.min$/.test(basename)) {
equal(strip(lodash[methodName]), strip(_[methodName]), basename);
}
testMethod(lodash, methodName, basename);
start();
});
});
});
}());
/*--------------------------------------------------------------------------*/
QUnit.module('lodash build');
(function() {
@@ -1435,19 +1588,19 @@
var command = origCommand;
if (index == 1) {
if (/legacy|mobile/.test(command)) {
if (/\b(?:legacy|mobile)\b/.test(command)) {
return;
}
command = 'mobile ' + command;
}
else if (index == 2) {
if (/legacy|modern/.test(command)) {
if (/\b(?:legacy|modern)\b/.test(command)) {
return;
}
command = 'modern ' + command;
}
else if (index == 3) {
if (/category|legacy|underscore/.test(command)) {
if (/\b(?:category|legacy|underscore)\b/.test(command)) {
return;
}
command = 'underscore ' + command;
@@ -1459,8 +1612,8 @@
var methodNames,
basename = path.basename(data.outputPath, '.js'),
context = createContext(),
isBackbone = /backbone/.test(command),
isUnderscore = isBackbone || /underscore/.test(command),
isBackbone = /\bbackbone\b/.test(command),
isUnderscore = isBackbone || /\bunderscore\b/.test(command),
exposeAssign = !isUnderscore,
exposeZipObject = !isUnderscore;
@@ -1470,11 +1623,11 @@
console.log(e);
}
// add method names explicitly
if (/include/.test(command)) {
methodNames = command.match(/include=(\S*)/)[1].split(/, */);
if (/\binclude=/.test(command)) {
methodNames = command.match(/\binclude=(\S*)/)[1].split(/, */);
}
// add method names required by Backbone and Underscore builds
if (/backbone/.test(command) && !methodNames) {
if (/\bbackbone\b/.test(command) && !methodNames) {
methodNames = backboneDependencies.slice();
}
if (isUnderscore) {
@@ -1485,20 +1638,22 @@
methodNames = underscoreMethods.slice();
}
}
if (/category/.test(command)) {
methodNames = (methodNames || []).concat(command.match(/category=(\S*)/)[1].split(/, */).map(capitalize));
if (/\bcategory=/.test(command)) {
methodNames = (methodNames || []).concat(command.match(/\bcategory=(\S*)/)[1].split(/, */).map(function(category) {
return capitalize(category.toLowerCase());
}));
}
if (!methodNames) {
methodNames = lodashMethods.slice();
}
if (/plus/.test(command)) {
methodNames = methodNames.concat(command.match(/plus=(\S*)/)[1].split(/, */));
if (/\bplus=/.test(command)) {
methodNames = methodNames.concat(command.match(/\bplus=(\S*)/)[1].split(/, */));
}
if (/minus/.test(command)) {
methodNames = _.without.apply(_, [methodNames].concat(expandMethodNames(command.match(/minus=(\S*)/)[1].split(/, */))));
if (/\bminus=/.test(command)) {
methodNames = _.without.apply(_, [methodNames].concat(expandMethodNames(command.match(/\bminus=(\S*)/)[1].split(/, */))));
}
if (/exclude/.test(command)) {
methodNames = _.without.apply(_, [methodNames].concat(expandMethodNames(command.match(/exclude=(\S*)/)[1].split(/, */))));
if (/\bexclude=/.test(command)) {
methodNames = _.without.apply(_, [methodNames].concat(expandMethodNames(command.match(/\bexclude=(\S*)/)[1].split(/, */))));
}
// expand categories to real method names

View File

@@ -72,6 +72,9 @@
undefined
];
/** Used as the size when optimizations are enabled for large arrays */
var largeArraySize = 75;
/** Used to set property descriptors */
var setDescriptor = (function() {
try {
@@ -338,6 +341,23 @@
});
}());
/*--------------------------------------------------------------------------*/
QUnit.module('lodash.chain');
(function() {
test('should return a wrapped value', function() {
var actual = _.chain({ 'a': 0 });
ok(actual instanceof _);
});
test('should return the existing wrapper when chaining', function() {
var wrapper = _({ 'a': 0 });
equal(wrapper.chain(), wrapper);
});
}());
/*--------------------------------------------------------------------------*/
QUnit.module('cloning');
@@ -392,11 +412,11 @@
});
});
test('should shallow clone when used as `callback` for `_.map`', function() {
test('should perform a shallow clone when used as `callback` for `_.map`', function() {
var expected = [{ 'a': [0] }, { 'b': [1] }],
actual = _.map(expected, _.clone);
ok(actual != expected && actual.a == expected.a && actual.b == expected.b);
ok(actual[0] != expected[0] && actual[0].a === expected[0].a && actual[1].b === expected[1].b);
});
test('should deep clone `index` and `input` array properties', function() {
@@ -558,14 +578,19 @@
});
asyncTest('should work with `leading` option', function() {
var counts = [0, 0, 0];
var withLeadingAndTrailing,
counts = [0, 0, 0];
_.each([true, { 'leading': true }], function(options, index) {
var withLeading = _.debounce(function(value) {
var debounced = _.debounce(function(value) {
counts[index]++;
return value;
}, 32, options);
equal(withLeading('x'), 'x');
if (index == 1) {
withLeadingAndTrailing = debounced;
}
equal(debounced('x'), 'x');
});
_.times(2, _.debounce(function() { counts[2]++; }, 32, { 'leading': true }));
@@ -578,6 +603,10 @@
setTimeout(function() {
deepEqual(counts, [1, 1, 2]);
withLeadingAndTrailing('x');
equal(counts[1], 2);
QUnit.start();
}, 64);
});
@@ -605,6 +634,34 @@
QUnit.start();
}, 64);
});
asyncTest('should work with `maxWait` option', function() {
var limit = 96,
withCount = 0,
withoutCount = 0;
var withMaxWait = _.debounce(function() {
withCount++;
}, 32, { 'maxWait': 64 });
var withoutMaxWait = _.debounce(function() {
withoutCount++;
}, 32);
var start = new Date;
while ((new Date - start) < limit) {
withMaxWait();
withoutMaxWait();
}
strictEqual(withCount, 1);
strictEqual(withoutCount, 0);
setTimeout(function() {
strictEqual(withCount, 2);
strictEqual(withoutCount, 1);
QUnit.start();
}, 64);
});
}());
/*--------------------------------------------------------------------------*/
@@ -697,19 +754,21 @@
deepEqual(func({}, new Foo), {});
});
test('lodash.' + methodName + ' should treat sparse arrays as dense', function() {
var array = Array(3);
array[0] = 1;
array[2] = 3;
if (methodName == 'merge') {
test('lodash.' + methodName + ' should treat sparse arrays as dense', function() {
var array = Array(3);
array[0] = 1;
array[2] = 3;
var actual = func([], array),
expected = array.slice();
var actual = func([], array),
expected = array.slice();
expected[1] = undefined;
expected[1] = undefined;
ok(1 in actual);
deepEqual(actual, expected);
});
ok(1 in actual);
deepEqual(actual, expected);
});
}
});
/*--------------------------------------------------------------------------*/
@@ -832,7 +891,7 @@
deepEqual(args, [1, 0, array]);
});
test('supports the `thisArg` argument', function() {
test('should support the `thisArg` argument', function() {
var actual = _.first(array, function(value, index) {
return this[index] < 3;
}, array);
@@ -905,7 +964,7 @@
deepEqual(args, [{ 'a': [1, [2]] }, 0, array]);
});
test('supports the `thisArg` argument', function() {
test('should support the `thisArg` argument', function() {
var actual = _.flatten(array, function(value, index) {
return this[index].a;
}, array);
@@ -917,6 +976,13 @@
deepEqual(_.flatten(array, 'a'), [1, 2, 3]);
});
test('should perform a deep flatten when used as `callback` for `_.map`', function() {
var array = [[[['a']]], [[['b']]]],
actual = _.map(array, _.flatten);
deepEqual(actual, [['a'], ['b']]);
});
test('should treat sparse arrays as dense', function() {
var array = [[1, 2, 3], Array(3)],
expected = [1, 2, 3],
@@ -948,7 +1014,7 @@
equal(wrapper.forEach(Boolean), wrapper);
});
test('supports the `thisArg` argument', function() {
test('should support the `thisArg` argument', function() {
var actual;
function callback(value, index) {
@@ -988,12 +1054,25 @@
(function() {
test('iterates over inherited properties', function() {
function Dog(name) { this.name = name; }
Dog.prototype.bark = function() { /* Woof, woof! */ };
function Foo() { this.a = 1; }
Foo.prototype.b = 2;
var keys = [];
_.forIn(new Dog('Dagny'), function(value, key) { keys.push(key); });
deepEqual(keys.sort(), ['bark', 'name']);
_.forIn(new Foo, function(value, key) { keys.push(key); });
deepEqual(keys.sort(), ['a', 'b']);
});
test('fixes the JScript [[DontEnum]] bug with inherited properties (test in IE < 9)', function() {
function Foo() {}
Foo.prototype = shadowedObject;
function Bar() {}
Bar.prototype = new Foo;
Bar.prototype.constructor = Bar;
var keys = [];
_.forIn(shadowedObject, function(value, key) { keys.push(key); });
deepEqual(keys.sort(), shadowedProps);
});
}());
@@ -1024,6 +1103,37 @@
deepEqual(keys.sort(), shadowedProps);
});
test('lodash.' + methodName + ' does not iterate over non-enumerable properties (test in IE < 9)', function() {
_.forOwn({
'Array': Array.prototype,
'Boolean': Boolean.prototype,
'Date': Date.prototype,
'Error': Error.prototype,
'Function': Function.prototype,
'Object': Object.prototype,
'Number': Number.prototype,
'TypeError': TypeError.prototype,
'RegExp': RegExp.prototype,
'String': String.prototype
},
function(object, builtin) {
var message = 'non-enumerable properties on ' + builtin + '.prototype',
props = [];
func(object, function(value, prop) {
props.push(prop);
});
if (/Error/.test(builtin)) {
ok(_.every(['constructor', 'toString'], function(prop) {
return !_.contains(props, prop);
}), message);
} else {
deepEqual(props, [], message);
}
});
});
test('lodash.' + methodName + ' skips the prototype property of functions (test in Firefox < 3.6, Opera > 9.50 - Opera < 11.60, and Safari < 5.1)', function() {
function Foo() {}
Foo.prototype.a = 1;
@@ -1173,7 +1283,7 @@
stringObject = Object(stringLiteral),
expected = [stringLiteral, stringObject];
var array = _.times(100, function(count) {
var array = _.times(largeArraySize, function(count) {
return count % 2 ? stringObject : stringLiteral;
});
@@ -1199,7 +1309,7 @@
QUnit.module('lodash.groupBy');
(function() {
test('supports the `thisArg` argument', function() {
test('should support the `thisArg` argument', function() {
var actual = _.groupBy([4.2, 6.1, 6.4], function(num) {
return this.floor(num);
}, Math);
@@ -1238,6 +1348,18 @@
/*--------------------------------------------------------------------------*/
QUnit.module('lodash.has');
(function() {
test('should return `false` for primitives', function() {
_.each(falsey.concat(1, 'a'), function(value) {
strictEqual(_.has(value, 'valueOf'), false);
});
});
}());
/*--------------------------------------------------------------------------*/
QUnit.module('lodash.indexOf');
(function() {
@@ -1274,6 +1396,68 @@
/*--------------------------------------------------------------------------*/
QUnit.module('custom `_.indexOf` methods');
(function() {
function custom(array, value, fromIndex) {
var index = (fromIndex || 0) - 1,
length = array.length;
while (++index < length) {
var other = array[index];
if (other === value ||
(_.isObject(value) && other instanceof Foo) ||
(other === 'x' && /[13]/.test(value))) {
return index;
}
}
return -1;
}
function Foo() {}
var array = [1, new Foo, 3, new Foo],
indexOf = _.indexOf;
test('_.contains should work with a custom `_.indexOf` method', function() {
_.indexOf = custom;
ok(_.contains(array, new Foo));
_.indexOf = indexOf;
});
test('_.difference should work with a custom `_.indexOf` method', function() {
_.indexOf = custom;
deepEqual(_.difference(array, [new Foo]), [1, 3]);
_.indexOf = indexOf;
});
test('_.intersection should work with a custom `_.indexOf` method', function() {
_.indexOf = custom;
deepEqual(_.intersection(array, [new Foo]), [array[1]]);
_.indexOf = indexOf;
});
test('_.omit should work with a custom `_.indexOf` method', function() {
_.indexOf = custom;
deepEqual(_.omit(array, ['x']), { '0': 1, '2': 3 });
_.indexOf = indexOf;
});
test('_.uniq should work with a custom `_.indexOf` method', function() {
_.indexOf = custom;
deepEqual(_.uniq(array), array.slice(0, 3));
var largeArray = _.times(largeArraySize, function() {
return new Foo;
});
deepEqual(_.uniq(largeArray), [largeArray[0]]);
_.indexOf = indexOf;
});
}());
/*--------------------------------------------------------------------------*/
QUnit.module('lodash.initial');
(function() {
@@ -1324,7 +1508,7 @@
deepEqual(args, [3, 2, array]);
});
test('supports the `thisArg` argument', function() {
test('should support the `thisArg` argument', function() {
var actual = _.initial(array, function(value, index) {
return this[index] > 1;
}, array);
@@ -1575,12 +1759,16 @@
}
});
test('should return `true` for empty objects', function() {
strictEqual(_.isPlainObject({}), true);
});
test('should return `false` for Object objects without a [[Class]] of "Object"', function() {
strictEqual(_.isPlainObject(arguments), false);
strictEqual(_.isPlainObject(Error), false);
strictEqual(_.isPlainObject(Math), false);
strictEqual(_.isPlainObject(window), false);
})
});
}());
/*--------------------------------------------------------------------------*/
@@ -1718,7 +1906,7 @@
deepEqual(args, [3, 2, array]);
});
test('supports the `thisArg` argument', function() {
test('should support the `thisArg` argument', function() {
var actual = _.last(array, function(value, index) {
return this[index] > 1;
}, array);
@@ -1844,6 +2032,33 @@
/*--------------------------------------------------------------------------*/
QUnit.module('lodash.max and lodash.min chaining');
_.each(['max', 'min'], function(methodName) {
test('lodash.' + methodName + ' should resolve the correct value when passed an array containing only one value', function() {
var actual = _([40])[methodName]().value();
strictEqual(actual, 40);
});
});
/*--------------------------------------------------------------------------*/
QUnit.module('lodash.memoize');
(function() {
test('should expose a `cache` object on the `memoized` function', function() {
var memoized = _.memoize(_.identity);
memoized('x');
var cache = memoized.cache,
key = _.keys(cache)[0];
equal(cache[key], 'x');
});
}());
/*--------------------------------------------------------------------------*/
QUnit.module('lodash.merge');
(function() {
@@ -2234,6 +2449,15 @@
test('should coerce arguments to numbers', function() {
strictEqual(_.random('1', '1'), 1);
});
test('should support floats', function() {
var min = 1.5,
max = 1.6,
actual = _.random(min, max);
ok(actual % 1);
ok(actual >= min && actual <= max);
});
}());
/*--------------------------------------------------------------------------*/
@@ -2537,7 +2761,7 @@
deepEqual(actual, collection);
});
test('supports the `thisArg` argument', function() {
test('should support the `thisArg` argument', function() {
var actual = _.sortBy([1, 2, 3], function(num) {
return this.sin(num);
}, Math);
@@ -2559,7 +2783,7 @@
QUnit.module('lodash.sortedIndex');
(function() {
test('supports the `thisArg` argument', function() {
test('should support the `thisArg` argument', function() {
var actual = _.sortedIndex([1, 2, 3], 4, function(num) {
return this.sin(num);
}, Math);
@@ -2974,6 +3198,67 @@
/*--------------------------------------------------------------------------*/
QUnit.module('lodash.transform');
(function() {
test('should produce an that is an instance of the given object\'s constructor', function() {
function Foo() {
this.a = 1;
this.b = 2;
this.c = 3;
}
var actual = _.transform(new Foo, function(result, value, key) {
result[key] = value * value;
});
ok(actual instanceof Foo);
deepEqual(_.clone(actual), { 'a': 1, 'b': 4, 'c': 9 });
});
test('should treat sparse arrays as dense', function() {
var actual = _.transform(Array(1), function(result, value, index) {
result[index] = String(value);
});
deepEqual(actual, ['undefined']);
});
_.each({
'array': [1, 2, 3],
'object': { 'a': 1, 'b': 2, 'c': 3 }
},
function(object, key) {
test('should pass the correct `callback` arguments when transforming an ' + key, function() {
var args;
_.transform(object, function() {
args || (args = slice.call(arguments));
});
var first = args[0];
if (key == 'array') {
ok(first != object && _.isArray(first));
deepEqual(args, [first, 1, 0, object]);
} else {
ok(first != object && _.isPlainObject(first));
deepEqual(args, [first, 1, 'a', object]);
}
});
test('should support the `thisArg` argument when transforming an ' + key, function() {
var actual = _.transform(object, function(result, value, key) {
result[key] = this[key];
}, null, object);
notEqual(actual, object);
deepEqual(actual, object);
});
});
}());
/*--------------------------------------------------------------------------*/
QUnit.module('lodash.unescape');
(function() {
@@ -3016,7 +3301,7 @@
QUnit.module('lodash.uniq');
(function() {
test('supports the `thisArg` argument', function() {
test('should support the `thisArg` argument', function() {
var actual = _.uniq([1, 2, 1.5, 3, 2.5], function(num) {
return this.floor(num);
}, Math);
@@ -3024,15 +3309,23 @@
deepEqual(actual, [1, 2, 3]);
});
test('should perform an unsorted uniq operation when used as `callback` for `_.map`', function() {
var array = [[2, 1, 2], [1, 2, 1]],
actual = _.map(array, _.uniq);
deepEqual(actual, [[2, 1], [1, 2]]);
});
test('should distinguish between numbers and numeric strings', function() {
var array = [],
expected = ['2', 2, Object('2'), Object(2)];
expected = ['2', 2, Object('2'), Object(2)],
count = Math.ceil(largeArraySize / expected.length);
_.times(50, function() {
_.times(count, function() {
array.push.apply(array, expected);
});
deepEqual(_.uniq(expected), expected);
deepEqual(_.uniq(array), expected);
});
_.each({

View File

@@ -34,7 +34,7 @@
push = arrayProto.push,
slice = arrayProto.slice;
if (_.chain) {
if (_.chain().__chain__) {
return;
}
_.mixin = function(object) {

View File

@@ -15,7 +15,7 @@ For a list of upcoming features, check out our [roadmap](https://github.com/best
## Support
Benchmark.js has been tested in at least Chrome 5~26, Firefox 2~20, IE 6-10, Opera 9.25-12, Safari 3-6, Node.js 0.4.8-0.10.5, Narwhal 0.3.2, PhantomJS 1.9.0, RingoJS 0.9, and Rhino 1.7RC5.
Benchmark.js has been tested in at least Chrome 5~27, Firefox 2~21, IE 6-10, Opera 9.25-12, Safari 3-6, Node.js 0.4.8-0.10.7, Narwhal 0.3.2, PhantomJS 1.9.0, RingoJS 0.9, and Rhino 1.7RC5.
## Installation and usage

View File

@@ -1675,7 +1675,7 @@
// start timer
't#.start(d#);' +
// execute `deferred.fn` and return a dummy object
'}d#.fn();return{}'
'}d#.fn();return{uid:"${uid}"}'
: 'var r#,s#,m#=this,f#=m#.fn,i#=m#.count,n#=t#.ns;${setup}\n${begin};' +
'while(i#--){${fn}\n}${end};${teardown}\nreturn{elapsed:r#,uid:"${uid}"}'

View File

@@ -58,7 +58,7 @@ class Entry {
* @returns {Array} The array of entries.
*/
public static function getEntries( $source ) {
preg_match_all('#/\*\*(?![-!])[\s\S]*?\*/\s*[^\n]+#', $source, $result);
preg_match_all('#/\*\*(?![-!])[\s\S]*?\*/\s*.+#', $source, $result);
return array_pop($result);
}
@@ -77,7 +77,7 @@ class Entry {
$this->isCtor() ||
count($this->getParams()) ||
count($this->getReturns()) ||
preg_match('/\* *@function\b/', $this->entry)
preg_match('/\*[\t ]*@function\b/', $this->entry)
);
}
return $this->_isFunction;
@@ -94,10 +94,10 @@ class Entry {
*/
public function getAliases( $index = null ) {
if (!isset($this->_aliases)) {
preg_match('#\* *@alias\s+([^\n]+)#', $this->entry, $result);
preg_match('#\*[\t ]*@alias\s+(.+)#', $this->entry, $result);
if (count($result)) {
$result = trim(preg_replace('/(?:^|\n)\s*\* ?/', ' ', $result[1]));
$result = trim(preg_replace('/(?:^|\n)[\t ]*\*[\t ]?/', ' ', $result[1]));
$result = preg_split('/,\s*/', $result);
natsort($result);
@@ -129,7 +129,7 @@ class Entry {
}
// resolve name
// avoid $this->getName() because it calls $this->getCall()
preg_match('#\* *@name\s+([^\n]+)#', $this->entry, $name);
preg_match('#\*[\t ]*@name\s+(.+)#', $this->entry, $name);
if (count($name)) {
$name = trim($name[1]);
} else {
@@ -163,9 +163,9 @@ class Entry {
return $this->_category;
}
preg_match('#\* *@category\s+([^\n]+)#', $this->entry, $result);
preg_match('#\*[\t ]*@category\s+(.+)#', $this->entry, $result);
if (count($result)) {
$result = trim(preg_replace('/(?:^|\n)\s*\* ?/', ' ', $result[1]));
$result = trim(preg_replace('/(?:^|\n)[\t ]*\*[\t ]?/', ' ', $result[1]));
} else {
$result = $this->getType() == 'Function' ? 'Methods' : 'Properties';
}
@@ -187,9 +187,9 @@ class Entry {
preg_match('#/\*\*(?:\s*\*)?([\s\S]*?)(?=\*\s\@[a-z]|\*/)#', $this->entry, $result);
if (count($result)) {
$type = $this->getType();
$result = preg_replace('/:\n *\* */', ":<br>\n", $result[1]);
$result = preg_replace('/(?:^|\n) *\*\n *\* */', "\n\n", $result);
$result = preg_replace('/(?:^|\n) *\* ?/', ' ', $result);
$result = preg_replace('/:\n[\t ]*\*[\t ]*/', ":<br>\n", $result[1]);
$result = preg_replace('/(?:^|\n)[\t ]*\*\n[\t ]*\*[\t ]*/', "\n\n", $result);
$result = preg_replace('/(?:^|\n)[\t ]*\*[\t ]?/', ' ', $result);
$result = trim($result);
$result = ($type == 'Function' ? '' : '(' . str_replace('|', ', ', trim($type, '{}')) . '): ') . $result;
}
@@ -208,9 +208,9 @@ class Entry {
return $this->_example;
}
preg_match('#\* *@example\s+([\s\S]*?)(?=\*\s\@[a-z]|\*/)#', $this->entry, $result);
preg_match('#\*[\t ]*@example\s+([\s\S]*?)(?=\*\s\@[a-z]|\*/)#', $this->entry, $result);
if (count($result)) {
$result = trim(preg_replace('/(?:^|\n)\s*\* ?/', "\n", $result[1]));
$result = trim(preg_replace('/(?:^|\n)[\t ]*\*[\t ]?/', "\n", $result[1]));
$result = '```' . $this->lang . "\n" . $result . "\n```";
}
$this->_example = $result;
@@ -235,7 +235,7 @@ class Entry {
*/
public function isCtor() {
if (!isset($this->_isCtor)) {
$this->_isCtor = !!preg_match('/\* *@constructor\b/', $this->entry);
$this->_isCtor = !!preg_match('/\*[\t ]*@constructor\b/', $this->entry);
}
return $this->_isCtor;
}
@@ -248,7 +248,7 @@ class Entry {
*/
public function isLicense() {
if (!isset($this->_isLicense)) {
$this->_isLicense = !!preg_match('/\* *@license\b/', $this->entry);
$this->_isLicense = !!preg_match('/\*[\t ]*@license\b/', $this->entry);
}
return $this->_isLicense;
}
@@ -274,7 +274,7 @@ class Entry {
*/
public function isPrivate() {
if (!isset($this->_isPrivate)) {
$this->_isPrivate = $this->isLicense() || !!preg_match('/\* *@private\b/', $this->entry) || !preg_match('/\* *@[a-z]+\b/', $this->entry);
$this->_isPrivate = $this->isLicense() || !!preg_match('/\*[\t ]*@private\b/', $this->entry) || !preg_match('/\*[\t ]*@[a-z]+\b/', $this->entry);
}
return $this->_isPrivate;
}
@@ -291,7 +291,7 @@ class Entry {
}
$public = !$this->isPrivate();
$result = $public && !!preg_match('/\* *@static\b/', $this->entry);
$result = $public && !!preg_match('/\*[\t ]*@static\b/', $this->entry);
// set in cases where it isn't explicitly stated
if ($public && !$result) {
@@ -334,9 +334,9 @@ class Entry {
*/
public function getMembers( $index = null ) {
if (!isset($this->_members)) {
preg_match('#\* *@member(?:Of)?\s+([^\n]+)#', $this->entry, $result);
preg_match('#\*[\t ]*@member(?:Of)?\s+(.+)#', $this->entry, $result);
if (count($result)) {
$result = trim(preg_replace('/(?:^|\n)\s*\* ?/', ' ', $result[1]));
$result = trim(preg_replace('/(?:^|\n)[\t ]*\*[\t ]?/', ' ', $result[1]));
$result = preg_split('/,\s*/', $result);
natsort($result);
}
@@ -358,9 +358,9 @@ class Entry {
return $this->_name;
}
preg_match('#\* *@name\s+([^\n]+)#', $this->entry, $result);
preg_match('#\*[\t ]*@name\s+(.+)#', $this->entry, $result);
if (count($result)) {
$result = trim(preg_replace('/(?:^|\n)\s*\* ?/', ' ', $result[1]));
$result = trim(preg_replace('/(?:^|\n)[\t ]*\*[\t ]?/', ' ', $result[1]));
} else {
$result = array_shift(explode('(', $this->getCall()));
}
@@ -377,7 +377,7 @@ class Entry {
*/
public function getParams( $index = null ) {
if (!isset($this->_params)) {
preg_match_all('#\* *@param\s+\{([^}]+)\}\s+(\[.+\]|[$\w|]+(?:\[.+\])?)\s+([\s\S]*?)(?=\*\s\@[a-z]|\*/)#i', $this->entry, $result);
preg_match_all('#\*[\t ]*@param\s+\{([^}]+)\}\s+(\[.+\]|[$\w|]+(?:\[.+\])?)\s+([\s\S]*?)(?=\*\s\@[a-z]|\*/)#i', $this->entry, $result);
if (count($result = array_filter(array_slice($result, 1)))) {
// repurpose array
foreach ($result as $param) {
@@ -385,7 +385,7 @@ class Entry {
if (!is_array($result[0][$key])) {
$result[0][$key] = array();
}
$result[0][$key][] = trim(preg_replace('/(?:^|\n)\s*\* */', ' ', $value));
$result[0][$key][] = trim(preg_replace('/(?:^|\n)[\t ]*\*[\t ]*/', ' ', $value));
}
}
$result = $result[0];
@@ -408,11 +408,11 @@ class Entry {
return $this->_returns;
}
preg_match('#\* *@returns\s+\{([^}]+)\}\s+([\s\S]*?)(?=\*\s\@[a-z]|\*/)#', $this->entry, $result);
preg_match('#\*[\t ]*@returns\s+\{([^}]+)\}\s+([\s\S]*?)(?=\*\s\@[a-z]|\*/)#', $this->entry, $result);
if (count($result)) {
$result = array_map('trim', array_slice($result, 1));
$result[0] = str_replace('|', ', ', $result[0]);
$result[1] = preg_replace('/(?:^|\n)\s*\* ?/', ' ', $result[1]);
$result[1] = preg_replace('/(?:^|\n)[\t ]*\*[\t ]?/', ' ', $result[1]);
}
$this->_returns = $result;
return $result;
@@ -429,9 +429,9 @@ class Entry {
return $this->_type;
}
preg_match('#\* *@type\s+([^\n]+)#', $this->entry, $result);
preg_match('#\*[\t ]*@type\s+(.+)#', $this->entry, $result);
if (count($result)) {
$result = trim(preg_replace('/(?:^|\n)\s*\* ?/', ' ', $result[1]));
$result = trim(preg_replace('/(?:^|\n)[\t ]*\*[\t ]?/', ' ', $result[1]));
} else {
$result = $this->isFunction() ? 'Function' : 'Unknown';
}

View File

@@ -121,7 +121,7 @@ class Generator {
$string = preg_replace('/(^|\s)(\([^)]+\))/', '$1*$2*', $string);
// mark numbers as inline code
$string = preg_replace('/ (-?\d+(?:.\d+)?)(?!\.[^\n])/', ' `$1`', $string);
$string = preg_replace('/[\t ](-?\d+(?:.\d+)?)(?!\.[^\n])/', ' `$1`', $string);
// detokenize inline code snippets
$counter = 0;
@@ -321,9 +321,7 @@ class Generator {
$api[$member] = $entry;
foreach ($entry->getAliases() as $alias) {
$api[$member] = $alias;
$alias->static = array();
$alias->plugin = array();
$api[$member]->static[] = $alias;
}
}
else if ($entry->isStatic()) {
@@ -559,7 +557,7 @@ class Generator {
array_push($result, $closeTag, $closeTag, '', ' [1]: #' . $toc . ' "Jump back to the TOC."');
// cleanup whitespace
return trim(preg_replace('/ +\n/', "\n", join($result, "\n")));
return trim(preg_replace('/[\t ]+\n/', "\n", join($result, "\n")));
}
}
?>

View File

@@ -18,7 +18,7 @@ For a list of upcoming features, check out our [roadmap](https://github.com/best
## Support
Platform.js has been tested in at least Chrome 5~26, Firefox 2~20, IE 6-10, Opera 9.25-12, Safari 3-6, Node.js 0.4.8-0.10.5, Narwhal 0.3.2, PhantomJS 1.9.0, RingoJS 0.9, and Rhino 1.7RC5.
Platform.js has been tested in at least Chrome 5~27, Firefox 2~21, IE 6-10, Opera 9.25-12, Safari 3-6, Node.js 0.4.8-0.10.7, Narwhal 0.3.2, PhantomJS 1.9.0, RingoJS 0.9, and Rhino 1.7RC5.
## Installation and usage

View File

@@ -9,7 +9,7 @@ QUnit CLIB helps extend QUnits CLI support to many common CLI environments.
## Support
QUnit CLIB has been tested in at least Node.js 0.4.8-0.10.5, Narwhal 0.3.2, PhantomJS 1.9.0, RingoJS 0.9, and Rhino 1.7RC5.
QUnit CLIB has been tested in at least Node.js 0.4.8-0.10.7, Narwhal 0.3.2, PhantomJS 1.9.0, RingoJS 0.9, and Rhino 1.7RC5.
## Usage

View File

@@ -1,5 +1,5 @@
/** vim: et:ts=4:sw=4:sts=4
* @license RequireJS 2.1.5 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved.
* @license RequireJS 2.1.6 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved.
* Available via the MIT or new BSD license.
* see: http://github.com/jrburke/requirejs for details
*/
@@ -12,7 +12,7 @@ var requirejs, require, define;
(function (global) {
var req, s, head, baseElement, dataMain, src,
interactiveScript, currentlyAddingScript, mainScript, subPath,
version = '2.1.5',
version = '2.1.6',
commentRegExp = /(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/mg,
cjsRequireRegExp = /[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g,
jsSuffixRegExp = /\.js$/,
@@ -22,7 +22,7 @@ var requirejs, require, define;
hasOwn = op.hasOwnProperty,
ap = Array.prototype,
apsp = ap.splice,
isBrowser = !!(typeof window !== 'undefined' && navigator && document),
isBrowser = !!(typeof window !== 'undefined' && navigator && window.document),
isWebWorker = !isBrowser && typeof importScripts !== 'undefined',
//PS3 indicates loaded and complete, but need to wait for complete
//specifically. Sequence is 'loading', 'loaded', execution,
@@ -134,6 +134,10 @@ var requirejs, require, define;
return document.getElementsByTagName('script');
}
function defaultOnError(err) {
throw err;
}
//Allow getting a global that expressed in
//dot notation, like 'a.b.c'.
function getGlobal(value) {
@@ -500,7 +504,12 @@ var requirejs, require, define;
fn(defined[id]);
}
} else {
getModule(depMap).on(name, fn);
mod = getModule(depMap);
if (mod.error && name === 'error') {
fn(mod.error);
} else {
mod.on(name, fn);
}
}
}
@@ -571,7 +580,13 @@ var requirejs, require, define;
id: mod.map.id,
uri: mod.map.url,
config: function () {
return (config.config && getOwn(config.config, mod.map.id)) || {};
var c,
pkg = getOwn(config.pkgs, mod.map.id);
// For packages, only support config targeted
// at the main module.
c = pkg ? getOwn(config.config, mod.map.id + '/' + pkg.main) :
getOwn(config.config, mod.map.id);
return c || {};
},
exports: defined[mod.map.id]
});
@@ -840,8 +855,13 @@ var requirejs, require, define;
if (this.depCount < 1 && !this.defined) {
if (isFunction(factory)) {
//If there is an error listener, favor passing
//to that instead of throwing an error.
if (this.events.error) {
//to that instead of throwing an error. However,
//only do it for define()'d modules. require
//errbacks should not be called for failures in
//their callbacks (#699). However if a global
//onError is set, use that.
if ((this.events.error && this.map.isDefine) ||
req.onError !== defaultOnError) {
try {
exports = context.execCb(id, factory, depExports, exports);
} catch (e) {
@@ -869,8 +889,8 @@ var requirejs, require, define;
if (err) {
err.requireMap = this.map;
err.requireModules = [this.map.id];
err.requireType = 'define';
err.requireModules = this.map.isDefine ? [this.map.id] : null;
err.requireType = this.map.isDefine ? 'define' : 'require';
return onError((this.error = err));
}
@@ -1093,7 +1113,7 @@ var requirejs, require, define;
}));
if (this.errback) {
on(depMap, 'error', this.errback);
on(depMap, 'error', bind(this, this.errback));
}
}
@@ -1605,7 +1625,7 @@ var requirejs, require, define;
},
/**
* Executes a module callack function. Broken out as a separate function
* Executes a module callback function. Broken out as a separate function
* solely to allow the build system to sequence the files in the built
* layer in the right sequence.
*
@@ -1643,7 +1663,7 @@ var requirejs, require, define;
onScriptError: function (evt) {
var data = getScriptData(evt);
if (!hasPathFallback(data.id)) {
return onError(makeError('scripterror', 'Script error', evt, [data.id]));
return onError(makeError('scripterror', 'Script error for: ' + data.id, evt, [data.id]));
}
}
};
@@ -1772,9 +1792,7 @@ var requirejs, require, define;
* function. Intercept/override it if you want custom error handling.
* @param {Error} err the error object.
*/
req.onError = function (err) {
throw err;
};
req.onError = defaultOnError;
/**
* Does the request to load a module for the browser case.
@@ -1906,24 +1924,31 @@ var requirejs, require, define;
//baseUrl, if it is not already set.
dataMain = script.getAttribute('data-main');
if (dataMain) {
//Preserve dataMain in case it is a path (i.e. contains '?')
mainScript = dataMain;
//Set final baseUrl if there is not already an explicit one.
if (!cfg.baseUrl) {
//Pull off the directory of data-main for use as the
//baseUrl.
src = dataMain.split('/');
src = mainScript.split('/');
mainScript = src.pop();
subPath = src.length ? src.join('/') + '/' : './';
cfg.baseUrl = subPath;
dataMain = mainScript;
}
//Strip off any trailing .js since dataMain is now
//Strip off any trailing .js since mainScript is now
//like a module name.
dataMain = dataMain.replace(jsSuffixRegExp, '');
mainScript = mainScript.replace(jsSuffixRegExp, '');
//If mainScript is still a path, fall back to dataMain
if (req.jsExtRegExp.test(mainScript)) {
mainScript = dataMain;
}
//Put the data-main script in the files to load.
cfg.deps = cfg.deps ? cfg.deps.concat(dataMain) : [dataMain];
cfg.deps = cfg.deps ? cfg.deps.concat(mainScript) : [mainScript];
return true;
}
@@ -1951,12 +1976,13 @@ var requirejs, require, define;
//This module may not have dependencies
if (!isArray(deps)) {
callback = deps;
deps = [];
deps = null;
}
//If no name, and callback is a function, then figure out if it a
//CommonJS thing with dependencies.
if (!deps.length && isFunction(callback)) {
if (!deps && isFunction(callback)) {
deps = [];
//Remove comments from the callback string,
//look for require calls, and pull them into the dependencies,
//but only if there are function args.

File diff suppressed because one or more lines are too long

View File

@@ -266,7 +266,7 @@
var result = {computed : -Infinity, value: -Infinity};
each(obj, function(value, index, list) {
var computed = iterator ? iterator.call(context, value, index, list) : value;
computed >= result.computed && (result = {value : value, computed : computed});
computed > result.computed && (result = {value : value, computed : computed});
});
return result.value;
};
@@ -365,7 +365,7 @@
return low;
};
// Safely convert anything iterable into a real, live array.
// Safely create a real, live array from anything iterable.
_.toArray = function(obj) {
if (!obj) return [];
if (_.isArray(obj)) return slice.call(obj);
@@ -425,7 +425,7 @@
// Internal implementation of a recursive `flatten` function.
var flatten = function(input, shallow, output) {
each(input, function(value) {
if (_.isArray(value)) {
if (_.isArray(value) || _.isArguments(value)) {
shallow ? push.apply(output, value) : flatten(value, shallow, output);
} else {
output.push(value);
@@ -468,7 +468,7 @@
// Produce an array that contains the union: each distinct element from all of
// the passed-in arrays.
_.union = function() {
return _.uniq(concat.apply(ArrayProto, arguments));
return _.uniq(_.flatten(arguments, true));
};
// Produce an array that contains every item shared between all the
@@ -492,13 +492,7 @@
// Zip together multiple lists into a single array -- elements that share
// an index go together.
_.zip = function() {
var args = slice.call(arguments);
var length = _.max(_.pluck(args, 'length'));
var results = new Array(length);
for (var i = 0; i < length; i++) {
results[i] = _.pluck(args, "" + i);
}
return results;
return _.unzip(slice.call(arguments));
};
// The inverse operation to `_.zip`. If given an array of pairs it
@@ -507,9 +501,13 @@
// three element array and so on. For example, `_.unzip` given
// `[['a',1],['b',2],['c',3]]` returns the array
// [['a','b','c'],[1,2,3]].
_.unzip = function(tuples) {
var maxLen = _.max(_.pluck(tuples, "length"))
return _.times(maxLen, _.partial(_.pluck, tuples));
_.unzip = function(list) {
var length = _.max(_.pluck(list, "length").concat(0));
var results = new Array(length);
for (var i = 0; i < length; i++) {
results[i] = _.pluck(list, '' + i);
}
return results;
};
// Converts lists into objects. Pass either a single array of `[key, value]`
@@ -595,7 +593,7 @@
// available.
_.bind = function(func, context) {
var args, bound;
if (func.bind === nativeBind && nativeBind) return nativeBind.apply(func, slice.call(arguments, 1));
if (nativeBind && func.bind === nativeBind) return nativeBind.apply(func, slice.call(arguments, 1));
if (!_.isFunction(func)) throw new TypeError;
args = slice.call(arguments, 2);
return bound = function() {
@@ -653,7 +651,8 @@
// Returns a function, that, when invoked, will only be triggered at most once
// during a given window of time.
_.throttle = function(func, wait, immediate) {
var context, args, timeout, result;
var context, args, result;
var timeout = null;
var previous = 0;
var later = function() {
previous = new Date;
@@ -683,7 +682,8 @@
// N milliseconds. If `immediate` is passed, trigger the function on the
// leading edge, instead of the trailing.
_.debounce = function(func, wait, immediate) {
var timeout, result;
var result;
var timeout = null;
return function() {
var context = this, args = arguments;
var later = function() {