Compare commits

..

1 Commits
2.2.1 ... 1.1.1

Author SHA1 Message Date
Benjamin Tan
3bdc4f19d4 Update v1.1.1 docs 2015-01-23 16:15:04 +08:00
144 changed files with 17129 additions and 19579 deletions

4
.gitattributes vendored
View File

@@ -1,5 +1 @@
* text=auto
*.html text eol=lf
*.js text eol=lf
*.md text eol=lf
*.sh text eol=lf

11
.gitignore vendored
View File

@@ -1,10 +1,5 @@
.DS_Store
*.custom.*
*.template.*
*.map
/*.min.*
modularize
node_modules
dist/*.backbone.*
dist/*.legacy.*
dist/*.mobile.*
node_modules/
vendor/closure-compiler/
vendor/uglifyjs/

12
.jamignore Normal file
View File

@@ -0,0 +1,12 @@
.*
*.custom.*
*.md
*.txt
build.js
index.js
build/
doc/
node_modules/
perf/
test/
vendor/

27
.npmignore Normal file
View File

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

View File

@@ -1,58 +1,20 @@
language: node_js
node_js:
- "0.6"
- "0.8"
- "0.10"
- 0.6
- 0.9
env:
global:
- BIN="node" BUILD=false MAKE=false OPTION=""
matrix:
- BUILD="compat"
- BUILD="modern"
- BUILD="legacy"
- BUILD="mobile"
- BIN="phantomjs" BUILD="compat"
- BIN="phantomjs" BUILD="legacy"
- BIN="phantomjs" BUILD="mobile"
matrix:
include:
- node_js: "0.10"
env: BIN="istanbul"
- node_js: "0.10"
env: BIN="narwhal" BUILD="compat"
- node_js: "0.10"
env: BIN="narwhal" BUILD="legacy"
- node_js: "0.10"
env: BIN="rhino" BUILD="compat"
- node_js: "0.10"
env: BIN="rhino" BUILD="legacy"
- node_js: "0.10"
env: BIN="rhino" BUILD="compat" OPTION="-require"
- node_js: "0.10"
env: BIN="rhino" BUILD="legacy" OPTION="-require"
- node_js: "0.10"
env: BIN="ringo" BUILD="compat"
- node_js: "0.10"
env: BIN="ringo" BUILD="legacy"
- TEST_COMMAND="phantomjs ./test/test.js ../dist/lodash.compat.js"
- TEST_COMMAND="phantomjs ./test/test.js ../dist/lodash.compat.min.js"
- TEST_COMMAND="node ./test/test.js ../dist/lodash.js"
- TEST_COMMAND="node ./test/test.js ../dist/lodash.min.js"
- TEST_COMMAND="node ./test/test-build.js --time-limit 49m40s"
git:
depth: 1
branches:
only:
- master
before_install:
- "[ $BIN == 'istanbul' ] && npm install -g istanbul || true"
- "[ $BIN == 'narwhal' ] && wget https://github.com/280north/narwhal/archive/v0.3.2.zip && sudo unzip v0.3.2 -d /opt/ && rm v0.3.2.zip || true"
- "[ $BIN == 'narwhal' ] && sudo ln -s /opt/narwhal-0.3.2/bin/narwhal /usr/local/bin/narwhal && sudo chmod +x /usr/local/bin/narwhal || true"
- "[ $BIN == 'rhino' ] && sudo mkdir /opt/rhino-1.7R5 && sudo wget -O /opt/rhino-1.7R5/js.jar https://oss.sonatype.org/content/repositories/snapshots/org/mozilla/rhino/1.7R5-SNAPSHOT/rhino-1.7R5-20120629.144839-4.jar || true"
- "[ $BIN == 'rhino' ] && echo -e '#!/bin/sh\\njava -jar /opt/rhino-1.7R5/js.jar $@' | sudo tee /usr/local/bin/rhino && sudo chmod +x /usr/local/bin/rhino || true"
- "[ $BIN == 'ringo' ] && wget http://ringojs.org/downloads/ringojs-0.9.zip && sudo unzip ringojs-0.9 -d /opt && rm ringojs-0.9.zip || true"
- "[ $BIN == 'ringo' ] && sudo ln -s /opt/ringojs-0.9/bin/ringo /usr/local/bin/ringo && sudo chmod +x /usr/local/bin/ringo || true"
before_script:
- "tar -xzvf vendor/closure-compiler.tar.gz -C vendor"
- "tar -xzvf vendor/uglifyjs.tar.gz -C vendor"
script:
- "[ $BIN == 'istanbul' ] && $BIN cover ./test/test.js || true"
- "[ $BUILD != false ] && [ $BUILD != 'compat' ] && [ $BUILD != 'modern' ] && MAKE=true || true"
- "[ $MAKE != false ] && git clone --depth=1 --branch=master git://github.com/lodash/lodash-cli.git ./node_modules/lodash-cli || true"
- "[ $MAKE != false ] && mkdir ./node_modules/lodash-cli/node_modules && cd ./node_modules/lodash-cli/node_modules/ && ln -s ../../../ ./lodash && cd ../ && npm i . && cd ../../ || true"
- "[ $MAKE != false ] && node ./node_modules/lodash-cli/bin/lodash $BUILD -o ./dist/lodash.$BUILD.js || true"
- "[ $BUILD != false ] && cd ./test || true"
- "[ $BUILD != false ] && $BIN $OPTION ./test.js ../dist/lodash.$BUILD.js || true"
- "[ $BUILD != false ] && $BIN $OPTION ./test.js ../dist/lodash.$BUILD.min.js || true"
$TEST_COMMAND

View File

@@ -1,12 +1,12 @@
# Contributing to Lo-Dash
If youd like to contribute a feature or bug fix, you can [fork](https://help.github.com/articles/fork-a-repo) Lo-Dash, commit your changes, and [send a pull request](https://help.github.com/articles/using-pull-requests).
Please make sure to [search the issue tracker](https://github.com/lodash/lodash/issues) first; your issue may have already been discussed or fixed in `master`.
Please make sure to [search the issue tracker](https://github.com/bestiejs/lodash/issues) first; your issue may have already been discussed or fixed in `master`.
## Tests
Include updated unit tests in the `test` directory as part of your pull request.
You can run the tests from the command line via `node test/test`, or open `test/index.html` in a web browser.
You can run the tests from the command line via `npm test`, or open `test/index.html` in a web browser.
The `test/run-test.sh` script attempts to run the tests in [Rhino](https://developer.mozilla.org/en-US/docs/Rhino), [Narwhal](https://github.com/280north/narwhal), [RingoJS](http://ringojs.org/), [PhantomJS](http://phantomjs.org/), and [Node](http://nodejs.org/), before running them in your default browser.
The [Backbone](http://backbonejs.org/) and [Underscore](http://http://underscorejs.org/) test suites are included as well.
@@ -15,7 +15,7 @@ The [Backbone](http://backbonejs.org/) and [Underscore](http://http://underscore
Lo-Dash is a member of the [Dojo Foundation](http://dojofoundation.org/).
As such, we request that all contributors sign the Dojo Foundation [contributor license agreement](http://dojofoundation.org/about/claForm).
For more information about CLAs, please check out Alex Russells excellent post, [Why Do I Need to Sign This?](http://infrequently.org/2008/06/why-do-i-need-to-sign-this/).
For more information about CLAs, please check out Alex Russells excellent post, ["Why Do I Need to Sign This?"](http://infrequently.org/2008/06/why-do-i-need-to-sign-this/).
## Coding Guidelines

View File

@@ -1,6 +1,6 @@
Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/>
Based on Underscore.js 1.5.2, copyright 2009-2013 Jeremy Ashkenas,
DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/>
Based on Underscore.js 1.4.3, copyright 2009-2013 Jeremy Ashkenas,
DocumentCloud Inc. <http://underscorejs.org/>
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the

313
README.md
View File

@@ -1,87 +1,197 @@
# Lo-Dash v2.2.1
A utility library delivering consistency, [customization](http://lodash.com/custom-builds), [performance](http://lodash.com/benchmarks), & [extras](http://lodash.com/#features).
# Lo-Dash <sup>v1.1.1</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).
## Download
* Modern builds perfect for newer browsers/environments:<br>
[Development](https://raw.github.com/lodash/lodash/2.2.1/dist/lodash.js) &
[Production](https://raw.github.com/lodash/lodash/2.2.1/dist/lodash.min.js)
* Lo-Dash builds (for modern environments):<br>
[Development](https://raw.github.com/bestiejs/lodash/v1.1.1/dist/lodash.js) and
[Production](https://raw.github.com/bestiejs/lodash/v1.1.1/dist/lodash.min.js)
* Compatibility builds for older environment support too:<br>
[Development](https://raw.github.com/lodash/lodash/2.2.1/dist/lodash.compat.js) &
[Production](https://raw.github.com/lodash/lodash/2.2.1/dist/lodash.compat.min.js)
* 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
[Production](https://raw.github.com/bestiejs/lodash/v1.1.1/dist/lodash.compat.min.js)
* Underscore builds to use as a drop-in replacement:<br>
[Development](https://raw.github.com/lodash/lodash/2.2.1/dist/lodash.underscore.js) &
[Production](https://raw.github.com/lodash/lodash/2.2.1/dist/lodash.underscore.min.js)
* Underscore compatibility builds:<br>
[Development](https://raw.github.com/bestiejs/lodash/v1.1.1/dist/lodash.underscore.js) and
[Production](https://raw.github.com/bestiejs/lodash/v1.1.1/dist/lodash.underscore.min.js)
CDN copies are available on [cdnjs](http://cdnjs.com/libraries/lodash.js/) & [jsDelivr](http://www.jsdelivr.com/#!lodash).<br>
For smaller file sizes, create [custom builds](http://lodash.com/custom-builds) with only the features needed.<br>
Love modules? Weve got you covered with [lodash-amd](https://npmjs.org/package/lodash-amd), [lodash-node](https://npmjs.org/package/lodash-node), & [npm packages](https://npmjs.org/browse/keyword/lodash-modularized) per method.
* CDN copies of ≤ v1.1.1s builds are available on [cdnjs](http://cdnjs.com/) thanks to [CloudFlare](http://www.cloudflare.com/):<br>
[Lo-Dash dev](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.1.1/lodash.js),
[Lo-Dash prod](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.1.1/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-prod](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.1.1/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-prod](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.1.1/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
## Dive in
Theres plenty of [documentation](http://lodash.com/docs), [unit tests](http://lodash.com/tests), & [benchmarks](http://lodash.com/benchmarks).<br>
For a list of upcoming features, check out our [roadmap](https://github.com/lodash/lodash/wiki/Roadmap).<br>
The full changelog for this release is available on our [wiki](https://github.com/lodash/lodash/wiki/Changelog).
Weve got [API docs](http://lodash.com/docs), [benchmarks](http://lodash.com/benchmarks), and [unit tests](http://lodash.com/tests).
## Features *not* in Underscore
* AMD loader support ([curl](https://github.com/cujojs/curl), [dojo](http://dojotoolkit.org/), [requirejs](http://requirejs.org/), etc.)
* [_(…)](http://lodash.com/docs#_) supports intuitive chaining
* [_.at](http://lodash.com/docs#at) for cherry-picking collection values
* [_.bindKey](http://lodash.com/docs#bindKey) for binding [*“lazy”*](http://michaux.ca/articles/lazy-function-definition-pattern) defined methods
* [_.clone](http://lodash.com/docs#clone) supports shallow cloning of `Date` & `RegExp` objects
* [_.cloneDeep](http://lodash.com/docs#cloneDeep) for deep cloning arrays & objects
* [_.contains](http://lodash.com/docs#contains) accepts a `fromIndex`
* [_.createCallback](http://lodash.com/docs#createCallback) for extending callbacks in methods & mixins
* [_.curry](http://lodash.com/docs#curry) for creating [curried](http://hughfdjackson.com/javascript/2013/07/06/why-curry-helps/) functions
* [_.debounce](http://lodash.com/docs#debounce) & [_.throttle](http://lodash.com/docs#throttle) accept additional `options` for more control
* [_.findIndex](http://lodash.com/docs#findIndex) & [_.findKey](http://lodash.com/docs#findKey) for finding indexes & keys
* [_.forEach](http://lodash.com/docs#forEach) is chainable & supports exiting early
* [_.forIn](http://lodash.com/docs#forIn) for iterating own & inherited properties
* [_.forOwn](http://lodash.com/docs#forOwn) for iterating own properties
* [_.isPlainObject](http://lodash.com/docs#isPlainObject) for checking if values are created by `Object`
* [_.memoize](http://lodash.com/docs#memoize) exposes the `cache` of memoized functions
* [_.merge](http://lodash.com/docs#merge) for a deep [_.extend](http://lodash.com/docs#extend)
* [_.parseInt](http://lodash.com/docs#parseInt) for consistent behavior
* [_.partialRight](http://lodash.com/docs#partialRight) for [partial application](http://lodash.com/docs#partial) from the right
* [_.pull](http://lodash.com/docs#pull) & [_.remove](http://lodash.com/docs#remove) for mutating arrays
* [_.random](http://lodash.com/docs#random) supports returning floating-point numbers
* [_.runInContext](http://lodash.com/docs#runInContext) for easier mocking
* [_.support](http://lodash.com/docs#support) for flagging environment features
* [_.template](http://lodash.com/docs#template) supports [*“imports”*](http://lodash.com/docs#templateSettings_imports) options & [ES6 template delimiters](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-7.8.6)
* [_.transform](http://lodash.com/docs#transform) as a powerful alternative to [_.reduce](http://lodash.com/docs#reduce) for transforming objects
* [_.where](http://lodash.com/docs#where) supports deep object comparisons
* [_.zip](http://lodash.com/docs#zip) is capable of unzipping values
* [_.omit](http://lodash.com/docs#omit), [_.pick](http://lodash.com/docs#pick), &
[more](http://lodash.com/docs "_.assign, _.clone, _.cloneDeep, _.first, _.initial, _.isEqual, _.last, _.merge, _.rest") accept callbacks
* [_.contains](http://lodash.com/docs#contains), [_.toArray](http://lodash.com/docs#toArray), &
[more](http://lodash.com/docs "_.at, _.countBy, _.every, _.filter, _.find, _.forEach, _.forEachRight, _.groupBy, _.invoke, _.map, _.max, _.min, _.pluck, _.reduce, _.reduceRight, _.reject, _.shuffle, _.size, _.some, _.sortBy, _.where") accept strings
* [_.filter](http://lodash.com/docs#filter), [_.map](http://lodash.com/docs#map), &
[more](http://lodash.com/docs "_.countBy, _.every, _.find, _.findKey, _.findLast, _.findLastIndex, _.findLastKey, _.first, _.groupBy, _.initial, _.last, _.max, _.min, _.reject, _.rest, _.some, _.sortBy, _.sortedIndex, _.uniq") support *“_.pluck”* & *“_.where”* shorthands
* [_.findLast](http://lodash.com/docs#findLast), [_.findLastIndex](http://lodash.com/docs#findLastIndex), &
[more](http://lodash.com/docs "_.findLastKey, _.forEachRight, _.forInRight, _.forOwnRight") right-associative methods
For a list of upcoming features, check out our [roadmap](https://github.com/bestiejs/lodash/wiki/Roadmap).
## Resources
For more information check out these articles, screencasts, and other videos over Lo-Dash:
* Posts
- [Say “Hello” to Lo-Dash](http://kitcambridge.be/blog/say-hello-to-lo-dash/)
- [Custom builds in Lo-Dash 2.0](http://kitcambridge.be/blog/custom-builds-in-lo-dash-2-dot-0/)
* Videos
- [Introduction](https://vimeo.com/44154599)
- [Origins](https://vimeo.com/44154600)
- [Optimizations & builds](https://vimeo.com/44154601)
- [Native method use](https://vimeo.com/48576012)
- [Testing](https://vimeo.com/45865290)
- [CascadiaJS 12](http://www.youtube.com/watch?v=dpPy4f_SeEk)
- [Introducing Lo-Dash](https://vimeo.com/44154599)
- [Lo-Dash optimizations and custom builds](https://vimeo.com/44154601)
- [Lo-Dashs origin and why its a better utility belt](https://vimeo.com/44154600)
- [Unit testing in Lo-Dash](https://vimeo.com/45865290)
- [Lo-Dashs approach to native method use](https://vimeo.com/48576012)
- [CascadiaJS: Lo-Dash for a better utility belt](http://www.youtube.com/watch?v=dpPy4f_SeEk)
## Features
* AMD loader support ([RequireJS](http://requirejs.org/), [curl.js](https://github.com/cujojs/curl), etc.)
* [_(…)](http://lodash.com/docs#_) supports intuitive chaining
* [_.at](http://lodash.com/docs#at) for cherry-picking collection values
* [_.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
* [_.contains](http://lodash.com/docs#contains) accepts a `fromIndex` argument
* [_.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
* [_.forEach](http://lodash.com/docs#forEach) is chainable and supports exiting iteration early
* [_.forIn](http://lodash.com/docs#forIn) for iterating over an objects own and inherited properties
* [_.forOwn](http://lodash.com/docs#forOwn) for iterating over an objects own properties
* [_.isPlainObject](http://lodash.com/docs#isPlainObject) checks if values are created by the `Object` constructor
* [_.merge](http://lodash.com/docs#merge) for a deep [_.extend](http://lodash.com/docs#extend)
* [_.parseInt](http://lodash.com/docs#parseInt) for consistent cross-environment behavior
* [_.partial](http://lodash.com/docs#partial) and [_.partialRight](http://lodash.com/docs#partialRight) for partial application without `this` binding
* [_.runInContext](http://lodash.com/docs#runInContext) for easier mocking and extended environment support
* [_.support](http://lodash.com/docs#support) to flag environment features
* [_.template](http://lodash.com/docs#template) supports [*“imports”* options](http://lodash.com/docs#templateSettings_imports), [ES6 template delimiters](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-7.8.6), and [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
* [_.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),
[and more…](http://lodash.com/docs "_.assign, _.cloneDeep, _.first, _.initial, _.isEqual, _.last, _.merge, _.rest") accept `callback` and `thisArg` arguments
* [_.contains](http://lodash.com/docs#contains), [_.size](http://lodash.com/docs#size), [_.toArray](http://lodash.com/docs#toArray),
[and more…](http://lodash.com/docs "_.at, _.countBy, _.every, _.filter, _.find, _.forEach, _.groupBy, _.invoke, _.map, _.max, _.min, _.pluck, _.reduce, _.reduceRight, _.reject, _.shuffle, _.some, _.sortBy, _.where") accept strings
* [_.filter](http://lodash.com/docs#filter), [_.find](http://lodash.com/docs#find), [_.map](http://lodash.com/docs#map),
[and more…](http://lodash.com/docs "_.countBy, _.every, _.first, _.groupBy, _.initial, _.last, _.max, _.min, _.reject, _.rest, _.some, _.sortBy, _.sortedIndex, _.uniq") support *“_.pluck”* and *“_.where”* `callback` shorthands
## Support
Tested in Chrome 5~29, Firefox 2~24, IE 6-10, Opera 9.25~16, Safari 3-6, Node.js 0.6.8-0.10.20, Narwhal 0.3.2, PhantomJS 1.9.2, RingoJS 0.9, & Rhino 1.7RC5.
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.
## Installation & usage
## Custom builds
Custom builds make it easy to create lightweight versions of Lo-Dash containing only the methods you need.
To top it off, we handle all method dependency and alias mapping for you.
* Backbone builds, with only methods required by Backbone, may be created using the `backbone` modifier argument.
```bash
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.
```bash
lodash legacy
```
* Modern builds, tailored for newer environments with ES5 support, may be created using the `modern` modifier argument.
```bash
lodash modern
```
* Mobile builds, without method compilation and most bug fixes for old browsers, may be created using the `mobile` modifier argument.
```bash
lodash mobile
```
* Strict builds, with `_.bindAll`, `_.defaults`, and `_.extend` in [strict mode](http://es5.github.com/#C), may be created using the `strict` modifier argument.
```bash
lodash strict
```
* Underscore builds, tailored for projects already using Underscore, may be created using the `underscore` modifier argument.
```bash
lodash underscore
```
Custom builds may be created using the following commands:
* Use the `category` argument to pass comma separated categories of methods to include in the build.<br>
Valid categories (case-insensitive) are *“arrays”*, *“chaining”*, *“collections”*, *“functions”*, *“objects”*, and *“utilities”*.
```bash
lodash category=collections,functions
lodash category="collections, functions"
```
* Use the `exports` argument to pass comma separated names of ways to export the `LoDash` function.<br>
Valid exports are *“amd”*, *“commonjs”*, *“global”*, *“node”*, and *“none”*.
```bash
lodash exports=amd,commonjs,node
lodash exports="amd, commonjs, node"
```
* Use the `iife` argument to specify code to replace the immediately-invoked function expression that wraps Lo-Dash.
```bash
lodash iife="!function(window,undefined){%output%}(this)"
```
* Use the `include` argument to pass comma separated method/category names to include in the build.
```bash
lodash include=each,filter,map
lodash include="each, filter, map"
```
* Use the `minus` argument to pass comma separated method/category names to remove from those included in the build.
```bash
lodash underscore minus=result,shuffle
lodash underscore minus="result, shuffle"
```
* Use the `plus` argument to pass comma separated method/category names to add to those included in the build.
```bash
lodash backbone plus=random,template
lodash backbone plus="random, template"
```
* Use the `template` argument to pass the file path pattern used to match template files to precompile.
```bash
lodash template="./*.jst"
```
* Use the `settings` argument to pass the template settings used when precompiling templates.
```bash
lodash settings="{interpolate:/\{\{([\s\S]+?)\}\}/g}"
```
* Use the `moduleId` argument to specify the AMD module ID of Lo-Dash, which defaults to “lodash”, used by precompiled templates.
```bash
lodash moduleId="underscore"
```
All arguments, except `legacy` with `csp`, `mobile`, `modern`, or `underscore`, may be combined.<br>
Unless specified by `-o` or `--output`, all files created are saved to the current working directory.
The following options are also supported:
* `-c`, `--stdout` ......... Write output to standard output
* `-d`, `--debug` ........... Write only the non-minified development output
* `-h`, `--help` ............. Display help information
* `-m`, `--minify` ......... Write only the minified production output
* `-o`, `--output` ......... Write output to a given path/filename
* `-p`, `--source-map` .. Generate a source map for the minified output, using an optional source map URL
* `-s`, `--silent` ......... Skip status updates normally logged to the console
* `-V`, `--version` ....... Output current version of Lo-Dash
The `lodash` command-line utility is available when Lo-Dash is installed as a global package (i.e. `npm install -g lodash`).
## Installation and usage
In browsers:
@@ -92,24 +202,34 @@ In browsers:
Using [`npm`](http://npmjs.org/):
```bash
npm i --save lodash
npm install lodash
{sudo} npm i -g lodash
npm ln lodash
npm install -g lodash
npm link lodash
```
In [Node.js](http://nodejs.org/) & [Ringo](http://ringojs.org/):
To avoid potential issues, update `npm` before installing Lo-Dash:
```bash
npm install npm -g
```
In [Node.js](http://nodejs.org/) and [RingoJS ≥ v0.8.0](http://ringojs.org/):
```js
var _ = require('lodash');
// or as Underscore
// or as a drop-in replacement for Underscore
var _ = require('lodash/dist/lodash.underscore');
```
**Notes:**
* Dont assign values to [special variable](http://nodejs.org/api/repl.html#repl_repl_features) `_` when in the REPL
* If Lo-Dash is installed globally, run [`npm ln lodash`](http://blog.nodejs.org/2011/03/23/npm-1-0-global-vs-local-installation/) in your projects root directory *before* requiring it
* Node.js 0.10.8-0.10.11 [have](https://github.com/joyent/node/issues/5622) [bugs](https://github.com/joyent/node/issues/5688) preventing minified builds
**Note:** If Lo-Dash is installed globally, run [`npm link lodash`](http://blog.nodejs.org/2011/03/23/npm-1-0-global-vs-local-installation/) in your projects root directory before requiring it.
In [RingoJS ≤ v0.7.0](http://ringojs.org/):
```js
var _ = require('lodash')._;
```
In [Rhino](http://www.mozilla.org/rhino/):
@@ -117,27 +237,54 @@ In [Rhino](http://www.mozilla.org/rhino/):
load('lodash.js');
```
In an AMD loader:
In an AMD loader like [RequireJS](http://requirejs.org/):
```js
require({
'packages': [
{ 'name': 'lodash', 'location': 'path/to/lodash', 'main': 'lodash' }
]
'paths': {
'underscore': 'path/to/lodash'
}
},
['lodash'], function(_) {
['underscore'], function(_) {
console.log(_.VERSION);
});
```
## Release Notes
### <sup>v1.1.1</sup>
* Ensured the `underscore` build version of `_.forEach` accepts a `thisArg` argument
* Updated vendor/tar to work with Node v0.10.x
### <sup>v1.1.0</sup>
* Added `rhino -require` support
* Added `_.createCallback`, `_findIndex`, `_.findKey`, `_.parseInt`, `_.runInContext`, and `_.support`
* Added support for `callback` and `thisArg` arguments to `_.flatten`
* Added CommonJS/Node support to precompiled templates
* Ensured the `exports` object is not a DOM element
* Ensured `_.isPlainObject` returns `false` for objects without a `[[Class]]` of “Object”
* Made `_.cloneDeep`s `callback` support more closely follow its documentation
* 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).
## BestieJS
Lo-Dash is part of the BestieJS *“Best in Class”* module collection. This means we promote solid browser/environment support, ES5+ precedents, unit testing, and plenty of documentation.
## Author
| [![twitter/jdalton](http://gravatar.com/avatar/299a3d891ff1920b69c364d061007043?s=70)](http://twitter.com/jdalton "Follow @jdalton on Twitter") |
|---|
| [John-David Dalton](http://allyoucanleet.com/) |
* [John-David Dalton](http://allyoucanleet.com/)
[![twitter/jdalton](http://gravatar.com/avatar/299a3d891ff1920b69c364d061007043?s=70)](https://twitter.com/jdalton "Follow @jdalton on Twitter")
## Contributors
| [![twitter/blainebublitz](http://gravatar.com/avatar/ac1c67fd906c9fecd823ce302283b4c1?s=70)](http://twitter.com/blainebublitz "Follow @BlaineBublitz on Twitter") | [![twitter/kitcambridge](http://gravatar.com/avatar/6662a1d02f351b5ef2f8b4d815804661?s=70)](https://twitter.com/kitcambridge "Follow @kitcambridge on Twitter") | [![twitter/mathias](http://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](http://twitter.com/mathias "Follow @mathias on Twitter") |
|---|---|---|
| [Blaine Bublitz](http://iceddev.com/) | [Kit Cambridge](http://kitcambridge.github.io/) | [Mathias Bynens](http://mathiasbynens.be/) |
* [Kit Cambridge](http://kitcambridge.github.com/)
[![twitter/kitcambridge](http://gravatar.com/avatar/6662a1d02f351b5ef2f8b4d815804661?s=70)](https://twitter.com/kitcambridge "Follow @kitcambridge on Twitter")
* [Mathias Bynens](http://mathiasbynens.be/)
[![twitter/mathias](http://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias "Follow @mathias on Twitter")

View File

@@ -1,23 +0,0 @@
{
"name": "lodash",
"version": "2.2.1",
"main": "dist/lodash.compat.js",
"ignore": [
".*",
"*.custom.*",
"*.template.*",
"*.map",
"*.md",
"/*.min.*",
"/lodash.js",
"index.js",
"component.json",
"package.json",
"doc",
"modularize",
"node_modules",
"perf",
"test",
"vendor"
]
}

2976
build.js Executable file

File diff suppressed because it is too large Load Diff

763
build/minify.js Executable file
View File

@@ -0,0 +1,763 @@
#!/usr/bin/env node
;(function() {
'use strict';
/** Load Node.js modules */
var fs = require('fs'),
https = require('https'),
path = require('path'),
spawn = require('child_process').spawn,
zlib = require('zlib');
/** Load other modules */
var _ = require('../lodash.js'),
mkdirpSync = require('./mkdirp-sync.js'),
preprocess = require('./pre-compile.js'),
postprocess = require('./post-compile.js'),
tar = require('../vendor/tar/tar.js');
/** Add `fs.existsSync` for older versions of Node.js */
fs.existsSync || (fs.existsSync = path.existsSync);
/** 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` */
var closureId = 'a95a8007892aa824ce90c6aa3d3abb0489bf0fff';
/** The Git object ID of `uglifyjs.tar.gz` */
var uglifyId = '41308bd569db41a32d4f08af115875d0342e8bfb';
/** The path of the directory that is the base of the repository */
var basePath = fs.realpathSync(path.join(__dirname, '..'));
/** The path of the `vendor` directory */
var vendorPath = path.join(basePath, 'vendor');
/** The path to the Closure Compiler `.jar` */
var closurePath = path.join(vendorPath, 'closure-compiler', 'compiler.jar');
/** The path to the UglifyJS module */
var uglifyPath = path.join(vendorPath, 'uglifyjs', 'tools', 'node.js');
/** The Closure Compiler command-line options */
var closureOptions = ['--warning_level=QUIET'];
/** The media type for raw blob data */
var mediaType = 'application/vnd.github.v3.raw';
/** Used to detect the Node.js executable in command-line arguments */
var reNode = RegExp('(?:^|' + path.sep + ')node(?:\\.exe)?$');
/** Used to reference parts of the blob href */
var location = (function() {
var host = 'api.github.com',
origin = 'https://api.github.com',
pathname = '/repos/bestiejs/lodash/git/blobs';
return {
'host': host,
'href': origin + pathname,
'origin': origin,
'pathname': pathname
};
}());
/** The Closure Compiler optimization modes */
var optimizationModes = {
'simple': 'SIMPLE_OPTIMIZATIONS',
'advanced': 'ADVANCED_OPTIMIZATIONS'
};
/*--------------------------------------------------------------------------*/
/**
* Minifies a given Lo-Dash `source` and invokes the `options.onComplete`
* callback when finished. The `onComplete` callback is invoked with one
* argument; (outputSource).
*
* @param {Array|String} [source=''] The source to minify or array of commands.
* -o, --output - Write output to a given path/filename.
* -s, --silent - Skip status updates normally logged to the console.
* -t, --template - Applies template specific minifier options.
*
* @param {Object} [options={}] The options object.
* outputPath - Write output to a given path/filename.
* isSilent - Skip status updates normally logged to the console.
* isTemplate - Applies template specific minifier options.
* onComplete - The function called once minification has finished.
*/
function minify(source, options) {
// used to specify the source map URL
var sourceMapURL;
// used to specify the default minifer modes
var modes = ['simple', 'advanced', 'hybrid'];
source || (source = '');
options || (options = {});
// juggle arguments
if (Array.isArray(source)) {
// convert commands to an options object
options = source;
// used to report invalid command-line arguments
var invalidArgs = _.reject(options.slice(reNode.test(options[0]) ? 2 : 0), function(value, index, options) {
if (/^(?:-o|--output)$/.test(options[index - 1]) ||
/^modes=.*$/.test(value)) {
return true;
}
var result = [
'-o', '--output',
'-p', '--source-map',
'-s', '--silent',
'-t', '--template'
].indexOf(value) > -1;
if (!result && /^(?:-p|--source-map)$/.test(options[index - 1])) {
result = true;
sourceMapURL = value;
}
return result;
});
// report invalid arguments
if (invalidArgs.length) {
console.log(
'\n' +
'Invalid argument' + (invalidArgs.length > 1 ? 's' : '') +
' passed: ' + invalidArgs.join(', ')
);
return;
}
var filePath = options[options.length - 1],
isMapped = _.contains(options, '-p') || _.contains(options, '--source-map'),
isSilent = _.contains(options, '-s') || _.contains(options, '--silent'),
isTemplate = _.contains(options, '-t') || _.contains(options, '--template'),
outputPath = path.join(path.dirname(filePath), path.basename(filePath, '.js') + '.min.js');
modes = options.reduce(function(result, value) {
var match = value.match(/modes=(.*)$/);
return match ? match[1].split(/, */) : result;
}, modes);
outputPath = options.reduce(function(result, value, index) {
if (/-o|--output/.test(value)) {
result = options[index + 1];
var dirname = path.dirname(result);
mkdirpSync(dirname);
result = path.join(fs.realpathSync(dirname), path.basename(result));
}
return result;
}, outputPath);
options = {
'filePath': filePath,
'isMapped': isMapped,
'isSilent': isSilent,
'isTemplate': isTemplate,
'modes': modes,
'outputPath': outputPath,
'sourceMapURL': sourceMapURL
};
source = fs.readFileSync(filePath, 'utf8');
}
modes = options.modes || modes;
if (options.isMapped) {
modes = modes.filter(function(mode) {
return mode != 'hybrid';
});
}
if (options.isTemplate) {
modes = modes.filter(function(mode) {
return mode != 'advanced';
});
}
options.modes = modes;
// fetch the Closure Compiler
getDependency({
'id': 'closure-compiler',
'hashId': closureId,
'path': vendorPath,
'title': 'the Closure Compiler',
'onComplete': function(exception) {
var error = exception;
// fetch UglifyJS
getDependency({
'id': 'uglifyjs',
'hashId': uglifyId,
'title': 'UglifyJS',
'path': vendorPath,
'onComplete': function(exception) {
error || (error = exception);
if (!error) {
new Minify(source, options);
}
}
});
}
});
}
/**
* The Minify constructor used to keep state of each `minify` invocation.
*
* @private
* @constructor
* @param {String} source The source to minify.
* @param {Object} options The options object.
* outputPath - Write output to a given path/filename.
* isSilent - Skip status updates normally logged to the console.
* isTemplate - Applies template specific minifier options.
* onComplete - The function called once minification has finished.
*/
function Minify(source, options) {
// juggle arguments
if (typeof source == 'object' && source) {
options = source || options;
source = options.source || '';
}
this.compiled = { 'simple': {}, 'advanced': {} };
this.hybrid = { 'simple': {}, 'advanced': {} };
this.uglified = {};
this.filePath = options.filePath;
this.isMapped = !!options.isMapped;
this.isSilent = !!options.isSilent;
this.isTemplate = !!options.isTemplate;
this.outputPath = options.outputPath;
this.sourceMapURL = options.sourceMapURL;
var modes = this.modes = options.modes;
source = this.source = preprocess(source, options);
this.onComplete = options.onComplete || function(data) {
var outputPath = this.outputPath,
sourceMap = data.sourceMap;
fs.writeFileSync(outputPath, data.source, 'utf8');
if (sourceMap) {
fs.writeFileSync(getMapPath(outputPath), sourceMap, 'utf8');
}
};
// begin the minification process
if (_.contains(modes, 'simple')) {
closureCompile.call(this, source, 'simple', onClosureSimpleCompile.bind(this));
} else if (_.contains(modes, 'advanced')) {
onClosureSimpleGzip.call(this);
} else {
onClosureAdvancedGzip.call(this);
}
}
/*--------------------------------------------------------------------------*/
/**
* Fetches a required `.tar.gz` dependency with the given Git object ID from
* the Lo-Dash repo on GitHub. The object ID may be obtained by running
* `git hash-object path/to/dependency.tar.gz`.
*
* @private
* @param {Object} options The options object.
* id - The Git object ID of the `.tar.gz` file.
* onComplete - The function called once the extraction has finished.
* path - The path of the extraction directory.
* title - The dependency's title used in status updates logged to the console.
*/
function getDependency(options) {
options || (options = {});
var ran,
destPath = options.path,
hashId = options.hashId,
id = options.id,
onComplete = options.onComplete,
title = options.title;
// exit early if dependency exists
if (fs.existsSync(path.join(destPath, id))) {
onComplete();
return;
}
var callback = function(exception) {
if (ran) {
return;
}
if (exception) {
console.error([
'There was a problem installing ' + title + '.',
'Try running the command as root, via `sudo`, or manually install by running:',
'',
"curl -H 'Accept: " + mediaType + "' " + location.href + '/' + hashId + " | tar xvz -C '" + destPath + "'",
''
].join('\n'));
}
ran = true;
process.removeListener('uncaughtException', callback);
onComplete(exception);
};
console.log('Downloading ' + title + '...');
process.on('uncaughtException', callback);
https.get({
'host': location.host,
'path': location.pathname + '/' + hashId,
'headers': {
// By default, all GitHub blob API endpoints return a JSON document
// containing Base64-encoded blob data. Overriding the `Accept` header
// with the GitHub raw media type returns the blob data directly.
// See http://developer.github.com/v3/media/.
'Accept': mediaType
}
}, function(response) {
var decompressor = zlib.createUnzip(),
parser = new tar.Extract({ 'path': destPath });
parser.on('end', callback);
response.pipe(decompressor).pipe(parser);
});
}
/**
* Resolves the source map path from the given output path.
*
* @private
* @param {String} outputPath The output path.
* @returns {String} Returns the source map path.
*/
function getMapPath(outputPath) {
return path.join(path.dirname(outputPath), path.basename(outputPath, '.js') + '.map');
}
/*--------------------------------------------------------------------------*/
/**
* Compresses a `source` string using the Closure Compiler. Yields the
* minified result, and any exceptions encountered, to a `callback` function.
*
* @private
* @param {String} source The JavaScript source to minify.
* @param {String} mode The optimization mode.
* @param {Function} callback The function called once the process has completed.
*/
function closureCompile(source, mode, callback) {
var filePath = this.filePath,
isAdvanced = mode == 'advanced',
isMapped = this.isMapped,
options = closureOptions.slice(),
outputPath = this.outputPath,
mapPath = getMapPath(outputPath),
sourceMapURL = this.sourceMapURL || path.basename(mapPath);
// remove copyright header to make other modifications easier
var license = (/^(?:\s*\/\/.*\s*|\s*\/\*[^*]*\*+(?:[^\/][^*]*\*+)*\/\s*)*/.exec(source) || [''])[0];
if (license) {
source = source.replace(license, '');
}
var hasIIFE = /^;?\(function[^{]+{/.test(source),
isStrict = hasIIFE && /^;?\(function[^{]+{\s*["']use strict["']/.test(source);
// to avoid stripping the IIFE, convert it to a function call
if (hasIIFE && isAdvanced) {
source = source
.replace(/\(function/, '__iife__$&')
.replace(/\(this\)\)([\s;]*(\n\/\/.+)?)$/, ', this)$1');
}
options.push('--compilation_level=' + optimizationModes[mode]);
if (isMapped) {
options.push('--create_source_map=' + mapPath, '--source_map_format=V3');
}
var compiler = spawn('java', ['-jar', closurePath].concat(options));
if (!this.isSilent) {
console.log('Compressing ' + path.basename(outputPath, '.js') + ' using the Closure Compiler (' + mode + ')...');
}
var error = '';
compiler.stderr.on('data', function(data) {
error += data;
});
var output = '';
compiler.stdout.on('data', function(data) {
output += data;
});
compiler.on('exit', function(status) {
// `status` contains the process exit code
if (status) {
var exception = new Error(error);
exception.status = status;
}
// restore IIFE and move exposed vars inside the IIFE
if (hasIIFE && isAdvanced) {
output = output
.replace(/__iife__\(/, '(')
.replace(/,\s*this\)([\s;]*(\n\/\/.+)?)$/, '(this))$1')
.replace(/^((?:var (?:\w+=(?:!0|!1|null)[,;])+)?)([\s\S]*?function[^{]+{)/, '$2$1');
}
// inject "use strict" directive
if (isStrict) {
output = output.replace(/^[\s\S]*?function[^{]+{/, '$&"use strict";');
}
// restore copyright header
if (license) {
output = license + output;
}
if (isMapped) {
var mapOutput = fs.readFileSync(mapPath, 'utf8');
fs.unlinkSync(mapPath);
output = output.replace(/[\s;]*$/, '\n/*\n//@ sourceMappingURL=' + sourceMapURL) + '\n*/';
mapOutput = JSON.parse(mapOutput);
mapOutput.file = path.basename(outputPath);
mapOutput.sources = [path.basename(filePath)];
mapOutput = JSON.stringify(mapOutput, null, 2);
}
callback(exception, output, mapOutput);
});
// proxy the standard input to the Closure Compiler
compiler.stdin.end(source);
}
/**
* Compresses a `source` string using UglifyJS. Yields the result to a
* `callback` function. This function is synchronous; the `callback` is used
* for symmetry.
*
* @private
* @param {String} source The JavaScript source to minify.
* @param {String} label The label to log.
* @param {Function} callback The function called once the process has completed.
*/
function uglify(source, label, callback) {
if (!this.isSilent) {
console.log('Compressing ' + path.basename(this.outputPath, '.js') + ' using ' + label + '...');
}
try {
var uglifyJS = require(uglifyPath);
// 1. parse
var toplevel = uglifyJS.parse(source);
// 2. compress
// enable unsafe comparisons
toplevel.figure_out_scope();
toplevel = toplevel.transform(uglifyJS.Compressor({
'comparisons': false,
'unsafe': true,
'unsafe_comps': true,
'warnings': false
}));
// 3. mangle
// excluding the `define` function exposed by AMD loaders
toplevel.figure_out_scope();
toplevel.compute_char_frequency();
toplevel.mangle_names({
'except': ['define']
});
// 4. output
// restrict lines to 500 characters for consistency with the Closure Compiler
var stream = uglifyJS.OutputStream({
'ascii_only': true,
'comments': /@cc_on|@license|@preserve/i,
'max_line_len': 500,
});
toplevel.print(stream);
}
catch(e) {
var exception = e;
}
callback(exception, stream && String(stream));
}
/*--------------------------------------------------------------------------*/
/**
* The Closure Compiler callback for simple optimizations.
*
* @private
* @param {Object|Undefined} exception The error object.
* @param {String} result The resulting minified source.
* @param {String} map The source map output.
*/
function onClosureSimpleCompile(exception, result, map) {
if (exception) {
throw exception;
}
result = postprocess(result);
var simple = this.compiled.simple;
simple.source = result;
simple.sourceMap = map;
zlib.gzip(result, onClosureSimpleGzip.bind(this));
}
/**
* The Closure Compiler `gzip` callback for simple optimizations.
*
* @private
* @param {Object|Undefined} exception The error object.
* @param {Buffer} result The resulting gzipped source.
*/
function onClosureSimpleGzip(exception, result) {
if (exception) {
throw exception;
}
if (result != null) {
if (!this.isSilent) {
console.log('Done. Size: %d bytes.', result.length);
}
this.compiled.simple.gzip = result;
}
// compile the source using advanced optimizations
if (_.contains(this.modes, 'advanced')) {
closureCompile.call(this, this.source, 'advanced', onClosureAdvancedCompile.bind(this));
} else {
onClosureAdvancedGzip.call(this);
}
}
/**
* The Closure Compiler callback for advanced optimizations.
*
* @private
* @param {Object|Undefined} exception The error object.
* @param {String} result The resulting minified source.
* @param {String} map The source map output.
*/
function onClosureAdvancedCompile(exception, result, map) {
if (exception) {
throw exception;
}
result = postprocess(result);
var advanced = this.compiled.advanced;
advanced.source = result;
advanced.sourceMap = map;
zlib.gzip(result, onClosureAdvancedGzip.bind(this));
}
/**
* The Closure Compiler `gzip` callback for advanced optimizations.
*
* @private
* @param {Object|Undefined} exception The error object.
* @param {Buffer} result The resulting gzipped source.
*/
function onClosureAdvancedGzip(exception, result) {
if (exception) {
throw exception;
}
if (result != null) {
if (!this.isSilent) {
console.log('Done. Size: %d bytes.', result.length);
}
this.compiled.advanced.gzip = result;
}
// minify the source using UglifyJS
if (!this.isMapped) {
uglify.call(this, this.source, 'UglifyJS', onUglify.bind(this));
} else {
onComplete.call(this);
}
}
/**
* The UglifyJS callback.
*
* @private
* @param {Object|Undefined} exception The error object.
* @param {String} result The resulting minified source.
*/
function onUglify(exception, result) {
if (exception) {
throw exception;
}
result = postprocess(result);
this.uglified.source = result;
zlib.gzip(result, onUglifyGzip.bind(this));
}
/**
* The UglifyJS `gzip` callback.
*
* @private
* @param {Object|Undefined} exception The error object.
* @param {Buffer} result The resulting gzipped source.
*/
function onUglifyGzip(exception, result) {
if (exception) {
throw exception;
}
if (result != null) {
if (!this.isSilent) {
console.log('Done. Size: %d bytes.', result.length);
}
this.uglified.gzip = result;
}
// minify the already Closure Compiler simple optimized source using UglifyJS
var modes = this.modes;
if (_.contains(modes, 'hybrid')) {
if (_.contains(modes, 'simple')) {
uglify.call(this, this.compiled.simple.source, 'hybrid (simple)', onSimpleHybrid.bind(this));
} else if (_.contains(modes, 'advanced')) {
onSimpleHybridGzip.call(this);
}
} else {
onComplete.call(this);
}
}
/**
* The hybrid callback for simple optimizations.
*
* @private
* @param {Object|Undefined} exception The error object.
* @param {String} result The resulting minified source.
*/
function onSimpleHybrid(exception, result) {
if (exception) {
throw exception;
}
result = postprocess(result);
this.hybrid.simple.source = result;
zlib.gzip(result, onSimpleHybridGzip.bind(this));
}
/**
* The hybrid `gzip` callback for simple optimizations.
*
* @private
* @param {Object|Undefined} exception The error object.
* @param {Buffer} result The resulting gzipped source.
*/
function onSimpleHybridGzip(exception, result) {
if (exception) {
throw exception;
}
if (result != null) {
if (!this.isSilent) {
console.log('Done. Size: %d bytes.', result.length);
}
this.hybrid.simple.gzip = result;
}
// minify the already Closure Compiler advance optimized source using UglifyJS
if (_.contains(this.modes, 'advanced')) {
uglify.call(this, this.compiled.advanced.source, 'hybrid (advanced)', onAdvancedHybrid.bind(this));
} else {
onComplete.call(this);
}
}
/**
* The hybrid callback for advanced optimizations.
*
* @private
* @param {Object|Undefined} exception The error object.
* @param {String} result The resulting minified source.
*/
function onAdvancedHybrid(exception, result) {
if (exception) {
throw exception;
}
result = postprocess(result);
this.hybrid.advanced.source = result;
zlib.gzip(result, onAdvancedHybridGzip.bind(this));
}
/**
* The hybrid `gzip` callback for advanced optimizations.
*
* @private
* @param {Object|Undefined} exception The error object.
* @param {Buffer} result The resulting gzipped source.
*/
function onAdvancedHybridGzip(exception, result) {
if (exception) {
throw exception;
}
if (result != null) {
if (!this.isSilent) {
console.log('Done. Size: %d bytes.', result.length);
}
this.hybrid.advanced.gzip = result;
}
// finish by choosing the smallest compressed file
onComplete.call(this);
}
/**
* The callback executed after the source is minified and gzipped.
*
* @private
*/
function onComplete() {
var compiledSimple = this.compiled.simple,
compiledAdvanced = this.compiled.advanced,
uglified = this.uglified,
hybridSimple = this.hybrid.simple,
hybridAdvanced = this.hybrid.advanced;
var objects = [
compiledSimple,
compiledAdvanced,
uglified,
hybridSimple,
hybridAdvanced
];
var gzips = objects
.map(function(data) { return data.gzip; })
.filter(Boolean);
// select the smallest gzipped file and use its minified counterpart as the
// official minified release (ties go to the Closure Compiler)
var min = gzips.reduce(function(min, gzip) {
var length = gzip.length;
return min > length ? length : min;
}, Infinity);
// pass the minified source to the "onComplete" callback
objects.some(function(data) {
var gzip = data.gzip;
if (gzip && gzip.length == min) {
data.outputPath = this.outputPath;
this.onComplete(data);
return true;
}
}, this);
}
/*--------------------------------------------------------------------------*/
// expose `minify`
if (module != require.main) {
module.exports = minify;
}
else {
// read the Lo-Dash source file from the first argument if the script
// was invoked directly (e.g. `node minify.js source.js`) and write to
// `<filename>.min.js`
(function() {
var options = process.argv;
if (options.length < 3) {
return;
}
minify(options);
}());
}
}());

43
build/mkdirp-sync.js Executable file
View File

@@ -0,0 +1,43 @@
#!/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;
}());

83
build/post-compile.js Normal file
View File

@@ -0,0 +1,83 @@
#!/usr/bin/env node
;(function() {
'use strict';
/** The Node.js filesystem module */
var fs = require('fs');
/** The minimal license/copyright template */
var licenseTemplate = [
'/**',
' * @license',
' * Lo-Dash <%= VERSION %> lodash.com/license',
' * Underscore.js 1.4.4 underscorejs.org/LICENSE',
' */'
].join('\n');
/*--------------------------------------------------------------------------*/
/**
* Post-process a given minified Lo-Dash `source`, preparing it for
* deployment.
*
* @param {String} source The source to process.
* @returns {String} Returns the processed source.
*/
function postprocess(source) {
// remove copyright header
source = source.replace(/^\/\**[\s\S]+?\*\/\n/, '');
// correct overly aggressive Closure Compiler advanced optimizations
source = source
.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
// correct the AMD module definition for AMD build optimizers
// (e.g. from `"number" == typeof x` to `typeof x == "number")
source = source.replace(/(\w)?("[^"]+")\s*([!=]=)\s*(typeof(?:\s*\([^)]+\)|\s+[.\w]+(?!\[)))/g, function(match, other, type, equality, expression) {
return (other ? other + ' ' : '') + expression + equality + type;
});
// add trailing semicolon
if (source) {
source = source.replace(/[\s;]*?(\s*\/\/.*\s*|\s*\/\*[^*]*\*+(?:[^\/][^*]*\*+)*\/\s*)*$/, ';$1');
}
// exit early if version snippet isn't found
var snippet = /VERSION\s*[=:]\s*([\'"])(.*?)\1/.exec(source);
if (!snippet) {
return source;
}
// add new copyright header
var version = snippet[2];
source = licenseTemplate.replace('<%= VERSION %>', version) + '\n;' + source;
return source;
}
/*--------------------------------------------------------------------------*/
// expose `postprocess`
if (module != require.main) {
module.exports = postprocess;
}
else {
// read the Lo-Dash source file from the first argument if the script
// was invoked directly (e.g. `node post-compile.js source.js`) and write to
// the same file
(function() {
var options = process.argv;
if (options.length < 3) {
return;
}
var filePath = options[options.length - 1],
source = fs.readFileSync(filePath, 'utf8');
fs.writeFileSync(filePath, postprocess(source), 'utf8');
}());
}
}());

416
build/pre-compile.js Normal file
View File

@@ -0,0 +1,416 @@
#!/usr/bin/env node
;(function() {
'use strict';
/** The Node.js filesystem module */
var fs = require('fs');
/** Used to minify variables embedded in compiled strings */
var compiledVars = [
'args',
'argsIndex',
'argsLength',
'callback',
'collection',
'ctor',
'guard',
'hasOwnProperty',
'index',
'isArguments',
'isArray',
'isString',
'iterable',
'length',
'keys',
'lodash',
'object',
'objectTypes',
'ownIndex',
'ownProps',
'result',
'skipProto',
'source',
'thisArg'
];
/** Used to minify `iteratorTemplate` data properties */
var iteratorOptions = [
'args',
'arrays',
'bottom',
'firstArg',
'init',
'loop',
'shadowedProps',
'top',
'useHas',
'useKeys'
];
/** Used to minify variables and string values to a single character */
var minNames = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'.split('');
minNames.push.apply(minNames, minNames.map(function(value) {
return value + value;
}));
/** Used to protect the specified properties from getting minified */
var propWhitelist = [
'Array',
'Boolean',
'Date',
'Function',
'Math',
'Number',
'Object',
'RegExp',
'String',
'TypeError',
'VERSION',
'_',
'__wrapped__',
'after',
'all',
'amd',
'any',
'argsClass',
'argsObject',
'assign',
'at',
'attachEvent',
'bind',
'bindAll',
'bindKey',
'clearTimeout',
'clone',
'cloneDeep',
'collect',
'compact',
'compose',
'contains',
'countBy',
'createCallback',
'criteria',
'debounce',
'defaults',
'defer',
'delay',
'detect',
'difference',
'drop',
'each',
'enumPrototypes',
'environment',
'escape',
'evaluate',
'every',
'exports',
'extend',
'fastBind',
'fastKeys',
'filter',
'find',
'findIndex',
'findKey',
'first',
'flatten',
'foldl',
'foldr',
'forEach',
'forIn',
'forOwn',
'functions',
'global',
'groupBy',
'has',
'head',
'identity',
'imports',
'include',
'index',
'indexOf',
'initial',
'inject',
'interpolate',
'intersection',
'invert',
'invoke',
'isArguments',
'isArray',
'isBoolean',
'isDate',
'isElement',
'isEmpty',
'isEqual',
'isEqual',
'isFinite',
'isFinite',
'isFunction',
'isNaN',
'isNull',
'isNumber',
'isObject',
'isPlainObject',
'isRegExp',
'isString',
'isUndefined',
'keys',
'last',
'lastIndexOf',
'map',
'max',
'memoize',
'merge',
'methods',
'min',
'mixin',
'noConflict',
'nodeClass',
'nonEnumArgs',
'nonEnumShadows',
'object',
'omit',
'once',
'ownLast',
'pairs',
'parseInt',
'partial',
'partialRight',
'pick',
'pluck',
'random',
'range',
'reduce',
'reduceRight',
'reject',
'rest',
'result',
'runInContext',
'select',
'setImmediate',
'setTimeout',
'shuffle',
'size',
'some',
'sortBy',
'sortedIndex',
'source',
'spliceObjects',
'support',
'tail',
'take',
'tap',
'template',
'templateSettings',
'throttle',
'times',
'toArray',
'unescape',
'unindexedChars',
'union',
'uniq',
'unique',
'uniqueId',
'value',
'values',
'variable',
'where',
'without',
'wrap',
'zip',
'zipObject',
// properties used by the `backbone` and `underscore` builds
'__chain__',
'chain',
'findWhere'
];
/*--------------------------------------------------------------------------*/
/**
* Pre-process a given Lo-Dash `source`, preparing it for minification.
*
* @param {String} [source=''] The source to process.
* @param {Object} [options={}] The options object.
* @returns {String} Returns the processed source.
*/
function preprocess(source, options) {
source || (source = '');
options || (options = {});
// remove unrecognized JSDoc tags so the Closure Compiler won't complain
source = source.replace(/@(?:alias|category)\b.*/g, '');
if (options.isTemplate) {
return source;
}
// add brackets to whitelisted properties so the Closure Compiler won't mung them
// http://code.google.com/closure/compiler/docs/api-tutorial3.html#export
source = source.replace(RegExp('\\.(' + propWhitelist.join('|') + ')\\b', 'g'), function(match, prop) {
return "['" + prop.replace(/['\n\r\t]/g, '\\$&') + "']";
});
// remove brackets from `lodash.createCallback` in `eachIteratorOptions`
source = source.replace('lodash[\'createCallback\'](callback, thisArg)"', 'lodash.createCallback(callback, thisArg)"');
// remove brackets from `lodash.createCallback` in `_.assign`
source = source.replace("' var callback = lodash['createCallback']", "'var callback=lodash.createCallback");
// remove brackets from `_.escape` in `_.template`
source = source.replace(/__e *= *_\['escape']/g, '__e=_.escape');
// remove brackets from `collection.indexOf` in `_.contains`
source = source.replace("collection['indexOf'](target)", 'collection.indexOf(target)');
// remove brackets from `result[length].value` in `_.sortBy`
source = source.replace("result[length]['value']", 'result[length].value');
// remove whitespace from string literals
source = source.replace(/^((?:[ "'\w]+:)? *)"[^"\\\n]*(?:\\.[^"\\\n]*)*"|'[^'\\\n]*(?:\\.[^'\\\n]*)*'/gm, function(string, left) {
// clip after an object literal property name or leading spaces
if (left) {
string = string.slice(left.length);
}
// avoids removing the '\n' of the `stringEscapes` object
string = string.replace(/\[object |delete |else (?!{)|function | in |return\s+[\w"']|throw |typeof |use strict|var |@ |(["'])\\n\1|\\\\n|\\n|\s+/g, function(match) {
return match == false || match == '\\n' ? '' : match;
});
// unclip
return (left || '') + string;
});
// remove whitespace from `_.template` related regexes
source = source.replace(/reEmptyString\w+ *=.+/g, function(match) {
return match.replace(/ |\\n/g, '');
});
// remove newline from double-quoted strings in `_.template`
source = source
.replace('"__p += \'"', '"__p+=\'"')
.replace('"\';\n"', '"\';"')
// remove debug sourceURL use in `_.template`
source = source.replace(/(?:\s*\/\/.*\n)* *var sourceURL[^;]+;|\+ *sourceURL/g, '');
// minify internal properties used by 'compareAscending' and `_.sortBy`
(function() {
var properties = ['criteria', 'index', 'value'],
snippets = source.match(/( +)function (?:compareAscending|sortBy)\b[\s\S]+?\n\1}/g);
if (!snippets) {
return;
}
snippets.forEach(function(snippet) {
var modified = snippet;
// minify properties
properties.forEach(function(property, index) {
var minName = minNames[index],
reBracketProp = RegExp("\\['(" + property + ")'\\]", 'g'),
reDotProp = RegExp('\\.' + property + '\\b', 'g'),
rePropColon = RegExp("([^?\\s])\\s*([\"'])?\\b" + property + "\\2 *:", 'g');
modified = modified
.replace(reBracketProp, "['" + minName + "']")
.replace(reDotProp, "['" + minName + "']")
.replace(rePropColon, "$1'" + minName + "':");
});
// replace with modified snippet
source = source.replace(snippet, function() {
return modified;
});
});
}());
// minify all compilable snippets
var snippets = source.match(
RegExp([
// match the `iteratorTemplate`
'( +)var iteratorTemplate\\b[\\s\\S]+?\\n\\1}',
// match methods created by `createIterator` calls
'createIterator\\((?:{|[a-zA-Z]+)[\\s\\S]*?\\);\\n',
// match variables storing `createIterator` options
'( +)var [a-zA-Z]+IteratorOptions\\b[\\s\\S]+?\\n\\2}',
// match the the `createIterator` function
'( +)function createIterator\\b[\\s\\S]+?\\n\\3}'
].join('|'), 'g')
);
// exit early if no compilable snippets
if (!snippets) {
return source;
}
snippets.forEach(function(snippet, index) {
var isCreateIterator = /function createIterator\b/.test(snippet),
isIteratorTemplate = /var iteratorTemplate\b/.test(snippet),
modified = snippet;
// add brackets to iterator option properties so the Closure Compiler won't mung them
modified = modified.replace(RegExp('\\.(' + iteratorOptions.join('|') + ')\\b', 'g'), function(match, prop) {
return "['" + prop.replace(/['\n\r\t]/g, '\\$&') + "']";
});
// minify `createIterator` option property names
iteratorOptions.forEach(function(property, index) {
var minName = minNames[index];
// minify variables in `iteratorTemplate` or property names in everything else
modified = isIteratorTemplate
? modified.replace(RegExp('\\b' + property + '\\b', 'g'), minName)
: modified.replace(RegExp("'" + property + "'", 'g'), "'" + minName + "'");
});
// minify snippet variables / arguments
compiledVars.forEach(function(varName, index) {
var minName = minNames[index];
// minify variable names present in strings
if (isCreateIterator) {
modified = modified.replace(RegExp('(([\'"])[^\\n\\2]*?)\\b' + varName + '\\b(?=[^\\n\\2]*\\2[ ,+]+$)', 'gm'), '$1' + minName);
}
// ensure properties in compiled strings aren't minified
else {
modified = modified.replace(RegExp('([^.])\\b' + varName + '\\b(?!\' *[\\]:])', 'g'), '$1' + minName);
}
// correct `typeof` values
if (/^(?:boolean|function|object|number|string|undefined)$/.test(varName)) {
modified = modified.replace(RegExp("(typeof [^']+')" + minName + "'", 'g'), '$1' + varName + "'");
}
});
// replace with modified snippet
source = source.replace(snippet, function() {
return modified;
});
});
return source;
}
/*--------------------------------------------------------------------------*/
// expose `preprocess`
if (module != require.main) {
module.exports = preprocess;
}
else {
// read the Lo-Dash source file from the first argument if the script
// was invoked directly (e.g. `node pre-compile.js source.js`) and write to
// the same file
(function() {
var options = process.argv;
if (options.length < 3) {
return;
}
var filePath = options[options.length - 1],
isTemplate = options.indexOf('-t') > -1 || options.indexOf('--template') > -1,
source = fs.readFileSync(filePath, 'utf8');
fs.writeFileSync(filePath, preprocess(source, {
'isTemplate': isTemplate
}), 'utf8');
}());
}
}());

View File

@@ -1,12 +0,0 @@
{
"name": "lodash",
"repo": "lodash/lodash",
"version": "2.2.1",
"description": "A utility library delivering consistency, customization, performance, & extras.",
"license": "MIT",
"keywords": ["amd", "browser", "client", "functional", "server", "util"],
"scripts": [
"index.js",
"dist/lodash.compat.js"
]
}

4665
dist/lodash.compat.js vendored

File diff suppressed because it is too large Load Diff

View File

@@ -1,56 +1,46 @@
/**
* @license
* Lo-Dash 2.2.1 (Custom Build) lodash.com/license | Underscore.js 1.5.2 underscorejs.org/LICENSE
* Lo-Dash 1.1.1 (Custom Build) lodash.com/license
* Build: `lodash -o ./dist/lodash.compat.js`
* Underscore.js 1.4.4 underscorejs.org/LICENSE
*/
;(function(){function n(n,t,e){e=(e||0)-1;for(var r=n?n.length:0;++e<r;)if(n[e]===t)return e;return-1}function t(t,e){var r=typeof e;if(t=t.l,"boolean"==r||null==e)return t[e]?0:-1;"number"!=r&&"string"!=r&&(r="object");var u="number"==r?e:b+e;return t=(t=t[r])&&t[u],"object"==r?t&&-1<n(t,e)?0:-1:t?0:-1}function e(n){var t=this.l,e=typeof n;if("boolean"==e||null==n)t[n]=!0;else{"number"!=e&&"string"!=e&&(e="object");var r="number"==e?n:b+n,t=t[e]||(t[e]={});"object"==e?(t[r]||(t[r]=[])).push(n):t[r]=!0
}}function r(n){return n.charCodeAt(0)}function u(n,t){var e=n.m,r=t.m;if(e!==r){if(e>r||typeof e=="undefined")return 1;if(e<r||typeof r=="undefined")return-1}return n.n-t.n}function o(n){var t=-1,r=n.length,u=n[0],o=n[0|r/2],a=n[r-1];if(u&&typeof u=="object"&&o&&typeof o=="object"&&a&&typeof a=="object")return!1;for(u=l(),u["false"]=u["null"]=u["true"]=u.undefined=!1,o=l(),o.k=n,o.l=u,o.push=e;++t<r;)o.push(n[t]);return o}function a(n){return"\\"+Z[n]}function i(){return y.pop()||[]}function l(){return m.pop()||{k:null,l:null,m:null,"false":!1,n:0,"null":!1,number:null,object:null,push:null,string:null,"true":!1,undefined:!1,o:null}
}function f(n){return typeof n.toString!="function"&&typeof(n+"")=="string"}function c(){}function p(n){n.length=0,y.length<j&&y.push(n)}function s(n){var t=n.l;t&&s(t),n.k=n.l=n.m=n.object=n.number=n.string=n.o=null,m.length<j&&m.push(n)}function g(n,t,e){t||(t=0),typeof e=="undefined"&&(e=n?n.length:0);var r=-1;e=e-t||0;for(var u=Array(0>e?0:e);++r<e;)u[r]=n[t+r];return u}function h(e){function y(n){return n&&typeof n=="object"&&!Je(n)&&de.call(n,"__wrapped__")?n:new m(n)}function m(n,t){this.__chain__=!!t,this.__wrapped__=n
}function j(n,t,e,r,u){if(e){var o=e(n);if(typeof o!="undefined")return o}if(!bt(n))return n;var a=ke.call(n);if(!U[a]||!We.nodeClass&&f(n))return n;var l=qe[a];switch(a){case z:case q:return new l(+n);case G:case H:return new l(n);case M:return o=l(n.source,I.exec(n)),o.lastIndex=n.lastIndex,o}if(a=Je(n),t){var c=!r;r||(r=i()),u||(u=i());for(var s=r.length;s--;)if(r[s]==n)return u[s];o=a?l(n.length):{}}else o=a?g(n):er({},n);return a&&(de.call(n,"index")&&(o.index=n.index),de.call(n,"input")&&(o.input=n.input)),t?(r.push(n),u.push(o),(a?tr:or)(n,function(n,a){o[a]=j(n,t,e,r,u)
}),c&&(p(r),p(u)),o):o}function Z(n,t,e){if(typeof n!="function")return Ht;if(typeof t=="undefined")return n;var r=n.__bindData__||We.funcNames&&!n.name;if(typeof r=="undefined"){var u=P&&ye.call(n);We.funcNames||!u||A.test(u)||(r=!0),(We.funcNames||!r)&&(r=!We.funcDecomp||P.test(u),Ge(n,r))}if(true!==r&&r&&1&r[1])return n;switch(e){case 1:return function(e){return n.call(t,e)};case 2:return function(e,r){return n.call(t,e,r)};case 3:return function(e,r,u){return n.call(t,e,r,u)};case 4:return function(e,r,u,o){return n.call(t,e,r,u,o)
}}return Gt(n,t)}function tt(n,t,e,r){r=(r||0)-1;for(var u=n?n.length:0,o=[];++r<u;){var a=n[r];if(a&&typeof a=="object"&&typeof a.length=="number"&&(Je(a)||vt(a))){t||(a=tt(a,t,e));var i=-1,l=a.length,f=o.length;for(o.length+=l;++i<l;)o[f++]=a[i]}else e||o.push(a)}return o}function et(n,t,e,r,u,o){if(e){var a=e(n,t);if(typeof a!="undefined")return!!a}if(n===t)return 0!==n||1/n==1/t;if(n===n&&!(n&&Y[typeof n]||t&&Y[typeof t]))return!1;if(null==n||null==t)return n===t;var l=ke.call(n),c=ke.call(t);
if(l==L&&(l=J),c==L&&(c=J),l!=c)return!1;switch(l){case z:case q:return+n==+t;case G:return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;case M:case H:return n==oe(t)}if(c=l==T,!c){if(de.call(n,"__wrapped__")||de.call(t,"__wrapped__"))return et(n.__wrapped__||n,t.__wrapped__||t,e,r,u,o);if(l!=J||!We.nodeClass&&(f(n)||f(t)))return!1;var l=!We.argsObject&&vt(n)?re:n.constructor,s=!We.argsObject&&vt(t)?re:t.constructor;if(l!=s&&!(_t(l)&&l instanceof l&&_t(s)&&s instanceof s))return!1}for(s=!u,u||(u=i()),o||(o=i()),l=u.length;l--;)if(u[l]==n)return o[l]==t;
var g=0,a=!0;if(u.push(n),o.push(t),c){if(l=n.length,g=t.length,a=g==n.length,!a&&!r)return a;for(;g--;)if(c=l,s=t[g],r)for(;c--&&!(a=et(n[c],s,e,r,u,o)););else if(!(a=et(n[g],s,e,r,u,o)))break;return a}return ur(t,function(t,i,l){return de.call(l,i)?(g++,a=de.call(n,i)&&et(n[i],t,e,r,u,o)):void 0}),a&&!r&&ur(n,function(n,t,e){return de.call(e,t)?a=-1<--g:void 0}),s&&(p(u),p(o)),a}function ut(n,t,e,r,u){(Je(t)?St:or)(t,function(t,o){var a,i,l=t,f=n[o];if(t&&((i=Je(t))||ar(t))){for(l=r.length;l--;)if(a=r[l]==t){f=u[l];
break}if(!a){var c;e&&(l=e(f,t),c=typeof l!="undefined")&&(f=l),c||(f=i?Je(f)?f:[]:ar(f)?f:{}),r.push(t),u.push(f),c||ut(f,t,e,r,u)}}else e&&(l=e(f,t),typeof l=="undefined"&&(l=t)),typeof l!="undefined"&&(f=l);n[o]=f})}function at(e,r,u){var a=-1,l=st(),f=e?e.length:0,c=[],g=!r&&f>=w&&l===n,h=u||g?i():c;if(g){var v=o(h);v?(l=t,h=v):(g=!1,h=u?h:(p(h),c))}for(;++a<f;){var v=e[a],y=u?u(v,a,e):v;(r?!a||h[h.length-1]!==y:0>l(h,y))&&((u||g)&&h.push(y),c.push(v))}return g?(p(h.k),s(h)):u&&p(h),c}function it(n){return function(t,e,r){var u={};
if(e=y.createCallback(e,r,3),Je(t)){r=-1;for(var o=t.length;++r<o;){var a=t[r];n(u,a,e(a,r,t),t)}}else tr(t,function(t,r,o){n(u,t,e(t,r,o),o)});return u}}function lt(n,t,e,r,u,o){var a=1&t,i=2&t,l=4&t,f=8&t,c=16&t,p=32&t,s=n;if(!i&&!_t(n))throw new ae;c&&!e.length&&(t&=-17,c=e=!1),p&&!r.length&&(t&=-33,p=r=!1);var g=n&&n.__bindData__;if(g)return!a||1&g[1]||(g[4]=u),!a&&1&g[1]&&(t|=8),!l||4&g[1]||(g[5]=o),c&&be.apply(g[2]||(g[2]=[]),e),p&&be.apply(g[3]||(g[3]=[]),r),g[1]|=t,lt.apply(null,g);if(!a||i||l||p||!(We.fastBind||Se&&c))v=function(){var g=arguments,h=a?u:this;
return(l||c||p)&&(g=Le.call(g),c&&Ee.apply(g,e),p&&be.apply(g,r),l&&g.length<o)?(t|=16,lt(n,f?t:-4&t,g,null,u,o)):(i&&(n=h[s]),this instanceof v?(h=ct(n.prototype),g=n.apply(h,g),bt(g)?g:h):n.apply(h,g))};else{if(c){var h=[u];be.apply(h,e)}var v=c?Se.apply(n,h):Se.call(n,u)}return Ge(v,Le.call(arguments)),v}function ft(){X.h=$,X.b=X.c=X.g=X.i="",X.e="t",X.j=!0;for(var n,t=0;n=arguments[t];t++)for(var e in n)X[e]=n[e];t=X.a,X.d=/^[^,]+/.exec(t)[0],n=ne,t="return function("+t+"){",e=X;var r="var n,t="+e.d+",E="+e.e+";if(!t)return E;"+e.i+";";
e.b?(r+="var u=t.length;n=-1;if("+e.b+"){",We.unindexedChars&&(r+="if(s(t)){t=t.split('')}"),r+="while(++n<u){"+e.g+";}}else{"):We.nonEnumArgs&&(r+="var u=t.length;n=-1;if(u&&p(t)){while(++n<u){n+='';"+e.g+";}}else{"),We.enumPrototypes&&(r+="var G=typeof t=='function';"),We.enumErrorProps&&(r+="var F=t===k||t instanceof Error;");var u=[];if(We.enumPrototypes&&u.push('!(G&&n=="prototype")'),We.enumErrorProps&&u.push('!(F&&(n=="message"||n=="name"))'),e.j&&e.f)r+="var C=-1,D=B[typeof t]&&v(t),u=D?D.length:0;while(++C<u){n=D[C];",u.length&&(r+="if("+u.join("&&")+"){"),r+=e.g+";",u.length&&(r+="}"),r+="}";
else if(r+="for(n in t){",e.j&&u.push("m.call(t, n)"),u.length&&(r+="if("+u.join("&&")+"){"),r+=e.g+";",u.length&&(r+="}"),r+="}",We.nonEnumShadows){for(r+="if(t!==A){var i=t.constructor,r=t===(i&&i.prototype),f=t===J?I:t===k?j:L.call(t),x=y[f];",k=0;7>k;k++)r+="n='"+e.h[k]+"';if((!(r&&x[n])&&m.call(t,n))",e.j||(r+="||(!x[n]&&t[n]!==A[n])"),r+="){"+e.g+"}";r+="}"}return(e.b||We.nonEnumArgs)&&(r+="}"),r+=e.c+";return E",n("d,j,k,m,o,p,q,s,v,A,B,y,I,J,L",t+r+"}")(Z,K,le,de,_,vt,Je,jt,X.f,fe,Y,Ke,H,ce,ke)
}function ct(n){return bt(n)?Ie(n):{}}function pt(n){return Xe[n]}function st(){var t=(t=y.indexOf)===Lt?n:t;return t}function gt(n){var t,e;return!n||ke.call(n)!=J||(t=n.constructor,_t(t)&&!(t instanceof t))||!We.argsClass&&vt(n)||!We.nodeClass&&f(n)?!1:We.ownLast?(ur(n,function(n,t,r){return e=de.call(r,t),!1}),false!==e):(ur(n,function(n,t){e=t}),typeof e=="undefined"||de.call(n,e))}function ht(n){return Ye[n]}function vt(n){return n&&typeof n=="object"&&typeof n.length=="number"&&ke.call(n)==L||!1
}function yt(n,t,e){var r=He(n),u=r.length;for(t=Z(t,e,3);u--&&(e=r[u],false!==t(n[e],e,n)););return n}function mt(n){var t=[];return ur(n,function(n,e){_t(n)&&t.push(e)}),t.sort()}function dt(n){for(var t=-1,e=He(n),r=e.length,u={};++t<r;){var o=e[t];u[n[o]]=o}return u}function _t(n){return typeof n=="function"}function bt(n){return!(!n||!Y[typeof n])}function wt(n){return typeof n=="number"||ke.call(n)==G}function jt(n){return typeof n=="string"||ke.call(n)==H}function xt(n){for(var t=-1,e=He(n),r=e.length,u=Xt(r);++t<r;)u[t]=n[e[t]];
return u}function Ct(n,t,e){var r=-1,u=st(),o=n?n.length:0,a=!1;return e=(0>e?Pe(0,o+e):e)||0,Je(n)?a=-1<u(n,t,e):typeof o=="number"?a=-1<(jt(n)?n.indexOf(t,e):u(n,t,e)):tr(n,function(n){return++r<e?void 0:!(a=n===t)}),a}function kt(n,t,e){var r=!0;if(t=y.createCallback(t,e,3),Je(n)){e=-1;for(var u=n.length;++e<u&&(r=!!t(n[e],e,n)););}else tr(n,function(n,e,u){return r=!!t(n,e,u)});return r}function Et(n,t,e){var r=[];if(t=y.createCallback(t,e,3),Je(n)){e=-1;for(var u=n.length;++e<u;){var o=n[e];
t(o,e,n)&&r.push(o)}}else tr(n,function(n,e,u){t(n,e,u)&&r.push(n)});return r}function Ot(n,t,e){if(t=y.createCallback(t,e,3),!Je(n)){var r;return tr(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 St(n,t,e){if(t&&typeof e=="undefined"&&Je(n)){e=-1;for(var r=n.length;++e<r&&false!==t(n[e],e,n););}else tr(n,t,e);return n}function It(n,t,e){var r=n,u=n?n.length:0;if(t=t&&typeof e=="undefined"?t:Z(t,e,3),Je(n))for(;u--&&false!==t(n[u],u,n););else{if(typeof u!="number")var o=He(n),u=o.length;
else We.unindexedChars&&jt(n)&&(r=n.split(""));tr(n,function(n,e,a){return e=o?o[--u]:--u,t(r[e],e,a)})}return n}function At(n,t,e){var r=-1,u=n?n.length:0,o=Xt(typeof u=="number"?u:0);if(t=y.createCallback(t,e,3),Je(n))for(;++r<u;)o[r]=t(n[r],r,n);else tr(n,function(n,e,u){o[++r]=t(n,e,u)});return o}function Nt(n,t,e){var u=-1/0,o=u;if(!t&&Je(n)){e=-1;for(var a=n.length;++e<a;){var i=n[e];i>o&&(o=i)}}else t=!t&&jt(n)?r:y.createCallback(t,e,3),tr(n,function(n,e,r){e=t(n,e,r),e>u&&(u=e,o=n)});return o
}function Bt(n,t,e,r){var u=3>arguments.length;if(t=Z(t,r,4),Je(n)){var o=-1,a=n.length;for(u&&(e=n[++o]);++o<a;)e=t(e,n[o],o,n)}else tr(n,function(n,r,o){e=u?(u=!1,n):t(e,n,r,o)});return e}function Dt(n,t,e,r){var u=3>arguments.length;return t=Z(t,r,4),It(n,function(n,r,o){e=u?(u=!1,n):t(e,n,r,o)}),e}function Pt(n){var t=-1,e=n?n.length:0,r=Xt(typeof e=="number"?e:0);return St(n,function(n){var e=Vt(++t);r[t]=r[e],r[e]=n}),r}function Rt(n,t,e){var r;if(t=y.createCallback(t,e,3),Je(n)){e=-1;for(var u=n.length;++e<u&&!(r=t(n[e],e,n)););}else tr(n,function(n,e,u){return!(r=t(n,e,u))
});return!!r}function Ft(e){var r=-1,u=st(),a=e?e.length:0,i=tt(arguments,!0,!0,1),l=[],f=a>=w&&u===n;if(f){var c=o(i);c?(u=t,i=c):f=!1}for(;++r<a;)c=e[r],0>u(i,c)&&l.push(c);return f&&s(i),l}function $t(n,t,e){var r=0,u=n?n.length:0;if(typeof t!="number"&&null!=t){var o=-1;for(t=y.createCallback(t,e,3);++o<u&&t(n[o],o,n);)r++}else if(r=t,null==r||e)return n?n[0]:v;return g(n,0,Re(Pe(0,r),u))}function Lt(t,e,r){if(typeof r=="number"){var u=t?t.length:0;r=0>r?Pe(0,u+r):r||0}else if(r)return r=zt(t,e),t[r]===e?r:-1;
return n(t,e,r)}function Tt(n,t,e){if(typeof t!="number"&&null!=t){var r=0,u=-1,o=n?n.length:0;for(t=y.createCallback(t,e,3);++u<o&&t(n[u],u,n);)r++}else r=null==t||e?1:Pe(0,t);return g(n,r)}function zt(n,t,e,r){var u=0,o=n?n.length:u;for(e=e?y.createCallback(e,r,1):Ht,t=e(t);u<o;)r=u+o>>>1,e(n[r])<t?u=r+1:o=r;return u}function qt(n,t,e,r){return typeof t!="boolean"&&null!=t&&(e=(r=e)&&r[t]===n?null:t,t=!1),null!=e&&(e=y.createCallback(e,r,3)),at(n,t,e)}function Kt(){for(var n=1<arguments.length?arguments:arguments[0],t=-1,e=n?Nt(cr(n,"length")):0,r=Xt(0>e?0:e);++t<e;)r[t]=cr(n,t);
return r}function Wt(n,t){for(var e=-1,r=n?n.length:0,u={};++e<r;){var o=n[e];t?u[o]=t[e]:o&&(u[o[0]]=o[1])}return u}function Gt(n,t){return 2<arguments.length?lt(n,17,Le.call(arguments,2),null,t):lt(n,1,null,null,t)}function Jt(n,t,e){function r(){c&&he(c),a=c=p=v,(h||g!==t)&&(s=_e(),i=n.apply(f,o))}function u(){var e=t-(_e()-l);0<e?c=xe(u,e):(a&&he(a),e=p,a=c=p=v,e&&(s=_e(),i=n.apply(f,o)))}var o,a,i,l,f,c,p,s=0,g=!1,h=!0;if(!_t(n))throw new ae;if(t=Pe(0,t)||0,true===e)var y=!0,h=!1;else bt(e)&&(y=e.leading,g="maxWait"in e&&(Pe(t,e.maxWait)||0),h="trailing"in e?e.trailing:h);
return function(){if(o=arguments,l=_e(),f=this,p=h&&(c||!y),false===g)var e=y&&!c;else{a||y||(s=l);var v=g-(l-s);0<v?a||(a=xe(r,v)):(a&&(a=he(a)),s=l,i=n.apply(f,o))}return c||t===g||(c=xe(u,t)),e&&(i=n.apply(f,o)),i}}function Mt(n){if(!_t(n))throw new ae;var t=Le.call(arguments,1);return xe(function(){n.apply(v,t)},1)}function Ht(n){return n}function Ut(n,t){var e=n,r=!t||_t(e);t||(e=m,t=n,n=y),St(mt(t),function(u){var o=n[u]=t[u];r&&(e.prototype[u]=function(){var t=this.__wrapped__,r=[t];return be.apply(r,arguments),r=o.apply(n,r),t&&typeof t=="object"&&t===r?this:(r=new e(r),r.__chain__=this.__chain__,r)
})})}function Vt(n,t,e){var r=null==n,u=null==t;return null==e&&(typeof n=="boolean"&&u?(e=n,n=1):u||typeof t!="boolean"||(e=t,u=!0)),r&&u&&(t=1),n=+n||0,u?(t=n,n=0):t=+t||0,r=$e(),e||n%1||t%1?Re(n+r*(t-n+parseFloat("1e-"+((r+"").length-1))),t):n+ve(r*(t-n+1))}function Qt(){return this.__wrapped__}e=e?ot.defaults(nt.Object(),e,ot.pick(nt,F)):nt;var Xt=e.Array,Yt=e.Boolean,Zt=e.Date,ne=e.Function,te=e.Math,ee=e.Number,re=e.Object,ue=e.RegExp,oe=e.String,ae=e.TypeError,ie=[],le=e.Error.prototype,fe=re.prototype,ce=oe.prototype,pe=e._,se=ue("^"+oe(fe.valueOf).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),ge=te.ceil,he=e.clearTimeout,ve=te.floor,ye=ne.prototype.toString,me=se.test(me=re.getPrototypeOf)&&me,de=fe.hasOwnProperty,_e=se.test(_e=Zt.now)&&_e||function(){return+new Zt
},be=ie.push,we=fe.propertyIsEnumerable,je=e.setImmediate,xe=e.setTimeout,Ce=ie.splice,ke=fe.toString,Ee=ie.unshift,Oe=function(){try{var n={},t=se.test(t=re.defineProperty)&&t,e=t(n,n,n)&&t}catch(r){}return e}(),Se=se.test(Se=ke.bind)&&Se,Ie=se.test(Ie=re.create)&&Ie,Ae=se.test(Ae=Xt.isArray)&&Ae,Ne=e.isFinite,Be=e.isNaN,De=se.test(De=re.keys)&&De,Pe=te.max,Re=te.min,Fe=e.parseInt,$e=te.random,Le=ie.slice,Te=se.test(e.attachEvent),ze=Se&&!/\n|true/.test(Se+Te),qe={};qe[T]=Xt,qe[z]=Yt,qe[q]=Zt,qe[W]=ne,qe[J]=re,qe[G]=ee,qe[M]=ue,qe[H]=oe;
var Ke={};Ke[T]=Ke[q]=Ke[G]={constructor:!0,toLocaleString:!0,toString:!0,valueOf:!0},Ke[z]=Ke[H]={constructor:!0,toString:!0,valueOf:!0},Ke[K]=Ke[W]=Ke[M]={constructor:!0,toString:!0},Ke[J]={constructor:!0},function(){for(var n=$.length;n--;){var t,e=$[n];for(t in Ke)de.call(Ke,t)&&!de.call(Ke[t],e)&&(Ke[t][e]=!1)}}(),m.prototype=y.prototype;var We=y.support={};!function(){function n(){this.x=1}var t={0:1,length:1},r=[];n.prototype={valueOf:1};for(var u in new n)r.push(u);for(u in arguments);We.argsClass=ke.call(arguments)==L,We.argsObject=arguments.constructor==re&&!(arguments instanceof Xt),We.enumErrorProps=we.call(le,"message")||we.call(le,"name"),We.enumPrototypes=we.call(n,"prototype"),We.fastBind=Se&&!ze,We.funcDecomp=!se.test(e.p)&&P.test(h),We.funcNames=typeof ne.name=="string",We.nonEnumArgs=0!=u,We.nonEnumShadows=!/valueOf/.test(r),We.ownLast="x"!=r[0],We.spliceObjects=(ie.splice.call(t,0,1),!t[0]),We.unindexedChars="xx"!="x"[0]+re("x")[0];
try{We.nodeClass=!(ke.call(document)==J&&!({toString:0}+""))}catch(o){We.nodeClass=!0}}(1),y.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:N,variable:"",imports:{_:y}},Ie||(ct=function(n){if(bt(n)){c.prototype=n;var t=new c;c.prototype=null}return t||{}});var Ge=Oe?function(n,t){Q.value=t,Oe(n,"__bindData__",Q)}:c;We.argsClass||(vt=function(n){return n&&typeof n=="object"&&typeof n.length=="number"&&de.call(n,"callee")||!1});var Je=Ae||function(n){return n&&typeof n=="object"&&typeof n.length=="number"&&ke.call(n)==T||!1
},Me=ft({a:"z",e:"[]",i:"if(!(B[typeof z]))return E",g:"E.push(n)"}),He=De?function(n){return bt(n)?We.enumPrototypes&&typeof n=="function"||We.nonEnumArgs&&n.length&&vt(n)?Me(n):De(n):[]}:Me,Ue={a:"g,e,K",i:"e=e&&typeof K=='undefined'?e:d(e,K,3)",b:"typeof u=='number'",v:He,g:"if(e(t[n],n,g)===false)return E"},Ve={a:"z,H,l",i:"var a=arguments,b=0,c=typeof l=='number'?2:a.length;while(++b<c){t=a[b];if(t&&B[typeof t]){",v:He,g:"if(typeof E[n]=='undefined')E[n]=t[n]",c:"}}"},Qe={i:"if(!B[typeof t])return E;"+Ue.i,b:!1},Xe={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Ye=dt(Xe),Ze=ue("("+He(Ye).join("|")+")","g"),nr=ue("["+He(Xe).join("")+"]","g"),tr=ft(Ue),er=ft(Ve,{i:Ve.i.replace(";",";if(c>3&&typeof a[c-2]=='function'){var e=d(a[--c-1],a[c--],2)}else if(c>2&&typeof a[c-1]=='function'){e=a[--c]}"),g:"E[n]=e?e(E[n],t[n]):t[n]"}),rr=ft(Ve),ur=ft(Ue,Qe,{j:!1}),or=ft(Ue,Qe);
_t(/x/)&&(_t=function(n){return typeof n=="function"&&ke.call(n)==W});var ar=me?function(n){if(!n||ke.call(n)!=J||!We.argsClass&&vt(n))return!1;var t=n.valueOf,e=typeof t=="function"&&(e=me(t))&&me(e);return e?n==e||me(n)==e:gt(n)}:gt,ir=it(function(n,t,e){de.call(n,e)?n[e]++:n[e]=1}),lr=it(function(n,t,e){(de.call(n,e)?n[e]:n[e]=[]).push(t)}),fr=it(function(n,t,e){n[e]=t}),cr=At;ze&&rt&&typeof je=="function"&&(Mt=function(n){if(!_t(n))throw new ae;return je.apply(e,arguments)});var pr=8==Fe(x+"08")?Fe:function(n,t){return Fe(jt(n)?n.replace(B,""):n,t||0)
};return y.after=function(n,t){if(!_t(t))throw new ae;return function(){return 1>--n?t.apply(this,arguments):void 0}},y.assign=er,y.at=function(n){var t=arguments,e=-1,r=tt(t,!0,!1,1),t=t[2]&&t[2][t[1]]===n?1:r.length,u=Xt(t);for(We.unindexedChars&&jt(n)&&(n=n.split(""));++e<t;)u[e]=n[r[e]];return u},y.bind=Gt,y.bindAll=function(n){for(var t=1<arguments.length?tt(arguments,!0,!1,1):mt(n),e=-1,r=t.length;++e<r;){var u=t[e];n[u]=lt(n[u],1,null,null,n)}return n},y.bindKey=function(n,t){return 2<arguments.length?lt(t,19,Le.call(arguments,2),null,n):lt(t,3,null,null,n)
},y.chain=function(n){return n=new m(n),n.__chain__=!0,n},y.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},y.compose=function(){for(var n=arguments,t=n.length;t--;)if(!_t(n[t]))throw new ae;return function(){for(var t=arguments,e=n.length;e--;)t=[n[e].apply(this,t)];return t[0]}},y.countBy=ir,y.createCallback=function(n,t,e){var r=typeof n;if(null==n||"function"==r)return Z(n,t,e);if("object"!=r)return function(t){return t[n]};var u=He(n),o=u[0],a=n[o];
return 1!=u.length||a!==a||bt(a)?function(t){for(var e=u.length,r=!1;e--&&(r=et(t[u[e]],n[u[e]],null,!0)););return r}:function(n){return n=n[o],a===n&&(0!==a||1/a==1/n)}},y.curry=function(n,t){return t=typeof t=="number"?t:+t||n.length,lt(n,4,null,null,null,t)},y.debounce=Jt,y.defaults=rr,y.defer=Mt,y.delay=function(n,t){if(!_t(n))throw new ae;var e=Le.call(arguments,2);return xe(function(){n.apply(v,e)},t)},y.difference=Ft,y.filter=Et,y.flatten=function(n,t,e,r){return typeof t!="boolean"&&null!=t&&(e=(r=e)&&r[t]===n?null:t,t=!1),null!=e&&(n=At(n,e,r)),tt(n,t)
},y.forEach=St,y.forEachRight=It,y.forIn=ur,y.forInRight=function(n,t,e){var r=[];ur(n,function(n,t){r.push(t,n)});var u=r.length;for(t=Z(t,e,3);u--&&false!==t(r[u--],r[u],n););return n},y.forOwn=or,y.forOwnRight=yt,y.functions=mt,y.groupBy=lr,y.indexBy=fr,y.initial=function(n,t,e){var r=0,u=n?n.length:0;if(typeof t!="number"&&null!=t){var o=u;for(t=y.createCallback(t,e,3);o--&&t(n[o],o,n);)r++}else r=null==t||e?1:t||r;return g(n,0,Re(Pe(0,u-r),u))},y.intersection=function(e){for(var r=arguments,u=r.length,a=-1,l=i(),f=-1,c=st(),g=e?e.length:0,h=[],v=i();++a<u;){var y=r[a];
l[a]=c===n&&(y?y.length:0)>=w&&o(a?r[a]:v)}n:for(;++f<g;){var m=l[0],y=e[f];if(0>(m?t(m,y):c(v,y))){for(a=u,(m||v).push(y);--a;)if(m=l[a],0>(m?t(m,y):c(r[a],y)))continue n;h.push(y)}}for(;u--;)(m=l[u])&&s(m);return p(l),p(v),h},y.invert=dt,y.invoke=function(n,t){var e=Le.call(arguments,2),r=-1,u=typeof t=="function",o=n?n.length:0,a=Xt(typeof o=="number"?o:0);return St(n,function(n){a[++r]=(u?t:n[t]).apply(n,e)}),a},y.keys=He,y.map=At,y.max=Nt,y.memoize=function(n,t){function e(){var r=e.cache,u=t?t.apply(this,arguments):b+arguments[0];
return de.call(r,u)?r[u]:r[u]=n.apply(this,arguments)}if(!_t(n))throw new ae;return e.cache={},e},y.merge=function(n){var t=arguments,e=2;if(!bt(n))return n;if("number"!=typeof t[2]&&(e=t.length),3<e&&"function"==typeof t[e-2])var r=Z(t[--e-1],t[e--],2);else 2<e&&"function"==typeof t[e-1]&&(r=t[--e]);for(var t=Le.call(arguments,1,e),u=-1,o=i(),a=i();++u<e;)ut(n,t[u],r,o,a);return p(o),p(a),n},y.min=function(n,t,e){var u=1/0,o=u;if(!t&&Je(n)){e=-1;for(var a=n.length;++e<a;){var i=n[e];i<o&&(o=i)}}else t=!t&&jt(n)?r:y.createCallback(t,e,3),tr(n,function(n,e,r){e=t(n,e,r),e<u&&(u=e,o=n)
});return o},y.omit=function(n,t,e){var r=st(),u=typeof t=="function",o={};if(u)t=y.createCallback(t,e,3);else var a=tt(arguments,!0,!1,1);return ur(n,function(n,e,i){(u?!t(n,e,i):0>r(a,e))&&(o[e]=n)}),o},y.once=function(n){var t,e;if(!_t(n))throw new ae;return function(){return t?e:(t=!0,e=n.apply(this,arguments),n=null,e)}},y.pairs=function(n){for(var t=-1,e=He(n),r=e.length,u=Xt(r);++t<r;){var o=e[t];u[t]=[o,n[o]]}return u},y.partial=function(n){return lt(n,16,Le.call(arguments,1))},y.partialRight=function(n){return lt(n,32,null,Le.call(arguments,1))
},y.pick=function(n,t,e){var r={};if(typeof t!="function")for(var u=-1,o=tt(arguments,!0,!1,1),a=bt(n)?o.length:0;++u<a;){var i=o[u];i in n&&(r[i]=n[i])}else t=y.createCallback(t,e,3),ur(n,function(n,e,u){t(n,e,u)&&(r[e]=n)});return r},y.pluck=cr,y.pull=function(n){for(var t=arguments,e=0,r=t.length,u=n?n.length:0;++e<r;)for(var o=-1,a=t[e];++o<u;)n[o]===a&&(Ce.call(n,o--,1),u--);return n},y.range=function(n,t,e){n=+n||0,e=typeof e=="number"?e:+e||1,null==t&&(t=n,n=0);var r=-1;t=Pe(0,ge((t-n)/(e||1)));
for(var u=Xt(t);++r<t;)u[r]=n,n+=e;return u},y.reject=function(n,t,e){return t=y.createCallback(t,e,3),Et(n,function(n,e,r){return!t(n,e,r)})},y.remove=function(n,t,e){var r=-1,u=n?n.length:0,o=[];for(t=y.createCallback(t,e,3);++r<u;)e=n[r],t(e,r,n)&&(o.push(e),Ce.call(n,r--,1),u--);return o},y.rest=Tt,y.shuffle=Pt,y.sortBy=function(n,t,e){var r=-1,o=n?n.length:0,a=Xt(typeof o=="number"?o:0);for(t=y.createCallback(t,e,3),St(n,function(n,e,u){var o=a[++r]=l();o.m=t(n,e,u),o.n=r,o.o=n}),o=a.length,a.sort(u);o--;)n=a[o],a[o]=n.o,s(n);
return a},y.tap=function(n,t){return t(n),n},y.throttle=function(n,t,e){var r=!0,u=!0;if(!_t(n))throw new ae;return false===e?r=!1:bt(e)&&(r="leading"in e?e.leading:r,u="trailing"in e?e.trailing:u),V.leading=r,V.maxWait=t,V.trailing=u,Jt(n,t,V)},y.times=function(n,t,e){n=-1<(n=+n)?n:0;var r=-1,u=Xt(n);for(t=Z(t,e,1);++r<n;)u[r]=t(r);return u},y.toArray=function(n){return n&&typeof n.length=="number"?We.unindexedChars&&jt(n)?n.split(""):g(n):xt(n)},y.transform=function(n,t,e,r){var u=Je(n);return t=Z(t,r,4),null==e&&(u?e=[]:(r=n&&n.constructor,e=ct(r&&r.prototype))),(u?tr:or)(n,function(n,r,u){return t(e,n,r,u)
}),e},y.union=function(){return at(tt(arguments,!0,!0))},y.uniq=qt,y.values=xt,y.where=Et,y.without=function(n){return Ft(n,Le.call(arguments,1))},y.wrap=function(n,t){if(!_t(t))throw new ae;return function(){var e=[n];return be.apply(e,arguments),t.apply(this,e)}},y.zip=Kt,y.zipObject=Wt,y.collect=At,y.drop=Tt,y.each=St,y.q=It,y.extend=er,y.methods=mt,y.object=Wt,y.select=Et,y.tail=Tt,y.unique=qt,y.unzip=Kt,Ut(y),y.clone=function(n,t,e,r){return typeof t!="boolean"&&null!=t&&(r=e,e=t,t=!1),j(n,t,typeof e=="function"&&Z(e,r,1))
},y.cloneDeep=function(n,t,e){return j(n,!0,typeof t=="function"&&Z(t,e,1))},y.contains=Ct,y.escape=function(n){return null==n?"":oe(n).replace(nr,pt)},y.every=kt,y.find=Ot,y.findIndex=function(n,t,e){var r=-1,u=n?n.length:0;for(t=y.createCallback(t,e,3);++r<u;)if(t(n[r],r,n))return r;return-1},y.findKey=function(n,t,e){var r;return t=y.createCallback(t,e,3),or(n,function(n,e,u){return t(n,e,u)?(r=e,!1):void 0}),r},y.findLast=function(n,t,e){var r;return t=y.createCallback(t,e,3),It(n,function(n,e,u){return t(n,e,u)?(r=n,!1):void 0
}),r},y.findLastIndex=function(n,t,e){var r=n?n.length:0;for(t=y.createCallback(t,e,3);r--;)if(t(n[r],r,n))return r;return-1},y.findLastKey=function(n,t,e){var r;return t=y.createCallback(t,e,3),yt(n,function(n,e,u){return t(n,e,u)?(r=e,!1):void 0}),r},y.has=function(n,t){return n?de.call(n,t):!1},y.identity=Ht,y.indexOf=Lt,y.isArguments=vt,y.isArray=Je,y.isBoolean=function(n){return true===n||false===n||ke.call(n)==z},y.isDate=function(n){return n?typeof n=="object"&&ke.call(n)==q:!1},y.isElement=function(n){return n?1===n.nodeType:!1
},y.isEmpty=function(n){var t=!0;if(!n)return t;var e=ke.call(n),r=n.length;return e==T||e==H||(We.argsClass?e==L:vt(n))||e==J&&typeof r=="number"&&_t(n.splice)?!r:(or(n,function(){return t=!1}),t)},y.isEqual=function(n,t,e,r){return et(n,t,typeof e=="function"&&Z(e,r,2))},y.isFinite=function(n){return Ne(n)&&!Be(parseFloat(n))},y.isFunction=_t,y.isNaN=function(n){return wt(n)&&n!=+n},y.isNull=function(n){return null===n},y.isNumber=wt,y.isObject=bt,y.isPlainObject=ar,y.isRegExp=function(n){return n&&Y[typeof n]?ke.call(n)==M:!1
},y.isString=jt,y.isUndefined=function(n){return typeof n=="undefined"},y.lastIndexOf=function(n,t,e){var r=n?n.length:0;for(typeof e=="number"&&(r=(0>e?Pe(0,r+e):Re(e,r-1))+1);r--;)if(n[r]===t)return r;return-1},y.mixin=Ut,y.noConflict=function(){return e._=pe,this},y.parseInt=pr,y.random=Vt,y.reduce=Bt,y.reduceRight=Dt,y.result=function(n,t){if(n){var e=n[t];return _t(e)?n[t]():e}},y.runInContext=h,y.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:He(n).length},y.some=Rt,y.sortedIndex=zt,y.template=function(n,t,e){var r=y.templateSettings;
n||(n=""),e=rr({},e,r);var u,o=rr({},e.imports,r.imports),r=He(o),o=xt(o),i=0,l=e.interpolate||D,f="__p+='",l=ue((e.escape||D).source+"|"+l.source+"|"+(l===N?S:D).source+"|"+(e.evaluate||D).source+"|$","g");n.replace(l,function(t,e,r,o,l,c){return r||(r=o),f+=n.slice(i,c).replace(R,a),e&&(f+="'+__e("+e+")+'"),l&&(u=!0,f+="';"+l+";__p+='"),r&&(f+="'+((__t=("+r+"))==null?'':__t)+'"),i=c+t.length,t}),f+="';\n",l=e=e.variable,l||(e="obj",f="with("+e+"){"+f+"}"),f=(u?f.replace(C,""):f).replace(E,"$1").replace(O,"$1;"),f="function("+e+"){"+(l?"":e+"||("+e+"={});")+"var __t,__p='',__e=_.escape"+(u?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+f+"return __p}";
try{var c=ne(r,"return "+f).apply(v,o)}catch(p){throw p.source=f,p}return t?c(t):(c.source=f,c)},y.unescape=function(n){return null==n?"":oe(n).replace(Ze,ht)},y.uniqueId=function(n){var t=++d;return oe(null==n?"":n)+t},y.all=kt,y.any=Rt,y.detect=Ot,y.findWhere=Ot,y.foldl=Bt,y.foldr=Dt,y.include=Ct,y.inject=Bt,or(y,function(n,t){y.prototype[t]||(y.prototype[t]=function(){var t=[this.__wrapped__],e=this.__chain__;return be.apply(t,arguments),t=n.apply(y,t),e?new m(t,e):t})}),y.first=$t,y.last=function(n,t,e){var r=0,u=n?n.length:0;
if(typeof t!="number"&&null!=t){var o=u;for(t=y.createCallback(t,e,3);o--&&t(n[o],o,n);)r++}else if(r=t,null==r||e)return n?n[u-1]:v;return g(n,Pe(0,u-r))},y.sample=function(n,t,e){var r=n?n.length:0;return typeof r!="number"?n=xt(n):We.unindexedChars&&jt(n)&&(n=n.split("")),null==t||e?n?n[Vt(r-1)]:v:(n=Pt(n),n.length=Re(Pe(0,t),n.length),n)},y.take=$t,y.head=$t,or(y,function(n,t){var e="sample"!==t;y.prototype[t]||(y.prototype[t]=function(t,r){var u=this.__chain__,o=n(this.__wrapped__,t,r);return u||null!=t&&(!r||e&&typeof t=="function")?new m(o,u):o
})}),y.VERSION="2.2.1",y.prototype.chain=function(){return this.__chain__=!0,this},y.prototype.toString=function(){return oe(this.__wrapped__)},y.prototype.value=Qt,y.prototype.valueOf=Qt,tr(["join","pop","shift"],function(n){var t=ie[n];y.prototype[n]=function(){var n=this.__chain__,e=t.apply(this.__wrapped__,arguments);return n?new m(e,n):e}}),tr(["push","reverse","sort","unshift"],function(n){var t=ie[n];y.prototype[n]=function(){return t.apply(this.__wrapped__,arguments),this}}),tr(["concat","slice","splice"],function(n){var t=ie[n];
y.prototype[n]=function(){return new m(t.apply(this.__wrapped__,arguments),this.__chain__)}}),We.spliceObjects||tr(["pop","shift","splice"],function(n){var t=ie[n],e="splice"==n;y.prototype[n]=function(){var n=this.__chain__,r=this.__wrapped__,u=t.apply(r,arguments);return 0===r.length&&delete r[0],n||e?new m(u,n):u}}),y}var v,y=[],m=[],d=0,_={},b=+new Date+"",w=75,j=40,x=" \t\x0B\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000",C=/\b__p\+='';/g,E=/\b(__p\+=)''\+/g,O=/(__e\(.*?\)|\b__t\))\+'';/g,S=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,I=/\w*$/,A=/^function[ \n\r\t]+\w/,N=/<%=([\s\S]+?)%>/g,B=RegExp("^["+x+"]*0+(?=.$)"),D=/($^)/,P=/\bthis\b/,R=/['\n\r\t\u2028\u2029\\]/g,F="Array Boolean Date Error Function Math Number Object RegExp String _ attachEvent clearTimeout isFinite isNaN parseInt setImmediate setTimeout".split(" "),$="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),L="[object Arguments]",T="[object Array]",z="[object Boolean]",q="[object Date]",K="[object Error]",W="[object Function]",G="[object Number]",J="[object Object]",M="[object RegExp]",H="[object String]",U={};
U[W]=!1,U[L]=U[T]=U[z]=U[q]=U[G]=U[J]=U[M]=U[H]=!0;var V={leading:!1,maxWait:0,trailing:!1},Q={configurable:!1,enumerable:!1,value:null,writable:!1},X={a:"",b:null,c:"",d:"",e:"",v:null,g:"",h:null,support:null,i:"",j:!1},Y={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},Z={"\\":"\\","'":"'","\n":"n","\r":"r","\t":"t","\u2028":"u2028","\u2029":"u2029"},nt=Y[typeof window]&&window||this,tt=Y[typeof exports]&&exports&&!exports.nodeType&&exports,et=Y[typeof module]&&module&&!module.nodeType&&module,rt=et&&et.exports===tt&&tt,ut=Y[typeof global]&&global;
!ut||ut.global!==ut&&ut.window!==ut||(nt=ut);var ot=h();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(nt._=ot, define(function(){return ot})):tt&&et?rt?(et.exports=ot)._=ot:tt._=ot:nt._=ot}).call(this);
;(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
}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+="}";
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)
}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);
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);
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);
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);
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
}),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]);
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)
}),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];
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)
});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;
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);
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;
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);
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={};
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];
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
});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);
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);
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]
}},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)
}: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={};
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]=[];
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;
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];
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;
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)
}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];
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;
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;
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;
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;
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}";
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;
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)
}}),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;
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={};
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);

4475
dist/lodash.js vendored

File diff suppressed because it is too large Load Diff

88
dist/lodash.min.js vendored
View File

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

File diff suppressed because it is too large Load Diff

View File

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

File diff suppressed because it is too large Load Diff

View File

@@ -1,38 +1,36 @@
<?php
// cleanup requested file path
$filePath = isset($_GET['f']) ? $_GET['f'] : 'lodash';
$filePath = preg_replace('#(\.*[\/])+#', '', $filePath);
$filePath .= preg_match('/\.[a-z]+$/', $filePath) ? '' : '.js';
// cleanup requested filepath
$file = isset($_GET['f']) ? $_GET['f'] : 'lodash';
$file = preg_replace('#(\.*[\/])+#', '', $file);
$file .= preg_match('/\.[a-z]+$/', $file) ? '' : '.js';
// output filename
if (isset($_GET['o'])) {
$outputName = $_GET['o'];
$output = $_GET['o'];
} else if (isset($_SERVER['argv'][1])) {
$outputName = $_SERVER['argv'][1];
$output = $_SERVER['argv'][1];
} else {
$outputName = basename($filePath);
$output = basename($file);
}
/*--------------------------------------------------------------------------*/
require('../vendor/docdown/docdown.php');
// get package version
$version = json_decode(file_get_contents('../package.json'))->version;
// generate Markdown
$markdown = docdown(array(
'path' => '../' . $filePath,
'title' => 'Lo-Dash <span>v' . $version . '</span>',
'path' => '../' . $file,
'title' => 'Lo-Dash <sup>v1.1.1</sup>',
'toc' => 'categories',
'url' => 'https://github.com/lodash/lodash/blob/' . $version . '/lodash.js'
'url' => 'https://github.com/lodash/lodash/blob/1.1.1/lodash.js'
));
// save to a `.md` file
file_put_contents($outputName . '.md', $markdown);
// save to a .md file
file_put_contents($output . '.md', $markdown);
// print
header('Content-Type: text/plain;charset=utf-8');
echo $markdown . PHP_EOL;
?>

View File

@@ -1 +1 @@
module.exports = require('./dist/lodash.compat.js');
module.exports = require('./lodash');

4658
lodash.js

File diff suppressed because it is too large Load Diff

View File

@@ -1,62 +1,52 @@
{
"name": "lodash",
"version": "2.2.1",
"description": "A utility library delivering consistency, customization, performance, & extras.",
"homepage": "http://lodash.com/",
"license": "MIT",
"main": "dist/lodash.js",
"keywords": ["amd", "browser", "client", "customize", "functional", "server", "util"],
"author": "John-David Dalton <john.david.dalton@gmail.com> (http://allyoucanleet.com/)",
"contributors": [
"John-David Dalton <john.david.dalton@gmail.com> (http://allyoucanleet.com/)",
"Blaine Bublitz <blaine@iceddev.com> (http://iceddev.com/)",
"Kit Cambridge <github@kitcambridge.be> (http://kitcambridge.be/)",
"Mathias Bynens <mathias@qiwi.be> (http://mathiasbynens.be/)"
"version": "1.1.1",
"description": "A low-level utility library delivering consistency, customization, performance, and extra features.",
"homepage": "http://lodash.com",
"main": "./dist/lodash",
"keywords": [
"browser",
"client",
"functional",
"performance",
"server",
"speed",
"util"
],
"bugs": "https://github.com/lodash/lodash/issues",
"repository": { "type": "git", "url": "https://github.com/lodash/lodash.git" },
"engines": ["node", "rhino"],
"files": [
"LICENSE.txt",
"lodash.js",
"dist/lodash.js",
"dist/lodash.min.js",
"dist/lodash.compat.js",
"dist/lodash.compat.min.js",
"dist/lodash.underscore.js",
"dist/lodash.underscore.min.js"
"licenses": [
{
"type": "MIT",
"url": "http://lodash.com/license"
}
],
"author": {
"name": "John-David Dalton",
"email": "john.david.dalton@gmail.com",
"web": "http://allyoucanleet.com/"
},
"bugs": {
"url": "https://github.com/bestiejs/lodash/issues"
},
"repository": {
"type": "git",
"url": "https://github.com/bestiejs/lodash.git"
},
"bin": {
"lodash": "./build.js"
},
"directories": {
"doc": "./doc",
"test": "./test"
},
"engines": [
"node",
"rhino"
],
"jam": {
"main": "dist/lodash.compat.js",
"include": [
"LICENSE.txt",
"dist/lodash.js",
"dist/lodash.min.js",
"dist/lodash.compat.js",
"dist/lodash.compat.min.js",
"dist/lodash.underscore.js",
"dist/lodash.underscore.min.js"
]
"main": "./lodash.js"
},
"volo": {
"type": "directory",
"ignore": [
".*",
"*.custom.*",
"*.min.*",
"*.template.*",
"*.map",
"*.md",
"lodash.js",
"index.js",
"bower.json",
"component.json",
"doc",
"modularize",
"node_modules",
"perf",
"test",
"vendor"
]
"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

@@ -1,172 +0,0 @@
;(function(window) {
'use strict';
/** The base path of the builds */
var basePath = '../';
/** The Lo-Dash build to load */
var build = (build = /build=([^&]+)/.exec(location.search)) && decodeURIComponent(build[1]);
/** The other library to load */
var other = (other = /other=([^&]+)/.exec(location.search)) && decodeURIComponent(other[1]);
/** The `ui` object */
var ui = {};
/*--------------------------------------------------------------------------*/
/**
* Registers an event listener on an element.
*
* @private
* @param {Element} element The element.
* @param {string} eventName The name of the event.
* @param {Function} handler The event handler.
* @returns {Element} The element.
*/
function addListener(element, eventName, handler) {
if (typeof element.addEventListener != 'undefined') {
element.addEventListener(eventName, handler, false);
} else if (typeof element.attachEvent != 'undefined') {
element.attachEvent('on' + eventName, handler);
}
}
/*--------------------------------------------------------------------------*/
// expose `ui.urlParams` properties
ui.urlParams = {
'build': build,
'other': other
};
// expose Lo-Dash build file path
ui.buildPath = (function() {
var result;
switch (build) {
case 'lodash-compat': result = 'dist/lodash.compat.min.js'; break;
case 'lodash-legacy': result = 'dist/lodash.legacy.min.js'; break;
case 'lodash-mobile': result = 'dist/lodash.mobile.min.js'; break;
case 'lodash-underscore': result = 'dist/lodash.underscore.min.js'; break;
case 'lodash-custom-dev': result = 'lodash.custom.js'; break;
case 'lodash-custom': result = 'lodash.custom.min.js'; break;
case 'lodash-modern':
case null: result = 'dist/lodash.min.js'; break;
default: return build;
}
return basePath + result;
}());
// expose other library file path
ui.otherPath = (function() {
var result;
switch (other) {
case 'lodash-compat': result = 'dist/lodash.compat.min.js'; break;
case 'lodash-legacy': result = 'dist/lodash.legacy.min.js'; break;
case 'lodash-mobile': result = 'dist/lodash.mobile.min.js'; break;
case 'lodash-modern': result = 'dist/lodash.min.js'; break;
case 'lodash-underscore': result = 'dist/lodash.underscore.min.js'; break;
case 'lodash-custom-dev': result = 'lodash.custom.js'; break;
case 'lodash-custom': result = 'lodash.custom.min.js'; break;
case 'underscore-dev': result = 'vendor/underscore/underscore.js'; break;
case 'underscore':
case null: result = 'vendor/underscore/underscore-min.js'; break;
default: return other;
}
return basePath + result;
}());
// initialize controls
addListener(window, 'load', function() {
function eventHandler(event) {
var buildIndex = buildList.selectedIndex,
otherIndex = otherList.selectedIndex,
search = location.search.replace(/^\?|&?(?:build|other)=[^&]*&?/g, '');
if (event.stopPropagation) {
event.stopPropagation();
} else {
event.cancelBubble = true;
}
location.href =
location.href.split('?')[0] + '?' +
(search ? search + '&' : '') +
'build=' + (buildIndex < 0 ? build : buildList[buildIndex].value) + '&' +
'other=' + (otherIndex < 0 ? other : otherList[otherIndex].value);
}
var span1 = document.createElement('span');
span1.style.cssText = 'float:right';
span1.innerHTML =
'<label for="perf-build">Build: </label>' +
'<select id="perf-build">' +
'<option value="lodash-compat">Lo-Dash (compat)</option>' +
'<option value="lodash-legacy">Lo-Dash (legacy)</option>' +
'<option value="lodash-mobile">Lo-Dash (mobile)</option>' +
'<option value="lodash-modern">Lo-Dash (modern)</option>' +
'<option value="lodash-underscore">Lo-Dash (underscore)</option>' +
'<option value="lodash-custom-dev">Lo-Dash (custom development)</option>' +
'<option value="lodash-custom">Lo-Dash (custom production)</option>' +
'</select>';
var span2 = document.createElement('span');
span2.style.cssText = 'float:right';
span2.innerHTML =
'<label for="perf-other">Other Library: </label>' +
'<select id="perf-other">' +
'<option value="underscore-dev">Underscore (development)</option>' +
'<option value="underscore">Underscore (production)</option>' +
'<option value="lodash-compat">Lo-Dash (compat)</option>' +
'<option value="lodash-legacy">Lo-Dash (legacy)</option>' +
'<option value="lodash-mobile">Lo-Dash (mobile)</option>' +
'<option value="lodash-modern">Lo-Dash (modern)</option>' +
'<option value="lodash-underscore">Lo-Dash (underscore)</option>' +
'<option value="lodash-custom-dev">Lo-Dash (custom development)</option>' +
'<option value="lodash-custom">Lo-Dash (custom production)</option>' +
'</select>';
var buildList = span1.lastChild,
otherList = span2.lastChild,
toolbar = document.getElementById('perf-toolbar');
toolbar.appendChild(span2);
toolbar.appendChild(span1);
buildList.selectedIndex = (function() {
switch (build) {
case 'lodash-compat': return 0;
case 'lodash-legacy': return 1;
case 'lodash-mobile': return 2;
case 'lodash-underscore': return 4;
case 'lodash-custom-dev': return 5;
case 'lodash-custom': return 6;
case 'lodash-modern':
case null: return 3;
}
return -1;
}());
otherList.selectedIndex = (function() {
switch (other) {
case 'underscore-dev': return 0;
case 'lodash-compat': return 2;
case 'lodash-legacy': return 3;
case 'lodash-mobile': return 4;
case 'lodash-modern': return 5;
case 'lodash-underscore': return 6;
case 'lodash-custom-dev': return 7;
case 'lodash-custom': return 8;
case 'underscore':
case null: return 1;
}
return -1;
}());
addListener(buildList, 'change', eventHandler);
addListener(otherList, 'change', eventHandler);
});
// expose `ui`
window.ui = ui;
}(this));

View File

@@ -34,13 +34,13 @@
<script src="../vendor/firebug-lite/src/firebug-lite-debug.js"></script>
<script src="perf-ui.js"></script>
<script>
document.write('<script src="' + ui.buildPath + '"><\/script>');
document.write('<script src="../' + ui.buildPath + '"><\/script>');
</script>
<script>
var lodash = _.noConflict();
</script>
<script>
document.write('<script src="' + ui.otherPath + '"><\/script>');
document.write('<script src="../' + ui.otherPath + '"><\/script>');
</script>
<script src="perf.js"></script>
<script>

136
perf/perf-ui.js Normal file
View File

@@ -0,0 +1,136 @@
;(function(window) {
'use strict';
/** The Lo-Dash build to load */
var build = (/build=([^&]+)/.exec(location.search) || [])[1];
/** The other library to load */
var other = (/other=([^&]+)/.exec(location.search) || [])[1];
/** The `ui` object */
var ui = {};
/*--------------------------------------------------------------------------*/
/**
* Registers an event listener on an element.
*
* @private
* @param {Element} element The element.
* @param {String} eventName The name of the event.
* @param {Function} handler The event handler.
* @returns {Element} The element.
*/
function addListener(element, eventName, handler) {
if (typeof element.addEventListener != 'undefined') {
element.addEventListener(eventName, handler, false);
} else if (typeof element.attachEvent != 'undefined') {
element.attachEvent('on' + eventName, handler);
}
}
/*--------------------------------------------------------------------------*/
// expose Lo-Dash build file path
ui.buildPath = (function() {
switch (build) {
case 'lodash-dev': return 'dist/lodash.compat.js';
case 'lodash-modern': return 'dist/lodash.min.js';
case 'lodash-underscore': return 'dist/lodash.underscore.min.js';
case 'lodash-custom': return 'lodash.custom.min.js';
}
return 'dist/lodash.compat.min.js';
}());
// expose other library file path
ui.otherPath = (function() {
switch (other) {
case 'lodash-dev': return 'dist/lodash.compat.js';
case 'lodash-prod': return 'dist/lodash.compat.min.js';
case 'lodash-modern': return 'dist/lodash.min.js';
case 'lodash-underscore': return 'dist/lodash.underscore.min.js';
case 'lodash-custom': return 'lodash.custom.min.js';
case 'underscore-dev': return 'vendor/underscore/underscore.js';
}
return 'vendor/underscore/underscore-min.js';
}());
// initialize controls
addListener(window, 'load', function() {
function eventHandler(event) {
var search = location.search.replace(/^\?|&?(?:build|other)=[^&]*&?/g, '');
if (event.stopPropagation) {
event.stopPropagation();
} else {
event.cancelBubble = true;
}
location.href =
location.href.split('?')[0] + '?' +
(search ? search + '&' : '') +
'build=' + buildList[buildList.selectedIndex].value + '&' +
'other=' + otherList[otherList.selectedIndex].value;
}
var span1 = document.createElement('span');
span1.style.cssText = 'float:right';
span1.innerHTML =
'<label for="perf-build">Build: </label>' +
'<select id="perf-build">' +
'<option value="lodash-dev">Lo-Dash</option>' +
'<option value="lodash-prod">Lo-Dash (minified)</option>' +
'<option value="lodash-modern">Lo-Dash (modern)</option>' +
'<option value="lodash-underscore">Lo-Dash (underscore)</option>' +
'<option value="lodash-custom">Lo-Dash (custom)</option>' +
'</select>';
var span2 = document.createElement('span');
span2.style.cssText = 'float:right';
span2.innerHTML =
'<label for="perf-other">Other Library: </label>' +
'<select id="perf-other">' +
'<option value="underscore-dev">Underscore</option>' +
'<option value="underscore-prod">Underscore (minified)</option>' +
'<option value="lodash-dev">Lo-Dash</option>' +
'<option value="lodash-prod">Lo-Dash (minified)</option>' +
'<option value="lodash-modern">Lo-Dash (modern)</option>' +
'<option value="lodash-underscore">Lo-Dash (underscore)</option>' +
'<option value="lodash-custom">Lo-Dash (custom)</option>' +
'</select>';
var buildList = span1.lastChild,
otherList = span2.lastChild,
toolbar = document.getElementById('perf-toolbar');
toolbar.appendChild(span2);
toolbar.appendChild(span1);
buildList.selectedIndex = (function() {
switch (build) {
case 'lodash-dev': return 0;
case 'lodash-modern': return 2;
case 'lodash-underscore': return 3;
case 'lodash-custom': return 4;
}
return 1;
}());
otherList.selectedIndex = (function() {
switch (other) {
case 'underscore-dev': return 0;
case 'lodash-dev': return 2;
case 'lodash-prod': return 3;
case 'lodash-modern': return 4;
case 'lodash-underscore': return 5;
case 'lodash-custom': return 6;
}
return 1;
}());
addListener(buildList, 'change', eventHandler);
addListener(otherList, 'change', eventHandler);
});
// expose `ui`
window.ui = ui;
}(this));

View File

@@ -58,7 +58,7 @@
var reSpecialChars = /[.*+?^=!:${}()|[\]\/\\]/g;
/** Used to score performance */
var score = { 'a': [], 'b': [] };
var score = { 'a': 0, 'b': 0 };
/** Used to queue benchmark suites */
var suites = [];
@@ -67,19 +67,16 @@
var toString = Object.prototype.toString;
/** The `ui` object */
var ui = window.ui || (window.ui = {
var ui = window.ui || ({
'buildPath': basename(filePath, '.js'),
'otherPath': 'underscore'
});
/** The Lo-Dash build basename */
var buildName = window.buildName = basename(ui.buildPath, '.js');
var buildName = basename(ui.buildPath, '.js');
/** The other library basename */
var otherName = window.otherName = (function() {
var result = basename(ui.otherPath, '.js');
return result + (result == buildName ? ' (2)' : '');
}());
var otherName = basename(ui.otherPath, '.js');
/** Detect if in a browser environment */
var isBrowser = isHostType(window, 'document') && isHostType(window, 'navigator');
@@ -97,9 +94,9 @@
* it will be removed from the basename.
*
* @private
* @param {string} path The file path to inspect.
* @param {string} extension The extension to remove.
* @returns {string} Returns the basename.
* @param {String} path The file path to inspect.
* @param {String} extension The extension to remove.
* @returns {String} Returns the basename.
*/
function basename(filePath, extension) {
var result = (filePath || '').split(rePathSeparator).pop();
@@ -108,27 +105,13 @@
: result.replace(RegExp(extension.replace(reSpecialChars, '\\$&') + '$'), '');
}
/**
* Computes the geometric mean (log-average) of an array of values.
* See http://en.wikipedia.org/wiki/Geometric_mean#Relationship_with_arithmetic_mean_of_logarithms.
*
* @private
* @param {Array} array The array of values.
* @returns {number} The geometric mean.
*/
function getGeometricMean(array) {
return Math.pow(Math.E, lodash.reduce(array, function(sum, x) {
return sum + Math.log(x);
}, 0) / array.length) || 0;
}
/**
* Gets the Hz, i.e. operations per second, of `bench` adjusted for the
* margin of error.
*
* @private
* @param {Object} bench The benchmark object.
* @returns {number} Returns the adjusted Hz.
* @returns {Number} Returns the adjusted Hz.
*/
function getHz(bench) {
var result = 1 / (bench.stats.mean + bench.stats.moe);
@@ -141,9 +124,9 @@
* types of "object", "function", or "unknown".
*
* @private
* @param {*} object The owner of the property.
* @param {string} property The property to check.
* @returns {boolean} Returns `true` if the property value is a non-primitive, else `false`.
* @param {Mixed} object The owner of the property.
* @param {String} property The property to check.
* @returns {Boolean} Returns `true` if the property value is a non-primitive, else `false`.
*/
function isHostType(object, property) {
if (object == null) {
@@ -157,7 +140,7 @@
* Logs text to the console.
*
* @private
* @param {string} text The text to log.
* @param {String} text The text to log.
*/
function log(text) {
console.log(text + '');
@@ -191,41 +174,31 @@
log(event.target);
},
'onComplete': function() {
for (var index = 0, length = this.length; index < length; index++) {
var bench = this[index];
if (bench.error) {
var errored = true;
}
}
if (errored) {
log('There was a problem, skipping...');
var formatNumber = Benchmark.formatNumber,
fastest = this.filter('fastest'),
fastestHz = getHz(fastest[0]),
slowest = this.filter('slowest'),
slowestHz = getHz(slowest[0]),
aHz = getHz(this[0]),
bHz = getHz(this[1]);
if (fastest.length > 1) {
log('It\'s too close to call.');
aHz = bHz = slowestHz;
}
else {
var formatNumber = Benchmark.formatNumber,
fastest = this.filter('fastest'),
fastestHz = getHz(fastest[0]),
slowest = this.filter('slowest'),
slowestHz = getHz(slowest[0]),
aHz = getHz(this[0]),
bHz = getHz(this[1]);
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(
fastest[0].name + ' is ' +
formatNumber(percent < 1 ? percent.toFixed(2) : Math.round(percent)) +
'% faster.'
);
}
// add score adjusted for margin of error
score.a.push(aHz);
score.b.push(bHz);
log(
fastest[0].name + ' is ' +
formatNumber(percent < 1 ? percent.toFixed(2) : Math.round(percent)) +
'% faster.'
);
}
// add score adjusted for margin of error
score.a += aHz;
score.b += bHz;
// remove current suite from queue
suites.shift();
@@ -234,16 +207,14 @@
suites[0].run({ 'async': !isJava });
}
else {
var aMeanHz = getGeometricMean(score.a),
bMeanHz = getGeometricMean(score.b),
fastestMeanHz = Math.max(aMeanHz, bMeanHz),
slowestMeanHz = Math.min(aMeanHz, bMeanHz),
xFaster = fastestMeanHz / slowestMeanHz,
percentFaster = formatNumber(Math.round((xFaster - 1) * 100)),
message = 'is ' + percentFaster + '% ' + (xFaster == 1 ? '' : '(' + formatNumber(xFaster.toFixed(2)) + 'x) ') + 'faster than';
var fastestTotalHz = Math.max(score.a, score.b),
slowestTotalHz = Math.min(score.a, score.b),
totalPercent = formatNumber(Math.round(((fastestTotalHz / slowestTotalHz) - 1) * 100)),
totalX = fastestTotalHz / slowestTotalHz,
message = 'is ' + totalPercent + '% ' + (totalX == 1 ? '' : '(' + formatNumber(totalX.toFixed(2)) + 'x) ') + 'faster than';
// report results
if (aMeanHz >= bMeanHz) {
if (score.a >= score.b) {
log('\n' + buildName + ' ' + message + ' ' + otherName + '.');
} else {
log('\n' + otherName + ' ' + message + ' ' + buildName + '.');
@@ -259,7 +230,7 @@
'setup': '\
var _ = window._,\
lodash = window.lodash,\
belt = this.name == buildName ? lodash : _;\
belt = this.name == "Lo-Dash" ? lodash : _;\
\
var index,\
date = new Date,\
@@ -270,7 +241,6 @@
numbers = Array(limit),\
fourNumbers = [5, 25, 10, 30],\
nestedNumbers = [1, [2], [3, [[4]]]],\
nestedObjects = [{}, [{}], [{}, [[{}]]]],\
twoNumbers = [12, 23];\
\
for (index = 0; index < limit; index++) {\
@@ -288,31 +258,20 @@
};\
\
var _boundNormal = _.bind(func, thisArg),\
_boundMultiple = _boundNormal,\
_boundPartial = _.bind(func, thisArg, "hi");\
\
var lodashBoundNormal = lodash.bind(func, thisArg),\
lodashBoundMultiple = lodashBoundNormal,\
lodashBoundPartial = lodash.bind(func, thisArg, "hi");\
\
for (index = 0; index < 10; index++) {\
_boundMultiple = _.bind(_boundMultiple, { "name": "moe" + index });\
lodashBoundMultiple = lodash.bind(lodashBoundMultiple, { "name": "moe" + index });\
}\
}\
\
if (typeof bindAll != "undefined") {\
var bindAllCount = -1,\
bindAllObjects = Array(this.count);\
\
var funcNames = belt.reject(belt.functions(belt).slice(0, 40), function(funcName) {\
return /^_/.test(funcName);\
});\
var bindAllObjects = Array(this.count),\
funcNames = belt.functions(lodash);\
\
// potentially expensive\n\
for (index = 0; index < this.count; index++) {\
bindAllObjects[index] = belt.reduce(funcNames, function(object, funcName) {\
object[funcName] = belt[funcName];\
object[funcName] = lodash[funcName];\
return object;\
}, {});\
}\
@@ -419,14 +378,12 @@
fiftyValues2 = Array(50),\
seventyFiveValues = Array(75),\
seventyFiveValues2 = Array(75),\
oneHundredValues = Array(100),\
oneHundredValues2 = Array(100),\
twoHundredValues = Array(200),\
twoHundredValues2 = Array(200),\
hundredValues = Array(100),\
hundredValues2 = Array(100),\
lowerChars = "abcdefghijklmnopqrstuvwxyz".split(""),\
upperChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ".split("");\
\
for (index = 0; index < 200; index++) {\
for (index = 0; index < 100; index++) {\
if (index < 15) {\
twentyValues[index] = lowerChars[index];\
twentyValues2[index] = upperChars[index];\
@@ -446,15 +403,13 @@
fortyValues[index] =\
fiftyValues[index] =\
seventyFiveValues[index] =\
oneHundredValues[index] =\
twoHundredValues[index] = lowerChars[index];\
hundredValues[index] = lowerChars[index];\
\
thirtyValues2[index] =\
fortyValues2[index] =\
fiftyValues2[index] =\
seventyFiveValues2[index] =\
oneHundredValues2[index] =\
twoHundredValues2[index] = upperChars[index];\
hundredValues2[index] = upperChars[index];\
}\
else {\
if (index < 30) {\
@@ -473,12 +428,8 @@
seventyFiveValues[index] =\
seventyFiveValues2[index] = index;\
}\
if (index < 100) {\
oneHundredValues[index] =\
oneHundredValues2[index] = index;\
}\
twoHundredValues[index] =\
twoHundredValues2[index] = index;\
hundredValues[index] =\
hundredValues2[index] = index;\
}\
}\
}\
@@ -536,9 +487,6 @@
var _findWhere = _.findWhere || _.find,\
lodashFindWhere = lodash.findWhere || lodash.find,\
whereObject = { "num": 9 };\
}\
if (typeof zip != "undefined") {\
var unzipped = [["a", "b", "c"], [1, 2, 3], [true, false, true]];\
}'
});
@@ -594,11 +542,11 @@
suites.push(
Benchmark.Suite('`_.bind` (uses native `Function#bind` if available and inferred fast)')
.add(buildName, {
'fn': 'lodash.bind(func, { "name": "moe" })',
'fn': 'lodash.bind(func, { "name": "moe" }, "hi")',
'teardown': 'function bind(){}'
})
.add(otherName, {
'fn': '_.bind(func, { "name": "moe" })',
'fn': '_.bind(func, { "name": "moe" }, "hi")',
'teardown': 'function bind(){}'
})
);
@@ -651,28 +599,16 @@
})
);
suites.push(
Benchmark.Suite('bound multiple times')
.add(buildName, {
'fn': 'lodashBoundMultiple()',
'teardown': 'function bind(){}'
})
.add(otherName, {
'fn': '_boundMultiple()',
'teardown': 'function bind(){}'
})
);
/*--------------------------------------------------------------------------*/
suites.push(
Benchmark.Suite('`_.bindAll` iterating arguments')
.add(buildName, {
'fn': 'lodash.bindAll.apply(lodash, [bindAllObjects[++bindAllCount]].concat(funcNames))',
'fn': 'lodash.bindAll.apply(lodash, [bindAllObjects.pop()].concat(funcNames))',
'teardown': 'function bindAll(){}'
})
.add(otherName, {
'fn': '_.bindAll.apply(_, [bindAllObjects[++bindAllCount]].concat(funcNames))',
'fn': '_.bindAll.apply(_, [bindAllObjects.pop()].concat(funcNames))',
'teardown': 'function bindAll(){}'
})
);
@@ -680,11 +616,11 @@
suites.push(
Benchmark.Suite('`_.bindAll` iterating the `object`')
.add(buildName, {
'fn': 'lodash.bindAll(bindAllObjects[++bindAllCount])',
'fn': 'lodash.bindAll(bindAllObjects.pop())',
'teardown': 'function bindAll(){}'
})
.add(otherName, {
'fn': '_.bindAll(bindAllObjects[++bindAllCount])',
'fn': '_.bindAll(bindAllObjects.pop())',
'teardown': 'function bindAll(){}'
})
);
@@ -720,20 +656,20 @@
suites.push(
Benchmark.Suite('`_.contains` iterating an array')
.add(buildName, '\
lodash.contains(numbers, limit - 1)'
lodash.contains(numbers, 19)'
)
.add(otherName, '\
_.contains(numbers, limit - 1)'
_.contains(numbers, 19)'
)
);
suites.push(
Benchmark.Suite('`_.contains` iterating an object')
.add(buildName, '\
lodash.contains(object, limit - 1)'
lodash.contains(object, 19)'
)
.add(otherName, '\
_.contains(object, limit - 1)'
_.contains(object, 19)'
)
);
@@ -798,25 +734,13 @@
);
suites.push(
Benchmark.Suite('`_.difference` iterating 75 elements')
Benchmark.Suite('`_.difference` iterating 100 elements')
.add(buildName, {
'fn': 'lodash.difference(seventyFiveValues, seventyFiveValues2)',
'fn': 'lodash.difference(hundredValues, hundredValues2)',
'teardown': 'function multiArrays(){}'
})
.add(otherName, {
'fn': '_.difference(seventyFiveValues, seventyFiveValues2)',
'teardown': 'function multiArrays(){}'
})
);
suites.push(
Benchmark.Suite('`_.difference` iterating 200 elements')
.add(buildName, {
'fn': 'lodash.difference(twoHundredValues, twoHundredValues2)',
'teardown': 'function multiArrays(){}'
})
.add(otherName, {
'fn': '_.difference(twoHundredValues, twoHundredValues2)',
'fn': '_.difference(hundredValues, hundredValues2)',
'teardown': 'function multiArrays(){}'
})
);
@@ -975,12 +899,12 @@
Benchmark.Suite('`_.find` iterating an array')
.add(buildName, '\
lodash.find(numbers, function(num) {\
return num === (limit - 1);\
return num === 19;\
})'
)
.add(otherName, '\
_.find(numbers, function(num) {\
return num === (limit - 1);\
return num === 19;\
})'
)
);
@@ -1026,16 +950,6 @@
)
);
suites.push(
Benchmark.Suite('`_.flatten` with objects')
.add(buildName, '\
lodash.flatten(nestedObjects)'
)
.add(otherName, '\
_.flatten(nestedObjects)'
)
);
suites.push(
Benchmark.Suite('`_.flatten` with `shallow`')
.add(buildName, '\
@@ -1097,51 +1011,23 @@
/*--------------------------------------------------------------------------*/
suites.push(
Benchmark.Suite('`_.indexBy` with `callback` iterating an array')
Benchmark.Suite('`_.indexOf`')
.add(buildName, '\
lodash.indexBy(numbers, function(num) { return num >> 1; })'
lodash.indexOf(numbers, 9)'
)
.add(otherName, '\
_.indexBy(numbers, function(num) { return num >> 1; })'
_.indexOf(numbers, 9)'
)
);
suites.push(
Benchmark.Suite('`_.indexBy` with `property` name iterating an array')
.add(buildName, {
'fn': 'lodash.indexBy(words, "length")',
'teardown': 'function countBy(){}'
})
.add(otherName, {
'fn': '_.indexBy(words, "length")',
'teardown': 'function countBy(){}'
})
);
suites.push(
Benchmark.Suite('`_.indexBy` with `callback` iterating an object')
.add(buildName, {
'fn': 'lodash.indexBy(wordToNumber, function(num) { return num >> 1; })',
'teardown': 'function countBy(){}'
})
.add(otherName, {
'fn': '_.indexBy(wordToNumber, function(num) { return num >> 1; })',
'teardown': 'function countBy(){}'
})
);
/*--------------------------------------------------------------------------*/
suites.push(
Benchmark.Suite('`_.indexOf`')
.add(buildName, {
'fn': 'lodash.indexOf(twoHundredValues, 199)',
'teardown': 'function multiArrays(){}'
})
.add(otherName, {
'fn': '_.indexOf(twoHundredValues, 199)',
'teardown': 'function multiArrays(){}'
})
Benchmark.Suite('`_.indexOf` with `isSorted`')
.add(buildName, '\
lodash.indexOf(numbers, 19, true)'
)
.add(otherName, '\
_.indexOf(numbers, 19, true)'
)
);
/*--------------------------------------------------------------------------*/
@@ -1157,25 +1043,13 @@
);
suites.push(
Benchmark.Suite('`_.intersection` iterating 75 elements')
Benchmark.Suite('`_.intersection` iterating 100 elements')
.add(buildName, {
'fn': 'lodash.intersection(seventyFiveValues, seventyFiveValues2)',
'fn': 'lodash.intersection(hundredValues, hundredValues2)',
'teardown': 'function multiArrays(){}'
})
.add(otherName, {
'fn': '_.intersection(seventyFiveValues, seventyFiveValues2)',
'teardown': 'function multiArrays(){}'
})
);
suites.push(
Benchmark.Suite('`_.intersection` iterating 200 elements')
.add(buildName, {
'fn': 'lodash.intersection(twoHundredValues, twoHundredValues2)',
'teardown': 'function multiArrays(){}'
})
.add(otherName, {
'fn': '_.intersection(twoHundredValues, twoHundredValues2)',
'fn': '_.intersection(hundredValues, hundredValues2)',
'teardown': 'function multiArrays(){}'
})
);
@@ -1243,13 +1117,13 @@
.add(buildName, {
'fn': '\
lodash.isEqual(numbers, numbers2);\
lodash.isEqual(twoNumbers, twoNumbers2)',
lodash.isEqual(twoNumbers, twoNumbers2);',
'teardown': 'function isEqual(){}'
})
.add(otherName, {
'fn': '\
_.isEqual(numbers, numbers2);\
_.isEqual(twoNumbers, twoNumbers2)',
_.isEqual(twoNumbers, twoNumbers2);',
'teardown': 'function isEqual(){}'
})
);
@@ -1259,13 +1133,13 @@
.add(buildName, {
'fn': '\
lodash.isEqual(nestedNumbers, nestedNumbers2);\
lodash.isEqual(nestedNumbers2, nestedNumbers3)',
lodash.isEqual(nestedNumbers2, nestedNumbers3);',
'teardown': 'function isEqual(){}'
})
.add(otherName, {
'fn': '\
_.isEqual(nestedNumbers, nestedNumbers2);\
_.isEqual(nestedNumbers2, nestedNumbers3)',
_.isEqual(nestedNumbers2, nestedNumbers3);',
'teardown': 'function isEqual(){}'
})
);
@@ -1275,13 +1149,13 @@
.add(buildName, {
'fn': '\
lodash.isEqual(objects, objects2);\
lodash.isEqual(simpleObjects, simpleObjects2)',
lodash.isEqual(simpleObjects, simpleObjects2);',
'teardown': 'function isEqual(){}'
})
.add(otherName, {
'fn': '\
_.isEqual(objects, objects2);\
_.isEqual(simpleObjects, simpleObjects2)',
_.isEqual(simpleObjects, simpleObjects2);',
'teardown': 'function isEqual(){}'
})
);
@@ -1291,13 +1165,13 @@
.add(buildName, {
'fn': '\
lodash.isEqual(object, object2);\
lodash.isEqual(simpleObject, simpleObject2)',
lodash.isEqual(simpleObject, simpleObject2);',
'teardown': 'function isEqual(){}'
})
.add(otherName, {
'fn': '\
_.isEqual(object, object2);\
_.isEqual(simpleObject, simpleObject2)',
_.isEqual(simpleObject, simpleObject2);',
'teardown': 'function isEqual(){}'
})
);
@@ -1305,7 +1179,7 @@
/*--------------------------------------------------------------------------*/
suites.push(
Benchmark.Suite('`_.isArguments`, `_.isDate`, `_.isFunction`, `_.isNumber`, `_.isObject`, `_.isRegExp`')
Benchmark.Suite('`_.isArguments`, `_.isDate`, `_.isFunction`, `_.isNumber`, `_.isRegExp`')
.add(buildName, '\
lodash.isArguments(arguments);\
lodash.isArguments(object);\
@@ -1315,10 +1189,8 @@
lodash.isFunction(object);\
lodash.isNumber(1);\
lodash.isNumber(object);\
lodash.isObject(object);\
lodash.isObject(1);\
lodash.isRegExp(regexp);\
lodash.isRegExp(object)'
lodash.isRegExp(object);'
)
.add(otherName, '\
_.isArguments(arguments);\
@@ -1329,10 +1201,8 @@
_.isFunction(object);\
_.isNumber(1);\
_.isNumber(object);\
_.isObject(object);\
_.isObject(1);\
_.isRegExp(regexp);\
_.isRegExp(object)'
_.isRegExp(object);'
)
);
@@ -1496,13 +1366,13 @@
lodash.reduce(numbers, function(result, value, index) {\
result[index] = value;\
return result;\
}, {})'
}, {});'
)
.add(otherName, '\
_.reduce(numbers, function(result, value, index) {\
result[index] = value;\
return result;\
}, {})'
}, {});'
)
);
@@ -1512,13 +1382,13 @@
lodash.reduce(object, function(result, value, key) {\
result.push(key, value);\
return result;\
}, [])'
}, []);'
)
.add(otherName, '\
_.reduce(object, function(result, value, key) {\
result.push(key, value);\
return result;\
}, [])'
}, []);'
)
);
@@ -1530,13 +1400,13 @@
lodash.reduceRight(numbers, function(result, value, index) {\
result[index] = value;\
return result;\
}, {})'
}, {});'
)
.add(otherName, '\
_.reduceRight(numbers, function(result, value, index) {\
result[index] = value;\
return result;\
}, {})'
}, {});'
)
);
@@ -1546,13 +1416,13 @@
lodash.reduceRight(object, function(result, value, key) {\
result.push(key, value);\
return result;\
}, [])'
}, []);'
)
.add(otherName, '\
_.reduceRight(object, function(result, value, key) {\
result.push(key, value);\
return result;\
}, [])'
}, []);'
)
);
@@ -1602,18 +1472,6 @@
/*--------------------------------------------------------------------------*/
suites.push(
Benchmark.Suite('`_.sample` with an `n`')
.add(buildName, '\
lodash.sample(numbers, limit / 2)'
)
.add(otherName, '\
_.sample(numbers, limit / 2)'
)
);
/*--------------------------------------------------------------------------*/
suites.push(
Benchmark.Suite('`_.shuffle`')
.add(buildName, '\
@@ -1642,12 +1500,12 @@
Benchmark.Suite('`_.some` iterating an array')
.add(buildName, '\
lodash.some(numbers, function(num) {\
return num == (limit - 1);\
return num == 19;\
})'
)
.add(otherName, '\
_.some(numbers, function(num) {\
return num == (limit - 1);\
return num == 19;\
})'
)
);
@@ -1656,12 +1514,12 @@
Benchmark.Suite('`_.some` with `thisArg` iterating an array (slow path)')
.add(buildName, '\
lodash.some(objects, function(value, index) {\
return this["key" + index] == (limit - 1);\
return this["key" + index] == 19;\
}, object)'
)
.add(otherName, '\
_.some(objects, function(value, index) {\
return this["key" + index] == (limit - 1);\
return this["key" + index] == 19;\
}, object)'
)
);
@@ -1670,12 +1528,12 @@
Benchmark.Suite('`_.some` iterating an object')
.add(buildName, '\
lodash.some(object, function(num) {\
return num == (limit - 1);\
return num == 19;\
})'
)
.add(otherName, '\
_.some(object, function(num) {\
return num == (limit - 1);\
return num == 19;\
})'
)
);
@@ -1716,6 +1574,16 @@
/*--------------------------------------------------------------------------*/
suites.push(
Benchmark.Suite('`_.sortedIndex`')
.add(buildName, '\
lodash.sortedIndex(numbers, 25)'
)
.add(otherName, '\
_.sortedIndex(numbers, 25)'
)
);
suites.push(
Benchmark.Suite('`_.sortedIndex` with `callback`')
.add(buildName, {
@@ -1835,23 +1703,11 @@
suites.push(
Benchmark.Suite('`_.union` iterating an array of 75 elements')
.add(buildName, {
'fn': 'lodash.union(twentyFiveValues, fiftyValues2)',
'fn': 'lodash.union(fiftyValues, twentyFiveValues2);',
'teardown': 'function multiArrays(){}'
})
.add(otherName, {
'fn': '_.union(twentyFiveValues, fiftyValues2)',
'teardown': 'function multiArrays(){}'
})
);
suites.push(
Benchmark.Suite('`_.union` iterating an array of 200 elements')
.add(buildName, {
'fn': 'lodash.union(oneHundredValues, oneHundredValues2)',
'teardown': 'function multiArrays(){}'
})
.add(otherName, {
'fn': '_.union(oneHundredValues, oneHundredValues2)',
'fn': '_.union(fiftyValues, twentyFiveValues2);',
'teardown': 'function multiArrays(){}'
})
);
@@ -1873,7 +1729,7 @@
.add(buildName, '\
lodash.uniq(numbers.concat(twoNumbers, fourNumbers), function(num) {\
return num % 2;\
})'
});'
)
.add(otherName, '\
_.uniq(numbers.concat(twoNumbers, fourNumbers), function(num) {\
@@ -1885,23 +1741,11 @@
suites.push(
Benchmark.Suite('`_.uniq` iterating an array of 75 elements')
.add(buildName, {
'fn': 'lodash.uniq(twentyFiveValues.concat(fiftyValues2))',
'fn': 'lodash.uniq(fiftyValues.concat(twentyFiveValues2));',
'teardown': 'function multiArrays(){}'
})
.add(otherName, {
'fn': '_.uniq(twentyFiveValues.concat(fiftyValues2))',
'teardown': 'function multiArrays(){}'
})
);
suites.push(
Benchmark.Suite('`_.uniq` iterating an array of 200 elements')
.add(buildName, {
'fn': 'lodash.uniq(oneHundredValues.concat(oneHundredValues2))',
'teardown': 'function multiArrays(){}'
})
.add(otherName, {
'fn': '_.uniq(oneHundredValues.concat(oneHundredValues2))',
'fn': '_.uniq(fiftyValues.concat(twentyFiveValues2));',
'teardown': 'function multiArrays(){}'
})
);
@@ -1923,11 +1767,11 @@
suites.push(
Benchmark.Suite('`_.where`')
.add(buildName, {
'fn': 'lodash.where(objects, whereObject)',
'fn': 'lodash.where(objects, whereObject);',
'teardown': 'function where(){}'
})
.add(otherName, {
'fn': '_.where(objects, whereObject)',
'fn': '_.where(objects, whereObject);',
'teardown': 'function where(){}'
})
);
@@ -1944,17 +1788,15 @@
)
);
/*--------------------------------------------------------------------------*/
suites.push(
Benchmark.Suite('`_.zip`')
Benchmark.Suite('`_.without` iterating an array of 30 elements')
.add(buildName, {
'fn': 'lodash.zip.apply(lodash, unzipped)',
'teardown': 'function zip(){}'
'fn': 'lodash.without.apply(lodash, [thirtyValues].concat(thirtyValues2));',
'teardown': 'function multiArrays(){}'
})
.add(otherName, {
'fn': '_.zip.apply(_, unzipped)',
'teardown': 'function zip(){}'
'fn': '_.without.apply(_, [thirtyValues].concat(thirtyValues2));',
'teardown': 'function multiArrays(){}'
})
);

View File

@@ -1,174 +0,0 @@
;(function(window) {
'use strict';
/** The base path of the builds */
var basePath = '../';
/** The Lo-Dash build to load */
var build = (build = /build=([^&]+)/.exec(location.search)) && decodeURIComponent(build[1]);
/** The module loader to use */
var loader = (loader = /loader=([^&]+)/.exec(location.search)) && decodeURIComponent(loader[1]);
/** The `ui` object */
var ui = {};
/*--------------------------------------------------------------------------*/
/**
* Registers an event listener on an element.
*
* @private
* @param {Element} element The element.
* @param {string} eventName The name of the event.
* @param {Function} handler The event handler.
* @returns {Element} The element.
*/
function addListener(element, eventName, handler) {
if (typeof element.addEventListener != 'undefined') {
element.addEventListener(eventName, handler, false);
} else if (typeof element.attachEvent != 'undefined') {
element.attachEvent('on' + eventName, handler);
}
}
/*--------------------------------------------------------------------------*/
// expose `ui.urlParams` properties
ui.urlParams = {
'build': build,
'loader': loader
};
// expose Lo-Dash build file path
ui.buildPath = (function() {
var result;
switch (build) {
case 'lodash-compat': result = 'dist/lodash.compat.min.js'; break;
case 'lodash-modern-dev': result = 'dist/lodash.js'; break;
case 'lodash-modern': result = 'dist/lodash.min.js'; break;
case 'lodash-legacy': result = 'dist/lodash.legacy.min.js'; break;
case 'lodash-mobile': result = 'dist/lodash.mobile.min.js'; break;
case 'lodash-underscore': result = 'dist/lodash.underscore.min.js'; break;
case 'lodash-custom-dev': result = 'lodash.custom.js'; break;
case 'lodash-custom': result = 'lodash.custom.min.js'; break;
case 'lodash-compat-dev':
case null: result = 'lodash.js'; break;
default: return build;
}
return basePath + result;
}());
// expose module loader file path
ui.loaderPath = (function() {
var result;
switch (loader) {
case 'curl': result = 'vendor/curl/dist/curl-kitchen-sink/curl.js'; break;
case 'dojo': result = 'vendor/dojo/dojo.js'; break;
case 'requirejs':
case null: result = 'vendor/requirejs/require.js'; break;
default: return loader;
}
return basePath + result;
}());
// used to indicate testing a modularized build
ui.isModularize = /\b(?:commonjs|(index|main)\.js|lodash-(?:amd|node)|modularize|npm)\b/.test([location.pathname, location.search, ui.buildPath]);
// initialize controls
addListener(window, 'load', function() {
function eventHandler(event) {
var buildIndex = buildList.selectedIndex,
loaderIndex = loaderList.selectedIndex,
search = location.search.replace(/^\?|&?(?:build|loader)=[^&]*&?/g, '');
if (event.stopPropagation) {
event.stopPropagation();
} else {
event.cancelBubble = true;
}
location.href =
location.href.split('?')[0] + '?' +
(search ? search + '&' : '') +
'build=' + (buildIndex < 0 ? build : buildList[buildIndex].value) + '&' +
'loader=' + (loaderIndex < 0 ? loader : loaderList[loaderIndex].value);
}
function init() {
var toolbar = document.getElementById('qunit-testrunner-toolbar');
if (toolbar) {
toolbar.appendChild(span1);
toolbar.appendChild(span2);
buildList.selectedIndex = (function() {
switch (build) {
case 'lodash-compat': return 1;
case 'lodash-modern-dev': return 2;
case 'lodash-modern': return 3;
case 'lodash-legacy': return 4;
case 'lodash-mobile': return 5;
case 'lodash-underscore': return 6;
case 'lodash-custom-dev': return 7;
case 'lodash-custom': return 8;
case 'lodash-compat-dev':
case null: return 0;
}
return -1;
}());
loaderList.selectedIndex = (function() {
switch (loader) {
case 'none': return 0
case 'curl': return 1;
case 'dojo': return 2;
case 'requirejs':
case null: return 3;
}
return -1;
}());
addListener(buildList, 'change', eventHandler);
addListener(loaderList, 'change', eventHandler);
}
else {
setTimeout(init, 15);
}
}
var span1 = document.createElement('span');
span1.style.cssText = 'float:right';
span1.innerHTML =
'<label for="qunit-build">Build: </label>' +
'<select id="qunit-build">' +
'<option value="lodash-compat-dev">Lo-Dash (compat development)</option>' +
'<option value="lodash-compat">Lo-Dash (compat production)</option>' +
'<option value="lodash-modern-dev">Lo-Dash (modern development)</option>' +
'<option value="lodash-modern">Lo-Dash (modern production)</option>' +
'<option value="lodash-legacy">Lo-Dash (legacy)</option>' +
'<option value="lodash-mobile">Lo-Dash (mobile)</option>' +
'<option value="lodash-underscore">Lo-Dash (underscore)</option>' +
'<option value="lodash-custom-dev">Lo-Dash (custom development)</option>' +
'<option value="lodash-custom">Lo-Dash (custom production)</option>' +
'</select>';
var span2 = document.createElement('span');
span2.style.cssText = 'float:right';
span2.innerHTML =
'<label for="qunit-loader">Loader: </label>' +
'<select id="qunit-loader">' +
'<option value="none">None</option>' +
'<option value="curl">Curl</option>' +
'<option value="dojo">Dojo</option>' +
'<option value="requirejs">RequireJS</option>' +
'</select>';
var buildList = span1.lastChild,
loaderList = span2.lastChild;
init();
});
// expose `ui`
window.ui = ui;
}(this));

View File

@@ -1,6 +0,0 @@
addEventListener('message', function(e) {
if (e.data) {
importScripts('../' + e.data);
postMessage(_.VERSION);
}
}, false);

View File

@@ -18,22 +18,28 @@
<h1>Test</h1>
</div>
</div>
<script src="../vendor/json-js/json2.js"></script>
<script src="../vendor/json3/lib/json3.js"></script>
<script src="../vendor/jquery/jquery.js"></script>
<script src="../vendor/platform.js/platform.js"></script>
<script src="../vendor/qunit/qunit/qunit.js"></script>
<script src="./asset/test-ui.js"></script>
<script src="test-ui.js"></script>
<script src="../lodash.js"></script>
<script>
var lodash = _.noConflict();
document.write('<script src="' + ui.buildPath + '"><\/script>');
document.write('<script src="../' + ui.buildPath + '"><\/script>');
</script>
<script>
_.mixin({
'debounce': _.debounce || lodash.debounce,
'defer': _.defer || lodash.defer,
'pluck': _.pluck || lodash.pluck
'debounce': lodash.debounce,
'defer': lodash.defer
});
if (!_.chain) {
_.mixin({
'chain': function(value) {
return new _(value);
}
});
}
</script>
<script src="../vendor/backbone/backbone.js"></script>
<script src="../vendor/backbone/test/environment.js"></script>

View File

@@ -13,152 +13,73 @@
<body>
<script src="../vendor/qunit/qunit/qunit.js"></script>
<script src="../vendor/platform.js/platform.js"></script>
<script src="./asset/test-ui.js"></script>
<script src="test-ui.js"></script>
<div id="qunit"></div>
<div id="exports"></div>
<script>
// set bad shims
Array._isArray = Array.isArray;
Array.isArray = function() { return false; };
Function.prototype._bind = Function.prototype.bind;
Function.prototype.bind = function() { return function() {}; };
Object._create = Object.create;
Object.create = function() {};
Object._defineProperty = Object.defineProperty;
Object.defineProperty = function() {};
// set a bad shim
Object._keys = Object.keys;
Object.keys = function() { return []; };
// load Lo-Dash and expose it to the bad `Object.keys` shim
document.write('<script src="' + (ui.isModularize ? '../lodash.js' : ui.buildPath) + '"><\/script>');
document.write('<script src="../' + ui.buildPath + '"><\/script>');
</script>
<script>
// store Lo-Dash to test for bad shim detection
var lodashBadShim = window._;
var lodashBadShim = _;
// restore native methods
if (Array._isArray) {
Array.isArray = Array._isArray;
} else {
delete Array.isArray;
}
if (Function.prototype._bind) {
Function.prototype.bind = Function.prototype._bind;
} else {
delete Function.prototype.bind;
}
if (Object._create) {
Object.create = Object._create;
} else {
delete Object.create;
}
if (Object._defineProperty) {
Object.defineProperty = Object._defineProperty;
} else {
delete Object.defineProperty;
}
if (Object._keys) {
Object.keys = Object._keys;
} else {
delete Object.keys;
}
delete Array._isArray;
delete Function.prototype._bind;
delete Object._create;
delete Object._defineProperty;
// restore nativeKeys
Object.keys = Object._keys;
delete Object._keys;
// load Lo-Dash again to overwrite the existing `_` value
document.write('<script src="' + (ui.isModularize ? '../lodash.js' : ui.buildPath) + '"><\/script>');
document.write('<script src="../' + ui.buildPath + '"><\/script>');
// load test.js if not using require.js
document.write(ui.urlParams.loader == 'none'
document.write(QUnit.urlParams.norequire
? '<script src="test.js"><\/script>'
: '<script data-dojo-config="async:1" src="' + ui.loaderPath + '"><\/script>'
: '<script src="../vendor/requirejs/require.js"><\/script>'
);
</script>
<script>
// load Lo-Dash as a module
var lodashModule,
shimmedModule,
underscoreModule;
window.require && require(
(function() {
if (window.curl) {
curl.config({ 'apiName': 'require' });
}
if (!window.require) {
return;
}
var reBasename = /[\w.-]+$/,
basePath = ('//' + location.host + location.pathname.replace(reBasename, '')).replace(/\btest\/$/, ''),
modulePath = ui.buildPath.replace(/\.js$/, ''),
locationPath = modulePath.replace(reBasename, ''),
moduleMain = modulePath.match(reBasename)[0];
QUnit.config.autostart = false;
// load Lo-Dash as a module
require({
'baseUrl': './',
var modulePath = ui.buildPath.replace(/\.js$/, '');
return {
'baseUrl': '../vendor/requirejs/',
'urlArgs': 't=' + (+new Date),
'packages': [
{
'name': 'lodash',
'location': locationPath,
'main': moduleMain
},
{
'name': 'shimmed',
'location': './abc/../' + locationPath,
'main': moduleMain
},
{
'name': 'underscore',
'location': './xyz/../' + locationPath,
'main': moduleMain
},
{
'name': 'test',
'location': basePath + '/test',
'main': 'test',
'config': {
// work around no global being exported
'exports': 'QUnit',
'loader': 'curl/loader/legacy'
}
}
],
'paths': {
'lodash': '../../' + modulePath,
'shimmed': './../../' + modulePath,
'underscore': '../underscore/../../' + modulePath
},
'shim': {
'shimmed': {
'exports': '_'
'exports': '_'
}
}
},
['lodash', 'shimmed', 'underscore'], function(lodash, shimmed, underscore) {
if (shimmed && shimmed.noConflict) {
shimmedModule = shimmed.noConflict();
shimmedModule.moduleName = 'shimmed';
}
if (underscore && underscore.noConflict) {
underscoreModule = underscore.noConflict();
underscoreModule.moduleName = 'underscore';
}
if (lodash && lodash.noConflict) {
lodashModule = lodash.noConflict();
lodashModule.moduleName = 'lodash';
}
if (ui.isModularize) {
window._ = lodash;
}
require(['test'], function() {
QUnit.start();
});
});
}());
};
}()),
['lodash', 'shimmed', 'underscore'], function(lodash, shimmed, underscore) {
if (lodash && lodash.noConflict) {
lodashModule = lodash.noConflict();
lodashModule.moduleName = 'lodash';
}
if (shimmed.noConflict) {
shimmedModule = shimmed.noConflict();
shimmedModule.moduleName = 'shimmed';
}
if (underscore && underscore.noConflict) {
underscoreModule = underscore.noConflict();
underscoreModule.moduleName = 'underscore';
}
require(['test.js']);
});
// set a more readable browser name
window.onload = function() {
@@ -168,7 +89,7 @@
ua.innerHTML = platform;
clearInterval(timeoutId);
}
}, 16);
}, 15);
};
</script>
</body>

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

@@ -9,6 +9,10 @@ done
echo "Testing in node..."
node test.js ../dist/lodash.js && node test.js ../dist/lodash.min.js
echo ""
echo "Testing build..."
node test-build.js
echo ""
echo "Testing in a browser..."
open index.html

3
test/template/a.jst Normal file
View File

@@ -0,0 +1,3 @@
<ul>
<% _.forEach(people, function(name) { %><li><%- name %></li><% }); %>
</ul>

1
test/template/b.jst Normal file
View File

@@ -0,0 +1 @@
<% print("Hello " + epithet); %>.

1
test/template/c.jst Normal file
View File

@@ -0,0 +1 @@
Hello ${ name }!

1
test/template/d.tpl Normal file
View File

@@ -0,0 +1 @@
Hello {{ name }}!

1486
test/test-build.js Normal file

File diff suppressed because it is too large Load Diff

108
test/test-ui.js Normal file
View File

@@ -0,0 +1,108 @@
;(function(window) {
'use strict';
/** `QUnit.addEvent` shortcut */
var addEvent = QUnit.addEvent;
/** The Lo-Dash build to load */
var build = (/build=([^&]+)/.exec(location.search) || [])[1];
/** A flag to determine if RequireJS should be loaded */
var norequire = /[?&]norequire=true(?:&|$)/.test(location.search);
/** The `ui` object */
var ui = {};
/*--------------------------------------------------------------------------*/
// expose Lo-Dash build file path
ui.buildPath = (function() {
switch (build) {
case 'lodash-prod': return 'dist/lodash.compat.min.js';
case 'lodash-underscore': return 'dist/lodash.underscore.min.js';
case 'lodash-modern': return 'dist/lodash.min.js';
case 'lodash-modern-debug': return 'dist/lodash.js';
case 'lodash-custom': return 'lodash.custom.min.js';
case 'lodash-custom-debug': return 'lodash.custom.js';
}
return 'lodash.js';
}());
// assign `QUnit.urlParams` properties
QUnit.extend(QUnit.urlParams, {
'build': build,
'norequire': norequire
});
// initialize controls
addEvent(window, 'load', function() {
function eventHandler(event) {
var search = location.search.replace(/^\?|&?(?:build|norequire)=[^&]*&?/g, '');
if (event.stopPropagation) {
event.stopPropagation();
} else {
event.cancelBubble = true;
}
location.href =
location.href.split('?')[0] + '?' +
(search ? search + '&' : '') +
'build=' + buildList[buildList.selectedIndex].value +
(checkbox.checked ? '&norequire=true' : '');
}
function init() {
var toolbar = document.getElementById('qunit-testrunner-toolbar');
if (toolbar) {
toolbar.appendChild(span1);
toolbar.appendChild(span2);
buildList.selectedIndex = (function() {
switch (build) {
case 'lodash-prod': return 1;
case 'lodash-underscore': return 2;
case 'lodash-modern': return 3;
case 'lodash-modern-debug': return 4;
case 'lodash-custom': return 5;
case 'lodash-custom-debug': return 6;
}
return 0;
}());
checkbox.checked = norequire;
addEvent(checkbox, 'click', eventHandler);
addEvent(buildList, 'change', eventHandler);
}
else {
setTimeout(init, 15);
}
}
var span1 = document.createElement('span');
span1.innerHTML =
'<input id="qunit-norequire" type="checkbox">' +
'<label for="qunit-norequire">No RequireJS</label>';
var span2 = document.createElement('span');
span2.style.cssText = 'float:right';
span2.innerHTML =
'<label for="qunit-build">Build: </label>' +
'<select id="qunit-build">' +
'<option value="lodash-dev">Developement</option>' +
'<option value="lodash-prod">Production</option>' +
'<option value="lodash-underscore">Underscore</option>' +
'<option value="lodash-modern">Modern</option>' +
'<option value="lodash-modern-debug">Modern (debug)</option>' +
'<option value="lodash-custom">Custom</option>' +
'<option value="lodash-custom-debug">Custom (debug)</option>' +
'</select>';
var checkbox = span1.firstChild,
buildList = span2.lastChild;
init();
});
// expose `ui`
window.ui = ui;
}(this));

File diff suppressed because it is too large Load Diff

View File

@@ -19,28 +19,34 @@
</div>
<img id="chart_image" src="data:image/gif;base64,R0lGODlhAQABAIAAAP///////yH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==">
</div>
<script src="../vendor/qunit/qunit/qunit.js"></script>
<script src="../vendor/jquery/jquery.js"></script>
<script src="../vendor/platform.js/platform.js"></script>
<script src="./asset/test-ui.js"></script>
<script src="../vendor/qunit/qunit/qunit.js"></script>
<script src="test-ui.js"></script>
<script>
function init(lodash) {
var arrayRef = [],
push = arrayRef.push;
document.write('<script src="../' + ui.buildPath + '"><\/script>');
</script>
<script>
(function() {
var arrayProto = Array.prototype,
concat = arrayProto.concat,
pop = arrayProto.pop,
push = arrayProto.push,
slice = arrayProto.slice;
if (!lodash().map()) {
if (_.chain) {
return;
}
lodash.mixin = function(object) {
lodash.forEach(lodash.functions(object), function(methodName) {
var func = lodash[methodName] = object[methodName];
lodash.prototype[methodName] = function() {
_.mixin = function(object) {
_.forEach(_.functions(object), function(methodName) {
var func = _[methodName] = object[methodName];
_.prototype[methodName] = function() {
var args = [this.__wrapped__];
push.apply(args, arguments);
var result = func.apply(lodash, args);
var result = func.apply(_, args);
if (this.__chain__) {
result = new lodash(result);
result = new _(result);
result.__chain__ = true;
}
return result;
@@ -48,90 +54,44 @@
});
};
lodash.forEach(['pop', 'shift'], function(methodName) {
var func = arrayRef[methodName];
lodash.prototype[methodName] = function() {
func.apply(this.__wrapped__, arguments);
return this;
};
_.mixin(_);
_.mixin({
'findWhere': _.find
});
_.chain = function(value) {
value = new _(value);
value.__chain__ = true;
return value;
};
lodash.mixin(lodash);
_.prototype.chain = function() {
this.__chain__ = true;
return this;
};
// expose lodash
window._ = lodash;
}
_.prototype.concat = function() {
var result = concat.apply(this.__wrapped__, arguments);
if (this.__chain__) {
result = new _(result);
result.__chain__ = true;
}
return result;
};
// load Lo-Dash again to overwrite the existing `_` value
document.write('<script src="' + (ui.isModularize ? '../lodash.js' : ui.buildPath) + '"><\/script>');
// load test.js if not using require.js
document.write(ui.urlParams.loader != 'none'
? '<script data-dojo-config="async:1" src="' + ui.loaderPath + '"><\/script>'
: ([
'<script src="../vendor/underscore/test/collections.js"><\/script>',
'<script src="../vendor/underscore/test/arrays.js"><\/script>',
'<script src="../vendor/underscore/test/functions.js"><\/script>',
'<script src="../vendor/underscore/test/objects.js"><\/script>',
'<script src="../vendor/underscore/test/utility.js"><\/script>',
'<script src="../vendor/underscore/test/chaining.js"><\/script>'
].join('\n'))
);
</script>
<script>
(function() {
if (window.curl) {
curl.config({ 'apiName': 'require' });
}
if (!window.require) {
init(_);
return;
}
var reBasename = /[\w.-]+$/,
basePath = ('//' + location.host + location.pathname).replace(/\btest\/$/, ''),
modulePath = ui.buildPath.replace(/\.js$/, ''),
locationPath = modulePath.replace(reBasename, ''),
moduleMain = modulePath.match(reBasename)[0];
QUnit.config.autostart = false;
// load Lo-Dash as a module
require({
'baseUrl': './',
'urlArgs': 't=' + (+new Date),
'packages': [
{
'name': 'lodash',
'location': locationPath,
'main': moduleMain
},
{
'name': 'test',
'location': '../vendor/underscore/test',
'config': {
// work around no global being exported
'exports': 'QUnit',
'loader': 'curl/loader/legacy'
}
}
]
},
['lodash'], function(lodash) {
init(lodash);
require([
'test/collections',
'test/arrays',
'test/functions',
'test/objects',
'test/utility',
'test/chaining'
], function() {
QUnit.start();
});
});
_.prototype.pop = function() {
pop.apply(this.__wrapped__, arguments);
return this;
};
}());
</script>
<script src="../vendor/underscore/test/collections.js"></script>
<script src="../vendor/underscore/test/arrays.js"></script>
<script src="../vendor/underscore/test/functions.js"></script>
<script src="../vendor/underscore/test/objects.js"></script>
<script src="../vendor/underscore/test/utility.js"></script>
<script src="../vendor/underscore/test/chaining.js"></script>
<script type="text/html" id="template">
<%
// a comment

26
vendor/backbone/README.md vendored Normal file
View File

@@ -0,0 +1,26 @@
____ __ __
/\ _`\ /\ \ /\ \ __
\ \ \ \ \ __ ___\ \ \/'\\ \ \____ ___ ___ __ /\_\ ____
\ \ _ <' /'__`\ /'___\ \ , < \ \ '__`\ / __`\ /' _ `\ /'__`\ \/\ \ /',__\
\ \ \ \ \/\ \ \.\_/\ \__/\ \ \\`\\ \ \ \ \/\ \ \ \/\ \/\ \/\ __/ __ \ \ \/\__, `\
\ \____/\ \__/.\_\ \____\\ \_\ \_\ \_,__/\ \____/\ \_\ \_\ \____\/\_\_\ \ \/\____/
\/___/ \/__/\/_/\/____/ \/_/\/_/\/___/ \/___/ \/_/\/_/\/____/\/_/\ \_\ \/___/
\ \____/
\/___/
(_'_______________________________________________________________________________'_)
(_.———————————————————————————————————————————————————————————————————————————————._)
Backbone supplies structure to JavaScript-heavy applications by providing models key-value binding and custom events, collections with a rich API of enumerable functions, views with declarative event handling, and connects it all to your existing application over a RESTful JSON interface.
For Docs, License, Tests, pre-packed downloads, and everything else, really, see:
http://backbonejs.org
To suggest a feature, report a bug, or general discussion:
http://github.com/documentcloud/backbone/issues/
All contributors are listed here:
http://github.com/documentcloud/backbone/contributors
Special thanks to Robert Kieffer for the original philosophy behind Backbone.
http://github.com/broofa

128
vendor/benchmark.js/README.md vendored Normal file
View File

@@ -0,0 +1,128 @@
# Benchmark.js <sup>v1.0.0</sup>
[![build status](https://secure.travis-ci.org/bestiejs/benchmark.js.png)](http://travis-ci.org/bestiejs/benchmark.js)
A [robust](http://calendar.perfplanet.com/2010/bulletproof-javascript-benchmarks/ "Bulletproof JavaScript benchmarks") benchmarking library that works on nearly all JavaScript platforms<sup><a name="fnref1" href="#fn1">1</a></sup>, supports high-resolution timers, and returns statistically significant results. As seen on [jsPerf](http://jsperf.com/).
## Download
* [Development source](https://raw.github.com/bestiejs/benchmark.js/v1.0.0/benchmark.js)
## Dive in
Weve got [API docs](http://benchmarkjs.com/docs) and [unit tests](http://benchmarkjs.com/tests).
For a list of upcoming features, check out our [roadmap](https://github.com/bestiejs/benchmark.js/wiki/Roadmap).
## 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.
## Installation and usage
Benchmark.js only hard dependency is [Lo-Dash](http://lodash.com/).
In a browser:
```html
<script src="lodash.js"></script>
<script src="benchmark.js"></script>
```
Optionally, expose Javas nanosecond timer by adding the `nano` applet to the `<body>`:
```html
<applet code="nano" archive="nano.jar"></applet>
```
Or enable Chromes microsecond timer by using the [command line switch](http://peter.sh/experiments/chromium-command-line-switches/#enable-benchmarking):
--enable-benchmarking
Via [npm](http://npmjs.org/):
```bash
npm install benchmark
```
In [Node.js](http://nodejs.org/) and [RingoJS v0.8.0+](http://ringojs.org/):
```js
var Benchmark = require('benchmark');
```
Optionally, use the [microtime module](https://github.com/wadey/node-microtime) by Wade Simmons:
```bash
npm install microtime
```
In [RingoJS v0.7.0-](http://ringojs.org/):
```js
var Benchmark = require('benchmark').Benchmark;
```
In [Rhino](http://www.mozilla.org/rhino/):
```js
load('benchmark.js');
```
In an AMD loader like [RequireJS](http://requirejs.org/):
```js
require({
'paths': {
'benchmark': 'path/to/benchmark',
'lodash': 'path/to/lodash',
'platform': 'path/to/platform'
}
},
['benchmark'], function(Benchmark) {
console.log(Benchmark.platform.name);
});
```
Usage example:
```js
var suite = new Benchmark.Suite;
// add tests
suite.add('RegExp#test', function() {
/o/.test('Hello World!');
})
.add('String#indexOf', function() {
'Hello World!'.indexOf('o') > -1;
})
// add listeners
.on('cycle', function(event) {
console.log(String(event.target));
})
.on('complete', function() {
console.log('Fastest is ' + _.pluck(this.filter('fastest'), 'name'));
})
// run async
.run({ 'async': true });
// logs:
// > RegExp#test x 4,161,532 +-0.99% (59 cycles)
// > String#indexOf x 6,139,623 +-1.00% (131 cycles)
// > Fastest is String#indexOf
```
## BestieJS
Benchmark.js is part of the BestieJS *"Best in Class"* module collection. This means we promote solid browser/environment support, ES5+ precedents, unit testing, and plenty of documentation.
## Authors
* [Mathias Bynens](http://mathiasbynens.be/)
[![twitter/mathias](http://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias "Follow @mathias on Twitter")
* [John-David Dalton](http://allyoucanleet.com/)
[![twitter/jdalton](http://gravatar.com/avatar/299a3d891ff1920b69c364d061007043?s=70)](https://twitter.com/jdalton "Follow @jdalton on Twitter")
## Contributors
* [Kit Cambridge](http://kitcambridge.github.com/)
[![twitter/kitcambridge](http://gravatar.com/avatar/6662a1d02f351b5ef2f8b4d815804661?s=70)](https://twitter.com/kitcambridge "Follow @kitcambridge on Twitter")

File diff suppressed because it is too large Load Diff

View File

@@ -1,24 +0,0 @@
Open Source Initiative OSI - The MIT License
http://www.opensource.org/licenses/mit-license.php
Copyright (c) 2010-2013 Brian Cavalier and John Hann
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View File

@@ -1,48 +0,0 @@
(function(){/*
MIT License (c) copyright 2010-2013 B Cavalier & J Hann MIT (c) copyright 2010-2013 B Cavalier & J Hann */
(function(d){function l(){}function k(b,e){return 0==U.call(b).indexOf("[object "+e)}function n(b){return b&&"/"==b.charAt(b.length-1)?b.substr(0,b.length-1):b}function h(b,e){var m,g,x,P;m=1;g=b;"."==g.charAt(0)&&(x=!0,g=g.replace(V,function(b,e,g,x){g&&m++;return x||""}));if(x){x=e.split("/");P=x.length-m;if(0>P)return b;x.splice(P,m);return x.concat(g||[]).join("/")}return g}function p(b){var e=b.indexOf("!");return{h:b.substr(e+1),e:0<=e&&b.substr(0,e)}}function v(){}function r(b,e){v.prototype=
b||Q;var m=new v;v.prototype=Q;for(var g in e)m[g]=e[g];return m}function z(){function b(b,e,m){g.push([b,e,m])}function e(b,e){for(var m,x=0;m=g[x++];)(m=m[b])&&m(e)}var m,g,x;m=this;g=[];x=function(m,f){b=m?function(b){b&&b(f)}:function(b,e){e&&e(f)};x=l;e(m?0:1,f);e=l;g=G};this.j=function(e,g,x){b(e,g,x);return m};this.g=function(b){m.I=b;x(!0,b)};this.d=function(b){m.Aa=b;x(!1,b)};this.G=function(b){e(2,b)}}function y(b){return b instanceof z||b instanceof t}function q(b,e,m,g){y(b)?b.j(e,m,g):
e(b)}function w(b,e,m){var g;return function(){0<=--b&&e&&(g=e.apply(G,arguments));0==b&&m&&m(g);return g}}function c(){var b,e;b=[].slice.call(arguments);k(b[0],"Object")&&(e=b.shift(),e=a(e));return new t(b[0],b[1],b[2],e)}function a(b,e,m){var g,x,a;if(b&&(u.V(b),f=u.b(b),"preloads"in b&&(g=new t(b.preloads,G,m,J,!0),u.C(function(){J=g})),a=(a=b.main)&&String(a).split(W)))return x=new z,x.j(e,m),b=a[1]?function(){new t([a[1]],x.g,x.d)}:x.d,new t([a[0]],x.g,b),x}function t(b,e,m,g,x){var s;s=u.k(f,
G,[].concat(b),x);this.then=this.j=b=function(b,e){q(s,function(e){b&&b.apply(G,e)},function(b){if(e)e(b);else throw b;});return this};this.next=function(b,e,g){return new t(b,e,g,s)};this.config=a;(e||m)&&b(e,m);u.C(function(){q(x||J,function(){q(g,function(){u.A(s)},m)})})}function A(b){var e,m;e=b.id;e==G&&(K!==G?K={M:"Multiple anonymous defines encountered"}:(e=u.ia())||(K=b));if(e!=G){m=E[e];e in E||(m=u.m(e,f),m=u.J(m.b,e),E[e]=m);if(!y(m))throw Error("duplicate define: "+e);m.na=!1;u.K(m,b)}}
function C(){var b=u.fa(arguments);A(b)}var f,B,F,H=d.document,D=H&&(H.head||H.getElementsByTagName("head")[0]),R=D&&D.getElementsByTagName("base")[0]||null,L={},M={},I={},s="addEventListener"in d?{}:{loaded:1,complete:1},Q={},U=Q.toString,G,E={},N={},J=!1,K,T=/^\/|^[^:]+:\/\//,V=/(\.)(\.?)(?:$|\/([^\.\/]+.*)?)/g,X=/\/\*[\s\S]*?\*\/|\/\/.*?[\n\r]/g,Y=/require\s*\(\s*(["'])(.*?[^\\])\1\s*\)|[^\\]?(["'])/g,W=/\s*,\s*/,S,u;u={t:function(b,e,m){var g;b=h(b,e);if("."==b.charAt(0))return b;g=p(b);b=(e=
g.e)||g.h;b in m.c&&(b=m.c[b].q||b);e&&(0>e.indexOf("/")&&!(e in m.c)&&(b=n(m.T)+"/"+e),b=b+"!"+g.h);return b},k:function(b,e,m,g){function x(e,g){var m,a;m=u.t(e,f.id,b);if(!g)return m;a=p(m);if(!a.e)return m;m=E[a.e];a.h="normalize"in m?m.normalize(a.h,x,f.b)||"":x(a.h);return a.e+"!"+a.h}function a(e,m,s){var c;c=m&&function(b){m.apply(G,b)};if(k(e,"String")){if(c)throw Error("require(id, callback) not allowed");s=x(e,!0);e=E[s];if(!(s in E))throw Error("Module not resolved: "+s);return(s=y(e)&&
e.a)||e}q(u.A(u.k(b,f.id,e,g)),c,s)}var f;f=new z;f.id=e||"";f.ja=g;f.L=m;f.b=b;f.s=a;a.toUrl=function(e){return u.m(x(e,!0),b).url};f.t=x;return f},J:function(b,e,m){var g,x,a;g=u.k(b,e,G,m);x=g.g;a=w(1,function(b){g.w=b;try{return u.aa(g)}catch(e){g.d(e)}});g.g=function(b){q(m||J,function(){x(E[g.id]=N[g.url]=a(b))})};g.N=function(b){q(m||J,function(){g.a&&(a(b),g.G(M))})};return g},Z:function(b,e,m,g){return u.k(b,m,G,g)},ha:function(b){return b.s},P:function(b){return b.a||(b.a={})},ga:function(b){var e=
b.B;e||(e=b.B={id:b.id,uri:u.Q(b),exports:u.P(b),config:function(){return b.b}},e.a=e.exports);return e},Q:function(b){return b.url||(b.url=u.u(b.s.toUrl(b.id),b.b))},V:function(b){var e,m,g,a,f;e="curl";m="define";g=a=d;if(b&&(f=b.overwriteApi||b.xa,e=b.apiName||b.pa||e,g=b.apiContext||b.oa||g,m=b.defineName||b.ta||m,a=b.defineContext||b.sa||a,B&&k(B,"Function")&&(d.curl=B),B=null,F&&k(F,"Function")&&(d.define=F),F=null,!f)){if(g[e]&&g[e]!=c)throw Error(e+" already exists");if(a[m]&&a[m]!=C)throw Error(m+
" already exists");}g[e]=c;a[m]=C},b:function(b){function e(b,e){var m,g,f,c,d;for(d in b){f=b[d];k(f,"String")&&(f={path:b[d]});f.name=f.name||d;c=a;g=p(n(f.name));m=g.h;if(g=g.e)c=s[g],c||(c=s[g]=r(a),c.c=r(a.c),c.f=[]),delete b[d];g=f;var l=e,q=void 0;g.path=n(g.path||g.location||"");l&&(q=g.main||"./main","."==q.charAt(0)||(q="./"+q),g.q=h(q,g.name+"/"));g.b=g.config;g.b&&(g.b=r(a,g.b));g.W=m.split("/").length;m?(c.c[m]=g,c.f.push(m)):c.n=u.U(f.path,a)}}function m(b){var e=b.c;b.S=RegExp("^("+
b.f.sort(function(b,g){return e[g].W-e[b].W}).join("|").replace(/\/|\./g,"\\$&")+")(?=\\/|$)");delete b.f}var g,a,s,c;"baseUrl"in b&&(b.n=b.baseUrl);"main"in b&&(b.q=b.main);"preloads"in b&&(b.ya=b.preloads);"pluginPath"in b&&(b.T=b.pluginPath);if("dontAddFileExt"in b||b.l)b.l=RegExp(b.dontAddFileExt||b.l);g=f;a=r(g,b);a.c=r(g.c);s=b.plugins||{};a.plugins=r(g.plugins);a.F=r(g.F,b.F);a.D=r(g.D,b.D);a.f=[];e(b.packages,!0);e(b.paths,!1);for(c in s)b=u.t(c+"!","",a),a.plugins[b.substr(0,b.length-1)]=
s[c];s=a.plugins;for(c in s)if(s[c]=r(a,s[c]),b=s[c].f)s[c].f=b.concat(a.f),m(s[c]);for(c in g.c)a.c.hasOwnProperty(c)||a.f.push(c);m(a);return a},m:function(b,e){var a,g,c,s;a=e.c;c=T.test(b)?b:b.replace(e.S,function(b){g=a[b]||{};s=g.b;return g.path||""});return{b:s||f,url:u.U(c,e)}},U:function(b,e){var a=e.n;return a&&!T.test(b)?n(a)+"/"+b:b},u:function(b,e){return b+((e||f).l.test(b)?"":".js")},p:function(b,e,a){var g=H.createElement("script");g.onload=g.onreadystatechange=function(a){a=a||d.event;
if("load"==a.type||s[g.readyState])delete I[b.id],g.onload=g.onreadystatechange=g.onerror="",e()};g.onerror=function(){a(Error("Syntax or http error: "+b.url))};g.type=b.r||"text/javascript";g.charset="utf-8";g.async=!b.R;g.src=b.url;I[b.id]=g;D.insertBefore(g,R);return g},O:function(b){var e=[],a;("string"==typeof b?b:b.toSource?b.toSource():b.toString()).replace(X,"").replace(Y,function(b,f,c,s){s?a=a==s?G:a:a||e.push(c);return""});return e},fa:function(b){var e,a,g,f,c,s;c=b.length;g=b[c-1];f=
k(g,"Function")?g.length:-1;2==c?k(b[0],"Array")?a=b[0]:e=b[0]:3==c&&(e=b[0],a=b[1]);!a&&0<f&&(s=!0,a=["require","exports","module"].slice(0,f).concat(u.O(g)));return{id:e,w:a||[],H:0<=f?g:function(){return g},v:s}},aa:function(b){var e;e=b.H.apply(b.v?b.a:G,b.w);e===G&&b.a&&(e=b.B?b.a=b.B.a:b.a);return e},K:function(b,e){b.H=e.H;b.v=e.v;b.L=e.w;u.A(b)},A:function(b){function e(b,e,a){s[e]=b;a&&k(b,e)}function a(e,g){var f,c,s,m;f=w(1,function(b){c(b);p(b,g)});c=w(1,function(b){k(b,g)});s=u.ca(e,
b);(m=y(s)&&s.a)&&c(m);q(s,f,b.d,b.a&&function(b){s.a&&(b==L?c(s.a):b==M&&f(s.a))})}function g(){b.g(s)}var f,c,s,d,h,k,p;s=[];c=b.L;d=c.length;0==c.length&&g();k=w(d,e,function(){b.N&&b.N(s)});p=w(d,e,g);for(f=0;f<d;f++)h=c[f],h in S?(p(S[h](b),f,!0),b.a&&b.G(L)):h?a(h,f):p(G,f,!0);return b},da:function(b){u.Q(b);u.p(b,function(){var e=K;K=G;!1!==b.na&&(!e||e.M?b.d(Error(e&&e.M||"define() missing or duplicated: "+b.url)):u.K(b,e))},b.d);return b},ca:function(b,e){var a,g,s,c,d,h,k,l,n,r,t,B;a=e.t;
g=e.ja;s=e.b||f;d=a(b);d in E?h=d:(c=p(d),l=c.h,h=c.e||l,n=u.m(h,s));if(!(d in E))if(B=u.m(l,s).b,c.e)k=h;else if(k=B.moduleLoader||B.wa||B.loader||B.va)l=h,h=k,n=u.m(k,s);h in E?r=E[h]:n.url in N?r=E[h]=N[n.url]:(r=u.J(B,h,g),r.url=u.u(n.url,n.b),E[h]=N[n.url]=r,u.da(r));h==k&&(c.e&&s.plugins[c.e]&&(B=s.plugins[c.e]),t=new z,q(r,function(b){var e,c,s;s=b.dynamic;l="normalize"in b?b.normalize(l,a,r.b)||"":a(l);c=k+"!"+l;e=E[c];if(!(c in E)){e=u.Z(B,c,l,g);s||(E[c]=e);var f=function(b){s||(E[c]=b);
e.g(b)};f.resolve=f;f.reject=f.error=e.d;b.load(l,e.s,f,B)}t!=e&&q(e,t.g,t.d,t.G)},t.d));return t||r},ia:function(){var b;if(!k(d.opera,"Opera"))for(var e in I)if("interactive"==I[e].readyState){b=e;break}return b},ea:function(b){var e=0,a,c;for(a=H&&(H.scripts||H.getElementsByTagName("script"));a&&(c=a[e++]);)if(b(c))return c},ba:function(b){var e;(e=u.ea(function(e){if(e=e.getAttribute("data-curl-run"))b.q=e;return e}))&&e.setAttribute("data-curl-run","");return b},C:function(b){setTimeout(b,0)}};
S={require:u.ha,exports:u.P,module:u.ga};c.version="0.8.1";c.config=a;C.amd={plugins:!0,jQuery:!0,curl:"0.8.1"};f={n:"",T:"curl/plugin",l:/\?|\.js\b/,F:{},D:{},plugins:{},c:{},S:/$^/};f=u.ba(f);B=d.curl;F=d.define;B&&k(B,"Object")||f.q?(d.curl=G,a(B||f)):u.V();E.curl=c;E["curl/_privileged"]={core:u,cache:E,config:function(){return f},_define:A,_curl:c,Promise:z}})(this.window||"undefined"!=typeof global&&global||this);
(function(d,l){function k(){if(!l.body)return!1;C||(C=l.createTextNode(""));try{return l.body.removeChild(l.body.appendChild(C)),C=A,!0}catch(a){return!1}}function n(){var f;f=v[l[p]]&&k();if(!y&&f){y=!0;for(clearTimeout(t);c=a.pop();)c();z&&(l[p]="complete");for(var h;h=r.shift();)h()}return f}function h(){n();y||(t=setTimeout(h,q))}var p="readyState",v={loaded:1,interactive:1,complete:1},r=[],z=l&&"string"!=typeof l[p],y=!1,q=10,w,c,a=[],t,A,C;w="addEventListener"in d?function(a,c){a.addEventListener(c,
n,!1);return function(){a.removeEventListener(c,n,!1)}}:function(a,c){a.attachEvent("on"+c,n);return function(){a.detachEvent(c,n)}};l&&!n()&&(a=[w(d,"load"),w(l,"readystatechange"),w(d,"DOMContentLoaded")],t=setTimeout(h,q));define("curl/domReady",function(){function a(c){y?c():r.push(c)}a.then=a;a.amd=!0;return a})})(this,this.document);var O;
(function(d,l){define("curl/shim/dojo18",["curl/_privileged"],function(k){function n(a){a.has||(a.has=c);a.on||(a.on=p);a.idle||(a.idle=h);a.async=!0}function h(){for(var a in r)if(r[a]instanceof z)return!1;return!0}function p(){}var v,r,z,y;v=k._curl;r=k.cache;z=k.Promise;y=k.core.k;var q,w,c;q=k.b().ua||{};w=l&&l.createElement("div");c=function(a){return"function"==typeof q[a]?q[a]=q[a](d,l,w):q[a]};c.add=function(a,h,d,k){if(void 0===q[a]||k)q[a]=h;if(d)return c(a)};q["dojo-loader"]=!1;r["dojo/_base/loader"]=
0;"undefined"==typeof O&&(n(v),O=v);k.core.k=function(){var a=y.apply(this,arguments);n(a.s);return a};return!0})})("object"==typeof global?global:this.window||this.global,"object"==typeof document&&document);
(function(d,l,k){define("curl/plugin/js",["curl/_privileged"],function(d){function h(c,a,h){function l(){f||(p<new Date?h():setTimeout(l,10))}var p,f,r;p=(new Date).valueOf()+(c.ma||3E5);h&&c.a&&setTimeout(l,10);r=d.core.p(c,function(){f=!0;c.a&&(c.I=k(c.a));!c.a||c.I?a(r):h()},function(a){f=!0;h(a)})}function p(c,a){h(c,function(){var h=r.shift();q=0<r.length;h&&p.apply(null,h);a.g(c.I||!0)},function(c){a.d(c)})}var v={},r=[],z=l&&!0==l.createElement("script").async,y,q,w=/\?|\.js\b/;y=d.Promise;
return{dynamic:!0,normalize:function(c,a){var h=c.indexOf("!");return 0<=h?a(c.substr(0,h))+c.substr(h):a(c)},load:function(c,a,d,k){function l(a){(d.error||function(a){throw a;})(a)}var f,n,F,H,D;f=0<c.indexOf("!order");n=c.indexOf("!exports=");F=0<n?c.substr(n+9):k.a;H="prefetch"in k?k.prefetch:!0;c=f||0<n?c.substr(0,c.indexOf("!")):c;n=(n=k.dontAddFileExt||k.l)?RegExp(n):w;D=a.toUrl(c);n.test(D)||(D=D.lastIndexOf(".")<=D.lastIndexOf("/")?D+".js":D);D in v?v[D]instanceof y?v[D].j(d,l):d(v[D]):(c=
{name:c,url:D,R:f,a:F,ma:k.timeout},v[D]=a=new y,a.j(function(a){v[D]=a;d(a)},l),f&&!z&&q?(r.push([c,a]),H&&(c.r="text/cache",h(c,function(a){a&&a.parentNode.removeChild(a)},function(){}),c.r="")):(q=q||f,p(c,a)))},cramPlugin:"../cram/js"}})})(this,this.document,function(d){try{return eval(d)}catch(l){}});
define("curl/plugin/_fetchText",[],function(){var d,l;l=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"];d=function(){if("undefined"!==typeof XMLHttpRequest)d=function(){return new XMLHttpRequest};else for(var k=d=function(){throw Error("getXhr(): XMLHttpRequest not available");};0<l.length&&d===k;)(function(k){try{new ActiveXObject(k),d=function(){return new ActiveXObject(k)}}catch(h){}})(l.shift());return d()};return function(k,l,h){var p=d();p.open("GET",k,!0);p.onreadystatechange=function(){4===
p.readyState&&(400>p.status?l(p.responseText):h(Error("fetchText() failed. status: "+p.statusText)))};p.send(null)}});define("curl/plugin/text",["./_fetchText"],function(d){function l(d){throw d;}return{normalize:function(d,l){return d?l(d.split("!")[0]):d},load:function(k,n,h){d(n.toUrl(k),h,h.error||l)},cramPlugin:"../cram/text"}});
define("curl/plugin/async",function(){return{load:function(d,l,k){function n(h){"function"==typeof k.error&&k.error(h)}l([d],function(h){"function"==typeof h.j?h.j(function(d){0==arguments.length&&(d=h);k(d)},n):k(h)},k.error||function(h){throw h;})},analyze:function(d,l,k){k(d)}}});
(function(d){function l(){var a;a=f[A]("link");a.rel="stylesheet";a.type="text/css";return a}function k(a,c){a.onload=function(){I.load=I.load||!0;c()}}function n(a,c){a.onerror=function(){I.error=I.error||!0;c()}}function h(a,c,f){D.push({url:a,X:c,$:function(){f(Error(M))}});(a=v())&&p(a)}function p(a){var c,f;c=D.shift();f=a.styleSheet;c?(a.onload=function(){c.X(c.la);p(a)},a.onerror=function(){c.$();p(a)},c.la=f.imports[f.addImport(c.url)]):(a.onload=a.onerror=t,H.push(a))}function v(){var a;
a=H.shift();!a&&F.length<R&&(a=f.createElement("style"),F.push(a),B.appendChild(a));return a}function r(a){var c,h,d;if(!a.href||f.readyState&&"complete"!=f.readyState)return!1;c=!1;try{if(h=a.sheet)d=h.cssRules,c=null===d,!c&&d&&(h.insertRule("-curl-css-test {}",0),h.deleteRule(0),c=!0)}catch(k){c="[object Opera]"!=Object.prototype.toString.call(window.opera)&&/security|denied/i.test(k.message)}return c}function z(a,c,f){I.load||(r(a)?f(a.sheet):a.onload==t||!a.onload||C(function(){z(a,c,f)},c))}
function y(a,f,h){function d(){a.onload!=t&&a.onload&&(a.onload=a.onerror=t,c(function(){h(a.sheet)}))}k(a,d);z(a,f,d)}function q(a,c){n(a,function(){a.onload!=t&&a.onload&&(a.onload=a.onerror=t,c(Error(M)))})}function w(a,c,f,h){var d;d=l();y(d,h,c);q(d,f);d.href=a;B.appendChild(d)}function c(a){function c(){f.readyState&&"complete"!=f.readyState?C(c,10):a()}c()}function a(a){return a.lastIndexOf(".")<=a.lastIndexOf("/")?a+".css":a}function t(){}var A="createElement",C=d.setTimeout,f=d.document,
B;d=f&&f.createStyleSheet&&!(10<=f.documentMode);var F=[],H=[],D=[],R=12,L,M="HTTP or network error.",I={};f&&(B=f.head||f.getElementsByTagName("head")[0],L=d?h:w);define("curl/plugin/css",{normalize:function(a,c){var f,h;if(!a)return a;f=a.split(",");h=[];for(var d=0,k=f.length;d<k;d++)h.push(c(f[d]));return h.join(",")},load:function(c,f,h,d){function k(a){1<n.length&&p.push(a);0==--w&&h(1==n.length?a:p)}function r(a){(h.d||function(a){throw a;})(a)}var p,n,q,w,F;p=[];n=(c||"").split(",");q=d.cssWatchPeriod||
50;d=d.cssNoWait;w=n.length;for(F=0;F<n.length;F++){c=n[F];var t;c=a(f.toUrl(c));d?(t=l(),t.href=c,B.appendChild(t),k(t.sheet||t.styleSheet)):L(c,k,r,q)}},cramPlugin:"../cram/css"})})(this);
(function(d){var l=d.document,k=/^\/\//,n;l&&(n=l.head||(l.head=l.getElementsByTagName("head")[0]));define("curl/plugin/link",{load:function(d,p,v,r){d=p.toUrl(d);d=d.lastIndexOf(".")<=d.lastIndexOf("/")?d+".css":d;r=d=(r="fixSchemalessUrls"in r?r.fixSchemalessUrls:l.location.protocol)?d.replace(k,r+"//"):d;d=l.createElement("link");d.rel="stylesheet";d.type="text/css";d.href=r;n.appendChild(d);v(d.sheet||d.styleSheet)}})})(this);
define("curl/plugin/domReady",["../domReady"],function(d){return{load:function(l,k,n){d(n)}}});(function(d){define("curl/shim/_fetchText",function(){function l(d,h,k){n.za(d,function(d,l){d?k(d):h(l.toString())})}function k(d,k,l){var n;d=p.parse(d,!1,!0);n="";h.get(d,function(d){d.i("data",function(c){n+=c}).i("end",function(){k(n)}).i("error",l)}).i("error",l)}var n,h,p;n=d("fs");h=d("http");p=d("url");var v;v=/^https?:/;return function(d,h,n){v.test(d)?k(d,h,n):l(d,h,n)}})})(O);define.amd.Ca=!0;
(function(d,l){define("curl/shim/ssjs",["curl/_privileged","./_fetchText"],function(k,n){function h(a,c,d){try{l(a.url),c()}catch(f){d(f)}}function p(a,c,f){var h;try{h=a.url.replace(/\.js$/,""),d(h),c()}catch(k){f(k)}}function v(a,c,f){var h;a=d("url").parse(a.url,!1,!0);h="";A.get(a,function(a){a.i("data",function(a){h+=a}).i("end",function(){z(h);c()}).i("error",f)}).i("error",f)}function r(a){throw Error("ssjs: unable to load module in current environment: "+a.url);}function z(a){eval(a)}function y(c){return c&&
c.replace(a,function(a,c){return c})}var q,w,c,a,t,A,C,f;if("object"!=typeof window||!window.ra&&!window.navigator){q=k.qa;w=k.b();c=/^\w+:\/\//;a=/(^\w+:)?.*$/;"undefined"==typeof XMLHttpRequest&&(q["curl/plugin/_fetchText"]=n);t=(w.o&&":"!=w.o[w.o.length-1]?w.o+":":w.o)||y(w.n)||"http:";if(l)C=f=h;else if(d){C=p;try{A=d("http"),f=v}catch(B){f=r}}else C=f=r;"object"===typeof process&&process.ka&&(k.Y.C=process.ka);k.Y.p=function(a,d,h){/^\/\//.test(a.url)&&(a.url=t+a.url);return c.test(a.url)?f(a,
d,h):C(a,d,h)}}})})(O,void 0);
(function(d,l,k){define("curl/loader/cjsm11",["../plugin/_fetchText","curl/_privileged"],function(d,h){function p(d,c){p="text"in d?function(a,c){a.text=c}:function(a,c){a.appendChild(l.createTextNode(c))};p(d,c)}function v(d,c,a){a=a?"/*\n////@ sourceURL="+a.replace(/\s/g,"%20")+".js\n*/":"";return"define('"+c+"',['require','exports','module'],function(require,exports,module){"+d+"\n});\n"+a+"\n"}var r,z,y,q;z=(r=l&&(l.head||l.getElementsByTagName("head")[0]))&&r.getElementsByTagName("base")[0]||null;
y=h.core.O;q=h.core.u;v.load=function(h,c,a,t){var A,C,f;A=a.error||function(a){throw a;};C=q(c.Ea(h),t);f=!1!==t.injectSourceUrl&&C;d(C,function(d){var n;n=y(d);c(n,function(){d=v(d,h,f);if(t.injectScript){var n=d,q=l.createElement("script");p(q,n);q.charset="utf-8";r.insertBefore(q,z)}else k(d);a(c(h))},A)},A)};v.cramPlugin="../cram/cjsm11";return v})})(this,this.document,function(d){eval(d)});
define("curl/plugin/locale",function(){function d(d,h){var k;if(d&&(k=d.locale,"function"==typeof k&&(k=k(d,h)),"string"==typeof k))return k;if("undefined"==typeof window)return!1;k=window.clientInformation||window.navigator;return(k&&(k.language||k.userLanguage)||"").toLowerCase()}function l(d,h){return d.replace(k,(h?"/"+h:"")+"$&")}var k;k=/(\.js)?$/;d.toModuleId=l;d.load=function(k,h,p,v){function r(){var c=Error("Unable to find correct locale for "+k);if(p.error)p.error(c);else throw c;}var z,
y;z=d(v,k);y=v.localeToModuleId||l;v=z?y(k,z):k;try{p(h(v))}catch(q){y=z?y(k,!1):k;if(y==v)return r();try{p(h(y))}catch(w){if(!0!==z)return r();h(["i18n!"+k],p,r)}}};return d});
define("curl/plugin/i18n",["./locale"],function(d){function l(d,l,h,p,v){d([l],function(d){p(d,h)},v)}return{load:function(k,n,h,p){function v(a,c){w[c]=a;r()}function r(){var d;if(++c==a.length)if(0==w.length)z(Error('No i18n bundles found: "'+k+'", locale "'+q+'"'));else{d=w[0]||{};for(A=1;A<w.length;A++){var f=w[A],l={},n=void 0;for(n in d)l[n]=d[n];if(f)for(n in f)l[n]=f[n];d=l}h(d)}}var z,y,q,w,c,a,t,A;z=h.error;k||z(Error("blank i18n bundle id."));y=p.localeToModuleId||d.Da;q=d(p,k);a=[k];w=
[];c=0;if(q&&!1!==p.locale)for(a=a.concat(q.split("-")),t=[],A=1;A<a.length;A++)t[A-1]=a[A],p=y(k,t.join("-")),l(n,p,A,v,r);l(n,k,0,v,r)},cramPlugin:"../cram/i18n"}});
(function(d,l,k){define("curl/loader/legacy",["curl/_privileged"],function(n){var h,p,v;h=l&&!0==l.createElement("script").async;p=n.core.p;v=/\?|\.js\b/;return{load:function(l,n,y,q){function w(){B.r="";p(B,c,a)}function c(){var c;if(!(0<--F)){if(A)try{c=A.call(d,l)}catch(f){a(Error("Factory for legacy "+l+" failed: "+f.message))}else try{c=k(t)}catch(h){a(Error("Failed to find exports "+t+" for legacy "+l))}y(c)}}function a(a){(y.error||function(a){throw a;})(a)}var t,A,C,f,B,F;t=q.exports||q.a;
A=q.factory||q.factory;if(!t&&!A)throw Error("`exports` or `factory` required for legacy: "+l);C=[].concat(q.requires||q.Ba||[]);q=(q=q.dontAddFileExt||q.l)?RegExp(q):v;f=n.toUrl(l);q.test(f)||(f=f.lastIndexOf(".")<=f.lastIndexOf("/")?f+".js":f);B={url:f,R:!0,r:h||!C.length?"":"text/cache"};C.length?(F=2,n(C,h?c:w,a)):F=1;p(B,c,a)},cramPlugin:"../cram/legacy"}})})(this,this.document,function(d){return(0,eval)(d)});
}).call(this);

33
vendor/docdown/README.md vendored Normal file
View File

@@ -0,0 +1,33 @@
# Docdown <sup>v1.0.0</sup>
A simple JSDoc to Markdown documentation generator.
## Documentation
The documentation for Docdown can be viewed here: [/doc/README.md](https://github.com/jdalton/docdown/blob/master/doc/README.md#readme)
For a list of upcoming features, check out our [roadmap](https://github.com/jdalton/docdown/wiki/Roadmap).
## Installation and usage
Usage example:
```php
require("docdown.php");
// generate Markdown
$markdown = docdown(array(
"path" => $filepath,
"url" => "https://github.com/username/project/blob/master/my.js"
));
```
## Author
* [John-David Dalton](http://allyoucanleet.com/)
[![twitter/jdalton](http://gravatar.com/avatar/299a3d891ff1920b69c364d061007043?s=70)](https://twitter.com/jdalton "Follow @jdalton on Twitter")
## Contributors
* [Mathias Bynens](http://mathiasbynens.be/)
[![twitter/mathias](http://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias "Follow @mathias on Twitter")

View File

@@ -4,13 +4,13 @@
* Copyright 2011-2013 John-David Dalton <http://allyoucanleet.com/>
* Available under MIT license <http://mths.be/mit>
*/
require(dirname(__FILE__) . '/src/DocDown/MarkdownGenerator.php');
require(dirname(__FILE__) . '/src/DocDown/Generator.php');
/**
* Generates Markdown from JSDoc entries in a given file.
*
* @param {Array} [$options=array()] The options array.
* @returns {string} The generated Markdown.
* @returns {String} The generated Markdown.
* @example
*
* // specify a file path
@@ -32,7 +32,7 @@ require(dirname(__FILE__) . '/src/DocDown/MarkdownGenerator.php');
* ));
*/
function docdown( $options = array() ) {
$gen = new MarkdownGenerator($options);
$gen = new Generator($options);
return $gen->generate();
}
?>

View File

@@ -19,7 +19,7 @@ class Alias {
* The Alias constructor.
*
* @constructor
* @param {string} $name The alias name.
* @param {String} $name The alias name.
* @param {Object} $owner The alias owner.
*/
public function __construct( $name, $owner ) {
@@ -47,8 +47,8 @@ class Alias {
* Extracts the entry's `alias` objects.
*
* @memberOf Alias
* @param {number} $index The index of the array value to return.
* @returns {Array|string} The entry's `alias` objects.
* @param {Number} $index The index of the array value to return.
* @returns {Array|String} The entry's `alias` objects.
*/
public function getAliases( $index = null ) {
$result = array();
@@ -61,7 +61,7 @@ class Alias {
* Extracts the function call from the owner entry.
*
* @memberOf Alias
* @returns {string} The function call.
* @returns {String} The function call.
*/
public function getCall() {
return $this->_call;
@@ -71,7 +71,7 @@ class Alias {
* Extracts the owner entry's `category` data.
*
* @memberOf Alias
* @returns {string} The owner entry's `category` data.
* @returns {String} The owner entry's `category` data.
*/
public function getCategory() {
return $this->_category;
@@ -81,7 +81,7 @@ class Alias {
* Extracts the owner entry's description.
*
* @memberOf Alias
* @returns {string} The owner entry's description.
* @returns {String} The owner entry's description.
*/
public function getDesc() {
return $this->_desc;
@@ -91,7 +91,7 @@ class Alias {
* Extracts the owner entry's `example` data.
*
* @memberOf Alias
* @returns {string} The owner entry's `example` data.
* @returns {String} The owner entry's `example` data.
*/
public function getExample() {
return $this->_example;
@@ -101,7 +101,7 @@ class Alias {
* Checks if the entry is an alias.
*
* @memberOf Alias
* @returns {boolean} Returns `true`.
* @returns {Boolean} Returns `true`.
*/
public function isAlias() {
return true;
@@ -111,7 +111,7 @@ class Alias {
* Checks if the owner entry is a constructor.
*
* @memberOf Alias
* @returns {boolean} Returns `true` if a constructor, else `false`.
* @returns {Boolean} Returns `true` if a constructor, else `false`.
*/
public function isCtor() {
return $this->_isCtor;
@@ -121,7 +121,7 @@ class Alias {
* Checks if the owner entry is a license.
*
* @memberOf Alias
* @returns {boolean} Returns `true` if a license, else `false`.
* @returns {Boolean} Returns `true` if a license, else `false`.
*/
public function isLicense() {
return $this->_isLicense;
@@ -131,7 +131,7 @@ class Alias {
* Checks if the owner entry *is* assigned to a prototype.
*
* @memberOf Alias
* @returns {boolean} Returns `true` if assigned to a prototype, else `false`.
* @returns {Boolean} Returns `true` if assigned to a prototype, else `false`.
*/
public function isPlugin() {
return $this->_isPlugin;
@@ -141,7 +141,7 @@ class Alias {
* Checks if the owner entry is private.
*
* @memberOf Alias
* @returns {boolean} Returns `true` if private, else `false`.
* @returns {Boolean} Returns `true` if private, else `false`.
*/
public function isPrivate() {
return $this->_isPrivate;
@@ -151,7 +151,7 @@ class Alias {
* Checks if the owner entry is *not* assigned to a prototype.
*
* @memberOf Alias
* @returns {boolean} Returns `true` if not assigned to a prototype, else `false`.
* @returns {Boolean} Returns `true` if not assigned to a prototype, else `false`.
*/
public function isStatic() {
return $this->_isStatic;
@@ -161,7 +161,7 @@ class Alias {
* Resolves the owner entry's line number.
*
* @memberOf Alias
* @returns {number} The owner entry's line number.
* @returns {Number} The owner entry's line number.
*/
public function getLineNumber() {
return $this->_lineNumber;
@@ -171,8 +171,8 @@ class Alias {
* Extracts the owner entry's `member` data.
*
* @memberOf Alias
* @param {number} $index The index of the array value to return.
* @returns {Array|string} The owner entry's `member` data.
* @param {Number} $index The index of the array value to return.
* @returns {Array|String} The owner entry's `member` data.
*/
public function getMembers( $index = null ) {
return $index !== null
@@ -184,7 +184,7 @@ class Alias {
* Extracts the owner entry's `name` data.
*
* @memberOf Alias
* @returns {string} The owner entry's `name` data.
* @returns {String} The owner entry's `name` data.
*/
public function getName() {
return $this->_name;
@@ -194,7 +194,7 @@ class Alias {
* Extracts the owner entry's `param` data.
*
* @memberOf Alias
* @param {number} $index The index of the array value to return.
* @param {Number} $index The index of the array value to return.
* @returns {Array} The owner entry's `param` data.
*/
public function getParams( $index = null ) {
@@ -207,7 +207,7 @@ class Alias {
* Extracts the owner entry's `returns` data.
*
* @memberOf Alias
* @returns {string} The owner entry's `returns` data.
* @returns {String} The owner entry's `returns` data.
*/
public function getReturns() {
return $this->_returns;
@@ -217,7 +217,7 @@ class Alias {
* Extracts the owner entry's `type` data.
*
* @memberOf Alias
* @returns {string} The owner entry's `type` data.
* @returns {String} The owner entry's `type` data.
*/
public function getType() {
return $this->_type;

View File

@@ -11,7 +11,7 @@ class Entry {
* The documentation entry.
*
* @memberOf Entry
* @type string
* @type String
*/
public $entry = '';
@@ -19,7 +19,7 @@ class Entry {
* The language highlighter used for code examples.
*
* @memberOf Entry
* @type string
* @type String
*/
public $lang = '';
@@ -27,7 +27,7 @@ class Entry {
* The source code.
*
* @memberOf Entry
* @type string
* @type String
*/
public $source = '';
@@ -37,9 +37,9 @@ class Entry {
* The Entry constructor.
*
* @constructor
* @param {string} $entry The documentation entry to analyse.
* @param {string} $source The source code.
* @param {string} [$lang ='js'] The language highlighter used for code examples.
* @param {String} $entry The documentation entry to analyse.
* @param {String} $source The source code.
* @param {String} [$lang ='js'] The language highlighter used for code examples.
*/
public function __construct( $entry, $source, $lang = 'js' ) {
$this->entry = $entry;
@@ -54,11 +54,11 @@ class Entry {
*
* @static
* @memberOf Entry
* @param {string} $source The source code.
* @param {String} $source The source code.
* @returns {Array} The array of entries.
*/
public static function getEntries( $source ) {
preg_match_all('#/\*\*(?![-!])[\s\S]*?\*/\s*.+#', $source, $result);
preg_match_all('#/\*\*(?![-!])[\s\S]*?\*/\s*[^\n]+#', $source, $result);
return array_pop($result);
}
@@ -69,7 +69,7 @@ class Entry {
*
* @private
* @memberOf Entry
* @returns {boolean} Returns `true` if the entry is a function reference, else `false`.
* @returns {Boolean} Returns `true` if the entry is a function reference, else `false`.
*/
private function isFunction() {
if (!isset($this->_isFunction)) {
@@ -77,7 +77,7 @@ class Entry {
$this->isCtor() ||
count($this->getParams()) ||
count($this->getReturns()) ||
preg_match('/\*[\t ]*@function\b/', $this->entry)
preg_match('/\* *@function\b/', $this->entry)
);
}
return $this->_isFunction;
@@ -89,15 +89,15 @@ class Entry {
* Extracts the entry's `alias` objects.
*
* @memberOf Entry
* @param {number} $index The index of the array value to return.
* @returns {Array|string} The entry's `alias` objects.
* @param {Number} $index The index of the array value to return.
* @returns {Array|String} The entry's `alias` objects.
*/
public function getAliases( $index = null ) {
if (!isset($this->_aliases)) {
preg_match('#\*[\t ]*@alias\s+(.+)#', $this->entry, $result);
preg_match('#\* *@alias\s+([^\n]+)#', $this->entry, $result);
if (count($result)) {
$result = trim(preg_replace('/(?:^|\n)[\t ]*\*[\t ]?/', ' ', $result[1]));
$result = trim(preg_replace('/(?:^|\n)\s*\* ?/', ' ', $result[1]));
$result = preg_split('/,\s*/', $result);
natsort($result);
@@ -116,7 +116,7 @@ class Entry {
* Extracts the function call from the entry.
*
* @memberOf Entry
* @returns {string} The function call.
* @returns {String} The function call.
*/
public function getCall() {
if (isset($this->_call)) {
@@ -129,7 +129,7 @@ class Entry {
}
// resolve name
// avoid $this->getName() because it calls $this->getCall()
preg_match('#\*[\t ]*@name\s+(.+)#', $this->entry, $name);
preg_match('#\* *@name\s+([^\n]+)#', $this->entry, $name);
if (count($name)) {
$name = trim($name[1]);
} else {
@@ -140,15 +140,12 @@ class Entry {
// compose parts
$result = array($result);
$params = $this->getParams();
foreach ($params as $param) {
// skip params that are properties of other params (e.g. `options.leading`)
if (!preg_match('/\w+\.[\w.]+\s*=/', $param[1])) {
$result[] = $param[1];
}
$result[] = $param[1];
}
// format
$result = $name .'('. implode(array_slice($result, 1), ', ') .')';
$result = str_replace(', [', ' [, ', str_replace('], [', ', ', $result));
}
$this->_call = $result ? $result : $name;
@@ -159,16 +156,16 @@ class Entry {
* Extracts the entry's `category` data.
*
* @memberOf Entry
* @returns {string} The entry's `category` data.
* @returns {String} The entry's `category` data.
*/
public function getCategory() {
if (isset($this->_category)) {
return $this->_category;
}
preg_match('#\*[\t ]*@category\s+(.+)#', $this->entry, $result);
preg_match('#\* *@category\s+([^\n]+)#', $this->entry, $result);
if (count($result)) {
$result = trim(preg_replace('/(?:^|\n)[\t ]*\*[\t ]?/', ' ', $result[1]));
$result = trim(preg_replace('/(?:^|\n)\s*\* ?/', ' ', $result[1]));
} else {
$result = $this->getType() == 'Function' ? 'Methods' : 'Properties';
}
@@ -180,7 +177,7 @@ class Entry {
* Extracts the entry's description.
*
* @memberOf Entry
* @returns {string} The entry's description.
* @returns {String} The entry's description.
*/
public function getDesc() {
if (isset($this->_desc)) {
@@ -190,9 +187,9 @@ class Entry {
preg_match('#/\*\*(?:\s*\*)?([\s\S]*?)(?=\*\s\@[a-z]|\*/)#', $this->entry, $result);
if (count($result)) {
$type = $this->getType();
$result = preg_replace('/:\n[\t ]*\*[\t ]*/', ":<br>\n", $result[1]);
$result = preg_replace('/(?:^|\n)[\t ]*\*\n[\t ]*\*[\t ]*/', "\n\n", $result);
$result = preg_replace('/(?:^|\n)[\t ]*\*[\t ]?/', ' ', $result);
$result = preg_replace('/:\n *\* */', ":<br>\n", $result[1]);
$result = preg_replace('/(?:^|\n) *\*\n *\* */', "\n\n", $result);
$result = preg_replace('/(?:^|\n) *\* ?/', ' ', $result);
$result = trim($result);
$result = ($type == 'Function' ? '' : '(' . str_replace('|', ', ', trim($type, '{}')) . '): ') . $result;
}
@@ -204,16 +201,16 @@ class Entry {
* Extracts the entry's `example` data.
*
* @memberOf Entry
* @returns {string} The entry's `example` data.
* @returns {String} The entry's `example` data.
*/
public function getExample() {
if (isset($this->_example)) {
return $this->_example;
}
preg_match('#\*[\t ]*@example\s+([\s\S]*?)(?=\*\s\@[a-z]|\*/)#', $this->entry, $result);
preg_match('#\* *@example\s+([\s\S]*?)(?=\*\s\@[a-z]|\*/)#', $this->entry, $result);
if (count($result)) {
$result = trim(preg_replace('/(?:^|\n)[\t ]*\*[\t ]?/', "\n", $result[1]));
$result = trim(preg_replace('/(?:^|\n)\s*\* ?/', "\n", $result[1]));
$result = '```' . $this->lang . "\n" . $result . "\n```";
}
$this->_example = $result;
@@ -224,7 +221,7 @@ class Entry {
* Checks if the entry is an alias.
*
* @memberOf Entry
* @returns {boolean} Returns `false`.
* @returns {Boolean} Returns `false`.
*/
public function isAlias() {
return false;
@@ -234,11 +231,11 @@ class Entry {
* Checks if the entry is a constructor.
*
* @memberOf Entry
* @returns {boolean} Returns `true` if a constructor, else `false`.
* @returns {Boolean} Returns `true` if a constructor, else `false`.
*/
public function isCtor() {
if (!isset($this->_isCtor)) {
$this->_isCtor = !!preg_match('/\*[\t ]*@constructor\b/', $this->entry);
$this->_isCtor = !!preg_match('/\* *@constructor\b/', $this->entry);
}
return $this->_isCtor;
}
@@ -247,11 +244,11 @@ class Entry {
* Checks if the entry is a license.
*
* @memberOf Entry
* @returns {boolean} Returns `true` if a license, else `false`.
* @returns {Boolean} Returns `true` if a license, else `false`.
*/
public function isLicense() {
if (!isset($this->_isLicense)) {
$this->_isLicense = !!preg_match('/\*[\t ]*@license\b/', $this->entry);
$this->_isLicense = !!preg_match('/\* *@license\b/', $this->entry);
}
return $this->_isLicense;
}
@@ -260,7 +257,7 @@ class Entry {
* Checks if the entry *is* assigned to a prototype.
*
* @memberOf Entry
* @returns {boolean} Returns `true` if assigned to a prototype, else `false`.
* @returns {Boolean} Returns `true` if assigned to a prototype, else `false`.
*/
public function isPlugin() {
if (!isset($this->_isPlugin)) {
@@ -273,11 +270,11 @@ class Entry {
* Checks if the entry is private.
*
* @memberOf Entry
* @returns {boolean} Returns `true` if private, else `false`.
* @returns {Boolean} Returns `true` if private, else `false`.
*/
public function isPrivate() {
if (!isset($this->_isPrivate)) {
$this->_isPrivate = $this->isLicense() || !!preg_match('/\*[\t ]*@private\b/', $this->entry) || !preg_match('/\*[\t ]*@[a-z]+\b/', $this->entry);
$this->_isPrivate = $this->isLicense() || !!preg_match('/\* *@private\b/', $this->entry) || !preg_match('/\* *@[a-z]+\b/', $this->entry);
}
return $this->_isPrivate;
}
@@ -286,7 +283,7 @@ class Entry {
* Checks if the entry is *not* assigned to a prototype.
*
* @memberOf Entry
* @returns {boolean} Returns `true` if not assigned to a prototype, else `false`.
* @returns {Boolean} Returns `true` if not assigned to a prototype, else `false`.
*/
public function isStatic() {
if (isset($this->_isStatic)) {
@@ -294,7 +291,7 @@ class Entry {
}
$public = !$this->isPrivate();
$result = $public && !!preg_match('/\*[\t ]*@static\b/', $this->entry);
$result = $public && !!preg_match('/\* *@static\b/', $this->entry);
// set in cases where it isn't explicitly stated
if ($public && !$result) {
@@ -318,7 +315,7 @@ class Entry {
* Resolves the entry's line number.
*
* @memberOf Entry
* @returns {number} The entry's line number.
* @returns {Number} The entry's line number.
*/
public function getLineNumber() {
if (!isset($this->_lineNumber)) {
@@ -332,14 +329,14 @@ class Entry {
* Extracts the entry's `member` data.
*
* @memberOf Entry
* @param {number} $index The index of the array value to return.
* @returns {Array|string} The entry's `member` data.
* @param {Number} $index The index of the array value to return.
* @returns {Array|String} The entry's `member` data.
*/
public function getMembers( $index = null ) {
if (!isset($this->_members)) {
preg_match('#\*[\t ]*@member(?:Of)?\s+(.+)#', $this->entry, $result);
preg_match('#\* *@member(?:Of)?\s+([^\n]+)#', $this->entry, $result);
if (count($result)) {
$result = trim(preg_replace('/(?:^|\n)[\t ]*\*[\t ]?/', ' ', $result[1]));
$result = trim(preg_replace('/(?:^|\n)\s*\* ?/', ' ', $result[1]));
$result = preg_split('/,\s*/', $result);
natsort($result);
}
@@ -354,16 +351,16 @@ class Entry {
* Extracts the entry's `name` data.
*
* @memberOf Entry
* @returns {string} The entry's `name` data.
* @returns {String} The entry's `name` data.
*/
public function getName() {
if (isset($this->_name)) {
return $this->_name;
}
preg_match('#\*[\t ]*@name\s+(.+)#', $this->entry, $result);
preg_match('#\* *@name\s+([^\n]+)#', $this->entry, $result);
if (count($result)) {
$result = trim(preg_replace('/(?:^|\n)[\t ]*\*[\t ]?/', ' ', $result[1]));
$result = trim(preg_replace('/(?:^|\n)\s*\* ?/', ' ', $result[1]));
} else {
$result = array_shift(explode('(', $this->getCall()));
}
@@ -375,26 +372,23 @@ class Entry {
* Extracts the entry's `param` data.
*
* @memberOf Entry
* @param {number} $index The index of the array value to return.
* @param {Number} $index The index of the array value to return.
* @returns {Array} The entry's `param` data.
*/
public function getParams( $index = null ) {
if (!isset($this->_params)) {
preg_match_all('#\*[\t ]*@param\s+\{\(?([^})]+)\)?\}\s+(\[.+\]|[$\w|]+(?:\[.+\])?)\s+([\s\S]*?)(?=\*\s\@[a-z]|\*/)#i', $this->entry, $matchTuples);
$matchTuples = array_filter(array_slice($matchTuples, 1));
$result = array();
if (count($matchTuples)) {
foreach ($matchTuples as $tupleKey => $tuple) {
foreach ($tuple as $key => $value) {
if (!isset($result[$key])) {
$result[$key] = array();
preg_match_all('#\* *@param\s+\{([^}]+)\}\s+(\[.+\]|[$\w|]+(?:\[.+\])?)\s+([\s\S]*?)(?=\*\s\@[a-z]|\*/)#i', $this->entry, $result);
if (count($result = array_filter(array_slice($result, 1)))) {
// repurpose array
foreach ($result as $param) {
foreach ($param as $key => $value) {
if (!is_array($result[0][$key])) {
$result[0][$key] = array();
}
$result[$key][] = $tupleKey
? trim(preg_replace('/(?:^|\n)[\t ]*\*[\t ]*/', ' ', $value))
: trim($value);
$result[0][$key][] = trim(preg_replace('/(?:^|\n)\s*\* */', ' ', $value));
}
}
$result = $result[0];
}
$this->_params = $result;
}
@@ -407,18 +401,18 @@ class Entry {
* Extracts the entry's `returns` data.
*
* @memberOf Entry
* @returns {string} The entry's `returns` data.
* @returns {String} The entry's `returns` data.
*/
public function getReturns() {
if (isset($this->_returns)) {
return $this->_returns;
}
preg_match('#\*[\t ]*@returns\s+\{([^}]+)\}\s+([\s\S]*?)(?=\*\s\@[a-z]|\*/)#', $this->entry, $result);
preg_match('#\* *@returns\s+\{([^}]+)\}\s+([\s\S]*?)(?=\*\s\@[a-z]|\*/)#', $this->entry, $result);
if (count($result)) {
$result = array_map('trim', array_slice($result, 1));
$result[0] = str_replace('|', ', ', $result[0]);
$result[1] = preg_replace('/(?:^|\n)[\t ]*\*[\t ]?/', ' ', $result[1]);
$result[1] = preg_replace('/(?:^|\n)\s*\* ?/', ' ', $result[1]);
}
$this->_returns = $result;
return $result;
@@ -428,21 +422,18 @@ class Entry {
* Extracts the entry's `type` data.
*
* @memberOf Entry
* @returns {string} The entry's `type` data.
* @returns {String} The entry's `type` data.
*/
public function getType() {
if (isset($this->_type)) {
return $this->_type;
}
preg_match('#\*[\t ]*@type\s(?:\{\(?)?([^)}\n]+)#', $this->entry, $result);
preg_match('#\* *@type\s+([^\n]+)#', $this->entry, $result);
if (count($result)) {
$result = trim($result[1]);
if (preg_match('/^(?:array|function|object|regexp)$/', $result)) {
$result = ucfirst($result);
}
$result = trim(preg_replace('/(?:^|\n)\s*\* ?/', ' ', $result[1]));
} else {
$result = $this->isFunction() ? 'Function' : 'unknown';
$result = $this->isFunction() ? 'Function' : 'Unknown';
}
$this->_type = $result;
return $result;

View File

@@ -5,21 +5,21 @@ require(dirname(__FILE__) . "/Entry.php");
/**
* Generates Markdown from JSDoc entries.
*/
class MarkdownGenerator {
class Generator {
/**
* The HTML for the close tag.
*
* @static
* @memberOf MarkdownGenerator
* @type string
* @memberOf Generator
* @type String
*/
public $closeTag = "\n<!-- /div -->\n";
/**
* An array of JSDoc entries.
*
* @memberOf MarkdownGenerator
* @memberOf Generator
* @type Array
*/
public $entries = array();
@@ -28,15 +28,15 @@ class MarkdownGenerator {
* The HTML for the open tag.
*
* @static
* @memberOf MarkdownGenerator
* @type string
* @memberOf Generator
* @type String
*/
public $openTag = "\n<!-- div -->\n";
/**
* An options array used to configure the generator.
*
* @memberOf MarkdownGenerator
* @memberOf Generator
* @type Array
*/
public $options = array();
@@ -44,18 +44,18 @@ class MarkdownGenerator {
/**
* The file's source code.
*
* @memberOf MarkdownGenerator
* @type string
* @memberOf Generator
* @type String
*/
public $source = '';
/*--------------------------------------------------------------------------*/
/**
* The MarkdownGenerator constructor.
* The Generator constructor.
*
* @constructor
* @param {string} $source The source code to parse.
* @param {String} $source The source code to parse.
* @param {Array} $options The options array.
*/
public function __construct( $source, $options = array() ) {
@@ -103,9 +103,9 @@ class MarkdownGenerator {
*
* @private
* @static
* @memberOf MarkdownGenerator
* @param {string} $string The string to format.
* @returns {string} The formatted string.
* @memberOf Generator
* @param {String} $string The string to format.
* @returns {String} The formatted string.
*/
private static function format( $string ) {
$counter = 0;
@@ -121,7 +121,7 @@ class MarkdownGenerator {
$string = preg_replace('/(^|\s)(\([^)]+\))/', '$1*$2*', $string);
// mark numbers as inline code
$string = preg_replace('/[\t ](-?\d+(?:.\d+)?)(?!\.[^\n])/', ' `$1`', $string);
$string = preg_replace('/ (-?\d+(?:.\d+)?)(?!\.[^\n])/', ' `$1`', $string);
// detokenize inline code snippets
$counter = 0;
@@ -137,23 +137,23 @@ class MarkdownGenerator {
*
* @private
* @static
* @memberOf MarkdownGenerator
* @param {string} $string The string to modify.
* @memberOf Generator
* @param {String} $string The string to modify.
* @param {Array|Object} $object The template object.
* @returns {string} The modified string.
* @returns {String} The modified string.
*/
private static function interpolate( $string, $object ) {
preg_match_all('/#\{([^}]+)\}/', $string, $tokens);
$tokens = array_unique(array_pop($tokens));
foreach ($tokens as $token) {
$pattern = '/#\{' . preg_replace('/([.*+?^${}()|[\]\\\])/', '\\\$1', $token) . '\}/';
$pattern = '/#\{' . $token . '\}/';
$replacement = '';
if (is_object($object)) {
preg_match('/\(([^)]+?)\)$/', $token, $args);
$args = preg_split('/,\s*/', array_pop($args));
$method = 'get' . ucfirst(preg_replace('/\([^)]+?\)$/', '', $token));
$method = 'get' . ucfirst(str_replace('/\([^)]+?\)$/', '', $token));
if (method_exists($object, $method)) {
$replacement = (string) call_user_func_array(array($object, $method), $args);
@@ -165,7 +165,7 @@ class MarkdownGenerator {
}
$string = preg_replace($pattern, trim($replacement), $string);
}
return MarkdownGenerator::format($string);
return Generator::format($string);
}
/*--------------------------------------------------------------------------*/
@@ -174,7 +174,7 @@ class MarkdownGenerator {
* Adds the given `$entries` to the `$result` array.
*
* @private
* @memberOf MarkdownGenerator
* @memberOf Generator
* @param {Array} $result The result array to modify.
* @param {Array} $entries The entries to add to the `$result`.
*/
@@ -188,14 +188,14 @@ class MarkdownGenerator {
array_push(
$result,
$this->openTag,
MarkdownGenerator::interpolate("### <a id=\"#{hash}\"></a>`#{member}#{separator}#{call}`\n<a href=\"##{hash}\">#</a> [&#x24C8;](#{href} \"View in source\") [&#x24C9;][1]\n\n#{desc}", $entry)
Generator::interpolate("### <a id=\"#{hash}\"></a>`#{member}#{separator}#{call}`\n<a href=\"##{hash}\">#</a> [&#x24C8;](#{href} \"View in source\") [&#x24C9;][1]\n\n#{desc}", $entry)
);
// @alias
if (count($aliases = $entry->getAliases())) {
array_push($result, '', '#### Aliases');
foreach ($aliases as $index => $alias) {
$aliases[$index] = MarkdownGenerator::interpolate('#{member}#{separator}#{name}', $alias);
$aliases[$index] = $alias->getName();
}
$result[] = '*' . implode(', ', $aliases) . '*';
}
@@ -203,11 +203,11 @@ class MarkdownGenerator {
if (count($params = $entry->getParams())) {
array_push($result, '', '#### Arguments');
foreach ($params as $index => $param) {
$result[] = MarkdownGenerator::interpolate('#{num}. `#{name}` (#{type}): #{desc}', array(
$result[] = Generator::interpolate('#{num}. `#{name}` (#{type}): #{desc}', array(
'desc' => $param[2],
'name' => $param[1],
'num' => $index + 1,
'type' => preg_replace('/(?<!\\\)(\*)/', '\\\$1', $param[0])
'type' => $param[0]
));
}
}
@@ -216,10 +216,7 @@ class MarkdownGenerator {
array_push(
$result, '',
'#### Returns',
MarkdownGenerator::interpolate('(#{type}): #{desc}', array(
'desc' => $returns[1],
'type' => preg_replace('/(?<!\\\)(\*)/', '\\\$1', $returns[0])
))
Generator::interpolate('(#{type}): #{desc}', array('desc' => $returns[1], 'type' => $returns[0]))
);
}
// @example
@@ -234,18 +231,17 @@ class MarkdownGenerator {
* Resolves the entry's hash used to navigate the documentation.
*
* @private
* @memberOf MarkdownGenerator
* @param {number|Object} $entry The entry object.
* @param {string} $member The name of the member.
* @returns {string} The url hash.
* @memberOf Generator
* @param {Number|Object} $entry The entry object.
* @param {String} $member The name of the member.
* @returns {String} The url hash.
*/
private function getHash( $entry, $member = '' ) {
$entry = is_numeric($entry) ? $this->entries[$entry] : $entry;
$member = !$member ? $entry->getMembers(0) : $member;
$result = ($member ? $member . ($entry->isPlugin() ? 'prototype' : '') : '') . $entry->getCall();
$result = preg_replace('/\(\[|\[\]/', '', $result);
$result = preg_replace('/[\t =|\'"{}.()\]]/', '', $result);
$result = preg_replace('/[ =|\'"{}.()\]]/', '', $result);
$result = preg_replace('/[[#,]/', '-', $result);
return strtolower($result);
}
@@ -254,9 +250,9 @@ class MarkdownGenerator {
* Resolves the entry's url for the specific line number.
*
* @private
* @memberOf MarkdownGenerator
* @param {number|Object} $entry The entry object.
* @returns {string} The url.
* @memberOf Generator
* @param {Number|Object} $entry The entry object.
* @returns {String} The url.
*/
private function getLineUrl( $entry ) {
$entry = is_numeric($entry) ? $this->entries($entry) : $entry;
@@ -267,9 +263,9 @@ class MarkdownGenerator {
* Extracts the character used to separate the entry's name from its member.
*
* @private
* @memberOf MarkdownGenerator
* @param {number|Object} $entry The entry object.
* @returns {string} The separator.
* @memberOf Generator
* @param {Number|Object} $entry The entry object.
* @returns {String} The separator.
*/
private function getSeparator( $entry ) {
$entry = is_numeric($entry) ? $this->entries($entry) : $entry;
@@ -281,8 +277,8 @@ class MarkdownGenerator {
/**
* Generates Markdown from JSDoc entries.
*
* @memberOf MarkdownGenerator
* @returns {string} The rendered Markdown.
* @memberOf Generator
* @returns {String} The rendered Markdown.
*/
public function generate() {
$api = array();
@@ -325,7 +321,9 @@ class MarkdownGenerator {
$api[$member] = $entry;
foreach ($entry->getAliases() as $alias) {
$api[$member]->static[] = $alias;
$api[$member] = $alias;
$alias->static = array();
$alias->plugin = array();
}
}
else if ($entry->isStatic()) {
@@ -349,7 +347,7 @@ class MarkdownGenerator {
$entry->href = $this->getLineUrl($entry);
$member = $entry->getMembers(0);
$member = ($member ? $member . $this->getSeparator($entry) : '') . $entry->getName();
$member = ($member ? $member . ($entry->isPlugin() ? '.prototype.' : '.') : '') . $entry->getName();
$entry->member = preg_replace('/' . $entry->getName() . '$/', '', $member);
// add properties to static and plugin sub-entries
@@ -457,7 +455,7 @@ class MarkdownGenerator {
);
// add entries
foreach ($entries as $entry) {
$result[] = MarkdownGenerator::interpolate('* [`#{member}#{separator}#{name}`](##{hash})', $entry);
$result[] = Generator::interpolate('* [`#{member}#{separator}#{name}`](##{hash})', $entry);
}
}
}
@@ -479,7 +477,7 @@ class MarkdownGenerator {
array_push(
$result,
$openTag, '## ' . (count($result) == 2 ? '<a id="' . $toc . '"></a>' : '') . '`' . $member . '`',
MarkdownGenerator::interpolate('* [`' . $member . '`](##{hash})', $entry)
Generator::interpolate('* [`' . $member . '`](##{hash})', $entry)
);
// add static and plugin sub-entries
@@ -494,7 +492,7 @@ class MarkdownGenerator {
}
foreach ($entry->{$kind} as $subentry) {
$subentry->member = $member;
$result[] = MarkdownGenerator::interpolate('* [`#{member}#{separator}#{name}`](##{hash})', $subentry);
$result[] = Generator::interpolate('* [`#{member}#{separator}#{name}`](##{hash})', $subentry);
}
}
}
@@ -561,7 +559,7 @@ class MarkdownGenerator {
array_push($result, $closeTag, $closeTag, '', ' [1]: #' . $toc . ' "Jump back to the TOC."');
// cleanup whitespace
return trim(preg_replace('/[\t ]+\n/', "\n", join($result, "\n")));
return trim(preg_replace('/ +\n/', "\n", join($result, "\n")));
}
}
?>

195
vendor/dojo/LICENSE vendored
View File

@@ -1,195 +0,0 @@
Dojo is available under *either* the terms of the modified BSD license *or* the
Academic Free License version 2.1. As a recipient of Dojo, you may choose which
license to receive this code under (except as noted in per-module LICENSE
files). Some modules may not be the copyright of the Dojo Foundation. These
modules contain explicit declarations of copyright in both the LICENSE files in
the directories in which they reside and in the code itself. No external
contributions are allowed under licenses which are fundamentally incompatible
with the AFL or BSD licenses that Dojo is distributed under.
The text of the AFL and BSD licenses is reproduced below.
-------------------------------------------------------------------------------
The "New" BSD License:
**********************
Copyright (c) 2005-2013, The Dojo Foundation
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of the Dojo Foundation nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-------------------------------------------------------------------------------
The Academic Free License, v. 2.1:
**********************************
This Academic Free License (the "License") applies to any original work of
authorship (the "Original Work") whose owner (the "Licensor") has placed the
following notice immediately following the copyright notice for the Original
Work:
Licensed under the Academic Free License version 2.1
1) Grant of Copyright License. Licensor hereby grants You a world-wide,
royalty-free, non-exclusive, perpetual, sublicenseable license to do the
following:
a) to reproduce the Original Work in copies;
b) to prepare derivative works ("Derivative Works") based upon the Original
Work;
c) to distribute copies of the Original Work and Derivative Works to the
public;
d) to perform the Original Work publicly; and
e) to display the Original Work publicly.
2) Grant of Patent License. Licensor hereby grants You a world-wide,
royalty-free, non-exclusive, perpetual, sublicenseable license, under patent
claims owned or controlled by the Licensor that are embodied in the Original
Work as furnished by the Licensor, to make, use, sell and offer for sale the
Original Work and Derivative Works.
3) Grant of Source Code License. The term "Source Code" means the preferred
form of the Original Work for making modifications to it and all available
documentation describing how to modify the Original Work. Licensor hereby
agrees to provide a machine-readable copy of the Source Code of the Original
Work along with each copy of the Original Work that Licensor distributes.
Licensor reserves the right to satisfy this obligation by placing a
machine-readable copy of the Source Code in an information repository
reasonably calculated to permit inexpensive and convenient access by You for as
long as Licensor continues to distribute the Original Work, and by publishing
the address of that information repository in a notice immediately following
the copyright notice that applies to the Original Work.
4) Exclusions From License Grant. Neither the names of Licensor, nor the names
of any contributors to the Original Work, nor any of their trademarks or
service marks, may be used to endorse or promote products derived from this
Original Work without express prior written permission of the Licensor. Nothing
in this License shall be deemed to grant any rights to trademarks, copyrights,
patents, trade secrets or any other intellectual property of Licensor except as
expressly stated herein. No patent license is granted to make, use, sell or
offer to sell embodiments of any patent claims other than the licensed claims
defined in Section 2. No right is granted to the trademarks of Licensor even if
such marks are included in the Original Work. Nothing in this License shall be
interpreted to prohibit Licensor from licensing under different terms from this
License any Original Work that Licensor otherwise would have a right to
license.
5) This section intentionally omitted.
6) Attribution Rights. You must retain, in the Source Code of any Derivative
Works that You create, all copyright, patent or trademark notices from the
Source Code of the Original Work, as well as any notices of licensing and any
descriptive text identified therein as an "Attribution Notice." You must cause
the Source Code for any Derivative Works that You create to carry a prominent
Attribution Notice reasonably calculated to inform recipients that You have
modified the Original Work.
7) Warranty of Provenance and Disclaimer of Warranty. Licensor warrants that
the copyright in and to the Original Work and the patent rights granted herein
by Licensor are owned by the Licensor or are sublicensed to You under the terms
of this License with the permission of the contributor(s) of those copyrights
and patent rights. Except as expressly stated in the immediately proceeding
sentence, the Original Work is provided under this License on an "AS IS" BASIS
and WITHOUT WARRANTY, either express or implied, including, without limitation,
the warranties of NON-INFRINGEMENT, MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY OF THE ORIGINAL WORK IS WITH YOU.
This DISCLAIMER OF WARRANTY constitutes an essential part of this License. No
license to Original Work is granted hereunder except under this disclaimer.
8) Limitation of Liability. Under no circumstances and under no legal theory,
whether in tort (including negligence), contract, or otherwise, shall the
Licensor be liable to any person for any direct, indirect, special, incidental,
or consequential damages of any character arising as a result of this License
or the use of the Original Work including, without limitation, damages for loss
of goodwill, work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses. This limitation of liability shall not
apply to liability for death or personal injury resulting from Licensor's
negligence to the extent applicable law prohibits such limitation. Some
jurisdictions do not allow the exclusion or limitation of incidental or
consequential damages, so this exclusion and limitation may not apply to You.
9) Acceptance and Termination. If You distribute copies of the Original Work or
a Derivative Work, You must make a reasonable effort under the circumstances to
obtain the express assent of recipients to the terms of this License. Nothing
else but this License (or another written agreement between Licensor and You)
grants You permission to create Derivative Works based upon the Original Work
or to exercise any of the rights granted in Section 1 herein, and any attempt
to do so except under the terms of this License (or another written agreement
between Licensor and You) is expressly prohibited by U.S. copyright law, the
equivalent laws of other countries, and by international treaty. Therefore, by
exercising any of the rights granted to You in Section 1 herein, You indicate
Your acceptance of this License and all of its terms and conditions.
10) Termination for Patent Action. This License shall terminate automatically
and You may no longer exercise any of the rights granted to You by this License
as of the date You commence an action, including a cross-claim or counterclaim,
against Licensor or any licensee alleging that the Original Work infringes a
patent. This termination provision shall not apply for an action alleging
patent infringement by combinations of the Original Work with other software or
hardware.
11) Jurisdiction, Venue and Governing Law. Any action or suit relating to this
License may be brought only in the courts of a jurisdiction wherein the
Licensor resides or in which Licensor conducts its primary business, and under
the laws of that jurisdiction excluding its conflict-of-law provisions. The
application of the United Nations Convention on Contracts for the International
Sale of Goods is expressly excluded. Any use of the Original Work outside the
scope of this License or after its termination shall be subject to the
requirements and penalties of the U.S. Copyright Act, 17 U.S.C. § 101 et
seq., the equivalent laws of other countries, and international treaty. This
section shall survive the termination of this License.
12) Attorneys Fees. In any action to enforce the terms of this License or
seeking damages relating thereto, the prevailing party shall be entitled to
recover its costs and expenses, including, without limitation, reasonable
attorneys' fees and costs incurred in connection with such action, including
any appeal of such action. This section shall survive the termination of this
License.
13) Miscellaneous. This License represents the complete agreement concerning
the subject matter hereof. If any provision of this License is held to be
unenforceable, such provision shall be reformed only to the extent necessary to
make it enforceable.
14) Definition of "You" in This License. "You" throughout this License, whether
in upper or lower case, means an individual or a legal entity exercising rights
under, and complying with all of the terms of, this License. For legal
entities, "You" includes any entity that controls, is controlled by, or is
under common control with you. For purposes of this definition, "control" means
(i) the power, direct or indirect, to cause the direction or management of such
entity, whether by contract or otherwise, or (ii) ownership of fifty percent
(50%) or more of the outstanding shares, or (iii) beneficial ownership of such
entity.
15) Right to Use. You may use the Original Work in all ways not otherwise
restricted or conditioned by this License or by law, and Licensor promises not
to interfere with or be responsible for such uses by You.
This license is Copyright (C) 2003-2004 Lawrence E. Rosen. All rights reserved.
Permission is hereby granted to copy and distribute this license without
modification. This license may not be modified without the express written
permission of its copyright owner.

1997
vendor/dojo/dojo.js vendored

File diff suppressed because it is too large Load Diff

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

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

Before

Width:  |  Height:  |  Size: 43 B

After

Width:  |  Height:  |  Size: 43 B

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

Before

Width:  |  Height:  |  Size: 167 B

After

Width:  |  Height:  |  Size: 167 B

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

Before

Width:  |  Height:  |  Size: 171 B

After

Width:  |  Height:  |  Size: 171 B

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

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

Before

Width:  |  Height:  |  Size: 655 B

After

Width:  |  Height:  |  Size: 655 B

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

Before

Width:  |  Height:  |  Size: 586 B

After

Width:  |  Height:  |  Size: 586 B

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

Before

Width:  |  Height:  |  Size: 340 B

After

Width:  |  Height:  |  Size: 340 B

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

Before

Width:  |  Height:  |  Size: 543 B

After

Width:  |  Height:  |  Size: 543 B

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

Before

Width:  |  Height:  |  Size: 344 B

After

Width:  |  Height:  |  Size: 344 B

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

Before

Width:  |  Height:  |  Size: 512 B

After

Width:  |  Height:  |  Size: 512 B

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

Before

Width:  |  Height:  |  Size: 637 B

After

Width:  |  Height:  |  Size: 637 B

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

Before

Width:  |  Height:  |  Size: 543 B

After

Width:  |  Height:  |  Size: 543 B

0
vendor/firebug-lite/skin/xp/downHover.png vendored Executable file → Normal 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 Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 447 B

After

Width:  |  Height:  |  Size: 447 B

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

Before

Width:  |  Height:  |  Size: 365 B

After

Width:  |  Height:  |  Size: 365 B

0
vendor/firebug-lite/skin/xp/errorIcon.png vendored Executable file → Normal 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 Executable file → Normal file
View File

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

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

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

0
vendor/firebug-lite/skin/xp/firebug.png vendored Executable file → Normal 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 Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 158 B

After

Width:  |  Height:  |  Size: 158 B

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

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

Before

Width:  |  Height:  |  Size: 359 B

After

Width:  |  Height:  |  Size: 359 B

0
vendor/firebug-lite/skin/xp/infoIcon.png vendored Executable file → Normal 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 Executable file → Normal 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 Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 552 B

After

Width:  |  Height:  |  Size: 552 B

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

Before

Width:  |  Height:  |  Size: 485 B

After

Width:  |  Height:  |  Size: 485 B

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

Before

Width:  |  Height:  |  Size: 742 B

After

Width:  |  Height:  |  Size: 742 B

0
vendor/firebug-lite/skin/xp/offHover.png vendored Executable file → Normal 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 Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 43 B

After

Width:  |  Height:  |  Size: 43 B

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

Before

Width:  |  Height:  |  Size: 228 B

After

Width:  |  Height:  |  Size: 228 B

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

Before

Width:  |  Height:  |  Size: 550 B

After

Width:  |  Height:  |  Size: 550 B

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

Before

Width:  |  Height:  |  Size: 685 B

After

Width:  |  Height:  |  Size: 685 B

0
vendor/firebug-lite/skin/xp/shadow.gif vendored Executable file → Normal 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 Executable file → Normal 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 Executable file → Normal 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 Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 39 KiB

After

Width:  |  Height:  |  Size: 39 KiB

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

Before

Width:  |  Height:  |  Size: 438 B

After

Width:  |  Height:  |  Size: 438 B

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

Before

Width:  |  Height:  |  Size: 261 B

After

Width:  |  Height:  |  Size: 261 B

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

Before

Width:  |  Height:  |  Size: 436 B

After

Width:  |  Height:  |  Size: 436 B

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

Before

Width:  |  Height:  |  Size: 449 B

After

Width:  |  Height:  |  Size: 449 B

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

Before

Width:  |  Height:  |  Size: 220 B

After

Width:  |  Height:  |  Size: 220 B

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

Before

Width:  |  Height:  |  Size: 207 B

After

Width:  |  Height:  |  Size: 207 B

Some files were not shown because too many files have changed in this diff Show More