Compare commits

...

51 Commits
1.1.1 ... 1.2.0

Author SHA1 Message Date
Benjamin Tan
dd5fda0690 Update v1.2.0 docs 2015-01-23 16:05:11 +08:00
John-David Dalton
2276df07bd Bump to v1.2.0.
Former-commit-id: bb045c043e8f1bbf6cf7fbf463952daa1c24c855
2013-04-16 09:00:33 -07:00
John-David Dalton
758ff03520 Exclude bower.json from Jam and NPM packages.
Former-commit-id: 93ce567c4cfd70bcba58fff27d0dc6c6cca12b7d
2013-04-16 08:58:57 -07:00
John-David Dalton
c3ac172960 Simplify _.debounce and _.throttle for the underscore build.
Former-commit-id: 56dc526cf71130084651d06b8caadce573471131
2013-04-16 01:52:47 -07:00
John-David Dalton
562b4eb531 Ensure unit tests pass in Narwhal.
Former-commit-id: a86ce088a72ea0be7b31e4bccc51ce1286b9418b
2013-04-16 01:04:47 -07:00
John-David Dalton
b1f8e845df Make _.isArray consistent with the other isType methods.
Former-commit-id: adcf242ba7692c96fb8f570118acd7fd0a4602da
2013-04-15 23:58:33 -07:00
John-David Dalton
bda869ea54 Add more to the .gitattributes and tweak template built tests.
Former-commit-id: 7f6c20de3981edb4afeb848ef7721f0075c51b54
2013-04-14 22:05:44 -07:00
John-David Dalton
19cfbf082a Fix corrupt vendor/closure-compiler.tar.gz.
Former-commit-id: 118cbaae80df4751552569211cd7b6436fb6b30f
2013-04-14 15:51:43 -07:00
John-David Dalton
07078bdd1f Tweak how the build handles support property cleanup and ensure the mobile build fixes some old WebKit bugs.
Former-commit-id: 34c3aeb2b58cf83a5a141ffc423245922082a714
2013-04-14 14:02:11 -07:00
John-David Dalton
03657a98e1 Fix typo in no-dep test title.
Former-commit-id: 30d904ab630012c4ba1f07b2762a33d25151486b
2013-04-14 10:19:34 -07:00
John-David Dalton
b3f64abfae Update vendors.
Former-commit-id: 43e57a1a75bdd66e95d3608f180514cfe5e0075c
2013-04-14 01:18:54 -07:00
John-David Dalton
5d73c8f002 Add -n/--no-dep build option.
Former-commit-id: 57571d0df4e17402b9055bae5ccfbc2b94f03613
2013-04-14 00:43:39 -07:00
John-David Dalton
ba0882762d Reorganize build tests.
Former-commit-id: 6f6aea86b84f8b4936785653fbfaa3a146af66a2
2013-04-13 23:47:51 -07:00
John-David Dalton
bb8855b628 Don't include tests that error in the total score of the perf.js suite. [ci skip]
Former-commit-id: ea71d436ecec9297b2d991e9f17e3665a9e53d23
2013-04-13 16:58:28 -07:00
John-David Dalton
883d5917f5 Fix build.
Former-commit-id: 99b283a2f26a9f5973799ad6757bfdc57d0a0404
2013-04-13 14:22:29 -07:00
John-David Dalton
0275e99fe2 Remove the lodash csp build as the default modern build no longer uses compilation.
Former-commit-id: 97f0722cae9190fd11aa9f458c9c7bc281fd82e4
2013-04-13 14:19:41 -07:00
John-David Dalton
5d109077e5 Use _.cloneDeep in build/util.js.
Former-commit-id: 06094c21fe084192933665982edc9a4212016406
2013-04-13 11:13:26 -07:00
John-David Dalton
540851ab6a Reorganize build.js modifications and remove compilation from the lodash modern build.
Former-commit-id: af5d0500be9e11d108bf941604ce2316cbd8c4b5
2013-04-13 11:12:01 -07:00
John-David Dalton
6b920fa5e6 Don't prefix paths with drive letters with dots in mkdirpSync. [closes #238]
Former-commit-id: dd0c8d7b1906210e5f26604d4149ba542727c78d
2013-04-12 13:15:44 -07:00
John-David Dalton
d1498bb9fb Tweak lodash, shimIsPlainObject, shimKeys, and reduce function docs. [ci skip]
Former-commit-id: f24dd4de2a5a6c8103f26d000f1f16b5be3d8165
2013-04-10 20:38:26 -07:00
John-David Dalton
54eeef173a Force lf in .gitattributes.
Former-commit-id: 075ae2c3b8655159095cd7ea5d1b4aae7792f39f
2013-04-10 08:38:35 -07:00
John-David Dalton
723ddf8cda Cleanup ignore files and package files, adding bower.json.
Former-commit-id: eb817fdaa786f35a7906d56dc1bd7e4af1bee33a
2013-04-09 20:49:42 -07:00
John-David Dalton
9f12552907 Add _.once unit tests.
Former-commit-id: cb79b4a5e73ec0cb7bae959693bb14599277ffe0
2013-04-09 20:23:58 -07:00
John-David Dalton
a8b6fa413e Cleanup build files and add build/util.js.
Former-commit-id: 67e5564a17ec4a438e3d0768e8963a1384d4ce98
2013-04-09 20:23:16 -07:00
John-David Dalton
76aae8ce42 Escape path separator when using it as part of a regexp. [closes #233]
Former-commit-id: 95d28187ee573ecc26e44f30cb5fb7457877dd06
2013-04-09 08:35:05 -07:00
John-David Dalton
ad0c287053 Ensure _.merge passes the right arguments to the callback when comparing objects. [closes #231]
Former-commit-id: 7c1ff861f753d3a2bdf62a753c94df2052d03d78
2013-04-08 21:01:57 -07:00
John-David Dalton
4a11a3559d Fix typo in iteratorTemplate and _.template docs. [ci skip] [closes #232]
Former-commit-id: b7870c00a2ab788c233696d3ca40f8306ee7bc3a
2013-04-08 20:01:19 -07:00
John-David Dalton
1faa5a80e4 Add unit tests to ensure non-underscore builds may include _.chain and _.findWhere methods.
Former-commit-id: 91a4ea5114a45bc5038a37d7ff4ea4b6212182ca
2013-04-07 22:55:52 -07:00
John-David Dalton
f1d3df1ec0 Update builds and docs.
Former-commit-id: 6409ea5dfeb50e5e69c844847b57b4853b7622c3
2013-04-07 20:15:23 -07:00
John-David Dalton
e7c94d3351 Cleanup _.union.
Former-commit-id: ed927c495c93121371d852f5239a068967ec6a6c
2013-04-07 20:06:09 -07:00
John-David Dalton
954f76dcf5 Reduce package size. [closes #230]
Former-commit-id: 91e7564f799866453783c9319af405a7aea65b2c
2013-04-07 20:00:44 -07:00
John-David Dalton
43037c0ff9 Ensure "Arrays" and "Objects" methods work with arguments objects and arrays respectively.
Former-commit-id: aebb7a0004d804b7fd43d73e24d1da28c67f4059
2013-04-07 15:53:52 -07:00
John-David Dalton
93df901b71 Switch to using useLodashMethod in build.js and allow non-underscore builds to include _.chain and _.findWhere.
Former-commit-id: 6c99623286059caf7a74dd4a19394da3562d7932
2013-04-07 08:56:43 -07:00
John-David Dalton
e97e645eda Use nativeSlice when possible and adjust largeArraySize to account for the recent cachedContains tweaks.
Former-commit-id: 9fe4dc10c74fb7a4b8e5cff434a4146d274f15d4
2013-04-06 01:26:21 -07:00
John-David Dalton
4a03ba3874 Add more _.debounce and _.throttle tests.
Former-commit-id: db3cb30a8eac82850a056f85d0c363e752d10027
2013-04-05 22:14:44 -07:00
John-David Dalton
7f637e4acc Update builds, vendors, and docs.
Former-commit-id: 67aec5a64de61ac2b8948b31315395a727c10071
2013-04-05 09:04:01 -07:00
John-David Dalton
8f3eeefafd Should ensure callback is a function in _.isEqual.
Former-commit-id: b53f8e0ab1bafff395ff19cd069940ba6c37eb5f
2013-04-05 08:59:09 -07:00
John-David Dalton
5dc550a0ce Cleanup doc examples for _.find and _.findKey.
Former-commit-id: 198149aa9caf277b2a819ee5c06c73e38fa6beae
2013-04-05 08:35:07 -07:00
John-David Dalton
6fe322da27 Add an options object argument to _.debounce and _.throttle. [closes #222]
Former-commit-id: d5eb3bc21d4a5c6d25314153f98d43a3d11eb4fa
2013-04-04 08:52:42 -07:00
John-David Dalton
3cfe7c9a56 Reduce --time-limit in .travis.yml.
Former-commit-id: 8fcd6b73eafbbb7c23e29cd60ee75fc83577673b
2013-04-03 23:04:47 -07:00
John-David Dalton
be7d5917cb Update vendor/underscore.
Former-commit-id: d1cca79a4f6732ee8cd48dd4574041b4ebe19edf
2013-04-02 22:38:48 -07:00
John-David Dalton
ca28aa6ebd Tweak argument names and docs.
Former-commit-id: 38d7f9cc7dea76e038ede22b6c6b4e779e28237b
2013-04-02 22:37:40 -07:00
John-David Dalton
e76360c1b5 Add _.unzip. [closes #225]
Former-commit-id: 4b2c7fc068fd430f3d78de850a5f7670fd0e1a4e
2013-04-02 22:34:15 -07:00
John-David Dalton
265ca8ba67 Update docs and builds.
Former-commit-id: 6bb15d3ad0d4d189ad5e27e1dd79d2a070a568b2
2013-04-02 00:37:19 -07:00
John-David Dalton
b0d942d0ec Ensure _.merge applies a given callback to nested properties. [closes #227]
Former-commit-id: 1a58c178e0ecb9c50512f221b4aed82762709066
2013-04-01 23:54:09 -07:00
John-David Dalton
6c25905ae4 Add keyPrefix to avoid issues with __proto__. [closes #226]
Former-commit-id: 55dee782acdd5e28229b1fcb7587424d3fdfd445
2013-04-01 22:32:50 -07:00
John-David Dalton
80a39393fe Use toString.bind instead of slice.bind in nativeBind assignment.
Former-commit-id: f08d16b1fa8eb98cf848daff96f7449c0dc51c90
2013-03-30 22:07:24 -07:00
John-David Dalton
d4aed71abf Make Lo-Dash work with Browserify. [closes #223]
Former-commit-id: 33b53dd075d6c4ed9682881af463bdd3c241ca44
2013-03-29 19:04:20 -07:00
John-David Dalton
ebb72bb992 Remove useUnderscoreClone check from the underscore build _.toArray replacement.
Former-commit-id: 62777dbc108689aa7bd0e258e64341aad8fa6cb3
2013-03-27 19:43:37 -07:00
John-David Dalton
8ffcd30b4d Simplify license in package.json. [ci skip]
Former-commit-id: 1915ba400e5f45713a018d26081bb6666fb6683a
2013-03-27 19:37:56 -07:00
John-David Dalton
06804c37e2 Remove travis-ci badge from README.md.
Former-commit-id: f978ab7e86a15b4f599c3f20afd8e1b8cfe1183a
2013-03-27 09:47:27 -07:00
99 changed files with 2615 additions and 1749 deletions

4
.gitattributes vendored
View File

@@ -1 +1,5 @@
* text=auto * text=auto
*.js text eol=lf
*.jst text eol=lf
*.sh text eol=lf
*.tpl text eol=lf

6
.gitignore vendored
View File

@@ -1,5 +1,5 @@
.DS_Store .DS_Store
*.custom.* *.custom.*
node_modules/ node_modules
vendor/closure-compiler/ vendor/closure-compiler
vendor/uglifyjs/ vendor/uglifyjs

View File

@@ -1,12 +1,14 @@
.* .*
*.custom.* *.custom.*
*.d.ts
*.md *.md
*.txt *.txt
build.js build.js
index.js index.js
build/ bower.json
doc/ build
node_modules/ doc
perf/ node_modules
test/ perf
vendor/ test
vendor

View File

@@ -1,27 +1,23 @@
.* .*
*.custom.* *.custom.*
*.d.ts *.d.ts
CONTRIBUTING.md *.md
doc/*.php bower.json
node_modules/ doc
perf/*.html node_modules
perf/*-ui.js perf
perf/*.sh test
test/*.html
test/*-ui.js
test/*.sh
vendor/*.gz vendor/*.gz
vendor/backbone/ vendor/backbone
vendor/benchmark.js/*.jar vendor/benchmark.js
vendor/closure-compiler/ vendor/closure-compiler
vendor/docdown/ vendor/docdown
vendor/firebug-lite/ vendor/firebug-lite
vendor/json3/ vendor/jquery
vendor/jquery/ vendor/json3
vendor/platform.js/ vendor/platform.js
vendor/qunit/qunit/*.css vendor/qunit
vendor/qunit/qunit/*-1.8.0.js vendor/qunit-clib
vendor/requirejs/ vendor/requirejs
vendor/underscore/*-min.js vendor/uglifyjs
vendor/uglifyjs/ vendor/underscore
vendor/underscore/test/

View File

@@ -7,7 +7,7 @@ env:
- TEST_COMMAND="phantomjs ./test/test.js ../dist/lodash.compat.min.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.js"
- TEST_COMMAND="node ./test/test.js ../dist/lodash.min.js" - TEST_COMMAND="node ./test/test.js ../dist/lodash.min.js"
- TEST_COMMAND="node ./test/test-build.js --time-limit 49m40s" - TEST_COMMAND="node ./test/test-build.js --time-limit 49m30s"
git: git:
depth: 1 depth: 1
branches: branches:

View File

@@ -1,29 +1,28 @@
# Lo-Dash <sup>v1.1.1</sup> # Lo-Dash <sup>v1.2.0</sup>
[![build status](https://secure.travis-ci.org/bestiejs/lodash.png)](http://travis-ci.org/bestiejs/lodash)
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). 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 ## Download
* Lo-Dash builds (for modern environments):<br> * Lo-Dash builds (for modern environments):<br>
[Development](https://raw.github.com/bestiejs/lodash/v1.1.1/dist/lodash.js) and [Development](https://raw.github.com/bestiejs/lodash/v1.2.0/dist/lodash.js) and
[Production](https://raw.github.com/bestiejs/lodash/v1.1.1/dist/lodash.min.js) [Production](https://raw.github.com/bestiejs/lodash/v1.2.0/dist/lodash.min.js)
* Lo-Dash compatibility builds (for legacy and modern environments):<br> * Lo-Dash compatibility builds (for legacy and modern environments):<br>
[Development](https://raw.github.com/bestiejs/lodash/v1.1.1/dist/lodash.compat.js) and [Development](https://raw.github.com/bestiejs/lodash/v1.2.0/dist/lodash.compat.js) and
[Production](https://raw.github.com/bestiejs/lodash/v1.1.1/dist/lodash.compat.min.js) [Production](https://raw.github.com/bestiejs/lodash/v1.2.0/dist/lodash.compat.min.js)
* Underscore compatibility builds:<br> * Underscore compatibility builds:<br>
[Development](https://raw.github.com/bestiejs/lodash/v1.1.1/dist/lodash.underscore.js) and [Development](https://raw.github.com/bestiejs/lodash/v1.2.0/dist/lodash.underscore.js) and
[Production](https://raw.github.com/bestiejs/lodash/v1.1.1/dist/lodash.underscore.min.js) [Production](https://raw.github.com/bestiejs/lodash/v1.2.0/dist/lodash.underscore.min.js)
* CDN copies of ≤ v1.1.1s builds are available on [cdnjs](http://cdnjs.com/) thanks to [CloudFlare](http://www.cloudflare.com/):<br> * CDN copies of ≤ v1.2.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.1.1/lodash.js), [Lo-Dash dev](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.2.0/lodash.js),
[Lo-Dash prod](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.1.1/lodash.min.js),<br> [Lo-Dash prod](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.2.0/lodash.min.js),<br>
[Lo-Dash compat-dev](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.1.1/lodash.compat.js), [Lo-Dash compat-dev](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.2.0/lodash.compat.js),
[Lo-Dash compat-prod](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.1.1/lodash.compat.min.js),<br> [Lo-Dash compat-prod](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.2.0/lodash.compat.min.js),<br>
[Underscore compat-dev](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.1.1/lodash.underscore.js), and [Underscore compat-dev](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.2.0/lodash.underscore.js), and
[Underscore compat-prod](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.1.1/lodash.underscore.min.js) [Underscore compat-prod](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.2.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 * For optimal file size, [create a custom build](https://github.com/bestiejs/lodash#custom-builds) with only the features you need
@@ -56,6 +55,7 @@ For more information check out these articles, screencasts, and other videos ove
* [_.bindKey](http://lodash.com/docs#bindKey) for binding [*“lazy”* defined](http://michaux.ca/articles/lazy-function-definition-pattern) methods * [_.bindKey](http://lodash.com/docs#bindKey) for binding [*“lazy”* defined](http://michaux.ca/articles/lazy-function-definition-pattern) methods
* [_.cloneDeep](http://lodash.com/docs#cloneDeep) for deep cloning arrays and objects * [_.cloneDeep](http://lodash.com/docs#cloneDeep) for deep cloning arrays and objects
* [_.contains](http://lodash.com/docs#contains) accepts a `fromIndex` argument * [_.contains](http://lodash.com/docs#contains) accepts a `fromIndex` argument
* [_.debounce](http://lodash.com/docs#debounce) and [_.throttle](http://lodash.com/docs#throttle) accept an `options` argument for more control
* [_.createCallback](http://lodash.com/docs#createCallback) to customize how callback arguments are handled and support callback shorthands in mixins * [_.createCallback](http://lodash.com/docs#createCallback) to customize how callback arguments are handled and support callback shorthands in mixins
* [_.findIndex](http://lodash.com/docs#findIndex) and [_.findKey](http://lodash.com/docs#findKey) for finding indexes and keys of collections * [_.findIndex](http://lodash.com/docs#findIndex) and [_.findKey](http://lodash.com/docs#findKey) for finding indexes and keys of collections
* [_.forEach](http://lodash.com/docs#forEach) is chainable and supports exiting iteration early * [_.forEach](http://lodash.com/docs#forEach) is chainable and supports exiting iteration early
@@ -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 * [_.runInContext](http://lodash.com/docs#runInContext) for easier mocking and extended environment support
* [_.support](http://lodash.com/docs#support) to flag environment features * [_.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) * [_.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)
* [_.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 * [_.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), * [_.clone](http://lodash.com/docs#clone), [_.omit](http://lodash.com/docs#omit), [_.pick](http://lodash.com/docs#pick),
[and more…](http://lodash.com/docs "_.assign, _.cloneDeep, _.first, _.initial, _.isEqual, _.last, _.merge, _.rest") accept `callback` and `thisArg` arguments [and more…](http://lodash.com/docs "_.assign, _.cloneDeep, _.first, _.initial, _.isEqual, _.last, _.merge, _.rest") accept `callback` and `thisArg` arguments
@@ -78,7 +79,7 @@ For more information check out these articles, screencasts, and other videos ove
## Support ## Support
Lo-Dash has been tested in at least Chrome 5~25, Firefox 2~19, IE 6-10, Opera 9.25-12, Safari 3-6, Node.js 0.4.8-0.10.1, Narwhal 0.3.2, PhantomJS 1.8.1, RingoJS 0.9, and Rhino 1.7RC5. Lo-Dash has been tested in at least Chrome 5~26, Firefox 2~19, IE 6-10, Opera 9.25~12, Safari 3-6, Node.js 0.4.8-0.10.4, Narwhal 0.3.2, PhantomJS 1.9.0, RingoJS 0.9, and Rhino 1.7RC5.
## Custom builds ## Custom builds
@@ -88,12 +89,6 @@ To top it off, we handle all method dependency and alias mapping for you.
* Backbone builds, with only methods required by Backbone, may be created using the `backbone` modifier argument. * Backbone builds, with only methods required by Backbone, may be created using the `backbone` modifier argument.
```bash ```bash
lodash backbone lodash backbone
```
* CSP builds, supporting default [Content Security Policy](https://dvcs.w3.org/hg/content-security-policy/raw-file/tip/csp-specification.dev.html) restrictions, may be created using the `csp` modifier argument.
The `csp` modifier is an alias of the `mobile` modifier. Lo-Dash may be used in Chrome extensions by using either the `csp`, `mobile`, or `underscore` build and using precompiled templates, or loading Lo-Dash in a [sandbox](http://developer.chrome.com/stable/extensions/sandboxingEval.html).
```bash
lodash csp
``` ```
* Legacy builds, tailored for older environments without [ES5 support](http://es5.github.com/), may be created using the `legacy` modifier argument. * Legacy builds, tailored for older environments without [ES5 support](http://es5.github.com/), may be created using the `legacy` modifier argument.
@@ -175,7 +170,7 @@ lodash settings="{interpolate:/\{\{([\s\S]+?)\}\}/g}"
lodash moduleId="underscore" lodash moduleId="underscore"
``` ```
All arguments, except `legacy` with `csp`, `mobile`, `modern`, or `underscore`, may be combined.<br> All arguments, except `legacy` with `mobile`, `modern`, or `underscore`, may be combined.<br>
Unless specified by `-o` or `--output`, all files created are saved to the current working directory. Unless specified by `-o` or `--output`, all files created are saved to the current working directory.
The following options are also supported: The following options are also supported:
@@ -252,24 +247,20 @@ require({
## Release Notes ## Release Notes
### <sup>v1.1.1</sup> ### <sup>v1.2.0</sup>
* Ensured the `underscore` build version of `_.forEach` accepts a `thisArg` argument * Added Bower package support
* Updated vendor/tar to work with Node v0.10.x * Added `_.unzip`
* Added an `options` argument to `_.debounce` and `_.throttle`
### <sup>v1.1.0</sup> * Allowed non-`underscore` builds to include `_.findWhere` and `_.chain`
* Ensured *“Arrays”* and *“Objects”* category methods work with `arguments` objects and arrays respectively
* Added `rhino -require` support * Ensured build utility runs on Windows
* Added `_.createCallback`, `_findIndex`, `_.findKey`, `_.parseInt`, `_.runInContext`, and `_.support` * Ensured `underscore` build versions of *“isType”* methods align with Underscore
* Added support for `callback` and `thisArg` arguments to `_.flatten` * Ensured methods avoid issues with the `__proto__` property
* Added CommonJS/Node support to precompiled templates * Ensured `_.merge` applies a `callback` to nested properties
* Ensured the `exports` object is not a DOM element * Ensured `_.merge` passes the correct `callback` arguments when comparing objects
* Ensured `_.isPlainObject` returns `false` for objects without a `[[Class]]` of “Object” * Made Lo-Dash work with Browserify
* Made `_.cloneDeep`s `callback` support more closely follow its documentation * Removed method compilation from the `modern`
* Made the template precompiler create nonexistent directories of `--output` paths
* Made `_.object` an alias of `_.zipObject`
* Optimized method chaining, object iteration, `_.find`, and `_.pluck` (an average of 18% overall better performance)
* Updated `backbone` build Lo-Dash method dependencies
The full changelog is available [here](https://github.com/bestiejs/lodash/wiki/Changelog). The full changelog is available [here](https://github.com/bestiejs/lodash/wiki/Changelog).

20
bower.json Normal file
View File

@@ -0,0 +1,20 @@
{
"name": "lodash",
"version": "1.2.0",
"main": "./lodash.js",
"ignore": [
".*",
"*.custom.*",
"*.d.ts",
"*.md",
"*.txt",
"build.js",
"index.js",
"build",
"doc",
"node_modules",
"perf",
"test",
"vendor"
]
}

896
build.js

File diff suppressed because it is too large Load Diff

View File

@@ -3,30 +3,26 @@
'use strict'; 'use strict';
/** Load Node.js modules */ /** Load Node.js modules */
var fs = require('fs'), var https = require('https'),
https = require('https'),
path = require('path'),
spawn = require('child_process').spawn, spawn = require('child_process').spawn,
zlib = require('zlib'); zlib = require('zlib');
/** Load other modules */ /** Load other modules */
var _ = require('../lodash.js'), var _ = require('../lodash.js'),
mkdirpSync = require('./mkdirp-sync.js'),
preprocess = require('./pre-compile.js'), preprocess = require('./pre-compile.js'),
postprocess = require('./post-compile.js'), postprocess = require('./post-compile.js'),
tar = require('../vendor/tar/tar.js'); tar = require('../vendor/tar/tar.js'),
util = require('./util.js');
/** Add `fs.existsSync` for older versions of Node.js */ /** Module shortcuts */
fs.existsSync || (fs.existsSync = path.existsSync); var fs = util.fs,
path = util.path;
/** Add `path.sep` for older versions of Node.js */
path.sep || (path.sep = process.platform == 'win32' ? '\\' : '/');
/** The Git object ID of `closure-compiler.tar.gz` */ /** The Git object ID of `closure-compiler.tar.gz` */
var closureId = 'a95a8007892aa824ce90c6aa3d3abb0489bf0fff'; var closureId = 'fe7665b9fb2378ffaf9e3985268e20e5c72e35fd';
/** The Git object ID of `uglifyjs.tar.gz` */ /** The Git object ID of `uglifyjs.tar.gz` */
var uglifyId = '41308bd569db41a32d4f08af115875d0342e8bfb'; var uglifyId = '3658629b8c7ae2e686f69eadd788ed792a23f4c6';
/** The path of the directory that is the base of the repository */ /** The path of the directory that is the base of the repository */
var basePath = fs.realpathSync(path.join(__dirname, '..')); var basePath = fs.realpathSync(path.join(__dirname, '..'));
@@ -47,7 +43,7 @@
var mediaType = 'application/vnd.github.v3.raw'; var mediaType = 'application/vnd.github.v3.raw';
/** Used to detect the Node.js executable in command-line arguments */ /** Used to detect the Node.js executable in command-line arguments */
var reNode = RegExp('(?:^|' + path.sep + ')node(?:\\.exe)?$'); var reNode = RegExp('(?:^|' + path.sepEscaped + ')node(?:\\.exe)?$');
/** Used to reference parts of the blob href */ /** Used to reference parts of the blob href */
var location = (function() { var location = (function() {
@@ -146,7 +142,7 @@
if (/-o|--output/.test(value)) { if (/-o|--output/.test(value)) {
result = options[index + 1]; result = options[index + 1];
var dirname = path.dirname(result); var dirname = path.dirname(result);
mkdirpSync(dirname); fs.mkdirpSync(dirname);
result = path.join(fs.realpathSync(dirname), path.basename(result)); result = path.join(fs.realpathSync(dirname), path.basename(result));
} }
return result; return result;

View File

@@ -1,43 +0,0 @@
#!/usr/bin/env node
;(function() {
'use strict';
/** Load Node.js modules */
var fs = require('fs'),
path = require('path');
/** Add `path.sep` for older versions of Node.js */
path.sep || (path.sep = process.platform == 'win32' ? '\\' : '/');
/*--------------------------------------------------------------------------*/
/**
* Makes the given `dirname` directory, without throwing errors for existing
* directories and making parent directories as needed.
*
* @param {String} dirname The path of the directory.
* @param {Number|String} [mode='0777'] The permission mode.
*/
function mkdirpSync(dirname, mode) {
var sep = path.sep;
// ensure relative paths are prefixed with `./`
if (!RegExp('^\\.?' + sep).test(dirname)) {
dirname = '.' + sep + dirname;
}
dirname.split(sep).reduce(function(currPath, segment) {
currPath += sep + segment;
try {
currPath = fs.realpathSync(currPath);
} catch(e) {
fs.mkdirSync(currPath, mode);
}
return currPath;
});
}
/*--------------------------------------------------------------------------*/
// expose
module.exports = mkdirpSync;
}());

View File

@@ -27,14 +27,8 @@
// remove copyright header // remove copyright header
source = source.replace(/^\/\**[\s\S]+?\*\/\n/, ''); source = source.replace(/^\/\**[\s\S]+?\*\/\n/, '');
// correct overly aggressive Closure Compiler advanced optimizations // correct overly aggressive Closure Compiler advanced optimization
source = source source = source.replace(/(document[^&]+&&)\s*(?:\w+|!\d)/, '$1!({toString:0}+"")');
.replace(/prototype\s*=\s*{\s*valueOf\s*:\s*1\s*}/, 'prototype={valueOf:1,y:1}')
.replace(/(document[^&]+&&)\s*(?:\w+|!\d)/, '$1!({toString:0}+"")')
source = source.replace(/(\w+\.prototype\s*=\s*)\w+(?=\.prototype;)/, function(match, left) {
return left + /\w+(?=\.VERSION)/.exec(source);
});
// flip `typeof` expressions to help optimize Safari and // flip `typeof` expressions to help optimize Safari and
// correct the AMD module definition for AMD build optimizers // correct the AMD module definition for AMD build optimizers

View File

@@ -156,6 +156,7 @@
'keys', 'keys',
'last', 'last',
'lastIndexOf', 'lastIndexOf',
'leading',
'map', 'map',
'max', 'max',
'memoize', 'memoize',
@@ -204,16 +205,19 @@
'throttle', 'throttle',
'times', 'times',
'toArray', 'toArray',
'trailing',
'unescape', 'unescape',
'unindexedChars', 'unindexedChars',
'union', 'union',
'uniq', 'uniq',
'unique', 'unique',
'uniqueId', 'uniqueId',
'unzip',
'value', 'value',
'values', 'values',
'variable', 'variable',
'where', 'where',
'window',
'without', 'without',
'wrap', 'wrap',
'zip', 'zip',

98
build/util.js Executable file
View File

@@ -0,0 +1,98 @@
#!/usr/bin/env node
;(function() {
'use strict';
/** Load Node.js modules */
var fs = require('fs'),
path = require('path');
/** Load other modules */
var _ = require('../lodash.js');
/** Used to indicate if running in Windows */
var isWindows = process.platform == 'win32';
/*--------------------------------------------------------------------------*/
/**
* The path separator.
*
* @memberOf util.path
* @type String
*/
var sep = path.sep || (isWindows ? '\\' : '/');
/**
* The escaped path separator used for inclusion in RegExp strings.
*
* @memberOf util.path
* @type String
*/
var sepEscaped = sep.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
/** Used to determine if a path is prefixed with a drive letter, dot, or slash */
var rePrefixed = RegExp('^(?:' + (isWindows ? '[a-zA-Z]:|' : '') + '\\.?)' + sepEscaped);
/*--------------------------------------------------------------------------*/
/**
* Makes the given `dirname` directory, without throwing errors for existing
* directories and making parent directories as needed.
*
* @memberOf util.fs
* @param {String} dirname The path of the directory.
* @param {Number|String} [mode='0777'] The permission mode.
*/
function mkdirpSync(dirname, mode) {
// ensure relative paths are prefixed with `./`
if (!rePrefixed.test(dirname)) {
dirname = '.' + sep + dirname;
}
dirname.split(sep).reduce(function(currPath, segment) {
currPath += sep + segment;
try {
currPath = fs.realpathSync(currPath);
} catch(e) {
fs.mkdirSync(currPath, mode);
}
return currPath;
});
}
/*--------------------------------------------------------------------------*/
/**
* The utility object.
*
* @type Object
*/
var util = {
/**
* The file system object.
*
* @memberOf util
* @type Object
*/
'fs': _.defaults(_.cloneDeep(fs), {
'existsSync': fs.existsSync || path.existsSync,
'mkdirpSync': mkdirpSync
}),
/**
* The path object.
*
* @memberOf util
* @type Object
*/
'path': _.defaults(_.cloneDeep(path), {
'sep': sep,
'sepEscaped': sepEscaped
})
};
/*--------------------------------------------------------------------------*/
// expose
module.exports = util;
}());

352
dist/lodash.compat.js vendored
View File

@@ -1,6 +1,6 @@
/** /**
* @license * @license
* Lo-Dash 1.1.1 (Custom Build) <http://lodash.com/> * Lo-Dash 1.2.0 (Custom Build) <http://lodash.com/>
* Build: `lodash -o ./dist/lodash.compat.js` * Build: `lodash -o ./dist/lodash.compat.js`
* Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/> * Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/>
* Based on Underscore.js 1.4.4 <http://underscorejs.org/> * Based on Underscore.js 1.4.4 <http://underscorejs.org/>
@@ -18,9 +18,9 @@
/** Detect free variable `module` */ /** Detect free variable `module` */
var freeModule = typeof module == 'object' && module && module.exports == freeExports && module; var freeModule = typeof module == 'object' && module && module.exports == freeExports && module;
/** Detect free variable `global` and use it as `window` */ /** Detect free variable `global`, from Node.js or Browserified code, and use it as `window` */
var freeGlobal = typeof global == 'object' && global; var freeGlobal = typeof global == 'object' && global;
if (freeGlobal.global === freeGlobal) { if (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal) {
window = freeGlobal; window = freeGlobal;
} }
@@ -30,6 +30,12 @@
/** Used internally to indicate various things */ /** Used internally to indicate various things */
var indicatorObject = {}; var indicatorObject = {};
/** Used to prefix keys to avoid issues with `__proto__` and properties on `Object.prototype` */
var keyPrefix = +new Date + '';
/** Used as the size when optimizations are enabled for large arrays */
var largeArraySize = 200;
/** Used to match empty string literals in compiled template source */ /** Used to match empty string literals in compiled template source */
var reEmptyStringLeading = /\b__p \+= '';/g, var reEmptyStringLeading = /\b__p \+= '';/g,
reEmptyStringMiddle = /\b(__p \+=) '' \+/g, reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
@@ -175,7 +181,7 @@
toString = objectRef.toString; toString = objectRef.toString;
/* Native method shortcuts for methods with the same name as other `lodash` methods */ /* Native method shortcuts for methods with the same name as other `lodash` methods */
var nativeBind = reNative.test(nativeBind = slice.bind) && nativeBind, var nativeBind = reNative.test(nativeBind = toString.bind) && nativeBind,
nativeIsArray = reNative.test(nativeIsArray = Array.isArray) && nativeIsArray, nativeIsArray = reNative.test(nativeIsArray = Array.isArray) && nativeIsArray,
nativeIsFinite = context.isFinite, nativeIsFinite = context.isFinite,
nativeIsNaN = context.isNaN, nativeIsNaN = context.isNaN,
@@ -183,7 +189,8 @@
nativeMax = Math.max, nativeMax = Math.max,
nativeMin = Math.min, nativeMin = Math.min,
nativeParseInt = context.parseInt, nativeParseInt = context.parseInt,
nativeRandom = Math.random; nativeRandom = Math.random,
nativeSlice = arrayRef.slice;
/** Detect various environments */ /** Detect various environments */
var isIeOpera = reNative.test(context.attachEvent), var isIeOpera = reNative.test(context.attachEvent),
@@ -202,7 +209,7 @@
/*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/
/** /**
* Creates a `lodash` object, that wraps the given `value`, to enable method * Creates a `lodash` object, which wraps the given `value`, to enable method
* chaining. * chaining.
* *
* In addition to Lo-Dash methods, wrappers also have the following `Array` methods: * In addition to Lo-Dash methods, wrappers also have the following `Array` methods:
@@ -220,8 +227,8 @@
* `invoke`, `keys`, `map`, `max`, `memoize`, `merge`, `min`, `object`, `omit`, * `invoke`, `keys`, `map`, `max`, `memoize`, `merge`, `min`, `object`, `omit`,
* `once`, `pairs`, `partial`, `partialRight`, `pick`, `pluck`, `push`, `range`, * `once`, `pairs`, `partial`, `partialRight`, `pick`, `pluck`, `push`, `range`,
* `reject`, `rest`, `reverse`, `shuffle`, `slice`, `sort`, `sortBy`, `splice`, * `reject`, `rest`, `reverse`, `shuffle`, `slice`, `sort`, `sortBy`, `splice`,
* `tap`, `throttle`, `times`, `toArray`, `union`, `uniq`, `unshift`, `values`, * `tap`, `throttle`, `times`, `toArray`, `union`, `uniq`, `unshift`, `unzip`,
* `where`, `without`, `wrap`, and `zip` * `values`, `where`, `without`, `wrap`, and `zip`
* *
* The non-chainable wrapper functions are: * The non-chainable wrapper functions are:
* `clone`, `cloneDeep`, `contains`, `escape`, `every`, `find`, `has`, * `clone`, `cloneDeep`, `contains`, `escape`, `every`, `find`, `has`,
@@ -240,6 +247,26 @@
* @category Chaining * @category Chaining
* @param {Mixed} value The value to wrap in a `lodash` instance. * @param {Mixed} value The value to wrap in a `lodash` instance.
* @returns {Object} Returns a `lodash` instance. * @returns {Object} Returns a `lodash` instance.
* @example
*
* var wrapped = _([1, 2, 3]);
*
* // returns an unwrapped value
* wrapped.reduce(function(sum, num) {
* return sum + num;
* });
* // => 6
*
* // returns a wrapped value
* var squares = wrapped.map(function(num) {
* return num * num;
* });
*
* _.isArray(squares);
* // => false
*
* _.isArray(squares.value());
* // => true
*/ */
function lodash(value) { function lodash(value) {
// don't wrap if already wrapped, even if wrapped by a different `lodash` constructor // don't wrap if already wrapped, even if wrapped by a different `lodash` constructor
@@ -267,12 +294,12 @@
for (prop in arguments) { } for (prop in arguments) { }
/** /**
* Detect if `arguments` objects are `Object` objects (all but Opera < 10.5). * Detect if `arguments` objects are `Object` objects (all but Narwhal and Opera < 10.5).
* *
* @memberOf _.support * @memberOf _.support
* @type Boolean * @type Boolean
*/ */
support.argsObject = arguments.constructor == Object; support.argsObject = arguments.constructor == Object && !(arguments instanceof Array);
/** /**
* Detect if an `arguments` object's [[Class]] is resolvable (all but Firefox < 4, IE < 9). * Detect if an `arguments` object's [[Class]] is resolvable (all but Firefox < 4, IE < 9).
@@ -438,7 +465,7 @@
* The template used to create iterator functions. * The template used to create iterator functions.
* *
* @private * @private
* @param {Obect} data The data object used to populate the text. * @param {Object} data The data object used to populate the text.
* @returns {String} Returns the interpolated text. * @returns {String} Returns the interpolated text.
*/ */
var iteratorTemplate = function(obj) { var iteratorTemplate = function(obj) {
@@ -566,31 +593,27 @@
* @private * @private
* @param {Array} array The array to search. * @param {Array} array The array to search.
* @param {Mixed} value The value to search for. * @param {Mixed} value The value to search for.
* @param {Number} fromIndex The index to search from.
* @param {Number} largeSize The length at which an array is considered large.
* @returns {Boolean} Returns `true`, if `value` is found, else `false`. * @returns {Boolean} Returns `true`, if `value` is found, else `false`.
*/ */
function cachedContains(array, fromIndex, largeSize) { function cachedContains(array) {
var length = array.length, var length = array.length,
isLarge = (length - fromIndex) >= largeSize; isLarge = length >= largeArraySize;
if (isLarge) { if (isLarge) {
var cache = {}, var cache = {},
index = fromIndex - 1; index = -1;
while (++index < length) { while (++index < length) {
// manually coerce `value` to a string because `hasOwnProperty`, in some var key = keyPrefix + array[index];
// older versions of Firefox, coerces objects incorrectly (cache[key] || (cache[key] = [])).push(array[index]);
var key = String(array[index]);
(hasOwnProperty.call(cache, key) ? cache[key] : (cache[key] = [])).push(array[index]);
} }
} }
return function(value) { return function(value) {
if (isLarge) { if (isLarge) {
var key = String(value); var key = keyPrefix + value;
return hasOwnProperty.call(cache, key) && indexOf(cache[key], value) > -1; return cache[key] && indexOf(cache[key], value) > -1;
} }
return indexOf(array, value, fromIndex) > -1; return indexOf(array, value) > -1;
} }
} }
@@ -676,7 +699,7 @@
} }
if (partialArgs.length) { if (partialArgs.length) {
args = args.length args = args.length
? (args = slice(args), rightIndicator ? args.concat(partialArgs) : partialArgs.concat(args)) ? (args = nativeSlice.call(args), rightIndicator ? args.concat(partialArgs) : partialArgs.concat(args))
: partialArgs; : partialArgs;
} }
if (this instanceof bound) { if (this instanceof bound) {
@@ -702,6 +725,7 @@
* @param {Object} [options1, options2, ...] The compile options object(s). * @param {Object} [options1, options2, ...] The compile options object(s).
* arrays - A string of code to determine if the iterable is an array or array-like. * arrays - A string of code to determine if the iterable is an array or array-like.
* useHas - A boolean to specify using `hasOwnProperty` checks in the object loop. * useHas - A boolean to specify using `hasOwnProperty` checks in the object loop.
* useKeys - A boolean to specify using `_.keys` for own property iteration.
* args - A string of comma separated arguments the iteration function will accept. * args - A string of comma separated arguments the iteration function will accept.
* top - A string of code to execute before the iteration branches. * top - A string of code to execute before the iteration branches.
* loop - A string of code to execute in the object loop. * loop - A string of code to execute in the object loop.
@@ -803,7 +827,7 @@
} }
/** /**
* A fallback implementation of `isPlainObject` that checks if a given `value` * A fallback implementation of `isPlainObject` which checks if a given `value`
* is an object created by the `Object` constructor, assuming objects created * is an object created by the `Object` constructor, assuming objects created
* by the `Object` constructor have no inherited enumerable properties and that * by the `Object` constructor have no inherited enumerable properties and that
* there are no `Object.prototype` extensions. * there are no `Object.prototype` extensions.
@@ -911,29 +935,7 @@
} }
/** /**
* Checks if `value` is an array. * A fallback implementation of `Object.keys` which produces an array of the
*
* @static
* @memberOf _
* @category Objects
* @param {Mixed} value The value to check.
* @returns {Boolean} Returns `true`, if the `value` is an array, else `false`.
* @example
*
* (function() { return _.isArray(arguments); })();
* // => false
*
* _.isArray([1, 2, 3]);
* // => true
*/
var isArray = nativeIsArray || function(value) {
// `instanceof` may cause a memory leak in IE 7 if `value` is a host object
// http://ajaxian.com/archives/working-aroung-the-instanceof-memory-leak
return (support.argsObject && value instanceof Array) || toString.call(value) == arrayClass;
};
/**
* A fallback implementation of `Object.keys` that produces an array of the
* given object's own enumerable property names. * given object's own enumerable property names.
* *
* @private * @private
@@ -1253,7 +1255,7 @@
* @static * @static
* @memberOf _ * @memberOf _
* @category Objects * @category Objects
* @param {Array|Object|String} collection The collection to iterate over. * @param {Object} object The object to search.
* @param {Function|Object|String} [callback=identity] The function called per * @param {Function|Object|String} [callback=identity] The function called per
* iteration. If a property name or object is passed, it will be used to create * iteration. If a property name or object is passed, it will be used to create
* a "_.pluck" or "_.where" style callback, respectively. * a "_.pluck" or "_.where" style callback, respectively.
@@ -1261,14 +1263,16 @@
* @returns {Mixed} Returns the key of the found element, else `undefined`. * @returns {Mixed} Returns the key of the found element, else `undefined`.
* @example * @example
* *
* _.findKey({ 'a': 1, 'b': 2, 'c': 3, 'd': 4 }, function(num) { return num % 2 == 0; }); * _.findKey({ 'a': 1, 'b': 2, 'c': 3, 'd': 4 }, function(num) {
* return num % 2 == 0;
* });
* // => 'b' * // => 'b'
*/ */
function findKey(collection, callback, thisArg) { function findKey(object, callback, thisArg) {
var result; var result;
callback = lodash.createCallback(callback, thisArg); callback = lodash.createCallback(callback, thisArg);
forOwn(collection, function(value, key, collection) { forOwn(object, function(value, key, object) {
if (callback(value, key, collection)) { if (callback(value, key, object)) {
result = key; result = key;
return false; return false;
} }
@@ -1402,6 +1406,29 @@
return result; return result;
} }
/**
* Checks if `value` is an array.
*
* @static
* @memberOf _
* @category Objects
* @param {Mixed} value The value to check.
* @returns {Boolean} Returns `true`, if the `value` is an array, else `false`.
* @example
*
* (function() { return _.isArray(arguments); })();
* // => false
*
* _.isArray([1, 2, 3]);
* // => true
*/
function isArray(value) {
// `instanceof` may cause a memory leak in IE 7 if `value` is a host object
// http://ajaxian.com/archives/working-aroung-the-instanceof-memory-leak
return (support.argsObject && value instanceof Array) ||
(nativeIsArray ? nativeIsArray(value) : toString.call(value) == arrayClass);
}
/** /**
* Checks if `value` is a boolean value. * Checks if `value` is a boolean value.
* *
@@ -1536,11 +1563,8 @@
function isEqual(a, b, callback, thisArg, stackA, stackB) { function isEqual(a, b, callback, thisArg, stackA, stackB) {
// used to indicate that when comparing objects, `a` has at least the properties of `b` // used to indicate that when comparing objects, `a` has at least the properties of `b`
var whereIndicator = callback === indicatorObject; var whereIndicator = callback === indicatorObject;
if (callback && !whereIndicator) { if (typeof callback == 'function' && !whereIndicator) {
callback = (typeof thisArg == 'undefined') callback = lodash.createCallback(callback, thisArg, 2);
? callback
: lodash.createCallback(callback, thisArg, 2);
var result = callback(a, b); var result = callback(a, b);
if (typeof result != 'undefined') { if (typeof result != 'undefined') {
return !!result; return !!result;
@@ -2026,22 +2050,24 @@
} }
} }
if (!found) { if (!found) {
value = isArr var isShallow;
? (isArray(value) ? value : [])
: (isPlainObject(value) ? value : {});
if (callback) { if (callback) {
result = callback(value, source); result = callback(value, source);
if (typeof result != 'undefined') { if ((isShallow = typeof result != 'undefined')) {
value = result; value = result;
} }
} }
if (!isShallow) {
value = isArr
? (isArray(value) ? value : [])
: (isPlainObject(value) ? value : {});
}
// add `source` and associated `value` to the stack of traversed objects // add `source` and associated `value` to the stack of traversed objects
stackA.push(source); stackA.push(source);
stackB.push(value); stackB.push(value);
// recursively merge objects and arrays (susceptible to call stack limits) // recursively merge objects and arrays (susceptible to call stack limits)
if (!callback) { if (!isShallow) {
value = merge(value, source, indicatorObject, callback, stackA, stackB); value = merge(value, source, indicatorObject, callback, stackA, stackB);
} }
} }
@@ -2096,12 +2122,12 @@
if (isFunc) { if (isFunc) {
callback = lodash.createCallback(callback, thisArg); callback = lodash.createCallback(callback, thisArg);
} else { } else {
var props = concat.apply(arrayRef, arguments); var props = concat.apply(arrayRef, nativeSlice.call(arguments, 1));
} }
forIn(object, function(value, key, object) { forIn(object, function(value, key, object) {
if (isFunc if (isFunc
? !callback(value, key, object) ? !callback(value, key, object)
: indexOf(props, key, 1) < 0 : indexOf(props, key) < 0
) { ) {
result[key] = value; result[key] = value;
} }
@@ -2164,8 +2190,8 @@
function pick(object, callback, thisArg) { function pick(object, callback, thisArg) {
var result = {}; var result = {};
if (typeof callback != 'function') { if (typeof callback != 'function') {
var index = 0, var index = -1,
props = concat.apply(arrayRef, arguments), props = concat.apply(arrayRef, nativeSlice.call(arguments, 1)),
length = isObject(object) ? props.length : 0; length = isObject(object) ? props.length : 0;
while (++index < length) { while (++index < length) {
@@ -2235,7 +2261,7 @@
*/ */
function at(collection) { function at(collection) {
var index = -1, var index = -1,
props = concat.apply(arrayRef, slice(arguments, 1)), props = concat.apply(arrayRef, nativeSlice.call(arguments, 1)),
length = props.length, length = props.length,
result = Array(length); result = Array(length);
@@ -2490,7 +2516,9 @@
* @returns {Mixed} Returns the found element, else `undefined`. * @returns {Mixed} Returns the found element, else `undefined`.
* @example * @example
* *
* _.find([1, 2, 3, 4], function(num) { return num % 2 == 0; }); * _.find([1, 2, 3, 4], function(num) {
* return num % 2 == 0;
* });
* // => 2 * // => 2
* *
* var food = [ * var food = [
@@ -2638,7 +2666,7 @@
* // => [['1', '2', '3'], ['4', '5', '6']] * // => [['1', '2', '3'], ['4', '5', '6']]
*/ */
function invoke(collection, methodName) { function invoke(collection, methodName) {
var args = slice(arguments, 2), var args = nativeSlice.call(arguments, 2),
index = -1, index = -1,
isFunc = typeof methodName == 'function', isFunc = typeof methodName == 'function',
length = collection ? collection.length : 0, length = collection ? collection.length : 0,
@@ -2868,7 +2896,7 @@
var pluck = map; var pluck = map;
/** /**
* Reduces a `collection` to a value that is the accumulated result of running * Reduces a `collection` to a value which is the accumulated result of running
* each element in the `collection` through the `callback`, where each successive * each element in the `collection` through the `callback`, where each successive
* `callback` execution consumes the return value of the previous execution. * `callback` execution consumes the return value of the previous execution.
* If `accumulator` is not passed, the first element of the `collection` will be * If `accumulator` is not passed, the first element of the `collection` will be
@@ -3275,8 +3303,8 @@
function difference(array) { function difference(array) {
var index = -1, var index = -1,
length = array ? array.length : 0, length = array ? array.length : 0,
flattened = concat.apply(arrayRef, arguments), flattened = concat.apply(arrayRef, nativeSlice.call(arguments, 1)),
contains = cachedContains(flattened, length, 100), contains = cachedContains(flattened),
result = []; result = [];
while (++index < length) { while (++index < length) {
@@ -3295,7 +3323,7 @@
* @static * @static
* @memberOf _ * @memberOf _
* @category Arrays * @category Arrays
* @param {Array|Object|String} collection The collection to iterate over. * @param {Array} array The array to search.
* @param {Function|Object|String} [callback=identity] The function called per * @param {Function|Object|String} [callback=identity] The function called per
* iteration. If a property name or object is passed, it will be used to create * iteration. If a property name or object is passed, it will be used to create
* a "_.pluck" or "_.where" style callback, respectively. * a "_.pluck" or "_.where" style callback, respectively.
@@ -3303,16 +3331,18 @@
* @returns {Mixed} Returns the index of the found element, else `-1`. * @returns {Mixed} Returns the index of the found element, else `-1`.
* @example * @example
* *
* _.findIndex(['apple', 'banana', 'beet'], function(food) { return /^b/.test(food); }); * _.findIndex(['apple', 'banana', 'beet'], function(food) {
* return /^b/.test(food);
* });
* // => 1 * // => 1
*/ */
function findIndex(collection, callback, thisArg) { function findIndex(array, callback, thisArg) {
var index = -1, var index = -1,
length = collection ? collection.length : 0; length = array ? array.length : 0;
callback = lodash.createCallback(callback, thisArg); callback = lodash.createCallback(callback, thisArg);
while (++index < length) { while (++index < length) {
if (callback(collection[index], index, collection)) { if (callback(array[index], index, array)) {
return index; return index;
} }
} }
@@ -3414,7 +3444,7 @@
* @static * @static
* @memberOf _ * @memberOf _
* @category Arrays * @category Arrays
* @param {Array} array The array to compact. * @param {Array} array The array to flatten.
* @param {Boolean} [isShallow=false] A flag to indicate only flattening a single level. * @param {Boolean} [isShallow=false] A flag to indicate only flattening a single level.
* @param {Function|Object|String} [callback=identity] The function called per * @param {Function|Object|String} [callback=identity] The function called per
* iteration. If a property name or object is passed, it will be used to create * iteration. If a property name or object is passed, it will be used to create
@@ -3605,7 +3635,7 @@
cache = { '0': {} }, cache = { '0': {} },
index = -1, index = -1,
length = array ? array.length : 0, length = array ? array.length : 0,
isLarge = length >= 100, isLarge = length >= largeArraySize,
result = [], result = [],
seen = result; seen = result;
@@ -3613,8 +3643,8 @@
while (++index < length) { while (++index < length) {
var value = array[index]; var value = array[index];
if (isLarge) { if (isLarge) {
var key = String(value); var key = keyPrefix + value;
var inited = hasOwnProperty.call(cache[0], key) var inited = cache[0][key]
? !(seen = cache[0][key]) ? !(seen = cache[0][key])
: (seen = cache[0][key] = []); : (seen = cache[0][key] = []);
} }
@@ -3624,7 +3654,7 @@
} }
var argsIndex = argsLength; var argsIndex = argsLength;
while (--argsIndex) { while (--argsIndex) {
if (!(cache[argsIndex] || (cache[argsIndex] = cachedContains(args[argsIndex], 0, 100)))(value)) { if (!(cache[argsIndex] || (cache[argsIndex] = cachedContains(args[argsIndex])))(value)) {
continue outer; continue outer;
} }
} }
@@ -3885,7 +3915,7 @@
* @static * @static
* @memberOf _ * @memberOf _
* @category Arrays * @category Arrays
* @param {Array} array The array to iterate over. * @param {Array} array The array to inspect.
* @param {Mixed} value The value to evaluate. * @param {Mixed} value The value to evaluate.
* @param {Function|Object|String} [callback=identity] The function called per * @param {Function|Object|String} [callback=identity] The function called per
* iteration. If a property name or object is passed, it will be used to create * iteration. If a property name or object is passed, it will be used to create
@@ -3948,7 +3978,10 @@
* _.union([1, 2, 3], [101, 2, 1, 10], [2, 1]); * _.union([1, 2, 3], [101, 2, 1, 10], [2, 1]);
* // => [1, 2, 3, 101, 10] * // => [1, 2, 3, 101, 10]
*/ */
function union() { function union(array) {
if (!isArray(array)) {
arguments[0] = array ? nativeSlice.call(array) : arrayRef;
}
return uniq(concat.apply(arrayRef, arguments)); return uniq(concat.apply(arrayRef, arguments));
} }
@@ -4008,7 +4041,7 @@
isSorted = false; isSorted = false;
} }
// init value cache for large arrays // init value cache for large arrays
var isLarge = !isSorted && length >= 75; var isLarge = !isSorted && length >= largeArraySize;
if (isLarge) { if (isLarge) {
var cache = {}; var cache = {};
} }
@@ -4021,8 +4054,8 @@
computed = callback ? callback(value, index, array) : value; computed = callback ? callback(value, index, array) : value;
if (isLarge) { if (isLarge) {
var key = String(computed); var key = keyPrefix + computed;
var inited = hasOwnProperty.call(cache, key) var inited = cache[key]
? !(seen = cache[key]) ? !(seen = cache[key])
: (seen = cache[key] = []); : (seen = cache[key] = []);
} }
@@ -4039,6 +4072,37 @@
return result; 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 ? array.length : 0,
tupleLength = length ? max(pluck(array, 'length')) : 0,
result = Array(tupleLength);
while (++index < length) {
var tupleIndex = -1,
tuple = array[index];
while (++tupleIndex < tupleLength) {
(result[tupleIndex] || (result[tupleIndex] = Array(length)))[index] = tuple[tupleIndex];
}
}
return result;
}
/** /**
* Creates an array with all occurrences of the passed values removed using * Creates an array with all occurrences of the passed values removed using
* strict equality for comparisons, i.e. `===`. * strict equality for comparisons, i.e. `===`.
@@ -4055,18 +4119,7 @@
* // => [2, 3, 4] * // => [2, 3, 4]
*/ */
function without(array) { function without(array) {
var index = -1, return difference(array, nativeSlice.call(arguments, 1));
length = array ? array.length : 0,
contains = cachedContains(arguments, 1, 30),
result = [];
while (++index < length) {
var value = array[index];
if (!contains(value)) {
result.push(value);
}
}
return result;
} }
/** /**
@@ -4192,7 +4245,7 @@
// (in V8 `Function#bind` is slower except when partially applied) // (in V8 `Function#bind` is slower except when partially applied)
return support.fastBind || (nativeBind && arguments.length > 2) return support.fastBind || (nativeBind && arguments.length > 2)
? nativeBind.call.apply(nativeBind, arguments) ? nativeBind.call.apply(nativeBind, arguments)
: createBound(func, thisArg, slice(arguments, 2)); : createBound(func, thisArg, nativeSlice.call(arguments, 2));
} }
/** /**
@@ -4219,8 +4272,8 @@
* // => alerts 'clicked docs', when the button is clicked * // => alerts 'clicked docs', when the button is clicked
*/ */
function bindAll(object) { function bindAll(object) {
var funcs = concat.apply(arrayRef, arguments), var funcs = arguments.length > 1 ? concat.apply(arrayRef, nativeSlice.call(arguments, 1)) : functions(object),
index = funcs.length > 1 ? 0 : (funcs = functions(object), -1), index = -1,
length = funcs.length; length = funcs.length;
while (++index < length) { while (++index < length) {
@@ -4265,7 +4318,7 @@
* // => 'hi, moe!' * // => 'hi, moe!'
*/ */
function bindKey(object, key) { function bindKey(object, key) {
return createBound(object, key, slice(arguments, 2), indicatorObject); return createBound(object, key, nativeSlice.call(arguments, 2), indicatorObject);
} }
/** /**
@@ -4395,44 +4448,53 @@
/** /**
* Creates a function that will delay the execution of `func` until after * Creates a function that will delay the execution of `func` until after
* `wait` milliseconds have elapsed since the last time it was invoked. Pass * `wait` milliseconds have elapsed since the last time it was invoked. Pass
* `true` for `immediate` to cause debounce to invoke `func` on the leading, * an `options` object to indicate that `func` should be invoked on the leading
* instead of the trailing, edge of the `wait` timeout. Subsequent calls to * and/or trailing edge of the `wait` timeout. Subsequent calls to the debounced
* the debounced function will return the result of the last `func` call. * function will return the result of the last `func` call.
* *
* @static * @static
* @memberOf _ * @memberOf _
* @category Functions * @category Functions
* @param {Function} func The function to debounce. * @param {Function} func The function to debounce.
* @param {Number} wait The number of milliseconds to delay. * @param {Number} wait The number of milliseconds to delay.
* @param {Boolean} immediate A flag to indicate execution is on the leading * @param {Object} options The options object.
* edge of the timeout. * [leading=false] A boolean to specify execution on the leading edge of the timeout.
* [trailing=true] A boolean to specify execution on the trailing edge of the timeout.
* @returns {Function} Returns the new debounced function. * @returns {Function} Returns the new debounced function.
* @example * @example
* *
* var lazyLayout = _.debounce(calculateLayout, 300); * var lazyLayout = _.debounce(calculateLayout, 300);
* jQuery(window).on('resize', lazyLayout); * jQuery(window).on('resize', lazyLayout);
*/ */
function debounce(func, wait, immediate) { function debounce(func, wait, options) {
var args, var args,
result, result,
thisArg, thisArg,
timeoutId; timeoutId,
trailing = true;
function delayed() { function delayed() {
timeoutId = null; timeoutId = null;
if (!immediate) { if (trailing) {
result = func.apply(thisArg, args); result = func.apply(thisArg, args);
} }
} }
if (options === true) {
var leading = true;
trailing = false;
} else if (options && objectTypes[typeof options]) {
leading = options.leading;
trailing = 'trailing' in options ? options.trailing : trailing;
}
return function() { return function() {
var isImmediate = immediate && !timeoutId; var isLeading = leading && !timeoutId;
args = arguments; args = arguments;
thisArg = this; thisArg = this;
clearTimeout(timeoutId); clearTimeout(timeoutId);
timeoutId = setTimeout(delayed, wait); timeoutId = setTimeout(delayed, wait);
if (isImmediate) { if (isLeading) {
result = func.apply(thisArg, args); result = func.apply(thisArg, args);
} }
return result; return result;
@@ -4455,7 +4517,7 @@
* // returns from the function before `alert` is called * // returns from the function before `alert` is called
*/ */
function defer(func) { function defer(func) {
var args = slice(arguments, 1); var args = nativeSlice.call(arguments, 1);
return setTimeout(function() { func.apply(undefined, args); }, 1); return setTimeout(function() { func.apply(undefined, args); }, 1);
} }
// use `setImmediate` if it's available in Node.js // use `setImmediate` if it's available in Node.js
@@ -4481,7 +4543,7 @@
* // => 'logged later' (Appears after one second.) * // => 'logged later' (Appears after one second.)
*/ */
function delay(func, wait) { function delay(func, wait) {
var args = slice(arguments, 2); var args = nativeSlice.call(arguments, 2);
return setTimeout(function() { func.apply(undefined, args); }, wait); return setTimeout(function() { func.apply(undefined, args); }, wait);
} }
@@ -4507,7 +4569,7 @@
function memoize(func, resolver) { function memoize(func, resolver) {
var cache = {}; var cache = {};
return function() { return function() {
var key = String(resolver ? resolver.apply(this, arguments) : arguments[0]); var key = keyPrefix + (resolver ? resolver.apply(this, arguments) : arguments[0]);
return hasOwnProperty.call(cache, key) return hasOwnProperty.call(cache, key)
? cache[key] ? cache[key]
: (cache[key] = func.apply(this, arguments)); : (cache[key] = func.apply(this, arguments));
@@ -4567,7 +4629,7 @@
* // => 'hi moe' * // => 'hi moe'
*/ */
function partial(func) { function partial(func) {
return createBound(func, slice(arguments, 1)); return createBound(func, nativeSlice.call(arguments, 1));
} }
/** /**
@@ -4598,43 +4660,61 @@
* // => { '_': _, 'jq': $ } * // => { '_': _, 'jq': $ }
*/ */
function partialRight(func) { function partialRight(func) {
return createBound(func, slice(arguments, 1), null, indicatorObject); return createBound(func, nativeSlice.call(arguments, 1), null, indicatorObject);
} }
/** /**
* Creates a function that, when executed, will only call the `func` * Creates a function that, when executed, will only call the `func` function
* function at most once per every `wait` milliseconds. If the throttled * at most once per every `wait` milliseconds. If the throttled function is
* function is invoked more than once during the `wait` timeout, `func` will * invoked more than once during the `wait` timeout, `func` will also be called
* also be called on the trailing edge of the timeout. Subsequent calls to the * on the trailing edge of the timeout. Pass an `options` object to indicate
* throttled function will return the result of the last `func` call. * that `func` should be invoked on the leading and/or trailing edge of the
* `wait` timeout. Subsequent calls to the throttled function will return
* the result of the last `func` call.
* *
* @static * @static
* @memberOf _ * @memberOf _
* @category Functions * @category Functions
* @param {Function} func The function to throttle. * @param {Function} func The function to throttle.
* @param {Number} wait The number of milliseconds to throttle executions to. * @param {Number} wait The number of milliseconds to throttle executions to.
* @param {Object} options The options object.
* [leading=true] A boolean to specify execution on the leading edge of the timeout.
* [trailing=true] A boolean to specify execution on the trailing edge of the timeout.
* @returns {Function} Returns the new throttled function. * @returns {Function} Returns the new throttled function.
* @example * @example
* *
* var throttled = _.throttle(updatePosition, 100); * var throttled = _.throttle(updatePosition, 100);
* jQuery(window).on('scroll', throttled); * jQuery(window).on('scroll', throttled);
*/ */
function throttle(func, wait) { function throttle(func, wait, options) {
var args, var args,
result, result,
thisArg, thisArg,
timeoutId, timeoutId,
lastCalled = 0; lastCalled = 0,
leading = true,
trailing = true;
function trailingCall() { function trailingCall() {
lastCalled = new Date; lastCalled = new Date;
timeoutId = null; timeoutId = null;
result = func.apply(thisArg, args);
if (trailing) {
result = func.apply(thisArg, args);
}
}
if (options === false) {
leading = false;
} else if (options && objectTypes[typeof options]) {
leading = 'leading' in options ? options.leading : leading;
trailing = 'trailing' in options ? options.trailing : trailing;
} }
return function() { return function() {
var now = new Date, var now = new Date;
remaining = wait - (now - lastCalled); if (!timeoutId && !leading) {
lastCalled = now;
}
var remaining = wait - (now - lastCalled);
args = arguments; args = arguments;
thisArg = this; thisArg = this;
@@ -4864,9 +4944,6 @@
* Note: In the development build, `_.template` utilizes sourceURLs for easier * Note: In the development build, `_.template` utilizes sourceURLs for easier
* debugging. See http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl * debugging. See http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl
* *
* Note: Lo-Dash may be used in Chrome extensions by either creating a `lodash csp`
* build and using precompiled templates, or loading Lo-Dash in a sandbox.
*
* For more information on precompiling templates see: * For more information on precompiling templates see:
* http://lodash.com/#custom-builds * http://lodash.com/#custom-builds
* *
@@ -4877,7 +4954,7 @@
* @memberOf _ * @memberOf _
* @category Utilities * @category Utilities
* @param {String} text The template text. * @param {String} text The template text.
* @param {Obect} data The data object used to populate the text. * @param {Object} data The data object used to populate the text.
* @param {Object} options The options object. * @param {Object} options The options object.
* escape - The "escape" delimiter regexp. * escape - The "escape" delimiter regexp.
* evaluate - The "evaluate" delimiter regexp. * evaluate - The "evaluate" delimiter regexp.
@@ -5077,7 +5154,7 @@
} }
/** /**
* The opposite of `_.escape`, this method converts the HTML entities * The inverse of `_.escape`, this method converts the HTML entities
* `&amp;`, `&lt;`, `&gt;`, `&quot;`, and `&#39;` in `string` to their * `&amp;`, `&lt;`, `&gt;`, `&quot;`, and `&#39;` in `string` to their
* corresponding characters. * corresponding characters.
* *
@@ -5230,6 +5307,7 @@
lodash.toArray = toArray; lodash.toArray = toArray;
lodash.union = union; lodash.union = union;
lodash.uniq = uniq; lodash.uniq = uniq;
lodash.unzip = unzip;
lodash.values = values; lodash.values = values;
lodash.where = where; lodash.where = where;
lodash.without = without; lodash.without = without;
@@ -5347,7 +5425,7 @@
* @memberOf _ * @memberOf _
* @type String * @type String
*/ */
lodash.VERSION = '1.1.1'; lodash.VERSION = '1.2.0';
// add "Chaining" functions to the wrapper // add "Chaining" functions to the wrapper
lodash.prototype.toString = wrapperToString; lodash.prototype.toString = wrapperToString;

View File

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

603
dist/lodash.js vendored

File diff suppressed because it is too large Load Diff

76
dist/lodash.min.js vendored
View File

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

View File

@@ -1,6 +1,6 @@
/** /**
* @license * @license
* Lo-Dash 1.1.1 (Custom Build) <http://lodash.com/> * Lo-Dash 1.2.0 (Custom Build) <http://lodash.com/>
* Build: `lodash underscore exports="amd,commonjs,global,node" -o ./dist/lodash.underscore.js` * Build: `lodash underscore exports="amd,commonjs,global,node" -o ./dist/lodash.underscore.js`
* Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/> * Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/>
* Based on Underscore.js 1.4.4 <http://underscorejs.org/> * Based on Underscore.js 1.4.4 <http://underscorejs.org/>
@@ -18,9 +18,9 @@
/** Detect free variable `module` */ /** Detect free variable `module` */
var freeModule = typeof module == 'object' && module && module.exports == freeExports && module; var freeModule = typeof module == 'object' && module && module.exports == freeExports && module;
/** Detect free variable `global` and use it as `window` */ /** Detect free variable `global`, from Node.js or Browserified code, and use it as `window` */
var freeGlobal = typeof global == 'object' && global; var freeGlobal = typeof global == 'object' && global;
if (freeGlobal.global === freeGlobal) { if (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal) {
window = freeGlobal; window = freeGlobal;
} }
@@ -30,6 +30,12 @@
/** Used internally to indicate various things */ /** Used internally to indicate various things */
var indicatorObject = {}; var indicatorObject = {};
/** Used to prefix keys to avoid issues with `__proto__` and properties on `Object.prototype` */
var keyPrefix = +new Date + '';
/** Used as the size when optimizations are enabled for large arrays */
var largeArraySize = 200;
/** Used to match empty string literals in compiled template source */ /** Used to match empty string literals in compiled template source */
var reEmptyStringLeading = /\b__p \+= '';/g, var reEmptyStringLeading = /\b__p \+= '';/g,
reEmptyStringMiddle = /\b(__p \+=) '' \+/g, reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
@@ -118,18 +124,18 @@
hasOwnProperty = objectRef.hasOwnProperty, hasOwnProperty = objectRef.hasOwnProperty,
push = arrayRef.push, push = arrayRef.push,
setTimeout = window.setTimeout, setTimeout = window.setTimeout,
slice = arrayRef.slice,
toString = objectRef.toString; toString = objectRef.toString;
/* Native method shortcuts for methods with the same name as other `lodash` methods */ /* Native method shortcuts for methods with the same name as other `lodash` methods */
var nativeBind = reNative.test(nativeBind = slice.bind) && nativeBind, var nativeBind = reNative.test(nativeBind = toString.bind) && nativeBind,
nativeIsArray = reNative.test(nativeIsArray = Array.isArray) && nativeIsArray, nativeIsArray = reNative.test(nativeIsArray = Array.isArray) && nativeIsArray,
nativeIsFinite = window.isFinite, nativeIsFinite = window.isFinite,
nativeIsNaN = window.isNaN, nativeIsNaN = window.isNaN,
nativeKeys = reNative.test(nativeKeys = Object.keys) && nativeKeys, nativeKeys = reNative.test(nativeKeys = Object.keys) && nativeKeys,
nativeMax = Math.max, nativeMax = Math.max,
nativeMin = Math.min, nativeMin = Math.min,
nativeRandom = Math.random; nativeRandom = Math.random,
nativeSlice = arrayRef.slice;
/** Detect various environments */ /** Detect various environments */
var isIeOpera = reNative.test(window.attachEvent), var isIeOpera = reNative.test(window.attachEvent),
@@ -138,7 +144,7 @@
/*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/
/** /**
* Creates a `lodash` object, that wraps the given `value`, to enable method * Creates a `lodash` object, which wraps the given `value`, to enable method
* chaining. * chaining.
* *
* In addition to Lo-Dash methods, wrappers also have the following `Array` methods: * In addition to Lo-Dash methods, wrappers also have the following `Array` methods:
@@ -156,8 +162,8 @@
* `invoke`, `keys`, `map`, `max`, `memoize`, `merge`, `min`, `object`, `omit`, * `invoke`, `keys`, `map`, `max`, `memoize`, `merge`, `min`, `object`, `omit`,
* `once`, `pairs`, `partial`, `partialRight`, `pick`, `pluck`, `push`, `range`, * `once`, `pairs`, `partial`, `partialRight`, `pick`, `pluck`, `push`, `range`,
* `reject`, `rest`, `reverse`, `shuffle`, `slice`, `sort`, `sortBy`, `splice`, * `reject`, `rest`, `reverse`, `shuffle`, `slice`, `sort`, `sortBy`, `splice`,
* `tap`, `throttle`, `times`, `toArray`, `union`, `uniq`, `unshift`, `values`, * `tap`, `throttle`, `times`, `toArray`, `union`, `uniq`, `unshift`, `unzip`,
* `where`, `without`, `wrap`, and `zip` * `values`, `where`, `without`, `wrap`, and `zip`
* *
* The non-chainable wrapper functions are: * The non-chainable wrapper functions are:
* `clone`, `cloneDeep`, `contains`, `escape`, `every`, `find`, `has`, * `clone`, `cloneDeep`, `contains`, `escape`, `every`, `find`, `has`,
@@ -176,6 +182,26 @@
* @category Chaining * @category Chaining
* @param {Mixed} value The value to wrap in a `lodash` instance. * @param {Mixed} value The value to wrap in a `lodash` instance.
* @returns {Object} Returns a `lodash` instance. * @returns {Object} Returns a `lodash` instance.
* @example
*
* var wrapped = _([1, 2, 3]);
*
* // returns an unwrapped value
* wrapped.reduce(function(sum, num) {
* return sum + num;
* });
* // => 6
*
* // returns a wrapped value
* var squares = wrapped.map(function(num) {
* return num * num;
* });
*
* _.isArray(squares);
* // => false
*
* _.isArray(squares.value());
* // => true
*/ */
function lodash(value) { function lodash(value) {
return (value instanceof lodash) return (value instanceof lodash)
@@ -196,12 +222,12 @@
var object = { '0': 1, 'length': 1 }; var object = { '0': 1, 'length': 1 };
/** /**
* Detect if `arguments` objects are `Object` objects (all but Opera < 10.5). * Detect if `arguments` objects are `Object` objects (all but Narwhal and Opera < 10.5).
* *
* @memberOf _.support * @memberOf _.support
* @type Boolean * @type Boolean
*/ */
support.argsObject = arguments.constructor == Object; support.argsObject = arguments.constructor == Object && !(arguments instanceof Array);
/** /**
* Detect if `Function#bind` exists and is inferred to be fast (all but V8). * Detect if `Function#bind` exists and is inferred to be fast (all but V8).
@@ -354,7 +380,7 @@
} }
if (partialArgs.length) { if (partialArgs.length) {
args = args.length args = args.length
? (args = slice.call(args), rightIndicator ? args.concat(partialArgs) : partialArgs.concat(args)) ? (args = nativeSlice.call(args), rightIndicator ? args.concat(partialArgs) : partialArgs.concat(args))
: partialArgs; : partialArgs;
} }
if (this instanceof bound) { if (this instanceof bound) {
@@ -458,29 +484,7 @@
} }
/** /**
* Checks if `value` is an array. * A fallback implementation of `Object.keys` which produces an array of the
*
* @static
* @memberOf _
* @category Objects
* @param {Mixed} value The value to check.
* @returns {Boolean} Returns `true`, if the `value` is an array, else `false`.
* @example
*
* (function() { return _.isArray(arguments); })();
* // => false
*
* _.isArray([1, 2, 3]);
* // => true
*/
var isArray = nativeIsArray || function(value) {
// `instanceof` may cause a memory leak in IE 7 if `value` is a host object
// http://ajaxian.com/archives/working-aroung-the-instanceof-memory-leak
return (support.argsObject && value instanceof Array) || toString.call(value) == arrayClass;
};
/**
* A fallback implementation of `Object.keys` that produces an array of the
* given object's own enumerable property names. * given object's own enumerable property names.
* *
* @private * @private
@@ -631,7 +635,7 @@
*/ */
function clone(value) { function clone(value) {
return isObject(value) return isObject(value)
? (isArray(value) ? slice.call(value) : assign({}, value)) ? (isArray(value) ? nativeSlice.call(value) : assign({}, value))
: value; : value;
} }
@@ -816,6 +820,26 @@
return result; return result;
} }
/**
* Checks if `value` is an array.
*
* @static
* @memberOf _
* @category Objects
* @param {Mixed} value The value to check.
* @returns {Boolean} Returns `true`, if the `value` is an array, else `false`.
* @example
*
* (function() { return _.isArray(arguments); })();
* // => false
*
* _.isArray([1, 2, 3]);
* // => true
*/
var isArray = nativeIsArray || function(value) {
return toString.call(value) == arrayClass;
};
/** /**
* Checks if `value` is a boolean value. * Checks if `value` is a boolean value.
* *
@@ -847,7 +871,7 @@
* // => true * // => true
*/ */
function isDate(value) { function isDate(value) {
return value instanceof Date || toString.call(value) == dateClass; return toString.call(value) == dateClass;
} }
/** /**
@@ -1092,7 +1116,7 @@
// fallback for older versions of Chrome and Safari // fallback for older versions of Chrome and Safari
if (isFunction(/x/)) { if (isFunction(/x/)) {
isFunction = function(value) { isFunction = function(value) {
return value instanceof Function || toString.call(value) == funcClass; return toString.call(value) == funcClass;
}; };
} }
@@ -1206,7 +1230,7 @@
* // => true * // => true
*/ */
function isRegExp(value) { function isRegExp(value) {
return value instanceof RegExp || toString.call(value) == regexpClass; return toString.call(value) == regexpClass;
} }
/** /**
@@ -1270,11 +1294,11 @@
* // => { 'name': 'moe' } * // => { 'name': 'moe' }
*/ */
function omit(object) { function omit(object) {
var props = concat.apply(arrayRef, arguments), var props = concat.apply(arrayRef, nativeSlice.call(arguments, 1)),
result = {}; result = {};
forIn(object, function(value, key) { forIn(object, function(value, key) {
if (indexOf(props, key, 1) < 0) { if (indexOf(props, key) < 0) {
result[key] = value; result[key] = value;
} }
}); });
@@ -1334,8 +1358,8 @@
* // => { 'name': 'moe' } * // => { 'name': 'moe' }
*/ */
function pick(object) { function pick(object) {
var index = 0, var index = -1,
props = concat.apply(arrayRef, arguments), props = concat.apply(arrayRef, nativeSlice.call(arguments, 1)),
length = props.length, length = props.length,
result = {}; result = {};
@@ -1609,7 +1633,9 @@
* @returns {Mixed} Returns the found element, else `undefined`. * @returns {Mixed} Returns the found element, else `undefined`.
* @example * @example
* *
* _.find([1, 2, 3, 4], function(num) { return num % 2 == 0; }); * _.find([1, 2, 3, 4], function(num) {
* return num % 2 == 0;
* });
* // => 2 * // => 2
* *
* var food = [ * var food = [
@@ -1651,6 +1677,29 @@
} }
} }
/**
* Examines each element in a `collection`, returning the first that
* has the given `properties`. When checking `properties`, this method
* performs a deep comparison between values to determine if they are
* equivalent to each other.
*
* @static
* @memberOf _
* @category Collections
* @param {Array|Object|String} collection The collection to iterate over.
* @param {Object} properties The object of property values to filter by.
* @returns {Mixed} Returns the found element, else `undefined`.
* @example
*
* var food = [
* { 'name': 'apple', 'organic': false, 'type': 'fruit' },
* { 'name': 'banana', 'organic': true, 'type': 'fruit' },
* { 'name': 'beet', 'organic': false, 'type': 'vegetable' }
* ];
*
* _.findWhere(food, { 'type': 'vegetable' });
* // => { 'name': 'beet', 'organic': false, 'type': 'vegetable' }
*/
function findWhere(object, properties) { function findWhere(object, properties) {
return where(object, properties, true); return where(object, properties, true);
} }
@@ -1761,7 +1810,7 @@
* // => [['1', '2', '3'], ['4', '5', '6']] * // => [['1', '2', '3'], ['4', '5', '6']]
*/ */
function invoke(collection, methodName) { function invoke(collection, methodName) {
var args = slice.call(arguments, 2), var args = nativeSlice.call(arguments, 2),
index = -1, index = -1,
isFunc = typeof methodName == 'function', isFunc = typeof methodName == 'function',
length = collection ? collection.length : 0, length = collection ? collection.length : 0,
@@ -1999,7 +2048,7 @@
} }
/** /**
* Reduces a `collection` to a value that is the accumulated result of running * Reduces a `collection` to a value which is the accumulated result of running
* each element in the `collection` through the `callback`, where each successive * each element in the `collection` through the `callback`, where each successive
* `callback` execution consumes the return value of the previous execution. * `callback` execution consumes the return value of the previous execution.
* If `accumulator` is not passed, the first element of the `collection` will be * If `accumulator` is not passed, the first element of the `collection` will be
@@ -2324,7 +2373,7 @@
*/ */
function toArray(collection) { function toArray(collection) {
if (isArray(collection)) { if (isArray(collection)) {
return slice.call(collection); return nativeSlice.call(collection);
} }
if (collection && typeof collection.length == 'number') { if (collection && typeof collection.length == 'number') {
return map(collection); return map(collection);
@@ -2410,12 +2459,12 @@
function difference(array) { function difference(array) {
var index = -1, var index = -1,
length = array.length, length = array.length,
flattened = concat.apply(arrayRef, arguments), flattened = concat.apply(arrayRef, nativeSlice.call(arguments, 1)),
result = []; result = [];
while (++index < length) { while (++index < length) {
var value = array[index]; var value = array[index];
if (indexOf(flattened, value, length) < 0) { if (indexOf(flattened, value) < 0) {
result.push(value); result.push(value);
} }
} }
@@ -2496,7 +2545,7 @@
return array[0]; return array[0];
} }
} }
return slice.call(array, 0, nativeMin(nativeMax(0, n), length)); return nativeSlice.call(array, 0, nativeMin(nativeMax(0, n), length));
} }
} }
@@ -2517,7 +2566,7 @@
* @static * @static
* @memberOf _ * @memberOf _
* @category Arrays * @category Arrays
* @param {Array} array The array to compact. * @param {Array} array The array to flatten.
* @param {Boolean} [isShallow=false] A flag to indicate only flattening a single level. * @param {Boolean} [isShallow=false] A flag to indicate only flattening a single level.
* @param {Function|Object|String} [callback=identity] The function called per * @param {Function|Object|String} [callback=identity] The function called per
* iteration. If a property name or object is passed, it will be used to create * iteration. If a property name or object is passed, it will be used to create
@@ -2671,7 +2720,7 @@
} else { } else {
n = (callback == null || thisArg) ? 1 : callback || n; n = (callback == null || thisArg) ? 1 : callback || n;
} }
return slice.call(array, 0, nativeMin(nativeMax(0, length - n), length)); return nativeSlice.call(array, 0, nativeMin(nativeMax(0, length - n), length));
} }
/** /**
@@ -2786,7 +2835,7 @@
return array[length - 1]; return array[length - 1];
} }
} }
return slice.call(array, nativeMax(0, length - n)); return nativeSlice.call(array, nativeMax(0, length - n));
} }
} }
@@ -2943,7 +2992,7 @@
} else { } else {
n = (callback == null || thisArg) ? 1 : nativeMax(0, callback); n = (callback == null || thisArg) ? 1 : nativeMax(0, callback);
} }
return slice.call(array, n); return nativeSlice.call(array, n);
} }
/** /**
@@ -2963,7 +3012,7 @@
* @static * @static
* @memberOf _ * @memberOf _
* @category Arrays * @category Arrays
* @param {Array} array The array to iterate over. * @param {Array} array The array to inspect.
* @param {Mixed} value The value to evaluate. * @param {Mixed} value The value to evaluate.
* @param {Function|Object|String} [callback=identity] The function called per * @param {Function|Object|String} [callback=identity] The function called per
* iteration. If a property name or object is passed, it will be used to create * iteration. If a property name or object is passed, it will be used to create
@@ -3026,7 +3075,10 @@
* _.union([1, 2, 3], [101, 2, 1, 10], [2, 1]); * _.union([1, 2, 3], [101, 2, 1, 10], [2, 1]);
* // => [1, 2, 3, 101, 10] * // => [1, 2, 3, 101, 10]
*/ */
function union() { function union(array) {
if (!isArray(array)) {
arguments[0] = array ? nativeSlice.call(array) : arrayRef;
}
return uniq(concat.apply(arrayRef, arguments)); return uniq(concat.apply(arrayRef, arguments));
} }
@@ -3121,17 +3173,7 @@
* // => [2, 3, 4] * // => [2, 3, 4]
*/ */
function without(array) { function without(array) {
var index = -1, return difference(array, nativeSlice.call(arguments, 1));
length = array.length,
result = [];
while (++index < length) {
var value = array[index];
if (indexOf(arguments, value, 1) < 0) {
result.push(value);
}
}
return result
} }
/** /**
@@ -3257,7 +3299,7 @@
// (in V8 `Function#bind` is slower except when partially applied) // (in V8 `Function#bind` is slower except when partially applied)
return support.fastBind || (nativeBind && arguments.length > 2) return support.fastBind || (nativeBind && arguments.length > 2)
? nativeBind.call.apply(nativeBind, arguments) ? nativeBind.call.apply(nativeBind, arguments)
: createBound(func, thisArg, slice.call(arguments, 2)); : createBound(func, thisArg, nativeSlice.call(arguments, 2));
} }
/** /**
@@ -3284,8 +3326,8 @@
* // => alerts 'clicked docs', when the button is clicked * // => alerts 'clicked docs', when the button is clicked
*/ */
function bindAll(object) { function bindAll(object) {
var funcs = concat.apply(arrayRef, arguments), var funcs = arguments.length > 1 ? concat.apply(arrayRef, nativeSlice.call(arguments, 1)) : functions(object),
index = funcs.length > 1 ? 0 : (funcs = functions(object), -1), index = -1,
length = funcs.length; length = funcs.length;
while (++index < length) { while (++index < length) {
@@ -3422,17 +3464,18 @@
/** /**
* Creates a function that will delay the execution of `func` until after * Creates a function that will delay the execution of `func` until after
* `wait` milliseconds have elapsed since the last time it was invoked. Pass * `wait` milliseconds have elapsed since the last time it was invoked. Pass
* `true` for `immediate` to cause debounce to invoke `func` on the leading, * an `options` object to indicate that `func` should be invoked on the leading
* instead of the trailing, edge of the `wait` timeout. Subsequent calls to * and/or trailing edge of the `wait` timeout. Subsequent calls to the debounced
* the debounced function will return the result of the last `func` call. * function will return the result of the last `func` call.
* *
* @static * @static
* @memberOf _ * @memberOf _
* @category Functions * @category Functions
* @param {Function} func The function to debounce. * @param {Function} func The function to debounce.
* @param {Number} wait The number of milliseconds to delay. * @param {Number} wait The number of milliseconds to delay.
* @param {Boolean} immediate A flag to indicate execution is on the leading * @param {Object} options The options object.
* edge of the timeout. * [leading=false] A boolean to specify execution on the leading edge of the timeout.
* [trailing=true] A boolean to specify execution on the trailing edge of the timeout.
* @returns {Function} Returns the new debounced function. * @returns {Function} Returns the new debounced function.
* @example * @example
* *
@@ -3482,7 +3525,7 @@
* // returns from the function before `alert` is called * // returns from the function before `alert` is called
*/ */
function defer(func) { function defer(func) {
var args = slice.call(arguments, 1); var args = nativeSlice.call(arguments, 1);
return setTimeout(function() { func.apply(undefined, args); }, 1); return setTimeout(function() { func.apply(undefined, args); }, 1);
} }
@@ -3504,7 +3547,7 @@
* // => 'logged later' (Appears after one second.) * // => 'logged later' (Appears after one second.)
*/ */
function delay(func, wait) { function delay(func, wait) {
var args = slice.call(arguments, 2); var args = nativeSlice.call(arguments, 2);
return setTimeout(function() { func.apply(undefined, args); }, wait); return setTimeout(function() { func.apply(undefined, args); }, wait);
} }
@@ -3530,7 +3573,7 @@
function memoize(func, resolver) { function memoize(func, resolver) {
var cache = {}; var cache = {};
return function() { return function() {
var key = String(resolver ? resolver.apply(this, arguments) : arguments[0]); var key = keyPrefix + (resolver ? resolver.apply(this, arguments) : arguments[0]);
return hasOwnProperty.call(cache, key) return hasOwnProperty.call(cache, key)
? cache[key] ? cache[key]
: (cache[key] = func.apply(this, arguments)); : (cache[key] = func.apply(this, arguments));
@@ -3590,21 +3633,26 @@
* // => 'hi moe' * // => 'hi moe'
*/ */
function partial(func) { function partial(func) {
return createBound(func, slice.call(arguments, 1)); return createBound(func, nativeSlice.call(arguments, 1));
} }
/** /**
* Creates a function that, when executed, will only call the `func` * Creates a function that, when executed, will only call the `func` function
* function at most once per every `wait` milliseconds. If the throttled * at most once per every `wait` milliseconds. If the throttled function is
* function is invoked more than once during the `wait` timeout, `func` will * invoked more than once during the `wait` timeout, `func` will also be called
* also be called on the trailing edge of the timeout. Subsequent calls to the * on the trailing edge of the timeout. Pass an `options` object to indicate
* throttled function will return the result of the last `func` call. * that `func` should be invoked on the leading and/or trailing edge of the
* `wait` timeout. Subsequent calls to the throttled function will return
* the result of the last `func` call.
* *
* @static * @static
* @memberOf _ * @memberOf _
* @category Functions * @category Functions
* @param {Function} func The function to throttle. * @param {Function} func The function to throttle.
* @param {Number} wait The number of milliseconds to throttle executions to. * @param {Number} wait The number of milliseconds to throttle executions to.
* @param {Object} options The options object.
* [leading=true] A boolean to specify execution on the leading edge of the timeout.
* [trailing=true] A boolean to specify execution on the trailing edge of the timeout.
* @returns {Function} Returns the new throttled function. * @returns {Function} Returns the new throttled function.
* @example * @example
* *
@@ -3836,9 +3884,6 @@
* Note: In the development build, `_.template` utilizes sourceURLs for easier * Note: In the development build, `_.template` utilizes sourceURLs for easier
* debugging. See http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl * debugging. See http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl
* *
* Note: Lo-Dash may be used in Chrome extensions by either creating a `lodash csp`
* build and using precompiled templates, or loading Lo-Dash in a sandbox.
*
* For more information on precompiling templates see: * For more information on precompiling templates see:
* http://lodash.com/#custom-builds * http://lodash.com/#custom-builds
* *
@@ -3849,7 +3894,7 @@
* @memberOf _ * @memberOf _
* @category Utilities * @category Utilities
* @param {String} text The template text. * @param {String} text The template text.
* @param {Obect} data The data object used to populate the text. * @param {Object} data The data object used to populate the text.
* @param {Object} options The options object. * @param {Object} options The options object.
* escape - The "escape" delimiter regexp. * escape - The "escape" delimiter regexp.
* evaluate - The "evaluate" delimiter regexp. * evaluate - The "evaluate" delimiter regexp.
@@ -3998,7 +4043,7 @@
} }
/** /**
* The opposite of `_.escape`, this method converts the HTML entities * The inverse of `_.escape`, this method converts the HTML entities
* `&amp;`, `&lt;`, `&gt;`, `&quot;`, and `&#39;` in `string` to their * `&amp;`, `&lt;`, `&gt;`, `&quot;`, and `&#39;` in `string` to their
* corresponding characters. * corresponding characters.
* *
@@ -4280,7 +4325,7 @@
* @memberOf _ * @memberOf _
* @type String * @type String
*/ */
lodash.VERSION = '1.1.1'; lodash.VERSION = '1.2.0';
// add functions to `lodash.prototype` // add functions to `lodash.prototype`
mixin(lodash); mixin(lodash);
@@ -4289,36 +4334,36 @@
lodash.prototype.chain = wrapperChain; lodash.prototype.chain = wrapperChain;
lodash.prototype.value = wrapperValueOf; lodash.prototype.value = wrapperValueOf;
// add `Array` mutator functions to the wrapper // add `Array` mutator functions to the wrapper
forEach(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(methodName) { forEach(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(methodName) {
var func = arrayRef[methodName]; var func = arrayRef[methodName];
lodash.prototype[methodName] = function() { lodash.prototype[methodName] = function() {
var value = this.__wrapped__; var value = this.__wrapped__;
func.apply(value, arguments); func.apply(value, arguments);
// avoid array-like object bugs with `Array#shift` and `Array#splice` // avoid array-like object bugs with `Array#shift` and `Array#splice`
// in Firefox < 10 and IE < 9 // in Firefox < 10 and IE < 9
if (!support.spliceObjects && value.length === 0) { if (!support.spliceObjects && value.length === 0) {
delete value[0]; delete value[0];
} }
return this; return this;
}; };
}); });
// add `Array` accessor functions to the wrapper // add `Array` accessor functions to the wrapper
forEach(['concat', 'join', 'slice'], function(methodName) { forEach(['concat', 'join', 'slice'], function(methodName) {
var func = arrayRef[methodName]; var func = arrayRef[methodName];
lodash.prototype[methodName] = function() { lodash.prototype[methodName] = function() {
var value = this.__wrapped__, var value = this.__wrapped__,
result = func.apply(value, arguments); result = func.apply(value, arguments);
if (this.__chain__) { if (this.__chain__) {
result = new lodashWrapper(result); result = new lodashWrapper(result);
result.__chain__ = true; result.__chain__ = true;
} }
return result; return result;
}; };
}); });
/*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/

View File

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

File diff suppressed because it is too large Load Diff

View File

@@ -21,9 +21,9 @@
// generate Markdown // generate Markdown
$markdown = docdown(array( $markdown = docdown(array(
'path' => '../' . $file, 'path' => '../' . $file,
'title' => 'Lo-Dash <sup>v1.1.1</sup>', 'title' => 'Lo-Dash <sup>v1.2.0</sup>',
'toc' => 'categories', 'toc' => 'categories',
'url' => 'https://github.com/bestiejs/lodash/blob/master/lodash.js' 'url' => 'https://github.com/lodash/lodash/blob/1.2.0/lodash.js'
)); ));
// save to a .md file // save to a .md file
@@ -33,4 +33,4 @@
header('Content-Type: text/plain;charset=utf-8'); header('Content-Type: text/plain;charset=utf-8');
echo $markdown . PHP_EOL; echo $markdown . PHP_EOL;
?> ?>

352
lodash.js
View File

@@ -1,6 +1,6 @@
/** /**
* @license * @license
* Lo-Dash 1.1.1 <http://lodash.com/> * Lo-Dash 1.2.0 <http://lodash.com/>
* Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/> * Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/>
* Based on Underscore.js 1.4.4 <http://underscorejs.org/> * Based on Underscore.js 1.4.4 <http://underscorejs.org/>
* Copyright 2009-2013 Jeremy Ashkenas, DocumentCloud Inc. * Copyright 2009-2013 Jeremy Ashkenas, DocumentCloud Inc.
@@ -17,9 +17,9 @@
/** Detect free variable `module` */ /** Detect free variable `module` */
var freeModule = typeof module == 'object' && module && module.exports == freeExports && module; var freeModule = typeof module == 'object' && module && module.exports == freeExports && module;
/** Detect free variable `global` and use it as `window` */ /** Detect free variable `global`, from Node.js or Browserified code, and use it as `window` */
var freeGlobal = typeof global == 'object' && global; var freeGlobal = typeof global == 'object' && global;
if (freeGlobal.global === freeGlobal) { if (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal) {
window = freeGlobal; window = freeGlobal;
} }
@@ -29,6 +29,12 @@
/** Used internally to indicate various things */ /** Used internally to indicate various things */
var indicatorObject = {}; var indicatorObject = {};
/** Used to prefix keys to avoid issues with `__proto__` and properties on `Object.prototype` */
var keyPrefix = +new Date + '';
/** Used as the size when optimizations are enabled for large arrays */
var largeArraySize = 200;
/** Used to match empty string literals in compiled template source */ /** Used to match empty string literals in compiled template source */
var reEmptyStringLeading = /\b__p \+= '';/g, var reEmptyStringLeading = /\b__p \+= '';/g,
reEmptyStringMiddle = /\b(__p \+=) '' \+/g, reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
@@ -174,7 +180,7 @@
toString = objectRef.toString; toString = objectRef.toString;
/* Native method shortcuts for methods with the same name as other `lodash` methods */ /* Native method shortcuts for methods with the same name as other `lodash` methods */
var nativeBind = reNative.test(nativeBind = slice.bind) && nativeBind, var nativeBind = reNative.test(nativeBind = toString.bind) && nativeBind,
nativeIsArray = reNative.test(nativeIsArray = Array.isArray) && nativeIsArray, nativeIsArray = reNative.test(nativeIsArray = Array.isArray) && nativeIsArray,
nativeIsFinite = context.isFinite, nativeIsFinite = context.isFinite,
nativeIsNaN = context.isNaN, nativeIsNaN = context.isNaN,
@@ -182,7 +188,8 @@
nativeMax = Math.max, nativeMax = Math.max,
nativeMin = Math.min, nativeMin = Math.min,
nativeParseInt = context.parseInt, nativeParseInt = context.parseInt,
nativeRandom = Math.random; nativeRandom = Math.random,
nativeSlice = arrayRef.slice;
/** Detect various environments */ /** Detect various environments */
var isIeOpera = reNative.test(context.attachEvent), var isIeOpera = reNative.test(context.attachEvent),
@@ -201,7 +208,7 @@
/*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/
/** /**
* Creates a `lodash` object, that wraps the given `value`, to enable method * Creates a `lodash` object, which wraps the given `value`, to enable method
* chaining. * chaining.
* *
* In addition to Lo-Dash methods, wrappers also have the following `Array` methods: * In addition to Lo-Dash methods, wrappers also have the following `Array` methods:
@@ -219,8 +226,8 @@
* `invoke`, `keys`, `map`, `max`, `memoize`, `merge`, `min`, `object`, `omit`, * `invoke`, `keys`, `map`, `max`, `memoize`, `merge`, `min`, `object`, `omit`,
* `once`, `pairs`, `partial`, `partialRight`, `pick`, `pluck`, `push`, `range`, * `once`, `pairs`, `partial`, `partialRight`, `pick`, `pluck`, `push`, `range`,
* `reject`, `rest`, `reverse`, `shuffle`, `slice`, `sort`, `sortBy`, `splice`, * `reject`, `rest`, `reverse`, `shuffle`, `slice`, `sort`, `sortBy`, `splice`,
* `tap`, `throttle`, `times`, `toArray`, `union`, `uniq`, `unshift`, `values`, * `tap`, `throttle`, `times`, `toArray`, `union`, `uniq`, `unshift`, `unzip`,
* `where`, `without`, `wrap`, and `zip` * `values`, `where`, `without`, `wrap`, and `zip`
* *
* The non-chainable wrapper functions are: * The non-chainable wrapper functions are:
* `clone`, `cloneDeep`, `contains`, `escape`, `every`, `find`, `has`, * `clone`, `cloneDeep`, `contains`, `escape`, `every`, `find`, `has`,
@@ -239,6 +246,26 @@
* @category Chaining * @category Chaining
* @param {Mixed} value The value to wrap in a `lodash` instance. * @param {Mixed} value The value to wrap in a `lodash` instance.
* @returns {Object} Returns a `lodash` instance. * @returns {Object} Returns a `lodash` instance.
* @example
*
* var wrapped = _([1, 2, 3]);
*
* // returns an unwrapped value
* wrapped.reduce(function(sum, num) {
* return sum + num;
* });
* // => 6
*
* // returns a wrapped value
* var squares = wrapped.map(function(num) {
* return num * num;
* });
*
* _.isArray(squares);
* // => false
*
* _.isArray(squares.value());
* // => true
*/ */
function lodash(value) { function lodash(value) {
// don't wrap if already wrapped, even if wrapped by a different `lodash` constructor // don't wrap if already wrapped, even if wrapped by a different `lodash` constructor
@@ -266,12 +293,12 @@
for (prop in arguments) { } for (prop in arguments) { }
/** /**
* Detect if `arguments` objects are `Object` objects (all but Opera < 10.5). * Detect if `arguments` objects are `Object` objects (all but Narwhal and Opera < 10.5).
* *
* @memberOf _.support * @memberOf _.support
* @type Boolean * @type Boolean
*/ */
support.argsObject = arguments.constructor == Object; support.argsObject = arguments.constructor == Object && !(arguments instanceof Array);
/** /**
* Detect if an `arguments` object's [[Class]] is resolvable (all but Firefox < 4, IE < 9). * Detect if an `arguments` object's [[Class]] is resolvable (all but Firefox < 4, IE < 9).
@@ -437,7 +464,7 @@
* The template used to create iterator functions. * The template used to create iterator functions.
* *
* @private * @private
* @param {Obect} data The data object used to populate the text. * @param {Object} data The data object used to populate the text.
* @returns {String} Returns the interpolated text. * @returns {String} Returns the interpolated text.
*/ */
var iteratorTemplate = template( var iteratorTemplate = template(
@@ -573,31 +600,27 @@
* @private * @private
* @param {Array} array The array to search. * @param {Array} array The array to search.
* @param {Mixed} value The value to search for. * @param {Mixed} value The value to search for.
* @param {Number} fromIndex The index to search from.
* @param {Number} largeSize The length at which an array is considered large.
* @returns {Boolean} Returns `true`, if `value` is found, else `false`. * @returns {Boolean} Returns `true`, if `value` is found, else `false`.
*/ */
function cachedContains(array, fromIndex, largeSize) { function cachedContains(array) {
var length = array.length, var length = array.length,
isLarge = (length - fromIndex) >= largeSize; isLarge = length >= largeArraySize;
if (isLarge) { if (isLarge) {
var cache = {}, var cache = {},
index = fromIndex - 1; index = -1;
while (++index < length) { while (++index < length) {
// manually coerce `value` to a string because `hasOwnProperty`, in some var key = keyPrefix + array[index];
// older versions of Firefox, coerces objects incorrectly (cache[key] || (cache[key] = [])).push(array[index]);
var key = String(array[index]);
(hasOwnProperty.call(cache, key) ? cache[key] : (cache[key] = [])).push(array[index]);
} }
} }
return function(value) { return function(value) {
if (isLarge) { if (isLarge) {
var key = String(value); var key = keyPrefix + value;
return hasOwnProperty.call(cache, key) && indexOf(cache[key], value) > -1; return cache[key] && indexOf(cache[key], value) > -1;
} }
return indexOf(array, value, fromIndex) > -1; return indexOf(array, value) > -1;
} }
} }
@@ -683,7 +706,7 @@
} }
if (partialArgs.length) { if (partialArgs.length) {
args = args.length args = args.length
? (args = slice(args), rightIndicator ? args.concat(partialArgs) : partialArgs.concat(args)) ? (args = nativeSlice.call(args), rightIndicator ? args.concat(partialArgs) : partialArgs.concat(args))
: partialArgs; : partialArgs;
} }
if (this instanceof bound) { if (this instanceof bound) {
@@ -709,6 +732,7 @@
* @param {Object} [options1, options2, ...] The compile options object(s). * @param {Object} [options1, options2, ...] The compile options object(s).
* arrays - A string of code to determine if the iterable is an array or array-like. * arrays - A string of code to determine if the iterable is an array or array-like.
* useHas - A boolean to specify using `hasOwnProperty` checks in the object loop. * useHas - A boolean to specify using `hasOwnProperty` checks in the object loop.
* useKeys - A boolean to specify using `_.keys` for own property iteration.
* args - A string of comma separated arguments the iteration function will accept. * args - A string of comma separated arguments the iteration function will accept.
* top - A string of code to execute before the iteration branches. * top - A string of code to execute before the iteration branches.
* loop - A string of code to execute in the object loop. * loop - A string of code to execute in the object loop.
@@ -812,7 +836,7 @@
} }
/** /**
* A fallback implementation of `isPlainObject` that checks if a given `value` * A fallback implementation of `isPlainObject` which checks if a given `value`
* is an object created by the `Object` constructor, assuming objects created * is an object created by the `Object` constructor, assuming objects created
* by the `Object` constructor have no inherited enumerable properties and that * by the `Object` constructor have no inherited enumerable properties and that
* there are no `Object.prototype` extensions. * there are no `Object.prototype` extensions.
@@ -920,29 +944,7 @@
} }
/** /**
* Checks if `value` is an array. * A fallback implementation of `Object.keys` which produces an array of the
*
* @static
* @memberOf _
* @category Objects
* @param {Mixed} value The value to check.
* @returns {Boolean} Returns `true`, if the `value` is an array, else `false`.
* @example
*
* (function() { return _.isArray(arguments); })();
* // => false
*
* _.isArray([1, 2, 3]);
* // => true
*/
var isArray = nativeIsArray || function(value) {
// `instanceof` may cause a memory leak in IE 7 if `value` is a host object
// http://ajaxian.com/archives/working-aroung-the-instanceof-memory-leak
return (support.argsObject && value instanceof Array) || toString.call(value) == arrayClass;
};
/**
* A fallback implementation of `Object.keys` that produces an array of the
* given object's own enumerable property names. * given object's own enumerable property names.
* *
* @private * @private
@@ -1263,7 +1265,7 @@
* @static * @static
* @memberOf _ * @memberOf _
* @category Objects * @category Objects
* @param {Array|Object|String} collection The collection to iterate over. * @param {Object} object The object to search.
* @param {Function|Object|String} [callback=identity] The function called per * @param {Function|Object|String} [callback=identity] The function called per
* iteration. If a property name or object is passed, it will be used to create * iteration. If a property name or object is passed, it will be used to create
* a "_.pluck" or "_.where" style callback, respectively. * a "_.pluck" or "_.where" style callback, respectively.
@@ -1271,14 +1273,16 @@
* @returns {Mixed} Returns the key of the found element, else `undefined`. * @returns {Mixed} Returns the key of the found element, else `undefined`.
* @example * @example
* *
* _.findKey({ 'a': 1, 'b': 2, 'c': 3, 'd': 4 }, function(num) { return num % 2 == 0; }); * _.findKey({ 'a': 1, 'b': 2, 'c': 3, 'd': 4 }, function(num) {
* return num % 2 == 0;
* });
* // => 'b' * // => 'b'
*/ */
function findKey(collection, callback, thisArg) { function findKey(object, callback, thisArg) {
var result; var result;
callback = lodash.createCallback(callback, thisArg); callback = lodash.createCallback(callback, thisArg);
forOwn(collection, function(value, key, collection) { forOwn(object, function(value, key, object) {
if (callback(value, key, collection)) { if (callback(value, key, object)) {
result = key; result = key;
return false; return false;
} }
@@ -1412,6 +1416,29 @@
return result; return result;
} }
/**
* Checks if `value` is an array.
*
* @static
* @memberOf _
* @category Objects
* @param {Mixed} value The value to check.
* @returns {Boolean} Returns `true`, if the `value` is an array, else `false`.
* @example
*
* (function() { return _.isArray(arguments); })();
* // => false
*
* _.isArray([1, 2, 3]);
* // => true
*/
function isArray(value) {
// `instanceof` may cause a memory leak in IE 7 if `value` is a host object
// http://ajaxian.com/archives/working-aroung-the-instanceof-memory-leak
return (support.argsObject && value instanceof Array) ||
(nativeIsArray ? nativeIsArray(value) : toString.call(value) == arrayClass);
}
/** /**
* Checks if `value` is a boolean value. * Checks if `value` is a boolean value.
* *
@@ -1546,11 +1573,8 @@
function isEqual(a, b, callback, thisArg, stackA, stackB) { function isEqual(a, b, callback, thisArg, stackA, stackB) {
// used to indicate that when comparing objects, `a` has at least the properties of `b` // used to indicate that when comparing objects, `a` has at least the properties of `b`
var whereIndicator = callback === indicatorObject; var whereIndicator = callback === indicatorObject;
if (callback && !whereIndicator) { if (typeof callback == 'function' && !whereIndicator) {
callback = (typeof thisArg == 'undefined') callback = lodash.createCallback(callback, thisArg, 2);
? callback
: lodash.createCallback(callback, thisArg, 2);
var result = callback(a, b); var result = callback(a, b);
if (typeof result != 'undefined') { if (typeof result != 'undefined') {
return !!result; return !!result;
@@ -2036,22 +2060,24 @@
} }
} }
if (!found) { if (!found) {
value = isArr var isShallow;
? (isArray(value) ? value : [])
: (isPlainObject(value) ? value : {});
if (callback) { if (callback) {
result = callback(value, source); result = callback(value, source);
if (typeof result != 'undefined') { if ((isShallow = typeof result != 'undefined')) {
value = result; value = result;
} }
} }
if (!isShallow) {
value = isArr
? (isArray(value) ? value : [])
: (isPlainObject(value) ? value : {});
}
// add `source` and associated `value` to the stack of traversed objects // add `source` and associated `value` to the stack of traversed objects
stackA.push(source); stackA.push(source);
stackB.push(value); stackB.push(value);
// recursively merge objects and arrays (susceptible to call stack limits) // recursively merge objects and arrays (susceptible to call stack limits)
if (!callback) { if (!isShallow) {
value = merge(value, source, indicatorObject, callback, stackA, stackB); value = merge(value, source, indicatorObject, callback, stackA, stackB);
} }
} }
@@ -2106,12 +2132,12 @@
if (isFunc) { if (isFunc) {
callback = lodash.createCallback(callback, thisArg); callback = lodash.createCallback(callback, thisArg);
} else { } else {
var props = concat.apply(arrayRef, arguments); var props = concat.apply(arrayRef, nativeSlice.call(arguments, 1));
} }
forIn(object, function(value, key, object) { forIn(object, function(value, key, object) {
if (isFunc if (isFunc
? !callback(value, key, object) ? !callback(value, key, object)
: indexOf(props, key, 1) < 0 : indexOf(props, key) < 0
) { ) {
result[key] = value; result[key] = value;
} }
@@ -2174,8 +2200,8 @@
function pick(object, callback, thisArg) { function pick(object, callback, thisArg) {
var result = {}; var result = {};
if (typeof callback != 'function') { if (typeof callback != 'function') {
var index = 0, var index = -1,
props = concat.apply(arrayRef, arguments), props = concat.apply(arrayRef, nativeSlice.call(arguments, 1)),
length = isObject(object) ? props.length : 0; length = isObject(object) ? props.length : 0;
while (++index < length) { while (++index < length) {
@@ -2245,7 +2271,7 @@
*/ */
function at(collection) { function at(collection) {
var index = -1, var index = -1,
props = concat.apply(arrayRef, slice(arguments, 1)), props = concat.apply(arrayRef, nativeSlice.call(arguments, 1)),
length = props.length, length = props.length,
result = Array(length); result = Array(length);
@@ -2500,7 +2526,9 @@
* @returns {Mixed} Returns the found element, else `undefined`. * @returns {Mixed} Returns the found element, else `undefined`.
* @example * @example
* *
* _.find([1, 2, 3, 4], function(num) { return num % 2 == 0; }); * _.find([1, 2, 3, 4], function(num) {
* return num % 2 == 0;
* });
* // => 2 * // => 2
* *
* var food = [ * var food = [
@@ -2648,7 +2676,7 @@
* // => [['1', '2', '3'], ['4', '5', '6']] * // => [['1', '2', '3'], ['4', '5', '6']]
*/ */
function invoke(collection, methodName) { function invoke(collection, methodName) {
var args = slice(arguments, 2), var args = nativeSlice.call(arguments, 2),
index = -1, index = -1,
isFunc = typeof methodName == 'function', isFunc = typeof methodName == 'function',
length = collection ? collection.length : 0, length = collection ? collection.length : 0,
@@ -2878,7 +2906,7 @@
var pluck = map; var pluck = map;
/** /**
* Reduces a `collection` to a value that is the accumulated result of running * Reduces a `collection` to a value which is the accumulated result of running
* each element in the `collection` through the `callback`, where each successive * each element in the `collection` through the `callback`, where each successive
* `callback` execution consumes the return value of the previous execution. * `callback` execution consumes the return value of the previous execution.
* If `accumulator` is not passed, the first element of the `collection` will be * If `accumulator` is not passed, the first element of the `collection` will be
@@ -3285,8 +3313,8 @@
function difference(array) { function difference(array) {
var index = -1, var index = -1,
length = array ? array.length : 0, length = array ? array.length : 0,
flattened = concat.apply(arrayRef, arguments), flattened = concat.apply(arrayRef, nativeSlice.call(arguments, 1)),
contains = cachedContains(flattened, length, 100), contains = cachedContains(flattened),
result = []; result = [];
while (++index < length) { while (++index < length) {
@@ -3305,7 +3333,7 @@
* @static * @static
* @memberOf _ * @memberOf _
* @category Arrays * @category Arrays
* @param {Array|Object|String} collection The collection to iterate over. * @param {Array} array The array to search.
* @param {Function|Object|String} [callback=identity] The function called per * @param {Function|Object|String} [callback=identity] The function called per
* iteration. If a property name or object is passed, it will be used to create * iteration. If a property name or object is passed, it will be used to create
* a "_.pluck" or "_.where" style callback, respectively. * a "_.pluck" or "_.where" style callback, respectively.
@@ -3313,16 +3341,18 @@
* @returns {Mixed} Returns the index of the found element, else `-1`. * @returns {Mixed} Returns the index of the found element, else `-1`.
* @example * @example
* *
* _.findIndex(['apple', 'banana', 'beet'], function(food) { return /^b/.test(food); }); * _.findIndex(['apple', 'banana', 'beet'], function(food) {
* return /^b/.test(food);
* });
* // => 1 * // => 1
*/ */
function findIndex(collection, callback, thisArg) { function findIndex(array, callback, thisArg) {
var index = -1, var index = -1,
length = collection ? collection.length : 0; length = array ? array.length : 0;
callback = lodash.createCallback(callback, thisArg); callback = lodash.createCallback(callback, thisArg);
while (++index < length) { while (++index < length) {
if (callback(collection[index], index, collection)) { if (callback(array[index], index, array)) {
return index; return index;
} }
} }
@@ -3424,7 +3454,7 @@
* @static * @static
* @memberOf _ * @memberOf _
* @category Arrays * @category Arrays
* @param {Array} array The array to compact. * @param {Array} array The array to flatten.
* @param {Boolean} [isShallow=false] A flag to indicate only flattening a single level. * @param {Boolean} [isShallow=false] A flag to indicate only flattening a single level.
* @param {Function|Object|String} [callback=identity] The function called per * @param {Function|Object|String} [callback=identity] The function called per
* iteration. If a property name or object is passed, it will be used to create * iteration. If a property name or object is passed, it will be used to create
@@ -3615,7 +3645,7 @@
cache = { '0': {} }, cache = { '0': {} },
index = -1, index = -1,
length = array ? array.length : 0, length = array ? array.length : 0,
isLarge = length >= 100, isLarge = length >= largeArraySize,
result = [], result = [],
seen = result; seen = result;
@@ -3623,8 +3653,8 @@
while (++index < length) { while (++index < length) {
var value = array[index]; var value = array[index];
if (isLarge) { if (isLarge) {
var key = String(value); var key = keyPrefix + value;
var inited = hasOwnProperty.call(cache[0], key) var inited = cache[0][key]
? !(seen = cache[0][key]) ? !(seen = cache[0][key])
: (seen = cache[0][key] = []); : (seen = cache[0][key] = []);
} }
@@ -3634,7 +3664,7 @@
} }
var argsIndex = argsLength; var argsIndex = argsLength;
while (--argsIndex) { while (--argsIndex) {
if (!(cache[argsIndex] || (cache[argsIndex] = cachedContains(args[argsIndex], 0, 100)))(value)) { if (!(cache[argsIndex] || (cache[argsIndex] = cachedContains(args[argsIndex])))(value)) {
continue outer; continue outer;
} }
} }
@@ -3895,7 +3925,7 @@
* @static * @static
* @memberOf _ * @memberOf _
* @category Arrays * @category Arrays
* @param {Array} array The array to iterate over. * @param {Array} array The array to inspect.
* @param {Mixed} value The value to evaluate. * @param {Mixed} value The value to evaluate.
* @param {Function|Object|String} [callback=identity] The function called per * @param {Function|Object|String} [callback=identity] The function called per
* iteration. If a property name or object is passed, it will be used to create * iteration. If a property name or object is passed, it will be used to create
@@ -3958,7 +3988,10 @@
* _.union([1, 2, 3], [101, 2, 1, 10], [2, 1]); * _.union([1, 2, 3], [101, 2, 1, 10], [2, 1]);
* // => [1, 2, 3, 101, 10] * // => [1, 2, 3, 101, 10]
*/ */
function union() { function union(array) {
if (!isArray(array)) {
arguments[0] = array ? nativeSlice.call(array) : arrayRef;
}
return uniq(concat.apply(arrayRef, arguments)); return uniq(concat.apply(arrayRef, arguments));
} }
@@ -4018,7 +4051,7 @@
isSorted = false; isSorted = false;
} }
// init value cache for large arrays // init value cache for large arrays
var isLarge = !isSorted && length >= 75; var isLarge = !isSorted && length >= largeArraySize;
if (isLarge) { if (isLarge) {
var cache = {}; var cache = {};
} }
@@ -4031,8 +4064,8 @@
computed = callback ? callback(value, index, array) : value; computed = callback ? callback(value, index, array) : value;
if (isLarge) { if (isLarge) {
var key = String(computed); var key = keyPrefix + computed;
var inited = hasOwnProperty.call(cache, key) var inited = cache[key]
? !(seen = cache[key]) ? !(seen = cache[key])
: (seen = cache[key] = []); : (seen = cache[key] = []);
} }
@@ -4049,6 +4082,37 @@
return result; 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 ? array.length : 0,
tupleLength = length ? max(pluck(array, 'length')) : 0,
result = Array(tupleLength);
while (++index < length) {
var tupleIndex = -1,
tuple = array[index];
while (++tupleIndex < tupleLength) {
(result[tupleIndex] || (result[tupleIndex] = Array(length)))[index] = tuple[tupleIndex];
}
}
return result;
}
/** /**
* Creates an array with all occurrences of the passed values removed using * Creates an array with all occurrences of the passed values removed using
* strict equality for comparisons, i.e. `===`. * strict equality for comparisons, i.e. `===`.
@@ -4065,18 +4129,7 @@
* // => [2, 3, 4] * // => [2, 3, 4]
*/ */
function without(array) { function without(array) {
var index = -1, return difference(array, nativeSlice.call(arguments, 1));
length = array ? array.length : 0,
contains = cachedContains(arguments, 1, 30),
result = [];
while (++index < length) {
var value = array[index];
if (!contains(value)) {
result.push(value);
}
}
return result;
} }
/** /**
@@ -4202,7 +4255,7 @@
// (in V8 `Function#bind` is slower except when partially applied) // (in V8 `Function#bind` is slower except when partially applied)
return support.fastBind || (nativeBind && arguments.length > 2) return support.fastBind || (nativeBind && arguments.length > 2)
? nativeBind.call.apply(nativeBind, arguments) ? nativeBind.call.apply(nativeBind, arguments)
: createBound(func, thisArg, slice(arguments, 2)); : createBound(func, thisArg, nativeSlice.call(arguments, 2));
} }
/** /**
@@ -4229,8 +4282,8 @@
* // => alerts 'clicked docs', when the button is clicked * // => alerts 'clicked docs', when the button is clicked
*/ */
function bindAll(object) { function bindAll(object) {
var funcs = concat.apply(arrayRef, arguments), var funcs = arguments.length > 1 ? concat.apply(arrayRef, nativeSlice.call(arguments, 1)) : functions(object),
index = funcs.length > 1 ? 0 : (funcs = functions(object), -1), index = -1,
length = funcs.length; length = funcs.length;
while (++index < length) { while (++index < length) {
@@ -4275,7 +4328,7 @@
* // => 'hi, moe!' * // => 'hi, moe!'
*/ */
function bindKey(object, key) { function bindKey(object, key) {
return createBound(object, key, slice(arguments, 2), indicatorObject); return createBound(object, key, nativeSlice.call(arguments, 2), indicatorObject);
} }
/** /**
@@ -4405,44 +4458,53 @@
/** /**
* Creates a function that will delay the execution of `func` until after * Creates a function that will delay the execution of `func` until after
* `wait` milliseconds have elapsed since the last time it was invoked. Pass * `wait` milliseconds have elapsed since the last time it was invoked. Pass
* `true` for `immediate` to cause debounce to invoke `func` on the leading, * an `options` object to indicate that `func` should be invoked on the leading
* instead of the trailing, edge of the `wait` timeout. Subsequent calls to * and/or trailing edge of the `wait` timeout. Subsequent calls to the debounced
* the debounced function will return the result of the last `func` call. * function will return the result of the last `func` call.
* *
* @static * @static
* @memberOf _ * @memberOf _
* @category Functions * @category Functions
* @param {Function} func The function to debounce. * @param {Function} func The function to debounce.
* @param {Number} wait The number of milliseconds to delay. * @param {Number} wait The number of milliseconds to delay.
* @param {Boolean} immediate A flag to indicate execution is on the leading * @param {Object} options The options object.
* edge of the timeout. * [leading=false] A boolean to specify execution on the leading edge of the timeout.
* [trailing=true] A boolean to specify execution on the trailing edge of the timeout.
* @returns {Function} Returns the new debounced function. * @returns {Function} Returns the new debounced function.
* @example * @example
* *
* var lazyLayout = _.debounce(calculateLayout, 300); * var lazyLayout = _.debounce(calculateLayout, 300);
* jQuery(window).on('resize', lazyLayout); * jQuery(window).on('resize', lazyLayout);
*/ */
function debounce(func, wait, immediate) { function debounce(func, wait, options) {
var args, var args,
result, result,
thisArg, thisArg,
timeoutId; timeoutId,
trailing = true;
function delayed() { function delayed() {
timeoutId = null; timeoutId = null;
if (!immediate) { if (trailing) {
result = func.apply(thisArg, args); result = func.apply(thisArg, args);
} }
} }
if (options === true) {
var leading = true;
trailing = false;
} else if (options && objectTypes[typeof options]) {
leading = options.leading;
trailing = 'trailing' in options ? options.trailing : trailing;
}
return function() { return function() {
var isImmediate = immediate && !timeoutId; var isLeading = leading && !timeoutId;
args = arguments; args = arguments;
thisArg = this; thisArg = this;
clearTimeout(timeoutId); clearTimeout(timeoutId);
timeoutId = setTimeout(delayed, wait); timeoutId = setTimeout(delayed, wait);
if (isImmediate) { if (isLeading) {
result = func.apply(thisArg, args); result = func.apply(thisArg, args);
} }
return result; return result;
@@ -4465,7 +4527,7 @@
* // returns from the function before `alert` is called * // returns from the function before `alert` is called
*/ */
function defer(func) { function defer(func) {
var args = slice(arguments, 1); var args = nativeSlice.call(arguments, 1);
return setTimeout(function() { func.apply(undefined, args); }, 1); return setTimeout(function() { func.apply(undefined, args); }, 1);
} }
// use `setImmediate` if it's available in Node.js // use `setImmediate` if it's available in Node.js
@@ -4491,7 +4553,7 @@
* // => 'logged later' (Appears after one second.) * // => 'logged later' (Appears after one second.)
*/ */
function delay(func, wait) { function delay(func, wait) {
var args = slice(arguments, 2); var args = nativeSlice.call(arguments, 2);
return setTimeout(function() { func.apply(undefined, args); }, wait); return setTimeout(function() { func.apply(undefined, args); }, wait);
} }
@@ -4517,7 +4579,7 @@
function memoize(func, resolver) { function memoize(func, resolver) {
var cache = {}; var cache = {};
return function() { return function() {
var key = String(resolver ? resolver.apply(this, arguments) : arguments[0]); var key = keyPrefix + (resolver ? resolver.apply(this, arguments) : arguments[0]);
return hasOwnProperty.call(cache, key) return hasOwnProperty.call(cache, key)
? cache[key] ? cache[key]
: (cache[key] = func.apply(this, arguments)); : (cache[key] = func.apply(this, arguments));
@@ -4577,7 +4639,7 @@
* // => 'hi moe' * // => 'hi moe'
*/ */
function partial(func) { function partial(func) {
return createBound(func, slice(arguments, 1)); return createBound(func, nativeSlice.call(arguments, 1));
} }
/** /**
@@ -4608,43 +4670,61 @@
* // => { '_': _, 'jq': $ } * // => { '_': _, 'jq': $ }
*/ */
function partialRight(func) { function partialRight(func) {
return createBound(func, slice(arguments, 1), null, indicatorObject); return createBound(func, nativeSlice.call(arguments, 1), null, indicatorObject);
} }
/** /**
* Creates a function that, when executed, will only call the `func` * Creates a function that, when executed, will only call the `func` function
* function at most once per every `wait` milliseconds. If the throttled * at most once per every `wait` milliseconds. If the throttled function is
* function is invoked more than once during the `wait` timeout, `func` will * invoked more than once during the `wait` timeout, `func` will also be called
* also be called on the trailing edge of the timeout. Subsequent calls to the * on the trailing edge of the timeout. Pass an `options` object to indicate
* throttled function will return the result of the last `func` call. * that `func` should be invoked on the leading and/or trailing edge of the
* `wait` timeout. Subsequent calls to the throttled function will return
* the result of the last `func` call.
* *
* @static * @static
* @memberOf _ * @memberOf _
* @category Functions * @category Functions
* @param {Function} func The function to throttle. * @param {Function} func The function to throttle.
* @param {Number} wait The number of milliseconds to throttle executions to. * @param {Number} wait The number of milliseconds to throttle executions to.
* @param {Object} options The options object.
* [leading=true] A boolean to specify execution on the leading edge of the timeout.
* [trailing=true] A boolean to specify execution on the trailing edge of the timeout.
* @returns {Function} Returns the new throttled function. * @returns {Function} Returns the new throttled function.
* @example * @example
* *
* var throttled = _.throttle(updatePosition, 100); * var throttled = _.throttle(updatePosition, 100);
* jQuery(window).on('scroll', throttled); * jQuery(window).on('scroll', throttled);
*/ */
function throttle(func, wait) { function throttle(func, wait, options) {
var args, var args,
result, result,
thisArg, thisArg,
timeoutId, timeoutId,
lastCalled = 0; lastCalled = 0,
leading = true,
trailing = true;
function trailingCall() { function trailingCall() {
lastCalled = new Date; lastCalled = new Date;
timeoutId = null; timeoutId = null;
result = func.apply(thisArg, args);
if (trailing) {
result = func.apply(thisArg, args);
}
}
if (options === false) {
leading = false;
} else if (options && objectTypes[typeof options]) {
leading = 'leading' in options ? options.leading : leading;
trailing = 'trailing' in options ? options.trailing : trailing;
} }
return function() { return function() {
var now = new Date, var now = new Date;
remaining = wait - (now - lastCalled); if (!timeoutId && !leading) {
lastCalled = now;
}
var remaining = wait - (now - lastCalled);
args = arguments; args = arguments;
thisArg = this; thisArg = this;
@@ -4874,9 +4954,6 @@
* Note: In the development build, `_.template` utilizes sourceURLs for easier * Note: In the development build, `_.template` utilizes sourceURLs for easier
* debugging. See http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl * debugging. See http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl
* *
* Note: Lo-Dash may be used in Chrome extensions by either creating a `lodash csp`
* build and using precompiled templates, or loading Lo-Dash in a sandbox.
*
* For more information on precompiling templates see: * For more information on precompiling templates see:
* http://lodash.com/#custom-builds * http://lodash.com/#custom-builds
* *
@@ -4887,7 +4964,7 @@
* @memberOf _ * @memberOf _
* @category Utilities * @category Utilities
* @param {String} text The template text. * @param {String} text The template text.
* @param {Obect} data The data object used to populate the text. * @param {Object} data The data object used to populate the text.
* @param {Object} options The options object. * @param {Object} options The options object.
* escape - The "escape" delimiter regexp. * escape - The "escape" delimiter regexp.
* evaluate - The "evaluate" delimiter regexp. * evaluate - The "evaluate" delimiter regexp.
@@ -5087,7 +5164,7 @@
} }
/** /**
* The opposite of `_.escape`, this method converts the HTML entities * The inverse of `_.escape`, this method converts the HTML entities
* `&amp;`, `&lt;`, `&gt;`, `&quot;`, and `&#39;` in `string` to their * `&amp;`, `&lt;`, `&gt;`, `&quot;`, and `&#39;` in `string` to their
* corresponding characters. * corresponding characters.
* *
@@ -5240,6 +5317,7 @@
lodash.toArray = toArray; lodash.toArray = toArray;
lodash.union = union; lodash.union = union;
lodash.uniq = uniq; lodash.uniq = uniq;
lodash.unzip = unzip;
lodash.values = values; lodash.values = values;
lodash.where = where; lodash.where = where;
lodash.without = without; lodash.without = without;
@@ -5357,7 +5435,7 @@
* @memberOf _ * @memberOf _
* @type String * @type String
*/ */
lodash.VERSION = '1.1.1'; lodash.VERSION = '1.2.0';
// add "Chaining" functions to the wrapper // add "Chaining" functions to the wrapper
lodash.prototype.toString = wrapperToString; lodash.prototype.toString = wrapperToString;

View File

@@ -1,9 +1,10 @@
{ {
"name": "lodash", "name": "lodash",
"version": "1.1.1", "version": "1.2.0",
"description": "A low-level utility library delivering consistency, customization, performance, and extra features.", "description": "A low-level utility library delivering consistency, customization, performance, and extra features.",
"homepage": "http://lodash.com", "homepage": "http://lodash.com",
"main": "./dist/lodash", "license": "MIT",
"main": "./dist/lodash.js",
"keywords": [ "keywords": [
"browser", "browser",
"client", "client",
@@ -13,12 +14,6 @@
"speed", "speed",
"util" "util"
], ],
"licenses": [
{
"type": "MIT",
"url": "http://lodash.com/license"
}
],
"author": { "author": {
"name": "John-David Dalton", "name": "John-David Dalton",
"email": "john.david.dalton@gmail.com", "email": "john.david.dalton@gmail.com",
@@ -34,19 +29,11 @@
"bin": { "bin": {
"lodash": "./build.js" "lodash": "./build.js"
}, },
"directories": {
"doc": "./doc",
"test": "./test"
},
"engines": [ "engines": [
"node", "node",
"rhino" "rhino"
], ],
"jam": { "jam": {
"main": "./lodash.js" "main": "./lodash.js"
},
"scripts": {
"build": "node ./build.js",
"test": "node ./test/test.js ./dist/lodash.js && node ./test/test.js ./dist/lodash.min.js && node ./test/test-build.js"
} }
} }

View File

@@ -182,23 +182,31 @@
aHz = getHz(this[0]), aHz = getHz(this[0]),
bHz = getHz(this[1]); bHz = getHz(this[1]);
if (fastest.length > 1) { for (var index = 0, length = this.length; index < length; index++) {
log('It\'s too close to call.'); var bench = this[index];
aHz = bHz = slowestHz; if (bench.error) {
var errored = true;
log(bench.error);
}
} }
else { if (!errored) {
var percent = ((fastestHz / slowestHz) - 1) * 100; if (fastest.length > 1) {
log('It\'s too close to call.');
aHz = bHz = slowestHz;
}
else {
var percent = ((fastestHz / slowestHz) - 1) * 100;
log( log(
fastest[0].name + ' is ' + fastest[0].name + ' is ' +
formatNumber(percent < 1 ? percent.toFixed(2) : Math.round(percent)) + formatNumber(percent < 1 ? percent.toFixed(2) : Math.round(percent)) +
'% faster.' '% faster.'
); );
}
// add score adjusted for margin of error
score.a += aHz;
score.b += bHz;
} }
// add score adjusted for margin of error
score.a += aHz;
score.b += bHz;
// remove current suite from queue // remove current suite from queue
suites.shift(); suites.shift();
@@ -378,12 +386,14 @@
fiftyValues2 = Array(50),\ fiftyValues2 = Array(50),\
seventyFiveValues = Array(75),\ seventyFiveValues = Array(75),\
seventyFiveValues2 = Array(75),\ seventyFiveValues2 = Array(75),\
hundredValues = Array(100),\ oneHundredValues = Array(100),\
hundredValues2 = Array(100),\ oneHundredValues2 = Array(100),\
twoHundredValues = Array(200),\
twoHundredValues2 = Array(200),\
lowerChars = "abcdefghijklmnopqrstuvwxyz".split(""),\ lowerChars = "abcdefghijklmnopqrstuvwxyz".split(""),\
upperChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ".split("");\ upperChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ".split("");\
\ \
for (index = 0; index < 100; index++) {\ for (index = 0; index < 200; index++) {\
if (index < 15) {\ if (index < 15) {\
twentyValues[index] = lowerChars[index];\ twentyValues[index] = lowerChars[index];\
twentyValues2[index] = upperChars[index];\ twentyValues2[index] = upperChars[index];\
@@ -403,13 +413,15 @@
fortyValues[index] =\ fortyValues[index] =\
fiftyValues[index] =\ fiftyValues[index] =\
seventyFiveValues[index] =\ seventyFiveValues[index] =\
hundredValues[index] = lowerChars[index];\ oneHundredValues[index] =\
twoHundredValues[index] = lowerChars[index];\
\ \
thirtyValues2[index] =\ thirtyValues2[index] =\
fortyValues2[index] =\ fortyValues2[index] =\
fiftyValues2[index] =\ fiftyValues2[index] =\
seventyFiveValues2[index] =\ seventyFiveValues2[index] =\
hundredValues2[index] = upperChars[index];\ oneHundredValues2[index] =\
twoHundredValues2[index] = upperChars[index];\
}\ }\
else {\ else {\
if (index < 30) {\ if (index < 30) {\
@@ -428,8 +440,12 @@
seventyFiveValues[index] =\ seventyFiveValues[index] =\
seventyFiveValues2[index] = index;\ seventyFiveValues2[index] = index;\
}\ }\
hundredValues[index] =\ if (index < 100) {\
hundredValues2[index] = index;\ oneHundredValues[index] =\
oneHundredValues2[index] = index;\
}\
twoHundredValues[index] =\
twoHundredValues2[index] = index;\
}\ }\
}\ }\
}\ }\
@@ -487,6 +503,10 @@
var _findWhere = _.findWhere || _.find,\ var _findWhere = _.findWhere || _.find,\
lodashFindWhere = lodash.findWhere || lodash.find,\ lodashFindWhere = lodash.findWhere || lodash.find,\
whereObject = { "num": 9 };\ whereObject = { "num": 9 };\
}\
if (typeof zip != "undefined") {\
var unzipped = [["a", "b", "c"], [1, 2, 3], [true, false, true]],\
zipped = [["a", 1, true], ["b", 2, false], ["c", 3, true]];\
}' }'
}); });
@@ -734,13 +754,13 @@
); );
suites.push( suites.push(
Benchmark.Suite('`_.difference` iterating 100 elements') Benchmark.Suite('`_.difference` iterating 200 elements')
.add(buildName, { .add(buildName, {
'fn': 'lodash.difference(hundredValues, hundredValues2)', 'fn': 'lodash.difference(twoHundredValues, twoHundredValues2)',
'teardown': 'function multiArrays(){}' 'teardown': 'function multiArrays(){}'
}) })
.add(otherName, { .add(otherName, {
'fn': '_.difference(hundredValues, hundredValues2)', 'fn': '_.difference(twoHundredValues, twoHundredValues2)',
'teardown': 'function multiArrays(){}' 'teardown': 'function multiArrays(){}'
}) })
); );
@@ -1043,13 +1063,13 @@
); );
suites.push( suites.push(
Benchmark.Suite('`_.intersection` iterating 100 elements') Benchmark.Suite('`_.intersection` iterating 200 elements')
.add(buildName, { .add(buildName, {
'fn': 'lodash.intersection(hundredValues, hundredValues2)', 'fn': 'lodash.intersection(twoHundredValues, twoHundredValues2)',
'teardown': 'function multiArrays(){}' 'teardown': 'function multiArrays(){}'
}) })
.add(otherName, { .add(otherName, {
'fn': '_.intersection(hundredValues, hundredValues2)', 'fn': '_.intersection(twoHundredValues, twoHundredValues2)',
'teardown': 'function multiArrays(){}' 'teardown': 'function multiArrays(){}'
}) })
); );
@@ -1739,19 +1759,33 @@
); );
suites.push( suites.push(
Benchmark.Suite('`_.uniq` iterating an array of 75 elements') Benchmark.Suite('`_.uniq` iterating an array of 200 elements')
.add(buildName, { .add(buildName, {
'fn': 'lodash.uniq(fiftyValues.concat(twentyFiveValues2));', 'fn': 'lodash.uniq(oneHundredValues.concat(oneHundredValues2));',
'teardown': 'function multiArrays(){}' 'teardown': 'function multiArrays(){}'
}) })
.add(otherName, { .add(otherName, {
'fn': '_.uniq(fiftyValues.concat(twentyFiveValues2));', 'fn': '_.uniq(oneHundredValues.concat(oneHundredValues2));',
'teardown': 'function multiArrays(){}' 'teardown': 'function multiArrays(){}'
}) })
); );
/*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/
suites.push(
Benchmark.Suite('`_.unzip`')
.add(buildName, {
'fn': 'lodash.unzip(zipped);',
'teardown': 'function zip(){}'
})
.add(otherName, {
'fn': '_.unzip(zipped);',
'teardown': 'function zip(){}'
})
);
/*--------------------------------------------------------------------------*/
suites.push( suites.push(
Benchmark.Suite('`_.values`') Benchmark.Suite('`_.values`')
.add(buildName, '\ .add(buildName, '\
@@ -1788,15 +1822,17 @@
) )
); );
/*--------------------------------------------------------------------------*/
suites.push( suites.push(
Benchmark.Suite('`_.without` iterating an array of 30 elements') Benchmark.Suite('`_.zip`')
.add(buildName, { .add(buildName, {
'fn': 'lodash.without.apply(lodash, [thirtyValues].concat(thirtyValues2));', 'fn': 'lodash.zip.apply(lodash, unzipped);',
'teardown': 'function multiArrays(){}' 'teardown': 'function zip(){}'
}) })
.add(otherName, { .add(otherName, {
'fn': '_.without.apply(_, [thirtyValues].concat(thirtyValues2));', 'fn': '_.zip.apply(_, unzipped);',
'teardown': 'function multiArrays(){}' 'teardown': 'function zip(){}'
}) })
); );

View File

@@ -3,21 +3,21 @@
'use strict'; 'use strict';
/** Load Node.js modules */ /** Load Node.js modules */
var fs = require('fs'), var vm = require('vm');
path = require('path'),
vm = require('vm');
/** Load other modules */ /** Load other modules */
var build = require('../build.js'), var _ = require('../lodash.js'),
minify = require('../build/minify'), build = require('../build.js'),
_ = require('../lodash.js'); minify = require('../build/minify.js'),
util = require('../build/util.js');
/** Module shortcuts */
var fs = util.fs,
path = util.path;
/** Used to avoid `noglobal` false positives caused by `errno` leaked in Node.js */ /** Used to avoid `noglobal` false positives caused by `errno` leaked in Node.js */
global.errno = true; global.errno = true;
/** Add `path.sep` for older versions of Node.js */
path.sep || (path.sep = process.platform == 'win32' ? '\\' : '/');
/** The current working directory */ /** The current working directory */
var cwd = process.cwd(); var cwd = process.cwd();
@@ -90,10 +90,12 @@
}; };
/** List of all Lo-Dash methods */ /** List of all Lo-Dash methods */
var allMethods = _.functions(_) var lodashMethods = _.functions(_).filter(function(methodName) {
.filter(function(methodName) { return !/^_/.test(methodName); }) return !/^_/.test(methodName);
.concat('chain') });
.sort();
/** List of all methods */
var allMethods = lodashMethods.concat('chain', 'findWhere');
/** List of "Arrays" category methods */ /** List of "Arrays" category methods */
var arraysMethods = [ var arraysMethods = [
@@ -118,6 +120,7 @@
'union', 'union',
'uniq', 'uniq',
'unique', 'unique',
'unzip',
'without', 'without',
'zip', 'zip',
'zipObject' 'zipObject'
@@ -125,6 +128,7 @@
/** List of "Chaining" category methods */ /** List of "Chaining" category methods */
var chainingMethods = [ var chainingMethods = [
'chain',
'tap', 'tap',
'value' 'value'
]; ];
@@ -142,6 +146,7 @@
'every', 'every',
'filter', 'filter',
'find', 'find',
'findWhere',
'foldl', 'foldl',
'foldr', 'foldr',
'forEach', 'forEach',
@@ -296,8 +301,8 @@
'without' 'without'
]; ];
/** List of methods used by Underscore */ /** List of Lo-Dash only methods */
var underscoreMethods = _.without.apply(_, [allMethods].concat([ var lodashOnlyMethods = [
'at', 'at',
'bindKey', 'bindKey',
'cloneDeep', 'cloneDeep',
@@ -310,8 +315,12 @@
'merge', 'merge',
'parseInt', 'parseInt',
'partialRight', 'partialRight',
'runInContext' 'runInContext',
])); 'unzip'
];
/** List of Underscore methods */
var underscoreMethods = _.without.apply(_, [allMethods].concat(lodashOnlyMethods));
/*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/
@@ -573,9 +582,12 @@
context._ = _; context._ = _;
vm.runInContext(data.source, context); vm.runInContext(data.source, context);
equal(_.templates.a(object.a).replace(/[\r\n]+/g, ''), '<ul><li>moe</li><li>larry</li><li>curly</li></ul>', basename); var actual = _.templates.a(object.a);
equal(actual.replace(/[\r\n]+/g, ''), '<ul><li>moe</li><li>larry</li><li>curly</li></ul>', basename);
equal(_.templates.b(object.b), 'Hello stooge.', basename); equal(_.templates.b(object.b), 'Hello stooge.', basename);
equal(_.templates.c(object.c), 'Hello ES6!', basename); equal(_.templates.c(object.c), 'Hello ES6!', basename);
delete _.templates; delete _.templates;
start(); start();
}); });
@@ -608,7 +620,9 @@
equal(moduleId, expectedId, basename); equal(moduleId, expectedId, basename);
ok('a' in _.templates && 'b' in _.templates, basename); ok('a' in _.templates && 'b' in _.templates, basename);
equal(_.templates.a({ 'people': ['moe', 'larry'] }), '<ul>\n<li>moe</li><li>larry</li>\n</ul>', basename);
var actual = _.templates.a({ 'people': ['moe', 'larry'] });
equal(actual.replace(/[\r\n]+/g, ''), '<ul><li>moe</li><li>larry</li></ul>', basename);
delete _.templates; delete _.templates;
start(); start();
@@ -693,7 +707,71 @@
/*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/
QUnit.module('source maps'); QUnit.module('csp modifier');
(function() {
asyncTest('`lodash csp`', function() {
var sources = [];
var check = _.after(2, _.once(function() {
ok(_.every(sources, function(source) {
// remove `Function` in `_.template` before testing for additional use
return !/\bFunction\(/.test(source.replace(/= *\w+\(\w+, *['"]return.+?apply[^)]+\)/, ''));
}));
equal(sources[0], sources[1]);
QUnit.start();
}));
var callback = function(data) {
// remove copyright header and append to `sources`
sources.push(data.source.replace(/^\/\**[\s\S]+?\*\/\n/, ''));
check();
};
build(['-s', '-d', 'csp'], callback);
build(['-s', '-d', 'modern'], callback);
});
}());
/*--------------------------------------------------------------------------*/
QUnit.module('mobile modifier');
(function() {
asyncTest('`lodash mobile`', function() {
var start = _.after(2, _.once(QUnit.start));
build(['-s', 'mobile'], function(data) {
var array = [1, 2, 3],
basename = path.basename(data.outputPath, '.js'),
context = createContext(),
object1 = [{ 'a': 1 }],
object2 = [{ 'b': 2 }],
object3 = [{ 'a': 1, 'b': 2 }],
circular1 = { 'a': 1 },
circular2 = { 'a': 1 };
circular1.b = circular1;
circular2.b = circular2;
vm.runInContext(data.source, context);
var lodash = context._;
deepEqual(lodash.merge(object1, object2), object3, basename);
deepEqual(lodash.sortBy([3, 2, 1], _.identity), array, basename);
strictEqual(lodash.isEqual(circular1, circular2), true, basename);
var actual = lodash.cloneDeep(circular1);
ok(actual != circular1 && actual.b == actual, basename);
start();
});
});
}());
/*--------------------------------------------------------------------------*/
QUnit.module('source-map modifier');
(function() { (function() {
var mapCommands = [ var mapCommands = [
@@ -792,50 +870,6 @@
/*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/
QUnit.module('underscore chaining methods');
(function() {
var commands = [
'backbone',
'underscore'
];
commands.forEach(function(command) {
asyncTest('`lodash ' + command +'`', function() {
var start = _.after(2, _.once(QUnit.start));
build(['-s', command], function(data) {
var basename = path.basename(data.outputPath, '.js'),
context = createContext();
vm.runInContext(data.source, context);
var lodash = context._;
ok(lodash.chain(1) instanceof lodash, '_.chain: ' + basename);
ok(lodash(1).chain() instanceof lodash, '_#chain: ' + basename);
var wrapped = lodash(1);
strictEqual(wrapped.identity(), 1, '_(...) wrapped values are not chainable by default: ' + basename);
equal(String(wrapped) === '1', false, '_#toString should not be implemented: ' + basename);
equal(Number(wrapped) === 1 , false, '_#valueOf should not be implemented: ' + basename);
wrapped.chain();
ok(wrapped.has('x') instanceof lodash, '_#has returns wrapped values when chaining: ' + basename);
ok(wrapped.join() instanceof lodash, '_#join returns wrapped values when chaining: ' + basename);
wrapped = lodash([1, 2, 3]);
ok(wrapped.pop() instanceof lodash, '_#pop returns wrapped values: ' + basename);
ok(wrapped.shift() instanceof lodash, '_#shift returns wrapped values: ' + basename);
deepEqual(wrapped.splice(0, 0).value(), [2], '_#splice returns wrapper: ' + basename);
start();
});
});
});
}());
/*--------------------------------------------------------------------------*/
QUnit.module('underscore modifier'); QUnit.module('underscore modifier');
(function() { (function() {
@@ -970,22 +1004,7 @@
vm.runInContext(data.source, context); vm.runInContext(data.source, context);
var lodash = context._; var lodash = context._;
_.each([ _.each(lodashOnlyMethods.concat('assign'), function(methodName) {
'assign',
'at',
'bindKey',
'createCallback',
'findIndex',
'findKey',
'forIn',
'forOwn',
'isPlainObject',
'merge',
'parseInt',
'partialRight',
'runInContext',
'zipObject'
], function(methodName) {
equal(lodash[methodName], undefined, '_.' + methodName + ' should not exist: ' + basename); equal(lodash[methodName], undefined, '_.' + methodName + ' should not exist: ' + basename);
}); });
@@ -993,23 +1012,6 @@
}); });
}); });
asyncTest('`lodash underscore include=findWhere`', function() {
var start = _.after(2, _.once(QUnit.start));
build(['-s', 'underscore', 'include=findWhere'], 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();
});
});
asyncTest('`lodash underscore include=partial`', function() { asyncTest('`lodash underscore include=partial`', function() {
var start = _.after(2, _.once(QUnit.start)); var start = _.after(2, _.once(QUnit.start));
@@ -1059,6 +1061,51 @@
/*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/
QUnit.module('underscore chaining methods');
(function() {
var commands = [
'backbone',
'underscore',
'modern plus=chain'
];
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._;
ok(lodash.chain(1) instanceof lodash, '_.chain: ' + basename);
ok(lodash(1).chain() instanceof lodash, '_#chain: ' + basename);
var wrapped = lodash(1);
strictEqual(wrapped.identity(), 1, '_(...) wrapped values are not chainable by default: ' + basename);
equal(String(wrapped) === '1', false, '_#toString should not be implemented: ' + basename);
equal(Number(wrapped) === 1 , false, '_#valueOf should not be implemented: ' + basename);
wrapped.chain();
ok(wrapped.has('x') instanceof lodash, '_#has returns wrapped values when chaining: ' + basename);
ok(wrapped.join() instanceof lodash, '_#join returns wrapped values when chaining: ' + basename);
wrapped = lodash([1, 2, 3]);
ok(wrapped.pop() instanceof lodash, '_#pop returns wrapped values: ' + basename);
ok(wrapped.shift() instanceof lodash, '_#shift returns wrapped values: ' + basename);
deepEqual(wrapped.splice(0, 0).value(), [2], '_#splice returns wrapper: ' + basename);
start();
});
});
});
}());
/*--------------------------------------------------------------------------*/
QUnit.module('exports command'); QUnit.module('exports command');
(function() { (function() {
@@ -1197,7 +1244,66 @@
/*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/
QUnit.module('output options'); 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() {
var commands = [
'-n',
'--no-dep'
];
commands.forEach(function(command) {
asyncTest('`lodash modern include=each ' + command +'`', function() {
var start = _.after(2, _.once(QUnit.start));
build(['-s', 'modern', 'include=each', command], function(data) {
var basename = path.basename(data.outputPath, '.js'),
context = createContext();
vm.runInContext(data.source, context);
var lodash = context._;
deepEqual(_.functions(lodash), ['each', 'forEach'], basename);
start();
});
});
});
}());
/*--------------------------------------------------------------------------*/
QUnit.module('output option');
(function() { (function() {
var nestedPath = path.join(__dirname, 'a', 'b'); var nestedPath = path.join(__dirname, 'a', 'b');
@@ -1238,7 +1344,7 @@
/*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/
QUnit.module('stdout options'); QUnit.module('stdout option');
(function() { (function() {
var commands = [ var commands = [
@@ -1269,64 +1375,6 @@
/*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/
QUnit.module('mobile build');
(function() {
asyncTest('`lodash mobile`', function() {
var start = _.after(2, _.once(QUnit.start));
build(['-s', 'mobile'], function(data) {
var array = [1, 2, 3],
basename = path.basename(data.outputPath, '.js'),
context = createContext(),
object1 = [{ 'a': 1 }],
object2 = [{ 'b': 2 }],
object3 = [{ 'a': 1, 'b': 2 }],
circular1 = { 'a': 1 },
circular2 = { 'a': 1 };
circular1.b = circular1;
circular2.b = circular2;
vm.runInContext(data.source, context);
var lodash = context._;
deepEqual(lodash.merge(object1, object2), object3, basename);
deepEqual(lodash.sortBy([3, 2, 1], _.identity), array, basename);
strictEqual(lodash.isEqual(circular1, circular2), true, basename);
var actual = lodash.cloneDeep(circular1);
ok(actual != circular1 && actual.b == actual, basename);
start();
});
});
asyncTest('`lodash csp`', function() {
var sources = [];
var check = _.after(2, _.once(function() {
ok(_.every(sources, function(source) {
// remove `Function` in `_.template` before testing for additional use
return !/\bFunction\(/.test(source.replace(/= *\w+\(\w+, *['"]return.+?apply[^)]+\)/, ''));
}));
equal(sources[0], sources[1]);
QUnit.start();
}));
var callback = function(data) {
// remove copyright header and append to `sources`
sources.push(data.source.replace(/^\/\**[\s\S]+?\*\/\n/, ''));
check();
};
build(['-s', '-d', 'csp'], callback);
build(['-s', '-d', 'mobile'], callback);
});
}());
/*--------------------------------------------------------------------------*/
QUnit.module('lodash build'); QUnit.module('lodash build');
(function() { (function() {
@@ -1420,7 +1468,7 @@
methodNames = (methodNames || []).concat(command.match(/category=(\S*)/)[1].split(/, */).map(capitalize)); methodNames = (methodNames || []).concat(command.match(/category=(\S*)/)[1].split(/, */).map(capitalize));
} }
if (!methodNames) { if (!methodNames) {
methodNames = allMethods.slice(); methodNames = lodashMethods.slice();
} }
if (/plus/.test(command)) { if (/plus/.test(command)) {
methodNames = methodNames.concat(command.match(/plus=(\S*)/)[1].split(/, */)); methodNames = methodNames.concat(command.match(/plus=(\S*)/)[1].split(/, */));
@@ -1437,16 +1485,13 @@
var result = getMethodsByCategory(category); var result = getMethodsByCategory(category);
// limit category methods to those available for specific builds // limit category methods to those available for specific builds
if (isBackbone) { result = result.filter(function(methodName) {
result = result.filter(function(methodName) { return _.contains(
return _.contains(backboneDependencies, methodName); isBackbone ? backboneDependencies :
}); isUnderscore ? underscoreMethods :
} lodashMethods, methodName
else if (isUnderscore) { );
result = result.filter(function(methodName) { });
return _.contains(underscoreMethods, methodName);
});
}
if (result.length) { if (result.length) {
methodNames = _.without(methodNames, category); methodNames = _.without(methodNames, category);
push.apply(methodNames, result); push.apply(methodNames, result);

View File

@@ -196,6 +196,8 @@
QUnit.module('lodash.at'); QUnit.module('lodash.at');
(function() { (function() {
var args = arguments;
test('should return `undefined` for nonexistent keys', function() { test('should return `undefined` for nonexistent keys', function() {
var actual = _.at(['a', 'b', 'c'], [0, 2, 4]); var actual = _.at(['a', 'b', 'c'], [0, 2, 4]);
deepEqual(actual, ['a', 'c', undefined]); deepEqual(actual, ['a', 'c', undefined]);
@@ -210,6 +212,11 @@
deepEqual(actual, ['a', 'c', 'd']); deepEqual(actual, ['a', 'c', 'd']);
}); });
test('should work with an `arguments` object for `collection`', function() {
var actual = _.at(args, [0, 2]);
deepEqual(actual, ['a', 'c']);
});
test('should work with an object for `collection`', function() { test('should work with an object for `collection`', function() {
var actual = _.at({ 'a': 1, 'b': 2, 'c': 3 }, ['a', 'c']); var actual = _.at({ 'a': 1, 'b': 2, 'c': 3 }, ['a', 'c']);
deepEqual(actual, [1, 3]); deepEqual(actual, [1, 3]);
@@ -224,7 +231,7 @@
deepEqual(_.at(collection, [0, 2]), ['a', 'c']); deepEqual(_.at(collection, [0, 2]), ['a', 'c']);
}); });
}); });
}()); }('a', 'b', 'c'));
/*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/
@@ -295,6 +302,12 @@
deepEqual(actual, [1, 2, 3, undefined]); deepEqual(actual, [1, 2, 3, undefined]);
}); });
test('should work with an array `object` argument', function() {
var array = ['push', 'pop'];
_.bindAll(array);
equal(array.pop, Array.prototype.pop);
});
}()); }());
/*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/
@@ -334,7 +347,7 @@
}; };
var objects = { var objects = {
'an arguments object': arguments, 'an `arguments` object': arguments,
'an array': ['a', 'b', 'c', ''], 'an array': ['a', 'b', 'c', ''],
'an array-like-object': { '0': 'a', '1': 'b', '2': 'c', '3': '', 'length': 5 }, 'an array-like-object': { '0': 'a', '1': 'b', '2': 'c', '3': '', 'length': 5 },
'boolean': false, 'boolean': false,
@@ -507,14 +520,14 @@
(function() { (function() {
test('subsequent "immediate" debounced calls return the last `func` result', function() { test('subsequent "immediate" debounced calls return the last `func` result', function() {
var debounced = _.debounce(function(value) { return value; }, 32, true), var debounced = _.debounce(_.identity, 32, true),
result = [debounced('x'), debounced('y')]; result = [debounced('x'), debounced('y')];
deepEqual(result, ['x', 'x']); deepEqual(result, ['x', 'x']);
}); });
asyncTest('subsequent debounced calls return the last `func` result', function() { asyncTest('subsequent debounced calls return the last `func` result', function() {
var debounced = _.debounce(function(value) { return value; }, 32); var debounced = _.debounce(_.identity, 32);
debounced('x'); debounced('x');
setTimeout(function() { setTimeout(function() {
@@ -522,6 +535,58 @@
QUnit.start(); QUnit.start();
}, 64); }, 64);
}); });
asyncTest('should apply default options correctly', function() {
var count = 0;
var debounced = _.debounce(function(value) {
count++;
return value;
}, 32, {});
strictEqual(debounced('x'), undefined);
setTimeout(function() {
strictEqual(count, 1);
QUnit.start();
}, 64);
});
test('should work with `leading` option', function() {
_.each([true, { 'leading': true }], function(options) {
var withLeading = _.debounce(_.identity, 32, options);
equal(withLeading('x'), 'x');
});
_.each([false, { 'leading': false }], function(options) {
var withoutLeading = _.debounce(_.identity, 32, options);
strictEqual(withoutLeading('x'), undefined);
});
});
asyncTest('should work with `trailing` option', function() {
var withCount = 0,
withoutCount = 0;
var withTrailing = _.debounce(function(value) {
withCount++;
return value;
}, 32, { 'trailing': true });
var withoutTrailing = _.debounce(function(value) {
withoutCount++;
return value;
}, 32, { 'trailing': false });
strictEqual(withTrailing('x'), undefined);
strictEqual(withoutTrailing('x'), undefined);
setTimeout(function() {
strictEqual(withCount, 1);
strictEqual(withoutCount, 0);
QUnit.start();
}, 64);
});
}()); }());
/*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/
@@ -1020,12 +1085,21 @@
test('lodash.' + methodName + ' should pass the correct `callback` arguments', function() { test('lodash.' + methodName + ' should pass the correct `callback` arguments', function() {
var args; var args;
func({ 'a': 1 }, { 'a': 2 }, function() { func({ 'a': 1 }, { 'a': 2 }, function() {
args || (args = slice.call(arguments)); args || (args = slice.call(arguments));
}); });
deepEqual(args, [1, 2]); deepEqual(args, [1, 2], 'primitive property values');
var array = [1, 2],
object = { 'b': 2 };
args = null;
func({ 'a': array }, { 'a': object }, function() {
args || (args = slice.call(arguments));
});
deepEqual(args, [array, object], 'non-primitive property values');
}); });
test('lodash.' + methodName + ' should correct set the `this` binding', function() { test('lodash.' + methodName + ' should correct set the `this` binding', function() {
@@ -1074,6 +1148,36 @@
/*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/
QUnit.module('`__proto__` property bugs');
(function() {
var stringLiteral = '__proto__',
stringObject = Object(stringLiteral),
expected = [stringLiteral, stringObject];
var array = _.times(100, function(count) {
return count % 2 ? stringObject : stringLiteral;
});
test('internal data objects should work with the `__proto__` key', function() {
deepEqual(_.difference(array, array), []);
deepEqual(_.intersection(array, array), expected);
deepEqual(_.uniq(array), expected);
deepEqual(_.without.apply(_, [array].concat(array)), []);
});
test('lodash.memoize should memoize values resolved to the `__proto__` key', function() {
var count = 0,
memoized = _.memoize(function() { return ++count; });
memoized('__proto__');
memoized('__proto__');
strictEqual(count, 1);
});
}());
/*--------------------------------------------------------------------------*/
QUnit.module('lodash.groupBy'); QUnit.module('lodash.groupBy');
(function() { (function() {
@@ -1356,6 +1460,14 @@
strictEqual(actual, false); strictEqual(actual, false);
}); });
}); });
test('should ensure `callback` is a function', function() {
var array = [1, 2, 3],
eq = _.partial(_.isEqual, array),
actual = _.every([array, [1, 0, 3]], eq);
strictEqual(actual, false);
})
}()); }());
/*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/
@@ -1771,8 +1883,27 @@
}); });
test('should handle merging if `callback` returns `undefined`', function() { test('should handle merging if `callback` returns `undefined`', function() {
var actual = _.merge({ 'a': 1 }, { 'a': 2 }, function() { }); var actual = _.merge({ 'a': { 'b': [1, 1] } }, { 'a': { 'b': [0] } }, function() { });
deepEqual(actual, { 'a': 2 }); deepEqual(actual, { 'a': { 'b': [0, 1] } });
});
test('should defer to `callback` when it returns a value other than `undefined`', function() {
var actual = _.merge({ 'a': { 'b': [0, 1] } }, { 'a': { 'b': [2] } }, function(a, b) {
return _.isArray(a) ? a.concat(b) : undefined;
});
deepEqual(actual, { 'a': { 'b': [0, 1, 2] } });
});
test('should pass the correct values to `callback`', function() {
var argsList = [],
array = [1, 2],
object = { 'b': 2 };
_.merge({ 'a': array }, { 'a': object }, function(a, b) {
argsList.push(slice.call(arguments));
});
deepEqual(argsList, [[array, object], [undefined, 2]]);
}); });
}(1, 2, 3)); }(1, 2, 3));
@@ -1803,6 +1934,10 @@
deepEqual(_.omit(new Foo, 'a'), expected); deepEqual(_.omit(new Foo, 'a'), expected);
}); });
test('should work with an array `object` argument', function() {
deepEqual(_.omit([1, 2, 3], '0', '2'), { '1': 2 });
});
test('should work with a `callback` argument', function() { test('should work with a `callback` argument', function() {
var actual = _.omit(object, function(value) { var actual = _.omit(object, function(value) {
return value == 1; return value == 1;
@@ -1837,6 +1972,41 @@
/*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/
QUnit.module('lodash.once');
(function() {
test('should ignore recursive calls', function() {
var count = 0;
var func = _.once(function() {
count++;
func();
});
func();
strictEqual(count, 1);
});
test('should not throw more than once', function() {
var pass = true;
var func = _.once(function() {
throw new Error;
});
raises(function() { func(); }, Error);
try {
func();
} catch(e) {
pass = false;
}
ok(pass);
});
}());
/*--------------------------------------------------------------------------*/
QUnit.module('lodash.parseInt'); QUnit.module('lodash.parseInt');
(function() { (function() {
@@ -1927,6 +2097,10 @@
deepEqual(_.pick(new Foo, 'b'), { 'b': 2 }); deepEqual(_.pick(new Foo, 'b'), { 'b': 2 });
}); });
test('should work with an array `object` argument', function() {
deepEqual(_.pick([1, 2, 3], '1'), { '1': 2 });
});
test('should work with a `callback` argument', function() { test('should work with a `callback` argument', function() {
var actual = _.pick(object, function(value) { var actual = _.pick(object, function(value) {
return value == 2; return value == 2;
@@ -2558,53 +2732,109 @@
}); });
asyncTest('supports recursive calls', function() { asyncTest('supports recursive calls', function() {
var counter = 0; var count = 0;
var throttled = _.throttle(function() { var throttled = _.throttle(function() {
counter++; count++;
if (counter < 10) { if (count < 10) {
throttled(); throttled();
} }
}, 32); }, 32);
throttled(); throttled();
equal(counter, 1); equal(count, 1);
setTimeout(function() { setTimeout(function() {
ok(counter < 3) ok(count < 3)
QUnit.start(); QUnit.start();
}, 32); }, 32);
}); });
asyncTest('should not trigger a trailing call when invoked once', function() { asyncTest('should not trigger a trailing call when invoked once', function() {
var counter = 0, var count = 0,
throttled = _.throttle(function() { counter++; }, 32); throttled = _.throttle(function() { count++; }, 32);
throttled(); throttled();
equal(counter, 1); equal(count, 1);
setTimeout(function() { setTimeout(function() {
equal(counter, 1); equal(count, 1);
QUnit.start(); QUnit.start();
}, 96); }, 96);
}); });
asyncTest('should trigger trailing call when invoked repeatedly', function() { asyncTest('should trigger trailing call when invoked repeatedly', function() {
var counter = 0, var count = 0,
limit = 48, limit = 48,
throttled = _.throttle(function() { counter++; }, 32), throttled = _.throttle(function() { count++; }, 32),
start = new Date; start = new Date;
while ((new Date - start) < limit) { while ((new Date - start) < limit) {
throttled(); throttled();
} }
var lastCount = counter; var lastCount = count;
ok(lastCount > 1); ok(lastCount > 1);
setTimeout(function() { setTimeout(function() {
ok(counter > lastCount); ok(count > lastCount);
QUnit.start(); QUnit.start();
}, 96); }, 96);
}); });
asyncTest('should apply default options correctly', function() {
var count = 0;
var throttled = _.throttle(function(value) {
count++;
return value;
}, 32, {});
_.times(2, function() {
equal(throttled('x'), 'x');
});
setTimeout(function() {
strictEqual(count, 2);
QUnit.start();
}, 64);
});
test('should work with `leading` option', function() {
_.each([true, { 'leading': true }], function(options) {
var withLeading = _.throttle(_.identity, 32, options);
equal(withLeading('x'), 'x');
});
_.each([false, { 'leading': false }], function(options) {
var withoutLeading = _.throttle(_.identity, 32, options);
strictEqual(withoutLeading('x'), undefined);
});
});
asyncTest('should work with `trailing` option', function() {
var withCount = 0,
withoutCount = 0;
var withTrailing = _.throttle(function(value) {
withCount++;
return value;
}, 32, { 'trailing': true });
var withoutTrailing = _.throttle(function(value) {
withoutCount++;
return value;
}, 32, { 'trailing': false });
_.times(2, function() {
equal(withTrailing('x'), 'x');
equal(withoutTrailing('x'), 'x');
});
setTimeout(function() {
strictEqual(withCount, 2);
strictEqual(withoutCount, 1);
QUnit.start();
}, 64);
});
}()); }());
/*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/
@@ -2702,6 +2932,19 @@
/*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/
QUnit.module('lodash.union');
(function() {
test('should produce correct results when passed a falsey `array` argument', function() {
var expected = [1, 2, 3],
actual = _.union(null, expected);
deepEqual(actual, expected);
});
}());
/*--------------------------------------------------------------------------*/
QUnit.module('lodash.uniq'); QUnit.module('lodash.uniq');
(function() { (function() {
@@ -2714,10 +2957,14 @@
}); });
test('should distinguish between numbers and numeric strings', function() { test('should distinguish between numbers and numeric strings', function() {
var expected = ['2', 2, Object('2'), Object(2)], var array = [],
actual = _.uniq(expected); expected = ['2', 2, Object('2'), Object(2)];
deepEqual(actual, expected); _.times(50, function() {
array.push.apply(array, expected);
});
deepEqual(_.uniq(expected), expected);
}); });
_.each({ _.each({
@@ -2750,6 +2997,58 @@
/*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/
QUnit.module('lodash.unzip');
(function() {
var object = {
'an empty array': [
[],
[]
],
'0-tuples': [
[[], []],
[]
],
'1-tuples': [
[['moe'], ['larry']],
[['moe', 'larry']]
],
'2-tuples': [
[['moe', 30], ['larry', 40]],
[['moe', 'larry'], [30, 40]]
],
'3-tuples': [
[['moe', 30, true], ['larry', 40, false]],
[['moe', 'larry'], [30, 40], [true, false]]
]
};
_.forOwn(object, function(pair, key) {
test('should work with ' + key, function() {
var actual = _.unzip(pair[0]);
deepEqual(actual, pair[1]);
deepEqual(_.zip.apply(_, actual), pair[1].length ? pair[0] : pair[1]);
});
});
test('should work with tuples of different lengths', function() {
var pair = [
[['moe', 30], ['larry', 40, false]],
[['moe', 'larry'], [30, 40], [undefined, false]]
];
var actual = _.unzip(pair[0]);
ok(1 in actual);
deepEqual(actual, pair[1]);
actual = _.zip.apply(_, actual);
ok(2 in actual[0]);
deepEqual(actual, [['moe', 30, undefined], ['larry', 40, false]]);
});
}());
/*--------------------------------------------------------------------------*/
QUnit.module('lodash.where'); QUnit.module('lodash.where');
(function() { (function() {
@@ -2962,6 +3261,37 @@
/*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/
QUnit.module('"Arrays" category methods');
(function() {
var args = arguments;
test('should work with `arguments` objects', function() {
function message(methodName) {
return '_.' + methodName + ' should work with `arguments` objects';
}
deepEqual(_.compact(args), [1, [3], 5], message('compact'));
deepEqual(_.difference(args, [null]), [1, [3], 5], message('difference'));
deepEqual(_.findIndex(args, _.identity), 0, message('findIndex'));
deepEqual(_.first(args), 1, message('first'));
deepEqual(_.flatten(args), [1, null, 3, null, 5], message('flatten'));
deepEqual(_.indexOf(args, 5), 4, message('indexOf'));
deepEqual(_.initial(args, 4), [1], message('initial'));
deepEqual(_.intersection(args, [1]), [1], message('intersection'));
deepEqual(_.last(args), 5, message('last'));
deepEqual(_.lastIndexOf(args, 1), 0, message('lastIndexOf'));
deepEqual(_.rest(args, 4), [5], message('rest'));
deepEqual(_.sortedIndex(args, 6), 5, message('sortedIndex'));
deepEqual(_.union(args, [null, 6]), [1, null, [3], 5, 6], message('union'));
deepEqual(_.uniq(args), [1, null, [3], 5], message('uniq'));
deepEqual(_.without(args, null), [1, [3], 5], message('without'));
deepEqual(_.zip(args, args), [[1, 1], [null, null], [[3], [3]], [null, null], [5, 5]], message('zip'));
});
}(1, null, [3], null, 5));
/*--------------------------------------------------------------------------*/
QUnit.module('lodash methods'); QUnit.module('lodash methods');
(function() { (function() {
@@ -3022,13 +3352,10 @@
_.each(funcs, function(methodName) { _.each(funcs, function(methodName) {
var actual = [], var actual = [],
expected = _.map(falsey, function() { return []; }),
func = _[methodName], func = _[methodName],
pass = true; pass = true;
var expected = (methodName == 'union')
? _.map(falsey, function(value, index) { return index ? [value] : []; })
: _.map(falsey, function() { return []; });
_.each(falsey, function(value, index) { _.each(falsey, function(value, index) {
try { try {
actual.push(index ? func(value) : func()); actual.push(index ? func(value) : func());

View File

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

View File

@@ -21,9 +21,9 @@
/** Detect free variable `require` */ /** Detect free variable `require` */
var freeRequire = typeof require == 'function' && require; var freeRequire = typeof require == 'function' && require;
/** Detect free variable `global` and use it as `window` */ /** Detect free variable `global`, from Node.js or Browserified code, and use it as `window` */
var freeGlobal = typeof global == 'object' && global; var freeGlobal = typeof global == 'object' && global;
if (freeGlobal.global === freeGlobal) { if (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal) {
window = freeGlobal; window = freeGlobal;
} }
@@ -738,13 +738,7 @@
cycle(deferred); cycle(deferred);
} }
else if (++deferred.cycles < clone.count) { else if (++deferred.cycles < clone.count) {
// continue the test loop clone.compiled.call(deferred, context, timer);
if (support.timeout) {
// use setTimeout to avoid a call stack overflow if called recursively
setTimeout(function() { clone.compiled.call(deferred, context, timer); }, 0);
} else {
clone.compiled.call(deferred, context, timer);
}
} }
else { else {
timer.stop(deferred); timer.stop(deferred);

0
vendor/firebug-lite/license.txt vendored Normal file → Executable file
View File

0
vendor/firebug-lite/skin/xp/blank.gif vendored Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 43 B

After

Width:  |  Height:  |  Size: 43 B

0
vendor/firebug-lite/skin/xp/buttonBg.png vendored Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 167 B

After

Width:  |  Height:  |  Size: 167 B

0
vendor/firebug-lite/skin/xp/buttonBgHover.png vendored Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 171 B

After

Width:  |  Height:  |  Size: 171 B

0
vendor/firebug-lite/skin/xp/debugger.css vendored Normal file → Executable file
View File

0
vendor/firebug-lite/skin/xp/detach.png vendored Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 655 B

After

Width:  |  Height:  |  Size: 655 B

0
vendor/firebug-lite/skin/xp/detachHover.png vendored Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 586 B

After

Width:  |  Height:  |  Size: 586 B

0
vendor/firebug-lite/skin/xp/disable.gif vendored Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 340 B

After

Width:  |  Height:  |  Size: 340 B

0
vendor/firebug-lite/skin/xp/disable.png vendored Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 543 B

After

Width:  |  Height:  |  Size: 543 B

0
vendor/firebug-lite/skin/xp/disableHover.gif vendored Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 344 B

After

Width:  |  Height:  |  Size: 344 B

0
vendor/firebug-lite/skin/xp/disableHover.png vendored Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 512 B

After

Width:  |  Height:  |  Size: 512 B

0
vendor/firebug-lite/skin/xp/down.png vendored Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 637 B

After

Width:  |  Height:  |  Size: 637 B

0
vendor/firebug-lite/skin/xp/downActive.png vendored Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 543 B

After

Width:  |  Height:  |  Size: 543 B

0
vendor/firebug-lite/skin/xp/downHover.png vendored Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 526 B

After

Width:  |  Height:  |  Size: 526 B

0
vendor/firebug-lite/skin/xp/errorIcon-sm.png vendored Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 447 B

After

Width:  |  Height:  |  Size: 447 B

0
vendor/firebug-lite/skin/xp/errorIcon.gif vendored Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 365 B

After

Width:  |  Height:  |  Size: 365 B

0
vendor/firebug-lite/skin/xp/errorIcon.png vendored Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 457 B

After

Width:  |  Height:  |  Size: 457 B

0
vendor/firebug-lite/skin/xp/firebug-1.3a2.css vendored Normal file → Executable file
View File

0
vendor/firebug-lite/skin/xp/firebug.IE6.css vendored Normal file → Executable file
View File

0
vendor/firebug-lite/skin/xp/firebug.css vendored Normal file → Executable file
View File

0
vendor/firebug-lite/skin/xp/firebug.html vendored Normal file → Executable file
View File

0
vendor/firebug-lite/skin/xp/firebug.png vendored Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

0
vendor/firebug-lite/skin/xp/group.gif vendored Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 158 B

After

Width:  |  Height:  |  Size: 158 B

0
vendor/firebug-lite/skin/xp/html.css vendored Normal file → Executable file
View File

0
vendor/firebug-lite/skin/xp/infoIcon.gif vendored Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 359 B

After

Width:  |  Height:  |  Size: 359 B

0
vendor/firebug-lite/skin/xp/infoIcon.png vendored Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 524 B

After

Width:  |  Height:  |  Size: 524 B

0
vendor/firebug-lite/skin/xp/loading_16.gif vendored Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

0
vendor/firebug-lite/skin/xp/min.png vendored Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 552 B

After

Width:  |  Height:  |  Size: 552 B

0
vendor/firebug-lite/skin/xp/minHover.png vendored Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 485 B

After

Width:  |  Height:  |  Size: 485 B

0
vendor/firebug-lite/skin/xp/off.png vendored Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 742 B

After

Width:  |  Height:  |  Size: 742 B

0
vendor/firebug-lite/skin/xp/offHover.png vendored Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 680 B

After

Width:  |  Height:  |  Size: 680 B

0
vendor/firebug-lite/skin/xp/pixel_transparent.gif vendored Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 43 B

After

Width:  |  Height:  |  Size: 43 B

0
vendor/firebug-lite/skin/xp/roundCorner.svg vendored Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 228 B

After

Width:  |  Height:  |  Size: 228 B

0
vendor/firebug-lite/skin/xp/search.gif vendored Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 550 B

After

Width:  |  Height:  |  Size: 550 B

0
vendor/firebug-lite/skin/xp/search.png vendored Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 685 B

After

Width:  |  Height:  |  Size: 685 B

0
vendor/firebug-lite/skin/xp/shadow.gif vendored Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

0
vendor/firebug-lite/skin/xp/shadow2.gif vendored Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

0
vendor/firebug-lite/skin/xp/shadowAlpha.png vendored Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

0
vendor/firebug-lite/skin/xp/sprite.png vendored Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 39 KiB

After

Width:  |  Height:  |  Size: 39 KiB

0
vendor/firebug-lite/skin/xp/tabHoverLeft.png vendored Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 438 B

After

Width:  |  Height:  |  Size: 438 B

0
vendor/firebug-lite/skin/xp/tabHoverMid.png vendored Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 261 B

After

Width:  |  Height:  |  Size: 261 B

0
vendor/firebug-lite/skin/xp/tabHoverRight.png vendored Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 436 B

After

Width:  |  Height:  |  Size: 436 B

0
vendor/firebug-lite/skin/xp/tabLeft.png vendored Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 449 B

After

Width:  |  Height:  |  Size: 449 B

0
vendor/firebug-lite/skin/xp/tabMenuCheckbox.png vendored Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 220 B

After

Width:  |  Height:  |  Size: 220 B

0
vendor/firebug-lite/skin/xp/tabMenuPin.png vendored Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 207 B

After

Width:  |  Height:  |  Size: 207 B

0
vendor/firebug-lite/skin/xp/tabMenuRadio.png vendored Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 192 B

After

Width:  |  Height:  |  Size: 192 B

0
vendor/firebug-lite/skin/xp/tabMenuTarget.png vendored Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 142 B

After

Width:  |  Height:  |  Size: 142 B

0
vendor/firebug-lite/skin/xp/tabMenuTargetHover.png vendored Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 148 B

After

Width:  |  Height:  |  Size: 148 B

0
vendor/firebug-lite/skin/xp/tabMid.png vendored Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 262 B

After

Width:  |  Height:  |  Size: 262 B

0
vendor/firebug-lite/skin/xp/tabRight.png vendored Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 448 B

After

Width:  |  Height:  |  Size: 448 B

0
vendor/firebug-lite/skin/xp/textEditorBorders.gif vendored Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 117 B

After

Width:  |  Height:  |  Size: 117 B

0
vendor/firebug-lite/skin/xp/textEditorBorders.png vendored Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

0
vendor/firebug-lite/skin/xp/textEditorCorners.gif vendored Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

0
vendor/firebug-lite/skin/xp/textEditorCorners.png vendored Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 3.9 KiB

0
vendor/firebug-lite/skin/xp/titlebarMid.png vendored Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 273 B

After

Width:  |  Height:  |  Size: 273 B

0
vendor/firebug-lite/skin/xp/toolbarMid.png vendored Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 242 B

After

Width:  |  Height:  |  Size: 242 B

0
vendor/firebug-lite/skin/xp/tree_close.gif vendored Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 300 B

After

Width:  |  Height:  |  Size: 300 B

0
vendor/firebug-lite/skin/xp/tree_open.gif vendored Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 202 B

After

Width:  |  Height:  |  Size: 202 B

0
vendor/firebug-lite/skin/xp/twistyClosed.png vendored Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 334 B

After

Width:  |  Height:  |  Size: 334 B

0
vendor/firebug-lite/skin/xp/twistyOpen.png vendored Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 309 B

After

Width:  |  Height:  |  Size: 309 B

0
vendor/firebug-lite/skin/xp/up.png vendored Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 619 B

After

Width:  |  Height:  |  Size: 619 B

0
vendor/firebug-lite/skin/xp/upActive.png vendored Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 551 B

After

Width:  |  Height:  |  Size: 551 B

0
vendor/firebug-lite/skin/xp/upHover.png vendored Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 526 B

After

Width:  |  Height:  |  Size: 526 B

0
vendor/firebug-lite/skin/xp/warningIcon.gif vendored Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 357 B

After

Width:  |  Height:  |  Size: 357 B

0
vendor/firebug-lite/skin/xp/warningIcon.png vendored Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 516 B

After

Width:  |  Height:  |  Size: 516 B

0
vendor/firebug-lite/src/firebug-lite-debug.js vendored Normal file → Executable file
View File

View File

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

View File

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

View File

@@ -10,9 +10,9 @@
/** Detect free variable `exports` */ /** Detect free variable `exports` */
var freeExports = typeof exports == 'object' && exports; var freeExports = typeof exports == 'object' && exports;
/** Detect free variable `global` and use it as `window` */ /** Detect free variable `global`, from Node.js or Browserified code, and use it as `window` */
var freeGlobal = typeof global == 'object' && global; var freeGlobal = typeof global == 'object' && global;
if (freeGlobal.global === freeGlobal) { if (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal) {
window = freeGlobal; window = freeGlobal;
} }

File diff suppressed because one or more lines are too long

View File

@@ -96,7 +96,7 @@
if (obj == null) return results; if (obj == null) return results;
if (nativeMap && obj.map === nativeMap) return obj.map(iterator, context); if (nativeMap && obj.map === nativeMap) return obj.map(iterator, context);
each(obj, function(value, index, list) { each(obj, function(value, index, list) {
results[results.length] = iterator.call(context, value, index, list); results.push(iterator.call(context, value, index, list));
}); });
return results; return results;
}; };
@@ -171,7 +171,7 @@
if (obj == null) return results; if (obj == null) return results;
if (nativeFilter && obj.filter === nativeFilter) return obj.filter(iterator, context); if (nativeFilter && obj.filter === nativeFilter) return obj.filter(iterator, context);
each(obj, function(value, index, list) { each(obj, function(value, index, list) {
if (iterator.call(context, value, index, list)) results[results.length] = value; if (iterator.call(context, value, index, list)) results.push(value);
}); });
return results; return results;
}; };
@@ -238,7 +238,7 @@
// Convenience version of a common use case of `filter`: selecting only objects // Convenience version of a common use case of `filter`: selecting only objects
// containing specific `key:value` pairs. // containing specific `key:value` pairs.
_.where = function(obj, attrs, first) { _.where = function(obj, attrs, first) {
if (_.isEmpty(attrs)) return first ? null : []; if (_.isEmpty(attrs)) return first ? void 0 : [];
return _[first ? 'find' : 'filter'](obj, function(value) { return _[first ? 'find' : 'filter'](obj, function(value) {
for (var key in attrs) { for (var key in attrs) {
if (attrs[key] !== value[key]) return false; if (attrs[key] !== value[key]) return false;
@@ -255,7 +255,7 @@
// Return the maximum element or (element-based computation). // Return the maximum element or (element-based computation).
// Can't optimize arrays of integers longer than 65,535 elements. // Can't optimize arrays of integers longer than 65,535 elements.
// See: https://bugs.webkit.org/show_bug.cgi?id=80797 // See [WebKit Bug 80797](https://bugs.webkit.org/show_bug.cgi?id=80797)
_.max = function(obj, iterator, context) { _.max = function(obj, iterator, context) {
if (!iterator && _.isArray(obj) && obj[0] === +obj[0] && obj.length < 65535) { if (!iterator && _.isArray(obj) && obj[0] === +obj[0] && obj.length < 65535) {
return Math.max.apply(Math, obj); return Math.max.apply(Math, obj);
@@ -324,7 +324,7 @@
// An internal function used for aggregate "group by" operations. // An internal function used for aggregate "group by" operations.
var group = function(obj, value, context, behavior) { var group = function(obj, value, context, behavior) {
var result = {}; var result = {};
var iterator = lookupIterator(value || _.identity); var iterator = lookupIterator(value == null ? _.identity : value);
each(obj, function(value, index) { each(obj, function(value, index) {
var key = iterator.call(context, value, index, obj); var key = iterator.call(context, value, index, obj);
behavior(result, key, value); behavior(result, key, value);
@@ -499,6 +499,17 @@
return results; return results;
}; };
// The inverse operation to `_.zip`. If given an array of pairs it
// returns an array of the paired elements split into two left and
// right element arrays, if given an array of triples it returns a
// 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));
};
// Converts lists into objects. Pass either a single array of `[key, value]` // Converts lists into objects. Pass either a single array of `[key, value]`
// pairs, or two parallel arrays of the same length -- one of keys, and one of // pairs, or two parallel arrays of the same length -- one of keys, and one of
// the corresponding values. // the corresponding values.
@@ -574,14 +585,25 @@
// Function (ahem) Functions // Function (ahem) Functions
// ------------------ // ------------------
// Reusable constructor function for prototype setting.
var ctor = function(){};
// Create a function bound to a given object (assigning `this`, and arguments, // Create a function bound to a given object (assigning `this`, and arguments,
// optionally). Delegates to **ECMAScript 5**'s native `Function.bind` if // optionally). Delegates to **ECMAScript 5**'s native `Function.bind` if
// available. // available.
_.bind = function(func, context) { _.bind = function(func, context) {
var args, bound;
if (func.bind === nativeBind && nativeBind) return nativeBind.apply(func, slice.call(arguments, 1)); if (func.bind === nativeBind && nativeBind) return nativeBind.apply(func, slice.call(arguments, 1));
var args = slice.call(arguments, 2); if (!_.isFunction(func)) throw new TypeError;
return function() { args = slice.call(arguments, 2);
return func.apply(context, args.concat(slice.call(arguments))); return bound = function() {
if (!(this instanceof bound)) return func.apply(context, args.concat(slice.call(arguments)));
ctor.prototype = func.prototype;
var self = new ctor;
ctor.prototype = null;
var result = func.apply(self, args.concat(slice.call(arguments)));
if (Object(result) === result) return result;
return self;
}; };
}; };
@@ -598,7 +620,7 @@
// all callbacks defined on an object belong to it. // all callbacks defined on an object belong to it.
_.bindAll = function(obj) { _.bindAll = function(obj) {
var funcs = slice.call(arguments, 1); var funcs = slice.call(arguments, 1);
if (funcs.length === 0) funcs = _.functions(obj); if (funcs.length === 0) throw new Error("bindAll must be passed function names");
each(funcs, function(f) { obj[f] = _.bind(obj[f], obj); }); each(funcs, function(f) { obj[f] = _.bind(obj[f], obj); });
return obj; return obj;
}; };
@@ -628,7 +650,7 @@
// Returns a function, that, when invoked, will only be triggered at most once // Returns a function, that, when invoked, will only be triggered at most once
// during a given window of time. // during a given window of time.
_.throttle = function(func, wait) { _.throttle = function(func, wait, immediate) {
var context, args, timeout, result; var context, args, timeout, result;
var previous = 0; var previous = 0;
var later = function() { var later = function() {
@@ -638,6 +660,7 @@
}; };
return function() { return function() {
var now = new Date; var now = new Date;
if (!previous && immediate === false) previous = now;
var remaining = wait - (now - previous); var remaining = wait - (now - previous);
context = this; context = this;
args = arguments; args = arguments;
@@ -728,7 +751,7 @@
_.keys = nativeKeys || function(obj) { _.keys = nativeKeys || function(obj) {
if (obj !== Object(obj)) throw new TypeError('Invalid object'); if (obj !== Object(obj)) throw new TypeError('Invalid object');
var keys = []; var keys = [];
for (var key in obj) if (_.has(obj, key)) keys[keys.length] = key; for (var key in obj) if (_.has(obj, key)) keys.push(key);
return keys; return keys;
}; };
@@ -800,7 +823,7 @@
each(slice.call(arguments, 1), function(source) { each(slice.call(arguments, 1), function(source) {
if (source) { if (source) {
for (var prop in source) { for (var prop in source) {
if (obj[prop] == null) obj[prop] = source[prop]; if (obj[prop] === void 0) obj[prop] = source[prop];
} }
} }
}); });
@@ -824,7 +847,7 @@
// Internal recursive comparison function for `isEqual`. // Internal recursive comparison function for `isEqual`.
var eq = function(a, b, aStack, bStack) { var eq = function(a, b, aStack, bStack) {
// Identical objects are equal. `0 === -0`, but they aren't identical. // Identical objects are equal. `0 === -0`, but they aren't identical.
// See the Harmony `egal` proposal: http://wiki.ecmascript.org/doku.php?id=harmony:egal. // See the [Harmony `egal` proposal](http://wiki.ecmascript.org/doku.php?id=harmony:egal).
if (a === b) return a !== 0 || 1 / a == 1 / b; if (a === b) return a !== 0 || 1 / a == 1 / b;
// A strict comparison is necessary because `null == undefined`. // A strict comparison is necessary because `null == undefined`.
if (a == null || b == null) return a === b; if (a == null || b == null) return a === b;
@@ -1012,7 +1035,7 @@
// Run a function **n** times. // Run a function **n** times.
_.times = function(n, iterator, context) { _.times = function(n, iterator, context) {
var accum = Array(n); var accum = Array(Math.max(0, n));
for (var i = 0; i < n; i++) accum[i] = iterator.call(context, i); for (var i = 0; i < n; i++) accum[i] = iterator.call(context, i);
return accum; return accum;
}; };
@@ -1055,10 +1078,10 @@
}; };
}); });
// If the value of the named property is a function then invoke it; // If the value of the named `property` is a function then invoke it with the
// otherwise, return it. // `object` as context; otherwise, return it.
_.result = function(object, property) { _.result = function(object, property) {
if (object == null) return null; if (object == null) return void 0;
var value = object[property]; var value = object[property];
return _.isFunction(value) ? value.call(object) : value; return _.isFunction(value) ? value.call(object) : value;
}; };