diff --git a/StockManMVC/.bin/bower.cmd b/StockManMVC/.bin/bower.cmd new file mode 100644 index 0000000..814cf7b --- /dev/null +++ b/StockManMVC/.bin/bower.cmd @@ -0,0 +1,3 @@ +@echo off +SET PATH=%~dp0;%PATH% +"%~dp0node" "%~dp0..\..\packages\Bower.1.3.11\node_modules\bower\bin\bower" %* diff --git a/StockManMVC/.bin/bower_components/StockManMVC/.bower.json b/StockManMVC/.bin/bower_components/StockManMVC/.bower.json new file mode 100644 index 0000000..b4763e2 --- /dev/null +++ b/StockManMVC/.bin/bower_components/StockManMVC/.bower.json @@ -0,0 +1,23 @@ +{ + "name": "StockManMVC", + "version": "0.8.20", + "description": "Gestione Stock", + "authors": [ + "S.E.Locatelli" + ], + "license": "MIT", + "dependencies": { + "globalize": "^1.0.0" + }, + "ignore": [ + "**/.*", + "node_modules", + "bower_components", + "test", + "tests" + ], + "_source": "C:\\Users\\samuele.STEAMWAREWIN\\Documents\\VisualStudioProjects\\StockMan\\StockManMVC\\bower.json", + "_target": "*", + "_originalSource": "../bower.json", + "_direct": true +} \ No newline at end of file diff --git a/StockManMVC/.bin/bower_components/StockManMVC/bower.json b/StockManMVC/.bin/bower_components/StockManMVC/bower.json new file mode 100644 index 0000000..0b49d4c --- /dev/null +++ b/StockManMVC/.bin/bower_components/StockManMVC/bower.json @@ -0,0 +1,19 @@ +{ + "name": "StockManMVC", + "version": "0.8.20", + "description": "Gestione Stock", + "authors": [ + "S.E.Locatelli" + ], + "license": "MIT", + "dependencies": { + "globalize": "^1.0.0" + }, + "ignore": [ + "**/.*", + "node_modules", + "bower_components", + "test", + "tests" + ] +} diff --git a/StockManMVC/.bin/bower_components/cldr-data/.bower.json b/StockManMVC/.bin/bower_components/cldr-data/.bower.json new file mode 100644 index 0000000..2eebc6f --- /dev/null +++ b/StockManMVC/.bin/bower_components/cldr-data/.bower.json @@ -0,0 +1,30 @@ +{ + "name": "cldr-data", + "main": "index.json", + "version": "29.0.0", + "homepage": "https://github.com/rxaviers/cldr-data-bower", + "authors": [ + "Rafael Xavier de Souza " + ], + "description": "Bower module for Unicode CLDR JSON data", + "moduleType": [ + "amd", + "globals" + ], + "keywords": [ + "Unicode", + "CLDR", + "JSON", + "data" + ], + "license": "MIT", + "_release": "29.0.0", + "_resolution": { + "type": "version", + "tag": "29.0.0", + "commit": "2bbb69cc3d10d14b4d39d6359d0f56089166ac1f" + }, + "_source": "https://github.com/rxaviers/cldr-data-bower.git", + "_target": ">=25", + "_originalSource": "cldr-data" +} \ No newline at end of file diff --git a/StockManMVC/.bin/bower_components/cldr-data/DCO.md b/StockManMVC/.bin/bower_components/cldr-data/DCO.md new file mode 100644 index 0000000..69afd4b --- /dev/null +++ b/StockManMVC/.bin/bower_components/cldr-data/DCO.md @@ -0,0 +1,27 @@ +If you would like to make a contribution to cldr-data-bower, please certify to the following: + +--- + +cldr-data-bower Developer's Certificate of Origin. Version 1.0 + +By making a contribution to this project, I certify that: + +(a) The contribution was created in whole or in part by me and I have the right to submit it under the MIT license; or + +(b) The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate open source license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the MIT license; or + +(c) The contribution was provided directly to me by some other person who certified (a) or (b) and I have not modified it. + +(d) I understand and agree that this project and the contribution are public and that a record of the contribution (including all metadata and personal information I submit with it, including my sign-off) is maintained indefinitely and may be redistributed consistent with cldr-data-bower's policies and the requirements of the MIT license where they are relevant. + +(e) I am granting this work to this project under the terms of the [MIT license](http://opensource.org/licenses/MIT). + +--- + +And please confirm your certification to the above by adding the following line to your commit message: + + Signed-off-by: Jane Developer + +using your real name (sorry, no pseudonyms or anonymous contributions). Committing with `git commit -s` will add the sign-off at the end of the commit message for you. + +If you are a developer who is authorized to contribute to cldr-data-bower on behalf of your employer, then please use your corporate email address in the Signed-off-by tag. If not, then please use a personal email address. diff --git a/StockManMVC/.bin/bower_components/cldr-data/LICENSE-MIT b/StockManMVC/.bin/bower_components/cldr-data/LICENSE-MIT new file mode 100644 index 0000000..6db134a --- /dev/null +++ b/StockManMVC/.bin/bower_components/cldr-data/LICENSE-MIT @@ -0,0 +1,22 @@ +Copyright (c) 2013 Rafael Xavier de Souza http://rafael.xavier.blog.br + +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. diff --git a/StockManMVC/.bin/bower_components/cldr-data/README.md b/StockManMVC/.bin/bower_components/cldr-data/README.md new file mode 100644 index 0000000..0a915c4 --- /dev/null +++ b/StockManMVC/.bin/bower_components/cldr-data/README.md @@ -0,0 +1,139 @@ +# Bower's cldr-data + +Bower module for [Unicode CLDR JSON][] data. + +[Unicode CLDR JSON]: http://cldr.unicode.org/index/cldr-spec/json + +## Goal + +- Allow i18n libraries to define CLDR data as versioned "peer" dependency. +- Empower end applications the manage the final flatten CLDR data. +- Provide tools to assist (in other words, ease the pain) on fetching and + filtering the data. + +Bonus goals + +- Optimal for frontend development. (Backend, see [Npm's cldr-data][]). +- Optimal for AMD environment. (Node.js, see [Npm's cldr-data][]). + +[Npm's cldr-data]: https://github.com/rxaviers/cldr-data-npm + + +## Usage + +### End applications + +If you're writing an end application that depends on i18n libraries, which +in turn define their CLDR data dependency using bower's `cldr-data`, you need +to: + +1. List your i18n dependencies (obvious). +1. Setup a bower postinstall hook to populate the correct Unicode CLDR JSON data. + +On the `bower.json` of your application, list the i18n dependencies as you'd +normally do. For example, let's say they are FooNumberFormat and BarDateFormat. + +```javascript +"dependencies": { + "foo-number-format": "1.2.3", + "bar-date-format": "4.5.6" +} +``` + +If you don't have a `.bowerrc` file then create one. On your `.bowerrc` file, define script hooks to actually fetch the correct +Unicode CLDR JSON data for you. With this in place, when you enter `bower install` the lovely `cldr-data` will be included as part of the installation. + +**Important:** If you have already installed your bower dependencies prior to defining your `.bowerrc` hook then subsequently entering `bower install` *will not install `cldr-data`*. + +```javascript +{ + "scripts": { + "preinstall": "npm install cldr-data-downloader@0.2.x", + "postinstall": "node ./node_modules/cldr-data-downloader/bin/download.js -i bower_components/cldr-data/index.json -o bower_components/cldr-data/" + } +} +``` + +Unicode CLDR JSON data will be available at +`bower_components/cldr-data` (obviously, you can change that to your taste if +you want to). + +Note that if you use AMD, you can use the below in your application. + +```javascript +require.config({ + cldrData: "./bower_components/cldr-data", + json: "./bower_components/requirejs-plugins/src/json", + text: "./bower_components/requirejs-text/text" +}); + +require([ + "json!cldrData/main/en/numbers.json", + "json!cldrData/supplemental/likelySubtags.json", + ... +], function( enNumbers, likelySubtags, ... ) { + + // Your awesome application code goes here. + +}); +``` + +You can find more details (and give it a try) by switching to the +[Application Example][] branch. + +[Application Example]: https://github.com/rxaviers/cldr-data-bower/tree/example-application + +### I18n libraries + +If you own or develop an i18n library, your life just got better. :p + +On the `bower.json` of your i18n library, define its CLDR data dependency. + +```javascript +"dependencies": { + "cldr-data": ">=26" +} +``` + +That's it. End applications will now be able to provide your library the correct +version of CLDR data. For your convinience, use cldr-data in conjunction of +[cldr.js][]. + +You can find more details (and give it a try) by switching to the +[Foo Number Format Library Example][] branch. + +[cldr.js]: https://github.com/rxaviers/cldrjs +[Foo Number Format Library Example]: https://github.com/rxaviers/cldr-data-bower/tree/example-library-foo + +## How does it work? + +This bower module doesn't actually mirror any Unicode CLDR JSON data as you may +have already noticed. The only piece of information we carry is its zips URLs +(see `index.json`), which are necessary to fetch the data. In consequence, this +dependency gets really light and fast to be processed by bower. + +Each cldr-data-bower's `major.minor` version maps to a Unicode CLDR JSON with +the same number. For example, cldr-data-bower `26.0.0`, `26.0.1`, or `26.0.1` +all map to Unicode CLDR JSON `v26`. So, simply use major (and possibly minor, +e.g., 23.1) when defining it, e.g., `"cldr-data": ">=26"`. + +What really matters is that this approach allows bower to do its job, i.e., +dependency management. + +Exemplifying, an end application that depends on Foo (that depends on cldr-data +\>= 25) and Bar (that depends on cldr-data \>= 23.1), can use bower to install +and to flatten its `cldr-data` dependency. In this case, it's any version bigger +or equal to twenty five (>=25). + +At this point, bower installs the right `cldr-data` version into +`./bower_components/cldr-data`, which carries instructions on how to download +the CLDR JSON data. + +A postinstall script, like cldr-data-downloader, must be used to actually +populate the above skeleton. + +On any questions or problems, please file an issue. + +## License + +MIT © [Rafael Xavier de Souza](http://rafael.xavier.blog.br) diff --git a/StockManMVC/.bin/bower_components/cldr-data/bower.json b/StockManMVC/.bin/bower_components/cldr-data/bower.json new file mode 100644 index 0000000..a961029 --- /dev/null +++ b/StockManMVC/.bin/bower_components/cldr-data/bower.json @@ -0,0 +1,21 @@ +{ + "name": "cldr-data", + "main": "index.json", + "version": "29.0.0", + "homepage": "https://github.com/rxaviers/cldr-data-bower", + "authors": [ + "Rafael Xavier de Souza " + ], + "description": "Bower module for Unicode CLDR JSON data", + "moduleType": [ + "amd", + "globals" + ], + "keywords": [ + "Unicode", + "CLDR", + "JSON", + "data" + ], + "license": "MIT" +} diff --git a/StockManMVC/.bin/bower_components/cldr-data/index.json b/StockManMVC/.bin/bower_components/cldr-data/index.json new file mode 100644 index 0000000..dc4fcfc --- /dev/null +++ b/StockManMVC/.bin/bower_components/cldr-data/index.json @@ -0,0 +1,42 @@ +{ + "core": [ + "https://github.com/unicode-cldr/cldr-core/archive/29.0.0.zip", + "https://github.com/unicode-cldr/cldr-dates-modern/archive/29.0.0.zip", + "https://github.com/unicode-cldr/cldr-cal-buddhist-modern/archive/29.0.0.zip", + "https://github.com/unicode-cldr/cldr-cal-chinese-modern/archive/29.0.0.zip", + "https://github.com/unicode-cldr/cldr-cal-coptic-modern/archive/29.0.0.zip", + "https://github.com/unicode-cldr/cldr-cal-dangi-modern/archive/29.0.0.zip", + "https://github.com/unicode-cldr/cldr-cal-ethiopic-modern/archive/29.0.0.zip", + "https://github.com/unicode-cldr/cldr-cal-hebrew-modern/archive/29.0.0.zip", + "https://github.com/unicode-cldr/cldr-cal-indian-modern/archive/29.0.0.zip", + "https://github.com/unicode-cldr/cldr-cal-islamic-modern/archive/29.0.0.zip", + "https://github.com/unicode-cldr/cldr-cal-japanese-modern/archive/29.0.0.zip", + "https://github.com/unicode-cldr/cldr-cal-persian-modern/archive/29.0.0.zip", + "https://github.com/unicode-cldr/cldr-cal-roc-modern/archive/29.0.0.zip", + "https://github.com/unicode-cldr/cldr-localenames-modern/archive/29.0.0.zip", + "https://github.com/unicode-cldr/cldr-misc-modern/archive/29.0.0.zip", + "https://github.com/unicode-cldr/cldr-numbers-modern/archive/29.0.0.zip", + "https://github.com/unicode-cldr/cldr-segments-modern/archive/29.0.0.zip", + "https://github.com/unicode-cldr/cldr-units-modern/archive/29.0.0.zip" + ], + "full": [ + "https://github.com/unicode-cldr/cldr-core/archive/29.0.0.zip", + "https://github.com/unicode-cldr/cldr-segments-modern/archive/29.0.0.zip", + "https://github.com/unicode-cldr/cldr-dates-full/archive/29.0.0.zip", + "https://github.com/unicode-cldr/cldr-cal-buddhist-full/archive/29.0.0.zip", + "https://github.com/unicode-cldr/cldr-cal-chinese-full/archive/29.0.0.zip", + "https://github.com/unicode-cldr/cldr-cal-coptic-full/archive/29.0.0.zip", + "https://github.com/unicode-cldr/cldr-cal-dangi-full/archive/29.0.0.zip", + "https://github.com/unicode-cldr/cldr-cal-ethiopic-full/archive/29.0.0.zip", + "https://github.com/unicode-cldr/cldr-cal-hebrew-full/archive/29.0.0.zip", + "https://github.com/unicode-cldr/cldr-cal-indian-full/archive/29.0.0.zip", + "https://github.com/unicode-cldr/cldr-cal-islamic-full/archive/29.0.0.zip", + "https://github.com/unicode-cldr/cldr-cal-japanese-full/archive/29.0.0.zip", + "https://github.com/unicode-cldr/cldr-cal-persian-full/archive/29.0.0.zip", + "https://github.com/unicode-cldr/cldr-cal-roc-full/archive/29.0.0.zip", + "https://github.com/unicode-cldr/cldr-localenames-full/archive/29.0.0.zip", + "https://github.com/unicode-cldr/cldr-misc-full/archive/29.0.0.zip", + "https://github.com/unicode-cldr/cldr-numbers-full/archive/29.0.0.zip", + "https://github.com/unicode-cldr/cldr-units-full/archive/29.0.0.zip" + ] +} diff --git a/StockManMVC/.bin/bower_components/cldrjs/.bower.json b/StockManMVC/.bin/bower_components/cldrjs/.bower.json new file mode 100644 index 0000000..884d038 --- /dev/null +++ b/StockManMVC/.bin/bower_components/cldrjs/.bower.json @@ -0,0 +1,25 @@ +{ + "name": "cldrjs", + "dependencies": { + "cldr-data": ">=25" + }, + "devDependencies": { + "chai": "1.7.x", + "eventEmitter": "4.2.7", + "mocha": "1.12.x", + "requirejs": "2.1.x", + "requirejs-plugins": "1.0.2", + "requirejs-text": "2.0.10" + }, + "homepage": "https://github.com/rxaviers/cldrjs", + "version": "0.4.4", + "_release": "0.4.4", + "_resolution": { + "type": "version", + "tag": "0.4.4", + "commit": "ffa7de2f81e334eff2bf6a9ce0b586c0c875d7de" + }, + "_source": "https://github.com/rxaviers/cldrjs.git", + "_target": "0.4.4", + "_originalSource": "cldrjs" +} \ No newline at end of file diff --git a/StockManMVC/.bin/bower_components/cldrjs/.bowerrc b/StockManMVC/.bin/bower_components/cldrjs/.bowerrc new file mode 100644 index 0000000..f095e81 --- /dev/null +++ b/StockManMVC/.bin/bower_components/cldrjs/.bowerrc @@ -0,0 +1,6 @@ +{ + "scripts": { + "postinstall": "node ./node_modules/cldr-data-downloader/bin/download.js -i bower_components/cldr-data/index.json -o bower_components/cldr-data/" + } +} + diff --git a/StockManMVC/.bin/bower_components/cldrjs/.gitignore b/StockManMVC/.bin/bower_components/cldrjs/.gitignore new file mode 100644 index 0000000..ca2ac19 --- /dev/null +++ b/StockManMVC/.bin/bower_components/cldrjs/.gitignore @@ -0,0 +1,3 @@ +bower_components/ +node_modules/ +tmp/ diff --git a/StockManMVC/.bin/bower_components/cldrjs/.jshintrc b/StockManMVC/.bin/bower_components/cldrjs/.jshintrc new file mode 100644 index 0000000..ed61a87 --- /dev/null +++ b/StockManMVC/.bin/bower_components/cldrjs/.jshintrc @@ -0,0 +1,16 @@ +{ + "boss": true, + "eqeqeq": true, + "eqnull": true, + "expr": true, + "immed": true, + "noarg": true, + "onevar": false, + "quotmark": "double", + "smarttabs": true, + "trailing": true, + "undef": true, + "unused": true, + + "node": true +} \ No newline at end of file diff --git a/StockManMVC/.bin/bower_components/cldrjs/CHANGELOG.md b/StockManMVC/.bin/bower_components/cldrjs/CHANGELOG.md new file mode 100644 index 0000000..f12921d --- /dev/null +++ b/StockManMVC/.bin/bower_components/cldrjs/CHANGELOG.md @@ -0,0 +1,13 @@ +# 0.4.0 + +## Breaking Changes + +- Bundle Lookup Matcher ([f9572aa][], [#17][]). + +Applications that explicitly use `/main/{languageId}` to traverse main items need to update it to `/main/{bundle}`. Applications that use the `.main()` method need to take no action. + +This change improves how cldrjs performs lookup for the right bundle when traversing main items. See more information at [Bundle Lookup Matcher][]. + +[f9572aa]: https://github.com/rxaviers/cldrjs/commit/f9572aa0164a8e4fcb5b7c4ae95957f2ced8e96a +[#17]: https://github.com/rxaviers/cldrjs/issues/17 +[Bundle Lookup Matcher]: ./doc/bundle_lookup_matcher.md diff --git a/StockManMVC/.bin/bower_components/cldrjs/DCO.md b/StockManMVC/.bin/bower_components/cldrjs/DCO.md new file mode 100644 index 0000000..2076e0d --- /dev/null +++ b/StockManMVC/.bin/bower_components/cldrjs/DCO.md @@ -0,0 +1,27 @@ +If you would like to make a contribution to cldr.js, please certify to the following: + +--- + +cldr.js Developer's Certificate of Origin. Version 1.0 + +By making a contribution to this project, I certify that: + +(a) The contribution was created in whole or in part by me and I have the right to submit it under the MIT license; or + +(b) The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate open source license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the MIT license; or + +(c) The contribution was provided directly to me by some other person who certified (a) or (b) and I have not modified it. + +(d) I understand and agree that this project and the contribution are public and that a record of the contribution (including all metadata and personal information I submit with it, including my sign-off) is maintained indefinitely and may be redistributed consistent with cldr.js's policies and the requirements of the MIT license where they are relevant. + +(e) I am granting this work to this project under the terms of the [MIT license](http://opensource.org/licenses/MIT). + +--- + +And please confirm your certification to the above by adding the following line to your commit message: + + Signed-off-by: Jane Developer + +using your real name (sorry, no pseudonyms or anonymous contributions). Committing with `git commit -s` will add the sign-off at the end of the commit message for you. + +If you are a developer who is authorized to contribute to cldr.js on behalf of your employer, then please use your corporate email address in the Signed-off-by tag. If not, then please use a personal email address. diff --git a/StockManMVC/.bin/bower_components/cldrjs/Gruntfile.js b/StockManMVC/.bin/bower_components/cldrjs/Gruntfile.js new file mode 100644 index 0000000..e7f9545 --- /dev/null +++ b/StockManMVC/.bin/bower_components/cldrjs/Gruntfile.js @@ -0,0 +1,293 @@ +module.exports = function(grunt) { + + "use strict"; + + var isConnectTestRunning, + rdefineEnd = /\}\);[^}\w]*$/, + pkg = grunt.file.readJSON( "package.json" ); + + function camelCase( input ) { + return input.toLowerCase().replace( /[_/](.)/g, function( match, group1 ) { + return group1.toUpperCase(); + }); + } + + function mountFolder( connect, path ) { + return connect.static( require( "path" ).resolve( path ) ); + } + + function replaceConsts( content ) { + return content + + // Replace Version + .replace( /@VERSION/g, pkg.version ) + + // Replace Date yyyy-mm-ddThh:mmZ + .replace( /@DATE/g, ( new Date() ).toISOString().replace( /:\d+\.\d+Z$/, "Z" ) ); + } + + grunt.initConfig({ + pkg: pkg, + connect: { + options: { + port: 9001, + hostname: "localhost" + }, + test: { + options: { + middleware: function ( connect ) { + return [ + mountFolder( connect, "." ), + mountFolder( connect, "test" ) + ]; + } + } + } + }, + jshint: { + source: { + src: [ "src/**/*.js", "!src/build/**" ], + options: { + jshintrc: "src/.jshintrc" + } + }, + grunt: { + src: [ "Gruntfile.js" ], + options: { + jshintrc: ".jshintrc" + } + }, + metafiles: { + src: [ "bower.json", "package.json" ], + options: { + jshintrc: ".jshintrc" + } + }, + test: { + src: [ "test/**/*.js" ], + options: { + jshintrc: "test/.jshintrc" + } + }, + dist: { + src: [ "dist/**/*.js" ], + options: { + jshintrc: "src/.dist_jshintrc" + } + } + }, + dco: { + current: { + options: { + exceptionalAuthors: { + "rxaviers@gmail.com": "Rafael Xavier de Souza" + } + } + } + }, + mocha: { + unit: { + options: { + log: true, + urls: [ + "http://localhost:<%= connect.options.port %>/unit.html", + "http://localhost:<%= connect.options.port %>/unit_unresolved.html" + ] + } + }, + functional: { + options: { + log: true, + urls: [ + "http://localhost:<%= connect.options.port %>/functional.html"//, + //"http://localhost:<%= connect.options.port %>/functional_unresolved.html" + ] + } + } + }, + requirejs: { + options: { + dir: "dist/.build", + appDir: "src", + baseUrl: ".", + optimize: "none", + paths: { + EventEmitter: "../bower_components/eventEmitter/EventEmitter" + }, + skipSemiColonInsertion: true, + skipModuleInsertion: true, + + // Strip all definitions generated by requirejs. + // Convert content as follows: + // a) "Single return" means the module only contains a return statement that is converted to a var declaration. + // b) "Not as simple as a single return" means the define wrappers are replaced by a function wrapper call and the returned value is assigned to a var. + // c) "Main" means the define wrappers are removed, but content is untouched. Only for main* files. + onBuildWrite: function ( id, path, contents ) { + var name = id + .replace( /util\/|common\//, "" ); + + if ( (/^EventEmitter$/).test( id ) ) { + contents = contents + .replace( /.*\buse strict\b.*/, "" ) + .replace( /(\(function \(\) {)/, "var EventEmitter;\n/* jshint ignore:start */\nEventEmitter = $1" ) + .replace( /\/\/ Expose the class either via AMD, CommonJS[\S\s]*}\.call\(this\)\);/, "return EventEmitter;\n}());\n/* jshint ignore:end */" ); + return contents; + } + + // 1, and 2: Remove define() wrap. + // 3: Remove empty define()'s. + contents = contents + .replace( /define\([^{]*?{/, "" ) /* 1 */ + .replace( rdefineEnd, "" ) /* 2 */ + .replace( /define\(\[[^\]]+\]\)[\W\n]+$/, "" ); /* 3 */ + + // Type b (not as simple as a single return) + if ( [ "item/lookup", "util/json/merge" ].indexOf( id ) !== -1 ) { + contents = " var " + camelCase( name ) + " = (function() {" + + contents + "}());"; + } + // Type a (single return) + else if ( (/\//).test( id ) ) { + contents = contents + .replace( / return/, " var " + camelCase( name ) + " =" ); + } + + return contents; + } + }, + bundle: { + options: { + modules: [{ + name: "cldr", + include: [ "core" ], + create: true, + override: { + wrap: { + startFile: "src/build/intro_core.js", + endFile: "src/build/outro.js" + } + } + }, { + name: "cldr_event", + include: [ "event" ], + exclude: [ "core" ], + create: true, + override: { + wrap: { + startFile: "src/build/intro_event.js", + endFile: "src/build/outro.js" + } + } + }, { + name: "cldr_supplemental", + include: [ "supplemental" ], + exclude: [ "core" ], + create: true, + override: { + wrap: { + startFile: "src/build/intro_supplemental.js", + endFile: "src/build/outro.js" + } + } + }, { + name: "cldr_unresolved", + include: [ "unresolved" ], + exclude: [ "core" ], + create: true, + override: { + wrap: { + startFile: "src/build/intro_unresolved.js", + endFile: "src/build/outro.js" + } + } + }] + } + } + }, + copy: { + options: { + processContent: function( content ) { + + // Remove leftover define created during rjs build + content = content.replace( /define\(".*/, "" ); + + // Embed VERSION and DATE + return replaceConsts( content ); + } + }, + dist_cldr: { + expand: true, + cwd: "dist/.build/", + src: [ "cldr.js" ], + dest: "dist/" + }, + dist_modules: { + expand: true, + cwd: "dist/.build/", + src: [ "cldr*.js", "!cldr.js" ], + dest: "dist/cldr", + rename: function( dest, src ) { + return require( "path" ).join( dest, src.replace( /cldr_/, "" ) ); + } + }, + dist_node_main: { + src: "src/build/node_main.js", + dest: "dist/node_main.js" + } + }, + uglify: { + options: { + banner: replaceConsts( grunt.file.read( "src/build/intro.min.js" ) ) + }, + dist: { + files: { + "tmp/cldr.min.js": [ "dist/cldr.js" ], + "tmp/cldr/event.min.js": [ "dist/cldr/event.js" ], + "tmp/cldr/supplemental.min.js": [ "dist/cldr/supplemental.js" ], + "tmp/cldr/unresolved.min.js": [ "dist/cldr/unresolved.js" ] + } + } + }, + compare_size: { + files: [ + "tmp/cldr.min.js", + "tmp/cldr/*min.js" + ], + options: { + compress: { + gz: function( fileContents ) { + return require( "gzip-js" ).zip( fileContents, {} ).length; + } + } + } + } + }); + + require( "matchdep" ).filterDev( "grunt-*" ).forEach( grunt.loadNpmTasks ); + + grunt.registerTask( "test", function() { + var args = [].slice.call( arguments ); + if ( !isConnectTestRunning ) { + grunt.task.run( "connect:test" ); + isConnectTestRunning = true; + } + grunt.task.run( [ "mocha" ].concat( args ).join( ":" ) ); + }); + + grunt.registerTask( "default", [ + "jshint:metafiles", + "jshint:grunt", + "jshint:source", + "jshint:test", + "test:unit", + "requirejs", + "copy", + "jshint:dist", + "test:functional", + "uglify", + "compare_size", + "dco" + ]); + +}; + diff --git a/StockManMVC/.bin/bower_components/cldrjs/LICENSE-MIT b/StockManMVC/.bin/bower_components/cldrjs/LICENSE-MIT new file mode 100644 index 0000000..6123def --- /dev/null +++ b/StockManMVC/.bin/bower_components/cldrjs/LICENSE-MIT @@ -0,0 +1,22 @@ +Copyright (c) Rafael Xavier de Souza http://rafael.xavier.blog.br + +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. diff --git a/StockManMVC/.bin/bower_components/cldrjs/README.md b/StockManMVC/.bin/bower_components/cldrjs/README.md new file mode 100644 index 0000000..8c97cfb --- /dev/null +++ b/StockManMVC/.bin/bower_components/cldrjs/README.md @@ -0,0 +1,552 @@ +# cldr.js - Simple CLDR traverser + +[CLDR (unicode.org)](http://cldr.unicode.org/) provides locale content for i18n software. The data is provided in two formats: LDML (XML format) and JSON. Our goal is to provide a simple layer to facilitate i18n software to access and use the [official CLDR JSON data](http://cldr.unicode.org/index/cldr-spec/json). + +| File | Minified + gzipped size | Summary | +|---|--:|---| +| cldr.js | 2.1KB | Core library | +| cldr/event.js | +1.4KB | Provides methods to allow listening to events, eg. `get` | +| cldr/supplemental.js | +0.5KB | Provides supplemental helper methods | +| cldr/unresolved.js | +0.7KB | Provides inheritance support for unresolved data | + +Quick jump: +- [About cldr.js?](#about-cldrjs) +- [Getting Started](#getting-started) + - [Usage and installation](#usage-and-installation) + - [How to get CLDR JSON data?](#how-to-get-cldr-json-data) + - [How do I load CLDR data into Cldrjs?](#how-do-i-load-cldr-data-into-cldrjs) +- [API](#api) +- [Error reference](#error) +- [Development / Contributing](#development--contributing) + + +## About cldr.js? + +### Who uses cldr.js? + +| Organization | Project | +|---|---| +| ![jQuery](doc/asset/jquery.png) | https://github.com/jquery/globalize | + +### Where to use it? + +It's designed to work both in the [browser](#usage-and-installation) and in [Node.js](#commonjs--nodejs). It supports [AMD](#usage-and-installation) and [CommonJs](#usage-and-installation); + +See [Usage and installation](#usage-and-installation). + +### What changed from 0.3.x to 0.4.x? + +See our [changelogs](./CHANGELOG.md). + +### Load only the CLDR portion you need + +```javascript +// Load the appropriate portion of CLDR JSON data +Cldr.load( + likelySubtagsData, + enData, + ptBrData +); +``` + +See [How to get CLDR JSON data?](#how-to-get-cldr-json-data) below for more information on how to get that data. + +### Instantiate a locale and get it normalized + +```javascript +var en = new Cldr( "en" ); +en.attributes; +// > { +// "bundle": "en", +// "minLanguageId": "en", +// "maxLanguageId": "en-Latn-US", +// "language": "en", +// "script": "Latn", +// "territory": "US", +// "region": "US" +// } + +var zh = new Cldr( "zh-u-nu-finance-cu-cny" ); +zh.attributes; +// > { +// "bundle": "zh-Hant", +// "minLanguageId": "zh", +// "maxLanguageId": "zh-Hans-CN", +// "language": "zh", +// "script": "Hans", +// "territory": "CN", +// "region": "CN", +// "u-nu": "finance", +// "u-cu": "cny" +// } + +``` + +- `language`, `script`, `territory` (also aliased as `region`), `maxLanguageId` (computed by [adding likely subtags](./src/core/likely_subtags.js)) and `minLanguageId` (computed by [removing likely subtags](./src/core/remove_likely_subtags.js)) according to the [specification](http://www.unicode.org/reports/tr35/#Likely_Subtags). +- `bundle` holds the bundle lookup match based on the available loaded CLDR data, obtained by following [Bundle Lookup Matcher][]. +- [Unicode locale extensions](http://www.unicode.org/reports/tr35/#u_Extension). + +Comparison between different locales. + +| locale | minLanguageId | maxLanguageId | language | script | region | +| --- | --- | --- | --- | --- | --- | +| **en** | `"en"` | `"en-Latn-US"` | `"en"` | `"Latn"` | `"US"` | +| **en-US** | `"en"` | `"en-Latn-US"` | `"en"` | `"Latn"` | `"US"` | +| **de** | `"de"` | `"de-Latn-DE"` | `"de"` | `"Latn"` | `"DE"` | +| **zh** | `"zh"` | `"zh-Hans-CN"` | `"zh"` | `"Hans"` | `"CN"` | +| **zh-TW** | `"zh-TW"` | `"zh-Hant-TW"` | `"zh"` | `"Hant"` | `"TW"` | +| **ar** | `"ar"` | `"ar-Arab-EG"` | `"ar"` | `"Arab"` | `"EG"` | +| **pt** | `"pt"` | `"pt-Latn-BR"` | `"pt"` | `"Latn"` | `"BR"` | +| **pt-BR** | `"pt"` | `"pt-Latn-BR"` | `"pt"` | `"Latn"` | `"BR"` | +| **pt-PT** | `"pt-PT"` | `"pt-Latn-PT"` | `"pt"` | `"Latn"` | `"PT"` | +| **es** | `"es"` | `"es-Latn-ES"` | `"es"` | `"Latn"` | `"ES"` | +| **es-AR** | `"es-AR"` | `"es-Latn-AR"` | `"es"` | `"Latn"` | `"AR"` | + +### Get item given its path + +```javascript +// Equivalent to: +// .get( "main/{bundle}/numbers/symbols-numberSystem-latn/decimal" ); +en.main( "numbers/symbols-numberSystem-latn/decimal" ); +// > "." + +// Equivalent to: +// .get( "main/{bundle}/numbers/symbols-numberSystem-latn/decimal" ); +ptBr.main( "numbers/symbols-numberSystem-latn/decimal" ); +// > "," +``` + +Have any [locale attributes](#cldrattributes) replaced with their corresponding values by embracing it with `{}`. In the example below, `{language}` is replaced with `"en"` and `{territory}` with `"US"`. + +```javascript +// Notice the more complete way to get this data is: +// cldr.get( "supplemental/gender/personList/{language}" ) || +// cldr.get( "supplemental/gender/personList/001" ); +var enGender = en.get( "supplemental/gender/personList/{language}" ); +// > "neutral" + +var USCurrencies = en.get( "supplemental/currencyData/region/{territory}" ); +// > [ +// { USD: { _from: "1792-01-01" } }, +// { USN: { _tender: "false" } }, +// { USS: { _tender: "false" } } +// ] + +// Notice the more complete way to get this data is: +// cldr.get( "supplemental/measurementData/measurementSystem/{territory}" ) || +// cldr.get( "supplemental/measurementData/measurementSystem/001" ); +var enMeasurementSystem = en.get( "supplemental/measurementData/measurementSystem/{territory}" ); +// > "US" +``` + +Get `undefined` for non-existent data. + +```javascript +en.get( "/crazy/invalid/path" ); +// ➡ undefined + +// Avoid this +enData && enData.crazy && enData.crazy.invalid && enData.crazy.invalid.path; +``` + +### Resolve CLDR inheritances + +If you are using unresolved JSON data, you can resolve them dynamically during runtime by loading the `cldr/unresolved.js` extension module. Currently, we support bundle inheritance. + +```javascript +Cldr.load( + unresolvedEnData + unresolvedEnGbData, + unresolvedEnInData, + parentLocalesData, // supplemental + likelySubtagsData // supplemental +); + +var enIn = new Cldr( "en-IN" ); + +// 1st time retrieved by resolving: en-IN ➡ en-GB (parent locale lookup). +// Further times retrieved straight from the resolved cache. +enIn.main( "dates/calendars/gregorian/dateTimeFormats/availableFormats/yMd" ); +// > "dd/MM/y" + +// 1st time retrieved by resolving: en-IN ➡ en-GB (parent locale lookup) ➡ en (truncate lookup) +// Further times retrieved straight from the resolved cache. +enIn.main( "numbers/symbols-numberSystem-latn/decimal" ); +// > "." +``` + +### Helpers + +We offer some convenient helpers. + +```javascript +var usFirstDay = en.supplemental.weekData.firstDay(); +// ➡ sun +// Equivalent to: +// en.get( "supplemental/weekData/firstDay/{territory}" ) || +// en.get( "supplemental/weekData/firstDay/001" ); + +var brFirstDay = ptBr.supplemental.weekData.firstDay(); +// ➡ mon +// Equivalent to: +// ptBr.get( "supplemental/weekData/firstDay/{territory}" ) || +// ptBr.get( "supplemental/weekData/firstDay/001" ); +``` + +### Browser support + +We officially support: +- Firefox (latest - 2)+ +- Chrome (latest - 2)+ +- Safari 5.1+ +- IE 8+ +- Opera (latest - 2)+ + +Sniff tests show cldr.js also works on the following browsers: +- Firefox 4+ +- Safari 5+ +- Chrome 14+ +- IE 6+ +- Opera 11.1+ + +If you find any bugs, please just let us know. We'll be glad to fix them for the officially supported browsers, or at least update the documentation for the unsupported ones. + + +## Getting Started + +### Usage and installation + +cldr.js has no external dependencies. You can include it in the script tag of your page and you're ready to go. [Download it by clicking here](https://github.com/rxaviers/cldr/releases). + +```html + +``` + + +```javascript +// Load the appropriate portion of CLDR JSON data. +// See "How to get CLDR JSON data?" below for more information on how to get that data. +Cldr.load( cldrJsonData ); + +// Instantiate it by passing a locale. +var ptBr = new Cldr( "pt-BR" ); + +// Get CLDR item data given its path. +// Equivalent to: +// .get( "main/{bundle}/numbers/symbols-numberSystem-latn/decimal" ); +ptBr.main( "numbers/symbols-numberSystem-latn/decimal" ); +// > "," +``` + +We are UMD wrapped. So, it supports AMD, CommonJS, or global variables (in case neither AMD nor CommonJS have been detected). + +Example of usage on AMD: + +```bash +bower install cldrjs +``` + +```javascript +require.config({ + paths: { + "cldr": "bower_components/cldrjs/dist/cldr" + } +}); + +require( [ "cldr", "cldr/supplemental", "cldr/unresolved" ], function( Cldr ) { + ... +}); +``` + +Example of usage with Node.js: + +```bash +npm install cldrjs +``` + +```javascript +var Cldr = require( "cldrjs" ); +``` + +### How to get CLDR JSON data? + +*By downloading the JSON packages individually...* + +Unicode CLDR is available as JSON at https://github.com/unicode-cldr/ (after this [json-packaging proposal][] took place). Please, read https://github.com/unicode-cldr/cldr-json for more information about package organization. + +[json-packaging proposal]: http://cldr.unicode.org/development/development-process/design-proposals/json-packaging + +*By using a package manager...* + +`cldr-data` can be used for convenience. It always downloads from the correct source. + +Use bower `bower install cldr-data` ([detailed instructions][]) or npm `npm install cldr-data`. For more information, see: + +- https://github.com/rxaviers/cldr-data-npm +- https://github.com/rxaviers/cldr-data-bower + +[detailed instructions]: https://github.com/rxaviers/cldr-data-bower + +*By generating the JSON mappings yourself...* + +You can generate the JSON representation of the languages not available in the ZIP file by using the official conversion tool ([`tools.zip`](http://www.unicode.org/Public/cldr/latest/)). This ZIP contains a README with instructions on how to build the data. + +You can choose to generate unresolved data to save space or bandwidth (`-r false` option of the conversion tool) and instead have it resolve at runtime. + +### How do I load CLDR data into Cldrjs? + +The short answer is by using `Cldr.load()` and passing the JSON data as the first argument. Below, follow several examples on how this could be accomplished. + +For the examples below, first fetch CLDR JSON data: + +```bash +wget http://www.unicode.org/Public/cldr/latest/json.zip +unzip json.zip -d cldr +``` + +Example of embedding CLDR JSON data: + +```html + +``` + +Example of loading it dynamically: + +```html + + +``` + +Example using AMD (also see our [functional tests](test/functional.js)): +```javascript +define([ + "cldr", + "json!cldr/supplemental/likelySubtags.json" +], function( Cldr, likelySubtags ) { + + Cldr.load( likelySubtags ); + +}); +``` + +Example using Node.js: + +```javascript +var Cldr = require( "cldrjs" ); +Cldr.load( require( "./cldr/supplemental/likelySubtags.json" ) ); +``` + +#### Attention: library owners, do not embed data + +It's NOT recommended that libraries embed data into their code logic for several reasons: avoid forcing a certain data version on users, avoid maintaining locale changes, avoid duplicating data among different i18n libraries. + +We recommend loading CLDR data must be performed by end user code. + +#### Which CLDR portion to load? + +It depends on the used modules. + +| File | Required CLDR JSON data | +|---|---| +| cldr.js | `cldr/supplemental/likelySubtags.json` | +| cldr/unresolved.js | `cldr/supplemental/parentLocales.json` | +| cldr/supplemental.js | `cldr/supplemental/{timeData, weekData}.json` | + +You must also load any portion of the CLDR data you plan to use in your library or your end-application. + +## API + +### Core + +- **`Cldr.load( json, ... )`** + + Load resolved or unresolved [1] JSON data. + + [Read more...](doc/api/core/load.md) + + 1: Unresolved processing is **only available** after loading `cldr/unresolved.js` extension module. + +- **`new Cldr( locale )`** + + Create a new instance of Cldr. + + [Read more...](doc/api/core/constructor.md) + +- **`.attributes`** + + Attributes is an Object created during instance initialization (construction) and are used internally by `.get()` to replace dynamic parts of an item path. + + [Read more...](doc/api/core/attributes.md) + +- **`.get( path )`** + + Get the item data given its path, or `undefined` if missing. + + [Read more...](doc/api/core/get.md) + +- **`.main( path )`** + + It's an alias for `.get([ "main/{bundle}", ... ])`. + + [Read more...](doc/api/core/main.md) + +### cldr/event.js + +- **`Cldr.on( event, listener )`** + + Add a listener function to the specified event globally (for all instances). + + [Read more...](doc/api/event/global_on.md) + +- **`Cldr.once( event, listener )`** + + Add a listener function to the specified event globally (for all instances). It will be automatically removed after it's first execution. + + [Read more...](doc/api/event/global_once.md) + +- **`Cldr.off( event, listener )`** + + Remove a listener function from the specified event globally (for all instances). + + [Read more...](doc/api/event/global_off.md) + +- **`.on( event, listener )`** + + Add a listener function to the specified event for this instance. + + [Read more...](doc/api/event/on.md) + +- **`.once( event, listener )`** + + Add a listener function to the specified event for this instance. It will be automatically removed after it's first execution. + + [Read more...](doc/api/event/once.md) + +- **`.off( event, listener )`** + + Remove a listener function from the specified event for this instance. + + [Read more...](doc/api/event/off.md) + +#### Events + +- `get` ➡ `( path, value )` + + Triggered before a `.get()` (or any alias) return. The triggered listener receives the normalized *path* and the *value* found. + + [Read more...](doc/api/event/event_get.md) + +### cldr/supplemental.js + +- **`.supplemental( path )`** + + It's an alias for `.get([ "supplemental", ... ])`. + + [Read more...](doc/api/supplemental.md) + +- **`.supplemental.timeData.allowed()`** + + Helper function. Return the supplemental timeData allowed of locale's territory. + + [Read more...](doc/api/supplemental/time_data_allowed.md) + +- **`.supplemental.timeData.preferred()`** + + Helper function. Return the supplemental timeData preferred of locale's territory. + + [Read more...](doc/api/supplemental/time_data_preferred.md) + +- **`.supplemental.weekData.firstDay()`** + + Helper function. Return the supplemental weekData firstDay of locale's territory. + + [Read more...](doc/api/supplemental/week_data_first_day.md) + +- **`.supplemental.weekData.minDays()`** + + Helper function. Return the supplemental weekData minDays of locale's territory as a Number. + + [Read more...](doc/api/supplemental/week_data_min_days.md) + +### cldr/unresolved.js + +- **`.get( path )`** + + Overload (extend) `.get()` to get the item data or lookup by following [locale inheritance](http://www.unicode.org/reports/tr35/#Locale_Inheritance), set a local resolved cache if it's found (for subsequent faster access), or return `undefined`. + + [Read more...](doc/api/unresolved/get.md) + +## Error reference + +### CLDR Errors + +#### `E_MISSING_BUNDLE` + +Thrown when none of the loaded CLDR data can be used as a bundle for the corresponding locale. See more information on [Bundle Lookup Matcher][]. + +Error object: + +| Attribute | Value | +| --- | --- | +| code | `E_MISSING_BUNDLE` | +| locale | Locale whose bundle could not be found | + +### Parameter Errors + +#### `E_MISSING_PARAMETER` + +Thrown when a required parameter is missing on any static or instance methods. + +Error object: + +| Attribute | Value | +| --- | --- | +| code | `E_MISSING_PARAMETER` | +| name | Name of the missing parameter | + +#### `E_INVALID_PAR_TYPE` + +Thrown when a parameter has an invalid type on any static or instance methods. + +Error object: + +| Attribute | Value | +| --- | --- | +| code | `E_INVALID_PAR_TYPE` | +| name | Name of the invalid parameter | +| value | Invalid value | +| expected | Expected type | + + +### Development / Contributing + +Install grunt and tests external dependencies. First, install the [grunt-cli](http://gruntjs.com/getting-started#installing-the-cli) and [bower](http://bower.io/) packages if you haven't before. These should be done as global installs. Then: + +```bash +npm install && bower install +``` +Run tests +```bash +grunt test +``` +Build distribution file. +```bash +grunt +``` + +[Bundle Lookup Matcher]: ./doc/bundle_lookup_matcher.md + +## License + +MIT © [Rafael Xavier de Souza](http://rafael.xavier.blog.br) diff --git a/StockManMVC/.bin/bower_components/cldrjs/bower.json b/StockManMVC/.bin/bower_components/cldrjs/bower.json new file mode 100644 index 0000000..41123b4 --- /dev/null +++ b/StockManMVC/.bin/bower_components/cldrjs/bower.json @@ -0,0 +1,14 @@ +{ + "name": "cldrjs", + "dependencies": { + "cldr-data": ">=25" + }, + "devDependencies": { + "chai": "1.7.x", + "eventEmitter": "4.2.7", + "mocha": "1.12.x", + "requirejs": "2.1.x", + "requirejs-plugins": "1.0.2", + "requirejs-text": "2.0.10" + } +} diff --git a/StockManMVC/.bin/bower_components/cldrjs/dist/cldr.js b/StockManMVC/.bin/bower_components/cldrjs/dist/cldr.js new file mode 100644 index 0000000..956afca --- /dev/null +++ b/StockManMVC/.bin/bower_components/cldrjs/dist/cldr.js @@ -0,0 +1,676 @@ +/** + * CLDR JavaScript Library v0.4.4 + * http://jquery.com/ + * + * Copyright 2013 Rafael Xavier de Souza + * Released under the MIT license + * http://jquery.org/license + * + * Date: 2016-01-18T12:25Z + */ +/*! + * CLDR JavaScript Library v0.4.4 2016-01-18T12:25Z MIT license © Rafael Xavier + * http://git.io/h4lmVg + */ +(function( root, factory ) { + + if ( typeof define === "function" && define.amd ) { + // AMD. + define( factory ); + } else if ( typeof module === "object" && typeof module.exports === "object" ) { + // Node. CommonJS. + module.exports = factory(); + } else { + // Global + root.Cldr = factory(); + } + +}( this, function() { + + + var arrayIsArray = Array.isArray || function( obj ) { + return Object.prototype.toString.call( obj ) === "[object Array]"; + }; + + + + + var pathNormalize = function( path, attributes ) { + if ( arrayIsArray( path ) ) { + path = path.join( "/" ); + } + if ( typeof path !== "string" ) { + throw new Error( "invalid path \"" + path + "\"" ); + } + // 1: Ignore leading slash `/` + // 2: Ignore leading `cldr/` + path = path + .replace( /^\// , "" ) /* 1 */ + .replace( /^cldr\// , "" ); /* 2 */ + + // Replace {attribute}'s + path = path.replace( /{[a-zA-Z]+}/g, function( name ) { + name = name.replace( /^{([^}]*)}$/, "$1" ); + return attributes[ name ]; + }); + + return path.split( "/" ); + }; + + + + + var arraySome = function( array, callback ) { + var i, length; + if ( array.some ) { + return array.some( callback ); + } + for ( i = 0, length = array.length; i < length; i++ ) { + if ( callback( array[ i ], i, array ) ) { + return true; + } + } + return false; + }; + + + + + /** + * Return the maximized language id as defined in + * http://www.unicode.org/reports/tr35/#Likely_Subtags + * 1. Canonicalize. + * 1.1 Make sure the input locale is in canonical form: uses the right + * separator, and has the right casing. + * TODO Right casing? What df? It seems languages are lowercase, scripts are + * Capitalized, territory is uppercase. I am leaving this as an exercise to + * the user. + * + * 1.2 Replace any deprecated subtags with their canonical values using the + * data in supplemental metadata. Use the first value in the + * replacement list, if it exists. Language tag replacements may have multiple + * parts, such as "sh" ➞ "sr_Latn" or mo" ➞ "ro_MD". In such a case, the + * original script and/or region are retained if there is one. Thus + * "sh_Arab_AQ" ➞ "sr_Arab_AQ", not "sr_Latn_AQ". + * TODO What data? + * + * 1.3 If the tag is grandfathered (see in the supplemental data), then return it. + * TODO grandfathered? + * + * 1.4 Remove the script code 'Zzzz' and the region code 'ZZ' if they occur. + * 1.5 Get the components of the cleaned-up source tag (languages, scripts, + * and regions), plus any variants and extensions. + * 2. Lookup. Lookup each of the following in order, and stop on the first + * match: + * 2.1 languages_scripts_regions + * 2.2 languages_regions + * 2.3 languages_scripts + * 2.4 languages + * 2.5 und_scripts + * 3. Return + * 3.1 If there is no match, either return an error value, or the match for + * "und" (in APIs where a valid language tag is required). + * 3.2 Otherwise there is a match = languagem_scriptm_regionm + * 3.3 Let xr = xs if xs is not empty, and xm otherwise. + * 3.4 Return the language tag composed of languager _ scriptr _ regionr + + * variants + extensions. + * + * @subtags [Array] normalized language id subtags tuple (see init.js). + */ + var coreLikelySubtags = function( Cldr, cldr, subtags, options ) { + var match, matchFound, + language = subtags[ 0 ], + script = subtags[ 1 ], + sep = Cldr.localeSep, + territory = subtags[ 2 ], + variantsAndUnicodeLocaleExtensions = subtags.slice( 3, 4 ); + options = options || {}; + + // Skip if (language, script, territory) is not empty [3.3] + if ( language !== "und" && script !== "Zzzz" && territory !== "ZZ" ) { + return [ language, script, territory ].concat( variantsAndUnicodeLocaleExtensions ); + } + + // Skip if no supplemental likelySubtags data is present + if ( typeof cldr.get( "supplemental/likelySubtags" ) === "undefined" ) { + return; + } + + // [2] + matchFound = arraySome([ + [ language, script, territory ], + [ language, territory ], + [ language, script ], + [ language ], + [ "und", script ] + ], function( test ) { + return match = !(/\b(Zzzz|ZZ)\b/).test( test.join( sep ) ) /* [1.4] */ && cldr.get( [ "supplemental/likelySubtags", test.join( sep ) ] ); + }); + + // [3] + if ( matchFound ) { + // [3.2 .. 3.4] + match = match.split( sep ); + return [ + language !== "und" ? language : match[ 0 ], + script !== "Zzzz" ? script : match[ 1 ], + territory !== "ZZ" ? territory : match[ 2 ] + ].concat( + variantsAndUnicodeLocaleExtensions + ); + } else if ( options.force ) { + // [3.1.2] + return cldr.get( "supplemental/likelySubtags/und" ).split( sep ); + } else { + // [3.1.1] + return; + } + }; + + + + /** + * Given a locale, remove any fields that Add Likely Subtags would add. + * http://www.unicode.org/reports/tr35/#Likely_Subtags + * 1. First get max = AddLikelySubtags(inputLocale). If an error is signaled, + * return it. + * 2. Remove the variants from max. + * 3. Then for trial in {language, language _ region, language _ script}. If + * AddLikelySubtags(trial) = max, then return trial + variants. + * 4. If you do not get a match, return max + variants. + * + * @maxLanguageId [Array] maxLanguageId tuple (see init.js). + */ + var coreRemoveLikelySubtags = function( Cldr, cldr, maxLanguageId ) { + var match, matchFound, + language = maxLanguageId[ 0 ], + script = maxLanguageId[ 1 ], + territory = maxLanguageId[ 2 ], + variants = maxLanguageId[ 3 ]; + + // [3] + matchFound = arraySome([ + [ [ language, "Zzzz", "ZZ" ], [ language ] ], + [ [ language, "Zzzz", territory ], [ language, territory ] ], + [ [ language, script, "ZZ" ], [ language, script ] ] + ], function( test ) { + var result = coreLikelySubtags( Cldr, cldr, test[ 0 ] ); + match = test[ 1 ]; + return result && result[ 0 ] === maxLanguageId[ 0 ] && + result[ 1 ] === maxLanguageId[ 1 ] && + result[ 2 ] === maxLanguageId[ 2 ]; + }); + + if ( matchFound ) { + if ( variants ) { + match.push( variants ); + } + return match; + } + + // [4] + return maxLanguageId; + }; + + + + + /** + * subtags( locale ) + * + * @locale [String] + */ + var coreSubtags = function( locale ) { + var aux, unicodeLanguageId, + subtags = []; + + locale = locale.replace( /_/, "-" ); + + // Unicode locale extensions. + aux = locale.split( "-u-" ); + if ( aux[ 1 ] ) { + aux[ 1 ] = aux[ 1 ].split( "-t-" ); + locale = aux[ 0 ] + ( aux[ 1 ][ 1 ] ? "-t-" + aux[ 1 ][ 1 ] : ""); + subtags[ 4 /* unicodeLocaleExtensions */ ] = aux[ 1 ][ 0 ]; + } + + // TODO normalize transformed extensions. Currently, skipped. + // subtags[ x ] = locale.split( "-t-" )[ 1 ]; + unicodeLanguageId = locale.split( "-t-" )[ 0 ]; + + // unicode_language_id = "root" + // | unicode_language_subtag + // (sep unicode_script_subtag)? + // (sep unicode_region_subtag)? + // (sep unicode_variant_subtag)* ; + // + // Although unicode_language_subtag = alpha{2,8}, I'm using alpha{2,3}. Because, there's no language on CLDR lengthier than 3. + aux = unicodeLanguageId.match( /^(([a-z]{2,3})(-([A-Z][a-z]{3}))?(-([A-Z]{2}|[0-9]{3}))?)((-([a-zA-Z0-9]{5,8}|[0-9][a-zA-Z0-9]{3}))*)$|^(root)$/ ); + if ( aux === null ) { + return [ "und", "Zzzz", "ZZ" ]; + } + subtags[ 0 /* language */ ] = aux[ 10 ] /* root */ || aux[ 2 ] || "und"; + subtags[ 1 /* script */ ] = aux[ 4 ] || "Zzzz"; + subtags[ 2 /* territory */ ] = aux[ 6 ] || "ZZ"; + if ( aux[ 7 ] && aux[ 7 ].length ) { + subtags[ 3 /* variant */ ] = aux[ 7 ].slice( 1 ) /* remove leading "-" */; + } + + // 0: language + // 1: script + // 2: territory (aka region) + // 3: variant + // 4: unicodeLocaleExtensions + return subtags; + }; + + + + + var arrayForEach = function( array, callback ) { + var i, length; + if ( array.forEach ) { + return array.forEach( callback ); + } + for ( i = 0, length = array.length; i < length; i++ ) { + callback( array[ i ], i, array ); + } + }; + + + + + /** + * bundleLookup( minLanguageId ) + * + * @Cldr [Cldr class] + * + * @cldr [Cldr instance] + * + * @minLanguageId [String] requested languageId after applied remove likely subtags. + */ + var bundleLookup = function( Cldr, cldr, minLanguageId ) { + var availableBundleMap = Cldr._availableBundleMap, + availableBundleMapQueue = Cldr._availableBundleMapQueue; + + if ( availableBundleMapQueue.length ) { + arrayForEach( availableBundleMapQueue, function( bundle ) { + var existing, maxBundle, minBundle, subtags; + subtags = coreSubtags( bundle ); + maxBundle = coreLikelySubtags( Cldr, cldr, subtags ); + minBundle = coreRemoveLikelySubtags( Cldr, cldr, maxBundle ); + minBundle = minBundle.join( Cldr.localeSep ); + existing = availableBundleMapQueue[ minBundle ]; + if ( existing && existing.length < bundle.length ) { + return; + } + availableBundleMap[ minBundle ] = bundle; + }); + Cldr._availableBundleMapQueue = []; + } + + return availableBundleMap[ minLanguageId ] || null; + }; + + + + + var objectKeys = function( object ) { + var i, + result = []; + + if ( Object.keys ) { + return Object.keys( object ); + } + + for ( i in object ) { + result.push( i ); + } + + return result; + }; + + + + + var createError = function( code, attributes ) { + var error, message; + + message = code + ( attributes && JSON ? ": " + JSON.stringify( attributes ) : "" ); + error = new Error( message ); + error.code = code; + + // extend( error, attributes ); + arrayForEach( objectKeys( attributes ), function( attribute ) { + error[ attribute ] = attributes[ attribute ]; + }); + + return error; + }; + + + + + var validate = function( code, check, attributes ) { + if ( !check ) { + throw createError( code, attributes ); + } + }; + + + + + var validatePresence = function( value, name ) { + validate( "E_MISSING_PARAMETER", typeof value !== "undefined", { + name: name + }); + }; + + + + + var validateType = function( value, name, check, expected ) { + validate( "E_INVALID_PAR_TYPE", check, { + expected: expected, + name: name, + value: value + }); + }; + + + + + var validateTypePath = function( value, name ) { + validateType( value, name, typeof value === "string" || arrayIsArray( value ), "String or Array" ); + }; + + + + + /** + * Function inspired by jQuery Core, but reduced to our use case. + */ + var isPlainObject = function( obj ) { + return obj !== null && "" + obj === "[object Object]"; + }; + + + + + var validateTypePlainObject = function( value, name ) { + validateType( value, name, typeof value === "undefined" || isPlainObject( value ), "Plain Object" ); + }; + + + + + var validateTypeString = function( value, name ) { + validateType( value, name, typeof value === "string", "a string" ); + }; + + + + + // @path: normalized path + var resourceGet = function( data, path ) { + var i, + node = data, + length = path.length; + + for ( i = 0; i < length - 1; i++ ) { + node = node[ path[ i ] ]; + if ( !node ) { + return undefined; + } + } + return node[ path[ i ] ]; + }; + + + + + /** + * setAvailableBundles( Cldr, json ) + * + * @Cldr [Cldr class] + * + * @json resolved/unresolved cldr data. + * + * Set available bundles queue based on passed json CLDR data. Considers a bundle as any String at /main/{bundle}. + */ + var coreSetAvailableBundles = function( Cldr, json ) { + var bundle, + availableBundleMapQueue = Cldr._availableBundleMapQueue, + main = resourceGet( json, [ "main" ] ); + + if ( main ) { + for ( bundle in main ) { + if ( main.hasOwnProperty( bundle ) && bundle !== "root" && + availableBundleMapQueue.indexOf( bundle ) === -1 ) { + availableBundleMapQueue.push( bundle ); + } + } + } + }; + + + + var alwaysArray = function( somethingOrArray ) { + return arrayIsArray( somethingOrArray ) ? somethingOrArray : [ somethingOrArray ]; + }; + + + var jsonMerge = (function() { + + // Returns new deeply merged JSON. + // + // Eg. + // merge( { a: { b: 1, c: 2 } }, { a: { b: 3, d: 4 } } ) + // -> { a: { b: 3, c: 2, d: 4 } } + // + // @arguments JSON's + // + var merge = function() { + var destination = {}, + sources = [].slice.call( arguments, 0 ); + arrayForEach( sources, function( source ) { + var prop; + for ( prop in source ) { + if ( prop in destination && typeof destination[ prop ] === "object" && !arrayIsArray( destination[ prop ] ) ) { + + // Merge Objects + destination[ prop ] = merge( destination[ prop ], source[ prop ] ); + + } else { + + // Set new values + destination[ prop ] = source[ prop ]; + + } + } + }); + return destination; + }; + + return merge; + +}()); + + + /** + * load( Cldr, source, jsons ) + * + * @Cldr [Cldr class] + * + * @source [Object] + * + * @jsons [arguments] + */ + var coreLoad = function( Cldr, source, jsons ) { + var i, j, json; + + validatePresence( jsons[ 0 ], "json" ); + + // Support arbitrary parameters, e.g., `Cldr.load({...}, {...})`. + for ( i = 0; i < jsons.length; i++ ) { + + // Support array parameters, e.g., `Cldr.load([{...}, {...}])`. + json = alwaysArray( jsons[ i ] ); + + for ( j = 0; j < json.length; j++ ) { + validateTypePlainObject( json[ j ], "json" ); + source = jsonMerge( source, json[ j ] ); + coreSetAvailableBundles( Cldr, json[ j ] ); + } + } + + return source; + }; + + + + var itemGetResolved = function( Cldr, path, attributes ) { + // Resolve path + var normalizedPath = pathNormalize( path, attributes ); + + return resourceGet( Cldr._resolved, normalizedPath ); + }; + + + + + /** + * new Cldr() + */ + var Cldr = function( locale ) { + this.init( locale ); + }; + + // Build optimization hack to avoid duplicating functions across modules. + Cldr._alwaysArray = alwaysArray; + Cldr._coreLoad = coreLoad; + Cldr._createError = createError; + Cldr._itemGetResolved = itemGetResolved; + Cldr._jsonMerge = jsonMerge; + Cldr._pathNormalize = pathNormalize; + Cldr._resourceGet = resourceGet; + Cldr._validatePresence = validatePresence; + Cldr._validateType = validateType; + Cldr._validateTypePath = validateTypePath; + Cldr._validateTypePlainObject = validateTypePlainObject; + + Cldr._availableBundleMap = {}; + Cldr._availableBundleMapQueue = []; + Cldr._resolved = {}; + + // Allow user to override locale separator "-" (default) | "_". According to http://www.unicode.org/reports/tr35/#Unicode_language_identifier, both "-" and "_" are valid locale separators (eg. "en_GB", "en-GB"). According to http://unicode.org/cldr/trac/ticket/6786 its usage must be consistent throughout the data set. + Cldr.localeSep = "-"; + + /** + * Cldr.load( json [, json, ...] ) + * + * @json [JSON] CLDR data or [Array] Array of @json's. + * + * Load resolved cldr data. + */ + Cldr.load = function() { + Cldr._resolved = coreLoad( Cldr, Cldr._resolved, arguments ); + }; + + /** + * .init() automatically run on instantiation/construction. + */ + Cldr.prototype.init = function( locale ) { + var attributes, language, maxLanguageId, minLanguageId, script, subtags, territory, unicodeLocaleExtensions, variant, + sep = Cldr.localeSep; + + validatePresence( locale, "locale" ); + validateTypeString( locale, "locale" ); + + subtags = coreSubtags( locale ); + + unicodeLocaleExtensions = subtags[ 4 ]; + variant = subtags[ 3 ]; + + // Normalize locale code. + // Get (or deduce) the "triple subtags": language, territory (also aliased as region), and script subtags. + // Get the variant subtags (calendar, collation, currency, etc). + // refs: + // - http://www.unicode.org/reports/tr35/#Field_Definitions + // - http://www.unicode.org/reports/tr35/#Language_and_Locale_IDs + // - http://www.unicode.org/reports/tr35/#Unicode_locale_identifier + + // When a locale id does not specify a language, or territory (region), or script, they are obtained by Likely Subtags. + maxLanguageId = coreLikelySubtags( Cldr, this, subtags, { force: true } ) || subtags; + language = maxLanguageId[ 0 ]; + script = maxLanguageId[ 1 ]; + territory = maxLanguageId[ 2 ]; + + minLanguageId = coreRemoveLikelySubtags( Cldr, this, maxLanguageId ).join( sep ); + + // Set attributes + this.attributes = attributes = { + bundle: bundleLookup( Cldr, this, minLanguageId ), + + // Unicode Language Id + minlanguageId: minLanguageId, + maxLanguageId: maxLanguageId.join( sep ), + + // Unicode Language Id Subtabs + language: language, + script: script, + territory: territory, + region: territory, /* alias */ + variant: variant + }; + + // Unicode locale extensions. + unicodeLocaleExtensions && ( "-" + unicodeLocaleExtensions ).replace( /-[a-z]{3,8}|(-[a-z]{2})-([a-z]{3,8})/g, function( attribute, key, type ) { + + if ( key ) { + + // Extension is in the `keyword` form. + attributes[ "u" + key ] = type; + } else { + + // Extension is in the `attribute` form. + attributes[ "u" + attribute ] = true; + } + }); + + this.locale = locale; + }; + + /** + * .get() + */ + Cldr.prototype.get = function( path ) { + + validatePresence( path, "path" ); + validateTypePath( path, "path" ); + + return itemGetResolved( Cldr, path, this.attributes ); + }; + + /** + * .main() + */ + Cldr.prototype.main = function( path ) { + validatePresence( path, "path" ); + validateTypePath( path, "path" ); + + validate( "E_MISSING_BUNDLE", this.attributes.bundle !== null, { + locale: this.locale + }); + + path = alwaysArray( path ); + return this.get( [ "main/{bundle}" ].concat( path ) ); + }; + + return Cldr; + + + + +})); diff --git a/StockManMVC/.bin/bower_components/cldrjs/dist/cldr/event.js b/StockManMVC/.bin/bower_components/cldrjs/dist/cldr/event.js new file mode 100644 index 0000000..121b5c8 --- /dev/null +++ b/StockManMVC/.bin/bower_components/cldrjs/dist/cldr/event.js @@ -0,0 +1,585 @@ +/** + * CLDR JavaScript Library v0.4.4 + * http://jquery.com/ + * + * Copyright 2013 Rafael Xavier de Souza + * Released under the MIT license + * http://jquery.org/license + * + * Date: 2016-01-18T12:25Z + */ +/*! + * CLDR JavaScript Library v0.4.4 2016-01-18T12:25Z MIT license © Rafael Xavier + * http://git.io/h4lmVg + */ +(function( factory ) { + + if ( typeof define === "function" && define.amd ) { + // AMD. + define( [ "../cldr" ], factory ); + } else if ( typeof module === "object" && typeof module.exports === "object" ) { + // Node. CommonJS. + module.exports = factory( require( "cldrjs" ) ); + } else { + // Global + factory( Cldr ); + } + +}(function( Cldr ) { + + // Build optimization hack to avoid duplicating functions across modules. + var pathNormalize = Cldr._pathNormalize, + validatePresence = Cldr._validatePresence, + validateType = Cldr._validateType; + +/*! + * EventEmitter v4.2.7 - git.io/ee + * Oliver Caldwell + * MIT license + * @preserve + */ + +var EventEmitter; +/* jshint ignore:start */ +EventEmitter = (function () { + + + /** + * Class for managing events. + * Can be extended to provide event functionality in other classes. + * + * @class EventEmitter Manages event registering and emitting. + */ + function EventEmitter() {} + + // Shortcuts to improve speed and size + var proto = EventEmitter.prototype; + var exports = this; + var originalGlobalValue = exports.EventEmitter; + + /** + * Finds the index of the listener for the event in it's storage array. + * + * @param {Function[]} listeners Array of listeners to search through. + * @param {Function} listener Method to look for. + * @return {Number} Index of the specified listener, -1 if not found + * @api private + */ + function indexOfListener(listeners, listener) { + var i = listeners.length; + while (i--) { + if (listeners[i].listener === listener) { + return i; + } + } + + return -1; + } + + /** + * Alias a method while keeping the context correct, to allow for overwriting of target method. + * + * @param {String} name The name of the target method. + * @return {Function} The aliased method + * @api private + */ + function alias(name) { + return function aliasClosure() { + return this[name].apply(this, arguments); + }; + } + + /** + * Returns the listener array for the specified event. + * Will initialise the event object and listener arrays if required. + * Will return an object if you use a regex search. The object contains keys for each matched event. So /ba[rz]/ might return an object containing bar and baz. But only if you have either defined them with defineEvent or added some listeners to them. + * Each property in the object response is an array of listener functions. + * + * @param {String|RegExp} evt Name of the event to return the listeners from. + * @return {Function[]|Object} All listener functions for the event. + */ + proto.getListeners = function getListeners(evt) { + var events = this._getEvents(); + var response; + var key; + + // Return a concatenated array of all matching events if + // the selector is a regular expression. + if (evt instanceof RegExp) { + response = {}; + for (key in events) { + if (events.hasOwnProperty(key) && evt.test(key)) { + response[key] = events[key]; + } + } + } + else { + response = events[evt] || (events[evt] = []); + } + + return response; + }; + + /** + * Takes a list of listener objects and flattens it into a list of listener functions. + * + * @param {Object[]} listeners Raw listener objects. + * @return {Function[]} Just the listener functions. + */ + proto.flattenListeners = function flattenListeners(listeners) { + var flatListeners = []; + var i; + + for (i = 0; i < listeners.length; i += 1) { + flatListeners.push(listeners[i].listener); + } + + return flatListeners; + }; + + /** + * Fetches the requested listeners via getListeners but will always return the results inside an object. This is mainly for internal use but others may find it useful. + * + * @param {String|RegExp} evt Name of the event to return the listeners from. + * @return {Object} All listener functions for an event in an object. + */ + proto.getListenersAsObject = function getListenersAsObject(evt) { + var listeners = this.getListeners(evt); + var response; + + if (listeners instanceof Array) { + response = {}; + response[evt] = listeners; + } + + return response || listeners; + }; + + /** + * Adds a listener function to the specified event. + * The listener will not be added if it is a duplicate. + * If the listener returns true then it will be removed after it is called. + * If you pass a regular expression as the event name then the listener will be added to all events that match it. + * + * @param {String|RegExp} evt Name of the event to attach the listener to. + * @param {Function} listener Method to be called when the event is emitted. If the function returns true then it will be removed after calling. + * @return {Object} Current instance of EventEmitter for chaining. + */ + proto.addListener = function addListener(evt, listener) { + var listeners = this.getListenersAsObject(evt); + var listenerIsWrapped = typeof listener === 'object'; + var key; + + for (key in listeners) { + if (listeners.hasOwnProperty(key) && indexOfListener(listeners[key], listener) === -1) { + listeners[key].push(listenerIsWrapped ? listener : { + listener: listener, + once: false + }); + } + } + + return this; + }; + + /** + * Alias of addListener + */ + proto.on = alias('addListener'); + + /** + * Semi-alias of addListener. It will add a listener that will be + * automatically removed after it's first execution. + * + * @param {String|RegExp} evt Name of the event to attach the listener to. + * @param {Function} listener Method to be called when the event is emitted. If the function returns true then it will be removed after calling. + * @return {Object} Current instance of EventEmitter for chaining. + */ + proto.addOnceListener = function addOnceListener(evt, listener) { + return this.addListener(evt, { + listener: listener, + once: true + }); + }; + + /** + * Alias of addOnceListener. + */ + proto.once = alias('addOnceListener'); + + /** + * Defines an event name. This is required if you want to use a regex to add a listener to multiple events at once. If you don't do this then how do you expect it to know what event to add to? Should it just add to every possible match for a regex? No. That is scary and bad. + * You need to tell it what event names should be matched by a regex. + * + * @param {String} evt Name of the event to create. + * @return {Object} Current instance of EventEmitter for chaining. + */ + proto.defineEvent = function defineEvent(evt) { + this.getListeners(evt); + return this; + }; + + /** + * Uses defineEvent to define multiple events. + * + * @param {String[]} evts An array of event names to define. + * @return {Object} Current instance of EventEmitter for chaining. + */ + proto.defineEvents = function defineEvents(evts) { + for (var i = 0; i < evts.length; i += 1) { + this.defineEvent(evts[i]); + } + return this; + }; + + /** + * Removes a listener function from the specified event. + * When passed a regular expression as the event name, it will remove the listener from all events that match it. + * + * @param {String|RegExp} evt Name of the event to remove the listener from. + * @param {Function} listener Method to remove from the event. + * @return {Object} Current instance of EventEmitter for chaining. + */ + proto.removeListener = function removeListener(evt, listener) { + var listeners = this.getListenersAsObject(evt); + var index; + var key; + + for (key in listeners) { + if (listeners.hasOwnProperty(key)) { + index = indexOfListener(listeners[key], listener); + + if (index !== -1) { + listeners[key].splice(index, 1); + } + } + } + + return this; + }; + + /** + * Alias of removeListener + */ + proto.off = alias('removeListener'); + + /** + * Adds listeners in bulk using the manipulateListeners method. + * If you pass an object as the second argument you can add to multiple events at once. The object should contain key value pairs of events and listeners or listener arrays. You can also pass it an event name and an array of listeners to be added. + * You can also pass it a regular expression to add the array of listeners to all events that match it. + * Yeah, this function does quite a bit. That's probably a bad thing. + * + * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to add to multiple events at once. + * @param {Function[]} [listeners] An optional array of listener functions to add. + * @return {Object} Current instance of EventEmitter for chaining. + */ + proto.addListeners = function addListeners(evt, listeners) { + // Pass through to manipulateListeners + return this.manipulateListeners(false, evt, listeners); + }; + + /** + * Removes listeners in bulk using the manipulateListeners method. + * If you pass an object as the second argument you can remove from multiple events at once. The object should contain key value pairs of events and listeners or listener arrays. + * You can also pass it an event name and an array of listeners to be removed. + * You can also pass it a regular expression to remove the listeners from all events that match it. + * + * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to remove from multiple events at once. + * @param {Function[]} [listeners] An optional array of listener functions to remove. + * @return {Object} Current instance of EventEmitter for chaining. + */ + proto.removeListeners = function removeListeners(evt, listeners) { + // Pass through to manipulateListeners + return this.manipulateListeners(true, evt, listeners); + }; + + /** + * Edits listeners in bulk. The addListeners and removeListeners methods both use this to do their job. You should really use those instead, this is a little lower level. + * The first argument will determine if the listeners are removed (true) or added (false). + * If you pass an object as the second argument you can add/remove from multiple events at once. The object should contain key value pairs of events and listeners or listener arrays. + * You can also pass it an event name and an array of listeners to be added/removed. + * You can also pass it a regular expression to manipulate the listeners of all events that match it. + * + * @param {Boolean} remove True if you want to remove listeners, false if you want to add. + * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to add/remove from multiple events at once. + * @param {Function[]} [listeners] An optional array of listener functions to add/remove. + * @return {Object} Current instance of EventEmitter for chaining. + */ + proto.manipulateListeners = function manipulateListeners(remove, evt, listeners) { + var i; + var value; + var single = remove ? this.removeListener : this.addListener; + var multiple = remove ? this.removeListeners : this.addListeners; + + // If evt is an object then pass each of it's properties to this method + if (typeof evt === 'object' && !(evt instanceof RegExp)) { + for (i in evt) { + if (evt.hasOwnProperty(i) && (value = evt[i])) { + // Pass the single listener straight through to the singular method + if (typeof value === 'function') { + single.call(this, i, value); + } + else { + // Otherwise pass back to the multiple function + multiple.call(this, i, value); + } + } + } + } + else { + // So evt must be a string + // And listeners must be an array of listeners + // Loop over it and pass each one to the multiple method + i = listeners.length; + while (i--) { + single.call(this, evt, listeners[i]); + } + } + + return this; + }; + + /** + * Removes all listeners from a specified event. + * If you do not specify an event then all listeners will be removed. + * That means every event will be emptied. + * You can also pass a regex to remove all events that match it. + * + * @param {String|RegExp} [evt] Optional name of the event to remove all listeners for. Will remove from every event if not passed. + * @return {Object} Current instance of EventEmitter for chaining. + */ + proto.removeEvent = function removeEvent(evt) { + var type = typeof evt; + var events = this._getEvents(); + var key; + + // Remove different things depending on the state of evt + if (type === 'string') { + // Remove all listeners for the specified event + delete events[evt]; + } + else if (evt instanceof RegExp) { + // Remove all events matching the regex. + for (key in events) { + if (events.hasOwnProperty(key) && evt.test(key)) { + delete events[key]; + } + } + } + else { + // Remove all listeners in all events + delete this._events; + } + + return this; + }; + + /** + * Alias of removeEvent. + * + * Added to mirror the node API. + */ + proto.removeAllListeners = alias('removeEvent'); + + /** + * Emits an event of your choice. + * When emitted, every listener attached to that event will be executed. + * If you pass the optional argument array then those arguments will be passed to every listener upon execution. + * Because it uses `apply`, your array of arguments will be passed as if you wrote them out separately. + * So they will not arrive within the array on the other side, they will be separate. + * You can also pass a regular expression to emit to all events that match it. + * + * @param {String|RegExp} evt Name of the event to emit and execute listeners for. + * @param {Array} [args] Optional array of arguments to be passed to each listener. + * @return {Object} Current instance of EventEmitter for chaining. + */ + proto.emitEvent = function emitEvent(evt, args) { + var listeners = this.getListenersAsObject(evt); + var listener; + var i; + var key; + var response; + + for (key in listeners) { + if (listeners.hasOwnProperty(key)) { + i = listeners[key].length; + + while (i--) { + // If the listener returns true then it shall be removed from the event + // The function is executed either with a basic call or an apply if there is an args array + listener = listeners[key][i]; + + if (listener.once === true) { + this.removeListener(evt, listener.listener); + } + + response = listener.listener.apply(this, args || []); + + if (response === this._getOnceReturnValue()) { + this.removeListener(evt, listener.listener); + } + } + } + } + + return this; + }; + + /** + * Alias of emitEvent + */ + proto.trigger = alias('emitEvent'); + + /** + * Subtly different from emitEvent in that it will pass its arguments on to the listeners, as opposed to taking a single array of arguments to pass on. + * As with emitEvent, you can pass a regex in place of the event name to emit to all events that match it. + * + * @param {String|RegExp} evt Name of the event to emit and execute listeners for. + * @param {...*} Optional additional arguments to be passed to each listener. + * @return {Object} Current instance of EventEmitter for chaining. + */ + proto.emit = function emit(evt) { + var args = Array.prototype.slice.call(arguments, 1); + return this.emitEvent(evt, args); + }; + + /** + * Sets the current value to check against when executing listeners. If a + * listeners return value matches the one set here then it will be removed + * after execution. This value defaults to true. + * + * @param {*} value The new value to check for when executing listeners. + * @return {Object} Current instance of EventEmitter for chaining. + */ + proto.setOnceReturnValue = function setOnceReturnValue(value) { + this._onceReturnValue = value; + return this; + }; + + /** + * Fetches the current value to check against when executing listeners. If + * the listeners return value matches this one then it should be removed + * automatically. It will return true by default. + * + * @return {*|Boolean} The current value to check for or the default, true. + * @api private + */ + proto._getOnceReturnValue = function _getOnceReturnValue() { + if (this.hasOwnProperty('_onceReturnValue')) { + return this._onceReturnValue; + } + else { + return true; + } + }; + + /** + * Fetches the events object and creates one if required. + * + * @return {Object} The events storage object. + * @api private + */ + proto._getEvents = function _getEvents() { + return this._events || (this._events = {}); + }; + + /** + * Reverts the global {@link EventEmitter} to its previous value and returns a reference to this version. + * + * @return {Function} Non conflicting EventEmitter class. + */ + EventEmitter.noConflict = function noConflict() { + exports.EventEmitter = originalGlobalValue; + return EventEmitter; + }; + + return EventEmitter; +}()); +/* jshint ignore:end */ + + + + var validateTypeFunction = function( value, name ) { + validateType( value, name, typeof value === "undefined" || typeof value === "function", "Function" ); + }; + + + + + var superGet, superInit, + globalEe = new EventEmitter(); + + function validateTypeEvent( value, name ) { + validateType( value, name, typeof value === "string" || value instanceof RegExp, "String or RegExp" ); + } + + function validateThenCall( method, self ) { + return function( event, listener ) { + validatePresence( event, "event" ); + validateTypeEvent( event, "event" ); + + validatePresence( listener, "listener" ); + validateTypeFunction( listener, "listener" ); + + return self[ method ].apply( self, arguments ); + }; + } + + function off( self ) { + return validateThenCall( "off", self ); + } + + function on( self ) { + return validateThenCall( "on", self ); + } + + function once( self ) { + return validateThenCall( "once", self ); + } + + Cldr.off = off( globalEe ); + Cldr.on = on( globalEe ); + Cldr.once = once( globalEe ); + + /** + * Overload Cldr.prototype.init(). + */ + superInit = Cldr.prototype.init; + Cldr.prototype.init = function() { + var ee; + this.ee = ee = new EventEmitter(); + this.off = off( ee ); + this.on = on( ee ); + this.once = once( ee ); + superInit.apply( this, arguments ); + }; + + /** + * getOverload is encapsulated, because of cldr/unresolved. If it's loaded + * after cldr/event (and note it overwrites .get), it can trigger this + * overload again. + */ + function getOverload() { + + /** + * Overload Cldr.prototype.get(). + */ + superGet = Cldr.prototype.get; + Cldr.prototype.get = function( path ) { + var value = superGet.apply( this, arguments ); + path = pathNormalize( path, this.attributes ).join( "/" ); + globalEe.trigger( "get", [ path, value ] ); + this.ee.trigger( "get", [ path, value ] ); + return value; + }; + } + + Cldr._eventInit = getOverload; + getOverload(); + + return Cldr; + + + + +})); diff --git a/StockManMVC/.bin/bower_components/cldrjs/dist/cldr/supplemental.js b/StockManMVC/.bin/bower_components/cldrjs/dist/cldr/supplemental.js new file mode 100644 index 0000000..855de02 --- /dev/null +++ b/StockManMVC/.bin/bower_components/cldrjs/dist/cldr/supplemental.js @@ -0,0 +1,101 @@ +/** + * CLDR JavaScript Library v0.4.4 + * http://jquery.com/ + * + * Copyright 2013 Rafael Xavier de Souza + * Released under the MIT license + * http://jquery.org/license + * + * Date: 2016-01-18T12:25Z + */ +/*! + * CLDR JavaScript Library v0.4.4 2016-01-18T12:25Z MIT license © Rafael Xavier + * http://git.io/h4lmVg + */ +(function( factory ) { + + if ( typeof define === "function" && define.amd ) { + // AMD. + define( [ "../cldr" ], factory ); + } else if ( typeof module === "object" && typeof module.exports === "object" ) { + // Node. CommonJS. + module.exports = factory( require( "cldrjs" ) ); + } else { + // Global + factory( Cldr ); + } + +}(function( Cldr ) { + + // Build optimization hack to avoid duplicating functions across modules. + var alwaysArray = Cldr._alwaysArray; + + + + var supplementalMain = function( cldr ) { + + var prepend, supplemental; + + prepend = function( prepend ) { + return function( path ) { + path = alwaysArray( path ); + return cldr.get( [ prepend ].concat( path ) ); + }; + }; + + supplemental = prepend( "supplemental" ); + + // Week Data + // http://www.unicode.org/reports/tr35/tr35-dates.html#Week_Data + supplemental.weekData = prepend( "supplemental/weekData" ); + + supplemental.weekData.firstDay = function() { + return cldr.get( "supplemental/weekData/firstDay/{territory}" ) || + cldr.get( "supplemental/weekData/firstDay/001" ); + }; + + supplemental.weekData.minDays = function() { + var minDays = cldr.get( "supplemental/weekData/minDays/{territory}" ) || + cldr.get( "supplemental/weekData/minDays/001" ); + return parseInt( minDays, 10 ); + }; + + // Time Data + // http://www.unicode.org/reports/tr35/tr35-dates.html#Time_Data + supplemental.timeData = prepend( "supplemental/timeData" ); + + supplemental.timeData.allowed = function() { + return cldr.get( "supplemental/timeData/{territory}/_allowed" ) || + cldr.get( "supplemental/timeData/001/_allowed" ); + }; + + supplemental.timeData.preferred = function() { + return cldr.get( "supplemental/timeData/{territory}/_preferred" ) || + cldr.get( "supplemental/timeData/001/_preferred" ); + }; + + return supplemental; + + }; + + + + + var initSuper = Cldr.prototype.init; + + /** + * .init() automatically ran on construction. + * + * Overload .init(). + */ + Cldr.prototype.init = function() { + initSuper.apply( this, arguments ); + this.supplemental = supplementalMain( this ); + }; + + return Cldr; + + + + +})); diff --git a/StockManMVC/.bin/bower_components/cldrjs/dist/cldr/unresolved.js b/StockManMVC/.bin/bower_components/cldrjs/dist/cldr/unresolved.js new file mode 100644 index 0000000..0248ccb --- /dev/null +++ b/StockManMVC/.bin/bower_components/cldrjs/dist/cldr/unresolved.js @@ -0,0 +1,164 @@ +/** + * CLDR JavaScript Library v0.4.4 + * http://jquery.com/ + * + * Copyright 2013 Rafael Xavier de Souza + * Released under the MIT license + * http://jquery.org/license + * + * Date: 2016-01-18T12:25Z + */ +/*! + * CLDR JavaScript Library v0.4.4 2016-01-18T12:25Z MIT license © Rafael Xavier + * http://git.io/h4lmVg + */ +(function( factory ) { + + if ( typeof define === "function" && define.amd ) { + // AMD. + define( [ "../cldr" ], factory ); + } else if ( typeof module === "object" && typeof module.exports === "object" ) { + // Node. CommonJS. + module.exports = factory( require( "cldrjs" ) ); + } else { + // Global + factory( Cldr ); + } + +}(function( Cldr ) { + + // Build optimization hack to avoid duplicating functions across modules. + var coreLoad = Cldr._coreLoad; + var jsonMerge = Cldr._jsonMerge; + var pathNormalize = Cldr._pathNormalize; + var resourceGet = Cldr._resourceGet; + var validatePresence = Cldr._validatePresence; + var validateTypePath = Cldr._validateTypePath; + + + + var bundleParentLookup = function( Cldr, locale ) { + var normalizedPath, parent; + + if ( locale === "root" ) { + return; + } + + // First, try to find parent on supplemental data. + normalizedPath = pathNormalize( [ "supplemental/parentLocales/parentLocale", locale ] ); + parent = resourceGet( Cldr._resolved, normalizedPath ) || resourceGet( Cldr._raw, normalizedPath ); + if ( parent ) { + return parent; + } + + // Or truncate locale. + parent = locale.substr( 0, locale.lastIndexOf( Cldr.localeSep ) ); + if ( !parent ) { + return "root"; + } + + return parent; + }; + + + + + // @path: normalized path + var resourceSet = function( data, path, value ) { + var i, + node = data, + length = path.length; + + for ( i = 0; i < length - 1; i++ ) { + if ( !node[ path[ i ] ] ) { + node[ path[ i ] ] = {}; + } + node = node[ path[ i ] ]; + } + node[ path[ i ] ] = value; + }; + + + var itemLookup = (function() { + + var lookup; + + lookup = function( Cldr, locale, path, attributes, childLocale ) { + var normalizedPath, parent, value; + + // 1: Finish recursion + // 2: Avoid infinite loop + if ( typeof locale === "undefined" /* 1 */ || locale === childLocale /* 2 */ ) { + return; + } + + // Resolve path + normalizedPath = pathNormalize( path, attributes ); + + // Check resolved (cached) data first + // 1: Due to #16, never use the cached resolved non-leaf nodes. It may not + // represent its leafs in its entirety. + value = resourceGet( Cldr._resolved, normalizedPath ); + if ( value && typeof value !== "object" /* 1 */ ) { + return value; + } + + // Check raw data + value = resourceGet( Cldr._raw, normalizedPath ); + + if ( !value ) { + // Or, lookup at parent locale + parent = bundleParentLookup( Cldr, locale ); + value = lookup( Cldr, parent, path, jsonMerge( attributes, { bundle: parent }), locale ); + } + + if ( value ) { + // Set resolved (cached) + resourceSet( Cldr._resolved, normalizedPath, value ); + } + + return value; + }; + + return lookup; + +}()); + + + Cldr._raw = {}; + + /** + * Cldr.load( json [, json, ...] ) + * + * @json [JSON] CLDR data or [Array] Array of @json's. + * + * Load resolved or unresolved cldr data. + * Overwrite Cldr.load(). + */ + Cldr.load = function() { + Cldr._raw = coreLoad( Cldr, Cldr._raw, arguments ); + }; + + /** + * Overwrite Cldr.prototype.get(). + */ + Cldr.prototype.get = function( path ) { + validatePresence( path, "path" ); + validateTypePath( path, "path" ); + + // 1: use bundle as locale on item lookup for simplification purposes, because no other extended subtag is used anyway on bundle parent lookup. + // 2: during init(), this method is called, but bundle is yet not defined. Use "" as a workaround in this very specific scenario. + return itemLookup( Cldr, this.attributes && this.attributes.bundle /* 1 */ || "" /* 2 */, path, this.attributes ); + }; + + // In case cldr/unresolved is loaded after cldr/event, we trigger its overloads again. Because, .get is overwritten in here. + if ( Cldr._eventInit ) { + Cldr._eventInit(); + } + + return Cldr; + + + + +})); diff --git a/StockManMVC/.bin/bower_components/cldrjs/dist/node_main.js b/StockManMVC/.bin/bower_components/cldrjs/dist/node_main.js new file mode 100644 index 0000000..371f288 --- /dev/null +++ b/StockManMVC/.bin/bower_components/cldrjs/dist/node_main.js @@ -0,0 +1,22 @@ +/** + * CLDR JavaScript Library v0.4.4 + * http://jquery.com/ + * + * Copyright 2013 Rafael Xavier de Souza + * Released under the MIT license + * http://jquery.org/license + * + * Date: 2016-01-18T12:25Z + */ +/*! + * CLDR JavaScript Library v0.4.4 2016-01-18T12:25Z MIT license © Rafael Xavier + * http://git.io/h4lmVg + */ + +// Cldr +module.exports = require( "./cldr" ); + +// Extent Cldr with the following modules +require( "./cldr/event" ); +require( "./cldr/supplemental" ); +require( "./cldr/unresolved" ); diff --git a/StockManMVC/.bin/bower_components/cldrjs/doc/api/core/attributes.md b/StockManMVC/.bin/bower_components/cldrjs/doc/api/core/attributes.md new file mode 100644 index 0000000..02242d7 --- /dev/null +++ b/StockManMVC/.bin/bower_components/cldrjs/doc/api/core/attributes.md @@ -0,0 +1,15 @@ +## .attributes + +Attributes is an Object created during instance initialization (construction), and are used internally by `.get()` to replace dynamic parts of an item path. + +| Attribute | Field | +| --- | --- | +| `language` | Language Subtag ([spec](http://www.unicode.org/reports/tr35/#Language_Locale_Field_Definitions)) | +| `script` | Script Subtag ([spec](http://www.unicode.org/reports/tr35/#Language_Locale_Field_Definitions)) | +| `region` or `territory` | Region Subtag ([spec](http://www.unicode.org/reports/tr35/#Language_Locale_Field_Definitions)) | +| `languageId` | Language Id ([spec](http://www.unicode.org/reports/tr35/#Unicode_language_identifier)) | +| `maxLanguageId` | Maximized Language Id ([spec](http://www.unicode.org/reports/tr35/#Likely_Subtags)) | + +- `language`, `script`, `territory` (also aliased as `region`), and `maxLanguageId` are computed by [adding likely subtags](./src/likely-subtags.js) according to the [specification](http://www.unicode.org/reports/tr35/#Likely_Subtags). +- `languageId` is always in the succint form, obtained by [removing the likely subtags from `maxLanguageId`](./src/remove-likely-subtags.js) according to the [specification](http://www.unicode.org/reports/tr35/#Likely_Subtags). + diff --git a/StockManMVC/.bin/bower_components/cldrjs/doc/api/core/constructor.md b/StockManMVC/.bin/bower_components/cldrjs/doc/api/core/constructor.md new file mode 100644 index 0000000..a6c3b86 --- /dev/null +++ b/StockManMVC/.bin/bower_components/cldrjs/doc/api/core/constructor.md @@ -0,0 +1,9 @@ +## new Cldr( locale ) + +Create a new instance of Cldr. + +| Parameter | Type | Exampe | +| --- | --- | --- | +| *locale* | String | `"en"`, `"pt-BR"` | + +More information in the [specification](http://www.unicode.org/reports/tr35/#Locale). diff --git a/StockManMVC/.bin/bower_components/cldrjs/doc/api/core/get.md b/StockManMVC/.bin/bower_components/cldrjs/doc/api/core/get.md new file mode 100644 index 0000000..eaf6f88 --- /dev/null +++ b/StockManMVC/.bin/bower_components/cldrjs/doc/api/core/get.md @@ -0,0 +1,18 @@ +## .get( path ) + +Get the item data given its path, or `undefined` if missing. + +| Parameter | Type | Exampe | +| --- | --- | --- | +| *path* | String or
Array | `"/cldr/main/{languageId}/numbers/symbols-numberSystem-latn/decimal"`
`[ "cldr", "main", "{languageId}", "numbers", "symbols-numberSystem-latn", "decimal" ]` | + +On *path* parameter, note the leading "/cldr" can be ommited. Also, note that its Array form accepts subpaths, eg. `[ "cldr/main", "{languageId}", "numbers/symbols-numberSystem-latn/"decimal" ]`. + +The [locale attributes](#cldrattributes), eg. `{languageId}`, are replaced with their appropriate values. + +If extended with the `cldr/unresolved.js` module, get the item data or lookup by following [locale inheritance](http://www.unicode.org/reports/tr35/#Locale_Inheritance), set a local resolved cache if it's found (for subsequent faster access), or return `undefined`. + +```javascript +ptBr.get( "main/{languageId}/numbers/symbols-numberSystem-latn/decimal" ); +// ➡ "," +``` diff --git a/StockManMVC/.bin/bower_components/cldrjs/doc/api/core/load.md b/StockManMVC/.bin/bower_components/cldrjs/doc/api/core/load.md new file mode 100644 index 0000000..6c65fbd --- /dev/null +++ b/StockManMVC/.bin/bower_components/cldrjs/doc/api/core/load.md @@ -0,0 +1,23 @@ +## Cldr.load( json, ... ) + +Load resolved or unresolved [1] JSON data. + +| Parameter | Type | Description | +| --- | --- | --- | +| *json* | Object | Resolved or unresolved [1] CLDR JSON data | + +```javascript +Cldr.load({ + "main": { + "pt-BR": { + "numbers": { + "symbols-numberSystem-latn": { + "decimal": "," + } + } + } + } +}); +``` + +1: Unresolved processing is **only available** after loading `cldr/unresolved.js` extension module. diff --git a/StockManMVC/.bin/bower_components/cldrjs/doc/api/core/main.md b/StockManMVC/.bin/bower_components/cldrjs/doc/api/core/main.md new file mode 100644 index 0000000..ce7e69b --- /dev/null +++ b/StockManMVC/.bin/bower_components/cldrjs/doc/api/core/main.md @@ -0,0 +1,12 @@ +## .main( path ) + +It's an alias for `.get([ "main/{languageId}", ... ])`. + +| Parameter | Type | Exampe | +| --- | --- | --- | +| *path* | String or
Array | See `cldr.get()` for more information | + +```javascript +ptBr.main( "numbers/symbols-numberSystem-latn/decimal" ); +// ➡ "," +``` diff --git a/StockManMVC/.bin/bower_components/cldrjs/doc/api/event/event_get.md b/StockManMVC/.bin/bower_components/cldrjs/doc/api/event/event_get.md new file mode 100644 index 0000000..2fd7361 --- /dev/null +++ b/StockManMVC/.bin/bower_components/cldrjs/doc/api/event/event_get.md @@ -0,0 +1,10 @@ +## get ➡ ( path, value ) + +Triggered before a `.get()` (or any alias) return. The triggered listener receives the normalized *path* and the *value* found. + +| Parameter | Description | +| --- | --- | +| *path* | See [../core/get.md](.get()) for more information | +| *value* | See [../core/get.md](.get()) for more information | + +See [Cldr.on()](global_on.md) or [.on()](on.md) for example. diff --git a/StockManMVC/.bin/bower_components/cldrjs/doc/api/event/global_off.md b/StockManMVC/.bin/bower_components/cldrjs/doc/api/event/global_off.md new file mode 100644 index 0000000..8c3072c --- /dev/null +++ b/StockManMVC/.bin/bower_components/cldrjs/doc/api/event/global_off.md @@ -0,0 +1,10 @@ +## Cldr.off( event, listener ) + +Removes a listener function from the specified event globally (for all instances). + +| Parameter | Type | Exampe | +| --- | --- | --- | +| *event* | String | `"get"` | +| *listener* | Function | | + +See [Cldr.on()](global_on.md) for example. diff --git a/StockManMVC/.bin/bower_components/cldrjs/doc/api/event/global_on.md b/StockManMVC/.bin/bower_components/cldrjs/doc/api/event/global_on.md new file mode 100644 index 0000000..5e7decc --- /dev/null +++ b/StockManMVC/.bin/bower_components/cldrjs/doc/api/event/global_on.md @@ -0,0 +1,32 @@ +## Cldr.on( event, listener ) + +Add a listener function to the specified event globally (for all instances). + +| Parameter | Type | Exampe | +| --- | --- | --- | +| *event* | String | `"get"` | +| *listener* | Function | | + +```javascript +Cldr.load({ + foo: "bar" +}); + +function log( path, value ) { + console.log( "Got", path, value ); +} + +Cldr.on( "get", log ); + +en = new Cldr( "en" ); +en.get( "foo" ); +// Got foo bar (logged) +// ➡ bar + +zh = new Cldr( "zh" ); +zh.get( "foo" ); +// Got foo bar (logged) +// ➡ bar + +Cldr.off( "get", log ); +``` diff --git a/StockManMVC/.bin/bower_components/cldrjs/doc/api/event/global_once.md b/StockManMVC/.bin/bower_components/cldrjs/doc/api/event/global_once.md new file mode 100644 index 0000000..54c4956 --- /dev/null +++ b/StockManMVC/.bin/bower_components/cldrjs/doc/api/event/global_once.md @@ -0,0 +1,28 @@ +## Cldr.once( event, listener ) + +Add a listener function to the specified event globally (for all instances). It will be automatically removed after it's first execution. + +| Parameter | Type | Exampe | +| --- | --- | --- | +| *event* | String | `"get"` | +| *listener* | Function | | + +```javascript +Cldr.load({ + foo: "bar" +}); + +function log( path, value ) { + console.log( "Got", path, value ); +} + +Cldr.once( "get", log ); + +cldr = new Cldr( "en" ); +cldr.get( "foo" ); +// Got foo bar (logged) +// ➡ bar + +cldr.get( "foo" ); +// ➡ bar +``` diff --git a/StockManMVC/.bin/bower_components/cldrjs/doc/api/event/off.md b/StockManMVC/.bin/bower_components/cldrjs/doc/api/event/off.md new file mode 100644 index 0000000..bf74ded --- /dev/null +++ b/StockManMVC/.bin/bower_components/cldrjs/doc/api/event/off.md @@ -0,0 +1,10 @@ +## .off( event, listener ) + +Removes a listener function from the specified event for this instance. + +| Parameter | Type | Exampe | +| --- | --- | --- | +| *event* | String | `"get"` | +| *listener* | Function | | + +See [cldr.on()](on.md) for example. diff --git a/StockManMVC/.bin/bower_components/cldrjs/doc/api/event/on.md b/StockManMVC/.bin/bower_components/cldrjs/doc/api/event/on.md new file mode 100644 index 0000000..d9915b1 --- /dev/null +++ b/StockManMVC/.bin/bower_components/cldrjs/doc/api/event/on.md @@ -0,0 +1,26 @@ +## .on( event, listener ) + +Add a listener function to the specified event for this instance. + +| Parameter | Type | Exampe | +| --- | --- | --- | +| *event* | String | `"get"` | +| *listener* | Function | | + +```javascript +Cldr.load({ + foo: "bar" +}); + +function log( path, value ) { + console.log( "Got", path, value ); +} + +cldr = new Cldr( "en" ); +cldr.on( "get", log ); +cldr.get( "foo" ); +// Got foo bar (logged) +// ➡ bar + +cldr.off( "get", log ); +``` diff --git a/StockManMVC/.bin/bower_components/cldrjs/doc/api/event/once.md b/StockManMVC/.bin/bower_components/cldrjs/doc/api/event/once.md new file mode 100644 index 0000000..39e8979 --- /dev/null +++ b/StockManMVC/.bin/bower_components/cldrjs/doc/api/event/once.md @@ -0,0 +1,27 @@ +## .once( event, listener ) + +Add a listener function to the specified event for this instance. It will be automatically removed after it's first execution. + +| Parameter | Type | Exampe | +| --- | --- | --- | +| *event* | String | `"get"` | +| *listener* | Function | | + +```javascript +Cldr.load({ + foo: "bar" +}); + +function log( path, value ) { + console.log( "Got", path, value ); +} + +cldr = new Cldr( "en" ); +cldr.once( "get", log ); +cldr.get( "foo" ); +// Got foo bar (logged) +// ➡ bar + +cldr.get( "foo" ); +// ➡ bar +``` diff --git a/StockManMVC/.bin/bower_components/cldrjs/doc/api/supplemental.md b/StockManMVC/.bin/bower_components/cldrjs/doc/api/supplemental.md new file mode 100644 index 0000000..ceb2231 --- /dev/null +++ b/StockManMVC/.bin/bower_components/cldrjs/doc/api/supplemental.md @@ -0,0 +1,12 @@ +## .supplemental( path ) + +It's an alias for `.get([ "supplemental", ... ])`. + +| Parameter | Type | Exampe | +| --- | --- | --- | +| *path* | String or
Array | See `cldr.get()` for more information | + +```javascript +en.supplemental( "gender/personList/{language}" ); +// ➡ "neutral" +``` diff --git a/StockManMVC/.bin/bower_components/cldrjs/doc/api/supplemental/time_data_allowed.md b/StockManMVC/.bin/bower_components/cldrjs/doc/api/supplemental/time_data_allowed.md new file mode 100644 index 0000000..3bafd3f --- /dev/null +++ b/StockManMVC/.bin/bower_components/cldrjs/doc/api/supplemental/time_data_allowed.md @@ -0,0 +1,8 @@ +## .supplemental.timeData.allowed() + +Helper function. Return the supplemental timeData allowed of locale's territory. + +```javascript +en.supplemental.timeData.allowed(); +// ➡ "H h" +``` diff --git a/StockManMVC/.bin/bower_components/cldrjs/doc/api/supplemental/time_data_preferred.md b/StockManMVC/.bin/bower_components/cldrjs/doc/api/supplemental/time_data_preferred.md new file mode 100644 index 0000000..d4d0425 --- /dev/null +++ b/StockManMVC/.bin/bower_components/cldrjs/doc/api/supplemental/time_data_preferred.md @@ -0,0 +1,8 @@ +## .supplemental.timeData.preferred() + +Helper function. Return the supplemental timeData preferred of locale's territory. + +```javascript +en.supplemental.timeData.preferred(); +// ➡ "h" +``` diff --git a/StockManMVC/.bin/bower_components/cldrjs/doc/api/supplemental/week_data_first_day.md b/StockManMVC/.bin/bower_components/cldrjs/doc/api/supplemental/week_data_first_day.md new file mode 100644 index 0000000..f0064e9 --- /dev/null +++ b/StockManMVC/.bin/bower_components/cldrjs/doc/api/supplemental/week_data_first_day.md @@ -0,0 +1,8 @@ +## .supplemental.weekData.firstDay() + +Helper function. Return the supplemental weekData firstDay of locale's territory. + +```javascript +en.supplemental.weekData.firstDay(); +// ➡ "sun" +``` diff --git a/StockManMVC/.bin/bower_components/cldrjs/doc/api/supplemental/week_data_min_days.md b/StockManMVC/.bin/bower_components/cldrjs/doc/api/supplemental/week_data_min_days.md new file mode 100644 index 0000000..efdd0a8 --- /dev/null +++ b/StockManMVC/.bin/bower_components/cldrjs/doc/api/supplemental/week_data_min_days.md @@ -0,0 +1,8 @@ +## .supplemental.weekData.minDays() + +Helper function. Return the supplemental weekData minDays of locale's territory as a Number. + +```javascript +en.supplemental.weekData.minDays(); +// ➡ 1 +``` diff --git a/StockManMVC/.bin/bower_components/cldrjs/doc/api/unresolved/get.md b/StockManMVC/.bin/bower_components/cldrjs/doc/api/unresolved/get.md new file mode 100644 index 0000000..bc35931 --- /dev/null +++ b/StockManMVC/.bin/bower_components/cldrjs/doc/api/unresolved/get.md @@ -0,0 +1,12 @@ +## .get( path ) + +Overload (extend) `.get()` to get the item data or lookup by following [locale inheritance](http://www.unicode.org/reports/tr35/#Locale_Inheritance), set a local resolved cache if it's found (for subsequent faster access), or return `undefined`. + +| Parameter | Type | Exampe | +| --- | --- | --- | +| *path* | String or
Array | See `cldr.get()` above for more information | + +```javascript +ptBr.get( "main/{languageId}/numbers/symbols-numberSystem-latn/decimal" ); +// ➡ "," +``` diff --git a/StockManMVC/.bin/bower_components/cldrjs/doc/asset/jquery.png b/StockManMVC/.bin/bower_components/cldrjs/doc/asset/jquery.png new file mode 100644 index 0000000..6eb7a1f Binary files /dev/null and b/StockManMVC/.bin/bower_components/cldrjs/doc/asset/jquery.png differ diff --git a/StockManMVC/.bin/bower_components/cldrjs/doc/bundle_lookup_matcher.md b/StockManMVC/.bin/bower_components/cldrjs/doc/bundle_lookup_matcher.md new file mode 100644 index 0000000..e3e0c06 --- /dev/null +++ b/StockManMVC/.bin/bower_components/cldrjs/doc/bundle_lookup_matcher.md @@ -0,0 +1,134 @@ +## Bundle Lookup Matcher + +Bundle Lookup is the process of selecting the right dataset for the requested locale. We run this process during instance creation and set it on `instance.attributes.bundle`, which is further used when traversing items of the **main** dataset. + +User must load likelySubtags and any wanted main datasets prior to creating an instance. For example: + +```javascript +Cldr.load( + require( "cldr-data/supplemental/likelySubtags" ), // JSON data from supplemental/likelySubtags.json + require( "cldr-data/main/en-US/ca-gregorian" ), // JSON data from main/en-US/ca-gregorian.json + require( "cldr-data/main/en-GB/ca-gregorian" ) // JSON data from main/en-GB/ca-gregorian.json +); + +var enUs = new Cldr( "en-US" ); +console.log( enUs.attributes.bundle ); // "en-US" +console.log( enUs.main( "dates/calendars/gregorian/dateFormats/short" ) ); // "M/d/yy" + +var enGb = new Cldr( "en-GB" ); +console.log( enGb.attributes.bundle ); // "en-GB" +console.log( enGb.main( "dates/calendars/gregorian/dateFormats/short" ) ); // "dd/MM/y" +``` + +When instances are created, its `.attributes.bundle` reveals the matched bundle. The `.main` method uses this information to traverse the correct main item. + +What happens if we include `main/en/ca-gregorian` to the above example? + +```javascript +Cldr.load( + require( "cldr-data/supplemental/likelySubtags" ), // JSON data from supplemental/likelySubtags.json + require( "cldr-data/main/en/ca-gregorian" ), // JSON data from main/en/ca-gregorian.json + require( "cldr-data/main/en-US/ca-gregorian" ), // JSON data from main/en-US/ca-gregorian.json + require( "cldr-data/main/en-GB/ca-gregorian" ) // JSON data from main/en-GB/ca-gregorian.json +); + +var enUs = new Cldr( "en-US" ); // English as spoken in United States. +console.log( enUs.attributes.bundle ); // "en" +console.log( enUs.main( "dates/calendars/gregorian/dateFormats/short" ) ); // "M/d/yy" + +var enGb = new Cldr( "en-GB" ); // English as spoken in Great Britain. +console.log( enGb.attributes.bundle ); // "en-GB" +console.log( enGb.main( "dates/calendars/gregorian/dateFormats/short" ) ); // "dd/MM/y" +``` + +Now, the `en-US` requested locale uses the `en` bundle (not the `en-US` bundle as used in the first example) and `en-GB` still uses the `en-GB` bundle. Why? Because, `en` is the default content for `en-US` (deduced from likelySubtags data). Default content means that the child content is all in the parent. Therefore, both `en` and `en-US` are identical. Our bundle lookup matching algorithm always picks the grandest available parent. Note the retrieved main item is still the correct one (as it should be). + +A good observer may notice that loading both `main/en/ca-gregorian` and `main/en-US/ca-gregorian` is redundant. Although loading both is not a problem, loading either the `en` or the `en-US` bundle alone is enough. + +Let's add a bit of sugar to the requested locales. + +```javascript +var en = new Cldr( "en" ); // English. +console.log( en.attributes.bundle ); // "en" + +var enUs = new Cldr( "en-US" ); // English as spoken in United States. +console.log( enUs.attributes.bundle ); // "en" + +var enLatnUs = new Cldr( "en-Latn-US" ); // English in Latin script as spoken in the United States. +console.log( enLatnUs.attributes.bundle ); // "en" +``` + +All instances above obviously matches the same `en` bundle. Because, (a) `en` is the default content for `en-US` and (b) `en-US` is the default content for `en-Latn-US`. + +What happens if the requested locale includes [Unicode extensions][]? + +```javascript +var en = new Cldr( "en-US-u-cu-USD" ); +console.log( en.attributes.bundle ); // "en" +console.log( en.main( "numbers/currencies/{u-cu}/displayName" ) ); // "US Dollar" +``` + +[Unicode extensions][] are obviously ignored on bundle lookup. Note they are accessible via variable replacements. + +Below are other non-obvious lookups. + +```javascript +Cldr.load( + require( "cldr-data/supplemental/likelySubtags" ), // JSON data from supplemental/likelySubtags.json + require( "cldr-data/main/sr-Cyrl/numbers" ), // JSON data from main/sr-Cyrl/numbers.json + require( "cldr-data/main/sr-Latn/numbers" ), // JSON data from main/sr-Latn/numbers.json + require( "cldr-data/main/zh-Hant/numbers" ) // JSON data from main/zh-Hant/numbers.json +); + +var srCyrl = new Cldr( "sr-Cyrl" ); +console.log( srCyrl.attributes.bundle ); // "sr-Cyrl" +console.log( srCyrl.main( "numbers/decimalFormats-numberSystem-latn/short/decimalFormat/1000-count-one" ) ); +// ➜ "0 хиљ'.'" + +var srRS = new Cldr( "sr-RS" ); +console.log( srRs.attributes.bundle ); // "sr-Cyrl" +console.log( srRs.main( "numbers/decimalFormats-numberSystem-latn/short/decimalFormat/1000-count-one" ) ); +// ➜ "0 хиљ'.'" + +var srLatnRS = new Cldr( "sr-Latn-RS" ); +console.log( srLatnRS.attributes.bundle ); // "sr-Latn" +console.log( srLatnRS.main( "numbers/decimalFormats-numberSystem-latn/short/decimalFormat/1000-count-one" ) ); +// ➜ "0 hilj'.'" + +var zhTW = new Cldr( "zh-TW" ); +console.log( zhTW.attributes.bundle ); // "zh-Hant" +console.log( zhTW.main( "numbers/symbols-numberSystem-hanidec/nan" ) ); // "非數值" +``` + +Finally, if an instance is created whose bundle hasn't been loaded yet, its `.attributes.bundle` is set as `null`. If this instance is used to traverse a main dataset, an error is thrown. If this instance is used to traverse any non-main dataset (e.g., supplemental/postalCodeData.json) it can be used just fine. + +```javascript +var zhCN = new Cldr( "zh-CN" ); +console.log( zhCN.attributes.bundle ); // null +console.log( zhCN.main( /* something */ ) ); // Error: E_MISSING_BUNDLE +``` + +### Implementation details + +[UTS#35][] doesn't specify how bundle lookup matcher should be implemented. [RFC 4647][] section 3.4 "Lookup" has an algorithm for that, although it fails in various cases listed above. Mark Davis, the co-founder and president of the Unicode Consortium, said (via CLDR mailing list and via [Fixing Inheritance doc][]) that bundle lookup should happen via [LanguageMatching](http://www.unicode.org/reports/tr35/#LanguageMatching). + +Our belief is that LanguageMatching is a great algorithm for Best Fit Matcher. Although, it's an overkill for Lookup Matcher. + +ICU (a known CLDR implementation) doesn't use LanguageMatching for Bundle Lookup Matcher either. But, it has its own implementation, which has its own flaws as Mark Davis says in the Fixing Inheritance doc "ICU uses the %%ALIAS element to counteract some of these problems... It doesn’t fix all of them, and the data is not derivable from CLDR." + +We also believe ICU's aliases approach is not the best solution. Instead we believe in the following approach, whose result matches LanguageMatching with a score threshold of 100%. + +`BundleLookupMatcher( requestedLocale, availableBundles )` is used for bundle lookup given an arbitrary `requestedLocale`. + + 1. Create a Hash (aka Dictionary or Key-Value-Pair) object, named `availableBundlesMap`, that maps each `availableBundle` (value) to its respective [Remove Likely Subtags][] result (key). + 1. In case of a duplicate key, keep the smaller value, i.e., keep the available bundle locale whose length is the smallest; e.g., keep { "en": "en" } instead of { "en": "en-US" }. + 1. [Remove Likely Subtags][] from `requestedLocale` and let `minRequestedLocale` keep its result. + 1. Return `availableBundlesMap[ minRequestedLocale ]`. + +This algorithm is faster than LanguageMatching and needs no extra CLDR to be created and maintained (likelySubtags is sufficient). Note the `availableBundlesMap` can be cached for improved performance on repeated calls. + +[Fixing Inheritance doc]: https://docs.google.com/document/d/1qZwEVb4kfODi2TK5f4x15FYWj5rJRijXmSIg5m6OH8s/edit +[Remove Likely Subtags]: http://www.unicode.org/reports/tr35/tr35.html#Likely_Subtags +[RFC 4647]: http://www.ietf.org/rfc/rfc4647.txt +[Unicode extensions]: http://Www.unicode.org/reports/tr35/#u_Extension +[UTS#35]: http://www.unicode.org/reports/tr35 diff --git a/StockManMVC/.bin/bower_components/cldrjs/package.json b/StockManMVC/.bin/bower_components/cldrjs/package.json new file mode 100644 index 0000000..e11167d --- /dev/null +++ b/StockManMVC/.bin/bower_components/cldrjs/package.json @@ -0,0 +1,64 @@ +{ + "name": "cldrjs", + "version": "0.4.4", + "description": "Simple CLDR traverser", + "keywords": [ + "utility", + "globalization", + "internationalization", + "multilingualization", + "localization", + "g11n", + "i18n", + "m17n", + "L10n", + "localize", + "locale", + "cldr", + "json", + "inheritance", + "compiler" + ], + "main": "dist/node_main.js", + "files": [ + "CHANGELOG.md", + "DCO.md", + "dist/", + "doc/", + "LICENSE-MIT", + "README.md" + ], + "repository": { + "type": "git", + "url": "git://github.com/rxaviers/cldrjs.git" + }, + "readmeFilename": "README.md", + "author": { + "name": "Rafael Xavier de Souza", + "email": "rxaviers@gmail.com", + "url": "http://rafael.xavier.blog.br" + }, + "licenses": [ + { + "type": "MIT", + "url": "https://github.com/rxaviers/cldrjs/blob/master/LICENSE-MIT" + } + ], + "peerDependencies": { + "cldr-data": ">=25" + }, + "devDependencies": { + "cldr-data-downloader": "0.2.x", + "grunt": "0.4.x", + "grunt-compare-size": "0.4.0", + "grunt-contrib-connect": "0.3.x", + "grunt-contrib-copy": "0.4.x", + "grunt-contrib-jshint": "0.10.x", + "grunt-contrib-requirejs": "0.4.x", + "grunt-contrib-uglify": "0.2.x", + "grunt-dco": "0.0.3", + "gzip-js": "0.3.2", + "grunt-mocha": "0.3.x", + "matchdep": "*" + } +} diff --git a/StockManMVC/.bin/bower_components/cldrjs/src/.dist_jshintrc b/StockManMVC/.bin/bower_components/cldrjs/src/.dist_jshintrc new file mode 100644 index 0000000..4eae8e7 --- /dev/null +++ b/StockManMVC/.bin/bower_components/cldrjs/src/.dist_jshintrc @@ -0,0 +1,17 @@ +{ + "boss": true, + "curly": true, + "eqeqeq": true, + "eqnull": true, + "expr": true, + "immed": true, + "noarg": true, + "onevar": false, + "quotmark": "double", + "smarttabs": true, + "trailing": true, + "undef": true, + "unused": true, + + "predef": [ "Cldr", "define", "module", "require" ] +} diff --git a/StockManMVC/.bin/bower_components/cldrjs/src/.jshintrc b/StockManMVC/.bin/bower_components/cldrjs/src/.jshintrc new file mode 100644 index 0000000..0a9a03c --- /dev/null +++ b/StockManMVC/.bin/bower_components/cldrjs/src/.jshintrc @@ -0,0 +1,17 @@ +{ + "boss": true, + "curly": true, + "eqeqeq": true, + "eqnull": true, + "expr": true, + "immed": true, + "noarg": true, + "onevar": false, + "quotmark": "double", + "smarttabs": true, + "trailing": true, + "undef": true, + "unused": true, + + "predef": [ "define" ] +} diff --git a/StockManMVC/.bin/bower_components/cldrjs/src/build/intro.min.js b/StockManMVC/.bin/bower_components/cldrjs/src/build/intro.min.js new file mode 100644 index 0000000..47b5dc6 --- /dev/null +++ b/StockManMVC/.bin/bower_components/cldrjs/src/build/intro.min.js @@ -0,0 +1,4 @@ +/*! + * CLDR JavaScript Library v@VERSION @DATE MIT license © Rafael Xavier + * http://git.io/h4lmVg + */ diff --git a/StockManMVC/.bin/bower_components/cldrjs/src/build/intro_core.js b/StockManMVC/.bin/bower_components/cldrjs/src/build/intro_core.js new file mode 100644 index 0000000..8490f60 --- /dev/null +++ b/StockManMVC/.bin/bower_components/cldrjs/src/build/intro_core.js @@ -0,0 +1,28 @@ +/** + * CLDR JavaScript Library v@VERSION + * http://jquery.com/ + * + * Copyright 2013 Rafael Xavier de Souza + * Released under the MIT license + * http://jquery.org/license + * + * Date: @DATE + */ +/*! + * CLDR JavaScript Library v@VERSION @DATE MIT license © Rafael Xavier + * http://git.io/h4lmVg + */ +(function( root, factory ) { + + if ( typeof define === "function" && define.amd ) { + // AMD. + define( factory ); + } else if ( typeof module === "object" && typeof module.exports === "object" ) { + // Node. CommonJS. + module.exports = factory(); + } else { + // Global + root.Cldr = factory(); + } + +}( this, function() { diff --git a/StockManMVC/.bin/bower_components/cldrjs/src/build/intro_event.js b/StockManMVC/.bin/bower_components/cldrjs/src/build/intro_event.js new file mode 100644 index 0000000..8b0a53f --- /dev/null +++ b/StockManMVC/.bin/bower_components/cldrjs/src/build/intro_event.js @@ -0,0 +1,34 @@ +/** + * CLDR JavaScript Library v@VERSION + * http://jquery.com/ + * + * Copyright 2013 Rafael Xavier de Souza + * Released under the MIT license + * http://jquery.org/license + * + * Date: @DATE + */ +/*! + * CLDR JavaScript Library v@VERSION @DATE MIT license © Rafael Xavier + * http://git.io/h4lmVg + */ +(function( factory ) { + + if ( typeof define === "function" && define.amd ) { + // AMD. + define( [ "../cldr" ], factory ); + } else if ( typeof module === "object" && typeof module.exports === "object" ) { + // Node. CommonJS. + module.exports = factory( require( "cldrjs" ) ); + } else { + // Global + factory( Cldr ); + } + +}(function( Cldr ) { + + // Build optimization hack to avoid duplicating functions across modules. + var pathNormalize = Cldr._pathNormalize, + validatePresence = Cldr._validatePresence, + validateType = Cldr._validateType; + diff --git a/StockManMVC/.bin/bower_components/cldrjs/src/build/intro_supplemental.js b/StockManMVC/.bin/bower_components/cldrjs/src/build/intro_supplemental.js new file mode 100644 index 0000000..6a662a2 --- /dev/null +++ b/StockManMVC/.bin/bower_components/cldrjs/src/build/intro_supplemental.js @@ -0,0 +1,32 @@ +/** + * CLDR JavaScript Library v@VERSION + * http://jquery.com/ + * + * Copyright 2013 Rafael Xavier de Souza + * Released under the MIT license + * http://jquery.org/license + * + * Date: @DATE + */ +/*! + * CLDR JavaScript Library v@VERSION @DATE MIT license © Rafael Xavier + * http://git.io/h4lmVg + */ +(function( factory ) { + + if ( typeof define === "function" && define.amd ) { + // AMD. + define( [ "../cldr" ], factory ); + } else if ( typeof module === "object" && typeof module.exports === "object" ) { + // Node. CommonJS. + module.exports = factory( require( "cldrjs" ) ); + } else { + // Global + factory( Cldr ); + } + +}(function( Cldr ) { + + // Build optimization hack to avoid duplicating functions across modules. + var alwaysArray = Cldr._alwaysArray; + diff --git a/StockManMVC/.bin/bower_components/cldrjs/src/build/intro_unresolved.js b/StockManMVC/.bin/bower_components/cldrjs/src/build/intro_unresolved.js new file mode 100644 index 0000000..129d628 --- /dev/null +++ b/StockManMVC/.bin/bower_components/cldrjs/src/build/intro_unresolved.js @@ -0,0 +1,37 @@ +/** + * CLDR JavaScript Library v@VERSION + * http://jquery.com/ + * + * Copyright 2013 Rafael Xavier de Souza + * Released under the MIT license + * http://jquery.org/license + * + * Date: @DATE + */ +/*! + * CLDR JavaScript Library v@VERSION @DATE MIT license © Rafael Xavier + * http://git.io/h4lmVg + */ +(function( factory ) { + + if ( typeof define === "function" && define.amd ) { + // AMD. + define( [ "../cldr" ], factory ); + } else if ( typeof module === "object" && typeof module.exports === "object" ) { + // Node. CommonJS. + module.exports = factory( require( "cldrjs" ) ); + } else { + // Global + factory( Cldr ); + } + +}(function( Cldr ) { + + // Build optimization hack to avoid duplicating functions across modules. + var coreLoad = Cldr._coreLoad; + var jsonMerge = Cldr._jsonMerge; + var pathNormalize = Cldr._pathNormalize; + var resourceGet = Cldr._resourceGet; + var validatePresence = Cldr._validatePresence; + var validateTypePath = Cldr._validateTypePath; + diff --git a/StockManMVC/.bin/bower_components/cldrjs/src/build/node_main.js b/StockManMVC/.bin/bower_components/cldrjs/src/build/node_main.js new file mode 100644 index 0000000..772f757 --- /dev/null +++ b/StockManMVC/.bin/bower_components/cldrjs/src/build/node_main.js @@ -0,0 +1,22 @@ +/** + * CLDR JavaScript Library v@VERSION + * http://jquery.com/ + * + * Copyright 2013 Rafael Xavier de Souza + * Released under the MIT license + * http://jquery.org/license + * + * Date: @DATE + */ +/*! + * CLDR JavaScript Library v@VERSION @DATE MIT license © Rafael Xavier + * http://git.io/h4lmVg + */ + +// Cldr +module.exports = require( "./cldr" ); + +// Extent Cldr with the following modules +require( "./cldr/event" ); +require( "./cldr/supplemental" ); +require( "./cldr/unresolved" ); diff --git a/StockManMVC/.bin/bower_components/cldrjs/src/build/outro.js b/StockManMVC/.bin/bower_components/cldrjs/src/build/outro.js new file mode 100644 index 0000000..be4600a --- /dev/null +++ b/StockManMVC/.bin/bower_components/cldrjs/src/build/outro.js @@ -0,0 +1 @@ +})); diff --git a/StockManMVC/.bin/bower_components/cldrjs/src/bundle/lookup.js b/StockManMVC/.bin/bower_components/cldrjs/src/bundle/lookup.js new file mode 100644 index 0000000..9604498 --- /dev/null +++ b/StockManMVC/.bin/bower_components/cldrjs/src/bundle/lookup.js @@ -0,0 +1,40 @@ +define([ + "../core/likely_subtags", + "../core/remove_likely_subtags", + "../core/subtags", + "../util/array/for_each" +], function( coreLikelySubtags, coreRemoveLikelySubtags, coreSubtags, arrayForEach ) { + + /** + * bundleLookup( minLanguageId ) + * + * @Cldr [Cldr class] + * + * @cldr [Cldr instance] + * + * @minLanguageId [String] requested languageId after applied remove likely subtags. + */ + return function( Cldr, cldr, minLanguageId ) { + var availableBundleMap = Cldr._availableBundleMap, + availableBundleMapQueue = Cldr._availableBundleMapQueue; + + if ( availableBundleMapQueue.length ) { + arrayForEach( availableBundleMapQueue, function( bundle ) { + var existing, maxBundle, minBundle, subtags; + subtags = coreSubtags( bundle ); + maxBundle = coreLikelySubtags( Cldr, cldr, subtags ); + minBundle = coreRemoveLikelySubtags( Cldr, cldr, maxBundle ); + minBundle = minBundle.join( Cldr.localeSep ); + existing = availableBundleMapQueue[ minBundle ]; + if ( existing && existing.length < bundle.length ) { + return; + } + availableBundleMap[ minBundle ] = bundle; + }); + Cldr._availableBundleMapQueue = []; + } + + return availableBundleMap[ minLanguageId ] || null; + }; + +}); diff --git a/StockManMVC/.bin/bower_components/cldrjs/src/bundle/parent_lookup.js b/StockManMVC/.bin/bower_components/cldrjs/src/bundle/parent_lookup.js new file mode 100644 index 0000000..0f5db21 --- /dev/null +++ b/StockManMVC/.bin/bower_components/cldrjs/src/bundle/parent_lookup.js @@ -0,0 +1,29 @@ +define([ + "../resource/get", + "../path/normalize" +], function( resourceGet, pathNormalize ) { + + return function( Cldr, locale ) { + var normalizedPath, parent; + + if ( locale === "root" ) { + return; + } + + // First, try to find parent on supplemental data. + normalizedPath = pathNormalize( [ "supplemental/parentLocales/parentLocale", locale ] ); + parent = resourceGet( Cldr._resolved, normalizedPath ) || resourceGet( Cldr._raw, normalizedPath ); + if ( parent ) { + return parent; + } + + // Or truncate locale. + parent = locale.substr( 0, locale.lastIndexOf( Cldr.localeSep ) ); + if ( !parent ) { + return "root"; + } + + return parent; + }; + +}); diff --git a/StockManMVC/.bin/bower_components/cldrjs/src/common/create_error.js b/StockManMVC/.bin/bower_components/cldrjs/src/common/create_error.js new file mode 100644 index 0000000..9536c7a --- /dev/null +++ b/StockManMVC/.bin/bower_components/cldrjs/src/common/create_error.js @@ -0,0 +1,21 @@ +define([ + "../util/array/for_each", + "../util/object/keys" +], function( arrayForEach, objectKeys ) { + + return function( code, attributes ) { + var error, message; + + message = code + ( attributes && JSON ? ": " + JSON.stringify( attributes ) : "" ); + error = new Error( message ); + error.code = code; + + // extend( error, attributes ); + arrayForEach( objectKeys( attributes ), function( attribute ) { + error[ attribute ] = attributes[ attribute ]; + }); + + return error; + }; + +}); diff --git a/StockManMVC/.bin/bower_components/cldrjs/src/common/validate.js b/StockManMVC/.bin/bower_components/cldrjs/src/common/validate.js new file mode 100644 index 0000000..43992bd --- /dev/null +++ b/StockManMVC/.bin/bower_components/cldrjs/src/common/validate.js @@ -0,0 +1,11 @@ +define([ + "./create_error" +], function( createError ) { + + return function( code, check, attributes ) { + if ( !check ) { + throw createError( code, attributes ); + } + }; + +}); diff --git a/StockManMVC/.bin/bower_components/cldrjs/src/common/validate/presence.js b/StockManMVC/.bin/bower_components/cldrjs/src/common/validate/presence.js new file mode 100644 index 0000000..3bd5652 --- /dev/null +++ b/StockManMVC/.bin/bower_components/cldrjs/src/common/validate/presence.js @@ -0,0 +1,11 @@ +define([ + "../validate" +], function( validate ) { + + return function( value, name ) { + validate( "E_MISSING_PARAMETER", typeof value !== "undefined", { + name: name + }); + }; + +}); diff --git a/StockManMVC/.bin/bower_components/cldrjs/src/common/validate/type.js b/StockManMVC/.bin/bower_components/cldrjs/src/common/validate/type.js new file mode 100644 index 0000000..4e72f00 --- /dev/null +++ b/StockManMVC/.bin/bower_components/cldrjs/src/common/validate/type.js @@ -0,0 +1,13 @@ +define([ + "../validate" +], function( validate ) { + + return function( value, name, check, expected ) { + validate( "E_INVALID_PAR_TYPE", check, { + expected: expected, + name: name, + value: value + }); + }; + +}); diff --git a/StockManMVC/.bin/bower_components/cldrjs/src/common/validate/type/function.js b/StockManMVC/.bin/bower_components/cldrjs/src/common/validate/type/function.js new file mode 100644 index 0000000..a23d09b --- /dev/null +++ b/StockManMVC/.bin/bower_components/cldrjs/src/common/validate/type/function.js @@ -0,0 +1,9 @@ +define([ + "../type" +], function( validateType ) { + + return function( value, name ) { + validateType( value, name, typeof value === "undefined" || typeof value === "function", "Function" ); + }; + +}); diff --git a/StockManMVC/.bin/bower_components/cldrjs/src/common/validate/type/path.js b/StockManMVC/.bin/bower_components/cldrjs/src/common/validate/type/path.js new file mode 100644 index 0000000..e1b35a8 --- /dev/null +++ b/StockManMVC/.bin/bower_components/cldrjs/src/common/validate/type/path.js @@ -0,0 +1,10 @@ +define([ + "../type", + "../../../util/array/is_array" +], function( validateType, arrayIsArray ) { + + return function( value, name ) { + validateType( value, name, typeof value === "string" || arrayIsArray( value ), "String or Array" ); + }; + +}); diff --git a/StockManMVC/.bin/bower_components/cldrjs/src/common/validate/type/plain_object.js b/StockManMVC/.bin/bower_components/cldrjs/src/common/validate/type/plain_object.js new file mode 100644 index 0000000..188f0f4 --- /dev/null +++ b/StockManMVC/.bin/bower_components/cldrjs/src/common/validate/type/plain_object.js @@ -0,0 +1,10 @@ +define([ + "../type", + "../../../util/is_plain_object" +], function( validateType, isPlainObject ) { + + return function( value, name ) { + validateType( value, name, typeof value === "undefined" || isPlainObject( value ), "Plain Object" ); + }; + +}); diff --git a/StockManMVC/.bin/bower_components/cldrjs/src/common/validate/type/string.js b/StockManMVC/.bin/bower_components/cldrjs/src/common/validate/type/string.js new file mode 100644 index 0000000..bdba6b4 --- /dev/null +++ b/StockManMVC/.bin/bower_components/cldrjs/src/common/validate/type/string.js @@ -0,0 +1,9 @@ +define([ + "../type" +], function( validateType ) { + + return function( value, name ) { + validateType( value, name, typeof value === "string", "a string" ); + }; + +}); diff --git a/StockManMVC/.bin/bower_components/cldrjs/src/core.js b/StockManMVC/.bin/bower_components/cldrjs/src/core.js new file mode 100644 index 0000000..7244c4a --- /dev/null +++ b/StockManMVC/.bin/bower_components/cldrjs/src/core.js @@ -0,0 +1,151 @@ +define([ + "./bundle/lookup", + "./common/create_error", + "./common/validate", + "./common/validate/presence", + "./common/validate/type", + "./common/validate/type/path", + "./common/validate/type/plain_object", + "./common/validate/type/string", + "./core/likely_subtags", + "./core/load", + "./core/remove_likely_subtags", + "./core/subtags", + "./item/get_resolved", + "./path/normalize", + "./resource/get", + "./util/always_array", + "./util/json/merge" +], function( bundleLookup, createError, validate, validatePresence, validateType, validateTypePath, validateTypePlainObject, validateTypeString, coreLikelySubtags, coreLoad, coreRemoveLikelySubtags, coreSubtags, itemGetResolved, pathNormalize, resourceGet, alwaysArray, jsonMerge ) { + + /** + * new Cldr() + */ + var Cldr = function( locale ) { + this.init( locale ); + }; + + // Build optimization hack to avoid duplicating functions across modules. + Cldr._alwaysArray = alwaysArray; + Cldr._coreLoad = coreLoad; + Cldr._createError = createError; + Cldr._itemGetResolved = itemGetResolved; + Cldr._jsonMerge = jsonMerge; + Cldr._pathNormalize = pathNormalize; + Cldr._resourceGet = resourceGet; + Cldr._validatePresence = validatePresence; + Cldr._validateType = validateType; + Cldr._validateTypePath = validateTypePath; + Cldr._validateTypePlainObject = validateTypePlainObject; + + Cldr._availableBundleMap = {}; + Cldr._availableBundleMapQueue = []; + Cldr._resolved = {}; + + // Allow user to override locale separator "-" (default) | "_". According to http://www.unicode.org/reports/tr35/#Unicode_language_identifier, both "-" and "_" are valid locale separators (eg. "en_GB", "en-GB"). According to http://unicode.org/cldr/trac/ticket/6786 its usage must be consistent throughout the data set. + Cldr.localeSep = "-"; + + /** + * Cldr.load( json [, json, ...] ) + * + * @json [JSON] CLDR data or [Array] Array of @json's. + * + * Load resolved cldr data. + */ + Cldr.load = function() { + Cldr._resolved = coreLoad( Cldr, Cldr._resolved, arguments ); + }; + + /** + * .init() automatically run on instantiation/construction. + */ + Cldr.prototype.init = function( locale ) { + var attributes, language, maxLanguageId, minLanguageId, script, subtags, territory, unicodeLocaleExtensions, variant, + sep = Cldr.localeSep; + + validatePresence( locale, "locale" ); + validateTypeString( locale, "locale" ); + + subtags = coreSubtags( locale ); + + unicodeLocaleExtensions = subtags[ 4 ]; + variant = subtags[ 3 ]; + + // Normalize locale code. + // Get (or deduce) the "triple subtags": language, territory (also aliased as region), and script subtags. + // Get the variant subtags (calendar, collation, currency, etc). + // refs: + // - http://www.unicode.org/reports/tr35/#Field_Definitions + // - http://www.unicode.org/reports/tr35/#Language_and_Locale_IDs + // - http://www.unicode.org/reports/tr35/#Unicode_locale_identifier + + // When a locale id does not specify a language, or territory (region), or script, they are obtained by Likely Subtags. + maxLanguageId = coreLikelySubtags( Cldr, this, subtags, { force: true } ) || subtags; + language = maxLanguageId[ 0 ]; + script = maxLanguageId[ 1 ]; + territory = maxLanguageId[ 2 ]; + + minLanguageId = coreRemoveLikelySubtags( Cldr, this, maxLanguageId ).join( sep ); + + // Set attributes + this.attributes = attributes = { + bundle: bundleLookup( Cldr, this, minLanguageId ), + + // Unicode Language Id + minlanguageId: minLanguageId, + maxLanguageId: maxLanguageId.join( sep ), + + // Unicode Language Id Subtabs + language: language, + script: script, + territory: territory, + region: territory, /* alias */ + variant: variant + }; + + // Unicode locale extensions. + unicodeLocaleExtensions && ( "-" + unicodeLocaleExtensions ).replace( /-[a-z]{3,8}|(-[a-z]{2})-([a-z]{3,8})/g, function( attribute, key, type ) { + + if ( key ) { + + // Extension is in the `keyword` form. + attributes[ "u" + key ] = type; + } else { + + // Extension is in the `attribute` form. + attributes[ "u" + attribute ] = true; + } + }); + + this.locale = locale; + }; + + /** + * .get() + */ + Cldr.prototype.get = function( path ) { + + validatePresence( path, "path" ); + validateTypePath( path, "path" ); + + return itemGetResolved( Cldr, path, this.attributes ); + }; + + /** + * .main() + */ + Cldr.prototype.main = function( path ) { + validatePresence( path, "path" ); + validateTypePath( path, "path" ); + + validate( "E_MISSING_BUNDLE", this.attributes.bundle !== null, { + locale: this.locale + }); + + path = alwaysArray( path ); + return this.get( [ "main/{bundle}" ].concat( path ) ); + }; + + return Cldr; + +}); diff --git a/StockManMVC/.bin/bower_components/cldrjs/src/core/likely_subtags.js b/StockManMVC/.bin/bower_components/cldrjs/src/core/likely_subtags.js new file mode 100644 index 0000000..20d7392 --- /dev/null +++ b/StockManMVC/.bin/bower_components/cldrjs/src/core/likely_subtags.js @@ -0,0 +1,97 @@ +define([ + "../path/normalize", + "../util/array/some" +], function( pathNormalize, arraySome ) { + + /** + * Return the maximized language id as defined in + * http://www.unicode.org/reports/tr35/#Likely_Subtags + * 1. Canonicalize. + * 1.1 Make sure the input locale is in canonical form: uses the right + * separator, and has the right casing. + * TODO Right casing? What df? It seems languages are lowercase, scripts are + * Capitalized, territory is uppercase. I am leaving this as an exercise to + * the user. + * + * 1.2 Replace any deprecated subtags with their canonical values using the + * data in supplemental metadata. Use the first value in the + * replacement list, if it exists. Language tag replacements may have multiple + * parts, such as "sh" ➞ "sr_Latn" or mo" ➞ "ro_MD". In such a case, the + * original script and/or region are retained if there is one. Thus + * "sh_Arab_AQ" ➞ "sr_Arab_AQ", not "sr_Latn_AQ". + * TODO What data? + * + * 1.3 If the tag is grandfathered (see in the supplemental data), then return it. + * TODO grandfathered? + * + * 1.4 Remove the script code 'Zzzz' and the region code 'ZZ' if they occur. + * 1.5 Get the components of the cleaned-up source tag (languages, scripts, + * and regions), plus any variants and extensions. + * 2. Lookup. Lookup each of the following in order, and stop on the first + * match: + * 2.1 languages_scripts_regions + * 2.2 languages_regions + * 2.3 languages_scripts + * 2.4 languages + * 2.5 und_scripts + * 3. Return + * 3.1 If there is no match, either return an error value, or the match for + * "und" (in APIs where a valid language tag is required). + * 3.2 Otherwise there is a match = languagem_scriptm_regionm + * 3.3 Let xr = xs if xs is not empty, and xm otherwise. + * 3.4 Return the language tag composed of languager _ scriptr _ regionr + + * variants + extensions. + * + * @subtags [Array] normalized language id subtags tuple (see init.js). + */ + return function( Cldr, cldr, subtags, options ) { + var match, matchFound, + language = subtags[ 0 ], + script = subtags[ 1 ], + sep = Cldr.localeSep, + territory = subtags[ 2 ], + variantsAndUnicodeLocaleExtensions = subtags.slice( 3, 4 ); + options = options || {}; + + // Skip if (language, script, territory) is not empty [3.3] + if ( language !== "und" && script !== "Zzzz" && territory !== "ZZ" ) { + return [ language, script, territory ].concat( variantsAndUnicodeLocaleExtensions ); + } + + // Skip if no supplemental likelySubtags data is present + if ( typeof cldr.get( "supplemental/likelySubtags" ) === "undefined" ) { + return; + } + + // [2] + matchFound = arraySome([ + [ language, script, territory ], + [ language, territory ], + [ language, script ], + [ language ], + [ "und", script ] + ], function( test ) { + return match = !(/\b(Zzzz|ZZ)\b/).test( test.join( sep ) ) /* [1.4] */ && cldr.get( [ "supplemental/likelySubtags", test.join( sep ) ] ); + }); + + // [3] + if ( matchFound ) { + // [3.2 .. 3.4] + match = match.split( sep ); + return [ + language !== "und" ? language : match[ 0 ], + script !== "Zzzz" ? script : match[ 1 ], + territory !== "ZZ" ? territory : match[ 2 ] + ].concat( + variantsAndUnicodeLocaleExtensions + ); + } else if ( options.force ) { + // [3.1.2] + return cldr.get( "supplemental/likelySubtags/und" ).split( sep ); + } else { + // [3.1.1] + return; + } + }; +}); diff --git a/StockManMVC/.bin/bower_components/cldrjs/src/core/load.js b/StockManMVC/.bin/bower_components/cldrjs/src/core/load.js new file mode 100644 index 0000000..e6cebfc --- /dev/null +++ b/StockManMVC/.bin/bower_components/cldrjs/src/core/load.js @@ -0,0 +1,38 @@ +define([ + "./set_available_bundles", + "../common/validate/presence", + "../common/validate/type/plain_object", + "../util/always_array", + "../util/json/merge" +], function( coreSetAvailableBundles, validatePresence, validateTypePlainObject, alwaysArray, jsonMerge ) { + + /** + * load( Cldr, source, jsons ) + * + * @Cldr [Cldr class] + * + * @source [Object] + * + * @jsons [arguments] + */ + return function( Cldr, source, jsons ) { + var i, j, json; + + validatePresence( jsons[ 0 ], "json" ); + + // Support arbitrary parameters, e.g., `Cldr.load({...}, {...})`. + for ( i = 0; i < jsons.length; i++ ) { + + // Support array parameters, e.g., `Cldr.load([{...}, {...}])`. + json = alwaysArray( jsons[ i ] ); + + for ( j = 0; j < json.length; j++ ) { + validateTypePlainObject( json[ j ], "json" ); + source = jsonMerge( source, json[ j ] ); + coreSetAvailableBundles( Cldr, json[ j ] ); + } + } + + return source; + }; +}); diff --git a/StockManMVC/.bin/bower_components/cldrjs/src/core/remove_likely_subtags.js b/StockManMVC/.bin/bower_components/cldrjs/src/core/remove_likely_subtags.js new file mode 100644 index 0000000..f03426f --- /dev/null +++ b/StockManMVC/.bin/bower_components/cldrjs/src/core/remove_likely_subtags.js @@ -0,0 +1,49 @@ +define([ + "./likely_subtags", + "../util/array/some" +], function( coreLikelySubtags, arraySome ) { + + /** + * Given a locale, remove any fields that Add Likely Subtags would add. + * http://www.unicode.org/reports/tr35/#Likely_Subtags + * 1. First get max = AddLikelySubtags(inputLocale). If an error is signaled, + * return it. + * 2. Remove the variants from max. + * 3. Then for trial in {language, language _ region, language _ script}. If + * AddLikelySubtags(trial) = max, then return trial + variants. + * 4. If you do not get a match, return max + variants. + * + * @maxLanguageId [Array] maxLanguageId tuple (see init.js). + */ + return function( Cldr, cldr, maxLanguageId ) { + var match, matchFound, + language = maxLanguageId[ 0 ], + script = maxLanguageId[ 1 ], + territory = maxLanguageId[ 2 ], + variants = maxLanguageId[ 3 ]; + + // [3] + matchFound = arraySome([ + [ [ language, "Zzzz", "ZZ" ], [ language ] ], + [ [ language, "Zzzz", territory ], [ language, territory ] ], + [ [ language, script, "ZZ" ], [ language, script ] ] + ], function( test ) { + var result = coreLikelySubtags( Cldr, cldr, test[ 0 ] ); + match = test[ 1 ]; + return result && result[ 0 ] === maxLanguageId[ 0 ] && + result[ 1 ] === maxLanguageId[ 1 ] && + result[ 2 ] === maxLanguageId[ 2 ]; + }); + + if ( matchFound ) { + if ( variants ) { + match.push( variants ); + } + return match; + } + + // [4] + return maxLanguageId; + }; + +}); diff --git a/StockManMVC/.bin/bower_components/cldrjs/src/core/set_available_bundles.js b/StockManMVC/.bin/bower_components/cldrjs/src/core/set_available_bundles.js new file mode 100644 index 0000000..cf85063 --- /dev/null +++ b/StockManMVC/.bin/bower_components/cldrjs/src/core/set_available_bundles.js @@ -0,0 +1,28 @@ +define([ + "../resource/get" +], function( resourceGet ) { + + /** + * setAvailableBundles( Cldr, json ) + * + * @Cldr [Cldr class] + * + * @json resolved/unresolved cldr data. + * + * Set available bundles queue based on passed json CLDR data. Considers a bundle as any String at /main/{bundle}. + */ + return function( Cldr, json ) { + var bundle, + availableBundleMapQueue = Cldr._availableBundleMapQueue, + main = resourceGet( json, [ "main" ] ); + + if ( main ) { + for ( bundle in main ) { + if ( main.hasOwnProperty( bundle ) && bundle !== "root" && + availableBundleMapQueue.indexOf( bundle ) === -1 ) { + availableBundleMapQueue.push( bundle ); + } + } + } + }; +}); diff --git a/StockManMVC/.bin/bower_components/cldrjs/src/core/subtags.js b/StockManMVC/.bin/bower_components/cldrjs/src/core/subtags.js new file mode 100644 index 0000000..c6857b1 --- /dev/null +++ b/StockManMVC/.bin/bower_components/cldrjs/src/core/subtags.js @@ -0,0 +1,52 @@ +define(function() { + + /** + * subtags( locale ) + * + * @locale [String] + */ + return function( locale ) { + var aux, unicodeLanguageId, + subtags = []; + + locale = locale.replace( /_/, "-" ); + + // Unicode locale extensions. + aux = locale.split( "-u-" ); + if ( aux[ 1 ] ) { + aux[ 1 ] = aux[ 1 ].split( "-t-" ); + locale = aux[ 0 ] + ( aux[ 1 ][ 1 ] ? "-t-" + aux[ 1 ][ 1 ] : ""); + subtags[ 4 /* unicodeLocaleExtensions */ ] = aux[ 1 ][ 0 ]; + } + + // TODO normalize transformed extensions. Currently, skipped. + // subtags[ x ] = locale.split( "-t-" )[ 1 ]; + unicodeLanguageId = locale.split( "-t-" )[ 0 ]; + + // unicode_language_id = "root" + // | unicode_language_subtag + // (sep unicode_script_subtag)? + // (sep unicode_region_subtag)? + // (sep unicode_variant_subtag)* ; + // + // Although unicode_language_subtag = alpha{2,8}, I'm using alpha{2,3}. Because, there's no language on CLDR lengthier than 3. + aux = unicodeLanguageId.match( /^(([a-z]{2,3})(-([A-Z][a-z]{3}))?(-([A-Z]{2}|[0-9]{3}))?)((-([a-zA-Z0-9]{5,8}|[0-9][a-zA-Z0-9]{3}))*)$|^(root)$/ ); + if ( aux === null ) { + return [ "und", "Zzzz", "ZZ" ]; + } + subtags[ 0 /* language */ ] = aux[ 10 ] /* root */ || aux[ 2 ] || "und"; + subtags[ 1 /* script */ ] = aux[ 4 ] || "Zzzz"; + subtags[ 2 /* territory */ ] = aux[ 6 ] || "ZZ"; + if ( aux[ 7 ] && aux[ 7 ].length ) { + subtags[ 3 /* variant */ ] = aux[ 7 ].slice( 1 ) /* remove leading "-" */; + } + + // 0: language + // 1: script + // 2: territory (aka region) + // 3: variant + // 4: unicodeLocaleExtensions + return subtags; + }; + +}); diff --git a/StockManMVC/.bin/bower_components/cldrjs/src/event.js b/StockManMVC/.bin/bower_components/cldrjs/src/event.js new file mode 100644 index 0000000..94046c9 --- /dev/null +++ b/StockManMVC/.bin/bower_components/cldrjs/src/event.js @@ -0,0 +1,83 @@ +define([ + "EventEmitter", + "./common/validate/presence", + "./common/validate/type", + "./common/validate/type/function", + "./core", + "./path/normalize" +], function( EventEmitter, validatePresence, validateType, validateTypeFunction, Cldr, pathNormalize ) { + + var superGet, superInit, + globalEe = new EventEmitter(); + + function validateTypeEvent( value, name ) { + validateType( value, name, typeof value === "string" || value instanceof RegExp, "String or RegExp" ); + } + + function validateThenCall( method, self ) { + return function( event, listener ) { + validatePresence( event, "event" ); + validateTypeEvent( event, "event" ); + + validatePresence( listener, "listener" ); + validateTypeFunction( listener, "listener" ); + + return self[ method ].apply( self, arguments ); + }; + } + + function off( self ) { + return validateThenCall( "off", self ); + } + + function on( self ) { + return validateThenCall( "on", self ); + } + + function once( self ) { + return validateThenCall( "once", self ); + } + + Cldr.off = off( globalEe ); + Cldr.on = on( globalEe ); + Cldr.once = once( globalEe ); + + /** + * Overload Cldr.prototype.init(). + */ + superInit = Cldr.prototype.init; + Cldr.prototype.init = function() { + var ee; + this.ee = ee = new EventEmitter(); + this.off = off( ee ); + this.on = on( ee ); + this.once = once( ee ); + superInit.apply( this, arguments ); + }; + + /** + * getOverload is encapsulated, because of cldr/unresolved. If it's loaded + * after cldr/event (and note it overwrites .get), it can trigger this + * overload again. + */ + function getOverload() { + + /** + * Overload Cldr.prototype.get(). + */ + superGet = Cldr.prototype.get; + Cldr.prototype.get = function( path ) { + var value = superGet.apply( this, arguments ); + path = pathNormalize( path, this.attributes ).join( "/" ); + globalEe.trigger( "get", [ path, value ] ); + this.ee.trigger( "get", [ path, value ] ); + return value; + }; + } + + Cldr._eventInit = getOverload; + getOverload(); + + return Cldr; + +}); diff --git a/StockManMVC/.bin/bower_components/cldrjs/src/item/get_resolved.js b/StockManMVC/.bin/bower_components/cldrjs/src/item/get_resolved.js new file mode 100644 index 0000000..c16a452 --- /dev/null +++ b/StockManMVC/.bin/bower_components/cldrjs/src/item/get_resolved.js @@ -0,0 +1,13 @@ +define([ + "../resource/get", + "../path/normalize" +], function( resourceGet, pathNormalize ) { + + return function( Cldr, path, attributes ) { + // Resolve path + var normalizedPath = pathNormalize( path, attributes ); + + return resourceGet( Cldr._resolved, normalizedPath ); + }; + +}); diff --git a/StockManMVC/.bin/bower_components/cldrjs/src/item/lookup.js b/StockManMVC/.bin/bower_components/cldrjs/src/item/lookup.js new file mode 100644 index 0000000..3532572 --- /dev/null +++ b/StockManMVC/.bin/bower_components/cldrjs/src/item/lookup.js @@ -0,0 +1,50 @@ +define([ + "../bundle/parent_lookup", + "../path/normalize", + "../resource/get", + "../resource/set", + "../util/json/merge" +], function( bundleParentLookup, pathNormalize, resourceGet, resourceSet, jsonMerge ) { + + var lookup; + + lookup = function( Cldr, locale, path, attributes, childLocale ) { + var normalizedPath, parent, value; + + // 1: Finish recursion + // 2: Avoid infinite loop + if ( typeof locale === "undefined" /* 1 */ || locale === childLocale /* 2 */ ) { + return; + } + + // Resolve path + normalizedPath = pathNormalize( path, attributes ); + + // Check resolved (cached) data first + // 1: Due to #16, never use the cached resolved non-leaf nodes. It may not + // represent its leafs in its entirety. + value = resourceGet( Cldr._resolved, normalizedPath ); + if ( value && typeof value !== "object" /* 1 */ ) { + return value; + } + + // Check raw data + value = resourceGet( Cldr._raw, normalizedPath ); + + if ( !value ) { + // Or, lookup at parent locale + parent = bundleParentLookup( Cldr, locale ); + value = lookup( Cldr, parent, path, jsonMerge( attributes, { bundle: parent }), locale ); + } + + if ( value ) { + // Set resolved (cached) + resourceSet( Cldr._resolved, normalizedPath, value ); + } + + return value; + }; + + return lookup; + +}); diff --git a/StockManMVC/.bin/bower_components/cldrjs/src/path/normalize.js b/StockManMVC/.bin/bower_components/cldrjs/src/path/normalize.js new file mode 100644 index 0000000..b1d68a8 --- /dev/null +++ b/StockManMVC/.bin/bower_components/cldrjs/src/path/normalize.js @@ -0,0 +1,27 @@ +define([ + "../util/array/is_array" +], function( arrayIsArray ) { + + return function( path, attributes ) { + if ( arrayIsArray( path ) ) { + path = path.join( "/" ); + } + if ( typeof path !== "string" ) { + throw new Error( "invalid path \"" + path + "\"" ); + } + // 1: Ignore leading slash `/` + // 2: Ignore leading `cldr/` + path = path + .replace( /^\// , "" ) /* 1 */ + .replace( /^cldr\// , "" ); /* 2 */ + + // Replace {attribute}'s + path = path.replace( /{[a-zA-Z]+}/g, function( name ) { + name = name.replace( /^{([^}]*)}$/, "$1" ); + return attributes[ name ]; + }); + + return path.split( "/" ); + }; + +}); diff --git a/StockManMVC/.bin/bower_components/cldrjs/src/resource/get.js b/StockManMVC/.bin/bower_components/cldrjs/src/resource/get.js new file mode 100644 index 0000000..f8bfd17 --- /dev/null +++ b/StockManMVC/.bin/bower_components/cldrjs/src/resource/get.js @@ -0,0 +1,18 @@ +define(function() { + + // @path: normalized path + return function( data, path ) { + var i, + node = data, + length = path.length; + + for ( i = 0; i < length - 1; i++ ) { + node = node[ path[ i ] ]; + if ( !node ) { + return undefined; + } + } + return node[ path[ i ] ]; + }; + +}); diff --git a/StockManMVC/.bin/bower_components/cldrjs/src/resource/set.js b/StockManMVC/.bin/bower_components/cldrjs/src/resource/set.js new file mode 100644 index 0000000..800b009 --- /dev/null +++ b/StockManMVC/.bin/bower_components/cldrjs/src/resource/set.js @@ -0,0 +1,18 @@ +define(function() { + + // @path: normalized path + return function( data, path, value ) { + var i, + node = data, + length = path.length; + + for ( i = 0; i < length - 1; i++ ) { + if ( !node[ path[ i ] ] ) { + node[ path[ i ] ] = {}; + } + node = node[ path[ i ] ]; + } + node[ path[ i ] ] = value; + }; + +}); diff --git a/StockManMVC/.bin/bower_components/cldrjs/src/supplemental.js b/StockManMVC/.bin/bower_components/cldrjs/src/supplemental.js new file mode 100644 index 0000000..7ca2d87 --- /dev/null +++ b/StockManMVC/.bin/bower_components/cldrjs/src/supplemental.js @@ -0,0 +1,20 @@ +define([ + "./core", + "./supplemental/main" +], function( Cldr, supplementalMain ) { + + var initSuper = Cldr.prototype.init; + + /** + * .init() automatically ran on construction. + * + * Overload .init(). + */ + Cldr.prototype.init = function() { + initSuper.apply( this, arguments ); + this.supplemental = supplementalMain( this ); + }; + + return Cldr; + +}); diff --git a/StockManMVC/.bin/bower_components/cldrjs/src/supplemental/main.js b/StockManMVC/.bin/bower_components/cldrjs/src/supplemental/main.js new file mode 100644 index 0000000..a584529 --- /dev/null +++ b/StockManMVC/.bin/bower_components/cldrjs/src/supplemental/main.js @@ -0,0 +1,51 @@ +define([ + "../util/always_array" +], function( alwaysArray ) { + + return function( cldr ) { + + var prepend, supplemental; + + prepend = function( prepend ) { + return function( path ) { + path = alwaysArray( path ); + return cldr.get( [ prepend ].concat( path ) ); + }; + }; + + supplemental = prepend( "supplemental" ); + + // Week Data + // http://www.unicode.org/reports/tr35/tr35-dates.html#Week_Data + supplemental.weekData = prepend( "supplemental/weekData" ); + + supplemental.weekData.firstDay = function() { + return cldr.get( "supplemental/weekData/firstDay/{territory}" ) || + cldr.get( "supplemental/weekData/firstDay/001" ); + }; + + supplemental.weekData.minDays = function() { + var minDays = cldr.get( "supplemental/weekData/minDays/{territory}" ) || + cldr.get( "supplemental/weekData/minDays/001" ); + return parseInt( minDays, 10 ); + }; + + // Time Data + // http://www.unicode.org/reports/tr35/tr35-dates.html#Time_Data + supplemental.timeData = prepend( "supplemental/timeData" ); + + supplemental.timeData.allowed = function() { + return cldr.get( "supplemental/timeData/{territory}/_allowed" ) || + cldr.get( "supplemental/timeData/001/_allowed" ); + }; + + supplemental.timeData.preferred = function() { + return cldr.get( "supplemental/timeData/{territory}/_preferred" ) || + cldr.get( "supplemental/timeData/001/_preferred" ); + }; + + return supplemental; + + }; + +}); diff --git a/StockManMVC/.bin/bower_components/cldrjs/src/unresolved.js b/StockManMVC/.bin/bower_components/cldrjs/src/unresolved.js new file mode 100644 index 0000000..a3f76f6 --- /dev/null +++ b/StockManMVC/.bin/bower_components/cldrjs/src/unresolved.js @@ -0,0 +1,42 @@ +define([ + "./common/validate/presence", + "./common/validate/type/path", + "./core", + "./core/load", + "./item/lookup" +], function( validatePresence, validateTypePath, Cldr, coreLoad, itemLookup ) { + + Cldr._raw = {}; + + /** + * Cldr.load( json [, json, ...] ) + * + * @json [JSON] CLDR data or [Array] Array of @json's. + * + * Load resolved or unresolved cldr data. + * Overwrite Cldr.load(). + */ + Cldr.load = function() { + Cldr._raw = coreLoad( Cldr, Cldr._raw, arguments ); + }; + + /** + * Overwrite Cldr.prototype.get(). + */ + Cldr.prototype.get = function( path ) { + validatePresence( path, "path" ); + validateTypePath( path, "path" ); + + // 1: use bundle as locale on item lookup for simplification purposes, because no other extended subtag is used anyway on bundle parent lookup. + // 2: during init(), this method is called, but bundle is yet not defined. Use "" as a workaround in this very specific scenario. + return itemLookup( Cldr, this.attributes && this.attributes.bundle /* 1 */ || "" /* 2 */, path, this.attributes ); + }; + + // In case cldr/unresolved is loaded after cldr/event, we trigger its overloads again. Because, .get is overwritten in here. + if ( Cldr._eventInit ) { + Cldr._eventInit(); + } + + return Cldr; + +}); diff --git a/StockManMVC/.bin/bower_components/cldrjs/src/util/always_array.js b/StockManMVC/.bin/bower_components/cldrjs/src/util/always_array.js new file mode 100644 index 0000000..c8ddb66 --- /dev/null +++ b/StockManMVC/.bin/bower_components/cldrjs/src/util/always_array.js @@ -0,0 +1,9 @@ +define([ + "./array/is_array" +], function( arrayIsArray ) { + + return function( somethingOrArray ) { + return arrayIsArray( somethingOrArray ) ? somethingOrArray : [ somethingOrArray ]; + }; + +}); diff --git a/StockManMVC/.bin/bower_components/cldrjs/src/util/array/for_each.js b/StockManMVC/.bin/bower_components/cldrjs/src/util/array/for_each.js new file mode 100644 index 0000000..d23b71a --- /dev/null +++ b/StockManMVC/.bin/bower_components/cldrjs/src/util/array/for_each.js @@ -0,0 +1,13 @@ +define(function() { + + return function( array, callback ) { + var i, length; + if ( array.forEach ) { + return array.forEach( callback ); + } + for ( i = 0, length = array.length; i < length; i++ ) { + callback( array[ i ], i, array ); + } + }; + +}); diff --git a/StockManMVC/.bin/bower_components/cldrjs/src/util/array/is_array.js b/StockManMVC/.bin/bower_components/cldrjs/src/util/array/is_array.js new file mode 100644 index 0000000..0d68266 --- /dev/null +++ b/StockManMVC/.bin/bower_components/cldrjs/src/util/array/is_array.js @@ -0,0 +1,7 @@ +define(function() { + + return Array.isArray || function( obj ) { + return Object.prototype.toString.call( obj ) === "[object Array]"; + }; + +}); diff --git a/StockManMVC/.bin/bower_components/cldrjs/src/util/array/some.js b/StockManMVC/.bin/bower_components/cldrjs/src/util/array/some.js new file mode 100644 index 0000000..3ed54fb --- /dev/null +++ b/StockManMVC/.bin/bower_components/cldrjs/src/util/array/some.js @@ -0,0 +1,16 @@ +define(function() { + + return function( array, callback ) { + var i, length; + if ( array.some ) { + return array.some( callback ); + } + for ( i = 0, length = array.length; i < length; i++ ) { + if ( callback( array[ i ], i, array ) ) { + return true; + } + } + return false; + }; + +}); diff --git a/StockManMVC/.bin/bower_components/cldrjs/src/util/is_plain_object.js b/StockManMVC/.bin/bower_components/cldrjs/src/util/is_plain_object.js new file mode 100644 index 0000000..7a2fe1f --- /dev/null +++ b/StockManMVC/.bin/bower_components/cldrjs/src/util/is_plain_object.js @@ -0,0 +1,10 @@ +define(function() { + + /** + * Function inspired by jQuery Core, but reduced to our use case. + */ + return function( obj ) { + return obj !== null && "" + obj === "[object Object]"; + }; + +}); diff --git a/StockManMVC/.bin/bower_components/cldrjs/src/util/json/merge.js b/StockManMVC/.bin/bower_components/cldrjs/src/util/json/merge.js new file mode 100644 index 0000000..54862e9 --- /dev/null +++ b/StockManMVC/.bin/bower_components/cldrjs/src/util/json/merge.js @@ -0,0 +1,38 @@ +define([ + "../array/for_each", + "../array/is_array" +], function( arrayForEach, arrayIsArray ) { + + // Returns new deeply merged JSON. + // + // Eg. + // merge( { a: { b: 1, c: 2 } }, { a: { b: 3, d: 4 } } ) + // -> { a: { b: 3, c: 2, d: 4 } } + // + // @arguments JSON's + // + var merge = function() { + var destination = {}, + sources = [].slice.call( arguments, 0 ); + arrayForEach( sources, function( source ) { + var prop; + for ( prop in source ) { + if ( prop in destination && typeof destination[ prop ] === "object" && !arrayIsArray( destination[ prop ] ) ) { + + // Merge Objects + destination[ prop ] = merge( destination[ prop ], source[ prop ] ); + + } else { + + // Set new values + destination[ prop ] = source[ prop ]; + + } + } + }); + return destination; + }; + + return merge; + +}); diff --git a/StockManMVC/.bin/bower_components/cldrjs/src/util/object/keys.js b/StockManMVC/.bin/bower_components/cldrjs/src/util/object/keys.js new file mode 100644 index 0000000..28d2a74 --- /dev/null +++ b/StockManMVC/.bin/bower_components/cldrjs/src/util/object/keys.js @@ -0,0 +1,18 @@ +define(function() { + + return function( object ) { + var i, + result = []; + + if ( Object.keys ) { + return Object.keys( object ); + } + + for ( i in object ) { + result.push( i ); + } + + return result; + }; + +}); diff --git a/StockManMVC/.bin/bower_components/cldrjs/test/.jshintrc b/StockManMVC/.bin/bower_components/cldrjs/test/.jshintrc new file mode 100644 index 0000000..4d123df --- /dev/null +++ b/StockManMVC/.bin/bower_components/cldrjs/test/.jshintrc @@ -0,0 +1,17 @@ +{ + "boss": true, + "curly": true, + "eqeqeq": true, + "eqnull": true, + "expr": true, + "immed": true, + "noarg": true, + "onevar": false, + "quotmark": "double", + "smarttabs": true, + "trailing": true, + "undef": true, + "unused": true, + + "predef": [ "after", "before", "define", "describe", "expect", "it", "mocha", "require", "setTimeout" ] +} diff --git a/StockManMVC/.bin/bower_components/cldrjs/test/functional.html b/StockManMVC/.bin/bower_components/cldrjs/test/functional.html new file mode 100644 index 0000000..46d8ef9 --- /dev/null +++ b/StockManMVC/.bin/bower_components/cldrjs/test/functional.html @@ -0,0 +1,20 @@ + + + + + CLDR Functional Tests + + + +
+ + + + + + + + + diff --git a/StockManMVC/.bin/bower_components/cldrjs/test/functional.js b/StockManMVC/.bin/bower_components/cldrjs/test/functional.js new file mode 100644 index 0000000..2169aa5 --- /dev/null +++ b/StockManMVC/.bin/bower_components/cldrjs/test/functional.js @@ -0,0 +1,17 @@ +require.config({ + paths: { + cldr: "../dist/cldr", + "cldr-data": "../bower_components/cldr-data", + json: "../bower_components/requirejs-plugins/src/json", + text: "../bower_components/requirejs-text/text" + } +}); + +require([ + + "./functional/core", + "./functional/event" + +], function() { + mocha.run(); +}); diff --git a/StockManMVC/.bin/bower_components/cldrjs/test/functional/core.js b/StockManMVC/.bin/bower_components/cldrjs/test/functional/core.js new file mode 100644 index 0000000..f1251c0 --- /dev/null +++ b/StockManMVC/.bin/bower_components/cldrjs/test/functional/core.js @@ -0,0 +1,109 @@ +define([ + "cldr", + "../util", + "json!cldr-data/main/en/numbers.json", + "json!cldr-data/supplemental/likelySubtags.json" +], function( Cldr, util, enNumbersJson, likelySubtagsJson ) { + + var isLoaded; + + function cldrLoad() { + if ( isLoaded ) { + return; + } + Cldr.load( enNumbersJson, likelySubtagsJson ); + isLoaded = true; + } + + describe( "Cldr.load( json )", function() { + + it( "should throw error on missing json parameter", function() { + expect(function() { + Cldr.load(); + }).to.throw( Error, /E_MISSING_PARAMETER/ ); + }); + + it( "should throw error on invalid locale parameter type", function() { + util.assertObjectParameter( expect, function( invalidValue ) { + return function() { + Cldr.load( invalidValue ); + }; + }); + }); + + it( "should throw error on invalid locale parameter type", function() { + util.assertObjectParameter( expect, function( invalidValue ) { + return function() { + Cldr.load([ { a: 1 }, invalidValue ]); + }; + }); + }); + + it( "should throw error on invalid locale parameter type", function() { + util.assertObjectParameter( expect, function( invalidValue ) { + return function() { + Cldr.load( { a: 1 }, invalidValue ); + }; + }); + }); + + }); + + describe( "new Cldr( locale )", function() { + cldrLoad(); + + it( "should throw error on missing locale parameter", function() { + expect(function() { + new Cldr(); + }).to.throw( Error, /E_MISSING_PARAMETER/ ); + }); + + it( "should throw error on invalid locale parameter type", function() { + util.assertStringParameter( expect, function( invalidValue ) { + return function() { + new Cldr( invalidValue ); + }; + }); + }); + + }); + + describe( ".get( path )", function() { + var cldr; + cldrLoad(); + cldr = new Cldr( "en" ); + + it( "should throw error on invalid parameter type", function() { + util.assertPathParameter( expect, function( invalidValue ) { + return function() { + cldr.get( invalidValue ); + }; + }); + }); + + }); + + describe( ".main( path )", function() { + var cldr; + cldrLoad(); + cldr = new Cldr( "en" ); + + it( "should throw error on invalid parameter type", function() { + util.assertPathParameter( expect, function( invalidValue ) { + return function() { + cldr.main( invalidValue ); + }; + }); + }); + + it( "should throw error on missing bundle", function() { + var cldr = new Cldr( "sr-RS" ); + expect( cldr.attributes.bundle ).to.be.null; + expect(function() { + cldr.main( "numbers" ); + }).to.throw( Error, /E_MISSING_BUNDLE/ ); + }); + + }); + +}); diff --git a/StockManMVC/.bin/bower_components/cldrjs/test/functional/event.js b/StockManMVC/.bin/bower_components/cldrjs/test/functional/event.js new file mode 100644 index 0000000..c73258a --- /dev/null +++ b/StockManMVC/.bin/bower_components/cldrjs/test/functional/event.js @@ -0,0 +1,219 @@ +define([ + "cldr", + "../util", + "json!cldr-data/supplemental/likelySubtags.json", + "cldr/event" +], function( Cldr, util, likelySubtagsJson ) { + + Cldr.load( likelySubtagsJson ); + + [ "off", "on", "once" ].forEach(function( method ) { + describe( "Cldr." + method + "( event, listener )", function() { + + it( "should throw error on missing event parameter", function() { + expect(function() { + Cldr[ method ](); + }).to.throw( Error, /E_MISSING_PARAMETER/ ); + }); + + it( "should throw error on missing listener parameter", function() { + expect(function() { + Cldr[ method ]( "get" ); + }).to.throw( Error, /E_MISSING_PARAMETER/ ); + }); + + it( "should throw error on invalid event parameter type", function() { + util.assertEventParameter( expect, function( invalidValue ) { + return function() { + Cldr[ method ]( invalidValue, function() {} ); + }; + }); + }); + + it( "should throw error on invalid listener parameter type", function() { + util.assertFunctionParameter( expect, function( invalidValue ) { + return function() { + Cldr[ method ]( "get", invalidValue ); + }; + }); + }); + + }); + + }); + + describe( "Cldr.on( \"get\", listener )", function() { + + it( "should add the listener to the global `get` event", function( done ) { + function listener() { + done(); + } + var cldr = new Cldr( "root" ); + Cldr.on( "get", listener ); + cldr.get( "something" ); + Cldr.off( "get", listener ); + }); + + it( "should pass path and value to the listener", function( done ) { + function listener( path, value ) { + if ( path === "supplemental/likelySubtags/en" && value === "en-Latn-US" ) { + done(); + } + } + var cldr = new Cldr( "root" ); + Cldr.on( "get", listener ); + cldr.get( "supplemental/likelySubtags/en" ); + Cldr.off( "get", listener ); + }); + + }); + + describe( "Cldr.off( \"get\", listener )", function() { + + it( "should remove the specific listener from the global `get` event", function( done ) { + var status = new Error( "Also removed wrong listener `listener2`" ); + function listener1() { + done( new Error( "should not listen `listener1`" ) ); + } + function listener2() { + status = undefined; // Good. + } + var cldr = new Cldr( "root" ); + Cldr.on( "get", listener1 ); + Cldr.on( "get", listener2 ); + Cldr.off( "get", listener1 ); + cldr.get( "something" ); + Cldr.off( "get", listener2 ); + setTimeout(function() { + done( status ); + }); + }); + + }); + + describe( "Cldr.once( \"get\", listener )", function() { + + it( "should add the listener to the global `get` event *once*", function( done ) { + var status = new Error( "Did not listen" ); + function listener( path ) { + if ( path === "first" ) { + status = undefined; // Good. + } else if ( path === "second" ) { + status = new Error( "Listened twice" ); + } + } + var cldr = new Cldr( "root" ); + Cldr.once( "get", listener ); + cldr.get( "first" ); + cldr.get( "second" ); + setTimeout(function() { + done( status ); + }); + }); + + it( "should pass path and value to the listener", function( done ) { + function listener( path, value ) { + if ( path === "supplemental/likelySubtags/en" && value === "en-Latn-US" ) { + done(); + } + } + var cldr = new Cldr( "root" ); + Cldr.once( "get", listener ); + cldr.get( "supplemental/likelySubtags/en" ); + }); + + }); + + describe( "cldr.on( \"get\", listener )", function() { + + it( "should add the listener to the instance `get` event", function( done ) { + var status = new Error( "Did not listen" ); + function listener( path ) { + if ( path === "something-from-cldr" ) { + status = undefined; // Good. + } else { + status = new Error( "Eavesdropping another instances" ); + } + } + var cldr = new Cldr( "root" ), + another = new Cldr( "root" ); + cldr.on( "get", listener ); + cldr.get( "something-from-cldr" ); + another.get( "something-from-another" ); + cldr.off( "get", listener ); + setTimeout(function() { + done( status ); + }); + }); + + it( "should pass path and value to the listener", function( done ) { + function listener( path, value ) { + if ( path === "supplemental/likelySubtags/en" && value === "en-Latn-US" ) { + done(); + } + } + var cldr = new Cldr( "root" ); + cldr.on( "get", listener ); + cldr.get( "supplemental/likelySubtags/en" ); + cldr.off( "get", listener ); + }); + + }); + + describe( "cldr.off( \"get\", listener )", function() { + + it( "should remove the specific listener from the instance `get` event", function( done ) { + var status = new Error( "Also removed wrong listener `listener2`" ); + function listener1() { + done( new Error( "should not listen `listener1`" ) ); + } + function listener2() { + status = undefined; // Good. + } + var cldr = new Cldr( "root" ); + cldr.on( "get", listener1 ); + cldr.on( "get", listener2 ); + cldr.off( "get", listener1 ); + cldr.get( "something" ); + cldr.off( "get", listener2 ); + setTimeout(function() { + done( status ); + }); + }); + + }); + + describe( "cldr.once( \"get\", listener )", function() { + + it( "should add the listener to the instance `get` event *once*", function( done ) { + var status = new Error( "Did not listen" ); + function listener( path ) { + if ( path === "first" ) { + status = undefined; // Good. + } else if ( path === "second" ) { + status = new Error( "Listened twice" ); + } + } + var cldr = new Cldr( "root" ); + cldr.once( "get", listener ); + cldr.get( "first" ); + cldr.get( "second" ); + setTimeout(function() { + done( status ); + }); + }); + + it( "should pass path and value to the listener", function( done ) { + function listener( path, value ) { + if ( path === "supplemental/likelySubtags/en" && value === "en-Latn-US" ) { + done(); + } + } + var cldr = new Cldr( "root" ); + cldr.once( "get", listener ); + cldr.get( "supplemental/likelySubtags/en" ); + }); + + }); + +}); diff --git a/StockManMVC/.bin/bower_components/cldrjs/test/unit.html b/StockManMVC/.bin/bower_components/cldrjs/test/unit.html new file mode 100644 index 0000000..6965f03 --- /dev/null +++ b/StockManMVC/.bin/bower_components/cldrjs/test/unit.html @@ -0,0 +1,20 @@ + + + + + CLDR Unit Tests + + + +
+ + + + + + + + + diff --git a/StockManMVC/.bin/bower_components/cldrjs/test/unit.js b/StockManMVC/.bin/bower_components/cldrjs/test/unit.js new file mode 100644 index 0000000..b1255e3 --- /dev/null +++ b/StockManMVC/.bin/bower_components/cldrjs/test/unit.js @@ -0,0 +1,34 @@ +require.config({ + paths: { + "cldr-data": "../bower_components/cldr-data", + json: "../bower_components/requirejs-plugins/src/json", + src: "../src", + text: "../bower_components/requirejs-text/text" + } +}); + +require([ + + // 1st unit tests group. + "./unit/core/subtags", + "./unit/path/normalize", + "./unit/resource/get", + "./unit/resource/set", + "./unit/util/json/merge", + + // 2nd unit tests group. + "./unit/core/load", + "./unit/core/set_available_bundles", + + // 3rd unit tests group. + "./unit/core", + "./unit/core/likely_subtags", + "./unit/core/remove_likely_subtags", + "./unit/supplemental", + + // 4th unit tests group. + "./unit/bundle/lookup" + +], function() { + mocha.run(); +}); diff --git a/StockManMVC/.bin/bower_components/cldrjs/test/unit/bundle/lookup.js b/StockManMVC/.bin/bower_components/cldrjs/test/unit/bundle/lookup.js new file mode 100644 index 0000000..0c2c51c --- /dev/null +++ b/StockManMVC/.bin/bower_components/cldrjs/test/unit/bundle/lookup.js @@ -0,0 +1,59 @@ +define([ + "src/bundle/lookup", + "src/core", + "json!cldr-data/supplemental/likelySubtags.json" +], function( bundleLookup, Cldr, likelySubtags ) { + + describe( "Bundle Lookup", function() { + + before(function() { + Cldr.load( likelySubtags ); + }); + + // This test must pass to ensure this whole unit test run under the planned premises. + it( "should pass test's prerequisites", function() { + expect( Cldr._availableBundleMapQueue ).to.not.include.members([ "sr", "sr-Cyrl", "sr-Latn" ]); + expect( Cldr._availableBundleMap ).to.not.contain.keys( "sr", "sr-Latn" ); + }); + + it( "should set the correct bundle", function() { + var sr; + Cldr.load({ + main: { "sr-Cyrl": {} } + }); + expect( Cldr._availableBundleMapQueue ).to.include.members([ "sr-Cyrl" ]); + sr = new Cldr( "sr" ); + expect( Cldr._availableBundleMapQueue ).to.eql([]); + expect( Cldr._availableBundleMap ).to.contain.keys( "sr" ); + expect( Cldr._availableBundleMap.sr ).to.equal( "sr-Cyrl" ); + expect( sr.attributes.bundle ).to.equal( "sr-Cyrl" ); + sr = new Cldr( "sr-Cyrl" ); + expect( sr.attributes.bundle ).to.equal( "sr-Cyrl" ); + sr = new Cldr( "sr-RS" ); + expect( sr.attributes.bundle ).to.equal( "sr-Cyrl" ); + sr = new Cldr( "sr-Cyrl-RS" ); + expect( sr.attributes.bundle ).to.equal( "sr-Cyrl" ); + sr = new Cldr( "sr-Latn-RS" ); + expect( sr.attributes.bundle ).to.be.null; + }); + + it( "should always favor the grandest parent", function() { + var sr; + Cldr.load({ + main: { "sr": {} } + }); + expect( Cldr._availableBundleMapQueue ).to.include.members([ "sr" ]); + sr = new Cldr( "sr" ); + expect( Cldr._availableBundleMapQueue ).to.eql([]); + expect( Cldr._availableBundleMap ).to.contain.keys( "sr" ); + expect( Cldr._availableBundleMap.sr ).to.equal( "sr" ); + expect( sr.attributes.bundle ).to.equal( "sr" ); + sr = new Cldr( "sr-Cyrl" ); + expect( sr.attributes.bundle ).to.equal( "sr" ); + sr = new Cldr( "sr-RS" ); + expect( sr.attributes.bundle ).to.equal( "sr" ); + }); + + }); + +}); diff --git a/StockManMVC/.bin/bower_components/cldrjs/test/unit/bundle/parent_lookup.js b/StockManMVC/.bin/bower_components/cldrjs/test/unit/bundle/parent_lookup.js new file mode 100644 index 0000000..b29dc44 --- /dev/null +++ b/StockManMVC/.bin/bower_components/cldrjs/test/unit/bundle/parent_lookup.js @@ -0,0 +1,27 @@ +define([ + "src/core", + "src/bundle/parent_lookup", + "json!cldr-data/supplemental/parentLocales.json" +], function( Cldr, parentLookup, parentLocalesJson ) { + + describe( "Bundle Parent Lookup", function() { + + before(function() { + Cldr.load( parentLocalesJson ); + }); + + it( "should truncate locale", function() { + expect( parentLookup( Cldr, [ "pt", "BR" ].join( Cldr.localeSep ) ) ).to.equal( "pt" ); + }); + + it( "should end with root", function() { + expect( parentLookup( Cldr, "en" ) ).to.equal( "root" ); + }); + + it( "should use supplemental resource", function() { + expect( parentLookup( Cldr, [ "en", "IN" ].join( Cldr.localeSep ) )).to.equal( [ "en", "001" ].join( Cldr.localeSep ) ); + }); + + }); + +}); diff --git a/StockManMVC/.bin/bower_components/cldrjs/test/unit/core.js b/StockManMVC/.bin/bower_components/cldrjs/test/unit/core.js new file mode 100644 index 0000000..764ddc3 --- /dev/null +++ b/StockManMVC/.bin/bower_components/cldrjs/test/unit/core.js @@ -0,0 +1,83 @@ +define([ + "src/core", + "json!cldr-data/main/en/numbers.json", + "json!cldr-data/supplemental/likelySubtags.json" +], function( Cldr, enNumbersJson, likelySubtagsJson ) { + + describe( "Cldr (core)", function() { + before(function() { + Cldr.load( enNumbersJson, likelySubtagsJson ); + }); + + describe( "Cldr.load()", function() { + + it( "should load json", function() { + expect( Cldr._resolved && Cldr._resolved.supplemental ).to.be.ok; + }); + + }); + + describe( "Constructor", function() { + var cldr; + + it( "should normalize a locale on initialization", function() { + cldr = new Cldr( "pt-BR" ); + expect( cldr.attributes.language ).to.equal( "pt" ); + expect( cldr.attributes.script ).to.equal( "Latn" ); + expect( cldr.attributes.territory ).to.equal( "BR" ); + + cldr = new Cldr( "en" ); + expect( cldr.attributes.language ).to.equal( "en" ); + expect( cldr.attributes.script ).to.equal( "Latn" ); + expect( cldr.attributes.territory ).to.equal( "US" ); + + cldr = new Cldr( "en-GB" ); + expect( cldr.attributes.language ).to.equal( "en" ); + expect( cldr.attributes.script ).to.equal( "Latn" ); + expect( cldr.attributes.territory ).to.equal( "GB" ); + + cldr = new Cldr( "lkt" ); + expect( cldr.attributes.language ).to.equal( "lkt" ); + expect( cldr.attributes.script ).to.equal( "Latn" ); + expect( cldr.attributes.territory ).to.equal( "US" ); + + cldr = new Cldr( "root" ); + expect( cldr.attributes.language ).to.equal( "en" ); + expect( cldr.attributes.script ).to.equal( "Latn" ); + expect( cldr.attributes.territory ).to.equal( "US" ); + + // Should not identify nonExistent as a language subtag, due to its length. So, it should become `und_Zzzz_ZZ`. Then, the `und` likelySubtags value. + cldr = new Cldr( "nonExistent" ); + expect( cldr.attributes.language ).to.equal( "en" ); + expect( cldr.attributes.script ).to.equal( "Latn" ); + expect( cldr.attributes.territory ).to.equal( "US" ); + + // Variant + cldr = new Cldr( "en-POSIX" ); + expect( cldr.attributes.language ).to.equal( "en" ); + expect( cldr.attributes.script ).to.equal( "Latn" ); + expect( cldr.attributes.territory ).to.equal( "US" ); + expect( cldr.attributes.variant ).to.equal( "POSIX" ); + }); + + it( "should set unicode locale extensions attributes", function() { + cldr = new Cldr( "en-u-cu-usd" ); + expect( cldr.attributes[ "u-cu" ] ).to.equal( "usd" ); + + cldr = new Cldr( "en-u-foo-bar-nu-arab-cu-usd" ); + expect( cldr.attributes[ "u-foo" ] ).to.be.true; + expect( cldr.attributes[ "u-bar" ] ).to.be.true; + expect( cldr.attributes[ "u-cu" ] ).to.equal( "usd" ); + expect( cldr.attributes[ "u-nu" ] ).to.equal( "arab" ); + }); + + it( "should implement cldr.main as an alias of get( \"main/{bundle}...\" )", function() { + cldr = new Cldr( "en" ); + expect( cldr.main( "numbers/symbols-numberSystem-latn/decimal" ) ).to.equal( "." ); + }); + + }); + + }); + +}); diff --git a/StockManMVC/.bin/bower_components/cldrjs/test/unit/core/likely_subtags.js b/StockManMVC/.bin/bower_components/cldrjs/test/unit/core/likely_subtags.js new file mode 100644 index 0000000..f76a7fe --- /dev/null +++ b/StockManMVC/.bin/bower_components/cldrjs/test/unit/core/likely_subtags.js @@ -0,0 +1,53 @@ +define([ + "src/core", + "src/core/likely_subtags", + "json!cldr-data/supplemental/likelySubtags.json" +], function( Cldr, likelySubtags, likelySubtagsJson ) { + + describe( "Likely Subtags", function() { + var cldr = new Cldr( "root" ); + + before(function() { + Cldr.load( likelySubtagsJson ); + }); + + it( "should skip empty language tag", function() { + expect( likelySubtags( Cldr, cldr, [ "en", "Latn", "US" ] ) ).to.eql( [ "en", "Latn", "US" ] ); + }); + + it( "should lookup language_script_territory's", function() { + expect( likelySubtags( Cldr, cldr, [ "und", "Latn", "RU" ] ) ).to.eql( [ "krl", "Latn", "RU" ] ); + }); + + it( "should lookup language_territory's", function() { + expect( likelySubtags( Cldr, cldr, [ "zh", "Zzzz", "HK" ] ) ).to.eql( [ "zh", "Hant", "HK" ] ); + }); + + it( "should lookup language_script's", function() { + expect( likelySubtags( Cldr, cldr, [ "az", "Arab", "ZZ" ] ) ).to.eql( [ "az", "Arab", "IR" ] ); + }); + + it( "should lookup und_scripts's", function() { + expect( likelySubtags( Cldr, cldr, [ "und", "Java", "ZZ" ] ) ).to.eql( [ "jv", "Java", "ID" ] ); + }); + + it( "should lookup root", function() { + expect( likelySubtags( Cldr, cldr, [ "und", "Zzzz", "ZZ" ] ) ).to.eql( [ "en", "Latn", "US" ] ); + }); + + it( "should lookup und", function() { + expect( likelySubtags( Cldr, cldr, [ "und", "Zzzz", "ZZ" ] ) ).to.eql( [ "en", "Latn", "US" ] ); + }); + + it( "should lookup non-existent when option { force: true }", function() { + expect( likelySubtags( Cldr, cldr, [ "foo", "Zzzz", "bar" ], { force: true } ) ).to.eql( [ "en", "Latn", "US" ] ); + }); + + it( "should lookup variant subtag", function() { + expect( likelySubtags( Cldr, cldr, [ "en", "Zzzz", "US", "POSIX" ] ) ).to.eql( [ "en", "Latn", "US", "POSIX" ] ); + expect( likelySubtags( Cldr, cldr, [ "ca", "Zzzz", "ES", "VALENCIA" ] ) ).to.eql( [ "ca", "Latn", "ES", "VALENCIA" ] ); + }); + + }); + +}); diff --git a/StockManMVC/.bin/bower_components/cldrjs/test/unit/core/load.js b/StockManMVC/.bin/bower_components/cldrjs/test/unit/core/load.js new file mode 100644 index 0000000..5163973 --- /dev/null +++ b/StockManMVC/.bin/bower_components/cldrjs/test/unit/core/load.js @@ -0,0 +1,31 @@ +define([ + "src/core/load" +], function( _load ) { + + describe( "Core load", function() { + var fakeCldr = { + _availableBundleMapQueue: [] + }; + + function load() { + return _load( fakeCldr, {}, arguments ); + } + + it( "should load a json entry", function() { + var source = load({ foo: "bar" }); + expect( source ).to.eql({ foo: "bar" }); + }); + + it( "should load arbitrary json parameters, e.g., Cldr.load({...}, {...}, ...)", function() { + var source = load({ foo: "bar" }, { baz: "qux" }); + expect( source ).to.eql({ baz: "qux", foo: "bar" }); + }); + + it( "should load arbitrary jsons via Array, e.g., Cldr.load([{...}, {...}, ...])", function() { + var source = load([{ foo: "bar" }, { baz: "qux" }]); + expect( source ).to.eql({ baz: "qux", foo: "bar" }); + }); + + }); + +}); diff --git a/StockManMVC/.bin/bower_components/cldrjs/test/unit/core/remove_likely_subtags.js b/StockManMVC/.bin/bower_components/cldrjs/test/unit/core/remove_likely_subtags.js new file mode 100644 index 0000000..60f5ccb --- /dev/null +++ b/StockManMVC/.bin/bower_components/cldrjs/test/unit/core/remove_likely_subtags.js @@ -0,0 +1,40 @@ +define([ + "src/core", + "src/core/remove_likely_subtags", + "json!cldr-data/supplemental/likelySubtags.json" +], function( Cldr, removeLikelySubtags, likelySubtagsJson ) { + + describe( "Remove Likely Subtags", function() { + var cldr = new Cldr( "root" ); + + before(function() { + Cldr.load( likelySubtagsJson ); + }); + + it( "Should reduce \"en_Latn_US\" into \"en\"", function() { + expect( removeLikelySubtags( Cldr, cldr, [ "en", "Latn", "US" ] ) ).to.eql( [ "en" ] ); + }); + + it( "Should reduce \"pt_Latn_BR\" into \"pt\"", function() { + expect( removeLikelySubtags( Cldr, cldr, [ "pt", "Latn", "BR" ] ) ).to.eql( [ "pt" ] ); + }); + + it( "Should reduce \"en_Latn_GB\" into \"en_GB\"", function() { + expect( removeLikelySubtags( Cldr, cldr, [ "en", "Latn", "GB" ] ) ).to.eql( [ "en", "GB" ] ); + }); + + it( "Should reduce \"zh_Hant_HK\" into \"zh_HK\"", function() { + expect( removeLikelySubtags( Cldr, cldr, [ "zh", "Hant", "HK" ] ) ).to.eql( [ "zh", "HK" ] ); + }); + + it( "Should reduce \"az_Arab_IR\" into \"az_Arab\"", function() { + expect( removeLikelySubtags( Cldr, cldr, [ "az", "Arab", "IR" ] ) ).to.eql( [ "az", "IR" ] ); + }); + + it( "Should reduce \"en_Latn_US_POSIX\" into \"en_POSIX\" - variant subtag", function() { + expect( removeLikelySubtags( Cldr, cldr, [ "en", "Latn", "US", "POSIX" ] )).to.eql( [ "en", "POSIX" ] ); + }); + + }); + +}); diff --git a/StockManMVC/.bin/bower_components/cldrjs/test/unit/core/set_available_bundles.js b/StockManMVC/.bin/bower_components/cldrjs/test/unit/core/set_available_bundles.js new file mode 100644 index 0000000..857bc72 --- /dev/null +++ b/StockManMVC/.bin/bower_components/cldrjs/test/unit/core/set_available_bundles.js @@ -0,0 +1,24 @@ +define([ + "src/core/set_available_bundles" +], function( setAvailableBundles ) { + + describe( "Core setAvailableBundles", function() { + var fakeCldr = { + _availableBundleMap: {}, + _availableBundleMapQueue: [] + }; + + it( "should set availableBundleMapQueue", function() { + setAvailableBundles( fakeCldr, { + main: { "en-US": {} } + }); + expect( fakeCldr._availableBundleMapQueue ).to.eql([ "en-US" ]); + setAvailableBundles( fakeCldr, { + main: { "pt-BR": {} } + }); + expect( fakeCldr._availableBundleMapQueue ).to.eql([ "en-US", "pt-BR" ]); + }); + + }); + +}); diff --git a/StockManMVC/.bin/bower_components/cldrjs/test/unit/core/subtags.js b/StockManMVC/.bin/bower_components/cldrjs/test/unit/core/subtags.js new file mode 100644 index 0000000..a57f4d9 --- /dev/null +++ b/StockManMVC/.bin/bower_components/cldrjs/test/unit/core/subtags.js @@ -0,0 +1,55 @@ +define([ + "src/core/subtags" +], function( subtags ) { + + describe( "Subtags", function() { + it( "should match language", function() { + expect( subtags( "root" ) ).to.eql( [ "root", "Zzzz", "ZZ" ] ); + }); + + it( "should match language", function() { + expect( subtags( "en" ) ).to.eql( [ "en", "Zzzz", "ZZ" ] ); + expect( subtags( "ar" ) ).to.eql( [ "ar", "Zzzz", "ZZ" ] ); + expect( subtags( "zh" ) ).to.eql( [ "zh", "Zzzz", "ZZ" ] ); + expect( subtags( "pt" ) ).to.eql( [ "pt", "Zzzz", "ZZ" ] ); + expect( subtags( "foobar" ) ).to.eql( [ "und", "Zzzz", "ZZ" ] ); + }); + + it( "should match language_region", function() { + expect( subtags( "en-US" ) ).to.eql( [ "en", "Zzzz", "US" ] ); + expect( subtags( "ar-EG" ) ).to.eql( [ "ar", "Zzzz", "EG" ] ); + expect( subtags( "zh-CN" ) ).to.eql( [ "zh", "Zzzz", "CN" ] ); + expect( subtags( "pt-BR" ) ).to.eql( [ "pt", "Zzzz", "BR" ] ); + expect( subtags( "en-001" ) ).to.eql( [ "en", "Zzzz", "001" ] ); + expect( subtags( "en-0001" ) ).to.eql( [ "en", "Zzzz", "ZZ", "0001" ] ); + expect( subtags( "en-01" ) ).to.eql( [ "und", "Zzzz", "ZZ" ] ); + }); + + it( "should match language_script", function() { + expect( subtags( "en-Latn" ) ).to.eql( [ "en", "Latn", "ZZ" ] ); + expect( subtags( "ar-Arab" ) ).to.eql( [ "ar", "Arab", "ZZ" ] ); + expect( subtags( "ar-Arabic" ) ).to.eql( [ "ar", "Zzzz", "ZZ", "Arabic" ] ); + }); + + it( "should match language_script_region", function() { + expect( subtags( "en-Latn-US" ) ).to.eql( [ "en", "Latn", "US" ] ); + expect( subtags( "ar-Arab-EG" ) ).to.eql( [ "ar", "Arab", "EG" ] ); + expect( subtags( "ar-EG-Arab" ) ).to.eql( [ "und", "Zzzz", "ZZ" ] ); + }); + + it( "should match language_script_region_variant", function() { + expect( subtags( "en-US-POSIX" ) ).to.eql( [ "en", "Zzzz", "US", "POSIX" ] ); + expect( subtags( "ca-ES-VALENCIA" ) ).to.eql( [ "ca", "Zzzz", "ES", "VALENCIA" ] ); + }); + + it( "should match language_script_region_unicode_extension", function() { + var aux = subtags( "en-u-cu-usd" ); + expect( aux[ 0 ] ).to.eql( "en" ); + expect( aux[ 1 ] ).to.eql( "Zzzz" ); + expect( aux[ 2 ] ).to.eql( "ZZ" ); + expect( aux[ 4 ] ).to.eql( "cu-usd" ); + }); + + }); + +}); diff --git a/StockManMVC/.bin/bower_components/cldrjs/test/unit/item/lookup.js b/StockManMVC/.bin/bower_components/cldrjs/test/unit/item/lookup.js new file mode 100644 index 0000000..0e9a772 --- /dev/null +++ b/StockManMVC/.bin/bower_components/cldrjs/test/unit/item/lookup.js @@ -0,0 +1,50 @@ +define([ + "src/core", + "src/item/lookup", + "json!cldr-data/main/pt/numbers.json", + "json!cldr-data/supplemental/gender.json", + "json!cldr-data/supplemental/likelySubtags.json", + "src/unresolved" +], function( Cldr, itemLookup, ptNumbersJson, genderJson, likelySubtagsJson ) { + + describe( "Item Lookup", function() { + + before(function() { + Cldr.load( + genderJson, + likelySubtagsJson, + ptNumbersJson, + { + "lookup-test": { + a: 1, + b: 2 + } + } + ); + }); + + it( "should get resolved items", function() { + var cldr = new Cldr( "root" ); + expect( itemLookup( Cldr, cldr.locale, "/supplemental/gender/personList/de", cldr.attributes ) ).to.equal( "neutral" ); + }); + + it( "should resolve and get unresolved items", function() { + var cldr = new Cldr( "pt_BR" ); + expect( itemLookup( Cldr, cldr.locale, "/main/{bundle}/numbers/symbols-numberSystem-latn/decimal", cldr.attributes ) ).to.equal( "," ); + }); + + it( "should only cache found resolved items", function() { + var cldr = new Cldr( "root" ); + itemLookup( Cldr, cldr.locale, "/lookup-inexistent-item/data", cldr.attributes ); + expect( Cldr._resolved[ "lookup-inexistent-item" ] ).to.be.undefined; + }); + + it( "should only cache leaf items", function() { + var cldr = new Cldr( "root" ); + expect( itemLookup( Cldr, cldr.locale, "/lookup-test/a", cldr.attributes ) ).to.equal( 1 ); + expect( itemLookup( Cldr, cldr.locale, "/lookup-test", cldr.attributes ) ).to.eql({ a: 1, b: 2 }); + }); + + }); + +}); diff --git a/StockManMVC/.bin/bower_components/cldrjs/test/unit/path/normalize.js b/StockManMVC/.bin/bower_components/cldrjs/test/unit/path/normalize.js new file mode 100644 index 0000000..6f66d96 --- /dev/null +++ b/StockManMVC/.bin/bower_components/cldrjs/test/unit/path/normalize.js @@ -0,0 +1,44 @@ +define([ + "src/path/normalize", +], function( pathNormalize ) { + + describe("Path Normalize", function() { + + it( "should throw Error on invalid path", function() { + var invalidPath = 5; + expect(function() { + pathNormalize( invalidPath ); + }).to.throw( Error ); + }); + + it( "should split a String into an Array", function() { + var value = pathNormalize( "supplemental/likelySubtags" ); + expect( value ).to.be.instanceof( Array ); + expect( value ).to.eql( [ "supplemental", "likelySubtags" ] ); + }); + + it( "should ignore a leading slash / on path", function() { + var value = pathNormalize( "/supplemental/likelySubtags" ); + expect( value ).to.be.instanceof( Array ); + expect( value ).to.eql( [ "supplemental", "likelySubtags" ] ); + }); + + it( "should ignore a leading /cldr/ or cldr/ on path", function() { + [ "/cldr/supplemental/likelySubtags", "cldr/supplemental/likelySubtags" ].forEach(function( path ) { + var value = pathNormalize( path ); + expect( value ).to.be.instanceof( Array ); + expect( value ).to.eql( [ "supplemental", "likelySubtags" ] ); + }); + }); + + it( "should replace attribute variables", function() { + expect( pathNormalize( "main/{languageId}/numbers/decimalFormats-numberSystem-latn", { languageId: "root" } ) ).to.eql( [ "main", "root", "numbers", "decimalFormats-numberSystem-latn" ] ); + }); + + it( "should split the inner Strings of an Array into a flatten Array", function() { + expect( pathNormalize( [ "main/{languageId}/numbers", "decimalFormats-numberSystem-latn" ], { languageId: "root" } ) ).to.eql( [ "main", "root", "numbers", "decimalFormats-numberSystem-latn" ] ); + }); + + }); + +}); diff --git a/StockManMVC/.bin/bower_components/cldrjs/test/unit/resource/get.js b/StockManMVC/.bin/bower_components/cldrjs/test/unit/resource/get.js new file mode 100644 index 0000000..1c148b3 --- /dev/null +++ b/StockManMVC/.bin/bower_components/cldrjs/test/unit/resource/get.js @@ -0,0 +1,23 @@ +define([ + "src/resource/get", +], function( resourceGet ) { + + var data = { a: { b: { c: 5 } } }; + + describe("Data Get", function() { + + it( "should return existing data value", function() { + expect( resourceGet( data, [ "a", "b", "c" ] ) ).to.equal( 5 ); + }); + + it( "should return undefined for non-existing data", function() { + expect( resourceGet( data, [ "a", "b", "x" ] ) ).to.be.undefined; + }); + + it( "should return undefined for non-existing tree", function() { + expect( resourceGet( data, [ "x", "y", "z" ] ) ).to.be.undefined; + }); + + }); + +}); diff --git a/StockManMVC/.bin/bower_components/cldrjs/test/unit/resource/set.js b/StockManMVC/.bin/bower_components/cldrjs/test/unit/resource/set.js new file mode 100644 index 0000000..6fa3829 --- /dev/null +++ b/StockManMVC/.bin/bower_components/cldrjs/test/unit/resource/set.js @@ -0,0 +1,24 @@ +define([ + "src/resource/set", +], function( resourceSet ) { + + var data = {}; + + describe("Resource Set", function() { + + it( "should set value into new JSON data structure", function() { + resourceSet( data, [ "i" ], 1 ); + expect( data.i ).to.equal( 1 ); + + resourceSet( data, [ "a", "b", "c" ], 5 ); + expect( data.a.b.c ).to.equal( 5 ); + }); + + it( "should set value into existing JSON data structure", function() { + resourceSet( data, [ "a", "b", "e" ], 7 ); + expect( data.a.b.e ).to.equal( 7 ); + }); + + }); + +}); diff --git a/StockManMVC/.bin/bower_components/cldrjs/test/unit/supplemental.js b/StockManMVC/.bin/bower_components/cldrjs/test/unit/supplemental.js new file mode 100644 index 0000000..1f31c0f --- /dev/null +++ b/StockManMVC/.bin/bower_components/cldrjs/test/unit/supplemental.js @@ -0,0 +1,68 @@ +define([ + "src/core", + "src/supplemental/main", + "json!cldr-data/supplemental/likelySubtags.json", + "json!cldr-data/supplemental/timeData.json", + "json!cldr-data/supplemental/weekData.json" +], function( Cldr, supplemental, likelySubtagsJson, timeDataJson, weekDataJson ) { + + describe( "Supplemental", function() { + var en, enGb, fr, ptBr, ty; + + before(function() { + Cldr.load( + likelySubtagsJson, + timeDataJson, + weekDataJson + ); + + en = new Cldr( "en" ), + enGb = new Cldr( "en_GB" ), + fr = new Cldr( "fr" ), + ptBr = new Cldr( "pt_BR" ), + ty = new Cldr( "ty" ); + + en.supplemental = supplemental( en ); + enGb.supplemental = supplemental( enGb ); + fr.supplemental = supplemental( fr ); + ptBr.supplemental = supplemental( ptBr ); + ty.supplemental = supplemental( ty ); + }); + + it( "should get weekData.firstDay", function() { + // Explicitly defined firstDay. + expect( en.supplemental.weekData.firstDay() ).to.equal( "sun" ); + + // Or default (001). + expect( ty.supplemental.weekData.firstDay() ).to.equal( "mon" ); + }); + + it( "should get weekData.minDays", function() { + // Explicitly defined minDays. + expect( fr.supplemental.weekData.minDays() ).to.equal( 4 ); + + // Or default (001). + expect( en.supplemental.weekData.minDays() ).to.equal( 1 ); + }); + + it( "should get timeData.allowed", function() { + // Explicitly defined allowed. + expect( en.supplemental.timeData.allowed() ).to.equal( "H h" ); + expect( ptBr.supplemental.timeData.allowed() ).to.equal( "H" ); + + // Or default (001). + expect( enGb.supplemental.timeData.allowed() ).to.equal( "H h" ); + }); + + it( "should get timeData.preferred", function() { + // Explicitly defined preferred. + expect( en.supplemental.timeData.preferred() ).to.equal( "h" ); + expect( ptBr.supplemental.timeData.preferred() ).to.equal( "H" ); + + // Or default (001). + expect( enGb.supplemental.timeData.preferred() ).to.equal( "H" ); + }); + + }); + +}); diff --git a/StockManMVC/.bin/bower_components/cldrjs/test/unit/util/json/merge.js b/StockManMVC/.bin/bower_components/cldrjs/test/unit/util/json/merge.js new file mode 100644 index 0000000..d71f5b5 --- /dev/null +++ b/StockManMVC/.bin/bower_components/cldrjs/test/unit/util/json/merge.js @@ -0,0 +1,24 @@ +define([ + "src/util/json/merge" +], function( jsonMerge ) { + + var data1 = { a: { b: 1, c: 2 } }, + data2 = { a: { b: 3, d: 4 } }, + empty = {}; + + describe( "Util Json Merge", function() { + + it( "should merge two JSONs deeply", function() { + expect( jsonMerge( data1, data2 ) ).to.eql( { a: { b: 3, c: 2, d: 4 } } ); + }); + + it( "should merge empty JSONs", function() { + expect( jsonMerge( empty ) ).to.eql( empty ); + expect( jsonMerge( empty, data1 ) ).to.eql( data1 ); + expect( jsonMerge( data1, empty ) ).to.eql( data1 ); + expect( jsonMerge( empty, data1, empty ) ).to.eql( data1 ); + }); + + }); + +}); diff --git a/StockManMVC/.bin/bower_components/cldrjs/test/unit_unresolved.html b/StockManMVC/.bin/bower_components/cldrjs/test/unit_unresolved.html new file mode 100644 index 0000000..d9920a3 --- /dev/null +++ b/StockManMVC/.bin/bower_components/cldrjs/test/unit_unresolved.html @@ -0,0 +1,20 @@ + + + + + CLDR Unit Tests + + + +
+ + + + + + + + + diff --git a/StockManMVC/.bin/bower_components/cldrjs/test/unit_unresolved.js b/StockManMVC/.bin/bower_components/cldrjs/test/unit_unresolved.js new file mode 100644 index 0000000..0b9dfc7 --- /dev/null +++ b/StockManMVC/.bin/bower_components/cldrjs/test/unit_unresolved.js @@ -0,0 +1,19 @@ +require.config({ + paths: { + "cldr-data": "../bower_components/cldr-data", + json: "../bower_components/requirejs-plugins/src/json", + src: "../src", + text: "../bower_components/requirejs-text/text" + } +}); + +require( [ "src/unresolved" ], function() { + + require([ + "./unit/item/lookup", + "./unit/bundle/parent_lookup" + ], function() { + mocha.run(); + }); + +}); diff --git a/StockManMVC/.bin/bower_components/cldrjs/test/util.js b/StockManMVC/.bin/bower_components/cldrjs/test/util.js new file mode 100644 index 0000000..fe4deaa --- /dev/null +++ b/StockManMVC/.bin/bower_components/cldrjs/test/util.js @@ -0,0 +1,67 @@ +define(function() { + +var allTypes = { + array: [ 7 ], + date: new Date(), + "function": function() {}, + "null": null, + number: 7, + object: new Foo(), + plainObject: {}, + regexp: /foo/, + string: "foo" +}; + +function assertParameterType( expect, type, fn ) { + Object.keys( allTypes ).filter( not( type ) ).forEach(function( type ) { + expect( fn( allTypes[ type ] ) ).to.throw( Error, /E_INVALID_PAR_TYPE/ ); + }); +} + +function Foo() {} + +/** + * not() should be used with Array.prototype.filter(). + * + * Return true only if b is different than any a. + * + * For example: + * [ 1, 2, 3 ].filter( not( 2 ) ) => [ 1, 3 ] + * [ 1, 2, 3 ].filter( not( [ 2, 3 ] ) ) => [ 1 ] + */ +function not( a ) { + return function( b ) { + if ( Array.isArray( a ) ) { + return !a.some(function( a ) { + return a === b; + }); + } + return a !== b; + }; +} + +return { + + assertEventParameter: function( expect, fn ) { + assertParameterType( expect, [ "regexp", "string" ], fn ); + }, + + assertFunctionParameter: function( expect, fn ) { + assertParameterType( expect, [ "function" ], fn ); + }, + + assertPathParameter: function( expect, fn ) { + assertParameterType( expect, [ "array", "string" ], fn ); + }, + + assertObjectParameter: function( expect, fn ) { + assertParameterType( expect, [ "object", "plainObject" ], fn ); + }, + + assertStringParameter: function( expect, fn ) { + assertParameterType( expect, [ "string" ], fn ); + } + +}; + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/.bower.json b/StockManMVC/.bin/bower_components/globalize/.bower.json new file mode 100644 index 0000000..dd0d38d --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/.bower.json @@ -0,0 +1,34 @@ +{ + "name": "globalize", + "license": "MIT", + "ignore": [ + "**/.*", + "test", + "CONTRIBUTING.md", + "bower.json" + ], + "dependencies": { + "cldrjs": "0.4.4", + "cldr-data": ">=25" + }, + "devDependencies": { + "es5-shim": "3.4.0", + "make-plural": "eemeli/make-plural.js#3.0.0", + "messageformat": "SlexAxton/messageformat.js#v0.3.0-1", + "qunit": "1.18.0", + "requirejs": "2.1.20", + "requirejs-plugins": "1.0.2", + "requirejs-text": "2.0.10" + }, + "homepage": "https://github.com/jquery/globalize", + "version": "1.1.1", + "_release": "1.1.1", + "_resolution": { + "type": "version", + "tag": "1.1.1", + "commit": "e8325dbf5564d239e022ce78487f4f10e26d71b1" + }, + "_source": "https://github.com/jquery/globalize.git", + "_target": "^1.0.0", + "_originalSource": "globalize" +} \ No newline at end of file diff --git a/StockManMVC/.bin/bower_components/globalize/AUTHORS.txt b/StockManMVC/.bin/bower_components/globalize/AUTHORS.txt new file mode 100644 index 0000000..bab87b3 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/AUTHORS.txt @@ -0,0 +1,53 @@ +Authors ordered by number of contributions + +Rafael Xavier de Souza +Richard D. Worth +Eric Bréchemier +Jörn Zaefferer +Dave Reed +Nikolaus Graf +Nick Schonning +Scott González +Kyle Florence +Manraj Singh +Tobie Langel +John Reilly +Nova Patch +Sean Cady +Wes Cravens +Michael Birtwell +Andrew Lunny +Pavel Karoukin +Kris Borchers +Rob Garrison +Karan Sharma +Yasuhiro Yoshida +Oleg Gulverdashvili +Stephen Walther +Mateusz Bożyk +Oleg Gaidarenko +Riku Nieminen +Isaac Durazo +Anne-Gaelle Colom +Raphael Amorim +Peter Dave Hello +Bao Ngo +Leonardo Balter +Andreas Blixt +Ed Sanders +Brahim Arkni +Kevin Kirsche +Lee Nave +Tomasz Peczek +Robert Plummer +Fredrik Blomqvist +Christian Vuerings +David De Sloovere +Tobias Nießen +Boris Moore +Arvind Kalyan +Juan Soto +John Resig +Luke Page +Amanpreet Singh +Arthur Verschaeve diff --git a/StockManMVC/.bin/bower_components/globalize/Gruntfile.js b/StockManMVC/.bin/bower_components/globalize/Gruntfile.js new file mode 100644 index 0000000..4f8eb10 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/Gruntfile.js @@ -0,0 +1,663 @@ +module.exports = function( grunt ) { + + "use strict"; + + var isConnectTestRunning, + rdefineEnd = /\}\);[^}\w]*$/, + pkg = grunt.file.readJSON( "package.json" ); + + function camelCase( input ) { + return input.toLowerCase().replace( /[-/](.)/g, function( match, group1 ) { + return group1.toUpperCase(); + }); + } + + function mountFolder( connect, path ) { + return connect.static( require( "path" ).resolve( path ) ); + } + + function replaceConsts( content ) { + return content + + // Replace Version + .replace( /@VERSION/g, pkg.version ) + + // Replace Date yyyy-mm-ddThh:mmZ + .replace( /@DATE/g, ( new Date() ).toISOString().replace( /:\d+\.\d+Z$/, "Z" ) ); + } + + grunt.initConfig({ + pkg: pkg, + authors: { + order: "count" + }, + commitplease: { + last50: { + options: { + committish: "-n 50" + } + } + }, + connect: { + options: { + port: 9001, + hostname: "localhost" + }, + test: { + options: { + middleware: function( connect ) { + return [ + mountFolder( connect, "." ), + mountFolder( connect, "test" ) + ]; + } + } + }, + keepalive: { + options: { + keepalive: true, + middleware: function( connect ) { + return [ + mountFolder( connect, "." ) + ]; + } + } + } + }, + jshint: { + source: { + src: [ "src/**/*.js", "!src/build/**" ], + options: { + jshintrc: "src/.jshintrc" + } + }, + grunt: { + src: [ "Gruntfile.js" ], + options: { + jshintrc: ".jshintrc" + } + }, + test: { + src: [ "test/*.js", "test/functional/**/*.js", "test/unit/**/*.js", + "!test/config.js" ], + options: { + jshintrc: "test/.jshintrc" + } + }, + dist: { + src: [ "dist/globalize*.js", "dist/globalize/*.js" ], + options: { + jshintrc: "src/.dist-jshintrc" + } + } + }, + jscs: { + source: [ "src/**/*.js", "!src/build/**" ], + grunt: "Gruntfile.js", + test: [ "test/*.js", "test/functional/**/*.js", "test/unit/**/*.js" ], + dist: [ "dist/globalize*.js", "dist/globalize/*.js" ] + }, + qunit: { + functional: { + options: { + urls: [ + + // Use es5-shim here due to .bind(), which is not present on phantomjs v1.9. + // But, it should be on v2.x. + "http://localhost:<%= connect.options.port %>/functional-es5-shim.html" + ] + } + }, + unit: { + options: { + urls: [ "http://localhost:<%= connect.options.port %>/unit.html" ] + } + } + }, + requirejs: { + options: { + dir: "dist/.build", + appDir: "src", + baseUrl: ".", + optimize: "none", + paths: { + cldr: "../external/cldrjs/dist/cldr", + "make-plural": "../external/make-plural/make-plural", + messageformat: "../external/messageformat/messageformat" + }, + skipSemiColonInsertion: true, + skipModuleInsertion: true, + + // Strip all definitions generated by requirejs. + // Convert content as follows: + // a) "Single return" means the module only contains a return statement that is + // converted to a var declaration. + // b) "Module" means the define wrappers are removed, but content is untouched. + // Only for root id's (the ones in src, not in src's subpaths). Note there's no + // conditional code checking for this type. + onBuildWrite: function( id, path, contents ) { + var messageformat, + name = camelCase( id.replace( /util\/|common\//, "" ) ); + + // MakePlural + if ( ( /make-plural/ ).test( id ) ) { + return contents + + // Remove browserify wrappers. + .replace( /^\(function\(f\){if\(typeof exports==="object"&&type.*/, "" ) + .replace( /\},\{\}\]\},\{\},\[1\]\)\(1\)[\s\S]*?$/, "" ) + + // Remove browserify exports. + .replace( /Object.defineProperty\(exports[\s\S]*?\n}\);/, "" ) + .replace( "exports['default'] = MakePlural;", "" ) + .replace( "module.exports = exports['default'];", "" ) + + // Remove self-tests. + .replace( /var Tests =[\s\S]*?\n}\)\(\);/, "" ) + .replace( "this.tests = new Tests(this);", "" ) + .replace( /this.fn.test =[\s\S]*?bind\(this\);/, "" ) + .replace( "this.tests.add(type, cat, examples);", "" ) + + // Remove load method. + .replace( /load: \{[\s\S]*?\n \}/, "" ) + + // Replace its wrapper into var assignment. + .replace( /\(function \(global\) \{/, [ + "var MakePlural;", + "/* jshint ignore:start */", + "MakePlural = (function() {" + ].join( "\n" ) ) + .replace( /if \(\(typeof module !== 'undefined'[\s\S]*/, [ + "return MakePlural;", + "}());", + "/* jshint ignore:end */" + ].join( "\n" ) ) + + // Wrap everything into a var assignment. + .replace( /^/, [ + "var MakePlural;", + "/* jshint ignore:start */", + "MakePlural = (function() {" + ].join( "\n" ) ) + .replace( /$/, [ + "return MakePlural;", + "}());", + "/* jshint ignore:end */" + ].join( "\n" ) ); + + // messageformat + } else if ( ( /messageformat/ ).test( id ) ) { + return contents + + // Remove browserify wrappers. + .replace( /^\(function\(f\)\{if\(typeof exports==="object"&&type.*/, "" ) + .replace( "},{}],2:[function(require,module,exports){", "" ) + .replace( /\},\{"\.\/messageformat-parser":1,"make-plural\/plural.*/, "" ) + .replace( /\},\{\}\]\},\{\},\[2\]\)\(2\)[\s\S]*?$/, "" ) + + // Set `MessageFormat.plurals` and remove `make-plural/plurals` + // completely. This is populated by Globalize on demand. + .replace( /var _cp = \[[\s\S]*?$/, "" ) + .replace( + "MessageFormat.plurals = require('make-plural/plurals')", + "MessageFormat.plurals = {}" + ) + + // Set `MessageFormat._parse` + .replace( + "MessageFormat._parse = require('./messageformat-parser').parse;", + "" + ) + .replace( /module\.exports = \(function\(\) \{([\s\S]*?)\n\}\)\(\);/, [ + "MessageFormat._parse = (function() {", + "$1", + "}()).parse;" + ].join( "\n" ) ) + + // Remove unused code. + .replace( /if \(!pluralFunc\) \{\n[\s\S]*?\n \}/, "" ) + .replace( /if \(!locale\) \{\n[\s\S]*? \}\n/, "this.lc = [locale];" ) + .replace( /(MessageFormat\.formatters) = \{[\s\S]*?\n\};/, "$1 = {};" ) + .replace( /MessageFormat\.prototype\.setIntlSupport[\s\S]*?\n\};/, "" ) + + // Wrap everything into a var assignment. + .replace( "module.exports = MessageFormat;", "" ) + .replace( /^/, [ + "var MessageFormat;", + "/* jshint ignore:start */", + "MessageFormat = (function() {" + ].join( "\n" ) ) + .replace( /$/, [ + "return MessageFormat;", + "}());", + "/* jshint ignore:end */" + ].join( "\n" ) ); + + // message-runtime + } else if ( ( /message-runtime/ ).test( id ) ) { + messageformat = require( "./external/messageformat/messageformat" ); + delete messageformat.prototype.runtime.fmt; + delete messageformat.prototype.runtime.pluralFuncs; + contents = contents.replace( "Globalize._messageFormat = {};", [ + "/* jshint ignore:start */", + "Globalize._messageFormat = (function() {", + messageformat.prototype.runtime.toString(), + "return {number: number, plural: plural, select: select};", + "}());", + "/* jshint ignore:end */" + ].join( "\n" ) ); + } + + // 1, and 2: Remove define() wrap. + // 3: Remove empty define()'s. + contents = contents + .replace( /define\([^{]*?\{/, "" ) /* 1 */ + .replace( rdefineEnd, "" ) /* 2 */ + .replace( /define\(\[[^\]]+\]\)[\W\n]+$/, "" ); /* 3 */ + + // Type a (single return) + if ( ( /\// ).test( id ) ) { + contents = contents + .replace( /\nreturn/, "\nvar " + name + " =" ); + } + + return contents; + } + }, + bundle: { + options: { + modules: [ + { + name: "globalize", + include: [ "core" ], + exclude: [ "cldr", "cldr/event" ], + create: true, + override: { + wrap: { + startFile: "src/build/intro-core.js", + endFile: "src/build/outro.js" + } + } + }, + { + name: "globalize.currency", + include: [ "currency" ], + exclude: [ + "cldr", + "cldr/event", + "cldr/supplemental", + "./core", + "./number" + ], + create: true, + override: { + wrap: { + startFile: "src/build/intro-currency.js", + endFile: "src/build/outro.js" + } + } + }, + { + name: "globalize.date", + include: [ "date" ], + exclude: [ + "cldr", + "cldr/event", + "cldr/supplemental", + "./core", + "./number" + ], + create: true, + override: { + wrap: { + startFile: "src/build/intro-date.js", + endFile: "src/build/outro.js" + } + } + }, + { + name: "globalize.message", + include: [ "message" ], + exclude: [ "cldr", "./core" ], + create: true, + override: { + wrap: { + startFile: "src/build/intro-message.js", + endFile: "src/build/outro.js" + } + } + }, + { + name: "globalize.number", + include: [ "number" ], + exclude: [ + "cldr", + "cldr/event", + "cldr/supplemental", + "./core" + ], + create: true, + override: { + wrap: { + startFile: "src/build/intro-number.js", + endFile: "src/build/outro.js" + } + } + }, + { + name: "globalize.plural", + include: [ "plural" ], + exclude: [ + "cldr", + "cldr/event", + "cldr/supplemental", + "./core" + ], + create: true, + override: { + wrap: { + startFile: "src/build/intro-plural.js", + endFile: "src/build/outro.js" + } + } + }, + { + name: "globalize.relative-time", + include: [ "relative-time" ], + exclude: [ + "cldr", + "cldr/event", + "cldr/supplemental", + "./core", + "./number", + "./plural" + ], + create: true, + override: { + wrap: { + startFile: "src/build/intro-relative-time.js", + endFile: "src/build/outro.js" + } + } + }, + { + name: "globalize.unit", + include: [ "unit" ], + exclude: [ + "cldr", + "./core", + "./number", + "./plural" + ], + create: true, + override: { + wrap: { + startFile: "src/build/intro-unit.js", + endFile: "src/build/outro.js" + } + } + }, + { + name: "globalize-runtime", + include: [ "core-runtime" ], + create: true, + override: { + wrap: { + startFile: "src/build/intro-core-runtime.js", + endFile: "src/build/outro.js" + } + } + }, + { + name: "globalize.currency-runtime", + include: [ "currency-runtime" ], + exclude: [ + "./core-runtime", + "./number-runtime" + ], + create: true, + override: { + wrap: { + startFile: "src/build/intro-currency-runtime.js", + endFile: "src/build/outro.js" + } + } + }, + { + name: "globalize.date-runtime", + include: [ "date-runtime" ], + exclude: [ + "./core-runtime", + "./number-runtime" + ], + create: true, + override: { + wrap: { + startFile: "src/build/intro-date-runtime.js", + endFile: "src/build/outro.js" + } + } + }, + { + name: "globalize.message-runtime", + include: [ "message-runtime" ], + exclude: [ "./core-runtime" ], + create: true, + override: { + wrap: { + startFile: "src/build/intro-message-runtime.js", + endFile: "src/build/outro.js" + } + } + }, + { + name: "globalize.number-runtime", + include: [ "number-runtime" ], + exclude: [ + "./core-runtime" + ], + create: true, + override: { + wrap: { + startFile: "src/build/intro-number-runtime.js", + endFile: "src/build/outro.js" + } + } + }, + { + name: "globalize.plural-runtime", + include: [ "plural-runtime" ], + exclude: [ + "./core-runtime" + ], + create: true, + override: { + wrap: { + startFile: "src/build/intro-plural-runtime.js", + endFile: "src/build/outro.js" + } + } + }, + { + name: "globalize.relative-time-runtime", + include: [ "relative-time-runtime" ], + exclude: [ + "./core-runtime", + "./number-runtime", + "./plural-runtime" + ], + create: true, + override: { + wrap: { + startFile: "src/build/intro-relative-time-runtime.js", + endFile: "src/build/outro.js" + } + } + }, + { + name: "globalize.unit-runtime", + include: [ "unit-runtime" ], + exclude: [ + "./core-runtime", + "./number-runtime", + "./plural-runtime" + ], + create: true, + override: { + wrap: { + startFile: "src/build/intro-unit-runtime.js", + endFile: "src/build/outro.js" + } + } + } + ] + } + } + }, + watch: { + files: [ "src/*.js", "test/functional/**/*.js", "test/unit/**/*.js", "test/*.html" ], + tasks: [ "default" ] + }, + copy: { + options: { + processContent: function( content ) { + + // Remove leftover define created during rjs build + content = content.replace( /define\(".*/, "" ); + + // Embed VERSION and DATE + return replaceConsts( content ); + } + }, + coreAndRuntime: { + expand: true, + cwd: "dist/.build/", + src: [ "globalize.js", "globalize-runtime.js" ], + dest: "dist/" + }, + modules: { + expand: true, + cwd: "dist/.build/", + src: [ "globalize*.js", "!globalize.js", "!*runtime*.js" ], + dest: "dist/globalize", + rename: function( dest, src ) { + return require( "path" ).join( dest, src.replace( /globalize\./, "" ) ); + } + }, + runtimeModules: { + expand: true, + cwd: "dist/.build/", + src: [ "globalize.*runtime.js" ], + dest: "dist/globalize-runtime", + rename: function( dest, src ) { + return require( "path" ).join( dest, src.replace( /(globalize\.|-runtime)/g, "" ) ); + } + }, + allInOneNode: { + src: "src/build/node-main.js", + dest: "dist/node-main.js" + } + }, + uglify: { + options: { + banner: replaceConsts( grunt.file.read( "src/build/intro.min.js" ) ) + }, + dist: { + files: { + "tmp/globalize.min.js": [ "dist/globalize.js" ], + "tmp/globalize/currency.min.js": [ "dist/globalize/currency.js" ], + "tmp/globalize/date.min.js": [ "dist/globalize/date.js" ], + "tmp/globalize/number.min.js": [ "dist/globalize/number.js" ], + "tmp/globalize/plural.min.js": [ "dist/globalize/plural.js" ], + "tmp/globalize/message.min.js": [ "dist/globalize/message.js" ], + "tmp/globalize/relative-time.min.js": [ "dist/globalize/relative-time.js" ], + "tmp/globalize/unit.min.js": [ "dist/globalize/unit.js" ], + + "tmp/globalize-runtime.min.js": [ "dist/globalize-runtime.js" ], + "tmp/globalize-runtime/currency.min.js": [ + "dist/globalize-runtime/currency.js" + ], + "tmp/globalize-runtime/date.min.js": [ "dist/globalize-runtime/date.js" ], + "tmp/globalize-runtime/message.min.js": [ "dist/globalize-runtime/message.js" ], + "tmp/globalize-runtime/number.min.js": [ "dist/globalize-runtime/number.js" ], + "tmp/globalize-runtime/plural.min.js": [ "dist/globalize-runtime/plural.js" ], + "tmp/globalize-runtime/relative-time.min.js": [ + "dist/globalize-runtime/relative-time.js" + ], + "tmp/globalize-runtime/unit.min.js": [ "dist/globalize-runtime/unit.js" ] + } + } + }, + + // TODO figure out how to specify exceptions for externals + "compare_size": { + files: [ + "tmp/globalize.min.js", + "tmp/globalize/*min.js", + "tmp/globalize-runtime.min.js", + "tmp/globalize-runtime/*min.js" + ], + options: { + compress: { + gz: function( fileContents ) { + return require( "gzip-js" ).zip( fileContents, {}).length; + } + } + } + }, + clean: { + dist: [ + "dist" + ] + }, + checkDependencies: { + bower: { + options: { + packageManager: "bower" + } + }, + npm: { + options: { + packageManager: "npm" + } + } + } + }); + + require( "matchdep" ).filterDev( "grunt-*" ).forEach( grunt.loadNpmTasks ); + + grunt.registerTask( "test", function() { + var args = [].slice.call( arguments ); + if ( !isConnectTestRunning ) { + grunt.task.run( "checkDependencies" ); + grunt.task.run( "connect:test" ); + isConnectTestRunning = true; + } + grunt.task.run( [ "qunit" ].concat( args ).join( ":" ) ); + }); + + // Default task. + grunt.registerTask( "default", [ + "jshint:grunt", + "jshint:source", + "jshint:test", + "jscs:grunt", + "jscs:source", + + // TODO fix issues, enable + //"jscs:test", + "test:unit", + "clean", + "requirejs", + "copy", + "jshint:dist", + + // TODO fix issues, enable + // "jscs:dist", + "test:functional", + "uglify", + "compare_size", + "commitplease" + ]); + +}; diff --git a/StockManMVC/.bin/bower_components/globalize/LICENSE.txt b/StockManMVC/.bin/bower_components/globalize/LICENSE.txt new file mode 100644 index 0000000..0f9f2e5 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/LICENSE.txt @@ -0,0 +1,43 @@ +Copyright jQuery Foundation and other contributors, https://jquery.org/ + +This software consists of voluntary contributions made by many +individuals. For exact contribution history, see the revision history +available at https://github.com/jquery/globalize + +The following license applies to all parts of this software except as +documented below: + +==== + +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. + +==== + +Copyright and related rights for sample code are waived via CC0. Sample +code is defined as all source code contained within the doc directory. + +CC0: http://creativecommons.org/publicdomain/zero/1.0/ + +==== + +All files located in the node_modules and external directories are +externally maintained libraries used by this software which have their +own licenses; we recommend you read them, as their terms may differ from +the terms above. diff --git a/StockManMVC/.bin/bower_components/globalize/README.md b/StockManMVC/.bin/bower_components/globalize/README.md new file mode 100644 index 0000000..7968a4e --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/README.md @@ -0,0 +1,867 @@ +# Globalize + +[![Build Status](https://secure.travis-ci.org/jquery/globalize.svg?branch=master)](http://travis-ci.org/jquery/globalize) +[![devDependency Status](https://david-dm.org/jquery/globalize/status.svg)](https://david-dm.org/jquery/globalize#info=dependencies) +[![devDependency Status](https://david-dm.org/jquery/globalize/dev-status.svg)](https://david-dm.org/jquery/globalize#info=devDependencies) + +A JavaScript library for internationalization and localization that leverage the +official [Unicode CLDR](http://cldr.unicode.org/) JSON data. The library works both for the browser and as a +Node.js module. + +- [About Globalize](#about-globalize) + - [Why globalization?](#why-globalization) + - [Why Globalize?](#why-globalize) + - [Migrating from Globalize 0.x](#migrating-from-globalize-0x) + - [Where to use it?](#where-to-use-it) + - [Where does the data come from?](#where-does-the-data-come-from) + - [Only load and use what you need](#pick-the-modules-you-need) + - [Browser support](#browser-support) +- [Getting started](#getting-started) + - [Requirements](#requirements) + - [Installation](#installation) + - [Usage](#usage) + - [Performance](#performance) + - [Compilation and the Runtime modules](#compilation-and-the-runtime-modules) + - [Examples](#examples) +- [API](#api) + - [Core](#core-module) + - [Date module](#date-module) + - [Message module](#message-module) + - [Number module](#number-module) + - [Currency module](#currency-module) + - [Plural module](#plural-module) + - [Relative time module](#relative-time-module) + - [Unit module](#unit-module) + - more to come... +- [Error reference](#error-reference) +- [Contributing](#contributing) + - [Roadmap](#roadmap) +- [Development](#development) + - [File structure](#file-structure) + - [Source files](#source-files) + - [Tests](#tests) + - [Build](#build) + + +## About Globalize + +### Why globalization? + +Each language, and the countries that speak that language, have different +expectations when it comes to how numbers (including currency and percentages) +and dates should appear. Obviously, each language has different names for the +days of the week and the months of the year. But they also have different +expectations for the structure of dates, such as what order the day, month and +year are in. In number formatting, not only does the character used to +delineate number groupings and the decimal portion differ, but the placement of +those characters differ as well. + +A user using an application should be able to read and write dates and numbers +in the format they are accustomed to. This library makes this possible, +providing an API to convert user-entered number and date strings - in their +own format - into actual numbers and dates, and conversely, to format numbers +and dates into that string format. + +Even if the application deals only with the English locale, it may still need +globalization to format programming language bytes into human-understandable +language and vice-versa in an effective and reasonable way. For example, to +display something better than "Edited 1 minutes ago". + +### Why Globalize? + +Globalize provides number formatting and parsing, date and time formatting and +parsing, currency formatting, message formatting (ICU message format pattern), +and plural support. + +Design Goals. + +- Leverages the Unicode CLDR data and follows its UTS#35 specification. +- Keeps code separate from i18n content. Doesn't host or embed any locale data + in the library. Empowers developers to control the loading mechanism of their + choice. +- Allows developers to load as much or as little data as they need. Avoids + duplicating data if using multiple i18n libraries that leverage CLDR. +- Keeps code modular. Allows developers to load the i18n functionalities they + need. +- Runs in browsers and Node.js, consistently across all of them. +- Makes globalization as easy to use as jQuery. + +Globalize is based on the Unicode Consortium's Common Locale Data Repository +(CLDR), the largest and most extensive standard repository of locale data +available. CLDR is constantly updated and is used by many large applications and +operating systems, so you'll always have access to the most accurate and +up-to-date locale data. + +Globalize needs CLDR content to function properly, although it doesn't embed, +hard-code, or host such content. Instead, Globalize empowers developers to load +CLDR data the way they want. Vanilla CLDR in its official JSON format (no +pre-processing) is expected to be provided. As a consequence, (a) Globalize +avoids bugs caused by outdated i18n content. Developers can use up-to-date CLDR +data directly from Unicode as soon as it's released, without having to wait for +any pipeline on our side. (b) Developers have full control over which locale +coverage they want to provide on their applications. (c) Developers are able to +share the same i18n dataset between Globalize and other libraries that leverage +CLDR. There's no need for duplicating data. + +Globalize is systematically tested against desktop and mobile browsers and +Node.js. So, using it you'll get consistent results across different browsers +and across browsers and the server. + +Globalize doesn't use native Ecma-402 yet, which could potentially improve date +and number formatting performance. Although Ecma-402 support is improving among +modern browsers and even Node.js, the functionality and locale coverage level +varies between different environments (see Comparing JavaScript Libraries [slide +25][]). Globalize needs to do more research and testings to use it reliably. + +For alternative libraries and more, check out this [JavaScript globalization +overview][]. + +[slide 25]: http://jsi18n.com/jsi18n.pdf +[JavaScript globalization overview]: http://rxaviers.github.io/javascript-globalization/ + +### Migrating from Globalize 0.x + +Are you coming from Globalize 0.x? Read our [migration guide][] to learn what +have changed and how to migrate older 0.x code to up-to-date 1.x. + +[migration guide]: doc/migrating-from-0.x.md + +### Where to use it? + +Globalize is designed to work both in the [browser](#browser-support), or in +[Node.js](#usage). It supports both [AMD](#usage) and [CommonJS](#usage). + +### Where does the data come from? + +Globalize uses the [Unicode CLDR](http://cldr.unicode.org/), the largest and +most extensive standard repository of locale data. + +We do NOT embed any i18n data within our library. However, we make it really +easy to use. Read [How to get and load CLDR JSON data](#2-cldr-content) for more +information on its usage. + +### Pick the modules you need + +| File | Minified + gzipped size | Runtime minified + gzipped size | Summary | +|---|--:|--:|---| +| globalize.js | 1.5KB | 1.0KB | [Core library](#core-module) | +| globalize/currency.js | 2.6KB | 0.6KB | [Currency module](#currency-module) provides currency formatting and parsing | +| globalize/date.js | 5.1KB | 3.8KB | [Date module](#date-module) provides date formatting and parsing | +| globalize/message.js | 5.4KB | 0.7KB | [Message module](#message-module) provides ICU message format support | +| globalize/number.js | 3.1KB | 1.8KB | [Number module](#number-module) provides number formatting and parsing | +| globalize/plural.js | 2.3KB | 0.4KB | [Plural module](#plural-module) provides pluralization support | +| globalize/relative-time.js | 0.8KB | 0.6KB | [Relative time module](#relative-time-module) provides relative time formatting support | +| globalize/unit.js | 0.9KB | 0.5KB | [Unit module](#unit-module) provides unit formatting support | + +### Browser Support + +Globalize 1.x supports the following browsers: + +- Chrome: (Current - 1) or Current +- Firefox: (Current - 1) or Current +- Safari: 5.1+ +- Opera: 12.1x, (Current - 1) or Current +- IE9+ + +*(Current - 1)* or *Current* denotes that we support the current stable version +of the browser and the version that preceded it. For example, if the current +version of a browser is 24.x, we support the 24.x and 23.x versions. + +## Getting Started + + npm install globalize cldr-data + +```js +var Globalize = require( "globalize" ); +Globalize.load( require( "cldr-data" ).entireSupplemental() ); +Globalize.load( require( "cldr-data" ).entireMainFor( "en", "es" ) ); + +Globalize("en").formatDate(new Date()); +// > "11/27/2015" + +Globalize("es").formatDate(new Date()); +// > "27/11/2015" +``` + +Read the [Locales section](#locales) for more information about supported locales. For AMD, bower and other usage examples, see [Examples section](#examples). + +### Installation + +*By downloading a ZIP or a TAR.GZ...* + +Click the github [releases tab](https://github.com/jquery/globalize/releases) +and download the latest available Globalize package. + +*By using a package manager...* + +Use bower `bower install globalize`, or npm `npm install globalize cldr-data`. + +*By using source files...* + +1. `git clone https://github.com/jquery/globalize.git`. +1. [Build the distribution files](#build). + +### Requirements + +#### 1. Dependencies + +If you use module loading like ES6 import, CommonJS, or AMD and fetch your code +using package managers like *npm* or *bower*, you don't need to worry about this +and can skip reading this section. Otherwise, you need to satisfy Globalize +dependencies prior to using it. There is only one external dependency: +[cldr.js][], which is a CLDR low level manipulation tool. Additionally, you need +to satisfy the cross-dependencies between modules. + +| Module | Dependencies (load in order) | +|---|---| +| Core module | [cldr.js][] | +| Currency module | globalize.js (core), globalize/number.js, and globalize/plural.js (only required for "code" or "name" styles) | +| Date module | globalize.js (core) and globalize/number.js | +| Message module | globalize.js (core) and globalize/plural.js (if using messages that need pluralization support) | +| Number module | globalize.js (core) | +| Plural | globalize.js (core) | +| Relative time module | globalize.js (core), globalize/number.js, and globalize/plural.js | +| Unit module | globalize.js (core), globalize/number.js, and globalize/plural.js | + +As an alternative to deducing this yourself, use this [online tool](http://johnnyreilly.github.io/globalize-so-what-cha-want/). The tool allows you to select the modules you're interested in using and tells you the Globalize files *and* CLDR JSON that you need. + +[cldr.js]: https://github.com/rxaviers/cldrjs + +#### 2. CLDR content + +Globalize is the i18n software (the engine). Unicode CLDR is the i18n content +(the fuel). You need to feed Globalize on the appropriate portions of CLDR prior +to using it. + +*(a) How do I figure out which CLDR portions are appropriate for my needs?* + +Each Globalize function requires a special set of CLDR portions. Once you know +which Globalize functionalities you need, you can deduce its respective CLDR +requirements. See table below. + +| Module | Required CLDR JSON files | +|---|---| +| Core module | cldr/supplemental/likelySubtags.json | +| Currency module | cldr/main/`locale`/currencies.json
cldr/supplemental/currencyData.json
+CLDR JSON files from number module
+CLDR JSON files from plural module for name style support | +| Date module | cldr/main/`locale`/ca-gregorian.json
cldr/main/`locale`/timeZoneNames.json
cldr/supplemental/timeData.json
cldr/supplemental/weekData.json
+CLDR JSON files from number module | +| Number module | cldr/main/`locale`/numbers.json
cldr/supplemental/numberingSystems.json | +| Plural module | cldr/supplemental/plurals.json (for cardinals)
cldr/supplemental/ordinals.json (for ordinals) | +| Relative time module | cldr/main/`locale`/dateFields.json
+CLDR JSON files from number and plural modules | +| Unit module | cldr/main/`locale`/units.json
+CLDR JSON files from number and plural module | + +As an alternative to deducing this yourself, use this [online tool](http://johnnyreilly.github.io/globalize-so-what-cha-want/). The tool allows you to select the modules you're interested in using and tells you the Globalize files *and* CLDR JSON that you need. + +*(b) How am I supposed to get and load CLDR content?* + +Learn [how to get and load CLDR content...](doc/cldr.md). + +### Usage + +Globalize's consumable-files are located in the `./dist` directory. If you +don't find it, it's because you are using a development branch. You should +either use a tagged version or [build the distribution files yourself](#build). +Read [installation](#installation) above if you need more information on how to +download. + +Globalize can be used for a variety of different i18n tasks, eg. formatting or +parsing dates, formatting or parsing numbers, formatting messages, etc. You may +NOT need Globalize in its entirety. For that reason, we made it modular. So, you +can cherry-pick the pieces you need, eg. load `dist/globalize.js` to get +Globalize core, load `dist/globalize/date.js` to extend Globalize with Date +functionalities, etc. + +An example is worth a thousand words. Check out our [Examples](#examples) +section below. + +### Performance + +When formatting or parsing, there's actually a two-step process: (a) the +formatter (or parser) *creation* and (b) its *execution*, where creation takes +an order of magnitude more time (more expensive) than execution. In the creation +phase, Globalize traverses the CLDR tree, processes data (e.g., expands date +patterns, parses plural rules, etc), and returns a function that actually +executes the formatting or parsing. + +```js +// Formatter creation. +var formatter = Globalize.numberFormatter(); + +// Formatter execution (roughly 10x faster than above). +formatter( Math.PI ); +// > 3.141 +``` + +As a rule of thumb for optimal performance, cache your formatters and parsers. +For example: (a) on iterations, generate them outside the loop and reuse while +looping; (b) on server applications, generate them in advance and execute when +requests arrive. + +### Compilation and the Runtime modules + +Take advantage of compiling your formatters and/or parsers during build time +when deploying to production. It's much faster than generating them in real-time +and it's also much smaller (i.e., better loading performance). + +Your compiled formatters and parsers allow you to skip a big part of the library +and also allow you to skip loading CLDR data, because they have already been +created (see [Performance](#performance) above for more information). + +To illustrate, see our [Basic Globalize Compiler example][]. + + +#### Globalize Compiler + +For information about the Globalize Compiler CLI or its JavaScript API, see the +[Globalize Compiler documentation][]. + +[Globalize Compiler documentation]: https://github.com/jquery-support/globalize-compiler#README + +### Examples + +The fastest and easiest way to use Globalize is by integrating it into your +existing tools. + +- [Application example using webpack and npm](examples/app-npm-webpack/): easy to + get started, automated CLDR loading and precompilation for production, but + requires npm and webpack knowledge. + +If you're using a different tool than the one above, but you're comfortable +using JavaScript modules (such as ES6 modules, CommonJS, or AMD) and package +managers like npm or bower, you may want to check out the following examples. +Note you'll need to compile your code for production yourself. + +- [Basic example using AMD and bower](examples/amd-bower/): feeding Globalize on + CLDR is not completely transparent. +- [Basic example using Node.js and npm](examples/node-npm/): feeding Globalize + on CLDR is not completely transparent. +- [Basic Globalize Compiler example][]: shows how to use Globalize Compiler CLI. + +[Basic Globalize Compiler example]: examples/globalize-compiler/ + +If you're using none of the tools above, but instead you're using the plain and +old script tags only, the following example may interest you. Note Globalize +allows you to go low level like this. But, acknowledge that you'll need to +handle dependencies and CLDR loading manually yourself. + +- [Basic example using plain JavaScript](examples/plain-javascript/): requires + loading CLDR and handling dependencies manually. + +## API + +### Core module + +- **`Globalize.load( cldrJSONData, ... )`** + + This method allows you to load CLDR JSON locale data. `Globalize.load()` is a + proxy to `Cldr.load()`. + + [Read more...](doc/api/core/load.md) + +- **`Globalize.locale( [locale|cldr] )`** + + Set default locale, or get it if locale argument is omitted. + + [Read more...](doc/api/core/locale.md) + +- **`[new] Globalize( locale|cldr )`** + + Create a Globalize instance. + + [Read more...](doc/api/core/constructor.md) + +#### Locales + +A locale is an identifier (id) that refers to a set of user preferences that +tend to be shared across significant swaths of the world. In technical terms, +it's a String composed of three parts: language, script, and region. For +example: + +| locale | description | +| --- | --- | +| *en-Latn-US* | English as spoken in the Unites States in the Latin script. | +| *en-US* | English as spoken in the Unites States (Latin script is deduced given it's the most likely script used in this place). | +| *en* | English (United States region and Latin script are deduced given they are respectively the most likely region and script used in this place). | +| *en-GB* | English as spoken in the United Kingdom (Latin script is deduced given it's the most likely script used in this place). | +| *en-IN* | English as spoken in India (Latin script is deduced). | +| *es* | Spanish (Spain region and Latin script are deduced). | +| *es-MX* | Spanish as spoken in Mexico (Latin script is deduced). | +| *zh* | Chinese (China region and Simplified Han script are deduced). | +| *zh-TW* | Chinese as spoken in Taiwan (Traditional Han script is deduced). | +| *ja* | Japanese (Japan region and Japanese script are deduced). | +| *de* | German (Germany region and Latin script are deduced). | +| *pt* | Portuguese (Brazil region and Latin script are deduced). | +| *pt-PT* | Portuguese as spoken in Portugal (Latin script is deduced). | +| *fr* | French (France region and Latin script are deduced). | +| *ru* | Russian (Russia region and Cyrillic script are deduced). | +| *ar* | Arabic (Egypt region and Arabic script are deduced). | + +The likely deductibility is computed by using CLDR data, which is based on the +population and the suppress-script data in BCP47 (among others). The data is +heuristically derived, and may change over time. + +Figure out the deduced information by looking at the +`cldr.attributes.maxLanguageId` property of a Globalize instance: + +```js +var Globalize = require( "globalize" ); +Globalize.load( require( "cldr-data" ).entireSupplemental() ); +Globalize("en").cldr.attributes.maxLanguageId; +// > "en-Latn-US" +``` + +Globalize supports all the locales available in CLDR, which are around 740. +For more information, search for coverage charts at the downloads section of +http://cldr.unicode.org/. + +Read more details about locale at [UTS#35 locale][]. + +[UTS#35 locale]: http://www.unicode.org/reports/tr35/#Locale + +### Date module + +- **`.dateFormatter( [options] )`** + + Return a function that formats a date according to the given `options`. The default formatting is + numeric year, month, and day (i.e., `{ skeleton: "yMd" }`. + + ```javascript + .dateFormatter()( new Date() ) + // > "11/30/2010" + + .dateFormatter({ skeleton: "GyMMMd" })( new Date() ) + // > "Nov 30, 2010 AD" + + .dateFormatter({ date: "medium" })( new Date() ) + // > "Nov 1, 2010" + + .dateFormatter({ time: "medium" })( new Date() ) + // > "5:55:00 PM" + + .dateFormatter({ datetime: "medium" })( new Date() ) + // > "Nov 1, 2010, 5:55:00 PM" + ``` + + [Read more...](doc/api/date/date-formatter.md) + +- **`.dateParser( [options] )`** + + Return a function that parses a string representing a date into a JavaScript Date object according + to the given `options`. The default parsing assumes numeric year, month, and day (i.e., `{ + skeleton: "yMd" }`). + + ```javascript + .dateParser()( "11/30/2010" ) + // > new Date( 2010, 10, 30, 0, 0, 0 ) + + .dateParser({ skeleton: "GyMMMd" })( "Nov 30, 2010 AD" ) + // > new Date( 2010, 10, 30, 0, 0, 0 ) + + .dateParser({ date: "medium" })( "Nov 1, 2010" ) + // > new Date( 2010, 10, 30, 0, 0, 0 ) + + .dateParser({ time: "medium" })( "5:55:00 PM" ) + // > new Date( 2015, 3, 22, 17, 55, 0 ) // i.e., today @ 5:55PM + + .dateParser({ datetime: "medium" })( "Nov 1, 2010, 5:55:00 PM" ) + // > new Date( 2010, 10, 30, 17, 55, 0 ) + ``` + + [Read more...](doc/api/date/date-parser.md) + +- **`.formatDate( value [, options] )`** + + Alias for `.dateFormatter( [options] )( value )`. + +- **`.parseDate( value [, options] )`** + + Alias for `.dateParser( [options] )( value )`. + +### Message module + +- **`Globalize.loadMessages( json )`** + + Load messages data. + + [Read more...](doc/api/message/load-messages.md) + +- **`.messageFormatter( path ) ➡ function( [variables] )`** + + Return a function that formats a message (using ICU message format pattern) + given its path and a set of variables into a user-readable string. It supports + pluralization and gender inflections. + + ```javascript + .messageFormatter( "task" )( 1000 ) + // > "You have 1,000 tasks remaining" + + .messageFormatter( "like" )( 3 ) + // > "You and 2 others liked this" + ``` + + [Read more...](doc/api/message/message-formatter.md) + +- **`.formatMessage( path [, variables ] )`** + + Alias for `.messageFormatter( path )([ variables ])`. + +### Number module + +- **`.numberFormatter( [options] )`** + + Return a function that formats a number according to the given options or locale's defaults. + + ```javascript + .numberFormatter()( pi ) + // > "3.142" + + .numberFormatter({ maximumFractionDigits: 5 })( pi ) + // > "3.14159" + + .numberFormatter({ round: "floor" })( pi ) + // > "3.141" + + .numberFormatter({ minimumFractionDigits: 2 })( 10000 ) + // > "10,000.00" + + .numberFormatter({ style: "percent" })( 0.5 ) + // > "50%" + ``` + + [Read more...](doc/api/number/number-formatter.md) + +- **`.numberParser( [options] )`** + + Return a function that parses a string representing a number according to the given options or + locale's defaults. + + ```javascript + .numberParser()( "3.14159" ) + // > 3.14159 + + .numberParser()( "10,000.00" ) + // > 10000 + + .numberParser({ style: "percent" })( "50%" ) + // > 0.5 + ``` + + [Read more...](doc/api/number/number-parser.md) + +- **`.formatNumber( value [, options] )`** + + Alias for `.numberFormatter( [options] )( value )`. + +- **`.parseNumber( value [, options] )`** + + Alias for `.numberParser( [options] )( value )`. + +#### Currency module + +- **`.currencyFormatter( currency [, options] )`** + + Return a function that formats a currency according to the given options or + locale's defaults. + + ```javascript + .currencyFormatter( "USD" )( 1 ) + // > "$1.00" + + .currencyFormatter( "USD", { style: "accounting" })( -1 ) + // > "($1.00)" + + .currencyFormatter( "USD", { style: "name" })( 69900 ) + // > "69,900.00 US dollars" + + .currencyFormatter( "USD", { style: "code" })( 69900 ) + // > "69,900.00 USD" + + .currencyFormatter( "USD", { round: "ceil" })( 1.491 ) + // > "$1.50" + ``` + + [Read more...](doc/api/currency/currency-formatter.md) + +- **`.formatCurrency( value, currency [, options] )`** + + Alias for `.currencyFormatter( currency [, options] )( value )`. + +### Plural module + +- **`.pluralGenerator( [options] )`** + + Return a function that returns the value's corresponding plural group: `zero`, + `one`, `two`, `few`, `many`, or `other`. + + The function may be used for cardinals or ordinals. + + ```javascript + .pluralGenerator()( 0 ) + // > "other" + + .pluralGenerator()( 1 ) + // > "one" + + .pluralGenerator({ type: "ordinal" })( 1 ) + // > "one" + + .pluralGenerator({ type: "ordinal" })( 2 ) + // > "two" + ``` + + [Read more...](doc/api/plural/plural-generator.md) + +- **`.plural( value[, options ] )`** + + Alias for `.pluralGenerator( [options] )( value )`. + +### Relative time module + +- **`.relativeTimeFormatter( unit [, options] )`** + + Returns a function that formats a relative time according to the given unit, options, and the + default/instance locale. + + ```javascript + .relativeTimeFormatter( "day" )( 1 ) + // > "tomorrow" + + .relativeTimeFormatter( "month" )( -1 ) + // > "last month" + + .relativeTimeFormatter( "month" )( 3 ) + // > "in 3 months" + ``` + + [Read more...](doc/api/relative-time/relative-time-formatter.md) + +- **`.formatRelativeTime( value, unit [, options] )`** + + Alias for `.relativeTimeFormatter( unit, options )( value )`. + +## Unit module + +- **`.unitFormatter( unit [, options] )`** + + Returns a function that formats a unit according to the given unit, options, and the + default/instance locale. + + ```javascript + .unitFormatter( "second" )( 10 ) + // > "10 seconds" + + .unitFormatter( "second", { form: "short" } )( 10 ) + // > "10 secs" + + .unitFormatter( "second", { form: "narrow" } )( 10 ) + // > "10s" + ``` + + [Read more...](doc/api/unit/unit-formatter.md) + +- **`.formatUnit( value, unit [, options] )`** + + Alias for `.unitFormatter( unit, options )( value )`. + +## Error reference + +### CLDR Errors + +- **`E_INVALID_CLDR`** + + Thrown when a CLDR item has an invalid or unexpected value. + + [Read more...](doc/error/e-invalid-cldr.md) + +- **`E_MISSING_CLDR`** + + Thrown when any required CLDR item is NOT found. + + [Read more...](doc/error/e-missing-cldr.md) + +### Parameter Errors + +- **`E_INVALID_PAR_TYPE`** + + Thrown when a parameter has an invalid type on any static or instance methods. + + [Read more...](doc/error/e-invalid-par-type.md) + +- **`E_INVALID_PAR_VALUE`** + + Thrown for certain parameters when the type is correct, but the value is + invalid. + + [Read more...](doc/error/e-invalid-par-value.md) + +- **`E_MISSING_PARAMETER`** + + Thrown when a required parameter is missing on any static or instance methods. + + [Read more...](doc/error/e-missing-parameter.md) + +- **`E_PAR_OUT_OF_RANGE`** + + Thrown when a parameter is not within a valid range of values. + + [Read more...](doc/error/e-par-out-of-range.md) + +### Other Errors + +- **`E_DEFAULT_LOCALE_NOT_DEFINED`** + + Thrown when any static method, eg. `Globalize.formatNumber()` is used prior to + setting the Global locale with `Globalize.locale( )`. + + [Read more...](doc/error/e-default-locale-not-defined.md) + +- **`E_MISSING_PLURAL_MODULE`** + + Thrown when plural module is needed, but not loaded, eg. to format currencies + using the named form. + + [Read more...](doc/error/e-missing-plural-module.md) + +- **`E_UNSUPPORTED`** + + Thrown for unsupported features, eg. to format unsupported date patterns. + + [Read more...](doc/error/e-unsupported.md) + + +## Contributing + +If you are having trouble using Globalize after reading the documentation +carefully, please post a question to [StackOverflow with the +"javascript-globalize" tag][]. Questions that include a minimal demo are more +likely to receive responses. + +In the spirit of open source software development, we always encourage +community code contribution. To help you get started and before you jump into +writing code, be sure to read [CONTRIBUTING.md](CONTRIBUTING.md). + +[StackOverflow with the "javascript-globalize" tag]: http://stackoverflow.com/tags/javascript-globalize + +For ideas where to start contributing, see the following queries to find what +best suites your interest: [quick changes][], [new features][], [bug fixes][], +[documentation improvements][], [date module][], [currency module][], [message +module][], [number module][], [plural module][], [relative time module][]. Last +but not least, feel free to [get in touch](http://irc.jquery.org/). + +[bug fixes]: https://github.com/jquery/globalize/labels/bug +[documentation improvements]: https://github.com/jquery/globalize/labels/docs +[new features]: https://github.com/jquery/globalize/labels/new%20feature +[quick changes]: https://github.com/jquery/globalize/labels/quick%20changes + +[currency module]: https://github.com/jquery/globalize/labels/currency%20module +[date module]: https://github.com/jquery/globalize/labels/date%20module +[message module]: https://github.com/jquery/globalize/labels/message%20module +[number module]: https://github.com/jquery/globalize/labels/number%20module +[plural module]: https://github.com/jquery/globalize/labels/plural%20module +[relative time module]: https://github.com/jquery/globalize/labels/relative%20time%20module + +### Roadmap + +Our roadmap is the collection of all open issues and pull requests where you can +find: + +- [Ongoing work][] lists our current sprint. Here you find where we're actively + working on at this very moment. Priority is determined by the community needs + and volunteering. If there is anything you want to be done, share your + thoughts with us on any existing or new issue and especially volunteer to do + it. +- [Everything else][] is potential next work that you could help us to + accomplish now. Releases are published following semver rules as often as + possible. + +[Ongoing work]: https://github.com/jquery/globalize/labels/Current%20Sprint +[Everything else]: https://github.com/jquery/globalize/issues?utf8=%E2%9C%93&q=is%3Aopen+-label%3A%22Current+Sprint%22+ + +## Development + +### File structure +``` +├── bower.json (metadata file) +├── CONTRIBUTING.md (doc file) +├── dist/ (consumable files, the built files) +├── external/ (external dependencies, eg. cldr.js, QUnit, RequireJS) +├── Gruntfile.js (Grunt tasks) +├── LICENSE.txt (license file) +├── package.json (metadata file) +├── README.md (doc file) +├── src/ (source code) +│ ├── build/ (build helpers, eg. intro, and outro) +│ ├── common/ (common function helpers across modules) +│ ├── core.js (core module) +│ ├── date/ (date source code) +│ ├── date.js (date module) +│ ├── message.js (message module) +│ ├── number.js (number module) +│ ├── number/ (number source code) +│ ├── plural.js (plural module) +│ ├── plural/ (plural source code) +│ ├── relative-time.js (relative time module) +│ ├── relative-time/ (relative time source code) +│ ├── unit.js (unit module) +│ ├── unit/ (unit source code) +│ └── util/ (basic JavaScript helpers polyfills, eg array.map) +└── test/ (unit and functional test files) + ├── fixtures/ (CLDR fixture data) + ├── functional/ (functional tests) + ├── functional.html + ├── functional.js + ├── unit/ (unit tests) + ├── unit.html + └── unit.js +``` + +### Source files + +The source files are as granular as possible. When combined to generate the +build file, all the excessive/overhead wrappers are cut off. It's following +the same build model of jQuery and Modernizr. + +Core, and all modules' public APIs are located in the `src/` directory, ie. +`core.js`, `date.js`, `message.js`, `number.js`, and `plural.js`. + +### Install development external dependencies + +Install Grunt and external dependencies. First, install the +[grunt-cli](http://gruntjs.com/getting-started#installing-the-cli) and +[bower](http://bower.io/) packages if you haven't before. These should be +installed globally (like this: `npm install -g grunt-cli bower`). Then: + +```bash +npm install && bower install +``` + +### Tests + +Tests can be run either in the browser or using Node.js (via Grunt) after having +installed the external development dependencies (for more details, see above). + +***Unit tests*** + +To run the unit tests, run `grunt test:unit`, or run `grunt connect:keepalive` +and open `http://localhost:9001/test/unit.html` in a browser. It tests the very +specific functionality of each function (sometimes internal/private). + +The goal of the unit tests is to make it easy to spot bugs, easy to debug. + +***Functional tests*** + +To run the functional tests, create the dist files by running `grunt`. Then, run +`grunt test:functional`, or open `http://localhost:9001/test/functional.html` in +a browser. Note that `grunt` will automatically run unit and functional tests +for you to ensure the built files are safe. + +The goal of the functional tests is to ensure that everything works as expected +when it is combined. + +### Build + +Build the distribution files after having installed the external development +dependencies (for more details, see above). + +```bash +grunt +``` diff --git a/StockManMVC/.bin/bower_components/globalize/bower.json b/StockManMVC/.bin/bower_components/globalize/bower.json new file mode 100644 index 0000000..49ee5d6 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/bower.json @@ -0,0 +1,23 @@ +{ + "name": "globalize", + "license": "MIT", + "ignore": [ + "**/.*", + "test", + "CONTRIBUTING.md", + "bower.json" + ], + "dependencies": { + "cldrjs": "0.4.4", + "cldr-data": ">=25" + }, + "devDependencies": { + "es5-shim": "3.4.0", + "make-plural": "eemeli/make-plural.js#3.0.0", + "messageformat": "SlexAxton/messageformat.js#v0.3.0-1", + "qunit": "1.18.0", + "requirejs": "2.1.20", + "requirejs-plugins": "1.0.2", + "requirejs-text": "2.0.10" + } +} diff --git a/StockManMVC/.bin/bower_components/globalize/browserstack.json b/StockManMVC/.bin/bower_components/globalize/browserstack.json new file mode 100644 index 0000000..cbffa87 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/browserstack.json @@ -0,0 +1,17 @@ +{ + "test_framework": "qunit", + "test_path": [ "test/unit.html", "test/functional.html" ], + "browsers": [ + "chrome_previous", + "chrome_latest", + "firefox_previous", + "firefox_latest", + "ie_9", + "ie_10", + "ie_11", + "opera_previous", + "opera_latest", + "safari_previous", + "safari_latest" + ] +} diff --git a/StockManMVC/.bin/bower_components/globalize/chore/release.sh b/StockManMVC/.bin/bower_components/globalize/chore/release.sh new file mode 100644 index 0000000..f0964a4 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/chore/release.sh @@ -0,0 +1,106 @@ +#! /bin/bash + +function assertions { + if [ -z "$1" ]; then + echo Usage: $0 "" + exit 1 + fi + + if ! git diff --quiet --exit-code; then + echo Current branch "isn't" clean. Use '`git status` for more details.' + echo Quiting... + exit 1 + fi + + if git rev-parse --verify --quiet $1 > /dev/null; then + echo 'Target tag `'$1'` already exists.' + echo Quiting... + exit 1 + fi + + if [ ! -z `git branch --list $TARGET_BRANCH` ]; then + echo 'Target branch `'$TARGET_BRANCH'` already exists.' + echo Quiting... + exit 1 + fi + + CURRENT_BRANCH=`git name-rev --name-only HEAD` + if [ :$CURRENT_BRANCH != :master ]; then + echo 'Current branch `'$CURRENT_BRANCH'`' "isn't" '`master`.' + echo Quiting... + exit 1 + fi + + echo Preparing release for '`'$1'`' + echo -n Proceed? "[Y|n] " + read input + test :$input = :N -o :$input = :n && exit 1 + + h1 Test + grunt +} + +function h1 { + echo + echo '## '$* +} + +function error { + echo 'ERROR: '$* + exit 2 +} + +function update_authors { + h1 Update AUTHORS file + grunt update-authors > /dev/null && + git commit -a -m 'AUTHORS: Update' > /dev/null && + git show --stat +} + +function update_version { + h1 Update package.json '`versions`' attribute + sed -i.orig 's/"version": "[^"]\+"/"version": "'$1'"/' package.json && + git commit -a -m $1 && + git show +} + +function build { + h1 Include distribution files + + # Yeap, again. Now including the new version in the dist files. + grunt > /dev/null || error Build failed + + git add dist/* > /dev/null && + git commit -a -m "Build: Include distribution files" > /dev/null && + git show --stat || + error Failed including distribution files +} + +function tag { + h1 'Tag `'$1'` (detached)' + git tag -a -m $1 $1 > /dev/null +} + +function checkout_back_to_master { + git checkout master > /dev/null +} + +function final_message { + h1 Done + echo + echo Now you need to: + echo git push --tags origin + echo npm publish + echo git branch -D $TARGET_BRANCH +} + +TARGET_BRANCH=b$1 + +assertions $1 && + update_authors && + update_version $1 && + git checkout -b $TARGET_BRANCH && + build && + tag $1 && + git checkout master > /dev/null && + final_message diff --git a/StockManMVC/.bin/bower_components/globalize/dist/globalize-runtime.js b/StockManMVC/.bin/bower_components/globalize/dist/globalize-runtime.js new file mode 100644 index 0000000..1d451d5 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/dist/globalize-runtime.js @@ -0,0 +1,236 @@ +/** + * Globalize Runtime v1.1.1 + * + * http://github.com/jquery/globalize + * + * Copyright jQuery Foundation and other contributors + * Released under the MIT license + * http://jquery.org/license + * + * Date: 2016-02-04T12:01Z + */ +/*! + * Globalize Runtime v1.1.1 2016-02-04T12:01Z Released under the MIT license + * http://git.io/TrdQbw + */ +(function( root, factory ) { + + // UMD returnExports + if ( typeof define === "function" && define.amd ) { + + // AMD + define( factory ); + } else if ( typeof exports === "object" ) { + + // Node, CommonJS + module.exports = factory(); + } else { + + // Globalize + root.Globalize = factory(); + } +}( this, function() { + + +/** + * A toString method that outputs meaningful values for objects or arrays and + * still performs as fast as a plain string in case variable is string, or as + * fast as `"" + number` in case variable is a number. + * Ref: http://jsperf.com/my-stringify + */ +var toString = function( variable ) { + return typeof variable === "string" ? variable : ( typeof variable === "number" ? "" + + variable : JSON.stringify( variable ) ); +}; + + + + +/** + * formatMessage( message, data ) + * + * @message [String] A message with optional {vars} to be replaced. + * + * @data [Array or JSON] Object with replacing-variables content. + * + * Return the formatted message. For example: + * + * - formatMessage( "{0} second", [ 1 ] ); // 1 second + * + * - formatMessage( "{0}/{1}", ["m", "s"] ); // m/s + * + * - formatMessage( "{name} <{email}>", { + * name: "Foo", + * email: "bar@baz.qux" + * }); // Foo + */ +var formatMessage = function( message, data ) { + + // Replace {attribute}'s + message = message.replace( /{[0-9a-zA-Z-_. ]+}/g, function( name ) { + name = name.replace( /^{([^}]*)}$/, "$1" ); + return toString( data[ name ] ); + }); + + return message; +}; + + + + +var objectExtend = function() { + var destination = arguments[ 0 ], + sources = [].slice.call( arguments, 1 ); + + sources.forEach(function( source ) { + var prop; + for ( prop in source ) { + destination[ prop ] = source[ prop ]; + } + }); + + return destination; +}; + + + + +var createError = function( code, message, attributes ) { + var error; + + message = code + ( message ? ": " + formatMessage( message, attributes ) : "" ); + error = new Error( message ); + error.code = code; + + objectExtend( error, attributes ); + + return error; +}; + + + + +// Based on http://stackoverflow.com/questions/7616461/generate-a-hash-from-string-in-javascript-jquery +var stringHash = function( str ) { + return [].reduce.call( str, function( hash, i ) { + var chr = i.charCodeAt( 0 ); + hash = ( ( hash << 5 ) - hash ) + chr; + return hash | 0; + }, 0 ); +}; + + + + +var runtimeKey = function( fnName, locale, args, argsStr ) { + var hash; + argsStr = argsStr || JSON.stringify( args ); + hash = stringHash( fnName + locale + argsStr ); + return hash > 0 ? "a" + hash : "b" + Math.abs( hash ); +}; + + + + +var validate = function( code, message, check, attributes ) { + if ( !check ) { + throw createError( code, message, attributes ); + } +}; + + + + +var validateParameterPresence = function( value, name ) { + validate( "E_MISSING_PARAMETER", "Missing required parameter `{name}`.", + value !== undefined, { name: name }); +}; + + + + +var validateParameterType = function( value, name, check, expected ) { + validate( + "E_INVALID_PAR_TYPE", + "Invalid `{name}` parameter ({value}). {expected} expected.", + check, + { + expected: expected, + name: name, + value: value + } + ); +}; + + + + +var validateParameterTypeString = function( value, name ) { + validateParameterType( + value, + name, + value === undefined || typeof value === "string", + "a string" + ); +}; + + + + +// ref: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions?redirectlocale=en-US&redirectslug=JavaScript%2FGuide%2FRegular_Expressions +var regexpEscape = function( string ) { + return string.replace( /([.*+?^=!:${}()|\[\]\/\\])/g, "\\$1" ); +}; + + + + +var stringPad = function( str, count, right ) { + var length; + if ( typeof str !== "string" ) { + str = String( str ); + } + for ( length = str.length; length < count; length += 1 ) { + str = ( right ? ( str + "0" ) : ( "0" + str ) ); + } + return str; +}; + + + + +function Globalize( locale ) { + if ( !( this instanceof Globalize ) ) { + return new Globalize( locale ); + } + + validateParameterPresence( locale, "locale" ); + validateParameterTypeString( locale, "locale" ); + + this._locale = locale; +} + +Globalize.locale = function( locale ) { + validateParameterTypeString( locale, "locale" ); + + if ( arguments.length ) { + this._locale = locale; + } + return this._locale; +}; + +Globalize._createError = createError; +Globalize._formatMessage = formatMessage; +Globalize._regexpEscape = regexpEscape; +Globalize._runtimeKey = runtimeKey; +Globalize._stringPad = stringPad; +Globalize._validateParameterPresence = validateParameterPresence; +Globalize._validateParameterTypeString = validateParameterTypeString; +Globalize._validateParameterType = validateParameterType; + +return Globalize; + + + + +})); diff --git a/StockManMVC/.bin/bower_components/globalize/dist/globalize-runtime/currency.js b/StockManMVC/.bin/bower_components/globalize/dist/globalize-runtime/currency.js new file mode 100644 index 0000000..b5c61ca --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/dist/globalize-runtime/currency.js @@ -0,0 +1,119 @@ +/** + * Globalize Runtime v1.1.1 + * + * http://github.com/jquery/globalize + * + * Copyright jQuery Foundation and other contributors + * Released under the MIT license + * http://jquery.org/license + * + * Date: 2016-02-04T12:01Z + */ +/*! + * Globalize Runtime v1.1.1 2016-02-04T12:01Z Released under the MIT license + * http://git.io/TrdQbw + */ +(function( root, factory ) { + + // UMD returnExports + if ( typeof define === "function" && define.amd ) { + + // AMD + define([ + "../globalize-runtime", + "./number" + ], factory ); + } else if ( typeof exports === "object" ) { + + // Node, CommonJS + module.exports = factory( + require( "../globalize-runtime" ), + require( "./number" ) + ); + } else { + + // Extend global + factory( root.Globalize ); + } +}(this, function( Globalize ) { + +var formatMessage = Globalize._formatMessage, + runtimeKey = Globalize._runtimeKey, + validateParameterPresence = Globalize._validateParameterPresence, + validateParameterTypeNumber = Globalize._validateParameterTypeNumber; + + +/** + * nameFormat( formattedNumber, pluralForm, properties ) + * + * Return the appropriate name form currency format. + */ +var currencyNameFormat = function( formattedNumber, pluralForm, properties ) { + var displayName, unitPattern, + displayNames = properties.displayNames || {}, + unitPatterns = properties.unitPatterns; + + displayName = displayNames[ "displayName-count-" + pluralForm ] || + displayNames[ "displayName-count-other" ] || + displayNames.displayName || + properties.currency; + unitPattern = unitPatterns[ "unitPattern-count-" + pluralForm ] || + unitPatterns[ "unitPattern-count-other" ]; + + return formatMessage( unitPattern, [ formattedNumber, displayName ]); +}; + + + + +var currencyFormatterFn = function( numberFormatter, pluralGenerator, properties ) { + var fn; + + // Return formatter when style is "code" or "name". + if ( pluralGenerator && properties ) { + fn = function currencyFormatter( value ) { + validateParameterPresence( value, "value" ); + validateParameterTypeNumber( value, "value" ); + return currencyNameFormat( + numberFormatter( value ), + pluralGenerator( value ), + properties + ); + }; + + // Return formatter when style is "symbol" or "accounting". + } else { + fn = function currencyFormatter( value ) { + return numberFormatter( value ); + }; + } + + return fn; +}; + + + + +Globalize._currencyFormatterFn = currencyFormatterFn; +Globalize._currencyNameFormat = currencyNameFormat; + +Globalize.currencyFormatter = +Globalize.prototype.currencyFormatter = function( currency, options ) { + options = options || {}; + return Globalize[ runtimeKey( "currencyFormatter", this._locale, [ currency, options ] ) ]; +}; + +Globalize.formatCurrency = +Globalize.prototype.formatCurrency = function( value, currency, options ) { + validateParameterPresence( value, "value" ); + validateParameterTypeNumber( value, "value" ); + + return this.currencyFormatter( currency, options )( value ); +}; + +return Globalize; + + + + +})); diff --git a/StockManMVC/.bin/bower_components/globalize/dist/globalize-runtime/date.js b/StockManMVC/.bin/bower_components/globalize/dist/globalize-runtime/date.js new file mode 100644 index 0000000..528678e --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/dist/globalize-runtime/date.js @@ -0,0 +1,1300 @@ +/** + * Globalize Runtime v1.1.1 + * + * http://github.com/jquery/globalize + * + * Copyright jQuery Foundation and other contributors + * Released under the MIT license + * http://jquery.org/license + * + * Date: 2016-02-04T12:01Z + */ +/*! + * Globalize Runtime v1.1.1 2016-02-04T12:01Z Released under the MIT license + * http://git.io/TrdQbw + */ +(function( root, factory ) { + + // UMD returnExports + if ( typeof define === "function" && define.amd ) { + + // AMD + define([ + "../globalize-runtime", + "./number" + ], factory ); + } else if ( typeof exports === "object" ) { + + // Node, CommonJS + module.exports = factory( + require( "../globalize-runtime" ), + require( "./number" ) + ); + } else { + + // Extend global + factory( root.Globalize ); + } +}(this, function( Globalize ) { + +var createErrorUnsupportedFeature = Globalize._createErrorUnsupportedFeature, + regexpEscape = Globalize._regexpEscape, + runtimeKey = Globalize._runtimeKey, + stringPad = Globalize._stringPad, + validateParameterPresence = Globalize._validateParameterPresence, + validateParameterType = Globalize._validateParameterType, + validateParameterTypeString = Globalize._validateParameterTypeString; + + +var validateParameterTypeDate = function( value, name ) { + validateParameterType( value, name, value === undefined || value instanceof Date, "Date" ); +}; + + + + +/** + * dayOfWeek( date, firstDay ) + * + * @date + * + * @firstDay the result of `dateFirstDayOfWeek( cldr )` + * + * Return the day of the week normalized by the territory's firstDay [0-6]. + * Eg for "mon": + * - return 0 if territory is GB, or BR, or DE, or FR (week starts on "mon"); + * - return 1 if territory is US (week starts on "sun"); + * - return 2 if territory is EG (week starts on "sat"); + */ +var dateDayOfWeek = function( date, firstDay ) { + return ( date.getDay() - firstDay + 7 ) % 7; +}; + + + + +/** + * distanceInDays( from, to ) + * + * Return the distance in days between from and to Dates. + */ +var dateDistanceInDays = function( from, to ) { + var inDays = 864e5; + return ( to.getTime() - from.getTime() ) / inDays; +}; + + + + +/** + * startOf changes the input to the beginning of the given unit. + * + * For example, starting at the start of a day, resets hours, minutes + * seconds and milliseconds to 0. Starting at the month does the same, but + * also sets the date to 1. + * + * Returns the modified date + */ +var dateStartOf = function( date, unit ) { + date = new Date( date.getTime() ); + switch ( unit ) { + case "year": + date.setMonth( 0 ); + /* falls through */ + case "month": + date.setDate( 1 ); + /* falls through */ + case "day": + date.setHours( 0 ); + /* falls through */ + case "hour": + date.setMinutes( 0 ); + /* falls through */ + case "minute": + date.setSeconds( 0 ); + /* falls through */ + case "second": + date.setMilliseconds( 0 ); + } + return date; +}; + + + + +/** + * dayOfYear + * + * Return the distance in days of the date to the begin of the year [0-d]. + */ +var dateDayOfYear = function( date ) { + return Math.floor( dateDistanceInDays( dateStartOf( date, "year" ), date ) ); +}; + + + + +/** + * millisecondsInDay + */ +var dateMillisecondsInDay = function( date ) { + + // TODO Handle daylight savings discontinuities + return date - dateStartOf( date, "day" ); +}; + + + + +var datePatternRe = ( /([a-z])\1*|'([^']|'')+'|''|./ig ); + + + + +/** + * hourFormat( date, format, timeSeparator, formatNumber ) + * + * Return date's timezone offset according to the format passed. + * Eg for format when timezone offset is 180: + * - "+H;-H": -3 + * - "+HHmm;-HHmm": -0300 + * - "+HH:mm;-HH:mm": -03:00 + */ +var dateTimezoneHourFormat = function( date, format, timeSeparator, formatNumber ) { + var absOffset, + offset = date.getTimezoneOffset(); + + absOffset = Math.abs( offset ); + formatNumber = formatNumber || { + 1: function( value ) { + return stringPad( value, 1 ); + }, + 2: function( value ) { + return stringPad( value, 2 ); + } + }; + + return format + + // Pick the correct sign side (+ or -). + .split( ";" )[ offset > 0 ? 1 : 0 ] + + // Localize time separator + .replace( ":", timeSeparator ) + + // Update hours offset. + .replace( /HH?/, function( match ) { + return formatNumber[ match.length ]( Math.floor( absOffset / 60 ) ); + }) + + // Update minutes offset and return. + .replace( /mm/, function() { + return formatNumber[ 2 ]( absOffset % 60 ); + }); +}; + + + + +var dateWeekDays = [ "sun", "mon", "tue", "wed", "thu", "fri", "sat" ]; + + + + +/** + * format( date, properties ) + * + * @date [Date instance]. + * + * @properties + * + * TODO Support other calendar types. + * + * Disclosure: this function borrows excerpts of dojo/date/locale. + */ +var dateFormat = function( date, numberFormatters, properties ) { + var timeSeparator = properties.timeSeparator; + + return properties.pattern.replace( datePatternRe, function( current ) { + var ret, + chr = current.charAt( 0 ), + length = current.length; + + if ( chr === "j" ) { + + // Locale preferred hHKk. + // http://www.unicode.org/reports/tr35/tr35-dates.html#Time_Data + chr = properties.preferredTime; + } + + if ( chr === "Z" ) { + + // Z..ZZZ: same as "xxxx". + if ( length < 4 ) { + chr = "x"; + length = 4; + + // ZZZZ: same as "OOOO". + } else if ( length < 5 ) { + chr = "O"; + length = 4; + + // ZZZZZ: same as "XXXXX" + } else { + chr = "X"; + length = 5; + } + } + + switch ( chr ) { + + // Era + case "G": + ret = properties.eras[ date.getFullYear() < 0 ? 0 : 1 ]; + break; + + // Year + case "y": + + // Plain year. + // The length specifies the padding, but for two letters it also specifies the + // maximum length. + ret = date.getFullYear(); + if ( length === 2 ) { + ret = String( ret ); + ret = +ret.substr( ret.length - 2 ); + } + break; + + case "Y": + + // Year in "Week of Year" + // The length specifies the padding, but for two letters it also specifies the + // maximum length. + // yearInWeekofYear = date + DaysInAWeek - (dayOfWeek - firstDay) - minDays + ret = new Date( date.getTime() ); + ret.setDate( + ret.getDate() + 7 - + dateDayOfWeek( date, properties.firstDay ) - + properties.firstDay - + properties.minDays + ); + ret = ret.getFullYear(); + if ( length === 2 ) { + ret = String( ret ); + ret = +ret.substr( ret.length - 2 ); + } + break; + + // Quarter + case "Q": + case "q": + ret = Math.ceil( ( date.getMonth() + 1 ) / 3 ); + if ( length > 2 ) { + ret = properties.quarters[ chr ][ length ][ ret ]; + } + break; + + // Month + case "M": + case "L": + ret = date.getMonth() + 1; + if ( length > 2 ) { + ret = properties.months[ chr ][ length ][ ret ]; + } + break; + + // Week + case "w": + + // Week of Year. + // woy = ceil( ( doy + dow of 1/1 ) / 7 ) - minDaysStuff ? 1 : 0. + // TODO should pad on ww? Not documented, but I guess so. + ret = dateDayOfWeek( dateStartOf( date, "year" ), properties.firstDay ); + ret = Math.ceil( ( dateDayOfYear( date ) + ret ) / 7 ) - + ( 7 - ret >= properties.minDays ? 0 : 1 ); + break; + + case "W": + + // Week of Month. + // wom = ceil( ( dom + dow of `1/month` ) / 7 ) - minDaysStuff ? 1 : 0. + ret = dateDayOfWeek( dateStartOf( date, "month" ), properties.firstDay ); + ret = Math.ceil( ( date.getDate() + ret ) / 7 ) - + ( 7 - ret >= properties.minDays ? 0 : 1 ); + break; + + // Day + case "d": + ret = date.getDate(); + break; + + case "D": + ret = dateDayOfYear( date ) + 1; + break; + + case "F": + + // Day of Week in month. eg. 2nd Wed in July. + ret = Math.floor( date.getDate() / 7 ) + 1; + break; + + // Week day + case "e": + case "c": + if ( length <= 2 ) { + + // Range is [1-7] (deduced by example provided on documentation) + // TODO Should pad with zeros (not specified in the docs)? + ret = dateDayOfWeek( date, properties.firstDay ) + 1; + break; + } + + /* falls through */ + case "E": + ret = dateWeekDays[ date.getDay() ]; + ret = properties.days[ chr ][ length ][ ret ]; + break; + + // Period (AM or PM) + case "a": + ret = properties.dayPeriods[ date.getHours() < 12 ? "am" : "pm" ]; + break; + + // Hour + case "h": // 1-12 + ret = ( date.getHours() % 12 ) || 12; + break; + + case "H": // 0-23 + ret = date.getHours(); + break; + + case "K": // 0-11 + ret = date.getHours() % 12; + break; + + case "k": // 1-24 + ret = date.getHours() || 24; + break; + + // Minute + case "m": + ret = date.getMinutes(); + break; + + // Second + case "s": + ret = date.getSeconds(); + break; + + case "S": + ret = Math.round( date.getMilliseconds() * Math.pow( 10, length - 3 ) ); + break; + + case "A": + ret = Math.round( dateMillisecondsInDay( date ) * Math.pow( 10, length - 3 ) ); + break; + + // Zone + case "z": + case "O": + + // O: "{gmtFormat}+H;{gmtFormat}-H" or "{gmtZeroFormat}", eg. "GMT-8" or "GMT". + // OOOO: "{gmtFormat}{hourFormat}" or "{gmtZeroFormat}", eg. "GMT-08:00" or "GMT". + if ( date.getTimezoneOffset() === 0 ) { + ret = properties.gmtZeroFormat; + } else { + ret = dateTimezoneHourFormat( + date, + length < 4 ? "+H;-H" : properties.tzLongHourFormat, + timeSeparator, + numberFormatters + ); + ret = properties.gmtFormat.replace( /\{0\}/, ret ); + } + break; + + case "X": + + // Same as x*, except it uses "Z" for zero offset. + if ( date.getTimezoneOffset() === 0 ) { + ret = "Z"; + break; + } + + /* falls through */ + case "x": + + // x: hourFormat("+HH;-HH") + // xx or xxxx: hourFormat("+HHmm;-HHmm") + // xxx or xxxxx: hourFormat("+HH:mm;-HH:mm") + ret = length === 1 ? "+HH;-HH" : ( length % 2 ? "+HH:mm;-HH:mm" : "+HHmm;-HHmm" ); + ret = dateTimezoneHourFormat( date, ret, ":" ); + break; + + // timeSeparator + case ":": + ret = timeSeparator; + break; + + // ' literals. + case "'": + current = current.replace( /''/, "'" ); + if ( length > 2 ) { + current = current.slice( 1, -1 ); + } + ret = current; + break; + + // Anything else is considered a literal, including [ ,:/.@#], chinese, japonese, and + // arabic characters. + default: + ret = current; + } + if ( typeof ret === "number" ) { + ret = numberFormatters[ length ]( ret ); + } + return ret; + }); +}; + + + + +var dateFormatterFn = function( numberFormatters, properties ) { + return function dateFormatter( value ) { + validateParameterPresence( value, "value" ); + validateParameterTypeDate( value, "value" ); + + return dateFormat( value, numberFormatters, properties ); + }; + +}; + + + + +/** + * isLeapYear( year ) + * + * @year [Number] + * + * Returns an indication whether the specified year is a leap year. + */ +var dateIsLeapYear = function( year ) { + return new Date( year, 1, 29 ).getMonth() === 1; +}; + + + + +/** + * lastDayOfMonth( date ) + * + * @date [Date] + * + * Return the last day of the given date's month + */ +var dateLastDayOfMonth = function( date ) { + return new Date( date.getFullYear(), date.getMonth() + 1, 0 ).getDate(); +}; + + + + +/** + * Differently from native date.setDate(), this function returns a date whose + * day remains inside the month boundaries. For example: + * + * setDate( FebDate, 31 ): a "Feb 28" date. + * setDate( SepDate, 31 ): a "Sep 30" date. + */ +var dateSetDate = function( date, day ) { + var lastDay = new Date( date.getFullYear(), date.getMonth() + 1, 0 ).getDate(); + + date.setDate( day < 1 ? 1 : day < lastDay ? day : lastDay ); +}; + + + + +/** + * Differently from native date.setMonth(), this function adjusts date if + * needed, so final month is always the one set. + * + * setMonth( Jan31Date, 1 ): a "Feb 28" date. + * setDate( Jan31Date, 8 ): a "Sep 30" date. + */ +var dateSetMonth = function( date, month ) { + var originalDate = date.getDate(); + + date.setDate( 1 ); + date.setMonth( month ); + dateSetDate( date, originalDate ); +}; + + + + +var outOfRange = function( value, low, high ) { + return value < low || value > high; +}; + + + + +/** + * parse( value, tokens, properties ) + * + * @value [String] string date. + * + * @tokens [Object] tokens returned by date/tokenizer. + * + * @properties [Object] output returned by date/tokenizer-properties. + * + * ref: http://www.unicode.org/reports/tr35/tr35-dates.html#Date_Format_Patterns + */ +var dateParse = function( value, tokens, properties ) { + var amPm, day, daysOfYear, month, era, hour, hour12, timezoneOffset, valid, + YEAR = 0, + MONTH = 1, + DAY = 2, + HOUR = 3, + MINUTE = 4, + SECOND = 5, + MILLISECONDS = 6, + date = new Date(), + truncateAt = [], + units = [ "year", "month", "day", "hour", "minute", "second", "milliseconds" ]; + + if ( !tokens.length ) { + return null; + } + + valid = tokens.every(function( token ) { + var century, chr, value, length; + + if ( token.type === "literal" ) { + + // continue + return true; + } + + chr = token.type.charAt( 0 ); + length = token.type.length; + + if ( chr === "j" ) { + + // Locale preferred hHKk. + // http://www.unicode.org/reports/tr35/tr35-dates.html#Time_Data + chr = properties.preferredTimeData; + } + + switch ( chr ) { + + // Era + case "G": + truncateAt.push( YEAR ); + era = +token.value; + break; + + // Year + case "y": + value = token.value; + if ( length === 2 ) { + if ( outOfRange( value, 0, 99 ) ) { + return false; + } + + // mimic dojo/date/locale: choose century to apply, according to a sliding + // window of 80 years before and 20 years after present year. + century = Math.floor( date.getFullYear() / 100 ) * 100; + value += century; + if ( value > date.getFullYear() + 20 ) { + value -= 100; + } + } + date.setFullYear( value ); + truncateAt.push( YEAR ); + break; + + case "Y": // Year in "Week of Year" + throw createErrorUnsupportedFeature({ + feature: "year pattern `" + chr + "`" + }); + + // Quarter (skip) + case "Q": + case "q": + break; + + // Month + case "M": + case "L": + if ( length <= 2 ) { + value = token.value; + } else { + value = +token.value; + } + if ( outOfRange( value, 1, 12 ) ) { + return false; + } + + // Setting the month later so that we have the correct year and can determine + // the correct last day of February in case of leap year. + month = value; + truncateAt.push( MONTH ); + break; + + // Week (skip) + case "w": // Week of Year. + case "W": // Week of Month. + break; + + // Day + case "d": + day = token.value; + truncateAt.push( DAY ); + break; + + case "D": + daysOfYear = token.value; + truncateAt.push( DAY ); + break; + + case "F": + + // Day of Week in month. eg. 2nd Wed in July. + // Skip + break; + + // Week day + case "e": + case "c": + case "E": + + // Skip. + // value = arrayIndexOf( dateWeekDays, token.value ); + break; + + // Period (AM or PM) + case "a": + amPm = token.value; + break; + + // Hour + case "h": // 1-12 + value = token.value; + if ( outOfRange( value, 1, 12 ) ) { + return false; + } + hour = hour12 = true; + date.setHours( value === 12 ? 0 : value ); + truncateAt.push( HOUR ); + break; + + case "K": // 0-11 + value = token.value; + if ( outOfRange( value, 0, 11 ) ) { + return false; + } + hour = hour12 = true; + date.setHours( value ); + truncateAt.push( HOUR ); + break; + + case "k": // 1-24 + value = token.value; + if ( outOfRange( value, 1, 24 ) ) { + return false; + } + hour = true; + date.setHours( value === 24 ? 0 : value ); + truncateAt.push( HOUR ); + break; + + case "H": // 0-23 + value = token.value; + if ( outOfRange( value, 0, 23 ) ) { + return false; + } + hour = true; + date.setHours( value ); + truncateAt.push( HOUR ); + break; + + // Minute + case "m": + value = token.value; + if ( outOfRange( value, 0, 59 ) ) { + return false; + } + date.setMinutes( value ); + truncateAt.push( MINUTE ); + break; + + // Second + case "s": + value = token.value; + if ( outOfRange( value, 0, 59 ) ) { + return false; + } + date.setSeconds( value ); + truncateAt.push( SECOND ); + break; + + case "A": + date.setHours( 0 ); + date.setMinutes( 0 ); + date.setSeconds( 0 ); + + /* falls through */ + case "S": + value = Math.round( token.value * Math.pow( 10, 3 - length ) ); + date.setMilliseconds( value ); + truncateAt.push( MILLISECONDS ); + break; + + // Zone + case "Z": + case "z": + case "O": + case "X": + case "x": + timezoneOffset = token.value - date.getTimezoneOffset(); + break; + } + + return true; + }); + + if ( !valid ) { + return null; + } + + // 12-hour format needs AM or PM, 24-hour format doesn't, ie. return null + // if amPm && !hour12 || !amPm && hour12. + if ( hour && !( !amPm ^ hour12 ) ) { + return null; + } + + if ( era === 0 ) { + + // 1 BC = year 0 + date.setFullYear( date.getFullYear() * -1 + 1 ); + } + + if ( month !== undefined ) { + dateSetMonth( date, month - 1 ); + } + + if ( day !== undefined ) { + if ( outOfRange( day, 1, dateLastDayOfMonth( date ) ) ) { + return null; + } + date.setDate( day ); + } else if ( daysOfYear !== undefined ) { + if ( outOfRange( daysOfYear, 1, dateIsLeapYear( date.getFullYear() ) ? 366 : 365 ) ) { + return null; + } + date.setMonth( 0 ); + date.setDate( daysOfYear ); + } + + if ( hour12 && amPm === "pm" ) { + date.setHours( date.getHours() + 12 ); + } + + if ( timezoneOffset ) { + date.setMinutes( date.getMinutes() + timezoneOffset ); + } + + // Truncate date at the most precise unit defined. Eg. + // If value is "12/31", and pattern is "MM/dd": + // => new Date( , 12, 31, 0, 0, 0, 0 ); + truncateAt = Math.max.apply( null, truncateAt ); + date = dateStartOf( date, units[ truncateAt ] ); + + return date; +}; + + + + +/** + * Generated by: + * + * regenerate().add( require( "unicode-7.0.0/categories/N/symbols" ) ).toString(); + * + * https://github.com/mathiasbynens/regenerate + * https://github.com/mathiasbynens/unicode-7.0.0 + */ +var regexpN = /[0-9\xB2\xB3\xB9\xBC-\xBE\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u09F4-\u09F9\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0B72-\u0B77\u0BE6-\u0BF2\u0C66-\u0C6F\u0C78-\u0C7E\u0CE6-\u0CEF\u0D66-\u0D75\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F33\u1040-\u1049\u1090-\u1099\u1369-\u137C\u16EE-\u16F0\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1946-\u194F\u19D0-\u19DA\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\u2070\u2074-\u2079\u2080-\u2089\u2150-\u2182\u2185-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2CFD\u3007\u3021-\u3029\u3038-\u303A\u3192-\u3195\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\uA620-\uA629\uA6E6-\uA6EF\uA830-\uA835\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19]|\uD800[\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDEE1-\uDEFB\uDF20-\uDF23\uDF41\uDF4A\uDFD1-\uDFD5]|\uD801[\uDCA0-\uDCA9]|\uD802[\uDC58-\uDC5F\uDC79-\uDC7F\uDCA7-\uDCAF\uDD16-\uDD1B\uDE40-\uDE47\uDE7D\uDE7E\uDE9D-\uDE9F\uDEEB-\uDEEF\uDF58-\uDF5F\uDF78-\uDF7F\uDFA9-\uDFAF]|\uD803[\uDE60-\uDE7E]|\uD804[\uDC52-\uDC6F\uDCF0-\uDCF9\uDD36-\uDD3F\uDDD0-\uDDD9\uDDE1-\uDDF4\uDEF0-\uDEF9]|\uD805[\uDCD0-\uDCD9\uDE50-\uDE59\uDEC0-\uDEC9]|\uD806[\uDCE0-\uDCF2]|\uD809[\uDC00-\uDC6E]|\uD81A[\uDE60-\uDE69\uDF50-\uDF59\uDF5B-\uDF61]|\uD834[\uDF60-\uDF71]|\uD835[\uDFCE-\uDFFF]|\uD83A[\uDCC7-\uDCCF]|\uD83C[\uDD00-\uDD0C]/; + + + + +/** + * tokenizer( value, pattern, properties ) + * + * @value [String] string date. + * + * @properties [Object] output returned by date/tokenizer-properties. + * + * Returns an Array of tokens, eg. value "5 o'clock PM", pattern "h 'o''clock' a": + * [{ + * type: "h", + * lexeme: "5" + * }, { + * type: "literal", + * lexeme: " " + * }, { + * type: "literal", + * lexeme: "o'clock" + * }, { + * type: "literal", + * lexeme: " " + * }, { + * type: "a", + * lexeme: "PM", + * value: "pm" + * }] + * + * OBS: lexeme's are always String and may return invalid ranges depending of the token type. + * Eg. "99" for month number. + * + * Return an empty Array when not successfully parsed. + */ +var dateTokenizer = function( value, numberParser, properties ) { + var valid, + timeSeparator = properties.timeSeparator, + tokens = [], + widths = [ "abbreviated", "wide", "narrow" ]; + + valid = properties.pattern.match( datePatternRe ).every(function( current ) { + var chr, length, numeric, tokenRe, + token = {}; + + function hourFormatParse( tokenRe, numberParser ) { + var aux = value.match( tokenRe ); + numberParser = numberParser || function( value ) { + return +value; + }; + + if ( !aux ) { + return false; + } + + // hourFormat containing H only, e.g., `+H;-H` + if ( aux.length < 8 ) { + token.value = + ( aux[ 1 ] ? -numberParser( aux[ 1 ] ) : numberParser( aux[ 4 ] ) ) * 60; + + // hourFormat containing H and m, e.g., `+HHmm;-HHmm` + } else { + token.value = + ( aux[ 1 ] ? -numberParser( aux[ 1 ] ) : numberParser( aux[ 7 ] ) ) * 60 + + ( aux[ 1 ] ? -numberParser( aux[ 4 ] ) : numberParser( aux[ 10 ] ) ); + } + + return true; + } + + // Transform: + // - "+H;-H" -> /\+(\d\d?)|-(\d\d?)/ + // - "+HH;-HH" -> /\+(\d\d)|-(\d\d)/ + // - "+HHmm;-HHmm" -> /\+(\d\d)(\d\d)|-(\d\d)(\d\d)/ + // - "+HH:mm;-HH:mm" -> /\+(\d\d):(\d\d)|-(\d\d):(\d\d)/ + // + // If gmtFormat is GMT{0}, the regexp must fill {0} in each side, e.g.: + // - "+H;-H" -> /GMT\+(\d\d?)|GMT-(\d\d?)/ + function hourFormatRe( hourFormat, gmtFormat, timeSeparator ) { + var re; + + if ( !gmtFormat ) { + gmtFormat = "{0}"; + } + + re = hourFormat + .replace( "+", "\\+" ) + + // Unicode equivalent to (\\d\\d) + .replace( /HH|mm/g, "((" + regexpN.source + ")(" + regexpN.source + "))" ) + + // Unicode equivalent to (\\d\\d?) + .replace( /H|m/g, "((" + regexpN.source + ")(" + regexpN.source + ")?)" ); + + if ( timeSeparator ) { + re = re.replace( /:/g, timeSeparator ); + } + + re = re.split( ";" ).map(function( part ) { + return gmtFormat.replace( "{0}", part ); + }).join( "|" ); + + return new RegExp( re ); + } + + function oneDigitIfLengthOne() { + if ( length === 1 ) { + + // Unicode equivalent to /\d/ + numeric = true; + return tokenRe = regexpN; + } + } + + function oneOrTwoDigitsIfLengthOne() { + if ( length === 1 ) { + + // Unicode equivalent to /\d\d?/ + numeric = true; + return tokenRe = new RegExp( "(" + regexpN.source + ")(" + regexpN.source + ")?" ); + } + } + + function twoDigitsIfLengthTwo() { + if ( length === 2 ) { + + // Unicode equivalent to /\d\d/ + numeric = true; + return tokenRe = new RegExp( "(" + regexpN.source + ")(" + regexpN.source + ")" ); + } + } + + // Brute-force test every locale entry in an attempt to match the given value. + // Return the first found one (and set token accordingly), or null. + function lookup( path ) { + var i, re, + data = properties[ path.join( "/" ) ]; + + for ( i in data ) { + re = new RegExp( "^" + data[ i ] ); + if ( re.test( value ) ) { + token.value = i; + return tokenRe = new RegExp( data[ i ] ); + } + } + return null; + } + + token.type = current; + chr = current.charAt( 0 ), + length = current.length; + + if ( chr === "Z" ) { + + // Z..ZZZ: same as "xxxx". + if ( length < 4 ) { + chr = "x"; + length = 4; + + // ZZZZ: same as "OOOO". + } else if ( length < 5 ) { + chr = "O"; + length = 4; + + // ZZZZZ: same as "XXXXX" + } else { + chr = "X"; + length = 5; + } + } + + switch ( chr ) { + + // Era + case "G": + lookup([ + "gregorian/eras", + length <= 3 ? "eraAbbr" : ( length === 4 ? "eraNames" : "eraNarrow" ) + ]); + break; + + // Year + case "y": + case "Y": + numeric = true; + + // number l=1:+, l=2:{2}, l=3:{3,}, l=4:{4,}, ... + if ( length === 1 ) { + + // Unicode equivalent to /\d+/. + tokenRe = new RegExp( "(" + regexpN.source + ")+" ); + } else if ( length === 2 ) { + + // Unicode equivalent to /\d\d/ + tokenRe = new RegExp( "(" + regexpN.source + ")(" + regexpN.source + ")" ); + } else { + + // Unicode equivalent to /\d{length,}/ + tokenRe = new RegExp( "(" + regexpN.source + "){" + length + ",}" ); + } + break; + + // Quarter + case "Q": + case "q": + + // number l=1:{1}, l=2:{2}. + // lookup l=3... + oneDigitIfLengthOne() || twoDigitsIfLengthTwo() || lookup([ + "gregorian/quarters", + chr === "Q" ? "format" : "stand-alone", + widths[ length - 3 ] + ]); + break; + + // Month + case "M": + case "L": + + // number l=1:{1,2}, l=2:{2}. + // lookup l=3... + oneOrTwoDigitsIfLengthOne() || twoDigitsIfLengthTwo() || lookup([ + "gregorian/months", + chr === "M" ? "format" : "stand-alone", + widths[ length - 3 ] + ]); + break; + + // Day + case "D": + + // number {l,3}. + if ( length <= 3 ) { + + // Unicode equivalent to /\d{length,3}/ + numeric = true; + tokenRe = new RegExp( "(" + regexpN.source + "){" + length + ",3}" ); + } + break; + + case "W": + case "F": + + // number l=1:{1}. + oneDigitIfLengthOne(); + break; + + // Week day + case "e": + case "c": + + // number l=1:{1}, l=2:{2}. + // lookup for length >=3. + if ( length <= 2 ) { + oneDigitIfLengthOne() || twoDigitsIfLengthTwo(); + break; + } + + /* falls through */ + case "E": + if ( length === 6 ) { + + // Note: if short day names are not explicitly specified, abbreviated day + // names are used instead http://www.unicode.org/reports/tr35/tr35-dates.html#months_days_quarters_eras + lookup([ + "gregorian/days", + [ chr === "c" ? "stand-alone" : "format" ], + "short" + ]) || lookup([ + "gregorian/days", + [ chr === "c" ? "stand-alone" : "format" ], + "abbreviated" + ]); + } else { + lookup([ + "gregorian/days", + [ chr === "c" ? "stand-alone" : "format" ], + widths[ length < 3 ? 0 : length - 3 ] + ]); + } + break; + + // Period (AM or PM) + case "a": + lookup([ + "gregorian/dayPeriods/format/wide" + ]); + break; + + // Week, Day, Hour, Minute, or Second + case "w": + case "d": + case "h": + case "H": + case "K": + case "k": + case "j": + case "m": + case "s": + + // number l1:{1,2}, l2:{2}. + oneOrTwoDigitsIfLengthOne() || twoDigitsIfLengthTwo(); + break; + + case "S": + + // number {l}. + + // Unicode equivalent to /\d{length}/ + numeric = true; + tokenRe = new RegExp( "(" + regexpN.source + "){" + length + "}" ); + break; + + case "A": + + // number {l+5}. + + // Unicode equivalent to /\d{length+5}/ + numeric = true; + tokenRe = new RegExp( "(" + regexpN.source + "){" + ( length + 5 ) + "}" ); + break; + + // Zone + case "z": + case "O": + + // O: "{gmtFormat}+H;{gmtFormat}-H" or "{gmtZeroFormat}", eg. "GMT-8" or "GMT". + // OOOO: "{gmtFormat}{hourFormat}" or "{gmtZeroFormat}", eg. "GMT-08:00" or "GMT". + if ( value === properties[ "timeZoneNames/gmtZeroFormat" ] ) { + token.value = 0; + tokenRe = new RegExp( properties[ "timeZoneNames/gmtZeroFormat" ] ); + } else { + tokenRe = hourFormatRe( + length < 4 ? "+H;-H" : properties[ "timeZoneNames/hourFormat" ], + properties[ "timeZoneNames/gmtFormat" ], + timeSeparator + ); + if ( !hourFormatParse( tokenRe, numberParser ) ) { + return null; + } + } + break; + + case "X": + + // Same as x*, except it uses "Z" for zero offset. + if ( value === "Z" ) { + token.value = 0; + tokenRe = /Z/; + break; + } + + /* falls through */ + case "x": + + // x: hourFormat("+HH;-HH") + // xx or xxxx: hourFormat("+HHmm;-HHmm") + // xxx or xxxxx: hourFormat("+HH:mm;-HH:mm") + tokenRe = hourFormatRe( + length === 1 ? "+HH;-HH" : ( length % 2 ? "+HH:mm;-HH:mm" : "+HHmm;-HHmm" ) + ); + if ( !hourFormatParse( tokenRe ) ) { + return null; + } + break; + + case "'": + token.type = "literal"; + current = current.replace( /''/, "'" ); + if ( length > 2 ) { + current = current.slice( 1, -1 ); + } + tokenRe = new RegExp( regexpEscape( current ) ); + break; + + default: + token.type = "literal"; + tokenRe = /./; + } + + if ( !tokenRe ) { + return false; + } + + // Get lexeme and consume it. + value = value.replace( new RegExp( "^" + tokenRe.source ), function( lexeme ) { + token.lexeme = lexeme; + if ( numeric ) { + token.value = numberParser( lexeme ); + } + return ""; + }); + + if ( !token.lexeme ) { + return false; + } + + tokens.push( token ); + return true; + }); + + if ( value !== "" ) { + valid = false; + } + + return valid ? tokens : []; +}; + + + + +var dateParserFn = function( numberParser, parseProperties, tokenizerProperties ) { + return function dateParser( value ) { + var tokens; + + validateParameterPresence( value, "value" ); + validateParameterTypeString( value, "value" ); + + tokens = dateTokenizer( value, numberParser, tokenizerProperties ); + return dateParse( value, tokens, parseProperties ) || null; + }; +}; + + + + +Globalize._dateFormatterFn = dateFormatterFn; +Globalize._dateParserFn = dateParserFn; +Globalize._dateFormat = dateFormat; +Globalize._dateParser = dateParse; +Globalize._dateTokenizer = dateTokenizer; +Globalize._validateParameterTypeDate = validateParameterTypeDate; + +Globalize.dateFormatter = +Globalize.prototype.dateFormatter = function( options ) { + options = options || { skeleton: "yMd" }; + return Globalize[ runtimeKey( "dateFormatter", this._locale, [ options ] ) ]; +}; + +Globalize.dateParser = +Globalize.prototype.dateParser = function( options ) { + options = options || { skeleton: "yMd" }; + return Globalize[ runtimeKey( "dateParser", this._locale, [ options ] ) ]; +}; + +Globalize.formatDate = +Globalize.prototype.formatDate = function( value, options ) { + validateParameterPresence( value, "value" ); + validateParameterTypeDate( value, "value" ); + + return this.dateFormatter( options )( value ); +}; + +Globalize.parseDate = +Globalize.prototype.parseDate = function( value, options ) { + validateParameterPresence( value, "value" ); + validateParameterTypeString( value, "value" ); + + return this.dateParser( options )( value ); +}; + +return Globalize; + + + + +})); diff --git a/StockManMVC/.bin/bower_components/globalize/dist/globalize-runtime/message.js b/StockManMVC/.bin/bower_components/globalize/dist/globalize-runtime/message.js new file mode 100644 index 0000000..2637d11 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/dist/globalize-runtime/message.js @@ -0,0 +1,116 @@ +/** + * Globalize Runtime v1.1.1 + * + * http://github.com/jquery/globalize + * + * Copyright jQuery Foundation and other contributors + * Released under the MIT license + * http://jquery.org/license + * + * Date: 2016-02-04T12:01Z + */ +/*! + * Globalize Runtime v1.1.1 2016-02-04T12:01Z Released under the MIT license + * http://git.io/TrdQbw + */ +(function( root, factory ) { + + // UMD returnExports + if ( typeof define === "function" && define.amd ) { + + // AMD + define([ + "../globalize-runtime" + ], factory ); + } else if ( typeof exports === "object" ) { + + // Node, CommonJS + module.exports = factory( require( "../globalize-runtime" ) ); + } else { + + // Extend global + factory( root.Globalize ); + } +}(this, function( Globalize ) { + +var runtimeKey = Globalize._runtimeKey, + validateParameterType = Globalize._validateParameterType; + + +/** + * Function inspired by jQuery Core, but reduced to our use case. + */ +var isPlainObject = function( obj ) { + return obj !== null && "" + obj === "[object Object]"; +}; + + + + +var validateParameterTypeMessageVariables = function( value, name ) { + validateParameterType( + value, + name, + value === undefined || isPlainObject( value ) || Array.isArray( value ), + "Array or Plain Object" + ); +}; + + + + +var messageFormatterFn = function( formatter ) { + return function messageFormatter( variables ) { + if ( typeof variables === "number" || typeof variables === "string" ) { + variables = [].slice.call( arguments, 0 ); + } + validateParameterTypeMessageVariables( variables, "variables" ); + return formatter( variables ); + }; +}; + + + + +Globalize._messageFormatterFn = messageFormatterFn; +/* jshint ignore:start */ +Globalize._messageFormat = (function() { +var number = function (value, offset) { + if (isNaN(value)) throw new Error("'" + value + "' isn't a number."); + return value - (offset || 0); +}; +var plural = function (value, offset, lcfunc, data, isOrdinal) { + if ({}.hasOwnProperty.call(data, value)) return data[value](); + if (offset) value -= offset; + var key = lcfunc(value, isOrdinal); + if (key in data) return data[key](); + return data.other(); +}; +var select = function (value, data) { + if ({}.hasOwnProperty.call(data, value)) return data[value](); + return data.other() +}; + +return {number: number, plural: plural, select: select}; +}()); +/* jshint ignore:end */ +Globalize._validateParameterTypeMessageVariables = validateParameterTypeMessageVariables; + +Globalize.messageFormatter = +Globalize.prototype.messageFormatter = function( /* path */ ) { + return Globalize[ + runtimeKey( "messageFormatter", this._locale, [].slice.call( arguments, 0 ) ) + ]; +}; + +Globalize.formatMessage = +Globalize.prototype.formatMessage = function( path /* , variables */ ) { + return this.messageFormatter( path ).apply( {}, [].slice.call( arguments, 1 ) ); +}; + +return Globalize; + + + + +})); diff --git a/StockManMVC/.bin/bower_components/globalize/dist/globalize-runtime/number.js b/StockManMVC/.bin/bower_components/globalize/dist/globalize-runtime/number.js new file mode 100644 index 0000000..8ff668b --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/dist/globalize-runtime/number.js @@ -0,0 +1,682 @@ +/** + * Globalize Runtime v1.1.1 + * + * http://github.com/jquery/globalize + * + * Copyright jQuery Foundation and other contributors + * Released under the MIT license + * http://jquery.org/license + * + * Date: 2016-02-04T12:01Z + */ +/*! + * Globalize Runtime v1.1.1 2016-02-04T12:01Z Released under the MIT license + * http://git.io/TrdQbw + */ +(function( root, factory ) { + + // UMD returnExports + if ( typeof define === "function" && define.amd ) { + + // AMD + define([ + "../globalize-runtime" + ], factory ); + } else if ( typeof exports === "object" ) { + + // Node, CommonJS + module.exports = factory( require( "../globalize-runtime" ) ); + } else { + + // Extend global + factory( root.Globalize ); + } +}(this, function( Globalize ) { + +var createError = Globalize._createError, + regexpEscape = Globalize._regexpEscape, + runtimeKey = Globalize._runtimeKey, + stringPad = Globalize._stringPad, + validateParameterType = Globalize._validateParameterType, + validateParameterPresence = Globalize._validateParameterPresence, + validateParameterTypeString = Globalize._validateParameterTypeString; + + +var createErrorUnsupportedFeature = function( feature ) { + return createError( "E_UNSUPPORTED", "Unsupported {feature}.", { + feature: feature + }); +}; + + + + +var validateParameterTypeNumber = function( value, name ) { + validateParameterType( + value, + name, + value === undefined || typeof value === "number", + "Number" + ); +}; + + + + +/** + * goupingSeparator( number, primaryGroupingSize, secondaryGroupingSize ) + * + * @number [Number]. + * + * @primaryGroupingSize [Number] + * + * @secondaryGroupingSize [Number] + * + * Return the formatted number with group separator. + */ +var numberFormatGroupingSeparator = function( number, primaryGroupingSize, secondaryGroupingSize ) { + var index, + currentGroupingSize = primaryGroupingSize, + ret = "", + sep = ",", + switchToSecondary = secondaryGroupingSize ? true : false; + + number = String( number ).split( "." ); + index = number[ 0 ].length; + + while ( index > currentGroupingSize ) { + ret = number[ 0 ].slice( index - currentGroupingSize, index ) + + ( ret.length ? sep : "" ) + ret; + index -= currentGroupingSize; + if ( switchToSecondary ) { + currentGroupingSize = secondaryGroupingSize; + switchToSecondary = false; + } + } + + number[ 0 ] = number[ 0 ].slice( 0, index ) + ( ret.length ? sep : "" ) + ret; + return number.join( "." ); +}; + + + + +/** + * integerFractionDigits( number, minimumIntegerDigits, minimumFractionDigits, + * maximumFractionDigits, round, roundIncrement ) + * + * @number [Number] + * + * @minimumIntegerDigits [Number] + * + * @minimumFractionDigits [Number] + * + * @maximumFractionDigits [Number] + * + * @round [Function] + * + * @roundIncrement [Function] + * + * Return the formatted integer and fraction digits. + */ +var numberFormatIntegerFractionDigits = function( number, minimumIntegerDigits, minimumFractionDigits, maximumFractionDigits, round, + roundIncrement ) { + + // Fraction + if ( maximumFractionDigits ) { + + // Rounding + if ( roundIncrement ) { + number = round( number, roundIncrement ); + + // Maximum fraction digits + } else { + number = round( number, { exponent: -maximumFractionDigits } ); + } + + // Minimum fraction digits + if ( minimumFractionDigits ) { + number = String( number ).split( "." ); + number[ 1 ] = stringPad( number[ 1 ] || "", minimumFractionDigits, true ); + number = number.join( "." ); + } + } else { + number = round( number ); + } + + number = String( number ); + + // Minimum integer digits + if ( minimumIntegerDigits ) { + number = number.split( "." ); + number[ 0 ] = stringPad( number[ 0 ], minimumIntegerDigits ); + number = number.join( "." ); + } + + return number; +}; + + + + +/** + * toPrecision( number, precision, round ) + * + * @number (Number) + * + * @precision (Number) significant figures precision (not decimal precision). + * + * @round (Function) + * + * Return number.toPrecision( precision ) using the given round function. + */ +var numberToPrecision = function( number, precision, round ) { + var roundOrder; + + // Get number at two extra significant figure precision. + number = number.toPrecision( precision + 2 ); + + // Then, round it to the required significant figure precision. + roundOrder = Math.ceil( Math.log( Math.abs( number ) ) / Math.log( 10 ) ); + roundOrder -= precision; + + return round( number, { exponent: roundOrder } ); +}; + + + + +/** + * toPrecision( number, minimumSignificantDigits, maximumSignificantDigits, round ) + * + * @number [Number] + * + * @minimumSignificantDigits [Number] + * + * @maximumSignificantDigits [Number] + * + * @round [Function] + * + * Return the formatted significant digits number. + */ +var numberFormatSignificantDigits = function( number, minimumSignificantDigits, maximumSignificantDigits, round ) { + var atMinimum, atMaximum; + + // Sanity check. + if ( minimumSignificantDigits > maximumSignificantDigits ) { + maximumSignificantDigits = minimumSignificantDigits; + } + + atMinimum = numberToPrecision( number, minimumSignificantDigits, round ); + atMaximum = numberToPrecision( number, maximumSignificantDigits, round ); + + // Use atMaximum only if it has more significant digits than atMinimum. + number = +atMinimum === +atMaximum ? atMinimum : atMaximum; + + // Expand integer numbers, eg. 123e5 to 12300. + number = ( +number ).toString( 10 ); + + if ( ( /e/ ).test( number ) ) { + throw createErrorUnsupportedFeature({ + feature: "integers out of (1e21, 1e-7)" + }); + } + + // Add trailing zeros if necessary. + if ( minimumSignificantDigits - number.replace( /^0+|\./g, "" ).length > 0 ) { + number = number.split( "." ); + number[ 1 ] = stringPad( number[ 1 ] || "", minimumSignificantDigits - number[ 0 ].replace( /^0+/, "" ).length, true ); + number = number.join( "." ); + } + + return number; +}; + + + + +/** + * format( number, properties ) + * + * @number [Number]. + * + * @properties [Object] Output of number/format-properties. + * + * Return the formatted number. + * ref: http://www.unicode.org/reports/tr35/tr35-numbers.html + */ +var numberFormat = function( number, properties ) { + var infinitySymbol, maximumFractionDigits, maximumSignificantDigits, minimumFractionDigits, + minimumIntegerDigits, minimumSignificantDigits, nanSymbol, nuDigitsMap, padding, prefix, + primaryGroupingSize, pattern, ret, round, roundIncrement, secondaryGroupingSize, suffix, + symbolMap; + + padding = properties[ 1 ]; + minimumIntegerDigits = properties[ 2 ]; + minimumFractionDigits = properties[ 3 ]; + maximumFractionDigits = properties[ 4 ]; + minimumSignificantDigits = properties[ 5 ]; + maximumSignificantDigits = properties[ 6 ]; + roundIncrement = properties[ 7 ]; + primaryGroupingSize = properties[ 8 ]; + secondaryGroupingSize = properties[ 9 ]; + round = properties[ 15 ]; + infinitySymbol = properties[ 16 ]; + nanSymbol = properties[ 17 ]; + symbolMap = properties[ 18 ]; + nuDigitsMap = properties[ 19 ]; + + // NaN + if ( isNaN( number ) ) { + return nanSymbol; + } + + if ( number < 0 ) { + pattern = properties[ 12 ]; + prefix = properties[ 13 ]; + suffix = properties[ 14 ]; + } else { + pattern = properties[ 11 ]; + prefix = properties[ 0 ]; + suffix = properties[ 10 ]; + } + + // Infinity + if ( !isFinite( number ) ) { + return prefix + infinitySymbol + suffix; + } + + ret = prefix; + + // Percent + if ( pattern.indexOf( "%" ) !== -1 ) { + number *= 100; + + // Per mille + } else if ( pattern.indexOf( "\u2030" ) !== -1 ) { + number *= 1000; + } + + // Significant digit format + if ( !isNaN( minimumSignificantDigits * maximumSignificantDigits ) ) { + number = numberFormatSignificantDigits( number, minimumSignificantDigits, + maximumSignificantDigits, round ); + + // Integer and fractional format + } else { + number = numberFormatIntegerFractionDigits( number, minimumIntegerDigits, + minimumFractionDigits, maximumFractionDigits, round, roundIncrement ); + } + + // Remove the possible number minus sign + number = number.replace( /^-/, "" ); + + // Grouping separators + if ( primaryGroupingSize ) { + number = numberFormatGroupingSeparator( number, primaryGroupingSize, + secondaryGroupingSize ); + } + + ret += number; + + // Scientific notation + // TODO implement here + + // Padding/'([^']|'')+'|''|[.,\-+E%\u2030]/g + // TODO implement here + + ret += suffix; + + return ret.replace( /('([^']|'')+'|'')|./g, function( character, literal ) { + + // Literals + if ( literal ) { + literal = literal.replace( /''/, "'" ); + if ( literal.length > 2 ) { + literal = literal.slice( 1, -1 ); + } + return literal; + } + + // Symbols + character = character.replace( /[.,\-+E%\u2030]/, function( symbol ) { + return symbolMap[ symbol ]; + }); + + // Numbering system + if ( nuDigitsMap ) { + character = character.replace( /[0-9]/, function( digit ) { + return nuDigitsMap[ +digit ]; + }); + } + + return character; + }); +}; + + + + +var numberFormatterFn = function( properties ) { + return function numberFormatter( value ) { + validateParameterPresence( value, "value" ); + validateParameterTypeNumber( value, "value" ); + + return numberFormat( value, properties ); + }; +}; + + + + +/** + * EBNF representation: + * + * number_pattern_re = prefix_including_padding? + * number + * scientific_notation? + * suffix? + * + * number = integer_including_group_separator fraction_including_decimal_separator + * + * integer_including_group_separator = + * regexp([0-9,]*[0-9]+) + * + * fraction_including_decimal_separator = + * regexp((\.[0-9]+)?) + + * prefix_including_padding = non_number_stuff + * + * scientific_notation = regexp(E[+-]?[0-9]+) + * + * suffix = non_number_stuff + * + * non_number_stuff = regexp([^0-9]*) + * + * + * Regexp groups: + * + * 0: number_pattern_re + * 1: prefix + * 2: integer_including_group_separator fraction_including_decimal_separator + * 3: integer_including_group_separator + * 4: fraction_including_decimal_separator + * 5: scientific_notation + * 6: suffix + */ +var numberNumberRe = ( /^([^0-9]*)(([0-9,]*[0-9]+)(\.[0-9]+)?)(E[+-]?[0-9]+)?([^0-9]*)$/ ); + + + + +/** + * parse( value, properties ) + * + * @value [String]. + * + * @properties [Object] Parser properties is a reduced pre-processed cldr + * data set returned by numberParserProperties(). + * + * Return the parsed Number (including Infinity) or NaN when value is invalid. + * ref: http://www.unicode.org/reports/tr35/tr35-numbers.html + */ +var numberParse = function( value, properties ) { + var aux, infinitySymbol, invertedNuDigitsMap, invertedSymbolMap, localizedDigitRe, + localizedSymbolsRe, negativePrefix, negativeSuffix, number, prefix, suffix; + + infinitySymbol = properties[ 0 ]; + invertedSymbolMap = properties[ 1 ]; + negativePrefix = properties[ 2 ]; + negativeSuffix = properties[ 3 ]; + invertedNuDigitsMap = properties[ 4 ]; + + // Infinite number. + if ( aux = value.match( infinitySymbol ) ) { + + number = Infinity; + prefix = value.slice( 0, aux.length ); + suffix = value.slice( aux.length + 1 ); + + // Finite number. + } else { + + // TODO: Create it during setup, i.e., make it a property. + localizedSymbolsRe = new RegExp( + Object.keys( invertedSymbolMap ).map(function( localizedSymbol ) { + return regexpEscape( localizedSymbol ); + }).join( "|" ), + "g" + ); + + // Reverse localized symbols. + value = value.replace( localizedSymbolsRe, function( localizedSymbol ) { + return invertedSymbolMap[ localizedSymbol ]; + }); + + // Reverse localized numbering system. + if ( invertedNuDigitsMap ) { + + // TODO: Create it during setup, i.e., make it a property. + localizedDigitRe = new RegExp( + Object.keys( invertedNuDigitsMap ).map(function( localizedDigit ) { + return regexpEscape( localizedDigit ); + }).join( "|" ), + "g" + ); + value = value.replace( localizedDigitRe, function( localizedDigit ) { + return invertedNuDigitsMap[ localizedDigit ]; + }); + } + + // Add padding zero to leading decimal. + if ( value.charAt( 0 ) === "." ) { + value = "0" + value; + } + + // Is it a valid number? + value = value.match( numberNumberRe ); + if ( !value ) { + + // Invalid number. + return NaN; + } + + prefix = value[ 1 ]; + suffix = value[ 6 ]; + + // Remove grouping separators. + number = value[ 2 ].replace( /,/g, "" ); + + // Scientific notation + if ( value[ 5 ] ) { + number += value[ 5 ]; + } + + number = +number; + + // Is it a valid number? + if ( isNaN( number ) ) { + + // Invalid number. + return NaN; + } + + // Percent + if ( value[ 0 ].indexOf( "%" ) !== -1 ) { + number /= 100; + suffix = suffix.replace( "%", "" ); + + // Per mille + } else if ( value[ 0 ].indexOf( "\u2030" ) !== -1 ) { + number /= 1000; + suffix = suffix.replace( "\u2030", "" ); + } + } + + // Negative number + // "If there is an explicit negative subpattern, it serves only to specify the negative prefix + // and suffix. If there is no explicit negative subpattern, the negative subpattern is the + // localized minus sign prefixed to the positive subpattern" UTS#35 + if ( prefix === negativePrefix && suffix === negativeSuffix ) { + number *= -1; + } + + return number; +}; + + + + +var numberParserFn = function( properties ) { + return function numberParser( value ) { + validateParameterPresence( value, "value" ); + validateParameterTypeString( value, "value" ); + + return numberParse( value, properties ); + }; + +}; + + + + +var numberTruncate = function( value ) { + if ( isNaN( value ) ) { + return NaN; + } + return Math[ value < 0 ? "ceil" : "floor" ]( value ); +}; + + + + +/** + * round( method ) + * + * @method [String] with either "round", "ceil", "floor", or "truncate". + * + * Return function( value, incrementOrExp ): + * + * @value [Number] eg. 123.45. + * + * @incrementOrExp [Number] optional, eg. 0.1; or + * [Object] Either { increment: } or { exponent: } + * + * Return the rounded number, eg: + * - round( "round" )( 123.45 ): 123; + * - round( "ceil" )( 123.45 ): 124; + * - round( "floor" )( 123.45 ): 123; + * - round( "truncate" )( 123.45 ): 123; + * - round( "round" )( 123.45, 0.1 ): 123.5; + * - round( "round" )( 123.45, 10 ): 120; + * + * Based on https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/round + * Ref: #376 + */ +var numberRound = function( method ) { + method = method || "round"; + method = method === "truncate" ? numberTruncate : Math[ method ]; + + return function( value, incrementOrExp ) { + var exp, increment; + + value = +value; + + // If the value is not a number, return NaN. + if ( isNaN( value ) ) { + return NaN; + } + + // Exponent given. + if ( typeof incrementOrExp === "object" && incrementOrExp.exponent ) { + exp = +incrementOrExp.exponent; + increment = 1; + + if ( exp === 0 ) { + return method( value ); + } + + // If the exp is not an integer, return NaN. + if ( !( typeof exp === "number" && exp % 1 === 0 ) ) { + return NaN; + } + + // Increment given. + } else { + increment = +incrementOrExp || 1; + + if ( increment === 1 ) { + return method( value ); + } + + // If the increment is not a number, return NaN. + if ( isNaN( increment ) ) { + return NaN; + } + + increment = increment.toExponential().split( "e" ); + exp = +increment[ 1 ]; + increment = +increment[ 0 ]; + } + + // Shift & Round + value = value.toString().split( "e" ); + value[ 0 ] = +value[ 0 ] / increment; + value[ 1 ] = value[ 1 ] ? ( +value[ 1 ] - exp ) : -exp; + value = method( +( value[ 0 ] + "e" + value[ 1 ] ) ); + + // Shift back + value = value.toString().split( "e" ); + value[ 0 ] = +value[ 0 ] * increment; + value[ 1 ] = value[ 1 ] ? ( +value[ 1 ] + exp ) : exp; + return +( value[ 0 ] + "e" + value[ 1 ] ); + }; +}; + + + + +Globalize._createErrorUnsupportedFeature = createErrorUnsupportedFeature; +Globalize._numberFormat = numberFormat; +Globalize._numberFormatterFn = numberFormatterFn; +Globalize._numberParse = numberParse; +Globalize._numberParserFn = numberParserFn; +Globalize._numberRound = numberRound; +Globalize._validateParameterPresence = validateParameterPresence; +Globalize._validateParameterTypeNumber = validateParameterTypeNumber; +Globalize._validateParameterTypeString = validateParameterTypeString; + +Globalize.numberFormatter = +Globalize.prototype.numberFormatter = function( options ) { + options = options || {}; + return Globalize[ runtimeKey( "numberFormatter", this._locale, [ options ] ) ]; +}; + +Globalize.numberParser = +Globalize.prototype.numberParser = function( options ) { + options = options || {}; + return Globalize[ runtimeKey( "numberParser", this._locale, [ options ] ) ]; +}; + +Globalize.formatNumber = +Globalize.prototype.formatNumber = function( value, options ) { + validateParameterPresence( value, "value" ); + validateParameterTypeNumber( value, "value" ); + + return this.numberFormatter( options )( value ); +}; + +Globalize.parseNumber = +Globalize.prototype.parseNumber = function( value, options ) { + validateParameterPresence( value, "value" ); + validateParameterTypeString( value, "value" ); + + return this.numberParser( options )( value ); +}; + +return Globalize; + + + + +})); diff --git a/StockManMVC/.bin/bower_components/globalize/dist/globalize-runtime/plural.js b/StockManMVC/.bin/bower_components/globalize/dist/globalize-runtime/plural.js new file mode 100644 index 0000000..146142a --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/dist/globalize-runtime/plural.js @@ -0,0 +1,86 @@ +/** + * Globalize Runtime v1.1.1 + * + * http://github.com/jquery/globalize + * + * Copyright jQuery Foundation and other contributors + * Released under the MIT license + * http://jquery.org/license + * + * Date: 2016-02-04T12:01Z + */ +/*! + * Globalize Runtime v1.1.1 2016-02-04T12:01Z Released under the MIT license + * http://git.io/TrdQbw + */ +(function( root, factory ) { + + // UMD returnExports + if ( typeof define === "function" && define.amd ) { + + // AMD + define([ + "../globalize-runtime" + ], factory ); + } else if ( typeof exports === "object" ) { + + // Node, CommonJS + module.exports = factory( require( "../globalize-runtime" ) ); + } else { + + // Extend global + factory( root.Globalize ); + } +}(this, function( Globalize ) { + +var runtimeKey = Globalize._runtimeKey, + validateParameterPresence = Globalize._validateParameterPresence, + validateParameterType = Globalize._validateParameterType; + + +var validateParameterTypeNumber = function( value, name ) { + validateParameterType( + value, + name, + value === undefined || typeof value === "number", + "Number" + ); +}; + + + + +var pluralGeneratorFn = function( plural ) { + return function pluralGenerator( value ) { + validateParameterPresence( value, "value" ); + validateParameterTypeNumber( value, "value" ); + + return plural( value ); + }; +}; + + + + +Globalize._pluralGeneratorFn = pluralGeneratorFn; +Globalize._validateParameterTypeNumber = validateParameterTypeNumber; + +Globalize.plural = +Globalize.prototype.plural = function( value, options ) { + validateParameterPresence( value, "value" ); + validateParameterTypeNumber( value, "value" ); + return this.pluralGenerator( options )( value ); +}; + +Globalize.pluralGenerator = +Globalize.prototype.pluralGenerator = function( options ) { + options = options || {}; + return Globalize[ runtimeKey( "pluralGenerator", this._locale, [ options ] ) ]; +}; + +return Globalize; + + + + +})); diff --git a/StockManMVC/.bin/bower_components/globalize/dist/globalize-runtime/relative-time.js b/StockManMVC/.bin/bower_components/globalize/dist/globalize-runtime/relative-time.js new file mode 100644 index 0000000..41e6ec5 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/dist/globalize-runtime/relative-time.js @@ -0,0 +1,116 @@ +/** + * Globalize Runtime v1.1.1 + * + * http://github.com/jquery/globalize + * + * Copyright jQuery Foundation and other contributors + * Released under the MIT license + * http://jquery.org/license + * + * Date: 2016-02-04T12:01Z + */ +/*! + * Globalize Runtime v1.1.1 2016-02-04T12:01Z Released under the MIT license + * http://git.io/TrdQbw + */ +(function( root, factory ) { + + // UMD returnExports + if ( typeof define === "function" && define.amd ) { + + // AMD + define([ + "../globalize-runtime", + "./number", + "./plural" + ], factory ); + } else if ( typeof exports === "object" ) { + + // Node, CommonJS + module.exports = factory( + require( "../globalize-runtime" ), + require( "./number" ), + require( "./plural" ) + ); + } else { + + // Extend global + factory( root.Globalize ); + } +}(this, function( Globalize ) { + +var formatMessage = Globalize._formatMessage, + runtimeKey = Globalize._runtimeKey, + validateParameterPresence = Globalize._validateParameterPresence, + validateParameterTypeNumber = Globalize._validateParameterTypeNumber; + + +/** + * format( value, numberFormatter, pluralGenerator, properties ) + * + * @value [Number] The number to format + * + * @numberFormatter [String] A numberFormatter from Globalize.numberFormatter + * + * @pluralGenerator [String] A pluralGenerator from Globalize.pluralGenerator + * + * @properties [Object] containing relative time plural message. + * + * Format relative time. + */ +var relativeTimeFormat = function( value, numberFormatter, pluralGenerator, properties ) { + + var relativeTime, + message = properties[ "relative-type-" + value ]; + + if ( message ) { + return message; + } + + relativeTime = value <= 0 ? properties[ "relativeTime-type-past" ] + : properties[ "relativeTime-type-future" ]; + + value = Math.abs( value ); + + message = relativeTime[ "relativeTimePattern-count-" + pluralGenerator( value ) ]; + return formatMessage( message, [ numberFormatter( value ) ] ); +}; + + + + +var relativeTimeFormatterFn = function( numberFormatter, pluralGenerator, properties ) { + return function relativeTimeFormatter( value ) { + validateParameterPresence( value, "value" ); + validateParameterTypeNumber( value, "value" ); + + return relativeTimeFormat( value, numberFormatter, pluralGenerator, properties ); + }; + +}; + + + + +Globalize._relativeTimeFormatterFn = relativeTimeFormatterFn; + +Globalize.formatRelativeTime = +Globalize.prototype.formatRelativeTime = function( value, unit, options ) { + validateParameterPresence( value, "value" ); + validateParameterTypeNumber( value, "value" ); + + return this.relativeTimeFormatter( unit, options )( value ); +}; + +Globalize.relativeTimeFormatter = +Globalize.prototype.relativeTimeFormatter = function( unit, options ) { + options = options || {}; + return Globalize[ runtimeKey( "relativeTimeFormatter", this._locale, [ unit, options ] ) ]; +}; + +return Globalize; + + + + +})); diff --git a/StockManMVC/.bin/bower_components/globalize/dist/globalize-runtime/unit.js b/StockManMVC/.bin/bower_components/globalize/dist/globalize-runtime/unit.js new file mode 100644 index 0000000..5b5f3e9 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/dist/globalize-runtime/unit.js @@ -0,0 +1,127 @@ +/** + * Globalize Runtime v1.1.1 + * + * http://github.com/jquery/globalize + * + * Copyright jQuery Foundation and other contributors + * Released under the MIT license + * http://jquery.org/license + * + * Date: 2016-02-04T12:01Z + */ +/*! + * Globalize Runtime v1.1.1 2016-02-04T12:01Z Released under the MIT license + * http://git.io/TrdQbw + */ +(function( root, factory ) { + + // UMD returnExports + if ( typeof define === "function" && define.amd ) { + + // AMD + define([ + "../globalize-runtime", + "./number", + "./plural" + ], factory ); + } else if ( typeof exports === "object" ) { + + // Node, CommonJS + module.exports = factory( + require( "../globalize-runtime" ), + require( "./number" ), + require( "./plural" ) + ); + } else { + + // Extend global + factory( root.Globalize ); + } +}(this, function( Globalize ) { + +var formatMessage = Globalize._formatMessage, + runtimeKey = Globalize._runtimeKey, + validateParameterPresence = Globalize._validateParameterPresence, + validateParameterTypeNumber = Globalize._validateParameterTypeNumber; + + +/** + * format( value, numberFormatter, pluralGenerator, unitProperies ) + * + * @value [Number] + * + * @numberFormatter [Object]: A numberFormatter from Globalize.numberFormatter. + * + * @pluralGenerator [Object]: A pluralGenerator from Globalize.pluralGenerator. + * + * @unitProperies [Object]: localized unit data from cldr. + * + * Format units such as seconds, minutes, days, weeks, etc. + * + * OBS: + * + * Unit Sequences are not implemented. + * http://www.unicode.org/reports/tr35/tr35-35/tr35-general.html#Unit_Sequences + * + * Duration Unit (for composed time unit durations) is not implemented. + * http://www.unicode.org/reports/tr35/tr35-35/tr35-general.html#durationUnit + */ +var unitFormat = function( value, numberFormatter, pluralGenerator, unitProperties ) { + var compoundUnitPattern = unitProperties.compoundUnitPattern, dividend, dividendProperties, + formattedValue, divisor, divisorProperties, message, pluralValue; + + unitProperties = unitProperties.unitProperties; + formattedValue = numberFormatter( value ); + pluralValue = pluralGenerator( value ); + + // computed compound unit, eg. "megabyte-per-second". + if ( unitProperties instanceof Array ) { + dividendProperties = unitProperties[ 0 ]; + divisorProperties = unitProperties[ 1 ]; + + dividend = formatMessage( dividendProperties[ pluralValue ], [ value ] ); + divisor = formatMessage( divisorProperties.one, [ "" ] ).trim(); + + return formatMessage( compoundUnitPattern, [ dividend, divisor ] ); + } + + message = unitProperties[ pluralValue ]; + + return formatMessage( message, [ formattedValue ] ); +}; + + + + +var unitFormatterFn = function( numberFormatter, pluralGenerator, unitProperties ) { + return function unitFormatter( value ) { + validateParameterPresence( value, "value" ); + validateParameterTypeNumber( value, "value" ); + + return unitFormat( value, numberFormatter, pluralGenerator, unitProperties ); + }; + +}; + + + + +Globalize._unitFormatterFn = unitFormatterFn; + +Globalize.formatUnit = +Globalize.prototype.formatUnit = function( value, unit, options ) { + return this.unitFormatter( unit, options )( value ); +}; + +Globalize.unitFormatter = +Globalize.prototype.unitFormatter = function( unit, options ) { + options = options || {}; + return Globalize[ runtimeKey( "unitFormatter", this._locale, [ unit, options ] ) ]; +}; + +return Globalize; + + + + +})); diff --git a/StockManMVC/.bin/bower_components/globalize/dist/globalize.js b/StockManMVC/.bin/bower_components/globalize/dist/globalize.js new file mode 100644 index 0000000..1426c4f --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/dist/globalize.js @@ -0,0 +1,421 @@ +/** + * Globalize v1.1.1 + * + * http://github.com/jquery/globalize + * + * Copyright jQuery Foundation and other contributors + * Released under the MIT license + * http://jquery.org/license + * + * Date: 2016-02-04T12:01Z + */ +/*! + * Globalize v1.1.1 2016-02-04T12:01Z Released under the MIT license + * http://git.io/TrdQbw + */ +(function( root, factory ) { + + // UMD returnExports + if ( typeof define === "function" && define.amd ) { + + // AMD + define([ + "cldr", + "cldr/event" + ], factory ); + } else if ( typeof exports === "object" ) { + + // Node, CommonJS + module.exports = factory( require( "cldrjs" ) ); + } else { + + // Global + root.Globalize = factory( root.Cldr ); + } +}( this, function( Cldr ) { + + +/** + * A toString method that outputs meaningful values for objects or arrays and + * still performs as fast as a plain string in case variable is string, or as + * fast as `"" + number` in case variable is a number. + * Ref: http://jsperf.com/my-stringify + */ +var toString = function( variable ) { + return typeof variable === "string" ? variable : ( typeof variable === "number" ? "" + + variable : JSON.stringify( variable ) ); +}; + + + + +/** + * formatMessage( message, data ) + * + * @message [String] A message with optional {vars} to be replaced. + * + * @data [Array or JSON] Object with replacing-variables content. + * + * Return the formatted message. For example: + * + * - formatMessage( "{0} second", [ 1 ] ); // 1 second + * + * - formatMessage( "{0}/{1}", ["m", "s"] ); // m/s + * + * - formatMessage( "{name} <{email}>", { + * name: "Foo", + * email: "bar@baz.qux" + * }); // Foo + */ +var formatMessage = function( message, data ) { + + // Replace {attribute}'s + message = message.replace( /{[0-9a-zA-Z-_. ]+}/g, function( name ) { + name = name.replace( /^{([^}]*)}$/, "$1" ); + return toString( data[ name ] ); + }); + + return message; +}; + + + + +var objectExtend = function() { + var destination = arguments[ 0 ], + sources = [].slice.call( arguments, 1 ); + + sources.forEach(function( source ) { + var prop; + for ( prop in source ) { + destination[ prop ] = source[ prop ]; + } + }); + + return destination; +}; + + + + +var createError = function( code, message, attributes ) { + var error; + + message = code + ( message ? ": " + formatMessage( message, attributes ) : "" ); + error = new Error( message ); + error.code = code; + + objectExtend( error, attributes ); + + return error; +}; + + + + +// Based on http://stackoverflow.com/questions/7616461/generate-a-hash-from-string-in-javascript-jquery +var stringHash = function( str ) { + return [].reduce.call( str, function( hash, i ) { + var chr = i.charCodeAt( 0 ); + hash = ( ( hash << 5 ) - hash ) + chr; + return hash | 0; + }, 0 ); +}; + + + + +var runtimeKey = function( fnName, locale, args, argsStr ) { + var hash; + argsStr = argsStr || JSON.stringify( args ); + hash = stringHash( fnName + locale + argsStr ); + return hash > 0 ? "a" + hash : "b" + Math.abs( hash ); +}; + + + + +var functionName = function( fn ) { + if ( fn.name !== undefined ) { + return fn.name; + } + + // fn.name is not supported by IE. + var matches = /^function\s+([\w\$]+)\s*\(/.exec( fn.toString() ); + + if ( matches && matches.length > 0 ) { + return matches[ 1 ]; + } +}; + + + + +var runtimeBind = function( args, cldr, fn, runtimeArgs ) { + + var argsStr = JSON.stringify( args ), + fnName = functionName( fn ), + locale = cldr.locale; + + // If name of the function is not available, this is most likely due uglification, + // which most likely means we are in production, and runtimeBind here is not necessary. + if ( !fnName ) { + return fn; + } + + fn.runtimeKey = runtimeKey( fnName, locale, null, argsStr ); + + fn.generatorString = function() { + return "Globalize(\"" + locale + "\")." + fnName + "(" + argsStr.slice( 1, -1 ) + ")"; + }; + + fn.runtimeArgs = runtimeArgs; + + return fn; +}; + + + + +var validate = function( code, message, check, attributes ) { + if ( !check ) { + throw createError( code, message, attributes ); + } +}; + + + + +var alwaysArray = function( stringOrArray ) { + return Array.isArray( stringOrArray ) ? stringOrArray : stringOrArray ? [ stringOrArray ] : []; +}; + + + + +var validateCldr = function( path, value, options ) { + var skipBoolean; + options = options || {}; + + skipBoolean = alwaysArray( options.skip ).some(function( pathRe ) { + return pathRe.test( path ); + }); + + validate( "E_MISSING_CLDR", "Missing required CLDR content `{path}`.", value || skipBoolean, { + path: path + }); +}; + + + + +var validateDefaultLocale = function( value ) { + validate( "E_DEFAULT_LOCALE_NOT_DEFINED", "Default locale has not been defined.", + value !== undefined, {} ); +}; + + + + +var validateParameterPresence = function( value, name ) { + validate( "E_MISSING_PARAMETER", "Missing required parameter `{name}`.", + value !== undefined, { name: name }); +}; + + + + +/** + * range( value, name, minimum, maximum ) + * + * @value [Number]. + * + * @name [String] name of variable. + * + * @minimum [Number]. The lowest valid value, inclusive. + * + * @maximum [Number]. The greatest valid value, inclusive. + */ +var validateParameterRange = function( value, name, minimum, maximum ) { + validate( + "E_PAR_OUT_OF_RANGE", + "Parameter `{name}` has value `{value}` out of range [{minimum}, {maximum}].", + value === undefined || value >= minimum && value <= maximum, + { + maximum: maximum, + minimum: minimum, + name: name, + value: value + } + ); +}; + + + + +var validateParameterType = function( value, name, check, expected ) { + validate( + "E_INVALID_PAR_TYPE", + "Invalid `{name}` parameter ({value}). {expected} expected.", + check, + { + expected: expected, + name: name, + value: value + } + ); +}; + + + + +var validateParameterTypeLocale = function( value, name ) { + validateParameterType( + value, + name, + value === undefined || typeof value === "string" || value instanceof Cldr, + "String or Cldr instance" + ); +}; + + + + +/** + * Function inspired by jQuery Core, but reduced to our use case. + */ +var isPlainObject = function( obj ) { + return obj !== null && "" + obj === "[object Object]"; +}; + + + + +var validateParameterTypePlainObject = function( value, name ) { + validateParameterType( + value, + name, + value === undefined || isPlainObject( value ), + "Plain Object" + ); +}; + + + + +var alwaysCldr = function( localeOrCldr ) { + return localeOrCldr instanceof Cldr ? localeOrCldr : new Cldr( localeOrCldr ); +}; + + + + +// ref: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions?redirectlocale=en-US&redirectslug=JavaScript%2FGuide%2FRegular_Expressions +var regexpEscape = function( string ) { + return string.replace( /([.*+?^=!:${}()|\[\]\/\\])/g, "\\$1" ); +}; + + + + +var stringPad = function( str, count, right ) { + var length; + if ( typeof str !== "string" ) { + str = String( str ); + } + for ( length = str.length; length < count; length += 1 ) { + str = ( right ? ( str + "0" ) : ( "0" + str ) ); + } + return str; +}; + + + + +function validateLikelySubtags( cldr ) { + cldr.once( "get", validateCldr ); + cldr.get( "supplemental/likelySubtags" ); +} + +/** + * [new] Globalize( locale|cldr ) + * + * @locale [String] + * + * @cldr [Cldr instance] + * + * Create a Globalize instance. + */ +function Globalize( locale ) { + if ( !( this instanceof Globalize ) ) { + return new Globalize( locale ); + } + + validateParameterPresence( locale, "locale" ); + validateParameterTypeLocale( locale, "locale" ); + + this.cldr = alwaysCldr( locale ); + + validateLikelySubtags( this.cldr ); +} + +/** + * Globalize.load( json, ... ) + * + * @json [JSON] + * + * Load resolved or unresolved cldr data. + * Somewhat equivalent to previous Globalize.addCultureInfo(...). + */ +Globalize.load = function() { + + // validations are delegated to Cldr.load(). + Cldr.load.apply( Cldr, arguments ); +}; + +/** + * Globalize.locale( [locale|cldr] ) + * + * @locale [String] + * + * @cldr [Cldr instance] + * + * Set default Cldr instance if locale or cldr argument is passed. + * + * Return the default Cldr instance. + */ +Globalize.locale = function( locale ) { + validateParameterTypeLocale( locale, "locale" ); + + if ( arguments.length ) { + this.cldr = alwaysCldr( locale ); + validateLikelySubtags( this.cldr ); + } + return this.cldr; +}; + +/** + * Optimization to avoid duplicating some internal functions across modules. + */ +Globalize._alwaysArray = alwaysArray; +Globalize._createError = createError; +Globalize._formatMessage = formatMessage; +Globalize._isPlainObject = isPlainObject; +Globalize._objectExtend = objectExtend; +Globalize._regexpEscape = regexpEscape; +Globalize._runtimeBind = runtimeBind; +Globalize._stringPad = stringPad; +Globalize._validate = validate; +Globalize._validateCldr = validateCldr; +Globalize._validateDefaultLocale = validateDefaultLocale; +Globalize._validateParameterPresence = validateParameterPresence; +Globalize._validateParameterRange = validateParameterRange; +Globalize._validateParameterTypePlainObject = validateParameterTypePlainObject; +Globalize._validateParameterType = validateParameterType; + +return Globalize; + + + + +})); diff --git a/StockManMVC/.bin/bower_components/globalize/dist/globalize/currency.js b/StockManMVC/.bin/bower_components/globalize/dist/globalize/currency.js new file mode 100644 index 0000000..8b68100 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/dist/globalize/currency.js @@ -0,0 +1,439 @@ +/*! + * Globalize v1.1.1 + * + * http://github.com/jquery/globalize + * + * Copyright jQuery Foundation and other contributors + * Released under the MIT license + * http://jquery.org/license + * + * Date: 2016-02-04T12:01Z + */ +(function( root, factory ) { + + // UMD returnExports + if ( typeof define === "function" && define.amd ) { + + // AMD + define([ + "cldr", + "../globalize", + "./number", + "cldr/event", + "cldr/supplemental" + ], factory ); + } else if ( typeof exports === "object" ) { + + // Node, CommonJS + module.exports = factory( require( "cldrjs" ), require( "globalize" ) ); + } else { + + // Global + factory( root.Cldr, root.Globalize ); + } +}(this, function( Cldr, Globalize ) { + +var alwaysArray = Globalize._alwaysArray, + formatMessage = Globalize._formatMessage, + numberNumberingSystem = Globalize._numberNumberingSystem, + numberPattern = Globalize._numberPattern, + runtimeBind = Globalize._runtimeBind, + stringPad = Globalize._stringPad, + validateCldr = Globalize._validateCldr, + validateDefaultLocale = Globalize._validateDefaultLocale, + validateParameterPresence = Globalize._validateParameterPresence, + validateParameterType = Globalize._validateParameterType, + validateParameterTypeNumber = Globalize._validateParameterTypeNumber, + validateParameterTypePlainObject = Globalize._validateParameterTypePlainObject; + + +var validateParameterTypeCurrency = function( value, name ) { + validateParameterType( + value, + name, + value === undefined || typeof value === "string" && ( /^[A-Za-z]{3}$/ ).test( value ), + "3-letter currency code string as defined by ISO 4217" + ); +}; + + + + +/** + * supplementalOverride( currency, pattern, cldr ) + * + * Return pattern with fraction digits overriden by supplemental currency data. + */ +var currencySupplementalOverride = function( currency, pattern, cldr ) { + var digits, + fraction = "", + fractionData = cldr.supplemental([ "currencyData/fractions", currency ]) || + cldr.supplemental( "currencyData/fractions/DEFAULT" ); + + digits = +fractionData._digits; + + if ( digits ) { + fraction = "." + stringPad( "0", digits ).slice( 0, -1 ) + fractionData._rounding; + } + + return pattern.replace( /\.(#+|0*[0-9]|0+[0-9]?)/g, fraction ); +}; + + + + +var objectFilter = function( object, testRe ) { + var key, + copy = {}; + + for ( key in object ) { + if ( testRe.test( key ) ) { + copy[ key ] = object[ key ]; + } + } + + return copy; +}; + + + + +var currencyUnitPatterns = function( cldr ) { + return objectFilter( cldr.main([ + "numbers", + "currencyFormats-numberSystem-" + numberNumberingSystem( cldr ) + ]), /^unitPattern/ ); +}; + + + + +/** + * codeProperties( currency, cldr ) + * + * Return number pattern with the appropriate currency code in as literal. + */ +var currencyCodeProperties = function( currency, cldr ) { + var pattern = numberPattern( "decimal", cldr ); + + // The number of decimal places and the rounding for each currency is not locale-specific. Those + // values overridden by Supplemental Currency Data. + pattern = currencySupplementalOverride( currency, pattern, cldr ); + + return { + currency: currency, + pattern: pattern, + unitPatterns: currencyUnitPatterns( cldr ) + }; +}; + + + + +/** + * nameFormat( formattedNumber, pluralForm, properties ) + * + * Return the appropriate name form currency format. + */ +var currencyNameFormat = function( formattedNumber, pluralForm, properties ) { + var displayName, unitPattern, + displayNames = properties.displayNames || {}, + unitPatterns = properties.unitPatterns; + + displayName = displayNames[ "displayName-count-" + pluralForm ] || + displayNames[ "displayName-count-other" ] || + displayNames.displayName || + properties.currency; + unitPattern = unitPatterns[ "unitPattern-count-" + pluralForm ] || + unitPatterns[ "unitPattern-count-other" ]; + + return formatMessage( unitPattern, [ formattedNumber, displayName ]); +}; + + + + +var currencyFormatterFn = function( numberFormatter, pluralGenerator, properties ) { + var fn; + + // Return formatter when style is "code" or "name". + if ( pluralGenerator && properties ) { + fn = function currencyFormatter( value ) { + validateParameterPresence( value, "value" ); + validateParameterTypeNumber( value, "value" ); + return currencyNameFormat( + numberFormatter( value ), + pluralGenerator( value ), + properties + ); + }; + + // Return formatter when style is "symbol" or "accounting". + } else { + fn = function currencyFormatter( value ) { + return numberFormatter( value ); + }; + } + + return fn; +}; + + + + +/** + * nameProperties( currency, cldr ) + * + * Return number pattern with the appropriate currency code in as literal. + */ +var currencyNameProperties = function( currency, cldr ) { + var properties = currencyCodeProperties( currency, cldr ); + + properties.displayNames = objectFilter( cldr.main([ + "numbers/currencies", + currency + ]), /^displayName/ ); + + return properties; +}; + + + + +/** + * Unicode regular expression for: everything except math symbols, currency signs, dingbats, and + * box-drawing characters. + * + * Generated by: + * + * regenerate() + * .addRange( 0x0, 0x10FFFF ) + * .remove( require( "unicode-7.0.0/categories/S/symbols" ) ).toString(); + * + * https://github.com/mathiasbynens/regenerate + * https://github.com/mathiasbynens/unicode-7.0.0 + */ +var regexpNotS = /[\0-#%-\*,-;\?-\]_a-\{\}\x7F-\xA1\xA7\xAA\xAB\xAD\xB2\xB3\xB5-\xB7\xB9-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376-\u0383\u0386-\u03F5\u03F7-\u0481\u0483-\u058C\u0590-\u0605\u0609\u060A\u060C\u060D\u0610-\u06DD\u06DF-\u06E8\u06EA-\u06FC\u06FF-\u07F5\u07F7-\u09F1\u09F4-\u09F9\u09FC-\u0AF0\u0AF2-\u0B6F\u0B71-\u0BF2\u0BFB-\u0C7E\u0C80-\u0D78\u0D7A-\u0E3E\u0E40-\u0F00\u0F04-\u0F12\u0F14\u0F18\u0F19\u0F20-\u0F33\u0F35\u0F37\u0F39-\u0FBD\u0FC6\u0FCD\u0FD0-\u0FD4\u0FD9-\u109D\u10A0-\u138F\u139A-\u17DA\u17DC-\u193F\u1941-\u19DD\u1A00-\u1B60\u1B6B-\u1B73\u1B7D-\u1FBC\u1FBE\u1FC2-\u1FCC\u1FD0-\u1FDC\u1FE0-\u1FEC\u1FF0-\u1FFC\u1FFF-\u2043\u2045-\u2051\u2053-\u2079\u207D-\u2089\u208D-\u209F\u20BE-\u20FF\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2150-\u218F\u2308-\u230B\u2329\u232A\u23FB-\u23FF\u2427-\u243F\u244B-\u249B\u24EA-\u24FF\u2768-\u2793\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2B74\u2B75\u2B96\u2B97\u2BBA-\u2BBC\u2BC9\u2BD2-\u2CE4\u2CEB-\u2E7F\u2E9A\u2EF4-\u2EFF\u2FD6-\u2FEF\u2FFC-\u3003\u3005-\u3011\u3014-\u301F\u3021-\u3035\u3038-\u303D\u3040-\u309A\u309D-\u318F\u3192-\u3195\u31A0-\u31BF\u31E4-\u31FF\u321F-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u32FF\u3400-\u4DBF\u4E00-\uA48F\uA4C7-\uA6FF\uA717-\uA71F\uA722-\uA788\uA78B-\uA827\uA82C-\uA835\uA83A-\uAA76\uAA7A-\uAB5A\uAB5C-\uD7FF\uDC00-\uFB28\uFB2A-\uFBB1\uFBC2-\uFDFB\uFDFE-\uFE61\uFE63\uFE67\uFE68\uFE6A-\uFF03\uFF05-\uFF0A\uFF0C-\uFF1B\uFF1F-\uFF3D\uFF3F\uFF41-\uFF5B\uFF5D\uFF5F-\uFFDF\uFFE7\uFFEF-\uFFFB\uFFFE\uFFFF]|\uD800[\uDC00-\uDD36\uDD40-\uDD78\uDD8A\uDD8B\uDD8D-\uDD8F\uDD9C-\uDD9F\uDDA1-\uDDCF\uDDFD-\uDFFF]|[\uD801\uD803-\uD819\uD81B-\uD82E\uD830-\uD833\uD836-\uD83A\uD83F-\uDBFF][\uDC00-\uDFFF]|\uD802[\uDC00-\uDC76\uDC79-\uDEC7\uDEC9-\uDFFF]|\uD81A[\uDC00-\uDF3B\uDF40-\uDF44\uDF46-\uDFFF]|\uD82F[\uDC00-\uDC9B\uDC9D-\uDFFF]|\uD834[\uDCF6-\uDCFF\uDD27\uDD28\uDD65-\uDD69\uDD6D-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDDDE-\uDDFF\uDE42-\uDE44\uDE46-\uDEFF\uDF57-\uDFFF]|\uD835[\uDC00-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFFF]|\uD83B[\uDC00-\uDEEF\uDEF2-\uDFFF]|\uD83C[\uDC2C-\uDC2F\uDC94-\uDC9F\uDCAF\uDCB0\uDCC0\uDCD0\uDCF6-\uDD0F\uDD2F\uDD6C-\uDD6F\uDD9B-\uDDE5\uDE03-\uDE0F\uDE3B-\uDE3F\uDE49-\uDE4F\uDE52-\uDEFF\uDF2D-\uDF2F\uDF7E\uDF7F\uDFCF-\uDFD3\uDFF8-\uDFFF]|\uD83D[\uDCFF\uDD4B-\uDD4F\uDD7A\uDDA4\uDE43\uDE44\uDED0-\uDEDF\uDEED-\uDEEF\uDEF4-\uDEFF\uDF74-\uDF7F\uDFD5-\uDFFF]|\uD83E[\uDC0C-\uDC0F\uDC48-\uDC4F\uDC5A-\uDC5F\uDC88-\uDC8F\uDCAE-\uDFFF]|[\uD800-\uDBFF]/; + + + + +/** + * symbolProperties( currency, cldr ) + * + * Return pattern replacing `¤` with the appropriate currency symbol literal. + */ +var currencySymbolProperties = function( currency, cldr, options ) { + var currencySpacing, pattern, + regexp = { + "[:digit:]": /\d/, + "[:^S:]": regexpNotS + }, + symbol = cldr.main([ + "numbers/currencies", + currency, + "symbol" + ]); + + currencySpacing = [ "beforeCurrency", "afterCurrency" ].map(function( position ) { + return cldr.main([ + "numbers", + "currencyFormats-numberSystem-" + numberNumberingSystem( cldr ), + "currencySpacing", + position + ]); + }); + + pattern = cldr.main([ + "numbers", + "currencyFormats-numberSystem-" + numberNumberingSystem( cldr ), + options.style === "accounting" ? "accounting" : "standard" + ]); + + pattern = + + // The number of decimal places and the rounding for each currency is not locale-specific. + // Those values are overridden by Supplemental Currency Data. + currencySupplementalOverride( currency, pattern, cldr ) + + // Replace "¤" (\u00A4) with the appropriate symbol literal. + .split( ";" ).map(function( pattern ) { + + return pattern.split( "\u00A4" ).map(function( part, i ) { + var currencyMatch = regexp[ currencySpacing[ i ].currencyMatch ], + surroundingMatch = regexp[ currencySpacing[ i ].surroundingMatch ], + insertBetween = ""; + + // For currencyMatch and surroundingMatch definitions, read [1]. + // When i === 0, beforeCurrency is being handled. Otherwise, afterCurrency. + // 1: http://www.unicode.org/reports/tr35/tr35-numbers.html#Currencies + currencyMatch = currencyMatch.test( symbol.charAt( i ? symbol.length - 1 : 0 ) ); + surroundingMatch = surroundingMatch.test( + part.charAt( i ? 0 : part.length - 1 ).replace( /[#@,.]/g, "0" ) + ); + + if ( currencyMatch && part && surroundingMatch ) { + insertBetween = currencySpacing[ i ].insertBetween; + } + + return ( i ? insertBetween : "" ) + part + ( i ? "" : insertBetween ); + }).join( "'" + symbol + "'" ); + }).join( ";" ); + + return { + pattern: pattern + }; +}; + + + + +/** + * objectOmit( object, keys ) + * + * Return a copy of the object, filtered to omit the blacklisted key or array of keys. + */ +var objectOmit = function( object, keys ) { + var key, + copy = {}; + + keys = alwaysArray( keys ); + + for ( key in object ) { + if ( keys.indexOf( key ) === -1 ) { + copy[ key ] = object[ key ]; + } + } + + return copy; +}; + + + + +function validateRequiredCldr( path, value ) { + validateCldr( path, value, { + skip: [ /supplemental\/currencyData\/fractions\/[A-Za-z]{3}$/ ] + }); +} + +/** + * .currencyFormatter( currency [, options] ) + * + * @currency [String] 3-letter currency code as defined by ISO 4217. + * + * @options [Object]: + * - style: [String] "symbol" (default), "accounting", "code" or "name". + * - see also number/format options. + * + * Return a function that formats a currency according to the given options and default/instance + * locale. + */ +Globalize.currencyFormatter = +Globalize.prototype.currencyFormatter = function( currency, options ) { + var args, cldr, numberFormatter, pluralGenerator, properties, returnFn, style; + + validateParameterPresence( currency, "currency" ); + validateParameterTypeCurrency( currency, "currency" ); + + validateParameterTypePlainObject( options, "options" ); + + cldr = this.cldr; + options = options || {}; + + args = [ currency, options ]; + style = options.style || "symbol"; + + validateDefaultLocale( cldr ); + + // Get properties given style ("symbol" default, "code" or "name"). + cldr.on( "get", validateRequiredCldr ); + properties = ({ + accounting: currencySymbolProperties, + code: currencyCodeProperties, + name: currencyNameProperties, + symbol: currencySymbolProperties + }[ style ] )( currency, cldr, options ); + cldr.off( "get", validateRequiredCldr ); + + // options = options minus style, plus raw pattern. + options = objectOmit( options, "style" ); + options.raw = properties.pattern; + + // Return formatter when style is "symbol" or "accounting". + if ( style === "symbol" || style === "accounting" ) { + numberFormatter = this.numberFormatter( options ); + + returnFn = currencyFormatterFn( numberFormatter ); + + runtimeBind( args, cldr, returnFn, [ numberFormatter ] ); + + // Return formatter when style is "code" or "name". + } else { + numberFormatter = this.numberFormatter( options ); + pluralGenerator = this.pluralGenerator(); + + returnFn = currencyFormatterFn( numberFormatter, pluralGenerator, properties ); + + runtimeBind( args, cldr, returnFn, [ numberFormatter, pluralGenerator, properties ] ); + } + + return returnFn; +}; + +/** + * .currencyParser( currency [, options] ) + * + * @currency [String] 3-letter currency code as defined by ISO 4217. + * + * @options [Object] see currencyFormatter. + * + * Return the currency parser according to the given options and the default/instance locale. + */ +Globalize.currencyParser = +Globalize.prototype.currencyParser = function( /* currency, options */ ) { + + // TODO implement parser. + +}; + +/** + * .formatCurrency( value, currency [, options] ) + * + * @value [Number] number to be formatted. + * + * @currency [String] 3-letter currency code as defined by ISO 4217. + * + * @options [Object] see currencyFormatter. + * + * Format a currency according to the given options and the default/instance locale. + */ +Globalize.formatCurrency = +Globalize.prototype.formatCurrency = function( value, currency, options ) { + validateParameterPresence( value, "value" ); + validateParameterTypeNumber( value, "value" ); + + return this.currencyFormatter( currency, options )( value ); +}; + +/** + * .parseCurrency( value, currency [, options] ) + * + * @value [String] + * + * @currency [String] 3-letter currency code as defined by ISO 4217. + * + * @options [Object]: See currencyFormatter. + * + * Return the parsed currency or NaN when value is invalid. + */ +Globalize.parseCurrency = +Globalize.prototype.parseCurrency = function( /* value, currency, options */ ) { +}; + +return Globalize; + + + + +})); diff --git a/StockManMVC/.bin/bower_components/globalize/dist/globalize/date.js b/StockManMVC/.bin/bower_components/globalize/dist/globalize/date.js new file mode 100644 index 0000000..4fa68ce --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/dist/globalize/date.js @@ -0,0 +1,1923 @@ +/** + * Globalize v1.1.1 + * + * http://github.com/jquery/globalize + * + * Copyright jQuery Foundation and other contributors + * Released under the MIT license + * http://jquery.org/license + * + * Date: 2016-02-04T12:01Z + */ +/*! + * Globalize v1.1.1 2016-02-04T12:01Z Released under the MIT license + * http://git.io/TrdQbw + */ +(function( root, factory ) { + + // UMD returnExports + if ( typeof define === "function" && define.amd ) { + + // AMD + define([ + "cldr", + "../globalize", + "./number", + "cldr/event", + "cldr/supplemental" + ], factory ); + } else if ( typeof exports === "object" ) { + + // Node, CommonJS + module.exports = factory( require( "cldrjs" ), require( "globalize" ) ); + } else { + + // Extend global + factory( root.Cldr, root.Globalize ); + } +}(this, function( Cldr, Globalize ) { + +var createError = Globalize._createError, + createErrorUnsupportedFeature = Globalize._createErrorUnsupportedFeature, + formatMessage = Globalize._formatMessage, + numberSymbol = Globalize._numberSymbol, + regexpEscape = Globalize._regexpEscape, + runtimeBind = Globalize._runtimeBind, + stringPad = Globalize._stringPad, + validateCldr = Globalize._validateCldr, + validateDefaultLocale = Globalize._validateDefaultLocale, + validateParameterPresence = Globalize._validateParameterPresence, + validateParameterType = Globalize._validateParameterType, + validateParameterTypePlainObject = Globalize._validateParameterTypePlainObject, + validateParameterTypeString = Globalize._validateParameterTypeString; + + +var validateParameterTypeDate = function( value, name ) { + validateParameterType( value, name, value === undefined || value instanceof Date, "Date" ); +}; + + + + +var createErrorInvalidParameterValue = function( name, value ) { + return createError( "E_INVALID_PAR_VALUE", "Invalid `{name}` value ({value}).", { + name: name, + value: value + }); +}; + + + + +/** + * expandPattern( options, cldr ) + * + * @options [Object] if String, it's considered a skeleton. Object accepts: + * - skeleton: [String] lookup availableFormat; + * - date: [String] ( "full" | "long" | "medium" | "short" ); + * - time: [String] ( "full" | "long" | "medium" | "short" ); + * - datetime: [String] ( "full" | "long" | "medium" | "short" ); + * - raw: [String] For more info see datetime/format.js. + * + * @cldr [Cldr instance]. + * + * Return the corresponding pattern. + * Eg for "en": + * - "GyMMMd" returns "MMM d, y G"; + * - { skeleton: "GyMMMd" } returns "MMM d, y G"; + * - { date: "full" } returns "EEEE, MMMM d, y"; + * - { time: "full" } returns "h:mm:ss a zzzz"; + * - { datetime: "full" } returns "EEEE, MMMM d, y 'at' h:mm:ss a zzzz"; + * - { raw: "dd/mm" } returns "dd/mm"; + */ + +var dateExpandPattern = function( options, cldr ) { + var dateSkeleton, result, skeleton, timeSkeleton, type; + + function combineDateTime( type, datePattern, timePattern ) { + return formatMessage( + cldr.main([ + "dates/calendars/gregorian/dateTimeFormats", + type + ]), + [ timePattern, datePattern ] + ); + } + + switch ( true ) { + case "skeleton" in options: + skeleton = options.skeleton; + result = cldr.main([ + "dates/calendars/gregorian/dateTimeFormats/availableFormats", + skeleton + ]); + if ( !result ) { + timeSkeleton = skeleton.split( /[^hHKkmsSAzZOvVXx]/ ).slice( -1 )[ 0 ]; + dateSkeleton = skeleton.split( /[^GyYuUrQqMLlwWdDFgEec]/ )[ 0 ]; + if ( /(MMMM|LLLL).*[Ec]/.test( dateSkeleton ) ) { + type = "full"; + } else if ( /MMMM/g.test( dateSkeleton ) ) { + type = "long"; + } else if ( /MMM/g.test( dateSkeleton ) || /LLL/g.test( dateSkeleton ) ) { + type = "medium"; + } else { + type = "short"; + } + result = combineDateTime( type, + cldr.main([ + "dates/calendars/gregorian/dateTimeFormats/availableFormats", + dateSkeleton + ]), + cldr.main([ + "dates/calendars/gregorian/dateTimeFormats/availableFormats", + timeSkeleton + ]) + ); + } + break; + + case "date" in options: + case "time" in options: + result = cldr.main([ + "dates/calendars/gregorian", + "date" in options ? "dateFormats" : "timeFormats", + ( options.date || options.time ) + ]); + break; + + case "datetime" in options: + result = combineDateTime( options.datetime, + cldr.main([ "dates/calendars/gregorian/dateFormats", options.datetime ]), + cldr.main([ "dates/calendars/gregorian/timeFormats", options.datetime ]) + ); + break; + + case "raw" in options: + result = options.raw; + break; + + default: + throw createErrorInvalidParameterValue({ + name: "options", + value: options + }); + } + + return result; +}; + + + + +/** + * dayOfWeek( date, firstDay ) + * + * @date + * + * @firstDay the result of `dateFirstDayOfWeek( cldr )` + * + * Return the day of the week normalized by the territory's firstDay [0-6]. + * Eg for "mon": + * - return 0 if territory is GB, or BR, or DE, or FR (week starts on "mon"); + * - return 1 if territory is US (week starts on "sun"); + * - return 2 if territory is EG (week starts on "sat"); + */ +var dateDayOfWeek = function( date, firstDay ) { + return ( date.getDay() - firstDay + 7 ) % 7; +}; + + + + +/** + * distanceInDays( from, to ) + * + * Return the distance in days between from and to Dates. + */ +var dateDistanceInDays = function( from, to ) { + var inDays = 864e5; + return ( to.getTime() - from.getTime() ) / inDays; +}; + + + + +/** + * startOf changes the input to the beginning of the given unit. + * + * For example, starting at the start of a day, resets hours, minutes + * seconds and milliseconds to 0. Starting at the month does the same, but + * also sets the date to 1. + * + * Returns the modified date + */ +var dateStartOf = function( date, unit ) { + date = new Date( date.getTime() ); + switch ( unit ) { + case "year": + date.setMonth( 0 ); + /* falls through */ + case "month": + date.setDate( 1 ); + /* falls through */ + case "day": + date.setHours( 0 ); + /* falls through */ + case "hour": + date.setMinutes( 0 ); + /* falls through */ + case "minute": + date.setSeconds( 0 ); + /* falls through */ + case "second": + date.setMilliseconds( 0 ); + } + return date; +}; + + + + +/** + * dayOfYear + * + * Return the distance in days of the date to the begin of the year [0-d]. + */ +var dateDayOfYear = function( date ) { + return Math.floor( dateDistanceInDays( dateStartOf( date, "year" ), date ) ); +}; + + + + +/** + * millisecondsInDay + */ +var dateMillisecondsInDay = function( date ) { + + // TODO Handle daylight savings discontinuities + return date - dateStartOf( date, "day" ); +}; + + + + +var datePatternRe = ( /([a-z])\1*|'([^']|'')+'|''|./ig ); + + + + +/** + * hourFormat( date, format, timeSeparator, formatNumber ) + * + * Return date's timezone offset according to the format passed. + * Eg for format when timezone offset is 180: + * - "+H;-H": -3 + * - "+HHmm;-HHmm": -0300 + * - "+HH:mm;-HH:mm": -03:00 + */ +var dateTimezoneHourFormat = function( date, format, timeSeparator, formatNumber ) { + var absOffset, + offset = date.getTimezoneOffset(); + + absOffset = Math.abs( offset ); + formatNumber = formatNumber || { + 1: function( value ) { + return stringPad( value, 1 ); + }, + 2: function( value ) { + return stringPad( value, 2 ); + } + }; + + return format + + // Pick the correct sign side (+ or -). + .split( ";" )[ offset > 0 ? 1 : 0 ] + + // Localize time separator + .replace( ":", timeSeparator ) + + // Update hours offset. + .replace( /HH?/, function( match ) { + return formatNumber[ match.length ]( Math.floor( absOffset / 60 ) ); + }) + + // Update minutes offset and return. + .replace( /mm/, function() { + return formatNumber[ 2 ]( absOffset % 60 ); + }); +}; + + + + +var dateWeekDays = [ "sun", "mon", "tue", "wed", "thu", "fri", "sat" ]; + + + + +/** + * format( date, properties ) + * + * @date [Date instance]. + * + * @properties + * + * TODO Support other calendar types. + * + * Disclosure: this function borrows excerpts of dojo/date/locale. + */ +var dateFormat = function( date, numberFormatters, properties ) { + var timeSeparator = properties.timeSeparator; + + return properties.pattern.replace( datePatternRe, function( current ) { + var ret, + chr = current.charAt( 0 ), + length = current.length; + + if ( chr === "j" ) { + + // Locale preferred hHKk. + // http://www.unicode.org/reports/tr35/tr35-dates.html#Time_Data + chr = properties.preferredTime; + } + + if ( chr === "Z" ) { + + // Z..ZZZ: same as "xxxx". + if ( length < 4 ) { + chr = "x"; + length = 4; + + // ZZZZ: same as "OOOO". + } else if ( length < 5 ) { + chr = "O"; + length = 4; + + // ZZZZZ: same as "XXXXX" + } else { + chr = "X"; + length = 5; + } + } + + switch ( chr ) { + + // Era + case "G": + ret = properties.eras[ date.getFullYear() < 0 ? 0 : 1 ]; + break; + + // Year + case "y": + + // Plain year. + // The length specifies the padding, but for two letters it also specifies the + // maximum length. + ret = date.getFullYear(); + if ( length === 2 ) { + ret = String( ret ); + ret = +ret.substr( ret.length - 2 ); + } + break; + + case "Y": + + // Year in "Week of Year" + // The length specifies the padding, but for two letters it also specifies the + // maximum length. + // yearInWeekofYear = date + DaysInAWeek - (dayOfWeek - firstDay) - minDays + ret = new Date( date.getTime() ); + ret.setDate( + ret.getDate() + 7 - + dateDayOfWeek( date, properties.firstDay ) - + properties.firstDay - + properties.minDays + ); + ret = ret.getFullYear(); + if ( length === 2 ) { + ret = String( ret ); + ret = +ret.substr( ret.length - 2 ); + } + break; + + // Quarter + case "Q": + case "q": + ret = Math.ceil( ( date.getMonth() + 1 ) / 3 ); + if ( length > 2 ) { + ret = properties.quarters[ chr ][ length ][ ret ]; + } + break; + + // Month + case "M": + case "L": + ret = date.getMonth() + 1; + if ( length > 2 ) { + ret = properties.months[ chr ][ length ][ ret ]; + } + break; + + // Week + case "w": + + // Week of Year. + // woy = ceil( ( doy + dow of 1/1 ) / 7 ) - minDaysStuff ? 1 : 0. + // TODO should pad on ww? Not documented, but I guess so. + ret = dateDayOfWeek( dateStartOf( date, "year" ), properties.firstDay ); + ret = Math.ceil( ( dateDayOfYear( date ) + ret ) / 7 ) - + ( 7 - ret >= properties.minDays ? 0 : 1 ); + break; + + case "W": + + // Week of Month. + // wom = ceil( ( dom + dow of `1/month` ) / 7 ) - minDaysStuff ? 1 : 0. + ret = dateDayOfWeek( dateStartOf( date, "month" ), properties.firstDay ); + ret = Math.ceil( ( date.getDate() + ret ) / 7 ) - + ( 7 - ret >= properties.minDays ? 0 : 1 ); + break; + + // Day + case "d": + ret = date.getDate(); + break; + + case "D": + ret = dateDayOfYear( date ) + 1; + break; + + case "F": + + // Day of Week in month. eg. 2nd Wed in July. + ret = Math.floor( date.getDate() / 7 ) + 1; + break; + + // Week day + case "e": + case "c": + if ( length <= 2 ) { + + // Range is [1-7] (deduced by example provided on documentation) + // TODO Should pad with zeros (not specified in the docs)? + ret = dateDayOfWeek( date, properties.firstDay ) + 1; + break; + } + + /* falls through */ + case "E": + ret = dateWeekDays[ date.getDay() ]; + ret = properties.days[ chr ][ length ][ ret ]; + break; + + // Period (AM or PM) + case "a": + ret = properties.dayPeriods[ date.getHours() < 12 ? "am" : "pm" ]; + break; + + // Hour + case "h": // 1-12 + ret = ( date.getHours() % 12 ) || 12; + break; + + case "H": // 0-23 + ret = date.getHours(); + break; + + case "K": // 0-11 + ret = date.getHours() % 12; + break; + + case "k": // 1-24 + ret = date.getHours() || 24; + break; + + // Minute + case "m": + ret = date.getMinutes(); + break; + + // Second + case "s": + ret = date.getSeconds(); + break; + + case "S": + ret = Math.round( date.getMilliseconds() * Math.pow( 10, length - 3 ) ); + break; + + case "A": + ret = Math.round( dateMillisecondsInDay( date ) * Math.pow( 10, length - 3 ) ); + break; + + // Zone + case "z": + case "O": + + // O: "{gmtFormat}+H;{gmtFormat}-H" or "{gmtZeroFormat}", eg. "GMT-8" or "GMT". + // OOOO: "{gmtFormat}{hourFormat}" or "{gmtZeroFormat}", eg. "GMT-08:00" or "GMT". + if ( date.getTimezoneOffset() === 0 ) { + ret = properties.gmtZeroFormat; + } else { + ret = dateTimezoneHourFormat( + date, + length < 4 ? "+H;-H" : properties.tzLongHourFormat, + timeSeparator, + numberFormatters + ); + ret = properties.gmtFormat.replace( /\{0\}/, ret ); + } + break; + + case "X": + + // Same as x*, except it uses "Z" for zero offset. + if ( date.getTimezoneOffset() === 0 ) { + ret = "Z"; + break; + } + + /* falls through */ + case "x": + + // x: hourFormat("+HH;-HH") + // xx or xxxx: hourFormat("+HHmm;-HHmm") + // xxx or xxxxx: hourFormat("+HH:mm;-HH:mm") + ret = length === 1 ? "+HH;-HH" : ( length % 2 ? "+HH:mm;-HH:mm" : "+HHmm;-HHmm" ); + ret = dateTimezoneHourFormat( date, ret, ":" ); + break; + + // timeSeparator + case ":": + ret = timeSeparator; + break; + + // ' literals. + case "'": + current = current.replace( /''/, "'" ); + if ( length > 2 ) { + current = current.slice( 1, -1 ); + } + ret = current; + break; + + // Anything else is considered a literal, including [ ,:/.@#], chinese, japonese, and + // arabic characters. + default: + ret = current; + } + if ( typeof ret === "number" ) { + ret = numberFormatters[ length ]( ret ); + } + return ret; + }); +}; + + + + +var dateFormatterFn = function( numberFormatters, properties ) { + return function dateFormatter( value ) { + validateParameterPresence( value, "value" ); + validateParameterTypeDate( value, "value" ); + + return dateFormat( value, numberFormatters, properties ); + }; + +}; + + + + +/** + * firstDayOfWeek + */ +var dateFirstDayOfWeek = function( cldr ) { + return dateWeekDays.indexOf( cldr.supplemental.weekData.firstDay() ); +}; + + + + +/** + * properties( pattern, cldr ) + * + * @pattern [String] raw pattern. + * ref: http://www.unicode.org/reports/tr35/tr35-dates.html#Date_Format_Patterns + * + * @cldr [Cldr instance]. + * + * Return the properties given the pattern and cldr. + * + * TODO Support other calendar types. + */ +var dateFormatProperties = function( pattern, cldr ) { + var properties = { + numberFormatters: {}, + pattern: pattern, + timeSeparator: numberSymbol( "timeSeparator", cldr ) + }, + widths = [ "abbreviated", "wide", "narrow" ]; + + function setNumberFormatterPattern( pad ) { + properties.numberFormatters[ pad ] = stringPad( "", pad ); + } + + pattern.replace( datePatternRe, function( current ) { + var formatNumber, + chr = current.charAt( 0 ), + length = current.length; + + if ( chr === "j" ) { + + // Locale preferred hHKk. + // http://www.unicode.org/reports/tr35/tr35-dates.html#Time_Data + properties.preferredTime = chr = cldr.supplemental.timeData.preferred(); + } + + // ZZZZ: same as "OOOO". + if ( chr === "Z" && length === 4 ) { + chr = "O"; + length = 4; + } + + switch ( chr ) { + + // Era + case "G": + properties.eras = cldr.main([ + "dates/calendars/gregorian/eras", + length <= 3 ? "eraAbbr" : ( length === 4 ? "eraNames" : "eraNarrow" ) + ]); + break; + + // Year + case "y": + + // Plain year. + formatNumber = true; + break; + + case "Y": + + // Year in "Week of Year" + properties.firstDay = dateFirstDayOfWeek( cldr ); + properties.minDays = cldr.supplemental.weekData.minDays(); + formatNumber = true; + break; + + case "u": // Extended year. Need to be implemented. + case "U": // Cyclic year name. Need to be implemented. + throw createErrorUnsupportedFeature({ + feature: "year pattern `" + chr + "`" + }); + + // Quarter + case "Q": + case "q": + if ( length > 2 ) { + if ( !properties.quarters ) { + properties.quarters = {}; + } + if ( !properties.quarters[ chr ] ) { + properties.quarters[ chr ] = {}; + } + properties.quarters[ chr ][ length ] = cldr.main([ + "dates/calendars/gregorian/quarters", + chr === "Q" ? "format" : "stand-alone", + widths[ length - 3 ] + ]); + } else { + formatNumber = true; + } + break; + + // Month + case "M": + case "L": + if ( length > 2 ) { + if ( !properties.months ) { + properties.months = {}; + } + if ( !properties.months[ chr ] ) { + properties.months[ chr ] = {}; + } + properties.months[ chr ][ length ] = cldr.main([ + "dates/calendars/gregorian/months", + chr === "M" ? "format" : "stand-alone", + widths[ length - 3 ] + ]); + } else { + formatNumber = true; + } + break; + + // Week - Week of Year (w) or Week of Month (W). + case "w": + case "W": + properties.firstDay = dateFirstDayOfWeek( cldr ); + properties.minDays = cldr.supplemental.weekData.minDays(); + formatNumber = true; + break; + + // Day + case "d": + case "D": + case "F": + formatNumber = true; + break; + + case "g": + + // Modified Julian day. Need to be implemented. + throw createErrorUnsupportedFeature({ + feature: "Julian day pattern `g`" + }); + + // Week day + case "e": + case "c": + if ( length <= 2 ) { + properties.firstDay = dateFirstDayOfWeek( cldr ); + formatNumber = true; + break; + } + + /* falls through */ + case "E": + if ( !properties.days ) { + properties.days = {}; + } + if ( !properties.days[ chr ] ) { + properties.days[ chr ] = {}; + } + if ( length === 6 ) { + + // If short day names are not explicitly specified, abbreviated day names are + // used instead. + // http://www.unicode.org/reports/tr35/tr35-dates.html#months_days_quarters_eras + // http://unicode.org/cldr/trac/ticket/6790 + properties.days[ chr ][ length ] = cldr.main([ + "dates/calendars/gregorian/days", + chr === "c" ? "stand-alone" : "format", + "short" + ]) || cldr.main([ + "dates/calendars/gregorian/days", + chr === "c" ? "stand-alone" : "format", + "abbreviated" + ]); + } else { + properties.days[ chr ][ length ] = cldr.main([ + "dates/calendars/gregorian/days", + chr === "c" ? "stand-alone" : "format", + widths[ length < 3 ? 0 : length - 3 ] + ]); + } + break; + + // Period (AM or PM) + case "a": + properties.dayPeriods = cldr.main( + "dates/calendars/gregorian/dayPeriods/format/wide" + ); + break; + + // Hour + case "h": // 1-12 + case "H": // 0-23 + case "K": // 0-11 + case "k": // 1-24 + + // Minute + case "m": + + // Second + case "s": + case "S": + case "A": + formatNumber = true; + break; + + // Zone + case "z": + case "O": + + // O: "{gmtFormat}+H;{gmtFormat}-H" or "{gmtZeroFormat}", eg. "GMT-8" or "GMT". + // OOOO: "{gmtFormat}{hourFormat}" or "{gmtZeroFormat}", eg. "GMT-08:00" or "GMT". + properties.gmtFormat = cldr.main( "dates/timeZoneNames/gmtFormat" ); + properties.gmtZeroFormat = cldr.main( "dates/timeZoneNames/gmtZeroFormat" ); + properties.tzLongHourFormat = cldr.main( "dates/timeZoneNames/hourFormat" ); + + /* falls through */ + case "Z": + case "X": + case "x": + setNumberFormatterPattern( 1 ); + setNumberFormatterPattern( 2 ); + break; + + case "v": + case "V": + throw createErrorUnsupportedFeature({ + feature: "timezone pattern `" + chr + "`" + }); + } + + if ( formatNumber ) { + setNumberFormatterPattern( length ); + } + }); + + return properties; +}; + + + + +/** + * isLeapYear( year ) + * + * @year [Number] + * + * Returns an indication whether the specified year is a leap year. + */ +var dateIsLeapYear = function( year ) { + return new Date( year, 1, 29 ).getMonth() === 1; +}; + + + + +/** + * lastDayOfMonth( date ) + * + * @date [Date] + * + * Return the last day of the given date's month + */ +var dateLastDayOfMonth = function( date ) { + return new Date( date.getFullYear(), date.getMonth() + 1, 0 ).getDate(); +}; + + + + +/** + * Differently from native date.setDate(), this function returns a date whose + * day remains inside the month boundaries. For example: + * + * setDate( FebDate, 31 ): a "Feb 28" date. + * setDate( SepDate, 31 ): a "Sep 30" date. + */ +var dateSetDate = function( date, day ) { + var lastDay = new Date( date.getFullYear(), date.getMonth() + 1, 0 ).getDate(); + + date.setDate( day < 1 ? 1 : day < lastDay ? day : lastDay ); +}; + + + + +/** + * Differently from native date.setMonth(), this function adjusts date if + * needed, so final month is always the one set. + * + * setMonth( Jan31Date, 1 ): a "Feb 28" date. + * setDate( Jan31Date, 8 ): a "Sep 30" date. + */ +var dateSetMonth = function( date, month ) { + var originalDate = date.getDate(); + + date.setDate( 1 ); + date.setMonth( month ); + dateSetDate( date, originalDate ); +}; + + + + +var outOfRange = function( value, low, high ) { + return value < low || value > high; +}; + + + + +/** + * parse( value, tokens, properties ) + * + * @value [String] string date. + * + * @tokens [Object] tokens returned by date/tokenizer. + * + * @properties [Object] output returned by date/tokenizer-properties. + * + * ref: http://www.unicode.org/reports/tr35/tr35-dates.html#Date_Format_Patterns + */ +var dateParse = function( value, tokens, properties ) { + var amPm, day, daysOfYear, month, era, hour, hour12, timezoneOffset, valid, + YEAR = 0, + MONTH = 1, + DAY = 2, + HOUR = 3, + MINUTE = 4, + SECOND = 5, + MILLISECONDS = 6, + date = new Date(), + truncateAt = [], + units = [ "year", "month", "day", "hour", "minute", "second", "milliseconds" ]; + + if ( !tokens.length ) { + return null; + } + + valid = tokens.every(function( token ) { + var century, chr, value, length; + + if ( token.type === "literal" ) { + + // continue + return true; + } + + chr = token.type.charAt( 0 ); + length = token.type.length; + + if ( chr === "j" ) { + + // Locale preferred hHKk. + // http://www.unicode.org/reports/tr35/tr35-dates.html#Time_Data + chr = properties.preferredTimeData; + } + + switch ( chr ) { + + // Era + case "G": + truncateAt.push( YEAR ); + era = +token.value; + break; + + // Year + case "y": + value = token.value; + if ( length === 2 ) { + if ( outOfRange( value, 0, 99 ) ) { + return false; + } + + // mimic dojo/date/locale: choose century to apply, according to a sliding + // window of 80 years before and 20 years after present year. + century = Math.floor( date.getFullYear() / 100 ) * 100; + value += century; + if ( value > date.getFullYear() + 20 ) { + value -= 100; + } + } + date.setFullYear( value ); + truncateAt.push( YEAR ); + break; + + case "Y": // Year in "Week of Year" + throw createErrorUnsupportedFeature({ + feature: "year pattern `" + chr + "`" + }); + + // Quarter (skip) + case "Q": + case "q": + break; + + // Month + case "M": + case "L": + if ( length <= 2 ) { + value = token.value; + } else { + value = +token.value; + } + if ( outOfRange( value, 1, 12 ) ) { + return false; + } + + // Setting the month later so that we have the correct year and can determine + // the correct last day of February in case of leap year. + month = value; + truncateAt.push( MONTH ); + break; + + // Week (skip) + case "w": // Week of Year. + case "W": // Week of Month. + break; + + // Day + case "d": + day = token.value; + truncateAt.push( DAY ); + break; + + case "D": + daysOfYear = token.value; + truncateAt.push( DAY ); + break; + + case "F": + + // Day of Week in month. eg. 2nd Wed in July. + // Skip + break; + + // Week day + case "e": + case "c": + case "E": + + // Skip. + // value = arrayIndexOf( dateWeekDays, token.value ); + break; + + // Period (AM or PM) + case "a": + amPm = token.value; + break; + + // Hour + case "h": // 1-12 + value = token.value; + if ( outOfRange( value, 1, 12 ) ) { + return false; + } + hour = hour12 = true; + date.setHours( value === 12 ? 0 : value ); + truncateAt.push( HOUR ); + break; + + case "K": // 0-11 + value = token.value; + if ( outOfRange( value, 0, 11 ) ) { + return false; + } + hour = hour12 = true; + date.setHours( value ); + truncateAt.push( HOUR ); + break; + + case "k": // 1-24 + value = token.value; + if ( outOfRange( value, 1, 24 ) ) { + return false; + } + hour = true; + date.setHours( value === 24 ? 0 : value ); + truncateAt.push( HOUR ); + break; + + case "H": // 0-23 + value = token.value; + if ( outOfRange( value, 0, 23 ) ) { + return false; + } + hour = true; + date.setHours( value ); + truncateAt.push( HOUR ); + break; + + // Minute + case "m": + value = token.value; + if ( outOfRange( value, 0, 59 ) ) { + return false; + } + date.setMinutes( value ); + truncateAt.push( MINUTE ); + break; + + // Second + case "s": + value = token.value; + if ( outOfRange( value, 0, 59 ) ) { + return false; + } + date.setSeconds( value ); + truncateAt.push( SECOND ); + break; + + case "A": + date.setHours( 0 ); + date.setMinutes( 0 ); + date.setSeconds( 0 ); + + /* falls through */ + case "S": + value = Math.round( token.value * Math.pow( 10, 3 - length ) ); + date.setMilliseconds( value ); + truncateAt.push( MILLISECONDS ); + break; + + // Zone + case "Z": + case "z": + case "O": + case "X": + case "x": + timezoneOffset = token.value - date.getTimezoneOffset(); + break; + } + + return true; + }); + + if ( !valid ) { + return null; + } + + // 12-hour format needs AM or PM, 24-hour format doesn't, ie. return null + // if amPm && !hour12 || !amPm && hour12. + if ( hour && !( !amPm ^ hour12 ) ) { + return null; + } + + if ( era === 0 ) { + + // 1 BC = year 0 + date.setFullYear( date.getFullYear() * -1 + 1 ); + } + + if ( month !== undefined ) { + dateSetMonth( date, month - 1 ); + } + + if ( day !== undefined ) { + if ( outOfRange( day, 1, dateLastDayOfMonth( date ) ) ) { + return null; + } + date.setDate( day ); + } else if ( daysOfYear !== undefined ) { + if ( outOfRange( daysOfYear, 1, dateIsLeapYear( date.getFullYear() ) ? 366 : 365 ) ) { + return null; + } + date.setMonth( 0 ); + date.setDate( daysOfYear ); + } + + if ( hour12 && amPm === "pm" ) { + date.setHours( date.getHours() + 12 ); + } + + if ( timezoneOffset ) { + date.setMinutes( date.getMinutes() + timezoneOffset ); + } + + // Truncate date at the most precise unit defined. Eg. + // If value is "12/31", and pattern is "MM/dd": + // => new Date( , 12, 31, 0, 0, 0, 0 ); + truncateAt = Math.max.apply( null, truncateAt ); + date = dateStartOf( date, units[ truncateAt ] ); + + return date; +}; + + + + +/** + * Generated by: + * + * regenerate().add( require( "unicode-7.0.0/categories/N/symbols" ) ).toString(); + * + * https://github.com/mathiasbynens/regenerate + * https://github.com/mathiasbynens/unicode-7.0.0 + */ +var regexpN = /[0-9\xB2\xB3\xB9\xBC-\xBE\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u09F4-\u09F9\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0B72-\u0B77\u0BE6-\u0BF2\u0C66-\u0C6F\u0C78-\u0C7E\u0CE6-\u0CEF\u0D66-\u0D75\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F33\u1040-\u1049\u1090-\u1099\u1369-\u137C\u16EE-\u16F0\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1946-\u194F\u19D0-\u19DA\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\u2070\u2074-\u2079\u2080-\u2089\u2150-\u2182\u2185-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2CFD\u3007\u3021-\u3029\u3038-\u303A\u3192-\u3195\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\uA620-\uA629\uA6E6-\uA6EF\uA830-\uA835\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19]|\uD800[\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDEE1-\uDEFB\uDF20-\uDF23\uDF41\uDF4A\uDFD1-\uDFD5]|\uD801[\uDCA0-\uDCA9]|\uD802[\uDC58-\uDC5F\uDC79-\uDC7F\uDCA7-\uDCAF\uDD16-\uDD1B\uDE40-\uDE47\uDE7D\uDE7E\uDE9D-\uDE9F\uDEEB-\uDEEF\uDF58-\uDF5F\uDF78-\uDF7F\uDFA9-\uDFAF]|\uD803[\uDE60-\uDE7E]|\uD804[\uDC52-\uDC6F\uDCF0-\uDCF9\uDD36-\uDD3F\uDDD0-\uDDD9\uDDE1-\uDDF4\uDEF0-\uDEF9]|\uD805[\uDCD0-\uDCD9\uDE50-\uDE59\uDEC0-\uDEC9]|\uD806[\uDCE0-\uDCF2]|\uD809[\uDC00-\uDC6E]|\uD81A[\uDE60-\uDE69\uDF50-\uDF59\uDF5B-\uDF61]|\uD834[\uDF60-\uDF71]|\uD835[\uDFCE-\uDFFF]|\uD83A[\uDCC7-\uDCCF]|\uD83C[\uDD00-\uDD0C]/; + + + + +/** + * tokenizer( value, pattern, properties ) + * + * @value [String] string date. + * + * @properties [Object] output returned by date/tokenizer-properties. + * + * Returns an Array of tokens, eg. value "5 o'clock PM", pattern "h 'o''clock' a": + * [{ + * type: "h", + * lexeme: "5" + * }, { + * type: "literal", + * lexeme: " " + * }, { + * type: "literal", + * lexeme: "o'clock" + * }, { + * type: "literal", + * lexeme: " " + * }, { + * type: "a", + * lexeme: "PM", + * value: "pm" + * }] + * + * OBS: lexeme's are always String and may return invalid ranges depending of the token type. + * Eg. "99" for month number. + * + * Return an empty Array when not successfully parsed. + */ +var dateTokenizer = function( value, numberParser, properties ) { + var valid, + timeSeparator = properties.timeSeparator, + tokens = [], + widths = [ "abbreviated", "wide", "narrow" ]; + + valid = properties.pattern.match( datePatternRe ).every(function( current ) { + var chr, length, numeric, tokenRe, + token = {}; + + function hourFormatParse( tokenRe, numberParser ) { + var aux = value.match( tokenRe ); + numberParser = numberParser || function( value ) { + return +value; + }; + + if ( !aux ) { + return false; + } + + // hourFormat containing H only, e.g., `+H;-H` + if ( aux.length < 8 ) { + token.value = + ( aux[ 1 ] ? -numberParser( aux[ 1 ] ) : numberParser( aux[ 4 ] ) ) * 60; + + // hourFormat containing H and m, e.g., `+HHmm;-HHmm` + } else { + token.value = + ( aux[ 1 ] ? -numberParser( aux[ 1 ] ) : numberParser( aux[ 7 ] ) ) * 60 + + ( aux[ 1 ] ? -numberParser( aux[ 4 ] ) : numberParser( aux[ 10 ] ) ); + } + + return true; + } + + // Transform: + // - "+H;-H" -> /\+(\d\d?)|-(\d\d?)/ + // - "+HH;-HH" -> /\+(\d\d)|-(\d\d)/ + // - "+HHmm;-HHmm" -> /\+(\d\d)(\d\d)|-(\d\d)(\d\d)/ + // - "+HH:mm;-HH:mm" -> /\+(\d\d):(\d\d)|-(\d\d):(\d\d)/ + // + // If gmtFormat is GMT{0}, the regexp must fill {0} in each side, e.g.: + // - "+H;-H" -> /GMT\+(\d\d?)|GMT-(\d\d?)/ + function hourFormatRe( hourFormat, gmtFormat, timeSeparator ) { + var re; + + if ( !gmtFormat ) { + gmtFormat = "{0}"; + } + + re = hourFormat + .replace( "+", "\\+" ) + + // Unicode equivalent to (\\d\\d) + .replace( /HH|mm/g, "((" + regexpN.source + ")(" + regexpN.source + "))" ) + + // Unicode equivalent to (\\d\\d?) + .replace( /H|m/g, "((" + regexpN.source + ")(" + regexpN.source + ")?)" ); + + if ( timeSeparator ) { + re = re.replace( /:/g, timeSeparator ); + } + + re = re.split( ";" ).map(function( part ) { + return gmtFormat.replace( "{0}", part ); + }).join( "|" ); + + return new RegExp( re ); + } + + function oneDigitIfLengthOne() { + if ( length === 1 ) { + + // Unicode equivalent to /\d/ + numeric = true; + return tokenRe = regexpN; + } + } + + function oneOrTwoDigitsIfLengthOne() { + if ( length === 1 ) { + + // Unicode equivalent to /\d\d?/ + numeric = true; + return tokenRe = new RegExp( "(" + regexpN.source + ")(" + regexpN.source + ")?" ); + } + } + + function twoDigitsIfLengthTwo() { + if ( length === 2 ) { + + // Unicode equivalent to /\d\d/ + numeric = true; + return tokenRe = new RegExp( "(" + regexpN.source + ")(" + regexpN.source + ")" ); + } + } + + // Brute-force test every locale entry in an attempt to match the given value. + // Return the first found one (and set token accordingly), or null. + function lookup( path ) { + var i, re, + data = properties[ path.join( "/" ) ]; + + for ( i in data ) { + re = new RegExp( "^" + data[ i ] ); + if ( re.test( value ) ) { + token.value = i; + return tokenRe = new RegExp( data[ i ] ); + } + } + return null; + } + + token.type = current; + chr = current.charAt( 0 ), + length = current.length; + + if ( chr === "Z" ) { + + // Z..ZZZ: same as "xxxx". + if ( length < 4 ) { + chr = "x"; + length = 4; + + // ZZZZ: same as "OOOO". + } else if ( length < 5 ) { + chr = "O"; + length = 4; + + // ZZZZZ: same as "XXXXX" + } else { + chr = "X"; + length = 5; + } + } + + switch ( chr ) { + + // Era + case "G": + lookup([ + "gregorian/eras", + length <= 3 ? "eraAbbr" : ( length === 4 ? "eraNames" : "eraNarrow" ) + ]); + break; + + // Year + case "y": + case "Y": + numeric = true; + + // number l=1:+, l=2:{2}, l=3:{3,}, l=4:{4,}, ... + if ( length === 1 ) { + + // Unicode equivalent to /\d+/. + tokenRe = new RegExp( "(" + regexpN.source + ")+" ); + } else if ( length === 2 ) { + + // Unicode equivalent to /\d\d/ + tokenRe = new RegExp( "(" + regexpN.source + ")(" + regexpN.source + ")" ); + } else { + + // Unicode equivalent to /\d{length,}/ + tokenRe = new RegExp( "(" + regexpN.source + "){" + length + ",}" ); + } + break; + + // Quarter + case "Q": + case "q": + + // number l=1:{1}, l=2:{2}. + // lookup l=3... + oneDigitIfLengthOne() || twoDigitsIfLengthTwo() || lookup([ + "gregorian/quarters", + chr === "Q" ? "format" : "stand-alone", + widths[ length - 3 ] + ]); + break; + + // Month + case "M": + case "L": + + // number l=1:{1,2}, l=2:{2}. + // lookup l=3... + oneOrTwoDigitsIfLengthOne() || twoDigitsIfLengthTwo() || lookup([ + "gregorian/months", + chr === "M" ? "format" : "stand-alone", + widths[ length - 3 ] + ]); + break; + + // Day + case "D": + + // number {l,3}. + if ( length <= 3 ) { + + // Unicode equivalent to /\d{length,3}/ + numeric = true; + tokenRe = new RegExp( "(" + regexpN.source + "){" + length + ",3}" ); + } + break; + + case "W": + case "F": + + // number l=1:{1}. + oneDigitIfLengthOne(); + break; + + // Week day + case "e": + case "c": + + // number l=1:{1}, l=2:{2}. + // lookup for length >=3. + if ( length <= 2 ) { + oneDigitIfLengthOne() || twoDigitsIfLengthTwo(); + break; + } + + /* falls through */ + case "E": + if ( length === 6 ) { + + // Note: if short day names are not explicitly specified, abbreviated day + // names are used instead http://www.unicode.org/reports/tr35/tr35-dates.html#months_days_quarters_eras + lookup([ + "gregorian/days", + [ chr === "c" ? "stand-alone" : "format" ], + "short" + ]) || lookup([ + "gregorian/days", + [ chr === "c" ? "stand-alone" : "format" ], + "abbreviated" + ]); + } else { + lookup([ + "gregorian/days", + [ chr === "c" ? "stand-alone" : "format" ], + widths[ length < 3 ? 0 : length - 3 ] + ]); + } + break; + + // Period (AM or PM) + case "a": + lookup([ + "gregorian/dayPeriods/format/wide" + ]); + break; + + // Week, Day, Hour, Minute, or Second + case "w": + case "d": + case "h": + case "H": + case "K": + case "k": + case "j": + case "m": + case "s": + + // number l1:{1,2}, l2:{2}. + oneOrTwoDigitsIfLengthOne() || twoDigitsIfLengthTwo(); + break; + + case "S": + + // number {l}. + + // Unicode equivalent to /\d{length}/ + numeric = true; + tokenRe = new RegExp( "(" + regexpN.source + "){" + length + "}" ); + break; + + case "A": + + // number {l+5}. + + // Unicode equivalent to /\d{length+5}/ + numeric = true; + tokenRe = new RegExp( "(" + regexpN.source + "){" + ( length + 5 ) + "}" ); + break; + + // Zone + case "z": + case "O": + + // O: "{gmtFormat}+H;{gmtFormat}-H" or "{gmtZeroFormat}", eg. "GMT-8" or "GMT". + // OOOO: "{gmtFormat}{hourFormat}" or "{gmtZeroFormat}", eg. "GMT-08:00" or "GMT". + if ( value === properties[ "timeZoneNames/gmtZeroFormat" ] ) { + token.value = 0; + tokenRe = new RegExp( properties[ "timeZoneNames/gmtZeroFormat" ] ); + } else { + tokenRe = hourFormatRe( + length < 4 ? "+H;-H" : properties[ "timeZoneNames/hourFormat" ], + properties[ "timeZoneNames/gmtFormat" ], + timeSeparator + ); + if ( !hourFormatParse( tokenRe, numberParser ) ) { + return null; + } + } + break; + + case "X": + + // Same as x*, except it uses "Z" for zero offset. + if ( value === "Z" ) { + token.value = 0; + tokenRe = /Z/; + break; + } + + /* falls through */ + case "x": + + // x: hourFormat("+HH;-HH") + // xx or xxxx: hourFormat("+HHmm;-HHmm") + // xxx or xxxxx: hourFormat("+HH:mm;-HH:mm") + tokenRe = hourFormatRe( + length === 1 ? "+HH;-HH" : ( length % 2 ? "+HH:mm;-HH:mm" : "+HHmm;-HHmm" ) + ); + if ( !hourFormatParse( tokenRe ) ) { + return null; + } + break; + + case "'": + token.type = "literal"; + current = current.replace( /''/, "'" ); + if ( length > 2 ) { + current = current.slice( 1, -1 ); + } + tokenRe = new RegExp( regexpEscape( current ) ); + break; + + default: + token.type = "literal"; + tokenRe = /./; + } + + if ( !tokenRe ) { + return false; + } + + // Get lexeme and consume it. + value = value.replace( new RegExp( "^" + tokenRe.source ), function( lexeme ) { + token.lexeme = lexeme; + if ( numeric ) { + token.value = numberParser( lexeme ); + } + return ""; + }); + + if ( !token.lexeme ) { + return false; + } + + tokens.push( token ); + return true; + }); + + if ( value !== "" ) { + valid = false; + } + + return valid ? tokens : []; +}; + + + + +var dateParserFn = function( numberParser, parseProperties, tokenizerProperties ) { + return function dateParser( value ) { + var tokens; + + validateParameterPresence( value, "value" ); + validateParameterTypeString( value, "value" ); + + tokens = dateTokenizer( value, numberParser, tokenizerProperties ); + return dateParse( value, tokens, parseProperties ) || null; + }; +}; + + + + +/** + * parseProperties( cldr ) + * + * @cldr [Cldr instance]. + * + * Return parser properties. + */ +var dateParseProperties = function( cldr ) { + return { + preferredTimeData: cldr.supplemental.timeData.preferred() + }; +}; + + + + +/** + * tokenizerProperties( pattern, cldr ) + * + * @pattern [String] raw pattern. + * + * @cldr [Cldr instance]. + * + * Return Object with data that will be used by tokenizer. + */ +var dateTokenizerProperties = function( pattern, cldr ) { + var properties = { + pattern: pattern, + timeSeparator: numberSymbol( "timeSeparator", cldr ) + }, + widths = [ "abbreviated", "wide", "narrow" ]; + + function populateProperties( path, value ) { + + // The `dates` and `calendars` trim's purpose is to reduce properties' key size only. + properties[ path.replace( /^.*\/dates\//, "" ).replace( /calendars\//, "" ) ] = value; + } + + cldr.on( "get", populateProperties ); + + pattern.match( datePatternRe ).forEach(function( current ) { + var chr, length; + + chr = current.charAt( 0 ), + length = current.length; + + if ( chr === "Z" && length < 5 ) { + chr = "O"; + length = 4; + } + + switch ( chr ) { + + // Era + case "G": + cldr.main([ + "dates/calendars/gregorian/eras", + length <= 3 ? "eraAbbr" : ( length === 4 ? "eraNames" : "eraNarrow" ) + ]); + break; + + // Year + case "u": // Extended year. Need to be implemented. + case "U": // Cyclic year name. Need to be implemented. + throw createErrorUnsupportedFeature({ + feature: "year pattern `" + chr + "`" + }); + + // Quarter + case "Q": + case "q": + if ( length > 2 ) { + cldr.main([ + "dates/calendars/gregorian/quarters", + chr === "Q" ? "format" : "stand-alone", + widths[ length - 3 ] + ]); + } + break; + + // Month + case "M": + case "L": + + // number l=1:{1,2}, l=2:{2}. + // lookup l=3... + if ( length > 2 ) { + cldr.main([ + "dates/calendars/gregorian/months", + chr === "M" ? "format" : "stand-alone", + widths[ length - 3 ] + ]); + } + break; + + // Day + case "g": + + // Modified Julian day. Need to be implemented. + throw createErrorUnsupportedFeature({ + feature: "Julian day pattern `g`" + }); + + // Week day + case "e": + case "c": + + // lookup for length >=3. + if ( length <= 2 ) { + break; + } + + /* falls through */ + case "E": + if ( length === 6 ) { + + // Note: if short day names are not explicitly specified, abbreviated day + // names are used instead http://www.unicode.org/reports/tr35/tr35-dates.html#months_days_quarters_eras + cldr.main([ + "dates/calendars/gregorian/days", + [ chr === "c" ? "stand-alone" : "format" ], + "short" + ]) || cldr.main([ + "dates/calendars/gregorian/days", + [ chr === "c" ? "stand-alone" : "format" ], + "abbreviated" + ]); + } else { + cldr.main([ + "dates/calendars/gregorian/days", + [ chr === "c" ? "stand-alone" : "format" ], + widths[ length < 3 ? 0 : length - 3 ] + ]); + } + break; + + // Period (AM or PM) + case "a": + cldr.main([ + "dates/calendars/gregorian/dayPeriods/format/wide" + ]); + break; + + // Zone + case "z": + case "O": + cldr.main( "dates/timeZoneNames/gmtFormat" ); + cldr.main( "dates/timeZoneNames/gmtZeroFormat" ); + cldr.main( "dates/timeZoneNames/hourFormat" ); + break; + + case "v": + case "V": + throw createErrorUnsupportedFeature({ + feature: "timezone pattern `" + chr + "`" + }); + } + }); + + cldr.off( "get", populateProperties ); + + return properties; +}; + + + + +function validateRequiredCldr( path, value ) { + validateCldr( path, value, { + skip: [ + /dates\/calendars\/gregorian\/dateTimeFormats\/availableFormats/, + /dates\/calendars\/gregorian\/days\/.*\/short/, + /supplemental\/timeData\/(?!001)/, + /supplemental\/weekData\/(?!001)/ + ] + }); +} + +/** + * .dateFormatter( options ) + * + * @options [Object] see date/expand_pattern for more info. + * + * Return a date formatter function (of the form below) according to the given options and the + * default/instance locale. + * + * fn( value ) + * + * @value [Date] + * + * Return a function that formats a date according to the given `format` and the default/instance + * locale. + */ +Globalize.dateFormatter = +Globalize.prototype.dateFormatter = function( options ) { + var args, cldr, numberFormatters, pad, pattern, properties, returnFn; + + validateParameterTypePlainObject( options, "options" ); + + cldr = this.cldr; + options = options || { skeleton: "yMd" }; + + args = [ options ]; + + validateDefaultLocale( cldr ); + + cldr.on( "get", validateRequiredCldr ); + pattern = dateExpandPattern( options, cldr ); + properties = dateFormatProperties( pattern, cldr ); + cldr.off( "get", validateRequiredCldr ); + + // Create needed number formatters. + numberFormatters = properties.numberFormatters; + delete properties.numberFormatters; + for ( pad in numberFormatters ) { + numberFormatters[ pad ] = this.numberFormatter({ + raw: numberFormatters[ pad ] + }); + } + + returnFn = dateFormatterFn( numberFormatters, properties ); + + runtimeBind( args, cldr, returnFn, [ numberFormatters, properties ] ); + + return returnFn; +}; + +/** + * .dateParser( options ) + * + * @options [Object] see date/expand_pattern for more info. + * + * Return a function that parses a string date according to the given `formats` and the + * default/instance locale. + */ +Globalize.dateParser = +Globalize.prototype.dateParser = function( options ) { + var args, cldr, numberParser, parseProperties, pattern, tokenizerProperties, returnFn; + + validateParameterTypePlainObject( options, "options" ); + + cldr = this.cldr; + options = options || { skeleton: "yMd" }; + + args = [ options ]; + + validateDefaultLocale( cldr ); + + cldr.on( "get", validateRequiredCldr ); + pattern = dateExpandPattern( options, cldr ); + tokenizerProperties = dateTokenizerProperties( pattern, cldr ); + parseProperties = dateParseProperties( cldr ); + cldr.off( "get", validateRequiredCldr ); + + numberParser = this.numberParser({ raw: "0" }); + + returnFn = dateParserFn( numberParser, parseProperties, tokenizerProperties ); + + runtimeBind( args, cldr, returnFn, [ numberParser, parseProperties, tokenizerProperties ] ); + + return returnFn; +}; + +/** + * .formatDate( value, options ) + * + * @value [Date] + * + * @options [Object] see date/expand_pattern for more info. + * + * Formats a date or number according to the given options string and the default/instance locale. + */ +Globalize.formatDate = +Globalize.prototype.formatDate = function( value, options ) { + validateParameterPresence( value, "value" ); + validateParameterTypeDate( value, "value" ); + + return this.dateFormatter( options )( value ); +}; + +/** + * .parseDate( value, options ) + * + * @value [String] + * + * @options [Object] see date/expand_pattern for more info. + * + * Return a Date instance or null. + */ +Globalize.parseDate = +Globalize.prototype.parseDate = function( value, options ) { + validateParameterPresence( value, "value" ); + validateParameterTypeString( value, "value" ); + + return this.dateParser( options )( value ); +}; + +return Globalize; + + + + +})); diff --git a/StockManMVC/.bin/bower_components/globalize/dist/globalize/message.js b/StockManMVC/.bin/bower_components/globalize/dist/globalize/message.js new file mode 100644 index 0000000..5de252b --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/dist/globalize/message.js @@ -0,0 +1,2076 @@ +/** + * Globalize v1.1.1 + * + * http://github.com/jquery/globalize + * + * Copyright jQuery Foundation and other contributors + * Released under the MIT license + * http://jquery.org/license + * + * Date: 2016-02-04T12:01Z + */ +/*! + * Globalize v1.1.1 2016-02-04T12:01Z Released under the MIT license + * http://git.io/TrdQbw + */ +(function( root, factory ) { + + // UMD returnExports + if ( typeof define === "function" && define.amd ) { + + // AMD + define([ + "cldr", + "../globalize", + "cldr/event" + ], factory ); + } else if ( typeof exports === "object" ) { + + // Node, CommonJS + module.exports = factory( require( "cldrjs" ), require( "globalize" ) ); + } else { + + // Extend global + factory( root.Cldr, root.Globalize ); + } +}(this, function( Cldr, Globalize ) { + +var alwaysArray = Globalize._alwaysArray, + createError = Globalize._createError, + isPlainObject = Globalize._isPlainObject, + runtimeBind = Globalize._runtimeBind, + validateDefaultLocale = Globalize._validateDefaultLocale, + validate = Globalize._validate, + validateParameterPresence = Globalize._validateParameterPresence, + validateParameterType = Globalize._validateParameterType, + validateParameterTypePlainObject = Globalize._validateParameterTypePlainObject; +var MessageFormat; +/* jshint ignore:start */ +MessageFormat = (function() { +MessageFormat._parse = (function() { + + /* + * Generated by PEG.js 0.8.0. + * + * http://pegjs.majda.cz/ + */ + + function peg$subclass(child, parent) { + function ctor() { this.constructor = child; } + ctor.prototype = parent.prototype; + child.prototype = new ctor(); + } + + function SyntaxError(message, expected, found, offset, line, column) { + this.message = message; + this.expected = expected; + this.found = found; + this.offset = offset; + this.line = line; + this.column = column; + + this.name = "SyntaxError"; + } + + peg$subclass(SyntaxError, Error); + + function parse(input) { + var options = arguments.length > 1 ? arguments[1] : {}, + + peg$FAILED = {}, + + peg$startRuleFunctions = { start: peg$parsestart }, + peg$startRuleFunction = peg$parsestart, + + peg$c0 = [], + peg$c1 = function(st) { + return { type: 'messageFormatPattern', statements: st }; + }, + peg$c2 = peg$FAILED, + peg$c3 = "{", + peg$c4 = { type: "literal", value: "{", description: "\"{\"" }, + peg$c5 = null, + peg$c6 = ",", + peg$c7 = { type: "literal", value: ",", description: "\",\"" }, + peg$c8 = "}", + peg$c9 = { type: "literal", value: "}", description: "\"}\"" }, + peg$c10 = function(argIdx, efmt) { + var res = { + type: "messageFormatElement", + argumentIndex: argIdx + }; + if (efmt && efmt.length) { + res.elementFormat = efmt[1]; + } else { + res.output = true; + } + return res; + }, + peg$c11 = "plural", + peg$c12 = { type: "literal", value: "plural", description: "\"plural\"" }, + peg$c13 = function(t, s) { + return { type: "elementFormat", key: t, val: s }; + }, + peg$c14 = "selectordinal", + peg$c15 = { type: "literal", value: "selectordinal", description: "\"selectordinal\"" }, + peg$c16 = "select", + peg$c17 = { type: "literal", value: "select", description: "\"select\"" }, + peg$c18 = function(t, p) { + return { type: "elementFormat", key: t, val: p }; + }, + peg$c19 = function(op, pf) { + return { type: "pluralFormatPattern", pluralForms: pf, offset: op || 0 }; + }, + peg$c20 = "offset", + peg$c21 = { type: "literal", value: "offset", description: "\"offset\"" }, + peg$c22 = ":", + peg$c23 = { type: "literal", value: ":", description: "\":\"" }, + peg$c24 = function(d) { return d; }, + peg$c25 = function(k, mfp) { + return { key: k, val: mfp }; + }, + peg$c26 = function(i) { return i; }, + peg$c27 = "=", + peg$c28 = { type: "literal", value: "=", description: "\"=\"" }, + peg$c29 = function(pf) { return { type: "selectFormatPattern", pluralForms: pf }; }, + peg$c30 = function(p) { return p; }, + peg$c31 = "#", + peg$c32 = { type: "literal", value: "#", description: "\"#\"" }, + peg$c33 = function() { return {type: 'octothorpe'}; }, + peg$c34 = function(s) { return { type: "string", val: s.join('') }; }, + peg$c35 = { type: "other", description: "identifier" }, + peg$c36 = /^[0-9a-zA-Z$_]/, + peg$c37 = { type: "class", value: "[0-9a-zA-Z$_]", description: "[0-9a-zA-Z$_]" }, + peg$c38 = /^[^ \t\n\r,.+={}]/, + peg$c39 = { type: "class", value: "[^ \\t\\n\\r,.+={}]", description: "[^ \\t\\n\\r,.+={}]" }, + peg$c40 = function(s) { return s; }, + peg$c41 = function(chars) { return chars.join(''); }, + peg$c42 = /^[^{}#\\\0-\x1F \t\n\r]/, + peg$c43 = { type: "class", value: "[^{}#\\\\\\0-\\x1F \\t\\n\\r]", description: "[^{}#\\\\\\0-\\x1F \\t\\n\\r]" }, + peg$c44 = function(x) { return x; }, + peg$c45 = "\\\\", + peg$c46 = { type: "literal", value: "\\\\", description: "\"\\\\\\\\\"" }, + peg$c47 = function() { return "\\"; }, + peg$c48 = "\\#", + peg$c49 = { type: "literal", value: "\\#", description: "\"\\\\#\"" }, + peg$c50 = function() { return "#"; }, + peg$c51 = "\\{", + peg$c52 = { type: "literal", value: "\\{", description: "\"\\\\{\"" }, + peg$c53 = function() { return "\u007B"; }, + peg$c54 = "\\}", + peg$c55 = { type: "literal", value: "\\}", description: "\"\\\\}\"" }, + peg$c56 = function() { return "\u007D"; }, + peg$c57 = "\\u", + peg$c58 = { type: "literal", value: "\\u", description: "\"\\\\u\"" }, + peg$c59 = function(h1, h2, h3, h4) { + return String.fromCharCode(parseInt("0x" + h1 + h2 + h3 + h4)); + }, + peg$c60 = /^[0-9]/, + peg$c61 = { type: "class", value: "[0-9]", description: "[0-9]" }, + peg$c62 = function(ds) { + //the number might start with 0 but must not be interpreted as an octal number + //Hence, the base is passed to parseInt explicitely + return parseInt((ds.join('')), 10); + }, + peg$c63 = /^[0-9a-fA-F]/, + peg$c64 = { type: "class", value: "[0-9a-fA-F]", description: "[0-9a-fA-F]" }, + peg$c65 = { type: "other", description: "whitespace" }, + peg$c66 = function(w) { return w.join(''); }, + peg$c67 = /^[ \t\n\r]/, + peg$c68 = { type: "class", value: "[ \\t\\n\\r]", description: "[ \\t\\n\\r]" }, + + peg$currPos = 0, + peg$reportedPos = 0, + peg$cachedPos = 0, + peg$cachedPosDetails = { line: 1, column: 1, seenCR: false }, + peg$maxFailPos = 0, + peg$maxFailExpected = [], + peg$silentFails = 0, + + peg$result; + + if ("startRule" in options) { + if (!(options.startRule in peg$startRuleFunctions)) { + throw new Error("Can't start parsing from rule \"" + options.startRule + "\"."); + } + + peg$startRuleFunction = peg$startRuleFunctions[options.startRule]; + } + + function text() { + return input.substring(peg$reportedPos, peg$currPos); + } + + function offset() { + return peg$reportedPos; + } + + function line() { + return peg$computePosDetails(peg$reportedPos).line; + } + + function column() { + return peg$computePosDetails(peg$reportedPos).column; + } + + function expected(description) { + throw peg$buildException( + null, + [{ type: "other", description: description }], + peg$reportedPos + ); + } + + function error(message) { + throw peg$buildException(message, null, peg$reportedPos); + } + + function peg$computePosDetails(pos) { + function advance(details, startPos, endPos) { + var p, ch; + + for (p = startPos; p < endPos; p++) { + ch = input.charAt(p); + if (ch === "\n") { + if (!details.seenCR) { details.line++; } + details.column = 1; + details.seenCR = false; + } else if (ch === "\r" || ch === "\u2028" || ch === "\u2029") { + details.line++; + details.column = 1; + details.seenCR = true; + } else { + details.column++; + details.seenCR = false; + } + } + } + + if (peg$cachedPos !== pos) { + if (peg$cachedPos > pos) { + peg$cachedPos = 0; + peg$cachedPosDetails = { line: 1, column: 1, seenCR: false }; + } + advance(peg$cachedPosDetails, peg$cachedPos, pos); + peg$cachedPos = pos; + } + + return peg$cachedPosDetails; + } + + function peg$fail(expected) { + if (peg$currPos < peg$maxFailPos) { return; } + + if (peg$currPos > peg$maxFailPos) { + peg$maxFailPos = peg$currPos; + peg$maxFailExpected = []; + } + + peg$maxFailExpected.push(expected); + } + + function peg$buildException(message, expected, pos) { + function cleanupExpected(expected) { + var i = 1; + + expected.sort(function(a, b) { + if (a.description < b.description) { + return -1; + } else if (a.description > b.description) { + return 1; + } else { + return 0; + } + }); + + while (i < expected.length) { + if (expected[i - 1] === expected[i]) { + expected.splice(i, 1); + } else { + i++; + } + } + } + + function buildMessage(expected, found) { + function stringEscape(s) { + function hex(ch) { return ch.charCodeAt(0).toString(16).toUpperCase(); } + + return s + .replace(/\\/g, '\\\\') + .replace(/"/g, '\\"') + .replace(/\x08/g, '\\b') + .replace(/\t/g, '\\t') + .replace(/\n/g, '\\n') + .replace(/\f/g, '\\f') + .replace(/\r/g, '\\r') + .replace(/[\x00-\x07\x0B\x0E\x0F]/g, function(ch) { return '\\x0' + hex(ch); }) + .replace(/[\x10-\x1F\x80-\xFF]/g, function(ch) { return '\\x' + hex(ch); }) + .replace(/[\u0180-\u0FFF]/g, function(ch) { return '\\u0' + hex(ch); }) + .replace(/[\u1080-\uFFFF]/g, function(ch) { return '\\u' + hex(ch); }); + } + + var expectedDescs = new Array(expected.length), + expectedDesc, foundDesc, i; + + for (i = 0; i < expected.length; i++) { + expectedDescs[i] = expected[i].description; + } + + expectedDesc = expected.length > 1 + ? expectedDescs.slice(0, -1).join(", ") + + " or " + + expectedDescs[expected.length - 1] + : expectedDescs[0]; + + foundDesc = found ? "\"" + stringEscape(found) + "\"" : "end of input"; + + return "Expected " + expectedDesc + " but " + foundDesc + " found."; + } + + var posDetails = peg$computePosDetails(pos), + found = pos < input.length ? input.charAt(pos) : null; + + if (expected !== null) { + cleanupExpected(expected); + } + + return new SyntaxError( + message !== null ? message : buildMessage(expected, found), + expected, + found, + pos, + posDetails.line, + posDetails.column + ); + } + + function peg$parsestart() { + var s0; + + s0 = peg$parsemessageFormatPattern(); + + return s0; + } + + function peg$parsemessageFormatPattern() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsemessageFormatElement(); + if (s2 === peg$FAILED) { + s2 = peg$parsestring(); + if (s2 === peg$FAILED) { + s2 = peg$parseoctothorpe(); + } + } + while (s2 !== peg$FAILED) { + s1.push(s2); + s2 = peg$parsemessageFormatElement(); + if (s2 === peg$FAILED) { + s2 = peg$parsestring(); + if (s2 === peg$FAILED) { + s2 = peg$parseoctothorpe(); + } + } + } + if (s1 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c1(s1); + } + s0 = s1; + + return s0; + } + + function peg$parsemessageFormatElement() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 123) { + s1 = peg$c3; + peg$currPos++; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c4); } + } + if (s1 !== peg$FAILED) { + s2 = peg$parse_(); + if (s2 !== peg$FAILED) { + s3 = peg$parseid(); + if (s3 !== peg$FAILED) { + s4 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 44) { + s5 = peg$c6; + peg$currPos++; + } else { + s5 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c7); } + } + if (s5 !== peg$FAILED) { + s6 = peg$parseelementFormat(); + if (s6 !== peg$FAILED) { + s5 = [s5, s6]; + s4 = s5; + } else { + peg$currPos = s4; + s4 = peg$c2; + } + } else { + peg$currPos = s4; + s4 = peg$c2; + } + if (s4 === peg$FAILED) { + s4 = peg$c5; + } + if (s4 !== peg$FAILED) { + s5 = peg$parse_(); + if (s5 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 125) { + s6 = peg$c8; + peg$currPos++; + } else { + s6 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c9); } + } + if (s6 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c10(s3, s4); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + + return s0; + } + + function peg$parseelementFormat() { + var s0, s1, s2, s3, s4, s5, s6, s7; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== peg$FAILED) { + if (input.substr(peg$currPos, 6) === peg$c11) { + s2 = peg$c11; + peg$currPos += 6; + } else { + s2 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c12); } + } + if (s2 !== peg$FAILED) { + s3 = peg$parse_(); + if (s3 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 44) { + s4 = peg$c6; + peg$currPos++; + } else { + s4 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c7); } + } + if (s4 !== peg$FAILED) { + s5 = peg$parse_(); + if (s5 !== peg$FAILED) { + s6 = peg$parsepluralFormatPattern(); + if (s6 !== peg$FAILED) { + s7 = peg$parse_(); + if (s7 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c13(s2, s6); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + if (s0 === peg$FAILED) { + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== peg$FAILED) { + if (input.substr(peg$currPos, 13) === peg$c14) { + s2 = peg$c14; + peg$currPos += 13; + } else { + s2 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c15); } + } + if (s2 !== peg$FAILED) { + s3 = peg$parse_(); + if (s3 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 44) { + s4 = peg$c6; + peg$currPos++; + } else { + s4 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c7); } + } + if (s4 !== peg$FAILED) { + s5 = peg$parse_(); + if (s5 !== peg$FAILED) { + s6 = peg$parsepluralFormatPattern(); + if (s6 !== peg$FAILED) { + s7 = peg$parse_(); + if (s7 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c13(s2, s6); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + if (s0 === peg$FAILED) { + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== peg$FAILED) { + if (input.substr(peg$currPos, 6) === peg$c16) { + s2 = peg$c16; + peg$currPos += 6; + } else { + s2 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c17); } + } + if (s2 !== peg$FAILED) { + s3 = peg$parse_(); + if (s3 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 44) { + s4 = peg$c6; + peg$currPos++; + } else { + s4 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c7); } + } + if (s4 !== peg$FAILED) { + s5 = peg$parse_(); + if (s5 !== peg$FAILED) { + s6 = peg$parseselectFormatPattern(); + if (s6 !== peg$FAILED) { + s7 = peg$parse_(); + if (s7 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c13(s2, s6); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + if (s0 === peg$FAILED) { + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== peg$FAILED) { + s2 = peg$parseid(); + if (s2 !== peg$FAILED) { + s3 = []; + s4 = peg$parseargStylePattern(); + while (s4 !== peg$FAILED) { + s3.push(s4); + s4 = peg$parseargStylePattern(); + } + if (s3 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c18(s2, s3); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } + } + } + + return s0; + } + + function peg$parsepluralFormatPattern() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parseoffsetPattern(); + if (s1 === peg$FAILED) { + s1 = peg$c5; + } + if (s1 !== peg$FAILED) { + s2 = []; + s3 = peg$parsepluralForm(); + if (s3 !== peg$FAILED) { + while (s3 !== peg$FAILED) { + s2.push(s3); + s3 = peg$parsepluralForm(); + } + } else { + s2 = peg$c2; + } + if (s2 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c19(s1, s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + + return s0; + } + + function peg$parseoffsetPattern() { + var s0, s1, s2, s3, s4, s5, s6, s7; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== peg$FAILED) { + if (input.substr(peg$currPos, 6) === peg$c20) { + s2 = peg$c20; + peg$currPos += 6; + } else { + s2 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c21); } + } + if (s2 !== peg$FAILED) { + s3 = peg$parse_(); + if (s3 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 58) { + s4 = peg$c22; + peg$currPos++; + } else { + s4 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c23); } + } + if (s4 !== peg$FAILED) { + s5 = peg$parse_(); + if (s5 !== peg$FAILED) { + s6 = peg$parsedigits(); + if (s6 !== peg$FAILED) { + s7 = peg$parse_(); + if (s7 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c24(s6); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + + return s0; + } + + function peg$parsepluralForm() { + var s0, s1, s2, s3, s4, s5, s6, s7, s8; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== peg$FAILED) { + s2 = peg$parsepluralKey(); + if (s2 !== peg$FAILED) { + s3 = peg$parse_(); + if (s3 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 123) { + s4 = peg$c3; + peg$currPos++; + } else { + s4 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c4); } + } + if (s4 !== peg$FAILED) { + s5 = peg$parse_(); + if (s5 !== peg$FAILED) { + s6 = peg$parsemessageFormatPattern(); + if (s6 !== peg$FAILED) { + s7 = peg$parse_(); + if (s7 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 125) { + s8 = peg$c8; + peg$currPos++; + } else { + s8 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c9); } + } + if (s8 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c25(s2, s6); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + + return s0; + } + + function peg$parsepluralKey() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parseid(); + if (s1 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c26(s1); + } + s0 = s1; + if (s0 === peg$FAILED) { + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61) { + s1 = peg$c27; + peg$currPos++; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c28); } + } + if (s1 !== peg$FAILED) { + s2 = peg$parsedigits(); + if (s2 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c24(s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } + + return s0; + } + + function peg$parseselectFormatPattern() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parseselectForm(); + if (s2 !== peg$FAILED) { + while (s2 !== peg$FAILED) { + s1.push(s2); + s2 = peg$parseselectForm(); + } + } else { + s1 = peg$c2; + } + if (s1 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c29(s1); + } + s0 = s1; + + return s0; + } + + function peg$parseselectForm() { + var s0, s1, s2, s3, s4, s5, s6, s7, s8; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== peg$FAILED) { + s2 = peg$parseid(); + if (s2 !== peg$FAILED) { + s3 = peg$parse_(); + if (s3 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 123) { + s4 = peg$c3; + peg$currPos++; + } else { + s4 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c4); } + } + if (s4 !== peg$FAILED) { + s5 = peg$parse_(); + if (s5 !== peg$FAILED) { + s6 = peg$parsemessageFormatPattern(); + if (s6 !== peg$FAILED) { + s7 = peg$parse_(); + if (s7 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 125) { + s8 = peg$c8; + peg$currPos++; + } else { + s8 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c9); } + } + if (s8 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c25(s2, s6); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + + return s0; + } + + function peg$parseargStylePattern() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 44) { + s2 = peg$c6; + peg$currPos++; + } else { + s2 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c7); } + } + if (s2 !== peg$FAILED) { + s3 = peg$parse_(); + if (s3 !== peg$FAILED) { + s4 = peg$parseid(); + if (s4 !== peg$FAILED) { + s5 = peg$parse_(); + if (s5 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c30(s4); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + + return s0; + } + + function peg$parseoctothorpe() { + var s0, s1; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 35) { + s1 = peg$c31; + peg$currPos++; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c32); } + } + if (s1 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c33(); + } + s0 = s1; + + return s0; + } + + function peg$parsestring() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsechars(); + if (s2 === peg$FAILED) { + s2 = peg$parsewhitespace(); + } + if (s2 !== peg$FAILED) { + while (s2 !== peg$FAILED) { + s1.push(s2); + s2 = peg$parsechars(); + if (s2 === peg$FAILED) { + s2 = peg$parsewhitespace(); + } + } + } else { + s1 = peg$c2; + } + if (s1 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c34(s1); + } + s0 = s1; + + return s0; + } + + function peg$parseid() { + var s0, s1, s2, s3, s4, s5, s6; + + peg$silentFails++; + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== peg$FAILED) { + s2 = peg$currPos; + s3 = peg$currPos; + if (peg$c36.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c37); } + } + if (s4 !== peg$FAILED) { + s5 = []; + if (peg$c38.test(input.charAt(peg$currPos))) { + s6 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s6 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c39); } + } + while (s6 !== peg$FAILED) { + s5.push(s6); + if (peg$c38.test(input.charAt(peg$currPos))) { + s6 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s6 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c39); } + } + } + if (s5 !== peg$FAILED) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c2; + } + } else { + peg$currPos = s3; + s3 = peg$c2; + } + if (s3 !== peg$FAILED) { + s3 = input.substring(s2, peg$currPos); + } + s2 = s3; + if (s2 !== peg$FAILED) { + s3 = peg$parse_(); + if (s3 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c40(s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + peg$silentFails--; + if (s0 === peg$FAILED) { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c35); } + } + + return s0; + } + + function peg$parsechars() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsechar(); + if (s2 !== peg$FAILED) { + while (s2 !== peg$FAILED) { + s1.push(s2); + s2 = peg$parsechar(); + } + } else { + s1 = peg$c2; + } + if (s1 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c41(s1); + } + s0 = s1; + + return s0; + } + + function peg$parsechar() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + if (peg$c42.test(input.charAt(peg$currPos))) { + s1 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c43); } + } + if (s1 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c44(s1); + } + s0 = s1; + if (s0 === peg$FAILED) { + s0 = peg$currPos; + if (input.substr(peg$currPos, 2) === peg$c45) { + s1 = peg$c45; + peg$currPos += 2; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c46); } + } + if (s1 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c47(); + } + s0 = s1; + if (s0 === peg$FAILED) { + s0 = peg$currPos; + if (input.substr(peg$currPos, 2) === peg$c48) { + s1 = peg$c48; + peg$currPos += 2; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c49); } + } + if (s1 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c50(); + } + s0 = s1; + if (s0 === peg$FAILED) { + s0 = peg$currPos; + if (input.substr(peg$currPos, 2) === peg$c51) { + s1 = peg$c51; + peg$currPos += 2; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c52); } + } + if (s1 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c53(); + } + s0 = s1; + if (s0 === peg$FAILED) { + s0 = peg$currPos; + if (input.substr(peg$currPos, 2) === peg$c54) { + s1 = peg$c54; + peg$currPos += 2; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c55); } + } + if (s1 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c56(); + } + s0 = s1; + if (s0 === peg$FAILED) { + s0 = peg$currPos; + if (input.substr(peg$currPos, 2) === peg$c57) { + s1 = peg$c57; + peg$currPos += 2; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c58); } + } + if (s1 !== peg$FAILED) { + s2 = peg$parsehexDigit(); + if (s2 !== peg$FAILED) { + s3 = peg$parsehexDigit(); + if (s3 !== peg$FAILED) { + s4 = peg$parsehexDigit(); + if (s4 !== peg$FAILED) { + s5 = peg$parsehexDigit(); + if (s5 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c59(s2, s3, s4, s5); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } + } + } + } + } + + return s0; + } + + function peg$parsedigits() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + if (peg$c60.test(input.charAt(peg$currPos))) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c61); } + } + if (s2 !== peg$FAILED) { + while (s2 !== peg$FAILED) { + s1.push(s2); + if (peg$c60.test(input.charAt(peg$currPos))) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c61); } + } + } + } else { + s1 = peg$c2; + } + if (s1 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c62(s1); + } + s0 = s1; + + return s0; + } + + function peg$parsehexDigit() { + var s0; + + if (peg$c63.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c64); } + } + + return s0; + } + + function peg$parse_() { + var s0, s1, s2; + + peg$silentFails++; + s0 = peg$currPos; + s1 = []; + s2 = peg$parsewhitespace(); + while (s2 !== peg$FAILED) { + s1.push(s2); + s2 = peg$parsewhitespace(); + } + if (s1 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c66(s1); + } + s0 = s1; + peg$silentFails--; + if (s0 === peg$FAILED) { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c65); } + } + + return s0; + } + + function peg$parsewhitespace() { + var s0; + + if (peg$c67.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c68); } + } + + return s0; + } + + peg$result = peg$startRuleFunction(); + + if (peg$result !== peg$FAILED && peg$currPos === input.length) { + return peg$result; + } else { + if (peg$result !== peg$FAILED && peg$currPos < input.length) { + peg$fail({ type: "end", description: "end of input" }); + } + + throw peg$buildException(null, peg$maxFailExpected, peg$maxFailPos); + } + } + + return { + SyntaxError: SyntaxError, + parse: parse + }; +}()).parse; + + +/** @file messageformat.js - ICU PluralFormat + SelectFormat for JavaScript + * @author Alex Sexton - @SlexAxton + * @version 0.3.0-1 + * @copyright 2012-2015 Alex Sexton, Eemeli Aro, and Contributors + * @license To use or fork, MIT. To contribute back, Dojo CLA */ + + +/** Utility function for quoting an Object's key value iff required + * @private */ +function propname(key, obj) { + if (/^[A-Z_$][0-9A-Z_$]*$/i.test(key)) { + return obj ? obj + '.' + key : key; + } else { + var jkey = JSON.stringify(key); + return obj ? obj + '[' + jkey + ']' : jkey; + } +}; + + +/** Create a new message formatter + * + * @class + * @global + * @param {string|string[]} [locale="en"] - The locale to use, with fallbacks + * @param {function} [pluralFunc] - Optional custom pluralization function + * @param {function[]} [formatters] - Optional custom formatting functions */ +function MessageFormat(locale, pluralFunc, formatters) { + this.lc = [locale]; + this.runtime.pluralFuncs = {}; + this.runtime.pluralFuncs[this.lc[0]] = pluralFunc; + this.runtime.fmt = {}; + if (formatters) for (var f in formatters) { + this.runtime.fmt[f] = formatters[f]; + } +} + + + + +/** Parse an input string to its AST + * + * Precompiled from `lib/messageformat-parser.pegjs` by + * {@link http://pegjs.org/ PEG.js}. Included in MessageFormat object + * to enable testing. + * + * @private */ + + + +/** Pluralization functions from + * {@link http://github.com/eemeli/make-plural.js make-plural} + * + * @memberof MessageFormat + * @type Object. */ +MessageFormat.plurals = {}; + + +/** Default number formatting functions in the style of ICU's + * {@link http://icu-project.org/apiref/icu4j/com/ibm/icu/text/MessageFormat.html simpleArg syntax} + * implemented using the + * {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl Intl} + * object defined by ECMA-402. + * + * **Note**: Intl is not defined in default Node until 0.11.15 / 0.12.0, so + * earlier versions require a {@link https://www.npmjs.com/package/intl polyfill}. + * Therefore {@link MessageFormat.withIntlSupport} needs to be true for these + * functions to be available for inclusion in the output. + * + * @see MessageFormat#setIntlSupport + * + * @namespace + * @memberof MessageFormat + * @property {function} number - Represent a number as an integer, percent or currency value + * @property {function} date - Represent a date as a full/long/default/short string + * @property {function} time - Represent a time as a full/long/default/short string + * + * @example + * > var MessageFormat = require('messageformat'); + * > var mf = (new MessageFormat('en')).setIntlSupport(true); + * > mf.currency = 'EUR'; + * > var mfunc = mf.compile("The total is {V,number,currency}."); + * > mfunc({V:5.5}) + * "The total is €5.50." + * + * @example + * > var MessageFormat = require('messageformat'); + * > var mf = new MessageFormat('en', null, {number: MessageFormat.number}); + * > mf.currency = 'EUR'; + * > var mfunc = mf.compile("The total is {V,number,currency}."); + * > mfunc({V:5.5}) + * "The total is €5.50." */ +MessageFormat.formatters = {}; + +/** Enable or disable support for the default formatters, which require the + * `Intl` object. Note that this can't be autodetected, as the environment + * in which the formatted text is compiled into Javascript functions is not + * necessarily the same environment in which they will get executed. + * + * @see MessageFormat.formatters + * + * @memberof MessageFormat + * @param {boolean} [enable=true] + * @returns {Object} The MessageFormat instance, to allow for chaining + * @example + * > var Intl = require('intl'); + * > var MessageFormat = require('messageformat'); + * > var mf = (new MessageFormat('en')).setIntlSupport(true); + * > mf.currency = 'EUR'; + * > mf.compile("The total is {V,number,currency}.")({V:5.5}); + * "The total is €5.50." */ + + + +/** A set of utility functions that are called by the compiled Javascript + * functions, these are included locally in the output of {@link + * MessageFormat#compile compile()}. + * + * @namespace + * @memberof MessageFormat */ +MessageFormat.prototype.runtime = { + + /** Utility function for `#` in plural rules + * + * @param {number} value - The value to operate on + * @param {number} [offset=0] - An optional offset, set by the surrounding context */ + number: function(value, offset) { + if (isNaN(value)) throw new Error("'" + value + "' isn't a number."); + return value - (offset || 0); + }, + + /** Utility function for `{N, plural|selectordinal, ...}` + * + * @param {number} value - The key to use to find a pluralization rule + * @param {number} offset - An offset to apply to `value` + * @param {function} lcfunc - A locale function from `pluralFuncs` + * @param {Object.} data - The object from which results are looked up + * @param {?boolean} isOrdinal - If true, use ordinal rather than cardinal rules + * @returns {string} The result of the pluralization */ + plural: function(value, offset, lcfunc, data, isOrdinal) { + if ({}.hasOwnProperty.call(data, value)) return data[value](); + if (offset) value -= offset; + var key = lcfunc(value, isOrdinal); + if (key in data) return data[key](); + return data.other(); + }, + + /** Utility function for `{N, select, ...}` + * + * @param {number} value - The key to use to find a selection + * @param {Object.} data - The object from which results are looked up + * @returns {string} The result of the select statement */ + select: function(value, data) { + if ({}.hasOwnProperty.call(data, value)) return data[value](); + return data.other() + }, + + /** Pluralization functions included in compiled output + * @instance + * @type Object. */ + pluralFuncs: {}, + + /** Custom formatting functions called by `{var, fn[, args]*}` syntax + * + * For examples, see {@link MessageFormat.formatters} + * + * @instance + * @see MessageFormat.formatters + * @type Object. */ + fmt: {}, + + /** Custom stringifier to clean up browser inconsistencies + * @instance */ + toString: function () { + var _stringify = function(o, level) { + if (typeof o != 'object') { + var funcStr = o.toString().replace(/^(function )\w*/, '$1'); + var indent = /([ \t]*)\S.*$/.exec(funcStr); + return indent ? funcStr.replace(new RegExp('^' + indent[1], 'mg'), '') : funcStr; + } + var s = []; + for (var i in o) if (i != 'toString') { + if (level == 0) s.push('var ' + i + ' = ' + _stringify(o[i], level + 1) + ';\n'); + else s.push(propname(i) + ': ' + _stringify(o[i], level + 1)); + } + if (level == 0) return s.join(''); + if (s.length == 0) return '{}'; + var indent = ' '; while (--level) indent += ' '; + return '{\n' + s.join(',\n').replace(/^/gm, indent) + '\n}'; + }; + return _stringify(this, 0); + } +}; + + +/** Recursively map an AST to its resulting string + * + * @memberof MessageFormat + * + * @param ast - the Ast node for which the JS code should be generated + * + * @private */ +MessageFormat.prototype._precompile = function(ast, data) { + data = data || { keys: {}, offset: {} }; + var r = [], i, tmp, args = []; + + switch ( ast.type ) { + case 'messageFormatPattern': + for ( i = 0; i < ast.statements.length; ++i ) { + r.push(this._precompile( ast.statements[i], data )); + } + tmp = r.join(' + ') || '""'; + return data.pf_count ? tmp : 'function(d) { return ' + tmp + '; }'; + + case 'messageFormatElement': + data.pf_count = data.pf_count || 0; + if ( ast.output ) { + return propname(ast.argumentIndex, 'd'); + } + else { + data.keys[data.pf_count] = ast.argumentIndex; + return this._precompile( ast.elementFormat, data ); + } + return ''; + + case 'elementFormat': + args = [ propname(data.keys[data.pf_count], 'd') ]; + switch (ast.key) { + case 'select': + args.push(this._precompile(ast.val, data)); + return 'select(' + args.join(', ') + ')'; + case 'selectordinal': + args = args.concat([ 0, propname(this.lc[0], 'pluralFuncs'), this._precompile(ast.val, data), 1 ]); + return 'plural(' + args.join(', ') + ')'; + case 'plural': + data.offset[data.pf_count || 0] = ast.val.offset || 0; + args = args.concat([ data.offset[data.pf_count] || 0, propname(this.lc[0], 'pluralFuncs'), this._precompile(ast.val, data) ]); + return 'plural(' + args.join(', ') + ')'; + default: + if (this.withIntlSupport && !(ast.key in this.runtime.fmt) && (ast.key in MessageFormat.formatters)) { + tmp = MessageFormat.formatters[ast.key]; + this.runtime.fmt[ast.key] = (typeof tmp(this) == 'function') ? tmp(this) : tmp; + } + args.push(JSON.stringify(this.lc)); + if (ast.val && ast.val.length) args.push(JSON.stringify(ast.val.length == 1 ? ast.val[0] : ast.val)); + return 'fmt.' + ast.key + '(' + args.join(', ') + ')'; + } + + case 'pluralFormatPattern': + case 'selectFormatPattern': + data.pf_count = data.pf_count || 0; + if (ast.type == 'selectFormatPattern') data.offset[data.pf_count] = 0; + var needOther = true; + for (i = 0; i < ast.pluralForms.length; ++i) { + var key = ast.pluralForms[i].key; + if (key === 'other') needOther = false; + var data_copy = JSON.parse(JSON.stringify(data)); + data_copy.pf_count++; + r.push(propname(key) + ': function() { return ' + this._precompile(ast.pluralForms[i].val, data_copy) + ';}'); + } + if (needOther) throw new Error("No 'other' form found in " + ast.type + " " + data.pf_count); + return '{ ' + r.join(', ') + ' }'; + + case 'string': + return JSON.stringify(ast.val || ""); + + case 'octothorpe': + if (!data.pf_count) return '"#"'; + args = [ propname(data.keys[data.pf_count-1], 'd') ]; + if (data.offset[data.pf_count-1]) args.push(data.offset[data.pf_count-1]); + return 'number(' + args.join(', ') + ')'; + + default: + throw new Error( 'Bad AST type: ' + ast.type ); + } +}; + +/** Compile messages into an executable function with clean string + * representation. + * + * If `messages` is a single string including ICU MessageFormat declarations, + * `opt` is ignored and the returned function takes a single Object parameter + * `d` representing each of the input's defined variables. The returned + * function will be defined in a local scope that includes all the required + * runtime variables. + * + * If `messages` is a map of keys to strings, or a map of namespace keys to + * such key/string maps, the returned function will fill the specified global + * with javascript functions matching the structure of the input. In such use, + * the output of `compile()` is expected to be serialized using `.toString()`, + * and will include definitions of the runtime functions. If `opt.global` is + * null, calling the output function will return the object itself. + * + * Together, the input parameters should match the following patterns: + * ```js + * messages = "string" || { key0: "string0", key1: "string1", ... } || { + * ns0: { key0: "string0", key1: "string1", ... }, + * ns1: { key0: "string0", key1: "string1", ... }, + * ... + * } + * + * opt = null || { + * locale: null || { + * ns0: "lc0" || [ "lc0", ... ], + * ns1: "lc1" || [ "lc1", ... ], + * ... + * }, + * global: null || "module.exports" || "exports" || "i18n" || ... + * } + * ``` + * + * @memberof MessageFormat + * @param {string|Object} + * messages - The input message(s) to be compiled, in ICU MessageFormat + * @param {Object} [opt={}] - Options controlling output for non-simple intput + * @param {Object} [opt.locale] - The locales to use for the messages, with a + * structure matching that of `messages` + * @param {string} [opt.global=""] - The global variable that the output + * function should use, or a null string for none. "exports" and + * "module.exports" are recognised as special cases. + * @returns {function} The first match found for the given locale(s) + * + * @example + * > var MessageFormat = require('messageformat'), + * ... mf = new MessageFormat('en'), + * ... mfunc0 = mf.compile('A {TYPE} example.'); + * > mfunc0({TYPE:'simple'}) + * 'A simple example.' + * > mfunc0.toString() + * 'function (d) { return "A " + d.TYPE + " example."; }' + * + * @example + * > var msgSet = { a: 'A {TYPE} example.', + * ... b: 'This has {COUNT, plural, one{one member} other{# members}}.' }, + * ... mfuncSet = mf.compile(msgSet); + * > mfuncSet().a({TYPE:'more complex'}) + * 'A more complex example.' + * > mfuncSet().b({COUNT:2}) + * 'This has 2 members.' + * + * > console.log(mfuncSet.toString()) + * function anonymous() { + * var number = function (value, offset) { + * if (isNaN(value)) throw new Error("'" + value + "' isn't a number."); + * return value - (offset || 0); + * }; + * var plural = function (value, offset, lcfunc, data, isOrdinal) { + * if ({}.hasOwnProperty.call(data, value)) return data[value](); + * if (offset) value -= offset; + * var key = lcfunc(value, isOrdinal); + * if (key in data) return data[key](); + * return data.other(); + * }; + * var select = function (value, data) { + * if ({}.hasOwnProperty.call(data, value)) return data[value](); + * return data.other() + * }; + * var pluralFuncs = { + * en: function (n, ord) { + * var s = String(n).split('.'), v0 = !s[1], t0 = Number(s[0]) == n, + * n10 = t0 && s[0].slice(-1), n100 = t0 && s[0].slice(-2); + * if (ord) return (n10 == 1 && n100 != 11) ? 'one' + * : (n10 == 2 && n100 != 12) ? 'two' + * : (n10 == 3 && n100 != 13) ? 'few' + * : 'other'; + * return (n == 1 && v0) ? 'one' : 'other'; + * } + * }; + * var fmt = {}; + * + * return { + * a: function(d) { return "A " + d.TYPE + " example."; }, + * b: function(d) { return "This has " + plural(d.COUNT, 0, pluralFuncs.en, { one: function() { return "one member";}, other: function() { return number(d.COUNT)+" members";} }) + "."; } + * } + * } + * + * @example + * > mf.runtime.pluralFuncs.fi = MessageFormat.plurals.fi; + * > var multiSet = { en: { a: 'A {TYPE} example.', + * ... b: 'This is the {COUNT, selectordinal, one{#st} two{#nd} few{#rd} other{#th}} example.' }, + * ... fi: { a: '{TYPE} esimerkki.', + * ... b: 'Tämä on {COUNT, selectordinal, other{#.}} esimerkki.' } }, + * ... multiSetLocales = { en: 'en', fi: 'fi' }, + * ... mfuncSet = mf.compile(multiSet, { locale: multiSetLocales, global: 'i18n' }); + * > mfuncSet(this); + * > i18n.en.b({COUNT:3}) + * 'This is the 3rd example.' + * > i18n.fi.b({COUNT:3}) + * 'Tämä on 3. esimerkki.' */ +MessageFormat.prototype.compile = function ( messages, opt ) { + var r = {}, lc0 = this.lc, + compileMsg = function(self, msg) { + try { + var ast = MessageFormat._parse(msg); + return self._precompile(ast); + } catch (e) { + throw new Error((ast ? 'Precompiler' : 'Parser') + ' error: ' + e.toString()); + } + }, + stringify = function(r, level) { + if (!level) level = 0; + if (typeof r != 'object') return r; + var o = [], indent = ''; + for (var i = 0; i < level; ++i) indent += ' '; + for (var k in r) o.push('\n' + indent + ' ' + propname(k) + ': ' + stringify(r[k], level + 1)); + return '{' + o.join(',') + '\n' + indent + '}'; + }; + + if (typeof messages == 'string') { + var f = new Function( + 'number, plural, select, pluralFuncs, fmt', + 'return ' + compileMsg(this, messages)); + return f(this.runtime.number, this.runtime.plural, this.runtime.select, + this.runtime.pluralFuncs, this.runtime.fmt); + } + + opt = opt || {}; + + for (var ns in messages) { + if (opt.locale) this.lc = opt.locale[ns] && [].concat(opt.locale[ns]) || lc0; + if (typeof messages[ns] == 'string') { + try { r[ns] = compileMsg(this, messages[ns]); } + catch (e) { e.message = e.message.replace(':', ' with `' + ns + '`:'); throw e; } + } else { + r[ns] = {}; + for (var key in messages[ns]) { + try { r[ns][key] = compileMsg(this, messages[ns][key]); } + catch (e) { e.message = e.message.replace(':', ' with `' + key + '` in `' + ns + '`:'); throw e; } + } + } + } + + this.lc = lc0; + var s = this.runtime.toString() + '\n'; + switch (opt.global || '') { + case 'exports': + var o = []; + for (var k in r) o.push(propname(k, 'exports') + ' = ' + stringify(r[k])); + return new Function(s + o.join(';\n')); + case 'module.exports': + return new Function(s + 'module.exports = ' + stringify(r)); + case '': + return new Function(s + 'return ' + stringify(r)); + default: + return new Function('G', s + propname(opt.global, 'G') + ' = ' + stringify(r)); + } +}; + + +return MessageFormat; +}()); +/* jshint ignore:end */ + + +var createErrorPluralModulePresence = function() { + return createError( "E_MISSING_PLURAL_MODULE", "Plural module not loaded." ); +}; + + + + +var validateMessageBundle = function( cldr ) { + validate( + "E_MISSING_MESSAGE_BUNDLE", + "Missing message bundle for locale `{locale}`.", + cldr.attributes.bundle && cldr.get( "globalize-messages/{bundle}" ) !== undefined, + { + locale: cldr.locale + } + ); +}; + + + + +var validateMessagePresence = function( path, value ) { + path = path.join( "/" ); + validate( "E_MISSING_MESSAGE", "Missing required message content `{path}`.", + value !== undefined, { path: path } ); +}; + + + + +var validateMessageType = function( path, value ) { + path = path.join( "/" ); + validate( + "E_INVALID_MESSAGE", + "Invalid message content `{path}`. {expected} expected.", + typeof value === "string", + { + expected: "a string", + path: path + } + ); +}; + + + + +var validateParameterTypeMessageVariables = function( value, name ) { + validateParameterType( + value, + name, + value === undefined || isPlainObject( value ) || Array.isArray( value ), + "Array or Plain Object" + ); +}; + + + + +var messageFormatterFn = function( formatter ) { + return function messageFormatter( variables ) { + if ( typeof variables === "number" || typeof variables === "string" ) { + variables = [].slice.call( arguments, 0 ); + } + validateParameterTypeMessageVariables( variables, "variables" ); + return formatter( variables ); + }; +}; + + + + +var messageFormatterRuntimeBind = function( cldr, messageformatter ) { + var locale = cldr.locale, + origToString = messageformatter.toString; + + messageformatter.toString = function() { + var argNames, argValues, output, + args = {}; + + // Properly adjust SlexAxton/messageformat.js compiled variables with Globalize variables: + output = origToString.call( messageformatter ); + + if ( /number\(/.test( output ) ) { + args.number = "messageFormat.number"; + } + + if ( /plural\(/.test( output ) ) { + args.plural = "messageFormat.plural"; + } + + if ( /select\(/.test( output ) ) { + args.select = "messageFormat.select"; + } + + output.replace( /pluralFuncs(\[([^\]]+)\]|\.([a-zA-Z]+))/, function( match ) { + args.pluralFuncs = "{" + + "\"" + locale + "\": Globalize(\"" + locale + "\").pluralGenerator()" + + "}"; + return match; + }); + + argNames = Object.keys( args ).join( ", " ); + argValues = Object.keys( args ).map(function( key ) { + return args[ key ]; + }).join( ", " ); + + return "(function( " + argNames + " ) {\n" + + " return " + output + "\n" + + "})(" + argValues + ")"; + }; + + return messageformatter; +}; + + + + +var slice = [].slice; + +/** + * .loadMessages( json ) + * + * @json [JSON] + * + * Load translation data. + */ +Globalize.loadMessages = function( json ) { + var locale, + customData = { + "globalize-messages": json, + "main": {} + }; + + validateParameterPresence( json, "json" ); + validateParameterTypePlainObject( json, "json" ); + + // Set available bundles by populating customData main dataset. + for ( locale in json ) { + if ( json.hasOwnProperty( locale ) ) { + customData.main[ locale ] = {}; + } + } + + Cldr.load( customData ); +}; + +/** + * .messageFormatter( path ) + * + * @path [String or Array] + * + * Format a message given its path. + */ +Globalize.messageFormatter = +Globalize.prototype.messageFormatter = function( path ) { + var cldr, formatter, message, pluralGenerator, returnFn, + args = slice.call( arguments, 0 ); + + validateParameterPresence( path, "path" ); + validateParameterType( path, "path", typeof path === "string" || Array.isArray( path ), + "a String nor an Array" ); + + path = alwaysArray( path ); + cldr = this.cldr; + + validateDefaultLocale( cldr ); + validateMessageBundle( cldr ); + + message = cldr.get( [ "globalize-messages/{bundle}" ].concat( path ) ); + validateMessagePresence( path, message ); + + // If message is an Array, concatenate it. + if ( Array.isArray( message ) ) { + message = message.join( " " ); + } + validateMessageType( path, message ); + + // Is plural module present? Yes, use its generator. Nope, use an error generator. + pluralGenerator = this.plural !== undefined ? + this.pluralGenerator() : + createErrorPluralModulePresence; + + formatter = new MessageFormat( cldr.locale, pluralGenerator ).compile( message ); + + returnFn = messageFormatterFn( formatter ); + + runtimeBind( args, cldr, returnFn, + [ messageFormatterRuntimeBind( cldr, formatter ), pluralGenerator ] ); + + return returnFn; +}; + +/** + * .formatMessage( path [, variables] ) + * + * @path [String or Array] + * + * @variables [Number, String, Array or Object] + * + * Format a message given its path. + */ +Globalize.formatMessage = +Globalize.prototype.formatMessage = function( path /* , variables */ ) { + return this.messageFormatter( path ).apply( {}, slice.call( arguments, 1 ) ); +}; + +return Globalize; + + + + +})); diff --git a/StockManMVC/.bin/bower_components/globalize/dist/globalize/number.js b/StockManMVC/.bin/bower_components/globalize/dist/globalize/number.js new file mode 100644 index 0000000..c2a859c --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/dist/globalize/number.js @@ -0,0 +1,1311 @@ +/** + * Globalize v1.1.1 + * + * http://github.com/jquery/globalize + * + * Copyright jQuery Foundation and other contributors + * Released under the MIT license + * http://jquery.org/license + * + * Date: 2016-02-04T12:01Z + */ +/*! + * Globalize v1.1.1 2016-02-04T12:01Z Released under the MIT license + * http://git.io/TrdQbw + */ +(function( root, factory ) { + + // UMD returnExports + if ( typeof define === "function" && define.amd ) { + + // AMD + define([ + "cldr", + "../globalize", + "cldr/event", + "cldr/supplemental" + ], factory ); + } else if ( typeof exports === "object" ) { + + // Node, CommonJS + module.exports = factory( require( "cldrjs" ), require( "globalize" ) ); + } else { + + // Global + factory( root.Cldr, root.Globalize ); + } +}(this, function( Cldr, Globalize ) { + +var createError = Globalize._createError, + objectExtend = Globalize._objectExtend, + regexpEscape = Globalize._regexpEscape, + runtimeBind = Globalize._runtimeBind, + stringPad = Globalize._stringPad, + validateCldr = Globalize._validateCldr, + validateDefaultLocale = Globalize._validateDefaultLocale, + validateParameterPresence = Globalize._validateParameterPresence, + validateParameterRange = Globalize._validateParameterRange, + validateParameterType = Globalize._validateParameterType, + validateParameterTypePlainObject = Globalize._validateParameterTypePlainObject; + + +var createErrorUnsupportedFeature = function( feature ) { + return createError( "E_UNSUPPORTED", "Unsupported {feature}.", { + feature: feature + }); +}; + + + + +var validateParameterTypeNumber = function( value, name ) { + validateParameterType( + value, + name, + value === undefined || typeof value === "number", + "Number" + ); +}; + + + + +var validateParameterTypeString = function( value, name ) { + validateParameterType( + value, + name, + value === undefined || typeof value === "string", + "a string" + ); +}; + + + + +/** + * goupingSeparator( number, primaryGroupingSize, secondaryGroupingSize ) + * + * @number [Number]. + * + * @primaryGroupingSize [Number] + * + * @secondaryGroupingSize [Number] + * + * Return the formatted number with group separator. + */ +var numberFormatGroupingSeparator = function( number, primaryGroupingSize, secondaryGroupingSize ) { + var index, + currentGroupingSize = primaryGroupingSize, + ret = "", + sep = ",", + switchToSecondary = secondaryGroupingSize ? true : false; + + number = String( number ).split( "." ); + index = number[ 0 ].length; + + while ( index > currentGroupingSize ) { + ret = number[ 0 ].slice( index - currentGroupingSize, index ) + + ( ret.length ? sep : "" ) + ret; + index -= currentGroupingSize; + if ( switchToSecondary ) { + currentGroupingSize = secondaryGroupingSize; + switchToSecondary = false; + } + } + + number[ 0 ] = number[ 0 ].slice( 0, index ) + ( ret.length ? sep : "" ) + ret; + return number.join( "." ); +}; + + + + +/** + * integerFractionDigits( number, minimumIntegerDigits, minimumFractionDigits, + * maximumFractionDigits, round, roundIncrement ) + * + * @number [Number] + * + * @minimumIntegerDigits [Number] + * + * @minimumFractionDigits [Number] + * + * @maximumFractionDigits [Number] + * + * @round [Function] + * + * @roundIncrement [Function] + * + * Return the formatted integer and fraction digits. + */ +var numberFormatIntegerFractionDigits = function( number, minimumIntegerDigits, minimumFractionDigits, maximumFractionDigits, round, + roundIncrement ) { + + // Fraction + if ( maximumFractionDigits ) { + + // Rounding + if ( roundIncrement ) { + number = round( number, roundIncrement ); + + // Maximum fraction digits + } else { + number = round( number, { exponent: -maximumFractionDigits } ); + } + + // Minimum fraction digits + if ( minimumFractionDigits ) { + number = String( number ).split( "." ); + number[ 1 ] = stringPad( number[ 1 ] || "", minimumFractionDigits, true ); + number = number.join( "." ); + } + } else { + number = round( number ); + } + + number = String( number ); + + // Minimum integer digits + if ( minimumIntegerDigits ) { + number = number.split( "." ); + number[ 0 ] = stringPad( number[ 0 ], minimumIntegerDigits ); + number = number.join( "." ); + } + + return number; +}; + + + + +/** + * toPrecision( number, precision, round ) + * + * @number (Number) + * + * @precision (Number) significant figures precision (not decimal precision). + * + * @round (Function) + * + * Return number.toPrecision( precision ) using the given round function. + */ +var numberToPrecision = function( number, precision, round ) { + var roundOrder; + + // Get number at two extra significant figure precision. + number = number.toPrecision( precision + 2 ); + + // Then, round it to the required significant figure precision. + roundOrder = Math.ceil( Math.log( Math.abs( number ) ) / Math.log( 10 ) ); + roundOrder -= precision; + + return round( number, { exponent: roundOrder } ); +}; + + + + +/** + * toPrecision( number, minimumSignificantDigits, maximumSignificantDigits, round ) + * + * @number [Number] + * + * @minimumSignificantDigits [Number] + * + * @maximumSignificantDigits [Number] + * + * @round [Function] + * + * Return the formatted significant digits number. + */ +var numberFormatSignificantDigits = function( number, minimumSignificantDigits, maximumSignificantDigits, round ) { + var atMinimum, atMaximum; + + // Sanity check. + if ( minimumSignificantDigits > maximumSignificantDigits ) { + maximumSignificantDigits = minimumSignificantDigits; + } + + atMinimum = numberToPrecision( number, minimumSignificantDigits, round ); + atMaximum = numberToPrecision( number, maximumSignificantDigits, round ); + + // Use atMaximum only if it has more significant digits than atMinimum. + number = +atMinimum === +atMaximum ? atMinimum : atMaximum; + + // Expand integer numbers, eg. 123e5 to 12300. + number = ( +number ).toString( 10 ); + + if ( ( /e/ ).test( number ) ) { + throw createErrorUnsupportedFeature({ + feature: "integers out of (1e21, 1e-7)" + }); + } + + // Add trailing zeros if necessary. + if ( minimumSignificantDigits - number.replace( /^0+|\./g, "" ).length > 0 ) { + number = number.split( "." ); + number[ 1 ] = stringPad( number[ 1 ] || "", minimumSignificantDigits - number[ 0 ].replace( /^0+/, "" ).length, true ); + number = number.join( "." ); + } + + return number; +}; + + + + +/** + * format( number, properties ) + * + * @number [Number]. + * + * @properties [Object] Output of number/format-properties. + * + * Return the formatted number. + * ref: http://www.unicode.org/reports/tr35/tr35-numbers.html + */ +var numberFormat = function( number, properties ) { + var infinitySymbol, maximumFractionDigits, maximumSignificantDigits, minimumFractionDigits, + minimumIntegerDigits, minimumSignificantDigits, nanSymbol, nuDigitsMap, padding, prefix, + primaryGroupingSize, pattern, ret, round, roundIncrement, secondaryGroupingSize, suffix, + symbolMap; + + padding = properties[ 1 ]; + minimumIntegerDigits = properties[ 2 ]; + minimumFractionDigits = properties[ 3 ]; + maximumFractionDigits = properties[ 4 ]; + minimumSignificantDigits = properties[ 5 ]; + maximumSignificantDigits = properties[ 6 ]; + roundIncrement = properties[ 7 ]; + primaryGroupingSize = properties[ 8 ]; + secondaryGroupingSize = properties[ 9 ]; + round = properties[ 15 ]; + infinitySymbol = properties[ 16 ]; + nanSymbol = properties[ 17 ]; + symbolMap = properties[ 18 ]; + nuDigitsMap = properties[ 19 ]; + + // NaN + if ( isNaN( number ) ) { + return nanSymbol; + } + + if ( number < 0 ) { + pattern = properties[ 12 ]; + prefix = properties[ 13 ]; + suffix = properties[ 14 ]; + } else { + pattern = properties[ 11 ]; + prefix = properties[ 0 ]; + suffix = properties[ 10 ]; + } + + // Infinity + if ( !isFinite( number ) ) { + return prefix + infinitySymbol + suffix; + } + + ret = prefix; + + // Percent + if ( pattern.indexOf( "%" ) !== -1 ) { + number *= 100; + + // Per mille + } else if ( pattern.indexOf( "\u2030" ) !== -1 ) { + number *= 1000; + } + + // Significant digit format + if ( !isNaN( minimumSignificantDigits * maximumSignificantDigits ) ) { + number = numberFormatSignificantDigits( number, minimumSignificantDigits, + maximumSignificantDigits, round ); + + // Integer and fractional format + } else { + number = numberFormatIntegerFractionDigits( number, minimumIntegerDigits, + minimumFractionDigits, maximumFractionDigits, round, roundIncrement ); + } + + // Remove the possible number minus sign + number = number.replace( /^-/, "" ); + + // Grouping separators + if ( primaryGroupingSize ) { + number = numberFormatGroupingSeparator( number, primaryGroupingSize, + secondaryGroupingSize ); + } + + ret += number; + + // Scientific notation + // TODO implement here + + // Padding/'([^']|'')+'|''|[.,\-+E%\u2030]/g + // TODO implement here + + ret += suffix; + + return ret.replace( /('([^']|'')+'|'')|./g, function( character, literal ) { + + // Literals + if ( literal ) { + literal = literal.replace( /''/, "'" ); + if ( literal.length > 2 ) { + literal = literal.slice( 1, -1 ); + } + return literal; + } + + // Symbols + character = character.replace( /[.,\-+E%\u2030]/, function( symbol ) { + return symbolMap[ symbol ]; + }); + + // Numbering system + if ( nuDigitsMap ) { + character = character.replace( /[0-9]/, function( digit ) { + return nuDigitsMap[ +digit ]; + }); + } + + return character; + }); +}; + + + + +var numberFormatterFn = function( properties ) { + return function numberFormatter( value ) { + validateParameterPresence( value, "value" ); + validateParameterTypeNumber( value, "value" ); + + return numberFormat( value, properties ); + }; +}; + + + + +/** + * NumberingSystem( cldr ) + * + * - http://www.unicode.org/reports/tr35/tr35-numbers.html#otherNumberingSystems + * - http://cldr.unicode.org/index/bcp47-extension + * - http://www.unicode.org/reports/tr35/#u_Extension + */ +var numberNumberingSystem = function( cldr ) { + var nu = cldr.attributes[ "u-nu" ]; + + if ( nu ) { + if ( nu === "traditio" ) { + nu = "traditional"; + } + if ( [ "native", "traditional", "finance" ].indexOf( nu ) !== -1 ) { + + // Unicode locale extension `u-nu` is set using either (native, traditional or + // finance). So, lookup the respective locale's numberingSystem and return it. + return cldr.main([ "numbers/otherNumberingSystems", nu ]); + } + + // Unicode locale extension `u-nu` is set with an explicit numberingSystem. Return it. + return nu; + } + + // Return the default numberingSystem. + return cldr.main( "numbers/defaultNumberingSystem" ); +}; + + + + +/** + * nuMap( cldr ) + * + * @cldr [Cldr instance]. + * + * Return digits map if numbering system is different than `latn`. + */ +var numberNumberingSystemDigitsMap = function( cldr ) { + var aux, + nu = numberNumberingSystem( cldr ); + + if ( nu === "latn" ) { + return; + } + + aux = cldr.supplemental([ "numberingSystems", nu ]); + + if ( aux._type !== "numeric" ) { + throw createErrorUnsupportedFeature( "`" + aux._type + "` numbering system" ); + } + + return aux._digits; +}; + + + + +/** + * EBNF representation: + * + * number_pattern_re = prefix? + * padding? + * (integer_fraction_pattern | significant_pattern) + * scientific_notation? + * suffix? + * + * prefix = non_number_stuff + * + * padding = "*" regexp(.) + * + * integer_fraction_pattern = integer_pattern + * fraction_pattern? + * + * integer_pattern = regexp([#,]*[0,]*0+) + * + * fraction_pattern = "." regexp(0*[0-9]*#*) + * + * significant_pattern = regexp([#,]*@+#*) + * + * scientific_notation = regexp(E\+?0+) + * + * suffix = non_number_stuff + * + * non_number_stuff = regexp(('[^']+'|''|[^*#@0,.E])*) + * + * + * Regexp groups: + * + * 0: number_pattern_re + * 1: prefix + * 2: - + * 3: padding + * 4: (integer_fraction_pattern | significant_pattern) + * 5: integer_fraction_pattern + * 6: integer_pattern + * 7: fraction_pattern + * 8: significant_pattern + * 9: scientific_notation + * 10: suffix + * 11: - + */ +var numberPatternRe = ( /^(('[^']+'|''|[^*#@0,.E])*)(\*.)?((([#,]*[0,]*0+)(\.0*[0-9]*#*)?)|([#,]*@+#*))(E\+?0+)?(('[^']+'|''|[^*#@0,.E])*)$/ ); + + + + +/** + * format( number, pattern ) + * + * @number [Number]. + * + * @pattern [String] raw pattern for numbers. + * + * Return the formatted number. + * ref: http://www.unicode.org/reports/tr35/tr35-numbers.html + */ +var numberPatternProperties = function( pattern ) { + var aux1, aux2, fractionPattern, integerFractionOrSignificantPattern, integerPattern, + maximumFractionDigits, maximumSignificantDigits, minimumFractionDigits, + minimumIntegerDigits, minimumSignificantDigits, padding, prefix, primaryGroupingSize, + roundIncrement, scientificNotation, secondaryGroupingSize, significantPattern, suffix; + + pattern = pattern.match( numberPatternRe ); + if ( !pattern ) { + throw new Error( "Invalid pattern: " + pattern ); + } + + prefix = pattern[ 1 ]; + padding = pattern[ 3 ]; + integerFractionOrSignificantPattern = pattern[ 4 ]; + significantPattern = pattern[ 8 ]; + scientificNotation = pattern[ 9 ]; + suffix = pattern[ 10 ]; + + // Significant digit format + if ( significantPattern ) { + significantPattern.replace( /(@+)(#*)/, function( match, minimumSignificantDigitsMatch, maximumSignificantDigitsMatch ) { + minimumSignificantDigits = minimumSignificantDigitsMatch.length; + maximumSignificantDigits = minimumSignificantDigits + + maximumSignificantDigitsMatch.length; + }); + + // Integer and fractional format + } else { + fractionPattern = pattern[ 7 ]; + integerPattern = pattern[ 6 ]; + + if ( fractionPattern ) { + + // Minimum fraction digits, and rounding. + fractionPattern.replace( /[0-9]+/, function( match ) { + minimumFractionDigits = match; + }); + if ( minimumFractionDigits ) { + roundIncrement = +( "0." + minimumFractionDigits ); + minimumFractionDigits = minimumFractionDigits.length; + } else { + minimumFractionDigits = 0; + } + + // Maximum fraction digits + // 1: ignore decimal character + maximumFractionDigits = fractionPattern.length - 1 /* 1 */; + } + + // Minimum integer digits + integerPattern.replace( /0+$/, function( match ) { + minimumIntegerDigits = match.length; + }); + } + + // Scientific notation + if ( scientificNotation ) { + throw createErrorUnsupportedFeature({ + feature: "scientific notation (not implemented)" + }); + } + + // Padding + if ( padding ) { + throw createErrorUnsupportedFeature({ + feature: "padding (not implemented)" + }); + } + + // Grouping + if ( ( aux1 = integerFractionOrSignificantPattern.lastIndexOf( "," ) ) !== -1 ) { + + // Primary grouping size is the interval between the last group separator and the end of + // the integer (or the end of the significant pattern). + aux2 = integerFractionOrSignificantPattern.split( "." )[ 0 ]; + primaryGroupingSize = aux2.length - aux1 - 1; + + // Secondary grouping size is the interval between the last two group separators. + if ( ( aux2 = integerFractionOrSignificantPattern.lastIndexOf( ",", aux1 - 1 ) ) !== -1 ) { + secondaryGroupingSize = aux1 - 1 - aux2; + } + } + + // Return: + // 0: @prefix String + // 1: @padding Array [ , ] TODO + // 2: @minimumIntegerDigits non-negative integer Number value indicating the minimum integer + // digits to be used. Numbers will be padded with leading zeroes if necessary. + // 3: @minimumFractionDigits and + // 4: @maximumFractionDigits are non-negative integer Number values indicating the minimum and + // maximum fraction digits to be used. Numbers will be rounded or padded with trailing + // zeroes if necessary. + // 5: @minimumSignificantDigits and + // 6: @maximumSignificantDigits are positive integer Number values indicating the minimum and + // maximum fraction digits to be shown. Either none or both of these properties are + // present; if they are, they override minimum and maximum integer and fraction digits + // – the formatter uses however many integer and fraction digits are required to display + // the specified number of significant digits. + // 7: @roundIncrement Decimal round increment or null + // 8: @primaryGroupingSize + // 9: @secondaryGroupingSize + // 10: @suffix String + return [ + prefix, + padding, + minimumIntegerDigits, + minimumFractionDigits, + maximumFractionDigits, + minimumSignificantDigits, + maximumSignificantDigits, + roundIncrement, + primaryGroupingSize, + secondaryGroupingSize, + suffix + ]; +}; + + + + +/** + * Symbol( name, cldr ) + * + * @name [String] Symbol name. + * + * @cldr [Cldr instance]. + * + * Return the localized symbol given its name. + */ +var numberSymbol = function( name, cldr ) { + return cldr.main([ + "numbers/symbols-numberSystem-" + numberNumberingSystem( cldr ), + name + ]); +}; + + + + +var numberSymbolName = { + ".": "decimal", + ",": "group", + "%": "percentSign", + "+": "plusSign", + "-": "minusSign", + "E": "exponential", + "\u2030": "perMille" +}; + + + + +/** + * symbolMap( cldr ) + * + * @cldr [Cldr instance]. + * + * Return the (localized symbol, pattern symbol) key value pair, eg. { + * ".": "٫", + * ",": "٬", + * "%": "٪", + * ... + * }; + */ +var numberSymbolMap = function( cldr ) { + var symbol, + symbolMap = {}; + + for ( symbol in numberSymbolName ) { + symbolMap[ symbol ] = numberSymbol( numberSymbolName[ symbol ], cldr ); + } + + return symbolMap; +}; + + + + +var numberTruncate = function( value ) { + if ( isNaN( value ) ) { + return NaN; + } + return Math[ value < 0 ? "ceil" : "floor" ]( value ); +}; + + + + +/** + * round( method ) + * + * @method [String] with either "round", "ceil", "floor", or "truncate". + * + * Return function( value, incrementOrExp ): + * + * @value [Number] eg. 123.45. + * + * @incrementOrExp [Number] optional, eg. 0.1; or + * [Object] Either { increment: } or { exponent: } + * + * Return the rounded number, eg: + * - round( "round" )( 123.45 ): 123; + * - round( "ceil" )( 123.45 ): 124; + * - round( "floor" )( 123.45 ): 123; + * - round( "truncate" )( 123.45 ): 123; + * - round( "round" )( 123.45, 0.1 ): 123.5; + * - round( "round" )( 123.45, 10 ): 120; + * + * Based on https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/round + * Ref: #376 + */ +var numberRound = function( method ) { + method = method || "round"; + method = method === "truncate" ? numberTruncate : Math[ method ]; + + return function( value, incrementOrExp ) { + var exp, increment; + + value = +value; + + // If the value is not a number, return NaN. + if ( isNaN( value ) ) { + return NaN; + } + + // Exponent given. + if ( typeof incrementOrExp === "object" && incrementOrExp.exponent ) { + exp = +incrementOrExp.exponent; + increment = 1; + + if ( exp === 0 ) { + return method( value ); + } + + // If the exp is not an integer, return NaN. + if ( !( typeof exp === "number" && exp % 1 === 0 ) ) { + return NaN; + } + + // Increment given. + } else { + increment = +incrementOrExp || 1; + + if ( increment === 1 ) { + return method( value ); + } + + // If the increment is not a number, return NaN. + if ( isNaN( increment ) ) { + return NaN; + } + + increment = increment.toExponential().split( "e" ); + exp = +increment[ 1 ]; + increment = +increment[ 0 ]; + } + + // Shift & Round + value = value.toString().split( "e" ); + value[ 0 ] = +value[ 0 ] / increment; + value[ 1 ] = value[ 1 ] ? ( +value[ 1 ] - exp ) : -exp; + value = method( +( value[ 0 ] + "e" + value[ 1 ] ) ); + + // Shift back + value = value.toString().split( "e" ); + value[ 0 ] = +value[ 0 ] * increment; + value[ 1 ] = value[ 1 ] ? ( +value[ 1 ] + exp ) : exp; + return +( value[ 0 ] + "e" + value[ 1 ] ); + }; +}; + + + + +/** + * formatProperties( pattern, cldr [, options] ) + * + * @pattern [String] raw pattern for numbers. + * + * @cldr [Cldr instance]. + * + * @options [Object]: + * - minimumIntegerDigits [Number] + * - minimumFractionDigits, maximumFractionDigits [Number] + * - minimumSignificantDigits, maximumSignificantDigits [Number] + * - round [String] "ceil", "floor", "round" (default), or "truncate". + * - useGrouping [Boolean] default true. + * + * Return the processed properties that will be used in number/format. + * ref: http://www.unicode.org/reports/tr35/tr35-numbers.html + */ +var numberFormatProperties = function( pattern, cldr, options ) { + var negativePattern, negativePrefix, negativeProperties, negativeSuffix, positivePattern, + roundFn, properties; + + function getOptions( attribute, propertyIndex ) { + if ( attribute in options ) { + properties[ propertyIndex ] = options[ attribute ]; + } + } + + options = options || {}; + pattern = pattern.split( ";" ); + + positivePattern = pattern[ 0 ]; + + negativePattern = pattern[ 1 ] || "-" + positivePattern; + negativeProperties = numberPatternProperties( negativePattern ); + negativePrefix = negativeProperties[ 0 ]; + negativeSuffix = negativeProperties[ 10 ]; + + // Have runtime code to refer to numberRound() instead of including it explicitly. + roundFn = numberRound( options.round ); + roundFn.generatorString = function() { + return "numberRound(" + ( options.round ? "\"" + options.round + "\"" : "" ) + ")"; + }; + + properties = numberPatternProperties( positivePattern ).concat([ + positivePattern, + negativePrefix + positivePattern + negativeSuffix, + negativePrefix, + negativeSuffix, + roundFn, + numberSymbol( "infinity", cldr ), + numberSymbol( "nan", cldr ), + numberSymbolMap( cldr ), + numberNumberingSystemDigitsMap( cldr ) + ]); + + getOptions( "minimumIntegerDigits", 2 ); + getOptions( "minimumFractionDigits", 3 ); + getOptions( "maximumFractionDigits", 4 ); + getOptions( "minimumSignificantDigits", 5 ); + getOptions( "maximumSignificantDigits", 6 ); + + // Grouping separators + if ( options.useGrouping === false ) { + properties[ 8 ] = null; + } + + // Normalize number of digits if only one of either minimumFractionDigits or + // maximumFractionDigits is passed in as an option + if ( "minimumFractionDigits" in options && !( "maximumFractionDigits" in options ) ) { + + // maximumFractionDigits = Math.max( minimumFractionDigits, maximumFractionDigits ); + properties[ 4 ] = Math.max( properties[ 3 ], properties[ 4 ] ); + } else if ( !( "minimumFractionDigits" in options ) && + "maximumFractionDigits" in options ) { + + // minimumFractionDigits = Math.min( minimumFractionDigits, maximumFractionDigits ); + properties[ 3 ] = Math.min( properties[ 3 ], properties[ 4 ] ); + } + + // Return: + // 0-10: see number/pattern-properties. + // 11: @positivePattern [String] Positive pattern. + // 12: @negativePattern [String] Negative pattern. + // 13: @negativePrefix [String] Negative prefix. + // 14: @negativeSuffix [String] Negative suffix. + // 15: @round [Function] Round function. + // 16: @infinitySymbol [String] Infinity symbol. + // 17: @nanSymbol [String] NaN symbol. + // 18: @symbolMap [Object] A bunch of other symbols. + // 19: @nuDigitsMap [Array] Digits map if numbering system is different than `latn`. + return properties; +}; + + + + +/** + * EBNF representation: + * + * number_pattern_re = prefix_including_padding? + * number + * scientific_notation? + * suffix? + * + * number = integer_including_group_separator fraction_including_decimal_separator + * + * integer_including_group_separator = + * regexp([0-9,]*[0-9]+) + * + * fraction_including_decimal_separator = + * regexp((\.[0-9]+)?) + + * prefix_including_padding = non_number_stuff + * + * scientific_notation = regexp(E[+-]?[0-9]+) + * + * suffix = non_number_stuff + * + * non_number_stuff = regexp([^0-9]*) + * + * + * Regexp groups: + * + * 0: number_pattern_re + * 1: prefix + * 2: integer_including_group_separator fraction_including_decimal_separator + * 3: integer_including_group_separator + * 4: fraction_including_decimal_separator + * 5: scientific_notation + * 6: suffix + */ +var numberNumberRe = ( /^([^0-9]*)(([0-9,]*[0-9]+)(\.[0-9]+)?)(E[+-]?[0-9]+)?([^0-9]*)$/ ); + + + + +/** + * parse( value, properties ) + * + * @value [String]. + * + * @properties [Object] Parser properties is a reduced pre-processed cldr + * data set returned by numberParserProperties(). + * + * Return the parsed Number (including Infinity) or NaN when value is invalid. + * ref: http://www.unicode.org/reports/tr35/tr35-numbers.html + */ +var numberParse = function( value, properties ) { + var aux, infinitySymbol, invertedNuDigitsMap, invertedSymbolMap, localizedDigitRe, + localizedSymbolsRe, negativePrefix, negativeSuffix, number, prefix, suffix; + + infinitySymbol = properties[ 0 ]; + invertedSymbolMap = properties[ 1 ]; + negativePrefix = properties[ 2 ]; + negativeSuffix = properties[ 3 ]; + invertedNuDigitsMap = properties[ 4 ]; + + // Infinite number. + if ( aux = value.match( infinitySymbol ) ) { + + number = Infinity; + prefix = value.slice( 0, aux.length ); + suffix = value.slice( aux.length + 1 ); + + // Finite number. + } else { + + // TODO: Create it during setup, i.e., make it a property. + localizedSymbolsRe = new RegExp( + Object.keys( invertedSymbolMap ).map(function( localizedSymbol ) { + return regexpEscape( localizedSymbol ); + }).join( "|" ), + "g" + ); + + // Reverse localized symbols. + value = value.replace( localizedSymbolsRe, function( localizedSymbol ) { + return invertedSymbolMap[ localizedSymbol ]; + }); + + // Reverse localized numbering system. + if ( invertedNuDigitsMap ) { + + // TODO: Create it during setup, i.e., make it a property. + localizedDigitRe = new RegExp( + Object.keys( invertedNuDigitsMap ).map(function( localizedDigit ) { + return regexpEscape( localizedDigit ); + }).join( "|" ), + "g" + ); + value = value.replace( localizedDigitRe, function( localizedDigit ) { + return invertedNuDigitsMap[ localizedDigit ]; + }); + } + + // Add padding zero to leading decimal. + if ( value.charAt( 0 ) === "." ) { + value = "0" + value; + } + + // Is it a valid number? + value = value.match( numberNumberRe ); + if ( !value ) { + + // Invalid number. + return NaN; + } + + prefix = value[ 1 ]; + suffix = value[ 6 ]; + + // Remove grouping separators. + number = value[ 2 ].replace( /,/g, "" ); + + // Scientific notation + if ( value[ 5 ] ) { + number += value[ 5 ]; + } + + number = +number; + + // Is it a valid number? + if ( isNaN( number ) ) { + + // Invalid number. + return NaN; + } + + // Percent + if ( value[ 0 ].indexOf( "%" ) !== -1 ) { + number /= 100; + suffix = suffix.replace( "%", "" ); + + // Per mille + } else if ( value[ 0 ].indexOf( "\u2030" ) !== -1 ) { + number /= 1000; + suffix = suffix.replace( "\u2030", "" ); + } + } + + // Negative number + // "If there is an explicit negative subpattern, it serves only to specify the negative prefix + // and suffix. If there is no explicit negative subpattern, the negative subpattern is the + // localized minus sign prefixed to the positive subpattern" UTS#35 + if ( prefix === negativePrefix && suffix === negativeSuffix ) { + number *= -1; + } + + return number; +}; + + + + +var numberParserFn = function( properties ) { + return function numberParser( value ) { + validateParameterPresence( value, "value" ); + validateParameterTypeString( value, "value" ); + + return numberParse( value, properties ); + }; + +}; + + + + +/** + * symbolMap( cldr ) + * + * @cldr [Cldr instance]. + * + * Return the (localized symbol, pattern symbol) key value pair, eg. { + * "٫": ".", + * "٬": ",", + * "٪": "%", + * ... + * }; + */ +var numberSymbolInvertedMap = function( cldr ) { + var symbol, + symbolMap = {}; + + for ( symbol in numberSymbolName ) { + symbolMap[ numberSymbol( numberSymbolName[ symbol ], cldr ) ] = symbol; + } + + return symbolMap; +}; + + + + +/** + * parseProperties( pattern, cldr ) + * + * @pattern [String] raw pattern for numbers. + * + * @cldr [Cldr instance]. + * + * Return parser properties, used to feed parser function. + */ +var numberParseProperties = function( pattern, cldr ) { + var invertedNuDigitsMap, invertedNuDigitsMapSanityCheck, negativePattern, negativeProperties, + nuDigitsMap = numberNumberingSystemDigitsMap( cldr ); + + pattern = pattern.split( ";" ); + negativePattern = pattern[ 1 ] || "-" + pattern[ 0 ]; + negativeProperties = numberPatternProperties( negativePattern ); + if ( nuDigitsMap ) { + invertedNuDigitsMap = nuDigitsMap.split( "" ).reduce(function( object, localizedDigit, i ) { + object[ localizedDigit ] = String( i ); + return object; + }, {} ); + invertedNuDigitsMapSanityCheck = "0123456789".split( "" ).reduce(function( object, digit ) { + object[ digit ] = "invalid"; + return object; + }, {} ); + invertedNuDigitsMap = objectExtend( + invertedNuDigitsMapSanityCheck, + invertedNuDigitsMap + ); + } + + // 0: @infinitySymbol [String] Infinity symbol. + // 1: @invertedSymbolMap [Object] Inverted symbol map augmented with sanity check. + // The sanity check prevents permissive parsing, i.e., it prevents symbols that doesn't + // belong to the localized set to pass through. This is obtained with the result of the + // inverted map object overloading symbol name map object (the remaining symbol name + // mappings will invalidate parsing, working as the sanity check). + // 2: @negativePrefix [String] Negative prefix. + // 3: @negativeSuffix [String] Negative suffix with percent or per mille stripped out. + // 4: @invertedNuDigitsMap [Object] Inverted digits map if numbering system is different than + // `latn` augmented with sanity check (similar to invertedSymbolMap). + return [ + numberSymbol( "infinity", cldr ), + objectExtend( {}, numberSymbolName, numberSymbolInvertedMap( cldr ) ), + negativeProperties[ 0 ], + negativeProperties[ 10 ].replace( "%", "" ).replace( "\u2030", "" ), + invertedNuDigitsMap + ]; +}; + + + + +/** + * Pattern( style ) + * + * @style [String] "decimal" (default) or "percent". + * + * @cldr [Cldr instance]. + */ +var numberPattern = function( style, cldr ) { + if ( style !== "decimal" && style !== "percent" ) { + throw new Error( "Invalid style" ); + } + + return cldr.main([ + "numbers", + style + "Formats-numberSystem-" + numberNumberingSystem( cldr ), + "standard" + ]); +}; + + + + +function validateDigits( properties ) { + var minimumIntegerDigits = properties[ 2 ], + minimumFractionDigits = properties[ 3 ], + maximumFractionDigits = properties[ 4 ], + minimumSignificantDigits = properties[ 5 ], + maximumSignificantDigits = properties[ 6 ]; + + // Validate significant digit format properties + if ( !isNaN( minimumSignificantDigits * maximumSignificantDigits ) ) { + validateParameterRange( minimumSignificantDigits, "minimumSignificantDigits", 1, 21 ); + validateParameterRange( maximumSignificantDigits, "maximumSignificantDigits", + minimumSignificantDigits, 21 ); + + } else if ( !isNaN( minimumSignificantDigits ) || !isNaN( maximumSignificantDigits ) ) { + throw new Error( "Neither or both the minimum and maximum significant digits must be " + + "present" ); + + // Validate integer and fractional format + } else { + validateParameterRange( minimumIntegerDigits, "minimumIntegerDigits", 1, 21 ); + validateParameterRange( minimumFractionDigits, "minimumFractionDigits", 0, 20 ); + validateParameterRange( maximumFractionDigits, "maximumFractionDigits", + minimumFractionDigits, 20 ); + } +} + +/** + * .numberFormatter( [options] ) + * + * @options [Object]: + * - style: [String] "decimal" (default) or "percent". + * - see also number/format options. + * + * Return a function that formats a number according to the given options and default/instance + * locale. + */ +Globalize.numberFormatter = +Globalize.prototype.numberFormatter = function( options ) { + var args, cldr, pattern, properties, returnFn; + + validateParameterTypePlainObject( options, "options" ); + + options = options || {}; + cldr = this.cldr; + + args = [ options ]; + + validateDefaultLocale( cldr ); + + cldr.on( "get", validateCldr ); + + if ( options.raw ) { + pattern = options.raw; + } else { + pattern = numberPattern( options.style || "decimal", cldr ); + } + + properties = numberFormatProperties( pattern, cldr, options ); + + cldr.off( "get", validateCldr ); + + validateDigits( properties ); + + returnFn = numberFormatterFn( properties ); + + runtimeBind( args, cldr, returnFn, [ properties ] ); + + return returnFn; +}; + +/** + * .numberParser( [options] ) + * + * @options [Object]: + * - style: [String] "decimal" (default) or "percent". + * + * Return the number parser according to the default/instance locale. + */ +Globalize.numberParser = +Globalize.prototype.numberParser = function( options ) { + var args, cldr, pattern, properties, returnFn; + + validateParameterTypePlainObject( options, "options" ); + + options = options || {}; + cldr = this.cldr; + + args = [ options ]; + + validateDefaultLocale( cldr ); + + cldr.on( "get", validateCldr ); + + if ( options.raw ) { + pattern = options.raw; + } else { + pattern = numberPattern( options.style || "decimal", cldr ); + } + + properties = numberParseProperties( pattern, cldr ); + + cldr.off( "get", validateCldr ); + + returnFn = numberParserFn( properties ); + + runtimeBind( args, cldr, returnFn, [ properties ] ); + + return returnFn; +}; + +/** + * .formatNumber( value [, options] ) + * + * @value [Number] number to be formatted. + * + * @options [Object]: see number/format-properties. + * + * Format a number according to the given options and default/instance locale. + */ +Globalize.formatNumber = +Globalize.prototype.formatNumber = function( value, options ) { + validateParameterPresence( value, "value" ); + validateParameterTypeNumber( value, "value" ); + + return this.numberFormatter( options )( value ); +}; + +/** + * .parseNumber( value [, options] ) + * + * @value [String] + * + * @options [Object]: See numberParser(). + * + * Return the parsed Number (including Infinity) or NaN when value is invalid. + */ +Globalize.parseNumber = +Globalize.prototype.parseNumber = function( value, options ) { + validateParameterPresence( value, "value" ); + validateParameterTypeString( value, "value" ); + + return this.numberParser( options )( value ); +}; + +/** + * Optimization to avoid duplicating some internal functions across modules. + */ +Globalize._createErrorUnsupportedFeature = createErrorUnsupportedFeature; +Globalize._numberNumberingSystem = numberNumberingSystem; +Globalize._numberPattern = numberPattern; +Globalize._numberSymbol = numberSymbol; +Globalize._stringPad = stringPad; +Globalize._validateParameterTypeNumber = validateParameterTypeNumber; +Globalize._validateParameterTypeString = validateParameterTypeString; + +return Globalize; + + + + +})); diff --git a/StockManMVC/.bin/bower_components/globalize/dist/globalize/plural.js b/StockManMVC/.bin/bower_components/globalize/dist/globalize/plural.js new file mode 100644 index 0000000..1fe38f2 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/dist/globalize/plural.js @@ -0,0 +1,373 @@ +/** + * Globalize v1.1.1 + * + * http://github.com/jquery/globalize + * + * Copyright jQuery Foundation and other contributors + * Released under the MIT license + * http://jquery.org/license + * + * Date: 2016-02-04T12:01Z + */ +/*! + * Globalize v1.1.1 2016-02-04T12:01Z Released under the MIT license + * http://git.io/TrdQbw + */ +(function( root, factory ) { + + // UMD returnExports + if ( typeof define === "function" && define.amd ) { + + // AMD + define([ + "cldr", + "../globalize", + "cldr/event", + "cldr/supplemental" + ], factory ); + } else if ( typeof exports === "object" ) { + + // Node, CommonJS + module.exports = factory( require( "cldrjs" ), require( "globalize" ) ); + } else { + + // Global + factory( root.Cldr, root.Globalize ); + } +}(this, function( Cldr, Globalize ) { + +var runtimeBind = Globalize._runtimeBind, + validateCldr = Globalize._validateCldr, + validateDefaultLocale = Globalize._validateDefaultLocale, + validateParameterPresence = Globalize._validateParameterPresence, + validateParameterType = Globalize._validateParameterType, + validateParameterTypePlainObject = Globalize._validateParameterTypePlainObject; +var MakePlural; +/* jshint ignore:start */ +MakePlural = (function() { +'use strict'; + +var _toArray = function (arr) { return Array.isArray(arr) ? arr : Array.from(arr); }; + +var _toConsumableArray = function (arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; return arr2; } else { return Array.from(arr); } }; + +var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }; + +var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); + + +/** + * make-plural.js -- https://github.com/eemeli/make-plural.js/ + * Copyright (c) 2014-2015 by Eemeli Aro + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * The software is provided "as is" and the author disclaims all warranties + * with regard to this software including all implied warranties of + * merchantability and fitness. In no event shall the author be liable for + * any special, direct, indirect, or consequential damages or any damages + * whatsoever resulting from loss of use, data or profits, whether in an + * action of contract, negligence or other tortious action, arising out of + * or in connection with the use or performance of this software. + */ + +var Parser = (function () { + function Parser() { + _classCallCheck(this, Parser); + } + + _createClass(Parser, [{ + key: 'parse', + value: function parse(cond) { + var _this = this; + + if (cond === 'i = 0 or n = 1') { + return 'n >= 0 && n <= 1'; + }if (cond === 'i = 0,1') { + return 'n >= 0 && n < 2'; + }if (cond === 'i = 1 and v = 0') { + this.v0 = 1; + return 'n == 1 && v0'; + } + return cond.replace(/([tv]) (!?)= 0/g, function (m, sym, noteq) { + var sn = sym + '0'; + _this[sn] = 1; + return noteq ? '!' + sn : sn; + }).replace(/\b[fintv]\b/g, function (m) { + _this[m] = 1; + return m; + }).replace(/([fin]) % (10+)/g, function (m, sym, num) { + var sn = sym + num; + _this[sn] = 1; + return sn; + }).replace(/n10+ = 0/g, 't0 && $&').replace(/(\w+ (!?)= )([0-9.]+,[0-9.,]+)/g, function (m, se, noteq, x) { + if (m === 'n = 0,1') return '(n == 0 || n == 1)'; + if (noteq) return se + x.split(',').join(' && ' + se); + return '(' + se + x.split(',').join(' || ' + se) + ')'; + }).replace(/(\w+) (!?)= ([0-9]+)\.\.([0-9]+)/g, function (m, sym, noteq, x0, x1) { + if (Number(x0) + 1 === Number(x1)) { + if (noteq) return '' + sym + ' != ' + x0 + ' && ' + sym + ' != ' + x1; + return '(' + sym + ' == ' + x0 + ' || ' + sym + ' == ' + x1 + ')'; + } + if (noteq) return '(' + sym + ' < ' + x0 + ' || ' + sym + ' > ' + x1 + ')'; + if (sym === 'n') { + _this.t0 = 1;return '(t0 && n >= ' + x0 + ' && n <= ' + x1 + ')'; + } + return '(' + sym + ' >= ' + x0 + ' && ' + sym + ' <= ' + x1 + ')'; + }).replace(/ and /g, ' && ').replace(/ or /g, ' || ').replace(/ = /g, ' == '); + } + }, { + key: 'vars', + value: (function (_vars) { + function vars() { + return _vars.apply(this, arguments); + } + + vars.toString = function () { + return _vars.toString(); + }; + + return vars; + })(function () { + var vars = []; + if (this.i) vars.push('i = s[0]'); + if (this.f || this.v) vars.push('f = s[1] || \'\''); + if (this.t) vars.push('t = (s[1] || \'\').replace(/0+$/, \'\')'); + if (this.v) vars.push('v = f.length'); + if (this.v0) vars.push('v0 = !s[1]'); + if (this.t0 || this.n10 || this.n100) vars.push('t0 = Number(s[0]) == n'); + for (var k in this) { + if (/^.10+$/.test(k)) { + var k0 = k[0] === 'n' ? 't0 && s[0]' : k[0]; + vars.push('' + k + ' = ' + k0 + '.slice(-' + k.substr(2).length + ')'); + } + }if (!vars.length) return ''; + return 'var ' + ['s = String(n).split(\'.\')'].concat(vars).join(', '); + }) + }]); + + return Parser; +})(); + + + +var MakePlural = (function () { + function MakePlural(lc) { + var _ref = arguments[1] === undefined ? MakePlural : arguments[1]; + + var cardinals = _ref.cardinals; + var ordinals = _ref.ordinals; + + _classCallCheck(this, MakePlural); + + if (!cardinals && !ordinals) throw new Error('At least one type of plural is required'); + this.lc = lc; + this.categories = { cardinal: [], ordinal: [] }; + this.parser = new Parser(); + + this.fn = this.buildFunction(cardinals, ordinals); + this.fn._obj = this; + this.fn.categories = this.categories; + + this.fn.toString = this.fnToString.bind(this); + return this.fn; + } + + _createClass(MakePlural, [{ + key: 'compile', + value: function compile(type, req) { + var cases = []; + var rules = MakePlural.rules[type][this.lc]; + if (!rules) { + if (req) throw new Error('Locale "' + this.lc + '" ' + type + ' rules not found'); + this.categories[type] = ['other']; + return '\'other\''; + } + for (var r in rules) { + var _rules$r$trim$split = rules[r].trim().split(/\s*@\w*/); + + var _rules$r$trim$split2 = _toArray(_rules$r$trim$split); + + var cond = _rules$r$trim$split2[0]; + var examples = _rules$r$trim$split2.slice(1); + var cat = r.replace('pluralRule-count-', ''); + if (cond) cases.push([this.parser.parse(cond), cat]); + + } + this.categories[type] = cases.map(function (c) { + return c[1]; + }).concat('other'); + if (cases.length === 1) { + return '(' + cases[0][0] + ') ? \'' + cases[0][1] + '\' : \'other\''; + } else { + return [].concat(_toConsumableArray(cases.map(function (c) { + return '(' + c[0] + ') ? \'' + c[1] + '\''; + })), ['\'other\'']).join('\n : '); + } + } + }, { + key: 'buildFunction', + value: function buildFunction(cardinals, ordinals) { + var _this3 = this; + + var compile = function compile(c) { + return c ? (c[1] ? 'return ' : 'if (ord) return ') + _this3.compile.apply(_this3, _toConsumableArray(c)) : ''; + }, + fold = { vars: function vars(str) { + return (' ' + str + ';').replace(/(.{1,78})(,|$) ?/g, '$1$2\n '); + }, + cond: function cond(str) { + return (' ' + str + ';').replace(/(.{1,78}) (\|\| |$) ?/gm, '$1\n $2'); + } }, + cond = [ordinals && ['ordinal', !cardinals], cardinals && ['cardinal', true]].map(compile).map(fold.cond), + body = [fold.vars(this.parser.vars())].concat(_toConsumableArray(cond)).join('\n').replace(/\s+$/gm, '').replace(/^[\s;]*[\r\n]+/gm, ''), + args = ordinals && cardinals ? 'n, ord' : 'n'; + return new Function(args, body); + } + }, { + key: 'fnToString', + value: function fnToString(name) { + return Function.prototype.toString.call(this.fn).replace(/^function( \w+)?/, name ? 'function ' + name : 'function').replace('\n/**/', ''); + } + }], [{ + key: 'load', + value: function load() { + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + args.forEach(function (cldr) { + var data = cldr && cldr.supplemental || null; + if (!data) throw new Error('Data does not appear to be CLDR data'); + MakePlural.rules = { + cardinal: data['plurals-type-cardinal'] || MakePlural.rules.cardinal, + ordinal: data['plurals-type-ordinal'] || MakePlural.rules.ordinal + }; + }); + return MakePlural; + } + }]); + + return MakePlural; +})(); + + + +MakePlural.cardinals = true; +MakePlural.ordinals = false; +MakePlural.rules = { cardinal: {}, ordinal: {} }; + + +return MakePlural; +}()); +/* jshint ignore:end */ + + +var validateParameterTypeNumber = function( value, name ) { + validateParameterType( + value, + name, + value === undefined || typeof value === "number", + "Number" + ); +}; + + + + +var validateParameterTypePluralType = function( value, name ) { + validateParameterType( + value, + name, + value === undefined || value === "cardinal" || value === "ordinal", + "String \"cardinal\" or \"ordinal\"" + ); +}; + + + + +var pluralGeneratorFn = function( plural ) { + return function pluralGenerator( value ) { + validateParameterPresence( value, "value" ); + validateParameterTypeNumber( value, "value" ); + + return plural( value ); + }; +}; + + + + +/** + * .plural( value ) + * + * @value [Number] + * + * Return the corresponding form (zero | one | two | few | many | other) of a + * value given locale. + */ +Globalize.plural = +Globalize.prototype.plural = function( value, options ) { + validateParameterPresence( value, "value" ); + validateParameterTypeNumber( value, "value" ); + return this.pluralGenerator( options )( value ); +}; + +/** + * .pluralGenerator( [options] ) + * + * Return a plural function (of the form below). + * + * fn( value ) + * + * @value [Number] + * + * Return the corresponding form (zero | one | two | few | many | other) of a value given the + * default/instance locale. + */ +Globalize.pluralGenerator = +Globalize.prototype.pluralGenerator = function( options ) { + var args, cldr, isOrdinal, plural, returnFn, type; + + validateParameterTypePlainObject( options, "options" ); + + options = options || {}; + cldr = this.cldr; + + args = [ options ]; + type = options.type || "cardinal"; + + validateParameterTypePluralType( options.type, "options.type" ); + + validateDefaultLocale( cldr ); + + isOrdinal = type === "ordinal"; + + cldr.on( "get", validateCldr ); + cldr.supplemental([ "plurals-type-" + type, "{language}" ]); + cldr.off( "get", validateCldr ); + + MakePlural.rules = {}; + MakePlural.rules[ type ] = cldr.supplemental( "plurals-type-" + type ); + + plural = new MakePlural( cldr.attributes.language, { + "ordinals": isOrdinal, + "cardinals": !isOrdinal + }); + + returnFn = pluralGeneratorFn( plural ); + + runtimeBind( args, cldr, returnFn, [ plural ] ); + + return returnFn; +}; + +return Globalize; + + + + +})); diff --git a/StockManMVC/.bin/bower_components/globalize/dist/globalize/relative-time.js b/StockManMVC/.bin/bower_components/globalize/dist/globalize/relative-time.js new file mode 100644 index 0000000..e179a80 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/dist/globalize/relative-time.js @@ -0,0 +1,201 @@ +/** + * Globalize v1.1.1 + * + * http://github.com/jquery/globalize + * + * Copyright 2010, 2014 jQuery Foundation, Inc. and other contributors + * Released under the MIT license + * http://jquery.org/license + * + * Date: 2016-02-04T12:01Z + */ +/*! + * Globalize v1.1.1 2016-02-04T12:01Z Released under the MIT license + * http://git.io/TrdQbw + */ +(function( root, factory ) { + + // UMD returnExports + if ( typeof define === "function" && define.amd ) { + + // AMD + define([ + "cldr", + "../globalize", + "./number", + "./plural", + "cldr/event", + "cldr/supplemental" + ], factory ); + } else if ( typeof exports === "object" ) { + + // Node, CommonJS + module.exports = factory( require( "cldrjs" ), require( "globalize" ) ); + } else { + + // Extend global + factory( root.Cldr, root.Globalize ); + } +}(this, function( Cldr, Globalize ) { + +var formatMessage = Globalize._formatMessage, + runtimeBind = Globalize._runtimeBind, + validateCldr = Globalize._validateCldr, + validateDefaultLocale = Globalize._validateDefaultLocale, + validateParameterPresence = Globalize._validateParameterPresence, + validateParameterTypeString = Globalize._validateParameterTypeString, + validateParameterTypeNumber = Globalize._validateParameterTypeNumber; + + +/** + * format( value, numberFormatter, pluralGenerator, properties ) + * + * @value [Number] The number to format + * + * @numberFormatter [String] A numberFormatter from Globalize.numberFormatter + * + * @pluralGenerator [String] A pluralGenerator from Globalize.pluralGenerator + * + * @properties [Object] containing relative time plural message. + * + * Format relative time. + */ +var relativeTimeFormat = function( value, numberFormatter, pluralGenerator, properties ) { + + var relativeTime, + message = properties[ "relative-type-" + value ]; + + if ( message ) { + return message; + } + + relativeTime = value <= 0 ? properties[ "relativeTime-type-past" ] + : properties[ "relativeTime-type-future" ]; + + value = Math.abs( value ); + + message = relativeTime[ "relativeTimePattern-count-" + pluralGenerator( value ) ]; + return formatMessage( message, [ numberFormatter( value ) ] ); +}; + + + + +var relativeTimeFormatterFn = function( numberFormatter, pluralGenerator, properties ) { + return function relativeTimeFormatter( value ) { + validateParameterPresence( value, "value" ); + validateParameterTypeNumber( value, "value" ); + + return relativeTimeFormat( value, numberFormatter, pluralGenerator, properties ); + }; + +}; + + + + +/** + * properties( unit, cldr, options ) + * + * @unit [String] eg. "day", "week", "month", etc. + * + * @cldr [Cldr instance]. + * + * @options [Object] + * - form: [String] eg. "short" or "narrow". Or falsy for default long form. + * + * Return relative time properties. + */ +var relativeTimeProperties = function( unit, cldr, options ) { + + var form = options.form, + raw, properties, key, match; + + if ( form ) { + unit = unit + "-" + form; + } + + raw = cldr.main( [ "dates", "fields", unit ] ); + properties = { + "relativeTime-type-future": raw[ "relativeTime-type-future" ], + "relativeTime-type-past": raw[ "relativeTime-type-past" ] + }; + for ( key in raw ) { + if ( raw.hasOwnProperty( key ) ) { + match = /relative-type-(-?[0-9]+)/.exec( key ); + if ( match ) { + properties[ key ] = raw[ key ]; + } + } + } + + return properties; +}; + + + + +/** + * .formatRelativeTime( value, unit [, options] ) + * + * @value [Number] The number of unit to format. + * + * @unit [String] see .relativeTimeFormatter() for details. + * + * @options [Object] see .relativeTimeFormatter() for details. + * + * Formats a relative time according to the given unit, options, and the default/instance locale. + */ +Globalize.formatRelativeTime = +Globalize.prototype.formatRelativeTime = function( value, unit, options ) { + validateParameterPresence( value, "value" ); + validateParameterTypeNumber( value, "value" ); + + return this.relativeTimeFormatter( unit, options )( value ); +}; + +/** + * .relativeTimeFormatter( unit [, options ]) + * + * @unit [String] String value indicating the unit to be formatted. eg. "day", "week", "month", etc. + * + * @options [Object] + * - form: [String] eg. "short" or "narrow". Or falsy for default long form. + * + * Returns a function that formats a relative time according to the given unit, options, and the + * default/instance locale. + */ +Globalize.relativeTimeFormatter = +Globalize.prototype.relativeTimeFormatter = function( unit, options ) { + var args, cldr, numberFormatter, pluralGenerator, properties, returnFn; + + validateParameterPresence( unit, "unit" ); + validateParameterTypeString( unit, "unit" ); + + cldr = this.cldr; + options = options || {}; + + args = [ unit, options ]; + + validateDefaultLocale( cldr ); + + cldr.on( "get", validateCldr ); + properties = relativeTimeProperties( unit, cldr, options ); + cldr.off( "get", validateCldr ); + + numberFormatter = this.numberFormatter( options ); + pluralGenerator = this.pluralGenerator(); + + returnFn = relativeTimeFormatterFn( numberFormatter, pluralGenerator, properties ); + + runtimeBind( args, cldr, returnFn, [ numberFormatter, pluralGenerator, properties ] ); + + return returnFn; +}; + +return Globalize; + + + + +})); diff --git a/StockManMVC/.bin/bower_components/globalize/dist/globalize/unit.js b/StockManMVC/.bin/bower_components/globalize/dist/globalize/unit.js new file mode 100644 index 0000000..a847a7d --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/dist/globalize/unit.js @@ -0,0 +1,300 @@ +/** + * Globalize v1.1.1 + * + * http://github.com/jquery/globalize + * + * Copyright 2010, 2014 jQuery Foundation, Inc. and other contributors + * Released under the MIT license + * http://jquery.org/license + * + * Date: 2016-02-04T12:01Z + */ +/*! + * Globalize v1.1.1 2016-02-04T12:01Z Released under the MIT license + * http://git.io/TrdQbw + */ +(function( root, factory ) { + + // UMD returnExports + if ( typeof define === "function" && define.amd ) { + + // AMD + define([ + "cldr", + "../globalize", + "./number", + "./plural" + ], factory ); + } else if ( typeof exports === "object" ) { + + // Node, CommonJS + module.exports = factory( require( "cldrjs" ), require( "globalize" ) ); + } else { + + // Extend global + factory( root.Cldr, root.Globalize ); + } +}(this, function( Cldr, Globalize ) { + +var formatMessage = Globalize._formatMessage, + runtimeBind = Globalize._runtimeBind, + validateParameterPresence = Globalize._validateParameterPresence, + validateParameterTypePlainObject = Globalize._validateParameterTypePlainObject, + validateParameterTypeNumber = Globalize._validateParameterTypeNumber, + validateParameterTypeString = Globalize._validateParameterTypeString; + + +/** + * format( value, numberFormatter, pluralGenerator, unitProperies ) + * + * @value [Number] + * + * @numberFormatter [Object]: A numberFormatter from Globalize.numberFormatter. + * + * @pluralGenerator [Object]: A pluralGenerator from Globalize.pluralGenerator. + * + * @unitProperies [Object]: localized unit data from cldr. + * + * Format units such as seconds, minutes, days, weeks, etc. + * + * OBS: + * + * Unit Sequences are not implemented. + * http://www.unicode.org/reports/tr35/tr35-35/tr35-general.html#Unit_Sequences + * + * Duration Unit (for composed time unit durations) is not implemented. + * http://www.unicode.org/reports/tr35/tr35-35/tr35-general.html#durationUnit + */ +var unitFormat = function( value, numberFormatter, pluralGenerator, unitProperties ) { + var compoundUnitPattern = unitProperties.compoundUnitPattern, dividend, dividendProperties, + formattedValue, divisor, divisorProperties, message, pluralValue; + + unitProperties = unitProperties.unitProperties; + formattedValue = numberFormatter( value ); + pluralValue = pluralGenerator( value ); + + // computed compound unit, eg. "megabyte-per-second". + if ( unitProperties instanceof Array ) { + dividendProperties = unitProperties[ 0 ]; + divisorProperties = unitProperties[ 1 ]; + + dividend = formatMessage( dividendProperties[ pluralValue ], [ value ] ); + divisor = formatMessage( divisorProperties.one, [ "" ] ).trim(); + + return formatMessage( compoundUnitPattern, [ dividend, divisor ] ); + } + + message = unitProperties[ pluralValue ]; + + return formatMessage( message, [ formattedValue ] ); +}; + + + + +var unitFormatterFn = function( numberFormatter, pluralGenerator, unitProperties ) { + return function unitFormatter( value ) { + validateParameterPresence( value, "value" ); + validateParameterTypeNumber( value, "value" ); + + return unitFormat( value, numberFormatter, pluralGenerator, unitProperties ); + }; + +}; + + + + +/** + * categories() + * + * Return all unit categories. + */ +var unitCategories = [ "acceleration", "angle", "area", "digital", "duration", "length", "mass", "power", +"pressure", "speed", "temperature", "volume" ]; + + + + +function stripPluralGarbage( data ) { + var aux, pluralCount; + + if ( data ) { + aux = {}; + for ( pluralCount in data ) { + aux[ pluralCount.replace( /unitPattern-count-/, "" ) ] = data[ pluralCount ]; + } + } + + return aux; +} + +/** + * get( unit, form, cldr ) + * + * @unit [String] The full type-unit name (eg. duration-second), or the short unit name + * (eg. second). + * + * @form [String] A string describing the form of the unit representation (eg. long, + * short, narrow). + * + * @cldr [Cldr instance]. + * + * Return the plural map of a unit, eg: "second" + * { "one": "{0} second", + * "other": "{0} seconds" } + * } + * + * Or the Array of plural maps of a compound-unit, eg: "foot-per-second" + * [ { "one": "{0} foot", + * "other": "{0} feet" }, + * { "one": "{0} second", + * "other": "{0} seconds" } ] + * + * Uses the precomputed form of a compound-unit if available, eg: "mile-per-hour" + * { "displayName": "miles per hour", + * "unitPattern-count-one": "{0} mile per hour", + * "unitPattern-count-other": "{0} miles per hour" + * }, + * + * Also supports "/" instead of "-per-", eg. "foot/second", using the precomputed form if + * available. + * + * Or the Array of plural maps of a compound-unit, eg: "foot-per-second" + * [ { "one": "{0} foot", + * "other": "{0} feet" }, + * { "one": "{0} second", + * "other": "{0} seconds" } ] + * + * Or undefined in case the unit (or a unit of the compound-unit) doesn't exist. + */ +var get = function( unit, form, cldr ) { + var ret; + + // Ensure that we get the 'precomputed' form, if present. + unit = unit.replace( /\//, "-per-" ); + + // Get unit or -unit (eg. "duration-second"). + [ "" ].concat( unitCategories ).some(function( category ) { + return ret = cldr.main([ + "units", + form, + category.length ? category + "-" + unit : unit + ]); + }); + + // Rename keys s/unitPattern-count-//g. + ret = stripPluralGarbage( ret ); + + // Compound Unit, eg. "foot-per-second" or "foot/second". + if ( !ret && ( /-per-/ ).test( unit ) ) { + + // "Some units already have 'precomputed' forms, such as kilometer-per-hour; + // where such units exist, they should be used in preference" UTS#35. + // Note that precomputed form has already been handled above (!ret). + + // Get both recursively. + unit = unit.split( "-per-" ); + ret = unit.map(function( unit ) { + return get( unit, form, cldr ); + }); + if ( !ret[ 0 ] || !ret[ 1 ] ) { + return; + } + } + + return ret; +}; + +var unitGet = get; + + + + +/** + * properties( unit, form, cldr ) + * + * @unit [String] The full type-unit name (eg. duration-second), or the short unit name + * (eg. second). + * + * @form [String] A string describing the form of the unit representation (eg. long, + * short, narrow). + * + * @cldr [Cldr instance]. + */ +var unitProperties = function( unit, form, cldr ) { + var compoundUnitPattern, unitProperties; + + compoundUnitPattern = cldr.main( [ "units", form, "per/compoundUnitPattern" ] ); + unitProperties = unitGet( unit, form, cldr ); + + return { + compoundUnitPattern: compoundUnitPattern, + unitProperties: unitProperties + }; +}; + + + + +/** + * Globalize.formatUnit( value, unit, options ) + * + * @value [Number] + * + * @unit [String]: The unit (e.g "second", "day", "year") + * + * @options [Object] + * - form: [String] "long", "short" (default), or "narrow". + * + * Format units such as seconds, minutes, days, weeks, etc. + */ +Globalize.formatUnit = +Globalize.prototype.formatUnit = function( value, unit, options ) { + validateParameterPresence( value, "value" ); + validateParameterTypeNumber( value, "value" ); + + return this.unitFormatter( unit, options )( value ); +}; + +/** + * Globalize.unitFormatter( unit, options ) + * + * @unit [String]: The unit (e.g "second", "day", "year") + * + * @options [Object] + * - form: [String] "long", "short" (default), or "narrow". + * + * - numberFormatter: [Function] a number formatter function. Defaults to Globalize + * `.numberFormatter()` for the current locale using the default options. + */ +Globalize.unitFormatter = +Globalize.prototype.unitFormatter = function( unit, options ) { + var args, form, numberFormatter, pluralGenerator, returnFn, properties; + + validateParameterPresence( unit, "unit" ); + validateParameterTypeString( unit, "unit" ); + + validateParameterTypePlainObject( options, "options" ); + + options = options || {}; + + args = [ unit, options ]; + form = options.form || "long"; + properties = unitProperties( unit, form, this.cldr ); + + numberFormatter = options.numberFormatter || this.numberFormatter(); + pluralGenerator = this.pluralGenerator(); + returnFn = unitFormatterFn( numberFormatter, pluralGenerator, properties ); + + runtimeBind( args, this.cldr, returnFn, [ numberFormatter, pluralGenerator, properties ] ); + + return returnFn; +}; + +return Globalize; + + + + +})); diff --git a/StockManMVC/.bin/bower_components/globalize/dist/node-main.js b/StockManMVC/.bin/bower_components/globalize/dist/node-main.js new file mode 100644 index 0000000..1e8a16d --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/dist/node-main.js @@ -0,0 +1,27 @@ +/*! + * Globalize v1.1.1 + * + * http://github.com/jquery/globalize + * + * Copyright jQuery Foundation and other contributors + * Released under the MIT license + * http://jquery.org/license + * + * Date: 2016-02-04T12:01Z + */ + +// Core +module.exports = require( "./globalize" ); + +// Extent core with the following modules +require( "./globalize/message" ); +require( "./globalize/number" ); +require( "./globalize/plural" ); + +// Load after globalize/number +require( "./globalize/currency" ); +require( "./globalize/date" ); + +// Load after globalize/number and globalize/plural +require( "./globalize/relative-time" ); +require( "./globalize/unit" ); diff --git a/StockManMVC/.bin/bower_components/globalize/doc/api/core/constructor.md b/StockManMVC/.bin/bower_components/globalize/doc/api/core/constructor.md new file mode 100644 index 0000000..364743a --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/doc/api/core/constructor.md @@ -0,0 +1,30 @@ +## [new] Globalize( locale|cldr ) + +Create a Globalize instance. + +**locale|cldr** + +Locale string or [Cldr instance](https://github.com/rxaviers/cldrjs) of the +instance. + +### Example + +Prior to creating any Globalize instance, you must load +`cldr/supplemental/likelySubtags.json`. Read [CLDR content][] if you need more +information. + +[CLDR content]: ../../../README.md#2-cldr-content + +```javascript +var en = new Globalize( "en" ); + +// You can optionally omit the `new` operator. +var pt = Globalize( "pt" ); + +en.formatNumber( 3.1415 ); +// > 3.142 + +pt.formatNumber( 3.1415 ); +// > 3,142 + +``` diff --git a/StockManMVC/.bin/bower_components/globalize/doc/api/core/load.md b/StockManMVC/.bin/bower_components/globalize/doc/api/core/load.md new file mode 100644 index 0000000..ebabc0b --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/doc/api/core/load.md @@ -0,0 +1,99 @@ +## Globalize.load( cldrJSONData, ... ) + +This method allows you to load CLDR JSON locale data. `Globalize.load()` is a +proxy to `Cldr.load()`. + +This method can be called as many time as needed. All passed JSON objects are +deeply merged internally. + +For more information, see https://github.com/rxaviers/cldrjs#readme. + +### Parameters + +**cldrJSONData** + +A JSON object with CLDR data. See [Getting Started](#../../../README.md#2-cldr-content) +for more information. + +### Example + +```javascript +Globalize.load({ + "main": { + "en": { + "identity": { + "version": { + "_cldrVersion": "25", + "_number": "$Revision: 91 $" + }, + "generation": { + "_date": "$Date: 2014-03-13 22:27:12 -0500 (Thu, 13 Mar 2014) $" + }, + "language": "en" + }, + "dates": { + "calendars": { + "gregorian": { + "months": { + "format": { + "abbreviated": { + "1": "Jan", + "2": "Feb", + "3": "Mar", + "4": "Apr", + "5": "May", + "6": "Jun", + "7": "Jul", + "8": "Aug", + "9": "Sep", + "10": "Oct", + "11": "Nov", + "12": "Dec" + } + } + }, + "dayPeriods": { + "format": { + "wide": { + "am": "AM", + "am-alt-variant": "am", + "noon": "noon", + "pm": "PM", + "pm-alt-variant": "pm" + } + } + }, + "dateFormats": { + "medium": "MMM d, y" + }, + "timeFormats": { + "medium": "h:mm:ss a", + }, + "dateTimeFormats": { + "medium": "{1}, {0}" + } + } + } + }, + "numbers": { + "defaultNumberingSystem": "latn", + "symbols-numberSystem-latn": { + "group": "," + }, + "decimalFormats-numberSystem-latn": { + "standard": "#,##0.###" + } + } + } + }, + "supplemental": { + "version": { + "_cldrVersion": "25", + "_number": "$Revision: 91 $" + }, + "likelySubtags": { + "en": "en-Latn-US", + } + } +}); +``` diff --git a/StockManMVC/.bin/bower_components/globalize/doc/api/core/locale.md b/StockManMVC/.bin/bower_components/globalize/doc/api/core/locale.md new file mode 100644 index 0000000..eeaf8be --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/doc/api/core/locale.md @@ -0,0 +1,54 @@ +## Globalize.locale( [locale|cldr] ) + +Set default locale, or get it if locale argument is omitted. + +Return the default [Cldr instance](https://github.com/rxaviers/cldrjs). + +An application that supports globalization and/or localization will need to +have a way to determine the user's preference. Attempting to automatically +determine the appropriate locale is useful, but it is good practice to always +offer the user a choice, by whatever means. + +Whatever your mechanism, it is likely that you will have to correlate the +user's preferences with the list of locale data supported in the app. This +method allows you to select the best match given the locale data that you +have included and to set the Globalize locale to the one which the user +prefers. + +LanguageMatching TBD (CLDR's spec http://www.unicode.org/reports/tr35/#LanguageMatching). + +### Parameters + +**locale|cldr** + +The locale string, eg. `en`, `pt-BR`, or `zh-Hant-TW`. Or, + +The [Cldr instance](https://github.com/rxaviers/cldrjs), eg. new +`Cldr( "en" )`. + +### Example + +Prior to using this function, you must load +`cldr/supplemental/likelySubtags.json`. Read [CLDR content][] if you need more +information. + +[CLDR content]: ../../../README.md#2-cldr-content + +```javascript +// Set "pt" as our default locale. +Globalize.locale( "pt" ); + +// Get default locale. +Globalize.locale(); +// > { +// attributes: { +// "languageId": "pt", +// "maxLanguageId": "pt_Latn_BR", +// "language": "pt", +// "script": "Latn", +// "territory": "BR", +// "region": "BR" +// }, +// some more stuff... +// } +``` diff --git a/StockManMVC/.bin/bower_components/globalize/doc/api/currency/currency-formatter.md b/StockManMVC/.bin/bower_components/globalize/doc/api/currency/currency-formatter.md new file mode 100644 index 0000000..d6e4038 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/doc/api/currency/currency-formatter.md @@ -0,0 +1,164 @@ +## .currencyFormatter( currency [, options] ) ➜ function( value ) + +Return a function that formats a `currency` according to the given `options` or +locale's defaults. + +The returned function is invoked with one argument: the Number `value` to be +formatted. + +### Parameters + +**currency** + +3-letter currency code as defined by ISO 4217, eg. `USD`. + +**options** Optional + +A JSON object including none or any of the following options. + +> **style** Optional +> +> String `symbol` (default), `accounting`, `code` or `name`. + +See [`.numberFormatter( [options] )`](../number/number-formatter.md) for more +options. + +**value** + +Number to be formatted, eg. `9.99`. + +### Example + +Prior to using any currency methods, you must load +`cldr/main/{locale}/currencies.json`, `cldr/supplemental/currencyData.json`, and +the CLDR content required by the number module. If using plural messages, you +also must load the CLDR content required by the plural module. Read [CLDR +content][] if you need more information. + +[CLDR content]: ../../../README.md#2-cldr-content + +You can use the static method `Globalize.currencyFormatter()`, which uses the +default locale. + +```javascript +var formatter; + +Globalize.locale( "en" ); +formatter = Globalize.currencyFormatter( "USD" ); + +formatter( 9.99 ); +// > "$9.99" + +``` + +You can use the instance method `.currencyFormatter()`, which uses the instance +locale. + +```javascript +var deFormatter = Globalize( "de" ).currencyFormatter( "EUR" ), + zhFormatter = Globalize( "zh" ).currencyFormatter( "EUR" ); + +deFormatter( 9.99 ); +// > "9,99 €" + +zhFormatter( 9.99 ); +// > "€ 9.99" + +``` + +For comparison, follow the formatting output of different symbols in different +locales. + +| 3-letter currency code | en (English) | de (German) | zh (Chinese) | +| --- | --- | --- | --- | +| `.currencyFormatter( "USD" )( 1 )` | `$1.00` | `1,00 $` | `US$ 1.00` | +| `.currencyFormatter( "EUR" )( 1 )` | `€1.00` | `1,00 €` | `€ 1.00` | +| `.currencyFormatter( "CNY" )( 1 )` | `CN¥1.00` | `1,00 CN¥` | `¥ 1.00` | +| `.currencyFormatter( "JPY" )( 1 )` | `¥1` | `1 ¥` | `JP¥ 1` | +| `.currencyFormatter( "GBP" )( 1 )` | `£1.00` | `1,00 £` | `£ 1.00` | +| `.currencyFormatter( "BRL" )( 1 )` | `R$1.00` | `1,00 R$` | `R$ 1.00` | + +For the accounting variation of the symbol format, use `style: "accounting"`. + +```javascript +var formatter = Globalize( "en" ).currencyFormatter( "USD", { + style: "accounting" +}); + +formatter( -1 ); +// > "($1.00)" +``` + +For plural messages, use `style: "name"`. + +```javascript +var formatter = Globalize( "en" ).currencyFormatter( "USD", { + style: "name" +}); + +formatter( 0 ); +// > "0.00 US dollars" + +formatter( 1 ); +// > "1.00 US dollar" +``` + +For comparison, follow the formatting output of different symbols in different +locales using the plural messages `Globalize( locale ).currencyFormatter( currency, +{ style: "name" } )( 1 )`. + +| 3-letter currency code | en (English) | de (German) | zh (Chinese) | +| --- | --- | --- | --- | +| `USD` | `1.00 US dollar` | `1,00 US-Dollar` | `1.00美元` | +| `EUR` | `1.00 euro` | `1,00 Euro` | `1.00欧元` | +| `CNY` | `1.00 Chinese yuan` | `1,00 Chinesischer Yuan` | `1.00人民币` | +| `JPY` | `1 Japanese yen` | `1 Japanischer Yen` | `1日元` | +| `GBP` | `1.00 British pound sterling` | `1,00 Britisches Pfund Sterling` | `1.00英镑` | +| `BRL` | `1.00 Brazilian real` | `1,00 Brasilianischer Real` | `1.00巴西雷亚尔` | + +For the international currency code, use `style: "code"`. + +```javascript +var formatter = Globalize( "en" ).currencyFormatter( "USD", { + style: "code" +}); + +formatter( 9.99 ); +// > "9.99 USD" +``` + +Override the number of digits, grouping separators, rounding function or any +other [`.numberFormatter()` options](../number/number-formatter.md). + +```javascript +var formatter; + +Globalize.locale( "en" ); +formatter = Globalize.currencyFormatter( "USD", { + minimumFractionDigits: 0, + style: "name" +}); + +formatter( 1 ); +// > "1 US dollar" + +formatter = Globalize.currencyFormatter( "USD", { + round: "ceil" +}); + +formatter( 1.491 ); +// > "$1.50" +``` + +For improved performance on iterations, first create the formatter. Then, reuse +it on each loop. + +```javascript +var formatter = Globalize( "en" ).currencyFormatter( "USD" ); + +renderInvoice({ + prices: prices.map(function( price ) { + return formatter( price ); + }) +}); +``` diff --git a/StockManMVC/.bin/bower_components/globalize/doc/api/date/date-formatter.md b/StockManMVC/.bin/bower_components/globalize/doc/api/date/date-formatter.md new file mode 100644 index 0000000..8c3475c --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/doc/api/date/date-formatter.md @@ -0,0 +1,199 @@ +## .dateFormatter( [options] ) ➜ function( value ) + +Return a function that formats a date according to the given `options`. The +default formatting is numeric year, month, and day (i.e., `{ skeleton: "yMd" }`. + +The returned function is invoked with one argument: the Date instance `value` to +be formatted. + +### Parameters + +**options** + +A JSON object including one of the following. + +> **skeleton** +> +> String value indicating a skeleton (see description above), eg. +> `{ skeleton: "GyMMMd" }`. +> +> Skeleton provides a more flexible formatting mechanism than the predefined +> list `full`, `long`, `medium`, or `short` represented by date, time, or +> datetime. Instead, they are an open-ended list of patterns containing +> only date field information, and in a canonical order. For a complete list of +> skeleton patterns [check the unicode CLDR documentation](http://www.unicode.o +> rg/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table). +> +> For example: +> +> | locale | `"GyMMMd"` skeleton | +> | --- | --- | +> | *en* | `"Apr 9, 2014 AD"` | +> | *zh* | `"公元2014年4月9日"` | +> | *es* | `"9 abr. de 2014 d. C."` | +> | *ar* | `"٩ أبريل، ٢٠١٤ م"` | +> | *pt* | `"9 de abr de 2014 d.C."` | + +> **date** +> +> One of the following String values: `full`, `long`, `medium`, or `short`, eg. +> `{ date: "full" }`. +> +> **time** +> +> One of the following String values: `full`, `long`, `medium`, or `short`, eg. +> `{ time: "full" }`. +> +> **datetime** +> +> One of the following String values: `full`, `long`, `medium`, or `short`, eg. +> `{ datetime: "full" }` +> +> **raw** +> +> String value indicating a machine +> [raw pattern (anything in the "Sym." column)](http://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table) +> eg. `{ raw: "dd/mm" }`. Note this is NOT recommended for i18n in general. +> Use `skeleton` instead. + +**value** + +Date instance to be formatted, eg. `new Date()`; + +### Example + +Prior to using any date methods, you must load +`cldr/main/{locale}/ca-gregorian.json`, `cldr/main/{locale}/timeZoneNames.json`, +`cldr/supplemental/timeData.json`, `cldr/supplemental/weekData.json`, and the +CLDR content required by the number module. Read [CLDR content][] if you need +more information. + +[CLDR content]: ../../../README.md#2-cldr-content + +You can use the static method `Globalize.dateFormatter()`, which uses the default +locale. + +```javascript +var formatter; + +Globalize.locale( "en" ); +formatter = Globalize.dateFormatter(); + +formatter( new Date( 2010, 10, 30, 17, 55 ) ); +// > "11/30/2010" +``` + +You can use the instance method `.dateFormatter()`, which uses the instance locale. + +```javascript +var enFormatter = Globalize( "en" ).dateFormatter(), + deFormatter = Globalize( "de" ).dateFormatter(); + +enFormatter( new Date( 2010, 10, 30, 17, 55 ) ); +// > "11/30/2010, 5:55 PM" + +deFormatter( new Date( 2010, 10, 30, 17, 55 ) ); +// > "30.11.2010" +``` + +Use convenient presets for `date`, `time`, or `datetime`. Their possible values +are: `full`, `long`, `medium`, and `short`. + +| `presetValue` | `Globalize( "en" ).dateFormatter( presetValue )( new Date( 2010, 10, 1, 17, 55 ) )` | +| --- | --- | +| `{ date: "short" }` | `"11/1/10"` | +| `{ date: "medium" }` | `"Nov 1, 2010"` | +| `{ date: "long" }` | `"November 1, 2010"` | +| `{ date: "full" }` | `"Monday, November 1, 2010"` | +| `{ time: "short" }` | `"5:55 PM"` | +| `{ time: "medium" }` | `"5:55:00 PM"` | +| `{ time: "long" }` | `"5:55:00 PM GMT-2"` | +| `{ time: "full" }` | `"5:55:00 PM GMT-02:00"` | +| `{ datetime: "short" }` | `"11/1/10, 5:55 PM"` | +| `{ datetime: "medium" }` | `"Nov 1, 2010, 5:55:00 PM"` | +| `{ datetime: "long" }` | `"November 1, 2010 at 5:55:00 PM GMT-2"` | +| `{ datetime: "full" }` | `"Monday, November 1, 2010 at 5:55:00 PM GMT-02:00"` | + +For comparison, follow the same formatter `{ datetime: "short" }` on different locales. + +| locale | `Globalize( locale ).dateFormatter({ datetime: "short" })( new Date( 2010, 10, 1, 17, 55 ) )` | +| --- | --- | +| *en* | `"11/1/10, 5:55 PM"` | +| *en_GB* | `"01/11/2010 17:55"` | +| *zh* | `"10/11/1 下午5:55"` | +| *zh-u-nu-native* | `"一〇/一一/一 下午五:五五"` | +| *es* | `"1/11/10 17:55"` | +| *de* | `"01.11.10 17:55"` | +| *pt* | `"01/11/10 17:55"` | +| *ar* | `"١‏/١١‏/٢٠١٠ ٥،٥٥ م"` | + +Use skeletons for more flexibility (see its description [above](#parameters)). + +| `skeleton` | `Globalize( "en" ).dateFormatter( skeleton )( new Date( 2010, 10, 1, 17, 55 ) )` | +| --- | --- | +| `{ skeleton: "E" }` | `"Tue"` | +| `{ skeleton: "EHm" }` | `"Tue 17:55"` | +| `{ skeleton: "EHms" }` | `"Tue 17:55:00"` | +| `{ skeleton: "Ed" }` | `"30 Tue"` | +| `{ skeleton: "Ehm" }` | `"Tue 5:55 PM"` | +| `{ skeleton: "Ehms" }` | `"Tue 5:55:00 PM"` | +| `{ skeleton: "Gy" }` | `"2010 AD"` | +| `{ skeleton: "GyMMM" }` | `"Nov 2010 AD"` | +| `{ skeleton: "GyMMMEd" }` | `"Tue, Nov 30, 2010 AD"` | +| `{ skeleton: "GyMMMd" }` | `"Nov 30, 2010 AD"` | +| `{ skeleton: "H" }` | `"17"` | +| `{ skeleton: "Hm" }` | `"17:55"` | +| `{ skeleton: "Hms" }` | `"17:55:00"` | +| `{ skeleton: "M" }` | `"11"` | +| `{ skeleton: "MEd" }` | `"Tue, 11/30"` | +| `{ skeleton: "MMM" }` | `"Nov"` | +| `{ skeleton: "MMMEd" }` | `"Tue, Nov 30"` | +| `{ skeleton: "MMMd" }` | `"Nov 30"` | +| `{ skeleton: "Md" }` | `"11/30"` | +| `{ skeleton: "d" }` | `"30"` | +| `{ skeleton: "h" }` | `"5 PM"` | +| `{ skeleton: "hm" }` | `"5:55 PM"` | +| `{ skeleton: "hms" }` | `"5:55:00 PM"` | +| `{ skeleton: "ms" }` | `"55:00"` | +| `{ skeleton: "y" }` | `"2010"` | +| `{ skeleton: "yM" }` | `"11/2010"` | +| `{ skeleton: "yMEd" }` | `"Tue, 11/30/2010"` | +| `{ skeleton: "yMMM" }` | `"Nov 2010"` | +| `{ skeleton: "yMMMEd" }` | `"Tue, Nov 30, 2010"` | +| `{ skeleton: "yMMMd" }` | `"Nov 30, 2010"` | +| `{ skeleton: "yMd" }` | `"11/30/2010"` | +| `{ skeleton: "yQQQ" }` | `"Q4 2010"` | +| `{ skeleton: "yQQQQ" }` | `"4th quarter 2010"` | +| `{ skeleton: "GyMMMEdhms" }` | `"Tue, Nov 30, 2010 AD, 5:55:00 PM"` | +| `{ skeleton: "Ehms" }` | `"Tue 5:55:00 PM"` | +| `{ skeleton: "yQQQHm" }` | `"Q4 2010, 17:55"` | +| `{ skeleton: "MMMEdhm" }` | `"Tue, Nov 30, 5:55 PM"` | +| `{ skeleton: "yMMMdhm" }` | `"Nov 30, 2010, 5:55 PM"` | + + +```javascript +var globalize = Globalize( "en" ), + date = new Date( 2010, 10, 30, 17, 55 ), + monthDayFormatter = globalize.dateFormatter({ skeleton: "MMMd" }), + hourMinuteSecondFormatter = globalize.dateFormatter({ skeleton: "Hms" }); + +monthDayFormatter( date ); +// > "Nov 30" + +hourMinuteSecondFormatter( date ); +// > "17:55:00" +``` + +For improved performance on iterations, first create the formatter. Then, reuse +it on each loop. + +```javascript +// In an application, this array could have a few hundred entries +var dates = [ new Date( 2010, 10, 30, 17, 55 ), new Date( 2015, 3, 18, 4, 25 ) ]; +var formatter = Globalize( "en" ).dateFormatter({ time: "short" }); + +var formattedDates = dates.map(function( date ) { + return formatter( date ); +}); +// > Array [ "5:55 PM", "4:25 AM" ] +``` diff --git a/StockManMVC/.bin/bower_components/globalize/doc/api/date/date-parser.md b/StockManMVC/.bin/bower_components/globalize/doc/api/date/date-parser.md new file mode 100644 index 0000000..579ec36 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/doc/api/date/date-parser.md @@ -0,0 +1,68 @@ +## .dateParser( [options] ) ➜ function( value ) + +Return a function that parses a string representing a date into a JavaScript +Date object according to the given `options`. The default parsing assumes numeric year, month, and +day (i.e., `{ skeleton: "yMd" }`). + +The returned function is invoked with one argument: the String `value` to be +parsed. + +### Parameters + +**options** + +See [.dateFormatter( [options] )](./date-formatter.md). + +**value** + +String with date to be parsed, eg. `"11/1/10, 5:55 PM"`. + +### Example + +Prior to using any date methods, you must load +`cldr/main/{locale}/ca-gregorian.json`, `cldr/main/{locale}/timeZoneNames.json`, +`cldr/supplemental/timeData.json`, `cldr/supplemental/weekData.json`, and the +CLDR content required by the number module. Read [CLDR content][] if you need +more information. + +[CLDR content]: ../../../README.md#2-cldr-content + +You can use the static method `Globalize.dateParser()`, which uses the default +locale. + +```javascript +var parser; + +Globalize.locale( "en" ); +parser = Globalize.dateParser(); + +parser( "1/2/2013" ); +// > Wed Jan 02 2013 00:00:00 + +Globalize.locale( "es" ); +parser = Globalize.dateParser(); + +parser( "1/2/2013" ); +// > Fri Feb 01 2013 00:00:00 +``` + +You can use the instance method `.dateParser()`, which uses the instance locale. + +```javascript +var esParser = Globalize( "es" ).dateParser({ date: short }); + +esParser( "1/2/13" ); +// > Fri Feb 01 2013 00:00:00 +``` + +For improved performance on iterations, first create the parser. Then, reuse it +on each loop. + +```javascript +var formattedDates = [ new Date( a ), new Date( b ), ... ]; +var parser = Globalize( "en" ).dateParser({ time: "short" }); + +dates = formattedDates.map(function( formattedDate ) { + return parser( formattedDate ); +}); +``` diff --git a/StockManMVC/.bin/bower_components/globalize/doc/api/message/load-messages.md b/StockManMVC/.bin/bower_components/globalize/doc/api/message/load-messages.md new file mode 100644 index 0000000..a7d4e87 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/doc/api/message/load-messages.md @@ -0,0 +1,116 @@ +## .loadMessages( json ) + +Load messages data. + +The first level of keys must be locales. For example: + +``` +{ + en: { + hello: "Hello" + }, + pt: { + hello: "Olá" + } +} +``` + +ICU MessageFormat pattern is supported: variable replacement, gender and plural +inflections. For more information see [`.messageFormatter( path ) ➡ function([ +variables ])`](./message-formatter.md). + +The provided messages are stored along side other cldr data, under the +"globalize-messages" key. This allows Globalize to reuse the traversal methods +provided by cldrjs. You can inspect this data using +`cldrjs.get("globalize-messages")`. + +### Parameters + +**json** + +JSON object of messages data. Keys can use any character, except `/`, `{` and +`}`. Values (i.e., the message content itself) can contain any character. + +### Example + +```javascript +Globalize.loadMessages({ + pt: { + greetings: { + hello: "Olá", + bye: "Tchau" + } + } +}); + +Globalize( "pt" ).formatMessage( "greetings/hello" ); +// > Olá +``` + +#### Multiline strings + +Use Arrays as a convenience for multiline strings. The lines will be joined by a +space. + +```javascript +Globalize.loadMessages({ + en: { + longText: [ + "Lorem ipsum dolor sit amet, consectetur adipisicing elit. Eligendi non", + "quis exercitationem culpa nesciunt nihil aut nostrum explicabo", + "reprehenderit optio amet ab temporibus asperiores quasi cupiditate.", + "Voluptatum ducimus voluptates voluptas?" + ] + } +}); + +Globalize( "en" ).formatMessage( "longText" ); +// > "Lorem ipsum dolor sit amet, consectetur adipisicing elit. Eligendi non quis exercitationem culpa nesciunt nihil aut nostrum explicabo reprehenderit optio amet ab temporibus asperiores quasi cupiditate. Voluptatum ducimus voluptates voluptas?" +``` + +#### Messages inheritance + +It's possible to inherit messages, for example: + +```javascript +Globalize.loadMessages({ + root: { + amen: "Amen" + }, + de: {}, + en: {}, + "en-GB": {}, + fr: {}, + pt: { + amen: "Amém" + }, + "pt-PT": {} +}); + +Globalize( "de" ).formatMessage( "amen" ); +// > "Amen" + +Globalize( "en" ).formatMessage( "amen" ); +// > "Amen" + +Globalize( "en-GB" ).formatMessage( "amen" ); +// > "Amen" + +Globalize( "fr" ).formatMessage( "amen" ); +// > "Amen" + +Globalize( "pt-PT" ).formatMessage( "amen" ); +// > "Amém" +``` + +Note that `de`, `en`, `en-GB`, `fr`, and `pt-PT` are empty. `.formatMessage()` +inherits `pt-PT` messages from `pt` (`pt-PT` ➡ `pt`), and it inherits the other +messages from root, eg. `en-GB` ➡ `en-001` ➡ `en` ➡ `root`. Yes, `root` is the +last bundle of the parent lookup. + +Attention: On browsers, message inheritance only works if the optional +dependency `cldr/unresolved` is loaded. + +```html + +``` diff --git a/StockManMVC/.bin/bower_components/globalize/doc/api/message/message-formatter.md b/StockManMVC/.bin/bower_components/globalize/doc/api/message/message-formatter.md new file mode 100644 index 0000000..2784c4a --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/doc/api/message/message-formatter.md @@ -0,0 +1,219 @@ +## .messageFormatter( path ) ➡ function([ variables ]) + +Return a function that formats a message (using ICU message format pattern) +given its path and a set of variables into a user-readable string. It supports +pluralization and gender inflections. + +Use [`Globalize.loadMessages( json )`](./load-messages.md) to load +messages data. + +### Parameters + +**path** + +String or Array containing the path of the message content, eg. +`"greetings/bye"`, or `[ "greetings", "bye" ]`. + +**variables** (optional) + +Variables can be Objects, where each property can be referenced by name inside a +message; or Arrays, where each entry of the Array can be used inside a message, +using numeric indices. When passing one or more arguments of other types, +they're converted to an Array and used as such. + +### Example + +You can use the static method `Globalize.messageFormatter()`, which uses the default +locale. + +```javascript +var formatter; + +Globalize.loadMessages({ + pt: { + greetings: { + bye: "Tchau" + } + } +}); + +Globalize.locale( "pt" ); +formatter = Globalize.messageFormatter( "greetings/bye" ); + +formatter(); +// > "Tchau" +``` + +You can use the instance method `.messageFormatter()`, which uses the instance locale. + +```javascript +var pt = new Globalize( "pt" ), + formatter = pt.messageFormatter( "greetings/bye" ); + +formatter(); +// > "Tchau" +``` + +#### Simple Variable Replacement + +```javascript +var formatter; + +Globalize.loadMessages({ + en: { + hello: "Hello, {0} {1} {2}", + hey: "Hey, {first} {middle} {last}" + } +}); + +formatter = Globalize( "en" ).messageFormatter( "hello" ); + +// Numbered variables using Array. +formatter([ "Wolfgang", "Amadeus", "Mozart" ]); +// > "Hello, Wolfgang Amadeus Mozart" + +// Numbered variables using function arguments. +formatter( "Wolfgang", "Amadeus", "Mozart" ); +// > "Hello, Wolfgang Amadeus Mozart" + +// Named variables using Object key-value pairs. +formatter = Globalize( "en" ).messageFormatter( "hey" ); +formatter({ + first: "Wolfgang", + middle: "Amadeus", + last: "Mozart" +}); +// > "Hey, Wolfgang Amadeus Mozart" +``` + +#### Gender inflections + +`select` can be used to format any message variations that works like a switch. + +```javascript +var formatter; + +// Note you can define multiple lines message using an Array of Strings. +Globalize.loadMessages({ + en: { + party: [ + "{hostGender, select,", + " female {{host} invites {guest} to her party}", + " male {{host} invites {guest} to his party}", + " other {{host} invites {guest} to their party}", + "}" + ] + } +}); + +formatter = Globalize( "en" ).messageFormatter( "party" ); + +formatter({ + guest: "Mozart", + host: "Beethoven", + hostGender: "male" +}); +// > "Beethoven invites Mozart to his party" +``` + +#### Plural inflections + +It uses the plural forms `zero`, `one`, `two`, `few`, `many`, or `other` +(required). Note English only uses `one` and `other`. So, including `zero` will +never get called, even when the number is 0. For more information see +[`.pluralGenerator()`](../plural/plural-generator.md). + +```javascript +var numberFormatter, taskFormatter, + en = new Globalize( "en" ); + +// Note you can define multiple lines message using an Array of Strings. +Globalize.loadMessages({ + en: { + task: [ + "You have {count, plural,", + " one {one task}", + " other {{formattedCount} tasks}", + "} remaining" + ] + } +}); + +numberFormatter = en.numberFormatter(); +taskFormatter = en.messageFormatter( "task" ); + +taskFormatter({ + count: 1000, + formattedCount: numberFormatter( 1000 ) +}); +// > "You have 1,000 tasks remaining" +``` + +Literal numeric keys can be used in `plural` to match single, specific numbers. + +```javascript +var taskFormatter, + en = new Globalize( "en" ); + +// Note you can define multiple lines message using an Array of Strings. +Globalize.loadMessages({ + en: { + task: [ + "You have {count, plural,", + " =0 {no tasks}", + " one {one task}", + " other {{formattedCount} tasks}", + "} remaining" + ] + } +}); + +taskFormatter = Globalize( "en" ).messageFormatter( "task" ); + +taskFormatter({ + count: 0, + formattedCount: en.numberFormatter( 0 ) +}); +// > "You have no tasks remaining" +``` + +You may find useful having the plural forms calculated with an offset applied. +Use `#` to output the resulting number. Note literal numeric keys do NOT use the +offset value. + +```javascript +var likeFormatter, + en = new Globalize( "en" ); + +Globalize.loadMessages({ + en: { + likeIncludingMe: [ + "{0, plural, offset:1", + " =0 {Be the first to like this}", + " =1 {You liked this}", + " one {You and someone else liked this}", + " other {You and # others liked this}", + "}" + ] + } +}); + +likeFormatter = Globalize( "en" ).messageFormatter( "likeIncludingMe" ); + +likeFormatter( 0 ); +// > "Be the first to like this" + +likeFormatter( 1 ); +// > "You liked this" + +likeFormatter( 2 ); +// > "You and someone else liked this" + +likeFormatter( 3 ); +// > "You and 2 others liked this" +``` + +Read on [SlexAxton/messageFormatter.js][] for more information on regard of ICU +MessageFormat. + +[SlexAxton/messageFormatter.js]: https://github.com/SlexAxton/messageformat.js/#no-frills diff --git a/StockManMVC/.bin/bower_components/globalize/doc/api/number/number-formatter.md b/StockManMVC/.bin/bower_components/globalize/doc/api/number/number-formatter.md new file mode 100644 index 0000000..d5e9175 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/doc/api/number/number-formatter.md @@ -0,0 +1,185 @@ +## .numberFormatter( [options] ) ➜ function( value ) + +Return a function that formats a number according to the given options. + +The returned function is invoked with one argument: the Number `value` to be +formatted. + +### Parameters + +**options** Optional + +A JSON object including none or any of the following options. + +> **style** Optional +> +> String `decimal` (default), or `percent`. +> +> **minimumIntegerDigits** Optional +> +> Non-negative integer Number value indicating the minimum integer digits to be +> used. Numbers will be padded with leading zeroes if necessary. +> +> **minimumFractionDigits** and **maximumFractionDigits** Optional +> +> Non-negative integer Number values indicating the minimum and maximum fraction +> digits to be used. Numbers will be rounded or padded with trailing zeroes if +> necessary. Either one or both of these properties must be present. If they +> are, they will override minimum and maximum fraction digits derived from the +> CLDR patterns. +> +> **minimumSignificantDigits** and **maximumSignificantDigits** Optional +> +> Positive integer Number values indicating the minimum and maximum fraction +> digits to be shown. Either none or both of these properties are present. If +> they are, they override minimum and maximum integer and fraction digits. The +> formatter uses however many integer and fraction digits are required to +> display the specified number of significant digits. +> +> **round** Optional +> +> String with rounding method `ceil`, `floor`, `round` (default), or `truncate`. +> +> **useGrouping** Optional +> +> Boolean (default is true) value indicating whether a grouping separator should +> be used. + +### Examples + +#### Static Formatter + +Prior to using any number methods, you must load +`cldr/main/{locale}/numbers.json` and `cldr/supplemental/numberingSystems.json`. +Read [CLDR content][] if you need more information. + +[CLDR content]: ../../../README.md#2-cldr-content + +You can use the static method `Globalize.numberFormatter()`, which uses the +default locale. + +```javascript +var formatter; + +Globalize.locale( "en" ); +formatter = Globalize.numberFormatter(); + +formatter( 3.141592 ); +// > "3.142" +``` + +#### Instance Formatter + +You can use the instance method `.numberFormatter()`, which uses the instance +locale. + +```javascript +var arFormatter = Globalize( "ar" ).numberFormatter(), + esFormatter = Globalize( "es" ).numberFormatter(), + zhFormatter = Globalize( "zh-u-nu-native" ).numberFormatter(); + +arFormatter( 3.141592 ); +// > "٣٫١٤٢" + +esFormatter( 3.141592 ); +// > "3,142" + +zhFormatter( 3.141592 ); +// > "三.一四二" +``` + +#### Configuring decimal places + +The number of decimal places can be decreased or increased using `minimumFractionDigits` and `maximumFractionDigits`. + +```javascript +Globalize.numberFormatter({ maximumFractionDigits: 2 })( 3.141592 ); +// > "3.14" + +Globalize.numberFormatter({ minimumFractionDigits: 2 })( 1.5 ); +// > "1.50" +``` + +#### Configuring significant digits + +The number of significant (non-zero) digits can be decreased or increased using `minimumSignificantDigits` and `maximumSignificantDigits`. + +```javascript +var formatter = Globalize.numberFormatter({ + minimumSignificantDigits: 1, + maximumSignificantDigits: 3 +}); + +formatter( 3.141592 ); +// > "3.14" + +formatter = Globalize.numberFormatter({ + minimumSignificantDigits: 1, + maximumSignificantDigits: 3 +}); + +formatter( 12345 ); +// > "12,300" + +formatter = Globalize.numberFormatter({ + minimumSignificantDigits: 1, + maximumSignificantDigits: 3 +}); + +formatter( 0.00012345 ); +// > "0.000123" +``` + +#### Formatting Percentages + +Numbers can be formatted as percentages. + +```javascript +var enFormatter = Globalize( "en" ).numberFormatter({ + style: "percent", + minimumFractionDigits: 1, + maximumFractionDigits: 1 +}); + +var frFormatter = Globalize( "fr" ).numberFormatter({ + style: "percent", + minimumFractionDigits: 2, + maximumFractionDigits: 2 +}); + +enFormatter( 0.0016 ); +// > "0.2%" + +enFormatter( 0.0014 ); +// > "0.1%" + +frFormatter( 0.0005 ); +// > "0,05 %" +``` + +#### Configuring Rounding + +Numbers with a decreased amount of decimal places can be rounded up, rounded down, rounded arithmetically, or truncated by setting the `round` option to `ceil`, `floor`, `round` (default), or `truncate`. + +```javascript +var formatter = Globalize.numberFormatter({ + maximumFractionDigits: 2, + round: "ceil" +}); + +formatter( 3.141592 ); +// > "3.15" +``` + +#### Performance Suggestions + +For improved performance on iterations, the formatter should be created before the loop. Then, it can be reused in each iteration. + +```javascript +var numbers = [ 1, 1, 2, 3, ... ]; +var formatter = Globalize( "en" ).numberFormatter(); + +formattedNumbers = numbers.map(function( number ) { + return formatter( number ); +}); +``` diff --git a/StockManMVC/.bin/bower_components/globalize/doc/api/number/number-parser.md b/StockManMVC/.bin/bower_components/globalize/doc/api/number/number-parser.md new file mode 100644 index 0000000..55471f4 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/doc/api/number/number-parser.md @@ -0,0 +1,86 @@ +## .numberParser( [options] ) ➜ function( value ) + +Return a function that parses a String representing a number according to the +given options. If value is invalid, `NaN` is returned. + +The returned function is invoked with one argument: the String representing a +number `value` to be parsed. + +### Parameters + +**options** Optional + +A JSON object including none or any of the following options. + +> **style** Optional +> +> String `decimal` (default), or `percent`. + +**value** + +String with number to be parsed, eg. `"3.14"`. + +### Example + +Prior to using any number methods, you must load +`cldr/main/{locale}/numbers.json` and `cldr/supplemental/numberingSystems.json`. +Read [CLDR content][] if you need more information. + +[CLDR content]: ../../../README.md#2-cldr-content + +You can use the static method `Globalize.numberParser()`, which uses the +default locale. + +```javascript +var parser; + +Globalize.locale( "en" ); +parser = Globalize.numberParser(); + +parser( "3.14" ); +// > 3.14 +``` + +You can use the instance method `.numberParser()`, which uses the instance +locale. + +```javascript +var enParser = Globalize( "ar" ).numberParser(), + esParser = Globalize( "es" ).numberParser(); + +enParser( "3.14" ); +// > 3.14 + +esParser( "3,14" ); +// > 3.14 +``` + +Some more examples. + +```javascript +var parser = Globalize( "en" ).numberParser(); + +parser( "12,735.00" ); +// > 12735 + +parser( "6.626E-34" ); +// > 6.626e-34 + +parser( "∞" ); +// > Infinity + +parser( "invalid-stuff" ); +// > NaN +``` + +For improved performance on iterations, first create the parser. Then, reuse it +on each loop. + +```javascript +var formattedNumbers = [ "1", "1", "2", "3", ... ]; +var parser = Globalize( "en" ).numberParser(); + +numbers = formattedNumbers.map(function( formattedNumber ) { + return parser( formattedNumber ); +}); +``` diff --git a/StockManMVC/.bin/bower_components/globalize/doc/api/plural/plural-generator.md b/StockManMVC/.bin/bower_components/globalize/doc/api/plural/plural-generator.md new file mode 100644 index 0000000..9f26535 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/doc/api/plural/plural-generator.md @@ -0,0 +1,95 @@ +## .pluralGenerator( [options] ) ➜ function( value ) + +It supports the creation of internationalized messages with plural inflection by +returning a function that returns the value's plural group: `zero`, `one`, +`two`, `few`, `many`, or `other`. + +The returned function is invoked with one argument: the Number `value` for which +to return the plural group. + +### Parameters + +**options** Optional + +A JSON object including none or any of the following options. + +> **type** Optional +> +> String `cardinal` (default), or `ordinal`. + +**value** + +A Number for which to return the plural group. + +### Example + +Prior to using any plural method, you must load either +`supplemental/plurals.json` for cardinals or `supplemental/ordinals.json` for +ordinals. + +Read [CLDR content][] if you need more information. + +[CLDR content]: ../../../README.md#2-cldr-content + +You can use the static method `Globalize.pluralGenerator()`, which uses the +default locale. + +```javascript +var plural; + +Globalize.locale( "en" ); + +// Cardinals +plural = Globalize.pluralGenerator(); + +plural( 0 ); +// > "other" + +plural( 1 ); +// > "one" + +plural( 2 ); +// > "other" + +// Ordinals +plural = Globalize.pluralGenerator({ type: "ordinal" }); + +plural( 0 ); +// > "other" + +plural( 1 ); +// > "one" + +plural( 2 ); +// > "two" +``` + +You can use the instance method `.pluralGenerator()`, which uses the instance +locale. + +```javascript +var plural = Globalize( "zh" ).pluralGenerator(); + +plural( 1 ); +// > "other" +``` + +For comparison (cardinals): + +| | en (English) | ru (Russian) | ar (Arabic) | +| --- | --- | --- | --- | +| `plural( 0 )` | `other` | `many` | `zero` | +| `plural( 1 )` | `one` | `one` | `one` | +| `plural( 2 )` | `other` | `few` | `two` | +| `plural( 3 )` | `other` | `few` | `few` | +| `plural( 5 )` | `other` | `many` | `few` | + +For comparison (ordinals): + +| | en (English) | ru (Russian) | ar (Arabic) | +| --- | --- | --- | --- | +| `plural( 0, { type: "ordinal" } )` | `other` | `other` | `other` | +| `plural( 1, { type: "ordinal" } )` | `one` | `other` | `other` | +| `plural( 2, { type: "ordinal" } )` | `two` | `other` | `other` | +| `plural( 3, { type: "ordinal" } )` | `few` | `other` | `other` | +| `plural( 5, { type: "ordinal" } )` | `other` | `other` | `other` | diff --git a/StockManMVC/.bin/bower_components/globalize/doc/api/relative-time/relative-time-formatter.md b/StockManMVC/.bin/bower_components/globalize/doc/api/relative-time/relative-time-formatter.md new file mode 100644 index 0000000..84348f1 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/doc/api/relative-time/relative-time-formatter.md @@ -0,0 +1,66 @@ +## .relativeTimeFormatter( unit [, options] ) ➜ function( value ) + +Returns a function that formats a relative time according to the given unit, options, and the +default/instance locale. + +The returned function is invoked with one argument: the number `value` to +be formatted. + +### Parameters + +**unit** + +String value indicating the unit to be formatted. eg. "day", "week", "month", etc. + +**options** + +- form: [String] eg. "short" or "narrow". Or falsy for default long form + +**value** + +The number to be formatted. + + +### Example + +Prior to using any relative time methods, you must load +`cldr/main/{locale}/dateFields.json` and the +CLDR content required by the number and plural modules. Read [CLDR content][] if you need +more information. + +[CLDR content]: ../../../README.md#2-cldr-content + +You can use the static method `Globalize.relativeTimeFormatter()`, which uses the default +locale. + +```javascript +var formatter; + +Globalize.locale( "en" ); +formatter = Globalize.relativeTimeFormatter( "month" ); + +formatter( 1 ); +// > "next month" + +formatter( 3 ); +// > "in 3 months" + +formatter( -1 ); +// > "last month" + +formatter( -3 ); +// > "3 months ago" +``` + +You can use the instance method `.relativeTimeFormatter()`, which uses the instance locale. + +```javascript +var globalize = new Globalize( "en" ), + formatter = globalize.relativeTimeFormatter( "week" ); + +formatter( 1 ); +// > "next week" +``` + + + diff --git a/StockManMVC/.bin/bower_components/globalize/doc/api/unit/unit-formatter.md b/StockManMVC/.bin/bower_components/globalize/doc/api/unit/unit-formatter.md new file mode 100644 index 0000000..136b0a4 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/doc/api/unit/unit-formatter.md @@ -0,0 +1,77 @@ +## .unitFormatter( unit, options ) ➜ function( value ) + +Returns a function that formats a unit according to the given unit, options, and the +default/instance locale. + +The returned function is invoked with one argument: the number `value` to +be formatted. + +### Parameters + +**unit** + +String value indicating the unit to be formatted. eg. "day", "week", "month", etc. +Could also be a compound unit, eg. "mile-per-hour" or "mile/hour" + +**options** + +- form: [String] eg. "long", "short" or "narrow". + +- numberFormatter: [Function] a number formatter function. Defaults to Globalize + `.numberFormatter()` for the current locale using the default options. + +**value** + +The number to be formatted. + +### Example + +Prior to using any unit methods, you must load `cldr/main/{locale}/units.json` and the +CLDR content required by the plural module. Read [CLDR content][] if you need +more information. + +[CLDR content]: ../../../README.md#2-cldr-content + +You can use the static method `Globalize.unitFormatter()`, which uses the default +locale. + +```javascript +var customNumberFormatter, formatter; + +Globalize.locale( "en" ); +formatter = Globalize.unitFormatter( "month", { form: "long" } ); + +formatter( 1 ); +// > "1 month" + +formatter( 3 ); +// > "3 months" + +formatter( 3000 ); +// > "3,000 months" +``` + +You can pass a custom number formatter to format the number of units. + +```javascript +var customNumberFormatter, formatter; + +Globalize.locale( "en" ); +customNumberFormatter = Globalize.numberFormatter({ useGrouping = false }) +formatter = Globalize.unitFormatter( "mile-per-hour", { + form: "narrow", numberFormatter: customNumberFormatter +} ); + +formatter(5000) +// > "5000mph" +``` + +You can use the instance method `.unitFormatter()`, which uses the instance locale. + +```javascript +var globalize = new Globalize( "en" ), + formatter = globalize.unitFormatter( "mile-per-hour", { form: "narrow" } ); + +formatter( 10 ); +// > "10mph" +``` diff --git a/StockManMVC/.bin/bower_components/globalize/doc/cldr.md b/StockManMVC/.bin/bower_components/globalize/doc/cldr.md new file mode 100644 index 0000000..f07dee3 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/doc/cldr.md @@ -0,0 +1,120 @@ +# Unicode CLDR usage + +## How do I get CLDR data? + +*By downloading the JSON packages individually...* + +Unicode CLDR is available as JSON at https://github.com/unicode-cldr/ (after +this [json-packaging proposal][] took place). Please, read +https://github.com/unicode-cldr/cldr-json for more information about package +organization. + +[json-packaging proposal]: http://cldr.unicode.org/development/development-process/design-proposals/json-packaging + +*By using a package manager...* + +`cldr-data` can be used for convenience. It always downloads from the correct source. + +Use bower `bower install cldr-data` ([detailed instructions][]) or npm `npm +install cldr-data`. For more information, see: + +- https://github.com/rxaviers/cldr-data-npm +- https://github.com/rxaviers/cldr-data-bower + +[detailed instructions]: https://github.com/rxaviers/cldr-data-bower + +## How do I load CLDR data into Globalize? + +The short answer is by using `Globalize.load()` and passing the JSON data as the +first argument. Below, follow several examples on how this could be +accomplished. + +Example of embedding CLDR JSON data: + +```html + +``` + +Example of loading it dynamically: + +```html + + +``` + +Example using AMD (also see our [functional tests](../../test/functional.js)): +```javascript +define([ + "globalize", + "json!cldr-data/main/en/ca-gregorian.json", + "json!cldr-data/supplemental/likelySubtags.json", + "json!cldr-data/supplemental/timeData.json", + "json!cldr-data/supplemental/weekData.json", + "globalize/date" +], function( Globalize, enCaGregorian, likelySubtags, timeData, weekData ) { + + Globalize.load( + enCaGregorian, + likelySubtags, + timeData, + weekData + ); + + // Your code goes here. + +}); +``` + +Example using Node.js: + +```javascript +var Globalize = require( "globalize" ); + +Globalize.load( + require( "cldr-data/main/en/ca-gregorian" ), + require( "cldr-data/supplemental/likelySubtags" ), + require( "cldr-data/supplemental/timeData" ), + require( "cldr-data/supplemental/weekData" ) +); +``` diff --git a/StockManMVC/.bin/bower_components/globalize/doc/error/e-default-locale-not-defined.md b/StockManMVC/.bin/bower_components/globalize/doc/error/e-default-locale-not-defined.md new file mode 100644 index 0000000..0c98639 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/doc/error/e-default-locale-not-defined.md @@ -0,0 +1,10 @@ +## E_DEFAULT_LOCALE_NOT_DEFINED + +Thrown when any static method, eg. `Globalize.formatNumber()` is used prior to +setting the Global locale with `Globalize.locale( )`. + +Error object: + +| Attribute | Value | +| --- | --- | +| code | `E_DEFAULT_LOCALE_NOT_DEFINED` | diff --git a/StockManMVC/.bin/bower_components/globalize/doc/error/e-invalid-cldr.md b/StockManMVC/.bin/bower_components/globalize/doc/error/e-invalid-cldr.md new file mode 100644 index 0000000..8ed260d --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/doc/error/e-invalid-cldr.md @@ -0,0 +1,16 @@ +## E_INVALID_CLDR + +Thrown when a CLDR item has an invalid or unexpected value. + +Error object: + +| Attribute | Value | +| --- | --- | +| code | `E_INVALID_CLDR` | +| description | Reason why the data was considered invalid | + +- description "Missing rules to deduce plural form of \`{value}\`" + + Thrown when the plural form (also known as plural group) is not found for the + given value. This error is very unlikely to occur and is related to incomplete + or invalid CLDR `supplemental/plurals-type-cardinal/{language}` data. diff --git a/StockManMVC/.bin/bower_components/globalize/doc/error/e-invalid-par-type.md b/StockManMVC/.bin/bower_components/globalize/doc/error/e-invalid-par-type.md new file mode 100644 index 0000000..893cf1b --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/doc/error/e-invalid-par-type.md @@ -0,0 +1,12 @@ +## E_INVALID_PAR_TYPE + +Thrown when a parameter has an invalid type on any static or instance methods. + +Error object: + +| Attribute | Value | +| --- | --- | +| code | `E_INVALID_PAR_TYPE` | +| name | Name of the invalid parameter | +| value | Invalid value | +| expected | Expected type | diff --git a/StockManMVC/.bin/bower_components/globalize/doc/error/e-invalid-par-value.md b/StockManMVC/.bin/bower_components/globalize/doc/error/e-invalid-par-value.md new file mode 100644 index 0000000..693641b --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/doc/error/e-invalid-par-value.md @@ -0,0 +1,15 @@ +## E_INVALID_PAR_VALUE + +Thrown for certain parameters when the type is correct, but the value is +invalid. Currently, the only parameter with such validation is the date format +(for either format and parse). Format allows [certain +variants](https://github.com/jquery/globalize/blob/master/doc/api/date/date-formatter.md#parameters), +if it's none of them, error is thrown. + +Error object: + +| Attribute | Value | +| --- | --- | +| code | `E_INVALID_PAR_VALUE` | +| name | Name of the invalid parameter | +| value | Invalid value | diff --git a/StockManMVC/.bin/bower_components/globalize/doc/error/e-missing-cldr.md b/StockManMVC/.bin/bower_components/globalize/doc/error/e-missing-cldr.md new file mode 100644 index 0000000..fc77dbf --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/doc/error/e-missing-cldr.md @@ -0,0 +1,11 @@ +## E_MISSING_CLDR + +Thrown when any required CLDR item is NOT found. + +Error object: + +| Attribute | Value | +| --- | --- | +| code | `E_MISSING_CLDR` | +| path | Missing CLDR item path | + diff --git a/StockManMVC/.bin/bower_components/globalize/doc/error/e-missing-parameter.md b/StockManMVC/.bin/bower_components/globalize/doc/error/e-missing-parameter.md new file mode 100644 index 0000000..f0efac2 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/doc/error/e-missing-parameter.md @@ -0,0 +1,10 @@ +## E_MISSING_PARAMETER + +Thrown when a required parameter is missing on any static or instance methods. + +Error object: + +| Attribute | Value | +| --- | --- | +| code | `E_MISSING_PARAMETER` | +| name | Name of the missing parameter | diff --git a/StockManMVC/.bin/bower_components/globalize/doc/error/e-missing-plural-module.md b/StockManMVC/.bin/bower_components/globalize/doc/error/e-missing-plural-module.md new file mode 100644 index 0000000..f86f9c8 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/doc/error/e-missing-plural-module.md @@ -0,0 +1,10 @@ +## E_MISSING_PLURAL_MODULE + +Thrown when plural module is needed, but not loaded, eg. formatting currencies +using plural messages. + +Error object: + +| Attribute | Value | +| --- | --- | +| code | `E_MISSING_PLURAL_MODULE` | diff --git a/StockManMVC/.bin/bower_components/globalize/doc/error/e-par-missing-key.md b/StockManMVC/.bin/bower_components/globalize/doc/error/e-par-missing-key.md new file mode 100644 index 0000000..974aa5b --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/doc/error/e-par-missing-key.md @@ -0,0 +1,11 @@ +## E_PAR_MISSING_KEY + +Thrown when a parameter misses a required key. + +Error object: + +| Attribute | Value | +| --- | --- | +| code | `E_PAR_MISSING_KEY` | +| key | Name of the missing parameter's key | +| name | Name of the missing parameter | diff --git a/StockManMVC/.bin/bower_components/globalize/doc/error/e-par-out-of-range.md b/StockManMVC/.bin/bower_components/globalize/doc/error/e-par-out-of-range.md new file mode 100644 index 0000000..44c0c91 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/doc/error/e-par-out-of-range.md @@ -0,0 +1,13 @@ +## E_PAR_OUT_OF_RANGE + +Thrown when a parameter is not within a valid range of values. + +Error object: + +| Attribute | Value | +| --- | --- | +| code | `E_PAR_OUT_OF_RANGE` | +| name | Name of the invalid parameter | +| value | Invalid value | +| minimum | Minimum value of the valid range | +| maximum | Maximum value of the valid range | diff --git a/StockManMVC/.bin/bower_components/globalize/doc/error/e-unsupported.md b/StockManMVC/.bin/bower_components/globalize/doc/error/e-unsupported.md new file mode 100644 index 0000000..33546c1 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/doc/error/e-unsupported.md @@ -0,0 +1,10 @@ +## E_UNSUPPORTED + +Thrown for unsupported features, eg. to format unsupported date patterns. + +Error object: + +| Attribute | Value | +| --- | --- | +| code | `E_UNSUPPORTED` | +| feature | Description of the unsupported feature | diff --git a/StockManMVC/.bin/bower_components/globalize/doc/migrating-from-0.x.md b/StockManMVC/.bin/bower_components/globalize/doc/migrating-from-0.x.md new file mode 100644 index 0000000..6187beb --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/doc/migrating-from-0.x.md @@ -0,0 +1,64 @@ +# Migrating from Globalize 0.x + +Globalize 0.x came with a bundled locale for US English, and optional files for various other locales. Globalize 1.x uses CLDR for the locale data, and it doesn't bundle any locale data. Check out the documentation for loading CLDR data in 1.x to learn more about that. If you were only using the bundle locale, you only need to load CLDR data for US English. If you were loading other locales, make sure you load those from CLDR as well. + +On the API side, things have also changed, to simplify usage, remove ambiguity and add features. The rest of this document provides a brief function-by-function list. + +If you still need help with migration, let us know. We may extend this guide later as necessary. + +## Globalize.addCultureInfo() + +This method is replaced by `Globalize.loadMessages( json )`. If you were using it for anything except message translations, you may also need to use `Globalize.load`. + +## Globalize.cultures + +This property is gone. You can use Cldrjs to traverse CLDR directly. + +## Globalize.culture( [locale] ) + +This method is replaced by the `Globalize.locale( [locale|cldr] )` method. Call it without arguments to retrieve the default locale, call it with a string argument to set the default locale. + +## Globalize.findClosestCulture + +This method is gone, there is no replacement. If you still need this method, create an issue with your usecase. + +## Globalize.format + +Replaced by three separate methods: + +* `.formatNumber( value [, options] )` +* `.formatCurrency( value, currency [, options] )` +* `.formatDate( value, pattern )` + +See their respective documentation for usage details. Note that the number and date formats are now based on CLDR, using the options and patterns standardized by Unicode. We don't currently have documentation for migrating these formats. + +## Globalize.localize + +Replaced by `.formatMessage( path [, variables ] )`. The new API is quite different and provides much more than just value-lookup. See their respective documentation for usage details. + +## Globalize.parseInt/parseFloat + +Replaced by `.parseNumber( value [, options] )`. So where you might have previously executed: + +```js +Globalize( "en" ).parseFloat( "123,456.789" ) +// > 123456.789 +``` + +You could now execute: + +```js +Globalize( "en" ).parseNumber( "123,456.789" ) +// > 123456.789 +``` + +`parseNumber` is an alias for [`.numberParser( [options] )( value )`](api/number/number-parser.md). So you could also do this: + +```js +Globalize( "en" ).numberParser()( "123,456.789" ) +// > 123456.789 +``` + +## Globalize.parseDate + +This method still exists, and the signature is almost the same: `.parseDate( value, pattern )`. Note that `pattern` indicates just a single "format", where Globalize 0.x supported multiple of those "formats". diff --git a/StockManMVC/.bin/bower_components/globalize/examples/amd-bower/README.md b/StockManMVC/.bin/bower_components/globalize/examples/amd-bower/README.md new file mode 100644 index 0000000..0ea1e5d --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/examples/amd-bower/README.md @@ -0,0 +1,65 @@ +# Hello World (AMD + bower) + +We assume you know what [AMD](https://github.com/amdjs/amdjs-api/wiki/AMD) and +[bower](http://bower.io/) is. + +The demo is composed of the following files: + +``` +. +├── index.html +└── main.js +``` + +Before running it, execute the requirements below. + + +## Requirements + +**1. Install Globalize** + +Let's use bower to download Globalize. For more information on regard of +installation, please read [Getting Started](../../README.md#installation). + +``` +bower install +``` + +Note bower will also fetch some other dependencies of this demo, eg. require.js +and its json plugin. + +You'll get this: + +``` +. +├── bower_components/ +│ ├── globalize/ +│ │ └── dist/ +│ │ ├── globalize +│ │ │ ├── date.js +│ │ │ └── ... +│ │ └── globalize.js +│ └── ... +├── index.html +└── main.js +``` + +**2. Install Dependencies** + +No action needed, because bower has already handled that for us. + +**3. CLDR content** + +No action needed, because bower has already handled that for us. Note `.bowerrc` +has postinstall hook that populates bower's cldr-data skeleton. For more +information, see [bower's cldr-data](https://github.com/rxaviers/cldr-data-bower). + + +## Running the demo + +Once you've completed the requirements above: + +1. Start a server by running `python -m SimpleHTTPServer` or other alternative servers such as [http-server](https://github.com/nodeapps/http-server), [nginx](http://nginx.org/en/docs/), [apache](http://httpd.apache.org/docs/trunk/). +1. Point your browser at `http://localhost:8000/`. +1. Understand the demo by reading the source code (both index.html and main.js). +We have comments there for you. diff --git a/StockManMVC/.bin/bower_components/globalize/examples/amd-bower/index.html b/StockManMVC/.bin/bower_components/globalize/examples/amd-bower/index.html new file mode 100644 index 0000000..e3b10c4 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/examples/amd-bower/index.html @@ -0,0 +1,43 @@ + + + + + Globalize Hello World (AMD + bower) + + +

Globalize Hello World (AMD + bower)

+ +
+

Requirements

+
    +
  • Run `bower install` (you must have bower installed first).
  • +
  • Start a server, e.g., by running `python -m SimpleHTTPServer`.
  • +
  • Point your browser at `http://localhost:8000/`.
  • +
  • Please, read README.md for more information on any of the above.
  • +
+
+ + + + + + + + diff --git a/StockManMVC/.bin/bower_components/globalize/examples/amd-bower/main.js b/StockManMVC/.bin/bower_components/globalize/examples/amd-bower/main.js new file mode 100644 index 0000000..4946c43 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/examples/amd-bower/main.js @@ -0,0 +1,108 @@ +/** + * 1. Configure require.js paths. + */ +require.config({ + paths: { + // Globalize dependencies paths. + cldr: "./bower_components/cldrjs/dist/cldr", + + // Unicode CLDR JSON data. + "cldr-data": "./bower_components/cldr-data", + + // require.js plugin we'll use to fetch CLDR JSON content. + json: "./bower_components/requirejs-plugins/src/json", + + // text is json's dependency. + text: "./bower_components/requirejs-text/text", + + // Globalize. + globalize: "./bower_components/globalize/dist/globalize" + } +}); + + +/** + * 2. Require dependencies and run your code. + */ +require([ + "globalize", + + // CLDR content. + "json!cldr-data/main/en/ca-gregorian.json", + "json!cldr-data/main/en/currencies.json", + "json!cldr-data/main/en/dateFields.json", + "json!cldr-data/main/en/numbers.json", + "json!cldr-data/main/en/units.json", + "json!cldr-data/supplemental/currencyData.json", + "json!cldr-data/supplemental/likelySubtags.json", + "json!cldr-data/supplemental/plurals.json", + "json!cldr-data/supplemental/timeData.json", + "json!cldr-data/supplemental/weekData.json", + "json!messages/en.json", + + // Extend Globalize with Date and Number modules. + "globalize/currency", + "globalize/date", + "globalize/message", + "globalize/number", + "globalize/plural", + "globalize/relative-time", + "globalize/unit" +], function( Globalize, enGregorian, enCurrencies, enDateFields, enNumbers, enUnits, currencyData, + likelySubtags, pluralsData, timeData, weekData, messages ) { + + var en, like, number; + + // At this point, we have Globalize loaded. But, before we can use it, we need to feed it on the appropriate I18n content (Unicode CLDR). Read Requirements on Getting Started on the root's README.md for more information. + Globalize.load( + currencyData, + enCurrencies, + enDateFields, + enGregorian, + enNumbers, + enUnits, + likelySubtags, + pluralsData, + timeData, + weekData + ); + Globalize.loadMessages( messages ); + + // Instantiate "en". + en = Globalize( "en" ); + + // Use Globalize to format dates. + document.getElementById( "date" ).textContent = en.formatDate( new Date(), { + datetime: "medium" + }); + + // Use Globalize to format numbers. + number = en.numberFormatter(); + document.getElementById( "number" ).textContent = number( 12345.6789 ); + + // Use Globalize to format currencies. + document.getElementById( "currency" ).textContent = en.formatCurrency( 69900, "USD" ); + + // Use Globalize to get the plural form of a numeric value. + document.getElementById( "plural-number" ).textContent = number( 12345.6789 ); + document.getElementById( "plural-form" ).textContent = en.plural( 12345.6789 ); + + // Use Globalize to format a message with plural inflection. + like = en.messageFormatter( "like" ); + document.getElementById( "message-0" ).textContent = like( 0 ); + document.getElementById( "message-1" ).textContent = like( 1 ); + document.getElementById( "message-2" ).textContent = like( 2 ); + document.getElementById( "message-3" ).textContent = like( 3 ); + + // Use Globalize to format a relative time. + document.getElementById( "relative-time" ).textContent = en.formatRelativeTime( -35, "second" ); + + // Use Globalize to format a unit. + document.getElementById( "unit" ).textContent = en.formatUnit( 60, "mile/hour", { + form: "short" + }); + + document.getElementById( "requirements" ).style.display = "none"; + document.getElementById( "demo" ).style.display = "block"; + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/examples/amd-bower/messages/en.json b/StockManMVC/.bin/bower_components/globalize/examples/amd-bower/messages/en.json new file mode 100644 index 0000000..cd37bae --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/examples/amd-bower/messages/en.json @@ -0,0 +1,12 @@ +{ + "en": { + "like": [ + "{0, plural, offset:1", + " =0 {Be the first to like this}", + " =1 {You liked this}", + " one {You and someone else liked this}", + " other {You and # others liked this}", + "}" + ] + } +} diff --git a/StockManMVC/.bin/bower_components/globalize/examples/amd-bower/package.json b/StockManMVC/.bin/bower_components/globalize/examples/amd-bower/package.json new file mode 100644 index 0000000..75a2caa --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/examples/amd-bower/package.json @@ -0,0 +1,11 @@ +{ + "name": "globalize-hello-world-amd-bower", + "private": true, + "comment": [ + "You don't need this file. The only reasone this example does have a", + "package.json is to fool npm, so cldr-data-downloader doesn't get", + "installed on Globalize's root.", + "", + "It's analogous to `chroot .` for npm. [:P]" + ] +} diff --git a/StockManMVC/.bin/bower_components/globalize/examples/app-npm-webpack/README.md b/StockManMVC/.bin/bower_components/globalize/examples/app-npm-webpack/README.md new file mode 100644 index 0000000..ead9d43 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/examples/app-npm-webpack/README.md @@ -0,0 +1,74 @@ +# Globalize App example using webpack + +This example demonstrates how to integrate Globalize with Webpack in your +Application. If you already have an existing Application using Webpack stack, +this example should as well provide you guidance on how to integrate Globalize. +It focuses on the [Globalize Webpack Plugin][], which automates data loading +(CLDR and app messages) during development and automates Globalize compilation +and the usage of Globalize runtime modules for production. It assumes knowledge +of Globalize, npm, and Webpack usage basics. + +## Requirements + +**1. Install app development dependencies** + +This example uses `npm` to download the app development dependencies (i.e., +Globalize, CLDR data, Cldrjs, Webpack, [Globalize Webpack Plugin][], and +others). + +``` +npm install +``` + +## Running the example + +### Development mode + +``` +npm start +``` + +1. Start a server by running `npm start`, which uses webpack's live reload HMR +(Hot Module Replacement). See `package.json` to understand the actual shell +command that is used. +1. Point your browser at `http://localhost:8080`. Note that your browser will +automatically reload on any changes made to the application code (`app/*.js` +files). Also note that for faster page reload, formatters are created +dynamically and automatically by the [Globalize Webpack Plugin][]. +1. Note you can specify the development locale of your choice by setting the +`developmentLocale` property of the Globalize Webpack Plugin on the Webpack +config file. +1. Note that CLDR data and your messages data are automatically loaded by the +[Globalize Webpack Plugin][]. +1. Understand the demo by reading the source code. We have comments there for +you. + +### Production mode + +``` +npm run build +``` + +1. Generate the compiled bundles by running `npm run build`, which will be +created at `./dist`. Note the production bundles are split into three chunks: +(a) vendor, which holds third-party libraries, which in this case means +Globalize Runtime modules, (b) i18n precompiled data, which means the minimum +yet sufficient set of precompiled i18n data that your application needs (one +file for each supported locale), and (c) app, which means your application code. +Also note that all the production code is already minified using UglifyJS. See +`package.json` to understand the actual shell command that is used. +1. Note that your formatters are already precompiled. This is +obvious, but worth emphasizing. It means your formatters are prebuilt, so no client +CPU clock is wasted to generate them and no CLDR or messages data needs to be +dynamically loaded. It means fast to load code (small code) and fast to run +code. +1. Point your browser at `./dist/index.html` to run the application using the +generated production files. Edit this file to display the application using a +different locale (source code has instructions). +1. Understand the demo by reading the source code. We have comments there for +you. + +For more information about the plugin, see the [Globalize Webpack Plugin][] +documentation. + +[Globalize Webpack Plugin]: https://github.com/rxaviers/globalize-webpack-plugin diff --git a/StockManMVC/.bin/bower_components/globalize/examples/app-npm-webpack/app/index.js b/StockManMVC/.bin/bower_components/globalize/examples/app-npm-webpack/app/index.js new file mode 100644 index 0000000..7cc2771 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/examples/app-npm-webpack/app/index.js @@ -0,0 +1,57 @@ +var Globalize = require( "globalize" ); +var startTime = new Date(); + +// Standalone table. +var numberFormatter = Globalize.numberFormatter({ maximumFractionDigits: 2 }); +document.getElementById( "number" ).textContent = numberFormatter( 12345.6789 ); + +var currencyFormatter = Globalize.currencyFormatter( "USD" ); +document.getElementById( "currency" ).textContent = currencyFormatter( 69900 ); + +var dateFormatter = Globalize.dateFormatter({ datetime: "medium" }); +document.getElementById( "date" ).textContent = dateFormatter( new Date() ); + +var relativeTimeFormatter = Globalize.relativeTimeFormatter( "second" ); +document.getElementById( "relative-time" ).textContent = relativeTimeFormatter( 0 ); + +var unitFormatter = Globalize.unitFormatter( "mile/hour", { form: "short" } ); +document.getElementById( "unit" ).textContent = unitFormatter( 60 ); + +// Messages. +document.getElementById( "intro-1" ).textContent = Globalize.formatMessage( "intro-1" ); +document.getElementById( "number-label" ).textContent = Globalize.formatMessage( "number-label" ); +document.getElementById( "currency-label" ).textContent = Globalize.formatMessage( "currency-label" ); +document.getElementById( "date-label" ).textContent = Globalize.formatMessage( "date-label" ); +document.getElementById( "relative-time-label" ).textContent = Globalize.formatMessage( "relative-time-label" ); +document.getElementById( "unit-label" ).textContent = Globalize.formatMessage( "unit-label" ); +document.getElementById( "message-1" ).textContent = Globalize.formatMessage( "message-1", { + currency: currencyFormatter( 69900 ), + date: dateFormatter( new Date() ), + number: numberFormatter( 12345.6789 ), + relativeTime: relativeTimeFormatter( 0 ), + unit: unitFormatter( 60 ) +}); + +document.getElementById( "message-2" ).textContent = Globalize.formatMessage( "message-2", { + count: 3 +}); + +// Display demo. +document.getElementById( "requirements" ).style.display = "none"; +document.getElementById( "demo" ).style.display = "block"; + +// Refresh elapsed time +setInterval(function() { + var elapsedTime = +( ( startTime - new Date() ) / 1000 ).toFixed( 0 ); + document.getElementById( "date" ).textContent = dateFormatter( new Date() ); + document.getElementById( "relative-time" ).textContent = relativeTimeFormatter( elapsedTime ); + document.getElementById( "message-1" ).textContent = Globalize.formatMessage( "message-1", { + currency: currencyFormatter( 69900 ), + date: dateFormatter( new Date() ), + number: numberFormatter( 12345.6789 ), + relativeTime: relativeTimeFormatter( elapsedTime ), + unit: unitFormatter( 60 ) + }); + +}, 1000); + diff --git a/StockManMVC/.bin/bower_components/globalize/examples/app-npm-webpack/index-template.html b/StockManMVC/.bin/bower_components/globalize/examples/app-npm-webpack/index-template.html new file mode 100644 index 0000000..11f91df --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/examples/app-npm-webpack/index-template.html @@ -0,0 +1,86 @@ + + + + + + Globalize App example using Webpack + + + +

Globalize App example using Webpack

+ +
+

Requirements

+
    +
  • Read README.md for instructions on how to run the demo. +
  • +
+
+ + + +{% +var hasShownLocaleHelp; +for ( var chunk in o.htmlWebpackPlugin.files.chunks ) { + if ( /globalize-compiled-data-/.test( chunk ) && chunk !== "globalize-compiled-data-en" ) { + if ( !hasShownLocaleHelp ) { + hasShownLocaleHelp = true; +%} + +{% } %} + +{% } else { %} + +{% + } +} +%} + + + diff --git a/StockManMVC/.bin/bower_components/globalize/examples/app-npm-webpack/messages/ar.json b/StockManMVC/.bin/bower_components/globalize/examples/app-npm-webpack/messages/ar.json new file mode 100644 index 0000000..bd0ff37 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/examples/app-npm-webpack/messages/ar.json @@ -0,0 +1,22 @@ +{ + "ar": { + "intro-1": "‫استخدم Globalize لتدويل تطبيقك.‬", + "number-label": "رقم", + "currency-label": "عملة", + "date-label": "تاريخ", + "relative-time-label": "الوقت النسبي", + "unit-label": "وحدة القياس", + "message-1": "مثال علي رسالة باستخدام رقم مختلط \"{number}\", عملة \"{currency}\", تاريخ \"{date}\", وقت نسبي \"{relativeTime}\", و وحدة قياس \"{unit}\" .", + "message-2": [ + "مثال على رسالة بدعم صيغة الجمع:", + "{count, plural,", + " zero {لا يوجد لديك اي مهام متبقية}", + " one {لديك مهمة واحدة متبقية}", + " two {لديك اثنين من المهام المتبقية}", + " few {لديك # من المهام المتبقية}", + " many {لديك # من المهام المتبقية}", + " other {لديك # من المهام المتبقية}", + "}." + ] + } +} diff --git a/StockManMVC/.bin/bower_components/globalize/examples/app-npm-webpack/messages/de.json b/StockManMVC/.bin/bower_components/globalize/examples/app-npm-webpack/messages/de.json new file mode 100644 index 0000000..2318d76 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/examples/app-npm-webpack/messages/de.json @@ -0,0 +1,18 @@ +{ + "de": { + "intro-1": "Verwenden Sie Globalize um Ihre Anwendung zu internationalisieren.", + "number-label": "Zahl", + "currency-label": "Währung", + "date-label": "Datum", + "relative-time-label": "Relative Zeit", + "unit-label": "Einheit", + "message-1": "Ein Beispiel mit Zahl \"{number}\", Währung \"{currency}\", Datum \"{date}\", relative Zeit \"{relativeTime}\", und Einheit \"{unit}\".", + "message-2": [ + "Ein Beispieltext mit Unterstützung von Plural Formen: ", + "{count, plural,", + " one {Sie haben noch eine Aufgabe}", + " other {Sie haben noch # verbliebende Aufgaben}", + "}." + ] + } +} diff --git a/StockManMVC/.bin/bower_components/globalize/examples/app-npm-webpack/messages/en.json b/StockManMVC/.bin/bower_components/globalize/examples/app-npm-webpack/messages/en.json new file mode 100644 index 0000000..3b970c4 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/examples/app-npm-webpack/messages/en.json @@ -0,0 +1,18 @@ +{ + "en": { + "intro-1": "Use Globalize to internationalize your application.", + "number-label": "Number", + "currency-label": "Currency", + "date-label": "Date", + "relative-time-label": "Relative Time", + "unit-label": "Unit", + "message-1": "An example of a message using mixed number \"{number}\", currency \"{currency}\", date \"{date}\", relative time \"{relativeTime}\", and unit \"{unit}\".", + "message-2": [ + "An example of a message with pluralization support:", + "{count, plural,", + " one {You have one remaining task}", + " other {You have # remaining tasks}", + "}." + ] + } +} diff --git a/StockManMVC/.bin/bower_components/globalize/examples/app-npm-webpack/messages/es.json b/StockManMVC/.bin/bower_components/globalize/examples/app-npm-webpack/messages/es.json new file mode 100644 index 0000000..4df8751 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/examples/app-npm-webpack/messages/es.json @@ -0,0 +1,18 @@ +{ + "es": { + "intro-1": "Usa Globalize para internacionalizar tu aplicación.", + "number-label": "Número", + "currency-label": "Moneda", + "date-label": "Fecha", + "relative-time-label": "Tiempo Relativo", + "unit-label": "Unidad", + "message-1": "Un ejemplo de mensaje usando números mixtos \"{number}\", monedas \"{currency}\", fechas \"{date}\", tiempo relativo \"{relativeTime}\", y unidades \"{unit}\".", + "message-2": [ + "Un ejemplo de mensaje con soporte de pluralización:", + "{count, plural,", + " one {Tienes una tarea restante}", + " other {Tienes # tareas restantes}", + "}." + ] + } +} diff --git a/StockManMVC/.bin/bower_components/globalize/examples/app-npm-webpack/messages/pt.json b/StockManMVC/.bin/bower_components/globalize/examples/app-npm-webpack/messages/pt.json new file mode 100644 index 0000000..734f3ed --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/examples/app-npm-webpack/messages/pt.json @@ -0,0 +1,18 @@ +{ + "pt": { + "intro-1": "Use o Globalize para internacionalizar sua aplicação.", + "number-label": "Número", + "currency-label": "Moeda", + "date-label": "Data", + "relative-time-label": "Tempo relativo", + "unit-label": "Unit", + "message-1": "Um exemplo de mensagem com mistura de número \"{number}\", moeda \"{currency}\", data \"{date}\", tempo relativo \"{relativeTime}\", e unidade \"{unit}\".", + "message-2": [ + "Um exemplo de message com suporte a pluralização:", + "{count, plural,", + " one {Você tem uma tarefa restante}", + " other {Você tem # tarefas restantes}", + "}." + ] + } +} diff --git a/StockManMVC/.bin/bower_components/globalize/examples/app-npm-webpack/messages/ru.json b/StockManMVC/.bin/bower_components/globalize/examples/app-npm-webpack/messages/ru.json new file mode 100644 index 0000000..cc9dbb5 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/examples/app-npm-webpack/messages/ru.json @@ -0,0 +1,20 @@ +{ + "ru": { + "intro-1": "Используйте Globalize для интернационализиции вашего приложения.", + "number-label": "Число", + "currency-label": "Валюта", + "date-label": "Дата", + "relative-time-label": "Относительное время", + "unit-label": "Единица измерения", + "message-1": "Пример сообщения с числом \"{number}\", валютой \"{currency}\", датой \"{date}\", относительным временем \"{relativeTime}\" и единицей измерения \"{unit}\".", + "message-2": [ + "Пример сообщения с поддержкой множественного числа:", + "{count, plural,", + " one {У вас осталась одна задача}", + " many {У вас осталось # задач}", + " few {У вас осталось # задачи}", + " other {У вас осталось # задачи}", + "}." + ] + } +} diff --git a/StockManMVC/.bin/bower_components/globalize/examples/app-npm-webpack/messages/zh.json b/StockManMVC/.bin/bower_components/globalize/examples/app-npm-webpack/messages/zh.json new file mode 100644 index 0000000..80cba99 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/examples/app-npm-webpack/messages/zh.json @@ -0,0 +1,17 @@ +{ + "zh": { + "intro-1": "使用Globalize的国际化应用程序", + "number-label": "号码", + "currency-label": "币", + "date-label": "迄今", + "relative-time-label": "相对时间", + "unit-label": "单元", + "message-1": "使用混合数\"{number}\",货币\"{currency}\",日期\"{date}\",相对时间\"{relativeTime}\"和单元\"{unit}\"的消息的例子。", + "message-2": [ + "与多元化支持消息的例子:", + "{count, plural,", + " other {你有#剩下的任务}", + "}." + ] + } +} diff --git a/StockManMVC/.bin/bower_components/globalize/examples/app-npm-webpack/package.json b/StockManMVC/.bin/bower_components/globalize/examples/app-npm-webpack/package.json new file mode 100644 index 0000000..dbf4619 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/examples/app-npm-webpack/package.json @@ -0,0 +1,14 @@ +{ + "private": true, + "devDependencies": { + "cldr-data": ">=25", + "html-webpack-plugin": "^1.1.0", + "nopt": "^3.0.3", + "webpack": "^1.9.0", + "webpack-dev-server": "^1.9.0" + }, + "scripts": { + "start": "webpack-dev-server --config webpack-config.js --hot --progress --colors --inline", + "build": "webpack --production --config webpack-config.js" + } +} diff --git a/StockManMVC/.bin/bower_components/globalize/examples/app-npm-webpack/webpack-config.js b/StockManMVC/.bin/bower_components/globalize/examples/app-npm-webpack/webpack-config.js new file mode 100644 index 0000000..446e76b --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/examples/app-npm-webpack/webpack-config.js @@ -0,0 +1,55 @@ +var webpack = require( "webpack" ); +var CommonsChunkPlugin = require( "webpack/lib/optimize/CommonsChunkPlugin" ); +var HtmlWebpackPlugin = require( "html-webpack-plugin" ); +var GlobalizePlugin = require( "globalize-webpack-plugin" ); +var nopt = require( "nopt" ); + +var options = nopt({ + production: Boolean +}); + +module.exports = { + entry: options.production ? { + main: "./app/index.js", + vendor: [ + "globalize", + "globalize/dist/globalize-runtime/number", + "globalize/dist/globalize-runtime/currency", + "globalize/dist/globalize-runtime/date", + "globalize/dist/globalize-runtime/message", + "globalize/dist/globalize-runtime/plural", + "globalize/dist/globalize-runtime/relative-time", + "globalize/dist/globalize-runtime/unit" + ] + } : "./app/index.js", + debug: !options.production, + output: { + path: options.production ? "./dist" : "./tmp", + publicPath: options.production ? "" : "http://localhost:8080/", + filename: options.production ? "app.[hash].js" : "app.js" + }, + resolve: { + extensions: [ "", ".js" ] + }, + plugins: [ + new HtmlWebpackPlugin({ + production: options.production, + template: "./index-template.html" + }), + new GlobalizePlugin({ + production: options.production, + developmentLocale: "en", + supportedLocales: [ "ar", "de", "en", "es", "pt", "ru", "zh" ], + messages: "messages/[locale].json", + output: "i18n/[locale].[hash].js" + }) + ].concat( options.production ? [ + new webpack.optimize.DedupePlugin(), + new CommonsChunkPlugin( "vendor", "vendor.[hash].js" ), + new webpack.optimize.UglifyJsPlugin({ + compress: { + warnings: false + } + }) + ] : [] ) +}; diff --git a/StockManMVC/.bin/bower_components/globalize/examples/globalize-compiler/README.md b/StockManMVC/.bin/bower_components/globalize/examples/globalize-compiler/README.md new file mode 100644 index 0000000..a2c129b --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/examples/globalize-compiler/README.md @@ -0,0 +1,45 @@ +# Basic Globalize Compiler example + +This example focuses on the Globalize Compiler and the Globalize runtime +modules. It assumes knowledge of Globalize usage basics. + +## Requirements + +**1. Install Globalize dependencies and Globalize Compiler** + +This example uses `npm` to download Globalize dependencies (i.e., CLDR data and +the Cldrjs library) and the [Globalize Compiler][]. + +``` +npm install +``` + +[Globalize Compiler]: https://github.com/jquery-support/globalize-compiler + +## Running the example + +### Development mode + +1. Start a server by running `python -m SimpleHTTPServer` or other alternative +servers such as [http-server][], [nginx][], [apache][]. +1. Point your browser at `http://localhost:8000/development.html`. Note that the +formatters are created dynamically. Therefore, Cldrjs and CLDR data are +required. +1. Understand the demo by reading the source code. We have comments there for +you. + +[http-server]: https://github.com/nodeapps/http-server +[nginx]: http://nginx.org/en/docs/ +[apache]: http://httpd.apache.org/docs/trunk/ + +### Production mode + +1. Compile the application formatters by running `npm run build`. See +`package.json` to understand the actual shell command that is used. For more +information about the compiler, see the [Globalize Compiler documentation][]. +1. Point your browser at `./production.html`. Note that we don't need Cldrjs nor +CLDR data in production here. +1. Understand the demo by reading the source code. We have comments there for +you. + +[Globalize Compiler documentation]: https://github.com/jquery-support/globalize-compiler#README diff --git a/StockManMVC/.bin/bower_components/globalize/examples/globalize-compiler/app.js b/StockManMVC/.bin/bower_components/globalize/examples/globalize-compiler/app.js new file mode 100644 index 0000000..ffd871b --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/examples/globalize-compiler/app.js @@ -0,0 +1,38 @@ +var like, number; + +// Set default locale as "en". +Globalize.locale( "en" ); + +// Use Globalize to format dates. +document.getElementById( "date" ).textContent = Globalize.formatDate( new Date(), { + datetime: "medium" +}); + +// Use Globalize to format numbers. +number = Globalize.numberFormatter(); +document.getElementById( "number" ).textContent = number( 12345.6789 ); + +// Use Globalize to format currencies. +document.getElementById( "currency" ).textContent = Globalize.formatCurrency( 69900, "USD" ); + +// Use Globalize to get the plural form of a numeric value. +document.getElementById( "plural-number" ).textContent = number( 12345.6789 ); +document.getElementById( "plural-form" ).textContent = Globalize.plural( 12345.6789 ); + +// Use Globalize to format a message with plural inflection. +like = Globalize.messageFormatter( "like" ); +document.getElementById( "message-0" ).textContent = like( 0 ); +document.getElementById( "message-1" ).textContent = like( 1 ); +document.getElementById( "message-2" ).textContent = like( 2 ); +document.getElementById( "message-3" ).textContent = like( 3 ); + +// Use Globalize to format a relative time. +document.getElementById( "relative-time" ).textContent = Globalize.formatRelativeTime( -35, "second" ); + +// Use Globalize to format a unit. +document.getElementById( "unit" ).textContent = Globalize.formatUnit( 60, "mile/hour", { + form: "short" +}); + +document.getElementById( "requirements" ).style.display = "none"; +document.getElementById( "demo" ).style.display = "block"; diff --git a/StockManMVC/.bin/bower_components/globalize/examples/globalize-compiler/cldr.json b/StockManMVC/.bin/bower_components/globalize/examples/globalize-compiler/cldr.json new file mode 100644 index 0000000..1de447b --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/examples/globalize-compiler/cldr.json @@ -0,0 +1,147 @@ +{ + "main": { + "en": { + "identity": { + "version": { + "_cldrVersion": "25", + "_number": "$Revision: 91 $" + }, + "generation": { + "_date": "$Date: 2014-03-13 22:27:12 -0500 (Thu, 13 Mar 2014) $" + }, + "language": "en" + }, + "dates": { + "calendars": { + "gregorian": { + "months": { + "format": { + "abbreviated": { + "1": "Jan", + "2": "Feb", + "3": "Mar", + "4": "Apr", + "5": "May", + "6": "Jun", + "7": "Jul", + "8": "Aug", + "9": "Sep", + "10": "Oct", + "11": "Nov", + "12": "Dec" + } + } + }, + "dayPeriods": { + "format": { + "wide": { + "am": "AM", + "am-alt-variant": "am", + "noon": "noon", + "pm": "PM", + "pm-alt-variant": "pm" + } + } + }, + "dateFormats": { + "medium": "MMM d, y" + }, + "timeFormats": { + "medium": "h:mm:ss a" + }, + "dateTimeFormats": { + "medium": "{1}, {0}" + } + } + }, + "fields": { + "second": { + "displayName": "Second", + "relative-type-0": "now", + "relativeTime-type-future": { + "relativeTimePattern-count-one": "in {0} second", + "relativeTimePattern-count-other": "in {0} seconds" + }, + "relativeTime-type-past": { + "relativeTimePattern-count-one": "{0} second ago", + "relativeTimePattern-count-other": "{0} seconds ago" + } + } + } + }, + "numbers": { + "currencies": { + "USD": { + "symbol": "$" + } + }, + "defaultNumberingSystem": "latn", + "symbols-numberSystem-latn": { + "decimal": ".", + "exponential": "E", + "group": ",", + "infinity": "∞", + "minusSign": "-", + "nan": "NaN", + "percentSign": "%", + "perMille": "‰", + "plusSign": "+", + "timeSeparator": ":" + }, + "decimalFormats-numberSystem-latn": { + "standard": "#,##0.###" + }, + "currencyFormats-numberSystem-latn": { + "currencySpacing": { + "beforeCurrency": { + "currencyMatch": "[:^S:]", + "surroundingMatch": "[:digit:]", + "insertBetween": " " + }, + "afterCurrency": { + "currencyMatch": "[:^S:]", + "surroundingMatch": "[:digit:]", + "insertBetween": " " + } + }, + "standard": "¤#,##0.00" + } + }, + "units": { + "short": { + "per": { + "compoundUnitPattern": "{0}/{1}" + }, + "speed-mile-per-hour": { + "displayName": "miles/hour", + "unitPattern-count-one": "{0} mph", + "unitPattern-count-other": "{0} mph" + } + } + } + } + }, + "supplemental": { + "version": { + "_cldrVersion": "25", + "_number": "$Revision: 91 $" + }, + "currencyData": { + "fractions": { + "DEFAULT": { + "_rounding": "0", + "_digits": "2" + } + } + }, + "likelySubtags": { + "en": "en-Latn-US" + }, + "plurals-type-cardinal": { + "en": { + "pluralRule-count-one": "i = 1 and v = 0 @integer 1", + "pluralRule-count-other": " @integer 0, 2~16, 100, 1000, 10000, 100000, 1000000, … @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …" + } + } + } +} diff --git a/StockManMVC/.bin/bower_components/globalize/examples/globalize-compiler/development.html b/StockManMVC/.bin/bower_components/globalize/examples/globalize-compiler/development.html new file mode 100644 index 0000000..002d6da --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/examples/globalize-compiler/development.html @@ -0,0 +1,93 @@ + + + + + Basic Globalize Compiler example (development mode) + + +

Basic Globalize Compiler example (development mode)

+ +
+

Requirements

+
    +
  • Read README.md for instructions.
  • +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/StockManMVC/.bin/bower_components/globalize/examples/globalize-compiler/messages.json b/StockManMVC/.bin/bower_components/globalize/examples/globalize-compiler/messages.json new file mode 100644 index 0000000..4a5f1f4 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/examples/globalize-compiler/messages.json @@ -0,0 +1,12 @@ +{ + "en": { + "like": [ + "{0, plural, offset:1", + " =0 {Be the first to like this}", + " =1 {You liked this}", + " one {You and someone else liked this}", + " other {You and # others liked this}", + "}" + ] + } +} diff --git a/StockManMVC/.bin/bower_components/globalize/examples/globalize-compiler/package.json b/StockManMVC/.bin/bower_components/globalize/examples/globalize-compiler/package.json new file mode 100644 index 0000000..73d1f0c --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/examples/globalize-compiler/package.json @@ -0,0 +1,13 @@ +{ + "name": "basic-globalize-compiler", + "private": true, + "scripts": { + "build": "globalize-compiler -l en -c cldr.json -m messages.json -o compiled-formatters.js app.js" + }, + "devDependencies": { + "cldr-data": ">=25", + "globalize": "1.1.x", + "globalize-compiler": "0.1.x", + "jquery": "latest" + } +} diff --git a/StockManMVC/.bin/bower_components/globalize/examples/globalize-compiler/production.html b/StockManMVC/.bin/bower_components/globalize/examples/globalize-compiler/production.html new file mode 100644 index 0000000..296b69b --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/examples/globalize-compiler/production.html @@ -0,0 +1,69 @@ + + + + + Basic Globalize Compiler example (production mode) + + +

Basic Globalize Compiler example (production mode)

+ +
+

Requirements

+
    +
  • You need to build the `compiled-formatters.js`. Read README.md for instructions. +
  • +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/StockManMVC/.bin/bower_components/globalize/examples/node-npm/README.md b/StockManMVC/.bin/bower_components/globalize/examples/node-npm/README.md new file mode 100644 index 0000000..6b39f7d --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/examples/node-npm/README.md @@ -0,0 +1,57 @@ +# Hello World (Node.js + npm) + +We assume you know what [Node.js](http://nodejs.org/) and +[npm](https://www.npmjs.org/) is. + +The demo contains one single file: + +``` +. +└── main.js +``` + +Before running it, execute the requirements below. + + +## Requirements + +**1. Install Globalize** + +Let's use npm to download Globalize. For more information on regard of +installation, please read [Getting Started](../../README.md#installation). + +``` +npm install +``` + +Then, you'll get this: + +``` +. +├── node_modules/ +│ ├── globalize/ +│ │ └── dist/ +│ │ ├── globalize +│ │ │ ├── date.js +│ │ │ └── ... +│ │ └── globalize.js +│ └── ... +└── main.js +``` + +**2. Dependencies** + +No action needed, because npm has already handled that for us. + +**3. CLDR content** + +No action needed, because npm has already handled that for us. For more +information, see [npm's cldr-data](https://github.com/rxaviers/cldr-data-npm). + + +## Running the demo + +Once you've completed the requirements above: + +1. Run `node main.js`. +1. Understand the demo by reading the source code. We have comments there for you. diff --git a/StockManMVC/.bin/bower_components/globalize/examples/node-npm/main.js b/StockManMVC/.bin/bower_components/globalize/examples/node-npm/main.js new file mode 100644 index 0000000..f7e4307 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/examples/node-npm/main.js @@ -0,0 +1,45 @@ +var like; +var Globalize = require( "globalize" ); + +// Before we can use Globalize, we need to feed it on the appropriate I18n content (Unicode CLDR). Read Requirements on Getting Started on the root's README.md for more information. +Globalize.load( + require( "cldr-data/main/en/ca-gregorian" ), + require( "cldr-data/main/en/currencies" ), + require( "cldr-data/main/en/dateFields" ), + require( "cldr-data/main/en/numbers" ), + require( "cldr-data/main/en/units" ), + require( "cldr-data/supplemental/currencyData" ), + require( "cldr-data/supplemental/likelySubtags" ), + require( "cldr-data/supplemental/plurals" ), + require( "cldr-data/supplemental/timeData" ), + require( "cldr-data/supplemental/weekData" ) +); +Globalize.loadMessages( require( "./messages/en" ) ); + +// Set "en" as our default locale. +Globalize.locale( "en" ); + +// Use Globalize to format dates. +console.log( Globalize.formatDate( new Date(), { datetime: "medium" } ) ); + +// Use Globalize to format numbers. +console.log( Globalize.formatNumber( 12345.6789 ) ); + +// Use Globalize to format currencies. +console.log( Globalize.formatCurrency( 69900, "USD" ) ); + +// Use Globalize to get the plural form of a numeric value. +console.log( Globalize.plural( 12345.6789 ) ); + +// Use Globalize to format a message with plural inflection. +like = Globalize.messageFormatter( "like" ); +console.log( like( 0 ) ); +console.log( like( 1 ) ); +console.log( like( 2 ) ); +console.log( like( 3 ) ); + +// Use Globalize to format relative time. +console.log( Globalize.formatRelativeTime( -35, "second" ) ); + +// Use Globalize to format unit. +console.log( Globalize.formatUnit( 60, "mile/hour", { form: "short" } ) ); diff --git a/StockManMVC/.bin/bower_components/globalize/examples/node-npm/messages/en.json b/StockManMVC/.bin/bower_components/globalize/examples/node-npm/messages/en.json new file mode 100644 index 0000000..cd37bae --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/examples/node-npm/messages/en.json @@ -0,0 +1,12 @@ +{ + "en": { + "like": [ + "{0, plural, offset:1", + " =0 {Be the first to like this}", + " =1 {You liked this}", + " one {You and someone else liked this}", + " other {You and # others liked this}", + "}" + ] + } +} diff --git a/StockManMVC/.bin/bower_components/globalize/examples/node-npm/package.json b/StockManMVC/.bin/bower_components/globalize/examples/node-npm/package.json new file mode 100644 index 0000000..b8e45c8 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/examples/node-npm/package.json @@ -0,0 +1,8 @@ +{ + "name": "globalize-hello-world-node-npm", + "private": true, + "dependencies": { + "cldr-data": "latest", + "globalize": "1.1.x" + } +} diff --git a/StockManMVC/.bin/bower_components/globalize/examples/plain-javascript/README.md b/StockManMVC/.bin/bower_components/globalize/examples/plain-javascript/README.md new file mode 100644 index 0000000..6977ecb --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/examples/plain-javascript/README.md @@ -0,0 +1,81 @@ +# Hello World (plain javascript) + +The demo contains one single file: + +``` +. +└── index.html +``` + +Before running it, execute the requirements below. + + +## Requirements + +**1. Dependencies** + +The demo requires Globalize and its dependencies. Globalize's dependencies are listed on [Getting +Started](../../README.md#dependencies), and the only one is +[cldrjs](https://github.com/rxaviers/cldrjs). You are free to fetch it the way you want. But, as an +exercise of this demo, we'll download it ourselves. So: + +1. Click at [Globalize releases tab](https://github.com/rxaviers/globalize/releases). +1. Download the latest package. +1. Unzip it. +1. Rename the extracted directory `globalize` and move it alongside `index.html` and `README.md`. +1. Click at [cldrjs releases tab](https://github.com/rxaviers/cldrjs/releases). +1. Download the latest package. +1. Unzip it. +1. Rename the extracted directory `cldrjs` and move it alongside `index.html` and `README.md`. + +Then, you'll get this: + +``` +. +├── cldrjs +│ └── dist +│ ├── cldr.js +│ ├── ... +│ └── cldr +│ ├── event.js +│ ├── supplemental.js +│ └── ... +├── globalize +│ └── dist +│ ├── globalize.js +│ ├── ... +│ └── globalize +│ ├── currency.js +│ ├── date.js +│ └── ... +├── index.html +└── README.md +``` + +For more information read [cldrjs' usage and +installation](https://github.com/rxaviers/cldrjs#usage-and-installation) docs. + +**2. CLDR content** + +Another typical Globalize requirement is to fetch CLDR content yourself. But, on +this demo we made the things a little easier for you: we've embedded static JSON +into the demo. So, you don't need to actually fetch it anywhere. For more +information about fetching Unicode CLDR JSON data, see [How do I get CLDR +data?](../../doc/cldr.md). + +No action needed here. + +**3. Globalize `dist` files** + +*This step only applies if you are building the source files. If you have downloaded a ZIP or a TAR.GZ or are using a package manager (such as bower or npm) to install then you can ignore this step.* + +[Install the development external dependencies](../../README.md#install-development-external-dependencies) and [build the distribution files](../../README.md#build). + +## Running the demo + +Once you've completed the requirements above: + +1. Point your browser at `./index.html`. +1. Open your JavaScript console to see the demo output. +1. Understand the demo by reading the source code. We have comments there for +you. diff --git a/StockManMVC/.bin/bower_components/globalize/examples/plain-javascript/index.html b/StockManMVC/.bin/bower_components/globalize/examples/plain-javascript/index.html new file mode 100644 index 0000000..6a94be2 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/examples/plain-javascript/index.html @@ -0,0 +1,270 @@ + + + + + Globalize Hello World (plain javascript) + + +

Globalize Hello World (plain javascript)

+ +
+

Requirements

+
    +
  • You need to download the `cldrjs` dependency yourself. Read README.md for instructions. +
  • +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/StockManMVC/.bin/bower_components/globalize/package.json b/StockManMVC/.bin/bower_components/globalize/package.json new file mode 100644 index 0000000..ad4f41f --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/package.json @@ -0,0 +1,98 @@ +{ + "name": "globalize", + "version": "1.1.1", + "description": "A JavaScript library for internationalization and localization that leverages the official Unicode CLDR JSON data.", + "keywords": [ + "utility", + "globalization", + "internationalization", + "multilingualization", + "localization", + "g11n", + "i18n", + "m17n", + "L10n", + "localize", + "format", + "parse", + "translate", + "strings", + "numbers", + "dates", + "times", + "calendars", + "plural", + "plurals", + "pluralize", + "cultures", + "languages", + "locales", + "Unicode", + "CLDR", + "JSON" + ], + "homepage": "https://github.com/jquery/globalize", + "author": { + "name": "jQuery Foundation and other contributors", + "url": "https://github.com/jquery/jquery/blob/master/AUTHORS.txt" + }, + "maintainers": [ + { + "name": "Jörn Zaefferer", + "email": "joern.zaefferer@gmail.com", + "url": "http://bassistance.de" + }, + { + "name": "Rafael Xavier de Souza", + "email": "rxaviers@gmail.com", + "url": "http://rafael.xavier.blog.br" + } + ], + "main": "./dist/node-main.js", + "files": [ + "CONTRIBUTING.md", + "dist/", + "doc/", + "examples/", + "LICENSE.txt", + "README.md" + ], + "repository": { + "type": "git", + "url": "git://github.com/jquery/globalize.git" + }, + "bugs": { + "url": "http://github.com/jquery/globalize/issues" + }, + "dependencies": { + "cldrjs": "0.4.4" + }, + "peerDependencies": { + "cldr-data": ">=25" + }, + "devDependencies": { + "grunt": "0.4.5", + "grunt-check-dependencies": "0.6.0", + "grunt-commitplease": "0.0.5", + "grunt-compare-size": "0.4.0", + "grunt-contrib-clean": "0.6.0", + "grunt-contrib-connect": "0.8.0", + "grunt-contrib-copy": "0.6.0", + "grunt-contrib-jshint": "0.10.0", + "grunt-contrib-qunit": "0.7.0", + "grunt-contrib-requirejs": "0.4.4", + "grunt-contrib-uglify": "0.6.0", + "grunt-contrib-watch": "0.6.1", + "grunt-git-authors": "^3.1.0", + "grunt-jscs": "1.8.0", + "gzip-js": "0.3.2", + "matchdep": "0.3.0" + }, + "commitplease": { + "nohook": true + }, + "license": "MIT", + "scripts": { + "test": "grunt" + } +} diff --git a/StockManMVC/.bin/bower_components/globalize/src/build/intro-core-runtime.js b/StockManMVC/.bin/bower_components/globalize/src/build/intro-core-runtime.js new file mode 100644 index 0000000..a070876 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/build/intro-core-runtime.js @@ -0,0 +1,32 @@ +/** + * Globalize Runtime v@VERSION + * + * http://github.com/jquery/globalize + * + * Copyright jQuery Foundation and other contributors + * Released under the MIT license + * http://jquery.org/license + * + * Date: @DATE + */ +/*! + * Globalize Runtime v@VERSION @DATE Released under the MIT license + * http://git.io/TrdQbw + */ +(function( root, factory ) { + + // UMD returnExports + if ( typeof define === "function" && define.amd ) { + + // AMD + define( factory ); + } else if ( typeof exports === "object" ) { + + // Node, CommonJS + module.exports = factory(); + } else { + + // Globalize + root.Globalize = factory(); + } +}( this, function() { diff --git a/StockManMVC/.bin/bower_components/globalize/src/build/intro-core.js b/StockManMVC/.bin/bower_components/globalize/src/build/intro-core.js new file mode 100644 index 0000000..9cbb07c --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/build/intro-core.js @@ -0,0 +1,35 @@ +/** + * Globalize v@VERSION + * + * http://github.com/jquery/globalize + * + * Copyright jQuery Foundation and other contributors + * Released under the MIT license + * http://jquery.org/license + * + * Date: @DATE + */ +/*! + * Globalize v@VERSION @DATE Released under the MIT license + * http://git.io/TrdQbw + */ +(function( root, factory ) { + + // UMD returnExports + if ( typeof define === "function" && define.amd ) { + + // AMD + define([ + "cldr", + "cldr/event" + ], factory ); + } else if ( typeof exports === "object" ) { + + // Node, CommonJS + module.exports = factory( require( "cldrjs" ) ); + } else { + + // Global + root.Globalize = factory( root.Cldr ); + } +}( this, function( Cldr ) { diff --git a/StockManMVC/.bin/bower_components/globalize/src/build/intro-currency-runtime.js b/StockManMVC/.bin/bower_components/globalize/src/build/intro-currency-runtime.js new file mode 100644 index 0000000..8f8442b --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/build/intro-currency-runtime.js @@ -0,0 +1,43 @@ +/** + * Globalize Runtime v@VERSION + * + * http://github.com/jquery/globalize + * + * Copyright jQuery Foundation and other contributors + * Released under the MIT license + * http://jquery.org/license + * + * Date: @DATE + */ +/*! + * Globalize Runtime v@VERSION @DATE Released under the MIT license + * http://git.io/TrdQbw + */ +(function( root, factory ) { + + // UMD returnExports + if ( typeof define === "function" && define.amd ) { + + // AMD + define([ + "../globalize-runtime", + "./number" + ], factory ); + } else if ( typeof exports === "object" ) { + + // Node, CommonJS + module.exports = factory( + require( "../globalize-runtime" ), + require( "./number" ) + ); + } else { + + // Extend global + factory( root.Globalize ); + } +}(this, function( Globalize ) { + +var formatMessage = Globalize._formatMessage, + runtimeKey = Globalize._runtimeKey, + validateParameterPresence = Globalize._validateParameterPresence, + validateParameterTypeNumber = Globalize._validateParameterTypeNumber; diff --git a/StockManMVC/.bin/bower_components/globalize/src/build/intro-currency.js b/StockManMVC/.bin/bower_components/globalize/src/build/intro-currency.js new file mode 100644 index 0000000..02ac4e7 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/build/intro-currency.js @@ -0,0 +1,47 @@ +/*! + * Globalize v@VERSION + * + * http://github.com/jquery/globalize + * + * Copyright jQuery Foundation and other contributors + * Released under the MIT license + * http://jquery.org/license + * + * Date: @DATE + */ +(function( root, factory ) { + + // UMD returnExports + if ( typeof define === "function" && define.amd ) { + + // AMD + define([ + "cldr", + "../globalize", + "./number", + "cldr/event", + "cldr/supplemental" + ], factory ); + } else if ( typeof exports === "object" ) { + + // Node, CommonJS + module.exports = factory( require( "cldrjs" ), require( "globalize" ) ); + } else { + + // Global + factory( root.Cldr, root.Globalize ); + } +}(this, function( Cldr, Globalize ) { + +var alwaysArray = Globalize._alwaysArray, + formatMessage = Globalize._formatMessage, + numberNumberingSystem = Globalize._numberNumberingSystem, + numberPattern = Globalize._numberPattern, + runtimeBind = Globalize._runtimeBind, + stringPad = Globalize._stringPad, + validateCldr = Globalize._validateCldr, + validateDefaultLocale = Globalize._validateDefaultLocale, + validateParameterPresence = Globalize._validateParameterPresence, + validateParameterType = Globalize._validateParameterType, + validateParameterTypeNumber = Globalize._validateParameterTypeNumber, + validateParameterTypePlainObject = Globalize._validateParameterTypePlainObject; diff --git a/StockManMVC/.bin/bower_components/globalize/src/build/intro-date-runtime.js b/StockManMVC/.bin/bower_components/globalize/src/build/intro-date-runtime.js new file mode 100644 index 0000000..748c785 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/build/intro-date-runtime.js @@ -0,0 +1,46 @@ +/** + * Globalize Runtime v@VERSION + * + * http://github.com/jquery/globalize + * + * Copyright jQuery Foundation and other contributors + * Released under the MIT license + * http://jquery.org/license + * + * Date: @DATE + */ +/*! + * Globalize Runtime v@VERSION @DATE Released under the MIT license + * http://git.io/TrdQbw + */ +(function( root, factory ) { + + // UMD returnExports + if ( typeof define === "function" && define.amd ) { + + // AMD + define([ + "../globalize-runtime", + "./number" + ], factory ); + } else if ( typeof exports === "object" ) { + + // Node, CommonJS + module.exports = factory( + require( "../globalize-runtime" ), + require( "./number" ) + ); + } else { + + // Extend global + factory( root.Globalize ); + } +}(this, function( Globalize ) { + +var createErrorUnsupportedFeature = Globalize._createErrorUnsupportedFeature, + regexpEscape = Globalize._regexpEscape, + runtimeKey = Globalize._runtimeKey, + stringPad = Globalize._stringPad, + validateParameterPresence = Globalize._validateParameterPresence, + validateParameterType = Globalize._validateParameterType, + validateParameterTypeString = Globalize._validateParameterTypeString; diff --git a/StockManMVC/.bin/bower_components/globalize/src/build/intro-date.js b/StockManMVC/.bin/bower_components/globalize/src/build/intro-date.js new file mode 100644 index 0000000..eb3de87 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/build/intro-date.js @@ -0,0 +1,52 @@ +/** + * Globalize v@VERSION + * + * http://github.com/jquery/globalize + * + * Copyright jQuery Foundation and other contributors + * Released under the MIT license + * http://jquery.org/license + * + * Date: @DATE + */ +/*! + * Globalize v@VERSION @DATE Released under the MIT license + * http://git.io/TrdQbw + */ +(function( root, factory ) { + + // UMD returnExports + if ( typeof define === "function" && define.amd ) { + + // AMD + define([ + "cldr", + "../globalize", + "./number", + "cldr/event", + "cldr/supplemental" + ], factory ); + } else if ( typeof exports === "object" ) { + + // Node, CommonJS + module.exports = factory( require( "cldrjs" ), require( "globalize" ) ); + } else { + + // Extend global + factory( root.Cldr, root.Globalize ); + } +}(this, function( Cldr, Globalize ) { + +var createError = Globalize._createError, + createErrorUnsupportedFeature = Globalize._createErrorUnsupportedFeature, + formatMessage = Globalize._formatMessage, + numberSymbol = Globalize._numberSymbol, + regexpEscape = Globalize._regexpEscape, + runtimeBind = Globalize._runtimeBind, + stringPad = Globalize._stringPad, + validateCldr = Globalize._validateCldr, + validateDefaultLocale = Globalize._validateDefaultLocale, + validateParameterPresence = Globalize._validateParameterPresence, + validateParameterType = Globalize._validateParameterType, + validateParameterTypePlainObject = Globalize._validateParameterTypePlainObject, + validateParameterTypeString = Globalize._validateParameterTypeString; diff --git a/StockManMVC/.bin/bower_components/globalize/src/build/intro-message-runtime.js b/StockManMVC/.bin/bower_components/globalize/src/build/intro-message-runtime.js new file mode 100644 index 0000000..522a9d6 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/build/intro-message-runtime.js @@ -0,0 +1,37 @@ +/** + * Globalize Runtime v@VERSION + * + * http://github.com/jquery/globalize + * + * Copyright jQuery Foundation and other contributors + * Released under the MIT license + * http://jquery.org/license + * + * Date: @DATE + */ +/*! + * Globalize Runtime v@VERSION @DATE Released under the MIT license + * http://git.io/TrdQbw + */ +(function( root, factory ) { + + // UMD returnExports + if ( typeof define === "function" && define.amd ) { + + // AMD + define([ + "../globalize-runtime" + ], factory ); + } else if ( typeof exports === "object" ) { + + // Node, CommonJS + module.exports = factory( require( "../globalize-runtime" ) ); + } else { + + // Extend global + factory( root.Globalize ); + } +}(this, function( Globalize ) { + +var runtimeKey = Globalize._runtimeKey, + validateParameterType = Globalize._validateParameterType; diff --git a/StockManMVC/.bin/bower_components/globalize/src/build/intro-message.js b/StockManMVC/.bin/bower_components/globalize/src/build/intro-message.js new file mode 100644 index 0000000..e5a0492 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/build/intro-message.js @@ -0,0 +1,46 @@ +/** + * Globalize v@VERSION + * + * http://github.com/jquery/globalize + * + * Copyright jQuery Foundation and other contributors + * Released under the MIT license + * http://jquery.org/license + * + * Date: @DATE + */ +/*! + * Globalize v@VERSION @DATE Released under the MIT license + * http://git.io/TrdQbw + */ +(function( root, factory ) { + + // UMD returnExports + if ( typeof define === "function" && define.amd ) { + + // AMD + define([ + "cldr", + "../globalize", + "cldr/event" + ], factory ); + } else if ( typeof exports === "object" ) { + + // Node, CommonJS + module.exports = factory( require( "cldrjs" ), require( "globalize" ) ); + } else { + + // Extend global + factory( root.Cldr, root.Globalize ); + } +}(this, function( Cldr, Globalize ) { + +var alwaysArray = Globalize._alwaysArray, + createError = Globalize._createError, + isPlainObject = Globalize._isPlainObject, + runtimeBind = Globalize._runtimeBind, + validateDefaultLocale = Globalize._validateDefaultLocale, + validate = Globalize._validate, + validateParameterPresence = Globalize._validateParameterPresence, + validateParameterType = Globalize._validateParameterType, + validateParameterTypePlainObject = Globalize._validateParameterTypePlainObject; diff --git a/StockManMVC/.bin/bower_components/globalize/src/build/intro-number-runtime.js b/StockManMVC/.bin/bower_components/globalize/src/build/intro-number-runtime.js new file mode 100644 index 0000000..cd37769 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/build/intro-number-runtime.js @@ -0,0 +1,42 @@ +/** + * Globalize Runtime v@VERSION + * + * http://github.com/jquery/globalize + * + * Copyright jQuery Foundation and other contributors + * Released under the MIT license + * http://jquery.org/license + * + * Date: @DATE + */ +/*! + * Globalize Runtime v@VERSION @DATE Released under the MIT license + * http://git.io/TrdQbw + */ +(function( root, factory ) { + + // UMD returnExports + if ( typeof define === "function" && define.amd ) { + + // AMD + define([ + "../globalize-runtime" + ], factory ); + } else if ( typeof exports === "object" ) { + + // Node, CommonJS + module.exports = factory( require( "../globalize-runtime" ) ); + } else { + + // Extend global + factory( root.Globalize ); + } +}(this, function( Globalize ) { + +var createError = Globalize._createError, + regexpEscape = Globalize._regexpEscape, + runtimeKey = Globalize._runtimeKey, + stringPad = Globalize._stringPad, + validateParameterType = Globalize._validateParameterType, + validateParameterPresence = Globalize._validateParameterPresence, + validateParameterTypeString = Globalize._validateParameterTypeString; diff --git a/StockManMVC/.bin/bower_components/globalize/src/build/intro-number.js b/StockManMVC/.bin/bower_components/globalize/src/build/intro-number.js new file mode 100644 index 0000000..585bca0 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/build/intro-number.js @@ -0,0 +1,49 @@ +/** + * Globalize v@VERSION + * + * http://github.com/jquery/globalize + * + * Copyright jQuery Foundation and other contributors + * Released under the MIT license + * http://jquery.org/license + * + * Date: @DATE + */ +/*! + * Globalize v@VERSION @DATE Released under the MIT license + * http://git.io/TrdQbw + */ +(function( root, factory ) { + + // UMD returnExports + if ( typeof define === "function" && define.amd ) { + + // AMD + define([ + "cldr", + "../globalize", + "cldr/event", + "cldr/supplemental" + ], factory ); + } else if ( typeof exports === "object" ) { + + // Node, CommonJS + module.exports = factory( require( "cldrjs" ), require( "globalize" ) ); + } else { + + // Global + factory( root.Cldr, root.Globalize ); + } +}(this, function( Cldr, Globalize ) { + +var createError = Globalize._createError, + objectExtend = Globalize._objectExtend, + regexpEscape = Globalize._regexpEscape, + runtimeBind = Globalize._runtimeBind, + stringPad = Globalize._stringPad, + validateCldr = Globalize._validateCldr, + validateDefaultLocale = Globalize._validateDefaultLocale, + validateParameterPresence = Globalize._validateParameterPresence, + validateParameterRange = Globalize._validateParameterRange, + validateParameterType = Globalize._validateParameterType, + validateParameterTypePlainObject = Globalize._validateParameterTypePlainObject; diff --git a/StockManMVC/.bin/bower_components/globalize/src/build/intro-plural-runtime.js b/StockManMVC/.bin/bower_components/globalize/src/build/intro-plural-runtime.js new file mode 100644 index 0000000..f89418b --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/build/intro-plural-runtime.js @@ -0,0 +1,38 @@ +/** + * Globalize Runtime v@VERSION + * + * http://github.com/jquery/globalize + * + * Copyright jQuery Foundation and other contributors + * Released under the MIT license + * http://jquery.org/license + * + * Date: @DATE + */ +/*! + * Globalize Runtime v@VERSION @DATE Released under the MIT license + * http://git.io/TrdQbw + */ +(function( root, factory ) { + + // UMD returnExports + if ( typeof define === "function" && define.amd ) { + + // AMD + define([ + "../globalize-runtime" + ], factory ); + } else if ( typeof exports === "object" ) { + + // Node, CommonJS + module.exports = factory( require( "../globalize-runtime" ) ); + } else { + + // Extend global + factory( root.Globalize ); + } +}(this, function( Globalize ) { + +var runtimeKey = Globalize._runtimeKey, + validateParameterPresence = Globalize._validateParameterPresence, + validateParameterType = Globalize._validateParameterType; diff --git a/StockManMVC/.bin/bower_components/globalize/src/build/intro-plural.js b/StockManMVC/.bin/bower_components/globalize/src/build/intro-plural.js new file mode 100644 index 0000000..953e358 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/build/intro-plural.js @@ -0,0 +1,44 @@ +/** + * Globalize v@VERSION + * + * http://github.com/jquery/globalize + * + * Copyright jQuery Foundation and other contributors + * Released under the MIT license + * http://jquery.org/license + * + * Date: @DATE + */ +/*! + * Globalize v@VERSION @DATE Released under the MIT license + * http://git.io/TrdQbw + */ +(function( root, factory ) { + + // UMD returnExports + if ( typeof define === "function" && define.amd ) { + + // AMD + define([ + "cldr", + "../globalize", + "cldr/event", + "cldr/supplemental" + ], factory ); + } else if ( typeof exports === "object" ) { + + // Node, CommonJS + module.exports = factory( require( "cldrjs" ), require( "globalize" ) ); + } else { + + // Global + factory( root.Cldr, root.Globalize ); + } +}(this, function( Cldr, Globalize ) { + +var runtimeBind = Globalize._runtimeBind, + validateCldr = Globalize._validateCldr, + validateDefaultLocale = Globalize._validateDefaultLocale, + validateParameterPresence = Globalize._validateParameterPresence, + validateParameterType = Globalize._validateParameterType, + validateParameterTypePlainObject = Globalize._validateParameterTypePlainObject; diff --git a/StockManMVC/.bin/bower_components/globalize/src/build/intro-relative-time-runtime.js b/StockManMVC/.bin/bower_components/globalize/src/build/intro-relative-time-runtime.js new file mode 100644 index 0000000..0241f86 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/build/intro-relative-time-runtime.js @@ -0,0 +1,45 @@ +/** + * Globalize Runtime v@VERSION + * + * http://github.com/jquery/globalize + * + * Copyright jQuery Foundation and other contributors + * Released under the MIT license + * http://jquery.org/license + * + * Date: @DATE + */ +/*! + * Globalize Runtime v@VERSION @DATE Released under the MIT license + * http://git.io/TrdQbw + */ +(function( root, factory ) { + + // UMD returnExports + if ( typeof define === "function" && define.amd ) { + + // AMD + define([ + "../globalize-runtime", + "./number", + "./plural" + ], factory ); + } else if ( typeof exports === "object" ) { + + // Node, CommonJS + module.exports = factory( + require( "../globalize-runtime" ), + require( "./number" ), + require( "./plural" ) + ); + } else { + + // Extend global + factory( root.Globalize ); + } +}(this, function( Globalize ) { + +var formatMessage = Globalize._formatMessage, + runtimeKey = Globalize._runtimeKey, + validateParameterPresence = Globalize._validateParameterPresence, + validateParameterTypeNumber = Globalize._validateParameterTypeNumber; diff --git a/StockManMVC/.bin/bower_components/globalize/src/build/intro-relative-time.js b/StockManMVC/.bin/bower_components/globalize/src/build/intro-relative-time.js new file mode 100644 index 0000000..30b6b64 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/build/intro-relative-time.js @@ -0,0 +1,47 @@ +/** + * Globalize v@VERSION + * + * http://github.com/jquery/globalize + * + * Copyright 2010, 2014 jQuery Foundation, Inc. and other contributors + * Released under the MIT license + * http://jquery.org/license + * + * Date: @DATE + */ +/*! + * Globalize v@VERSION @DATE Released under the MIT license + * http://git.io/TrdQbw + */ +(function( root, factory ) { + + // UMD returnExports + if ( typeof define === "function" && define.amd ) { + + // AMD + define([ + "cldr", + "../globalize", + "./number", + "./plural", + "cldr/event", + "cldr/supplemental" + ], factory ); + } else if ( typeof exports === "object" ) { + + // Node, CommonJS + module.exports = factory( require( "cldrjs" ), require( "globalize" ) ); + } else { + + // Extend global + factory( root.Cldr, root.Globalize ); + } +}(this, function( Cldr, Globalize ) { + +var formatMessage = Globalize._formatMessage, + runtimeBind = Globalize._runtimeBind, + validateCldr = Globalize._validateCldr, + validateDefaultLocale = Globalize._validateDefaultLocale, + validateParameterPresence = Globalize._validateParameterPresence, + validateParameterTypeString = Globalize._validateParameterTypeString, + validateParameterTypeNumber = Globalize._validateParameterTypeNumber; diff --git a/StockManMVC/.bin/bower_components/globalize/src/build/intro-unit-runtime.js b/StockManMVC/.bin/bower_components/globalize/src/build/intro-unit-runtime.js new file mode 100644 index 0000000..0241f86 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/build/intro-unit-runtime.js @@ -0,0 +1,45 @@ +/** + * Globalize Runtime v@VERSION + * + * http://github.com/jquery/globalize + * + * Copyright jQuery Foundation and other contributors + * Released under the MIT license + * http://jquery.org/license + * + * Date: @DATE + */ +/*! + * Globalize Runtime v@VERSION @DATE Released under the MIT license + * http://git.io/TrdQbw + */ +(function( root, factory ) { + + // UMD returnExports + if ( typeof define === "function" && define.amd ) { + + // AMD + define([ + "../globalize-runtime", + "./number", + "./plural" + ], factory ); + } else if ( typeof exports === "object" ) { + + // Node, CommonJS + module.exports = factory( + require( "../globalize-runtime" ), + require( "./number" ), + require( "./plural" ) + ); + } else { + + // Extend global + factory( root.Globalize ); + } +}(this, function( Globalize ) { + +var formatMessage = Globalize._formatMessage, + runtimeKey = Globalize._runtimeKey, + validateParameterPresence = Globalize._validateParameterPresence, + validateParameterTypeNumber = Globalize._validateParameterTypeNumber; diff --git a/StockManMVC/.bin/bower_components/globalize/src/build/intro-unit.js b/StockManMVC/.bin/bower_components/globalize/src/build/intro-unit.js new file mode 100644 index 0000000..690d92b --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/build/intro-unit.js @@ -0,0 +1,44 @@ +/** + * Globalize v@VERSION + * + * http://github.com/jquery/globalize + * + * Copyright 2010, 2014 jQuery Foundation, Inc. and other contributors + * Released under the MIT license + * http://jquery.org/license + * + * Date: @DATE + */ +/*! + * Globalize v@VERSION @DATE Released under the MIT license + * http://git.io/TrdQbw + */ +(function( root, factory ) { + + // UMD returnExports + if ( typeof define === "function" && define.amd ) { + + // AMD + define([ + "cldr", + "../globalize", + "./number", + "./plural" + ], factory ); + } else if ( typeof exports === "object" ) { + + // Node, CommonJS + module.exports = factory( require( "cldrjs" ), require( "globalize" ) ); + } else { + + // Extend global + factory( root.Cldr, root.Globalize ); + } +}(this, function( Cldr, Globalize ) { + +var formatMessage = Globalize._formatMessage, + runtimeBind = Globalize._runtimeBind, + validateParameterPresence = Globalize._validateParameterPresence, + validateParameterTypePlainObject = Globalize._validateParameterTypePlainObject, + validateParameterTypeNumber = Globalize._validateParameterTypeNumber, + validateParameterTypeString = Globalize._validateParameterTypeString; diff --git a/StockManMVC/.bin/bower_components/globalize/src/build/intro.min.js b/StockManMVC/.bin/bower_components/globalize/src/build/intro.min.js new file mode 100644 index 0000000..d5d29a8 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/build/intro.min.js @@ -0,0 +1,4 @@ +/*! + * Globalize v@VERSION @DATE Released under the MIT license + * http://git.io/TrdQbw + */ diff --git a/StockManMVC/.bin/bower_components/globalize/src/build/node-main.js b/StockManMVC/.bin/bower_components/globalize/src/build/node-main.js new file mode 100644 index 0000000..96450c8 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/build/node-main.js @@ -0,0 +1,27 @@ +/*! + * Globalize v@VERSION + * + * http://github.com/jquery/globalize + * + * Copyright jQuery Foundation and other contributors + * Released under the MIT license + * http://jquery.org/license + * + * Date: @DATE + */ + +// Core +module.exports = require( "./globalize" ); + +// Extent core with the following modules +require( "./globalize/message" ); +require( "./globalize/number" ); +require( "./globalize/plural" ); + +// Load after globalize/number +require( "./globalize/currency" ); +require( "./globalize/date" ); + +// Load after globalize/number and globalize/plural +require( "./globalize/relative-time" ); +require( "./globalize/unit" ); diff --git a/StockManMVC/.bin/bower_components/globalize/src/build/outro.js b/StockManMVC/.bin/bower_components/globalize/src/build/outro.js new file mode 100644 index 0000000..be4600a --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/build/outro.js @@ -0,0 +1 @@ +})); diff --git a/StockManMVC/.bin/bower_components/globalize/src/common/create-error.js b/StockManMVC/.bin/bower_components/globalize/src/common/create-error.js new file mode 100644 index 0000000..aa16236 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/common/create-error.js @@ -0,0 +1,18 @@ +define([ + "./format-message", + "../util/object/extend" +], function( formatMessage, objectExtend ) { + +return function( code, message, attributes ) { + var error; + + message = code + ( message ? ": " + formatMessage( message, attributes ) : "" ); + error = new Error( message ); + error.code = code; + + objectExtend( error, attributes ); + + return error; +}; + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/src/common/create-error/invalid-parameter-value.js b/StockManMVC/.bin/bower_components/globalize/src/common/create-error/invalid-parameter-value.js new file mode 100644 index 0000000..b014c29 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/common/create-error/invalid-parameter-value.js @@ -0,0 +1,12 @@ +define([ + "../create-error" +], function( createError ) { + +return function( name, value ) { + return createError( "E_INVALID_PAR_VALUE", "Invalid `{name}` value ({value}).", { + name: name, + value: value + }); +}; + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/src/common/create-error/plural-module-presence.js b/StockManMVC/.bin/bower_components/globalize/src/common/create-error/plural-module-presence.js new file mode 100644 index 0000000..d7a9396 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/common/create-error/plural-module-presence.js @@ -0,0 +1,9 @@ +define([ + "../create-error" +], function( createError ) { + +return function() { + return createError( "E_MISSING_PLURAL_MODULE", "Plural module not loaded." ); +}; + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/src/common/create-error/unsupported-feature.js b/StockManMVC/.bin/bower_components/globalize/src/common/create-error/unsupported-feature.js new file mode 100644 index 0000000..27de1ed --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/common/create-error/unsupported-feature.js @@ -0,0 +1,11 @@ +define([ + "../create-error" +], function( createError ) { + +return function( feature ) { + return createError( "E_UNSUPPORTED", "Unsupported {feature}.", { + feature: feature + }); +}; + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/src/common/format-message.js b/StockManMVC/.bin/bower_components/globalize/src/common/format-message.js new file mode 100644 index 0000000..a3e825c --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/common/format-message.js @@ -0,0 +1,34 @@ +define([ + "../util/to-string" +], function( toString ) { + +/** + * formatMessage( message, data ) + * + * @message [String] A message with optional {vars} to be replaced. + * + * @data [Array or JSON] Object with replacing-variables content. + * + * Return the formatted message. For example: + * + * - formatMessage( "{0} second", [ 1 ] ); // 1 second + * + * - formatMessage( "{0}/{1}", ["m", "s"] ); // m/s + * + * - formatMessage( "{name} <{email}>", { + * name: "Foo", + * email: "bar@baz.qux" + * }); // Foo + */ +return function( message, data ) { + + // Replace {attribute}'s + message = message.replace( /{[0-9a-zA-Z-_. ]+}/g, function( name ) { + name = name.replace( /^{([^}]*)}$/, "$1" ); + return toString( data[ name ] ); + }); + + return message; +}; + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/src/common/runtime-bind.js b/StockManMVC/.bin/bower_components/globalize/src/common/runtime-bind.js new file mode 100644 index 0000000..fc66263 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/common/runtime-bind.js @@ -0,0 +1,29 @@ +define([ + "./runtime-key", + "../util/function-name" +], function( runtimeKey, functionName ) { + +return function( args, cldr, fn, runtimeArgs ) { + + var argsStr = JSON.stringify( args ), + fnName = functionName( fn ), + locale = cldr.locale; + + // If name of the function is not available, this is most likely due uglification, + // which most likely means we are in production, and runtimeBind here is not necessary. + if ( !fnName ) { + return fn; + } + + fn.runtimeKey = runtimeKey( fnName, locale, null, argsStr ); + + fn.generatorString = function() { + return "Globalize(\"" + locale + "\")." + fnName + "(" + argsStr.slice( 1, -1 ) + ")"; + }; + + fn.runtimeArgs = runtimeArgs; + + return fn; +}; + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/src/common/runtime-key.js b/StockManMVC/.bin/bower_components/globalize/src/common/runtime-key.js new file mode 100644 index 0000000..c1513aa --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/common/runtime-key.js @@ -0,0 +1,12 @@ +define([ + "../util/string/hash" +], function( stringHash ) { + +return function( fnName, locale, args, argsStr ) { + var hash; + argsStr = argsStr || JSON.stringify( args ); + hash = stringHash( fnName + locale + argsStr ); + return hash > 0 ? "a" + hash : "b" + Math.abs( hash ); +}; + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/src/common/validate.js b/StockManMVC/.bin/bower_components/globalize/src/common/validate.js new file mode 100644 index 0000000..ace0342 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/common/validate.js @@ -0,0 +1,11 @@ +define([ + "./create-error" +], function( createError ) { + +return function( code, message, check, attributes ) { + if ( !check ) { + throw createError( code, message, attributes ); + } +}; + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/src/common/validate/cldr.js b/StockManMVC/.bin/bower_components/globalize/src/common/validate/cldr.js new file mode 100644 index 0000000..0a2feb3 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/common/validate/cldr.js @@ -0,0 +1,19 @@ +define([ + "../validate", + "../../util/always-array" +], function( validate, alwaysArray ) { + +return function( path, value, options ) { + var skipBoolean; + options = options || {}; + + skipBoolean = alwaysArray( options.skip ).some(function( pathRe ) { + return pathRe.test( path ); + }); + + validate( "E_MISSING_CLDR", "Missing required CLDR content `{path}`.", value || skipBoolean, { + path: path + }); +}; + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/src/common/validate/default-locale.js b/StockManMVC/.bin/bower_components/globalize/src/common/validate/default-locale.js new file mode 100644 index 0000000..7e2379f --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/common/validate/default-locale.js @@ -0,0 +1,10 @@ +define([ + "../validate" +], function( validate ) { + +return function( value ) { + validate( "E_DEFAULT_LOCALE_NOT_DEFINED", "Default locale has not been defined.", + value !== undefined, {} ); +}; + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/src/common/validate/message-bundle.js b/StockManMVC/.bin/bower_components/globalize/src/common/validate/message-bundle.js new file mode 100644 index 0000000..1c7ea3a --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/common/validate/message-bundle.js @@ -0,0 +1,16 @@ +define([ + "../validate" +], function( validate ) { + +return function( cldr ) { + validate( + "E_MISSING_MESSAGE_BUNDLE", + "Missing message bundle for locale `{locale}`.", + cldr.attributes.bundle && cldr.get( "globalize-messages/{bundle}" ) !== undefined, + { + locale: cldr.locale + } + ); +}; + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/src/common/validate/message-presence.js b/StockManMVC/.bin/bower_components/globalize/src/common/validate/message-presence.js new file mode 100644 index 0000000..5f7fd93 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/common/validate/message-presence.js @@ -0,0 +1,11 @@ +define([ + "../validate" +], function( validate ) { + +return function( path, value ) { + path = path.join( "/" ); + validate( "E_MISSING_MESSAGE", "Missing required message content `{path}`.", + value !== undefined, { path: path } ); +}; + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/src/common/validate/message-type.js b/StockManMVC/.bin/bower_components/globalize/src/common/validate/message-type.js new file mode 100644 index 0000000..185d2b4 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/common/validate/message-type.js @@ -0,0 +1,18 @@ +define([ + "../validate" +], function( validate ) { + +return function( path, value ) { + path = path.join( "/" ); + validate( + "E_INVALID_MESSAGE", + "Invalid message content `{path}`. {expected} expected.", + typeof value === "string", + { + expected: "a string", + path: path + } + ); +}; + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/src/common/validate/parameter-presence.js b/StockManMVC/.bin/bower_components/globalize/src/common/validate/parameter-presence.js new file mode 100644 index 0000000..81bc2cc --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/common/validate/parameter-presence.js @@ -0,0 +1,10 @@ +define([ + "../validate" +], function( validate ) { + +return function( value, name ) { + validate( "E_MISSING_PARAMETER", "Missing required parameter `{name}`.", + value !== undefined, { name: name }); +}; + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/src/common/validate/parameter-range.js b/StockManMVC/.bin/bower_components/globalize/src/common/validate/parameter-range.js new file mode 100644 index 0000000..df54782 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/common/validate/parameter-range.js @@ -0,0 +1,30 @@ +define([ + "../validate" +], function( validate ) { + +/** + * range( value, name, minimum, maximum ) + * + * @value [Number]. + * + * @name [String] name of variable. + * + * @minimum [Number]. The lowest valid value, inclusive. + * + * @maximum [Number]. The greatest valid value, inclusive. + */ +return function( value, name, minimum, maximum ) { + validate( + "E_PAR_OUT_OF_RANGE", + "Parameter `{name}` has value `{value}` out of range [{minimum}, {maximum}].", + value === undefined || value >= minimum && value <= maximum, + { + maximum: maximum, + minimum: minimum, + name: name, + value: value + } + ); +}; + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/src/common/validate/parameter-type.js b/StockManMVC/.bin/bower_components/globalize/src/common/validate/parameter-type.js new file mode 100644 index 0000000..6a45d17 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/common/validate/parameter-type.js @@ -0,0 +1,18 @@ +define([ + "../validate" +], function( validate ) { + +return function( value, name, check, expected ) { + validate( + "E_INVALID_PAR_TYPE", + "Invalid `{name}` parameter ({value}). {expected} expected.", + check, + { + expected: expected, + name: name, + value: value + } + ); +}; + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/src/common/validate/parameter-type/array.js b/StockManMVC/.bin/bower_components/globalize/src/common/validate/parameter-type/array.js new file mode 100644 index 0000000..9ee77a8 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/common/validate/parameter-type/array.js @@ -0,0 +1,9 @@ +define([ + "../parameter-type" +], function( validateParameterType ) { + +return function( value, name ) { + validateParameterType( value, name, value === undefined || Array.isArray( value ), "Array" ); +}; + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/src/common/validate/parameter-type/currency.js b/StockManMVC/.bin/bower_components/globalize/src/common/validate/parameter-type/currency.js new file mode 100644 index 0000000..7497d39 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/common/validate/parameter-type/currency.js @@ -0,0 +1,14 @@ +define([ + "../parameter-type" +], function( validateParameterType ) { + +return function( value, name ) { + validateParameterType( + value, + name, + value === undefined || typeof value === "string" && ( /^[A-Za-z]{3}$/ ).test( value ), + "3-letter currency code string as defined by ISO 4217" + ); +}; + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/src/common/validate/parameter-type/date.js b/StockManMVC/.bin/bower_components/globalize/src/common/validate/parameter-type/date.js new file mode 100644 index 0000000..d29a1e0 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/common/validate/parameter-type/date.js @@ -0,0 +1,9 @@ +define([ + "../parameter-type" +], function( validateParameterType ) { + +return function( value, name ) { + validateParameterType( value, name, value === undefined || value instanceof Date, "Date" ); +}; + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/src/common/validate/parameter-type/locale.js b/StockManMVC/.bin/bower_components/globalize/src/common/validate/parameter-type/locale.js new file mode 100644 index 0000000..f1bb61b --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/common/validate/parameter-type/locale.js @@ -0,0 +1,15 @@ +define([ + "cldr", + "../parameter-type" +], function( Cldr, validateParameterType ) { + +return function( value, name ) { + validateParameterType( + value, + name, + value === undefined || typeof value === "string" || value instanceof Cldr, + "String or Cldr instance" + ); +}; + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/src/common/validate/parameter-type/message-variables.js b/StockManMVC/.bin/bower_components/globalize/src/common/validate/parameter-type/message-variables.js new file mode 100644 index 0000000..a0f0d5d --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/common/validate/parameter-type/message-variables.js @@ -0,0 +1,15 @@ +define([ + "../parameter-type", + "../../../util/is-plain-object" +], function( validateParameterType, isPlainObject ) { + +return function( value, name ) { + validateParameterType( + value, + name, + value === undefined || isPlainObject( value ) || Array.isArray( value ), + "Array or Plain Object" + ); +}; + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/src/common/validate/parameter-type/number.js b/StockManMVC/.bin/bower_components/globalize/src/common/validate/parameter-type/number.js new file mode 100644 index 0000000..c7dfb00 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/common/validate/parameter-type/number.js @@ -0,0 +1,14 @@ +define([ + "../parameter-type" +], function( validateParameterType ) { + +return function( value, name ) { + validateParameterType( + value, + name, + value === undefined || typeof value === "number", + "Number" + ); +}; + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/src/common/validate/parameter-type/plain-object.js b/StockManMVC/.bin/bower_components/globalize/src/common/validate/parameter-type/plain-object.js new file mode 100644 index 0000000..6a57810 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/common/validate/parameter-type/plain-object.js @@ -0,0 +1,15 @@ +define([ + "../parameter-type", + "../../../util/is-plain-object" +], function( validateParameterType, isPlainObject ) { + +return function( value, name ) { + validateParameterType( + value, + name, + value === undefined || isPlainObject( value ), + "Plain Object" + ); +}; + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/src/common/validate/parameter-type/plural-type.js b/StockManMVC/.bin/bower_components/globalize/src/common/validate/parameter-type/plural-type.js new file mode 100644 index 0000000..8991f19 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/common/validate/parameter-type/plural-type.js @@ -0,0 +1,14 @@ +define([ + "../parameter-type" +], function( validateParameterType ) { + +return function( value, name ) { + validateParameterType( + value, + name, + value === undefined || value === "cardinal" || value === "ordinal", + "String \"cardinal\" or \"ordinal\"" + ); +}; + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/src/common/validate/parameter-type/string.js b/StockManMVC/.bin/bower_components/globalize/src/common/validate/parameter-type/string.js new file mode 100644 index 0000000..c53512e --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/common/validate/parameter-type/string.js @@ -0,0 +1,14 @@ +define([ + "../parameter-type" +], function( validateParameterType ) { + +return function( value, name ) { + validateParameterType( + value, + name, + value === undefined || typeof value === "string", + "a string" + ); +}; + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/src/core-runtime.js b/StockManMVC/.bin/bower_components/globalize/src/core-runtime.js new file mode 100644 index 0000000..ed97bbc --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/core-runtime.js @@ -0,0 +1,44 @@ +define([ + "./common/create-error", + "./common/format-message", + "./common/runtime-key", + "./common/validate/parameter-presence", + "./common/validate/parameter-type", + "./common/validate/parameter-type/string", + "./util/regexp/escape", + "./util/string/pad" +], function( createError, formatMessage, runtimeKey, validateParameterPresence, + validateParameterType, validateParameterTypeString, regexpEscape, stringPad ) { + +function Globalize( locale ) { + if ( !( this instanceof Globalize ) ) { + return new Globalize( locale ); + } + + validateParameterPresence( locale, "locale" ); + validateParameterTypeString( locale, "locale" ); + + this._locale = locale; +} + +Globalize.locale = function( locale ) { + validateParameterTypeString( locale, "locale" ); + + if ( arguments.length ) { + this._locale = locale; + } + return this._locale; +}; + +Globalize._createError = createError; +Globalize._formatMessage = formatMessage; +Globalize._regexpEscape = regexpEscape; +Globalize._runtimeKey = runtimeKey; +Globalize._stringPad = stringPad; +Globalize._validateParameterPresence = validateParameterPresence; +Globalize._validateParameterTypeString = validateParameterTypeString; +Globalize._validateParameterType = validateParameterType; + +return Globalize; + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/src/core.js b/StockManMVC/.bin/bower_components/globalize/src/core.js new file mode 100644 index 0000000..28a7b34 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/core.js @@ -0,0 +1,110 @@ +define([ + "cldr", + "./common/create-error", + "./common/format-message", + "./common/runtime-bind", + "./common/validate", + "./common/validate/cldr", + "./common/validate/default-locale", + "./common/validate/parameter-presence", + "./common/validate/parameter-range", + "./common/validate/parameter-type", + "./common/validate/parameter-type/locale", + "./common/validate/parameter-type/plain-object", + "./util/always-array", + "./util/always-cldr", + "./util/is-plain-object", + "./util/object/extend", + "./util/regexp/escape", + "./util/string/pad", + + "cldr/event" +], function( Cldr, createError, formatMessage, runtimeBind, validate, validateCldr, + validateDefaultLocale, validateParameterPresence, validateParameterRange, validateParameterType, + validateParameterTypeLocale, validateParameterTypePlainObject, alwaysArray, alwaysCldr, + isPlainObject, objectExtend, regexpEscape, stringPad ) { + +function validateLikelySubtags( cldr ) { + cldr.once( "get", validateCldr ); + cldr.get( "supplemental/likelySubtags" ); +} + +/** + * [new] Globalize( locale|cldr ) + * + * @locale [String] + * + * @cldr [Cldr instance] + * + * Create a Globalize instance. + */ +function Globalize( locale ) { + if ( !( this instanceof Globalize ) ) { + return new Globalize( locale ); + } + + validateParameterPresence( locale, "locale" ); + validateParameterTypeLocale( locale, "locale" ); + + this.cldr = alwaysCldr( locale ); + + validateLikelySubtags( this.cldr ); +} + +/** + * Globalize.load( json, ... ) + * + * @json [JSON] + * + * Load resolved or unresolved cldr data. + * Somewhat equivalent to previous Globalize.addCultureInfo(...). + */ +Globalize.load = function() { + + // validations are delegated to Cldr.load(). + Cldr.load.apply( Cldr, arguments ); +}; + +/** + * Globalize.locale( [locale|cldr] ) + * + * @locale [String] + * + * @cldr [Cldr instance] + * + * Set default Cldr instance if locale or cldr argument is passed. + * + * Return the default Cldr instance. + */ +Globalize.locale = function( locale ) { + validateParameterTypeLocale( locale, "locale" ); + + if ( arguments.length ) { + this.cldr = alwaysCldr( locale ); + validateLikelySubtags( this.cldr ); + } + return this.cldr; +}; + +/** + * Optimization to avoid duplicating some internal functions across modules. + */ +Globalize._alwaysArray = alwaysArray; +Globalize._createError = createError; +Globalize._formatMessage = formatMessage; +Globalize._isPlainObject = isPlainObject; +Globalize._objectExtend = objectExtend; +Globalize._regexpEscape = regexpEscape; +Globalize._runtimeBind = runtimeBind; +Globalize._stringPad = stringPad; +Globalize._validate = validate; +Globalize._validateCldr = validateCldr; +Globalize._validateDefaultLocale = validateDefaultLocale; +Globalize._validateParameterPresence = validateParameterPresence; +Globalize._validateParameterRange = validateParameterRange; +Globalize._validateParameterTypePlainObject = validateParameterTypePlainObject; +Globalize._validateParameterType = validateParameterType; + +return Globalize; + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/src/currency-runtime.js b/StockManMVC/.bin/bower_components/globalize/src/currency-runtime.js new file mode 100644 index 0000000..a372335 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/currency-runtime.js @@ -0,0 +1,32 @@ +define([ + "./common/runtime-key", + "./common/validate/parameter-presence", + "./common/validate/parameter-type/number", + "./core-runtime", + "./currency/formatter-fn", + "./currency/name-format", + + "./number-runtime" +], function( runtimeKey, validateParameterPresence, validateParameterTypeNumber, Globalize, + currencyFormatterFn, currencyNameFormat ) { + +Globalize._currencyFormatterFn = currencyFormatterFn; +Globalize._currencyNameFormat = currencyNameFormat; + +Globalize.currencyFormatter = +Globalize.prototype.currencyFormatter = function( currency, options ) { + options = options || {}; + return Globalize[ runtimeKey( "currencyFormatter", this._locale, [ currency, options ] ) ]; +}; + +Globalize.formatCurrency = +Globalize.prototype.formatCurrency = function( value, currency, options ) { + validateParameterPresence( value, "value" ); + validateParameterTypeNumber( value, "value" ); + + return this.currencyFormatter( currency, options )( value ); +}; + +return Globalize; + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/src/currency.js b/StockManMVC/.bin/bower_components/globalize/src/currency.js new file mode 100644 index 0000000..9777580 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/currency.js @@ -0,0 +1,146 @@ +define([ + "./core", + "./common/runtime-bind", + "./common/validate/cldr", + "./common/validate/default-locale", + "./common/validate/parameter-presence", + "./common/validate/parameter-type/currency", + "./common/validate/parameter-type/number", + "./common/validate/parameter-type/plain-object", + "./currency/code-properties", + "./currency/formatter-fn", + "./currency/name-properties", + "./currency/symbol-properties", + "./util/object/omit", + + "./number", + "cldr/event", + "cldr/supplemental" +], function( Globalize, runtimeBind, validateCldr, validateDefaultLocale, validateParameterPresence, + validateParameterTypeCurrency, validateParameterTypeNumber, validateParameterTypePlainObject, + currencyCodeProperties, currencyFormatterFn, currencyNameProperties, currencySymbolProperties, + objectOmit ) { + +function validateRequiredCldr( path, value ) { + validateCldr( path, value, { + skip: [ /supplemental\/currencyData\/fractions\/[A-Za-z]{3}$/ ] + }); +} + +/** + * .currencyFormatter( currency [, options] ) + * + * @currency [String] 3-letter currency code as defined by ISO 4217. + * + * @options [Object]: + * - style: [String] "symbol" (default), "accounting", "code" or "name". + * - see also number/format options. + * + * Return a function that formats a currency according to the given options and default/instance + * locale. + */ +Globalize.currencyFormatter = +Globalize.prototype.currencyFormatter = function( currency, options ) { + var args, cldr, numberFormatter, pluralGenerator, properties, returnFn, style; + + validateParameterPresence( currency, "currency" ); + validateParameterTypeCurrency( currency, "currency" ); + + validateParameterTypePlainObject( options, "options" ); + + cldr = this.cldr; + options = options || {}; + + args = [ currency, options ]; + style = options.style || "symbol"; + + validateDefaultLocale( cldr ); + + // Get properties given style ("symbol" default, "code" or "name"). + cldr.on( "get", validateRequiredCldr ); + properties = ({ + accounting: currencySymbolProperties, + code: currencyCodeProperties, + name: currencyNameProperties, + symbol: currencySymbolProperties + }[ style ] )( currency, cldr, options ); + cldr.off( "get", validateRequiredCldr ); + + // options = options minus style, plus raw pattern. + options = objectOmit( options, "style" ); + options.raw = properties.pattern; + + // Return formatter when style is "symbol" or "accounting". + if ( style === "symbol" || style === "accounting" ) { + numberFormatter = this.numberFormatter( options ); + + returnFn = currencyFormatterFn( numberFormatter ); + + runtimeBind( args, cldr, returnFn, [ numberFormatter ] ); + + // Return formatter when style is "code" or "name". + } else { + numberFormatter = this.numberFormatter( options ); + pluralGenerator = this.pluralGenerator(); + + returnFn = currencyFormatterFn( numberFormatter, pluralGenerator, properties ); + + runtimeBind( args, cldr, returnFn, [ numberFormatter, pluralGenerator, properties ] ); + } + + return returnFn; +}; + +/** + * .currencyParser( currency [, options] ) + * + * @currency [String] 3-letter currency code as defined by ISO 4217. + * + * @options [Object] see currencyFormatter. + * + * Return the currency parser according to the given options and the default/instance locale. + */ +Globalize.currencyParser = +Globalize.prototype.currencyParser = function( /* currency, options */ ) { + + // TODO implement parser. + +}; + +/** + * .formatCurrency( value, currency [, options] ) + * + * @value [Number] number to be formatted. + * + * @currency [String] 3-letter currency code as defined by ISO 4217. + * + * @options [Object] see currencyFormatter. + * + * Format a currency according to the given options and the default/instance locale. + */ +Globalize.formatCurrency = +Globalize.prototype.formatCurrency = function( value, currency, options ) { + validateParameterPresence( value, "value" ); + validateParameterTypeNumber( value, "value" ); + + return this.currencyFormatter( currency, options )( value ); +}; + +/** + * .parseCurrency( value, currency [, options] ) + * + * @value [String] + * + * @currency [String] 3-letter currency code as defined by ISO 4217. + * + * @options [Object]: See currencyFormatter. + * + * Return the parsed currency or NaN when value is invalid. + */ +Globalize.parseCurrency = +Globalize.prototype.parseCurrency = function( /* value, currency, options */ ) { +}; + +return Globalize; + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/src/currency/code-properties.js b/StockManMVC/.bin/bower_components/globalize/src/currency/code-properties.js new file mode 100644 index 0000000..9239b52 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/currency/code-properties.js @@ -0,0 +1,26 @@ +define([ + "./supplemental-override", + "./unit-patterns", + "../number/pattern" +], function( currencySupplementalOverride, currencyUnitPatterns, numberPattern ) { + +/** + * codeProperties( currency, cldr ) + * + * Return number pattern with the appropriate currency code in as literal. + */ +return function( currency, cldr ) { + var pattern = numberPattern( "decimal", cldr ); + + // The number of decimal places and the rounding for each currency is not locale-specific. Those + // values overridden by Supplemental Currency Data. + pattern = currencySupplementalOverride( currency, pattern, cldr ); + + return { + currency: currency, + pattern: pattern, + unitPatterns: currencyUnitPatterns( cldr ) + }; +}; + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/src/currency/formatter-fn.js b/StockManMVC/.bin/bower_components/globalize/src/currency/formatter-fn.js new file mode 100644 index 0000000..453f485 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/currency/formatter-fn.js @@ -0,0 +1,32 @@ +define([ + "../common/validate/parameter-presence", + "../common/validate/parameter-type/number", + "./name-format" +], function( validateParameterPresence, validateParameterTypeNumber, currencyNameFormat ) { + +return function( numberFormatter, pluralGenerator, properties ) { + var fn; + + // Return formatter when style is "code" or "name". + if ( pluralGenerator && properties ) { + fn = function currencyFormatter( value ) { + validateParameterPresence( value, "value" ); + validateParameterTypeNumber( value, "value" ); + return currencyNameFormat( + numberFormatter( value ), + pluralGenerator( value ), + properties + ); + }; + + // Return formatter when style is "symbol" or "accounting". + } else { + fn = function currencyFormatter( value ) { + return numberFormatter( value ); + }; + } + + return fn; +}; + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/src/currency/name-format.js b/StockManMVC/.bin/bower_components/globalize/src/currency/name-format.js new file mode 100644 index 0000000..4ad17b9 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/currency/name-format.js @@ -0,0 +1,25 @@ +define([ + "../common/format-message" +], function( formatMessage ) { + +/** + * nameFormat( formattedNumber, pluralForm, properties ) + * + * Return the appropriate name form currency format. + */ +return function( formattedNumber, pluralForm, properties ) { + var displayName, unitPattern, + displayNames = properties.displayNames || {}, + unitPatterns = properties.unitPatterns; + + displayName = displayNames[ "displayName-count-" + pluralForm ] || + displayNames[ "displayName-count-other" ] || + displayNames.displayName || + properties.currency; + unitPattern = unitPatterns[ "unitPattern-count-" + pluralForm ] || + unitPatterns[ "unitPattern-count-other" ]; + + return formatMessage( unitPattern, [ formattedNumber, displayName ]); +}; + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/src/currency/name-properties.js b/StockManMVC/.bin/bower_components/globalize/src/currency/name-properties.js new file mode 100644 index 0000000..b52a7a4 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/currency/name-properties.js @@ -0,0 +1,22 @@ +define([ + "./code-properties", + "../util/object/filter" +], function( currencyCodeProperties, objectFilter ) { + +/** + * nameProperties( currency, cldr ) + * + * Return number pattern with the appropriate currency code in as literal. + */ +return function( currency, cldr ) { + var properties = currencyCodeProperties( currency, cldr ); + + properties.displayNames = objectFilter( cldr.main([ + "numbers/currencies", + currency + ]), /^displayName/ ); + + return properties; +}; + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/src/currency/supplemental-override.js b/StockManMVC/.bin/bower_components/globalize/src/currency/supplemental-override.js new file mode 100644 index 0000000..73fbaf5 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/currency/supplemental-override.js @@ -0,0 +1,25 @@ +define([ + "../util/string/pad" +], function( stringPad ) { + +/** + * supplementalOverride( currency, pattern, cldr ) + * + * Return pattern with fraction digits overriden by supplemental currency data. + */ +return function( currency, pattern, cldr ) { + var digits, + fraction = "", + fractionData = cldr.supplemental([ "currencyData/fractions", currency ]) || + cldr.supplemental( "currencyData/fractions/DEFAULT" ); + + digits = +fractionData._digits; + + if ( digits ) { + fraction = "." + stringPad( "0", digits ).slice( 0, -1 ) + fractionData._rounding; + } + + return pattern.replace( /\.(#+|0*[0-9]|0+[0-9]?)/g, fraction ); +}; + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/src/currency/symbol-properties.js b/StockManMVC/.bin/bower_components/globalize/src/currency/symbol-properties.js new file mode 100644 index 0000000..93a9a51 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/currency/symbol-properties.js @@ -0,0 +1,74 @@ +define([ + "./supplemental-override", + "../number/numbering-system", + "../util/regexp/not-s" +], function( currencySupplementalOverride, numberNumberingSystem, regexpNotS ) { + +/** + * symbolProperties( currency, cldr ) + * + * Return pattern replacing `¤` with the appropriate currency symbol literal. + */ +return function( currency, cldr, options ) { + var currencySpacing, pattern, + regexp = { + "[:digit:]": /\d/, + "[:^S:]": regexpNotS + }, + symbol = cldr.main([ + "numbers/currencies", + currency, + "symbol" + ]); + + currencySpacing = [ "beforeCurrency", "afterCurrency" ].map(function( position ) { + return cldr.main([ + "numbers", + "currencyFormats-numberSystem-" + numberNumberingSystem( cldr ), + "currencySpacing", + position + ]); + }); + + pattern = cldr.main([ + "numbers", + "currencyFormats-numberSystem-" + numberNumberingSystem( cldr ), + options.style === "accounting" ? "accounting" : "standard" + ]); + + pattern = + + // The number of decimal places and the rounding for each currency is not locale-specific. + // Those values are overridden by Supplemental Currency Data. + currencySupplementalOverride( currency, pattern, cldr ) + + // Replace "¤" (\u00A4) with the appropriate symbol literal. + .split( ";" ).map(function( pattern ) { + + return pattern.split( "\u00A4" ).map(function( part, i ) { + var currencyMatch = regexp[ currencySpacing[ i ].currencyMatch ], + surroundingMatch = regexp[ currencySpacing[ i ].surroundingMatch ], + insertBetween = ""; + + // For currencyMatch and surroundingMatch definitions, read [1]. + // When i === 0, beforeCurrency is being handled. Otherwise, afterCurrency. + // 1: http://www.unicode.org/reports/tr35/tr35-numbers.html#Currencies + currencyMatch = currencyMatch.test( symbol.charAt( i ? symbol.length - 1 : 0 ) ); + surroundingMatch = surroundingMatch.test( + part.charAt( i ? 0 : part.length - 1 ).replace( /[#@,.]/g, "0" ) + ); + + if ( currencyMatch && part && surroundingMatch ) { + insertBetween = currencySpacing[ i ].insertBetween; + } + + return ( i ? insertBetween : "" ) + part + ( i ? "" : insertBetween ); + }).join( "'" + symbol + "'" ); + }).join( ";" ); + + return { + pattern: pattern + }; +}; + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/src/currency/unit-patterns.js b/StockManMVC/.bin/bower_components/globalize/src/currency/unit-patterns.js new file mode 100644 index 0000000..3a90861 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/currency/unit-patterns.js @@ -0,0 +1,13 @@ +define([ + "../util/object/filter", + "../number/numbering-system" +], function( objectFilter, numberNumberingSystem ) { + +return function( cldr ) { + return objectFilter( cldr.main([ + "numbers", + "currencyFormats-numberSystem-" + numberNumberingSystem( cldr ) + ]), /^unitPattern/ ); +}; + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/src/date-runtime.js b/StockManMVC/.bin/bower_components/globalize/src/date-runtime.js new file mode 100644 index 0000000..db908de --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/date-runtime.js @@ -0,0 +1,55 @@ +define([ + "./common/runtime-key", + "./common/validate/parameter-presence", + "./common/validate/parameter-type/date", + "./common/validate/parameter-type/string", + "./core-runtime", + "./date/format", + "./date/formatter-fn", + "./date/parse", + "./date/parser-fn", + "./date/tokenizer", + + "./number-runtime" +], function( runtimeKey, validateParameterPresence, validateParameterTypeDate, + validateParameterTypeString, Globalize, dateFormat, dateFormatterFn, dateParse, dateParserFn, + dateTokenizer ) { + +Globalize._dateFormatterFn = dateFormatterFn; +Globalize._dateParserFn = dateParserFn; +Globalize._dateFormat = dateFormat; +Globalize._dateParser = dateParse; +Globalize._dateTokenizer = dateTokenizer; +Globalize._validateParameterTypeDate = validateParameterTypeDate; + +Globalize.dateFormatter = +Globalize.prototype.dateFormatter = function( options ) { + options = options || { skeleton: "yMd" }; + return Globalize[ runtimeKey( "dateFormatter", this._locale, [ options ] ) ]; +}; + +Globalize.dateParser = +Globalize.prototype.dateParser = function( options ) { + options = options || { skeleton: "yMd" }; + return Globalize[ runtimeKey( "dateParser", this._locale, [ options ] ) ]; +}; + +Globalize.formatDate = +Globalize.prototype.formatDate = function( value, options ) { + validateParameterPresence( value, "value" ); + validateParameterTypeDate( value, "value" ); + + return this.dateFormatter( options )( value ); +}; + +Globalize.parseDate = +Globalize.prototype.parseDate = function( value, options ) { + validateParameterPresence( value, "value" ); + validateParameterTypeString( value, "value" ); + + return this.dateParser( options )( value ); +}; + +return Globalize; + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/src/date.js b/StockManMVC/.bin/bower_components/globalize/src/date.js new file mode 100644 index 0000000..98500c9 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/date.js @@ -0,0 +1,158 @@ +define([ + "cldr", + "./common/runtime-bind", + "./common/validate/cldr", + "./common/validate/default-locale", + "./common/validate/parameter-presence", + "./common/validate/parameter-type/date", + "./common/validate/parameter-type/plain-object", + "./common/validate/parameter-type/string", + "./core", + "./date/expand-pattern", + "./date/formatter-fn", + "./date/format-properties", + "./date/parser-fn", + "./date/parse-properties", + "./date/tokenizer-properties", + + "cldr/event", + "cldr/supplemental", + "./number" +], function( Cldr, runtimeBind, validateCldr, validateDefaultLocale, validateParameterPresence, + validateParameterTypeDate, validateParameterTypePlainObject, validateParameterTypeString, + Globalize, dateExpandPattern, dateFormatterFn, dateFormatProperties, dateParserFn, + dateParseProperties, dateTokenizerProperties ) { + +function validateRequiredCldr( path, value ) { + validateCldr( path, value, { + skip: [ + /dates\/calendars\/gregorian\/dateTimeFormats\/availableFormats/, + /dates\/calendars\/gregorian\/days\/.*\/short/, + /supplemental\/timeData\/(?!001)/, + /supplemental\/weekData\/(?!001)/ + ] + }); +} + +/** + * .dateFormatter( options ) + * + * @options [Object] see date/expand_pattern for more info. + * + * Return a date formatter function (of the form below) according to the given options and the + * default/instance locale. + * + * fn( value ) + * + * @value [Date] + * + * Return a function that formats a date according to the given `format` and the default/instance + * locale. + */ +Globalize.dateFormatter = +Globalize.prototype.dateFormatter = function( options ) { + var args, cldr, numberFormatters, pad, pattern, properties, returnFn; + + validateParameterTypePlainObject( options, "options" ); + + cldr = this.cldr; + options = options || { skeleton: "yMd" }; + + args = [ options ]; + + validateDefaultLocale( cldr ); + + cldr.on( "get", validateRequiredCldr ); + pattern = dateExpandPattern( options, cldr ); + properties = dateFormatProperties( pattern, cldr ); + cldr.off( "get", validateRequiredCldr ); + + // Create needed number formatters. + numberFormatters = properties.numberFormatters; + delete properties.numberFormatters; + for ( pad in numberFormatters ) { + numberFormatters[ pad ] = this.numberFormatter({ + raw: numberFormatters[ pad ] + }); + } + + returnFn = dateFormatterFn( numberFormatters, properties ); + + runtimeBind( args, cldr, returnFn, [ numberFormatters, properties ] ); + + return returnFn; +}; + +/** + * .dateParser( options ) + * + * @options [Object] see date/expand_pattern for more info. + * + * Return a function that parses a string date according to the given `formats` and the + * default/instance locale. + */ +Globalize.dateParser = +Globalize.prototype.dateParser = function( options ) { + var args, cldr, numberParser, parseProperties, pattern, tokenizerProperties, returnFn; + + validateParameterTypePlainObject( options, "options" ); + + cldr = this.cldr; + options = options || { skeleton: "yMd" }; + + args = [ options ]; + + validateDefaultLocale( cldr ); + + cldr.on( "get", validateRequiredCldr ); + pattern = dateExpandPattern( options, cldr ); + tokenizerProperties = dateTokenizerProperties( pattern, cldr ); + parseProperties = dateParseProperties( cldr ); + cldr.off( "get", validateRequiredCldr ); + + numberParser = this.numberParser({ raw: "0" }); + + returnFn = dateParserFn( numberParser, parseProperties, tokenizerProperties ); + + runtimeBind( args, cldr, returnFn, [ numberParser, parseProperties, tokenizerProperties ] ); + + return returnFn; +}; + +/** + * .formatDate( value, options ) + * + * @value [Date] + * + * @options [Object] see date/expand_pattern for more info. + * + * Formats a date or number according to the given options string and the default/instance locale. + */ +Globalize.formatDate = +Globalize.prototype.formatDate = function( value, options ) { + validateParameterPresence( value, "value" ); + validateParameterTypeDate( value, "value" ); + + return this.dateFormatter( options )( value ); +}; + +/** + * .parseDate( value, options ) + * + * @value [String] + * + * @options [Object] see date/expand_pattern for more info. + * + * Return a Date instance or null. + */ +Globalize.parseDate = +Globalize.prototype.parseDate = function( value, options ) { + validateParameterPresence( value, "value" ); + validateParameterTypeString( value, "value" ); + + return this.dateParser( options )( value ); +}; + +return Globalize; + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/src/date/day-of-week.js b/StockManMVC/.bin/bower_components/globalize/src/date/day-of-week.js new file mode 100644 index 0000000..7c70c20 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/date/day-of-week.js @@ -0,0 +1,20 @@ +define(function() { + +/** + * dayOfWeek( date, firstDay ) + * + * @date + * + * @firstDay the result of `dateFirstDayOfWeek( cldr )` + * + * Return the day of the week normalized by the territory's firstDay [0-6]. + * Eg for "mon": + * - return 0 if territory is GB, or BR, or DE, or FR (week starts on "mon"); + * - return 1 if territory is US (week starts on "sun"); + * - return 2 if territory is EG (week starts on "sat"); + */ +return function( date, firstDay ) { + return ( date.getDay() - firstDay + 7 ) % 7; +}; + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/src/date/day-of-year.js b/StockManMVC/.bin/bower_components/globalize/src/date/day-of-year.js new file mode 100644 index 0000000..5158eae --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/date/day-of-year.js @@ -0,0 +1,15 @@ +define([ + "./distance-in-days", + "./start-of" +], function( dateDistanceInDays, dateStartOf ) { + +/** + * dayOfYear + * + * Return the distance in days of the date to the begin of the year [0-d]. + */ +return function( date ) { + return Math.floor( dateDistanceInDays( dateStartOf( date, "year" ), date ) ); +}; + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/src/date/distance-in-days.js b/StockManMVC/.bin/bower_components/globalize/src/date/distance-in-days.js new file mode 100644 index 0000000..1f1f265 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/date/distance-in-days.js @@ -0,0 +1,13 @@ +define(function() { + +/** + * distanceInDays( from, to ) + * + * Return the distance in days between from and to Dates. + */ +return function( from, to ) { + var inDays = 864e5; + return ( to.getTime() - from.getTime() ) / inDays; +}; + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/src/date/expand-pattern.js b/StockManMVC/.bin/bower_components/globalize/src/date/expand-pattern.js new file mode 100644 index 0000000..e153ae2 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/date/expand-pattern.js @@ -0,0 +1,103 @@ +define([ + "../common/format-message", + "../common/create-error/invalid-parameter-value" +], function( formatMessage, createErrorInvalidParameterValue ) { + +/** + * expandPattern( options, cldr ) + * + * @options [Object] if String, it's considered a skeleton. Object accepts: + * - skeleton: [String] lookup availableFormat; + * - date: [String] ( "full" | "long" | "medium" | "short" ); + * - time: [String] ( "full" | "long" | "medium" | "short" ); + * - datetime: [String] ( "full" | "long" | "medium" | "short" ); + * - raw: [String] For more info see datetime/format.js. + * + * @cldr [Cldr instance]. + * + * Return the corresponding pattern. + * Eg for "en": + * - "GyMMMd" returns "MMM d, y G"; + * - { skeleton: "GyMMMd" } returns "MMM d, y G"; + * - { date: "full" } returns "EEEE, MMMM d, y"; + * - { time: "full" } returns "h:mm:ss a zzzz"; + * - { datetime: "full" } returns "EEEE, MMMM d, y 'at' h:mm:ss a zzzz"; + * - { raw: "dd/mm" } returns "dd/mm"; + */ + +return function( options, cldr ) { + var dateSkeleton, result, skeleton, timeSkeleton, type; + + function combineDateTime( type, datePattern, timePattern ) { + return formatMessage( + cldr.main([ + "dates/calendars/gregorian/dateTimeFormats", + type + ]), + [ timePattern, datePattern ] + ); + } + + switch ( true ) { + case "skeleton" in options: + skeleton = options.skeleton; + result = cldr.main([ + "dates/calendars/gregorian/dateTimeFormats/availableFormats", + skeleton + ]); + if ( !result ) { + timeSkeleton = skeleton.split( /[^hHKkmsSAzZOvVXx]/ ).slice( -1 )[ 0 ]; + dateSkeleton = skeleton.split( /[^GyYuUrQqMLlwWdDFgEec]/ )[ 0 ]; + if ( /(MMMM|LLLL).*[Ec]/.test( dateSkeleton ) ) { + type = "full"; + } else if ( /MMMM/g.test( dateSkeleton ) ) { + type = "long"; + } else if ( /MMM/g.test( dateSkeleton ) || /LLL/g.test( dateSkeleton ) ) { + type = "medium"; + } else { + type = "short"; + } + result = combineDateTime( type, + cldr.main([ + "dates/calendars/gregorian/dateTimeFormats/availableFormats", + dateSkeleton + ]), + cldr.main([ + "dates/calendars/gregorian/dateTimeFormats/availableFormats", + timeSkeleton + ]) + ); + } + break; + + case "date" in options: + case "time" in options: + result = cldr.main([ + "dates/calendars/gregorian", + "date" in options ? "dateFormats" : "timeFormats", + ( options.date || options.time ) + ]); + break; + + case "datetime" in options: + result = combineDateTime( options.datetime, + cldr.main([ "dates/calendars/gregorian/dateFormats", options.datetime ]), + cldr.main([ "dates/calendars/gregorian/timeFormats", options.datetime ]) + ); + break; + + case "raw" in options: + result = options.raw; + break; + + default: + throw createErrorInvalidParameterValue({ + name: "options", + value: options + }); + } + + return result; +}; + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/src/date/first-day-of-week.js b/StockManMVC/.bin/bower_components/globalize/src/date/first-day-of-week.js new file mode 100644 index 0000000..44490b4 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/date/first-day-of-week.js @@ -0,0 +1,12 @@ +define([ + "./week-days" +], function( dateWeekDays ) { + +/** + * firstDayOfWeek + */ +return function( cldr ) { + return dateWeekDays.indexOf( cldr.supplemental.weekData.firstDay() ); +}; + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/src/date/format-properties.js b/StockManMVC/.bin/bower_components/globalize/src/date/format-properties.js new file mode 100644 index 0000000..6c42a9d --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/date/format-properties.js @@ -0,0 +1,242 @@ +define([ + "./first-day-of-week", + "./pattern-re", + "../common/create-error/unsupported-feature", + "../number/symbol", + "../util/string/pad" +], function( dateFirstDayOfWeek, datePatternRe, createErrorUnsupportedFeature, numberSymbol, + stringPad ) { + +/** + * properties( pattern, cldr ) + * + * @pattern [String] raw pattern. + * ref: http://www.unicode.org/reports/tr35/tr35-dates.html#Date_Format_Patterns + * + * @cldr [Cldr instance]. + * + * Return the properties given the pattern and cldr. + * + * TODO Support other calendar types. + */ +return function( pattern, cldr ) { + var properties = { + numberFormatters: {}, + pattern: pattern, + timeSeparator: numberSymbol( "timeSeparator", cldr ) + }, + widths = [ "abbreviated", "wide", "narrow" ]; + + function setNumberFormatterPattern( pad ) { + properties.numberFormatters[ pad ] = stringPad( "", pad ); + } + + pattern.replace( datePatternRe, function( current ) { + var formatNumber, + chr = current.charAt( 0 ), + length = current.length; + + if ( chr === "j" ) { + + // Locale preferred hHKk. + // http://www.unicode.org/reports/tr35/tr35-dates.html#Time_Data + properties.preferredTime = chr = cldr.supplemental.timeData.preferred(); + } + + // ZZZZ: same as "OOOO". + if ( chr === "Z" && length === 4 ) { + chr = "O"; + length = 4; + } + + switch ( chr ) { + + // Era + case "G": + properties.eras = cldr.main([ + "dates/calendars/gregorian/eras", + length <= 3 ? "eraAbbr" : ( length === 4 ? "eraNames" : "eraNarrow" ) + ]); + break; + + // Year + case "y": + + // Plain year. + formatNumber = true; + break; + + case "Y": + + // Year in "Week of Year" + properties.firstDay = dateFirstDayOfWeek( cldr ); + properties.minDays = cldr.supplemental.weekData.minDays(); + formatNumber = true; + break; + + case "u": // Extended year. Need to be implemented. + case "U": // Cyclic year name. Need to be implemented. + throw createErrorUnsupportedFeature({ + feature: "year pattern `" + chr + "`" + }); + + // Quarter + case "Q": + case "q": + if ( length > 2 ) { + if ( !properties.quarters ) { + properties.quarters = {}; + } + if ( !properties.quarters[ chr ] ) { + properties.quarters[ chr ] = {}; + } + properties.quarters[ chr ][ length ] = cldr.main([ + "dates/calendars/gregorian/quarters", + chr === "Q" ? "format" : "stand-alone", + widths[ length - 3 ] + ]); + } else { + formatNumber = true; + } + break; + + // Month + case "M": + case "L": + if ( length > 2 ) { + if ( !properties.months ) { + properties.months = {}; + } + if ( !properties.months[ chr ] ) { + properties.months[ chr ] = {}; + } + properties.months[ chr ][ length ] = cldr.main([ + "dates/calendars/gregorian/months", + chr === "M" ? "format" : "stand-alone", + widths[ length - 3 ] + ]); + } else { + formatNumber = true; + } + break; + + // Week - Week of Year (w) or Week of Month (W). + case "w": + case "W": + properties.firstDay = dateFirstDayOfWeek( cldr ); + properties.minDays = cldr.supplemental.weekData.minDays(); + formatNumber = true; + break; + + // Day + case "d": + case "D": + case "F": + formatNumber = true; + break; + + case "g": + + // Modified Julian day. Need to be implemented. + throw createErrorUnsupportedFeature({ + feature: "Julian day pattern `g`" + }); + + // Week day + case "e": + case "c": + if ( length <= 2 ) { + properties.firstDay = dateFirstDayOfWeek( cldr ); + formatNumber = true; + break; + } + + /* falls through */ + case "E": + if ( !properties.days ) { + properties.days = {}; + } + if ( !properties.days[ chr ] ) { + properties.days[ chr ] = {}; + } + if ( length === 6 ) { + + // If short day names are not explicitly specified, abbreviated day names are + // used instead. + // http://www.unicode.org/reports/tr35/tr35-dates.html#months_days_quarters_eras + // http://unicode.org/cldr/trac/ticket/6790 + properties.days[ chr ][ length ] = cldr.main([ + "dates/calendars/gregorian/days", + chr === "c" ? "stand-alone" : "format", + "short" + ]) || cldr.main([ + "dates/calendars/gregorian/days", + chr === "c" ? "stand-alone" : "format", + "abbreviated" + ]); + } else { + properties.days[ chr ][ length ] = cldr.main([ + "dates/calendars/gregorian/days", + chr === "c" ? "stand-alone" : "format", + widths[ length < 3 ? 0 : length - 3 ] + ]); + } + break; + + // Period (AM or PM) + case "a": + properties.dayPeriods = cldr.main( + "dates/calendars/gregorian/dayPeriods/format/wide" + ); + break; + + // Hour + case "h": // 1-12 + case "H": // 0-23 + case "K": // 0-11 + case "k": // 1-24 + + // Minute + case "m": + + // Second + case "s": + case "S": + case "A": + formatNumber = true; + break; + + // Zone + case "z": + case "O": + + // O: "{gmtFormat}+H;{gmtFormat}-H" or "{gmtZeroFormat}", eg. "GMT-8" or "GMT". + // OOOO: "{gmtFormat}{hourFormat}" or "{gmtZeroFormat}", eg. "GMT-08:00" or "GMT". + properties.gmtFormat = cldr.main( "dates/timeZoneNames/gmtFormat" ); + properties.gmtZeroFormat = cldr.main( "dates/timeZoneNames/gmtZeroFormat" ); + properties.tzLongHourFormat = cldr.main( "dates/timeZoneNames/hourFormat" ); + + /* falls through */ + case "Z": + case "X": + case "x": + setNumberFormatterPattern( 1 ); + setNumberFormatterPattern( 2 ); + break; + + case "v": + case "V": + throw createErrorUnsupportedFeature({ + feature: "timezone pattern `" + chr + "`" + }); + } + + if ( formatNumber ) { + setNumberFormatterPattern( length ); + } + }); + + return properties; +}; + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/src/date/format.js b/StockManMVC/.bin/bower_components/globalize/src/date/format.js new file mode 100644 index 0000000..2fd827e --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/date/format.js @@ -0,0 +1,270 @@ +define([ + "./day-of-week", + "./day-of-year", + "./milliseconds-in-day", + "./pattern-re", + "./start-of", + "./timezone-hour-format", + "./week-days" +], function( dateDayOfWeek, dateDayOfYear, dateMillisecondsInDay, datePatternRe, dateStartOf, + dateTimezoneHourFormat, dateWeekDays ) { + +/** + * format( date, properties ) + * + * @date [Date instance]. + * + * @properties + * + * TODO Support other calendar types. + * + * Disclosure: this function borrows excerpts of dojo/date/locale. + */ +return function( date, numberFormatters, properties ) { + var timeSeparator = properties.timeSeparator; + + return properties.pattern.replace( datePatternRe, function( current ) { + var ret, + chr = current.charAt( 0 ), + length = current.length; + + if ( chr === "j" ) { + + // Locale preferred hHKk. + // http://www.unicode.org/reports/tr35/tr35-dates.html#Time_Data + chr = properties.preferredTime; + } + + if ( chr === "Z" ) { + + // Z..ZZZ: same as "xxxx". + if ( length < 4 ) { + chr = "x"; + length = 4; + + // ZZZZ: same as "OOOO". + } else if ( length < 5 ) { + chr = "O"; + length = 4; + + // ZZZZZ: same as "XXXXX" + } else { + chr = "X"; + length = 5; + } + } + + switch ( chr ) { + + // Era + case "G": + ret = properties.eras[ date.getFullYear() < 0 ? 0 : 1 ]; + break; + + // Year + case "y": + + // Plain year. + // The length specifies the padding, but for two letters it also specifies the + // maximum length. + ret = date.getFullYear(); + if ( length === 2 ) { + ret = String( ret ); + ret = +ret.substr( ret.length - 2 ); + } + break; + + case "Y": + + // Year in "Week of Year" + // The length specifies the padding, but for two letters it also specifies the + // maximum length. + // yearInWeekofYear = date + DaysInAWeek - (dayOfWeek - firstDay) - minDays + ret = new Date( date.getTime() ); + ret.setDate( + ret.getDate() + 7 - + dateDayOfWeek( date, properties.firstDay ) - + properties.firstDay - + properties.minDays + ); + ret = ret.getFullYear(); + if ( length === 2 ) { + ret = String( ret ); + ret = +ret.substr( ret.length - 2 ); + } + break; + + // Quarter + case "Q": + case "q": + ret = Math.ceil( ( date.getMonth() + 1 ) / 3 ); + if ( length > 2 ) { + ret = properties.quarters[ chr ][ length ][ ret ]; + } + break; + + // Month + case "M": + case "L": + ret = date.getMonth() + 1; + if ( length > 2 ) { + ret = properties.months[ chr ][ length ][ ret ]; + } + break; + + // Week + case "w": + + // Week of Year. + // woy = ceil( ( doy + dow of 1/1 ) / 7 ) - minDaysStuff ? 1 : 0. + // TODO should pad on ww? Not documented, but I guess so. + ret = dateDayOfWeek( dateStartOf( date, "year" ), properties.firstDay ); + ret = Math.ceil( ( dateDayOfYear( date ) + ret ) / 7 ) - + ( 7 - ret >= properties.minDays ? 0 : 1 ); + break; + + case "W": + + // Week of Month. + // wom = ceil( ( dom + dow of `1/month` ) / 7 ) - minDaysStuff ? 1 : 0. + ret = dateDayOfWeek( dateStartOf( date, "month" ), properties.firstDay ); + ret = Math.ceil( ( date.getDate() + ret ) / 7 ) - + ( 7 - ret >= properties.minDays ? 0 : 1 ); + break; + + // Day + case "d": + ret = date.getDate(); + break; + + case "D": + ret = dateDayOfYear( date ) + 1; + break; + + case "F": + + // Day of Week in month. eg. 2nd Wed in July. + ret = Math.floor( date.getDate() / 7 ) + 1; + break; + + // Week day + case "e": + case "c": + if ( length <= 2 ) { + + // Range is [1-7] (deduced by example provided on documentation) + // TODO Should pad with zeros (not specified in the docs)? + ret = dateDayOfWeek( date, properties.firstDay ) + 1; + break; + } + + /* falls through */ + case "E": + ret = dateWeekDays[ date.getDay() ]; + ret = properties.days[ chr ][ length ][ ret ]; + break; + + // Period (AM or PM) + case "a": + ret = properties.dayPeriods[ date.getHours() < 12 ? "am" : "pm" ]; + break; + + // Hour + case "h": // 1-12 + ret = ( date.getHours() % 12 ) || 12; + break; + + case "H": // 0-23 + ret = date.getHours(); + break; + + case "K": // 0-11 + ret = date.getHours() % 12; + break; + + case "k": // 1-24 + ret = date.getHours() || 24; + break; + + // Minute + case "m": + ret = date.getMinutes(); + break; + + // Second + case "s": + ret = date.getSeconds(); + break; + + case "S": + ret = Math.round( date.getMilliseconds() * Math.pow( 10, length - 3 ) ); + break; + + case "A": + ret = Math.round( dateMillisecondsInDay( date ) * Math.pow( 10, length - 3 ) ); + break; + + // Zone + case "z": + case "O": + + // O: "{gmtFormat}+H;{gmtFormat}-H" or "{gmtZeroFormat}", eg. "GMT-8" or "GMT". + // OOOO: "{gmtFormat}{hourFormat}" or "{gmtZeroFormat}", eg. "GMT-08:00" or "GMT". + if ( date.getTimezoneOffset() === 0 ) { + ret = properties.gmtZeroFormat; + } else { + ret = dateTimezoneHourFormat( + date, + length < 4 ? "+H;-H" : properties.tzLongHourFormat, + timeSeparator, + numberFormatters + ); + ret = properties.gmtFormat.replace( /\{0\}/, ret ); + } + break; + + case "X": + + // Same as x*, except it uses "Z" for zero offset. + if ( date.getTimezoneOffset() === 0 ) { + ret = "Z"; + break; + } + + /* falls through */ + case "x": + + // x: hourFormat("+HH;-HH") + // xx or xxxx: hourFormat("+HHmm;-HHmm") + // xxx or xxxxx: hourFormat("+HH:mm;-HH:mm") + ret = length === 1 ? "+HH;-HH" : ( length % 2 ? "+HH:mm;-HH:mm" : "+HHmm;-HHmm" ); + ret = dateTimezoneHourFormat( date, ret, ":" ); + break; + + // timeSeparator + case ":": + ret = timeSeparator; + break; + + // ' literals. + case "'": + current = current.replace( /''/, "'" ); + if ( length > 2 ) { + current = current.slice( 1, -1 ); + } + ret = current; + break; + + // Anything else is considered a literal, including [ ,:/.@#], chinese, japonese, and + // arabic characters. + default: + ret = current; + } + if ( typeof ret === "number" ) { + ret = numberFormatters[ length ]( ret ); + } + return ret; + }); +}; + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/src/date/formatter-fn.js b/StockManMVC/.bin/bower_components/globalize/src/date/formatter-fn.js new file mode 100644 index 0000000..7076422 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/date/formatter-fn.js @@ -0,0 +1,17 @@ +define([ + "../common/validate/parameter-presence", + "../common/validate/parameter-type/date", + "./format" +], function( validateParameterPresence, validateParameterTypeDate, dateFormat ) { + +return function( numberFormatters, properties ) { + return function dateFormatter( value ) { + validateParameterPresence( value, "value" ); + validateParameterTypeDate( value, "value" ); + + return dateFormat( value, numberFormatters, properties ); + }; + +}; + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/src/date/is-leap-year.js b/StockManMVC/.bin/bower_components/globalize/src/date/is-leap-year.js new file mode 100644 index 0000000..86ee8be --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/date/is-leap-year.js @@ -0,0 +1,14 @@ +define(function() { + +/** + * isLeapYear( year ) + * + * @year [Number] + * + * Returns an indication whether the specified year is a leap year. + */ +return function( year ) { + return new Date( year, 1, 29 ).getMonth() === 1; +}; + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/src/date/last-day-of-month.js b/StockManMVC/.bin/bower_components/globalize/src/date/last-day-of-month.js new file mode 100644 index 0000000..c5208b7 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/date/last-day-of-month.js @@ -0,0 +1,14 @@ +define(function() { + +/** + * lastDayOfMonth( date ) + * + * @date [Date] + * + * Return the last day of the given date's month + */ +return function( date ) { + return new Date( date.getFullYear(), date.getMonth() + 1, 0 ).getDate(); +}; + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/src/date/milliseconds-in-day.js b/StockManMVC/.bin/bower_components/globalize/src/date/milliseconds-in-day.js new file mode 100644 index 0000000..99d60e7 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/date/milliseconds-in-day.js @@ -0,0 +1,14 @@ +define([ + "./start-of" +], function( dateStartOf ) { + +/** + * millisecondsInDay + */ +return function( date ) { + + // TODO Handle daylight savings discontinuities + return date - dateStartOf( date, "day" ); +}; + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/src/date/parse-properties.js b/StockManMVC/.bin/bower_components/globalize/src/date/parse-properties.js new file mode 100644 index 0000000..a5db8d6 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/date/parse-properties.js @@ -0,0 +1,16 @@ +define(function() { + +/** + * parseProperties( cldr ) + * + * @cldr [Cldr instance]. + * + * Return parser properties. + */ +return function( cldr ) { + return { + preferredTimeData: cldr.supplemental.timeData.preferred() + }; +}; + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/src/date/parse.js b/StockManMVC/.bin/bower_components/globalize/src/date/parse.js new file mode 100644 index 0000000..64f61b3 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/date/parse.js @@ -0,0 +1,287 @@ +define([ + "./is-leap-year", + "./last-day-of-month", + "./pattern-re", + "./start-of", + "../common/create-error/unsupported-feature", + "../util/date/set-month", + "../util/out-of-range" +], function( dateIsLeapYear, dateLastDayOfMonth, datePatternRe, dateStartOf, + createErrorUnsupportedFeature, dateSetMonth, outOfRange ) { + +/** + * parse( value, tokens, properties ) + * + * @value [String] string date. + * + * @tokens [Object] tokens returned by date/tokenizer. + * + * @properties [Object] output returned by date/tokenizer-properties. + * + * ref: http://www.unicode.org/reports/tr35/tr35-dates.html#Date_Format_Patterns + */ +return function( value, tokens, properties ) { + var amPm, day, daysOfYear, month, era, hour, hour12, timezoneOffset, valid, + YEAR = 0, + MONTH = 1, + DAY = 2, + HOUR = 3, + MINUTE = 4, + SECOND = 5, + MILLISECONDS = 6, + date = new Date(), + truncateAt = [], + units = [ "year", "month", "day", "hour", "minute", "second", "milliseconds" ]; + + if ( !tokens.length ) { + return null; + } + + valid = tokens.every(function( token ) { + var century, chr, value, length; + + if ( token.type === "literal" ) { + + // continue + return true; + } + + chr = token.type.charAt( 0 ); + length = token.type.length; + + if ( chr === "j" ) { + + // Locale preferred hHKk. + // http://www.unicode.org/reports/tr35/tr35-dates.html#Time_Data + chr = properties.preferredTimeData; + } + + switch ( chr ) { + + // Era + case "G": + truncateAt.push( YEAR ); + era = +token.value; + break; + + // Year + case "y": + value = token.value; + if ( length === 2 ) { + if ( outOfRange( value, 0, 99 ) ) { + return false; + } + + // mimic dojo/date/locale: choose century to apply, according to a sliding + // window of 80 years before and 20 years after present year. + century = Math.floor( date.getFullYear() / 100 ) * 100; + value += century; + if ( value > date.getFullYear() + 20 ) { + value -= 100; + } + } + date.setFullYear( value ); + truncateAt.push( YEAR ); + break; + + case "Y": // Year in "Week of Year" + throw createErrorUnsupportedFeature({ + feature: "year pattern `" + chr + "`" + }); + + // Quarter (skip) + case "Q": + case "q": + break; + + // Month + case "M": + case "L": + if ( length <= 2 ) { + value = token.value; + } else { + value = +token.value; + } + if ( outOfRange( value, 1, 12 ) ) { + return false; + } + + // Setting the month later so that we have the correct year and can determine + // the correct last day of February in case of leap year. + month = value; + truncateAt.push( MONTH ); + break; + + // Week (skip) + case "w": // Week of Year. + case "W": // Week of Month. + break; + + // Day + case "d": + day = token.value; + truncateAt.push( DAY ); + break; + + case "D": + daysOfYear = token.value; + truncateAt.push( DAY ); + break; + + case "F": + + // Day of Week in month. eg. 2nd Wed in July. + // Skip + break; + + // Week day + case "e": + case "c": + case "E": + + // Skip. + // value = arrayIndexOf( dateWeekDays, token.value ); + break; + + // Period (AM or PM) + case "a": + amPm = token.value; + break; + + // Hour + case "h": // 1-12 + value = token.value; + if ( outOfRange( value, 1, 12 ) ) { + return false; + } + hour = hour12 = true; + date.setHours( value === 12 ? 0 : value ); + truncateAt.push( HOUR ); + break; + + case "K": // 0-11 + value = token.value; + if ( outOfRange( value, 0, 11 ) ) { + return false; + } + hour = hour12 = true; + date.setHours( value ); + truncateAt.push( HOUR ); + break; + + case "k": // 1-24 + value = token.value; + if ( outOfRange( value, 1, 24 ) ) { + return false; + } + hour = true; + date.setHours( value === 24 ? 0 : value ); + truncateAt.push( HOUR ); + break; + + case "H": // 0-23 + value = token.value; + if ( outOfRange( value, 0, 23 ) ) { + return false; + } + hour = true; + date.setHours( value ); + truncateAt.push( HOUR ); + break; + + // Minute + case "m": + value = token.value; + if ( outOfRange( value, 0, 59 ) ) { + return false; + } + date.setMinutes( value ); + truncateAt.push( MINUTE ); + break; + + // Second + case "s": + value = token.value; + if ( outOfRange( value, 0, 59 ) ) { + return false; + } + date.setSeconds( value ); + truncateAt.push( SECOND ); + break; + + case "A": + date.setHours( 0 ); + date.setMinutes( 0 ); + date.setSeconds( 0 ); + + /* falls through */ + case "S": + value = Math.round( token.value * Math.pow( 10, 3 - length ) ); + date.setMilliseconds( value ); + truncateAt.push( MILLISECONDS ); + break; + + // Zone + case "Z": + case "z": + case "O": + case "X": + case "x": + timezoneOffset = token.value - date.getTimezoneOffset(); + break; + } + + return true; + }); + + if ( !valid ) { + return null; + } + + // 12-hour format needs AM or PM, 24-hour format doesn't, ie. return null + // if amPm && !hour12 || !amPm && hour12. + if ( hour && !( !amPm ^ hour12 ) ) { + return null; + } + + if ( era === 0 ) { + + // 1 BC = year 0 + date.setFullYear( date.getFullYear() * -1 + 1 ); + } + + if ( month !== undefined ) { + dateSetMonth( date, month - 1 ); + } + + if ( day !== undefined ) { + if ( outOfRange( day, 1, dateLastDayOfMonth( date ) ) ) { + return null; + } + date.setDate( day ); + } else if ( daysOfYear !== undefined ) { + if ( outOfRange( daysOfYear, 1, dateIsLeapYear( date.getFullYear() ) ? 366 : 365 ) ) { + return null; + } + date.setMonth( 0 ); + date.setDate( daysOfYear ); + } + + if ( hour12 && amPm === "pm" ) { + date.setHours( date.getHours() + 12 ); + } + + if ( timezoneOffset ) { + date.setMinutes( date.getMinutes() + timezoneOffset ); + } + + // Truncate date at the most precise unit defined. Eg. + // If value is "12/31", and pattern is "MM/dd": + // => new Date( , 12, 31, 0, 0, 0, 0 ); + truncateAt = Math.max.apply( null, truncateAt ); + date = dateStartOf( date, units[ truncateAt ] ); + + return date; +}; + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/src/date/parser-fn.js b/StockManMVC/.bin/bower_components/globalize/src/date/parser-fn.js new file mode 100644 index 0000000..3619d3f --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/date/parser-fn.js @@ -0,0 +1,20 @@ +define([ + "../common/validate/parameter-presence", + "../common/validate/parameter-type/string", + "./parse", + "./tokenizer" +], function( validateParameterPresence, validateParameterTypeString, dateParse, dateTokenizer ) { + +return function( numberParser, parseProperties, tokenizerProperties ) { + return function dateParser( value ) { + var tokens; + + validateParameterPresence( value, "value" ); + validateParameterTypeString( value, "value" ); + + tokens = dateTokenizer( value, numberParser, tokenizerProperties ); + return dateParse( value, tokens, parseProperties ) || null; + }; +}; + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/src/date/pattern-re.js b/StockManMVC/.bin/bower_components/globalize/src/date/pattern-re.js new file mode 100644 index 0000000..0fe8638 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/date/pattern-re.js @@ -0,0 +1,5 @@ +define(function() { + +return ( /([a-z])\1*|'([^']|'')+'|''|./ig ); + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/src/date/start-of.js b/StockManMVC/.bin/bower_components/globalize/src/date/start-of.js new file mode 100644 index 0000000..16b5dce --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/date/start-of.js @@ -0,0 +1,36 @@ +define(function() { + +/** + * startOf changes the input to the beginning of the given unit. + * + * For example, starting at the start of a day, resets hours, minutes + * seconds and milliseconds to 0. Starting at the month does the same, but + * also sets the date to 1. + * + * Returns the modified date + */ +return function( date, unit ) { + date = new Date( date.getTime() ); + switch ( unit ) { + case "year": + date.setMonth( 0 ); + /* falls through */ + case "month": + date.setDate( 1 ); + /* falls through */ + case "day": + date.setHours( 0 ); + /* falls through */ + case "hour": + date.setMinutes( 0 ); + /* falls through */ + case "minute": + date.setSeconds( 0 ); + /* falls through */ + case "second": + date.setMilliseconds( 0 ); + } + return date; +}; + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/src/date/timezone-hour-format.js b/StockManMVC/.bin/bower_components/globalize/src/date/timezone-hour-format.js new file mode 100644 index 0000000..d47390b --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/date/timezone-hour-format.js @@ -0,0 +1,47 @@ +define([ + "../util/string/pad" +], function( stringPad ) { + +/** + * hourFormat( date, format, timeSeparator, formatNumber ) + * + * Return date's timezone offset according to the format passed. + * Eg for format when timezone offset is 180: + * - "+H;-H": -3 + * - "+HHmm;-HHmm": -0300 + * - "+HH:mm;-HH:mm": -03:00 + */ +return function( date, format, timeSeparator, formatNumber ) { + var absOffset, + offset = date.getTimezoneOffset(); + + absOffset = Math.abs( offset ); + formatNumber = formatNumber || { + 1: function( value ) { + return stringPad( value, 1 ); + }, + 2: function( value ) { + return stringPad( value, 2 ); + } + }; + + return format + + // Pick the correct sign side (+ or -). + .split( ";" )[ offset > 0 ? 1 : 0 ] + + // Localize time separator + .replace( ":", timeSeparator ) + + // Update hours offset. + .replace( /HH?/, function( match ) { + return formatNumber[ match.length ]( Math.floor( absOffset / 60 ) ); + }) + + // Update minutes offset and return. + .replace( /mm/, function() { + return formatNumber[ 2 ]( absOffset % 60 ); + }); +}; + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/src/date/tokenizer-properties.js b/StockManMVC/.bin/bower_components/globalize/src/date/tokenizer-properties.js new file mode 100644 index 0000000..556641c --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/date/tokenizer-properties.js @@ -0,0 +1,155 @@ +define([ + "./pattern-re", + "../common/create-error/unsupported-feature", + "../number/symbol" +], function( datePatternRe, createErrorUnsupportedFeature, numberSymbol ) { + +/** + * tokenizerProperties( pattern, cldr ) + * + * @pattern [String] raw pattern. + * + * @cldr [Cldr instance]. + * + * Return Object with data that will be used by tokenizer. + */ +return function( pattern, cldr ) { + var properties = { + pattern: pattern, + timeSeparator: numberSymbol( "timeSeparator", cldr ) + }, + widths = [ "abbreviated", "wide", "narrow" ]; + + function populateProperties( path, value ) { + + // The `dates` and `calendars` trim's purpose is to reduce properties' key size only. + properties[ path.replace( /^.*\/dates\//, "" ).replace( /calendars\//, "" ) ] = value; + } + + cldr.on( "get", populateProperties ); + + pattern.match( datePatternRe ).forEach(function( current ) { + var chr, length; + + chr = current.charAt( 0 ), + length = current.length; + + if ( chr === "Z" && length < 5 ) { + chr = "O"; + length = 4; + } + + switch ( chr ) { + + // Era + case "G": + cldr.main([ + "dates/calendars/gregorian/eras", + length <= 3 ? "eraAbbr" : ( length === 4 ? "eraNames" : "eraNarrow" ) + ]); + break; + + // Year + case "u": // Extended year. Need to be implemented. + case "U": // Cyclic year name. Need to be implemented. + throw createErrorUnsupportedFeature({ + feature: "year pattern `" + chr + "`" + }); + + // Quarter + case "Q": + case "q": + if ( length > 2 ) { + cldr.main([ + "dates/calendars/gregorian/quarters", + chr === "Q" ? "format" : "stand-alone", + widths[ length - 3 ] + ]); + } + break; + + // Month + case "M": + case "L": + + // number l=1:{1,2}, l=2:{2}. + // lookup l=3... + if ( length > 2 ) { + cldr.main([ + "dates/calendars/gregorian/months", + chr === "M" ? "format" : "stand-alone", + widths[ length - 3 ] + ]); + } + break; + + // Day + case "g": + + // Modified Julian day. Need to be implemented. + throw createErrorUnsupportedFeature({ + feature: "Julian day pattern `g`" + }); + + // Week day + case "e": + case "c": + + // lookup for length >=3. + if ( length <= 2 ) { + break; + } + + /* falls through */ + case "E": + if ( length === 6 ) { + + // Note: if short day names are not explicitly specified, abbreviated day + // names are used instead http://www.unicode.org/reports/tr35/tr35-dates.html#months_days_quarters_eras + cldr.main([ + "dates/calendars/gregorian/days", + [ chr === "c" ? "stand-alone" : "format" ], + "short" + ]) || cldr.main([ + "dates/calendars/gregorian/days", + [ chr === "c" ? "stand-alone" : "format" ], + "abbreviated" + ]); + } else { + cldr.main([ + "dates/calendars/gregorian/days", + [ chr === "c" ? "stand-alone" : "format" ], + widths[ length < 3 ? 0 : length - 3 ] + ]); + } + break; + + // Period (AM or PM) + case "a": + cldr.main([ + "dates/calendars/gregorian/dayPeriods/format/wide" + ]); + break; + + // Zone + case "z": + case "O": + cldr.main( "dates/timeZoneNames/gmtFormat" ); + cldr.main( "dates/timeZoneNames/gmtZeroFormat" ); + cldr.main( "dates/timeZoneNames/hourFormat" ); + break; + + case "v": + case "V": + throw createErrorUnsupportedFeature({ + feature: "timezone pattern `" + chr + "`" + }); + } + }); + + cldr.off( "get", populateProperties ); + + return properties; +}; + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/src/date/tokenizer.js b/StockManMVC/.bin/bower_components/globalize/src/date/tokenizer.js new file mode 100644 index 0000000..5cfc9a1 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/date/tokenizer.js @@ -0,0 +1,411 @@ +define([ + "./pattern-re", + "../util/regexp/escape", + "../util/regexp/n" +], function( datePatternRe, regexpEscape, regexpN ) { + +/** + * tokenizer( value, pattern, properties ) + * + * @value [String] string date. + * + * @properties [Object] output returned by date/tokenizer-properties. + * + * Returns an Array of tokens, eg. value "5 o'clock PM", pattern "h 'o''clock' a": + * [{ + * type: "h", + * lexeme: "5" + * }, { + * type: "literal", + * lexeme: " " + * }, { + * type: "literal", + * lexeme: "o'clock" + * }, { + * type: "literal", + * lexeme: " " + * }, { + * type: "a", + * lexeme: "PM", + * value: "pm" + * }] + * + * OBS: lexeme's are always String and may return invalid ranges depending of the token type. + * Eg. "99" for month number. + * + * Return an empty Array when not successfully parsed. + */ +return function( value, numberParser, properties ) { + var valid, + timeSeparator = properties.timeSeparator, + tokens = [], + widths = [ "abbreviated", "wide", "narrow" ]; + + valid = properties.pattern.match( datePatternRe ).every(function( current ) { + var chr, length, numeric, tokenRe, + token = {}; + + function hourFormatParse( tokenRe, numberParser ) { + var aux = value.match( tokenRe ); + numberParser = numberParser || function( value ) { + return +value; + }; + + if ( !aux ) { + return false; + } + + // hourFormat containing H only, e.g., `+H;-H` + if ( aux.length < 8 ) { + token.value = + ( aux[ 1 ] ? -numberParser( aux[ 1 ] ) : numberParser( aux[ 4 ] ) ) * 60; + + // hourFormat containing H and m, e.g., `+HHmm;-HHmm` + } else { + token.value = + ( aux[ 1 ] ? -numberParser( aux[ 1 ] ) : numberParser( aux[ 7 ] ) ) * 60 + + ( aux[ 1 ] ? -numberParser( aux[ 4 ] ) : numberParser( aux[ 10 ] ) ); + } + + return true; + } + + // Transform: + // - "+H;-H" -> /\+(\d\d?)|-(\d\d?)/ + // - "+HH;-HH" -> /\+(\d\d)|-(\d\d)/ + // - "+HHmm;-HHmm" -> /\+(\d\d)(\d\d)|-(\d\d)(\d\d)/ + // - "+HH:mm;-HH:mm" -> /\+(\d\d):(\d\d)|-(\d\d):(\d\d)/ + // + // If gmtFormat is GMT{0}, the regexp must fill {0} in each side, e.g.: + // - "+H;-H" -> /GMT\+(\d\d?)|GMT-(\d\d?)/ + function hourFormatRe( hourFormat, gmtFormat, timeSeparator ) { + var re; + + if ( !gmtFormat ) { + gmtFormat = "{0}"; + } + + re = hourFormat + .replace( "+", "\\+" ) + + // Unicode equivalent to (\\d\\d) + .replace( /HH|mm/g, "((" + regexpN.source + ")(" + regexpN.source + "))" ) + + // Unicode equivalent to (\\d\\d?) + .replace( /H|m/g, "((" + regexpN.source + ")(" + regexpN.source + ")?)" ); + + if ( timeSeparator ) { + re = re.replace( /:/g, timeSeparator ); + } + + re = re.split( ";" ).map(function( part ) { + return gmtFormat.replace( "{0}", part ); + }).join( "|" ); + + return new RegExp( re ); + } + + function oneDigitIfLengthOne() { + if ( length === 1 ) { + + // Unicode equivalent to /\d/ + numeric = true; + return tokenRe = regexpN; + } + } + + function oneOrTwoDigitsIfLengthOne() { + if ( length === 1 ) { + + // Unicode equivalent to /\d\d?/ + numeric = true; + return tokenRe = new RegExp( "(" + regexpN.source + ")(" + regexpN.source + ")?" ); + } + } + + function twoDigitsIfLengthTwo() { + if ( length === 2 ) { + + // Unicode equivalent to /\d\d/ + numeric = true; + return tokenRe = new RegExp( "(" + regexpN.source + ")(" + regexpN.source + ")" ); + } + } + + // Brute-force test every locale entry in an attempt to match the given value. + // Return the first found one (and set token accordingly), or null. + function lookup( path ) { + var i, re, + data = properties[ path.join( "/" ) ]; + + for ( i in data ) { + re = new RegExp( "^" + data[ i ] ); + if ( re.test( value ) ) { + token.value = i; + return tokenRe = new RegExp( data[ i ] ); + } + } + return null; + } + + token.type = current; + chr = current.charAt( 0 ), + length = current.length; + + if ( chr === "Z" ) { + + // Z..ZZZ: same as "xxxx". + if ( length < 4 ) { + chr = "x"; + length = 4; + + // ZZZZ: same as "OOOO". + } else if ( length < 5 ) { + chr = "O"; + length = 4; + + // ZZZZZ: same as "XXXXX" + } else { + chr = "X"; + length = 5; + } + } + + switch ( chr ) { + + // Era + case "G": + lookup([ + "gregorian/eras", + length <= 3 ? "eraAbbr" : ( length === 4 ? "eraNames" : "eraNarrow" ) + ]); + break; + + // Year + case "y": + case "Y": + numeric = true; + + // number l=1:+, l=2:{2}, l=3:{3,}, l=4:{4,}, ... + if ( length === 1 ) { + + // Unicode equivalent to /\d+/. + tokenRe = new RegExp( "(" + regexpN.source + ")+" ); + } else if ( length === 2 ) { + + // Unicode equivalent to /\d\d/ + tokenRe = new RegExp( "(" + regexpN.source + ")(" + regexpN.source + ")" ); + } else { + + // Unicode equivalent to /\d{length,}/ + tokenRe = new RegExp( "(" + regexpN.source + "){" + length + ",}" ); + } + break; + + // Quarter + case "Q": + case "q": + + // number l=1:{1}, l=2:{2}. + // lookup l=3... + oneDigitIfLengthOne() || twoDigitsIfLengthTwo() || lookup([ + "gregorian/quarters", + chr === "Q" ? "format" : "stand-alone", + widths[ length - 3 ] + ]); + break; + + // Month + case "M": + case "L": + + // number l=1:{1,2}, l=2:{2}. + // lookup l=3... + oneOrTwoDigitsIfLengthOne() || twoDigitsIfLengthTwo() || lookup([ + "gregorian/months", + chr === "M" ? "format" : "stand-alone", + widths[ length - 3 ] + ]); + break; + + // Day + case "D": + + // number {l,3}. + if ( length <= 3 ) { + + // Unicode equivalent to /\d{length,3}/ + numeric = true; + tokenRe = new RegExp( "(" + regexpN.source + "){" + length + ",3}" ); + } + break; + + case "W": + case "F": + + // number l=1:{1}. + oneDigitIfLengthOne(); + break; + + // Week day + case "e": + case "c": + + // number l=1:{1}, l=2:{2}. + // lookup for length >=3. + if ( length <= 2 ) { + oneDigitIfLengthOne() || twoDigitsIfLengthTwo(); + break; + } + + /* falls through */ + case "E": + if ( length === 6 ) { + + // Note: if short day names are not explicitly specified, abbreviated day + // names are used instead http://www.unicode.org/reports/tr35/tr35-dates.html#months_days_quarters_eras + lookup([ + "gregorian/days", + [ chr === "c" ? "stand-alone" : "format" ], + "short" + ]) || lookup([ + "gregorian/days", + [ chr === "c" ? "stand-alone" : "format" ], + "abbreviated" + ]); + } else { + lookup([ + "gregorian/days", + [ chr === "c" ? "stand-alone" : "format" ], + widths[ length < 3 ? 0 : length - 3 ] + ]); + } + break; + + // Period (AM or PM) + case "a": + lookup([ + "gregorian/dayPeriods/format/wide" + ]); + break; + + // Week, Day, Hour, Minute, or Second + case "w": + case "d": + case "h": + case "H": + case "K": + case "k": + case "j": + case "m": + case "s": + + // number l1:{1,2}, l2:{2}. + oneOrTwoDigitsIfLengthOne() || twoDigitsIfLengthTwo(); + break; + + case "S": + + // number {l}. + + // Unicode equivalent to /\d{length}/ + numeric = true; + tokenRe = new RegExp( "(" + regexpN.source + "){" + length + "}" ); + break; + + case "A": + + // number {l+5}. + + // Unicode equivalent to /\d{length+5}/ + numeric = true; + tokenRe = new RegExp( "(" + regexpN.source + "){" + ( length + 5 ) + "}" ); + break; + + // Zone + case "z": + case "O": + + // O: "{gmtFormat}+H;{gmtFormat}-H" or "{gmtZeroFormat}", eg. "GMT-8" or "GMT". + // OOOO: "{gmtFormat}{hourFormat}" or "{gmtZeroFormat}", eg. "GMT-08:00" or "GMT". + if ( value === properties[ "timeZoneNames/gmtZeroFormat" ] ) { + token.value = 0; + tokenRe = new RegExp( properties[ "timeZoneNames/gmtZeroFormat" ] ); + } else { + tokenRe = hourFormatRe( + length < 4 ? "+H;-H" : properties[ "timeZoneNames/hourFormat" ], + properties[ "timeZoneNames/gmtFormat" ], + timeSeparator + ); + if ( !hourFormatParse( tokenRe, numberParser ) ) { + return null; + } + } + break; + + case "X": + + // Same as x*, except it uses "Z" for zero offset. + if ( value === "Z" ) { + token.value = 0; + tokenRe = /Z/; + break; + } + + /* falls through */ + case "x": + + // x: hourFormat("+HH;-HH") + // xx or xxxx: hourFormat("+HHmm;-HHmm") + // xxx or xxxxx: hourFormat("+HH:mm;-HH:mm") + tokenRe = hourFormatRe( + length === 1 ? "+HH;-HH" : ( length % 2 ? "+HH:mm;-HH:mm" : "+HHmm;-HHmm" ) + ); + if ( !hourFormatParse( tokenRe ) ) { + return null; + } + break; + + case "'": + token.type = "literal"; + current = current.replace( /''/, "'" ); + if ( length > 2 ) { + current = current.slice( 1, -1 ); + } + tokenRe = new RegExp( regexpEscape( current ) ); + break; + + default: + token.type = "literal"; + tokenRe = /./; + } + + if ( !tokenRe ) { + return false; + } + + // Get lexeme and consume it. + value = value.replace( new RegExp( "^" + tokenRe.source ), function( lexeme ) { + token.lexeme = lexeme; + if ( numeric ) { + token.value = numberParser( lexeme ); + } + return ""; + }); + + if ( !token.lexeme ) { + return false; + } + + tokens.push( token ); + return true; + }); + + if ( value !== "" ) { + valid = false; + } + + return valid ? tokens : []; +}; + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/src/date/week-days.js b/StockManMVC/.bin/bower_components/globalize/src/date/week-days.js new file mode 100644 index 0000000..2e0d4db --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/date/week-days.js @@ -0,0 +1,5 @@ +define(function() { + +return [ "sun", "mon", "tue", "wed", "thu", "fri", "sat" ]; + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/src/message-runtime.js b/StockManMVC/.bin/bower_components/globalize/src/message-runtime.js new file mode 100644 index 0000000..6880351 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/message-runtime.js @@ -0,0 +1,26 @@ +define([ + "./common/runtime-key", + "./common/validate/parameter-type/message-variables", + "./core-runtime", + "./message/formatter-fn" +], function( runtimeKey, validateParameterTypeMessageVariables, Globalize, messageFormatterFn ) { + +Globalize._messageFormatterFn = messageFormatterFn; +Globalize._messageFormat = {}; +Globalize._validateParameterTypeMessageVariables = validateParameterTypeMessageVariables; + +Globalize.messageFormatter = +Globalize.prototype.messageFormatter = function( /* path */ ) { + return Globalize[ + runtimeKey( "messageFormatter", this._locale, [].slice.call( arguments, 0 ) ) + ]; +}; + +Globalize.formatMessage = +Globalize.prototype.formatMessage = function( path /* , variables */ ) { + return this.messageFormatter( path ).apply( {}, [].slice.call( arguments, 1 ) ); +}; + +return Globalize; + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/src/message.js b/StockManMVC/.bin/bower_components/globalize/src/message.js new file mode 100644 index 0000000..b5c4e46 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/message.js @@ -0,0 +1,116 @@ +define([ + "cldr", + "messageformat", + "./common/create-error", + "./common/create-error/plural-module-presence", + "./common/runtime-bind", + "./common/validate/default-locale", + "./common/validate/message-bundle", + "./common/validate/message-presence", + "./common/validate/message-type", + "./common/validate/parameter-presence", + "./common/validate/parameter-type", + "./common/validate/parameter-type/plain-object", + "./core", + "./message/formatter-fn", + "./message/formatter-runtime-bind", + "./util/always-array", + + "cldr/event" +], function( Cldr, MessageFormat, createError, createErrorPluralModulePresence, runtimeBind, + validateDefaultLocale, validateMessageBundle, validateMessagePresence, validateMessageType, + validateParameterPresence, validateParameterType, validateParameterTypePlainObject, Globalize, + messageFormatterFn, messageFormatterRuntimeBind, alwaysArray ) { + +var slice = [].slice; + +/** + * .loadMessages( json ) + * + * @json [JSON] + * + * Load translation data. + */ +Globalize.loadMessages = function( json ) { + var locale, + customData = { + "globalize-messages": json, + "main": {} + }; + + validateParameterPresence( json, "json" ); + validateParameterTypePlainObject( json, "json" ); + + // Set available bundles by populating customData main dataset. + for ( locale in json ) { + if ( json.hasOwnProperty( locale ) ) { + customData.main[ locale ] = {}; + } + } + + Cldr.load( customData ); +}; + +/** + * .messageFormatter( path ) + * + * @path [String or Array] + * + * Format a message given its path. + */ +Globalize.messageFormatter = +Globalize.prototype.messageFormatter = function( path ) { + var cldr, formatter, message, pluralGenerator, returnFn, + args = slice.call( arguments, 0 ); + + validateParameterPresence( path, "path" ); + validateParameterType( path, "path", typeof path === "string" || Array.isArray( path ), + "a String nor an Array" ); + + path = alwaysArray( path ); + cldr = this.cldr; + + validateDefaultLocale( cldr ); + validateMessageBundle( cldr ); + + message = cldr.get( [ "globalize-messages/{bundle}" ].concat( path ) ); + validateMessagePresence( path, message ); + + // If message is an Array, concatenate it. + if ( Array.isArray( message ) ) { + message = message.join( " " ); + } + validateMessageType( path, message ); + + // Is plural module present? Yes, use its generator. Nope, use an error generator. + pluralGenerator = this.plural !== undefined ? + this.pluralGenerator() : + createErrorPluralModulePresence; + + formatter = new MessageFormat( cldr.locale, pluralGenerator ).compile( message ); + + returnFn = messageFormatterFn( formatter ); + + runtimeBind( args, cldr, returnFn, + [ messageFormatterRuntimeBind( cldr, formatter ), pluralGenerator ] ); + + return returnFn; +}; + +/** + * .formatMessage( path [, variables] ) + * + * @path [String or Array] + * + * @variables [Number, String, Array or Object] + * + * Format a message given its path. + */ +Globalize.formatMessage = +Globalize.prototype.formatMessage = function( path /* , variables */ ) { + return this.messageFormatter( path ).apply( {}, slice.call( arguments, 1 ) ); +}; + +return Globalize; + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/src/message/formatter-fn.js b/StockManMVC/.bin/bower_components/globalize/src/message/formatter-fn.js new file mode 100644 index 0000000..720f481 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/message/formatter-fn.js @@ -0,0 +1,15 @@ +define([ + "../common/validate/parameter-type/message-variables" +], function( validateParameterTypeMessageVariables ) { + +return function( formatter ) { + return function messageFormatter( variables ) { + if ( typeof variables === "number" || typeof variables === "string" ) { + variables = [].slice.call( arguments, 0 ); + } + validateParameterTypeMessageVariables( variables, "variables" ); + return formatter( variables ); + }; +}; + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/src/message/formatter-runtime-bind.js b/StockManMVC/.bin/bower_components/globalize/src/message/formatter-runtime-bind.js new file mode 100644 index 0000000..c2b285d --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/message/formatter-runtime-bind.js @@ -0,0 +1,46 @@ +define(function() { + +return function( cldr, messageformatter ) { + var locale = cldr.locale, + origToString = messageformatter.toString; + + messageformatter.toString = function() { + var argNames, argValues, output, + args = {}; + + // Properly adjust SlexAxton/messageformat.js compiled variables with Globalize variables: + output = origToString.call( messageformatter ); + + if ( /number\(/.test( output ) ) { + args.number = "messageFormat.number"; + } + + if ( /plural\(/.test( output ) ) { + args.plural = "messageFormat.plural"; + } + + if ( /select\(/.test( output ) ) { + args.select = "messageFormat.select"; + } + + output.replace( /pluralFuncs(\[([^\]]+)\]|\.([a-zA-Z]+))/, function( match ) { + args.pluralFuncs = "{" + + "\"" + locale + "\": Globalize(\"" + locale + "\").pluralGenerator()" + + "}"; + return match; + }); + + argNames = Object.keys( args ).join( ", " ); + argValues = Object.keys( args ).map(function( key ) { + return args[ key ]; + }).join( ", " ); + + return "(function( " + argNames + " ) {\n" + + " return " + output + "\n" + + "})(" + argValues + ")"; + }; + + return messageformatter; +}; + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/src/number-runtime.js b/StockManMVC/.bin/bower_components/globalize/src/number-runtime.js new file mode 100644 index 0000000..b57109b --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/number-runtime.js @@ -0,0 +1,57 @@ +define([ + "./common/runtime-key", + "./common/create-error/unsupported-feature", + "./common/validate/parameter-presence", + "./common/validate/parameter-type/number", + "./common/validate/parameter-type/string", + "./core-runtime", + "./number/format", + "./number/formatter-fn", + "./number/parse", + "./number/parser-fn", + "./util/number/round" +], function( runtimeKey, createErrorUnsupportedFeature, validateParameterPresence, + validateParameterTypeNumber, validateParameterTypeString, Globalize, numberFormat, + numberFormatterFn, numberParse, numberParserFn, numberRound ) { + +Globalize._createErrorUnsupportedFeature = createErrorUnsupportedFeature; +Globalize._numberFormat = numberFormat; +Globalize._numberFormatterFn = numberFormatterFn; +Globalize._numberParse = numberParse; +Globalize._numberParserFn = numberParserFn; +Globalize._numberRound = numberRound; +Globalize._validateParameterPresence = validateParameterPresence; +Globalize._validateParameterTypeNumber = validateParameterTypeNumber; +Globalize._validateParameterTypeString = validateParameterTypeString; + +Globalize.numberFormatter = +Globalize.prototype.numberFormatter = function( options ) { + options = options || {}; + return Globalize[ runtimeKey( "numberFormatter", this._locale, [ options ] ) ]; +}; + +Globalize.numberParser = +Globalize.prototype.numberParser = function( options ) { + options = options || {}; + return Globalize[ runtimeKey( "numberParser", this._locale, [ options ] ) ]; +}; + +Globalize.formatNumber = +Globalize.prototype.formatNumber = function( value, options ) { + validateParameterPresence( value, "value" ); + validateParameterTypeNumber( value, "value" ); + + return this.numberFormatter( options )( value ); +}; + +Globalize.parseNumber = +Globalize.prototype.parseNumber = function( value, options ) { + validateParameterPresence( value, "value" ); + validateParameterTypeString( value, "value" ); + + return this.numberParser( options )( value ); +}; + +return Globalize; + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/src/number.js b/StockManMVC/.bin/bower_components/globalize/src/number.js new file mode 100644 index 0000000..40b009a --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/number.js @@ -0,0 +1,186 @@ +define([ + "./core", + "./common/create-error/unsupported-feature", + "./common/runtime-bind", + "./common/validate/cldr", + "./common/validate/default-locale", + "./common/validate/parameter-presence", + "./common/validate/parameter-range", + "./common/validate/parameter-type/number", + "./common/validate/parameter-type/plain-object", + "./common/validate/parameter-type/string", + "./number/formatter-fn", + "./number/format-properties", + "./number/numbering-system", + "./number/parser-fn", + "./number/parse-properties", + "./number/pattern", + "./number/symbol", + "./util/string/pad", + + "cldr/event", + "cldr/supplemental" +], function( Globalize, createErrorUnsupportedFeature, runtimeBind, validateCldr, + validateDefaultLocale, validateParameterPresence, validateParameterRange, + validateParameterTypeNumber, validateParameterTypePlainObject, validateParameterTypeString, + numberFormatterFn, numberFormatProperties, numberNumberingSystem, numberParserFn, + numberParseProperties, numberPattern, numberSymbol, stringPad ) { + +function validateDigits( properties ) { + var minimumIntegerDigits = properties[ 2 ], + minimumFractionDigits = properties[ 3 ], + maximumFractionDigits = properties[ 4 ], + minimumSignificantDigits = properties[ 5 ], + maximumSignificantDigits = properties[ 6 ]; + + // Validate significant digit format properties + if ( !isNaN( minimumSignificantDigits * maximumSignificantDigits ) ) { + validateParameterRange( minimumSignificantDigits, "minimumSignificantDigits", 1, 21 ); + validateParameterRange( maximumSignificantDigits, "maximumSignificantDigits", + minimumSignificantDigits, 21 ); + + } else if ( !isNaN( minimumSignificantDigits ) || !isNaN( maximumSignificantDigits ) ) { + throw new Error( "Neither or both the minimum and maximum significant digits must be " + + "present" ); + + // Validate integer and fractional format + } else { + validateParameterRange( minimumIntegerDigits, "minimumIntegerDigits", 1, 21 ); + validateParameterRange( minimumFractionDigits, "minimumFractionDigits", 0, 20 ); + validateParameterRange( maximumFractionDigits, "maximumFractionDigits", + minimumFractionDigits, 20 ); + } +} + +/** + * .numberFormatter( [options] ) + * + * @options [Object]: + * - style: [String] "decimal" (default) or "percent". + * - see also number/format options. + * + * Return a function that formats a number according to the given options and default/instance + * locale. + */ +Globalize.numberFormatter = +Globalize.prototype.numberFormatter = function( options ) { + var args, cldr, pattern, properties, returnFn; + + validateParameterTypePlainObject( options, "options" ); + + options = options || {}; + cldr = this.cldr; + + args = [ options ]; + + validateDefaultLocale( cldr ); + + cldr.on( "get", validateCldr ); + + if ( options.raw ) { + pattern = options.raw; + } else { + pattern = numberPattern( options.style || "decimal", cldr ); + } + + properties = numberFormatProperties( pattern, cldr, options ); + + cldr.off( "get", validateCldr ); + + validateDigits( properties ); + + returnFn = numberFormatterFn( properties ); + + runtimeBind( args, cldr, returnFn, [ properties ] ); + + return returnFn; +}; + +/** + * .numberParser( [options] ) + * + * @options [Object]: + * - style: [String] "decimal" (default) or "percent". + * + * Return the number parser according to the default/instance locale. + */ +Globalize.numberParser = +Globalize.prototype.numberParser = function( options ) { + var args, cldr, pattern, properties, returnFn; + + validateParameterTypePlainObject( options, "options" ); + + options = options || {}; + cldr = this.cldr; + + args = [ options ]; + + validateDefaultLocale( cldr ); + + cldr.on( "get", validateCldr ); + + if ( options.raw ) { + pattern = options.raw; + } else { + pattern = numberPattern( options.style || "decimal", cldr ); + } + + properties = numberParseProperties( pattern, cldr ); + + cldr.off( "get", validateCldr ); + + returnFn = numberParserFn( properties ); + + runtimeBind( args, cldr, returnFn, [ properties ] ); + + return returnFn; +}; + +/** + * .formatNumber( value [, options] ) + * + * @value [Number] number to be formatted. + * + * @options [Object]: see number/format-properties. + * + * Format a number according to the given options and default/instance locale. + */ +Globalize.formatNumber = +Globalize.prototype.formatNumber = function( value, options ) { + validateParameterPresence( value, "value" ); + validateParameterTypeNumber( value, "value" ); + + return this.numberFormatter( options )( value ); +}; + +/** + * .parseNumber( value [, options] ) + * + * @value [String] + * + * @options [Object]: See numberParser(). + * + * Return the parsed Number (including Infinity) or NaN when value is invalid. + */ +Globalize.parseNumber = +Globalize.prototype.parseNumber = function( value, options ) { + validateParameterPresence( value, "value" ); + validateParameterTypeString( value, "value" ); + + return this.numberParser( options )( value ); +}; + +/** + * Optimization to avoid duplicating some internal functions across modules. + */ +Globalize._createErrorUnsupportedFeature = createErrorUnsupportedFeature; +Globalize._numberNumberingSystem = numberNumberingSystem; +Globalize._numberPattern = numberPattern; +Globalize._numberSymbol = numberSymbol; +Globalize._stringPad = stringPad; +Globalize._validateParameterTypeNumber = validateParameterTypeNumber; +Globalize._validateParameterTypeString = validateParameterTypeString; + +return Globalize; + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/src/number/format-properties.js b/StockManMVC/.bin/bower_components/globalize/src/number/format-properties.js new file mode 100644 index 0000000..f963669 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/number/format-properties.js @@ -0,0 +1,104 @@ +define([ + "./numbering-system-digits-map", + "./pattern-properties", + "./symbol", + "./symbol/map", + "./symbol/name", + "../util/number/round" +], function( numberNumberingSystemDigitsMap, numberPatternProperties, numberSymbol, numberSymbolMap, + numberSymbolName, numberRound ) { + +/** + * formatProperties( pattern, cldr [, options] ) + * + * @pattern [String] raw pattern for numbers. + * + * @cldr [Cldr instance]. + * + * @options [Object]: + * - minimumIntegerDigits [Number] + * - minimumFractionDigits, maximumFractionDigits [Number] + * - minimumSignificantDigits, maximumSignificantDigits [Number] + * - round [String] "ceil", "floor", "round" (default), or "truncate". + * - useGrouping [Boolean] default true. + * + * Return the processed properties that will be used in number/format. + * ref: http://www.unicode.org/reports/tr35/tr35-numbers.html + */ +return function( pattern, cldr, options ) { + var negativePattern, negativePrefix, negativeProperties, negativeSuffix, positivePattern, + roundFn, properties; + + function getOptions( attribute, propertyIndex ) { + if ( attribute in options ) { + properties[ propertyIndex ] = options[ attribute ]; + } + } + + options = options || {}; + pattern = pattern.split( ";" ); + + positivePattern = pattern[ 0 ]; + + negativePattern = pattern[ 1 ] || "-" + positivePattern; + negativeProperties = numberPatternProperties( negativePattern ); + negativePrefix = negativeProperties[ 0 ]; + negativeSuffix = negativeProperties[ 10 ]; + + // Have runtime code to refer to numberRound() instead of including it explicitly. + roundFn = numberRound( options.round ); + roundFn.generatorString = function() { + return "numberRound(" + ( options.round ? "\"" + options.round + "\"" : "" ) + ")"; + }; + + properties = numberPatternProperties( positivePattern ).concat([ + positivePattern, + negativePrefix + positivePattern + negativeSuffix, + negativePrefix, + negativeSuffix, + roundFn, + numberSymbol( "infinity", cldr ), + numberSymbol( "nan", cldr ), + numberSymbolMap( cldr ), + numberNumberingSystemDigitsMap( cldr ) + ]); + + getOptions( "minimumIntegerDigits", 2 ); + getOptions( "minimumFractionDigits", 3 ); + getOptions( "maximumFractionDigits", 4 ); + getOptions( "minimumSignificantDigits", 5 ); + getOptions( "maximumSignificantDigits", 6 ); + + // Grouping separators + if ( options.useGrouping === false ) { + properties[ 8 ] = null; + } + + // Normalize number of digits if only one of either minimumFractionDigits or + // maximumFractionDigits is passed in as an option + if ( "minimumFractionDigits" in options && !( "maximumFractionDigits" in options ) ) { + + // maximumFractionDigits = Math.max( minimumFractionDigits, maximumFractionDigits ); + properties[ 4 ] = Math.max( properties[ 3 ], properties[ 4 ] ); + } else if ( !( "minimumFractionDigits" in options ) && + "maximumFractionDigits" in options ) { + + // minimumFractionDigits = Math.min( minimumFractionDigits, maximumFractionDigits ); + properties[ 3 ] = Math.min( properties[ 3 ], properties[ 4 ] ); + } + + // Return: + // 0-10: see number/pattern-properties. + // 11: @positivePattern [String] Positive pattern. + // 12: @negativePattern [String] Negative pattern. + // 13: @negativePrefix [String] Negative prefix. + // 14: @negativeSuffix [String] Negative suffix. + // 15: @round [Function] Round function. + // 16: @infinitySymbol [String] Infinity symbol. + // 17: @nanSymbol [String] NaN symbol. + // 18: @symbolMap [Object] A bunch of other symbols. + // 19: @nuDigitsMap [Array] Digits map if numbering system is different than `latn`. + return properties; +}; + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/src/number/format.js b/StockManMVC/.bin/bower_components/globalize/src/number/format.js new file mode 100644 index 0000000..ac28511 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/number/format.js @@ -0,0 +1,127 @@ +define([ + "./format/grouping-separator", + "./format/integer-fraction-digits", + "./format/significant-digits" +], function( numberFormatGroupingSeparator, numberFormatIntegerFractionDigits, + numberFormatSignificantDigits ) { + +/** + * format( number, properties ) + * + * @number [Number]. + * + * @properties [Object] Output of number/format-properties. + * + * Return the formatted number. + * ref: http://www.unicode.org/reports/tr35/tr35-numbers.html + */ +return function( number, properties ) { + var infinitySymbol, maximumFractionDigits, maximumSignificantDigits, minimumFractionDigits, + minimumIntegerDigits, minimumSignificantDigits, nanSymbol, nuDigitsMap, padding, prefix, + primaryGroupingSize, pattern, ret, round, roundIncrement, secondaryGroupingSize, suffix, + symbolMap; + + padding = properties[ 1 ]; + minimumIntegerDigits = properties[ 2 ]; + minimumFractionDigits = properties[ 3 ]; + maximumFractionDigits = properties[ 4 ]; + minimumSignificantDigits = properties[ 5 ]; + maximumSignificantDigits = properties[ 6 ]; + roundIncrement = properties[ 7 ]; + primaryGroupingSize = properties[ 8 ]; + secondaryGroupingSize = properties[ 9 ]; + round = properties[ 15 ]; + infinitySymbol = properties[ 16 ]; + nanSymbol = properties[ 17 ]; + symbolMap = properties[ 18 ]; + nuDigitsMap = properties[ 19 ]; + + // NaN + if ( isNaN( number ) ) { + return nanSymbol; + } + + if ( number < 0 ) { + pattern = properties[ 12 ]; + prefix = properties[ 13 ]; + suffix = properties[ 14 ]; + } else { + pattern = properties[ 11 ]; + prefix = properties[ 0 ]; + suffix = properties[ 10 ]; + } + + // Infinity + if ( !isFinite( number ) ) { + return prefix + infinitySymbol + suffix; + } + + ret = prefix; + + // Percent + if ( pattern.indexOf( "%" ) !== -1 ) { + number *= 100; + + // Per mille + } else if ( pattern.indexOf( "\u2030" ) !== -1 ) { + number *= 1000; + } + + // Significant digit format + if ( !isNaN( minimumSignificantDigits * maximumSignificantDigits ) ) { + number = numberFormatSignificantDigits( number, minimumSignificantDigits, + maximumSignificantDigits, round ); + + // Integer and fractional format + } else { + number = numberFormatIntegerFractionDigits( number, minimumIntegerDigits, + minimumFractionDigits, maximumFractionDigits, round, roundIncrement ); + } + + // Remove the possible number minus sign + number = number.replace( /^-/, "" ); + + // Grouping separators + if ( primaryGroupingSize ) { + number = numberFormatGroupingSeparator( number, primaryGroupingSize, + secondaryGroupingSize ); + } + + ret += number; + + // Scientific notation + // TODO implement here + + // Padding/'([^']|'')+'|''|[.,\-+E%\u2030]/g + // TODO implement here + + ret += suffix; + + return ret.replace( /('([^']|'')+'|'')|./g, function( character, literal ) { + + // Literals + if ( literal ) { + literal = literal.replace( /''/, "'" ); + if ( literal.length > 2 ) { + literal = literal.slice( 1, -1 ); + } + return literal; + } + + // Symbols + character = character.replace( /[.,\-+E%\u2030]/, function( symbol ) { + return symbolMap[ symbol ]; + }); + + // Numbering system + if ( nuDigitsMap ) { + character = character.replace( /[0-9]/, function( digit ) { + return nuDigitsMap[ +digit ]; + }); + } + + return character; + }); +}; + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/src/number/format/grouping-separator.js b/StockManMVC/.bin/bower_components/globalize/src/number/format/grouping-separator.js new file mode 100644 index 0000000..0cb013a --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/number/format/grouping-separator.js @@ -0,0 +1,38 @@ +define(function() { + +/** + * goupingSeparator( number, primaryGroupingSize, secondaryGroupingSize ) + * + * @number [Number]. + * + * @primaryGroupingSize [Number] + * + * @secondaryGroupingSize [Number] + * + * Return the formatted number with group separator. + */ +return function( number, primaryGroupingSize, secondaryGroupingSize ) { + var index, + currentGroupingSize = primaryGroupingSize, + ret = "", + sep = ",", + switchToSecondary = secondaryGroupingSize ? true : false; + + number = String( number ).split( "." ); + index = number[ 0 ].length; + + while ( index > currentGroupingSize ) { + ret = number[ 0 ].slice( index - currentGroupingSize, index ) + + ( ret.length ? sep : "" ) + ret; + index -= currentGroupingSize; + if ( switchToSecondary ) { + currentGroupingSize = secondaryGroupingSize; + switchToSecondary = false; + } + } + + number[ 0 ] = number[ 0 ].slice( 0, index ) + ( ret.length ? sep : "" ) + ret; + return number.join( "." ); +}; + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/src/number/format/integer-fraction-digits.js b/StockManMVC/.bin/bower_components/globalize/src/number/format/integer-fraction-digits.js new file mode 100644 index 0000000..b188b26 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/number/format/integer-fraction-digits.js @@ -0,0 +1,60 @@ +define([ + "../../util/string/pad" +], function( stringPad ) { + +/** + * integerFractionDigits( number, minimumIntegerDigits, minimumFractionDigits, + * maximumFractionDigits, round, roundIncrement ) + * + * @number [Number] + * + * @minimumIntegerDigits [Number] + * + * @minimumFractionDigits [Number] + * + * @maximumFractionDigits [Number] + * + * @round [Function] + * + * @roundIncrement [Function] + * + * Return the formatted integer and fraction digits. + */ +return function( number, minimumIntegerDigits, minimumFractionDigits, maximumFractionDigits, round, + roundIncrement ) { + + // Fraction + if ( maximumFractionDigits ) { + + // Rounding + if ( roundIncrement ) { + number = round( number, roundIncrement ); + + // Maximum fraction digits + } else { + number = round( number, { exponent: -maximumFractionDigits } ); + } + + // Minimum fraction digits + if ( minimumFractionDigits ) { + number = String( number ).split( "." ); + number[ 1 ] = stringPad( number[ 1 ] || "", minimumFractionDigits, true ); + number = number.join( "." ); + } + } else { + number = round( number ); + } + + number = String( number ); + + // Minimum integer digits + if ( minimumIntegerDigits ) { + number = number.split( "." ); + number[ 0 ] = stringPad( number[ 0 ], minimumIntegerDigits ); + number = number.join( "." ); + } + + return number; +}; + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/src/number/format/significant-digits.js b/StockManMVC/.bin/bower_components/globalize/src/number/format/significant-digits.js new file mode 100644 index 0000000..343e238 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/number/format/significant-digits.js @@ -0,0 +1,53 @@ +define([ + "../../common/create-error/unsupported-feature", + "../../util/number/to-precision", + "../../util/string/pad" +], function( createErrorUnsupportedFeature, numberToPrecision, stringPad ) { + +/** + * toPrecision( number, minimumSignificantDigits, maximumSignificantDigits, round ) + * + * @number [Number] + * + * @minimumSignificantDigits [Number] + * + * @maximumSignificantDigits [Number] + * + * @round [Function] + * + * Return the formatted significant digits number. + */ +return function( number, minimumSignificantDigits, maximumSignificantDigits, round ) { + var atMinimum, atMaximum; + + // Sanity check. + if ( minimumSignificantDigits > maximumSignificantDigits ) { + maximumSignificantDigits = minimumSignificantDigits; + } + + atMinimum = numberToPrecision( number, minimumSignificantDigits, round ); + atMaximum = numberToPrecision( number, maximumSignificantDigits, round ); + + // Use atMaximum only if it has more significant digits than atMinimum. + number = +atMinimum === +atMaximum ? atMinimum : atMaximum; + + // Expand integer numbers, eg. 123e5 to 12300. + number = ( +number ).toString( 10 ); + + if ( ( /e/ ).test( number ) ) { + throw createErrorUnsupportedFeature({ + feature: "integers out of (1e21, 1e-7)" + }); + } + + // Add trailing zeros if necessary. + if ( minimumSignificantDigits - number.replace( /^0+|\./g, "" ).length > 0 ) { + number = number.split( "." ); + number[ 1 ] = stringPad( number[ 1 ] || "", minimumSignificantDigits - number[ 0 ].replace( /^0+/, "" ).length, true ); + number = number.join( "." ); + } + + return number; +}; + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/src/number/formatter-fn.js b/StockManMVC/.bin/bower_components/globalize/src/number/formatter-fn.js new file mode 100644 index 0000000..f4a61be --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/number/formatter-fn.js @@ -0,0 +1,16 @@ +define([ + "../common/validate/parameter-presence", + "../common/validate/parameter-type/number", + "./format" +], function( validateParameterPresence, validateParameterTypeNumber, numberFormat ) { + +return function( properties ) { + return function numberFormatter( value ) { + validateParameterPresence( value, "value" ); + validateParameterTypeNumber( value, "value" ); + + return numberFormat( value, properties ); + }; +}; + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/src/number/number-re.js b/StockManMVC/.bin/bower_components/globalize/src/number/number-re.js new file mode 100644 index 0000000..4dd703f --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/number/number-re.js @@ -0,0 +1,40 @@ +define(function() { + +/** + * EBNF representation: + * + * number_pattern_re = prefix_including_padding? + * number + * scientific_notation? + * suffix? + * + * number = integer_including_group_separator fraction_including_decimal_separator + * + * integer_including_group_separator = + * regexp([0-9,]*[0-9]+) + * + * fraction_including_decimal_separator = + * regexp((\.[0-9]+)?) + + * prefix_including_padding = non_number_stuff + * + * scientific_notation = regexp(E[+-]?[0-9]+) + * + * suffix = non_number_stuff + * + * non_number_stuff = regexp([^0-9]*) + * + * + * Regexp groups: + * + * 0: number_pattern_re + * 1: prefix + * 2: integer_including_group_separator fraction_including_decimal_separator + * 3: integer_including_group_separator + * 4: fraction_including_decimal_separator + * 5: scientific_notation + * 6: suffix + */ +return ( /^([^0-9]*)(([0-9,]*[0-9]+)(\.[0-9]+)?)(E[+-]?[0-9]+)?([^0-9]*)$/ ); + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/src/number/numbering-system-digits-map.js b/StockManMVC/.bin/bower_components/globalize/src/number/numbering-system-digits-map.js new file mode 100644 index 0000000..cfdd1ef --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/number/numbering-system-digits-map.js @@ -0,0 +1,30 @@ +define([ + "./numbering-system", + "../common/create-error/unsupported-feature" +], function( numberNumberingSystem, createErrorUnsupportedFeature ) { + +/** + * nuMap( cldr ) + * + * @cldr [Cldr instance]. + * + * Return digits map if numbering system is different than `latn`. + */ +return function( cldr ) { + var aux, + nu = numberNumberingSystem( cldr ); + + if ( nu === "latn" ) { + return; + } + + aux = cldr.supplemental([ "numberingSystems", nu ]); + + if ( aux._type !== "numeric" ) { + throw createErrorUnsupportedFeature( "`" + aux._type + "` numbering system" ); + } + + return aux._digits; +}; + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/src/number/numbering-system.js b/StockManMVC/.bin/bower_components/globalize/src/number/numbering-system.js new file mode 100644 index 0000000..020a3c2 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/number/numbering-system.js @@ -0,0 +1,32 @@ +define(function() { + +/** + * NumberingSystem( cldr ) + * + * - http://www.unicode.org/reports/tr35/tr35-numbers.html#otherNumberingSystems + * - http://cldr.unicode.org/index/bcp47-extension + * - http://www.unicode.org/reports/tr35/#u_Extension + */ +return function( cldr ) { + var nu = cldr.attributes[ "u-nu" ]; + + if ( nu ) { + if ( nu === "traditio" ) { + nu = "traditional"; + } + if ( [ "native", "traditional", "finance" ].indexOf( nu ) !== -1 ) { + + // Unicode locale extension `u-nu` is set using either (native, traditional or + // finance). So, lookup the respective locale's numberingSystem and return it. + return cldr.main([ "numbers/otherNumberingSystems", nu ]); + } + + // Unicode locale extension `u-nu` is set with an explicit numberingSystem. Return it. + return nu; + } + + // Return the default numberingSystem. + return cldr.main( "numbers/defaultNumberingSystem" ); +}; + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/src/number/parse-properties.js b/StockManMVC/.bin/bower_components/globalize/src/number/parse-properties.js new file mode 100644 index 0000000..91dd3d5 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/number/parse-properties.js @@ -0,0 +1,61 @@ +define([ + "./numbering-system-digits-map", + "./pattern-properties", + "./symbol", + "./symbol/inverted-map", + "./symbol/name", + "../util/object/extend" +], function( numberNumberingSystemDigitsMap, numberPatternProperties, numberSymbol, + numberSymbolInvertedMap, numberSymbolName, objectExtend ) { + +/** + * parseProperties( pattern, cldr ) + * + * @pattern [String] raw pattern for numbers. + * + * @cldr [Cldr instance]. + * + * Return parser properties, used to feed parser function. + */ +return function( pattern, cldr ) { + var invertedNuDigitsMap, invertedNuDigitsMapSanityCheck, negativePattern, negativeProperties, + nuDigitsMap = numberNumberingSystemDigitsMap( cldr ); + + pattern = pattern.split( ";" ); + negativePattern = pattern[ 1 ] || "-" + pattern[ 0 ]; + negativeProperties = numberPatternProperties( negativePattern ); + if ( nuDigitsMap ) { + invertedNuDigitsMap = nuDigitsMap.split( "" ).reduce(function( object, localizedDigit, i ) { + object[ localizedDigit ] = String( i ); + return object; + }, {} ); + invertedNuDigitsMapSanityCheck = "0123456789".split( "" ).reduce(function( object, digit ) { + object[ digit ] = "invalid"; + return object; + }, {} ); + invertedNuDigitsMap = objectExtend( + invertedNuDigitsMapSanityCheck, + invertedNuDigitsMap + ); + } + + // 0: @infinitySymbol [String] Infinity symbol. + // 1: @invertedSymbolMap [Object] Inverted symbol map augmented with sanity check. + // The sanity check prevents permissive parsing, i.e., it prevents symbols that doesn't + // belong to the localized set to pass through. This is obtained with the result of the + // inverted map object overloading symbol name map object (the remaining symbol name + // mappings will invalidate parsing, working as the sanity check). + // 2: @negativePrefix [String] Negative prefix. + // 3: @negativeSuffix [String] Negative suffix with percent or per mille stripped out. + // 4: @invertedNuDigitsMap [Object] Inverted digits map if numbering system is different than + // `latn` augmented with sanity check (similar to invertedSymbolMap). + return [ + numberSymbol( "infinity", cldr ), + objectExtend( {}, numberSymbolName, numberSymbolInvertedMap( cldr ) ), + negativeProperties[ 0 ], + negativeProperties[ 10 ].replace( "%", "" ).replace( "\u2030", "" ), + invertedNuDigitsMap + ]; +}; + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/src/number/parse.js b/StockManMVC/.bin/bower_components/globalize/src/number/parse.js new file mode 100644 index 0000000..4ab3202 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/number/parse.js @@ -0,0 +1,121 @@ +define([ + "./number-re", + "../util/regexp/escape" +], function( numberNumberRe, regexpEscape ) { + +/** + * parse( value, properties ) + * + * @value [String]. + * + * @properties [Object] Parser properties is a reduced pre-processed cldr + * data set returned by numberParserProperties(). + * + * Return the parsed Number (including Infinity) or NaN when value is invalid. + * ref: http://www.unicode.org/reports/tr35/tr35-numbers.html + */ +return function( value, properties ) { + var aux, infinitySymbol, invertedNuDigitsMap, invertedSymbolMap, localizedDigitRe, + localizedSymbolsRe, negativePrefix, negativeSuffix, number, prefix, suffix; + + infinitySymbol = properties[ 0 ]; + invertedSymbolMap = properties[ 1 ]; + negativePrefix = properties[ 2 ]; + negativeSuffix = properties[ 3 ]; + invertedNuDigitsMap = properties[ 4 ]; + + // Infinite number. + if ( aux = value.match( infinitySymbol ) ) { + + number = Infinity; + prefix = value.slice( 0, aux.length ); + suffix = value.slice( aux.length + 1 ); + + // Finite number. + } else { + + // TODO: Create it during setup, i.e., make it a property. + localizedSymbolsRe = new RegExp( + Object.keys( invertedSymbolMap ).map(function( localizedSymbol ) { + return regexpEscape( localizedSymbol ); + }).join( "|" ), + "g" + ); + + // Reverse localized symbols. + value = value.replace( localizedSymbolsRe, function( localizedSymbol ) { + return invertedSymbolMap[ localizedSymbol ]; + }); + + // Reverse localized numbering system. + if ( invertedNuDigitsMap ) { + + // TODO: Create it during setup, i.e., make it a property. + localizedDigitRe = new RegExp( + Object.keys( invertedNuDigitsMap ).map(function( localizedDigit ) { + return regexpEscape( localizedDigit ); + }).join( "|" ), + "g" + ); + value = value.replace( localizedDigitRe, function( localizedDigit ) { + return invertedNuDigitsMap[ localizedDigit ]; + }); + } + + // Add padding zero to leading decimal. + if ( value.charAt( 0 ) === "." ) { + value = "0" + value; + } + + // Is it a valid number? + value = value.match( numberNumberRe ); + if ( !value ) { + + // Invalid number. + return NaN; + } + + prefix = value[ 1 ]; + suffix = value[ 6 ]; + + // Remove grouping separators. + number = value[ 2 ].replace( /,/g, "" ); + + // Scientific notation + if ( value[ 5 ] ) { + number += value[ 5 ]; + } + + number = +number; + + // Is it a valid number? + if ( isNaN( number ) ) { + + // Invalid number. + return NaN; + } + + // Percent + if ( value[ 0 ].indexOf( "%" ) !== -1 ) { + number /= 100; + suffix = suffix.replace( "%", "" ); + + // Per mille + } else if ( value[ 0 ].indexOf( "\u2030" ) !== -1 ) { + number /= 1000; + suffix = suffix.replace( "\u2030", "" ); + } + } + + // Negative number + // "If there is an explicit negative subpattern, it serves only to specify the negative prefix + // and suffix. If there is no explicit negative subpattern, the negative subpattern is the + // localized minus sign prefixed to the positive subpattern" UTS#35 + if ( prefix === negativePrefix && suffix === negativeSuffix ) { + number *= -1; + } + + return number; +}; + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/src/number/parser-fn.js b/StockManMVC/.bin/bower_components/globalize/src/number/parser-fn.js new file mode 100644 index 0000000..c626e70 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/number/parser-fn.js @@ -0,0 +1,17 @@ +define([ + "../common/validate/parameter-presence", + "../common/validate/parameter-type/string", + "./parse" +], function( validateParameterPresence, validateParameterTypeString, numberParse ) { + +return function( properties ) { + return function numberParser( value ) { + validateParameterPresence( value, "value" ); + validateParameterTypeString( value, "value" ); + + return numberParse( value, properties ); + }; + +}; + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/src/number/pattern-properties.js b/StockManMVC/.bin/bower_components/globalize/src/number/pattern-properties.js new file mode 100644 index 0000000..ede4d2b --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/number/pattern-properties.js @@ -0,0 +1,133 @@ +define([ + "./pattern-re", + "../common/create-error/unsupported-feature" +], function( numberPatternRe, createErrorUnsupportedFeature ) { + +/** + * format( number, pattern ) + * + * @number [Number]. + * + * @pattern [String] raw pattern for numbers. + * + * Return the formatted number. + * ref: http://www.unicode.org/reports/tr35/tr35-numbers.html + */ +return function( pattern ) { + var aux1, aux2, fractionPattern, integerFractionOrSignificantPattern, integerPattern, + maximumFractionDigits, maximumSignificantDigits, minimumFractionDigits, + minimumIntegerDigits, minimumSignificantDigits, padding, prefix, primaryGroupingSize, + roundIncrement, scientificNotation, secondaryGroupingSize, significantPattern, suffix; + + pattern = pattern.match( numberPatternRe ); + if ( !pattern ) { + throw new Error( "Invalid pattern: " + pattern ); + } + + prefix = pattern[ 1 ]; + padding = pattern[ 3 ]; + integerFractionOrSignificantPattern = pattern[ 4 ]; + significantPattern = pattern[ 8 ]; + scientificNotation = pattern[ 9 ]; + suffix = pattern[ 10 ]; + + // Significant digit format + if ( significantPattern ) { + significantPattern.replace( /(@+)(#*)/, function( match, minimumSignificantDigitsMatch, maximumSignificantDigitsMatch ) { + minimumSignificantDigits = minimumSignificantDigitsMatch.length; + maximumSignificantDigits = minimumSignificantDigits + + maximumSignificantDigitsMatch.length; + }); + + // Integer and fractional format + } else { + fractionPattern = pattern[ 7 ]; + integerPattern = pattern[ 6 ]; + + if ( fractionPattern ) { + + // Minimum fraction digits, and rounding. + fractionPattern.replace( /[0-9]+/, function( match ) { + minimumFractionDigits = match; + }); + if ( minimumFractionDigits ) { + roundIncrement = +( "0." + minimumFractionDigits ); + minimumFractionDigits = minimumFractionDigits.length; + } else { + minimumFractionDigits = 0; + } + + // Maximum fraction digits + // 1: ignore decimal character + maximumFractionDigits = fractionPattern.length - 1 /* 1 */; + } + + // Minimum integer digits + integerPattern.replace( /0+$/, function( match ) { + minimumIntegerDigits = match.length; + }); + } + + // Scientific notation + if ( scientificNotation ) { + throw createErrorUnsupportedFeature({ + feature: "scientific notation (not implemented)" + }); + } + + // Padding + if ( padding ) { + throw createErrorUnsupportedFeature({ + feature: "padding (not implemented)" + }); + } + + // Grouping + if ( ( aux1 = integerFractionOrSignificantPattern.lastIndexOf( "," ) ) !== -1 ) { + + // Primary grouping size is the interval between the last group separator and the end of + // the integer (or the end of the significant pattern). + aux2 = integerFractionOrSignificantPattern.split( "." )[ 0 ]; + primaryGroupingSize = aux2.length - aux1 - 1; + + // Secondary grouping size is the interval between the last two group separators. + if ( ( aux2 = integerFractionOrSignificantPattern.lastIndexOf( ",", aux1 - 1 ) ) !== -1 ) { + secondaryGroupingSize = aux1 - 1 - aux2; + } + } + + // Return: + // 0: @prefix String + // 1: @padding Array [ , ] TODO + // 2: @minimumIntegerDigits non-negative integer Number value indicating the minimum integer + // digits to be used. Numbers will be padded with leading zeroes if necessary. + // 3: @minimumFractionDigits and + // 4: @maximumFractionDigits are non-negative integer Number values indicating the minimum and + // maximum fraction digits to be used. Numbers will be rounded or padded with trailing + // zeroes if necessary. + // 5: @minimumSignificantDigits and + // 6: @maximumSignificantDigits are positive integer Number values indicating the minimum and + // maximum fraction digits to be shown. Either none or both of these properties are + // present; if they are, they override minimum and maximum integer and fraction digits + // – the formatter uses however many integer and fraction digits are required to display + // the specified number of significant digits. + // 7: @roundIncrement Decimal round increment or null + // 8: @primaryGroupingSize + // 9: @secondaryGroupingSize + // 10: @suffix String + return [ + prefix, + padding, + minimumIntegerDigits, + minimumFractionDigits, + maximumFractionDigits, + minimumSignificantDigits, + maximumSignificantDigits, + roundIncrement, + primaryGroupingSize, + secondaryGroupingSize, + suffix + ]; +}; + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/src/number/pattern-re.js b/StockManMVC/.bin/bower_components/globalize/src/number/pattern-re.js new file mode 100644 index 0000000..92f21c8 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/number/pattern-re.js @@ -0,0 +1,49 @@ +define(function() { + +/** + * EBNF representation: + * + * number_pattern_re = prefix? + * padding? + * (integer_fraction_pattern | significant_pattern) + * scientific_notation? + * suffix? + * + * prefix = non_number_stuff + * + * padding = "*" regexp(.) + * + * integer_fraction_pattern = integer_pattern + * fraction_pattern? + * + * integer_pattern = regexp([#,]*[0,]*0+) + * + * fraction_pattern = "." regexp(0*[0-9]*#*) + * + * significant_pattern = regexp([#,]*@+#*) + * + * scientific_notation = regexp(E\+?0+) + * + * suffix = non_number_stuff + * + * non_number_stuff = regexp(('[^']+'|''|[^*#@0,.E])*) + * + * + * Regexp groups: + * + * 0: number_pattern_re + * 1: prefix + * 2: - + * 3: padding + * 4: (integer_fraction_pattern | significant_pattern) + * 5: integer_fraction_pattern + * 6: integer_pattern + * 7: fraction_pattern + * 8: significant_pattern + * 9: scientific_notation + * 10: suffix + * 11: - + */ +return ( /^(('[^']+'|''|[^*#@0,.E])*)(\*.)?((([#,]*[0,]*0+)(\.0*[0-9]*#*)?)|([#,]*@+#*))(E\+?0+)?(('[^']+'|''|[^*#@0,.E])*)$/ ); + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/src/number/pattern.js b/StockManMVC/.bin/bower_components/globalize/src/number/pattern.js new file mode 100644 index 0000000..fceb3e5 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/number/pattern.js @@ -0,0 +1,24 @@ +define([ + "./numbering-system" +], function( numberNumberingSystem ) { + +/** + * Pattern( style ) + * + * @style [String] "decimal" (default) or "percent". + * + * @cldr [Cldr instance]. + */ +return function( style, cldr ) { + if ( style !== "decimal" && style !== "percent" ) { + throw new Error( "Invalid style" ); + } + + return cldr.main([ + "numbers", + style + "Formats-numberSystem-" + numberNumberingSystem( cldr ), + "standard" + ]); +}; + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/src/number/symbol.js b/StockManMVC/.bin/bower_components/globalize/src/number/symbol.js new file mode 100644 index 0000000..431d95e --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/number/symbol.js @@ -0,0 +1,21 @@ +define([ + "./numbering-system" +], function( numberNumberingSystem ) { + +/** + * Symbol( name, cldr ) + * + * @name [String] Symbol name. + * + * @cldr [Cldr instance]. + * + * Return the localized symbol given its name. + */ +return function( name, cldr ) { + return cldr.main([ + "numbers/symbols-numberSystem-" + numberNumberingSystem( cldr ), + name + ]); +}; + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/src/number/symbol/inverted-map.js b/StockManMVC/.bin/bower_components/globalize/src/number/symbol/inverted-map.js new file mode 100644 index 0000000..76101ae --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/number/symbol/inverted-map.js @@ -0,0 +1,29 @@ +define([ + "./name", + "../symbol" +], function( numberSymbolName, numberSymbol ) { + +/** + * symbolMap( cldr ) + * + * @cldr [Cldr instance]. + * + * Return the (localized symbol, pattern symbol) key value pair, eg. { + * "٫": ".", + * "٬": ",", + * "٪": "%", + * ... + * }; + */ +return function( cldr ) { + var symbol, + symbolMap = {}; + + for ( symbol in numberSymbolName ) { + symbolMap[ numberSymbol( numberSymbolName[ symbol ], cldr ) ] = symbol; + } + + return symbolMap; +}; + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/src/number/symbol/map.js b/StockManMVC/.bin/bower_components/globalize/src/number/symbol/map.js new file mode 100644 index 0000000..4d94bd5 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/number/symbol/map.js @@ -0,0 +1,29 @@ +define([ + "./name", + "../symbol" +], function( numberSymbolName, numberSymbol ) { + +/** + * symbolMap( cldr ) + * + * @cldr [Cldr instance]. + * + * Return the (localized symbol, pattern symbol) key value pair, eg. { + * ".": "٫", + * ",": "٬", + * "%": "٪", + * ... + * }; + */ +return function( cldr ) { + var symbol, + symbolMap = {}; + + for ( symbol in numberSymbolName ) { + symbolMap[ symbol ] = numberSymbol( numberSymbolName[ symbol ], cldr ); + } + + return symbolMap; +}; + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/src/number/symbol/name.js b/StockManMVC/.bin/bower_components/globalize/src/number/symbol/name.js new file mode 100644 index 0000000..2efd2a2 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/number/symbol/name.js @@ -0,0 +1,13 @@ +define(function() { + +return { + ".": "decimal", + ",": "group", + "%": "percentSign", + "+": "plusSign", + "-": "minusSign", + "E": "exponential", + "\u2030": "perMille" +}; + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/src/plural-runtime.js b/StockManMVC/.bin/bower_components/globalize/src/plural-runtime.js new file mode 100644 index 0000000..849d95d --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/plural-runtime.js @@ -0,0 +1,28 @@ +define([ + "./common/runtime-key", + "./common/validate/parameter-presence", + "./common/validate/parameter-type/number", + "./core-runtime", + "./plural/generator-fn" +], function( runtimeKey, validateParameterPresence, validateParameterTypeNumber, Globalize, + pluralGeneratorFn ) { + +Globalize._pluralGeneratorFn = pluralGeneratorFn; +Globalize._validateParameterTypeNumber = validateParameterTypeNumber; + +Globalize.plural = +Globalize.prototype.plural = function( value, options ) { + validateParameterPresence( value, "value" ); + validateParameterTypeNumber( value, "value" ); + return this.pluralGenerator( options )( value ); +}; + +Globalize.pluralGenerator = +Globalize.prototype.pluralGenerator = function( options ) { + options = options || {}; + return Globalize[ runtimeKey( "pluralGenerator", this._locale, [ options ] ) ]; +}; + +return Globalize; + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/src/plural.js b/StockManMVC/.bin/bower_components/globalize/src/plural.js new file mode 100644 index 0000000..b978154 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/plural.js @@ -0,0 +1,88 @@ +define([ + "cldr", + "make-plural", + "./common/runtime-bind", + "./common/validate/cldr", + "./common/validate/default-locale", + "./common/validate/parameter-presence", + "./common/validate/parameter-type", + "./common/validate/parameter-type/number", + "./common/validate/parameter-type/plain-object", + "./common/validate/parameter-type/plural-type", + "./core", + "./plural/generator-fn", + + "cldr/event", + "cldr/supplemental" +], function( Cldr, MakePlural, runtimeBind, validateCldr, validateDefaultLocale, + validateParameterPresence, validateParameterType, validateParameterTypeNumber, + validateParameterTypePlainObject, validateParameterTypePluralType, Globalize, + pluralGeneratorFn ) { + +/** + * .plural( value ) + * + * @value [Number] + * + * Return the corresponding form (zero | one | two | few | many | other) of a + * value given locale. + */ +Globalize.plural = +Globalize.prototype.plural = function( value, options ) { + validateParameterPresence( value, "value" ); + validateParameterTypeNumber( value, "value" ); + return this.pluralGenerator( options )( value ); +}; + +/** + * .pluralGenerator( [options] ) + * + * Return a plural function (of the form below). + * + * fn( value ) + * + * @value [Number] + * + * Return the corresponding form (zero | one | two | few | many | other) of a value given the + * default/instance locale. + */ +Globalize.pluralGenerator = +Globalize.prototype.pluralGenerator = function( options ) { + var args, cldr, isOrdinal, plural, returnFn, type; + + validateParameterTypePlainObject( options, "options" ); + + options = options || {}; + cldr = this.cldr; + + args = [ options ]; + type = options.type || "cardinal"; + + validateParameterTypePluralType( options.type, "options.type" ); + + validateDefaultLocale( cldr ); + + isOrdinal = type === "ordinal"; + + cldr.on( "get", validateCldr ); + cldr.supplemental([ "plurals-type-" + type, "{language}" ]); + cldr.off( "get", validateCldr ); + + MakePlural.rules = {}; + MakePlural.rules[ type ] = cldr.supplemental( "plurals-type-" + type ); + + plural = new MakePlural( cldr.attributes.language, { + "ordinals": isOrdinal, + "cardinals": !isOrdinal + }); + + returnFn = pluralGeneratorFn( plural ); + + runtimeBind( args, cldr, returnFn, [ plural ] ); + + return returnFn; +}; + +return Globalize; + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/src/plural/generator-fn.js b/StockManMVC/.bin/bower_components/globalize/src/plural/generator-fn.js new file mode 100644 index 0000000..3c05239 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/plural/generator-fn.js @@ -0,0 +1,15 @@ +define([ + "../common/validate/parameter-presence", + "../common/validate/parameter-type/number" +], function( validateParameterPresence, validateParameterTypeNumber ) { + +return function( plural ) { + return function pluralGenerator( value ) { + validateParameterPresence( value, "value" ); + validateParameterTypeNumber( value, "value" ); + + return plural( value ); + }; +}; + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/src/relative-time-runtime.js b/StockManMVC/.bin/bower_components/globalize/src/relative-time-runtime.js new file mode 100644 index 0000000..eb4e25e --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/relative-time-runtime.js @@ -0,0 +1,31 @@ +define([ + "./common/runtime-key", + "./common/validate/parameter-presence", + "./common/validate/parameter-type/number", + "./core-runtime", + "./relative-time/formatter-fn", + + "./number-runtime", + "./plural-runtime" +], function( runtimeKey, validateParameterPresence, validateParameterTypeNumber, Globalize, + relativeTimeFormatterFn ) { + +Globalize._relativeTimeFormatterFn = relativeTimeFormatterFn; + +Globalize.formatRelativeTime = +Globalize.prototype.formatRelativeTime = function( value, unit, options ) { + validateParameterPresence( value, "value" ); + validateParameterTypeNumber( value, "value" ); + + return this.relativeTimeFormatter( unit, options )( value ); +}; + +Globalize.relativeTimeFormatter = +Globalize.prototype.relativeTimeFormatter = function( unit, options ) { + options = options || {}; + return Globalize[ runtimeKey( "relativeTimeFormatter", this._locale, [ unit, options ] ) ]; +}; + +return Globalize; + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/src/relative-time.js b/StockManMVC/.bin/bower_components/globalize/src/relative-time.js new file mode 100644 index 0000000..4c36886 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/relative-time.js @@ -0,0 +1,79 @@ +define([ + "./core", + "./common/runtime-bind", + "./common/validate/cldr", + "./common/validate/default-locale", + "./common/validate/parameter-presence", + "./common/validate/parameter-type/number", + "./common/validate/parameter-type/string", + "./relative-time/formatter-fn", + "./relative-time/properties", + + "./number", + "./plural", + "cldr/event" +], function( Globalize, runtimeBind, validateCldr, validateDefaultLocale, validateParameterPresence, + validateParameterTypeNumber, validateParameterTypeString, relativeTimeFormatterFn, + relativeTimeProperties ) { + +/** + * .formatRelativeTime( value, unit [, options] ) + * + * @value [Number] The number of unit to format. + * + * @unit [String] see .relativeTimeFormatter() for details. + * + * @options [Object] see .relativeTimeFormatter() for details. + * + * Formats a relative time according to the given unit, options, and the default/instance locale. + */ +Globalize.formatRelativeTime = +Globalize.prototype.formatRelativeTime = function( value, unit, options ) { + validateParameterPresence( value, "value" ); + validateParameterTypeNumber( value, "value" ); + + return this.relativeTimeFormatter( unit, options )( value ); +}; + +/** + * .relativeTimeFormatter( unit [, options ]) + * + * @unit [String] String value indicating the unit to be formatted. eg. "day", "week", "month", etc. + * + * @options [Object] + * - form: [String] eg. "short" or "narrow". Or falsy for default long form. + * + * Returns a function that formats a relative time according to the given unit, options, and the + * default/instance locale. + */ +Globalize.relativeTimeFormatter = +Globalize.prototype.relativeTimeFormatter = function( unit, options ) { + var args, cldr, numberFormatter, pluralGenerator, properties, returnFn; + + validateParameterPresence( unit, "unit" ); + validateParameterTypeString( unit, "unit" ); + + cldr = this.cldr; + options = options || {}; + + args = [ unit, options ]; + + validateDefaultLocale( cldr ); + + cldr.on( "get", validateCldr ); + properties = relativeTimeProperties( unit, cldr, options ); + cldr.off( "get", validateCldr ); + + numberFormatter = this.numberFormatter( options ); + pluralGenerator = this.pluralGenerator(); + + returnFn = relativeTimeFormatterFn( numberFormatter, pluralGenerator, properties ); + + runtimeBind( args, cldr, returnFn, [ numberFormatter, pluralGenerator, properties ] ); + + return returnFn; +}; + +return Globalize; + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/src/relative-time/format.js b/StockManMVC/.bin/bower_components/globalize/src/relative-time/format.js new file mode 100644 index 0000000..3002d51 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/relative-time/format.js @@ -0,0 +1,36 @@ +define([ + "../common/format-message" +], function( formatMessage ) { + +/** + * format( value, numberFormatter, pluralGenerator, properties ) + * + * @value [Number] The number to format + * + * @numberFormatter [String] A numberFormatter from Globalize.numberFormatter + * + * @pluralGenerator [String] A pluralGenerator from Globalize.pluralGenerator + * + * @properties [Object] containing relative time plural message. + * + * Format relative time. + */ +return function( value, numberFormatter, pluralGenerator, properties ) { + + var relativeTime, + message = properties[ "relative-type-" + value ]; + + if ( message ) { + return message; + } + + relativeTime = value <= 0 ? properties[ "relativeTime-type-past" ] + : properties[ "relativeTime-type-future" ]; + + value = Math.abs( value ); + + message = relativeTime[ "relativeTimePattern-count-" + pluralGenerator( value ) ]; + return formatMessage( message, [ numberFormatter( value ) ] ); +}; + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/src/relative-time/formatter-fn.js b/StockManMVC/.bin/bower_components/globalize/src/relative-time/formatter-fn.js new file mode 100644 index 0000000..b2be713 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/relative-time/formatter-fn.js @@ -0,0 +1,17 @@ +define([ + "../common/validate/parameter-presence", + "../common/validate/parameter-type/number", + "./format" +], function( validateParameterPresence, validateParameterTypeNumber, relativeTimeFormat ) { + +return function( numberFormatter, pluralGenerator, properties ) { + return function relativeTimeFormatter( value ) { + validateParameterPresence( value, "value" ); + validateParameterTypeNumber( value, "value" ); + + return relativeTimeFormat( value, numberFormatter, pluralGenerator, properties ); + }; + +}; + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/src/relative-time/properties.js b/StockManMVC/.bin/bower_components/globalize/src/relative-time/properties.js new file mode 100644 index 0000000..346cd99 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/relative-time/properties.js @@ -0,0 +1,41 @@ +define(function() { + +/** + * properties( unit, cldr, options ) + * + * @unit [String] eg. "day", "week", "month", etc. + * + * @cldr [Cldr instance]. + * + * @options [Object] + * - form: [String] eg. "short" or "narrow". Or falsy for default long form. + * + * Return relative time properties. + */ +return function( unit, cldr, options ) { + + var form = options.form, + raw, properties, key, match; + + if ( form ) { + unit = unit + "-" + form; + } + + raw = cldr.main( [ "dates", "fields", unit ] ); + properties = { + "relativeTime-type-future": raw[ "relativeTime-type-future" ], + "relativeTime-type-past": raw[ "relativeTime-type-past" ] + }; + for ( key in raw ) { + if ( raw.hasOwnProperty( key ) ) { + match = /relative-type-(-?[0-9]+)/.exec( key ); + if ( match ) { + properties[ key ] = raw[ key ]; + } + } + } + + return properties; +}; + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/src/unit-runtime.js b/StockManMVC/.bin/bower_components/globalize/src/unit-runtime.js new file mode 100644 index 0000000..8eb6972 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/unit-runtime.js @@ -0,0 +1,25 @@ +define([ + "./common/runtime-key", + "./core-runtime", + "./unit/formatter-fn", + + "./number-runtime", + "./plural-runtime" +], function( runtimeKey, Globalize, unitFormatterFn ) { + +Globalize._unitFormatterFn = unitFormatterFn; + +Globalize.formatUnit = +Globalize.prototype.formatUnit = function( value, unit, options ) { + return this.unitFormatter( unit, options )( value ); +}; + +Globalize.unitFormatter = +Globalize.prototype.unitFormatter = function( unit, options ) { + options = options || {}; + return Globalize[ runtimeKey( "unitFormatter", this._locale, [ unit, options ] ) ]; +}; + +return Globalize; + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/src/unit.js b/StockManMVC/.bin/bower_components/globalize/src/unit.js new file mode 100644 index 0000000..024b68e --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/unit.js @@ -0,0 +1,74 @@ +define([ + "./core", + "./common/runtime-bind", + "./common/validate/parameter-presence", + "./common/validate/parameter-type/number", + "./common/validate/parameter-type/plain-object", + "./common/validate/parameter-type/string", + "./unit/formatter-fn", + "./unit/properties", + + "./number", + "./plural" +], function( Globalize, runtimeBind, validateParameterPresence, validateParameterTypeNumber, + validateParameterTypePlainObject, validateParameterTypeString, unitFormatterFn, + unitProperties ) { + +/** + * Globalize.formatUnit( value, unit, options ) + * + * @value [Number] + * + * @unit [String]: The unit (e.g "second", "day", "year") + * + * @options [Object] + * - form: [String] "long", "short" (default), or "narrow". + * + * Format units such as seconds, minutes, days, weeks, etc. + */ +Globalize.formatUnit = +Globalize.prototype.formatUnit = function( value, unit, options ) { + validateParameterPresence( value, "value" ); + validateParameterTypeNumber( value, "value" ); + + return this.unitFormatter( unit, options )( value ); +}; + +/** + * Globalize.unitFormatter( unit, options ) + * + * @unit [String]: The unit (e.g "second", "day", "year") + * + * @options [Object] + * - form: [String] "long", "short" (default), or "narrow". + * + * - numberFormatter: [Function] a number formatter function. Defaults to Globalize + * `.numberFormatter()` for the current locale using the default options. + */ +Globalize.unitFormatter = +Globalize.prototype.unitFormatter = function( unit, options ) { + var args, form, numberFormatter, pluralGenerator, returnFn, properties; + + validateParameterPresence( unit, "unit" ); + validateParameterTypeString( unit, "unit" ); + + validateParameterTypePlainObject( options, "options" ); + + options = options || {}; + + args = [ unit, options ]; + form = options.form || "long"; + properties = unitProperties( unit, form, this.cldr ); + + numberFormatter = options.numberFormatter || this.numberFormatter(); + pluralGenerator = this.pluralGenerator(); + returnFn = unitFormatterFn( numberFormatter, pluralGenerator, properties ); + + runtimeBind( args, this.cldr, returnFn, [ numberFormatter, pluralGenerator, properties ] ); + + return returnFn; +}; + +return Globalize; + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/src/unit/categories.js b/StockManMVC/.bin/bower_components/globalize/src/unit/categories.js new file mode 100644 index 0000000..7a2fcad --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/unit/categories.js @@ -0,0 +1,11 @@ +define(function() { + +/** + * categories() + * + * Return all unit categories. + */ +return [ "acceleration", "angle", "area", "digital", "duration", "length", "mass", "power", +"pressure", "speed", "temperature", "volume" ]; + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/src/unit/format.js b/StockManMVC/.bin/bower_components/globalize/src/unit/format.js new file mode 100644 index 0000000..37320ed --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/unit/format.js @@ -0,0 +1,50 @@ +define([ + "../common/format-message" +], function( formatMessage ) { + +/** + * format( value, numberFormatter, pluralGenerator, unitProperies ) + * + * @value [Number] + * + * @numberFormatter [Object]: A numberFormatter from Globalize.numberFormatter. + * + * @pluralGenerator [Object]: A pluralGenerator from Globalize.pluralGenerator. + * + * @unitProperies [Object]: localized unit data from cldr. + * + * Format units such as seconds, minutes, days, weeks, etc. + * + * OBS: + * + * Unit Sequences are not implemented. + * http://www.unicode.org/reports/tr35/tr35-35/tr35-general.html#Unit_Sequences + * + * Duration Unit (for composed time unit durations) is not implemented. + * http://www.unicode.org/reports/tr35/tr35-35/tr35-general.html#durationUnit + */ +return function( value, numberFormatter, pluralGenerator, unitProperties ) { + var compoundUnitPattern = unitProperties.compoundUnitPattern, dividend, dividendProperties, + formattedValue, divisor, divisorProperties, message, pluralValue; + + unitProperties = unitProperties.unitProperties; + formattedValue = numberFormatter( value ); + pluralValue = pluralGenerator( value ); + + // computed compound unit, eg. "megabyte-per-second". + if ( unitProperties instanceof Array ) { + dividendProperties = unitProperties[ 0 ]; + divisorProperties = unitProperties[ 1 ]; + + dividend = formatMessage( dividendProperties[ pluralValue ], [ value ] ); + divisor = formatMessage( divisorProperties.one, [ "" ] ).trim(); + + return formatMessage( compoundUnitPattern, [ dividend, divisor ] ); + } + + message = unitProperties[ pluralValue ]; + + return formatMessage( message, [ formattedValue ] ); +}; + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/src/unit/formatter-fn.js b/StockManMVC/.bin/bower_components/globalize/src/unit/formatter-fn.js new file mode 100644 index 0000000..7131c1d --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/unit/formatter-fn.js @@ -0,0 +1,17 @@ +define([ + "../common/validate/parameter-presence", + "../common/validate/parameter-type/number", + "./format" +], function( validateParameterPresence, validateParameterTypeNumber, unitFormat ) { + +return function( numberFormatter, pluralGenerator, unitProperties ) { + return function unitFormatter( value ) { + validateParameterPresence( value, "value" ); + validateParameterTypeNumber( value, "value" ); + + return unitFormat( value, numberFormatter, pluralGenerator, unitProperties ); + }; + +}; + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/src/unit/get.js b/StockManMVC/.bin/bower_components/globalize/src/unit/get.js new file mode 100644 index 0000000..f905b77 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/unit/get.js @@ -0,0 +1,97 @@ +define([ + "./categories" +], function( unitCategories ) { + +function stripPluralGarbage( data ) { + var aux, pluralCount; + + if ( data ) { + aux = {}; + for ( pluralCount in data ) { + aux[ pluralCount.replace( /unitPattern-count-/, "" ) ] = data[ pluralCount ]; + } + } + + return aux; +} + +/** + * get( unit, form, cldr ) + * + * @unit [String] The full type-unit name (eg. duration-second), or the short unit name + * (eg. second). + * + * @form [String] A string describing the form of the unit representation (eg. long, + * short, narrow). + * + * @cldr [Cldr instance]. + * + * Return the plural map of a unit, eg: "second" + * { "one": "{0} second", + * "other": "{0} seconds" } + * } + * + * Or the Array of plural maps of a compound-unit, eg: "foot-per-second" + * [ { "one": "{0} foot", + * "other": "{0} feet" }, + * { "one": "{0} second", + * "other": "{0} seconds" } ] + * + * Uses the precomputed form of a compound-unit if available, eg: "mile-per-hour" + * { "displayName": "miles per hour", + * "unitPattern-count-one": "{0} mile per hour", + * "unitPattern-count-other": "{0} miles per hour" + * }, + * + * Also supports "/" instead of "-per-", eg. "foot/second", using the precomputed form if + * available. + * + * Or the Array of plural maps of a compound-unit, eg: "foot-per-second" + * [ { "one": "{0} foot", + * "other": "{0} feet" }, + * { "one": "{0} second", + * "other": "{0} seconds" } ] + * + * Or undefined in case the unit (or a unit of the compound-unit) doesn't exist. + */ +var get = function( unit, form, cldr ) { + var ret; + + // Ensure that we get the 'precomputed' form, if present. + unit = unit.replace( /\//, "-per-" ); + + // Get unit or -unit (eg. "duration-second"). + [ "" ].concat( unitCategories ).some(function( category ) { + return ret = cldr.main([ + "units", + form, + category.length ? category + "-" + unit : unit + ]); + }); + + // Rename keys s/unitPattern-count-//g. + ret = stripPluralGarbage( ret ); + + // Compound Unit, eg. "foot-per-second" or "foot/second". + if ( !ret && ( /-per-/ ).test( unit ) ) { + + // "Some units already have 'precomputed' forms, such as kilometer-per-hour; + // where such units exist, they should be used in preference" UTS#35. + // Note that precomputed form has already been handled above (!ret). + + // Get both recursively. + unit = unit.split( "-per-" ); + ret = unit.map(function( unit ) { + return get( unit, form, cldr ); + }); + if ( !ret[ 0 ] || !ret[ 1 ] ) { + return; + } + } + + return ret; +}; + +return get; + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/src/unit/properties.js b/StockManMVC/.bin/bower_components/globalize/src/unit/properties.js new file mode 100644 index 0000000..edabde0 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/unit/properties.js @@ -0,0 +1,28 @@ +define([ + "./get" +], function( unitGet ) { + +/** + * properties( unit, form, cldr ) + * + * @unit [String] The full type-unit name (eg. duration-second), or the short unit name + * (eg. second). + * + * @form [String] A string describing the form of the unit representation (eg. long, + * short, narrow). + * + * @cldr [Cldr instance]. + */ +return function( unit, form, cldr ) { + var compoundUnitPattern, unitProperties; + + compoundUnitPattern = cldr.main( [ "units", form, "per/compoundUnitPattern" ] ); + unitProperties = unitGet( unit, form, cldr ); + + return { + compoundUnitPattern: compoundUnitPattern, + unitProperties: unitProperties + }; +}; + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/src/util/always-array.js b/StockManMVC/.bin/bower_components/globalize/src/util/always-array.js new file mode 100644 index 0000000..b727661 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/util/always-array.js @@ -0,0 +1,7 @@ +define(function() { + +return function( stringOrArray ) { + return Array.isArray( stringOrArray ) ? stringOrArray : stringOrArray ? [ stringOrArray ] : []; +}; + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/src/util/always-cldr.js b/StockManMVC/.bin/bower_components/globalize/src/util/always-cldr.js new file mode 100644 index 0000000..a17e74d --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/util/always-cldr.js @@ -0,0 +1,9 @@ +define([ + "cldr" +], function( Cldr ) { + +return function( localeOrCldr ) { + return localeOrCldr instanceof Cldr ? localeOrCldr : new Cldr( localeOrCldr ); +}; + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/src/util/date/set-date.js b/StockManMVC/.bin/bower_components/globalize/src/util/date/set-date.js new file mode 100644 index 0000000..e83c732 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/util/date/set-date.js @@ -0,0 +1,16 @@ +define(function() { + +/** + * Differently from native date.setDate(), this function returns a date whose + * day remains inside the month boundaries. For example: + * + * setDate( FebDate, 31 ): a "Feb 28" date. + * setDate( SepDate, 31 ): a "Sep 30" date. + */ +return function( date, day ) { + var lastDay = new Date( date.getFullYear(), date.getMonth() + 1, 0 ).getDate(); + + date.setDate( day < 1 ? 1 : day < lastDay ? day : lastDay ); +}; + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/src/util/date/set-month.js b/StockManMVC/.bin/bower_components/globalize/src/util/date/set-month.js new file mode 100644 index 0000000..3befece --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/util/date/set-month.js @@ -0,0 +1,20 @@ +define([ + "./set-date" +], function( dateSetDate ) { + +/** + * Differently from native date.setMonth(), this function adjusts date if + * needed, so final month is always the one set. + * + * setMonth( Jan31Date, 1 ): a "Feb 28" date. + * setDate( Jan31Date, 8 ): a "Sep 30" date. + */ +return function( date, month ) { + var originalDate = date.getDate(); + + date.setDate( 1 ); + date.setMonth( month ); + dateSetDate( date, originalDate ); +}; + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/src/util/function-name.js b/StockManMVC/.bin/bower_components/globalize/src/util/function-name.js new file mode 100644 index 0000000..9ab3a4d --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/util/function-name.js @@ -0,0 +1,16 @@ +define([], function() { + +return function( fn ) { + if ( fn.name !== undefined ) { + return fn.name; + } + + // fn.name is not supported by IE. + var matches = /^function\s+([\w\$]+)\s*\(/.exec( fn.toString() ); + + if ( matches && matches.length > 0 ) { + return matches[ 1 ]; + } +}; + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/src/util/is-plain-object.js b/StockManMVC/.bin/bower_components/globalize/src/util/is-plain-object.js new file mode 100644 index 0000000..de8cc3d --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/util/is-plain-object.js @@ -0,0 +1,10 @@ +define(function() { + +/** + * Function inspired by jQuery Core, but reduced to our use case. + */ +return function( obj ) { + return obj !== null && "" + obj === "[object Object]"; +}; + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/src/util/number/round.js b/StockManMVC/.bin/bower_components/globalize/src/util/number/round.js new file mode 100644 index 0000000..35ed3f0 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/util/number/round.js @@ -0,0 +1,88 @@ +define([ + "./truncate" +], function( numberTruncate ) { + +/** + * round( method ) + * + * @method [String] with either "round", "ceil", "floor", or "truncate". + * + * Return function( value, incrementOrExp ): + * + * @value [Number] eg. 123.45. + * + * @incrementOrExp [Number] optional, eg. 0.1; or + * [Object] Either { increment: } or { exponent: } + * + * Return the rounded number, eg: + * - round( "round" )( 123.45 ): 123; + * - round( "ceil" )( 123.45 ): 124; + * - round( "floor" )( 123.45 ): 123; + * - round( "truncate" )( 123.45 ): 123; + * - round( "round" )( 123.45, 0.1 ): 123.5; + * - round( "round" )( 123.45, 10 ): 120; + * + * Based on https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/round + * Ref: #376 + */ +return function( method ) { + method = method || "round"; + method = method === "truncate" ? numberTruncate : Math[ method ]; + + return function( value, incrementOrExp ) { + var exp, increment; + + value = +value; + + // If the value is not a number, return NaN. + if ( isNaN( value ) ) { + return NaN; + } + + // Exponent given. + if ( typeof incrementOrExp === "object" && incrementOrExp.exponent ) { + exp = +incrementOrExp.exponent; + increment = 1; + + if ( exp === 0 ) { + return method( value ); + } + + // If the exp is not an integer, return NaN. + if ( !( typeof exp === "number" && exp % 1 === 0 ) ) { + return NaN; + } + + // Increment given. + } else { + increment = +incrementOrExp || 1; + + if ( increment === 1 ) { + return method( value ); + } + + // If the increment is not a number, return NaN. + if ( isNaN( increment ) ) { + return NaN; + } + + increment = increment.toExponential().split( "e" ); + exp = +increment[ 1 ]; + increment = +increment[ 0 ]; + } + + // Shift & Round + value = value.toString().split( "e" ); + value[ 0 ] = +value[ 0 ] / increment; + value[ 1 ] = value[ 1 ] ? ( +value[ 1 ] - exp ) : -exp; + value = method( +( value[ 0 ] + "e" + value[ 1 ] ) ); + + // Shift back + value = value.toString().split( "e" ); + value[ 0 ] = +value[ 0 ] * increment; + value[ 1 ] = value[ 1 ] ? ( +value[ 1 ] + exp ) : exp; + return +( value[ 0 ] + "e" + value[ 1 ] ); + }; +}; + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/src/util/number/to-precision.js b/StockManMVC/.bin/bower_components/globalize/src/util/number/to-precision.js new file mode 100644 index 0000000..e3ba0bf --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/util/number/to-precision.js @@ -0,0 +1,27 @@ +define(function() { + +/** + * toPrecision( number, precision, round ) + * + * @number (Number) + * + * @precision (Number) significant figures precision (not decimal precision). + * + * @round (Function) + * + * Return number.toPrecision( precision ) using the given round function. + */ +return function( number, precision, round ) { + var roundOrder; + + // Get number at two extra significant figure precision. + number = number.toPrecision( precision + 2 ); + + // Then, round it to the required significant figure precision. + roundOrder = Math.ceil( Math.log( Math.abs( number ) ) / Math.log( 10 ) ); + roundOrder -= precision; + + return round( number, { exponent: roundOrder } ); +}; + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/src/util/number/truncate.js b/StockManMVC/.bin/bower_components/globalize/src/util/number/truncate.js new file mode 100644 index 0000000..0fe0627 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/util/number/truncate.js @@ -0,0 +1,10 @@ +define(function() { + +return function( value ) { + if ( isNaN( value ) ) { + return NaN; + } + return Math[ value < 0 ? "ceil" : "floor" ]( value ); +}; + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/src/util/object/extend.js b/StockManMVC/.bin/bower_components/globalize/src/util/object/extend.js new file mode 100644 index 0000000..6d1f449 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/util/object/extend.js @@ -0,0 +1,17 @@ +define(function() { + +return function() { + var destination = arguments[ 0 ], + sources = [].slice.call( arguments, 1 ); + + sources.forEach(function( source ) { + var prop; + for ( prop in source ) { + destination[ prop ] = source[ prop ]; + } + }); + + return destination; +}; + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/src/util/object/filter.js b/StockManMVC/.bin/bower_components/globalize/src/util/object/filter.js new file mode 100644 index 0000000..5b16e47 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/util/object/filter.js @@ -0,0 +1,16 @@ +define(function() { + +return function( object, testRe ) { + var key, + copy = {}; + + for ( key in object ) { + if ( testRe.test( key ) ) { + copy[ key ] = object[ key ]; + } + } + + return copy; +}; + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/src/util/object/omit.js b/StockManMVC/.bin/bower_components/globalize/src/util/object/omit.js new file mode 100644 index 0000000..e4e981a --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/util/object/omit.js @@ -0,0 +1,25 @@ +define([ + "../always-array" +], function( alwaysArray ) { + +/** + * objectOmit( object, keys ) + * + * Return a copy of the object, filtered to omit the blacklisted key or array of keys. + */ +return function( object, keys ) { + var key, + copy = {}; + + keys = alwaysArray( keys ); + + for ( key in object ) { + if ( keys.indexOf( key ) === -1 ) { + copy[ key ] = object[ key ]; + } + } + + return copy; +}; + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/src/util/object/values.js b/StockManMVC/.bin/bower_components/globalize/src/util/object/values.js new file mode 100644 index 0000000..9364f9d --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/util/object/values.js @@ -0,0 +1,14 @@ +define(function() { + +return function( object ) { + var i, + result = []; + + for ( i in object ) { + result.push( object[ i ] ); + } + + return result; +}; + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/src/util/out-of-range.js b/StockManMVC/.bin/bower_components/globalize/src/util/out-of-range.js new file mode 100644 index 0000000..eea8bc3 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/util/out-of-range.js @@ -0,0 +1,7 @@ +define(function() { + +return function( value, low, high ) { + return value < low || value > high; +}; + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/src/util/regexp/escape.js b/StockManMVC/.bin/bower_components/globalize/src/util/regexp/escape.js new file mode 100644 index 0000000..ebfdb73 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/util/regexp/escape.js @@ -0,0 +1,8 @@ +define(function() { + +// ref: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions?redirectlocale=en-US&redirectslug=JavaScript%2FGuide%2FRegular_Expressions +return function( string ) { + return string.replace( /([.*+?^=!:${}()|\[\]\/\\])/g, "\\$1" ); +}; + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/src/util/regexp/n.js b/StockManMVC/.bin/bower_components/globalize/src/util/regexp/n.js new file mode 100644 index 0000000..4fc2c9c --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/util/regexp/n.js @@ -0,0 +1,13 @@ +define(function() { + +/** + * Generated by: + * + * regenerate().add( require( "unicode-7.0.0/categories/N/symbols" ) ).toString(); + * + * https://github.com/mathiasbynens/regenerate + * https://github.com/mathiasbynens/unicode-7.0.0 + */ +return /[0-9\xB2\xB3\xB9\xBC-\xBE\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u09F4-\u09F9\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0B72-\u0B77\u0BE6-\u0BF2\u0C66-\u0C6F\u0C78-\u0C7E\u0CE6-\u0CEF\u0D66-\u0D75\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F33\u1040-\u1049\u1090-\u1099\u1369-\u137C\u16EE-\u16F0\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1946-\u194F\u19D0-\u19DA\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\u2070\u2074-\u2079\u2080-\u2089\u2150-\u2182\u2185-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2CFD\u3007\u3021-\u3029\u3038-\u303A\u3192-\u3195\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\uA620-\uA629\uA6E6-\uA6EF\uA830-\uA835\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19]|\uD800[\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDEE1-\uDEFB\uDF20-\uDF23\uDF41\uDF4A\uDFD1-\uDFD5]|\uD801[\uDCA0-\uDCA9]|\uD802[\uDC58-\uDC5F\uDC79-\uDC7F\uDCA7-\uDCAF\uDD16-\uDD1B\uDE40-\uDE47\uDE7D\uDE7E\uDE9D-\uDE9F\uDEEB-\uDEEF\uDF58-\uDF5F\uDF78-\uDF7F\uDFA9-\uDFAF]|\uD803[\uDE60-\uDE7E]|\uD804[\uDC52-\uDC6F\uDCF0-\uDCF9\uDD36-\uDD3F\uDDD0-\uDDD9\uDDE1-\uDDF4\uDEF0-\uDEF9]|\uD805[\uDCD0-\uDCD9\uDE50-\uDE59\uDEC0-\uDEC9]|\uD806[\uDCE0-\uDCF2]|\uD809[\uDC00-\uDC6E]|\uD81A[\uDE60-\uDE69\uDF50-\uDF59\uDF5B-\uDF61]|\uD834[\uDF60-\uDF71]|\uD835[\uDFCE-\uDFFF]|\uD83A[\uDCC7-\uDCCF]|\uD83C[\uDD00-\uDD0C]/; + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/src/util/regexp/not-s.js b/StockManMVC/.bin/bower_components/globalize/src/util/regexp/not-s.js new file mode 100644 index 0000000..fe3aeeb --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/util/regexp/not-s.js @@ -0,0 +1,18 @@ +define(function() { + +/** + * Unicode regular expression for: everything except math symbols, currency signs, dingbats, and + * box-drawing characters. + * + * Generated by: + * + * regenerate() + * .addRange( 0x0, 0x10FFFF ) + * .remove( require( "unicode-7.0.0/categories/S/symbols" ) ).toString(); + * + * https://github.com/mathiasbynens/regenerate + * https://github.com/mathiasbynens/unicode-7.0.0 + */ +return /[\0-#%-\*,-;\?-\]_a-\{\}\x7F-\xA1\xA7\xAA\xAB\xAD\xB2\xB3\xB5-\xB7\xB9-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376-\u0383\u0386-\u03F5\u03F7-\u0481\u0483-\u058C\u0590-\u0605\u0609\u060A\u060C\u060D\u0610-\u06DD\u06DF-\u06E8\u06EA-\u06FC\u06FF-\u07F5\u07F7-\u09F1\u09F4-\u09F9\u09FC-\u0AF0\u0AF2-\u0B6F\u0B71-\u0BF2\u0BFB-\u0C7E\u0C80-\u0D78\u0D7A-\u0E3E\u0E40-\u0F00\u0F04-\u0F12\u0F14\u0F18\u0F19\u0F20-\u0F33\u0F35\u0F37\u0F39-\u0FBD\u0FC6\u0FCD\u0FD0-\u0FD4\u0FD9-\u109D\u10A0-\u138F\u139A-\u17DA\u17DC-\u193F\u1941-\u19DD\u1A00-\u1B60\u1B6B-\u1B73\u1B7D-\u1FBC\u1FBE\u1FC2-\u1FCC\u1FD0-\u1FDC\u1FE0-\u1FEC\u1FF0-\u1FFC\u1FFF-\u2043\u2045-\u2051\u2053-\u2079\u207D-\u2089\u208D-\u209F\u20BE-\u20FF\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2150-\u218F\u2308-\u230B\u2329\u232A\u23FB-\u23FF\u2427-\u243F\u244B-\u249B\u24EA-\u24FF\u2768-\u2793\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2B74\u2B75\u2B96\u2B97\u2BBA-\u2BBC\u2BC9\u2BD2-\u2CE4\u2CEB-\u2E7F\u2E9A\u2EF4-\u2EFF\u2FD6-\u2FEF\u2FFC-\u3003\u3005-\u3011\u3014-\u301F\u3021-\u3035\u3038-\u303D\u3040-\u309A\u309D-\u318F\u3192-\u3195\u31A0-\u31BF\u31E4-\u31FF\u321F-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u32FF\u3400-\u4DBF\u4E00-\uA48F\uA4C7-\uA6FF\uA717-\uA71F\uA722-\uA788\uA78B-\uA827\uA82C-\uA835\uA83A-\uAA76\uAA7A-\uAB5A\uAB5C-\uD7FF\uDC00-\uFB28\uFB2A-\uFBB1\uFBC2-\uFDFB\uFDFE-\uFE61\uFE63\uFE67\uFE68\uFE6A-\uFF03\uFF05-\uFF0A\uFF0C-\uFF1B\uFF1F-\uFF3D\uFF3F\uFF41-\uFF5B\uFF5D\uFF5F-\uFFDF\uFFE7\uFFEF-\uFFFB\uFFFE\uFFFF]|\uD800[\uDC00-\uDD36\uDD40-\uDD78\uDD8A\uDD8B\uDD8D-\uDD8F\uDD9C-\uDD9F\uDDA1-\uDDCF\uDDFD-\uDFFF]|[\uD801\uD803-\uD819\uD81B-\uD82E\uD830-\uD833\uD836-\uD83A\uD83F-\uDBFF][\uDC00-\uDFFF]|\uD802[\uDC00-\uDC76\uDC79-\uDEC7\uDEC9-\uDFFF]|\uD81A[\uDC00-\uDF3B\uDF40-\uDF44\uDF46-\uDFFF]|\uD82F[\uDC00-\uDC9B\uDC9D-\uDFFF]|\uD834[\uDCF6-\uDCFF\uDD27\uDD28\uDD65-\uDD69\uDD6D-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDDDE-\uDDFF\uDE42-\uDE44\uDE46-\uDEFF\uDF57-\uDFFF]|\uD835[\uDC00-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFFF]|\uD83B[\uDC00-\uDEEF\uDEF2-\uDFFF]|\uD83C[\uDC2C-\uDC2F\uDC94-\uDC9F\uDCAF\uDCB0\uDCC0\uDCD0\uDCF6-\uDD0F\uDD2F\uDD6C-\uDD6F\uDD9B-\uDDE5\uDE03-\uDE0F\uDE3B-\uDE3F\uDE49-\uDE4F\uDE52-\uDEFF\uDF2D-\uDF2F\uDF7E\uDF7F\uDFCF-\uDFD3\uDFF8-\uDFFF]|\uD83D[\uDCFF\uDD4B-\uDD4F\uDD7A\uDDA4\uDE43\uDE44\uDED0-\uDEDF\uDEED-\uDEEF\uDEF4-\uDEFF\uDF74-\uDF7F\uDFD5-\uDFFF]|\uD83E[\uDC0C-\uDC0F\uDC48-\uDC4F\uDC5A-\uDC5F\uDC88-\uDC8F\uDCAE-\uDFFF]|[\uD800-\uDBFF]/; + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/src/util/string/hash.js b/StockManMVC/.bin/bower_components/globalize/src/util/string/hash.js new file mode 100644 index 0000000..83e26a8 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/util/string/hash.js @@ -0,0 +1,12 @@ +define(function() { + +// Based on http://stackoverflow.com/questions/7616461/generate-a-hash-from-string-in-javascript-jquery +return function( str ) { + return [].reduce.call( str, function( hash, i ) { + var chr = i.charCodeAt( 0 ); + hash = ( ( hash << 5 ) - hash ) + chr; + return hash | 0; + }, 0 ); +}; + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/src/util/string/pad.js b/StockManMVC/.bin/bower_components/globalize/src/util/string/pad.js new file mode 100644 index 0000000..7ab1058 --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/util/string/pad.js @@ -0,0 +1,14 @@ +define(function() { + +return function( str, count, right ) { + var length; + if ( typeof str !== "string" ) { + str = String( str ); + } + for ( length = str.length; length < count; length += 1 ) { + str = ( right ? ( str + "0" ) : ( "0" + str ) ); + } + return str; +}; + +}); diff --git a/StockManMVC/.bin/bower_components/globalize/src/util/to-string.js b/StockManMVC/.bin/bower_components/globalize/src/util/to-string.js new file mode 100644 index 0000000..29d0f1d --- /dev/null +++ b/StockManMVC/.bin/bower_components/globalize/src/util/to-string.js @@ -0,0 +1,14 @@ +define(function() { + +/** + * A toString method that outputs meaningful values for objects or arrays and + * still performs as fast as a plain string in case variable is string, or as + * fast as `"" + number` in case variable is a number. + * Ref: http://jsperf.com/my-stringify + */ +return function( variable ) { + return typeof variable === "string" ? variable : ( typeof variable === "number" ? "" + + variable : JSON.stringify( variable ) ); +}; + +}); diff --git a/StockManMVC/.bin/git.cmd b/StockManMVC/.bin/git.cmd new file mode 100644 index 0000000..85ddefe --- /dev/null +++ b/StockManMVC/.bin/git.cmd @@ -0,0 +1,3 @@ +@echo off +SET PATH=%~dp0;%PATH% +"%~dp0node" "%~dp0..\..\packages\NoGit.0.0.8\node_modules\nogit\bin\git.js" %* \ No newline at end of file diff --git a/StockManMVC/.bin/node.cmd b/StockManMVC/.bin/node.cmd new file mode 100644 index 0000000..5b6b155 --- /dev/null +++ b/StockManMVC/.bin/node.cmd @@ -0,0 +1,3 @@ +@echo off +SET PATH=%PATH%;%~dp0 +"%~dp0..\..\packages\Node.js.0.10.28\node.exe" %* \ No newline at end of file diff --git a/StockManMVC/App_Start/BundleConfig.cs b/StockManMVC/App_Start/BundleConfig.cs index d0037ff..1842af2 100644 --- a/StockManMVC/App_Start/BundleConfig.cs +++ b/StockManMVC/App_Start/BundleConfig.cs @@ -19,9 +19,12 @@ namespace StockManMVC "~/Scripts/cldr.js", "~/Scripts/cldr/event.js", "~/Scripts/cldr/supplemental.js", + "~/Scripts/cldr/unresolved.js", "~/Scripts/globalize.js", + "~/Scripts/globalize/currency.js", + "~/Scripts/globalize/date.js", "~/Scripts/globalize/number.js", - "~/Scripts/globalize/date.js" + "~/Scripts/globalize/unit.js" )); bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include( diff --git a/StockManMVC/StockManMVC.csproj b/StockManMVC/StockManMVC.csproj index e957f1c..029e656 100644 --- a/StockManMVC/StockManMVC.csproj +++ b/StockManMVC/StockManMVC.csproj @@ -233,6 +233,18 @@ + + + + + + + + + + + + @@ -325,6 +337,105 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + compilerconfig.json @@ -369,6 +480,7 @@ + Web.config diff --git a/StockManMVC/Test.html b/StockManMVC/Test.html new file mode 100644 index 0000000..fc82e37 --- /dev/null +++ b/StockManMVC/Test.html @@ -0,0 +1,74 @@ + + + + Globalize demo + + + +
+

Globalize demo for the culture / locale

+

+ This is a the number formatted by Globalize: + +

+

+ This is a the number formatted by Globalize: + +

+
+ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/StockManMVC/Web.config b/StockManMVC/Web.config index ecca14e..9ce0f66 100644 --- a/StockManMVC/Web.config +++ b/StockManMVC/Web.config @@ -33,7 +33,6 @@ - @@ -80,7 +79,18 @@ - + + + + + + + + + + + + diff --git a/StockManMVC/bin/StockManMVC.dll b/StockManMVC/bin/StockManMVC.dll index 57031d0..5626e6f 100644 Binary files a/StockManMVC/bin/StockManMVC.dll and b/StockManMVC/bin/StockManMVC.dll differ diff --git a/StockManMVC/bin/StockManMVC.dll.config b/StockManMVC/bin/StockManMVC.dll.config index ecca14e..9ce0f66 100644 --- a/StockManMVC/bin/StockManMVC.dll.config +++ b/StockManMVC/bin/StockManMVC.dll.config @@ -33,7 +33,6 @@ - @@ -80,7 +79,18 @@ - + + + + + + + + + + + + diff --git a/StockManMVC/bower.json b/StockManMVC/bower.json index 0b49d4c..9174b1e 100644 --- a/StockManMVC/bower.json +++ b/StockManMVC/bower.json @@ -1,6 +1,6 @@ { "name": "StockManMVC", - "version": "0.8.20", + "version": "1.0.37", "description": "Gestione Stock", "authors": [ "S.E.Locatelli" diff --git a/StockManMVC/bower_components/bower.json/.bower.json b/StockManMVC/bower_components/bower.json/.bower.json new file mode 100644 index 0000000..34726b7 --- /dev/null +++ b/StockManMVC/bower_components/bower.json/.bower.json @@ -0,0 +1,15 @@ +{ + "name": "bower.json", + "homepage": "https://github.com/Kalitte/app-states", + "version": "0.6.9", + "_release": "0.6.9", + "_resolution": { + "type": "version", + "tag": "v0.6.9", + "commit": "97eb8e1d134fca9e6dc1767d2bd3597c05437fac" + }, + "_source": "https://github.com/Kalitte/app-states.git", + "_target": "~0.6.9", + "_originalSource": "bower.json", + "_direct": true +} \ No newline at end of file diff --git a/StockManMVC/bower_components/cldr-data/segments/de/suppressions.json b/StockManMVC/bower_components/cldr-data/segments/de/suppressions.json new file mode 100644 index 0000000..8641b54 --- /dev/null +++ b/StockManMVC/bower_components/cldr-data/segments/de/suppressions.json @@ -0,0 +1,740 @@ +{ + "segments": { + "identity": { + "version": { + "_number": "$Revision: 11914 $", + "_cldrVersion": "29" + }, + "language": "de" + }, + "segmentations": { + "SentenceBreak": { + "standard": [ + { + "suppression": "Port." + }, + { + "suppression": "Alt." + }, + { + "suppression": "Di." + }, + { + "suppression": "Ges." + }, + { + "suppression": "frz." + }, + { + "suppression": "entspr." + }, + { + "suppression": "Gebr." + }, + { + "suppression": "erw." + }, + { + "suppression": "Frl." + }, + { + "suppression": "Inh." + }, + { + "suppression": "k.u.k." + }, + { + "suppression": "Ca." + }, + { + "suppression": "J.D." + }, + { + "suppression": "Ausg." + }, + { + "suppression": "evtl." + }, + { + "suppression": "So." + }, + { + "suppression": "i.B." + }, + { + "suppression": "s.a." + }, + { + "suppression": "kgl." + }, + { + "suppression": "Sept." + }, + { + "suppression": "o.B." + }, + { + "suppression": "Sa." + }, + { + "suppression": "ev." + }, + { + "suppression": "Dez." + }, + { + "suppression": "am." + }, + { + "suppression": "i.R." + }, + { + "suppression": "eigtl." + }, + { + "suppression": "i.J." + }, + { + "suppression": "u.U." + }, + { + "suppression": "G." + }, + { + "suppression": "z.Hd." + }, + { + "suppression": "u.A.w.g." + }, + { + "suppression": "Kl." + }, + { + "suppression": "Spezif." + }, + { + "suppression": "Obj." + }, + { + "suppression": "Ing." + }, + { + "suppression": "D. h." + }, + { + "suppression": "Folg." + }, + { + "suppression": "Akt." + }, + { + "suppression": "i.A." + }, + { + "suppression": "Msp." + }, + { + "suppression": "U.U." + }, + { + "suppression": "Chr." + }, + { + "suppression": "R." + }, + { + "suppression": "Einh." + }, + { + "suppression": "schwäb." + }, + { + "suppression": "Vgl." + }, + { + "suppression": "Aug." + }, + { + "suppression": "Dipl.-Ing." + }, + { + "suppression": "W." + }, + { + "suppression": "B." + }, + { + "suppression": "U. U." + }, + { + "suppression": "J." + }, + { + "suppression": "Fa." + }, + { + "suppression": "Mo." + }, + { + "suppression": "n.u.Z." + }, + { + "suppression": "Op." + }, + { + "suppression": "Mrd." + }, + { + "suppression": "e.h." + }, + { + "suppression": "Hr." + }, + { + "suppression": "Hrn." + }, + { + "suppression": "Ztr." + }, + { + "suppression": "k. u. k." + }, + { + "suppression": "Bibl." + }, + { + "suppression": "d.Ä." + }, + { + "suppression": "b." + }, + { + "suppression": "M." + }, + { + "suppression": "i.H." + }, + { + "suppression": "v.R.w." + }, + { + "suppression": "o.A." + }, + { + "suppression": "St." + }, + { + "suppression": "Dr." + }, + { + "suppression": "Fn." + }, + { + "suppression": "Abs." + }, + { + "suppression": "Rd." + }, + { + "suppression": "Dtzd." + }, + { + "suppression": "Jahrh." + }, + { + "suppression": "Z." + }, + { + "suppression": "Std." + }, + { + "suppression": "n. Chr." + }, + { + "suppression": "möbl." + }, + { + "suppression": "tägl." + }, + { + "suppression": "gest." + }, + { + "suppression": "gesch." + }, + { + "suppression": "z.B." + }, + { + "suppression": "Hbf." + }, + { + "suppression": "Abt." + }, + { + "suppression": "A.M." + }, + { + "suppression": "e.Wz." + }, + { + "suppression": "v.T." + }, + { + "suppression": "Nov." + }, + { + "suppression": "z." + }, + { + "suppression": "Prot." + }, + { + "suppression": "U.S." + }, + { + "suppression": "Wg." + }, + { + "suppression": "u.v.a." + }, + { + "suppression": "Adr." + }, + { + "suppression": "App." + }, + { + "suppression": "ggf." + }, + { + "suppression": "ggfs." + }, + { + "suppression": "Jan." + }, + { + "suppression": "O." + }, + { + "suppression": "Rel." + }, + { + "suppression": "od." + }, + { + "suppression": "Pfd." + }, + { + "suppression": "a.a.O." + }, + { + "suppression": "p.Adr." + }, + { + "suppression": "P." + }, + { + "suppression": "Gem." + }, + { + "suppression": "v. Chr." + }, + { + "suppression": "Art." + }, + { + "suppression": "z.Z." + }, + { + "suppression": "S.A." + }, + { + "suppression": "i.V." + }, + { + "suppression": "verh." + }, + { + "suppression": "Ausschl." + }, + { + "suppression": "m.W." + }, + { + "suppression": "Dir." + }, + { + "suppression": "Verf." + }, + { + "suppression": "Sek." + }, + { + "suppression": "r." + }, + { + "suppression": "Chin." + }, + { + "suppression": "Feb." + }, + { + "suppression": "Int." + }, + { + "suppression": "Sep." + }, + { + "suppression": "Gesch." + }, + { + "suppression": "schweiz." + }, + { + "suppression": "Bed." + }, + { + "suppression": "a.Rh." + }, + { + "suppression": "jew." + }, + { + "suppression": "vgl." + }, + { + "suppression": "a.M." + }, + { + "suppression": "Str." + }, + { + "suppression": "exkl." + }, + { + "suppression": "gek." + }, + { + "suppression": "Erf." + }, + { + "suppression": "u.Ä." + }, + { + "suppression": "ehem." + }, + { + "suppression": "näml." + }, + { + "suppression": "u. Z." + }, + { + "suppression": "v. u. Z." + }, + { + "suppression": "sog." + }, + { + "suppression": "C." + }, + { + "suppression": "Dipl.-Kfm." + }, + { + "suppression": "mtl." + }, + { + "suppression": "Hrsg." + }, + { + "suppression": "Qu." + }, + { + "suppression": "röm." + }, + { + "suppression": "u." + }, + { + "suppression": "U." + }, + { + "suppression": "Adj." + }, + { + "suppression": "Kap." + }, + { + "suppression": "hpts." + }, + { + "suppression": "a.D." + }, + { + "suppression": "gedr." + }, + { + "suppression": "Best." + }, + { + "suppression": "N." + }, + { + "suppression": "v.u.Z." + }, + { + "suppression": "Phys." + }, + { + "suppression": "Fr." + }, + { + "suppression": "d.J." + }, + { + "suppression": "Reg.-Bez." + }, + { + "suppression": "m.E." + }, + { + "suppression": "schles." + }, + { + "suppression": "Max." + }, + { + "suppression": "Ltd." + }, + { + "suppression": "südd." + }, + { + "suppression": "inkl." + }, + { + "suppression": "geb." + }, + { + "suppression": "Ggf." + }, + { + "suppression": "Inc." + }, + { + "suppression": "kath." + }, + { + "suppression": "kfm." + }, + { + "suppression": "Nr." + }, + { + "suppression": "Proz." + }, + { + "suppression": "Dim." + }, + { + "suppression": "verw." + }, + { + "suppression": "Reg." + }, + { + "suppression": "Dat." + }, + { + "suppression": "Evtl." + }, + { + "suppression": "led." + }, + { + "suppression": "F." + }, + { + "suppression": "Test." + }, + { + "suppression": "Schr." + }, + { + "suppression": "Do." + }, + { + "suppression": "PIN." + }, + { + "suppression": "Z. Zt." + }, + { + "suppression": "v.Chr." + }, + { + "suppression": "Tägl." + }, + { + "suppression": "s." + }, + { + "suppression": "amtl." + }, + { + "suppression": "Temp." + }, + { + "suppression": "Mind." + }, + { + "suppression": "e.V." + }, + { + "suppression": "Abw." + }, + { + "suppression": "P.M." + }, + { + "suppression": "F.f." + }, + { + "suppression": "a.a.S." + }, + { + "suppression": "Mod." + }, + { + "suppression": "Co." + }, + { + "suppression": "Min." + }, + { + "suppression": "Allg." + }, + { + "suppression": "Geograph." + }, + { + "suppression": "Jr." + }, + { + "suppression": "Urspr." + }, + { + "suppression": "Apr." + }, + { + "suppression": "Z. B." + }, + { + "suppression": "v.H." + }, + { + "suppression": "A." + }, + { + "suppression": "einschl." + }, + { + "suppression": "Trans." + }, + { + "suppression": "zzgl." + }, + { + "suppression": "StR." + }, + { + "suppression": "Fam." + }, + { + "suppression": "I." + }, + { + "suppression": "jhrl." + }, + { + "suppression": "u.a." + }, + { + "suppression": "Ben." + }, + { + "suppression": "o.g." + }, + { + "suppression": "Kfm." + }, + { + "suppression": "Konv." + }, + { + "suppression": "Mi." + }, + { + "suppression": "L." + }, + { + "suppression": "beil." + }, + { + "suppression": "T." + }, + { + "suppression": "Ursprüngl." + }, + { + "suppression": "röm.-kath." + }, + { + "suppression": "Okt." + }, + { + "suppression": "u.ä." + }, + { + "suppression": "Tel." + }, + { + "suppression": "D." + }, + { + "suppression": "Ber." + }, + { + "suppression": "Kop." + }, + { + "suppression": "Mio." + }, + { + "suppression": "Y." + }, + { + "suppression": "U.S.A." + }, + { + "suppression": "v. H." + }, + { + "suppression": "Forts. f." + }, + { + "suppression": "Rep." + }, + { + "suppression": "Hptst." + }, + { + "suppression": "österr." + } + ] + } + } + } +} diff --git a/StockManMVC/bower_components/cldr-data/segments/el/suppressions.json b/StockManMVC/bower_components/cldr-data/segments/el/suppressions.json new file mode 100644 index 0000000..a202e60 --- /dev/null +++ b/StockManMVC/bower_components/cldr-data/segments/el/suppressions.json @@ -0,0 +1,20 @@ +{ + "segments": { + "identity": { + "version": { + "_number": "$Revision: 11914 $", + "_cldrVersion": "29" + }, + "language": "el" + }, + "segmentations": { + "SentenceBreak": { + "variables": [ + { + "$STerm": "[[$STerm] [\\u003B \\u037E]]" + } + ] + } + } + } +} diff --git a/StockManMVC/bower_components/cldr-data/segments/es/suppressions.json b/StockManMVC/bower_components/cldr-data/segments/es/suppressions.json new file mode 100644 index 0000000..a96e059 --- /dev/null +++ b/StockManMVC/bower_components/cldr-data/segments/es/suppressions.json @@ -0,0 +1,509 @@ +{ + "segments": { + "identity": { + "version": { + "_number": "$Revision: 11914 $", + "_cldrVersion": "29" + }, + "language": "es" + }, + "segmentations": { + "SentenceBreak": { + "standard": [ + { + "suppression": "Rdos." + }, + { + "suppression": "JJ.OO." + }, + { + "suppression": "Sres." + }, + { + "suppression": "fig." + }, + { + "suppression": "may." + }, + { + "suppression": "RR.HH." + }, + { + "suppression": "oct." + }, + { + "suppression": "cap." + }, + { + "suppression": "mié." + }, + { + "suppression": "doc." + }, + { + "suppression": "Excmo." + }, + { + "suppression": "Trab." + }, + { + "suppression": "Excmos." + }, + { + "suppression": "Kit." + }, + { + "suppression": "Inc." + }, + { + "suppression": "FF.CC." + }, + { + "suppression": "DC." + }, + { + "suppression": "ago." + }, + { + "suppression": "trad." + }, + { + "suppression": "SA." + }, + { + "suppression": "Rvdos." + }, + { + "suppression": "ed." + }, + { + "suppression": "Exmo." + }, + { + "suppression": "jul." + }, + { + "suppression": "col." + }, + { + "suppression": "RAM." + }, + { + "suppression": "Srtas." + }, + { + "suppression": "ene." + }, + { + "suppression": "Rol." + }, + { + "suppression": "Fabric." + }, + { + "suppression": "Comm." + }, + { + "suppression": "vid." + }, + { + "suppression": "Da." + }, + { + "suppression": "dic." + }, + { + "suppression": "ss." + }, + { + "suppression": "abr." + }, + { + "suppression": "ntra." + }, + { + "suppression": "Sra." + }, + { + "suppression": "dtor." + }, + { + "suppression": "cf." + }, + { + "suppression": "dom." + }, + { + "suppression": "prov." + }, + { + "suppression": "Emm." + }, + { + "suppression": "Sr." + }, + { + "suppression": "licdo." + }, + { + "suppression": "p.ej." + }, + { + "suppression": "bol." + }, + { + "suppression": "figs." + }, + { + "suppression": "Vda." + }, + { + "suppression": "Dr." + }, + { + "suppression": "ntro." + }, + { + "suppression": "Desv." + }, + { + "suppression": "O.M." + }, + { + "suppression": "Ldo." + }, + { + "suppression": "Drs." + }, + { + "suppression": "sáb." + }, + { + "suppression": "feb." + }, + { + "suppression": "Ltda." + }, + { + "suppression": "Lcda." + }, + { + "suppression": "Exma." + }, + { + "suppression": "C.V." + }, + { + "suppression": "SS.MM." + }, + { + "suppression": "Lda." + }, + { + "suppression": "U.S." + }, + { + "suppression": "hnos." + }, + { + "suppression": "R.D." + }, + { + "suppression": "Korn." + }, + { + "suppression": "v.gr." + }, + { + "suppression": "vs." + }, + { + "suppression": "Ilmas." + }, + { + "suppression": "Rdo." + }, + { + "suppression": "ej." + }, + { + "suppression": "vie." + }, + { + "suppression": "jue." + }, + { + "suppression": "a. C." + }, + { + "suppression": "Ilmos." + }, + { + "suppression": "e. c." + }, + { + "suppression": "Excma." + }, + { + "suppression": "afma." + }, + { + "suppression": "licda." + }, + { + "suppression": "Em." + }, + { + "suppression": "K." + }, + { + "suppression": "sras." + }, + { + "suppression": "MM." + }, + { + "suppression": "fund." + }, + { + "suppression": "Mons." + }, + { + "suppression": "Lcdo." + }, + { + "suppression": "afmo." + }, + { + "suppression": "C." + }, + { + "suppression": "A.C." + }, + { + "suppression": "dptos." + }, + { + "suppression": "Col." + }, + { + "suppression": "Srta." + }, + { + "suppression": "Av." + }, + { + "suppression": "Ant." + }, + { + "suppression": "depto." + }, + { + "suppression": "Var." + }, + { + "suppression": "H.P." + }, + { + "suppression": "D." + }, + { + "suppression": "M." + }, + { + "suppression": "C.P." + }, + { + "suppression": "Rev." + }, + { + "suppression": "Rvdmos." + }, + { + "suppression": "Fr." + }, + { + "suppression": "Ilmo." + }, + { + "suppression": "afmos." + }, + { + "suppression": "Ltd." + }, + { + "suppression": "afmas." + }, + { + "suppression": "prof." + }, + { + "suppression": "lun." + }, + { + "suppression": "SS.AA." + }, + { + "suppression": "Sol." + }, + { + "suppression": "nov." + }, + { + "suppression": "mss." + }, + { + "suppression": "Dña." + }, + { + "suppression": "Seg." + }, + { + "suppression": "mar." + }, + { + "suppression": "Rvdmo." + }, + { + "suppression": "Reg." + }, + { + "suppression": "ms." + }, + { + "suppression": "Sras." + }, + { + "suppression": "sres." + }, + { + "suppression": "U.S.A." + }, + { + "suppression": "Sta." + }, + { + "suppression": "Sdad." + }, + { + "suppression": "Dra." + }, + { + "suppression": "srs." + }, + { + "suppression": "R.U." + }, + { + "suppression": "deptos." + }, + { + "suppression": "dpto." + }, + { + "suppression": "jun." + }, + { + "suppression": "bco." + }, + { + "suppression": "Cía." + }, + { + "suppression": "Id." + }, + { + "suppression": "Mr." + }, + { + "suppression": "e.g." + }, + { + "suppression": "C.S." + }, + { + "suppression": "Excmas." + }, + { + "suppression": "Dª." + }, + { + "suppression": "Rvdo." + }, + { + "suppression": "Lic." + }, + { + "suppression": "cfr." + }, + { + "suppression": "Corp." + }, + { + "suppression": "Dto." + }, + { + "suppression": "Ilma." + }, + { + "suppression": "L." + }, + { + "suppression": "All." + }, + { + "suppression": "PP." + }, + { + "suppression": "d. C." + }, + { + "suppression": "Ltdo." + }, + { + "suppression": "mtro." + }, + { + "suppression": "Mrs." + }, + { + "suppression": "Desc." + }, + { + "suppression": "Avda." + }, + { + "suppression": "Exmas." + }, + { + "suppression": "a. e. c." + }, + { + "suppression": "Bien." + }, + { + "suppression": "Exmos." + }, + { + "suppression": "AA." + }, + { + "suppression": "Sto." + }, + { + "suppression": "CA." + }, + { + "suppression": "sept." + }, + { + "suppression": "Exc." + }, + { + "suppression": "c/c." + } + ] + } + } + } +} diff --git a/StockManMVC/bower_components/cldr-data/segments/fi/suppressions.json b/StockManMVC/bower_components/cldr-data/segments/fi/suppressions.json new file mode 100644 index 0000000..963b215 --- /dev/null +++ b/StockManMVC/bower_components/cldr-data/segments/fi/suppressions.json @@ -0,0 +1,30 @@ +{ + "segments": { + "identity": { + "version": { + "_number": "$Revision: 11914 $", + "_cldrVersion": "29" + }, + "language": "fi" + }, + "segmentations": { + "LineBreak": { + "variables": [ + { + "$BA": "[[$BA] - [\\u2010]]" + }, + { + "$HH": "[\\u2010]" + }, + { + "$HH": "($HH $X)" + } + ], + "segmentRules": { + "20.09": " $SP ÷ ($HY | $HH) $AL ", + "21.01": " × ($BA | $HH) " + } + } + } + } +} diff --git a/StockManMVC/bower_components/cldr-data/segments/fr/suppressions.json b/StockManMVC/bower_components/cldr-data/segments/fr/suppressions.json new file mode 100644 index 0000000..666dd90 --- /dev/null +++ b/StockManMVC/bower_components/cldr-data/segments/fr/suppressions.json @@ -0,0 +1,263 @@ +{ + "segments": { + "identity": { + "version": { + "_number": "$Revision: 11914 $", + "_cldrVersion": "29" + }, + "language": "fr" + }, + "segmentations": { + "SentenceBreak": { + "standard": [ + { + "suppression": "aux." + }, + { + "suppression": "config." + }, + { + "suppression": "collab." + }, + { + "suppression": "M." + }, + { + "suppression": "dim." + }, + { + "suppression": "imprim." + }, + { + "suppression": "oct." + }, + { + "suppression": "syst." + }, + { + "suppression": "bull." + }, + { + "suppression": "MM." + }, + { + "suppression": "doc." + }, + { + "suppression": "P.O." + }, + { + "suppression": "hôp." + }, + { + "suppression": "Mart." + }, + { + "suppression": "juil." + }, + { + "suppression": "broch." + }, + { + "suppression": "adr." + }, + { + "suppression": "symb." + }, + { + "suppression": "C." + }, + { + "suppression": "anc." + }, + { + "suppression": "voit." + }, + { + "suppression": "Jr." + }, + { + "suppression": "graph." + }, + { + "suppression": "dir." + }, + { + "suppression": "éd." + }, + { + "suppression": "fig." + }, + { + "suppression": "édit." + }, + { + "suppression": "niv." + }, + { + "suppression": "quart." + }, + { + "suppression": "cam." + }, + { + "suppression": "éval." + }, + { + "suppression": "anon." + }, + { + "suppression": "réf." + }, + { + "suppression": "Comm." + }, + { + "suppression": "Prof." + }, + { + "suppression": "févr." + }, + { + "suppression": "indus." + }, + { + "suppression": "DC." + }, + { + "suppression": "équiv." + }, + { + "suppression": "illustr." + }, + { + "suppression": "acoust." + }, + { + "suppression": "nov." + }, + { + "suppression": "L." + }, + { + "suppression": "All." + }, + { + "suppression": "U.S." + }, + { + "suppression": "S.M.A.R.T." + }, + { + "suppression": "sept." + }, + { + "suppression": "avr." + }, + { + "suppression": "jeu." + }, + { + "suppression": "dest." + }, + { + "suppression": "P.-D. G." + }, + { + "suppression": "ill." + }, + { + "suppression": "coll." + }, + { + "suppression": "encycl." + }, + { + "suppression": "mer." + }, + { + "suppression": "Desc." + }, + { + "suppression": "ven." + }, + { + "suppression": "P." + }, + { + "suppression": "lun." + }, + { + "suppression": "Inc." + }, + { + "suppression": "sam." + }, + { + "suppression": "D." + }, + { + "suppression": "append." + }, + { + "suppression": "Var." + }, + { + "suppression": "categ." + }, + { + "suppression": "janv." + }, + { + "suppression": "S.A." + }, + { + "suppression": "imm." + }, + { + "suppression": "U.S.A." + }, + { + "suppression": "mar." + }, + { + "suppression": "exempl." + }, + { + "suppression": "déc." + }, + { + "suppression": "ann." + }, + { + "suppression": "U." + }, + { + "suppression": "synth." + }, + { + "suppression": "dict." + }, + { + "suppression": "av. J.-C." + }, + { + "suppression": "W." + }, + { + "suppression": "Op." + }, + { + "suppression": "ap. J.-C." + }, + { + "suppression": "gouv." + }, + { + "suppression": "trav. publ." + } + ] + } + } + } +} diff --git a/StockManMVC/bower_components/cldr-data/segments/ja/suppressions.json b/StockManMVC/bower_components/cldr-data/segments/ja/suppressions.json new file mode 100644 index 0000000..c71fd5d --- /dev/null +++ b/StockManMVC/bower_components/cldr-data/segments/ja/suppressions.json @@ -0,0 +1,43 @@ +{ + "segments": { + "identity": { + "version": { + "_number": "$Revision: 11914 $", + "_cldrVersion": "29" + }, + "language": "ja" + }, + "segmentations": { + "LineBreak": { + "variables": [ + { + "$ID": "[[\\\\p{Line_Break=Ideographic}] [$CJ]]" + }, + { + "$NS": "\\\\p{Line_Break=Nonstarter}" + } + ] + }, + "WordBreak": { + "variables": [ + { + "$Hiragana": "\\\\p{Hiragana}" + }, + { + "$Hiragana": "($Hiragana $X)" + }, + { + "$Ideographic": "[[\\\\p{Ideographic}] [\\u3005 \\u3007 \\u303B]]" + }, + { + "$Ideographic": "($Ideographic $X)" + } + ], + "segmentRules": { + "13.05": " $Hiragana × $Hiragana ", + "13.06": " $Ideographic × $Ideographic " + } + } + } + } +} diff --git a/StockManMVC/bower_components/cldr-data/segments/pt/suppressions.json b/StockManMVC/bower_components/cldr-data/segments/pt/suppressions.json new file mode 100644 index 0000000..d8669eb --- /dev/null +++ b/StockManMVC/bower_components/cldr-data/segments/pt/suppressions.json @@ -0,0 +1,533 @@ +{ + "segments": { + "identity": { + "version": { + "_number": "$Revision: 11914 $", + "_cldrVersion": "29" + }, + "language": "pt" + }, + "segmentations": { + "SentenceBreak": { + "standard": [ + { + "suppression": "psicol." + }, + { + "suppression": "fig." + }, + { + "suppression": "compl." + }, + { + "suppression": "rep." + }, + { + "suppression": "cap." + }, + { + "suppression": "doc." + }, + { + "suppression": "fisiol." + }, + { + "suppression": "dipl." + }, + { + "suppression": "astron." + }, + { + "suppression": "port." + }, + { + "suppression": "eletrôn." + }, + { + "suppression": "geom." + }, + { + "suppression": "mov." + }, + { + "suppression": "ago." + }, + { + "suppression": "trad." + }, + { + "suppression": "arquit." + }, + { + "suppression": "dez." + }, + { + "suppression": "ed." + }, + { + "suppression": "apt." + }, + { + "suppression": "Exmo." + }, + { + "suppression": "col." + }, + { + "suppression": "ff." + }, + { + "suppression": "univ." + }, + { + "suppression": "res." + }, + { + "suppression": "R." + }, + { + "suppression": "transp." + }, + { + "suppression": "D.C" + }, + { + "suppression": "l." + }, + { + "suppression": "des." + }, + { + "suppression": "fev." + }, + { + "suppression": "abr." + }, + { + "suppression": "liter." + }, + { + "suppression": "lat." + }, + { + "suppression": "Dir." + }, + { + "suppression": "cf." + }, + { + "suppression": "adm." + }, + { + "suppression": "fot." + }, + { + "suppression": "p.m." + }, + { + "suppression": "P.M." + }, + { + "suppression": "créd." + }, + { + "suppression": "jur." + }, + { + "suppression": "com." + }, + { + "suppression": "anat." + }, + { + "suppression": "dir." + }, + { + "suppression": "end." + }, + { + "suppression": "fís." + }, + { + "suppression": "E." + }, + { + "suppression": "Est." + }, + { + "suppression": "cont." + }, + { + "suppression": "matem." + }, + { + "suppression": "Drs." + }, + { + "suppression": "gên." + }, + { + "suppression": "neol." + }, + { + "suppression": "pág." + }, + { + "suppression": "índ." + }, + { + "suppression": "Ltda." + }, + { + "suppression": "Exma." + }, + { + "suppression": "esp." + }, + { + "suppression": "ingl." + }, + { + "suppression": "tecnol." + }, + { + "suppression": "Mar." + }, + { + "suppression": "símb." + }, + { + "suppression": "Pe." + }, + { + "suppression": "pal." + }, + { + "suppression": "filos." + }, + { + "suppression": "V.T." + }, + { + "suppression": "fasc." + }, + { + "suppression": "vs." + }, + { + "suppression": "mai." + }, + { + "suppression": "S.A." + }, + { + "suppression": "profa." + }, + { + "suppression": "N.Sra." + }, + { + "suppression": "r.s.v.p." + }, + { + "suppression": "cel." + }, + { + "suppression": "mat." + }, + { + "suppression": "abrev." + }, + { + "suppression": "out." + }, + { + "suppression": "long." + }, + { + "suppression": "aux." + }, + { + "suppression": "arit." + }, + { + "suppression": "aer." + }, + { + "suppression": "jul." + }, + { + "suppression": "lin." + }, + { + "suppression": "S." + }, + { + "suppression": "méd." + }, + { + "suppression": "odontol." + }, + { + "suppression": "org." + }, + { + "suppression": "A.C." + }, + { + "suppression": "jun." + }, + { + "suppression": "déb." + }, + { + "suppression": "Av." + }, + { + "suppression": "álg." + }, + { + "suppression": "sup." + }, + { + "suppression": "fl." + }, + { + "suppression": "odont." + }, + { + "suppression": "caps." + }, + { + "suppression": "relat." + }, + { + "suppression": "organiz." + }, + { + "suppression": "hist." + }, + { + "suppression": "Fr." + }, + { + "suppression": "Ilmo." + }, + { + "suppression": "fem." + }, + { + "suppression": "ap." + }, + { + "suppression": "Ltd." + }, + { + "suppression": "pol." + }, + { + "suppression": "séc." + }, + { + "suppression": "prof." + }, + { + "suppression": "cx." + }, + { + "suppression": "nov." + }, + { + "suppression": "quím." + }, + { + "suppression": "mús." + }, + { + "suppression": "agric." + }, + { + "suppression": "mar." + }, + { + "suppression": "W.C." + }, + { + "suppression": "fr." + }, + { + "suppression": "cat." + }, + { + "suppression": "jan." + }, + { + "suppression": "pron." + }, + { + "suppression": "rel." + }, + { + "suppression": "autom." + }, + { + "suppression": "Sta." + }, + { + "suppression": "Dra." + }, + { + "suppression": "p." + }, + { + "suppression": "tel." + }, + { + "suppression": "div." + }, + { + "suppression": "p. ex." + }, + { + "suppression": "a.C." + }, + { + "suppression": "bras." + }, + { + "suppression": "Alm." + }, + { + "suppression": "Dr." + }, + { + "suppression": "comp." + }, + { + "suppression": "pq." + }, + { + "suppression": "arqueol." + }, + { + "suppression": "náut." + }, + { + "suppression": "biogr." + }, + { + "suppression": "f." + }, + { + "suppression": "círc." + }, + { + "suppression": "fac." + }, + { + "suppression": "d.C." + }, + { + "suppression": "apart." + }, + { + "suppression": "ex." + }, + { + "suppression": "Jr." + }, + { + "suppression": "set." + }, + { + "suppression": "tec." + }, + { + "suppression": "sociol." + }, + { + "suppression": "gram." + }, + { + "suppression": "ind." + }, + { + "suppression": "Ilma." + }, + { + "suppression": "vol." + }, + { + "suppression": "eng." + }, + { + "suppression": "rod." + }, + { + "suppression": "Ph.D." + }, + { + "suppression": "Dras." + }, + { + "suppression": "pp." + }, + { + "suppression": "elem." + }, + { + "suppression": "máq." + }, + { + "suppression": "cód." + }, + { + "suppression": "eletr." + }, + { + "suppression": "prod." + }, + { + "suppression": "ref." + }, + { + "suppression": "fil." + }, + { + "suppression": "a.m." + }, + { + "suppression": "A.M" + }, + { + "suppression": "obs." + }, + { + "suppression": "N.T." + }, + { + "suppression": "contab." + }, + { + "suppression": "Sto." + }, + { + "suppression": "lit." + }, + { + "suppression": "educ." + }, + { + "suppression": "rementente" + }, + { + "suppression": "desc." + }, + { + "suppression": "próx." + } + ] + } + } + } +} diff --git a/StockManMVC/bower_components/cldr-data/segments/root/suppressions.json b/StockManMVC/bower_components/cldr-data/segments/root/suppressions.json new file mode 100644 index 0000000..a3c61ee --- /dev/null +++ b/StockManMVC/bower_components/cldr-data/segments/root/suppressions.json @@ -0,0 +1,562 @@ +{ + "segments": { + "identity": { + "version": { + "_number": "$Revision: 12321 $", + "_cldrVersion": "29" + }, + "language": "root" + }, + "segmentations": { + "GraphemeClusterBreak": { + "variables": [ + { + "$CR": "\\\\p{Grapheme_Cluster_Break=CR}" + }, + { + "$LF": "\\\\p{Grapheme_Cluster_Break=LF}" + }, + { + "$Control": "\\\\p{Grapheme_Cluster_Break=Control}" + }, + { + "$Extend": "\\\\p{Grapheme_Cluster_Break=Extend}" + }, + { + "$SpacingMark": "\\\\p{Grapheme_Cluster_Break=SpacingMark}" + }, + { + "$L": "\\\\p{Grapheme_Cluster_Break=L}" + }, + { + "$V": "\\\\p{Grapheme_Cluster_Break=V}" + }, + { + "$T": "\\\\p{Grapheme_Cluster_Break=T}" + }, + { + "$LV": "\\\\p{Grapheme_Cluster_Break=LV}" + }, + { + "$LVT": "\\\\p{Grapheme_Cluster_Break=LVT}" + }, + { + "$Regional_Indicator": "\\\\p{Grapheme_Cluster_Break=Regional_Indicator}" + } + ], + "segmentRules": { + "3": " $CR × $LF ", + "4": " ( $Control | $CR | $LF ) ÷ ", + "5": " ÷ ( $Control | $CR | $LF ) ", + "6": " $L × ( $L | $V | $LV | $LVT ) ", + "7": " ( $LV | $V ) × ( $V | $T ) ", + "8": " ( $LVT | $T) × $T ", + "8.1": " $Regional_Indicator × $Regional_Indicator ", + "9": " × $Extend ", + "9.1": " × $SpacingMark " + } + }, + "LineBreak": { + "variables": [ + { + "$AI": "\\\\p{Line_Break=Ambiguous}" + }, + { + "$AL": "\\\\p{Line_Break=Alphabetic}" + }, + { + "$B2": "\\\\p{Line_Break=Break_Both}" + }, + { + "$BA": "\\\\p{Line_Break=Break_After}" + }, + { + "$BB": "\\\\p{Line_Break=Break_Before}" + }, + { + "$BK": "\\\\p{Line_Break=Mandatory_Break}" + }, + { + "$CB": "\\\\p{Line_Break=Contingent_Break}" + }, + { + "$CL": "\\\\p{Line_Break=Close_Punctuation}" + }, + { + "$CP": "\\\\p{Line_Break=CP}" + }, + { + "$CM": "\\\\p{Line_Break=Combining_Mark}" + }, + { + "$CR": "\\\\p{Line_Break=Carriage_Return}" + }, + { + "$EX": "\\\\p{Line_Break=Exclamation}" + }, + { + "$GL": "\\\\p{Line_Break=Glue}" + }, + { + "$H2": "\\\\p{Line_Break=H2}" + }, + { + "$H3": "\\\\p{Line_Break=H3}" + }, + { + "$HL": "\\\\p{Line_Break=HL}" + }, + { + "$HY": "\\\\p{Line_Break=Hyphen}" + }, + { + "$ID": "\\\\p{Line_Break=Ideographic}" + }, + { + "$IN": "\\\\p{Line_Break=Inseparable}" + }, + { + "$IS": "\\\\p{Line_Break=Infix_Numeric}" + }, + { + "$JL": "\\\\p{Line_Break=JL}" + }, + { + "$JT": "\\\\p{Line_Break=JT}" + }, + { + "$JV": "\\\\p{Line_Break=JV}" + }, + { + "$LF": "\\\\p{Line_Break=Line_Feed}" + }, + { + "$NL": "\\\\p{Line_Break=Next_Line}" + }, + { + "$NS": "\\\\p{Line_Break=Nonstarter}" + }, + { + "$NU": "\\\\p{Line_Break=Numeric}" + }, + { + "$OP": "\\\\p{Line_Break=Open_Punctuation}" + }, + { + "$PO": "\\\\p{Line_Break=Postfix_Numeric}" + }, + { + "$PR": "\\\\p{Line_Break=Prefix_Numeric}" + }, + { + "$QU": "\\\\p{Line_Break=Quotation}" + }, + { + "$SA": "\\\\p{Line_Break=Complex_Context}" + }, + { + "$SG": "\\\\p{Line_Break=Surrogate}" + }, + { + "$SP": "\\\\p{Line_Break=Space}" + }, + { + "$SY": "\\\\p{Line_Break=Break_Symbols}" + }, + { + "$WJ": "\\\\p{Line_Break=Word_Joiner}" + }, + { + "$XX": "\\\\p{Line_Break=Unknown}" + }, + { + "$ZW": "\\\\p{Line_Break=ZWSpace}" + }, + { + "$CJ": "\\\\p{Line_Break=Conditional_Japanese_Starter}" + }, + { + "$RI": "\\\\p{Line_Break=Regional_Indicator}" + }, + { + "$AL": "[$AI $AL $XX $SA $SG]" + }, + { + "$NS": "[$NS $CJ]" + }, + { + "$X": "$CM*" + }, + { + "$Spec1_": "[$SP $BK $CR $LF $NL $ZW]" + }, + { + "$Spec2_": "[^ $SP $BK $CR $LF $NL $ZW]" + }, + { + "$Spec3a_": "[^ $SP $BA $HY $CM]" + }, + { + "$Spec3b_": "[^ $BA $HY $CM]" + }, + { + "$Spec4_": "[^ $NU $CM]" + }, + { + "$AI": "($AI $X)" + }, + { + "$AL": "($AL $X)" + }, + { + "$B2": "($B2 $X)" + }, + { + "$BA": "($BA $X)" + }, + { + "$BB": "($BB $X)" + }, + { + "$CB": "($CB $X)" + }, + { + "$CL": "($CL $X)" + }, + { + "$CP": "($CP $X)" + }, + { + "$CM": "($CM $X)" + }, + { + "$CM": "($CM $X)" + }, + { + "$GL": "($GL $X)" + }, + { + "$H2": "($H2 $X)" + }, + { + "$H3": "($H3 $X)" + }, + { + "$HL": "($HL $X)" + }, + { + "$HY": "($HY $X)" + }, + { + "$ID": "($ID $X)" + }, + { + "$IN": "($IN $X)" + }, + { + "$IS": "($IS $X)" + }, + { + "$JL": "($JL $X)" + }, + { + "$JT": "($JT $X)" + }, + { + "$JV": "($JV $X)" + }, + { + "$NS": "($NS $X)" + }, + { + "$NU": "($NU $X)" + }, + { + "$OP": "($OP $X)" + }, + { + "$PO": "($PO $X)" + }, + { + "$PR": "($PR $X)" + }, + { + "$QU": "($QU $X)" + }, + { + "$SA": "($SA $X)" + }, + { + "$SG": "($SG $X)" + }, + { + "$SY": "($SY $X)" + }, + { + "$WJ": "($WJ $X)" + }, + { + "$XX": "($XX $X)" + }, + { + "$RI": "($RI $X)" + }, + { + "$AL": "($AL | ^ $CM | (?<=$Spec1_) $CM)" + } + ], + "segmentRules": { + "4": " $BK ÷ ", + "5.01": " $CR × $LF ", + "5.02": " $CR ÷ ", + "5.03": " $LF ÷ ", + "5.04": " $NL ÷ ", + "6": " × ( $BK | $CR | $LF | $NL ) ", + "7.01": " × $SP ", + "7.02": " × $ZW ", + "8": " $ZW $SP* ÷ ", + "9": " $Spec2_ × $CM ", + "11.01": " × $WJ ", + "11.02": " $WJ × ", + "12": " $GL × ", + "12.1": " $Spec3a_ × $GL ", + "12.2": " $Spec3b_ $CM+ × $GL ", + "12.3": " ^ $CM+ × $GL ", + "13.01": " × $EX ", + "13.02": " $Spec4_ × ($CL | $CP | $IS | $SY) ", + "13.03": " $Spec4_ $CM+ × ($CL | $CP | $IS | $SY) ", + "13.04": " ^ $CM+ × ($CL | $CP | $IS | $SY) ", + "14": " $OP $SP* × ", + "15": " $QU $SP* × $OP ", + "16": " ($CL | $CP) $SP* × $NS ", + "17": " $B2 $SP* × $B2 ", + "18": " $SP ÷ ", + "19.01": " × $QU ", + "19.02": " $QU × ", + "20.01": " ÷ $CB ", + "20.02": " $CB ÷ ", + "21.01": " × $BA ", + "21.02": " × $HY ", + "21.03": " × $NS ", + "21.04": " $BB × ", + "21.1": " $HL ($HY | $BA) × ", + "21.2": " $SY × $HL ", + "22.01": " ($AL | $HL) × $IN ", + "22.02": " $ID × $IN ", + "22.03": " $IN × $IN ", + "22.04": " $NU × $IN ", + "22.05": " $EX × $IN ", + "23.01": " $ID × $PO ", + "23.02": " ($AL | $HL) × $NU ", + "23.03": " $NU × ($AL | $HL) ", + "24.01": " $PR × $ID ", + "24.02": " $PR × ($AL | $HL) ", + "24.03": " $PO × ($AL | $HL) ", + "25.01": " ($PR | $PO) × ( $OP | $HY )? $NU ", + "25.02": " ( $OP | $HY ) × $NU ", + "25.03": " $NU × ($NU | $SY | $IS) ", + "25.04": " $NU ($NU | $SY | $IS)* × ($NU | $SY | $IS | $CL | $CP) ", + "25.05": " $NU ($NU | $SY | $IS)* ($CL | $CP)? × ($PO | $PR) ", + "26.01": " $JL × $JL | $JV | $H2 | $H3 ", + "26.02": " $JV | $H2 × $JV | $JT ", + "26.03": " $JT | $H3 × $JT ", + "27.01": " $JL | $JV | $JT | $H2 | $H3 × $IN ", + "27.02": " $JL | $JV | $JT | $H2 | $H3 × $PO ", + "27.03": " $PR × $JL | $JV | $JT | $H2 | $H3 ", + "28": " ($AL | $HL) × ($AL | $HL) ", + "29": " $IS × ($AL | $HL) ", + "30.01": " ($AL | $HL | $NU) × $OP ", + "30.02": " $CP × ($AL | $HL | $NU) ", + "30.11": " $RI × $RI " + } + }, + "SentenceBreak": { + "variables": [ + { + "$CR": "\\\\p{Sentence_Break=CR}" + }, + { + "$LF": "\\\\p{Sentence_Break=LF}" + }, + { + "$Extend": "\\\\p{Sentence_Break=Extend}" + }, + { + "$Format": "\\\\p{Sentence_Break=Format}" + }, + { + "$Sep": "\\\\p{Sentence_Break=Sep}" + }, + { + "$Sp": "\\\\p{Sentence_Break=Sp}" + }, + { + "$Lower": "\\\\p{Sentence_Break=Lower}" + }, + { + "$Upper": "\\\\p{Sentence_Break=Upper}" + }, + { + "$OLetter": "\\\\p{Sentence_Break=OLetter}" + }, + { + "$Numeric": "\\\\p{Sentence_Break=Numeric}" + }, + { + "$ATerm": "\\\\p{Sentence_Break=ATerm}" + }, + { + "$STerm": "\\\\p{Sentence_Break=STerm}" + }, + { + "$Close": "\\\\p{Sentence_Break=Close}" + }, + { + "$SContinue": "\\\\p{Sentence_Break=SContinue}" + }, + { + "$Any": "." + }, + { + "$FE": "[$Format $Extend]" + }, + { + "$NotPreLower_": "[^ $OLetter $Upper $Lower $Sep $CR $LF $STerm $ATerm]" + }, + { + "$Sp": "($Sp $FE*)" + }, + { + "$Lower": "($Lower $FE*)" + }, + { + "$Upper": "($Upper $FE*)" + }, + { + "$OLetter": "($OLetter $FE*)" + }, + { + "$Numeric": "($Numeric $FE*)" + }, + { + "$ATerm": "($ATerm $FE*)" + }, + { + "$STerm": "($STerm $FE*)" + }, + { + "$Close": "($Close $FE*)" + }, + { + "$SContinue": "($SContinue $FE*)" + } + ], + "segmentRules": { + "3": " $CR × $LF ", + "4": " ($Sep | $CR | $LF) ÷ ", + "5": " × [$Format $Extend] ", + "6": " $ATerm × $Numeric ", + "7": " ($Upper | $Lower) $ATerm × $Upper ", + "8": " $ATerm $Close* $Sp* × $NotPreLower_* $Lower ", + "8.1": " ($STerm | $ATerm) $Close* $Sp* × ($SContinue | $STerm | $ATerm) ", + "9": " ( $STerm | $ATerm ) $Close* × ( $Close | $Sp | $Sep | $CR | $LF ) ", + "10": " ( $STerm | $ATerm ) $Close* $Sp* × ( $Sp | $Sep | $CR | $LF ) ", + "11": " ( $STerm | $ATerm ) $Close* $Sp* ($Sep | $CR | $LF)? ÷ ", + "12": " × $Any " + }, + "standard": {} + }, + "WordBreak": { + "variables": [ + { + "$CR": "\\\\p{Word_Break=CR}" + }, + { + "$LF": "\\\\p{Word_Break=LF}" + }, + { + "$Newline": "\\\\p{Word_Break=Newline}" + }, + { + "$Extend": "\\\\p{Word_Break=Extend}" + }, + { + "$Format": "\\\\p{Word_Break=Format}" + }, + { + "$Katakana": "\\\\p{Word_Break=Katakana}" + }, + { + "$ALetter": "\\\\p{Word_Break=ALetter}" + }, + { + "$MidLetter": "\\\\p{Word_Break=MidLetter}" + }, + { + "$MidNum": "\\\\p{Word_Break=MidNum}" + }, + { + "$MidNumLet": "\\\\p{Word_Break=MidNumLet}" + }, + { + "$Numeric": "\\\\p{Word_Break=Numeric}" + }, + { + "$ExtendNumLet": "\\\\p{Word_Break=ExtendNumLet}" + }, + { + "$Regional_Indicator": "\\\\p{Word_Break=Regional_Indicator}" + }, + { + "$FE": "[$Format $Extend]" + }, + { + "$NotBreak_": "[^ $Newline $CR $LF ]" + }, + { + "$Katakana": "($Katakana $FE*)" + }, + { + "$ALetter": "($ALetter $FE*)" + }, + { + "$MidLetter": "($MidLetter $FE*)" + }, + { + "$MidNum": "($MidNum $FE*)" + }, + { + "$MidNumLet": "($MidNumLet $FE*)" + }, + { + "$Numeric": "($Numeric $FE*)" + }, + { + "$ExtendNumLet": "($ExtendNumLet $FE*)" + }, + { + "$Regional_Indicator": "($Regional_Indicator $FE*)" + } + ], + "segmentRules": { + "3": " $CR × $LF ", + "3.1": " ($Newline | $CR | $LF) ÷ ", + "3.2": " ÷ ($Newline | $CR | $LF) ", + "4": " $NotBreak_ × [$Format $Extend] ", + "5": " $ALetter × $ALetter ", + "6": " $ALetter × ($MidLetter | $MidNumLet) $ALetter ", + "7": " $ALetter ($MidLetter | $MidNumLet) × $ALetter ", + "8": " $Numeric × $Numeric ", + "9": " $ALetter × $Numeric ", + "10": " $Numeric × $ALetter ", + "11": " $Numeric ($MidNum | $MidNumLet) × $Numeric ", + "12": " $Numeric × ($MidNum | $MidNumLet) $Numeric ", + "13": " $Katakana × $Katakana ", + "13.1": " ($ALetter | $Numeric | $Katakana | $ExtendNumLet) × $ExtendNumLet ", + "13.2": " $ExtendNumLet × ($ALetter | $Numeric | $Katakana) ", + "13.3": " $Regional_Indicator × $Regional_Indicator " + } + } + } + } +} diff --git a/StockManMVC/bower_components/cldr-data/segments/ru/suppressions.json b/StockManMVC/bower_components/cldr-data/segments/ru/suppressions.json new file mode 100644 index 0000000..4ae5e13 --- /dev/null +++ b/StockManMVC/bower_components/cldr-data/segments/ru/suppressions.json @@ -0,0 +1,71 @@ +{ + "segments": { + "identity": { + "version": { + "_number": "$Revision: 11914 $", + "_cldrVersion": "29" + }, + "language": "ru" + }, + "segmentations": { + "SentenceBreak": { + "standard": [ + { + "suppression": "руб." + }, + { + "suppression": "янв." + }, + { + "suppression": "до н. э." + }, + { + "suppression": "сент." + }, + { + "suppression": "тел." + }, + { + "suppression": "дек." + }, + { + "suppression": "февр." + }, + { + "suppression": "нояб." + }, + { + "suppression": "апр." + }, + { + "suppression": "н. э." + }, + { + "suppression": "окт." + }, + { + "suppression": "тыс." + }, + { + "suppression": "авг." + }, + { + "suppression": "проф." + }, + { + "suppression": "н.э." + }, + { + "suppression": "кв." + }, + { + "suppression": "ул." + }, + { + "suppression": "отд." + } + ] + } + } + } +} diff --git a/StockManMVC/bower_components/cldr-data/segments/zh-Hant/suppressions.json b/StockManMVC/bower_components/cldr-data/segments/zh-Hant/suppressions.json new file mode 100644 index 0000000..ba398e1 --- /dev/null +++ b/StockManMVC/bower_components/cldr-data/segments/zh-Hant/suppressions.json @@ -0,0 +1,23 @@ +{ + "segments": { + "identity": { + "version": { + "_number": "$Revision: 11914 $", + "_cldrVersion": "29" + }, + "language": "zh-Hant" + }, + "segmentations": { + "LineBreak": { + "variables": [ + { + "$ID": "[[\\\\p{Line_Break=Ideographic}] [$CJ]]" + }, + { + "$NS": "\\\\p{Line_Break=Nonstarter}" + } + ] + } + } + } +} diff --git a/StockManMVC/bower_components/cldr-data/segments/zh/suppressions.json b/StockManMVC/bower_components/cldr-data/segments/zh/suppressions.json new file mode 100644 index 0000000..37efe7c --- /dev/null +++ b/StockManMVC/bower_components/cldr-data/segments/zh/suppressions.json @@ -0,0 +1,23 @@ +{ + "segments": { + "identity": { + "version": { + "_number": "$Revision: 11914 $", + "_cldrVersion": "29" + }, + "language": "zh" + }, + "segmentations": { + "LineBreak": { + "variables": [ + { + "$ID": "[[\\\\p{Line_Break=Ideographic}] [$CJ]]" + }, + { + "$NS": "\\\\p{Line_Break=Nonstarter}" + } + ] + } + } + } +} diff --git a/StockManMVC/bower_components/cldrjs/dist/cldr.js b/StockManMVC/bower_components/cldrjs/dist/cldr.js new file mode 100644 index 0000000..956afca --- /dev/null +++ b/StockManMVC/bower_components/cldrjs/dist/cldr.js @@ -0,0 +1,676 @@ +/** + * CLDR JavaScript Library v0.4.4 + * http://jquery.com/ + * + * Copyright 2013 Rafael Xavier de Souza + * Released under the MIT license + * http://jquery.org/license + * + * Date: 2016-01-18T12:25Z + */ +/*! + * CLDR JavaScript Library v0.4.4 2016-01-18T12:25Z MIT license © Rafael Xavier + * http://git.io/h4lmVg + */ +(function( root, factory ) { + + if ( typeof define === "function" && define.amd ) { + // AMD. + define( factory ); + } else if ( typeof module === "object" && typeof module.exports === "object" ) { + // Node. CommonJS. + module.exports = factory(); + } else { + // Global + root.Cldr = factory(); + } + +}( this, function() { + + + var arrayIsArray = Array.isArray || function( obj ) { + return Object.prototype.toString.call( obj ) === "[object Array]"; + }; + + + + + var pathNormalize = function( path, attributes ) { + if ( arrayIsArray( path ) ) { + path = path.join( "/" ); + } + if ( typeof path !== "string" ) { + throw new Error( "invalid path \"" + path + "\"" ); + } + // 1: Ignore leading slash `/` + // 2: Ignore leading `cldr/` + path = path + .replace( /^\// , "" ) /* 1 */ + .replace( /^cldr\// , "" ); /* 2 */ + + // Replace {attribute}'s + path = path.replace( /{[a-zA-Z]+}/g, function( name ) { + name = name.replace( /^{([^}]*)}$/, "$1" ); + return attributes[ name ]; + }); + + return path.split( "/" ); + }; + + + + + var arraySome = function( array, callback ) { + var i, length; + if ( array.some ) { + return array.some( callback ); + } + for ( i = 0, length = array.length; i < length; i++ ) { + if ( callback( array[ i ], i, array ) ) { + return true; + } + } + return false; + }; + + + + + /** + * Return the maximized language id as defined in + * http://www.unicode.org/reports/tr35/#Likely_Subtags + * 1. Canonicalize. + * 1.1 Make sure the input locale is in canonical form: uses the right + * separator, and has the right casing. + * TODO Right casing? What df? It seems languages are lowercase, scripts are + * Capitalized, territory is uppercase. I am leaving this as an exercise to + * the user. + * + * 1.2 Replace any deprecated subtags with their canonical values using the + * data in supplemental metadata. Use the first value in the + * replacement list, if it exists. Language tag replacements may have multiple + * parts, such as "sh" ➞ "sr_Latn" or mo" ➞ "ro_MD". In such a case, the + * original script and/or region are retained if there is one. Thus + * "sh_Arab_AQ" ➞ "sr_Arab_AQ", not "sr_Latn_AQ". + * TODO What data? + * + * 1.3 If the tag is grandfathered (see in the supplemental data), then return it. + * TODO grandfathered? + * + * 1.4 Remove the script code 'Zzzz' and the region code 'ZZ' if they occur. + * 1.5 Get the components of the cleaned-up source tag (languages, scripts, + * and regions), plus any variants and extensions. + * 2. Lookup. Lookup each of the following in order, and stop on the first + * match: + * 2.1 languages_scripts_regions + * 2.2 languages_regions + * 2.3 languages_scripts + * 2.4 languages + * 2.5 und_scripts + * 3. Return + * 3.1 If there is no match, either return an error value, or the match for + * "und" (in APIs where a valid language tag is required). + * 3.2 Otherwise there is a match = languagem_scriptm_regionm + * 3.3 Let xr = xs if xs is not empty, and xm otherwise. + * 3.4 Return the language tag composed of languager _ scriptr _ regionr + + * variants + extensions. + * + * @subtags [Array] normalized language id subtags tuple (see init.js). + */ + var coreLikelySubtags = function( Cldr, cldr, subtags, options ) { + var match, matchFound, + language = subtags[ 0 ], + script = subtags[ 1 ], + sep = Cldr.localeSep, + territory = subtags[ 2 ], + variantsAndUnicodeLocaleExtensions = subtags.slice( 3, 4 ); + options = options || {}; + + // Skip if (language, script, territory) is not empty [3.3] + if ( language !== "und" && script !== "Zzzz" && territory !== "ZZ" ) { + return [ language, script, territory ].concat( variantsAndUnicodeLocaleExtensions ); + } + + // Skip if no supplemental likelySubtags data is present + if ( typeof cldr.get( "supplemental/likelySubtags" ) === "undefined" ) { + return; + } + + // [2] + matchFound = arraySome([ + [ language, script, territory ], + [ language, territory ], + [ language, script ], + [ language ], + [ "und", script ] + ], function( test ) { + return match = !(/\b(Zzzz|ZZ)\b/).test( test.join( sep ) ) /* [1.4] */ && cldr.get( [ "supplemental/likelySubtags", test.join( sep ) ] ); + }); + + // [3] + if ( matchFound ) { + // [3.2 .. 3.4] + match = match.split( sep ); + return [ + language !== "und" ? language : match[ 0 ], + script !== "Zzzz" ? script : match[ 1 ], + territory !== "ZZ" ? territory : match[ 2 ] + ].concat( + variantsAndUnicodeLocaleExtensions + ); + } else if ( options.force ) { + // [3.1.2] + return cldr.get( "supplemental/likelySubtags/und" ).split( sep ); + } else { + // [3.1.1] + return; + } + }; + + + + /** + * Given a locale, remove any fields that Add Likely Subtags would add. + * http://www.unicode.org/reports/tr35/#Likely_Subtags + * 1. First get max = AddLikelySubtags(inputLocale). If an error is signaled, + * return it. + * 2. Remove the variants from max. + * 3. Then for trial in {language, language _ region, language _ script}. If + * AddLikelySubtags(trial) = max, then return trial + variants. + * 4. If you do not get a match, return max + variants. + * + * @maxLanguageId [Array] maxLanguageId tuple (see init.js). + */ + var coreRemoveLikelySubtags = function( Cldr, cldr, maxLanguageId ) { + var match, matchFound, + language = maxLanguageId[ 0 ], + script = maxLanguageId[ 1 ], + territory = maxLanguageId[ 2 ], + variants = maxLanguageId[ 3 ]; + + // [3] + matchFound = arraySome([ + [ [ language, "Zzzz", "ZZ" ], [ language ] ], + [ [ language, "Zzzz", territory ], [ language, territory ] ], + [ [ language, script, "ZZ" ], [ language, script ] ] + ], function( test ) { + var result = coreLikelySubtags( Cldr, cldr, test[ 0 ] ); + match = test[ 1 ]; + return result && result[ 0 ] === maxLanguageId[ 0 ] && + result[ 1 ] === maxLanguageId[ 1 ] && + result[ 2 ] === maxLanguageId[ 2 ]; + }); + + if ( matchFound ) { + if ( variants ) { + match.push( variants ); + } + return match; + } + + // [4] + return maxLanguageId; + }; + + + + + /** + * subtags( locale ) + * + * @locale [String] + */ + var coreSubtags = function( locale ) { + var aux, unicodeLanguageId, + subtags = []; + + locale = locale.replace( /_/, "-" ); + + // Unicode locale extensions. + aux = locale.split( "-u-" ); + if ( aux[ 1 ] ) { + aux[ 1 ] = aux[ 1 ].split( "-t-" ); + locale = aux[ 0 ] + ( aux[ 1 ][ 1 ] ? "-t-" + aux[ 1 ][ 1 ] : ""); + subtags[ 4 /* unicodeLocaleExtensions */ ] = aux[ 1 ][ 0 ]; + } + + // TODO normalize transformed extensions. Currently, skipped. + // subtags[ x ] = locale.split( "-t-" )[ 1 ]; + unicodeLanguageId = locale.split( "-t-" )[ 0 ]; + + // unicode_language_id = "root" + // | unicode_language_subtag + // (sep unicode_script_subtag)? + // (sep unicode_region_subtag)? + // (sep unicode_variant_subtag)* ; + // + // Although unicode_language_subtag = alpha{2,8}, I'm using alpha{2,3}. Because, there's no language on CLDR lengthier than 3. + aux = unicodeLanguageId.match( /^(([a-z]{2,3})(-([A-Z][a-z]{3}))?(-([A-Z]{2}|[0-9]{3}))?)((-([a-zA-Z0-9]{5,8}|[0-9][a-zA-Z0-9]{3}))*)$|^(root)$/ ); + if ( aux === null ) { + return [ "und", "Zzzz", "ZZ" ]; + } + subtags[ 0 /* language */ ] = aux[ 10 ] /* root */ || aux[ 2 ] || "und"; + subtags[ 1 /* script */ ] = aux[ 4 ] || "Zzzz"; + subtags[ 2 /* territory */ ] = aux[ 6 ] || "ZZ"; + if ( aux[ 7 ] && aux[ 7 ].length ) { + subtags[ 3 /* variant */ ] = aux[ 7 ].slice( 1 ) /* remove leading "-" */; + } + + // 0: language + // 1: script + // 2: territory (aka region) + // 3: variant + // 4: unicodeLocaleExtensions + return subtags; + }; + + + + + var arrayForEach = function( array, callback ) { + var i, length; + if ( array.forEach ) { + return array.forEach( callback ); + } + for ( i = 0, length = array.length; i < length; i++ ) { + callback( array[ i ], i, array ); + } + }; + + + + + /** + * bundleLookup( minLanguageId ) + * + * @Cldr [Cldr class] + * + * @cldr [Cldr instance] + * + * @minLanguageId [String] requested languageId after applied remove likely subtags. + */ + var bundleLookup = function( Cldr, cldr, minLanguageId ) { + var availableBundleMap = Cldr._availableBundleMap, + availableBundleMapQueue = Cldr._availableBundleMapQueue; + + if ( availableBundleMapQueue.length ) { + arrayForEach( availableBundleMapQueue, function( bundle ) { + var existing, maxBundle, minBundle, subtags; + subtags = coreSubtags( bundle ); + maxBundle = coreLikelySubtags( Cldr, cldr, subtags ); + minBundle = coreRemoveLikelySubtags( Cldr, cldr, maxBundle ); + minBundle = minBundle.join( Cldr.localeSep ); + existing = availableBundleMapQueue[ minBundle ]; + if ( existing && existing.length < bundle.length ) { + return; + } + availableBundleMap[ minBundle ] = bundle; + }); + Cldr._availableBundleMapQueue = []; + } + + return availableBundleMap[ minLanguageId ] || null; + }; + + + + + var objectKeys = function( object ) { + var i, + result = []; + + if ( Object.keys ) { + return Object.keys( object ); + } + + for ( i in object ) { + result.push( i ); + } + + return result; + }; + + + + + var createError = function( code, attributes ) { + var error, message; + + message = code + ( attributes && JSON ? ": " + JSON.stringify( attributes ) : "" ); + error = new Error( message ); + error.code = code; + + // extend( error, attributes ); + arrayForEach( objectKeys( attributes ), function( attribute ) { + error[ attribute ] = attributes[ attribute ]; + }); + + return error; + }; + + + + + var validate = function( code, check, attributes ) { + if ( !check ) { + throw createError( code, attributes ); + } + }; + + + + + var validatePresence = function( value, name ) { + validate( "E_MISSING_PARAMETER", typeof value !== "undefined", { + name: name + }); + }; + + + + + var validateType = function( value, name, check, expected ) { + validate( "E_INVALID_PAR_TYPE", check, { + expected: expected, + name: name, + value: value + }); + }; + + + + + var validateTypePath = function( value, name ) { + validateType( value, name, typeof value === "string" || arrayIsArray( value ), "String or Array" ); + }; + + + + + /** + * Function inspired by jQuery Core, but reduced to our use case. + */ + var isPlainObject = function( obj ) { + return obj !== null && "" + obj === "[object Object]"; + }; + + + + + var validateTypePlainObject = function( value, name ) { + validateType( value, name, typeof value === "undefined" || isPlainObject( value ), "Plain Object" ); + }; + + + + + var validateTypeString = function( value, name ) { + validateType( value, name, typeof value === "string", "a string" ); + }; + + + + + // @path: normalized path + var resourceGet = function( data, path ) { + var i, + node = data, + length = path.length; + + for ( i = 0; i < length - 1; i++ ) { + node = node[ path[ i ] ]; + if ( !node ) { + return undefined; + } + } + return node[ path[ i ] ]; + }; + + + + + /** + * setAvailableBundles( Cldr, json ) + * + * @Cldr [Cldr class] + * + * @json resolved/unresolved cldr data. + * + * Set available bundles queue based on passed json CLDR data. Considers a bundle as any String at /main/{bundle}. + */ + var coreSetAvailableBundles = function( Cldr, json ) { + var bundle, + availableBundleMapQueue = Cldr._availableBundleMapQueue, + main = resourceGet( json, [ "main" ] ); + + if ( main ) { + for ( bundle in main ) { + if ( main.hasOwnProperty( bundle ) && bundle !== "root" && + availableBundleMapQueue.indexOf( bundle ) === -1 ) { + availableBundleMapQueue.push( bundle ); + } + } + } + }; + + + + var alwaysArray = function( somethingOrArray ) { + return arrayIsArray( somethingOrArray ) ? somethingOrArray : [ somethingOrArray ]; + }; + + + var jsonMerge = (function() { + + // Returns new deeply merged JSON. + // + // Eg. + // merge( { a: { b: 1, c: 2 } }, { a: { b: 3, d: 4 } } ) + // -> { a: { b: 3, c: 2, d: 4 } } + // + // @arguments JSON's + // + var merge = function() { + var destination = {}, + sources = [].slice.call( arguments, 0 ); + arrayForEach( sources, function( source ) { + var prop; + for ( prop in source ) { + if ( prop in destination && typeof destination[ prop ] === "object" && !arrayIsArray( destination[ prop ] ) ) { + + // Merge Objects + destination[ prop ] = merge( destination[ prop ], source[ prop ] ); + + } else { + + // Set new values + destination[ prop ] = source[ prop ]; + + } + } + }); + return destination; + }; + + return merge; + +}()); + + + /** + * load( Cldr, source, jsons ) + * + * @Cldr [Cldr class] + * + * @source [Object] + * + * @jsons [arguments] + */ + var coreLoad = function( Cldr, source, jsons ) { + var i, j, json; + + validatePresence( jsons[ 0 ], "json" ); + + // Support arbitrary parameters, e.g., `Cldr.load({...}, {...})`. + for ( i = 0; i < jsons.length; i++ ) { + + // Support array parameters, e.g., `Cldr.load([{...}, {...}])`. + json = alwaysArray( jsons[ i ] ); + + for ( j = 0; j < json.length; j++ ) { + validateTypePlainObject( json[ j ], "json" ); + source = jsonMerge( source, json[ j ] ); + coreSetAvailableBundles( Cldr, json[ j ] ); + } + } + + return source; + }; + + + + var itemGetResolved = function( Cldr, path, attributes ) { + // Resolve path + var normalizedPath = pathNormalize( path, attributes ); + + return resourceGet( Cldr._resolved, normalizedPath ); + }; + + + + + /** + * new Cldr() + */ + var Cldr = function( locale ) { + this.init( locale ); + }; + + // Build optimization hack to avoid duplicating functions across modules. + Cldr._alwaysArray = alwaysArray; + Cldr._coreLoad = coreLoad; + Cldr._createError = createError; + Cldr._itemGetResolved = itemGetResolved; + Cldr._jsonMerge = jsonMerge; + Cldr._pathNormalize = pathNormalize; + Cldr._resourceGet = resourceGet; + Cldr._validatePresence = validatePresence; + Cldr._validateType = validateType; + Cldr._validateTypePath = validateTypePath; + Cldr._validateTypePlainObject = validateTypePlainObject; + + Cldr._availableBundleMap = {}; + Cldr._availableBundleMapQueue = []; + Cldr._resolved = {}; + + // Allow user to override locale separator "-" (default) | "_". According to http://www.unicode.org/reports/tr35/#Unicode_language_identifier, both "-" and "_" are valid locale separators (eg. "en_GB", "en-GB"). According to http://unicode.org/cldr/trac/ticket/6786 its usage must be consistent throughout the data set. + Cldr.localeSep = "-"; + + /** + * Cldr.load( json [, json, ...] ) + * + * @json [JSON] CLDR data or [Array] Array of @json's. + * + * Load resolved cldr data. + */ + Cldr.load = function() { + Cldr._resolved = coreLoad( Cldr, Cldr._resolved, arguments ); + }; + + /** + * .init() automatically run on instantiation/construction. + */ + Cldr.prototype.init = function( locale ) { + var attributes, language, maxLanguageId, minLanguageId, script, subtags, territory, unicodeLocaleExtensions, variant, + sep = Cldr.localeSep; + + validatePresence( locale, "locale" ); + validateTypeString( locale, "locale" ); + + subtags = coreSubtags( locale ); + + unicodeLocaleExtensions = subtags[ 4 ]; + variant = subtags[ 3 ]; + + // Normalize locale code. + // Get (or deduce) the "triple subtags": language, territory (also aliased as region), and script subtags. + // Get the variant subtags (calendar, collation, currency, etc). + // refs: + // - http://www.unicode.org/reports/tr35/#Field_Definitions + // - http://www.unicode.org/reports/tr35/#Language_and_Locale_IDs + // - http://www.unicode.org/reports/tr35/#Unicode_locale_identifier + + // When a locale id does not specify a language, or territory (region), or script, they are obtained by Likely Subtags. + maxLanguageId = coreLikelySubtags( Cldr, this, subtags, { force: true } ) || subtags; + language = maxLanguageId[ 0 ]; + script = maxLanguageId[ 1 ]; + territory = maxLanguageId[ 2 ]; + + minLanguageId = coreRemoveLikelySubtags( Cldr, this, maxLanguageId ).join( sep ); + + // Set attributes + this.attributes = attributes = { + bundle: bundleLookup( Cldr, this, minLanguageId ), + + // Unicode Language Id + minlanguageId: minLanguageId, + maxLanguageId: maxLanguageId.join( sep ), + + // Unicode Language Id Subtabs + language: language, + script: script, + territory: territory, + region: territory, /* alias */ + variant: variant + }; + + // Unicode locale extensions. + unicodeLocaleExtensions && ( "-" + unicodeLocaleExtensions ).replace( /-[a-z]{3,8}|(-[a-z]{2})-([a-z]{3,8})/g, function( attribute, key, type ) { + + if ( key ) { + + // Extension is in the `keyword` form. + attributes[ "u" + key ] = type; + } else { + + // Extension is in the `attribute` form. + attributes[ "u" + attribute ] = true; + } + }); + + this.locale = locale; + }; + + /** + * .get() + */ + Cldr.prototype.get = function( path ) { + + validatePresence( path, "path" ); + validateTypePath( path, "path" ); + + return itemGetResolved( Cldr, path, this.attributes ); + }; + + /** + * .main() + */ + Cldr.prototype.main = function( path ) { + validatePresence( path, "path" ); + validateTypePath( path, "path" ); + + validate( "E_MISSING_BUNDLE", this.attributes.bundle !== null, { + locale: this.locale + }); + + path = alwaysArray( path ); + return this.get( [ "main/{bundle}" ].concat( path ) ); + }; + + return Cldr; + + + + +})); diff --git a/StockManMVC/bower_components/cldrjs/dist/cldr/event.js b/StockManMVC/bower_components/cldrjs/dist/cldr/event.js new file mode 100644 index 0000000..121b5c8 --- /dev/null +++ b/StockManMVC/bower_components/cldrjs/dist/cldr/event.js @@ -0,0 +1,585 @@ +/** + * CLDR JavaScript Library v0.4.4 + * http://jquery.com/ + * + * Copyright 2013 Rafael Xavier de Souza + * Released under the MIT license + * http://jquery.org/license + * + * Date: 2016-01-18T12:25Z + */ +/*! + * CLDR JavaScript Library v0.4.4 2016-01-18T12:25Z MIT license © Rafael Xavier + * http://git.io/h4lmVg + */ +(function( factory ) { + + if ( typeof define === "function" && define.amd ) { + // AMD. + define( [ "../cldr" ], factory ); + } else if ( typeof module === "object" && typeof module.exports === "object" ) { + // Node. CommonJS. + module.exports = factory( require( "cldrjs" ) ); + } else { + // Global + factory( Cldr ); + } + +}(function( Cldr ) { + + // Build optimization hack to avoid duplicating functions across modules. + var pathNormalize = Cldr._pathNormalize, + validatePresence = Cldr._validatePresence, + validateType = Cldr._validateType; + +/*! + * EventEmitter v4.2.7 - git.io/ee + * Oliver Caldwell + * MIT license + * @preserve + */ + +var EventEmitter; +/* jshint ignore:start */ +EventEmitter = (function () { + + + /** + * Class for managing events. + * Can be extended to provide event functionality in other classes. + * + * @class EventEmitter Manages event registering and emitting. + */ + function EventEmitter() {} + + // Shortcuts to improve speed and size + var proto = EventEmitter.prototype; + var exports = this; + var originalGlobalValue = exports.EventEmitter; + + /** + * Finds the index of the listener for the event in it's storage array. + * + * @param {Function[]} listeners Array of listeners to search through. + * @param {Function} listener Method to look for. + * @return {Number} Index of the specified listener, -1 if not found + * @api private + */ + function indexOfListener(listeners, listener) { + var i = listeners.length; + while (i--) { + if (listeners[i].listener === listener) { + return i; + } + } + + return -1; + } + + /** + * Alias a method while keeping the context correct, to allow for overwriting of target method. + * + * @param {String} name The name of the target method. + * @return {Function} The aliased method + * @api private + */ + function alias(name) { + return function aliasClosure() { + return this[name].apply(this, arguments); + }; + } + + /** + * Returns the listener array for the specified event. + * Will initialise the event object and listener arrays if required. + * Will return an object if you use a regex search. The object contains keys for each matched event. So /ba[rz]/ might return an object containing bar and baz. But only if you have either defined them with defineEvent or added some listeners to them. + * Each property in the object response is an array of listener functions. + * + * @param {String|RegExp} evt Name of the event to return the listeners from. + * @return {Function[]|Object} All listener functions for the event. + */ + proto.getListeners = function getListeners(evt) { + var events = this._getEvents(); + var response; + var key; + + // Return a concatenated array of all matching events if + // the selector is a regular expression. + if (evt instanceof RegExp) { + response = {}; + for (key in events) { + if (events.hasOwnProperty(key) && evt.test(key)) { + response[key] = events[key]; + } + } + } + else { + response = events[evt] || (events[evt] = []); + } + + return response; + }; + + /** + * Takes a list of listener objects and flattens it into a list of listener functions. + * + * @param {Object[]} listeners Raw listener objects. + * @return {Function[]} Just the listener functions. + */ + proto.flattenListeners = function flattenListeners(listeners) { + var flatListeners = []; + var i; + + for (i = 0; i < listeners.length; i += 1) { + flatListeners.push(listeners[i].listener); + } + + return flatListeners; + }; + + /** + * Fetches the requested listeners via getListeners but will always return the results inside an object. This is mainly for internal use but others may find it useful. + * + * @param {String|RegExp} evt Name of the event to return the listeners from. + * @return {Object} All listener functions for an event in an object. + */ + proto.getListenersAsObject = function getListenersAsObject(evt) { + var listeners = this.getListeners(evt); + var response; + + if (listeners instanceof Array) { + response = {}; + response[evt] = listeners; + } + + return response || listeners; + }; + + /** + * Adds a listener function to the specified event. + * The listener will not be added if it is a duplicate. + * If the listener returns true then it will be removed after it is called. + * If you pass a regular expression as the event name then the listener will be added to all events that match it. + * + * @param {String|RegExp} evt Name of the event to attach the listener to. + * @param {Function} listener Method to be called when the event is emitted. If the function returns true then it will be removed after calling. + * @return {Object} Current instance of EventEmitter for chaining. + */ + proto.addListener = function addListener(evt, listener) { + var listeners = this.getListenersAsObject(evt); + var listenerIsWrapped = typeof listener === 'object'; + var key; + + for (key in listeners) { + if (listeners.hasOwnProperty(key) && indexOfListener(listeners[key], listener) === -1) { + listeners[key].push(listenerIsWrapped ? listener : { + listener: listener, + once: false + }); + } + } + + return this; + }; + + /** + * Alias of addListener + */ + proto.on = alias('addListener'); + + /** + * Semi-alias of addListener. It will add a listener that will be + * automatically removed after it's first execution. + * + * @param {String|RegExp} evt Name of the event to attach the listener to. + * @param {Function} listener Method to be called when the event is emitted. If the function returns true then it will be removed after calling. + * @return {Object} Current instance of EventEmitter for chaining. + */ + proto.addOnceListener = function addOnceListener(evt, listener) { + return this.addListener(evt, { + listener: listener, + once: true + }); + }; + + /** + * Alias of addOnceListener. + */ + proto.once = alias('addOnceListener'); + + /** + * Defines an event name. This is required if you want to use a regex to add a listener to multiple events at once. If you don't do this then how do you expect it to know what event to add to? Should it just add to every possible match for a regex? No. That is scary and bad. + * You need to tell it what event names should be matched by a regex. + * + * @param {String} evt Name of the event to create. + * @return {Object} Current instance of EventEmitter for chaining. + */ + proto.defineEvent = function defineEvent(evt) { + this.getListeners(evt); + return this; + }; + + /** + * Uses defineEvent to define multiple events. + * + * @param {String[]} evts An array of event names to define. + * @return {Object} Current instance of EventEmitter for chaining. + */ + proto.defineEvents = function defineEvents(evts) { + for (var i = 0; i < evts.length; i += 1) { + this.defineEvent(evts[i]); + } + return this; + }; + + /** + * Removes a listener function from the specified event. + * When passed a regular expression as the event name, it will remove the listener from all events that match it. + * + * @param {String|RegExp} evt Name of the event to remove the listener from. + * @param {Function} listener Method to remove from the event. + * @return {Object} Current instance of EventEmitter for chaining. + */ + proto.removeListener = function removeListener(evt, listener) { + var listeners = this.getListenersAsObject(evt); + var index; + var key; + + for (key in listeners) { + if (listeners.hasOwnProperty(key)) { + index = indexOfListener(listeners[key], listener); + + if (index !== -1) { + listeners[key].splice(index, 1); + } + } + } + + return this; + }; + + /** + * Alias of removeListener + */ + proto.off = alias('removeListener'); + + /** + * Adds listeners in bulk using the manipulateListeners method. + * If you pass an object as the second argument you can add to multiple events at once. The object should contain key value pairs of events and listeners or listener arrays. You can also pass it an event name and an array of listeners to be added. + * You can also pass it a regular expression to add the array of listeners to all events that match it. + * Yeah, this function does quite a bit. That's probably a bad thing. + * + * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to add to multiple events at once. + * @param {Function[]} [listeners] An optional array of listener functions to add. + * @return {Object} Current instance of EventEmitter for chaining. + */ + proto.addListeners = function addListeners(evt, listeners) { + // Pass through to manipulateListeners + return this.manipulateListeners(false, evt, listeners); + }; + + /** + * Removes listeners in bulk using the manipulateListeners method. + * If you pass an object as the second argument you can remove from multiple events at once. The object should contain key value pairs of events and listeners or listener arrays. + * You can also pass it an event name and an array of listeners to be removed. + * You can also pass it a regular expression to remove the listeners from all events that match it. + * + * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to remove from multiple events at once. + * @param {Function[]} [listeners] An optional array of listener functions to remove. + * @return {Object} Current instance of EventEmitter for chaining. + */ + proto.removeListeners = function removeListeners(evt, listeners) { + // Pass through to manipulateListeners + return this.manipulateListeners(true, evt, listeners); + }; + + /** + * Edits listeners in bulk. The addListeners and removeListeners methods both use this to do their job. You should really use those instead, this is a little lower level. + * The first argument will determine if the listeners are removed (true) or added (false). + * If you pass an object as the second argument you can add/remove from multiple events at once. The object should contain key value pairs of events and listeners or listener arrays. + * You can also pass it an event name and an array of listeners to be added/removed. + * You can also pass it a regular expression to manipulate the listeners of all events that match it. + * + * @param {Boolean} remove True if you want to remove listeners, false if you want to add. + * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to add/remove from multiple events at once. + * @param {Function[]} [listeners] An optional array of listener functions to add/remove. + * @return {Object} Current instance of EventEmitter for chaining. + */ + proto.manipulateListeners = function manipulateListeners(remove, evt, listeners) { + var i; + var value; + var single = remove ? this.removeListener : this.addListener; + var multiple = remove ? this.removeListeners : this.addListeners; + + // If evt is an object then pass each of it's properties to this method + if (typeof evt === 'object' && !(evt instanceof RegExp)) { + for (i in evt) { + if (evt.hasOwnProperty(i) && (value = evt[i])) { + // Pass the single listener straight through to the singular method + if (typeof value === 'function') { + single.call(this, i, value); + } + else { + // Otherwise pass back to the multiple function + multiple.call(this, i, value); + } + } + } + } + else { + // So evt must be a string + // And listeners must be an array of listeners + // Loop over it and pass each one to the multiple method + i = listeners.length; + while (i--) { + single.call(this, evt, listeners[i]); + } + } + + return this; + }; + + /** + * Removes all listeners from a specified event. + * If you do not specify an event then all listeners will be removed. + * That means every event will be emptied. + * You can also pass a regex to remove all events that match it. + * + * @param {String|RegExp} [evt] Optional name of the event to remove all listeners for. Will remove from every event if not passed. + * @return {Object} Current instance of EventEmitter for chaining. + */ + proto.removeEvent = function removeEvent(evt) { + var type = typeof evt; + var events = this._getEvents(); + var key; + + // Remove different things depending on the state of evt + if (type === 'string') { + // Remove all listeners for the specified event + delete events[evt]; + } + else if (evt instanceof RegExp) { + // Remove all events matching the regex. + for (key in events) { + if (events.hasOwnProperty(key) && evt.test(key)) { + delete events[key]; + } + } + } + else { + // Remove all listeners in all events + delete this._events; + } + + return this; + }; + + /** + * Alias of removeEvent. + * + * Added to mirror the node API. + */ + proto.removeAllListeners = alias('removeEvent'); + + /** + * Emits an event of your choice. + * When emitted, every listener attached to that event will be executed. + * If you pass the optional argument array then those arguments will be passed to every listener upon execution. + * Because it uses `apply`, your array of arguments will be passed as if you wrote them out separately. + * So they will not arrive within the array on the other side, they will be separate. + * You can also pass a regular expression to emit to all events that match it. + * + * @param {String|RegExp} evt Name of the event to emit and execute listeners for. + * @param {Array} [args] Optional array of arguments to be passed to each listener. + * @return {Object} Current instance of EventEmitter for chaining. + */ + proto.emitEvent = function emitEvent(evt, args) { + var listeners = this.getListenersAsObject(evt); + var listener; + var i; + var key; + var response; + + for (key in listeners) { + if (listeners.hasOwnProperty(key)) { + i = listeners[key].length; + + while (i--) { + // If the listener returns true then it shall be removed from the event + // The function is executed either with a basic call or an apply if there is an args array + listener = listeners[key][i]; + + if (listener.once === true) { + this.removeListener(evt, listener.listener); + } + + response = listener.listener.apply(this, args || []); + + if (response === this._getOnceReturnValue()) { + this.removeListener(evt, listener.listener); + } + } + } + } + + return this; + }; + + /** + * Alias of emitEvent + */ + proto.trigger = alias('emitEvent'); + + /** + * Subtly different from emitEvent in that it will pass its arguments on to the listeners, as opposed to taking a single array of arguments to pass on. + * As with emitEvent, you can pass a regex in place of the event name to emit to all events that match it. + * + * @param {String|RegExp} evt Name of the event to emit and execute listeners for. + * @param {...*} Optional additional arguments to be passed to each listener. + * @return {Object} Current instance of EventEmitter for chaining. + */ + proto.emit = function emit(evt) { + var args = Array.prototype.slice.call(arguments, 1); + return this.emitEvent(evt, args); + }; + + /** + * Sets the current value to check against when executing listeners. If a + * listeners return value matches the one set here then it will be removed + * after execution. This value defaults to true. + * + * @param {*} value The new value to check for when executing listeners. + * @return {Object} Current instance of EventEmitter for chaining. + */ + proto.setOnceReturnValue = function setOnceReturnValue(value) { + this._onceReturnValue = value; + return this; + }; + + /** + * Fetches the current value to check against when executing listeners. If + * the listeners return value matches this one then it should be removed + * automatically. It will return true by default. + * + * @return {*|Boolean} The current value to check for or the default, true. + * @api private + */ + proto._getOnceReturnValue = function _getOnceReturnValue() { + if (this.hasOwnProperty('_onceReturnValue')) { + return this._onceReturnValue; + } + else { + return true; + } + }; + + /** + * Fetches the events object and creates one if required. + * + * @return {Object} The events storage object. + * @api private + */ + proto._getEvents = function _getEvents() { + return this._events || (this._events = {}); + }; + + /** + * Reverts the global {@link EventEmitter} to its previous value and returns a reference to this version. + * + * @return {Function} Non conflicting EventEmitter class. + */ + EventEmitter.noConflict = function noConflict() { + exports.EventEmitter = originalGlobalValue; + return EventEmitter; + }; + + return EventEmitter; +}()); +/* jshint ignore:end */ + + + + var validateTypeFunction = function( value, name ) { + validateType( value, name, typeof value === "undefined" || typeof value === "function", "Function" ); + }; + + + + + var superGet, superInit, + globalEe = new EventEmitter(); + + function validateTypeEvent( value, name ) { + validateType( value, name, typeof value === "string" || value instanceof RegExp, "String or RegExp" ); + } + + function validateThenCall( method, self ) { + return function( event, listener ) { + validatePresence( event, "event" ); + validateTypeEvent( event, "event" ); + + validatePresence( listener, "listener" ); + validateTypeFunction( listener, "listener" ); + + return self[ method ].apply( self, arguments ); + }; + } + + function off( self ) { + return validateThenCall( "off", self ); + } + + function on( self ) { + return validateThenCall( "on", self ); + } + + function once( self ) { + return validateThenCall( "once", self ); + } + + Cldr.off = off( globalEe ); + Cldr.on = on( globalEe ); + Cldr.once = once( globalEe ); + + /** + * Overload Cldr.prototype.init(). + */ + superInit = Cldr.prototype.init; + Cldr.prototype.init = function() { + var ee; + this.ee = ee = new EventEmitter(); + this.off = off( ee ); + this.on = on( ee ); + this.once = once( ee ); + superInit.apply( this, arguments ); + }; + + /** + * getOverload is encapsulated, because of cldr/unresolved. If it's loaded + * after cldr/event (and note it overwrites .get), it can trigger this + * overload again. + */ + function getOverload() { + + /** + * Overload Cldr.prototype.get(). + */ + superGet = Cldr.prototype.get; + Cldr.prototype.get = function( path ) { + var value = superGet.apply( this, arguments ); + path = pathNormalize( path, this.attributes ).join( "/" ); + globalEe.trigger( "get", [ path, value ] ); + this.ee.trigger( "get", [ path, value ] ); + return value; + }; + } + + Cldr._eventInit = getOverload; + getOverload(); + + return Cldr; + + + + +})); diff --git a/StockManMVC/bower_components/cldrjs/dist/cldr/supplemental.js b/StockManMVC/bower_components/cldrjs/dist/cldr/supplemental.js new file mode 100644 index 0000000..855de02 --- /dev/null +++ b/StockManMVC/bower_components/cldrjs/dist/cldr/supplemental.js @@ -0,0 +1,101 @@ +/** + * CLDR JavaScript Library v0.4.4 + * http://jquery.com/ + * + * Copyright 2013 Rafael Xavier de Souza + * Released under the MIT license + * http://jquery.org/license + * + * Date: 2016-01-18T12:25Z + */ +/*! + * CLDR JavaScript Library v0.4.4 2016-01-18T12:25Z MIT license © Rafael Xavier + * http://git.io/h4lmVg + */ +(function( factory ) { + + if ( typeof define === "function" && define.amd ) { + // AMD. + define( [ "../cldr" ], factory ); + } else if ( typeof module === "object" && typeof module.exports === "object" ) { + // Node. CommonJS. + module.exports = factory( require( "cldrjs" ) ); + } else { + // Global + factory( Cldr ); + } + +}(function( Cldr ) { + + // Build optimization hack to avoid duplicating functions across modules. + var alwaysArray = Cldr._alwaysArray; + + + + var supplementalMain = function( cldr ) { + + var prepend, supplemental; + + prepend = function( prepend ) { + return function( path ) { + path = alwaysArray( path ); + return cldr.get( [ prepend ].concat( path ) ); + }; + }; + + supplemental = prepend( "supplemental" ); + + // Week Data + // http://www.unicode.org/reports/tr35/tr35-dates.html#Week_Data + supplemental.weekData = prepend( "supplemental/weekData" ); + + supplemental.weekData.firstDay = function() { + return cldr.get( "supplemental/weekData/firstDay/{territory}" ) || + cldr.get( "supplemental/weekData/firstDay/001" ); + }; + + supplemental.weekData.minDays = function() { + var minDays = cldr.get( "supplemental/weekData/minDays/{territory}" ) || + cldr.get( "supplemental/weekData/minDays/001" ); + return parseInt( minDays, 10 ); + }; + + // Time Data + // http://www.unicode.org/reports/tr35/tr35-dates.html#Time_Data + supplemental.timeData = prepend( "supplemental/timeData" ); + + supplemental.timeData.allowed = function() { + return cldr.get( "supplemental/timeData/{territory}/_allowed" ) || + cldr.get( "supplemental/timeData/001/_allowed" ); + }; + + supplemental.timeData.preferred = function() { + return cldr.get( "supplemental/timeData/{territory}/_preferred" ) || + cldr.get( "supplemental/timeData/001/_preferred" ); + }; + + return supplemental; + + }; + + + + + var initSuper = Cldr.prototype.init; + + /** + * .init() automatically ran on construction. + * + * Overload .init(). + */ + Cldr.prototype.init = function() { + initSuper.apply( this, arguments ); + this.supplemental = supplementalMain( this ); + }; + + return Cldr; + + + + +})); diff --git a/StockManMVC/bower_components/cldrjs/dist/cldr/unresolved.js b/StockManMVC/bower_components/cldrjs/dist/cldr/unresolved.js new file mode 100644 index 0000000..0248ccb --- /dev/null +++ b/StockManMVC/bower_components/cldrjs/dist/cldr/unresolved.js @@ -0,0 +1,164 @@ +/** + * CLDR JavaScript Library v0.4.4 + * http://jquery.com/ + * + * Copyright 2013 Rafael Xavier de Souza + * Released under the MIT license + * http://jquery.org/license + * + * Date: 2016-01-18T12:25Z + */ +/*! + * CLDR JavaScript Library v0.4.4 2016-01-18T12:25Z MIT license © Rafael Xavier + * http://git.io/h4lmVg + */ +(function( factory ) { + + if ( typeof define === "function" && define.amd ) { + // AMD. + define( [ "../cldr" ], factory ); + } else if ( typeof module === "object" && typeof module.exports === "object" ) { + // Node. CommonJS. + module.exports = factory( require( "cldrjs" ) ); + } else { + // Global + factory( Cldr ); + } + +}(function( Cldr ) { + + // Build optimization hack to avoid duplicating functions across modules. + var coreLoad = Cldr._coreLoad; + var jsonMerge = Cldr._jsonMerge; + var pathNormalize = Cldr._pathNormalize; + var resourceGet = Cldr._resourceGet; + var validatePresence = Cldr._validatePresence; + var validateTypePath = Cldr._validateTypePath; + + + + var bundleParentLookup = function( Cldr, locale ) { + var normalizedPath, parent; + + if ( locale === "root" ) { + return; + } + + // First, try to find parent on supplemental data. + normalizedPath = pathNormalize( [ "supplemental/parentLocales/parentLocale", locale ] ); + parent = resourceGet( Cldr._resolved, normalizedPath ) || resourceGet( Cldr._raw, normalizedPath ); + if ( parent ) { + return parent; + } + + // Or truncate locale. + parent = locale.substr( 0, locale.lastIndexOf( Cldr.localeSep ) ); + if ( !parent ) { + return "root"; + } + + return parent; + }; + + + + + // @path: normalized path + var resourceSet = function( data, path, value ) { + var i, + node = data, + length = path.length; + + for ( i = 0; i < length - 1; i++ ) { + if ( !node[ path[ i ] ] ) { + node[ path[ i ] ] = {}; + } + node = node[ path[ i ] ]; + } + node[ path[ i ] ] = value; + }; + + + var itemLookup = (function() { + + var lookup; + + lookup = function( Cldr, locale, path, attributes, childLocale ) { + var normalizedPath, parent, value; + + // 1: Finish recursion + // 2: Avoid infinite loop + if ( typeof locale === "undefined" /* 1 */ || locale === childLocale /* 2 */ ) { + return; + } + + // Resolve path + normalizedPath = pathNormalize( path, attributes ); + + // Check resolved (cached) data first + // 1: Due to #16, never use the cached resolved non-leaf nodes. It may not + // represent its leafs in its entirety. + value = resourceGet( Cldr._resolved, normalizedPath ); + if ( value && typeof value !== "object" /* 1 */ ) { + return value; + } + + // Check raw data + value = resourceGet( Cldr._raw, normalizedPath ); + + if ( !value ) { + // Or, lookup at parent locale + parent = bundleParentLookup( Cldr, locale ); + value = lookup( Cldr, parent, path, jsonMerge( attributes, { bundle: parent }), locale ); + } + + if ( value ) { + // Set resolved (cached) + resourceSet( Cldr._resolved, normalizedPath, value ); + } + + return value; + }; + + return lookup; + +}()); + + + Cldr._raw = {}; + + /** + * Cldr.load( json [, json, ...] ) + * + * @json [JSON] CLDR data or [Array] Array of @json's. + * + * Load resolved or unresolved cldr data. + * Overwrite Cldr.load(). + */ + Cldr.load = function() { + Cldr._raw = coreLoad( Cldr, Cldr._raw, arguments ); + }; + + /** + * Overwrite Cldr.prototype.get(). + */ + Cldr.prototype.get = function( path ) { + validatePresence( path, "path" ); + validateTypePath( path, "path" ); + + // 1: use bundle as locale on item lookup for simplification purposes, because no other extended subtag is used anyway on bundle parent lookup. + // 2: during init(), this method is called, but bundle is yet not defined. Use "" as a workaround in this very specific scenario. + return itemLookup( Cldr, this.attributes && this.attributes.bundle /* 1 */ || "" /* 2 */, path, this.attributes ); + }; + + // In case cldr/unresolved is loaded after cldr/event, we trigger its overloads again. Because, .get is overwritten in here. + if ( Cldr._eventInit ) { + Cldr._eventInit(); + } + + return Cldr; + + + + +})); diff --git a/StockManMVC/bower_components/cldrjs/dist/node_main.js b/StockManMVC/bower_components/cldrjs/dist/node_main.js new file mode 100644 index 0000000..371f288 --- /dev/null +++ b/StockManMVC/bower_components/cldrjs/dist/node_main.js @@ -0,0 +1,22 @@ +/** + * CLDR JavaScript Library v0.4.4 + * http://jquery.com/ + * + * Copyright 2013 Rafael Xavier de Souza + * Released under the MIT license + * http://jquery.org/license + * + * Date: 2016-01-18T12:25Z + */ +/*! + * CLDR JavaScript Library v0.4.4 2016-01-18T12:25Z MIT license © Rafael Xavier + * http://git.io/h4lmVg + */ + +// Cldr +module.exports = require( "./cldr" ); + +// Extent Cldr with the following modules +require( "./cldr/event" ); +require( "./cldr/supplemental" ); +require( "./cldr/unresolved" ); diff --git a/StockManMVC/bower_components/cldrjs/doc/api/core/constructor.md b/StockManMVC/bower_components/cldrjs/doc/api/core/constructor.md index b29cc8d..a6c3b86 100644 --- a/StockManMVC/bower_components/cldrjs/doc/api/core/constructor.md +++ b/StockManMVC/bower_components/cldrjs/doc/api/core/constructor.md @@ -2,7 +2,7 @@ Create a new instance of Cldr. -| Parameter | Type | Example | +| Parameter | Type | Exampe | | --- | --- | --- | | *locale* | String | `"en"`, `"pt-BR"` | diff --git a/StockManMVC/bower_components/cldrjs/doc/api/core/get.md b/StockManMVC/bower_components/cldrjs/doc/api/core/get.md index 0a96f4f..eaf6f88 100644 --- a/StockManMVC/bower_components/cldrjs/doc/api/core/get.md +++ b/StockManMVC/bower_components/cldrjs/doc/api/core/get.md @@ -2,7 +2,7 @@ Get the item data given its path, or `undefined` if missing. -| Parameter | Type | Example | +| Parameter | Type | Exampe | | --- | --- | --- | | *path* | String or
Array | `"/cldr/main/{languageId}/numbers/symbols-numberSystem-latn/decimal"`
`[ "cldr", "main", "{languageId}", "numbers", "symbols-numberSystem-latn", "decimal" ]` | diff --git a/StockManMVC/bower_components/cldrjs/doc/api/core/main.md b/StockManMVC/bower_components/cldrjs/doc/api/core/main.md index 856279a..ce7e69b 100644 --- a/StockManMVC/bower_components/cldrjs/doc/api/core/main.md +++ b/StockManMVC/bower_components/cldrjs/doc/api/core/main.md @@ -2,7 +2,7 @@ It's an alias for `.get([ "main/{languageId}", ... ])`. -| Parameter | Type | Example | +| Parameter | Type | Exampe | | --- | --- | --- | | *path* | String or
Array | See `cldr.get()` for more information | diff --git a/StockManMVC/bower_components/cldrjs/doc/api/event/global_off.md b/StockManMVC/bower_components/cldrjs/doc/api/event/global_off.md index 2a2db5f..8c3072c 100644 --- a/StockManMVC/bower_components/cldrjs/doc/api/event/global_off.md +++ b/StockManMVC/bower_components/cldrjs/doc/api/event/global_off.md @@ -2,7 +2,7 @@ Removes a listener function from the specified event globally (for all instances). -| Parameter | Type | Example | +| Parameter | Type | Exampe | | --- | --- | --- | | *event* | String | `"get"` | | *listener* | Function | | diff --git a/StockManMVC/bower_components/cldrjs/doc/api/event/global_on.md b/StockManMVC/bower_components/cldrjs/doc/api/event/global_on.md index 96f63a3..5e7decc 100644 --- a/StockManMVC/bower_components/cldrjs/doc/api/event/global_on.md +++ b/StockManMVC/bower_components/cldrjs/doc/api/event/global_on.md @@ -2,7 +2,7 @@ Add a listener function to the specified event globally (for all instances). -| Parameter | Type | Example | +| Parameter | Type | Exampe | | --- | --- | --- | | *event* | String | `"get"` | | *listener* | Function | | diff --git a/StockManMVC/bower_components/cldrjs/doc/api/event/global_once.md b/StockManMVC/bower_components/cldrjs/doc/api/event/global_once.md index 8aec636..54c4956 100644 --- a/StockManMVC/bower_components/cldrjs/doc/api/event/global_once.md +++ b/StockManMVC/bower_components/cldrjs/doc/api/event/global_once.md @@ -2,7 +2,7 @@ Add a listener function to the specified event globally (for all instances). It will be automatically removed after it's first execution. -| Parameter | Type | Example | +| Parameter | Type | Exampe | | --- | --- | --- | | *event* | String | `"get"` | | *listener* | Function | | diff --git a/StockManMVC/bower_components/cldrjs/doc/api/event/off.md b/StockManMVC/bower_components/cldrjs/doc/api/event/off.md index e0191a1..bf74ded 100644 --- a/StockManMVC/bower_components/cldrjs/doc/api/event/off.md +++ b/StockManMVC/bower_components/cldrjs/doc/api/event/off.md @@ -2,7 +2,7 @@ Removes a listener function from the specified event for this instance. -| Parameter | Type | Example | +| Parameter | Type | Exampe | | --- | --- | --- | | *event* | String | `"get"` | | *listener* | Function | | diff --git a/StockManMVC/bower_components/cldrjs/doc/api/event/on.md b/StockManMVC/bower_components/cldrjs/doc/api/event/on.md index f7cd83f..d9915b1 100644 --- a/StockManMVC/bower_components/cldrjs/doc/api/event/on.md +++ b/StockManMVC/bower_components/cldrjs/doc/api/event/on.md @@ -2,7 +2,7 @@ Add a listener function to the specified event for this instance. -| Parameter | Type | Example | +| Parameter | Type | Exampe | | --- | --- | --- | | *event* | String | `"get"` | | *listener* | Function | | diff --git a/StockManMVC/bower_components/cldrjs/doc/api/event/once.md b/StockManMVC/bower_components/cldrjs/doc/api/event/once.md index 5011cce..39e8979 100644 --- a/StockManMVC/bower_components/cldrjs/doc/api/event/once.md +++ b/StockManMVC/bower_components/cldrjs/doc/api/event/once.md @@ -2,7 +2,7 @@ Add a listener function to the specified event for this instance. It will be automatically removed after it's first execution. -| Parameter | Type | Example | +| Parameter | Type | Exampe | | --- | --- | --- | | *event* | String | `"get"` | | *listener* | Function | | diff --git a/StockManMVC/bower_components/cldrjs/doc/api/supplemental.md b/StockManMVC/bower_components/cldrjs/doc/api/supplemental.md index b083226..ceb2231 100644 --- a/StockManMVC/bower_components/cldrjs/doc/api/supplemental.md +++ b/StockManMVC/bower_components/cldrjs/doc/api/supplemental.md @@ -2,7 +2,7 @@ It's an alias for `.get([ "supplemental", ... ])`. -| Parameter | Type | Example | +| Parameter | Type | Exampe | | --- | --- | --- | | *path* | String or
Array | See `cldr.get()` for more information | diff --git a/StockManMVC/bower_components/cldrjs/doc/api/unresolved/get.md b/StockManMVC/bower_components/cldrjs/doc/api/unresolved/get.md index f37dd06..bc35931 100644 --- a/StockManMVC/bower_components/cldrjs/doc/api/unresolved/get.md +++ b/StockManMVC/bower_components/cldrjs/doc/api/unresolved/get.md @@ -2,7 +2,7 @@ Overload (extend) `.get()` to get the item data or lookup by following [locale inheritance](http://www.unicode.org/reports/tr35/#Locale_Inheritance), set a local resolved cache if it's found (for subsequent faster access), or return `undefined`. -| Parameter | Type | Example | +| Parameter | Type | Exampe | | --- | --- | --- | | *path* | String or
Array | See `cldr.get()` above for more information | diff --git a/StockManMVC/bower_components/cldrjs/package.json b/StockManMVC/bower_components/cldrjs/package.json index 6b3bb03..e11167d 100644 --- a/StockManMVC/bower_components/cldrjs/package.json +++ b/StockManMVC/bower_components/cldrjs/package.json @@ -1,6 +1,6 @@ { "name": "cldrjs", - "version": "0.4.5", + "version": "0.4.4", "description": "Simple CLDR traverser", "keywords": [ "utility", diff --git a/StockManMVC/bower_components/cldrjs/src/core.js b/StockManMVC/bower_components/cldrjs/src/core.js index e8f0cd0..7244c4a 100644 --- a/StockManMVC/bower_components/cldrjs/src/core.js +++ b/StockManMVC/bower_components/cldrjs/src/core.js @@ -61,22 +61,14 @@ define([ */ Cldr.prototype.init = function( locale ) { var attributes, language, maxLanguageId, minLanguageId, script, subtags, territory, unicodeLocaleExtensions, variant, - sep = Cldr.localeSep, - unicodeLocaleExtensionsRaw = ""; + sep = Cldr.localeSep; validatePresence( locale, "locale" ); validateTypeString( locale, "locale" ); subtags = coreSubtags( locale ); - if ( subtags.length === 5 ) { - unicodeLocaleExtensions = subtags.pop(); - unicodeLocaleExtensionsRaw = sep + "u" + sep + unicodeLocaleExtensions; - // Remove trailing null when there is unicodeLocaleExtensions but no variants. - if ( !subtags[ 3 ] ) { - subtags.pop(); - } - } + unicodeLocaleExtensions = subtags[ 4 ]; variant = subtags[ 3 ]; // Normalize locale code. @@ -100,8 +92,8 @@ define([ bundle: bundleLookup( Cldr, this, minLanguageId ), // Unicode Language Id - minLanguageId: minLanguageId + unicodeLocaleExtensionsRaw, - maxLanguageId: maxLanguageId.join( sep ) + unicodeLocaleExtensionsRaw, + minlanguageId: minLanguageId, + maxLanguageId: maxLanguageId.join( sep ), // Unicode Language Id Subtabs language: language, diff --git a/StockManMVC/bower_components/cldrjs/src/core/likely_subtags.js b/StockManMVC/bower_components/cldrjs/src/core/likely_subtags.js index 0d6d366..20d7392 100644 --- a/StockManMVC/bower_components/cldrjs/src/core/likely_subtags.js +++ b/StockManMVC/bower_components/cldrjs/src/core/likely_subtags.js @@ -51,12 +51,12 @@ define([ script = subtags[ 1 ], sep = Cldr.localeSep, territory = subtags[ 2 ], - variants = subtags.slice( 3, 4 ); + variantsAndUnicodeLocaleExtensions = subtags.slice( 3, 4 ); options = options || {}; // Skip if (language, script, territory) is not empty [3.3] if ( language !== "und" && script !== "Zzzz" && territory !== "ZZ" ) { - return [ language, script, territory ].concat( variants ); + return [ language, script, territory ].concat( variantsAndUnicodeLocaleExtensions ); } // Skip if no supplemental likelySubtags data is present @@ -83,7 +83,9 @@ define([ language !== "und" ? language : match[ 0 ], script !== "Zzzz" ? script : match[ 1 ], territory !== "ZZ" ? territory : match[ 2 ] - ].concat( variants ); + ].concat( + variantsAndUnicodeLocaleExtensions + ); } else if ( options.force ) { // [3.1.2] return cldr.get( "supplemental/likelySubtags/und" ).split( sep ); diff --git a/StockManMVC/bower_components/cldrjs/test/unit/core.js b/StockManMVC/bower_components/cldrjs/test/unit/core.js index 35c7e2b..764ddc3 100644 --- a/StockManMVC/bower_components/cldrjs/test/unit/core.js +++ b/StockManMVC/bower_components/cldrjs/test/unit/core.js @@ -71,20 +71,6 @@ define([ expect( cldr.attributes[ "u-nu" ] ).to.equal( "arab" ); }); - it( "should set minLanguageId and maxLanguageId attributes", function() { - cldr = new Cldr( "en" ); - expect( cldr.attributes.minLanguageId ).to.equal( "en" ); - expect( cldr.attributes.maxLanguageId ).to.equal( "en-Latn-US" ); - - cldr = new Cldr( "zh-Hant-HK-u-nu-native" ); - expect( cldr.attributes.minLanguageId ).to.equal( "zh-HK-u-nu-native" ); - expect( cldr.attributes.maxLanguageId ).to.equal( "zh-Hant-HK-u-nu-native" ); - - cldr = new Cldr( "en-POSIX-u-nu-native" ); - expect( cldr.attributes.minLanguageId ).to.equal( "en-POSIX-u-nu-native" ); - expect( cldr.attributes.maxLanguageId ).to.equal( "en-Latn-US-POSIX-u-nu-native" ); - }); - it( "should implement cldr.main as an alias of get( \"main/{bundle}...\" )", function() { cldr = new Cldr( "en" ); expect( cldr.main( "numbers/symbols-numberSystem-latn/decimal" ) ).to.equal( "." ); diff --git a/StockManMVC/bower_components/globalize/README.md b/StockManMVC/bower_components/globalize/README.md index 2d00775..7968a4e 100644 --- a/StockManMVC/bower_components/globalize/README.md +++ b/StockManMVC/bower_components/globalize/README.md @@ -742,7 +742,7 @@ writing code, be sure to read [CONTRIBUTING.md](CONTRIBUTING.md). [StackOverflow with the "javascript-globalize" tag]: http://stackoverflow.com/tags/javascript-globalize For ideas where to start contributing, see the following queries to find what -best suites your interest: [quick change][], [new features][], [bug fixes][], +best suites your interest: [quick changes][], [new features][], [bug fixes][], [documentation improvements][], [date module][], [currency module][], [message module][], [number module][], [plural module][], [relative time module][]. Last but not least, feel free to [get in touch](http://irc.jquery.org/). @@ -750,7 +750,7 @@ but not least, feel free to [get in touch](http://irc.jquery.org/). [bug fixes]: https://github.com/jquery/globalize/labels/bug [documentation improvements]: https://github.com/jquery/globalize/labels/docs [new features]: https://github.com/jquery/globalize/labels/new%20feature -[quick change]: https://github.com/jquery/globalize/labels/quick%20change +[quick changes]: https://github.com/jquery/globalize/labels/quick%20changes [currency module]: https://github.com/jquery/globalize/labels/currency%20module [date module]: https://github.com/jquery/globalize/labels/date%20module diff --git a/StockManMVC/bower_components/globalize/dist/globalize-runtime.js b/StockManMVC/bower_components/globalize/dist/globalize-runtime.js new file mode 100644 index 0000000..1d451d5 --- /dev/null +++ b/StockManMVC/bower_components/globalize/dist/globalize-runtime.js @@ -0,0 +1,236 @@ +/** + * Globalize Runtime v1.1.1 + * + * http://github.com/jquery/globalize + * + * Copyright jQuery Foundation and other contributors + * Released under the MIT license + * http://jquery.org/license + * + * Date: 2016-02-04T12:01Z + */ +/*! + * Globalize Runtime v1.1.1 2016-02-04T12:01Z Released under the MIT license + * http://git.io/TrdQbw + */ +(function( root, factory ) { + + // UMD returnExports + if ( typeof define === "function" && define.amd ) { + + // AMD + define( factory ); + } else if ( typeof exports === "object" ) { + + // Node, CommonJS + module.exports = factory(); + } else { + + // Globalize + root.Globalize = factory(); + } +}( this, function() { + + +/** + * A toString method that outputs meaningful values for objects or arrays and + * still performs as fast as a plain string in case variable is string, or as + * fast as `"" + number` in case variable is a number. + * Ref: http://jsperf.com/my-stringify + */ +var toString = function( variable ) { + return typeof variable === "string" ? variable : ( typeof variable === "number" ? "" + + variable : JSON.stringify( variable ) ); +}; + + + + +/** + * formatMessage( message, data ) + * + * @message [String] A message with optional {vars} to be replaced. + * + * @data [Array or JSON] Object with replacing-variables content. + * + * Return the formatted message. For example: + * + * - formatMessage( "{0} second", [ 1 ] ); // 1 second + * + * - formatMessage( "{0}/{1}", ["m", "s"] ); // m/s + * + * - formatMessage( "{name} <{email}>", { + * name: "Foo", + * email: "bar@baz.qux" + * }); // Foo + */ +var formatMessage = function( message, data ) { + + // Replace {attribute}'s + message = message.replace( /{[0-9a-zA-Z-_. ]+}/g, function( name ) { + name = name.replace( /^{([^}]*)}$/, "$1" ); + return toString( data[ name ] ); + }); + + return message; +}; + + + + +var objectExtend = function() { + var destination = arguments[ 0 ], + sources = [].slice.call( arguments, 1 ); + + sources.forEach(function( source ) { + var prop; + for ( prop in source ) { + destination[ prop ] = source[ prop ]; + } + }); + + return destination; +}; + + + + +var createError = function( code, message, attributes ) { + var error; + + message = code + ( message ? ": " + formatMessage( message, attributes ) : "" ); + error = new Error( message ); + error.code = code; + + objectExtend( error, attributes ); + + return error; +}; + + + + +// Based on http://stackoverflow.com/questions/7616461/generate-a-hash-from-string-in-javascript-jquery +var stringHash = function( str ) { + return [].reduce.call( str, function( hash, i ) { + var chr = i.charCodeAt( 0 ); + hash = ( ( hash << 5 ) - hash ) + chr; + return hash | 0; + }, 0 ); +}; + + + + +var runtimeKey = function( fnName, locale, args, argsStr ) { + var hash; + argsStr = argsStr || JSON.stringify( args ); + hash = stringHash( fnName + locale + argsStr ); + return hash > 0 ? "a" + hash : "b" + Math.abs( hash ); +}; + + + + +var validate = function( code, message, check, attributes ) { + if ( !check ) { + throw createError( code, message, attributes ); + } +}; + + + + +var validateParameterPresence = function( value, name ) { + validate( "E_MISSING_PARAMETER", "Missing required parameter `{name}`.", + value !== undefined, { name: name }); +}; + + + + +var validateParameterType = function( value, name, check, expected ) { + validate( + "E_INVALID_PAR_TYPE", + "Invalid `{name}` parameter ({value}). {expected} expected.", + check, + { + expected: expected, + name: name, + value: value + } + ); +}; + + + + +var validateParameterTypeString = function( value, name ) { + validateParameterType( + value, + name, + value === undefined || typeof value === "string", + "a string" + ); +}; + + + + +// ref: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions?redirectlocale=en-US&redirectslug=JavaScript%2FGuide%2FRegular_Expressions +var regexpEscape = function( string ) { + return string.replace( /([.*+?^=!:${}()|\[\]\/\\])/g, "\\$1" ); +}; + + + + +var stringPad = function( str, count, right ) { + var length; + if ( typeof str !== "string" ) { + str = String( str ); + } + for ( length = str.length; length < count; length += 1 ) { + str = ( right ? ( str + "0" ) : ( "0" + str ) ); + } + return str; +}; + + + + +function Globalize( locale ) { + if ( !( this instanceof Globalize ) ) { + return new Globalize( locale ); + } + + validateParameterPresence( locale, "locale" ); + validateParameterTypeString( locale, "locale" ); + + this._locale = locale; +} + +Globalize.locale = function( locale ) { + validateParameterTypeString( locale, "locale" ); + + if ( arguments.length ) { + this._locale = locale; + } + return this._locale; +}; + +Globalize._createError = createError; +Globalize._formatMessage = formatMessage; +Globalize._regexpEscape = regexpEscape; +Globalize._runtimeKey = runtimeKey; +Globalize._stringPad = stringPad; +Globalize._validateParameterPresence = validateParameterPresence; +Globalize._validateParameterTypeString = validateParameterTypeString; +Globalize._validateParameterType = validateParameterType; + +return Globalize; + + + + +})); diff --git a/StockManMVC/bower_components/globalize/dist/globalize-runtime/currency.js b/StockManMVC/bower_components/globalize/dist/globalize-runtime/currency.js new file mode 100644 index 0000000..b5c61ca --- /dev/null +++ b/StockManMVC/bower_components/globalize/dist/globalize-runtime/currency.js @@ -0,0 +1,119 @@ +/** + * Globalize Runtime v1.1.1 + * + * http://github.com/jquery/globalize + * + * Copyright jQuery Foundation and other contributors + * Released under the MIT license + * http://jquery.org/license + * + * Date: 2016-02-04T12:01Z + */ +/*! + * Globalize Runtime v1.1.1 2016-02-04T12:01Z Released under the MIT license + * http://git.io/TrdQbw + */ +(function( root, factory ) { + + // UMD returnExports + if ( typeof define === "function" && define.amd ) { + + // AMD + define([ + "../globalize-runtime", + "./number" + ], factory ); + } else if ( typeof exports === "object" ) { + + // Node, CommonJS + module.exports = factory( + require( "../globalize-runtime" ), + require( "./number" ) + ); + } else { + + // Extend global + factory( root.Globalize ); + } +}(this, function( Globalize ) { + +var formatMessage = Globalize._formatMessage, + runtimeKey = Globalize._runtimeKey, + validateParameterPresence = Globalize._validateParameterPresence, + validateParameterTypeNumber = Globalize._validateParameterTypeNumber; + + +/** + * nameFormat( formattedNumber, pluralForm, properties ) + * + * Return the appropriate name form currency format. + */ +var currencyNameFormat = function( formattedNumber, pluralForm, properties ) { + var displayName, unitPattern, + displayNames = properties.displayNames || {}, + unitPatterns = properties.unitPatterns; + + displayName = displayNames[ "displayName-count-" + pluralForm ] || + displayNames[ "displayName-count-other" ] || + displayNames.displayName || + properties.currency; + unitPattern = unitPatterns[ "unitPattern-count-" + pluralForm ] || + unitPatterns[ "unitPattern-count-other" ]; + + return formatMessage( unitPattern, [ formattedNumber, displayName ]); +}; + + + + +var currencyFormatterFn = function( numberFormatter, pluralGenerator, properties ) { + var fn; + + // Return formatter when style is "code" or "name". + if ( pluralGenerator && properties ) { + fn = function currencyFormatter( value ) { + validateParameterPresence( value, "value" ); + validateParameterTypeNumber( value, "value" ); + return currencyNameFormat( + numberFormatter( value ), + pluralGenerator( value ), + properties + ); + }; + + // Return formatter when style is "symbol" or "accounting". + } else { + fn = function currencyFormatter( value ) { + return numberFormatter( value ); + }; + } + + return fn; +}; + + + + +Globalize._currencyFormatterFn = currencyFormatterFn; +Globalize._currencyNameFormat = currencyNameFormat; + +Globalize.currencyFormatter = +Globalize.prototype.currencyFormatter = function( currency, options ) { + options = options || {}; + return Globalize[ runtimeKey( "currencyFormatter", this._locale, [ currency, options ] ) ]; +}; + +Globalize.formatCurrency = +Globalize.prototype.formatCurrency = function( value, currency, options ) { + validateParameterPresence( value, "value" ); + validateParameterTypeNumber( value, "value" ); + + return this.currencyFormatter( currency, options )( value ); +}; + +return Globalize; + + + + +})); diff --git a/StockManMVC/bower_components/globalize/dist/globalize-runtime/date.js b/StockManMVC/bower_components/globalize/dist/globalize-runtime/date.js new file mode 100644 index 0000000..528678e --- /dev/null +++ b/StockManMVC/bower_components/globalize/dist/globalize-runtime/date.js @@ -0,0 +1,1300 @@ +/** + * Globalize Runtime v1.1.1 + * + * http://github.com/jquery/globalize + * + * Copyright jQuery Foundation and other contributors + * Released under the MIT license + * http://jquery.org/license + * + * Date: 2016-02-04T12:01Z + */ +/*! + * Globalize Runtime v1.1.1 2016-02-04T12:01Z Released under the MIT license + * http://git.io/TrdQbw + */ +(function( root, factory ) { + + // UMD returnExports + if ( typeof define === "function" && define.amd ) { + + // AMD + define([ + "../globalize-runtime", + "./number" + ], factory ); + } else if ( typeof exports === "object" ) { + + // Node, CommonJS + module.exports = factory( + require( "../globalize-runtime" ), + require( "./number" ) + ); + } else { + + // Extend global + factory( root.Globalize ); + } +}(this, function( Globalize ) { + +var createErrorUnsupportedFeature = Globalize._createErrorUnsupportedFeature, + regexpEscape = Globalize._regexpEscape, + runtimeKey = Globalize._runtimeKey, + stringPad = Globalize._stringPad, + validateParameterPresence = Globalize._validateParameterPresence, + validateParameterType = Globalize._validateParameterType, + validateParameterTypeString = Globalize._validateParameterTypeString; + + +var validateParameterTypeDate = function( value, name ) { + validateParameterType( value, name, value === undefined || value instanceof Date, "Date" ); +}; + + + + +/** + * dayOfWeek( date, firstDay ) + * + * @date + * + * @firstDay the result of `dateFirstDayOfWeek( cldr )` + * + * Return the day of the week normalized by the territory's firstDay [0-6]. + * Eg for "mon": + * - return 0 if territory is GB, or BR, or DE, or FR (week starts on "mon"); + * - return 1 if territory is US (week starts on "sun"); + * - return 2 if territory is EG (week starts on "sat"); + */ +var dateDayOfWeek = function( date, firstDay ) { + return ( date.getDay() - firstDay + 7 ) % 7; +}; + + + + +/** + * distanceInDays( from, to ) + * + * Return the distance in days between from and to Dates. + */ +var dateDistanceInDays = function( from, to ) { + var inDays = 864e5; + return ( to.getTime() - from.getTime() ) / inDays; +}; + + + + +/** + * startOf changes the input to the beginning of the given unit. + * + * For example, starting at the start of a day, resets hours, minutes + * seconds and milliseconds to 0. Starting at the month does the same, but + * also sets the date to 1. + * + * Returns the modified date + */ +var dateStartOf = function( date, unit ) { + date = new Date( date.getTime() ); + switch ( unit ) { + case "year": + date.setMonth( 0 ); + /* falls through */ + case "month": + date.setDate( 1 ); + /* falls through */ + case "day": + date.setHours( 0 ); + /* falls through */ + case "hour": + date.setMinutes( 0 ); + /* falls through */ + case "minute": + date.setSeconds( 0 ); + /* falls through */ + case "second": + date.setMilliseconds( 0 ); + } + return date; +}; + + + + +/** + * dayOfYear + * + * Return the distance in days of the date to the begin of the year [0-d]. + */ +var dateDayOfYear = function( date ) { + return Math.floor( dateDistanceInDays( dateStartOf( date, "year" ), date ) ); +}; + + + + +/** + * millisecondsInDay + */ +var dateMillisecondsInDay = function( date ) { + + // TODO Handle daylight savings discontinuities + return date - dateStartOf( date, "day" ); +}; + + + + +var datePatternRe = ( /([a-z])\1*|'([^']|'')+'|''|./ig ); + + + + +/** + * hourFormat( date, format, timeSeparator, formatNumber ) + * + * Return date's timezone offset according to the format passed. + * Eg for format when timezone offset is 180: + * - "+H;-H": -3 + * - "+HHmm;-HHmm": -0300 + * - "+HH:mm;-HH:mm": -03:00 + */ +var dateTimezoneHourFormat = function( date, format, timeSeparator, formatNumber ) { + var absOffset, + offset = date.getTimezoneOffset(); + + absOffset = Math.abs( offset ); + formatNumber = formatNumber || { + 1: function( value ) { + return stringPad( value, 1 ); + }, + 2: function( value ) { + return stringPad( value, 2 ); + } + }; + + return format + + // Pick the correct sign side (+ or -). + .split( ";" )[ offset > 0 ? 1 : 0 ] + + // Localize time separator + .replace( ":", timeSeparator ) + + // Update hours offset. + .replace( /HH?/, function( match ) { + return formatNumber[ match.length ]( Math.floor( absOffset / 60 ) ); + }) + + // Update minutes offset and return. + .replace( /mm/, function() { + return formatNumber[ 2 ]( absOffset % 60 ); + }); +}; + + + + +var dateWeekDays = [ "sun", "mon", "tue", "wed", "thu", "fri", "sat" ]; + + + + +/** + * format( date, properties ) + * + * @date [Date instance]. + * + * @properties + * + * TODO Support other calendar types. + * + * Disclosure: this function borrows excerpts of dojo/date/locale. + */ +var dateFormat = function( date, numberFormatters, properties ) { + var timeSeparator = properties.timeSeparator; + + return properties.pattern.replace( datePatternRe, function( current ) { + var ret, + chr = current.charAt( 0 ), + length = current.length; + + if ( chr === "j" ) { + + // Locale preferred hHKk. + // http://www.unicode.org/reports/tr35/tr35-dates.html#Time_Data + chr = properties.preferredTime; + } + + if ( chr === "Z" ) { + + // Z..ZZZ: same as "xxxx". + if ( length < 4 ) { + chr = "x"; + length = 4; + + // ZZZZ: same as "OOOO". + } else if ( length < 5 ) { + chr = "O"; + length = 4; + + // ZZZZZ: same as "XXXXX" + } else { + chr = "X"; + length = 5; + } + } + + switch ( chr ) { + + // Era + case "G": + ret = properties.eras[ date.getFullYear() < 0 ? 0 : 1 ]; + break; + + // Year + case "y": + + // Plain year. + // The length specifies the padding, but for two letters it also specifies the + // maximum length. + ret = date.getFullYear(); + if ( length === 2 ) { + ret = String( ret ); + ret = +ret.substr( ret.length - 2 ); + } + break; + + case "Y": + + // Year in "Week of Year" + // The length specifies the padding, but for two letters it also specifies the + // maximum length. + // yearInWeekofYear = date + DaysInAWeek - (dayOfWeek - firstDay) - minDays + ret = new Date( date.getTime() ); + ret.setDate( + ret.getDate() + 7 - + dateDayOfWeek( date, properties.firstDay ) - + properties.firstDay - + properties.minDays + ); + ret = ret.getFullYear(); + if ( length === 2 ) { + ret = String( ret ); + ret = +ret.substr( ret.length - 2 ); + } + break; + + // Quarter + case "Q": + case "q": + ret = Math.ceil( ( date.getMonth() + 1 ) / 3 ); + if ( length > 2 ) { + ret = properties.quarters[ chr ][ length ][ ret ]; + } + break; + + // Month + case "M": + case "L": + ret = date.getMonth() + 1; + if ( length > 2 ) { + ret = properties.months[ chr ][ length ][ ret ]; + } + break; + + // Week + case "w": + + // Week of Year. + // woy = ceil( ( doy + dow of 1/1 ) / 7 ) - minDaysStuff ? 1 : 0. + // TODO should pad on ww? Not documented, but I guess so. + ret = dateDayOfWeek( dateStartOf( date, "year" ), properties.firstDay ); + ret = Math.ceil( ( dateDayOfYear( date ) + ret ) / 7 ) - + ( 7 - ret >= properties.minDays ? 0 : 1 ); + break; + + case "W": + + // Week of Month. + // wom = ceil( ( dom + dow of `1/month` ) / 7 ) - minDaysStuff ? 1 : 0. + ret = dateDayOfWeek( dateStartOf( date, "month" ), properties.firstDay ); + ret = Math.ceil( ( date.getDate() + ret ) / 7 ) - + ( 7 - ret >= properties.minDays ? 0 : 1 ); + break; + + // Day + case "d": + ret = date.getDate(); + break; + + case "D": + ret = dateDayOfYear( date ) + 1; + break; + + case "F": + + // Day of Week in month. eg. 2nd Wed in July. + ret = Math.floor( date.getDate() / 7 ) + 1; + break; + + // Week day + case "e": + case "c": + if ( length <= 2 ) { + + // Range is [1-7] (deduced by example provided on documentation) + // TODO Should pad with zeros (not specified in the docs)? + ret = dateDayOfWeek( date, properties.firstDay ) + 1; + break; + } + + /* falls through */ + case "E": + ret = dateWeekDays[ date.getDay() ]; + ret = properties.days[ chr ][ length ][ ret ]; + break; + + // Period (AM or PM) + case "a": + ret = properties.dayPeriods[ date.getHours() < 12 ? "am" : "pm" ]; + break; + + // Hour + case "h": // 1-12 + ret = ( date.getHours() % 12 ) || 12; + break; + + case "H": // 0-23 + ret = date.getHours(); + break; + + case "K": // 0-11 + ret = date.getHours() % 12; + break; + + case "k": // 1-24 + ret = date.getHours() || 24; + break; + + // Minute + case "m": + ret = date.getMinutes(); + break; + + // Second + case "s": + ret = date.getSeconds(); + break; + + case "S": + ret = Math.round( date.getMilliseconds() * Math.pow( 10, length - 3 ) ); + break; + + case "A": + ret = Math.round( dateMillisecondsInDay( date ) * Math.pow( 10, length - 3 ) ); + break; + + // Zone + case "z": + case "O": + + // O: "{gmtFormat}+H;{gmtFormat}-H" or "{gmtZeroFormat}", eg. "GMT-8" or "GMT". + // OOOO: "{gmtFormat}{hourFormat}" or "{gmtZeroFormat}", eg. "GMT-08:00" or "GMT". + if ( date.getTimezoneOffset() === 0 ) { + ret = properties.gmtZeroFormat; + } else { + ret = dateTimezoneHourFormat( + date, + length < 4 ? "+H;-H" : properties.tzLongHourFormat, + timeSeparator, + numberFormatters + ); + ret = properties.gmtFormat.replace( /\{0\}/, ret ); + } + break; + + case "X": + + // Same as x*, except it uses "Z" for zero offset. + if ( date.getTimezoneOffset() === 0 ) { + ret = "Z"; + break; + } + + /* falls through */ + case "x": + + // x: hourFormat("+HH;-HH") + // xx or xxxx: hourFormat("+HHmm;-HHmm") + // xxx or xxxxx: hourFormat("+HH:mm;-HH:mm") + ret = length === 1 ? "+HH;-HH" : ( length % 2 ? "+HH:mm;-HH:mm" : "+HHmm;-HHmm" ); + ret = dateTimezoneHourFormat( date, ret, ":" ); + break; + + // timeSeparator + case ":": + ret = timeSeparator; + break; + + // ' literals. + case "'": + current = current.replace( /''/, "'" ); + if ( length > 2 ) { + current = current.slice( 1, -1 ); + } + ret = current; + break; + + // Anything else is considered a literal, including [ ,:/.@#], chinese, japonese, and + // arabic characters. + default: + ret = current; + } + if ( typeof ret === "number" ) { + ret = numberFormatters[ length ]( ret ); + } + return ret; + }); +}; + + + + +var dateFormatterFn = function( numberFormatters, properties ) { + return function dateFormatter( value ) { + validateParameterPresence( value, "value" ); + validateParameterTypeDate( value, "value" ); + + return dateFormat( value, numberFormatters, properties ); + }; + +}; + + + + +/** + * isLeapYear( year ) + * + * @year [Number] + * + * Returns an indication whether the specified year is a leap year. + */ +var dateIsLeapYear = function( year ) { + return new Date( year, 1, 29 ).getMonth() === 1; +}; + + + + +/** + * lastDayOfMonth( date ) + * + * @date [Date] + * + * Return the last day of the given date's month + */ +var dateLastDayOfMonth = function( date ) { + return new Date( date.getFullYear(), date.getMonth() + 1, 0 ).getDate(); +}; + + + + +/** + * Differently from native date.setDate(), this function returns a date whose + * day remains inside the month boundaries. For example: + * + * setDate( FebDate, 31 ): a "Feb 28" date. + * setDate( SepDate, 31 ): a "Sep 30" date. + */ +var dateSetDate = function( date, day ) { + var lastDay = new Date( date.getFullYear(), date.getMonth() + 1, 0 ).getDate(); + + date.setDate( day < 1 ? 1 : day < lastDay ? day : lastDay ); +}; + + + + +/** + * Differently from native date.setMonth(), this function adjusts date if + * needed, so final month is always the one set. + * + * setMonth( Jan31Date, 1 ): a "Feb 28" date. + * setDate( Jan31Date, 8 ): a "Sep 30" date. + */ +var dateSetMonth = function( date, month ) { + var originalDate = date.getDate(); + + date.setDate( 1 ); + date.setMonth( month ); + dateSetDate( date, originalDate ); +}; + + + + +var outOfRange = function( value, low, high ) { + return value < low || value > high; +}; + + + + +/** + * parse( value, tokens, properties ) + * + * @value [String] string date. + * + * @tokens [Object] tokens returned by date/tokenizer. + * + * @properties [Object] output returned by date/tokenizer-properties. + * + * ref: http://www.unicode.org/reports/tr35/tr35-dates.html#Date_Format_Patterns + */ +var dateParse = function( value, tokens, properties ) { + var amPm, day, daysOfYear, month, era, hour, hour12, timezoneOffset, valid, + YEAR = 0, + MONTH = 1, + DAY = 2, + HOUR = 3, + MINUTE = 4, + SECOND = 5, + MILLISECONDS = 6, + date = new Date(), + truncateAt = [], + units = [ "year", "month", "day", "hour", "minute", "second", "milliseconds" ]; + + if ( !tokens.length ) { + return null; + } + + valid = tokens.every(function( token ) { + var century, chr, value, length; + + if ( token.type === "literal" ) { + + // continue + return true; + } + + chr = token.type.charAt( 0 ); + length = token.type.length; + + if ( chr === "j" ) { + + // Locale preferred hHKk. + // http://www.unicode.org/reports/tr35/tr35-dates.html#Time_Data + chr = properties.preferredTimeData; + } + + switch ( chr ) { + + // Era + case "G": + truncateAt.push( YEAR ); + era = +token.value; + break; + + // Year + case "y": + value = token.value; + if ( length === 2 ) { + if ( outOfRange( value, 0, 99 ) ) { + return false; + } + + // mimic dojo/date/locale: choose century to apply, according to a sliding + // window of 80 years before and 20 years after present year. + century = Math.floor( date.getFullYear() / 100 ) * 100; + value += century; + if ( value > date.getFullYear() + 20 ) { + value -= 100; + } + } + date.setFullYear( value ); + truncateAt.push( YEAR ); + break; + + case "Y": // Year in "Week of Year" + throw createErrorUnsupportedFeature({ + feature: "year pattern `" + chr + "`" + }); + + // Quarter (skip) + case "Q": + case "q": + break; + + // Month + case "M": + case "L": + if ( length <= 2 ) { + value = token.value; + } else { + value = +token.value; + } + if ( outOfRange( value, 1, 12 ) ) { + return false; + } + + // Setting the month later so that we have the correct year and can determine + // the correct last day of February in case of leap year. + month = value; + truncateAt.push( MONTH ); + break; + + // Week (skip) + case "w": // Week of Year. + case "W": // Week of Month. + break; + + // Day + case "d": + day = token.value; + truncateAt.push( DAY ); + break; + + case "D": + daysOfYear = token.value; + truncateAt.push( DAY ); + break; + + case "F": + + // Day of Week in month. eg. 2nd Wed in July. + // Skip + break; + + // Week day + case "e": + case "c": + case "E": + + // Skip. + // value = arrayIndexOf( dateWeekDays, token.value ); + break; + + // Period (AM or PM) + case "a": + amPm = token.value; + break; + + // Hour + case "h": // 1-12 + value = token.value; + if ( outOfRange( value, 1, 12 ) ) { + return false; + } + hour = hour12 = true; + date.setHours( value === 12 ? 0 : value ); + truncateAt.push( HOUR ); + break; + + case "K": // 0-11 + value = token.value; + if ( outOfRange( value, 0, 11 ) ) { + return false; + } + hour = hour12 = true; + date.setHours( value ); + truncateAt.push( HOUR ); + break; + + case "k": // 1-24 + value = token.value; + if ( outOfRange( value, 1, 24 ) ) { + return false; + } + hour = true; + date.setHours( value === 24 ? 0 : value ); + truncateAt.push( HOUR ); + break; + + case "H": // 0-23 + value = token.value; + if ( outOfRange( value, 0, 23 ) ) { + return false; + } + hour = true; + date.setHours( value ); + truncateAt.push( HOUR ); + break; + + // Minute + case "m": + value = token.value; + if ( outOfRange( value, 0, 59 ) ) { + return false; + } + date.setMinutes( value ); + truncateAt.push( MINUTE ); + break; + + // Second + case "s": + value = token.value; + if ( outOfRange( value, 0, 59 ) ) { + return false; + } + date.setSeconds( value ); + truncateAt.push( SECOND ); + break; + + case "A": + date.setHours( 0 ); + date.setMinutes( 0 ); + date.setSeconds( 0 ); + + /* falls through */ + case "S": + value = Math.round( token.value * Math.pow( 10, 3 - length ) ); + date.setMilliseconds( value ); + truncateAt.push( MILLISECONDS ); + break; + + // Zone + case "Z": + case "z": + case "O": + case "X": + case "x": + timezoneOffset = token.value - date.getTimezoneOffset(); + break; + } + + return true; + }); + + if ( !valid ) { + return null; + } + + // 12-hour format needs AM or PM, 24-hour format doesn't, ie. return null + // if amPm && !hour12 || !amPm && hour12. + if ( hour && !( !amPm ^ hour12 ) ) { + return null; + } + + if ( era === 0 ) { + + // 1 BC = year 0 + date.setFullYear( date.getFullYear() * -1 + 1 ); + } + + if ( month !== undefined ) { + dateSetMonth( date, month - 1 ); + } + + if ( day !== undefined ) { + if ( outOfRange( day, 1, dateLastDayOfMonth( date ) ) ) { + return null; + } + date.setDate( day ); + } else if ( daysOfYear !== undefined ) { + if ( outOfRange( daysOfYear, 1, dateIsLeapYear( date.getFullYear() ) ? 366 : 365 ) ) { + return null; + } + date.setMonth( 0 ); + date.setDate( daysOfYear ); + } + + if ( hour12 && amPm === "pm" ) { + date.setHours( date.getHours() + 12 ); + } + + if ( timezoneOffset ) { + date.setMinutes( date.getMinutes() + timezoneOffset ); + } + + // Truncate date at the most precise unit defined. Eg. + // If value is "12/31", and pattern is "MM/dd": + // => new Date( , 12, 31, 0, 0, 0, 0 ); + truncateAt = Math.max.apply( null, truncateAt ); + date = dateStartOf( date, units[ truncateAt ] ); + + return date; +}; + + + + +/** + * Generated by: + * + * regenerate().add( require( "unicode-7.0.0/categories/N/symbols" ) ).toString(); + * + * https://github.com/mathiasbynens/regenerate + * https://github.com/mathiasbynens/unicode-7.0.0 + */ +var regexpN = /[0-9\xB2\xB3\xB9\xBC-\xBE\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u09F4-\u09F9\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0B72-\u0B77\u0BE6-\u0BF2\u0C66-\u0C6F\u0C78-\u0C7E\u0CE6-\u0CEF\u0D66-\u0D75\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F33\u1040-\u1049\u1090-\u1099\u1369-\u137C\u16EE-\u16F0\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1946-\u194F\u19D0-\u19DA\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\u2070\u2074-\u2079\u2080-\u2089\u2150-\u2182\u2185-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2CFD\u3007\u3021-\u3029\u3038-\u303A\u3192-\u3195\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\uA620-\uA629\uA6E6-\uA6EF\uA830-\uA835\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19]|\uD800[\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDEE1-\uDEFB\uDF20-\uDF23\uDF41\uDF4A\uDFD1-\uDFD5]|\uD801[\uDCA0-\uDCA9]|\uD802[\uDC58-\uDC5F\uDC79-\uDC7F\uDCA7-\uDCAF\uDD16-\uDD1B\uDE40-\uDE47\uDE7D\uDE7E\uDE9D-\uDE9F\uDEEB-\uDEEF\uDF58-\uDF5F\uDF78-\uDF7F\uDFA9-\uDFAF]|\uD803[\uDE60-\uDE7E]|\uD804[\uDC52-\uDC6F\uDCF0-\uDCF9\uDD36-\uDD3F\uDDD0-\uDDD9\uDDE1-\uDDF4\uDEF0-\uDEF9]|\uD805[\uDCD0-\uDCD9\uDE50-\uDE59\uDEC0-\uDEC9]|\uD806[\uDCE0-\uDCF2]|\uD809[\uDC00-\uDC6E]|\uD81A[\uDE60-\uDE69\uDF50-\uDF59\uDF5B-\uDF61]|\uD834[\uDF60-\uDF71]|\uD835[\uDFCE-\uDFFF]|\uD83A[\uDCC7-\uDCCF]|\uD83C[\uDD00-\uDD0C]/; + + + + +/** + * tokenizer( value, pattern, properties ) + * + * @value [String] string date. + * + * @properties [Object] output returned by date/tokenizer-properties. + * + * Returns an Array of tokens, eg. value "5 o'clock PM", pattern "h 'o''clock' a": + * [{ + * type: "h", + * lexeme: "5" + * }, { + * type: "literal", + * lexeme: " " + * }, { + * type: "literal", + * lexeme: "o'clock" + * }, { + * type: "literal", + * lexeme: " " + * }, { + * type: "a", + * lexeme: "PM", + * value: "pm" + * }] + * + * OBS: lexeme's are always String and may return invalid ranges depending of the token type. + * Eg. "99" for month number. + * + * Return an empty Array when not successfully parsed. + */ +var dateTokenizer = function( value, numberParser, properties ) { + var valid, + timeSeparator = properties.timeSeparator, + tokens = [], + widths = [ "abbreviated", "wide", "narrow" ]; + + valid = properties.pattern.match( datePatternRe ).every(function( current ) { + var chr, length, numeric, tokenRe, + token = {}; + + function hourFormatParse( tokenRe, numberParser ) { + var aux = value.match( tokenRe ); + numberParser = numberParser || function( value ) { + return +value; + }; + + if ( !aux ) { + return false; + } + + // hourFormat containing H only, e.g., `+H;-H` + if ( aux.length < 8 ) { + token.value = + ( aux[ 1 ] ? -numberParser( aux[ 1 ] ) : numberParser( aux[ 4 ] ) ) * 60; + + // hourFormat containing H and m, e.g., `+HHmm;-HHmm` + } else { + token.value = + ( aux[ 1 ] ? -numberParser( aux[ 1 ] ) : numberParser( aux[ 7 ] ) ) * 60 + + ( aux[ 1 ] ? -numberParser( aux[ 4 ] ) : numberParser( aux[ 10 ] ) ); + } + + return true; + } + + // Transform: + // - "+H;-H" -> /\+(\d\d?)|-(\d\d?)/ + // - "+HH;-HH" -> /\+(\d\d)|-(\d\d)/ + // - "+HHmm;-HHmm" -> /\+(\d\d)(\d\d)|-(\d\d)(\d\d)/ + // - "+HH:mm;-HH:mm" -> /\+(\d\d):(\d\d)|-(\d\d):(\d\d)/ + // + // If gmtFormat is GMT{0}, the regexp must fill {0} in each side, e.g.: + // - "+H;-H" -> /GMT\+(\d\d?)|GMT-(\d\d?)/ + function hourFormatRe( hourFormat, gmtFormat, timeSeparator ) { + var re; + + if ( !gmtFormat ) { + gmtFormat = "{0}"; + } + + re = hourFormat + .replace( "+", "\\+" ) + + // Unicode equivalent to (\\d\\d) + .replace( /HH|mm/g, "((" + regexpN.source + ")(" + regexpN.source + "))" ) + + // Unicode equivalent to (\\d\\d?) + .replace( /H|m/g, "((" + regexpN.source + ")(" + regexpN.source + ")?)" ); + + if ( timeSeparator ) { + re = re.replace( /:/g, timeSeparator ); + } + + re = re.split( ";" ).map(function( part ) { + return gmtFormat.replace( "{0}", part ); + }).join( "|" ); + + return new RegExp( re ); + } + + function oneDigitIfLengthOne() { + if ( length === 1 ) { + + // Unicode equivalent to /\d/ + numeric = true; + return tokenRe = regexpN; + } + } + + function oneOrTwoDigitsIfLengthOne() { + if ( length === 1 ) { + + // Unicode equivalent to /\d\d?/ + numeric = true; + return tokenRe = new RegExp( "(" + regexpN.source + ")(" + regexpN.source + ")?" ); + } + } + + function twoDigitsIfLengthTwo() { + if ( length === 2 ) { + + // Unicode equivalent to /\d\d/ + numeric = true; + return tokenRe = new RegExp( "(" + regexpN.source + ")(" + regexpN.source + ")" ); + } + } + + // Brute-force test every locale entry in an attempt to match the given value. + // Return the first found one (and set token accordingly), or null. + function lookup( path ) { + var i, re, + data = properties[ path.join( "/" ) ]; + + for ( i in data ) { + re = new RegExp( "^" + data[ i ] ); + if ( re.test( value ) ) { + token.value = i; + return tokenRe = new RegExp( data[ i ] ); + } + } + return null; + } + + token.type = current; + chr = current.charAt( 0 ), + length = current.length; + + if ( chr === "Z" ) { + + // Z..ZZZ: same as "xxxx". + if ( length < 4 ) { + chr = "x"; + length = 4; + + // ZZZZ: same as "OOOO". + } else if ( length < 5 ) { + chr = "O"; + length = 4; + + // ZZZZZ: same as "XXXXX" + } else { + chr = "X"; + length = 5; + } + } + + switch ( chr ) { + + // Era + case "G": + lookup([ + "gregorian/eras", + length <= 3 ? "eraAbbr" : ( length === 4 ? "eraNames" : "eraNarrow" ) + ]); + break; + + // Year + case "y": + case "Y": + numeric = true; + + // number l=1:+, l=2:{2}, l=3:{3,}, l=4:{4,}, ... + if ( length === 1 ) { + + // Unicode equivalent to /\d+/. + tokenRe = new RegExp( "(" + regexpN.source + ")+" ); + } else if ( length === 2 ) { + + // Unicode equivalent to /\d\d/ + tokenRe = new RegExp( "(" + regexpN.source + ")(" + regexpN.source + ")" ); + } else { + + // Unicode equivalent to /\d{length,}/ + tokenRe = new RegExp( "(" + regexpN.source + "){" + length + ",}" ); + } + break; + + // Quarter + case "Q": + case "q": + + // number l=1:{1}, l=2:{2}. + // lookup l=3... + oneDigitIfLengthOne() || twoDigitsIfLengthTwo() || lookup([ + "gregorian/quarters", + chr === "Q" ? "format" : "stand-alone", + widths[ length - 3 ] + ]); + break; + + // Month + case "M": + case "L": + + // number l=1:{1,2}, l=2:{2}. + // lookup l=3... + oneOrTwoDigitsIfLengthOne() || twoDigitsIfLengthTwo() || lookup([ + "gregorian/months", + chr === "M" ? "format" : "stand-alone", + widths[ length - 3 ] + ]); + break; + + // Day + case "D": + + // number {l,3}. + if ( length <= 3 ) { + + // Unicode equivalent to /\d{length,3}/ + numeric = true; + tokenRe = new RegExp( "(" + regexpN.source + "){" + length + ",3}" ); + } + break; + + case "W": + case "F": + + // number l=1:{1}. + oneDigitIfLengthOne(); + break; + + // Week day + case "e": + case "c": + + // number l=1:{1}, l=2:{2}. + // lookup for length >=3. + if ( length <= 2 ) { + oneDigitIfLengthOne() || twoDigitsIfLengthTwo(); + break; + } + + /* falls through */ + case "E": + if ( length === 6 ) { + + // Note: if short day names are not explicitly specified, abbreviated day + // names are used instead http://www.unicode.org/reports/tr35/tr35-dates.html#months_days_quarters_eras + lookup([ + "gregorian/days", + [ chr === "c" ? "stand-alone" : "format" ], + "short" + ]) || lookup([ + "gregorian/days", + [ chr === "c" ? "stand-alone" : "format" ], + "abbreviated" + ]); + } else { + lookup([ + "gregorian/days", + [ chr === "c" ? "stand-alone" : "format" ], + widths[ length < 3 ? 0 : length - 3 ] + ]); + } + break; + + // Period (AM or PM) + case "a": + lookup([ + "gregorian/dayPeriods/format/wide" + ]); + break; + + // Week, Day, Hour, Minute, or Second + case "w": + case "d": + case "h": + case "H": + case "K": + case "k": + case "j": + case "m": + case "s": + + // number l1:{1,2}, l2:{2}. + oneOrTwoDigitsIfLengthOne() || twoDigitsIfLengthTwo(); + break; + + case "S": + + // number {l}. + + // Unicode equivalent to /\d{length}/ + numeric = true; + tokenRe = new RegExp( "(" + regexpN.source + "){" + length + "}" ); + break; + + case "A": + + // number {l+5}. + + // Unicode equivalent to /\d{length+5}/ + numeric = true; + tokenRe = new RegExp( "(" + regexpN.source + "){" + ( length + 5 ) + "}" ); + break; + + // Zone + case "z": + case "O": + + // O: "{gmtFormat}+H;{gmtFormat}-H" or "{gmtZeroFormat}", eg. "GMT-8" or "GMT". + // OOOO: "{gmtFormat}{hourFormat}" or "{gmtZeroFormat}", eg. "GMT-08:00" or "GMT". + if ( value === properties[ "timeZoneNames/gmtZeroFormat" ] ) { + token.value = 0; + tokenRe = new RegExp( properties[ "timeZoneNames/gmtZeroFormat" ] ); + } else { + tokenRe = hourFormatRe( + length < 4 ? "+H;-H" : properties[ "timeZoneNames/hourFormat" ], + properties[ "timeZoneNames/gmtFormat" ], + timeSeparator + ); + if ( !hourFormatParse( tokenRe, numberParser ) ) { + return null; + } + } + break; + + case "X": + + // Same as x*, except it uses "Z" for zero offset. + if ( value === "Z" ) { + token.value = 0; + tokenRe = /Z/; + break; + } + + /* falls through */ + case "x": + + // x: hourFormat("+HH;-HH") + // xx or xxxx: hourFormat("+HHmm;-HHmm") + // xxx or xxxxx: hourFormat("+HH:mm;-HH:mm") + tokenRe = hourFormatRe( + length === 1 ? "+HH;-HH" : ( length % 2 ? "+HH:mm;-HH:mm" : "+HHmm;-HHmm" ) + ); + if ( !hourFormatParse( tokenRe ) ) { + return null; + } + break; + + case "'": + token.type = "literal"; + current = current.replace( /''/, "'" ); + if ( length > 2 ) { + current = current.slice( 1, -1 ); + } + tokenRe = new RegExp( regexpEscape( current ) ); + break; + + default: + token.type = "literal"; + tokenRe = /./; + } + + if ( !tokenRe ) { + return false; + } + + // Get lexeme and consume it. + value = value.replace( new RegExp( "^" + tokenRe.source ), function( lexeme ) { + token.lexeme = lexeme; + if ( numeric ) { + token.value = numberParser( lexeme ); + } + return ""; + }); + + if ( !token.lexeme ) { + return false; + } + + tokens.push( token ); + return true; + }); + + if ( value !== "" ) { + valid = false; + } + + return valid ? tokens : []; +}; + + + + +var dateParserFn = function( numberParser, parseProperties, tokenizerProperties ) { + return function dateParser( value ) { + var tokens; + + validateParameterPresence( value, "value" ); + validateParameterTypeString( value, "value" ); + + tokens = dateTokenizer( value, numberParser, tokenizerProperties ); + return dateParse( value, tokens, parseProperties ) || null; + }; +}; + + + + +Globalize._dateFormatterFn = dateFormatterFn; +Globalize._dateParserFn = dateParserFn; +Globalize._dateFormat = dateFormat; +Globalize._dateParser = dateParse; +Globalize._dateTokenizer = dateTokenizer; +Globalize._validateParameterTypeDate = validateParameterTypeDate; + +Globalize.dateFormatter = +Globalize.prototype.dateFormatter = function( options ) { + options = options || { skeleton: "yMd" }; + return Globalize[ runtimeKey( "dateFormatter", this._locale, [ options ] ) ]; +}; + +Globalize.dateParser = +Globalize.prototype.dateParser = function( options ) { + options = options || { skeleton: "yMd" }; + return Globalize[ runtimeKey( "dateParser", this._locale, [ options ] ) ]; +}; + +Globalize.formatDate = +Globalize.prototype.formatDate = function( value, options ) { + validateParameterPresence( value, "value" ); + validateParameterTypeDate( value, "value" ); + + return this.dateFormatter( options )( value ); +}; + +Globalize.parseDate = +Globalize.prototype.parseDate = function( value, options ) { + validateParameterPresence( value, "value" ); + validateParameterTypeString( value, "value" ); + + return this.dateParser( options )( value ); +}; + +return Globalize; + + + + +})); diff --git a/StockManMVC/bower_components/globalize/dist/globalize-runtime/message.js b/StockManMVC/bower_components/globalize/dist/globalize-runtime/message.js new file mode 100644 index 0000000..2637d11 --- /dev/null +++ b/StockManMVC/bower_components/globalize/dist/globalize-runtime/message.js @@ -0,0 +1,116 @@ +/** + * Globalize Runtime v1.1.1 + * + * http://github.com/jquery/globalize + * + * Copyright jQuery Foundation and other contributors + * Released under the MIT license + * http://jquery.org/license + * + * Date: 2016-02-04T12:01Z + */ +/*! + * Globalize Runtime v1.1.1 2016-02-04T12:01Z Released under the MIT license + * http://git.io/TrdQbw + */ +(function( root, factory ) { + + // UMD returnExports + if ( typeof define === "function" && define.amd ) { + + // AMD + define([ + "../globalize-runtime" + ], factory ); + } else if ( typeof exports === "object" ) { + + // Node, CommonJS + module.exports = factory( require( "../globalize-runtime" ) ); + } else { + + // Extend global + factory( root.Globalize ); + } +}(this, function( Globalize ) { + +var runtimeKey = Globalize._runtimeKey, + validateParameterType = Globalize._validateParameterType; + + +/** + * Function inspired by jQuery Core, but reduced to our use case. + */ +var isPlainObject = function( obj ) { + return obj !== null && "" + obj === "[object Object]"; +}; + + + + +var validateParameterTypeMessageVariables = function( value, name ) { + validateParameterType( + value, + name, + value === undefined || isPlainObject( value ) || Array.isArray( value ), + "Array or Plain Object" + ); +}; + + + + +var messageFormatterFn = function( formatter ) { + return function messageFormatter( variables ) { + if ( typeof variables === "number" || typeof variables === "string" ) { + variables = [].slice.call( arguments, 0 ); + } + validateParameterTypeMessageVariables( variables, "variables" ); + return formatter( variables ); + }; +}; + + + + +Globalize._messageFormatterFn = messageFormatterFn; +/* jshint ignore:start */ +Globalize._messageFormat = (function() { +var number = function (value, offset) { + if (isNaN(value)) throw new Error("'" + value + "' isn't a number."); + return value - (offset || 0); +}; +var plural = function (value, offset, lcfunc, data, isOrdinal) { + if ({}.hasOwnProperty.call(data, value)) return data[value](); + if (offset) value -= offset; + var key = lcfunc(value, isOrdinal); + if (key in data) return data[key](); + return data.other(); +}; +var select = function (value, data) { + if ({}.hasOwnProperty.call(data, value)) return data[value](); + return data.other() +}; + +return {number: number, plural: plural, select: select}; +}()); +/* jshint ignore:end */ +Globalize._validateParameterTypeMessageVariables = validateParameterTypeMessageVariables; + +Globalize.messageFormatter = +Globalize.prototype.messageFormatter = function( /* path */ ) { + return Globalize[ + runtimeKey( "messageFormatter", this._locale, [].slice.call( arguments, 0 ) ) + ]; +}; + +Globalize.formatMessage = +Globalize.prototype.formatMessage = function( path /* , variables */ ) { + return this.messageFormatter( path ).apply( {}, [].slice.call( arguments, 1 ) ); +}; + +return Globalize; + + + + +})); diff --git a/StockManMVC/bower_components/globalize/dist/globalize-runtime/number.js b/StockManMVC/bower_components/globalize/dist/globalize-runtime/number.js new file mode 100644 index 0000000..8ff668b --- /dev/null +++ b/StockManMVC/bower_components/globalize/dist/globalize-runtime/number.js @@ -0,0 +1,682 @@ +/** + * Globalize Runtime v1.1.1 + * + * http://github.com/jquery/globalize + * + * Copyright jQuery Foundation and other contributors + * Released under the MIT license + * http://jquery.org/license + * + * Date: 2016-02-04T12:01Z + */ +/*! + * Globalize Runtime v1.1.1 2016-02-04T12:01Z Released under the MIT license + * http://git.io/TrdQbw + */ +(function( root, factory ) { + + // UMD returnExports + if ( typeof define === "function" && define.amd ) { + + // AMD + define([ + "../globalize-runtime" + ], factory ); + } else if ( typeof exports === "object" ) { + + // Node, CommonJS + module.exports = factory( require( "../globalize-runtime" ) ); + } else { + + // Extend global + factory( root.Globalize ); + } +}(this, function( Globalize ) { + +var createError = Globalize._createError, + regexpEscape = Globalize._regexpEscape, + runtimeKey = Globalize._runtimeKey, + stringPad = Globalize._stringPad, + validateParameterType = Globalize._validateParameterType, + validateParameterPresence = Globalize._validateParameterPresence, + validateParameterTypeString = Globalize._validateParameterTypeString; + + +var createErrorUnsupportedFeature = function( feature ) { + return createError( "E_UNSUPPORTED", "Unsupported {feature}.", { + feature: feature + }); +}; + + + + +var validateParameterTypeNumber = function( value, name ) { + validateParameterType( + value, + name, + value === undefined || typeof value === "number", + "Number" + ); +}; + + + + +/** + * goupingSeparator( number, primaryGroupingSize, secondaryGroupingSize ) + * + * @number [Number]. + * + * @primaryGroupingSize [Number] + * + * @secondaryGroupingSize [Number] + * + * Return the formatted number with group separator. + */ +var numberFormatGroupingSeparator = function( number, primaryGroupingSize, secondaryGroupingSize ) { + var index, + currentGroupingSize = primaryGroupingSize, + ret = "", + sep = ",", + switchToSecondary = secondaryGroupingSize ? true : false; + + number = String( number ).split( "." ); + index = number[ 0 ].length; + + while ( index > currentGroupingSize ) { + ret = number[ 0 ].slice( index - currentGroupingSize, index ) + + ( ret.length ? sep : "" ) + ret; + index -= currentGroupingSize; + if ( switchToSecondary ) { + currentGroupingSize = secondaryGroupingSize; + switchToSecondary = false; + } + } + + number[ 0 ] = number[ 0 ].slice( 0, index ) + ( ret.length ? sep : "" ) + ret; + return number.join( "." ); +}; + + + + +/** + * integerFractionDigits( number, minimumIntegerDigits, minimumFractionDigits, + * maximumFractionDigits, round, roundIncrement ) + * + * @number [Number] + * + * @minimumIntegerDigits [Number] + * + * @minimumFractionDigits [Number] + * + * @maximumFractionDigits [Number] + * + * @round [Function] + * + * @roundIncrement [Function] + * + * Return the formatted integer and fraction digits. + */ +var numberFormatIntegerFractionDigits = function( number, minimumIntegerDigits, minimumFractionDigits, maximumFractionDigits, round, + roundIncrement ) { + + // Fraction + if ( maximumFractionDigits ) { + + // Rounding + if ( roundIncrement ) { + number = round( number, roundIncrement ); + + // Maximum fraction digits + } else { + number = round( number, { exponent: -maximumFractionDigits } ); + } + + // Minimum fraction digits + if ( minimumFractionDigits ) { + number = String( number ).split( "." ); + number[ 1 ] = stringPad( number[ 1 ] || "", minimumFractionDigits, true ); + number = number.join( "." ); + } + } else { + number = round( number ); + } + + number = String( number ); + + // Minimum integer digits + if ( minimumIntegerDigits ) { + number = number.split( "." ); + number[ 0 ] = stringPad( number[ 0 ], minimumIntegerDigits ); + number = number.join( "." ); + } + + return number; +}; + + + + +/** + * toPrecision( number, precision, round ) + * + * @number (Number) + * + * @precision (Number) significant figures precision (not decimal precision). + * + * @round (Function) + * + * Return number.toPrecision( precision ) using the given round function. + */ +var numberToPrecision = function( number, precision, round ) { + var roundOrder; + + // Get number at two extra significant figure precision. + number = number.toPrecision( precision + 2 ); + + // Then, round it to the required significant figure precision. + roundOrder = Math.ceil( Math.log( Math.abs( number ) ) / Math.log( 10 ) ); + roundOrder -= precision; + + return round( number, { exponent: roundOrder } ); +}; + + + + +/** + * toPrecision( number, minimumSignificantDigits, maximumSignificantDigits, round ) + * + * @number [Number] + * + * @minimumSignificantDigits [Number] + * + * @maximumSignificantDigits [Number] + * + * @round [Function] + * + * Return the formatted significant digits number. + */ +var numberFormatSignificantDigits = function( number, minimumSignificantDigits, maximumSignificantDigits, round ) { + var atMinimum, atMaximum; + + // Sanity check. + if ( minimumSignificantDigits > maximumSignificantDigits ) { + maximumSignificantDigits = minimumSignificantDigits; + } + + atMinimum = numberToPrecision( number, minimumSignificantDigits, round ); + atMaximum = numberToPrecision( number, maximumSignificantDigits, round ); + + // Use atMaximum only if it has more significant digits than atMinimum. + number = +atMinimum === +atMaximum ? atMinimum : atMaximum; + + // Expand integer numbers, eg. 123e5 to 12300. + number = ( +number ).toString( 10 ); + + if ( ( /e/ ).test( number ) ) { + throw createErrorUnsupportedFeature({ + feature: "integers out of (1e21, 1e-7)" + }); + } + + // Add trailing zeros if necessary. + if ( minimumSignificantDigits - number.replace( /^0+|\./g, "" ).length > 0 ) { + number = number.split( "." ); + number[ 1 ] = stringPad( number[ 1 ] || "", minimumSignificantDigits - number[ 0 ].replace( /^0+/, "" ).length, true ); + number = number.join( "." ); + } + + return number; +}; + + + + +/** + * format( number, properties ) + * + * @number [Number]. + * + * @properties [Object] Output of number/format-properties. + * + * Return the formatted number. + * ref: http://www.unicode.org/reports/tr35/tr35-numbers.html + */ +var numberFormat = function( number, properties ) { + var infinitySymbol, maximumFractionDigits, maximumSignificantDigits, minimumFractionDigits, + minimumIntegerDigits, minimumSignificantDigits, nanSymbol, nuDigitsMap, padding, prefix, + primaryGroupingSize, pattern, ret, round, roundIncrement, secondaryGroupingSize, suffix, + symbolMap; + + padding = properties[ 1 ]; + minimumIntegerDigits = properties[ 2 ]; + minimumFractionDigits = properties[ 3 ]; + maximumFractionDigits = properties[ 4 ]; + minimumSignificantDigits = properties[ 5 ]; + maximumSignificantDigits = properties[ 6 ]; + roundIncrement = properties[ 7 ]; + primaryGroupingSize = properties[ 8 ]; + secondaryGroupingSize = properties[ 9 ]; + round = properties[ 15 ]; + infinitySymbol = properties[ 16 ]; + nanSymbol = properties[ 17 ]; + symbolMap = properties[ 18 ]; + nuDigitsMap = properties[ 19 ]; + + // NaN + if ( isNaN( number ) ) { + return nanSymbol; + } + + if ( number < 0 ) { + pattern = properties[ 12 ]; + prefix = properties[ 13 ]; + suffix = properties[ 14 ]; + } else { + pattern = properties[ 11 ]; + prefix = properties[ 0 ]; + suffix = properties[ 10 ]; + } + + // Infinity + if ( !isFinite( number ) ) { + return prefix + infinitySymbol + suffix; + } + + ret = prefix; + + // Percent + if ( pattern.indexOf( "%" ) !== -1 ) { + number *= 100; + + // Per mille + } else if ( pattern.indexOf( "\u2030" ) !== -1 ) { + number *= 1000; + } + + // Significant digit format + if ( !isNaN( minimumSignificantDigits * maximumSignificantDigits ) ) { + number = numberFormatSignificantDigits( number, minimumSignificantDigits, + maximumSignificantDigits, round ); + + // Integer and fractional format + } else { + number = numberFormatIntegerFractionDigits( number, minimumIntegerDigits, + minimumFractionDigits, maximumFractionDigits, round, roundIncrement ); + } + + // Remove the possible number minus sign + number = number.replace( /^-/, "" ); + + // Grouping separators + if ( primaryGroupingSize ) { + number = numberFormatGroupingSeparator( number, primaryGroupingSize, + secondaryGroupingSize ); + } + + ret += number; + + // Scientific notation + // TODO implement here + + // Padding/'([^']|'')+'|''|[.,\-+E%\u2030]/g + // TODO implement here + + ret += suffix; + + return ret.replace( /('([^']|'')+'|'')|./g, function( character, literal ) { + + // Literals + if ( literal ) { + literal = literal.replace( /''/, "'" ); + if ( literal.length > 2 ) { + literal = literal.slice( 1, -1 ); + } + return literal; + } + + // Symbols + character = character.replace( /[.,\-+E%\u2030]/, function( symbol ) { + return symbolMap[ symbol ]; + }); + + // Numbering system + if ( nuDigitsMap ) { + character = character.replace( /[0-9]/, function( digit ) { + return nuDigitsMap[ +digit ]; + }); + } + + return character; + }); +}; + + + + +var numberFormatterFn = function( properties ) { + return function numberFormatter( value ) { + validateParameterPresence( value, "value" ); + validateParameterTypeNumber( value, "value" ); + + return numberFormat( value, properties ); + }; +}; + + + + +/** + * EBNF representation: + * + * number_pattern_re = prefix_including_padding? + * number + * scientific_notation? + * suffix? + * + * number = integer_including_group_separator fraction_including_decimal_separator + * + * integer_including_group_separator = + * regexp([0-9,]*[0-9]+) + * + * fraction_including_decimal_separator = + * regexp((\.[0-9]+)?) + + * prefix_including_padding = non_number_stuff + * + * scientific_notation = regexp(E[+-]?[0-9]+) + * + * suffix = non_number_stuff + * + * non_number_stuff = regexp([^0-9]*) + * + * + * Regexp groups: + * + * 0: number_pattern_re + * 1: prefix + * 2: integer_including_group_separator fraction_including_decimal_separator + * 3: integer_including_group_separator + * 4: fraction_including_decimal_separator + * 5: scientific_notation + * 6: suffix + */ +var numberNumberRe = ( /^([^0-9]*)(([0-9,]*[0-9]+)(\.[0-9]+)?)(E[+-]?[0-9]+)?([^0-9]*)$/ ); + + + + +/** + * parse( value, properties ) + * + * @value [String]. + * + * @properties [Object] Parser properties is a reduced pre-processed cldr + * data set returned by numberParserProperties(). + * + * Return the parsed Number (including Infinity) or NaN when value is invalid. + * ref: http://www.unicode.org/reports/tr35/tr35-numbers.html + */ +var numberParse = function( value, properties ) { + var aux, infinitySymbol, invertedNuDigitsMap, invertedSymbolMap, localizedDigitRe, + localizedSymbolsRe, negativePrefix, negativeSuffix, number, prefix, suffix; + + infinitySymbol = properties[ 0 ]; + invertedSymbolMap = properties[ 1 ]; + negativePrefix = properties[ 2 ]; + negativeSuffix = properties[ 3 ]; + invertedNuDigitsMap = properties[ 4 ]; + + // Infinite number. + if ( aux = value.match( infinitySymbol ) ) { + + number = Infinity; + prefix = value.slice( 0, aux.length ); + suffix = value.slice( aux.length + 1 ); + + // Finite number. + } else { + + // TODO: Create it during setup, i.e., make it a property. + localizedSymbolsRe = new RegExp( + Object.keys( invertedSymbolMap ).map(function( localizedSymbol ) { + return regexpEscape( localizedSymbol ); + }).join( "|" ), + "g" + ); + + // Reverse localized symbols. + value = value.replace( localizedSymbolsRe, function( localizedSymbol ) { + return invertedSymbolMap[ localizedSymbol ]; + }); + + // Reverse localized numbering system. + if ( invertedNuDigitsMap ) { + + // TODO: Create it during setup, i.e., make it a property. + localizedDigitRe = new RegExp( + Object.keys( invertedNuDigitsMap ).map(function( localizedDigit ) { + return regexpEscape( localizedDigit ); + }).join( "|" ), + "g" + ); + value = value.replace( localizedDigitRe, function( localizedDigit ) { + return invertedNuDigitsMap[ localizedDigit ]; + }); + } + + // Add padding zero to leading decimal. + if ( value.charAt( 0 ) === "." ) { + value = "0" + value; + } + + // Is it a valid number? + value = value.match( numberNumberRe ); + if ( !value ) { + + // Invalid number. + return NaN; + } + + prefix = value[ 1 ]; + suffix = value[ 6 ]; + + // Remove grouping separators. + number = value[ 2 ].replace( /,/g, "" ); + + // Scientific notation + if ( value[ 5 ] ) { + number += value[ 5 ]; + } + + number = +number; + + // Is it a valid number? + if ( isNaN( number ) ) { + + // Invalid number. + return NaN; + } + + // Percent + if ( value[ 0 ].indexOf( "%" ) !== -1 ) { + number /= 100; + suffix = suffix.replace( "%", "" ); + + // Per mille + } else if ( value[ 0 ].indexOf( "\u2030" ) !== -1 ) { + number /= 1000; + suffix = suffix.replace( "\u2030", "" ); + } + } + + // Negative number + // "If there is an explicit negative subpattern, it serves only to specify the negative prefix + // and suffix. If there is no explicit negative subpattern, the negative subpattern is the + // localized minus sign prefixed to the positive subpattern" UTS#35 + if ( prefix === negativePrefix && suffix === negativeSuffix ) { + number *= -1; + } + + return number; +}; + + + + +var numberParserFn = function( properties ) { + return function numberParser( value ) { + validateParameterPresence( value, "value" ); + validateParameterTypeString( value, "value" ); + + return numberParse( value, properties ); + }; + +}; + + + + +var numberTruncate = function( value ) { + if ( isNaN( value ) ) { + return NaN; + } + return Math[ value < 0 ? "ceil" : "floor" ]( value ); +}; + + + + +/** + * round( method ) + * + * @method [String] with either "round", "ceil", "floor", or "truncate". + * + * Return function( value, incrementOrExp ): + * + * @value [Number] eg. 123.45. + * + * @incrementOrExp [Number] optional, eg. 0.1; or + * [Object] Either { increment: } or { exponent: } + * + * Return the rounded number, eg: + * - round( "round" )( 123.45 ): 123; + * - round( "ceil" )( 123.45 ): 124; + * - round( "floor" )( 123.45 ): 123; + * - round( "truncate" )( 123.45 ): 123; + * - round( "round" )( 123.45, 0.1 ): 123.5; + * - round( "round" )( 123.45, 10 ): 120; + * + * Based on https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/round + * Ref: #376 + */ +var numberRound = function( method ) { + method = method || "round"; + method = method === "truncate" ? numberTruncate : Math[ method ]; + + return function( value, incrementOrExp ) { + var exp, increment; + + value = +value; + + // If the value is not a number, return NaN. + if ( isNaN( value ) ) { + return NaN; + } + + // Exponent given. + if ( typeof incrementOrExp === "object" && incrementOrExp.exponent ) { + exp = +incrementOrExp.exponent; + increment = 1; + + if ( exp === 0 ) { + return method( value ); + } + + // If the exp is not an integer, return NaN. + if ( !( typeof exp === "number" && exp % 1 === 0 ) ) { + return NaN; + } + + // Increment given. + } else { + increment = +incrementOrExp || 1; + + if ( increment === 1 ) { + return method( value ); + } + + // If the increment is not a number, return NaN. + if ( isNaN( increment ) ) { + return NaN; + } + + increment = increment.toExponential().split( "e" ); + exp = +increment[ 1 ]; + increment = +increment[ 0 ]; + } + + // Shift & Round + value = value.toString().split( "e" ); + value[ 0 ] = +value[ 0 ] / increment; + value[ 1 ] = value[ 1 ] ? ( +value[ 1 ] - exp ) : -exp; + value = method( +( value[ 0 ] + "e" + value[ 1 ] ) ); + + // Shift back + value = value.toString().split( "e" ); + value[ 0 ] = +value[ 0 ] * increment; + value[ 1 ] = value[ 1 ] ? ( +value[ 1 ] + exp ) : exp; + return +( value[ 0 ] + "e" + value[ 1 ] ); + }; +}; + + + + +Globalize._createErrorUnsupportedFeature = createErrorUnsupportedFeature; +Globalize._numberFormat = numberFormat; +Globalize._numberFormatterFn = numberFormatterFn; +Globalize._numberParse = numberParse; +Globalize._numberParserFn = numberParserFn; +Globalize._numberRound = numberRound; +Globalize._validateParameterPresence = validateParameterPresence; +Globalize._validateParameterTypeNumber = validateParameterTypeNumber; +Globalize._validateParameterTypeString = validateParameterTypeString; + +Globalize.numberFormatter = +Globalize.prototype.numberFormatter = function( options ) { + options = options || {}; + return Globalize[ runtimeKey( "numberFormatter", this._locale, [ options ] ) ]; +}; + +Globalize.numberParser = +Globalize.prototype.numberParser = function( options ) { + options = options || {}; + return Globalize[ runtimeKey( "numberParser", this._locale, [ options ] ) ]; +}; + +Globalize.formatNumber = +Globalize.prototype.formatNumber = function( value, options ) { + validateParameterPresence( value, "value" ); + validateParameterTypeNumber( value, "value" ); + + return this.numberFormatter( options )( value ); +}; + +Globalize.parseNumber = +Globalize.prototype.parseNumber = function( value, options ) { + validateParameterPresence( value, "value" ); + validateParameterTypeString( value, "value" ); + + return this.numberParser( options )( value ); +}; + +return Globalize; + + + + +})); diff --git a/StockManMVC/bower_components/globalize/dist/globalize-runtime/plural.js b/StockManMVC/bower_components/globalize/dist/globalize-runtime/plural.js new file mode 100644 index 0000000..146142a --- /dev/null +++ b/StockManMVC/bower_components/globalize/dist/globalize-runtime/plural.js @@ -0,0 +1,86 @@ +/** + * Globalize Runtime v1.1.1 + * + * http://github.com/jquery/globalize + * + * Copyright jQuery Foundation and other contributors + * Released under the MIT license + * http://jquery.org/license + * + * Date: 2016-02-04T12:01Z + */ +/*! + * Globalize Runtime v1.1.1 2016-02-04T12:01Z Released under the MIT license + * http://git.io/TrdQbw + */ +(function( root, factory ) { + + // UMD returnExports + if ( typeof define === "function" && define.amd ) { + + // AMD + define([ + "../globalize-runtime" + ], factory ); + } else if ( typeof exports === "object" ) { + + // Node, CommonJS + module.exports = factory( require( "../globalize-runtime" ) ); + } else { + + // Extend global + factory( root.Globalize ); + } +}(this, function( Globalize ) { + +var runtimeKey = Globalize._runtimeKey, + validateParameterPresence = Globalize._validateParameterPresence, + validateParameterType = Globalize._validateParameterType; + + +var validateParameterTypeNumber = function( value, name ) { + validateParameterType( + value, + name, + value === undefined || typeof value === "number", + "Number" + ); +}; + + + + +var pluralGeneratorFn = function( plural ) { + return function pluralGenerator( value ) { + validateParameterPresence( value, "value" ); + validateParameterTypeNumber( value, "value" ); + + return plural( value ); + }; +}; + + + + +Globalize._pluralGeneratorFn = pluralGeneratorFn; +Globalize._validateParameterTypeNumber = validateParameterTypeNumber; + +Globalize.plural = +Globalize.prototype.plural = function( value, options ) { + validateParameterPresence( value, "value" ); + validateParameterTypeNumber( value, "value" ); + return this.pluralGenerator( options )( value ); +}; + +Globalize.pluralGenerator = +Globalize.prototype.pluralGenerator = function( options ) { + options = options || {}; + return Globalize[ runtimeKey( "pluralGenerator", this._locale, [ options ] ) ]; +}; + +return Globalize; + + + + +})); diff --git a/StockManMVC/bower_components/globalize/dist/globalize-runtime/relative-time.js b/StockManMVC/bower_components/globalize/dist/globalize-runtime/relative-time.js new file mode 100644 index 0000000..41e6ec5 --- /dev/null +++ b/StockManMVC/bower_components/globalize/dist/globalize-runtime/relative-time.js @@ -0,0 +1,116 @@ +/** + * Globalize Runtime v1.1.1 + * + * http://github.com/jquery/globalize + * + * Copyright jQuery Foundation and other contributors + * Released under the MIT license + * http://jquery.org/license + * + * Date: 2016-02-04T12:01Z + */ +/*! + * Globalize Runtime v1.1.1 2016-02-04T12:01Z Released under the MIT license + * http://git.io/TrdQbw + */ +(function( root, factory ) { + + // UMD returnExports + if ( typeof define === "function" && define.amd ) { + + // AMD + define([ + "../globalize-runtime", + "./number", + "./plural" + ], factory ); + } else if ( typeof exports === "object" ) { + + // Node, CommonJS + module.exports = factory( + require( "../globalize-runtime" ), + require( "./number" ), + require( "./plural" ) + ); + } else { + + // Extend global + factory( root.Globalize ); + } +}(this, function( Globalize ) { + +var formatMessage = Globalize._formatMessage, + runtimeKey = Globalize._runtimeKey, + validateParameterPresence = Globalize._validateParameterPresence, + validateParameterTypeNumber = Globalize._validateParameterTypeNumber; + + +/** + * format( value, numberFormatter, pluralGenerator, properties ) + * + * @value [Number] The number to format + * + * @numberFormatter [String] A numberFormatter from Globalize.numberFormatter + * + * @pluralGenerator [String] A pluralGenerator from Globalize.pluralGenerator + * + * @properties [Object] containing relative time plural message. + * + * Format relative time. + */ +var relativeTimeFormat = function( value, numberFormatter, pluralGenerator, properties ) { + + var relativeTime, + message = properties[ "relative-type-" + value ]; + + if ( message ) { + return message; + } + + relativeTime = value <= 0 ? properties[ "relativeTime-type-past" ] + : properties[ "relativeTime-type-future" ]; + + value = Math.abs( value ); + + message = relativeTime[ "relativeTimePattern-count-" + pluralGenerator( value ) ]; + return formatMessage( message, [ numberFormatter( value ) ] ); +}; + + + + +var relativeTimeFormatterFn = function( numberFormatter, pluralGenerator, properties ) { + return function relativeTimeFormatter( value ) { + validateParameterPresence( value, "value" ); + validateParameterTypeNumber( value, "value" ); + + return relativeTimeFormat( value, numberFormatter, pluralGenerator, properties ); + }; + +}; + + + + +Globalize._relativeTimeFormatterFn = relativeTimeFormatterFn; + +Globalize.formatRelativeTime = +Globalize.prototype.formatRelativeTime = function( value, unit, options ) { + validateParameterPresence( value, "value" ); + validateParameterTypeNumber( value, "value" ); + + return this.relativeTimeFormatter( unit, options )( value ); +}; + +Globalize.relativeTimeFormatter = +Globalize.prototype.relativeTimeFormatter = function( unit, options ) { + options = options || {}; + return Globalize[ runtimeKey( "relativeTimeFormatter", this._locale, [ unit, options ] ) ]; +}; + +return Globalize; + + + + +})); diff --git a/StockManMVC/bower_components/globalize/dist/globalize-runtime/unit.js b/StockManMVC/bower_components/globalize/dist/globalize-runtime/unit.js new file mode 100644 index 0000000..5b5f3e9 --- /dev/null +++ b/StockManMVC/bower_components/globalize/dist/globalize-runtime/unit.js @@ -0,0 +1,127 @@ +/** + * Globalize Runtime v1.1.1 + * + * http://github.com/jquery/globalize + * + * Copyright jQuery Foundation and other contributors + * Released under the MIT license + * http://jquery.org/license + * + * Date: 2016-02-04T12:01Z + */ +/*! + * Globalize Runtime v1.1.1 2016-02-04T12:01Z Released under the MIT license + * http://git.io/TrdQbw + */ +(function( root, factory ) { + + // UMD returnExports + if ( typeof define === "function" && define.amd ) { + + // AMD + define([ + "../globalize-runtime", + "./number", + "./plural" + ], factory ); + } else if ( typeof exports === "object" ) { + + // Node, CommonJS + module.exports = factory( + require( "../globalize-runtime" ), + require( "./number" ), + require( "./plural" ) + ); + } else { + + // Extend global + factory( root.Globalize ); + } +}(this, function( Globalize ) { + +var formatMessage = Globalize._formatMessage, + runtimeKey = Globalize._runtimeKey, + validateParameterPresence = Globalize._validateParameterPresence, + validateParameterTypeNumber = Globalize._validateParameterTypeNumber; + + +/** + * format( value, numberFormatter, pluralGenerator, unitProperies ) + * + * @value [Number] + * + * @numberFormatter [Object]: A numberFormatter from Globalize.numberFormatter. + * + * @pluralGenerator [Object]: A pluralGenerator from Globalize.pluralGenerator. + * + * @unitProperies [Object]: localized unit data from cldr. + * + * Format units such as seconds, minutes, days, weeks, etc. + * + * OBS: + * + * Unit Sequences are not implemented. + * http://www.unicode.org/reports/tr35/tr35-35/tr35-general.html#Unit_Sequences + * + * Duration Unit (for composed time unit durations) is not implemented. + * http://www.unicode.org/reports/tr35/tr35-35/tr35-general.html#durationUnit + */ +var unitFormat = function( value, numberFormatter, pluralGenerator, unitProperties ) { + var compoundUnitPattern = unitProperties.compoundUnitPattern, dividend, dividendProperties, + formattedValue, divisor, divisorProperties, message, pluralValue; + + unitProperties = unitProperties.unitProperties; + formattedValue = numberFormatter( value ); + pluralValue = pluralGenerator( value ); + + // computed compound unit, eg. "megabyte-per-second". + if ( unitProperties instanceof Array ) { + dividendProperties = unitProperties[ 0 ]; + divisorProperties = unitProperties[ 1 ]; + + dividend = formatMessage( dividendProperties[ pluralValue ], [ value ] ); + divisor = formatMessage( divisorProperties.one, [ "" ] ).trim(); + + return formatMessage( compoundUnitPattern, [ dividend, divisor ] ); + } + + message = unitProperties[ pluralValue ]; + + return formatMessage( message, [ formattedValue ] ); +}; + + + + +var unitFormatterFn = function( numberFormatter, pluralGenerator, unitProperties ) { + return function unitFormatter( value ) { + validateParameterPresence( value, "value" ); + validateParameterTypeNumber( value, "value" ); + + return unitFormat( value, numberFormatter, pluralGenerator, unitProperties ); + }; + +}; + + + + +Globalize._unitFormatterFn = unitFormatterFn; + +Globalize.formatUnit = +Globalize.prototype.formatUnit = function( value, unit, options ) { + return this.unitFormatter( unit, options )( value ); +}; + +Globalize.unitFormatter = +Globalize.prototype.unitFormatter = function( unit, options ) { + options = options || {}; + return Globalize[ runtimeKey( "unitFormatter", this._locale, [ unit, options ] ) ]; +}; + +return Globalize; + + + + +})); diff --git a/StockManMVC/bower_components/globalize/dist/globalize.js b/StockManMVC/bower_components/globalize/dist/globalize.js new file mode 100644 index 0000000..1426c4f --- /dev/null +++ b/StockManMVC/bower_components/globalize/dist/globalize.js @@ -0,0 +1,421 @@ +/** + * Globalize v1.1.1 + * + * http://github.com/jquery/globalize + * + * Copyright jQuery Foundation and other contributors + * Released under the MIT license + * http://jquery.org/license + * + * Date: 2016-02-04T12:01Z + */ +/*! + * Globalize v1.1.1 2016-02-04T12:01Z Released under the MIT license + * http://git.io/TrdQbw + */ +(function( root, factory ) { + + // UMD returnExports + if ( typeof define === "function" && define.amd ) { + + // AMD + define([ + "cldr", + "cldr/event" + ], factory ); + } else if ( typeof exports === "object" ) { + + // Node, CommonJS + module.exports = factory( require( "cldrjs" ) ); + } else { + + // Global + root.Globalize = factory( root.Cldr ); + } +}( this, function( Cldr ) { + + +/** + * A toString method that outputs meaningful values for objects or arrays and + * still performs as fast as a plain string in case variable is string, or as + * fast as `"" + number` in case variable is a number. + * Ref: http://jsperf.com/my-stringify + */ +var toString = function( variable ) { + return typeof variable === "string" ? variable : ( typeof variable === "number" ? "" + + variable : JSON.stringify( variable ) ); +}; + + + + +/** + * formatMessage( message, data ) + * + * @message [String] A message with optional {vars} to be replaced. + * + * @data [Array or JSON] Object with replacing-variables content. + * + * Return the formatted message. For example: + * + * - formatMessage( "{0} second", [ 1 ] ); // 1 second + * + * - formatMessage( "{0}/{1}", ["m", "s"] ); // m/s + * + * - formatMessage( "{name} <{email}>", { + * name: "Foo", + * email: "bar@baz.qux" + * }); // Foo + */ +var formatMessage = function( message, data ) { + + // Replace {attribute}'s + message = message.replace( /{[0-9a-zA-Z-_. ]+}/g, function( name ) { + name = name.replace( /^{([^}]*)}$/, "$1" ); + return toString( data[ name ] ); + }); + + return message; +}; + + + + +var objectExtend = function() { + var destination = arguments[ 0 ], + sources = [].slice.call( arguments, 1 ); + + sources.forEach(function( source ) { + var prop; + for ( prop in source ) { + destination[ prop ] = source[ prop ]; + } + }); + + return destination; +}; + + + + +var createError = function( code, message, attributes ) { + var error; + + message = code + ( message ? ": " + formatMessage( message, attributes ) : "" ); + error = new Error( message ); + error.code = code; + + objectExtend( error, attributes ); + + return error; +}; + + + + +// Based on http://stackoverflow.com/questions/7616461/generate-a-hash-from-string-in-javascript-jquery +var stringHash = function( str ) { + return [].reduce.call( str, function( hash, i ) { + var chr = i.charCodeAt( 0 ); + hash = ( ( hash << 5 ) - hash ) + chr; + return hash | 0; + }, 0 ); +}; + + + + +var runtimeKey = function( fnName, locale, args, argsStr ) { + var hash; + argsStr = argsStr || JSON.stringify( args ); + hash = stringHash( fnName + locale + argsStr ); + return hash > 0 ? "a" + hash : "b" + Math.abs( hash ); +}; + + + + +var functionName = function( fn ) { + if ( fn.name !== undefined ) { + return fn.name; + } + + // fn.name is not supported by IE. + var matches = /^function\s+([\w\$]+)\s*\(/.exec( fn.toString() ); + + if ( matches && matches.length > 0 ) { + return matches[ 1 ]; + } +}; + + + + +var runtimeBind = function( args, cldr, fn, runtimeArgs ) { + + var argsStr = JSON.stringify( args ), + fnName = functionName( fn ), + locale = cldr.locale; + + // If name of the function is not available, this is most likely due uglification, + // which most likely means we are in production, and runtimeBind here is not necessary. + if ( !fnName ) { + return fn; + } + + fn.runtimeKey = runtimeKey( fnName, locale, null, argsStr ); + + fn.generatorString = function() { + return "Globalize(\"" + locale + "\")." + fnName + "(" + argsStr.slice( 1, -1 ) + ")"; + }; + + fn.runtimeArgs = runtimeArgs; + + return fn; +}; + + + + +var validate = function( code, message, check, attributes ) { + if ( !check ) { + throw createError( code, message, attributes ); + } +}; + + + + +var alwaysArray = function( stringOrArray ) { + return Array.isArray( stringOrArray ) ? stringOrArray : stringOrArray ? [ stringOrArray ] : []; +}; + + + + +var validateCldr = function( path, value, options ) { + var skipBoolean; + options = options || {}; + + skipBoolean = alwaysArray( options.skip ).some(function( pathRe ) { + return pathRe.test( path ); + }); + + validate( "E_MISSING_CLDR", "Missing required CLDR content `{path}`.", value || skipBoolean, { + path: path + }); +}; + + + + +var validateDefaultLocale = function( value ) { + validate( "E_DEFAULT_LOCALE_NOT_DEFINED", "Default locale has not been defined.", + value !== undefined, {} ); +}; + + + + +var validateParameterPresence = function( value, name ) { + validate( "E_MISSING_PARAMETER", "Missing required parameter `{name}`.", + value !== undefined, { name: name }); +}; + + + + +/** + * range( value, name, minimum, maximum ) + * + * @value [Number]. + * + * @name [String] name of variable. + * + * @minimum [Number]. The lowest valid value, inclusive. + * + * @maximum [Number]. The greatest valid value, inclusive. + */ +var validateParameterRange = function( value, name, minimum, maximum ) { + validate( + "E_PAR_OUT_OF_RANGE", + "Parameter `{name}` has value `{value}` out of range [{minimum}, {maximum}].", + value === undefined || value >= minimum && value <= maximum, + { + maximum: maximum, + minimum: minimum, + name: name, + value: value + } + ); +}; + + + + +var validateParameterType = function( value, name, check, expected ) { + validate( + "E_INVALID_PAR_TYPE", + "Invalid `{name}` parameter ({value}). {expected} expected.", + check, + { + expected: expected, + name: name, + value: value + } + ); +}; + + + + +var validateParameterTypeLocale = function( value, name ) { + validateParameterType( + value, + name, + value === undefined || typeof value === "string" || value instanceof Cldr, + "String or Cldr instance" + ); +}; + + + + +/** + * Function inspired by jQuery Core, but reduced to our use case. + */ +var isPlainObject = function( obj ) { + return obj !== null && "" + obj === "[object Object]"; +}; + + + + +var validateParameterTypePlainObject = function( value, name ) { + validateParameterType( + value, + name, + value === undefined || isPlainObject( value ), + "Plain Object" + ); +}; + + + + +var alwaysCldr = function( localeOrCldr ) { + return localeOrCldr instanceof Cldr ? localeOrCldr : new Cldr( localeOrCldr ); +}; + + + + +// ref: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions?redirectlocale=en-US&redirectslug=JavaScript%2FGuide%2FRegular_Expressions +var regexpEscape = function( string ) { + return string.replace( /([.*+?^=!:${}()|\[\]\/\\])/g, "\\$1" ); +}; + + + + +var stringPad = function( str, count, right ) { + var length; + if ( typeof str !== "string" ) { + str = String( str ); + } + for ( length = str.length; length < count; length += 1 ) { + str = ( right ? ( str + "0" ) : ( "0" + str ) ); + } + return str; +}; + + + + +function validateLikelySubtags( cldr ) { + cldr.once( "get", validateCldr ); + cldr.get( "supplemental/likelySubtags" ); +} + +/** + * [new] Globalize( locale|cldr ) + * + * @locale [String] + * + * @cldr [Cldr instance] + * + * Create a Globalize instance. + */ +function Globalize( locale ) { + if ( !( this instanceof Globalize ) ) { + return new Globalize( locale ); + } + + validateParameterPresence( locale, "locale" ); + validateParameterTypeLocale( locale, "locale" ); + + this.cldr = alwaysCldr( locale ); + + validateLikelySubtags( this.cldr ); +} + +/** + * Globalize.load( json, ... ) + * + * @json [JSON] + * + * Load resolved or unresolved cldr data. + * Somewhat equivalent to previous Globalize.addCultureInfo(...). + */ +Globalize.load = function() { + + // validations are delegated to Cldr.load(). + Cldr.load.apply( Cldr, arguments ); +}; + +/** + * Globalize.locale( [locale|cldr] ) + * + * @locale [String] + * + * @cldr [Cldr instance] + * + * Set default Cldr instance if locale or cldr argument is passed. + * + * Return the default Cldr instance. + */ +Globalize.locale = function( locale ) { + validateParameterTypeLocale( locale, "locale" ); + + if ( arguments.length ) { + this.cldr = alwaysCldr( locale ); + validateLikelySubtags( this.cldr ); + } + return this.cldr; +}; + +/** + * Optimization to avoid duplicating some internal functions across modules. + */ +Globalize._alwaysArray = alwaysArray; +Globalize._createError = createError; +Globalize._formatMessage = formatMessage; +Globalize._isPlainObject = isPlainObject; +Globalize._objectExtend = objectExtend; +Globalize._regexpEscape = regexpEscape; +Globalize._runtimeBind = runtimeBind; +Globalize._stringPad = stringPad; +Globalize._validate = validate; +Globalize._validateCldr = validateCldr; +Globalize._validateDefaultLocale = validateDefaultLocale; +Globalize._validateParameterPresence = validateParameterPresence; +Globalize._validateParameterRange = validateParameterRange; +Globalize._validateParameterTypePlainObject = validateParameterTypePlainObject; +Globalize._validateParameterType = validateParameterType; + +return Globalize; + + + + +})); diff --git a/StockManMVC/bower_components/globalize/dist/globalize/currency.js b/StockManMVC/bower_components/globalize/dist/globalize/currency.js new file mode 100644 index 0000000..8b68100 --- /dev/null +++ b/StockManMVC/bower_components/globalize/dist/globalize/currency.js @@ -0,0 +1,439 @@ +/*! + * Globalize v1.1.1 + * + * http://github.com/jquery/globalize + * + * Copyright jQuery Foundation and other contributors + * Released under the MIT license + * http://jquery.org/license + * + * Date: 2016-02-04T12:01Z + */ +(function( root, factory ) { + + // UMD returnExports + if ( typeof define === "function" && define.amd ) { + + // AMD + define([ + "cldr", + "../globalize", + "./number", + "cldr/event", + "cldr/supplemental" + ], factory ); + } else if ( typeof exports === "object" ) { + + // Node, CommonJS + module.exports = factory( require( "cldrjs" ), require( "globalize" ) ); + } else { + + // Global + factory( root.Cldr, root.Globalize ); + } +}(this, function( Cldr, Globalize ) { + +var alwaysArray = Globalize._alwaysArray, + formatMessage = Globalize._formatMessage, + numberNumberingSystem = Globalize._numberNumberingSystem, + numberPattern = Globalize._numberPattern, + runtimeBind = Globalize._runtimeBind, + stringPad = Globalize._stringPad, + validateCldr = Globalize._validateCldr, + validateDefaultLocale = Globalize._validateDefaultLocale, + validateParameterPresence = Globalize._validateParameterPresence, + validateParameterType = Globalize._validateParameterType, + validateParameterTypeNumber = Globalize._validateParameterTypeNumber, + validateParameterTypePlainObject = Globalize._validateParameterTypePlainObject; + + +var validateParameterTypeCurrency = function( value, name ) { + validateParameterType( + value, + name, + value === undefined || typeof value === "string" && ( /^[A-Za-z]{3}$/ ).test( value ), + "3-letter currency code string as defined by ISO 4217" + ); +}; + + + + +/** + * supplementalOverride( currency, pattern, cldr ) + * + * Return pattern with fraction digits overriden by supplemental currency data. + */ +var currencySupplementalOverride = function( currency, pattern, cldr ) { + var digits, + fraction = "", + fractionData = cldr.supplemental([ "currencyData/fractions", currency ]) || + cldr.supplemental( "currencyData/fractions/DEFAULT" ); + + digits = +fractionData._digits; + + if ( digits ) { + fraction = "." + stringPad( "0", digits ).slice( 0, -1 ) + fractionData._rounding; + } + + return pattern.replace( /\.(#+|0*[0-9]|0+[0-9]?)/g, fraction ); +}; + + + + +var objectFilter = function( object, testRe ) { + var key, + copy = {}; + + for ( key in object ) { + if ( testRe.test( key ) ) { + copy[ key ] = object[ key ]; + } + } + + return copy; +}; + + + + +var currencyUnitPatterns = function( cldr ) { + return objectFilter( cldr.main([ + "numbers", + "currencyFormats-numberSystem-" + numberNumberingSystem( cldr ) + ]), /^unitPattern/ ); +}; + + + + +/** + * codeProperties( currency, cldr ) + * + * Return number pattern with the appropriate currency code in as literal. + */ +var currencyCodeProperties = function( currency, cldr ) { + var pattern = numberPattern( "decimal", cldr ); + + // The number of decimal places and the rounding for each currency is not locale-specific. Those + // values overridden by Supplemental Currency Data. + pattern = currencySupplementalOverride( currency, pattern, cldr ); + + return { + currency: currency, + pattern: pattern, + unitPatterns: currencyUnitPatterns( cldr ) + }; +}; + + + + +/** + * nameFormat( formattedNumber, pluralForm, properties ) + * + * Return the appropriate name form currency format. + */ +var currencyNameFormat = function( formattedNumber, pluralForm, properties ) { + var displayName, unitPattern, + displayNames = properties.displayNames || {}, + unitPatterns = properties.unitPatterns; + + displayName = displayNames[ "displayName-count-" + pluralForm ] || + displayNames[ "displayName-count-other" ] || + displayNames.displayName || + properties.currency; + unitPattern = unitPatterns[ "unitPattern-count-" + pluralForm ] || + unitPatterns[ "unitPattern-count-other" ]; + + return formatMessage( unitPattern, [ formattedNumber, displayName ]); +}; + + + + +var currencyFormatterFn = function( numberFormatter, pluralGenerator, properties ) { + var fn; + + // Return formatter when style is "code" or "name". + if ( pluralGenerator && properties ) { + fn = function currencyFormatter( value ) { + validateParameterPresence( value, "value" ); + validateParameterTypeNumber( value, "value" ); + return currencyNameFormat( + numberFormatter( value ), + pluralGenerator( value ), + properties + ); + }; + + // Return formatter when style is "symbol" or "accounting". + } else { + fn = function currencyFormatter( value ) { + return numberFormatter( value ); + }; + } + + return fn; +}; + + + + +/** + * nameProperties( currency, cldr ) + * + * Return number pattern with the appropriate currency code in as literal. + */ +var currencyNameProperties = function( currency, cldr ) { + var properties = currencyCodeProperties( currency, cldr ); + + properties.displayNames = objectFilter( cldr.main([ + "numbers/currencies", + currency + ]), /^displayName/ ); + + return properties; +}; + + + + +/** + * Unicode regular expression for: everything except math symbols, currency signs, dingbats, and + * box-drawing characters. + * + * Generated by: + * + * regenerate() + * .addRange( 0x0, 0x10FFFF ) + * .remove( require( "unicode-7.0.0/categories/S/symbols" ) ).toString(); + * + * https://github.com/mathiasbynens/regenerate + * https://github.com/mathiasbynens/unicode-7.0.0 + */ +var regexpNotS = /[\0-#%-\*,-;\?-\]_a-\{\}\x7F-\xA1\xA7\xAA\xAB\xAD\xB2\xB3\xB5-\xB7\xB9-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376-\u0383\u0386-\u03F5\u03F7-\u0481\u0483-\u058C\u0590-\u0605\u0609\u060A\u060C\u060D\u0610-\u06DD\u06DF-\u06E8\u06EA-\u06FC\u06FF-\u07F5\u07F7-\u09F1\u09F4-\u09F9\u09FC-\u0AF0\u0AF2-\u0B6F\u0B71-\u0BF2\u0BFB-\u0C7E\u0C80-\u0D78\u0D7A-\u0E3E\u0E40-\u0F00\u0F04-\u0F12\u0F14\u0F18\u0F19\u0F20-\u0F33\u0F35\u0F37\u0F39-\u0FBD\u0FC6\u0FCD\u0FD0-\u0FD4\u0FD9-\u109D\u10A0-\u138F\u139A-\u17DA\u17DC-\u193F\u1941-\u19DD\u1A00-\u1B60\u1B6B-\u1B73\u1B7D-\u1FBC\u1FBE\u1FC2-\u1FCC\u1FD0-\u1FDC\u1FE0-\u1FEC\u1FF0-\u1FFC\u1FFF-\u2043\u2045-\u2051\u2053-\u2079\u207D-\u2089\u208D-\u209F\u20BE-\u20FF\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2150-\u218F\u2308-\u230B\u2329\u232A\u23FB-\u23FF\u2427-\u243F\u244B-\u249B\u24EA-\u24FF\u2768-\u2793\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2B74\u2B75\u2B96\u2B97\u2BBA-\u2BBC\u2BC9\u2BD2-\u2CE4\u2CEB-\u2E7F\u2E9A\u2EF4-\u2EFF\u2FD6-\u2FEF\u2FFC-\u3003\u3005-\u3011\u3014-\u301F\u3021-\u3035\u3038-\u303D\u3040-\u309A\u309D-\u318F\u3192-\u3195\u31A0-\u31BF\u31E4-\u31FF\u321F-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u32FF\u3400-\u4DBF\u4E00-\uA48F\uA4C7-\uA6FF\uA717-\uA71F\uA722-\uA788\uA78B-\uA827\uA82C-\uA835\uA83A-\uAA76\uAA7A-\uAB5A\uAB5C-\uD7FF\uDC00-\uFB28\uFB2A-\uFBB1\uFBC2-\uFDFB\uFDFE-\uFE61\uFE63\uFE67\uFE68\uFE6A-\uFF03\uFF05-\uFF0A\uFF0C-\uFF1B\uFF1F-\uFF3D\uFF3F\uFF41-\uFF5B\uFF5D\uFF5F-\uFFDF\uFFE7\uFFEF-\uFFFB\uFFFE\uFFFF]|\uD800[\uDC00-\uDD36\uDD40-\uDD78\uDD8A\uDD8B\uDD8D-\uDD8F\uDD9C-\uDD9F\uDDA1-\uDDCF\uDDFD-\uDFFF]|[\uD801\uD803-\uD819\uD81B-\uD82E\uD830-\uD833\uD836-\uD83A\uD83F-\uDBFF][\uDC00-\uDFFF]|\uD802[\uDC00-\uDC76\uDC79-\uDEC7\uDEC9-\uDFFF]|\uD81A[\uDC00-\uDF3B\uDF40-\uDF44\uDF46-\uDFFF]|\uD82F[\uDC00-\uDC9B\uDC9D-\uDFFF]|\uD834[\uDCF6-\uDCFF\uDD27\uDD28\uDD65-\uDD69\uDD6D-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDDDE-\uDDFF\uDE42-\uDE44\uDE46-\uDEFF\uDF57-\uDFFF]|\uD835[\uDC00-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFFF]|\uD83B[\uDC00-\uDEEF\uDEF2-\uDFFF]|\uD83C[\uDC2C-\uDC2F\uDC94-\uDC9F\uDCAF\uDCB0\uDCC0\uDCD0\uDCF6-\uDD0F\uDD2F\uDD6C-\uDD6F\uDD9B-\uDDE5\uDE03-\uDE0F\uDE3B-\uDE3F\uDE49-\uDE4F\uDE52-\uDEFF\uDF2D-\uDF2F\uDF7E\uDF7F\uDFCF-\uDFD3\uDFF8-\uDFFF]|\uD83D[\uDCFF\uDD4B-\uDD4F\uDD7A\uDDA4\uDE43\uDE44\uDED0-\uDEDF\uDEED-\uDEEF\uDEF4-\uDEFF\uDF74-\uDF7F\uDFD5-\uDFFF]|\uD83E[\uDC0C-\uDC0F\uDC48-\uDC4F\uDC5A-\uDC5F\uDC88-\uDC8F\uDCAE-\uDFFF]|[\uD800-\uDBFF]/; + + + + +/** + * symbolProperties( currency, cldr ) + * + * Return pattern replacing `¤` with the appropriate currency symbol literal. + */ +var currencySymbolProperties = function( currency, cldr, options ) { + var currencySpacing, pattern, + regexp = { + "[:digit:]": /\d/, + "[:^S:]": regexpNotS + }, + symbol = cldr.main([ + "numbers/currencies", + currency, + "symbol" + ]); + + currencySpacing = [ "beforeCurrency", "afterCurrency" ].map(function( position ) { + return cldr.main([ + "numbers", + "currencyFormats-numberSystem-" + numberNumberingSystem( cldr ), + "currencySpacing", + position + ]); + }); + + pattern = cldr.main([ + "numbers", + "currencyFormats-numberSystem-" + numberNumberingSystem( cldr ), + options.style === "accounting" ? "accounting" : "standard" + ]); + + pattern = + + // The number of decimal places and the rounding for each currency is not locale-specific. + // Those values are overridden by Supplemental Currency Data. + currencySupplementalOverride( currency, pattern, cldr ) + + // Replace "¤" (\u00A4) with the appropriate symbol literal. + .split( ";" ).map(function( pattern ) { + + return pattern.split( "\u00A4" ).map(function( part, i ) { + var currencyMatch = regexp[ currencySpacing[ i ].currencyMatch ], + surroundingMatch = regexp[ currencySpacing[ i ].surroundingMatch ], + insertBetween = ""; + + // For currencyMatch and surroundingMatch definitions, read [1]. + // When i === 0, beforeCurrency is being handled. Otherwise, afterCurrency. + // 1: http://www.unicode.org/reports/tr35/tr35-numbers.html#Currencies + currencyMatch = currencyMatch.test( symbol.charAt( i ? symbol.length - 1 : 0 ) ); + surroundingMatch = surroundingMatch.test( + part.charAt( i ? 0 : part.length - 1 ).replace( /[#@,.]/g, "0" ) + ); + + if ( currencyMatch && part && surroundingMatch ) { + insertBetween = currencySpacing[ i ].insertBetween; + } + + return ( i ? insertBetween : "" ) + part + ( i ? "" : insertBetween ); + }).join( "'" + symbol + "'" ); + }).join( ";" ); + + return { + pattern: pattern + }; +}; + + + + +/** + * objectOmit( object, keys ) + * + * Return a copy of the object, filtered to omit the blacklisted key or array of keys. + */ +var objectOmit = function( object, keys ) { + var key, + copy = {}; + + keys = alwaysArray( keys ); + + for ( key in object ) { + if ( keys.indexOf( key ) === -1 ) { + copy[ key ] = object[ key ]; + } + } + + return copy; +}; + + + + +function validateRequiredCldr( path, value ) { + validateCldr( path, value, { + skip: [ /supplemental\/currencyData\/fractions\/[A-Za-z]{3}$/ ] + }); +} + +/** + * .currencyFormatter( currency [, options] ) + * + * @currency [String] 3-letter currency code as defined by ISO 4217. + * + * @options [Object]: + * - style: [String] "symbol" (default), "accounting", "code" or "name". + * - see also number/format options. + * + * Return a function that formats a currency according to the given options and default/instance + * locale. + */ +Globalize.currencyFormatter = +Globalize.prototype.currencyFormatter = function( currency, options ) { + var args, cldr, numberFormatter, pluralGenerator, properties, returnFn, style; + + validateParameterPresence( currency, "currency" ); + validateParameterTypeCurrency( currency, "currency" ); + + validateParameterTypePlainObject( options, "options" ); + + cldr = this.cldr; + options = options || {}; + + args = [ currency, options ]; + style = options.style || "symbol"; + + validateDefaultLocale( cldr ); + + // Get properties given style ("symbol" default, "code" or "name"). + cldr.on( "get", validateRequiredCldr ); + properties = ({ + accounting: currencySymbolProperties, + code: currencyCodeProperties, + name: currencyNameProperties, + symbol: currencySymbolProperties + }[ style ] )( currency, cldr, options ); + cldr.off( "get", validateRequiredCldr ); + + // options = options minus style, plus raw pattern. + options = objectOmit( options, "style" ); + options.raw = properties.pattern; + + // Return formatter when style is "symbol" or "accounting". + if ( style === "symbol" || style === "accounting" ) { + numberFormatter = this.numberFormatter( options ); + + returnFn = currencyFormatterFn( numberFormatter ); + + runtimeBind( args, cldr, returnFn, [ numberFormatter ] ); + + // Return formatter when style is "code" or "name". + } else { + numberFormatter = this.numberFormatter( options ); + pluralGenerator = this.pluralGenerator(); + + returnFn = currencyFormatterFn( numberFormatter, pluralGenerator, properties ); + + runtimeBind( args, cldr, returnFn, [ numberFormatter, pluralGenerator, properties ] ); + } + + return returnFn; +}; + +/** + * .currencyParser( currency [, options] ) + * + * @currency [String] 3-letter currency code as defined by ISO 4217. + * + * @options [Object] see currencyFormatter. + * + * Return the currency parser according to the given options and the default/instance locale. + */ +Globalize.currencyParser = +Globalize.prototype.currencyParser = function( /* currency, options */ ) { + + // TODO implement parser. + +}; + +/** + * .formatCurrency( value, currency [, options] ) + * + * @value [Number] number to be formatted. + * + * @currency [String] 3-letter currency code as defined by ISO 4217. + * + * @options [Object] see currencyFormatter. + * + * Format a currency according to the given options and the default/instance locale. + */ +Globalize.formatCurrency = +Globalize.prototype.formatCurrency = function( value, currency, options ) { + validateParameterPresence( value, "value" ); + validateParameterTypeNumber( value, "value" ); + + return this.currencyFormatter( currency, options )( value ); +}; + +/** + * .parseCurrency( value, currency [, options] ) + * + * @value [String] + * + * @currency [String] 3-letter currency code as defined by ISO 4217. + * + * @options [Object]: See currencyFormatter. + * + * Return the parsed currency or NaN when value is invalid. + */ +Globalize.parseCurrency = +Globalize.prototype.parseCurrency = function( /* value, currency, options */ ) { +}; + +return Globalize; + + + + +})); diff --git a/StockManMVC/bower_components/globalize/dist/globalize/date.js b/StockManMVC/bower_components/globalize/dist/globalize/date.js new file mode 100644 index 0000000..4fa68ce --- /dev/null +++ b/StockManMVC/bower_components/globalize/dist/globalize/date.js @@ -0,0 +1,1923 @@ +/** + * Globalize v1.1.1 + * + * http://github.com/jquery/globalize + * + * Copyright jQuery Foundation and other contributors + * Released under the MIT license + * http://jquery.org/license + * + * Date: 2016-02-04T12:01Z + */ +/*! + * Globalize v1.1.1 2016-02-04T12:01Z Released under the MIT license + * http://git.io/TrdQbw + */ +(function( root, factory ) { + + // UMD returnExports + if ( typeof define === "function" && define.amd ) { + + // AMD + define([ + "cldr", + "../globalize", + "./number", + "cldr/event", + "cldr/supplemental" + ], factory ); + } else if ( typeof exports === "object" ) { + + // Node, CommonJS + module.exports = factory( require( "cldrjs" ), require( "globalize" ) ); + } else { + + // Extend global + factory( root.Cldr, root.Globalize ); + } +}(this, function( Cldr, Globalize ) { + +var createError = Globalize._createError, + createErrorUnsupportedFeature = Globalize._createErrorUnsupportedFeature, + formatMessage = Globalize._formatMessage, + numberSymbol = Globalize._numberSymbol, + regexpEscape = Globalize._regexpEscape, + runtimeBind = Globalize._runtimeBind, + stringPad = Globalize._stringPad, + validateCldr = Globalize._validateCldr, + validateDefaultLocale = Globalize._validateDefaultLocale, + validateParameterPresence = Globalize._validateParameterPresence, + validateParameterType = Globalize._validateParameterType, + validateParameterTypePlainObject = Globalize._validateParameterTypePlainObject, + validateParameterTypeString = Globalize._validateParameterTypeString; + + +var validateParameterTypeDate = function( value, name ) { + validateParameterType( value, name, value === undefined || value instanceof Date, "Date" ); +}; + + + + +var createErrorInvalidParameterValue = function( name, value ) { + return createError( "E_INVALID_PAR_VALUE", "Invalid `{name}` value ({value}).", { + name: name, + value: value + }); +}; + + + + +/** + * expandPattern( options, cldr ) + * + * @options [Object] if String, it's considered a skeleton. Object accepts: + * - skeleton: [String] lookup availableFormat; + * - date: [String] ( "full" | "long" | "medium" | "short" ); + * - time: [String] ( "full" | "long" | "medium" | "short" ); + * - datetime: [String] ( "full" | "long" | "medium" | "short" ); + * - raw: [String] For more info see datetime/format.js. + * + * @cldr [Cldr instance]. + * + * Return the corresponding pattern. + * Eg for "en": + * - "GyMMMd" returns "MMM d, y G"; + * - { skeleton: "GyMMMd" } returns "MMM d, y G"; + * - { date: "full" } returns "EEEE, MMMM d, y"; + * - { time: "full" } returns "h:mm:ss a zzzz"; + * - { datetime: "full" } returns "EEEE, MMMM d, y 'at' h:mm:ss a zzzz"; + * - { raw: "dd/mm" } returns "dd/mm"; + */ + +var dateExpandPattern = function( options, cldr ) { + var dateSkeleton, result, skeleton, timeSkeleton, type; + + function combineDateTime( type, datePattern, timePattern ) { + return formatMessage( + cldr.main([ + "dates/calendars/gregorian/dateTimeFormats", + type + ]), + [ timePattern, datePattern ] + ); + } + + switch ( true ) { + case "skeleton" in options: + skeleton = options.skeleton; + result = cldr.main([ + "dates/calendars/gregorian/dateTimeFormats/availableFormats", + skeleton + ]); + if ( !result ) { + timeSkeleton = skeleton.split( /[^hHKkmsSAzZOvVXx]/ ).slice( -1 )[ 0 ]; + dateSkeleton = skeleton.split( /[^GyYuUrQqMLlwWdDFgEec]/ )[ 0 ]; + if ( /(MMMM|LLLL).*[Ec]/.test( dateSkeleton ) ) { + type = "full"; + } else if ( /MMMM/g.test( dateSkeleton ) ) { + type = "long"; + } else if ( /MMM/g.test( dateSkeleton ) || /LLL/g.test( dateSkeleton ) ) { + type = "medium"; + } else { + type = "short"; + } + result = combineDateTime( type, + cldr.main([ + "dates/calendars/gregorian/dateTimeFormats/availableFormats", + dateSkeleton + ]), + cldr.main([ + "dates/calendars/gregorian/dateTimeFormats/availableFormats", + timeSkeleton + ]) + ); + } + break; + + case "date" in options: + case "time" in options: + result = cldr.main([ + "dates/calendars/gregorian", + "date" in options ? "dateFormats" : "timeFormats", + ( options.date || options.time ) + ]); + break; + + case "datetime" in options: + result = combineDateTime( options.datetime, + cldr.main([ "dates/calendars/gregorian/dateFormats", options.datetime ]), + cldr.main([ "dates/calendars/gregorian/timeFormats", options.datetime ]) + ); + break; + + case "raw" in options: + result = options.raw; + break; + + default: + throw createErrorInvalidParameterValue({ + name: "options", + value: options + }); + } + + return result; +}; + + + + +/** + * dayOfWeek( date, firstDay ) + * + * @date + * + * @firstDay the result of `dateFirstDayOfWeek( cldr )` + * + * Return the day of the week normalized by the territory's firstDay [0-6]. + * Eg for "mon": + * - return 0 if territory is GB, or BR, or DE, or FR (week starts on "mon"); + * - return 1 if territory is US (week starts on "sun"); + * - return 2 if territory is EG (week starts on "sat"); + */ +var dateDayOfWeek = function( date, firstDay ) { + return ( date.getDay() - firstDay + 7 ) % 7; +}; + + + + +/** + * distanceInDays( from, to ) + * + * Return the distance in days between from and to Dates. + */ +var dateDistanceInDays = function( from, to ) { + var inDays = 864e5; + return ( to.getTime() - from.getTime() ) / inDays; +}; + + + + +/** + * startOf changes the input to the beginning of the given unit. + * + * For example, starting at the start of a day, resets hours, minutes + * seconds and milliseconds to 0. Starting at the month does the same, but + * also sets the date to 1. + * + * Returns the modified date + */ +var dateStartOf = function( date, unit ) { + date = new Date( date.getTime() ); + switch ( unit ) { + case "year": + date.setMonth( 0 ); + /* falls through */ + case "month": + date.setDate( 1 ); + /* falls through */ + case "day": + date.setHours( 0 ); + /* falls through */ + case "hour": + date.setMinutes( 0 ); + /* falls through */ + case "minute": + date.setSeconds( 0 ); + /* falls through */ + case "second": + date.setMilliseconds( 0 ); + } + return date; +}; + + + + +/** + * dayOfYear + * + * Return the distance in days of the date to the begin of the year [0-d]. + */ +var dateDayOfYear = function( date ) { + return Math.floor( dateDistanceInDays( dateStartOf( date, "year" ), date ) ); +}; + + + + +/** + * millisecondsInDay + */ +var dateMillisecondsInDay = function( date ) { + + // TODO Handle daylight savings discontinuities + return date - dateStartOf( date, "day" ); +}; + + + + +var datePatternRe = ( /([a-z])\1*|'([^']|'')+'|''|./ig ); + + + + +/** + * hourFormat( date, format, timeSeparator, formatNumber ) + * + * Return date's timezone offset according to the format passed. + * Eg for format when timezone offset is 180: + * - "+H;-H": -3 + * - "+HHmm;-HHmm": -0300 + * - "+HH:mm;-HH:mm": -03:00 + */ +var dateTimezoneHourFormat = function( date, format, timeSeparator, formatNumber ) { + var absOffset, + offset = date.getTimezoneOffset(); + + absOffset = Math.abs( offset ); + formatNumber = formatNumber || { + 1: function( value ) { + return stringPad( value, 1 ); + }, + 2: function( value ) { + return stringPad( value, 2 ); + } + }; + + return format + + // Pick the correct sign side (+ or -). + .split( ";" )[ offset > 0 ? 1 : 0 ] + + // Localize time separator + .replace( ":", timeSeparator ) + + // Update hours offset. + .replace( /HH?/, function( match ) { + return formatNumber[ match.length ]( Math.floor( absOffset / 60 ) ); + }) + + // Update minutes offset and return. + .replace( /mm/, function() { + return formatNumber[ 2 ]( absOffset % 60 ); + }); +}; + + + + +var dateWeekDays = [ "sun", "mon", "tue", "wed", "thu", "fri", "sat" ]; + + + + +/** + * format( date, properties ) + * + * @date [Date instance]. + * + * @properties + * + * TODO Support other calendar types. + * + * Disclosure: this function borrows excerpts of dojo/date/locale. + */ +var dateFormat = function( date, numberFormatters, properties ) { + var timeSeparator = properties.timeSeparator; + + return properties.pattern.replace( datePatternRe, function( current ) { + var ret, + chr = current.charAt( 0 ), + length = current.length; + + if ( chr === "j" ) { + + // Locale preferred hHKk. + // http://www.unicode.org/reports/tr35/tr35-dates.html#Time_Data + chr = properties.preferredTime; + } + + if ( chr === "Z" ) { + + // Z..ZZZ: same as "xxxx". + if ( length < 4 ) { + chr = "x"; + length = 4; + + // ZZZZ: same as "OOOO". + } else if ( length < 5 ) { + chr = "O"; + length = 4; + + // ZZZZZ: same as "XXXXX" + } else { + chr = "X"; + length = 5; + } + } + + switch ( chr ) { + + // Era + case "G": + ret = properties.eras[ date.getFullYear() < 0 ? 0 : 1 ]; + break; + + // Year + case "y": + + // Plain year. + // The length specifies the padding, but for two letters it also specifies the + // maximum length. + ret = date.getFullYear(); + if ( length === 2 ) { + ret = String( ret ); + ret = +ret.substr( ret.length - 2 ); + } + break; + + case "Y": + + // Year in "Week of Year" + // The length specifies the padding, but for two letters it also specifies the + // maximum length. + // yearInWeekofYear = date + DaysInAWeek - (dayOfWeek - firstDay) - minDays + ret = new Date( date.getTime() ); + ret.setDate( + ret.getDate() + 7 - + dateDayOfWeek( date, properties.firstDay ) - + properties.firstDay - + properties.minDays + ); + ret = ret.getFullYear(); + if ( length === 2 ) { + ret = String( ret ); + ret = +ret.substr( ret.length - 2 ); + } + break; + + // Quarter + case "Q": + case "q": + ret = Math.ceil( ( date.getMonth() + 1 ) / 3 ); + if ( length > 2 ) { + ret = properties.quarters[ chr ][ length ][ ret ]; + } + break; + + // Month + case "M": + case "L": + ret = date.getMonth() + 1; + if ( length > 2 ) { + ret = properties.months[ chr ][ length ][ ret ]; + } + break; + + // Week + case "w": + + // Week of Year. + // woy = ceil( ( doy + dow of 1/1 ) / 7 ) - minDaysStuff ? 1 : 0. + // TODO should pad on ww? Not documented, but I guess so. + ret = dateDayOfWeek( dateStartOf( date, "year" ), properties.firstDay ); + ret = Math.ceil( ( dateDayOfYear( date ) + ret ) / 7 ) - + ( 7 - ret >= properties.minDays ? 0 : 1 ); + break; + + case "W": + + // Week of Month. + // wom = ceil( ( dom + dow of `1/month` ) / 7 ) - minDaysStuff ? 1 : 0. + ret = dateDayOfWeek( dateStartOf( date, "month" ), properties.firstDay ); + ret = Math.ceil( ( date.getDate() + ret ) / 7 ) - + ( 7 - ret >= properties.minDays ? 0 : 1 ); + break; + + // Day + case "d": + ret = date.getDate(); + break; + + case "D": + ret = dateDayOfYear( date ) + 1; + break; + + case "F": + + // Day of Week in month. eg. 2nd Wed in July. + ret = Math.floor( date.getDate() / 7 ) + 1; + break; + + // Week day + case "e": + case "c": + if ( length <= 2 ) { + + // Range is [1-7] (deduced by example provided on documentation) + // TODO Should pad with zeros (not specified in the docs)? + ret = dateDayOfWeek( date, properties.firstDay ) + 1; + break; + } + + /* falls through */ + case "E": + ret = dateWeekDays[ date.getDay() ]; + ret = properties.days[ chr ][ length ][ ret ]; + break; + + // Period (AM or PM) + case "a": + ret = properties.dayPeriods[ date.getHours() < 12 ? "am" : "pm" ]; + break; + + // Hour + case "h": // 1-12 + ret = ( date.getHours() % 12 ) || 12; + break; + + case "H": // 0-23 + ret = date.getHours(); + break; + + case "K": // 0-11 + ret = date.getHours() % 12; + break; + + case "k": // 1-24 + ret = date.getHours() || 24; + break; + + // Minute + case "m": + ret = date.getMinutes(); + break; + + // Second + case "s": + ret = date.getSeconds(); + break; + + case "S": + ret = Math.round( date.getMilliseconds() * Math.pow( 10, length - 3 ) ); + break; + + case "A": + ret = Math.round( dateMillisecondsInDay( date ) * Math.pow( 10, length - 3 ) ); + break; + + // Zone + case "z": + case "O": + + // O: "{gmtFormat}+H;{gmtFormat}-H" or "{gmtZeroFormat}", eg. "GMT-8" or "GMT". + // OOOO: "{gmtFormat}{hourFormat}" or "{gmtZeroFormat}", eg. "GMT-08:00" or "GMT". + if ( date.getTimezoneOffset() === 0 ) { + ret = properties.gmtZeroFormat; + } else { + ret = dateTimezoneHourFormat( + date, + length < 4 ? "+H;-H" : properties.tzLongHourFormat, + timeSeparator, + numberFormatters + ); + ret = properties.gmtFormat.replace( /\{0\}/, ret ); + } + break; + + case "X": + + // Same as x*, except it uses "Z" for zero offset. + if ( date.getTimezoneOffset() === 0 ) { + ret = "Z"; + break; + } + + /* falls through */ + case "x": + + // x: hourFormat("+HH;-HH") + // xx or xxxx: hourFormat("+HHmm;-HHmm") + // xxx or xxxxx: hourFormat("+HH:mm;-HH:mm") + ret = length === 1 ? "+HH;-HH" : ( length % 2 ? "+HH:mm;-HH:mm" : "+HHmm;-HHmm" ); + ret = dateTimezoneHourFormat( date, ret, ":" ); + break; + + // timeSeparator + case ":": + ret = timeSeparator; + break; + + // ' literals. + case "'": + current = current.replace( /''/, "'" ); + if ( length > 2 ) { + current = current.slice( 1, -1 ); + } + ret = current; + break; + + // Anything else is considered a literal, including [ ,:/.@#], chinese, japonese, and + // arabic characters. + default: + ret = current; + } + if ( typeof ret === "number" ) { + ret = numberFormatters[ length ]( ret ); + } + return ret; + }); +}; + + + + +var dateFormatterFn = function( numberFormatters, properties ) { + return function dateFormatter( value ) { + validateParameterPresence( value, "value" ); + validateParameterTypeDate( value, "value" ); + + return dateFormat( value, numberFormatters, properties ); + }; + +}; + + + + +/** + * firstDayOfWeek + */ +var dateFirstDayOfWeek = function( cldr ) { + return dateWeekDays.indexOf( cldr.supplemental.weekData.firstDay() ); +}; + + + + +/** + * properties( pattern, cldr ) + * + * @pattern [String] raw pattern. + * ref: http://www.unicode.org/reports/tr35/tr35-dates.html#Date_Format_Patterns + * + * @cldr [Cldr instance]. + * + * Return the properties given the pattern and cldr. + * + * TODO Support other calendar types. + */ +var dateFormatProperties = function( pattern, cldr ) { + var properties = { + numberFormatters: {}, + pattern: pattern, + timeSeparator: numberSymbol( "timeSeparator", cldr ) + }, + widths = [ "abbreviated", "wide", "narrow" ]; + + function setNumberFormatterPattern( pad ) { + properties.numberFormatters[ pad ] = stringPad( "", pad ); + } + + pattern.replace( datePatternRe, function( current ) { + var formatNumber, + chr = current.charAt( 0 ), + length = current.length; + + if ( chr === "j" ) { + + // Locale preferred hHKk. + // http://www.unicode.org/reports/tr35/tr35-dates.html#Time_Data + properties.preferredTime = chr = cldr.supplemental.timeData.preferred(); + } + + // ZZZZ: same as "OOOO". + if ( chr === "Z" && length === 4 ) { + chr = "O"; + length = 4; + } + + switch ( chr ) { + + // Era + case "G": + properties.eras = cldr.main([ + "dates/calendars/gregorian/eras", + length <= 3 ? "eraAbbr" : ( length === 4 ? "eraNames" : "eraNarrow" ) + ]); + break; + + // Year + case "y": + + // Plain year. + formatNumber = true; + break; + + case "Y": + + // Year in "Week of Year" + properties.firstDay = dateFirstDayOfWeek( cldr ); + properties.minDays = cldr.supplemental.weekData.minDays(); + formatNumber = true; + break; + + case "u": // Extended year. Need to be implemented. + case "U": // Cyclic year name. Need to be implemented. + throw createErrorUnsupportedFeature({ + feature: "year pattern `" + chr + "`" + }); + + // Quarter + case "Q": + case "q": + if ( length > 2 ) { + if ( !properties.quarters ) { + properties.quarters = {}; + } + if ( !properties.quarters[ chr ] ) { + properties.quarters[ chr ] = {}; + } + properties.quarters[ chr ][ length ] = cldr.main([ + "dates/calendars/gregorian/quarters", + chr === "Q" ? "format" : "stand-alone", + widths[ length - 3 ] + ]); + } else { + formatNumber = true; + } + break; + + // Month + case "M": + case "L": + if ( length > 2 ) { + if ( !properties.months ) { + properties.months = {}; + } + if ( !properties.months[ chr ] ) { + properties.months[ chr ] = {}; + } + properties.months[ chr ][ length ] = cldr.main([ + "dates/calendars/gregorian/months", + chr === "M" ? "format" : "stand-alone", + widths[ length - 3 ] + ]); + } else { + formatNumber = true; + } + break; + + // Week - Week of Year (w) or Week of Month (W). + case "w": + case "W": + properties.firstDay = dateFirstDayOfWeek( cldr ); + properties.minDays = cldr.supplemental.weekData.minDays(); + formatNumber = true; + break; + + // Day + case "d": + case "D": + case "F": + formatNumber = true; + break; + + case "g": + + // Modified Julian day. Need to be implemented. + throw createErrorUnsupportedFeature({ + feature: "Julian day pattern `g`" + }); + + // Week day + case "e": + case "c": + if ( length <= 2 ) { + properties.firstDay = dateFirstDayOfWeek( cldr ); + formatNumber = true; + break; + } + + /* falls through */ + case "E": + if ( !properties.days ) { + properties.days = {}; + } + if ( !properties.days[ chr ] ) { + properties.days[ chr ] = {}; + } + if ( length === 6 ) { + + // If short day names are not explicitly specified, abbreviated day names are + // used instead. + // http://www.unicode.org/reports/tr35/tr35-dates.html#months_days_quarters_eras + // http://unicode.org/cldr/trac/ticket/6790 + properties.days[ chr ][ length ] = cldr.main([ + "dates/calendars/gregorian/days", + chr === "c" ? "stand-alone" : "format", + "short" + ]) || cldr.main([ + "dates/calendars/gregorian/days", + chr === "c" ? "stand-alone" : "format", + "abbreviated" + ]); + } else { + properties.days[ chr ][ length ] = cldr.main([ + "dates/calendars/gregorian/days", + chr === "c" ? "stand-alone" : "format", + widths[ length < 3 ? 0 : length - 3 ] + ]); + } + break; + + // Period (AM or PM) + case "a": + properties.dayPeriods = cldr.main( + "dates/calendars/gregorian/dayPeriods/format/wide" + ); + break; + + // Hour + case "h": // 1-12 + case "H": // 0-23 + case "K": // 0-11 + case "k": // 1-24 + + // Minute + case "m": + + // Second + case "s": + case "S": + case "A": + formatNumber = true; + break; + + // Zone + case "z": + case "O": + + // O: "{gmtFormat}+H;{gmtFormat}-H" or "{gmtZeroFormat}", eg. "GMT-8" or "GMT". + // OOOO: "{gmtFormat}{hourFormat}" or "{gmtZeroFormat}", eg. "GMT-08:00" or "GMT". + properties.gmtFormat = cldr.main( "dates/timeZoneNames/gmtFormat" ); + properties.gmtZeroFormat = cldr.main( "dates/timeZoneNames/gmtZeroFormat" ); + properties.tzLongHourFormat = cldr.main( "dates/timeZoneNames/hourFormat" ); + + /* falls through */ + case "Z": + case "X": + case "x": + setNumberFormatterPattern( 1 ); + setNumberFormatterPattern( 2 ); + break; + + case "v": + case "V": + throw createErrorUnsupportedFeature({ + feature: "timezone pattern `" + chr + "`" + }); + } + + if ( formatNumber ) { + setNumberFormatterPattern( length ); + } + }); + + return properties; +}; + + + + +/** + * isLeapYear( year ) + * + * @year [Number] + * + * Returns an indication whether the specified year is a leap year. + */ +var dateIsLeapYear = function( year ) { + return new Date( year, 1, 29 ).getMonth() === 1; +}; + + + + +/** + * lastDayOfMonth( date ) + * + * @date [Date] + * + * Return the last day of the given date's month + */ +var dateLastDayOfMonth = function( date ) { + return new Date( date.getFullYear(), date.getMonth() + 1, 0 ).getDate(); +}; + + + + +/** + * Differently from native date.setDate(), this function returns a date whose + * day remains inside the month boundaries. For example: + * + * setDate( FebDate, 31 ): a "Feb 28" date. + * setDate( SepDate, 31 ): a "Sep 30" date. + */ +var dateSetDate = function( date, day ) { + var lastDay = new Date( date.getFullYear(), date.getMonth() + 1, 0 ).getDate(); + + date.setDate( day < 1 ? 1 : day < lastDay ? day : lastDay ); +}; + + + + +/** + * Differently from native date.setMonth(), this function adjusts date if + * needed, so final month is always the one set. + * + * setMonth( Jan31Date, 1 ): a "Feb 28" date. + * setDate( Jan31Date, 8 ): a "Sep 30" date. + */ +var dateSetMonth = function( date, month ) { + var originalDate = date.getDate(); + + date.setDate( 1 ); + date.setMonth( month ); + dateSetDate( date, originalDate ); +}; + + + + +var outOfRange = function( value, low, high ) { + return value < low || value > high; +}; + + + + +/** + * parse( value, tokens, properties ) + * + * @value [String] string date. + * + * @tokens [Object] tokens returned by date/tokenizer. + * + * @properties [Object] output returned by date/tokenizer-properties. + * + * ref: http://www.unicode.org/reports/tr35/tr35-dates.html#Date_Format_Patterns + */ +var dateParse = function( value, tokens, properties ) { + var amPm, day, daysOfYear, month, era, hour, hour12, timezoneOffset, valid, + YEAR = 0, + MONTH = 1, + DAY = 2, + HOUR = 3, + MINUTE = 4, + SECOND = 5, + MILLISECONDS = 6, + date = new Date(), + truncateAt = [], + units = [ "year", "month", "day", "hour", "minute", "second", "milliseconds" ]; + + if ( !tokens.length ) { + return null; + } + + valid = tokens.every(function( token ) { + var century, chr, value, length; + + if ( token.type === "literal" ) { + + // continue + return true; + } + + chr = token.type.charAt( 0 ); + length = token.type.length; + + if ( chr === "j" ) { + + // Locale preferred hHKk. + // http://www.unicode.org/reports/tr35/tr35-dates.html#Time_Data + chr = properties.preferredTimeData; + } + + switch ( chr ) { + + // Era + case "G": + truncateAt.push( YEAR ); + era = +token.value; + break; + + // Year + case "y": + value = token.value; + if ( length === 2 ) { + if ( outOfRange( value, 0, 99 ) ) { + return false; + } + + // mimic dojo/date/locale: choose century to apply, according to a sliding + // window of 80 years before and 20 years after present year. + century = Math.floor( date.getFullYear() / 100 ) * 100; + value += century; + if ( value > date.getFullYear() + 20 ) { + value -= 100; + } + } + date.setFullYear( value ); + truncateAt.push( YEAR ); + break; + + case "Y": // Year in "Week of Year" + throw createErrorUnsupportedFeature({ + feature: "year pattern `" + chr + "`" + }); + + // Quarter (skip) + case "Q": + case "q": + break; + + // Month + case "M": + case "L": + if ( length <= 2 ) { + value = token.value; + } else { + value = +token.value; + } + if ( outOfRange( value, 1, 12 ) ) { + return false; + } + + // Setting the month later so that we have the correct year and can determine + // the correct last day of February in case of leap year. + month = value; + truncateAt.push( MONTH ); + break; + + // Week (skip) + case "w": // Week of Year. + case "W": // Week of Month. + break; + + // Day + case "d": + day = token.value; + truncateAt.push( DAY ); + break; + + case "D": + daysOfYear = token.value; + truncateAt.push( DAY ); + break; + + case "F": + + // Day of Week in month. eg. 2nd Wed in July. + // Skip + break; + + // Week day + case "e": + case "c": + case "E": + + // Skip. + // value = arrayIndexOf( dateWeekDays, token.value ); + break; + + // Period (AM or PM) + case "a": + amPm = token.value; + break; + + // Hour + case "h": // 1-12 + value = token.value; + if ( outOfRange( value, 1, 12 ) ) { + return false; + } + hour = hour12 = true; + date.setHours( value === 12 ? 0 : value ); + truncateAt.push( HOUR ); + break; + + case "K": // 0-11 + value = token.value; + if ( outOfRange( value, 0, 11 ) ) { + return false; + } + hour = hour12 = true; + date.setHours( value ); + truncateAt.push( HOUR ); + break; + + case "k": // 1-24 + value = token.value; + if ( outOfRange( value, 1, 24 ) ) { + return false; + } + hour = true; + date.setHours( value === 24 ? 0 : value ); + truncateAt.push( HOUR ); + break; + + case "H": // 0-23 + value = token.value; + if ( outOfRange( value, 0, 23 ) ) { + return false; + } + hour = true; + date.setHours( value ); + truncateAt.push( HOUR ); + break; + + // Minute + case "m": + value = token.value; + if ( outOfRange( value, 0, 59 ) ) { + return false; + } + date.setMinutes( value ); + truncateAt.push( MINUTE ); + break; + + // Second + case "s": + value = token.value; + if ( outOfRange( value, 0, 59 ) ) { + return false; + } + date.setSeconds( value ); + truncateAt.push( SECOND ); + break; + + case "A": + date.setHours( 0 ); + date.setMinutes( 0 ); + date.setSeconds( 0 ); + + /* falls through */ + case "S": + value = Math.round( token.value * Math.pow( 10, 3 - length ) ); + date.setMilliseconds( value ); + truncateAt.push( MILLISECONDS ); + break; + + // Zone + case "Z": + case "z": + case "O": + case "X": + case "x": + timezoneOffset = token.value - date.getTimezoneOffset(); + break; + } + + return true; + }); + + if ( !valid ) { + return null; + } + + // 12-hour format needs AM or PM, 24-hour format doesn't, ie. return null + // if amPm && !hour12 || !amPm && hour12. + if ( hour && !( !amPm ^ hour12 ) ) { + return null; + } + + if ( era === 0 ) { + + // 1 BC = year 0 + date.setFullYear( date.getFullYear() * -1 + 1 ); + } + + if ( month !== undefined ) { + dateSetMonth( date, month - 1 ); + } + + if ( day !== undefined ) { + if ( outOfRange( day, 1, dateLastDayOfMonth( date ) ) ) { + return null; + } + date.setDate( day ); + } else if ( daysOfYear !== undefined ) { + if ( outOfRange( daysOfYear, 1, dateIsLeapYear( date.getFullYear() ) ? 366 : 365 ) ) { + return null; + } + date.setMonth( 0 ); + date.setDate( daysOfYear ); + } + + if ( hour12 && amPm === "pm" ) { + date.setHours( date.getHours() + 12 ); + } + + if ( timezoneOffset ) { + date.setMinutes( date.getMinutes() + timezoneOffset ); + } + + // Truncate date at the most precise unit defined. Eg. + // If value is "12/31", and pattern is "MM/dd": + // => new Date( , 12, 31, 0, 0, 0, 0 ); + truncateAt = Math.max.apply( null, truncateAt ); + date = dateStartOf( date, units[ truncateAt ] ); + + return date; +}; + + + + +/** + * Generated by: + * + * regenerate().add( require( "unicode-7.0.0/categories/N/symbols" ) ).toString(); + * + * https://github.com/mathiasbynens/regenerate + * https://github.com/mathiasbynens/unicode-7.0.0 + */ +var regexpN = /[0-9\xB2\xB3\xB9\xBC-\xBE\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u09F4-\u09F9\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0B72-\u0B77\u0BE6-\u0BF2\u0C66-\u0C6F\u0C78-\u0C7E\u0CE6-\u0CEF\u0D66-\u0D75\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F33\u1040-\u1049\u1090-\u1099\u1369-\u137C\u16EE-\u16F0\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1946-\u194F\u19D0-\u19DA\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\u2070\u2074-\u2079\u2080-\u2089\u2150-\u2182\u2185-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2CFD\u3007\u3021-\u3029\u3038-\u303A\u3192-\u3195\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\uA620-\uA629\uA6E6-\uA6EF\uA830-\uA835\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19]|\uD800[\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDEE1-\uDEFB\uDF20-\uDF23\uDF41\uDF4A\uDFD1-\uDFD5]|\uD801[\uDCA0-\uDCA9]|\uD802[\uDC58-\uDC5F\uDC79-\uDC7F\uDCA7-\uDCAF\uDD16-\uDD1B\uDE40-\uDE47\uDE7D\uDE7E\uDE9D-\uDE9F\uDEEB-\uDEEF\uDF58-\uDF5F\uDF78-\uDF7F\uDFA9-\uDFAF]|\uD803[\uDE60-\uDE7E]|\uD804[\uDC52-\uDC6F\uDCF0-\uDCF9\uDD36-\uDD3F\uDDD0-\uDDD9\uDDE1-\uDDF4\uDEF0-\uDEF9]|\uD805[\uDCD0-\uDCD9\uDE50-\uDE59\uDEC0-\uDEC9]|\uD806[\uDCE0-\uDCF2]|\uD809[\uDC00-\uDC6E]|\uD81A[\uDE60-\uDE69\uDF50-\uDF59\uDF5B-\uDF61]|\uD834[\uDF60-\uDF71]|\uD835[\uDFCE-\uDFFF]|\uD83A[\uDCC7-\uDCCF]|\uD83C[\uDD00-\uDD0C]/; + + + + +/** + * tokenizer( value, pattern, properties ) + * + * @value [String] string date. + * + * @properties [Object] output returned by date/tokenizer-properties. + * + * Returns an Array of tokens, eg. value "5 o'clock PM", pattern "h 'o''clock' a": + * [{ + * type: "h", + * lexeme: "5" + * }, { + * type: "literal", + * lexeme: " " + * }, { + * type: "literal", + * lexeme: "o'clock" + * }, { + * type: "literal", + * lexeme: " " + * }, { + * type: "a", + * lexeme: "PM", + * value: "pm" + * }] + * + * OBS: lexeme's are always String and may return invalid ranges depending of the token type. + * Eg. "99" for month number. + * + * Return an empty Array when not successfully parsed. + */ +var dateTokenizer = function( value, numberParser, properties ) { + var valid, + timeSeparator = properties.timeSeparator, + tokens = [], + widths = [ "abbreviated", "wide", "narrow" ]; + + valid = properties.pattern.match( datePatternRe ).every(function( current ) { + var chr, length, numeric, tokenRe, + token = {}; + + function hourFormatParse( tokenRe, numberParser ) { + var aux = value.match( tokenRe ); + numberParser = numberParser || function( value ) { + return +value; + }; + + if ( !aux ) { + return false; + } + + // hourFormat containing H only, e.g., `+H;-H` + if ( aux.length < 8 ) { + token.value = + ( aux[ 1 ] ? -numberParser( aux[ 1 ] ) : numberParser( aux[ 4 ] ) ) * 60; + + // hourFormat containing H and m, e.g., `+HHmm;-HHmm` + } else { + token.value = + ( aux[ 1 ] ? -numberParser( aux[ 1 ] ) : numberParser( aux[ 7 ] ) ) * 60 + + ( aux[ 1 ] ? -numberParser( aux[ 4 ] ) : numberParser( aux[ 10 ] ) ); + } + + return true; + } + + // Transform: + // - "+H;-H" -> /\+(\d\d?)|-(\d\d?)/ + // - "+HH;-HH" -> /\+(\d\d)|-(\d\d)/ + // - "+HHmm;-HHmm" -> /\+(\d\d)(\d\d)|-(\d\d)(\d\d)/ + // - "+HH:mm;-HH:mm" -> /\+(\d\d):(\d\d)|-(\d\d):(\d\d)/ + // + // If gmtFormat is GMT{0}, the regexp must fill {0} in each side, e.g.: + // - "+H;-H" -> /GMT\+(\d\d?)|GMT-(\d\d?)/ + function hourFormatRe( hourFormat, gmtFormat, timeSeparator ) { + var re; + + if ( !gmtFormat ) { + gmtFormat = "{0}"; + } + + re = hourFormat + .replace( "+", "\\+" ) + + // Unicode equivalent to (\\d\\d) + .replace( /HH|mm/g, "((" + regexpN.source + ")(" + regexpN.source + "))" ) + + // Unicode equivalent to (\\d\\d?) + .replace( /H|m/g, "((" + regexpN.source + ")(" + regexpN.source + ")?)" ); + + if ( timeSeparator ) { + re = re.replace( /:/g, timeSeparator ); + } + + re = re.split( ";" ).map(function( part ) { + return gmtFormat.replace( "{0}", part ); + }).join( "|" ); + + return new RegExp( re ); + } + + function oneDigitIfLengthOne() { + if ( length === 1 ) { + + // Unicode equivalent to /\d/ + numeric = true; + return tokenRe = regexpN; + } + } + + function oneOrTwoDigitsIfLengthOne() { + if ( length === 1 ) { + + // Unicode equivalent to /\d\d?/ + numeric = true; + return tokenRe = new RegExp( "(" + regexpN.source + ")(" + regexpN.source + ")?" ); + } + } + + function twoDigitsIfLengthTwo() { + if ( length === 2 ) { + + // Unicode equivalent to /\d\d/ + numeric = true; + return tokenRe = new RegExp( "(" + regexpN.source + ")(" + regexpN.source + ")" ); + } + } + + // Brute-force test every locale entry in an attempt to match the given value. + // Return the first found one (and set token accordingly), or null. + function lookup( path ) { + var i, re, + data = properties[ path.join( "/" ) ]; + + for ( i in data ) { + re = new RegExp( "^" + data[ i ] ); + if ( re.test( value ) ) { + token.value = i; + return tokenRe = new RegExp( data[ i ] ); + } + } + return null; + } + + token.type = current; + chr = current.charAt( 0 ), + length = current.length; + + if ( chr === "Z" ) { + + // Z..ZZZ: same as "xxxx". + if ( length < 4 ) { + chr = "x"; + length = 4; + + // ZZZZ: same as "OOOO". + } else if ( length < 5 ) { + chr = "O"; + length = 4; + + // ZZZZZ: same as "XXXXX" + } else { + chr = "X"; + length = 5; + } + } + + switch ( chr ) { + + // Era + case "G": + lookup([ + "gregorian/eras", + length <= 3 ? "eraAbbr" : ( length === 4 ? "eraNames" : "eraNarrow" ) + ]); + break; + + // Year + case "y": + case "Y": + numeric = true; + + // number l=1:+, l=2:{2}, l=3:{3,}, l=4:{4,}, ... + if ( length === 1 ) { + + // Unicode equivalent to /\d+/. + tokenRe = new RegExp( "(" + regexpN.source + ")+" ); + } else if ( length === 2 ) { + + // Unicode equivalent to /\d\d/ + tokenRe = new RegExp( "(" + regexpN.source + ")(" + regexpN.source + ")" ); + } else { + + // Unicode equivalent to /\d{length,}/ + tokenRe = new RegExp( "(" + regexpN.source + "){" + length + ",}" ); + } + break; + + // Quarter + case "Q": + case "q": + + // number l=1:{1}, l=2:{2}. + // lookup l=3... + oneDigitIfLengthOne() || twoDigitsIfLengthTwo() || lookup([ + "gregorian/quarters", + chr === "Q" ? "format" : "stand-alone", + widths[ length - 3 ] + ]); + break; + + // Month + case "M": + case "L": + + // number l=1:{1,2}, l=2:{2}. + // lookup l=3... + oneOrTwoDigitsIfLengthOne() || twoDigitsIfLengthTwo() || lookup([ + "gregorian/months", + chr === "M" ? "format" : "stand-alone", + widths[ length - 3 ] + ]); + break; + + // Day + case "D": + + // number {l,3}. + if ( length <= 3 ) { + + // Unicode equivalent to /\d{length,3}/ + numeric = true; + tokenRe = new RegExp( "(" + regexpN.source + "){" + length + ",3}" ); + } + break; + + case "W": + case "F": + + // number l=1:{1}. + oneDigitIfLengthOne(); + break; + + // Week day + case "e": + case "c": + + // number l=1:{1}, l=2:{2}. + // lookup for length >=3. + if ( length <= 2 ) { + oneDigitIfLengthOne() || twoDigitsIfLengthTwo(); + break; + } + + /* falls through */ + case "E": + if ( length === 6 ) { + + // Note: if short day names are not explicitly specified, abbreviated day + // names are used instead http://www.unicode.org/reports/tr35/tr35-dates.html#months_days_quarters_eras + lookup([ + "gregorian/days", + [ chr === "c" ? "stand-alone" : "format" ], + "short" + ]) || lookup([ + "gregorian/days", + [ chr === "c" ? "stand-alone" : "format" ], + "abbreviated" + ]); + } else { + lookup([ + "gregorian/days", + [ chr === "c" ? "stand-alone" : "format" ], + widths[ length < 3 ? 0 : length - 3 ] + ]); + } + break; + + // Period (AM or PM) + case "a": + lookup([ + "gregorian/dayPeriods/format/wide" + ]); + break; + + // Week, Day, Hour, Minute, or Second + case "w": + case "d": + case "h": + case "H": + case "K": + case "k": + case "j": + case "m": + case "s": + + // number l1:{1,2}, l2:{2}. + oneOrTwoDigitsIfLengthOne() || twoDigitsIfLengthTwo(); + break; + + case "S": + + // number {l}. + + // Unicode equivalent to /\d{length}/ + numeric = true; + tokenRe = new RegExp( "(" + regexpN.source + "){" + length + "}" ); + break; + + case "A": + + // number {l+5}. + + // Unicode equivalent to /\d{length+5}/ + numeric = true; + tokenRe = new RegExp( "(" + regexpN.source + "){" + ( length + 5 ) + "}" ); + break; + + // Zone + case "z": + case "O": + + // O: "{gmtFormat}+H;{gmtFormat}-H" or "{gmtZeroFormat}", eg. "GMT-8" or "GMT". + // OOOO: "{gmtFormat}{hourFormat}" or "{gmtZeroFormat}", eg. "GMT-08:00" or "GMT". + if ( value === properties[ "timeZoneNames/gmtZeroFormat" ] ) { + token.value = 0; + tokenRe = new RegExp( properties[ "timeZoneNames/gmtZeroFormat" ] ); + } else { + tokenRe = hourFormatRe( + length < 4 ? "+H;-H" : properties[ "timeZoneNames/hourFormat" ], + properties[ "timeZoneNames/gmtFormat" ], + timeSeparator + ); + if ( !hourFormatParse( tokenRe, numberParser ) ) { + return null; + } + } + break; + + case "X": + + // Same as x*, except it uses "Z" for zero offset. + if ( value === "Z" ) { + token.value = 0; + tokenRe = /Z/; + break; + } + + /* falls through */ + case "x": + + // x: hourFormat("+HH;-HH") + // xx or xxxx: hourFormat("+HHmm;-HHmm") + // xxx or xxxxx: hourFormat("+HH:mm;-HH:mm") + tokenRe = hourFormatRe( + length === 1 ? "+HH;-HH" : ( length % 2 ? "+HH:mm;-HH:mm" : "+HHmm;-HHmm" ) + ); + if ( !hourFormatParse( tokenRe ) ) { + return null; + } + break; + + case "'": + token.type = "literal"; + current = current.replace( /''/, "'" ); + if ( length > 2 ) { + current = current.slice( 1, -1 ); + } + tokenRe = new RegExp( regexpEscape( current ) ); + break; + + default: + token.type = "literal"; + tokenRe = /./; + } + + if ( !tokenRe ) { + return false; + } + + // Get lexeme and consume it. + value = value.replace( new RegExp( "^" + tokenRe.source ), function( lexeme ) { + token.lexeme = lexeme; + if ( numeric ) { + token.value = numberParser( lexeme ); + } + return ""; + }); + + if ( !token.lexeme ) { + return false; + } + + tokens.push( token ); + return true; + }); + + if ( value !== "" ) { + valid = false; + } + + return valid ? tokens : []; +}; + + + + +var dateParserFn = function( numberParser, parseProperties, tokenizerProperties ) { + return function dateParser( value ) { + var tokens; + + validateParameterPresence( value, "value" ); + validateParameterTypeString( value, "value" ); + + tokens = dateTokenizer( value, numberParser, tokenizerProperties ); + return dateParse( value, tokens, parseProperties ) || null; + }; +}; + + + + +/** + * parseProperties( cldr ) + * + * @cldr [Cldr instance]. + * + * Return parser properties. + */ +var dateParseProperties = function( cldr ) { + return { + preferredTimeData: cldr.supplemental.timeData.preferred() + }; +}; + + + + +/** + * tokenizerProperties( pattern, cldr ) + * + * @pattern [String] raw pattern. + * + * @cldr [Cldr instance]. + * + * Return Object with data that will be used by tokenizer. + */ +var dateTokenizerProperties = function( pattern, cldr ) { + var properties = { + pattern: pattern, + timeSeparator: numberSymbol( "timeSeparator", cldr ) + }, + widths = [ "abbreviated", "wide", "narrow" ]; + + function populateProperties( path, value ) { + + // The `dates` and `calendars` trim's purpose is to reduce properties' key size only. + properties[ path.replace( /^.*\/dates\//, "" ).replace( /calendars\//, "" ) ] = value; + } + + cldr.on( "get", populateProperties ); + + pattern.match( datePatternRe ).forEach(function( current ) { + var chr, length; + + chr = current.charAt( 0 ), + length = current.length; + + if ( chr === "Z" && length < 5 ) { + chr = "O"; + length = 4; + } + + switch ( chr ) { + + // Era + case "G": + cldr.main([ + "dates/calendars/gregorian/eras", + length <= 3 ? "eraAbbr" : ( length === 4 ? "eraNames" : "eraNarrow" ) + ]); + break; + + // Year + case "u": // Extended year. Need to be implemented. + case "U": // Cyclic year name. Need to be implemented. + throw createErrorUnsupportedFeature({ + feature: "year pattern `" + chr + "`" + }); + + // Quarter + case "Q": + case "q": + if ( length > 2 ) { + cldr.main([ + "dates/calendars/gregorian/quarters", + chr === "Q" ? "format" : "stand-alone", + widths[ length - 3 ] + ]); + } + break; + + // Month + case "M": + case "L": + + // number l=1:{1,2}, l=2:{2}. + // lookup l=3... + if ( length > 2 ) { + cldr.main([ + "dates/calendars/gregorian/months", + chr === "M" ? "format" : "stand-alone", + widths[ length - 3 ] + ]); + } + break; + + // Day + case "g": + + // Modified Julian day. Need to be implemented. + throw createErrorUnsupportedFeature({ + feature: "Julian day pattern `g`" + }); + + // Week day + case "e": + case "c": + + // lookup for length >=3. + if ( length <= 2 ) { + break; + } + + /* falls through */ + case "E": + if ( length === 6 ) { + + // Note: if short day names are not explicitly specified, abbreviated day + // names are used instead http://www.unicode.org/reports/tr35/tr35-dates.html#months_days_quarters_eras + cldr.main([ + "dates/calendars/gregorian/days", + [ chr === "c" ? "stand-alone" : "format" ], + "short" + ]) || cldr.main([ + "dates/calendars/gregorian/days", + [ chr === "c" ? "stand-alone" : "format" ], + "abbreviated" + ]); + } else { + cldr.main([ + "dates/calendars/gregorian/days", + [ chr === "c" ? "stand-alone" : "format" ], + widths[ length < 3 ? 0 : length - 3 ] + ]); + } + break; + + // Period (AM or PM) + case "a": + cldr.main([ + "dates/calendars/gregorian/dayPeriods/format/wide" + ]); + break; + + // Zone + case "z": + case "O": + cldr.main( "dates/timeZoneNames/gmtFormat" ); + cldr.main( "dates/timeZoneNames/gmtZeroFormat" ); + cldr.main( "dates/timeZoneNames/hourFormat" ); + break; + + case "v": + case "V": + throw createErrorUnsupportedFeature({ + feature: "timezone pattern `" + chr + "`" + }); + } + }); + + cldr.off( "get", populateProperties ); + + return properties; +}; + + + + +function validateRequiredCldr( path, value ) { + validateCldr( path, value, { + skip: [ + /dates\/calendars\/gregorian\/dateTimeFormats\/availableFormats/, + /dates\/calendars\/gregorian\/days\/.*\/short/, + /supplemental\/timeData\/(?!001)/, + /supplemental\/weekData\/(?!001)/ + ] + }); +} + +/** + * .dateFormatter( options ) + * + * @options [Object] see date/expand_pattern for more info. + * + * Return a date formatter function (of the form below) according to the given options and the + * default/instance locale. + * + * fn( value ) + * + * @value [Date] + * + * Return a function that formats a date according to the given `format` and the default/instance + * locale. + */ +Globalize.dateFormatter = +Globalize.prototype.dateFormatter = function( options ) { + var args, cldr, numberFormatters, pad, pattern, properties, returnFn; + + validateParameterTypePlainObject( options, "options" ); + + cldr = this.cldr; + options = options || { skeleton: "yMd" }; + + args = [ options ]; + + validateDefaultLocale( cldr ); + + cldr.on( "get", validateRequiredCldr ); + pattern = dateExpandPattern( options, cldr ); + properties = dateFormatProperties( pattern, cldr ); + cldr.off( "get", validateRequiredCldr ); + + // Create needed number formatters. + numberFormatters = properties.numberFormatters; + delete properties.numberFormatters; + for ( pad in numberFormatters ) { + numberFormatters[ pad ] = this.numberFormatter({ + raw: numberFormatters[ pad ] + }); + } + + returnFn = dateFormatterFn( numberFormatters, properties ); + + runtimeBind( args, cldr, returnFn, [ numberFormatters, properties ] ); + + return returnFn; +}; + +/** + * .dateParser( options ) + * + * @options [Object] see date/expand_pattern for more info. + * + * Return a function that parses a string date according to the given `formats` and the + * default/instance locale. + */ +Globalize.dateParser = +Globalize.prototype.dateParser = function( options ) { + var args, cldr, numberParser, parseProperties, pattern, tokenizerProperties, returnFn; + + validateParameterTypePlainObject( options, "options" ); + + cldr = this.cldr; + options = options || { skeleton: "yMd" }; + + args = [ options ]; + + validateDefaultLocale( cldr ); + + cldr.on( "get", validateRequiredCldr ); + pattern = dateExpandPattern( options, cldr ); + tokenizerProperties = dateTokenizerProperties( pattern, cldr ); + parseProperties = dateParseProperties( cldr ); + cldr.off( "get", validateRequiredCldr ); + + numberParser = this.numberParser({ raw: "0" }); + + returnFn = dateParserFn( numberParser, parseProperties, tokenizerProperties ); + + runtimeBind( args, cldr, returnFn, [ numberParser, parseProperties, tokenizerProperties ] ); + + return returnFn; +}; + +/** + * .formatDate( value, options ) + * + * @value [Date] + * + * @options [Object] see date/expand_pattern for more info. + * + * Formats a date or number according to the given options string and the default/instance locale. + */ +Globalize.formatDate = +Globalize.prototype.formatDate = function( value, options ) { + validateParameterPresence( value, "value" ); + validateParameterTypeDate( value, "value" ); + + return this.dateFormatter( options )( value ); +}; + +/** + * .parseDate( value, options ) + * + * @value [String] + * + * @options [Object] see date/expand_pattern for more info. + * + * Return a Date instance or null. + */ +Globalize.parseDate = +Globalize.prototype.parseDate = function( value, options ) { + validateParameterPresence( value, "value" ); + validateParameterTypeString( value, "value" ); + + return this.dateParser( options )( value ); +}; + +return Globalize; + + + + +})); diff --git a/StockManMVC/bower_components/globalize/dist/globalize/message.js b/StockManMVC/bower_components/globalize/dist/globalize/message.js new file mode 100644 index 0000000..5de252b --- /dev/null +++ b/StockManMVC/bower_components/globalize/dist/globalize/message.js @@ -0,0 +1,2076 @@ +/** + * Globalize v1.1.1 + * + * http://github.com/jquery/globalize + * + * Copyright jQuery Foundation and other contributors + * Released under the MIT license + * http://jquery.org/license + * + * Date: 2016-02-04T12:01Z + */ +/*! + * Globalize v1.1.1 2016-02-04T12:01Z Released under the MIT license + * http://git.io/TrdQbw + */ +(function( root, factory ) { + + // UMD returnExports + if ( typeof define === "function" && define.amd ) { + + // AMD + define([ + "cldr", + "../globalize", + "cldr/event" + ], factory ); + } else if ( typeof exports === "object" ) { + + // Node, CommonJS + module.exports = factory( require( "cldrjs" ), require( "globalize" ) ); + } else { + + // Extend global + factory( root.Cldr, root.Globalize ); + } +}(this, function( Cldr, Globalize ) { + +var alwaysArray = Globalize._alwaysArray, + createError = Globalize._createError, + isPlainObject = Globalize._isPlainObject, + runtimeBind = Globalize._runtimeBind, + validateDefaultLocale = Globalize._validateDefaultLocale, + validate = Globalize._validate, + validateParameterPresence = Globalize._validateParameterPresence, + validateParameterType = Globalize._validateParameterType, + validateParameterTypePlainObject = Globalize._validateParameterTypePlainObject; +var MessageFormat; +/* jshint ignore:start */ +MessageFormat = (function() { +MessageFormat._parse = (function() { + + /* + * Generated by PEG.js 0.8.0. + * + * http://pegjs.majda.cz/ + */ + + function peg$subclass(child, parent) { + function ctor() { this.constructor = child; } + ctor.prototype = parent.prototype; + child.prototype = new ctor(); + } + + function SyntaxError(message, expected, found, offset, line, column) { + this.message = message; + this.expected = expected; + this.found = found; + this.offset = offset; + this.line = line; + this.column = column; + + this.name = "SyntaxError"; + } + + peg$subclass(SyntaxError, Error); + + function parse(input) { + var options = arguments.length > 1 ? arguments[1] : {}, + + peg$FAILED = {}, + + peg$startRuleFunctions = { start: peg$parsestart }, + peg$startRuleFunction = peg$parsestart, + + peg$c0 = [], + peg$c1 = function(st) { + return { type: 'messageFormatPattern', statements: st }; + }, + peg$c2 = peg$FAILED, + peg$c3 = "{", + peg$c4 = { type: "literal", value: "{", description: "\"{\"" }, + peg$c5 = null, + peg$c6 = ",", + peg$c7 = { type: "literal", value: ",", description: "\",\"" }, + peg$c8 = "}", + peg$c9 = { type: "literal", value: "}", description: "\"}\"" }, + peg$c10 = function(argIdx, efmt) { + var res = { + type: "messageFormatElement", + argumentIndex: argIdx + }; + if (efmt && efmt.length) { + res.elementFormat = efmt[1]; + } else { + res.output = true; + } + return res; + }, + peg$c11 = "plural", + peg$c12 = { type: "literal", value: "plural", description: "\"plural\"" }, + peg$c13 = function(t, s) { + return { type: "elementFormat", key: t, val: s }; + }, + peg$c14 = "selectordinal", + peg$c15 = { type: "literal", value: "selectordinal", description: "\"selectordinal\"" }, + peg$c16 = "select", + peg$c17 = { type: "literal", value: "select", description: "\"select\"" }, + peg$c18 = function(t, p) { + return { type: "elementFormat", key: t, val: p }; + }, + peg$c19 = function(op, pf) { + return { type: "pluralFormatPattern", pluralForms: pf, offset: op || 0 }; + }, + peg$c20 = "offset", + peg$c21 = { type: "literal", value: "offset", description: "\"offset\"" }, + peg$c22 = ":", + peg$c23 = { type: "literal", value: ":", description: "\":\"" }, + peg$c24 = function(d) { return d; }, + peg$c25 = function(k, mfp) { + return { key: k, val: mfp }; + }, + peg$c26 = function(i) { return i; }, + peg$c27 = "=", + peg$c28 = { type: "literal", value: "=", description: "\"=\"" }, + peg$c29 = function(pf) { return { type: "selectFormatPattern", pluralForms: pf }; }, + peg$c30 = function(p) { return p; }, + peg$c31 = "#", + peg$c32 = { type: "literal", value: "#", description: "\"#\"" }, + peg$c33 = function() { return {type: 'octothorpe'}; }, + peg$c34 = function(s) { return { type: "string", val: s.join('') }; }, + peg$c35 = { type: "other", description: "identifier" }, + peg$c36 = /^[0-9a-zA-Z$_]/, + peg$c37 = { type: "class", value: "[0-9a-zA-Z$_]", description: "[0-9a-zA-Z$_]" }, + peg$c38 = /^[^ \t\n\r,.+={}]/, + peg$c39 = { type: "class", value: "[^ \\t\\n\\r,.+={}]", description: "[^ \\t\\n\\r,.+={}]" }, + peg$c40 = function(s) { return s; }, + peg$c41 = function(chars) { return chars.join(''); }, + peg$c42 = /^[^{}#\\\0-\x1F \t\n\r]/, + peg$c43 = { type: "class", value: "[^{}#\\\\\\0-\\x1F \\t\\n\\r]", description: "[^{}#\\\\\\0-\\x1F \\t\\n\\r]" }, + peg$c44 = function(x) { return x; }, + peg$c45 = "\\\\", + peg$c46 = { type: "literal", value: "\\\\", description: "\"\\\\\\\\\"" }, + peg$c47 = function() { return "\\"; }, + peg$c48 = "\\#", + peg$c49 = { type: "literal", value: "\\#", description: "\"\\\\#\"" }, + peg$c50 = function() { return "#"; }, + peg$c51 = "\\{", + peg$c52 = { type: "literal", value: "\\{", description: "\"\\\\{\"" }, + peg$c53 = function() { return "\u007B"; }, + peg$c54 = "\\}", + peg$c55 = { type: "literal", value: "\\}", description: "\"\\\\}\"" }, + peg$c56 = function() { return "\u007D"; }, + peg$c57 = "\\u", + peg$c58 = { type: "literal", value: "\\u", description: "\"\\\\u\"" }, + peg$c59 = function(h1, h2, h3, h4) { + return String.fromCharCode(parseInt("0x" + h1 + h2 + h3 + h4)); + }, + peg$c60 = /^[0-9]/, + peg$c61 = { type: "class", value: "[0-9]", description: "[0-9]" }, + peg$c62 = function(ds) { + //the number might start with 0 but must not be interpreted as an octal number + //Hence, the base is passed to parseInt explicitely + return parseInt((ds.join('')), 10); + }, + peg$c63 = /^[0-9a-fA-F]/, + peg$c64 = { type: "class", value: "[0-9a-fA-F]", description: "[0-9a-fA-F]" }, + peg$c65 = { type: "other", description: "whitespace" }, + peg$c66 = function(w) { return w.join(''); }, + peg$c67 = /^[ \t\n\r]/, + peg$c68 = { type: "class", value: "[ \\t\\n\\r]", description: "[ \\t\\n\\r]" }, + + peg$currPos = 0, + peg$reportedPos = 0, + peg$cachedPos = 0, + peg$cachedPosDetails = { line: 1, column: 1, seenCR: false }, + peg$maxFailPos = 0, + peg$maxFailExpected = [], + peg$silentFails = 0, + + peg$result; + + if ("startRule" in options) { + if (!(options.startRule in peg$startRuleFunctions)) { + throw new Error("Can't start parsing from rule \"" + options.startRule + "\"."); + } + + peg$startRuleFunction = peg$startRuleFunctions[options.startRule]; + } + + function text() { + return input.substring(peg$reportedPos, peg$currPos); + } + + function offset() { + return peg$reportedPos; + } + + function line() { + return peg$computePosDetails(peg$reportedPos).line; + } + + function column() { + return peg$computePosDetails(peg$reportedPos).column; + } + + function expected(description) { + throw peg$buildException( + null, + [{ type: "other", description: description }], + peg$reportedPos + ); + } + + function error(message) { + throw peg$buildException(message, null, peg$reportedPos); + } + + function peg$computePosDetails(pos) { + function advance(details, startPos, endPos) { + var p, ch; + + for (p = startPos; p < endPos; p++) { + ch = input.charAt(p); + if (ch === "\n") { + if (!details.seenCR) { details.line++; } + details.column = 1; + details.seenCR = false; + } else if (ch === "\r" || ch === "\u2028" || ch === "\u2029") { + details.line++; + details.column = 1; + details.seenCR = true; + } else { + details.column++; + details.seenCR = false; + } + } + } + + if (peg$cachedPos !== pos) { + if (peg$cachedPos > pos) { + peg$cachedPos = 0; + peg$cachedPosDetails = { line: 1, column: 1, seenCR: false }; + } + advance(peg$cachedPosDetails, peg$cachedPos, pos); + peg$cachedPos = pos; + } + + return peg$cachedPosDetails; + } + + function peg$fail(expected) { + if (peg$currPos < peg$maxFailPos) { return; } + + if (peg$currPos > peg$maxFailPos) { + peg$maxFailPos = peg$currPos; + peg$maxFailExpected = []; + } + + peg$maxFailExpected.push(expected); + } + + function peg$buildException(message, expected, pos) { + function cleanupExpected(expected) { + var i = 1; + + expected.sort(function(a, b) { + if (a.description < b.description) { + return -1; + } else if (a.description > b.description) { + return 1; + } else { + return 0; + } + }); + + while (i < expected.length) { + if (expected[i - 1] === expected[i]) { + expected.splice(i, 1); + } else { + i++; + } + } + } + + function buildMessage(expected, found) { + function stringEscape(s) { + function hex(ch) { return ch.charCodeAt(0).toString(16).toUpperCase(); } + + return s + .replace(/\\/g, '\\\\') + .replace(/"/g, '\\"') + .replace(/\x08/g, '\\b') + .replace(/\t/g, '\\t') + .replace(/\n/g, '\\n') + .replace(/\f/g, '\\f') + .replace(/\r/g, '\\r') + .replace(/[\x00-\x07\x0B\x0E\x0F]/g, function(ch) { return '\\x0' + hex(ch); }) + .replace(/[\x10-\x1F\x80-\xFF]/g, function(ch) { return '\\x' + hex(ch); }) + .replace(/[\u0180-\u0FFF]/g, function(ch) { return '\\u0' + hex(ch); }) + .replace(/[\u1080-\uFFFF]/g, function(ch) { return '\\u' + hex(ch); }); + } + + var expectedDescs = new Array(expected.length), + expectedDesc, foundDesc, i; + + for (i = 0; i < expected.length; i++) { + expectedDescs[i] = expected[i].description; + } + + expectedDesc = expected.length > 1 + ? expectedDescs.slice(0, -1).join(", ") + + " or " + + expectedDescs[expected.length - 1] + : expectedDescs[0]; + + foundDesc = found ? "\"" + stringEscape(found) + "\"" : "end of input"; + + return "Expected " + expectedDesc + " but " + foundDesc + " found."; + } + + var posDetails = peg$computePosDetails(pos), + found = pos < input.length ? input.charAt(pos) : null; + + if (expected !== null) { + cleanupExpected(expected); + } + + return new SyntaxError( + message !== null ? message : buildMessage(expected, found), + expected, + found, + pos, + posDetails.line, + posDetails.column + ); + } + + function peg$parsestart() { + var s0; + + s0 = peg$parsemessageFormatPattern(); + + return s0; + } + + function peg$parsemessageFormatPattern() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsemessageFormatElement(); + if (s2 === peg$FAILED) { + s2 = peg$parsestring(); + if (s2 === peg$FAILED) { + s2 = peg$parseoctothorpe(); + } + } + while (s2 !== peg$FAILED) { + s1.push(s2); + s2 = peg$parsemessageFormatElement(); + if (s2 === peg$FAILED) { + s2 = peg$parsestring(); + if (s2 === peg$FAILED) { + s2 = peg$parseoctothorpe(); + } + } + } + if (s1 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c1(s1); + } + s0 = s1; + + return s0; + } + + function peg$parsemessageFormatElement() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 123) { + s1 = peg$c3; + peg$currPos++; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c4); } + } + if (s1 !== peg$FAILED) { + s2 = peg$parse_(); + if (s2 !== peg$FAILED) { + s3 = peg$parseid(); + if (s3 !== peg$FAILED) { + s4 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 44) { + s5 = peg$c6; + peg$currPos++; + } else { + s5 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c7); } + } + if (s5 !== peg$FAILED) { + s6 = peg$parseelementFormat(); + if (s6 !== peg$FAILED) { + s5 = [s5, s6]; + s4 = s5; + } else { + peg$currPos = s4; + s4 = peg$c2; + } + } else { + peg$currPos = s4; + s4 = peg$c2; + } + if (s4 === peg$FAILED) { + s4 = peg$c5; + } + if (s4 !== peg$FAILED) { + s5 = peg$parse_(); + if (s5 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 125) { + s6 = peg$c8; + peg$currPos++; + } else { + s6 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c9); } + } + if (s6 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c10(s3, s4); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + + return s0; + } + + function peg$parseelementFormat() { + var s0, s1, s2, s3, s4, s5, s6, s7; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== peg$FAILED) { + if (input.substr(peg$currPos, 6) === peg$c11) { + s2 = peg$c11; + peg$currPos += 6; + } else { + s2 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c12); } + } + if (s2 !== peg$FAILED) { + s3 = peg$parse_(); + if (s3 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 44) { + s4 = peg$c6; + peg$currPos++; + } else { + s4 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c7); } + } + if (s4 !== peg$FAILED) { + s5 = peg$parse_(); + if (s5 !== peg$FAILED) { + s6 = peg$parsepluralFormatPattern(); + if (s6 !== peg$FAILED) { + s7 = peg$parse_(); + if (s7 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c13(s2, s6); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + if (s0 === peg$FAILED) { + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== peg$FAILED) { + if (input.substr(peg$currPos, 13) === peg$c14) { + s2 = peg$c14; + peg$currPos += 13; + } else { + s2 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c15); } + } + if (s2 !== peg$FAILED) { + s3 = peg$parse_(); + if (s3 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 44) { + s4 = peg$c6; + peg$currPos++; + } else { + s4 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c7); } + } + if (s4 !== peg$FAILED) { + s5 = peg$parse_(); + if (s5 !== peg$FAILED) { + s6 = peg$parsepluralFormatPattern(); + if (s6 !== peg$FAILED) { + s7 = peg$parse_(); + if (s7 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c13(s2, s6); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + if (s0 === peg$FAILED) { + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== peg$FAILED) { + if (input.substr(peg$currPos, 6) === peg$c16) { + s2 = peg$c16; + peg$currPos += 6; + } else { + s2 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c17); } + } + if (s2 !== peg$FAILED) { + s3 = peg$parse_(); + if (s3 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 44) { + s4 = peg$c6; + peg$currPos++; + } else { + s4 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c7); } + } + if (s4 !== peg$FAILED) { + s5 = peg$parse_(); + if (s5 !== peg$FAILED) { + s6 = peg$parseselectFormatPattern(); + if (s6 !== peg$FAILED) { + s7 = peg$parse_(); + if (s7 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c13(s2, s6); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + if (s0 === peg$FAILED) { + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== peg$FAILED) { + s2 = peg$parseid(); + if (s2 !== peg$FAILED) { + s3 = []; + s4 = peg$parseargStylePattern(); + while (s4 !== peg$FAILED) { + s3.push(s4); + s4 = peg$parseargStylePattern(); + } + if (s3 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c18(s2, s3); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } + } + } + + return s0; + } + + function peg$parsepluralFormatPattern() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$parseoffsetPattern(); + if (s1 === peg$FAILED) { + s1 = peg$c5; + } + if (s1 !== peg$FAILED) { + s2 = []; + s3 = peg$parsepluralForm(); + if (s3 !== peg$FAILED) { + while (s3 !== peg$FAILED) { + s2.push(s3); + s3 = peg$parsepluralForm(); + } + } else { + s2 = peg$c2; + } + if (s2 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c19(s1, s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + + return s0; + } + + function peg$parseoffsetPattern() { + var s0, s1, s2, s3, s4, s5, s6, s7; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== peg$FAILED) { + if (input.substr(peg$currPos, 6) === peg$c20) { + s2 = peg$c20; + peg$currPos += 6; + } else { + s2 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c21); } + } + if (s2 !== peg$FAILED) { + s3 = peg$parse_(); + if (s3 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 58) { + s4 = peg$c22; + peg$currPos++; + } else { + s4 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c23); } + } + if (s4 !== peg$FAILED) { + s5 = peg$parse_(); + if (s5 !== peg$FAILED) { + s6 = peg$parsedigits(); + if (s6 !== peg$FAILED) { + s7 = peg$parse_(); + if (s7 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c24(s6); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + + return s0; + } + + function peg$parsepluralForm() { + var s0, s1, s2, s3, s4, s5, s6, s7, s8; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== peg$FAILED) { + s2 = peg$parsepluralKey(); + if (s2 !== peg$FAILED) { + s3 = peg$parse_(); + if (s3 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 123) { + s4 = peg$c3; + peg$currPos++; + } else { + s4 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c4); } + } + if (s4 !== peg$FAILED) { + s5 = peg$parse_(); + if (s5 !== peg$FAILED) { + s6 = peg$parsemessageFormatPattern(); + if (s6 !== peg$FAILED) { + s7 = peg$parse_(); + if (s7 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 125) { + s8 = peg$c8; + peg$currPos++; + } else { + s8 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c9); } + } + if (s8 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c25(s2, s6); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + + return s0; + } + + function peg$parsepluralKey() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = peg$parseid(); + if (s1 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c26(s1); + } + s0 = s1; + if (s0 === peg$FAILED) { + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61) { + s1 = peg$c27; + peg$currPos++; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c28); } + } + if (s1 !== peg$FAILED) { + s2 = peg$parsedigits(); + if (s2 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c24(s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } + + return s0; + } + + function peg$parseselectFormatPattern() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parseselectForm(); + if (s2 !== peg$FAILED) { + while (s2 !== peg$FAILED) { + s1.push(s2); + s2 = peg$parseselectForm(); + } + } else { + s1 = peg$c2; + } + if (s1 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c29(s1); + } + s0 = s1; + + return s0; + } + + function peg$parseselectForm() { + var s0, s1, s2, s3, s4, s5, s6, s7, s8; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== peg$FAILED) { + s2 = peg$parseid(); + if (s2 !== peg$FAILED) { + s3 = peg$parse_(); + if (s3 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 123) { + s4 = peg$c3; + peg$currPos++; + } else { + s4 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c4); } + } + if (s4 !== peg$FAILED) { + s5 = peg$parse_(); + if (s5 !== peg$FAILED) { + s6 = peg$parsemessageFormatPattern(); + if (s6 !== peg$FAILED) { + s7 = peg$parse_(); + if (s7 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 125) { + s8 = peg$c8; + peg$currPos++; + } else { + s8 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c9); } + } + if (s8 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c25(s2, s6); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + + return s0; + } + + function peg$parseargStylePattern() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 44) { + s2 = peg$c6; + peg$currPos++; + } else { + s2 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c7); } + } + if (s2 !== peg$FAILED) { + s3 = peg$parse_(); + if (s3 !== peg$FAILED) { + s4 = peg$parseid(); + if (s4 !== peg$FAILED) { + s5 = peg$parse_(); + if (s5 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c30(s4); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + + return s0; + } + + function peg$parseoctothorpe() { + var s0, s1; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 35) { + s1 = peg$c31; + peg$currPos++; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c32); } + } + if (s1 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c33(); + } + s0 = s1; + + return s0; + } + + function peg$parsestring() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsechars(); + if (s2 === peg$FAILED) { + s2 = peg$parsewhitespace(); + } + if (s2 !== peg$FAILED) { + while (s2 !== peg$FAILED) { + s1.push(s2); + s2 = peg$parsechars(); + if (s2 === peg$FAILED) { + s2 = peg$parsewhitespace(); + } + } + } else { + s1 = peg$c2; + } + if (s1 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c34(s1); + } + s0 = s1; + + return s0; + } + + function peg$parseid() { + var s0, s1, s2, s3, s4, s5, s6; + + peg$silentFails++; + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== peg$FAILED) { + s2 = peg$currPos; + s3 = peg$currPos; + if (peg$c36.test(input.charAt(peg$currPos))) { + s4 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s4 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c37); } + } + if (s4 !== peg$FAILED) { + s5 = []; + if (peg$c38.test(input.charAt(peg$currPos))) { + s6 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s6 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c39); } + } + while (s6 !== peg$FAILED) { + s5.push(s6); + if (peg$c38.test(input.charAt(peg$currPos))) { + s6 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s6 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c39); } + } + } + if (s5 !== peg$FAILED) { + s4 = [s4, s5]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$c2; + } + } else { + peg$currPos = s3; + s3 = peg$c2; + } + if (s3 !== peg$FAILED) { + s3 = input.substring(s2, peg$currPos); + } + s2 = s3; + if (s2 !== peg$FAILED) { + s3 = peg$parse_(); + if (s3 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c40(s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + peg$silentFails--; + if (s0 === peg$FAILED) { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c35); } + } + + return s0; + } + + function peg$parsechars() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsechar(); + if (s2 !== peg$FAILED) { + while (s2 !== peg$FAILED) { + s1.push(s2); + s2 = peg$parsechar(); + } + } else { + s1 = peg$c2; + } + if (s1 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c41(s1); + } + s0 = s1; + + return s0; + } + + function peg$parsechar() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + if (peg$c42.test(input.charAt(peg$currPos))) { + s1 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c43); } + } + if (s1 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c44(s1); + } + s0 = s1; + if (s0 === peg$FAILED) { + s0 = peg$currPos; + if (input.substr(peg$currPos, 2) === peg$c45) { + s1 = peg$c45; + peg$currPos += 2; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c46); } + } + if (s1 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c47(); + } + s0 = s1; + if (s0 === peg$FAILED) { + s0 = peg$currPos; + if (input.substr(peg$currPos, 2) === peg$c48) { + s1 = peg$c48; + peg$currPos += 2; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c49); } + } + if (s1 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c50(); + } + s0 = s1; + if (s0 === peg$FAILED) { + s0 = peg$currPos; + if (input.substr(peg$currPos, 2) === peg$c51) { + s1 = peg$c51; + peg$currPos += 2; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c52); } + } + if (s1 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c53(); + } + s0 = s1; + if (s0 === peg$FAILED) { + s0 = peg$currPos; + if (input.substr(peg$currPos, 2) === peg$c54) { + s1 = peg$c54; + peg$currPos += 2; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c55); } + } + if (s1 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c56(); + } + s0 = s1; + if (s0 === peg$FAILED) { + s0 = peg$currPos; + if (input.substr(peg$currPos, 2) === peg$c57) { + s1 = peg$c57; + peg$currPos += 2; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c58); } + } + if (s1 !== peg$FAILED) { + s2 = peg$parsehexDigit(); + if (s2 !== peg$FAILED) { + s3 = peg$parsehexDigit(); + if (s3 !== peg$FAILED) { + s4 = peg$parsehexDigit(); + if (s4 !== peg$FAILED) { + s5 = peg$parsehexDigit(); + if (s5 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c59(s2, s3, s4, s5); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } else { + peg$currPos = s0; + s0 = peg$c2; + } + } + } + } + } + } + + return s0; + } + + function peg$parsedigits() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + if (peg$c60.test(input.charAt(peg$currPos))) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c61); } + } + if (s2 !== peg$FAILED) { + while (s2 !== peg$FAILED) { + s1.push(s2); + if (peg$c60.test(input.charAt(peg$currPos))) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c61); } + } + } + } else { + s1 = peg$c2; + } + if (s1 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c62(s1); + } + s0 = s1; + + return s0; + } + + function peg$parsehexDigit() { + var s0; + + if (peg$c63.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c64); } + } + + return s0; + } + + function peg$parse_() { + var s0, s1, s2; + + peg$silentFails++; + s0 = peg$currPos; + s1 = []; + s2 = peg$parsewhitespace(); + while (s2 !== peg$FAILED) { + s1.push(s2); + s2 = peg$parsewhitespace(); + } + if (s1 !== peg$FAILED) { + peg$reportedPos = s0; + s1 = peg$c66(s1); + } + s0 = s1; + peg$silentFails--; + if (s0 === peg$FAILED) { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c65); } + } + + return s0; + } + + function peg$parsewhitespace() { + var s0; + + if (peg$c67.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c68); } + } + + return s0; + } + + peg$result = peg$startRuleFunction(); + + if (peg$result !== peg$FAILED && peg$currPos === input.length) { + return peg$result; + } else { + if (peg$result !== peg$FAILED && peg$currPos < input.length) { + peg$fail({ type: "end", description: "end of input" }); + } + + throw peg$buildException(null, peg$maxFailExpected, peg$maxFailPos); + } + } + + return { + SyntaxError: SyntaxError, + parse: parse + }; +}()).parse; + + +/** @file messageformat.js - ICU PluralFormat + SelectFormat for JavaScript + * @author Alex Sexton - @SlexAxton + * @version 0.3.0-1 + * @copyright 2012-2015 Alex Sexton, Eemeli Aro, and Contributors + * @license To use or fork, MIT. To contribute back, Dojo CLA */ + + +/** Utility function for quoting an Object's key value iff required + * @private */ +function propname(key, obj) { + if (/^[A-Z_$][0-9A-Z_$]*$/i.test(key)) { + return obj ? obj + '.' + key : key; + } else { + var jkey = JSON.stringify(key); + return obj ? obj + '[' + jkey + ']' : jkey; + } +}; + + +/** Create a new message formatter + * + * @class + * @global + * @param {string|string[]} [locale="en"] - The locale to use, with fallbacks + * @param {function} [pluralFunc] - Optional custom pluralization function + * @param {function[]} [formatters] - Optional custom formatting functions */ +function MessageFormat(locale, pluralFunc, formatters) { + this.lc = [locale]; + this.runtime.pluralFuncs = {}; + this.runtime.pluralFuncs[this.lc[0]] = pluralFunc; + this.runtime.fmt = {}; + if (formatters) for (var f in formatters) { + this.runtime.fmt[f] = formatters[f]; + } +} + + + + +/** Parse an input string to its AST + * + * Precompiled from `lib/messageformat-parser.pegjs` by + * {@link http://pegjs.org/ PEG.js}. Included in MessageFormat object + * to enable testing. + * + * @private */ + + + +/** Pluralization functions from + * {@link http://github.com/eemeli/make-plural.js make-plural} + * + * @memberof MessageFormat + * @type Object. */ +MessageFormat.plurals = {}; + + +/** Default number formatting functions in the style of ICU's + * {@link http://icu-project.org/apiref/icu4j/com/ibm/icu/text/MessageFormat.html simpleArg syntax} + * implemented using the + * {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl Intl} + * object defined by ECMA-402. + * + * **Note**: Intl is not defined in default Node until 0.11.15 / 0.12.0, so + * earlier versions require a {@link https://www.npmjs.com/package/intl polyfill}. + * Therefore {@link MessageFormat.withIntlSupport} needs to be true for these + * functions to be available for inclusion in the output. + * + * @see MessageFormat#setIntlSupport + * + * @namespace + * @memberof MessageFormat + * @property {function} number - Represent a number as an integer, percent or currency value + * @property {function} date - Represent a date as a full/long/default/short string + * @property {function} time - Represent a time as a full/long/default/short string + * + * @example + * > var MessageFormat = require('messageformat'); + * > var mf = (new MessageFormat('en')).setIntlSupport(true); + * > mf.currency = 'EUR'; + * > var mfunc = mf.compile("The total is {V,number,currency}."); + * > mfunc({V:5.5}) + * "The total is €5.50." + * + * @example + * > var MessageFormat = require('messageformat'); + * > var mf = new MessageFormat('en', null, {number: MessageFormat.number}); + * > mf.currency = 'EUR'; + * > var mfunc = mf.compile("The total is {V,number,currency}."); + * > mfunc({V:5.5}) + * "The total is €5.50." */ +MessageFormat.formatters = {}; + +/** Enable or disable support for the default formatters, which require the + * `Intl` object. Note that this can't be autodetected, as the environment + * in which the formatted text is compiled into Javascript functions is not + * necessarily the same environment in which they will get executed. + * + * @see MessageFormat.formatters + * + * @memberof MessageFormat + * @param {boolean} [enable=true] + * @returns {Object} The MessageFormat instance, to allow for chaining + * @example + * > var Intl = require('intl'); + * > var MessageFormat = require('messageformat'); + * > var mf = (new MessageFormat('en')).setIntlSupport(true); + * > mf.currency = 'EUR'; + * > mf.compile("The total is {V,number,currency}.")({V:5.5}); + * "The total is €5.50." */ + + + +/** A set of utility functions that are called by the compiled Javascript + * functions, these are included locally in the output of {@link + * MessageFormat#compile compile()}. + * + * @namespace + * @memberof MessageFormat */ +MessageFormat.prototype.runtime = { + + /** Utility function for `#` in plural rules + * + * @param {number} value - The value to operate on + * @param {number} [offset=0] - An optional offset, set by the surrounding context */ + number: function(value, offset) { + if (isNaN(value)) throw new Error("'" + value + "' isn't a number."); + return value - (offset || 0); + }, + + /** Utility function for `{N, plural|selectordinal, ...}` + * + * @param {number} value - The key to use to find a pluralization rule + * @param {number} offset - An offset to apply to `value` + * @param {function} lcfunc - A locale function from `pluralFuncs` + * @param {Object.} data - The object from which results are looked up + * @param {?boolean} isOrdinal - If true, use ordinal rather than cardinal rules + * @returns {string} The result of the pluralization */ + plural: function(value, offset, lcfunc, data, isOrdinal) { + if ({}.hasOwnProperty.call(data, value)) return data[value](); + if (offset) value -= offset; + var key = lcfunc(value, isOrdinal); + if (key in data) return data[key](); + return data.other(); + }, + + /** Utility function for `{N, select, ...}` + * + * @param {number} value - The key to use to find a selection + * @param {Object.} data - The object from which results are looked up + * @returns {string} The result of the select statement */ + select: function(value, data) { + if ({}.hasOwnProperty.call(data, value)) return data[value](); + return data.other() + }, + + /** Pluralization functions included in compiled output + * @instance + * @type Object. */ + pluralFuncs: {}, + + /** Custom formatting functions called by `{var, fn[, args]*}` syntax + * + * For examples, see {@link MessageFormat.formatters} + * + * @instance + * @see MessageFormat.formatters + * @type Object. */ + fmt: {}, + + /** Custom stringifier to clean up browser inconsistencies + * @instance */ + toString: function () { + var _stringify = function(o, level) { + if (typeof o != 'object') { + var funcStr = o.toString().replace(/^(function )\w*/, '$1'); + var indent = /([ \t]*)\S.*$/.exec(funcStr); + return indent ? funcStr.replace(new RegExp('^' + indent[1], 'mg'), '') : funcStr; + } + var s = []; + for (var i in o) if (i != 'toString') { + if (level == 0) s.push('var ' + i + ' = ' + _stringify(o[i], level + 1) + ';\n'); + else s.push(propname(i) + ': ' + _stringify(o[i], level + 1)); + } + if (level == 0) return s.join(''); + if (s.length == 0) return '{}'; + var indent = ' '; while (--level) indent += ' '; + return '{\n' + s.join(',\n').replace(/^/gm, indent) + '\n}'; + }; + return _stringify(this, 0); + } +}; + + +/** Recursively map an AST to its resulting string + * + * @memberof MessageFormat + * + * @param ast - the Ast node for which the JS code should be generated + * + * @private */ +MessageFormat.prototype._precompile = function(ast, data) { + data = data || { keys: {}, offset: {} }; + var r = [], i, tmp, args = []; + + switch ( ast.type ) { + case 'messageFormatPattern': + for ( i = 0; i < ast.statements.length; ++i ) { + r.push(this._precompile( ast.statements[i], data )); + } + tmp = r.join(' + ') || '""'; + return data.pf_count ? tmp : 'function(d) { return ' + tmp + '; }'; + + case 'messageFormatElement': + data.pf_count = data.pf_count || 0; + if ( ast.output ) { + return propname(ast.argumentIndex, 'd'); + } + else { + data.keys[data.pf_count] = ast.argumentIndex; + return this._precompile( ast.elementFormat, data ); + } + return ''; + + case 'elementFormat': + args = [ propname(data.keys[data.pf_count], 'd') ]; + switch (ast.key) { + case 'select': + args.push(this._precompile(ast.val, data)); + return 'select(' + args.join(', ') + ')'; + case 'selectordinal': + args = args.concat([ 0, propname(this.lc[0], 'pluralFuncs'), this._precompile(ast.val, data), 1 ]); + return 'plural(' + args.join(', ') + ')'; + case 'plural': + data.offset[data.pf_count || 0] = ast.val.offset || 0; + args = args.concat([ data.offset[data.pf_count] || 0, propname(this.lc[0], 'pluralFuncs'), this._precompile(ast.val, data) ]); + return 'plural(' + args.join(', ') + ')'; + default: + if (this.withIntlSupport && !(ast.key in this.runtime.fmt) && (ast.key in MessageFormat.formatters)) { + tmp = MessageFormat.formatters[ast.key]; + this.runtime.fmt[ast.key] = (typeof tmp(this) == 'function') ? tmp(this) : tmp; + } + args.push(JSON.stringify(this.lc)); + if (ast.val && ast.val.length) args.push(JSON.stringify(ast.val.length == 1 ? ast.val[0] : ast.val)); + return 'fmt.' + ast.key + '(' + args.join(', ') + ')'; + } + + case 'pluralFormatPattern': + case 'selectFormatPattern': + data.pf_count = data.pf_count || 0; + if (ast.type == 'selectFormatPattern') data.offset[data.pf_count] = 0; + var needOther = true; + for (i = 0; i < ast.pluralForms.length; ++i) { + var key = ast.pluralForms[i].key; + if (key === 'other') needOther = false; + var data_copy = JSON.parse(JSON.stringify(data)); + data_copy.pf_count++; + r.push(propname(key) + ': function() { return ' + this._precompile(ast.pluralForms[i].val, data_copy) + ';}'); + } + if (needOther) throw new Error("No 'other' form found in " + ast.type + " " + data.pf_count); + return '{ ' + r.join(', ') + ' }'; + + case 'string': + return JSON.stringify(ast.val || ""); + + case 'octothorpe': + if (!data.pf_count) return '"#"'; + args = [ propname(data.keys[data.pf_count-1], 'd') ]; + if (data.offset[data.pf_count-1]) args.push(data.offset[data.pf_count-1]); + return 'number(' + args.join(', ') + ')'; + + default: + throw new Error( 'Bad AST type: ' + ast.type ); + } +}; + +/** Compile messages into an executable function with clean string + * representation. + * + * If `messages` is a single string including ICU MessageFormat declarations, + * `opt` is ignored and the returned function takes a single Object parameter + * `d` representing each of the input's defined variables. The returned + * function will be defined in a local scope that includes all the required + * runtime variables. + * + * If `messages` is a map of keys to strings, or a map of namespace keys to + * such key/string maps, the returned function will fill the specified global + * with javascript functions matching the structure of the input. In such use, + * the output of `compile()` is expected to be serialized using `.toString()`, + * and will include definitions of the runtime functions. If `opt.global` is + * null, calling the output function will return the object itself. + * + * Together, the input parameters should match the following patterns: + * ```js + * messages = "string" || { key0: "string0", key1: "string1", ... } || { + * ns0: { key0: "string0", key1: "string1", ... }, + * ns1: { key0: "string0", key1: "string1", ... }, + * ... + * } + * + * opt = null || { + * locale: null || { + * ns0: "lc0" || [ "lc0", ... ], + * ns1: "lc1" || [ "lc1", ... ], + * ... + * }, + * global: null || "module.exports" || "exports" || "i18n" || ... + * } + * ``` + * + * @memberof MessageFormat + * @param {string|Object} + * messages - The input message(s) to be compiled, in ICU MessageFormat + * @param {Object} [opt={}] - Options controlling output for non-simple intput + * @param {Object} [opt.locale] - The locales to use for the messages, with a + * structure matching that of `messages` + * @param {string} [opt.global=""] - The global variable that the output + * function should use, or a null string for none. "exports" and + * "module.exports" are recognised as special cases. + * @returns {function} The first match found for the given locale(s) + * + * @example + * > var MessageFormat = require('messageformat'), + * ... mf = new MessageFormat('en'), + * ... mfunc0 = mf.compile('A {TYPE} example.'); + * > mfunc0({TYPE:'simple'}) + * 'A simple example.' + * > mfunc0.toString() + * 'function (d) { return "A " + d.TYPE + " example."; }' + * + * @example + * > var msgSet = { a: 'A {TYPE} example.', + * ... b: 'This has {COUNT, plural, one{one member} other{# members}}.' }, + * ... mfuncSet = mf.compile(msgSet); + * > mfuncSet().a({TYPE:'more complex'}) + * 'A more complex example.' + * > mfuncSet().b({COUNT:2}) + * 'This has 2 members.' + * + * > console.log(mfuncSet.toString()) + * function anonymous() { + * var number = function (value, offset) { + * if (isNaN(value)) throw new Error("'" + value + "' isn't a number."); + * return value - (offset || 0); + * }; + * var plural = function (value, offset, lcfunc, data, isOrdinal) { + * if ({}.hasOwnProperty.call(data, value)) return data[value](); + * if (offset) value -= offset; + * var key = lcfunc(value, isOrdinal); + * if (key in data) return data[key](); + * return data.other(); + * }; + * var select = function (value, data) { + * if ({}.hasOwnProperty.call(data, value)) return data[value](); + * return data.other() + * }; + * var pluralFuncs = { + * en: function (n, ord) { + * var s = String(n).split('.'), v0 = !s[1], t0 = Number(s[0]) == n, + * n10 = t0 && s[0].slice(-1), n100 = t0 && s[0].slice(-2); + * if (ord) return (n10 == 1 && n100 != 11) ? 'one' + * : (n10 == 2 && n100 != 12) ? 'two' + * : (n10 == 3 && n100 != 13) ? 'few' + * : 'other'; + * return (n == 1 && v0) ? 'one' : 'other'; + * } + * }; + * var fmt = {}; + * + * return { + * a: function(d) { return "A " + d.TYPE + " example."; }, + * b: function(d) { return "This has " + plural(d.COUNT, 0, pluralFuncs.en, { one: function() { return "one member";}, other: function() { return number(d.COUNT)+" members";} }) + "."; } + * } + * } + * + * @example + * > mf.runtime.pluralFuncs.fi = MessageFormat.plurals.fi; + * > var multiSet = { en: { a: 'A {TYPE} example.', + * ... b: 'This is the {COUNT, selectordinal, one{#st} two{#nd} few{#rd} other{#th}} example.' }, + * ... fi: { a: '{TYPE} esimerkki.', + * ... b: 'Tämä on {COUNT, selectordinal, other{#.}} esimerkki.' } }, + * ... multiSetLocales = { en: 'en', fi: 'fi' }, + * ... mfuncSet = mf.compile(multiSet, { locale: multiSetLocales, global: 'i18n' }); + * > mfuncSet(this); + * > i18n.en.b({COUNT:3}) + * 'This is the 3rd example.' + * > i18n.fi.b({COUNT:3}) + * 'Tämä on 3. esimerkki.' */ +MessageFormat.prototype.compile = function ( messages, opt ) { + var r = {}, lc0 = this.lc, + compileMsg = function(self, msg) { + try { + var ast = MessageFormat._parse(msg); + return self._precompile(ast); + } catch (e) { + throw new Error((ast ? 'Precompiler' : 'Parser') + ' error: ' + e.toString()); + } + }, + stringify = function(r, level) { + if (!level) level = 0; + if (typeof r != 'object') return r; + var o = [], indent = ''; + for (var i = 0; i < level; ++i) indent += ' '; + for (var k in r) o.push('\n' + indent + ' ' + propname(k) + ': ' + stringify(r[k], level + 1)); + return '{' + o.join(',') + '\n' + indent + '}'; + }; + + if (typeof messages == 'string') { + var f = new Function( + 'number, plural, select, pluralFuncs, fmt', + 'return ' + compileMsg(this, messages)); + return f(this.runtime.number, this.runtime.plural, this.runtime.select, + this.runtime.pluralFuncs, this.runtime.fmt); + } + + opt = opt || {}; + + for (var ns in messages) { + if (opt.locale) this.lc = opt.locale[ns] && [].concat(opt.locale[ns]) || lc0; + if (typeof messages[ns] == 'string') { + try { r[ns] = compileMsg(this, messages[ns]); } + catch (e) { e.message = e.message.replace(':', ' with `' + ns + '`:'); throw e; } + } else { + r[ns] = {}; + for (var key in messages[ns]) { + try { r[ns][key] = compileMsg(this, messages[ns][key]); } + catch (e) { e.message = e.message.replace(':', ' with `' + key + '` in `' + ns + '`:'); throw e; } + } + } + } + + this.lc = lc0; + var s = this.runtime.toString() + '\n'; + switch (opt.global || '') { + case 'exports': + var o = []; + for (var k in r) o.push(propname(k, 'exports') + ' = ' + stringify(r[k])); + return new Function(s + o.join(';\n')); + case 'module.exports': + return new Function(s + 'module.exports = ' + stringify(r)); + case '': + return new Function(s + 'return ' + stringify(r)); + default: + return new Function('G', s + propname(opt.global, 'G') + ' = ' + stringify(r)); + } +}; + + +return MessageFormat; +}()); +/* jshint ignore:end */ + + +var createErrorPluralModulePresence = function() { + return createError( "E_MISSING_PLURAL_MODULE", "Plural module not loaded." ); +}; + + + + +var validateMessageBundle = function( cldr ) { + validate( + "E_MISSING_MESSAGE_BUNDLE", + "Missing message bundle for locale `{locale}`.", + cldr.attributes.bundle && cldr.get( "globalize-messages/{bundle}" ) !== undefined, + { + locale: cldr.locale + } + ); +}; + + + + +var validateMessagePresence = function( path, value ) { + path = path.join( "/" ); + validate( "E_MISSING_MESSAGE", "Missing required message content `{path}`.", + value !== undefined, { path: path } ); +}; + + + + +var validateMessageType = function( path, value ) { + path = path.join( "/" ); + validate( + "E_INVALID_MESSAGE", + "Invalid message content `{path}`. {expected} expected.", + typeof value === "string", + { + expected: "a string", + path: path + } + ); +}; + + + + +var validateParameterTypeMessageVariables = function( value, name ) { + validateParameterType( + value, + name, + value === undefined || isPlainObject( value ) || Array.isArray( value ), + "Array or Plain Object" + ); +}; + + + + +var messageFormatterFn = function( formatter ) { + return function messageFormatter( variables ) { + if ( typeof variables === "number" || typeof variables === "string" ) { + variables = [].slice.call( arguments, 0 ); + } + validateParameterTypeMessageVariables( variables, "variables" ); + return formatter( variables ); + }; +}; + + + + +var messageFormatterRuntimeBind = function( cldr, messageformatter ) { + var locale = cldr.locale, + origToString = messageformatter.toString; + + messageformatter.toString = function() { + var argNames, argValues, output, + args = {}; + + // Properly adjust SlexAxton/messageformat.js compiled variables with Globalize variables: + output = origToString.call( messageformatter ); + + if ( /number\(/.test( output ) ) { + args.number = "messageFormat.number"; + } + + if ( /plural\(/.test( output ) ) { + args.plural = "messageFormat.plural"; + } + + if ( /select\(/.test( output ) ) { + args.select = "messageFormat.select"; + } + + output.replace( /pluralFuncs(\[([^\]]+)\]|\.([a-zA-Z]+))/, function( match ) { + args.pluralFuncs = "{" + + "\"" + locale + "\": Globalize(\"" + locale + "\").pluralGenerator()" + + "}"; + return match; + }); + + argNames = Object.keys( args ).join( ", " ); + argValues = Object.keys( args ).map(function( key ) { + return args[ key ]; + }).join( ", " ); + + return "(function( " + argNames + " ) {\n" + + " return " + output + "\n" + + "})(" + argValues + ")"; + }; + + return messageformatter; +}; + + + + +var slice = [].slice; + +/** + * .loadMessages( json ) + * + * @json [JSON] + * + * Load translation data. + */ +Globalize.loadMessages = function( json ) { + var locale, + customData = { + "globalize-messages": json, + "main": {} + }; + + validateParameterPresence( json, "json" ); + validateParameterTypePlainObject( json, "json" ); + + // Set available bundles by populating customData main dataset. + for ( locale in json ) { + if ( json.hasOwnProperty( locale ) ) { + customData.main[ locale ] = {}; + } + } + + Cldr.load( customData ); +}; + +/** + * .messageFormatter( path ) + * + * @path [String or Array] + * + * Format a message given its path. + */ +Globalize.messageFormatter = +Globalize.prototype.messageFormatter = function( path ) { + var cldr, formatter, message, pluralGenerator, returnFn, + args = slice.call( arguments, 0 ); + + validateParameterPresence( path, "path" ); + validateParameterType( path, "path", typeof path === "string" || Array.isArray( path ), + "a String nor an Array" ); + + path = alwaysArray( path ); + cldr = this.cldr; + + validateDefaultLocale( cldr ); + validateMessageBundle( cldr ); + + message = cldr.get( [ "globalize-messages/{bundle}" ].concat( path ) ); + validateMessagePresence( path, message ); + + // If message is an Array, concatenate it. + if ( Array.isArray( message ) ) { + message = message.join( " " ); + } + validateMessageType( path, message ); + + // Is plural module present? Yes, use its generator. Nope, use an error generator. + pluralGenerator = this.plural !== undefined ? + this.pluralGenerator() : + createErrorPluralModulePresence; + + formatter = new MessageFormat( cldr.locale, pluralGenerator ).compile( message ); + + returnFn = messageFormatterFn( formatter ); + + runtimeBind( args, cldr, returnFn, + [ messageFormatterRuntimeBind( cldr, formatter ), pluralGenerator ] ); + + return returnFn; +}; + +/** + * .formatMessage( path [, variables] ) + * + * @path [String or Array] + * + * @variables [Number, String, Array or Object] + * + * Format a message given its path. + */ +Globalize.formatMessage = +Globalize.prototype.formatMessage = function( path /* , variables */ ) { + return this.messageFormatter( path ).apply( {}, slice.call( arguments, 1 ) ); +}; + +return Globalize; + + + + +})); diff --git a/StockManMVC/bower_components/globalize/dist/globalize/number.js b/StockManMVC/bower_components/globalize/dist/globalize/number.js new file mode 100644 index 0000000..c2a859c --- /dev/null +++ b/StockManMVC/bower_components/globalize/dist/globalize/number.js @@ -0,0 +1,1311 @@ +/** + * Globalize v1.1.1 + * + * http://github.com/jquery/globalize + * + * Copyright jQuery Foundation and other contributors + * Released under the MIT license + * http://jquery.org/license + * + * Date: 2016-02-04T12:01Z + */ +/*! + * Globalize v1.1.1 2016-02-04T12:01Z Released under the MIT license + * http://git.io/TrdQbw + */ +(function( root, factory ) { + + // UMD returnExports + if ( typeof define === "function" && define.amd ) { + + // AMD + define([ + "cldr", + "../globalize", + "cldr/event", + "cldr/supplemental" + ], factory ); + } else if ( typeof exports === "object" ) { + + // Node, CommonJS + module.exports = factory( require( "cldrjs" ), require( "globalize" ) ); + } else { + + // Global + factory( root.Cldr, root.Globalize ); + } +}(this, function( Cldr, Globalize ) { + +var createError = Globalize._createError, + objectExtend = Globalize._objectExtend, + regexpEscape = Globalize._regexpEscape, + runtimeBind = Globalize._runtimeBind, + stringPad = Globalize._stringPad, + validateCldr = Globalize._validateCldr, + validateDefaultLocale = Globalize._validateDefaultLocale, + validateParameterPresence = Globalize._validateParameterPresence, + validateParameterRange = Globalize._validateParameterRange, + validateParameterType = Globalize._validateParameterType, + validateParameterTypePlainObject = Globalize._validateParameterTypePlainObject; + + +var createErrorUnsupportedFeature = function( feature ) { + return createError( "E_UNSUPPORTED", "Unsupported {feature}.", { + feature: feature + }); +}; + + + + +var validateParameterTypeNumber = function( value, name ) { + validateParameterType( + value, + name, + value === undefined || typeof value === "number", + "Number" + ); +}; + + + + +var validateParameterTypeString = function( value, name ) { + validateParameterType( + value, + name, + value === undefined || typeof value === "string", + "a string" + ); +}; + + + + +/** + * goupingSeparator( number, primaryGroupingSize, secondaryGroupingSize ) + * + * @number [Number]. + * + * @primaryGroupingSize [Number] + * + * @secondaryGroupingSize [Number] + * + * Return the formatted number with group separator. + */ +var numberFormatGroupingSeparator = function( number, primaryGroupingSize, secondaryGroupingSize ) { + var index, + currentGroupingSize = primaryGroupingSize, + ret = "", + sep = ",", + switchToSecondary = secondaryGroupingSize ? true : false; + + number = String( number ).split( "." ); + index = number[ 0 ].length; + + while ( index > currentGroupingSize ) { + ret = number[ 0 ].slice( index - currentGroupingSize, index ) + + ( ret.length ? sep : "" ) + ret; + index -= currentGroupingSize; + if ( switchToSecondary ) { + currentGroupingSize = secondaryGroupingSize; + switchToSecondary = false; + } + } + + number[ 0 ] = number[ 0 ].slice( 0, index ) + ( ret.length ? sep : "" ) + ret; + return number.join( "." ); +}; + + + + +/** + * integerFractionDigits( number, minimumIntegerDigits, minimumFractionDigits, + * maximumFractionDigits, round, roundIncrement ) + * + * @number [Number] + * + * @minimumIntegerDigits [Number] + * + * @minimumFractionDigits [Number] + * + * @maximumFractionDigits [Number] + * + * @round [Function] + * + * @roundIncrement [Function] + * + * Return the formatted integer and fraction digits. + */ +var numberFormatIntegerFractionDigits = function( number, minimumIntegerDigits, minimumFractionDigits, maximumFractionDigits, round, + roundIncrement ) { + + // Fraction + if ( maximumFractionDigits ) { + + // Rounding + if ( roundIncrement ) { + number = round( number, roundIncrement ); + + // Maximum fraction digits + } else { + number = round( number, { exponent: -maximumFractionDigits } ); + } + + // Minimum fraction digits + if ( minimumFractionDigits ) { + number = String( number ).split( "." ); + number[ 1 ] = stringPad( number[ 1 ] || "", minimumFractionDigits, true ); + number = number.join( "." ); + } + } else { + number = round( number ); + } + + number = String( number ); + + // Minimum integer digits + if ( minimumIntegerDigits ) { + number = number.split( "." ); + number[ 0 ] = stringPad( number[ 0 ], minimumIntegerDigits ); + number = number.join( "." ); + } + + return number; +}; + + + + +/** + * toPrecision( number, precision, round ) + * + * @number (Number) + * + * @precision (Number) significant figures precision (not decimal precision). + * + * @round (Function) + * + * Return number.toPrecision( precision ) using the given round function. + */ +var numberToPrecision = function( number, precision, round ) { + var roundOrder; + + // Get number at two extra significant figure precision. + number = number.toPrecision( precision + 2 ); + + // Then, round it to the required significant figure precision. + roundOrder = Math.ceil( Math.log( Math.abs( number ) ) / Math.log( 10 ) ); + roundOrder -= precision; + + return round( number, { exponent: roundOrder } ); +}; + + + + +/** + * toPrecision( number, minimumSignificantDigits, maximumSignificantDigits, round ) + * + * @number [Number] + * + * @minimumSignificantDigits [Number] + * + * @maximumSignificantDigits [Number] + * + * @round [Function] + * + * Return the formatted significant digits number. + */ +var numberFormatSignificantDigits = function( number, minimumSignificantDigits, maximumSignificantDigits, round ) { + var atMinimum, atMaximum; + + // Sanity check. + if ( minimumSignificantDigits > maximumSignificantDigits ) { + maximumSignificantDigits = minimumSignificantDigits; + } + + atMinimum = numberToPrecision( number, minimumSignificantDigits, round ); + atMaximum = numberToPrecision( number, maximumSignificantDigits, round ); + + // Use atMaximum only if it has more significant digits than atMinimum. + number = +atMinimum === +atMaximum ? atMinimum : atMaximum; + + // Expand integer numbers, eg. 123e5 to 12300. + number = ( +number ).toString( 10 ); + + if ( ( /e/ ).test( number ) ) { + throw createErrorUnsupportedFeature({ + feature: "integers out of (1e21, 1e-7)" + }); + } + + // Add trailing zeros if necessary. + if ( minimumSignificantDigits - number.replace( /^0+|\./g, "" ).length > 0 ) { + number = number.split( "." ); + number[ 1 ] = stringPad( number[ 1 ] || "", minimumSignificantDigits - number[ 0 ].replace( /^0+/, "" ).length, true ); + number = number.join( "." ); + } + + return number; +}; + + + + +/** + * format( number, properties ) + * + * @number [Number]. + * + * @properties [Object] Output of number/format-properties. + * + * Return the formatted number. + * ref: http://www.unicode.org/reports/tr35/tr35-numbers.html + */ +var numberFormat = function( number, properties ) { + var infinitySymbol, maximumFractionDigits, maximumSignificantDigits, minimumFractionDigits, + minimumIntegerDigits, minimumSignificantDigits, nanSymbol, nuDigitsMap, padding, prefix, + primaryGroupingSize, pattern, ret, round, roundIncrement, secondaryGroupingSize, suffix, + symbolMap; + + padding = properties[ 1 ]; + minimumIntegerDigits = properties[ 2 ]; + minimumFractionDigits = properties[ 3 ]; + maximumFractionDigits = properties[ 4 ]; + minimumSignificantDigits = properties[ 5 ]; + maximumSignificantDigits = properties[ 6 ]; + roundIncrement = properties[ 7 ]; + primaryGroupingSize = properties[ 8 ]; + secondaryGroupingSize = properties[ 9 ]; + round = properties[ 15 ]; + infinitySymbol = properties[ 16 ]; + nanSymbol = properties[ 17 ]; + symbolMap = properties[ 18 ]; + nuDigitsMap = properties[ 19 ]; + + // NaN + if ( isNaN( number ) ) { + return nanSymbol; + } + + if ( number < 0 ) { + pattern = properties[ 12 ]; + prefix = properties[ 13 ]; + suffix = properties[ 14 ]; + } else { + pattern = properties[ 11 ]; + prefix = properties[ 0 ]; + suffix = properties[ 10 ]; + } + + // Infinity + if ( !isFinite( number ) ) { + return prefix + infinitySymbol + suffix; + } + + ret = prefix; + + // Percent + if ( pattern.indexOf( "%" ) !== -1 ) { + number *= 100; + + // Per mille + } else if ( pattern.indexOf( "\u2030" ) !== -1 ) { + number *= 1000; + } + + // Significant digit format + if ( !isNaN( minimumSignificantDigits * maximumSignificantDigits ) ) { + number = numberFormatSignificantDigits( number, minimumSignificantDigits, + maximumSignificantDigits, round ); + + // Integer and fractional format + } else { + number = numberFormatIntegerFractionDigits( number, minimumIntegerDigits, + minimumFractionDigits, maximumFractionDigits, round, roundIncrement ); + } + + // Remove the possible number minus sign + number = number.replace( /^-/, "" ); + + // Grouping separators + if ( primaryGroupingSize ) { + number = numberFormatGroupingSeparator( number, primaryGroupingSize, + secondaryGroupingSize ); + } + + ret += number; + + // Scientific notation + // TODO implement here + + // Padding/'([^']|'')+'|''|[.,\-+E%\u2030]/g + // TODO implement here + + ret += suffix; + + return ret.replace( /('([^']|'')+'|'')|./g, function( character, literal ) { + + // Literals + if ( literal ) { + literal = literal.replace( /''/, "'" ); + if ( literal.length > 2 ) { + literal = literal.slice( 1, -1 ); + } + return literal; + } + + // Symbols + character = character.replace( /[.,\-+E%\u2030]/, function( symbol ) { + return symbolMap[ symbol ]; + }); + + // Numbering system + if ( nuDigitsMap ) { + character = character.replace( /[0-9]/, function( digit ) { + return nuDigitsMap[ +digit ]; + }); + } + + return character; + }); +}; + + + + +var numberFormatterFn = function( properties ) { + return function numberFormatter( value ) { + validateParameterPresence( value, "value" ); + validateParameterTypeNumber( value, "value" ); + + return numberFormat( value, properties ); + }; +}; + + + + +/** + * NumberingSystem( cldr ) + * + * - http://www.unicode.org/reports/tr35/tr35-numbers.html#otherNumberingSystems + * - http://cldr.unicode.org/index/bcp47-extension + * - http://www.unicode.org/reports/tr35/#u_Extension + */ +var numberNumberingSystem = function( cldr ) { + var nu = cldr.attributes[ "u-nu" ]; + + if ( nu ) { + if ( nu === "traditio" ) { + nu = "traditional"; + } + if ( [ "native", "traditional", "finance" ].indexOf( nu ) !== -1 ) { + + // Unicode locale extension `u-nu` is set using either (native, traditional or + // finance). So, lookup the respective locale's numberingSystem and return it. + return cldr.main([ "numbers/otherNumberingSystems", nu ]); + } + + // Unicode locale extension `u-nu` is set with an explicit numberingSystem. Return it. + return nu; + } + + // Return the default numberingSystem. + return cldr.main( "numbers/defaultNumberingSystem" ); +}; + + + + +/** + * nuMap( cldr ) + * + * @cldr [Cldr instance]. + * + * Return digits map if numbering system is different than `latn`. + */ +var numberNumberingSystemDigitsMap = function( cldr ) { + var aux, + nu = numberNumberingSystem( cldr ); + + if ( nu === "latn" ) { + return; + } + + aux = cldr.supplemental([ "numberingSystems", nu ]); + + if ( aux._type !== "numeric" ) { + throw createErrorUnsupportedFeature( "`" + aux._type + "` numbering system" ); + } + + return aux._digits; +}; + + + + +/** + * EBNF representation: + * + * number_pattern_re = prefix? + * padding? + * (integer_fraction_pattern | significant_pattern) + * scientific_notation? + * suffix? + * + * prefix = non_number_stuff + * + * padding = "*" regexp(.) + * + * integer_fraction_pattern = integer_pattern + * fraction_pattern? + * + * integer_pattern = regexp([#,]*[0,]*0+) + * + * fraction_pattern = "." regexp(0*[0-9]*#*) + * + * significant_pattern = regexp([#,]*@+#*) + * + * scientific_notation = regexp(E\+?0+) + * + * suffix = non_number_stuff + * + * non_number_stuff = regexp(('[^']+'|''|[^*#@0,.E])*) + * + * + * Regexp groups: + * + * 0: number_pattern_re + * 1: prefix + * 2: - + * 3: padding + * 4: (integer_fraction_pattern | significant_pattern) + * 5: integer_fraction_pattern + * 6: integer_pattern + * 7: fraction_pattern + * 8: significant_pattern + * 9: scientific_notation + * 10: suffix + * 11: - + */ +var numberPatternRe = ( /^(('[^']+'|''|[^*#@0,.E])*)(\*.)?((([#,]*[0,]*0+)(\.0*[0-9]*#*)?)|([#,]*@+#*))(E\+?0+)?(('[^']+'|''|[^*#@0,.E])*)$/ ); + + + + +/** + * format( number, pattern ) + * + * @number [Number]. + * + * @pattern [String] raw pattern for numbers. + * + * Return the formatted number. + * ref: http://www.unicode.org/reports/tr35/tr35-numbers.html + */ +var numberPatternProperties = function( pattern ) { + var aux1, aux2, fractionPattern, integerFractionOrSignificantPattern, integerPattern, + maximumFractionDigits, maximumSignificantDigits, minimumFractionDigits, + minimumIntegerDigits, minimumSignificantDigits, padding, prefix, primaryGroupingSize, + roundIncrement, scientificNotation, secondaryGroupingSize, significantPattern, suffix; + + pattern = pattern.match( numberPatternRe ); + if ( !pattern ) { + throw new Error( "Invalid pattern: " + pattern ); + } + + prefix = pattern[ 1 ]; + padding = pattern[ 3 ]; + integerFractionOrSignificantPattern = pattern[ 4 ]; + significantPattern = pattern[ 8 ]; + scientificNotation = pattern[ 9 ]; + suffix = pattern[ 10 ]; + + // Significant digit format + if ( significantPattern ) { + significantPattern.replace( /(@+)(#*)/, function( match, minimumSignificantDigitsMatch, maximumSignificantDigitsMatch ) { + minimumSignificantDigits = minimumSignificantDigitsMatch.length; + maximumSignificantDigits = minimumSignificantDigits + + maximumSignificantDigitsMatch.length; + }); + + // Integer and fractional format + } else { + fractionPattern = pattern[ 7 ]; + integerPattern = pattern[ 6 ]; + + if ( fractionPattern ) { + + // Minimum fraction digits, and rounding. + fractionPattern.replace( /[0-9]+/, function( match ) { + minimumFractionDigits = match; + }); + if ( minimumFractionDigits ) { + roundIncrement = +( "0." + minimumFractionDigits ); + minimumFractionDigits = minimumFractionDigits.length; + } else { + minimumFractionDigits = 0; + } + + // Maximum fraction digits + // 1: ignore decimal character + maximumFractionDigits = fractionPattern.length - 1 /* 1 */; + } + + // Minimum integer digits + integerPattern.replace( /0+$/, function( match ) { + minimumIntegerDigits = match.length; + }); + } + + // Scientific notation + if ( scientificNotation ) { + throw createErrorUnsupportedFeature({ + feature: "scientific notation (not implemented)" + }); + } + + // Padding + if ( padding ) { + throw createErrorUnsupportedFeature({ + feature: "padding (not implemented)" + }); + } + + // Grouping + if ( ( aux1 = integerFractionOrSignificantPattern.lastIndexOf( "," ) ) !== -1 ) { + + // Primary grouping size is the interval between the last group separator and the end of + // the integer (or the end of the significant pattern). + aux2 = integerFractionOrSignificantPattern.split( "." )[ 0 ]; + primaryGroupingSize = aux2.length - aux1 - 1; + + // Secondary grouping size is the interval between the last two group separators. + if ( ( aux2 = integerFractionOrSignificantPattern.lastIndexOf( ",", aux1 - 1 ) ) !== -1 ) { + secondaryGroupingSize = aux1 - 1 - aux2; + } + } + + // Return: + // 0: @prefix String + // 1: @padding Array [ , ] TODO + // 2: @minimumIntegerDigits non-negative integer Number value indicating the minimum integer + // digits to be used. Numbers will be padded with leading zeroes if necessary. + // 3: @minimumFractionDigits and + // 4: @maximumFractionDigits are non-negative integer Number values indicating the minimum and + // maximum fraction digits to be used. Numbers will be rounded or padded with trailing + // zeroes if necessary. + // 5: @minimumSignificantDigits and + // 6: @maximumSignificantDigits are positive integer Number values indicating the minimum and + // maximum fraction digits to be shown. Either none or both of these properties are + // present; if they are, they override minimum and maximum integer and fraction digits + // – the formatter uses however many integer and fraction digits are required to display + // the specified number of significant digits. + // 7: @roundIncrement Decimal round increment or null + // 8: @primaryGroupingSize + // 9: @secondaryGroupingSize + // 10: @suffix String + return [ + prefix, + padding, + minimumIntegerDigits, + minimumFractionDigits, + maximumFractionDigits, + minimumSignificantDigits, + maximumSignificantDigits, + roundIncrement, + primaryGroupingSize, + secondaryGroupingSize, + suffix + ]; +}; + + + + +/** + * Symbol( name, cldr ) + * + * @name [String] Symbol name. + * + * @cldr [Cldr instance]. + * + * Return the localized symbol given its name. + */ +var numberSymbol = function( name, cldr ) { + return cldr.main([ + "numbers/symbols-numberSystem-" + numberNumberingSystem( cldr ), + name + ]); +}; + + + + +var numberSymbolName = { + ".": "decimal", + ",": "group", + "%": "percentSign", + "+": "plusSign", + "-": "minusSign", + "E": "exponential", + "\u2030": "perMille" +}; + + + + +/** + * symbolMap( cldr ) + * + * @cldr [Cldr instance]. + * + * Return the (localized symbol, pattern symbol) key value pair, eg. { + * ".": "٫", + * ",": "٬", + * "%": "٪", + * ... + * }; + */ +var numberSymbolMap = function( cldr ) { + var symbol, + symbolMap = {}; + + for ( symbol in numberSymbolName ) { + symbolMap[ symbol ] = numberSymbol( numberSymbolName[ symbol ], cldr ); + } + + return symbolMap; +}; + + + + +var numberTruncate = function( value ) { + if ( isNaN( value ) ) { + return NaN; + } + return Math[ value < 0 ? "ceil" : "floor" ]( value ); +}; + + + + +/** + * round( method ) + * + * @method [String] with either "round", "ceil", "floor", or "truncate". + * + * Return function( value, incrementOrExp ): + * + * @value [Number] eg. 123.45. + * + * @incrementOrExp [Number] optional, eg. 0.1; or + * [Object] Either { increment: } or { exponent: } + * + * Return the rounded number, eg: + * - round( "round" )( 123.45 ): 123; + * - round( "ceil" )( 123.45 ): 124; + * - round( "floor" )( 123.45 ): 123; + * - round( "truncate" )( 123.45 ): 123; + * - round( "round" )( 123.45, 0.1 ): 123.5; + * - round( "round" )( 123.45, 10 ): 120; + * + * Based on https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/round + * Ref: #376 + */ +var numberRound = function( method ) { + method = method || "round"; + method = method === "truncate" ? numberTruncate : Math[ method ]; + + return function( value, incrementOrExp ) { + var exp, increment; + + value = +value; + + // If the value is not a number, return NaN. + if ( isNaN( value ) ) { + return NaN; + } + + // Exponent given. + if ( typeof incrementOrExp === "object" && incrementOrExp.exponent ) { + exp = +incrementOrExp.exponent; + increment = 1; + + if ( exp === 0 ) { + return method( value ); + } + + // If the exp is not an integer, return NaN. + if ( !( typeof exp === "number" && exp % 1 === 0 ) ) { + return NaN; + } + + // Increment given. + } else { + increment = +incrementOrExp || 1; + + if ( increment === 1 ) { + return method( value ); + } + + // If the increment is not a number, return NaN. + if ( isNaN( increment ) ) { + return NaN; + } + + increment = increment.toExponential().split( "e" ); + exp = +increment[ 1 ]; + increment = +increment[ 0 ]; + } + + // Shift & Round + value = value.toString().split( "e" ); + value[ 0 ] = +value[ 0 ] / increment; + value[ 1 ] = value[ 1 ] ? ( +value[ 1 ] - exp ) : -exp; + value = method( +( value[ 0 ] + "e" + value[ 1 ] ) ); + + // Shift back + value = value.toString().split( "e" ); + value[ 0 ] = +value[ 0 ] * increment; + value[ 1 ] = value[ 1 ] ? ( +value[ 1 ] + exp ) : exp; + return +( value[ 0 ] + "e" + value[ 1 ] ); + }; +}; + + + + +/** + * formatProperties( pattern, cldr [, options] ) + * + * @pattern [String] raw pattern for numbers. + * + * @cldr [Cldr instance]. + * + * @options [Object]: + * - minimumIntegerDigits [Number] + * - minimumFractionDigits, maximumFractionDigits [Number] + * - minimumSignificantDigits, maximumSignificantDigits [Number] + * - round [String] "ceil", "floor", "round" (default), or "truncate". + * - useGrouping [Boolean] default true. + * + * Return the processed properties that will be used in number/format. + * ref: http://www.unicode.org/reports/tr35/tr35-numbers.html + */ +var numberFormatProperties = function( pattern, cldr, options ) { + var negativePattern, negativePrefix, negativeProperties, negativeSuffix, positivePattern, + roundFn, properties; + + function getOptions( attribute, propertyIndex ) { + if ( attribute in options ) { + properties[ propertyIndex ] = options[ attribute ]; + } + } + + options = options || {}; + pattern = pattern.split( ";" ); + + positivePattern = pattern[ 0 ]; + + negativePattern = pattern[ 1 ] || "-" + positivePattern; + negativeProperties = numberPatternProperties( negativePattern ); + negativePrefix = negativeProperties[ 0 ]; + negativeSuffix = negativeProperties[ 10 ]; + + // Have runtime code to refer to numberRound() instead of including it explicitly. + roundFn = numberRound( options.round ); + roundFn.generatorString = function() { + return "numberRound(" + ( options.round ? "\"" + options.round + "\"" : "" ) + ")"; + }; + + properties = numberPatternProperties( positivePattern ).concat([ + positivePattern, + negativePrefix + positivePattern + negativeSuffix, + negativePrefix, + negativeSuffix, + roundFn, + numberSymbol( "infinity", cldr ), + numberSymbol( "nan", cldr ), + numberSymbolMap( cldr ), + numberNumberingSystemDigitsMap( cldr ) + ]); + + getOptions( "minimumIntegerDigits", 2 ); + getOptions( "minimumFractionDigits", 3 ); + getOptions( "maximumFractionDigits", 4 ); + getOptions( "minimumSignificantDigits", 5 ); + getOptions( "maximumSignificantDigits", 6 ); + + // Grouping separators + if ( options.useGrouping === false ) { + properties[ 8 ] = null; + } + + // Normalize number of digits if only one of either minimumFractionDigits or + // maximumFractionDigits is passed in as an option + if ( "minimumFractionDigits" in options && !( "maximumFractionDigits" in options ) ) { + + // maximumFractionDigits = Math.max( minimumFractionDigits, maximumFractionDigits ); + properties[ 4 ] = Math.max( properties[ 3 ], properties[ 4 ] ); + } else if ( !( "minimumFractionDigits" in options ) && + "maximumFractionDigits" in options ) { + + // minimumFractionDigits = Math.min( minimumFractionDigits, maximumFractionDigits ); + properties[ 3 ] = Math.min( properties[ 3 ], properties[ 4 ] ); + } + + // Return: + // 0-10: see number/pattern-properties. + // 11: @positivePattern [String] Positive pattern. + // 12: @negativePattern [String] Negative pattern. + // 13: @negativePrefix [String] Negative prefix. + // 14: @negativeSuffix [String] Negative suffix. + // 15: @round [Function] Round function. + // 16: @infinitySymbol [String] Infinity symbol. + // 17: @nanSymbol [String] NaN symbol. + // 18: @symbolMap [Object] A bunch of other symbols. + // 19: @nuDigitsMap [Array] Digits map if numbering system is different than `latn`. + return properties; +}; + + + + +/** + * EBNF representation: + * + * number_pattern_re = prefix_including_padding? + * number + * scientific_notation? + * suffix? + * + * number = integer_including_group_separator fraction_including_decimal_separator + * + * integer_including_group_separator = + * regexp([0-9,]*[0-9]+) + * + * fraction_including_decimal_separator = + * regexp((\.[0-9]+)?) + + * prefix_including_padding = non_number_stuff + * + * scientific_notation = regexp(E[+-]?[0-9]+) + * + * suffix = non_number_stuff + * + * non_number_stuff = regexp([^0-9]*) + * + * + * Regexp groups: + * + * 0: number_pattern_re + * 1: prefix + * 2: integer_including_group_separator fraction_including_decimal_separator + * 3: integer_including_group_separator + * 4: fraction_including_decimal_separator + * 5: scientific_notation + * 6: suffix + */ +var numberNumberRe = ( /^([^0-9]*)(([0-9,]*[0-9]+)(\.[0-9]+)?)(E[+-]?[0-9]+)?([^0-9]*)$/ ); + + + + +/** + * parse( value, properties ) + * + * @value [String]. + * + * @properties [Object] Parser properties is a reduced pre-processed cldr + * data set returned by numberParserProperties(). + * + * Return the parsed Number (including Infinity) or NaN when value is invalid. + * ref: http://www.unicode.org/reports/tr35/tr35-numbers.html + */ +var numberParse = function( value, properties ) { + var aux, infinitySymbol, invertedNuDigitsMap, invertedSymbolMap, localizedDigitRe, + localizedSymbolsRe, negativePrefix, negativeSuffix, number, prefix, suffix; + + infinitySymbol = properties[ 0 ]; + invertedSymbolMap = properties[ 1 ]; + negativePrefix = properties[ 2 ]; + negativeSuffix = properties[ 3 ]; + invertedNuDigitsMap = properties[ 4 ]; + + // Infinite number. + if ( aux = value.match( infinitySymbol ) ) { + + number = Infinity; + prefix = value.slice( 0, aux.length ); + suffix = value.slice( aux.length + 1 ); + + // Finite number. + } else { + + // TODO: Create it during setup, i.e., make it a property. + localizedSymbolsRe = new RegExp( + Object.keys( invertedSymbolMap ).map(function( localizedSymbol ) { + return regexpEscape( localizedSymbol ); + }).join( "|" ), + "g" + ); + + // Reverse localized symbols. + value = value.replace( localizedSymbolsRe, function( localizedSymbol ) { + return invertedSymbolMap[ localizedSymbol ]; + }); + + // Reverse localized numbering system. + if ( invertedNuDigitsMap ) { + + // TODO: Create it during setup, i.e., make it a property. + localizedDigitRe = new RegExp( + Object.keys( invertedNuDigitsMap ).map(function( localizedDigit ) { + return regexpEscape( localizedDigit ); + }).join( "|" ), + "g" + ); + value = value.replace( localizedDigitRe, function( localizedDigit ) { + return invertedNuDigitsMap[ localizedDigit ]; + }); + } + + // Add padding zero to leading decimal. + if ( value.charAt( 0 ) === "." ) { + value = "0" + value; + } + + // Is it a valid number? + value = value.match( numberNumberRe ); + if ( !value ) { + + // Invalid number. + return NaN; + } + + prefix = value[ 1 ]; + suffix = value[ 6 ]; + + // Remove grouping separators. + number = value[ 2 ].replace( /,/g, "" ); + + // Scientific notation + if ( value[ 5 ] ) { + number += value[ 5 ]; + } + + number = +number; + + // Is it a valid number? + if ( isNaN( number ) ) { + + // Invalid number. + return NaN; + } + + // Percent + if ( value[ 0 ].indexOf( "%" ) !== -1 ) { + number /= 100; + suffix = suffix.replace( "%", "" ); + + // Per mille + } else if ( value[ 0 ].indexOf( "\u2030" ) !== -1 ) { + number /= 1000; + suffix = suffix.replace( "\u2030", "" ); + } + } + + // Negative number + // "If there is an explicit negative subpattern, it serves only to specify the negative prefix + // and suffix. If there is no explicit negative subpattern, the negative subpattern is the + // localized minus sign prefixed to the positive subpattern" UTS#35 + if ( prefix === negativePrefix && suffix === negativeSuffix ) { + number *= -1; + } + + return number; +}; + + + + +var numberParserFn = function( properties ) { + return function numberParser( value ) { + validateParameterPresence( value, "value" ); + validateParameterTypeString( value, "value" ); + + return numberParse( value, properties ); + }; + +}; + + + + +/** + * symbolMap( cldr ) + * + * @cldr [Cldr instance]. + * + * Return the (localized symbol, pattern symbol) key value pair, eg. { + * "٫": ".", + * "٬": ",", + * "٪": "%", + * ... + * }; + */ +var numberSymbolInvertedMap = function( cldr ) { + var symbol, + symbolMap = {}; + + for ( symbol in numberSymbolName ) { + symbolMap[ numberSymbol( numberSymbolName[ symbol ], cldr ) ] = symbol; + } + + return symbolMap; +}; + + + + +/** + * parseProperties( pattern, cldr ) + * + * @pattern [String] raw pattern for numbers. + * + * @cldr [Cldr instance]. + * + * Return parser properties, used to feed parser function. + */ +var numberParseProperties = function( pattern, cldr ) { + var invertedNuDigitsMap, invertedNuDigitsMapSanityCheck, negativePattern, negativeProperties, + nuDigitsMap = numberNumberingSystemDigitsMap( cldr ); + + pattern = pattern.split( ";" ); + negativePattern = pattern[ 1 ] || "-" + pattern[ 0 ]; + negativeProperties = numberPatternProperties( negativePattern ); + if ( nuDigitsMap ) { + invertedNuDigitsMap = nuDigitsMap.split( "" ).reduce(function( object, localizedDigit, i ) { + object[ localizedDigit ] = String( i ); + return object; + }, {} ); + invertedNuDigitsMapSanityCheck = "0123456789".split( "" ).reduce(function( object, digit ) { + object[ digit ] = "invalid"; + return object; + }, {} ); + invertedNuDigitsMap = objectExtend( + invertedNuDigitsMapSanityCheck, + invertedNuDigitsMap + ); + } + + // 0: @infinitySymbol [String] Infinity symbol. + // 1: @invertedSymbolMap [Object] Inverted symbol map augmented with sanity check. + // The sanity check prevents permissive parsing, i.e., it prevents symbols that doesn't + // belong to the localized set to pass through. This is obtained with the result of the + // inverted map object overloading symbol name map object (the remaining symbol name + // mappings will invalidate parsing, working as the sanity check). + // 2: @negativePrefix [String] Negative prefix. + // 3: @negativeSuffix [String] Negative suffix with percent or per mille stripped out. + // 4: @invertedNuDigitsMap [Object] Inverted digits map if numbering system is different than + // `latn` augmented with sanity check (similar to invertedSymbolMap). + return [ + numberSymbol( "infinity", cldr ), + objectExtend( {}, numberSymbolName, numberSymbolInvertedMap( cldr ) ), + negativeProperties[ 0 ], + negativeProperties[ 10 ].replace( "%", "" ).replace( "\u2030", "" ), + invertedNuDigitsMap + ]; +}; + + + + +/** + * Pattern( style ) + * + * @style [String] "decimal" (default) or "percent". + * + * @cldr [Cldr instance]. + */ +var numberPattern = function( style, cldr ) { + if ( style !== "decimal" && style !== "percent" ) { + throw new Error( "Invalid style" ); + } + + return cldr.main([ + "numbers", + style + "Formats-numberSystem-" + numberNumberingSystem( cldr ), + "standard" + ]); +}; + + + + +function validateDigits( properties ) { + var minimumIntegerDigits = properties[ 2 ], + minimumFractionDigits = properties[ 3 ], + maximumFractionDigits = properties[ 4 ], + minimumSignificantDigits = properties[ 5 ], + maximumSignificantDigits = properties[ 6 ]; + + // Validate significant digit format properties + if ( !isNaN( minimumSignificantDigits * maximumSignificantDigits ) ) { + validateParameterRange( minimumSignificantDigits, "minimumSignificantDigits", 1, 21 ); + validateParameterRange( maximumSignificantDigits, "maximumSignificantDigits", + minimumSignificantDigits, 21 ); + + } else if ( !isNaN( minimumSignificantDigits ) || !isNaN( maximumSignificantDigits ) ) { + throw new Error( "Neither or both the minimum and maximum significant digits must be " + + "present" ); + + // Validate integer and fractional format + } else { + validateParameterRange( minimumIntegerDigits, "minimumIntegerDigits", 1, 21 ); + validateParameterRange( minimumFractionDigits, "minimumFractionDigits", 0, 20 ); + validateParameterRange( maximumFractionDigits, "maximumFractionDigits", + minimumFractionDigits, 20 ); + } +} + +/** + * .numberFormatter( [options] ) + * + * @options [Object]: + * - style: [String] "decimal" (default) or "percent". + * - see also number/format options. + * + * Return a function that formats a number according to the given options and default/instance + * locale. + */ +Globalize.numberFormatter = +Globalize.prototype.numberFormatter = function( options ) { + var args, cldr, pattern, properties, returnFn; + + validateParameterTypePlainObject( options, "options" ); + + options = options || {}; + cldr = this.cldr; + + args = [ options ]; + + validateDefaultLocale( cldr ); + + cldr.on( "get", validateCldr ); + + if ( options.raw ) { + pattern = options.raw; + } else { + pattern = numberPattern( options.style || "decimal", cldr ); + } + + properties = numberFormatProperties( pattern, cldr, options ); + + cldr.off( "get", validateCldr ); + + validateDigits( properties ); + + returnFn = numberFormatterFn( properties ); + + runtimeBind( args, cldr, returnFn, [ properties ] ); + + return returnFn; +}; + +/** + * .numberParser( [options] ) + * + * @options [Object]: + * - style: [String] "decimal" (default) or "percent". + * + * Return the number parser according to the default/instance locale. + */ +Globalize.numberParser = +Globalize.prototype.numberParser = function( options ) { + var args, cldr, pattern, properties, returnFn; + + validateParameterTypePlainObject( options, "options" ); + + options = options || {}; + cldr = this.cldr; + + args = [ options ]; + + validateDefaultLocale( cldr ); + + cldr.on( "get", validateCldr ); + + if ( options.raw ) { + pattern = options.raw; + } else { + pattern = numberPattern( options.style || "decimal", cldr ); + } + + properties = numberParseProperties( pattern, cldr ); + + cldr.off( "get", validateCldr ); + + returnFn = numberParserFn( properties ); + + runtimeBind( args, cldr, returnFn, [ properties ] ); + + return returnFn; +}; + +/** + * .formatNumber( value [, options] ) + * + * @value [Number] number to be formatted. + * + * @options [Object]: see number/format-properties. + * + * Format a number according to the given options and default/instance locale. + */ +Globalize.formatNumber = +Globalize.prototype.formatNumber = function( value, options ) { + validateParameterPresence( value, "value" ); + validateParameterTypeNumber( value, "value" ); + + return this.numberFormatter( options )( value ); +}; + +/** + * .parseNumber( value [, options] ) + * + * @value [String] + * + * @options [Object]: See numberParser(). + * + * Return the parsed Number (including Infinity) or NaN when value is invalid. + */ +Globalize.parseNumber = +Globalize.prototype.parseNumber = function( value, options ) { + validateParameterPresence( value, "value" ); + validateParameterTypeString( value, "value" ); + + return this.numberParser( options )( value ); +}; + +/** + * Optimization to avoid duplicating some internal functions across modules. + */ +Globalize._createErrorUnsupportedFeature = createErrorUnsupportedFeature; +Globalize._numberNumberingSystem = numberNumberingSystem; +Globalize._numberPattern = numberPattern; +Globalize._numberSymbol = numberSymbol; +Globalize._stringPad = stringPad; +Globalize._validateParameterTypeNumber = validateParameterTypeNumber; +Globalize._validateParameterTypeString = validateParameterTypeString; + +return Globalize; + + + + +})); diff --git a/StockManMVC/bower_components/globalize/dist/globalize/plural.js b/StockManMVC/bower_components/globalize/dist/globalize/plural.js new file mode 100644 index 0000000..1fe38f2 --- /dev/null +++ b/StockManMVC/bower_components/globalize/dist/globalize/plural.js @@ -0,0 +1,373 @@ +/** + * Globalize v1.1.1 + * + * http://github.com/jquery/globalize + * + * Copyright jQuery Foundation and other contributors + * Released under the MIT license + * http://jquery.org/license + * + * Date: 2016-02-04T12:01Z + */ +/*! + * Globalize v1.1.1 2016-02-04T12:01Z Released under the MIT license + * http://git.io/TrdQbw + */ +(function( root, factory ) { + + // UMD returnExports + if ( typeof define === "function" && define.amd ) { + + // AMD + define([ + "cldr", + "../globalize", + "cldr/event", + "cldr/supplemental" + ], factory ); + } else if ( typeof exports === "object" ) { + + // Node, CommonJS + module.exports = factory( require( "cldrjs" ), require( "globalize" ) ); + } else { + + // Global + factory( root.Cldr, root.Globalize ); + } +}(this, function( Cldr, Globalize ) { + +var runtimeBind = Globalize._runtimeBind, + validateCldr = Globalize._validateCldr, + validateDefaultLocale = Globalize._validateDefaultLocale, + validateParameterPresence = Globalize._validateParameterPresence, + validateParameterType = Globalize._validateParameterType, + validateParameterTypePlainObject = Globalize._validateParameterTypePlainObject; +var MakePlural; +/* jshint ignore:start */ +MakePlural = (function() { +'use strict'; + +var _toArray = function (arr) { return Array.isArray(arr) ? arr : Array.from(arr); }; + +var _toConsumableArray = function (arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; return arr2; } else { return Array.from(arr); } }; + +var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }; + +var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); + + +/** + * make-plural.js -- https://github.com/eemeli/make-plural.js/ + * Copyright (c) 2014-2015 by Eemeli Aro + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * The software is provided "as is" and the author disclaims all warranties + * with regard to this software including all implied warranties of + * merchantability and fitness. In no event shall the author be liable for + * any special, direct, indirect, or consequential damages or any damages + * whatsoever resulting from loss of use, data or profits, whether in an + * action of contract, negligence or other tortious action, arising out of + * or in connection with the use or performance of this software. + */ + +var Parser = (function () { + function Parser() { + _classCallCheck(this, Parser); + } + + _createClass(Parser, [{ + key: 'parse', + value: function parse(cond) { + var _this = this; + + if (cond === 'i = 0 or n = 1') { + return 'n >= 0 && n <= 1'; + }if (cond === 'i = 0,1') { + return 'n >= 0 && n < 2'; + }if (cond === 'i = 1 and v = 0') { + this.v0 = 1; + return 'n == 1 && v0'; + } + return cond.replace(/([tv]) (!?)= 0/g, function (m, sym, noteq) { + var sn = sym + '0'; + _this[sn] = 1; + return noteq ? '!' + sn : sn; + }).replace(/\b[fintv]\b/g, function (m) { + _this[m] = 1; + return m; + }).replace(/([fin]) % (10+)/g, function (m, sym, num) { + var sn = sym + num; + _this[sn] = 1; + return sn; + }).replace(/n10+ = 0/g, 't0 && $&').replace(/(\w+ (!?)= )([0-9.]+,[0-9.,]+)/g, function (m, se, noteq, x) { + if (m === 'n = 0,1') return '(n == 0 || n == 1)'; + if (noteq) return se + x.split(',').join(' && ' + se); + return '(' + se + x.split(',').join(' || ' + se) + ')'; + }).replace(/(\w+) (!?)= ([0-9]+)\.\.([0-9]+)/g, function (m, sym, noteq, x0, x1) { + if (Number(x0) + 1 === Number(x1)) { + if (noteq) return '' + sym + ' != ' + x0 + ' && ' + sym + ' != ' + x1; + return '(' + sym + ' == ' + x0 + ' || ' + sym + ' == ' + x1 + ')'; + } + if (noteq) return '(' + sym + ' < ' + x0 + ' || ' + sym + ' > ' + x1 + ')'; + if (sym === 'n') { + _this.t0 = 1;return '(t0 && n >= ' + x0 + ' && n <= ' + x1 + ')'; + } + return '(' + sym + ' >= ' + x0 + ' && ' + sym + ' <= ' + x1 + ')'; + }).replace(/ and /g, ' && ').replace(/ or /g, ' || ').replace(/ = /g, ' == '); + } + }, { + key: 'vars', + value: (function (_vars) { + function vars() { + return _vars.apply(this, arguments); + } + + vars.toString = function () { + return _vars.toString(); + }; + + return vars; + })(function () { + var vars = []; + if (this.i) vars.push('i = s[0]'); + if (this.f || this.v) vars.push('f = s[1] || \'\''); + if (this.t) vars.push('t = (s[1] || \'\').replace(/0+$/, \'\')'); + if (this.v) vars.push('v = f.length'); + if (this.v0) vars.push('v0 = !s[1]'); + if (this.t0 || this.n10 || this.n100) vars.push('t0 = Number(s[0]) == n'); + for (var k in this) { + if (/^.10+$/.test(k)) { + var k0 = k[0] === 'n' ? 't0 && s[0]' : k[0]; + vars.push('' + k + ' = ' + k0 + '.slice(-' + k.substr(2).length + ')'); + } + }if (!vars.length) return ''; + return 'var ' + ['s = String(n).split(\'.\')'].concat(vars).join(', '); + }) + }]); + + return Parser; +})(); + + + +var MakePlural = (function () { + function MakePlural(lc) { + var _ref = arguments[1] === undefined ? MakePlural : arguments[1]; + + var cardinals = _ref.cardinals; + var ordinals = _ref.ordinals; + + _classCallCheck(this, MakePlural); + + if (!cardinals && !ordinals) throw new Error('At least one type of plural is required'); + this.lc = lc; + this.categories = { cardinal: [], ordinal: [] }; + this.parser = new Parser(); + + this.fn = this.buildFunction(cardinals, ordinals); + this.fn._obj = this; + this.fn.categories = this.categories; + + this.fn.toString = this.fnToString.bind(this); + return this.fn; + } + + _createClass(MakePlural, [{ + key: 'compile', + value: function compile(type, req) { + var cases = []; + var rules = MakePlural.rules[type][this.lc]; + if (!rules) { + if (req) throw new Error('Locale "' + this.lc + '" ' + type + ' rules not found'); + this.categories[type] = ['other']; + return '\'other\''; + } + for (var r in rules) { + var _rules$r$trim$split = rules[r].trim().split(/\s*@\w*/); + + var _rules$r$trim$split2 = _toArray(_rules$r$trim$split); + + var cond = _rules$r$trim$split2[0]; + var examples = _rules$r$trim$split2.slice(1); + var cat = r.replace('pluralRule-count-', ''); + if (cond) cases.push([this.parser.parse(cond), cat]); + + } + this.categories[type] = cases.map(function (c) { + return c[1]; + }).concat('other'); + if (cases.length === 1) { + return '(' + cases[0][0] + ') ? \'' + cases[0][1] + '\' : \'other\''; + } else { + return [].concat(_toConsumableArray(cases.map(function (c) { + return '(' + c[0] + ') ? \'' + c[1] + '\''; + })), ['\'other\'']).join('\n : '); + } + } + }, { + key: 'buildFunction', + value: function buildFunction(cardinals, ordinals) { + var _this3 = this; + + var compile = function compile(c) { + return c ? (c[1] ? 'return ' : 'if (ord) return ') + _this3.compile.apply(_this3, _toConsumableArray(c)) : ''; + }, + fold = { vars: function vars(str) { + return (' ' + str + ';').replace(/(.{1,78})(,|$) ?/g, '$1$2\n '); + }, + cond: function cond(str) { + return (' ' + str + ';').replace(/(.{1,78}) (\|\| |$) ?/gm, '$1\n $2'); + } }, + cond = [ordinals && ['ordinal', !cardinals], cardinals && ['cardinal', true]].map(compile).map(fold.cond), + body = [fold.vars(this.parser.vars())].concat(_toConsumableArray(cond)).join('\n').replace(/\s+$/gm, '').replace(/^[\s;]*[\r\n]+/gm, ''), + args = ordinals && cardinals ? 'n, ord' : 'n'; + return new Function(args, body); + } + }, { + key: 'fnToString', + value: function fnToString(name) { + return Function.prototype.toString.call(this.fn).replace(/^function( \w+)?/, name ? 'function ' + name : 'function').replace('\n/**/', ''); + } + }], [{ + key: 'load', + value: function load() { + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + args.forEach(function (cldr) { + var data = cldr && cldr.supplemental || null; + if (!data) throw new Error('Data does not appear to be CLDR data'); + MakePlural.rules = { + cardinal: data['plurals-type-cardinal'] || MakePlural.rules.cardinal, + ordinal: data['plurals-type-ordinal'] || MakePlural.rules.ordinal + }; + }); + return MakePlural; + } + }]); + + return MakePlural; +})(); + + + +MakePlural.cardinals = true; +MakePlural.ordinals = false; +MakePlural.rules = { cardinal: {}, ordinal: {} }; + + +return MakePlural; +}()); +/* jshint ignore:end */ + + +var validateParameterTypeNumber = function( value, name ) { + validateParameterType( + value, + name, + value === undefined || typeof value === "number", + "Number" + ); +}; + + + + +var validateParameterTypePluralType = function( value, name ) { + validateParameterType( + value, + name, + value === undefined || value === "cardinal" || value === "ordinal", + "String \"cardinal\" or \"ordinal\"" + ); +}; + + + + +var pluralGeneratorFn = function( plural ) { + return function pluralGenerator( value ) { + validateParameterPresence( value, "value" ); + validateParameterTypeNumber( value, "value" ); + + return plural( value ); + }; +}; + + + + +/** + * .plural( value ) + * + * @value [Number] + * + * Return the corresponding form (zero | one | two | few | many | other) of a + * value given locale. + */ +Globalize.plural = +Globalize.prototype.plural = function( value, options ) { + validateParameterPresence( value, "value" ); + validateParameterTypeNumber( value, "value" ); + return this.pluralGenerator( options )( value ); +}; + +/** + * .pluralGenerator( [options] ) + * + * Return a plural function (of the form below). + * + * fn( value ) + * + * @value [Number] + * + * Return the corresponding form (zero | one | two | few | many | other) of a value given the + * default/instance locale. + */ +Globalize.pluralGenerator = +Globalize.prototype.pluralGenerator = function( options ) { + var args, cldr, isOrdinal, plural, returnFn, type; + + validateParameterTypePlainObject( options, "options" ); + + options = options || {}; + cldr = this.cldr; + + args = [ options ]; + type = options.type || "cardinal"; + + validateParameterTypePluralType( options.type, "options.type" ); + + validateDefaultLocale( cldr ); + + isOrdinal = type === "ordinal"; + + cldr.on( "get", validateCldr ); + cldr.supplemental([ "plurals-type-" + type, "{language}" ]); + cldr.off( "get", validateCldr ); + + MakePlural.rules = {}; + MakePlural.rules[ type ] = cldr.supplemental( "plurals-type-" + type ); + + plural = new MakePlural( cldr.attributes.language, { + "ordinals": isOrdinal, + "cardinals": !isOrdinal + }); + + returnFn = pluralGeneratorFn( plural ); + + runtimeBind( args, cldr, returnFn, [ plural ] ); + + return returnFn; +}; + +return Globalize; + + + + +})); diff --git a/StockManMVC/bower_components/globalize/dist/globalize/relative-time.js b/StockManMVC/bower_components/globalize/dist/globalize/relative-time.js new file mode 100644 index 0000000..e179a80 --- /dev/null +++ b/StockManMVC/bower_components/globalize/dist/globalize/relative-time.js @@ -0,0 +1,201 @@ +/** + * Globalize v1.1.1 + * + * http://github.com/jquery/globalize + * + * Copyright 2010, 2014 jQuery Foundation, Inc. and other contributors + * Released under the MIT license + * http://jquery.org/license + * + * Date: 2016-02-04T12:01Z + */ +/*! + * Globalize v1.1.1 2016-02-04T12:01Z Released under the MIT license + * http://git.io/TrdQbw + */ +(function( root, factory ) { + + // UMD returnExports + if ( typeof define === "function" && define.amd ) { + + // AMD + define([ + "cldr", + "../globalize", + "./number", + "./plural", + "cldr/event", + "cldr/supplemental" + ], factory ); + } else if ( typeof exports === "object" ) { + + // Node, CommonJS + module.exports = factory( require( "cldrjs" ), require( "globalize" ) ); + } else { + + // Extend global + factory( root.Cldr, root.Globalize ); + } +}(this, function( Cldr, Globalize ) { + +var formatMessage = Globalize._formatMessage, + runtimeBind = Globalize._runtimeBind, + validateCldr = Globalize._validateCldr, + validateDefaultLocale = Globalize._validateDefaultLocale, + validateParameterPresence = Globalize._validateParameterPresence, + validateParameterTypeString = Globalize._validateParameterTypeString, + validateParameterTypeNumber = Globalize._validateParameterTypeNumber; + + +/** + * format( value, numberFormatter, pluralGenerator, properties ) + * + * @value [Number] The number to format + * + * @numberFormatter [String] A numberFormatter from Globalize.numberFormatter + * + * @pluralGenerator [String] A pluralGenerator from Globalize.pluralGenerator + * + * @properties [Object] containing relative time plural message. + * + * Format relative time. + */ +var relativeTimeFormat = function( value, numberFormatter, pluralGenerator, properties ) { + + var relativeTime, + message = properties[ "relative-type-" + value ]; + + if ( message ) { + return message; + } + + relativeTime = value <= 0 ? properties[ "relativeTime-type-past" ] + : properties[ "relativeTime-type-future" ]; + + value = Math.abs( value ); + + message = relativeTime[ "relativeTimePattern-count-" + pluralGenerator( value ) ]; + return formatMessage( message, [ numberFormatter( value ) ] ); +}; + + + + +var relativeTimeFormatterFn = function( numberFormatter, pluralGenerator, properties ) { + return function relativeTimeFormatter( value ) { + validateParameterPresence( value, "value" ); + validateParameterTypeNumber( value, "value" ); + + return relativeTimeFormat( value, numberFormatter, pluralGenerator, properties ); + }; + +}; + + + + +/** + * properties( unit, cldr, options ) + * + * @unit [String] eg. "day", "week", "month", etc. + * + * @cldr [Cldr instance]. + * + * @options [Object] + * - form: [String] eg. "short" or "narrow". Or falsy for default long form. + * + * Return relative time properties. + */ +var relativeTimeProperties = function( unit, cldr, options ) { + + var form = options.form, + raw, properties, key, match; + + if ( form ) { + unit = unit + "-" + form; + } + + raw = cldr.main( [ "dates", "fields", unit ] ); + properties = { + "relativeTime-type-future": raw[ "relativeTime-type-future" ], + "relativeTime-type-past": raw[ "relativeTime-type-past" ] + }; + for ( key in raw ) { + if ( raw.hasOwnProperty( key ) ) { + match = /relative-type-(-?[0-9]+)/.exec( key ); + if ( match ) { + properties[ key ] = raw[ key ]; + } + } + } + + return properties; +}; + + + + +/** + * .formatRelativeTime( value, unit [, options] ) + * + * @value [Number] The number of unit to format. + * + * @unit [String] see .relativeTimeFormatter() for details. + * + * @options [Object] see .relativeTimeFormatter() for details. + * + * Formats a relative time according to the given unit, options, and the default/instance locale. + */ +Globalize.formatRelativeTime = +Globalize.prototype.formatRelativeTime = function( value, unit, options ) { + validateParameterPresence( value, "value" ); + validateParameterTypeNumber( value, "value" ); + + return this.relativeTimeFormatter( unit, options )( value ); +}; + +/** + * .relativeTimeFormatter( unit [, options ]) + * + * @unit [String] String value indicating the unit to be formatted. eg. "day", "week", "month", etc. + * + * @options [Object] + * - form: [String] eg. "short" or "narrow". Or falsy for default long form. + * + * Returns a function that formats a relative time according to the given unit, options, and the + * default/instance locale. + */ +Globalize.relativeTimeFormatter = +Globalize.prototype.relativeTimeFormatter = function( unit, options ) { + var args, cldr, numberFormatter, pluralGenerator, properties, returnFn; + + validateParameterPresence( unit, "unit" ); + validateParameterTypeString( unit, "unit" ); + + cldr = this.cldr; + options = options || {}; + + args = [ unit, options ]; + + validateDefaultLocale( cldr ); + + cldr.on( "get", validateCldr ); + properties = relativeTimeProperties( unit, cldr, options ); + cldr.off( "get", validateCldr ); + + numberFormatter = this.numberFormatter( options ); + pluralGenerator = this.pluralGenerator(); + + returnFn = relativeTimeFormatterFn( numberFormatter, pluralGenerator, properties ); + + runtimeBind( args, cldr, returnFn, [ numberFormatter, pluralGenerator, properties ] ); + + return returnFn; +}; + +return Globalize; + + + + +})); diff --git a/StockManMVC/bower_components/globalize/dist/globalize/unit.js b/StockManMVC/bower_components/globalize/dist/globalize/unit.js new file mode 100644 index 0000000..a847a7d --- /dev/null +++ b/StockManMVC/bower_components/globalize/dist/globalize/unit.js @@ -0,0 +1,300 @@ +/** + * Globalize v1.1.1 + * + * http://github.com/jquery/globalize + * + * Copyright 2010, 2014 jQuery Foundation, Inc. and other contributors + * Released under the MIT license + * http://jquery.org/license + * + * Date: 2016-02-04T12:01Z + */ +/*! + * Globalize v1.1.1 2016-02-04T12:01Z Released under the MIT license + * http://git.io/TrdQbw + */ +(function( root, factory ) { + + // UMD returnExports + if ( typeof define === "function" && define.amd ) { + + // AMD + define([ + "cldr", + "../globalize", + "./number", + "./plural" + ], factory ); + } else if ( typeof exports === "object" ) { + + // Node, CommonJS + module.exports = factory( require( "cldrjs" ), require( "globalize" ) ); + } else { + + // Extend global + factory( root.Cldr, root.Globalize ); + } +}(this, function( Cldr, Globalize ) { + +var formatMessage = Globalize._formatMessage, + runtimeBind = Globalize._runtimeBind, + validateParameterPresence = Globalize._validateParameterPresence, + validateParameterTypePlainObject = Globalize._validateParameterTypePlainObject, + validateParameterTypeNumber = Globalize._validateParameterTypeNumber, + validateParameterTypeString = Globalize._validateParameterTypeString; + + +/** + * format( value, numberFormatter, pluralGenerator, unitProperies ) + * + * @value [Number] + * + * @numberFormatter [Object]: A numberFormatter from Globalize.numberFormatter. + * + * @pluralGenerator [Object]: A pluralGenerator from Globalize.pluralGenerator. + * + * @unitProperies [Object]: localized unit data from cldr. + * + * Format units such as seconds, minutes, days, weeks, etc. + * + * OBS: + * + * Unit Sequences are not implemented. + * http://www.unicode.org/reports/tr35/tr35-35/tr35-general.html#Unit_Sequences + * + * Duration Unit (for composed time unit durations) is not implemented. + * http://www.unicode.org/reports/tr35/tr35-35/tr35-general.html#durationUnit + */ +var unitFormat = function( value, numberFormatter, pluralGenerator, unitProperties ) { + var compoundUnitPattern = unitProperties.compoundUnitPattern, dividend, dividendProperties, + formattedValue, divisor, divisorProperties, message, pluralValue; + + unitProperties = unitProperties.unitProperties; + formattedValue = numberFormatter( value ); + pluralValue = pluralGenerator( value ); + + // computed compound unit, eg. "megabyte-per-second". + if ( unitProperties instanceof Array ) { + dividendProperties = unitProperties[ 0 ]; + divisorProperties = unitProperties[ 1 ]; + + dividend = formatMessage( dividendProperties[ pluralValue ], [ value ] ); + divisor = formatMessage( divisorProperties.one, [ "" ] ).trim(); + + return formatMessage( compoundUnitPattern, [ dividend, divisor ] ); + } + + message = unitProperties[ pluralValue ]; + + return formatMessage( message, [ formattedValue ] ); +}; + + + + +var unitFormatterFn = function( numberFormatter, pluralGenerator, unitProperties ) { + return function unitFormatter( value ) { + validateParameterPresence( value, "value" ); + validateParameterTypeNumber( value, "value" ); + + return unitFormat( value, numberFormatter, pluralGenerator, unitProperties ); + }; + +}; + + + + +/** + * categories() + * + * Return all unit categories. + */ +var unitCategories = [ "acceleration", "angle", "area", "digital", "duration", "length", "mass", "power", +"pressure", "speed", "temperature", "volume" ]; + + + + +function stripPluralGarbage( data ) { + var aux, pluralCount; + + if ( data ) { + aux = {}; + for ( pluralCount in data ) { + aux[ pluralCount.replace( /unitPattern-count-/, "" ) ] = data[ pluralCount ]; + } + } + + return aux; +} + +/** + * get( unit, form, cldr ) + * + * @unit [String] The full type-unit name (eg. duration-second), or the short unit name + * (eg. second). + * + * @form [String] A string describing the form of the unit representation (eg. long, + * short, narrow). + * + * @cldr [Cldr instance]. + * + * Return the plural map of a unit, eg: "second" + * { "one": "{0} second", + * "other": "{0} seconds" } + * } + * + * Or the Array of plural maps of a compound-unit, eg: "foot-per-second" + * [ { "one": "{0} foot", + * "other": "{0} feet" }, + * { "one": "{0} second", + * "other": "{0} seconds" } ] + * + * Uses the precomputed form of a compound-unit if available, eg: "mile-per-hour" + * { "displayName": "miles per hour", + * "unitPattern-count-one": "{0} mile per hour", + * "unitPattern-count-other": "{0} miles per hour" + * }, + * + * Also supports "/" instead of "-per-", eg. "foot/second", using the precomputed form if + * available. + * + * Or the Array of plural maps of a compound-unit, eg: "foot-per-second" + * [ { "one": "{0} foot", + * "other": "{0} feet" }, + * { "one": "{0} second", + * "other": "{0} seconds" } ] + * + * Or undefined in case the unit (or a unit of the compound-unit) doesn't exist. + */ +var get = function( unit, form, cldr ) { + var ret; + + // Ensure that we get the 'precomputed' form, if present. + unit = unit.replace( /\//, "-per-" ); + + // Get unit or -unit (eg. "duration-second"). + [ "" ].concat( unitCategories ).some(function( category ) { + return ret = cldr.main([ + "units", + form, + category.length ? category + "-" + unit : unit + ]); + }); + + // Rename keys s/unitPattern-count-//g. + ret = stripPluralGarbage( ret ); + + // Compound Unit, eg. "foot-per-second" or "foot/second". + if ( !ret && ( /-per-/ ).test( unit ) ) { + + // "Some units already have 'precomputed' forms, such as kilometer-per-hour; + // where such units exist, they should be used in preference" UTS#35. + // Note that precomputed form has already been handled above (!ret). + + // Get both recursively. + unit = unit.split( "-per-" ); + ret = unit.map(function( unit ) { + return get( unit, form, cldr ); + }); + if ( !ret[ 0 ] || !ret[ 1 ] ) { + return; + } + } + + return ret; +}; + +var unitGet = get; + + + + +/** + * properties( unit, form, cldr ) + * + * @unit [String] The full type-unit name (eg. duration-second), or the short unit name + * (eg. second). + * + * @form [String] A string describing the form of the unit representation (eg. long, + * short, narrow). + * + * @cldr [Cldr instance]. + */ +var unitProperties = function( unit, form, cldr ) { + var compoundUnitPattern, unitProperties; + + compoundUnitPattern = cldr.main( [ "units", form, "per/compoundUnitPattern" ] ); + unitProperties = unitGet( unit, form, cldr ); + + return { + compoundUnitPattern: compoundUnitPattern, + unitProperties: unitProperties + }; +}; + + + + +/** + * Globalize.formatUnit( value, unit, options ) + * + * @value [Number] + * + * @unit [String]: The unit (e.g "second", "day", "year") + * + * @options [Object] + * - form: [String] "long", "short" (default), or "narrow". + * + * Format units such as seconds, minutes, days, weeks, etc. + */ +Globalize.formatUnit = +Globalize.prototype.formatUnit = function( value, unit, options ) { + validateParameterPresence( value, "value" ); + validateParameterTypeNumber( value, "value" ); + + return this.unitFormatter( unit, options )( value ); +}; + +/** + * Globalize.unitFormatter( unit, options ) + * + * @unit [String]: The unit (e.g "second", "day", "year") + * + * @options [Object] + * - form: [String] "long", "short" (default), or "narrow". + * + * - numberFormatter: [Function] a number formatter function. Defaults to Globalize + * `.numberFormatter()` for the current locale using the default options. + */ +Globalize.unitFormatter = +Globalize.prototype.unitFormatter = function( unit, options ) { + var args, form, numberFormatter, pluralGenerator, returnFn, properties; + + validateParameterPresence( unit, "unit" ); + validateParameterTypeString( unit, "unit" ); + + validateParameterTypePlainObject( options, "options" ); + + options = options || {}; + + args = [ unit, options ]; + form = options.form || "long"; + properties = unitProperties( unit, form, this.cldr ); + + numberFormatter = options.numberFormatter || this.numberFormatter(); + pluralGenerator = this.pluralGenerator(); + returnFn = unitFormatterFn( numberFormatter, pluralGenerator, properties ); + + runtimeBind( args, this.cldr, returnFn, [ numberFormatter, pluralGenerator, properties ] ); + + return returnFn; +}; + +return Globalize; + + + + +})); diff --git a/StockManMVC/bower_components/globalize/dist/node-main.js b/StockManMVC/bower_components/globalize/dist/node-main.js new file mode 100644 index 0000000..1e8a16d --- /dev/null +++ b/StockManMVC/bower_components/globalize/dist/node-main.js @@ -0,0 +1,27 @@ +/*! + * Globalize v1.1.1 + * + * http://github.com/jquery/globalize + * + * Copyright jQuery Foundation and other contributors + * Released under the MIT license + * http://jquery.org/license + * + * Date: 2016-02-04T12:01Z + */ + +// Core +module.exports = require( "./globalize" ); + +// Extent core with the following modules +require( "./globalize/message" ); +require( "./globalize/number" ); +require( "./globalize/plural" ); + +// Load after globalize/number +require( "./globalize/currency" ); +require( "./globalize/date" ); + +// Load after globalize/number and globalize/plural +require( "./globalize/relative-time" ); +require( "./globalize/unit" ); diff --git a/StockManMVC/bower_components/globalize/doc/api/date/date-formatter.md b/StockManMVC/bower_components/globalize/doc/api/date/date-formatter.md index 76013cf..8c3475c 100644 --- a/StockManMVC/bower_components/globalize/doc/api/date/date-formatter.md +++ b/StockManMVC/bower_components/globalize/doc/api/date/date-formatter.md @@ -21,7 +21,8 @@ A JSON object including one of the following. > list `full`, `long`, `medium`, or `short` represented by date, time, or > datetime. Instead, they are an open-ended list of patterns containing > only date field information, and in a canonical order. For a complete list of -> skeleton patterns [check the unicode CLDR documentation](http://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table). +> skeleton patterns [check the unicode CLDR documentation](http://www.unicode.o +> rg/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table). > > For example: > diff --git a/StockManMVC/bower_components/globalize/examples/app-npm-webpack/package.json b/StockManMVC/bower_components/globalize/examples/app-npm-webpack/package.json index 051b438..dbf4619 100644 --- a/StockManMVC/bower_components/globalize/examples/app-npm-webpack/package.json +++ b/StockManMVC/bower_components/globalize/examples/app-npm-webpack/package.json @@ -2,7 +2,6 @@ "private": true, "devDependencies": { "cldr-data": ">=25", - "globalize-webpack-plugin": "0.3.x", "html-webpack-plugin": "^1.1.0", "nopt": "^3.0.3", "webpack": "^1.9.0", diff --git a/StockManMVC/node_modules/async/CHANGELOG.md b/StockManMVC/node_modules/async/CHANGELOG.md index 94cf2ca..b473e5f 100644 --- a/StockManMVC/node_modules/async/CHANGELOG.md +++ b/StockManMVC/node_modules/async/CHANGELOG.md @@ -1,3 +1,11 @@ +# v2.1.0 + +- `retry` and `retryable` now support an optional `errorFilter` function that determines if the `task` should retry on the error (#1256, #1261) +- Optimized array iteration in `race`, `cargo`, `queue`, and `priorityQueue` (#1253) +- Added alias documentation to doc site (#1251, #1254) +- Added [BootStrap scrollspy](http://getbootstrap.com/javascript/#scrollspy) to docs to highlight in the sidebar the current method being viewed (#1289, #1300) +- Various minor doc fixes (#1263, #1264, #1271, #1278, #1280, #1282, #1302) + # v2.0.1 - Significantly optimized all iteration based collection methods such as `each`, `map`, `filter`, etc (#1245, #1246, #1247). diff --git a/StockManMVC/node_modules/async/apply.js b/StockManMVC/node_modules/async/apply.js index 578f449..c0c8840 100644 --- a/StockManMVC/node_modules/async/apply.js +++ b/StockManMVC/node_modules/async/apply.js @@ -4,9 +4,9 @@ Object.defineProperty(exports, "__esModule", { value: true }); -var _rest = require('lodash/rest'); +var _baseRest = require('lodash/_baseRest'); -var _rest2 = _interopRequireDefault(_rest); +var _baseRest2 = _interopRequireDefault(_baseRest); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -54,8 +54,8 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de * two * three */ -exports.default = (0, _rest2.default)(function (fn, args) { - return (0, _rest2.default)(function (callArgs) { +exports.default = (0, _baseRest2.default)(function (fn, args) { + return (0, _baseRest2.default)(function (callArgs) { return fn.apply(null, args.concat(callArgs)); }); }); diff --git a/StockManMVC/node_modules/async/applyEach.js b/StockManMVC/node_modules/async/applyEach.js index c6e71b9..6865996 100644 --- a/StockManMVC/node_modules/async/applyEach.js +++ b/StockManMVC/node_modules/async/applyEach.js @@ -17,23 +17,25 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de /** * Applies the provided arguments to each function in the array, calling * `callback` after all functions have completed. If you only provide the first - * argument, then it will return a function which lets you pass in the - * arguments as if it were a single function call. + * argument, `fns`, then it will return a function which lets you pass in the + * arguments as if it were a single function call. If more arguments are + * provided, `callback` is required while `args` is still optional. * * @name applyEach * @static * @memberOf module:ControlFlow * @method * @category Control Flow - * @param {Array|Iterable|Object} fns - A collection of asynchronous functions to all - * call with the same arguments + * @param {Array|Iterable|Object} fns - A collection of asynchronous functions + * to all call with the same arguments * @param {...*} [args] - any number of separate arguments to pass to the * function. * @param {Function} [callback] - the final argument should be the callback, * called when all functions have completed processing. - * @returns {Function} - If only the first argument is provided, it will return - * a function which lets you pass in the arguments as if it were a single - * function call. + * @returns {Function} - If only the first argument, `fns`, is provided, it will + * return a function which lets you pass in the arguments as if it were a single + * function call. The signature is `(..args, callback)`. If invoked with any + * arguments, `callback` is required. * @example * * async.applyEach([enableSearch, updateSchema], 'bucket', callback); diff --git a/StockManMVC/node_modules/async/auto.js b/StockManMVC/node_modules/async/auto.js index 7f324b4..e1572dd 100644 --- a/StockManMVC/node_modules/async/auto.js +++ b/StockManMVC/node_modules/async/auto.js @@ -102,7 +102,7 @@ exports.default = function (tasks, concurrency, callback) { function runTask(key, task) { if (hasError) return; - var taskCallback = (0, _onlyOnce2.default)((0, _rest2.default)(function (err, args) { + var taskCallback = (0, _onlyOnce2.default)((0, _baseRest2.default)(function (err, args) { runningTasks--; if (args.length <= 1) { args = args[0]; @@ -188,9 +188,9 @@ var _noop = require('lodash/noop'); var _noop2 = _interopRequireDefault(_noop); -var _rest = require('lodash/rest'); +var _baseRest = require('lodash/_baseRest'); -var _rest2 = _interopRequireDefault(_rest); +var _baseRest2 = _interopRequireDefault(_baseRest); var _once = require('./internal/once'); diff --git a/StockManMVC/node_modules/async/compose.js b/StockManMVC/node_modules/async/compose.js index 499316f..65b26bb 100644 --- a/StockManMVC/node_modules/async/compose.js +++ b/StockManMVC/node_modules/async/compose.js @@ -8,9 +8,9 @@ var _seq = require('./seq'); var _seq2 = _interopRequireDefault(_seq); -var _rest = require('lodash/rest'); +var _baseRest = require('lodash/_baseRest'); -var _rest2 = _interopRequireDefault(_rest); +var _baseRest2 = _interopRequireDefault(_baseRest); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -49,7 +49,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de * // result now equals 15 * }); */ -exports.default = (0, _rest2.default)(function (args) { +exports.default = (0, _baseRest2.default)(function (args) { return _seq2.default.apply(null, args.reverse()); }); module.exports = exports['default']; \ No newline at end of file diff --git a/StockManMVC/node_modules/async/constant.js b/StockManMVC/node_modules/async/constant.js index 1387878..d130ca6 100644 --- a/StockManMVC/node_modules/async/constant.js +++ b/StockManMVC/node_modules/async/constant.js @@ -4,9 +4,9 @@ Object.defineProperty(exports, "__esModule", { value: true }); -var _rest = require('lodash/rest'); +var _baseRest = require('lodash/_baseRest'); -var _rest2 = _interopRequireDefault(_rest); +var _baseRest2 = _interopRequireDefault(_baseRest); var _initialParams = require('./internal/initialParams'); @@ -56,7 +56,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de * //... * }, callback); */ -exports.default = (0, _rest2.default)(function (values) { +exports.default = (0, _baseRest2.default)(function (values) { var args = [null].concat(values); return (0, _initialParams2.default)(function (ignoredArgs, callback) { return callback.apply(this, args); diff --git a/StockManMVC/node_modules/async/dist/async.js b/StockManMVC/node_modules/async/dist/async.js index 609d9cd..27c49bd 100644 --- a/StockManMVC/node_modules/async/dist/async.js +++ b/StockManMVC/node_modules/async/dist/async.js @@ -4,6 +4,26 @@ (factory((global.async = global.async || {}))); }(this, function (exports) { 'use strict'; + /** + * This method returns the first argument it receives. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Util + * @param {*} value Any value. + * @returns {*} Returns `value`. + * @example + * + * var object = { 'a': 1 }; + * + * console.log(_.identity(object) === object); + * // => true + */ + function identity(value) { + return value; + } + /** * A faster alternative to `Function#apply`, this function invokes `func` * with the `this` binding of `thisArg` and the arguments of `args`. @@ -15,8 +35,7 @@ * @returns {*} Returns the result of `func`. */ function apply(func, thisArg, args) { - var length = args.length; - switch (length) { + switch (args.length) { case 0: return func.call(thisArg); case 1: return func.call(thisArg, args[0]); case 2: return func.call(thisArg, args[0], args[1]); @@ -25,9 +44,67 @@ return func.apply(thisArg, args); } + /* Built-in method references for those with the same name as other `lodash` methods. */ + var nativeMax = Math.max; + + /** + * A specialized version of `baseRest` which transforms the rest array. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @param {Function} transform The rest array transform. + * @returns {Function} Returns the new function. + */ + function overRest(func, start, transform) { + start = nativeMax(start === undefined ? (func.length - 1) : start, 0); + return function() { + var args = arguments, + index = -1, + length = nativeMax(args.length - start, 0), + array = Array(length); + + while (++index < length) { + array[index] = args[start + index]; + } + index = -1; + var otherArgs = Array(start + 1); + while (++index < start) { + otherArgs[index] = args[index]; + } + otherArgs[start] = transform(array); + return apply(func, this, otherArgs); + }; + } + + /** + * Creates a function that returns `value`. + * + * @static + * @memberOf _ + * @since 2.4.0 + * @category Util + * @param {*} value The value to return from the new function. + * @returns {Function} Returns the new constant function. + * @example + * + * var objects = _.times(2, _.constant({ 'a': 1 })); + * + * console.log(objects); + * // => [{ 'a': 1 }, { 'a': 1 }] + * + * console.log(objects[0] === objects[1]); + * // => true + */ + function constant(value) { + return function() { + return value; + }; + } + /** * Checks if `value` is the - * [language type](http://www.ecma-international.org/ecma-262/6.0/#sec-ecmascript-language-types) + * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) * * @static @@ -52,20 +129,21 @@ */ function isObject(value) { var type = typeof value; - return !!value && (type == 'object' || type == 'function'); + return value != null && (type == 'object' || type == 'function'); } var funcTag = '[object Function]'; var genTag = '[object GeneratorFunction]'; + var proxyTag = '[object Proxy]'; /** Used for built-in method references. */ - var objectProto = Object.prototype; + var objectProto$1 = Object.prototype; /** * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) * of values. */ - var objectToString = objectProto.toString; + var objectToString = objectProto$1.toString; /** * Checks if `value` is classified as a `Function` object. @@ -75,8 +153,7 @@ * @since 0.1.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, - * else `false`. + * @returns {boolean} Returns `true` if `value` is a function, else `false`. * @example * * _.isFunction(_); @@ -87,277 +164,221 @@ */ function isFunction(value) { // The use of `Object#toString` avoids issues with the `typeof` operator - // in Safari 8 which returns 'object' for typed array and weak map constructors, - // and PhantomJS 1.9 which returns 'function' for `NodeList` instances. + // in Safari 9 which returns 'object' for typed array and other constructors. var tag = isObject(value) ? objectToString.call(value) : ''; - return tag == funcTag || tag == genTag; + return tag == funcTag || tag == genTag || tag == proxyTag; } + /** Detect free variable `global` from Node.js. */ + var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; + + /** Detect free variable `self`. */ + var freeSelf = typeof self == 'object' && self && self.Object === Object && self; + + /** Used as a reference to the global object. */ + var root = freeGlobal || freeSelf || Function('return this')(); + + /** Used to detect overreaching core-js shims. */ + var coreJsData = root['__core-js_shared__']; + + /** Used to detect methods masquerading as native. */ + var maskSrcKey = (function() { + var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); + return uid ? ('Symbol(src)_1.' + uid) : ''; + }()); + /** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". + * Checks if `func` has its source masked. * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - * @example - * - * _.isObjectLike({}); - * // => true - * - * _.isObjectLike([1, 2, 3]); - * // => true - * - * _.isObjectLike(_.noop); - * // => false - * - * _.isObjectLike(null); - * // => false + * @private + * @param {Function} func The function to check. + * @returns {boolean} Returns `true` if `func` is masked, else `false`. */ - function isObjectLike(value) { - return !!value && typeof value == 'object'; + function isMasked(func) { + return !!maskSrcKey && (maskSrcKey in func); } - /** `Object#toString` result references. */ - var symbolTag = '[object Symbol]'; - /** Used for built-in method references. */ - var objectProto$1 = Object.prototype; + var funcProto$1 = Function.prototype; + + /** Used to resolve the decompiled source of functions. */ + var funcToString$1 = funcProto$1.toString; /** - * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) - * of values. - */ - var objectToString$1 = objectProto$1.toString; - - /** - * Checks if `value` is classified as a `Symbol` primitive or object. + * Converts `func` to its source code. * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang + * @private + * @param {Function} func The function to process. + * @returns {string} Returns the source code. + */ + function toSource(func) { + if (func != null) { + try { + return funcToString$1.call(func); + } catch (e) {} + try { + return (func + ''); + } catch (e) {} + } + return ''; + } + + /** + * Used to match `RegExp` + * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). + */ + var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; + + /** Used to detect host constructors (Safari). */ + var reIsHostCtor = /^\[object .+?Constructor\]$/; + + /** Used for built-in method references. */ + var funcProto = Function.prototype; + var objectProto = Object.prototype; + /** Used to resolve the decompiled source of functions. */ + var funcToString = funcProto.toString; + + /** Used to check objects for own properties. */ + var hasOwnProperty = objectProto.hasOwnProperty; + + /** Used to detect if a method is native. */ + var reIsNative = RegExp('^' + + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') + .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' + ); + + /** + * The base implementation of `_.isNative` without bad shim checks. + * + * @private * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, + * @returns {boolean} Returns `true` if `value` is a native function, * else `false`. - * @example - * - * _.isSymbol(Symbol.iterator); - * // => true - * - * _.isSymbol('abc'); - * // => false */ - function isSymbol(value) { - return typeof value == 'symbol' || - (isObjectLike(value) && objectToString$1.call(value) == symbolTag); - } - - /** Used as references for various `Number` constants. */ - var NAN = 0 / 0; - - /** Used to match leading and trailing whitespace. */ - var reTrim = /^\s+|\s+$/g; - - /** Used to detect bad signed hexadecimal string values. */ - var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; - - /** Used to detect binary string values. */ - var reIsBinary = /^0b[01]+$/i; - - /** Used to detect octal string values. */ - var reIsOctal = /^0o[0-7]+$/i; - - /** Built-in method references without a dependency on `root`. */ - var freeParseInt = parseInt; - - /** - * Converts `value` to a number. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to process. - * @returns {number} Returns the number. - * @example - * - * _.toNumber(3.2); - * // => 3.2 - * - * _.toNumber(Number.MIN_VALUE); - * // => 5e-324 - * - * _.toNumber(Infinity); - * // => Infinity - * - * _.toNumber('3.2'); - * // => 3.2 - */ - function toNumber(value) { - if (typeof value == 'number') { - return value; + function baseIsNative(value) { + if (!isObject(value) || isMasked(value)) { + return false; } - if (isSymbol(value)) { - return NAN; - } - if (isObject(value)) { - var other = isFunction(value.valueOf) ? value.valueOf() : value; - value = isObject(other) ? (other + '') : other; - } - if (typeof value != 'string') { - return value === 0 ? value : +value; - } - value = value.replace(reTrim, ''); - var isBinary = reIsBinary.test(value); - return (isBinary || reIsOctal.test(value)) - ? freeParseInt(value.slice(2), isBinary ? 2 : 8) - : (reIsBadHex.test(value) ? NAN : +value); - } - - var INFINITY = 1 / 0; - var MAX_INTEGER = 1.7976931348623157e+308; - /** - * Converts `value` to a finite number. - * - * @static - * @memberOf _ - * @since 4.12.0 - * @category Lang - * @param {*} value The value to convert. - * @returns {number} Returns the converted number. - * @example - * - * _.toFinite(3.2); - * // => 3.2 - * - * _.toFinite(Number.MIN_VALUE); - * // => 5e-324 - * - * _.toFinite(Infinity); - * // => 1.7976931348623157e+308 - * - * _.toFinite('3.2'); - * // => 3.2 - */ - function toFinite(value) { - if (!value) { - return value === 0 ? value : 0; - } - value = toNumber(value); - if (value === INFINITY || value === -INFINITY) { - var sign = (value < 0 ? -1 : 1); - return sign * MAX_INTEGER; - } - return value === value ? value : 0; + var pattern = isFunction(value) ? reIsNative : reIsHostCtor; + return pattern.test(toSource(value)); } /** - * Converts `value` to an integer. + * Gets the value at `key` of `object`. * - * **Note:** This method is loosely based on - * [`ToInteger`](http://www.ecma-international.org/ecma-262/6.0/#sec-tointeger). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to convert. - * @returns {number} Returns the converted integer. - * @example - * - * _.toInteger(3.2); - * // => 3 - * - * _.toInteger(Number.MIN_VALUE); - * // => 0 - * - * _.toInteger(Infinity); - * // => 1.7976931348623157e+308 - * - * _.toInteger('3.2'); - * // => 3 + * @private + * @param {Object} [object] The object to query. + * @param {string} key The key of the property to get. + * @returns {*} Returns the property value. */ - function toInteger(value) { - var result = toFinite(value), - remainder = result % 1; - - return result === result ? (remainder ? result - remainder : result) : 0; + function getValue(object, key) { + return object == null ? undefined : object[key]; } - /** Used as the `TypeError` message for "Functions" methods. */ - var FUNC_ERROR_TEXT = 'Expected a function'; + /** + * Gets the native function at `key` of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {string} key The key of the method to get. + * @returns {*} Returns the function if it's native, else `undefined`. + */ + function getNative(object, key) { + var value = getValue(object, key); + return baseIsNative(value) ? value : undefined; + } + var defineProperty = (function() { + try { + var func = getNative(Object, 'defineProperty'); + func({}, '', {}); + return func; + } catch (e) {} + }()); + + /** + * The base implementation of `setToString` without support for hot loop shorting. + * + * @private + * @param {Function} func The function to modify. + * @param {Function} string The `toString` result. + * @returns {Function} Returns `func`. + */ + var baseSetToString = !defineProperty ? identity : function(func, string) { + return defineProperty(func, 'toString', { + 'configurable': true, + 'enumerable': false, + 'value': constant(string), + 'writable': true + }); + }; + + /** Used to detect hot functions by number of calls within a span of milliseconds. */ + var HOT_COUNT = 500; + var HOT_SPAN = 16; /* Built-in method references for those with the same name as other `lodash` methods. */ - var nativeMax = Math.max; + var nativeNow = Date.now; /** - * Creates a function that invokes `func` with the `this` binding of the - * created function and arguments from `start` and beyond provided as - * an array. + * Creates a function that'll short out and invoke `identity` instead + * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN` + * milliseconds. * - * **Note:** This method is based on the - * [rest parameter](https://mdn.io/rest_parameters). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Function - * @param {Function} func The function to apply a rest parameter to. - * @param {number} [start=func.length-1] The start position of the rest parameter. - * @returns {Function} Returns the new function. - * @example - * - * var say = _.rest(function(what, names) { - * return what + ' ' + _.initial(names).join(', ') + - * (_.size(names) > 1 ? ', & ' : '') + _.last(names); - * }); - * - * say('hello', 'fred', 'barney', 'pebbles'); - * // => 'hello fred, barney, & pebbles' + * @private + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new shortable function. */ - function rest(func, start) { - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - start = nativeMax(start === undefined ? (func.length - 1) : toInteger(start), 0); - return function() { - var args = arguments, - index = -1, - length = nativeMax(args.length - start, 0), - array = Array(length); + function shortOut(func) { + var count = 0, + lastCalled = 0; - while (++index < length) { - array[index] = args[start + index]; + return function() { + var stamp = nativeNow(), + remaining = HOT_SPAN - (stamp - lastCalled); + + lastCalled = stamp; + if (remaining > 0) { + if (++count >= HOT_COUNT) { + return arguments[0]; + } + } else { + count = 0; } - switch (start) { - case 0: return func.call(this, array); - case 1: return func.call(this, args[0], array); - case 2: return func.call(this, args[0], args[1], array); - } - var otherArgs = Array(start + 1); - index = -1; - while (++index < start) { - otherArgs[index] = args[index]; - } - otherArgs[start] = array; - return apply(func, this, otherArgs); + return func.apply(undefined, arguments); }; } + /** + * Sets the `toString` method of `func` to return `string`. + * + * @private + * @param {Function} func The function to modify. + * @param {Function} string The `toString` result. + * @returns {Function} Returns `func`. + */ + var setToString = shortOut(baseSetToString); + + /** + * The base implementation of `_.rest` which doesn't validate or coerce arguments. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @returns {Function} Returns the new function. + */ + function baseRest(func, start) { + return setToString(overRest(func, start, identity), func + ''); + } + function initialParams (fn) { - return rest(function (args /*..., callback*/) { + return baseRest(function (args /*..., callback*/) { var callback = args.pop(); fn.call(this, args, callback); }); } function applyEach$1(eachfn) { - return rest(function (fns, args) { + return baseRest(function (fns, args) { var go = initialParams(function (args, callback) { var that = this; return eachfn(fns, function (fn, cb) { @@ -372,48 +393,21 @@ }); } - /** - * The base implementation of `_.property` without support for deep paths. - * - * @private - * @param {string} key The key of the property to get. - * @returns {Function} Returns the new accessor function. - */ - function baseProperty(key) { - return function(object) { - return object == null ? undefined : object[key]; - }; - } - - /** - * Gets the "length" property value of `object`. - * - * **Note:** This function is used to avoid a - * [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) that affects - * Safari on at least iOS 8.1-8.3 ARM64. - * - * @private - * @param {Object} object The object to query. - * @returns {*} Returns the "length" value. - */ - var getLength = baseProperty('length'); - /** Used as references for various `Number` constants. */ var MAX_SAFE_INTEGER = 9007199254740991; /** * Checks if `value` is a valid array-like length. * - * **Note:** This function is loosely based on - * [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). + * **Note:** This method is loosely based on + * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a valid length, - * else `false`. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. * @example * * _.isLength(3); @@ -459,11 +453,11 @@ * // => false */ function isArrayLike(value) { - return value != null && isLength(getLength(value)) && !isFunction(value); + return value != null && isLength(value.length) && !isFunction(value); } /** - * A method that returns `undefined`. + * This method returns `undefined`. * * @static * @memberOf _ @@ -493,58 +487,6 @@ return iteratorSymbol && coll[iteratorSymbol] && coll[iteratorSymbol](); } - /* Built-in method references for those with the same name as other `lodash` methods. */ - var nativeGetPrototype = Object.getPrototypeOf; - - /** - * Gets the `[[Prototype]]` of `value`. - * - * @private - * @param {*} value The value to query. - * @returns {null|Object} Returns the `[[Prototype]]`. - */ - function getPrototype(value) { - return nativeGetPrototype(Object(value)); - } - - /** Used for built-in method references. */ - var objectProto$2 = Object.prototype; - - /** Used to check objects for own properties. */ - var hasOwnProperty = objectProto$2.hasOwnProperty; - - /** - * The base implementation of `_.has` without support for deep paths. - * - * @private - * @param {Object} [object] The object to query. - * @param {Array|string} key The key to check. - * @returns {boolean} Returns `true` if `key` exists, else `false`. - */ - function baseHas(object, key) { - // Avoid a bug in IE 10-11 where objects with a [[Prototype]] of `null`, - // that are composed entirely of index properties, return `false` for - // `hasOwnProperty` checks of them. - return object != null && - (hasOwnProperty.call(object, key) || - (typeof object == 'object' && key in object && getPrototype(object) === null)); - } - - /* Built-in method references for those with the same name as other `lodash` methods. */ - var nativeKeys = Object.keys; - - /** - * The base implementation of `_.keys` which doesn't skip the constructor - * property of prototypes or treat sparse arrays as dense. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - */ - function baseKeys(object) { - return nativeKeys(Object(object)); - } - /** * The base implementation of `_.times` without support for iteratee shorthands * or max array length checks. @@ -565,49 +507,62 @@ } /** - * This method is like `_.isArrayLike` except that it also checks if `value` - * is an object. + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an array-like object, - * else `false`. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. * @example * - * _.isArrayLikeObject([1, 2, 3]); + * _.isObjectLike({}); * // => true * - * _.isArrayLikeObject(document.body.children); + * _.isObjectLike([1, 2, 3]); * // => true * - * _.isArrayLikeObject('abc'); + * _.isObjectLike(_.noop); * // => false * - * _.isArrayLikeObject(_.noop); + * _.isObjectLike(null); * // => false */ - function isArrayLikeObject(value) { - return isObjectLike(value) && isArrayLike(value); + function isObjectLike(value) { + return value != null && typeof value == 'object'; } /** `Object#toString` result references. */ var argsTag = '[object Arguments]'; /** Used for built-in method references. */ - var objectProto$3 = Object.prototype; - - /** Used to check objects for own properties. */ - var hasOwnProperty$1 = objectProto$3.hasOwnProperty; + var objectProto$4 = Object.prototype; /** * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) * of values. */ - var objectToString$2 = objectProto$3.toString; + var objectToString$1 = objectProto$4.toString; + + /** + * The base implementation of `_.isArguments`. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + */ + function baseIsArguments(value) { + return isObjectLike(value) && objectToString$1.call(value) == argsTag; + } + + /** Used for built-in method references. */ + var objectProto$3 = Object.prototype; + + /** Used to check objects for own properties. */ + var hasOwnProperty$2 = objectProto$3.hasOwnProperty; /** Built-in value references. */ var propertyIsEnumerable = objectProto$3.propertyIsEnumerable; @@ -620,7 +575,7 @@ * @since 0.1.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, + * @returns {boolean} Returns `true` if `value` is an `arguments` object, * else `false`. * @example * @@ -630,11 +585,10 @@ * _.isArguments([1, 2, 3]); * // => false */ - function isArguments(value) { - // Safari 8.1 incorrectly makes `arguments.callee` enumerable in strict mode. - return isArrayLikeObject(value) && hasOwnProperty$1.call(value, 'callee') && - (!propertyIsEnumerable.call(value, 'callee') || objectToString$2.call(value) == argsTag); - } + var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) { + return isObjectLike(value) && hasOwnProperty$2.call(value, 'callee') && + !propertyIsEnumerable.call(value, 'callee'); + }; /** * Checks if `value` is classified as an `Array` object. @@ -642,11 +596,9 @@ * @static * @memberOf _ * @since 0.1.0 - * @type {Function} * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, - * else `false`. + * @returns {boolean} Returns `true` if `value` is an array, else `false`. * @example * * _.isArray([1, 2, 3]); @@ -663,58 +615,56 @@ */ var isArray = Array.isArray; - /** `Object#toString` result references. */ - var stringTag = '[object String]'; - - /** Used for built-in method references. */ - var objectProto$4 = Object.prototype; - /** - * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) - * of values. - */ - var objectToString$3 = objectProto$4.toString; - - /** - * Checks if `value` is classified as a `String` primitive or object. + * This method returns `false`. * * @static - * @since 0.1.0 * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, - * else `false`. + * @since 4.13.0 + * @category Util + * @returns {boolean} Returns `false`. * @example * - * _.isString('abc'); - * // => true - * - * _.isString(1); - * // => false + * _.times(2, _.stubFalse); + * // => [false, false] */ - function isString(value) { - return typeof value == 'string' || - (!isArray(value) && isObjectLike(value) && objectToString$3.call(value) == stringTag); + function stubFalse() { + return false; } + /** Detect free variable `exports`. */ + var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports; + + /** Detect free variable `module`. */ + var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; + + /** Detect the popular CommonJS extension `module.exports`. */ + var moduleExports = freeModule && freeModule.exports === freeExports; + + /** Built-in value references. */ + var Buffer = moduleExports ? root.Buffer : undefined; + + /* Built-in method references for those with the same name as other `lodash` methods. */ + var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined; + /** - * Creates an array of index keys for `object` values of arrays, - * `arguments` objects, and strings, otherwise `null` is returned. + * Checks if `value` is a buffer. * - * @private - * @param {Object} object The object to query. - * @returns {Array|null} Returns index keys, else `null`. + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. + * @example + * + * _.isBuffer(new Buffer(2)); + * // => true + * + * _.isBuffer(new Uint8Array(2)); + * // => false */ - function indexKeys(object) { - var length = object ? object.length : undefined; - if (isLength(length) && - (isArray(object) || isString(object) || isArguments(object))) { - return baseTimes(length, String); - } - return null; - } + var isBuffer = nativeIsBuffer || stubFalse; /** Used as references for various `Number` constants. */ var MAX_SAFE_INTEGER$1 = 9007199254740991; @@ -737,9 +687,166 @@ (value > -1 && value % 1 == 0 && value < length); } + var argsTag$1 = '[object Arguments]'; + var arrayTag = '[object Array]'; + var boolTag = '[object Boolean]'; + var dateTag = '[object Date]'; + var errorTag = '[object Error]'; + var funcTag$1 = '[object Function]'; + var mapTag = '[object Map]'; + var numberTag = '[object Number]'; + var objectTag = '[object Object]'; + var regexpTag = '[object RegExp]'; + var setTag = '[object Set]'; + var stringTag = '[object String]'; + var weakMapTag = '[object WeakMap]'; + var arrayBufferTag = '[object ArrayBuffer]'; + var dataViewTag = '[object DataView]'; + var float32Tag = '[object Float32Array]'; + var float64Tag = '[object Float64Array]'; + var int8Tag = '[object Int8Array]'; + var int16Tag = '[object Int16Array]'; + var int32Tag = '[object Int32Array]'; + var uint8Tag = '[object Uint8Array]'; + var uint8ClampedTag = '[object Uint8ClampedArray]'; + var uint16Tag = '[object Uint16Array]'; + var uint32Tag = '[object Uint32Array]'; + /** Used to identify `toStringTag` values of typed arrays. */ + var typedArrayTags = {}; + typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = + typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = + typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = + typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = + typedArrayTags[uint32Tag] = true; + typedArrayTags[argsTag$1] = typedArrayTags[arrayTag] = + typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = + typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = + typedArrayTags[errorTag] = typedArrayTags[funcTag$1] = + typedArrayTags[mapTag] = typedArrayTags[numberTag] = + typedArrayTags[objectTag] = typedArrayTags[regexpTag] = + typedArrayTags[setTag] = typedArrayTags[stringTag] = + typedArrayTags[weakMapTag] = false; + /** Used for built-in method references. */ var objectProto$5 = Object.prototype; + /** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ + var objectToString$2 = objectProto$5.toString; + + /** + * The base implementation of `_.isTypedArray` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. + */ + function baseIsTypedArray(value) { + return isObjectLike(value) && + isLength(value.length) && !!typedArrayTags[objectToString$2.call(value)]; + } + + /** + * The base implementation of `_.unary` without support for storing metadata. + * + * @private + * @param {Function} func The function to cap arguments for. + * @returns {Function} Returns the new capped function. + */ + function baseUnary(func) { + return function(value) { + return func(value); + }; + } + + /** Detect free variable `exports`. */ + var freeExports$1 = typeof exports == 'object' && exports && !exports.nodeType && exports; + + /** Detect free variable `module`. */ + var freeModule$1 = freeExports$1 && typeof module == 'object' && module && !module.nodeType && module; + + /** Detect the popular CommonJS extension `module.exports`. */ + var moduleExports$1 = freeModule$1 && freeModule$1.exports === freeExports$1; + + /** Detect free variable `process` from Node.js. */ + var freeProcess = moduleExports$1 && freeGlobal.process; + + /** Used to access faster Node.js helpers. */ + var nodeUtil = (function() { + try { + return freeProcess && freeProcess.binding('util'); + } catch (e) {} + }()); + + /* Node.js helper references. */ + var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; + + /** + * Checks if `value` is classified as a typed array. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. + * @example + * + * _.isTypedArray(new Uint8Array); + * // => true + * + * _.isTypedArray([]); + * // => false + */ + var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; + + /** Used for built-in method references. */ + var objectProto$2 = Object.prototype; + + /** Used to check objects for own properties. */ + var hasOwnProperty$1 = objectProto$2.hasOwnProperty; + + /** + * Creates an array of the enumerable property names of the array-like `value`. + * + * @private + * @param {*} value The value to query. + * @param {boolean} inherited Specify returning inherited property names. + * @returns {Array} Returns the array of property names. + */ + function arrayLikeKeys(value, inherited) { + var isArr = isArray(value), + isArg = !isArr && isArguments(value), + isBuff = !isArr && !isArg && isBuffer(value), + isType = !isArr && !isArg && !isBuff && isTypedArray(value), + skipIndexes = isArr || isArg || isBuff || isType, + result = skipIndexes ? baseTimes(value.length, String) : [], + length = result.length; + + for (var key in value) { + if ((inherited || hasOwnProperty$1.call(value, key)) && + !(skipIndexes && ( + // Safari 9 has enumerable `arguments.length` in strict mode. + key == 'length' || + // Node.js 0.10 has enumerable non-index properties on buffers. + (isBuff && (key == 'offset' || key == 'parent')) || + // PhantomJS 2 has enumerable non-index properties on typed arrays. + (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) || + // Skip index properties. + isIndex(key, length) + ))) { + result.push(key); + } + } + return result; + } + + /** Used for built-in method references. */ + var objectProto$7 = Object.prototype; + /** * Checks if `value` is likely a prototype object. * @@ -749,16 +856,59 @@ */ function isPrototype(value) { var Ctor = value && value.constructor, - proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto$5; + proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto$7; return value === proto; } + /** + * Creates a unary function that invokes `func` with its argument transformed. + * + * @private + * @param {Function} func The function to wrap. + * @param {Function} transform The argument transform. + * @returns {Function} Returns the new function. + */ + function overArg(func, transform) { + return function(arg) { + return func(transform(arg)); + }; + } + + /* Built-in method references for those with the same name as other `lodash` methods. */ + var nativeKeys = overArg(Object.keys, Object); + + /** Used for built-in method references. */ + var objectProto$6 = Object.prototype; + + /** Used to check objects for own properties. */ + var hasOwnProperty$3 = objectProto$6.hasOwnProperty; + + /** + * The base implementation of `_.keys` which doesn't treat sparse arrays as dense. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ + function baseKeys(object) { + if (!isPrototype(object)) { + return nativeKeys(object); + } + var result = []; + for (var key in Object(object)) { + if (hasOwnProperty$3.call(object, key) && key != 'constructor') { + result.push(key); + } + } + return result; + } + /** * Creates an array of the own enumerable property names of `object`. * * **Note:** Non-object values are coerced to objects. See the - * [ES spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys) + * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) * for more details. * * @static @@ -783,23 +933,7 @@ * // => ['0', '1'] */ function keys(object) { - var isProto = isPrototype(object); - if (!(isProto || isArrayLike(object))) { - return baseKeys(object); - } - var indexes = indexKeys(object), - skipIndexes = !!indexes, - result = indexes || [], - length = result.length; - - for (var key in object) { - if (baseHas(object, key) && - !(skipIndexes && (key == 'length' || isIndex(key, length))) && - !(isProto && key == 'constructor')) { - result.push(key); - } - } - return result; + return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); } function createArrayIterator(coll) { @@ -921,68 +1055,9 @@ }; } - /** Used as the `TypeError` message for "Functions" methods. */ - var FUNC_ERROR_TEXT$1 = 'Expected a function'; - - /** - * Creates a function that invokes `func`, with the `this` binding and arguments - * of the created function, while it's called less than `n` times. Subsequent - * calls to the created function return the result of the last `func` invocation. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Function - * @param {number} n The number of calls at which `func` is no longer invoked. - * @param {Function} func The function to restrict. - * @returns {Function} Returns the new restricted function. - * @example - * - * jQuery(element).on('click', _.before(5, addContactToList)); - * // => allows adding up to 4 contacts to the list - */ - function before(n, func) { - var result; - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT$1); - } - n = toInteger(n); - return function() { - if (--n > 0) { - result = func.apply(this, arguments); - } - if (n <= 1) { - func = undefined; - } - return result; - }; - } - - /** - * Creates a function that is restricted to invoking `func` once. Repeat calls - * to the function return the value of the first invocation. The `func` is - * invoked with the `this` binding and arguments of the created function. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Function - * @param {Function} func The function to restrict. - * @returns {Function} Returns the new restricted function. - * @example - * - * var initialize = _.once(createApplication); - * initialize(); - * initialize(); - * // `initialize` invokes `createApplication` once - */ - function once$1(func) { - return before(2, func); - } - // eachOf implementation optimized for array-likes function eachOfArrayLike(coll, iteratee, callback) { - callback = once$1(callback || noop); + callback = once(callback || noop); var index = 0, completed = 0, length = coll.length; @@ -1116,23 +1191,25 @@ /** * Applies the provided arguments to each function in the array, calling * `callback` after all functions have completed. If you only provide the first - * argument, then it will return a function which lets you pass in the - * arguments as if it were a single function call. + * argument, `fns`, then it will return a function which lets you pass in the + * arguments as if it were a single function call. If more arguments are + * provided, `callback` is required while `args` is still optional. * * @name applyEach * @static * @memberOf module:ControlFlow * @method * @category Control Flow - * @param {Array|Iterable|Object} fns - A collection of asynchronous functions to all - * call with the same arguments + * @param {Array|Iterable|Object} fns - A collection of asynchronous functions + * to all call with the same arguments * @param {...*} [args] - any number of separate arguments to pass to the * function. * @param {Function} [callback] - the final argument should be the callback, * called when all functions have completed processing. - * @returns {Function} - If only the first argument is provided, it will return - * a function which lets you pass in the arguments as if it were a single - * function call. + * @returns {Function} - If only the first argument, `fns`, is provided, it will + * return a function which lets you pass in the arguments as if it were a single + * function call. The signature is `(..args, callback)`. If invoked with any + * arguments, `callback` is required. * @example * * async.applyEach([enableSearch, updateSchema], 'bucket', callback); @@ -1258,8 +1335,8 @@ * two * three */ - var apply$1 = rest(function (fn, args) { - return rest(function (callArgs) { + var apply$1 = baseRest(function (fn, args) { + return baseRest(function (callArgs) { return fn.apply(null, args.concat(callArgs)); }); }); @@ -1411,21 +1488,55 @@ } /** - * Gets the index at which the first occurrence of `NaN` is found in `array`. + * The base implementation of `_.findIndex` and `_.findLastIndex` without + * support for iteratee shorthands. * * @private - * @param {Array} array The array to search. + * @param {Array} array The array to inspect. + * @param {Function} predicate The function invoked per iteration. * @param {number} fromIndex The index to search from. * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {number} Returns the index of the matched `NaN`, else `-1`. + * @returns {number} Returns the index of the matched value, else `-1`. */ - function indexOfNaN(array, fromIndex, fromRight) { + function baseFindIndex(array, predicate, fromIndex, fromRight) { var length = array.length, index = fromIndex + (fromRight ? 1 : -1); while ((fromRight ? index-- : ++index < length)) { - var other = array[index]; - if (other !== other) { + if (predicate(array[index], index, array)) { + return index; + } + } + return -1; + } + + /** + * The base implementation of `_.isNaN` without support for number objects. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. + */ + function baseIsNaN(value) { + return value !== value; + } + + /** + * A specialized version of `_.indexOf` which performs strict equality + * comparisons of values, i.e. `===`. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + */ + function strictIndexOf(array, value, fromIndex) { + var index = fromIndex - 1, + length = array.length; + + while (++index < length) { + if (array[index] === value) { return index; } } @@ -1436,24 +1547,15 @@ * The base implementation of `_.indexOf` without `fromIndex` bounds checks. * * @private - * @param {Array} array The array to search. + * @param {Array} array The array to inspect. * @param {*} value The value to search for. * @param {number} fromIndex The index to search from. * @returns {number} Returns the index of the matched value, else `-1`. */ function baseIndexOf(array, value, fromIndex) { - if (value !== value) { - return indexOfNaN(array, fromIndex); - } - var index = fromIndex - 1, - length = array.length; - - while (++index < length) { - if (array[index] === value) { - return index; - } - } - return -1; + return value === value + ? strictIndexOf(array, value, fromIndex) + : baseFindIndex(array, baseIsNaN, fromIndex); } /** @@ -1633,7 +1735,7 @@ function runTask(key, task) { if (hasError) return; - var taskCallback = onlyOnce(rest(function (err, args) { + var taskCallback = onlyOnce(baseRest(function (err, args) { runningTasks--; if (args.length <= 1) { args = args[0]; @@ -1734,34 +1836,46 @@ return array; } - /** - * Checks if `value` is a global object. - * - * @private - * @param {*} value The value to check. - * @returns {null|Object} Returns `value` if it's a global object, else `null`. - */ - function checkGlobal(value) { - return (value && value.Object === Object) ? value : null; - } - - /** Detect free variable `global` from Node.js. */ - var freeGlobal = checkGlobal(typeof global == 'object' && global); - - /** Detect free variable `self`. */ - var freeSelf = checkGlobal(typeof self == 'object' && self); - - /** Detect `this` as the global object. */ - var thisGlobal = checkGlobal(typeof this == 'object' && this); - - /** Used as a reference to the global object. */ - var root = freeGlobal || freeSelf || thisGlobal || Function('return this')(); - /** Built-in value references. */ var Symbol$1 = root.Symbol; + /** `Object#toString` result references. */ + var symbolTag = '[object Symbol]'; + + /** Used for built-in method references. */ + var objectProto$8 = Object.prototype; + + /** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ + var objectToString$3 = objectProto$8.toString; + + /** + * Checks if `value` is classified as a `Symbol` primitive or object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. + * @example + * + * _.isSymbol(Symbol.iterator); + * // => true + * + * _.isSymbol('abc'); + * // => false + */ + function isSymbol(value) { + return typeof value == 'symbol' || + (isObjectLike(value) && objectToString$3.call(value) == symbolTag); + } + /** Used as references for various `Number` constants. */ - var INFINITY$1 = 1 / 0; + var INFINITY = 1 / 0; /** Used to convert symbols to primitives and strings. */ var symbolProto = Symbol$1 ? Symbol$1.prototype : undefined; @@ -1779,11 +1893,15 @@ if (typeof value == 'string') { return value; } + if (isArray(value)) { + // Recursively convert values (susceptible to call stack limits). + return arrayMap(value, baseToString) + ''; + } if (isSymbol(value)) { return symbolToString ? symbolToString.call(value) : ''; } var result = (value + ''); - return (result == '0' && (1 / value) == -INFINITY$1) ? '-0' : result; + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; } /** @@ -1864,26 +1982,70 @@ return index; } + /** + * Converts an ASCII `string` to an array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the converted array. + */ + function asciiToArray(string) { + return string.split(''); + } + /** Used to compose unicode character classes. */ var rsAstralRange = '\\ud800-\\udfff'; var rsComboMarksRange = '\\u0300-\\u036f\\ufe20-\\ufe23'; var rsComboSymbolsRange = '\\u20d0-\\u20f0'; var rsVarRange = '\\ufe0e\\ufe0f'; - var rsAstral = '[' + rsAstralRange + ']'; - var rsCombo = '[' + rsComboMarksRange + rsComboSymbolsRange + ']'; + /** Used to compose unicode capture groups. */ + var rsZWJ = '\\u200d'; + + /** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */ + var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboMarksRange + rsComboSymbolsRange + rsVarRange + ']'); + + /** + * Checks if `string` contains Unicode symbols. + * + * @private + * @param {string} string The string to inspect. + * @returns {boolean} Returns `true` if a symbol is found, else `false`. + */ + function hasUnicode(string) { + return reHasUnicode.test(string); + } + + /** Used to compose unicode character classes. */ + var rsAstralRange$1 = '\\ud800-\\udfff'; + var rsComboMarksRange$1 = '\\u0300-\\u036f\\ufe20-\\ufe23'; + var rsComboSymbolsRange$1 = '\\u20d0-\\u20f0'; + var rsVarRange$1 = '\\ufe0e\\ufe0f'; + var rsAstral = '[' + rsAstralRange$1 + ']'; + var rsCombo = '[' + rsComboMarksRange$1 + rsComboSymbolsRange$1 + ']'; var rsFitz = '\\ud83c[\\udffb-\\udfff]'; var rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')'; - var rsNonAstral = '[^' + rsAstralRange + ']'; + var rsNonAstral = '[^' + rsAstralRange$1 + ']'; var rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}'; var rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]'; - var rsZWJ = '\\u200d'; + var rsZWJ$1 = '\\u200d'; var reOptMod = rsModifier + '?'; - var rsOptVar = '[' + rsVarRange + ']?'; - var rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*'; + var rsOptVar = '[' + rsVarRange$1 + ']?'; + var rsOptJoin = '(?:' + rsZWJ$1 + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*'; var rsSeq = rsOptVar + reOptMod + rsOptJoin; var rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')'; /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */ - var reComplexSymbol = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g'); + var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g'); + + /** + * Converts a Unicode `string` to an array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the converted array. + */ + function unicodeToArray(string) { + return string.match(reUnicode) || []; + } /** * Converts `string` to an array. @@ -1893,7 +2055,9 @@ * @returns {Array} Returns the converted array. */ function stringToArray(string) { - return string.match(reComplexSymbol); + return hasUnicode(string) + ? unicodeToArray(string) + : asciiToArray(string); } /** @@ -1904,8 +2068,8 @@ * @memberOf _ * @since 4.0.0 * @category Lang - * @param {*} value The value to process. - * @returns {string} Returns the string. + * @param {*} value The value to convert. + * @returns {string} Returns the converted string. * @example * * _.toString(null); @@ -1922,7 +2086,7 @@ } /** Used to match leading and trailing whitespace. */ - var reTrim$1 = /^\s+|\s+$/g; + var reTrim = /^\s+|\s+$/g; /** * Removes leading and trailing whitespace or specified characters from `string`. @@ -1949,7 +2113,7 @@ function trim(string, chars, guard) { string = toString(string); if (string && (guard || chars === undefined)) { - return string.replace(reTrim$1, ''); + return string.replace(reTrim, ''); } if (!string || !(chars = baseToString(chars))) { return string; @@ -2104,7 +2268,7 @@ } function wrap(defer) { - return rest(function (fn, args) { + return baseRest(function (fn, args) { defer(function () { fn.apply(null, args); }); @@ -2201,9 +2365,10 @@ q.drain(); }); } - arrayEach(data, function (task) { + + for (var i = 0, l = data.length; i < l; i++) { var item = { - data: task, + data: data[i], callback: callback || noop }; @@ -2212,28 +2377,27 @@ } else { q._tasks.push(item); } - }); + } setImmediate$1(q.process); } function _next(tasks) { - return rest(function (args) { + return baseRest(function (args) { workers -= 1; - arrayEach(tasks, function (task) { - arrayEach(workersList, function (worker, index) { - if (worker === task) { - workersList.splice(index, 1); - return false; - } - }); + for (var i = 0, l = tasks.length; i < l; i++) { + var task = tasks[i]; + var index = baseIndexOf(workersList, task, 0); + if (index >= 0) { + workersList.splice(index); + } task.callback.apply(task, args); if (args[0] != null) { q.error(args[0], task.data); } - }); + } if (workers <= q.concurrency - q.buffer) { q.unsaturated(); @@ -2520,8 +2684,8 @@ * }); * }); */ - var seq = rest(function seq(functions) { - return rest(function (args) { + var seq = baseRest(function seq(functions) { + return baseRest(function (args) { var that = this; var cb = args[args.length - 1]; @@ -2532,7 +2696,7 @@ } reduce(functions, args, function (newargs, fn, cb) { - fn.apply(that, newargs.concat([rest(function (err, nextargs) { + fn.apply(that, newargs.concat([baseRest(function (err, nextargs) { cb(err, nextargs); })])); }, function (err, results) { @@ -2576,7 +2740,7 @@ * // result now equals 15 * }); */ - var compose = rest(function (args) { + var compose = baseRest(function (args) { return seq.apply(null, args.reverse()); }); @@ -2690,33 +2854,13 @@ * //... * }, callback); */ - var constant = rest(function (values) { + var constant$1 = baseRest(function (values) { var args = [null].concat(values); return initialParams(function (ignoredArgs, callback) { return callback.apply(this, args); }); }); - /** - * This method returns the first argument given to it. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Util - * @param {*} value Any value. - * @returns {*} Returns `value`. - * @example - * - * var object = { 'user': 'fred' }; - * - * console.log(_.identity(object) === object); - * // => true - */ - function identity(value) { - return value; - } - function _createTester(eachfn, check, getResult) { return function (arr, limit, iteratee, cb) { function done(err) { @@ -2843,8 +2987,8 @@ var detectSeries = _createTester(eachOfSeries, identity, _findGetResult); function consoleFunc(name) { - return rest(function (fn, args) { - fn.apply(null, args.concat([rest(function (err, args) { + return baseRest(function (fn, args) { + fn.apply(null, args.concat([baseRest(function (err, args) { if (typeof console === 'object') { if (err) { if (console.error) { @@ -2914,7 +3058,7 @@ function doDuring(fn, test, callback) { callback = onlyOnce(callback || noop); - var next = rest(function (err, args) { + var next = baseRest(function (err, args) { if (err) return callback(err); args.push(check); test.apply(this, args); @@ -2945,8 +3089,8 @@ * passes. The function is passed a `callback(err)`, which must be called once * it has completed with an optional `err` argument. Invoked with (callback). * @param {Function} test - synchronous truth test to perform after each - * execution of `iteratee`. Invoked with Invoked with the non-error callback - * results of `iteratee`. + * execution of `iteratee`. Invoked with the non-error callback results of + * `iteratee`. * @param {Function} [callback] - A callback which is called after the test * function has failed and repeated execution of `iteratee` has stopped. * `callback` will be passed an error and any arguments passed to the final @@ -2954,7 +3098,7 @@ */ function doWhilst(iteratee, test, callback) { callback = onlyOnce(callback || noop); - var next = rest(function (err, args) { + var next = baseRest(function (err, args) { if (err) return callback(err); if (test.apply(this, args)) return iteratee(next); callback.apply(null, [null].concat(args)); @@ -3121,7 +3265,7 @@ * @see [async.each]{@link module:Collections.each} * @alias forEachLimit * @category Collection - * @param {Array|Iterable|Object} coll - A colleciton to iterate over. + * @param {Array|Iterable|Object} coll - A collection to iterate over. * @param {number} limit - The maximum number of async operations at a time. * @param {Function} iteratee - A function to apply to each item in `coll`. The * iteratee is passed a `callback(err)` which must be called once it has @@ -3287,6 +3431,19 @@ */ var everySeries = doLimit(everyLimit, 1); + /** + * The base implementation of `_.property` without support for deep paths. + * + * @private + * @param {string} key The key of the property to get. + * @returns {Function} Returns the new accessor function. + */ + function baseProperty(key) { + return function(object) { + return object == null ? undefined : object[key]; + }; + } + function _filter(eachfn, arr, iteratee, callback) { callback = once(callback || noop); var results = []; @@ -3605,7 +3762,7 @@ queues[key].push(callback); } else { queues[key] = [callback]; - fn.apply(null, args.concat([rest(function (args) { + fn.apply(null, args.concat([baseRest(function (args) { memo[key] = args; var q = queues[key]; delete queues[key]; @@ -3668,7 +3825,7 @@ var results = isArrayLike(tasks) ? [] : {}; eachfn(tasks, function (task, key, callback) { - task(rest(function (err, args) { + task(baseRest(function (err, args) { if (args.length <= 1) { args = args[0]; } @@ -3931,9 +4088,9 @@ nextNode = nextNode.next; } - arrayEach(data, function (task) { + for (var i = 0, l = data.length; i < l; i++) { var item = { - data: task, + data: data[i], priority: priority, callback: callback }; @@ -3943,7 +4100,7 @@ } else { q._tasks.push(item); } - }); + } setImmediate$1(q.process); }; @@ -3955,7 +4112,7 @@ /** * Runs the `tasks` array of functions in parallel, without waiting until the - * previous function has completed. Once any the `tasks` completed or pass an + * previous function has completed. Once any of the `tasks` complete or pass an * error to its callback, the main `callback` is immediately called. It's * equivalent to `Promise.race()`. * @@ -3994,9 +4151,9 @@ callback = once(callback || noop); if (!isArray(tasks)) return callback(new TypeError('First argument to race must be an array of functions')); if (!tasks.length) return callback(); - arrayEach(tasks, function (task) { - task(callback); - }); + for (var i = 0, l = tasks.length; i < l; i++) { + tasks[i](callback); + } } var slice = Array.prototype.slice; @@ -4069,7 +4226,7 @@ */ function reflect(fn) { return initialParams(function reflectOn(args, reflectCallback) { - args.push(rest(function callback(err, cbArgs) { + args.push(baseRest(function callback(err, cbArgs) { if (err) { reflectCallback(null, { error: err @@ -4248,31 +4405,6 @@ */ var rejectSeries = doLimit(rejectLimit, 1); - /** - * Creates a function that returns `value`. - * - * @static - * @memberOf _ - * @since 2.4.0 - * @category Util - * @param {*} value The value to return from the new function. - * @returns {Function} Returns the new constant function. - * @example - * - * var objects = _.times(2, _.constant({ 'a': 1 })); - * - * console.log(objects); - * // => [{ 'a': 1 }, { 'a': 1 }] - * - * console.log(objects[0] === objects[1]); - * // => true - */ - function constant$1(value) { - return function() { - return value; - }; - } - /** * Attempts to get a successful response from `task` no more than `times` times * before returning an error. If the task is successful, the `callback` will be @@ -4291,6 +4423,11 @@ * * `interval` - The time to wait between retries, in milliseconds. The * default is `0`. The interval may also be specified as a function of the * retry count (see example). + * * `errorFilter` - An optional synchronous function that is invoked on + * erroneous result. If it returns `true` the retry attempts will continue; + * if the function returns `false` the retry flow is aborted with the current + * attempt's error and result being returned to the final callback. + * Invoked with (err). * * If `opts` is a number, the number specifies the number of times to retry, * with the default interval of `0`. * @param {Function} task - A function which receives two arguments: (1) a @@ -4334,6 +4471,16 @@ * // do something with the result * }); * + * // try calling apiMethod only when error condition satisfies, all other + * // errors will abort the retry control flow and return to final callback + * async.retry({ + * errorFilter: function(err) { + * return err.message === 'Temporary error'; // only retry on a specific error + * } + * }, apiMethod, function(err, result) { + * // do something with the result + * }); + * * // It can also be embedded within other control flow functions to retry * // individual methods that are not as reliable, like this: * async.auto({ @@ -4342,6 +4489,7 @@ * }, function(err, results) { * // do something with the results * }); + * */ function retry(opts, task, callback) { var DEFAULT_TIMES = 5; @@ -4349,14 +4497,16 @@ var options = { times: DEFAULT_TIMES, - intervalFunc: constant$1(DEFAULT_INTERVAL) + intervalFunc: constant(DEFAULT_INTERVAL) }; function parseTimes(acc, t) { if (typeof t === 'object') { acc.times = +t.times || DEFAULT_TIMES; - acc.intervalFunc = typeof t.interval === 'function' ? t.interval : constant$1(+t.interval || DEFAULT_INTERVAL); + acc.intervalFunc = typeof t.interval === 'function' ? t.interval : constant(+t.interval || DEFAULT_INTERVAL); + + acc.errorFilter = t.errorFilter; } else if (typeof t === 'number' || typeof t === 'string') { acc.times = +t || DEFAULT_TIMES; } else { @@ -4379,7 +4529,7 @@ var attempt = 1; function retryAttempt() { task(function (err) { - if (err && attempt++ < options.times) { + if (err && attempt++ < options.times && (typeof options.errorFilter != 'function' || options.errorFilter(err))) { setTimeout(retryAttempt, options.intervalFunc(attempt)); } else { callback.apply(null, arguments); @@ -4653,12 +4803,31 @@ * @param {*} [info] - Any variable you want attached (`string`, `object`, etc) * to timeout Error for more information.. * @returns {Function} Returns a wrapped function that can be used with any of - * the control flow functions. + * the control flow functions. Invoke this function with the same + * parameters as you would `asyncFunc`. * @example * - * async.timeout(function(callback) { - * doAsyncTask(callback); - * }, 1000); + * function myFunction(foo, callback) { + * doAsyncTask(foo, function(err, data) { + * // handle errors + * if (err) return callback(err); + * + * // do some stuff ... + * + * // return processed data + * return callback(null, data); + * }); + * } + * + * var wrapped = async.timeout(myFunction, 1000); + * + * // call `wrapped` as you would `myFunction` + * wrapped({ bar: 'bar' }, function(err, data) { + * // if `myFunction` takes < 1000 ms to execute, `err` + * // and `data` will have their expected values + * + * // else `err` will be an Error with the code 'ETIMEDOUT' + * }); */ function timeout(asyncFn, milliseconds, info) { var originalCallback, timer; @@ -4695,7 +4864,7 @@ var nativeMax$1 = Math.max; /** * The base implementation of `_.range` and `_.rangeRight` which doesn't - * coerce arguments to numbers. + * coerce arguments. * * @private * @param {number} start The start of the range. @@ -4866,7 +5035,7 @@ } /** - * Repeatedly call `fn`, while `test` returns `true`. Calls `callback` when + * Repeatedly call `iteratee`, while `test` returns `true`. Calls `callback` when * stopped, or an error occurs. * * @name whilst @@ -4875,13 +5044,13 @@ * @method * @category Control Flow * @param {Function} test - synchronous truth test to perform before each - * execution of `fn`. Invoked with (). + * execution of `iteratee`. Invoked with (). * @param {Function} iteratee - A function which is called each time `test` passes. * The function is passed a `callback(err)`, which must be called once it has * completed with an optional `err` argument. Invoked with (callback). * @param {Function} [callback] - A callback which is called after the test - * function has failed and repeated execution of `fn` has stopped. `callback` - * will be passed an error and any arguments passed to the final `fn`'s + * function has failed and repeated execution of `iteratee` has stopped. `callback` + * will be passed an error and any arguments passed to the final `iteratee`'s * callback. Invoked with (err, [results]); * @returns undefined * @example @@ -4903,7 +5072,7 @@ function whilst(test, iteratee, callback) { callback = onlyOnce(callback || noop); if (!test()) return callback(null); - var next = rest(function (err, args) { + var next = baseRest(function (err, args) { if (err) return callback(err); if (test()) return iteratee(next); callback.apply(null, [null].concat(args)); @@ -5008,7 +5177,7 @@ return callback.apply(null, [null].concat(args)); } - var taskCallback = onlyOnce(rest(function (err, args) { + var taskCallback = onlyOnce(baseRest(function (err, args) { if (err) { return callback.apply(null, [err].concat(args)); } @@ -5035,7 +5204,7 @@ compose: compose, concat: concat, concatSeries: concatSeries, - constant: constant, + constant: constant$1, detect: detect, detectLimit: detectLimit, detectSeries: detectSeries, @@ -5127,7 +5296,7 @@ exports.compose = compose; exports.concat = concat; exports.concatSeries = concatSeries; - exports.constant = constant; + exports.constant = constant$1; exports.detect = detect; exports.detectLimit = detectLimit; exports.detectSeries = detectSeries; diff --git a/StockManMVC/node_modules/async/dist/async.min.js b/StockManMVC/node_modules/async/dist/async.min.js index 4d5d88a..58c40ef 100644 --- a/StockManMVC/node_modules/async/dist/async.min.js +++ b/StockManMVC/node_modules/async/dist/async.min.js @@ -1,2 +1,2 @@ -!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(n.async=n.async||{})}(this,function(n){"use strict";function t(n,t,e){var r=e.length;switch(r){case 0:return n.call(t);case 1:return n.call(t,e[0]);case 2:return n.call(t,e[0],e[1]);case 3:return n.call(t,e[0],e[1],e[2])}return n.apply(t,e)}function e(n){var t=typeof n;return!!n&&("object"==t||"function"==t)}function r(n){var t=e(n)?st.call(n):"";return t==ft||t==at}function u(n){return!!n&&"object"==typeof n}function i(n){return"symbol"==typeof n||u(n)&&vt.call(n)==pt}function o(n){if("number"==typeof n)return n;if(i(n))return yt;if(e(n)){var t=r(n.valueOf)?n.valueOf():n;n=e(t)?t+"":t}if("string"!=typeof n)return 0===n?n:+n;n=n.replace(mt,"");var u=gt.test(n);return u||bt.test(n)?St(n.slice(2),u?2:8):dt.test(n)?yt:+n}function c(n){if(!n)return 0===n?n:0;if(n=o(n),n===jt||n===-jt){var t=0>n?-1:1;return t*kt}return n===n?n:0}function f(n){var t=c(n),e=t%1;return t===t?e?t-e:t:0}function a(n,e){if("function"!=typeof n)throw new TypeError(wt);return e=Et(void 0===e?n.length-1:f(e),0),function(){for(var r=arguments,u=-1,i=Et(r.length-e,0),o=Array(i);++u-1&&n%1==0&&Lt>=n}function v(n){return null!=n&&h(xt(n))&&!r(n)}function y(){}function m(n){return function(){if(null!==n){var t=n;n=null,t.apply(this,arguments)}}}function d(n){return Ot&&n[Ot]&&n[Ot]()}function g(n){return At(Object(n))}function b(n,t){return null!=n&&(Tt.call(n,t)||"object"==typeof n&&t in n&&null===g(n))}function S(n){return _t(Object(n))}function j(n,t){for(var e=-1,r=Array(n);++e-1&&n%1==0&&t>n}function O(n){var t=n&&n.constructor,e="function"==typeof t&&t.prototype||Ut;return n===e}function A(n){var t=O(n);if(!t&&!v(n))return S(n);var e=x(n),r=!!e,u=e||[],i=u.length;for(var o in n)!b(n,o)||r&&("length"==o||L(o,i))||t&&"constructor"==o||u.push(o);return u}function I(n){var t=-1,e=n.length;return function(){return++te?{value:n[u],key:u}:null}}function F(n){if(v(n))return I(n);var t=d(n);return t?T(t):_(n)}function $(n){return function(){if(null===n)throw new Error("Callback was already called.");var t=n;n=null,t.apply(this,arguments)}}function z(n){return function(t,e,r){function u(n){if(f-=1,n)c=!0,r(n);else{if(c&&0>=f)return r(null);i()}}function i(){for(;n>f&&!c;){var t=o();if(null===t)return c=!0,void(0>=f&&r(null));f+=1,e(t.value,t.key,$(u))}}if(r=m(r||y),0>=n||!t)return r(null);var o=F(t),c=!1,f=0;i()}}function B(n,t,e,r){z(t)(n,e,r)}function M(n,t){return function(e,r,u){return n(e,t,r,u)}}function V(n,t){var e;if("function"!=typeof t)throw new TypeError(Nt);return n=f(n),function(){return--n>0&&(e=t.apply(this,arguments)),1>=n&&(t=void 0),e}}function q(n){return V(2,n)}function C(n,t,e){function r(n){n?e(n):++i===o&&e(null)}e=q(e||y);var u=0,i=0,o=n.length;for(0===o&&e(null);o>u;u++)t(n[u],u,$(r))}function D(n,t,e){var r=v(n)?C:Qt;r(n,t,e)}function P(n){return function(t,e,r){return n(D,t,e,r)}}function R(n,t,e,r){r=m(r||y),t=t||[];var u=[],i=0;n(t,function(n,t,r){var o=i++;e(n,function(n,t){u[o]=t,r(n)})},function(n){r(n,u)})}function U(n){return function(t,e,r,u){return n(z(e),t,r,u)}}function N(n){return l(function(t,r){var u;try{u=n.apply(this,t)}catch(i){return r(i)}e(u)&&"function"==typeof u.then?u.then(function(n){r(null,n)},function(n){r(n.message?n:new Error(n))}):r(null,u)})}function Q(n,t){for(var e=-1,r=n?n.length:0;++ev;){var n=b.shift();n()}}function i(n,t){var e=g[n];e||(e=g[n]=[]),e.push(t)}function o(n){var t=g[n]||[];Q(t,function(n){n()}),u()}function c(n,t){if(!d){var r=$(a(function(t,r){if(v--,r.length<=1&&(r=r[0]),t){var u={};G(h,function(n,t){u[t]=n}),u[n]=r,d=!0,g=[],e(t,u)}else h[n]=r,o(n)}));v++;var u=t[t.length-1];t.length>1?u(h,r):u(r)}}function f(){for(var n,t=0;S.length;)n=S.pop(),t++,Q(l(n),function(n){0===--j[n]&&S.push(n)});if(t!==p)throw new Error("async.auto cannot execute tasks due to a recursive dependency")}function l(t){var e=[];return G(n,function(n,r){Vt(n)&&J(n,t,0)>=0&&e.push(r)}),e}"function"==typeof t&&(e=t,t=null),e=m(e||y);var s=A(n),p=s.length;if(!p)return e(null);t||(t=p);var h={},v=0,d=!1,g={},b=[],S=[],j={};G(n,function(t,e){if(!Vt(t))return r(e,[t]),void S.push(e);var u=t.slice(0,t.length-1),o=u.length;return 0===o?(r(e,t),void S.push(e)):(j[e]=o,void Q(u,function(c){if(!n[c])throw new Error("async.auto task `"+e+"` has a non-existent dependency in "+u.join(", "));i(c,function(){o--,0===o&&r(e,t)})}))}),f(),u()}function X(n,t){for(var e=-1,r=n?n.length:0,u=Array(r);++et&&(t=-t>u?0:u+t),e=e>u?u:e,0>e&&(e+=u),u=t>e?0:e-t>>>0,t>>>=0;for(var i=Array(u);++r=r?n:tn(n,t,e)}function rn(n,t){for(var e=n.length;e--&&J(t,n[e],0)>-1;);return e}function un(n,t){for(var e=-1,r=n.length;++e-1;);return e}function on(n){return n.match(Ee)}function cn(n){return null==n?"":nn(n)}function fn(n,t,e){if(n=cn(n),n&&(e||void 0===t))return n.replace(xe,"");if(!n||!(t=nn(t)))return n;var r=on(n),u=on(t),i=un(r,u),o=rn(r,u)+1;return en(r,i,o).join("")}function an(n){return n=n.toString().replace(Ie,""),n=n.match(Le)[2].replace(" ",""),n=n?n.split(Oe):[],n=n.map(function(n){return fn(n.replace(Ae,""))})}function ln(n,t){var e={};G(n,function(n,t){function r(t,e){var r=X(u,function(n){return t[n]});r.push(e),n.apply(null,r)}var u;if(Vt(n))u=Y(n),n=u.pop(),e[t]=u.concat(u.length>0?r:n);else if(1===n.length)e[t]=n;else{if(u=an(n),0===n.length&&0===u.length)throw new Error("autoInject task functions require explicit parameters.");u.pop(),e[t]=u.concat(r)}}),K(e,t)}function sn(n){setTimeout(n,0)}function pn(n){return a(function(t,e){n(function(){t.apply(null,e)})})}function hn(){this.head=this.tail=null,this.length=0}function vn(n,t){n.length=1,n.head=n.tail=t}function yn(n,t,e){function r(n,t,e){if(null!=e&&"function"!=typeof e)throw new Error("task callback must be a function");return c.started=!0,Vt(n)||(n=[n]),0===n.length&&c.idle()?Fe(function(){c.drain()}):(Q(n,function(n){var r={data:n,callback:e||y};t?c._tasks.unshift(r):c._tasks.push(r)}),void Fe(c.process))}function u(n){return a(function(t){i-=1,Q(n,function(n){Q(o,function(t,e){return t===n?(o.splice(e,1),!1):void 0}),n.callback.apply(n,t),null!=t[0]&&c.error(t[0],n.data)}),i<=c.concurrency-c.buffer&&c.unsaturated(),c.idle()&&c.drain(),c.process()})}if(null==t)t=1;else if(0===t)throw new Error("Concurrency must not be zero");var i=0,o=[],c={_tasks:new hn,concurrency:t,payload:e,saturated:y,unsaturated:y,buffer:t/4,empty:y,drain:y,error:y,started:!1,paused:!1,push:function(n,t){r(n,!1,t)},kill:function(){c.drain=y,c._tasks.empty()},unshift:function(n,t){r(n,!0,t)},process:function(){for(;!c.paused&&if;f++){var a=c._tasks.shift();t.push(a),e.push(a.data)}0===c._tasks.length&&c.empty(),i+=1,o.push(t[0]),i===c.concurrency&&c.saturated();var l=$(u(t));n(e,l)}},length:function(){return c._tasks.length},running:function(){return i},workersList:function(){return o},idle:function(){return c._tasks.length+i===0},pause:function(){c.paused=!0},resume:function(){if(c.paused!==!1){c.paused=!1;for(var n=Math.min(c.concurrency,c._tasks.length),t=1;n>=t;t++)Fe(c.process)}}};return c}function mn(n,t){return yn(n,1,t)}function dn(n,t,e,r){r=m(r||y),ze(n,function(n,r,u){e(t,n,function(n,e){t=e,u(n)})},function(n){r(n,t)})}function gn(n,t,e,r){var u=[];n(t,function(n,t,r){e(n,function(n,t){u=u.concat(t||[]),r(n)})},function(n){r(n,u)})}function bn(n){return function(t,e,r){return n(ze,t,e,r)}}function Sn(n){return n}function jn(n,t,e){return function(r,u,i,o){function c(n){o&&(n?o(n):o(null,e(!1)))}function f(n,r,u){return o?void i(n,function(r,c){o&&(r?(o(r),o=i=!1):t(c)&&(o(null,e(!0,n)),o=i=!1)),u()}):u()}arguments.length>3?(o=o||y,n(r,u,f,c)):(o=i,o=o||y,i=u,n(r,f,c))}}function kn(n,t){return t}function wn(n){return a(function(t,e){t.apply(null,e.concat([a(function(t,e){"object"==typeof console&&(t?console.error&&console.error(t):console[n]&&Q(e,function(t){console[n](t)}))})]))})}function En(n,t,e){function r(t,r){return t?e(t):r?void n(u):e(null)}e=$(e||y);var u=a(function(n,u){return n?e(n):(u.push(r),void t.apply(this,u))});r(null,!0)}function xn(n,t,e){e=$(e||y);var r=a(function(u,i){return u?e(u):t.apply(this,i)?n(r):void e.apply(null,[null].concat(i))});n(r)}function Ln(n,t,e){xn(n,function(){return!t.apply(this,arguments)},e)}function On(n,t,e){function r(t){return t?e(t):void n(u)}function u(n,u){return n?e(n):u?void t(r):e(null)}e=$(e||y),n(u)}function An(n){return function(t,e,r){return n(t,r)}}function In(n,t,e){D(n,An(t),e)}function Tn(n,t,e,r){z(t)(n,An(e),r)}function _n(n){return l(function(t,e){var r=!0;t.push(function(){var n=arguments;r?Fe(function(){e.apply(null,n)}):e.apply(null,n)}),n.apply(this,t),r=!1})}function Fn(n){return!n}function $n(n,t,e,r){r=m(r||y);var u=[];n(t,function(n,t,r){e(n,function(e,i){e?r(e):(i&&u.push({index:t,value:n}),r())})},function(n){n?r(n):r(null,X(u.sort(function(n,t){return n.index-t.index}),p("value")))})}function zn(n,t){function e(n){return n?r(n):void u(e)}var r=$(t||y),u=_n(n);e()}function Bn(n,t,e,r){r=m(r||y);var u={};B(n,t,function(n,t,r){e(n,t,function(n,e){return n?r(n):(u[t]=e,void r())})},function(n){r(n,u)})}function Mn(n,t){return t in n}function Vn(n,t){var e=Object.create(null),r=Object.create(null);t=t||Sn;var u=l(function(u,i){var o=t.apply(null,u);Mn(e,o)?Fe(function(){i.apply(null,e[o])}):Mn(r,o)?r[o].push(i):(r[o]=[i],n.apply(null,u.concat([a(function(n){e[o]=n;var t=r[o];delete r[o];for(var u=0,i=t.length;i>u;u++)t[u].apply(null,n)})])))});return u.memo=e,u.unmemoized=n,u}function qn(n,t,e){e=e||y;var r=v(t)?[]:{};n(t,function(n,t,e){n(a(function(n,u){u.length<=1&&(u=u[0]),r[t]=u,e(n)}))},function(n){e(n,r)})}function Cn(n,t){qn(D,n,t)}function Dn(n,t,e){qn(z(t),n,e)}function Pn(n,t){return yn(function(t,e){n(t[0],e)},t,1)}function Rn(n,t){var e=Pn(n,t);return e.push=function(n,t,r){if(null==r&&(r=y),"function"!=typeof r)throw new Error("task callback must be a function");if(e.started=!0,Vt(n)||(n=[n]),0===n.length)return Fe(function(){e.drain()});t=t||0;for(var u=e._tasks.head;u&&t>=u.priority;)u=u.next;Q(n,function(n){var i={data:n,priority:t,callback:r};u?e._tasks.insertBefore(u,i):e._tasks.push(i)}),Fe(e.process)},delete e.unshift,e}function Un(n,t){return t=m(t||y),Vt(n)?n.length?void Q(n,function(n){n(t)}):t():t(new TypeError("First argument to race must be an array of functions"))}function Nn(n,t,e,r){var u=tr.call(n).reverse();dn(u,t,e,r)}function Qn(n){return l(function(t,e){return t.push(a(function(n,t){if(n)e(null,{error:n});else{var r=null;1===t.length?r=t[0]:t.length>1&&(r=t),e(null,{value:r})}})),n.apply(this,t)})}function Wn(n,t,e,r){$n(n,t,function(n,t){e(n,function(n,e){n?t(n):t(null,!e)})},r)}function Gn(n){var t;return Vt(n)?t=X(n,Qn):(t={},G(n,function(n,e){t[e]=Qn.call(this,n)})),t}function Hn(n){return function(){return n}}function Jn(n,t,e){function r(n,t){if("object"==typeof t)n.times=+t.times||i,n.intervalFunc="function"==typeof t.interval?t.interval:Hn(+t.interval||o);else{if("number"!=typeof t&&"string"!=typeof t)throw new Error("Invalid arguments for async.retry");n.times=+t||i}}function u(){t(function(n){n&&f++e?-1:e>r?1:0}Wt(n,function(n,e){t(n,function(t,r){return t?e(t):void e(null,{value:n,criteria:r})})},function(n,t){return n?e(n):void e(null,X(t.sort(r),p("value")))})}function Zn(n,t,e){function r(){c||(i.apply(null,arguments),clearTimeout(o))}function u(){var t=n.name||"anonymous",r=new Error('Callback function "'+t+'" timed out.');r.code="ETIMEDOUT",e&&(r.info=e),c=!0,i(r)}var i,o,c=!1;return l(function(e,c){i=c,o=setTimeout(u,t),n.apply(null,e.concat(r))})}function nt(n,t,e,r){for(var u=-1,i=ar(fr((t-n)/(e||1)),0),o=Array(i);i--;)o[r?i:++u]=n,n+=e;return o}function tt(n,t,e,r){Ht(nt(0,n,1),t,e,r)}function et(n,t,e,r){3===arguments.length&&(r=e,e=t,t=Vt(n)?[]:{}),r=m(r||y),D(n,function(n,r,u){e(t,n,r,u)},function(n){r(n,t)})}function rt(n){return function(){return(n.unmemoized||n).apply(null,arguments)}}function ut(n,t,e){if(e=$(e||y),!n())return e(null);var r=a(function(u,i){return u?e(u):n()?t(r):void e.apply(null,[null].concat(i))});t(r)}function it(n,t,e){ut(function(){return!n.apply(this,arguments)},t,e)}function ot(n,t){function e(u){if(r===n.length)return t.apply(null,[null].concat(u));var i=$(a(function(n,r){return n?t.apply(null,[n].concat(r)):void e(r)}));u.push(i);var o=n[r++];o.apply(null,u)}if(t=m(t||y),!Vt(n))return t(new Error("First argument to waterfall must be an array of functions"));if(!n.length)return t();var r=0;e([])}var ct,ft="[object Function]",at="[object GeneratorFunction]",lt=Object.prototype,st=lt.toString,pt="[object Symbol]",ht=Object.prototype,vt=ht.toString,yt=NaN,mt=/^\s+|\s+$/g,dt=/^[-+]0x[0-9a-f]+$/i,gt=/^0b[01]+$/i,bt=/^0o[0-7]+$/i,St=parseInt,jt=1/0,kt=1.7976931348623157e308,wt="Expected a function",Et=Math.max,xt=p("length"),Lt=9007199254740991,Ot="function"==typeof Symbol&&Symbol.iterator,At=Object.getPrototypeOf,It=Object.prototype,Tt=It.hasOwnProperty,_t=Object.keys,Ft="[object Arguments]",$t=Object.prototype,zt=$t.hasOwnProperty,Bt=$t.toString,Mt=$t.propertyIsEnumerable,Vt=Array.isArray,qt="[object String]",Ct=Object.prototype,Dt=Ct.toString,Pt=9007199254740991,Rt=/^(?:0|[1-9]\d*)$/,Ut=Object.prototype,Nt="Expected a function",Qt=M(B,1/0),Wt=P(R),Gt=s(Wt),Ht=U(R),Jt=M(Ht,1),Kt=s(Jt),Xt=a(function(n,t){return a(function(e){return n.apply(null,t.concat(e))})}),Yt=W(),Zt=Z("object"==typeof global&&global),ne=Z("object"==typeof self&&self),te=Z("object"==typeof this&&this),ee=Zt||ne||te||Function("return this")(),re=ee.Symbol,ue=1/0,ie=re?re.prototype:void 0,oe=ie?ie.toString:void 0,ce="\\ud800-\\udfff",fe="\\u0300-\\u036f\\ufe20-\\ufe23",ae="\\u20d0-\\u20f0",le="\\ufe0e\\ufe0f",se="["+ce+"]",pe="["+fe+ae+"]",he="\\ud83c[\\udffb-\\udfff]",ve="(?:"+pe+"|"+he+")",ye="[^"+ce+"]",me="(?:\\ud83c[\\udde6-\\uddff]){2}",de="[\\ud800-\\udbff][\\udc00-\\udfff]",ge="\\u200d",be=ve+"?",Se="["+le+"]?",je="(?:"+ge+"(?:"+[ye,me,de].join("|")+")"+Se+be+")*",ke=Se+be+je,we="(?:"+[ye+pe+"?",pe,me,de,se].join("|")+")",Ee=RegExp(he+"(?="+he+")|"+we+ke,"g"),xe=/^\s+|\s+$/g,Le=/^(function)?\s*[^\(]*\(\s*([^\)]*)\)/m,Oe=/,/,Ae=/(=.+)?(\s*)$/,Ie=/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/gm,Te="function"==typeof setImmediate&&setImmediate,_e="object"==typeof process&&"function"==typeof process.nextTick;ct=Te?setImmediate:_e?process.nextTick:sn;var Fe=pn(ct);hn.prototype.removeLink=function(n){return n.prev?n.prev.next=n.next:this.head=n.next,n.next?n.next.prev=n.prev:this.tail=n.prev,n.prev=n.next=null,this.length-=1,n},hn.prototype.empty=hn,hn.prototype.insertAfter=function(n,t){t.prev=n,t.next=n.next,n.next?n.next.prev=t:this.tail=t,n.next=t,this.length+=1},hn.prototype.insertBefore=function(n,t){t.prev=n.prev,t.next=n,n.prev?n.prev.next=t:this.head=t,n.prev=t,this.length+=1},hn.prototype.unshift=function(n){this.head?this.insertBefore(this.head,n):vn(this,n)},hn.prototype.push=function(n){this.tail?this.insertAfter(this.tail,n):vn(this,n)},hn.prototype.shift=function(){return this.head&&this.removeLink(this.head)},hn.prototype.pop=function(){return this.tail&&this.removeLink(this.tail)};var $e,ze=M(B,1),Be=a(function(n){return a(function(t){var e=this,r=t[t.length-1];"function"==typeof r?t.pop():r=y,dn(n,t,function(n,t,r){t.apply(e,n.concat([a(function(n,t){r(n,t)})]))},function(n,t){r.apply(e,[n].concat(t))})})}),Me=a(function(n){return Be.apply(null,n.reverse())}),Ve=P(gn),qe=bn(gn),Ce=a(function(n){var t=[null].concat(n);return l(function(n,e){return e.apply(this,t)})}),De=jn(D,Sn,kn),Pe=jn(B,Sn,kn),Re=jn(ze,Sn,kn),Ue=wn("dir"),Ne=M(Tn,1),Qe=jn(D,Fn,Fn),We=jn(B,Fn,Fn),Ge=M(We,1),He=P($n),Je=U($n),Ke=M(Je,1),Xe=wn("log"),Ye=M(Bn,1/0),Ze=M(Bn,1);$e=_e?process.nextTick:Te?setImmediate:sn;var nr=pn($e),tr=Array.prototype.slice,er=P(Wn),rr=U(Wn),ur=M(rr,1),ir=jn(D,Boolean,Sn),or=jn(B,Boolean,Sn),cr=M(or,1),fr=Math.ceil,ar=Math.max,lr=M(tt,1/0),sr=M(tt,1),pr={applyEach:Gt,applyEachSeries:Kt,apply:Xt,asyncify:N,auto:K,autoInject:ln,cargo:mn,compose:Me,concat:Ve,concatSeries:qe,constant:Ce,detect:De,detectLimit:Pe,detectSeries:Re,dir:Ue,doDuring:En,doUntil:Ln,doWhilst:xn,during:On,each:In,eachLimit:Tn,eachOf:D,eachOfLimit:B,eachOfSeries:ze,eachSeries:Ne,ensureAsync:_n,every:Qe,everyLimit:We,everySeries:Ge,filter:He,filterLimit:Je,filterSeries:Ke,forever:zn,log:Xe,map:Wt,mapLimit:Ht,mapSeries:Jt,mapValues:Ye,mapValuesLimit:Bn,mapValuesSeries:Ze,memoize:Vn,nextTick:nr,parallel:Cn,parallelLimit:Dn,priorityQueue:Rn,queue:Pn,race:Un,reduce:dn,reduceRight:Nn,reflect:Qn,reflectAll:Gn,reject:er,rejectLimit:rr,rejectSeries:ur,retry:Jn,retryable:Kn,seq:Be,series:Xn,setImmediate:Fe,some:ir,someLimit:or,someSeries:cr,sortBy:Yn,timeout:Zn,times:lr,timesLimit:tt,timesSeries:sr,transform:et,unmemoize:rt,until:it,waterfall:ot,whilst:ut,all:Qe,any:ir,forEach:In,forEachSeries:Ne,forEachLimit:Tn,forEachOf:D,forEachOfSeries:ze,forEachOfLimit:B,inject:dn,foldl:dn,foldr:Nn,select:He,selectLimit:Je,selectSeries:Ke,wrapSync:N};n["default"]=pr,n.applyEach=Gt,n.applyEachSeries=Kt,n.apply=Xt,n.asyncify=N,n.auto=K,n.autoInject=ln,n.cargo=mn,n.compose=Me,n.concat=Ve,n.concatSeries=qe,n.constant=Ce,n.detect=De,n.detectLimit=Pe,n.detectSeries=Re,n.dir=Ue,n.doDuring=En,n.doUntil=Ln,n.doWhilst=xn,n.during=On,n.each=In,n.eachLimit=Tn,n.eachOf=D,n.eachOfLimit=B,n.eachOfSeries=ze,n.eachSeries=Ne,n.ensureAsync=_n,n.every=Qe,n.everyLimit=We,n.everySeries=Ge,n.filter=He,n.filterLimit=Je,n.filterSeries=Ke,n.forever=zn,n.log=Xe,n.map=Wt,n.mapLimit=Ht,n.mapSeries=Jt,n.mapValues=Ye,n.mapValuesLimit=Bn,n.mapValuesSeries=Ze,n.memoize=Vn,n.nextTick=nr,n.parallel=Cn,n.parallelLimit=Dn,n.priorityQueue=Rn,n.queue=Pn,n.race=Un,n.reduce=dn,n.reduceRight=Nn,n.reflect=Qn,n.reflectAll=Gn,n.reject=er,n.rejectLimit=rr,n.rejectSeries=ur,n.retry=Jn,n.retryable=Kn,n.seq=Be,n.series=Xn,n.setImmediate=Fe,n.some=ir,n.someLimit=or,n.someSeries=cr,n.sortBy=Yn,n.timeout=Zn,n.times=lr,n.timesLimit=tt,n.timesSeries=sr,n.transform=et,n.unmemoize=rt,n.until=it,n.waterfall=ot,n.whilst=ut,n.all=Qe,n.allLimit=We,n.allSeries=Ge,n.any=ir,n.anyLimit=or,n.anySeries=cr,n.find=De,n.findLimit=Pe,n.findSeries=Re,n.forEach=In,n.forEachSeries=Ne,n.forEachLimit=Tn,n.forEachOf=D,n.forEachOfSeries=ze,n.forEachOfLimit=B,n.inject=dn,n.foldl=dn,n.foldr=Nn,n.select=He,n.selectLimit=Je,n.selectSeries=Ke,n.wrapSync=N}); +!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(n.async=n.async||{})}(this,function(n){"use strict";function t(n){return n}function e(n,t,e){switch(e.length){case 0:return n.call(t);case 1:return n.call(t,e[0]);case 2:return n.call(t,e[0],e[1]);case 3:return n.call(t,e[0],e[1],e[2])}return n.apply(t,e)}function r(n,t,r){return t=ht(void 0===t?n.length-1:t,0),function(){for(var u=arguments,o=-1,i=ht(u.length-t,0),c=Array(i);++o0){if(++t>=Mt)return arguments[0]}else t=0;return n.apply(void 0,arguments)}}function h(n,e){return Rt(r(n,e,t),n+"")}function y(n){return h(function(t){var e=t.pop();n.call(this,t,e)})}function v(n){return h(function(t,e){var r=y(function(e,r){var u=this;return n(t,function(n,t){n.apply(u,e.concat([t]))},r)});return e.length?r.apply(this,e):r})}function m(n){return"number"==typeof n&&n>-1&&n%1==0&&Ut>=n}function d(n){return null!=n&&m(n.length)&&!i(n)}function g(){}function b(n){return function(){if(null!==n){var t=n;n=null,t.apply(this,arguments)}}}function j(n){return Vt&&n[Vt]&&n[Vt]()}function S(n,t){for(var e=-1,r=Array(n);++e-1&&n%1==0&&t>n}function E(n){return k(n)&&m(n.length)&&!!Le[Te.call(n)]}function L(n){return function(t){return n(t)}}function A(n,t){var e=Ht(n),r=!e&&Nt(n),u=!e&&!r&&ne(n),o=!e&&!r&&!u&&ze(n),i=e||r||u||o,c=i?S(n.length,String):[],f=c.length;for(var a in n)!t&&!Ue.call(n,a)||i&&("length"==a||u&&("offset"==a||"parent"==a)||o&&("buffer"==a||"byteLength"==a||"byteOffset"==a)||x(a,f))||c.push(a);return c}function _(n){var t=n&&n.constructor,e="function"==typeof t&&t.prototype||Ve;return n===e}function T(n,t){return function(e){return n(t(e))}}function F(n){if(!_(n))return De(n);var t=[];for(var e in Object(n))Ce.call(n,e)&&"constructor"!=e&&t.push(e);return t}function I(n){return d(n)?A(n):F(n)}function B(n){var t=-1,e=n.length;return function(){return++te?{value:n[u],key:u}:null}}function P(n){if(d(n))return B(n);var t=j(n);return t?$(t):M(n)}function z(n){return function(){if(null===n)throw new Error("Callback was already called.");var t=n;n=null,t.apply(this,arguments)}}function R(n){return function(t,e,r){function u(n){if(f-=1,n)c=!0,r(n);else{if(c&&0>=f)return r(null);o()}}function o(){for(;n>f&&!c;){var t=i();if(null===t)return c=!0,void(0>=f&&r(null));f+=1,e(t.value,t.key,z(u))}}if(r=b(r||g),0>=n||!t)return r(null);var i=P(t),c=!1,f=0;o()}}function U(n,t,e,r){R(t)(n,e,r)}function V(n,t){return function(e,r,u){return n(e,t,r,u)}}function D(n,t,e){function r(n){n?e(n):++o===i&&e(null)}e=b(e||g);var u=0,o=0,i=n.length;for(0===i&&e(null);i>u;u++)t(n[u],u,z(r))}function q(n,t,e){var r=d(n)?D:We;r(n,t,e)}function C(n){return function(t,e,r){return n(q,t,e,r)}}function W(n,t,e,r){r=b(r||g),t=t||[];var u=[],o=0;n(t,function(n,t,r){var i=o++;e(n,function(n,t){u[i]=t,r(n)})},function(n){r(n,u)})}function Q(n){return function(t,e,r,u){return n(R(e),t,r,u)}}function G(n){return y(function(t,e){var r;try{r=n.apply(this,t)}catch(u){return e(u)}o(r)&&"function"==typeof r.then?r.then(function(n){e(null,n)},function(n){e(n.message?n:new Error(n))}):e(null,r)})}function N(n,t){for(var e=-1,r=n?n.length:0;++ey;){var n=d.shift();n()}}function o(n,t){var e=m[n];e||(e=m[n]=[]),e.push(t)}function i(n){var t=m[n]||[];N(t,function(n){n()}),u()}function c(n,t){if(!v){var r=z(h(function(t,r){if(y--,r.length<=1&&(r=r[0]),t){var u={};J(p,function(n,t){u[t]=n}),u[n]=r,v=!0,m=[],e(t,u)}else p[n]=r,i(n)}));y++;var u=t[t.length-1];t.length>1?u(p,r):u(r)}}function f(){for(var n,t=0;j.length;)n=j.pop(),t++,N(a(n),function(n){0===--S[n]&&j.push(n)});if(t!==s)throw new Error("async.auto cannot execute tasks due to a recursive dependency")}function a(t){var e=[];return J(n,function(n,r){Ht(n)&&Z(n,t,0)>=0&&e.push(r)}),e}"function"==typeof t&&(e=t,t=null),e=b(e||g);var l=I(n),s=l.length;if(!s)return e(null);t||(t=s);var p={},y=0,v=!1,m={},d=[],j=[],S={};J(n,function(t,e){if(!Ht(t))return r(e,[t]),void j.push(e);var u=t.slice(0,t.length-1),i=u.length;return 0===i?(r(e,t),void j.push(e)):(S[e]=i,void N(u,function(c){if(!n[c])throw new Error("async.auto task `"+e+"` has a non-existent dependency in "+u.join(", "));o(c,function(){i--,0===i&&r(e,t)})}))}),f(),u()}function tn(n,t){for(var e=-1,r=n?n.length:0,u=Array(r);++et&&(t=-t>u?0:u+t),e=e>u?u:e,0>e&&(e+=u),u=t>e?0:e-t>>>0,t>>>=0;for(var o=Array(u);++r=r?n:on(n,t,e)}function fn(n,t){for(var e=n.length;e--&&Z(t,n[e],0)>-1;);return e}function an(n,t){for(var e=-1,r=n.length;++e-1;);return e}function ln(n){return n.split("")}function sn(n){return lr.test(n)}function pn(n){return n.match(Ar)||[]}function hn(n){return sn(n)?pn(n):ln(n)}function yn(n){return null==n?"":un(n)}function vn(n,t,e){if(n=yn(n),n&&(e||void 0===t))return n.replace(_r,"");if(!n||!(t=un(t)))return n;var r=hn(n),u=hn(t),o=an(r,u),i=fn(r,u)+1;return cn(r,o,i).join("")}function mn(n){return n=n.toString().replace(Br,""),n=n.match(Tr)[2].replace(" ",""),n=n?n.split(Fr):[],n=n.map(function(n){return vn(n.replace(Ir,""))})}function dn(n,t){var e={};J(n,function(n,t){function r(t,e){var r=tn(u,function(n){return t[n]});r.push(e),n.apply(null,r)}var u;if(Ht(n))u=en(n),n=u.pop(),e[t]=u.concat(u.length>0?r:n);else if(1===n.length)e[t]=n;else{if(u=mn(n),0===n.length&&0===u.length)throw new Error("autoInject task functions require explicit parameters.");u.pop(),e[t]=u.concat(r)}}),nn(e,t)}function gn(n){setTimeout(n,0)}function bn(n){return h(function(t,e){n(function(){t.apply(null,e)})})}function jn(){this.head=this.tail=null,this.length=0}function Sn(n,t){n.length=1,n.head=n.tail=t}function kn(n,t,e){function r(n,t,e){if(null!=e&&"function"!=typeof e)throw new Error("task callback must be a function");if(c.started=!0,Ht(n)||(n=[n]),0===n.length&&c.idle())return Pr(function(){c.drain()});for(var r=0,u=n.length;u>r;r++){var o={data:n[r],callback:e||g};t?c._tasks.unshift(o):c._tasks.push(o)}Pr(c.process)}function u(n){return h(function(t){o-=1;for(var e=0,r=n.length;r>e;e++){var u=n[e],f=Z(i,u,0);f>=0&&i.splice(f),u.callback.apply(u,t),null!=t[0]&&c.error(t[0],u.data)}o<=c.concurrency-c.buffer&&c.unsaturated(),c.idle()&&c.drain(),c.process()})}if(null==t)t=1;else if(0===t)throw new Error("Concurrency must not be zero");var o=0,i=[],c={_tasks:new jn,concurrency:t,payload:e,saturated:g,unsaturated:g,buffer:t/4,empty:g,drain:g,error:g,started:!1,paused:!1,push:function(n,t){r(n,!1,t)},kill:function(){c.drain=g,c._tasks.empty()},unshift:function(n,t){r(n,!0,t)},process:function(){for(;!c.paused&&of;f++){var a=c._tasks.shift();t.push(a),e.push(a.data)}0===c._tasks.length&&c.empty(),o+=1,i.push(t[0]),o===c.concurrency&&c.saturated();var l=z(u(t));n(e,l)}},length:function(){return c._tasks.length},running:function(){return o},workersList:function(){return i},idle:function(){return c._tasks.length+o===0},pause:function(){c.paused=!0},resume:function(){if(c.paused!==!1){c.paused=!1;for(var n=Math.min(c.concurrency,c._tasks.length),t=1;n>=t;t++)Pr(c.process)}}};return c}function On(n,t){return kn(n,1,t)}function wn(n,t,e,r){r=b(r||g),Rr(n,function(n,r,u){e(t,n,function(n,e){t=e,u(n)})},function(n){r(n,t)})}function xn(n,t,e,r){var u=[];n(t,function(n,t,r){e(n,function(n,t){u=u.concat(t||[]),r(n)})},function(n){r(n,u)})}function En(n){return function(t,e,r){return n(Rr,t,e,r)}}function Ln(n,t,e){return function(r,u,o,i){function c(n){i&&(n?i(n):i(null,e(!1)))}function f(n,r,u){return i?void o(n,function(r,c){i&&(r?(i(r),i=o=!1):t(c)&&(i(null,e(!0,n)),i=o=!1)),u()}):u()}arguments.length>3?(i=i||g,n(r,u,f,c)):(i=o,i=i||g,o=u,n(r,f,c))}}function An(n,t){return t}function _n(n){return h(function(t,e){t.apply(null,e.concat([h(function(t,e){"object"==typeof console&&(t?console.error&&console.error(t):console[n]&&N(e,function(t){console[n](t)}))})]))})}function Tn(n,t,e){function r(t,r){return t?e(t):r?void n(u):e(null)}e=z(e||g);var u=h(function(n,u){return n?e(n):(u.push(r),void t.apply(this,u))});r(null,!0)}function Fn(n,t,e){e=z(e||g);var r=h(function(u,o){return u?e(u):t.apply(this,o)?n(r):void e.apply(null,[null].concat(o))});n(r)}function In(n,t,e){Fn(n,function(){return!t.apply(this,arguments)},e)}function Bn(n,t,e){function r(t){return t?e(t):void n(u)}function u(n,u){return n?e(n):u?void t(r):e(null)}e=z(e||g),n(u)}function $n(n){return function(t,e,r){return n(t,r)}}function Mn(n,t,e){q(n,$n(t),e)}function Pn(n,t,e,r){R(t)(n,$n(e),r)}function zn(n){return y(function(t,e){var r=!0;t.push(function(){var n=arguments;r?Pr(function(){e.apply(null,n)}):e.apply(null,n)}),n.apply(this,t),r=!1})}function Rn(n){return!n}function Un(n){return function(t){return null==t?void 0:t[n]}}function Vn(n,t,e,r){r=b(r||g);var u=[];n(t,function(n,t,r){e(n,function(e,o){e?r(e):(o&&u.push({index:t,value:n}),r())})},function(n){n?r(n):r(null,tn(u.sort(function(n,t){return n.index-t.index}),Un("value")))})}function Dn(n,t){function e(n){return n?r(n):void u(e)}var r=z(t||g),u=zn(n);e()}function qn(n,t,e,r){r=b(r||g);var u={};U(n,t,function(n,t,r){e(n,t,function(n,e){return n?r(n):(u[t]=e,void r())})},function(n){r(n,u)})}function Cn(n,t){return t in n}function Wn(n,e){var r=Object.create(null),u=Object.create(null);e=e||t;var o=y(function(t,o){var i=e.apply(null,t);Cn(r,i)?Pr(function(){o.apply(null,r[i])}):Cn(u,i)?u[i].push(o):(u[i]=[o],n.apply(null,t.concat([h(function(n){r[i]=n;var t=u[i];delete u[i];for(var e=0,o=t.length;o>e;e++)t[e].apply(null,n)})])))});return o.memo=r,o.unmemoized=n,o}function Qn(n,t,e){e=e||g;var r=d(t)?[]:{};n(t,function(n,t,e){n(h(function(n,u){u.length<=1&&(u=u[0]),r[t]=u,e(n)}))},function(n){e(n,r)})}function Gn(n,t){Qn(q,n,t)}function Nn(n,t,e){Qn(R(t),n,e)}function Hn(n,t){return kn(function(t,e){n(t[0],e)},t,1)}function Jn(n,t){var e=Hn(n,t);return e.push=function(n,t,r){if(null==r&&(r=g),"function"!=typeof r)throw new Error("task callback must be a function");if(e.started=!0,Ht(n)||(n=[n]),0===n.length)return Pr(function(){e.drain()});t=t||0;for(var u=e._tasks.head;u&&t>=u.priority;)u=u.next;for(var o=0,i=n.length;i>o;o++){var c={data:n[o],priority:t,callback:r};u?e._tasks.insertBefore(u,c):e._tasks.push(c)}Pr(e.process)},delete e.unshift,e}function Kn(n,t){if(t=b(t||g),!Ht(n))return t(new TypeError("First argument to race must be an array of functions"));if(!n.length)return t();for(var e=0,r=n.length;r>e;e++)n[e](t)}function Xn(n,t,e,r){var u=ou.call(n).reverse();wn(u,t,e,r)}function Yn(n){return y(function(t,e){return t.push(h(function(n,t){if(n)e(null,{error:n});else{var r=null;1===t.length?r=t[0]:t.length>1&&(r=t),e(null,{value:r})}})),n.apply(this,t)})}function Zn(n,t,e,r){Vn(n,t,function(n,t){e(n,function(n,e){n?t(n):t(null,!e)})},r)}function nt(n){var t;return Ht(n)?t=tn(n,Yn):(t={},J(n,function(n,e){t[e]=Yn.call(this,n)})),t}function tt(n,t,e){function r(n,t){if("object"==typeof t)n.times=+t.times||i,n.intervalFunc="function"==typeof t.interval?t.interval:u(+t.interval||c),n.errorFilter=t.errorFilter;else{if("number"!=typeof t&&"string"!=typeof t)throw new Error("Invalid arguments for async.retry");n.times=+t||i}}function o(){t(function(n){n&&a++e?-1:e>r?1:0}Qe(n,function(n,e){t(n,function(t,r){return t?e(t):void e(null,{value:n,criteria:r})})},function(n,t){return n?e(n):void e(null,tn(t.sort(r),Un("value")))})}function ot(n,t,e){function r(){c||(o.apply(null,arguments),clearTimeout(i))}function u(){var t=n.name||"anonymous",r=new Error('Callback function "'+t+'" timed out.');r.code="ETIMEDOUT",e&&(r.info=e),c=!0,o(r)}var o,i,c=!1;return y(function(e,c){o=c,i=setTimeout(u,t),n.apply(null,e.concat(r))})}function it(n,t,e,r){for(var u=-1,o=hu(pu((t-n)/(e||1)),0),i=Array(o);o--;)i[r?o:++u]=n,n+=e;return i}function ct(n,t,e,r){Ne(it(0,n,1),t,e,r)}function ft(n,t,e,r){3===arguments.length&&(r=e,e=t,t=Ht(n)?[]:{}),r=b(r||g),q(n,function(n,r,u){e(t,n,r,u)},function(n){r(n,t)})}function at(n){return function(){return(n.unmemoized||n).apply(null,arguments)}}function lt(n,t,e){if(e=z(e||g),!n())return e(null);var r=h(function(u,o){return u?e(u):n()?t(r):void e.apply(null,[null].concat(o))});t(r)}function st(n,t,e){lt(function(){return!n.apply(this,arguments)},t,e)}function pt(n,t){function e(u){if(r===n.length)return t.apply(null,[null].concat(u));var o=z(h(function(n,r){return n?t.apply(null,[n].concat(r)):void e(r)}));u.push(o);var i=n[r++];i.apply(null,u)}if(t=b(t||g),!Ht(n))return t(new Error("First argument to waterfall must be an array of functions"));if(!n.length)return t();var r=0;e([])}var ht=Math.max,yt="[object Function]",vt="[object GeneratorFunction]",mt="[object Proxy]",dt=Object.prototype,gt=dt.toString,bt="object"==typeof global&&global&&global.Object===Object&&global,jt="object"==typeof self&&self&&self.Object===Object&&self,St=bt||jt||Function("return this")(),kt=St["__core-js_shared__"],Ot=function(){var n=/[^.]+$/.exec(kt&&kt.keys&&kt.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""}(),wt=Function.prototype,xt=wt.toString,Et=/[\\^$.*+?()[\]{}|]/g,Lt=/^\[object .+?Constructor\]$/,At=Function.prototype,_t=Object.prototype,Tt=At.toString,Ft=_t.hasOwnProperty,It=RegExp("^"+Tt.call(Ft).replace(Et,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Bt=function(){try{var n=s(Object,"defineProperty");return n({},"",{}),n}catch(t){}}(),$t=Bt?function(n,t){return Bt(n,"toString",{configurable:!0,enumerable:!1,value:u(t),writable:!0})}:t,Mt=500,Pt=16,zt=Date.now,Rt=p($t),Ut=9007199254740991,Vt="function"==typeof Symbol&&Symbol.iterator,Dt="[object Arguments]",qt=Object.prototype,Ct=qt.toString,Wt=Object.prototype,Qt=Wt.hasOwnProperty,Gt=Wt.propertyIsEnumerable,Nt=O(function(){return arguments}())?O:function(n){return k(n)&&Qt.call(n,"callee")&&!Gt.call(n,"callee")},Ht=Array.isArray,Jt="object"==typeof n&&n&&!n.nodeType&&n,Kt=Jt&&"object"==typeof module&&module&&!module.nodeType&&module,Xt=Kt&&Kt.exports===Jt,Yt=Xt?St.Buffer:void 0,Zt=Yt?Yt.isBuffer:void 0,ne=Zt||w,te=9007199254740991,ee=/^(?:0|[1-9]\d*)$/,re="[object Arguments]",ue="[object Array]",oe="[object Boolean]",ie="[object Date]",ce="[object Error]",fe="[object Function]",ae="[object Map]",le="[object Number]",se="[object Object]",pe="[object RegExp]",he="[object Set]",ye="[object String]",ve="[object WeakMap]",me="[object ArrayBuffer]",de="[object DataView]",ge="[object Float32Array]",be="[object Float64Array]",je="[object Int8Array]",Se="[object Int16Array]",ke="[object Int32Array]",Oe="[object Uint8Array]",we="[object Uint8ClampedArray]",xe="[object Uint16Array]",Ee="[object Uint32Array]",Le={};Le[ge]=Le[be]=Le[je]=Le[Se]=Le[ke]=Le[Oe]=Le[we]=Le[xe]=Le[Ee]=!0,Le[re]=Le[ue]=Le[me]=Le[oe]=Le[de]=Le[ie]=Le[ce]=Le[fe]=Le[ae]=Le[le]=Le[se]=Le[pe]=Le[he]=Le[ye]=Le[ve]=!1;var Ae,_e=Object.prototype,Te=_e.toString,Fe="object"==typeof n&&n&&!n.nodeType&&n,Ie=Fe&&"object"==typeof module&&module&&!module.nodeType&&module,Be=Ie&&Ie.exports===Fe,$e=Be&&bt.process,Me=function(){try{return $e&&$e.binding("util")}catch(n){}}(),Pe=Me&&Me.isTypedArray,ze=Pe?L(Pe):E,Re=Object.prototype,Ue=Re.hasOwnProperty,Ve=Object.prototype,De=T(Object.keys,Object),qe=Object.prototype,Ce=qe.hasOwnProperty,We=V(U,1/0),Qe=C(W),Ge=v(Qe),Ne=Q(W),He=V(Ne,1),Je=v(He),Ke=h(function(n,t){return h(function(e){return n.apply(null,t.concat(e))})}),Xe=H(),Ye=St.Symbol,Ze="[object Symbol]",nr=Object.prototype,tr=nr.toString,er=1/0,rr=Ye?Ye.prototype:void 0,ur=rr?rr.toString:void 0,or="\\ud800-\\udfff",ir="\\u0300-\\u036f\\ufe20-\\ufe23",cr="\\u20d0-\\u20f0",fr="\\ufe0e\\ufe0f",ar="\\u200d",lr=RegExp("["+ar+or+ir+cr+fr+"]"),sr="\\ud800-\\udfff",pr="\\u0300-\\u036f\\ufe20-\\ufe23",hr="\\u20d0-\\u20f0",yr="\\ufe0e\\ufe0f",vr="["+sr+"]",mr="["+pr+hr+"]",dr="\\ud83c[\\udffb-\\udfff]",gr="(?:"+mr+"|"+dr+")",br="[^"+sr+"]",jr="(?:\\ud83c[\\udde6-\\uddff]){2}",Sr="[\\ud800-\\udbff][\\udc00-\\udfff]",kr="\\u200d",Or=gr+"?",wr="["+yr+"]?",xr="(?:"+kr+"(?:"+[br,jr,Sr].join("|")+")"+wr+Or+")*",Er=wr+Or+xr,Lr="(?:"+[br+mr+"?",mr,jr,Sr,vr].join("|")+")",Ar=RegExp(dr+"(?="+dr+")|"+Lr+Er,"g"),_r=/^\s+|\s+$/g,Tr=/^(function)?\s*[^\(]*\(\s*([^\)]*)\)/m,Fr=/,/,Ir=/(=.+)?(\s*)$/,Br=/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/gm,$r="function"==typeof setImmediate&&setImmediate,Mr="object"==typeof process&&"function"==typeof process.nextTick;Ae=$r?setImmediate:Mr?process.nextTick:gn;var Pr=bn(Ae);jn.prototype.removeLink=function(n){return n.prev?n.prev.next=n.next:this.head=n.next,n.next?n.next.prev=n.prev:this.tail=n.prev,n.prev=n.next=null,this.length-=1,n},jn.prototype.empty=jn,jn.prototype.insertAfter=function(n,t){t.prev=n,t.next=n.next,n.next?n.next.prev=t:this.tail=t,n.next=t,this.length+=1},jn.prototype.insertBefore=function(n,t){t.prev=n.prev,t.next=n,n.prev?n.prev.next=t:this.head=t,n.prev=t,this.length+=1},jn.prototype.unshift=function(n){this.head?this.insertBefore(this.head,n):Sn(this,n)},jn.prototype.push=function(n){this.tail?this.insertAfter(this.tail,n):Sn(this,n)},jn.prototype.shift=function(){return this.head&&this.removeLink(this.head)},jn.prototype.pop=function(){return this.tail&&this.removeLink(this.tail)};var zr,Rr=V(U,1),Ur=h(function(n){return h(function(t){var e=this,r=t[t.length-1];"function"==typeof r?t.pop():r=g,wn(n,t,function(n,t,r){t.apply(e,n.concat([h(function(n,t){r(n,t)})]))},function(n,t){r.apply(e,[n].concat(t))})})}),Vr=h(function(n){return Ur.apply(null,n.reverse())}),Dr=C(xn),qr=En(xn),Cr=h(function(n){var t=[null].concat(n);return y(function(n,e){return e.apply(this,t)})}),Wr=Ln(q,t,An),Qr=Ln(U,t,An),Gr=Ln(Rr,t,An),Nr=_n("dir"),Hr=V(Pn,1),Jr=Ln(q,Rn,Rn),Kr=Ln(U,Rn,Rn),Xr=V(Kr,1),Yr=C(Vn),Zr=Q(Vn),nu=V(Zr,1),tu=_n("log"),eu=V(qn,1/0),ru=V(qn,1);zr=Mr?process.nextTick:$r?setImmediate:gn;var uu=bn(zr),ou=Array.prototype.slice,iu=C(Zn),cu=Q(Zn),fu=V(cu,1),au=Ln(q,Boolean,t),lu=Ln(U,Boolean,t),su=V(lu,1),pu=Math.ceil,hu=Math.max,yu=V(ct,1/0),vu=V(ct,1),mu={applyEach:Ge,applyEachSeries:Je,apply:Ke,asyncify:G,auto:nn,autoInject:dn,cargo:On,compose:Vr,concat:Dr,concatSeries:qr,constant:Cr,detect:Wr,detectLimit:Qr,detectSeries:Gr,dir:Nr,doDuring:Tn,doUntil:In,doWhilst:Fn,during:Bn,each:Mn,eachLimit:Pn,eachOf:q,eachOfLimit:U,eachOfSeries:Rr,eachSeries:Hr,ensureAsync:zn,every:Jr,everyLimit:Kr,everySeries:Xr,filter:Yr,filterLimit:Zr,filterSeries:nu,forever:Dn,log:tu,map:Qe,mapLimit:Ne,mapSeries:He,mapValues:eu,mapValuesLimit:qn,mapValuesSeries:ru,memoize:Wn,nextTick:uu,parallel:Gn,parallelLimit:Nn,priorityQueue:Jn,queue:Hn,race:Kn,reduce:wn,reduceRight:Xn,reflect:Yn,reflectAll:nt,reject:iu,rejectLimit:cu,rejectSeries:fu,retry:tt,retryable:et,seq:Ur,series:rt,setImmediate:Pr,some:au,someLimit:lu,someSeries:su,sortBy:ut,timeout:ot,times:yu,timesLimit:ct,timesSeries:vu,transform:ft,unmemoize:at,until:st,waterfall:pt,whilst:lt,all:Jr,any:au,forEach:Mn,forEachSeries:Hr,forEachLimit:Pn,forEachOf:q,forEachOfSeries:Rr,forEachOfLimit:U,inject:wn,foldl:wn,foldr:Xn,select:Yr,selectLimit:Zr,selectSeries:nu,wrapSync:G};n["default"]=mu,n.applyEach=Ge,n.applyEachSeries=Je,n.apply=Ke,n.asyncify=G,n.auto=nn,n.autoInject=dn,n.cargo=On,n.compose=Vr,n.concat=Dr,n.concatSeries=qr,n.constant=Cr,n.detect=Wr,n.detectLimit=Qr,n.detectSeries=Gr,n.dir=Nr,n.doDuring=Tn,n.doUntil=In,n.doWhilst=Fn,n.during=Bn,n.each=Mn,n.eachLimit=Pn,n.eachOf=q,n.eachOfLimit=U,n.eachOfSeries=Rr,n.eachSeries=Hr,n.ensureAsync=zn,n.every=Jr,n.everyLimit=Kr,n.everySeries=Xr,n.filter=Yr,n.filterLimit=Zr,n.filterSeries=nu,n.forever=Dn,n.log=tu,n.map=Qe,n.mapLimit=Ne,n.mapSeries=He,n.mapValues=eu,n.mapValuesLimit=qn,n.mapValuesSeries=ru,n.memoize=Wn,n.nextTick=uu,n.parallel=Gn,n.parallelLimit=Nn,n.priorityQueue=Jn,n.queue=Hn,n.race=Kn,n.reduce=wn,n.reduceRight=Xn,n.reflect=Yn,n.reflectAll=nt,n.reject=iu,n.rejectLimit=cu,n.rejectSeries=fu,n.retry=tt,n.retryable=et,n.seq=Ur,n.series=rt,n.setImmediate=Pr,n.some=au,n.someLimit=lu,n.someSeries=su,n.sortBy=ut,n.timeout=ot,n.times=yu,n.timesLimit=ct,n.timesSeries=vu,n.transform=ft,n.unmemoize=at,n.until=st,n.waterfall=pt,n.whilst=lt,n.all=Jr,n.allLimit=Kr,n.allSeries=Xr,n.any=au,n.anyLimit=lu,n.anySeries=su,n.find=Wr,n.findLimit=Qr,n.findSeries=Gr,n.forEach=Mn,n.forEachSeries=Hr,n.forEachLimit=Pn,n.forEachOf=q,n.forEachOfSeries=Rr,n.forEachOfLimit=U,n.inject=wn,n.foldl=wn,n.foldr=Xn,n.select=Yr,n.selectLimit=Zr,n.selectSeries=nu,n.wrapSync=G}); //# sourceMappingURL=async.min.map \ No newline at end of file diff --git a/StockManMVC/node_modules/async/doDuring.js b/StockManMVC/node_modules/async/doDuring.js index 0d01995..c962895 100644 --- a/StockManMVC/node_modules/async/doDuring.js +++ b/StockManMVC/node_modules/async/doDuring.js @@ -9,9 +9,9 @@ var _noop = require('lodash/noop'); var _noop2 = _interopRequireDefault(_noop); -var _rest = require('lodash/rest'); +var _baseRest = require('lodash/_baseRest'); -var _rest2 = _interopRequireDefault(_rest); +var _baseRest2 = _interopRequireDefault(_baseRest); var _onlyOnce = require('./internal/onlyOnce'); @@ -43,7 +43,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de function doDuring(fn, test, callback) { callback = (0, _onlyOnce2.default)(callback || _noop2.default); - var next = (0, _rest2.default)(function (err, args) { + var next = (0, _baseRest2.default)(function (err, args) { if (err) return callback(err); args.push(check); test.apply(this, args); diff --git a/StockManMVC/node_modules/async/doWhilst.js b/StockManMVC/node_modules/async/doWhilst.js index a683bb6..088b2cf 100644 --- a/StockManMVC/node_modules/async/doWhilst.js +++ b/StockManMVC/node_modules/async/doWhilst.js @@ -9,9 +9,9 @@ var _noop = require('lodash/noop'); var _noop2 = _interopRequireDefault(_noop); -var _rest = require('lodash/rest'); +var _baseRest = require('lodash/_baseRest'); -var _rest2 = _interopRequireDefault(_rest); +var _baseRest2 = _interopRequireDefault(_baseRest); var _onlyOnce = require('./internal/onlyOnce'); @@ -35,8 +35,8 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de * passes. The function is passed a `callback(err)`, which must be called once * it has completed with an optional `err` argument. Invoked with (callback). * @param {Function} test - synchronous truth test to perform after each - * execution of `iteratee`. Invoked with Invoked with the non-error callback - * results of `iteratee`. + * execution of `iteratee`. Invoked with the non-error callback results of + * `iteratee`. * @param {Function} [callback] - A callback which is called after the test * function has failed and repeated execution of `iteratee` has stopped. * `callback` will be passed an error and any arguments passed to the final @@ -44,7 +44,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de */ function doWhilst(iteratee, test, callback) { callback = (0, _onlyOnce2.default)(callback || _noop2.default); - var next = (0, _rest2.default)(function (err, args) { + var next = (0, _baseRest2.default)(function (err, args) { if (err) return callback(err); if (test.apply(this, args)) return iteratee(next); callback.apply(null, [null].concat(args)); diff --git a/StockManMVC/node_modules/async/eachLimit.js b/StockManMVC/node_modules/async/eachLimit.js index 691a405..674c135 100644 --- a/StockManMVC/node_modules/async/eachLimit.js +++ b/StockManMVC/node_modules/async/eachLimit.js @@ -25,7 +25,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de * @see [async.each]{@link module:Collections.each} * @alias forEachLimit * @category Collection - * @param {Array|Iterable|Object} coll - A colleciton to iterate over. + * @param {Array|Iterable|Object} coll - A collection to iterate over. * @param {number} limit - The maximum number of async operations at a time. * @param {Function} iteratee - A function to apply to each item in `coll`. The * iteratee is passed a `callback(err)` which must be called once it has diff --git a/StockManMVC/node_modules/async/eachOf.js b/StockManMVC/node_modules/async/eachOf.js index c562f4c..4ab9a54 100644 --- a/StockManMVC/node_modules/async/eachOf.js +++ b/StockManMVC/node_modules/async/eachOf.js @@ -25,7 +25,7 @@ var _noop = require('lodash/noop'); var _noop2 = _interopRequireDefault(_noop); -var _once = require('lodash/once'); +var _once = require('./internal/once'); var _once2 = _interopRequireDefault(_once); diff --git a/StockManMVC/node_modules/async/internal/applyEach.js b/StockManMVC/node_modules/async/internal/applyEach.js index 4035bfb..bfe97e6 100644 --- a/StockManMVC/node_modules/async/internal/applyEach.js +++ b/StockManMVC/node_modules/async/internal/applyEach.js @@ -5,9 +5,9 @@ Object.defineProperty(exports, "__esModule", { }); exports.default = applyEach; -var _rest = require('lodash/rest'); +var _baseRest = require('lodash/_baseRest'); -var _rest2 = _interopRequireDefault(_rest); +var _baseRest2 = _interopRequireDefault(_baseRest); var _initialParams = require('./initialParams'); @@ -16,7 +16,7 @@ var _initialParams2 = _interopRequireDefault(_initialParams); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function applyEach(eachfn) { - return (0, _rest2.default)(function (fns, args) { + return (0, _baseRest2.default)(function (fns, args) { var go = (0, _initialParams2.default)(function (args, callback) { var that = this; return eachfn(fns, function (fn, cb) { diff --git a/StockManMVC/node_modules/async/internal/consoleFunc.js b/StockManMVC/node_modules/async/internal/consoleFunc.js index f7befa8..0fdab2f 100644 --- a/StockManMVC/node_modules/async/internal/consoleFunc.js +++ b/StockManMVC/node_modules/async/internal/consoleFunc.js @@ -9,15 +9,15 @@ var _arrayEach = require('lodash/_arrayEach'); var _arrayEach2 = _interopRequireDefault(_arrayEach); -var _rest = require('lodash/rest'); +var _baseRest = require('lodash/_baseRest'); -var _rest2 = _interopRequireDefault(_rest); +var _baseRest2 = _interopRequireDefault(_baseRest); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function consoleFunc(name) { - return (0, _rest2.default)(function (fn, args) { - fn.apply(null, args.concat([(0, _rest2.default)(function (err, args) { + return (0, _baseRest2.default)(function (fn, args) { + fn.apply(null, args.concat([(0, _baseRest2.default)(function (err, args) { if (typeof console === 'object') { if (err) { if (console.error) { diff --git a/StockManMVC/node_modules/async/internal/initialParams.js b/StockManMVC/node_modules/async/internal/initialParams.js index 2449320..0142132 100644 --- a/StockManMVC/node_modules/async/internal/initialParams.js +++ b/StockManMVC/node_modules/async/internal/initialParams.js @@ -5,15 +5,15 @@ Object.defineProperty(exports, "__esModule", { }); exports.default = function (fn) { - return (0, _rest2.default)(function (args /*..., callback*/) { + return (0, _baseRest2.default)(function (args /*..., callback*/) { var callback = args.pop(); fn.call(this, args, callback); }); }; -var _rest = require('lodash/rest'); +var _baseRest = require('lodash/_baseRest'); -var _rest2 = _interopRequireDefault(_rest); +var _baseRest2 = _interopRequireDefault(_baseRest); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } diff --git a/StockManMVC/node_modules/async/internal/parallel.js b/StockManMVC/node_modules/async/internal/parallel.js index f04888c..3915b20 100644 --- a/StockManMVC/node_modules/async/internal/parallel.js +++ b/StockManMVC/node_modules/async/internal/parallel.js @@ -13,9 +13,9 @@ var _isArrayLike = require('lodash/isArrayLike'); var _isArrayLike2 = _interopRequireDefault(_isArrayLike); -var _rest = require('lodash/rest'); +var _baseRest = require('lodash/_baseRest'); -var _rest2 = _interopRequireDefault(_rest); +var _baseRest2 = _interopRequireDefault(_baseRest); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -24,7 +24,7 @@ function _parallel(eachfn, tasks, callback) { var results = (0, _isArrayLike2.default)(tasks) ? [] : {}; eachfn(tasks, function (task, key, callback) { - task((0, _rest2.default)(function (err, args) { + task((0, _baseRest2.default)(function (err, args) { if (args.length <= 1) { args = args[0]; } diff --git a/StockManMVC/node_modules/async/internal/queue.js b/StockManMVC/node_modules/async/internal/queue.js index e54a6d7..6d53cc2 100644 --- a/StockManMVC/node_modules/async/internal/queue.js +++ b/StockManMVC/node_modules/async/internal/queue.js @@ -5,9 +5,9 @@ Object.defineProperty(exports, "__esModule", { }); exports.default = queue; -var _arrayEach = require('lodash/_arrayEach'); +var _baseIndexOf = require('lodash/_baseIndexOf'); -var _arrayEach2 = _interopRequireDefault(_arrayEach); +var _baseIndexOf2 = _interopRequireDefault(_baseIndexOf); var _isArray = require('lodash/isArray'); @@ -17,9 +17,9 @@ var _noop = require('lodash/noop'); var _noop2 = _interopRequireDefault(_noop); -var _rest = require('lodash/rest'); +var _baseRest = require('lodash/_baseRest'); -var _rest2 = _interopRequireDefault(_rest); +var _baseRest2 = _interopRequireDefault(_baseRest); var _onlyOnce = require('./onlyOnce'); @@ -56,9 +56,10 @@ function queue(worker, concurrency, payload) { q.drain(); }); } - (0, _arrayEach2.default)(data, function (task) { + + for (var i = 0, l = data.length; i < l; i++) { var item = { - data: task, + data: data[i], callback: callback || _noop2.default }; @@ -67,28 +68,27 @@ function queue(worker, concurrency, payload) { } else { q._tasks.push(item); } - }); + } (0, _setImmediate2.default)(q.process); } function _next(tasks) { - return (0, _rest2.default)(function (args) { + return (0, _baseRest2.default)(function (args) { workers -= 1; - (0, _arrayEach2.default)(tasks, function (task) { - (0, _arrayEach2.default)(workersList, function (worker, index) { - if (worker === task) { - workersList.splice(index, 1); - return false; - } - }); + for (var i = 0, l = tasks.length; i < l; i++) { + var task = tasks[i]; + var index = (0, _baseIndexOf2.default)(workersList, task, 0); + if (index >= 0) { + workersList.splice(index); + } task.callback.apply(task, args); if (args[0] != null) { q.error(args[0], task.data); } - }); + } if (workers <= q.concurrency - q.buffer) { q.unsaturated(); diff --git a/StockManMVC/node_modules/async/internal/setImmediate.js b/StockManMVC/node_modules/async/internal/setImmediate.js index 6d7e7fd..18f170d 100644 --- a/StockManMVC/node_modules/async/internal/setImmediate.js +++ b/StockManMVC/node_modules/async/internal/setImmediate.js @@ -7,9 +7,9 @@ exports.hasNextTick = exports.hasSetImmediate = undefined; exports.fallback = fallback; exports.wrap = wrap; -var _rest = require('lodash/rest'); +var _baseRest = require('lodash/_baseRest'); -var _rest2 = _interopRequireDefault(_rest); +var _baseRest2 = _interopRequireDefault(_baseRest); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -21,7 +21,7 @@ function fallback(fn) { } function wrap(defer) { - return (0, _rest2.default)(function (fn, args) { + return (0, _baseRest2.default)(function (fn, args) { defer(function () { fn.apply(null, args); }); diff --git a/StockManMVC/node_modules/async/memoize.js b/StockManMVC/node_modules/async/memoize.js index a6bc5f0..4c757ab 100644 --- a/StockManMVC/node_modules/async/memoize.js +++ b/StockManMVC/node_modules/async/memoize.js @@ -9,9 +9,9 @@ var _identity = require('lodash/identity'); var _identity2 = _interopRequireDefault(_identity); -var _rest = require('lodash/rest'); +var _baseRest = require('lodash/_baseRest'); -var _rest2 = _interopRequireDefault(_rest); +var _baseRest2 = _interopRequireDefault(_baseRest); var _setImmediate = require('./internal/setImmediate'); @@ -78,7 +78,7 @@ function memoize(fn, hasher) { queues[key].push(callback); } else { queues[key] = [callback]; - fn.apply(null, args.concat([(0, _rest2.default)(function (args) { + fn.apply(null, args.concat([(0, _baseRest2.default)(function (args) { memo[key] = args; var q = queues[key]; delete queues[key]; diff --git a/StockManMVC/node_modules/async/package.json b/StockManMVC/node_modules/async/package.json index c8e07a2..bfe9ec3 100644 --- a/StockManMVC/node_modules/async/package.json +++ b/StockManMVC/node_modules/async/package.json @@ -6,19 +6,19 @@ ] ], "_from": "async@>=2.0.1-0 <3.0.0-0", - "_id": "async@2.0.1", + "_id": "async@2.1.1", "_inCache": true, "_location": "/async", - "_nodeVersion": "6.2.2", + "_nodeVersion": "6.7.0", "_npmOperationalInternal": { "host": "packages-16-east.internal.npmjs.com", - "tmp": "tmp/async-2.0.1.tgz_1469219821915_0.46895121363922954" + "tmp": "tmp/async-2.1.1.tgz_1476298732568_0.5726463799364865" }, "_npmUser": { "email": "megawac@gmail.com", "name": "megawac" }, - "_npmVersion": "3.9.5", + "_npmVersion": "3.10.3", "_phantomChildren": {}, "_requested": { "name": "async", @@ -31,8 +31,8 @@ "_requiredBy": [ "/form-data" ], - "_resolved": "https://registry.npmjs.org/async/-/async-2.0.1.tgz", - "_shasum": "b709cc0280a9c36f09f4536be823c838a9049e25", + "_resolved": "https://registry.npmjs.org/async/-/async-2.1.1.tgz", + "_shasum": "e11b6d10043f2254efb61a21163d840ccddb8d28", "_shrinkwrap": null, "_spec": "async@^2.0.1", "_where": "C:\\Users\\samuele.STEAMWAREWIN\\Documents\\VisualStudioProjects\\StockMan\\StockManMVC\\node_modules\\form-data", @@ -43,7 +43,7 @@ "url": "https://github.com/caolan/async/issues" }, "dependencies": { - "lodash": "^4.8.0" + "lodash": "^4.14.0" }, "description": "Higher-order functions and common patterns for asynchronous code", "devDependencies": { @@ -53,7 +53,7 @@ "babel-plugin-transform-es2015-modules-commonjs": "^6.3.16", "babel-preset-es2015": "^6.3.13", "babelify": "^7.2.0", - "benchmark": "github:bestiejs/benchmark.js", + "benchmark": "^2.1.1", "bluebird": "^2.9.32", "chai": "^3.1.0", "cheerio": "^0.20.0", @@ -85,8 +85,8 @@ }, "directories": {}, "dist": { - "shasum": "b709cc0280a9c36f09f4536be823c838a9049e25", - "tarball": "https://registry.npmjs.org/async/-/async-2.0.1.tgz" + "shasum": "e11b6d10043f2254efb61a21163d840ccddb8d28", + "tarball": "https://registry.npmjs.org/async/-/async-2.1.1.tgz" }, "gh-pages-deploy": { "staticpath": "docs" @@ -140,5 +140,5 @@ "mocha-test": "npm run mocha-node-test && npm run mocha-browser-test", "test": "npm run-script lint && npm run mocha-node-test" }, - "version": "2.0.1" + "version": "2.1.1" } diff --git a/StockManMVC/node_modules/async/priorityQueue.js b/StockManMVC/node_modules/async/priorityQueue.js index f7736e9..4e37149 100644 --- a/StockManMVC/node_modules/async/priorityQueue.js +++ b/StockManMVC/node_modules/async/priorityQueue.js @@ -31,9 +31,9 @@ exports.default = function (worker, concurrency) { nextNode = nextNode.next; } - (0, _arrayEach2.default)(data, function (task) { + for (var i = 0, l = data.length; i < l; i++) { var item = { - data: task, + data: data[i], priority: priority, callback: callback }; @@ -43,7 +43,7 @@ exports.default = function (worker, concurrency) { } else { q._tasks.push(item); } - }); + } (0, _setImmediate2.default)(q.process); }; @@ -53,10 +53,6 @@ exports.default = function (worker, concurrency) { return q; }; -var _arrayEach = require('lodash/_arrayEach'); - -var _arrayEach2 = _interopRequireDefault(_arrayEach); - var _isArray = require('lodash/isArray'); var _isArray2 = _interopRequireDefault(_isArray); diff --git a/StockManMVC/node_modules/async/race.js b/StockManMVC/node_modules/async/race.js index 384ea10..4d0625b 100644 --- a/StockManMVC/node_modules/async/race.js +++ b/StockManMVC/node_modules/async/race.js @@ -9,10 +9,6 @@ var _isArray = require('lodash/isArray'); var _isArray2 = _interopRequireDefault(_isArray); -var _arrayEach = require('lodash/_arrayEach'); - -var _arrayEach2 = _interopRequireDefault(_arrayEach); - var _noop = require('lodash/noop'); var _noop2 = _interopRequireDefault(_noop); @@ -25,7 +21,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de /** * Runs the `tasks` array of functions in parallel, without waiting until the - * previous function has completed. Once any the `tasks` completed or pass an + * previous function has completed. Once any of the `tasks` complete or pass an * error to its callback, the main `callback` is immediately called. It's * equivalent to `Promise.race()`. * @@ -64,8 +60,8 @@ function race(tasks, callback) { callback = (0, _once2.default)(callback || _noop2.default); if (!(0, _isArray2.default)(tasks)) return callback(new TypeError('First argument to race must be an array of functions')); if (!tasks.length) return callback(); - (0, _arrayEach2.default)(tasks, function (task) { - task(callback); - }); + for (var i = 0, l = tasks.length; i < l; i++) { + tasks[i](callback); + } } module.exports = exports['default']; \ No newline at end of file diff --git a/StockManMVC/node_modules/async/reflect.js b/StockManMVC/node_modules/async/reflect.js index 326d1b9..e4fabcc 100644 --- a/StockManMVC/node_modules/async/reflect.js +++ b/StockManMVC/node_modules/async/reflect.js @@ -9,9 +9,9 @@ var _initialParams = require('./internal/initialParams'); var _initialParams2 = _interopRequireDefault(_initialParams); -var _rest = require('lodash/rest'); +var _baseRest = require('lodash/_baseRest'); -var _rest2 = _interopRequireDefault(_rest); +var _baseRest2 = _interopRequireDefault(_baseRest); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -56,7 +56,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de */ function reflect(fn) { return (0, _initialParams2.default)(function reflectOn(args, reflectCallback) { - args.push((0, _rest2.default)(function callback(err, cbArgs) { + args.push((0, _baseRest2.default)(function callback(err, cbArgs) { if (err) { reflectCallback(null, { error: err diff --git a/StockManMVC/node_modules/async/retry.js b/StockManMVC/node_modules/async/retry.js index 5ab0d11..3738be2 100644 --- a/StockManMVC/node_modules/async/retry.js +++ b/StockManMVC/node_modules/async/retry.js @@ -33,6 +33,11 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de * * `interval` - The time to wait between retries, in milliseconds. The * default is `0`. The interval may also be specified as a function of the * retry count (see example). + * * `errorFilter` - An optional synchronous function that is invoked on + * erroneous result. If it returns `true` the retry attempts will continue; + * if the function returns `false` the retry flow is aborted with the current + * attempt's error and result being returned to the final callback. + * Invoked with (err). * * If `opts` is a number, the number specifies the number of times to retry, * with the default interval of `0`. * @param {Function} task - A function which receives two arguments: (1) a @@ -76,6 +81,16 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de * // do something with the result * }); * + * // try calling apiMethod only when error condition satisfies, all other + * // errors will abort the retry control flow and return to final callback + * async.retry({ + * errorFilter: function(err) { + * return err.message === 'Temporary error'; // only retry on a specific error + * } + * }, apiMethod, function(err, result) { + * // do something with the result + * }); + * * // It can also be embedded within other control flow functions to retry * // individual methods that are not as reliable, like this: * async.auto({ @@ -84,6 +99,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de * }, function(err, results) { * // do something with the results * }); + * */ function retry(opts, task, callback) { var DEFAULT_TIMES = 5; @@ -99,6 +115,8 @@ function retry(opts, task, callback) { acc.times = +t.times || DEFAULT_TIMES; acc.intervalFunc = typeof t.interval === 'function' ? t.interval : (0, _constant2.default)(+t.interval || DEFAULT_INTERVAL); + + acc.errorFilter = t.errorFilter; } else if (typeof t === 'number' || typeof t === 'string') { acc.times = +t || DEFAULT_TIMES; } else { @@ -121,7 +139,7 @@ function retry(opts, task, callback) { var attempt = 1; function retryAttempt() { task(function (err) { - if (err && attempt++ < options.times) { + if (err && attempt++ < options.times && (typeof options.errorFilter != 'function' || options.errorFilter(err))) { setTimeout(retryAttempt, options.intervalFunc(attempt)); } else { callback.apply(null, arguments); diff --git a/StockManMVC/node_modules/async/seq.js b/StockManMVC/node_modules/async/seq.js index e2d7673..fc91fac 100644 --- a/StockManMVC/node_modules/async/seq.js +++ b/StockManMVC/node_modules/async/seq.js @@ -8,9 +8,9 @@ var _noop = require('lodash/noop'); var _noop2 = _interopRequireDefault(_noop); -var _rest = require('lodash/rest'); +var _baseRest = require('lodash/_baseRest'); -var _rest2 = _interopRequireDefault(_rest); +var _baseRest2 = _interopRequireDefault(_baseRest); var _reduce = require('./reduce'); @@ -56,8 +56,8 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de * }); * }); */ -exports.default = (0, _rest2.default)(function seq(functions) { - return (0, _rest2.default)(function (args) { +exports.default = (0, _baseRest2.default)(function seq(functions) { + return (0, _baseRest2.default)(function (args) { var that = this; var cb = args[args.length - 1]; @@ -68,7 +68,7 @@ exports.default = (0, _rest2.default)(function seq(functions) { } (0, _reduce2.default)(functions, args, function (newargs, fn, cb) { - fn.apply(that, newargs.concat([(0, _rest2.default)(function (err, nextargs) { + fn.apply(that, newargs.concat([(0, _baseRest2.default)(function (err, nextargs) { cb(err, nextargs); })])); }, function (err, results) { diff --git a/StockManMVC/node_modules/async/timeout.js b/StockManMVC/node_modules/async/timeout.js index a8de437..81a5b7a 100644 --- a/StockManMVC/node_modules/async/timeout.js +++ b/StockManMVC/node_modules/async/timeout.js @@ -27,12 +27,31 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de * @param {*} [info] - Any variable you want attached (`string`, `object`, etc) * to timeout Error for more information.. * @returns {Function} Returns a wrapped function that can be used with any of - * the control flow functions. + * the control flow functions. Invoke this function with the same + * parameters as you would `asyncFunc`. * @example * - * async.timeout(function(callback) { - * doAsyncTask(callback); - * }, 1000); + * function myFunction(foo, callback) { + * doAsyncTask(foo, function(err, data) { + * // handle errors + * if (err) return callback(err); + * + * // do some stuff ... + * + * // return processed data + * return callback(null, data); + * }); + * } + * + * var wrapped = async.timeout(myFunction, 1000); + * + * // call `wrapped` as you would `myFunction` + * wrapped({ bar: 'bar' }, function(err, data) { + * // if `myFunction` takes < 1000 ms to execute, `err` + * // and `data` will have their expected values + * + * // else `err` will be an Error with the code 'ETIMEDOUT' + * }); */ function timeout(asyncFn, milliseconds, info) { var originalCallback, timer; diff --git a/StockManMVC/node_modules/async/waterfall.js b/StockManMVC/node_modules/async/waterfall.js index 01ea63d..07611f4 100644 --- a/StockManMVC/node_modules/async/waterfall.js +++ b/StockManMVC/node_modules/async/waterfall.js @@ -15,7 +15,7 @@ exports.default = function (tasks, callback) { return callback.apply(null, [null].concat(args)); } - var taskCallback = (0, _onlyOnce2.default)((0, _rest2.default)(function (err, args) { + var taskCallback = (0, _onlyOnce2.default)((0, _baseRest2.default)(function (err, args) { if (err) { return callback.apply(null, [err].concat(args)); } @@ -43,9 +43,9 @@ var _once = require('./internal/once'); var _once2 = _interopRequireDefault(_once); -var _rest = require('lodash/rest'); +var _baseRest = require('lodash/_baseRest'); -var _rest2 = _interopRequireDefault(_rest); +var _baseRest2 = _interopRequireDefault(_baseRest); var _onlyOnce = require('./internal/onlyOnce'); diff --git a/StockManMVC/node_modules/async/whilst.js b/StockManMVC/node_modules/async/whilst.js index e81c460..9145e2e 100644 --- a/StockManMVC/node_modules/async/whilst.js +++ b/StockManMVC/node_modules/async/whilst.js @@ -9,9 +9,9 @@ var _noop = require('lodash/noop'); var _noop2 = _interopRequireDefault(_noop); -var _rest = require('lodash/rest'); +var _baseRest = require('lodash/_baseRest'); -var _rest2 = _interopRequireDefault(_rest); +var _baseRest2 = _interopRequireDefault(_baseRest); var _onlyOnce = require('./internal/onlyOnce'); @@ -20,7 +20,7 @@ var _onlyOnce2 = _interopRequireDefault(_onlyOnce); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /** - * Repeatedly call `fn`, while `test` returns `true`. Calls `callback` when + * Repeatedly call `iteratee`, while `test` returns `true`. Calls `callback` when * stopped, or an error occurs. * * @name whilst @@ -29,13 +29,13 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de * @method * @category Control Flow * @param {Function} test - synchronous truth test to perform before each - * execution of `fn`. Invoked with (). + * execution of `iteratee`. Invoked with (). * @param {Function} iteratee - A function which is called each time `test` passes. * The function is passed a `callback(err)`, which must be called once it has * completed with an optional `err` argument. Invoked with (callback). * @param {Function} [callback] - A callback which is called after the test - * function has failed and repeated execution of `fn` has stopped. `callback` - * will be passed an error and any arguments passed to the final `fn`'s + * function has failed and repeated execution of `iteratee` has stopped. `callback` + * will be passed an error and any arguments passed to the final `iteratee`'s * callback. Invoked with (err, [results]); * @returns undefined * @example @@ -57,7 +57,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de function whilst(test, iteratee, callback) { callback = (0, _onlyOnce2.default)(callback || _noop2.default); if (!test()) return callback(null); - var next = (0, _rest2.default)(function (err, args) { + var next = (0, _baseRest2.default)(function (err, args) { if (err) return callback(err); if (test()) return iteratee(next); callback.apply(null, [null].concat(args)); diff --git a/StockManMVC/node_modules/aws4/README.md b/StockManMVC/node_modules/aws4/README.md index 6c55da8..6b002d0 100644 --- a/StockManMVC/node_modules/aws4/README.md +++ b/StockManMVC/node_modules/aws4/README.md @@ -434,6 +434,15 @@ request(aws4.sign({ /* (HTTP 202, empty response) */ + +// Generate CodeCommit Git access password +var signer = new aws4.RequestSigner({ + service: 'codecommit', + host: 'git-codecommit.us-east-1.amazonaws.com', + method: 'GIT', + path: '/v1/repos/MyAwesomeRepo', +}) +var password = signer.getDateTime() + 'Z' + signer.signature() ``` API diff --git a/StockManMVC/node_modules/aws4/aws4.js b/StockManMVC/node_modules/aws4/aws4.js index cbe5dc9..a543180 100644 --- a/StockManMVC/node_modules/aws4/aws4.js +++ b/StockManMVC/node_modules/aws4/aws4.js @@ -52,6 +52,8 @@ function RequestSigner(request, credentials) { } if (!request.hostname && !request.host) request.hostname = headers.Host || headers.host + + this.isCodeCommitGit = this.service === 'codecommit' && request.method === 'GIT' } RequestSigner.prototype.matchHost = function(host) { @@ -109,7 +111,7 @@ RequestSigner.prototype.prepareRequest = function() { } else { - if (!request.doNotModifyHeaders) { + if (!request.doNotModifyHeaders && !this.isCodeCommitGit) { if (request.body && !headers['Content-Type'] && !headers['content-type']) headers['Content-Type'] = 'application/x-www-form-urlencoded; charset=utf-8' @@ -153,6 +155,9 @@ RequestSigner.prototype.getDateTime = function() { date = new Date(headers.Date || headers.date || new Date) this.datetime = date.toISOString().replace(/[:\-]|\.\d{3}/g, '') + + // Remove the trailing 'Z' on the timestamp string for CodeCommit git access + if (this.isCodeCommitGit) this.datetime = this.datetime.slice(0, -1) } return this.datetime } @@ -202,8 +207,8 @@ RequestSigner.prototype.canonicalString = function() { decodePath = this.service === 's3' || this.request.doNotEncodePath, decodeSlashesInPath = this.service === 's3', firstValOnly = this.service === 's3', - bodyHash = this.service === 's3' && this.request.signQuery ? - 'UNSIGNED-PAYLOAD' : hash(this.request.body || '', 'hex') + bodyHash = this.service === 's3' && this.request.signQuery ? 'UNSIGNED-PAYLOAD' : + (this.isCodeCommitGit ? '' : hash(this.request.body || '', 'hex')) if (query) { queryStr = encodeRfc3986(querystring.stringify(Object.keys(query).sort().reduce(function(obj, key) { diff --git a/StockManMVC/node_modules/aws4/package.json b/StockManMVC/node_modules/aws4/package.json index 63d1c50..c0231f6 100644 --- a/StockManMVC/node_modules/aws4/package.json +++ b/StockManMVC/node_modules/aws4/package.json @@ -6,19 +6,19 @@ ] ], "_from": "aws4@>=1.2.1-0 <2.0.0-0", - "_id": "aws4@1.4.1", + "_id": "aws4@1.5.0", "_inCache": true, "_location": "/aws4", - "_nodeVersion": "4.4.3", + "_nodeVersion": "4.5.0", "_npmOperationalInternal": { - "host": "packages-12-west.internal.npmjs.com", - "tmp": "tmp/aws4-1.4.1.tgz_1462643218465_0.6527479749638587" + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/aws4-1.5.0.tgz_1476226259635_0.2796843808609992" }, "_npmUser": { "email": "michael.hart.au@gmail.com", "name": "hichaelmart" }, - "_npmVersion": "2.15.4", + "_npmVersion": "2.15.11", "_phantomChildren": {}, "_requested": { "name": "aws4", @@ -31,8 +31,8 @@ "_requiredBy": [ "/request" ], - "_resolved": "https://registry.npmjs.org/aws4/-/aws4-1.4.1.tgz", - "_shasum": "fde7d5292466d230e5ee0f4e038d9dfaab08fc61", + "_resolved": "https://registry.npmjs.org/aws4/-/aws4-1.5.0.tgz", + "_shasum": "0a29ffb79c31c9e712eeb087e8e7a64b4a56d755", "_shrinkwrap": null, "_spec": "aws4@^1.2.1", "_where": "C:\\Users\\samuele.STEAMWAREWIN\\Documents\\VisualStudioProjects\\StockMan\\StockManMVC\\node_modules\\request", @@ -52,10 +52,10 @@ }, "directories": {}, "dist": { - "shasum": "fde7d5292466d230e5ee0f4e038d9dfaab08fc61", - "tarball": "https://registry.npmjs.org/aws4/-/aws4-1.4.1.tgz" + "shasum": "0a29ffb79c31c9e712eeb087e8e7a64b4a56d755", + "tarball": "https://registry.npmjs.org/aws4/-/aws4-1.5.0.tgz" }, - "gitHead": "f126d3ff80be1ddde0fc6b50bb51a7f199547e81", + "gitHead": "ba136334ee08884c6042c8578a22e376233eef34", "homepage": "https://github.com/mhart/aws4#readme", "installable": true, "keywords": [ @@ -127,5 +127,5 @@ "scripts": { "test": "mocha ./test/fast.js ./test/slow.js -b -t 100s -R list" }, - "version": "1.4.1" + "version": "1.5.0" } diff --git a/StockManMVC/node_modules/config-chain/package.json b/StockManMVC/node_modules/config-chain/package.json index 7f8dd4d..4f19e21 100644 --- a/StockManMVC/node_modules/config-chain/package.json +++ b/StockManMVC/node_modules/config-chain/package.json @@ -6,15 +6,19 @@ ] ], "_from": "config-chain@>=1.1.8-0 <1.2.0-0", - "_id": "config-chain@1.1.10", + "_id": "config-chain@1.1.11", "_inCache": true, "_location": "/config-chain", - "_nodeVersion": "5.3.0", + "_nodeVersion": "6.4.0", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/config-chain-1.1.11.tgz_1475546049061_0.23554040002636611" + }, "_npmUser": { "email": "dominic.tarr@gmail.com", "name": "dominictarr" }, - "_npmVersion": "3.3.12", + "_npmVersion": "3.9.3", "_phantomChildren": {}, "_requested": { "name": "config-chain", @@ -27,8 +31,8 @@ "_requiredBy": [ "/npmconf" ], - "_resolved": "https://registry.npmjs.org/config-chain/-/config-chain-1.1.10.tgz", - "_shasum": "7fc383de0fcc84d711cb465bd176579cad612346", + "_resolved": "https://registry.npmjs.org/config-chain/-/config-chain-1.1.11.tgz", + "_shasum": "aba09747dfbe4c3e70e766a6e41586e1859fc6f2", "_shrinkwrap": null, "_spec": "config-chain@~1.1.8", "_where": "C:\\Users\\samuele.STEAMWAREWIN\\Documents\\VisualStudioProjects\\StockMan\\StockManMVC\\node_modules\\npmconf", @@ -50,10 +54,10 @@ }, "directories": {}, "dist": { - "shasum": "7fc383de0fcc84d711cb465bd176579cad612346", - "tarball": "https://registry.npmjs.org/config-chain/-/config-chain-1.1.10.tgz" + "shasum": "aba09747dfbe4c3e70e766a6e41586e1859fc6f2", + "tarball": "https://registry.npmjs.org/config-chain/-/config-chain-1.1.11.tgz" }, - "gitHead": "0b6db3e14b9cdbe31460292bc4caf3983f977816", + "gitHead": "0976c33f2f126a060a289284bb031a5f7aeba329", "homepage": "http://github.com/dominictarr/config-chain", "installable": true, "licenses": [ @@ -81,5 +85,5 @@ "scripts": { "test": "tap test/" }, - "version": "1.1.10" + "version": "1.1.11" } diff --git a/StockManMVC/node_modules/config-chain/readme.markdown b/StockManMVC/node_modules/config-chain/readme.markdown index c83a430..a8d2637 100644 --- a/StockManMVC/node_modules/config-chain/readme.markdown +++ b/StockManMVC/node_modules/config-chain/readme.markdown @@ -2,6 +2,15 @@ USE THIS MODULE TO LOAD ALL YOUR CONFIGURATIONS +## NOTE: Feature Freeze + +[![locked](http://badges.github.io/stability-badges/dist/locked.svg)](http://github.com/badges/stability-badges) + +This module is frozen. + +In general, I'd recommend using [rc](https://github.com/dominictarr/rc) instead, +but as [npm](https://github.com/npmjs/npm) depends on this, it cannot be changed. + ``` js //npm install config-chain diff --git a/StockManMVC/node_modules/lodash/README.md b/StockManMVC/node_modules/lodash/README.md index 9fe97d8..72b66b2 100644 --- a/StockManMVC/node_modules/lodash/README.md +++ b/StockManMVC/node_modules/lodash/README.md @@ -1,4 +1,4 @@ -# lodash v4.16.2 +# lodash v4.16.4 The [Lodash](https://lodash.com/) library exported as [Node.js](https://nodejs.org/) modules. @@ -28,12 +28,12 @@ var at = require('lodash/at'); var curryN = require('lodash/fp/curryN'); ``` -See the [package source](https://github.com/lodash/lodash/tree/4.16.2-npm) for more details. +See the [package source](https://github.com/lodash/lodash/tree/4.16.4-npm) for more details. **Note:**
Install [n_](https://www.npmjs.com/package/n_) for Lodash use in the Node.js < 6 REPL. ## Support -Tested in Chrome 52-53, Firefox 47-48, IE 11, Edge 14, Safari 9-10, Node.js 4-6, & PhantomJS 2.1.1.
+Tested in Chrome 52-53, Firefox 48-49, IE 11, Edge 14, Safari 9-10, Node.js 4-6, & PhantomJS 2.1.1.
Automated [browser](https://saucelabs.com/u/lodash) & [CI](https://travis-ci.org/lodash/lodash/) test runs are available. diff --git a/StockManMVC/node_modules/lodash/_arrayLikeKeys.js b/StockManMVC/node_modules/lodash/_arrayLikeKeys.js index 0cb3b18..b2ec9ce 100644 --- a/StockManMVC/node_modules/lodash/_arrayLikeKeys.js +++ b/StockManMVC/node_modules/lodash/_arrayLikeKeys.js @@ -1,7 +1,9 @@ var baseTimes = require('./_baseTimes'), isArguments = require('./isArguments'), isArray = require('./isArray'), - isIndex = require('./_isIndex'); + isBuffer = require('./isBuffer'), + isIndex = require('./_isIndex'), + isTypedArray = require('./isTypedArray'); /** Used for built-in method references. */ var objectProto = Object.prototype; @@ -18,18 +20,26 @@ var hasOwnProperty = objectProto.hasOwnProperty; * @returns {Array} Returns the array of property names. */ function arrayLikeKeys(value, inherited) { - // Safari 8.1 makes `arguments.callee` enumerable in strict mode. - // Safari 9 makes `arguments.length` enumerable in strict mode. - var result = (isArray(value) || isArguments(value)) - ? baseTimes(value.length, String) - : []; - - var length = result.length, - skipIndexes = !!length; + var isArr = isArray(value), + isArg = !isArr && isArguments(value), + isBuff = !isArr && !isArg && isBuffer(value), + isType = !isArr && !isArg && !isBuff && isTypedArray(value), + skipIndexes = isArr || isArg || isBuff || isType, + result = skipIndexes ? baseTimes(value.length, String) : [], + length = result.length; for (var key in value) { if ((inherited || hasOwnProperty.call(value, key)) && - !(skipIndexes && (key == 'length' || isIndex(key, length)))) { + !(skipIndexes && ( + // Safari 9 has enumerable `arguments.length` in strict mode. + key == 'length' || + // Node.js 0.10 has enumerable non-index properties on buffers. + (isBuff && (key == 'offset' || key == 'parent')) || + // PhantomJS 2 has enumerable non-index properties on typed arrays. + (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) || + // Skip index properties. + isIndex(key, length) + ))) { result.push(key); } } diff --git a/StockManMVC/node_modules/lodash/_arraySampleSize.js b/StockManMVC/node_modules/lodash/_arraySampleSize.js index 9a9c017..8c7e364 100644 --- a/StockManMVC/node_modules/lodash/_arraySampleSize.js +++ b/StockManMVC/node_modules/lodash/_arraySampleSize.js @@ -1,4 +1,5 @@ -var copyArray = require('./_copyArray'), +var baseClamp = require('./_baseClamp'), + copyArray = require('./_copyArray'), shuffleSelf = require('./_shuffleSelf'); /** @@ -10,7 +11,7 @@ var copyArray = require('./_copyArray'), * @returns {Array} Returns the random elements. */ function arraySampleSize(array, n) { - return shuffleSelf(copyArray(array), n); + return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length)); } module.exports = arraySampleSize; diff --git a/StockManMVC/node_modules/lodash/_assignMergeValue.js b/StockManMVC/node_modules/lodash/_assignMergeValue.js index fe89875..cb1185e 100644 --- a/StockManMVC/node_modules/lodash/_assignMergeValue.js +++ b/StockManMVC/node_modules/lodash/_assignMergeValue.js @@ -12,7 +12,7 @@ var baseAssignValue = require('./_baseAssignValue'), */ function assignMergeValue(object, key, value) { if ((value !== undefined && !eq(object[key], value)) || - (typeof key == 'number' && value === undefined && !(key in object))) { + (value === undefined && !(key in object))) { baseAssignValue(object, key, value); } } diff --git a/StockManMVC/node_modules/lodash/_baseAssignValue.js b/StockManMVC/node_modules/lodash/_baseAssignValue.js index 0a93745..d6f66ef 100644 --- a/StockManMVC/node_modules/lodash/_baseAssignValue.js +++ b/StockManMVC/node_modules/lodash/_baseAssignValue.js @@ -1,5 +1,4 @@ -/** Built-in value references. */ -var defineProperty = Object.defineProperty; +var defineProperty = require('./_defineProperty'); /** * The base implementation of `assignValue` and `assignMergeValue` without diff --git a/StockManMVC/node_modules/lodash/_baseClone.js b/StockManMVC/node_modules/lodash/_baseClone.js index 8ac0fec..22ff841 100644 --- a/StockManMVC/node_modules/lodash/_baseClone.js +++ b/StockManMVC/node_modules/lodash/_baseClone.js @@ -118,9 +118,7 @@ function baseClone(value, isDeep, isFull, customizer, key, object, stack) { } stack.set(value, result); - if (!isArr) { - var props = isFull ? getAllKeys(value) : keys(value); - } + var props = isArr ? undefined : (isFull ? getAllKeys : keys)(value); arrayEach(props || value, function(subValue, key) { if (props) { key = subValue; diff --git a/StockManMVC/node_modules/lodash/_baseCreate.js b/StockManMVC/node_modules/lodash/_baseCreate.js index 81aa206..ffa6a52 100644 --- a/StockManMVC/node_modules/lodash/_baseCreate.js +++ b/StockManMVC/node_modules/lodash/_baseCreate.js @@ -20,7 +20,7 @@ var baseCreate = (function() { if (objectCreate) { return objectCreate(proto); } - object.prototype = prototype; + object.prototype = proto; var result = new object; object.prototype = undefined; return result; diff --git a/StockManMVC/node_modules/lodash/_baseIsArguments.js b/StockManMVC/node_modules/lodash/_baseIsArguments.js new file mode 100644 index 0000000..a176e18 --- /dev/null +++ b/StockManMVC/node_modules/lodash/_baseIsArguments.js @@ -0,0 +1,27 @@ +var isObjectLike = require('./isObjectLike'); + +/** `Object#toString` result references. */ +var argsTag = '[object Arguments]'; + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ +var objectToString = objectProto.toString; + +/** + * The base implementation of `_.isArguments`. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + */ +function baseIsArguments(value) { + return isObjectLike(value) && objectToString.call(value) == argsTag; +} + +module.exports = baseIsArguments; diff --git a/StockManMVC/node_modules/lodash/_baseIsEqualDeep.js b/StockManMVC/node_modules/lodash/_baseIsEqualDeep.js index 8d9a49f..42dc03d 100644 --- a/StockManMVC/node_modules/lodash/_baseIsEqualDeep.js +++ b/StockManMVC/node_modules/lodash/_baseIsEqualDeep.js @@ -4,6 +4,7 @@ var Stack = require('./_Stack'), equalObjects = require('./_equalObjects'), getTag = require('./_getTag'), isArray = require('./isArray'), + isBuffer = require('./isBuffer'), isTypedArray = require('./isTypedArray'); /** Used to compose bitmasks for comparison styles. */ @@ -53,6 +54,13 @@ function baseIsEqualDeep(object, other, equalFunc, customizer, bitmask, stack) { othIsObj = othTag == objectTag, isSameTag = objTag == othTag; + if (isSameTag && isBuffer(object)) { + if (!isBuffer(other)) { + return false; + } + objIsArr = true; + objIsObj = false; + } if (isSameTag && !objIsObj) { stack || (stack = new Stack); return (objIsArr || isTypedArray(object)) diff --git a/StockManMVC/node_modules/lodash/_baseMerge.js b/StockManMVC/node_modules/lodash/_baseMerge.js index dfb4b15..f4cb8c6 100644 --- a/StockManMVC/node_modules/lodash/_baseMerge.js +++ b/StockManMVC/node_modules/lodash/_baseMerge.js @@ -1,11 +1,9 @@ var Stack = require('./_Stack'), - arrayEach = require('./_arrayEach'), assignMergeValue = require('./_assignMergeValue'), - baseKeysIn = require('./_baseKeysIn'), + baseFor = require('./_baseFor'), baseMergeDeep = require('./_baseMergeDeep'), - isArray = require('./isArray'), isObject = require('./isObject'), - isTypedArray = require('./isTypedArray'); + keysIn = require('./keysIn'); /** * The base implementation of `_.merge` without support for multiple sources. @@ -22,14 +20,7 @@ function baseMerge(object, source, srcIndex, customizer, stack) { if (object === source) { return; } - if (!(isArray(source) || isTypedArray(source))) { - var props = baseKeysIn(source); - } - arrayEach(props || source, function(srcValue, key) { - if (props) { - key = srcValue; - srcValue = source[key]; - } + baseFor(source, function(srcValue, key) { if (isObject(srcValue)) { stack || (stack = new Stack); baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack); @@ -44,7 +35,7 @@ function baseMerge(object, source, srcIndex, customizer, stack) { } assignMergeValue(object, key, newValue); } - }); + }, keysIn); } module.exports = baseMerge; diff --git a/StockManMVC/node_modules/lodash/_baseMergeDeep.js b/StockManMVC/node_modules/lodash/_baseMergeDeep.js index 535c0d1..42b405a 100644 --- a/StockManMVC/node_modules/lodash/_baseMergeDeep.js +++ b/StockManMVC/node_modules/lodash/_baseMergeDeep.js @@ -1,9 +1,12 @@ var assignMergeValue = require('./_assignMergeValue'), - baseClone = require('./_baseClone'), + cloneBuffer = require('./_cloneBuffer'), + cloneTypedArray = require('./_cloneTypedArray'), copyArray = require('./_copyArray'), + initCloneObject = require('./_initCloneObject'), isArguments = require('./isArguments'), isArray = require('./isArray'), isArrayLikeObject = require('./isArrayLikeObject'), + isBuffer = require('./isBuffer'), isFunction = require('./isFunction'), isObject = require('./isObject'), isPlainObject = require('./isPlainObject'), @@ -41,29 +44,37 @@ function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, sta var isCommon = newValue === undefined; if (isCommon) { + var isArr = isArray(srcValue), + isBuff = !isArr && isBuffer(srcValue), + isTyped = !isArr && !isBuff && isTypedArray(srcValue); + newValue = srcValue; - if (isArray(srcValue) || isTypedArray(srcValue)) { + if (isArr || isBuff || isTyped) { if (isArray(objValue)) { newValue = objValue; } else if (isArrayLikeObject(objValue)) { newValue = copyArray(objValue); } - else { + else if (isBuff) { isCommon = false; - newValue = baseClone(srcValue, true); + newValue = cloneBuffer(srcValue, true); + } + else if (isTyped) { + isCommon = false; + newValue = cloneTypedArray(srcValue, true); + } + else { + newValue = []; } } else if (isPlainObject(srcValue) || isArguments(srcValue)) { + newValue = objValue; if (isArguments(objValue)) { newValue = toPlainObject(objValue); } else if (!isObject(objValue) || (srcIndex && isFunction(objValue))) { - isCommon = false; - newValue = baseClone(srcValue, true); - } - else { - newValue = objValue; + newValue = initCloneObject(srcValue); } } else { diff --git a/StockManMVC/node_modules/lodash/_baseSampleSize.js b/StockManMVC/node_modules/lodash/_baseSampleSize.js index 638215d..5c90ec5 100644 --- a/StockManMVC/node_modules/lodash/_baseSampleSize.js +++ b/StockManMVC/node_modules/lodash/_baseSampleSize.js @@ -1,4 +1,5 @@ -var shuffleSelf = require('./_shuffleSelf'), +var baseClamp = require('./_baseClamp'), + shuffleSelf = require('./_shuffleSelf'), values = require('./values'); /** @@ -10,7 +11,8 @@ var shuffleSelf = require('./_shuffleSelf'), * @returns {Array} Returns the random elements. */ function baseSampleSize(collection, n) { - return shuffleSelf(values(collection), n); + var array = values(collection); + return shuffleSelf(array, baseClamp(n, 0, array.length)); } module.exports = baseSampleSize; diff --git a/StockManMVC/node_modules/lodash/_baseSetToString.js b/StockManMVC/node_modules/lodash/_baseSetToString.js index 224a65a..89eaca3 100644 --- a/StockManMVC/node_modules/lodash/_baseSetToString.js +++ b/StockManMVC/node_modules/lodash/_baseSetToString.js @@ -1,6 +1,6 @@ var constant = require('./constant'), - identity = require('./identity'), - nativeDefineProperty = require('./_nativeDefineProperty'); + defineProperty = require('./_defineProperty'), + identity = require('./identity'); /** * The base implementation of `setToString` without support for hot loop shorting. @@ -10,8 +10,8 @@ var constant = require('./constant'), * @param {Function} string The `toString` result. * @returns {Function} Returns `func`. */ -var baseSetToString = !nativeDefineProperty ? identity : function(func, string) { - return nativeDefineProperty(func, 'toString', { +var baseSetToString = !defineProperty ? identity : function(func, string) { + return defineProperty(func, 'toString', { 'configurable': true, 'enumerable': false, 'value': constant(string), diff --git a/StockManMVC/node_modules/lodash/_baseToString.js b/StockManMVC/node_modules/lodash/_baseToString.js index 462e26f..ada6ad2 100644 --- a/StockManMVC/node_modules/lodash/_baseToString.js +++ b/StockManMVC/node_modules/lodash/_baseToString.js @@ -1,4 +1,6 @@ var Symbol = require('./_Symbol'), + arrayMap = require('./_arrayMap'), + isArray = require('./isArray'), isSymbol = require('./isSymbol'); /** Used as references for various `Number` constants. */ @@ -21,6 +23,10 @@ function baseToString(value) { if (typeof value == 'string') { return value; } + if (isArray(value)) { + // Recursively convert values (susceptible to call stack limits). + return arrayMap(value, baseToString) + ''; + } if (isSymbol(value)) { return symbolToString ? symbolToString.call(value) : ''; } diff --git a/StockManMVC/node_modules/lodash/_defineProperty.js b/StockManMVC/node_modules/lodash/_defineProperty.js new file mode 100644 index 0000000..b6116d9 --- /dev/null +++ b/StockManMVC/node_modules/lodash/_defineProperty.js @@ -0,0 +1,11 @@ +var getNative = require('./_getNative'); + +var defineProperty = (function() { + try { + var func = getNative(Object, 'defineProperty'); + func({}, '', {}); + return func; + } catch (e) {} +}()); + +module.exports = defineProperty; diff --git a/StockManMVC/node_modules/lodash/_nativeDefineProperty.js b/StockManMVC/node_modules/lodash/_nativeDefineProperty.js deleted file mode 100644 index 38ed486..0000000 --- a/StockManMVC/node_modules/lodash/_nativeDefineProperty.js +++ /dev/null @@ -1,6 +0,0 @@ -var getNative = require('./_getNative'); - -/* Built-in method references that are verified to be native. */ -var nativeDefineProperty = getNative(Object, 'defineProperty'); - -module.exports = nativeDefineProperty; diff --git a/StockManMVC/node_modules/lodash/_shuffleSelf.js b/StockManMVC/node_modules/lodash/_shuffleSelf.js index 1b62295..8bcc4f5 100644 --- a/StockManMVC/node_modules/lodash/_shuffleSelf.js +++ b/StockManMVC/node_modules/lodash/_shuffleSelf.js @@ -1,5 +1,4 @@ -var baseClamp = require('./_baseClamp'), - baseRandom = require('./_baseRandom'); +var baseRandom = require('./_baseRandom'); /** * A specialized version of `_.shuffle` which mutates and sets the size of `array`. @@ -14,7 +13,7 @@ function shuffleSelf(array, size) { length = array.length, lastIndex = length - 1; - size = size === undefined ? length : baseClamp(size, 0, length); + size = size === undefined ? length : size; while (++index < size) { var rand = baseRandom(index, lastIndex), value = array[rand]; diff --git a/StockManMVC/node_modules/lodash/core.js b/StockManMVC/node_modules/lodash/core.js index 6b7641e..c891e78 100644 --- a/StockManMVC/node_modules/lodash/core.js +++ b/StockManMVC/node_modules/lodash/core.js @@ -13,7 +13,7 @@ var undefined; /** Used as the semantic version number. */ - var VERSION = '4.16.2'; + var VERSION = '4.16.4'; /** Error message constants. */ var FUNC_ERROR_TEXT = 'Expected a function'; @@ -40,6 +40,7 @@ genTag = '[object GeneratorFunction]', numberTag = '[object Number]', objectTag = '[object Object]', + proxyTag = '[object Proxy]', regexpTag = '[object RegExp]', stringTag = '[object String]'; @@ -369,7 +370,7 @@ if (objectCreate) { return objectCreate(proto); } - object.prototype = prototype; + object.prototype = proto; var result = new object; object.prototype = undefined; return result; @@ -622,6 +623,15 @@ return value > other; } + /** + * The base implementation of `_.isArguments`. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + */ + var baseIsArguments = noop; + /** * The base implementation of `_.isDate` without Node.js optimizations. * @@ -2433,11 +2443,10 @@ * _.isArguments([1, 2, 3]); * // => false */ - function isArguments(value) { - // Safari 8.1 makes `arguments.callee` enumerable in strict mode. - return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && - (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag); - } + var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) { + return isObjectLike(value) && hasOwnProperty.call(value, 'callee') && + !propertyIsEnumerable.call(value, 'callee'); + }; /** * Checks if `value` is classified as an `Array` object. @@ -2493,35 +2502,6 @@ return value != null && isLength(value.length) && !isFunction(value); } - /** - * This method is like `_.isArrayLike` except that it also checks if `value` - * is an object. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an array-like object, - * else `false`. - * @example - * - * _.isArrayLikeObject([1, 2, 3]); - * // => true - * - * _.isArrayLikeObject(document.body.children); - * // => true - * - * _.isArrayLikeObject('abc'); - * // => false - * - * _.isArrayLikeObject(_.noop); - * // => false - */ - function isArrayLikeObject(value) { - return isObjectLike(value) && isArrayLike(value); - } - /** * Checks if `value` is classified as a boolean primitive or object. * @@ -2686,9 +2666,9 @@ */ function isFunction(value) { // The use of `Object#toString` avoids issues with the `typeof` operator - // in Safari 8-9 which returns 'object' for typed array and other constructors. + // in Safari 9 which returns 'object' for typed array and other constructors. var tag = isObject(value) ? objectToString.call(value) : ''; - return tag == funcTag || tag == genTag; + return tag == funcTag || tag == genTag || tag == proxyTag; } /** @@ -3020,8 +3000,8 @@ * @memberOf _ * @since 4.0.0 * @category Lang - * @param {*} value The value to process. - * @returns {string} Returns the string. + * @param {*} value The value to convert. + * @returns {string} Returns the converted string. * @example * * _.toString(null); diff --git a/StockManMVC/node_modules/lodash/core.min.js b/StockManMVC/node_modules/lodash/core.min.js index f0d1cf2..c1fb1cd 100644 --- a/StockManMVC/node_modules/lodash/core.min.js +++ b/StockManMVC/node_modules/lodash/core.min.js @@ -3,27 +3,27 @@ * lodash (Custom Build) /license | Underscore.js 1.8.3 underscorejs.org/LICENSE * Build: `lodash core -o ./dist/lodash.core.js` */ -;(function(){function n(n,t){return n.push.apply(n,t),n}function t(n){return function(t){return null==t?nn:t[n]}}function r(n,t,r,e,u){return u(n,function(n,u,o){r=e?(e=false,n):t(r,n,u,o)}),r}function e(n,t){return j(t,function(t){return n[t]})}function u(n){return n instanceof o?n:new o(n)}function o(n,t){this.__wrapped__=n,this.__actions__=[],this.__chain__=!!t}function i(n,t,r,e){return n===nn||M(n,ln[r])&&!pn.call(e,r)?t:n}function c(n,t,r){if(typeof n!="function")throw new TypeError("Expected a function"); -return setTimeout(function(){n.apply(nn,r)},t)}function f(n,t){var r=true;return mn(n,function(n,e,u){return r=!!t(n,e,u)}),r}function a(n,t,r){for(var e=-1,u=n.length;++et}function y(n,t,r,e,u){return n===t||(null==n||null==t||!H(n)&&!K(t)?n!==n&&t!==t:b(n,t,y,r,e,u))}function b(n,t,r,e,u,o){var i=Sn(n),c=Sn(t),f="[object Array]",a="[object Array]";i||(f=hn.call(n),f="[object Arguments]"==f?"[object Object]":f),c||(a=hn.call(t),a="[object Arguments]"==a?"[object Object]":a);var l="[object Object]"==f,c="[object Object]"==a,a=f==a;o||(o=[]);var p=En(o,function(t){return t[0]==n}),s=En(o,function(n){ -return n[0]==t});if(p&&s)return p[1]==t;if(o.push([n,t]),o.push([t,n]),a&&!l){if(i)r=F(n,t,r,e,u,o);else n:{switch(f){case"[object Boolean]":case"[object Date]":case"[object Number]":r=M(+n,+t);break n;case"[object Error]":r=n.name==t.name&&n.message==t.message;break n;case"[object RegExp]":case"[object String]":r=n==t+"";break n}r=false}return o.pop(),r}return 2&u||(i=l&&pn.call(n,"__wrapped__"),f=c&&pn.call(t,"__wrapped__"),!i&&!f)?!!a&&(r=B(n,t,r,e,u,o),o.pop(),r):(i=i?n.value():n,f=f?t.value():t, -r=r(i,f,e,u,o),o.pop(),r)}function g(n){return typeof n=="function"?n:null==n?Y:(typeof n=="object"?d:t)(n)}function _(n,t){return nt&&(t=-t>u?0:u+t),r=r>u?u:r,0>r&&(r+=u),u=t>r?0:r-t>>>0,t>>>=0,r=Array(u);++ei))return false;for(var c=-1,f=true,a=1&u?[]:nn;++cr?jn(e+r,0):r:0,r=(r||0)-1;for(var u=t===t;++rarguments.length,mn)}function J(n,t){ -var r;if(typeof t!="function")throw new TypeError("Expected a function");return n=Tn(n),function(){return 0<--n&&(r=t.apply(this,arguments)),1>=n&&(t=nn),r}}function M(n,t){return n===t||n!==n&&t!==t}function P(n){return K(n)&&U(n)&&pn.call(n,"callee")&&(!bn.call(n,"callee")||"[object Arguments]"==hn.call(n))}function U(n){var t;return(t=null!=n)&&(t=n.length,t=typeof t=="number"&&-1=t),t&&!V(n)}function V(n){return n=H(n)?hn.call(n):"","[object Function]"==n||"[object GeneratorFunction]"==n; -}function H(n){var t=typeof n;return null!=n&&("object"==t||"function"==t)}function K(n){return null!=n&&typeof n=="object"}function L(n){return typeof n=="number"||K(n)&&"[object Number]"==hn.call(n)}function Q(n){return typeof n=="string"||!Sn(n)&&K(n)&&"[object String]"==hn.call(n)}function W(n){return typeof n=="string"?n:null==n?"":n+""}function X(n){return n?e(n,qn(n)):[]}function Y(n){return n}function Z(t,r,e){var u=qn(r),o=h(r,u);null!=e||H(r)&&(o.length||!u.length)||(e=r,r=t,t=this,o=h(r,qn(r))); -var i=!(H(e)&&"chain"in e&&!e.chain),c=V(t);return mn(o,function(e){var u=r[e];t[e]=u,c&&(t.prototype[e]=function(){var r=this.__chain__;if(i||r){var e=t(this.__wrapped__);return(e.__actions__=A(this.__actions__)).push({func:u,args:arguments,thisArg:t}),e.__chain__=r,e}return u.apply(t,n([this.value()],arguments))})}),t}var nn,tn=1/0,rn=/[&<>"']/g,en=RegExp(rn.source),un=typeof self=="object"&&self&&self.Object===Object&&self,on=typeof global=="object"&&global&&global.Object===Object&&global||un||Function("return this")(),cn=(un=typeof exports=="object"&&exports&&!exports.nodeType&&exports)&&typeof module=="object"&&module&&!module.nodeType&&module,fn=function(n){ -return function(t){return null==n?nn:n[t]}}({"&":"&","<":"<",">":">",'"':""","'":"'"}),an=Array.prototype,ln=Object.prototype,pn=ln.hasOwnProperty,sn=0,hn=ln.toString,vn=on._,yn=Object.create,bn=ln.propertyIsEnumerable,gn=on.isFinite,_n=function(n,t){return function(r){return n(t(r))}}(Object.keys,Object),jn=Math.max,dn=function(){function n(){}return function(t){return H(t)?yn?yn(t):(n.prototype=prototype,t=new n,n.prototype=nn,t):{}}}();o.prototype=dn(u.prototype),o.prototype.constructor=o; -var mn=function(n,t){return function(r,e){if(null==r)return r;if(!U(r))return n(r,e);for(var u=r.length,o=t?u:-1,i=Object(r);(t?o--:++or&&(r=jn(e+r,0));n:{for(t=g(t),e=n.length,r+=-1;++re||o&&c&&a||!u&&a||!i){r=1;break n}if(!o&&rt}function b(n,t,r,e,u){return n===t||(null==n||null==t||!H(n)&&!K(t)?n!==n&&t!==t:g(n,t,b,r,e,u))}function g(n,t,r,e,u,o){var i=Sn(n),c=Sn(t),f="[object Array]",a="[object Array]";i||(f=hn.call(n),f="[object Arguments]"==f?"[object Object]":f),c||(a=hn.call(t),a="[object Arguments]"==a?"[object Object]":a);var l="[object Object]"==f,c="[object Object]"==a,a=f==a;o||(o=[]); +var p=En(o,function(t){return t[0]==n}),s=En(o,function(n){return n[0]==t});if(p&&s)return p[1]==t;if(o.push([n,t]),o.push([t,n]),a&&!l){if(i)r=B(n,t,r,e,u,o);else n:{switch(f){case"[object Boolean]":case"[object Date]":case"[object Number]":r=M(+n,+t);break n;case"[object Error]":r=n.name==t.name&&n.message==t.message;break n;case"[object RegExp]":case"[object String]":r=n==t+"";break n}r=false}return o.pop(),r}return 2&u||(i=l&&pn.call(n,"__wrapped__"),f=c&&pn.call(t,"__wrapped__"),!i&&!f)?!!a&&(r=R(n,t,r,e,u,o), +o.pop(),r):(i=i?n.value():n,f=f?t.value():t,r=r(i,f,e,u,o),o.pop(),r)}function _(n){return typeof n=="function"?n:null==n?Y:(typeof n=="object"?m:r)(n)}function j(n,t){return nt&&(t=-t>u?0:u+t),r=r>u?u:r,0>r&&(r+=u),u=t>r?0:r-t>>>0,t>>>=0,r=Array(u);++ei))return false;for(var c=-1,f=true,a=1&u?[]:nn;++cr?jn(e+r,0):r:0,r=(r||0)-1;for(var u=t===t;++rarguments.length,mn); +}function J(n,t){var r;if(typeof t!="function")throw new TypeError("Expected a function");return n=Tn(n),function(){return 0<--n&&(r=t.apply(this,arguments)),1>=n&&(t=nn),r}}function M(n,t){return n===t||n!==n&&t!==t}function U(n){var t;return(t=null!=n)&&(t=n.length,t=typeof t=="number"&&-1=t),t&&!V(n)}function V(n){return n=H(n)?hn.call(n):"","[object Function]"==n||"[object GeneratorFunction]"==n||"[object Proxy]"==n}function H(n){var t=typeof n;return null!=n&&("object"==t||"function"==t); +}function K(n){return null!=n&&typeof n=="object"}function L(n){return typeof n=="number"||K(n)&&"[object Number]"==hn.call(n)}function Q(n){return typeof n=="string"||!Sn(n)&&K(n)&&"[object String]"==hn.call(n)}function W(n){return typeof n=="string"?n:null==n?"":n+""}function X(n){return n?u(n,qn(n)):[]}function Y(n){return n}function Z(n,r,e){var u=qn(r),o=v(r,u);null!=e||H(r)&&(o.length||!u.length)||(e=r,r=n,n=this,o=v(r,qn(r)));var i=!(H(e)&&"chain"in e&&!e.chain),c=V(n);return mn(o,function(e){ +var u=r[e];n[e]=u,c&&(n.prototype[e]=function(){var r=this.__chain__;if(i||r){var e=n(this.__wrapped__);return(e.__actions__=E(this.__actions__)).push({func:u,args:arguments,thisArg:n}),e.__chain__=r,e}return u.apply(n,t([this.value()],arguments))})}),n}var nn,tn=1/0,rn=/[&<>"']/g,en=RegExp(rn.source),un=typeof self=="object"&&self&&self.Object===Object&&self,on=typeof global=="object"&&global&&global.Object===Object&&global||un||Function("return this")(),cn=(un=typeof exports=="object"&&exports&&!exports.nodeType&&exports)&&typeof module=="object"&&module&&!module.nodeType&&module,fn=function(n){ +return function(t){return null==n?nn:n[t]}}({"&":"&","<":"<",">":">",'"':""","'":"'"}),an=Array.prototype,ln=Object.prototype,pn=ln.hasOwnProperty,sn=0,hn=ln.toString,vn=on._,yn=Object.create,bn=ln.propertyIsEnumerable,gn=on.isFinite,_n=function(n,t){return function(r){return n(t(r))}}(Object.keys,Object),jn=Math.max,dn=function(){function n(){}return function(t){return H(t)?yn?yn(t):(n.prototype=t,t=new n,n.prototype=nn,t):{}}}();i.prototype=dn(o.prototype),i.prototype.constructor=i; +var mn=function(n,t){return function(r,e){if(null==r)return r;if(!U(r))return n(r,e);for(var u=r.length,o=t?u:-1,i=Object(r);(t?o--:++or&&(r=jn(e+r,0));n:{for(t=_(t),e=n.length,r+=-1;++re||o&&c&&a||!u&&a||!i){r=1;break n}if(!o&&r false */ -function isArguments(value) { - // Safari 8.1 makes `arguments.callee` enumerable in strict mode. - return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && - (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag); -} +var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) { + return isObjectLike(value) && hasOwnProperty.call(value, 'callee') && + !propertyIsEnumerable.call(value, 'callee'); +}; module.exports = isArguments; diff --git a/StockManMVC/node_modules/lodash/isEmpty.js b/StockManMVC/node_modules/lodash/isEmpty.js index 4bee455..e190425 100644 --- a/StockManMVC/node_modules/lodash/isEmpty.js +++ b/StockManMVC/node_modules/lodash/isEmpty.js @@ -1,10 +1,11 @@ -var getTag = require('./_getTag'), +var baseKeys = require('./_baseKeys'), + getTag = require('./_getTag'), isArguments = require('./isArguments'), isArray = require('./isArray'), isArrayLike = require('./isArrayLike'), isBuffer = require('./isBuffer'), isPrototype = require('./_isPrototype'), - nativeKeys = require('./_nativeKeys'); + isTypedArray = require('./isTypedArray'); /** `Object#toString` result references. */ var mapTag = '[object Map]', @@ -51,8 +52,8 @@ var hasOwnProperty = objectProto.hasOwnProperty; */ function isEmpty(value) { if (isArrayLike(value) && - (isArray(value) || typeof value == 'string' || - typeof value.splice == 'function' || isBuffer(value) || isArguments(value))) { + (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' || + isBuffer(value) || isTypedArray(value) || isArguments(value))) { return !value.length; } var tag = getTag(value); @@ -60,7 +61,7 @@ function isEmpty(value) { return !value.size; } if (isPrototype(value)) { - return !nativeKeys(value).length; + return !baseKeys(value).length; } for (var key in value) { if (hasOwnProperty.call(value, key)) { diff --git a/StockManMVC/node_modules/lodash/isFunction.js b/StockManMVC/node_modules/lodash/isFunction.js index f1d440b..17ccf32 100644 --- a/StockManMVC/node_modules/lodash/isFunction.js +++ b/StockManMVC/node_modules/lodash/isFunction.js @@ -2,7 +2,8 @@ var isObject = require('./isObject'); /** `Object#toString` result references. */ var funcTag = '[object Function]', - genTag = '[object GeneratorFunction]'; + genTag = '[object GeneratorFunction]', + proxyTag = '[object Proxy]'; /** Used for built-in method references. */ var objectProto = Object.prototype; @@ -33,9 +34,9 @@ var objectToString = objectProto.toString; */ function isFunction(value) { // The use of `Object#toString` avoids issues with the `typeof` operator - // in Safari 8-9 which returns 'object' for typed array and other constructors. + // in Safari 9 which returns 'object' for typed array and other constructors. var tag = isObject(value) ? objectToString.call(value) : ''; - return tag == funcTag || tag == genTag; + return tag == funcTag || tag == genTag || tag == proxyTag; } module.exports = isFunction; diff --git a/StockManMVC/node_modules/lodash/lodash.js b/StockManMVC/node_modules/lodash/lodash.js index 0944c4c..361e74d 100644 --- a/StockManMVC/node_modules/lodash/lodash.js +++ b/StockManMVC/node_modules/lodash/lodash.js @@ -12,7 +12,7 @@ var undefined; /** Used as the semantic version number. */ - var VERSION = '4.16.2'; + var VERSION = '4.16.4'; /** Used as the size to enable large array optimizations. */ var LARGE_ARRAY_SIZE = 200; @@ -95,6 +95,7 @@ numberTag = '[object Number]', objectTag = '[object Object]', promiseTag = '[object Promise]', + proxyTag = '[object Proxy]', regexpTag = '[object RegExp]', setTag = '[object Set]', stringTag = '[object String]', @@ -1469,7 +1470,6 @@ Symbol = context.Symbol, Uint8Array = context.Uint8Array, allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined, - defineProperty = Object.defineProperty, getPrototype = overArg(Object.getPrototypeOf, Object), iteratorSymbol = Symbol ? Symbol.iterator : undefined, objectCreate = Object.create, @@ -1477,6 +1477,14 @@ splice = arrayProto.splice, spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined; + var defineProperty = (function() { + try { + var func = getNative(Object, 'defineProperty'); + func({}, '', {}); + return func; + } catch (e) {} + }()); + /** Mocked built-ins. */ var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout, ctxNow = Date && Date.now !== root.Date.now && Date.now, @@ -1503,8 +1511,7 @@ Promise = getNative(context, 'Promise'), Set = getNative(context, 'Set'), WeakMap = getNative(context, 'WeakMap'), - nativeCreate = getNative(Object, 'create'), - nativeDefineProperty = getNative(Object, 'defineProperty'); + nativeCreate = getNative(Object, 'create'); /** Used to store function metadata. */ var metaMap = WeakMap && new WeakMap; @@ -1672,7 +1679,7 @@ if (objectCreate) { return objectCreate(proto); } - object.prototype = prototype; + object.prototype = proto; var result = new object; object.prototype = undefined; return result; @@ -2380,18 +2387,26 @@ * @returns {Array} Returns the array of property names. */ function arrayLikeKeys(value, inherited) { - // Safari 8.1 makes `arguments.callee` enumerable in strict mode. - // Safari 9 makes `arguments.length` enumerable in strict mode. - var result = (isArray(value) || isArguments(value)) - ? baseTimes(value.length, String) - : []; - - var length = result.length, - skipIndexes = !!length; + var isArr = isArray(value), + isArg = !isArr && isArguments(value), + isBuff = !isArr && !isArg && isBuffer(value), + isType = !isArr && !isArg && !isBuff && isTypedArray(value), + skipIndexes = isArr || isArg || isBuff || isType, + result = skipIndexes ? baseTimes(value.length, String) : [], + length = result.length; for (var key in value) { if ((inherited || hasOwnProperty.call(value, key)) && - !(skipIndexes && (key == 'length' || isIndex(key, length)))) { + !(skipIndexes && ( + // Safari 9 has enumerable `arguments.length` in strict mode. + key == 'length' || + // Node.js 0.10 has enumerable non-index properties on buffers. + (isBuff && (key == 'offset' || key == 'parent')) || + // PhantomJS 2 has enumerable non-index properties on typed arrays. + (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) || + // Skip index properties. + isIndex(key, length) + ))) { result.push(key); } } @@ -2419,7 +2434,7 @@ * @returns {Array} Returns the random elements. */ function arraySampleSize(array, n) { - return shuffleSelf(copyArray(array), n); + return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length)); } /** @@ -2462,7 +2477,7 @@ */ function assignMergeValue(object, key, value) { if ((value !== undefined && !eq(object[key], value)) || - (typeof key == 'number' && value === undefined && !(key in object))) { + (value === undefined && !(key in object))) { baseAssignValue(object, key, value); } } @@ -2655,9 +2670,7 @@ } stack.set(value, result); - if (!isArr) { - var props = isFull ? getAllKeys(value) : keys(value); - } + var props = isArr ? undefined : (isFull ? getAllKeys : keys)(value); arrayEach(props || value, function(subValue, key) { if (props) { key = subValue; @@ -3191,6 +3204,17 @@ return func == null ? undefined : apply(func, object, args); } + /** + * The base implementation of `_.isArguments`. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + */ + function baseIsArguments(value) { + return isObjectLike(value) && objectToString.call(value) == argsTag; + } + /** * The base implementation of `_.isArrayBuffer` without Node.js optimizations. * @@ -3271,6 +3295,13 @@ othIsObj = othTag == objectTag, isSameTag = objTag == othTag; + if (isSameTag && isBuffer(object)) { + if (!isBuffer(other)) { + return false; + } + objIsArr = true; + objIsObj = false; + } if (isSameTag && !objIsObj) { stack || (stack = new Stack); return (objIsArr || isTypedArray(object)) @@ -3560,14 +3591,7 @@ if (object === source) { return; } - if (!(isArray(source) || isTypedArray(source))) { - var props = baseKeysIn(source); - } - arrayEach(props || source, function(srcValue, key) { - if (props) { - key = srcValue; - srcValue = source[key]; - } + baseFor(source, function(srcValue, key) { if (isObject(srcValue)) { stack || (stack = new Stack); baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack); @@ -3582,7 +3606,7 @@ } assignMergeValue(object, key, newValue); } - }); + }, keysIn); } /** @@ -3616,29 +3640,37 @@ var isCommon = newValue === undefined; if (isCommon) { + var isArr = isArray(srcValue), + isBuff = !isArr && isBuffer(srcValue), + isTyped = !isArr && !isBuff && isTypedArray(srcValue); + newValue = srcValue; - if (isArray(srcValue) || isTypedArray(srcValue)) { + if (isArr || isBuff || isTyped) { if (isArray(objValue)) { newValue = objValue; } else if (isArrayLikeObject(objValue)) { newValue = copyArray(objValue); } - else { + else if (isBuff) { isCommon = false; - newValue = baseClone(srcValue, true); + newValue = cloneBuffer(srcValue, true); + } + else if (isTyped) { + isCommon = false; + newValue = cloneTypedArray(srcValue, true); + } + else { + newValue = []; } } else if (isPlainObject(srcValue) || isArguments(srcValue)) { + newValue = objValue; if (isArguments(objValue)) { newValue = toPlainObject(objValue); } else if (!isObject(objValue) || (srcIndex && isFunction(objValue))) { - isCommon = false; - newValue = baseClone(srcValue, true); - } - else { - newValue = objValue; + newValue = initCloneObject(srcValue); } } else { @@ -3920,7 +3952,8 @@ * @returns {Array} Returns the random elements. */ function baseSampleSize(collection, n) { - return shuffleSelf(values(collection), n); + var array = values(collection); + return shuffleSelf(array, baseClamp(n, 0, array.length)); } /** @@ -3984,8 +4017,8 @@ * @param {Function} string The `toString` result. * @returns {Function} Returns `func`. */ - var baseSetToString = !nativeDefineProperty ? identity : function(func, string) { - return nativeDefineProperty(func, 'toString', { + var baseSetToString = !defineProperty ? identity : function(func, string) { + return defineProperty(func, 'toString', { 'configurable': true, 'enumerable': false, 'value': constant(string), @@ -4197,6 +4230,10 @@ if (typeof value == 'string') { return value; } + if (isArray(value)) { + // Recursively convert values (susceptible to call stack limits). + return arrayMap(value, baseToString) + ''; + } if (isSymbol(value)) { return symbolToString ? symbolToString.call(value) : ''; } @@ -6592,7 +6629,7 @@ length = array.length, lastIndex = length - 1; - size = size === undefined ? length : baseClamp(size, 0, length); + size = size === undefined ? length : size; while (++index < size) { var rand = baseRandom(index, lastIndex), value = array[rand]; @@ -11165,11 +11202,10 @@ * _.isArguments([1, 2, 3]); * // => false */ - function isArguments(value) { - // Safari 8.1 makes `arguments.callee` enumerable in strict mode. - return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && - (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag); - } + var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) { + return isObjectLike(value) && hasOwnProperty.call(value, 'callee') && + !propertyIsEnumerable.call(value, 'callee'); + }; /** * Checks if `value` is classified as an `Array` object. @@ -11389,8 +11425,8 @@ */ function isEmpty(value) { if (isArrayLike(value) && - (isArray(value) || typeof value == 'string' || - typeof value.splice == 'function' || isBuffer(value) || isArguments(value))) { + (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' || + isBuffer(value) || isTypedArray(value) || isArguments(value))) { return !value.length; } var tag = getTag(value); @@ -11398,7 +11434,7 @@ return !value.size; } if (isPrototype(value)) { - return !nativeKeys(value).length; + return !baseKeys(value).length; } for (var key in value) { if (hasOwnProperty.call(value, key)) { @@ -11553,9 +11589,9 @@ */ function isFunction(value) { // The use of `Object#toString` avoids issues with the `typeof` operator - // in Safari 8-9 which returns 'object' for typed array and other constructors. + // in Safari 9 which returns 'object' for typed array and other constructors. var tag = isObject(value) ? objectToString.call(value) : ''; - return tag == funcTag || tag == genTag; + return tag == funcTag || tag == genTag || tag == proxyTag; } /** @@ -12443,8 +12479,8 @@ * @memberOf _ * @since 4.0.0 * @category Lang - * @param {*} value The value to process. - * @returns {string} Returns the string. + * @param {*} value The value to convert. + * @returns {string} Returns the converted string. * @example * * _.toString(null); @@ -13628,22 +13664,23 @@ * // => { '1': ['a', 'c'], '2': ['b'] } */ function transform(object, iteratee, accumulator) { - var isArr = isArray(object) || isTypedArray(object); - iteratee = getIteratee(iteratee, 4); + var isArr = isArray(object), + isArrLike = isArr || isBuffer(object) || isTypedArray(object); + iteratee = getIteratee(iteratee, 4); if (accumulator == null) { - if (isArr || isObject(object)) { - var Ctor = object.constructor; - if (isArr) { - accumulator = isArray(object) ? new Ctor : []; - } else { - accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {}; - } - } else { + var Ctor = object && object.constructor; + if (isArrLike) { + accumulator = isArr ? new Ctor : []; + } + else if (isObject(object)) { + accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {}; + } + else { accumulator = {}; } } - (isArr ? arrayEach : baseForOwn)(object, function(value, index, object) { + (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) { return iteratee(accumulator, value, index, object); }); return accumulator; diff --git a/StockManMVC/node_modules/lodash/lodash.min.js b/StockManMVC/node_modules/lodash/lodash.min.js index 6534ae3..4bf932b 100644 --- a/StockManMVC/node_modules/lodash/lodash.min.js +++ b/StockManMVC/node_modules/lodash/lodash.min.js @@ -17,116 +17,118 @@ t:{try{Mt=Kt&&Kt.g("util");break t}catch(t){}Mt=void 0}var Gt=Mt&&Mt.isArrayBuff "\u0107":"c","\u0109":"c","\u010b":"c","\u010d":"c","\u010e":"D","\u0110":"D","\u010f":"d","\u0111":"d","\u0112":"E","\u0114":"E","\u0116":"E","\u0118":"E","\u011a":"E","\u0113":"e","\u0115":"e","\u0117":"e","\u0119":"e","\u011b":"e","\u011c":"G","\u011e":"G","\u0120":"G","\u0122":"G","\u011d":"g","\u011f":"g","\u0121":"g","\u0123":"g","\u0124":"H","\u0126":"H","\u0125":"h","\u0127":"h","\u0128":"I","\u012a":"I","\u012c":"I","\u012e":"I","\u0130":"I","\u0129":"i","\u012b":"i","\u012d":"i","\u012f":"i", "\u0131":"i","\u0134":"J","\u0135":"j","\u0136":"K","\u0137":"k","\u0138":"k","\u0139":"L","\u013b":"L","\u013d":"L","\u013f":"L","\u0141":"L","\u013a":"l","\u013c":"l","\u013e":"l","\u0140":"l","\u0142":"l","\u0143":"N","\u0145":"N","\u0147":"N","\u014a":"N","\u0144":"n","\u0146":"n","\u0148":"n","\u014b":"n","\u014c":"O","\u014e":"O","\u0150":"O","\u014d":"o","\u014f":"o","\u0151":"o","\u0154":"R","\u0156":"R","\u0158":"R","\u0155":"r","\u0157":"r","\u0159":"r","\u015a":"S","\u015c":"S","\u015e":"S", "\u0160":"S","\u015b":"s","\u015d":"s","\u015f":"s","\u0161":"s","\u0162":"T","\u0164":"T","\u0166":"T","\u0163":"t","\u0165":"t","\u0167":"t","\u0168":"U","\u016a":"U","\u016c":"U","\u016e":"U","\u0170":"U","\u0172":"U","\u0169":"u","\u016b":"u","\u016d":"u","\u016f":"u","\u0171":"u","\u0173":"u","\u0174":"W","\u0175":"w","\u0176":"Y","\u0177":"y","\u0178":"Y","\u0179":"Z","\u017b":"Z","\u017d":"Z","\u017a":"z","\u017c":"z","\u017e":"z","\u0132":"IJ","\u0133":"ij","\u0152":"Oe","\u0153":"oe","\u0149":"'n", -"\u017f":"s"}),rn=w({"&":"&","<":"<",">":">",'"':""","'":"'"}),en=w({"&":"&","<":"<",">":">",""":'"',"'":"'"}),un=function w(kt){function Et(t){return oi.call(t)}function Ot(t){if(_u(t)&&!tf(t)&&!(t instanceof Dt)){if(t instanceof Mt)return t;if(ei.call(t,"__wrapped__"))return Ce(t)}return new Mt(t)}function Rt(){}function Mt(t,n){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!n,this.__index__=0,this.__values__=F}function Dt(t){this.__wrapped__=t,this.__actions__=[], +"\u017f":"s"}),rn=w({"&":"&","<":"<",">":">",'"':""","'":"'"}),en=w({"&":"&","<":"<",">":">",""":'"',"'":"'"}),un=function w(kt){function Et(t){return fi.call(t)}function Ot(t){if(vu(t)&&!nf(t)&&!(t instanceof Dt)){if(t instanceof Mt)return t;if(ui.call(t,"__wrapped__"))return De(t)}return new Mt(t)}function Rt(){}function Mt(t,n){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!n,this.__index__=0,this.__values__=F}function Dt(t){this.__wrapped__=t,this.__actions__=[], this.__dir__=1,this.__filtered__=false,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function Ft(t){var n=-1,r=t?t.length:0;for(this.clear();++n=n?t:n)),t}function yn(t,n,r,e,i,o,f){var c;if(e&&(c=o?e(t,i,o,f):e(t)), -c!==F)return c;if(!pu(t))return t;if(i=tf(t)){if(c=de(t),!n)return Ur(t,c)}else{var a=Et(t),l="[object Function]"==a||"[object GeneratorFunction]"==a;if(rf(t))return Rr(t,n);if("[object Object]"==a||"[object Arguments]"==a||l&&!o){if(c=ye(l?{}:t),!n)return Mr(t,_n(c,t))}else{if(!Ct[a])return o?t:{};c=be(t,a,yn,n)}}if(f||(f=new Kt),o=f.get(t))return o;if(f.set(t,c),!i)var s=r?zn(t,Su,ao):Su(t);return u(s||t,function(u,i){s&&(i=u,u=t[i]),sn(c,i,yn(u,n,r,e,i,t,f))}),c}function bn(t){var n=Su(t);return function(r){ -return xn(r,t,n)}}function xn(t,n,r){var e=r.length;if(null==t)return!e;for(t=Gu(t);e--;){var u=r[e],i=n[u],o=t[u];if(o===F&&!(u in t)||!i(o))return false}return true}function jn(t,n,r){if(typeof t!="function")throw new Hu("Expected a function");return po(function(){t.apply(F,r)},n)}function wn(t,n,r,e){var u=-1,i=c,o=true,f=t.length,s=[],h=n.length;if(!f)return s;r&&(n=l(n,S(r))),e?(i=a,o=false):200<=n.length&&(i=R,o=false,n=new qt(n));t:for(;++un}function Bn(t,n){return null!=t&&ei.call(t,n)}function Ln(t,n){return null!=t&&n in Gu(t)}function Un(t,n,r){for(var e=r?a:c,u=t[0].length,i=t.length,o=i,f=Pu(i),s=1/0,h=[];o--;){var p=t[o];o&&n&&(p=l(p,S(n))),s=zi(p.length,s), -f[o]=!r&&(n||120<=u&&120<=p.length)?new qt(o&&p):F}var p=t[0],_=-1,v=f[0];t:for(;++_n?r:0,je(n,r)?t[n]:F}function rr(t,n,r){var e=-1;return n=l(n.length?n:[Cu],S(he())),t=Hn(t,function(t){return{a:l(n,function(n){return n(t)}),b:++e,c:t -}}),A(t,function(t,n){var e;t:{e=-1;for(var u=t.a,i=n.a,o=u.length,f=r.length;++e=f?c:c*("desc"==r[e]?-1:1);break t}}e=t.b-n.b}return e})}function er(t,n){return t=Gu(t),ur(t,n,function(n,r){return r in t})}function ur(t,n,r){for(var e=-1,u=n.length,i={};++en||9007199254740991n&&(n=-n>u?0:u+n),r=r>u?u:r,0>r&&(r+=u),u=n>r?0:r-n>>>0,n>>>=0,r=Pu(u);++e=u){for(;e>>1,o=t[i];null!==o&&!yu(o)&&(r?o<=n:o=e?t:vr(t,n,r)}function Rr(t,n){if(n)return t.slice();var r=t.length,r=hi?hi(r):new t.constructor(r);return t.copy(r),r}function zr(t){var n=new t.constructor(t.byteLength);return new si(n).set(new si(t)),n}function Wr(t,n){if(t!==n){var r=t!==F,e=null===t,u=t===t,i=yu(t),o=n!==F,f=null===n,c=n===n,a=yu(n);if(!f&&!a&&!i&&t>n||i&&o&&c&&!f&&!a||e&&o&&c||!r&&c||!u)return 1;if(!e&&!i&&!a&&tu?F:i,u=1),n=Gu(n);++eo&&f[0]!==a&&f[o-1]!==a?[]:C(f,a),o-=c.length,or?r?ar(n,t):n:(r=ar(n,mi(t/T(n))),Wt.test(n)?Ir($(r),0,t).join(""):r.slice(0,t)); -}function te(t,n,e,u){function i(){for(var n=-1,c=arguments.length,a=-1,l=u.length,s=Pu(l+c),h=this&&this!==Pt&&this instanceof i?f:t;++an||e)&&(1&t&&(i[2]=h[2],n|=1&r?0:4),(r=h[3])&&(e=i[3],i[3]=e?Br(e,r,h[4]):r,i[4]=e?C(i[3],"__lodash_placeholder__"):h[4]), -(r=h[5])&&(e=i[5],i[5]=e?Lr(e,r,h[6]):r,i[6]=e?C(i[5],"__lodash_placeholder__"):h[6]),(r=h[7])&&(i[7]=r),128&t&&(i[8]=null==i[8]?h[8]:zi(i[8],h[8])),null==i[9]&&(i[9]=h[9]),i[0]=h[0],i[1]=n),t=i[0],n=i[1],r=i[2],e=i[3],u=i[4],f=i[9]=null==i[9]?c?0:t.length:Ri(i[9]-a,0),!f&&24&n&&(n&=-25),Re((h?uo:ho)(n&&1!=n?8==n||16==n?Vr(t,n,f):32!=n&&33!=n||u.length?Jr.apply(F,i):te(t,n,r,e):Nr(t,n,r),i),t,n)}function fe(t,n,r,e,u,i){var o=2&u,f=t.length,c=n.length;if(f!=c&&!(o&&c>f))return false;if((c=i.get(t))&&i.get(n))return c==n; -var c=-1,a=true,l=1&u?new qt:F;for(i.set(t,n),i.set(n,t);++cr&&(r=Ri(e+r,0)),g(t,he(n,3),r)):-1}function De(t,n,r){var e=t?t.length:0;if(!e)return-1;var u=e-1;return r!==F&&(u=ju(r),u=0>r?Ri(e+u,0):zi(u,e-1)),g(t,he(n,3),u,true)}function Te(t){return t&&t.length?En(t,1):[]}function $e(t){return t&&t.length?t[0]:F}function Fe(t){var n=t?t.length:0;return n?t[n-1]:F}function Ne(t,n){return t&&t.length&&n&&n.length?or(t,n):t}function Pe(t){return t?Ui.call(t):t}function Ze(t){if(!t||!t.length)return[];var n=0;return t=f(t,function(t){if(cu(t))return n=Ri(t.length,n), -!0}),E(n,function(n){return l(t,j(n))})}function qe(t,n){if(!t||!t.length)return[];var e=Ze(t);return null==n?e:l(e,function(t){return r(n,F,t)})}function Ve(t){return t=Ot(t),t.__chain__=true,t}function Ke(t,n){return n(t)}function Ge(){return this}function Je(t,n){return(tf(t)?u:to)(t,he(n,3))}function Ye(t,n){return(tf(t)?i:no)(t,he(n,3))}function He(t,n){return(tf(t)?l:Hn)(t,he(n,3))}function Qe(t,n,r){return n=r?F:n,n=t&&null==n?t.length:n,oe(t,128,F,F,F,F,n)}function Xe(t,n){var r;if(typeof n!="function")throw new Hu("Expected a function"); -return t=ju(t),function(){return 0<--t&&(r=n.apply(this,arguments)),1>=t&&(n=F),r}}function tu(t,n,r){return n=r?F:n,t=oe(t,8,F,F,F,F,F,n),t.placeholder=tu.placeholder,t}function nu(t,n,r){return n=r?F:n,t=oe(t,16,F,F,F,F,F,n),t.placeholder=nu.placeholder,t}function ru(t,n,r){function e(n){var r=c,e=a;return c=a=F,_=n,s=t.apply(e,r)}function u(t){var r=t-p;return t-=_,p===F||r>=n||0>r||g&&t>=l}function i(){var t=Po();if(u(t))return o(t);var r,e=po;r=t-_,t=n-(t-p),r=g?zi(t,l-r):t,h=e(i,r)}function o(t){ -return h=F,d&&c?e(t):(c=a=F,s)}function f(){var t=Po(),r=u(t);if(c=arguments,a=this,p=t,r){if(h===F)return _=t=p,h=po(i,n),v?e(t):s;if(g)return h=po(i,n),e(p)}return h===F&&(h=po(i,n)),s}var c,a,l,s,h,p,_=0,v=false,g=false,d=true;if(typeof t!="function")throw new Hu("Expected a function");return n=mu(n)||0,pu(r)&&(v=!!r.leading,l=(g="maxWait"in r)?Ri(mu(r.maxWait)||0,n):l,d="trailing"in r?!!r.trailing:d),f.cancel=function(){h!==F&&oo(h),_=0,c=p=a=h=F},f.flush=function(){return h===F?s:o(Po())},f}function eu(t,n){ -function r(){var e=arguments,u=n?n.apply(this,e):e[0],i=r.cache;return i.has(u)?i.get(u):(e=t.apply(this,e),r.cache=i.set(u,e)||i,e)}if(typeof t!="function"||n&&typeof n!="function")throw new Hu("Expected a function");return r.cache=new(eu.Cache||Zt),r}function uu(t){if(typeof t!="function")throw new Hu("Expected a function");return function(){var n=arguments;switch(n.length){case 0:return!t.call(this);case 1:return!t.call(this,n[0]);case 2:return!t.call(this,n[0],n[1]);case 3:return!t.call(this,n[0],n[1],n[2]); -}return!t.apply(this,n)}}function iu(t,n){return t===n||t!==t&&n!==n}function ou(t){return cu(t)&&ei.call(t,"callee")&&(!di.call(t,"callee")||"[object Arguments]"==oi.call(t))}function fu(t){return null!=t&&hu(t.length)&&!lu(t)}function cu(t){return _u(t)&&fu(t)}function au(t){return!!_u(t)&&("[object Error]"==oi.call(t)||typeof t.message=="string"&&typeof t.name=="string")}function lu(t){return t=pu(t)?oi.call(t):"","[object Function]"==t||"[object GeneratorFunction]"==t}function su(t){return typeof t=="number"&&t==ju(t); -}function hu(t){return typeof t=="number"&&-1=t}function pu(t){var n=typeof t;return null!=t&&("object"==n||"function"==n)}function _u(t){return null!=t&&typeof t=="object"}function vu(t){return typeof t=="number"||_u(t)&&"[object Number]"==oi.call(t)}function gu(t){return!(!_u(t)||"[object Object]"!=oi.call(t))&&(t=_i(t),null===t||(t=ei.call(t,"constructor")&&t.constructor,typeof t=="function"&&t instanceof t&&ri.call(t)==ii))}function du(t){return typeof t=="string"||!tf(t)&&_u(t)&&"[object String]"==oi.call(t); -}function yu(t){return typeof t=="symbol"||_u(t)&&"[object Symbol]"==oi.call(t)}function bu(t){if(!t)return[];if(fu(t))return du(t)?$(t):Ur(t);if(vi&&t[vi]){t=t[vi]();for(var n,r=[];!(n=t.next()).done;)r.push(n.value);return r}return n=Et(t),("[object Map]"==n?L:"[object Set]"==n?M:zu)(t)}function xu(t){return t?(t=mu(t),t===N||t===-N?1.7976931348623157e308*(0>t?-1:1):t===t?t:0):0===t?t:0}function ju(t){t=xu(t);var n=t%1;return t===t?n?t-n:t:0}function wu(t){return t?dn(ju(t),0,4294967295):0}function mu(t){ -if(typeof t=="number")return t;if(yu(t))return P;if(pu(t)&&(t=typeof t.valueOf=="function"?t.valueOf():t,t=pu(t)?t+"":t),typeof t!="string")return 0===t?t:+t;t=t.replace(ft,"");var n=yt.test(t);return n||xt.test(t)?$t(t.slice(2),n?2:8):dt.test(t)?P:+t}function Au(t){return Cr(t,Iu(t))}function ku(t){return null==t?"":jr(t)}function Eu(t,n,r){return t=null==t?F:Rn(t,n),t===F?r:t}function Ou(t,n){return null!=t&&ge(t,n,Ln)}function Su(t){return fu(t)?tn(t):Gn(t)}function Iu(t){return fu(t)?tn(t,true):Jn(t); -}function Ru(t,n){return null==t?{}:ur(t,zn(t,Iu,lo),he(n))}function zu(t){return t?I(t,Su(t)):[]}function Wu(t){return Lf(ku(t).toLowerCase())}function Bu(t){return(t=ku(t))&&t.replace(wt,nn).replace(It,"")}function Lu(t,n,r){return t=ku(t),n=r?F:n,n===F?Bt.test(t)?t.match(zt)||[]:t.match(pt)||[]:t.match(n)||[]}function Uu(t){return function(){return t}}function Cu(t){return t}function Mu(t){return Kn(typeof t=="function"?t:yn(t,true))}function Du(t,n,r){var e=Su(n),i=In(n,e);null!=r||pu(n)&&(i.length||!e.length)||(r=n, -n=t,t=this,i=In(n,Su(n)));var o=!(pu(r)&&"chain"in r&&!r.chain),f=lu(t);return u(i,function(r){var e=n[r];t[r]=e,f&&(t.prototype[r]=function(){var n=this.__chain__;if(o||n){var r=t(this.__wrapped__);return(r.__actions__=Ur(this.__actions__)).push({func:e,args:arguments,thisArg:t}),r.__chain__=n,r}return e.apply(t,s([this.value()],arguments))})}),t}function Tu(){}function $u(t){return me(t)?j(Be(t)):ir(t)}function Fu(){return[]}function Nu(){return false}kt=kt?un.defaults(Pt.Object(),kt,un.pick(Pt,Lt)):Pt; -var Pu=kt.Array,Zu=kt.Date,qu=kt.Error,Vu=kt.Function,Ku=kt.Math,Gu=kt.Object,Ju=kt.RegExp,Yu=kt.String,Hu=kt.TypeError,Qu=Pu.prototype,Xu=Gu.prototype,ti=kt["__core-js_shared__"],ni=function(){var t=/[^.]+$/.exec(ti&&ti.keys&&ti.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),ri=Vu.prototype.toString,ei=Xu.hasOwnProperty,ui=0,ii=ri.call(Gu),oi=Xu.toString,fi=Pt._,ci=Ju("^"+ri.call(ei).replace(it,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ai=Vt?kt.Buffer:F,li=kt.Symbol,si=kt.Uint8Array,hi=ai?ai.f:F,pi=Gu.defineProperty,_i=U(Gu.getPrototypeOf,Gu),vi=li?li.iterator:F,gi=Gu.create,di=Xu.propertyIsEnumerable,yi=Qu.splice,bi=li?li.isConcatSpreadable:F,xi=kt.clearTimeout!==Pt.clearTimeout&&kt.clearTimeout,ji=Zu&&Zu.now!==Pt.Date.now&&Zu.now,wi=kt.setTimeout!==Pt.setTimeout&&kt.setTimeout,mi=Ku.ceil,Ai=Ku.floor,ki=Gu.getOwnPropertySymbols,Ei=ai?ai.isBuffer:F,Oi=kt.isFinite,Si=Qu.join,Ii=U(Gu.keys,Gu),Ri=Ku.max,zi=Ku.min,Wi=Zu.now,Bi=kt.parseInt,Li=Ku.random,Ui=Qu.reverse,Ci=ve(kt,"DataView"),Mi=ve(kt,"Map"),Di=ve(kt,"Promise"),Ti=ve(kt,"Set"),$i=ve(kt,"WeakMap"),Fi=ve(Gu,"create"),Ni=ve(Gu,"defineProperty"),Pi=$i&&new $i,Zi={},qi=Le(Ci),Vi=Le(Mi),Ki=Le(Di),Gi=Le(Ti),Ji=Le($i),Yi=li?li.prototype:F,Hi=Yi?Yi.valueOf:F,Qi=Yi?Yi.toString:F,Xi=function(){ -function t(){}return function(n){return pu(n)?gi?gi(n):(t.prototype=prototype,n=new t,t.prototype=F,n):{}}}();Ot.templateSettings={escape:Q,evaluate:X,interpolate:tt,variable:"",imports:{_:Ot}},Ot.prototype=Rt.prototype,Ot.prototype.constructor=Ot,Mt.prototype=Xi(Rt.prototype),Mt.prototype.constructor=Mt,Dt.prototype=Xi(Rt.prototype),Dt.prototype.constructor=Dt,Ft.prototype.clear=function(){this.__data__=Fi?Fi(null):{},this.size=0},Ft.prototype.delete=function(t){return t=this.has(t)&&delete this.__data__[t], -this.size-=t?1:0,t},Ft.prototype.get=function(t){var n=this.__data__;return Fi?(t=n[t],"__lodash_hash_undefined__"===t?F:t):ei.call(n,t)?n[t]:F},Ft.prototype.has=function(t){var n=this.__data__;return Fi?n[t]!==F:ei.call(n,t)},Ft.prototype.set=function(t,n){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=Fi&&n===F?"__lodash_hash_undefined__":n,this},Nt.prototype.clear=function(){this.__data__=[],this.size=0},Nt.prototype.delete=function(t){var n=this.__data__;return t=hn(n,t),!(0>t)&&(t==n.length-1?n.pop():yi.call(n,t,1), ---this.size,true)},Nt.prototype.get=function(t){var n=this.__data__;return t=hn(n,t),0>t?F:n[t][1]},Nt.prototype.has=function(t){return-1e?(++this.size,r.push([t,n])):r[e][1]=n,this},Zt.prototype.clear=function(){this.size=0,this.__data__={hash:new Ft,map:new(Mi||Nt),string:new Ft}},Zt.prototype.delete=function(t){return t=pe(this,t).delete(t),this.size-=t?1:0,t},Zt.prototype.get=function(t){return pe(this,t).get(t); -},Zt.prototype.has=function(t){return pe(this,t).has(t)},Zt.prototype.set=function(t,n){var r=pe(this,t),e=r.size;return r.set(t,n),this.size+=r.size==e?0:1,this},qt.prototype.add=qt.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},qt.prototype.has=function(t){return this.__data__.has(t)},Kt.prototype.clear=function(){this.__data__=new Nt,this.size=0},Kt.prototype.delete=function(t){var n=this.__data__;return t=n.delete(t),this.size=n.size,t},Kt.prototype.get=function(t){ -return this.__data__.get(t)},Kt.prototype.has=function(t){return this.__data__.has(t)},Kt.prototype.set=function(t,n){var r=this.__data__;if(r instanceof Nt){var e=r.__data__;if(!Mi||199>e.length)return e.push([t,n]),this.size=++r.size,this;r=this.__data__=new Zt(e)}return r.set(t,n),this.size=r.size,this};var to=$r(On),no=$r(Sn,true),ro=Fr(),eo=Fr(true),uo=Pi?function(t,n){return Pi.set(t,n),t}:Cu,io=Ni?function(t,n){return Ni(t,"toString",{configurable:true,enumerable:false,value:Uu(n),writable:true})}:Cu,oo=xi||function(t){ -return Pt.clearTimeout(t)},fo=Ti&&1/M(new Ti([,-0]))[1]==N?function(t){return new Ti(t)}:Tu,co=Pi?function(t){return Pi.get(t)}:Tu,ao=ki?U(ki,Gu):Fu,lo=ki?function(t){for(var n=[];t;)s(n,ao(t)),t=_i(t);return n}:Fu;(Ci&&"[object DataView]"!=Et(new Ci(new ArrayBuffer(1)))||Mi&&"[object Map]"!=Et(new Mi)||Di&&"[object Promise]"!=Et(Di.resolve())||Ti&&"[object Set]"!=Et(new Ti)||$i&&"[object WeakMap]"!=Et(new $i))&&(Et=function(t){var n=oi.call(t);if(t=(t="[object Object]"==n?t.constructor:F)?Le(t):F)switch(t){ -case qi:return"[object DataView]";case Vi:return"[object Map]";case Ki:return"[object Promise]";case Gi:return"[object Set]";case Ji:return"[object WeakMap]"}return n});var so=ti?lu:Nu,ho=ze(uo),po=wi||function(t,n){return Pt.setTimeout(t,n)},_o=ze(io),vo=function(t){t=eu(t,function(t){return 500===n.size&&n.clear(),t});var n=t.cache;return t}(function(t){t=ku(t);var n=[];return et.test(t)&&n.push(""),t.replace(ut,function(t,r,e,u){n.push(e?u.replace(_t,"$1"):r||t)}),n}),go=lr(function(t,n){return cu(t)?wn(t,En(n,1,cu,true)):[]; -}),yo=lr(function(t,n){var r=Fe(n);return cu(r)&&(r=F),cu(t)?wn(t,En(n,1,cu,true),he(r,2)):[]}),bo=lr(function(t,n){var r=Fe(n);return cu(r)&&(r=F),cu(t)?wn(t,En(n,1,cu,true),F,r):[]}),xo=lr(function(t){var n=l(t,Or);return n.length&&n[0]===t[0]?Un(n):[]}),jo=lr(function(t){var n=Fe(t),r=l(t,Or);return n===Fe(r)?n=F:r.pop(),r.length&&r[0]===t[0]?Un(r,he(n,2)):[]}),wo=lr(function(t){var n=Fe(t),r=l(t,Or);return n===Fe(r)?n=F:r.pop(),r.length&&r[0]===t[0]?Un(r,F,n):[]}),mo=lr(Ne),Ao=ae(function(t,n){var r=t?t.length:0,e=gn(t,n); -return fr(t,l(n,function(t){return je(t,r)?+t:t}).sort(Wr)),e}),ko=lr(function(t){return wr(En(t,1,cu,true))}),Eo=lr(function(t){var n=Fe(t);return cu(n)&&(n=F),wr(En(t,1,cu,true),he(n,2))}),Oo=lr(function(t){var n=Fe(t);return cu(n)&&(n=F),wr(En(t,1,cu,true),F,n)}),So=lr(function(t,n){return cu(t)?wn(t,n):[]}),Io=lr(function(t){return kr(f(t,cu))}),Ro=lr(function(t){var n=Fe(t);return cu(n)&&(n=F),kr(f(t,cu),he(n,2))}),zo=lr(function(t){var n=Fe(t);return cu(n)&&(n=F),kr(f(t,cu),F,n)}),Wo=lr(Ze),Bo=lr(function(t){ -var n=t.length,n=1=n}),tf=Pu.isArray,nf=Gt?S(Gt):Dn,rf=Ei||Nu,ef=Jt?S(Jt):Tn,uf=Yt?S(Yt):Fn,of=Ht?S(Ht):Zn,ff=Qt?S(Qt):qn,cf=Xt?S(Xt):Vn,af=re(Yn),lf=re(function(t,n){return t<=n}),sf=Tr(function(t,n){if(ke(n)||fu(n))Cr(n,Su(n),t);else for(var r in n)ei.call(n,r)&&sn(t,r,n[r])}),hf=Tr(function(t,n){Cr(n,Iu(n),t)}),pf=Tr(function(t,n,r,e){Cr(n,Iu(n),t,e)}),_f=Tr(function(t,n,r,e){ -Cr(n,Su(n),t,e)}),vf=ae(gn),gf=lr(function(t){return t.push(F,an),r(pf,F,t)}),df=lr(function(t){return t.push(F,Oe),r(wf,F,t)}),yf=Yr(function(t,n,r){t[n]=r},Uu(Cu)),bf=Yr(function(t,n,r){ei.call(t,n)?t[n].push(r):t[n]=[r]},he),xf=lr(Mn),jf=Tr(function(t,n,r){tr(t,n,r)}),wf=Tr(function(t,n,r,e){tr(t,n,r,e)}),mf=ae(function(t,n){return null==t?{}:(n=l(n,Be),er(t,wn(zn(t,Iu,lo),n)))}),Af=ae(function(t,n){return null==t?{}:er(t,l(n,Be))}),kf=ie(Su),Ef=ie(Iu),Of=Zr(function(t,n,r){return n=n.toLowerCase(), -t+(r?Wu(n):n)}),Sf=Zr(function(t,n,r){return t+(r?"-":"")+n.toLowerCase()}),If=Zr(function(t,n,r){return t+(r?" ":"")+n.toLowerCase()}),Rf=Pr("toLowerCase"),zf=Zr(function(t,n,r){return t+(r?"_":"")+n.toLowerCase()}),Wf=Zr(function(t,n,r){return t+(r?" ":"")+Lf(n)}),Bf=Zr(function(t,n,r){return t+(r?" ":"")+n.toUpperCase()}),Lf=Pr("toUpperCase"),Uf=lr(function(t,n){try{return r(t,F,n)}catch(t){return au(t)?t:new qu(t)}}),Cf=ae(function(t,n){return u(n,function(n){n=Be(n),vn(t,n,Zo(t[n],t))}),t}),Mf=Gr(),Df=Gr(true),Tf=lr(function(t,n){ -return function(r){return Mn(r,t,n)}}),$f=lr(function(t,n){return function(r){return Mn(t,r,n)}}),Ff=Qr(l),Nf=Qr(o),Pf=Qr(_),Zf=ne(),qf=ne(true),Vf=Hr(function(t,n){return t+n},0),Kf=ue("ceil"),Gf=Hr(function(t,n){return t/n},1),Jf=ue("floor"),Yf=Hr(function(t,n){return t*n},1),Hf=ue("round"),Qf=Hr(function(t,n){return t-n},0);return Ot.after=function(t,n){if(typeof n!="function")throw new Hu("Expected a function");return t=ju(t),function(){if(1>--t)return n.apply(this,arguments)}},Ot.ary=Qe,Ot.assign=sf, -Ot.assignIn=hf,Ot.assignInWith=pf,Ot.assignWith=_f,Ot.at=vf,Ot.before=Xe,Ot.bind=Zo,Ot.bindAll=Cf,Ot.bindKey=qo,Ot.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return tf(t)?t:[t]},Ot.chain=Ve,Ot.chunk=function(t,n,r){if(n=(r?we(t,n,r):n===F)?1:Ri(ju(n),0),r=t?t.length:0,!r||1>n)return[];for(var e=0,u=0,i=Pu(mi(r/n));en?0:n,e)):[]},Ot.dropRight=function(t,n,r){var e=t?t.length:0;return e?(n=r||n===F?1:ju(n),n=e-n,vr(t,0,0>n?0:n)):[]},Ot.dropRightWhile=function(t,n){return t&&t.length?mr(t,he(n,3),true,true):[]},Ot.dropWhile=function(t,n){return t&&t.length?mr(t,he(n,3),true):[]},Ot.fill=function(t,n,r,e){ -var u=t?t.length:0;if(!u)return[];for(r&&typeof r!="number"&&we(t,n,r)&&(r=0,e=u),u=t.length,r=ju(r),0>r&&(r=-r>u?0:u+r),e=e===F||e>u?u:ju(e),0>e&&(e+=u),e=r>e?0:wu(e);r>>0,r?(t=ku(t))&&(typeof n=="string"||null!=n&&!of(n))&&(n=jr(n),!n&&Wt.test(t))?Ir($(t),0,r):t.split(n,r):[]},Ot.spread=function(t,n){if(typeof t!="function")throw new Hu("Expected a function");return n=n===F?0:Ri(ju(n),0),lr(function(e){var u=e[n];return e=Ir(e,0,n),u&&s(e,u),r(t,this,e)})},Ot.tail=function(t){var n=t?t.length:0;return n?vr(t,1,n):[]},Ot.take=function(t,n,r){return t&&t.length?(n=r||n===F?1:ju(n), -vr(t,0,0>n?0:n)):[]},Ot.takeRight=function(t,n,r){var e=t?t.length:0;return e?(n=r||n===F?1:ju(n),n=e-n,vr(t,0>n?0:n,e)):[]},Ot.takeRightWhile=function(t,n){return t&&t.length?mr(t,he(n,3),false,true):[]},Ot.takeWhile=function(t,n){return t&&t.length?mr(t,he(n,3)):[]},Ot.tap=function(t,n){return n(t),t},Ot.throttle=function(t,n,r){var e=true,u=true;if(typeof t!="function")throw new Hu("Expected a function");return pu(r)&&(e="leading"in r?!!r.leading:e,u="trailing"in r?!!r.trailing:u),ru(t,n,{leading:e,maxWait:n, -trailing:u})},Ot.thru=Ke,Ot.toArray=bu,Ot.toPairs=kf,Ot.toPairsIn=Ef,Ot.toPath=function(t){return tf(t)?l(t,Be):yu(t)?[t]:Ur(vo(t))},Ot.toPlainObject=Au,Ot.transform=function(t,n,r){var e=tf(t)||cf(t);if(n=he(n,4),null==r)if(e||pu(t)){var i=t.constructor;r=e?tf(t)?new i:[]:lu(i)?Xi(_i(t)):{}}else r={};return(e?u:On)(t,function(t,e,u){return n(r,t,e,u)}),r},Ot.unary=function(t){return Qe(t,1)},Ot.union=ko,Ot.unionBy=Eo,Ot.unionWith=Oo,Ot.uniq=function(t){return t&&t.length?wr(t):[]},Ot.uniqBy=function(t,n){ -return t&&t.length?wr(t,he(n,2)):[]},Ot.uniqWith=function(t,n){return t&&t.length?wr(t,F,n):[]},Ot.unset=function(t,n){var r;if(null==t)r=true;else{r=t;var e=n,e=me(e,r)?[e]:Sr(e);r=Ie(r,e),e=Be(Fe(e)),r=!(null!=r&&ei.call(r,e))||delete r[e]}return r},Ot.unzip=Ze,Ot.unzipWith=qe,Ot.update=function(t,n,r){return null==t?t:pr(t,n,(typeof r=="function"?r:Cu)(Rn(t,n)),void 0)},Ot.updateWith=function(t,n,r,e){return e=typeof e=="function"?e:F,null!=t&&(t=pr(t,n,(typeof r=="function"?r:Cu)(Rn(t,n)),e)),t; -},Ot.values=zu,Ot.valuesIn=function(t){return null==t?[]:I(t,Iu(t))},Ot.without=So,Ot.words=Lu,Ot.wrap=function(t,n){return n=null==n?Cu:n,Jo(n,t)},Ot.xor=Io,Ot.xorBy=Ro,Ot.xorWith=zo,Ot.zip=Wo,Ot.zipObject=function(t,n){return Er(t||[],n||[],sn)},Ot.zipObjectDeep=function(t,n){return Er(t||[],n||[],pr)},Ot.zipWith=Bo,Ot.entries=kf,Ot.entriesIn=Ef,Ot.extend=hf,Ot.extendWith=pf,Du(Ot,Ot),Ot.add=Vf,Ot.attempt=Uf,Ot.camelCase=Of,Ot.capitalize=Wu,Ot.ceil=Kf,Ot.clamp=function(t,n,r){return r===F&&(r=n, -n=F),r!==F&&(r=mu(r),r=r===r?r:0),n!==F&&(n=mu(n),n=n===n?n:0),dn(mu(t),n,r)},Ot.clone=function(t){return yn(t,false,true)},Ot.cloneDeep=function(t){return yn(t,true,true)},Ot.cloneDeepWith=function(t,n){return yn(t,true,true,n)},Ot.cloneWith=function(t,n){return yn(t,false,true,n)},Ot.conformsTo=function(t,n){return null==n||xn(t,n,Su(n))},Ot.deburr=Bu,Ot.defaultTo=function(t,n){return null==t||t!==t?n:t},Ot.divide=Gf,Ot.endsWith=function(t,n,r){t=ku(t),n=jr(n);var e=t.length,e=r=r===F?e:dn(ju(r),0,e);return r-=n.length, -0<=r&&t.slice(r,e)==n},Ot.eq=iu,Ot.escape=function(t){return(t=ku(t))&&H.test(t)?t.replace(J,rn):t},Ot.escapeRegExp=function(t){return(t=ku(t))&&ot.test(t)?t.replace(it,"\\$&"):t},Ot.every=function(t,n,r){var e=tf(t)?o:mn;return r&&we(t,n,r)&&(n=F),e(t,he(n,3))},Ot.find=Co,Ot.findIndex=Me,Ot.findKey=function(t,n){return v(t,he(n,3),On)},Ot.findLast=Mo,Ot.findLastIndex=De,Ot.findLastKey=function(t,n){return v(t,he(n,3),Sn)},Ot.floor=Jf,Ot.forEach=Je,Ot.forEachRight=Ye,Ot.forIn=function(t,n){return null==t?t:ro(t,he(n,3),Iu); -},Ot.forInRight=function(t,n){return null==t?t:eo(t,he(n,3),Iu)},Ot.forOwn=function(t,n){return t&&On(t,he(n,3))},Ot.forOwnRight=function(t,n){return t&&Sn(t,he(n,3))},Ot.get=Eu,Ot.gt=Qo,Ot.gte=Xo,Ot.has=function(t,n){return null!=t&&ge(t,n,Bn)},Ot.hasIn=Ou,Ot.head=$e,Ot.identity=Cu,Ot.includes=function(t,n,r,e){return t=fu(t)?t:zu(t),r=r&&!e?ju(r):0,e=t.length,0>r&&(r=Ri(e+r,0)),du(t)?r<=e&&-1r&&(r=Ri(e+r,0)),d(t,n,r)):-1},Ot.inRange=function(t,n,r){return n=xu(n),r===F?(r=n,n=0):r=xu(r),t=mu(t),t>=zi(n,r)&&t=t},Ot.isSet=ff,Ot.isString=du,Ot.isSymbol=yu, -Ot.isTypedArray=cf,Ot.isUndefined=function(t){return t===F},Ot.isWeakMap=function(t){return _u(t)&&"[object WeakMap]"==Et(t)},Ot.isWeakSet=function(t){return _u(t)&&"[object WeakSet]"==oi.call(t)},Ot.join=function(t,n){return t?Si.call(t,n):""},Ot.kebabCase=Sf,Ot.last=Fe,Ot.lastIndexOf=function(t,n,r){var e=t?t.length:0;if(!e)return-1;var u=e;if(r!==F&&(u=ju(r),u=0>u?Ri(e+u,0):zi(u,e-1)),n===n){for(r=u+1;r--&&t[r]!==n;);t=r}else t=g(t,b,u,true);return t},Ot.lowerCase=If,Ot.lowerFirst=Rf,Ot.lt=af,Ot.lte=lf, -Ot.max=function(t){return t&&t.length?An(t,Cu,Wn):F},Ot.maxBy=function(t,n){return t&&t.length?An(t,he(n,2),Wn):F},Ot.mean=function(t){return x(t,Cu)},Ot.meanBy=function(t,n){return x(t,he(n,2))},Ot.min=function(t){return t&&t.length?An(t,Cu,Yn):F},Ot.minBy=function(t,n){return t&&t.length?An(t,he(n,2),Yn):F},Ot.stubArray=Fu,Ot.stubFalse=Nu,Ot.stubObject=function(){return{}},Ot.stubString=function(){return""},Ot.stubTrue=function(){return true},Ot.multiply=Yf,Ot.nth=function(t,n){return t&&t.length?nr(t,ju(n)):F; -},Ot.noConflict=function(){return Pt._===this&&(Pt._=fi),this},Ot.noop=Tu,Ot.now=Po,Ot.pad=function(t,n,r){t=ku(t);var e=(n=ju(n))?T(t):0;return!n||e>=n?t:(n=(n-e)/2,Xr(Ai(n),r)+t+Xr(mi(n),r))},Ot.padEnd=function(t,n,r){t=ku(t);var e=(n=ju(n))?T(t):0;return n&&en){var e=t;t=n,n=e}return r||t%1||n%1?(r=Li(),zi(t+r*(n-t+Tt("1e-"+((r+"").length-1))),n)):cr(t,n)},Ot.reduce=function(t,n,r){var e=tf(t)?h:m,u=3>arguments.length;return e(t,he(n,4),r,u,to)},Ot.reduceRight=function(t,n,r){var e=tf(t)?p:m,u=3>arguments.length;return e(t,he(n,4),r,u,no)},Ot.repeat=function(t,n,r){return n=(r?we(t,n,r):n===F)?1:ju(n),ar(ku(t),n)},Ot.replace=function(){ -var t=arguments,n=ku(t[0]);return 3>t.length?n:n.replace(t[1],t[2])},Ot.result=function(t,n,r){n=me(n,t)?[n]:Sr(n);var e=-1,u=n.length;for(u||(t=F,u=1);++e=n?t:n)),t}function yn(t,n,r,e,i,o,f){var c;if(e&&(c=o?e(t,i,o,f):e(t)),c!==F)return c;if(!_u(t))return t;if(i=nf(t)){if(c=be(t),!n)return Cr(t,c)}else{var a=Et(t),l="[object Function]"==a||"[object GeneratorFunction]"==a;if(ef(t))return Rr(t,n);if("[object Object]"==a||"[object Arguments]"==a||l&&!o){if(c=xe(l?{}:t),!n)return Dr(t,_n(c,t))}else{if(!Ct[a])return o?t:{};c=je(t,a,yn,n)}}if(f||(f=new Kt),o=f.get(t))return o;f.set(t,c); +var s=i?F:(r?se:Iu)(t);return u(s||t,function(u,i){s&&(i=u,u=t[i]),sn(c,i,yn(u,n,r,e,i,t,f))}),c}function bn(t){var n=Iu(t);return function(r){return xn(r,t,n)}}function xn(t,n,r){var e=r.length;if(null==t)return!e;for(t=Ju(t);e--;){var u=r[e],i=n[u],o=t[u];if(o===F&&!(u in t)||!i(o))return false}return true}function jn(t,n,r){if(typeof t!="function")throw new Qu("Expected a function");return po(function(){t.apply(F,r)},n)}function wn(t,n,r,e){var u=-1,i=c,o=true,f=t.length,s=[],h=n.length;if(!f)return s;r&&(n=l(n,S(r))), +e?(i=a,o=false):200<=n.length&&(i=R,o=false,n=new qt(n));t:for(;++un}function Bn(t,n){return null!=t&&ui.call(t,n)}function Ln(t,n){ +return null!=t&&n in Ju(t)}function Un(t,n,r){for(var e=r?a:c,u=t[0].length,i=t.length,o=i,f=Zu(i),s=1/0,h=[];o--;){var p=t[o];o&&n&&(p=l(p,S(n))),s=Wi(p.length,s),f[o]=!r&&(n||120<=u&&120<=p.length)?new qt(o&&p):F}var p=t[0],_=-1,v=f[0];t:for(;++_n?r:0,me(n,r)?t[n]:F}function rr(t,n,r){var e=-1;return n=l(n.length?n:[Mu],S(_e())),t=Hn(t,function(t){return{a:l(n,function(n){return n(t)}),b:++e,c:t}}),A(t,function(t,n){var e;t:{e=-1;for(var u=t.a,i=n.a,o=u.length,f=r.length;++e=f?c:c*("desc"==r[e]?-1:1);break t}}e=t.b-n.b}return e})}function er(t,n){return t=Ju(t),ur(t,n,function(n,r){return r in t})}function ur(t,n,r){for(var e=-1,u=n.length,i={};++en||9007199254740991n&&(n=-n>u?0:u+n),r=r>u?u:r,0>r&&(r+=u),u=n>r?0:r-n>>>0,n>>>=0,r=Zu(u);++e=u){for(;e>>1,o=t[i];null!==o&&!bu(o)&&(r?o<=n:o=e?t:vr(t,n,r)}function Rr(t,n){if(n)return t.slice();var r=t.length,r=pi?pi(r):new t.constructor(r); +return t.copy(r),r}function zr(t){var n=new t.constructor(t.byteLength);return new hi(n).set(new hi(t)),n}function Wr(t,n){return new t.constructor(n?zr(t.buffer):t.buffer,t.byteOffset,t.length)}function Br(t,n){if(t!==n){var r=t!==F,e=null===t,u=t===t,i=bu(t),o=n!==F,f=null===n,c=n===n,a=bu(n);if(!f&&!a&&!i&&t>n||i&&o&&c&&!f&&!a||e&&o&&c||!r&&c||!u)return 1;if(!e&&!i&&!a&&tu?F:i,u=1),n=Ju(n);++eo&&f[0]!==a&&f[o-1]!==a?[]:C(f,a),o-=c.length,or?r?ar(n,t):n:(r=ar(n,Ai(t/T(n))),Wt.test(n)?Ir($(r),0,t).join(""):r.slice(0,t))}function ne(t,n,e,u){function i(){for(var n=-1,c=arguments.length,a=-1,l=u.length,s=Zu(l+c),h=this&&this!==Pt&&this instanceof i?f:t;++an||e)&&(1&t&&(i[2]=h[2],n|=1&r?0:4),(r=h[3])&&(e=i[3],i[3]=e?Lr(e,r,h[4]):r,i[4]=e?C(i[3],"__lodash_placeholder__"):h[4]),(r=h[5])&&(e=i[5],i[5]=e?Ur(e,r,h[6]):r,i[6]=e?C(i[5],"__lodash_placeholder__"):h[6]),(r=h[7])&&(i[7]=r),128&t&&(i[8]=null==i[8]?h[8]:Wi(i[8],h[8])), +null==i[9]&&(i[9]=h[9]),i[0]=h[0],i[1]=n),t=i[0],n=i[1],r=i[2],e=i[3],u=i[4],f=i[9]=null==i[9]?c?0:t.length:zi(i[9]-a,0),!f&&24&n&&(n&=-25),We((h?uo:ho)(n&&1!=n?8==n||16==n?Kr(t,n,f):32!=n&&33!=n||u.length?Yr.apply(F,i):ne(t,n,r,e):Pr(t,n,r),i),t,n)}function ce(t,n,r,e,u,i){var o=2&u,f=t.length,c=n.length;if(f!=c&&!(o&&c>f))return false;if((c=i.get(t))&&i.get(n))return c==n;var c=-1,a=true,l=1&u?new qt:F;for(i.set(t,n),i.set(n,t);++cr&&(r=zi(e+r,0)),g(t,_e(n,3),r)):-1}function $e(t,n,r){var e=t?t.length:0;if(!e)return-1;var u=e-1;return r!==F&&(u=wu(r),u=0>r?zi(e+u,0):Wi(u,e-1)),g(t,_e(n,3),u,true); +}function Fe(t){return t&&t.length?En(t,1):[]}function Ne(t){return t&&t.length?t[0]:F}function Pe(t){var n=t?t.length:0;return n?t[n-1]:F}function Ze(t,n){return t&&t.length&&n&&n.length?or(t,n):t}function qe(t){return t?Ci.call(t):t}function Ve(t){if(!t||!t.length)return[];var n=0;return t=f(t,function(t){if(au(t))return n=zi(t.length,n),true}),E(n,function(n){return l(t,j(n))})}function Ke(t,n){if(!t||!t.length)return[];var e=Ve(t);return null==n?e:l(e,function(t){return r(n,F,t)})}function Ge(t){ +return t=Ot(t),t.__chain__=true,t}function Je(t,n){return n(t)}function Ye(){return this}function He(t,n){return(nf(t)?u:to)(t,_e(n,3))}function Qe(t,n){return(nf(t)?i:no)(t,_e(n,3))}function Xe(t,n){return(nf(t)?l:Hn)(t,_e(n,3))}function tu(t,n,r){return n=r?F:n,n=t&&null==n?t.length:n,fe(t,128,F,F,F,F,n)}function nu(t,n){var r;if(typeof n!="function")throw new Qu("Expected a function");return t=wu(t),function(){return 0<--t&&(r=n.apply(this,arguments)),1>=t&&(n=F),r}}function ru(t,n,r){return n=r?F:n, +t=fe(t,8,F,F,F,F,F,n),t.placeholder=ru.placeholder,t}function eu(t,n,r){return n=r?F:n,t=fe(t,16,F,F,F,F,F,n),t.placeholder=eu.placeholder,t}function uu(t,n,r){function e(n){var r=c,e=a;return c=a=F,_=n,s=t.apply(e,r)}function u(t){var r=t-p;return t-=_,p===F||r>=n||0>r||g&&t>=l}function i(){var t=Po();if(u(t))return o(t);var r,e=po;r=t-_,t=n-(t-p),r=g?Wi(t,l-r):t,h=e(i,r)}function o(t){return h=F,d&&c?e(t):(c=a=F,s)}function f(){var t=Po(),r=u(t);if(c=arguments,a=this,p=t,r){if(h===F)return _=t=p, +h=po(i,n),v?e(t):s;if(g)return h=po(i,n),e(p)}return h===F&&(h=po(i,n)),s}var c,a,l,s,h,p,_=0,v=false,g=false,d=true;if(typeof t!="function")throw new Qu("Expected a function");return n=Au(n)||0,_u(r)&&(v=!!r.leading,l=(g="maxWait"in r)?zi(Au(r.maxWait)||0,n):l,d="trailing"in r?!!r.trailing:d),f.cancel=function(){h!==F&&oo(h),_=0,c=p=a=h=F},f.flush=function(){return h===F?s:o(Po())},f}function iu(t,n){function r(){var e=arguments,u=n?n.apply(this,e):e[0],i=r.cache;return i.has(u)?i.get(u):(e=t.apply(this,e), +r.cache=i.set(u,e)||i,e)}if(typeof t!="function"||n&&typeof n!="function")throw new Qu("Expected a function");return r.cache=new(iu.Cache||Zt),r}function ou(t){if(typeof t!="function")throw new Qu("Expected a function");return function(){var n=arguments;switch(n.length){case 0:return!t.call(this);case 1:return!t.call(this,n[0]);case 2:return!t.call(this,n[0],n[1]);case 3:return!t.call(this,n[0],n[1],n[2])}return!t.apply(this,n)}}function fu(t,n){return t===n||t!==t&&n!==n}function cu(t){return null!=t&&pu(t.length)&&!su(t); +}function au(t){return vu(t)&&cu(t)}function lu(t){return!!vu(t)&&("[object Error]"==fi.call(t)||typeof t.message=="string"&&typeof t.name=="string")}function su(t){return t=_u(t)?fi.call(t):"","[object Function]"==t||"[object GeneratorFunction]"==t||"[object Proxy]"==t}function hu(t){return typeof t=="number"&&t==wu(t)}function pu(t){return typeof t=="number"&&-1=t}function _u(t){var n=typeof t;return null!=t&&("object"==n||"function"==n)}function vu(t){return null!=t&&typeof t=="object"; +}function gu(t){return typeof t=="number"||vu(t)&&"[object Number]"==fi.call(t)}function du(t){return!(!vu(t)||"[object Object]"!=fi.call(t))&&(t=_i(t),null===t||(t=ui.call(t,"constructor")&&t.constructor,typeof t=="function"&&t instanceof t&&ei.call(t)==oi))}function yu(t){return typeof t=="string"||!nf(t)&&vu(t)&&"[object String]"==fi.call(t)}function bu(t){return typeof t=="symbol"||vu(t)&&"[object Symbol]"==fi.call(t)}function xu(t){if(!t)return[];if(cu(t))return yu(t)?$(t):Cr(t);if(vi&&t[vi]){t=t[vi](); +for(var n,r=[];!(n=t.next()).done;)r.push(n.value);return r}return n=Et(t),("[object Map]"==n?L:"[object Set]"==n?M:Wu)(t)}function ju(t){return t?(t=Au(t),t===N||t===-N?1.7976931348623157e308*(0>t?-1:1):t===t?t:0):0===t?t:0}function wu(t){t=ju(t);var n=t%1;return t===t?n?t-n:t:0}function mu(t){return t?dn(wu(t),0,4294967295):0}function Au(t){if(typeof t=="number")return t;if(bu(t))return P;if(_u(t)&&(t=typeof t.valueOf=="function"?t.valueOf():t,t=_u(t)?t+"":t),typeof t!="string")return 0===t?t:+t; +t=t.replace(ft,"");var n=yt.test(t);return n||xt.test(t)?$t(t.slice(2),n?2:8):dt.test(t)?P:+t}function ku(t){return Mr(t,Ru(t))}function Eu(t){return null==t?"":jr(t)}function Ou(t,n,r){return t=null==t?F:Rn(t,n),t===F?r:t}function Su(t,n){return null!=t&&ye(t,n,Ln)}function Iu(t){return cu(t)?tn(t):Jn(t)}function Ru(t){if(cu(t))t=tn(t,true);else if(_u(t)){var n,r=Oe(t),e=[];for(n in t)("constructor"!=n||!r&&ui.call(t,n))&&e.push(n);t=e}else{if(n=[],null!=t)for(r in Ju(t))n.push(r);t=n}return t}function zu(t,n){ +return null==t?{}:ur(t,zn(t,Ru,lo),_e(n))}function Wu(t){return t?I(t,Iu(t)):[]}function Bu(t){return Uf(Eu(t).toLowerCase())}function Lu(t){return(t=Eu(t))&&t.replace(wt,nn).replace(It,"")}function Uu(t,n,r){return t=Eu(t),n=r?F:n,n===F?Bt.test(t)?t.match(zt)||[]:t.match(pt)||[]:t.match(n)||[]}function Cu(t){return function(){return t}}function Mu(t){return t}function Du(t){return Gn(typeof t=="function"?t:yn(t,true))}function Tu(t,n,r){var e=Iu(n),i=In(n,e);null!=r||_u(n)&&(i.length||!e.length)||(r=n, +n=t,t=this,i=In(n,Iu(n)));var o=!(_u(r)&&"chain"in r&&!r.chain),f=su(t);return u(i,function(r){var e=n[r];t[r]=e,f&&(t.prototype[r]=function(){var n=this.__chain__;if(o||n){var r=t(this.__wrapped__);return(r.__actions__=Cr(this.__actions__)).push({func:e,args:arguments,thisArg:t}),r.__chain__=n,r}return e.apply(t,s([this.value()],arguments))})}),t}function $u(){}function Fu(t){return ke(t)?j(Ue(t)):ir(t)}function Nu(){return[]}function Pu(){return false}kt=kt?un.defaults(Pt.Object(),kt,un.pick(Pt,Lt)):Pt; +var Zu=kt.Array,qu=kt.Date,Vu=kt.Error,Ku=kt.Function,Gu=kt.Math,Ju=kt.Object,Yu=kt.RegExp,Hu=kt.String,Qu=kt.TypeError,Xu=Zu.prototype,ti=Ju.prototype,ni=kt["__core-js_shared__"],ri=function(){var t=/[^.]+$/.exec(ni&&ni.keys&&ni.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),ei=Ku.prototype.toString,ui=ti.hasOwnProperty,ii=0,oi=ei.call(Ju),fi=ti.toString,ci=Pt._,ai=Yu("^"+ei.call(ui).replace(it,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),li=Vt?kt.Buffer:F,si=kt.Symbol,hi=kt.Uint8Array,pi=li?li.f:F,_i=U(Ju.getPrototypeOf,Ju),vi=si?si.iterator:F,gi=Ju.create,di=ti.propertyIsEnumerable,yi=Xu.splice,bi=si?si.isConcatSpreadable:F,xi=function(){ +try{var t=de(Ju,"defineProperty");return t({},"",{}),t}catch(t){}}(),ji=kt.clearTimeout!==Pt.clearTimeout&&kt.clearTimeout,wi=qu&&qu.now!==Pt.Date.now&&qu.now,mi=kt.setTimeout!==Pt.setTimeout&&kt.setTimeout,Ai=Gu.ceil,ki=Gu.floor,Ei=Ju.getOwnPropertySymbols,Oi=li?li.isBuffer:F,Si=kt.isFinite,Ii=Xu.join,Ri=U(Ju.keys,Ju),zi=Gu.max,Wi=Gu.min,Bi=qu.now,Li=kt.parseInt,Ui=Gu.random,Ci=Xu.reverse,Mi=de(kt,"DataView"),Di=de(kt,"Map"),Ti=de(kt,"Promise"),$i=de(kt,"Set"),Fi=de(kt,"WeakMap"),Ni=de(Ju,"create"),Pi=Fi&&new Fi,Zi={},qi=Ce(Mi),Vi=Ce(Di),Ki=Ce(Ti),Gi=Ce($i),Ji=Ce(Fi),Yi=si?si.prototype:F,Hi=Yi?Yi.valueOf:F,Qi=Yi?Yi.toString:F,Xi=function(){ +function t(){}return function(n){return _u(n)?gi?gi(n):(t.prototype=n,n=new t,t.prototype=F,n):{}}}();Ot.templateSettings={escape:Q,evaluate:X,interpolate:tt,variable:"",imports:{_:Ot}},Ot.prototype=Rt.prototype,Ot.prototype.constructor=Ot,Mt.prototype=Xi(Rt.prototype),Mt.prototype.constructor=Mt,Dt.prototype=Xi(Rt.prototype),Dt.prototype.constructor=Dt,Ft.prototype.clear=function(){this.__data__=Ni?Ni(null):{},this.size=0},Ft.prototype.delete=function(t){return t=this.has(t)&&delete this.__data__[t], +this.size-=t?1:0,t},Ft.prototype.get=function(t){var n=this.__data__;return Ni?(t=n[t],"__lodash_hash_undefined__"===t?F:t):ui.call(n,t)?n[t]:F},Ft.prototype.has=function(t){var n=this.__data__;return Ni?n[t]!==F:ui.call(n,t)},Ft.prototype.set=function(t,n){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=Ni&&n===F?"__lodash_hash_undefined__":n,this},Nt.prototype.clear=function(){this.__data__=[],this.size=0},Nt.prototype.delete=function(t){var n=this.__data__;return t=hn(n,t),!(0>t)&&(t==n.length-1?n.pop():yi.call(n,t,1), +--this.size,true)},Nt.prototype.get=function(t){var n=this.__data__;return t=hn(n,t),0>t?F:n[t][1]},Nt.prototype.has=function(t){return-1e?(++this.size,r.push([t,n])):r[e][1]=n,this},Zt.prototype.clear=function(){this.size=0,this.__data__={hash:new Ft,map:new(Di||Nt),string:new Ft}},Zt.prototype.delete=function(t){return t=ve(this,t).delete(t),this.size-=t?1:0,t},Zt.prototype.get=function(t){return ve(this,t).get(t); +},Zt.prototype.has=function(t){return ve(this,t).has(t)},Zt.prototype.set=function(t,n){var r=ve(this,t),e=r.size;return r.set(t,n),this.size+=r.size==e?0:1,this},qt.prototype.add=qt.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},qt.prototype.has=function(t){return this.__data__.has(t)},Kt.prototype.clear=function(){this.__data__=new Nt,this.size=0},Kt.prototype.delete=function(t){var n=this.__data__;return t=n.delete(t),this.size=n.size,t},Kt.prototype.get=function(t){ +return this.__data__.get(t)},Kt.prototype.has=function(t){return this.__data__.has(t)},Kt.prototype.set=function(t,n){var r=this.__data__;if(r instanceof Nt){var e=r.__data__;if(!Di||199>e.length)return e.push([t,n]),this.size=++r.size,this;r=this.__data__=new Zt(e)}return r.set(t,n),this.size=r.size,this};var to=Fr(On),no=Fr(Sn,true),ro=Nr(),eo=Nr(true),uo=Pi?function(t,n){return Pi.set(t,n),t}:Mu,io=xi?function(t,n){return xi(t,"toString",{configurable:true,enumerable:false,value:Cu(n),writable:true})}:Mu,oo=ji||function(t){ +return Pt.clearTimeout(t)},fo=$i&&1/M(new $i([,-0]))[1]==N?function(t){return new $i(t)}:$u,co=Pi?function(t){return Pi.get(t)}:$u,ao=Ei?U(Ei,Ju):Nu,lo=Ei?function(t){for(var n=[];t;)s(n,ao(t)),t=_i(t);return n}:Nu;(Mi&&"[object DataView]"!=Et(new Mi(new ArrayBuffer(1)))||Di&&"[object Map]"!=Et(new Di)||Ti&&"[object Promise]"!=Et(Ti.resolve())||$i&&"[object Set]"!=Et(new $i)||Fi&&"[object WeakMap]"!=Et(new Fi))&&(Et=function(t){var n=fi.call(t);if(t=(t="[object Object]"==n?t.constructor:F)?Ce(t):F)switch(t){ +case qi:return"[object DataView]";case Vi:return"[object Map]";case Ki:return"[object Promise]";case Gi:return"[object Set]";case Ji:return"[object WeakMap]"}return n});var so=ni?su:Pu,ho=Be(uo),po=mi||function(t,n){return Pt.setTimeout(t,n)},_o=Be(io),vo=function(t){t=iu(t,function(t){return 500===n.size&&n.clear(),t});var n=t.cache;return t}(function(t){t=Eu(t);var n=[];return et.test(t)&&n.push(""),t.replace(ut,function(t,r,e,u){n.push(e?u.replace(_t,"$1"):r||t)}),n}),go=lr(function(t,n){return au(t)?wn(t,En(n,1,au,true)):[]; +}),yo=lr(function(t,n){var r=Pe(n);return au(r)&&(r=F),au(t)?wn(t,En(n,1,au,true),_e(r,2)):[]}),bo=lr(function(t,n){var r=Pe(n);return au(r)&&(r=F),au(t)?wn(t,En(n,1,au,true),F,r):[]}),xo=lr(function(t){var n=l(t,Or);return n.length&&n[0]===t[0]?Un(n):[]}),jo=lr(function(t){var n=Pe(t),r=l(t,Or);return n===Pe(r)?n=F:r.pop(),r.length&&r[0]===t[0]?Un(r,_e(n,2)):[]}),wo=lr(function(t){var n=Pe(t),r=l(t,Or);return n===Pe(r)?n=F:r.pop(),r.length&&r[0]===t[0]?Un(r,F,n):[]}),mo=lr(Ze),Ao=le(function(t,n){var r=t?t.length:0,e=gn(t,n); +return fr(t,l(n,function(t){return me(t,r)?+t:t}).sort(Br)),e}),ko=lr(function(t){return wr(En(t,1,au,true))}),Eo=lr(function(t){var n=Pe(t);return au(n)&&(n=F),wr(En(t,1,au,true),_e(n,2))}),Oo=lr(function(t){var n=Pe(t);return au(n)&&(n=F),wr(En(t,1,au,true),F,n)}),So=lr(function(t,n){return au(t)?wn(t,n):[]}),Io=lr(function(t){return kr(f(t,au))}),Ro=lr(function(t){var n=Pe(t);return au(n)&&(n=F),kr(f(t,au),_e(n,2))}),zo=lr(function(t){var n=Pe(t);return au(n)&&(n=F),kr(f(t,au),F,n)}),Wo=lr(Ve),Bo=lr(function(t){ +var n=t.length,n=1=n}),tf=Dn(function(){return arguments}())?Dn:function(t){return vu(t)&&ui.call(t,"callee")&&!di.call(t,"callee")},nf=Zu.isArray,rf=Gt?S(Gt):Tn,ef=Oi||Pu,uf=Jt?S(Jt):$n,of=Yt?S(Yt):Nn,ff=Ht?S(Ht):qn,cf=Qt?S(Qt):Vn,af=Xt?S(Xt):Kn,lf=ee(Yn),sf=ee(function(t,n){return t<=n}),hf=$r(function(t,n){if(Oe(n)||cu(n))Mr(n,Iu(n),t);else for(var r in n)ui.call(n,r)&&sn(t,r,n[r]); +}),pf=$r(function(t,n){Mr(n,Ru(n),t)}),_f=$r(function(t,n,r,e){Mr(n,Ru(n),t,e)}),vf=$r(function(t,n,r,e){Mr(n,Iu(n),t,e)}),gf=le(gn),df=lr(function(t){return t.push(F,an),r(_f,F,t)}),yf=lr(function(t){return t.push(F,Ie),r(mf,F,t)}),bf=Hr(function(t,n,r){t[n]=r},Cu(Mu)),xf=Hr(function(t,n,r){ui.call(t,n)?t[n].push(r):t[n]=[r]},_e),jf=lr(Mn),wf=$r(function(t,n,r){tr(t,n,r)}),mf=$r(function(t,n,r,e){tr(t,n,r,e)}),Af=le(function(t,n){return null==t?{}:(n=l(n,Ue),er(t,wn(zn(t,Ru,lo),n)))}),kf=le(function(t,n){ +return null==t?{}:er(t,l(n,Ue))}),Ef=oe(Iu),Of=oe(Ru),Sf=qr(function(t,n,r){return n=n.toLowerCase(),t+(r?Bu(n):n)}),If=qr(function(t,n,r){return t+(r?"-":"")+n.toLowerCase()}),Rf=qr(function(t,n,r){return t+(r?" ":"")+n.toLowerCase()}),zf=Zr("toLowerCase"),Wf=qr(function(t,n,r){return t+(r?"_":"")+n.toLowerCase()}),Bf=qr(function(t,n,r){return t+(r?" ":"")+Uf(n)}),Lf=qr(function(t,n,r){return t+(r?" ":"")+n.toUpperCase()}),Uf=Zr("toUpperCase"),Cf=lr(function(t,n){try{return r(t,F,n)}catch(t){return lu(t)?t:new Vu(t); +}}),Mf=le(function(t,n){return u(n,function(n){n=Ue(n),vn(t,n,Zo(t[n],t))}),t}),Df=Jr(),Tf=Jr(true),$f=lr(function(t,n){return function(r){return Mn(r,t,n)}}),Ff=lr(function(t,n){return function(r){return Mn(t,r,n)}}),Nf=Xr(l),Pf=Xr(o),Zf=Xr(_),qf=re(),Vf=re(true),Kf=Qr(function(t,n){return t+n},0),Gf=ie("ceil"),Jf=Qr(function(t,n){return t/n},1),Yf=ie("floor"),Hf=Qr(function(t,n){return t*n},1),Qf=ie("round"),Xf=Qr(function(t,n){return t-n},0);return Ot.after=function(t,n){if(typeof n!="function")throw new Qu("Expected a function"); +return t=wu(t),function(){if(1>--t)return n.apply(this,arguments)}},Ot.ary=tu,Ot.assign=hf,Ot.assignIn=pf,Ot.assignInWith=_f,Ot.assignWith=vf,Ot.at=gf,Ot.before=nu,Ot.bind=Zo,Ot.bindAll=Mf,Ot.bindKey=qo,Ot.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return nf(t)?t:[t]},Ot.chain=Ge,Ot.chunk=function(t,n,r){if(n=(r?Ae(t,n,r):n===F)?1:zi(wu(n),0),r=t?t.length:0,!r||1>n)return[];for(var e=0,u=0,i=Zu(Ai(r/n));en?0:n,e)):[]},Ot.dropRight=function(t,n,r){var e=t?t.length:0;return e?(n=r||n===F?1:wu(n),n=e-n,vr(t,0,0>n?0:n)):[]},Ot.dropRightWhile=function(t,n){return t&&t.length?mr(t,_e(n,3),true,true):[]},Ot.dropWhile=function(t,n){ +return t&&t.length?mr(t,_e(n,3),true):[]},Ot.fill=function(t,n,r,e){var u=t?t.length:0;if(!u)return[];for(r&&typeof r!="number"&&Ae(t,n,r)&&(r=0,e=u),u=t.length,r=wu(r),0>r&&(r=-r>u?0:u+r),e=e===F||e>u?u:wu(e),0>e&&(e+=u),e=r>e?0:mu(e);r>>0,r?(t=Eu(t))&&(typeof n=="string"||null!=n&&!ff(n))&&(n=jr(n),!n&&Wt.test(t))?Ir($(t),0,r):t.split(n,r):[]},Ot.spread=function(t,n){if(typeof t!="function")throw new Qu("Expected a function");return n=n===F?0:zi(wu(n),0),lr(function(e){var u=e[n];return e=Ir(e,0,n),u&&s(e,u),r(t,this,e)})},Ot.tail=function(t){ +var n=t?t.length:0;return n?vr(t,1,n):[]},Ot.take=function(t,n,r){return t&&t.length?(n=r||n===F?1:wu(n),vr(t,0,0>n?0:n)):[]},Ot.takeRight=function(t,n,r){var e=t?t.length:0;return e?(n=r||n===F?1:wu(n),n=e-n,vr(t,0>n?0:n,e)):[]},Ot.takeRightWhile=function(t,n){return t&&t.length?mr(t,_e(n,3),false,true):[]},Ot.takeWhile=function(t,n){return t&&t.length?mr(t,_e(n,3)):[]},Ot.tap=function(t,n){return n(t),t},Ot.throttle=function(t,n,r){var e=true,u=true;if(typeof t!="function")throw new Qu("Expected a function"); +return _u(r)&&(e="leading"in r?!!r.leading:e,u="trailing"in r?!!r.trailing:u),uu(t,n,{leading:e,maxWait:n,trailing:u})},Ot.thru=Je,Ot.toArray=xu,Ot.toPairs=Ef,Ot.toPairsIn=Of,Ot.toPath=function(t){return nf(t)?l(t,Ue):bu(t)?[t]:Cr(vo(t))},Ot.toPlainObject=ku,Ot.transform=function(t,n,r){var e=nf(t),i=e||ef(t)||af(t);if(n=_e(n,4),null==r){var o=t&&t.constructor;r=i?e?new o:[]:_u(t)&&su(o)?Xi(_i(t)):{}}return(i?u:On)(t,function(t,e,u){return n(r,t,e,u)}),r},Ot.unary=function(t){return tu(t,1)},Ot.union=ko, +Ot.unionBy=Eo,Ot.unionWith=Oo,Ot.uniq=function(t){return t&&t.length?wr(t):[]},Ot.uniqBy=function(t,n){return t&&t.length?wr(t,_e(n,2)):[]},Ot.uniqWith=function(t,n){return t&&t.length?wr(t,F,n):[]},Ot.unset=function(t,n){var r;if(null==t)r=true;else{r=t;var e=n,e=ke(e,r)?[e]:Sr(e);r=ze(r,e),e=Ue(Pe(e)),r=!(null!=r&&ui.call(r,e))||delete r[e]}return r},Ot.unzip=Ve,Ot.unzipWith=Ke,Ot.update=function(t,n,r){return null==t?t:pr(t,n,(typeof r=="function"?r:Mu)(Rn(t,n)),void 0)},Ot.updateWith=function(t,n,r,e){ +return e=typeof e=="function"?e:F,null!=t&&(t=pr(t,n,(typeof r=="function"?r:Mu)(Rn(t,n)),e)),t},Ot.values=Wu,Ot.valuesIn=function(t){return null==t?[]:I(t,Ru(t))},Ot.without=So,Ot.words=Uu,Ot.wrap=function(t,n){return n=null==n?Mu:n,Jo(n,t)},Ot.xor=Io,Ot.xorBy=Ro,Ot.xorWith=zo,Ot.zip=Wo,Ot.zipObject=function(t,n){return Er(t||[],n||[],sn)},Ot.zipObjectDeep=function(t,n){return Er(t||[],n||[],pr)},Ot.zipWith=Bo,Ot.entries=Ef,Ot.entriesIn=Of,Ot.extend=pf,Ot.extendWith=_f,Tu(Ot,Ot),Ot.add=Kf,Ot.attempt=Cf, +Ot.camelCase=Sf,Ot.capitalize=Bu,Ot.ceil=Gf,Ot.clamp=function(t,n,r){return r===F&&(r=n,n=F),r!==F&&(r=Au(r),r=r===r?r:0),n!==F&&(n=Au(n),n=n===n?n:0),dn(Au(t),n,r)},Ot.clone=function(t){return yn(t,false,true)},Ot.cloneDeep=function(t){return yn(t,true,true)},Ot.cloneDeepWith=function(t,n){return yn(t,true,true,n)},Ot.cloneWith=function(t,n){return yn(t,false,true,n)},Ot.conformsTo=function(t,n){return null==n||xn(t,n,Iu(n))},Ot.deburr=Lu,Ot.defaultTo=function(t,n){return null==t||t!==t?n:t},Ot.divide=Jf,Ot.endsWith=function(t,n,r){ +t=Eu(t),n=jr(n);var e=t.length,e=r=r===F?e:dn(wu(r),0,e);return r-=n.length,0<=r&&t.slice(r,e)==n},Ot.eq=fu,Ot.escape=function(t){return(t=Eu(t))&&H.test(t)?t.replace(J,rn):t},Ot.escapeRegExp=function(t){return(t=Eu(t))&&ot.test(t)?t.replace(it,"\\$&"):t},Ot.every=function(t,n,r){var e=nf(t)?o:mn;return r&&Ae(t,n,r)&&(n=F),e(t,_e(n,3))},Ot.find=Co,Ot.findIndex=Te,Ot.findKey=function(t,n){return v(t,_e(n,3),On)},Ot.findLast=Mo,Ot.findLastIndex=$e,Ot.findLastKey=function(t,n){return v(t,_e(n,3),Sn); +},Ot.floor=Yf,Ot.forEach=He,Ot.forEachRight=Qe,Ot.forIn=function(t,n){return null==t?t:ro(t,_e(n,3),Ru)},Ot.forInRight=function(t,n){return null==t?t:eo(t,_e(n,3),Ru)},Ot.forOwn=function(t,n){return t&&On(t,_e(n,3))},Ot.forOwnRight=function(t,n){return t&&Sn(t,_e(n,3))},Ot.get=Ou,Ot.gt=Qo,Ot.gte=Xo,Ot.has=function(t,n){return null!=t&&ye(t,n,Bn)},Ot.hasIn=Su,Ot.head=Ne,Ot.identity=Mu,Ot.includes=function(t,n,r,e){return t=cu(t)?t:Wu(t),r=r&&!e?wu(r):0,e=t.length,0>r&&(r=zi(e+r,0)),yu(t)?r<=e&&-1r&&(r=zi(e+r,0)),d(t,n,r)):-1},Ot.inRange=function(t,n,r){return n=ju(n),r===F?(r=n,n=0):r=ju(r),t=Au(t),t>=Wi(n,r)&&t=t; +},Ot.isSet=cf,Ot.isString=yu,Ot.isSymbol=bu,Ot.isTypedArray=af,Ot.isUndefined=function(t){return t===F},Ot.isWeakMap=function(t){return vu(t)&&"[object WeakMap]"==Et(t)},Ot.isWeakSet=function(t){return vu(t)&&"[object WeakSet]"==fi.call(t)},Ot.join=function(t,n){return t?Ii.call(t,n):""},Ot.kebabCase=If,Ot.last=Pe,Ot.lastIndexOf=function(t,n,r){var e=t?t.length:0;if(!e)return-1;var u=e;if(r!==F&&(u=wu(r),u=0>u?zi(e+u,0):Wi(u,e-1)),n===n){for(r=u+1;r--&&t[r]!==n;);t=r}else t=g(t,b,u,true);return t}, +Ot.lowerCase=Rf,Ot.lowerFirst=zf,Ot.lt=lf,Ot.lte=sf,Ot.max=function(t){return t&&t.length?An(t,Mu,Wn):F},Ot.maxBy=function(t,n){return t&&t.length?An(t,_e(n,2),Wn):F},Ot.mean=function(t){return x(t,Mu)},Ot.meanBy=function(t,n){return x(t,_e(n,2))},Ot.min=function(t){return t&&t.length?An(t,Mu,Yn):F},Ot.minBy=function(t,n){return t&&t.length?An(t,_e(n,2),Yn):F},Ot.stubArray=Nu,Ot.stubFalse=Pu,Ot.stubObject=function(){return{}},Ot.stubString=function(){return""},Ot.stubTrue=function(){return true},Ot.multiply=Hf, +Ot.nth=function(t,n){return t&&t.length?nr(t,wu(n)):F},Ot.noConflict=function(){return Pt._===this&&(Pt._=ci),this},Ot.noop=$u,Ot.now=Po,Ot.pad=function(t,n,r){t=Eu(t);var e=(n=wu(n))?T(t):0;return!n||e>=n?t:(n=(n-e)/2,te(ki(n),r)+t+te(Ai(n),r))},Ot.padEnd=function(t,n,r){t=Eu(t);var e=(n=wu(n))?T(t):0;return n&&en){var e=t;t=n,n=e}return r||t%1||n%1?(r=Ui(),Wi(t+r*(n-t+Tt("1e-"+((r+"").length-1))),n)):cr(t,n)},Ot.reduce=function(t,n,r){var e=nf(t)?h:m,u=3>arguments.length;return e(t,_e(n,4),r,u,to)},Ot.reduceRight=function(t,n,r){var e=nf(t)?p:m,u=3>arguments.length;return e(t,_e(n,4),r,u,no)},Ot.repeat=function(t,n,r){ +return n=(r?Ae(t,n,r):n===F)?1:wu(n),ar(Eu(t),n)},Ot.replace=function(){var t=arguments,n=Eu(t[0]);return 3>t.length?n:n.replace(t[1],t[2])},Ot.result=function(t,n,r){n=ke(n,t)?[n]:Sr(n);var e=-1,u=n.length;for(u||(t=F,u=1);++et||9007199254740991=i)return t;if(i=r-T(e),1>i)return e;if(r=o?Ir(o,0,i).join(""):t.slice(0,i),u===F)return r+e;if(o&&(i+=r.length-i),of(u)){if(t.slice(i).search(u)){var f=r;for(u.global||(u=Ju(u.source,ku(gt.exec(u))+"g")),u.lastIndex=0;o=u.exec(f);)var c=o.index;r=r.slice(0,c===F?i:c)}}else t.indexOf(jr(u),i)!=i&&(u=r.lastIndexOf(u),-1u.__dir__?"Right":"")}),u},Dt.prototype[t+"Right"]=function(n){return this.reverse()[t](n).reverse()}}),u(["filter","map","takeWhile"],function(t,n){var r=n+1,e=1==r||3==r;Dt.prototype[t]=function(t){var n=this.clone();return n.__iteratees__.push({iteratee:he(t,3),type:r}),n.__filtered__=n.__filtered__||e,n}}),u(["head","last"],function(t,n){var r="take"+(n?"Right":"");Dt.prototype[t]=function(){return this[r](1).value()[0]}}),u(["initial","tail"],function(t,n){var r="drop"+(n?"":"Right"); -Dt.prototype[t]=function(){return this.__filtered__?new Dt(this):this[r](1)}}),Dt.prototype.compact=function(){return this.filter(Cu)},Dt.prototype.find=function(t){return this.filter(t).head()},Dt.prototype.findLast=function(t){return this.reverse().find(t)},Dt.prototype.invokeMap=lr(function(t,n){return typeof t=="function"?new Dt(this):this.map(function(r){return Mn(r,t,n)})}),Dt.prototype.reject=function(t){return this.filter(uu(he(t)))},Dt.prototype.slice=function(t,n){t=ju(t);var r=this;return r.__filtered__&&(0n)?new Dt(r):(0>t?r=r.takeRight(-t):t&&(r=r.drop(t)), -n!==F&&(n=ju(n),r=0>n?r.dropRight(-n):r.take(n-t)),r)},Dt.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},Dt.prototype.toArray=function(){return this.take(4294967295)},On(Dt.prototype,function(t,n){var r=/^(?:filter|find|map|reject)|While$/.test(n),e=/^(?:head|last)$/.test(n),u=Ot[e?"take"+("last"==n?"Right":""):n],i=e||/^find/.test(n);u&&(Ot.prototype[n]=function(){function n(t){return t=u.apply(Ot,s([t],f)),e&&h?t[0]:t}var o=this.__wrapped__,f=e?[1]:arguments,c=o instanceof Dt,a=f[0],l=c||tf(o); -l&&r&&typeof a=="function"&&1!=a.length&&(c=l=false);var h=this.__chain__,p=!!this.__actions__.length,a=i&&!h,c=c&&!p;return!i&&l?(o=c?o:new Dt(this),o=t.apply(o,f),o.__actions__.push({func:Ke,args:[n],thisArg:F}),new Mt(o,h)):a&&c?t.apply(this,f):(o=this.thru(n),a?e?o.value()[0]:o.value():o)})}),u("pop push shift sort splice unshift".split(" "),function(t){var n=Qu[t],r=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",e=/^(?:pop|shift)$/.test(t);Ot.prototype[t]=function(){var t=arguments;if(e&&!this.__chain__){ -var u=this.value();return n.apply(tf(u)?u:[],t)}return this[r](function(r){return n.apply(tf(r)?r:[],t)})}}),On(Dt.prototype,function(t,n){var r=Ot[n];if(r){var e=r.name+"";(Zi[e]||(Zi[e]=[])).push({name:n,func:r})}}),Zi[Jr(F,2).name]=[{name:"wrapper",func:F}],Dt.prototype.clone=function(){var t=new Dt(this.__wrapped__);return t.__actions__=Ur(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=Ur(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=Ur(this.__views__), -t},Dt.prototype.reverse=function(){if(this.__filtered__){var t=new Dt(this);t.__dir__=-1,t.__filtered__=true}else t=this.clone(),t.__dir__*=-1;return t},Dt.prototype.value=function(){var t,n=this.__wrapped__.value(),r=this.__dir__,e=tf(n),u=0>r,i=e?n.length:0;t=i;for(var o=this.__views__,f=0,c=-1,a=o.length;++ci||i==t&&a==t)return Ar(n,this.__actions__);e=[];t:for(;t--&&c=this.__values__.length;return{done:t,value:t?F:this.__values__[this.__index__++]}},Ot.prototype.plant=function(t){for(var n,r=this;r instanceof Rt;){var e=Ce(r);e.__index__=0,e.__values__=F,n?u.__wrapped__=e:n=e;var u=e,r=r.__wrapped__}return u.__wrapped__=t,n},Ot.prototype.reverse=function(){var t=this.__wrapped__;return t instanceof Dt?(this.__actions__.length&&(t=new Dt(this)),t=t.reverse(),t.__actions__.push({func:Ke,args:[Pe],thisArg:F}),new Mt(t,this.__chain__)):this.thru(Pe); -},Ot.prototype.toJSON=Ot.prototype.valueOf=Ot.prototype.value=function(){return Ar(this.__wrapped__,this.__actions__)},Ot.prototype.first=Ot.prototype.head,vi&&(Ot.prototype[vi]=Ge),Ot}();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(Pt._=un, define(function(){return un})):qt?((qt.exports=un)._=un,Zt._=un):Pt._=un}).call(this); \ No newline at end of file +n=Cf(function(){return Ku(o,l+"return "+a).apply(F,f)}),n.source=a,lu(n))throw n;return n},Ot.times=function(t,n){if(t=wu(t),1>t||9007199254740991=i)return t;if(i=r-T(e),1>i)return e;if(r=o?Ir(o,0,i).join(""):t.slice(0,i),u===F)return r+e;if(o&&(i+=r.length-i),ff(u)){if(t.slice(i).search(u)){var f=r;for(u.global||(u=Yu(u.source,Eu(gt.exec(u))+"g")),u.lastIndex=0;o=u.exec(f);)var c=o.index;r=r.slice(0,c===F?i:c)}}else t.indexOf(jr(u),i)!=i&&(u=r.lastIndexOf(u),-1u.__dir__?"Right":"")}),u},Dt.prototype[t+"Right"]=function(n){return this.reverse()[t](n).reverse()}}),u(["filter","map","takeWhile"],function(t,n){var r=n+1,e=1==r||3==r;Dt.prototype[t]=function(t){var n=this.clone();return n.__iteratees__.push({iteratee:_e(t,3),type:r}),n.__filtered__=n.__filtered__||e,n}}),u(["head","last"],function(t,n){var r="take"+(n?"Right":"");Dt.prototype[t]=function(){return this[r](1).value()[0]}}),u(["initial","tail"],function(t,n){var r="drop"+(n?"":"Right"); +Dt.prototype[t]=function(){return this.__filtered__?new Dt(this):this[r](1)}}),Dt.prototype.compact=function(){return this.filter(Mu)},Dt.prototype.find=function(t){return this.filter(t).head()},Dt.prototype.findLast=function(t){return this.reverse().find(t)},Dt.prototype.invokeMap=lr(function(t,n){return typeof t=="function"?new Dt(this):this.map(function(r){return Mn(r,t,n)})}),Dt.prototype.reject=function(t){return this.filter(ou(_e(t)))},Dt.prototype.slice=function(t,n){t=wu(t);var r=this;return r.__filtered__&&(0n)?new Dt(r):(0>t?r=r.takeRight(-t):t&&(r=r.drop(t)), +n!==F&&(n=wu(n),r=0>n?r.dropRight(-n):r.take(n-t)),r)},Dt.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},Dt.prototype.toArray=function(){return this.take(4294967295)},On(Dt.prototype,function(t,n){var r=/^(?:filter|find|map|reject)|While$/.test(n),e=/^(?:head|last)$/.test(n),u=Ot[e?"take"+("last"==n?"Right":""):n],i=e||/^find/.test(n);u&&(Ot.prototype[n]=function(){function n(t){return t=u.apply(Ot,s([t],f)),e&&h?t[0]:t}var o=this.__wrapped__,f=e?[1]:arguments,c=o instanceof Dt,a=f[0],l=c||nf(o); +l&&r&&typeof a=="function"&&1!=a.length&&(c=l=false);var h=this.__chain__,p=!!this.__actions__.length,a=i&&!h,c=c&&!p;return!i&&l?(o=c?o:new Dt(this),o=t.apply(o,f),o.__actions__.push({func:Je,args:[n],thisArg:F}),new Mt(o,h)):a&&c?t.apply(this,f):(o=this.thru(n),a?e?o.value()[0]:o.value():o)})}),u("pop push shift sort splice unshift".split(" "),function(t){var n=Xu[t],r=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",e=/^(?:pop|shift)$/.test(t);Ot.prototype[t]=function(){var t=arguments;if(e&&!this.__chain__){ +var u=this.value();return n.apply(nf(u)?u:[],t)}return this[r](function(r){return n.apply(nf(r)?r:[],t)})}}),On(Dt.prototype,function(t,n){var r=Ot[n];if(r){var e=r.name+"";(Zi[e]||(Zi[e]=[])).push({name:n,func:r})}}),Zi[Yr(F,2).name]=[{name:"wrapper",func:F}],Dt.prototype.clone=function(){var t=new Dt(this.__wrapped__);return t.__actions__=Cr(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=Cr(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=Cr(this.__views__), +t},Dt.prototype.reverse=function(){if(this.__filtered__){var t=new Dt(this);t.__dir__=-1,t.__filtered__=true}else t=this.clone(),t.__dir__*=-1;return t},Dt.prototype.value=function(){var t,n=this.__wrapped__.value(),r=this.__dir__,e=nf(n),u=0>r,i=e?n.length:0;t=i;for(var o=this.__views__,f=0,c=-1,a=o.length;++ci||i==t&&a==t)return Ar(n,this.__actions__);e=[];t:for(;t--&&c=this.__values__.length;return{done:t,value:t?F:this.__values__[this.__index__++]}},Ot.prototype.plant=function(t){for(var n,r=this;r instanceof Rt;){var e=De(r);e.__index__=0,e.__values__=F,n?u.__wrapped__=e:n=e;var u=e,r=r.__wrapped__}return u.__wrapped__=t,n},Ot.prototype.reverse=function(){var t=this.__wrapped__;return t instanceof Dt?(this.__actions__.length&&(t=new Dt(this)),t=t.reverse(),t.__actions__.push({func:Je,args:[qe],thisArg:F}),new Mt(t,this.__chain__)):this.thru(qe); +},Ot.prototype.toJSON=Ot.prototype.valueOf=Ot.prototype.value=function(){return Ar(this.__wrapped__,this.__actions__)},Ot.prototype.first=Ot.prototype.head,vi&&(Ot.prototype[vi]=Ye),Ot}();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(Pt._=un, define(function(){return un})):qt?((qt.exports=un)._=un,Zt._=un):Pt._=un}).call(this); \ No newline at end of file diff --git a/StockManMVC/node_modules/lodash/package.json b/StockManMVC/node_modules/lodash/package.json index c9e9022..5f87ce3 100644 --- a/StockManMVC/node_modules/lodash/package.json +++ b/StockManMVC/node_modules/lodash/package.json @@ -1,18 +1,18 @@ { "_args": [ [ - "lodash@^4.8.0", + "lodash@^4.14.0", "C:\\Users\\samuele.STEAMWAREWIN\\Documents\\VisualStudioProjects\\StockMan\\StockManMVC\\node_modules\\async" ] ], - "_from": "lodash@>=4.8.0-0 <5.0.0-0", - "_id": "lodash@4.16.2", + "_from": "lodash@>=4.14.0-0 <5.0.0-0", + "_id": "lodash@4.16.4", "_inCache": true, "_location": "/lodash", "_nodeVersion": "4.4.7", "_npmOperationalInternal": { - "host": "packages-12-west.internal.npmjs.com", - "tmp": "tmp/lodash-4.16.2.tgz_1474859465050_0.057903866516426206" + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/lodash-4.16.4.tgz_1475766806071_0.6463651182129979" }, "_npmUser": { "email": "john.david.dalton@gmail.com", @@ -22,19 +22,19 @@ "_phantomChildren": {}, "_requested": { "name": "lodash", - "raw": "lodash@^4.8.0", - "rawSpec": "^4.8.0", + "raw": "lodash@^4.14.0", + "rawSpec": "^4.14.0", "scope": null, - "spec": ">=4.8.0-0 <5.0.0-0", + "spec": ">=4.14.0-0 <5.0.0-0", "type": "range" }, "_requiredBy": [ "/async" ], - "_resolved": "https://registry.npmjs.org/lodash/-/lodash-4.16.2.tgz", - "_shasum": "3e626db827048a699281a8a125226326cfc0e652", + "_resolved": "https://registry.npmjs.org/lodash/-/lodash-4.16.4.tgz", + "_shasum": "01ce306b9bad1319f2a5528674f88297aeb70127", "_shrinkwrap": null, - "_spec": "lodash@^4.8.0", + "_spec": "lodash@^4.14.0", "_where": "C:\\Users\\samuele.STEAMWAREWIN\\Documents\\VisualStudioProjects\\StockMan\\StockManMVC\\node_modules\\async", "author": { "email": "john.david.dalton@gmail.com", @@ -66,8 +66,8 @@ "devDependencies": {}, "directories": {}, "dist": { - "shasum": "3e626db827048a699281a8a125226326cfc0e652", - "tarball": "https://registry.npmjs.org/lodash/-/lodash-4.16.2.tgz" + "shasum": "01ce306b9bad1319f2a5528674f88297aeb70127", + "tarball": "https://registry.npmjs.org/lodash/-/lodash-4.16.4.tgz" }, "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", @@ -102,5 +102,5 @@ "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }, - "version": "4.16.2" + "version": "4.16.4" } diff --git a/StockManMVC/node_modules/lodash/toString.js b/StockManMVC/node_modules/lodash/toString.js index f20d65a..daaf681 100644 --- a/StockManMVC/node_modules/lodash/toString.js +++ b/StockManMVC/node_modules/lodash/toString.js @@ -8,8 +8,8 @@ var baseToString = require('./_baseToString'); * @memberOf _ * @since 4.0.0 * @category Lang - * @param {*} value The value to process. - * @returns {string} Returns the string. + * @param {*} value The value to convert. + * @returns {string} Returns the converted string. * @example * * _.toString(null); diff --git a/StockManMVC/node_modules/lodash/transform.js b/StockManMVC/node_modules/lodash/transform.js index f438ed8..d755a15 100644 --- a/StockManMVC/node_modules/lodash/transform.js +++ b/StockManMVC/node_modules/lodash/transform.js @@ -4,6 +4,7 @@ var arrayEach = require('./_arrayEach'), baseIteratee = require('./_baseIteratee'), getPrototype = require('./_getPrototype'), isArray = require('./isArray'), + isBuffer = require('./isBuffer'), isFunction = require('./isFunction'), isObject = require('./isObject'), isTypedArray = require('./isTypedArray'); @@ -39,22 +40,23 @@ var arrayEach = require('./_arrayEach'), * // => { '1': ['a', 'c'], '2': ['b'] } */ function transform(object, iteratee, accumulator) { - var isArr = isArray(object) || isTypedArray(object); - iteratee = baseIteratee(iteratee, 4); + var isArr = isArray(object), + isArrLike = isArr || isBuffer(object) || isTypedArray(object); + iteratee = baseIteratee(iteratee, 4); if (accumulator == null) { - if (isArr || isObject(object)) { - var Ctor = object.constructor; - if (isArr) { - accumulator = isArray(object) ? new Ctor : []; - } else { - accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {}; - } - } else { + var Ctor = object && object.constructor; + if (isArrLike) { + accumulator = isArr ? new Ctor : []; + } + else if (isObject(object)) { + accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {}; + } + else { accumulator = {}; } } - (isArr ? arrayEach : baseForOwn)(object, function(value, index, object) { + (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) { return iteratee(accumulator, value, index, object); }); return accumulator; diff --git a/StockManMVC/packages.config b/StockManMVC/packages.config index b44e69e..1c6a3b3 100644 --- a/StockManMVC/packages.config +++ b/StockManMVC/packages.config @@ -2,6 +2,7 @@ + @@ -26,6 +27,8 @@ + + diff --git a/VersGen/VersGen.cs b/VersGen/VersGen.cs index ef73ae2..1836bf1 100644 --- a/VersGen/VersGen.cs +++ b/VersGen/VersGen.cs @@ -5,7 +5,7 @@ using System.Reflection; -[assembly: AssemblyVersion("1.0.37.562")] -[assembly: AssemblyFileVersion("1.0.37.562")] +[assembly: AssemblyVersion("1.0.38.562")] +[assembly: AssemblyFileVersion("1.0.38.562")] [assembly: AssemblyCopyright("Steamware © 2006-2016")] [assembly: AssemblyCompany("Steamware")] diff --git a/VersGen/VersGen.tt b/VersGen/VersGen.tt index 6bb2939..d91c665 100644 --- a/VersGen/VersGen.tt +++ b/VersGen/VersGen.tt @@ -6,8 +6,8 @@ using System.Reflection; -[assembly: AssemblyVersion("1.0.37.<#= this.RevisionNumber #>")] -[assembly: AssemblyFileVersion("1.0.37.<#= this.RevisionNumber #>")] +[assembly: AssemblyVersion("1.0.38.<#= this.RevisionNumber #>")] +[assembly: AssemblyFileVersion("1.0.38.<#= this.RevisionNumber #>")] [assembly: AssemblyCopyright("Steamware © 2006-<#= DateTime.Now.Year #>")] [assembly: AssemblyCompany("Steamware")] <#+ diff --git a/VersGen/obj/Release/TempPE/VersGen.cs.dll b/VersGen/obj/Release/TempPE/VersGen.cs.dll index ade16e8..d32ff41 100644 Binary files a/VersGen/obj/Release/TempPE/VersGen.cs.dll and b/VersGen/obj/Release/TempPE/VersGen.cs.dll differ diff --git a/packages/Bower.1.3.11/Bower.1.3.11.nupkg b/packages/Bower.1.3.11/Bower.1.3.11.nupkg new file mode 100644 index 0000000..c171f95 Binary files /dev/null and b/packages/Bower.1.3.11/Bower.1.3.11.nupkg differ diff --git a/packages/Bower.1.3.11/content/.bin/bower.cmd b/packages/Bower.1.3.11/content/.bin/bower.cmd new file mode 100644 index 0000000..814cf7b --- /dev/null +++ b/packages/Bower.1.3.11/content/.bin/bower.cmd @@ -0,0 +1,3 @@ +@echo off +SET PATH=%~dp0;%PATH% +"%~dp0node" "%~dp0..\..\packages\Bower.1.3.11\node_modules\bower\bin\bower" %* diff --git a/packages/Bower.1.3.11/node_modules/bower/Gruntfile.js b/packages/Bower.1.3.11/node_modules/bower/Gruntfile.js new file mode 100644 index 0000000..a6d5b32 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/Gruntfile.js @@ -0,0 +1,60 @@ +'use strict'; +module.exports = function (grunt) { + require('load-grunt-tasks')(grunt); + + grunt.initConfig({ + jshint: { + options: { + jshintrc: '.jshintrc' + }, + files: [ + 'Gruntfile.js', + 'bin/*', + 'lib/**/*.js', + 'test/**/*.js', + '!test/assets/**/*', + '!test/reports/**/*', + '!test/tmp/**/*' + ] + }, + simplemocha: { + options: { + reporter: 'spec', + timeout: '5000' + }, + full: { + src: ['test/test.js'] + }, + short: { + options: { + reporter: 'dot' + }, + src: ['test/test.js'] + } + }, + exec: { + assets: { + command: 'node test/packages.js && node test/packages-svn.js' + }, + 'assets-force': { + command: 'node test/packages.js --force && node test/packages-svn.js --force' + }, + cover: { + command: 'STRICT_REQUIRE=1 node node_modules/istanbul/lib/cli.js cover --dir ./test/reports node_modules/mocha/bin/_mocha -- -R dot test/test.js' + }, + coveralls: { + command: 'node node_modules/.bin/coveralls < test/reports/lcov.info' + } + }, + watch: { + files: ['<%= jshint.files %>'], + tasks: ['jshint', 'simplemocha:short'] + } + }); + + grunt.registerTask('assets', ['exec:assets-force']); + grunt.registerTask('test', ['jshint', 'exec:assets', 'simplemocha:full']); + grunt.registerTask('cover', 'exec:cover'); + grunt.registerTask('travis', ['jshint', 'exec:assets', 'exec:cover', 'exec:coveralls']); + grunt.registerTask('default', 'test'); +}; diff --git a/packages/Bower.1.3.11/node_modules/bower/bin/bower b/packages/Bower.1.3.11/node_modules/bower/bin/bower new file mode 100644 index 0000000..6a98d94 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/bin/bower @@ -0,0 +1,145 @@ +#!/usr/bin/env node +'use strict'; + +process.bin = process.title = 'bower'; + +var Q = require('q'); +var mout = require('mout'); +var Logger = require('bower-logger'); +var osenv = require('osenv'); +var bower = require('../lib'); +var pkg = require('../package.json'); +var cli = require('../lib/util/cli'); +var rootCheck = require('../lib/util/rootCheck'); +var analytics = require('../lib/util/analytics'); + +var options; +var renderer; +var loglevel; +var command; +var commandFunc; +var logger; +var levels = Logger.LEVELS; + +options = cli.readOptions({ + version: { type: Boolean, shorthand: 'v' }, + help: { type: Boolean, shorthand: 'h' }, + 'allow-root': { type: Boolean } +}); + +// Handle print of version +if (options.version) { + process.stdout.write(pkg.version + '\n'); + process.exit(); +} + +// Root check +rootCheck(options, bower.config); + +// Set loglevel +if (bower.config.silent) { + loglevel = levels.error; +} else if (bower.config.verbose) { + loglevel = -Infinity; + Q.longStackSupport = true; +} else if (bower.config.quiet) { + loglevel = levels.warn; +} else { + loglevel = levels[bower.config.loglevel] || levels.info; +} + +// Get the command to execute +while (options.argv.remain.length) { + command = options.argv.remain.join(' '); + + // Alias lookup + if (bower.abbreviations[command]) { + command = bower.abbreviations[command].replace(/\s/g, '.'); + break; + } + + command = command.replace(/\s/g, '.'); + + // Direct lookup + if (mout.object.has(bower.commands, command)) { + break; + } + + options.argv.remain.pop(); +} + +// Ask for Insights on first run. +analytics.setup(bower.config).then(function () { + // Execute the command + commandFunc = command && mout.object.get(bower.commands, command); + command = command && command.replace(/\./g, ' '); + + // If no command was specified, show bower help + // Do the same if the command is unknown + if (!commandFunc) { + logger = bower.commands.help(); + command = 'help'; + // If the user requested help, show the command's help + // Do the same if the actual command is a group of other commands (e.g.: cache) + } else if (options.help || !commandFunc.line) { + logger = bower.commands.help(command); + command = 'help'; + // Call the line method + } else { + logger = commandFunc.line(process.argv); + + // If the method failed to interpret the process arguments + // show the command help + if (!logger) { + logger = bower.commands.help(command); + command = 'help'; + } + } + + // Get the renderer and configure it with the executed command + renderer = cli.getRenderer(command, logger.json, bower.config); + + logger + .on('end', function (data) { + if (!bower.config.silent && !bower.config.quiet) { + renderer.end(data); + } + }) + .on('error', function (err) { + if (levels.error >= loglevel) { + renderer.error(err); + } + + process.exit(1); + }) + .on('log', function (log) { + if (levels[log.level] >= loglevel) { + renderer.log(log); + } + }) + .on('prompt', function (prompt, callback) { + renderer.prompt(prompt) + .then(function (answer) { + callback(answer); + }); + }); + + // Warn if HOME is not SET + if (!osenv.home()) { + logger.warn('no-home', 'HOME not set, user configuration will not be loaded'); + } + + if (bower.config.interactive) { + var updateNotifier = require('update-notifier'); + + // Check for newer version of Bower + var notifier = updateNotifier({ + packageName: pkg.name, + packageVersion: pkg.version + }); + + if (notifier.update && levels.info >= loglevel) { + notifier.notify(); + } + } +}); diff --git a/packages/Bower.1.3.11/node_modules/bower/lib/commands/cache/clean.js b/packages/Bower.1.3.11/node_modules/bower/lib/commands/cache/clean.js new file mode 100644 index 0000000..044442b --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/lib/commands/cache/clean.js @@ -0,0 +1,205 @@ +var fs = require('graceful-fs'); +var path = require('path'); +var mout = require('mout'); +var Q = require('q'); +var rimraf = require('rimraf'); +var endpointParser = require('bower-endpoint-parser'); +var PackageRepository = require('../../core/PackageRepository'); +var semver = require('../../util/semver'); +var cli = require('../../util/cli'); +var defaultConfig = require('../../config'); + +function clean(logger, endpoints, options, config) { + var decEndpoints; + var names; + + options = options || {}; + config = defaultConfig(config); + + // If endpoints is an empty array, null them + if (endpoints && !endpoints.length) { + endpoints = null; + } + + // Generate decomposed endpoints and names based on the endpoints + if (endpoints) { + decEndpoints = endpoints.map(function (endpoint) { + return endpointParser.decompose(endpoint); + }); + names = decEndpoints.map(function (decEndpoint) { + return decEndpoint.name || decEndpoint.source; + }); + } + + return Q.all([ + clearPackages(decEndpoints, config, logger), + clearLinks(names, config, logger), + !names ? clearCompletion(config, logger) : null + ]) + .spread(function (entries) { + return entries; + }); +} + +function clearPackages(decEndpoints, config, logger) { + var repository = new PackageRepository(config, logger); + + return repository.list() + .then(function (entries) { + var promises; + + // Filter entries according to the specified packages + if (decEndpoints) { + entries = entries.filter(function (entry) { + return !!mout.array.find(decEndpoints, function (decEndpoint) { + var entryPkgMeta = entry.pkgMeta; + + // Check if name or source match the entry + if (decEndpoint.name !== entryPkgMeta.name && + decEndpoint.source !== entryPkgMeta.name && + decEndpoint.source !== entryPkgMeta._source + ) { + return false; + } + + // If target is a wildcard, simply return true + if (decEndpoint.target === '*') { + return true; + } + + // If it's a semver target, compare using semver spec + if (semver.validRange(decEndpoint.target)) { + return semver.satisfies(entryPkgMeta.version, decEndpoint.target); + } + + // Otherwise, compare against target/release + return decEndpoint.target === entryPkgMeta._target || + decEndpoint.target === entryPkgMeta._release; + }); + }); + } + + promises = entries.map(function (entry) { + return repository.eliminate(entry.pkgMeta) + .then(function () { + logger.info('deleted', 'Cached package ' + entry.pkgMeta.name + ': ' + entry.canonicalDir, { + file: entry.canonicalDir + }); + }); + }); + + return Q.all(promises) + .then(function () { + if (!decEndpoints) { + // Ensure that everything is cleaned, + // even invalid packages in the cache + return repository.clear(); + } + }) + .then(function () { + return entries; + }); + }); +} + +function clearLinks(names, config, logger) { + var promise; + var dir = config.storage.links; + + // If no names are passed, grab all links + if (!names) { + promise = Q.nfcall(fs.readdir, dir) + .fail(function (err) { + if (err.code === 'ENOENT') { + return []; + } + + throw err; + }); + // Otherwise use passed ones + } else { + promise = Q.resolve(names); + } + + return promise + .then(function (names) { + var promises; + var linksToRemove = []; + + // Decide which links to delete + promises = names.map(function (name) { + var link = path.join(config.storage.links, name); + + return Q.nfcall(fs.readlink, link) + .then(function (linkTarget) { + // Link exists, check if it points to a folder + // that still exists + return Q.nfcall(fs.stat, linkTarget) + .then(function (stat) { + // Target is not a folder.. + if (!stat.isDirectory()) { + linksToRemove.push(link); + } + }) + // Error occurred reading the link + .fail(function () { + linksToRemove.push(link); + }); + // Ignore if link does not exist + }, function (err) { + if (err.code !== 'ENOENT') { + linksToRemove.push(link); + } + }); + }); + + return Q.all(promises) + .then(function () { + var promises; + + // Remove each link that was declared as invalid + promises = linksToRemove.map(function (link) { + return Q.nfcall(rimraf, link) + .then(function () { + logger.info('deleted', 'Invalid link: ' + link, { + file: link + }); + }); + }); + + return Q.all(promises); + }); + }); +} + +function clearCompletion(config, logger) { + var dir = config.storage.completion; + + return Q.nfcall(fs.stat, dir) + .then(function () { + return Q.nfcall(rimraf, dir) + .then(function () { + logger.info('deleted', 'Completion cache', { + file: dir + }); + }); + }, function (error) { + if (error.code !== 'ENOENT') { + throw error; + } + }); +} + +// ------------------- + +clean.line = function (logger, argv) { + var options = cli.readOptions(argv); + var endpoints = options.argv.remain.slice(2); + return clean(logger, endpoints, options); +}; + +clean.completion = function () { + // TODO: +}; + +module.exports = clean; diff --git a/packages/Bower.1.3.11/node_modules/bower/lib/commands/cache/list.js b/packages/Bower.1.3.11/node_modules/bower/lib/commands/cache/list.js new file mode 100644 index 0000000..761085c --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/lib/commands/cache/list.js @@ -0,0 +1,44 @@ +var mout = require('mout'); +var PackageRepository = require('../../core/PackageRepository'); +var cli = require('../../util/cli'); +var defaultConfig = require('../../config'); + +function list(logger, packages, options, config) { + var repository; + + config = defaultConfig(config); + repository = new PackageRepository(config, logger); + + // If packages is an empty array, null them + if (packages && !packages.length) { + packages = null; + } + + return repository.list() + .then(function (entries) { + if (packages) { + // Filter entries according to the specified packages + entries = entries.filter(function (entry) { + return !!mout.array.find(packages, function (pkg) { + return pkg === entry.pkgMeta.name; + }); + }); + } + + return entries; + }); +} + +// ------------------- + +list.line = function (logger, argv) { + var options = cli.readOptions(argv); + var packages = options.argv.remain.slice(2); + return list(logger, packages, options); +}; + +list.completion = function () { + // TODO: +}; + +module.exports = list; diff --git a/packages/Bower.1.3.11/node_modules/bower/lib/commands/completion.js b/packages/Bower.1.3.11/node_modules/bower/lib/commands/completion.js new file mode 100644 index 0000000..4cc0017 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/lib/commands/completion.js @@ -0,0 +1,21 @@ +var Q = require('q'); +var cli = require('../util/cli'); + +function completion(config) { + return new Q(); +} + +// ------------------- + +completion.line = function (logger, argv) { + var options = cli.readOptions(argv); + var name = options.argv.remain[1]; + + return completion(logger, name); +}; + +completion.completion = function () { + // TODO: +}; + +module.exports = completion; diff --git a/packages/Bower.1.3.11/node_modules/bower/lib/commands/help.js b/packages/Bower.1.3.11/node_modules/bower/lib/commands/help.js new file mode 100644 index 0000000..8edd384 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/lib/commands/help.js @@ -0,0 +1,42 @@ +var Q = require('q'); +var path = require('path'); +var fs = require('graceful-fs'); +var cli = require('../util/cli'); +var createError = require('../util/createError'); + +function help(logger, name) { + var json; + + if (name) { + json = path.resolve(__dirname, '../../templates/json/help-' + name.replace(/\s+/g, '/') + '.json'); + } else { + json = path.resolve(__dirname, '../../templates/json/help.json'); + } + + return Q.promise(function (resolve) { + fs.exists(json, resolve); + }) + .then(function (exists) { + if (!exists) { + throw createError('Unknown command: ' + name, 'EUNKOWNCMD', { + command: name + }); + } + + return require(json); + }); +} + +// ------------------- + +help.line = function (logger, argv) { + var options = cli.readOptions(argv); + var name = options.argv.remain.slice(1).join(' '); + return help(logger, name); +}; + +help.completion = function () { + // TODO +}; + +module.exports = help; diff --git a/packages/Bower.1.3.11/node_modules/bower/lib/commands/home.js b/packages/Bower.1.3.11/node_modules/bower/lib/commands/home.js new file mode 100644 index 0000000..3bb5e48 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/lib/commands/home.js @@ -0,0 +1,62 @@ +var Project = require('../core/Project'); +var open = require('opn'); +var endpointParser = require('bower-endpoint-parser'); +var cli = require('../util/cli'); +var createError = require('../util/createError'); +var defaultConfig = require('../config'); + +function home(logger, name, config) { + var project; + var promise; + var decEndpoint; + + config = defaultConfig(config); + project = new Project(config, logger); + + // Get the package meta + // If no name is specified, read the project json + // If a name is specified, fetch from the package repository + if (!name) { + promise = project.hasJson() + .then(function (json) { + if (!json) { + throw createError('You are not inside a package', 'ENOENT'); + } + + return project.getJson(); + }); + } else { + decEndpoint = endpointParser.decompose(name); + promise = project.getPackageRepository().fetch(decEndpoint) + .spread(function (canonicalDir, pkgMeta) { + return pkgMeta; + }); + } + + // Get homepage and open it + return promise.then(function (pkgMeta) { + var homepage = pkgMeta.homepage; + + if (!homepage) { + throw createError('No homepage set for ' + pkgMeta.name, 'ENOHOME'); + } + + open(homepage); + return homepage; + }); +} + +// ------------------- + +home.line = function (logger, argv) { + var options = cli.readOptions(argv); + var name = options.argv.remain[1]; + + return home(logger, name); +}; + +home.completion = function () { + // TODO: +}; + +module.exports = home; diff --git a/packages/Bower.1.3.11/node_modules/bower/lib/commands/index.js b/packages/Bower.1.3.11/node_modules/bower/lib/commands/index.js new file mode 100644 index 0000000..fecf77b --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/lib/commands/index.js @@ -0,0 +1,71 @@ +var Q = require('q'); +var Logger = require('bower-logger'); + +/** + * Require commands only when called. + * + * Running `commandFactory(id)` is equivalent to `require(id)`. Both calls return + * a command function. The difference is that `cmd = commandFactory()` and `cmd()` + * return as soon as possible and load and execute the command asynchronously. + */ +function commandFactory(id) { + if (process.env.STRICT_REQUIRE) { + require(id); + } + + function command() { + var commandArgs = [].slice.call(arguments); + + return withLogger(function (logger) { + commandArgs.unshift(logger); + return require(id).apply(undefined, commandArgs); + }); + } + + function runFromArgv(argv) { + return withLogger(function (logger) { + return require(id).line.call(undefined, logger, argv); + }); + } + + function withLogger(func) { + var logger = new Logger(); + + Q.try(func, logger) + .done(function () { + var args = [].slice.call(arguments); + args.unshift('end'); + logger.emit.apply(logger, args); + }, function (error) { + logger.emit('error', error); + }); + + return logger; + } + + command.line = runFromArgv; + return command; +} + + +module.exports = { + cache: { + clean: commandFactory('./cache/clean'), + list: commandFactory('./cache/list'), + }, + completion: commandFactory('./completion'), + help: commandFactory('./help'), + home: commandFactory('./home'), + info: commandFactory('./info'), + init: commandFactory('./init'), + install: commandFactory('./install'), + link: commandFactory('./link'), + list: commandFactory('./list'), + lookup: commandFactory('./lookup'), + prune: commandFactory('./prune'), + register: commandFactory('./register'), + search: commandFactory('./search'), + update: commandFactory('./update'), + uninstall: commandFactory('./uninstall'), + version: commandFactory('./version') +}; diff --git a/packages/Bower.1.3.11/node_modules/bower/lib/commands/info.js b/packages/Bower.1.3.11/node_modules/bower/lib/commands/info.js new file mode 100644 index 0000000..84d9c46 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/lib/commands/info.js @@ -0,0 +1,72 @@ +var mout = require('mout'); +var Q = require('q'); +var endpointParser = require('bower-endpoint-parser'); +var PackageRepository = require('../core/PackageRepository'); +var cli = require('../util/cli'); +var Tracker = require('../util/analytics').Tracker; +var defaultConfig = require('../config'); + +function info(logger, endpoint, property, config) { + var repository; + var decEndpoint; + var tracker; + + config = defaultConfig(config); + repository = new PackageRepository(config, logger); + tracker = new Tracker(config); + + decEndpoint = endpointParser.decompose(endpoint); + tracker.trackDecomposedEndpoints('info', [decEndpoint]); + + return Q.all([ + getPkgMeta(repository, decEndpoint, property), + decEndpoint.target === '*' && !property ? repository.versions(decEndpoint.source) : null + ]) + .spread(function (pkgMeta, versions) { + if (versions) { + return { + name: decEndpoint.source, + versions: versions, + latest: pkgMeta + }; + } + + return pkgMeta; + }); +} + +function getPkgMeta(repository, decEndpoint, property) { + return repository.fetch(decEndpoint) + .spread(function (canonicalDir, pkgMeta) { + pkgMeta = mout.object.filter(pkgMeta, function (value, key) { + return key.charAt(0) !== '_'; + }); + + // Retrieve specific property + if (property) { + pkgMeta = mout.object.get(pkgMeta, property); + } + + return pkgMeta; + }); +} + +// ------------------- + +info.line = function (logger, argv) { + var options = cli.readOptions(argv); + var pkg = options.argv.remain[1]; + var property = options.argv.remain[2]; + + if (!pkg) { + return new Q(); + } + + return info(logger, pkg, property); +}; + +info.completion = function () { + // TODO: +}; + +module.exports = info; diff --git a/packages/Bower.1.3.11/node_modules/bower/lib/commands/init.js b/packages/Bower.1.3.11/node_modules/bower/lib/commands/init.js new file mode 100644 index 0000000..6392639 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/lib/commands/init.js @@ -0,0 +1,332 @@ +var mout = require('mout'); +var fs = require('graceful-fs'); +var path = require('path'); +var Q = require('q'); +var endpointParser = require('bower-endpoint-parser'); +var Project = require('../core/Project'); +var defaultConfig = require('../config'); +var GitHubResolver = require('../core/resolvers/GitHubResolver'); +var GitFsResolver = require('../core/resolvers/GitFsResolver'); +var cli = require('../util/cli'); +var cmd = require('../util/cmd'); +var createError = require('../util/createError'); + +function init(logger, config) { + var project; + + config = defaultConfig(config); + + // This command requires interactive to be enabled + if (!config.interactive) { + process.nextTick(function () { + logger.emit('error', createError('Register requires an interactive shell', 'ENOINT', { + details: 'Note that you can manually force an interactive shell with --config.interactive' + })); + }); + return logger; + } + + project = new Project(config, logger); + + // Start with existing JSON details + return readJson(project, logger) + // Fill in defaults + .then(setDefaults.bind(null, config)) + // Now prompt user to make changes + .then(promptUser.bind(null, logger)) + // Set ignore based on the response + .spread(setIgnore.bind(null, config)) + // Set dependencies based on the response + .spread(setDependencies.bind(null, project)) + // All done! + .spread(saveJson.bind(null, project, logger)); +} + +function readJson(project, logger) { + return project.hasJson() + .then(function (json) { + if (json) { + logger.warn('existing', 'The existing ' + path.basename(json) + ' file will be used and filled in'); + } + + return project.getJson(); + }); +} + +function saveJson(project, logger, json) { + // Cleanup empty props (null values, empty strings, objects and arrays) + mout.object.forOwn(json, function (value, key) { + if (value == null || mout.lang.isEmpty(value)) { + delete json[key]; + } + }); + + logger.info('json', 'Generated json', { json: json }); + + // Confirm the json with the user + return Q.nfcall(logger.prompt.bind(logger), { + type: 'confirm', + message: 'Looks good?', + default: true + }) + .then(function (good) { + if (!good) { + return null; + } + + // Save json (true forces file creation) + return project.saveJson(true); + }); +} + +function setDefaults(config, json) { + var name; + var promise = Q.resolve(); + + // Name + if (!json.name) { + json.name = path.basename(config.cwd); + } + + // Version + if (!json.version) { + // Assume latest semver tag if it's a git repo + promise = promise.then(function () { + return GitFsResolver.versions(config.cwd) + .then(function (versions) { + json.version = versions[0] || '0.0.0'; + }, function () { + json.version = '0.0.0'; + }); + }); + } + + // Main + if (!json.main) { + // Remove '.js' from the end of the package name if it is there + name = path.basename(json.name, '.js'); + + if (fs.existsSync(path.join(config.cwd, 'index.js'))) { + json.main = 'index.js'; + } else if (fs.existsSync(path.join(config.cwd, name + '.js'))) { + json.main = name + '.js'; + } + } + + // Homepage + if (!json.homepage) { + // Set as GitHub homepage if it's a GitHub repository + promise = promise.then(function () { + return cmd('git', ['config', '--get', 'remote.origin.url']) + .spread(function (stdout) { + var pair; + + stdout = stdout.trim(); + if (!stdout) { + return; + } + + pair = GitHubResolver.getOrgRepoPair(stdout); + if (pair) { + json.homepage = 'https://github.com/' + pair.org + '/' + pair.repo; + } + }) + .fail(function () { }); + }); + } + + if (!json.authors) { + promise = promise.then(function () { + // Get the user name configured in git + return cmd('git', ['config', '--get', '--global', 'user.name']) + .spread(function (stdout) { + var gitEmail; + var gitName = stdout.trim(); + + // Abort if no name specified + if (!gitName) { + return; + } + + // Get the user email configured in git + return cmd('git', ['config', '--get', '--global', 'user.email']) + .spread(function (stdout) { + gitEmail = stdout.trim(); + }, function () {}) + .then(function () { + json.authors = gitName; + json.authors += gitEmail ? ' <' + gitEmail + '>' : ''; + }); + }, function () {}); + }); + } + + return promise.then(function () { + return json; + }); +} + +function promptUser(logger, json) { + var questions = [ + { + 'name': 'name', + 'message': 'name', + 'default': json.name, + 'type': 'input' + }, + { + 'name': 'version', + 'message': 'version', + 'default': json.version, + 'type': 'input' + }, + { + 'name': 'description', + 'message': 'description', + 'default': json.description, + 'type': 'input' + }, + { + 'name': 'main', + 'message': 'main file', + 'default': json.main, + 'type': 'input' + }, + { + 'name': 'moduleType', + 'message': 'what types of modules does this package expose?', + 'type': 'checkbox', + 'choices': ['amd', 'es6', 'globals', 'node', 'yui'] + }, + { + 'name': 'keywords', + 'message': 'keywords', + 'default': json.keywords ? json.keywords.toString() : null, + 'type': 'input' + }, + { + 'name': 'authors', + 'message': 'authors', + 'default': json.authors ? json.authors.toString() : null, + 'type': 'input' + }, + { + 'name': 'license', + 'message': 'license', + 'default': json.license || 'MIT', + 'type': 'input' + }, + { + 'name': 'homepage', + 'message': 'homepage', + 'default': json.homepage, + 'type': 'input' + }, + { + 'name': 'dependencies', + 'message': 'set currently installed components as dependencies?', + 'default': !mout.object.size(json.dependencies) && !mout.object.size(json.devDependencies), + 'type': 'confirm' + }, + { + 'name': 'ignore', + 'message': 'add commonly ignored files to ignore list?', + 'default': true, + 'type': 'confirm' + }, + { + 'name': 'private', + 'message': 'would you like to mark this package as private which prevents it from being accidentally published to the registry?', + 'default': !!json.private, + 'type': 'confirm' + } + ]; + + return Q.nfcall(logger.prompt.bind(logger), questions) + .then(function (answers) { + json.name = answers.name; + json.version = answers.version; + json.description = answers.description; + json.main = answers.main; + json.moduleType = answers.moduleType; + json.keywords = toArray(answers.keywords); + json.authors = toArray(answers.authors, ','); + json.license = answers.license; + json.homepage = answers.homepage; + json.private = answers.private || null; + + return [json, answers]; + }); +} + +function toArray(value, splitter) { + var arr = value.split(splitter || /[\s,]/); + + // Trim values + arr = arr.map(function (item) { + return item.trim(); + }); + + // Filter empty values + arr = arr.filter(function (item) { + return !!item; + }); + + return arr.length ? arr : null; +} + +function setIgnore(config, json, answers) { + if (answers.ignore) { + json.ignore = mout.array.combine(json.ignore || [], [ + '**/.*', + 'node_modules', + 'bower_components', + config.directory, + 'test', + 'tests' + ]); + } + + return [json, answers]; +} + +function setDependencies(project, json, answers) { + if (answers.dependencies) { + return project.getTree() + .spread(function (tree, flattened, extraneous) { + if (extraneous.length) { + json.dependencies = {}; + + // Add extraneous as dependencies + extraneous.forEach(function (extra) { + var jsonEndpoint; + + // Skip linked packages + if (extra.linked) { + return; + } + + jsonEndpoint = endpointParser.decomposed2json(extra.endpoint); + mout.object.mixIn(json.dependencies, jsonEndpoint); + }); + } + + return [json, answers]; + }); + } + + return [json, answers]; +} + +// ------------------- + +init.line = function (logger, argv) { + var options = cli.readOptions(argv); + return init(logger, options); +}; + +init.completion = function () { + // TODO: +}; + +module.exports = init; diff --git a/packages/Bower.1.3.11/node_modules/bower/lib/commands/install.js b/packages/Bower.1.3.11/node_modules/bower/lib/commands/install.js new file mode 100644 index 0000000..dba8d04 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/lib/commands/install.js @@ -0,0 +1,50 @@ +var endpointParser = require('bower-endpoint-parser'); +var Project = require('../core/Project'); +var cli = require('../util/cli'); +var Tracker = require('../util/analytics').Tracker; +var defaultConfig = require('../config'); + +function install(logger, endpoints, options, config) { + var project; + var decEndpoints; + var tracker; + + options = options || {}; + config = defaultConfig(config); + if (options.save === undefined) { + options.save = config.defaultSave; + } + project = new Project(config, logger); + tracker = new Tracker(config); + + // Convert endpoints to decomposed endpoints + endpoints = endpoints || []; + decEndpoints = endpoints.map(function (endpoint) { + return endpointParser.decompose(endpoint); + }); + tracker.trackDecomposedEndpoints('install', decEndpoints); + + return project.install(decEndpoints, options, config); +} + +// ------------------- + +install.line = function (logger, argv) { + var options = install.options(argv); + return install(logger, options.argv.remain.slice(1), options); +}; + +install.options = function (argv) { + return cli.readOptions({ + 'force-latest': { type: Boolean, shorthand: 'F'}, + 'production': { type: Boolean, shorthand: 'p' }, + 'save': { type: Boolean, shorthand: 'S' }, + 'save-dev': { type: Boolean, shorthand: 'D' } + }, argv); +}; + +install.completion = function () { + // TODO: +}; + +module.exports = install; diff --git a/packages/Bower.1.3.11/node_modules/bower/lib/commands/link.js b/packages/Bower.1.3.11/node_modules/bower/lib/commands/link.js new file mode 100644 index 0000000..60a6691 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/lib/commands/link.js @@ -0,0 +1,87 @@ +var path = require('path'); +var rimraf = require('rimraf'); +var Q = require('q'); +var Project = require('../core/Project'); +var createLink = require('../util/createLink'); +var cli = require('../util/cli'); +var defaultConfig = require('../config'); + +function link(logger, name, localName) { + if (name) { + return linkTo(logger, name, localName); + } else { + return linkSelf(logger); + } +} + +function linkSelf(logger, config) { + var project; + + config = defaultConfig(config); + project = new Project(config, logger); + + return project.getJson() + .then(function (json) { + var src = config.cwd; + var dst = path.join(config.storage.links, json.name); + + // Delete previous link if any + return Q.nfcall(rimraf, dst) + // Link globally + .then(function () { + return createLink(src, dst); + }) + .then(function () { + return { + src: src, + dst: dst + }; + }); + }); +} + +function linkTo(logger, name, localName, config) { + var src; + var dst; + var project; + + config = defaultConfig(config); + project = new Project(config, logger); + + localName = localName || name; + src = path.join(config.storage.links, name); + dst = path.join(process.cwd(), config.directory, localName); + + // Delete destination folder if any + return Q.nfcall(rimraf, dst) + // Link locally + .then(function () { + return createLink(src, dst); + }) + // Install linked package deps + .then(function () { + return project.update([localName]); + }) + .then(function (installed) { + return { + src: src, + dst: dst, + installed: installed + }; + }); +} + +// ------------------- + +link.line = function (logger, argv) { + var options = cli.readOptions(argv); + var name = options.argv.remain[1]; + var localName = options.argv.remain[2]; + return link(logger, name, localName); +}; + +link.completion = function () { + // TODO: +}; + +module.exports = link; diff --git a/packages/Bower.1.3.11/node_modules/bower/lib/commands/list.js b/packages/Bower.1.3.11/node_modules/bower/lib/commands/list.js new file mode 100644 index 0000000..08244fe --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/lib/commands/list.js @@ -0,0 +1,170 @@ +var path = require('path'); +var mout = require('mout'); +var Q = require('q'); +var Project = require('../core/Project'); +var semver = require('../util/semver'); +var cli = require('../util/cli'); +var defaultConfig = require('../config'); + +function list(logger, options, config) { + var project; + + options = options || {}; + + // Make relative option true by default when used with paths + if (options.paths && options.relative == null) { + options.relative = true; + } + + config = defaultConfig(config); + project = new Project(config, logger); + + return project.getTree(options) + .spread(function (tree, flattened) { + // Relativize paths + // Also normalize paths on windows + project.walkTree(tree, function (node) { + if (node.missing) { + return; + } + + if (options.relative) { + node.canonicalDir = path.relative(config.cwd, node.canonicalDir); + } + if (options.paths) { + node.canonicalDir = normalize(node.canonicalDir); + } + }, true); + + // Note that we need to to parse the flattened tree because it might + // contain additional packages + mout.object.forOwn(flattened, function (node) { + if (node.missing) { + return; + } + + if (options.relative) { + node.canonicalDir = path.relative(config.cwd, node.canonicalDir); + } + if (options.paths) { + node.canonicalDir = normalize(node.canonicalDir); + } + }); + + // Render paths? + if (options.paths) { + return paths(flattened); + } + + // Do not check for new versions? + if (config.offline) { + return tree; + } + + // Check for new versions + return checkVersions(project, tree, logger) + .then(function () { + return tree; + }); + }); +} + +function checkVersions(project, tree, logger) { + var promises; + var nodes = []; + var repository = project.getPackageRepository(); + + // Gather all nodes, ignoring linked nodes + project.walkTree(tree, function (node) { + if (!node.linked) { + nodes.push(node); + } + }, true); + + if (nodes.length) { + logger.info('check-new', 'Checking for new versions of the project dependencies..'); + } + + // Check for new versions for each node + promises = nodes.map(function (node) { + var target = node.endpoint.target; + + return repository.versions(node.endpoint.source) + .then(function (versions) { + node.versions = versions; + + // Do not check if node's target is not a valid semver one + if (versions.length && semver.validRange(target)) { + node.update = { + target: semver.maxSatisfying(versions, target), + latest: semver.maxSatisfying(versions, '*') + }; + } + }); + }); + + // Set the versions also for the root node + tree.versions = []; + + return Q.all(promises); +} + +function paths(flattened) { + var ret = {}; + + mout.object.forOwn(flattened, function (pkg, name) { + var main; + + if (pkg.missing) { + return; + } + + main = pkg.pkgMeta.main; + + // If no main was specified, fallback to canonical dir + if (!main) { + ret[name] = pkg.canonicalDir; + return; + } + + // Normalize main + if (typeof main === 'string') { + main = [main]; + } + + // Concatenate each main entry with the canonical dir + main = main.map(function (part) { + return normalize(path.join(pkg.canonicalDir, part).trim()); + }); + + // If only one main file, use a string + // Otherwise use an array + ret[name] = main.length === 1 ? main[0] : main; + }); + + return ret; +} + +function normalize(src) { + return src.replace(/\\/g, '/'); +} + +// ------------------- + +list.line = function (logger, argv) { + var options = list.options(argv); + return list(logger, options); +}; + +list.options = function (argv) { + return cli.readOptions({ + 'paths': { type: Boolean, shorthand: 'p' }, + 'relative': { type: Boolean, shorthand: 'r' } + }, argv); +}; + +list.completion = function () { + // TODO: +}; + +module.exports = list; diff --git a/packages/Bower.1.3.11/node_modules/bower/lib/commands/lookup.js b/packages/Bower.1.3.11/node_modules/bower/lib/commands/lookup.js new file mode 100644 index 0000000..748fece --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/lib/commands/lookup.js @@ -0,0 +1,42 @@ +var Q = require('q'); +var RegistryClient = require('bower-registry-client'); +var cli = require('../util/cli'); +var defaultConfig = require('../config'); + +function lookup(logger, name, config) { + var registryClient; + + config = defaultConfig(config); + config.cache = config.storage.registry; + + registryClient = new RegistryClient(config, logger); + + return Q.nfcall(registryClient.lookup.bind(registryClient), name) + .then(function (entry) { + // TODO: Handle entry.type.. for now it's only 'alias' + // When we got published packages, this needs to be adjusted + return !entry ? null : { + name: name, + url: entry && entry.url + }; + }); +} + +// ------------------- + +lookup.line = function (logger, argv) { + var options = cli.readOptions(argv); + var name = options.argv.remain[1]; + + if (!name) { + return new Q(); + } else { + return lookup(logger, name); + } +}; + +lookup.completion = function () { + // TODO: +}; + +module.exports = lookup; diff --git a/packages/Bower.1.3.11/node_modules/bower/lib/commands/prune.js b/packages/Bower.1.3.11/node_modules/bower/lib/commands/prune.js new file mode 100644 index 0000000..dc9c033 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/lib/commands/prune.js @@ -0,0 +1,59 @@ +var mout = require('mout'); +var Project = require('../core/Project'); +var cli = require('../util/cli'); +var defaultConfig = require('../config'); + +function prune(logger, options, config) { + var project; + + options = options || {}; + config = defaultConfig(config); + project = new Project(config, logger); + + return clean(project, options); +} + +function clean(project, options, removed) { + removed = removed || {}; + + // Continually call clean until there is no more extraneous + // dependencies to remove + return project.getTree(options) + .spread(function (tree, flattened, extraneous) { + var names = extraneous.map(function (extra) { + return extra.endpoint.name; + }); + + // Uninstall extraneous + return project.uninstall(names, options) + .then(function (uninstalled) { + // Are we done? + if (!mout.object.size(uninstalled)) { + return removed; + } + + // Not yet, recurse! + mout.object.mixIn(removed, uninstalled); + return clean(project, options, removed); + }); + }); +} + +// ------------------- + +prune.line = function (logger, argv) { + var options = prune.options(argv); + return prune(logger, options); +}; + +prune.options = function (argv) { + return cli.readOptions({ + 'production': { type: Boolean, shorthand: 'p' }, + }, argv); +}; + +prune.completion = function () { + // TODO: +}; + +module.exports = prune; diff --git a/packages/Bower.1.3.11/node_modules/bower/lib/commands/register.js b/packages/Bower.1.3.11/node_modules/bower/lib/commands/register.js new file mode 100644 index 0000000..40b04b7 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/lib/commands/register.js @@ -0,0 +1,123 @@ +var mout = require('mout'); +var Q = require('q'); +var chalk = require('chalk'); +var PackageRepository = require('../core/PackageRepository'); +var Config = require('bower-config'); +var Tracker = require('../util/analytics').Tracker; +var cli = require('../util/cli'); +var createError = require('../util/createError'); +var defaultConfig = require('../config'); +var GitHubResolver = require('../core/resolvers/GitHubResolver'); + +function register(logger, name, url, config) { + var repository; + var registryClient; + var tracker; + var force; + + config = defaultConfig(config); + force = config.force; + tracker = new Tracker(config); + + // Bypass any cache + config.offline = false; + config.force = true; + + // Trim name + name = name.trim(); + + return Q.try(function () { + // Verify name + // TODO: Verify with the new spec regexp? + if (!name) { + throw createError('Please type a name', 'EINVNAME'); + } + + // The public registry only allows git:// endpoints + // As such, we attempt to convert URLs as necessary + if (config.registry.register === Config.DEFAULT_REGISTRY) { + url = convertUrl(url, logger); + + if (!mout.string.startsWith(url, 'git://')) { + throw createError('The registry only accepts URLs starting with git://', 'EINVFORMAT'); + } + } + + tracker.track('register'); + + // Attempt to resolve the package referenced by the URL to ensure + // everything is ok before registering + repository = new PackageRepository(config, logger); + return repository.fetch({ name: name, source: url, target: '*' }); + }) + .spread(function (canonicalDir, pkgMeta) { + if (pkgMeta.private) { + throw createError('The package you are trying to register is marked as private', 'EPRIV'); + } + + // If non interactive or user forced, bypass confirmation + if (!config.interactive || force) { + return true; + } + + // Confirm if the user really wants to register + return Q.nfcall(logger.prompt.bind(logger), { + type: 'confirm', + message: 'Registering a package will make it installable via the registry (' + + chalk.cyan.underline(config.registry.register) + '), continue?', + default: true + }); + }) + .then(function (result) { + // If user response was negative, abort + if (!result) { + return; + } + + // Register + registryClient = repository.getRegistryClient(); + + logger.action('register', url, { + name: name, + url: url + }); + + return Q.nfcall(registryClient.register.bind(registryClient), name, url); + }); +} + +function convertUrl(url, logger) { + var pair; + var newUrl; + + if (!mout.string.startsWith(url, 'git://')) { + // Convert GitHub ssh & https to git:// + pair = GitHubResolver.getOrgRepoPair(url); + if (pair) { + newUrl = 'git://github.com/' + pair.org + '/' + pair.repo + '.git'; + logger.warn('convert', 'Converted ' + url + ' to ' + newUrl); + } + } + + return newUrl || url; +} + +// ------------------- + +register.line = function (logger, argv) { + var options = cli.readOptions(argv); + var name = options.argv.remain[1]; + var url = options.argv.remain[2]; + + if (!name || !url) { + return new Q(); + } else { + return register(logger, name, url); + } +}; + +register.completion = function () { + // TODO: +}; + +module.exports = register; diff --git a/packages/Bower.1.3.11/node_modules/bower/lib/commands/search.js b/packages/Bower.1.3.11/node_modules/bower/lib/commands/search.js new file mode 100644 index 0000000..8fb6e9d --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/lib/commands/search.js @@ -0,0 +1,39 @@ +var Q = require('q'); +var RegistryClient = require('bower-registry-client'); +var cli = require('../util/cli'); +var Tracker = require('../util/analytics').Tracker; +var defaultConfig = require('../config'); + +function search(logger, name, config) { + var registryClient; + var tracker; + + config = defaultConfig(config); + config.cache = config.storage.registry; + + registryClient = new RegistryClient(config, logger); + tracker = new Tracker(config); + tracker.track('search', name); + + // If no name was specified, list all packages + if (!name) { + return Q.nfcall(registryClient.list.bind(registryClient)); + // Otherwise search it + } else { + return Q.nfcall(registryClient.search.bind(registryClient), name); + } +} + +// ------------------- + +search.line = function (logger, argv) { + var options = cli.readOptions(argv); + var name = options.argv.remain.slice(1).join(' '); + return search(logger, name, options); +}; + +search.completion = function () { + // TODO: +}; + +module.exports = search; diff --git a/packages/Bower.1.3.11/node_modules/bower/lib/commands/uninstall.js b/packages/Bower.1.3.11/node_modules/bower/lib/commands/uninstall.js new file mode 100644 index 0000000..324a6e9 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/lib/commands/uninstall.js @@ -0,0 +1,124 @@ +var mout = require('mout'); +var Q = require('q'); +var Project = require('../core/Project'); +var cli = require('../util/cli'); +var Tracker = require('../util/analytics').Tracker; +var defaultConfig = require('../config'); + +function uninstall(logger, names, options, config) { + var project; + var tracker; + + options = options || {}; + config = defaultConfig(config); + project = new Project(config, logger); + tracker = new Tracker(config); + + tracker.trackNames('uninstall', names); + + return project.getTree(options) + .spread(function (tree, flattened) { + // Uninstall nodes + return project.uninstall(names, options) + // Clean out non-shared uninstalled dependencies + .then(function (uninstalled) { + var names = Object.keys(uninstalled); + var children = []; + + // Grab the dependencies of packages that were uninstalled + mout.object.forOwn(flattened, function (node) { + if (names.indexOf(node.endpoint.name) !== -1) { + children.push.apply(children, mout.object.keys(node.dependencies)); + } + }); + + // Clean them! + return clean(project, children, uninstalled); + }); + }); +} + +function clean(project, names, removed) { + removed = removed || {}; + + return project.getTree() + .spread(function (tree, flattened) { + var nodes = []; + var dependantsCounter = {}; + + // Grab the nodes of each specified name + mout.object.forOwn(flattened, function (node) { + if (names.indexOf(node.endpoint.name) !== -1) { + nodes.push(node); + } + }); + + // Walk the down the tree, gathering dependants of the packages + project.walkTree(tree, function (node, nodeName) { + if (names.indexOf(nodeName) !== -1) { + dependantsCounter[nodeName] = dependantsCounter[nodeName] || 0; + dependantsCounter[nodeName] += node.nrDependants; + } + }, true); + + + // Filter out those that have no dependants + nodes = nodes.filter(function (node) { + return !dependantsCounter[node.endpoint.name]; + }); + + // Are we done? + if (!nodes.length) { + return Q.resolve(removed); + } + + // Grab the nodes after filtering + names = nodes.map(function (node) { + return node.endpoint.name; + }); + + // Uninstall them + return project.uninstall(names) + // Clean out non-shared uninstalled dependencies + .then(function (uninstalled) { + var children; + + mout.object.mixIn(removed, uninstalled); + + // Grab the dependencies of packages that were uninstalled + children = []; + nodes.forEach(function (node) { + children.push.apply(children, mout.object.keys(node.dependencies)); + }); + + // Recurse! + return clean(project, children, removed); + }); + }); +} + +// ------------------- + +uninstall.line = function (logger, argv) { + var options = uninstall.options(argv); + var names = options.argv.remain.slice(1); + + if (!names.length) { + return new Q(); + } else { + return uninstall(logger, names, options); + } +}; + +uninstall.options = function (argv) { + return cli.readOptions({ + 'save': { type: Boolean, shorthand: 'S' }, + 'save-dev': { type: Boolean, shorthand: 'D' } + }, argv); +}; + +uninstall.completion = function () { + // TODO: +}; + +module.exports = uninstall; diff --git a/packages/Bower.1.3.11/node_modules/bower/lib/commands/update.js b/packages/Bower.1.3.11/node_modules/bower/lib/commands/update.js new file mode 100644 index 0000000..f921303 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/lib/commands/update.js @@ -0,0 +1,39 @@ +var Project = require('../core/Project'); +var cli = require('../util/cli'); +var defaultConfig = require('../config'); + +function update(logger, names, options, config) { + var project; + + options = options || {}; + config = defaultConfig(config); + project = new Project(config, logger); + + // If names is an empty array, null them + if (names && !names.length) { + names = null; + } + + return project.update(names, options); +} + +// ------------------- + +update.line = function (logger, argv) { + var options = update.options(argv); + var names = options.argv.remain.slice(1); + return update(logger, names, options); +}; + +update.options = function (argv) { + return cli.readOptions({ + 'force-latest': { type: Boolean, shorthand: 'F' }, + 'production': { type: Boolean, shorthand: 'p' } + }, argv); +}; + +update.completion = function () { + // TODO: +}; + +module.exports = update; diff --git a/packages/Bower.1.3.11/node_modules/bower/lib/commands/version.js b/packages/Bower.1.3.11/node_modules/bower/lib/commands/version.js new file mode 100644 index 0000000..8a3faa3 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/lib/commands/version.js @@ -0,0 +1,131 @@ +var semver = require('semver'); +var which = require('which'); +var fs = require('fs'); +var path = require('path'); +var Q = require('q'); +var execFile = require('child_process').execFile; +var Project = require('../core/Project'); +var cli = require('../util/cli'); +var defaultConfig = require('../config'); +var createError = require('../util/createError'); + +function version(logger, versionArg, options, config) { + var project; + + config = defaultConfig(config); + project = new Project(config, logger); + + return bump(project, versionArg, options.message); +} + +function bump(project, versionArg, message) { + var newVersion; + var doGitCommit = false; + + return checkGit() + .then(function (hasGit) { + doGitCommit = hasGit; + }) + .then(project.getJson.bind(project)) + .then(function (json) { + newVersion = getNewVersion(json.version, versionArg); + json.version = newVersion; + }) + .then(project.saveJson.bind(project)) + .then(function () { + if (doGitCommit) { + return gitCommitAndTag(newVersion, message); + } + }) + .then(function () { + console.log('v' + newVersion); + }); +} + +function getNewVersion(currentVersion, versionArg) { + var newVersion = semver.valid(versionArg); + if (!newVersion) { + newVersion = semver.inc(currentVersion, versionArg); + } + if (!newVersion) { + throw createError('Invalid version argument: `' + versionArg + '`. Usage: `bower version [ | major | minor | patch]`', 'EINVALIDVERSION'); + } + if (currentVersion === newVersion) { + throw createError('Version not changed', 'EVERSIONNOTCHANGED'); + } + return newVersion; +} + +function checkGit() { + var gitDir = path.join(process.cwd(), '.git'); + return Q.nfcall(fs.stat, gitDir) + .then(function (stat) { + if (stat.isDirectory()) { + return checkGitStatus(); + } + return false; + }, function () { + //Ignore not found .git directory + return false; + }); +} + +function checkGitStatus() { + return Q.nfcall(which, 'git') + .fail(function (err) { + err.code = 'ENOGIT'; + throw err; + }) + .then(function () { + return Q.nfcall(execFile, 'git', ['status', '--porcelain'], {env: process.env}); + }) + .then(function (value) { + var stdout = value[0]; + var lines = filterModifiedStatusLines(stdout); + if (lines.length) { + throw createError('Git working directory not clean.\n' + lines.join('\n'), 'EWORKINGDIRECTORYDIRTY'); + } + return true; + }); +} + +function filterModifiedStatusLines(stdout) { + return stdout.trim().split('\n') + .filter(function (line) { + return line.trim() && !line.match(/^\?\? /); + }).map(function (line) { + return line.trim(); + }); +} + +function gitCommitAndTag(newVersion, message) { + var tag = 'v' + newVersion; + message = message || tag; + message = message.replace(/%s/g, newVersion); + return Q.nfcall(execFile, 'git', ['add', 'bower.json'], {env: process.env}) + .then(function () { + return Q.nfcall(execFile, 'git', ['commit', '-m', message], {env: process.env}); + }) + .then(function () { + return Q.nfcall(execFile, 'git', ['tag', tag, '-am', message], {env: process.env}); + }); +} + +// ------------------- + +version.line = function (logger, argv) { + var options = version.options(argv); + return version(logger, options.argv.remain[1], options); +}; + +version.options = function (argv) { + return cli.readOptions({ + 'message': { type: String, shorthand: 'm'} + }, argv); +}; + +version.completion = function () { + // TODO: +}; + +module.exports = version; diff --git a/packages/Bower.1.3.11/node_modules/bower/lib/config.js b/packages/Bower.1.3.11/node_modules/bower/lib/config.js new file mode 100644 index 0000000..3dfa6c5 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/lib/config.js @@ -0,0 +1,55 @@ +var tty = require('tty'); +var object = require('mout').object; +var bowerConfig = require('bower-config'); +var cli = require('./util/cli'); + +var cachedConfigs = {}; + +function defaultConfig(config) { + config = config || {}; + + var cachedConfig = readCachedConfig(config.cwd || process.cwd()); + + return object.merge(cachedConfig, config); +} + +function readCachedConfig(cwd) { + if (cachedConfigs[cwd]) { + return cachedConfigs[cwd]; + } + + var config = cachedConfigs[cwd] = bowerConfig.read(cwd); + + // Delete the json attribute because it is no longer supported + // and conflicts with --json + delete config.json; + + // If interactive is auto (null), guess its value + if (config.interactive == null) { + config.interactive = ( + process.bin === 'bower' && + tty.isatty(1) && + !process.env.CI + ); + } + + // Merge common CLI options into the config + object.mixIn(config, cli.readOptions({ + force: { type: Boolean, shorthand: 'f' }, + offline: { type: Boolean, shorthand: 'o' }, + verbose: { type: Boolean, shorthand: 'V' }, + quiet: { type: Boolean, shorthand: 'q' }, + loglevel: { type: String, shorthand: 'l' }, + json: { type: Boolean, shorthand: 'j' }, + silent: { type: Boolean, shorthand: 's' } + })); + + return config; +} + +function resetCache () { + cachedConfigs = {}; +} + +module.exports = defaultConfig; +module.exports.reset = resetCache; diff --git a/packages/Bower.1.3.11/node_modules/bower/lib/core/Manager.js b/packages/Bower.1.3.11/node_modules/bower/lib/core/Manager.js new file mode 100644 index 0000000..d519b4f --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/lib/core/Manager.js @@ -0,0 +1,1011 @@ +var Q = require('q'); +var mout = require('mout'); +var path = require('path'); +var mkdirp = require('mkdirp'); +var rimraf = require('rimraf'); +var fs = require('graceful-fs'); +var endpointParser = require('bower-endpoint-parser'); +var PackageRepository = require('./PackageRepository'); +var semver = require('../util/semver'); +var copy = require('../util/copy'); +var createError = require('../util/createError'); +var scripts = require('./scripts'); + +function Manager(config, logger) { + this._config = config; + this._logger = logger; + this._repository = new PackageRepository(this._config, this._logger); + + this.configure({}); +} + +// ----------------- + +Manager.prototype.configure = function (setup) { + var targetsHash = {}; + + this._conflicted = {}; + + // Targets + this._targets = setup.targets || []; + this._targets.forEach(function (decEndpoint) { + decEndpoint.initialName = decEndpoint.name; + decEndpoint.dependants = mout.object.values(decEndpoint.dependants); + targetsHash[decEndpoint.name] = true; + + // If the endpoint is marked as newly, make it unresolvable + decEndpoint.unresolvable = !!decEndpoint.newly; + }); + + // Resolved & installed + this._resolved = {}; + this._installed = {}; + mout.object.forOwn(setup.resolved, function (decEndpoint, name) { + decEndpoint.dependants = mout.object.values(decEndpoint.dependants); + this._resolved[name] = [decEndpoint]; + this._installed[name] = decEndpoint.pkgMeta; + }, this); + + // Installed + mout.object.mixIn(this._installed, setup.installed); + + // Incompatibles + this._incompatibles = {}; + setup.incompatibles = this._uniquify(setup.incompatibles || []); + setup.incompatibles.forEach(function (decEndpoint) { + var name = decEndpoint.name; + + this._incompatibles[name] = this._incompatibles[name] || []; + this._incompatibles[name].push(decEndpoint); + decEndpoint.dependants = mout.object.values(decEndpoint.dependants); + + // Mark as conflicted so that the resolution is not removed + this._conflicted[name] = true; + + // If not a target/resolved, add as target + if (!targetsHash[name] && !this._resolved[name]) { + this._targets.push(decEndpoint); + } + }, this); + + // Resolutions + this._resolutions = setup.resolutions || {}; + + // Uniquify targets + this._targets = this._uniquify(this._targets); + + // Force-latest + this._forceLatest = !!setup.forceLatest; + + return this; +}; + +Manager.prototype.resolve = function () { + // If already resolving, error out + if (this._working) { + return Q.reject(createError('Already working', 'EWORKING')); + } + + // Reset stuff + this._fetching = {}; + this._nrFetching = 0; + this._failed = {}; + this._hasFailed = false; + this._deferred = Q.defer(); + + // If there's nothing to resolve, simply dissect + if (!this._targets.length) { + process.nextTick(this._dissect.bind(this)); + // Otherwise, fetch each target from the repository + // and let the process roll out + } else { + this._targets.forEach(this._fetch.bind(this)); + } + + // Unset working flag when done + return this._deferred.promise + .fin(function () { + this._working = false; + }.bind(this)); +}; + +Manager.prototype.preinstall = function (json) { + var that = this; + var componentsDir = path.join(this._config.cwd, this._config.directory); + + // If nothing to install, skip the code bellow + if (mout.lang.isEmpty(that._dissected)) { + return Q.resolve({}); + } + + return Q.nfcall(mkdirp, componentsDir) + .then(function () { + return scripts.preinstall( + that._config, that._logger, that._dissected, that._installed, json + ); + }); +}; + +Manager.prototype.postinstall = function (json) { + var that = this; + var componentsDir = path.join(this._config.cwd, this._config.directory); + + // If nothing to install, skip the code bellow + if (mout.lang.isEmpty(that._dissected)) { + return Q.resolve({}); + } + + return Q.nfcall(mkdirp, componentsDir) + .then(function () { + return scripts.postinstall( + that._config, that._logger, that._dissected, that._installed, json + ); + }); +}; + +Manager.prototype.install = function (json) { + var componentsDir; + var that = this; + + // If already resolving, error out + if (this._working) { + return Q.reject(createError('Already working', 'EWORKING')); + } + + // If nothing to install, skip the code bellow + if (mout.lang.isEmpty(that._dissected)) { + return Q.resolve({}); + } + + componentsDir = path.join(this._config.cwd, this._config.directory); + return Q.nfcall(mkdirp, componentsDir) + .then(function () { + var promises = []; + + mout.object.forOwn(that._dissected, function (decEndpoint, name) { + var promise; + var dst; + var release = decEndpoint.pkgMeta._release; + + that._logger.action('install', name + (release ? '#' + release : ''), that.toData(decEndpoint)); + + dst = path.join(componentsDir, name); + + // Remove existent and copy canonical dir + promise = Q.nfcall(rimraf, dst) + .then(copy.copyDir.bind(copy, decEndpoint.canonicalDir, dst)) + .then(function () { + var metaFile = path.join(dst, '.bower.json'); + + decEndpoint.canonicalDir = dst; + + // Store additional metadata in bower.json + return Q.nfcall(fs.readFile, metaFile) + .then(function (contents) { + var json = JSON.parse(contents.toString()); + + json._target = decEndpoint.target; + json._originalSource = decEndpoint.source; + if (decEndpoint.newly) { + json._direct = true; + } + + json = JSON.stringify(json, null, ' '); + return Q.nfcall(fs.writeFile, metaFile, json); + }); + }); + + promises.push(promise); + }); + + return Q.all(promises); + }) + .then(function () { + // Sync up dissected dependencies and dependants + // See: https://github.com/bower/bower/issues/879 + mout.object.forOwn(that._dissected, function (pkg) { + // Sync dependencies + mout.object.forOwn(pkg.dependencies, function (dependency, name) { + var dissected = this._dissected[name] || (this._resolved[name] ? this._resolved[name][0] : dependency); + pkg.dependencies[name] = dissected; + }, this); + + // Sync dependants + pkg.dependants = pkg.dependants.map(function (dependant) { + var name = dependant.name; + var dissected = this._dissected[name] || (this._resolved[name] ? this._resolved[name][0] : dependant); + + return dissected; + }, this); + }, that); + + // Resolve with meaningful data + return mout.object.map(that._dissected, function (decEndpoint) { + return this.toData(decEndpoint); + }, that); + }) + .fin(function () { + this._working = false; + }.bind(this)); +}; + +Manager.prototype.toData = function (decEndpoint, extraKeys, upperDeps) { + var names; + var extra; + + var data = {}; + + upperDeps = upperDeps || []; + data.endpoint = mout.object.pick(decEndpoint, ['name', 'source', 'target']); + + if (decEndpoint.canonicalDir) { + data.canonicalDir = decEndpoint.canonicalDir; + data.pkgMeta = decEndpoint.pkgMeta; + } + + if (extraKeys) { + extra = mout.object.pick(decEndpoint, extraKeys); + extra = mout.object.filter(extra, function (value) { + return !!value; + }); + mout.object.mixIn(data, extra); + } + + if (decEndpoint.dependencies) { + data.dependencies = {}; + + // Call recursively for each dependency but ordered + // by dependency names + names = Object.keys(decEndpoint.dependencies).sort(); + names.forEach(function (name) { + + // Prevent from infinite recursion when installing cyclic + // dependencies + if (!mout.array.contains(upperDeps, name)) { + data.dependencies[name] = this.toData(decEndpoint.dependencies[name], + extraKeys, + upperDeps.concat(decEndpoint.name)); + } + }, this); + } + + data.nrDependants = mout.object.size(decEndpoint.dependants); + + return data; +}; + +Manager.prototype.getPackageRepository = function () { + return this._repository; +}; + +// ----------------- + +Manager.prototype._fetch = function (decEndpoint) { + var name = decEndpoint.name; + + // Check if the whole process started to fail fast + if (this._hasFailed) { + return; + } + + // Mark as being fetched + this._fetching[name] = this._fetching[name] || []; + this._fetching[name].push(decEndpoint); + this._nrFetching++; + + // Fetch it from the repository + // Note that the promise is stored in the decomposed endpoint + // because it might be reused if a similar endpoint needs to be resolved + return decEndpoint.promise = this._repository.fetch(decEndpoint) + // When done, call onFetchSuccess + .spread(this._onFetchSuccess.bind(this, decEndpoint)) + // If it fails, call onFetchFailure + .fail(this._onFetchError.bind(this, decEndpoint)); +}; + +Manager.prototype._onFetchSuccess = function (decEndpoint, canonicalDir, pkgMeta, isTargetable) { + var name; + var resolved; + var index; + var incompatibles; + var initialName = decEndpoint.initialName != null ? decEndpoint.initialName : decEndpoint.name; + var fetching = this._fetching[initialName]; + + // Remove from being fetched list + mout.array.remove(fetching, decEndpoint); + this._nrFetching--; + + // Store some needed stuff + decEndpoint.name = name = decEndpoint.name || pkgMeta.name; + decEndpoint.canonicalDir = canonicalDir; + decEndpoint.pkgMeta = pkgMeta; + delete decEndpoint.promise; + + // Add to the resolved list + // If there's an exact equal endpoint, replace instead of adding + // This can happen because the name might not be known from the start + resolved = this._resolved[name] = this._resolved[name] || []; + index = mout.array.findIndex(resolved, function (resolved) { + return resolved.target === decEndpoint.target; + }); + if (index !== -1) { + // Merge dependants + decEndpoint.dependants.push.apply(decEndpoint.dependants, resolved[index.dependants]); + decEndpoint.dependants = this._uniquify(decEndpoint.dependants); + resolved.splice(index, 1); + } + resolved.push(decEndpoint); + + // Parse dependencies + this._parseDependencies(decEndpoint, pkgMeta, 'dependencies'); + + // Check if there are incompatibilities for this package name + // If there are, we need to fetch them + incompatibles = this._incompatibles[name]; + if (incompatibles) { + // Filter already resolved + incompatibles = incompatibles.filter(function (incompatible) { + return !resolved.some(function (decEndpoint) { + return incompatible.target === decEndpoint.target; + }); + }, this); + // Filter being resolved + incompatibles = incompatibles.filter(function (incompatible) { + return !fetching.some(function (decEndpoint) { + return incompatible.target === decEndpoint.target; + }); + }, this); + + incompatibles.forEach(this._fetch.bind(this)); + delete this._incompatibles[name]; + } + + // If the package is not targetable, flag it + // It will be needed later so that untargetable endpoints + // will not get * converted to ~version + if (!isTargetable) { + decEndpoint.untargetable = true; + } + + // If there are no more packages being fetched, + // finish the resolve process by dissecting all resolved packages + if (this._nrFetching <= 0) { + process.nextTick(this._dissect.bind(this)); + } +}; + +Manager.prototype._onFetchError = function (decEndpoint, err) { + var name = decEndpoint.name; + + err.data = err.data || {}; + err.data.endpoint = mout.object.pick(decEndpoint, ['name', 'source', 'target']); + + // Remove from being fetched list + mout.array.remove(this._fetching[name], decEndpoint); + this._nrFetching--; + + // Add to the failed list + this._failed[name] = this._failed[name] || []; + this._failed[name].push(err); + delete decEndpoint.promise; + + // Make the whole process to fail fast + this._failFast(); + + // If there are no more packages being fetched, + // finish the resolve process (with an error) + if (this._nrFetching <= 0) { + process.nextTick(this._dissect.bind(this)); + } +}; + +Manager.prototype._failFast = function () { + if (this._hasFailed) { + return; + } + + this._hasFailed = true; + + // If after some amount of time all pending tasks haven't finished, + // we force the process to end + this._failFastTimeout = setTimeout(function () { + this._nrFetching = Infinity; + this._dissect(); + }.bind(this), 20000); +}; + +Manager.prototype._parseDependencies = function (decEndpoint, pkgMeta, jsonKey) { + var pending = []; + + decEndpoint.dependencies = decEndpoint.dependencies || {}; + + // Parse package dependencies + mout.object.forOwn(pkgMeta[jsonKey], function (value, key) { + var resolved; + var fetching; + var compatible; + var childDecEndpoint = endpointParser.json2decomposed(key, value); + + // Check if a compatible one is already resolved + // If there's one, we don't need to resolve it twice + resolved = this._resolved[key]; + if (resolved) { + // Find if there's one with the exact same target + compatible = mout.array.find(resolved, function (resolved) { + return childDecEndpoint.target === resolved.target; + }, this); + + // If we found one, merge stuff instead of adding as resolved + if (compatible) { + decEndpoint.dependencies[key] = compatible; + compatible.dependants.push(decEndpoint); + compatible.dependants = this._uniquify(compatible.dependants); + + return; + } + + // Find one that is compatible + compatible = mout.array.find(resolved, function (resolved) { + return this._areCompatible(childDecEndpoint, resolved); + }, this); + + // If we found one, add as resolved + // and copy resolved properties from the compatible one + if (compatible) { + decEndpoint.dependencies[key] = compatible; + childDecEndpoint.canonicalDir = compatible.canonicalDir; + childDecEndpoint.pkgMeta = compatible.pkgMeta; + childDecEndpoint.dependencies = compatible.dependencies; + childDecEndpoint.dependants = [decEndpoint]; + this._resolved[key].push(childDecEndpoint); + + return; + } + } + + // Check if a compatible one is being fetched + // If there's one, we wait and reuse it to avoid resolving it twice + fetching = this._fetching[key]; + if (fetching) { + compatible = mout.array.find(fetching, function (fetching) { + return this._areCompatible(childDecEndpoint, fetching); + }, this); + + if (compatible) { + pending.push(compatible.promise); + return; + } + } + + // Mark endpoint as unresolvable if the parent is also unresolvable + childDecEndpoint.unresolvable = !!decEndpoint.unresolvable; + + // Otherwise, just fetch it from the repository + decEndpoint.dependencies[key] = childDecEndpoint; + childDecEndpoint.dependants = [decEndpoint]; + this._fetch(childDecEndpoint); + }, this); + + if (pending.length > 0) { + Q.all(pending) + .then(function () { + this._parseDependencies(decEndpoint, pkgMeta, jsonKey); + }.bind(this)); + } +}; + +Manager.prototype._dissect = function () { + var err; + var componentsDir; + var promise = Q.resolve(); + var suitables = {}; + var that = this; + + // If something failed, reject the whole resolve promise + // with the first error + if (this._hasFailed) { + clearTimeout(this._failFastTimeout); // Cancel fail fast timeout + + err = mout.object.values(this._failed)[0][0]; + this._deferred.reject(err); + return; + } + + // Find a suitable version for each package name + mout.object.forOwn(this._resolved, function (decEndpoints, name) { + var semvers; + var nonSemvers; + + // Filter out non-semver ones + semvers = decEndpoints.filter(function (decEndpoint) { + return !!decEndpoint.pkgMeta.version; + }); + + // Sort semver ones DESC + semvers.sort(function (first, second) { + var result = semver.rcompare(first.pkgMeta.version, second.pkgMeta.version); + + // If they are equal and one of them is a wildcard target, + // give lower priority + if (!result) { + if (first.target === '*') { + return 1; + } + if (second.target === '*') { + return -1; + } + } + + return result; + }); + + // Convert wildcard targets to semver range targets if they are newly + // Note that this can only be made if they can be targetable + // If they are not, the resolver is incapable of handling targets + semvers.forEach(function (decEndpoint) { + if (decEndpoint.newly && decEndpoint.target === '*' && !decEndpoint.untargetable) { + decEndpoint.target = '~' + decEndpoint.pkgMeta.version; + decEndpoint.originalTarget = '*'; + } + }); + + // Filter non-semver ones + nonSemvers = decEndpoints.filter(function (decEndpoint) { + return !decEndpoint.pkgMeta.version; + }); + + promise = promise.then(function () { + return that._electSuitable(name, semvers, nonSemvers) + .then(function (suitable) { + suitables[name] = suitable; + }); + }); + }, this); + + // After a suitable version has been elected for every package + promise + .then(function () { + // Look for extraneous resolutions + mout.object.forOwn(this._resolutions, function (resolution, name) { + if (this._conflicted[name]) { + return; + } + + this._logger.warn('extra-resolution', 'Unnecessary resolution: ' + name + '#' + resolution, { + name: name, + resolution: resolution, + action: 'delete' + }); + }, this); + + // Filter only packages that need to be installed + componentsDir = path.resolve(that._config.cwd, that._config.directory); + this._dissected = mout.object.filter(suitables, function (decEndpoint, name) { + var installedMeta = this._installed[name]; + var dst; + + // Skip linked dependencies + if (decEndpoint.linked) { + return false; + } + + // Skip if source is the same as dest + dst = path.join(componentsDir, name); + if (dst === decEndpoint.canonicalDir) { + return false; + } + + // Analyse a few props + if (installedMeta && + installedMeta._target === decEndpoint.target && + installedMeta._originalSource === decEndpoint.source && + installedMeta._release === decEndpoint.pkgMeta._release + ) { + return this._config.force; + } + + return true; + }, this); + }.bind(this)) + .then(this._deferred.resolve, this._deferred.reject); +}; + +Manager.prototype._electSuitable = function (name, semvers, nonSemvers) { + var suitable; + var resolution; + var unresolvable; + var dataPicks; + var save; + var choices; + var picks = []; + + // If there are both semver and non-semver, there's no way + // to figure out the suitable one + if (semvers.length && nonSemvers.length) { + picks.push.apply(picks, semvers); + picks.push.apply(picks, nonSemvers); + // If there are only non-semver ones, the suitable is elected + // only if there's one + } else if (nonSemvers.length) { + if (nonSemvers.length === 1) { + return Q.resolve(nonSemvers[0]); + } + + picks.push.apply(picks, nonSemvers); + // If there are only semver ones, figure out which one is + // compatible with every requirement + } else { + suitable = mout.array.find(semvers, function (subject) { + return semvers.every(function (decEndpoint) { + return subject === decEndpoint || + semver.satisfies(subject.pkgMeta.version, decEndpoint.target); + }); + }); + + if (suitable) { + return Q.resolve(suitable); + } + + picks.push.apply(picks, semvers); + } + + // At this point, there's a conflict + this._conflicted[name] = true; + + // Prepare data to be sent bellow + // 1 - Sort picks by version/release + picks.sort(function (pick1, pick2) { + var version1 = pick1.pkgMeta.version; + var version2 = pick2.pkgMeta.version; + var comp; + + // If both have versions, compare their versions using semver + if (version1 && version2) { + comp = semver.compare(version1, version2); + if (comp) { + return comp; + } + } else { + // If one of them has a version, it's considered higher + if (version1) { + return 1; + } + if (version2) { + return -1; + } + } + + // Give priority to the one with most dependants + if (pick1.dependants.length > pick2.dependants.length) { + return -1; + } + if (pick1.dependants.length < pick2.dependants.length) { + return 1; + } + + return 0; + }); + + // 2 - Transform data + dataPicks = picks.map(function (pick) { + var dataPick = this.toData(pick); + dataPick.dependants = pick.dependants.map(this.toData, this); + dataPick.dependants.sort(function (dependant1, dependant2) { + return dependant1.endpoint.name.localeCompare(dependant2.endpoint.name); + }); + return dataPick; + }, this); + + // Check if there's a resolution that resolves the conflict + // Note that if one of them is marked as unresolvable, + // the resolution has no effect + resolution = this._resolutions[name]; + unresolvable = mout.object.find(picks, function (pick) { + return pick.unresolvable; + }); + + if (resolution && !unresolvable) { + suitable = -1; + + // Range resolution + if (semver.validRange(resolution)) { + suitable = mout.array.findIndex(picks, function (pick) { + return pick.pkgMeta.version && + semver.satisfies(pick.pkgMeta.version, resolution); + }); + } + + // Exact match resolution (e.g. branches/tags) + if (suitable === -1) { + suitable = mout.array.findIndex(picks, function (pick) { + return pick.target === resolution || + pick.pkgMeta._release === resolution; + }); + } + + if (suitable === -1) { + this._logger.warn('resolution', 'Unsuitable resolution declared for ' + name + ': ' + resolution, { + name: name, + picks: dataPicks, + resolution: resolution + }); + } else { + this._logger.conflict('solved', 'Unable to find suitable version for ' + name, { + name: name, + picks: dataPicks, + resolution: resolution, + suitable: dataPicks[suitable] + }); + return Q.resolve(picks[suitable]); + } + } + + // If force latest is enabled, resolve to the highest semver version + // or whatever non-semver if none available + if (this._forceLatest) { + suitable = picks.length - 1; + + this._logger.conflict('solved', 'Unable to find suitable version for ' + name, { + name: name, + picks: dataPicks, + suitable: dataPicks[suitable], + forced: true + }); + + // Save resolution + this._storeResolution(picks[suitable]); + + return Q.resolve(picks[suitable]); + } + + // If interactive is disabled, error out + if (!this._config.interactive) { + throw createError('Unable to find suitable version for ' + name, 'ECONFLICT', { + name: name, + picks: dataPicks + }); + } + + // At this point the user needs to make a decision + this._logger.conflict('incompatible', 'Unable to find suitable version for ' + name, { + name: name, + picks: dataPicks + }); + + choices = picks.map(function (pick, index) { return index + 1; }); + return Q.nfcall(this._logger.prompt.bind(this._logger), { + type: 'input', + message: 'Answer:', + validate: function (choice) { + choice = Number(mout.string.trim(choice.trim(), '!')); + + if (!choice || choice < 1 || choice > picks.length) { + return 'Invalid choice'; + } + + return true; + } + }) + .then(function (choice) { + var pick; + + // Sanitize choice + choice = choice.trim(); + save = /^!/.test(choice) || /!$/.test(choice); // Save if prefixed or suffixed with ! + choice = Number(mout.string.trim(choice, '!')); + pick = picks[choice - 1]; + + // Save resolution + if (save) { + this._storeResolution(pick); + } + + return pick; + }.bind(this)); +}; + +Manager.prototype._storeResolution = function (pick) { + var resolution; + var name = pick.name; + + if (pick.target === '*') { + resolution = pick.pkgMeta._release || '*'; + } else { + resolution = pick.target; + } + + this._logger.info('resolution', 'Saved ' + name + '#' + resolution + ' as resolution', { + name: name, + resolution: resolution, + action: this._resolutions[name] ? 'edit' : 'add' + }); + this._resolutions[name] = resolution; +}; + +/** + * Checks if some endpoint is compatible with already resolved target. + * + * It is used in two situations: + * * checks if resolved component matches dependency constraint + * * checks if not resolved component matches alredy fetched component + * + * If candidate matches already resolved component, it won't be downloaded. + * + * @param {Endpoint} candidate endpoint + * @param {Endpoint} resolved endpoint + * + * @return {Boolean} + */ +Manager.prototype._areCompatible = function (candidate, resolved) { + var resolvedVersion; + var highestCandidate; + var highestResolved; + var candidateIsRange = semver.validRange(candidate.target); + var resolvedIsRange = semver.validRange(resolved.target); + var candidateIsVersion = semver.valid(candidate.target); + var resolvedIsVersion = semver.valid(resolved.target); + + // Check if targets are equal + if (candidate.target === resolved.target) { + return true; + } + + resolvedVersion = resolved.pkgMeta && resolved.pkgMeta.version; + // If there is no pkgMeta, resolvedVersion is downloading now + // Check based on target requirements + if (!resolvedVersion) { + // If one of the targets is range and other is version, + // check version against the range + if (candidateIsVersion && resolvedIsRange) { + return semver.satisfies(candidate.target, resolved.target); + } + + if (resolvedIsVersion && candidateIsRange) { + return semver.satisfies(resolved.target, candidate.target); + } + + if (resolvedIsVersion && candidateIsVersion) { + return semver.eq(resolved.target, candidate.target); + } + + // If both targets are range, check that both have same + // higher cap + if (resolvedIsRange && candidateIsRange) { + highestCandidate = + this._getCap(semver.toComparators(candidate.target), 'highest'); + highestResolved = + this._getCap(semver.toComparators(resolved.target), 'highest'); + + // This never happens, but you can't be sure without tests + if (!highestResolved.version || !highestCandidate.version) { + return false; + } + + return semver.eq(highestCandidate.version, highestResolved.version) && + highestCandidate.comparator === highestResolved.comparator; + } + return false; + } + + // If target is a version, compare against the resolved version + if (candidateIsVersion) { + return semver.eq(candidate.target, resolvedVersion); + } + + // If target is a range, check if resolved version satisfies it + if (candidateIsRange) { + return semver.satisfies(resolvedVersion, candidate.target); + } + + return false; +}; + +/** + * Gets highest/lowest version from set of comparators. + * + * The only thing that matters for this function is version number. + * Returned comparator is splitted to comparator and version parts. + * + * It is used to receive lowest / highest bound of toComparators result: + * semver.toComparators('~0.1.1') // => [ [ '>=0.1.1-0', '<0.2.0-0' ] ] + * + * Examples: + * + * _getCap([['>=2.1.1-0', '<2.2.0-0'], '<3.2.0'], 'highest') + * // => { comparator: '<', version: '3.2.0' } + * + * _getCap([['>=2.1.1-0', '<2.2.0-0'], '<3.2.0'], 'lowest') + * // => { comparator: '>=', version: '2.1.1-0' } + * + * @param {Array.} comparators + * @param {string} side, 'highest' (default) or 'lowest' + * + * @return {{ comparator: string, version: string }} + */ +Manager.prototype._getCap = function (comparators, side) { + var matches; + var candidate; + var cap = {}; + var compare = side === 'lowest' ? semver.lt : semver.gt; + + comparators.forEach(function (comparator) { + // Get version of this comparator + // If it's an array, call recursively + if (Array.isArray(comparator)) { + candidate = this._getCap(comparator, side); + + // Compare with the current highest version + if (!cap.version || compare(candidate.version, cap.version)) { + cap = candidate; + } + // Otherwise extract the version from the comparator + // using a simple regexp + } else { + matches = comparator.match(/(.*?)(\d+\.\d+\.\d+.*)$/); + if (!matches) { + return; + } + + // Compare with the current highest version + if (!cap.version || compare(matches[2], cap.version)) { + cap.version = matches[2]; + cap.comparator = matches[1]; + } + } + }, this); + + return cap; +}; + +/** + * Filters out unique endpoints, comparing by name and then source. + * + * It leaves last matching endpoint. + * + * Examples: + * + * manager._uniquify([ + * { name: 'foo', source: 'google.com' }, + * { name: 'foo', source: 'facebook.com' } + * ]); + * // => { name: 'foo', source: 'facebook.com' } + * + * @param {Array.} decEndpoints + * @return {Array.} Filtered elements of decEndpoints + * + */ +Manager.prototype._uniquify = function (decEndpoints) { + var length = decEndpoints.length; + + return decEndpoints.filter(function (decEndpoint, index) { + var x; + var current; + + for (x = index + 1; x < length; ++x) { + current = decEndpoints[x]; + + if (current === decEndpoint) { + return false; + } + + // Compare name if both set + // Fallback to compare sources + if (!current.name && !decEndpoint.name) { + if (current.source !== decEndpoint.source) { + continue; + } + } else if (current.name !== decEndpoint.name) { + continue; + } + + // Compare targets if name/sources are equal + if (current.target === decEndpoint.target) { + return false; + } + } + + return true; + }); +}; + +module.exports = Manager; diff --git a/packages/Bower.1.3.11/node_modules/bower/lib/core/PackageRepository.js b/packages/Bower.1.3.11/node_modules/bower/lib/core/PackageRepository.js new file mode 100644 index 0000000..43f0ec5 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/lib/core/PackageRepository.js @@ -0,0 +1,219 @@ +var mout = require('mout'); +var Q = require('q'); +var RegistryClient = require('bower-registry-client'); +var ResolveCache = require('./ResolveCache'); +var resolverFactory = require('./resolverFactory'); +var createError = require('../util/createError'); + +function PackageRepository(config, logger) { + var registryOptions; + + this._config = config; + this._logger = logger; + + // Instantiate the registry + registryOptions = mout.object.deepMixIn({}, this._config); + registryOptions.cache = this._config.storage.registry; + this._registryClient = new RegistryClient(registryOptions, logger); + + // Instantiate the resolve cache + this._resolveCache = new ResolveCache(this._config); +} + +// ----------------- + +PackageRepository.prototype.fetch = function (decEndpoint) { + var logger; + var that = this; + var isTargetable; + var info = { + decEndpoint: decEndpoint + }; + + // Create a new logger that pipes everything to ours that will be + // used to fetch + logger = this._logger.geminate(); + // Intercept all logs, adding additional information + logger.intercept(function (log) { + that._extendLog(log, info); + }); + + // Get the appropriate resolver + return resolverFactory(decEndpoint, this._config, logger, this._registryClient) + // Decide if we retrieve from the cache or not + // Also decide if we validate the cached entry or not + .then(function (resolver) { + info.resolver = resolver; + isTargetable = resolver.constructor.isTargetable; + + if (!resolver.isCacheable()) { + return that._resolve(resolver, logger); + } + + // If force flag is used, bypass cache, but write to cache anyway + if (that._config.force) { + logger.action('resolve', resolver.getSource() + '#' + resolver.getTarget()); + return that._resolve(resolver, logger); + } + + // Note that we use the resolver methods to query the + // cache because transformations/normalisations can occur + return that._resolveCache.retrieve(resolver.getSource(), resolver.getTarget()) + // Decide if we can use the one from the resolve cache + .spread(function (canonicalDir, pkgMeta) { + // If there's no package in the cache + if (!canonicalDir) { + // And the offline flag is passed, error out + if (that._config.offline) { + throw createError('No cached version for ' + resolver.getSource() + '#' + resolver.getTarget(), 'ENOCACHE', { + resolver: resolver + }); + } + + // Otherwise, we have to resolve it + logger.info('not-cached', resolver.getSource() + (resolver.getTarget() ? '#' + resolver.getTarget() : '')); + logger.action('resolve', resolver.getSource() + '#' + resolver.getTarget()); + + return that._resolve(resolver, logger); + } + + info.canonicalDir = canonicalDir; + info.pkgMeta = pkgMeta; + + logger.info('cached', resolver.getSource() + (pkgMeta._release ? '#' + pkgMeta._release : '')); + + // If offline flag is used, use directly the cached one + if (that._config.offline) { + return [canonicalDir, pkgMeta, isTargetable]; + } + + // Otherwise check for new contents + logger.action('validate', (pkgMeta._release ? pkgMeta._release + ' against ': '') + + resolver.getSource() + (resolver.getTarget() ? '#' + resolver.getTarget() : '')); + + return resolver.hasNew(canonicalDir, pkgMeta) + .then(function (hasNew) { + // If there are no new contents, resolve to + // the cached one + if (!hasNew) { + return [canonicalDir, pkgMeta, isTargetable]; + } + + // Otherwise resolve to the newest one + logger.info('new', 'version for ' + resolver.getSource() + '#' + resolver.getTarget()); + logger.action('resolve', resolver.getSource() + '#' + resolver.getTarget()); + + return that._resolve(resolver, logger); + }); + }); + }) + // If something went wrong, also extend the error + .fail(function (err) { + that._extendLog(err, info); + throw err; + }); +}; + +PackageRepository.prototype.versions = function (source) { + // Resolve the source using the factory because the + // source can actually be a registry name + return resolverFactory.getConstructor(source, this._config, this._registryClient) + .spread(function (ConcreteResolver, source) { + // If offline, resolve using the cached versions + if (this._config.offline) { + return this._resolveCache.versions(source); + } + + // Otherwise, fetch remotely + return ConcreteResolver.versions(source); + }.bind(this)); +}; + +PackageRepository.prototype.eliminate = function (pkgMeta) { + return Q.all([ + this._resolveCache.eliminate(pkgMeta), + Q.nfcall(this._registryClient.clearCache.bind(this._registryClient), pkgMeta.name) + ]); +}; + +PackageRepository.prototype.clear = function () { + return Q.all([ + this._resolveCache.clear(), + Q.nfcall(this._registryClient.clearCache.bind(this._registryClient)) + ]); +}; + +PackageRepository.prototype.reset = function () { + this._resolveCache.reset(); + this._registryClient.resetCache(); +}; + +PackageRepository.prototype.list = function () { + return this._resolveCache.list(); +}; + +PackageRepository.prototype.getRegistryClient = function () { + return this._registryClient; +}; + +PackageRepository.prototype.getResolveCache = function () { + return this._resolveCache; +}; + +PackageRepository.clearRuntimeCache = function () { + ResolveCache.clearRuntimeCache(); + RegistryClient.clearRuntimeCache(); + resolverFactory.clearRuntimeCache(); +}; + +// --------------------- + +PackageRepository.prototype._resolve = function (resolver, logger) { + var that = this; + + // Resolve the resolver + return resolver.resolve() + // Store in the cache + .then(function (canonicalDir) { + if (!resolver.isCacheable()) { + return canonicalDir; + } + + return that._resolveCache.store(canonicalDir, resolver.getPkgMeta()); + }) + // Resolve promise with canonical dir and package meta + .then(function (dir) { + var pkgMeta = resolver.getPkgMeta(); + + logger.info('resolved', resolver.getSource() + (pkgMeta._release ? '#' + pkgMeta._release : '')); + return [dir, pkgMeta, resolver.constructor.isTargetable()]; + }); +}; + +PackageRepository.prototype._extendLog = function (log, info) { + log.data = log.data || {}; + + // Store endpoint info in each log + if (info.decEndpoint) { + log.data.endpoint = mout.object.pick(info.decEndpoint, ['name', 'source', 'target']); + } + + // Store the resolver info in each log + if (info.resolver) { + log.data.resolver = { + name: info.resolver.getName(), + source: info.resolver.getSource(), + target: info.resolver.getTarget() + }; + } + + // Store the canonical dir and its meta in each log + if (info.canonicalDir) { + log.data.canonicalDir = info.canonicalDir; + log.data.pkgMeta = info.pkgMeta; + } + + return log; +}; + +module.exports = PackageRepository; diff --git a/packages/Bower.1.3.11/node_modules/bower/lib/core/Project.js b/packages/Bower.1.3.11/node_modules/bower/lib/core/Project.js new file mode 100644 index 0000000..3258608 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/lib/core/Project.js @@ -0,0 +1,829 @@ +var glob = require('glob'); +var path = require('path'); +var fs = require('graceful-fs'); +var Q = require('q'); +var mout = require('mout'); +var rimraf = require('rimraf'); +var endpointParser = require('bower-endpoint-parser'); +var Logger = require('bower-logger'); +var Manager = require('./Manager'); +var defaultConfig = require('../config'); +var semver = require('../util/semver'); +var md5 = require('../util/md5'); +var createError = require('../util/createError'); +var readJson = require('../util/readJson'); +var validLink = require('../util/validLink'); +var scripts = require('./scripts'); + +function Project(config, logger) { + // This is the only architecture component that ensures defaults + // on config and logger + // The reason behind it is that users can likely use this component + // directly if commands do not fulfil their needs + this._config = defaultConfig(config); + this._logger = logger || new Logger(); + this._manager = new Manager(this._config, this._logger); + + this._options = {}; +} + +// ----------------- + +Project.prototype.install = function (decEndpoints, options, config) { + var that = this; + var targets = []; + var resolved = {}; + var incompatibles = []; + + // If already working, error out + if (this._working) { + return Q.reject(createError('Already working', 'EWORKING')); + } + + this._options = options || {}; + this._config = config || {}; + this._working = true; + + // Analyse the project + return this._analyse() + .spread(function (json, tree) { + // It shows an error when issuing `bower install` + // and no bower.json is present in current directory + if(!that._jsonFile && decEndpoints.length === 0 ) { + throw createError('No bower.json present', 'ENOENT'); + } + + // Recover tree + that.walkTree(tree, function (node, name) { + if (node.incompatible) { + incompatibles.push(node); + } else if (node.missing || node.different || that._config.force) { + targets.push(node); + } else { + resolved[name] = node; + } + }, true); + + // Add decomposed endpoints as targets + decEndpoints = decEndpoints || []; + decEndpoints.forEach(function (decEndpoint) { + // Mark as new so that a conflict for this target + // always require a choice + // Also allows for the target to be converted in case + // of being * + decEndpoint.newly = true; + targets.push(decEndpoint); + }); + + // Bootstrap the process + return that._bootstrap(targets, resolved, incompatibles); + }) + .then(function () { + return that._manager.preinstall(that._json); + }) + .then(function () { + return that._manager.install(that._json); + }) + .then(function (installed) { + // Handle save and saveDev options + if (that._options.save || that._options.saveDev) { + // Cycle through the specified endpoints + decEndpoints.forEach(function (decEndpoint) { + var jsonEndpoint; + + jsonEndpoint = endpointParser.decomposed2json(decEndpoint); + + if (that._options.save) { + that._json.dependencies = mout.object.mixIn(that._json.dependencies || {}, jsonEndpoint); + } + + if (that._options.saveDev) { + that._json.devDependencies = mout.object.mixIn(that._json.devDependencies || {}, jsonEndpoint); + } + }); + } + + // Save JSON, might contain changes to dependencies and resolutions + return that.saveJson() + .then(function () { + return that._manager.postinstall(that._json).then(function () { + return installed; + }); + }); + }) + .fin(function () { + that._installed = null; + that._working = false; + }); +}; + +Project.prototype.update = function (names, options) { + var that = this; + var targets = []; + var resolved = {}; + var incompatibles = []; + + // If already working, error out + if (this._working) { + return Q.reject(createError('Already working', 'EWORKING')); + } + + this._options = options || {}; + this._working = true; + + // Analyse the project + return this._analyse() + .spread(function (json, tree, flattened) { + // If no names were specified, update every package + if (!names) { + // Mark each root dependency as targets + that.walkTree(tree, function (node) { + // We don't know the real source of linked packages + // Instead we read its dependencies + if (node.linked) { + targets.push.apply(targets, mout.object.values(node.dependencies)); + } else { + targets.push(node); + } + + return false; + }, true); + // Otherwise, selectively update the specified ones + } else { + // Error out if some of the specified names + // are not installed + names.forEach(function (name) { + if (!flattened[name]) { + throw createError('Package ' + name + ' is not installed', 'ENOTINS', { + name: name + }); + } + }); + + // Add packages whose names are specified to be updated + that.walkTree(tree, function (node, name) { + if (names.indexOf(name) !== -1) { + // We don't know the real source of linked packages + // Instead we read its dependencies + if (node.linked) { + targets.push.apply(targets, mout.object.values(node.dependencies)); + } else { + targets.push(node); + } + + return false; + } + }, true); + + // Recover tree + that.walkTree(tree, function (node, name) { + if (node.missing || node.different) { + targets.push(node); + } else if (node.incompatible) { + incompatibles.push(node); + } else { + resolved[name] = node; + } + }, true); + } + + // Bootstrap the process + return that._bootstrap(targets, resolved, incompatibles) + .then(function () { + return that._manager.preinstall(that._json); + }) + .then(function () { + return that._manager.install(that._json); + }) + .then(function (installed) { + // Save JSON, might contain changes to resolutions + return that.saveJson() + .then(function () { + return that._manager.postinstall(that._json).then(function () { + return installed; + }); + }); + }); + }) + .fin(function () { + that._installed = null; + that._working = false; + }); +}; + +Project.prototype.uninstall = function (names, options) { + var that = this; + var packages = {}; + + // If already working, error out + if (this._working) { + return Q.reject(createError('Already working', 'EWORKING')); + } + + this._options = options || {}; + this._working = true; + + // Analyse the project + return this._analyse() + // Fill in the packages to be uninstalled + .spread(function (json, tree, flattened) { + var promise = Q.resolve(); + + names.forEach(function (name) { + var decEndpoint = flattened[name]; + + // Check if it is not installed + if (!decEndpoint || decEndpoint.missing) { + packages[name] = null; + return; + } + + promise = promise + .then(function () { + var message; + var data; + var dependantsNames; + var dependants = []; + + // Walk the down the tree, gathering dependants of the package + that.walkTree(tree, function (node, nodeName) { + if (name === nodeName) { + dependants.push.apply(dependants, mout.object.values(node.dependants)); + } + }, true); + + // Remove duplicates + dependants = mout.array.unique(dependants); + + // Note that the root is filtered from the dependants + // as well as other dependants marked to be uninstalled + dependants = dependants.filter(function (dependant) { + return !dependant.root && names.indexOf(dependant.name) === -1; + }); + + // If the package has no dependants or the force config is enabled, + // mark it to be removed + if (!dependants.length || that._config.force) { + packages[name] = decEndpoint.canonicalDir; + return; + } + + // Otherwise we need to figure it out if the user really wants to remove it, + // even with dependants + // As such we need to prompt the user with a meaningful message + dependantsNames = dependants.map(function (dep) { return dep.name; }); + dependantsNames.sort(function (name1, name2) { return name1.localeCompare(name2); }); + dependantsNames = mout.array.unique(dependantsNames); + dependants = dependants.map(function (dependant) { return that._manager.toData(dependant); }); + message = dependantsNames.join(', ') + ' depends on ' + decEndpoint.name; + data = { + name: decEndpoint.name, + dependants: dependants + }; + + // If interactive is disabled, error out + if (!that._config.interactive) { + throw createError(message, 'ECONFLICT', { + data: data + }); + } + + that._logger.conflict('mutual', message, data); + + // Prompt the user + return Q.nfcall(that._logger.prompt.bind(that._logger), { + type: 'confirm', + message: 'Continue anyway?', + default: true + }) + .then(function (confirmed) { + // If the user decided to skip it, remove from the array so that it won't + // influence subsequent dependants + if (!confirmed) { + mout.array.remove(names, name); + } else { + packages[name] = decEndpoint.canonicalDir; + } + }); + }); + }); + + return promise; + }) + // Remove packages + .then(function () { + return that._removePackages(packages); + }) + .fin(function () { + that._installed = null; + that._working = false; + }); +}; + +Project.prototype.getTree = function (options) { + this._options = options || {}; + + return this._analyse() + .spread(function (json, tree, flattened) { + var extraneous = []; + var additionalKeys = ['missing', 'extraneous', 'different', 'linked']; + + // Convert tree + tree = this._manager.toData(tree, additionalKeys); + + // Mark incompatibles + this.walkTree(tree, function (node) { + var version; + var target = node.endpoint.target; + + if (node.pkgMeta && semver.validRange(target)) { + version = node.pkgMeta.version; + + // Ignore if target is '*' and resolved to a non-semver release + if (!version && target === '*') { + return; + } + + if (!version || !semver.satisfies(version, target)) { + node.incompatible = true; + } + } + }, true); + + // Convert extraneous + mout.object.forOwn(flattened, function (pkg) { + if (pkg.extraneous) { + extraneous.push(this._manager.toData(pkg, additionalKeys)); + } + }, this); + + // Convert flattened + flattened = mout.object.map(flattened, function (node) { + return this._manager.toData(node, additionalKeys); + }, this); + + return [tree, flattened, extraneous]; + }.bind(this)); +}; + +Project.prototype.walkTree = function (node, fn, onlyOnce) { + var result; + var dependencies; + var queue = mout.object.values(node.dependencies); + + if (onlyOnce === true) { + onlyOnce = []; + } + + while (queue.length) { + node = queue.shift(); + result = fn(node, node.endpoint ? node.endpoint.name : node.name); + + // Abort traversal if result is false + if (result === false) { + continue; + } + + // Add dependencies to the queue + dependencies = mout.object.values(node.dependencies); + + // If onlyOnce was true, do not add if already traversed + if (onlyOnce) { + dependencies = dependencies.filter(function (dependency) { + return !mout.array.find(onlyOnce, function (stacked) { + if (dependency.endpoint) { + return mout.object.equals(dependency.endpoint, stacked.endpoint); + } + + return dependency.name === stacked.name && + dependency.source === stacked.source && + dependency.target === stacked.target; + }); + }); + + onlyOnce.push.apply(onlyOnce, dependencies); + } + + queue.unshift.apply(queue, dependencies); + } +}; + +Project.prototype.saveJson = function (forceCreate) { + var file; + var jsonStr = JSON.stringify(this._json, null, ' ') + '\n'; + var jsonHash = md5(jsonStr); + + // Save only if there's something different + if (jsonHash === this._jsonHash) { + return Q.resolve(); + } + + // Error out if the json file does not exist, unless force create + // is true + if (!this._jsonFile && !forceCreate) { + this._logger.warn('no-json', 'No bower.json file to save to, use bower init to create one'); + return Q.resolve(); + } + + file = this._jsonFile || path.join(this._config.cwd, 'bower.json'); + return Q.nfcall(fs.writeFile, file, jsonStr) + .then(function () { + this._jsonHash = jsonHash; + this._jsonFile = file; + return this._json; + }.bind(this)); +}; + +Project.prototype.hasJson = function () { + return this._readJson() + .then(function (json) { + return json ? this._jsonFile : false; + }.bind(this)); +}; + +Project.prototype.getJson = function () { + return this._readJson(); +}; + +Project.prototype.getManager = function () { + return this._manager; +}; + +Project.prototype.getPackageRepository = function () { + return this._manager.getPackageRepository(); +}; + +// ----------------- + +Project.prototype._analyse = function () { + return Q.all([ + this._readJson(), + this._readInstalled(), + this._readLinks() + ]) + .spread(function (json, installed, links) { + var root; + var jsonCopy = mout.lang.deepClone(json); + + root = { + name: json.name, + source: this._config.cwd, + target: json.version || '*', + pkgMeta: jsonCopy, + canonicalDir: this._config.cwd, + root: true + }; + + mout.object.mixIn(installed, links); + + // Mix direct extraneous as dependencies + // (dependencies installed without --save/--save-dev) + jsonCopy.dependencies = jsonCopy.dependencies || {}; + jsonCopy.devDependencies = jsonCopy.devDependencies || {}; + mout.object.forOwn(installed, function (decEndpoint, key) { + var pkgMeta = decEndpoint.pkgMeta; + var isSaved = jsonCopy.dependencies[key] || jsonCopy.devDependencies[key]; + + // The _direct propery is saved by the manager when .newly is specified + // It may happen pkgMeta is undefined if package is uninstalled + if (!isSaved && pkgMeta && pkgMeta._direct) { + decEndpoint.extraneous = true; + + if (decEndpoint.linked) { + jsonCopy.dependencies[key] = pkgMeta.version || '*'; + } else { + jsonCopy.dependencies[key] = (pkgMeta._originalSource || pkgMeta._source) + '#' + pkgMeta._target; + } + } + }); + + // Restore the original dependencies cross-references, + // that is, the parent-child relationships + this._restoreNode(root, installed, 'dependencies'); + // Do the same for the dev dependencies + if (!this._options.production) { + this._restoreNode(root, installed, 'devDependencies'); + } + + // Restore the rest of the extraneous (not installed directly) + mout.object.forOwn(installed, function (decEndpoint, name) { + if (!decEndpoint.dependants) { + decEndpoint.extraneous = true; + this._restoreNode(decEndpoint, installed, 'dependencies'); + // Note that it has no dependants, just dependencies! + root.dependencies[name] = decEndpoint; + } + }, this); + + // Remove root from the flattened tree + delete installed[json.name]; + + return [json, root, installed]; + }.bind(this)); +}; + +Project.prototype._bootstrap = function (targets, resolved, incompatibles) { + var installed = mout.object.map(this._installed, function (decEndpoint) { + return decEndpoint.pkgMeta; + }); + + this._json.resolutions = this._json.resolutions || {}; + + // Configure the manager and kick in the resolve process + return this._manager + .configure({ + targets: targets, + resolved: resolved, + incompatibles: incompatibles, + resolutions: this._json.resolutions, + installed: installed, + forceLatest: this._options.forceLatest + }) + .resolve() + .then(function () { + // If the resolutions is empty, delete key + if (!mout.object.size(this._json.resolutions)) { + delete this._json.resolutions; + } + }.bind(this)); +}; + +Project.prototype._readJson = function () { + var that = this; + + if (this._json) { + return Q.resolve(this._json); + } + + // Read local json + return this._json = readJson(this._config.cwd, { + assume: { name: path.basename(this._config.cwd) || 'root' } + }) + .spread(function (json, deprecated, assumed) { + var jsonStr; + + if (deprecated) { + that._logger.warn('deprecated', 'You are using the deprecated ' + deprecated + ' file'); + } + + if (!assumed) { + that._jsonFile = path.join(that._config.cwd, deprecated ? deprecated : 'bower.json'); + } + + jsonStr = JSON.stringify(json, null, ' ') + '\n'; + that._jsonHash = md5(jsonStr); + return that._json = json; + }); +}; + +Project.prototype._readInstalled = function () { + var componentsDir; + var that = this; + + if (this._installed) { + return Q.resolve(this._installed); + } + + // Gather all folders that are actual packages by + // looking for the package metadata file + componentsDir = path.join(this._config.cwd, this._config.directory); + return this._installed = Q.nfcall(glob, '*/.bower.json', { + cwd: componentsDir, + dot: true + }) + .then(function (filenames) { + var promises; + var decEndpoints = {}; + + // Foreach bower.json found + promises = filenames.map(function (filename) { + var name = path.dirname(filename); + var metaFile = path.join(componentsDir, filename); + + // Read package metadata + return readJson(metaFile) + .spread(function (pkgMeta) { + decEndpoints[name] = { + name: name, + source: pkgMeta._originalSource || pkgMeta._source, + target: pkgMeta._target, + canonicalDir: path.dirname(metaFile), + pkgMeta: pkgMeta + }; + }); + }); + + // Wait until all files have been read + // and resolve with the decomposed endpoints + return Q.all(promises) + .then(function () { + return that._installed = decEndpoints; + }); + }); +}; + +Project.prototype._readLinks = function () { + var componentsDir; + var that = this; + + // Read directory, looking for links + componentsDir = path.join(this._config.cwd, this._config.directory); + return Q.nfcall(fs.readdir, componentsDir) + .then(function (filenames) { + var promises; + var decEndpoints = {}; + + promises = filenames.map(function (filename) { + var dir = path.join(componentsDir, filename); + + // Filter only those that are valid links + return validLink(dir) + .spread(function (valid, err) { + var name; + + if (!valid) { + if (err) { + that._logger.debug('read-link', 'Link ' + dir + ' is invalid', { + filename: dir, + error: err + }); + } + return; + } + + // Skip links to files (see #783) + if (!valid.isDirectory()) { + return; + } + + name = path.basename(dir); + return readJson(dir, { + assume: { name: name } + }) + .spread(function (json, deprecated) { + if (deprecated) { + that._logger.warn('deprecated', 'Package ' + name + ' is using the deprecated ' + deprecated); + } + + json._direct = true; // Mark as a direct dep of root + decEndpoints[name] = { + name: name, + source: dir, + target: '*', + canonicalDir: dir, + pkgMeta: json, + linked: true + }; + }); + }); + }); + + // Wait until all links have been read + // and resolve with the decomposed endpoints + return Q.all(promises) + .then(function () { + return decEndpoints; + }); + // Ignore if folder does not exist + }, function (err) { + if (err.code !== 'ENOENT') { + throw err; + } + + return {}; + }); +}; + +Project.prototype._removePackages = function (packages) { + var that = this; + var promises = []; + + return scripts.preuninstall(that._config, that._logger, packages, that._installed, that._json) + .then(function () { + + mout.object.forOwn(packages, function (dir, name) { + var promise; + + // Delete directory + if (!dir) { + promise = Q.resolve(); + that._logger.warn('not-installed', '\'' + name + '\'' + ' cannot be uninstalled as it is not currently installed', { + name: name + }); + } else { + promise = Q.nfcall(rimraf, dir); + that._logger.action('uninstall', name, { + name: name, + dir: dir + }); + } + + // Remove from json only if successfully deleted + if (that._options.save && that._json.dependencies) { + promise = promise + .then(function () { + delete that._json.dependencies[name]; + }); + } + + if (that._options.saveDev && that._json.devDependencies) { + promise = promise + .then(function () { + delete that._json.devDependencies[name]; + }); + } + + promises.push(promise); + }); + + return Q.all(promises); + + }) + .then(function () { + return that.saveJson(); + }) + // Resolve with removed packages + .then(function () { + return mout.object.filter(packages, function (dir) { + return !!dir; + }); + }); +}; + +Project.prototype._restoreNode = function (node, flattened, jsonKey, processed) { + var deps; + + // Do not restore if the node is missing + if (node.missing) { + return; + } + + node.dependencies = node.dependencies || {}; + node.dependants = node.dependants || {}; + processed = processed || {}; + + // Only process deps that are not yet processed + deps = mout.object.filter(node.pkgMeta[jsonKey], function (value, key) { + return !processed[node.name + ':' + key]; + }); + + mout.object.forOwn(deps, function (value, key) { + var local = flattened[key]; + var json = endpointParser.json2decomposed(key, value); + var restored; + var compatible; + var originalSource; + + // Check if the dependency is not installed + if (!local) { + flattened[key] = restored = json; + restored.missing = true; + // Even if it is installed, check if it's compatible + // Note that linked packages are interpreted as compatible + // This might change in the future: #673 + } else { + compatible = local.linked || (!local.missing && json.target === local.pkgMeta._target); + + if (!compatible) { + restored = json; + + if (!local.missing) { + restored.pkgMeta = local.pkgMeta; + restored.canonicalDir = local.canonicalDir; + restored.incompatible = true; + } else { + restored.missing = true; + } + } else { + restored = local; + mout.object.mixIn(local, json); + } + + // Check if source changed, marking as different if it did + // We only do this for direct root dependencies that are compatible + if (node.root && compatible) { + originalSource = mout.object.get(local, 'pkgMeta._originalSource'); + if (originalSource && originalSource !== json.source) { + restored.different = true; + } + } + } + + // Cross reference + node.dependencies[key] = restored; + processed[node.name + ':' + key] = true; + + restored.dependants = restored.dependants || {}; + restored.dependants[node.name] = mout.object.mixIn({}, node); // We need to clone due to shared objects in the manager! + + // Call restore for this dependency + this._restoreNode(restored, flattened, 'dependencies', processed); + + // Do the same for the incompatible local package + if (local && restored !== local) { + this._restoreNode(local, flattened, 'dependencies', processed); + } + }, this); +}; + +module.exports = Project; diff --git a/packages/Bower.1.3.11/node_modules/bower/lib/core/ResolveCache.js b/packages/Bower.1.3.11/node_modules/bower/lib/core/ResolveCache.js new file mode 100644 index 0000000..1103a90 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/lib/core/ResolveCache.js @@ -0,0 +1,406 @@ +var fs = require('graceful-fs'); +var path = require('path'); +var mout = require('mout'); +var Q = require('q'); +var mkdirp = require('mkdirp'); +var rimraf = require('rimraf'); +var LRU = require('lru-cache'); +var lockFile = require('lockfile'); +var semver = require('../util/semver'); +var readJson = require('../util/readJson'); +var copy = require('../util/copy'); +var md5 = require('../util/md5'); + +function ResolveCache(config) { + // TODO: Make some config entries, such as: + // - Max MB + // - Max versions per source + // - Max MB per source + // - etc.. + this._config = config; + this._dir = this._config.storage.packages; + this._lockDir = this._config.storage.packages; + + mkdirp.sync(this._lockDir); + + // Cache is stored/retrieved statically to ensure singularity + // among instances + this._cache = this.constructor._cache.get(this._dir); + if (!this._cache) { + this._cache = new LRU({ + max: 100, + maxAge: 60 * 5 * 1000 // 5 minutes + }); + this.constructor._cache.set(this._dir, this._cache); + } + + // Ensure dir is created + mkdirp.sync(this._dir); +} + +// ----------------- + +ResolveCache.prototype.retrieve = function (source, target) { + var sourceId = md5(source); + var dir = path.join(this._dir, sourceId); + var that = this; + + target = target || '*'; + + return this._getVersions(sourceId) + .spread(function (versions) { + var suitable; + + // If target is a semver, find a suitable version + if (semver.validRange(target)) { + suitable = semver.maxSatisfying(versions, target, true); + + if (suitable) { + return suitable; + } + } + + // If target is '*' check if there's a cached '_wildcard' + if (target === '*') { + return mout.array.find(versions, function (version) { + return version === '_wildcard'; + }); + } + + // Otherwise check if there's an exact match + return mout.array.find(versions, function (version) { + return version === target; + }); + }) + .then(function (version) { + var canonicalDir; + + if (!version) { + return []; + } + + // Resolve with canonical dir and package meta + canonicalDir = path.join(dir, encodeURIComponent(version)); + return that._readPkgMeta(canonicalDir) + .then(function (pkgMeta) { + return [canonicalDir, pkgMeta]; + }, function () { + // If there was an error, invalidate the in-memory cache, + // delete the cached package and try again + that._cache.del(sourceId); + + return Q.nfcall(rimraf, canonicalDir) + .then(function () { + return that.retrieve(source, target); + }); + }); + }); +}; + +ResolveCache.prototype.store = function (canonicalDir, pkgMeta) { + var sourceId; + var release; + var dir; + var pkgLock; + var promise; + var that = this; + + promise = pkgMeta ? Q.resolve(pkgMeta) : this._readPkgMeta(canonicalDir); + + return promise + .then(function (pkgMeta) { + sourceId = md5(pkgMeta._source); + release = that._getPkgRelease(pkgMeta); + dir = path.join(that._dir, sourceId, release); + pkgLock = path.join(that._lockDir, sourceId + '-' + release + '.lock'); + + // Check if destination directory exists to prevent issuing lock at all times + return Q.nfcall(fs.stat, dir) + .fail(function (err) { + var lockParams = { wait: 250, retries: 25, stale: 60000 }; + return Q.nfcall(lockFile.lock, pkgLock, lockParams).then(function () { + // Ensure other process didn't start copying files before lock was created + return Q.nfcall(fs.stat, dir) + .fail(function (err) { + // If stat fails, it is expected to return ENOENT + if (err.code !== 'ENOENT') { + throw err; + } + + // Create missing directory and copy files there + return Q.nfcall(mkdirp, path.dirname(dir)).then(function () { + return Q.nfcall(fs.rename, canonicalDir, dir) + .fail(function (err) { + // If error is EXDEV it means that we are trying to rename + // across different drives, so we copy and remove it instead + if (err.code !== 'EXDEV') { + throw err; + } + + return copy.copyDir(canonicalDir, dir); + }); + }); + }); + }).finally(function () { + lockFile.unlockSync(pkgLock); + }); + }).finally(function () { + // Ensure no tmp dir is left on disk. + return Q.nfcall(rimraf, canonicalDir); + }); + }) + .then(function () { + var versions = that._cache.get(sourceId); + + // Add it to the in memory cache + // and sort the versions afterwards + if (versions && versions.indexOf(release) === -1) { + versions.push(release); + that._sortVersions(versions); + } + + // Resolve with the final location + return dir; + }); +}; + +ResolveCache.prototype.eliminate = function (pkgMeta) { + var sourceId = md5(pkgMeta._source); + var release = this._getPkgRelease(pkgMeta); + var dir = path.join(this._dir, sourceId, release); + var that = this; + + return Q.nfcall(rimraf, dir) + .then(function () { + var versions = that._cache.get(sourceId) || []; + mout.array.remove(versions, release); + + // If this was the last package in the cache, + // delete the parent folder (source) + // For extra security, check against the file system + // if this was really the last package + if (!versions.length) { + that._cache.del(sourceId); + + return that._getVersions(sourceId) + .spread(function (versions) { + if (!versions.length) { + // Do not keep in-memory cache if it's completely + // empty + that._cache.del(sourceId); + + return Q.nfcall(rimraf, path.dirname(dir)); + } + }); + } + }); +}; + +ResolveCache.prototype.clear = function () { + return Q.nfcall(rimraf, this._dir) + .then(function () { + return Q.nfcall(fs.mkdir, this._dir); + }.bind(this)) + .then(function () { + this._cache.reset(); + }.bind(this)); +}; + +ResolveCache.prototype.reset = function () { + this._cache.reset(); + return this; +}; + +ResolveCache.prototype.versions = function (source) { + var sourceId = md5(source); + + return this._getVersions(sourceId) + .spread(function (versions) { + return versions.filter(function (version) { + return semver.valid(version); + }); + }); +}; + +ResolveCache.prototype.list = function () { + var promises; + var dirs = []; + var that = this; + + // Get the list of directories + return Q.nfcall(fs.readdir, this._dir) + .then(function (sourceIds) { + promises = sourceIds.map(function (sourceId) { + return Q.nfcall(fs.readdir, path.join(that._dir, sourceId)) + .then(function (versions) { + versions.forEach(function (version) { + var dir = path.join(that._dir, sourceId, version); + dirs.push(dir); + }); + }, function (err) { + // Ignore lurking files, e.g.: .DS_Store if the user + // has navigated throughout the cache + if (err.code === 'ENOTDIR' && err.path) { + return Q.nfcall(rimraf, err.path); + } + + throw err; + }); + }); + + return Q.all(promises); + }) + // Read every package meta + .then(function () { + promises = dirs.map(function (dir) { + return that._readPkgMeta(dir) + .then(function (pkgMeta) { + return { + canonicalDir: dir, + pkgMeta: pkgMeta + }; + }, function () { + // If it fails to read, invalidate the in memory + // cache for the source and delete the entry directory + var sourceId = path.basename(path.dirname(dir)); + that._cache.del(sourceId); + + return Q.nfcall(rimraf, dir); + }); + }); + + return Q.all(promises); + }) + // Sort by name ASC & release ASC + .then(function (entries) { + // Ignore falsy entries due to errors reading + // package metas + entries = entries.filter(function (entry) { + return !!entry; + }); + + return entries.sort(function (entry1, entry2) { + var pkgMeta1 = entry1.pkgMeta; + var pkgMeta2 = entry2.pkgMeta; + var comp = pkgMeta1.name.localeCompare(pkgMeta2.name); + + // Sort by name + if (comp) { + return comp; + } + + // Sort by version + if (pkgMeta1.version && pkgMeta2.version) { + return semver.compare(pkgMeta1.version, pkgMeta2.version); + } + if (pkgMeta1.version) { + return -1; + } + if (pkgMeta2.version) { + return 1; + } + + // Sort by target + return pkgMeta1._target.localeCompare(pkgMeta2._target); + }); + }); +}; + +// ------------------------ + +ResolveCache.clearRuntimeCache = function () { + // Note that _cache refers to the static _cache variable + // that holds other caches per dir! + // Do not confuse it with the instance cache + + // Clear cache of each directory + this._cache.forEach(function (cache) { + cache.reset(); + }); + + // Clear root cache + this._cache.reset(); +}; + +// ------------------------ + +ResolveCache.prototype._getPkgRelease = function (pkgMeta) { + var release = pkgMeta.version || (pkgMeta._target === '*' ? '_wildcard' : pkgMeta._target); + + // Encode some dangerous chars such as / and \ + release = encodeURIComponent(release); + + return release; +}; + +ResolveCache.prototype._readPkgMeta = function (dir) { + var filename = path.join(dir, '.bower.json'); + + return readJson(filename) + .spread(function (json) { + return json; + }); +}; + +ResolveCache.prototype._getVersions = function (sourceId) { + var dir; + var versions = this._cache.get(sourceId); + var that = this; + + if (versions) { + return Q.resolve([versions, true]); + } + + dir = path.join(this._dir, sourceId); + return Q.nfcall(fs.readdir, dir) + .then(function (versions) { + // Sort and cache in memory + that._sortVersions(versions); + versions = versions.map(decodeURIComponent); + that._cache.set(sourceId, versions); + return [versions, false]; + }, function (err) { + // If the directory does not exists, resolve + // as an empty array + if (err.code === 'ENOENT') { + versions = []; + that._cache.set(sourceId, versions); + return [versions, false]; + } + + throw err; + }); +}; + +ResolveCache.prototype._sortVersions = function (versions) { + // Sort DESC + versions.sort(function (version1, version2) { + var validSemver1 = semver.valid(version1); + var validSemver2 = semver.valid(version2); + + // If both are semvers, compare them + if (validSemver1 && validSemver2) { + return semver.rcompare(version1, version2); + } + + // If one of them are semvers, give higher priority + if (validSemver1) { + return -1; + } + if (validSemver2) { + return 1; + } + + // Otherwise they are considered equal + return 0; + }); +}; + +// ------------------------ + +ResolveCache._cache = new LRU({ + max: 5, + maxAge: 60 * 30 * 1000 // 30 minutes +}); + +module.exports = ResolveCache; diff --git a/packages/Bower.1.3.11/node_modules/bower/lib/core/resolverFactory.js b/packages/Bower.1.3.11/node_modules/bower/lib/core/resolverFactory.js new file mode 100644 index 0000000..2e01b01 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/lib/core/resolverFactory.js @@ -0,0 +1,174 @@ +var Q = require('q'); +var fs = require('graceful-fs'); +var path = require('path'); +var mout = require('mout'); +var resolvers = require('./resolvers'); +var createError = require('../util/createError'); + +function createInstance(decEndpoint, config, logger, registryClient) { + return getConstructor(decEndpoint.source, config, registryClient) + .spread(function (ConcreteResolver, source, fromRegistry) { + var decEndpointCopy = mout.object.pick(decEndpoint, ['name', 'target']); + + decEndpointCopy.source = source; + + // Signal if it was fetched from the registry + if (fromRegistry) { + decEndpoint.registry = true; + // If no name was specified, assume the name from the registry + if (!decEndpointCopy.name) { + decEndpointCopy.name = decEndpoint.name = decEndpoint.source; + } + } + + return new ConcreteResolver(decEndpointCopy, config, logger); + }); +} + +function getConstructor(source, config, registryClient) { + var absolutePath, + promise; + + // Git case: git git+ssh, git+http, git+https + // .git at the end (probably ssh shorthand) + // git@ at the start + if (/^git(\+(ssh|https?))?:\/\//i.test(source) || /\.git\/?$/i.test(source) || /^git@/i.test(source)) { + source = source.replace(/^git\+/, ''); + return Q.fcall(function () { + + // If it's a GitHub repository, return the specialized resolver + if (resolvers.GitHub.getOrgRepoPair(source)) { + return [resolvers.GitHub, source]; + } + + return [resolvers.GitRemote, source]; + }); + } + + // SVN case: svn, svn+ssh, svn+http, svn+https, svn+file + if (/^svn(\+(ssh|https?|file))?:\/\//i.test(source)) { + return Q.fcall(function () { + return [resolvers.Svn, source]; + }); + } + + // URL case + if (/^https?:\/\//i.exec(source)) { + return Q.fcall(function () { + return [resolvers.Url, source]; + }); + } + + // Below we try a series of async tests to guess the type of resolver to use + // If a step was unable to guess the resolver, it throws an error + // If a step was able to guess the resolver, it resolves with a function + // That function returns a promise that will resolve with the concrete type + + // If source is ./ or ../ or an absolute path + absolutePath = path.resolve(config.cwd, source); + + if (/^\.\.?[\/\\]/.test(source) || /^~\//.test(source) || path.normalize(source).replace(/[\/\\]+$/, '') === absolutePath) { + promise = Q.nfcall(fs.stat, path.join(absolutePath, '.git')) + .then(function (stats) { + if (stats.isDirectory()) { + return function () { + return Q.resolve([resolvers.GitFs, absolutePath]); + }; + } + + throw new Error('Not a Git repository'); + }) + // If not, check if source is a valid Subversion repository + .fail(function () { + return Q.nfcall(fs.stat, path.join(absolutePath, '.svn')) + .then(function (stats) { + if (stats.isDirectory()) { + return function () { + return Q.resolve([resolvers.Svn, absolutePath]); + }; + } + + throw new Error('Not a Subversion repository'); + }); + }) + // If not, check if source is a valid file/folder + .fail(function () { + return Q.nfcall(fs.stat, absolutePath) + .then(function () { + return function () { + return Q.resolve([resolvers.Fs, absolutePath]); + }; + }); + }); + } else { + promise = Q.reject(new Error('Not an absolute or relative file')); + } + + return promise + // Check if is a shorthand and expand it + .fail(function (err) { + var parts; + + // Skip ssh and/or URL with auth + if (/[:@]/.test(source)) { + throw err; + } + + // Ensure exactly only one "/" + parts = source.split('/'); + if (parts.length === 2) { + source = mout.string.interpolate(config.shorthandResolver, { + shorthand: source, + owner: parts[0], + package: parts[1] + }); + + return function () { + return getConstructor(source, config, registryClient); + }; + } + + throw err; + }) + // As last resort, we try the registry + .fail(function (err) { + if (!registryClient) { + throw err; + } + + return function () { + return Q.nfcall(registryClient.lookup.bind(registryClient), source) + .then(function (entry) { + if (!entry) { + throw createError('Package ' + source + ' not found', 'ENOTFOUND'); + } + + // TODO: Handle entry.type.. for now it's only 'alias' + // When we got published packages, this needs to be adjusted + source = entry.url; + + return getConstructor(source, config, registryClient) + .spread(function (ConcreteResolver, source) { + return [ConcreteResolver, source, true]; + }); + }); + }; + }) + // If we got the function, simply call and return + .then(function (func) { + return func(); + // Finally throw a meaningful error + }, function () { + throw createError('Could not find appropriate resolver for ' + source, 'ENORESOLVER'); + }); +} + +function clearRuntimeCache() { + mout.object.values(resolvers).forEach(function (ConcreteResolver) { + ConcreteResolver.clearRuntimeCache(); + }); +} + +module.exports = createInstance; +module.exports.getConstructor = getConstructor; +module.exports.clearRuntimeCache = clearRuntimeCache; diff --git a/packages/Bower.1.3.11/node_modules/bower/lib/core/resolvers/FsResolver.js b/packages/Bower.1.3.11/node_modules/bower/lib/core/resolvers/FsResolver.js new file mode 100644 index 0000000..92c916a --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/lib/core/resolvers/FsResolver.js @@ -0,0 +1,143 @@ +var util = require('util'); +var fs = require('graceful-fs'); +var path = require('path'); +var mout = require('mout'); +var Q = require('q'); +var junk = require('junk'); +var Resolver = require('./Resolver'); +var copy = require('../../util/copy'); +var extract = require('../../util/extract'); +var createError = require('../../util/createError'); + +function FsResolver(decEndpoint, config, logger) { + Resolver.call(this, decEndpoint, config, logger); + + // Ensure absolute path + this._source = path.resolve(this._config.cwd, this._source); + + // If target was specified, simply reject the promise + if (this._target !== '*') { + throw createError('File system sources can\'t resolve targets', 'ENORESTARGET'); + } + + // If the name was guessed + if (this._guessedName) { + // Remove extension + this._name = this._name.substr(0, this._name.length - path.extname(this._name).length); + } +} + +util.inherits(FsResolver, Resolver); +mout.object.mixIn(FsResolver, Resolver); + +// ----------------- + +FsResolver.isTargetable = function () { + return false; +}; + +// TODO: Should we store latest mtimes in the resolution and compare? +// This would be beneficial when copying big files/folders + +// TODO: There's room for improvement by using streams if the source +// is an archive file, by piping read stream to the zip extractor +// This will likely increase the complexity of code but might worth it +FsResolver.prototype._resolve = function () { + return this._copy() + .then(this._extract.bind(this)) + .then(this._rename.bind(this)); +}; + +// ----------------- + +FsResolver.prototype._copy = function () { + var that = this; + + return Q.nfcall(fs.stat, this._source) + .then(function (stat) { + var dst; + var copyOpts; + var promise; + + that._sourceStat = stat; + copyOpts = { mode: stat.mode }; + + // If it's a folder + if (stat.isDirectory()) { + dst = that._tempDir; + + // Read the bower.json inside the folder, so that we + // copy only the necessary files if it has ignore specified + promise = that._readJson(that._source) + .then(function (json) { + copyOpts.ignore = json.ignore; + return copy.copyDir(that._source, dst, copyOpts); + }) + .then(function () { + // Resolve to null because it's a dir + return; + }); + // Else it's a file + } else { + dst = path.join(that._tempDir, path.basename(that._source)); + promise = copy.copyFile(that._source, dst, copyOpts) + .then(function () { + return dst; + }); + } + + that._logger.action('copy', that._source, { + src: that._source, + dst: dst + }); + + return promise; + }); +}; + +FsResolver.prototype._extract = function (file) { + if (!file || !extract.canExtract(file)) { + return Q.resolve(); + } + + this._logger.action('extract', path.basename(this._source), { + archive: file, + to: this._tempDir + }); + + return extract(file, this._tempDir); +}; + +FsResolver.prototype._rename = function () { + return Q.nfcall(fs.readdir, this._tempDir) + .then(function (files) { + var file; + var oldPath; + var newPath; + + // Remove any OS specific files from the files array + // before checking its length + files = files.filter(junk.isnt); + + // Only rename if there's only one file and it's not the json + if (files.length === 1 && !/^(bower|component)\.json$/.test(files[0])) { + file = files[0]; + this._singleFile = 'index' + path.extname(file); + oldPath = path.join(this._tempDir, file); + newPath = path.join(this._tempDir, this._singleFile); + + return Q.nfcall(fs.rename, oldPath, newPath); + } + }.bind(this)); +}; + +FsResolver.prototype._savePkgMeta = function (meta) { + // Store main if is a single file + if (this._singleFile) { + meta.main = this._singleFile; + } + + return Resolver.prototype._savePkgMeta.call(this, meta); +}; + +module.exports = FsResolver; diff --git a/packages/Bower.1.3.11/node_modules/bower/lib/core/resolvers/GitFsResolver.js b/packages/Bower.1.3.11/node_modules/bower/lib/core/resolvers/GitFsResolver.js new file mode 100644 index 0000000..3f3e943 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/lib/core/resolvers/GitFsResolver.js @@ -0,0 +1,77 @@ +var util = require('util'); +var Q = require('q'); +var mout = require('mout'); +var path = require('path'); +var GitResolver = require('./GitResolver'); +var copy = require('../../util/copy'); +var cmd = require('../../util/cmd'); + +function GitFsResolver(decEndpoint, config, logger) { + GitResolver.call(this, decEndpoint, config, logger); + + // Ensure absolute path + this._source = path.resolve(this._config.cwd, this._source); +} + +util.inherits(GitFsResolver, GitResolver); +mout.object.mixIn(GitFsResolver, GitResolver); + +// ----------------- + +// Override the checkout function to work with the local copy +GitFsResolver.prototype._checkout = function () { + var resolution = this._resolution; + + // The checkout process could be similar to the GitRemoteResolver by prepending file:// to the source + // But from my performance measures, it's faster to copy the folder and just checkout in there + this._logger.action('checkout', resolution.tag || resolution.branch || resolution.commit, { + resolution: resolution, + to: this._tempDir + }); + + // Copy files to the temporary directory first + return this._copy() + .then(cmd.bind(cmd, 'git', ['checkout', '-f', resolution.tag || resolution.branch || resolution.commit], { cwd: this._tempDir })) + // Cleanup unstaged files + .then(cmd.bind(cmd, 'git', ['clean', '-f', '-d'], { cwd: this._tempDir })); +}; + +GitFsResolver.prototype._copy = function () { + return copy.copyDir(this._source, this._tempDir); +}; + +// ----------------- + +// Grab refs locally +GitFsResolver.refs = function (source) { + var value; + + // TODO: Normalize source because of the various available protocols? + value = this._cache.refs.get(source); + if (value) { + return Q.resolve(value); + } + + value = cmd('git', ['show-ref', '--tags', '--heads'], { cwd : source }) + .spread(function (stdout) { + var refs; + + refs = stdout.toString() + .trim() // Trim trailing and leading spaces + .replace(/[\t ]+/g, ' ') // Standardize spaces (some git versions make tabs, other spaces) + .split(/[\r\n]+/); // Split lines into an array + + // Update the refs with the actual refs + this._cache.refs.set(source, refs); + + return refs; + }.bind(this)); + + // Store the promise to be reused until it resolves + // to a specific value + this._cache.refs.set(source, value); + + return value; +}; + +module.exports = GitFsResolver; diff --git a/packages/Bower.1.3.11/node_modules/bower/lib/core/resolvers/GitHubResolver.js b/packages/Bower.1.3.11/node_modules/bower/lib/core/resolvers/GitHubResolver.js new file mode 100644 index 0000000..8b34639 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/lib/core/resolvers/GitHubResolver.js @@ -0,0 +1,150 @@ +var util = require('util'); +var path = require('path'); +var mout = require('mout'); +var GitRemoteResolver = require('./GitRemoteResolver'); +var download = require('../../util/download'); +var extract = require('../../util/extract'); +var createError = require('../../util/createError'); + +function GitHubResolver(decEndpoint, config, logger) { + var pair; + + GitRemoteResolver.call(this, decEndpoint, config, logger); + + // Grab the org/repo + // /xxxxx/yyyyy.git or :xxxxx/yyyyy.git (.git is optional) + pair = GitHubResolver.getOrgRepoPair(this._source); + if (!pair) { + throw createError('Invalid GitHub URL', 'EINVEND', { + details: this._source + ' does not seem to be a valid GitHub URL' + }); + } + + this._org = pair.org; + this._repo = pair.repo; + + // Ensure trailing for all protocols + if (!mout.string.endsWith(this._source, '.git')) { + this._source += '.git'; + } + + // Check if it's public + this._public = mout.string.startsWith(this._source, 'git://'); + + // Use https:// rather than git:// if on a proxy + if (this._config.proxy || this._config.httpsProxy) { + this._source = this._source.replace('git://', 'https://'); + } + + // Enable shallow clones for GitHub repos + this._shallowClone = true; +} + +util.inherits(GitHubResolver, GitRemoteResolver); +mout.object.mixIn(GitHubResolver, GitRemoteResolver); + +// ----------------- + +GitHubResolver.prototype._checkout = function () { + // Only fully works with public repositories and tags + // Could work with https/ssh protocol but not with 100% certainty + if (!this._public || !this._resolution.tag) { + return GitRemoteResolver.prototype._checkout.call(this); + } + + var msg; + var tarballUrl = 'https://github.com/' + this._org + '/' + this._repo + '/archive/' + this._resolution.tag + '.tar.gz'; + var file = path.join(this._tempDir, 'archive.tar.gz'); + var reqHeaders = {}; + var that = this; + + if (this._config.userAgent) { + reqHeaders['User-Agent'] = this._config.userAgent; + } + + this._logger.action('download', tarballUrl, { + url: that._source, + to: file + }); + + // Download tarball + return download(tarballUrl, file, { + proxy: this._config.httpsProxy, + strictSSL: this._config.strictSsl, + timeout: this._config.timeout, + headers: reqHeaders + }) + .progress(function (state) { + // Retry? + if (state.retry) { + msg = 'Download of ' + tarballUrl + ' failed with ' + state.error.code + ', '; + msg += 'retrying in ' + (state.delay / 1000).toFixed(1) + 's'; + that._logger.debug('error', state.error.message, { error: state.error }); + return that._logger.warn('retry', msg); + } + + // Progress + msg = 'received ' + (state.received / 1024 / 1024).toFixed(1) + 'MB'; + if (state.total) { + msg += ' of ' + (state.total / 1024 / 1024).toFixed(1) + 'MB downloaded, '; + msg += state.percent + '%'; + } + that._logger.info('progress', msg); + }) + .then(function () { + // Extract archive + that._logger.action('extract', path.basename(file), { + archive: file, + to: that._tempDir + }); + + return extract(file, that._tempDir) + // Fallback to standard git clone if extraction failed + .fail(function (err) { + msg = 'Decompression of ' + path.basename(file) + ' failed' + (err.code ? ' with ' + err.code : '') + ', '; + msg += 'trying with git..'; + that._logger.debug('error', err.message, { error: err }); + that._logger.warn('retry', msg); + + return that._cleanTempDir() + .then(GitRemoteResolver.prototype._checkout.bind(that)); + }); + // Fallback to standard git clone if download failed + }, function (err) { + msg = 'Download of ' + tarballUrl + ' failed' + (err.code ? ' with ' + err.code : '') + ', '; + msg += 'trying with git..'; + that._logger.debug('error', err.message, { error: err }); + that._logger.warn('retry', msg); + + return that._cleanTempDir() + .then(GitRemoteResolver.prototype._checkout.bind(that)); + + }); +}; + +GitHubResolver.prototype._savePkgMeta = function (meta) { + // Set homepage if not defined + if (!meta.homepage) { + meta.homepage = 'https://github.com/' + this._org + '/' + this._repo; + } + + return GitRemoteResolver.prototype._savePkgMeta.call(this, meta); +}; + +// ---------------- + +GitHubResolver.getOrgRepoPair = function (url) { + var match; + + match = url.match(/(?:@|:\/\/)github.com[:\/]([^\/\s]+?)\/([^\/\s]+?)(?:\.git)?\/?$/i); + if (!match) { + return null; + } + + return { + org: match[1], + repo: match[2] + }; +}; + +module.exports = GitHubResolver; diff --git a/packages/Bower.1.3.11/node_modules/bower/lib/core/resolvers/GitRemoteResolver.js b/packages/Bower.1.3.11/node_modules/bower/lib/core/resolvers/GitRemoteResolver.js new file mode 100644 index 0000000..3223c89 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/lib/core/resolvers/GitRemoteResolver.js @@ -0,0 +1,201 @@ +var util = require('util'); +var url = require('url'); +var Q = require('q'); +var mout = require('mout'); +var LRU = require('lru-cache'); +var GitResolver = require('./GitResolver'); +var cmd = require('../../util/cmd'); + +function GitRemoteResolver(decEndpoint, config, logger) { + GitResolver.call(this, decEndpoint, config, logger); + + if (!mout.string.startsWith(this._source, 'file://')) { + // Trim trailing slashes + this._source = this._source.replace(/\/+$/, ''); + } + + // If the name was guessed, remove the trailing .git + if (this._guessedName && mout.string.endsWith(this._name, '.git')) { + this._name = this._name.slice(0, -4); + } + + // Get the host of this source + if (!/:\/\//.test(this._source)) { + this._host = url.parse('ssh://' + this._source).host; + } else { + this._host = url.parse(this._source).host; + } + + // Disable shallow clones + this._shallowClone = false; +} + +util.inherits(GitRemoteResolver, GitResolver); +mout.object.mixIn(GitRemoteResolver, GitResolver); + +// ----------------- + +GitRemoteResolver.prototype._checkout = function () { + var promise; + var timer; + var reporter; + var that = this; + var resolution = this._resolution; + + this._logger.action('checkout', resolution.tag || resolution.branch || resolution.commit, { + resolution: resolution, + to: this._tempDir + }); + + // If resolution is a commit, we need to clone the entire repo and check it out + // Because a commit is not a named ref, there's no better solution + if (resolution.type === 'commit') { + promise = this._slowClone(resolution); + // Otherwise we are checking out a named ref so we can optimize it + } else { + promise = this._fastClone(resolution); + } + + // Throttle the progress reporter to 1 time each sec + reporter = mout.fn.throttle(function (data) { + var lines; + + lines = data.split(/[\r\n]+/); + lines.forEach(function (line) { + if (/\d{1,3}\%/.test(line)) { + // TODO: There are some strange chars that appear once in a while (\u001b[K) + // Trim also those? + that._logger.info('progress', line.trim()); + } + }); + }, 1000); + + // Start reporting progress after a few seconds + timer = setTimeout(function () { + promise.progress(reporter); + }, 8000); + + return promise + // Add additional proxy information to the error if necessary + .fail(function (err) { + that._suggestProxyWorkaround(err); + throw err; + }) + // Clear timer at the end + .fin(function () { + clearTimeout(timer); + reporter.cancel(); + }); +}; + +GitRemoteResolver.prototype._findResolution = function (target) { + var that = this; + + // Override this function to include a meaningful message related to proxies + // if necessary + return GitResolver.prototype._findResolution.call(this, target) + .fail(function (err) { + that._suggestProxyWorkaround(err); + throw err; + }); +}; + +// ------------------------------ + +GitRemoteResolver.prototype._slowClone = function (resolution) { + return cmd('git', ['clone', this._source, this._tempDir, '--progress']) + .then(cmd.bind(cmd, 'git', ['checkout', resolution.commit], { cwd: this._tempDir })); +}; + +GitRemoteResolver.prototype._fastClone = function (resolution) { + var branch, + args, + that = this; + + branch = resolution.tag || resolution.branch; + args = ['clone', this._source, '-b', branch, '--progress', '.']; + + // If the host does not support shallow clones, we don't use --depth=1 + if (this._shallowClone && !GitRemoteResolver._noShallow.get(this._host)) { + args.push('--depth', 1); + } + + return cmd('git', args, { cwd: this._tempDir }) + .spread(function (stdout, stderr) { + // Only after 1.7.10 --branch accepts tags + // Detect those cases and inform the user to update git otherwise it's + // a lot slower than newer versions + if (!/branch .+? not found/i.test(stderr)) { + return; + } + + that._logger.warn('old-git', 'It seems you are using an old version of git, it will be slower and propitious to errors!'); + return cmd('git', ['checkout', resolution.commit], { cwd: that._tempDir }); + }, function (err) { + // Some git servers do not support shallow clones + // When that happens, we mark this host and try again + if (!GitRemoteResolver._noShallow.has(that._source) && + err.details && + /(rpc failed|shallow|--depth)/i.test(err.details) + ) { + GitRemoteResolver._noShallow.set(that._host, true); + return that._fastClone(resolution); + } + + throw err; + }); +}; + +GitRemoteResolver.prototype._suggestProxyWorkaround = function (err) { + if ((this._config.proxy || this._config.httpsProxy) && + mout.string.startsWith(this._source, 'git://') && + err.code === 'ECMDERR' && err.details + ) { + err.details = err.details.trim(); + err.details += '\n\nWhen under a proxy, you must configure git to use https:// instead of git://.'; + err.details += '\nYou can configure it for every endpoint or for this specific host as follows:'; + err.details += '\ngit config --global url."https://".insteadOf git://'; + err.details += '\ngit config --global url."https://' + this._host + '".insteadOf git://' + this._host; + err.details += 'Ignore this suggestion if you already have this configured.'; + } +}; + +// ------------------------------ + +// Grab refs remotely +GitRemoteResolver.refs = function (source) { + var value; + + // TODO: Normalize source because of the various available protocols? + value = this._cache.refs.get(source); + if (value) { + return Q.resolve(value); + } + + // Store the promise in the refs object + value = cmd('git', ['ls-remote', '--tags', '--heads', source]) + .spread(function (stdout) { + var refs; + + refs = stdout.toString() + .trim() // Trim trailing and leading spaces + .replace(/[\t ]+/g, ' ') // Standardize spaces (some git versions make tabs, other spaces) + .split(/[\r\n]+/); // Split lines into an array + + // Update the refs with the actual refs + this._cache.refs.set(source, refs); + + return refs; + }.bind(this)); + + // Store the promise to be reused until it resolves + // to a specific value + this._cache.refs.set(source, value); + + return value; +}; + +// Store hosts that do not support shallow clones here +GitRemoteResolver._noShallow = new LRU({ max: 50, maxAge: 5 * 60 * 1000 }); + +module.exports = GitRemoteResolver; diff --git a/packages/Bower.1.3.11/node_modules/bower/lib/core/resolvers/GitResolver.js b/packages/Bower.1.3.11/node_modules/bower/lib/core/resolvers/GitResolver.js new file mode 100644 index 0000000..231c988 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/lib/core/resolvers/GitResolver.js @@ -0,0 +1,387 @@ +var util = require('util'); +var path = require('path'); +var Q = require('q'); +var chmodr = require('chmodr'); +var rimraf = require('rimraf'); +var mkdirp = require('mkdirp'); +var which = require('which'); +var LRU = require('lru-cache'); +var mout = require('mout'); +var Resolver = require('./Resolver'); +var semver = require('../../util/semver'); +var createError = require('../../util/createError'); + +var hasGit; + +// Check if git is installed +try { + which.sync('git'); + hasGit = true; +} catch (ex) { + hasGit = false; +} + +function GitResolver(decEndpoint, config, logger) { + // Set template dir to the empty directory so that user templates are not run + // This environment variable is not multiple config aware but it's not documented + // anyway + mkdirp.sync(config.storage.empty); + process.env.GIT_TEMPLATE_DIR = config.storage.empty; + + Resolver.call(this, decEndpoint, config, logger); + + if (!hasGit) { + throw createError('git is not installed or not in the PATH', 'ENOGIT'); + } +} + +util.inherits(GitResolver, Resolver); +mout.object.mixIn(GitResolver, Resolver); + +// ----------------- + +GitResolver.prototype._hasNew = function (canonicalDir, pkgMeta) { + var oldResolution = pkgMeta._resolution || {}; + + return this._findResolution() + .then(function (resolution) { + // Check if resolution types are different + if (oldResolution.type !== resolution.type) { + return true; + } + + // If resolved to a version, there is new content if the tags are not equal + if (resolution.type === 'version' && semver.neq(resolution.tag, oldResolution.tag)) { + return true; + } + + // As last check, we compare both commit hashes + return resolution.commit !== oldResolution.commit; + }); +}; + +GitResolver.prototype._resolve = function () { + var that = this; + + return this._findResolution() + .then(function () { + return that._checkout() + // Always run cleanup after checkout to ensure that .git is removed! + // If it's not removed, problems might arise when the "tmp" module attempts + // to delete the temporary folder + .fin(function () { + return that._cleanup(); + }); + }); +}; + +// ----------------- + +// Abstract functions that should be implemented by concrete git resolvers +GitResolver.prototype._checkout = function () { + throw new Error('_checkout not implemented'); +}; + +GitResolver.refs = function (source) { + throw new Error('refs not implemented'); +}; + +// ----------------- + +GitResolver.prototype._findResolution = function (target) { + var err; + var self = this.constructor; + var that = this; + + target = target || this._target || '*'; + + // Target is a commit, so it's a stale target (not a moving target) + // There's nothing to do in this case + if ((/^[a-f0-9]{40}$/).test(target)) { + this._resolution = { type: 'commit', commit: target }; + return Q.resolve(this._resolution); + } + + // Target is a range/version + if (semver.validRange(target)) { + return self.versions(this._source, true) + .then(function (versions) { + var versionsArr, + version, + index; + + versionsArr = versions.map(function (obj) { return obj.version; }); + + // If there are no tags and target is *, + // fallback to the latest commit on master + if (!versions.length && target === '*') { + return that._findResolution('master'); + } + + versionsArr = versions.map(function (obj) { return obj.version; }); + // Find a satisfying version, enabling strict match so that pre-releases + // have lower priority over normal ones when target is * + index = semver.maxSatisfyingIndex(versionsArr, target, true); + if (index !== -1) { + version = versions[index]; + return that._resolution = { type: 'version', tag: version.tag, commit: version.commit }; + } + + // Check if there's an exact branch/tag with this name as last resort + return Q.all([ + self.branches(that._source), + self.tags(that._source) + ]) + .spread(function (branches, tags) { + // Use hasOwn because a branch/tag could have a name like "hasOwnProperty" + if (mout.object.hasOwn(tags, target)) { + return that._resolution = { type: 'tag', tag: target, commit: tags[target] }; + } + if (mout.object.hasOwn(branches, target)) { + return that._resolution = { type: 'branch', branch: target, commit: branches[target] }; + } + + throw createError('No tag found that was able to satisfy ' + target, 'ENORESTARGET', { + details: !versions.length ? + 'No versions found in ' + that._source : + 'Available versions: ' + versions.map(function (version) { return version.version; }).join(', ') + }); + }); + }); + } + + // Otherwise, target is either a tag or a branch + return Q.all([ + self.branches(that._source), + self.tags(that._source) + ]) + .spread(function (branches, tags) { + // Use hasOwn because a branch/tag could have a name like "hasOwnProperty" + if (mout.object.hasOwn(tags, target)) { + return that._resolution = { type: 'tag', tag: target, commit: tags[target] }; + } + if (mout.object.hasOwn(branches, target)) { + return that._resolution = { type: 'branch', branch: target, commit: branches[target] }; + } + + if ((/^[a-f0-9]{4,40}$/).test(target)) { + if (target.length < 12) { + that._logger.warn( + 'short-sha', + 'Consider using longer commit SHA to avoid conflicts' + ); + } + + that._resolution = { type: 'commit', commit: target }; + return that._resolution; + } + + branches = Object.keys(branches); + tags = Object.keys(tags); + + err = createError('Tag/branch ' + target + ' does not exist', 'ENORESTARGET'); + err.details = !tags.length ? + 'No tags found in ' + that._source : + 'Available tags: ' + tags.join(', '); + err.details += '\n'; + err.details += !branches.length ? + 'No branches found in ' + that._source : + 'Available branches: ' + branches.join(', '); + + throw err; + }); +}; + +GitResolver.prototype._cleanup = function () { + var gitFolder = path.join(this._tempDir, '.git'); + + // Remove the .git folder + // Note that on windows, we need to chmod to 0777 before due to a bug in git + // See: https://github.com/isaacs/rimraf/issues/19 + if (process.platform === 'win32') { + return Q.nfcall(chmodr, gitFolder, 0777) + .then(function () { + return Q.nfcall(rimraf, gitFolder); + }, function (err) { + // If .git does not exist, chmodr returns ENOENT + // so, we ignore that error code + if (err.code !== 'ENOENT') { + throw err; + } + }); + } else { + return Q.nfcall(rimraf, gitFolder); + } +}; + +GitResolver.prototype._savePkgMeta = function (meta) { + var version; + + if (this._resolution.type === 'version') { + version = semver.clean(this._resolution.tag); + + // Warn if the package meta version is different than the resolved one + if (typeof meta.version === 'string' && semver.neq(meta.version, version)) { + this._logger.warn('mismatch', 'Version declared in the json (' + meta.version + ') is different than the resolved one (' + version + ')', { + resolution: this._resolution, + pkgMeta: meta + }); + } + + // Ensure package meta version is the same as the resolution + meta.version = version; + } else { + // If resolved to a target that is not a version, + // remove the version from the meta + delete meta.version; + } + + // Save version/tag/commit in the release + // Note that we can't store branches because _release is supposed to be + // an unique id of this ref. + meta._release = version || + this._resolution.tag || + this._resolution.commit.substr(0, 10); + + // Save resolution to be used in hasNew later + meta._resolution = this._resolution; + + return Resolver.prototype._savePkgMeta.call(this, meta); +}; + +// ------------------------------ + +GitResolver.versions = function (source, extra) { + var value = this._cache.versions.get(source); + + if (value) { + return Q.resolve(value) + .then(function () { + var versions = this._cache.versions.get(source); + + // If no extra information was requested, + // resolve simply with the versions + if (!extra) { + versions = versions.map(function (version) { + return version.version; + }); + } + + return versions; + }.bind(this)); + } + + value = this.tags(source) + .then(function (tags) { + var tag; + var version; + var versions = []; + + // For each tag + for (tag in tags) { + version = semver.clean(tag); + if (version) { + versions.push({ version: version, tag: tag, commit: tags[tag] }); + } + } + + // Sort them by DESC order + versions.sort(function (a, b) { + return semver.rcompare(a.version, b.version); + }); + + this._cache.versions.set(source, versions); + + // Call the function again to keep it DRY + return this.versions(source, extra); + }.bind(this)); + + + // Store the promise to be reused until it resolves + // to a specific value + this._cache.versions.set(source, value); + + return value; +}; + +GitResolver.tags = function (source) { + var value = this._cache.tags.get(source); + + if (value) { + return Q.resolve(value); + } + + value = this.refs(source) + .then(function (refs) { + var tags = {}; + + // For each line in the refs, match only the tags + refs.forEach(function (line) { + var match = line.match(/^([a-f0-9]{40})\s+refs\/tags\/(\S+)/); + + if (match && !mout.string.endsWith(match[2], '^{}')) { + tags[match[2]] = match[1]; + } + }); + + this._cache.tags.set(source, tags); + + return tags; + }.bind(this)); + + // Store the promise to be reused until it resolves + // to a specific value + this._cache.tags.set(source, value); + + return value; +}; + +GitResolver.branches = function (source) { + var value = this._cache.branches.get(source); + + if (value) { + return Q.resolve(value); + } + + value = this.refs(source) + .then(function (refs) { + var branches = {}; + + // For each line in the refs, extract only the heads + // Organize them in an object where keys are branches and values + // the commit hashes + refs.forEach(function (line) { + var match = line.match(/^([a-f0-9]{40})\s+refs\/heads\/(\S+)/); + + if (match) { + branches[match[2]] = match[1]; + } + }); + + this._cache.branches.set(source, branches); + + return branches; + }.bind(this)); + + // Store the promise to be reused until it resolves + // to a specific value + this._cache.branches.set(source, value); + + return value; +}; + +GitResolver.clearRuntimeCache = function () { + // Reset cache for branches, tags, etc + mout.object.forOwn(GitResolver._cache, function (lru) { + lru.reset(); + }); +}; + +GitResolver._cache = { + branches: new LRU({ max: 50, maxAge: 5 * 60 * 1000 }), + tags: new LRU({ max: 50, maxAge: 5 * 60 * 1000 }), + versions: new LRU({ max: 50, maxAge: 5 * 60 * 1000 }), + refs: new LRU({ max: 50, maxAge: 5 * 60 * 1000 }) +}; + +module.exports = GitResolver; diff --git a/packages/Bower.1.3.11/node_modules/bower/lib/core/resolvers/Resolver.js b/packages/Bower.1.3.11/node_modules/bower/lib/core/resolvers/Resolver.js new file mode 100644 index 0000000..38ff87b --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/lib/core/resolvers/Resolver.js @@ -0,0 +1,256 @@ +var fs = require('graceful-fs'); +var path = require('path'); +var Q = require('q'); +var tmp = require('tmp'); +var mkdirp = require('mkdirp'); +var rimraf = require('rimraf'); +var readJson = require('../../util/readJson'); +var createError = require('../../util/createError'); +var removeIgnores = require('../../util/removeIgnores'); + +tmp.setGracefulCleanup(); + +function Resolver(decEndpoint, config, logger) { + this._source = decEndpoint.source; + this._target = decEndpoint.target || '*'; + this._name = decEndpoint.name || path.basename(this._source); + + this._config = config; + this._logger = logger; + + this._guessedName = !decEndpoint.name; +} + +// ----------------- + +Resolver.prototype.getSource = function () { + return this._source; +}; + +Resolver.prototype.getName = function () { + return this._name; +}; + +Resolver.prototype.getTarget = function () { + return this._target; +}; + +Resolver.prototype.getTempDir = function () { + return this._tempDir; +}; + +Resolver.prototype.getPkgMeta = function () { + return this._pkgMeta; +}; + +Resolver.prototype.hasNew = function (canonicalDir, pkgMeta) { + var promise; + var metaFile; + var that = this; + + // If already working, error out + if (this._working) { + return Q.reject(createError('Already working', 'EWORKING')); + } + + this._working = true; + + // Avoid reading the package meta if already given + if (pkgMeta) { + promise = this._hasNew(canonicalDir, pkgMeta); + // Otherwise call _hasNew with both the package meta and the canonical dir + } else { + metaFile = path.join(canonicalDir, '.bower.json'); + + promise = readJson(metaFile) + .spread(function (pkgMeta) { + return that._hasNew(canonicalDir, pkgMeta); + }, function (err) { + that._logger.debug('read-json', 'Failed to read ' + metaFile, { + filename: metaFile, + error: err + }); + + return true; // Simply resolve to true if there was an error reading the file + }); + } + + return promise.fin(function () { + that._working = false; + }); +}; + +Resolver.prototype.resolve = function () { + var that = this; + + // If already working, error out + if (this._working) { + return Q.reject(createError('Already working', 'EWORKING')); + } + + this._working = true; + + // Create temporary dir + return this._createTempDir() + // Resolve self + .then(this._resolve.bind(this)) + // Read json, generating the package meta + .then(this._readJson.bind(this, null)) + // Apply and save package meta + .then(function (meta) { + return that._applyPkgMeta(meta) + .then(that._savePkgMeta.bind(that, meta)); + }) + .then(function () { + // Resolve with the folder + return that._tempDir; + }, function (err) { + // If something went wrong, unset the temporary dir + that._tempDir = null; + throw err; + }) + .fin(function () { + that._working = false; + }); +}; + +Resolver.prototype.isCacheable = function () { + // Bypass cache for local dependencies + if (this._source && + /^(?:file:[\/\\]{2}|[A-Z]:)?\.?\.?[\/\\]/.test(this._source) + ) { + return false; + } + + // We don't want to cache moving targets like branches + if (this._pkgMeta && + this._pkgMeta._resolution && + this._pkgMeta._resolution.type === 'branch') + { + return false; + } + + return true; +}; + + +// ----------------- + +// Abstract functions that must be implemented by concrete resolvers +Resolver.prototype._resolve = function () { + throw new Error('_resolve not implemented'); +}; + +// Abstract functions that can be re-implemented by concrete resolvers +// as necessary +Resolver.prototype._hasNew = function (canonicalDir, pkgMeta) { + return Q.resolve(true); +}; + +Resolver.isTargetable = function () { + return true; +}; + +Resolver.versions = function (source) { + return Q.resolve([]); +}; + +Resolver.clearRuntimeCache = function () {}; + +// ----------------- + +Resolver.prototype._createTempDir = function () { + return Q.nfcall(mkdirp, this._config.tmp) + .then(function () { + return Q.nfcall(tmp.dir, { + template: path.join(this._config.tmp, this._name + '-' + process.pid + '-XXXXXX'), + mode: 0777 & ~process.umask(), + unsafeCleanup: true + }); + }.bind(this)) + .then(function (dir) { + // nfcall may return multiple callback arguments as an array + return this._tempDir = Array.isArray(dir) ? dir[0] : dir; + }.bind(this)); +}; + +Resolver.prototype._cleanTempDir = function () { + var tempDir = this._tempDir; + + if (!tempDir) { + return Q.resolve(); + } + + // Delete and create folder + return Q.nfcall(rimraf, tempDir) + .then(function () { + return Q.nfcall(mkdirp, tempDir, 0777 & ~process.umask()); + }) + .then(function () { + return tempDir; + }); +}; + +Resolver.prototype._readJson = function (dir) { + var that = this; + + dir = dir || this._tempDir; + return readJson(dir, { + assume: { name: this._name } + }) + .spread(function (json, deprecated) { + if (deprecated) { + that._logger.warn('deprecated', 'Package ' + that._name + ' is using the deprecated ' + deprecated); + } + + return json; + }); +}; + +Resolver.prototype._applyPkgMeta = function (meta) { + // Check if name defined in the json is different + // If so and if the name was "guessed", assume the json name + if (meta.name !== this._name && this._guessedName) { + this._name = meta.name; + } + + // Handle ignore property, deleting all files from the temporary directory + // If no ignores were specified, simply resolve + if (!meta.ignore || !meta.ignore.length) { + return Q.resolve(meta); + } + + // Otherwise remove them from the temp dir + return removeIgnores(this._tempDir, meta) + .then(function () { + return meta; + }); +}; + +Resolver.prototype._savePkgMeta = function (meta) { + var that = this; + var contents; + + // Store original source & target + meta._source = this._source; + meta._target = this._target; + + ['main', 'ignore'].forEach(function (attr) { + if (meta[attr]) return; + + that._logger.log( + 'warn', 'invalid-meta', + (meta.name || 'component') + ' is missing "' + attr + '" entry in bower.json' + ); + }); + + // Stringify contents + contents = JSON.stringify(meta, null, 2); + + return Q.nfcall(fs.writeFile, path.join(this._tempDir, '.bower.json'), contents) + .then(function () { + return that._pkgMeta = meta; + }); +}; + +module.exports = Resolver; diff --git a/packages/Bower.1.3.11/node_modules/bower/lib/core/resolvers/SvnResolver.js b/packages/Bower.1.3.11/node_modules/bower/lib/core/resolvers/SvnResolver.js new file mode 100644 index 0000000..866fad7 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/lib/core/resolvers/SvnResolver.js @@ -0,0 +1,403 @@ +var util = require('util'); +var Q = require('q'); +var which = require('which'); +var LRU = require('lru-cache'); +var mout = require('mout'); +var Resolver = require('./Resolver'); +var semver = require('../../util/semver'); +var createError = require('../../util/createError'); +var cmd = require('../../util/cmd'); + +var hasSvn; + +// Check if svn is installed +try { + which.sync('svn'); + hasSvn = true; +} catch (ex) { + hasSvn = false; +} + +function SvnResolver(decEndpoint, config, logger) { + Resolver.call(this, decEndpoint, config, logger); + + if (!hasSvn) { + throw createError('svn is not installed or not in the PATH', 'ENOSVN'); + } +} + +util.inherits(SvnResolver, Resolver); +mout.object.mixIn(SvnResolver, Resolver); + +// ----------------- + +SvnResolver.getSource = function (source) { + var uri = this._source || source; + + return uri + .replace(/^svn\+(https?|file):\/\//i, '$1://') // Change svn+http or svn+https or svn+file to http(s), file respectively + .replace('svn://', 'http://') // Change svn to http + .replace(/\/+$/, ''); // Remove trailing slashes +}; + +SvnResolver.prototype._hasNew = function (canonicalDir, pkgMeta) { + var oldResolution = pkgMeta._resolution || {}; + + return this._findResolution() + .then(function (resolution) { + // Check if resolution types are different + if (oldResolution.type !== resolution.type) { + return true; + } + + // If resolved to a version, there is new content if the tags are not equal + if (resolution.type === 'version' && semver.neq(resolution.tag, oldResolution.tag)) { + return true; + } + + // As last check, we compare both commit hashes + return resolution.commit !== oldResolution.commit; + }); +}; + +SvnResolver.prototype._resolve = function () { + var that = this; + + return this._findResolution() + .then(function () { + return that._export(); + }); +}; + +// ----------------- + +SvnResolver.prototype._export = function () { + var promise; + var timer; + var reporter; + var that = this; + var resolution = this._resolution; + + this.source = SvnResolver.getSource(this._source); + + this._logger.action('export', resolution.tag || resolution.branch || resolution.commit, { + resolution: resolution, + to: this._tempDir + }); + + if (resolution.type === 'commit') { + promise = cmd('svn', ['export', '--force', this._source + '/trunk', '-r' + resolution.commit, this._tempDir]); + } else if (resolution.type === 'branch' && resolution.branch === 'trunk') { + promise = cmd('svn', ['export', '--force', this._source + '/trunk', this._tempDir]); + } else if (resolution.type === 'branch') { + promise = cmd('svn', ['export', '--force', this._source + '/branches/' + resolution.branch, this._tempDir]); + } else { + promise = cmd('svn', ['export', '--force', this._source + '/tags/' + resolution.tag, this._tempDir]); + } + + // Throttle the progress reporter to 1 time each sec + reporter = mout.fn.throttle(function (data) { + var lines; + + lines = data.split(/[\r\n]+/); + lines.forEach(function (line) { + if (/\d{1,3}\%/.test(line)) { + // TODO: There are some strange chars that appear once in a while (\u001b[K) + // Trim also those? + that._logger.info('progress', line.trim()); + } + }); + }, 1000); + + // Start reporting progress after a few seconds + timer = setTimeout(function () { + promise.progress(reporter); + }, 8000); + + return promise + // Add additional proxy information to the error if necessary + .fail(function (err) { + throw err; + }) + // Clear timer at the end + .fin(function () { + clearTimeout(timer); + reporter.cancel(); + }); +}; + +// ----------------- + +SvnResolver.prototype._findResolution = function (target) { + var err; + var self = this.constructor; + var that = this; + + target = target || this._target || '*'; + + this._source = SvnResolver.getSource(this._source); + + // Target is a revision, so it's a stale target (not a moving target) + // There's nothing to do in this case + if ((/^r\d+/).test(target)) { + target = target.split('r'); + + this._resolution = { type: 'commit', commit: target[1] }; + return Q.resolve(this._resolution); + } + + // Target is a range/version + if (semver.validRange(target)) { + return self.versions(this._source, true) + .then(function (versions) { + var versionsArr, + version, + index; + + versionsArr = versions.map(function (obj) { return obj.version; }); + + // If there are no tags and target is *, + // fallback to the latest commit on trunk + if (!versions.length && target === '*') { + return that._findResolution('trunk'); + } + + versionsArr = versions.map(function (obj) { return obj.version; }); + // Find a satisfying version, enabling strict match so that pre-releases + // have lower priority over normal ones when target is * + index = semver.maxSatisfyingIndex(versionsArr, target, true); + if (index !== -1) { + version = versions[index]; + return that._resolution = { type: 'version', tag: version.tag, commit: version.commit }; + } + + // Check if there's an exact branch/tag with this name as last resort + return Q.all([ + self.branches(that._source), + self.tags(that._source) + ]) + .spread(function (branches, tags) { + // Use hasOwn because a branch/tag could have a name like "hasOwnProperty" + if (mout.object.hasOwn(tags, target)) { + return that._resolution = { type: 'tag', tag: target, commit: tags[target] }; + } + if (mout.object.hasOwn(branches, target)) { + return that._resolution = { type: 'branch', branch: target, commit: branches[target] }; + } + + throw createError('No tag found that was able to satisfy ' + target, 'ENORESTARGET', { + details: !versions.length ? + 'No versions found in ' + that._source : + 'Available versions: ' + versions.map(function (version) { return version.version; }).join(', ') + }); + }); + }); + } + + // Otherwise, target is either a tag or a branch + return Q.all([ + self.branches(that._source), + self.tags(that._source) + ]) + .spread(function (branches, tags) { + // Use hasOwn because a branch/tag could have a name like "hasOwnProperty" + if (mout.object.hasOwn(tags, target)) { + return that._resolution = { type: 'tag', tag: target, commit: tags[target] }; + } + if (mout.object.hasOwn(branches, target)) { + return that._resolution = { type: 'branch', branch: target, commit: branches[target] }; + } + + branches = Object.keys(branches); + tags = Object.keys(tags); + + err = createError('target ' + target + ' does not exist', 'ENORESTARGET'); + err.details = !tags.length ? + 'No tags found in ' + that._source : + 'Available tags: ' + tags.join(', '); + err.details += '\n'; + err.details += !branches.length ? + 'No branches found in ' + that._source : + 'Available branches: ' + branches.join(', '); + + throw err; + }); +}; + +SvnResolver.prototype._savePkgMeta = function (meta) { + var version; + + if (this._resolution.type === 'version') { + version = semver.clean(this._resolution.tag); + + // Warn if the package meta version is different than the resolved one + if (typeof meta.version === 'string' && semver.neq(meta.version, version)) { + this._logger.warn('mismatch', 'Version declared in the json (' + meta.version + ') is different than the resolved one (' + version + ')', { + resolution: this._resolution, + pkgMeta: meta + }); + } + + // Ensure package meta version is the same as the resolution + meta.version = version; + } else { + // If resolved to a target that is not a version, + // remove the version from the meta + delete meta.version; + } + + // Save version/tag/commit in the release + // Note that we can't store branches because _release is supposed to be + // an unique id of this ref. + meta._release = version || + this._resolution.tag || + this._resolution.commit; + + // Save resolution to be used in hasNew later + meta._resolution = this._resolution; + + return Resolver.prototype._savePkgMeta.call(this, meta); +}; + +// ------------------------------ + +SvnResolver.versions = function (source, extra) { + source = SvnResolver.getSource(source); + + var value = this._cache.versions.get(source); + + if (value) { + return Q.resolve(value) + .then(function () { + var versions = this._cache.versions.get(source); + + // If no extra information was requested, + // resolve simply with the versions + if (!extra) { + versions = versions.map(function (version) { + return version.version; + }); + } + + return versions; + }.bind(this)); + } + + value = this.tags(source) + .then(function (tags) { + var tag; + var version; + var versions = []; + + // For each tag + for (tag in tags) { + version = semver.clean(tag); + if (version) { + versions.push({ version: version, tag: tag, commit: tags[tag] }); + } + } + + // Sort them by DESC order + versions.sort(function (a, b) { + return semver.rcompare(a.version, b.version); + }); + + this._cache.versions.set(source, versions); + + // Call the function again to keep it DRY + return this.versions(source, extra); + }.bind(this)); + + // Store the promise to be reused until it resolves + // to a specific value + this._cache.versions.set(source, value); + + return value; +}; + +SvnResolver.tags = function (source) { + source = SvnResolver.getSource(source); + + var value = this._cache.tags.get(source); + + if (value) { + return Q.resolve(value); + } + + value = cmd('svn', ['list', source + '/tags', '--verbose']) + .spread(function (stout) { + var tags = SvnResolver.parseSubversionListOutput(stout.toString()); + + this._cache.tags.set(source, tags); + return tags; + + }.bind(this)); + + // Store the promise to be reused until it resolves + // to a specific value + this._cache.tags.set(source, value); + + return value; +}; + +SvnResolver.branches = function (source) { + source = SvnResolver.getSource(source); + + var value = this._cache.branches.get(source); + + if (value) { + return Q.resolve(value); + } + + value = cmd('svn', ['list', source + '/branches', '--verbose']) + .spread(function (stout) { + var branches = SvnResolver.parseSubversionListOutput(stout.toString()); + + // trunk is a branch! + branches.trunk = '*'; + + this._cache.branches.set(source, branches); + return branches; + + }.bind(this)); + + // Store the promise to be reused until it resolves + // to a specific value + this._cache.branches.set(source, value); + + return value; +}; + +SvnResolver.parseSubversionListOutput = function (stout) { + + var entries = {}; + var lines = stout + .trim() + .split(/[\r\n]+/); + + // For each line in the refs, match only the branches + lines.forEach(function (line) { + var match = line.match(/\s+([0-9]+)\s.+\s([\w.$-]+)\//i); + + if (match && match[2] !== '.') { + entries[match[2]] = match[1]; + } + }); + + return entries; +}; + +SvnResolver.clearRuntimeCache = function () { + // Reset cache for branches, tags, etc + mout.object.forOwn(SvnResolver._cache, function (lru) { + lru.reset(); + }); +}; + +SvnResolver._cache = { + branches: new LRU({ max: 50, maxAge: 5 * 60 * 1000 }), + tags: new LRU({ max: 50, maxAge: 5 * 60 * 1000 }), + versions: new LRU({ max: 50, maxAge: 5 * 60 * 1000 }) +}; + +module.exports = SvnResolver; diff --git a/packages/Bower.1.3.11/node_modules/bower/lib/core/resolvers/UrlResolver.js b/packages/Bower.1.3.11/node_modules/bower/lib/core/resolvers/UrlResolver.js new file mode 100644 index 0000000..0048786 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/lib/core/resolvers/UrlResolver.js @@ -0,0 +1,284 @@ +var util = require('util'); +var path = require('path'); +var fs = require('graceful-fs'); +var url = require('url'); +var request = require('request'); +var Q = require('q'); +var mout = require('mout'); +var junk = require('junk'); +var Resolver = require('./Resolver'); +var download = require('../../util/download'); +var extract = require('../../util/extract'); +var createError = require('../../util/createError'); + +function UrlResolver(decEndpoint, config, logger) { + Resolver.call(this, decEndpoint, config, logger); + + // If target was specified, error out + if (this._target !== '*') { + throw createError('URL sources can\'t resolve targets', 'ENORESTARGET'); + } + + // If the name was guessed + if (this._guessedName) { + // Remove the ?xxx part + this._name = this._name.replace(/\?.*$/, ''); + // Remove extension + this._name = this._name.substr(0, this._name.length - path.extname(this._name).length); + } + + this._remote = url.parse(this._source); +} + +util.inherits(UrlResolver, Resolver); +mout.object.mixIn(UrlResolver, Resolver); + +// ----------------- + +UrlResolver.isTargetable = function () { + return false; +}; + +UrlResolver.prototype._hasNew = function (canonicalDir, pkgMeta) { + var oldCacheHeaders = pkgMeta._cacheHeaders || {}; + var reqHeaders = {}; + + // If the previous cache headers contain an ETag, + // send the "If-None-Match" header with it + if (oldCacheHeaders.ETag) { + reqHeaders['If-None-Match'] = oldCacheHeaders.ETag; + } + + if (this._config.userAgent) { + reqHeaders['User-Agent'] = this._config.userAgent; + } + + // Make an HEAD request to the source + return Q.nfcall(request.head, this._source, { + proxy: this._remote.protocol === 'https:' ? this._config.httpsProxy : this._config.proxy, + strictSSL: this._config.strictSsl, + timeout: this._config.timeout, + headers: reqHeaders + }) + // Compare new headers with the old ones + .spread(function (response) { + var cacheHeaders; + + // If the server responded with 303 then the resource + // still has the same ETag + if (response.statusCode === 304) { + return false; + } + + // If status code is not in the 2xx range, + // then just resolve to true + if (response.statusCode < 200 || response.statusCode >= 300) { + return true; + } + + // Fallback to comparing cache headers + cacheHeaders = this._collectCacheHeaders(response); + return !mout.object.equals(oldCacheHeaders, cacheHeaders); + }.bind(this), function () { + // Assume new contents if the request failed + // Note that we do not retry the request using the "request-replay" module + // because it would take too long + return true; + }); +}; + +// TODO: There's room for improvement by using streams if the URL +// is an archive file, by piping read stream to the zip extractor +// This will likely increase the complexity of code but might worth it + +UrlResolver.prototype._resolve = function () { + // Download + return this._download() + // Parse headers + .spread(this._parseHeaders.bind(this)) + // Extract file + .spread(this._extract.bind(this)) + // Rename file to index + .then(this._rename.bind(this)); +}; + +// ----------------- + +UrlResolver.prototype._download = function () { + var fileName = url.parse(path.basename(this._source)).pathname; + var file = path.join(this._tempDir, fileName); + var reqHeaders = {}; + var that = this; + + if (this._config.userAgent) { + reqHeaders['User-Agent'] = this._config.userAgent; + } + + this._logger.action('download', that._source, { + url: that._source, + to: file + }); + + // Download the file + return download(this._source, file, { + proxy: this._remote.protocol === 'https:' ? this._config.httpsProxy : this._config.proxy, + strictSSL: this._config.strictSsl, + timeout: this._config.timeout, + headers: reqHeaders + }) + .progress(function (state) { + var msg; + + // Retry? + if (state.retry) { + msg = 'Download of ' + that._source + ' failed' + (state.error.code ? ' with ' + state.error.code : '') + ', '; + msg += 'retrying in ' + (state.delay / 1000).toFixed(1) + 's'; + that._logger.debug('error', state.error.message, { error: state.error }); + return that._logger.warn('retry', msg); + } + + // Progress + msg = 'received ' + (state.received / 1024 / 1024).toFixed(1) + 'MB'; + if (state.total) { + msg += ' of ' + (state.total / 1024 / 1024).toFixed(1) + 'MB downloaded, '; + msg += state.percent + '%'; + } + that._logger.info('progress', msg); + }) + .then(function (response) { + that._response = response; + return [file, response]; + }); +}; + +UrlResolver.prototype._parseHeaders = function (file, response) { + var disposition; + var newFile; + var match; + + // Check if we got a Content-Disposition header + disposition = response.headers['content-disposition']; + if (!disposition) { + return Q.resolve([file, response]); + } + + // Since there's various security issues with parsing this header, we only + // interpret word chars plus dots, dashes and spaces + match = disposition.match(/filename=(?:"([\w\-\. ]+)")/i); + if (!match) { + // The spec defines that the filename must be in quotes, + // though a wide range of servers do not follow the rule + match = disposition.match(/filename=([\w\-\.]+)/i); + if (!match) { + return Q.resolve([file, response]); + } + } + + // Trim spaces + newFile = match[1].trim(); + + // The filename can't end with a dot because this is known + // to cause issues in Windows + // See: http://superuser.com/questions/230385/dots-at-end-of-file-name + if (mout.string.endsWith(newFile, '.')) { + return Q.resolve([file, response]); + } + + newFile = path.join(this._tempDir, newFile); + + return Q.nfcall(fs.rename, file, newFile) + .then(function () { + return [newFile, response]; + }); +}; + +UrlResolver.prototype._extract = function (file, response) { + var mimeType = response.headers['content-type']; + + if (mimeType) { + // Clean everything after ; and trim the end result + mimeType = mimeType.split(';')[0].trim(); + // Some servers add quotes around the content-type, so we trim that also + mimeType = mout.string.trim(mimeType, ['"', '\'']); + } + + if (!extract.canExtract(file, mimeType)) { + return Q.resolve(); + } + + this._logger.action('extract', path.basename(this._source), { + archive: file, + to: this._tempDir + }); + + return extract(file, this._tempDir, { + mimeType: mimeType + }); +}; + +UrlResolver.prototype._rename = function () { + return Q.nfcall(fs.readdir, this._tempDir) + .then(function (files) { + var file; + var oldPath; + var newPath; + + // Remove any OS specific files from the files array + // before checking its length + files = files.filter(junk.isnt); + + // Only rename if there's only one file and it's not the json + if (files.length === 1 && !/^(component|bower)\.json$/.test(files[0])) { + file = files[0]; + this._singleFile = 'index' + path.extname(file); + oldPath = path.join(this._tempDir, file); + newPath = path.join(this._tempDir, this._singleFile); + + return Q.nfcall(fs.rename, oldPath, newPath); + } + }.bind(this)); +}; + +UrlResolver.prototype._savePkgMeta = function (meta) { + // Store collected headers in the package meta + meta._cacheHeaders = this._collectCacheHeaders(this._response); + + // Store ETAG under _release + if (meta._cacheHeaders.ETag) { + meta._release = 'e-tag:' + mout.string.trim(meta._cacheHeaders.ETag.substr(0, 10), '"'); + } + + // Store main if is a single file + if (this._singleFile) { + meta.main = this._singleFile; + } + + return Resolver.prototype._savePkgMeta.call(this, meta); +}; + +UrlResolver.prototype._collectCacheHeaders = function (res) { + var headers = {}; + + // Collect cache headers + this.constructor._cacheHeaders.forEach(function (name) { + var value = res.headers[name.toLowerCase()]; + + if (value != null) { + headers[name] = value; + } + }); + + return headers; +}; + +UrlResolver._cacheHeaders = [ + 'Content-MD5', + 'ETag', + 'Last-Modified', + 'Content-Language', + 'Content-Length', + 'Content-Type', + 'Content-Disposition' +]; + +module.exports = UrlResolver; diff --git a/packages/Bower.1.3.11/node_modules/bower/lib/core/resolvers/index.js b/packages/Bower.1.3.11/node_modules/bower/lib/core/resolvers/index.js new file mode 100644 index 0000000..01bc18f --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/lib/core/resolvers/index.js @@ -0,0 +1,8 @@ +module.exports = { + GitFs: require('./GitFsResolver'), + GitRemote: require('./GitRemoteResolver'), + GitHub: require('./GitHubResolver'), + Svn: require('./SvnResolver'), + Fs: require('./FsResolver'), + Url: require('./UrlResolver') +}; diff --git a/packages/Bower.1.3.11/node_modules/bower/lib/core/scripts.js b/packages/Bower.1.3.11/node_modules/bower/lib/core/scripts.js new file mode 100644 index 0000000..0d5eeab --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/lib/core/scripts.js @@ -0,0 +1,96 @@ +var mout = require('mout'); +var cmd = require('../util/cmd'); +var Q = require('q'); +var shellquote = require('shell-quote'); + +var orderByDependencies = function (packages, installed, json) { + var ordered = []; + installed = mout.object.keys(installed); + + var depsSatisfied = function (packageName) { + return mout.array.difference(mout.object.keys(packages[packageName].dependencies), installed, ordered).length === 0; + }; + + var depsFromBowerJson = json && json.dependencies ? mout.object.keys(json.dependencies) : []; + var packageNames = mout.object.keys(packages); + + //get the list of the packages that are specified in bower.json in that order + //its nice to maintain that order for users + var desiredOrder = mout.array.intersection(depsFromBowerJson, packageNames); + //then add to the end any remaining packages that werent in bower.json + desiredOrder = desiredOrder.concat(mout.array.difference(packageNames, desiredOrder)); + + //the desired order isn't necessarily a correct dependency specific order + //so we ensure that below + var resolvedOne = true; + while (resolvedOne) { + + resolvedOne = false; + + for (var i = 0; i < desiredOrder.length; i++) { + var packageName = desiredOrder[i]; + if (depsSatisfied(packageName)) { + ordered.push(packageName); + mout.array.remove(desiredOrder, packageName); + //as soon as we resolve a package start the loop again + resolvedOne = true; + break; + } + } + + if (!resolvedOne && desiredOrder.length > 0) { + //if we're here then some package(s) doesn't have all its deps satisified + //so lets just jam those names on the end + ordered = ordered.concat(desiredOrder); + } + + } + + return ordered; +}; + +var run = function (cmdString, action, logger, config) { + logger.action(action, cmdString); + + //pass env + BOWER_PID so callees can identify a preinstall+postinstall from the same bower instance + var env = mout.object.mixIn({ 'BOWER_PID': process.pid }, process.env); + var args = shellquote.parse(cmdString, env); + var cmdName = args[0]; + mout.array.remove(args, cmdName); //no rest() in mout + + var options = { + cwd: config.cwd, + env: env + }; + + var promise = cmd(cmdName, args, options); + + promise.progress(function (progress) { + progress.split('\n').forEach(function (line) { + if (line) { + logger.action(action, line); + } + }); + }); + + return promise; +}; + +var hook = function (action, ordered, config, logger, packages, installed, json) { + if (mout.object.keys(packages).length === 0 || !config.scripts || !config.scripts[action]) { + /*jshint newcap: false */ + return Q(); + } + + var orderedPackages = ordered ? orderByDependencies(packages, installed, json) : mout.object.keys(packages); + var cmdString = mout.string.replace(config.scripts[action], '%', orderedPackages.join(' ')); + return run(cmdString, action, logger, config); +}; + +module.exports = { + preuninstall: mout.function.partial(hook, 'preuninstall', false), + preinstall: mout.function.partial(hook, 'preinstall', true), + postinstall: mout.function.partial(hook, 'postinstall', true), + //only exposed for test + _orderByDependencies: orderByDependencies +}; \ No newline at end of file diff --git a/packages/Bower.1.3.11/node_modules/bower/lib/index.js b/packages/Bower.1.3.11/node_modules/bower/lib/index.js new file mode 100644 index 0000000..1efed6a --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/lib/index.js @@ -0,0 +1,43 @@ +var abbrev = require('abbrev'); +var mout = require('mout'); +var commands = require('./commands'); +var pkg = require('../package.json'); + +var abbreviations = abbrev(expandNames(commands)); +abbreviations.i = 'install'; +abbreviations.rm = 'uninstall'; +abbreviations.unlink = 'uninstall'; +abbreviations.ls = 'list'; + +function expandNames(obj, prefix, stack) { + prefix = prefix || ''; + stack = stack || []; + + mout.object.forOwn(obj, function (value, name) { + name = prefix + name; + + stack.push(name); + + if (typeof value === 'object' && !value.line) { + expandNames(value, name + ' ', stack); + } + }); + + return stack; +} + +function clearRuntimeCache() { + // Note that in edge cases, some architecture components instance's + // in-memory cache might be skipped. + // If that's a problem, you should create and fresh instances instead. + var PackageRepository = require('./core/PackageRepository'); + PackageRepository.clearRuntimeCache(); +} + +module.exports = { + version: pkg.version, + commands: commands, + config: require('./config')(), + abbreviations: abbreviations, + reset: clearRuntimeCache +}; diff --git a/packages/Bower.1.3.11/node_modules/bower/lib/renderers/JsonRenderer.js b/packages/Bower.1.3.11/node_modules/bower/lib/renderers/JsonRenderer.js new file mode 100644 index 0000000..04a1ce0 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/lib/renderers/JsonRenderer.js @@ -0,0 +1,135 @@ +var chalk = require('chalk'); +var Q = require('q'); +var promptly = require('promptly'); +var createError = require('../util/createError'); + +function JsonRenderer() { + this._nrLogs = 0; +} + +JsonRenderer.prototype.end = function (data) { + if (this._nrLogs) { + process.stderr.write(']\n'); + } + + if (data) { + process.stdout.write(this._stringify(data) + '\n'); + } +}; + +JsonRenderer.prototype.error = function (err) { + var message = err.message; + var stack; + + err.id = err.code || 'error'; + err.level = 'error'; + err.data = err.data || {}; + + // Need to set message again because it is + // not enumerable in some cases + delete err.message; + err.message = message; + + // Stack + /*jshint camelcase:false*/ + stack = err.fstream_stack || err.stack || 'N/A'; + err.stacktrace = (Array.isArray(stack) ? stack.join('\n') : stack); + /*jshint camelcase:true*/ + + this.log(err); + this.end(); +}; + +JsonRenderer.prototype.log = function (log) { + if (!this._nrLogs) { + process.stderr.write('['); + } else { + process.stderr.write(', '); + } + + process.stderr.write(this._stringify(log)); + this._nrLogs++; +}; + +JsonRenderer.prototype.prompt = function (prompts) { + var promise = Q.resolve(); + var answers = {}; + var that = this; + + prompts.forEach(function (prompt) { + var opts; + var funcName; + + // Strip colors + prompt.message = chalk.stripColor(prompt.message); + + // Prompt + opts = { + silent: true, // To not mess with JSON output + trim: false, // To allow " " to not assume the default value + default: prompt.default == null ? '' : prompt.default, // If default is null, make it '' so that it does not retry + validator: !prompt.validate ? null : function (value) { + var ret = prompt.validate(value); + + if (typeof ret === 'string') { + throw ret; + } + + return value; + }, + }; + + // For now only "input", "confirm" and "password" are supported + switch (prompt.type) { + case 'input': + funcName = 'prompt'; + break; + case 'confirm': + case 'password': + funcName = prompt.type; + break; + case 'checkbox': + funcName = 'prompt'; + break; + default: + promise = promise.then(function () { + throw createError('Unknown prompt type', 'ENOTSUP'); + }); + return; + } + + promise = promise.then(function () { + // Log + prompt.level = 'prompt'; + that.log(prompt); + + return Q.nfcall(promptly[funcName], '', opts) + .then(function (answer) { + answers[prompt.name] = answer; + }); + }); + + if (prompt.type === 'checkbox') { + promise = promise.then(function () { + answers[prompt.name] = answers[prompt.name].split(','); + }); + } + }); + + return promise.then(function () { + return answers; + }); +}; + +// ------------------------- + +JsonRenderer.prototype._stringify = function (log) { + // To json + var str = JSON.stringify(log, null, ' '); + // Remove colors in case some log has colors.. + str = chalk.stripColor(str); + + return str; +}; + +module.exports = JsonRenderer; diff --git a/packages/Bower.1.3.11/node_modules/bower/lib/renderers/StandardRenderer.js b/packages/Bower.1.3.11/node_modules/bower/lib/renderers/StandardRenderer.js new file mode 100644 index 0000000..6c804c6 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/lib/renderers/StandardRenderer.js @@ -0,0 +1,495 @@ +var chalk = require('chalk'); +var path = require('path'); +var mout = require('mout'); +var archy = require('archy'); +var Q = require('q'); +var stringifyObject = require('stringify-object'); +var os = require('os'); +var pkg = require(path.join(__dirname, '../..', 'package.json')); +var template = require('../util/template'); + +function StandardRenderer(command, config) { + this._sizes = { + id: 13, // Id max chars + label: 20, // Label max chars + sumup: 5 // Amount to sum when the label exceeds + }; + this._colors = { + warn: chalk.yellow, + error: chalk.red, + conflict: chalk.magenta, + debug: chalk.gray, + default: chalk.cyan + }; + + this._command = command; + this._config = config; + + if (this.constructor._wideCommands.indexOf(command) === -1) { + this._compact = true; + } else { + this._compact = process.stdout.columns < 120; + } + + var exitOnPipeError = function (err) { + if (err.code === 'EPIPE') { + process.exit(0); + } + }; + + // It happens when piping command to "head" util + process.stdout.on('error', exitOnPipeError); + process.stderr.on('error', exitOnPipeError); +} + +StandardRenderer.prototype.end = function (data) { + var method = '_' + mout.string.camelCase(this._command); + + if (this[method]) { + this[method](data); + } +}; + +StandardRenderer.prototype.error = function (err) { + var str; + var stack; + + this._guessOrigin(err); + + err.id = err.code || 'error'; + err.level = 'error'; + + str = this._prefix(err) + ' ' + err.message.replace(/\r?\n/g, ' ').trim() + '\n'; + this._write(process.stderr, 'bower ' + str); + + // Check if additional details were provided + if (err.details) { + str = chalk.yellow('\nAdditional error details:\n') + err.details.trim() + '\n'; + this._write(process.stderr, str); + } + + // Print trace if verbose, the error has no code + // or if the error is a node error + if (this._config.verbose || !err.code || err.errno) { + /*jshint camelcase:false*/ + stack = err.fstream_stack || err.stack || 'N/A'; + str = chalk.yellow('\nStack trace:\n'); + str += (Array.isArray(stack) ? stack.join('\n') : stack) + '\n'; + str += chalk.yellow('\nConsole trace:\n'); + /*jshint camelcase:true*/ + + this._write(process.stderr, str); + console.trace(); + + // Print bower version, node version and system info. + this._write(process.stderr, chalk.yellow('\nSystem info:\n')); + this._write(process.stderr, 'Bower version: ' + pkg.version + '\n'); + this._write(process.stderr, 'Node version: ' + process.versions.node + '\n'); + this._write(process.stderr, 'OS: ' + os.type() + ' ' + os.release() + ' ' + os.arch() + '\n'); + } +}; + +StandardRenderer.prototype.log = function (log) { + var method = '_' + mout.string.camelCase(log.id) + 'Log'; + + this._guessOrigin(log); + + // Call render method for this log entry or the generic one + if (this[method]) { + this[method](log); + } else { + this._genericLog(log); + } +}; + +StandardRenderer.prototype.prompt = function (prompts) { + var deferred; + + // Strip colors from the prompt if color is disabled + if (!this._config.color) { + prompts.forEach(function (prompt) { + prompt.message = chalk.stripColor(prompt.message); + }); + } + + // Prompt + deferred = Q.defer(); + var inquirer = require('inquirer'); + inquirer.prompt(prompts, deferred.resolve); + + return deferred.promise; +}; + +// ------------------------- + +StandardRenderer.prototype._help = function (data) { + var str; + var that = this; + var specific; + + if (!data.command) { + str = template.render('std/help.std', data); + that._write(process.stdout, str); + } else { + // Check if a specific template exists for the command + specific = 'std/help-' + data.command.replace(/\s+/g, '/') + '.std'; + + if (template.exists(specific)) { + str = template.render(specific, data); + } else { + str = template.render('std/help-generic.std', data); + } + + that._write(process.stdout, str); + } +}; + +StandardRenderer.prototype._install = function (packages) { + var str = ''; + + mout.object.forOwn(packages, function (pkg) { + var cliTree; + + // List only 1 level deep dependencies + mout.object.forOwn(pkg.dependencies, function (dependency) { + dependency.dependencies = {}; + }); + // Make canonical dir relative + pkg.canonicalDir = path.relative(this._config.cwd, pkg.canonicalDir); + // Signal as root + pkg.root = true; + + cliTree = this._tree2archy(pkg); + str += '\n' + archy(cliTree); + }, this); + + if (str) { + this._write(process.stdout, str); + } +}; + +StandardRenderer.prototype._update = function (packages) { + this._install(packages); +}; + +StandardRenderer.prototype._list = function (tree) { + var cliTree; + + if (tree.pkgMeta) { + tree.root = true; + cliTree = archy(this._tree2archy(tree)); + } else { + cliTree = stringifyObject(tree, { indent: ' ' }).replace(/[{}]/g, '') + '\n'; + } + + this._write(process.stdout, cliTree); +}; + +StandardRenderer.prototype._search = function (results) { + var str = template.render('std/search-results.std', results); + this._write(process.stdout, str); +}; + +StandardRenderer.prototype._info = function (data) { + var str = ''; + var pkgMeta = data; + var includeVersions = false; + + // If the response is the whole package info, the package meta + // is under the "latest" property + if (typeof data === 'object' && data.versions) { + pkgMeta = data.latest; + includeVersions = true; + } + + // Render package meta + if (pkgMeta != null) { + str += '\n' + this._highlightJson(pkgMeta) + '\n'; + } + + // Render the versions at the end + if (includeVersions) { + str += '\n' + template.render('std/info.std', data); + } + + this._write(process.stdout, str); +}; + +StandardRenderer.prototype._lookup = function (data) { + var str = template.render('std/lookup.std', data); + + this._write(process.stdout, str); +}; + +StandardRenderer.prototype._link = function (data) { + this._sizes.id = 4; + + this.log({ + id: 'link', + level: 'info', + message: data.dst + ' > ' + data.src + }); + + // Print also a tree of the installed packages + if (data.installed) { + this._install(data.installed); + } +}; + +StandardRenderer.prototype._register = function (data) { + var str; + + // If no data passed, it means the user aborted + if (!data) { + return; + } + + str = '\n' + template.render('std/register.std', data); + this._write(process.stdout, str); +}; + +StandardRenderer.prototype._cacheList = function (entries) { + entries.forEach(function (entry) { + var pkgMeta = entry.pkgMeta; + var version = pkgMeta.version || pkgMeta._target; + this._write(process.stdout, pkgMeta.name + '=' + pkgMeta._source + '#' + version + '\n'); + }, this); +}; + +// ------------------------- + +StandardRenderer.prototype._genericLog = function (log) { + var stream; + var str; + + if (log.level === 'warn') { + stream = process.stderr; + } else { + stream = process.stdout; + } + + str = this._prefix(log) + ' ' + log.message + '\n'; + this._write(stream, 'bower ' + str); +}; + +StandardRenderer.prototype._checkoutLog = function (log) { + if (this._compact) { + log.message = log.origin.split('#')[0] + '#' + log.message; + } + + this._genericLog(log); +}; + +StandardRenderer.prototype._progressLog = function (log) { + if (this._compact) { + log.message = log.origin + ' ' + log.message; + } + + this._genericLog(log); +}; + +StandardRenderer.prototype._extractLog = function (log) { + if (this._compact) { + log.message = log.origin + ' ' + log.message; + } + + this._genericLog(log); +}; + +StandardRenderer.prototype._incompatibleLog = function (log) { + var str; + var templatePath; + + // Generate dependants string for each pick + log.data.picks.forEach(function (pick) { + pick.dependants = pick.dependants.map(function (dependant) { + var release = dependant.pkgMeta._release; + return dependant.endpoint.name + (release ? '#' + release : ''); + }).join(', '); + }); + + templatePath = log.data.suitable ? 'std/conflict-resolved.std' : 'std/conflict.std'; + str = template.render(templatePath, log.data); + + this._write(process.stdout, '\n'); + this._write(process.stdout, str); + this._write(process.stdout, '\n'); +}; + +StandardRenderer.prototype._solvedLog = function (log) { + this._incompatibleLog(log); +}; + +StandardRenderer.prototype._jsonLog = function (log) { + this._write(process.stdout, '\n' + this._highlightJson(log.data.json) + '\n\n'); +}; + +StandardRenderer.prototype._cachedEntryLog = function (log) { + if (this._compact) { + log.message = log.origin; + } + + this._genericLog(log); +}; + +// ------------------------- + +StandardRenderer.prototype._guessOrigin = function (log) { + var data = log.data; + + if (!data) { + return; + } + + if (data.endpoint) { + log.origin = data.endpoint.name || (data.registry && data.endpoint.source); + + // Resort to using the resolver name for unnamed endpoints + if (!log.origin && data.resolver) { + log.origin = data.resolver.name; + } + + if (log.origin && data.endpoint.target) { + log.origin += '#' + data.endpoint.target; + } + } else if (data.name) { + log.origin = data.name; + + if (data.version) { + log.origin += '#' + data.version; + } + } +}; + +StandardRenderer.prototype._prefix = function (log) { + var label; + var length; + var nrSpaces; + var id = this.constructor._idMappings[log.id] || log.id; + var idColor = this._colors[log.level] || this._colors.default; + + if (this._compact) { + // If there's not enough space for the id, adjust it + // for subsequent logs + if (id.length > this._sizes.id) { + this._sizes.id = id.length += this._sizes.sumup; + } + + return idColor(mout.string.rpad(id, this._sizes.id)); + } + + // Construct the label + label = log.origin || ''; + length = id.length + label.length + 1; + nrSpaces = this._sizes.id + this._sizes.label - length; + + // Ensure at least one space between the label and the id + if (nrSpaces < 1) { + // Also adjust the label size for subsequent logs + this._sizes.label = label.length + this._sizes.sumup; + nrSpaces = this._sizes.id + this._sizes.label - length; + } + + return chalk.green(label) + mout.string.repeat(' ', nrSpaces) + idColor(id); +}; + +StandardRenderer.prototype._write = function (stream, str) { + if (!this._config.color) { + str = chalk.stripColor(str); + } + + stream.write(str); +}; + +StandardRenderer.prototype._highlightJson = function (json) { + var cardinal = require('cardinal'); + + return cardinal.highlight(stringifyObject(json, { indent: ' ' }), { + theme: { + String: { + _default: function (str) { + return chalk.cyan(str); + } + }, + Identifier: { + _default: function (str) { + return chalk.green(str); + } + } + }, + json: true + }); +}; + +StandardRenderer.prototype._tree2archy = function (node) { + var dependencies = mout.object.values(node.dependencies); + var version = !node.missing ? node.pkgMeta._release || node.pkgMeta.version : null; + var label = node.endpoint.name + (version ? '#' + version : ''); + var update; + + if (node.root) { + label += ' ' + node.canonicalDir; + } + + // State labels + if (node.missing) { + label += chalk.red(' not installed'); + return label; + } + + if (node.different) { + label += chalk.red(' different'); + } + + if (node.linked) { + label += chalk.magenta(' linked'); + } + + if (node.incompatible) { + label += chalk.yellow(' incompatible') + ' with ' + node.endpoint.target; + } else if (node.extraneous) { + label += chalk.green(' extraneous'); + } + + // New versions + if (node.update) { + update = ''; + + if (node.update.target && node.pkgMeta.version !== node.update.target) { + update += node.update.target + ' available'; + } + + if (node.update.latest !== node.update.target) { + update += (update ? ', ' : ''); + update += 'latest is ' + node.update.latest; + } + + if (update) { + label += ' (' + chalk.cyan(update) + ')'; + } + } + + if (!dependencies.length) { + return label; + } + + return { + label: label, + nodes: mout.object.values(dependencies).map(this._tree2archy, this) + }; +}; + +StandardRenderer._wideCommands = [ + 'install', + 'update', + 'link', + 'info', + 'home', + 'register' +]; +StandardRenderer._idMappings = { + 'mutual': 'conflict', + 'cached-entry': 'cached' +}; + +module.exports = StandardRenderer; diff --git a/packages/Bower.1.3.11/node_modules/bower/lib/renderers/index.js b/packages/Bower.1.3.11/node_modules/bower/lib/renderers/index.js new file mode 100644 index 0000000..04bdb1f --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/lib/renderers/index.js @@ -0,0 +1,4 @@ +module.exports = { + Json: require('./JsonRenderer'), + Standard: require('./StandardRenderer') +}; diff --git a/packages/Bower.1.3.11/node_modules/bower/lib/util/analytics.js b/packages/Bower.1.3.11/node_modules/bower/lib/util/analytics.js new file mode 100644 index 0000000..1262ccc --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/lib/util/analytics.js @@ -0,0 +1,88 @@ +var Q = require('q'); +var mout = require('mout'); + +var analytics = module.exports; + +var insight; + +// Insight takes long to load, and often causes problems +// in non-interactive environment, so we load it lazily +function ensureInsight () { + if (!insight) { + var Insight = require('insight'); + var pkg = require('../../package.json'); + insight = new Insight({ + trackingCode: 'UA-43531210-1', + packageName: pkg.name, + packageVersion: pkg.version + }); + } +} + +// Initializes the application-wide insight singleton and asks for the +// permission on the CLI during the first run. +analytics.setup = function setup (config) { + var deferred = Q.defer(); + + // if `analytics` hasn't been explicitly set + if (config.analytics == null) { + ensureInsight(); + + // if there is a stored value + if (insight.optOut !== undefined) { + // set analytics to the stored value + config.analytics = !insight.optOut; + deferred.resolve(); + } else { + if (config.interactive) { + insight.askPermission(null, function(err, optIn) { + // optIn callback param was exactly opposite before 0.4.3 + // so we force at least insight@0.4.3 in package.json + config.analytics = optIn; + deferred.resolve(); + }); + } else { + // no specified value, no stored value, and can't prompt for one + // so set analytics to true + config.analytics = true; + deferred.resolve(); + } + } + } else { + // use the specified value + deferred.resolve(); + } + + return deferred.promise; +}; + +var Tracker = analytics.Tracker = function Tracker(config) { + if (!config.analytics) { + this.track = function noop() {}; + } +}; + +Tracker.prototype.track = function track() { + ensureInsight(); + + insight.track.apply(insight, arguments); +}; + +Tracker.prototype.trackDecomposedEndpoints = function trackDecomposedEndpoints(command, endpoints) { + endpoints.forEach(function (endpoint) { + this.track(command, endpoint.source, endpoint.target); + }.bind(this)); +}; + +Tracker.prototype.trackPackages = function trackPackages(command, packages) { + mout.object.forOwn(packages, function (package) { + var meta = package.pkgMeta; + this.track(command, meta.name, meta.version); + }.bind(this)); +}; + +Tracker.prototype.trackNames = function trackNames(command, names) { + names.forEach(function (name) { + this.track(command, name); + }.bind(this)); +}; diff --git a/packages/Bower.1.3.11/node_modules/bower/lib/util/cli.js b/packages/Bower.1.3.11/node_modules/bower/lib/util/cli.js new file mode 100644 index 0000000..a537c75 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/lib/util/cli.js @@ -0,0 +1,49 @@ +var mout = require('mout'); +var nopt = require('nopt'); +var renderers = require('../renderers'); + +function readOptions(options, argv) { + var types; + var noptOptions; + var parsedOptions = {}; + var shorthands = {}; + + if (Array.isArray(options)) { + argv = options; + options = {}; + } else { + options = options || {}; + } + + types = mout.object.map(options, function (option) { + return option.type; + }); + mout.object.forOwn(options, function (option, name) { + shorthands[option.shorthand] = '--' + name; + }); + + noptOptions = nopt(types, shorthands, argv); + + // Filter only the specified options because nopt parses every -- + // Also make them camel case + mout.object.forOwn(noptOptions, function (value, key) { + if (options[key]) { + parsedOptions[mout.string.camelCase(key)] = value; + } + }); + + parsedOptions.argv = noptOptions.argv; + + return parsedOptions; +} + +function getRenderer(command, json, config) { + if (config.json || json) { + return new renderers.Json(command, config); + } + + return new renderers.Standard(command, config); +} + +module.exports.readOptions = readOptions; +module.exports.getRenderer = getRenderer; diff --git a/packages/Bower.1.3.11/node_modules/bower/lib/util/cmd.js b/packages/Bower.1.3.11/node_modules/bower/lib/util/cmd.js new file mode 100644 index 0000000..aa59fad --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/lib/util/cmd.js @@ -0,0 +1,120 @@ +var cp = require('child_process'); +var path = require('path'); +var Q = require('q'); +var mout = require('mout'); +var which = require('which'); +var PThrottler = require('p-throttler'); +var createError = require('./createError'); + +// The concurrency limit here is kind of magic. You don't really gain a lot from +// having a large number of commands spawned at once, so it isn't super +// important for this number to be large. Reports have shown that much more than 5 +// or 10 cause issues for corporate networks, private repos or situations where +// internet bandwidth is limited. We're running with a concurrency of 5 until +// 1.4.X is released, at which time we'll move to what was discussed in #1262 +// https://github.com/bower/bower/pull/1262 +var throttler = new PThrottler(5); + +var winBatchExtensions; +var winWhichCache; +var isWin = process.platform === 'win32'; + +if (isWin) { + winBatchExtensions = ['.bat', '.cmd']; + winWhichCache = {}; +} + +function getWindowsCommand(command) { + var fullCommand; + var extension; + + // Do we got the value converted in the cache? + if (mout.object.hasOwn(winWhichCache, command)) { + return winWhichCache[command]; + } + + // Use which to retrieve the full command, which puts the extension in the end + try { + fullCommand = which.sync(command); + } catch (err) { + return winWhichCache[command] = command; + } + + extension = path.extname(fullCommand).toLowerCase(); + + // Does it need to be converted? + if (winBatchExtensions.indexOf(extension) === -1) { + return winWhichCache[command] = command; + } + + return winWhichCache[command] = fullCommand; +} + +// Executes a shell command, buffering the stdout and stderr +// If an error occurs, a meaningful error is generated +// Returns a promise that gets fulfilled if the command succeeds +// or rejected if it fails +function executeCmd(command, args, options) { + var process; + var stderr = ''; + var stdout = ''; + var deferred = Q.defer(); + + // Windows workaround for .bat and .cmd files, see #626 + if (isWin) { + command = getWindowsCommand(command); + } + + // Buffer output, reporting progress + process = cp.spawn(command, args, options); + process.stdout.on('data', function (data) { + data = data.toString(); + deferred.notify(data); + stdout += data; + }); + process.stderr.on('data', function (data) { + data = data.toString(); + deferred.notify(data); + stderr += data; + }); + + // If there is an error spawning the command, reject the promise + process.on('error', function (error) { + return deferred.reject(error); + }); + + // Listen to the close event instead of exit + // They are similar but close ensures that streams are flushed + process.on('close', function (code) { + var fullCommand; + var error; + + if (code) { + // Generate the full command to be presented in the error message + if (!Array.isArray(args)) { + args = []; + } + + fullCommand = command; + fullCommand += args.length ? ' ' + args.join(' ') : ''; + + // Build the error instance + error = createError('Failed to execute "' + fullCommand + '", exit code of #' + code, 'ECMDERR', { + details: stderr, + exitCode: code + }); + + return deferred.reject(error); + } + + return deferred.resolve([stdout, stderr]); + }); + + return deferred.promise; +} + +function cmd(command, args, options) { + return throttler.enqueue(executeCmd.bind(null, command, args, options)); +} + +module.exports = cmd; diff --git a/packages/Bower.1.3.11/node_modules/bower/lib/util/copy.js b/packages/Bower.1.3.11/node_modules/bower/lib/util/copy.js new file mode 100644 index 0000000..a0fb10d --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/lib/util/copy.js @@ -0,0 +1,114 @@ +var fstream = require('fstream'); +var fstreamIgnore = require('fstream-ignore'); +var fs = require('graceful-fs'); +var Q = require('q'); + +function copy(reader, writer) { + var deferred; + var ignore; + + // Filter symlinks because they are not 100% portable, specially + // when linking between different drives + // Following can't be enabled either because symlinks that reference + // another symlinks will get filtered + // See: https://github.com/bower/bower/issues/699 + reader.filter = filterSymlinks; + reader.follow = false; + + if (reader.type === 'Directory' && reader.ignore) { + ignore = reader.ignore; + reader = fstreamIgnore(reader); + reader.addIgnoreRules(ignore); + } else { + reader = fstream.Reader(reader); + } + + deferred = Q.defer(); + + reader + .on('error', deferred.reject) + // Pipe to writer + .pipe(fstream.Writer(writer)) + .on('error', deferred.reject) + .on('close', deferred.resolve); + + return deferred.promise; +} + +function copyMode(src, dst) { + return Q.nfcall(fs.stat, src) + .then(function (stat) { + return Q.nfcall(fs.chmod, dst, stat.mode); + }); +} + +function filterSymlinks(entry) { + return entry.type !== 'SymbolicLink'; +} + +function parseOptions(opts) { + opts = opts || {}; + + if (opts.mode != null) { + opts.copyMode = false; + } else if (opts.copyMode == null) { + opts.copyMode = true; + } + + return opts; +} + +// --------------------- + +// Available options: +// - mode: force final mode of dst (defaults to null) +// - copyMode: copy mode of src to dst, only if mode is not specified (defaults to true) +function copyFile(src, dst, opts) { + var promise; + + opts = parseOptions(opts); + + promise = copy({ + path: src, + type: 'File' + }, { + path: dst, + mode: opts.mode, + type: 'File' + }); + + if (opts.copyMode) { + promise = promise.then(copyMode.bind(copyMode, src, dst)); + } + + return promise; +} + +// Available options: +// - ignore: array of patterns to be ignored (defaults to null) +// - mode: force final mode of dst (defaults to null) +// - copyMode: copy mode of src to dst, only if mode is not specified (defaults to true) +function copyDir(src, dst, opts) { + var promise; + + opts = parseOptions(opts); + + promise = copy({ + path: src, + type: 'Directory', + ignore: opts.ignore + }, { + path: dst, + mode: opts.mode, + type: 'Directory' + }); + + if (opts.copyMode) { + promise = promise.then(copyMode.bind(copyMode, src, dst)); + } + + return promise; +} + +module.exports.copyDir = copyDir; +module.exports.copyFile = copyFile; diff --git a/packages/Bower.1.3.11/node_modules/bower/lib/util/createError.js b/packages/Bower.1.3.11/node_modules/bower/lib/util/createError.js new file mode 100644 index 0000000..6aef2f0 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/lib/util/createError.js @@ -0,0 +1,14 @@ +var mout = require('mout'); + +function createError(msg, code, props) { + var err = new Error(msg); + err.code = code; + + if (props) { + mout.object.mixIn(err, props); + } + + return err; +} + +module.exports = createError; diff --git a/packages/Bower.1.3.11/node_modules/bower/lib/util/createLink.js b/packages/Bower.1.3.11/node_modules/bower/lib/util/createLink.js new file mode 100644 index 0000000..f2c26d7 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/lib/util/createLink.js @@ -0,0 +1,50 @@ +var fs = require('graceful-fs'); +var path = require('path'); +var Q = require('q'); +var mkdirp = require('mkdirp'); +var createError = require('./createError'); + +var isWin = process.platform === 'win32'; + +function createLink(src, dst, type) { + var dstDir = path.dirname(dst); + + // Create directory + return Q.nfcall(mkdirp, dstDir) + // Check if source exists + .then(function () { + return Q.nfcall(fs.stat, src) + .fail(function (error) { + if (error.code === 'ENOENT') { + throw createError('Failed to create link to ' + path.basename(src), 'ENOENT', { + details: src + ' does not exist or points to a non-existent file' + }); + } + + throw error; + }); + }) + // Create symlink + .then(function (stat) { + type = type || (stat.isDirectory() ? 'dir' : 'file'); + + return Q.nfcall(fs.symlink, src, dst, type) + .fail(function (err) { + if (!isWin || err.code !== 'EPERM') { + throw err; + } + + // Try with type "junction" on Windows + // Junctions behave equally to true symlinks and can be created in + // non elevated terminal (well, not always..) + return Q.nfcall(fs.symlink, src, dst, 'junction') + .fail(function (err) { + throw createError('Unable to create link to ' + path.basename(src), err.code, { + details: err.message.trim() + '\n\nTry running this command in an elevated terminal (run as root/administrator).' + }); + }); + }); + }); +} + +module.exports = createLink; diff --git a/packages/Bower.1.3.11/node_modules/bower/lib/util/download.js b/packages/Bower.1.3.11/node_modules/bower/lib/util/download.js new file mode 100644 index 0000000..c7c71d7 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/lib/util/download.js @@ -0,0 +1,109 @@ +var progress = require('request-progress'); +var request = require('request'); +var Q = require('q'); +var mout = require('mout'); +var retry = require('retry'); +var fs = require('graceful-fs'); +var createError = require('./createError'); + +var errorCodes = [ + 'EADDRINFO', + 'ETIMEDOUT', + 'ECONNRESET', + 'ESOCKETTIMEDOUT' +]; + +function download(url, file, options) { + var operation; + var response; + var deferred = Q.defer(); + var progressDelay = 8000; + + options = mout.object.mixIn({ + retries: 5, + factor: 2, + minTimeout: 1000, + maxTimeout: 35000, + randomize: true + }, options || {}); + + // Retry on network errors + operation = retry.operation(options); + operation.attempt(function () { + var req; + var writeStream; + var contentLength; + var bytesDownloaded = 0; + + req = progress(request(url, options), { + delay: progressDelay + }) + .on('response', function (res) { + var status = res.statusCode; + + if (status < 200 || status >= 300) { + return deferred.reject(createError('Status code of ' + status, 'EHTTP')); + } + + response = res; + contentLength = Number(res.headers['content-length']); + }) + .on('data', function (data) { + bytesDownloaded += data.length; + }) + .on('progress', function (state) { + deferred.notify(state); + }) + .on('end', function () { + // Check if the whole file was downloaded + // In some unstable connections the ACK/FIN packet might be sent in the + // middle of the download + // See: https://github.com/joyent/node/issues/6143 + if (contentLength && bytesDownloaded < contentLength) { + req.emit('error', createError('Transfer closed with ' + (contentLength - bytesDownloaded) + ' bytes remaining to read', 'EINCOMPLETE')); + } + }) + .on('error', function (error) { + var timeout = operation._timeouts[0]; + + // Reject if error is not a network error + if (errorCodes.indexOf(error.code) === -1) { + return deferred.reject(error); + } + + // Next attempt will start reporting download progress immediately + progressDelay = 0; + + // Check if there are more retries + if (operation.retry(error)) { + // Ensure that there are no more events from this request + req.removeAllListeners(); + req.on('error', function () {}); + // Ensure that there are no more events from the write stream + writeStream.removeAllListeners(); + writeStream.on('error', function () {}); + + return deferred.notify({ + retry: true, + delay: timeout, + error: error + }); + } + + // No more retries, reject! + deferred.reject(error); + }); + + // Pipe read stream to write stream + writeStream = req + .pipe(fs.createWriteStream(file)) + .on('error', deferred.reject) + .on('close', function () { + deferred.resolve(response); + }); + }); + + return deferred.promise; +} + +module.exports = download; diff --git a/packages/Bower.1.3.11/node_modules/bower/lib/util/extract.js b/packages/Bower.1.3.11/node_modules/bower/lib/util/extract.js new file mode 100644 index 0000000..580c566 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/lib/util/extract.js @@ -0,0 +1,228 @@ +var path = require('path'); +var fs = require('graceful-fs'); +var zlib = require('zlib'); +var DecompressZip = require('decompress-zip'); +var tar = require('tar-fs'); +var Q = require('q'); +var mout = require('mout'); +var junk = require('junk'); +var createError = require('./createError'); + +// This forces the default chunk size to something small in an attempt +// to avoid issue #314 +zlib.Z_DEFAULT_CHUNK = 1024 * 8; + +var extractors; +var extractorTypes; + +extractors = { + '.zip': extractZip, + '.tar': extractTar, + '.tar.gz': extractTarGz, + '.tgz': extractTarGz, + '.gz': extractGz, + 'application/zip': extractZip, + 'application/x-zip': extractZip, + 'application/x-zip-compressed': extractZip, + 'application/x-tar': extractTar, + 'application/x-tgz': extractTarGz, + 'application/x-gzip': extractGz +}; + +extractorTypes = Object.keys(extractors); + +function extractZip(archive, dst) { + var deferred = Q.defer(); + + new DecompressZip(archive) + .on('error', deferred.reject) + .on('extract', deferred.resolve.bind(deferred, dst)) + .extract({ + path: dst, + follow: false, // Do not follow symlinks (#699) + filter: filterSymlinks // Filter symlink files + }); + + return deferred.promise; +} + +function extractTar(archive, dst) { + var deferred = Q.defer(); + + fs.createReadStream(archive) + .on('error', deferred.reject) + .pipe(tar.extract(dst, { + ignore: isSymlink // Filter symlink files + })) + .on('error', deferred.reject) + .on('finish', deferred.resolve.bind(deferred, dst)); + + return deferred.promise; +} + +function extractTarGz(archive, dst) { + var deferred = Q.defer(); + + fs.createReadStream(archive) + .on('error', deferred.reject) + .pipe(zlib.createGunzip()) + .on('error', deferred.reject) + .pipe(tar.extract(dst, { + ignore: isSymlink // Filter symlink files + })) + .on('error', deferred.reject) + .on('finish', deferred.resolve.bind(deferred, dst)); + + return deferred.promise; +} + +function extractGz(archive, dst) { + var deferred = Q.defer(); + + fs.createReadStream(archive) + .on('error', deferred.reject) + .pipe(zlib.createGunzip()) + .on('error', deferred.reject) + .pipe(fs.createWriteStream(dst)) + .on('error', deferred.reject) + .on('close', deferred.resolve.bind(deferred, dst)); + + return deferred.promise; +} + +function isSymlink(entry) { + return entry.type === 'SymbolicLink'; +} + +function filterSymlinks(entry) { + return entry.type !== 'SymbolicLink'; +} + +function getExtractor(archive) { + // Make the archive lower case to match against the types + // This ensures that upper-cased extensions work + archive = archive.toLowerCase(); + + var type = mout.array.find(extractorTypes, function (type) { + return mout.string.endsWith(archive, type); + }); + + return type ? extractors[type] : null; +} + +function isSingleDir(dir) { + return Q.nfcall(fs.readdir, dir) + .then(function (files) { + var singleDir; + + // Remove any OS specific files from the files array + // before checking its length + files = files.filter(junk.isnt); + + if (files.length !== 1) { + return false; + } + + singleDir = path.join(dir, files[0]); + + return Q.nfcall(fs.stat, singleDir) + .then(function (stat) { + return stat.isDirectory() ? singleDir : false; + }); + }); +} + +function moveSingleDirContents(dir) { + var destDir = path.dirname(dir); + + return Q.nfcall(fs.readdir, dir) + .then(function (files) { + var promises; + + promises = files.map(function (file) { + var src = path.join(dir, file); + var dst = path.join(destDir, file); + + return Q.nfcall(fs.rename, src, dst); + }); + + return Q.all(promises); + }) + .then(function () { + return Q.nfcall(fs.rmdir, dir); + }); +} + +// ----------------------------- + +function canExtract(src, mimeType) { + if (mimeType && mimeType !== 'application/octet-stream') { + return !!getExtractor(mimeType); + } + + return !!getExtractor(src); +} + +// Available options: +// - keepArchive: true to keep the archive afterwards (defaults to false) +// - keepStructure: true to keep the extracted structure unchanged (defaults to false) +function extract(src, dst, opts) { + var extractor; + var promise; + + opts = opts || {}; + extractor = getExtractor(src); + + // Try to get extractor from mime type + if (!extractor && opts.mimeType) { + extractor = getExtractor(opts.mimeType); + } + + // If extractor is null, then the archive type is unknown + if (!extractor) { + return Q.reject(createError('File ' + src + ' is not a known archive', 'ENOTARCHIVE')); + } + + // Check archive file size + promise = Q.nfcall(fs.stat, src) + .then(function (stat) { + if (stat.size <= 8) { + throw createError('File ' + src + ' is an invalid archive', 'ENOTARCHIVE'); + } + + // Extract archive + return extractor(src, dst); + }); + + // TODO: There's an issue here if the src and dst are the same and + // The zip name is the same as some of the zip file contents + // Maybe create a temp directory inside dst, unzip it there, + // unlink zip and then move contents + + // Remove archive + if (!opts.keepArchive) { + promise = promise + .then(function () { + return Q.nfcall(fs.unlink, src); + }); + } + + // Move contents if a single directory was extracted + if (!opts.keepStructure) { + promise = promise + .then(function () { + return isSingleDir(dst); + }) + .then(function (singleDir) { + return singleDir ? moveSingleDirContents(singleDir) : null; + }); + } + + // Resolve promise to the dst dir + return promise.then(function () { + return dst; + }); +} + +module.exports = extract; +module.exports.canExtract = canExtract; diff --git a/packages/Bower.1.3.11/node_modules/bower/lib/util/md5.js b/packages/Bower.1.3.11/node_modules/bower/lib/util/md5.js new file mode 100644 index 0000000..dbc920b --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/lib/util/md5.js @@ -0,0 +1,7 @@ +var crypto = require('crypto'); + +function md5(contents) { + return crypto.createHash('md5').update(contents).digest('hex'); +} + +module.exports = md5; diff --git a/packages/Bower.1.3.11/node_modules/bower/lib/util/readJson.js b/packages/Bower.1.3.11/node_modules/bower/lib/util/readJson.js new file mode 100644 index 0000000..41fe799 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/lib/util/readJson.js @@ -0,0 +1,43 @@ +var path = require('path'); +var bowerJson = require('bower-json'); +var Q = require('q'); + +// The valid options are the same as bower-json#readFile. +// If the "assume" option is passed, it will be used if no json file was found + +// This promise is resolved with [json, deprecated, assumed] +// - json: The read json +// - deprecated: The deprecated filename being used or false otherwise +// - assumed: True if a dummy json was returned if no json file was found, false otherwise +function readJson(file, options) { + options = options || {}; + + // Read + return Q.nfcall(bowerJson.read, file, options) + .spread(function (json, jsonFile) { + var deprecated; + + jsonFile = path.basename(jsonFile); + deprecated = jsonFile === 'component.json' ? jsonFile : false; + + return [json, deprecated, false]; + }, function (err) { + // No json file was found, assume one + if (err.code === 'ENOENT' && options.assume) { + return [bowerJson.parse(options.assume, options), false, true]; + } + + err.details = err.message; + + if (err.file) { + err.message = 'Failed to read ' + err.file; + err.data = { filename: err.file }; + } else { + err.message = 'Failed to read json from ' + file; + } + + throw err; + }); +} + +module.exports = readJson; diff --git a/packages/Bower.1.3.11/node_modules/bower/lib/util/removeIgnores.js b/packages/Bower.1.3.11/node_modules/bower/lib/util/removeIgnores.js new file mode 100644 index 0000000..1405bdb --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/lib/util/removeIgnores.js @@ -0,0 +1,66 @@ +var path = require('path'); +var rimraf = require('rimraf'); +var fstreamIgnore = require('fstream-ignore'); +var mout = require('mout'); +var Q = require('q'); + +function removeIgnores(dir, meta) { + var reader; + var applyIgnores; + var deferred = Q.defer(); + var ignored = []; + var nonIgnored = ['bower.json']; + + // Don't ignore main files + nonIgnored = nonIgnored.concat(meta.main || []); + + nonIgnored = nonIgnored.map(function (file) { + return path.join(dir, file); + }); + + reader = fstreamIgnore({ + path: dir, + type: 'Directory' + }); + + reader.addIgnoreRules(meta.ignore || []); + + // Monkey patch applyIgnores such that we get hold of all ignored files + applyIgnores = reader.applyIgnores; + reader.applyIgnores = function (entry) { + var ret = applyIgnores.apply(this, arguments); + + if (!ret) { + ignored.push(path.join(dir, entry)); + } + + return ret; + }; + + reader + .on('child', function (entry) { + nonIgnored.push(entry.path); + }) + .on('error', deferred.reject) + .on('end', function () { + var promises; + + // Ensure that we are not ignoring files that should not be ignored! + ignored = mout.array.unique(ignored); + ignored = ignored.filter(function (file) { + return nonIgnored.indexOf(file) === -1; + }); + + // Delete all the ignored files + promises = ignored.map(function (file) { + return Q.nfcall(rimraf, file); + }); + + return Q.all(promises) + .then(deferred.resolve, deferred.reject); + }); + + return deferred.promise; +} + +module.exports = removeIgnores; diff --git a/packages/Bower.1.3.11/node_modules/bower/lib/util/rootCheck.js b/packages/Bower.1.3.11/node_modules/bower/lib/util/rootCheck.js new file mode 100644 index 0000000..9f91b51 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/lib/util/rootCheck.js @@ -0,0 +1,32 @@ +/*jshint multistr:true*/ +'use strict'; +var isRoot = require('is-root'); +var createError = require('./createError'); +var cli = require('./cli'); + +var renderer; + +function rootCheck(options, config) { + var errorMsg; + + // Allow running the command as root + if (options.allowRoot || config.allowRoot) { + return; + } + + errorMsg = 'Since bower is a user command, there is no need to execute it with \ +superuser permissions.\nIf you\'re having permission errors when using bower without \ +sudo, please spend a few minutes learning more about how your system should work and \ +make any necessary repairs.\n\n\ +http://www.joyent.com/blog/installing-node-and-npm\n\ +https://gist.github.com/isaacs/579814\n\n\ +You can however run a command with sudo using --allow-root option'; + + if (isRoot()) { + renderer = cli.getRenderer('', false, config); + renderer.error(createError('Cannot be run with sudo', 'ESUDO', { details : errorMsg })); + process.exit(1); + } +} + +module.exports = rootCheck; diff --git a/packages/Bower.1.3.11/node_modules/bower/lib/util/semver.js b/packages/Bower.1.3.11/node_modules/bower/lib/util/semver.js new file mode 100644 index 0000000..d0a1953 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/lib/util/semver.js @@ -0,0 +1,74 @@ +var semver = require('semver'); +var mout = require('mout'); + +function maxSatisfying(versions, range, strictMatch) { + var version; + var filteredVersions; + + // Filter only valid versions, since semver.maxSatisfying() throws an error + versions = versions.filter(function (version) { + return semver.valid(version); + }); + + // Exact version & range match + if (semver.valid(range)) { + version = mout.array.find(versions, function (version) { + return version === range; + }); + if (version) { + return version; + } + } + + range = typeof range === 'string' ? range.trim() : range; + + // When strict match is enabled give priority to non-pre-releases + // We do this by filtering every pre-release version + if (strictMatch) { + filteredVersions = versions.map(function (version) { + return !isPreRelease(version) ? version : null; + }); + + version = semver.maxSatisfying(filteredVersions, range); + if (version) { + return version; + } + } + + // Fallback to regular semver max satisfies + return semver.maxSatisfying(versions, range); +} + +function maxSatisfyingIndex(versions, range, strictMatch) { + var version = maxSatisfying(versions, range, strictMatch); + + if (!version) { + return -1; + } + + return versions.indexOf(version); +} + +function clean(version) { + var parsed = semver.parse(version); + + if (!parsed) { + return null; + } + + // Keep builds! + return parsed.version + (parsed.build.length ? '+' + parsed.build.join('.') : ''); +} + +function isPreRelease(version) { + var parsed = semver.parse(version); + return parsed && parsed.prerelease && parsed.prerelease.length; +} + +// Export a semver like object but with our custom functions +mout.object.mixIn(module.exports, semver, { + maxSatisfying: maxSatisfying, + maxSatisfyingIndex: maxSatisfyingIndex, + clean: clean, + valid: clean +}); diff --git a/packages/Bower.1.3.11/node_modules/bower/lib/util/template.js b/packages/Bower.1.3.11/node_modules/bower/lib/util/template.js new file mode 100644 index 0000000..4fd012c --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/lib/util/template.js @@ -0,0 +1,44 @@ +var path = require('path'); +var fs = require('graceful-fs'); +var Handlebars = require('handlebars'); +var mout = require('mout'); +var helpers = require('../../templates/helpers'); + +var templatesDir = path.resolve(__dirname, '../../templates'); +var cache = {}; + +// Register helpers +mout.object.forOwn(helpers, function (register) { + register(Handlebars); +}); + +function render(name, data, escape) { + var contents; + + // Check if already compiled + if (cache[name]) { + return cache[name](data); + } + + // Otherwise, read the file, compile and cache + contents = fs.readFileSync(path.join(templatesDir, name)).toString(); + cache[name] = Handlebars.compile(contents, { + noEscape: !escape + }); + + // Call the function again + return render(name, data, escape); +} + +function exists(name) { + if (cache[name]) { + return true; + } + + return fs.existsSync(path.join(templatesDir, name)); +} + +module.exports = { + render: render, + exists: exists +}; diff --git a/packages/Bower.1.3.11/node_modules/bower/lib/util/validLink.js b/packages/Bower.1.3.11/node_modules/bower/lib/util/validLink.js new file mode 100644 index 0000000..5191556 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/lib/util/validLink.js @@ -0,0 +1,24 @@ +var Q = require('q'); +var fs = require('graceful-fs'); + +function validLink(file) { + // Ensures that a file is a symlink that points + // to a valid file + return Q.nfcall(fs.lstat, file) + .then(function (lstat) { + if (!lstat.isSymbolicLink()) { + return [false]; + } + + return Q.nfcall(fs.stat, file) + .then(function (stat) { + return [stat]; + }); + }) + .fail(function (err) { + return [false, err]; + }); +} + +module.exports = validLink; + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/abbrev/abbrev.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/abbrev/abbrev.js new file mode 100644 index 0000000..69cfeac --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/abbrev/abbrev.js @@ -0,0 +1,62 @@ + +module.exports = exports = abbrev.abbrev = abbrev + +abbrev.monkeyPatch = monkeyPatch + +function monkeyPatch () { + Object.defineProperty(Array.prototype, 'abbrev', { + value: function () { return abbrev(this) }, + enumerable: false, configurable: true, writable: true + }) + + Object.defineProperty(Object.prototype, 'abbrev', { + value: function () { return abbrev(Object.keys(this)) }, + enumerable: false, configurable: true, writable: true + }) +} + +function abbrev (list) { + if (arguments.length !== 1 || !Array.isArray(list)) { + list = Array.prototype.slice.call(arguments, 0) + } + for (var i = 0, l = list.length, args = [] ; i < l ; i ++) { + args[i] = typeof list[i] === "string" ? list[i] : String(list[i]) + } + + // sort them lexicographically, so that they're next to their nearest kin + args = args.sort(lexSort) + + // walk through each, seeing how much it has in common with the next and previous + var abbrevs = {} + , prev = "" + for (var i = 0, l = args.length ; i < l ; i ++) { + var current = args[i] + , next = args[i + 1] || "" + , nextMatches = true + , prevMatches = true + if (current === next) continue + for (var j = 0, cl = current.length ; j < cl ; j ++) { + var curChar = current.charAt(j) + nextMatches = nextMatches && curChar === next.charAt(j) + prevMatches = prevMatches && curChar === prev.charAt(j) + if (!nextMatches && !prevMatches) { + j ++ + break + } + } + prev = current + if (j === cl) { + abbrevs[current] = current + continue + } + for (var a = current.substr(0, j) ; j <= cl ; j ++) { + abbrevs[a] = current + a += current.charAt(j) + } + } + return abbrevs +} + +function lexSort (a, b) { + return a === b ? 0 : a > b ? 1 : -1 +} diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/abbrev/package.json b/packages/Bower.1.3.11/node_modules/bower/node_modules/abbrev/package.json new file mode 100644 index 0000000..33e48fd --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/abbrev/package.json @@ -0,0 +1,46 @@ +{ + "name": "abbrev", + "version": "1.0.5", + "description": "Like ruby's abbrev module, but in js", + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me" + }, + "main": "abbrev.js", + "scripts": { + "test": "node test.js" + }, + "repository": { + "type": "git", + "url": "http://github.com/isaacs/abbrev-js" + }, + "license": { + "type": "MIT", + "url": "https://github.com/isaacs/abbrev-js/raw/master/LICENSE" + }, + "bugs": { + "url": "https://github.com/isaacs/abbrev-js/issues" + }, + "homepage": "https://github.com/isaacs/abbrev-js", + "_id": "abbrev@1.0.5", + "_shasum": "5d8257bd9ebe435e698b2fa431afde4fe7b10b03", + "_from": "abbrev@~1.0.4", + "_npmVersion": "1.4.7", + "_npmUser": { + "name": "isaacs", + "email": "i@izs.me" + }, + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + } + ], + "dist": { + "shasum": "5d8257bd9ebe435e698b2fa431afde4fe7b10b03", + "tarball": "http://registry.npmjs.org/abbrev/-/abbrev-1.0.5.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.0.5.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/archy/index.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/archy/index.js new file mode 100644 index 0000000..869d64e --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/archy/index.js @@ -0,0 +1,35 @@ +module.exports = function archy (obj, prefix, opts) { + if (prefix === undefined) prefix = ''; + if (!opts) opts = {}; + var chr = function (s) { + var chars = { + '│' : '|', + '└' : '`', + '├' : '+', + '─' : '-', + '┬' : '-' + }; + return opts.unicode === false ? chars[s] : s; + }; + + if (typeof obj === 'string') obj = { label : obj }; + + var nodes = obj.nodes || []; + var lines = (obj.label || '').split('\n'); + var splitter = '\n' + prefix + (nodes.length ? chr('│') : ' ') + ' '; + + return prefix + + lines.join(splitter) + '\n' + + nodes.map(function (node, ix) { + var last = ix === nodes.length - 1; + var more = node.nodes && node.nodes.length; + var prefix_ = prefix + (last ? ' ' : chr('│')) + ' '; + + return prefix + + (last ? chr('└') : chr('├')) + chr('─') + + (more ? chr('┬') : chr('─')) + ' ' + + archy(node, prefix_, opts).slice(prefix.length + 2) + ; + }).join('') + ; +}; diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/archy/package.json b/packages/Bower.1.3.11/node_modules/bower/node_modules/archy/package.json new file mode 100644 index 0000000..14002da --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/archy/package.json @@ -0,0 +1,69 @@ +{ + "name": "archy", + "version": "0.0.2", + "description": "render nested hierarchies `npm ls` style with unicode pipes", + "main": "index.js", + "directories": { + "lib": ".", + "example": "example", + "test": "test" + }, + "devDependencies": { + "tap": "~0.2.3" + }, + "scripts": { + "test": "tap test" + }, + "repository": { + "type": "git", + "url": "git://github.com/substack/node-archy.git" + }, + "keywords": [ + "hierarchy", + "npm ls", + "unicode", + "pretty", + "print" + ], + "author": { + "name": "James Halliday", + "email": "mail@substack.net", + "url": "http://substack.net" + }, + "license": "MIT/X11", + "engine": { + "node": ">=0.4" + }, + "_npmUser": { + "name": "substack", + "email": "mail@substack.net" + }, + "_id": "archy@0.0.2", + "dependencies": {}, + "engines": { + "node": "*" + }, + "_engineSupported": true, + "_npmVersion": "1.0.106", + "_nodeVersion": "v0.4.12", + "_defaultsLoaded": true, + "dist": { + "shasum": "910f43bf66141fc335564597abc189df44b3d35e", + "tarball": "http://registry.npmjs.org/archy/-/archy-0.0.2.tgz" + }, + "maintainers": [ + { + "name": "substack", + "email": "mail@substack.net" + } + ], + "_shasum": "910f43bf66141fc335564597abc189df44b3d35e", + "_from": "archy@0.0.2", + "_resolved": "https://registry.npmjs.org/archy/-/archy-0.0.2.tgz", + "readme": "archy\n=====\n\nRender nested hierarchies `npm ls` style with unicode pipes.\n\n[![build status](https://secure.travis-ci.org/substack/node-archy.png)](http://travis-ci.org/substack/node-archy)\n\nexample\n=======\n\n``` js\nvar archy = require('archy');\nvar s = archy({\n label : 'beep',\n nodes : [\n 'ity',\n {\n label : 'boop',\n nodes : [\n {\n label : 'o_O',\n nodes : [\n {\n label : 'oh',\n nodes : [ 'hello', 'puny' ]\n },\n 'human'\n ]\n },\n 'party\\ntime!'\n ]\n }\n ]\n});\nconsole.log(s);\n```\n\noutput\n\n```\nbeep\n├── ity\n└─┬ boop\n ├─┬ o_O\n │ ├─┬ oh\n │ │ ├── hello\n │ │ └── puny\n │ └── human\n └── party\n time!\n```\n\nmethods\n=======\n\nvar archy = require('archy')\n\narchy(obj, prefix='', opts={})\n------------------------------\n\nReturn a string representation of `obj` with unicode pipe characters like how\n`npm ls` looks.\n\n`obj` should be a tree of nested objects with `'label'` and `'nodes'` fields.\n`'label'` is a string of text to display at a node level and `'nodes'` is an\narray of the descendents of the current node.\n\nIf a node is a string, that string will be used as the `'label'` and an empty\narray of `'nodes'` will be used.\n\n`prefix` gets prepended to all the lines and is used by the algorithm to\nrecursively update.\n\nIf `'label'` has newlines they will be indented at the present indentation level\nwith the current prefix.\n\nTo disable unicode results in favor of all-ansi output set `opts.unicode` to\n`false`.\n\ninstall\n=======\n\nWith [npm](http://npmjs.org) do:\n\n```\nnpm install archy\n```\n\nlicense\n=======\n\nMIT/X11\n", + "readmeFilename": "README.markdown", + "bugs": { + "url": "https://github.com/substack/node-archy/issues" + }, + "homepage": "https://github.com/substack/node-archy" +} diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bl/bl.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bl/bl.js new file mode 100644 index 0000000..d1ea3b5 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bl/bl.js @@ -0,0 +1,216 @@ +var DuplexStream = require('readable-stream').Duplex + , util = require('util') + +function BufferList (callback) { + if (!(this instanceof BufferList)) + return new BufferList(callback) + + this._bufs = [] + this.length = 0 + + if (typeof callback == 'function') { + this._callback = callback + + var piper = function (err) { + if (this._callback) { + this._callback(err) + this._callback = null + } + }.bind(this) + + this.on('pipe', function (src) { + src.on('error', piper) + }) + this.on('unpipe', function (src) { + src.removeListener('error', piper) + }) + } + else if (Buffer.isBuffer(callback)) + this.append(callback) + else if (Array.isArray(callback)) { + callback.forEach(function (b) { + Buffer.isBuffer(b) && this.append(b) + }.bind(this)) + } + + DuplexStream.call(this) +} + +util.inherits(BufferList, DuplexStream) + +BufferList.prototype._offset = function (offset) { + var tot = 0, i = 0, _t + for (; i < this._bufs.length; i++) { + _t = tot + this._bufs[i].length + if (offset < _t) + return [ i, offset - tot ] + tot = _t + } +} + +BufferList.prototype.append = function (buf) { + var isBuffer = Buffer.isBuffer(buf) || + buf instanceof BufferList + + this._bufs.push(isBuffer ? buf : new Buffer(buf)) + this.length += buf.length + return this +} + +BufferList.prototype._write = function (buf, encoding, callback) { + this.append(buf) + if (callback) + callback() +} + +BufferList.prototype._read = function (size) { + if (!this.length) + return this.push(null) + size = Math.min(size, this.length) + this.push(this.slice(0, size)) + this.consume(size) +} + +BufferList.prototype.end = function (chunk) { + DuplexStream.prototype.end.call(this, chunk) + + if (this._callback) { + this._callback(null, this.slice()) + this._callback = null + } +} + +BufferList.prototype.get = function (index) { + return this.slice(index, index + 1)[0] +} + +BufferList.prototype.slice = function (start, end) { + return this.copy(null, 0, start, end) +} + +BufferList.prototype.copy = function (dst, dstStart, srcStart, srcEnd) { + if (typeof srcStart != 'number' || srcStart < 0) + srcStart = 0 + if (typeof srcEnd != 'number' || srcEnd > this.length) + srcEnd = this.length + if (srcStart >= this.length) + return dst || new Buffer(0) + if (srcEnd <= 0) + return dst || new Buffer(0) + + var copy = !!dst + , off = this._offset(srcStart) + , len = srcEnd - srcStart + , bytes = len + , bufoff = (copy && dstStart) || 0 + , start = off[1] + , l + , i + + // copy/slice everything + if (srcStart === 0 && srcEnd == this.length) { + if (!copy) // slice, just return a full concat + return Buffer.concat(this._bufs) + + // copy, need to copy individual buffers + for (i = 0; i < this._bufs.length; i++) { + this._bufs[i].copy(dst, bufoff) + bufoff += this._bufs[i].length + } + + return dst + } + + // easy, cheap case where it's a subset of one of the buffers + if (bytes <= this._bufs[off[0]].length - start) { + return copy + ? this._bufs[off[0]].copy(dst, dstStart, start, start + bytes) + : this._bufs[off[0]].slice(start, start + bytes) + } + + if (!copy) // a slice, we need something to copy in to + dst = new Buffer(len) + + for (i = off[0]; i < this._bufs.length; i++) { + l = this._bufs[i].length - start + + if (bytes > l) { + this._bufs[i].copy(dst, bufoff, start) + } else { + this._bufs[i].copy(dst, bufoff, start, start + bytes) + break + } + + bufoff += l + bytes -= l + + if (start) + start = 0 + } + + return dst +} + +BufferList.prototype.toString = function (encoding, start, end) { + return this.slice(start, end).toString(encoding) +} + +BufferList.prototype.consume = function (bytes) { + while (this._bufs.length) { + if (bytes > this._bufs[0].length) { + bytes -= this._bufs[0].length + this.length -= this._bufs[0].length + this._bufs.shift() + } else { + this._bufs[0] = this._bufs[0].slice(bytes) + this.length -= bytes + break + } + } + return this +} + +BufferList.prototype.duplicate = function () { + var i = 0 + , copy = new BufferList() + + for (; i < this._bufs.length; i++) + copy.append(this._bufs[i]) + + return copy +} + +BufferList.prototype.destroy = function () { + this._bufs.length = 0; + this.length = 0; + this.push(null); +} + +;(function () { + var methods = { + 'readDoubleBE' : 8 + , 'readDoubleLE' : 8 + , 'readFloatBE' : 4 + , 'readFloatLE' : 4 + , 'readInt32BE' : 4 + , 'readInt32LE' : 4 + , 'readUInt32BE' : 4 + , 'readUInt32LE' : 4 + , 'readInt16BE' : 2 + , 'readInt16LE' : 2 + , 'readUInt16BE' : 2 + , 'readUInt16LE' : 2 + , 'readInt8' : 1 + , 'readUInt8' : 1 + } + + for (var m in methods) { + (function (m) { + BufferList.prototype[m] = function (offset) { + return this.slice(offset, offset + methods[m])[m](0) + } + }(m)) + } +}()) + +module.exports = BufferList diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bl/node_modules/readable-stream/duplex.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bl/node_modules/readable-stream/duplex.js new file mode 100644 index 0000000..ca807af --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bl/node_modules/readable-stream/duplex.js @@ -0,0 +1 @@ +module.exports = require("./lib/_stream_duplex.js") diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bl/node_modules/readable-stream/lib/_stream_duplex.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bl/node_modules/readable-stream/lib/_stream_duplex.js new file mode 100644 index 0000000..b513d61 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bl/node_modules/readable-stream/lib/_stream_duplex.js @@ -0,0 +1,89 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// 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. + +// a duplex stream is just a stream that is both readable and writable. +// Since JS doesn't have multiple prototypal inheritance, this class +// prototypally inherits from Readable, and then parasitically from +// Writable. + +module.exports = Duplex; + +/**/ +var objectKeys = Object.keys || function (obj) { + var keys = []; + for (var key in obj) keys.push(key); + return keys; +} +/**/ + + +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ + +var Readable = require('./_stream_readable'); +var Writable = require('./_stream_writable'); + +util.inherits(Duplex, Readable); + +forEach(objectKeys(Writable.prototype), function(method) { + if (!Duplex.prototype[method]) + Duplex.prototype[method] = Writable.prototype[method]; +}); + +function Duplex(options) { + if (!(this instanceof Duplex)) + return new Duplex(options); + + Readable.call(this, options); + Writable.call(this, options); + + if (options && options.readable === false) + this.readable = false; + + if (options && options.writable === false) + this.writable = false; + + this.allowHalfOpen = true; + if (options && options.allowHalfOpen === false) + this.allowHalfOpen = false; + + this.once('end', onend); +} + +// the no-half-open enforcer +function onend() { + // if we allow half-open state, or if the writable side ended, + // then we're ok. + if (this.allowHalfOpen || this._writableState.ended) + return; + + // no more data can be written. + // But allow more writes to happen in this tick. + process.nextTick(this.end.bind(this)); +} + +function forEach (xs, f) { + for (var i = 0, l = xs.length; i < l; i++) { + f(xs[i], i); + } +} diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bl/node_modules/readable-stream/lib/_stream_passthrough.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bl/node_modules/readable-stream/lib/_stream_passthrough.js new file mode 100644 index 0000000..895ca50 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bl/node_modules/readable-stream/lib/_stream_passthrough.js @@ -0,0 +1,46 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// 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. + +// a passthrough stream. +// basically just the most minimal sort of Transform stream. +// Every written chunk gets output as-is. + +module.exports = PassThrough; + +var Transform = require('./_stream_transform'); + +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ + +util.inherits(PassThrough, Transform); + +function PassThrough(options) { + if (!(this instanceof PassThrough)) + return new PassThrough(options); + + Transform.call(this, options); +} + +PassThrough.prototype._transform = function(chunk, encoding, cb) { + cb(null, chunk); +}; diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bl/node_modules/readable-stream/lib/_stream_readable.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bl/node_modules/readable-stream/lib/_stream_readable.js new file mode 100644 index 0000000..6307220 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bl/node_modules/readable-stream/lib/_stream_readable.js @@ -0,0 +1,982 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// 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. + +module.exports = Readable; + +/**/ +var isArray = require('isarray'); +/**/ + + +/**/ +var Buffer = require('buffer').Buffer; +/**/ + +Readable.ReadableState = ReadableState; + +var EE = require('events').EventEmitter; + +/**/ +if (!EE.listenerCount) EE.listenerCount = function(emitter, type) { + return emitter.listeners(type).length; +}; +/**/ + +var Stream = require('stream'); + +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ + +var StringDecoder; + +util.inherits(Readable, Stream); + +function ReadableState(options, stream) { + options = options || {}; + + // the point at which it stops calling _read() to fill the buffer + // Note: 0 is a valid value, means "don't call _read preemptively ever" + var hwm = options.highWaterMark; + this.highWaterMark = (hwm || hwm === 0) ? hwm : 16 * 1024; + + // cast to ints. + this.highWaterMark = ~~this.highWaterMark; + + this.buffer = []; + this.length = 0; + this.pipes = null; + this.pipesCount = 0; + this.flowing = false; + this.ended = false; + this.endEmitted = false; + this.reading = false; + + // In streams that never have any data, and do push(null) right away, + // the consumer can miss the 'end' event if they do some I/O before + // consuming the stream. So, we don't emit('end') until some reading + // happens. + this.calledRead = false; + + // a flag to be able to tell if the onwrite cb is called immediately, + // or on a later tick. We set this to true at first, becuase any + // actions that shouldn't happen until "later" should generally also + // not happen before the first write call. + this.sync = true; + + // whenever we return null, then we set a flag to say + // that we're awaiting a 'readable' event emission. + this.needReadable = false; + this.emittedReadable = false; + this.readableListening = false; + + + // object stream flag. Used to make read(n) ignore n and to + // make all the buffer merging and length checks go away + this.objectMode = !!options.objectMode; + + // Crypto is kind of old and crusty. Historically, its default string + // encoding is 'binary' so we have to make this configurable. + // Everything else in the universe uses 'utf8', though. + this.defaultEncoding = options.defaultEncoding || 'utf8'; + + // when piping, we only care about 'readable' events that happen + // after read()ing all the bytes and not getting any pushback. + this.ranOut = false; + + // the number of writers that are awaiting a drain event in .pipe()s + this.awaitDrain = 0; + + // if true, a maybeReadMore has been scheduled + this.readingMore = false; + + this.decoder = null; + this.encoding = null; + if (options.encoding) { + if (!StringDecoder) + StringDecoder = require('string_decoder/').StringDecoder; + this.decoder = new StringDecoder(options.encoding); + this.encoding = options.encoding; + } +} + +function Readable(options) { + if (!(this instanceof Readable)) + return new Readable(options); + + this._readableState = new ReadableState(options, this); + + // legacy + this.readable = true; + + Stream.call(this); +} + +// Manually shove something into the read() buffer. +// This returns true if the highWaterMark has not been hit yet, +// similar to how Writable.write() returns true if you should +// write() some more. +Readable.prototype.push = function(chunk, encoding) { + var state = this._readableState; + + if (typeof chunk === 'string' && !state.objectMode) { + encoding = encoding || state.defaultEncoding; + if (encoding !== state.encoding) { + chunk = new Buffer(chunk, encoding); + encoding = ''; + } + } + + return readableAddChunk(this, state, chunk, encoding, false); +}; + +// Unshift should *always* be something directly out of read() +Readable.prototype.unshift = function(chunk) { + var state = this._readableState; + return readableAddChunk(this, state, chunk, '', true); +}; + +function readableAddChunk(stream, state, chunk, encoding, addToFront) { + var er = chunkInvalid(state, chunk); + if (er) { + stream.emit('error', er); + } else if (chunk === null || chunk === undefined) { + state.reading = false; + if (!state.ended) + onEofChunk(stream, state); + } else if (state.objectMode || chunk && chunk.length > 0) { + if (state.ended && !addToFront) { + var e = new Error('stream.push() after EOF'); + stream.emit('error', e); + } else if (state.endEmitted && addToFront) { + var e = new Error('stream.unshift() after end event'); + stream.emit('error', e); + } else { + if (state.decoder && !addToFront && !encoding) + chunk = state.decoder.write(chunk); + + // update the buffer info. + state.length += state.objectMode ? 1 : chunk.length; + if (addToFront) { + state.buffer.unshift(chunk); + } else { + state.reading = false; + state.buffer.push(chunk); + } + + if (state.needReadable) + emitReadable(stream); + + maybeReadMore(stream, state); + } + } else if (!addToFront) { + state.reading = false; + } + + return needMoreData(state); +} + + + +// if it's past the high water mark, we can push in some more. +// Also, if we have no data yet, we can stand some +// more bytes. This is to work around cases where hwm=0, +// such as the repl. Also, if the push() triggered a +// readable event, and the user called read(largeNumber) such that +// needReadable was set, then we ought to push more, so that another +// 'readable' event will be triggered. +function needMoreData(state) { + return !state.ended && + (state.needReadable || + state.length < state.highWaterMark || + state.length === 0); +} + +// backwards compatibility. +Readable.prototype.setEncoding = function(enc) { + if (!StringDecoder) + StringDecoder = require('string_decoder/').StringDecoder; + this._readableState.decoder = new StringDecoder(enc); + this._readableState.encoding = enc; +}; + +// Don't raise the hwm > 128MB +var MAX_HWM = 0x800000; +function roundUpToNextPowerOf2(n) { + if (n >= MAX_HWM) { + n = MAX_HWM; + } else { + // Get the next highest power of 2 + n--; + for (var p = 1; p < 32; p <<= 1) n |= n >> p; + n++; + } + return n; +} + +function howMuchToRead(n, state) { + if (state.length === 0 && state.ended) + return 0; + + if (state.objectMode) + return n === 0 ? 0 : 1; + + if (n === null || isNaN(n)) { + // only flow one buffer at a time + if (state.flowing && state.buffer.length) + return state.buffer[0].length; + else + return state.length; + } + + if (n <= 0) + return 0; + + // If we're asking for more than the target buffer level, + // then raise the water mark. Bump up to the next highest + // power of 2, to prevent increasing it excessively in tiny + // amounts. + if (n > state.highWaterMark) + state.highWaterMark = roundUpToNextPowerOf2(n); + + // don't have that much. return null, unless we've ended. + if (n > state.length) { + if (!state.ended) { + state.needReadable = true; + return 0; + } else + return state.length; + } + + return n; +} + +// you can override either this method, or the async _read(n) below. +Readable.prototype.read = function(n) { + var state = this._readableState; + state.calledRead = true; + var nOrig = n; + var ret; + + if (typeof n !== 'number' || n > 0) + state.emittedReadable = false; + + // if we're doing read(0) to trigger a readable event, but we + // already have a bunch of data in the buffer, then just trigger + // the 'readable' event and move on. + if (n === 0 && + state.needReadable && + (state.length >= state.highWaterMark || state.ended)) { + emitReadable(this); + return null; + } + + n = howMuchToRead(n, state); + + // if we've ended, and we're now clear, then finish it up. + if (n === 0 && state.ended) { + ret = null; + + // In cases where the decoder did not receive enough data + // to produce a full chunk, then immediately received an + // EOF, state.buffer will contain [, ]. + // howMuchToRead will see this and coerce the amount to + // read to zero (because it's looking at the length of the + // first in state.buffer), and we'll end up here. + // + // This can only happen via state.decoder -- no other venue + // exists for pushing a zero-length chunk into state.buffer + // and triggering this behavior. In this case, we return our + // remaining data and end the stream, if appropriate. + if (state.length > 0 && state.decoder) { + ret = fromList(n, state); + state.length -= ret.length; + } + + if (state.length === 0) + endReadable(this); + + return ret; + } + + // All the actual chunk generation logic needs to be + // *below* the call to _read. The reason is that in certain + // synthetic stream cases, such as passthrough streams, _read + // may be a completely synchronous operation which may change + // the state of the read buffer, providing enough data when + // before there was *not* enough. + // + // So, the steps are: + // 1. Figure out what the state of things will be after we do + // a read from the buffer. + // + // 2. If that resulting state will trigger a _read, then call _read. + // Note that this may be asynchronous, or synchronous. Yes, it is + // deeply ugly to write APIs this way, but that still doesn't mean + // that the Readable class should behave improperly, as streams are + // designed to be sync/async agnostic. + // Take note if the _read call is sync or async (ie, if the read call + // has returned yet), so that we know whether or not it's safe to emit + // 'readable' etc. + // + // 3. Actually pull the requested chunks out of the buffer and return. + + // if we need a readable event, then we need to do some reading. + var doRead = state.needReadable; + + // if we currently have less than the highWaterMark, then also read some + if (state.length - n <= state.highWaterMark) + doRead = true; + + // however, if we've ended, then there's no point, and if we're already + // reading, then it's unnecessary. + if (state.ended || state.reading) + doRead = false; + + if (doRead) { + state.reading = true; + state.sync = true; + // if the length is currently zero, then we *need* a readable event. + if (state.length === 0) + state.needReadable = true; + // call internal read method + this._read(state.highWaterMark); + state.sync = false; + } + + // If _read called its callback synchronously, then `reading` + // will be false, and we need to re-evaluate how much data we + // can return to the user. + if (doRead && !state.reading) + n = howMuchToRead(nOrig, state); + + if (n > 0) + ret = fromList(n, state); + else + ret = null; + + if (ret === null) { + state.needReadable = true; + n = 0; + } + + state.length -= n; + + // If we have nothing in the buffer, then we want to know + // as soon as we *do* get something into the buffer. + if (state.length === 0 && !state.ended) + state.needReadable = true; + + // If we happened to read() exactly the remaining amount in the + // buffer, and the EOF has been seen at this point, then make sure + // that we emit 'end' on the very next tick. + if (state.ended && !state.endEmitted && state.length === 0) + endReadable(this); + + return ret; +}; + +function chunkInvalid(state, chunk) { + var er = null; + if (!Buffer.isBuffer(chunk) && + 'string' !== typeof chunk && + chunk !== null && + chunk !== undefined && + !state.objectMode) { + er = new TypeError('Invalid non-string/buffer chunk'); + } + return er; +} + + +function onEofChunk(stream, state) { + if (state.decoder && !state.ended) { + var chunk = state.decoder.end(); + if (chunk && chunk.length) { + state.buffer.push(chunk); + state.length += state.objectMode ? 1 : chunk.length; + } + } + state.ended = true; + + // if we've ended and we have some data left, then emit + // 'readable' now to make sure it gets picked up. + if (state.length > 0) + emitReadable(stream); + else + endReadable(stream); +} + +// Don't emit readable right away in sync mode, because this can trigger +// another read() call => stack overflow. This way, it might trigger +// a nextTick recursion warning, but that's not so bad. +function emitReadable(stream) { + var state = stream._readableState; + state.needReadable = false; + if (state.emittedReadable) + return; + + state.emittedReadable = true; + if (state.sync) + process.nextTick(function() { + emitReadable_(stream); + }); + else + emitReadable_(stream); +} + +function emitReadable_(stream) { + stream.emit('readable'); +} + + +// at this point, the user has presumably seen the 'readable' event, +// and called read() to consume some data. that may have triggered +// in turn another _read(n) call, in which case reading = true if +// it's in progress. +// However, if we're not ended, or reading, and the length < hwm, +// then go ahead and try to read some more preemptively. +function maybeReadMore(stream, state) { + if (!state.readingMore) { + state.readingMore = true; + process.nextTick(function() { + maybeReadMore_(stream, state); + }); + } +} + +function maybeReadMore_(stream, state) { + var len = state.length; + while (!state.reading && !state.flowing && !state.ended && + state.length < state.highWaterMark) { + stream.read(0); + if (len === state.length) + // didn't get any data, stop spinning. + break; + else + len = state.length; + } + state.readingMore = false; +} + +// abstract method. to be overridden in specific implementation classes. +// call cb(er, data) where data is <= n in length. +// for virtual (non-string, non-buffer) streams, "length" is somewhat +// arbitrary, and perhaps not very meaningful. +Readable.prototype._read = function(n) { + this.emit('error', new Error('not implemented')); +}; + +Readable.prototype.pipe = function(dest, pipeOpts) { + var src = this; + var state = this._readableState; + + switch (state.pipesCount) { + case 0: + state.pipes = dest; + break; + case 1: + state.pipes = [state.pipes, dest]; + break; + default: + state.pipes.push(dest); + break; + } + state.pipesCount += 1; + + var doEnd = (!pipeOpts || pipeOpts.end !== false) && + dest !== process.stdout && + dest !== process.stderr; + + var endFn = doEnd ? onend : cleanup; + if (state.endEmitted) + process.nextTick(endFn); + else + src.once('end', endFn); + + dest.on('unpipe', onunpipe); + function onunpipe(readable) { + if (readable !== src) return; + cleanup(); + } + + function onend() { + dest.end(); + } + + // when the dest drains, it reduces the awaitDrain counter + // on the source. This would be more elegant with a .once() + // handler in flow(), but adding and removing repeatedly is + // too slow. + var ondrain = pipeOnDrain(src); + dest.on('drain', ondrain); + + function cleanup() { + // cleanup event handlers once the pipe is broken + dest.removeListener('close', onclose); + dest.removeListener('finish', onfinish); + dest.removeListener('drain', ondrain); + dest.removeListener('error', onerror); + dest.removeListener('unpipe', onunpipe); + src.removeListener('end', onend); + src.removeListener('end', cleanup); + + // if the reader is waiting for a drain event from this + // specific writer, then it would cause it to never start + // flowing again. + // So, if this is awaiting a drain, then we just call it now. + // If we don't know, then assume that we are waiting for one. + if (!dest._writableState || dest._writableState.needDrain) + ondrain(); + } + + // if the dest has an error, then stop piping into it. + // however, don't suppress the throwing behavior for this. + function onerror(er) { + unpipe(); + dest.removeListener('error', onerror); + if (EE.listenerCount(dest, 'error') === 0) + dest.emit('error', er); + } + // This is a brutally ugly hack to make sure that our error handler + // is attached before any userland ones. NEVER DO THIS. + if (!dest._events || !dest._events.error) + dest.on('error', onerror); + else if (isArray(dest._events.error)) + dest._events.error.unshift(onerror); + else + dest._events.error = [onerror, dest._events.error]; + + + + // Both close and finish should trigger unpipe, but only once. + function onclose() { + dest.removeListener('finish', onfinish); + unpipe(); + } + dest.once('close', onclose); + function onfinish() { + dest.removeListener('close', onclose); + unpipe(); + } + dest.once('finish', onfinish); + + function unpipe() { + src.unpipe(dest); + } + + // tell the dest that it's being piped to + dest.emit('pipe', src); + + // start the flow if it hasn't been started already. + if (!state.flowing) { + // the handler that waits for readable events after all + // the data gets sucked out in flow. + // This would be easier to follow with a .once() handler + // in flow(), but that is too slow. + this.on('readable', pipeOnReadable); + + state.flowing = true; + process.nextTick(function() { + flow(src); + }); + } + + return dest; +}; + +function pipeOnDrain(src) { + return function() { + var dest = this; + var state = src._readableState; + state.awaitDrain--; + if (state.awaitDrain === 0) + flow(src); + }; +} + +function flow(src) { + var state = src._readableState; + var chunk; + state.awaitDrain = 0; + + function write(dest, i, list) { + var written = dest.write(chunk); + if (false === written) { + state.awaitDrain++; + } + } + + while (state.pipesCount && null !== (chunk = src.read())) { + + if (state.pipesCount === 1) + write(state.pipes, 0, null); + else + forEach(state.pipes, write); + + src.emit('data', chunk); + + // if anyone needs a drain, then we have to wait for that. + if (state.awaitDrain > 0) + return; + } + + // if every destination was unpiped, either before entering this + // function, or in the while loop, then stop flowing. + // + // NB: This is a pretty rare edge case. + if (state.pipesCount === 0) { + state.flowing = false; + + // if there were data event listeners added, then switch to old mode. + if (EE.listenerCount(src, 'data') > 0) + emitDataEvents(src); + return; + } + + // at this point, no one needed a drain, so we just ran out of data + // on the next readable event, start it over again. + state.ranOut = true; +} + +function pipeOnReadable() { + if (this._readableState.ranOut) { + this._readableState.ranOut = false; + flow(this); + } +} + + +Readable.prototype.unpipe = function(dest) { + var state = this._readableState; + + // if we're not piping anywhere, then do nothing. + if (state.pipesCount === 0) + return this; + + // just one destination. most common case. + if (state.pipesCount === 1) { + // passed in one, but it's not the right one. + if (dest && dest !== state.pipes) + return this; + + if (!dest) + dest = state.pipes; + + // got a match. + state.pipes = null; + state.pipesCount = 0; + this.removeListener('readable', pipeOnReadable); + state.flowing = false; + if (dest) + dest.emit('unpipe', this); + return this; + } + + // slow case. multiple pipe destinations. + + if (!dest) { + // remove all. + var dests = state.pipes; + var len = state.pipesCount; + state.pipes = null; + state.pipesCount = 0; + this.removeListener('readable', pipeOnReadable); + state.flowing = false; + + for (var i = 0; i < len; i++) + dests[i].emit('unpipe', this); + return this; + } + + // try to find the right one. + var i = indexOf(state.pipes, dest); + if (i === -1) + return this; + + state.pipes.splice(i, 1); + state.pipesCount -= 1; + if (state.pipesCount === 1) + state.pipes = state.pipes[0]; + + dest.emit('unpipe', this); + + return this; +}; + +// set up data events if they are asked for +// Ensure readable listeners eventually get something +Readable.prototype.on = function(ev, fn) { + var res = Stream.prototype.on.call(this, ev, fn); + + if (ev === 'data' && !this._readableState.flowing) + emitDataEvents(this); + + if (ev === 'readable' && this.readable) { + var state = this._readableState; + if (!state.readableListening) { + state.readableListening = true; + state.emittedReadable = false; + state.needReadable = true; + if (!state.reading) { + this.read(0); + } else if (state.length) { + emitReadable(this, state); + } + } + } + + return res; +}; +Readable.prototype.addListener = Readable.prototype.on; + +// pause() and resume() are remnants of the legacy readable stream API +// If the user uses them, then switch into old mode. +Readable.prototype.resume = function() { + emitDataEvents(this); + this.read(0); + this.emit('resume'); +}; + +Readable.prototype.pause = function() { + emitDataEvents(this, true); + this.emit('pause'); +}; + +function emitDataEvents(stream, startPaused) { + var state = stream._readableState; + + if (state.flowing) { + // https://github.com/isaacs/readable-stream/issues/16 + throw new Error('Cannot switch to old mode now.'); + } + + var paused = startPaused || false; + var readable = false; + + // convert to an old-style stream. + stream.readable = true; + stream.pipe = Stream.prototype.pipe; + stream.on = stream.addListener = Stream.prototype.on; + + stream.on('readable', function() { + readable = true; + + var c; + while (!paused && (null !== (c = stream.read()))) + stream.emit('data', c); + + if (c === null) { + readable = false; + stream._readableState.needReadable = true; + } + }); + + stream.pause = function() { + paused = true; + this.emit('pause'); + }; + + stream.resume = function() { + paused = false; + if (readable) + process.nextTick(function() { + stream.emit('readable'); + }); + else + this.read(0); + this.emit('resume'); + }; + + // now make it start, just in case it hadn't already. + stream.emit('readable'); +} + +// wrap an old-style stream as the async data source. +// This is *not* part of the readable stream interface. +// It is an ugly unfortunate mess of history. +Readable.prototype.wrap = function(stream) { + var state = this._readableState; + var paused = false; + + var self = this; + stream.on('end', function() { + if (state.decoder && !state.ended) { + var chunk = state.decoder.end(); + if (chunk && chunk.length) + self.push(chunk); + } + + self.push(null); + }); + + stream.on('data', function(chunk) { + if (state.decoder) + chunk = state.decoder.write(chunk); + + // don't skip over falsy values in objectMode + //if (state.objectMode && util.isNullOrUndefined(chunk)) + if (state.objectMode && (chunk === null || chunk === undefined)) + return; + else if (!state.objectMode && (!chunk || !chunk.length)) + return; + + var ret = self.push(chunk); + if (!ret) { + paused = true; + stream.pause(); + } + }); + + // proxy all the other methods. + // important when wrapping filters and duplexes. + for (var i in stream) { + if (typeof stream[i] === 'function' && + typeof this[i] === 'undefined') { + this[i] = function(method) { return function() { + return stream[method].apply(stream, arguments); + }}(i); + } + } + + // proxy certain important events. + var events = ['error', 'close', 'destroy', 'pause', 'resume']; + forEach(events, function(ev) { + stream.on(ev, self.emit.bind(self, ev)); + }); + + // when we try to consume some more bytes, simply unpause the + // underlying stream. + self._read = function(n) { + if (paused) { + paused = false; + stream.resume(); + } + }; + + return self; +}; + + + +// exposed for testing purposes only. +Readable._fromList = fromList; + +// Pluck off n bytes from an array of buffers. +// Length is the combined lengths of all the buffers in the list. +function fromList(n, state) { + var list = state.buffer; + var length = state.length; + var stringMode = !!state.decoder; + var objectMode = !!state.objectMode; + var ret; + + // nothing in the list, definitely empty. + if (list.length === 0) + return null; + + if (length === 0) + ret = null; + else if (objectMode) + ret = list.shift(); + else if (!n || n >= length) { + // read it all, truncate the array. + if (stringMode) + ret = list.join(''); + else + ret = Buffer.concat(list, length); + list.length = 0; + } else { + // read just some of it. + if (n < list[0].length) { + // just take a part of the first list item. + // slice is the same for buffers and strings. + var buf = list[0]; + ret = buf.slice(0, n); + list[0] = buf.slice(n); + } else if (n === list[0].length) { + // first list is a perfect match + ret = list.shift(); + } else { + // complex case. + // we have enough to cover it, but it spans past the first buffer. + if (stringMode) + ret = ''; + else + ret = new Buffer(n); + + var c = 0; + for (var i = 0, l = list.length; i < l && c < n; i++) { + var buf = list[0]; + var cpy = Math.min(n - c, buf.length); + + if (stringMode) + ret += buf.slice(0, cpy); + else + buf.copy(ret, c, 0, cpy); + + if (cpy < buf.length) + list[0] = buf.slice(cpy); + else + list.shift(); + + c += cpy; + } + } + } + + return ret; +} + +function endReadable(stream) { + var state = stream._readableState; + + // If we get here before consuming all the bytes, then that is a + // bug in node. Should never happen. + if (state.length > 0) + throw new Error('endReadable called on non-empty stream'); + + if (!state.endEmitted && state.calledRead) { + state.ended = true; + process.nextTick(function() { + // Check that we didn't get one last unshift. + if (!state.endEmitted && state.length === 0) { + state.endEmitted = true; + stream.readable = false; + stream.emit('end'); + } + }); + } +} + +function forEach (xs, f) { + for (var i = 0, l = xs.length; i < l; i++) { + f(xs[i], i); + } +} + +function indexOf (xs, x) { + for (var i = 0, l = xs.length; i < l; i++) { + if (xs[i] === x) return i; + } + return -1; +} diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bl/node_modules/readable-stream/lib/_stream_transform.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bl/node_modules/readable-stream/lib/_stream_transform.js new file mode 100644 index 0000000..eb188df --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bl/node_modules/readable-stream/lib/_stream_transform.js @@ -0,0 +1,210 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// 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. + + +// a transform stream is a readable/writable stream where you do +// something with the data. Sometimes it's called a "filter", +// but that's not a great name for it, since that implies a thing where +// some bits pass through, and others are simply ignored. (That would +// be a valid example of a transform, of course.) +// +// While the output is causally related to the input, it's not a +// necessarily symmetric or synchronous transformation. For example, +// a zlib stream might take multiple plain-text writes(), and then +// emit a single compressed chunk some time in the future. +// +// Here's how this works: +// +// The Transform stream has all the aspects of the readable and writable +// stream classes. When you write(chunk), that calls _write(chunk,cb) +// internally, and returns false if there's a lot of pending writes +// buffered up. When you call read(), that calls _read(n) until +// there's enough pending readable data buffered up. +// +// In a transform stream, the written data is placed in a buffer. When +// _read(n) is called, it transforms the queued up data, calling the +// buffered _write cb's as it consumes chunks. If consuming a single +// written chunk would result in multiple output chunks, then the first +// outputted bit calls the readcb, and subsequent chunks just go into +// the read buffer, and will cause it to emit 'readable' if necessary. +// +// This way, back-pressure is actually determined by the reading side, +// since _read has to be called to start processing a new chunk. However, +// a pathological inflate type of transform can cause excessive buffering +// here. For example, imagine a stream where every byte of input is +// interpreted as an integer from 0-255, and then results in that many +// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in +// 1kb of data being output. In this case, you could write a very small +// amount of input, and end up with a very large amount of output. In +// such a pathological inflating mechanism, there'd be no way to tell +// the system to stop doing the transform. A single 4MB write could +// cause the system to run out of memory. +// +// However, even in such a pathological case, only a single written chunk +// would be consumed, and then the rest would wait (un-transformed) until +// the results of the previous transformed chunk were consumed. + +module.exports = Transform; + +var Duplex = require('./_stream_duplex'); + +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ + +util.inherits(Transform, Duplex); + + +function TransformState(options, stream) { + this.afterTransform = function(er, data) { + return afterTransform(stream, er, data); + }; + + this.needTransform = false; + this.transforming = false; + this.writecb = null; + this.writechunk = null; +} + +function afterTransform(stream, er, data) { + var ts = stream._transformState; + ts.transforming = false; + + var cb = ts.writecb; + + if (!cb) + return stream.emit('error', new Error('no writecb in Transform class')); + + ts.writechunk = null; + ts.writecb = null; + + if (data !== null && data !== undefined) + stream.push(data); + + if (cb) + cb(er); + + var rs = stream._readableState; + rs.reading = false; + if (rs.needReadable || rs.length < rs.highWaterMark) { + stream._read(rs.highWaterMark); + } +} + + +function Transform(options) { + if (!(this instanceof Transform)) + return new Transform(options); + + Duplex.call(this, options); + + var ts = this._transformState = new TransformState(options, this); + + // when the writable side finishes, then flush out anything remaining. + var stream = this; + + // start out asking for a readable event once data is transformed. + this._readableState.needReadable = true; + + // we have implemented the _read method, and done the other things + // that Readable wants before the first _read call, so unset the + // sync guard flag. + this._readableState.sync = false; + + this.once('finish', function() { + if ('function' === typeof this._flush) + this._flush(function(er) { + done(stream, er); + }); + else + done(stream); + }); +} + +Transform.prototype.push = function(chunk, encoding) { + this._transformState.needTransform = false; + return Duplex.prototype.push.call(this, chunk, encoding); +}; + +// This is the part where you do stuff! +// override this function in implementation classes. +// 'chunk' is an input chunk. +// +// Call `push(newChunk)` to pass along transformed output +// to the readable side. You may call 'push' zero or more times. +// +// Call `cb(err)` when you are done with this chunk. If you pass +// an error, then that'll put the hurt on the whole operation. If you +// never call cb(), then you'll never get another chunk. +Transform.prototype._transform = function(chunk, encoding, cb) { + throw new Error('not implemented'); +}; + +Transform.prototype._write = function(chunk, encoding, cb) { + var ts = this._transformState; + ts.writecb = cb; + ts.writechunk = chunk; + ts.writeencoding = encoding; + if (!ts.transforming) { + var rs = this._readableState; + if (ts.needTransform || + rs.needReadable || + rs.length < rs.highWaterMark) + this._read(rs.highWaterMark); + } +}; + +// Doesn't matter what the args are here. +// _transform does all the work. +// That we got here means that the readable side wants more data. +Transform.prototype._read = function(n) { + var ts = this._transformState; + + if (ts.writechunk !== null && ts.writecb && !ts.transforming) { + ts.transforming = true; + this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform); + } else { + // mark that we need a transform, so that any data that comes in + // will get processed, now that we've asked for it. + ts.needTransform = true; + } +}; + + +function done(stream, er) { + if (er) + return stream.emit('error', er); + + // if there's nothing in the write buffer, then that means + // that nothing more will ever be provided + var ws = stream._writableState; + var rs = stream._readableState; + var ts = stream._transformState; + + if (ws.length) + throw new Error('calling transform done when ws.length != 0'); + + if (ts.transforming) + throw new Error('calling transform done when still transforming'); + + return stream.push(null); +} diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bl/node_modules/readable-stream/lib/_stream_writable.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bl/node_modules/readable-stream/lib/_stream_writable.js new file mode 100644 index 0000000..4bdaa4f --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bl/node_modules/readable-stream/lib/_stream_writable.js @@ -0,0 +1,386 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// 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. + +// A bit simpler than readable streams. +// Implement an async ._write(chunk, cb), and it'll handle all +// the drain event emission and buffering. + +module.exports = Writable; + +/**/ +var Buffer = require('buffer').Buffer; +/**/ + +Writable.WritableState = WritableState; + + +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ + +var Stream = require('stream'); + +util.inherits(Writable, Stream); + +function WriteReq(chunk, encoding, cb) { + this.chunk = chunk; + this.encoding = encoding; + this.callback = cb; +} + +function WritableState(options, stream) { + options = options || {}; + + // the point at which write() starts returning false + // Note: 0 is a valid value, means that we always return false if + // the entire buffer is not flushed immediately on write() + var hwm = options.highWaterMark; + this.highWaterMark = (hwm || hwm === 0) ? hwm : 16 * 1024; + + // object stream flag to indicate whether or not this stream + // contains buffers or objects. + this.objectMode = !!options.objectMode; + + // cast to ints. + this.highWaterMark = ~~this.highWaterMark; + + this.needDrain = false; + // at the start of calling end() + this.ending = false; + // when end() has been called, and returned + this.ended = false; + // when 'finish' is emitted + this.finished = false; + + // should we decode strings into buffers before passing to _write? + // this is here so that some node-core streams can optimize string + // handling at a lower level. + var noDecode = options.decodeStrings === false; + this.decodeStrings = !noDecode; + + // Crypto is kind of old and crusty. Historically, its default string + // encoding is 'binary' so we have to make this configurable. + // Everything else in the universe uses 'utf8', though. + this.defaultEncoding = options.defaultEncoding || 'utf8'; + + // not an actual buffer we keep track of, but a measurement + // of how much we're waiting to get pushed to some underlying + // socket or file. + this.length = 0; + + // a flag to see when we're in the middle of a write. + this.writing = false; + + // a flag to be able to tell if the onwrite cb is called immediately, + // or on a later tick. We set this to true at first, becuase any + // actions that shouldn't happen until "later" should generally also + // not happen before the first write call. + this.sync = true; + + // a flag to know if we're processing previously buffered items, which + // may call the _write() callback in the same tick, so that we don't + // end up in an overlapped onwrite situation. + this.bufferProcessing = false; + + // the callback that's passed to _write(chunk,cb) + this.onwrite = function(er) { + onwrite(stream, er); + }; + + // the callback that the user supplies to write(chunk,encoding,cb) + this.writecb = null; + + // the amount that is being written when _write is called. + this.writelen = 0; + + this.buffer = []; + + // True if the error was already emitted and should not be thrown again + this.errorEmitted = false; +} + +function Writable(options) { + var Duplex = require('./_stream_duplex'); + + // Writable ctor is applied to Duplexes, though they're not + // instanceof Writable, they're instanceof Readable. + if (!(this instanceof Writable) && !(this instanceof Duplex)) + return new Writable(options); + + this._writableState = new WritableState(options, this); + + // legacy. + this.writable = true; + + Stream.call(this); +} + +// Otherwise people can pipe Writable streams, which is just wrong. +Writable.prototype.pipe = function() { + this.emit('error', new Error('Cannot pipe. Not readable.')); +}; + + +function writeAfterEnd(stream, state, cb) { + var er = new Error('write after end'); + // TODO: defer error events consistently everywhere, not just the cb + stream.emit('error', er); + process.nextTick(function() { + cb(er); + }); +} + +// If we get something that is not a buffer, string, null, or undefined, +// and we're not in objectMode, then that's an error. +// Otherwise stream chunks are all considered to be of length=1, and the +// watermarks determine how many objects to keep in the buffer, rather than +// how many bytes or characters. +function validChunk(stream, state, chunk, cb) { + var valid = true; + if (!Buffer.isBuffer(chunk) && + 'string' !== typeof chunk && + chunk !== null && + chunk !== undefined && + !state.objectMode) { + var er = new TypeError('Invalid non-string/buffer chunk'); + stream.emit('error', er); + process.nextTick(function() { + cb(er); + }); + valid = false; + } + return valid; +} + +Writable.prototype.write = function(chunk, encoding, cb) { + var state = this._writableState; + var ret = false; + + if (typeof encoding === 'function') { + cb = encoding; + encoding = null; + } + + if (Buffer.isBuffer(chunk)) + encoding = 'buffer'; + else if (!encoding) + encoding = state.defaultEncoding; + + if (typeof cb !== 'function') + cb = function() {}; + + if (state.ended) + writeAfterEnd(this, state, cb); + else if (validChunk(this, state, chunk, cb)) + ret = writeOrBuffer(this, state, chunk, encoding, cb); + + return ret; +}; + +function decodeChunk(state, chunk, encoding) { + if (!state.objectMode && + state.decodeStrings !== false && + typeof chunk === 'string') { + chunk = new Buffer(chunk, encoding); + } + return chunk; +} + +// if we're already writing something, then just put this +// in the queue, and wait our turn. Otherwise, call _write +// If we return false, then we need a drain event, so set that flag. +function writeOrBuffer(stream, state, chunk, encoding, cb) { + chunk = decodeChunk(state, chunk, encoding); + if (Buffer.isBuffer(chunk)) + encoding = 'buffer'; + var len = state.objectMode ? 1 : chunk.length; + + state.length += len; + + var ret = state.length < state.highWaterMark; + // we must ensure that previous needDrain will not be reset to false. + if (!ret) + state.needDrain = true; + + if (state.writing) + state.buffer.push(new WriteReq(chunk, encoding, cb)); + else + doWrite(stream, state, len, chunk, encoding, cb); + + return ret; +} + +function doWrite(stream, state, len, chunk, encoding, cb) { + state.writelen = len; + state.writecb = cb; + state.writing = true; + state.sync = true; + stream._write(chunk, encoding, state.onwrite); + state.sync = false; +} + +function onwriteError(stream, state, sync, er, cb) { + if (sync) + process.nextTick(function() { + cb(er); + }); + else + cb(er); + + stream._writableState.errorEmitted = true; + stream.emit('error', er); +} + +function onwriteStateUpdate(state) { + state.writing = false; + state.writecb = null; + state.length -= state.writelen; + state.writelen = 0; +} + +function onwrite(stream, er) { + var state = stream._writableState; + var sync = state.sync; + var cb = state.writecb; + + onwriteStateUpdate(state); + + if (er) + onwriteError(stream, state, sync, er, cb); + else { + // Check if we're actually ready to finish, but don't emit yet + var finished = needFinish(stream, state); + + if (!finished && !state.bufferProcessing && state.buffer.length) + clearBuffer(stream, state); + + if (sync) { + process.nextTick(function() { + afterWrite(stream, state, finished, cb); + }); + } else { + afterWrite(stream, state, finished, cb); + } + } +} + +function afterWrite(stream, state, finished, cb) { + if (!finished) + onwriteDrain(stream, state); + cb(); + if (finished) + finishMaybe(stream, state); +} + +// Must force callback to be called on nextTick, so that we don't +// emit 'drain' before the write() consumer gets the 'false' return +// value, and has a chance to attach a 'drain' listener. +function onwriteDrain(stream, state) { + if (state.length === 0 && state.needDrain) { + state.needDrain = false; + stream.emit('drain'); + } +} + + +// if there's something in the buffer waiting, then process it +function clearBuffer(stream, state) { + state.bufferProcessing = true; + + for (var c = 0; c < state.buffer.length; c++) { + var entry = state.buffer[c]; + var chunk = entry.chunk; + var encoding = entry.encoding; + var cb = entry.callback; + var len = state.objectMode ? 1 : chunk.length; + + doWrite(stream, state, len, chunk, encoding, cb); + + // if we didn't call the onwrite immediately, then + // it means that we need to wait until it does. + // also, that means that the chunk and cb are currently + // being processed, so move the buffer counter past them. + if (state.writing) { + c++; + break; + } + } + + state.bufferProcessing = false; + if (c < state.buffer.length) + state.buffer = state.buffer.slice(c); + else + state.buffer.length = 0; +} + +Writable.prototype._write = function(chunk, encoding, cb) { + cb(new Error('not implemented')); +}; + +Writable.prototype.end = function(chunk, encoding, cb) { + var state = this._writableState; + + if (typeof chunk === 'function') { + cb = chunk; + chunk = null; + encoding = null; + } else if (typeof encoding === 'function') { + cb = encoding; + encoding = null; + } + + if (typeof chunk !== 'undefined' && chunk !== null) + this.write(chunk, encoding); + + // ignore unnecessary end() calls. + if (!state.ending && !state.finished) + endWritable(this, state, cb); +}; + + +function needFinish(stream, state) { + return (state.ending && + state.length === 0 && + !state.finished && + !state.writing); +} + +function finishMaybe(stream, state) { + var need = needFinish(stream, state); + if (need) { + state.finished = true; + stream.emit('finish'); + } + return need; +} + +function endWritable(stream, state, cb) { + state.ending = true; + finishMaybe(stream, state); + if (cb) { + if (state.finished) + process.nextTick(cb); + else + stream.once('finish', cb); + } + state.ended = true; +} diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bl/node_modules/readable-stream/package.json b/packages/Bower.1.3.11/node_modules/bower/node_modules/bl/node_modules/readable-stream/package.json new file mode 100644 index 0000000..3acc2e1 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bl/node_modules/readable-stream/package.json @@ -0,0 +1,71 @@ +{ + "name": "readable-stream", + "version": "1.0.32", + "description": "Streams2, a user-land copy of the stream library from Node.js v0.10.x", + "main": "readable.js", + "dependencies": { + "core-util-is": "~1.0.0", + "isarray": "0.0.1", + "string_decoder": "~0.10.x", + "inherits": "~2.0.1" + }, + "devDependencies": { + "tap": "~0.2.6" + }, + "scripts": { + "test": "tap test/simple/*.js" + }, + "repository": { + "type": "git", + "url": "git://github.com/isaacs/readable-stream" + }, + "keywords": [ + "readable", + "stream", + "pipe" + ], + "browser": { + "util": false + }, + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "license": "MIT", + "gitHead": "2024ad52b1e475465488b4ad39eb41d067ffcbb9", + "bugs": { + "url": "https://github.com/isaacs/readable-stream/issues" + }, + "homepage": "https://github.com/isaacs/readable-stream", + "_id": "readable-stream@1.0.32", + "_shasum": "6b44a88ba984cd0ec0834ae7d59a47c39aef48ec", + "_from": "readable-stream@~1.0.26", + "_npmVersion": "2.0.2", + "_nodeVersion": "0.10.31", + "_npmUser": { + "name": "rvagg", + "email": "rod@vagg.org" + }, + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + }, + { + "name": "tootallnate", + "email": "nathan@tootallnate.net" + }, + { + "name": "rvagg", + "email": "rod@vagg.org" + } + ], + "dist": { + "shasum": "6b44a88ba984cd0ec0834ae7d59a47c39aef48ec", + "tarball": "http://registry.npmjs.org/readable-stream/-/readable-stream-1.0.32.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.32.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bl/node_modules/readable-stream/passthrough.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bl/node_modules/readable-stream/passthrough.js new file mode 100644 index 0000000..27e8d8a --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bl/node_modules/readable-stream/passthrough.js @@ -0,0 +1 @@ +module.exports = require("./lib/_stream_passthrough.js") diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bl/node_modules/readable-stream/readable.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bl/node_modules/readable-stream/readable.js new file mode 100644 index 0000000..4d1ddfc --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bl/node_modules/readable-stream/readable.js @@ -0,0 +1,6 @@ +exports = module.exports = require('./lib/_stream_readable.js'); +exports.Readable = exports; +exports.Writable = require('./lib/_stream_writable.js'); +exports.Duplex = require('./lib/_stream_duplex.js'); +exports.Transform = require('./lib/_stream_transform.js'); +exports.PassThrough = require('./lib/_stream_passthrough.js'); diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bl/node_modules/readable-stream/transform.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bl/node_modules/readable-stream/transform.js new file mode 100644 index 0000000..5d482f0 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bl/node_modules/readable-stream/transform.js @@ -0,0 +1 @@ +module.exports = require("./lib/_stream_transform.js") diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bl/node_modules/readable-stream/writable.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bl/node_modules/readable-stream/writable.js new file mode 100644 index 0000000..e1e9efd --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bl/node_modules/readable-stream/writable.js @@ -0,0 +1 @@ +module.exports = require("./lib/_stream_writable.js") diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bl/package.json b/packages/Bower.1.3.11/node_modules/bower/node_modules/bl/package.json new file mode 100644 index 0000000..ea9cd6c --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bl/package.json @@ -0,0 +1,61 @@ +{ + "name": "bl", + "version": "0.9.3", + "description": "Buffer List: collect buffers and access with a standard readable Buffer interface, streamable too!", + "main": "bl.js", + "scripts": { + "test": "node test/test.js | faucet", + "test-local": "brtapsauce-local test/basic-test.js" + }, + "repository": { + "type": "git", + "url": "https://github.com/rvagg/bl.git" + }, + "homepage": "https://github.com/rvagg/bl", + "authors": [ + "Rod Vagg (https://github.com/rvagg)", + "Matteo Collina (https://github.com/mcollina)", + "Jarett Cruger (https://github.com/jcrugzz)" + ], + "keywords": [ + "buffer", + "buffers", + "stream", + "awesomesauce" + ], + "license": "MIT", + "dependencies": { + "readable-stream": "~1.0.26" + }, + "devDependencies": { + "tape": "~2.12.3", + "hash_file": "~0.1.1", + "faucet": "~0.0.1", + "brtapsauce": "~0.3.0" + }, + "gitHead": "4987a76bf6bafd7616e62c7023c955e62f3a9461", + "bugs": { + "url": "https://github.com/rvagg/bl/issues" + }, + "_id": "bl@0.9.3", + "_shasum": "c41eff3e7cb31bde107c8f10076d274eff7f7d44", + "_from": "bl@0.9.3", + "_npmVersion": "1.4.27", + "_npmUser": { + "name": "rvagg", + "email": "rod@vagg.org" + }, + "maintainers": [ + { + "name": "rvagg", + "email": "rod@vagg.org" + } + ], + "dist": { + "shasum": "c41eff3e7cb31bde107c8f10076d274eff7f7d44", + "tarball": "http://registry.npmjs.org/bl/-/bl-0.9.3.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/bl/-/bl-0.9.3.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/boom/index.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/boom/index.js new file mode 100644 index 0000000..4cc88b3 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/boom/index.js @@ -0,0 +1 @@ +module.exports = require('./lib'); \ No newline at end of file diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/boom/lib/index.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/boom/lib/index.js new file mode 100644 index 0000000..0bbeed9 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/boom/lib/index.js @@ -0,0 +1,207 @@ +// Load modules + +var Http = require('http'); +var NodeUtil = require('util'); +var Hoek = require('hoek'); + + +// Declare internals + +var internals = {}; + + +exports = module.exports = internals.Boom = function (/* (new Error) or (code, message) */) { + + var self = this; + + Hoek.assert(this.constructor === internals.Boom, 'Error must be instantiated using new'); + + Error.call(this); + this.isBoom = true; + + this.response = { + code: 0, + payload: {}, + headers: {} + // type: 'content-type' + }; + + if (arguments[0] instanceof Error) { + + // Error + + var error = arguments[0]; + + this.data = error; + this.response.code = error.code || 500; + if (error.message) { + this.message = error.message; + } + } + else { + + // code, message + + var code = arguments[0]; + var message = arguments[1]; + + Hoek.assert(!isNaN(parseFloat(code)) && isFinite(code) && code >= 400, 'First argument must be a number (400+)'); + + this.response.code = code; + if (message) { + this.message = message; + } + } + + // Response format + + this.reformat(); + + return this; +}; + +NodeUtil.inherits(internals.Boom, Error); + + +internals.Boom.prototype.reformat = function () { + + this.response.payload.code = this.response.code; + this.response.payload.error = Http.STATUS_CODES[this.response.code] || 'Unknown'; + if (this.message) { + this.response.payload.message = Hoek.escapeHtml(this.message); // Prevent XSS from error message + } +}; + + +// Utilities + +internals.Boom.badRequest = function (message) { + + return new internals.Boom(400, message); +}; + + +internals.Boom.unauthorized = function (message, scheme, attributes) { // Or function (message, wwwAuthenticate[]) + + var err = new internals.Boom(401, message); + + if (!scheme) { + return err; + } + + var wwwAuthenticate = ''; + + if (typeof scheme === 'string') { + + // function (message, scheme, attributes) + + wwwAuthenticate = scheme; + if (attributes) { + var names = Object.keys(attributes); + for (var i = 0, il = names.length; i < il; ++i) { + if (i) { + wwwAuthenticate += ','; + } + + var value = attributes[names[i]]; + if (value === null || + value === undefined) { // Value can be zero + + value = ''; + } + wwwAuthenticate += ' ' + names[i] + '="' + Hoek.escapeHeaderAttribute(value.toString()) + '"'; + } + } + + if (message) { + if (attributes) { + wwwAuthenticate += ','; + } + wwwAuthenticate += ' error="' + Hoek.escapeHeaderAttribute(message) + '"'; + } + else { + err.isMissing = true; + } + } + else { + + // function (message, wwwAuthenticate[]) + + var wwwArray = scheme; + for (var i = 0, il = wwwArray.length; i < il; ++i) { + if (i) { + wwwAuthenticate += ', '; + } + + wwwAuthenticate += wwwArray[i]; + } + } + + err.response.headers['WWW-Authenticate'] = wwwAuthenticate; + + return err; +}; + + +internals.Boom.clientTimeout = function (message) { + + return new internals.Boom(408, message); +}; + + +internals.Boom.serverTimeout = function (message) { + + return new internals.Boom(503, message); +}; + + +internals.Boom.forbidden = function (message) { + + return new internals.Boom(403, message); +}; + + +internals.Boom.notFound = function (message) { + + return new internals.Boom(404, message); +}; + + +internals.Boom.internal = function (message, data) { + + var err = new internals.Boom(500, message); + + if (data && data.stack) { + err.trace = data.stack.split('\n'); + err.outterTrace = Hoek.displayStack(1); + } + else { + err.trace = Hoek.displayStack(1); + } + + err.data = data; + err.response.payload.message = 'An internal server error occurred'; // Hide actual error from user + + return err; +}; + + +internals.Boom.passThrough = function (code, payload, contentType, headers) { + + var err = new internals.Boom(500, 'Pass-through'); // 500 code is only used to initialize + + err.data = { + code: code, + payload: payload, + type: contentType + }; + + err.response.code = code; + err.response.type = contentType; + err.response.headers = headers; + err.response.payload = payload; + + return err; +}; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/boom/package.json b/packages/Bower.1.3.11/node_modules/bower/node_modules/boom/package.json new file mode 100644 index 0000000..f22eac6 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/boom/package.json @@ -0,0 +1,64 @@ +{ + "name": "boom", + "description": "HTTP-friendly error objects", + "version": "0.4.2", + "author": { + "name": "Eran Hammer", + "email": "eran@hueniverse.com", + "url": "http://hueniverse.com" + }, + "contributors": [], + "repository": { + "type": "git", + "url": "git://github.com/spumko/boom" + }, + "main": "index", + "keywords": [ + "error", + "http" + ], + "engines": { + "node": ">=0.8.0" + }, + "dependencies": { + "hoek": "0.9.x" + }, + "devDependencies": { + "lab": "0.1.x", + "complexity-report": "0.x.x" + }, + "scripts": { + "test": "make test-cov" + }, + "licenses": [ + { + "type": "BSD", + "url": "http://github.com/spumko/boom/raw/master/LICENSE" + } + ], + "_id": "boom@0.4.2", + "dist": { + "shasum": "7a636e9ded4efcefb19cef4947a3c67dfaee911b", + "tarball": "http://registry.npmjs.org/boom/-/boom-0.4.2.tgz" + }, + "_from": "boom@0.4.2", + "_npmVersion": "1.2.18", + "_npmUser": { + "name": "hueniverse", + "email": "eran@hueniverse.com" + }, + "maintainers": [ + { + "name": "hueniverse", + "email": "eran@hueniverse.com" + } + ], + "directories": {}, + "_shasum": "7a636e9ded4efcefb19cef4947a3c67dfaee911b", + "_resolved": "https://registry.npmjs.org/boom/-/boom-0.4.2.tgz", + "bugs": { + "url": "https://github.com/spumko/boom/issues" + }, + "readme": "ERROR: No README data found!", + "homepage": "https://github.com/spumko/boom" +} diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/lib/Config.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/lib/Config.js new file mode 100644 index 0000000..7da02e9 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/lib/Config.js @@ -0,0 +1,76 @@ +var lang = require('mout/lang'); +var object = require('mout/object'); +var rc = require('./util/rc'); +var defaults = require('./util/defaults'); +var expand = require('./util/expand'); +var path = require('path'); + +function Config(cwd) { + this._cwd = cwd || process.cwd(); + this._config = {}; +} + +Config.prototype.load = function () { + this._config = rc('bower', defaults, this._cwd); + return this; +}; + +Config.prototype.get = function (key) { + // TODO +}; + +Config.prototype.set = function (key, value) { + // TODO + return this; +}; + +Config.prototype.del = function (key, value) { + // TODO + return this; +}; + +Config.prototype.save = function (where, callback) { + // TODO +}; + +Config.prototype.toObject = function () { + var config = lang.deepClone(this._config); + + config = Config.normalise(config); + return config; +}; + +Config.create = function (cwd) { + return new Config(cwd); +}; + +Config.read = function (cwd) { + var config = new Config(cwd); + return config.load().toObject(); +}; + +Config.normalise = function (rawConfig) { + var config = {}; + + // Mix in defaults and raw config + object.deepMixIn(config, expand(defaults), expand(rawConfig)); + + // Some backwards compatible things.. + config.shorthandResolver = config.shorthandResolver + .replace(/\{\{\{/g, '{{') + .replace(/\}\}\}/g, '}}'); + + // Ensure that every registry endpoint does not end with / + config.registry.search = config.registry.search.map(function (url) { + return url.replace(/\/+$/, ''); + }); + config.registry.register = config.registry.register.replace(/\/+$/, ''); + config.registry.publish = config.registry.publish.replace(/\/+$/, ''); + config.tmp = path.resolve(config.tmp); + + return config; +}; + +Config.DEFAULT_REGISTRY = defaults.registry; + +module.exports = Config; diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/lib/util/defaults.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/lib/util/defaults.js new file mode 100644 index 0000000..c742cbd --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/lib/util/defaults.js @@ -0,0 +1,44 @@ +var path = require('path'); +var paths = require('./paths'); + +// Guess proxy defined in the env +/*jshint camelcase: false*/ +var proxy = process.env.HTTP_PROXY + || process.env.http_proxy + || null; + +var httpsProxy = process.env.HTTPS_PROXY + || process.env.https_proxy + || proxy; +/*jshint camelcase: true*/ + +// Use a well known user agent (in this case, curl) when using a proxy, +// to avoid potential filtering on many corporate proxies with blank or unknown agents +var userAgent = !proxy && !httpsProxy + ? 'node/' + process.version + ' ' + process.platform + ' ' + process.arch + : 'curl/7.21.4 (universal-apple-darwin11.0) libcurl/7.21.4 OpenSSL/0.9.8r zlib/1.2.5'; + +var defaults = { + 'cwd': process.cwd(), + 'directory': 'bower_components', + 'registry': 'https://bower.herokuapp.com', + 'shorthand-resolver': 'git://github.com/{{owner}}/{{package}}.git', + 'tmp': paths.tmp, + 'proxy': proxy, + 'https-proxy': httpsProxy, + 'timeout': 30000, + 'ca': { search: [] }, + 'strict-ssl': true, + 'user-agent': userAgent, + 'color': true, + 'interactive': null, + 'storage': { + packages: path.join(paths.cache, 'packages'), + links: path.join(paths.data, 'links'), + completion: path.join(paths.data, 'completion'), + registry: path.join(paths.cache, 'registry'), + empty: path.join(paths.data, 'empty') // Empty dir, used in GIT_TEMPLATE_DIR among others + } +}; + +module.exports = defaults; diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/lib/util/expand.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/lib/util/expand.js new file mode 100644 index 0000000..6243f74 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/lib/util/expand.js @@ -0,0 +1,55 @@ +var object = require('mout/object'); +var lang = require('mout/lang'); +var string = require('mout/string'); + +function camelCase(config) { + var camelCased = {}; + + // Camel case + object.forOwn(config, function (value, key) { + // Ignore null values + if (value == null) { + return; + } + + key = string.camelCase(key.replace(/_/g, '-')); + camelCased[key] = lang.isPlainObject(value) ? camelCase(value) : value; + }); + + return camelCased; +} + +function expand(config) { + config = camelCase(config); + + // Expand some properties + // Registry + if (typeof config.registry === 'string') { + config.registry = { + search: [config.registry], + register: config.registry, + publish: config.registry + }; + } else if (config.registry) { + if (config.registry.search && !Array.isArray(config.registry.search)) { + config.registry.search = [config.registry.search]; + } + } + + // CA + if (typeof config.ca === 'string') { + config.ca = { + search: [config.ca], + register: config.ca, + publish: config.ca + }; + } else if (config.ca) { + if (config.ca.search && !Array.isArray(config.ca.search)) { + config.ca.search = [config.ca.search]; + } + } + + return config; +} + +module.exports = expand; diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/lib/util/paths.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/lib/util/paths.js new file mode 100644 index 0000000..566ba72 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/lib/util/paths.js @@ -0,0 +1,44 @@ +var os = require('os'); +var path = require('path'); +var osenv = require('osenv'); +var crypto = require('crypto'); + +function generateFakeUser() { + var uid = process.pid + '-' + Date.now() + '-' + Math.floor(Math.random() * 1000000); + return crypto.createHash('md5').update(uid).digest('hex'); +} + +// Assume XDG defaults +// See: http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html +var paths = { + config: process.env.XDG_CONFIG_HOME, + data: process.env.XDG_DATA_HOME, + cache: process.env.XDG_CACHE_HOME +}; + +// Guess some needed properties based on the user OS +var user = (osenv.user() || generateFakeUser()).replace(/\\/g, '-'); +var tmp = path.join(os.tmpdir ? os.tmpdir() : os.tmpDir(), user); +var home = osenv.home(); +var base; + +// Fallbacks for windows +if (process.platform === 'win32') { + base = path.resolve(process.env.APPDATA || home || tmp); + base = path.join(base, 'bower'); + + paths.config = paths.config || path.join(base, 'config'); + paths.data = paths.data || path.join(base, 'data'); + paths.cache = paths.cache || path.join(base, 'cache'); +// Fallbacks for other operating systems +} else { + base = path.resolve(home || tmp); + + paths.config = paths.config || path.join(base, '.config/bower'); + paths.data = paths.data || path.join(base, '.local/share/bower'); + paths.cache = paths.cache || path.join(base, '.cache/bower'); +} + +paths.tmp = path.resolve(path.join(tmp, 'bower')); + +module.exports = paths; diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/lib/util/rc.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/lib/util/rc.js new file mode 100644 index 0000000..8ab86c1 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/lib/util/rc.js @@ -0,0 +1,116 @@ +var path = require('path'); +var fs = require('graceful-fs'); +var optimist = require('optimist'); +var osenv = require('osenv'); +var object = require('mout/object'); +var string = require('mout/string'); +var paths = require('./paths'); + +var win = process.platform === 'win32'; +var home = osenv.home(); + +function rc(name, defaults, cwd, argv) { + var argvConfig; + + defaults = defaults || {}; + cwd = cwd || process.cwd(); + argv = argv || optimist.argv; + + // Parse --config.foo=false + argvConfig = object.map(argv.config || {}, function (value) { + return value === 'false' ? false : value; + }); + + return object.deepMixIn.apply(null, [ + {}, + defaults, + { cwd: cwd }, + win ? {} : json(path.join('/etc', name + 'rc')), + !home ? {} : json(path.join(home, '.' + name + 'rc')), + json(path.join(paths.config, name + 'rc')), + json(find('.' + name + 'rc', cwd)), + env(name + '_'), + argvConfig + ]); +} + +function parse(content, file) { + var error; + + if (!content.trim().length) { + return {}; + } + + try { + return JSON.parse(content); + } catch (e) { + if (file) { + error = new Error('Unable to parse ' + file + ': ' + e.message); + } else { + error = new Error('Unable to parse rc config: ' + e.message); + } + + error.details = content; + error.code = 'EMALFORMED'; + throw error; + } + + return null; +} + +function json(file) { + var content; + + try { + content = fs.readFileSync(file).toString(); + } catch (err) { + return null; + } + + return parse(content, file); +} + +function env(prefix) { + var obj = {}; + var prefixLength = prefix.length; + + prefix = prefix.toLowerCase(); + + object.forOwn(process.env, function (value, key) { + key = key.toLowerCase(); + + if (string.startsWith(key, prefix)) { + var parsedKey = key + .substr(prefixLength) + .replace(/__/g, '.') // __ is used for nesting + .replace(/_/g, '-'); // _ is used as a - separator + object.set(obj, parsedKey, value); + } + }); + + return obj; +} + +function find(filename, dir) { + var walk = function (filename, dir) { + var file = path.join(dir, filename); + var parent = path.dirname(dir); + + try { + fs.statSync(file); + return file; + } catch (err) { + // Check if we hit the root + if (parent === dir) { + return null; + } + + return walk(filename, parent); + } + }; + + dir = dir || process.cwd(); + return walk(filename, dir); +} + +module.exports = rc; diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/graceful-fs/graceful-fs.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/graceful-fs/graceful-fs.js new file mode 100644 index 0000000..c84db91 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/graceful-fs/graceful-fs.js @@ -0,0 +1,160 @@ +// Monkey-patching the fs module. +// It's ugly, but there is simply no other way to do this. +var fs = module.exports = require('fs') + +var assert = require('assert') + +// fix up some busted stuff, mostly on windows and old nodes +require('./polyfills.js') + +// The EMFILE enqueuing stuff + +var util = require('util') + +function noop () {} + +var debug = noop +if (util.debuglog) + debug = util.debuglog('gfs') +else if (/\bgfs\b/i.test(process.env.NODE_DEBUG || '')) + debug = function() { + var m = util.format.apply(util, arguments) + m = 'GFS: ' + m.split(/\n/).join('\nGFS: ') + console.error(m) + } + +if (/\bgfs\b/i.test(process.env.NODE_DEBUG || '')) { + process.on('exit', function() { + debug('fds', fds) + debug(queue) + assert.equal(queue.length, 0) + }) +} + + +var originalOpen = fs.open +fs.open = open + +function open(path, flags, mode, cb) { + if (typeof mode === "function") cb = mode, mode = null + if (typeof cb !== "function") cb = noop + new OpenReq(path, flags, mode, cb) +} + +function OpenReq(path, flags, mode, cb) { + this.path = path + this.flags = flags + this.mode = mode + this.cb = cb + Req.call(this) +} + +util.inherits(OpenReq, Req) + +OpenReq.prototype.process = function() { + originalOpen.call(fs, this.path, this.flags, this.mode, this.done) +} + +var fds = {} +OpenReq.prototype.done = function(er, fd) { + debug('open done', er, fd) + if (fd) + fds['fd' + fd] = this.path + Req.prototype.done.call(this, er, fd) +} + + +var originalReaddir = fs.readdir +fs.readdir = readdir + +function readdir(path, cb) { + if (typeof cb !== "function") cb = noop + new ReaddirReq(path, cb) +} + +function ReaddirReq(path, cb) { + this.path = path + this.cb = cb + Req.call(this) +} + +util.inherits(ReaddirReq, Req) + +ReaddirReq.prototype.process = function() { + originalReaddir.call(fs, this.path, this.done) +} + +ReaddirReq.prototype.done = function(er, files) { + if (files && files.sort) + files = files.sort() + Req.prototype.done.call(this, er, files) + onclose() +} + + +var originalClose = fs.close +fs.close = close + +function close (fd, cb) { + debug('close', fd) + if (typeof cb !== "function") cb = noop + delete fds['fd' + fd] + originalClose.call(fs, fd, function(er) { + onclose() + cb(er) + }) +} + + +var originalCloseSync = fs.closeSync +fs.closeSync = closeSync + +function closeSync (fd) { + try { + return originalCloseSync(fd) + } finally { + onclose() + } +} + + +// Req class +function Req () { + // start processing + this.done = this.done.bind(this) + this.failures = 0 + this.process() +} + +Req.prototype.done = function (er, result) { + var tryAgain = false + if (er) { + var code = er.code + var tryAgain = code === "EMFILE" + if (process.platform === "win32") + tryAgain = tryAgain || code === "OK" + } + + if (tryAgain) { + this.failures ++ + enqueue(this) + } else { + var cb = this.cb + cb(er, result) + } +} + +var queue = [] + +function enqueue(req) { + queue.push(req) + debug('enqueue %d %s', queue.length, req.constructor.name, req) +} + +function onclose() { + var req = queue.shift() + if (req) { + debug('process', req.constructor.name, req) + req.process() + } +} diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/graceful-fs/package.json b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/graceful-fs/package.json new file mode 100644 index 0000000..dc22856 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/graceful-fs/package.json @@ -0,0 +1,65 @@ +{ + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me" + }, + "name": "graceful-fs", + "description": "A drop-in replacement for fs, making various improvements.", + "version": "2.0.3", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/node-graceful-fs.git" + }, + "main": "graceful-fs.js", + "engines": { + "node": ">=0.4.0" + }, + "directories": { + "test": "test" + }, + "scripts": { + "test": "tap test/*.js" + }, + "keywords": [ + "fs", + "module", + "reading", + "retry", + "retries", + "queue", + "error", + "errors", + "handling", + "EMFILE", + "EAGAIN", + "EINVAL", + "EPERM", + "EACCESS" + ], + "license": "BSD", + "bugs": { + "url": "https://github.com/isaacs/node-graceful-fs/issues" + }, + "homepage": "https://github.com/isaacs/node-graceful-fs", + "_id": "graceful-fs@2.0.3", + "dist": { + "shasum": "7cd2cdb228a4a3f36e95efa6cc142de7d1a136d0", + "tarball": "http://registry.npmjs.org/graceful-fs/-/graceful-fs-2.0.3.tgz" + }, + "_from": "graceful-fs@~2.0.0", + "_npmVersion": "1.4.6", + "_npmUser": { + "name": "isaacs", + "email": "i@izs.me" + }, + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + } + ], + "_shasum": "7cd2cdb228a4a3f36e95efa6cc142de7d1a136d0", + "_resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-2.0.3.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/graceful-fs/polyfills.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/graceful-fs/polyfills.js new file mode 100644 index 0000000..afc83b3 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/graceful-fs/polyfills.js @@ -0,0 +1,228 @@ +var fs = require('fs') +var constants = require('constants') + +var origCwd = process.cwd +var cwd = null +process.cwd = function() { + if (!cwd) + cwd = origCwd.call(process) + return cwd +} +var chdir = process.chdir +process.chdir = function(d) { + cwd = null + chdir.call(process, d) +} + +// (re-)implement some things that are known busted or missing. + +// lchmod, broken prior to 0.6.2 +// back-port the fix here. +if (constants.hasOwnProperty('O_SYMLINK') && + process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) { + fs.lchmod = function (path, mode, callback) { + callback = callback || noop + fs.open( path + , constants.O_WRONLY | constants.O_SYMLINK + , mode + , function (err, fd) { + if (err) { + callback(err) + return + } + // prefer to return the chmod error, if one occurs, + // but still try to close, and report closing errors if they occur. + fs.fchmod(fd, mode, function (err) { + fs.close(fd, function(err2) { + callback(err || err2) + }) + }) + }) + } + + fs.lchmodSync = function (path, mode) { + var fd = fs.openSync(path, constants.O_WRONLY | constants.O_SYMLINK, mode) + + // prefer to return the chmod error, if one occurs, + // but still try to close, and report closing errors if they occur. + var err, err2 + try { + var ret = fs.fchmodSync(fd, mode) + } catch (er) { + err = er + } + try { + fs.closeSync(fd) + } catch (er) { + err2 = er + } + if (err || err2) throw (err || err2) + return ret + } +} + + +// lutimes implementation, or no-op +if (!fs.lutimes) { + if (constants.hasOwnProperty("O_SYMLINK")) { + fs.lutimes = function (path, at, mt, cb) { + fs.open(path, constants.O_SYMLINK, function (er, fd) { + cb = cb || noop + if (er) return cb(er) + fs.futimes(fd, at, mt, function (er) { + fs.close(fd, function (er2) { + return cb(er || er2) + }) + }) + }) + } + + fs.lutimesSync = function (path, at, mt) { + var fd = fs.openSync(path, constants.O_SYMLINK) + , err + , err2 + , ret + + try { + var ret = fs.futimesSync(fd, at, mt) + } catch (er) { + err = er + } + try { + fs.closeSync(fd) + } catch (er) { + err2 = er + } + if (err || err2) throw (err || err2) + return ret + } + + } else if (fs.utimensat && constants.hasOwnProperty("AT_SYMLINK_NOFOLLOW")) { + // maybe utimensat will be bound soonish? + fs.lutimes = function (path, at, mt, cb) { + fs.utimensat(path, at, mt, constants.AT_SYMLINK_NOFOLLOW, cb) + } + + fs.lutimesSync = function (path, at, mt) { + return fs.utimensatSync(path, at, mt, constants.AT_SYMLINK_NOFOLLOW) + } + + } else { + fs.lutimes = function (_a, _b, _c, cb) { process.nextTick(cb) } + fs.lutimesSync = function () {} + } +} + + +// https://github.com/isaacs/node-graceful-fs/issues/4 +// Chown should not fail on einval or eperm if non-root. + +fs.chown = chownFix(fs.chown) +fs.fchown = chownFix(fs.fchown) +fs.lchown = chownFix(fs.lchown) + +fs.chownSync = chownFixSync(fs.chownSync) +fs.fchownSync = chownFixSync(fs.fchownSync) +fs.lchownSync = chownFixSync(fs.lchownSync) + +function chownFix (orig) { + if (!orig) return orig + return function (target, uid, gid, cb) { + return orig.call(fs, target, uid, gid, function (er, res) { + if (chownErOk(er)) er = null + cb(er, res) + }) + } +} + +function chownFixSync (orig) { + if (!orig) return orig + return function (target, uid, gid) { + try { + return orig.call(fs, target, uid, gid) + } catch (er) { + if (!chownErOk(er)) throw er + } + } +} + +function chownErOk (er) { + // if there's no getuid, or if getuid() is something other than 0, + // and the error is EINVAL or EPERM, then just ignore it. + // This specific case is a silent failure in cp, install, tar, + // and most other unix tools that manage permissions. + // When running as root, or if other types of errors are encountered, + // then it's strict. + if (!er || (!process.getuid || process.getuid() !== 0) + && (er.code === "EINVAL" || er.code === "EPERM")) return true +} + + +// if lchmod/lchown do not exist, then make them no-ops +if (!fs.lchmod) { + fs.lchmod = function (path, mode, cb) { + process.nextTick(cb) + } + fs.lchmodSync = function () {} +} +if (!fs.lchown) { + fs.lchown = function (path, uid, gid, cb) { + process.nextTick(cb) + } + fs.lchownSync = function () {} +} + + + +// on Windows, A/V software can lock the directory, causing this +// to fail with an EACCES or EPERM if the directory contains newly +// created files. Try again on failure, for up to 1 second. +if (process.platform === "win32") { + var rename_ = fs.rename + fs.rename = function rename (from, to, cb) { + var start = Date.now() + rename_(from, to, function CB (er) { + if (er + && (er.code === "EACCES" || er.code === "EPERM") + && Date.now() - start < 1000) { + return rename_(from, to, CB) + } + cb(er) + }) + } +} + + +// if read() returns EAGAIN, then just try it again. +var read = fs.read +fs.read = function (fd, buffer, offset, length, position, callback_) { + var callback + if (callback_ && typeof callback_ === 'function') { + var eagCounter = 0 + callback = function (er, _, __) { + if (er && er.code === 'EAGAIN' && eagCounter < 10) { + eagCounter ++ + return read.call(fs, fd, buffer, offset, length, position, callback) + } + callback_.apply(this, arguments) + } + } + return read.call(fs, fd, buffer, offset, length, position, callback) +} + +var readSync = fs.readSync +fs.readSync = function (fd, buffer, offset, length, position) { + var eagCounter = 0 + while (true) { + try { + return readSync.call(fs, fd, buffer, offset, length, position) + } catch (er) { + if (er.code === 'EAGAIN' && eagCounter < 10) { + eagCounter ++ + continue + } + throw er + } + } +} + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array.js new file mode 100644 index 0000000..0ccae2d --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array.js @@ -0,0 +1,50 @@ + + +//automatically generated, do not edit! +//run `node build` instead +module.exports = { + 'append' : require('./array/append'), + 'collect' : require('./array/collect'), + 'combine' : require('./array/combine'), + 'compact' : require('./array/compact'), + 'contains' : require('./array/contains'), + 'difference' : require('./array/difference'), + 'every' : require('./array/every'), + 'filter' : require('./array/filter'), + 'find' : require('./array/find'), + 'findIndex' : require('./array/findIndex'), + 'findLast' : require('./array/findLast'), + 'findLastIndex' : require('./array/findLastIndex'), + 'flatten' : require('./array/flatten'), + 'forEach' : require('./array/forEach'), + 'indexOf' : require('./array/indexOf'), + 'insert' : require('./array/insert'), + 'intersection' : require('./array/intersection'), + 'invoke' : require('./array/invoke'), + 'join' : require('./array/join'), + 'lastIndexOf' : require('./array/lastIndexOf'), + 'map' : require('./array/map'), + 'max' : require('./array/max'), + 'min' : require('./array/min'), + 'pick' : require('./array/pick'), + 'pluck' : require('./array/pluck'), + 'range' : require('./array/range'), + 'reduce' : require('./array/reduce'), + 'reduceRight' : require('./array/reduceRight'), + 'reject' : require('./array/reject'), + 'remove' : require('./array/remove'), + 'removeAll' : require('./array/removeAll'), + 'shuffle' : require('./array/shuffle'), + 'slice' : require('./array/slice'), + 'some' : require('./array/some'), + 'sort' : require('./array/sort'), + 'sortBy' : require('./array/sortBy'), + 'split' : require('./array/split'), + 'toLookup' : require('./array/toLookup'), + 'union' : require('./array/union'), + 'unique' : require('./array/unique'), + 'xor' : require('./array/xor'), + 'zip' : require('./array/zip') +}; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/append.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/append.js new file mode 100644 index 0000000..bf74037 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/append.js @@ -0,0 +1,21 @@ + + + /** + * Appends an array to the end of another. + * The first array will be modified. + */ + function append(arr1, arr2) { + if (arr2 == null) { + return arr1; + } + + var pad = arr1.length, + i = -1, + len = arr2.length; + while (++i < len) { + arr1[pad + i] = arr2[i]; + } + return arr1; + } + module.exports = append; + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/collect.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/collect.js new file mode 100644 index 0000000..5863749 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/collect.js @@ -0,0 +1,27 @@ +var append = require('./append'); +var makeIterator = require('../function/makeIterator_'); + + /** + * Maps the items in the array and concatenates the result arrays. + */ + function collect(arr, callback, thisObj){ + callback = makeIterator(callback, thisObj); + var results = []; + if (arr == null) { + return results; + } + + var i = -1, len = arr.length; + while (++i < len) { + var value = callback(arr[i], i, arr); + if (value != null) { + append(results, value); + } + } + + return results; + } + + module.exports = collect; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/combine.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/combine.js new file mode 100644 index 0000000..d66e621 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/combine.js @@ -0,0 +1,22 @@ +var indexOf = require('./indexOf'); + + /** + * Combines an array with all the items of another. + * Does not allow duplicates and is case and type sensitive. + */ + function combine(arr1, arr2) { + if (arr2 == null) { + return arr1; + } + + var i = -1, len = arr2.length; + while (++i < len) { + if (indexOf(arr1, arr2[i]) === -1) { + arr1.push(arr2[i]); + } + } + + return arr1; + } + module.exports = combine; + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/compact.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/compact.js new file mode 100644 index 0000000..74c176e --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/compact.js @@ -0,0 +1,13 @@ +var filter = require('./filter'); + + /** + * Remove all null/undefined items from array. + */ + function compact(arr) { + return filter(arr, function(val){ + return (val != null); + }); + } + + module.exports = compact; + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/contains.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/contains.js new file mode 100644 index 0000000..92bb6ad --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/contains.js @@ -0,0 +1,10 @@ +var indexOf = require('./indexOf'); + + /** + * If array contains values. + */ + function contains(arr, val) { + return indexOf(arr, val) !== -1; + } + module.exports = contains; + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/difference.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/difference.js new file mode 100644 index 0000000..ca57524 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/difference.js @@ -0,0 +1,23 @@ +var unique = require('./unique'); +var filter = require('./filter'); +var some = require('./some'); +var contains = require('./contains'); +var slice = require('./slice'); + + + /** + * Return a new Array with elements that aren't present in the other Arrays. + */ + function difference(arr) { + var arrs = slice(arguments, 1), + result = filter(unique(arr), function(needle){ + return !some(arrs, function(haystack){ + return contains(haystack, needle); + }); + }); + return result; + } + + module.exports = difference; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/every.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/every.js new file mode 100644 index 0000000..ac59883 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/every.js @@ -0,0 +1,27 @@ +var makeIterator = require('../function/makeIterator_'); + + /** + * Array every + */ + function every(arr, callback, thisObj) { + callback = makeIterator(callback, thisObj); + var result = true; + if (arr == null) { + return result; + } + + var i = -1, len = arr.length; + while (++i < len) { + // we iterate over sparse items since there is no way to make it + // work properly on IE 7-8. see #64 + if (!callback(arr[i], i, arr) ) { + result = false; + break; + } + } + + return result; + } + + module.exports = every; + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/filter.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/filter.js new file mode 100644 index 0000000..f0e7419 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/filter.js @@ -0,0 +1,26 @@ +var makeIterator = require('../function/makeIterator_'); + + /** + * Array filter + */ + function filter(arr, callback, thisObj) { + callback = makeIterator(callback, thisObj); + var results = []; + if (arr == null) { + return results; + } + + var i = -1, len = arr.length, value; + while (++i < len) { + value = arr[i]; + if (callback(value, i, arr)) { + results.push(value); + } + } + + return results; + } + + module.exports = filter; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/find.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/find.js new file mode 100644 index 0000000..b4a7313 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/find.js @@ -0,0 +1,13 @@ +var findIndex = require('./findIndex'); + + /** + * Returns first item that matches criteria + */ + function find(arr, iterator, thisObj){ + var idx = findIndex(arr, iterator, thisObj); + return idx >= 0? arr[idx] : void(0); + } + + module.exports = find; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/findIndex.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/findIndex.js new file mode 100644 index 0000000..53f22a5 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/findIndex.js @@ -0,0 +1,23 @@ +var makeIterator = require('../function/makeIterator_'); + + /** + * Returns the index of the first item that matches criteria + */ + function findIndex(arr, iterator, thisObj){ + iterator = makeIterator(iterator, thisObj); + if (arr == null) { + return -1; + } + + var i = -1, len = arr.length; + while (++i < len) { + if (iterator(arr[i], i, arr)) { + return i; + } + } + + return -1; + } + + module.exports = findIndex; + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/findLast.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/findLast.js new file mode 100644 index 0000000..84ba4bf --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/findLast.js @@ -0,0 +1,13 @@ +var findLastIndex = require('./findLastIndex'); + + /** + * Returns last item that matches criteria + */ + function findLast(arr, iterator, thisObj){ + var idx = findLastIndex(arr, iterator, thisObj); + return idx >= 0? arr[idx] : void(0); + } + + module.exports = findLast; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/findLastIndex.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/findLastIndex.js new file mode 100644 index 0000000..d5aacdc --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/findLastIndex.js @@ -0,0 +1,24 @@ +var makeIterator = require('../function/makeIterator_'); + + /** + * Returns the index of the last item that matches criteria + */ + function findLastIndex(arr, iterator, thisObj){ + iterator = makeIterator(iterator, thisObj); + if (arr == null) { + return -1; + } + + var n = arr.length; + while (n-- >= 0) { + if (iterator(arr[n], n, arr)) { + return n; + } + } + + return -1; + } + + module.exports = findLastIndex; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/flatten.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/flatten.js new file mode 100644 index 0000000..aa9757a --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/flatten.js @@ -0,0 +1,43 @@ +var isArray = require('../lang/isArray'); +var append = require('./append'); + + /* + * Helper function to flatten to a destination array. + * Used to remove the need to create intermediate arrays while flattening. + */ + function flattenTo(arr, result, level) { + if (arr == null) { + return result; + } else if (level === 0) { + append(result, arr); + return result; + } + + var value, + i = -1, + len = arr.length; + while (++i < len) { + value = arr[i]; + if (isArray(value)) { + flattenTo(value, result, level - 1); + } else { + result.push(value); + } + } + return result; + } + + /** + * Recursively flattens an array. + * A new array containing all the elements is returned. + * If `shallow` is true, it will only flatten one level. + */ + function flatten(arr, level) { + level = level == null? -1 : level; + return flattenTo(arr, [], level); + } + + module.exports = flatten; + + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/forEach.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/forEach.js new file mode 100644 index 0000000..268e506 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/forEach.js @@ -0,0 +1,23 @@ + + + /** + * Array forEach + */ + function forEach(arr, callback, thisObj) { + if (arr == null) { + return; + } + var i = -1, + len = arr.length; + while (++i < len) { + // we iterate over sparse items since there is no way to make it + // work properly on IE 7-8. see #64 + if ( callback.call(thisObj, arr[i], i, arr) === false ) { + break; + } + } + } + + module.exports = forEach; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/indexOf.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/indexOf.js new file mode 100644 index 0000000..6a9ac83 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/indexOf.js @@ -0,0 +1,28 @@ + + + /** + * Array.indexOf + */ + function indexOf(arr, item, fromIndex) { + fromIndex = fromIndex || 0; + if (arr == null) { + return -1; + } + + var len = arr.length, + i = fromIndex < 0 ? len + fromIndex : fromIndex; + while (i < len) { + // we iterate over sparse items since there is no way to make it + // work properly on IE 7-8. see #64 + if (arr[i] === item) { + return i; + } + + i++; + } + + return -1; + } + + module.exports = indexOf; + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/insert.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/insert.js new file mode 100644 index 0000000..20bd442 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/insert.js @@ -0,0 +1,15 @@ +var difference = require('./difference'); +var slice = require('./slice'); + + /** + * Insert item into array if not already present. + */ + function insert(arr, rest_items) { + var diff = difference(slice(arguments, 1), arr); + if (diff.length) { + Array.prototype.push.apply(arr, diff); + } + return arr.length; + } + module.exports = insert; + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/intersection.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/intersection.js new file mode 100644 index 0000000..34957ab --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/intersection.js @@ -0,0 +1,24 @@ +var unique = require('./unique'); +var filter = require('./filter'); +var every = require('./every'); +var contains = require('./contains'); +var slice = require('./slice'); + + + /** + * Return a new Array with elements common to all Arrays. + * - based on underscore.js implementation + */ + function intersection(arr) { + var arrs = slice(arguments, 1), + result = filter(unique(arr), function(needle){ + return every(arrs, function(haystack){ + return contains(haystack, needle); + }); + }); + return result; + } + + module.exports = intersection; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/invoke.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/invoke.js new file mode 100644 index 0000000..32ec584 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/invoke.js @@ -0,0 +1,23 @@ +var slice = require('./slice'); + + /** + * Call `methodName` on each item of the array passing custom arguments if + * needed. + */ + function invoke(arr, methodName, var_args){ + if (arr == null) { + return arr; + } + + var args = slice(arguments, 2); + var i = -1, len = arr.length, value; + while (++i < len) { + value = arr[i]; + value[methodName].apply(value, args); + } + + return arr; + } + + module.exports = invoke; + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/join.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/join.js new file mode 100644 index 0000000..71d8bd2 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/join.js @@ -0,0 +1,17 @@ +var filter = require('./filter'); + + function isValidString(val) { + return (val != null && val !== ''); + } + + /** + * Joins strings with the specified separator inserted between each value. + * Null values and empty strings will be excluded. + */ + function join(items, separator) { + separator = separator || ''; + return filter(items, isValidString).join(separator); + } + + module.exports = join; + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/lastIndexOf.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/lastIndexOf.js new file mode 100644 index 0000000..ee44a25 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/lastIndexOf.js @@ -0,0 +1,28 @@ + + + /** + * Array lastIndexOf + */ + function lastIndexOf(arr, item, fromIndex) { + if (arr == null) { + return -1; + } + + var len = arr.length; + fromIndex = (fromIndex == null || fromIndex >= len)? len - 1 : fromIndex; + fromIndex = (fromIndex < 0)? len + fromIndex : fromIndex; + + while (fromIndex >= 0) { + // we iterate over sparse items since there is no way to make it + // work properly on IE 7-8. see #64 + if (arr[fromIndex] === item) { + return fromIndex; + } + fromIndex--; + } + + return -1; + } + + module.exports = lastIndexOf; + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/map.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/map.js new file mode 100644 index 0000000..7b7fb33 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/map.js @@ -0,0 +1,22 @@ +var makeIterator = require('../function/makeIterator_'); + + /** + * Array map + */ + function map(arr, callback, thisObj) { + callback = makeIterator(callback, thisObj); + var results = []; + if (arr == null){ + return results; + } + + var i = -1, len = arr.length; + while (++i < len) { + results[i] = callback(arr[i], i, arr); + } + + return results; + } + + module.exports = map; + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/max.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/max.js new file mode 100644 index 0000000..0b8f259 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/max.js @@ -0,0 +1,34 @@ +var makeIterator = require('../function/makeIterator_'); + + /** + * Return maximum value inside array + */ + function max(arr, iterator, thisObj){ + if (arr == null || !arr.length) { + return Infinity; + } else if (arr.length && !iterator) { + return Math.max.apply(Math, arr); + } else { + iterator = makeIterator(iterator, thisObj); + var result, + compare = -Infinity, + value, + temp; + + var i = -1, len = arr.length; + while (++i < len) { + value = arr[i]; + temp = iterator(value, i, arr); + if (temp > compare) { + compare = temp; + result = value; + } + } + + return result; + } + } + + module.exports = max; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/min.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/min.js new file mode 100644 index 0000000..ed6cc6a --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/min.js @@ -0,0 +1,34 @@ +var makeIterator = require('../function/makeIterator_'); + + /** + * Return minimum value inside array + */ + function min(arr, iterator, thisObj){ + if (arr == null || !arr.length) { + return -Infinity; + } else if (arr.length && !iterator) { + return Math.min.apply(Math, arr); + } else { + iterator = makeIterator(iterator, thisObj); + var result, + compare = Infinity, + value, + temp; + + var i = -1, len = arr.length; + while (++i < len) { + value = arr[i]; + temp = iterator(value, i, arr); + if (temp < compare) { + compare = temp; + result = value; + } + } + + return result; + } + } + + module.exports = min; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/pick.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/pick.js new file mode 100644 index 0000000..6408678 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/pick.js @@ -0,0 +1,31 @@ +var randInt = require('../random/randInt'); + + /** + * Remove random item(s) from the Array and return it. + * Returns an Array of items if [nItems] is provided or a single item if + * it isn't specified. + */ + function pick(arr, nItems){ + if (nItems != null) { + var result = []; + if (nItems > 0 && arr && arr.length) { + nItems = nItems > arr.length? arr.length : nItems; + while (nItems--) { + result.push( pickOne(arr) ); + } + } + return result; + } + return (arr && arr.length)? pickOne(arr) : void(0); + } + + + function pickOne(arr){ + var idx = randInt(0, arr.length - 1); + return arr.splice(idx, 1)[0]; + } + + + module.exports = pick; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/pluck.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/pluck.js new file mode 100644 index 0000000..fef4043 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/pluck.js @@ -0,0 +1,12 @@ +var map = require('./map'); + + /** + * Extract a list of property values. + */ + function pluck(arr, propName){ + return map(arr, propName); + } + + module.exports = pluck; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/range.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/range.js new file mode 100644 index 0000000..31d3c77 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/range.js @@ -0,0 +1,27 @@ +var countSteps = require('../math/countSteps'); + + /** + * Returns an Array of numbers inside range. + */ + function range(start, stop, step) { + if (stop == null) { + stop = start; + start = 0; + } + step = step || 1; + + var result = [], + nSteps = countSteps(stop - start, step), + i = start; + + while (i <= stop) { + result.push(i); + i += step; + } + + return result; + } + + module.exports = range; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/reduce.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/reduce.js new file mode 100644 index 0000000..827f428 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/reduce.js @@ -0,0 +1,33 @@ + + + /** + * Array reduce + */ + function reduce(arr, fn, initVal) { + // check for args.length since initVal might be "undefined" see #gh-57 + var hasInit = arguments.length > 2, + result = initVal; + + if (arr == null || !arr.length) { + if (!hasInit) { + throw new Error('reduce of empty array with no initial value'); + } else { + return initVal; + } + } + + var i = -1, len = arr.length; + while (++i < len) { + if (!hasInit) { + result = arr[i]; + hasInit = true; + } else { + result = fn(result, arr[i], i, arr); + } + } + + return result; + } + + module.exports = reduce; + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/reduceRight.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/reduceRight.js new file mode 100644 index 0000000..e36fd4a --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/reduceRight.js @@ -0,0 +1,34 @@ + + + /** + * Array reduceRight + */ + function reduceRight(arr, fn, initVal) { + // check for args.length since initVal might be "undefined" see #gh-57 + var hasInit = arguments.length > 2; + + if (arr == null || !arr.length) { + if (hasInit) { + return initVal; + } else { + throw new Error('reduce of empty array with no initial value'); + } + } + + var i = arr.length, result = initVal, value; + while (--i >= 0) { + // we iterate over sparse items since there is no way to make it + // work properly on IE 7-8. see #64 + value = arr[i]; + if (!hasInit) { + result = value; + hasInit = true; + } else { + result = fn(result, value, i, arr); + } + } + return result; + } + + module.exports = reduceRight; + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/reject.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/reject.js new file mode 100644 index 0000000..0cfc8b1 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/reject.js @@ -0,0 +1,25 @@ +var makeIterator = require('../function/makeIterator_'); + + /** + * Array reject + */ + function reject(arr, callback, thisObj) { + callback = makeIterator(callback, thisObj); + var results = []; + if (arr == null) { + return results; + } + + var i = -1, len = arr.length, value; + while (++i < len) { + value = arr[i]; + if (!callback(value, i, arr)) { + results.push(value); + } + } + + return results; + } + + module.exports = reject; + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/remove.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/remove.js new file mode 100644 index 0000000..aa6517d --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/remove.js @@ -0,0 +1,13 @@ +var indexOf = require('./indexOf'); + + /** + * Remove a single item from the array. + * (it won't remove duplicates, just a single item) + */ + function remove(arr, item){ + var idx = indexOf(arr, item); + if (idx !== -1) arr.splice(idx, 1); + } + + module.exports = remove; + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/removeAll.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/removeAll.js new file mode 100644 index 0000000..d5f7f3b --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/removeAll.js @@ -0,0 +1,15 @@ +var indexOf = require('./indexOf'); + + /** + * Remove all instances of an item from array. + */ + function removeAll(arr, item){ + var idx = indexOf(arr, item); + while (idx !== -1) { + arr.splice(idx, 1); + idx = indexOf(arr, item, idx); + } + } + + module.exports = removeAll; + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/shuffle.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/shuffle.js new file mode 100644 index 0000000..99d0660 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/shuffle.js @@ -0,0 +1,28 @@ +var randInt = require('../random/randInt'); + + /** + * Shuffle array items. + */ + function shuffle(arr) { + var results = [], + rnd; + if (arr == null) { + return results; + } + + var i = -1, len = arr.length, value; + while (++i < len) { + if (!i) { + results[0] = arr[0]; + } else { + rnd = randInt(0, i); + results[i] = results[rnd]; + results[rnd] = arr[i]; + } + } + + return results; + } + + module.exports = shuffle; + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/slice.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/slice.js new file mode 100644 index 0000000..0a4d5cf --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/slice.js @@ -0,0 +1,35 @@ + + + /** + * Create slice of source array or array-like object + */ + function slice(arr, start, end){ + var len = arr.length; + + if (start == null) { + start = 0; + } else if (start < 0) { + start = Math.max(len + start, 0); + } else { + start = Math.min(start, len); + } + + if (end == null) { + end = len; + } else if (end < 0) { + end = Math.max(len + end, 0); + } else { + end = Math.min(end, len); + } + + var result = []; + while (start < end) { + result.push(arr[start++]); + } + + return result; + } + + module.exports = slice; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/some.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/some.js new file mode 100644 index 0000000..8d17772 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/some.js @@ -0,0 +1,27 @@ +var makeIterator = require('../function/makeIterator_'); + + /** + * Array some + */ + function some(arr, callback, thisObj) { + callback = makeIterator(callback, thisObj); + var result = false; + if (arr == null) { + return result; + } + + var i = -1, len = arr.length; + while (++i < len) { + // we iterate over sparse items since there is no way to make it + // work properly on IE 7-8. see #64 + if ( callback(arr[i], i, arr) ) { + result = true; + break; + } + } + + return result; + } + + module.exports = some; + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/sort.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/sort.js new file mode 100644 index 0000000..7807339 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/sort.js @@ -0,0 +1,55 @@ + + + /** + * Merge sort (http://en.wikipedia.org/wiki/Merge_sort) + */ + function mergeSort(arr, compareFn) { + if (arr == null) { + return []; + } else if (arr.length < 2) { + return arr; + } + + if (compareFn == null) { + compareFn = defaultCompare; + } + + var mid, left, right; + + mid = ~~(arr.length / 2); + left = mergeSort( arr.slice(0, mid), compareFn ); + right = mergeSort( arr.slice(mid, arr.length), compareFn ); + + return merge(left, right, compareFn); + } + + function defaultCompare(a, b) { + return a < b ? -1 : (a > b? 1 : 0); + } + + function merge(left, right, compareFn) { + var result = []; + + while (left.length && right.length) { + if (compareFn(left[0], right[0]) <= 0) { + // if 0 it should preserve same order (stable) + result.push(left.shift()); + } else { + result.push(right.shift()); + } + } + + if (left.length) { + result.push.apply(result, left); + } + + if (right.length) { + result.push.apply(result, right); + } + + return result; + } + + module.exports = mergeSort; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/sortBy.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/sortBy.js new file mode 100644 index 0000000..b84544c --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/sortBy.js @@ -0,0 +1,19 @@ +var sort = require('./sort'); +var makeIterator = require('../function/makeIterator_'); + + /* + * Sort array by the result of the callback + */ + function sortBy(arr, callback, context){ + callback = makeIterator(callback, context); + + return sort(arr, function(a, b) { + a = callback(a); + b = callback(b); + return (a < b) ? -1 : ((a > b) ? 1 : 0); + }); + } + + module.exports = sortBy; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/split.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/split.js new file mode 100644 index 0000000..4f3ba50 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/split.js @@ -0,0 +1,35 @@ + + + /** + * Split array into a fixed number of segments. + */ + function split(array, segments) { + segments = segments || 2; + var results = []; + if (array == null) { + return results; + } + + var minLength = Math.floor(array.length / segments), + remainder = array.length % segments, + i = 0, + len = array.length, + segmentIndex = 0, + segmentLength; + + while (i < len) { + segmentLength = minLength; + if (segmentIndex < remainder) { + segmentLength++; + } + + results.push(array.slice(i, i + segmentLength)); + + segmentIndex++; + i += segmentLength; + } + + return results; + } + module.exports = split; + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/toLookup.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/toLookup.js new file mode 100644 index 0000000..ce4c55d --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/toLookup.js @@ -0,0 +1,28 @@ +var isFunction = require('../lang/isFunction'); + + /** + * Creates an object that holds a lookup for the objects in the array. + */ + function toLookup(arr, key) { + var result = {}; + if (arr == null) { + return result; + } + + var i = -1, len = arr.length, value; + if (isFunction(key)) { + while (++i < len) { + value = arr[i]; + result[key(value)] = value; + } + } else { + while (++i < len) { + value = arr[i]; + result[value[key]] = value; + } + } + + return result; + } + module.exports = toLookup; + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/union.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/union.js new file mode 100644 index 0000000..f1334a9 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/union.js @@ -0,0 +1,19 @@ +var unique = require('./unique'); +var append = require('./append'); + + /** + * Concat multiple arrays and remove duplicates + */ + function union(arrs) { + var results = []; + var i = -1, len = arguments.length; + while (++i < len) { + append(results, arguments[i]); + } + + return unique(results); + } + + module.exports = union; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/unique.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/unique.js new file mode 100644 index 0000000..5db2510 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/unique.js @@ -0,0 +1,25 @@ +var filter = require('./filter'); + + /** + * @return {array} Array of unique items + */ + function unique(arr, compare){ + compare = compare || isEqual; + return filter(arr, function(item, i, arr){ + var n = arr.length; + while (++i < n) { + if ( compare(item, arr[i]) ) { + return false; + } + } + return true; + }); + } + + function isEqual(a, b){ + return a === b; + } + + module.exports = unique; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/xor.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/xor.js new file mode 100644 index 0000000..c125a99 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/xor.js @@ -0,0 +1,26 @@ +var unique = require('./unique'); +var filter = require('./filter'); +var contains = require('./contains'); + + + /** + * Exclusive OR. Returns items that are present in a single array. + * - like ptyhon's `symmetric_difference` + */ + function xor(arr1, arr2) { + arr1 = unique(arr1); + arr2 = unique(arr2); + + var a1 = filter(arr1, function(item){ + return !contains(arr2, item); + }), + a2 = filter(arr2, function(item){ + return !contains(arr1, item); + }); + + return a1.concat(a2); + } + + module.exports = xor; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/zip.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/zip.js new file mode 100644 index 0000000..8bce9c0 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/array/zip.js @@ -0,0 +1,28 @@ +var max = require('./max'); +var map = require('./map'); + + function getLength(arr) { + return arr == null ? 0 : arr.length; + } + + /** + * Merges together the values of each of the arrays with the values at the + * corresponding position. + */ + function zip(arr){ + var len = arr ? max(map(arguments, getLength)) : 0, + results = [], + i = -1; + while (++i < len) { + // jshint loopfunc: true + results.push(map(arguments, function(item) { + return item == null ? undefined : item[i]; + })); + } + + return results; + } + + module.exports = zip; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/collection.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/collection.js new file mode 100644 index 0000000..d5cf6ca --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/collection.js @@ -0,0 +1,22 @@ + + +//automatically generated, do not edit! +//run `node build` instead +module.exports = { + 'contains' : require('./collection/contains'), + 'every' : require('./collection/every'), + 'filter' : require('./collection/filter'), + 'find' : require('./collection/find'), + 'forEach' : require('./collection/forEach'), + 'make_' : require('./collection/make_'), + 'map' : require('./collection/map'), + 'max' : require('./collection/max'), + 'min' : require('./collection/min'), + 'pluck' : require('./collection/pluck'), + 'reduce' : require('./collection/reduce'), + 'reject' : require('./collection/reject'), + 'size' : require('./collection/size'), + 'some' : require('./collection/some') +}; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/contains.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/contains.js new file mode 100644 index 0000000..a73f994 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/contains.js @@ -0,0 +1,9 @@ +var make = require('./make_'); +var arrContains = require('../array/contains'); +var objContains = require('../object/contains'); + + /** + */ + module.exports = make(arrContains, objContains); + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/every.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/every.js new file mode 100644 index 0000000..300e03c --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/every.js @@ -0,0 +1,9 @@ +var make = require('./make_'); +var arrEvery = require('../array/every'); +var objEvery = require('../object/every'); + + /** + */ + module.exports = make(arrEvery, objEvery); + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/filter.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/filter.js new file mode 100644 index 0000000..3875700 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/filter.js @@ -0,0 +1,23 @@ +var forEach = require('./forEach'); +var makeIterator = require('../function/makeIterator_'); + + /** + * filter collection values, returns array. + */ + function filter(list, iterator, thisObj) { + iterator = makeIterator(iterator, thisObj); + var results = []; + if (!list) { + return results; + } + forEach(list, function(value, index, list) { + if (iterator(value, index, list)) { + results[results.length] = value; + } + }); + return results; + } + + module.exports = filter; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/find.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/find.js new file mode 100644 index 0000000..14317e6 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/find.js @@ -0,0 +1,10 @@ +var make = require('./make_'); +var arrFind = require('../array/find'); +var objFind = require('../object/find'); + + /** + * Find value that returns true on iterator check. + */ + module.exports = make(arrFind, objFind); + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/forEach.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/forEach.js new file mode 100644 index 0000000..6e28dcb --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/forEach.js @@ -0,0 +1,9 @@ +var make = require('./make_'); +var arrForEach = require('../array/forEach'); +var objForEach = require('../object/forOwn'); + + /** + */ + module.exports = make(arrForEach, objForEach); + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/make_.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/make_.js new file mode 100644 index 0000000..4fb8a81 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/make_.js @@ -0,0 +1,19 @@ +var slice = require('../array/slice'); + + /** + * internal method used to create other collection modules. + */ + function makeCollectionMethod(arrMethod, objMethod, defaultReturn) { + return function(){ + var args = slice(arguments); + if (args[0] == null) { + return defaultReturn; + } + // array-like is treated as array + return (typeof args[0].length === 'number')? arrMethod.apply(null, args) : objMethod.apply(null, args); + }; + } + + module.exports = makeCollectionMethod; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/map.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/map.js new file mode 100644 index 0000000..fc157f5 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/map.js @@ -0,0 +1,23 @@ +var isObject = require('../lang/isObject'); +var values = require('../object/values'); +var arrMap = require('../array/map'); +var makeIterator = require('../function/makeIterator_'); + + /** + * Map collection values, returns Array. + */ + function map(list, callback, thisObj) { + callback = makeIterator(callback, thisObj); + // list.length to check array-like object, if not array-like + // we simply map all the object values + if( isObject(list) && list.length == null ){ + list = values(list); + } + return arrMap(list, function (val, key, list) { + return callback(val, key, list); + }); + } + + module.exports = map; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/max.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/max.js new file mode 100644 index 0000000..a8490e7 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/max.js @@ -0,0 +1,10 @@ +var make = require('./make_'); +var arrMax = require('../array/max'); +var objMax = require('../object/max'); + + /** + * Get maximum value inside collection + */ + module.exports = make(arrMax, objMax); + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/min.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/min.js new file mode 100644 index 0000000..51d9f14 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/min.js @@ -0,0 +1,10 @@ +var make = require('./make_'); +var arrMin = require('../array/min'); +var objMin = require('../object/min'); + + /** + * Get minimum value inside collection. + */ + module.exports = make(arrMin, objMin); + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/pluck.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/pluck.js new file mode 100644 index 0000000..9b28377 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/pluck.js @@ -0,0 +1,14 @@ +var map = require('./map'); + + /** + * Extract a list of property values. + */ + function pluck(list, key) { + return map(list, function(value) { + return value[key]; + }); + } + + module.exports = pluck; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/reduce.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/reduce.js new file mode 100644 index 0000000..4c07573 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/reduce.js @@ -0,0 +1,9 @@ +var make = require('./make_'); +var arrReduce = require('../array/reduce'); +var objReduce = require('../object/reduce'); + + /** + */ + module.exports = make(arrReduce, objReduce); + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/reject.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/reject.js new file mode 100644 index 0000000..2a92e3b --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/reject.js @@ -0,0 +1,16 @@ +var filter = require('./filter'); +var makeIterator = require('../function/makeIterator_'); + + /** + * Inverse or collection/filter + */ + function reject(list, iterator, thisObj) { + iterator = makeIterator(iterator, thisObj); + return filter(list, function(value, index, list) { + return !iterator(value, index, list); + }, thisObj); + } + + module.exports = reject; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/size.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/size.js new file mode 100644 index 0000000..244e33e --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/size.js @@ -0,0 +1,19 @@ +var isArray = require('../lang/isArray'); +var objSize = require('../object/size'); + + /** + * Get collection size + */ + function size(list) { + if (!list) { + return 0; + } + if (isArray(list)) { + return list.length; + } + return objSize(list); + } + + module.exports = size; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/some.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/some.js new file mode 100644 index 0000000..48fd252 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/collection/some.js @@ -0,0 +1,9 @@ +var make = require('./make_'); +var arrSome = require('../array/some'); +var objSome = require('../object/some'); + + /** + */ + module.exports = make(arrSome, objSome); + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/date.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/date.js new file mode 100644 index 0000000..9c2efe9 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/date.js @@ -0,0 +1,22 @@ + + +//automatically generated, do not edit! +//run `node build` instead +module.exports = { + 'dayOfTheYear' : require('./date/dayOfTheYear'), + 'diff' : require('./date/diff'), + 'i18n_' : require('./date/i18n_'), + 'isLeapYear' : require('./date/isLeapYear'), + 'isSame' : require('./date/isSame'), + 'parseIso' : require('./date/parseIso'), + 'quarter' : require('./date/quarter'), + 'startOf' : require('./date/startOf'), + 'strftime' : require('./date/strftime'), + 'timezoneAbbr' : require('./date/timezoneAbbr'), + 'timezoneOffset' : require('./date/timezoneOffset'), + 'totalDaysInMonth' : require('./date/totalDaysInMonth'), + 'totalDaysInYear' : require('./date/totalDaysInYear'), + 'weekOfTheYear' : require('./date/weekOfTheYear') +}; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/date/dayOfTheYear.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/date/dayOfTheYear.js new file mode 100644 index 0000000..85905c5 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/date/dayOfTheYear.js @@ -0,0 +1,13 @@ +var isDate = require('../lang/isDate'); + + /** + * return the day of the year (1..366) + */ + function dayOfTheYear(date){ + return (Date.UTC(date.getFullYear(), date.getMonth(), date.getDate()) - + Date.UTC(date.getFullYear(), 0, 1)) / 86400000 + 1; + } + + module.exports = dayOfTheYear; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/date/diff.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/date/diff.js new file mode 100644 index 0000000..1131cdc --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/date/diff.js @@ -0,0 +1,130 @@ +var totalDaysInMonth = require('./totalDaysInMonth'); +var totalDaysInYear = require('./totalDaysInYear'); +var convert = require('../time/convert'); + + /** + * calculate the difference between dates (range) + */ + function diff(start, end, unitName){ + // sort the dates to make it easier to process (specially year/month) + if (start > end) { + var swap = start; + start = end; + end = swap; + } + + var output; + + if (unitName === 'month') { + output = getMonthsDiff(start, end); + } else if (unitName === 'year'){ + output = getYearsDiff(start, end); + } else if (unitName != null) { + if (unitName === 'day') { + // ignore timezone difference because of daylight savings time + start = toUtc(start); + end = toUtc(end); + } + output = convert(end - start, 'ms', unitName); + } else { + output = end - start; + } + + return output; + } + + + function toUtc(d){ + // we ignore timezone differences on purpose because of daylight + // savings time, otherwise it would return fractional days/weeks even + // if a full day elapsed. eg: + // Wed Feb 12 2014 00:00:00 GMT-0200 (BRST) + // Sun Feb 16 2014 00:00:00 GMT-0300 (BRT) + // diff should be 4 days and not 4.041666666666667 + return Date.UTC(d.getUTCFullYear(), d.getUTCMonth(), d.getUTCDate(), + d.getHours(), d.getMinutes(), d.getSeconds(), + d.getMilliseconds()); + } + + + function getMonthsDiff(start, end){ + return getElapsedMonths(start, end) + + getElapsedYears(start, end) * 12 + + getFractionalMonth(start, end); + } + + + function getYearsDiff(start, end){ + var elapsedYears = getElapsedYears(start, end); + return elapsedYears + getFractionalYear(start, end, elapsedYears); + } + + + function getElapsedMonths(start, end){ + var monthDiff = end.getMonth() - start.getMonth(); + if (monthDiff < 0) { + monthDiff += 12; + } + // less than a full month + if (start.getDate() > end.getDate()) { + monthDiff -= 1; + } + return monthDiff; + } + + + function getElapsedYears(start, end){ + var yearDiff = end.getFullYear() - start.getFullYear(); + // less than a full year + if (start.getMonth() > end.getMonth()) { + yearDiff -= 1; + } + return yearDiff; + } + + + function getFractionalMonth(start, end){ + var fractionalDiff = 0; + var startDay = start.getDate(); + var endDay = end.getDate(); + + if (startDay !== endDay) { + var startTotalDays = totalDaysInMonth(start); + var endTotalDays = totalDaysInMonth(end); + var totalDays; + var daysElapsed; + + if (startDay > endDay) { + // eg: Jan 29 - Feb 27 (29 days elapsed but not a full month) + var baseDay = startTotalDays - startDay; + daysElapsed = endDay + baseDay; + // total days should be relative to 1st day of next month if + // startDay > endTotalDays + totalDays = (startDay > endTotalDays)? + endTotalDays + baseDay + 1 : startDay + baseDay; + } else { + // fractional is only based on endMonth eg: Jan 12 - Feb 18 + // (6 fractional days, 28 days until next full month) + daysElapsed = endDay - startDay; + totalDays = endTotalDays; + } + + fractionalDiff = daysElapsed / totalDays; + } + + return fractionalDiff; + } + + + function getFractionalYear(start, end, elapsedYears){ + var base = elapsedYears? + new Date(end.getFullYear(), start.getMonth(), start.getDate()) : + start; + var elapsedDays = diff(base, end, 'day'); + return elapsedDays / totalDaysInYear(end); + } + + + module.exports = diff; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/date/i18n/de-DE.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/date/i18n/de-DE.js new file mode 100644 index 0000000..b3ab620 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/date/i18n/de-DE.js @@ -0,0 +1,61 @@ + + // de-DE (German) + module.exports = { + "am" : "", + "pm" : "", + + "x": "%d/%m/%y", + "X": "%H:%M:%S", + "c": "%a %d %b %Y %H:%M:%S %Z", + + "months" : [ + "Januar", + "Februar", + "März", + "April", + "Mai", + "Juni", + "Juli", + "August", + "September", + "Oktober", + "November", + "Dezember" + ], + + "months_abbr" : [ + "Jan", + "Febr", + "März", + "Apr", + "Mai", + "Juni", + "Juli", + "Aug", + "Sept", + "Okt", + "Nov", + "Dez" + ], + + "days" : [ + "Sonntag", + "Montag", + "Dienstag", + "Mittwoch", + "Donnerstag", + "Freitag", + "Samstag" + ], + + "days_abbr" : [ + "So", + "Mo", + "Di", + "Mi", + "Do", + "Fr", + "Sa" + ] + }; + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/date/i18n/en-US.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/date/i18n/en-US.js new file mode 100644 index 0000000..f9526ce --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/date/i18n/en-US.js @@ -0,0 +1,61 @@ + + // en-US (English, United States) + module.exports = { + "am" : "AM", + "pm" : "PM", + + "x": "%m/%d/%y", + "X": "%H:%M:%S", + "c": "%a %d %b %Y %I:%M:%S %p %Z", + + "months" : [ + "January", + "February", + "March", + "April", + "May", + "June", + "July", + "August", + "September", + "October", + "November", + "December" + ], + + "months_abbr" : [ + "Jan", + "Feb", + "Mar", + "Apr", + "May", + "Jun", + "Jul", + "Aug", + "Sep", + "Oct", + "Nov", + "Dec" + ], + + "days" : [ + "Sunday", + "Monday", + "Tuesday", + "Wednesday", + "Thursday", + "Friday", + "Saturday" + ], + + "days_abbr" : [ + "Sun", + "Mon", + "Tue", + "Wed", + "Thu", + "Fri", + "Sat" + ] + }; + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/date/i18n/pt-BR.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/date/i18n/pt-BR.js new file mode 100644 index 0000000..71ebadb --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/date/i18n/pt-BR.js @@ -0,0 +1,61 @@ + + // pt-BR (Brazillian Portuguese) + module.exports = { + "am" : "", + "pm" : "", + + "x": "%d/%m/%y", + "X": "%H:%M:%S", + "c": "%a %d %b %Y %H:%M:%S %Z", + + "months" : [ + "Janeiro", + "Fevereiro", + "Março", + "Abril", + "Maio", + "Junho", + "Julho", + "Agosto", + "Setembro", + "Outubro", + "Novembro", + "Dezembro" + ], + + "months_abbr" : [ + "Jan", + "Fev", + "Mar", + "Abr", + "Mai", + "Jun", + "Jul", + "Ago", + "Set", + "Out", + "Nov", + "Dez" + ], + + "days" : [ + "Domingo", + "Segunda", + "Terça", + "Quarta", + "Quinta", + "Sexta", + "Sábado" + ], + + "days_abbr" : [ + "Dom", + "Seg", + "Ter", + "Qua", + "Qui", + "Sex", + "Sáb" + ] + }; + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/date/i18n_.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/date/i18n_.js new file mode 100644 index 0000000..723fc10 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/date/i18n_.js @@ -0,0 +1,14 @@ +var mixIn = require('../object/mixIn'); +var enUS = require('./i18n/en-US'); + + // we also use mixIn to make sure we don't affect the original locale + var activeLocale = mixIn({}, enUS, { + // we expose a "set" method to allow overriding the global locale + set : function(localeData){ + mixIn(activeLocale, localeData); + } + }); + + module.exports = activeLocale; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/date/isLeapYear.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/date/isLeapYear.js new file mode 100644 index 0000000..4212870 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/date/isLeapYear.js @@ -0,0 +1,15 @@ +var isDate = require('../lang/isDate'); + + /** + * checks if it's a leap year + */ + function isLeapYear(fullYear){ + if (isDate(fullYear)) { + fullYear = fullYear.getFullYear(); + } + return fullYear % 400 === 0 || (fullYear % 100 !== 0 && fullYear % 4 === 0); + } + + module.exports = isLeapYear; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/date/isSame.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/date/isSame.js new file mode 100644 index 0000000..4097d29 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/date/isSame.js @@ -0,0 +1,16 @@ +var startOf = require('./startOf'); + + /** + * Check if date is "same" with optional period + */ + function isSame(date1, date2, period){ + if (period) { + date1 = startOf(date1, period); + date2 = startOf(date2, period); + } + return Number(date1) === Number(date2); + } + + module.exports = isSame; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/date/parseIso.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/date/parseIso.js new file mode 100644 index 0000000..40a70a8 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/date/parseIso.js @@ -0,0 +1,146 @@ +var some = require('../array/some'); + + var datePatterns = [ + /^([0-9]{4})$/, // YYYY + /^([0-9]{4})-([0-9]{2})$/, // YYYY-MM (YYYYMM not allowed) + /^([0-9]{4})-?([0-9]{2})-?([0-9]{2})$/ // YYYY-MM-DD or YYYYMMDD + ]; + var ORD_DATE = /^([0-9]{4})-?([0-9]{3})$/; // YYYY-DDD + + var timePatterns = [ + /^([0-9]{2}(?:\.[0-9]*)?)$/, // HH.hh + /^([0-9]{2}):?([0-9]{2}(?:\.[0-9]*)?)$/, // HH:MM.mm + /^([0-9]{2}):?([0-9]{2}):?([0-9]{2}(\.[0-9]*)?)$/ // HH:MM:SS.ss + ]; + + var DATE_TIME = /^(.+)T(.+)$/; + var TIME_ZONE = /^(.+)([+\-])([0-9]{2}):?([0-9]{2})$/; + + function matchAll(str, patterns) { + var match; + var found = some(patterns, function(pattern) { + return !!(match = pattern.exec(str)); + }); + + return found ? match : null; + } + + function getDate(year, month, day) { + var date = new Date(Date.UTC(year, month, day)); + + // Explicitly set year to avoid Date.UTC making dates < 100 relative to + // 1900 + date.setUTCFullYear(year); + + var valid = + date.getUTCFullYear() === year && + date.getUTCMonth() === month && + date.getUTCDate() === day; + return valid ? +date : NaN; + } + + function parseOrdinalDate(str) { + var match = ORD_DATE.exec(str); + if (match ) { + var year = +match[1], + day = +match[2], + date = new Date(Date.UTC(year, 0, day)); + + if (date.getUTCFullYear() === year) { + return +date; + } + } + + return NaN; + } + + function parseDate(str) { + var match, year, month, day; + + match = matchAll(str, datePatterns); + if (match === null) { + // Ordinal dates are verified differently. + return parseOrdinalDate(str); + } + + year = (match[1] === void 0) ? 0 : +match[1]; + month = (match[2] === void 0) ? 0 : +match[2] - 1; + day = (match[3] === void 0) ? 1 : +match[3]; + + return getDate(year, month, day); + } + + function getTime(hr, min, sec) { + var valid = + (hr < 24 && hr >= 0 && + min < 60 && min >= 0 && + sec < 60 && min >= 0) || + (hr === 24 && min === 0 && sec === 0); + if (!valid) { + return NaN; + } + + return ((hr * 60 + min) * 60 + sec) * 1000; + } + + function parseOffset(str) { + var match; + if (str.charAt(str.length - 1) === 'Z') { + str = str.substring(0, str.length - 1); + } else { + match = TIME_ZONE.exec(str); + if (match) { + var hours = +match[3], + minutes = (match[4] === void 0) ? 0 : +match[4], + offset = getTime(hours, minutes, 0); + + if (match[2] === '-') { + offset *= -1; + } + + return { offset: offset, time: match[1] }; + } + } + + // No time zone specified, assume UTC + return { offset: 0, time: str }; + } + + function parseTime(str) { + var match; + var offset = parseOffset(str); + + str = offset.time; + offset = offset.offset; + if (isNaN(offset)) { + return NaN; + } + + match = matchAll(str, timePatterns); + if (match === null) { + return NaN; + } + + var hours = (match[1] === void 0) ? 0 : +match[1], + minutes = (match[2] === void 0) ? 0 : +match[2], + seconds = (match[3] === void 0) ? 0 : +match[3]; + + return getTime(hours, minutes, seconds) - offset; + } + + /** + * Parse an ISO8601 formatted date string, and return a Date object. + */ + function parseISO8601(str){ + var match = DATE_TIME.exec(str); + if (!match) { + // No time specified + return parseDate(str); + } + + return parseDate(match[1]) + parseTime(match[2]); + } + + module.exports = parseISO8601; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/date/quarter.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/date/quarter.js new file mode 100644 index 0000000..8f61076 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/date/quarter.js @@ -0,0 +1,16 @@ + + + /** + * gets date quarter + */ + function quarter(date){ + var month = date.getMonth(); + if (month < 3) return 1; + if (month < 6) return 2; + if (month < 9) return 3; + return 4; + } + + module.exports = quarter; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/date/startOf.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/date/startOf.js new file mode 100644 index 0000000..072bc0e --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/date/startOf.js @@ -0,0 +1,54 @@ +var clone = require('../lang/clone'); + + /** + * get a new Date object representing start of period + */ + function startOf(date, period){ + date = clone(date); + + // intentionally removed "break" from switch since start of + // month/year/etc should also reset the following periods + switch (period) { + case 'year': + date.setMonth(0); + /* falls through */ + case 'month': + date.setDate(1); + /* falls through */ + case 'week': + case 'day': + date.setHours(0); + /* falls through */ + case 'hour': + date.setMinutes(0); + /* falls through */ + case 'minute': + date.setSeconds(0); + /* falls through */ + case 'second': + date.setMilliseconds(0); + break; + default: + throw new Error('"'+ period +'" is not a valid period'); + } + + // week is the only case that should reset the weekDay and maybe even + // overflow to previous month + if (period === 'week') { + var weekDay = date.getDay(); + var baseDate = date.getDate(); + if (weekDay) { + if (weekDay >= baseDate) { + //start of the week is on previous month + date.setDate(0); + } + date.setDate(date.getDate() - date.getDay()); + } + } + + return date; + } + + module.exports = startOf; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/date/strftime.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/date/strftime.js new file mode 100644 index 0000000..5e56633 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/date/strftime.js @@ -0,0 +1,121 @@ +var pad = require('../number/pad'); +var lpad = require('../string/lpad'); +var i18n = require('./i18n_'); +var dayOfTheYear = require('./dayOfTheYear'); +var timezoneOffset = require('./timezoneOffset'); +var timezoneAbbr = require('./timezoneAbbr'); +var weekOfTheYear = require('./weekOfTheYear'); + + var _combinations = { + 'D': '%m/%d/%y', + 'F': '%Y-%m-%d', + 'r': '%I:%M:%S %p', + 'R': '%H:%M', + 'T': '%H:%M:%S', + 'x': 'locale', + 'X': 'locale', + 'c': 'locale' + }; + + + /** + * format date based on strftime format + */ + function strftime(date, format, localeData){ + localeData = localeData || i18n; + var reToken = /%([a-z%])/gi; + + function makeIterator(fn) { + return function(match, token){ + return fn(date, token, localeData); + }; + } + + return format + .replace(reToken, makeIterator(expandCombinations)) + .replace(reToken, makeIterator(convertToken)); + } + + + function expandCombinations(date, token, l10n){ + if (token in _combinations) { + var expanded = _combinations[token]; + return expanded === 'locale'? l10n[token] : expanded; + } else { + return '%'+ token; + } + } + + + function convertToken(date, token, l10n){ + switch (token){ + case 'a': + return l10n.days_abbr[date.getDay()]; + case 'A': + return l10n.days[date.getDay()]; + case 'h': + case 'b': + return l10n.months_abbr[date.getMonth()]; + case 'B': + return l10n.months[date.getMonth()]; + case 'C': + return pad(Math.floor(date.getFullYear() / 100), 2); + case 'd': + return pad(date.getDate(), 2); + case 'e': + return pad(date.getDate(), 2, ' '); + case 'H': + return pad(date.getHours(), 2); + case 'I': + return pad(date.getHours() % 12, 2); + case 'j': + return pad(dayOfTheYear(date), 3); + case 'l': + return lpad(date.getHours() % 12, 2); + case 'L': + return pad(date.getMilliseconds(), 3); + case 'm': + return pad(date.getMonth() + 1, 2); + case 'M': + return pad(date.getMinutes(), 2); + case 'n': + return '\n'; + case 'p': + return date.getHours() >= 12? l10n.pm : l10n.am; + case 'P': + return convertToken(date, 'p', l10n).toLowerCase(); + case 's': + return date.getTime() / 1000; + case 'S': + return pad(date.getSeconds(), 2); + case 't': + return '\t'; + case 'u': + var day = date.getDay(); + return day === 0? 7 : day; + case 'U': + return pad(weekOfTheYear(date), 2); + case 'w': + return date.getDay(); + case 'W': + return pad(weekOfTheYear(date, 1), 2); + case 'y': + return pad(date.getFullYear() % 100, 2); + case 'Y': + return pad(date.getFullYear(), 4); + case 'z': + return timezoneOffset(date); + case 'Z': + return timezoneAbbr(date); + case '%': + return '%'; + default: + // keep unrecognized tokens + return '%'+ token; + } + } + + + module.exports = strftime; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/date/timezoneAbbr.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/date/timezoneAbbr.js new file mode 100644 index 0000000..b100687 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/date/timezoneAbbr.js @@ -0,0 +1,17 @@ +var timezoneOffset = require('./timezoneOffset'); + + /** + * Abbreviated time zone name or similar information. + */ + function timezoneAbbr(date){ + // Date.toString gives different results depending on the + // browser/system so we fallback to timezone offset + // chrome: 'Mon Apr 08 2013 09:02:04 GMT-0300 (BRT)' + // IE: 'Mon Apr 8 09:02:04 UTC-0300 2013' + var tz = /\(([A-Z]{3,4})\)/.exec(date.toString()); + return tz? tz[1] : timezoneOffset(date); + } + + module.exports = timezoneAbbr; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/date/timezoneOffset.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/date/timezoneOffset.js new file mode 100644 index 0000000..9492dce --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/date/timezoneOffset.js @@ -0,0 +1,16 @@ +var pad = require('../number/pad'); + + /** + * time zone as hour and minute offset from UTC (e.g. +0900) + */ + function timezoneOffset(date){ + var offset = date.getTimezoneOffset(); + var abs = Math.abs(offset); + var h = pad(Math.floor(abs / 60), 2); + var m = pad(abs % 60, 2); + return (offset > 0? '-' : '+') + h + m; + } + + module.exports = timezoneOffset; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/date/totalDaysInMonth.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/date/totalDaysInMonth.js new file mode 100644 index 0000000..8aafeb8 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/date/totalDaysInMonth.js @@ -0,0 +1,25 @@ +var isDate = require('../lang/isDate'); +var isLeapYear = require('./isLeapYear'); + + var DAYS_IN_MONTH = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; + + /** + * returns the total amount of days in the month (considering leap years) + */ + function totalDaysInMonth(fullYear, monthIndex){ + if (isDate(fullYear)) { + var date = fullYear; + year = date.getFullYear(); + monthIndex = date.getMonth(); + } + + if (monthIndex === 1 && isLeapYear(fullYear)) { + return 29; + } else { + return DAYS_IN_MONTH[monthIndex]; + } + } + + module.exports = totalDaysInMonth; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/date/totalDaysInYear.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/date/totalDaysInYear.js new file mode 100644 index 0000000..b4b7e9b --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/date/totalDaysInYear.js @@ -0,0 +1,13 @@ +var isLeapYear = require('./isLeapYear'); + + /** + * return the amount of days in the year following the gregorian calendar + * and leap years + */ + function totalDaysInYear(fullYear){ + return isLeapYear(fullYear)? 366 : 365; + } + + module.exports = totalDaysInYear; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/date/weekOfTheYear.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/date/weekOfTheYear.js new file mode 100644 index 0000000..dd51b7f --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/date/weekOfTheYear.js @@ -0,0 +1,16 @@ +var dayOfTheYear = require('./dayOfTheYear'); + + /** + * Return the week of the year based on given firstDayOfWeek + */ + function weekOfTheYear(date, firstDayOfWeek){ + firstDayOfWeek = firstDayOfWeek == null? 0 : firstDayOfWeek; + var doy = dayOfTheYear(date); + var dow = (7 + date.getDay() - firstDayOfWeek) % 7; + var relativeWeekDay = 6 - firstDayOfWeek - dow; + return Math.floor((doy + relativeWeekDay) / 7); + } + + module.exports = weekOfTheYear; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/function.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/function.js new file mode 100644 index 0000000..53254c3 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/function.js @@ -0,0 +1,22 @@ + + +//automatically generated, do not edit! +//run `node build` instead +module.exports = { + 'awaitDelay' : require('./function/awaitDelay'), + 'bind' : require('./function/bind'), + 'compose' : require('./function/compose'), + 'constant' : require('./function/constant'), + 'debounce' : require('./function/debounce'), + 'func' : require('./function/func'), + 'identity' : require('./function/identity'), + 'makeIterator_' : require('./function/makeIterator_'), + 'partial' : require('./function/partial'), + 'prop' : require('./function/prop'), + 'series' : require('./function/series'), + 'throttle' : require('./function/throttle'), + 'timeout' : require('./function/timeout'), + 'times' : require('./function/times') +}; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/function/awaitDelay.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/function/awaitDelay.js new file mode 100644 index 0000000..8c9b1a3 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/function/awaitDelay.js @@ -0,0 +1,22 @@ +var now = require('../time/now'); +var timeout = require('./timeout'); +var append = require('../array/append'); + + /** + * Ensure a minimum delay for callbacks + */ + function awaitDelay( callback, delay ){ + var baseTime = now() + delay; + return function() { + // ensure all browsers will execute it asynchronously (avoid hard + // to catch errors) not using "0" because of old browsers and also + // since new browsers increase the value to be at least "4" + // http://www.whatwg.org/specs/web-apps/current-work/multipage/timers.html#dom-windowtimers-settimeout + var ms = Math.max(baseTime - now(), 4); + return timeout.apply(this, append([callback, ms, this], arguments)); + }; + } + + module.exports = awaitDelay; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/function/bind.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/function/bind.js new file mode 100644 index 0000000..c6c4719 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/function/bind.js @@ -0,0 +1,19 @@ +var slice = require('../array/slice'); + + /** + * Return a function that will execute in the given context, optionally adding any additional supplied parameters to the beginning of the arguments collection. + * @param {Function} fn Function. + * @param {object} context Execution context. + * @param {rest} args Arguments (0...n arguments). + * @return {Function} Wrapped Function. + */ + function bind(fn, context, args){ + var argsArr = slice(arguments, 2); //curried args + return function(){ + return fn.apply(context, argsArr.concat(slice(arguments))); + }; + } + + module.exports = bind; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/function/compose.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/function/compose.js new file mode 100644 index 0000000..8cd5c5f --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/function/compose.js @@ -0,0 +1,23 @@ + + + /** + * Returns a function that composes multiple functions, passing results to + * each other. + */ + function compose() { + var fns = arguments; + return function(arg){ + // only cares about the first argument since the chain can only + // deal with a single return value anyway. It should start from + // the last fn. + var n = fns.length; + while (n--) { + arg = fns[n].call(this, arg); + } + return arg; + }; + } + + module.exports = compose; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/function/constant.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/function/constant.js new file mode 100644 index 0000000..ab932d9 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/function/constant.js @@ -0,0 +1,14 @@ + + + /** + * Returns a new function that will return the value + */ + function constant(value){ + return function() { + return value; + }; + } + + module.exports = constant; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/function/debounce.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/function/debounce.js new file mode 100644 index 0000000..7f6f302 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/function/debounce.js @@ -0,0 +1,32 @@ + + + /** + * Debounce callback execution + */ + function debounce(fn, threshold, isAsap){ + var timeout, result; + function debounced(){ + var args = arguments, context = this; + function delayed(){ + if (! isAsap) { + result = fn.apply(context, args); + } + timeout = null; + } + if (timeout) { + clearTimeout(timeout); + } else if (isAsap) { + result = fn.apply(context, args); + } + timeout = setTimeout(delayed, threshold); + return result; + } + debounced.cancel = function(){ + clearTimeout(timeout); + }; + return debounced; + } + + module.exports = debounce; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/function/func.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/function/func.js new file mode 100644 index 0000000..b81bf0a --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/function/func.js @@ -0,0 +1,14 @@ + + + /** + * Returns a function that call a method on the passed object + */ + function func(name){ + return function(obj){ + return obj[name](); + }; + } + + module.exports = func; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/function/identity.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/function/identity.js new file mode 100644 index 0000000..d07b01a --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/function/identity.js @@ -0,0 +1,12 @@ + + + /** + * Returns the first argument provided to it. + */ + function identity(val){ + return val; + } + + module.exports = identity; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/function/makeIterator_.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/function/makeIterator_.js new file mode 100644 index 0000000..20cc0e7 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/function/makeIterator_.js @@ -0,0 +1,34 @@ +var identity = require('./identity'); +var prop = require('./prop'); +var deepMatches = require('../object/deepMatches'); + + /** + * Converts argument into a valid iterator. + * Used internally on most array/object/collection methods that receives a + * callback/iterator providing a shortcut syntax. + */ + function makeIterator(src, thisObj){ + if (src == null) { + return identity; + } + switch(typeof src) { + case 'function': + // function is the first to improve perf (most common case) + // also avoid using `Function#call` if not needed, which boosts + // perf a lot in some cases + return (typeof thisObj !== 'undefined')? function(val, i, arr){ + return src.call(thisObj, val, i, arr); + } : src; + case 'object': + return function(val){ + return deepMatches(val, src); + }; + case 'string': + case 'number': + return prop(src); + } + } + + module.exports = makeIterator; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/function/partial.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/function/partial.js new file mode 100644 index 0000000..0e3927d --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/function/partial.js @@ -0,0 +1,15 @@ +var slice = require('../array/slice'); + + /** + * Creates a partially applied function. + */ + function partial(fn, var_args){ + var argsArr = slice(arguments, 1); //curried args + return function(){ + return fn.apply(this, argsArr.concat(slice(arguments))); + }; + } + + module.exports = partial; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/function/prop.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/function/prop.js new file mode 100644 index 0000000..734acb7 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/function/prop.js @@ -0,0 +1,14 @@ + + + /** + * Returns a function that gets a property of the passed object + */ + function prop(name){ + return function(obj){ + return obj[name]; + }; + } + + module.exports = prop; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/function/series.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/function/series.js new file mode 100644 index 0000000..25159c2 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/function/series.js @@ -0,0 +1,22 @@ + + + /** + * Returns a function that will execute a list of functions in sequence + * passing the same arguments to each one. (useful for batch processing + * items during a forEach loop) + */ + function series(){ + var fns = arguments; + return function(){ + var i = 0, + n = fns.length; + while (i < n) { + fns[i].apply(this, arguments); + i += 1; + } + }; + } + + module.exports = series; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/function/throttle.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/function/throttle.js new file mode 100644 index 0000000..0a5e161 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/function/throttle.js @@ -0,0 +1,33 @@ +var now = require('../time/now'); + + /** + */ + function throttle(fn, delay){ + var context, timeout, result, args, + diff, prevCall = 0; + function delayed(){ + prevCall = now(); + timeout = null; + result = fn.apply(context, args); + } + function throttled(){ + context = this; + args = arguments; + diff = delay - (now() - prevCall); + if (diff <= 0) { + clearTimeout(timeout); + delayed(); + } else if (! timeout) { + timeout = setTimeout(delayed, diff); + } + return result; + } + throttled.cancel = function(){ + clearTimeout(timeout); + }; + return throttled; + } + + module.exports = throttle; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/function/timeout.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/function/timeout.js new file mode 100644 index 0000000..509dd68 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/function/timeout.js @@ -0,0 +1,17 @@ +var slice = require('../array/slice'); + + /** + * Delays the call of a function within a given context. + */ + function timeout(fn, millis, context){ + + var args = slice(arguments, 3); + + return setTimeout(function() { + fn.apply(context, args); + }, millis); + } + + module.exports = timeout; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/function/times.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/function/times.js new file mode 100644 index 0000000..04a11c2 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/function/times.js @@ -0,0 +1,17 @@ + + + /** + * Iterates over a callback a set amount of times + */ + function times(n, callback, thisObj){ + var i = -1; + while (++i < n) { + if ( callback.call(thisObj, i) === false ) { + break; + } + } + } + + module.exports = times; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/index.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/index.js new file mode 100644 index 0000000..d4dddd6 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/index.js @@ -0,0 +1,25 @@ +/**@license + * mout v0.9.1 | http://moutjs.com | MIT license + */ + + +//automatically generated, do not edit! +//run `node build` instead +module.exports = { + 'VERSION' : '0.9.1', + 'array' : require('./array'), + 'collection' : require('./collection'), + 'date' : require('./date'), + 'function' : require('./function'), + 'lang' : require('./lang'), + 'math' : require('./math'), + 'number' : require('./number'), + 'object' : require('./object'), + 'queryString' : require('./queryString'), + 'random' : require('./random'), + 'string' : require('./string'), + 'time' : require('./time'), + 'fn' : require('./function') +}; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/lang.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/lang.js new file mode 100644 index 0000000..024f7fa --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/lang.js @@ -0,0 +1,37 @@ + + +//automatically generated, do not edit! +//run `node build` instead +module.exports = { + 'clone' : require('./lang/clone'), + 'createObject' : require('./lang/createObject'), + 'ctorApply' : require('./lang/ctorApply'), + 'deepClone' : require('./lang/deepClone'), + 'defaults' : require('./lang/defaults'), + 'inheritPrototype' : require('./lang/inheritPrototype'), + 'is' : require('./lang/is'), + 'isArguments' : require('./lang/isArguments'), + 'isArray' : require('./lang/isArray'), + 'isBoolean' : require('./lang/isBoolean'), + 'isDate' : require('./lang/isDate'), + 'isEmpty' : require('./lang/isEmpty'), + 'isFinite' : require('./lang/isFinite'), + 'isFunction' : require('./lang/isFunction'), + 'isInteger' : require('./lang/isInteger'), + 'isKind' : require('./lang/isKind'), + 'isNaN' : require('./lang/isNaN'), + 'isNull' : require('./lang/isNull'), + 'isNumber' : require('./lang/isNumber'), + 'isObject' : require('./lang/isObject'), + 'isPlainObject' : require('./lang/isPlainObject'), + 'isRegExp' : require('./lang/isRegExp'), + 'isString' : require('./lang/isString'), + 'isUndefined' : require('./lang/isUndefined'), + 'isnt' : require('./lang/isnt'), + 'kindOf' : require('./lang/kindOf'), + 'toArray' : require('./lang/toArray'), + 'toNumber' : require('./lang/toNumber'), + 'toString' : require('./lang/toString') +}; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/clone.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/clone.js new file mode 100644 index 0000000..33c4e94 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/clone.js @@ -0,0 +1,49 @@ +var kindOf = require('./kindOf'); +var isPlainObject = require('./isPlainObject'); +var mixIn = require('../object/mixIn'); + + /** + * Clone native types. + */ + function clone(val){ + switch (kindOf(val)) { + case 'Object': + return cloneObject(val); + case 'Array': + return cloneArray(val); + case 'RegExp': + return cloneRegExp(val); + case 'Date': + return cloneDate(val); + default: + return val; + } + } + + function cloneObject(source) { + if (isPlainObject(source)) { + return mixIn({}, source); + } else { + return source; + } + } + + function cloneRegExp(r) { + var flags = ''; + flags += r.multiline ? 'm' : ''; + flags += r.global ? 'g' : ''; + flags += r.ignorecase ? 'i' : ''; + return new RegExp(r.source, flags); + } + + function cloneDate(date) { + return new Date(+date); + } + + function cloneArray(arr) { + return arr.slice(); + } + + module.exports = clone; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/createObject.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/createObject.js new file mode 100644 index 0000000..bbc14c1 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/createObject.js @@ -0,0 +1,18 @@ +var mixIn = require('../object/mixIn'); + + /** + * Create Object using prototypal inheritance and setting custom properties. + * - Mix between Douglas Crockford Prototypal Inheritance and the EcmaScript 5 `Object.create()` method. + * @param {object} parent Parent Object. + * @param {object} [props] Object properties. + * @return {object} Created object. + */ + function createObject(parent, props){ + function F(){} + F.prototype = parent; + return mixIn(new F(), props); + + } + module.exports = createObject; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/ctorApply.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/ctorApply.js new file mode 100644 index 0000000..d68dc50 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/ctorApply.js @@ -0,0 +1,17 @@ + + + function F(){} + + /** + * Do fn.apply on a constructor. + */ + function ctorApply(ctor, args) { + F.prototype = ctor.prototype; + var instance = new F(); + ctor.apply(instance, args); + return instance; + } + + module.exports = ctorApply; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/deepClone.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/deepClone.js new file mode 100644 index 0000000..25fd95f --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/deepClone.js @@ -0,0 +1,48 @@ +var clone = require('./clone'); +var forOwn = require('../object/forOwn'); +var kindOf = require('./kindOf'); +var isPlainObject = require('./isPlainObject'); + + /** + * Recursively clone native types. + */ + function deepClone(val, instanceClone) { + switch ( kindOf(val) ) { + case 'Object': + return cloneObject(val, instanceClone); + case 'Array': + return cloneArray(val, instanceClone); + default: + return clone(val); + } + } + + function cloneObject(source, instanceClone) { + if (isPlainObject(source)) { + var out = {}; + forOwn(source, function(val, key) { + this[key] = deepClone(val, instanceClone); + }, out); + return out; + } else if (instanceClone) { + return instanceClone(source); + } else { + return source; + } + } + + function cloneArray(arr, instanceClone) { + var out = [], + i = -1, + n = arr.length, + val; + while (++i < n) { + out[i] = deepClone(arr[i], instanceClone); + } + return out; + } + + module.exports = deepClone; + + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/defaults.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/defaults.js new file mode 100644 index 0000000..1111b2e --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/defaults.js @@ -0,0 +1,17 @@ +var toArray = require('./toArray'); +var find = require('../array/find'); + + /** + * Return first non void argument + */ + function defaults(var_args){ + return find(toArray(arguments), nonVoid); + } + + function nonVoid(val){ + return val != null; + } + + module.exports = defaults; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/inheritPrototype.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/inheritPrototype.js new file mode 100644 index 0000000..1c9da1f --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/inheritPrototype.js @@ -0,0 +1,18 @@ +var createObject = require('./createObject'); + + /** + * Inherit prototype from another Object. + * - inspired by Nicholas Zackas Solution + * @param {object} child Child object + * @param {object} parent Parent Object + */ + function inheritPrototype(child, parent){ + var p = createObject(parent.prototype); + p.constructor = child; + child.prototype = p; + child.super_ = parent; + return p; + } + + module.exports = inheritPrototype; + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/is.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/is.js new file mode 100644 index 0000000..4a83573 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/is.js @@ -0,0 +1,23 @@ + + + /** + * Check if both arguments are egal. + */ + function is(x, y){ + // implementation borrowed from harmony:egal spec + if (x === y) { + // 0 === -0, but they are not identical + return x !== 0 || 1 / x === 1 / y; + } + + // NaN !== NaN, but they are identical. + // NaNs are the only non-reflexive value, i.e., if x !== x, + // then x is a NaN. + // isNaN is broken: it converts its argument to number, so + // isNaN("foo") => true + return x !== x && y !== y; + } + + module.exports = is; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isArguments.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isArguments.js new file mode 100644 index 0000000..f7b08ba --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isArguments.js @@ -0,0 +1,15 @@ +var isKind = require('./isKind'); + + /** + */ + var isArgs = isKind(arguments, 'Arguments')? + function(val){ + return isKind(val, 'Arguments'); + } : + function(val){ + // Arguments is an Object on IE7 + return !!(val && Object.prototype.hasOwnProperty.call(val, 'callee')); + }; + + module.exports = isArgs; + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isArray.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isArray.js new file mode 100644 index 0000000..262ee40 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isArray.js @@ -0,0 +1,8 @@ +var isKind = require('./isKind'); + /** + */ + var isArray = Array.isArray || function (val) { + return isKind(val, 'Array'); + }; + module.exports = isArray; + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isBoolean.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isBoolean.js new file mode 100644 index 0000000..86557cb --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isBoolean.js @@ -0,0 +1,8 @@ +var isKind = require('./isKind'); + /** + */ + function isBoolean(val) { + return isKind(val, 'Boolean'); + } + module.exports = isBoolean; + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isDate.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isDate.js new file mode 100644 index 0000000..4a5130f --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isDate.js @@ -0,0 +1,8 @@ +var isKind = require('./isKind'); + /** + */ + function isDate(val) { + return isKind(val, 'Date'); + } + module.exports = isDate; + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isEmpty.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isEmpty.js new file mode 100644 index 0000000..0e9f77d --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isEmpty.js @@ -0,0 +1,24 @@ +var forOwn = require('../object/forOwn'); +var isArray = require('./isArray'); + + function isEmpty(val){ + if (val == null) { + // typeof null == 'object' so we check it first + return false; + } else if ( typeof val === 'string' || isArray(val) ) { + return !val.length; + } else if ( typeof val === 'object' || typeof val === 'function' ) { + var result = true; + forOwn(val, function(){ + result = false; + return false; // break loop + }); + return result; + } else { + return false; + } + } + + module.exports = isEmpty; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isFinite.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isFinite.js new file mode 100644 index 0000000..6d4006f --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isFinite.js @@ -0,0 +1,21 @@ +var isNumber = require('./isNumber'); + + var global = this; + + /** + * Check if value is finite + */ + function isFinite(val){ + var is = false; + if (typeof val === 'string' && val !== '') { + is = global.isFinite( parseFloat(val) ); + } else if (isNumber(val)){ + // need to use isNumber because of Number constructor + is = global.isFinite( val ); + } + return is; + } + + module.exports = isFinite; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isFunction.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isFunction.js new file mode 100644 index 0000000..216879f --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isFunction.js @@ -0,0 +1,8 @@ +var isKind = require('./isKind'); + /** + */ + function isFunction(val) { + return isKind(val, 'Function'); + } + module.exports = isFunction; + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isInteger.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isInteger.js new file mode 100644 index 0000000..29f95d9 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isInteger.js @@ -0,0 +1,12 @@ +var isNumber = require('./isNumber'); + + /** + * Check if value is an integer + */ + function isInteger(val){ + return isNumber(val) && (val % 1 === 0); + } + + module.exports = isInteger; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isKind.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isKind.js new file mode 100644 index 0000000..02301e0 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isKind.js @@ -0,0 +1,9 @@ +var kindOf = require('./kindOf'); + /** + * Check if value is from a specific "kind". + */ + function isKind(val, kind){ + return kindOf(val) === kind; + } + module.exports = isKind; + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isNaN.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isNaN.js new file mode 100644 index 0000000..b1018ec --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isNaN.js @@ -0,0 +1,16 @@ +var isNumber = require('./isNumber'); +var $isNaN = require('../number/isNaN'); + + /** + * Check if value is NaN for realz + */ + function isNaN(val){ + // based on the fact that NaN !== NaN + // need to check if it's a number to avoid conflicts with host objects + // also need to coerce ToNumber to avoid edge case `new Number(NaN)` + return !isNumber(val) || $isNaN(Number(val)); + } + + module.exports = isNaN; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isNull.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isNull.js new file mode 100644 index 0000000..6252f9e --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isNull.js @@ -0,0 +1,9 @@ + + /** + */ + function isNull(val){ + return val === null; + } + module.exports = isNull; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isNumber.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isNumber.js new file mode 100644 index 0000000..126c1cc --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isNumber.js @@ -0,0 +1,8 @@ +var isKind = require('./isKind'); + /** + */ + function isNumber(val) { + return isKind(val, 'Number'); + } + module.exports = isNumber; + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isObject.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isObject.js new file mode 100644 index 0000000..7350c89 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isObject.js @@ -0,0 +1,8 @@ +var isKind = require('./isKind'); + /** + */ + function isObject(val) { + return isKind(val, 'Object'); + } + module.exports = isObject; + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isPlainObject.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isPlainObject.js new file mode 100644 index 0000000..b81342e --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isPlainObject.js @@ -0,0 +1,13 @@ + + + /** + * Checks if the value is created by the `Object` constructor. + */ + function isPlainObject(value) { + return (!!value && typeof value === 'object' && + value.constructor === Object); + } + + module.exports = isPlainObject; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isRegExp.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isRegExp.js new file mode 100644 index 0000000..fc5459a --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isRegExp.js @@ -0,0 +1,8 @@ +var isKind = require('./isKind'); + /** + */ + function isRegExp(val) { + return isKind(val, 'RegExp'); + } + module.exports = isRegExp; + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isString.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isString.js new file mode 100644 index 0000000..f890658 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isString.js @@ -0,0 +1,8 @@ +var isKind = require('./isKind'); + /** + */ + function isString(val) { + return isKind(val, 'String'); + } + module.exports = isString; + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isUndefined.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isUndefined.js new file mode 100644 index 0000000..fb2261d --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isUndefined.js @@ -0,0 +1,10 @@ + + var UNDEF; + + /** + */ + function isUndef(val){ + return val === UNDEF; + } + module.exports = isUndef; + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isnt.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isnt.js new file mode 100644 index 0000000..9dad58c --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/isnt.js @@ -0,0 +1,12 @@ +var is = require('./is'); + + /** + * Check if both values are not identical/egal + */ + function isnt(x, y){ + return !is(x, y); + } + + module.exports = isnt; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/kindOf.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/kindOf.js new file mode 100644 index 0000000..663464d --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/kindOf.js @@ -0,0 +1,20 @@ + + + var _rKind = /^\[object (.*)\]$/, + _toString = Object.prototype.toString, + UNDEF; + + /** + * Gets the "kind" of value. (e.g. "String", "Number", etc) + */ + function kindOf(val) { + if (val === null) { + return 'Null'; + } else if (val === UNDEF) { + return 'Undefined'; + } else { + return _rKind.exec( _toString.call(val) )[1]; + } + } + module.exports = kindOf; + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/toArray.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/toArray.js new file mode 100644 index 0000000..e39b873 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/toArray.js @@ -0,0 +1,31 @@ +var kindOf = require('./kindOf'); + + var _win = this; + + /** + * Convert array-like object into array + */ + function toArray(val){ + var ret = [], + kind = kindOf(val), + n; + + if (val != null) { + if ( val.length == null || kind === 'String' || kind === 'Function' || kind === 'RegExp' || val === _win ) { + //string, regexp, function have .length but user probably just want + //to wrap value into an array.. + ret[ret.length] = val; + } else { + //window returns true on isObject in IE7 and may have length + //property. `typeof NodeList` returns `function` on Safari so + //we can't use it (#58) + n = val.length; + while (n--) { + ret[n] = val[n]; + } + } + } + return ret; + } + module.exports = toArray; + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/toNumber.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/toNumber.js new file mode 100644 index 0000000..8b6df34 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/toNumber.js @@ -0,0 +1,20 @@ +var isArray = require('./isArray'); + + /** + * covert value into number if numeric + */ + function toNumber(val){ + // numberic values should come first because of -0 + if (typeof val === 'number') return val; + // we want all falsy values (besides -0) to return zero to avoid + // headaches + if (!val) return 0; + if (typeof val === 'string') return parseFloat(val); + // arrays are edge cases. `Number([4]) === 4` + if (isArray(val)) return NaN; + return Number(val); + } + + module.exports = toNumber; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/toString.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/toString.js new file mode 100644 index 0000000..ae5c2b0 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/lang/toString.js @@ -0,0 +1,13 @@ + + + /** + * Typecast a value to a String, using an empty string value for null or + * undefined. + */ + function toString(val){ + return val == null ? '' : val.toString(); + } + + module.exports = toString; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/math.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/math.js new file mode 100644 index 0000000..c6ee889 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/math.js @@ -0,0 +1,19 @@ + + +//automatically generated, do not edit! +//run `node build` instead +module.exports = { + 'ceil' : require('./math/ceil'), + 'clamp' : require('./math/clamp'), + 'countSteps' : require('./math/countSteps'), + 'floor' : require('./math/floor'), + 'inRange' : require('./math/inRange'), + 'isNear' : require('./math/isNear'), + 'lerp' : require('./math/lerp'), + 'loop' : require('./math/loop'), + 'map' : require('./math/map'), + 'norm' : require('./math/norm'), + 'round' : require('./math/round') +}; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/math/ceil.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/math/ceil.js new file mode 100644 index 0000000..a279e15 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/math/ceil.js @@ -0,0 +1,11 @@ + + /** + * Round value up with a custom radix. + */ + function ceil(val, step){ + step = Math.abs(step || 1); + return Math.ceil(val / step) * step; + } + + module.exports = ceil; + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/math/clamp.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/math/clamp.js new file mode 100644 index 0000000..e929a9a --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/math/clamp.js @@ -0,0 +1,9 @@ + + /** + * Clamps value inside range. + */ + function clamp(val, min, max){ + return val < min? min : (val > max? max : val); + } + module.exports = clamp; + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/math/countSteps.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/math/countSteps.js new file mode 100644 index 0000000..60ac90c --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/math/countSteps.js @@ -0,0 +1,16 @@ + + /** + * Count number of full steps. + */ + function countSteps(val, step, overflow){ + val = Math.floor(val / step); + + if (overflow) { + return val % overflow; + } + + return val; + } + + module.exports = countSteps; + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/math/floor.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/math/floor.js new file mode 100644 index 0000000..9de5053 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/math/floor.js @@ -0,0 +1,10 @@ + + /** + * Floor value to full steps. + */ + function floor(val, step){ + step = Math.abs(step || 1); + return Math.floor(val / step) * step; + } + module.exports = floor; + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/math/inRange.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/math/inRange.js new file mode 100644 index 0000000..763218f --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/math/inRange.js @@ -0,0 +1,11 @@ + + /** + * Checks if value is inside the range. + */ + function inRange(val, min, max, threshold){ + threshold = threshold || 0; + return (val + threshold >= min && val - threshold <= max); + } + + module.exports = inRange; + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/math/isNear.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/math/isNear.js new file mode 100644 index 0000000..45486b6 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/math/isNear.js @@ -0,0 +1,9 @@ + + /** + * Check if value is close to target. + */ + function isNear(val, target, threshold){ + return (Math.abs(val - target) <= threshold); + } + module.exports = isNear; + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/math/lerp.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/math/lerp.js new file mode 100644 index 0000000..111e271 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/math/lerp.js @@ -0,0 +1,11 @@ + + /** + * Linear interpolation. + * IMPORTANT:will return `Infinity` if numbers overflow Number.MAX_VALUE + */ + function lerp(ratio, start, end){ + return start + (end - start) * ratio; + } + + module.exports = lerp; + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/math/loop.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/math/loop.js new file mode 100644 index 0000000..35207c1 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/math/loop.js @@ -0,0 +1,10 @@ + + /** + * Loops value inside range. + */ + function loop(val, min, max){ + return val < min? max : (val > max? min : val); + } + + module.exports = loop; + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/math/map.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/math/map.js new file mode 100644 index 0000000..96c4b78 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/math/map.js @@ -0,0 +1,11 @@ +var lerp = require('./lerp'); +var norm = require('./norm'); + /** + * Maps a number from one scale to another. + * @example map(3, 0, 4, -1, 1) -> 0.5 + */ + function map(val, min1, max1, min2, max2){ + return lerp( norm(val, min1, max1), min2, max2 ); + } + module.exports = map; + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/math/norm.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/math/norm.js new file mode 100644 index 0000000..54caf78 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/math/norm.js @@ -0,0 +1,9 @@ + + /** + * Gets normalized ratio of value inside range. + */ + function norm(val, min, max){ + return (val - min) / (max - min); + } + module.exports = norm; + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/math/round.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/math/round.js new file mode 100644 index 0000000..d108e6c --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/math/round.js @@ -0,0 +1,12 @@ + + /** + * Round number to a specific radix + */ + function round(value, radix){ + radix = radix || 1; // default round 1 + return Math.round(value / radix) * radix; + } + + module.exports = round; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/number.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/number.js new file mode 100644 index 0000000..d7a3fe2 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/number.js @@ -0,0 +1,24 @@ + + +//automatically generated, do not edit! +//run `node build` instead +module.exports = { + 'MAX_INT' : require('./number/MAX_INT'), + 'MAX_UINT' : require('./number/MAX_UINT'), + 'MIN_INT' : require('./number/MIN_INT'), + 'abbreviate' : require('./number/abbreviate'), + 'currencyFormat' : require('./number/currencyFormat'), + 'enforcePrecision' : require('./number/enforcePrecision'), + 'isNaN' : require('./number/isNaN'), + 'nth' : require('./number/nth'), + 'ordinal' : require('./number/ordinal'), + 'pad' : require('./number/pad'), + 'rol' : require('./number/rol'), + 'ror' : require('./number/ror'), + 'sign' : require('./number/sign'), + 'toInt' : require('./number/toInt'), + 'toUInt' : require('./number/toUInt'), + 'toUInt31' : require('./number/toUInt31') +}; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/number/MAX_INT.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/number/MAX_INT.js new file mode 100644 index 0000000..1d6f0e4 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/number/MAX_INT.js @@ -0,0 +1,6 @@ +/** + * @constant Maximum 32-bit signed integer value. (2^31 - 1) + */ + + module.exports = 2147483647; + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/number/MAX_UINT.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/number/MAX_UINT.js new file mode 100644 index 0000000..700da0f --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/number/MAX_UINT.js @@ -0,0 +1,6 @@ +/** + * @constant Maximum 32-bit unsigned integet value (2^32 - 1) + */ + + module.exports = 4294967295; + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/number/MIN_INT.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/number/MIN_INT.js new file mode 100644 index 0000000..b34ab2c --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/number/MIN_INT.js @@ -0,0 +1,6 @@ +/** + * @constant Minimum 32-bit signed integer value (-2^31). + */ + + module.exports = -2147483648; + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/number/abbreviate.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/number/abbreviate.js new file mode 100644 index 0000000..dd6716b --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/number/abbreviate.js @@ -0,0 +1,35 @@ +var enforcePrecision = require('./enforcePrecision'); + + var _defaultDict = { + thousand : 'K', + million : 'M', + billion : 'B' + }; + + /** + * Abbreviate number if bigger than 1000. (eg: 2.5K, 17.5M, 3.4B, ...) + */ + function abbreviateNumber(val, nDecimals, dict){ + nDecimals = nDecimals != null? nDecimals : 1; + dict = dict || _defaultDict; + val = enforcePrecision(val, nDecimals); + + var str, mod; + + if (val < 1000000) { + mod = enforcePrecision(val / 1000, nDecimals); + // might overflow to next scale during rounding + str = mod < 1000? mod + dict.thousand : 1 + dict.million; + } else if (val < 1000000000) { + mod = enforcePrecision(val / 1000000, nDecimals); + str = mod < 1000? mod + dict.million : 1 + dict.billion; + } else { + str = enforcePrecision(val / 1000000000, nDecimals) + dict.billion; + } + + return str; + } + + module.exports = abbreviateNumber; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/number/currencyFormat.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/number/currencyFormat.js new file mode 100644 index 0000000..c85a668 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/number/currencyFormat.js @@ -0,0 +1,27 @@ +var toNumber = require('../lang/toNumber'); + + /** + * Converts number into currency format + */ + function currencyFormat(val, nDecimalDigits, decimalSeparator, thousandsSeparator) { + val = toNumber(val); + nDecimalDigits = nDecimalDigits == null? 2 : nDecimalDigits; + decimalSeparator = decimalSeparator == null? '.' : decimalSeparator; + thousandsSeparator = thousandsSeparator == null? ',' : thousandsSeparator; + + //can't use enforce precision since it returns a number and we are + //doing a RegExp over the string + var fixed = val.toFixed(nDecimalDigits), + //separate begin [$1], middle [$2] and decimal digits [$4] + parts = new RegExp('^(-?\\d{1,3})((?:\\d{3})+)(\\.(\\d{'+ nDecimalDigits +'}))?$').exec( fixed ); + + if(parts){ //val >= 1000 || val <= -1000 + return parts[1] + parts[2].replace(/\d{3}/g, thousandsSeparator + '$&') + (parts[4] ? decimalSeparator + parts[4] : ''); + }else{ + return fixed.replace('.', decimalSeparator); + } + } + + module.exports = currencyFormat; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/number/enforcePrecision.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/number/enforcePrecision.js new file mode 100644 index 0000000..3d3b2d4 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/number/enforcePrecision.js @@ -0,0 +1,12 @@ +var toNumber = require('../lang/toNumber'); + /** + * Enforce a specific amount of decimal digits and also fix floating + * point rounding issues. + */ + function enforcePrecision(val, nDecimalDigits){ + val = toNumber(val); + var pow = Math.pow(10, nDecimalDigits); + return +(Math.round(val * pow) / pow).toFixed(nDecimalDigits); + } + module.exports = enforcePrecision; + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/number/isNaN.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/number/isNaN.js new file mode 100644 index 0000000..3799f3b --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/number/isNaN.js @@ -0,0 +1,14 @@ + + + /** + * ES6 Number.isNaN + * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isNaN + */ + function isNaN(val){ + // jshint eqeqeq:false + return typeof val === 'number' && val != val; + } + + module.exports = isNaN; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/number/nth.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/number/nth.js new file mode 100644 index 0000000..43ffb21 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/number/nth.js @@ -0,0 +1,25 @@ + + + /** + * Returns "nth" of number (1 = "st", 2 = "nd", 3 = "rd", 4..10 = "th", ...) + */ + function nth(i) { + var t = (i % 100); + if (t >= 10 && t <= 20) { + return 'th'; + } + switch(i % 10) { + case 1: + return 'st'; + case 2: + return 'nd'; + case 3: + return 'rd'; + default: + return 'th'; + } + } + + module.exports = nth; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/number/ordinal.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/number/ordinal.js new file mode 100644 index 0000000..939a0fa --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/number/ordinal.js @@ -0,0 +1,14 @@ +var toInt = require('./toInt'); +var nth = require('./nth'); + + /** + * converts number into ordinal form (1st, 2nd, 3rd, 4th, ...) + */ + function ordinal(n){ + n = toInt(n); + return n + nth(n); + } + + module.exports = ordinal; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/number/pad.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/number/pad.js new file mode 100644 index 0000000..1f83af4 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/number/pad.js @@ -0,0 +1,14 @@ +var lpad = require('../string/lpad'); +var toNumber = require('../lang/toNumber'); + + /** + * Add padding zeros if n.length < minLength. + */ + function pad(n, minLength, char){ + n = toNumber(n); + return lpad(''+ n, minLength, char || '0'); + } + + module.exports = pad; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/number/rol.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/number/rol.js new file mode 100644 index 0000000..ecd58da --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/number/rol.js @@ -0,0 +1,10 @@ + + /** + * Bitwise circular shift left + * http://en.wikipedia.org/wiki/Circular_shift + */ + function rol(val, shift){ + return (val << shift) | (val >> (32 - shift)); + } + module.exports = rol; + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/number/ror.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/number/ror.js new file mode 100644 index 0000000..2eda81d --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/number/ror.js @@ -0,0 +1,10 @@ + + /** + * Bitwise circular shift right + * http://en.wikipedia.org/wiki/Circular_shift + */ + function ror(val, shift){ + return (val >> shift) | (val << (32 - shift)); + } + module.exports = ror; + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/number/sign.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/number/sign.js new file mode 100644 index 0000000..7f9a1e2 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/number/sign.js @@ -0,0 +1,15 @@ +var toNumber = require('../lang/toNumber'); + + /** + * Get sign of the value. + */ + function sign(val) { + var num = toNumber(val); + if (num === 0) return num; // +0 and +0 === 0 + if (isNaN(num)) return num; // NaN + return num < 0? -1 : 1; + } + + module.exports = sign; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/number/toInt.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/number/toInt.js new file mode 100644 index 0000000..72fd7de --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/number/toInt.js @@ -0,0 +1,17 @@ + + + /** + * "Convert" value into an 32-bit integer. + * Works like `Math.floor` if val > 0 and `Math.ceil` if val < 0. + * IMPORTANT: val will wrap at 2^31 and -2^31. + * Perf tests: http://jsperf.com/vs-vs-parseint-bitwise-operators/7 + */ + function toInt(val){ + // we do not use lang/toNumber because of perf and also because it + // doesn't break the functionality + return ~~val; + } + + module.exports = toInt; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/number/toUInt.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/number/toUInt.js new file mode 100644 index 0000000..d279656 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/number/toUInt.js @@ -0,0 +1,15 @@ + + + /** + * "Convert" value into a 32-bit unsigned integer. + * IMPORTANT: Value will wrap at 2^32. + */ + function toUInt(val){ + // we do not use lang/toNumber because of perf and also because it + // doesn't break the functionality + return val >>> 0; + } + + module.exports = toUInt; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/number/toUInt31.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/number/toUInt31.js new file mode 100644 index 0000000..6cd3bb5 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/number/toUInt31.js @@ -0,0 +1,15 @@ +var MAX_INT = require('./MAX_INT'); + + /** + * "Convert" value into an 31-bit unsigned integer (since 1 bit is used for sign). + * IMPORTANT: value wil wrap at 2^31, if negative will return 0. + */ + function toUInt31(val){ + // we do not use lang/toNumber because of perf and also because it + // doesn't break the functionality + return (val <= 0)? 0 : (val > MAX_INT? ~~(val % (MAX_INT + 1)) : ~~val); + } + + module.exports = toUInt31; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/object.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/object.js new file mode 100644 index 0000000..76c0642 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/object.js @@ -0,0 +1,42 @@ + + +//automatically generated, do not edit! +//run `node build` instead +module.exports = { + 'bindAll' : require('./object/bindAll'), + 'contains' : require('./object/contains'), + 'deepEquals' : require('./object/deepEquals'), + 'deepFillIn' : require('./object/deepFillIn'), + 'deepMatches' : require('./object/deepMatches'), + 'deepMixIn' : require('./object/deepMixIn'), + 'equals' : require('./object/equals'), + 'every' : require('./object/every'), + 'fillIn' : require('./object/fillIn'), + 'filter' : require('./object/filter'), + 'find' : require('./object/find'), + 'forIn' : require('./object/forIn'), + 'forOwn' : require('./object/forOwn'), + 'functions' : require('./object/functions'), + 'get' : require('./object/get'), + 'has' : require('./object/has'), + 'hasOwn' : require('./object/hasOwn'), + 'keys' : require('./object/keys'), + 'map' : require('./object/map'), + 'matches' : require('./object/matches'), + 'max' : require('./object/max'), + 'merge' : require('./object/merge'), + 'min' : require('./object/min'), + 'mixIn' : require('./object/mixIn'), + 'namespace' : require('./object/namespace'), + 'pick' : require('./object/pick'), + 'pluck' : require('./object/pluck'), + 'reduce' : require('./object/reduce'), + 'reject' : require('./object/reject'), + 'set' : require('./object/set'), + 'size' : require('./object/size'), + 'some' : require('./object/some'), + 'unset' : require('./object/unset'), + 'values' : require('./object/values') +}; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/object/bindAll.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/object/bindAll.js new file mode 100644 index 0000000..c8a2034 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/object/bindAll.js @@ -0,0 +1,19 @@ +var functions = require('./functions'); +var bind = require('../function/bind'); +var forEach = require('../array/forEach'); +var slice = require('../array/slice'); + + /** + * Binds methods of the object to be run in it's own context. + */ + function bindAll(obj, rest_methodNames){ + var keys = arguments.length > 1? + slice(arguments, 1) : functions(obj); + forEach(keys, function(key){ + obj[key] = bind(obj[key], obj); + }); + } + + module.exports = bindAll; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/object/contains.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/object/contains.js new file mode 100644 index 0000000..8076e2c --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/object/contains.js @@ -0,0 +1,13 @@ +var some = require('./some'); + + /** + * Check if object contains value + */ + function contains(obj, needle) { + return some(obj, function(val) { + return (val === needle); + }); + } + module.exports = contains; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/object/deepEquals.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/object/deepEquals.js new file mode 100644 index 0000000..fcde944 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/object/deepEquals.js @@ -0,0 +1,27 @@ +var isObject = require('../lang/isObject'); +var equals = require('./equals'); + + function defaultCompare(a, b) { + return a === b; + } + + /** + * Recursively checks for same properties and values. + */ + function deepEquals(a, b, callback){ + callback = callback || defaultCompare; + + if (!isObject(a) || !isObject(b)) { + return callback(a, b); + } + + function compare(a, b){ + return deepEquals(a, b, callback); + } + + return equals(a, b, compare); + } + + module.exports = deepEquals; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/object/deepFillIn.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/object/deepFillIn.js new file mode 100644 index 0000000..6568ea8 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/object/deepFillIn.js @@ -0,0 +1,33 @@ +var forOwn = require('./forOwn'); +var isPlainObject = require('../lang/isPlainObject'); + + /** + * Deeply copy missing properties in the target from the defaults. + */ + function deepFillIn(target, defaults){ + var i = 0, + n = arguments.length, + obj; + + while(++i < n) { + obj = arguments[i]; + if (obj) { + // jshint loopfunc: true + forOwn(obj, function(newValue, key) { + var curValue = target[key]; + if (curValue == null) { + target[key] = newValue; + } else if (isPlainObject(curValue) && + isPlainObject(newValue)) { + deepFillIn(curValue, newValue); + } + }); + } + } + + return target; + } + + module.exports = deepFillIn; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/object/deepMatches.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/object/deepMatches.js new file mode 100644 index 0000000..3366c52 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/object/deepMatches.js @@ -0,0 +1,55 @@ +var forOwn = require('./forOwn'); +var isArray = require('../lang/isArray'); + + function containsMatch(array, pattern) { + var i = -1, length = array.length; + while (++i < length) { + if (deepMatches(array[i], pattern)) { + return true; + } + } + + return false; + } + + function matchArray(target, pattern) { + var i = -1, patternLength = pattern.length; + while (++i < patternLength) { + if (!containsMatch(target, pattern[i])) { + return false; + } + } + + return true; + } + + function matchObject(target, pattern) { + var result = true; + forOwn(pattern, function(val, key) { + if (!deepMatches(target[key], val)) { + // Return false to break out of forOwn early + return (result = false); + } + }); + + return result; + } + + /** + * Recursively check if the objects match. + */ + function deepMatches(target, pattern){ + if (target && typeof target === 'object') { + if (isArray(target) && isArray(pattern)) { + return matchArray(target, pattern); + } else { + return matchObject(target, pattern); + } + } else { + return target === pattern; + } + } + + module.exports = deepMatches; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/object/deepMixIn.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/object/deepMixIn.js new file mode 100644 index 0000000..a97e98d --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/object/deepMixIn.js @@ -0,0 +1,34 @@ +var forOwn = require('./forOwn'); +var isPlainObject = require('../lang/isPlainObject'); + + /** + * Mixes objects into the target object, recursively mixing existing child + * objects. + */ + function deepMixIn(target, objects) { + var i = 0, + n = arguments.length, + obj; + + while(++i < n){ + obj = arguments[i]; + if (obj) { + forOwn(obj, copyProp, target); + } + } + + return target; + } + + function copyProp(val, key) { + var existing = this[key]; + if (isPlainObject(val) && isPlainObject(existing)) { + deepMixIn(existing, val); + } else { + this[key] = val; + } + } + + module.exports = deepMixIn; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/object/equals.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/object/equals.js new file mode 100644 index 0000000..f50cbe4 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/object/equals.js @@ -0,0 +1,36 @@ +var hasOwn = require('./hasOwn'); +var every = require('./every'); +var isObject = require('../lang/isObject'); + + function defaultCompare(a, b) { + return a === b; + } + + // Makes a function to compare the object values from the specified compare + // operation callback. + function makeCompare(callback) { + return function(value, key) { + return hasOwn(this, key) && callback(value, this[key]); + }; + } + + function checkProperties(value, key) { + return hasOwn(this, key); + } + + /** + * Checks if two objects have the same keys and values. + */ + function equals(a, b, callback) { + callback = callback || defaultCompare; + + if (!isObject(a) || !isObject(b)) { + return callback(a, b); + } + + return (every(a, makeCompare(callback), b) && + every(b, checkProperties, a)); + } + + module.exports = equals; + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/object/every.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/object/every.js new file mode 100644 index 0000000..01106e5 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/object/every.js @@ -0,0 +1,23 @@ +var forOwn = require('./forOwn'); +var makeIterator = require('../function/makeIterator_'); + + /** + * Object every + */ + function every(obj, callback, thisObj) { + callback = makeIterator(callback, thisObj); + var result = true; + forOwn(obj, function(val, key) { + // we consider any falsy values as "false" on purpose so shorthand + // syntax can be used to check property existence + if (!callback(val, key, obj)) { + result = false; + return false; // break + } + }); + return result; + } + + module.exports = every; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/object/fillIn.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/object/fillIn.js new file mode 100644 index 0000000..4010e28 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/object/fillIn.js @@ -0,0 +1,21 @@ +var forEach = require('../array/forEach'); +var slice = require('../array/slice'); +var forOwn = require('./forOwn'); + + /** + * Copy missing properties in the obj from the defaults. + */ + function fillIn(obj, var_defaults){ + forEach(slice(arguments, 1), function(base){ + forOwn(base, function(val, key){ + if (obj[key] == null) { + obj[key] = val; + } + }); + }); + return obj; + } + + module.exports = fillIn; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/object/filter.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/object/filter.js new file mode 100644 index 0000000..3a83a92 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/object/filter.js @@ -0,0 +1,20 @@ +var forOwn = require('./forOwn'); +var makeIterator = require('../function/makeIterator_'); + + /** + * Creates a new object with all the properties where the callback returns + * true. + */ + function filterValues(obj, callback, thisObj) { + callback = makeIterator(callback, thisObj); + var output = {}; + forOwn(obj, function(value, key, obj) { + if (callback(value, key, obj)) { + output[key] = value; + } + }); + + return output; + } + module.exports = filterValues; + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/object/find.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/object/find.js new file mode 100644 index 0000000..d39c070 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/object/find.js @@ -0,0 +1,21 @@ +var some = require('./some'); +var makeIterator = require('../function/makeIterator_'); + + /** + * Returns first item that matches criteria + */ + function find(obj, callback, thisObj) { + callback = makeIterator(callback, thisObj); + var result; + some(obj, function(value, key, obj) { + if (callback(value, key, obj)) { + result = value; + return true; //break + } + }); + return result; + } + + module.exports = find; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/object/forIn.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/object/forIn.js new file mode 100644 index 0000000..7fe96ce --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/object/forIn.js @@ -0,0 +1,76 @@ +var hasOwn = require('./hasOwn'); + + var _hasDontEnumBug, + _dontEnums; + + function checkDontEnum(){ + _dontEnums = [ + 'toString', + 'toLocaleString', + 'valueOf', + 'hasOwnProperty', + 'isPrototypeOf', + 'propertyIsEnumerable', + 'constructor' + ]; + + _hasDontEnumBug = true; + + for (var key in {'toString': null}) { + _hasDontEnumBug = false; + } + } + + /** + * Similar to Array/forEach but works over object properties and fixes Don't + * Enum bug on IE. + * based on: http://whattheheadsaid.com/2010/10/a-safer-object-keys-compatibility-implementation + */ + function forIn(obj, fn, thisObj){ + var key, i = 0; + // no need to check if argument is a real object that way we can use + // it for arrays, functions, date, etc. + + //post-pone check till needed + if (_hasDontEnumBug == null) checkDontEnum(); + + for (key in obj) { + if (exec(fn, obj, key, thisObj) === false) { + break; + } + } + + + if (_hasDontEnumBug) { + var ctor = obj.constructor, + isProto = !!ctor && obj === ctor.prototype; + + while (key = _dontEnums[i++]) { + // For constructor, if it is a prototype object the constructor + // is always non-enumerable unless defined otherwise (and + // enumerated above). For non-prototype objects, it will have + // to be defined on this object, since it cannot be defined on + // any prototype objects. + // + // For other [[DontEnum]] properties, check if the value is + // different than Object prototype value. + if ( + (key !== 'constructor' || + (!isProto && hasOwn(obj, key))) && + obj[key] !== Object.prototype[key] + ) { + if (exec(fn, obj, key, thisObj) === false) { + break; + } + } + } + } + } + + function exec(fn, obj, key, thisObj){ + return fn.call(thisObj, obj[key], key, obj); + } + + module.exports = forIn; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/object/forOwn.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/object/forOwn.js new file mode 100644 index 0000000..5f2dfbf --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/object/forOwn.js @@ -0,0 +1,19 @@ +var hasOwn = require('./hasOwn'); +var forIn = require('./forIn'); + + /** + * Similar to Array/forEach but works over object properties and fixes Don't + * Enum bug on IE. + * based on: http://whattheheadsaid.com/2010/10/a-safer-object-keys-compatibility-implementation + */ + function forOwn(obj, fn, thisObj){ + forIn(obj, function(val, key){ + if (hasOwn(obj, key)) { + return fn.call(thisObj, obj[key], key, obj); + } + }); + } + + module.exports = forOwn; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/object/functions.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/object/functions.js new file mode 100644 index 0000000..f571797 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/object/functions.js @@ -0,0 +1,18 @@ +var forIn = require('./forIn'); + + /** + * return a list of all enumerable properties that have function values + */ + function functions(obj){ + var keys = []; + forIn(obj, function(val, key){ + if (typeof val === 'function'){ + keys.push(key); + } + }); + return keys.sort(); + } + + module.exports = functions; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/object/get.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/object/get.js new file mode 100644 index 0000000..7cf9d9b --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/object/get.js @@ -0,0 +1,20 @@ + + + /** + * get "nested" object property + */ + function get(obj, prop){ + var parts = prop.split('.'), + last = parts.pop(); + + while (prop = parts.shift()) { + obj = obj[prop]; + if (typeof obj !== 'object' || !obj) return; + } + + return obj[last]; + } + + module.exports = get; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/object/has.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/object/has.js new file mode 100644 index 0000000..ca9f228 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/object/has.js @@ -0,0 +1,15 @@ +var get = require('./get'); + + var UNDEF; + + /** + * Check if object has nested property. + */ + function has(obj, prop){ + return get(obj, prop) !== UNDEF; + } + + module.exports = has; + + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/object/hasOwn.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/object/hasOwn.js new file mode 100644 index 0000000..7e3c82a --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/object/hasOwn.js @@ -0,0 +1,12 @@ + + + /** + * Safer Object.hasOwnProperty + */ + function hasOwn(obj, prop){ + return Object.prototype.hasOwnProperty.call(obj, prop); + } + + module.exports = hasOwn; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/object/keys.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/object/keys.js new file mode 100644 index 0000000..dd2f4f5 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/object/keys.js @@ -0,0 +1,16 @@ +var forOwn = require('./forOwn'); + + /** + * Get object keys + */ + var keys = Object.keys || function (obj) { + var keys = []; + forOwn(obj, function(val, key){ + keys.push(key); + }); + return keys; + }; + + module.exports = keys; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/object/map.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/object/map.js new file mode 100644 index 0000000..dd449a7 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/object/map.js @@ -0,0 +1,18 @@ +var forOwn = require('./forOwn'); +var makeIterator = require('../function/makeIterator_'); + + /** + * Creates a new object where all the values are the result of calling + * `callback`. + */ + function mapValues(obj, callback, thisObj) { + callback = makeIterator(callback, thisObj); + var output = {}; + forOwn(obj, function(val, key, obj) { + output[key] = callback(val, key, obj); + }); + + return output; + } + module.exports = mapValues; + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/object/matches.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/object/matches.js new file mode 100644 index 0000000..6074faa --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/object/matches.js @@ -0,0 +1,20 @@ +var forOwn = require('./forOwn'); + + /** + * checks if a object contains all given properties/values + */ + function matches(target, props){ + // can't use "object/every" because of circular dependency + var result = true; + forOwn(props, function(val, key){ + if (target[key] !== val) { + // break loop at first difference + return (result = false); + } + }); + return result; + } + + module.exports = matches; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/object/max.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/object/max.js new file mode 100644 index 0000000..3e8e92c --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/object/max.js @@ -0,0 +1,12 @@ +var arrMax = require('../array/max'); +var values = require('./values'); + + /** + * Returns maximum value inside object. + */ + function max(obj, compareFn) { + return arrMax(values(obj), compareFn); + } + + module.exports = max; + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/object/merge.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/object/merge.js new file mode 100644 index 0000000..6961f60 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/object/merge.js @@ -0,0 +1,40 @@ +var hasOwn = require('./hasOwn'); +var deepClone = require('../lang/deepClone'); +var isObject = require('../lang/isObject'); + + /** + * Deep merge objects. + */ + function merge() { + var i = 1, + key, val, obj, target; + + // make sure we don't modify source element and it's properties + // objects are passed by reference + target = deepClone( arguments[0] ); + + while (obj = arguments[i++]) { + for (key in obj) { + if ( ! hasOwn(obj, key) ) { + continue; + } + + val = obj[key]; + + if ( isObject(val) && isObject(target[key]) ){ + // inception, deep merge objects + target[key] = merge(target[key], val); + } else { + // make sure arrays, regexp, date, objects are cloned + target[key] = deepClone(val); + } + + } + } + + return target; + } + + module.exports = merge; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/object/min.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/object/min.js new file mode 100644 index 0000000..e1e6697 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/object/min.js @@ -0,0 +1,12 @@ +var arrMin = require('../array/min'); +var values = require('./values'); + + /** + * Returns minimum value inside object. + */ + function min(obj, iterator) { + return arrMin(values(obj), iterator); + } + + module.exports = min; + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/object/mixIn.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/object/mixIn.js new file mode 100644 index 0000000..55ec8fd --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/object/mixIn.js @@ -0,0 +1,28 @@ +var forOwn = require('./forOwn'); + + /** + * Combine properties from all the objects into first one. + * - This method affects target object in place, if you want to create a new Object pass an empty object as first param. + * @param {object} target Target Object + * @param {...object} objects Objects to be combined (0...n objects). + * @return {object} Target Object. + */ + function mixIn(target, objects){ + var i = 0, + n = arguments.length, + obj; + while(++i < n){ + obj = arguments[i]; + if (obj != null) { + forOwn(obj, copyProp, target); + } + } + return target; + } + + function copyProp(val, key){ + this[key] = val; + } + + module.exports = mixIn; + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/object/namespace.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/object/namespace.js new file mode 100644 index 0000000..c6e79f6 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/object/namespace.js @@ -0,0 +1,19 @@ +var forEach = require('../array/forEach'); + + /** + * Create nested object if non-existent + */ + function namespace(obj, path){ + if (!path) return obj; + forEach(path.split('.'), function(key){ + if (!obj[key]) { + obj[key] = {}; + } + obj = obj[key]; + }); + return obj; + } + + module.exports = namespace; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/object/pick.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/object/pick.js new file mode 100644 index 0000000..da5a564 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/object/pick.js @@ -0,0 +1,18 @@ +var slice = require('../array/slice'); + + /** + * Return a copy of the object, filtered to only have values for the whitelisted keys. + */ + function pick(obj, var_keys){ + var keys = typeof arguments[1] !== 'string'? arguments[1] : slice(arguments, 1), + out = {}, + i = 0, key; + while (key = keys[i++]) { + out[key] = obj[key]; + } + return out; + } + + module.exports = pick; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/object/pluck.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/object/pluck.js new file mode 100644 index 0000000..e844df4 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/object/pluck.js @@ -0,0 +1,13 @@ +var map = require('./map'); +var prop = require('../function/prop'); + + /** + * Extract a list of property values. + */ + function pluck(obj, propName){ + return map(obj, prop(propName)); + } + + module.exports = pluck; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/object/reduce.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/object/reduce.js new file mode 100644 index 0000000..6f19a3a --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/object/reduce.js @@ -0,0 +1,29 @@ +var forOwn = require('./forOwn'); +var size = require('./size'); + + /** + * Object reduce + */ + function reduce(obj, callback, memo, thisObj) { + var initial = arguments.length > 2; + + if (!size(obj) && !initial) { + throw new Error('reduce of empty object with no initial value'); + } + + forOwn(obj, function(value, key, list) { + if (!initial) { + memo = value; + initial = true; + } + else { + memo = callback.call(thisObj, memo, value, key, list); + } + }); + + return memo; + } + + module.exports = reduce; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/object/reject.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/object/reject.js new file mode 100644 index 0000000..7464379 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/object/reject.js @@ -0,0 +1,16 @@ +var filter = require('./filter'); +var makeIterator = require('../function/makeIterator_'); + + /** + * Object reject + */ + function reject(obj, callback, thisObj) { + callback = makeIterator(callback, thisObj); + return filter(obj, function(value, index, obj) { + return !callback(value, index, obj); + }, thisObj); + } + + module.exports = reject; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/object/set.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/object/set.js new file mode 100644 index 0000000..9b3cdc4 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/object/set.js @@ -0,0 +1,17 @@ +var namespace = require('./namespace'); + + /** + * set "nested" object property + */ + function set(obj, prop, val){ + var parts = (/^(.+)\.(.+)$/).exec(prop); + if (parts){ + namespace(obj, parts[1])[parts[2]] = val; + } else { + obj[prop] = val; + } + } + + module.exports = set; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/object/size.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/object/size.js new file mode 100644 index 0000000..9788595 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/object/size.js @@ -0,0 +1,16 @@ +var forOwn = require('./forOwn'); + + /** + * Get object size + */ + function size(obj) { + var count = 0; + forOwn(obj, function(){ + count++; + }); + return count; + } + + module.exports = size; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/object/some.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/object/some.js new file mode 100644 index 0000000..384c6f3 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/object/some.js @@ -0,0 +1,21 @@ +var forOwn = require('./forOwn'); +var makeIterator = require('../function/makeIterator_'); + + /** + * Object some + */ + function some(obj, callback, thisObj) { + callback = makeIterator(callback, thisObj); + var result = false; + forOwn(obj, function(val, key) { + if (callback(val, key, obj)) { + result = true; + return false; // break + } + }); + return result; + } + + module.exports = some; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/object/unset.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/object/unset.js new file mode 100644 index 0000000..343bca0 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/object/unset.js @@ -0,0 +1,23 @@ +var has = require('./has'); + + /** + * Unset object property. + */ + function unset(obj, prop){ + if (has(obj, prop)) { + var parts = prop.split('.'), + last = parts.pop(); + while (prop = parts.shift()) { + obj = obj[prop]; + } + return (delete obj[last]); + + } else { + // if property doesn't exist treat as deleted + return true; + } + } + + module.exports = unset; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/object/values.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/object/values.js new file mode 100644 index 0000000..265a693 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/object/values.js @@ -0,0 +1,16 @@ +var forOwn = require('./forOwn'); + + /** + * Get object values + */ + function values(obj) { + var vals = []; + forOwn(obj, function(val, key){ + vals.push(val); + }); + return vals; + } + + module.exports = values; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/package.json b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/package.json new file mode 100644 index 0000000..f24d67c --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/package.json @@ -0,0 +1,157 @@ +{ + "name": "mout", + "description": "Modular Utilities", + "version": "0.9.1", + "homepage": "http://moutjs.com/", + "contributors": [ + { + "name": "Adam Nowotny" + }, + { + "name": "André Cruz", + "email": "amdfcruz@gmail.com" + }, + { + "name": "Conrad Zimmerman", + "url": "http://www.conradz.com" + }, + { + "name": "Friedemann Altrock", + "email": "frodenius@gmail.com" + }, + { + "name": "Igor Almeida", + "email": "igor.p.almeida@gmail.com" + }, + { + "name": "Jarrod Overson", + "url": "http://jarrodoverson.com" + }, + { + "name": "Miller Medeiros", + "email": "contact@millermedeiros.com", + "url": "http://blog.millermedeiros.com" + }, + { + "name": "Mathias Paumgarten", + "email": "mail@mathias-paumgarten.com" + }, + { + "name": "Zach Shipley" + } + ], + "keywords": [ + "utilities", + "functional", + "amd-utils", + "stdlib" + ], + "repository": { + "type": "git", + "url": "git://github.com/mout/mout.git" + }, + "licenses": [ + { + "type": "MIT", + "url": "http://www.opensource.org/licenses/mit-license.php" + } + ], + "bugs": { + "url": "https://github.com/mout/mout/issues/" + }, + "main": "./index.js", + "scripts": { + "pretest": "node build pkg", + "test": "istanbul test tests/runner.js --hook-run-in-context" + }, + "directories": { + "doc": "./doc" + }, + "devDependencies": { + "istanbul": "~0.1.27", + "jasmine-node": "~1.2.2", + "requirejs": "2.x", + "nodefy": "*", + "mdoc": "~0.3.2", + "handlebars": "~1.0.6", + "commander": "~1.0.5", + "rocambole": "~0.2.3", + "jshint": "2.x", + "rimraf": "~2.2.2", + "regenerate": "~0.5.4" + }, + "testling": { + "preprocess": "node build testling", + "browsers": { + "ie": [ + 7, + 8, + 9, + 10 + ], + "firefox": [ + 17, + "nightly" + ], + "chrome": [ + 23, + "canary" + ], + "opera": [ + 12, + "next" + ], + "safari": [ + 5.1, + 6 + ], + "iphone": [ + 6 + ], + "ipad": [ + 6 + ] + }, + "scripts": [ + "tests/lib/jasmine/jasmine.js", + "tests/lib/jasmine/jasmine.async.js", + "tests/lib/jasmine/jasmine-tap.js", + "tests/lib/requirejs/require.js", + "tests/testling/src.js", + "tests/testling/specs.js", + "tests/runner.js" + ] + }, + "_id": "mout@0.9.1", + "dist": { + "shasum": "84f0f3fd6acc7317f63de2affdcc0cee009b0477", + "tarball": "http://registry.npmjs.org/mout/-/mout-0.9.1.tgz" + }, + "_from": "mout@~0.9.0", + "_npmVersion": "1.4.3", + "_npmUser": { + "name": "millermedeiros", + "email": "miller@millermedeiros.com" + }, + "maintainers": [ + { + "name": "millermedeiros", + "email": "miller@millermedeiros.com" + }, + { + "name": "satazor", + "email": "andremiguelcruz@msn.com" + }, + { + "name": "conradz", + "email": "me@conradz.com" + }, + { + "name": "mathias.paumgarten", + "email": "mail@mathias-paumgarten.com" + } + ], + "_shasum": "84f0f3fd6acc7317f63de2affdcc0cee009b0477", + "_resolved": "https://registry.npmjs.org/mout/-/mout-0.9.1.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/queryString.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/queryString.js new file mode 100644 index 0000000..22685a7 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/queryString.js @@ -0,0 +1,15 @@ + + +//automatically generated, do not edit! +//run `node build` instead +module.exports = { + 'contains' : require('./queryString/contains'), + 'decode' : require('./queryString/decode'), + 'encode' : require('./queryString/encode'), + 'getParam' : require('./queryString/getParam'), + 'getQuery' : require('./queryString/getQuery'), + 'parse' : require('./queryString/parse'), + 'setParam' : require('./queryString/setParam') +}; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/queryString/contains.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/queryString/contains.js new file mode 100644 index 0000000..da678cf --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/queryString/contains.js @@ -0,0 +1,12 @@ +var getQuery = require('./getQuery'); + + /** + * Checks if query string contains parameter. + */ + function contains(url, paramName) { + var regex = new RegExp('(\\?|&)'+ paramName +'=', 'g'); //matches `?param=` or `¶m=` + return regex.test(getQuery(url)); + } + + module.exports = contains; + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/queryString/decode.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/queryString/decode.js new file mode 100644 index 0000000..1c15785 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/queryString/decode.js @@ -0,0 +1,38 @@ +var typecast = require('../string/typecast'); +var isString = require('../lang/isString'); +var isArray = require('../lang/isArray'); +var hasOwn = require('../object/hasOwn'); + + /** + * Decode query string into an object of keys => vals. + */ + function decode(queryStr, shouldTypecast) { + var queryArr = (queryStr || '').replace('?', '').split('&'), + count = -1, + length = queryArr.length, + obj = {}, + item, pValue, pName, toSet; + + while (++count < length) { + item = queryArr[count].split('='); + pName = item[0]; + if (!pName || !pName.length){ + continue; + } + pValue = shouldTypecast === false ? item[1] : typecast(item[1]); + toSet = isString(pValue) ? decodeURIComponent(pValue) : pValue; + if (hasOwn(obj,pName)){ + if(isArray(obj[pName])){ + obj[pName].push(toSet); + } else { + obj[pName] = [obj[pName],toSet]; + } + } else { + obj[pName] = toSet; + } + } + return obj; + } + + module.exports = decode; + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/queryString/encode.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/queryString/encode.js new file mode 100644 index 0000000..3a4fd0a --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/queryString/encode.js @@ -0,0 +1,27 @@ +var forOwn = require('../object/forOwn'); +var isArray = require('../lang/isArray'); +var forEach = require('../array/forEach'); + + /** + * Encode object into a query string. + */ + function encode(obj){ + var query = [], + arrValues, reg; + forOwn(obj, function (val, key) { + if (isArray(val)) { + arrValues = key + '='; + reg = new RegExp('&'+key+'+=$'); + forEach(val, function (aValue) { + arrValues += encodeURIComponent(aValue) + '&' + key + '='; + }); + query.push(arrValues.replace(reg, '')); + } else { + query.push(key + '=' + encodeURIComponent(val)); + } + }); + return (query.length) ? '?' + query.join('&') : ''; + } + + module.exports = encode; + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/queryString/getParam.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/queryString/getParam.js new file mode 100644 index 0000000..f149c3e --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/queryString/getParam.js @@ -0,0 +1,15 @@ +var typecast = require('../string/typecast'); +var getQuery = require('./getQuery'); + + /** + * Get query parameter value. + */ + function getParam(url, param, shouldTypecast){ + var regexp = new RegExp('(\\?|&)'+ param + '=([^&]*)'), //matches `?param=value` or `¶m=value`, value = $2 + result = regexp.exec( getQuery(url) ), + val = (result && result[2])? result[2] : null; + return shouldTypecast === false? val : typecast(val); + } + + module.exports = getParam; + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/queryString/getQuery.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/queryString/getQuery.js new file mode 100644 index 0000000..5194af2 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/queryString/getQuery.js @@ -0,0 +1,13 @@ + + + /** + * Gets full query as string with all special chars decoded. + */ + function getQuery(url) { + url = url.replace(/#.*/, ''); //removes hash (to avoid getting hash query) + var queryString = /\?[a-zA-Z0-9\=\&\%\$\-\_\.\+\!\*\'\(\)\,]+/.exec(url); //valid chars according to: http://www.ietf.org/rfc/rfc1738.txt + return (queryString)? decodeURIComponent(queryString[0]) : ''; + } + + module.exports = getQuery; + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/queryString/parse.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/queryString/parse.js new file mode 100644 index 0000000..532906c --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/queryString/parse.js @@ -0,0 +1,13 @@ +var decode = require('./decode'); +var getQuery = require('./getQuery'); + + /** + * Get query string, parses and decodes it. + */ + function parse(url, shouldTypecast) { + return decode(getQuery(url), shouldTypecast); + } + + module.exports = parse; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/queryString/setParam.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/queryString/setParam.js new file mode 100644 index 0000000..052a9ba --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/queryString/setParam.js @@ -0,0 +1,28 @@ + + + /** + * Set query string parameter value + */ + function setParam(url, paramName, value){ + url = url || ''; + + var re = new RegExp('(\\?|&)'+ paramName +'=[^&]*' ); + var param = paramName +'='+ encodeURIComponent( value ); + + if ( re.test(url) ) { + return url.replace(re, '$1'+ param); + } else { + if (url.indexOf('?') === -1) { + url += '?'; + } + if (url.indexOf('=') !== -1) { + url += '&'; + } + return url + param; + } + + } + + module.exports = setParam; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/random.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/random.js new file mode 100644 index 0000000..19d6dae --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/random.js @@ -0,0 +1,17 @@ + + +//automatically generated, do not edit! +//run `node build` instead +module.exports = { + 'choice' : require('./random/choice'), + 'guid' : require('./random/guid'), + 'rand' : require('./random/rand'), + 'randBit' : require('./random/randBit'), + 'randBool' : require('./random/randBool'), + 'randHex' : require('./random/randHex'), + 'randInt' : require('./random/randInt'), + 'randSign' : require('./random/randSign'), + 'random' : require('./random/random') +}; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/random/choice.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/random/choice.js new file mode 100644 index 0000000..51aa82a --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/random/choice.js @@ -0,0 +1,15 @@ +var randInt = require('./randInt'); +var isArray = require('../lang/isArray'); + + /** + * Returns a random element from the supplied arguments + * or from the array (if single argument is an array). + */ + function choice(items) { + var target = (arguments.length === 1 && isArray(items))? items : arguments; + return target[ randInt(0, target.length - 1) ]; + } + + module.exports = choice; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/random/guid.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/random/guid.js new file mode 100644 index 0000000..41f6edd --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/random/guid.js @@ -0,0 +1,24 @@ +var randHex = require('./randHex'); +var choice = require('./choice'); + + /** + * Returns pseudo-random guid (UUID v4) + * IMPORTANT: it's not totally "safe" since randHex/choice uses Math.random + * by default and sequences can be predicted in some cases. See the + * "random/random" documentation for more info about it and how to replace + * the default PRNG. + */ + function guid() { + return ( + randHex(8)+'-'+ + randHex(4)+'-'+ + // v4 UUID always contain "4" at this position to specify it was + // randomly generated + '4' + randHex(3) +'-'+ + // v4 UUID always contain chars [a,b,8,9] at this position + choice(8, 9, 'a', 'b') + randHex(3)+'-'+ + randHex(12) + ); + } + module.exports = guid; + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/random/rand.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/random/rand.js new file mode 100644 index 0000000..782dec8 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/random/rand.js @@ -0,0 +1,15 @@ +var random = require('./random'); +var MIN_INT = require('../number/MIN_INT'); +var MAX_INT = require('../number/MAX_INT'); + + /** + * Returns random number inside range + */ + function rand(min, max){ + min = min == null? MIN_INT : min; + max = max == null? MAX_INT : max; + return min + (max - min) * random(); + } + + module.exports = rand; + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/random/randBit.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/random/randBit.js new file mode 100644 index 0000000..04f7aa5 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/random/randBit.js @@ -0,0 +1,11 @@ +var randBool = require('./randBool'); + + /** + * Returns random bit (0 or 1) + */ + function randomBit() { + return randBool()? 1 : 0; + } + + module.exports = randomBit; + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/random/randBool.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/random/randBool.js new file mode 100644 index 0000000..d3d35cb --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/random/randBool.js @@ -0,0 +1,12 @@ +var random = require('./random'); + + /** + * returns a random boolean value (true or false) + */ + function randBool(){ + return random() >= 0.5; + } + + module.exports = randBool; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/random/randHex.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/random/randHex.js new file mode 100644 index 0000000..d8d711c --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/random/randHex.js @@ -0,0 +1,19 @@ +var choice = require('./choice'); + + var _chars = '0123456789abcdef'.split(''); + + /** + * Returns a random hexadecimal string + */ + function randHex(size){ + size = size && size > 0? size : 6; + var str = ''; + while (size--) { + str += choice(_chars); + } + return str; + } + + module.exports = randHex; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/random/randInt.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/random/randInt.js new file mode 100644 index 0000000..e237d96 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/random/randInt.js @@ -0,0 +1,18 @@ +var MIN_INT = require('../number/MIN_INT'); +var MAX_INT = require('../number/MAX_INT'); +var rand = require('./rand'); + + /** + * Gets random integer inside range or snap to min/max values. + */ + function randInt(min, max){ + min = min == null? MIN_INT : ~~min; + max = max == null? MAX_INT : ~~max; + // can't be max + 0.5 otherwise it will round up if `rand` + // returns `max` causing it to overflow range. + // -0.5 and + 0.49 are required to avoid bias caused by rounding + return Math.round( rand(min - 0.5, max + 0.499999999999) ); + } + + module.exports = randInt; + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/random/randSign.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/random/randSign.js new file mode 100644 index 0000000..75a1a51 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/random/randSign.js @@ -0,0 +1,11 @@ +var randBool = require('./randBool'); + + /** + * Returns random sign (-1 or 1) + */ + function randomSign() { + return randBool()? 1 : -1; + } + + module.exports = randomSign; + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/random/random.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/random/random.js new file mode 100644 index 0000000..670a3cc --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/random/random.js @@ -0,0 +1,18 @@ + + + /** + * Just a wrapper to Math.random. No methods inside mout/random should call + * Math.random() directly so we can inject the pseudo-random number + * generator if needed (ie. in case we need a seeded random or a better + * algorithm than the native one) + */ + function random(){ + return random.get(); + } + + // we expose the method so it can be swapped if needed + random.get = Math.random; + + module.exports = random; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/string.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/string.js new file mode 100644 index 0000000..6115811 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/string.js @@ -0,0 +1,46 @@ + + +//automatically generated, do not edit! +//run `node build` instead +module.exports = { + 'WHITE_SPACES' : require('./string/WHITE_SPACES'), + 'camelCase' : require('./string/camelCase'), + 'contains' : require('./string/contains'), + 'crop' : require('./string/crop'), + 'endsWith' : require('./string/endsWith'), + 'escapeHtml' : require('./string/escapeHtml'), + 'escapeRegExp' : require('./string/escapeRegExp'), + 'escapeUnicode' : require('./string/escapeUnicode'), + 'hyphenate' : require('./string/hyphenate'), + 'insert' : require('./string/insert'), + 'interpolate' : require('./string/interpolate'), + 'lowerCase' : require('./string/lowerCase'), + 'lpad' : require('./string/lpad'), + 'ltrim' : require('./string/ltrim'), + 'makePath' : require('./string/makePath'), + 'normalizeLineBreaks' : require('./string/normalizeLineBreaks'), + 'pascalCase' : require('./string/pascalCase'), + 'properCase' : require('./string/properCase'), + 'removeNonASCII' : require('./string/removeNonASCII'), + 'removeNonWord' : require('./string/removeNonWord'), + 'repeat' : require('./string/repeat'), + 'replace' : require('./string/replace'), + 'replaceAccents' : require('./string/replaceAccents'), + 'rpad' : require('./string/rpad'), + 'rtrim' : require('./string/rtrim'), + 'sentenceCase' : require('./string/sentenceCase'), + 'slugify' : require('./string/slugify'), + 'startsWith' : require('./string/startsWith'), + 'stripHtmlTags' : require('./string/stripHtmlTags'), + 'trim' : require('./string/trim'), + 'truncate' : require('./string/truncate'), + 'typecast' : require('./string/typecast'), + 'unCamelCase' : require('./string/unCamelCase'), + 'underscore' : require('./string/underscore'), + 'unescapeHtml' : require('./string/unescapeHtml'), + 'unescapeUnicode' : require('./string/unescapeUnicode'), + 'unhyphenate' : require('./string/unhyphenate'), + 'upperCase' : require('./string/upperCase') +}; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/string/WHITE_SPACES.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/string/WHITE_SPACES.js new file mode 100644 index 0000000..03e0125 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/string/WHITE_SPACES.js @@ -0,0 +1,12 @@ + + /** + * Contains all Unicode white-spaces. Taken from + * http://en.wikipedia.org/wiki/Whitespace_character. + */ + module.exports = [ + ' ', '\n', '\r', '\t', '\f', '\v', '\u00A0', '\u1680', '\u180E', + '\u2000', '\u2001', '\u2002', '\u2003', '\u2004', '\u2005', '\u2006', + '\u2007', '\u2008', '\u2009', '\u200A', '\u2028', '\u2029', '\u202F', + '\u205F', '\u3000' + ]; + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/string/camelCase.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/string/camelCase.js new file mode 100644 index 0000000..aadb69a --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/string/camelCase.js @@ -0,0 +1,20 @@ +var toString = require('../lang/toString'); +var replaceAccents = require('./replaceAccents'); +var removeNonWord = require('./removeNonWord'); +var upperCase = require('./upperCase'); +var lowerCase = require('./lowerCase'); + /** + * Convert string to camelCase text. + */ + function camelCase(str){ + str = toString(str); + str = replaceAccents(str); + str = removeNonWord(str) + .replace(/[\-_]/g, ' ') //convert all hyphens and underscores to spaces + .replace(/\s[a-z]/g, upperCase) //convert first char of each word to UPPERCASE + .replace(/\s+/g, '') //remove spaces + .replace(/^[A-Z]/g, lowerCase); //convert first char to lowercase + return str; + } + module.exports = camelCase; + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/string/contains.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/string/contains.js new file mode 100644 index 0000000..cb22cae --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/string/contains.js @@ -0,0 +1,14 @@ +var toString = require('../lang/toString'); + + /** + * Searches for a given substring + */ + function contains(str, substring, fromIndex){ + str = toString(str); + substring = toString(substring); + return str.indexOf(substring, fromIndex) !== -1; + } + + module.exports = contains; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/string/crop.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/string/crop.js new file mode 100644 index 0000000..53b93b4 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/string/crop.js @@ -0,0 +1,12 @@ +var toString = require('../lang/toString'); +var truncate = require('./truncate'); + /** + * Truncate string at full words. + */ + function crop(str, maxChars, append) { + str = toString(str); + return truncate(str, maxChars, append, true); + } + + module.exports = crop; + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/string/endsWith.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/string/endsWith.js new file mode 100644 index 0000000..d504e9d --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/string/endsWith.js @@ -0,0 +1,13 @@ +var toString = require('../lang/toString'); + /** + * Checks if string ends with specified suffix. + */ + function endsWith(str, suffix) { + str = toString(str); + suffix = toString(suffix); + + return str.indexOf(suffix, str.length - suffix.length) !== -1; + } + + module.exports = endsWith; + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/string/escapeHtml.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/string/escapeHtml.js new file mode 100644 index 0000000..e67c4b2 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/string/escapeHtml.js @@ -0,0 +1,18 @@ +var toString = require('../lang/toString'); + + /** + * Escapes a string for insertion into HTML. + */ + function escapeHtml(str){ + str = toString(str) + .replace(/&/g, '&') + .replace(//g, '>') + .replace(/'/g, ''') + .replace(/"/g, '"'); + return str; + } + + module.exports = escapeHtml; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/string/escapeRegExp.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/string/escapeRegExp.js new file mode 100644 index 0000000..02d743c --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/string/escapeRegExp.js @@ -0,0 +1,12 @@ +var toString = require('../lang/toString'); + + /** + * Escape RegExp string chars. + */ + function escapeRegExp(str) { + return toString(str).replace(/\W/g,'\\$&'); + } + + module.exports = escapeRegExp; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/string/escapeUnicode.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/string/escapeUnicode.js new file mode 100644 index 0000000..ec649ad --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/string/escapeUnicode.js @@ -0,0 +1,21 @@ +var toString = require('../lang/toString'); + + /** + * Escape string into unicode sequences + */ + function escapeUnicode(str, shouldEscapePrintable){ + str = toString(str); + return str.replace(/[\s\S]/g, function(ch){ + // skip printable ASCII chars if we should not escape them + if (!shouldEscapePrintable && (/[\x20-\x7E]/).test(ch)) { + return ch; + } + // we use "000" and slice(-4) for brevity, need to pad zeros, + // unicode escape always have 4 chars after "\u" + return '\\u'+ ('000'+ ch.charCodeAt(0).toString(16)).slice(-4); + }); + } + + module.exports = escapeUnicode; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/string/hyphenate.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/string/hyphenate.js new file mode 100644 index 0000000..95e3243 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/string/hyphenate.js @@ -0,0 +1,14 @@ +var toString = require('../lang/toString'); +var slugify = require('./slugify'); +var unCamelCase = require('./unCamelCase'); + /** + * Replaces spaces with hyphens, split camelCase text, remove non-word chars, remove accents and convert to lower case. + */ + function hyphenate(str){ + str = toString(str); + str = unCamelCase(str); + return slugify(str, "-"); + } + + module.exports = hyphenate; + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/string/insert.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/string/insert.js new file mode 100644 index 0000000..8f042c6 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/string/insert.js @@ -0,0 +1,21 @@ +var clamp = require('../math/clamp'); +var toString = require('../lang/toString'); + + /** + * Inserts a string at a given index. + */ + function insert(string, index, partial){ + string = toString(string); + + if (index < 0) { + index = string.length + index; + } + + index = clamp(index, 0, string.length); + + return string.substr(0, index) + partial + string.substr(index); + } + + module.exports = insert; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/string/interpolate.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/string/interpolate.js new file mode 100644 index 0000000..efbbf7d --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/string/interpolate.js @@ -0,0 +1,19 @@ +var toString = require('../lang/toString'); +var get = require('../object/get'); + + var stache = /\{\{([^\}]+)\}\}/g; //mustache-like + + /** + * String interpolation + */ + function interpolate(template, replacements, syntax){ + template = toString(template); + var replaceFn = function(match, prop){ + return toString( get(replacements, prop) ); + }; + return template.replace(syntax || stache, replaceFn); + } + + module.exports = interpolate; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/string/lowerCase.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/string/lowerCase.js new file mode 100644 index 0000000..30bb7ad --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/string/lowerCase.js @@ -0,0 +1,11 @@ +var toString = require('../lang/toString'); + /** + * "Safer" String.toLowerCase() + */ + function lowerCase(str){ + str = toString(str); + return str.toLowerCase(); + } + + module.exports = lowerCase; + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/string/lpad.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/string/lpad.js new file mode 100644 index 0000000..63641d3 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/string/lpad.js @@ -0,0 +1,17 @@ +var toString = require('../lang/toString'); +var repeat = require('./repeat'); + + /** + * Pad string with `char` if its' length is smaller than `minLen` + */ + function lpad(str, minLen, ch) { + str = toString(str); + ch = ch || ' '; + + return (str.length < minLen) ? + repeat(ch, minLen - str.length) + str : str; + } + + module.exports = lpad; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/string/ltrim.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/string/ltrim.js new file mode 100644 index 0000000..23d7b33 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/string/ltrim.js @@ -0,0 +1,34 @@ +var toString = require('../lang/toString'); +var WHITE_SPACES = require('./WHITE_SPACES'); + /** + * Remove chars from beginning of string. + */ + function ltrim(str, chars) { + str = toString(str); + chars = chars || WHITE_SPACES; + + var start = 0, + len = str.length, + charLen = chars.length, + found = true, + i, c; + + while (found && start < len) { + found = false; + i = -1; + c = str.charAt(start); + + while (++i < charLen) { + if (c === chars[i]) { + found = true; + start++; + break; + } + } + } + + return (start >= len) ? '' : str.substr(start, len); + } + + module.exports = ltrim; + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/string/makePath.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/string/makePath.js new file mode 100644 index 0000000..c337cec --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/string/makePath.js @@ -0,0 +1,15 @@ +var join = require('../array/join'); +var slice = require('../array/slice'); + + /** + * Group arguments as path segments, if any of the args is `null` or an + * empty string it will be ignored from resulting path. + */ + function makePath(var_args){ + var result = join(slice(arguments), '/'); + // need to disconsider duplicate '/' after protocol (eg: 'http://') + return result.replace(/([^:\/]|^)\/{2,}/g, '$1/'); + } + + module.exports = makePath; + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/string/normalizeLineBreaks.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/string/normalizeLineBreaks.js new file mode 100644 index 0000000..8a8dccf --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/string/normalizeLineBreaks.js @@ -0,0 +1,18 @@ +var toString = require('../lang/toString'); + + /** + * Convert line-breaks from DOS/MAC to a single standard (UNIX by default) + */ + function normalizeLineBreaks(str, lineEnd) { + str = toString(str); + lineEnd = lineEnd || '\n'; + + return str + .replace(/\r\n/g, lineEnd) // DOS + .replace(/\r/g, lineEnd) // Mac + .replace(/\n/g, lineEnd); // Unix + } + + module.exports = normalizeLineBreaks; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/string/pascalCase.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/string/pascalCase.js new file mode 100644 index 0000000..fd19035 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/string/pascalCase.js @@ -0,0 +1,13 @@ +var toString = require('../lang/toString'); +var camelCase = require('./camelCase'); +var upperCase = require('./upperCase'); + /** + * camelCase + UPPERCASE first char + */ + function pascalCase(str){ + str = toString(str); + return camelCase(str).replace(/^[a-z]/, upperCase); + } + + module.exports = pascalCase; + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/string/properCase.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/string/properCase.js new file mode 100644 index 0000000..61636be --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/string/properCase.js @@ -0,0 +1,13 @@ +var toString = require('../lang/toString'); +var lowerCase = require('./lowerCase'); +var upperCase = require('./upperCase'); + /** + * UPPERCASE first char of each word. + */ + function properCase(str){ + str = toString(str); + return lowerCase(str).replace(/^\w|\s\w/g, upperCase); + } + + module.exports = properCase; + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/string/removeNonASCII.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/string/removeNonASCII.js new file mode 100644 index 0000000..fb46381 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/string/removeNonASCII.js @@ -0,0 +1,14 @@ +var toString = require('../lang/toString'); + /** + * Remove non-printable ASCII chars + */ + function removeNonASCII(str){ + str = toString(str); + + // Matches non-printable ASCII chars - + // http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters + return str.replace(/[^\x20-\x7E]/g, ''); + } + + module.exports = removeNonASCII; + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/string/removeNonWord.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/string/removeNonWord.js new file mode 100644 index 0000000..ffb05a9 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/string/removeNonWord.js @@ -0,0 +1,14 @@ +var toString = require('../lang/toString'); + // This pattern is generated by the _build/pattern-removeNonWord.js script + var PATTERN = /[^\x20\x2D0-9A-Z\x5Fa-z\xC0-\xD6\xD8-\xF6\xF8-\xFF]/g; + + /** + * Remove non-word chars. + */ + function removeNonWord(str){ + str = toString(str); + return str.replace(PATTERN, ''); + } + + module.exports = removeNonWord; + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/string/repeat.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/string/repeat.js new file mode 100644 index 0000000..df0dc1e --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/string/repeat.js @@ -0,0 +1,26 @@ +var toString = require('../lang/toString'); +var toInt = require('../number/toInt'); + + /** + * Repeat string n times + */ + function repeat(str, n){ + var result = ''; + str = toString(str); + n = toInt(n); + if (n < 1) { + return ''; + } + while (n > 0) { + if (n % 2) { + result += str; + } + n = Math.floor(n / 2); + str += str; + } + return result; + } + + module.exports = repeat; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/string/replace.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/string/replace.js new file mode 100644 index 0000000..14433fc --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/string/replace.js @@ -0,0 +1,33 @@ +var toString = require('../lang/toString'); +var toArray = require('../lang/toArray'); + + /** + * Replace string(s) with the replacement(s) in the source. + */ + function replace(str, search, replacements) { + str = toString(str); + search = toArray(search); + replacements = toArray(replacements); + + var searchLength = search.length, + replacementsLength = replacements.length; + + if (replacementsLength !== 1 && searchLength !== replacementsLength) { + throw new Error('Unequal number of searches and replacements'); + } + + var i = -1; + while (++i < searchLength) { + // Use the first replacement for all searches if only one + // replacement is provided + str = str.replace( + search[i], + replacements[(replacementsLength === 1) ? 0 : i]); + } + + return str; + } + + module.exports = replace; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/string/replaceAccents.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/string/replaceAccents.js new file mode 100644 index 0000000..bb22126 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/string/replaceAccents.js @@ -0,0 +1,36 @@ +var toString = require('../lang/toString'); + /** + * Replaces all accented chars with regular ones + */ + function replaceAccents(str){ + str = toString(str); + + // verifies if the String has accents and replace them + if (str.search(/[\xC0-\xFF]/g) > -1) { + str = str + .replace(/[\xC0-\xC5]/g, "A") + .replace(/[\xC6]/g, "AE") + .replace(/[\xC7]/g, "C") + .replace(/[\xC8-\xCB]/g, "E") + .replace(/[\xCC-\xCF]/g, "I") + .replace(/[\xD0]/g, "D") + .replace(/[\xD1]/g, "N") + .replace(/[\xD2-\xD6\xD8]/g, "O") + .replace(/[\xD9-\xDC]/g, "U") + .replace(/[\xDD]/g, "Y") + .replace(/[\xDE]/g, "P") + .replace(/[\xE0-\xE5]/g, "a") + .replace(/[\xE6]/g, "ae") + .replace(/[\xE7]/g, "c") + .replace(/[\xE8-\xEB]/g, "e") + .replace(/[\xEC-\xEF]/g, "i") + .replace(/[\xF1]/g, "n") + .replace(/[\xF2-\xF6\xF8]/g, "o") + .replace(/[\xF9-\xFC]/g, "u") + .replace(/[\xFE]/g, "p") + .replace(/[\xFD\xFF]/g, "y"); + } + return str; + } + module.exports = replaceAccents; + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/string/rpad.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/string/rpad.js new file mode 100644 index 0000000..99f6378 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/string/rpad.js @@ -0,0 +1,15 @@ +var toString = require('../lang/toString'); +var repeat = require('./repeat'); + + /** + * Pad string with `char` if its' length is smaller than `minLen` + */ + function rpad(str, minLen, ch) { + str = toString(str); + ch = ch || ' '; + return (str.length < minLen)? str + repeat(ch, minLen - str.length) : str; + } + + module.exports = rpad; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/string/rtrim.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/string/rtrim.js new file mode 100644 index 0000000..66ba80e --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/string/rtrim.js @@ -0,0 +1,33 @@ +var toString = require('../lang/toString'); +var WHITE_SPACES = require('./WHITE_SPACES'); + /** + * Remove chars from end of string. + */ + function rtrim(str, chars) { + str = toString(str); + chars = chars || WHITE_SPACES; + + var end = str.length - 1, + charLen = chars.length, + found = true, + i, c; + + while (found && end >= 0) { + found = false; + i = -1; + c = str.charAt(end); + + while (++i < charLen) { + if (c === chars[i]) { + found = true; + end--; + break; + } + } + } + + return (end >= 0) ? str.substring(0, end + 1) : ''; + } + + module.exports = rtrim; + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/string/sentenceCase.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/string/sentenceCase.js new file mode 100644 index 0000000..354104c --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/string/sentenceCase.js @@ -0,0 +1,15 @@ +var toString = require('../lang/toString'); +var lowerCase = require('./lowerCase'); +var upperCase = require('./upperCase'); + /** + * UPPERCASE first char of each sentence and lowercase other chars. + */ + function sentenceCase(str){ + str = toString(str); + + // Replace first char of each sentence (new line or after '.\s+') to + // UPPERCASE + return lowerCase(str).replace(/(^\w)|\.\s+(\w)/gm, upperCase); + } + module.exports = sentenceCase; + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/string/slugify.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/string/slugify.js new file mode 100644 index 0000000..142f0d9 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/string/slugify.js @@ -0,0 +1,24 @@ +var toString = require('../lang/toString'); +var replaceAccents = require('./replaceAccents'); +var removeNonWord = require('./removeNonWord'); +var trim = require('./trim'); + /** + * Convert to lower case, remove accents, remove non-word chars and + * replace spaces with the specified delimeter. + * Does not split camelCase text. + */ + function slugify(str, delimeter){ + str = toString(str); + + if (delimeter == null) { + delimeter = "-"; + } + str = replaceAccents(str); + str = removeNonWord(str); + str = trim(str) //should come after removeNonWord + .replace(/ +/g, delimeter) //replace spaces with delimeter + .toLowerCase(); + return str; + } + module.exports = slugify; + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/string/startsWith.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/string/startsWith.js new file mode 100644 index 0000000..bce2bd2 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/string/startsWith.js @@ -0,0 +1,13 @@ +var toString = require('../lang/toString'); + /** + * Checks if string starts with specified prefix. + */ + function startsWith(str, prefix) { + str = toString(str); + prefix = toString(prefix); + + return str.indexOf(prefix) === 0; + } + + module.exports = startsWith; + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/string/stripHtmlTags.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/string/stripHtmlTags.js new file mode 100644 index 0000000..01d17b0 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/string/stripHtmlTags.js @@ -0,0 +1,11 @@ +var toString = require('../lang/toString'); + /** + * Remove HTML tags from string. + */ + function stripHtmlTags(str){ + str = toString(str); + + return str.replace(/<[^>]*>/g, ''); + } + module.exports = stripHtmlTags; + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/string/trim.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/string/trim.js new file mode 100644 index 0000000..9652b0c --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/string/trim.js @@ -0,0 +1,15 @@ +var toString = require('../lang/toString'); +var WHITE_SPACES = require('./WHITE_SPACES'); +var ltrim = require('./ltrim'); +var rtrim = require('./rtrim'); + /** + * Remove white-spaces from beginning and end of string. + */ + function trim(str, chars) { + str = toString(str); + chars = chars || WHITE_SPACES; + return ltrim(rtrim(str, chars), chars); + } + + module.exports = trim; + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/string/truncate.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/string/truncate.js new file mode 100644 index 0000000..a98d6c7 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/string/truncate.js @@ -0,0 +1,21 @@ +var toString = require('../lang/toString'); +var trim = require('./trim'); + /** + * Limit number of chars. + */ + function truncate(str, maxChars, append, onlyFullWords){ + str = toString(str); + append = append || '...'; + maxChars = onlyFullWords? maxChars + 1 : maxChars; + + str = trim(str); + if(str.length <= maxChars){ + return str; + } + str = str.substr(0, maxChars - append.length); + //crop at last space or remove trailing whitespace + str = onlyFullWords? str.substr(0, str.lastIndexOf(' ')) : trim(str); + return str + append; + } + module.exports = truncate; + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/string/typecast.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/string/typecast.js new file mode 100644 index 0000000..c1386a4 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/string/typecast.js @@ -0,0 +1,29 @@ + + + var UNDEF; + + /** + * Parses string and convert it into a native value. + */ + function typecast(val) { + var r; + if ( val === null || val === 'null' ) { + r = null; + } else if ( val === 'true' ) { + r = true; + } else if ( val === 'false' ) { + r = false; + } else if ( val === UNDEF || val === 'undefined' ) { + r = UNDEF; + } else if ( val === '' || isNaN(val) ) { + //isNaN('') returns false + r = val; + } else { + //parseFloat(null || '') returns NaN + r = parseFloat(val); + } + return r; + } + + module.exports = typecast; + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/string/unCamelCase.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/string/unCamelCase.js new file mode 100644 index 0000000..4968f37 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/string/unCamelCase.js @@ -0,0 +1,23 @@ +var toString = require('../lang/toString'); + + var CAMEL_CASE_BORDER = /([a-z\xE0-\xFF])([A-Z\xC0\xDF])/g; + + /** + * Add space between camelCase text. + */ + function unCamelCase(str, delimiter){ + if (delimiter == null) { + delimiter = ' '; + } + + function join(str, c1, c2) { + return c1 + delimiter + c2; + } + + str = toString(str); + str = str.replace(CAMEL_CASE_BORDER, join); + str = str.toLowerCase(); //add space between camelCase text + return str; + } + module.exports = unCamelCase; + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/string/underscore.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/string/underscore.js new file mode 100644 index 0000000..ebd6e2b --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/string/underscore.js @@ -0,0 +1,13 @@ +var toString = require('../lang/toString'); +var slugify = require('./slugify'); +var unCamelCase = require('./unCamelCase'); + /** + * Replaces spaces with underscores, split camelCase text, remove non-word chars, remove accents and convert to lower case. + */ + function underscore(str){ + str = toString(str); + str = unCamelCase(str); + return slugify(str, "_"); + } + module.exports = underscore; + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/string/unescapeHtml.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/string/unescapeHtml.js new file mode 100644 index 0000000..ad1987d --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/string/unescapeHtml.js @@ -0,0 +1,18 @@ +var toString = require('../lang/toString'); + + /** + * Unescapes HTML special chars + */ + function unescapeHtml(str){ + str = toString(str) + .replace(/&/g , '&') + .replace(/</g , '<') + .replace(/>/g , '>') + .replace(/�*39;/g , "'") + .replace(/"/g, '"'); + return str; + } + + module.exports = unescapeHtml; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/string/unescapeUnicode.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/string/unescapeUnicode.js new file mode 100644 index 0000000..0b7fb73 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/string/unescapeUnicode.js @@ -0,0 +1,16 @@ +var toString = require('../lang/toString'); + + /** + * Unescape unicode char sequences + */ + function unescapeUnicode(str){ + str = toString(str); + return str.replace(/\\u[0-9a-f]{4}/g, function(ch){ + var code = parseInt(ch.slice(2), 16); + return String.fromCharCode(code); + }); + } + + module.exports = unescapeUnicode; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/string/unhyphenate.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/string/unhyphenate.js new file mode 100644 index 0000000..311dfa1 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/string/unhyphenate.js @@ -0,0 +1,10 @@ +var toString = require('../lang/toString'); + /** + * Replaces hyphens with spaces. (only hyphens between word chars) + */ + function unhyphenate(str){ + str = toString(str); + return str.replace(/(\w)(-)(\w)/g, '$1 $3'); + } + module.exports = unhyphenate; + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/string/upperCase.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/string/upperCase.js new file mode 100644 index 0000000..6c92552 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/string/upperCase.js @@ -0,0 +1,10 @@ +var toString = require('../lang/toString'); + /** + * "Safer" String.toUpperCase() + */ + function upperCase(str){ + str = toString(str); + return str.toUpperCase(); + } + module.exports = upperCase; + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/time.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/time.js new file mode 100644 index 0000000..9f53329 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/time.js @@ -0,0 +1,12 @@ + + +//automatically generated, do not edit! +//run `node build` instead +module.exports = { + 'convert' : require('./time/convert'), + 'now' : require('./time/now'), + 'parseMs' : require('./time/parseMs'), + 'toTimeString' : require('./time/toTimeString') +}; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/time/convert.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/time/convert.js new file mode 100644 index 0000000..852a0f0 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/time/convert.js @@ -0,0 +1,41 @@ + + + /** + * convert time into another unit + */ + function convert(val, sourceUnitName, destinationUnitName){ + destinationUnitName = destinationUnitName || 'ms'; + return (val * getUnit(sourceUnitName)) / getUnit(destinationUnitName); + } + + + //TODO: maybe extract to a separate module + function getUnit(unitName){ + switch(unitName){ + case 'ms': + case 'millisecond': + return 1; + case 's': + case 'second': + return 1000; + case 'm': + case 'minute': + return 60000; + case 'h': + case 'hour': + return 3600000; + case 'd': + case 'day': + return 86400000; + case 'w': + case 'week': + return 604800000; + default: + throw new Error('"'+ unitName + '" is not a valid unit'); + } + } + + + module.exports = convert; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/time/now.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/time/now.js new file mode 100644 index 0000000..0cedb18 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/time/now.js @@ -0,0 +1,18 @@ + + + /** + * Get current time in miliseconds + */ + function now(){ + // yes, we defer the work to another function to allow mocking it + // during the tests + return now.get(); + } + + now.get = (typeof Date.now === 'function')? Date.now : function(){ + return +(new Date()); + }; + + module.exports = now; + + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/time/parseMs.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/time/parseMs.js new file mode 100644 index 0000000..6d99797 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/time/parseMs.js @@ -0,0 +1,17 @@ +var countSteps = require('../math/countSteps'); + + /** + * Parse timestamp into an object. + */ + function parseMs(ms){ + return { + milliseconds : countSteps(ms, 1, 1000), + seconds : countSteps(ms, 1000, 60), + minutes : countSteps(ms, 60000, 60), + hours : countSteps(ms, 3600000, 24), + days : countSteps(ms, 86400000) + }; + } + + module.exports = parseMs; + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/time/toTimeString.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/time/toTimeString.js new file mode 100644 index 0000000..101d69f --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/mout/time/toTimeString.js @@ -0,0 +1,24 @@ +var countSteps = require('../math/countSteps'); +var pad = require('../number/pad'); + + var HOUR = 3600000, + MINUTE = 60000, + SECOND = 1000; + + /** + * Format timestamp into a time string. + */ + function toTimeString(ms){ + var h = ms < HOUR ? 0 : countSteps(ms, HOUR), + m = ms < MINUTE ? 0 : countSteps(ms, MINUTE, 60), + s = ms < SECOND ? 0 : countSteps(ms, SECOND, 60), + str = ''; + + str += h? h + ':' : ''; + str += pad(m, 2) + ':'; + str += pad(s, 2); + + return str; + } + module.exports = toTimeString; + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/optimist/index.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/optimist/index.js new file mode 100644 index 0000000..4da5a6d --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/optimist/index.js @@ -0,0 +1,343 @@ +var path = require('path'); +var minimist = require('minimist'); +var wordwrap = require('wordwrap'); + +/* Hack an instance of Argv with process.argv into Argv + so people can do + require('optimist')(['--beeble=1','-z','zizzle']).argv + to parse a list of args and + require('optimist').argv + to get a parsed version of process.argv. +*/ + +var inst = Argv(process.argv.slice(2)); +Object.keys(inst).forEach(function (key) { + Argv[key] = typeof inst[key] == 'function' + ? inst[key].bind(inst) + : inst[key]; +}); + +var exports = module.exports = Argv; +function Argv (processArgs, cwd) { + var self = {}; + if (!cwd) cwd = process.cwd(); + + self.$0 = process.argv + .slice(0,2) + .map(function (x) { + var b = rebase(cwd, x); + return x.match(/^\//) && b.length < x.length + ? b : x + }) + .join(' ') + ; + + if (process.env._ != undefined && process.argv[1] == process.env._) { + self.$0 = process.env._.replace( + path.dirname(process.execPath) + '/', '' + ); + } + + var options = { + boolean: [], + string: [], + alias: {}, + default: [] + }; + + self.boolean = function (bools) { + options.boolean.push.apply(options.boolean, [].concat(bools)); + return self; + }; + + self.string = function (strings) { + options.string.push.apply(options.string, [].concat(strings)); + return self; + }; + + self.default = function (key, value) { + if (typeof key === 'object') { + Object.keys(key).forEach(function (k) { + self.default(k, key[k]); + }); + } + else { + options.default[key] = value; + } + return self; + }; + + self.alias = function (x, y) { + if (typeof x === 'object') { + Object.keys(x).forEach(function (key) { + self.alias(key, x[key]); + }); + } + else { + options.alias[x] = (options.alias[x] || []).concat(y); + } + return self; + }; + + var demanded = {}; + self.demand = function (keys) { + if (typeof keys == 'number') { + if (!demanded._) demanded._ = 0; + demanded._ += keys; + } + else if (Array.isArray(keys)) { + keys.forEach(function (key) { + self.demand(key); + }); + } + else { + demanded[keys] = true; + } + + return self; + }; + + var usage; + self.usage = function (msg, opts) { + if (!opts && typeof msg === 'object') { + opts = msg; + msg = null; + } + + usage = msg; + + if (opts) self.options(opts); + + return self; + }; + + function fail (msg) { + self.showHelp(); + if (msg) console.error(msg); + process.exit(1); + } + + var checks = []; + self.check = function (f) { + checks.push(f); + return self; + }; + + var descriptions = {}; + self.describe = function (key, desc) { + if (typeof key === 'object') { + Object.keys(key).forEach(function (k) { + self.describe(k, key[k]); + }); + } + else { + descriptions[key] = desc; + } + return self; + }; + + self.parse = function (args) { + return parseArgs(args); + }; + + self.option = self.options = function (key, opt) { + if (typeof key === 'object') { + Object.keys(key).forEach(function (k) { + self.options(k, key[k]); + }); + } + else { + if (opt.alias) self.alias(key, opt.alias); + if (opt.demand) self.demand(key); + if (typeof opt.default !== 'undefined') { + self.default(key, opt.default); + } + + if (opt.boolean || opt.type === 'boolean') { + self.boolean(key); + } + if (opt.string || opt.type === 'string') { + self.string(key); + } + + var desc = opt.describe || opt.description || opt.desc; + if (desc) { + self.describe(key, desc); + } + } + + return self; + }; + + var wrap = null; + self.wrap = function (cols) { + wrap = cols; + return self; + }; + + self.showHelp = function (fn) { + if (!fn) fn = console.error; + fn(self.help()); + }; + + self.help = function () { + var keys = Object.keys( + Object.keys(descriptions) + .concat(Object.keys(demanded)) + .concat(Object.keys(options.default)) + .reduce(function (acc, key) { + if (key !== '_') acc[key] = true; + return acc; + }, {}) + ); + + var help = keys.length ? [ 'Options:' ] : []; + + if (usage) { + help.unshift(usage.replace(/\$0/g, self.$0), ''); + } + + var switches = keys.reduce(function (acc, key) { + acc[key] = [ key ].concat(options.alias[key] || []) + .map(function (sw) { + return (sw.length > 1 ? '--' : '-') + sw + }) + .join(', ') + ; + return acc; + }, {}); + + var switchlen = longest(Object.keys(switches).map(function (s) { + return switches[s] || ''; + })); + + var desclen = longest(Object.keys(descriptions).map(function (d) { + return descriptions[d] || ''; + })); + + keys.forEach(function (key) { + var kswitch = switches[key]; + var desc = descriptions[key] || ''; + + if (wrap) { + desc = wordwrap(switchlen + 4, wrap)(desc) + .slice(switchlen + 4) + ; + } + + var spadding = new Array( + Math.max(switchlen - kswitch.length + 3, 0) + ).join(' '); + + var dpadding = new Array( + Math.max(desclen - desc.length + 1, 0) + ).join(' '); + + var type = null; + + if (options.boolean[key]) type = '[boolean]'; + if (options.string[key]) type = '[string]'; + + if (!wrap && dpadding.length > 0) { + desc += dpadding; + } + + var prelude = ' ' + kswitch + spadding; + var extra = [ + type, + demanded[key] + ? '[required]' + : null + , + options.default[key] !== undefined + ? '[default: ' + JSON.stringify(options.default[key]) + ']' + : null + , + ].filter(Boolean).join(' '); + + var body = [ desc, extra ].filter(Boolean).join(' '); + + if (wrap) { + var dlines = desc.split('\n'); + var dlen = dlines.slice(-1)[0].length + + (dlines.length === 1 ? prelude.length : 0) + + body = desc + (dlen + extra.length > wrap - 2 + ? '\n' + + new Array(wrap - extra.length + 1).join(' ') + + extra + : new Array(wrap - extra.length - dlen + 1).join(' ') + + extra + ); + } + + help.push(prelude + body); + }); + + help.push(''); + return help.join('\n'); + }; + + Object.defineProperty(self, 'argv', { + get : function () { return parseArgs(processArgs) }, + enumerable : true, + }); + + function parseArgs (args) { + var argv = minimist(args, options); + argv.$0 = self.$0; + + if (demanded._ && argv._.length < demanded._) { + fail('Not enough non-option arguments: got ' + + argv._.length + ', need at least ' + demanded._ + ); + } + + var missing = []; + Object.keys(demanded).forEach(function (key) { + if (!argv[key]) missing.push(key); + }); + + if (missing.length) { + fail('Missing required arguments: ' + missing.join(', ')); + } + + checks.forEach(function (f) { + try { + if (f(argv) === false) { + fail('Argument check failed: ' + f.toString()); + } + } + catch (err) { + fail(err) + } + }); + + return argv; + } + + function longest (xs) { + return Math.max.apply( + null, + xs.map(function (x) { return x.length }) + ); + } + + return self; +}; + +// rebase an absolute path to a relative one with respect to a base directory +// exported for tests +exports.rebase = rebase; +function rebase (base, dir) { + var ds = path.normalize(dir).split('/').slice(1); + var bs = path.normalize(base).split('/').slice(1); + + for (var i = 0; ds[i] && ds[i] == bs[i]; i++); + ds.splice(0, i); bs.splice(0, i); + + var p = path.normalize( + bs.map(function () { return '..' }).concat(ds).join('/') + ).replace(/\/$/,'').replace(/^$/, '.'); + return p.match(/^[.\/]/) ? p : './' + p; +}; diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/optimist/node_modules/minimist/index.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/optimist/node_modules/minimist/index.js new file mode 100644 index 0000000..71fb830 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/optimist/node_modules/minimist/index.js @@ -0,0 +1,187 @@ +module.exports = function (args, opts) { + if (!opts) opts = {}; + + var flags = { bools : {}, strings : {} }; + + [].concat(opts['boolean']).filter(Boolean).forEach(function (key) { + flags.bools[key] = true; + }); + + var aliases = {}; + Object.keys(opts.alias || {}).forEach(function (key) { + aliases[key] = [].concat(opts.alias[key]); + aliases[key].forEach(function (x) { + aliases[x] = [key].concat(aliases[key].filter(function (y) { + return x !== y; + })); + }); + }); + + [].concat(opts.string).filter(Boolean).forEach(function (key) { + flags.strings[key] = true; + if (aliases[key]) { + flags.strings[aliases[key]] = true; + } + }); + + var defaults = opts['default'] || {}; + + var argv = { _ : [] }; + Object.keys(flags.bools).forEach(function (key) { + setArg(key, defaults[key] === undefined ? false : defaults[key]); + }); + + var notFlags = []; + + if (args.indexOf('--') !== -1) { + notFlags = args.slice(args.indexOf('--')+1); + args = args.slice(0, args.indexOf('--')); + } + + function setArg (key, val) { + var value = !flags.strings[key] && isNumber(val) + ? Number(val) : val + ; + setKey(argv, key.split('.'), value); + + (aliases[key] || []).forEach(function (x) { + setKey(argv, x.split('.'), value); + }); + } + + for (var i = 0; i < args.length; i++) { + var arg = args[i]; + + if (/^--.+=/.test(arg)) { + // Using [\s\S] instead of . because js doesn't support the + // 'dotall' regex modifier. See: + // http://stackoverflow.com/a/1068308/13216 + var m = arg.match(/^--([^=]+)=([\s\S]*)$/); + setArg(m[1], m[2]); + } + else if (/^--no-.+/.test(arg)) { + var key = arg.match(/^--no-(.+)/)[1]; + setArg(key, false); + } + else if (/^--.+/.test(arg)) { + var key = arg.match(/^--(.+)/)[1]; + var next = args[i + 1]; + if (next !== undefined && !/^-/.test(next) + && !flags.bools[key] + && (aliases[key] ? !flags.bools[aliases[key]] : true)) { + setArg(key, next); + i++; + } + else if (/^(true|false)$/.test(next)) { + setArg(key, next === 'true'); + i++; + } + else { + setArg(key, flags.strings[key] ? '' : true); + } + } + else if (/^-[^-]+/.test(arg)) { + var letters = arg.slice(1,-1).split(''); + + var broken = false; + for (var j = 0; j < letters.length; j++) { + var next = arg.slice(j+2); + + if (next === '-') { + setArg(letters[j], next) + continue; + } + + if (/[A-Za-z]/.test(letters[j]) + && /-?\d+(\.\d*)?(e-?\d+)?$/.test(next)) { + setArg(letters[j], next); + broken = true; + break; + } + + if (letters[j+1] && letters[j+1].match(/\W/)) { + setArg(letters[j], arg.slice(j+2)); + broken = true; + break; + } + else { + setArg(letters[j], flags.strings[letters[j]] ? '' : true); + } + } + + var key = arg.slice(-1)[0]; + if (!broken && key !== '-') { + if (args[i+1] && !/^(-|--)[^-]/.test(args[i+1]) + && !flags.bools[key] + && (aliases[key] ? !flags.bools[aliases[key]] : true)) { + setArg(key, args[i+1]); + i++; + } + else if (args[i+1] && /true|false/.test(args[i+1])) { + setArg(key, args[i+1] === 'true'); + i++; + } + else { + setArg(key, flags.strings[key] ? '' : true); + } + } + } + else { + argv._.push( + flags.strings['_'] || !isNumber(arg) ? arg : Number(arg) + ); + } + } + + Object.keys(defaults).forEach(function (key) { + if (!hasKey(argv, key.split('.'))) { + setKey(argv, key.split('.'), defaults[key]); + + (aliases[key] || []).forEach(function (x) { + setKey(argv, x.split('.'), defaults[key]); + }); + } + }); + + notFlags.forEach(function(key) { + argv._.push(key); + }); + + return argv; +}; + +function hasKey (obj, keys) { + var o = obj; + keys.slice(0,-1).forEach(function (key) { + o = (o[key] || {}); + }); + + var key = keys[keys.length - 1]; + return key in o; +} + +function setKey (obj, keys, value) { + var o = obj; + keys.slice(0,-1).forEach(function (key) { + if (o[key] === undefined) o[key] = {}; + o = o[key]; + }); + + var key = keys[keys.length - 1]; + if (o[key] === undefined || typeof o[key] === 'boolean') { + o[key] = value; + } + else if (Array.isArray(o[key])) { + o[key].push(value); + } + else { + o[key] = [ o[key], value ]; + } +} + +function isNumber (x) { + if (typeof x === 'number') return true; + if (/^0x[0-9a-f]+$/i.test(x)) return true; + return /^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(x); +} + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/optimist/node_modules/minimist/package.json b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/optimist/node_modules/minimist/package.json new file mode 100644 index 0000000..54f611b --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/optimist/node_modules/minimist/package.json @@ -0,0 +1,67 @@ +{ + "name": "minimist", + "version": "0.0.10", + "description": "parse argument options", + "main": "index.js", + "devDependencies": { + "tape": "~1.0.4", + "tap": "~0.4.0" + }, + "scripts": { + "test": "tap test/*.js" + }, + "testling": { + "files": "test/*.js", + "browsers": [ + "ie/6..latest", + "ff/5", + "firefox/latest", + "chrome/10", + "chrome/latest", + "safari/5.1", + "safari/latest", + "opera/12" + ] + }, + "repository": { + "type": "git", + "url": "git://github.com/substack/minimist.git" + }, + "homepage": "https://github.com/substack/minimist", + "keywords": [ + "argv", + "getopt", + "parser", + "optimist" + ], + "author": { + "name": "James Halliday", + "email": "mail@substack.net", + "url": "http://substack.net" + }, + "license": "MIT", + "bugs": { + "url": "https://github.com/substack/minimist/issues" + }, + "_id": "minimist@0.0.10", + "dist": { + "shasum": "de3f98543dbf96082be48ad1a0c7cda836301dcf", + "tarball": "http://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz" + }, + "_from": "minimist@~0.0.1", + "_npmVersion": "1.4.3", + "_npmUser": { + "name": "substack", + "email": "mail@substack.net" + }, + "maintainers": [ + { + "name": "substack", + "email": "mail@substack.net" + } + ], + "directories": {}, + "_shasum": "de3f98543dbf96082be48ad1a0c7cda836301dcf", + "_resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/optimist/package.json b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/optimist/package.json new file mode 100644 index 0000000..1f20029 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/optimist/package.json @@ -0,0 +1,64 @@ +{ + "name": "optimist", + "version": "0.6.1", + "description": "Light-weight option parsing with an argv hash. No optstrings attached.", + "main": "./index.js", + "dependencies": { + "wordwrap": "~0.0.2", + "minimist": "~0.0.1" + }, + "devDependencies": { + "hashish": "~0.0.4", + "tap": "~0.4.0" + }, + "scripts": { + "test": "tap ./test/*.js" + }, + "repository": { + "type": "git", + "url": "http://github.com/substack/node-optimist.git" + }, + "keywords": [ + "argument", + "args", + "option", + "parser", + "parsing", + "cli", + "command" + ], + "author": { + "name": "James Halliday", + "email": "mail@substack.net", + "url": "http://substack.net" + }, + "license": "MIT/X11", + "engine": { + "node": ">=0.4" + }, + "bugs": { + "url": "https://github.com/substack/node-optimist/issues" + }, + "homepage": "https://github.com/substack/node-optimist", + "_id": "optimist@0.6.1", + "dist": { + "shasum": "da3ea74686fa21a19a111c326e90eb15a0196686", + "tarball": "http://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz" + }, + "_from": "optimist@~0.6.0", + "_npmVersion": "1.3.21", + "_npmUser": { + "name": "substack", + "email": "mail@substack.net" + }, + "maintainers": [ + { + "name": "substack", + "email": "mail@substack.net" + } + ], + "directories": {}, + "_shasum": "da3ea74686fa21a19a111c326e90eb15a0196686", + "_resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/osenv/osenv.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/osenv/osenv.js new file mode 100644 index 0000000..e3367a7 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/osenv/osenv.js @@ -0,0 +1,80 @@ +var isWindows = process.platform === 'win32' +var windir = isWindows ? process.env.windir || 'C:\\Windows' : null +var path = require('path') +var exec = require('child_process').exec + +// looking up envs is a bit costly. +// Also, sometimes we want to have a fallback +// Pass in a callback to wait for the fallback on failures +// After the first lookup, always returns the same thing. +function memo (key, lookup, fallback) { + var fell = false + var falling = false + exports[key] = function (cb) { + var val = lookup() + if (!val && !fell && !falling && fallback) { + fell = true + falling = true + exec(fallback, function (er, output, stderr) { + falling = false + if (er) return // oh well, we tried + val = output.trim() + }) + } + exports[key] = function (cb) { + if (cb) process.nextTick(cb.bind(null, null, val)) + return val + } + if (cb && !falling) process.nextTick(cb.bind(null, null, val)) + return val + } +} + +memo('user', function () { + return ( isWindows + ? process.env.USERDOMAIN + '\\' + process.env.USERNAME + : process.env.USER + ) +}, 'whoami') + +memo('prompt', function () { + return isWindows ? process.env.PROMPT : process.env.PS1 +}) + +memo('hostname', function () { + return isWindows ? process.env.COMPUTERNAME : process.env.HOSTNAME +}, 'hostname') + +memo('tmpdir', function () { + var t = isWindows ? 'temp' : 'tmp' + return process.env.TMPDIR || + process.env.TMP || + process.env.TEMP || + ( exports.home() ? path.resolve(exports.home(), t) + : isWindows ? path.resolve(windir, t) + : '/tmp' + ) +}) + +memo('home', function () { + return ( isWindows ? process.env.USERPROFILE + : process.env.HOME + ) +}) + +memo('path', function () { + return (process.env.PATH || + process.env.Path || + process.env.path).split(isWindows ? ';' : ':') +}) + +memo('editor', function () { + return process.env.EDITOR || + process.env.VISUAL || + (isWindows ? 'notepad.exe' : 'vi') +}) + +memo('shell', function () { + return isWindows ? process.env.ComSpec || 'cmd' + : process.env.SHELL || 'bash' +}) diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/osenv/package.json b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/osenv/package.json new file mode 100644 index 0000000..01c503d --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/node_modules/osenv/package.json @@ -0,0 +1,43 @@ +{ + "name": "osenv", + "version": "0.0.3", + "main": "osenv.js", + "directories": { + "test": "test" + }, + "dependencies": {}, + "devDependencies": { + "tap": "~0.2.5" + }, + "scripts": { + "test": "tap test/*.js" + }, + "repository": { + "type": "git", + "url": "git://github.com/isaacs/osenv" + }, + "keywords": [ + "environment", + "variable", + "home", + "tmpdir", + "path", + "prompt", + "ps1" + ], + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "license": "BSD", + "description": "Look up environment settings specific to different operating systems", + "readme": "# osenv\n\nLook up environment settings specific to different operating systems.\n\n## Usage\n\n```javascript\nvar osenv = require('osenv')\nvar path = osenv.path()\nvar user = osenv.user()\n// etc.\n\n// Some things are not reliably in the env, and have a fallback command:\nvar h = osenv.hostname(function (er, hostname) {\n h = hostname\n})\n// This will still cause it to be memoized, so calling osenv.hostname()\n// is now an immediate operation.\n\n// You can always send a cb, which will get called in the nextTick\n// if it's been memoized, or wait for the fallback data if it wasn't\n// found in the environment.\nosenv.hostname(function (er, hostname) {\n if (er) console.error('error looking up hostname')\n else console.log('this machine calls itself %s', hostname)\n})\n```\n\n## osenv.hostname()\n\nThe machine name. Calls `hostname` if not found.\n\n## osenv.user()\n\nThe currently logged-in user. Calls `whoami` if not found.\n\n## osenv.prompt()\n\nEither PS1 on unix, or PROMPT on Windows.\n\n## osenv.tmpdir()\n\nThe place where temporary files should be created.\n\n## osenv.home()\n\nNo place like it.\n\n## osenv.path()\n\nAn array of the places that the operating system will search for\nexecutables.\n\n## osenv.editor() \n\nReturn the executable name of the editor program. This uses the EDITOR\nand VISUAL environment variables, and falls back to `vi` on Unix, or\n`notepad.exe` on Windows.\n\n## osenv.shell()\n\nThe SHELL on Unix, which Windows calls the ComSpec. Defaults to 'bash'\nor 'cmd'.\n", + "readmeFilename": "README.md", + "bugs": { + "url": "https://github.com/isaacs/osenv/issues" + }, + "homepage": "https://github.com/isaacs/osenv", + "_id": "osenv@0.0.3", + "_from": "osenv@0.0.3" +} diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/package.json b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/package.json new file mode 100644 index 0000000..bbcaa41 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-config/package.json @@ -0,0 +1,43 @@ +{ + "name": "bower-config", + "version": "0.5.2", + "description": "The Bower config reader and writer.", + "author": { + "name": "Twitter" + }, + "licenses": [ + { + "type": "MIT", + "url": "https://github.com/bower/config/blob/master/LICENSE" + } + ], + "repository": { + "type": "git", + "url": "git://github.com/bower/config.git" + }, + "main": "lib/Config", + "homepage": "http://bower.io", + "engines": { + "node": ">=0.8.0" + }, + "dependencies": { + "graceful-fs": "~2.0.0", + "mout": "~0.9.0", + "optimist": "~0.6.0", + "osenv": "0.0.3" + }, + "devDependencies": { + "expect.js": "~0.2.0", + "mocha": "~1.12.0" + }, + "scripts": { + "test": "mocha -R spec" + }, + "readme": "# bower-config [![Build Status](https://secure.travis-ci.org/bower/config.png?branch=master)](http://travis-ci.org/bower/config)\n\nThe Bower config reader and writer. \nThe config spec can be read [here](https://docs.google.com/document/d/1APq7oA9tNao1UYWyOm8dKqlRP2blVkROYLZ2fLIjtWc/).\n\n\n## Usage\n\n#### .load()\n\nLoads the bower configuration from the configuration files.\n\n\n#### .get(key) - NOT YET IMPLEMENTED\n\nReturns a configuration value by `key`. \nKeys with dots are supported to access deep values.\n\n\n#### .set(key, value) - NOT YET IMPLEMENTED\n\nSets a configuration value for `key`. \nKeys with dots are supported to set deep values.\n\n\n#### .del(key) - NOT YET IMPLEMENTED\n\nRemoves configuration named `key`. \nKeys with dots are supported to delete deep keys.\n\n\n#### .save(where, callback) - NOT YET IMPLEMENTED\n\nSaves changes to `where`. \nThe `where` argument can be a path to a configuration file or:\n\n- `local` to save it in the configured current working directory (defaulting to `process.cwd`)\n- `user` to save it in the configuration file located in the home directory\n\n\n#### .toObject()\n\nReturns a deep copy of the underlying configuration object. \nThe returned configuration is normalised. \nThe object keys will be camelCase.\n\n\n#### #create(cwd)\n\nObtains a instance where `cwd` is the current working directory (defaults to `process.cwd`);\n\n```js\nvar config = require('bower-config').create();\n// You can also specify a working directory\nvar config2 = require('bower-config').create('./some/path');\n```\n\n\n#### #read(cwd)\n\nAlias for:\n\n```js\nvar configObject = (new Config(cwd)).load().toJson();\n```\n\n\n#### #normalise(config)\n\nReturns a new normalised config object based on `config`. \nObject keys will be converted to camelCase.\n\n\n## License\n\nReleased under the [MIT License](http://www.opensource.org/licenses/mit-license.php).\n", + "readmeFilename": "README.md", + "bugs": { + "url": "https://github.com/bower/config/issues" + }, + "_id": "bower-config@0.5.2", + "_from": "bower-config@~0.5.2" +} diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-endpoint-parser/index.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-endpoint-parser/index.js new file mode 100644 index 0000000..0552394 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-endpoint-parser/index.js @@ -0,0 +1,128 @@ +function decompose(endpoint) { + // Note that we allow spaces in targets and sources but they are trimmed + var regExp = /^(?:([\w\-]|(?:[\w\.\-]+[\w\-])?)=)?([^\|#]+)(?:#(.*))?$/; + var matches = endpoint.match(regExp); + var target; + var error; + + if (!matches) { + error = new Error('Invalid endpoint: ' + endpoint); + error.code = 'EINVEND'; + throw error; + } + + target = trim(matches[3]); + + return { + name: trim(matches[1]), + source: trim(matches[2]), + target: isWildcard(target) ? '*' : target + }; +} + +function compose(decEndpoint) { + var name = trim(decEndpoint.name); + var source = trim(decEndpoint.source); + var target = trim(decEndpoint.target); + var composed = ''; + + if (name) { + composed += name + '='; + } + + composed += source; + + if (!isWildcard(target)) { + composed += '#' + target; + } + + return composed; +} + +function json2decomposed(key, value) { + var endpoint; + var split; + var error; + + key = trim(key); + value = trim(value); + + if (!key) { + error = new Error('The key must be specified'); + error.code = 'EINVEND'; + throw error; + } + + endpoint = key + '='; + split = value.split('#').map(trim); + + // If # was found, the source was specified + if (split.length > 1) { + endpoint += (split[0] || key) + '#' + split[1]; + // Check if value looks like a source + } else if (isSource(value)) { + endpoint += value + '#*'; + // Otherwise use the key as the source + } else { + endpoint += key + '#' + split[0]; + } + + return decompose(endpoint); +} + +function decomposed2json(decEndpoint) { + var error; + var name = trim(decEndpoint.name); + var source = trim(decEndpoint.source); + var target = trim(decEndpoint.target); + var value = ''; + var ret = {}; + + if (!name) { + error = new Error('Decomposed endpoint must have a name'); + error.code = 'EINVEND'; + throw error; + } + + // Add source only if different than the name + if (source !== name) { + value += source; + } + + // If value is empty, we append the target always + if (!value) { + if (isWildcard(target)) { + value += '*'; + } else { + if (target.indexOf('/') !== -1) { + value += '#' + target; + } else { + value += target; + } + } + // Otherwise append only if not a wildcard or source does not look like a source + } else if (!isWildcard(target) || !isSource(source)) { + value += '#' + (target || '*'); + } + + ret[name] = value; + + return ret; +} + +function trim(str) { + return str ? str.trim() : ''; +} + +function isWildcard(target) { + return !target || target === '*' || target === 'latest'; +} + +function isSource(value) { + return (/[\/\\@]/).test(value); +} + +module.exports.decompose = decompose; +module.exports.compose = compose; +module.exports.json2decomposed = json2decomposed; +module.exports.decomposed2json = decomposed2json; diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-endpoint-parser/package.json b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-endpoint-parser/package.json new file mode 100644 index 0000000..606143e --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-endpoint-parser/package.json @@ -0,0 +1,38 @@ +{ + "name": "bower-endpoint-parser", + "version": "0.2.2", + "description": "Little module that helps with endpoints parsing.", + "author": { + "name": "Twitter" + }, + "licenses": [ + { + "type": "MIT", + "url": "https://github.com/bower/endpoint-parser/blob/master/LICENSE" + } + ], + "repository": { + "type": "git", + "url": "git://github.com/bower/endpoint-parser.git" + }, + "main": "index.js", + "engines": { + "node": ">=0.8.0" + }, + "devDependencies": { + "expect.js": "~0.2.0", + "mocha": "~1.12.0", + "mout": "~0.9.0" + }, + "scripts": { + "test": "mocha -R spec" + }, + "readme": "# endpoint-parser [![Build Status](https://secure.travis-ci.org/bower/endpoint-parser.png?branch=master)](http://travis-ci.org/bower/endpoint-parser)\n\nLittle module that helps with endpoints parsing.\n\n\n## API\n\n### .decompose(endpoint)\n\nDecomposes a endpoint into `name`, `source` and `target`.\n\n```js\nvar endpointParser = require('bower-endpoint-parser');\n\nendpointParser.decompose('jquery#~2.0.0');\n// { name: '', source: 'jquery', target: '~2.0.0' }\n\nendpointParser.decompose('backbone=backbone-amd#~1.0.0');\n// { name: 'backbone', source: 'backbone-amd', target: '~1.0.0' }\n\nendpointParser.decompose('http://twitter.github.io/bootstrap/assets/bootstrap.zip');\n// { name: '', source: 'http://twitter.github.io/bootstrap/assets/bootstrap', target: '*' }\n\nendpointParser.decompose('bootstrap=http://twitter.github.io/bootstrap/assets/bootstrap.zip');\n// { name: 'bootstrap', source: 'http://twitter.github.io/bootstrap/assets/bootstrap', target: '*' }\n```\n\n### .compose(decEndpoint)\n\nInverse of `decompose()`. \nTakes a decomposed endpoint and composes it back into a string.\n\n```js\nvar endpointParser = require('bower-endpoint-parser');\n\nendpointParser.compose({ name: '', source: 'jquery', target: '~2.0.0' });\n// jquery#~2.0.0\n\nendpointParser.compose({ name: 'backbone', source: 'backbone-amd', target: '~1.0.0' });\n// backbone=backbone-amd#~1.0.0\n\nendpointParser.compose({ name: '', source: 'http://twitter.github.io/bootstrap/assets/bootstrap', target: '*' });\n// http://twitter.github.io/bootstrap/assets/bootstrap.zip\n\nendpointParser.compose({ name: 'bootstrap', source: 'http://twitter.github.io/bootstrap/assets/bootstrap', target: '*' });\n// bootstrap=http://twitter.github.io/bootstrap/assets/bootstrap.zip\n```\n\n### .json2decomposed(key, value)\n\nSimilar to `decompose()` but specially designed to be used when parsing `bower.json` dependencies.\nFor instance, in a `bower.json` like this:\n\n```js\n{\n \"name\": \"foo\",\n \"version\": \"0.1.0\",\n \"dependencies\": {\n \"jquery\": \"~1.9.1\",\n \"backbone\": \"backbone-amd#~1.0.0\",\n \"bootstrap\": \"http://twitter.github.io/bootstrap/assets/bootstrap\"\n }\n}\n```\n\nYou would call `json2decomposed` like so:\n\n```js\nendpointParser.json2decomposed('jquery', '~1.9.1');\n// { name: 'jquery', source: 'jquery', target: '~1.9.1' }\n\nendpointParser.json2decomposed('backbone', 'backbone-amd#~1.0.0');\n// { name: 'backbone', source: 'backbone-amd', target: '~1.0.0' }\n\nendpointParser.json2decomposed('bootstrap', 'http://twitter.github.io/bootstrap/assets/bootstrap');\n// { name: 'bootstrap', source: 'http://twitter.github.io/bootstrap/assets/bootstrap', target: '*' }\n```\n\n### .decomposed2json(decEndpoint)\n\nInverse of `json2decomposed()`. \nTakes a decomposed endpoint and composes it to be saved to `bower.json`.\n\n```js\nvar endpointParser = require('bower-endpoint-parser');\n\nendpointParser.decomposed2json({ name: 'jquery', source: 'jquery', target: '~2.0.0' });\n// { jquery: '~2.0.0' }\n\nendpointParser.decomposed2json({ name: 'backbone', source: 'backbone-amd', target: '~1.0.0' });\n// { backbone: 'backbone-amd#~2.0.0' }\n\nendpointParser.decomposed2json({ name: 'bootstrap', source: 'http://twitter.github.io/bootstrap/assets/bootstrap', target: '*' });\n// { bootstrap: 'http://twitter.github.io/bootstrap/assets/bootstrap' }\n```\n\nThis function throws an exception if the `name` from the decomposed endpoint is empty.\n\n\n## License\n\nReleased under the [MIT License](http://www.opensource.org/licenses/mit-license.php).\n", + "readmeFilename": "README.md", + "bugs": { + "url": "https://github.com/bower/endpoint-parser/issues" + }, + "homepage": "https://github.com/bower/endpoint-parser", + "_id": "bower-endpoint-parser@0.2.2", + "_from": "bower-endpoint-parser@~0.2.2" +} diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-json/Gruntfile.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-json/Gruntfile.js new file mode 100644 index 0000000..7f8e1f5 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-json/Gruntfile.js @@ -0,0 +1,53 @@ +module.exports = function (grunt) { + + 'use strict'; + + grunt.loadNpmTasks('grunt-contrib-jshint'); + grunt.loadNpmTasks('grunt-contrib-watch'); + grunt.loadNpmTasks('grunt-simple-mocha'); + + // Project configuration. + grunt.initConfig({ + + jshint: { + files: [ + 'Gruntfile.js', + 'lib/**/*.js', + 'test/**/*.js' + ], + options: { + jshintrc: '.jshintrc' + } + }, + + simplemocha: { + options: { + reporter: 'spec' + }, + full: { src: ['test/test.js'] }, + short: { + options: { + reporter: 'dot' + }, + src: ['test/test.js'] + }, + build: { + options: { + reporter: 'tap' + }, + src: ['test/test.js'] + } + }, + + + watch: { + files: ['<%= jshint.files %>'], + tasks: ['jshint', 'simplemocha:short'] + } + + }); + + // Default task. + grunt.registerTask('test', ['simplemocha:full']); + grunt.registerTask('default', ['jshint', 'test']); +}; diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-json/lib/json.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-json/lib/json.js new file mode 100644 index 0000000..be753d2 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-json/lib/json.js @@ -0,0 +1,147 @@ +var fs = require('graceful-fs'); +var path = require('path'); +var deepExtend = require('deep-extend'); +var isComponent = require('./util/isComponent'); +var createError = require('./util/createError'); + +var possibleJsons = ['bower.json', 'component.json', '.bower.json']; + +function read(file, options, callback) { + if (typeof options === 'function') { + callback = options; + options = {}; + } + + // Check if file is a directory + fs.stat(file, function (err, stat) { + if (err) { + return callback(err); + } + + // It's a directory, so we find the json inside it + if (stat.isDirectory()) { + return find(file, function (err, file) { + if (err) { + return callback(err); + } + + read(file, options, callback); + }); + } + + // Otherwise read it + fs.readFile(file, function (err, contents) { + var json; + + if (err) { + return callback(err); + } + + try { + json = JSON.parse(contents.toString()); + } catch (err) { + err.file = path.resolve(file); + err.code = 'EMALFORMED'; + return callback(err); + } + + // Parse it + try { + json = parse(json, options); + } catch (err) { + err.file = path.resolve(file); + return callback(err); + } + + callback(null, json, file); + }); + }); +} + +function parse(json, options) { + options = deepExtend({ + normalize: false, + validate: true, + clone: false + }, options || {}); + + // Clone + if (options.clone) { + json = deepExtend({}, json); + } + + // Validate + if (options.validate) { + validate(json); + } + + // Normalize + if (options.normalize) { + normalize(json); + } + + return json; +} + +function validate(json) { + if (!json.name) { + throw createError('No name property set', 'EINVALID'); + } + + // TODO + + return json; +} + +function normalize(json) { + if (typeof json.main === 'string') { + json.main = json.main.split(','); + } + + // TODO + + return json; +} + +function find(folder, files, callback) { + var err; + var file; + + if (typeof files === 'function') { + callback = files; + files = possibleJsons; + } + + if (!files.length) { + err = createError('None of ' + possibleJsons.join(', ') + ' were found in ' + folder, 'ENOENT'); + return callback(err); + } + + file = path.resolve(path.join(folder, files[0])); + fs.exists(file, function (exists) { + if (!exists) { + return find(folder, files.slice(1), callback); + } + + if (files[0] !== 'component.json') { + return callback(null, file); + } + + // If the file is component.json, check it it's a component(1) file + // If it is, we ignore it and keep searching + isComponent(file, function (is) { + if (is) { + return find(folder, files.slice(1), callback); + } + + callback(null, file); + }); + }); +} + +module.exports = read; +module.exports.read = read; +module.exports.parse = parse; +module.exports.validate = validate; +module.exports.normalize = normalize; +module.exports.find = find; diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-json/lib/util/createError.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-json/lib/util/createError.js new file mode 100644 index 0000000..8e9a416 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-json/lib/util/createError.js @@ -0,0 +1,8 @@ +function createError(msg, code) { + var err = new Error(msg); + err.code = code; + + return err; +} + +module.exports = createError; diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-json/lib/util/isComponent.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-json/lib/util/isComponent.js new file mode 100644 index 0000000..0211206 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-json/lib/util/isComponent.js @@ -0,0 +1,41 @@ +var fs = require('graceful-fs'); +var intersect = require('intersect'); + +// Function to check if a file is a component(1) file +function isComponent(file, callback) { + fs.readFile(file, function (err, contents) { + var json; + var keys; + var common; + + // If an error occurs while reading the file, we ignore it + if (err) { + return callback(false); + } + + try { + json = JSON.parse(contents.toString()); + } catch (err) { + return callback(false); + } + + // Attempt to find specific things from the component(1) spec + // Note that we don't parse the dependencies property because at any point + // we can allow / to specify directories + // Bellow only some clearly not ambiguous properties are checked + keys = Object.keys(json); + common = intersect(keys, [ + 'repo', + 'development', + 'local', + 'remotes', + 'paths', + 'demo' + ]); + + // If none were found, than it's a valid component.json bower file + callback(common.length ? true : false); + }); +} + +module.exports = isComponent; diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-json/node_modules/deep-extend/index.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-json/node_modules/deep-extend/index.js new file mode 100644 index 0000000..c1f8dae --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-json/node_modules/deep-extend/index.js @@ -0,0 +1,90 @@ +/*! + * Node.JS module "Deep Extend" + * @description Recursive object extending. + * @author Viacheslav Lotsmanov (unclechu) + * @license MIT + * + * The MIT License (MIT) + * + * Copyright (c) 2013 Viacheslav Lotsmanov + * + * 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. + */ + +/** + * Extening object that entered in first argument. + * Returns extended object or false if have no target object or incorrect type. + * If you wish to clone object, simply use that: + * deepExtend({}, yourObj_1, [yourObj_N]) - first arg is new empty object + */ +var deepExtend = module.exports = function (/*obj_1, [obj_2], [obj_N]*/) { + if (arguments.length < 1 || typeof arguments[0] !== 'object') { + return false; + } + + if (arguments.length < 2) return arguments[0]; + + var target = arguments[0]; + + // convert arguments to array and cut off target object + var args = Array.prototype.slice.call(arguments, 1); + + var key, val, src, clone, tmpBuf; + + args.forEach(function (obj) { + if (typeof obj !== 'object') return; + + for (key in obj) { + if ( ! (key in obj)) continue; + + src = target[key]; + val = obj[key]; + + if (val === target) continue; + + if (typeof val !== 'object' || val === null) { + target[key] = val; + continue; + } else if (val instanceof Buffer) { + tmpBuf = new Buffer(val.length); + val.copy(tmpBuf); + target[key] = tmpBuf; + continue; + } else if (val instanceof Date) { + target[key] = new Date(val.getTime()); + continue; + } + + if (typeof src !== 'object' || src === null) { + clone = (Array.isArray(val)) ? [] : {}; + target[key] = deepExtend(clone, val); + continue; + } + + if (Array.isArray(val)) { + clone = (Array.isArray(src)) ? src : []; + } else { + clone = (!Array.isArray(src)) ? src : {}; + } + + target[key] = deepExtend(clone, val); + } + }); + + return target; +} diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-json/node_modules/deep-extend/package.json b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-json/node_modules/deep-extend/package.json new file mode 100644 index 0000000..072c58b --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-json/node_modules/deep-extend/package.json @@ -0,0 +1,43 @@ +{ + "name": "deep-extend", + "description": "Recursive object extending.", + "license": "MIT", + "version": "0.2.11", + "homepage": "https://github.com/unclechu/node-deep-extend", + "repository": { + "type": "git", + "url": "git://github.com/unclechu/node-deep-extend.git" + }, + "author": { + "name": "Viacheslav Lotsmanov", + "email": "lotsmanov89@gmail.com", + "url": "unclechu" + }, + "contributors": [ + { + "name": "Romain Prieto", + "url": "https://github.com/rprieto" + } + ], + "main": "index", + "engines": { + "node": ">=0.4" + }, + "scripts": { + "test": "mocha" + }, + "devDependencies": { + "mocha": "~1.19.0", + "should": "~3.3.2" + }, + "directories": { + "test": "./test" + }, + "readme": "Node.JS module “Deep Extend”\r\n============================\r\n\r\nRecursive object extending.\r\n\r\nInstall\r\n-----\r\n\r\n npm install deep-extend\r\n\r\nUsage\r\n-----\r\n\r\n var deepExtend = require('deep-extend');\r\n var obj1 = {\r\n a: 1,\r\n b: 2,\r\n d: {\r\n a: 1,\r\n b: [],\r\n c: { test1: 123, test2: 321 }\r\n },\r\n f: 5,\r\n g: 123\r\n };\r\n var obj2 = {\r\n b: 3,\r\n c: 5,\r\n d: {\r\n b: { first: 'one', second: 'two' },\r\n c: { test2: 222 }\r\n },\r\n e: { one: 1, two: 2 },\r\n f: [],\r\n g: (void 0)\r\n };\r\n\r\n deepExtend(obj1, obj2);\r\n\r\n console.log(obj1);\r\n /*\r\n { a: 1,\r\n b: 3,\r\n d:\r\n { a: 1,\r\n b: { first: 'one', second: 'two' },\r\n c: { test1: 123, test2: 222 } },\r\n f: [],\r\n c: 5,\r\n e: { one: 1, two: 2 },\r\n g: undefined }\r\n */\r\n", + "readmeFilename": "README.md", + "bugs": { + "url": "https://github.com/unclechu/node-deep-extend/issues" + }, + "_id": "deep-extend@0.2.11", + "_from": "deep-extend@~0.2.5" +} diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-json/node_modules/graceful-fs/graceful-fs.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-json/node_modules/graceful-fs/graceful-fs.js new file mode 100644 index 0000000..c84db91 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-json/node_modules/graceful-fs/graceful-fs.js @@ -0,0 +1,160 @@ +// Monkey-patching the fs module. +// It's ugly, but there is simply no other way to do this. +var fs = module.exports = require('fs') + +var assert = require('assert') + +// fix up some busted stuff, mostly on windows and old nodes +require('./polyfills.js') + +// The EMFILE enqueuing stuff + +var util = require('util') + +function noop () {} + +var debug = noop +if (util.debuglog) + debug = util.debuglog('gfs') +else if (/\bgfs\b/i.test(process.env.NODE_DEBUG || '')) + debug = function() { + var m = util.format.apply(util, arguments) + m = 'GFS: ' + m.split(/\n/).join('\nGFS: ') + console.error(m) + } + +if (/\bgfs\b/i.test(process.env.NODE_DEBUG || '')) { + process.on('exit', function() { + debug('fds', fds) + debug(queue) + assert.equal(queue.length, 0) + }) +} + + +var originalOpen = fs.open +fs.open = open + +function open(path, flags, mode, cb) { + if (typeof mode === "function") cb = mode, mode = null + if (typeof cb !== "function") cb = noop + new OpenReq(path, flags, mode, cb) +} + +function OpenReq(path, flags, mode, cb) { + this.path = path + this.flags = flags + this.mode = mode + this.cb = cb + Req.call(this) +} + +util.inherits(OpenReq, Req) + +OpenReq.prototype.process = function() { + originalOpen.call(fs, this.path, this.flags, this.mode, this.done) +} + +var fds = {} +OpenReq.prototype.done = function(er, fd) { + debug('open done', er, fd) + if (fd) + fds['fd' + fd] = this.path + Req.prototype.done.call(this, er, fd) +} + + +var originalReaddir = fs.readdir +fs.readdir = readdir + +function readdir(path, cb) { + if (typeof cb !== "function") cb = noop + new ReaddirReq(path, cb) +} + +function ReaddirReq(path, cb) { + this.path = path + this.cb = cb + Req.call(this) +} + +util.inherits(ReaddirReq, Req) + +ReaddirReq.prototype.process = function() { + originalReaddir.call(fs, this.path, this.done) +} + +ReaddirReq.prototype.done = function(er, files) { + if (files && files.sort) + files = files.sort() + Req.prototype.done.call(this, er, files) + onclose() +} + + +var originalClose = fs.close +fs.close = close + +function close (fd, cb) { + debug('close', fd) + if (typeof cb !== "function") cb = noop + delete fds['fd' + fd] + originalClose.call(fs, fd, function(er) { + onclose() + cb(er) + }) +} + + +var originalCloseSync = fs.closeSync +fs.closeSync = closeSync + +function closeSync (fd) { + try { + return originalCloseSync(fd) + } finally { + onclose() + } +} + + +// Req class +function Req () { + // start processing + this.done = this.done.bind(this) + this.failures = 0 + this.process() +} + +Req.prototype.done = function (er, result) { + var tryAgain = false + if (er) { + var code = er.code + var tryAgain = code === "EMFILE" + if (process.platform === "win32") + tryAgain = tryAgain || code === "OK" + } + + if (tryAgain) { + this.failures ++ + enqueue(this) + } else { + var cb = this.cb + cb(er, result) + } +} + +var queue = [] + +function enqueue(req) { + queue.push(req) + debug('enqueue %d %s', queue.length, req.constructor.name, req) +} + +function onclose() { + var req = queue.shift() + if (req) { + debug('process', req.constructor.name, req) + req.process() + } +} diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-json/node_modules/graceful-fs/package.json b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-json/node_modules/graceful-fs/package.json new file mode 100644 index 0000000..dc22856 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-json/node_modules/graceful-fs/package.json @@ -0,0 +1,65 @@ +{ + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me" + }, + "name": "graceful-fs", + "description": "A drop-in replacement for fs, making various improvements.", + "version": "2.0.3", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/node-graceful-fs.git" + }, + "main": "graceful-fs.js", + "engines": { + "node": ">=0.4.0" + }, + "directories": { + "test": "test" + }, + "scripts": { + "test": "tap test/*.js" + }, + "keywords": [ + "fs", + "module", + "reading", + "retry", + "retries", + "queue", + "error", + "errors", + "handling", + "EMFILE", + "EAGAIN", + "EINVAL", + "EPERM", + "EACCESS" + ], + "license": "BSD", + "bugs": { + "url": "https://github.com/isaacs/node-graceful-fs/issues" + }, + "homepage": "https://github.com/isaacs/node-graceful-fs", + "_id": "graceful-fs@2.0.3", + "dist": { + "shasum": "7cd2cdb228a4a3f36e95efa6cc142de7d1a136d0", + "tarball": "http://registry.npmjs.org/graceful-fs/-/graceful-fs-2.0.3.tgz" + }, + "_from": "graceful-fs@~2.0.0", + "_npmVersion": "1.4.6", + "_npmUser": { + "name": "isaacs", + "email": "i@izs.me" + }, + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + } + ], + "_shasum": "7cd2cdb228a4a3f36e95efa6cc142de7d1a136d0", + "_resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-2.0.3.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-json/node_modules/graceful-fs/polyfills.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-json/node_modules/graceful-fs/polyfills.js new file mode 100644 index 0000000..afc83b3 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-json/node_modules/graceful-fs/polyfills.js @@ -0,0 +1,228 @@ +var fs = require('fs') +var constants = require('constants') + +var origCwd = process.cwd +var cwd = null +process.cwd = function() { + if (!cwd) + cwd = origCwd.call(process) + return cwd +} +var chdir = process.chdir +process.chdir = function(d) { + cwd = null + chdir.call(process, d) +} + +// (re-)implement some things that are known busted or missing. + +// lchmod, broken prior to 0.6.2 +// back-port the fix here. +if (constants.hasOwnProperty('O_SYMLINK') && + process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) { + fs.lchmod = function (path, mode, callback) { + callback = callback || noop + fs.open( path + , constants.O_WRONLY | constants.O_SYMLINK + , mode + , function (err, fd) { + if (err) { + callback(err) + return + } + // prefer to return the chmod error, if one occurs, + // but still try to close, and report closing errors if they occur. + fs.fchmod(fd, mode, function (err) { + fs.close(fd, function(err2) { + callback(err || err2) + }) + }) + }) + } + + fs.lchmodSync = function (path, mode) { + var fd = fs.openSync(path, constants.O_WRONLY | constants.O_SYMLINK, mode) + + // prefer to return the chmod error, if one occurs, + // but still try to close, and report closing errors if they occur. + var err, err2 + try { + var ret = fs.fchmodSync(fd, mode) + } catch (er) { + err = er + } + try { + fs.closeSync(fd) + } catch (er) { + err2 = er + } + if (err || err2) throw (err || err2) + return ret + } +} + + +// lutimes implementation, or no-op +if (!fs.lutimes) { + if (constants.hasOwnProperty("O_SYMLINK")) { + fs.lutimes = function (path, at, mt, cb) { + fs.open(path, constants.O_SYMLINK, function (er, fd) { + cb = cb || noop + if (er) return cb(er) + fs.futimes(fd, at, mt, function (er) { + fs.close(fd, function (er2) { + return cb(er || er2) + }) + }) + }) + } + + fs.lutimesSync = function (path, at, mt) { + var fd = fs.openSync(path, constants.O_SYMLINK) + , err + , err2 + , ret + + try { + var ret = fs.futimesSync(fd, at, mt) + } catch (er) { + err = er + } + try { + fs.closeSync(fd) + } catch (er) { + err2 = er + } + if (err || err2) throw (err || err2) + return ret + } + + } else if (fs.utimensat && constants.hasOwnProperty("AT_SYMLINK_NOFOLLOW")) { + // maybe utimensat will be bound soonish? + fs.lutimes = function (path, at, mt, cb) { + fs.utimensat(path, at, mt, constants.AT_SYMLINK_NOFOLLOW, cb) + } + + fs.lutimesSync = function (path, at, mt) { + return fs.utimensatSync(path, at, mt, constants.AT_SYMLINK_NOFOLLOW) + } + + } else { + fs.lutimes = function (_a, _b, _c, cb) { process.nextTick(cb) } + fs.lutimesSync = function () {} + } +} + + +// https://github.com/isaacs/node-graceful-fs/issues/4 +// Chown should not fail on einval or eperm if non-root. + +fs.chown = chownFix(fs.chown) +fs.fchown = chownFix(fs.fchown) +fs.lchown = chownFix(fs.lchown) + +fs.chownSync = chownFixSync(fs.chownSync) +fs.fchownSync = chownFixSync(fs.fchownSync) +fs.lchownSync = chownFixSync(fs.lchownSync) + +function chownFix (orig) { + if (!orig) return orig + return function (target, uid, gid, cb) { + return orig.call(fs, target, uid, gid, function (er, res) { + if (chownErOk(er)) er = null + cb(er, res) + }) + } +} + +function chownFixSync (orig) { + if (!orig) return orig + return function (target, uid, gid) { + try { + return orig.call(fs, target, uid, gid) + } catch (er) { + if (!chownErOk(er)) throw er + } + } +} + +function chownErOk (er) { + // if there's no getuid, or if getuid() is something other than 0, + // and the error is EINVAL or EPERM, then just ignore it. + // This specific case is a silent failure in cp, install, tar, + // and most other unix tools that manage permissions. + // When running as root, or if other types of errors are encountered, + // then it's strict. + if (!er || (!process.getuid || process.getuid() !== 0) + && (er.code === "EINVAL" || er.code === "EPERM")) return true +} + + +// if lchmod/lchown do not exist, then make them no-ops +if (!fs.lchmod) { + fs.lchmod = function (path, mode, cb) { + process.nextTick(cb) + } + fs.lchmodSync = function () {} +} +if (!fs.lchown) { + fs.lchown = function (path, uid, gid, cb) { + process.nextTick(cb) + } + fs.lchownSync = function () {} +} + + + +// on Windows, A/V software can lock the directory, causing this +// to fail with an EACCES or EPERM if the directory contains newly +// created files. Try again on failure, for up to 1 second. +if (process.platform === "win32") { + var rename_ = fs.rename + fs.rename = function rename (from, to, cb) { + var start = Date.now() + rename_(from, to, function CB (er) { + if (er + && (er.code === "EACCES" || er.code === "EPERM") + && Date.now() - start < 1000) { + return rename_(from, to, CB) + } + cb(er) + }) + } +} + + +// if read() returns EAGAIN, then just try it again. +var read = fs.read +fs.read = function (fd, buffer, offset, length, position, callback_) { + var callback + if (callback_ && typeof callback_ === 'function') { + var eagCounter = 0 + callback = function (er, _, __) { + if (er && er.code === 'EAGAIN' && eagCounter < 10) { + eagCounter ++ + return read.call(fs, fd, buffer, offset, length, position, callback) + } + callback_.apply(this, arguments) + } + } + return read.call(fs, fd, buffer, offset, length, position, callback) +} + +var readSync = fs.readSync +fs.readSync = function (fd, buffer, offset, length, position) { + var eagCounter = 0 + while (true) { + try { + return readSync.call(fs, fd, buffer, offset, length, position) + } catch (er) { + if (er.code === 'EAGAIN' && eagCounter < 10) { + eagCounter ++ + continue + } + throw er + } + } +} + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-json/node_modules/intersect/component.json b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-json/node_modules/intersect/component.json new file mode 100644 index 0000000..23a3b1e --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-json/node_modules/intersect/component.json @@ -0,0 +1,16 @@ +{ + "name": "intersect", + "repo": "juliangruber/intersect", + "description": "Find the intersection of two arrays.", + "version": "0.0.3", + "keywords": [ + "intersect", + "array" + ], + "dependencies": {}, + "development": {}, + "license": "MIT", + "scripts": [ + "index.js" + ] +} diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-json/node_modules/intersect/index.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-json/node_modules/intersect/index.js new file mode 100644 index 0000000..71de652 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-json/node_modules/intersect/index.js @@ -0,0 +1,16 @@ +module.exports = intersect; + +function intersect (a, b) { + var res = []; + for (var i = 0; i < a.length; i++) { + if (indexOf(b, a[i]) > -1) res.push(a[i]); + } + return res; +} + +function indexOf(arr, el) { + for (var i = 0; i < arr.length; i++) { + if (arr[i] === el) return i; + } + return -1; +} diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-json/node_modules/intersect/package.json b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-json/node_modules/intersect/package.json new file mode 100644 index 0000000..f0c68a7 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-json/node_modules/intersect/package.json @@ -0,0 +1,65 @@ +{ + "name": "intersect", + "description": "Find the intersection of two arrays", + "version": "0.0.3", + "repository": { + "type": "git", + "url": "git://github.com/juliangruber/intersect.git" + }, + "homepage": "https://github.com/juliangruber/intersect", + "main": "index.js", + "scripts": { + "test": "tape test/*.js" + }, + "dependencies": {}, + "devDependencies": { + "tape": "~0.3.3" + }, + "keywords": [ + "interset", + "array" + ], + "author": { + "name": "Julian Gruber", + "email": "mail@juliangruber.com", + "url": "http://juliangruber.com" + }, + "license": "MIT", + "testling": { + "files": "test/*.js", + "browsers": [ + "ie/6..latest", + "chrome/20..latest", + "firefox/10..latest", + "safari/5.0.5..latest", + "opera/11.0..latest", + "iphone/6", + "ipad/6" + ] + }, + "readme": "\n# intersect\n\n## Usage\n\n```js\nvar intersect = require('intersect');\n\nvar a = ['foo', 'bar', 'baz'];\nvar b = ['nope', 'bar', 'baz'];\n\nconsole.log(intersect(a, b));\n// => ['bar', 'baz']\n```\n\n## License\n\n(MIT)\n\nCopyright (c) 2013 Julian Gruber <julian@juliangruber.com>\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies\nof the Software, and to permit persons to whom the Software is furnished to do\nso, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n", + "readmeFilename": "README.md", + "_id": "intersect@0.0.3", + "dist": { + "shasum": "c1a4a5e5eac6ede4af7504cc07e0ada7bc9f4920", + "tarball": "http://registry.npmjs.org/intersect/-/intersect-0.0.3.tgz" + }, + "_from": "intersect@~0.0.3", + "_npmVersion": "1.2.14", + "_npmUser": { + "name": "juliangruber", + "email": "julian@juliangruber.com" + }, + "maintainers": [ + { + "name": "juliangruber", + "email": "julian@juliangruber.com" + } + ], + "directories": {}, + "_shasum": "c1a4a5e5eac6ede4af7504cc07e0ada7bc9f4920", + "_resolved": "https://registry.npmjs.org/intersect/-/intersect-0.0.3.tgz", + "bugs": { + "url": "https://github.com/juliangruber/intersect/issues" + } +} diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-json/package.json b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-json/package.json new file mode 100644 index 0000000..14df4c0 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-json/package.json @@ -0,0 +1,63 @@ +{ + "name": "bower-json", + "version": "0.4.0", + "description": "Read bower.json files with semantics, normalisation, defaults and validation.", + "author": { + "name": "Twitter" + }, + "licenses": [ + { + "type": "MIT", + "url": "https://github.com/bower/json/blob/master/LICENSE" + } + ], + "repository": { + "type": "git", + "url": "git://github.com/bower/json.git" + }, + "main": "lib/json", + "engines": { + "node": ">=0.8.0" + }, + "dependencies": { + "deep-extend": "~0.2.5", + "graceful-fs": "~2.0.0", + "intersect": "~0.0.3" + }, + "devDependencies": { + "expect.js": "~0.2.0", + "mocha": "~1.12.0", + "grunt": "~0.4.1", + "grunt-contrib-watch": "~0.4.4", + "grunt-contrib-jshint": "~0.6.0", + "grunt-simple-mocha": "~0.4.0" + }, + "scripts": { + "test": "grunt test" + }, + "bugs": { + "url": "https://github.com/bower/json/issues" + }, + "_id": "bower-json@0.4.0", + "dist": { + "shasum": "a99c3ccf416ef0590ed0ded252c760f1c6d93766", + "tarball": "http://registry.npmjs.org/bower-json/-/bower-json-0.4.0.tgz" + }, + "_from": "bower-json@~0.4.0", + "_npmVersion": "1.3.2", + "_npmUser": { + "name": "satazor", + "email": "andremiguelcruz@msn.com" + }, + "maintainers": [ + { + "name": "satazor", + "email": "andremiguelcruz@msn.com" + } + ], + "directories": {}, + "_shasum": "a99c3ccf416ef0590ed0ded252c760f1c6d93766", + "_resolved": "https://registry.npmjs.org/bower-json/-/bower-json-0.4.0.tgz", + "readme": "ERROR: No README data found!", + "homepage": "https://github.com/bower/json" +} diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-logger/lib/Logger.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-logger/lib/Logger.js new file mode 100644 index 0000000..7c4dff1 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-logger/lib/Logger.js @@ -0,0 +1,150 @@ +var EventEmitter = require('events').EventEmitter; +var util = require('util'); + +var slice = Array.prototype.slice; + +function Logger() { + this._interceptors = []; + this._piped = []; +} + +util.inherits(Logger, EventEmitter); + +Logger.prototype.intercept = function (fn) { + this._interceptors.push(fn); + return this; +}; + +Logger.prototype.emit = function () { + var ret; + var args = slice.call(arguments); + + // Run interceptors before + if (args[0] === 'log') { + this._interceptors.forEach(function (interceptor) { + interceptor.apply(this, args.slice(1)); + }); + } + + ret = EventEmitter.prototype.emit.apply(this, args); + + // Pipe + this._piped.forEach(function (emitter) { + emitter.emit.apply(emitter, args); + }); + + return ret; +}; + +Logger.prototype.pipe = function (emitter) { + this._piped.push(emitter); + + return emitter; +}; + +Logger.prototype.geminate = function () { + var logger = new Logger(); + + logger.pipe(this); + return logger; +}; + +Logger.prototype.log = function (level, id, message, data) { + var log = { + level: level, + id: id, + message: message, + data: data || {} + }; + + // Emit log + this.emit('log', log); + + return this; +}; + +Logger.prototype.prompt = function (prompts, callback) { + var fn; + var one; + var invalid; + var runned; + var error; + var validPrompts = Logger._validPrompts; + + if (!Array.isArray(prompts)) { + prompts.name = 'prompt'; + prompts = [prompts]; + one = true; + } + + // Validate prompt types + invalid = prompts.some(function (prompt) { + return validPrompts.indexOf(prompt.type) === -1; + }); + + if (invalid) { + error = new Error('Unknown prompt type'); + error.code = 'ENOTSUP'; + return callback(error); + } + + fn = function (answers) { + // Run callback only once + if (runned) { + return; + } + + // Trim answers automatically + Object.keys(answers).forEach(function (key) { + var value = answers[key]; + + if (typeof value === 'string') { + answers[key] = value.trim(); + } else if (Array.isArray(value)) { + answers[key] = value.map(function (item) { + if (typeof item === 'string') { + return item.trim(); + } + }); + } + }); + + runned = true; + + // If only one prompt was requested, resolve with its answer + if (one) { + answers = answers.prompt; + } + + callback(null, answers); + }; + + this.emit('prompt', prompts, fn); +}; + +// ------------------ + +Logger._validPrompts = [ + 'input', + 'confirm', + 'password', + 'checkbox' +]; + +Logger.LEVELS = { + 'error': 5, + 'conflict': 4, + 'warn': 3, + 'action': 2, + 'info': 1, + 'debug': 0 +}; + +// Add helpful log methods +Object.keys(Logger.LEVELS).forEach(function (level) { + Logger.prototype[level] = function (id, message, data) { + this.log(level, id, message, data); + }; +}); + +module.exports = Logger; diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-logger/package.json b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-logger/package.json new file mode 100644 index 0000000..ae7a427 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-logger/package.json @@ -0,0 +1,62 @@ +{ + "name": "bower-logger", + "version": "0.2.2", + "description": "The logger used in the various architecture components of Bower.", + "author": { + "name": "Twitter" + }, + "licenses": [ + { + "type": "MIT", + "url": "https://github.com/bower/logger/blob/master/LICENSE" + } + ], + "repository": { + "type": "git", + "url": "git://github.com/bower/logger.git" + }, + "main": "lib/Logger", + "engines": { + "node": ">=0.8.0" + }, + "devDependencies": { + "expect.js": "~0.2.0", + "mocha": "~1.12.0" + }, + "scripts": { + "test": "mocha -R spec" + }, + "bugs": { + "url": "https://github.com/bower/logger/issues" + }, + "_id": "bower-logger@0.2.2", + "dist": { + "shasum": "39be07e979b2fc8e03a94634205ed9422373d381", + "tarball": "http://registry.npmjs.org/bower-logger/-/bower-logger-0.2.2.tgz" + }, + "_from": "bower-logger@~0.2.2", + "_npmVersion": "1.3.11", + "_npmUser": { + "name": "wibblymat", + "email": "mat@wibbly.org.uk" + }, + "maintainers": [ + { + "name": "satazor", + "email": "andremiguelcruz@msn.com" + }, + { + "name": "wibblymat", + "email": "mat@wibbly.org.uk" + }, + { + "name": "paulirish", + "email": "paul.irish@gmail.com" + } + ], + "directories": {}, + "_shasum": "39be07e979b2fc8e03a94634205ed9422373d381", + "_resolved": "https://registry.npmjs.org/bower-logger/-/bower-logger-0.2.2.tgz", + "readme": "ERROR: No README data found!", + "homepage": "https://github.com/bower/logger" +} diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-registry-client/Client.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-registry-client/Client.js new file mode 100644 index 0000000..0b1ce93 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-registry-client/Client.js @@ -0,0 +1,67 @@ +var async = require('async'); +var Config = require('bower-config'); +var methods = require('./lib'); +var Cache = require('./lib/util/Cache'); + +function RegistryClient(config, logger) { + this._logger = logger; + this._config = Config.normalise(config); + + // Cache defaults to storage registry + if (!Object.prototype.hasOwnProperty.call(this._config, 'cache')) { + this._config.cache = this._config.storage ? this._config.storage.registry : null; + } + + // Init the cache + this._initCache(); +} + +// Add every method to the prototype +RegistryClient.prototype.lookup = methods.lookup; +RegistryClient.prototype.search = methods.search; +RegistryClient.prototype.list = methods.list; +RegistryClient.prototype.register = methods.register; +RegistryClient.prototype.unregister = methods.unregister; + +RegistryClient.prototype.clearCache = function (name, callback) { + if (typeof name === 'function') { + callback = name; + name = null; + } + + async.parallel([ + this.lookup.clearCache.bind(this, name), + this.search.clearCache.bind(this, name), + this.list.clearCache.bind(this) + ], callback); +}; + +RegistryClient.prototype.resetCache = function (name) { + this.lookup.resetCache.call(this, name); + this.search.resetCache.call(this, name); + this.list.resetCache.call(this); + + return this; +}; + +RegistryClient.clearRuntimeCache = function () { + Cache.clearRuntimeCache(); +}; + +// ----------------------------- + +RegistryClient.prototype._initCache = function () { + var cache; + var dir = this._config.cache; + + // Cache is stored/retrieved statically to ensure singularity + // among instances + cache = this.constructor._cache = this.constructor._cache || {}; + this._cache = cache[dir] = cache[dir] || {}; + + this.lookup.initCache.call(this); + this.search.initCache.call(this); + this.list.initCache.call(this); +}; + +module.exports = RegistryClient; diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-registry-client/Gruntfile.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-registry-client/Gruntfile.js new file mode 100644 index 0000000..11042a5 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-registry-client/Gruntfile.js @@ -0,0 +1,53 @@ +module.exports = function (grunt) { + + 'use strict'; + + grunt.loadNpmTasks('grunt-contrib-jshint'); + grunt.loadNpmTasks('grunt-contrib-watch'); + grunt.loadNpmTasks('grunt-simple-mocha'); + + // Project configuration. + grunt.initConfig({ + + jshint: { + files: [ + 'Gruntfile.js', + 'lib/**/*.js', + 'test/**/*.js' + ], + options: { + jshintrc: '.jshintrc' + } + }, + + simplemocha: { + options: { + reporter: 'spec' + }, + full: { src: ['test/runner.js'] }, + short: { + options: { + reporter: 'dot' + }, + src: ['test/runner.js'] + }, + build: { + options: { + reporter: 'tap' + }, + src: ['test/runner.js'] + } + }, + + + watch: { + files: ['<%= jshint.files %>'], + tasks: ['jshint', 'simplemocha:short'] + } + + }); + + // Default task. + grunt.registerTask('test', ['simplemocha:full']); + grunt.registerTask('default', ['jshint', 'test']); +}; diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-registry-client/lib/index.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-registry-client/lib/index.js new file mode 100644 index 0000000..0a816d2 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-registry-client/lib/index.js @@ -0,0 +1,7 @@ +module.exports = { + lookup: require('./lookup'), + list: require('./list'), + register: require('./register'), + search: require('./search'), + unregister: require('./unregister') +}; diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-registry-client/lib/list.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-registry-client/lib/list.js new file mode 100644 index 0000000..18fbc07 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-registry-client/lib/list.js @@ -0,0 +1,185 @@ +var path = require('path'); +var url = require('url'); +var async = require('async'); +var request = require('request'); +var replay = require('request-replay'); +var Cache = require('./util/Cache'); +var createError = require('./util/createError'); + +function list(callback) { + var data = []; + var that = this; + var registry = this._config.registry.search; + var total = registry.length; + var index = 0; + + // If no registry entries were passed, simply + // error with package not found + if (!total) { + return callback(null, []); + } + + // List packages in series in each registry + async.doUntil(function (next) { + var remote = url.parse(registry[index]); + var listCache = that._listCache[remote.host]; + + // If offline flag is passed, only query the cache + if (that._config.offline) { + return listCache.get('list', function (err, results) { + if (err || !results) { + return next(err); + } + + // Add each result + results.forEach(function (result) { + addResult.call(that, data, result); + }); + + next(); + }); + } + + // Otherwise make a request to always obtain fresh data + doRequest.call(that, index, function (err, results) { + if (err || !results) { + return next(err); + } + + // Add each result + results.forEach(function (result) { + addResult(data, result); + }); + + // Store in cache for future offline usage + listCache.set('list', results, getMaxAge(), next); + }); + }, function () { + // Until there's still registries to test + return ++index === total; + }, function (err) { + // Clear runtime cache, keeping the persistent data + // in files for future offline usage + resetCache(); + + // If some of the registry entries failed, error out + if (err) { + return callback(err); + } + + callback(null, data); + }); +} + +function addResult(accumulated, result) { + var exists = accumulated.some(function (current) { + return current.name === result.name; + }); + + if (!exists) { + accumulated.push(result); + } +} + +function doRequest(index, callback) { + var req; + var msg; + var requestUrl = this._config.registry.search[index] + '/packages'; + var remote = url.parse(requestUrl); + var headers = {}; + var that = this; + + if (this._config.userAgent) { + headers['User-Agent'] = this._config.userAgent; + } + + req = replay(request.get(requestUrl, { + proxy: remote.protocol === 'https:' ? this._config.httpsProxy : this._config.proxy, + ca: this._config.ca.search[index], + headers: headers, + strictSSL: this._config.strictSsl, + timeout: this._config.timeout, + json: true + }, function (err, response, body) { + // If there was an internal error (e.g. timeout) + if (err) { + return callback(createError('Request to ' + requestUrl + ' failed: ' + err.message, err.code)); + } + + // Abort if there was an error (range different than 2xx) + if (response.statusCode < 200 || response.statusCode > 299) { + return callback(createError('Request to ' + requestUrl + ' failed with ' + response.statusCode, 'EINVRES')); + } + + // Validate response body, since we are expecting a JSON object + // If the server returns an invalid JSON, it's still a string + if (typeof body !== 'object') { + return callback(createError('Response of request to ' + requestUrl + ' is not a valid json', 'EINVRES')); + } + + callback(null, body); + })); + + if (this._logger) { + req.on('replay', function (replay) { + msg = 'Request to ' + requestUrl + ' failed with ' + replay.error.code + ', '; + msg += 'retrying in ' + (replay.delay / 1000).toFixed(1) + 's'; + that._logger.warn('retry', msg); + }); + } +} + +function getMaxAge() { + // Make it 5 minutes + return 5 * 60 * 60 * 1000; +} + +function initCache() { + this._listCache = this._cache.list || {}; + + // Generate a cache instance for each registry endpoint + this._config.registry.search.forEach(function (registry) { + var cacheDir; + var host = url.parse(registry).host; + + // Skip if there's a cache for the same host + if (this._listCache[host]) { + return; + } + + if (this._config.cache) { + cacheDir = path.join(this._config.cache, encodeURIComponent(host), 'list'); + } + + this._listCache[host] = new Cache(cacheDir, { + max: 250, + // If offline flag is passed, we use stale entries from the cache + useStale: this._config.offline + }); + }, this); +} + +function clearCache(callback) { + var listCache = this._listCache; + var remotes = Object.keys(listCache); + + // There's only one key, which is 'list'.. + // But we clear everything anyway + async.forEach(remotes, function (remote, next) { + listCache[remote].clear(next); + }, callback); +} + +function resetCache() { + var remote; + + for (remote in this._listCache) { + this._listCache[remote].reset(); + } +} + +list.initCache = initCache; +list.clearCache = clearCache; +list.resetCache = resetCache; + +module.exports = list; diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-registry-client/lib/lookup.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-registry-client/lib/lookup.js new file mode 100644 index 0000000..c6cd6cf --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-registry-client/lib/lookup.js @@ -0,0 +1,203 @@ +var path = require('path'); +var url = require('url'); +var async = require('async'); +var request = require('request'); +var replay = require('request-replay'); +var createError = require('./util/createError'); +var Cache = require('./util/Cache'); + +function lookup(name, callback) { + var data; + var that = this; + var registry = this._config.registry.search; + var total = registry.length; + var index = 0; + + // If no registry entries were passed.. + if (!total) { + return callback(); + } + + // Lookup package in series in each registry + // endpoint until we got the data + async.doUntil(function (next) { + var remote = url.parse(registry[index]); + var lookupCache = that._lookupCache[remote.host]; + + // If force flag is disabled we check the cache + if (!that._config.force) { + lookupCache.get(name, function (err, value) { + data = value; + + // Don't proceed with making a request if we got an error, + // a value from the cache or if the offline flag is enabled + if (err || data || that._config.offline) { + return next(err); + } + + doRequest.call(that, name, index, function (err, entry) { + if (err || !entry) { + return next(err); + } + + data = entry; + + // Store in cache + lookupCache.set(name, entry, getMaxAge(entry), next); + }); + }); + // Otherwise, we totally bypass the cache and + // make only the request + } else { + doRequest.call(that, name, index, function (err, entry) { + if (err || !entry) { + return next(err); + } + + data = entry; + + // Store in cache + lookupCache.set(name, entry, getMaxAge(entry), next); + }); + } + }, function () { + // Until the data is unknown or there's still registries to test + return !!data || ++index === total; + }, function (err) { + // If some of the registry entries failed, error out + if (err) { + return callback(err); + } + + callback(null, data); + }); +} + +function doRequest(name, index, callback) { + var req; + var msg; + var requestUrl = this._config.registry.search[index] + '/packages/' + encodeURIComponent(name); + var remote = url.parse(requestUrl); + var headers = {}; + var that = this; + + if (this._config.userAgent) { + headers['User-Agent'] = this._config.userAgent; + } + + req = replay(request.get(requestUrl, { + proxy: remote.protocol === 'https:' ? this._config.httpsProxy : this._config.proxy, + headers: headers, + ca: this._config.ca.search[index], + strictSSL: this._config.strictSsl, + timeout: this._config.timeout, + json: true + }, function (err, response, body) { + // If there was an internal error (e.g. timeout) + if (err) { + return callback(createError('Request to ' + requestUrl + ' failed: ' + err.message, err.code)); + } + + // If not found, try next + if (response.statusCode === 404) { + return callback(); + } + + // Abort if there was an error (range different than 2xx) + if (response.statusCode < 200 || response.statusCode > 299) { + return callback(createError('Request to ' + requestUrl + ' failed with ' + response.statusCode, 'EINVRES')); + } + + // Validate response body, since we are expecting a JSON object + // If the server returns an invalid JSON, it's still a string + if (typeof body !== 'object') { + return callback(createError('Response of request to ' + requestUrl + ' is not a valid json', 'EINVRES')); + } + + var data; + if (body.url) { + data = { + type: 'alias', + url: body.url + }; + } + callback(null, data); + })); + + if (this._logger) { + req.on('replay', function (replay) { + msg = 'Request to ' + requestUrl + ' failed with ' + replay.error.code + ', '; + msg += 'retrying in ' + (replay.delay / 1000).toFixed(1) + 's'; + that._logger.warn('retry', msg); + }); + } +} + +function getMaxAge(entry) { + // If type is alias, make it 5 days + if (entry.type === 'alias') { + return 5 * 24 * 60 * 60 * 1000; + } + + // Otherwise make it 5 minutes + return 5 * 60 * 60 * 1000; +} + +function initCache() { + this._lookupCache = this._cache.lookup || {}; + + // Generate a cache instance for each registry endpoint + this._config.registry.search.forEach(function (registry) { + var cacheDir; + var host = url.parse(registry).host; + + // Skip if there's a cache for the same host + if (this._lookupCache[host]) { + return; + } + + if (this._config.cache) { + cacheDir = path.join(this._config.cache, encodeURIComponent(host), 'lookup'); + } + + this._lookupCache[host] = new Cache(cacheDir, { + max: 250, + // If offline flag is passed, we use stale entries from the cache + useStale: this._config.offline + }); + }, this); +} + +function clearCache(name, callback) { + var lookupCache = this._lookupCache; + var remotes = Object.keys(lookupCache); + + if (typeof name === 'function') { + callback = name; + name = null; + } + + if (name) { + async.forEach(remotes, function (remote, next) { + lookupCache[remote].del(name, next); + }, callback); + } else { + async.forEach(remotes, function (remote, next) { + lookupCache[remote].clear(next); + }, callback); + } +} + +function resetCache() { + var remote; + + for (remote in this._lookupCache) { + this._lookupCache[remote].reset(); + } +} + +lookup.initCache = initCache; +lookup.clearCache = clearCache; +lookup.resetCache = resetCache; + +module.exports = lookup; diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-registry-client/lib/register.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-registry-client/lib/register.js new file mode 100644 index 0000000..fb43189 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-registry-client/lib/register.js @@ -0,0 +1,59 @@ +var parseUrl = require('url').parse; +var request = require('request'); +var createError = require('./util/createError'); + +function register(name, url, callback) { + var config = this._config; + var requestUrl = config.registry.register + '/packages'; + var remote = parseUrl(requestUrl); + var headers = {}; + + if (config.userAgent) { + headers['User-Agent'] = config.userAgent; + } + + if (config.accessToken) { + requestUrl += '?access_token=' + config.accessToken; + } + + request.post({ + url: requestUrl, + proxy: remote.protocol === 'https:' ? config.httpsProxy : config.proxy, + headers: headers, + ca: config.ca.register, + strictSSL: config.strictSsl, + timeout: config.timeout, + json: true, + form: { + name: name, + url: url + } + }, function (err, response) { + // If there was an internal error (e.g. timeout) + if (err) { + return callback(createError('Request to ' + requestUrl + ' failed: ' + err.message, err.code)); + } + + // Duplicate + if (response.statusCode === 406) { + return callback(createError('Duplicate package', 'EDUPLICATE')); + } + + // Invalid format + if (response.statusCode === 400) { + return callback(createError('Invalid URL format', 'EINVFORMAT')); + } + + // Everything other than 201 is unknown + if (response.statusCode !== 201) { + return callback(createError('Unknown error: ' + response.statusCode, 'EUNKNOWN')); + } + + callback(null, { + name: name, + url: url + }); + }); +} + +module.exports = register; diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-registry-client/lib/search.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-registry-client/lib/search.js new file mode 100644 index 0000000..3bbd8e7 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-registry-client/lib/search.js @@ -0,0 +1,201 @@ +var path = require('path'); +var url = require('url'); +var async = require('async'); +var request = require('request'); +var replay = require('request-replay'); +var Cache = require('./util/Cache'); +var createError = require('./util/createError'); + +// TODO: +// The search cache simply stores a specific search result +// into a file. This is a very rudimentary algorithm but +// works to support elementary offline support +// Once the registry server is rewritten, a better strategy +// can be implemented (with diffs and local search), similar to npm. + +function search(name, callback) { + var data = []; + var that = this; + var registry = this._config.registry.search; + var total = registry.length; + var index = 0; + + // If no registry entries were passed, simply + // error with package not found + if (!total) { + return callback(null, []); + } + + // Search package in series in each registry, + // merging results together + async.doUntil(function (next) { + var remote = url.parse(registry[index]); + var searchCache = that._searchCache[remote.host]; + + // If offline flag is passed, only query the cache + if (that._config.offline) { + return searchCache.get(name, function (err, results) { + if (err || !results || !results.length) { + return next(err); + } + + // Add each result + results.forEach(function (result) { + addResult.call(that, data, result); + }); + + next(); + }); + } + + // Otherwise make a request to always obtain fresh data + doRequest.call(that, name, index, function (err, results) { + if (err || !results || !results.length) { + return next(err); + } + + // Add each result + results.forEach(function (result) { + addResult.call(that, data, result); + }); + + // Store in cache for future offline usage + searchCache.set(name, results, getMaxAge(), next); + }); + }, function () { + // Until the data is unknown or there's still registries to test + return ++index === total; + }, function (err) { + // Clear runtime cache, keeping the persistent data + // in files for future offline usage + resetCache(); + + // If some of the registry entries failed, error out + if (err) { + return callback(err); + } + + callback(null, data); + }); +} + +function addResult(accumulated, result) { + var exists = accumulated.some(function (current) { + return current.name === result.name; + }); + + if (!exists) { + accumulated.push(result); + } +} + +function doRequest(name, index, callback) { + var req; + var msg; + var requestUrl = this._config.registry.search[index] + '/packages/search/' + encodeURIComponent(name); + var remote = url.parse(requestUrl); + var headers = {}; + var that = this; + + if (this._config.userAgent) { + headers['User-Agent'] = this._config.userAgent; + } + + req = replay(request.get(requestUrl, { + proxy: remote.protocol === 'https:' ? this._config.httpsProxy : this._config.proxy, + headers: headers, + ca: this._config.ca.search[index], + strictSSL: this._config.strictSsl, + timeout: this._config.timeout, + json: true + }, function (err, response, body) { + // If there was an internal error (e.g. timeout) + if (err) { + return callback(createError('Request to ' + requestUrl + ' failed: ' + err.message, err.code)); + } + + // Abort if there was an error (range different than 2xx) + if (response.statusCode < 200 || response.statusCode > 299) { + return callback(createError('Request to ' + requestUrl + ' failed with ' + response.statusCode, 'EINVRES')); + } + + // Validate response body, since we are expecting a JSON object + // If the server returns an invalid JSON, it's still a string + if (typeof body !== 'object') { + return callback(createError('Response of request to ' + requestUrl + ' is not a valid json', 'EINVRES')); + } + + callback(null, body); + })); + + if (this._logger) { + req.on('replay', function (replay) { + msg = 'Request to ' + requestUrl + ' failed with ' + replay.error.code + ', '; + msg += 'retrying in ' + (replay.delay / 1000).toFixed(1) + 's'; + that._logger.warn('retry', msg); + }); + } +} + +function getMaxAge() { + // Make it 5 minutes + return 5 * 60 * 60 * 1000; +} + +function initCache() { + this._searchCache = this._cache.search || {}; + + // Generate a cache instance for each registry endpoint + this._config.registry.search.forEach(function (registry) { + var cacheDir; + var host = url.parse(registry).host; + + // Skip if there's a cache for the same host + if (this._searchCache[host]) { + return; + } + + if (this._config.cache) { + cacheDir = path.join(this._config.cache, encodeURIComponent(host), 'search'); + } + + this._searchCache[host] = new Cache(cacheDir, { + max: 250, + // If offline flag is passed, we use stale entries from the cache + useStale: this._config.offline + }); + }, this); +} + +function clearCache(name, callback) { + var searchCache = this._searchCache; + var remotes = Object.keys(searchCache); + + if (typeof name === 'function') { + callback = name; + name = null; + } + + // Simply erase everything since other searches could + // contain the "name" package + // One possible solution would be to read every entry from the cache and + // delete if the package is contained in the search results + // But this is too expensive + async.forEach(remotes, function (remote, next) { + searchCache[remote].clear(next); + }, callback); +} + +function resetCache() { + var remote; + + for (remote in this._searchCache) { + this._searchCache[remote].reset(); + } +} + +search.initCache = initCache; +search.clearCache = clearCache; +search.resetCache = resetCache; + +module.exports = search; diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-registry-client/lib/unregister.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-registry-client/lib/unregister.js new file mode 100644 index 0000000..9d49304 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-registry-client/lib/unregister.js @@ -0,0 +1,48 @@ +var parseUrl = require('url').parse; +var request = require('request'); +var createError = require('./util/createError'); + +function unregister(name, callback) { + var config = this._config; + var requestUrl = config.registry.register + '/packages/' + name; + var remote = parseUrl(requestUrl); + var headers = {}; + + if (config.userAgent) { + headers['User-Agent'] = config.userAgent; + } + + if (config.accessToken) { + requestUrl += '?access_token=' + config.accessToken; + } + + request.del({ + url: requestUrl, + proxy: remote.protocol === 'https:' ? config.httpsProxy : config.proxy, + headers: headers, + ca: config.ca.register, + strictSSL: config.strictSsl, + timeout: config.timeout + }, function (err, response) { + // If there was an internal error (e.g. timeout) + if (err) { + return callback(createError('Request to ' + requestUrl + ' failed: ' + err.message, err.code)); + } + + // Forbidden + if (response.statusCode === 403) { + return callback(createError('Not authorized', 'EFORBIDDEN')); + } + + // Everything other than 204 is unknown + if (response.statusCode !== 204) { + return callback(createError('Unknown error: ' + response.statusCode + ', ' + response.body, 'EUNKNOWN')); + } + + callback(null, { + name: name + }); + }); +} + +module.exports = unregister; diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-registry-client/lib/util/Cache.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-registry-client/lib/util/Cache.js new file mode 100644 index 0000000..c490b91 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-registry-client/lib/util/Cache.js @@ -0,0 +1,195 @@ +var fs = require('graceful-fs'); +var path = require('path'); +var async = require('async'); +var mkdirp = require('mkdirp'); +var LRU = require('lru-cache'); +var md5 = require('./md5'); + +function Cache(dir, options) { + options = options || {}; + + this._dir = dir; + this._options = options; + this._cache = this.constructor._cache.get(this._dir); + + if (!this._cache) { + this._cache = new LRU(options); + this.constructor._cache.set(this._dir, this._cache); + } + + if (dir) { + mkdirp.sync(dir); + } +} + +Cache.prototype.get = function (key, callback) { + var file; + var json = this._cache.get(key); + + // Check in memory + if (json) { + if (this._hasExpired(json)) { + this.del(key, callback); + } else { + callback(null, json.value); + } + + return; + } + + // Check in disk + if (!this._dir) { + return callback(null); + } + + file = this._getFile(key); + fs.readFile(file, function (err, contents) { + var json; + + // Check if there was an error reading + // Note that if the file does not exist then + // we don't have its value + if (err) { + return callback(err.code === 'ENOENT' ? null : err); + } + + // If there was an error reading the file as json + // simply assume it doesn't exist + try { + json = JSON.parse(contents.toString()); + } catch (e) { + return this.del(key, callback); // If so, delete it + } + + // Check if it has expired + if (this._hasExpired(json)) { + return this.del(key, callback); + } + + this._cache.set(key, json); + callback(null, json.value); + }.bind(this)); +}; + +Cache.prototype.set = function (key, value, maxAge, callback) { + var file; + var entry; + var str; + + maxAge = maxAge != null ? maxAge : this._options.maxAge; + entry = { + expires: maxAge ? Date.now() + maxAge : null, + value: value + }; + + // Store in memory + this._cache.set(key, entry); + + // Store in disk + if (!this._dir) { + return callback(null); + } + + // If there was an error generating the json + // then there's some cyclic reference or some other issue + try { + str = JSON.stringify(entry); + } catch (e) { + return callback(e); + } + + file = this._getFile(key); + fs.writeFile(file, str, callback); +}; + +Cache.prototype.del = function (key, callback) { + // Delete from memory + this._cache.del(key); + + // Delete from disk + if (!this._dir) { + return callback(null); + } + + fs.unlink(this._getFile(key), function (err) { + if (err && err.code !== 'ENOENT') { + return callback(err); + } + + callback(); + }); +}; + +Cache.prototype.clear = function (callback) { + var dir = this._dir; + + // Clear in memory cache + this._cache.reset(); + + // Clear everything from the disk + if (!dir) { + return callback(null); + } + + fs.readdir(dir, function (err, files) { + if (err) { + return callback(err); + } + + // Delete every file in parallel + async.forEach(files, function (file, next) { + fs.unlink(path.join(dir, file), function (err) { + if (err && err.code !== 'ENOENT') { + return next(err); + } + + next(); + }); + }, callback); + }); +}; + +Cache.prototype.reset = function () { + this._cache.reset(); +}; + +Cache.clearRuntimeCache = function () { + // Note that _cache refers to the static _cache variable + // that holds other caches per dir! + // Do not confuse it with the instance cache + + // Clear cache of each directory + this._cache.forEach(function (cache) { + cache.reset(); + }); + + // Clear root cache + this._cache.reset(); +}; + +//------------------------------- + +Cache.prototype._hasExpired = function (json) { + var expires = json.expires; + + if (!expires || this._options.useStale) { + return false; + } + + // Check if the key has expired + return Date.now() > expires; +}; + +Cache.prototype._getFile = function (key) { + // Append a truncated md5 to the end of the file to solve case issues + // on case insensitive file systems + // See: https://github.com/bower/bower/issues/859 + return path.join(this._dir, encodeURIComponent(key) + '_' + md5(key).substr(0, 5)); +}; + +Cache._cache = new LRU({ + max: 5, + maxAge: 60 * 30 * 1000 // 30 minutes +}); + +module.exports = Cache; diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-registry-client/lib/util/createError.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-registry-client/lib/util/createError.js new file mode 100644 index 0000000..8e9a416 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-registry-client/lib/util/createError.js @@ -0,0 +1,8 @@ +function createError(msg, code) { + var err = new Error(msg); + err.code = code; + + return err; +} + +module.exports = createError; diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-registry-client/lib/util/md5.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-registry-client/lib/util/md5.js new file mode 100644 index 0000000..dbc920b --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-registry-client/lib/util/md5.js @@ -0,0 +1,7 @@ +var crypto = require('crypto'); + +function md5(contents) { + return crypto.createHash('md5').update(contents).digest('hex'); +} + +module.exports = md5; diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-registry-client/node_modules/async/component.json b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-registry-client/node_modules/async/component.json new file mode 100644 index 0000000..bbb0115 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-registry-client/node_modules/async/component.json @@ -0,0 +1,11 @@ +{ + "name": "async", + "repo": "caolan/async", + "description": "Higher-order functions and common patterns for asynchronous code", + "version": "0.1.23", + "keywords": [], + "dependencies": {}, + "development": {}, + "main": "lib/async.js", + "scripts": [ "lib/async.js" ] +} diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-registry-client/node_modules/async/lib/async.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-registry-client/node_modules/async/lib/async.js new file mode 100644 index 0000000..1eebb15 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/bower-registry-client/node_modules/async/lib/async.js @@ -0,0 +1,958 @@ +/*global setImmediate: false, setTimeout: false, console: false */ +(function () { + + var async = {}; + + // global on the server, window in the browser + var root, previous_async; + + root = this; + if (root != null) { + previous_async = root.async; + } + + async.noConflict = function () { + root.async = previous_async; + return async; + }; + + function only_once(fn) { + var called = false; + return function() { + if (called) throw new Error("Callback was already called."); + called = true; + fn.apply(root, arguments); + } + } + + //// cross-browser compatiblity functions //// + + var _each = function (arr, iterator) { + if (arr.forEach) { + return arr.forEach(iterator); + } + for (var i = 0; i < arr.length; i += 1) { + iterator(arr[i], i, arr); + } + }; + + var _map = function (arr, iterator) { + if (arr.map) { + return arr.map(iterator); + } + var results = []; + _each(arr, function (x, i, a) { + results.push(iterator(x, i, a)); + }); + return results; + }; + + var _reduce = function (arr, iterator, memo) { + if (arr.reduce) { + return arr.reduce(iterator, memo); + } + _each(arr, function (x, i, a) { + memo = iterator(memo, x, i, a); + }); + return memo; + }; + + var _keys = function (obj) { + if (Object.keys) { + return Object.keys(obj); + } + var keys = []; + for (var k in obj) { + if (obj.hasOwnProperty(k)) { + keys.push(k); + } + } + return keys; + }; + + //// exported async module functions //// + + //// nextTick implementation with browser-compatible fallback //// + if (typeof process === 'undefined' || !(process.nextTick)) { + if (typeof setImmediate === 'function') { + async.nextTick = function (fn) { + // not a direct alias for IE10 compatibility + setImmediate(fn); + }; + async.setImmediate = async.nextTick; + } + else { + async.nextTick = function (fn) { + setTimeout(fn, 0); + }; + async.setImmediate = async.nextTick; + } + } + else { + async.nextTick = process.nextTick; + if (typeof setImmediate !== 'undefined') { + async.setImmediate = function (fn) { + // not a direct alias for IE10 compatibility + setImmediate(fn); + }; + } + else { + async.setImmediate = async.nextTick; + } + } + + async.each = function (arr, iterator, callback) { + callback = callback || function () {}; + if (!arr.length) { + return callback(); + } + var completed = 0; + _each(arr, function (x) { + iterator(x, only_once(function (err) { + if (err) { + callback(err); + callback = function () {}; + } + else { + completed += 1; + if (completed >= arr.length) { + callback(null); + } + } + })); + }); + }; + async.forEach = async.each; + + async.eachSeries = function (arr, iterator, callback) { + callback = callback || function () {}; + if (!arr.length) { + return callback(); + } + var completed = 0; + var iterate = function () { + iterator(arr[completed], function (err) { + if (err) { + callback(err); + callback = function () {}; + } + else { + completed += 1; + if (completed >= arr.length) { + callback(null); + } + else { + iterate(); + } + } + }); + }; + iterate(); + }; + async.forEachSeries = async.eachSeries; + + async.eachLimit = function (arr, limit, iterator, callback) { + var fn = _eachLimit(limit); + fn.apply(null, [arr, iterator, callback]); + }; + async.forEachLimit = async.eachLimit; + + var _eachLimit = function (limit) { + + return function (arr, iterator, callback) { + callback = callback || function () {}; + if (!arr.length || limit <= 0) { + return callback(); + } + var completed = 0; + var started = 0; + var running = 0; + + (function replenish () { + if (completed >= arr.length) { + return callback(); + } + + while (running < limit && started < arr.length) { + started += 1; + running += 1; + iterator(arr[started - 1], function (err) { + if (err) { + callback(err); + callback = function () {}; + } + else { + completed += 1; + running -= 1; + if (completed >= arr.length) { + callback(); + } + else { + replenish(); + } + } + }); + } + })(); + }; + }; + + + var doParallel = function (fn) { + return function () { + var args = Array.prototype.slice.call(arguments); + return fn.apply(null, [async.each].concat(args)); + }; + }; + var doParallelLimit = function(limit, fn) { + return function () { + var args = Array.prototype.slice.call(arguments); + return fn.apply(null, [_eachLimit(limit)].concat(args)); + }; + }; + var doSeries = function (fn) { + return function () { + var args = Array.prototype.slice.call(arguments); + return fn.apply(null, [async.eachSeries].concat(args)); + }; + }; + + + var _asyncMap = function (eachfn, arr, iterator, callback) { + var results = []; + arr = _map(arr, function (x, i) { + return {index: i, value: x}; + }); + eachfn(arr, function (x, callback) { + iterator(x.value, function (err, v) { + results[x.index] = v; + callback(err); + }); + }, function (err) { + callback(err, results); + }); + }; + async.map = doParallel(_asyncMap); + async.mapSeries = doSeries(_asyncMap); + async.mapLimit = function (arr, limit, iterator, callback) { + return _mapLimit(limit)(arr, iterator, callback); + }; + + var _mapLimit = function(limit) { + return doParallelLimit(limit, _asyncMap); + }; + + // reduce only has a series version, as doing reduce in parallel won't + // work in many situations. + async.reduce = function (arr, memo, iterator, callback) { + async.eachSeries(arr, function (x, callback) { + iterator(memo, x, function (err, v) { + memo = v; + callback(err); + }); + }, function (err) { + callback(err, memo); + }); + }; + // inject alias + async.inject = async.reduce; + // foldl alias + async.foldl = async.reduce; + + async.reduceRight = function (arr, memo, iterator, callback) { + var reversed = _map(arr, function (x) { + return x; + }).reverse(); + async.reduce(reversed, memo, iterator, callback); + }; + // foldr alias + async.foldr = async.reduceRight; + + var _filter = function (eachfn, arr, iterator, callback) { + var results = []; + arr = _map(arr, function (x, i) { + return {index: i, value: x}; + }); + eachfn(arr, function (x, callback) { + iterator(x.value, function (v) { + if (v) { + results.push(x); + } + callback(); + }); + }, function (err) { + callback(_map(results.sort(function (a, b) { + return a.index - b.index; + }), function (x) { + return x.value; + })); + }); + }; + async.filter = doParallel(_filter); + async.filterSeries = doSeries(_filter); + // select alias + async.select = async.filter; + async.selectSeries = async.filterSeries; + + var _reject = function (eachfn, arr, iterator, callback) { + var results = []; + arr = _map(arr, function (x, i) { + return {index: i, value: x}; + }); + eachfn(arr, function (x, callback) { + iterator(x.value, function (v) { + if (!v) { + results.push(x); + } + callback(); + }); + }, function (err) { + callback(_map(results.sort(function (a, b) { + return a.index - b.index; + }), function (x) { + return x.value; + })); + }); + }; + async.reject = doParallel(_reject); + async.rejectSeries = doSeries(_reject); + + var _detect = function (eachfn, arr, iterator, main_callback) { + eachfn(arr, function (x, callback) { + iterator(x, function (result) { + if (result) { + main_callback(x); + main_callback = function () {}; + } + else { + callback(); + } + }); + }, function (err) { + main_callback(); + }); + }; + async.detect = doParallel(_detect); + async.detectSeries = doSeries(_detect); + + async.some = function (arr, iterator, main_callback) { + async.each(arr, function (x, callback) { + iterator(x, function (v) { + if (v) { + main_callback(true); + main_callback = function () {}; + } + callback(); + }); + }, function (err) { + main_callback(false); + }); + }; + // any alias + async.any = async.some; + + async.every = function (arr, iterator, main_callback) { + async.each(arr, function (x, callback) { + iterator(x, function (v) { + if (!v) { + main_callback(false); + main_callback = function () {}; + } + callback(); + }); + }, function (err) { + main_callback(true); + }); + }; + // all alias + async.all = async.every; + + async.sortBy = function (arr, iterator, callback) { + async.map(arr, function (x, callback) { + iterator(x, function (err, criteria) { + if (err) { + callback(err); + } + else { + callback(null, {value: x, criteria: criteria}); + } + }); + }, function (err, results) { + if (err) { + return callback(err); + } + else { + var fn = function (left, right) { + var a = left.criteria, b = right.criteria; + return a < b ? -1 : a > b ? 1 : 0; + }; + callback(null, _map(results.sort(fn), function (x) { + return x.value; + })); + } + }); + }; + + async.auto = function (tasks, callback) { + callback = callback || function () {}; + var keys = _keys(tasks); + if (!keys.length) { + return callback(null); + } + + var results = {}; + + var listeners = []; + var addListener = function (fn) { + listeners.unshift(fn); + }; + var removeListener = function (fn) { + for (var i = 0; i < listeners.length; i += 1) { + if (listeners[i] === fn) { + listeners.splice(i, 1); + return; + } + } + }; + var taskComplete = function () { + _each(listeners.slice(0), function (fn) { + fn(); + }); + }; + + addListener(function () { + if (_keys(results).length === keys.length) { + callback(null, results); + callback = function () {}; + } + }); + + _each(keys, function (k) { + var task = (tasks[k] instanceof Function) ? [tasks[k]]: tasks[k]; + var taskCallback = function (err) { + var args = Array.prototype.slice.call(arguments, 1); + if (args.length <= 1) { + args = args[0]; + } + if (err) { + var safeResults = {}; + _each(_keys(results), function(rkey) { + safeResults[rkey] = results[rkey]; + }); + safeResults[k] = args; + callback(err, safeResults); + // stop subsequent errors hitting callback multiple times + callback = function () {}; + } + else { + results[k] = args; + async.setImmediate(taskComplete); + } + }; + var requires = task.slice(0, Math.abs(task.length - 1)) || []; + var ready = function () { + return _reduce(requires, function (a, x) { + return (a && results.hasOwnProperty(x)); + }, true) && !results.hasOwnProperty(k); + }; + if (ready()) { + task[task.length - 1](taskCallback, results); + } + else { + var listener = function () { + if (ready()) { + removeListener(listener); + task[task.length - 1](taskCallback, results); + } + }; + addListener(listener); + } + }); + }; + + async.waterfall = function (tasks, callback) { + callback = callback || function () {}; + if (tasks.constructor !== Array) { + var err = new Error('First argument to waterfall must be an array of functions'); + return callback(err); + } + if (!tasks.length) { + return callback(); + } + var wrapIterator = function (iterator) { + return function (err) { + if (err) { + callback.apply(null, arguments); + callback = function () {}; + } + else { + var args = Array.prototype.slice.call(arguments, 1); + var next = iterator.next(); + if (next) { + args.push(wrapIterator(next)); + } + else { + args.push(callback); + } + async.setImmediate(function () { + iterator.apply(null, args); + }); + } + }; + }; + wrapIterator(async.iterator(tasks))(); + }; + + var _parallel = function(eachfn, tasks, callback) { + callback = callback || function () {}; + if (tasks.constructor === Array) { + eachfn.map(tasks, function (fn, callback) { + if (fn) { + fn(function (err) { + var args = Array.prototype.slice.call(arguments, 1); + if (args.length <= 1) { + args = args[0]; + } + callback.call(null, err, args); + }); + } + }, callback); + } + else { + var results = {}; + eachfn.each(_keys(tasks), function (k, callback) { + tasks[k](function (err) { + var args = Array.prototype.slice.call(arguments, 1); + if (args.length <= 1) { + args = args[0]; + } + results[k] = args; + callback(err); + }); + }, function (err) { + callback(err, results); + }); + } + }; + + async.parallel = function (tasks, callback) { + _parallel({ map: async.map, each: async.each }, tasks, callback); + }; + + async.parallelLimit = function(tasks, limit, callback) { + _parallel({ map: _mapLimit(limit), each: _eachLimit(limit) }, tasks, callback); + }; + + async.series = function (tasks, callback) { + callback = callback || function () {}; + if (tasks.constructor === Array) { + async.mapSeries(tasks, function (fn, callback) { + if (fn) { + fn(function (err) { + var args = Array.prototype.slice.call(arguments, 1); + if (args.length <= 1) { + args = args[0]; + } + callback.call(null, err, args); + }); + } + }, callback); + } + else { + var results = {}; + async.eachSeries(_keys(tasks), function (k, callback) { + tasks[k](function (err) { + var args = Array.prototype.slice.call(arguments, 1); + if (args.length <= 1) { + args = args[0]; + } + results[k] = args; + callback(err); + }); + }, function (err) { + callback(err, results); + }); + } + }; + + async.iterator = function (tasks) { + var makeCallback = function (index) { + var fn = function () { + if (tasks.length) { + tasks[index].apply(null, arguments); + } + return fn.next(); + }; + fn.next = function () { + return (index < tasks.length - 1) ? makeCallback(index + 1): null; + }; + return fn; + }; + return makeCallback(0); + }; + + async.apply = function (fn) { + var args = Array.prototype.slice.call(arguments, 1); + return function () { + return fn.apply( + null, args.concat(Array.prototype.slice.call(arguments)) + ); + }; + }; + + var _concat = function (eachfn, arr, fn, callback) { + var r = []; + eachfn(arr, function (x, cb) { + fn(x, function (err, y) { + r = r.concat(y || []); + cb(err); + }); + }, function (err) { + callback(err, r); + }); + }; + async.concat = doParallel(_concat); + async.concatSeries = doSeries(_concat); + + async.whilst = function (test, iterator, callback) { + if (test()) { + iterator(function (err) { + if (err) { + return callback(err); + } + async.whilst(test, iterator, callback); + }); + } + else { + callback(); + } + }; + + async.doWhilst = function (iterator, test, callback) { + iterator(function (err) { + if (err) { + return callback(err); + } + if (test()) { + async.doWhilst(iterator, test, callback); + } + else { + callback(); + } + }); + }; + + async.until = function (test, iterator, callback) { + if (!test()) { + iterator(function (err) { + if (err) { + return callback(err); + } + async.until(test, iterator, callback); + }); + } + else { + callback(); + } + }; + + async.doUntil = function (iterator, test, callback) { + iterator(function (err) { + if (err) { + return callback(err); + } + if (!test()) { + async.doUntil(iterator, test, callback); + } + else { + callback(); + } + }); + }; + + async.queue = function (worker, concurrency) { + if (concurrency === undefined) { + concurrency = 1; + } + function _insert(q, data, pos, callback) { + if(data.constructor !== Array) { + data = [data]; + } + _each(data, function(task) { + var item = { + data: task, + callback: typeof callback === 'function' ? callback : null + }; + + if (pos) { + q.tasks.unshift(item); + } else { + q.tasks.push(item); + } + + if (q.saturated && q.tasks.length === concurrency) { + q.saturated(); + } + async.setImmediate(q.process); + }); + } + + var workers = 0; + var q = { + tasks: [], + concurrency: concurrency, + saturated: null, + empty: null, + drain: null, + push: function (data, callback) { + _insert(q, data, false, callback); + }, + unshift: function (data, callback) { + _insert(q, data, true, callback); + }, + process: function () { + if (workers < q.concurrency && q.tasks.length) { + var task = q.tasks.shift(); + if (q.empty && q.tasks.length === 0) { + q.empty(); + } + workers += 1; + var next = function () { + workers -= 1; + if (task.callback) { + task.callback.apply(task, arguments); + } + if (q.drain && q.tasks.length + workers === 0) { + q.drain(); + } + q.process(); + }; + var cb = only_once(next); + worker(task.data, cb); + } + }, + length: function () { + return q.tasks.length; + }, + running: function () { + return workers; + } + }; + return q; + }; + + async.cargo = function (worker, payload) { + var working = false, + tasks = []; + + var cargo = { + tasks: tasks, + payload: payload, + saturated: null, + empty: null, + drain: null, + push: function (data, callback) { + if(data.constructor !== Array) { + data = [data]; + } + _each(data, function(task) { + tasks.push({ + data: task, + callback: typeof callback === 'function' ? callback : null + }); + if (cargo.saturated && tasks.length === payload) { + cargo.saturated(); + } + }); + async.setImmediate(cargo.process); + }, + process: function process() { + if (working) return; + if (tasks.length === 0) { + if(cargo.drain) cargo.drain(); + return; + } + + var ts = typeof payload === 'number' + ? tasks.splice(0, payload) + : tasks.splice(0); + + var ds = _map(ts, function (task) { + return task.data; + }); + + if(cargo.empty) cargo.empty(); + working = true; + worker(ds, function () { + working = false; + + var args = arguments; + _each(ts, function (data) { + if (data.callback) { + data.callback.apply(null, args); + } + }); + + process(); + }); + }, + length: function () { + return tasks.length; + }, + running: function () { + return working; + } + }; + return cargo; + }; + + var _console_fn = function (name) { + return function (fn) { + var args = Array.prototype.slice.call(arguments, 1); + fn.apply(null, args.concat([function (err) { + var args = Array.prototype.slice.call(arguments, 1); + if (typeof console !== 'undefined') { + if (err) { + if (console.error) { + console.error(err); + } + } + else if (console[name]) { + _each(args, function (x) { + console[name](x); + }); + } + } + }])); + }; + }; + async.log = _console_fn('log'); + async.dir = _console_fn('dir'); + /*async.info = _console_fn('info'); + async.warn = _console_fn('warn'); + async.error = _console_fn('error');*/ + + async.memoize = function (fn, hasher) { + var memo = {}; + var queues = {}; + hasher = hasher || function (x) { + return x; + }; + var memoized = function () { + var args = Array.prototype.slice.call(arguments); + var callback = args.pop(); + var key = hasher.apply(null, args); + if (key in memo) { + callback.apply(null, memo[key]); + } + else if (key in queues) { + queues[key].push(callback); + } + else { + queues[key] = [callback]; + fn.apply(null, args.concat([function () { + memo[key] = arguments; + var q = queues[key]; + delete queues[key]; + for (var i = 0, l = q.length; i < l; i++) { + q[i].apply(null, arguments); + } + }])); + } + }; + memoized.memo = memo; + memoized.unmemoized = fn; + return memoized; + }; + + async.unmemoize = function (fn) { + return function () { + return (fn.unmemoized || fn).apply(null, arguments); + }; + }; + + async.times = function (count, iterator, callback) { + var counter = []; + for (var i = 0; i < count; i++) { + counter.push(i); + } + return async.map(counter, iterator, callback); + }; + + async.timesSeries = function (count, iterator, callback) { + var counter = []; + for (var i = 0; i < count; i++) { + counter.push(i); + } + return async.mapSeries(counter, iterator, callback); + }; + + async.compose = function (/* functions... */) { + var fns = Array.prototype.reverse.call(arguments); + return function () { + var that = this; + var args = Array.prototype.slice.call(arguments); + var callback = args.pop(); + async.reduce(fns, args, function (newargs, fn, cb) { + fn.apply(that, newargs.concat([function () { + var err = arguments[0]; + var nextargs = Array.prototype.slice.call(arguments, 1); + cb(err, nextargs); + }])) + }, + function (err, results) { + callback.apply(that, [err].concat(results)); + }); + }; + }; + + var _applyEach = function (eachfn, fns /*args...*/) { + var go = function () { + var that = this; + var args = Array.prototype.slice.call(arguments); + var callback = args.pop(); + return eachfn(fns, function (fn, cb) { + fn.apply(that, args.concat([cb])); + }, + callback); + }; + if (arguments.length > 2) { + var args = Array.prototype.slice.call(arguments, 2); + return go.apply(this, args); + } + else { + return go; + } + }; + async.applyEach = doParallel(_applyEach); + async.applyEachSeries = doSeries(_applyEach); + + async.forever = function (fn, callback) { + function next(err) { + if (err) { + if (callback) { + return callback(err); + } + throw err; + } + fn(next); + } + next(); + }; + + // AMD / RequireJS + if (typeof define !== 'undefined' && define.amd) { + define([], function () { + return async; + }); + } + // Node.js + else if (typeof module !== 'undefined' && module.exports) { + module.exports = async; + } + // included directly via \n```\n\nOr in node.js:\n\n```\nnpm install node-uuid\n```\n\n```javascript\nvar uuid = require('node-uuid');\n```\n\nThen create some ids ...\n\n```javascript\n// Generate a v1 (time-based) id\nuuid.v1(); // -> '6c84fb90-12c4-11e1-840d-7b25c5ee775a'\n\n// Generate a v4 (random) id\nuuid.v4(); // -> '110ec58a-a0f2-4ac4-8393-c866d813b8d1'\n```\n\n## API\n\n### uuid.v1([`options` [, `buffer` [, `offset`]]])\n\nGenerate and return a RFC4122 v1 (timestamp-based) UUID.\n\n* `options` - (Object) Optional uuid state to apply. Properties may include:\n\n * `node` - (Array) Node id as Array of 6 bytes (per 4.1.6). Default: Randomly generated ID. See note 1.\n * `clockseq` - (Number between 0 - 0x3fff) RFC clock sequence. Default: An internally maintained clockseq is used.\n * `msecs` - (Number | Date) Time in milliseconds since unix Epoch. Default: The current time is used.\n * `nsecs` - (Number between 0-9999) additional time, in 100-nanosecond units. Ignored if `msecs` is unspecified. Default: internal uuid counter is used, as per 4.2.1.2.\n\n* `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written.\n* `offset` - (Number) Starting index in `buffer` at which to begin writing.\n\nReturns `buffer`, if specified, otherwise the string form of the UUID\n\nNotes:\n\n1. The randomly generated node id is only guaranteed to stay constant for the lifetime of the current JS runtime. (Future versions of this module may use persistent storage mechanisms to extend this guarantee.)\n\nExample: Generate string UUID with fully-specified options\n\n```javascript\nuuid.v1({\n node: [0x01, 0x23, 0x45, 0x67, 0x89, 0xab],\n clockseq: 0x1234,\n msecs: new Date('2011-11-01').getTime(),\n nsecs: 5678\n}); // -> \"710b962e-041c-11e1-9234-0123456789ab\"\n```\n\nExample: In-place generation of two binary IDs\n\n```javascript\n// Generate two ids in an array\nvar arr = new Array(32); // -> []\nuuid.v1(null, arr, 0); // -> [02 a2 ce 90 14 32 11 e1 85 58 0b 48 8e 4f c1 15]\nuuid.v1(null, arr, 16); // -> [02 a2 ce 90 14 32 11 e1 85 58 0b 48 8e 4f c1 15 02 a3 1c b0 14 32 11 e1 85 58 0b 48 8e 4f c1 15]\n\n// Optionally use uuid.unparse() to get stringify the ids\nuuid.unparse(buffer); // -> '02a2ce90-1432-11e1-8558-0b488e4fc115'\nuuid.unparse(buffer, 16) // -> '02a31cb0-1432-11e1-8558-0b488e4fc115'\n```\n\n### uuid.v4([`options` [, `buffer` [, `offset`]]])\n\nGenerate and return a RFC4122 v4 UUID.\n\n* `options` - (Object) Optional uuid state to apply. Properties may include:\n\n * `random` - (Number[16]) Array of 16 numbers (0-255) to use in place of randomly generated values\n * `rng` - (Function) Random # generator to use. Set to one of the built-in generators - `uuid.mathRNG` (all platforms), `uuid.nodeRNG` (node.js only), `uuid.whatwgRNG` (WebKit only) - or a custom function that returns an array[16] of byte values.\n\n* `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written.\n* `offset` - (Number) Starting index in `buffer` at which to begin writing.\n\nReturns `buffer`, if specified, otherwise the string form of the UUID\n\nExample: Generate string UUID with fully-specified options\n\n```javascript\nuuid.v4({\n random: [\n 0x10, 0x91, 0x56, 0xbe, 0xc4, 0xfb, 0xc1, 0xea,\n 0x71, 0xb4, 0xef, 0xe1, 0x67, 0x1c, 0x58, 0x36\n ]\n});\n// -> \"109156be-c4fb-41ea-b1b4-efe1671c5836\"\n```\n\nExample: Generate two IDs in a single buffer\n\n```javascript\nvar buffer = new Array(32); // (or 'new Buffer' in node.js)\nuuid.v4(null, buffer, 0);\nuuid.v4(null, buffer, 16);\n```\n\n### uuid.parse(id[, buffer[, offset]])\n### uuid.unparse(buffer[, offset])\n\nParse and unparse UUIDs\n\n * `id` - (String) UUID(-like) string\n * `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written. Default: A new Array or Buffer is used\n * `offset` - (Number) Starting index in `buffer` at which to begin writing. Default: 0\n\nExample parsing and unparsing a UUID string\n\n```javascript\nvar bytes = uuid.parse('797ff043-11eb-11e1-80d6-510998755d10'); // -> \nvar string = uuid.unparse(bytes); // -> '797ff043-11eb-11e1-80d6-510998755d10'\n```\n\n### uuid.noConflict()\n\n(Browsers only) Set `uuid` property back to it's previous value.\n\nReturns the node-uuid object.\n\nExample:\n\n```javascript\nvar myUuid = uuid.noConflict();\nmyUuid.v1(); // -> '6c84fb90-12c4-11e1-840d-7b25c5ee775a'\n```\n\n## Deprecated APIs\n\nSupport for the following v1.2 APIs is available in v1.3, but is deprecated and will be removed in the next major version.\n\n### uuid([format [, buffer [, offset]]])\n\nuuid() has become uuid.v4(), and the `format` argument is now implicit in the `buffer` argument. (i.e. if you specify a buffer, the format is assumed to be binary).\n\n### uuid.BufferClass\n\nThe class of container created when generating binary uuid data if no buffer argument is specified. This is expected to go away, with no replacement API.\n\n## Testing\n\nIn node.js\n\n```\n> cd test\n> node test.js\n```\n\nIn Browser\n\n```\nopen test/test.html\n```\n\n### Benchmarking\n\nRequires node.js\n\n```\nnpm install uuid uuid-js\nnode benchmark/benchmark.js\n```\n\nFor a more complete discussion of node-uuid performance, please see the `benchmark/README.md` file, and the [benchmark wiki](https://github.com/broofa/node-uuid/wiki/Benchmark)\n\nFor browser performance [checkout the JSPerf tests](http://jsperf.com/node-uuid-performance).\n\n## Release notes\n\n### 1.4.0\n\n* Improved module context detection\n* Removed public RNG functions\n\n### 1.3.2\n\n* Improve tests and handling of v1() options (Issue #24)\n* Expose RNG option to allow for perf testing with different generators\n\n### 1.3.0\n\n* Support for version 1 ids, thanks to [@ctavan](https://github.com/ctavan)!\n* Support for node.js crypto API\n* De-emphasizing performance in favor of a) cryptographic quality PRNGs where available and b) more manageable code\n", + "readmeFilename": "README.md", + "bugs": { + "url": "https://github.com/broofa/node-uuid/issues" + }, + "_id": "node-uuid@1.4.1", + "dist": { + "shasum": "39aef510e5889a3dca9c895b506c73aae1bac048", + "tarball": "http://registry.npmjs.org/node-uuid/-/node-uuid-1.4.1.tgz" + }, + "_from": "node-uuid@1.4.1", + "_npmVersion": "1.3.6", + "_npmUser": { + "name": "broofa", + "email": "robert@broofa.com" + }, + "maintainers": [ + { + "name": "broofa", + "email": "robert@broofa.com" + } + ], + "directories": {}, + "_shasum": "39aef510e5889a3dca9c895b506c73aae1bac048", + "_resolved": "https://registry.npmjs.org/node-uuid/-/node-uuid-1.4.1.tgz", + "homepage": "https://github.com/broofa/node-uuid", + "scripts": {} +} diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/node-uuid/uuid.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/node-uuid/uuid.js new file mode 100644 index 0000000..2fac6dc --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/node-uuid/uuid.js @@ -0,0 +1,245 @@ +// uuid.js +// +// Copyright (c) 2010-2012 Robert Kieffer +// MIT License - http://opensource.org/licenses/mit-license.php + +(function() { + var _global = this; + + // Unique ID creation requires a high quality random # generator. We feature + // detect to determine the best RNG source, normalizing to a function that + // returns 128-bits of randomness, since that's what's usually required + var _rng; + + // Node.js crypto-based RNG - http://nodejs.org/docs/v0.6.2/api/crypto.html + // + // Moderately fast, high quality + if (typeof(require) == 'function') { + try { + var _rb = require('crypto').randomBytes; + _rng = _rb && function() {return _rb(16);}; + } catch(e) {} + } + + if (!_rng && _global.crypto && crypto.getRandomValues) { + // WHATWG crypto-based RNG - http://wiki.whatwg.org/wiki/Crypto + // + // Moderately fast, high quality + var _rnds8 = new Uint8Array(16); + _rng = function whatwgRNG() { + crypto.getRandomValues(_rnds8); + return _rnds8; + }; + } + + if (!_rng) { + // Math.random()-based (RNG) + // + // If all else fails, use Math.random(). It's fast, but is of unspecified + // quality. + var _rnds = new Array(16); + _rng = function() { + for (var i = 0, r; i < 16; i++) { + if ((i & 0x03) === 0) r = Math.random() * 0x100000000; + _rnds[i] = r >>> ((i & 0x03) << 3) & 0xff; + } + + return _rnds; + }; + } + + // Buffer class to use + var BufferClass = typeof(Buffer) == 'function' ? Buffer : Array; + + // Maps for number <-> hex string conversion + var _byteToHex = []; + var _hexToByte = {}; + for (var i = 0; i < 256; i++) { + _byteToHex[i] = (i + 0x100).toString(16).substr(1); + _hexToByte[_byteToHex[i]] = i; + } + + // **`parse()` - Parse a UUID into it's component bytes** + function parse(s, buf, offset) { + var i = (buf && offset) || 0, ii = 0; + + buf = buf || []; + s.toLowerCase().replace(/[0-9a-f]{2}/g, function(oct) { + if (ii < 16) { // Don't overflow! + buf[i + ii++] = _hexToByte[oct]; + } + }); + + // Zero out remaining bytes if string was short + while (ii < 16) { + buf[i + ii++] = 0; + } + + return buf; + } + + // **`unparse()` - Convert UUID byte array (ala parse()) into a string** + function unparse(buf, offset) { + var i = offset || 0, bth = _byteToHex; + return bth[buf[i++]] + bth[buf[i++]] + + bth[buf[i++]] + bth[buf[i++]] + '-' + + bth[buf[i++]] + bth[buf[i++]] + '-' + + bth[buf[i++]] + bth[buf[i++]] + '-' + + bth[buf[i++]] + bth[buf[i++]] + '-' + + bth[buf[i++]] + bth[buf[i++]] + + bth[buf[i++]] + bth[buf[i++]] + + bth[buf[i++]] + bth[buf[i++]]; + } + + // **`v1()` - Generate time-based UUID** + // + // Inspired by https://github.com/LiosK/UUID.js + // and http://docs.python.org/library/uuid.html + + // random #'s we need to init node and clockseq + var _seedBytes = _rng(); + + // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1) + var _nodeId = [ + _seedBytes[0] | 0x01, + _seedBytes[1], _seedBytes[2], _seedBytes[3], _seedBytes[4], _seedBytes[5] + ]; + + // Per 4.2.2, randomize (14 bit) clockseq + var _clockseq = (_seedBytes[6] << 8 | _seedBytes[7]) & 0x3fff; + + // Previous uuid creation time + var _lastMSecs = 0, _lastNSecs = 0; + + // See https://github.com/broofa/node-uuid for API details + function v1(options, buf, offset) { + var i = buf && offset || 0; + var b = buf || []; + + options = options || {}; + + var clockseq = options.clockseq != null ? options.clockseq : _clockseq; + + // UUID timestamps are 100 nano-second units since the Gregorian epoch, + // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so + // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs' + // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00. + var msecs = options.msecs != null ? options.msecs : new Date().getTime(); + + // Per 4.2.1.2, use count of uuid's generated during the current clock + // cycle to simulate higher resolution clock + var nsecs = options.nsecs != null ? options.nsecs : _lastNSecs + 1; + + // Time since last uuid creation (in msecs) + var dt = (msecs - _lastMSecs) + (nsecs - _lastNSecs)/10000; + + // Per 4.2.1.2, Bump clockseq on clock regression + if (dt < 0 && options.clockseq == null) { + clockseq = clockseq + 1 & 0x3fff; + } + + // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new + // time interval + if ((dt < 0 || msecs > _lastMSecs) && options.nsecs == null) { + nsecs = 0; + } + + // Per 4.2.1.2 Throw error if too many uuids are requested + if (nsecs >= 10000) { + throw new Error('uuid.v1(): Can\'t create more than 10M uuids/sec'); + } + + _lastMSecs = msecs; + _lastNSecs = nsecs; + _clockseq = clockseq; + + // Per 4.1.4 - Convert from unix epoch to Gregorian epoch + msecs += 12219292800000; + + // `time_low` + var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000; + b[i++] = tl >>> 24 & 0xff; + b[i++] = tl >>> 16 & 0xff; + b[i++] = tl >>> 8 & 0xff; + b[i++] = tl & 0xff; + + // `time_mid` + var tmh = (msecs / 0x100000000 * 10000) & 0xfffffff; + b[i++] = tmh >>> 8 & 0xff; + b[i++] = tmh & 0xff; + + // `time_high_and_version` + b[i++] = tmh >>> 24 & 0xf | 0x10; // include version + b[i++] = tmh >>> 16 & 0xff; + + // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant) + b[i++] = clockseq >>> 8 | 0x80; + + // `clock_seq_low` + b[i++] = clockseq & 0xff; + + // `node` + var node = options.node || _nodeId; + for (var n = 0; n < 6; n++) { + b[i + n] = node[n]; + } + + return buf ? buf : unparse(b); + } + + // **`v4()` - Generate random UUID** + + // See https://github.com/broofa/node-uuid for API details + function v4(options, buf, offset) { + // Deprecated - 'format' argument, as supported in v1.2 + var i = buf && offset || 0; + + if (typeof(options) == 'string') { + buf = options == 'binary' ? new BufferClass(16) : null; + options = null; + } + options = options || {}; + + var rnds = options.random || (options.rng || _rng)(); + + // Per 4.4, set bits for version and `clock_seq_hi_and_reserved` + rnds[6] = (rnds[6] & 0x0f) | 0x40; + rnds[8] = (rnds[8] & 0x3f) | 0x80; + + // Copy bytes to buffer, if provided + if (buf) { + for (var ii = 0; ii < 16; ii++) { + buf[i + ii] = rnds[ii]; + } + } + + return buf || unparse(rnds); + } + + // Export public API + var uuid = v4; + uuid.v1 = v1; + uuid.v4 = v4; + uuid.parse = parse; + uuid.unparse = unparse; + uuid.BufferClass = BufferClass; + + if (typeof define === 'function' && define.amd) { + // Publish as AMD module + define(function() {return uuid;}); + } else if (typeof(module) != 'undefined' && module.exports) { + // Publish as node.js module + module.exports = uuid; + } else { + // Publish as global (in browsers) + var _previousRoot = _global.uuid; + + // **`noConflict()` - (browser only) to reset global 'uuid' var** + uuid.noConflict = function() { + _global.uuid = _previousRoot; + return uuid; + }; + + _global.uuid = uuid; + } +}).call(this); diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/nopt/bin/nopt.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/nopt/bin/nopt.js new file mode 100644 index 0000000..3232d4c --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/nopt/bin/nopt.js @@ -0,0 +1,54 @@ +#!/usr/bin/env node +var nopt = require("../lib/nopt") + , path = require("path") + , types = { num: Number + , bool: Boolean + , help: Boolean + , list: Array + , "num-list": [Number, Array] + , "str-list": [String, Array] + , "bool-list": [Boolean, Array] + , str: String + , clear: Boolean + , config: Boolean + , length: Number + , file: path + } + , shorthands = { s: [ "--str", "astring" ] + , b: [ "--bool" ] + , nb: [ "--no-bool" ] + , tft: [ "--bool-list", "--no-bool-list", "--bool-list", "true" ] + , "?": ["--help"] + , h: ["--help"] + , H: ["--help"] + , n: [ "--num", "125" ] + , c: ["--config"] + , l: ["--length"] + , f: ["--file"] + } + , parsed = nopt( types + , shorthands + , process.argv + , 2 ) + +console.log("parsed", parsed) + +if (parsed.help) { + console.log("") + console.log("nopt cli tester") + console.log("") + console.log("types") + console.log(Object.keys(types).map(function M (t) { + var type = types[t] + if (Array.isArray(type)) { + return [t, type.map(function (type) { return type.name })] + } + return [t, type && type.name] + }).reduce(function (s, i) { + s[i[0]] = i[1] + return s + }, {})) + console.log("") + console.log("shorthands") + console.log(shorthands) +} diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/nopt/lib/nopt.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/nopt/lib/nopt.js new file mode 100644 index 0000000..5309a00 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/nopt/lib/nopt.js @@ -0,0 +1,414 @@ +// info about each config option. + +var debug = process.env.DEBUG_NOPT || process.env.NOPT_DEBUG + ? function () { console.error.apply(console, arguments) } + : function () {} + +var url = require("url") + , path = require("path") + , Stream = require("stream").Stream + , abbrev = require("abbrev") + +module.exports = exports = nopt +exports.clean = clean + +exports.typeDefs = + { String : { type: String, validate: validateString } + , Boolean : { type: Boolean, validate: validateBoolean } + , url : { type: url, validate: validateUrl } + , Number : { type: Number, validate: validateNumber } + , path : { type: path, validate: validatePath } + , Stream : { type: Stream, validate: validateStream } + , Date : { type: Date, validate: validateDate } + } + +function nopt (types, shorthands, args, slice) { + args = args || process.argv + types = types || {} + shorthands = shorthands || {} + if (typeof slice !== "number") slice = 2 + + debug(types, shorthands, args, slice) + + args = args.slice(slice) + var data = {} + , key + , remain = [] + , cooked = args + , original = args.slice(0) + + parse(args, data, remain, types, shorthands) + // now data is full + clean(data, types, exports.typeDefs) + data.argv = {remain:remain,cooked:cooked,original:original} + Object.defineProperty(data.argv, 'toString', { value: function () { + return this.original.map(JSON.stringify).join(" ") + }, enumerable: false }) + return data +} + +function clean (data, types, typeDefs) { + typeDefs = typeDefs || exports.typeDefs + var remove = {} + , typeDefault = [false, true, null, String, Array] + + Object.keys(data).forEach(function (k) { + if (k === "argv") return + var val = data[k] + , isArray = Array.isArray(val) + , type = types[k] + if (!isArray) val = [val] + if (!type) type = typeDefault + if (type === Array) type = typeDefault.concat(Array) + if (!Array.isArray(type)) type = [type] + + debug("val=%j", val) + debug("types=", type) + val = val.map(function (val) { + // if it's an unknown value, then parse false/true/null/numbers/dates + if (typeof val === "string") { + debug("string %j", val) + val = val.trim() + if ((val === "null" && ~type.indexOf(null)) + || (val === "true" && + (~type.indexOf(true) || ~type.indexOf(Boolean))) + || (val === "false" && + (~type.indexOf(false) || ~type.indexOf(Boolean)))) { + val = JSON.parse(val) + debug("jsonable %j", val) + } else if (~type.indexOf(Number) && !isNaN(val)) { + debug("convert to number", val) + val = +val + } else if (~type.indexOf(Date) && !isNaN(Date.parse(val))) { + debug("convert to date", val) + val = new Date(val) + } + } + + if (!types.hasOwnProperty(k)) { + return val + } + + // allow `--no-blah` to set 'blah' to null if null is allowed + if (val === false && ~type.indexOf(null) && + !(~type.indexOf(false) || ~type.indexOf(Boolean))) { + val = null + } + + var d = {} + d[k] = val + debug("prevalidated val", d, val, types[k]) + if (!validate(d, k, val, types[k], typeDefs)) { + if (exports.invalidHandler) { + exports.invalidHandler(k, val, types[k], data) + } else if (exports.invalidHandler !== false) { + debug("invalid: "+k+"="+val, types[k]) + } + return remove + } + debug("validated val", d, val, types[k]) + return d[k] + }).filter(function (val) { return val !== remove }) + + if (!val.length) delete data[k] + else if (isArray) { + debug(isArray, data[k], val) + data[k] = val + } else data[k] = val[0] + + debug("k=%s val=%j", k, val, data[k]) + }) +} + +function validateString (data, k, val) { + data[k] = String(val) +} + +function validatePath (data, k, val) { + if (val === true) return false + if (val === null) return true + + val = String(val) + var homePattern = process.platform === 'win32' ? /^~(\/|\\)/ : /^~\// + if (val.match(homePattern) && process.env.HOME) { + val = path.resolve(process.env.HOME, val.substr(2)) + } + data[k] = path.resolve(String(val)) + return true +} + +function validateNumber (data, k, val) { + debug("validate Number %j %j %j", k, val, isNaN(val)) + if (isNaN(val)) return false + data[k] = +val +} + +function validateDate (data, k, val) { + debug("validate Date %j %j %j", k, val, Date.parse(val)) + var s = Date.parse(val) + if (isNaN(s)) return false + data[k] = new Date(val) +} + +function validateBoolean (data, k, val) { + if (val instanceof Boolean) val = val.valueOf() + else if (typeof val === "string") { + if (!isNaN(val)) val = !!(+val) + else if (val === "null" || val === "false") val = false + else val = true + } else val = !!val + data[k] = val +} + +function validateUrl (data, k, val) { + val = url.parse(String(val)) + if (!val.host) return false + data[k] = val.href +} + +function validateStream (data, k, val) { + if (!(val instanceof Stream)) return false + data[k] = val +} + +function validate (data, k, val, type, typeDefs) { + // arrays are lists of types. + if (Array.isArray(type)) { + for (var i = 0, l = type.length; i < l; i ++) { + if (type[i] === Array) continue + if (validate(data, k, val, type[i], typeDefs)) return true + } + delete data[k] + return false + } + + // an array of anything? + if (type === Array) return true + + // NaN is poisonous. Means that something is not allowed. + if (type !== type) { + debug("Poison NaN", k, val, type) + delete data[k] + return false + } + + // explicit list of values + if (val === type) { + debug("Explicitly allowed %j", val) + // if (isArray) (data[k] = data[k] || []).push(val) + // else data[k] = val + data[k] = val + return true + } + + // now go through the list of typeDefs, validate against each one. + var ok = false + , types = Object.keys(typeDefs) + for (var i = 0, l = types.length; i < l; i ++) { + debug("test type %j %j %j", k, val, types[i]) + var t = typeDefs[types[i]] + if (t && type === t.type) { + var d = {} + ok = false !== t.validate(d, k, val) + val = d[k] + if (ok) { + // if (isArray) (data[k] = data[k] || []).push(val) + // else data[k] = val + data[k] = val + break + } + } + } + debug("OK? %j (%j %j %j)", ok, k, val, types[i]) + + if (!ok) delete data[k] + return ok +} + +function parse (args, data, remain, types, shorthands) { + debug("parse", args, data, remain) + + var key = null + , abbrevs = abbrev(Object.keys(types)) + , shortAbbr = abbrev(Object.keys(shorthands)) + + for (var i = 0; i < args.length; i ++) { + var arg = args[i] + debug("arg", arg) + + if (arg.match(/^-{2,}$/)) { + // done with keys. + // the rest are args. + remain.push.apply(remain, args.slice(i + 1)) + args[i] = "--" + break + } + var hadEq = false + if (arg.charAt(0) === "-" && arg.length > 1) { + if (arg.indexOf("=") !== -1) { + hadEq = true + var v = arg.split("=") + arg = v.shift() + v = v.join("=") + args.splice.apply(args, [i, 1].concat([arg, v])) + } + + // see if it's a shorthand + // if so, splice and back up to re-parse it. + var shRes = resolveShort(arg, shorthands, shortAbbr, abbrevs) + debug("arg=%j shRes=%j", arg, shRes) + if (shRes) { + debug(arg, shRes) + args.splice.apply(args, [i, 1].concat(shRes)) + if (arg !== shRes[0]) { + i -- + continue + } + } + arg = arg.replace(/^-+/, "") + var no = null + while (arg.toLowerCase().indexOf("no-") === 0) { + no = !no + arg = arg.substr(3) + } + + if (abbrevs[arg]) arg = abbrevs[arg] + + var isArray = types[arg] === Array || + Array.isArray(types[arg]) && types[arg].indexOf(Array) !== -1 + + // allow unknown things to be arrays if specified multiple times. + if (!types.hasOwnProperty(arg) && data.hasOwnProperty(arg)) { + if (!Array.isArray(data[arg])) + data[arg] = [data[arg]] + isArray = true + } + + var val + , la = args[i + 1] + + var isBool = typeof no === 'boolean' || + types[arg] === Boolean || + Array.isArray(types[arg]) && types[arg].indexOf(Boolean) !== -1 || + (typeof types[arg] === 'undefined' && !hadEq) || + (la === "false" && + (types[arg] === null || + Array.isArray(types[arg]) && ~types[arg].indexOf(null))) + + if (isBool) { + // just set and move along + val = !no + // however, also support --bool true or --bool false + if (la === "true" || la === "false") { + val = JSON.parse(la) + la = null + if (no) val = !val + i ++ + } + + // also support "foo":[Boolean, "bar"] and "--foo bar" + if (Array.isArray(types[arg]) && la) { + if (~types[arg].indexOf(la)) { + // an explicit type + val = la + i ++ + } else if ( la === "null" && ~types[arg].indexOf(null) ) { + // null allowed + val = null + i ++ + } else if ( !la.match(/^-{2,}[^-]/) && + !isNaN(la) && + ~types[arg].indexOf(Number) ) { + // number + val = +la + i ++ + } else if ( !la.match(/^-[^-]/) && ~types[arg].indexOf(String) ) { + // string + val = la + i ++ + } + } + + if (isArray) (data[arg] = data[arg] || []).push(val) + else data[arg] = val + + continue + } + + if (types[arg] === String && la === undefined) + la = "" + + if (la && la.match(/^-{2,}$/)) { + la = undefined + i -- + } + + val = la === undefined ? true : la + if (isArray) (data[arg] = data[arg] || []).push(val) + else data[arg] = val + + i ++ + continue + } + remain.push(arg) + } +} + +function resolveShort (arg, shorthands, shortAbbr, abbrevs) { + // handle single-char shorthands glommed together, like + // npm ls -glp, but only if there is one dash, and only if + // all of the chars are single-char shorthands, and it's + // not a match to some other abbrev. + arg = arg.replace(/^-+/, '') + + // if it's an exact known option, then don't go any further + if (abbrevs[arg] === arg) + return null + + // if it's an exact known shortopt, same deal + if (shorthands[arg]) { + // make it an array, if it's a list of words + if (shorthands[arg] && !Array.isArray(shorthands[arg])) + shorthands[arg] = shorthands[arg].split(/\s+/) + + return shorthands[arg] + } + + // first check to see if this arg is a set of single-char shorthands + var singles = shorthands.___singles + if (!singles) { + singles = Object.keys(shorthands).filter(function (s) { + return s.length === 1 + }).reduce(function (l,r) { + l[r] = true + return l + }, {}) + shorthands.___singles = singles + debug('shorthand singles', singles) + } + + var chrs = arg.split("").filter(function (c) { + return singles[c] + }) + + if (chrs.join("") === arg) return chrs.map(function (c) { + return shorthands[c] + }).reduce(function (l, r) { + return l.concat(r) + }, []) + + + // if it's an arg abbrev, and not a literal shorthand, then prefer the arg + if (abbrevs[arg] && !shorthands[arg]) + return null + + // if it's an abbr for a shorthand, then use that + if (shortAbbr[arg]) + arg = shortAbbr[arg] + + // make it an array, if it's a list of words + if (shorthands[arg] && !Array.isArray(shorthands[arg])) + shorthands[arg] = shorthands[arg].split(/\s+/) + + return shorthands[arg] +} diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/nopt/package.json b/packages/Bower.1.3.11/node_modules/bower/node_modules/nopt/package.json new file mode 100644 index 0000000..f3a0a4e --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/nopt/package.json @@ -0,0 +1,39 @@ +{ + "name": "nopt", + "version": "3.0.1", + "description": "Option parsing for Node, supporting types, shorthands, etc. Used by npm.", + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "main": "lib/nopt.js", + "scripts": { + "test": "tap test/*.js" + }, + "repository": { + "type": "git", + "url": "http://github.com/isaacs/nopt" + }, + "bin": { + "nopt": "./bin/nopt.js" + }, + "license": { + "type": "MIT", + "url": "https://github.com/isaacs/nopt/raw/master/LICENSE" + }, + "dependencies": { + "abbrev": "1" + }, + "devDependencies": { + "tap": "~0.4.8" + }, + "readme": "If you want to write an option parser, and have it be good, there are\ntwo ways to do it. The Right Way, and the Wrong Way.\n\nThe Wrong Way is to sit down and write an option parser. We've all done\nthat.\n\nThe Right Way is to write some complex configurable program with so many\noptions that you go half-insane just trying to manage them all, and put\nit off with duct-tape solutions until you see exactly to the core of the\nproblem, and finally snap and write an awesome option parser.\n\nIf you want to write an option parser, don't write an option parser.\nWrite a package manager, or a source control system, or a service\nrestarter, or an operating system. You probably won't end up with a\ngood one of those, but if you don't give up, and you are relentless and\ndiligent enough in your procrastination, you may just end up with a very\nnice option parser.\n\n## USAGE\n\n // my-program.js\n var nopt = require(\"nopt\")\n , Stream = require(\"stream\").Stream\n , path = require(\"path\")\n , knownOpts = { \"foo\" : [String, null]\n , \"bar\" : [Stream, Number]\n , \"baz\" : path\n , \"bloo\" : [ \"big\", \"medium\", \"small\" ]\n , \"flag\" : Boolean\n , \"pick\" : Boolean\n , \"many\" : [String, Array]\n }\n , shortHands = { \"foofoo\" : [\"--foo\", \"Mr. Foo\"]\n , \"b7\" : [\"--bar\", \"7\"]\n , \"m\" : [\"--bloo\", \"medium\"]\n , \"p\" : [\"--pick\"]\n , \"f\" : [\"--flag\"]\n }\n // everything is optional.\n // knownOpts and shorthands default to {}\n // arg list defaults to process.argv\n // slice defaults to 2\n , parsed = nopt(knownOpts, shortHands, process.argv, 2)\n console.log(parsed)\n\nThis would give you support for any of the following:\n\n```bash\n$ node my-program.js --foo \"blerp\" --no-flag\n{ \"foo\" : \"blerp\", \"flag\" : false }\n\n$ node my-program.js ---bar 7 --foo \"Mr. Hand\" --flag\n{ bar: 7, foo: \"Mr. Hand\", flag: true }\n\n$ node my-program.js --foo \"blerp\" -f -----p\n{ foo: \"blerp\", flag: true, pick: true }\n\n$ node my-program.js -fp --foofoo\n{ foo: \"Mr. Foo\", flag: true, pick: true }\n\n$ node my-program.js --foofoo -- -fp # -- stops the flag parsing.\n{ foo: \"Mr. Foo\", argv: { remain: [\"-fp\"] } }\n\n$ node my-program.js --blatzk -fp # unknown opts are ok.\n{ blatzk: true, flag: true, pick: true }\n\n$ node my-program.js --blatzk=1000 -fp # but you need to use = if they have a value\n{ blatzk: 1000, flag: true, pick: true }\n\n$ node my-program.js --no-blatzk -fp # unless they start with \"no-\"\n{ blatzk: false, flag: true, pick: true }\n\n$ node my-program.js --baz b/a/z # known paths are resolved.\n{ baz: \"/Users/isaacs/b/a/z\" }\n\n# if Array is one of the types, then it can take many\n# values, and will always be an array. The other types provided\n# specify what types are allowed in the list.\n\n$ node my-program.js --many 1 --many null --many foo\n{ many: [\"1\", \"null\", \"foo\"] }\n\n$ node my-program.js --many foo\n{ many: [\"foo\"] }\n```\n\nRead the tests at the bottom of `lib/nopt.js` for more examples of\nwhat this puppy can do.\n\n## Types\n\nThe following types are supported, and defined on `nopt.typeDefs`\n\n* String: A normal string. No parsing is done.\n* path: A file system path. Gets resolved against cwd if not absolute.\n* url: A url. If it doesn't parse, it isn't accepted.\n* Number: Must be numeric.\n* Date: Must parse as a date. If it does, and `Date` is one of the options,\n then it will return a Date object, not a string.\n* Boolean: Must be either `true` or `false`. If an option is a boolean,\n then it does not need a value, and its presence will imply `true` as\n the value. To negate boolean flags, do `--no-whatever` or `--whatever\n false`\n* NaN: Means that the option is strictly not allowed. Any value will\n fail.\n* Stream: An object matching the \"Stream\" class in node. Valuable\n for use when validating programmatically. (npm uses this to let you\n supply any WriteStream on the `outfd` and `logfd` config options.)\n* Array: If `Array` is specified as one of the types, then the value\n will be parsed as a list of options. This means that multiple values\n can be specified, and that the value will always be an array.\n\nIf a type is an array of values not on this list, then those are\nconsidered valid values. For instance, in the example above, the\n`--bloo` option can only be one of `\"big\"`, `\"medium\"`, or `\"small\"`,\nand any other value will be rejected.\n\nWhen parsing unknown fields, `\"true\"`, `\"false\"`, and `\"null\"` will be\ninterpreted as their JavaScript equivalents.\n\nYou can also mix types and values, or multiple types, in a list. For\ninstance `{ blah: [Number, null] }` would allow a value to be set to\neither a Number or null. When types are ordered, this implies a\npreference, and the first type that can be used to properly interpret\nthe value will be used.\n\nTo define a new type, add it to `nopt.typeDefs`. Each item in that\nhash is an object with a `type` member and a `validate` method. The\n`type` member is an object that matches what goes in the type list. The\n`validate` method is a function that gets called with `validate(data,\nkey, val)`. Validate methods should assign `data[key]` to the valid\nvalue of `val` if it can be handled properly, or return boolean\n`false` if it cannot.\n\nYou can also call `nopt.clean(data, types, typeDefs)` to clean up a\nconfig object and remove its invalid properties.\n\n## Error Handling\n\nBy default, nopt outputs a warning to standard error when invalid\noptions are found. You can change this behavior by assigning a method\nto `nopt.invalidHandler`. This method will be called with\nthe offending `nopt.invalidHandler(key, val, types)`.\n\nIf no `nopt.invalidHandler` is assigned, then it will console.error\nits whining. If it is assigned to boolean `false` then the warning is\nsuppressed.\n\n## Abbreviations\n\nYes, they are supported. If you define options like this:\n\n```javascript\n{ \"foolhardyelephants\" : Boolean\n, \"pileofmonkeys\" : Boolean }\n```\n\nThen this will work:\n\n```bash\nnode program.js --foolhar --pil\nnode program.js --no-f --pileofmon\n# etc.\n```\n\n## Shorthands\n\nShorthands are a hash of shorter option names to a snippet of args that\nthey expand to.\n\nIf multiple one-character shorthands are all combined, and the\ncombination does not unambiguously match any other option or shorthand,\nthen they will be broken up into their constituent parts. For example:\n\n```json\n{ \"s\" : [\"--loglevel\", \"silent\"]\n, \"g\" : \"--global\"\n, \"f\" : \"--force\"\n, \"p\" : \"--parseable\"\n, \"l\" : \"--long\"\n}\n```\n\n```bash\nnpm ls -sgflp\n# just like doing this:\nnpm ls --loglevel silent --global --force --long --parseable\n```\n\n## The Rest of the args\n\nThe config object returned by nopt is given a special member called\n`argv`, which is an object with the following fields:\n\n* `remain`: The remaining args after all the parsing has occurred.\n* `original`: The args as they originally appeared.\n* `cooked`: The args after flags and shorthands are expanded.\n\n## Slicing\n\nNode programs are called with more or less the exact argv as it appears\nin C land, after the v8 and node-specific options have been plucked off.\nAs such, `argv[0]` is always `node` and `argv[1]` is always the\nJavaScript program being run.\n\nThat's usually not very useful to you. So they're sliced off by\ndefault. If you want them, then you can pass in `0` as the last\nargument, or any other number that you'd like to slice off the start of\nthe list.\n", + "readmeFilename": "README.md", + "bugs": { + "url": "https://github.com/isaacs/nopt/issues" + }, + "homepage": "https://github.com/isaacs/nopt", + "_id": "nopt@3.0.1", + "_from": "nopt@~3.0.0" +} diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/opn/cli.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/opn/cli.js new file mode 100644 index 0000000..2bd7701 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/opn/cli.js @@ -0,0 +1,30 @@ +#!/usr/bin/env node +'use strict'; +var pkg = require('./package.json'); +var opn = require('./'); + +function help() { + console.log([ + pkg.description, + '', + 'Usage', + ' $ opn [app]', + '', + 'Example', + ' $ opn http://sindresorhus.com', + ' $ opn http://sindresorhus.com firefox', + ' $ opn unicorn.png' + ].join('\n')); +} + +if (process.argv.indexOf('--help') !== -1) { + help(); + return; +} + +if (process.argv.indexOf('--version') !== -1) { + console.log(pkg.version); + return; +} + +opn(process.argv[2], process.argv[3]); diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/opn/index.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/opn/index.js new file mode 100644 index 0000000..9e8a1dc --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/opn/index.js @@ -0,0 +1,53 @@ +'use strict'; +var path = require('path'); +var execFile = require('child_process').execFile; + +module.exports = function (target, app, cb) { + if (typeof target !== 'string') { + throw new Error('Expected a `target`'); + } + + if (typeof app === 'function') { + cb = app; + app = null; + } + + var cmd; + var args = []; + + if (process.platform === 'darwin') { + cmd = 'open'; + + if (cb) { + args.push('-W'); + } + + if (app) { + args.push('-a', app); + } + } else if (process.platform === 'win32') { + cmd = 'cmd'; + args.push('/c', 'start'); + target = target.replace(/&/g, '^&'); + + if (cb) { + args.push('/wait'); + } + + if (app) { + args.push(app); + } + } else { + if (app) { + cmd = app; + } else { + // http://portland.freedesktop.org/download/xdg-utils-1.1.0-rc1.tar.gz + cmd = path.join(__dirname, 'xdg-open'); + } + } + + args.push(target); + + // xdg-open will block the process unless stdio is ignored + execFile(cmd, args, {stdio: 'ignore'}, cb); +}; diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/opn/package.json b/packages/Bower.1.3.11/node_modules/bower/node_modules/opn/package.json new file mode 100644 index 0000000..477ddd2 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/opn/package.json @@ -0,0 +1,73 @@ +{ + "name": "opn", + "version": "1.0.0", + "description": "A better node-open. Opens stuff like websites, files, executables. Cross-platform.", + "license": "MIT", + "repository": { + "type": "git", + "url": "git://github.com/sindresorhus/opn" + }, + "bin": { + "opn": "cli.js" + }, + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "http://sindresorhus.com" + }, + "engines": { + "node": ">=0.10.0" + }, + "scripts": { + "test": "mocha" + }, + "files": [ + "cli.js", + "index.js", + "xdg-open" + ], + "keywords": [ + "cli", + "bin", + "app", + "open", + "opn", + "launch", + "start", + "xdg-open", + "default", + "cmd", + "browser", + "editor", + "executable" + ], + "devDependencies": { + "mocha": "*" + }, + "gitHead": "e29d05bebe51c41be5193de85c7e1d78236d386c", + "bugs": { + "url": "https://github.com/sindresorhus/opn/issues" + }, + "homepage": "https://github.com/sindresorhus/opn", + "_id": "opn@1.0.0", + "_shasum": "1baa822af649a45fca744179a29a8b4c19346574", + "_from": "opn@~1.0.0", + "_npmVersion": "1.4.14", + "_npmUser": { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + } + ], + "dist": { + "shasum": "1baa822af649a45fca744179a29a8b4c19346574", + "tarball": "http://registry.npmjs.org/opn/-/opn-1.0.0.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/opn/-/opn-1.0.0.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/opn/xdg-open b/packages/Bower.1.3.11/node_modules/bower/node_modules/opn/xdg-open new file mode 100644 index 0000000..b8db0aa --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/opn/xdg-open @@ -0,0 +1,557 @@ +#!/bin/sh +#--------------------------------------------- +# xdg-open +# +# Utility script to open a URL in the registered default application. +# +# Refer to the usage() function below for usage. +# +# Copyright 2009-2010, Fathi Boudra +# Copyright 2009-2010, Rex Dieter +# Copyright 2006, Kevin Krammer +# Copyright 2006, Jeremy White +# +# LICENSE: +# +# 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. +# +#--------------------------------------------- + +manualpage() +{ +cat << _MANUALPAGE +Name + +xdg-open - opens a file or URL in the user's preferred application + +Synopsis + +xdg-open { file | URL } + +xdg-open { --help | --manual | --version } + +Description + +xdg-open opens a file or URL in the user's preferred application. If a URL is +provided the URL will be opened in the user's preferred web browser. If a file +is provided the file will be opened in the preferred application for files of +that type. xdg-open supports file, ftp, http and https URLs. + +xdg-open is for use inside a desktop session only. It is not recommended to use +xdg-open as root. + +Options + +--help + Show command synopsis. +--manual + Show this manualpage. +--version + Show the xdg-utils version information. + +Exit Codes + +An exit code of 0 indicates success while a non-zero exit code indicates +failure. The following failure codes can be returned: + +1 + Error in command line syntax. +2 + One of the files passed on the command line did not exist. +3 + A required tool could not be found. +4 + The action failed. + +Examples + +xdg-open 'http://www.freedesktop.org/' + +Opens the Freedesktop.org website in the user's default browser + +xdg-open /tmp/foobar.png + +Opens the PNG image file /tmp/foobar.png in the user's default image viewing +application. + +_MANUALPAGE +} + +usage() +{ +cat << _USAGE +xdg-open - opens a file or URL in the user's preferred application + +Synopsis + +xdg-open { file | URL } + +xdg-open { --help | --manual | --version } + +_USAGE +} + +#@xdg-utils-common@ + +#---------------------------------------------------------------------------- +# Common utility functions included in all XDG wrapper scripts +#---------------------------------------------------------------------------- + +DEBUG() +{ + [ -z "${XDG_UTILS_DEBUG_LEVEL}" ] && return 0; + [ ${XDG_UTILS_DEBUG_LEVEL} -lt $1 ] && return 0; + shift + echo "$@" >&2 +} + +#------------------------------------------------------------- +# Exit script on successfully completing the desired operation + +exit_success() +{ + if [ $# -gt 0 ]; then + echo "$@" + echo + fi + + exit 0 +} + + +#----------------------------------------- +# Exit script on malformed arguments, not enough arguments +# or missing required option. +# prints usage information + +exit_failure_syntax() +{ + if [ $# -gt 0 ]; then + echo "xdg-open: $@" >&2 + echo "Try 'xdg-open --help' for more information." >&2 + else + usage + echo "Use 'man xdg-open' or 'xdg-open --manual' for additional info." + fi + + exit 1 +} + +#------------------------------------------------------------- +# Exit script on missing file specified on command line + +exit_failure_file_missing() +{ + if [ $# -gt 0 ]; then + echo "xdg-open: $@" >&2 + fi + + exit 2 +} + +#------------------------------------------------------------- +# Exit script on failure to locate necessary tool applications + +exit_failure_operation_impossible() +{ + if [ $# -gt 0 ]; then + echo "xdg-open: $@" >&2 + fi + + exit 3 +} + +#------------------------------------------------------------- +# Exit script on failure returned by a tool application + +exit_failure_operation_failed() +{ + if [ $# -gt 0 ]; then + echo "xdg-open: $@" >&2 + fi + + exit 4 +} + +#------------------------------------------------------------ +# Exit script on insufficient permission to read a specified file + +exit_failure_file_permission_read() +{ + if [ $# -gt 0 ]; then + echo "xdg-open: $@" >&2 + fi + + exit 5 +} + +#------------------------------------------------------------ +# Exit script on insufficient permission to write a specified file + +exit_failure_file_permission_write() +{ + if [ $# -gt 0 ]; then + echo "xdg-open: $@" >&2 + fi + + exit 6 +} + +check_input_file() +{ + if [ ! -e "$1" ]; then + exit_failure_file_missing "file '$1' does not exist" + fi + if [ ! -r "$1" ]; then + exit_failure_file_permission_read "no permission to read file '$1'" + fi +} + +check_vendor_prefix() +{ + file_label="$2" + [ -n "$file_label" ] || file_label="filename" + file=`basename "$1"` + case "$file" in + [a-zA-Z]*-*) + return + ;; + esac + + echo "xdg-open: $file_label '$file' does not have a proper vendor prefix" >&2 + echo 'A vendor prefix consists of alpha characters ([a-zA-Z]) and is terminated' >&2 + echo 'with a dash ("-"). An example '"$file_label"' is '"'example-$file'" >&2 + echo "Use --novendor to override or 'xdg-open --manual' for additional info." >&2 + exit 1 +} + +check_output_file() +{ + # if the file exists, check if it is writeable + # if it does not exists, check if we are allowed to write on the directory + if [ -e "$1" ]; then + if [ ! -w "$1" ]; then + exit_failure_file_permission_write "no permission to write to file '$1'" + fi + else + DIR=`dirname "$1"` + if [ ! -w "$DIR" -o ! -x "$DIR" ]; then + exit_failure_file_permission_write "no permission to create file '$1'" + fi + fi +} + +#---------------------------------------- +# Checks for shared commands, e.g. --help + +check_common_commands() +{ + while [ $# -gt 0 ] ; do + parm="$1" + shift + + case "$parm" in + --help) + usage + echo "Use 'man xdg-open' or 'xdg-open --manual' for additional info." + exit_success + ;; + + --manual) + manualpage + exit_success + ;; + + --version) + echo "xdg-open 1.0.2" + exit_success + ;; + esac + done +} + +check_common_commands "$@" + +[ -z "${XDG_UTILS_DEBUG_LEVEL}" ] && unset XDG_UTILS_DEBUG_LEVEL; +if [ ${XDG_UTILS_DEBUG_LEVEL-0} -lt 1 ]; then + # Be silent + xdg_redirect_output=" > /dev/null 2> /dev/null" +else + # All output to stderr + xdg_redirect_output=" >&2" +fi + +#-------------------------------------- +# Checks for known desktop environments +# set variable DE to the desktop environments name, lowercase + +detectDE() +{ + if [ x"$KDE_FULL_SESSION" = x"true" ]; then DE=kde; + elif [ x"$GNOME_DESKTOP_SESSION_ID" != x"" ]; then DE=gnome; + elif `dbus-send --print-reply --dest=org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus.GetNameOwner string:org.gnome.SessionManager > /dev/null 2>&1` ; then DE=gnome; + elif xprop -root _DT_SAVE_MODE 2> /dev/null | grep ' = \"xfce4\"$' >/dev/null 2>&1; then DE=xfce; + elif [ x"$DESKTOP_SESSION" == x"LXDE" ]; then DE=lxde; + else DE="" + fi +} + +#---------------------------------------------------------------------------- +# kfmclient exec/openURL can give bogus exit value in KDE <= 3.5.4 +# It also always returns 1 in KDE 3.4 and earlier +# Simply return 0 in such case + +kfmclient_fix_exit_code() +{ + version=`kde${KDE_SESSION_VERSION}-config --version 2>/dev/null | grep '^KDE'` + major=`echo $version | sed 's/KDE.*: \([0-9]\).*/\1/'` + minor=`echo $version | sed 's/KDE.*: [0-9]*\.\([0-9]\).*/\1/'` + release=`echo $version | sed 's/KDE.*: [0-9]*\.[0-9]*\.\([0-9]\).*/\1/'` + test "$major" -gt 3 && return $1 + test "$minor" -gt 5 && return $1 + test "$release" -gt 4 && return $1 + return 0 +} + +# This handles backslashes but not quote marks. +first_word() +{ + read first rest + echo "$first" +} + +open_kde() +{ + if kde-open -v 2>/dev/null 1>&2; then + kde-open "$1" + else + if [ x"$KDE_SESSION_VERSION" = x"4" ]; then + kfmclient openURL "$1" + else + kfmclient exec "$1" + kfmclient_fix_exit_code $? + fi + fi + + if [ $? -eq 0 ]; then + exit_success + else + exit_failure_operation_failed + fi +} + +open_gnome() +{ + if gvfs-open --help 2>/dev/null 1>&2; then + gvfs-open "$1" + else + gnome-open "$1" + fi + + if [ $? -eq 0 ]; then + exit_success + else + exit_failure_operation_failed + fi +} + +open_xfce() +{ + exo-open "$1" + + if [ $? -eq 0 ]; then + exit_success + else + exit_failure_operation_failed + fi +} + +open_generic_xdg_mime() +{ + filetype=`xdg-mime query filetype "$1" | sed "s/;.*//"` + default=`xdg-mime query default "$filetype"` + if [ -n "$default" ] ; then + xdg_user_dir="$XDG_DATA_HOME" + [ -n "$xdg_user_dir" ] || xdg_user_dir="$HOME/.local/share" + + xdg_system_dirs="$XDG_DATA_DIRS" + [ -n "$xdg_system_dirs" ] || xdg_system_dirs=/usr/local/share/:/usr/share/ + + for x in `echo "$xdg_user_dir:$xdg_system_dirs" | sed 's/:/ /g'`; do + local file="$x/applications/$default" + if [ -r "$file" ] ; then + command="`grep -E "^Exec(\[[^]=]*])?=" "$file" | cut -d= -f 2- | first_word`" + command_exec=`which $command 2>/dev/null` + if [ -x "$command_exec" ] ; then + $command_exec "$1" + if [ $? -eq 0 ]; then + exit_success + fi + fi + fi + done + fi +} + +open_generic() +{ + # Paths or file:// URLs + if (echo "$1" | grep -q '^file://' || + ! echo "$1" | egrep -q '^[a-zA-Z+\.\-]+:'); then + + local file="$1" + + # Decode URLs + if echo "$file" | grep -q '^file:///'; then + file=${file#file://} + file="$(printf "$(echo "$file" | sed -e 's@%\([a-f0-9A-F]\{2\}\)@\\x\1@g')")" + fi + check_input_file "$file" + + open_generic_xdg_mime "$file" + + if [ -f /etc/debian_version ] && + which run-mailcap 2>/dev/null 1>&2; then + run-mailcap --action=view "$file" + if [ $? -eq 0 ]; then + exit_success + fi + fi + + if mimeopen -v 2>/dev/null 1>&2; then + mimeopen -L -n "$file" + if [ $? -eq 0 ]; then + exit_success + fi + fi + fi + + IFS=":" + for browser in $BROWSER; do + if [ x"$browser" != x"" ]; then + + browser_with_arg=`printf "$browser" "$1" 2>/dev/null` + if [ $? -ne 0 ]; then + browser_with_arg=$browser; + fi + + if [ x"$browser_with_arg" = x"$browser" ]; then + "$browser" "$1"; + else eval '$browser_with_arg'$xdg_redirect_output; + fi + + if [ $? -eq 0 ]; then + exit_success; + fi + fi + done + + exit_failure_operation_impossible "no method available for opening '$1'" +} + +open_lxde() +{ + # pcmanfm only knows how to handle file:// urls and filepaths, it seems. + if (echo "$1" | grep -q '^file://' || + ! echo "$1" | egrep -q '^[a-zA-Z+\.\-]+:') + then + local file="$(echo "$1" | sed 's%^file://%%')" + + # handle relative paths + if ! echo "$file" | grep -q '^/'; then + file="$(pwd)/$file" + fi + + pcmanfm "$file" + + else + open_generic "$1" + fi + + if [ $? -eq 0 ]; then + exit_success + else + exit_failure_operation_failed + fi +} + +[ x"$1" != x"" ] || exit_failure_syntax + +url= +while [ $# -gt 0 ] ; do + parm="$1" + shift + + case "$parm" in + -*) + exit_failure_syntax "unexpected option '$parm'" + ;; + + *) + if [ -n "$url" ] ; then + exit_failure_syntax "unexpected argument '$parm'" + fi + url="$parm" + ;; + esac +done + +if [ -z "${url}" ] ; then + exit_failure_syntax "file or URL argument missing" +fi + +detectDE + +if [ x"$DE" = x"" ]; then + DE=generic +fi + +# if BROWSER variable is not set, check some well known browsers instead +if [ x"$BROWSER" = x"" ]; then + BROWSER=links2:links:lynx:w3m + if [ -n "$DISPLAY" ]; then + BROWSER=firefox:mozilla:epiphany:konqueror:chromium-browser:google-chrome:$BROWSER + fi +fi + +case "$DE" in + kde) + open_kde "$url" + ;; + + gnome) + open_gnome "$url" + ;; + + xfce) + open_xfce "$url" + ;; + + lxde) + open_lxde "$url" + ;; + + generic) + open_generic "$url" + ;; + + *) + exit_failure_operation_impossible "no method available for opening '$url'" + ;; +esac diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/osenv/osenv.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/osenv/osenv.js new file mode 100644 index 0000000..7836faf --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/osenv/osenv.js @@ -0,0 +1,73 @@ +var isWindows = process.platform === 'win32' +var path = require('path') +var exec = require('child_process').exec +var os = require('os') + +// looking up envs is a bit costly. +// Also, sometimes we want to have a fallback +// Pass in a callback to wait for the fallback on failures +// After the first lookup, always returns the same thing. +function memo (key, lookup, fallback) { + var fell = false + var falling = false + exports[key] = function (cb) { + var val = lookup() + if (!val && !fell && !falling && fallback) { + fell = true + falling = true + exec(fallback, function (er, output, stderr) { + falling = false + if (er) return // oh well, we tried + val = output.trim() + }) + } + exports[key] = function (cb) { + if (cb) process.nextTick(cb.bind(null, null, val)) + return val + } + if (cb && !falling) process.nextTick(cb.bind(null, null, val)) + return val + } +} + +memo('user', function () { + return ( isWindows + ? process.env.USERDOMAIN + '\\' + process.env.USERNAME + : process.env.USER + ) +}, 'whoami') + +memo('prompt', function () { + return isWindows ? process.env.PROMPT : process.env.PS1 +}) + +memo('hostname', function () { + return isWindows ? process.env.COMPUTERNAME : process.env.HOSTNAME +}, 'hostname') + +memo('tmpdir', function () { + return os.tmpDir() +}) + +memo('home', function () { + return ( isWindows ? process.env.USERPROFILE + : process.env.HOME + ) +}) + +memo('path', function () { + return (process.env.PATH || + process.env.Path || + process.env.path).split(isWindows ? ';' : ':') +}) + +memo('editor', function () { + return process.env.EDITOR || + process.env.VISUAL || + (isWindows ? 'notepad.exe' : 'vi') +}) + +memo('shell', function () { + return isWindows ? process.env.ComSpec || 'cmd' + : process.env.SHELL || 'bash' +}) diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/osenv/package.json b/packages/Bower.1.3.11/node_modules/bower/node_modules/osenv/package.json new file mode 100644 index 0000000..0a477b6 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/osenv/package.json @@ -0,0 +1,63 @@ +{ + "name": "osenv", + "version": "0.1.0", + "main": "osenv.js", + "directories": { + "test": "test" + }, + "dependencies": {}, + "devDependencies": { + "tap": "~0.4.9" + }, + "scripts": { + "test": "tap test/*.js" + }, + "repository": { + "type": "git", + "url": "git://github.com/isaacs/osenv" + }, + "keywords": [ + "environment", + "variable", + "home", + "tmpdir", + "path", + "prompt", + "ps1" + ], + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "license": "BSD", + "description": "Look up environment settings specific to different operating systems", + "bugs": { + "url": "https://github.com/isaacs/osenv/issues" + }, + "homepage": "https://github.com/isaacs/osenv", + "_id": "osenv@0.1.0", + "_shasum": "61668121eec584955030b9f470b1d2309504bfcb", + "_from": "osenv@~0.1.0", + "_npmVersion": "1.4.9", + "_npmUser": { + "name": "robertkowalski", + "email": "rok@kowalski.gd" + }, + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + }, + { + "name": "robertkowalski", + "email": "rok@kowalski.gd" + } + ], + "dist": { + "shasum": "61668121eec584955030b9f470b1d2309504bfcb", + "tarball": "http://registry.npmjs.org/osenv/-/osenv-0.1.0.tgz" + }, + "_resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.0.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/p-throttler/index.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/p-throttler/index.js new file mode 100644 index 0000000..add2f94 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/p-throttler/index.js @@ -0,0 +1,155 @@ +'use strict'; + +var Q = require('q'); +var arrayRemove = require('./lib/arrayRemove'); + +function PThrottler(defaultConcurrency, types) { + this._defaultConcurrency = typeof defaultConcurrency === 'number' ? defaultConcurrency : 10; + + // Initialize some needed properties + this._queue = {}; + this._slots = types || {}; + this._executing = []; +} + +// ----------------- + +PThrottler.prototype.enqueue = function (func, type) { + var deferred = Q.defer(); + var types; + var entry; + + type = type || ''; + types = Array.isArray(type) ? type : [type]; + entry = { + func: func, + types: types, + deferred: deferred + }; + + // Add the entry to all the types queues + types.forEach(function (type) { + var queue = this._queue[type] = this._queue[type] || []; + queue.push(entry); + }, this); + + // Process the entry shortly later so that handlers can be attached to the returned promise + Q.fcall(this._processEntry.bind(this, entry)); + + return deferred.promise; +}; + +PThrottler.prototype.abort = function () { + var promises; + + // Empty the whole queue + Object.keys(this._queue).forEach(function (type) { + this._queue[type] = []; + }, this); + + // Wait for all pending functions to finish + promises = this._executing.map(function (entry) { + return entry.deferred.promise; + }); + + return Q.allResolved(promises) + .then(function () {}); // Resolve with no value +}; + +// ----------------- + +PThrottler.prototype._processQueue = function (type) { + var queue = this._queue[type]; + var length = queue ? queue.length : 0; + var x; + + for (x = 0; x < length; ++x) { + if (this._processEntry(queue[x])) { + break; + } + } +}; + +PThrottler.prototype._processEntry = function (entry) { + var allFree = entry.types.every(this._hasSlot, this); + var promise; + + // If there is a free slot for every type + if (allFree) { + // For each type + entry.types.forEach(function (type) { + // Remove entry from the queue + arrayRemove(this._queue[type], entry); + // Take slot + this._takeSlot(type); + }, this); + + // Execute the function + this._executing.push(entry); + promise = entry.func(); + if (typeof promise.then === 'undefined') { + promise = Q.resolve(promise); + } + + promise.progress(entry.deferred.notify.bind(entry.deferred)); + + promise.then( + this._onFulfill.bind(this, entry, true), + this._onFulfill.bind(this, entry, false) + ); + } + + return allFree; +}; + + +PThrottler.prototype._onFulfill = function (entry, ok, result) { + // Resolve/reject the deferred based on success/error of the promise + if (ok) { + entry.deferred.resolve(result); + } else { + entry.deferred.reject(result); + } + + // Remove it from the executing list + arrayRemove(this._executing, entry); + + // Free up slots for every type + entry.types.forEach(this._freeSlot, this); + + // Find candidates for the free slots of each type + entry.types.forEach(this._processQueue, this); +}; + +PThrottler.prototype._hasSlot = function (type) { + var freeSlots = this._slots[type]; + + if (freeSlots == null) { + freeSlots = this._defaultConcurrency; + } + + return freeSlots > 0; +}; + +PThrottler.prototype._takeSlot = function (type) { + if (this._slots[type] == null) { + this._slots[type] = this._defaultConcurrency; + } else if (!this._slots[type]) { + throw new Error('No free slots'); + } + + // Decrement the free slots + --this._slots[type]; +}; + +PThrottler.prototype._freeSlot = function (type) { + if (this._slots[type] != null) { + ++this._slots[type]; + } +}; + +PThrottler.create = function (defaultConcurrency, types) { + return new PThrottler(defaultConcurrency, types); +}; + +module.exports = PThrottler; diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/p-throttler/lib/arrayRemove.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/p-throttler/lib/arrayRemove.js new file mode 100644 index 0000000..1006bb0 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/p-throttler/lib/arrayRemove.js @@ -0,0 +1,13 @@ +'use strict'; + +function arrayRemove(array, value) { + var index = array.indexOf(value); + + if (index !== -1) { + array.splice(index, 1); + } + + return array; +} + +module.exports = arrayRemove; diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/p-throttler/node_modules/q/package.json b/packages/Bower.1.3.11/node_modules/bower/node_modules/p-throttler/node_modules/q/package.json new file mode 100644 index 0000000..78b0cf6 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/p-throttler/node_modules/q/package.json @@ -0,0 +1,113 @@ +{ + "name": "q", + "version": "0.9.7", + "description": "A library for promises (CommonJS/Promises/A,B,D)", + "homepage": "https://github.com/kriskowal/q", + "author": { + "name": "Kris Kowal", + "email": "kris@cixar.com", + "url": "https://github.com/kriskowal" + }, + "keywords": [ + "q", + "promise", + "promises", + "promises-a", + "promises-aplus", + "deferred", + "future", + "async", + "flow control", + "fluent", + "browser", + "node" + ], + "contributors": [ + { + "name": "Kris Kowal", + "email": "kris@cixar.com", + "url": "https://github.com/kriskowal" + }, + { + "name": "Irakli Gozalishvili", + "email": "rfobic@gmail.com", + "url": "http://jeditoolkit.com" + }, + { + "name": "Domenic Denicola", + "email": "domenic@domenicdenicola.com", + "url": "http://domenicdenicola.com" + } + ], + "bugs": { + "url": "http://github.com/kriskowal/q/issues" + }, + "license": { + "type": "MIT", + "url": "http://github.com/kriskowal/q/raw/master/LICENSE" + }, + "main": "q.js", + "repository": { + "type": "git", + "url": "git://github.com/kriskowal/q.git" + }, + "engines": { + "node": ">=0.6.0", + "teleport": ">=0.2.0" + }, + "dependencies": {}, + "devDependencies": { + "jshint": "~2.1.9", + "cover": "*", + "jasmine-node": "1.11.0", + "opener": "*", + "promises-aplus-tests": "1.x", + "grunt": "~0.4.1", + "grunt-cli": "~0.1.9", + "grunt-contrib-uglify": "~0.2.2", + "matcha": "~0.2.0" + }, + "scripts": { + "test": "jasmine-node spec && promises-aplus-tests spec/aplus-adapter", + "test-browser": "opener spec/q-spec.html", + "benchmark": "matcha", + "lint": "jshint q.js", + "cover": "cover run node_modules/jasmine-node/bin/jasmine-node spec && cover report html && opener cover_html/index.html", + "minify": "grunt", + "prepublish": "grunt" + }, + "overlay": { + "teleport": { + "dependencies": { + "system": ">=0.0.4" + } + } + }, + "directories": { + "test": "./spec" + }, + "_id": "q@0.9.7", + "dist": { + "shasum": "4de2e6cb3b29088c9e4cbc03bf9d42fb96ce2f75", + "tarball": "http://registry.npmjs.org/q/-/q-0.9.7.tgz" + }, + "_from": "q@~0.9.2", + "_npmVersion": "1.3.2", + "_npmUser": { + "name": "kriskowal", + "email": "kris.kowal@cixar.com" + }, + "maintainers": [ + { + "name": "kriskowal", + "email": "kris.kowal@cixar.com" + }, + { + "name": "domenic", + "email": "domenic@domenicdenicola.com" + } + ], + "_shasum": "4de2e6cb3b29088c9e4cbc03bf9d42fb96ce2f75", + "_resolved": "https://registry.npmjs.org/q/-/q-0.9.7.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/p-throttler/node_modules/q/q.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/p-throttler/node_modules/q/q.js new file mode 100644 index 0000000..66389fc --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/p-throttler/node_modules/q/q.js @@ -0,0 +1,1937 @@ +// vim:ts=4:sts=4:sw=4: +/*! + * + * Copyright 2009-2012 Kris Kowal under the terms of the MIT + * license found at http://github.com/kriskowal/q/raw/master/LICENSE + * + * With parts by Tyler Close + * Copyright 2007-2009 Tyler Close under the terms of the MIT X license found + * at http://www.opensource.org/licenses/mit-license.html + * Forked at ref_send.js version: 2009-05-11 + * + * With parts by Mark Miller + * Copyright (C) 2011 Google Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +(function (definition) { + // Turn off strict mode for this function so we can assign to global.Q + /* jshint strict: false */ + + // This file will function properly as a \n```\n\nIn [Narwhal](http://narwhaljs.org/), [Node.js](http://nodejs.org/), and [RingoJS](http://ringojs.org/):\n\n```js\nvar punycode = require('punycode');\n```\n\nIn [Rhino](http://www.mozilla.org/rhino/):\n\n```js\nload('punycode.js');\n```\n\nUsing an AMD loader like [RequireJS](http://requirejs.org/):\n\n```js\nrequire(\n {\n 'paths': {\n 'punycode': 'path/to/punycode'\n }\n },\n ['punycode'],\n function(punycode) {\n console.log(punycode);\n }\n);\n```\n\n## API\n\n### `punycode.decode(string)`\n\nConverts a Punycode string of ASCII symbols to a string of Unicode symbols.\n\n```js\n// decode domain name parts\npunycode.decode('maana-pta'); // 'mañana'\npunycode.decode('--dqo34k'); // '☃-⌘'\n```\n\n### `punycode.encode(string)`\n\nConverts a string of Unicode symbols to a Punycode string of ASCII symbols.\n\n```js\n// encode domain name parts\npunycode.encode('mañana'); // 'maana-pta'\npunycode.encode('☃-⌘'); // '--dqo34k'\n```\n\n### `punycode.toUnicode(input)`\n\nConverts a Punycode string representing a domain name or an email address to Unicode. Only the Punycoded parts of the input will be converted, i.e. it doesn’t matter if you call it on a string that has already been converted to Unicode.\n\n```js\n// decode domain names\npunycode.toUnicode('xn--maana-pta.com');\n// → 'mañana.com'\npunycode.toUnicode('xn----dqo34k.com');\n// → '☃-⌘.com'\n\n// decode email addresses\npunycode.toUnicode('джумла@xn--p-8sbkgc5ag7bhce.xn--ba-lmcq');\n// → 'джумла@джpумлатест.bрфa'\n```\n\n### `punycode.toASCII(input)`\n\nConverts a Unicode string representing a domain name or an email address to Punycode. Only the non-ASCII parts of the input will be converted, i.e. it doesn’t matter if you call it with a domain that's already in ASCII.\n\n```js\n// encode domain names\npunycode.toASCII('mañana.com');\n// → 'xn--maana-pta.com'\npunycode.toASCII('☃-⌘.com');\n// → 'xn----dqo34k.com'\n\n// encode email addresses\npunycode.toASCII('джумла@джpумлатест.bрфa');\n// → 'джумла@xn--p-8sbkgc5ag7bhce.xn--ba-lmcq'\n```\n\n### `punycode.ucs2`\n\n#### `punycode.ucs2.decode(string)`\n\nCreates an array containing the numeric code point values of each Unicode symbol in the string. While [JavaScript uses UCS-2 internally](http://mathiasbynens.be/notes/javascript-encoding), this function will convert a pair of surrogate halves (each of which UCS-2 exposes as separate characters) into a single code point, matching UTF-16.\n\n```js\npunycode.ucs2.decode('abc');\n// → [0x61, 0x62, 0x63]\n// surrogate pair for U+1D306 TETRAGRAM FOR CENTRE:\npunycode.ucs2.decode('\\uD834\\uDF06');\n// → [0x1D306]\n```\n\n#### `punycode.ucs2.encode(codePoints)`\n\nCreates a string based on an array of numeric code point values.\n\n```js\npunycode.ucs2.encode([0x61, 0x62, 0x63]);\n// → 'abc'\npunycode.ucs2.encode([0x1D306]);\n// → '\\uD834\\uDF06'\n```\n\n### `punycode.version`\n\nA string representing the current Punycode.js version number.\n\n## Unit tests & code coverage\n\nAfter cloning this repository, run `npm install --dev` to install the dependencies needed for Punycode.js development and testing. You may want to install Istanbul _globally_ using `npm install istanbul -g`.\n\nOnce that’s done, you can run the unit tests in Node using `npm test` or `node tests/tests.js`. To run the tests in Rhino, Ringo, Narwhal, PhantomJS, and web browsers as well, use `grunt test`.\n\nTo generate the code coverage report, use `grunt cover`.\n\nFeel free to fork if you see possible improvements!\n\n## Author\n\n| [![twitter/mathias](https://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias \"Follow @mathias on Twitter\") |\n|---|\n| [Mathias Bynens](http://mathiasbynens.be/) |\n\n## Contributors\n\n| [![twitter/jdalton](https://gravatar.com/avatar/299a3d891ff1920b69c364d061007043?s=70)](https://twitter.com/jdalton \"Follow @jdalton on Twitter\") |\n|---|\n| [John-David Dalton](http://allyoucanleet.com/) |\n\n## License\n\nPunycode.js is available under the [MIT](http://mths.be/mit) license.\n", + "readmeFilename": "README.md", + "_id": "punycode@1.3.1", + "_from": "punycode@>=0.2.0" +} diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/tough-cookie/node_modules/punycode/punycode.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/tough-cookie/node_modules/punycode/punycode.js new file mode 100644 index 0000000..6ab1df3 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/tough-cookie/node_modules/punycode/punycode.js @@ -0,0 +1,528 @@ +/*! http://mths.be/punycode v1.3.1 by @mathias */ +;(function(root) { + + /** Detect free variables */ + var freeExports = typeof exports == 'object' && exports && + !exports.nodeType && exports; + var freeModule = typeof module == 'object' && module && + !module.nodeType && module; + var freeGlobal = typeof global == 'object' && global; + if ( + freeGlobal.global === freeGlobal || + freeGlobal.window === freeGlobal || + freeGlobal.self === freeGlobal + ) { + root = freeGlobal; + } + + /** + * The `punycode` object. + * @name punycode + * @type Object + */ + var punycode, + + /** Highest positive signed 32-bit float value */ + maxInt = 2147483647, // aka. 0x7FFFFFFF or 2^31-1 + + /** Bootstring parameters */ + base = 36, + tMin = 1, + tMax = 26, + skew = 38, + damp = 700, + initialBias = 72, + initialN = 128, // 0x80 + delimiter = '-', // '\x2D' + + /** Regular expressions */ + regexPunycode = /^xn--/, + regexNonASCII = /[^\x20-\x7E]/, // unprintable ASCII chars + non-ASCII chars + regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g, // RFC 3490 separators + + /** Error messages */ + errors = { + 'overflow': 'Overflow: input needs wider integers to process', + 'not-basic': 'Illegal input >= 0x80 (not a basic code point)', + 'invalid-input': 'Invalid input' + }, + + /** Convenience shortcuts */ + baseMinusTMin = base - tMin, + floor = Math.floor, + stringFromCharCode = String.fromCharCode, + + /** Temporary variable */ + key; + + /*--------------------------------------------------------------------------*/ + + /** + * A generic error utility function. + * @private + * @param {String} type The error type. + * @returns {Error} Throws a `RangeError` with the applicable error message. + */ + function error(type) { + throw RangeError(errors[type]); + } + + /** + * A generic `Array#map` utility function. + * @private + * @param {Array} array The array to iterate over. + * @param {Function} callback The function that gets called for every array + * item. + * @returns {Array} A new array of values returned by the callback function. + */ + function map(array, fn) { + var length = array.length; + var result = []; + while (length--) { + result[length] = fn(array[length]); + } + return result; + } + + /** + * A simple `Array#map`-like wrapper to work with domain name strings or email + * addresses. + * @private + * @param {String} domain The domain name or email address. + * @param {Function} callback The function that gets called for every + * character. + * @returns {Array} A new string of characters returned by the callback + * function. + */ + function mapDomain(string, fn) { + var parts = string.split('@'); + var result = ''; + if (parts.length > 1) { + // In email addresses, only the domain name should be punycoded. Leave + // the local part (i.e. everything up to `@`) intact. + result = parts[0] + '@'; + string = parts[1]; + } + var labels = string.split(regexSeparators); + var encoded = map(labels, fn).join('.'); + return result + encoded; + } + + /** + * Creates an array containing the numeric code points of each Unicode + * character in the string. While JavaScript uses UCS-2 internally, + * this function will convert a pair of surrogate halves (each of which + * UCS-2 exposes as separate characters) into a single code point, + * matching UTF-16. + * @see `punycode.ucs2.encode` + * @see + * @memberOf punycode.ucs2 + * @name decode + * @param {String} string The Unicode input string (UCS-2). + * @returns {Array} The new array of code points. + */ + function ucs2decode(string) { + var output = [], + counter = 0, + length = string.length, + value, + extra; + while (counter < length) { + value = string.charCodeAt(counter++); + if (value >= 0xD800 && value <= 0xDBFF && counter < length) { + // high surrogate, and there is a next character + extra = string.charCodeAt(counter++); + if ((extra & 0xFC00) == 0xDC00) { // low surrogate + output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000); + } else { + // unmatched surrogate; only append this code unit, in case the next + // code unit is the high surrogate of a surrogate pair + output.push(value); + counter--; + } + } else { + output.push(value); + } + } + return output; + } + + /** + * Creates a string based on an array of numeric code points. + * @see `punycode.ucs2.decode` + * @memberOf punycode.ucs2 + * @name encode + * @param {Array} codePoints The array of numeric code points. + * @returns {String} The new Unicode string (UCS-2). + */ + function ucs2encode(array) { + return map(array, function(value) { + var output = ''; + if (value > 0xFFFF) { + value -= 0x10000; + output += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800); + value = 0xDC00 | value & 0x3FF; + } + output += stringFromCharCode(value); + return output; + }).join(''); + } + + /** + * Converts a basic code point into a digit/integer. + * @see `digitToBasic()` + * @private + * @param {Number} codePoint The basic numeric code point value. + * @returns {Number} The numeric value of a basic code point (for use in + * representing integers) in the range `0` to `base - 1`, or `base` if + * the code point does not represent a value. + */ + function basicToDigit(codePoint) { + if (codePoint - 48 < 10) { + return codePoint - 22; + } + if (codePoint - 65 < 26) { + return codePoint - 65; + } + if (codePoint - 97 < 26) { + return codePoint - 97; + } + return base; + } + + /** + * Converts a digit/integer into a basic code point. + * @see `basicToDigit()` + * @private + * @param {Number} digit The numeric value of a basic code point. + * @returns {Number} The basic code point whose value (when used for + * representing integers) is `digit`, which needs to be in the range + * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is + * used; else, the lowercase form is used. The behavior is undefined + * if `flag` is non-zero and `digit` has no uppercase form. + */ + function digitToBasic(digit, flag) { + // 0..25 map to ASCII a..z or A..Z + // 26..35 map to ASCII 0..9 + return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5); + } + + /** + * Bias adaptation function as per section 3.4 of RFC 3492. + * http://tools.ietf.org/html/rfc3492#section-3.4 + * @private + */ + function adapt(delta, numPoints, firstTime) { + var k = 0; + delta = firstTime ? floor(delta / damp) : delta >> 1; + delta += floor(delta / numPoints); + for (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) { + delta = floor(delta / baseMinusTMin); + } + return floor(k + (baseMinusTMin + 1) * delta / (delta + skew)); + } + + /** + * Converts a Punycode string of ASCII-only symbols to a string of Unicode + * symbols. + * @memberOf punycode + * @param {String} input The Punycode string of ASCII-only symbols. + * @returns {String} The resulting string of Unicode symbols. + */ + function decode(input) { + // Don't use UCS-2 + var output = [], + inputLength = input.length, + out, + i = 0, + n = initialN, + bias = initialBias, + basic, + j, + index, + oldi, + w, + k, + digit, + t, + /** Cached calculation results */ + baseMinusT; + + // Handle the basic code points: let `basic` be the number of input code + // points before the last delimiter, or `0` if there is none, then copy + // the first basic code points to the output. + + basic = input.lastIndexOf(delimiter); + if (basic < 0) { + basic = 0; + } + + for (j = 0; j < basic; ++j) { + // if it's not a basic code point + if (input.charCodeAt(j) >= 0x80) { + error('not-basic'); + } + output.push(input.charCodeAt(j)); + } + + // Main decoding loop: start just after the last delimiter if any basic code + // points were copied; start at the beginning otherwise. + + for (index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) { + + // `index` is the index of the next character to be consumed. + // Decode a generalized variable-length integer into `delta`, + // which gets added to `i`. The overflow checking is easier + // if we increase `i` as we go, then subtract off its starting + // value at the end to obtain `delta`. + for (oldi = i, w = 1, k = base; /* no condition */; k += base) { + + if (index >= inputLength) { + error('invalid-input'); + } + + digit = basicToDigit(input.charCodeAt(index++)); + + if (digit >= base || digit > floor((maxInt - i) / w)) { + error('overflow'); + } + + i += digit * w; + t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias); + + if (digit < t) { + break; + } + + baseMinusT = base - t; + if (w > floor(maxInt / baseMinusT)) { + error('overflow'); + } + + w *= baseMinusT; + + } + + out = output.length + 1; + bias = adapt(i - oldi, out, oldi == 0); + + // `i` was supposed to wrap around from `out` to `0`, + // incrementing `n` each time, so we'll fix that now: + if (floor(i / out) > maxInt - n) { + error('overflow'); + } + + n += floor(i / out); + i %= out; + + // Insert `n` at position `i` of the output + output.splice(i++, 0, n); + + } + + return ucs2encode(output); + } + + /** + * Converts a string of Unicode symbols (e.g. a domain name label) to a + * Punycode string of ASCII-only symbols. + * @memberOf punycode + * @param {String} input The string of Unicode symbols. + * @returns {String} The resulting Punycode string of ASCII-only symbols. + */ + function encode(input) { + var n, + delta, + handledCPCount, + basicLength, + bias, + j, + m, + q, + k, + t, + currentValue, + output = [], + /** `inputLength` will hold the number of code points in `input`. */ + inputLength, + /** Cached calculation results */ + handledCPCountPlusOne, + baseMinusT, + qMinusT; + + // Convert the input in UCS-2 to Unicode + input = ucs2decode(input); + + // Cache the length + inputLength = input.length; + + // Initialize the state + n = initialN; + delta = 0; + bias = initialBias; + + // Handle the basic code points + for (j = 0; j < inputLength; ++j) { + currentValue = input[j]; + if (currentValue < 0x80) { + output.push(stringFromCharCode(currentValue)); + } + } + + handledCPCount = basicLength = output.length; + + // `handledCPCount` is the number of code points that have been handled; + // `basicLength` is the number of basic code points. + + // Finish the basic string - if it is not empty - with a delimiter + if (basicLength) { + output.push(delimiter); + } + + // Main encoding loop: + while (handledCPCount < inputLength) { + + // All non-basic code points < n have been handled already. Find the next + // larger one: + for (m = maxInt, j = 0; j < inputLength; ++j) { + currentValue = input[j]; + if (currentValue >= n && currentValue < m) { + m = currentValue; + } + } + + // Increase `delta` enough to advance the decoder's state to , + // but guard against overflow + handledCPCountPlusOne = handledCPCount + 1; + if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) { + error('overflow'); + } + + delta += (m - n) * handledCPCountPlusOne; + n = m; + + for (j = 0; j < inputLength; ++j) { + currentValue = input[j]; + + if (currentValue < n && ++delta > maxInt) { + error('overflow'); + } + + if (currentValue == n) { + // Represent delta as a generalized variable-length integer + for (q = delta, k = base; /* no condition */; k += base) { + t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias); + if (q < t) { + break; + } + qMinusT = q - t; + baseMinusT = base - t; + output.push( + stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0)) + ); + q = floor(qMinusT / baseMinusT); + } + + output.push(stringFromCharCode(digitToBasic(q, 0))); + bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength); + delta = 0; + ++handledCPCount; + } + } + + ++delta; + ++n; + + } + return output.join(''); + } + + /** + * Converts a Punycode string representing a domain name or an email address + * to Unicode. Only the Punycoded parts of the input will be converted, i.e. + * it doesn't matter if you call it on a string that has already been + * converted to Unicode. + * @memberOf punycode + * @param {String} input The Punycoded domain name or email address to + * convert to Unicode. + * @returns {String} The Unicode representation of the given Punycode + * string. + */ + function toUnicode(input) { + return mapDomain(input, function(string) { + return regexPunycode.test(string) + ? decode(string.slice(4).toLowerCase()) + : string; + }); + } + + /** + * Converts a Unicode string representing a domain name or an email address to + * Punycode. Only the non-ASCII parts of the domain name will be converted, + * i.e. it doesn't matter if you call it with a domain that's already in + * ASCII. + * @memberOf punycode + * @param {String} input The domain name or email address to convert, as a + * Unicode string. + * @returns {String} The Punycode representation of the given domain name or + * email address. + */ + function toASCII(input) { + return mapDomain(input, function(string) { + return regexNonASCII.test(string) + ? 'xn--' + encode(string) + : string; + }); + } + + /*--------------------------------------------------------------------------*/ + + /** Define the public API */ + punycode = { + /** + * A string representing the current Punycode.js version number. + * @memberOf punycode + * @type String + */ + 'version': '1.3.1', + /** + * An object of methods to convert from JavaScript's internal character + * representation (UCS-2) to Unicode code points, and back. + * @see + * @memberOf punycode + * @type Object + */ + 'ucs2': { + 'decode': ucs2decode, + 'encode': ucs2encode + }, + 'decode': decode, + 'encode': encode, + 'toASCII': toASCII, + 'toUnicode': toUnicode + }; + + /** Expose `punycode` */ + // Some AMD build optimizers, like r.js, check for specific condition patterns + // like the following: + if ( + typeof define == 'function' && + typeof define.amd == 'object' && + define.amd + ) { + define('punycode', function() { + return punycode; + }); + } else if (freeExports && freeModule) { + if (module.exports == freeExports) { // in Node.js or RingoJS v0.8.0+ + freeModule.exports = punycode; + } else { // in Narwhal or RingoJS v0.7.0- + for (key in punycode) { + punycode.hasOwnProperty(key) && (freeExports[key] = punycode[key]); + } + } + } else { // in Rhino or a web browser + root.punycode = punycode; + } + +}(this)); diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/tough-cookie/package.json b/packages/Bower.1.3.11/node_modules/bower/node_modules/tough-cookie/package.json new file mode 100644 index 0000000..c323664 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/tough-cookie/package.json @@ -0,0 +1,67 @@ +{ + "author": { + "name": "GoInstant Inc., a salesforce.com company" + }, + "license": "MIT", + "name": "tough-cookie", + "description": "RFC6265 Cookies and Cookie Jar for node.js", + "keywords": [ + "HTTP", + "cookie", + "cookies", + "set-cookie", + "cookiejar", + "jar", + "RFC6265", + "RFC2965" + ], + "version": "0.12.1", + "homepage": "https://github.com/goinstant/tough-cookie", + "repository": { + "type": "git", + "url": "git://github.com/goinstant/tough-cookie.git" + }, + "bugs": { + "url": "https://github.com/goinstant/tough-cookie/issues" + }, + "main": "./lib/cookie", + "scripts": { + "test": "vows test.js" + }, + "engines": { + "node": ">=0.4.12" + }, + "dependencies": { + "punycode": ">=0.2.0" + }, + "devDependencies": { + "vows": "0.7.0", + "async": ">=0.1.12" + }, + "readme": "[RFC6265](http://tools.ietf.org/html/rfc6265) Cookies and CookieJar for Node.js\n\n![Tough Cookie](http://www.goinstant.com.s3.amazonaws.com/tough-cookie.jpg)\n\n[![Build Status](https://travis-ci.org/goinstant/node-cookie.png?branch=master)](https://travis-ci.org/goinstant/node-cookie)\n\n[![NPM Stats](https://nodei.co/npm/tough-cookie.png?downloads=true&stars=true)](https://npmjs.org/package/tough-cookie)\n![NPM Downloads](https://nodei.co/npm-dl/tough-cookie.png?months=9)\n\n# Synopsis\n\n``` javascript\nvar tough = require('tough-cookie'); // note: not 'cookie', 'cookies' or 'node-cookie'\nvar Cookie = tough.Cookie;\nvar cookie = Cookie.parse(header);\ncookie.value = 'somethingdifferent';\nheader = cookie.toString();\n\nvar cookiejar = new tough.CookieJar();\ncookiejar.setCookie(cookie, 'http://currentdomain.example.com/path', cb);\n// ...\ncookiejar.getCookies('http://example.com/otherpath',function(err,cookies) {\n res.headers['cookie'] = cookies.join('; ');\n});\n```\n\n# Installation\n\nIt's _so_ easy!\n\n`npm install tough-cookie`\n\nRequires `punycode`, which should get installed automatically for you. Note that node.js v0.6.2+ bundles punycode by default.\n\nWhy the name? NPM modules `cookie`, `cookies` and `cookiejar` were already taken.\n\n# API\n\ntough\n=====\n\nFunctions on the module you get from `require('tough-cookie')`. All can be used as pure functions and don't need to be \"bound\".\n\nparseDate(string[,strict])\n-----------------\n\nParse a cookie date string into a `Date`. Parses according to RFC6265 Section 5.1.1, not `Date.parse()`. If strict is set to true then leading/trailing non-seperator characters around the time part will cause the parsing to fail (e.g. \"Thu, 01 Jan 1970 00:00:010 GMT\" has an extra trailing zero but Chrome, an assumedly RFC-compliant browser, treats this as valid).\n\nformatDate(date)\n----------------\n\nFormat a Date into a RFC1123 string (the RFC6265-recommended format).\n\ncanonicalDomain(str)\n--------------------\n\nTransforms a domain-name into a canonical domain-name. The canonical domain-name is a trimmed, lowercased, stripped-of-leading-dot and optionally punycode-encoded domain-name (Section 5.1.2 of RFC6265). For the most part, this function is idempotent (can be run again on its output without ill effects).\n\ndomainMatch(str,domStr[,canonicalize=true])\n-------------------------------------------\n\nAnswers \"does this real domain match the domain in a cookie?\". The `str` is the \"current\" domain-name and the `domStr` is the \"cookie\" domain-name. Matches according to RFC6265 Section 5.1.3, but it helps to think of it as a \"suffix match\".\n\nThe `canonicalize` parameter will run the other two paramters through `canonicalDomain` or not.\n\ndefaultPath(path)\n-----------------\n\nGiven a current request/response path, gives the Path apropriate for storing in a cookie. This is basically the \"directory\" of a \"file\" in the path, but is specified by Section 5.1.4 of the RFC.\n\nThe `path` parameter MUST be _only_ the pathname part of a URI (i.e. excludes the hostname, query, fragment, etc.). This is the `.pathname` property of node's `uri.parse()` output.\n\npathMatch(reqPath,cookiePath)\n-----------------------------\n\nAnswers \"does the request-path path-match a given cookie-path?\" as per RFC6265 Section 5.1.4. Returns a boolean.\n\nThis is essentially a prefix-match where `cookiePath` is a prefix of `reqPath`.\n\nparse(header[,strict=false])\n----------------------------\n\nalias for `Cookie.parse(header[,strict])`\n\nfromJSON(string)\n----------------\n\nalias for `Cookie.fromJSON(string)`\n\ngetPublicSuffix(hostname)\n-------------------------\n\nReturns the public suffix of this hostname. The public suffix is the shortest domain-name upon which a cookie can be set. Returns `null` if the hostname cannot have cookies set for it.\n\nFor example: `www.example.com` and `www.subdomain.example.com` both have public suffix `example.com`.\n\nFor further information, see http://publicsuffix.org/. This module derives its list from that site.\n\ncookieCompare(a,b)\n------------------\n\nFor use with `.sort()`, sorts a list of cookies into the recommended order given in the RFC (Section 5.4 step 2). Longest `.path`s go first, then sorted oldest to youngest.\n\n``` javascript\nvar cookies = [ /* unsorted array of Cookie objects */ ];\ncookies = cookies.sort(cookieCompare);\n```\n\npermuteDomain(domain)\n---------------------\n\nGenerates a list of all possible domains that `domainMatch()` the parameter. May be handy for implementing cookie stores.\n\n\npermutePath(path)\n-----------------\n\nGenerates a list of all possible paths that `pathMatch()` the parameter. May be handy for implementing cookie stores.\n\nCookie\n======\n\nCookie.parse(header[,strict=false])\n-----------------------------------\n\nParses a single Cookie or Set-Cookie HTTP header into a `Cookie` object. Returns `undefined` if the string can't be parsed. If in strict mode, returns `undefined` if the cookie doesn't follow the guidelines in section 4 of RFC6265. Generally speaking, strict mode can be used to validate your own generated Set-Cookie headers, but acting as a client you want to be lenient and leave strict mode off.\n\nHere's how to process the Set-Cookie header(s) on a node HTTP/HTTPS response:\n\n``` javascript\nif (res.headers['set-cookie'] instanceof Array)\n cookies = res.headers['set-cookie'].map(function (c) { return (Cookie.parse(c)); });\nelse\n cookies = [Cookie.parse(res.headers['set-cookie'])];\n```\n\nCookie.fromJSON(string)\n-----------------------\n\nConvert a JSON string to a `Cookie` object. Does a `JSON.parse()` and converts the `.created`, `.lastAccessed` and `.expires` properties into `Date` objects.\n\nProperties\n==========\n\n * _key_ - string - the name or key of the cookie (default \"\")\n * _value_ - string - the value of the cookie (default \"\")\n * _expires_ - `Date` - if set, the `Expires=` attribute of the cookie (defaults to the string `\"Infinity\"`). See `setExpires()`\n * _maxAge_ - seconds - if set, the `Max-Age=` attribute _in seconds_ of the cookie. May also be set to strings `\"Infinity\"` and `\"-Infinity\"` for non-expiry and immediate-expiry, respectively. See `setMaxAge()`\n * _domain_ - string - the `Domain=` attribute of the cookie\n * _path_ - string - the `Path=` of the cookie\n * _secure_ - boolean - the `Secure` cookie flag\n * _httpOnly_ - boolean - the `HttpOnly` cookie flag\n * _extensions_ - `Array` - any unrecognized cookie attributes as strings (even if equal-signs inside)\n\nAfter a cookie has been passed through `CookieJar.setCookie()` it will have the following additional attributes:\n\n * _hostOnly_ - boolean - is this a host-only cookie (i.e. no Domain field was set, but was instead implied)\n * _pathIsDefault_ - boolean - if true, there was no Path field on the cookie and `defaultPath()` was used to derive one.\n * _created_ - `Date` - when this cookie was added to the jar\n * _lastAccessed_ - `Date` - last time the cookie got accessed. Will affect cookie cleaning once implemented. Using `cookiejar.getCookies(...)` will update this attribute.\n\nConstruction([{options}])\n------------\n\nReceives an options object that can contain any Cookie properties, uses the default for unspecified properties.\n\n.toString()\n-----------\n\nencode to a Set-Cookie header value. The Expires cookie field is set using `formatDate()`, but is omitted entirely if `.expires` is `Infinity`.\n\n.cookieString()\n---------------\n\nencode to a Cookie header value (i.e. the `.key` and `.value` properties joined with '=').\n\n.setExpires(String)\n-------------------\n\nsets the expiry based on a date-string passed through `parseDate()`. If parseDate returns `null` (i.e. can't parse this date string), `.expires` is set to `\"Infinity\"` (a string) is set.\n\n.setMaxAge(number)\n-------------------\n\nsets the maxAge in seconds. Coerces `-Infinity` to `\"-Infinity\"` and `Infinity` to `\"Infinity\"` so it JSON serializes correctly.\n\n.expiryTime([now=Date.now()])\n-----------------------------\n\n.expiryDate([now=Date.now()])\n-----------------------------\n\nexpiryTime() Computes the absolute unix-epoch milliseconds that this cookie expires. expiryDate() works similarly, except it returns a `Date` object. Note that in both cases the `now` parameter should be milliseconds.\n\nMax-Age takes precedence over Expires (as per the RFC). The `.created` attribute -- or, by default, the `now` paramter -- is used to offset the `.maxAge` attribute.\n\nIf Expires (`.expires`) is set, that's returned.\n\nOtherwise, `expiryTime()` returns `Infinity` and `expiryDate()` returns a `Date` object for \"Tue, 19 Jan 2038 03:14:07 GMT\" (latest date that can be expressed by a 32-bit `time_t`; the common limit for most user-agents).\n\n.TTL([now=Date.now()])\n---------\n\ncompute the TTL relative to `now` (milliseconds). The same precedence rules as for `expiryTime`/`expiryDate` apply.\n\nThe \"number\" `Infinity` is returned for cookies without an explicit expiry and `0` is returned if the cookie is expired. Otherwise a time-to-live in milliseconds is returned.\n\n.canonicalizedDoman()\n---------------------\n\n.cdomain()\n----------\n\nreturn the canonicalized `.domain` field. This is lower-cased and punycode (RFC3490) encoded if the domain has any non-ASCII characters.\n\n.validate()\n-----------\n\nStatus: *IN PROGRESS*. Works for a few things, but is by no means comprehensive.\n\nvalidates cookie attributes for semantic correctness. Useful for \"lint\" checking any Set-Cookie headers you generate. For now, it returns a boolean, but eventually could return a reason string -- you can future-proof with this construct:\n\n``` javascript\nif (cookie.validate() === true) {\n // it's tasty\n} else {\n // yuck!\n}\n```\n\nCookieJar\n=========\n\nConstruction([store = new MemoryCookieStore()][, rejectPublicSuffixes])\n------------\n\nSimply use `new CookieJar()`. If you'd like to use a custom store, pass that to the constructor otherwise a `MemoryCookieStore` will be created and used.\n\n\nAttributes\n----------\n\n * _rejectPublicSuffixes_ - boolean - reject cookies with domains like \"com\" and \"co.uk\" (default: `true`)\n\nSince eventually this module would like to support database/remote/etc. CookieJars, continuation passing style is used for CookieJar methods.\n\n.setCookie(cookieOrString, currentUrl, [{options},] cb(err,cookie))\n-------------------------------------------------------------------\n\nAttempt to set the cookie in the cookie jar. If the operation fails, an error will be given to the callback `cb`, otherwise the cookie is passed through. The cookie will have updated `.created`, `.lastAccessed` and `.hostOnly` properties.\n\nThe `options` object can be omitted and can have the following properties:\n\n * _http_ - boolean - default `true` - indicates if this is an HTTP or non-HTTP API. Affects HttpOnly cookies.\n * _secure_ - boolean - autodetect from url - indicates if this is a \"Secure\" API. If the currentUrl starts with `https:` or `wss:` then this is defaulted to `true`, otherwise `false`.\n * _now_ - Date - default `new Date()` - what to use for the creation/access time of cookies\n * _strict_ - boolean - default `false` - perform extra checks\n * _ignoreError_ - boolean - default `false` - silently ignore things like parse errors and invalid domains. CookieStore errors aren't ignored by this option.\n\nAs per the RFC, the `.hostOnly` property is set if there was no \"Domain=\" parameter in the cookie string (or `.domain` was null on the Cookie object). The `.domain` property is set to the fully-qualified hostname of `currentUrl` in this case. Matching this cookie requires an exact hostname match (not a `domainMatch` as per usual).\n\n.setCookieSync(cookieOrString, currentUrl, [{options}])\n-------------------------------------------------------\n\nSynchronous version of `setCookie`; only works with synchronous stores (e.g. the default `MemoryCookieStore`).\n\n.storeCookie(cookie, [{options},] cb(err,cookie))\n-------------------------------------------------\n\n__REMOVED__ removed in lieu of the CookieStore API below\n\n.getCookies(currentUrl, [{options},] cb(err,cookies))\n-----------------------------------------------------\n\nRetrieve the list of cookies that can be sent in a Cookie header for the current url.\n\nIf an error is encountered, that's passed as `err` to the callback, otherwise an `Array` of `Cookie` objects is passed. The array is sorted with `cookieCompare()` unless the `{sort:false}` option is given.\n\nThe `options` object can be omitted and can have the following properties:\n\n * _http_ - boolean - default `true` - indicates if this is an HTTP or non-HTTP API. Affects HttpOnly cookies.\n * _secure_ - boolean - autodetect from url - indicates if this is a \"Secure\" API. If the currentUrl starts with `https:` or `wss:` then this is defaulted to `true`, otherwise `false`.\n * _now_ - Date - default `new Date()` - what to use for the creation/access time of cookies\n * _expire_ - boolean - default `true` - perform expiry-time checking of cookies and asynchronously remove expired cookies from the store. Using `false` will return expired cookies and **not** remove them from the store (which is useful for replaying Set-Cookie headers, potentially).\n * _allPaths_ - boolean - default `false` - if `true`, do not scope cookies by path. The default uses RFC-compliant path scoping. **Note**: may not be supported by the CookieStore `fetchCookies` function (the default MemoryCookieStore supports it).\n\nThe `.lastAccessed` property of the returned cookies will have been updated.\n\n.getCookiesSync(currentUrl, [{options}])\n----------------------------------------\n\nSynchronous version of `getCookies`; only works with synchronous stores (e.g. the default `MemoryCookieStore`).\n\n.getCookieString(...)\n---------------------\n\nAccepts the same options as `.getCookies()` but passes a string suitable for a Cookie header rather than an array to the callback. Simply maps the `Cookie` array via `.cookieString()`.\n\n.getCookieStringSync(...)\n-------------------------\n\nSynchronous version of `getCookieString`; only works with synchronous stores (e.g. the default `MemoryCookieStore`).\n\n.getSetCookieStrings(...)\n-------------------------\n\nReturns an array of strings suitable for **Set-Cookie** headers. Accepts the same options as `.getCookies()`. Simply maps the cookie array via `.toString()`.\n\n.getSetCookieStringsSync(...)\n-----------------------------\n\nSynchronous version of `getSetCookieStrings`; only works with synchronous stores (e.g. the default `MemoryCookieStore`).\n\nStore\n=====\n\nBase class for CookieJar stores.\n\n# CookieStore API\n\nThe storage model for each `CookieJar` instance can be replaced with a custom implementation. The default is `MemoryCookieStore` which can be found in the `lib/memstore.js` file. The API uses continuation-passing-style to allow for asynchronous stores.\n\nStores should inherit from the base `Store` class, which is available as `require('tough-cookie').Store`. Stores are asynchronous by default, but if `store.synchronous` is set, then the `*Sync` methods on the CookieJar can be used.\n\nAll `domain` parameters will have been normalized before calling.\n\nThe Cookie store must have all of the following methods.\n\nstore.findCookie(domain, path, key, cb(err,cookie))\n---------------------------------------------------\n\nRetrieve a cookie with the given domain, path and key (a.k.a. name). The RFC maintains that exactly one of these cookies should exist in a store. If the store is using versioning, this means that the latest/newest such cookie should be returned.\n\nCallback takes an error and the resulting `Cookie` object. If no cookie is found then `null` MUST be passed instead (i.e. not an error).\n\nstore.findCookies(domain, path, cb(err,cookies))\n------------------------------------------------\n\nLocates cookies matching the given domain and path. This is most often called in the context of `cookiejar.getCookies()` above.\n\nIf no cookies are found, the callback MUST be passed an empty array.\n\nThe resulting list will be checked for applicability to the current request according to the RFC (domain-match, path-match, http-only-flag, secure-flag, expiry, etc.), so it's OK to use an optimistic search algorithm when implementing this method. However, the search algorithm used SHOULD try to find cookies that `domainMatch()` the domain and `pathMatch()` the path in order to limit the amount of checking that needs to be done.\n\nAs of version 0.9.12, the `allPaths` option to `cookiejar.getCookies()` above will cause the path here to be `null`. If the path is `null`, path-matching MUST NOT be performed (i.e. domain-matching only).\n\nstore.putCookie(cookie, cb(err))\n--------------------------------\n\nAdds a new cookie to the store. The implementation SHOULD replace any existing cookie with the same `.domain`, `.path`, and `.key` properties -- depending on the nature of the implementation, it's possible that between the call to `fetchCookie` and `putCookie` that a duplicate `putCookie` can occur.\n\nThe `cookie` object MUST NOT be modified; the caller will have already updated the `.creation` and `.lastAccessed` properties.\n\nPass an error if the cookie cannot be stored.\n\nstore.updateCookie(oldCookie, newCookie, cb(err))\n-------------------------------------------------\n\nUpdate an existing cookie. The implementation MUST update the `.value` for a cookie with the same `domain`, `.path` and `.key`. The implementation SHOULD check that the old value in the store is equivalent to `oldCookie` - how the conflict is resolved is up to the store.\n\nThe `.lastAccessed` property will always be different between the two objects and `.created` will always be the same. Stores MAY ignore or defer the `.lastAccessed` change at the cost of affecting how cookies are sorted (or selected for deletion).\n\nStores may wish to optimize changing the `.value` of the cookie in the store versus storing a new cookie. If the implementation doesn't define this method a stub that calls `putCookie(newCookie,cb)` will be added to the store object.\n\nThe `newCookie` and `oldCookie` objects MUST NOT be modified.\n\nPass an error if the newCookie cannot be stored.\n\nstore.removeCookie(domain, path, key, cb(err))\n----------------------------------------------\n\nRemove a cookie from the store (see notes on `findCookie` about the uniqueness constraint).\n\nThe implementation MUST NOT pass an error if the cookie doesn't exist; only pass an error due to the failure to remove an existing cookie.\n\nstore.removeCookies(domain, path, cb(err))\n------------------------------------------\n\nRemoves matching cookies from the store. The `path` paramter is optional, and if missing means all paths in a domain should be removed.\n\nPass an error ONLY if removing any existing cookies failed.\n\n# TODO\n\n * _full_ RFC5890/RFC5891 canonicalization for domains in `cdomain()`\n * the optional `punycode` requirement implements RFC3492, but RFC6265 requires RFC5891\n * better tests for `validate()`?\n\n# Copyright and License\n\n(tl;dr: MIT with some MPL/1.1)\n\nCopyright 2012- GoInstant, Inc. and other contributors. All rights reserved.\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to\ndeal in the Software without restriction, including without limitation the\nrights to use, copy, modify, merge, publish, distribute, sublicense, and/or\nsell copies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\nFROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\nIN THE SOFTWARE.\n\nPortions may be licensed under different licenses (in particular public-suffix.txt is MPL/1.1); please read the LICENSE file for full details.\n", + "readmeFilename": "README.md", + "_id": "tough-cookie@0.12.1", + "dist": { + "shasum": "8220c7e21abd5b13d96804254bd5a81ebf2c7d62", + "tarball": "http://registry.npmjs.org/tough-cookie/-/tough-cookie-0.12.1.tgz" + }, + "_from": "tough-cookie@0.12.1", + "_npmVersion": "1.3.11", + "_npmUser": { + "name": "goinstant", + "email": "support@goinstant.com" + }, + "maintainers": [ + { + "name": "jstash", + "email": "jeremy@goinstant.com" + }, + { + "name": "goinstant", + "email": "services@goinstant.com" + } + ], + "directories": {}, + "_shasum": "8220c7e21abd5b13d96804254bd5a81ebf2c7d62", + "_resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-0.12.1.tgz" +} diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/update-notifier/check.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/update-notifier/check.js new file mode 100644 index 0000000..c8578a1 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/update-notifier/check.js @@ -0,0 +1,21 @@ +'use strict'; +var updateNotifier = require('./'); +var options = JSON.parse(process.argv[2]); +var updateNotifier = new updateNotifier.UpdateNotifier(options); + +updateNotifier.checkNpm(function (err, update) { + if (err) { + process.exit(1); + } + + // only update the last update check time on success + updateNotifier.config.set('lastUpdateCheck', Date.now()); + + if (update.type && update.type !== 'latest') { + updateNotifier.config.set('update', update); + } + + // Call process exit explicitly to terminate the child process + // Otherwise the child process will run forever (according to nodejs docs) + process.exit(); +}); diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/update-notifier/index.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/update-notifier/index.js new file mode 100644 index 0000000..69c79d0 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/update-notifier/index.js @@ -0,0 +1,122 @@ +'use strict'; +var spawn = require('child_process').spawn; +var path = require('path'); +var Configstore = require('configstore'); +var chalk = require('chalk'); +var semverDiff = require('semver-diff'); +var latestVersion = require('latest-version'); +var stringLength = require('string-length'); + +function UpdateNotifier(options) { + this.options = options = options || {}; + + if (!options.packageName || !options.packageVersion) { + throw new Error('packageName and packageVersion required'); + } + + this.packageName = options.packageName; + this.packageVersion = options.packageVersion; + this.updateCheckInterval = typeof options.updateCheckInterval === 'number' ? options.updateCheckInterval : 1000 * 60 * 60 * 24; // 1 day + this.hasCallback = typeof options.callback === 'function'; + this.callback = options.callback || function () {}; + + if (!this.hasCallback) { + this.config = new Configstore('update-notifier-' + this.packageName, { + optOut: false, + // init with the current time so the first check is only + // after the set interval, so not to bother users right away + lastUpdateCheck: Date.now() + }); + } +} + +UpdateNotifier.prototype.check = function () { + if (this.hasCallback) { + return this.checkNpm(this.callback); + } + + if (this.config.get('optOut') || 'NO_UPDATE_NOTIFIER' in process.env) { + return; + } + + this.update = this.config.get('update'); + + if (this.update) { + this.config.del('update'); + } + + // Only check for updates on a set interval + if (Date.now() - this.config.get('lastUpdateCheck') < this.updateCheckInterval) { + return; + } + + // Spawn a detached process, passing the options as an environment property + spawn(process.execPath, [path.join(__dirname, 'check.js'), JSON.stringify(this.options)], { + detached: true, + stdio: 'ignore' + }).unref(); +}; + +UpdateNotifier.prototype.checkNpm = function (cb) { + latestVersion(this.packageName, function (err, latestVersion) { + if (err) { + return cb(err); + } + + cb(null, { + latest: latestVersion, + current: this.packageVersion, + type: semverDiff(this.packageVersion, latestVersion) || 'latest', + name: this.packageName + }); + }.bind(this)); +}; + +UpdateNotifier.prototype.notify = function (opts) { + if (!process.stdout.isTTY || !this.update) { + return this; + } + + opts = opts || {}; + opts.defer = opts.defer === undefined ? true : false; + + var fill = function (str, count) { + return Array(count + 1).join(str); + }; + + var line1 = ' Update available: ' + chalk.green.bold(this.update.latest) + + chalk.dim(' (current: ' + this.update.current + ')') + ' '; + var line2 = ' Run ' + chalk.blue('npm update -g ' + this.packageName) + + ' to update. '; + var contentWidth = Math.max(stringLength(line1), stringLength(line2)); + var line1rest = contentWidth - stringLength(line1); + var line2rest = contentWidth - stringLength(line2); + var top = chalk.yellow('┌' + fill('─', contentWidth) + '┐'); + var bottom = chalk.yellow('└' + fill('─', contentWidth) + '┘'); + var side = chalk.yellow('│'); + + var message = + '\n\n' + + top + '\n' + + side + line1 + fill(' ', line1rest) + side + '\n' + + side + line2 + fill(' ', line2rest) + side + '\n' + + bottom + '\n'; + + if (opts.defer) { + process.on('exit', function () { + console.error(message); + }); + } else { + console.error(message); + } + + return this; +}; + +module.exports = function (options) { + var updateNotifier = new UpdateNotifier(options); + updateNotifier.check(); + return updateNotifier; +}; + +module.exports.UpdateNotifier = UpdateNotifier; diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/update-notifier/node_modules/latest-version/cli.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/update-notifier/node_modules/latest-version/cli.js new file mode 100644 index 0000000..f54fd27 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/update-notifier/node_modules/latest-version/cli.js @@ -0,0 +1,40 @@ +#!/usr/bin/env node +'use strict'; +var pkg = require('./package.json'); +var latestVersion = require('./'); +var argv = process.argv.slice(2); +var input = argv[0]; + +function help() { + console.log([ + '', + ' ' + pkg.description, + '', + ' Usage', + ' latest-version ', + '', + ' Example', + ' latest-version pageres', + ' 0.4.1' + ].join('\n')); +} + +if (!input || argv.indexOf('--help') !== -1) { + help(); + return; +} + +if (argv.indexOf('--version') !== -1) { + console.log(pkg.version); + return; +} + +latestVersion(input, function (err, version) { + if (err) { + console.error(err); + process.exit(1); + return; + } + + console.log(version); +}); diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/update-notifier/node_modules/latest-version/index.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/update-notifier/node_modules/latest-version/index.js new file mode 100644 index 0000000..b4ee38a --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/update-notifier/node_modules/latest-version/index.js @@ -0,0 +1,13 @@ +'use strict'; +var packageJson = require('package-json'); + +module.exports = function (name, cb) { + packageJson(name, 'latest', function (err, json) { + if (err) { + cb(err); + return; + } + + cb(null, json.version); + }); +}; diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/update-notifier/node_modules/latest-version/package.json b/packages/Bower.1.3.11/node_modules/bower/node_modules/update-notifier/node_modules/latest-version/package.json new file mode 100644 index 0000000..a362315 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/update-notifier/node_modules/latest-version/package.json @@ -0,0 +1,69 @@ +{ + "name": "latest-version", + "version": "1.0.0", + "description": "Get the latest version of a npm package", + "license": "MIT", + "repository": { + "type": "git", + "url": "https://github.com/sindresorhus/latest-version" + }, + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "http://sindresorhus.com" + }, + "bin": { + "latest-version": "cli.js" + }, + "engines": { + "node": ">=0.10.0" + }, + "scripts": { + "test": "mocha" + }, + "files": [ + "index.js", + "cli.js" + ], + "keywords": [ + "latest", + "version", + "npm", + "package", + "package.json", + "current", + "module" + ], + "dependencies": { + "package-json": "^1.0.0" + }, + "devDependencies": { + "mocha": "*" + }, + "gitHead": "45f050c26630050f73db35967492174c5175a624", + "bugs": { + "url": "https://github.com/sindresorhus/latest-version/issues" + }, + "homepage": "https://github.com/sindresorhus/latest-version", + "_id": "latest-version@1.0.0", + "_shasum": "84f40e5c90745c7e4f7811624d6152c381d931d9", + "_from": "latest-version@^1.0.0", + "_npmVersion": "1.4.21", + "_npmUser": { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + } + ], + "dist": { + "shasum": "84f40e5c90745c7e4f7811624d6152c381d931d9", + "tarball": "http://registry.npmjs.org/latest-version/-/latest-version-1.0.0.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/latest-version/-/latest-version-1.0.0.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/update-notifier/node_modules/semver-diff/index.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/update-notifier/node_modules/semver-diff/index.js new file mode 100644 index 0000000..92c9c97 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/update-notifier/node_modules/semver-diff/index.js @@ -0,0 +1,27 @@ +'use strict'; +var semver = require('semver'); + +module.exports = function (a, b) { + if (semver.gt(a, b)) { + return null; + } + + a = semver.parse(a); + b = semver.parse(b); + + for (var key in a) { + if (key === 'major' || key === 'minor' || key === 'patch') { + if (a[key] !== b[key]) { + return key; + } + } + + if (key === 'prerelease' || key === 'build') { + if (JSON.stringify(a[key]) !== JSON.stringify(b[key])) { + return key; + } + } + } + + return null; +}; diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/update-notifier/node_modules/semver-diff/node_modules/semver/bin/semver b/packages/Bower.1.3.11/node_modules/bower/node_modules/update-notifier/node_modules/semver-diff/node_modules/semver/bin/semver new file mode 100644 index 0000000..41c148f --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/update-notifier/node_modules/semver-diff/node_modules/semver/bin/semver @@ -0,0 +1,125 @@ +#!/usr/bin/env node +// Standalone semver comparison program. +// Exits successfully and prints matching version(s) if +// any supplied version is valid and passes all tests. + +var argv = process.argv.slice(2) + , versions = [] + , range = [] + , gt = [] + , lt = [] + , eq = [] + , inc = null + , version = require("../package.json").version + , loose = false + , semver = require("../semver") + , reverse = false + +main() + +function main () { + if (!argv.length) return help() + while (argv.length) { + var a = argv.shift() + var i = a.indexOf('=') + if (i !== -1) { + a = a.slice(0, i) + argv.unshift(a.slice(i + 1)) + } + switch (a) { + case "-rv": case "-rev": case "--rev": case "--reverse": + reverse = true + break + case "-l": case "--loose": + loose = true + break + case "-v": case "--version": + versions.push(argv.shift()) + break + case "-i": case "--inc": case "--increment": + switch (argv[0]) { + case "major": case "minor": case "patch": case "prerelease": + case "premajor": case "preminor": case "prepatch": + inc = argv.shift() + break + default: + inc = "patch" + break + } + break + case "-r": case "--range": + range.push(argv.shift()) + break + case "-h": case "--help": case "-?": + return help() + default: + versions.push(a) + break + } + } + + versions = versions.filter(function (v) { + return semver.valid(v, loose) + }) + if (!versions.length) return fail() + if (inc && (versions.length !== 1 || range.length)) + return failInc() + + for (var i = 0, l = range.length; i < l ; i ++) { + versions = versions.filter(function (v) { + return semver.satisfies(v, range[i], loose) + }) + if (!versions.length) return fail() + } + return success(versions) +} + +function failInc () { + console.error("--inc can only be used on a single version with no range") + fail() +} + +function fail () { process.exit(1) } + +function success () { + var compare = reverse ? "rcompare" : "compare" + versions.sort(function (a, b) { + return semver[compare](a, b, loose) + }).map(function (v) { + return semver.clean(v, loose) + }).map(function (v) { + return inc ? semver.inc(v, inc, loose) : v + }).forEach(function (v,i,_) { console.log(v) }) +} + +function help () { + console.log(["SemVer " + version + ,"" + ,"A JavaScript implementation of the http://semver.org/ specification" + ,"Copyright Isaac Z. Schlueter" + ,"" + ,"Usage: semver [options] [ [...]]" + ,"Prints valid versions sorted by SemVer precedence" + ,"" + ,"Options:" + ,"-r --range " + ," Print versions that match the specified range." + ,"" + ,"-i --increment []" + ," Increment a version by the specified level. Level can" + ," be one of: major, minor, patch, premajor, preminor," + ," prepatch, or prerelease. Default level is 'patch'." + ," Only one version may be specified." + ,"" + ,"-l --loose" + ," Interpret versions and ranges loosely" + ,"" + ,"Program exits successfully if any valid version satisfies" + ,"all supplied ranges, and prints all satisfying versions." + ,"" + ,"If no satisfying versions are found, then exits failure." + ,"" + ,"Versions are printed in ascending order, so supplying" + ,"multiple versions to the utility will just sort them." + ].join("\n")) +} diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/update-notifier/node_modules/semver-diff/node_modules/semver/foot.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/update-notifier/node_modules/semver-diff/node_modules/semver/foot.js new file mode 100644 index 0000000..8f83c20 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/update-notifier/node_modules/semver-diff/node_modules/semver/foot.js @@ -0,0 +1,6 @@ + +})( + typeof exports === 'object' ? exports : + typeof define === 'function' && define.amd ? {} : + semver = {} +); diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/update-notifier/node_modules/semver-diff/node_modules/semver/head.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/update-notifier/node_modules/semver-diff/node_modules/semver/head.js new file mode 100644 index 0000000..6536865 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/update-notifier/node_modules/semver-diff/node_modules/semver/head.js @@ -0,0 +1,2 @@ +;(function(exports) { + diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/update-notifier/node_modules/semver-diff/node_modules/semver/package.json b/packages/Bower.1.3.11/node_modules/bower/node_modules/update-notifier/node_modules/semver-diff/node_modules/semver/package.json new file mode 100644 index 0000000..e1a487c --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/update-notifier/node_modules/semver-diff/node_modules/semver/package.json @@ -0,0 +1,50 @@ +{ + "name": "semver", + "version": "3.0.1", + "description": "The semantic version parser used by npm.", + "main": "semver.js", + "browser": "semver.browser.js", + "min": "semver.min.js", + "scripts": { + "test": "tap test/*.js", + "prepublish": "make" + }, + "devDependencies": { + "tap": "0.x >=0.0.4", + "uglify-js": "~2.3.6" + }, + "license": "BSD", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/node-semver.git" + }, + "bin": { + "semver": "./bin/semver" + }, + "gitHead": "4b24aeb54dd23560f53b0df01e64e5f229e6172f", + "bugs": { + "url": "https://github.com/isaacs/node-semver/issues" + }, + "homepage": "https://github.com/isaacs/node-semver", + "_id": "semver@3.0.1", + "_shasum": "720ac012515a252f91fb0dd2e99a56a70d6cf078", + "_from": "semver@^3.0.1", + "_npmVersion": "2.0.0-alpha-5", + "_npmUser": { + "name": "isaacs", + "email": "i@izs.me" + }, + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + } + ], + "dist": { + "shasum": "720ac012515a252f91fb0dd2e99a56a70d6cf078", + "tarball": "http://registry.npmjs.org/semver/-/semver-3.0.1.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/semver/-/semver-3.0.1.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/update-notifier/node_modules/semver-diff/node_modules/semver/semver.browser.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/update-notifier/node_modules/semver-diff/node_modules/semver/semver.browser.js new file mode 100644 index 0000000..c335720 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/update-notifier/node_modules/semver-diff/node_modules/semver/semver.browser.js @@ -0,0 +1,1035 @@ +;(function(exports) { + +// export the class if we are in a Node-like system. +if (typeof module === 'object' && module.exports === exports) + exports = module.exports = SemVer; + +// The debug function is excluded entirely from the minified version. + +// Note: this is the semver.org version of the spec that it implements +// Not necessarily the package version of this code. +exports.SEMVER_SPEC_VERSION = '2.0.0'; + +// The actual regexps go on exports.re +var re = exports.re = []; +var src = exports.src = []; +var R = 0; + +// The following Regular Expressions can be used for tokenizing, +// validating, and parsing SemVer version strings. + +// ## Numeric Identifier +// A single `0`, or a non-zero digit followed by zero or more digits. + +var NUMERICIDENTIFIER = R++; +src[NUMERICIDENTIFIER] = '0|[1-9]\\d*'; +var NUMERICIDENTIFIERLOOSE = R++; +src[NUMERICIDENTIFIERLOOSE] = '[0-9]+'; + + +// ## Non-numeric Identifier +// Zero or more digits, followed by a letter or hyphen, and then zero or +// more letters, digits, or hyphens. + +var NONNUMERICIDENTIFIER = R++; +src[NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*'; + + +// ## Main Version +// Three dot-separated numeric identifiers. + +var MAINVERSION = R++; +src[MAINVERSION] = '(' + src[NUMERICIDENTIFIER] + ')\\.' + + '(' + src[NUMERICIDENTIFIER] + ')\\.' + + '(' + src[NUMERICIDENTIFIER] + ')'; + +var MAINVERSIONLOOSE = R++; +src[MAINVERSIONLOOSE] = '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' + + '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' + + '(' + src[NUMERICIDENTIFIERLOOSE] + ')'; + +// ## Pre-release Version Identifier +// A numeric identifier, or a non-numeric identifier. + +var PRERELEASEIDENTIFIER = R++; +src[PRERELEASEIDENTIFIER] = '(?:' + src[NUMERICIDENTIFIER] + + '|' + src[NONNUMERICIDENTIFIER] + ')'; + +var PRERELEASEIDENTIFIERLOOSE = R++; +src[PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[NUMERICIDENTIFIERLOOSE] + + '|' + src[NONNUMERICIDENTIFIER] + ')'; + + +// ## Pre-release Version +// Hyphen, followed by one or more dot-separated pre-release version +// identifiers. + +var PRERELEASE = R++; +src[PRERELEASE] = '(?:-(' + src[PRERELEASEIDENTIFIER] + + '(?:\\.' + src[PRERELEASEIDENTIFIER] + ')*))'; + +var PRERELEASELOOSE = R++; +src[PRERELEASELOOSE] = '(?:-?(' + src[PRERELEASEIDENTIFIERLOOSE] + + '(?:\\.' + src[PRERELEASEIDENTIFIERLOOSE] + ')*))'; + +// ## Build Metadata Identifier +// Any combination of digits, letters, or hyphens. + +var BUILDIDENTIFIER = R++; +src[BUILDIDENTIFIER] = '[0-9A-Za-z-]+'; + +// ## Build Metadata +// Plus sign, followed by one or more period-separated build metadata +// identifiers. + +var BUILD = R++; +src[BUILD] = '(?:\\+(' + src[BUILDIDENTIFIER] + + '(?:\\.' + src[BUILDIDENTIFIER] + ')*))'; + + +// ## Full Version String +// A main version, followed optionally by a pre-release version and +// build metadata. + +// Note that the only major, minor, patch, and pre-release sections of +// the version string are capturing groups. The build metadata is not a +// capturing group, because it should not ever be used in version +// comparison. + +var FULL = R++; +var FULLPLAIN = 'v?' + src[MAINVERSION] + + src[PRERELEASE] + '?' + + src[BUILD] + '?'; + +src[FULL] = '^' + FULLPLAIN + '$'; + +// like full, but allows v1.2.3 and =1.2.3, which people do sometimes. +// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty +// common in the npm registry. +var LOOSEPLAIN = '[v=\\s]*' + src[MAINVERSIONLOOSE] + + src[PRERELEASELOOSE] + '?' + + src[BUILD] + '?'; + +var LOOSE = R++; +src[LOOSE] = '^' + LOOSEPLAIN + '$'; + +var GTLT = R++; +src[GTLT] = '((?:<|>)?=?)'; + +// Something like "2.*" or "1.2.x". +// Note that "x.x" is a valid xRange identifer, meaning "any version" +// Only the first item is strictly required. +var XRANGEIDENTIFIERLOOSE = R++; +src[XRANGEIDENTIFIERLOOSE] = src[NUMERICIDENTIFIERLOOSE] + '|x|X|\\*'; +var XRANGEIDENTIFIER = R++; +src[XRANGEIDENTIFIER] = src[NUMERICIDENTIFIER] + '|x|X|\\*'; + +var XRANGEPLAIN = R++; +src[XRANGEPLAIN] = '[v=\\s]*(' + src[XRANGEIDENTIFIER] + ')' + + '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' + + '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' + + '(?:(' + src[PRERELEASE] + ')' + + ')?)?)?'; + +var XRANGEPLAINLOOSE = R++; +src[XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[XRANGEIDENTIFIERLOOSE] + ')' + + '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' + + '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' + + '(?:(' + src[PRERELEASELOOSE] + ')' + + ')?)?)?'; + +// >=2.x, for example, means >=2.0.0-0 +// <1.x would be the same as "<1.0.0-0", though. +var XRANGE = R++; +src[XRANGE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAIN] + '$'; +var XRANGELOOSE = R++; +src[XRANGELOOSE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAINLOOSE] + '$'; + +// Tilde ranges. +// Meaning is "reasonably at or greater than" +var LONETILDE = R++; +src[LONETILDE] = '(?:~>?)'; + +var TILDETRIM = R++; +src[TILDETRIM] = '(\\s*)' + src[LONETILDE] + '\\s+'; +re[TILDETRIM] = new RegExp(src[TILDETRIM], 'g'); +var tildeTrimReplace = '$1~'; + +var TILDE = R++; +src[TILDE] = '^' + src[LONETILDE] + src[XRANGEPLAIN] + '$'; +var TILDELOOSE = R++; +src[TILDELOOSE] = '^' + src[LONETILDE] + src[XRANGEPLAINLOOSE] + '$'; + +// Caret ranges. +// Meaning is "at least and backwards compatible with" +var LONECARET = R++; +src[LONECARET] = '(?:\\^)'; + +var CARETTRIM = R++; +src[CARETTRIM] = '(\\s*)' + src[LONECARET] + '\\s+'; +re[CARETTRIM] = new RegExp(src[CARETTRIM], 'g'); +var caretTrimReplace = '$1^'; + +var CARET = R++; +src[CARET] = '^' + src[LONECARET] + src[XRANGEPLAIN] + '$'; +var CARETLOOSE = R++; +src[CARETLOOSE] = '^' + src[LONECARET] + src[XRANGEPLAINLOOSE] + '$'; + +// A simple gt/lt/eq thing, or just "" to indicate "any version" +var COMPARATORLOOSE = R++; +src[COMPARATORLOOSE] = '^' + src[GTLT] + '\\s*(' + LOOSEPLAIN + ')$|^$'; +var COMPARATOR = R++; +src[COMPARATOR] = '^' + src[GTLT] + '\\s*(' + FULLPLAIN + ')$|^$'; + + +// An expression to strip any whitespace between the gtlt and the thing +// it modifies, so that `> 1.2.3` ==> `>1.2.3` +var COMPARATORTRIM = R++; +src[COMPARATORTRIM] = '(\\s*)' + src[GTLT] + + '\\s*(' + LOOSEPLAIN + '|' + src[XRANGEPLAIN] + ')'; + +// this one has to use the /g flag +re[COMPARATORTRIM] = new RegExp(src[COMPARATORTRIM], 'g'); +var comparatorTrimReplace = '$1$2$3'; + + +// Something like `1.2.3 - 1.2.4` +// Note that these all use the loose form, because they'll be +// checked against either the strict or loose comparator form +// later. +var HYPHENRANGE = R++; +src[HYPHENRANGE] = '^\\s*(' + src[XRANGEPLAIN] + ')' + + '\\s+-\\s+' + + '(' + src[XRANGEPLAIN] + ')' + + '\\s*$'; + +var HYPHENRANGELOOSE = R++; +src[HYPHENRANGELOOSE] = '^\\s*(' + src[XRANGEPLAINLOOSE] + ')' + + '\\s+-\\s+' + + '(' + src[XRANGEPLAINLOOSE] + ')' + + '\\s*$'; + +// Star ranges basically just allow anything at all. +var STAR = R++; +src[STAR] = '(<|>)?=?\\s*\\*'; + +// Compile to actual regexp objects. +// All are flag-free, unless they were created above with a flag. +for (var i = 0; i < R; i++) { + ; + if (!re[i]) + re[i] = new RegExp(src[i]); +} + +exports.parse = parse; +function parse(version, loose) { + var r = loose ? re[LOOSE] : re[FULL]; + return (r.test(version)) ? new SemVer(version, loose) : null; +} + +exports.valid = valid; +function valid(version, loose) { + var v = parse(version, loose); + return v ? v.version : null; +} + + +exports.clean = clean; +function clean(version, loose) { + var s = parse(version.trim().replace(/^[=v]+/, ""), loose); + return s ? s.version : null; +} + +exports.SemVer = SemVer; + +function SemVer(version, loose) { + if (version instanceof SemVer) { + if (version.loose === loose) + return version; + else + version = version.version; + } else if (typeof version !== 'string') { + throw new TypeError('Invalid Version: ' + version); + } + + if (!(this instanceof SemVer)) + return new SemVer(version, loose); + + ; + this.loose = loose; + var m = version.trim().match(loose ? re[LOOSE] : re[FULL]); + + if (!m) + throw new TypeError('Invalid Version: ' + version); + + this.raw = version; + + // these are actually numbers + this.major = +m[1]; + this.minor = +m[2]; + this.patch = +m[3]; + + // numberify any prerelease numeric ids + if (!m[4]) + this.prerelease = []; + else + this.prerelease = m[4].split('.').map(function(id) { + return (/^[0-9]+$/.test(id)) ? +id : id; + }); + + this.build = m[5] ? m[5].split('.') : []; + this.format(); +} + +SemVer.prototype.format = function() { + this.version = this.major + '.' + this.minor + '.' + this.patch; + if (this.prerelease.length) + this.version += '-' + this.prerelease.join('.'); + return this.version; +}; + +SemVer.prototype.inspect = function() { + return ''; +}; + +SemVer.prototype.toString = function() { + return this.version; +}; + +SemVer.prototype.compare = function(other) { + ; + if (!(other instanceof SemVer)) + other = new SemVer(other, this.loose); + + return this.compareMain(other) || this.comparePre(other); +}; + +SemVer.prototype.compareMain = function(other) { + if (!(other instanceof SemVer)) + other = new SemVer(other, this.loose); + + return compareIdentifiers(this.major, other.major) || + compareIdentifiers(this.minor, other.minor) || + compareIdentifiers(this.patch, other.patch); +}; + +SemVer.prototype.comparePre = function(other) { + if (!(other instanceof SemVer)) + other = new SemVer(other, this.loose); + + // NOT having a prerelease is > having one + if (this.prerelease.length && !other.prerelease.length) + return -1; + else if (!this.prerelease.length && other.prerelease.length) + return 1; + else if (!this.prerelease.length && !other.prerelease.length) + return 0; + + var i = 0; + do { + var a = this.prerelease[i]; + var b = other.prerelease[i]; + ; + if (a === undefined && b === undefined) + return 0; + else if (b === undefined) + return 1; + else if (a === undefined) + return -1; + else if (a === b) + continue; + else + return compareIdentifiers(a, b); + } while (++i); +}; + +// preminor will bump the version up to the next minor release, and immediately +// down to pre-release. premajor and prepatch work the same way. +SemVer.prototype.inc = function(release) { + switch (release) { + case 'premajor': + this.inc('major'); + this.inc('pre'); + break; + case 'preminor': + this.inc('minor'); + this.inc('pre'); + break; + case 'prepatch': + // If this is already a prerelease, it will bump to the next version + // drop any prereleases that might already exist, since they are not + // relevant at this point. + this.prerelease.length = 0; + this.inc('patch'); + this.inc('pre'); + break; + // If the input is a non-prerelease version, this acts the same as + // prepatch. + case 'prerelease': + if (this.prerelease.length === 0) + this.inc('patch'); + this.inc('pre'); + break; + case 'major': + this.major++; + this.minor = -1; + case 'minor': + this.minor++; + this.patch = 0; + this.prerelease = []; + break; + case 'patch': + // If this is not a pre-release version, it will increment the patch. + // If it is a pre-release it will bump up to the same patch version. + // 1.2.0-5 patches to 1.2.0 + // 1.2.0 patches to 1.2.1 + if (this.prerelease.length === 0) + this.patch++; + this.prerelease = []; + break; + // This probably shouldn't be used publically. + // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction. + case 'pre': + if (this.prerelease.length === 0) + this.prerelease = [0]; + else { + var i = this.prerelease.length; + while (--i >= 0) { + if (typeof this.prerelease[i] === 'number') { + this.prerelease[i]++; + i = -2; + } + } + if (i === -1) // didn't increment anything + this.prerelease.push(0); + } + break; + + default: + throw new Error('invalid increment argument: ' + release); + } + this.format(); + return this; +}; + +exports.inc = inc; +function inc(version, release, loose) { + try { + return new SemVer(version, loose).inc(release).version; + } catch (er) { + return null; + } +} + +exports.compareIdentifiers = compareIdentifiers; + +var numeric = /^[0-9]+$/; +function compareIdentifiers(a, b) { + var anum = numeric.test(a); + var bnum = numeric.test(b); + + if (anum && bnum) { + a = +a; + b = +b; + } + + return (anum && !bnum) ? -1 : + (bnum && !anum) ? 1 : + a < b ? -1 : + a > b ? 1 : + 0; +} + +exports.rcompareIdentifiers = rcompareIdentifiers; +function rcompareIdentifiers(a, b) { + return compareIdentifiers(b, a); +} + +exports.compare = compare; +function compare(a, b, loose) { + return new SemVer(a, loose).compare(b); +} + +exports.compareLoose = compareLoose; +function compareLoose(a, b) { + return compare(a, b, true); +} + +exports.rcompare = rcompare; +function rcompare(a, b, loose) { + return compare(b, a, loose); +} + +exports.sort = sort; +function sort(list, loose) { + return list.sort(function(a, b) { + return exports.compare(a, b, loose); + }); +} + +exports.rsort = rsort; +function rsort(list, loose) { + return list.sort(function(a, b) { + return exports.rcompare(a, b, loose); + }); +} + +exports.gt = gt; +function gt(a, b, loose) { + return compare(a, b, loose) > 0; +} + +exports.lt = lt; +function lt(a, b, loose) { + return compare(a, b, loose) < 0; +} + +exports.eq = eq; +function eq(a, b, loose) { + return compare(a, b, loose) === 0; +} + +exports.neq = neq; +function neq(a, b, loose) { + return compare(a, b, loose) !== 0; +} + +exports.gte = gte; +function gte(a, b, loose) { + return compare(a, b, loose) >= 0; +} + +exports.lte = lte; +function lte(a, b, loose) { + return compare(a, b, loose) <= 0; +} + +exports.cmp = cmp; +function cmp(a, op, b, loose) { + var ret; + switch (op) { + case '===': ret = a === b; break; + case '!==': ret = a !== b; break; + case '': case '=': case '==': ret = eq(a, b, loose); break; + case '!=': ret = neq(a, b, loose); break; + case '>': ret = gt(a, b, loose); break; + case '>=': ret = gte(a, b, loose); break; + case '<': ret = lt(a, b, loose); break; + case '<=': ret = lte(a, b, loose); break; + default: throw new TypeError('Invalid operator: ' + op); + } + return ret; +} + +exports.Comparator = Comparator; +function Comparator(comp, loose) { + if (comp instanceof Comparator) { + if (comp.loose === loose) + return comp; + else + comp = comp.value; + } + + if (!(this instanceof Comparator)) + return new Comparator(comp, loose); + + ; + this.loose = loose; + this.parse(comp); + + if (this.semver === ANY) + this.value = ''; + else + this.value = this.operator + this.semver.version; +} + +var ANY = {}; +Comparator.prototype.parse = function(comp) { + var r = this.loose ? re[COMPARATORLOOSE] : re[COMPARATOR]; + var m = comp.match(r); + + if (!m) + throw new TypeError('Invalid comparator: ' + comp); + + this.operator = m[1]; + if (this.operator === '=') + this.operator = ''; + + // if it literally is just '>' or '' then allow anything. + if (!m[2]) + this.semver = ANY; + else { + this.semver = new SemVer(m[2], this.loose); + + // <1.2.3-rc DOES allow 1.2.3-beta (has prerelease) + // >=1.2.3 DOES NOT allow 1.2.3-beta + // <=1.2.3 DOES allow 1.2.3-beta + // However, <1.2.3 does NOT allow 1.2.3-beta, + // even though `1.2.3-beta < 1.2.3` + // The assumption is that the 1.2.3 version has something you + // *don't* want, so we push the prerelease down to the minimum. + if (this.operator === '<' && !this.semver.prerelease.length) { + this.semver.prerelease = ['0']; + this.semver.format(); + } + } +}; + +Comparator.prototype.inspect = function() { + return ''; +}; + +Comparator.prototype.toString = function() { + return this.value; +}; + +Comparator.prototype.test = function(version) { + ; + return (this.semver === ANY) ? true : + cmp(version, this.operator, this.semver, this.loose); +}; + + +exports.Range = Range; +function Range(range, loose) { + if ((range instanceof Range) && range.loose === loose) + return range; + + if (!(this instanceof Range)) + return new Range(range, loose); + + this.loose = loose; + + // First, split based on boolean or || + this.raw = range; + this.set = range.split(/\s*\|\|\s*/).map(function(range) { + return this.parseRange(range.trim()); + }, this).filter(function(c) { + // throw out any that are not relevant for whatever reason + return c.length; + }); + + if (!this.set.length) { + throw new TypeError('Invalid SemVer Range: ' + range); + } + + this.format(); +} + +Range.prototype.inspect = function() { + return ''; +}; + +Range.prototype.format = function() { + this.range = this.set.map(function(comps) { + return comps.join(' ').trim(); + }).join('||').trim(); + return this.range; +}; + +Range.prototype.toString = function() { + return this.range; +}; + +Range.prototype.parseRange = function(range) { + var loose = this.loose; + range = range.trim(); + ; + // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4` + var hr = loose ? re[HYPHENRANGELOOSE] : re[HYPHENRANGE]; + range = range.replace(hr, hyphenReplace); + ; + // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5` + range = range.replace(re[COMPARATORTRIM], comparatorTrimReplace); + ; + + // `~ 1.2.3` => `~1.2.3` + range = range.replace(re[TILDETRIM], tildeTrimReplace); + + // `^ 1.2.3` => `^1.2.3` + range = range.replace(re[CARETTRIM], caretTrimReplace); + + // normalize spaces + range = range.split(/\s+/).join(' '); + + // At this point, the range is completely trimmed and + // ready to be split into comparators. + + var compRe = loose ? re[COMPARATORLOOSE] : re[COMPARATOR]; + var set = range.split(' ').map(function(comp) { + return parseComparator(comp, loose); + }).join(' ').split(/\s+/); + if (this.loose) { + // in loose mode, throw out any that are not valid comparators + set = set.filter(function(comp) { + return !!comp.match(compRe); + }); + } + set = set.map(function(comp) { + return new Comparator(comp, loose); + }); + + return set; +}; + +// Mostly just for testing and legacy API reasons +exports.toComparators = toComparators; +function toComparators(range, loose) { + return new Range(range, loose).set.map(function(comp) { + return comp.map(function(c) { + return c.value; + }).join(' ').trim().split(' '); + }); +} + +// comprised of xranges, tildes, stars, and gtlt's at this point. +// already replaced the hyphen ranges +// turn into a set of JUST comparators. +function parseComparator(comp, loose) { + ; + comp = replaceCarets(comp, loose); + ; + comp = replaceTildes(comp, loose); + ; + comp = replaceXRanges(comp, loose); + ; + comp = replaceStars(comp, loose); + ; + return comp; +} + +function isX(id) { + return !id || id.toLowerCase() === 'x' || id === '*'; +} + +// ~, ~> --> * (any, kinda silly) +// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0 +// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0 +// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0 +// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0 +// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0 +function replaceTildes(comp, loose) { + return comp.trim().split(/\s+/).map(function(comp) { + return replaceTilde(comp, loose); + }).join(' '); +} + +function replaceTilde(comp, loose) { + var r = loose ? re[TILDELOOSE] : re[TILDE]; + return comp.replace(r, function(_, M, m, p, pr) { + ; + var ret; + + if (isX(M)) + ret = ''; + else if (isX(m)) + ret = '>=' + M + '.0.0-0 <' + (+M + 1) + '.0.0-0'; + else if (isX(p)) + // ~1.2 == >=1.2.0- <1.3.0- + ret = '>=' + M + '.' + m + '.0-0 <' + M + '.' + (+m + 1) + '.0-0'; + else if (pr) { + ; + if (pr.charAt(0) !== '-') + pr = '-' + pr; + ret = '>=' + M + '.' + m + '.' + p + pr + + ' <' + M + '.' + (+m + 1) + '.0-0'; + } else + // ~1.2.3 == >=1.2.3-0 <1.3.0-0 + ret = '>=' + M + '.' + m + '.' + p + '-0' + + ' <' + M + '.' + (+m + 1) + '.0-0'; + + ; + return ret; + }); +} + +// ^ --> * (any, kinda silly) +// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0 +// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0 +// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0 +// ^1.2.3 --> >=1.2.3 <2.0.0 +// ^1.2.0 --> >=1.2.0 <2.0.0 +function replaceCarets(comp, loose) { + return comp.trim().split(/\s+/).map(function(comp) { + return replaceCaret(comp, loose); + }).join(' '); +} + +function replaceCaret(comp, loose) { + var r = loose ? re[CARETLOOSE] : re[CARET]; + return comp.replace(r, function(_, M, m, p, pr) { + ; + var ret; + if (pr) { + if (pr.charAt(0) !== '-') + pr = '-' + pr; + } else + pr = ''; + + if (isX(M)) + ret = ''; + else if (isX(m)) + ret = '>=' + M + '.0.0-0 <' + (+M + 1) + '.0.0-0'; + else if (isX(p)) { + if (M === '0') + ret = '>=' + M + '.' + m + '.0-0 <' + M + '.' + (+m + 1) + '.0-0'; + else + ret = '>=' + M + '.' + m + '.0-0 <' + (+M + 1) + '.0.0-0'; + } else if (M === '0') + ret = '=' + M + '.' + m + '.' + p + pr; + else if (pr) + ret = '>=' + M + '.' + m + '.' + p + pr + + ' <' + (+M + 1) + '.0.0-0'; + else + ret = '>=' + M + '.' + m + '.' + p + '-0' + + ' <' + (+M + 1) + '.0.0-0'; + + ; + return ret; + }); +} + +function replaceXRanges(comp, loose) { + ; + return comp.split(/\s+/).map(function(comp) { + return replaceXRange(comp, loose); + }).join(' '); +} + +function replaceXRange(comp, loose) { + comp = comp.trim(); + var r = loose ? re[XRANGELOOSE] : re[XRANGE]; + return comp.replace(r, function(ret, gtlt, M, m, p, pr) { + ; + var xM = isX(M); + var xm = xM || isX(m); + var xp = xm || isX(p); + var anyX = xp; + + if (gtlt === '=' && anyX) + gtlt = ''; + + if (gtlt && anyX) { + // replace X with 0, and then append the -0 min-prerelease + if (xM) + M = 0; + if (xm) + m = 0; + if (xp) + p = 0; + + if (gtlt === '>') { + // >1 => >=2.0.0-0 + // >1.2 => >=1.3.0-0 + // >1.2.3 => >= 1.2.4-0 + gtlt = '>='; + if (xM) { + // no change + } else if (xm) { + M = +M + 1; + m = 0; + p = 0; + } else if (xp) { + m = +m + 1; + p = 0; + } + } + + + ret = gtlt + M + '.' + m + '.' + p + '-0'; + } else if (xM) { + // allow any + ret = '*'; + } else if (xm) { + // append '-0' onto the version, otherwise + // '1.x.x' matches '2.0.0-beta', since the tag + // *lowers* the version value + ret = '>=' + M + '.0.0-0 <' + (+M + 1) + '.0.0-0'; + } else if (xp) { + ret = '>=' + M + '.' + m + '.0-0 <' + M + '.' + (+m + 1) + '.0-0'; + } + + ; + + return ret; + }); +} + +// Because * is AND-ed with everything else in the comparator, +// and '' means "any version", just remove the *s entirely. +function replaceStars(comp, loose) { + ; + // Looseness is ignored here. star is always as loose as it gets! + return comp.trim().replace(re[STAR], ''); +} + +// This function is passed to string.replace(re[HYPHENRANGE]) +// M, m, patch, prerelease, build +// 1.2 - 3.4.5 => >=1.2.0-0 <=3.4.5 +// 1.2.3 - 3.4 => >=1.2.0-0 <3.5.0-0 Any 3.4.x will do +// 1.2 - 3.4 => >=1.2.0-0 <3.5.0-0 +function hyphenReplace($0, + from, fM, fm, fp, fpr, fb, + to, tM, tm, tp, tpr, tb) { + + if (isX(fM)) + from = ''; + else if (isX(fm)) + from = '>=' + fM + '.0.0-0'; + else if (isX(fp)) + from = '>=' + fM + '.' + fm + '.0-0'; + else + from = '>=' + from; + + if (isX(tM)) + to = ''; + else if (isX(tm)) + to = '<' + (+tM + 1) + '.0.0-0'; + else if (isX(tp)) + to = '<' + tM + '.' + (+tm + 1) + '.0-0'; + else if (tpr) + to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr; + else + to = '<=' + to; + + return (from + ' ' + to).trim(); +} + + +// if ANY of the sets match ALL of its comparators, then pass +Range.prototype.test = function(version) { + if (!version) + return false; + for (var i = 0; i < this.set.length; i++) { + if (testSet(this.set[i], version)) + return true; + } + return false; +}; + +function testSet(set, version) { + for (var i = 0; i < set.length; i++) { + if (!set[i].test(version)) + return false; + } + return true; +} + +exports.satisfies = satisfies; +function satisfies(version, range, loose) { + try { + range = new Range(range, loose); + } catch (er) { + return false; + } + return range.test(version); +} + +exports.maxSatisfying = maxSatisfying; +function maxSatisfying(versions, range, loose) { + return versions.filter(function(version) { + return satisfies(version, range, loose); + }).sort(function(a, b) { + return rcompare(a, b, loose); + })[0] || null; +} + +exports.validRange = validRange; +function validRange(range, loose) { + try { + // Return '*' instead of '' so that truthiness works. + // This will throw if it's invalid anyway + return new Range(range, loose).range || '*'; + } catch (er) { + return null; + } +} + +// Determine if version is less than all the versions possible in the range +exports.ltr = ltr; +function ltr(version, range, loose) { + return outside(version, range, '<', loose); +} + +// Determine if version is greater than all the versions possible in the range. +exports.gtr = gtr; +function gtr(version, range, loose) { + return outside(version, range, '>', loose); +} + +exports.outside = outside; +function outside(version, range, hilo, loose) { + version = new SemVer(version, loose); + range = new Range(range, loose); + + var gtfn, ltefn, ltfn, comp, ecomp; + switch (hilo) { + case '>': + gtfn = gt; + ltefn = lte; + ltfn = lt; + comp = '>'; + ecomp = '>='; + break; + case '<': + gtfn = lt; + ltefn = gte; + ltfn = gt; + comp = '<'; + ecomp = '<='; + break; + default: + throw new TypeError('Must provide a hilo val of "<" or ">"'); + } + + // If it satisifes the range it is not outside + if (satisfies(version, range, loose)) { + return false; + } + + // From now on, variable terms are as if we're in "gtr" mode. + // but note that everything is flipped for the "ltr" function. + + for (var i = 0; i < range.set.length; ++i) { + var comparators = range.set[i]; + + var high = null; + var low = null; + + comparators.forEach(function(comparator) { + high = high || comparator; + low = low || comparator; + if (gtfn(comparator.semver, high.semver, loose)) { + high = comparator; + } else if (ltfn(comparator.semver, low.semver, loose)) { + low = comparator; + } + }); + + // If the edge version comparator has a operator then our version + // isn't outside it + if (high.operator === comp || high.operator === ecomp) { + return false; + } + + // If the lowest version comparator has an operator and our version + // is less than it then it isn't higher than the range + if ((!low.operator || low.operator === comp) && + ltefn(version, low.semver)) { + return false; + } else if (low.operator === ecomp && ltfn(version, low.semver)) { + return false; + } + } + return true; +} + +// Use the define() function if we're in AMD land +if (typeof define === 'function' && define.amd) + define(exports); + +})( + typeof exports === 'object' ? exports : + typeof define === 'function' && define.amd ? {} : + semver = {} +); diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/update-notifier/node_modules/semver-diff/node_modules/semver/semver.browser.js.gz b/packages/Bower.1.3.11/node_modules/bower/node_modules/update-notifier/node_modules/semver-diff/node_modules/semver/semver.browser.js.gz new file mode 100644 index 0000000..4ff42fe Binary files /dev/null and b/packages/Bower.1.3.11/node_modules/bower/node_modules/update-notifier/node_modules/semver-diff/node_modules/semver/semver.browser.js.gz differ diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/update-notifier/node_modules/semver-diff/node_modules/semver/semver.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/update-notifier/node_modules/semver-diff/node_modules/semver/semver.js new file mode 100644 index 0000000..a3413d7 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/update-notifier/node_modules/semver-diff/node_modules/semver/semver.js @@ -0,0 +1,1039 @@ +// export the class if we are in a Node-like system. +if (typeof module === 'object' && module.exports === exports) + exports = module.exports = SemVer; + +// The debug function is excluded entirely from the minified version. +/* nomin */ var debug; +/* nomin */ if (typeof process === 'object' && + /* nomin */ process.env && + /* nomin */ process.env.NODE_DEBUG && + /* nomin */ /\bsemver\b/i.test(process.env.NODE_DEBUG)) + /* nomin */ debug = function() { + /* nomin */ var args = Array.prototype.slice.call(arguments, 0); + /* nomin */ args.unshift('SEMVER'); + /* nomin */ console.log.apply(console, args); + /* nomin */ }; +/* nomin */ else + /* nomin */ debug = function() {}; + +// Note: this is the semver.org version of the spec that it implements +// Not necessarily the package version of this code. +exports.SEMVER_SPEC_VERSION = '2.0.0'; + +// The actual regexps go on exports.re +var re = exports.re = []; +var src = exports.src = []; +var R = 0; + +// The following Regular Expressions can be used for tokenizing, +// validating, and parsing SemVer version strings. + +// ## Numeric Identifier +// A single `0`, or a non-zero digit followed by zero or more digits. + +var NUMERICIDENTIFIER = R++; +src[NUMERICIDENTIFIER] = '0|[1-9]\\d*'; +var NUMERICIDENTIFIERLOOSE = R++; +src[NUMERICIDENTIFIERLOOSE] = '[0-9]+'; + + +// ## Non-numeric Identifier +// Zero or more digits, followed by a letter or hyphen, and then zero or +// more letters, digits, or hyphens. + +var NONNUMERICIDENTIFIER = R++; +src[NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*'; + + +// ## Main Version +// Three dot-separated numeric identifiers. + +var MAINVERSION = R++; +src[MAINVERSION] = '(' + src[NUMERICIDENTIFIER] + ')\\.' + + '(' + src[NUMERICIDENTIFIER] + ')\\.' + + '(' + src[NUMERICIDENTIFIER] + ')'; + +var MAINVERSIONLOOSE = R++; +src[MAINVERSIONLOOSE] = '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' + + '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' + + '(' + src[NUMERICIDENTIFIERLOOSE] + ')'; + +// ## Pre-release Version Identifier +// A numeric identifier, or a non-numeric identifier. + +var PRERELEASEIDENTIFIER = R++; +src[PRERELEASEIDENTIFIER] = '(?:' + src[NUMERICIDENTIFIER] + + '|' + src[NONNUMERICIDENTIFIER] + ')'; + +var PRERELEASEIDENTIFIERLOOSE = R++; +src[PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[NUMERICIDENTIFIERLOOSE] + + '|' + src[NONNUMERICIDENTIFIER] + ')'; + + +// ## Pre-release Version +// Hyphen, followed by one or more dot-separated pre-release version +// identifiers. + +var PRERELEASE = R++; +src[PRERELEASE] = '(?:-(' + src[PRERELEASEIDENTIFIER] + + '(?:\\.' + src[PRERELEASEIDENTIFIER] + ')*))'; + +var PRERELEASELOOSE = R++; +src[PRERELEASELOOSE] = '(?:-?(' + src[PRERELEASEIDENTIFIERLOOSE] + + '(?:\\.' + src[PRERELEASEIDENTIFIERLOOSE] + ')*))'; + +// ## Build Metadata Identifier +// Any combination of digits, letters, or hyphens. + +var BUILDIDENTIFIER = R++; +src[BUILDIDENTIFIER] = '[0-9A-Za-z-]+'; + +// ## Build Metadata +// Plus sign, followed by one or more period-separated build metadata +// identifiers. + +var BUILD = R++; +src[BUILD] = '(?:\\+(' + src[BUILDIDENTIFIER] + + '(?:\\.' + src[BUILDIDENTIFIER] + ')*))'; + + +// ## Full Version String +// A main version, followed optionally by a pre-release version and +// build metadata. + +// Note that the only major, minor, patch, and pre-release sections of +// the version string are capturing groups. The build metadata is not a +// capturing group, because it should not ever be used in version +// comparison. + +var FULL = R++; +var FULLPLAIN = 'v?' + src[MAINVERSION] + + src[PRERELEASE] + '?' + + src[BUILD] + '?'; + +src[FULL] = '^' + FULLPLAIN + '$'; + +// like full, but allows v1.2.3 and =1.2.3, which people do sometimes. +// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty +// common in the npm registry. +var LOOSEPLAIN = '[v=\\s]*' + src[MAINVERSIONLOOSE] + + src[PRERELEASELOOSE] + '?' + + src[BUILD] + '?'; + +var LOOSE = R++; +src[LOOSE] = '^' + LOOSEPLAIN + '$'; + +var GTLT = R++; +src[GTLT] = '((?:<|>)?=?)'; + +// Something like "2.*" or "1.2.x". +// Note that "x.x" is a valid xRange identifer, meaning "any version" +// Only the first item is strictly required. +var XRANGEIDENTIFIERLOOSE = R++; +src[XRANGEIDENTIFIERLOOSE] = src[NUMERICIDENTIFIERLOOSE] + '|x|X|\\*'; +var XRANGEIDENTIFIER = R++; +src[XRANGEIDENTIFIER] = src[NUMERICIDENTIFIER] + '|x|X|\\*'; + +var XRANGEPLAIN = R++; +src[XRANGEPLAIN] = '[v=\\s]*(' + src[XRANGEIDENTIFIER] + ')' + + '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' + + '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' + + '(?:(' + src[PRERELEASE] + ')' + + ')?)?)?'; + +var XRANGEPLAINLOOSE = R++; +src[XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[XRANGEIDENTIFIERLOOSE] + ')' + + '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' + + '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' + + '(?:(' + src[PRERELEASELOOSE] + ')' + + ')?)?)?'; + +// >=2.x, for example, means >=2.0.0-0 +// <1.x would be the same as "<1.0.0-0", though. +var XRANGE = R++; +src[XRANGE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAIN] + '$'; +var XRANGELOOSE = R++; +src[XRANGELOOSE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAINLOOSE] + '$'; + +// Tilde ranges. +// Meaning is "reasonably at or greater than" +var LONETILDE = R++; +src[LONETILDE] = '(?:~>?)'; + +var TILDETRIM = R++; +src[TILDETRIM] = '(\\s*)' + src[LONETILDE] + '\\s+'; +re[TILDETRIM] = new RegExp(src[TILDETRIM], 'g'); +var tildeTrimReplace = '$1~'; + +var TILDE = R++; +src[TILDE] = '^' + src[LONETILDE] + src[XRANGEPLAIN] + '$'; +var TILDELOOSE = R++; +src[TILDELOOSE] = '^' + src[LONETILDE] + src[XRANGEPLAINLOOSE] + '$'; + +// Caret ranges. +// Meaning is "at least and backwards compatible with" +var LONECARET = R++; +src[LONECARET] = '(?:\\^)'; + +var CARETTRIM = R++; +src[CARETTRIM] = '(\\s*)' + src[LONECARET] + '\\s+'; +re[CARETTRIM] = new RegExp(src[CARETTRIM], 'g'); +var caretTrimReplace = '$1^'; + +var CARET = R++; +src[CARET] = '^' + src[LONECARET] + src[XRANGEPLAIN] + '$'; +var CARETLOOSE = R++; +src[CARETLOOSE] = '^' + src[LONECARET] + src[XRANGEPLAINLOOSE] + '$'; + +// A simple gt/lt/eq thing, or just "" to indicate "any version" +var COMPARATORLOOSE = R++; +src[COMPARATORLOOSE] = '^' + src[GTLT] + '\\s*(' + LOOSEPLAIN + ')$|^$'; +var COMPARATOR = R++; +src[COMPARATOR] = '^' + src[GTLT] + '\\s*(' + FULLPLAIN + ')$|^$'; + + +// An expression to strip any whitespace between the gtlt and the thing +// it modifies, so that `> 1.2.3` ==> `>1.2.3` +var COMPARATORTRIM = R++; +src[COMPARATORTRIM] = '(\\s*)' + src[GTLT] + + '\\s*(' + LOOSEPLAIN + '|' + src[XRANGEPLAIN] + ')'; + +// this one has to use the /g flag +re[COMPARATORTRIM] = new RegExp(src[COMPARATORTRIM], 'g'); +var comparatorTrimReplace = '$1$2$3'; + + +// Something like `1.2.3 - 1.2.4` +// Note that these all use the loose form, because they'll be +// checked against either the strict or loose comparator form +// later. +var HYPHENRANGE = R++; +src[HYPHENRANGE] = '^\\s*(' + src[XRANGEPLAIN] + ')' + + '\\s+-\\s+' + + '(' + src[XRANGEPLAIN] + ')' + + '\\s*$'; + +var HYPHENRANGELOOSE = R++; +src[HYPHENRANGELOOSE] = '^\\s*(' + src[XRANGEPLAINLOOSE] + ')' + + '\\s+-\\s+' + + '(' + src[XRANGEPLAINLOOSE] + ')' + + '\\s*$'; + +// Star ranges basically just allow anything at all. +var STAR = R++; +src[STAR] = '(<|>)?=?\\s*\\*'; + +// Compile to actual regexp objects. +// All are flag-free, unless they were created above with a flag. +for (var i = 0; i < R; i++) { + debug(i, src[i]); + if (!re[i]) + re[i] = new RegExp(src[i]); +} + +exports.parse = parse; +function parse(version, loose) { + var r = loose ? re[LOOSE] : re[FULL]; + return (r.test(version)) ? new SemVer(version, loose) : null; +} + +exports.valid = valid; +function valid(version, loose) { + var v = parse(version, loose); + return v ? v.version : null; +} + + +exports.clean = clean; +function clean(version, loose) { + var s = parse(version.trim().replace(/^[=v]+/, ""), loose); + return s ? s.version : null; +} + +exports.SemVer = SemVer; + +function SemVer(version, loose) { + if (version instanceof SemVer) { + if (version.loose === loose) + return version; + else + version = version.version; + } else if (typeof version !== 'string') { + throw new TypeError('Invalid Version: ' + version); + } + + if (!(this instanceof SemVer)) + return new SemVer(version, loose); + + debug('SemVer', version, loose); + this.loose = loose; + var m = version.trim().match(loose ? re[LOOSE] : re[FULL]); + + if (!m) + throw new TypeError('Invalid Version: ' + version); + + this.raw = version; + + // these are actually numbers + this.major = +m[1]; + this.minor = +m[2]; + this.patch = +m[3]; + + // numberify any prerelease numeric ids + if (!m[4]) + this.prerelease = []; + else + this.prerelease = m[4].split('.').map(function(id) { + return (/^[0-9]+$/.test(id)) ? +id : id; + }); + + this.build = m[5] ? m[5].split('.') : []; + this.format(); +} + +SemVer.prototype.format = function() { + this.version = this.major + '.' + this.minor + '.' + this.patch; + if (this.prerelease.length) + this.version += '-' + this.prerelease.join('.'); + return this.version; +}; + +SemVer.prototype.inspect = function() { + return ''; +}; + +SemVer.prototype.toString = function() { + return this.version; +}; + +SemVer.prototype.compare = function(other) { + debug('SemVer.compare', this.version, this.loose, other); + if (!(other instanceof SemVer)) + other = new SemVer(other, this.loose); + + return this.compareMain(other) || this.comparePre(other); +}; + +SemVer.prototype.compareMain = function(other) { + if (!(other instanceof SemVer)) + other = new SemVer(other, this.loose); + + return compareIdentifiers(this.major, other.major) || + compareIdentifiers(this.minor, other.minor) || + compareIdentifiers(this.patch, other.patch); +}; + +SemVer.prototype.comparePre = function(other) { + if (!(other instanceof SemVer)) + other = new SemVer(other, this.loose); + + // NOT having a prerelease is > having one + if (this.prerelease.length && !other.prerelease.length) + return -1; + else if (!this.prerelease.length && other.prerelease.length) + return 1; + else if (!this.prerelease.length && !other.prerelease.length) + return 0; + + var i = 0; + do { + var a = this.prerelease[i]; + var b = other.prerelease[i]; + debug('prerelease compare', i, a, b); + if (a === undefined && b === undefined) + return 0; + else if (b === undefined) + return 1; + else if (a === undefined) + return -1; + else if (a === b) + continue; + else + return compareIdentifiers(a, b); + } while (++i); +}; + +// preminor will bump the version up to the next minor release, and immediately +// down to pre-release. premajor and prepatch work the same way. +SemVer.prototype.inc = function(release) { + switch (release) { + case 'premajor': + this.inc('major'); + this.inc('pre'); + break; + case 'preminor': + this.inc('minor'); + this.inc('pre'); + break; + case 'prepatch': + // If this is already a prerelease, it will bump to the next version + // drop any prereleases that might already exist, since they are not + // relevant at this point. + this.prerelease.length = 0; + this.inc('patch'); + this.inc('pre'); + break; + // If the input is a non-prerelease version, this acts the same as + // prepatch. + case 'prerelease': + if (this.prerelease.length === 0) + this.inc('patch'); + this.inc('pre'); + break; + case 'major': + this.major++; + this.minor = -1; + case 'minor': + this.minor++; + this.patch = 0; + this.prerelease = []; + break; + case 'patch': + // If this is not a pre-release version, it will increment the patch. + // If it is a pre-release it will bump up to the same patch version. + // 1.2.0-5 patches to 1.2.0 + // 1.2.0 patches to 1.2.1 + if (this.prerelease.length === 0) + this.patch++; + this.prerelease = []; + break; + // This probably shouldn't be used publically. + // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction. + case 'pre': + if (this.prerelease.length === 0) + this.prerelease = [0]; + else { + var i = this.prerelease.length; + while (--i >= 0) { + if (typeof this.prerelease[i] === 'number') { + this.prerelease[i]++; + i = -2; + } + } + if (i === -1) // didn't increment anything + this.prerelease.push(0); + } + break; + + default: + throw new Error('invalid increment argument: ' + release); + } + this.format(); + return this; +}; + +exports.inc = inc; +function inc(version, release, loose) { + try { + return new SemVer(version, loose).inc(release).version; + } catch (er) { + return null; + } +} + +exports.compareIdentifiers = compareIdentifiers; + +var numeric = /^[0-9]+$/; +function compareIdentifiers(a, b) { + var anum = numeric.test(a); + var bnum = numeric.test(b); + + if (anum && bnum) { + a = +a; + b = +b; + } + + return (anum && !bnum) ? -1 : + (bnum && !anum) ? 1 : + a < b ? -1 : + a > b ? 1 : + 0; +} + +exports.rcompareIdentifiers = rcompareIdentifiers; +function rcompareIdentifiers(a, b) { + return compareIdentifiers(b, a); +} + +exports.compare = compare; +function compare(a, b, loose) { + return new SemVer(a, loose).compare(b); +} + +exports.compareLoose = compareLoose; +function compareLoose(a, b) { + return compare(a, b, true); +} + +exports.rcompare = rcompare; +function rcompare(a, b, loose) { + return compare(b, a, loose); +} + +exports.sort = sort; +function sort(list, loose) { + return list.sort(function(a, b) { + return exports.compare(a, b, loose); + }); +} + +exports.rsort = rsort; +function rsort(list, loose) { + return list.sort(function(a, b) { + return exports.rcompare(a, b, loose); + }); +} + +exports.gt = gt; +function gt(a, b, loose) { + return compare(a, b, loose) > 0; +} + +exports.lt = lt; +function lt(a, b, loose) { + return compare(a, b, loose) < 0; +} + +exports.eq = eq; +function eq(a, b, loose) { + return compare(a, b, loose) === 0; +} + +exports.neq = neq; +function neq(a, b, loose) { + return compare(a, b, loose) !== 0; +} + +exports.gte = gte; +function gte(a, b, loose) { + return compare(a, b, loose) >= 0; +} + +exports.lte = lte; +function lte(a, b, loose) { + return compare(a, b, loose) <= 0; +} + +exports.cmp = cmp; +function cmp(a, op, b, loose) { + var ret; + switch (op) { + case '===': ret = a === b; break; + case '!==': ret = a !== b; break; + case '': case '=': case '==': ret = eq(a, b, loose); break; + case '!=': ret = neq(a, b, loose); break; + case '>': ret = gt(a, b, loose); break; + case '>=': ret = gte(a, b, loose); break; + case '<': ret = lt(a, b, loose); break; + case '<=': ret = lte(a, b, loose); break; + default: throw new TypeError('Invalid operator: ' + op); + } + return ret; +} + +exports.Comparator = Comparator; +function Comparator(comp, loose) { + if (comp instanceof Comparator) { + if (comp.loose === loose) + return comp; + else + comp = comp.value; + } + + if (!(this instanceof Comparator)) + return new Comparator(comp, loose); + + debug('comparator', comp, loose); + this.loose = loose; + this.parse(comp); + + if (this.semver === ANY) + this.value = ''; + else + this.value = this.operator + this.semver.version; +} + +var ANY = {}; +Comparator.prototype.parse = function(comp) { + var r = this.loose ? re[COMPARATORLOOSE] : re[COMPARATOR]; + var m = comp.match(r); + + if (!m) + throw new TypeError('Invalid comparator: ' + comp); + + this.operator = m[1]; + if (this.operator === '=') + this.operator = ''; + + // if it literally is just '>' or '' then allow anything. + if (!m[2]) + this.semver = ANY; + else { + this.semver = new SemVer(m[2], this.loose); + + // <1.2.3-rc DOES allow 1.2.3-beta (has prerelease) + // >=1.2.3 DOES NOT allow 1.2.3-beta + // <=1.2.3 DOES allow 1.2.3-beta + // However, <1.2.3 does NOT allow 1.2.3-beta, + // even though `1.2.3-beta < 1.2.3` + // The assumption is that the 1.2.3 version has something you + // *don't* want, so we push the prerelease down to the minimum. + if (this.operator === '<' && !this.semver.prerelease.length) { + this.semver.prerelease = ['0']; + this.semver.format(); + } + } +}; + +Comparator.prototype.inspect = function() { + return ''; +}; + +Comparator.prototype.toString = function() { + return this.value; +}; + +Comparator.prototype.test = function(version) { + debug('Comparator.test', version, this.loose); + return (this.semver === ANY) ? true : + cmp(version, this.operator, this.semver, this.loose); +}; + + +exports.Range = Range; +function Range(range, loose) { + if ((range instanceof Range) && range.loose === loose) + return range; + + if (!(this instanceof Range)) + return new Range(range, loose); + + this.loose = loose; + + // First, split based on boolean or || + this.raw = range; + this.set = range.split(/\s*\|\|\s*/).map(function(range) { + return this.parseRange(range.trim()); + }, this).filter(function(c) { + // throw out any that are not relevant for whatever reason + return c.length; + }); + + if (!this.set.length) { + throw new TypeError('Invalid SemVer Range: ' + range); + } + + this.format(); +} + +Range.prototype.inspect = function() { + return ''; +}; + +Range.prototype.format = function() { + this.range = this.set.map(function(comps) { + return comps.join(' ').trim(); + }).join('||').trim(); + return this.range; +}; + +Range.prototype.toString = function() { + return this.range; +}; + +Range.prototype.parseRange = function(range) { + var loose = this.loose; + range = range.trim(); + debug('range', range, loose); + // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4` + var hr = loose ? re[HYPHENRANGELOOSE] : re[HYPHENRANGE]; + range = range.replace(hr, hyphenReplace); + debug('hyphen replace', range); + // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5` + range = range.replace(re[COMPARATORTRIM], comparatorTrimReplace); + debug('comparator trim', range, re[COMPARATORTRIM]); + + // `~ 1.2.3` => `~1.2.3` + range = range.replace(re[TILDETRIM], tildeTrimReplace); + + // `^ 1.2.3` => `^1.2.3` + range = range.replace(re[CARETTRIM], caretTrimReplace); + + // normalize spaces + range = range.split(/\s+/).join(' '); + + // At this point, the range is completely trimmed and + // ready to be split into comparators. + + var compRe = loose ? re[COMPARATORLOOSE] : re[COMPARATOR]; + var set = range.split(' ').map(function(comp) { + return parseComparator(comp, loose); + }).join(' ').split(/\s+/); + if (this.loose) { + // in loose mode, throw out any that are not valid comparators + set = set.filter(function(comp) { + return !!comp.match(compRe); + }); + } + set = set.map(function(comp) { + return new Comparator(comp, loose); + }); + + return set; +}; + +// Mostly just for testing and legacy API reasons +exports.toComparators = toComparators; +function toComparators(range, loose) { + return new Range(range, loose).set.map(function(comp) { + return comp.map(function(c) { + return c.value; + }).join(' ').trim().split(' '); + }); +} + +// comprised of xranges, tildes, stars, and gtlt's at this point. +// already replaced the hyphen ranges +// turn into a set of JUST comparators. +function parseComparator(comp, loose) { + debug('comp', comp); + comp = replaceCarets(comp, loose); + debug('caret', comp); + comp = replaceTildes(comp, loose); + debug('tildes', comp); + comp = replaceXRanges(comp, loose); + debug('xrange', comp); + comp = replaceStars(comp, loose); + debug('stars', comp); + return comp; +} + +function isX(id) { + return !id || id.toLowerCase() === 'x' || id === '*'; +} + +// ~, ~> --> * (any, kinda silly) +// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0 +// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0 +// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0 +// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0 +// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0 +function replaceTildes(comp, loose) { + return comp.trim().split(/\s+/).map(function(comp) { + return replaceTilde(comp, loose); + }).join(' '); +} + +function replaceTilde(comp, loose) { + var r = loose ? re[TILDELOOSE] : re[TILDE]; + return comp.replace(r, function(_, M, m, p, pr) { + debug('tilde', comp, _, M, m, p, pr); + var ret; + + if (isX(M)) + ret = ''; + else if (isX(m)) + ret = '>=' + M + '.0.0-0 <' + (+M + 1) + '.0.0-0'; + else if (isX(p)) + // ~1.2 == >=1.2.0- <1.3.0- + ret = '>=' + M + '.' + m + '.0-0 <' + M + '.' + (+m + 1) + '.0-0'; + else if (pr) { + debug('replaceTilde pr', pr); + if (pr.charAt(0) !== '-') + pr = '-' + pr; + ret = '>=' + M + '.' + m + '.' + p + pr + + ' <' + M + '.' + (+m + 1) + '.0-0'; + } else + // ~1.2.3 == >=1.2.3-0 <1.3.0-0 + ret = '>=' + M + '.' + m + '.' + p + '-0' + + ' <' + M + '.' + (+m + 1) + '.0-0'; + + debug('tilde return', ret); + return ret; + }); +} + +// ^ --> * (any, kinda silly) +// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0 +// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0 +// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0 +// ^1.2.3 --> >=1.2.3 <2.0.0 +// ^1.2.0 --> >=1.2.0 <2.0.0 +function replaceCarets(comp, loose) { + return comp.trim().split(/\s+/).map(function(comp) { + return replaceCaret(comp, loose); + }).join(' '); +} + +function replaceCaret(comp, loose) { + var r = loose ? re[CARETLOOSE] : re[CARET]; + return comp.replace(r, function(_, M, m, p, pr) { + debug('caret', comp, _, M, m, p, pr); + var ret; + if (pr) { + if (pr.charAt(0) !== '-') + pr = '-' + pr; + } else + pr = ''; + + if (isX(M)) + ret = ''; + else if (isX(m)) + ret = '>=' + M + '.0.0-0 <' + (+M + 1) + '.0.0-0'; + else if (isX(p)) { + if (M === '0') + ret = '>=' + M + '.' + m + '.0-0 <' + M + '.' + (+m + 1) + '.0-0'; + else + ret = '>=' + M + '.' + m + '.0-0 <' + (+M + 1) + '.0.0-0'; + } else if (M === '0') + ret = '=' + M + '.' + m + '.' + p + pr; + else if (pr) + ret = '>=' + M + '.' + m + '.' + p + pr + + ' <' + (+M + 1) + '.0.0-0'; + else + ret = '>=' + M + '.' + m + '.' + p + '-0' + + ' <' + (+M + 1) + '.0.0-0'; + + debug('caret return', ret); + return ret; + }); +} + +function replaceXRanges(comp, loose) { + debug('replaceXRanges', comp, loose); + return comp.split(/\s+/).map(function(comp) { + return replaceXRange(comp, loose); + }).join(' '); +} + +function replaceXRange(comp, loose) { + comp = comp.trim(); + var r = loose ? re[XRANGELOOSE] : re[XRANGE]; + return comp.replace(r, function(ret, gtlt, M, m, p, pr) { + debug('xRange', comp, ret, gtlt, M, m, p, pr); + var xM = isX(M); + var xm = xM || isX(m); + var xp = xm || isX(p); + var anyX = xp; + + if (gtlt === '=' && anyX) + gtlt = ''; + + if (gtlt && anyX) { + // replace X with 0, and then append the -0 min-prerelease + if (xM) + M = 0; + if (xm) + m = 0; + if (xp) + p = 0; + + if (gtlt === '>') { + // >1 => >=2.0.0-0 + // >1.2 => >=1.3.0-0 + // >1.2.3 => >= 1.2.4-0 + gtlt = '>='; + if (xM) { + // no change + } else if (xm) { + M = +M + 1; + m = 0; + p = 0; + } else if (xp) { + m = +m + 1; + p = 0; + } + } + + + ret = gtlt + M + '.' + m + '.' + p + '-0'; + } else if (xM) { + // allow any + ret = '*'; + } else if (xm) { + // append '-0' onto the version, otherwise + // '1.x.x' matches '2.0.0-beta', since the tag + // *lowers* the version value + ret = '>=' + M + '.0.0-0 <' + (+M + 1) + '.0.0-0'; + } else if (xp) { + ret = '>=' + M + '.' + m + '.0-0 <' + M + '.' + (+m + 1) + '.0-0'; + } + + debug('xRange return', ret); + + return ret; + }); +} + +// Because * is AND-ed with everything else in the comparator, +// and '' means "any version", just remove the *s entirely. +function replaceStars(comp, loose) { + debug('replaceStars', comp, loose); + // Looseness is ignored here. star is always as loose as it gets! + return comp.trim().replace(re[STAR], ''); +} + +// This function is passed to string.replace(re[HYPHENRANGE]) +// M, m, patch, prerelease, build +// 1.2 - 3.4.5 => >=1.2.0-0 <=3.4.5 +// 1.2.3 - 3.4 => >=1.2.0-0 <3.5.0-0 Any 3.4.x will do +// 1.2 - 3.4 => >=1.2.0-0 <3.5.0-0 +function hyphenReplace($0, + from, fM, fm, fp, fpr, fb, + to, tM, tm, tp, tpr, tb) { + + if (isX(fM)) + from = ''; + else if (isX(fm)) + from = '>=' + fM + '.0.0-0'; + else if (isX(fp)) + from = '>=' + fM + '.' + fm + '.0-0'; + else + from = '>=' + from; + + if (isX(tM)) + to = ''; + else if (isX(tm)) + to = '<' + (+tM + 1) + '.0.0-0'; + else if (isX(tp)) + to = '<' + tM + '.' + (+tm + 1) + '.0-0'; + else if (tpr) + to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr; + else + to = '<=' + to; + + return (from + ' ' + to).trim(); +} + + +// if ANY of the sets match ALL of its comparators, then pass +Range.prototype.test = function(version) { + if (!version) + return false; + for (var i = 0; i < this.set.length; i++) { + if (testSet(this.set[i], version)) + return true; + } + return false; +}; + +function testSet(set, version) { + for (var i = 0; i < set.length; i++) { + if (!set[i].test(version)) + return false; + } + return true; +} + +exports.satisfies = satisfies; +function satisfies(version, range, loose) { + try { + range = new Range(range, loose); + } catch (er) { + return false; + } + return range.test(version); +} + +exports.maxSatisfying = maxSatisfying; +function maxSatisfying(versions, range, loose) { + return versions.filter(function(version) { + return satisfies(version, range, loose); + }).sort(function(a, b) { + return rcompare(a, b, loose); + })[0] || null; +} + +exports.validRange = validRange; +function validRange(range, loose) { + try { + // Return '*' instead of '' so that truthiness works. + // This will throw if it's invalid anyway + return new Range(range, loose).range || '*'; + } catch (er) { + return null; + } +} + +// Determine if version is less than all the versions possible in the range +exports.ltr = ltr; +function ltr(version, range, loose) { + return outside(version, range, '<', loose); +} + +// Determine if version is greater than all the versions possible in the range. +exports.gtr = gtr; +function gtr(version, range, loose) { + return outside(version, range, '>', loose); +} + +exports.outside = outside; +function outside(version, range, hilo, loose) { + version = new SemVer(version, loose); + range = new Range(range, loose); + + var gtfn, ltefn, ltfn, comp, ecomp; + switch (hilo) { + case '>': + gtfn = gt; + ltefn = lte; + ltfn = lt; + comp = '>'; + ecomp = '>='; + break; + case '<': + gtfn = lt; + ltefn = gte; + ltfn = gt; + comp = '<'; + ecomp = '<='; + break; + default: + throw new TypeError('Must provide a hilo val of "<" or ">"'); + } + + // If it satisifes the range it is not outside + if (satisfies(version, range, loose)) { + return false; + } + + // From now on, variable terms are as if we're in "gtr" mode. + // but note that everything is flipped for the "ltr" function. + + for (var i = 0; i < range.set.length; ++i) { + var comparators = range.set[i]; + + var high = null; + var low = null; + + comparators.forEach(function(comparator) { + high = high || comparator; + low = low || comparator; + if (gtfn(comparator.semver, high.semver, loose)) { + high = comparator; + } else if (ltfn(comparator.semver, low.semver, loose)) { + low = comparator; + } + }); + + // If the edge version comparator has a operator then our version + // isn't outside it + if (high.operator === comp || high.operator === ecomp) { + return false; + } + + // If the lowest version comparator has an operator and our version + // is less than it then it isn't higher than the range + if ((!low.operator || low.operator === comp) && + ltefn(version, low.semver)) { + return false; + } else if (low.operator === ecomp && ltfn(version, low.semver)) { + return false; + } + } + return true; +} + +// Use the define() function if we're in AMD land +if (typeof define === 'function' && define.amd) + define(exports); diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/update-notifier/node_modules/semver-diff/node_modules/semver/semver.min.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/update-notifier/node_modules/semver-diff/node_modules/semver/semver.min.js new file mode 100644 index 0000000..04e4abb --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/update-notifier/node_modules/semver-diff/node_modules/semver/semver.min.js @@ -0,0 +1 @@ +(function(e){if(typeof module==="object"&&module.exports===e)e=module.exports=H;e.SEMVER_SPEC_VERSION="2.0.0";var r=e.re=[];var t=e.src=[];var n=0;var i=n++;t[i]="0|[1-9]\\d*";var s=n++;t[s]="[0-9]+";var a=n++;t[a]="\\d*[a-zA-Z-][a-zA-Z0-9-]*";var o=n++;t[o]="("+t[i]+")\\."+"("+t[i]+")\\."+"("+t[i]+")";var f=n++;t[f]="("+t[s]+")\\."+"("+t[s]+")\\."+"("+t[s]+")";var u=n++;t[u]="(?:"+t[i]+"|"+t[a]+")";var c=n++;t[c]="(?:"+t[s]+"|"+t[a]+")";var l=n++;t[l]="(?:-("+t[u]+"(?:\\."+t[u]+")*))";var p=n++;t[p]="(?:-?("+t[c]+"(?:\\."+t[c]+")*))";var h=n++;t[h]="[0-9A-Za-z-]+";var v=n++;t[v]="(?:\\+("+t[h]+"(?:\\."+t[h]+")*))";var m=n++;var g="v?"+t[o]+t[l]+"?"+t[v]+"?";t[m]="^"+g+"$";var w="[v=\\s]*"+t[f]+t[p]+"?"+t[v]+"?";var d=n++;t[d]="^"+w+"$";var y=n++;t[y]="((?:<|>)?=?)";var b=n++;t[b]=t[s]+"|x|X|\\*";var $=n++;t[$]=t[i]+"|x|X|\\*";var j=n++;t[j]="[v=\\s]*("+t[$]+")"+"(?:\\.("+t[$]+")"+"(?:\\.("+t[$]+")"+"(?:("+t[l]+")"+")?)?)?";var k=n++;t[k]="[v=\\s]*("+t[b]+")"+"(?:\\.("+t[b]+")"+"(?:\\.("+t[b]+")"+"(?:("+t[p]+")"+")?)?)?";var E=n++;t[E]="^"+t[y]+"\\s*"+t[j]+"$";var x=n++;t[x]="^"+t[y]+"\\s*"+t[k]+"$";var R=n++;t[R]="(?:~>?)";var S=n++;t[S]="(\\s*)"+t[R]+"\\s+";r[S]=new RegExp(t[S],"g");var V="$1~";var I=n++;t[I]="^"+t[R]+t[j]+"$";var T=n++;t[T]="^"+t[R]+t[k]+"$";var A=n++;t[A]="(?:\\^)";var C=n++;t[C]="(\\s*)"+t[A]+"\\s+";r[C]=new RegExp(t[C],"g");var M="$1^";var z=n++;t[z]="^"+t[A]+t[j]+"$";var P=n++;t[P]="^"+t[A]+t[k]+"$";var Z=n++;t[Z]="^"+t[y]+"\\s*("+w+")$|^$";var q=n++;t[q]="^"+t[y]+"\\s*("+g+")$|^$";var L=n++;t[L]="(\\s*)"+t[y]+"\\s*("+w+"|"+t[j]+")";r[L]=new RegExp(t[L],"g");var X="$1$2$3";var _=n++;t[_]="^\\s*("+t[j]+")"+"\\s+-\\s+"+"("+t[j]+")"+"\\s*$";var N=n++;t[N]="^\\s*("+t[k]+")"+"\\s+-\\s+"+"("+t[k]+")"+"\\s*$";var O=n++;t[O]="(<|>)?=?\\s*\\*";for(var B=0;B'};H.prototype.toString=function(){return this.version};H.prototype.compare=function(e){if(!(e instanceof H))e=new H(e,this.loose);return this.compareMain(e)||this.comparePre(e)};H.prototype.compareMain=function(e){if(!(e instanceof H))e=new H(e,this.loose);return Q(this.major,e.major)||Q(this.minor,e.minor)||Q(this.patch,e.patch)};H.prototype.comparePre=function(e){if(!(e instanceof H))e=new H(e,this.loose);if(this.prerelease.length&&!e.prerelease.length)return-1;else if(!this.prerelease.length&&e.prerelease.length)return 1;else if(!this.prerelease.length&&!e.prerelease.length)return 0;var r=0;do{var t=this.prerelease[r];var n=e.prerelease[r];if(t===undefined&&n===undefined)return 0;else if(n===undefined)return 1;else if(t===undefined)return-1;else if(t===n)continue;else return Q(t,n)}while(++r)};H.prototype.inc=function(e){switch(e){case"premajor":this.inc("major");this.inc("pre");break;case"preminor":this.inc("minor");this.inc("pre");break;case"prepatch":this.prerelease.length=0;this.inc("patch");this.inc("pre");break;case"prerelease":if(this.prerelease.length===0)this.inc("patch");this.inc("pre");break;case"major":this.major++;this.minor=-1;case"minor":this.minor++;this.patch=0;this.prerelease=[];break;case"patch":if(this.prerelease.length===0)this.patch++;this.prerelease=[];break;case"pre":if(this.prerelease.length===0)this.prerelease=[0];else{var r=this.prerelease.length;while(--r>=0){if(typeof this.prerelease[r]==="number"){this.prerelease[r]++;r=-2}}if(r===-1)this.prerelease.push(0)}break;default:throw new Error("invalid increment argument: "+e)}this.format();return this};e.inc=J;function J(e,r,t){try{return new H(e,t).inc(r).version}catch(n){return null}}e.compareIdentifiers=Q;var K=/^[0-9]+$/;function Q(e,r){var t=K.test(e);var n=K.test(r);if(t&&n){e=+e;r=+r}return t&&!n?-1:n&&!t?1:er?1:0}e.rcompareIdentifiers=U;function U(e,r){return Q(r,e)}e.compare=W;function W(e,r,t){return new H(e,t).compare(r)}e.compareLoose=Y;function Y(e,r){return W(e,r,true)}e.rcompare=er;function er(e,r,t){return W(r,e,t)}e.sort=rr;function rr(r,t){return r.sort(function(r,n){return e.compare(r,n,t)})}e.rsort=tr;function tr(r,t){return r.sort(function(r,n){return e.rcompare(r,n,t)})}e.gt=nr;function nr(e,r,t){return W(e,r,t)>0}e.lt=ir;function ir(e,r,t){return W(e,r,t)<0}e.eq=sr;function sr(e,r,t){return W(e,r,t)===0}e.neq=ar;function ar(e,r,t){return W(e,r,t)!==0}e.gte=or;function or(e,r,t){return W(e,r,t)>=0}e.lte=fr;function fr(e,r,t){return W(e,r,t)<=0}e.cmp=ur;function ur(e,r,t,n){var i;switch(r){case"===":i=e===t;break;case"!==":i=e!==t;break;case"":case"=":case"==":i=sr(e,t,n);break;case"!=":i=ar(e,t,n);break;case">":i=nr(e,t,n);break;case">=":i=or(e,t,n);break;case"<":i=ir(e,t,n);break;case"<=":i=fr(e,t,n);break;default:throw new TypeError("Invalid operator: "+r)}return i}e.Comparator=cr;function cr(e,r){if(e instanceof cr){if(e.loose===r)return e;else e=e.value}if(!(this instanceof cr))return new cr(e,r);this.loose=r;this.parse(e);if(this.semver===lr)this.value="";else this.value=this.operator+this.semver.version}var lr={};cr.prototype.parse=function(e){var t=this.loose?r[Z]:r[q];var n=e.match(t);if(!n)throw new TypeError("Invalid comparator: "+e);this.operator=n[1];if(this.operator==="=")this.operator="";if(!n[2])this.semver=lr;else{this.semver=new H(n[2],this.loose);if(this.operator==="<"&&!this.semver.prerelease.length){this.semver.prerelease=["0"];this.semver.format()}}};cr.prototype.inspect=function(){return''};cr.prototype.toString=function(){return this.value};cr.prototype.test=function(e){return this.semver===lr?true:ur(e,this.operator,this.semver,this.loose)};e.Range=pr;function pr(e,r){if(e instanceof pr&&e.loose===r)return e;if(!(this instanceof pr))return new pr(e,r);this.loose=r;this.raw=e;this.set=e.split(/\s*\|\|\s*/).map(function(e){return this.parseRange(e.trim())},this).filter(function(e){return e.length});if(!this.set.length){throw new TypeError("Invalid SemVer Range: "+e)}this.format()}pr.prototype.inspect=function(){return''};pr.prototype.format=function(){this.range=this.set.map(function(e){return e.join(" ").trim()}).join("||").trim();return this.range};pr.prototype.toString=function(){return this.range};pr.prototype.parseRange=function(e){var t=this.loose;e=e.trim();var n=t?r[N]:r[_];e=e.replace(n,kr);e=e.replace(r[L],X);e=e.replace(r[S],V);e=e.replace(r[C],M);e=e.split(/\s+/).join(" ");var i=t?r[Z]:r[q];var s=e.split(" ").map(function(e){return vr(e,t)}).join(" ").split(/\s+/);if(this.loose){s=s.filter(function(e){return!!e.match(i)})}s=s.map(function(e){return new cr(e,t)});return s};e.toComparators=hr;function hr(e,r){return new pr(e,r).set.map(function(e){return e.map(function(e){return e.value}).join(" ").trim().split(" ")})}function vr(e,r){e=dr(e,r);e=gr(e,r);e=br(e,r);e=jr(e,r);return e}function mr(e){return!e||e.toLowerCase()==="x"||e==="*"}function gr(e,r){return e.trim().split(/\s+/).map(function(e){return wr(e,r)}).join(" ")}function wr(e,t){var n=t?r[T]:r[I];return e.replace(n,function(e,r,t,n,i){var s;if(mr(r))s="";else if(mr(t))s=">="+r+".0.0-0 <"+(+r+1)+".0.0-0";else if(mr(n))s=">="+r+"."+t+".0-0 <"+r+"."+(+t+1)+".0-0";else if(i){if(i.charAt(0)!=="-")i="-"+i;s=">="+r+"."+t+"."+n+i+" <"+r+"."+(+t+1)+".0-0"}else s=">="+r+"."+t+"."+n+"-0"+" <"+r+"."+(+t+1)+".0-0";return s})}function dr(e,r){return e.trim().split(/\s+/).map(function(e){return yr(e,r)}).join(" ")}function yr(e,t){var n=t?r[P]:r[z];return e.replace(n,function(e,r,t,n,i){var s;if(i){if(i.charAt(0)!=="-")i="-"+i}else i="";if(mr(r))s="";else if(mr(t))s=">="+r+".0.0-0 <"+(+r+1)+".0.0-0";else if(mr(n)){if(r==="0")s=">="+r+"."+t+".0-0 <"+r+"."+(+t+1)+".0-0";else s=">="+r+"."+t+".0-0 <"+(+r+1)+".0.0-0"}else if(r==="0")s="="+r+"."+t+"."+n+i;else if(i)s=">="+r+"."+t+"."+n+i+" <"+(+r+1)+".0.0-0";else s=">="+r+"."+t+"."+n+"-0"+" <"+(+r+1)+".0.0-0";return s})}function br(e,r){return e.split(/\s+/).map(function(e){return $r(e,r)}).join(" ")}function $r(e,t){e=e.trim();var n=t?r[x]:r[E];return e.replace(n,function(e,r,t,n,i,s){var a=mr(t);var o=a||mr(n);var f=o||mr(i);var u=f;if(r==="="&&u)r="";if(r&&u){if(a)t=0;if(o)n=0;if(f)i=0;if(r===">"){r=">=";if(a){}else if(o){t=+t+1;n=0;i=0}else if(f){n=+n+1;i=0}}e=r+t+"."+n+"."+i+"-0"}else if(a){e="*"}else if(o){e=">="+t+".0.0-0 <"+(+t+1)+".0.0-0"}else if(f){e=">="+t+"."+n+".0-0 <"+t+"."+(+n+1)+".0-0"}return e})}function jr(e,t){return e.trim().replace(r[O],"")}function kr(e,r,t,n,i,s,a,o,f,u,c,l,p){if(mr(t))r="";else if(mr(n))r=">="+t+".0.0-0";else if(mr(i))r=">="+t+"."+n+".0-0";else r=">="+r;if(mr(f))o="";else if(mr(u))o="<"+(+f+1)+".0.0-0";else if(mr(c))o="<"+f+"."+(+u+1)+".0-0";else if(l)o="<="+f+"."+u+"."+c+"-"+l;else o="<="+o;return(r+" "+o).trim()}pr.prototype.test=function(e){if(!e)return false;for(var r=0;r",t)}e.outside=Tr;function Tr(e,r,t,n){e=new H(e,n);r=new pr(r,n);var i,s,a,o,f;switch(t){case">":i=nr;s=fr;a=ir;o=">";f=">=";break;case"<":i=ir;s=or;a=nr;o="<";f="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(xr(e,r,n)){return false}for(var u=0;u=0.10.0" + }, + "scripts": { + "test": "mocha" + }, + "files": [ + "index.js" + ], + "keywords": [ + "semver", + "version", + "semantic", + "diff", + "difference" + ], + "dependencies": { + "semver": "^3.0.1" + }, + "devDependencies": { + "mocha": "*" + }, + "gitHead": "9bf149f9beee7dced2a035429cf525c8372e84f5", + "bugs": { + "url": "https://github.com/sindresorhus/semver-diff/issues" + }, + "homepage": "https://github.com/sindresorhus/semver-diff", + "_id": "semver-diff@1.0.0", + "_shasum": "efa952393625b56d21ba146661dff68e90552b25", + "_from": "semver-diff@^1.0.0", + "_npmVersion": "1.4.14", + "_npmUser": { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + } + ], + "dist": { + "shasum": "efa952393625b56d21ba146661dff68e90552b25", + "tarball": "http://registry.npmjs.org/semver-diff/-/semver-diff-1.0.0.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/semver-diff/-/semver-diff-1.0.0.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/update-notifier/package.json b/packages/Bower.1.3.11/node_modules/bower/node_modules/update-notifier/package.json new file mode 100644 index 0000000..bf09c5c --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/update-notifier/package.json @@ -0,0 +1,93 @@ +{ + "name": "update-notifier", + "version": "0.2.1", + "description": "Update notifications for your CLI app", + "license": "BSD", + "repository": { + "type": "git", + "url": "git://github.com/yeoman/update-notifier" + }, + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "http://sindresorhus.com" + }, + "engines": { + "node": ">=0.10.0" + }, + "scripts": { + "test": "mocha --timeout 20000" + }, + "files": [ + "index.js", + "check.js" + ], + "keywords": [ + "npm", + "update", + "updater", + "notify", + "notifier", + "check", + "checker", + "cli", + "module", + "package", + "version" + ], + "dependencies": { + "chalk": "^0.5.1", + "configstore": "^0.3.1", + "latest-version": "^1.0.0", + "semver-diff": "^1.0.0", + "string-length": "^1.0.0" + }, + "devDependencies": { + "mocha": "*" + }, + "bugs": { + "url": "https://github.com/yeoman/update-notifier/issues" + }, + "homepage": "https://github.com/yeoman/update-notifier", + "_id": "update-notifier@0.2.1", + "_shasum": "72dabbd3e506a09c39d8a90f4807295166c1d424", + "_from": "update-notifier@~0.2.0", + "_npmVersion": "1.4.9", + "_npmUser": { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + { + "name": "addyosmani", + "email": "addyosmani@gmail.com" + }, + { + "name": "paulirish", + "email": "paul.irish@gmail.com" + }, + { + "name": "passy", + "email": "phartig@rdrei.net" + }, + { + "name": "sboudrias", + "email": "admin@simonboudrias.com" + }, + { + "name": "eddiemonge", + "email": "eddie+npm@eddiemonge.com" + } + ], + "dist": { + "shasum": "72dabbd3e506a09c39d8a90f4807295166c1d424", + "tarball": "http://registry.npmjs.org/update-notifier/-/update-notifier-0.2.1.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/update-notifier/-/update-notifier-0.2.1.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/which/bin/which b/packages/Bower.1.3.11/node_modules/bower/node_modules/which/bin/which new file mode 100644 index 0000000..8432ce2 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/which/bin/which @@ -0,0 +1,14 @@ +#!/usr/bin/env node +var which = require("../") +if (process.argv.length < 3) { + console.error("Usage: which ") + process.exit(1) +} + +which(process.argv[2], function (er, thing) { + if (er) { + console.error(er.message) + process.exit(er.errno || 127) + } + console.log(thing) +}) diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/which/package.json b/packages/Bower.1.3.11/node_modules/bower/node_modules/which/package.json new file mode 100644 index 0000000..4e0981a --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/which/package.json @@ -0,0 +1,53 @@ +{ + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me" + }, + "name": "which", + "description": "Like which(1) unix command. Find the first instance of an executable in the PATH.", + "version": "1.0.5", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/node-which.git" + }, + "main": "which.js", + "bin": { + "which": "./bin/which" + }, + "engines": { + "node": "*" + }, + "dependencies": {}, + "devDependencies": {}, + "_npmUser": { + "name": "isaacs", + "email": "i@izs.me" + }, + "_id": "which@1.0.5", + "optionalDependencies": {}, + "_engineSupported": true, + "_npmVersion": "1.1.2", + "_nodeVersion": "v0.7.6-pre", + "_defaultsLoaded": true, + "dist": { + "shasum": "5630d6819dda692f1464462e7956cb42c0842739", + "tarball": "http://registry.npmjs.org/which/-/which-1.0.5.tgz" + }, + "readme": "The \"which\" util from npm's guts.\n\nFinds the first instance of a specified executable in the PATH\nenvironment variable. Does not cache the results, so `hash -r` is not\nneeded when the PATH changes.\n", + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + } + ], + "directories": {}, + "_shasum": "5630d6819dda692f1464462e7956cb42c0842739", + "_from": "which@~1.0.5", + "_resolved": "https://registry.npmjs.org/which/-/which-1.0.5.tgz", + "bugs": { + "url": "https://github.com/isaacs/node-which/issues" + }, + "homepage": "https://github.com/isaacs/node-which", + "scripts": {} +} diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/which/which.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/which/which.js new file mode 100644 index 0000000..db7e8f7 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/which/which.js @@ -0,0 +1,104 @@ +module.exports = which +which.sync = whichSync + +var path = require("path") + , fs + , COLON = process.platform === "win32" ? ";" : ":" + , isExe + +try { + fs = require("graceful-fs") +} catch (ex) { + fs = require("fs") +} + +if (process.platform == "win32") { + // On windows, there is no good way to check that a file is executable + isExe = function isExe () { return true } +} else { + isExe = function isExe (mod, uid, gid) { + //console.error(mod, uid, gid); + //console.error("isExe?", (mod & 0111).toString(8)) + var ret = (mod & 0001) + || (mod & 0010) && process.getgid && gid === process.getgid() + || (mod & 0100) && process.getuid && uid === process.getuid() + //console.error("isExe?", ret) + return ret + } +} + + + +function which (cmd, cb) { + if (isAbsolute(cmd)) return cb(null, cmd) + var pathEnv = (process.env.PATH || "").split(COLON) + , pathExt = [""] + if (process.platform === "win32") { + pathEnv.push(process.cwd()) + pathExt = (process.env.PATHEXT || ".EXE").split(COLON) + if (cmd.indexOf(".") !== -1) pathExt.unshift("") + } + //console.error("pathEnv", pathEnv) + ;(function F (i, l) { + if (i === l) return cb(new Error("not found: "+cmd)) + var p = path.resolve(pathEnv[i], cmd) + ;(function E (ii, ll) { + if (ii === ll) return F(i + 1, l) + var ext = pathExt[ii] + //console.error(p + ext) + fs.stat(p + ext, function (er, stat) { + if (!er && + stat && + stat.isFile() && + isExe(stat.mode, stat.uid, stat.gid)) { + //console.error("yes, exe!", p + ext) + return cb(null, p + ext) + } + return E(ii + 1, ll) + }) + })(0, pathExt.length) + })(0, pathEnv.length) +} + +function whichSync (cmd) { + if (isAbsolute(cmd)) return cmd + var pathEnv = (process.env.PATH || "").split(COLON) + , pathExt = [""] + if (process.platform === "win32") { + pathEnv.push(process.cwd()) + pathExt = (process.env.PATHEXT || ".EXE").split(COLON) + if (cmd.indexOf(".") !== -1) pathExt.unshift("") + } + for (var i = 0, l = pathEnv.length; i < l; i ++) { + var p = path.join(pathEnv[i], cmd) + for (var j = 0, ll = pathExt.length; j < ll; j ++) { + var cur = p + pathExt[j] + var stat + try { stat = fs.statSync(cur) } catch (ex) {} + if (stat && + stat.isFile() && + isExe(stat.mode, stat.uid, stat.gid)) return cur + } + } + throw new Error("not found: "+cmd) +} + +var isAbsolute = process.platform === "win32" ? absWin : absUnix + +function absWin (p) { + if (absUnix(p)) return true + // pull off the device/UNC bit from a windows path. + // from node's lib/path.js + var splitDeviceRe = + /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?([\\\/])?/ + , result = splitDeviceRe.exec(p) + , device = result[1] || '' + , isUnc = device && device.charAt(1) !== ':' + , isAbsolute = !!result[2] || isUnc // UNC paths are always absolute + + return isAbsolute +} + +function absUnix (p) { + return p.charAt(0) === "/" || p === "" +} diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/wordwrap/index.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/wordwrap/index.js new file mode 100644 index 0000000..c9bc945 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/wordwrap/index.js @@ -0,0 +1,76 @@ +var wordwrap = module.exports = function (start, stop, params) { + if (typeof start === 'object') { + params = start; + start = params.start; + stop = params.stop; + } + + if (typeof stop === 'object') { + params = stop; + start = start || params.start; + stop = undefined; + } + + if (!stop) { + stop = start; + start = 0; + } + + if (!params) params = {}; + var mode = params.mode || 'soft'; + var re = mode === 'hard' ? /\b/ : /(\S+\s+)/; + + return function (text) { + var chunks = text.toString() + .split(re) + .reduce(function (acc, x) { + if (mode === 'hard') { + for (var i = 0; i < x.length; i += stop - start) { + acc.push(x.slice(i, i + stop - start)); + } + } + else acc.push(x) + return acc; + }, []) + ; + + return chunks.reduce(function (lines, rawChunk) { + if (rawChunk === '') return lines; + + var chunk = rawChunk.replace(/\t/g, ' '); + + var i = lines.length - 1; + if (lines[i].length + chunk.length > stop) { + lines[i] = lines[i].replace(/\s+$/, ''); + + chunk.split(/\n/).forEach(function (c) { + lines.push( + new Array(start + 1).join(' ') + + c.replace(/^\s+/, '') + ); + }); + } + else if (chunk.match(/\n/)) { + var xs = chunk.split(/\n/); + lines[i] += xs.shift(); + xs.forEach(function (c) { + lines.push( + new Array(start + 1).join(' ') + + c.replace(/^\s+/, '') + ); + }); + } + else { + lines[i] += chunk; + } + + return lines; + }, [ new Array(start + 1).join(' ') ]).join('\n'); + }; +}; + +wordwrap.soft = wordwrap; + +wordwrap.hard = function (start, stop) { + return wordwrap(start, stop, { mode : 'hard' }); +}; diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/wordwrap/package.json b/packages/Bower.1.3.11/node_modules/bower/node_modules/wordwrap/package.json new file mode 100644 index 0000000..68a89f6 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/wordwrap/package.json @@ -0,0 +1,61 @@ +{ + "name": "wordwrap", + "description": "Wrap those words. Show them at what columns to start and stop.", + "version": "0.0.2", + "repository": { + "type": "git", + "url": "git://github.com/substack/node-wordwrap.git" + }, + "main": "./index.js", + "keywords": [ + "word", + "wrap", + "rule", + "format", + "column" + ], + "directories": { + "lib": ".", + "example": "example", + "test": "test" + }, + "scripts": { + "test": "expresso" + }, + "devDependencies": { + "expresso": "=0.7.x" + }, + "engines": { + "node": ">=0.4.0" + }, + "license": "MIT/X11", + "author": { + "name": "James Halliday", + "email": "mail@substack.net", + "url": "http://substack.net" + }, + "_id": "wordwrap@0.0.2", + "dependencies": {}, + "_engineSupported": true, + "_npmVersion": "1.0.10", + "_nodeVersion": "v0.5.0-pre", + "_defaultsLoaded": true, + "dist": { + "shasum": "b79669bb42ecb409f83d583cad52ca17eaa1643f", + "tarball": "http://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz" + }, + "maintainers": [ + { + "name": "substack", + "email": "mail@substack.net" + } + ], + "_shasum": "b79669bb42ecb409f83d583cad52ca17eaa1643f", + "_from": "wordwrap@0.0.2", + "_resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz", + "bugs": { + "url": "https://github.com/substack/node-wordwrap/issues" + }, + "readme": "ERROR: No README data found!", + "homepage": "https://github.com/substack/node-wordwrap" +} diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/wrappy/package.json b/packages/Bower.1.3.11/node_modules/bower/node_modules/wrappy/package.json new file mode 100644 index 0000000..b88e662 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/wrappy/package.json @@ -0,0 +1,52 @@ +{ + "name": "wrappy", + "version": "1.0.1", + "description": "Callback wrapping utility", + "main": "wrappy.js", + "directories": { + "test": "test" + }, + "dependencies": {}, + "devDependencies": { + "tap": "^0.4.12" + }, + "scripts": { + "test": "tap test/*.js" + }, + "repository": { + "type": "git", + "url": "https://github.com/npm/wrappy" + }, + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "license": "ISC", + "bugs": { + "url": "https://github.com/npm/wrappy/issues" + }, + "homepage": "https://github.com/npm/wrappy", + "gitHead": "006a8cbac6b99988315834c207896eed71fd069a", + "_id": "wrappy@1.0.1", + "_shasum": "1e65969965ccbc2db4548c6b84a6f2c5aedd4739", + "_from": "wrappy@1.0.1", + "_npmVersion": "2.0.0", + "_nodeVersion": "0.10.31", + "_npmUser": { + "name": "isaacs", + "email": "i@izs.me" + }, + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + } + ], + "dist": { + "shasum": "1e65969965ccbc2db4548c6b84a6f2c5aedd4739", + "tarball": "http://registry.npmjs.org/wrappy/-/wrappy-1.0.1.tgz" + }, + "_resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.1.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/packages/Bower.1.3.11/node_modules/bower/node_modules/wrappy/wrappy.js b/packages/Bower.1.3.11/node_modules/bower/node_modules/wrappy/wrappy.js new file mode 100644 index 0000000..bb7e7d6 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/node_modules/wrappy/wrappy.js @@ -0,0 +1,33 @@ +// Returns a wrapper function that returns a wrapped callback +// The wrapper function should do some stuff, and return a +// presumably different callback function. +// This makes sure that own properties are retained, so that +// decorations and such are not lost along the way. +module.exports = wrappy +function wrappy (fn, cb) { + if (fn && cb) return wrappy(fn)(cb) + + if (typeof fn !== 'function') + throw new TypeError('need wrapper function') + + Object.keys(fn).forEach(function (k) { + wrapper[k] = fn[k] + }) + + return wrapper + + function wrapper() { + var args = new Array(arguments.length) + for (var i = 0; i < args.length; i++) { + args[i] = arguments[i] + } + var ret = fn.apply(this, args) + var cb = args[args.length-1] + if (typeof ret === 'function' && ret !== cb) { + Object.keys(cb).forEach(function (k) { + ret[k] = cb[k] + }) + } + return ret + } +} diff --git a/packages/Bower.1.3.11/node_modules/bower/package.json b/packages/Bower.1.3.11/node_modules/bower/package.json new file mode 100644 index 0000000..b13cda6 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/package.json @@ -0,0 +1,134 @@ +{ + "name": "bower", + "version": "1.3.11", + "description": "The browser package manager", + "author": { + "name": "Twitter" + }, + "licenses": [ + { + "type": "MIT", + "url": "https://github.com/bower/bower/blob/master/LICENSE" + } + ], + "repository": { + "type": "git", + "url": "https://github.com/bower/bower" + }, + "main": "lib", + "homepage": "http://bower.io", + "engines": { + "node": ">=0.10.0" + }, + "dependencies": { + "abbrev": "~1.0.4", + "archy": "0.0.2", + "bower-config": "~0.5.2", + "bower-endpoint-parser": "~0.2.2", + "bower-json": "~0.4.0", + "bower-logger": "~0.2.2", + "bower-registry-client": "~0.2.0", + "cardinal": "~0.4.0", + "chalk": "~0.5.0", + "chmodr": "~0.1.0", + "decompress-zip": "0.0.8", + "fstream": "~1.0.2", + "fstream-ignore": "~1.0.1", + "glob": "~4.0.2", + "graceful-fs": "~3.0.1", + "handlebars": "~2.0.0", + "inquirer": "~0.7.1", + "insight": "~0.4.3", + "is-root": "~1.0.0", + "junk": "~1.0.0", + "lockfile": "~1.0.0", + "lru-cache": "~2.5.0", + "mkdirp": "~0.5.0", + "mout": "~0.10.0", + "nopt": "~3.0.0", + "opn": "~1.0.0", + "osenv": "~0.1.0", + "p-throttler": "0.1.0", + "promptly": "~0.2.0", + "q": "~1.0.1", + "request": "~2.42.0", + "request-progress": "~0.3.0", + "retry": "~0.6.0", + "rimraf": "~2.2.0", + "semver": "~2.3.0", + "shell-quote": "~1.4.1", + "stringify-object": "~1.0.0", + "tar-fs": "~0.5.0", + "tmp": "0.0.23", + "update-notifier": "~0.2.0", + "which": "~1.0.5" + }, + "devDependencies": { + "coveralls": "~2.11.0", + "expect.js": "~0.3.1", + "grunt": "~0.4.4", + "grunt-cli": "^0.1.13", + "grunt-contrib-jshint": "~0.10.0", + "grunt-contrib-watch": "~0.6.1", + "grunt-exec": "~0.4.2", + "grunt-simple-mocha": "~0.4.0", + "istanbul": "~0.3.2", + "load-grunt-tasks": "~0.6.0", + "mocha": "~1.21.4", + "nock": "~0.46.0", + "node-uuid": "~1.4.1", + "proxyquire": "~1.0.1" + }, + "scripts": { + "test": "grunt test" + }, + "bin": { + "bower": "bin/bower" + }, + "preferGlobal": true, + "gitHead": "e97bf479fb804f57bb1437bf4ad14ce2cd2bf837", + "bugs": { + "url": "https://github.com/bower/bower/issues" + }, + "_id": "bower@1.3.11", + "_shasum": "174fe11dafb69d28478d2896878e06f1ed47b789", + "_from": "bower@", + "_npmVersion": "1.4.23", + "_npmUser": { + "name": "sheerun", + "email": "sheerun@sher.pl" + }, + "maintainers": [ + { + "name": "fat", + "email": "jacobthornton@gmail.com" + }, + { + "name": "satazor", + "email": "andremiguelcruz@msn.com" + }, + { + "name": "wibblymat", + "email": "mat@wibbly.org.uk" + }, + { + "name": "paulirish", + "email": "paul.irish@gmail.com" + }, + { + "name": "sheerun", + "email": "sheerun@sher.pl" + }, + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + } + ], + "dist": { + "shasum": "174fe11dafb69d28478d2896878e06f1ed47b789", + "tarball": "http://registry.npmjs.org/bower/-/bower-1.3.11.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/bower/-/bower-1.3.11.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/packages/Bower.1.3.11/node_modules/bower/templates/helpers/colors.js b/packages/Bower.1.3.11/node_modules/bower/templates/helpers/colors.js new file mode 100644 index 0000000..f9727b4 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/templates/helpers/colors.js @@ -0,0 +1,20 @@ +var chalk = require('chalk'); + +var templateColors = [ + 'yellow', + 'green', + 'cyan', + 'red', + 'white', + 'magenta' +]; + +function colors(Handlebars) { + templateColors.forEach(function (color) { + Handlebars.registerHelper(color, function (context) { + return chalk[color](context.fn(this)); + }); + }); +} + +module.exports = colors; diff --git a/packages/Bower.1.3.11/node_modules/bower/templates/helpers/condense.js b/packages/Bower.1.3.11/node_modules/bower/templates/helpers/condense.js new file mode 100644 index 0000000..3b8d366 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/templates/helpers/condense.js @@ -0,0 +1,22 @@ +var mout = require('mout'); +var leadLinesRegExp = /^\r?\n/; +var multipleLinesRegExp = /\r?\n(\r?\n)+/mg; + +function condense(Handlebars) { + Handlebars.registerHelper('condense', function (context) { + var str = context.fn(this); + + // Remove multiple lines + str = str.replace(multipleLinesRegExp, '$1'); + + // Remove leading new lines (while keeping indentation) + str = str.replace(leadLinesRegExp, ''); + + // Remove trailing whitespaces (including new lines); + str = mout.string.rtrim(str); + + return str; + }); +} + +module.exports = condense; diff --git a/packages/Bower.1.3.11/node_modules/bower/templates/helpers/indent.js b/packages/Bower.1.3.11/node_modules/bower/templates/helpers/indent.js new file mode 100644 index 0000000..7738f62 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/templates/helpers/indent.js @@ -0,0 +1,12 @@ +var mout = require('mout'); + +function indent(Handlebars) { + Handlebars.registerHelper('indent', function (context) { + var hash = context.hash; + var indentStr = mout.string.repeat(' ', parseInt(hash.level, 10)); + + return context.fn(this).replace(/\n/g, '\n' + indentStr); + }); +} + +module.exports = indent; diff --git a/packages/Bower.1.3.11/node_modules/bower/templates/helpers/index.js b/packages/Bower.1.3.11/node_modules/bower/templates/helpers/index.js new file mode 100644 index 0000000..fcc17a4 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/templates/helpers/index.js @@ -0,0 +1,7 @@ +module.exports = { + colors: require('./colors'), + condense: require('./condense'), + indent: require('./indent'), + rpad: require('./rpad'), + sum: require('./sum') +}; diff --git a/packages/Bower.1.3.11/node_modules/bower/templates/helpers/rpad.js b/packages/Bower.1.3.11/node_modules/bower/templates/helpers/rpad.js new file mode 100644 index 0000000..d5201d2 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/templates/helpers/rpad.js @@ -0,0 +1,13 @@ +var mout = require('mout'); + +function rpad(Handlebars) { + Handlebars.registerHelper('rpad', function (context) { + var hash = context.hash; + var length = parseInt(hash.length, 10); + var chr = hash.char; + + return mout.string.rpad(context.fn(this), length, chr); + }); +} + +module.exports = rpad; diff --git a/packages/Bower.1.3.11/node_modules/bower/templates/helpers/sum.js b/packages/Bower.1.3.11/node_modules/bower/templates/helpers/sum.js new file mode 100644 index 0000000..62e0b3c --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/templates/helpers/sum.js @@ -0,0 +1,7 @@ +function sum(Handlebars) { + Handlebars.registerHelper('sum', function (val1, val2) { + return val1 + val2; + }); +} + +module.exports = sum; diff --git a/packages/Bower.1.3.11/node_modules/bower/templates/json/help-cache.json b/packages/Bower.1.3.11/node_modules/bower/templates/json/help-cache.json new file mode 100644 index 0000000..fbd99cc --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/templates/json/help-cache.json @@ -0,0 +1,11 @@ +{ + "command": "cache", + "usage": [ + "cache [] []" + ], + "commands": { + "clean": "Clean cached packages", + "list": "List cached packages" + }, + "options": [] +} diff --git a/packages/Bower.1.3.11/node_modules/bower/templates/json/help-cache/clean.json b/packages/Bower.1.3.11/node_modules/bower/templates/json/help-cache/clean.json new file mode 100644 index 0000000..daf5ee6 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/templates/json/help-cache/clean.json @@ -0,0 +1,16 @@ +{ + "command": "cache list", + "description": "Cleans cached packages.", + "usage": [ + "cache clean []", + "cache clean [ ...] []", + "cache clean # [# ..] []" + ], + "options": [ + { + "shorthand": "-h", + "flag": "--help", + "description": "Show this help message" + } + ] +} diff --git a/packages/Bower.1.3.11/node_modules/bower/templates/json/help-cache/list.json b/packages/Bower.1.3.11/node_modules/bower/templates/json/help-cache/list.json new file mode 100644 index 0000000..2abf375 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/templates/json/help-cache/list.json @@ -0,0 +1,15 @@ +{ + "command": "cache clean", + "description": "Lists cached packages.", + "usage": [ + "cache list []", + "cache list [ ...] []" + ], + "options": [ + { + "shorthand": "-h", + "flag": "--help", + "description": "Show this help message" + } + ] +} diff --git a/packages/Bower.1.3.11/node_modules/bower/templates/json/help-home.json b/packages/Bower.1.3.11/node_modules/bower/templates/json/help-home.json new file mode 100644 index 0000000..e4d0222 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/templates/json/help-home.json @@ -0,0 +1,16 @@ +{ + "command": "home", + "description": "Opens a package homepage into your favorite browser.\n\nIf no is passed, opens the homepage of the local package.", + "usage": [ + "home []", + "home []", + "home # []" + ], + "options": [ + { + "shorthand": "-h", + "flag": "--help", + "description": "Show this help message" + } + ] +} diff --git a/packages/Bower.1.3.11/node_modules/bower/templates/json/help-info.json b/packages/Bower.1.3.11/node_modules/bower/templates/json/help-info.json new file mode 100644 index 0000000..2167249 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/templates/json/help-info.json @@ -0,0 +1,16 @@ +{ + "command": "info", + "description": "Displays overall information of a package or of a particular version.", + "usage": [ + "info []", + "info [] []", + "info # [] []" + ], + "options": [ + { + "shorthand": "-h", + "flag": "--help", + "description": "Show this help message" + } + ] +} diff --git a/packages/Bower.1.3.11/node_modules/bower/templates/json/help-init.json b/packages/Bower.1.3.11/node_modules/bower/templates/json/help-init.json new file mode 100644 index 0000000..774e0b4 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/templates/json/help-init.json @@ -0,0 +1,14 @@ +{ + "command": "init", + "description": "Creates a bower.json file based on answers to questions.", + "usage": [ + "init []" + ], + "options": [ + { + "shorthand": "-h", + "flag": "--help", + "description": "Show this help message" + } + ] +} diff --git a/packages/Bower.1.3.11/node_modules/bower/templates/json/help-install.json b/packages/Bower.1.3.11/node_modules/bower/templates/json/help-install.json new file mode 100644 index 0000000..8e118d2 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/templates/json/help-install.json @@ -0,0 +1,35 @@ +{ + "command": "install", + "description": "Installs the project dependencies or a specific set of endpoints.\nEndpoints can have multiple forms:\n- \n- #\n- =#\n\nWhere:\n- is a package URL, physical location or registry name\n- is a valid range, commit, branch, etc.\n- is the name it should have locally.", + "usage": [ + "install []", + "install [ ..] []" + ], + "options": [ + { + "shorthand": "-F", + "flag": "--force-latest", + "description": "Force latest version on conflict" + }, + { + "shorthand": "-h", + "flag": "--help", + "description": "Show this help message" + }, + { + "shorthand": "-p", + "flag": "--production", + "description": "Do not install project devDependencies" + }, + { + "shorthand": "-S", + "flag": "--save", + "description": "Save installed packages into the project's bower.json dependencies" + }, + { + "shorthand": "-D", + "flag": "--save-dev", + "description": "Save installed packages into the project's bower.json devDependencies" + } + ] +} diff --git a/packages/Bower.1.3.11/node_modules/bower/templates/json/help-link.json b/packages/Bower.1.3.11/node_modules/bower/templates/json/help-link.json new file mode 100644 index 0000000..eb674c6 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/templates/json/help-link.json @@ -0,0 +1,15 @@ +{ + "command": "link", + "description": "The link functionality allows developers to easily test their packages.\nLinking is a two-step process.\n\nUsing 'bower link' in a project folder will create a global link.\nThen, in some other package, 'bower link ' will create a link in the components folder pointing to the previously created link.\n\nThis allows to easily test a package because changes will be reflected immediately.\nWhen the link is no longer necessary, simply remove it with 'bower uninstall '.", + "usage": [ + "link []", + "link [] []" + ], + "options": [ + { + "shorthand": "-h", + "flag": "--help", + "description": "Show this help message" + } + ] +} diff --git a/packages/Bower.1.3.11/node_modules/bower/templates/json/help-list.json b/packages/Bower.1.3.11/node_modules/bower/templates/json/help-list.json new file mode 100644 index 0000000..a183f5c --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/templates/json/help-list.json @@ -0,0 +1,24 @@ +{ + "command": "list", + "description": "List local packages - and possible updates.", + "usage": [ + "list []" + ], + "options": [ + { + "shorthand": "-h", + "flag": "--help", + "description": "Show this help message" + }, + { + "shorthand": "-p", + "flag": "--paths", + "description": "Generates a simple JSON source mapping" + }, + { + "shorthand": "-r", + "flag": "--relative", + "description": "Make paths relative to the directory config property, which defaults to bower_components" + } + ] +} diff --git a/packages/Bower.1.3.11/node_modules/bower/templates/json/help-lookup.json b/packages/Bower.1.3.11/node_modules/bower/templates/json/help-lookup.json new file mode 100644 index 0000000..26080b7 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/templates/json/help-lookup.json @@ -0,0 +1,14 @@ +{ + "command": "lookup", + "description": "Looks up a package URL by name.", + "usage": [ + "lookup []" + ], + "options": [ + { + "shorthand": "-h", + "flag": "--help", + "description": "Show this help message" + } + ] +} diff --git a/packages/Bower.1.3.11/node_modules/bower/templates/json/help-prune.json b/packages/Bower.1.3.11/node_modules/bower/templates/json/help-prune.json new file mode 100644 index 0000000..676debc --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/templates/json/help-prune.json @@ -0,0 +1,14 @@ +{ + "command": "prune", + "description": "Uninstalls local extraneous packages.", + "usage": [ + "prune []" + ], + "options": [ + { + "shorthand": "-h", + "flag": "--help", + "description": "Show this help message" + } + ] +} diff --git a/packages/Bower.1.3.11/node_modules/bower/templates/json/help-register.json b/packages/Bower.1.3.11/node_modules/bower/templates/json/help-register.json new file mode 100644 index 0000000..8e01ce4 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/templates/json/help-register.json @@ -0,0 +1,14 @@ +{ + "command": "register", + "description": "Registers a package.", + "usage": [ + "register []" + ], + "options": [ + { + "shorthand": "-h", + "flag": "--help", + "description": "Show this help message" + } + ] +} diff --git a/packages/Bower.1.3.11/node_modules/bower/templates/json/help-search.json b/packages/Bower.1.3.11/node_modules/bower/templates/json/help-search.json new file mode 100644 index 0000000..7298b82 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/templates/json/help-search.json @@ -0,0 +1,15 @@ +{ + "command": "search", + "description": "Finds all packages or a specific package.", + "usage": [ + "search []", + "search []" + ], + "options": [ + { + "shorthand": "-h", + "flag": "--help", + "description": "Show this help message" + } + ] +} diff --git a/packages/Bower.1.3.11/node_modules/bower/templates/json/help-uninstall.json b/packages/Bower.1.3.11/node_modules/bower/templates/json/help-uninstall.json new file mode 100644 index 0000000..318f899 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/templates/json/help-uninstall.json @@ -0,0 +1,24 @@ +{ + "command": "uninstall", + "description": "Uninstalls a package locally from your bower_components directory", + "usage": [ + "uninstall [ ..] []" + ], + "options": [ + { + "shorthand": "-h", + "flag": "--help", + "description": "Show this help message" + }, + { + "shorthand": "-S", + "flag": "--save", + "description": "Remove uninstalled packages from the project's bower.json dependencies" + }, + { + "shorthand": "-D", + "flag": "--save-dev", + "description": "Remove uninstalled packages from the project's bower.json devDependencies" + } + ] +} diff --git a/packages/Bower.1.3.11/node_modules/bower/templates/json/help-update.json b/packages/Bower.1.3.11/node_modules/bower/templates/json/help-update.json new file mode 100644 index 0000000..2d98255 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/templates/json/help-update.json @@ -0,0 +1,24 @@ +{ + "command": "update", + "description": "Updates installed packages to their newest version according to bower.json.", + "usage": [ + "update [ ..] []" + ], + "options": [ + { + "shorthand": "-F", + "flag": "--force-latest", + "description": "Force latest version on conflict" + }, + { + "shorthand": "-h", + "flag": "--help", + "description": "Show this help message" + }, + { + "shorthand": "-p", + "flag": "--production", + "description": "Do not install project devDependencies" + } + ] +} diff --git a/packages/Bower.1.3.11/node_modules/bower/templates/json/help-version.json b/packages/Bower.1.3.11/node_modules/bower/templates/json/help-version.json new file mode 100644 index 0000000..605ef20 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/templates/json/help-version.json @@ -0,0 +1,14 @@ +{ + "command": "version", + "description": "Run this in a package directory to bump the version and write the new data back to the bower.json file.\n\nThe newversion argument should be a valid semver string, or a valid second argument to semver.inc (one of \"build\", \"patch\", \"minor\", or \"major\"). In the second case, the existing version will be incremented\nby 1 in the specified field.\n\nIf run in a git repo, it will also create a version commit and tag, and fail if the repo is not clean.\n\nIf supplied with --message (shorthand: -m) config option, bower will use it as a commit message when creating a version commit. If the message config contains %s then that will be replaced with the resulting\nversion number. For example:\n\n bower version patch -m \"Upgrade to %s for reasons\"", + "usage": [ + "version [ | major | minor | patch]" + ], + "options": [ + { + "shorthand": "-m", + "flag": "--message", + "description": "Custom git commit and tag message" + } + ] +} diff --git a/packages/Bower.1.3.11/node_modules/bower/templates/json/help.json b/packages/Bower.1.3.11/node_modules/bower/templates/json/help.json new file mode 100644 index 0000000..52e1265 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/templates/json/help.json @@ -0,0 +1,67 @@ +{ + "usage": [ + " [] []" + ], + "commands": { + "cache": "Manage bower cache", + "help": "Display help information about Bower", + "home": "Opens a package homepage into your favorite browser", + "info": "Info of a particular package", + "init": "Interactively create a bower.json file", + "install": "Install a package locally", + "link": "Symlink a package folder", + "list": "List local packages - and possible updates", + "lookup": "Look up a package URL by name", + "prune": "Removes local extraneous packages", + "register": "Register a package", + "search": "Search for a package by name", + "update": "Update a local package", + "uninstall": "Remove a local package", + "version": "Bump a package version" + }, + "options": [ + { + "shorthand": "-f", + "flag": "--force", + "description": "Makes various commands more forceful" + }, + { + "shorthand": "-j", + "flag": "--json", + "description": "Output consumable JSON" + }, + { + "shorthand": "-l", + "flag": "--log-level", + "description": "What level of logs to report" + }, + { + "shorthand": "-o", + "flag": "--offline", + "description": "Do not hit the network" + }, + { + "shorthand": "-q", + "flag": "--quiet", + "description": "Only output important information" + }, + { + "shorthand": "-s", + "flag": "--silent", + "description": "Do not output anything, besides errors" + }, + { + "shorthand": "-V", + "flag": "--verbose", + "description": "Makes output more verbose" + }, + { + "flag": "--allow-root", + "description": "Allows running commands as root" + }, + { + "flag": "--version", + "description": "Output Bower version" + } + ] +} diff --git a/packages/Bower.1.3.11/node_modules/bower/templates/std/conflict-resolved.std b/packages/Bower.1.3.11/node_modules/bower/templates/std/conflict-resolved.std new file mode 100644 index 0000000..b6c2673 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/templates/std/conflict-resolved.std @@ -0,0 +1,9 @@ +{{#yellow}}Please note that,{{/yellow}} +{{#condense}} +{{#each picks}} + {{#if dependants}}{{#green}}{{dependants}}{{/green}}{{else}}none{{/if}} depends on {{#cyan}}{{endpoint.name}}#{{endpoint.target}}{{/cyan}}{{#if pkgMeta._release}} which resolved to {{#green}}{{endpoint.name}}#{{pkgMeta._release}}{{/green}}{{/if}} +{{/each}} +{{/condense}} + +Resort to using {{#cyan}}{{suitable.endpoint.name}}#{{resolution}}{{/cyan}} which resolved to {{#green}}{{suitable.endpoint.name}}#{{suitable.pkgMeta._release}}{{/green}} +Code incompatibilities may occur. diff --git a/packages/Bower.1.3.11/node_modules/bower/templates/std/conflict.std b/packages/Bower.1.3.11/node_modules/bower/templates/std/conflict.std new file mode 100644 index 0000000..2a16dd3 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/templates/std/conflict.std @@ -0,0 +1,9 @@ +{{#yellow}}Unable to find a suitable version for {{name}}, please choose one:{{/yellow}} +{{#condense}} +{{#each picks}} + {{#magenta}}{{sum @index 1}}){{/magenta}} {{#cyan}}{{endpoint.name}}#{{endpoint.target}}{{/cyan}}{{#if pkgMeta._release}} which resolved to {{#green}}{{pkgMeta._release}}{{/green}}{{/if}}{{#if dependants}} and is required by {{#green}}{{dependants}}{{/green}} {{/if}} +{{/each}} +{{/condense}} +{{#unless saveResolutions}} +Prefix the choice with ! to persist it to bower.json +{{/unless}} diff --git a/packages/Bower.1.3.11/node_modules/bower/templates/std/help-cache.std b/packages/Bower.1.3.11/node_modules/bower/templates/std/help-cache.std new file mode 100644 index 0000000..369968f --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/templates/std/help-cache.std @@ -0,0 +1,16 @@ + +Usage: + +{{#condense}} +{{#each usage}} + {{#cyan}}bower{{/cyan}} {{.}} +{{/each}} +{{/condense}} + +Commands: + +{{#condense}} +{{#each commands}} + {{#rpad length="23"}}{{@key}}{{/rpad}} {{.}} +{{/each}} +{{/condense}} diff --git a/packages/Bower.1.3.11/node_modules/bower/templates/std/help-generic.std b/packages/Bower.1.3.11/node_modules/bower/templates/std/help-generic.std new file mode 100644 index 0000000..b573a97 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/templates/std/help-generic.std @@ -0,0 +1,22 @@ + +Usage: + +{{#condense}} +{{#each usage}} + {{#cyan}}bower{{/cyan}} {{.}} +{{/each}} +{{/condense}} + +Options: + +{{#condense}} +{{#each options}} + {{#yellow}}{{#rpad length="23"}}{{#if shorthand}}{{shorthand}}, {{/if}}{{flag}}{{/rpad}}{{/yellow}} {{description}} +{{/each}} +{{/condense}} + + Additionally all global options listed in 'bower help' are available + +Description: + + {{#indent level="4"}}{{description}}{{/indent}} diff --git a/packages/Bower.1.3.11/node_modules/bower/templates/std/help.std b/packages/Bower.1.3.11/node_modules/bower/templates/std/help.std new file mode 100644 index 0000000..7f1127e --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/templates/std/help.std @@ -0,0 +1,26 @@ + +Usage: + +{{#condense}} +{{#each usage}} + {{#cyan}}bower{{/cyan}} {{.}} +{{/each}} +{{/condense}} + +Commands: + +{{#condense}} +{{#each commands}} + {{#rpad length="23"}}{{@key}}{{/rpad}} {{.}} +{{/each}} +{{/condense}} + +Options: + +{{#condense}} +{{#each options}} + {{#yellow}}{{#rpad length="23"}}{{#if shorthand}}{{shorthand}}, {{/if}}{{flag}}{{/rpad}}{{/yellow}} {{description}} +{{/each}} +{{/condense}} + +See 'bower help ' for more information on a specific command. diff --git a/packages/Bower.1.3.11/node_modules/bower/templates/std/info.std b/packages/Bower.1.3.11/node_modules/bower/templates/std/info.std new file mode 100644 index 0000000..ffa9ab6 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/templates/std/info.std @@ -0,0 +1,10 @@ +{{#if versions}}{{#cyan}}Available versions:{{/cyan}} +{{#condense}} +{{#versions}} + - {{.}} +{{/versions}} +{{/condense}} + +You can request info for a specific version with 'bower info {{name}}#' +{{else}}No versions available. +{{/if}} \ No newline at end of file diff --git a/packages/Bower.1.3.11/node_modules/bower/templates/std/lookup.std b/packages/Bower.1.3.11/node_modules/bower/templates/std/lookup.std new file mode 100644 index 0000000..3bab824 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/templates/std/lookup.std @@ -0,0 +1,7 @@ +{{#condense}} +{{#if url}} +{{#cyan}}{{name}}{{/cyan}} {{url}} +{{else}} +Package not found. +{{/if}} +{{/condense}} diff --git a/packages/Bower.1.3.11/node_modules/bower/templates/std/register.std b/packages/Bower.1.3.11/node_modules/bower/templates/std/register.std new file mode 100644 index 0000000..31b157c --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/templates/std/register.std @@ -0,0 +1,5 @@ +Package {{#cyan}}{{name}}{{/cyan}} registered successfully! +All valid semver tags on {{#cyan}}{{url}}{{/cyan}} will be available as versions. +To publish a new version, just release a valid semver tag. + +Run {{#cyan}}bower info {{name}}{{/cyan}} to list the available versions. diff --git a/packages/Bower.1.3.11/node_modules/bower/templates/std/search-results.std b/packages/Bower.1.3.11/node_modules/bower/templates/std/search-results.std new file mode 100644 index 0000000..c73d3e7 --- /dev/null +++ b/packages/Bower.1.3.11/node_modules/bower/templates/std/search-results.std @@ -0,0 +1,9 @@ +{{#if .}}Search results: + +{{#condense}} +{{#.}} + {{#cyan}}{{{name}}}{{/cyan}} {{{url}}} +{{/.}} +{{/condense}} +{{else}}No results. +{{/if}} \ No newline at end of file diff --git a/packages/Bower.1.3.11/readme.txt b/packages/Bower.1.3.11/readme.txt new file mode 100644 index 0000000..c86cbb6 --- /dev/null +++ b/packages/Bower.1.3.11/readme.txt @@ -0,0 +1,64 @@ +Bower 1.3.11 +============ + +Bower is a package manager for client-side JavaScript. It is platform independent (unlike +NuGet, gem or npm) works with bare Git repositories, and because of this - largely +supported in JavaScript community. That's why Bower becomes a standard client-side package +manager on all platforms. + + +Installation overview +--------------------- + +Bower cmd is installed into .bin dir in your project, along with Node.js cmd. NuGet rules are +the same: everything deployed by NuGet, so use package restore and ignore packages in VCS. + +Node.js and Git is not needed to be installed on dev machines or build servers. + + +Automation +---------- + +Use ".bin\bower" command to run Bower in your build scripts. For example, here is a simple +MsBuild target to restore Bower packages defined in bower.json: + + + + + + +Daily usage +----------- + +Because ".bin" was added to your PATH, you should be able to run Bower directly in the +command prompt from the project dir. For example, if "MySite.Web" is a project dir: + +D:\Projects\MySite\MySite.Web> bower install requirejs + +Note: add ".bin" to the PATH manually for other developers in your team. +Note: if PATH was changed, restart your command prompt to refresh environment variables. + + +Proxy settings +-------------- + +If Bower should use a proxy for remote connections, set 'HTTP_PROXY' and/or 'HTTPS_PROXY' +environment variables to the proxy URL. For Node.js delivered via NuGet, edit +"~/.bin/node.cmd" file: + + SET HTTP_PROXY=http://1:1@127.0.0.1:8888 + SET HTTPS_PROXY=http://1:1@127.0.0.1:8888 + +where "http://1:1@127.0.0.1:8888" is the proxy at "127.0.0.1:8888" with username "1" and +password "1" used for authentication. + + +Support +------- + +Read more about Bower at http://bower.io/ +Post NuGet package issues to https://github.com/whyleee/nuget-node-tools/issues + + +------------------------------------------------------ + 2014 Twitter and other contributors diff --git a/packages/Bower.1.3.11/tools/bin_tools.ps1 b/packages/Bower.1.3.11/tools/bin_tools.ps1 new file mode 100644 index 0000000..0e5826d --- /dev/null +++ b/packages/Bower.1.3.11/tools/bin_tools.ps1 @@ -0,0 +1,64 @@ +Function Update-BinPaths($cmd) { + $cmd_name = [IO.Path]::GetFileName($cmd) + $bin_name = [IO.Path]::GetDirectoryName($cmd) + + $repo_rel_path = '..\..\packages' + $repo_rel_regex = $repo_rel_path.Replace('\', '\\').Replace('.', '\.') + $bin_dir = Join-Path (gi $project.FullName).Directory.FullName $bin_name + $repo_dir = (gi $installPath).Parent.FullName + + $source = Join-Path $installPath "content\$cmd" + $target = Join-Path $bin_dir $cmd_name + + cd $bin_dir + + if (($repo_dir | rvpa -relative) -eq $repo_rel_path) { + return; + } + + (gc $source) | % {$_ -replace $repo_rel_regex, ($repo_dir | rvpa -relative)} | sc $source + cp $source $target +} + +Function Add-BinToPath($cmd) { + $bin_name = [IO.Path]::GetDirectoryName($cmd) + $path = [Environment]::GetEnvironmentVariable('Path', [EnvironmentVariableTarget]::User) + + if ($path -notmatch ";$bin_name") { + [Environment]::SetEnvironmentVariable('Path', "$path;$bin_name", [EnvironmentVariableTarget]::User) + } +} + +Function Set-BuildAction($cmd, $action) { + $pi = Get-ProjectItem $cmd + if ($pi) { + $num = [int]2 + if ($action -eq 'None') { + $num = [int]0 + } elseif ($action -eq 'Compile') { + $num = [int]1 + } elseif ($action -eq 'Embedded Resource') { + $num = [int]3 + } + + $pi.Properties.Item('BuildAction').Value = $num; + } +} + +Function Delete-Bin($cmd) { + $pi = Get-ProjectItem $cmd + if ($pi) { + $pi.Delete() + } +} + +Function Get-ProjectItem($cmd) { + $cmd_name = [IO.Path]::GetFileName($cmd) + $bin_name = [IO.Path]::GetDirectoryName($cmd) + + $pi = $project.ProjectItems.Item($bin_name) + if ($pi) { + $pi = $pi.ProjectItems.Item($cmd_name) + } + return $pi +} diff --git a/packages/Bower.1.3.11/tools/install.ps1 b/packages/Bower.1.3.11/tools/install.ps1 new file mode 100644 index 0000000..02e6367 --- /dev/null +++ b/packages/Bower.1.3.11/tools/install.ps1 @@ -0,0 +1,8 @@ +param($installPath, $toolsPath, $package, $project) + +. (Join-Path $toolsPath 'bin_tools.ps1') + +$cmd = '.bin\bower.cmd' +Set-BuildAction $cmd 'None' +Update-BinPaths $cmd +Add-BinToPath $cmd diff --git a/packages/Bower.1.3.11/tools/uninstall.ps1 b/packages/Bower.1.3.11/tools/uninstall.ps1 new file mode 100644 index 0000000..388d9e5 --- /dev/null +++ b/packages/Bower.1.3.11/tools/uninstall.ps1 @@ -0,0 +1,6 @@ +param($installPath, $toolsPath, $package, $project) + +. (Join-Path $toolsPath 'bin_tools.ps1') + +$cmd = '.bin\bower.cmd' +Delete-Bin $cmd diff --git a/packages/NoGit.0.0.8/NoGit.0.0.8.nupkg b/packages/NoGit.0.0.8/NoGit.0.0.8.nupkg new file mode 100644 index 0000000..bf360d7 Binary files /dev/null and b/packages/NoGit.0.0.8/NoGit.0.0.8.nupkg differ diff --git a/packages/NoGit.0.0.8/content/.bin/git.cmd b/packages/NoGit.0.0.8/content/.bin/git.cmd new file mode 100644 index 0000000..85ddefe --- /dev/null +++ b/packages/NoGit.0.0.8/content/.bin/git.cmd @@ -0,0 +1,3 @@ +@echo off +SET PATH=%~dp0;%PATH% +"%~dp0node" "%~dp0..\..\packages\NoGit.0.0.8\node_modules\nogit\bin\git.js" %* \ No newline at end of file diff --git a/packages/NoGit.0.0.8/node_modules/nogit/bin/git.js b/packages/NoGit.0.0.8/node_modules/nogit/bin/git.js new file mode 100644 index 0000000..17d07d2 --- /dev/null +++ b/packages/NoGit.0.0.8/node_modules/nogit/bin/git.js @@ -0,0 +1,147 @@ +#!/usr/bin/env node + +var program = require('commander'); +var clone = require('../commands/clone'); +var archive = require('../commands/archive'); +var lsRemote = require('../commands/ls-remote'); +var config = require('../lib/config'); +var globalTunnel = require('global-tunnel'); +var fs = require('fs'); +var ini = require('ini'); +var urlParse = require('url').parse; + +config.read(function(config) { + + config.nogit = {}; // custom settings + + program + .version(require('git-node').version) + .option('-v, --verbose', 'show detailed output'); + + program + .command('clone [dir]') + .description('Clone a repository into a new directory') + .option('-b, --branch ', 'checkout to specefic branch, tag or ref') + .option('--depth ', 'do a shallow clone with num commits deep') + .option('--mirror', 'not supported yet (will act as a "git fetch")') + .option('--progress', 'show progress status') + .option('-v, --verbose', 'show detailed output') + .action(function(url, dir, options) { + clone(url, dir, options); + }); + + program + .command('fetch [repo]') + .description('Download objects and refs from another repository') + .option('-a, --append', 'pppend ref and object names of fetched refs to the .git/FETCH_HEAD') + .action(function(repo, options) { + // todo + }); + + program + .command('config') + .description('Get repository options') + .option('--get ', 'get the value for a given key') + .action(function(options) { + if (options.get) { + if (config['remote "origin"']) { + console.log(config['remote "origin"'].url); + } + } + }); + + program + .command('rev-list ') + .description('Lists commit objects in reverse chronological order') + .option('-n, --max-count ', 'limit the number of commits to output', parseInt) + .action(function(commit, options) { + // only '-n1' and 'refs/heads' are supported + if (options.maxCount == 1) { + var hash = fs.readFileSync('refs/heads/' + commit, 'utf8').trim(); + console.log(hash); + } + else { + // todo + } + }); + + program + .command('archive ') + .description('Create an archive of files from a named tree') + .option('--format ', 'format of the resulting archive: tar or zip') + .option('--prefix ', 'prepend / to each filename in the archive') + .option('-v, --verbose', 'show detailed output') + .action(function(commit, options) { + archive(commit, options); + }); + + program + .command('ls-remote ') + .description('List references in a remote repository') + .option('-t, --tags', 'limit to tags') + .option('-h, --heads', 'limit to heads') + .action(function(repo, options) { + lsRemote(repo, options); + }); + + + // .command("fetch ", "Download objects and refs from another repository") + // .command("log", "Show local history") + // .command("export ", "Export tree at HEAD as real files to target") + + enableProxyIfRequired(); + + fixNumArgs(); + program.parse(process.argv); + + if (process.argv.length < 3) { + program.outputHelp(); + process.exit(1); + } + + function fixNumArgs() { + for (var i = 0; i < process.argv.length; ++i) { + if (/^-[a-zA-Z](\d+)$/g.test(process.argv[i])) { + process.argv.splice(i + 1, 0, process.argv[i].slice(2)); + process.argv[i] = process.argv[i].slice(0, 2); + } + } + } + + function enableProxyIfRequired() { + var tunnel = 'neither'; + var configHttpProxy = config.http ? config.http.proxy : undefined; + var configHttpsProxy = config.https ? config.https.proxy : undefined; + + if (process.env.http_proxy || configHttpProxy) { + tunnel = 'both'; + if (!process.env.http_proxy) { + process.env.http_proxy = config.http.proxy; + } + } + if (process.env.https_proxy || configHttpsProxy) { + if (tunnel == 'neither') { + tunnel = 'https'; + } + if (!process.env.https_proxy) { + process.env.https_proxy = configHttpsProxy; + } + } + + var proxy = process.env.http_proxy || process.env.https_proxy; + + if (proxy) { + var parsed = urlParse(proxy); + var conf = { + connect: tunnel, + protocol: parsed.protocol, + host: parsed.hostname, + port: parseInt(parsed.port,10), + proxyAuth: parsed.auth + }; + + globalTunnel.initialize(conf); + config.nogit.proxy = proxy; + } + } +}); \ No newline at end of file diff --git a/packages/NoGit.0.0.8/node_modules/nogit/commands/archive.js b/packages/NoGit.0.0.8/node_modules/nogit/commands/archive.js new file mode 100644 index 0000000..443cd9e --- /dev/null +++ b/packages/NoGit.0.0.8/node_modules/nogit/commands/archive.js @@ -0,0 +1,50 @@ +var fs = require('fs'); +var git = require('git-node'); +var path = require('path'); +var archiver = require('archiver'); + +function archive(commit, options) { + var root = process.cwd(); + var repo = git.repo(root); + + var archive = archiver(options.format); + var output = process.stdout; + + archive.on('error', function(err) { + throw err; + }); + + archive.pipe(output); + + repo.treeWalk(commit, function (err, stream) { + if (options.verbose) console.log('Creating archive...'); + if (err) throw err; + read = stream.read; + return read(function() { + read(onEntry); + }); + }); + + function onEntry(err, entry) { + if (err) throw err; + if (!entry){ + archive.finalize(); + if (options.verbose) { + console.log('Done.') + } + return; + } + + var prefixedPath = path.join(options.prefix, entry.path); + + if (options.verbose) { + console.log("adding %s", prefixedPath); + } + if (entry.type === "blob") { + archive.append(entry.body, {name: prefixedPath}); + } + return read(onEntry); + } +} + +module.exports = archive; \ No newline at end of file diff --git a/packages/NoGit.0.0.8/node_modules/nogit/commands/clone.js b/packages/NoGit.0.0.8/node_modules/nogit/commands/clone.js new file mode 100644 index 0000000..8ab217a --- /dev/null +++ b/packages/NoGit.0.0.8/node_modules/nogit/commands/clone.js @@ -0,0 +1,98 @@ +var git = require('git-node'); +var fs = require('fs'); +var path = require('path'); +var pathJoin = path.join; +var mkdirp = require('mkdirp'); +var utils = require('../lib/utils'); + +function clone(url, dir, options) { + // fix url + var origUrl = url; + url = utils.fixUrl(url); + + var remote = git.remote(url); + var target = dir || path.basename(remote.pathname, ".git"); + var clonePath = target; + if (!options.mirror) target += '/.git'; + var repo = git.repo(target); + + var fetchOpts = {}; + // if no branch specified, get all heads + fetchOpts.want = options.branch || function(ref, cb) { + return cb(null, ref && ref.indexOf('refs/heads') != -1); + }; + if (options.verbose) fetchOpts.onProgress = onProgress; + if (options.depth) fetchOpts.depth = parseInt(options.depth, 10); + + if (!fs.existsSync(target)) { + mkdirp.sync(target); + } + + if (options.mirror) { + console.log("Cloning %s into bare repository %s", url, target); + } + else { + console.log("Cloning %s to %s..", url, target); + } + + repo.fetch(remote, fetchOpts, onFetch); + + function onProgress(progress) { + process.stderr.write(progress); + } + + function onFetch() { + if (!options.mirror) { + repo.resolveHashish(options.branch || 'HEAD', function (err, hash) { + if (err) throw err; + repo.updateHead(hash, function (err) { + if (err) throw err; + // copied from export.js + var read; + repo.treeWalk('HEAD', function (err, stream) { + if (options.verbose) console.log('walking...'); + if (err) throw err; + read = stream.read; + return read(function() { + read(onEntry); + }); + }); + + function onEntry(err, entry) { + if (options.verbose) console.log('on entry...'); + if (err) throw err; + if (!entry) return; + var path = pathJoin(clonePath, entry.path); + if (options.verbose) { + var colorPath = "\x1B[34m" + path.replace(/\//g, "\x1B[1;34m/\x1B[0;34m") + "\x1B[0m"; + console.log("%s %s", entry.hash, colorPath); + } + if (entry.type === "tree") { + return fs.mkdir(path, onDone); + } + if (entry.type === "blob") { + return fs.writeFile(path, entry.body, onDone); + } + return read(onEntry); + } + + function onDone(err) { + if (err) throw err; + return read(onEntry); + } + }); + }); + } + + // create config with remote + fs.writeFile(target + '/config', '[remote "origin"]\r\n\turl = ' + origUrl, function(err) { + if (err) throw err; + if (options.verbose) { + console.log('Created repo config'); + console.log("Done."); + } + }); + } +} + +module.exports = clone; \ No newline at end of file diff --git a/packages/NoGit.0.0.8/node_modules/nogit/commands/export.js b/packages/NoGit.0.0.8/node_modules/nogit/commands/export.js new file mode 100644 index 0000000..888edc8 --- /dev/null +++ b/packages/NoGit.0.0.8/node_modules/nogit/commands/export.js @@ -0,0 +1,50 @@ +#!/usr/bin/env node +var git = require('git-node'); +var program = require('commander'); +var fs = require('fs'); +var pathJoin = require('path').join; + +program + .usage('[options] [--] ') + .option('--ref ', 'export from a specefic local branch, tag, or ref') + .option('-q', 'Be quiet; don\t show progress') + .option('--git-dir ', 'Use custom git dir instead of cwd') + .parse(process.argv); + +if (program.args.length !== 1) { + program.outputHelp(); + process.exit(1); +} + +var target = program.args[0]; +var ref = program.ref || "HEAD"; +var source = require('./root.js')(program); +var repo = git.repo(source); +var read; +repo.treeWalk(ref, function (err, stream) { + if (err) throw err; + read = stream.read; + return read(onEntry); +}); + +function onEntry(err, entry) { + if (err) throw err; + if (!entry) return; + var path = pathJoin(target, entry.path); + if (!program.Q) { + var colorPath = "\x1B[34m" + path.replace(/\//g, "\x1B[1;34m/\x1B[0;34m") + "\x1B[0m"; + console.log("%s %s", entry.hash, colorPath); + } + if (entry.type === "tree") { + return fs.mkdir(path, onDone); + } + if (entry.type === "blob") { + return fs.writeFile(path, entry.body, onDone); + } + return read(onEntry); +} + +function onDone(err) { + if (err) throw err; + return read(onEntry); +} diff --git a/packages/NoGit.0.0.8/node_modules/nogit/commands/fetch.js b/packages/NoGit.0.0.8/node_modules/nogit/commands/fetch.js new file mode 100644 index 0000000..039af0b --- /dev/null +++ b/packages/NoGit.0.0.8/node_modules/nogit/commands/fetch.js @@ -0,0 +1,51 @@ +#!/usr/bin/env node +var git = require('git-node'); +var program = require('commander'); +var basename = require('path').basename; +var existsSync = require('fs').existsSync; + +program + .usage('[options] [--] []') + .option('--ref ', 'checkout to specefic branch, tag, or ref') + .option('--depth ', 'do a shallow clone with num commits deep') + .option('-q', 'Be quiet; don\'t show progress') + .parse(process.argv); + +if (program.args.length < 1 || program.args.length > 2) { + program.outputHelp(); + process.exit(1); +} + +var url = program.args[0]; +var remote = git.remote(url); +var target = program.args[1] || basename(remote.pathname, ".git") + ".git"; +var repo = git.repo(target); +var opts = {}; +if (!program.Q) opts.onProgress = onProgress; +if (program.ref) opts.want = program.ref; +if (program.depth) opts.depth = parseInt(program.depth, 10); +if (!program.Q) { + if (existsSync(target)) { + console.error("Fetching updates from %s to %s", url, target); + } + else { + console.log("Cloning %s to %s..", url, target); + } +} +repo.fetch(remote, opts, onDone); + +function onProgress(progress) { + process.stderr.write(progress); +} + +function onDone() { + if (program.ref) { + repo.resolveHashish(program.ref, function (err, hash) { + if (err) throw err; + repo.updateHead(hash, function (err) { + if (err) throw err; + }); + }); + } + if (!program.Q) console.log("Done."); +} diff --git a/packages/NoGit.0.0.8/node_modules/nogit/commands/log.js b/packages/NoGit.0.0.8/node_modules/nogit/commands/log.js new file mode 100644 index 0000000..bdfd1f4 --- /dev/null +++ b/packages/NoGit.0.0.8/node_modules/nogit/commands/log.js @@ -0,0 +1,66 @@ +#!/usr/bin/env node +var git = require('git-node'); +var program = require('commander'); + +program + .usage('[options] [--] []') + .option('--tree', 'show content trees') + .option('--limit ', 'stop loading history after num entries') + .option('--git-dir ', 'Use custom git dir instead of cwd') + .parse(process.argv); + +if (program.args.length > 1) { + program.outputHelp(); + process.exit(1); +} +if (program.limit) program.limit = parseInt(program.limit, 10); + +var ref = program.args[0] || "HEAD"; +var target = require('./root.js')(program); + +var repo = git.repo(target); +repo.logWalk(ref, function (err, log) { + if (err) throw err; + var shallow; + return log.read(onRead); + + function onRead(err, commit) { + if (err) throw err; + if ("limit" in program && !(program.limit--)) return; + if (!commit) return logEnd(shallow); + if (commit.last) shallow = true; + logCommit(commit); + if (!program.tree) return log.read(onRead); + repo.treeWalk(commit.tree, function (err, tree) { + if (err) throw err; + tree.read(onEntry); + function onEntry(err, entry) { + if (err) throw err; + if (!entry) { + return log.read(onRead); + } + logEntry(entry); + return tree.read(onEntry); + } + }); + } +}); + +function logCommit(commit) { + var author = commit.author; + var message = commit.message; + console.log("\n\x1B[33mcommit %s\x1B[0m", commit.hash); + console.log("Author: %s <%s>", author.name, author.email); + console.log("Date: %s", author.date); + console.log("\n \x1B[32;1m" + message.trim().split("\n").join("\x1B[0m\n \x1B[32m") + "\x1B[0m\n"); +} + +function logEntry(entry) { + var path = entry.path.replace(/\//g, "\x1B[1;34m/\x1B[0;34m") + "\x1B[0m"; + console.log(" %s %s", entry.hash, path); +} + +function logEnd(shallow) { + var message = shallow ? "End of shallow record." : "Beginning of history"; + console.log("\n\x1B[30;1m%s\x1B[0m\n", message); +} \ No newline at end of file diff --git a/packages/NoGit.0.0.8/node_modules/nogit/commands/ls-remote.js b/packages/NoGit.0.0.8/node_modules/nogit/commands/ls-remote.js new file mode 100644 index 0000000..62e69af --- /dev/null +++ b/packages/NoGit.0.0.8/node_modules/nogit/commands/ls-remote.js @@ -0,0 +1,18 @@ +var git = require('git-node'); +var utils = require('../lib/utils'); + +function lsRemote(repo, options) { + repo = utils.fixUrl(repo); + var remote = git.remote(repo); + remote.discover(function (err, refs) { + if (err) throw err; + Object.keys(refs).forEach(function (ref) { + console.log(refs[ref] + "\t" + ref); + }); + remote.close(function (err) { + if (err) throw err; + }); + }); +} + +module.exports = lsRemote; \ No newline at end of file diff --git a/packages/NoGit.0.0.8/node_modules/nogit/lib/config.js b/packages/NoGit.0.0.8/node_modules/nogit/lib/config.js new file mode 100644 index 0000000..212db8f --- /dev/null +++ b/packages/NoGit.0.0.8/node_modules/nogit/lib/config.js @@ -0,0 +1,39 @@ +var path = require('path'); +var fs = require('fs'); +var ini = require('ini'); + +var config = {}; + +exports.read = function(cb) { + var userConfigPath = path.join(process.env.USERPROFILE, '.gitconfig'); + readFrom(userConfigPath, function() { + readFrom('config', function() { + cb(config); + }); + }); +} + +exports.get = function() { + return config; +} + +function readFrom(configPath, cb) { + fs.exists(configPath, function(exists) { + if (exists) { + fs.readFile(configPath, 'utf8', function(err, data) { + if (err) throw err; + var parsedConfig = ini.parse(data); + mergeConfigs(config, parsedConfig); + cb(); + }); + } else { + // TODO: log it, but not to stdout/stderr - git doesn't do that + // console.log('"' + configPath + '" not found'); + cb(); + } + }); +} + +function mergeConfigs(to, from) { + for (var prop in from) {to[prop] = from[prop];} +} \ No newline at end of file diff --git a/packages/NoGit.0.0.8/node_modules/nogit/lib/utils.js b/packages/NoGit.0.0.8/node_modules/nogit/lib/utils.js new file mode 100644 index 0000000..642b1ad --- /dev/null +++ b/packages/NoGit.0.0.8/node_modules/nogit/lib/utils.js @@ -0,0 +1,23 @@ +var config = require('./config').get(); + +exports.fixUrl = function(url) { + // remove last '/' (to avoid url's ending with '/.git') + if (url.slice(-1) == '/') { + url = url.slice(0, -1); + } + + // '.git' ending is required for js-git + if (url.slice(-4) != '.git') { + url += '.git'; + } + + // can't use proxy for 'git://' urls (tcp) - use 'https://' instead + // also check if such replacement required in the config + var httpsInsteadOfGit = config['url "https://"'] && + config['url "https://"'].insteadOf == 'git://'; + if ((httpsInsteadOfGit || config.nogit.proxy) && url.indexOf('git://') == 0) { + url = url.replace('git://', 'https://'); + } + + return url; +} \ No newline at end of file diff --git a/packages/NoGit.0.0.8/node_modules/nogit/node_modules/.bin/mkdirp b/packages/NoGit.0.0.8/node_modules/nogit/node_modules/.bin/mkdirp new file mode 100644 index 0000000..958ff64 --- /dev/null +++ b/packages/NoGit.0.0.8/node_modules/nogit/node_modules/.bin/mkdirp @@ -0,0 +1,15 @@ +#!/bin/sh +basedir=`dirname "$0"` + +case `uname` in + *CYGWIN*) basedir=`cygpath -w "$basedir"`;; +esac + +if [ -x "$basedir/node" ]; then + "$basedir/node" "$basedir/../mkdirp/bin/cmd.js" "$@" + ret=$? +else + node "$basedir/../mkdirp/bin/cmd.js" "$@" + ret=$? +fi +exit $ret diff --git a/packages/NoGit.0.0.8/node_modules/nogit/node_modules/.bin/mkdirp.cmd b/packages/NoGit.0.0.8/node_modules/nogit/node_modules/.bin/mkdirp.cmd new file mode 100644 index 0000000..f0a9b6b --- /dev/null +++ b/packages/NoGit.0.0.8/node_modules/nogit/node_modules/.bin/mkdirp.cmd @@ -0,0 +1,5 @@ +@IF EXIST "%~dp0\node.exe" ( + "%~dp0\node.exe" "%~dp0\..\mkdirp\bin\cmd.js" %* +) ELSE ( + node "%~dp0\..\mkdirp\bin\cmd.js" %* +) \ No newline at end of file diff --git a/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/lib/archiver.js b/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/lib/archiver.js new file mode 100644 index 0000000..ed509c7 --- /dev/null +++ b/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/lib/archiver.js @@ -0,0 +1,42 @@ +/** + * node-archiver + * + * Copyright (c) 2012-2014 Chris Talkington, contributors. + * Licensed under the MIT license. + * https://github.com/ctalkington/node-archiver/blob/master/LICENSE-MIT + */ +var ArchiverCore = require('./modules/core'); +var formatModules = {}; + +var archiver = module.exports = function(format, options) { + return archiver.create(format, options); +}; + +archiver.create = function(format, options) { + if (formatModules[format]) { + var inst = new ArchiverCore(options); + inst.setModule(new formatModules[format](options)); + + return inst; + } else { + throw new Error('unknown format: ' + format); + } +}; + +archiver.registerFormat = function(format, module) { + if (module && typeof module === 'function' && typeof module.prototype.append === 'function') { + formatModules[format] = module; + + // backwards compat + var compatName = 'create' + format.charAt(0).toUpperCase() + format.slice(1); + archiver[compatName] = function(options) { + return archiver.create(format, options); + }; + } else { + throw new Error('format module invalid: ' + format); + } +}; + +archiver.registerFormat('zip', require('./modules/zip')); +archiver.registerFormat('tar', require('./modules/tar')); +archiver.registerFormat('json', require('./modules/json')); \ No newline at end of file diff --git a/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/lib/modules/core/index.js b/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/lib/modules/core/index.js new file mode 100644 index 0000000..6e79ce4 --- /dev/null +++ b/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/lib/modules/core/index.js @@ -0,0 +1,263 @@ +/** + * node-archiver + * + * Copyright (c) 2012-2014 Chris Talkington, contributors. + * Licensed under the MIT license. + * https://github.com/ctalkington/node-archiver/blob/master/LICENSE-MIT + */ +var inherits = require('util').inherits; +var Transform = require('readable-stream').Transform; + +var util = require('../../util'); +var Queue = require('./queue'); + +var Archiver = module.exports = function(options) { + options = this.options = util.defaults(options, { + highWaterMark: 1024 * 1024 + }); + + Transform.call(this, options); + + this._moduleOutputPiped = false; + + this._pointer = 0; + this._files = []; + this._module = false; + + this._queue = new Queue(); + this._queue.on('error', this._onQueueError.bind(this)); + this._queue.on('entry', this._onQueueEntry.bind(this)); + this._queue.once('end', this._onQueueEnd.bind(this)); +}; + +inherits(Archiver, Transform); + +Archiver.prototype._moduleSupports = function(key) { + this._module.supports = util.defaults(this._module.supports, { + directory: false + }); + + return this._module.supports[key]; +}; + +Archiver.prototype._normalizeFileData = function(data) { + data = util.defaults(data, { + type: 'file', + name: null, + date: null, + mode: null, + sourcePath: null + }); + + var isDir = data.type === 'directory'; + + if (data.name) { + data.name = util.sanitizePath(data.name); + + if (data.name.slice(-1) === '/') { + isDir = true; + data.type = 'directory'; + } else if (isDir) { + data.name += '/'; + } + } + + if (typeof data.mode === 'number') { + data.mode &= 0777; + } else { + data.mode = isDir ? 0755 : 0644; + } + + data.date = util.dateify(data.date); + + return data; +}; + +Archiver.prototype._onModuleError = function(err) { + this.emit('error', err); +}; + +Archiver.prototype._onQueueEnd = function() { + if (typeof this._module.finalize === 'function') { + this._module.finalize(); + } else if (typeof this._module.end === 'function') { + this._module.end(); + } else { + this.emit('error', new Error('format module missing finalize and end method')); + } +}; + +Archiver.prototype._onQueueEntry = function(entry) { + var nextCallback = function(err, file) { + if (err) { + this.emit('error', err); + return; + } + + file = file || entry.data; + + this.emit('entry', file); + this._files.push(file); + this._queue.next(); + }.bind(this); + + this._module.append(entry.source, entry.data, nextCallback); +}; + +Archiver.prototype._onQueueError = function(err) { + this.emit('error', err); +}; + +Archiver.prototype._pipeModuleOutput = function() { + this._module.on('error', this._onModuleError.bind(this)); + this._module.pipe(this); + + this._moduleOutputPiped = true; +}; + +Archiver.prototype._processFile = function(source, data, callback) { + this.emit('error', new Error('method not implemented')); +}; + +Archiver.prototype._transform = function(chunk, encoding, callback) { + if (chunk) { + this._pointer += chunk.length; + } + + callback(null, chunk); +}; + +Archiver.prototype.append = function(source, data) { + data = this._normalizeFileData(data); + + if (typeof data.name !== 'string' || data.name.length === 0) { + this.emit('error', new Error('entry name must be a non-empty string value')); + return this; + } + + if (data.type === 'directory' && !this._moduleSupports('directory')) { + this.emit('error', new Error('entries of "' + data.type + '" type not currently supported by this module')); + return; + } + + source = util.normalizeInputSource(source); + + if (Buffer.isBuffer(source)) { + data.sourceType = 'buffer'; + } else if (util.isStream(source)) { + data.sourceType = 'stream'; + } else { + this.emit('error', new Error('input source must be valid Stream or Buffer instance')); + return this; + } + + this._queue.add({ + data: data, + source: source + }); + + return this; +}; + +Archiver.prototype.bulk = function(mappings) { + if (!Array.isArray(mappings)) { + mappings = [mappings]; + } + + var self = this; + var files = util.normalizeFilesArray(mappings); + + files.forEach(function(file){ + var isExpandedPair = file.orig.expand || false; + var fileData = file.data || {}; + + file.src.forEach(function(filepath) { + var data = util._.extend({}, fileData); + var name = isExpandedPair ? file.dest : util.unixifyPath(file.dest || '', filepath); + + if (name === '.') { + return; + } + + var stat = util.stat(filepath); + var source; + + if (!stat) { + return; + } + + data.name = util.sanitizePath(name); + data.sourcePath = filepath; + + if (stat.isFile()) { + data.type = 'file'; + data.sourceType = 'stream'; + + source = util.lazyReadStream(filepath); + } else if (stat.isDirectory() && self._moduleSupports('directory')) { + data.name = util.trailingSlashIt(data.name); + data.type = 'directory'; + data.sourcePath = util.trailingSlashIt(data.sourcePath); + data.sourceType = 'buffer'; + + source = new Buffer(0); + } else { + return; + } + + self._queue.add({ + data: data, + source: source + }); + }); + }); + + return this; +}; + +Archiver.prototype.file = function(filepath, data) { + data = this._normalizeFileData(data); + + if (typeof filepath !== 'string' || filepath.length === 0) { + this.emit('error', new Error('filepath must be a non-empty string value')); + return this; + } + + if (util.file.isFile(filepath)) { + if (typeof data.name !== 'string' || data.name.length === 0) { + data.name = util.sanitizePath(filepath); + } + + data.sourcePath = filepath; + data.sourceType = 'stream'; + + this._queue.add({ + data: data, + source: util.lazyReadStream(filepath) + }); + } else { + this.emit('error', new Error('invalid file: ' + filepath)); + } + + return this; +}; + +Archiver.prototype.finalize = function(callback) { + this._queue.close(); + + return this; +}; + +Archiver.prototype.setModule = function(module) { + if (this._moduleOutputPiped) { + this.emit('error', new Error('format module already set')); + return; + } + + this._module = module; + this._pipeModuleOutput(); +}; + +Archiver.prototype.pointer = function() { + return this._pointer; +}; \ No newline at end of file diff --git a/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/lib/modules/core/queue.js b/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/lib/modules/core/queue.js new file mode 100644 index 0000000..c18ac44 --- /dev/null +++ b/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/lib/modules/core/queue.js @@ -0,0 +1,58 @@ +/** + * node-archiver + * + * Copyright (c) 2012-2014 Chris Talkington, contributors. + * Licensed under the MIT license. + * https://github.com/ctalkington/node-archiver/blob/master/LICENSE-MIT + */ +var inherits = require('util').inherits; +var EventEmitter = require('events').EventEmitter; + +var Queue = module.exports = function() { + EventEmitter.call(this); + + this.closed = false; + this.ended = false; + this.waiting = false; + + this.entries = []; +}; + +inherits(Queue, EventEmitter); + +Queue.prototype.add = function(obj) { + if (this.closed) { + this.emit('error', new Error('can\'t add queue entry after close')); + } else { + this.entries.push(obj); + this.run(); + } +}; + +Queue.prototype.close = function() { + this.closed = true; + this.run(); +}; + +Queue.prototype.next = function() { + this.waiting = false; + this.run(); +}; + +Queue.prototype.run = function() { + if (this.waiting || (this.closed && this.ended)) { + return; + } + + if (this.entries.length === 0) { + if (this.closed) { + this.emit('end'); + this.ended = true; + } + + return; + } + + this.waiting = true; + this.emit('entry', this.entries.shift()); +}; \ No newline at end of file diff --git a/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/lib/modules/json/index.js b/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/lib/modules/json/index.js new file mode 100644 index 0000000..9b6f857 --- /dev/null +++ b/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/lib/modules/json/index.js @@ -0,0 +1,71 @@ +/** + * node-archiver + * + * Copyright (c) 2012-2014 Chris Talkington, contributors. + * Licensed under the MIT license. + * https://github.com/ctalkington/node-archiver/blob/master/LICENSE-MIT + */ +var inherits = require('util').inherits; +var Transform = require('readable-stream').Transform; + +var crc32 = require('buffer-crc32'); +var util = require('../../util'); + +var Json = module.exports = function(options) { + options = this.options = util.defaults(options, {}); + + Transform.call(this, options); + + this.supports = { + directory: true + }; + + this.files = []; +}; + +inherits(Json, Transform); + +Json.prototype._transform = function(chunk, encoding, callback) { + callback(null, chunk); +}; + +Json.prototype._writeStringified = function() { + var fileString = JSON.stringify(this.files); + this.write(fileString); +}; + +Json.prototype.append = function(source, data, callback) { + var self = this; + + data.crc32 = 0; + + function onend(err, sourceBuffer) { + if (err) { + callback(err); + return; + } + + data.size = sourceBuffer.length || 0; + data.crc32 = crc32.unsigned(sourceBuffer); + + self.files.push(data); + + callback(null, data); + } + + if (data.sourceType === 'buffer') { + onend(null, source); + } else if (data.sourceType === 'stream') { + util.collectStream(source, onend); + } +}; + +Json.prototype.finalize = function(callback) { + callback = callback || function() {}; + + this._writeStringified(); + + this.end(); + + callback(); +}; \ No newline at end of file diff --git a/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/lib/modules/tar/index.js b/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/lib/modules/tar/index.js new file mode 100644 index 0000000..773bacf --- /dev/null +++ b/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/lib/modules/tar/index.js @@ -0,0 +1,76 @@ +/** + * node-archiver + * + * Copyright (c) 2012-2014 Chris Talkington, contributors. + * Licensed under the MIT license. + * https://github.com/ctalkington/node-archiver/blob/master/LICENSE-MIT + */ +var zlib = require('zlib'); + +var engine = require('tar-stream'); +var util = require('../../util'); + +var Tar = module.exports = function(options) { + options = this.options = util.defaults(options, { + gzip: false + }); + + if (typeof options.gzipOptions !== 'object') { + options.gzipOptions = {}; + } + + this.supports = { + directory: true + }; + + this.engine = engine.pack(options); + this.compressor = false; + + if (options.gzip) { + this.compressor = zlib.createGzip(options.gzipOptions); + this.compressor.on('error', this._onCompressorError.bind(this)); + } +}; + +Tar.prototype._onCompressorError = function(err) { + this.engine.emit('error', err); +}; + +Tar.prototype.append = function(source, data, callback) { + var self = this; + + data.mtime = data.date; + + function append(err, sourceBuffer) { + if (err) { + callback(err); + return; + } + + self.engine.entry(data, sourceBuffer, function(err) { + callback(err, data); + }); + } + + if (data.sourceType === 'buffer') { + append(null, source); + } else if (data.sourceType === 'stream') { + util.collectStream(source, append); + } +}; + +Tar.prototype.finalize = function() { + this.engine.finalize(); +}; + +Tar.prototype.on = function() { + return this.engine.on.apply(this.engine, arguments); +}; + +Tar.prototype.pipe = function(destination, options) { + if (this.compressor) { + return this.engine.pipe.apply(this.engine, [this.compressor]).pipe(destination, options); + } else { + return this.engine.pipe.apply(this.engine, arguments); + } +}; \ No newline at end of file diff --git a/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/lib/modules/zip/index.js b/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/lib/modules/zip/index.js new file mode 100644 index 0000000..e00a106 --- /dev/null +++ b/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/lib/modules/zip/index.js @@ -0,0 +1,39 @@ +/** + * node-archiver + * + * Copyright (c) 2012-2014 Chris Talkington, contributors. + * Licensed under the MIT license. + * https://github.com/ctalkington/node-archiver/blob/master/LICENSE-MIT + */ +var engine = require('zip-stream'); +var util = require('../../util'); + +var Zip = module.exports = function(options) { + options = this.options = util.defaults(options, { + comment: '', + forceUTC: false, + store: false + }); + + this.supports = { + directory: true + }; + + this.engine = new engine(options); +}; + +Zip.prototype.append = function(source, data, callback) { + this.engine.entry(source, data, callback); +}; + +Zip.prototype.finalize = function() { + this.engine.finalize(); +}; + +Zip.prototype.on = function() { + return this.engine.on.apply(this.engine, arguments); +}; + +Zip.prototype.pipe = function() { + return this.engine.pipe.apply(this.engine, arguments); +}; \ No newline at end of file diff --git a/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/lib/util/index.js b/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/lib/util/index.js new file mode 100644 index 0000000..f983d30 --- /dev/null +++ b/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/lib/util/index.js @@ -0,0 +1,193 @@ +/** + * node-archiver + * + * Copyright (c) 2012-2014 Chris Talkington, contributors. + * Licensed under the MIT license. + * https://github.com/ctalkington/node-archiver/blob/master/LICENSE-MIT + */ +var fs = require('fs'); +var path = require('path'); + +var Stream = require('stream').Stream; +var PassThrough = require('readable-stream').PassThrough; + +var util = module.exports = {}; + +util._ = require('lodash'); +util.lazystream = require('lazystream'); +util.file = require('file-utils'); + +util.collectStream = function(source, callback) { + var collection = []; + var size = 0; + + source.on('error', callback); + + source.on('data', function(chunk) { + collection.push(chunk); + size += chunk.length; + }); + + source.on('end', function() { + var buf = new Buffer(size, 'utf8'); + var offset = 0; + + collection.forEach(function(data) { + data.copy(buf, offset); + offset += data.length; + }); + + callback(null, buf); + }); +}; + +util.dateify = function(dateish) { + dateish = dateish || new Date(); + + if (dateish instanceof Date) { + dateish = dateish; + } else if (typeof dateish === 'string') { + dateish = new Date(dateish); + } else { + dateish = new Date(); + } + + return dateish; +}; + +// this is slightly different from lodash version +util.defaults = function(object, source, guard) { + var args = arguments; + args[0] = args[0] || {}; + + return util._.defaults.apply(util._, args); +}; + +util.isStream = function(source) { + return source instanceof Stream; +}; + +util.lazyReadStream = function(filepath) { + return new util.lazystream.Readable(function() { + return fs.createReadStream(filepath); + }); +}; + +// reusing bits of grunt's multi-task source normalization +util.normalizeFilesArray = function(data) { + var files = []; + + data.forEach(function(obj) { + var prop; + if ('src' in obj || 'dest' in obj) { + files.push(obj); + } + }); + + if (files.length === 0) { + return []; + } + + files = util._(files).chain().forEach(function(obj) { + if (!('src' in obj) || !obj.src) { return; } + // Normalize .src properties to flattened array. + if (Array.isArray(obj.src)) { + obj.src = util._.flatten(obj.src); + } else { + obj.src = [obj.src]; + } + }).map(function(obj) { + // Build options object, removing unwanted properties. + var expandOptions = util._.extend({}, obj); + delete expandOptions.src; + delete expandOptions.dest; + + // Expand file mappings. + if (obj.expand) { + return util.file.expandMapping(obj.src, obj.dest, expandOptions).map(function(mapObj) { + // Copy obj properties to result. + var result = util._.extend({}, obj); + // Make a clone of the orig obj available. + result.orig = util._.extend({}, obj); + // Set .src and .dest, processing both as templates. + result.src = mapObj.src; + result.dest = mapObj.dest; + // Remove unwanted properties. + ['expand', 'cwd', 'flatten', 'rename', 'ext'].forEach(function(prop) { + delete result[prop]; + }); + return result; + }); + } + + // Copy obj properties to result, adding an .orig property. + var result = util._.extend({}, obj); + // Make a clone of the orig obj available. + result.orig = util._.extend({}, obj); + + if ('src' in result) { + // Expose an expand-on-demand getter method as .src. + Object.defineProperty(result, 'src', { + enumerable: true, + get: function fn() { + var src; + if (!('result' in fn)) { + src = obj.src; + // If src is an array, flatten it. Otherwise, make it into an array. + src = Array.isArray(src) ? util._.flatten(src) : [src]; + // Expand src files, memoizing result. + fn.result = util.file.expand(expandOptions, src); + } + return fn.result; + } + }); + } + + if ('dest' in result) { + result.dest = obj.dest; + } + + return result; + }).flatten().value(); + + return files; +}; + +util.normalizeInputSource = function(source) { + if (source === null) { + return new Buffer(0); + } else if (typeof source === 'string') { + return new Buffer(source); + } else if (util.isStream(source) && !source._readableState) { + var normalized = new PassThrough(); + source.pipe(normalized); + + return normalized; + } + + return source; +}; + +util.sanitizePath = function() { + var filepath = path.join.apply(path, arguments); + return filepath.replace(/\\/g, '/').replace(/:/g, '').replace(/^\/+/, ''); +}; + +util.stat = function() { + var filepath = path.join.apply(path, arguments); + + if (!util.file.exists(filepath)) { + return false; + } + + return fs.statSync(filepath); +}; + +util.trailingSlashIt = function(str) { + return str.slice(-1) !== '/' ? str + '/' : str; +}; + +util.unixifyPath = function() { + var filepath = path.join.apply(path, arguments); + return filepath.replace(/\\/g, '/'); +}; \ No newline at end of file diff --git a/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/buffer-crc32/index.js b/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/buffer-crc32/index.js new file mode 100644 index 0000000..8694c63 --- /dev/null +++ b/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/buffer-crc32/index.js @@ -0,0 +1,91 @@ +var Buffer = require('buffer').Buffer; + +var CRC_TABLE = [ + 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, + 0x706af48f, 0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4, + 0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, + 0x90bf1d91, 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de, + 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, 0x136c9856, + 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9, + 0xfa0f3d63, 0x8d080df5, 0x3b6e20c8, 0x4c69105e, 0xd56041e4, + 0xa2677172, 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, + 0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, + 0x45df5c75, 0xdcd60dcf, 0xabd13d59, 0x26d930ac, 0x51de003a, + 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, 0xcfba9599, + 0xb8bda50f, 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, + 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, 0x76dc4190, + 0x01db7106, 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, + 0x9fbfe4a5, 0xe8b8d433, 0x7807c9a2, 0x0f00f934, 0x9609a88e, + 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01, + 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, 0x6c0695ed, + 0x1b01a57b, 0x8208f4c1, 0xf50fc457, 0x65b0d9c6, 0x12b7e950, + 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, + 0xfbd44c65, 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, + 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb, 0x4369e96a, + 0x346ed9fc, 0xad678846, 0xda60b8d0, 0x44042d73, 0x33031de5, + 0xaa0a4c5f, 0xdd0d7cc9, 0x5005713c, 0x270241aa, 0xbe0b1010, + 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f, + 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, + 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad, 0xedb88320, 0x9abfb3b6, + 0x03b6e20c, 0x74b1d29a, 0xead54739, 0x9dd277af, 0x04db2615, + 0x73dc1683, 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8, + 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, 0xf00f9344, + 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb, + 0x196c3671, 0x6e6b06e7, 0xfed41b76, 0x89d32be0, 0x10da7a5a, + 0x67dd4acc, 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, + 0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, + 0xa6bc5767, 0x3fb506dd, 0x48b2364b, 0xd80d2bda, 0xaf0a1b4c, + 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, 0x316e8eef, + 0x4669be79, 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, + 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, 0xc5ba3bbe, + 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, + 0x2cd99e8b, 0x5bdeae1d, 0x9b64c2b0, 0xec63f226, 0x756aa39c, + 0x026d930a, 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713, + 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, 0x92d28e9b, + 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, 0x86d3d2d4, 0xf1d4e242, + 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, + 0x18b74777, 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, + 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45, 0xa00ae278, + 0xd70dd2ee, 0x4e048354, 0x3903b3c2, 0xa7672661, 0xd06016f7, + 0x4969474d, 0x3e6e77db, 0xaed16a4a, 0xd9d65adc, 0x40df0b66, + 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9, + 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, + 0xcdd70693, 0x54de5729, 0x23d967bf, 0xb3667a2e, 0xc4614ab8, + 0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, + 0x2d02ef8d +]; + +if (typeof Int32Array !== 'undefined') + CRC_TABLE = new Int32Array(CRC_TABLE); + +function bufferizeInt(num) { + var tmp = Buffer(4); + tmp.writeInt32BE(num, 0); + return tmp; +} + +function _crc32(buf, previous) { + if (!Buffer.isBuffer(buf)) { + buf = Buffer(buf); + } + if (Buffer.isBuffer(previous)) { + previous = previous.readUInt32BE(0); + } + var crc = ~~previous ^ -1; + for (var n = 0; n < buf.length; n++) { + crc = CRC_TABLE[(crc ^ buf[n]) & 0xff] ^ (crc >>> 8); + } + return (crc ^ -1); +} + +function crc32() { + return bufferizeInt(_crc32.apply(null, arguments)); +} +crc32.signed = function () { + return _crc32.apply(null, arguments); +}; +crc32.unsigned = function () { + return _crc32.apply(null, arguments) >>> 0; +}; + +module.exports = crc32; diff --git a/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/buffer-crc32/package.json b/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/buffer-crc32/package.json new file mode 100644 index 0000000..516ea5e --- /dev/null +++ b/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/buffer-crc32/package.json @@ -0,0 +1,56 @@ +{ + "author": { + "name": "Brian J. Brennan", + "email": "brianloveswords@gmail.com", + "url": "http://bjb.io" + }, + "name": "buffer-crc32", + "description": "A pure javascript CRC32 algorithm that plays nice with binary data", + "version": "0.2.3", + "contributors": [ + { + "name": "Vladimir Kuznetsov" + } + ], + "homepage": "https://github.com/brianloveswords/buffer-crc32", + "repository": { + "type": "git", + "url": "git://github.com/brianloveswords/buffer-crc32.git" + }, + "main": "index.js", + "scripts": { + "test": "tap tests/*.test.js" + }, + "dependencies": {}, + "devDependencies": { + "tap": "~0.2.5" + }, + "optionalDependencies": {}, + "engines": { + "node": "*" + }, + "gitHead": "f06dc30bccbad685af30666268c6fd2670805998", + "bugs": { + "url": "https://github.com/brianloveswords/buffer-crc32/issues" + }, + "_id": "buffer-crc32@0.2.3", + "_shasum": "bb54519e95d107cbd2400e76d0cab1467336d921", + "_from": "buffer-crc32@~0.2.1", + "_npmVersion": "1.4.14", + "_npmUser": { + "name": "brianloveswords", + "email": "brianloveswords@gmail.com" + }, + "maintainers": [ + { + "name": "brianloveswords", + "email": "brian@nyhacker.org" + } + ], + "dist": { + "shasum": "bb54519e95d107cbd2400e76d0cab1467336d921", + "tarball": "http://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.3.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.3.tgz" +} diff --git a/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/file-utils/Gruntfile.js b/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/file-utils/Gruntfile.js new file mode 100644 index 0000000..40b80c2 --- /dev/null +++ b/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/file-utils/Gruntfile.js @@ -0,0 +1,56 @@ +/* + * grunt + * http://gruntjs.com/ + * + * Copyright (c) 2013 "Cowboy" Ben Alman + * Licensed under the MIT license. + * https://github.com/gruntjs/grunt/blob/master/LICENSE-MIT + */ + +'use strict'; + +module.exports = function(grunt) { + + // Project configuration. + grunt.initConfig({ + nodeunit: { + all: [ 'tests/**.js', '!tests/fixtures/**', '!tests/helpers/**' ] + }, + jshint: { + lib: ['lib/**/*.js'], + options: { + curly: true, + eqeqeq: true, + immed: true, + latedef: 'nofunc', + newcap: true, + noarg: true, + sub: true, + undef: true, + unused: true, + boss: true, + eqnull: true, + node: true, + } + }, + watch: { + tests: { + files: [ '**/*' ], + tasks: [ 'test' ] + } + } + }); + + // These plugins provide necessary tasks. + grunt.loadNpmTasks('grunt-contrib-jshint'); + grunt.loadNpmTasks('grunt-contrib-nodeunit'); + grunt.loadNpmTasks('grunt-contrib-watch'); + grunt.loadNpmTasks('grunt-release'); + + // "npm test" runs these tasks + grunt.registerTask('test', ['jshint', 'nodeunit']); + + // Default task. + grunt.registerTask('default', ['test']); + +}; diff --git a/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/file-utils/index.js b/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/file-utils/index.js new file mode 100644 index 0000000..b1a8c13 --- /dev/null +++ b/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/file-utils/index.js @@ -0,0 +1,11 @@ +var _ = require('lodash'); +var File = require('./lib/file'); +var Env = require('./lib/env'); + +var file = new File(); + +file.createEnv = function(opt) { + return new Env(_.extend({}, this._options, opt)); +}; + +module.exports = file; diff --git a/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/file-utils/lib/env.js b/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/file-utils/lib/env.js new file mode 100644 index 0000000..cd03ae8 --- /dev/null +++ b/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/file-utils/lib/env.js @@ -0,0 +1,163 @@ +var path = require('path'); +var util = require('util'); +var _ = require('lodash'); +var File = require('./file'); + +module.exports = Env; + +function Env(opt) { + File.apply(this, arguments); + + this._base = opt.base || ''; + this._destBase = opt.dest || ''; + this._writeFilters = {}; + this._validationFilters = {}; + + var methodsToPrefix = [ 'mkdir', 'recurse', 'read', 'readJSON', 'write', 'delete', + 'exists', 'isLink', 'isDir', 'isFile' ]; + + // Prefix path arguments with this environment root dir + methodsToPrefix.forEach(function(methodName) { + this[methodName] = function() { + var args = _.toArray(arguments); + args[0] = this.fromBase(args[0]); + return File.prototype[methodName].apply(this, args); + }; + }.bind(this)); + + this.copy = function() { + var args = _.toArray(arguments); + args[0] = this.fromBase(args[0]); + args[1] = this.fromDestBase(args[1]); + return File.prototype.copy.apply(this, args); + }; + + this._actualWrite = this.write; + this.write = function(filepath, contents, options) { + return this.applyWriteFilters({ + path: filepath, + contents: contents + }, this.applyValidationFilters, options); + }; +} + +util.inherits(Env, File); + +Env.prototype.setBase = function(filepath) { + this._base = filepath; +}; + +// Return a path prefixed by the base (if not absolute) +Env.prototype.fromBase = function(filepath) { + if (this.isPathAbsolute(filepath)) { + return filepath; + } + return path.join(_.isFunction(this._base) ? this._base() : this._base, filepath); +}; + +Env.prototype.setDestBase = function(filepath) { + this._destBase = filepath; +}; + +// Return a path prefixed by the destination base (if not absolute) +Env.prototype.fromDestBase = function(filepath) { + if (this.isPathAbsolute(filepath)) { + return filepath; + } + return path.join(_.isFunction(this._destBase) ? this._destBase() : this._destBase, filepath); +}; + +Env.prototype.registerWriteFilter = function(name, filter) { + this._writeFilters[name] = filter; +}; + +Env.prototype.removeWriteFilter = function(name) { + delete this._writeFilters[name]; +}; + +Env.prototype.registerValidationFilter = function(name, filter) { + this._validationFilters[name] = filter; +}; + +Env.prototype.removeValidationFilter = function(name) { + delete this._validationFilters[name]; +}; + + +Env.prototype.applyWriteFilters = function(file, validate, options) { + var writeFilters = _.reduce(this._writeFilters, function(m, v) { m.push(v); return m; }, []); + if (!writeFilters.length) { + return validate.call(this, file, options); + } + + var i = 0; + var output; + var recurse = function(file) { + i++; + if (writeFilters[i]) { + runAsync(writeFilters[i], recurse, file); + } else { + output = validate.call(this, file, options); + } + }.bind(this); + + runAsync(writeFilters[i], recurse, file); + + return output; +}; + +Env.prototype.applyValidationFilters = function( file, options ) { + var validationFilters = _.reduce(this._validationFilters, function(m, v) { m.push(v); return m; }, []); + if (!validationFilters.length) { + return this._actualWrite.call(this, file.path, file.contents, options); + } + + var i = 0; + var output; + var recurse = function(validated) { + if ( validated !== true ) { + return this.log.write(validated || 'Not actually writing to '+ file.path +' haven\'t pass validation' ); + } + i++; + if (validationFilters[i]) { + runAsync(validationFilters[i], recurse, file); + } else { + output = this._actualWrite.call(this, file.path, file.contents, options); + } + }.bind(this); + + runAsync(validationFilters[i], recurse, file); + + return output; +}; + + +/** + * Allow a function to be run async by using `this.async()`. If not, then the function is + * runned synchronously. + * @param {Function} func The function to run + * @param {Function} cb Callback to be provided even if the function is run sync + * @param {...rest} Arguments passed to `func` + * @return {null} + */ +function runAsync( func, cb ) { + var rest = []; + var len = 1; + + while ( len++ < arguments.length ) { + rest.push( arguments[len] ); + } + + var async = false; + var returnValue = func.apply({ + async: function() { + async = true; + return _.once(cb); + } + }, rest ); + + // Note: Call the callback synchronously to keep the sync flow by default + if ( !async ) { + cb(returnValue); + } +} diff --git a/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/file-utils/lib/file.js b/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/file-utils/lib/file.js new file mode 100644 index 0000000..f55eba9 --- /dev/null +++ b/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/file-utils/lib/file.js @@ -0,0 +1,367 @@ +/* + * grunt + * http://gruntjs.com/ + * + * Copyright (c) 2013 "Cowboy" Ben Alman + * Licensed under the MIT license. + * https://github.com/gruntjs/grunt/blob/master/LICENSE-MIT + */ + +// Nodejs libs. +var fs = require('fs'); +var path = require('path'); + +// The module to be exported. +module.exports = File; + +// External libs. +var rimraf = require('rimraf'); +var iconv = require('iconv-lite'); +var glob = require('glob'); +var minimatch = require('minimatch'); +var isBinaryFile = require('isbinaryfile'); +var _ = require('lodash'); + +var fquery = require('./query'); +var defaultLogger = require('./logger'); + +// Windows? +var win32 = process.platform === 'win32'; + +// Normalize \\ paths to / paths. +var unixifyPath = function(filepath) { + if (win32) { + return filepath.replace(/\\/g, '/'); + } else { + return filepath; + } +}; + +function File(opt) { + if (!opt) { + opt = {}; + } + + this._options = _.defaults(opt, { + write: true, + encoding: 'utf8', + logger: defaultLogger + }); + + Object.defineProperty(this, 'log', { + get: function() { + return this.option('logger'); + } + }); +} + +// Get or set options +File.prototype.option = function( key, val ) { + if (arguments.length < 2) { + return this._options[key]; + } else { + return this._options[key] = val; + } +}; + +// Process specified wildcard glob patterns or filenames against a +// callback, excluding and uniquing files in the result set. +var processPatterns = function(patterns, fn) { + // Filepaths to return. + var result = []; + // Iterate over flattened patterns array. + _.flatten(patterns).forEach(function(pattern) { + // If the first character is ! it should be omitted + var exclusion = pattern.indexOf('!') === 0; + // If the pattern is an exclusion, remove the ! + if (exclusion) { pattern = pattern.slice(1); } + // Find all matching files for this pattern. + var matches = fn(pattern); + if (exclusion) { + // If an exclusion, remove matching files. + result = _.difference(result, matches); + } else { + // Otherwise add matching files. + result = _.union(result, matches); + } + }); + return result; +}; + +// Match a filepath or filepaths against one or more wildcard patterns. Returns +// all matching filepaths. +File.prototype.match = function(options, patterns, filepaths) { + if (!_.isPlainObject(options)) { + filepaths = patterns; + patterns = options; + options = {}; + } + + // Return empty set if either patterns or filepaths was omitted. + if (patterns == null || filepaths == null) { return []; } + // Normalize patterns and filepaths to arrays. + if (!Array.isArray(patterns)) { patterns = [patterns]; } + if (!Array.isArray(filepaths)) { filepaths = [filepaths]; } + // Return empty set if there are no patterns or filepaths. + if (patterns.length === 0 || filepaths.length === 0) { return []; } + // Return all matching filepaths. + return processPatterns(patterns, function(pattern) { + return minimatch.match(filepaths, pattern, options); + }.bind(this)); +}; + +// Match a filepath or filepaths against one or more wildcard patterns. Returns +// true if any of the patterns match. +File.prototype.isMatch = function() { + return this.match.apply(this, arguments).length > 0; +}; + +// Return an array of all file paths that match the given wildcard patterns. +File.prototype.expand = function() { + var args = _.toArray(arguments); + // If the first argument is an options object, save those options to pass + // into the File.prototype.glob.sync method. + var options = _.isPlainObject(args[0]) ? args.shift() : {}; + // Use the first argument if it's an Array, otherwise convert the arguments + // object to an array and use that. + var patterns = Array.isArray(args[0]) ? args[0] : args; + // Return empty set if there are no patterns or filepaths. + if (patterns.length === 0) { return []; } + // Return all matching filepaths. + var matches = processPatterns(patterns, function(pattern) { + // Find all matching files for this pattern. + return glob.sync(pattern, options); + }.bind(this)); + // Filter result set? + if (options.filter) { + matches = matches.filter(function(filepath) { + filepath = path.join(options.cwd || '', filepath); + try { + if (typeof options.filter === 'function') { + return options.filter(filepath); + } else { + // If the file is of the right type and exists, this should work. + return fs.statSync(filepath)[options.filter](); + } + } catch(e) { + // Otherwise, it's probably not the right type. + return false; + } + }); + } + return matches; +}; + +var pathSeparatorRe = /[\/\\]/g; + +// Build a multi task "files" object dynamically. +File.prototype.expandMapping = function(patterns, destBase, options) { + options = _.defaults({}, options, { + rename: function(destBase, destPath) { + return path.join(destBase || '', destPath); + } + }); + var files = []; + var fileByDest = {}; + // Find all files matching pattern, using passed-in options. + this.expand(options, patterns).forEach(function(src) { + var destPath = src; + // Flatten? + if (options.flatten) { + destPath = path.basename(destPath); + } + // Change the extension? + if (options.ext) { + destPath = destPath.replace(/(\.[^\/]*)?$/, options.ext); + } + // Generate destination filename. + var dest = options.rename(destBase, destPath, options); + // Prepend cwd to src path if necessary. + if (options.cwd) { src = path.join(options.cwd, src); } + // Normalize filepaths to be unix-style. + dest = dest.replace(pathSeparatorRe, '/'); + src = src.replace(pathSeparatorRe, '/'); + // Map correct src path to dest path. + if (fileByDest[dest]) { + // If dest already exists, push this src onto that dest's src array. + fileByDest[dest].src.push(src); + } else { + // Otherwise create a new src-dest file mapping object. + files.push({ + src: [src], + dest: dest, + }); + // And store a reference for later use. + fileByDest[dest] = files[files.length - 1]; + } + }); + return files; +}; + +// Like mkdir -p. Create a directory and any intermediary directories. +File.prototype.mkdir = function(dirpath, mode) { + if (!this.option('write')) { return; } + // Set directory mode in a strict-mode-friendly way. + if (mode == null) { + mode = parseInt('0777', 8) & (~process.umask()); + } + dirpath.split(pathSeparatorRe).reduce(function(parts, part) { + parts += part + '/'; + var subpath = path.resolve(parts); + if (!File.prototype.exists.call(null, subpath)) { + try { + fs.mkdirSync(subpath, mode); + } catch(e) { + throw new Error('Unable to create directory "' + subpath + '" (Error code: ' + e.code + ').', e); + } + } + return parts; + }.bind(this), ''); +}; + +// Recurse into a directory, executing callback for each file. +File.prototype.recurse = function(rootdir, callback, subdir) { + var abspath = subdir ? path.join(rootdir, subdir) : rootdir; + fs.readdirSync(abspath).forEach(function(filename) { + var filepath = path.join(abspath, filename); + if (fs.statSync(filepath).isDirectory()) { + this.recurse(rootdir, callback, unixifyPath(path.join(subdir || '', filename || ''))); + } else { + callback(unixifyPath(filepath), rootdir, subdir, filename); + } + }.bind(this)); +}; + +// Read a file, return its contents. +File.prototype.read = function(filepath, options) { + if (!options) { options = {}; } + var contents; + try { + contents = fs.readFileSync(filepath); + // If encoding is not explicitly null, convert from encoded buffer to a + // string. If no encoding was specified, use the default. + if (options.encoding !== null) { + contents = iconv.decode(contents, options.encoding || this.option('encoding')); + // Strip any BOM that might exist. + if (contents.charCodeAt(0) === 0xFEFF) { + contents = contents.substring(1); + } + } + return contents; + } catch(e) { + throw new Error('Unable to read "' + filepath + '" file (Error code: ' + e.code + ').', e); + } +}; + +// Read a file, parse its contents, return an object. +File.prototype.readJSON = function(filepath, options) { + var src = this.read(filepath, options); + var result; + try { + result = JSON.parse(src); + return result; + } catch(e) { + throw new Error('Unable to parse "' + filepath + '" file (' + e.message + ').', e); + } +}; + +// Write a file. +File.prototype.write = function(filepath, contents, options) { + if (!options) { options = {}; } + var nowrite = !this.option('write'); + this.log.write((nowrite ? 'Not actually writing ' : 'Writing ') + filepath + '...'); + // Create path, if necessary. + this.mkdir(path.dirname(filepath)); + try { + // If contents is already a Buffer, don't try to encode it. If no encoding + // was specified, use the default. + if (!Buffer.isBuffer(contents)) { + contents = iconv.encode(contents, options.encoding || this.option('encoding')); + } + // Actually write file. + if (!nowrite) { + fs.writeFileSync(filepath, contents, { mode: options.mode }); + } + return true; + } catch(e) { + throw new Error('Unable to write "' + filepath + '" file (Error code: ' + e.code + ').', e); + } +}; + +// Read a file, optionally processing its content, then write the output. +File.prototype.copy = function(srcpath, destpath, options) { + if (!options) { options = {}; } + // If a process function was specified, and noProcess isn't true or doesn't + // match the srcpath, process the file's source. + var process = options.process && options.noProcess !== true && + !(options.noProcess && this.isMatch(options.noProcess, srcpath)); + // If the file will be processed, use the encoding as-specified. Otherwise, + // use an encoding of null to force the file to be read/written as a Buffer. + if (options.encoding === undefined && !isBinaryFile(srcpath)) { + options.encoding = this.option('encoding'); + } + var readWriteOptions = process ? options : _.extend({ + encoding: null, + mode: fs.statSync(srcpath).mode + }, options); + // Actually read the file. + var contents = this.read(srcpath, readWriteOptions); + if (process) { + this.log.write('Processing source...'); + try { + contents = options.process(contents, srcpath); + } catch(e) { + throw new Error('Error while processing "' + srcpath + '" file.', e); + } + } + + // Abort copy if the process function returns false. + if (contents === false) { + this.log.write('Write aborted.'); + } else { + this.write(destpath, contents, readWriteOptions); + } +}; + +// Delete folders and files recursively +File.prototype.delete = function(filepath, options) { + var nowrite = !this.option('write'); + if (!options) { + options = {force: this.option('force') || false}; + } + + this.log.write((nowrite ? 'Not actually deleting ' : 'Deleting ') + filepath + '...'); + + if (!File.prototype.exists.call(null, filepath)) { + this.log.warn('Cannot delete nonexistent file.'); + return false; + } + + // Only delete cwd or outside cwd if --force enabled. Be careful, people! + if (!options.force) { + var base = path.resolve(this._base || ''); + if (fquery.isPathCwd(filepath)) { + this.log.warn('Cannot delete the current working directory.'); + return false; + } else if (!fquery.doesPathContain(base, filepath)) { + this.log.warn('Cannot delete files outside the current working directory.'); + return false; + } + } + + try { + // Actually delete. Or not. + if (!nowrite) { + rimraf.sync(filepath); + } + return true; + } catch(e) { + throw new Error('Unable to delete "' + filepath + '" file (' + e.message + ').', e); + } +}; + +// Extend dependencies +File.prototype.glob = require('glob'); +File.prototype.minimatch = require('minimatch'); +File.prototype.findup = require('findup-sync'); +_.extend(File.prototype, fquery); diff --git a/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/file-utils/lib/logger.js b/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/file-utils/lib/logger.js new file mode 100644 index 0000000..a47237c --- /dev/null +++ b/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/file-utils/lib/logger.js @@ -0,0 +1,8 @@ +module.exports = { + warn: function(msg) { + console.log('WARN: ' + msg); + }, + write: function(msg) { + console.log(msg); + } +}; diff --git a/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/file-utils/lib/query.js b/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/file-utils/lib/query.js new file mode 100644 index 0000000..7c3f713 --- /dev/null +++ b/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/file-utils/lib/query.js @@ -0,0 +1,82 @@ +/** + * File/Path comparison and queries + */ + +var path = require('path'); +var fs = require('fs'); + +// True if the file path exists. +exports.exists = function() { + var filepath = path.join.apply(path, arguments); + return fs.existsSync(filepath); +}; + +// True if the file is a symbolic link. +exports.isLink = function() { + var filepath = path.join.apply(path, arguments); + return this.exists(filepath) && fs.lstatSync(filepath).isSymbolicLink(); +}; + +// True if the path is a directory. +exports.isDir = function() { + var filepath = path.join.apply(path, arguments); + return this.exists(filepath) && fs.statSync(filepath).isDirectory(); +}; + +// True if the path is a file. +exports.isFile = function() { + var filepath = path.join.apply(path, arguments); + return this.exists(filepath) && fs.statSync(filepath).isFile(); +}; + +exports.isExecutable = function(filepath) { + var stats = fs.statSync(filepath); + return !!(1 & parseFloat((stats.mode & parseInt(777, 8)).toString(8)[0])); +}; + +// Is a given file path absolute? +exports.isPathAbsolute = function() { + var filepath = path.join.apply(path, arguments); + return path.resolve(filepath) === filepath.replace(/[\/\\]+$/, ''); +}; + +// Do all the specified paths refer to the same path? +exports.arePathsEquivalent = function(first) { + first = path.resolve(first); + for (var i = 1; i < arguments.length; i++) { + if (first !== path.resolve(arguments[i])) { return false; } + } + return true; +}; + +// Are descendant path(s) contained within ancestor path? Note: does not test +// if paths actually exist. +exports.doesPathContain = function(ancestor) { + ancestor = path.resolve(ancestor); + var relative; + for (var i = 1; i < arguments.length; i++) { + relative = path.relative(path.resolve(arguments[i]), ancestor); + if (relative === '' || /\w+/.test(relative)) { return false; } + } + return true; +}; + +// Test to see if a filepath is the CWD. +exports.isPathCwd = function() { + var filepath = path.join.apply(path, arguments); + try { + return this.arePathsEquivalent(process.cwd(), fs.realpathSync(filepath)); + } catch(e) { + return false; + } +}; + +// Test to see if a filepath is contained within the CWD. +exports.isPathInCwd = function() { + var filepath = path.join.apply(path, arguments); + try { + return this.doesPathContain(process.cwd(), fs.realpathSync(filepath)); + } catch(e) { + return false; + } +}; diff --git a/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/file-utils/node_modules/.bin/rimraf b/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/file-utils/node_modules/.bin/rimraf new file mode 100644 index 0000000..71c3553 --- /dev/null +++ b/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/file-utils/node_modules/.bin/rimraf @@ -0,0 +1,15 @@ +#!/bin/sh +basedir=`dirname "$0"` + +case `uname` in + *CYGWIN*) basedir=`cygpath -w "$basedir"`;; +esac + +if [ -x "$basedir/node" ]; then + "$basedir/node" "$basedir/../rimraf/bin.js" "$@" + ret=$? +else + node "$basedir/../rimraf/bin.js" "$@" + ret=$? +fi +exit $ret diff --git a/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/file-utils/node_modules/.bin/rimraf.cmd b/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/file-utils/node_modules/.bin/rimraf.cmd new file mode 100644 index 0000000..772a3ef --- /dev/null +++ b/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/file-utils/node_modules/.bin/rimraf.cmd @@ -0,0 +1,5 @@ +@IF EXIST "%~dp0\node.exe" ( + "%~dp0\node.exe" "%~dp0\..\rimraf\bin.js" %* +) ELSE ( + node "%~dp0\..\rimraf\bin.js" %* +) \ No newline at end of file diff --git a/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/file-utils/node_modules/findup-sync/Gruntfile.js b/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/file-utils/node_modules/findup-sync/Gruntfile.js new file mode 100644 index 0000000..2f964a5 --- /dev/null +++ b/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/file-utils/node_modules/findup-sync/Gruntfile.js @@ -0,0 +1,25 @@ +'use strict'; + +module.exports = function(grunt) { + + // Project configuration. + grunt.initConfig({ + nodeunit: { + files: ['test/**/*_test.js'], + }, + jshint: { + options: { + jshintrc: '.jshintrc' + }, + all: ['Gruntfile.js', 'lib/**/*.js', 'test/**/*.js'] + } + }); + + // Load plugins. + grunt.loadNpmTasks('grunt-contrib-jshint'); + grunt.loadNpmTasks('grunt-contrib-nodeunit'); + + // Default task. + grunt.registerTask('default', ['jshint', 'nodeunit']); + +}; diff --git a/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/file-utils/node_modules/findup-sync/lib/findup-sync.js b/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/file-utils/node_modules/findup-sync/lib/findup-sync.js new file mode 100644 index 0000000..742a478 --- /dev/null +++ b/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/file-utils/node_modules/findup-sync/lib/findup-sync.js @@ -0,0 +1,46 @@ +/* + * findup-sync + * https://github.com/cowboy/node-findup-sync + * + * Copyright (c) 2013 "Cowboy" Ben Alman + * Licensed under the MIT license. + */ + +'use strict'; + +// Nodejs libs. +var path = require('path'); + +// External libs. +var glob = require('glob'); +var _ = require('lodash'); + +// Search for a filename in the given directory or all parent directories. +module.exports = function(patterns, options) { + // Normalize patterns to an array. + if (!Array.isArray(patterns)) { patterns = [patterns]; } + // Create globOptions so that it can be modified without mutating the + // original object. + var globOptions = Object.create(options || {}); + globOptions.maxDepth = 1; + globOptions.cwd = path.resolve(globOptions.cwd || '.'); + + var files, lastpath; + do { + // Search for files matching patterns. + files = _(patterns).map(function(pattern) { + return glob.sync(pattern, globOptions); + }).flatten().uniq().value(); + // Return file if found. + if (files.length > 0) { + return path.resolve(path.join(globOptions.cwd, files[0])); + } + // Go up a directory. + lastpath = globOptions.cwd; + globOptions.cwd = path.resolve(globOptions.cwd, '..'); + // If parentpath is the same as basedir, we can't go any higher. + } while (globOptions.cwd !== lastpath); + + // No files were found! + return null; +}; diff --git a/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/file-utils/node_modules/findup-sync/package.json b/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/file-utils/node_modules/findup-sync/package.json new file mode 100644 index 0000000..7d4426f --- /dev/null +++ b/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/file-utils/node_modules/findup-sync/package.json @@ -0,0 +1,64 @@ +{ + "name": "findup-sync", + "description": "Find the first file matching a given pattern in the current directory or the nearest ancestor directory.", + "version": "0.1.3", + "homepage": "https://github.com/cowboy/node-findup-sync", + "author": { + "name": "\"Cowboy\" Ben Alman", + "url": "http://benalman.com/" + }, + "repository": { + "type": "git", + "url": "git://github.com/cowboy/node-findup-sync.git" + }, + "bugs": { + "url": "https://github.com/cowboy/node-findup-sync/issues" + }, + "licenses": [ + { + "type": "MIT", + "url": "https://github.com/cowboy/node-findup-sync/blob/master/LICENSE-MIT" + } + ], + "main": "lib/findup-sync", + "engines": { + "node": ">= 0.6.0" + }, + "scripts": { + "test": "grunt nodeunit" + }, + "dependencies": { + "glob": "~3.2.9", + "lodash": "~2.4.1" + }, + "devDependencies": { + "grunt": "~0.4.4", + "grunt-contrib-jshint": "~0.9.2", + "grunt-contrib-nodeunit": "~0.3.3" + }, + "keywords": [ + "find", + "glob", + "file" + ], + "_id": "findup-sync@0.1.3", + "dist": { + "shasum": "7f3e7a97b82392c653bf06589bd85190e93c3683", + "tarball": "http://registry.npmjs.org/findup-sync/-/findup-sync-0.1.3.tgz" + }, + "_from": "findup-sync@~0.1.2", + "_npmVersion": "1.4.4", + "_npmUser": { + "name": "cowboy", + "email": "cowboy@rj3.net" + }, + "maintainers": [ + { + "name": "cowboy", + "email": "cowboy@rj3.net" + } + ], + "directories": {}, + "_shasum": "7f3e7a97b82392c653bf06589bd85190e93c3683", + "_resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-0.1.3.tgz" +} diff --git a/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/file-utils/node_modules/glob/glob.js b/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/file-utils/node_modules/glob/glob.js new file mode 100644 index 0000000..f646c44 --- /dev/null +++ b/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/file-utils/node_modules/glob/glob.js @@ -0,0 +1,728 @@ +// Approach: +// +// 1. Get the minimatch set +// 2. For each pattern in the set, PROCESS(pattern) +// 3. Store matches per-set, then uniq them +// +// PROCESS(pattern) +// Get the first [n] items from pattern that are all strings +// Join these together. This is PREFIX. +// If there is no more remaining, then stat(PREFIX) and +// add to matches if it succeeds. END. +// readdir(PREFIX) as ENTRIES +// If fails, END +// If pattern[n] is GLOBSTAR +// // handle the case where the globstar match is empty +// // by pruning it out, and testing the resulting pattern +// PROCESS(pattern[0..n] + pattern[n+1 .. $]) +// // handle other cases. +// for ENTRY in ENTRIES (not dotfiles) +// // attach globstar + tail onto the entry +// PROCESS(pattern[0..n] + ENTRY + pattern[n .. $]) +// +// else // not globstar +// for ENTRY in ENTRIES (not dotfiles, unless pattern[n] is dot) +// Test ENTRY against pattern[n] +// If fails, continue +// If passes, PROCESS(pattern[0..n] + item + pattern[n+1 .. $]) +// +// Caveat: +// Cache all stats and readdirs results to minimize syscall. Since all +// we ever care about is existence and directory-ness, we can just keep +// `true` for files, and [children,...] for directories, or `false` for +// things that don't exist. + + + +module.exports = glob + +var fs = require("fs") +, minimatch = require("minimatch") +, Minimatch = minimatch.Minimatch +, inherits = require("inherits") +, EE = require("events").EventEmitter +, path = require("path") +, isDir = {} +, assert = require("assert").ok + +function glob (pattern, options, cb) { + if (typeof options === "function") cb = options, options = {} + if (!options) options = {} + + if (typeof options === "number") { + deprecated() + return + } + + var g = new Glob(pattern, options, cb) + return g.sync ? g.found : g +} + +glob.fnmatch = deprecated + +function deprecated () { + throw new Error("glob's interface has changed. Please see the docs.") +} + +glob.sync = globSync +function globSync (pattern, options) { + if (typeof options === "number") { + deprecated() + return + } + + options = options || {} + options.sync = true + return glob(pattern, options) +} + +this._processingEmitQueue = false + +glob.Glob = Glob +inherits(Glob, EE) +function Glob (pattern, options, cb) { + if (!(this instanceof Glob)) { + return new Glob(pattern, options, cb) + } + + if (typeof options === "function") { + cb = options + options = null + } + + if (typeof cb === "function") { + this.on("error", cb) + this.on("end", function (matches) { + cb(null, matches) + }) + } + + options = options || {} + + this._endEmitted = false + this.EOF = {} + this._emitQueue = [] + + this.paused = false + this._processingEmitQueue = false + + this.maxDepth = options.maxDepth || 1000 + this.maxLength = options.maxLength || Infinity + this.cache = options.cache || {} + this.statCache = options.statCache || {} + + this.changedCwd = false + var cwd = process.cwd() + if (!options.hasOwnProperty("cwd")) this.cwd = cwd + else { + this.cwd = options.cwd + this.changedCwd = path.resolve(options.cwd) !== cwd + } + + this.root = options.root || path.resolve(this.cwd, "/") + this.root = path.resolve(this.root) + if (process.platform === "win32") + this.root = this.root.replace(/\\/g, "/") + + this.nomount = !!options.nomount + + if (!pattern) { + throw new Error("must provide pattern") + } + + // base-matching: just use globstar for that. + if (options.matchBase && -1 === pattern.indexOf("/")) { + if (options.noglobstar) { + throw new Error("base matching requires globstar") + } + pattern = "**/" + pattern + } + + this.strict = options.strict !== false + this.dot = !!options.dot + this.mark = !!options.mark + this.sync = !!options.sync + this.nounique = !!options.nounique + this.nonull = !!options.nonull + this.nosort = !!options.nosort + this.nocase = !!options.nocase + this.stat = !!options.stat + + this.debug = !!options.debug || !!options.globDebug + if (this.debug) + this.log = console.error + + this.silent = !!options.silent + + var mm = this.minimatch = new Minimatch(pattern, options) + this.options = mm.options + pattern = this.pattern = mm.pattern + + this.error = null + this.aborted = false + + // list of all the patterns that ** has resolved do, so + // we can avoid visiting multiple times. + this._globstars = {} + + EE.call(this) + + // process each pattern in the minimatch set + var n = this.minimatch.set.length + + // The matches are stored as {: true,...} so that + // duplicates are automagically pruned. + // Later, we do an Object.keys() on these. + // Keep them as a list so we can fill in when nonull is set. + this.matches = new Array(n) + + this.minimatch.set.forEach(iterator.bind(this)) + function iterator (pattern, i, set) { + this._process(pattern, 0, i, function (er) { + if (er) this.emit("error", er) + if (-- n <= 0) this._finish() + }) + } +} + +Glob.prototype.log = function () {} + +Glob.prototype._finish = function () { + assert(this instanceof Glob) + + var nou = this.nounique + , all = nou ? [] : {} + + for (var i = 0, l = this.matches.length; i < l; i ++) { + var matches = this.matches[i] + this.log("matches[%d] =", i, matches) + // do like the shell, and spit out the literal glob + if (!matches) { + if (this.nonull) { + var literal = this.minimatch.globSet[i] + if (nou) all.push(literal) + else all[literal] = true + } + } else { + // had matches + var m = Object.keys(matches) + if (nou) all.push.apply(all, m) + else m.forEach(function (m) { + all[m] = true + }) + } + } + + if (!nou) all = Object.keys(all) + + if (!this.nosort) { + all = all.sort(this.nocase ? alphasorti : alphasort) + } + + if (this.mark) { + // at *some* point we statted all of these + all = all.map(this._mark, this) + } + + this.log("emitting end", all) + + this.EOF = this.found = all + this.emitMatch(this.EOF) +} + +function alphasorti (a, b) { + a = a.toLowerCase() + b = b.toLowerCase() + return alphasort(a, b) +} + +function alphasort (a, b) { + return a > b ? 1 : a < b ? -1 : 0 +} + +Glob.prototype._mark = function (p) { + var c = this.cache[p] + var m = p + if (c) { + var isDir = c === 2 || Array.isArray(c) + var slash = p.slice(-1) === '/' + + if (isDir && !slash) + m += '/' + else if (!isDir && slash) + m = m.slice(0, -1) + + if (m !== p) { + this.statCache[m] = this.statCache[p] + this.cache[m] = this.cache[p] + } + } + + return m +} + +Glob.prototype.abort = function () { + this.aborted = true + this.emit("abort") +} + +Glob.prototype.pause = function () { + if (this.paused) return + if (this.sync) + this.emit("error", new Error("Can't pause/resume sync glob")) + this.paused = true + this.emit("pause") +} + +Glob.prototype.resume = function () { + if (!this.paused) return + if (this.sync) + this.emit("error", new Error("Can't pause/resume sync glob")) + this.paused = false + this.emit("resume") + this._processEmitQueue() + //process.nextTick(this.emit.bind(this, "resume")) +} + +Glob.prototype.emitMatch = function (m) { + this.log('emitMatch', m) + this._emitQueue.push(m) + this._processEmitQueue() +} + +Glob.prototype._processEmitQueue = function (m) { + this.log("pEQ paused=%j processing=%j m=%j", this.paused, + this._processingEmitQueue, m) + var done = false + while (!this._processingEmitQueue && + !this.paused) { + this._processingEmitQueue = true + var m = this._emitQueue.shift() + this.log(">processEmitQueue", m === this.EOF ? ":EOF:" : m) + if (!m) { + this.log(">processEmitQueue, falsey m") + this._processingEmitQueue = false + break + } + + if (m === this.EOF || !(this.mark && !this.stat)) { + this.log("peq: unmarked, or eof") + next.call(this, 0, false) + } else if (this.statCache[m]) { + var sc = this.statCache[m] + var exists + if (sc) + exists = sc.isDirectory() ? 2 : 1 + this.log("peq: stat cached") + next.call(this, exists, exists === 2) + } else { + this.log("peq: _stat, then next") + this._stat(m, next) + } + + function next(exists, isDir) { + this.log("next", m, exists, isDir) + var ev = m === this.EOF ? "end" : "match" + + // "end" can only happen once. + assert(!this._endEmitted) + if (ev === "end") + this._endEmitted = true + + if (exists) { + // Doesn't mean it necessarily doesn't exist, it's possible + // we just didn't check because we don't care that much, or + // this is EOF anyway. + if (isDir && !m.match(/\/$/)) { + m = m + "/" + } else if (!isDir && m.match(/\/$/)) { + m = m.replace(/\/+$/, "") + } + } + this.log("emit", ev, m) + this.emit(ev, m) + this._processingEmitQueue = false + if (done && m !== this.EOF && !this.paused) + this._processEmitQueue() + } + } + done = true +} + +Glob.prototype._process = function (pattern, depth, index, cb_) { + assert(this instanceof Glob) + + var cb = function cb (er, res) { + assert(this instanceof Glob) + if (this.paused) { + if (!this._processQueue) { + this._processQueue = [] + this.once("resume", function () { + var q = this._processQueue + this._processQueue = null + q.forEach(function (cb) { cb() }) + }) + } + this._processQueue.push(cb_.bind(this, er, res)) + } else { + cb_.call(this, er, res) + } + }.bind(this) + + if (this.aborted) return cb() + + if (depth > this.maxDepth) return cb() + + // Get the first [n] parts of pattern that are all strings. + var n = 0 + while (typeof pattern[n] === "string") { + n ++ + } + // now n is the index of the first one that is *not* a string. + + // see if there's anything else + var prefix + switch (n) { + // if not, then this is rather simple + case pattern.length: + prefix = pattern.join("/") + this._stat(prefix, function (exists, isDir) { + // either it's there, or it isn't. + // nothing more to do, either way. + if (exists) { + if (prefix && isAbsolute(prefix) && !this.nomount) { + if (prefix.charAt(0) === "/") { + prefix = path.join(this.root, prefix) + } else { + prefix = path.resolve(this.root, prefix) + } + } + + if (process.platform === "win32") + prefix = prefix.replace(/\\/g, "/") + + this.matches[index] = this.matches[index] || {} + this.matches[index][prefix] = true + this.emitMatch(prefix) + } + return cb() + }) + return + + case 0: + // pattern *starts* with some non-trivial item. + // going to readdir(cwd), but not include the prefix in matches. + prefix = null + break + + default: + // pattern has some string bits in the front. + // whatever it starts with, whether that's "absolute" like /foo/bar, + // or "relative" like "../baz" + prefix = pattern.slice(0, n) + prefix = prefix.join("/") + break + } + + // get the list of entries. + var read + if (prefix === null) read = "." + else if (isAbsolute(prefix) || isAbsolute(pattern.join("/"))) { + if (!prefix || !isAbsolute(prefix)) { + prefix = path.join("/", prefix) + } + read = prefix = path.resolve(prefix) + + // if (process.platform === "win32") + // read = prefix = prefix.replace(/^[a-zA-Z]:|\\/g, "/") + + this.log('absolute: ', prefix, this.root, pattern, read) + } else { + read = prefix + } + + this.log('readdir(%j)', read, this.cwd, this.root) + + return this._readdir(read, function (er, entries) { + if (er) { + // not a directory! + // this means that, whatever else comes after this, it can never match + return cb() + } + + // globstar is special + if (pattern[n] === minimatch.GLOBSTAR) { + // test without the globstar, and with every child both below + // and replacing the globstar. + var s = [ pattern.slice(0, n).concat(pattern.slice(n + 1)) ] + entries.forEach(function (e) { + if (e.charAt(0) === "." && !this.dot) return + // instead of the globstar + s.push(pattern.slice(0, n).concat(e).concat(pattern.slice(n + 1))) + // below the globstar + s.push(pattern.slice(0, n).concat(e).concat(pattern.slice(n))) + }, this) + + s = s.filter(function (pattern) { + var key = gsKey(pattern) + var seen = !this._globstars[key] + this._globstars[key] = true + return seen + }, this) + + if (!s.length) + return cb() + + // now asyncForEach over this + var l = s.length + , errState = null + s.forEach(function (gsPattern) { + this._process(gsPattern, depth + 1, index, function (er) { + if (errState) return + if (er) return cb(errState = er) + if (--l <= 0) return cb() + }) + }, this) + + return + } + + // not a globstar + // It will only match dot entries if it starts with a dot, or if + // dot is set. Stuff like @(.foo|.bar) isn't allowed. + var pn = pattern[n] + var rawGlob = pattern[n]._glob + , dotOk = this.dot || rawGlob.charAt(0) === "." + + entries = entries.filter(function (e) { + return (e.charAt(0) !== "." || dotOk) && + e.match(pattern[n]) + }) + + // If n === pattern.length - 1, then there's no need for the extra stat + // *unless* the user has specified "mark" or "stat" explicitly. + // We know that they exist, since the readdir returned them. + if (n === pattern.length - 1 && + !this.mark && + !this.stat) { + entries.forEach(function (e) { + if (prefix) { + if (prefix !== "/") e = prefix + "/" + e + else e = prefix + e + } + if (e.charAt(0) === "/" && !this.nomount) { + e = path.join(this.root, e) + } + + if (process.platform === "win32") + e = e.replace(/\\/g, "/") + + this.matches[index] = this.matches[index] || {} + this.matches[index][e] = true + this.emitMatch(e) + }, this) + return cb.call(this) + } + + + // now test all the remaining entries as stand-ins for that part + // of the pattern. + var l = entries.length + , errState = null + if (l === 0) return cb() // no matches possible + entries.forEach(function (e) { + var p = pattern.slice(0, n).concat(e).concat(pattern.slice(n + 1)) + this._process(p, depth + 1, index, function (er) { + if (errState) return + if (er) return cb(errState = er) + if (--l === 0) return cb.call(this) + }) + }, this) + }) + +} + +function gsKey (pattern) { + return '**' + pattern.map(function (p) { + return (p === minimatch.GLOBSTAR) ? '**' : (''+p) + }).join('/') +} + +Glob.prototype._stat = function (f, cb) { + assert(this instanceof Glob) + var abs = f + if (f.charAt(0) === "/") { + abs = path.join(this.root, f) + } else if (this.changedCwd) { + abs = path.resolve(this.cwd, f) + } + + if (f.length > this.maxLength) { + var er = new Error("Path name too long") + er.code = "ENAMETOOLONG" + er.path = f + return this._afterStat(f, abs, cb, er) + } + + this.log('stat', [this.cwd, f, '=', abs]) + + if (!this.stat && this.cache.hasOwnProperty(f)) { + var exists = this.cache[f] + , isDir = exists && (Array.isArray(exists) || exists === 2) + if (this.sync) return cb.call(this, !!exists, isDir) + return process.nextTick(cb.bind(this, !!exists, isDir)) + } + + var stat = this.statCache[abs] + if (this.sync || stat) { + var er + try { + stat = fs.statSync(abs) + } catch (e) { + er = e + } + this._afterStat(f, abs, cb, er, stat) + } else { + fs.stat(abs, this._afterStat.bind(this, f, abs, cb)) + } +} + +Glob.prototype._afterStat = function (f, abs, cb, er, stat) { + var exists + assert(this instanceof Glob) + + if (abs.slice(-1) === "/" && stat && !stat.isDirectory()) { + this.log("should be ENOTDIR, fake it") + + er = new Error("ENOTDIR, not a directory '" + abs + "'") + er.path = abs + er.code = "ENOTDIR" + stat = null + } + + var emit = !this.statCache[abs] + this.statCache[abs] = stat + + if (er || !stat) { + exists = false + } else { + exists = stat.isDirectory() ? 2 : 1 + if (emit) + this.emit('stat', f, stat) + } + this.cache[f] = this.cache[f] || exists + cb.call(this, !!exists, exists === 2) +} + +Glob.prototype._readdir = function (f, cb) { + assert(this instanceof Glob) + var abs = f + if (f.charAt(0) === "/") { + abs = path.join(this.root, f) + } else if (isAbsolute(f)) { + abs = f + } else if (this.changedCwd) { + abs = path.resolve(this.cwd, f) + } + + if (f.length > this.maxLength) { + var er = new Error("Path name too long") + er.code = "ENAMETOOLONG" + er.path = f + return this._afterReaddir(f, abs, cb, er) + } + + this.log('readdir', [this.cwd, f, abs]) + if (this.cache.hasOwnProperty(f)) { + var c = this.cache[f] + if (Array.isArray(c)) { + if (this.sync) return cb.call(this, null, c) + return process.nextTick(cb.bind(this, null, c)) + } + + if (!c || c === 1) { + // either ENOENT or ENOTDIR + var code = c ? "ENOTDIR" : "ENOENT" + , er = new Error((c ? "Not a directory" : "Not found") + ": " + f) + er.path = f + er.code = code + this.log(f, er) + if (this.sync) return cb.call(this, er) + return process.nextTick(cb.bind(this, er)) + } + + // at this point, c === 2, meaning it's a dir, but we haven't + // had to read it yet, or c === true, meaning it's *something* + // but we don't have any idea what. Need to read it, either way. + } + + if (this.sync) { + var er, entries + try { + entries = fs.readdirSync(abs) + } catch (e) { + er = e + } + return this._afterReaddir(f, abs, cb, er, entries) + } + + fs.readdir(abs, this._afterReaddir.bind(this, f, abs, cb)) +} + +Glob.prototype._afterReaddir = function (f, abs, cb, er, entries) { + assert(this instanceof Glob) + if (entries && !er) { + this.cache[f] = entries + // if we haven't asked to stat everything for suresies, then just + // assume that everything in there exists, so we can avoid + // having to stat it a second time. This also gets us one step + // further into ELOOP territory. + if (!this.mark && !this.stat) { + entries.forEach(function (e) { + if (f === "/") e = f + e + else e = f + "/" + e + this.cache[e] = true + }, this) + } + + return cb.call(this, er, entries) + } + + // now handle errors, and cache the information + if (er) switch (er.code) { + case "ENOTDIR": // totally normal. means it *does* exist. + this.cache[f] = 1 + return cb.call(this, er) + case "ENOENT": // not terribly unusual + case "ELOOP": + case "ENAMETOOLONG": + case "UNKNOWN": + this.cache[f] = false + return cb.call(this, er) + default: // some unusual error. Treat as failure. + this.cache[f] = false + if (this.strict) this.emit("error", er) + if (!this.silent) console.error("glob error", er) + return cb.call(this, er) + } +} + +var isAbsolute = process.platform === "win32" ? absWin : absUnix + +function absWin (p) { + if (absUnix(p)) return true + // pull off the device/UNC bit from a windows path. + // from node's lib/path.js + var splitDeviceRe = + /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/ + , result = splitDeviceRe.exec(p) + , device = result[1] || '' + , isUnc = device && device.charAt(1) !== ':' + , isAbsolute = !!result[2] || isUnc // UNC paths are always absolute + + return isAbsolute +} + +function absUnix (p) { + return p.charAt(0) === "/" || p === "" +} diff --git a/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/file-utils/node_modules/glob/node_modules/minimatch/minimatch.js b/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/file-utils/node_modules/glob/node_modules/minimatch/minimatch.js new file mode 100644 index 0000000..4539678 --- /dev/null +++ b/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/file-utils/node_modules/glob/node_modules/minimatch/minimatch.js @@ -0,0 +1,1061 @@ +;(function (require, exports, module, platform) { + +if (module) module.exports = minimatch +else exports.minimatch = minimatch + +if (!require) { + require = function (id) { + switch (id) { + case "sigmund": return function sigmund (obj) { + return JSON.stringify(obj) + } + case "path": return { basename: function (f) { + f = f.split(/[\/\\]/) + var e = f.pop() + if (!e) e = f.pop() + return e + }} + case "lru-cache": return function LRUCache () { + // not quite an LRU, but still space-limited. + var cache = {} + var cnt = 0 + this.set = function (k, v) { + cnt ++ + if (cnt >= 100) cache = {} + cache[k] = v + } + this.get = function (k) { return cache[k] } + } + } + } +} + +minimatch.Minimatch = Minimatch + +var LRU = require("lru-cache") + , cache = minimatch.cache = new LRU({max: 100}) + , GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {} + , sigmund = require("sigmund") + +var path = require("path") + // any single thing other than / + // don't need to escape / when using new RegExp() + , qmark = "[^/]" + + // * => any number of characters + , star = qmark + "*?" + + // ** when dots are allowed. Anything goes, except .. and . + // not (^ or / followed by one or two dots followed by $ or /), + // followed by anything, any number of times. + , twoStarDot = "(?:(?!(?:\\\/|^)(?:\\.{1,2})($|\\\/)).)*?" + + // not a ^ or / followed by a dot, + // followed by anything, any number of times. + , twoStarNoDot = "(?:(?!(?:\\\/|^)\\.).)*?" + + // characters that need to be escaped in RegExp. + , reSpecials = charSet("().*{}+?[]^$\\!") + +// "abc" -> { a:true, b:true, c:true } +function charSet (s) { + return s.split("").reduce(function (set, c) { + set[c] = true + return set + }, {}) +} + +// normalizes slashes. +var slashSplit = /\/+/ + +minimatch.filter = filter +function filter (pattern, options) { + options = options || {} + return function (p, i, list) { + return minimatch(p, pattern, options) + } +} + +function ext (a, b) { + a = a || {} + b = b || {} + var t = {} + Object.keys(b).forEach(function (k) { + t[k] = b[k] + }) + Object.keys(a).forEach(function (k) { + t[k] = a[k] + }) + return t +} + +minimatch.defaults = function (def) { + if (!def || !Object.keys(def).length) return minimatch + + var orig = minimatch + + var m = function minimatch (p, pattern, options) { + return orig.minimatch(p, pattern, ext(def, options)) + } + + m.Minimatch = function Minimatch (pattern, options) { + return new orig.Minimatch(pattern, ext(def, options)) + } + + return m +} + +Minimatch.defaults = function (def) { + if (!def || !Object.keys(def).length) return Minimatch + return minimatch.defaults(def).Minimatch +} + + +function minimatch (p, pattern, options) { + if (typeof pattern !== "string") { + throw new TypeError("glob pattern string required") + } + + if (!options) options = {} + + // shortcut: comments match nothing. + if (!options.nocomment && pattern.charAt(0) === "#") { + return false + } + + // "" only matches "" + if (pattern.trim() === "") return p === "" + + return new Minimatch(pattern, options).match(p) +} + +function Minimatch (pattern, options) { + if (!(this instanceof Minimatch)) { + return new Minimatch(pattern, options, cache) + } + + if (typeof pattern !== "string") { + throw new TypeError("glob pattern string required") + } + + if (!options) options = {} + pattern = pattern.trim() + + // windows: need to use /, not \ + // On other platforms, \ is a valid (albeit bad) filename char. + if (platform === "win32") { + pattern = pattern.split("\\").join("/") + } + + // lru storage. + // these things aren't particularly big, but walking down the string + // and turning it into a regexp can get pretty costly. + var cacheKey = pattern + "\n" + sigmund(options) + var cached = minimatch.cache.get(cacheKey) + if (cached) return cached + minimatch.cache.set(cacheKey, this) + + this.options = options + this.set = [] + this.pattern = pattern + this.regexp = null + this.negate = false + this.comment = false + this.empty = false + + // make the set of regexps etc. + this.make() +} + +Minimatch.prototype.debug = function() {} + +Minimatch.prototype.make = make +function make () { + // don't do it more than once. + if (this._made) return + + var pattern = this.pattern + var options = this.options + + // empty patterns and comments match nothing. + if (!options.nocomment && pattern.charAt(0) === "#") { + this.comment = true + return + } + if (!pattern) { + this.empty = true + return + } + + // step 1: figure out negation, etc. + this.parseNegate() + + // step 2: expand braces + var set = this.globSet = this.braceExpand() + + if (options.debug) this.debug = console.error + + this.debug(this.pattern, set) + + // step 3: now we have a set, so turn each one into a series of path-portion + // matching patterns. + // These will be regexps, except in the case of "**", which is + // set to the GLOBSTAR object for globstar behavior, + // and will not contain any / characters + set = this.globParts = set.map(function (s) { + return s.split(slashSplit) + }) + + this.debug(this.pattern, set) + + // glob --> regexps + set = set.map(function (s, si, set) { + return s.map(this.parse, this) + }, this) + + this.debug(this.pattern, set) + + // filter out everything that didn't compile properly. + set = set.filter(function (s) { + return -1 === s.indexOf(false) + }) + + this.debug(this.pattern, set) + + this.set = set +} + +Minimatch.prototype.parseNegate = parseNegate +function parseNegate () { + var pattern = this.pattern + , negate = false + , options = this.options + , negateOffset = 0 + + if (options.nonegate) return + + for ( var i = 0, l = pattern.length + ; i < l && pattern.charAt(i) === "!" + ; i ++) { + negate = !negate + negateOffset ++ + } + + if (negateOffset) this.pattern = pattern.substr(negateOffset) + this.negate = negate +} + +// Brace expansion: +// a{b,c}d -> abd acd +// a{b,}c -> abc ac +// a{0..3}d -> a0d a1d a2d a3d +// a{b,c{d,e}f}g -> abg acdfg acefg +// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg +// +// Invalid sets are not expanded. +// a{2..}b -> a{2..}b +// a{b}c -> a{b}c +minimatch.braceExpand = function (pattern, options) { + return new Minimatch(pattern, options).braceExpand() +} + +Minimatch.prototype.braceExpand = braceExpand +function braceExpand (pattern, options) { + options = options || this.options + pattern = typeof pattern === "undefined" + ? this.pattern : pattern + + if (typeof pattern === "undefined") { + throw new Error("undefined pattern") + } + + if (options.nobrace || + !pattern.match(/\{.*\}/)) { + // shortcut. no need to expand. + return [pattern] + } + + var escaping = false + + // examples and comments refer to this crazy pattern: + // a{b,c{d,e},{f,g}h}x{y,z} + // expected: + // abxy + // abxz + // acdxy + // acdxz + // acexy + // acexz + // afhxy + // afhxz + // aghxy + // aghxz + + // everything before the first \{ is just a prefix. + // So, we pluck that off, and work with the rest, + // and then prepend it to everything we find. + if (pattern.charAt(0) !== "{") { + this.debug(pattern) + var prefix = null + for (var i = 0, l = pattern.length; i < l; i ++) { + var c = pattern.charAt(i) + this.debug(i, c) + if (c === "\\") { + escaping = !escaping + } else if (c === "{" && !escaping) { + prefix = pattern.substr(0, i) + break + } + } + + // actually no sets, all { were escaped. + if (prefix === null) { + this.debug("no sets") + return [pattern] + } + + var tail = braceExpand.call(this, pattern.substr(i), options) + return tail.map(function (t) { + return prefix + t + }) + } + + // now we have something like: + // {b,c{d,e},{f,g}h}x{y,z} + // walk through the set, expanding each part, until + // the set ends. then, we'll expand the suffix. + // If the set only has a single member, then'll put the {} back + + // first, handle numeric sets, since they're easier + var numset = pattern.match(/^\{(-?[0-9]+)\.\.(-?[0-9]+)\}/) + if (numset) { + this.debug("numset", numset[1], numset[2]) + var suf = braceExpand.call(this, pattern.substr(numset[0].length), options) + , start = +numset[1] + , end = +numset[2] + , inc = start > end ? -1 : 1 + , set = [] + for (var i = start; i != (end + inc); i += inc) { + // append all the suffixes + for (var ii = 0, ll = suf.length; ii < ll; ii ++) { + set.push(i + suf[ii]) + } + } + return set + } + + // ok, walk through the set + // We hope, somewhat optimistically, that there + // will be a } at the end. + // If the closing brace isn't found, then the pattern is + // interpreted as braceExpand("\\" + pattern) so that + // the leading \{ will be interpreted literally. + var i = 1 // skip the \{ + , depth = 1 + , set = [] + , member = "" + , sawEnd = false + , escaping = false + + function addMember () { + set.push(member) + member = "" + } + + this.debug("Entering for") + FOR: for (i = 1, l = pattern.length; i < l; i ++) { + var c = pattern.charAt(i) + this.debug("", i, c) + + if (escaping) { + escaping = false + member += "\\" + c + } else { + switch (c) { + case "\\": + escaping = true + continue + + case "{": + depth ++ + member += "{" + continue + + case "}": + depth -- + // if this closes the actual set, then we're done + if (depth === 0) { + addMember() + // pluck off the close-brace + i ++ + break FOR + } else { + member += c + continue + } + + case ",": + if (depth === 1) { + addMember() + } else { + member += c + } + continue + + default: + member += c + continue + } // switch + } // else + } // for + + // now we've either finished the set, and the suffix is + // pattern.substr(i), or we have *not* closed the set, + // and need to escape the leading brace + if (depth !== 0) { + this.debug("didn't close", pattern) + return braceExpand.call(this, "\\" + pattern, options) + } + + // x{y,z} -> ["xy", "xz"] + this.debug("set", set) + this.debug("suffix", pattern.substr(i)) + var suf = braceExpand.call(this, pattern.substr(i), options) + // ["b", "c{d,e}","{f,g}h"] -> + // [["b"], ["cd", "ce"], ["fh", "gh"]] + var addBraces = set.length === 1 + this.debug("set pre-expanded", set) + set = set.map(function (p) { + return braceExpand.call(this, p, options) + }, this) + this.debug("set expanded", set) + + + // [["b"], ["cd", "ce"], ["fh", "gh"]] -> + // ["b", "cd", "ce", "fh", "gh"] + set = set.reduce(function (l, r) { + return l.concat(r) + }) + + if (addBraces) { + set = set.map(function (s) { + return "{" + s + "}" + }) + } + + // now attach the suffixes. + var ret = [] + for (var i = 0, l = set.length; i < l; i ++) { + for (var ii = 0, ll = suf.length; ii < ll; ii ++) { + ret.push(set[i] + suf[ii]) + } + } + return ret +} + +// parse a component of the expanded set. +// At this point, no pattern may contain "/" in it +// so we're going to return a 2d array, where each entry is the full +// pattern, split on '/', and then turned into a regular expression. +// A regexp is made at the end which joins each array with an +// escaped /, and another full one which joins each regexp with |. +// +// Following the lead of Bash 4.1, note that "**" only has special meaning +// when it is the *only* thing in a path portion. Otherwise, any series +// of * is equivalent to a single *. Globstar behavior is enabled by +// default, and can be disabled by setting options.noglobstar. +Minimatch.prototype.parse = parse +var SUBPARSE = {} +function parse (pattern, isSub) { + var options = this.options + + // shortcuts + if (!options.noglobstar && pattern === "**") return GLOBSTAR + if (pattern === "") return "" + + var re = "" + , hasMagic = !!options.nocase + , escaping = false + // ? => one single character + , patternListStack = [] + , plType + , stateChar + , inClass = false + , reClassStart = -1 + , classStart = -1 + // . and .. never match anything that doesn't start with ., + // even when options.dot is set. + , patternStart = pattern.charAt(0) === "." ? "" // anything + // not (start or / followed by . or .. followed by / or end) + : options.dot ? "(?!(?:^|\\\/)\\.{1,2}(?:$|\\\/))" + : "(?!\\.)" + , self = this + + function clearStateChar () { + if (stateChar) { + // we had some state-tracking character + // that wasn't consumed by this pass. + switch (stateChar) { + case "*": + re += star + hasMagic = true + break + case "?": + re += qmark + hasMagic = true + break + default: + re += "\\"+stateChar + break + } + self.debug('clearStateChar %j %j', stateChar, re) + stateChar = false + } + } + + for ( var i = 0, len = pattern.length, c + ; (i < len) && (c = pattern.charAt(i)) + ; i ++ ) { + + this.debug("%s\t%s %s %j", pattern, i, re, c) + + // skip over any that are escaped. + if (escaping && reSpecials[c]) { + re += "\\" + c + escaping = false + continue + } + + SWITCH: switch (c) { + case "/": + // completely not allowed, even escaped. + // Should already be path-split by now. + return false + + case "\\": + clearStateChar() + escaping = true + continue + + // the various stateChar values + // for the "extglob" stuff. + case "?": + case "*": + case "+": + case "@": + case "!": + this.debug("%s\t%s %s %j <-- stateChar", pattern, i, re, c) + + // all of those are literals inside a class, except that + // the glob [!a] means [^a] in regexp + if (inClass) { + this.debug(' in class') + if (c === "!" && i === classStart + 1) c = "^" + re += c + continue + } + + // if we already have a stateChar, then it means + // that there was something like ** or +? in there. + // Handle the stateChar, then proceed with this one. + self.debug('call clearStateChar %j', stateChar) + clearStateChar() + stateChar = c + // if extglob is disabled, then +(asdf|foo) isn't a thing. + // just clear the statechar *now*, rather than even diving into + // the patternList stuff. + if (options.noext) clearStateChar() + continue + + case "(": + if (inClass) { + re += "(" + continue + } + + if (!stateChar) { + re += "\\(" + continue + } + + plType = stateChar + patternListStack.push({ type: plType + , start: i - 1 + , reStart: re.length }) + // negation is (?:(?!js)[^/]*) + re += stateChar === "!" ? "(?:(?!" : "(?:" + this.debug('plType %j %j', stateChar, re) + stateChar = false + continue + + case ")": + if (inClass || !patternListStack.length) { + re += "\\)" + continue + } + + clearStateChar() + hasMagic = true + re += ")" + plType = patternListStack.pop().type + // negation is (?:(?!js)[^/]*) + // The others are (?:) + switch (plType) { + case "!": + re += "[^/]*?)" + break + case "?": + case "+": + case "*": re += plType + case "@": break // the default anyway + } + continue + + case "|": + if (inClass || !patternListStack.length || escaping) { + re += "\\|" + escaping = false + continue + } + + clearStateChar() + re += "|" + continue + + // these are mostly the same in regexp and glob + case "[": + // swallow any state-tracking char before the [ + clearStateChar() + + if (inClass) { + re += "\\" + c + continue + } + + inClass = true + classStart = i + reClassStart = re.length + re += c + continue + + case "]": + // a right bracket shall lose its special + // meaning and represent itself in + // a bracket expression if it occurs + // first in the list. -- POSIX.2 2.8.3.2 + if (i === classStart + 1 || !inClass) { + re += "\\" + c + escaping = false + continue + } + + // finish up the class. + hasMagic = true + inClass = false + re += c + continue + + default: + // swallow any state char that wasn't consumed + clearStateChar() + + if (escaping) { + // no need + escaping = false + } else if (reSpecials[c] + && !(c === "^" && inClass)) { + re += "\\" + } + + re += c + + } // switch + } // for + + + // handle the case where we left a class open. + // "[abc" is valid, equivalent to "\[abc" + if (inClass) { + // split where the last [ was, and escape it + // this is a huge pita. We now have to re-walk + // the contents of the would-be class to re-translate + // any characters that were passed through as-is + var cs = pattern.substr(classStart + 1) + , sp = this.parse(cs, SUBPARSE) + re = re.substr(0, reClassStart) + "\\[" + sp[0] + hasMagic = hasMagic || sp[1] + } + + // handle the case where we had a +( thing at the *end* + // of the pattern. + // each pattern list stack adds 3 chars, and we need to go through + // and escape any | chars that were passed through as-is for the regexp. + // Go through and escape them, taking care not to double-escape any + // | chars that were already escaped. + var pl + while (pl = patternListStack.pop()) { + var tail = re.slice(pl.reStart + 3) + // maybe some even number of \, then maybe 1 \, followed by a | + tail = tail.replace(/((?:\\{2})*)(\\?)\|/g, function (_, $1, $2) { + if (!$2) { + // the | isn't already escaped, so escape it. + $2 = "\\" + } + + // need to escape all those slashes *again*, without escaping the + // one that we need for escaping the | character. As it works out, + // escaping an even number of slashes can be done by simply repeating + // it exactly after itself. That's why this trick works. + // + // I am sorry that you have to see this. + return $1 + $1 + $2 + "|" + }) + + this.debug("tail=%j\n %s", tail, tail) + var t = pl.type === "*" ? star + : pl.type === "?" ? qmark + : "\\" + pl.type + + hasMagic = true + re = re.slice(0, pl.reStart) + + t + "\\(" + + tail + } + + // handle trailing things that only matter at the very end. + clearStateChar() + if (escaping) { + // trailing \\ + re += "\\\\" + } + + // only need to apply the nodot start if the re starts with + // something that could conceivably capture a dot + var addPatternStart = false + switch (re.charAt(0)) { + case ".": + case "[": + case "(": addPatternStart = true + } + + // if the re is not "" at this point, then we need to make sure + // it doesn't match against an empty path part. + // Otherwise a/* will match a/, which it should not. + if (re !== "" && hasMagic) re = "(?=.)" + re + + if (addPatternStart) re = patternStart + re + + // parsing just a piece of a larger pattern. + if (isSub === SUBPARSE) { + return [ re, hasMagic ] + } + + // skip the regexp for non-magical patterns + // unescape anything in it, though, so that it'll be + // an exact match against a file etc. + if (!hasMagic) { + return globUnescape(pattern) + } + + var flags = options.nocase ? "i" : "" + , regExp = new RegExp("^" + re + "$", flags) + + regExp._glob = pattern + regExp._src = re + + return regExp +} + +minimatch.makeRe = function (pattern, options) { + return new Minimatch(pattern, options || {}).makeRe() +} + +Minimatch.prototype.makeRe = makeRe +function makeRe () { + if (this.regexp || this.regexp === false) return this.regexp + + // at this point, this.set is a 2d array of partial + // pattern strings, or "**". + // + // It's better to use .match(). This function shouldn't + // be used, really, but it's pretty convenient sometimes, + // when you just want to work with a regex. + var set = this.set + + if (!set.length) return this.regexp = false + var options = this.options + + var twoStar = options.noglobstar ? star + : options.dot ? twoStarDot + : twoStarNoDot + , flags = options.nocase ? "i" : "" + + var re = set.map(function (pattern) { + return pattern.map(function (p) { + return (p === GLOBSTAR) ? twoStar + : (typeof p === "string") ? regExpEscape(p) + : p._src + }).join("\\\/") + }).join("|") + + // must match entire pattern + // ending in a * or ** will make it less strict. + re = "^(?:" + re + ")$" + + // can match anything, as long as it's not this. + if (this.negate) re = "^(?!" + re + ").*$" + + try { + return this.regexp = new RegExp(re, flags) + } catch (ex) { + return this.regexp = false + } +} + +minimatch.match = function (list, pattern, options) { + options = options || {} + var mm = new Minimatch(pattern, options) + list = list.filter(function (f) { + return mm.match(f) + }) + if (mm.options.nonull && !list.length) { + list.push(pattern) + } + return list +} + +Minimatch.prototype.match = match +function match (f, partial) { + this.debug("match", f, this.pattern) + // short-circuit in the case of busted things. + // comments, etc. + if (this.comment) return false + if (this.empty) return f === "" + + if (f === "/" && partial) return true + + var options = this.options + + // windows: need to use /, not \ + // On other platforms, \ is a valid (albeit bad) filename char. + if (platform === "win32") { + f = f.split("\\").join("/") + } + + // treat the test path as a set of pathparts. + f = f.split(slashSplit) + this.debug(this.pattern, "split", f) + + // just ONE of the pattern sets in this.set needs to match + // in order for it to be valid. If negating, then just one + // match means that we have failed. + // Either way, return on the first hit. + + var set = this.set + this.debug(this.pattern, "set", set) + + // Find the basename of the path by looking for the last non-empty segment + var filename; + for (var i = f.length - 1; i >= 0; i--) { + filename = f[i] + if (filename) break + } + + for (var i = 0, l = set.length; i < l; i ++) { + var pattern = set[i], file = f + if (options.matchBase && pattern.length === 1) { + file = [filename] + } + var hit = this.matchOne(file, pattern, partial) + if (hit) { + if (options.flipNegate) return true + return !this.negate + } + } + + // didn't get any hits. this is success if it's a negative + // pattern, failure otherwise. + if (options.flipNegate) return false + return this.negate +} + +// set partial to true to test if, for example, +// "/a/b" matches the start of "/*/b/*/d" +// Partial means, if you run out of file before you run +// out of pattern, then that's fine, as long as all +// the parts match. +Minimatch.prototype.matchOne = function (file, pattern, partial) { + var options = this.options + + this.debug("matchOne", + { "this": this + , file: file + , pattern: pattern }) + + this.debug("matchOne", file.length, pattern.length) + + for ( var fi = 0 + , pi = 0 + , fl = file.length + , pl = pattern.length + ; (fi < fl) && (pi < pl) + ; fi ++, pi ++ ) { + + this.debug("matchOne loop") + var p = pattern[pi] + , f = file[fi] + + this.debug(pattern, p, f) + + // should be impossible. + // some invalid regexp stuff in the set. + if (p === false) return false + + if (p === GLOBSTAR) { + this.debug('GLOBSTAR', [pattern, p, f]) + + // "**" + // a/**/b/**/c would match the following: + // a/b/x/y/z/c + // a/x/y/z/b/c + // a/b/x/b/x/c + // a/b/c + // To do this, take the rest of the pattern after + // the **, and see if it would match the file remainder. + // If so, return success. + // If not, the ** "swallows" a segment, and try again. + // This is recursively awful. + // + // a/**/b/**/c matching a/b/x/y/z/c + // - a matches a + // - doublestar + // - matchOne(b/x/y/z/c, b/**/c) + // - b matches b + // - doublestar + // - matchOne(x/y/z/c, c) -> no + // - matchOne(y/z/c, c) -> no + // - matchOne(z/c, c) -> no + // - matchOne(c, c) yes, hit + var fr = fi + , pr = pi + 1 + if (pr === pl) { + this.debug('** at the end') + // a ** at the end will just swallow the rest. + // We have found a match. + // however, it will not swallow /.x, unless + // options.dot is set. + // . and .. are *never* matched by **, for explosively + // exponential reasons. + for ( ; fi < fl; fi ++) { + if (file[fi] === "." || file[fi] === ".." || + (!options.dot && file[fi].charAt(0) === ".")) return false + } + return true + } + + // ok, let's see if we can swallow whatever we can. + WHILE: while (fr < fl) { + var swallowee = file[fr] + + this.debug('\nglobstar while', + file, fr, pattern, pr, swallowee) + + // XXX remove this slice. Just pass the start index. + if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) { + this.debug('globstar found match!', fr, fl, swallowee) + // found a match. + return true + } else { + // can't swallow "." or ".." ever. + // can only swallow ".foo" when explicitly asked. + if (swallowee === "." || swallowee === ".." || + (!options.dot && swallowee.charAt(0) === ".")) { + this.debug("dot detected!", file, fr, pattern, pr) + break WHILE + } + + // ** swallows a segment, and continue. + this.debug('globstar swallow a segment, and continue') + fr ++ + } + } + // no match was found. + // However, in partial mode, we can't say this is necessarily over. + // If there's more *pattern* left, then + if (partial) { + // ran out of file + this.debug("\n>>> no match, partial?", file, fr, pattern, pr) + if (fr === fl) return true + } + return false + } + + // something other than ** + // non-magic patterns just have to match exactly + // patterns with magic have been turned into regexps. + var hit + if (typeof p === "string") { + if (options.nocase) { + hit = f.toLowerCase() === p.toLowerCase() + } else { + hit = f === p + } + this.debug("string match", p, f, hit) + } else { + hit = f.match(p) + this.debug("pattern match", p, f, hit) + } + + if (!hit) return false + } + + // Note: ending in / means that we'll get a final "" + // at the end of the pattern. This can only match a + // corresponding "" at the end of the file. + // If the file ends in /, then it can only match a + // a pattern that ends in /, unless the pattern just + // doesn't have any more for it. But, a/b/ should *not* + // match "a/b/*", even though "" matches against the + // [^/]*? pattern, except in partial mode, where it might + // simply not be reached yet. + // However, a/b/ should still satisfy a/* + + // now either we fell off the end of the pattern, or we're done. + if (fi === fl && pi === pl) { + // ran out of pattern and filename at the same time. + // an exact hit! + return true + } else if (fi === fl) { + // ran out of file, but still had pattern left. + // this is ok if we're doing the match as part of + // a glob fs traversal. + return partial + } else if (pi === pl) { + // ran out of pattern, still have file left. + // this is only acceptable if we're on the very last + // empty segment of a file with a trailing slash. + // a/* should match a/b/ + var emptyFileEnd = (fi === fl - 1) && (file[fi] === "") + return emptyFileEnd + } + + // should be unreachable. + throw new Error("wtf?") +} + + +// replace stuff like \* with * +function globUnescape (s) { + return s.replace(/\\(.)/g, "$1") +} + + +function regExpEscape (s) { + return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&") +} + +})( typeof require === "function" ? require : null, + this, + typeof module === "object" ? module : null, + typeof process === "object" ? process.platform : "win32" + ) diff --git a/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/file-utils/node_modules/glob/node_modules/minimatch/node_modules/_._ b/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/file-utils/node_modules/glob/node_modules/minimatch/node_modules/_._ new file mode 100644 index 0000000..e69de29 diff --git a/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/file-utils/node_modules/glob/node_modules/minimatch/package.json b/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/file-utils/node_modules/glob/node_modules/minimatch/package.json new file mode 100644 index 0000000..e17bec3 --- /dev/null +++ b/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/file-utils/node_modules/glob/node_modules/minimatch/package.json @@ -0,0 +1,56 @@ +{ + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me" + }, + "name": "minimatch", + "description": "a glob matcher in javascript", + "version": "0.3.0", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/minimatch.git" + }, + "main": "minimatch.js", + "scripts": { + "test": "tap test/*.js" + }, + "engines": { + "node": "*" + }, + "dependencies": { + "lru-cache": "2", + "sigmund": "~1.0.0" + }, + "devDependencies": { + "tap": "" + }, + "license": { + "type": "MIT", + "url": "http://github.com/isaacs/minimatch/raw/master/LICENSE" + }, + "bugs": { + "url": "https://github.com/isaacs/minimatch/issues" + }, + "homepage": "https://github.com/isaacs/minimatch", + "_id": "minimatch@0.3.0", + "_shasum": "275d8edaac4f1bb3326472089e7949c8394699dd", + "_from": "minimatch@0.3", + "_npmVersion": "1.4.10", + "_npmUser": { + "name": "isaacs", + "email": "i@izs.me" + }, + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + } + ], + "dist": { + "shasum": "275d8edaac4f1bb3326472089e7949c8394699dd", + "tarball": "http://registry.npmjs.org/minimatch/-/minimatch-0.3.0.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/minimatch/-/minimatch-0.3.0.tgz" +} diff --git a/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/file-utils/node_modules/glob/package.json b/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/file-utils/node_modules/glob/package.json new file mode 100644 index 0000000..ff0660f --- /dev/null +++ b/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/file-utils/node_modules/glob/package.json @@ -0,0 +1,57 @@ +{ + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "name": "glob", + "description": "a little globber", + "version": "3.2.11", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/node-glob.git" + }, + "main": "glob.js", + "engines": { + "node": "*" + }, + "dependencies": { + "inherits": "2", + "minimatch": "0.3" + }, + "devDependencies": { + "tap": "~0.4.0", + "mkdirp": "0", + "rimraf": "1" + }, + "scripts": { + "test": "tap test/*.js", + "test-regen": "TEST_REGEN=1 node test/00-setup.js" + }, + "license": "BSD", + "gitHead": "73f57e99510582b2024b762305970ebcf9b70aa2", + "bugs": { + "url": "https://github.com/isaacs/node-glob/issues" + }, + "homepage": "https://github.com/isaacs/node-glob", + "_id": "glob@3.2.11", + "_shasum": "4a973f635b9190f715d10987d5c00fd2815ebe3d", + "_from": "glob@~3.2.6", + "_npmVersion": "1.4.10", + "_npmUser": { + "name": "isaacs", + "email": "i@izs.me" + }, + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + } + ], + "dist": { + "shasum": "4a973f635b9190f715d10987d5c00fd2815ebe3d", + "tarball": "http://registry.npmjs.org/glob/-/glob-3.2.11.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/glob/-/glob-3.2.11.tgz" +} diff --git a/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/file-utils/node_modules/iconv-lite/README.md~ b/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/file-utils/node_modules/iconv-lite/README.md~ new file mode 100644 index 0000000..5f57561 --- /dev/null +++ b/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/file-utils/node_modules/iconv-lite/README.md~ @@ -0,0 +1,54 @@ +iconv-lite - native javascript conversion between character encodings. +====================================================================== + +## Usage + + var iconv = require('iconv-lite'); + + // Convert from an encoded buffer to string. + str = iconv.fromEncoding(buf, 'win-1251'); + // Or + str = iconv.decode(buf, 'win-1251'); + + // Convert from string to an encoded buffer. + buf = iconv.toEncoding("Sample input string", 'win-1251'); + // Or + buf = iconv.encode("Sample input string", 'win-1251'); + +## Supported encodings + +Currently only a small part of encodings supported: + +* All node.js native encodings: 'utf8', 'ucs2', 'ascii', 'binary', 'base64'. +* 'latin1' +* Cyrillic encodings: 'windows-1251', 'koi8-r', 'iso 8859-5'. + +Other encodings are easy to add, see the source. Please, participate. + + +## Encoding/decoding speed + +Comparison with iconv module (1000 times 256kb, on Core i5/2.5 GHz). + + Operation\module iconv iconv-lite (this) + toEncoding('win1251') 19.57 mb/s 49.04 mb/s + fromEncoding('win1251') 16.39 mb/s 24.11 mb/s + + +## Notes + +This module is JavaScript-only, thus can be used in a sandboxed environment like [Cloud9](http://c9.io). + +Untranslatable characters are set to '?'. No transliteration is currently supported, pull requests are welcome. + +## Testing + + npm install --dev iconv-lite + vows + +## TODO + +* Support streaming character conversion, something like util.pipe(req, iconv.fromEncodingStream('latin1')). +* Add more encodings. +* Add transliteration (best fit char). +* Add tests and correct support of variable-byte encodings (currently work is delegated to node). diff --git a/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/file-utils/node_modules/iconv-lite/encodings/big5.js b/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/file-utils/node_modules/iconv-lite/encodings/big5.js new file mode 100644 index 0000000..0423d63 --- /dev/null +++ b/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/file-utils/node_modules/iconv-lite/encodings/big5.js @@ -0,0 +1,9 @@ +var big5Table = require('./table/big5.js'); +module.exports = { + 'windows950': 'big5', + 'cp950': 'big5', + 'big5': { + type: 'table', + table: big5Table + } +} diff --git a/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/file-utils/node_modules/iconv-lite/encodings/gbk.js b/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/file-utils/node_modules/iconv-lite/encodings/gbk.js new file mode 100644 index 0000000..78a63ec --- /dev/null +++ b/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/file-utils/node_modules/iconv-lite/encodings/gbk.js @@ -0,0 +1,9 @@ +var gbkTable = require('./table/gbk.js'); +module.exports = { + 'windows936': 'gbk', + 'gb2312': 'gbk', + 'gbk': { + type: 'table', + table: gbkTable + } +} diff --git a/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/file-utils/node_modules/iconv-lite/encodings/singlebyte.js b/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/file-utils/node_modules/iconv-lite/encodings/singlebyte.js new file mode 100644 index 0000000..f41a7ea --- /dev/null +++ b/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/file-utils/node_modules/iconv-lite/encodings/singlebyte.js @@ -0,0 +1,340 @@ +module.exports = { + "437": "cp437", + "737": "cp737", + "775": "cp775", + "850": "cp850", + "852": "cp852", + "855": "cp855", + "857": "cp857", + "858": "cp858", + "860": "cp860", + "861": "cp861", + "862": "cp862", + "863": "cp863", + "864": "cp864", + "865": "cp865", + "866": "cp866", + "869": "cp869", + "874": "iso885911", + "1250": "windows1250", + "1251": "windows1251", + "1252": "windows1252", + "1253": "windows1253", + "1254": "windows1254", + "1255": "windows1255", + "1256": "windows1256", + "1257": "windows1257", + "1258": "windows1258", + "10000": "macroman", + "10006": "macgreek", + "10007": "maccyrillic", + "10029": "maccenteuro", + "10079": "maciceland", + "10081": "macturkish", + "20866": "koi8r", + "21866": "koi8u", + "28591": "iso88591", + "28592": "iso88592", + "28593": "iso88593", + "28594": "iso88594", + "28595": "iso88595", + "28596": "iso88596", + "28597": "iso88597", + "28598": "iso88598", + "28599": "iso88599", + "28600": "iso885910", + "28601": "iso885911", + "28603": "iso885913", + "28604": "iso885914", + "28605": "iso885915", + "28606": "iso885916", + "ascii8bit": "ascii", + "usascii": "ascii", + "latin1": "iso88591", + "latin2": "iso88592", + "latin3": "iso88593", + "latin4": "iso88594", + "latin6": "iso885910", + "latin7": "iso885913", + "latin8": "iso885914", + "latin9": "iso885915", + "latin10": "iso885916", + "cp819": "iso88951", + "arabic": "iso88596", + "arabic8": "iso88596", + "greek": "iso88597", + "greek8": "iso88597", + "hebrew": "iso88598", + "hebrew8": "iso88598", + "turkish": "iso88599", + "turkish8": "iso88599", + "thai": "iso885911", + "thai8": "iso885911", + "tis620": "iso885911", + "windows874": "iso885911", + "win874": "iso885911", + "cp874": "iso885911", + "celtic": "iso885914", + "celtic8": "iso885914", + "cp20866": "koi8r", + "ibm878": "koi8r", + "cp21866": "koi8u", + "ibm1168": "koi8u", + "windows1250": { + "type": "singlebyte", + "chars": "€�‚�„…†‡�‰Š‹ŚŤŽŹ�‘’“”•–—�™š›śťžź ˇ˘Ł¤Ą¦§¨©Ş«¬­®Ż°±˛ł´µ¶·¸ąş»Ľ˝ľżŔÁÂĂÄĹĆÇČÉĘËĚÍÎĎĐŃŇÓÔŐÖ×ŘŮÚŰÜÝŢßŕáâăäĺćçčéęëěíîďđńňóôőö÷řůúűüýţ˙" + }, + "win1250": "windows1250", + "cp1250": "windows1250", + "windows1251": { + "type": "singlebyte", + "chars": "ЂЃ‚ѓ„…†‡€‰Љ‹ЊЌЋЏђ‘’“”•–—�™љ›њќћџ ЎўЈ¤Ґ¦§Ё©Є«¬­®Ї°±Ііґµ¶·ё№є»јЅѕїАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя" + }, + "win1251": "windows1251", + "cp1251": "windows1251", + "windows1252": { + "type": "singlebyte", + "chars": "€�‚ƒ„…†‡ˆ‰Š‹Œ�Ž��‘’“”•–—˜™š›œ�žŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ" + }, + "win1252": "windows1252", + "cp1252": "windows1252", + "windows1253": { + "type": "singlebyte", + "chars": "€�‚ƒ„…†‡�‰�‹�����‘’“”•–—�™�›���� ΅Ά£¤¥¦§¨©�«¬­®―°±²³΄µ¶·ΈΉΊ»Ό½ΎΏΐΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡ�ΣΤΥΦΧΨΩΪΫάέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώ�" + }, + "win1253": "windows1253", + "cp1253": "windows1253", + "windows1254": { + "type": "singlebyte", + "chars": "€�‚ƒ„…†‡ˆ‰Š‹Œ����‘’“”•–—˜™š›œ��Ÿ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏĞÑÒÓÔÕÖרÙÚÛÜİŞßàáâãäåæçèéêëìíîïğñòóôõö÷øùúûüışÿ" + }, + "win1254": "windows1254", + "cp1254": "windows1254", + "windows1255": { + "type": "singlebyte", + "chars": "€�‚ƒ„…†‡ˆ‰�‹�����‘’“”•–—˜™�›���� ¡¢£₪¥¦§¨©×«¬­®¯°±²³´µ¶·¸¹÷»¼½¾¿ְֱֲֳִֵֶַָֹ�ֻּֽ־ֿ׀ׁׂ׃װױײ׳״�������אבגדהוזחטיךכלםמןנסעףפץצקרשת��‎‏�" + }, + "win1255": "windows1255", + "cp1255": "windows1255", + "windows1256": { + "type": "singlebyte", + "chars": "€پ‚ƒ„…†‡ˆ‰ٹ‹Œچژڈگ‘’“”•–—ک™ڑ›œ‌‍ں ،¢£¤¥¦§¨©ھ«¬­®¯°±²³´µ¶·¸¹؛»¼½¾؟ہءآأؤإئابةتثجحخدذرزسشصض×طظعغـفقكàلâمنهوçèéêëىيîïًٌٍَôُِ÷ّùْûü‎‏ے" + }, + "win1256": "windows1256", + "cp1256": "windows1256", + "windows1257": { + "type": "singlebyte", + "chars": "€�‚�„…†‡�‰�‹�¨ˇ¸�‘’“”•–—�™�›�¯˛� �¢£¤�¦§Ø©Ŗ«¬­®Æ°±²³´µ¶·ø¹ŗ»¼½¾æĄĮĀĆÄÅĘĒČÉŹĖĢĶĪĻŠŃŅÓŌÕÖ×ŲŁŚŪÜŻŽßąįāćäåęēčéźėģķīļšńņóōõö÷ųłśūüżž˙" + }, + "win1257": "windows1257", + "cp1257": "windows1257", + "windows1258": { + "type": "singlebyte", + "chars": "€�‚ƒ„…†‡ˆ‰�‹Œ����‘’“”•–—˜™�›œ��Ÿ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖרÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ" + }, + "win1258": "windows1258", + "cp1258": "windows1258", + "iso88591": { + "type": "singlebyte", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ" + }, + "cp28591": "iso88591", + "iso88592": { + "type": "singlebyte", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ą˘Ł¤ĽŚ§¨ŠŞŤŹ­ŽŻ°ą˛ł´ľśˇ¸šşťź˝žżŔÁÂĂÄĹĆÇČÉĘËĚÍÎĎĐŃŇÓÔŐÖ×ŘŮÚŰÜÝŢßŕáâăäĺćçčéęëěíîďđńňóôőö÷řůúűüýţ˙" + }, + "cp28592": "iso88592", + "iso88593": { + "type": "singlebyte", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ħ˘£¤�Ĥ§¨İŞĞĴ­�ݰħ²³´µĥ·¸ışğĵ½�żÀÁÂ�ÄĊĈÇÈÉÊËÌÍÎÏ�ÑÒÓÔĠÖ×ĜÙÚÛÜŬŜßàáâ�äċĉçèéêëìíîï�ñòóôġö÷ĝùúûüŭŝ˙" + }, + "cp28593": "iso88593", + "iso88594": { + "type": "singlebyte", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄĸŖ¤Ĩϧ¨ŠĒĢŦ­Ž¯°ą˛ŗ´ĩšēģŧŊžŋĀÁÂÃÄÅÆĮČÉĘËĖÍÎĪĐŅŌĶÔÕÖרŲÚÛÜŨŪßāáâãäåæįčéęëėíîīđņōķôõö÷øųúûüũū˙" + }, + "cp28594": "iso88594", + "iso88595": { + "type": "singlebyte", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ЁЂЃЄЅІЇЈЉЊЋЌ­ЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя№ёђѓєѕіїјљњћќ§ўџ" + }, + "cp28595": "iso88595", + "iso88596": { + "type": "singlebyte", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ���¤�������،­�������������؛���؟�ءآأؤإئابةتثجحخدذرزسشصضطظعغ�����ـفقكلمنهوىيًٌٍَُِّْ�������������" + }, + "cp28596": "iso88596", + "iso88597": { + "type": "singlebyte", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ‘’£€₯¦§¨©ͺ«¬­�―°±²³΄΅Ά·ΈΉΊ»Ό½ΎΏΐΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡ�ΣΤΥΦΧΨΩΪΫάέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώ�" + }, + "cp28597": "iso88597", + "iso88598": { + "type": "singlebyte", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ �¢£¤¥¦§¨©×«¬­®¯°±²³´µ¶·¸¹÷»¼½¾��������������������������������‗אבגדהוזחטיךכלםמןנסעףפץצקרשת��‎‏�" + }, + "cp28598": "iso88598", + "iso88599": { + "type": "singlebyte", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏĞÑÒÓÔÕÖרÙÚÛÜİŞßàáâãäåæçèéêëìíîïğñòóôõö÷øùúûüışÿ" + }, + "cp28599": "iso88599", + "iso885910": { + "type": "singlebyte", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄĒĢĪĨͧĻĐŠŦŽ­ŪŊ°ąēģīĩķ·ļđšŧž―ūŋĀÁÂÃÄÅÆĮČÉĘËĖÍÎÏÐŅŌÓÔÕÖŨØŲÚÛÜÝÞßāáâãäåæįčéęëėíîïðņōóôõöũøųúûüýþĸ" + }, + "cp28600": "iso885910", + "iso885911": { + "type": "singlebyte", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����" + }, + "cp28601": "iso885911", + "iso885913": { + "type": "singlebyte", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ”¢£¤„¦§Ø©Ŗ«¬­®Æ°±²³“µ¶·ø¹ŗ»¼½¾æĄĮĀĆÄÅĘĒČÉŹĖĢĶĪĻŠŃŅÓŌÕÖ×ŲŁŚŪÜŻŽßąįāćäåęēčéźėģķīļšńņóōõö÷ųłśūüżž’" + }, + "cp28603": "iso885913", + "iso885914": { + "type": "singlebyte", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ḃḃ£ĊċḊ§Ẁ©ẂḋỲ­®ŸḞḟĠġṀṁ¶ṖẁṗẃṠỳẄẅṡÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏŴÑÒÓÔÕÖṪØÙÚÛÜÝŶßàáâãäåæçèéêëìíîïŵñòóôõöṫøùúûüýŷÿ" + }, + "cp28604": "iso885914", + "iso885915": { + "type": "singlebyte", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£€¥Š§š©ª«¬­®¯°±²³Žµ¶·ž¹º»ŒœŸ¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ" + }, + "cp28605": "iso885915", + "iso885916": { + "type": "singlebyte", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄąŁ€„Чš©Ș«Ź­źŻ°±ČłŽ”¶·žčș»ŒœŸżÀÁÂĂÄĆÆÇÈÉÊËÌÍÎÏĐŃÒÓÔŐÖŚŰÙÚÛÜĘȚßàáâăäćæçèéêëìíîïđńòóôőöśűùúûüęțÿ" + }, + "cp28606": "iso885916", + "cp437": { + "type": "singlebyte", + "chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " + }, + "ibm437": "cp437", + "cp737": { + "type": "singlebyte", + "chars": "ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩαβγδεζηθικλμνξοπρσςτυφχψ░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀ωάέήϊίόύϋώΆΈΉΊΌΎΏ±≥≤ΪΫ÷≈°∙·√ⁿ²■ " + }, + "ibm737": "cp737", + "cp775": { + "type": "singlebyte", + "chars": "ĆüéāäģåćłēŖŗīŹÄÅÉæÆōöĢ¢ŚśÖÜø£Ø×¤ĀĪóŻżź”¦©®¬½¼Ł«»░▒▓│┤ĄČĘĖ╣║╗╝ĮŠ┐└┴┬├─┼ŲŪ╚╔╩╦╠═╬Žąčęėįšųūž┘┌█▄▌▐▀ÓßŌŃõÕµńĶķĻļņĒŅ’­±“¾¶§÷„°∙·¹³²■ " + }, + "ibm775": "cp775", + "cp850": { + "type": "singlebyte", + "chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø×ƒáíóúñѪº¿®¬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ðÐÊËÈıÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµþÞÚÛÙýݯ´­±‗¾¶§÷¸°¨·¹³²■ " + }, + "ibm850": "cp850", + "cp852": { + "type": "singlebyte", + "chars": "ÇüéâäůćçłëŐőîŹÄĆÉĹĺôöĽľŚśÖÜŤťŁ×čáíóúĄąŽžĘ꬟Ⱥ«»░▒▓│┤ÁÂĚŞ╣║╗╝Żż┐└┴┬├─┼Ăă╚╔╩╦╠═╬¤đĐĎËďŇÍÎě┘┌█▄ŢŮ▀ÓßÔŃńňŠšŔÚŕŰýÝţ´­˝˛ˇ˘§÷¸°¨˙űŘř■ " + }, + "ibm852": "cp852", + "cp855": { + "type": "singlebyte", + "chars": "ђЂѓЃёЁєЄѕЅіІїЇјЈљЉњЊћЋќЌўЎџЏюЮъЪаАбБцЦдДеЕфФгГ«»░▒▓│┤хХиИ╣║╗╝йЙ┐└┴┬├─┼кК╚╔╩╦╠═╬¤лЛмМнНоОп┘┌█▄Пя▀ЯрРсСтТуУжЖвВьЬ№­ыЫзЗшШэЭщЩчЧ§■ " + }, + "ibm855": "cp855", + "cp857": { + "type": "singlebyte", + "chars": "ÇüéâäàåçêëèïîıÄÅÉæÆôöòûùİÖÜø£ØŞşáíóúñÑĞ𿮬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ºªÊËÈ�ÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµ�×ÚÛÙìÿ¯´­±�¾¶§÷¸°¨·¹³²■ " + }, + "ibm857": "cp857", + "cp858": { + "type": "singlebyte", + "chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø×ƒáíóúñѪº¿®¬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ðÐÊËÈ€ÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµþÞÚÛÙýݯ´­±‗¾¶§÷¸°¨·¹³²■ " + }, + "ibm858": "cp858", + "cp860": { + "type": "singlebyte", + "chars": "ÇüéâãàÁçêÊèÍÔìÃÂÉÀÈôõòÚùÌÕÜ¢£Ù₧ÓáíóúñѪº¿Ò¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " + }, + "ibm860": "cp860", + "cp861": { + "type": "singlebyte", + "chars": "ÇüéâäàåçêëèÐðÞÄÅÉæÆôöþûÝýÖÜø£Ø₧ƒáíóúÁÍÓÚ¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " + }, + "ibm861": "cp861", + "cp862": { + "type": "singlebyte", + "chars": "אבגדהוזחטיךכלםמןנסעףפץצקרשת¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " + }, + "ibm862": "cp862", + "cp863": { + "type": "singlebyte", + "chars": "ÇüéâÂà¶çêëèïî‗À§ÉÈÊôËÏûù¤ÔÜ¢£ÙÛƒ¦´óú¨¸³¯Î⌐¬½¼¾«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " + }, + "ibm863": "cp863", + "cp864": { + "type": "singlebyte", + "chars": "°·∙√▒─│┼┤┬├┴┐┌└┘β∞φ±½¼≈«»ﻷﻸ��ﻻﻼ� ­ﺂ£¤ﺄ��ﺎﺏﺕﺙ،ﺝﺡﺥ٠١٢٣٤٥٦٧٨٩ﻑ؛ﺱﺵﺹ؟¢ﺀﺁﺃﺅﻊﺋﺍﺑﺓﺗﺛﺟﺣﺧﺩﺫﺭﺯﺳﺷﺻﺿﻁﻅﻋﻏ¦¬÷×ﻉـﻓﻗﻛﻟﻣﻧﻫﻭﻯﻳﺽﻌﻎﻍﻡﹽّﻥﻩﻬﻰﻲﻐﻕﻵﻶﻝﻙﻱ■�" + }, + "ibm864": "cp864", + "cp865": { + "type": "singlebyte", + "chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø₧ƒáíóúñѪº¿⌐¬½¼¡«¤░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " + }, + "ibm865": "cp865", + "cp866": { + "type": "singlebyte", + "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёЄєЇїЎў°∙·√№¤■ " + }, + "ibm866": "cp866", + "cp869": { + "type": "singlebyte", + "chars": "������Ά�·¬¦‘’Έ―ΉΊΪΌ��ΎΫ©Ώ²³ά£έήίϊΐόύΑΒΓΔΕΖΗ½ΘΙ«»░▒▓│┤ΚΛΜΝ╣║╗╝ΞΟ┐└┴┬├─┼ΠΡ╚╔╩╦╠═╬ΣΤΥΦΧΨΩαβγ┘┌█▄δε▀ζηθικλμνξοπρσςτ΄­±υφχ§ψ΅°¨ωϋΰώ■ " + }, + "ibm869": "cp869", + "maccenteuro": { + "type": "singlebyte", + "chars": "ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ" + }, + "maccroatian": { + "type": "singlebyte", + "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈ƫȅ ÀÃÕŒœĐ—“”‘’÷◊�©⁄¤‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ" + }, + "maccyrillic": { + "type": "singlebyte", + "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°¢£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµ∂ЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю¤" + }, + "macgreek": { + "type": "singlebyte", + "chars": "Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦­ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ�" + }, + "maciceland": { + "type": "singlebyte", + "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüݰ¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ" + }, + "macroman": { + "type": "singlebyte", + "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ" + }, + "macromania": { + "type": "singlebyte", + "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂŞ∞±≤≥¥µ∂∑∏π∫ªºΩăş¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›Ţţ‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ" + }, + "macthai": { + "type": "singlebyte", + "chars": "«»…“”�•‘’� กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู​–—฿เแโใไๅๆ็่้๊๋์ํ™๏๐๑๒๓๔๕๖๗๘๙®©����" + }, + "macturkish": { + "type": "singlebyte", + "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙ�ˆ˜¯˘˙˚¸˝˛ˇ" + }, + "macukraine": { + "type": "singlebyte", + "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю¤" + }, + "koi8r": { + "type": "singlebyte", + "chars": "─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ё╓╔╕╖╗╘╙╚╛╜╝╞╟╠╡Ё╢╣╤╥╦╧╨╩╪╫╬©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ" + }, + "koi8u": { + "type": "singlebyte", + "chars": "─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ёє╔ії╗╘╙╚╛ґ╝╞╟╠╡ЁЄ╣ІЇ╦╧╨╩╪Ґ╬©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ" + } +}; diff --git a/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/file-utils/node_modules/iconv-lite/encodings/table/big5.js b/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/file-utils/node_modules/iconv-lite/encodings/table/big5.js new file mode 100644 index 0000000..605c72d --- /dev/null +++ b/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/file-utils/node_modules/iconv-lite/encodings/table/big5.js @@ -0,0 +1 @@ +module.exports={"33088":19991,"33089":20002,"33090":20012,"33091":20053,"33092":20066,"33093":20106,"33094":20144,"33095":20203,"33096":20205,"33097":20220,"33098":20252,"33099":20362,"33100":20479,"33101":20546,"33102":20560,"33103":20600,"33104":20696,"33105":20702,"33106":20724,"33107":20758,"33108":20810,"33109":20817,"33110":20836,"33111":20842,"33112":20869,"33113":20880,"33114":20893,"33115":20902,"33116":20904,"33117":20905,"33118":20935,"33119":20950,"33120":20955,"33121":20972,"33122":20988,"33123":21003,"33124":21012,"33125":21013,"33126":21024,"33127":21035,"33128":21049,"33129":21071,"33130":21105,"33131":21136,"33132":21138,"33133":21140,"33134":21148,"33135":21167,"33136":21173,"33137":21200,"33138":21248,"33139":21255,"33140":21284,"33141":21318,"33142":21343,"33143":21395,"33144":21424,"33145":21469,"33146":21539,"33147":21584,"33148":21585,"33149":21642,"33150":21661,"33185":21667,"33186":21684,"33187":21712,"33188":21795,"33189":21823,"33190":21836,"33191":21843,"33192":21853,"33193":21868,"33194":21918,"33195":21929,"33196":21996,"33197":22005,"33198":22051,"33199":22096,"33200":22140,"33201":22154,"33202":22164,"33203":22176,"33204":22191,"33205":22232,"33206":22272,"33207":22361,"33208":22373,"33209":22399,"33210":22405,"33211":22409,"33212":22433,"33213":22444,"33214":22452,"33215":22464,"33216":22472,"33217":22483,"33218":22511,"33219":22596,"33220":22636,"33221":22674,"33222":22682,"33223":22706,"33224":22712,"33225":22757,"33226":22779,"33227":22786,"33228":22795,"33229":22800,"33230":22808,"33231":22811,"33232":29836,"33233":29837,"33234":29849,"33235":29851,"33236":29860,"33237":29876,"33238":29881,"33239":29896,"33240":29900,"33241":29904,"33242":29907,"33243":30018,"33244":30037,"33245":30062,"33246":30093,"33247":30110,"33248":30172,"33249":30252,"33250":30287,"33251":30289,"33252":30323,"33253":30324,"33254":30373,"33255":30425,"33256":30478,"33257":30479,"33258":30552,"33259":30578,"33260":30583,"33261":30584,"33262":30586,"33263":30587,"33264":30616,"33265":30639,"33266":30654,"33267":30659,"33268":30661,"33269":30667,"33270":30685,"33271":30694,"33272":30708,"33273":30750,"33274":30781,"33275":30786,"33276":30788,"33277":30795,"33278":30801,"33344":21782,"33345":22775,"33346":38964,"33347":33883,"33348":28948,"33349":33398,"33350":35158,"33351":40236,"33352":40206,"33353":36527,"33354":24674,"33355":26214,"33356":34510,"33357":25785,"33358":37772,"33359":22107,"33360":28485,"33361":35532,"33362":29001,"33363":24012,"33364":34633,"33365":39464,"33366":31658,"33367":36107,"33368":39255,"33369":23597,"33370":32331,"33371":38938,"33372":20518,"33373":25458,"33374":40568,"33375":30783,"33376":40633,"33377":40634,"33378":36046,"33379":35715,"33380":61305,"33381":33931,"33382":37284,"33383":31331,"33384":25776,"33385":24061,"33386":24214,"33387":32865,"33388":26965,"33389":31466,"33390":28710,"33391":26812,"33392":31095,"33393":28060,"33394":36841,"33395":31074,"33396":22178,"33397":34687,"33398":21093,"33399":31108,"33400":28300,"33401":37271,"33402":31622,"33403":38956,"33404":26717,"33405":20397,"33406":34222,"33441":31725,"33442":34635,"33443":20534,"33444":26893,"33445":27542,"33446":24910,"33447":20855,"33448":30495,"33449":20516,"33450":32622,"33451":30452,"33452":27097,"33453":24803,"33454":25334,"33455":21599,"33456":38788,"33457":22092,"33458":20677,"33459":22040,"33460":34398,"33461":22834,"33462":22875,"33463":22877,"33464":22883,"33465":22892,"33466":22939,"33467":22999,"33468":23019,"33469":23066,"33470":23210,"33471":23248,"33472":23281,"33473":23350,"33474":23497,"33475":23539,"33476":23571,"33477":23580,"33478":23582,"33479":23635,"33480":23705,"33481":23708,"33482":23738,"33483":23739,"33484":23745,"33485":23797,"33486":23802,"33487":23829,"33488":23832,"33489":23870,"33490":23891,"33491":23900,"33492":23917,"33493":23923,"33494":23924,"33495":23948,"33496":23952,"33497":23993,"33498":24016,"33499":24019,"33500":24135,"33501":24164,"33502":24271,"33503":24272,"33504":24298,"33505":24304,"33506":24329,"33507":24332,"33508":24337,"33509":24353,"33510":24372,"33511":24385,"33512":24389,"33513":24401,"33514":24412,"33515":24422,"33516":24451,"33517":24560,"33518":24650,"33519":24672,"33520":24715,"33521":24742,"33522":24798,"33523":24849,"33524":24864,"33525":24865,"33526":24892,"33527":24893,"33528":24984,"33529":25015,"33530":25076,"33531":25107,"33532":25117,"33533":25118,"33534":25143,"33600":24186,"33601":27664,"33602":21454,"33603":20267,"33604":20302,"33605":21556,"33606":22257,"33607":22766,"33608":22841,"33609":22918,"33610":23596,"33611":20915,"33612":20914,"33613":28798,"33614":35265,"33615":35282,"33616":36125,"33617":36710,"33618":20122,"33619":26469,"33620":20177,"33621":20004,"33622":21327,"33623":23626,"33624":20872,"33625":24213,"33626":25269,"33627":19996,"33628":20105,"33629":29366,"33630":31868,"33631":32416,"33632":21351,"33633":36711,"33634":37048,"33635":38271,"33636":38376,"33637":20384,"33638":20387,"33639":20822,"33640":21017,"33641":21170,"33642":21364,"33643":22850,"33644":24069,"33645":26594,"33646":27769,"33647":20026,"33648":32419,"33649":32418,"33650":32426,"33651":32427,"33652":32421,"33653":32422,"33654":32417,"33655":32989,"33656":33486,"33657":35745,"33658":35746,"33659":35747,"33660":36126,"33661":36127,"33662":20891,"33697":36712,"33698":38377,"33699":38886,"33700":39029,"33701":39118,"33702":39134,"33703":20457,"33704":20204,"33705":20261,"33706":20010,"33707":20262,"33708":20179,"33709":20923,"33710":21018,"33711":21093,"33712":21592,"33713":23089,"33714":23385,"33715":23777,"33716":23707,"33717":23704,"33718":24072,"33719":24211,"33720":24452,"33721":25375,"33722":26102,"33723":26187,"33724":20070,"33725":27902,"33726":27971,"33727":20044,"33728":29421,"33729":29384,"33730":20137,"33731":30757,"33732":31210,"33733":32442,"33734":32433,"33735":32441,"33736":32431,"33737":32445,"33738":32432,"33739":32423,"33740":32429,"33741":32435,"33742":32440,"33743":32439,"33744":32961,"33745":33033,"33746":21005,"33747":35760,"33748":35750,"33749":35752,"33750":35751,"33751":35754,"33752":35759,"33753":35757,"33754":35755,"33755":23682,"33756":36130,"33757":36129,"33758":36713,"33759":36715,"33760":38025,"33761":38024,"33762":38026,"33763":38027,"33764":38378,"33765":38453,"33766":38485,"33767":38473,"33768":39269,"33769":39532,"33770":39592,"33771":20266,"33772":20255,"33773":20390,"33774":20391,"33775":21153,"33776":21160,"33777":21306,"33778":21442,"33779":21713,"33780":38382,"33781":34900,"33782":22269,"33783":22362,"33784":22441,"33785":25191,"33786":22815,"33787":23044,"33788":22919,"33789":19987,"33790":23558,"33856":23625,"33857":23781,"33858":23703,"33859":24102,"33860":24080,"33861":24352,"33862":24378,"33863":20174,"33864":24469,"33865":20932,"33866":24581,"33867":25195,"33868":25346,"33869":25194,"33870":25249,"33871":25379,"33872":36133,"33873":21551,"33874":26011,"33875":26025,"33876":26172,"33877":21206,"33878":24323,"33879":26465,"33880":26541,"33881":26432,"33882":27682,"33883":20937,"33884":27973,"33885":28170,"33886":27882,"33887":27814,"33888":20928,"33889":29301,"33890":29424,"33891":29616,"33892":20135,"33893":27605,"33894":24322,"33895":20247,"33896":32458,"33897":32479,"33898":32461,"33899":32459,"33900":32460,"33901":32454,"33902":32453,"33903":32452,"33904":32456,"33905":32449,"33906":32450,"33907":38069,"33908":20064,"33909":33626,"33910":33550,"33911":33682,"33912":24196,"33913":33483,"33914":22788,"33915":26415,"33916":34926,"33917":35269,"33918":35268,"33953":35775,"33954":35766,"33955":35776,"33956":35767,"33957":35768,"33958":35774,"33959":35772,"33960":35769,"33961":36137,"33962":36131,"33963":36143,"33964":36135,"33965":36138,"33966":36139,"33967":36717,"33968":36719,"33969":36825,"33970":36830,"33971":36851,"33972":38039,"33973":38035,"33974":38031,"33975":38034,"33976":38381,"33977":38472,"33978":38470,"33979":38452,"33980":39030,"33981":39031,"33982":40060,"33983":40479,"33984":21348,"33985":40614,"33986":22791,"33987":20263,"33988":20254,"33989":20975,"33990":21056,"33991":21019,"33992":21171,"33993":21195,"33994":20007,"33995":21333,"33996":21727,"33997":21796,"33998":20052,"33999":22260,"34000":23591,"34001":22330,"34002":25253,"34003":22490,"34004":22774,"34005":23090,"34006":23547,"34007":23706,"34008":24103,"34009":24079,"34010":21397,"34011":21417,"34012":24694,"34013":38391,"34014":24812,"34015":24699,"34016":24700,"34017":25315,"34018":25381,"34019":25442,"34020":25196,"34021":26531,"34022":26635,"34023":26632,"34024":38054,"34025":27531,"34026":22771,"34027":27695,"34028":27689,"34029":28044,"34030":20945,"34031":28270,"34032":28065,"34033":27748,"34034":27979,"34035":27985,"34036":28067,"34037":26080,"34038":29369,"34039":33487,"34040":30011,"34041":30153,"34042":21457,"34043":30423,"34044":30746,"34045":31174,"34046":31383,"34112":31508,"34113":31499,"34114":32478,"34115":32467,"34116":32466,"34117":32477,"34118":19997,"34119":32476,"34120":32473,"34121":32474,"34122":32470,"34123":32475,"34124":32899,"34125":32958,"34126":32960,"34127":21326,"34128":33713,"34129":33484,"34130":34394,"34131":35270,"34132":35780,"34133":35789,"34134":35777,"34135":35778,"34136":35791,"34137":35781,"34138":35784,"34139":35787,"34140":35785,"34141":35786,"34142":35779,"34143":36142,"34144":36148,"34145":36144,"34146":36155,"34147":36146,"34148":36153,"34149":36154,"34150":36149,"34151":20080,"34152":36140,"34153":36152,"34154":36151,"34155":36722,"34156":36724,"34157":36726,"34158":36827,"34159":37038,"34160":20065,"34161":38046,"34162":38062,"34163":38041,"34164":38048,"34165":38055,"34166":38045,"34167":38052,"34168":38051,"34169":38389,"34170":38384,"34171":24320,"34172":38386,"34173":38388,"34174":38387,"34209":38431,"34210":38454,"34211":38451,"34212":38887,"34213":39033,"34214":39034,"34215":39035,"34216":39274,"34217":39277,"34218":39272,"34219":39278,"34220":39276,"34221":20911,"34222":39533,"34223":20081,"34224":20538,"34225":20256,"34226":20165,"34227":20542,"34228":20260,"34229":20588,"34230":38130,"34231":21183,"34232":31215,"34233":27719,"34234":21527,"34235":21596,"34236":21595,"34237":22253,"34238":22278,"34239":28034,"34240":22359,"34241":22366,"34242":22488,"34243":33556,"34244":22885,"34245":22920,"34246":29233,"34247":24574,"34248":24582,"34249":24698,"34250":25439,"34251":25250,"34252":25443,"34253":26500,"34254":26198,"34255":26197,"34256":26104,"34257":20250,"34258":19994,"34259":26497,"34260":26472,"34261":26722,"34262":26539,"34263":23681,"34264":27807,"34265":28781,"34266":28287,"34267":28369,"34268":27815,"34269":28902,"34270":28860,"34271":28800,"34272":28949,"34273":29239,"34274":29422,"34275":29502,"34276":29682,"34277":24403,"34278":30415,"34279":30544,"34280":30529,"34281":38606,"34282":30860,"34283":33410,"34284":31509,"34285":31908,"34286":32463,"34287":32482,"34288":32465,"34289":32485,"34290":32486,"34291":20041,"34292":32673,"34293":22307,"34294":32928,"34295":33050,"34296":32959,"34297":33041,"34298":33636,"34299":33479,"34300":21494,"34301":33716,"34302":34398,"34368":34383,"34369":21495,"34370":34568,"34371":34476,"34372":34917,"34373":35013,"34374":35815,"34375":35813,"34376":35814,"34377":35797,"34378":35799,"34379":35800,"34380":35801,"34381":35811,"34382":35802,"34383":35805,"34384":35803,"34385":35809,"34386":35810,"34387":35808,"34388":35807,"34389":36156,"34390":36164,"34391":36158,"34392":36159,"34393":36160,"34394":36161,"34395":36162,"34396":36165,"34397":36739,"34398":36733,"34399":36732,"34400":36734,"34401":20892,"34402":36816,"34403":36798,"34404":36829,"34405":36807,"34406":37049,"34407":38068,"34408":38067,"34409":38073,"34410":38072,"34411":38078,"34412":38080,"34413":38085,"34414":38057,"34415":38082,"34416":38083,"34417":38089,"34418":38091,"34419":38044,"34420":38093,"34421":38079,"34422":38086,"34423":38392,"34424":38504,"34425":38589,"34426":30005,"34427":39044,"34428":39037,"34429":39039,"34430":39036,"34465":39041,"34466":39042,"34467":39282,"34468":39284,"34469":39281,"34470":39280,"34471":39536,"34472":39534,"34473":39535,"34474":40480,"34475":20389,"34476":20392,"34477":21294,"34478":21388,"34479":23581,"34480":21589,"34481":21497,"34482":21949,"34483":21863,"34484":21716,"34485":22242,"34486":22270,"34487":23576,"34488":22443,"34489":22545,"34490":23551,"34491":26790,"34492":22842,"34493":22849,"34494":22954,"34495":23454,"34496":23517,"34497":23545,"34498":23649,"34499":23853,"34500":23702,"34501":24065,"34502":24124,"34503":24443,"34504":24577,"34505":24815,"34506":24696,"34507":24813,"34508":24808,"34509":25602,"34510":25524,"34511":25530,"34512":30021,"34513":33635,"34514":26538,"34515":28378,"34516":28173,"34517":27721,"34518":28385,"34519":28382,"34520":28176,"34521":28072,"34522":28063,"34523":27818,"34524":28180,"34525":28183,"34526":28068,"34527":33639,"34528":23572,"34529":33638,"34530":29425,"34531":29712,"34532":29595,"34533":30111,"34534":30113,"34535":30127,"34536":30186,"34537":23613,"34538":30417,"34539":30805,"34540":31087,"34541":31096,"34542":31181,"34543":31216,"34544":27964,"34545":31389,"34546":31546,"34547":31581,"34548":32509,"34549":32510,"34550":32508,"34551":32496,"34552":32491,"34553":32511,"34554":32039,"34555":32512,"34556":32434,"34557":32494,"34558":32504,"34624":32501,"34625":32438,"34626":32500,"34627":32490,"34628":32513,"34629":32502,"34630":32602,"34631":38395,"34632":33669,"34633":30422,"34634":33642,"34635":33485,"34636":34432,"34637":35829,"34638":35821,"34639":35820,"34640":35748,"34641":35819,"34642":35823,"34643":35828,"34644":35824,"34645":35826,"34646":35825,"34647":35827,"34648":35822,"34649":23486,"34650":36168,"34651":36170,"34652":36213,"34653":36214,"34654":36741,"34655":36740,"34656":36731,"34657":36828,"34658":36874,"34659":36882,"34660":38128,"34661":38134,"34662":38108,"34663":38125,"34664":38114,"34665":38124,"34666":38120,"34667":38133,"34668":38115,"34669":38402,"34670":38394,"34671":38397,"34672":38401,"34673":38400,"34674":38469,"34675":39047,"34676":39046,"34677":39122,"34678":39290,"34679":39292,"34680":39285,"34681":39287,"34682":39539,"34683":32942,"34684":39600,"34685":40483,"34686":40482,"34721":20964,"34722":40784,"34723":20159,"34724":20202,"34725":20215,"34726":20396,"34727":20393,"34728":20461,"34729":21095,"34730":21016,"34731":21073,"34732":21053,"34733":21385,"34734":21792,"34735":22068,"34736":21719,"34737":22040,"34738":21943,"34739":21880,"34740":21501,"34741":22687,"34742":22367,"34743":22368,"34744":22549,"34745":23092,"34746":23157,"34747":22953,"34748":23047,"34749":23046,"34750":23485,"34751":23457,"34752":20889,"34753":23618,"34754":23956,"34755":24092,"34756":24223,"34757":21416,"34758":24217,"34759":21422,"34760":24191,"34761":24377,"34762":24198,"34763":34385,"34764":24551,"34765":24578,"34766":24751,"34767":24814,"34768":24868,"34769":24579,"34770":25370,"34771":25169,"34772":25438,"34773":25320,"34774":25376,"34775":25242,"34776":25528,"34777":25599,"34778":25932,"34779":25968,"34780":26242,"34781":26165,"34782":26679,"34783":26729,"34784":26530,"34785":26631,"34786":27004,"34787":26728,"34788":20048,"34789":26526,"34790":27431,"34791":27527,"34792":27572,"34793":27974,"34794":27900,"34795":27905,"34796":27975,"34797":28291,"34798":28070,"34799":28071,"34800":27988,"34801":28909,"34802":22870,"34803":33721,"34804":30126,"34805":30353,"34806":30385,"34807":30424,"34808":30830,"34809":30721,"34810":31377,"34811":31351,"34812":32532,"34813":32451,"34814":32428,"34880":32516,"34881":32517,"34882":32521,"34883":32534,"34884":32536,"34885":32447,"34886":32526,"34887":32531,"34888":32525,"34889":32514,"34890":32520,"34891":32519,"34892":39554,"34893":32610,"34894":33014,"34895":32932,"34896":33714,"34897":33643,"34898":33931,"34899":34430,"34900":34583,"34901":21355,"34902":35850,"34903":35845,"34904":35848,"34905":35846,"34906":35806,"34907":35831,"34908":35832,"34909":35838,"34910":35839,"34911":35844,"34912":35843,"34913":35841,"34914":35770,"34915":35812,"34916":35847,"34917":35837,"34918":35840,"34919":31446,"34920":36180,"34921":36175,"34922":36171,"34923":36145,"34924":36134,"34925":36172,"34926":36132,"34927":21334,"34928":36176,"34929":36136,"34930":36179,"34931":36341,"34932":36745,"34933":36742,"34934":36749,"34935":36744,"34936":36743,"34937":36718,"34938":36750,"34939":36747,"34940":36746,"34941":36866,"34942":36801,"34977":37051,"34978":37073,"34979":37011,"34980":38156,"34981":38161,"34982":38144,"34983":38138,"34984":38096,"34985":38148,"34986":38109,"34987":38160,"34988":38153,"34989":38155,"34990":38049,"34991":38146,"34992":38398,"34993":38405,"34994":24041,"34995":39049,"34996":39052,"34997":20859,"34998":39295,"34999":39297,"35000":39548,"35001":39547,"35002":39543,"35003":39542,"35004":39549,"35005":39550,"35006":39545,"35007":39544,"35008":39607,"35009":38393,"35010":40063,"35011":40065,"35012":40489,"35013":40486,"35014":40632,"35015":40831,"35016":20454,"35017":20647,"35018":20394,"35019":24130,"35020":21058,"35021":21544,"35022":21725,"35023":22003,"35024":22438,"35025":22363,"35026":22859,"35027":34949,"35028":23398,"35029":23548,"35030":23466,"35031":20973,"35032":24811,"35033":25044,"35034":24518,"35035":25112,"35036":25317,"35037":25377,"35038":25374,"35039":25454,"35040":25523,"35041":25321,"35042":25441,"35043":25285,"35044":25373,"35045":21382,"35046":26195,"35047":26196,"35048":26137,"35049":26726,"35050":27178,"35051":26641,"35052":26925,"35053":26725,"35054":26426,"35055":26721,"35056":28096,"35057":27987,"35058":27901,"35059":27978,"35060":27811,"35061":28582,"35062":28177,"35063":28861,"35064":28903,"35065":28783,"35066":28907,"35067":28950,"35068":29420,"35069":29585,"35070":29935,"35136":30232,"35137":21346,"35138":30610,"35139":30742,"35140":30875,"35141":31215,"35142":39062,"35143":31267,"35144":31397,"35145":31491,"35146":31579,"35147":32546,"35148":32547,"35149":33830,"35150":32538,"35151":21439,"35152":32543,"35153":32540,"35154":32537,"35155":32457,"35156":33147,"35157":20852,"35158":33329,"35159":33633,"35160":33831,"35161":33436,"35162":34434,"35163":33828,"35164":35044,"35165":20146,"35166":35278,"35167":35867,"35168":35866,"35169":35855,"35170":35763,"35171":35851,"35172":35853,"35173":35856,"35174":35864,"35175":35834,"35176":35858,"35177":35859,"35178":35773,"35179":35861,"35180":35865,"35181":35852,"35182":35862,"35183":36182,"35184":36752,"35185":36753,"35186":36755,"35187":36751,"35188":21150,"35189":36873,"35190":36831,"35191":36797,"35192":36951,"35193":37050,"35194":38189,"35195":38191,"35196":38192,"35197":38169,"35198":38065,"35233":38050,"35234":38177,"35235":24405,"35236":38126,"35237":38181,"35238":38182,"35239":38175,"35240":38178,"35241":38193,"35242":38414,"35243":38543,"35244":38505,"35245":38745,"35246":33148,"35247":39050,"35248":39048,"35249":39057,"35250":39060,"35251":22836,"35252":39059,"35253":39056,"35254":39302,"35255":39279,"35256":39300,"35257":39301,"35258":39559,"35259":39560,"35260":39558,"35261":39608,"35262":39612,"35263":40077,"35264":40501,"35265":40490,"35266":40495,"35267":40493,"35268":40499,"35269":40857,"35270":40863,"35271":20248,"35272":20607,"35273":20648,"35274":21169,"35275":21659,"35276":21523,"35277":21387,"35278":22489,"35279":23156,"35280":23252,"35281":23351,"35282":23604,"35283":23654,"35284":23679,"35285":23896,"35286":24110,"35287":24357,"35288":24212,"35289":24691,"35290":25103,"35291":20987,"35292":25380,"35293":25319,"35294":25311,"35295":25601,"35296":25947,"35297":27609,"35298":26279,"35299":26723,"35300":26816,"35301":26727,"35302":26633,"35303":27183,"35304":27539,"35305":27617,"35306":27870,"35307":28392,"35308":27982,"35309":28059,"35310":28389,"35311":28073,"35312":28493,"35313":33829,"35314":28799,"35315":28891,"35316":28905,"35317":22681,"35318":29406,"35319":33719,"35320":29615,"35321":29815,"35322":30184,"35323":30103,"35324":30699,"35325":30970,"35326":30710,"35392":31699,"35393":31914,"35394":38214,"35395":31937,"35396":32553,"35397":32489,"35398":32554,"35399":32533,"35400":32551,"35401":32503,"35402":32541,"35403":24635,"35404":32437,"35405":32555,"35406":32420,"35407":32549,"35408":32358,"35409":32550,"35410":22768,"35411":32874,"35412":32852,"35413":32824,"35414":33043,"35415":32966,"35416":33080,"35417":33037,"35418":20020,"35419":20030,"35420":33392,"35421":34103,"35422":34015,"35423":20111,"35424":34684,"35425":34632,"35426":20149,"35427":35099,"35428":35274,"35429":35868,"35430":35876,"35431":35878,"35432":35762,"35433":35854,"35434":35875,"35435":35874,"35436":35466,"35437":35879,"35438":36186,"35439":36187,"35440":36141,"35441":36185,"35442":36235,"35443":36758,"35444":36759,"35445":27586,"35446":36757,"35447":33286,"35448":36824,"35449":36808,"35450":37213,"35451":38208,"35452":38209,"35453":38170,"35454":38190,"35489":38194,"35490":38149,"35491":38180,"35492":38202,"35493":38201,"35494":38203,"35495":38206,"35496":38199,"35497":38420,"35498":38421,"35499":38417,"35500":38385,"35501":38544,"35502":38582,"35503":34429,"35504":38889,"35505":39063,"35506":39123,"35507":39563,"35508":39567,"35509":40092,"35510":40091,"35511":40084,"35512":40081,"35513":40511,"35514":40509,"35515":28857,"35516":25995,"35517":19995,"35518":22108,"35519":22329,"35520":22418,"35521":23158,"35522":25041,"35523":25193,"35524":25527,"35525":25200,"35526":25781,"35527":25670,"35528":25822,"35529":25783,"35530":26029,"35531":27103,"35532":26588,"35533":27099,"35534":26592,"35535":27428,"35536":24402,"35537":27553,"35538":27899,"35539":28182,"35540":28388,"35541":28174,"35542":28293,"35543":27983,"35544":28908,"35545":28952,"35546":29367,"35547":29454,"35548":29934,"35549":30112,"35550":30545,"35551":30784,"35552":31036,"35553":31313,"35554":31229,"35555":31388,"35556":31373,"35557":31659,"35558":31783,"35559":31658,"35560":31697,"35561":31616,"35562":31918,"35563":32455,"35564":32558,"35565":32469,"35566":32557,"35567":32483,"35568":32559,"35569":32728,"35570":32844,"35571":32834,"35572":33040,"35573":33169,"35574":26087,"35575":33832,"35576":34013,"35577":33632,"35578":34546,"35579":34633,"35580":35280,"35581":35294,"35582":35871,"35648":35880,"35649":35884,"35650":35882,"35651":36184,"35652":36434,"35653":36857,"35654":36344,"35655":36527,"35656":36716,"35657":36761,"35658":36841,"35659":21307,"35660":37233,"35661":38225,"35662":38145,"35663":38056,"35664":38221,"35665":38215,"35666":38224,"35667":38226,"35668":38217,"35669":38422,"35670":38383,"35671":38423,"35672":38425,"35673":26434,"35674":21452,"35675":38607,"35676":40481,"35677":39069,"35678":39068,"35679":39064,"35680":39066,"35681":39067,"35682":39311,"35683":39306,"35684":39304,"35685":39569,"35686":39617,"35687":40104,"35688":40100,"35689":40107,"35690":40103,"35691":40515,"35692":40517,"35693":40516,"35694":22404,"35695":22364,"35696":23456,"35697":24222,"35698":24208,"35699":24809,"35700":24576,"35701":25042,"35702":25314,"35703":26103,"35704":27249,"35705":26911,"35706":27016,"35707":27257,"35708":28487,"35709":28625,"35710":27813,"35745":28626,"35746":27896,"35747":28865,"35748":29261,"35749":29322,"35750":20861,"35751":29549,"35752":29626,"35753":29756,"35754":30068,"35755":30250,"35756":30861,"35757":31095,"35758":31283,"35759":31614,"35760":33575,"35761":32462,"35762":32499,"35763":32472,"35764":32599,"35765":32564,"35766":33211,"35767":33402,"35768":34222,"35769":33647,"35770":34433,"35771":34631,"35772":35014,"35773":34948,"35774":35889,"35775":35782,"35776":35885,"35777":35890,"35778":35749,"35779":35887,"35780":36192,"35781":36190,"35782":36343,"35783":36762,"35784":36735,"35785":36766,"35786":36793,"35787":38236,"35788":38237,"35789":38238,"35790":38142,"35791":38231,"35792":38232,"35793":38230,"35794":38233,"35795":38197,"35796":38210,"35797":38143,"35798":37694,"35799":20851,"35800":38471,"35801":38590,"35802":38654,"35803":38892,"35804":38901,"35805":31867,"35806":39072,"35807":39125,"35808":39314,"35809":39313,"35810":39579,"35811":39575,"35812":40120,"35813":40115,"35814":40109,"35815":40119,"35816":40529,"35817":40521,"35818":40522,"35819":40524,"35820":40527,"35821":20029,"35822":40628,"35823":21149,"35824":21657,"35825":22052,"35826":20005,"35827":23453,"35828":24748,"35829":24527,"35830":25318,"35831":25600,"35832":32999,"35833":27015,"35834":28572,"35835":28491,"35836":28809,"35837":29649,"35838":30719,"35904":30778,"35905":30718,"35906":30782,"35907":31398,"35908":31454,"35909":31609,"35910":31726,"35911":36779,"35912":32548,"35913":32487,"35914":32578,"35915":33002,"35916":33328,"35917":34108,"35918":34106,"35919":33446,"35920":33529,"35921":34164,"35922":34461,"35923":35124,"35924":35273,"35925":35302,"35926":35758,"35927":35793,"35928":35893,"35929":36194,"35930":36193,"35931":36280,"35932":37322,"35933":38047,"35934":38105,"35935":38152,"35936":38416,"35937":39128,"35938":39286,"35939":39269,"35940":39582,"35941":33150,"35942":39578,"35943":40131,"35944":40133,"35945":20826,"35946":40835,"35947":40836,"35948":20458,"35949":21995,"35950":21869,"35951":22179,"35952":23646,"35953":24807,"35954":24913,"35955":25668,"35956":25658,"35957":26003,"35958":27185,"35959":26639,"35960":26818,"35961":27516,"35962":28866,"35963":29306,"35964":38262,"35965":29838,"35966":30302,"36001":32544,"36002":32493,"36003":20848,"36004":34259,"36005":34510,"36006":35272,"36007":35892,"36008":25252,"36009":35465,"36010":36163,"36011":36364,"36012":36291,"36013":36347,"36014":36720,"36015":36777,"36016":38256,"36017":38253,"36018":38081,"36019":38107,"36020":38094,"36021":38255,"36022":38220,"36023":21709,"36024":39038,"36025":39074,"36026":39144,"36027":39537,"36028":39584,"36029":34022,"36030":39585,"36031":39621,"36032":40141,"36033":40143,"36034":33722,"36035":40548,"36036":40542,"36037":40839,"36038":40840,"36039":21870,"36040":20456,"36041":20645,"36042":21587,"36043":23402,"36044":24005,"36045":23782,"36046":24367,"36047":25674,"36048":26435,"36049":27426,"36050":28393,"36051":29473,"36052":21472,"36053":30270,"36054":30307,"36055":31548,"36056":31809,"36057":32843,"36058":33039,"36059":34989,"36060":34924,"36061":35835,"36062":36174,"36063":36189,"36064":36399,"36065":36396,"36066":36756,"36067":37094,"36068":38136,"36069":37492,"36070":38657,"36071":38801,"36072":32366,"36073":39076,"36074":39556,"36075":39553,"36076":40150,"36077":40098,"36078":40148,"36079":40151,"36080":40551,"36081":40485,"36082":40761,"36083":40841,"36084":40842,"36085":40858,"36086":24651,"36087":25371,"36088":25605,"36089":29906,"36090":31363,"36091":32552,"36092":33250,"36093":33821,"36094":34506,"36160":21464,"36161":36902,"36162":36923,"36163":38259,"36164":38084,"36165":38757,"36166":26174,"36167":39181,"36168":24778,"36169":39551,"36170":39564,"36171":39635,"36172":39633,"36173":40157,"36174":40158,"36175":40156,"36176":40502,"36177":22065,"36178":22365,"36179":25597,"36180":30251,"36181":30315,"36182":32641,"36183":34453,"36184":35753,"36185":35863,"36186":35894,"36187":33395,"36188":36195,"36189":37247,"36190":38643,"36191":28789,"36192":38701,"36193":39078,"36194":39588,"36195":39699,"36196":39751,"36197":40078,"36198":40560,"36199":40557,"36200":30839,"36201":30416,"36202":40140,"36203":40844,"36204":40843,"36205":21381,"36206":27012,"36207":28286,"36208":31729,"36209":31657,"36210":34542,"36211":35266,"36212":36433,"36213":34885,"36214":38053,"36215":39045,"36216":39307,"36217":39627,"36218":40649,"36219":28390,"36220":30633,"36221":38218,"36222":38831,"36257":39540,"36258":39589,"36259":32518,"36260":35872,"36261":36495,"36262":37245,"36263":38075,"36264":37550,"36265":38179,"36266":40132,"36267":40072,"36268":40681,"36269":20991,"36270":40550,"36271":39562,"36272":40563,"36273":40510,"36274":38074,"36275":20162,"36276":34381,"36277":27538,"36278":22439,"36279":22395,"36280":25099,"36281":20451,"36282":21037,"36283":21389,"36284":21593,"36285":21370,"36286":32424,"36287":33543,"36288":38023,"36289":38022,"36290":21591,"36291":24362,"36292":31059,"36293":32446,"36294":37071,"36295":38028,"36296":21072,"36297":21286,"36298":22261,"36299":22445,"36300":23045,"36301":23741,"36302":23811,"36303":28062,"36304":28172,"36305":28867,"36306":30502,"36307":32448,"36308":32464,"36309":33003,"36310":38030,"36311":38032,"36312":38037,"36313":38029,"36314":38379,"36315":22955,"36316":23899,"36317":24701,"36318":26720,"36319":26536,"36320":27817,"36321":27976,"36322":30066,"36323":30743,"36324":32471,"36325":33757,"36326":35271,"36327":35765,"36328":35790,"36329":35794,"36330":36150,"36331":36147,"36332":36730,"36333":36725,"36334":36728,"36335":36911,"36336":37075,"36337":37124,"36338":38059,"36339":38060,"36340":38043,"36341":38063,"36342":38061,"36343":38058,"36344":38390,"36345":38503,"36346":39032,"36347":39275,"36348":40697,"36349":20251,"36350":20603,"36416":20325,"36417":21794,"36418":22450,"36419":24047,"36420":24493,"36421":28828,"36422":33557,"36423":29426,"36424":29614,"36425":32488,"36426":32480,"36427":32481,"36428":32671,"36429":33645,"36430":34545,"36431":35795,"36432":35798,"36433":35817,"36434":35796,"36435":35804,"36436":36241,"36437":36738,"36438":36737,"36439":37036,"36440":38090,"36441":38088,"36442":38064,"36443":38066,"36444":38070,"36445":38157,"36446":38092,"36447":38077,"36448":38076,"36449":39043,"36450":39040,"36451":20971,"36452":40702,"36453":20606,"36454":21787,"36455":23901,"36456":24123,"36457":24747,"36458":24749,"36459":24580,"36460":25132,"36461":25111,"36462":25247,"36463":25248,"36464":25532,"36465":26724,"36466":26473,"36467":33637,"36468":27986,"36469":27812,"36470":28829,"36471":30386,"36472":30720,"36473":32507,"36474":32498,"36475":32495,"36476":32506,"36477":33715,"36478":35275,"36513":35830,"36514":36167,"36515":38129,"36516":38098,"36517":38097,"36518":38101,"36519":38111,"36520":38123,"36521":38127,"36522":38122,"36523":38135,"36524":38102,"36525":38117,"36526":39121,"36527":21055,"36528":21154,"36529":21715,"36530":21586,"36531":23810,"36532":23780,"36533":24209,"36534":24870,"36535":25378,"36536":26912,"36537":27637,"36538":39053,"36539":28061,"36540":28514,"36541":28064,"36542":28375,"36543":29711,"36544":29825,"36545":30231,"36546":32515,"36547":32535,"36548":32524,"36549":32527,"36550":32529,"36551":33628,"36552":33932,"36553":33553,"36554":33473,"36555":35833,"36556":35836,"36557":35842,"36558":36181,"36559":37112,"36560":38162,"36561":38103,"36562":38141,"36563":38163,"36564":38154,"36565":38116,"36566":38150,"36567":38151,"36568":38164,"36569":38406,"36570":38403,"36571":38739,"36572":39055,"36573":39293,"36574":39541,"36575":39552,"36576":40066,"36577":40488,"36578":21714,"36579":21717,"36580":21721,"36581":23250,"36582":23748,"36583":24639,"36584":27546,"36585":27981,"36586":28904,"36587":29443,"36588":29423,"36589":30876,"36590":31405,"36591":32279,"36592":32539,"36593":33927,"36594":33640,"36595":33929,"36596":33630,"36597":33720,"36598":33431,"36599":34547,"36600":35816,"36601":35857,"36602":35860,"36603":35869,"36604":37072,"36605":38185,"36606":38188,"36672":38166,"36673":38167,"36674":38140,"36675":38171,"36676":38165,"36677":38174,"36678":38036,"36679":38415,"36680":38408,"36681":38409,"36682":38410,"36683":38412,"36684":38413,"36685":40498,"36686":40497,"36687":21724,"36688":24113,"36689":24697,"36690":25672,"36691":58305,"36692":27894,"36693":29461,"36694":29971,"36695":30213,"36696":30187,"36697":30807,"36698":31654,"36699":31578,"36700":31976,"36701":32545,"36702":32807,"36703":33631,"36704":33718,"36705":34544,"36706":35042,"36707":35279,"36708":35873,"36709":35788,"36710":35877,"36711":36292,"36712":38200,"36713":38196,"36714":38113,"36715":38198,"36716":38418,"36717":39271,"36718":40082,"36719":40085,"36720":40504,"36721":40505,"36722":40506,"36723":40832,"36724":24636,"36725":25669,"36726":25784,"36727":27898,"36728":30102,"36729":32523,"36730":32873,"36731":33641,"36732":34789,"36733":34414,"36734":35764,"36769":35881,"36770":36188,"36771":36157,"36772":36760,"36773":37021,"36774":38227,"36775":38112,"36776":38204,"36777":38223,"36778":34021,"36779":38890,"36780":39273,"36781":39568,"36782":39570,"36783":39571,"36784":38411,"36785":40105,"36786":40096,"36787":40520,"36788":40513,"36789":40518,"36790":21411,"36791":21590,"36792":22406,"36793":27104,"36794":26638,"36795":27655,"36796":27895,"36797":28486,"36798":31074,"36799":32562,"36800":32563,"36801":32628,"36802":33315,"36803":34511,"36804":34431,"36805":35043,"36806":35281,"36807":35311,"36808":35886,"36809":38235,"36810":38239,"36811":38250,"36812":38214,"36813":38121,"36814":38891,"36815":39073,"36816":39312,"36817":39618,"36818":40117,"36819":40118,"36820":40123,"36821":40113,"36822":40526,"36823":40491,"36824":40700,"36825":21950,"36826":25732,"36827":26634,"36828":26533,"36829":26636,"36830":32561,"36831":32845,"36832":33551,"36833":33480,"36834":34162,"36835":34548,"36836":34686,"36837":38132,"36838":38246,"36839":38248,"36840":38241,"36841":38243,"36842":38212,"36843":38251,"36844":38119,"36845":38244,"36846":38137,"36847":38426,"36848":39071,"36849":39316,"36850":39546,"36851":39581,"36852":39583,"36853":39576,"36854":40535,"36855":40538,"36856":40540,"36857":40838,"36858":40837,"36859":20649,"36860":23743,"36861":30152,"36862":25786,"36928":27017,"36929":28384,"36930":30779,"36931":31901,"36932":32425,"36933":32556,"36934":34105,"36935":36166,"36936":38257,"36937":38396,"36938":39129,"36939":39586,"36940":39574,"36941":39580,"36942":40101,"36943":40142,"36944":40144,"36945":40547,"36946":40536,"36947":40574,"36948":20865,"36949":23048,"36950":28757,"36951":25874,"36952":30271,"36953":31656,"36954":31860,"36955":33339,"36956":35276,"36957":36345,"36958":36318,"36959":36729,"36960":38228,"36961":38252,"36962":39587,"36963":39557,"36964":40149,"36965":40099,"36966":40102,"36967":40552,"36968":40503,"36969":40859,"36970":26686,"36971":26916,"36972":34016,"36973":38624,"36974":36723,"36975":40159,"36976":40095,"36977":40553,"36978":40556,"36979":40554,"36980":40555,"36981":40519,"36982":28751,"36983":31766,"36984":35888,"36985":39628,"36986":31550,"36987":31900,"36988":32565,"36989":33044,"36990":36479,"37025":38247,"37026":40090,"37027":36273,"37028":36508,"37029":37246,"37030":35891,"37031":39070,"37032":39079,"37033":39591,"37034":40492,"37035":25094,"37036":38404,"37037":40097,"37038":40514,"37039":31160,"37040":25300,"37041":36299,"37042":29648,"37043":23467,"37044":25296,"37045":27585,"37046":20943,"37047":31108,"37048":21525,"37049":28508,"37050":34972,"37051":37095,"37052":20857,"37053":25144,"37054":25243,"37055":25383,"37056":25531,"37057":25566,"37058":25594,"37059":25745,"37060":25792,"37061":25825,"37062":25846,"37063":25861,"37064":25909,"37065":25934,"37066":25963,"37067":25992,"37068":26073,"37069":26142,"37070":26171,"37071":26175,"37072":26180,"37073":26199,"37074":26217,"37075":26227,"37076":26243,"37077":26300,"37078":26303,"37079":26305,"37080":26357,"37081":26362,"37082":26363,"37083":26382,"37084":26390,"37085":26423,"37086":26468,"37087":26470,"37088":26534,"37089":26535,"37090":26537,"37091":26619,"37092":26621,"37093":26624,"37094":26625,"37095":26629,"37096":26654,"37097":26698,"37098":26706,"37099":26709,"37100":26713,"37101":26765,"37102":26809,"37103":26831,"37104":20616,"37105":38184,"37106":40087,"37107":26914,"37108":26918,"37109":220,"37110":58591,"37111":58592,"37112":252,"37113":58594,"37114":58595,"37115":220,"37116":252,"37117":26934,"37118":26977,"37184":33477,"37185":33482,"37186":33496,"37187":33560,"37188":33562,"37189":33571,"37190":33606,"37191":33627,"37192":33634,"37193":33644,"37194":33646,"37195":33692,"37196":33695,"37197":33717,"37198":33724,"37199":33783,"37200":33834,"37201":33864,"37202":33884,"37203":33890,"37204":33924,"37205":33928,"37206":34012,"37207":34019,"37208":34104,"37209":34138,"37210":34199,"37211":34219,"37212":34241,"37213":34323,"37214":34326,"37215":8715,"37216":34581,"37217":34672,"37218":34685,"37219":34699,"37220":34728,"37221":34759,"37222":34768,"37223":34823,"37224":34830,"37225":34855,"37226":34990,"37227":8712,"37228":34997,"37229":35007,"37230":35045,"37231":35061,"37232":35100,"37233":35101,"37234":35191,"37235":35303,"37236":35383,"37237":35500,"37238":35546,"37239":35675,"37240":35697,"37241":35883,"37242":35898,"37243":35964,"37244":35982,"37245":36014,"37246":36114,"37281":36169,"37282":36173,"37283":36209,"37284":36360,"37285":36410,"37286":36464,"37287":36505,"37288":36528,"37289":36529,"37290":36549,"37291":36550,"37292":36558,"37293":36579,"37294":36620,"37295":36721,"37296":36727,"37297":36775,"37298":36847,"37299":36878,"37300":36921,"37301":36965,"37302":37001,"37303":37086,"37304":37141,"37305":37334,"37306":37339,"37307":37342,"37308":37345,"37309":37349,"37310":37366,"37311":37372,"37312":37417,"37313":37420,"37314":65287,"37315":37465,"37316":37495,"37317":37613,"37318":37690,"37319":58701,"37320":58702,"37321":29227,"37322":20866,"37323":20886,"37324":20023,"37325":20843,"37326":20799,"37327":58709,"37328":58710,"37329":26409,"37330":27706,"37331":21378,"37332":30098,"37333":32896,"37334":34916,"37335":19974,"37336":58718,"37337":58719,"37338":58720,"37339":11927,"37340":21241,"37341":21269,"37342":8225,"37343":58725,"37344":13316,"37345":58727,"37346":58728,"37347":58729,"37348":58730,"37349":58731,"37350":20981,"37351":58733,"37352":23662,"37353":58735,"37354":22231,"37355":20128,"37356":20907,"37357":11904,"37358":27079,"37359":58741,"37360":9550,"37361":9688,"37362":9689,"37363":9794,"37364":9654,"37365":9668,"37366":8597,"37367":8252,"37368":182,"37369":8704,"37370":8616,"37371":8596,"37372":8962,"37373":58755,"37374":58756,"37440":20124,"37441":24746,"37442":22311,"37443":22258,"37444":21307,"37445":22769,"37446":36920,"37447":38560,"37448":26628,"37449":21942,"37450":39365,"37451":35585,"37452":20870,"37453":32257,"37454":24540,"37455":27431,"37456":27572,"37457":26716,"37458":22885,"37459":31311,"37460":20206,"37461":20385,"37462":30011,"37463":28784,"37464":20250,"37465":24724,"37466":28023,"37467":32117,"37468":22730,"37469":25040,"37470":25313,"37471":27579,"37472":35226,"37473":23398,"37474":27005,"37475":21917,"37476":28167,"37477":58794,"37478":24059,"37479":38501,"37480":21223,"37481":23515,"37482":28450,"37483":38306,"37484":27475,"37485":35251,"37486":27671,"37487":24112,"37488":25135,"37489":29344,"37490":34384,"37491":26087,"37492":24613,"37493":25312,"37494":25369,"37495":34394,"37496":23777,"37497":25375,"37498":29421,"37499":37111,"37500":38911,"37501":26241,"37502":21220,"37537":35641,"37538":21306,"37539":39366,"37540":21234,"37541":58824,"37542":24452,"37543":33550,"37544":24693,"37545":25522,"37546":28179,"37547":32076,"37548":34509,"37549":36605,"37550":32153,"37551":40335,"37552":25731,"37553":30476,"37554":20537,"37555":21091,"37556":38522,"37557":22287,"37558":26908,"37559":27177,"37560":38997,"37561":39443,"37562":21427,"37563":21577,"37564":23087,"37565":35492,"37566":24195,"37567":28207,"37568":37489,"37569":21495,"37570":22269,"37571":40658,"37572":31296,"37573":30741,"37574":28168,"37575":25998,"37576":27507,"37577":21092,"37578":38609,"37579":21442,"37580":26719,"37581":24808,"37582":36059,"37583":27531,"37584":27503,"37585":20816,"37586":36766,"37587":28287,"37588":23455,"37589":20889,"37590":33294,"37591":25448,"37592":37320,"37593":23551,"37594":21454,"37595":34886,"37596":24467,"37597":28171,"37598":29539,"37599":32294,"37600":31899,"37601":20966,"37602":23558,"37603":31216,"37604":28169,"37605":28988,"37606":22888,"37607":26465,"37608":29366,"37609":20055,"37610":27972,"37611":21104,"37612":30067,"37613":32260,"37614":22732,"37615":23330,"37616":35698,"37617":37304,"37618":35302,"37619":22065,"37620":23517,"37621":23613,"37622":22259,"37623":31883,"37624":37204,"37625":31298,"37626":38543,"37627":39620,"37628":26530,"37629":25968,"37630":25454,"37696":28716,"37697":22768,"37698":25993,"37699":38745,"37700":31363,"37701":25666,"37702":32118,"37703":23554,"37704":27973,"37705":25126,"37706":36341,"37707":37549,"37708":28508,"37709":36983,"37710":36984,"37711":32330,"37712":31109,"37713":30094,"37714":22766,"37715":20105,"37716":33624,"37717":25436,"37718":25407,"37719":24035,"37720":31379,"37721":35013,"37722":20711,"37723":23652,"37724":32207,"37725":39442,"37726":22679,"37727":24974,"37728":34101,"37729":36104,"37730":33235,"37731":23646,"37732":32154,"37733":22549,"37734":23550,"37735":24111,"37736":28382,"37737":28381,"37738":25246,"37739":27810,"37740":28655,"37741":21336,"37742":22022,"37743":22243,"37744":26029,"37745":24382,"37746":36933,"37747":26172,"37748":37619,"37749":24193,"37750":24500,"37751":32884,"37752":25074,"37753":22618,"37754":36883,"37755":37444,"37756":28857,"37757":36578,"37758":20253,"37793":38651,"37794":28783,"37795":24403,"37796":20826,"37797":30423,"37798":31282,"37799":38360,"37800":24499,"37801":27602,"37802":29420,"37803":35501,"37804":23626,"37805":38627,"37806":24336,"37807":24745,"37808":33075,"37809":25309,"37810":24259,"37811":22770,"37812":26757,"37813":21338,"37814":34180,"37815":40614,"37816":32283,"37817":30330,"37818":39658,"37819":25244,"37820":27996,"37821":27996,"37822":25935,"37823":25975,"37824":20398,"37825":25173,"37826":20175,"37827":36794,"37828":22793,"37829":27497,"37830":33303,"37831":31807,"37832":21253,"37833":23453,"37834":25265,"37835":27873,"37836":32990,"37837":30770,"37838":35914,"37839":39165,"37840":22696,"37841":27598,"37842":28288,"37843":33032,"37844":40665,"37845":35379,"37846":34220,"37847":36493,"37848":19982,"37849":35465,"37850":25671,"37851":27096,"37852":35617,"37853":26332,"37854":26469,"37855":38972,"37856":20081,"37857":35239,"37858":31452,"37859":38534,"37860":26053,"37861":20001,"37862":29471,"37863":32209,"37864":28057,"37865":22593,"37866":31036,"37867":21169,"37868":25147,"37869":38666,"37870":40802,"37871":26278,"37872":27508,"37873":24651,"37874":32244,"37875":37676,"37876":28809,"37877":21172,"37878":27004,"37879":37682,"37880":28286,"37881":24357,"37882":20096,"37883":26365,"37884":22985,"37885":23437,"37886":23947,"37952":27179,"37953":26907,"37954":21936,"37955":31874,"37956":36796,"37957":27018,"37958":21682,"37959":40235,"37960":38635,"37961":26905,"37962":25539,"37963":39364,"37964":20967,"37965":26626,"37966":36795,"37967":20685,"37968":23776,"37969":26627,"37970":20970,"37971":21250,"37972":30834,"37973":30033,"37974":30048,"37975":22138,"37976":37618,"37977":22592,"37978":26622,"37979":20451,"37980":26466,"37981":31870,"37982":21249,"37983":20452,"37984":20453,"37985":20969,"37986":21498,"37987":21720,"37988":22222,"37989":22310,"37990":22327,"37991":22328,"37992":22408,"37993":22451,"37994":22442,"37995":22448,"37996":22486,"37997":22640,"37998":22713,"37999":22743,"38000":23670,"38001":23740,"38002":23749,"38003":23742,"38004":23926,"38005":24342,"38006":24634,"38007":25525,"38008":26433,"38009":26467,"38010":26529,"38011":26810,"38012":26917,"38013":26920,"38014":27258,"38049":26915,"38050":26913,"38051":27006,"38052":27009,"38053":27101,"38054":27182,"38055":27250,"38056":27423,"38057":27615,"38058":28181,"38059":29077,"38060":29927,"38061":29938,"38062":29936,"38063":29937,"38064":29944,"38065":29957,"38066":30057,"38067":30314,"38068":30836,"38069":31437,"38070":31439,"38071":31445,"38072":31443,"38073":31457,"38074":31472,"38075":31490,"38076":31763,"38077":31767,"38078":31888,"38079":31917,"38080":31936,"38081":31960,"38082":32155,"38083":32261,"38084":32359,"38085":32387,"38086":32400,"38087":33188,"38088":33373,"38089":33826,"38090":34009,"38091":34352,"38092":34475,"38093":34543,"38094":34992,"38095":35011,"38096":35012,"38097":35076,"38098":59183,"38099":36542,"38100":36552,"38101":36684,"38102":36791,"38103":36826,"38104":36903,"38105":36950,"38106":37685,"38107":37691,"38108":37817,"38109":38282,"38110":38294,"38111":38777,"38112":38790,"38113":38800,"38114":39082,"38115":39830,"38116":39831,"38117":39860,"38118":39887,"38119":39889,"38120":39890,"38121":39922,"38122":39921,"38123":39984,"38124":40007,"38125":40026,"38126":40176,"38127":40262,"38128":40292,"38129":40363,"38130":20036,"38131":21583,"38132":25368,"38133":39857,"38134":40041,"38135":40263,"38136":40293,"38137":39983,"38138":40639,"38139":20916,"38140":21610,"38141":26528,"38142":39822,"38208":37032,"38209":20914,"38210":13869,"38211":25285,"38212":21189,"38213":26545,"38214":21709,"38215":24658,"38216":21441,"38217":28913,"38218":22531,"38219":21855,"38220":37390,"38221":30528,"38222":29756,"38223":29002,"38224":28377,"38225":21472,"38226":29486,"38227":35023,"38228":30861,"38229":32675,"38230":32171,"38231":36394,"38232":37979,"38233":25452,"38234":24487,"38235":23557,"38236":32827,"38237":23791,"38238":14776,"38239":29009,"38240":36045,"38241":38894,"38242":22642,"38243":23139,"38244":32632,"38245":23895,"38246":24943,"38247":27032,"38248":32137,"38249":31918,"38250":32179,"38251":28545,"38252":23290,"38253":22715,"38254":29269,"38255":30286,"38256":36653,"38257":37561,"38258":40286,"38259":40623,"38260":32583,"38261":40388,"38262":36120,"38263":20915,"38264":34412,"38265":21668,"38266":21414,"38267":21030,"38268":26422,"38269":20001,"38270":21364,"38305":24313,"38306":21177,"38307":21647,"38308":24312,"38309":22956,"38310":24625,"38311":29248,"38312":33047,"38313":30267,"38314":24333,"38315":26187,"38316":26280,"38317":24932,"38318":25423,"38319":28895,"38320":27940,"38321":31911,"38322":31945,"38323":21465,"38324":25933,"38325":22338,"38326":29647,"38327":32966,"38328":13649,"38329":27445,"38330":30849,"38331":21452,"38332":29483,"38333":29482,"38334":29641,"38335":30026,"38336":23033,"38337":29124,"38338":29966,"38339":32220,"38340":39393,"38341":35241,"38342":28662,"38343":14935,"38344":25834,"38345":15341,"38346":27809,"38347":28284,"38348":30055,"38349":22633,"38350":22633,"38351":20996,"38352":59338,"38353":24967,"38354":25658,"38355":33263,"38356":59342,"38357":20917,"38358":20945,"38359":27769,"38360":22815,"38361":36857,"38362":39153,"38363":25911,"38364":33033,"38365":34996,"38366":14890,"38367":36525,"38368":32663,"38369":39440,"38370":32037,"38371":27336,"38372":20876,"38373":21031,"38374":59360,"38375":33050,"38376":21408,"38377":21410,"38378":27738,"38379":27703,"38380":33304,"38381":21894,"38382":24315,"38383":20937,"38384":30897,"38385":37474,"38386":21357,"38387":20931,"38388":59374,"38389":33905,"38390":35207,"38391":38765,"38392":35728,"38393":38563,"38394":24316,"38395":38583,"38396":20814,"38397":39952,"38398":26160,"38464":37461,"38465":30728,"38466":37701,"38467":37491,"38468":37737,"38469":59390,"38470":59391,"38471":59392,"38472":59393,"38473":37343,"38474":37338,"38475":30804,"38476":30822,"38477":30856,"38478":30902,"38479":30919,"38480":30930,"38481":30935,"38482":8491,"38483":8651,"38484":30948,"38485":30958,"38486":30960,"38487":30961,"38488":30965,"38489":31026,"38490":31027,"38491":31030,"38492":31064,"38493":12307,"38494":31065,"38495":31089,"38496":31102,"38497":31107,"38498":31110,"38499":31111,"38500":31121,"38501":31129,"38502":31135,"38503":31141,"38504":31202,"38505":31217,"38506":31220,"38507":31274,"38508":31290,"38509":31301,"38510":31333,"38511":31420,"38512":31426,"38513":31433,"38514":31451,"38515":31465,"38516":31486,"38517":31500,"38518":31527,"38519":31529,"38520":31554,"38521":31555,"38522":31573,"38523":31599,"38524":31666,"38525":27102,"38526":27129,"38561":37238,"38562":33114,"38563":33527,"38564":21579,"38565":33074,"38566":32957,"38567":33816,"38568":37214,"38569":37232,"38570":37260,"38571":33096,"38572":59459,"38573":17462,"38574":33113,"38575":32927,"38576":59463,"38577":21833,"38578":21537,"38579":21722,"38580":21554,"38581":21945,"38582":21652,"38583":59470,"38584":30802,"38585":30789,"38586":30796,"38587":59474,"38588":33981,"38589":33820,"38590":33476,"38591":59478,"38592":33915,"38593":35629,"38594":59481,"38595":22347,"38596":59483,"38597":59484,"38598":22341,"38599":34766,"38600":22112,"38601":21994,"38602":22139,"38603":32956,"38604":59491,"38605":30904,"38606":27148,"38607":21708,"38608":31696,"38609":31724,"38610":31738,"38611":31765,"38612":31771,"38613":31797,"38614":31812,"38615":31853,"38616":31886,"38617":31928,"38618":31939,"38619":31974,"38620":31981,"38621":31987,"38622":31989,"38623":31993,"38624":59511,"38625":31996,"38626":32139,"38627":32151,"38628":32164,"38629":32168,"38630":32205,"38631":32208,"38632":32211,"38633":32229,"38634":32253,"38635":27154,"38636":27170,"38637":27184,"38638":27190,"38639":27237,"38640":59527,"38641":59528,"38642":59529,"38643":59530,"38644":59531,"38645":59532,"38646":59533,"38647":59534,"38648":27251,"38649":27256,"38650":59537,"38651":59538,"38652":27260,"38653":27305,"38654":27306,"38720":9450,"38721":9312,"38722":9313,"38723":9314,"38724":9315,"38725":9316,"38726":9317,"38727":9318,"38728":9319,"38729":9320,"38730":9321,"38731":9322,"38732":9323,"38733":9324,"38734":9325,"38735":9326,"38736":9327,"38737":9328,"38738":9329,"38739":9330,"38740":9331,"38741":37700,"38742":37805,"38743":37830,"38744":37861,"38745":37914,"38746":37921,"38747":37950,"38748":37953,"38749":37971,"38750":37978,"38751":38042,"38752":38071,"38753":38104,"38754":38110,"38755":38131,"38756":38147,"38757":38158,"38758":38159,"38759":38168,"38760":38173,"38761":38186,"38762":38187,"38763":38207,"38764":38213,"38765":38222,"38766":38242,"38767":38245,"38768":38249,"38769":38258,"38770":38279,"38771":38297,"38772":38304,"38773":38322,"38774":38502,"38775":38557,"38776":38575,"38777":38578,"38778":38707,"38779":38715,"38780":38733,"38781":38735,"38782":38737,"38817":38741,"38818":38756,"38819":38763,"38820":38769,"38821":38802,"38822":38834,"38823":38898,"38824":38973,"38825":38996,"38826":39077,"38827":39107,"38828":39130,"38829":39150,"38830":39197,"38831":39200,"38832":39267,"38833":39296,"38834":39303,"38835":39309,"38836":39315,"38837":39317,"38838":39356,"38839":39368,"38840":39410,"38841":39606,"38842":39641,"38843":39646,"38844":39695,"38845":39753,"38846":39794,"38847":39811,"38848":39839,"38849":39867,"38850":39907,"38851":39925,"38852":39936,"38853":39940,"38854":39963,"38855":9398,"38856":9399,"38857":9400,"38858":9401,"38859":9402,"38860":9403,"38861":9404,"38862":9405,"38863":9406,"38864":9407,"38865":9408,"38866":9409,"38867":9410,"38868":9411,"38869":9412,"38870":9413,"38871":9414,"38872":9415,"38873":9416,"38874":9417,"38875":9418,"38876":9419,"38877":9420,"38878":9421,"38879":9422,"38880":9423,"38881":9424,"38882":9425,"38883":9426,"38884":9427,"38885":9428,"38886":9429,"38887":9430,"38888":9431,"38889":9432,"38890":9433,"38891":9434,"38892":9435,"38893":9436,"38894":9437,"38895":9438,"38896":9439,"38897":9440,"38898":9441,"38899":9442,"38900":9443,"38901":9444,"38902":9445,"38903":9446,"38904":9447,"38905":9448,"38906":9449,"38907":174,"38908":8482,"38909":59697,"38910":59698,"38976":40054,"38977":10122,"38978":10123,"38979":10124,"38980":10125,"38981":10126,"38982":10127,"38983":10128,"38984":10129,"38985":10130,"38986":10131,"38987":40069,"38988":40070,"38989":40071,"38990":40075,"38991":40080,"38992":40094,"38993":40110,"38994":40112,"38995":40114,"38996":40116,"38997":40122,"38998":40124,"38999":40125,"39000":40134,"39001":40135,"39002":40138,"39003":40139,"39004":40147,"39005":40152,"39006":40153,"39007":40162,"39008":40171,"39009":40172,"39010":40234,"39011":40264,"39012":40272,"39013":40314,"39014":40390,"39015":40523,"39016":40533,"39017":40539,"39018":40561,"39019":40618,"39020":40637,"39021":40644,"39022":40674,"39023":40682,"39024":40712,"39025":40715,"39026":40717,"39027":40737,"39028":40772,"39029":40785,"39030":40861,"39031":64014,"39032":64015,"39033":64017,"39034":64019,"39035":64020,"39036":64024,"39037":64031,"39038":64032,"39073":64033,"39074":64035,"39075":64036,"39076":64039,"39077":64040,"39078":64041,"39079":19972,"39080":20015,"39081":20097,"39082":20103,"39083":20131,"39084":20151,"39085":20156,"39086":20216,"39087":20264,"39088":20265,"39089":20279,"39090":20290,"39091":20293,"39092":20299,"39093":20338,"39094":20386,"39095":20400,"39096":20413,"39097":20424,"39098":20428,"39099":20464,"39100":20466,"39101":20473,"39102":20483,"39103":20488,"39104":20532,"39105":20539,"39106":20568,"39107":20582,"39108":20609,"39109":20624,"39110":20668,"39111":20688,"39112":20703,"39113":20705,"39114":20732,"39115":20749,"39116":20779,"39117":20832,"39118":20910,"39119":20920,"39120":20946,"39121":20962,"39122":20997,"39123":21044,"39124":21052,"39125":21081,"39126":21096,"39127":21113,"39128":21156,"39129":21196,"39130":21287,"39131":21314,"39132":21341,"39133":21373,"39134":21374,"39135":21445,"39136":21456,"39137":21458,"39138":21502,"39139":21613,"39140":21637,"39141":21651,"39142":21662,"39143":21689,"39144":21731,"39145":21743,"39146":21773,"39147":21784,"39148":21797,"39149":21800,"39150":21803,"39151":21831,"39152":21881,"39153":21904,"39154":21940,"39155":21953,"39156":21975,"39157":21976,"39158":22011,"39159":20404,"39160":22049,"39161":8707,"39162":22098,"39163":59852,"39164":9787,"39165":59854,"39166":59855,"39232":22109,"39233":9332,"39234":9333,"39235":9334,"39236":9335,"39237":9336,"39238":9337,"39239":9338,"39240":9339,"39241":9340,"39242":9341,"39243":9342,"39244":9343,"39245":9344,"39246":9345,"39247":9346,"39248":9347,"39249":9348,"39250":9349,"39251":9350,"39252":9351,"39253":22113,"39254":22153,"39255":22155,"39256":22174,"39257":22177,"39258":22193,"39259":22201,"39260":22207,"39261":22230,"39262":22255,"39263":22293,"39264":22301,"39265":22322,"39266":22333,"39267":22335,"39268":22339,"39269":8660,"39270":22398,"39271":22410,"39272":22413,"39273":22416,"39274":22428,"39275":22459,"39276":22462,"39277":22468,"39278":22494,"39279":22526,"39280":22546,"39281":22562,"39282":22599,"39283":22620,"39284":22623,"39285":22643,"39286":22695,"39287":22698,"39288":22704,"39289":22709,"39290":22710,"39291":22731,"39292":22736,"39293":22752,"39294":22789,"39329":22801,"39330":22921,"39331":22932,"39332":22938,"39333":22943,"39334":22960,"39335":22968,"39336":22980,"39337":23023,"39338":23024,"39339":23032,"39340":23042,"39341":23051,"39342":23053,"39343":23058,"39344":23073,"39345":23076,"39346":23079,"39347":23082,"39348":23083,"39349":23084,"39350":23101,"39351":23109,"39352":23124,"39353":23129,"39354":23137,"39355":23144,"39356":23147,"39357":23150,"39358":23153,"39359":23161,"39360":23166,"39361":23169,"39362":23170,"39363":23174,"39364":23176,"39365":23185,"39366":23193,"39367":23200,"39368":23201,"39369":23211,"39370":23235,"39371":23246,"39372":23247,"39373":23251,"39374":23268,"39375":23280,"39376":23294,"39377":23309,"39378":23313,"39379":23317,"39380":23327,"39381":23339,"39382":23361,"39383":23364,"39384":23366,"39385":23370,"39386":23375,"39387":23400,"39388":23412,"39389":23414,"39390":23420,"39391":23426,"39392":23440,"39393":9372,"39394":9373,"39395":9374,"39396":9375,"39397":9376,"39398":9377,"39399":9378,"39400":9379,"39401":9380,"39402":9381,"39403":9382,"39404":9383,"39405":9384,"39406":9385,"39407":9386,"39408":9387,"39409":9388,"39410":9389,"39411":9390,"39412":9391,"39413":9392,"39414":9393,"39415":9394,"39416":9395,"39417":9396,"39418":9397,"39419":60009,"39420":12850,"39421":12849,"39422":27307,"39488":23446,"39489":9352,"39490":9353,"39491":9354,"39492":9355,"39493":9356,"39494":9357,"39495":9358,"39496":9359,"39497":9360,"39498":9361,"39499":9362,"39500":9363,"39501":9364,"39502":9365,"39503":9366,"39504":9367,"39505":9368,"39506":9369,"39507":9370,"39508":9371,"39509":23509,"39510":23511,"39511":23587,"39512":23685,"39513":23710,"39514":23746,"39515":23824,"39516":23852,"39517":23855,"39518":23880,"39519":23894,"39520":23920,"39521":23931,"39522":23941,"39523":23972,"39524":23979,"39525":23990,"39526":24001,"39527":24023,"39528":24073,"39529":24136,"39530":24210,"39531":24253,"39532":24334,"39533":24434,"39534":24497,"39535":24514,"39536":24539,"39537":24543,"39538":24611,"39539":24702,"39540":24791,"39541":24839,"39542":24844,"39543":24857,"39544":24866,"39545":24912,"39546":24928,"39547":24961,"39548":24981,"39549":25017,"39550":25024,"39585":25039,"39586":25043,"39587":25050,"39588":25232,"39589":25393,"39590":8835,"39591":25399,"39592":25465,"39593":25483,"39594":25537,"39595":25570,"39596":25574,"39597":25595,"39598":25598,"39599":25607,"39600":25650,"39601":25656,"39602":25659,"39603":25690,"39604":25713,"39605":25724,"39606":25741,"39607":25775,"39608":25780,"39609":25782,"39610":25821,"39611":25829,"39612":25866,"39613":25873,"39614":25887,"39615":25951,"39616":25965,"39617":25990,"39618":26037,"39619":26046,"39620":26065,"39621":26068,"39622":26083,"39623":26111,"39624":26136,"39625":26147,"39626":26211,"39627":26219,"39628":26237,"39629":26245,"39630":26258,"39631":26266,"39632":26276,"39633":26285,"39634":26291,"39635":26294,"39636":26317,"39637":26318,"39638":26370,"39639":26380,"39640":26393,"39641":26436,"39642":26475,"39643":26511,"39644":26532,"39645":26559,"39646":26582,"39647":26583,"39648":8834,"39649":26637,"39650":26640,"39651":26651,"39652":26678,"39653":26695,"39654":26710,"39655":26756,"39656":26760,"39657":26813,"39658":26819,"39659":26821,"39660":26882,"39661":26883,"39662":26889,"39663":26904,"39664":26947,"39665":26950,"39666":26980,"39667":26983,"39668":26994,"39669":27013,"39670":27039,"39671":27042,"39672":27089,"39673":27093,"39674":27094,"39675":39457,"39676":39462,"39677":39471,"39678":27329,"39744":22975,"39745":27105,"39746":27139,"39747":27162,"39748":27164,"39749":27180,"39750":27181,"39751":27187,"39752":27203,"39753":27205,"39754":27212,"39755":27219,"39756":27223,"39757":27235,"39758":27252,"39759":27266,"39760":27274,"39761":27279,"39762":27289,"39763":27303,"39764":27313,"39765":27317,"39766":27326,"39767":27337,"39768":27348,"39769":27352,"39770":27382,"39771":27479,"39772":27514,"39773":27612,"39774":27676,"39775":27697,"39776":27736,"39777":27758,"39778":27765,"39779":27775,"39780":27823,"39781":27851,"39782":27871,"39783":27903,"39784":27906,"39785":27909,"39786":27910,"39787":27942,"39788":27991,"39789":27995,"39790":28017,"39791":28033,"39792":28047,"39793":28069,"39794":28081,"39795":28158,"39796":28162,"39797":28164,"39798":28175,"39799":28184,"39800":28202,"39801":28240,"39802":28249,"39803":28314,"39804":28341,"39805":28344,"39806":28379,"39841":28410,"39842":28420,"39843":28427,"39844":28428,"39845":28438,"39846":28439,"39847":28468,"39848":28477,"39849":28502,"39850":28537,"39851":28554,"39852":28573,"39853":28575,"39854":28603,"39855":28606,"39856":28627,"39857":28633,"39858":28664,"39859":28675,"39860":28747,"39861":28749,"39862":28752,"39863":28756,"39864":28764,"39865":28775,"39866":28791,"39867":28793,"39868":28811,"39869":28815,"39870":28832,"39871":28835,"39872":28837,"39873":28838,"39874":28839,"39875":28868,"39876":28876,"39877":28880,"39878":28886,"39879":618,"39880":603,"39881":230,"39882":652,"39883":593,"39884":596,"39885":650,"39886":605,"39887":601,"39888":602,"39889":604,"39890":609,"39891":7747,"39892":7753,"39893":330,"39894":7739,"39895":629,"39896":240,"39897":643,"39898":658,"39899":679,"39900":676,"39901":227,"39902":60294,"39903":60295,"39904":623,"39905":632,"39906":647,"39907":60299,"39908":199,"39909":339,"39910":594,"39911":65351,"39912":715,"39913":719,"39914":65345,"39915":65346,"39916":65348,"39917":65349,"39918":65350,"39919":65352,"39920":65353,"39921":65354,"39922":65355,"39923":65356,"39924":65357,"39925":65358,"39926":65359,"39927":65360,"39928":65362,"39929":65363,"39930":65364,"39931":65365,"39932":65366,"39933":65367,"39934":65370,"40000":28917,"40001":12832,"40002":12833,"40003":12834,"40004":12835,"40005":12836,"40006":12837,"40007":12838,"40008":12839,"40009":12840,"40010":12841,"40011":28926,"40012":28933,"40013":28957,"40014":28969,"40015":28971,"40016":28972,"40017":28979,"40018":28981,"40019":28987,"40020":28990,"40021":28992,"40022":29007,"40023":29035,"40024":29045,"40025":29047,"40026":29052,"40027":29054,"40028":29068,"40029":29070,"40030":29073,"40031":29078,"40032":29090,"40033":29091,"40034":29101,"40035":29108,"40036":29111,"40037":29114,"40038":29137,"40039":29149,"40040":29163,"40041":29184,"40042":29193,"40043":29198,"40044":29199,"40045":29206,"40046":29207,"40047":29220,"40048":23204,"40049":29230,"40050":8838,"40051":29271,"40052":29276,"40053":29332,"40054":29444,"40055":29456,"40056":29505,"40057":29556,"40058":29580,"40059":29583,"40060":29592,"40061":29596,"40062":29598,"40097":29607,"40098":29610,"40099":29653,"40100":29665,"40101":29666,"40102":29668,"40103":29670,"40104":29679,"40105":29683,"40106":8839,"40107":29689,"40108":29691,"40109":29698,"40110":29713,"40111":29714,"40112":29716,"40113":29717,"40114":29719,"40115":29721,"40116":29724,"40117":29726,"40118":29727,"40119":29751,"40120":29752,"40121":29753,"40122":29763,"40123":29765,"40124":29767,"40125":29768,"40126":29769,"40127":29779,"40128":29782,"40129":29797,"40130":29803,"40131":29804,"40132":29812,"40133":29818,"40134":29826,"40135":21378,"40136":24191,"40137":20008,"40138":24186,"40139":20886,"40140":23424,"40141":21353,"40142":11911,"40143":60436,"40144":21251,"40145":9746,"40146":33401,"40147":17553,"40148":11916,"40149":11914,"40150":20022,"40151":60444,"40152":21274,"40153":60446,"40154":60447,"40155":11925,"40156":60449,"40157":60450,"40158":9492,"40159":20058,"40160":36790,"40161":24308,"40162":20872,"40163":20101,"40164":60457,"40165":20031,"40166":60459,"40167":60460,"40168":20059,"40169":21430,"40170":36710,"40171":32415,"40172":35744,"40173":36125,"40174":40479,"40175":38376,"40176":38021,"40177":38429,"40178":25164,"40179":27701,"40180":20155,"40181":24516,"40182":28780,"40183":11950,"40184":21475,"40185":27362,"40186":39483,"40187":39484,"40188":39512,"40189":39516,"40190":39523,"40256":9742,"40257":8594,"40258":8592,"40259":8593,"40260":8595,"40261":8680,"40262":8678,"40263":8679,"40264":8681,"40265":8680,"40266":8678,"40267":8679,"40268":8681,"40269":9758,"40270":9756,"40271":9755,"40272":9759,"40273":12310,"40274":12311,"40275":9675,"40276":10005,"40277":10003,"40278":22267,"40279":9789,"40280":22813,"40281":26189,"40282":29221,"40283":10025,"40284":10017,"40285":9786,"40286":9785,"40287":60515,"40288":60516,"40289":60517,"40290":60518,"40291":60519,"40292":23672,"40293":9836,"40294":9834,"40295":23249,"40296":23479,"40297":23804,"40298":60526,"40299":9993,"40300":9986,"40301":60529,"40302":60530,"40303":60531,"40304":60532,"40305":23765,"40306":26478,"40307":29793,"40308":29853,"40309":32595,"40310":34195,"40311":10063,"40312":60540,"40313":60541,"40314":23928,"40315":24379,"40316":60544,"40317":9473,"40318":9475,"40353":60547,"40354":60548,"40355":60549,"40356":60550,"40357":60551,"40358":60552,"40359":60553,"40360":60554,"40361":60555,"40362":60556,"40363":60557,"40364":60558,"40365":60559,"40366":60560,"40367":60561,"40368":39602,"40369":39648,"40370":39700,"40371":39732,"40372":39737,"40373":39744,"40374":39760,"40375":39807,"40376":9788,"40377":32149,"40378":9729,"40379":38708,"40380":9730,"40381":60575,"40382":60576,"40383":60577,"40384":9992,"40385":60579,"40386":60580,"40387":60581,"40388":60582,"40389":60583,"40390":60584,"40391":60585,"40392":8507,"40393":8481,"40394":26343,"40395":28247,"40396":60590,"40397":29015,"40398":31178,"40399":8470,"40400":33132,"40401":35577,"40402":38998,"40403":60597,"40404":60598,"40405":9760,"40406":60600,"40407":9828,"40408":9824,"40409":9831,"40410":9827,"40411":9826,"40412":9830,"40413":9825,"40414":9829,"40415":60609,"40416":60610,"40417":27364,"40418":8478,"40419":13250,"40420":13272,"40421":13217,"40422":60616,"40423":13221,"40424":60618,"40425":60619,"40426":60620,"40427":60621,"40428":60622,"40429":9745,"40430":39809,"40431":39819,"40432":39821,"40433":39901,"40434":39913,"40435":39917,"40436":39924,"40437":39967,"40438":39968,"40439":39974,"40440":40019,"40441":40029,"40442":40059,"40443":40204,"40444":40214,"40445":8626,"40446":27397,"40512":36073,"40513":36082,"40514":36099,"40515":36113,"40516":36124,"40517":36218,"40518":36265,"40519":36288,"40520":36353,"40521":36366,"40522":36422,"40523":36456,"40524":36465,"40525":36478,"40526":36480,"40527":36534,"40528":36537,"40529":36540,"40530":36547,"40531":36580,"40532":36589,"40533":36594,"40534":36656,"40535":36673,"40536":36682,"40537":36773,"40538":36787,"40539":36792,"40540":36810,"40541":36815,"40542":36872,"40543":36915,"40544":36919,"40545":36964,"40546":36972,"40547":37289,"40548":37302,"40549":37316,"40550":37370,"40551":37384,"40552":37395,"40553":37409,"40554":37416,"40555":37419,"40556":37429,"40557":37436,"40558":37441,"40559":37464,"40560":37469,"40561":37471,"40562":37483,"40563":37486,"40564":37505,"40565":37508,"40566":37513,"40567":37519,"40568":37553,"40569":37562,"40570":37567,"40571":37588,"40572":37595,"40573":37603,"40574":37605,"40609":37611,"40610":37612,"40611":37620,"40612":37622,"40613":37629,"40614":37635,"40615":37639,"40616":37680,"40617":37681,"40618":37696,"40619":37698,"40620":37699,"40621":37727,"40622":37730,"40623":37734,"40624":37736,"40625":37747,"40626":37748,"40627":37752,"40628":37757,"40629":37761,"40630":37764,"40631":37766,"40632":37767,"40633":37776,"40634":37788,"40635":37792,"40636":37816,"40637":37819,"40638":37821,"40639":37823,"40640":37835,"40641":37843,"40642":37851,"40643":37856,"40644":37872,"40645":37873,"40646":37875,"40647":37876,"40648":37889,"40649":37892,"40650":37896,"40651":37911,"40652":37915,"40653":37917,"40654":37924,"40655":37925,"40656":37926,"40657":37933,"40658":37954,"40659":37955,"40660":37965,"40661":37972,"40662":37976,"40663":37989,"40664":37991,"40665":37996,"40666":38009,"40667":38011,"40668":38264,"40669":38277,"40670":38310,"40671":38314,"40672":38486,"40673":38523,"40674":38565,"40675":38644,"40676":38683,"40677":38710,"40678":38720,"40679":38721,"40680":38743,"40681":38791,"40682":38793,"40683":38811,"40684":38833,"40685":38845,"40686":38848,"40687":38850,"40688":38866,"40689":38880,"40690":38932,"40691":38933,"40692":38947,"40693":38963,"40694":39016,"40695":39095,"40696":39097,"40697":39111,"40698":39114,"40699":39136,"40700":39137,"40701":39148,"40702":39157,"40768":40225,"40769":40244,"40770":40249,"40771":40265,"40772":40270,"40773":40301,"40774":8759,"40775":40302,"40776":40316,"40777":40323,"40778":40339,"40779":40357,"40780":8748,"40781":40381,"40782":27521,"40783":27569,"40784":40015,"40785":40592,"40786":40384,"40787":60817,"40788":60818,"40789":9775,"40790":9776,"40791":9783,"40792":9779,"40793":9780,"40794":9781,"40795":9778,"40796":9782,"40797":9777,"40798":40393,"40799":40404,"40800":40444,"40801":40458,"40802":40460,"40803":40462,"40804":40472,"40805":40571,"40806":40581,"40807":40610,"40808":40620,"40809":40625,"40810":40641,"40811":40646,"40812":40647,"40813":40689,"40814":40696,"40815":40743,"40816":39182,"40817":39193,"40818":39196,"40819":39223,"40820":39261,"40821":39266,"40822":39323,"40823":39332,"40824":39338,"40825":39352,"40826":39392,"40827":39398,"40828":39413,"40829":39455,"40830":32254,"40865":32263,"40866":32347,"40867":32357,"40868":32364,"40869":32567,"40870":32576,"40871":32577,"40872":32585,"40873":32594,"40874":32655,"40875":32659,"40876":32692,"40877":32733,"40878":32743,"40879":32762,"40880":32770,"40881":32776,"40882":32814,"40883":32815,"40884":32828,"40885":32935,"40886":33036,"40887":33066,"40888":33076,"40889":33090,"40890":33110,"40891":33156,"40892":33189,"40893":33252,"40894":33364,"40895":33381,"40896":33403,"40897":33415,"40898":33471,"40899":33506,"40900":33518,"40901":33528,"40902":33532,"40903":33535,"40904":33547,"40905":33565,"40906":33597,"40907":33623,"40908":33681,"40909":33708,"40910":33741,"40911":33773,"40912":33797,"40913":33812,"40914":33814,"40915":33825,"40916":33838,"40917":33854,"40918":33866,"40919":33875,"40920":33877,"40921":33880,"40922":33892,"40923":33906,"40924":33919,"40925":33920,"40926":33938,"40927":33939,"40928":33942,"40929":33955,"40930":33982,"40931":34014,"40932":34017,"40933":34018,"40934":34020,"40935":34040,"40936":34051,"40937":34053,"40938":34064,"40939":34099,"40940":8208,"40941":34114,"40942":34124,"40943":34130,"40944":34143,"40945":34159,"40946":34160,"40947":34163,"40948":34262,"40949":34272,"40950":34286,"40951":34300,"40952":34317,"40953":34319,"40954":34324,"40955":34344,"40956":34370,"40957":34373,"40958":34418,"41024":34972,"41025":23405,"41026":33079,"41027":60958,"41028":39224,"41029":21874,"41030":21867,"41031":60962,"41032":13774,"41033":21873,"41034":21946,"41035":22001,"41036":13778,"41037":22000,"41038":22021,"41039":22050,"41040":22061,"41041":22083,"41042":22046,"41043":22162,"41044":31949,"41045":21530,"41046":21523,"41047":21655,"41048":26353,"41049":30004,"41050":21581,"41051":22180,"41052":22175,"41053":25811,"41054":25390,"41055":25592,"41056":25886,"41057":20088,"41058":27626,"41059":27698,"41060":27709,"41061":27746,"41062":27826,"41063":28152,"41064":28201,"41065":28278,"41066":28290,"41067":28294,"41068":28347,"41069":28383,"41070":28386,"41071":28433,"41072":28452,"41073":28532,"41074":28561,"41075":28597,"41076":28659,"41077":28661,"41078":28859,"41079":28864,"41080":28943,"41081":8706,"41082":29013,"41083":29043,"41084":29050,"41085":61016,"41086":21027,"41121":61018,"41122":13393,"41123":61020,"41124":36812,"41125":61022,"41126":61023,"41127":192,"41128":200,"41129":204,"41130":210,"41131":217,"41132":193,"41133":205,"41134":211,"41135":218,"41136":257,"41137":275,"41138":299,"41139":333,"41140":363,"41141":470,"41142":196,"41143":203,"41144":207,"41145":214,"41146":220,"41147":198,"41148":199,"41149":209,"41150":195,"41151":213,"41152":225,"41153":233,"41154":237,"41155":243,"41156":250,"41157":472,"41158":228,"41159":235,"41160":239,"41161":246,"41162":252,"41163":230,"41164":231,"41165":241,"41166":227,"41167":245,"41168":462,"41169":283,"41170":464,"41171":466,"41172":468,"41173":474,"41174":197,"41175":201,"41176":29064,"41177":216,"41178":208,"41179":7922,"41180":222,"41181":223,"41182":170,"41183":161,"41184":224,"41185":232,"41186":236,"41187":242,"41188":249,"41189":476,"41190":229,"41191":29080,"41192":29143,"41193":248,"41194":240,"41195":7923,"41196":254,"41197":255,"41198":186,"41199":191,"41200":226,"41201":234,"41202":238,"41203":244,"41204":251,"41205":29173,"41206":194,"41207":202,"41208":206,"41209":212,"41210":219,"41211":184,"41212":164,"41213":61110,"41214":402,"41280":12288,"41281":65292,"41282":12289,"41283":12290,"41284":65294,"41285":8231,"41286":65307,"41287":65306,"41288":65311,"41289":65281,"41290":65072,"41291":8230,"41292":8229,"41293":65104,"41294":65105,"41295":65106,"41296":183,"41297":65108,"41298":65109,"41299":65110,"41300":65111,"41301":65372,"41302":8211,"41303":65073,"41304":8212,"41305":65075,"41306":9588,"41307":65076,"41308":65103,"41309":65288,"41310":65289,"41311":65077,"41312":65078,"41313":65371,"41314":65373,"41315":65079,"41316":65080,"41317":12308,"41318":12309,"41319":65081,"41320":65082,"41321":12304,"41322":12305,"41323":65083,"41324":65084,"41325":12298,"41326":12299,"41327":65085,"41328":65086,"41329":12296,"41330":12297,"41331":65087,"41332":65088,"41333":12300,"41334":12301,"41335":65089,"41336":65090,"41337":12302,"41338":12303,"41339":65091,"41340":65092,"41341":65113,"41342":65114,"41377":65115,"41378":65116,"41379":65117,"41380":65118,"41381":8216,"41382":8217,"41383":8220,"41384":8221,"41385":12317,"41386":12318,"41387":8245,"41388":8242,"41389":65283,"41390":65286,"41391":65290,"41392":8251,"41393":167,"41394":12291,"41395":9675,"41396":9679,"41397":9651,"41398":9650,"41399":9678,"41400":9734,"41401":9733,"41402":9671,"41403":9670,"41404":9633,"41405":9632,"41406":9661,"41407":9660,"41408":12963,"41409":8453,"41410":175,"41411":65507,"41412":65343,"41413":717,"41414":65097,"41415":65098,"41416":65101,"41417":65102,"41418":65099,"41419":65100,"41420":65119,"41421":65120,"41422":65121,"41423":65291,"41424":65293,"41425":215,"41426":247,"41427":177,"41428":8730,"41429":65308,"41430":65310,"41431":65309,"41432":8806,"41433":8807,"41434":8800,"41435":8734,"41436":8786,"41437":8801,"41438":65122,"41439":65123,"41440":65124,"41441":65125,"41442":65126,"41443":65374,"41444":8745,"41445":8746,"41446":8869,"41447":8736,"41448":8735,"41449":8895,"41450":13266,"41451":13265,"41452":8747,"41453":8750,"41454":8757,"41455":8756,"41456":9792,"41457":9794,"41458":8853,"41459":8857,"41460":8593,"41461":8595,"41462":8592,"41463":8594,"41464":8598,"41465":8599,"41466":8601,"41467":8600,"41468":8741,"41469":8739,"41470":65295,"41536":65340,"41537":8725,"41538":65128,"41539":65284,"41540":65509,"41541":12306,"41542":65504,"41543":65505,"41544":65285,"41545":65312,"41546":8451,"41547":8457,"41548":65129,"41549":65130,"41550":65131,"41551":13269,"41552":13212,"41553":13213,"41554":13214,"41555":13262,"41556":13217,"41557":13198,"41558":13199,"41559":13252,"41560":176,"41561":20825,"41562":20827,"41563":20830,"41564":20829,"41565":20833,"41566":20835,"41567":21991,"41568":29929,"41569":31950,"41570":9601,"41571":9602,"41572":9603,"41573":9604,"41574":9605,"41575":9606,"41576":9607,"41577":9608,"41578":9615,"41579":9614,"41580":9613,"41581":9612,"41582":9611,"41583":9610,"41584":9609,"41585":9532,"41586":9524,"41587":9516,"41588":9508,"41589":9500,"41590":9620,"41591":9472,"41592":9474,"41593":9621,"41594":9484,"41595":9488,"41596":9492,"41597":9496,"41598":9581,"41633":9582,"41634":9584,"41635":9583,"41636":9552,"41637":9566,"41638":9578,"41639":9569,"41640":9698,"41641":9699,"41642":9701,"41643":9700,"41644":9585,"41645":9586,"41646":9587,"41647":65296,"41648":65297,"41649":65298,"41650":65299,"41651":65300,"41652":65301,"41653":65302,"41654":65303,"41655":65304,"41656":65305,"41657":8544,"41658":8545,"41659":8546,"41660":8547,"41661":8548,"41662":8549,"41663":8550,"41664":8551,"41665":8552,"41666":8553,"41667":12321,"41668":12322,"41669":12323,"41670":12324,"41671":12325,"41672":12326,"41673":12327,"41674":12328,"41675":12329,"41676":21313,"41677":21316,"41678":21317,"41679":65313,"41680":65314,"41681":65315,"41682":65316,"41683":65317,"41684":65318,"41685":65319,"41686":65320,"41687":65321,"41688":65322,"41689":65323,"41690":65324,"41691":65325,"41692":65326,"41693":65327,"41694":65328,"41695":65329,"41696":65330,"41697":65331,"41698":65332,"41699":65333,"41700":65334,"41701":65335,"41702":65336,"41703":65337,"41704":65338,"41705":65345,"41706":65346,"41707":65347,"41708":65348,"41709":65349,"41710":65350,"41711":65351,"41712":65352,"41713":65353,"41714":65354,"41715":65355,"41716":65356,"41717":65357,"41718":65358,"41719":65359,"41720":65360,"41721":65361,"41722":65362,"41723":65363,"41724":65364,"41725":65365,"41726":65366,"41792":65367,"41793":65368,"41794":65369,"41795":65370,"41796":913,"41797":914,"41798":915,"41799":916,"41800":917,"41801":918,"41802":919,"41803":920,"41804":921,"41805":922,"41806":923,"41807":924,"41808":925,"41809":926,"41810":927,"41811":928,"41812":929,"41813":931,"41814":932,"41815":933,"41816":934,"41817":935,"41818":936,"41819":937,"41820":945,"41821":946,"41822":947,"41823":948,"41824":949,"41825":950,"41826":951,"41827":952,"41828":953,"41829":954,"41830":955,"41831":956,"41832":957,"41833":958,"41834":959,"41835":960,"41836":961,"41837":963,"41838":964,"41839":965,"41840":966,"41841":967,"41842":968,"41843":969,"41844":12549,"41845":12550,"41846":12551,"41847":12552,"41848":12553,"41849":12554,"41850":12555,"41851":12556,"41852":12557,"41853":12558,"41854":12559,"41889":12560,"41890":12561,"41891":12562,"41892":12563,"41893":12564,"41894":12565,"41895":12566,"41896":12567,"41897":12568,"41898":12569,"41899":12570,"41900":12571,"41901":12572,"41902":12573,"41903":12574,"41904":12575,"41905":12576,"41906":12577,"41907":12578,"41908":12579,"41909":12580,"41910":12581,"41911":12582,"41912":12583,"41913":12584,"41914":12585,"41915":729,"41916":713,"41917":714,"41918":711,"41919":715,"41920":9216,"41921":9217,"41922":9218,"41923":9219,"41924":9220,"41925":9221,"41926":9222,"41927":9223,"41928":9224,"41929":9225,"41930":9226,"41931":9227,"41932":9228,"41933":9229,"41934":9230,"41935":9231,"41936":9232,"41937":9233,"41938":9234,"41939":9235,"41940":9236,"41941":9237,"41942":9238,"41943":9239,"41944":9240,"41945":9241,"41946":9242,"41947":9243,"41948":9244,"41949":9245,"41950":9246,"41951":9247,"41952":9249,"41953":8364,"41954":63561,"41955":63562,"41956":63563,"41957":63564,"41958":63565,"41959":63566,"41960":63567,"41961":63568,"41962":63569,"41963":63570,"41964":63571,"41965":63572,"41966":63573,"41967":63574,"41968":63575,"41969":63576,"41970":63577,"41971":63578,"41972":63579,"41973":63580,"41974":63581,"41975":63582,"41976":63583,"41977":63584,"41978":63585,"41979":63586,"41980":63587,"41981":63588,"41982":63589,"42048":19968,"42049":20057,"42050":19969,"42051":19971,"42052":20035,"42053":20061,"42054":20102,"42055":20108,"42056":20154,"42057":20799,"42058":20837,"42059":20843,"42060":20960,"42061":20992,"42062":20993,"42063":21147,"42064":21269,"42065":21313,"42066":21340,"42067":21448,"42068":19977,"42069":19979,"42070":19976,"42071":19978,"42072":20011,"42073":20024,"42074":20961,"42075":20037,"42076":20040,"42077":20063,"42078":20062,"42079":20110,"42080":20129,"42081":20800,"42082":20995,"42083":21242,"42084":21315,"42085":21449,"42086":21475,"42087":22303,"42088":22763,"42089":22805,"42090":22823,"42091":22899,"42092":23376,"42093":23377,"42094":23379,"42095":23544,"42096":23567,"42097":23586,"42098":23608,"42099":23665,"42100":24029,"42101":24037,"42102":24049,"42103":24050,"42104":24051,"42105":24062,"42106":24178,"42107":24318,"42108":24331,"42109":24339,"42110":25165,"42145":19985,"42146":19984,"42147":19981,"42148":20013,"42149":20016,"42150":20025,"42151":20043,"42152":23609,"42153":20104,"42154":20113,"42155":20117,"42156":20114,"42157":20116,"42158":20130,"42159":20161,"42160":20160,"42161":20163,"42162":20166,"42163":20167,"42164":20173,"42165":20170,"42166":20171,"42167":20164,"42168":20803,"42169":20801,"42170":20839,"42171":20845,"42172":20846,"42173":20844,"42174":20887,"42175":20982,"42176":20998,"42177":20999,"42178":21000,"42179":21243,"42180":21246,"42181":21247,"42182":21270,"42183":21305,"42184":21320,"42185":21319,"42186":21317,"42187":21342,"42188":21380,"42189":21451,"42190":21450,"42191":21453,"42192":22764,"42193":22825,"42194":22827,"42195":22826,"42196":22829,"42197":23380,"42198":23569,"42199":23588,"42200":23610,"42201":23663,"42202":24052,"42203":24187,"42204":24319,"42205":24340,"42206":24341,"42207":24515,"42208":25096,"42209":25142,"42210":25163,"42211":25166,"42212":25903,"42213":25991,"42214":26007,"42215":26020,"42216":26041,"42217":26085,"42218":26352,"42219":26376,"42220":26408,"42221":27424,"42222":27490,"42223":27513,"42224":27595,"42225":27604,"42226":27611,"42227":27663,"42228":27700,"42229":28779,"42230":29226,"42231":29238,"42232":29243,"42233":29255,"42234":29273,"42235":29275,"42236":29356,"42237":29579,"42238":19993,"42304":19990,"42305":19989,"42306":19988,"42307":19992,"42308":20027,"42309":20045,"42310":20047,"42311":20046,"42312":20197,"42313":20184,"42314":20180,"42315":20181,"42316":20182,"42317":20183,"42318":20195,"42319":20196,"42320":20185,"42321":20190,"42322":20805,"42323":20804,"42324":20873,"42325":20874,"42326":20908,"42327":20985,"42328":20986,"42329":20984,"42330":21002,"42331":21152,"42332":21151,"42333":21253,"42334":21254,"42335":21271,"42336":21277,"42337":20191,"42338":21322,"42339":21321,"42340":21345,"42341":21344,"42342":21359,"42343":21358,"42344":21435,"42345":21487,"42346":21476,"42347":21491,"42348":21484,"42349":21486,"42350":21481,"42351":21480,"42352":21500,"42353":21496,"42354":21493,"42355":21483,"42356":21478,"42357":21482,"42358":21490,"42359":21489,"42360":21488,"42361":21477,"42362":21485,"42363":21499,"42364":22235,"42365":22234,"42366":22806,"42401":22830,"42402":22833,"42403":22900,"42404":22902,"42405":23381,"42406":23427,"42407":23612,"42408":24040,"42409":24039,"42410":24038,"42411":24066,"42412":24067,"42413":24179,"42414":24188,"42415":24321,"42416":24344,"42417":24343,"42418":24517,"42419":25098,"42420":25171,"42421":25172,"42422":25170,"42423":25169,"42424":26021,"42425":26086,"42426":26414,"42427":26412,"42428":26410,"42429":26411,"42430":26413,"42431":27491,"42432":27597,"42433":27665,"42434":27664,"42435":27704,"42436":27713,"42437":27712,"42438":27710,"42439":29359,"42440":29572,"42441":29577,"42442":29916,"42443":29926,"42444":29976,"42445":29983,"42446":29992,"42447":29993,"42448":30000,"42449":30001,"42450":30002,"42451":30003,"42452":30091,"42453":30333,"42454":30382,"42455":30399,"42456":30446,"42457":30683,"42458":30690,"42459":30707,"42460":31034,"42461":31166,"42462":31348,"42463":31435,"42464":19998,"42465":19999,"42466":20050,"42467":20051,"42468":20073,"42469":20121,"42470":20132,"42471":20134,"42472":20133,"42473":20223,"42474":20233,"42475":20249,"42476":20234,"42477":20245,"42478":20237,"42479":20240,"42480":20241,"42481":20239,"42482":20210,"42483":20214,"42484":20219,"42485":20208,"42486":20211,"42487":20221,"42488":20225,"42489":20235,"42490":20809,"42491":20807,"42492":20806,"42493":20808,"42494":20840,"42560":20849,"42561":20877,"42562":20912,"42563":21015,"42564":21009,"42565":21010,"42566":21006,"42567":21014,"42568":21155,"42569":21256,"42570":21281,"42571":21280,"42572":21360,"42573":21361,"42574":21513,"42575":21519,"42576":21516,"42577":21514,"42578":21520,"42579":21505,"42580":21515,"42581":21508,"42582":21521,"42583":21517,"42584":21512,"42585":21507,"42586":21518,"42587":21510,"42588":21522,"42589":22240,"42590":22238,"42591":22237,"42592":22323,"42593":22320,"42594":22312,"42595":22317,"42596":22316,"42597":22319,"42598":22313,"42599":22809,"42600":22810,"42601":22839,"42602":22840,"42603":22916,"42604":22904,"42605":22915,"42606":22909,"42607":22905,"42608":22914,"42609":22913,"42610":23383,"42611":23384,"42612":23431,"42613":23432,"42614":23429,"42615":23433,"42616":23546,"42617":23574,"42618":23673,"42619":24030,"42620":24070,"42621":24182,"42622":24180,"42657":24335,"42658":24347,"42659":24537,"42660":24534,"42661":25102,"42662":25100,"42663":25101,"42664":25104,"42665":25187,"42666":25179,"42667":25176,"42668":25910,"42669":26089,"42670":26088,"42671":26092,"42672":26093,"42673":26354,"42674":26355,"42675":26377,"42676":26429,"42677":26420,"42678":26417,"42679":26421,"42680":27425,"42681":27492,"42682":27515,"42683":27670,"42684":27741,"42685":27735,"42686":27737,"42687":27743,"42688":27744,"42689":27728,"42690":27733,"42691":27745,"42692":27739,"42693":27725,"42694":27726,"42695":28784,"42696":29279,"42697":29277,"42698":30334,"42699":31481,"42700":31859,"42701":31992,"42702":32566,"42703":32650,"42704":32701,"42705":32769,"42706":32771,"42707":32780,"42708":32786,"42709":32819,"42710":32895,"42711":32905,"42712":32907,"42713":32908,"42714":33251,"42715":33258,"42716":33267,"42717":33276,"42718":33292,"42719":33307,"42720":33311,"42721":33390,"42722":33394,"42723":33406,"42724":34411,"42725":34880,"42726":34892,"42727":34915,"42728":35199,"42729":38433,"42730":20018,"42731":20136,"42732":20301,"42733":20303,"42734":20295,"42735":20311,"42736":20318,"42737":20276,"42738":20315,"42739":20309,"42740":20272,"42741":20304,"42742":20305,"42743":20285,"42744":20282,"42745":20280,"42746":20291,"42747":20308,"42748":20284,"42749":20294,"42750":20323,"42816":20316,"42817":20320,"42818":20271,"42819":20302,"42820":20278,"42821":20313,"42822":20317,"42823":20296,"42824":20314,"42825":20812,"42826":20811,"42827":20813,"42828":20853,"42829":20918,"42830":20919,"42831":21029,"42832":21028,"42833":21033,"42834":21034,"42835":21032,"42836":21163,"42837":21161,"42838":21162,"42839":21164,"42840":21283,"42841":21363,"42842":21365,"42843":21533,"42844":21549,"42845":21534,"42846":21566,"42847":21542,"42848":21582,"42849":21543,"42850":21574,"42851":21571,"42852":21555,"42853":21576,"42854":21570,"42855":21531,"42856":21545,"42857":21578,"42858":21561,"42859":21563,"42860":21560,"42861":21550,"42862":21557,"42863":21558,"42864":21536,"42865":21564,"42866":21568,"42867":21553,"42868":21547,"42869":21535,"42870":21548,"42871":22250,"42872":22256,"42873":22244,"42874":22251,"42875":22346,"42876":22353,"42877":22336,"42878":22349,"42913":22343,"42914":22350,"42915":22334,"42916":22352,"42917":22351,"42918":22331,"42919":22767,"42920":22846,"42921":22941,"42922":22930,"42923":22952,"42924":22942,"42925":22947,"42926":22937,"42927":22934,"42928":22925,"42929":22948,"42930":22931,"42931":22922,"42932":22949,"42933":23389,"42934":23388,"42935":23386,"42936":23387,"42937":23436,"42938":23435,"42939":23439,"42940":23596,"42941":23616,"42942":23617,"42943":23615,"42944":23614,"42945":23696,"42946":23697,"42947":23700,"42948":23692,"42949":24043,"42950":24076,"42951":24207,"42952":24199,"42953":24202,"42954":24311,"42955":24324,"42956":24351,"42957":24420,"42958":24418,"42959":24439,"42960":24441,"42961":24536,"42962":24524,"42963":24535,"42964":24525,"42965":24561,"42966":24555,"42967":24568,"42968":24554,"42969":25106,"42970":25105,"42971":25220,"42972":25239,"42973":25238,"42974":25216,"42975":25206,"42976":25225,"42977":25197,"42978":25226,"42979":25212,"42980":25214,"42981":25209,"42982":25203,"42983":25234,"42984":25199,"42985":25240,"42986":25198,"42987":25237,"42988":25235,"42989":25233,"42990":25222,"42991":25913,"42992":25915,"42993":25912,"42994":26097,"42995":26356,"42996":26463,"42997":26446,"42998":26447,"42999":26448,"43000":26449,"43001":26460,"43002":26454,"43003":26462,"43004":26441,"43005":26438,"43006":26464,"43072":26451,"43073":26455,"43074":27493,"43075":27599,"43076":27714,"43077":27742,"43078":27801,"43079":27777,"43080":27784,"43081":27785,"43082":27781,"43083":27803,"43084":27754,"43085":27770,"43086":27792,"43087":27760,"43088":27788,"43089":27752,"43090":27798,"43091":27794,"43092":27773,"43093":27779,"43094":27762,"43095":27774,"43096":27764,"43097":27782,"43098":27766,"43099":27789,"43100":27796,"43101":27800,"43102":27778,"43103":28790,"43104":28796,"43105":28797,"43106":28792,"43107":29282,"43108":29281,"43109":29280,"43110":29380,"43111":29378,"43112":29590,"43113":29996,"43114":29995,"43115":30007,"43116":30008,"43117":30338,"43118":30447,"43119":30691,"43120":31169,"43121":31168,"43122":31167,"43123":31350,"43124":31995,"43125":32597,"43126":32918,"43127":32915,"43128":32925,"43129":32920,"43130":32923,"43131":32922,"43132":32946,"43133":33391,"43134":33426,"43169":33419,"43170":33421,"43171":35211,"43172":35282,"43173":35328,"43174":35895,"43175":35910,"43176":35925,"43177":35997,"43178":36196,"43179":36208,"43180":36275,"43181":36523,"43182":36554,"43183":36763,"43184":36784,"43185":36802,"43186":36806,"43187":36805,"43188":36804,"43189":24033,"43190":37009,"43191":37026,"43192":37034,"43193":37030,"43194":37027,"43195":37193,"43196":37318,"43197":37324,"43198":38450,"43199":38446,"43200":38449,"43201":38442,"43202":38444,"43203":20006,"43204":20054,"43205":20083,"43206":20107,"43207":20123,"43208":20126,"43209":20139,"43210":20140,"43211":20335,"43212":20381,"43213":20365,"43214":20339,"43215":20351,"43216":20332,"43217":20379,"43218":20363,"43219":20358,"43220":20355,"43221":20336,"43222":20341,"43223":20360,"43224":20329,"43225":20347,"43226":20374,"43227":20350,"43228":20367,"43229":20369,"43230":20346,"43231":20820,"43232":20818,"43233":20821,"43234":20841,"43235":20855,"43236":20854,"43237":20856,"43238":20925,"43239":20989,"43240":21051,"43241":21048,"43242":21047,"43243":21050,"43244":21040,"43245":21038,"43246":21046,"43247":21057,"43248":21182,"43249":21179,"43250":21330,"43251":21332,"43252":21331,"43253":21329,"43254":21350,"43255":21367,"43256":21368,"43257":21369,"43258":21462,"43259":21460,"43260":21463,"43261":21619,"43262":21621,"43328":21654,"43329":21624,"43330":21653,"43331":21632,"43332":21627,"43333":21623,"43334":21636,"43335":21650,"43336":21638,"43337":21628,"43338":21648,"43339":21617,"43340":21622,"43341":21644,"43342":21658,"43343":21602,"43344":21608,"43345":21643,"43346":21629,"43347":21646,"43348":22266,"43349":22403,"43350":22391,"43351":22378,"43352":22377,"43353":22369,"43354":22374,"43355":22372,"43356":22396,"43357":22812,"43358":22857,"43359":22855,"43360":22856,"43361":22852,"43362":22868,"43363":22974,"43364":22971,"43365":22996,"43366":22969,"43367":22958,"43368":22993,"43369":22982,"43370":22992,"43371":22989,"43372":22987,"43373":22995,"43374":22986,"43375":22959,"43376":22963,"43377":22994,"43378":22981,"43379":23391,"43380":23396,"43381":23395,"43382":23447,"43383":23450,"43384":23448,"43385":23452,"43386":23449,"43387":23451,"43388":23578,"43389":23624,"43390":23621,"43425":23622,"43426":23735,"43427":23713,"43428":23736,"43429":23721,"43430":23723,"43431":23729,"43432":23731,"43433":24088,"43434":24090,"43435":24086,"43436":24085,"43437":24091,"43438":24081,"43439":24184,"43440":24218,"43441":24215,"43442":24220,"43443":24213,"43444":24214,"43445":24310,"43446":24358,"43447":24359,"43448":24361,"43449":24448,"43450":24449,"43451":24447,"43452":24444,"43453":24541,"43454":24544,"43455":24573,"43456":24565,"43457":24575,"43458":24591,"43459":24596,"43460":24623,"43461":24629,"43462":24598,"43463":24618,"43464":24597,"43465":24609,"43466":24615,"43467":24617,"43468":24619,"43469":24603,"43470":25110,"43471":25109,"43472":25151,"43473":25150,"43474":25152,"43475":25215,"43476":25289,"43477":25292,"43478":25284,"43479":25279,"43480":25282,"43481":25273,"43482":25298,"43483":25307,"43484":25259,"43485":25299,"43486":25300,"43487":25291,"43488":25288,"43489":25256,"43490":25277,"43491":25276,"43492":25296,"43493":25305,"43494":25287,"43495":25293,"43496":25269,"43497":25306,"43498":25265,"43499":25304,"43500":25302,"43501":25303,"43502":25286,"43503":25260,"43504":25294,"43505":25918,"43506":26023,"43507":26044,"43508":26106,"43509":26132,"43510":26131,"43511":26124,"43512":26118,"43513":26114,"43514":26126,"43515":26112,"43516":26127,"43517":26133,"43518":26122,"43584":26119,"43585":26381,"43586":26379,"43587":26477,"43588":26507,"43589":26517,"43590":26481,"43591":26524,"43592":26483,"43593":26487,"43594":26503,"43595":26525,"43596":26519,"43597":26479,"43598":26480,"43599":26495,"43600":26505,"43601":26494,"43602":26512,"43603":26485,"43604":26522,"43605":26515,"43606":26492,"43607":26474,"43608":26482,"43609":27427,"43610":27494,"43611":27495,"43612":27519,"43613":27667,"43614":27675,"43615":27875,"43616":27880,"43617":27891,"43618":27825,"43619":27852,"43620":27877,"43621":27827,"43622":27837,"43623":27838,"43624":27836,"43625":27874,"43626":27819,"43627":27861,"43628":27859,"43629":27832,"43630":27844,"43631":27833,"43632":27841,"43633":27822,"43634":27863,"43635":27845,"43636":27889,"43637":27839,"43638":27835,"43639":27873,"43640":27867,"43641":27850,"43642":27820,"43643":27887,"43644":27868,"43645":27862,"43646":27872,"43681":28821,"43682":28814,"43683":28818,"43684":28810,"43685":28825,"43686":29228,"43687":29229,"43688":29240,"43689":29256,"43690":29287,"43691":29289,"43692":29376,"43693":29390,"43694":29401,"43695":29399,"43696":29392,"43697":29609,"43698":29608,"43699":29599,"43700":29611,"43701":29605,"43702":30013,"43703":30109,"43704":30105,"43705":30106,"43706":30340,"43707":30402,"43708":30450,"43709":30452,"43710":30693,"43711":30717,"43712":31038,"43713":31040,"43714":31041,"43715":31177,"43716":31176,"43717":31354,"43718":31353,"43719":31482,"43720":31998,"43721":32596,"43722":32652,"43723":32651,"43724":32773,"43725":32954,"43726":32933,"43727":32930,"43728":32945,"43729":32929,"43730":32939,"43731":32937,"43732":32948,"43733":32938,"43734":32943,"43735":33253,"43736":33278,"43737":33293,"43738":33459,"43739":33437,"43740":33433,"43741":33453,"43742":33469,"43743":33439,"43744":33465,"43745":33457,"43746":33452,"43747":33445,"43748":33455,"43749":33464,"43750":33443,"43751":33456,"43752":33470,"43753":33463,"43754":34382,"43755":34417,"43756":21021,"43757":34920,"43758":36555,"43759":36814,"43760":36820,"43761":36817,"43762":37045,"43763":37048,"43764":37041,"43765":37046,"43766":37319,"43767":37329,"43768":38263,"43769":38272,"43770":38428,"43771":38464,"43772":38463,"43773":38459,"43774":38468,"43840":38466,"43841":38585,"43842":38632,"43843":38738,"43844":38750,"43845":20127,"43846":20141,"43847":20142,"43848":20449,"43849":20405,"43850":20399,"43851":20415,"43852":20448,"43853":20433,"43854":20431,"43855":20445,"43856":20419,"43857":20406,"43858":20440,"43859":20447,"43860":20426,"43861":20439,"43862":20398,"43863":20432,"43864":20420,"43865":20418,"43866":20442,"43867":20430,"43868":20446,"43869":20407,"43870":20823,"43871":20882,"43872":20881,"43873":20896,"43874":21070,"43875":21059,"43876":21066,"43877":21069,"43878":21068,"43879":21067,"43880":21063,"43881":21191,"43882":21193,"43883":21187,"43884":21185,"43885":21261,"43886":21335,"43887":21371,"43888":21402,"43889":21467,"43890":21676,"43891":21696,"43892":21672,"43893":21710,"43894":21705,"43895":21688,"43896":21670,"43897":21683,"43898":21703,"43899":21698,"43900":21693,"43901":21674,"43902":21697,"43937":21700,"43938":21704,"43939":21679,"43940":21675,"43941":21681,"43942":21691,"43943":21673,"43944":21671,"43945":21695,"43946":22271,"43947":22402,"43948":22411,"43949":22432,"43950":22435,"43951":22434,"43952":22478,"43953":22446,"43954":22419,"43955":22869,"43956":22865,"43957":22863,"43958":22862,"43959":22864,"43960":23004,"43961":23000,"43962":23039,"43963":23011,"43964":23016,"43965":23043,"43966":23013,"43967":23018,"43968":23002,"43969":23014,"43970":23041,"43971":23035,"43972":23401,"43973":23459,"43974":23462,"43975":23460,"43976":23458,"43977":23461,"43978":23553,"43979":23630,"43980":23631,"43981":23629,"43982":23627,"43983":23769,"43984":23762,"43985":24055,"43986":24093,"43987":24101,"43988":24095,"43989":24189,"43990":24224,"43991":24230,"43992":24314,"43993":24328,"43994":24365,"43995":24421,"43996":24456,"43997":24453,"43998":24458,"43999":24459,"44000":24455,"44001":24460,"44002":24457,"44003":24594,"44004":24605,"44005":24608,"44006":24613,"44007":24590,"44008":24616,"44009":24653,"44010":24688,"44011":24680,"44012":24674,"44013":24646,"44014":24643,"44015":24684,"44016":24683,"44017":24682,"44018":24676,"44019":25153,"44020":25308,"44021":25366,"44022":25353,"44023":25340,"44024":25325,"44025":25345,"44026":25326,"44027":25341,"44028":25351,"44029":25329,"44030":25335,"44096":25327,"44097":25324,"44098":25342,"44099":25332,"44100":25361,"44101":25346,"44102":25919,"44103":25925,"44104":26027,"44105":26045,"44106":26082,"44107":26149,"44108":26157,"44109":26144,"44110":26151,"44111":26159,"44112":26143,"44113":26152,"44114":26161,"44115":26148,"44116":26359,"44117":26623,"44118":26579,"44119":26609,"44120":26580,"44121":26576,"44122":26604,"44123":26550,"44124":26543,"44125":26613,"44126":26601,"44127":26607,"44128":26564,"44129":26577,"44130":26548,"44131":26586,"44132":26597,"44133":26552,"44134":26575,"44135":26590,"44136":26611,"44137":26544,"44138":26585,"44139":26594,"44140":26589,"44141":26578,"44142":27498,"44143":27523,"44144":27526,"44145":27573,"44146":27602,"44147":27607,"44148":27679,"44149":27849,"44150":27915,"44151":27954,"44152":27946,"44153":27969,"44154":27941,"44155":27916,"44156":27953,"44157":27934,"44158":27927,"44193":27963,"44194":27965,"44195":27966,"44196":27958,"44197":27931,"44198":27893,"44199":27961,"44200":27943,"44201":27960,"44202":27945,"44203":27950,"44204":27957,"44205":27918,"44206":27947,"44207":28843,"44208":28858,"44209":28851,"44210":28844,"44211":28847,"44212":28845,"44213":28856,"44214":28846,"44215":28836,"44216":29232,"44217":29298,"44218":29295,"44219":29300,"44220":29417,"44221":29408,"44222":29409,"44223":29623,"44224":29642,"44225":29627,"44226":29618,"44227":29645,"44228":29632,"44229":29619,"44230":29978,"44231":29997,"44232":30031,"44233":30028,"44234":30030,"44235":30027,"44236":30123,"44237":30116,"44238":30117,"44239":30114,"44240":30115,"44241":30328,"44242":30342,"44243":30343,"44244":30344,"44245":30408,"44246":30406,"44247":30403,"44248":30405,"44249":30465,"44250":30457,"44251":30456,"44252":30473,"44253":30475,"44254":30462,"44255":30460,"44256":30471,"44257":30684,"44258":30722,"44259":30740,"44260":30732,"44261":30733,"44262":31046,"44263":31049,"44264":31048,"44265":31047,"44266":31161,"44267":31162,"44268":31185,"44269":31186,"44270":31179,"44271":31359,"44272":31361,"44273":31487,"44274":31485,"44275":31869,"44276":32002,"44277":32005,"44278":32000,"44279":32009,"44280":32007,"44281":32004,"44282":32006,"44283":32568,"44284":32654,"44285":32703,"44286":32772,"44352":32784,"44353":32781,"44354":32785,"44355":32822,"44356":32982,"44357":32997,"44358":32986,"44359":32963,"44360":32964,"44361":32972,"44362":32993,"44363":32987,"44364":32974,"44365":32990,"44366":32996,"44367":32989,"44368":33268,"44369":33314,"44370":33511,"44371":33539,"44372":33541,"44373":33507,"44374":33499,"44375":33510,"44376":33540,"44377":33509,"44378":33538,"44379":33545,"44380":33490,"44381":33495,"44382":33521,"44383":33537,"44384":33500,"44385":33492,"44386":33489,"44387":33502,"44388":33491,"44389":33503,"44390":33519,"44391":33542,"44392":34384,"44393":34425,"44394":34427,"44395":34426,"44396":34893,"44397":34923,"44398":35201,"44399":35284,"44400":35336,"44401":35330,"44402":35331,"44403":35998,"44404":36000,"44405":36212,"44406":36211,"44407":36276,"44408":36557,"44409":36556,"44410":36848,"44411":36838,"44412":36834,"44413":36842,"44414":36837,"44449":36845,"44450":36843,"44451":36836,"44452":36840,"44453":37066,"44454":37070,"44455":37057,"44456":37059,"44457":37195,"44458":37194,"44459":37325,"44460":38274,"44461":38480,"44462":38475,"44463":38476,"44464":38477,"44465":38754,"44466":38761,"44467":38859,"44468":38893,"44469":38899,"44470":38913,"44471":39080,"44472":39131,"44473":39135,"44474":39318,"44475":39321,"44476":20056,"44477":20147,"44478":20492,"44479":20493,"44480":20515,"44481":20463,"44482":20518,"44483":20517,"44484":20472,"44485":20521,"44486":20502,"44487":20486,"44488":20540,"44489":20511,"44490":20506,"44491":20498,"44492":20497,"44493":20474,"44494":20480,"44495":20500,"44496":20520,"44497":20465,"44498":20513,"44499":20491,"44500":20505,"44501":20504,"44502":20467,"44503":20462,"44504":20525,"44505":20522,"44506":20478,"44507":20523,"44508":20489,"44509":20860,"44510":20900,"44511":20901,"44512":20898,"44513":20941,"44514":20940,"44515":20934,"44516":20939,"44517":21078,"44518":21084,"44519":21076,"44520":21083,"44521":21085,"44522":21290,"44523":21375,"44524":21407,"44525":21405,"44526":21471,"44527":21736,"44528":21776,"44529":21761,"44530":21815,"44531":21756,"44532":21733,"44533":21746,"44534":21766,"44535":21754,"44536":21780,"44537":21737,"44538":21741,"44539":21729,"44540":21769,"44541":21742,"44542":21738,"44608":21734,"44609":21799,"44610":21767,"44611":21757,"44612":21775,"44613":22275,"44614":22276,"44615":22466,"44616":22484,"44617":22475,"44618":22467,"44619":22537,"44620":22799,"44621":22871,"44622":22872,"44623":22874,"44624":23057,"44625":23064,"44626":23068,"44627":23071,"44628":23067,"44629":23059,"44630":23020,"44631":23072,"44632":23075,"44633":23081,"44634":23077,"44635":23052,"44636":23049,"44637":23403,"44638":23640,"44639":23472,"44640":23475,"44641":23478,"44642":23476,"44643":23470,"44644":23477,"44645":23481,"44646":23480,"44647":23556,"44648":23633,"44649":23637,"44650":23632,"44651":23789,"44652":23805,"44653":23803,"44654":23786,"44655":23784,"44656":23792,"44657":23798,"44658":23809,"44659":23796,"44660":24046,"44661":24109,"44662":24107,"44663":24235,"44664":24237,"44665":24231,"44666":24369,"44667":24466,"44668":24465,"44669":24464,"44670":24665,"44705":24675,"44706":24677,"44707":24656,"44708":24661,"44709":24685,"44710":24681,"44711":24687,"44712":24708,"44713":24735,"44714":24730,"44715":24717,"44716":24724,"44717":24716,"44718":24709,"44719":24726,"44720":25159,"44721":25331,"44722":25352,"44723":25343,"44724":25422,"44725":25406,"44726":25391,"44727":25429,"44728":25410,"44729":25414,"44730":25423,"44731":25417,"44732":25402,"44733":25424,"44734":25405,"44735":25386,"44736":25387,"44737":25384,"44738":25421,"44739":25420,"44740":25928,"44741":25929,"44742":26009,"44743":26049,"44744":26053,"44745":26178,"44746":26185,"44747":26191,"44748":26179,"44749":26194,"44750":26188,"44751":26181,"44752":26177,"44753":26360,"44754":26388,"44755":26389,"44756":26391,"44757":26657,"44758":26680,"44759":26696,"44760":26694,"44761":26707,"44762":26681,"44763":26690,"44764":26708,"44765":26665,"44766":26803,"44767":26647,"44768":26700,"44769":26705,"44770":26685,"44771":26612,"44772":26704,"44773":26688,"44774":26684,"44775":26691,"44776":26666,"44777":26693,"44778":26643,"44779":26648,"44780":26689,"44781":27530,"44782":27529,"44783":27575,"44784":27683,"44785":27687,"44786":27688,"44787":27686,"44788":27684,"44789":27888,"44790":28010,"44791":28053,"44792":28040,"44793":28039,"44794":28006,"44795":28024,"44796":28023,"44797":27993,"44798":28051,"44864":28012,"44865":28041,"44866":28014,"44867":27994,"44868":28020,"44869":28009,"44870":28044,"44871":28042,"44872":28025,"44873":28037,"44874":28005,"44875":28052,"44876":28874,"44877":28888,"44878":28900,"44879":28889,"44880":28872,"44881":28879,"44882":29241,"44883":29305,"44884":29436,"44885":29433,"44886":29437,"44887":29432,"44888":29431,"44889":29574,"44890":29677,"44891":29705,"44892":29678,"44893":29664,"44894":29674,"44895":29662,"44896":30036,"44897":30045,"44898":30044,"44899":30042,"44900":30041,"44901":30142,"44902":30149,"44903":30151,"44904":30130,"44905":30131,"44906":30141,"44907":30140,"44908":30137,"44909":30146,"44910":30136,"44911":30347,"44912":30384,"44913":30410,"44914":30413,"44915":30414,"44916":30505,"44917":30495,"44918":30496,"44919":30504,"44920":30697,"44921":30768,"44922":30759,"44923":30776,"44924":30749,"44925":30772,"44926":30775,"44961":30757,"44962":30765,"44963":30752,"44964":30751,"44965":30770,"44966":31061,"44967":31056,"44968":31072,"44969":31071,"44970":31062,"44971":31070,"44972":31069,"44973":31063,"44974":31066,"44975":31204,"44976":31203,"44977":31207,"44978":31199,"44979":31206,"44980":31209,"44981":31192,"44982":31364,"44983":31368,"44984":31449,"44985":31494,"44986":31505,"44987":31881,"44988":32033,"44989":32023,"44990":32011,"44991":32010,"44992":32032,"44993":32034,"44994":32020,"44995":32016,"44996":32021,"44997":32026,"44998":32028,"44999":32013,"45000":32025,"45001":32027,"45002":32570,"45003":32607,"45004":32660,"45005":32709,"45006":32705,"45007":32774,"45008":32792,"45009":32789,"45010":32793,"45011":32791,"45012":32829,"45013":32831,"45014":33009,"45015":33026,"45016":33008,"45017":33029,"45018":33005,"45019":33012,"45020":33030,"45021":33016,"45022":33011,"45023":33032,"45024":33021,"45025":33034,"45026":33020,"45027":33007,"45028":33261,"45029":33260,"45030":33280,"45031":33296,"45032":33322,"45033":33323,"45034":33320,"45035":33324,"45036":33467,"45037":33579,"45038":33618,"45039":33620,"45040":33610,"45041":33592,"45042":33616,"45043":33609,"45044":33589,"45045":33588,"45046":33615,"45047":33586,"45048":33593,"45049":33590,"45050":33559,"45051":33600,"45052":33585,"45053":33576,"45054":33603,"45120":34388,"45121":34442,"45122":34474,"45123":34451,"45124":34468,"45125":34473,"45126":34444,"45127":34467,"45128":34460,"45129":34928,"45130":34935,"45131":34945,"45132":34946,"45133":34941,"45134":34937,"45135":35352,"45136":35344,"45137":35342,"45138":35340,"45139":35349,"45140":35338,"45141":35351,"45142":35347,"45143":35350,"45144":35343,"45145":35345,"45146":35912,"45147":35962,"45148":35961,"45149":36001,"45150":36002,"45151":36215,"45152":36524,"45153":36562,"45154":36564,"45155":36559,"45156":36785,"45157":36865,"45158":36870,"45159":36855,"45160":36864,"45161":36858,"45162":36852,"45163":36867,"45164":36861,"45165":36869,"45166":36856,"45167":37013,"45168":37089,"45169":37085,"45170":37090,"45171":37202,"45172":37197,"45173":37196,"45174":37336,"45175":37341,"45176":37335,"45177":37340,"45178":37337,"45179":38275,"45180":38498,"45181":38499,"45182":38497,"45217":38491,"45218":38493,"45219":38500,"45220":38488,"45221":38494,"45222":38587,"45223":39138,"45224":39340,"45225":39592,"45226":39640,"45227":39717,"45228":39730,"45229":39740,"45230":20094,"45231":20602,"45232":20605,"45233":20572,"45234":20551,"45235":20547,"45236":20556,"45237":20570,"45238":20553,"45239":20581,"45240":20598,"45241":20558,"45242":20565,"45243":20597,"45244":20596,"45245":20599,"45246":20559,"45247":20495,"45248":20591,"45249":20589,"45250":20828,"45251":20885,"45252":20976,"45253":21098,"45254":21103,"45255":21202,"45256":21209,"45257":21208,"45258":21205,"45259":21264,"45260":21263,"45261":21273,"45262":21311,"45263":21312,"45264":21310,"45265":21443,"45266":26364,"45267":21830,"45268":21866,"45269":21862,"45270":21828,"45271":21854,"45272":21857,"45273":21827,"45274":21834,"45275":21809,"45276":21846,"45277":21839,"45278":21845,"45279":21807,"45280":21860,"45281":21816,"45282":21806,"45283":21852,"45284":21804,"45285":21859,"45286":21811,"45287":21825,"45288":21847,"45289":22280,"45290":22283,"45291":22281,"45292":22495,"45293":22533,"45294":22538,"45295":22534,"45296":22496,"45297":22500,"45298":22522,"45299":22530,"45300":22581,"45301":22519,"45302":22521,"45303":22816,"45304":22882,"45305":23094,"45306":23105,"45307":23113,"45308":23142,"45309":23146,"45310":23104,"45376":23100,"45377":23138,"45378":23130,"45379":23110,"45380":23114,"45381":23408,"45382":23495,"45383":23493,"45384":23492,"45385":23490,"45386":23487,"45387":23494,"45388":23561,"45389":23560,"45390":23559,"45391":23648,"45392":23644,"45393":23645,"45394":23815,"45395":23814,"45396":23822,"45397":23835,"45398":23830,"45399":23842,"45400":23825,"45401":23849,"45402":23828,"45403":23833,"45404":23844,"45405":23847,"45406":23831,"45407":24034,"45408":24120,"45409":24118,"45410":24115,"45411":24119,"45412":24247,"45413":24248,"45414":24246,"45415":24245,"45416":24254,"45417":24373,"45418":24375,"45419":24407,"45420":24428,"45421":24425,"45422":24427,"45423":24471,"45424":24473,"45425":24478,"45426":24472,"45427":24481,"45428":24480,"45429":24476,"45430":24703,"45431":24739,"45432":24713,"45433":24736,"45434":24744,"45435":24779,"45436":24756,"45437":24806,"45438":24765,"45473":24773,"45474":24763,"45475":24757,"45476":24796,"45477":24764,"45478":24792,"45479":24789,"45480":24774,"45481":24799,"45482":24760,"45483":24794,"45484":24775,"45485":25114,"45486":25115,"45487":25160,"45488":25504,"45489":25511,"45490":25458,"45491":25494,"45492":25506,"45493":25509,"45494":25463,"45495":25447,"45496":25496,"45497":25514,"45498":25457,"45499":25513,"45500":25481,"45501":25475,"45502":25499,"45503":25451,"45504":25512,"45505":25476,"45506":25480,"45507":25497,"45508":25505,"45509":25516,"45510":25490,"45511":25487,"45512":25472,"45513":25467,"45514":25449,"45515":25448,"45516":25466,"45517":25949,"45518":25942,"45519":25937,"45520":25945,"45521":25943,"45522":21855,"45523":25935,"45524":25944,"45525":25941,"45526":25940,"45527":26012,"45528":26011,"45529":26028,"45530":26063,"45531":26059,"45532":26060,"45533":26062,"45534":26205,"45535":26202,"45536":26212,"45537":26216,"45538":26214,"45539":26206,"45540":26361,"45541":21207,"45542":26395,"45543":26753,"45544":26799,"45545":26786,"45546":26771,"45547":26805,"45548":26751,"45549":26742,"45550":26801,"45551":26791,"45552":26775,"45553":26800,"45554":26755,"45555":26820,"45556":26797,"45557":26758,"45558":26757,"45559":26772,"45560":26781,"45561":26792,"45562":26783,"45563":26785,"45564":26754,"45565":27442,"45566":27578,"45632":27627,"45633":27628,"45634":27691,"45635":28046,"45636":28092,"45637":28147,"45638":28121,"45639":28082,"45640":28129,"45641":28108,"45642":28132,"45643":28155,"45644":28154,"45645":28165,"45646":28103,"45647":28107,"45648":28079,"45649":28113,"45650":28078,"45651":28126,"45652":28153,"45653":28088,"45654":28151,"45655":28149,"45656":28101,"45657":28114,"45658":28186,"45659":28085,"45660":28122,"45661":28139,"45662":28120,"45663":28138,"45664":28145,"45665":28142,"45666":28136,"45667":28102,"45668":28100,"45669":28074,"45670":28140,"45671":28095,"45672":28134,"45673":28921,"45674":28937,"45675":28938,"45676":28925,"45677":28911,"45678":29245,"45679":29309,"45680":29313,"45681":29468,"45682":29467,"45683":29462,"45684":29459,"45685":29465,"45686":29575,"45687":29701,"45688":29706,"45689":29699,"45690":29702,"45691":29694,"45692":29709,"45693":29920,"45694":29942,"45729":29943,"45730":29980,"45731":29986,"45732":30053,"45733":30054,"45734":30050,"45735":30064,"45736":30095,"45737":30164,"45738":30165,"45739":30133,"45740":30154,"45741":30157,"45742":30350,"45743":30420,"45744":30418,"45745":30427,"45746":30519,"45747":30526,"45748":30524,"45749":30518,"45750":30520,"45751":30522,"45752":30827,"45753":30787,"45754":30798,"45755":31077,"45756":31080,"45757":31085,"45758":31227,"45759":31378,"45760":31381,"45761":31520,"45762":31528,"45763":31515,"45764":31532,"45765":31526,"45766":31513,"45767":31518,"45768":31534,"45769":31890,"45770":31895,"45771":31893,"45772":32070,"45773":32067,"45774":32113,"45775":32046,"45776":32057,"45777":32060,"45778":32064,"45779":32048,"45780":32051,"45781":32068,"45782":32047,"45783":32066,"45784":32050,"45785":32049,"45786":32573,"45787":32670,"45788":32666,"45789":32716,"45790":32718,"45791":32722,"45792":32796,"45793":32842,"45794":32838,"45795":33071,"45796":33046,"45797":33059,"45798":33067,"45799":33065,"45800":33072,"45801":33060,"45802":33282,"45803":33333,"45804":33335,"45805":33334,"45806":33337,"45807":33678,"45808":33694,"45809":33688,"45810":33656,"45811":33698,"45812":33686,"45813":33725,"45814":33707,"45815":33682,"45816":33674,"45817":33683,"45818":33673,"45819":33696,"45820":33655,"45821":33659,"45822":33660,"45888":33670,"45889":33703,"45890":34389,"45891":24426,"45892":34503,"45893":34496,"45894":34486,"45895":34500,"45896":34485,"45897":34502,"45898":34507,"45899":34481,"45900":34479,"45901":34505,"45902":34899,"45903":34974,"45904":34952,"45905":34987,"45906":34962,"45907":34966,"45908":34957,"45909":34955,"45910":35219,"45911":35215,"45912":35370,"45913":35357,"45914":35363,"45915":35365,"45916":35377,"45917":35373,"45918":35359,"45919":35355,"45920":35362,"45921":35913,"45922":35930,"45923":36009,"45924":36012,"45925":36011,"45926":36008,"45927":36010,"45928":36007,"45929":36199,"45930":36198,"45931":36286,"45932":36282,"45933":36571,"45934":36575,"45935":36889,"45936":36877,"45937":36890,"45938":36887,"45939":36899,"45940":36895,"45941":36893,"45942":36880,"45943":36885,"45944":36894,"45945":36896,"45946":36879,"45947":36898,"45948":36886,"45949":36891,"45950":36884,"45985":37096,"45986":37101,"45987":37117,"45988":37207,"45989":37326,"45990":37365,"45991":37350,"45992":37347,"45993":37351,"45994":37357,"45995":37353,"45996":38281,"45997":38506,"45998":38517,"45999":38515,"46000":38520,"46001":38512,"46002":38516,"46003":38518,"46004":38519,"46005":38508,"46006":38592,"46007":38634,"46008":38633,"46009":31456,"46010":31455,"46011":38914,"46012":38915,"46013":39770,"46014":40165,"46015":40565,"46016":40575,"46017":40613,"46018":40635,"46019":20642,"46020":20621,"46021":20613,"46022":20633,"46023":20625,"46024":20608,"46025":20630,"46026":20632,"46027":20634,"46028":26368,"46029":20977,"46030":21106,"46031":21108,"46032":21109,"46033":21097,"46034":21214,"46035":21213,"46036":21211,"46037":21338,"46038":21413,"46039":21883,"46040":21888,"46041":21927,"46042":21884,"46043":21898,"46044":21917,"46045":21912,"46046":21890,"46047":21916,"46048":21930,"46049":21908,"46050":21895,"46051":21899,"46052":21891,"46053":21939,"46054":21934,"46055":21919,"46056":21822,"46057":21938,"46058":21914,"46059":21947,"46060":21932,"46061":21937,"46062":21886,"46063":21897,"46064":21931,"46065":21913,"46066":22285,"46067":22575,"46068":22570,"46069":22580,"46070":22564,"46071":22576,"46072":22577,"46073":22561,"46074":22557,"46075":22560,"46076":22777,"46077":22778,"46078":22880,"46144":23159,"46145":23194,"46146":23167,"46147":23186,"46148":23195,"46149":23207,"46150":23411,"46151":23409,"46152":23506,"46153":23500,"46154":23507,"46155":23504,"46156":23562,"46157":23563,"46158":23601,"46159":23884,"46160":23888,"46161":23860,"46162":23879,"46163":24061,"46164":24133,"46165":24125,"46166":24128,"46167":24131,"46168":24190,"46169":24266,"46170":24257,"46171":24258,"46172":24260,"46173":24380,"46174":24429,"46175":24489,"46176":24490,"46177":24488,"46178":24785,"46179":24801,"46180":24754,"46181":24758,"46182":24800,"46183":24860,"46184":24867,"46185":24826,"46186":24853,"46187":24816,"46188":24827,"46189":24820,"46190":24936,"46191":24817,"46192":24846,"46193":24822,"46194":24841,"46195":24832,"46196":24850,"46197":25119,"46198":25161,"46199":25507,"46200":25484,"46201":25551,"46202":25536,"46203":25577,"46204":25545,"46205":25542,"46206":25549,"46241":25554,"46242":25571,"46243":25552,"46244":25569,"46245":25558,"46246":25581,"46247":25582,"46248":25462,"46249":25588,"46250":25578,"46251":25563,"46252":25682,"46253":25562,"46254":25593,"46255":25950,"46256":25958,"46257":25954,"46258":25955,"46259":26001,"46260":26000,"46261":26031,"46262":26222,"46263":26224,"46264":26228,"46265":26230,"46266":26223,"46267":26257,"46268":26234,"46269":26238,"46270":26231,"46271":26366,"46272":26367,"46273":26399,"46274":26397,"46275":26874,"46276":26837,"46277":26848,"46278":26840,"46279":26839,"46280":26885,"46281":26847,"46282":26869,"46283":26862,"46284":26855,"46285":26873,"46286":26834,"46287":26866,"46288":26851,"46289":26827,"46290":26829,"46291":26893,"46292":26898,"46293":26894,"46294":26825,"46295":26842,"46296":26990,"46297":26875,"46298":27454,"46299":27450,"46300":27453,"46301":27544,"46302":27542,"46303":27580,"46304":27631,"46305":27694,"46306":27695,"46307":27692,"46308":28207,"46309":28216,"46310":28244,"46311":28193,"46312":28210,"46313":28263,"46314":28234,"46315":28192,"46316":28197,"46317":28195,"46318":28187,"46319":28251,"46320":28248,"46321":28196,"46322":28246,"46323":28270,"46324":28205,"46325":28198,"46326":28271,"46327":28212,"46328":28237,"46329":28218,"46330":28204,"46331":28227,"46332":28189,"46333":28222,"46334":28363,"46400":28297,"46401":28185,"46402":28238,"46403":28259,"46404":28228,"46405":28274,"46406":28265,"46407":28255,"46408":28953,"46409":28954,"46410":28966,"46411":28976,"46412":28961,"46413":28982,"46414":29038,"46415":28956,"46416":29260,"46417":29316,"46418":29312,"46419":29494,"46420":29477,"46421":29492,"46422":29481,"46423":29754,"46424":29738,"46425":29747,"46426":29730,"46427":29733,"46428":29749,"46429":29750,"46430":29748,"46431":29743,"46432":29723,"46433":29734,"46434":29736,"46435":29989,"46436":29990,"46437":30059,"46438":30058,"46439":30178,"46440":30171,"46441":30179,"46442":30169,"46443":30168,"46444":30174,"46445":30176,"46446":30331,"46447":30332,"46448":30358,"46449":30355,"46450":30388,"46451":30428,"46452":30543,"46453":30701,"46454":30813,"46455":30828,"46456":30831,"46457":31245,"46458":31240,"46459":31243,"46460":31237,"46461":31232,"46462":31384,"46497":31383,"46498":31382,"46499":31461,"46500":31459,"46501":31561,"46502":31574,"46503":31558,"46504":31568,"46505":31570,"46506":31572,"46507":31565,"46508":31563,"46509":31567,"46510":31569,"46511":31903,"46512":31909,"46513":32094,"46514":32080,"46515":32104,"46516":32085,"46517":32043,"46518":32110,"46519":32114,"46520":32097,"46521":32102,"46522":32098,"46523":32112,"46524":32115,"46525":21892,"46526":32724,"46527":32725,"46528":32779,"46529":32850,"46530":32901,"46531":33109,"46532":33108,"46533":33099,"46534":33105,"46535":33102,"46536":33081,"46537":33094,"46538":33086,"46539":33100,"46540":33107,"46541":33140,"46542":33298,"46543":33308,"46544":33769,"46545":33795,"46546":33784,"46547":33805,"46548":33760,"46549":33733,"46550":33803,"46551":33729,"46552":33775,"46553":33777,"46554":33780,"46555":33879,"46556":33802,"46557":33776,"46558":33804,"46559":33740,"46560":33789,"46561":33778,"46562":33738,"46563":33848,"46564":33806,"46565":33796,"46566":33756,"46567":33799,"46568":33748,"46569":33759,"46570":34395,"46571":34527,"46572":34521,"46573":34541,"46574":34516,"46575":34523,"46576":34532,"46577":34512,"46578":34526,"46579":34903,"46580":35009,"46581":35010,"46582":34993,"46583":35203,"46584":35222,"46585":35387,"46586":35424,"46587":35413,"46588":35422,"46589":35388,"46590":35393,"46656":35412,"46657":35419,"46658":35408,"46659":35398,"46660":35380,"46661":35386,"46662":35382,"46663":35414,"46664":35937,"46665":35970,"46666":36015,"46667":36028,"46668":36019,"46669":36029,"46670":36033,"46671":36027,"46672":36032,"46673":36020,"46674":36023,"46675":36022,"46676":36031,"46677":36024,"46678":36234,"46679":36229,"46680":36225,"46681":36302,"46682":36317,"46683":36299,"46684":36314,"46685":36305,"46686":36300,"46687":36315,"46688":36294,"46689":36603,"46690":36600,"46691":36604,"46692":36764,"46693":36910,"46694":36917,"46695":36913,"46696":36920,"46697":36914,"46698":36918,"46699":37122,"46700":37109,"46701":37129,"46702":37118,"46703":37219,"46704":37221,"46705":37327,"46706":37396,"46707":37397,"46708":37411,"46709":37385,"46710":37406,"46711":37389,"46712":37392,"46713":37383,"46714":37393,"46715":38292,"46716":38287,"46717":38283,"46718":38289,"46753":38291,"46754":38290,"46755":38286,"46756":38538,"46757":38542,"46758":38539,"46759":38525,"46760":38533,"46761":38534,"46762":38541,"46763":38514,"46764":38532,"46765":38593,"46766":38597,"46767":38596,"46768":38598,"46769":38599,"46770":38639,"46771":38642,"46772":38860,"46773":38917,"46774":38918,"46775":38920,"46776":39143,"46777":39146,"46778":39151,"46779":39145,"46780":39154,"46781":39149,"46782":39342,"46783":39341,"46784":40643,"46785":40653,"46786":40657,"46787":20098,"46788":20653,"46789":20661,"46790":20658,"46791":20659,"46792":20677,"46793":20670,"46794":20652,"46795":20663,"46796":20667,"46797":20655,"46798":20679,"46799":21119,"46800":21111,"46801":21117,"46802":21215,"46803":21222,"46804":21220,"46805":21218,"46806":21219,"46807":21295,"46808":21983,"46809":21992,"46810":21971,"46811":21990,"46812":21966,"46813":21980,"46814":21959,"46815":21969,"46816":21987,"46817":21988,"46818":21999,"46819":21978,"46820":21985,"46821":21957,"46822":21958,"46823":21989,"46824":21961,"46825":22290,"46826":22291,"46827":22622,"46828":22609,"46829":22616,"46830":22615,"46831":22618,"46832":22612,"46833":22635,"46834":22604,"46835":22637,"46836":22602,"46837":22626,"46838":22610,"46839":22603,"46840":22887,"46841":23233,"46842":23241,"46843":23244,"46844":23230,"46845":23229,"46846":23228,"46912":23219,"46913":23234,"46914":23218,"46915":23913,"46916":23919,"46917":24140,"46918":24185,"46919":24265,"46920":24264,"46921":24338,"46922":24409,"46923":24492,"46924":24494,"46925":24858,"46926":24847,"46927":24904,"46928":24863,"46929":24819,"46930":24859,"46931":24825,"46932":24833,"46933":24840,"46934":24910,"46935":24908,"46936":24900,"46937":24909,"46938":24894,"46939":24884,"46940":24871,"46941":24845,"46942":24838,"46943":24887,"46944":25121,"46945":25122,"46946":25619,"46947":25662,"46948":25630,"46949":25642,"46950":25645,"46951":25661,"46952":25644,"46953":25615,"46954":25628,"46955":25620,"46956":25613,"46957":25654,"46958":25622,"46959":25623,"46960":25606,"46961":25964,"46962":26015,"46963":26032,"46964":26263,"46965":26249,"46966":26247,"46967":26248,"46968":26262,"46969":26244,"46970":26264,"46971":26253,"46972":26371,"46973":27028,"46974":26989,"47009":26970,"47010":26999,"47011":26976,"47012":26964,"47013":26997,"47014":26928,"47015":27010,"47016":26954,"47017":26984,"47018":26987,"47019":26974,"47020":26963,"47021":27001,"47022":27014,"47023":26973,"47024":26979,"47025":26971,"47026":27463,"47027":27506,"47028":27584,"47029":27583,"47030":27603,"47031":27645,"47032":28322,"47033":28335,"47034":28371,"47035":28342,"47036":28354,"47037":28304,"47038":28317,"47039":28359,"47040":28357,"47041":28325,"47042":28312,"47043":28348,"47044":28346,"47045":28331,"47046":28369,"47047":28310,"47048":28316,"47049":28356,"47050":28372,"47051":28330,"47052":28327,"47053":28340,"47054":29006,"47055":29017,"47056":29033,"47057":29028,"47058":29001,"47059":29031,"47060":29020,"47061":29036,"47062":29030,"47063":29004,"47064":29029,"47065":29022,"47066":28998,"47067":29032,"47068":29014,"47069":29242,"47070":29266,"47071":29495,"47072":29509,"47073":29503,"47074":29502,"47075":29807,"47076":29786,"47077":29781,"47078":29791,"47079":29790,"47080":29761,"47081":29759,"47082":29785,"47083":29787,"47084":29788,"47085":30070,"47086":30072,"47087":30208,"47088":30192,"47089":30209,"47090":30194,"47091":30193,"47092":30202,"47093":30207,"47094":30196,"47095":30195,"47096":30430,"47097":30431,"47098":30555,"47099":30571,"47100":30566,"47101":30558,"47102":30563,"47168":30585,"47169":30570,"47170":30572,"47171":30556,"47172":30565,"47173":30568,"47174":30562,"47175":30702,"47176":30862,"47177":30896,"47178":30871,"47179":30872,"47180":30860,"47181":30857,"47182":30844,"47183":30865,"47184":30867,"47185":30847,"47186":31098,"47187":31103,"47188":31105,"47189":33836,"47190":31165,"47191":31260,"47192":31258,"47193":31264,"47194":31252,"47195":31263,"47196":31262,"47197":31391,"47198":31392,"47199":31607,"47200":31680,"47201":31584,"47202":31598,"47203":31591,"47204":31921,"47205":31923,"47206":31925,"47207":32147,"47208":32121,"47209":32145,"47210":32129,"47211":32143,"47212":32091,"47213":32622,"47214":32617,"47215":32618,"47216":32626,"47217":32681,"47218":32680,"47219":32676,"47220":32854,"47221":32856,"47222":32902,"47223":32900,"47224":33137,"47225":33136,"47226":33144,"47227":33125,"47228":33134,"47229":33139,"47230":33131,"47265":33145,"47266":33146,"47267":33126,"47268":33285,"47269":33351,"47270":33922,"47271":33911,"47272":33853,"47273":33841,"47274":33909,"47275":33894,"47276":33899,"47277":33865,"47278":33900,"47279":33883,"47280":33852,"47281":33845,"47282":33889,"47283":33891,"47284":33897,"47285":33901,"47286":33862,"47287":34398,"47288":34396,"47289":34399,"47290":34553,"47291":34579,"47292":34568,"47293":34567,"47294":34560,"47295":34558,"47296":34555,"47297":34562,"47298":34563,"47299":34566,"47300":34570,"47301":34905,"47302":35039,"47303":35028,"47304":35033,"47305":35036,"47306":35032,"47307":35037,"47308":35041,"47309":35018,"47310":35029,"47311":35026,"47312":35228,"47313":35299,"47314":35435,"47315":35442,"47316":35443,"47317":35430,"47318":35433,"47319":35440,"47320":35463,"47321":35452,"47322":35427,"47323":35488,"47324":35441,"47325":35461,"47326":35437,"47327":35426,"47328":35438,"47329":35436,"47330":35449,"47331":35451,"47332":35390,"47333":35432,"47334":35938,"47335":35978,"47336":35977,"47337":36042,"47338":36039,"47339":36040,"47340":36036,"47341":36018,"47342":36035,"47343":36034,"47344":36037,"47345":36321,"47346":36319,"47347":36328,"47348":36335,"47349":36339,"47350":36346,"47351":36330,"47352":36324,"47353":36326,"47354":36530,"47355":36611,"47356":36617,"47357":36606,"47358":36618,"47424":36767,"47425":36786,"47426":36939,"47427":36938,"47428":36947,"47429":36930,"47430":36948,"47431":36924,"47432":36949,"47433":36944,"47434":36935,"47435":36943,"47436":36942,"47437":36941,"47438":36945,"47439":36926,"47440":36929,"47441":37138,"47442":37143,"47443":37228,"47444":37226,"47445":37225,"47446":37321,"47447":37431,"47448":37463,"47449":37432,"47450":37437,"47451":37440,"47452":37438,"47453":37467,"47454":37451,"47455":37476,"47456":37457,"47457":37428,"47458":37449,"47459":37453,"47460":37445,"47461":37433,"47462":37439,"47463":37466,"47464":38296,"47465":38552,"47466":38548,"47467":38549,"47468":38605,"47469":38603,"47470":38601,"47471":38602,"47472":38647,"47473":38651,"47474":38649,"47475":38646,"47476":38742,"47477":38772,"47478":38774,"47479":38928,"47480":38929,"47481":38931,"47482":38922,"47483":38930,"47484":38924,"47485":39164,"47486":39156,"47521":39165,"47522":39166,"47523":39347,"47524":39345,"47525":39348,"47526":39649,"47527":40169,"47528":40578,"47529":40718,"47530":40723,"47531":40736,"47532":20711,"47533":20718,"47534":20709,"47535":20694,"47536":20717,"47537":20698,"47538":20693,"47539":20687,"47540":20689,"47541":20721,"47542":20686,"47543":20713,"47544":20834,"47545":20979,"47546":21123,"47547":21122,"47548":21297,"47549":21421,"47550":22014,"47551":22016,"47552":22043,"47553":22039,"47554":22013,"47555":22036,"47556":22022,"47557":22025,"47558":22029,"47559":22030,"47560":22007,"47561":22038,"47562":22047,"47563":22024,"47564":22032,"47565":22006,"47566":22296,"47567":22294,"47568":22645,"47569":22654,"47570":22659,"47571":22675,"47572":22666,"47573":22649,"47574":22661,"47575":22653,"47576":22781,"47577":22821,"47578":22818,"47579":22820,"47580":22890,"47581":22889,"47582":23265,"47583":23270,"47584":23273,"47585":23255,"47586":23254,"47587":23256,"47588":23267,"47589":23413,"47590":23518,"47591":23527,"47592":23521,"47593":23525,"47594":23526,"47595":23528,"47596":23522,"47597":23524,"47598":23519,"47599":23565,"47600":23650,"47601":23940,"47602":23943,"47603":24155,"47604":24163,"47605":24149,"47606":24151,"47607":24148,"47608":24275,"47609":24278,"47610":24330,"47611":24390,"47612":24432,"47613":24505,"47614":24903,"47680":24895,"47681":24907,"47682":24951,"47683":24930,"47684":24931,"47685":24927,"47686":24922,"47687":24920,"47688":24949,"47689":25130,"47690":25735,"47691":25688,"47692":25684,"47693":25764,"47694":25720,"47695":25695,"47696":25722,"47697":25681,"47698":25703,"47699":25652,"47700":25709,"47701":25723,"47702":25970,"47703":26017,"47704":26071,"47705":26070,"47706":26274,"47707":26280,"47708":26269,"47709":27036,"47710":27048,"47711":27029,"47712":27073,"47713":27054,"47714":27091,"47715":27083,"47716":27035,"47717":27063,"47718":27067,"47719":27051,"47720":27060,"47721":27088,"47722":27085,"47723":27053,"47724":27084,"47725":27046,"47726":27075,"47727":27043,"47728":27465,"47729":27468,"47730":27699,"47731":28467,"47732":28436,"47733":28414,"47734":28435,"47735":28404,"47736":28457,"47737":28478,"47738":28448,"47739":28460,"47740":28431,"47741":28418,"47742":28450,"47777":28415,"47778":28399,"47779":28422,"47780":28465,"47781":28472,"47782":28466,"47783":28451,"47784":28437,"47785":28459,"47786":28463,"47787":28552,"47788":28458,"47789":28396,"47790":28417,"47791":28402,"47792":28364,"47793":28407,"47794":29076,"47795":29081,"47796":29053,"47797":29066,"47798":29060,"47799":29074,"47800":29246,"47801":29330,"47802":29334,"47803":29508,"47804":29520,"47805":29796,"47806":29795,"47807":29802,"47808":29808,"47809":29805,"47810":29956,"47811":30097,"47812":30247,"47813":30221,"47814":30219,"47815":30217,"47816":30227,"47817":30433,"47818":30435,"47819":30596,"47820":30589,"47821":30591,"47822":30561,"47823":30913,"47824":30879,"47825":30887,"47826":30899,"47827":30889,"47828":30883,"47829":31118,"47830":31119,"47831":31117,"47832":31278,"47833":31281,"47834":31402,"47835":31401,"47836":31469,"47837":31471,"47838":31649,"47839":31637,"47840":31627,"47841":31605,"47842":31639,"47843":31645,"47844":31636,"47845":31631,"47846":31672,"47847":31623,"47848":31620,"47849":31929,"47850":31933,"47851":31934,"47852":32187,"47853":32176,"47854":32156,"47855":32189,"47856":32190,"47857":32160,"47858":32202,"47859":32180,"47860":32178,"47861":32177,"47862":32186,"47863":32162,"47864":32191,"47865":32181,"47866":32184,"47867":32173,"47868":32210,"47869":32199,"47870":32172,"47936":32624,"47937":32736,"47938":32737,"47939":32735,"47940":32862,"47941":32858,"47942":32903,"47943":33104,"47944":33152,"47945":33167,"47946":33160,"47947":33162,"47948":33151,"47949":33154,"47950":33255,"47951":33274,"47952":33287,"47953":33300,"47954":33310,"47955":33355,"47956":33993,"47957":33983,"47958":33990,"47959":33988,"47960":33945,"47961":33950,"47962":33970,"47963":33948,"47964":33995,"47965":33976,"47966":33984,"47967":34003,"47968":33936,"47969":33980,"47970":34001,"47971":33994,"47972":34623,"47973":34588,"47974":34619,"47975":34594,"47976":34597,"47977":34612,"47978":34584,"47979":34645,"47980":34615,"47981":34601,"47982":35059,"47983":35074,"47984":35060,"47985":35065,"47986":35064,"47987":35069,"47988":35048,"47989":35098,"47990":35055,"47991":35494,"47992":35468,"47993":35486,"47994":35491,"47995":35469,"47996":35489,"47997":35475,"47998":35492,"48033":35498,"48034":35493,"48035":35496,"48036":35480,"48037":35473,"48038":35482,"48039":35495,"48040":35946,"48041":35981,"48042":35980,"48043":36051,"48044":36049,"48045":36050,"48046":36203,"48047":36249,"48048":36245,"48049":36348,"48050":36628,"48051":36626,"48052":36629,"48053":36627,"48054":36771,"48055":36960,"48056":36952,"48057":36956,"48058":36963,"48059":36953,"48060":36958,"48061":36962,"48062":36957,"48063":36955,"48064":37145,"48065":37144,"48066":37150,"48067":37237,"48068":37240,"48069":37239,"48070":37236,"48071":37496,"48072":37504,"48073":37509,"48074":37528,"48075":37526,"48076":37499,"48077":37523,"48078":37532,"48079":37544,"48080":37500,"48081":37521,"48082":38305,"48083":38312,"48084":38313,"48085":38307,"48086":38309,"48087":38308,"48088":38553,"48089":38556,"48090":38555,"48091":38604,"48092":38610,"48093":38656,"48094":38780,"48095":38789,"48096":38902,"48097":38935,"48098":38936,"48099":39087,"48100":39089,"48101":39171,"48102":39173,"48103":39180,"48104":39177,"48105":39361,"48106":39599,"48107":39600,"48108":39654,"48109":39745,"48110":39746,"48111":40180,"48112":40182,"48113":40179,"48114":40636,"48115":40763,"48116":40778,"48117":20740,"48118":20736,"48119":20731,"48120":20725,"48121":20729,"48122":20738,"48123":20744,"48124":20745,"48125":20741,"48126":20956,"48192":21127,"48193":21128,"48194":21129,"48195":21133,"48196":21130,"48197":21232,"48198":21426,"48199":22062,"48200":22075,"48201":22073,"48202":22066,"48203":22079,"48204":22068,"48205":22057,"48206":22099,"48207":22094,"48208":22103,"48209":22132,"48210":22070,"48211":22063,"48212":22064,"48213":22656,"48214":22687,"48215":22686,"48216":22707,"48217":22684,"48218":22702,"48219":22697,"48220":22694,"48221":22893,"48222":23305,"48223":23291,"48224":23307,"48225":23285,"48226":23308,"48227":23304,"48228":23534,"48229":23532,"48230":23529,"48231":23531,"48232":23652,"48233":23653,"48234":23965,"48235":23956,"48236":24162,"48237":24159,"48238":24161,"48239":24290,"48240":24282,"48241":24287,"48242":24285,"48243":24291,"48244":24288,"48245":24392,"48246":24433,"48247":24503,"48248":24501,"48249":24950,"48250":24935,"48251":24942,"48252":24925,"48253":24917,"48254":24962,"48289":24956,"48290":24944,"48291":24939,"48292":24958,"48293":24999,"48294":24976,"48295":25003,"48296":24974,"48297":25004,"48298":24986,"48299":24996,"48300":24980,"48301":25006,"48302":25134,"48303":25705,"48304":25711,"48305":25721,"48306":25758,"48307":25778,"48308":25736,"48309":25744,"48310":25776,"48311":25765,"48312":25747,"48313":25749,"48314":25769,"48315":25746,"48316":25774,"48317":25773,"48318":25771,"48319":25754,"48320":25772,"48321":25753,"48322":25762,"48323":25779,"48324":25973,"48325":25975,"48326":25976,"48327":26286,"48328":26283,"48329":26292,"48330":26289,"48331":27171,"48332":27167,"48333":27112,"48334":27137,"48335":27166,"48336":27161,"48337":27133,"48338":27169,"48339":27155,"48340":27146,"48341":27123,"48342":27138,"48343":27141,"48344":27117,"48345":27153,"48346":27472,"48347":27470,"48348":27556,"48349":27589,"48350":27590,"48351":28479,"48352":28540,"48353":28548,"48354":28497,"48355":28518,"48356":28500,"48357":28550,"48358":28525,"48359":28507,"48360":28536,"48361":28526,"48362":28558,"48363":28538,"48364":28528,"48365":28516,"48366":28567,"48367":28504,"48368":28373,"48369":28527,"48370":28512,"48371":28511,"48372":29087,"48373":29100,"48374":29105,"48375":29096,"48376":29270,"48377":29339,"48378":29518,"48379":29527,"48380":29801,"48381":29835,"48382":29827,"48448":29822,"48449":29824,"48450":30079,"48451":30240,"48452":30249,"48453":30239,"48454":30244,"48455":30246,"48456":30241,"48457":30242,"48458":30362,"48459":30394,"48460":30436,"48461":30606,"48462":30599,"48463":30604,"48464":30609,"48465":30603,"48466":30923,"48467":30917,"48468":30906,"48469":30922,"48470":30910,"48471":30933,"48472":30908,"48473":30928,"48474":31295,"48475":31292,"48476":31296,"48477":31293,"48478":31287,"48479":31291,"48480":31407,"48481":31406,"48482":31661,"48483":31665,"48484":31684,"48485":31668,"48486":31686,"48487":31687,"48488":31681,"48489":31648,"48490":31692,"48491":31946,"48492":32224,"48493":32244,"48494":32239,"48495":32251,"48496":32216,"48497":32236,"48498":32221,"48499":32232,"48500":32227,"48501":32218,"48502":32222,"48503":32233,"48504":32158,"48505":32217,"48506":32242,"48507":32249,"48508":32629,"48509":32631,"48510":32687,"48545":32745,"48546":32806,"48547":33179,"48548":33180,"48549":33181,"48550":33184,"48551":33178,"48552":33176,"48553":34071,"48554":34109,"48555":34074,"48556":34030,"48557":34092,"48558":34093,"48559":34067,"48560":34065,"48561":34083,"48562":34081,"48563":34068,"48564":34028,"48565":34085,"48566":34047,"48567":34054,"48568":34690,"48569":34676,"48570":34678,"48571":34656,"48572":34662,"48573":34680,"48574":34664,"48575":34649,"48576":34647,"48577":34636,"48578":34643,"48579":34907,"48580":34909,"48581":35088,"48582":35079,"48583":35090,"48584":35091,"48585":35093,"48586":35082,"48587":35516,"48588":35538,"48589":35527,"48590":35524,"48591":35477,"48592":35531,"48593":35576,"48594":35506,"48595":35529,"48596":35522,"48597":35519,"48598":35504,"48599":35542,"48600":35533,"48601":35510,"48602":35513,"48603":35547,"48604":35916,"48605":35918,"48606":35948,"48607":36064,"48608":36062,"48609":36070,"48610":36068,"48611":36076,"48612":36077,"48613":36066,"48614":36067,"48615":36060,"48616":36074,"48617":36065,"48618":36205,"48619":36255,"48620":36259,"48621":36395,"48622":36368,"48623":36381,"48624":36386,"48625":36367,"48626":36393,"48627":36383,"48628":36385,"48629":36382,"48630":36538,"48631":36637,"48632":36635,"48633":36639,"48634":36649,"48635":36646,"48636":36650,"48637":36636,"48638":36638,"48704":36645,"48705":36969,"48706":36974,"48707":36968,"48708":36973,"48709":36983,"48710":37168,"48711":37165,"48712":37159,"48713":37169,"48714":37255,"48715":37257,"48716":37259,"48717":37251,"48718":37573,"48719":37563,"48720":37559,"48721":37610,"48722":37548,"48723":37604,"48724":37569,"48725":37555,"48726":37564,"48727":37586,"48728":37575,"48729":37616,"48730":37554,"48731":38317,"48732":38321,"48733":38660,"48734":38662,"48735":38663,"48736":38665,"48737":38752,"48738":38797,"48739":38795,"48740":38799,"48741":38945,"48742":38955,"48743":38940,"48744":39091,"48745":39178,"48746":39187,"48747":39186,"48748":39192,"48749":39389,"48750":39376,"48751":39391,"48752":39387,"48753":39377,"48754":39381,"48755":39378,"48756":39385,"48757":39607,"48758":39662,"48759":39663,"48760":39719,"48761":39749,"48762":39748,"48763":39799,"48764":39791,"48765":40198,"48766":40201,"48801":40195,"48802":40617,"48803":40638,"48804":40654,"48805":22696,"48806":40786,"48807":20754,"48808":20760,"48809":20756,"48810":20752,"48811":20757,"48812":20864,"48813":20906,"48814":20957,"48815":21137,"48816":21139,"48817":21235,"48818":22105,"48819":22123,"48820":22137,"48821":22121,"48822":22116,"48823":22136,"48824":22122,"48825":22120,"48826":22117,"48827":22129,"48828":22127,"48829":22124,"48830":22114,"48831":22134,"48832":22721,"48833":22718,"48834":22727,"48835":22725,"48836":22894,"48837":23325,"48838":23348,"48839":23416,"48840":23536,"48841":23566,"48842":24394,"48843":25010,"48844":24977,"48845":25001,"48846":24970,"48847":25037,"48848":25014,"48849":25022,"48850":25034,"48851":25032,"48852":25136,"48853":25797,"48854":25793,"48855":25803,"48856":25787,"48857":25788,"48858":25818,"48859":25796,"48860":25799,"48861":25794,"48862":25805,"48863":25791,"48864":25810,"48865":25812,"48866":25790,"48867":25972,"48868":26310,"48869":26313,"48870":26297,"48871":26308,"48872":26311,"48873":26296,"48874":27197,"48875":27192,"48876":27194,"48877":27225,"48878":27243,"48879":27224,"48880":27193,"48881":27204,"48882":27234,"48883":27233,"48884":27211,"48885":27207,"48886":27189,"48887":27231,"48888":27208,"48889":27481,"48890":27511,"48891":27653,"48892":28610,"48893":28593,"48894":28577,"48960":28611,"48961":28580,"48962":28609,"48963":28583,"48964":28595,"48965":28608,"48966":28601,"48967":28598,"48968":28582,"48969":28576,"48970":28596,"48971":29118,"48972":29129,"48973":29136,"48974":29138,"48975":29128,"48976":29141,"48977":29113,"48978":29134,"48979":29145,"48980":29148,"48981":29123,"48982":29124,"48983":29544,"48984":29852,"48985":29859,"48986":29848,"48987":29855,"48988":29854,"48989":29922,"48990":29964,"48991":29965,"48992":30260,"48993":30264,"48994":30266,"48995":30439,"48996":30437,"48997":30624,"48998":30622,"48999":30623,"49000":30629,"49001":30952,"49002":30938,"49003":30956,"49004":30951,"49005":31142,"49006":31309,"49007":31310,"49008":31302,"49009":31308,"49010":31307,"49011":31418,"49012":31705,"49013":31761,"49014":31689,"49015":31716,"49016":31707,"49017":31713,"49018":31721,"49019":31718,"49020":31957,"49021":31958,"49022":32266,"49057":32273,"49058":32264,"49059":32283,"49060":32291,"49061":32286,"49062":32285,"49063":32265,"49064":32272,"49065":32633,"49066":32690,"49067":32752,"49068":32753,"49069":32750,"49070":32808,"49071":33203,"49072":33193,"49073":33192,"49074":33275,"49075":33288,"49076":33368,"49077":33369,"49078":34122,"49079":34137,"49080":34120,"49081":34152,"49082":34153,"49083":34115,"49084":34121,"49085":34157,"49086":34154,"49087":34142,"49088":34691,"49089":34719,"49090":34718,"49091":34722,"49092":34701,"49093":34913,"49094":35114,"49095":35122,"49096":35109,"49097":35115,"49098":35105,"49099":35242,"49100":35238,"49101":35558,"49102":35578,"49103":35563,"49104":35569,"49105":35584,"49106":35548,"49107":35559,"49108":35566,"49109":35582,"49110":35585,"49111":35586,"49112":35575,"49113":35565,"49114":35571,"49115":35574,"49116":35580,"49117":35947,"49118":35949,"49119":35987,"49120":36084,"49121":36420,"49122":36401,"49123":36404,"49124":36418,"49125":36409,"49126":36405,"49127":36667,"49128":36655,"49129":36664,"49130":36659,"49131":36776,"49132":36774,"49133":36981,"49134":36980,"49135":36984,"49136":36978,"49137":36988,"49138":36986,"49139":37172,"49140":37266,"49141":37664,"49142":37686,"49143":37624,"49144":37683,"49145":37679,"49146":37666,"49147":37628,"49148":37675,"49149":37636,"49150":37658,"49216":37648,"49217":37670,"49218":37665,"49219":37653,"49220":37678,"49221":37657,"49222":38331,"49223":38567,"49224":38568,"49225":38570,"49226":38613,"49227":38670,"49228":38673,"49229":38678,"49230":38669,"49231":38675,"49232":38671,"49233":38747,"49234":38748,"49235":38758,"49236":38808,"49237":38960,"49238":38968,"49239":38971,"49240":38967,"49241":38957,"49242":38969,"49243":38948,"49244":39184,"49245":39208,"49246":39198,"49247":39195,"49248":39201,"49249":39194,"49250":39405,"49251":39394,"49252":39409,"49253":39608,"49254":39612,"49255":39675,"49256":39661,"49257":39720,"49258":39825,"49259":40213,"49260":40227,"49261":40230,"49262":40232,"49263":40210,"49264":40219,"49265":40664,"49266":40660,"49267":40845,"49268":40860,"49269":20778,"49270":20767,"49271":20769,"49272":20786,"49273":21237,"49274":22158,"49275":22144,"49276":22160,"49277":22149,"49278":22151,"49313":22159,"49314":22741,"49315":22739,"49316":22737,"49317":22734,"49318":23344,"49319":23338,"49320":23332,"49321":23418,"49322":23607,"49323":23656,"49324":23996,"49325":23994,"49326":23997,"49327":23992,"49328":24171,"49329":24396,"49330":24509,"49331":25033,"49332":25026,"49333":25031,"49334":25062,"49335":25035,"49336":25138,"49337":25140,"49338":25806,"49339":25802,"49340":25816,"49341":25824,"49342":25840,"49343":25830,"49344":25836,"49345":25841,"49346":25826,"49347":25837,"49348":25986,"49349":25987,"49350":26329,"49351":26326,"49352":27264,"49353":27284,"49354":27268,"49355":27298,"49356":27292,"49357":27355,"49358":27299,"49359":27262,"49360":27287,"49361":27280,"49362":27296,"49363":27484,"49364":27566,"49365":27610,"49366":27656,"49367":28632,"49368":28657,"49369":28639,"49370":28640,"49371":28635,"49372":28644,"49373":28651,"49374":28655,"49375":28544,"49376":28652,"49377":28641,"49378":28649,"49379":28629,"49380":28654,"49381":28656,"49382":29159,"49383":29151,"49384":29166,"49385":29158,"49386":29157,"49387":29165,"49388":29164,"49389":29172,"49390":29152,"49391":29237,"49392":29254,"49393":29552,"49394":29554,"49395":29865,"49396":29872,"49397":29862,"49398":29864,"49399":30278,"49400":30274,"49401":30284,"49402":30442,"49403":30643,"49404":30634,"49405":30640,"49406":30636,"49472":30631,"49473":30637,"49474":30703,"49475":30967,"49476":30970,"49477":30964,"49478":30959,"49479":30977,"49480":31143,"49481":31146,"49482":31319,"49483":31423,"49484":31751,"49485":31757,"49486":31742,"49487":31735,"49488":31756,"49489":31712,"49490":31968,"49491":31964,"49492":31966,"49493":31970,"49494":31967,"49495":31961,"49496":31965,"49497":32302,"49498":32318,"49499":32326,"49500":32311,"49501":32306,"49502":32323,"49503":32299,"49504":32317,"49505":32305,"49506":32325,"49507":32321,"49508":32308,"49509":32313,"49510":32328,"49511":32309,"49512":32319,"49513":32303,"49514":32580,"49515":32755,"49516":32764,"49517":32881,"49518":32882,"49519":32880,"49520":32879,"49521":32883,"49522":33222,"49523":33219,"49524":33210,"49525":33218,"49526":33216,"49527":33215,"49528":33213,"49529":33225,"49530":33214,"49531":33256,"49532":33289,"49533":33393,"49534":34218,"49569":34180,"49570":34174,"49571":34204,"49572":34193,"49573":34196,"49574":34223,"49575":34203,"49576":34183,"49577":34216,"49578":34186,"49579":34407,"49580":34752,"49581":34769,"49582":34739,"49583":34770,"49584":34758,"49585":34731,"49586":34747,"49587":34746,"49588":34760,"49589":34763,"49590":35131,"49591":35126,"49592":35140,"49593":35128,"49594":35133,"49595":35244,"49596":35598,"49597":35607,"49598":35609,"49599":35611,"49600":35594,"49601":35616,"49602":35613,"49603":35588,"49604":35600,"49605":35905,"49606":35903,"49607":35955,"49608":36090,"49609":36093,"49610":36092,"49611":36088,"49612":36091,"49613":36264,"49614":36425,"49615":36427,"49616":36424,"49617":36426,"49618":36676,"49619":36670,"49620":36674,"49621":36677,"49622":36671,"49623":36991,"49624":36989,"49625":36996,"49626":36993,"49627":36994,"49628":36992,"49629":37177,"49630":37283,"49631":37278,"49632":37276,"49633":37709,"49634":37762,"49635":37672,"49636":37749,"49637":37706,"49638":37733,"49639":37707,"49640":37656,"49641":37758,"49642":37740,"49643":37723,"49644":37744,"49645":37722,"49646":37716,"49647":38346,"49648":38347,"49649":38348,"49650":38344,"49651":38342,"49652":38577,"49653":38584,"49654":38614,"49655":38684,"49656":38686,"49657":38816,"49658":38867,"49659":38982,"49660":39094,"49661":39221,"49662":39425,"49728":39423,"49729":39854,"49730":39851,"49731":39850,"49732":39853,"49733":40251,"49734":40255,"49735":40587,"49736":40655,"49737":40670,"49738":40668,"49739":40669,"49740":40667,"49741":40766,"49742":40779,"49743":21474,"49744":22165,"49745":22190,"49746":22745,"49747":22744,"49748":23352,"49749":24413,"49750":25059,"49751":25139,"49752":25844,"49753":25842,"49754":25854,"49755":25862,"49756":25850,"49757":25851,"49758":25847,"49759":26039,"49760":26332,"49761":26406,"49762":27315,"49763":27308,"49764":27331,"49765":27323,"49766":27320,"49767":27330,"49768":27310,"49769":27311,"49770":27487,"49771":27512,"49772":27567,"49773":28681,"49774":28683,"49775":28670,"49776":28678,"49777":28666,"49778":28689,"49779":28687,"49780":29179,"49781":29180,"49782":29182,"49783":29176,"49784":29559,"49785":29557,"49786":29863,"49787":29887,"49788":29973,"49789":30294,"49790":30296,"49825":30290,"49826":30653,"49827":30655,"49828":30651,"49829":30652,"49830":30990,"49831":31150,"49832":31329,"49833":31330,"49834":31328,"49835":31428,"49836":31429,"49837":31787,"49838":31783,"49839":31786,"49840":31774,"49841":31779,"49842":31777,"49843":31975,"49844":32340,"49845":32341,"49846":32350,"49847":32346,"49848":32353,"49849":32338,"49850":32345,"49851":32584,"49852":32761,"49853":32763,"49854":32887,"49855":32886,"49856":33229,"49857":33231,"49858":33290,"49859":34255,"49860":34217,"49861":34253,"49862":34256,"49863":34249,"49864":34224,"49865":34234,"49866":34233,"49867":34214,"49868":34799,"49869":34796,"49870":34802,"49871":34784,"49872":35206,"49873":35250,"49874":35316,"49875":35624,"49876":35641,"49877":35628,"49878":35627,"49879":35920,"49880":36101,"49881":36441,"49882":36451,"49883":36454,"49884":36452,"49885":36447,"49886":36437,"49887":36544,"49888":36681,"49889":36685,"49890":36999,"49891":36995,"49892":37000,"49893":37291,"49894":37292,"49895":37328,"49896":37780,"49897":37770,"49898":37782,"49899":37794,"49900":37811,"49901":37806,"49902":37804,"49903":37808,"49904":37784,"49905":37786,"49906":37783,"49907":38356,"49908":38358,"49909":38352,"49910":38357,"49911":38626,"49912":38620,"49913":38617,"49914":38619,"49915":38622,"49916":38692,"49917":38819,"49918":38822,"49984":38829,"49985":38905,"49986":38989,"49987":38991,"49988":38988,"49989":38990,"49990":38995,"49991":39098,"49992":39230,"49993":39231,"49994":39229,"49995":39214,"49996":39333,"49997":39438,"49998":39617,"49999":39683,"50000":39686,"50001":39759,"50002":39758,"50003":39757,"50004":39882,"50005":39881,"50006":39933,"50007":39880,"50008":39872,"50009":40273,"50010":40285,"50011":40288,"50012":40672,"50013":40725,"50014":40748,"50015":20787,"50016":22181,"50017":22750,"50018":22751,"50019":22754,"50020":23541,"50021":40848,"50022":24300,"50023":25074,"50024":25079,"50025":25078,"50026":25077,"50027":25856,"50028":25871,"50029":26336,"50030":26333,"50031":27365,"50032":27357,"50033":27354,"50034":27347,"50035":28699,"50036":28703,"50037":28712,"50038":28698,"50039":28701,"50040":28693,"50041":28696,"50042":29190,"50043":29197,"50044":29272,"50045":29346,"50046":29560,"50081":29562,"50082":29885,"50083":29898,"50084":29923,"50085":30087,"50086":30086,"50087":30303,"50088":30305,"50089":30663,"50090":31001,"50091":31153,"50092":31339,"50093":31337,"50094":31806,"50095":31807,"50096":31800,"50097":31805,"50098":31799,"50099":31808,"50100":32363,"50101":32365,"50102":32377,"50103":32361,"50104":32362,"50105":32645,"50106":32371,"50107":32694,"50108":32697,"50109":32696,"50110":33240,"50111":34281,"50112":34269,"50113":34282,"50114":34261,"50115":34276,"50116":34277,"50117":34295,"50118":34811,"50119":34821,"50120":34829,"50121":34809,"50122":34814,"50123":35168,"50124":35167,"50125":35158,"50126":35166,"50127":35649,"50128":35676,"50129":35672,"50130":35657,"50131":35674,"50132":35662,"50133":35663,"50134":35654,"50135":35673,"50136":36104,"50137":36106,"50138":36476,"50139":36466,"50140":36487,"50141":36470,"50142":36460,"50143":36474,"50144":36468,"50145":36692,"50146":36686,"50147":36781,"50148":37002,"50149":37003,"50150":37297,"50151":37294,"50152":37857,"50153":37841,"50154":37855,"50155":37827,"50156":37832,"50157":37852,"50158":37853,"50159":37846,"50160":37858,"50161":37837,"50162":37848,"50163":37860,"50164":37847,"50165":37864,"50166":38364,"50167":38580,"50168":38627,"50169":38698,"50170":38695,"50171":38753,"50172":38876,"50173":38907,"50174":39006,"50240":39000,"50241":39003,"50242":39100,"50243":39237,"50244":39241,"50245":39446,"50246":39449,"50247":39693,"50248":39912,"50249":39911,"50250":39894,"50251":39899,"50252":40329,"50253":40289,"50254":40306,"50255":40298,"50256":40300,"50257":40594,"50258":40599,"50259":40595,"50260":40628,"50261":21240,"50262":22184,"50263":22199,"50264":22198,"50265":22196,"50266":22204,"50267":22756,"50268":23360,"50269":23363,"50270":23421,"50271":23542,"50272":24009,"50273":25080,"50274":25082,"50275":25880,"50276":25876,"50277":25881,"50278":26342,"50279":26407,"50280":27372,"50281":28734,"50282":28720,"50283":28722,"50284":29200,"50285":29563,"50286":29903,"50287":30306,"50288":30309,"50289":31014,"50290":31018,"50291":31020,"50292":31019,"50293":31431,"50294":31478,"50295":31820,"50296":31811,"50297":31821,"50298":31983,"50299":31984,"50300":36782,"50301":32381,"50302":32380,"50337":32386,"50338":32588,"50339":32768,"50340":33242,"50341":33382,"50342":34299,"50343":34297,"50344":34321,"50345":34298,"50346":34310,"50347":34315,"50348":34311,"50349":34314,"50350":34836,"50351":34837,"50352":35172,"50353":35258,"50354":35320,"50355":35696,"50356":35692,"50357":35686,"50358":35695,"50359":35679,"50360":35691,"50361":36111,"50362":36109,"50363":36489,"50364":36481,"50365":36485,"50366":36482,"50367":37300,"50368":37323,"50369":37912,"50370":37891,"50371":37885,"50372":38369,"50373":38704,"50374":39108,"50375":39250,"50376":39249,"50377":39336,"50378":39467,"50379":39472,"50380":39479,"50381":39477,"50382":39955,"50383":39949,"50384":40569,"50385":40629,"50386":40680,"50387":40751,"50388":40799,"50389":40803,"50390":40801,"50391":20791,"50392":20792,"50393":22209,"50394":22208,"50395":22210,"50396":22804,"50397":23660,"50398":24013,"50399":25084,"50400":25086,"50401":25885,"50402":25884,"50403":26005,"50404":26345,"50405":27387,"50406":27396,"50407":27386,"50408":27570,"50409":28748,"50410":29211,"50411":29351,"50412":29910,"50413":29908,"50414":30313,"50415":30675,"50416":31824,"50417":32399,"50418":32396,"50419":32700,"50420":34327,"50421":34349,"50422":34330,"50423":34851,"50424":34850,"50425":34849,"50426":34847,"50427":35178,"50428":35180,"50429":35261,"50430":35700,"50496":35703,"50497":35709,"50498":36115,"50499":36490,"50500":36493,"50501":36491,"50502":36703,"50503":36783,"50504":37306,"50505":37934,"50506":37939,"50507":37941,"50508":37946,"50509":37944,"50510":37938,"50511":37931,"50512":38370,"50513":38712,"50514":38713,"50515":38706,"50516":38911,"50517":39015,"50518":39013,"50519":39255,"50520":39493,"50521":39491,"50522":39488,"50523":39486,"50524":39631,"50525":39764,"50526":39761,"50527":39981,"50528":39973,"50529":40367,"50530":40372,"50531":40386,"50532":40376,"50533":40605,"50534":40687,"50535":40729,"50536":40796,"50537":40806,"50538":40807,"50539":20796,"50540":20795,"50541":22216,"50542":22218,"50543":22217,"50544":23423,"50545":24020,"50546":24018,"50547":24398,"50548":25087,"50549":25892,"50550":27402,"50551":27489,"50552":28753,"50553":28760,"50554":29568,"50555":29924,"50556":30090,"50557":30318,"50558":30316,"50593":31155,"50594":31840,"50595":31839,"50596":32894,"50597":32893,"50598":33247,"50599":35186,"50600":35183,"50601":35324,"50602":35712,"50603":36118,"50604":36119,"50605":36497,"50606":36499,"50607":36705,"50608":37192,"50609":37956,"50610":37969,"50611":37970,"50612":38717,"50613":38718,"50614":38851,"50615":38849,"50616":39019,"50617":39253,"50618":39509,"50619":39501,"50620":39634,"50621":39706,"50622":40009,"50623":39985,"50624":39998,"50625":39995,"50626":40403,"50627":40407,"50628":40756,"50629":40812,"50630":40810,"50631":40852,"50632":22220,"50633":24022,"50634":25088,"50635":25891,"50636":25899,"50637":25898,"50638":26348,"50639":27408,"50640":29914,"50641":31434,"50642":31844,"50643":31843,"50644":31845,"50645":32403,"50646":32406,"50647":32404,"50648":33250,"50649":34360,"50650":34367,"50651":34865,"50652":35722,"50653":37008,"50654":37007,"50655":37987,"50656":37984,"50657":37988,"50658":38760,"50659":39023,"50660":39260,"50661":39514,"50662":39515,"50663":39511,"50664":39635,"50665":39636,"50666":39633,"50667":40020,"50668":40023,"50669":40022,"50670":40421,"50671":40607,"50672":40692,"50673":22225,"50674":22761,"50675":25900,"50676":28766,"50677":30321,"50678":30322,"50679":30679,"50680":32592,"50681":32648,"50682":34870,"50683":34873,"50684":34914,"50685":35731,"50686":35730,"50752":35734,"50753":33399,"50754":36123,"50755":37312,"50756":37994,"50757":38722,"50758":38728,"50759":38724,"50760":38854,"50761":39024,"50762":39519,"50763":39714,"50764":39768,"50765":40031,"50766":40441,"50767":40442,"50768":40572,"50769":40573,"50770":40711,"50771":40823,"50772":40818,"50773":24307,"50774":27414,"50775":28771,"50776":31852,"50777":31854,"50778":34875,"50779":35264,"50780":36513,"50781":37313,"50782":38002,"50783":38000,"50784":39025,"50785":39262,"50786":39638,"50787":39715,"50788":40652,"50789":28772,"50790":30682,"50791":35738,"50792":38007,"50793":38857,"50794":39522,"50795":39525,"50796":32412,"50797":35740,"50798":36522,"50799":37317,"50800":38013,"50801":38014,"50802":38012,"50803":40055,"50804":40056,"50805":40695,"50806":35924,"50807":38015,"50808":40474,"50809":29224,"50810":39530,"50811":39729,"50812":40475,"50813":40478,"50814":31858,"50849":9312,"50850":9313,"50851":9314,"50852":9315,"50853":9316,"50854":9317,"50855":9318,"50856":9319,"50857":9320,"50858":9321,"50859":9332,"50860":9333,"50861":9334,"50862":9335,"50863":9336,"50864":9337,"50865":9338,"50866":9339,"50867":9340,"50868":9341,"50869":8560,"50870":8561,"50871":8562,"50872":8563,"50873":8564,"50874":8565,"50875":8566,"50876":8567,"50877":8568,"50878":8569,"50879":20022,"50880":20031,"50881":20101,"50882":20128,"50883":20866,"50884":20886,"50885":20907,"50886":21241,"50887":21304,"50888":21353,"50889":21430,"50890":22794,"50891":23424,"50892":24027,"50893":24186,"50894":24191,"50895":24308,"50896":24400,"50897":24417,"50898":25908,"50899":26080,"50900":30098,"50901":30326,"50902":36789,"50903":38582,"50904":168,"50905":710,"50906":12541,"50907":12542,"50908":12445,"50909":12446,"50910":12291,"50911":20189,"50912":12293,"50913":12294,"50914":12295,"50915":12540,"50916":65339,"50917":65341,"50918":10045,"50919":12353,"50920":12354,"50921":12355,"50922":12356,"50923":12357,"50924":12358,"50925":12359,"50926":12360,"50927":12361,"50928":12362,"50929":12363,"50930":12364,"50931":12365,"50932":12366,"50933":12367,"50934":12368,"50935":12369,"50936":12370,"50937":12371,"50938":12372,"50939":12373,"50940":12374,"50941":12375,"50942":12376,"51008":12377,"51009":12378,"51010":12379,"51011":12380,"51012":12381,"51013":12382,"51014":12383,"51015":12384,"51016":12385,"51017":12386,"51018":12387,"51019":12388,"51020":12389,"51021":12390,"51022":12391,"51023":12392,"51024":12393,"51025":12394,"51026":12395,"51027":12396,"51028":12397,"51029":12398,"51030":12399,"51031":12400,"51032":12401,"51033":12402,"51034":12403,"51035":12404,"51036":12405,"51037":12406,"51038":12407,"51039":12408,"51040":12409,"51041":12410,"51042":12411,"51043":12412,"51044":12413,"51045":12414,"51046":12415,"51047":12416,"51048":12417,"51049":12418,"51050":12419,"51051":12420,"51052":12421,"51053":12422,"51054":12423,"51055":12424,"51056":12425,"51057":12426,"51058":12427,"51059":12428,"51060":12429,"51061":12430,"51062":12431,"51063":12432,"51064":12433,"51065":12434,"51066":12435,"51067":12449,"51068":12450,"51069":12451,"51070":12452,"51105":12453,"51106":12454,"51107":12455,"51108":12456,"51109":12457,"51110":12458,"51111":12459,"51112":12460,"51113":12461,"51114":12462,"51115":12463,"51116":12464,"51117":12465,"51118":12466,"51119":12467,"51120":12468,"51121":12469,"51122":12470,"51123":12471,"51124":12472,"51125":12473,"51126":12474,"51127":12475,"51128":12476,"51129":12477,"51130":12478,"51131":12479,"51132":12480,"51133":12481,"51134":12482,"51135":12483,"51136":12484,"51137":12485,"51138":12486,"51139":12487,"51140":12488,"51141":12489,"51142":12490,"51143":12491,"51144":12492,"51145":12493,"51146":12494,"51147":12495,"51148":12496,"51149":12497,"51150":12498,"51151":12499,"51152":12500,"51153":12501,"51154":12502,"51155":12503,"51156":12504,"51157":12505,"51158":12506,"51159":12507,"51160":12508,"51161":12509,"51162":12510,"51163":12511,"51164":12512,"51165":12513,"51166":12514,"51167":12515,"51168":12516,"51169":12517,"51170":12518,"51171":12519,"51172":12520,"51173":12521,"51174":12522,"51175":12523,"51176":12524,"51177":12525,"51178":12526,"51179":12527,"51180":12528,"51181":12529,"51182":12530,"51183":12531,"51184":12532,"51185":12533,"51186":12534,"51187":1040,"51188":1041,"51189":1042,"51190":1043,"51191":1044,"51192":1045,"51193":1025,"51194":1046,"51195":1047,"51196":1048,"51197":1049,"51198":1050,"51264":1051,"51265":1052,"51266":1053,"51267":1054,"51268":1055,"51269":1056,"51270":1057,"51271":1058,"51272":1059,"51273":1060,"51274":1061,"51275":1062,"51276":1063,"51277":1064,"51278":1065,"51279":1066,"51280":1067,"51281":1068,"51282":1069,"51283":1070,"51284":1071,"51285":1072,"51286":1073,"51287":1074,"51288":1075,"51289":1076,"51290":1077,"51291":1105,"51292":1078,"51293":1079,"51294":1080,"51295":1081,"51296":1082,"51297":1083,"51298":1084,"51299":1085,"51300":1086,"51301":1087,"51302":1088,"51303":1089,"51304":1090,"51305":1091,"51306":1092,"51307":1093,"51308":1094,"51309":1095,"51310":1096,"51311":1097,"51312":1098,"51313":1099,"51314":1100,"51315":1101,"51316":1102,"51317":1103,"51318":8679,"51319":8632,"51320":8633,"51321":12751,"51322":63462,"51323":20058,"51324":63464,"51325":20994,"51326":17553,"51361":40880,"51362":20872,"51363":40881,"51364":63470,"51365":63471,"51366":63472,"51367":63473,"51368":63474,"51369":63475,"51370":63476,"51371":63477,"51372":63478,"51373":63479,"51374":63480,"51375":63481,"51376":63482,"51377":12443,"51378":12444,"51379":12436,"51380":12535,"51381":12536,"51382":12537,"51383":12538,"51384":12539,"51385":65377,"51386":65378,"51387":65379,"51388":65380,"51389":65381,"51390":65382,"51391":65383,"51392":65384,"51393":65385,"51394":65386,"51395":65387,"51396":65388,"51397":65389,"51398":65390,"51399":65391,"51400":65392,"51401":65393,"51402":65394,"51403":65395,"51404":65396,"51405":65506,"51406":65508,"51407":65287,"51408":65282,"51409":12849,"51410":8470,"51411":8481,"51412":65397,"51413":65398,"51414":65399,"51415":65400,"51416":65401,"51417":65402,"51418":65403,"51419":65404,"51420":65405,"51421":65406,"51422":65407,"51423":65408,"51424":65409,"51425":65410,"51426":65411,"51427":65412,"51428":65413,"51429":65414,"51430":65415,"51431":65416,"51432":65417,"51433":65418,"51434":65419,"51435":65420,"51436":65421,"51437":65422,"51438":65423,"51439":65424,"51440":65425,"51441":65426,"51442":65427,"51443":65428,"51444":65429,"51445":65430,"51446":65431,"51447":65432,"51448":65433,"51449":65434,"51450":65435,"51451":65436,"51452":65437,"51453":65438,"51454":65439,"51520":20034,"51521":20060,"51522":20981,"51523":21274,"51524":21378,"51525":19975,"51526":19980,"51527":20039,"51528":20109,"51529":22231,"51530":64012,"51531":23662,"51532":24435,"51533":19983,"51534":20871,"51535":19982,"51536":20014,"51537":20115,"51538":20162,"51539":20169,"51540":20168,"51541":20888,"51542":21244,"51543":21356,"51544":21433,"51545":22304,"51546":22787,"51547":22828,"51548":23568,"51549":24063,"51550":26081,"51551":27571,"51552":27596,"51553":27668,"51554":29247,"51555":20017,"51556":20028,"51557":20200,"51558":20188,"51559":20201,"51560":20193,"51561":20189,"51562":20186,"51563":21004,"51564":21276,"51565":21324,"51566":22306,"51567":22307,"51568":22807,"51569":22831,"51570":23425,"51571":23428,"51572":23570,"51573":23611,"51574":23668,"51575":23667,"51576":24068,"51577":24192,"51578":24194,"51579":24521,"51580":25097,"51581":25168,"51582":27669,"51617":27702,"51618":27715,"51619":27711,"51620":27707,"51621":29358,"51622":29360,"51623":29578,"51624":31160,"51625":32906,"51626":38430,"51627":20238,"51628":20248,"51629":20268,"51630":20213,"51631":20244,"51632":20209,"51633":20224,"51634":20215,"51635":20232,"51636":20253,"51637":20226,"51638":20229,"51639":20258,"51640":20243,"51641":20228,"51642":20212,"51643":20242,"51644":20913,"51645":21011,"51646":21001,"51647":21008,"51648":21158,"51649":21282,"51650":21279,"51651":21325,"51652":21386,"51653":21511,"51654":22241,"51655":22239,"51656":22318,"51657":22314,"51658":22324,"51659":22844,"51660":22912,"51661":22908,"51662":22917,"51663":22907,"51664":22910,"51665":22903,"51666":22911,"51667":23382,"51668":23573,"51669":23589,"51670":23676,"51671":23674,"51672":23675,"51673":23678,"51674":24031,"51675":24181,"51676":24196,"51677":24322,"51678":24346,"51679":24436,"51680":24533,"51681":24532,"51682":24527,"51683":25180,"51684":25182,"51685":25188,"51686":25185,"51687":25190,"51688":25186,"51689":25177,"51690":25184,"51691":25178,"51692":25189,"51693":26095,"51694":26094,"51695":26430,"51696":26425,"51697":26424,"51698":26427,"51699":26426,"51700":26431,"51701":26428,"51702":26419,"51703":27672,"51704":27718,"51705":27730,"51706":27740,"51707":27727,"51708":27722,"51709":27732,"51710":27723,"51776":27724,"51777":28785,"51778":29278,"51779":29364,"51780":29365,"51781":29582,"51782":29994,"51783":30335,"51784":31349,"51785":32593,"51786":33400,"51787":33404,"51788":33408,"51789":33405,"51790":33407,"51791":34381,"51792":35198,"51793":37017,"51794":37015,"51795":37016,"51796":37019,"51797":37012,"51798":38434,"51799":38436,"51800":38432,"51801":38435,"51802":20310,"51803":20283,"51804":20322,"51805":20297,"51806":20307,"51807":20324,"51808":20286,"51809":20327,"51810":20306,"51811":20319,"51812":20289,"51813":20312,"51814":20269,"51815":20275,"51816":20287,"51817":20321,"51818":20879,"51819":20921,"51820":21020,"51821":21022,"51822":21025,"51823":21165,"51824":21166,"51825":21257,"51826":21347,"51827":21362,"51828":21390,"51829":21391,"51830":21552,"51831":21559,"51832":21546,"51833":21588,"51834":21573,"51835":21529,"51836":21532,"51837":21541,"51838":21528,"51873":21565,"51874":21583,"51875":21569,"51876":21544,"51877":21540,"51878":21575,"51879":22254,"51880":22247,"51881":22245,"51882":22337,"51883":22341,"51884":22348,"51885":22345,"51886":22347,"51887":22354,"51888":22790,"51889":22848,"51890":22950,"51891":22936,"51892":22944,"51893":22935,"51894":22926,"51895":22946,"51896":22928,"51897":22927,"51898":22951,"51899":22945,"51900":23438,"51901":23442,"51902":23592,"51903":23594,"51904":23693,"51905":23695,"51906":23688,"51907":23691,"51908":23689,"51909":23698,"51910":23690,"51911":23686,"51912":23699,"51913":23701,"51914":24032,"51915":24074,"51916":24078,"51917":24203,"51918":24201,"51919":24204,"51920":24200,"51921":24205,"51922":24325,"51923":24349,"51924":24440,"51925":24438,"51926":24530,"51927":24529,"51928":24528,"51929":24557,"51930":24552,"51931":24558,"51932":24563,"51933":24545,"51934":24548,"51935":24547,"51936":24570,"51937":24559,"51938":24567,"51939":24571,"51940":24576,"51941":24564,"51942":25146,"51943":25219,"51944":25228,"51945":25230,"51946":25231,"51947":25236,"51948":25223,"51949":25201,"51950":25211,"51951":25210,"51952":25200,"51953":25217,"51954":25224,"51955":25207,"51956":25213,"51957":25202,"51958":25204,"51959":25911,"51960":26096,"51961":26100,"51962":26099,"51963":26098,"51964":26101,"51965":26437,"51966":26439,"52032":26457,"52033":26453,"52034":26444,"52035":26440,"52036":26461,"52037":26445,"52038":26458,"52039":26443,"52040":27600,"52041":27673,"52042":27674,"52043":27768,"52044":27751,"52045":27755,"52046":27780,"52047":27787,"52048":27791,"52049":27761,"52050":27759,"52051":27753,"52052":27802,"52053":27757,"52054":27783,"52055":27797,"52056":27804,"52057":27750,"52058":27763,"52059":27749,"52060":27771,"52061":27790,"52062":28788,"52063":28794,"52064":29283,"52065":29375,"52066":29373,"52067":29379,"52068":29382,"52069":29377,"52070":29370,"52071":29381,"52072":29589,"52073":29591,"52074":29587,"52075":29588,"52076":29586,"52077":30010,"52078":30009,"52079":30100,"52080":30101,"52081":30337,"52082":31037,"52083":32820,"52084":32917,"52085":32921,"52086":32912,"52087":32914,"52088":32924,"52089":33424,"52090":33423,"52091":33413,"52092":33422,"52093":33425,"52094":33427,"52129":33418,"52130":33411,"52131":33412,"52132":35960,"52133":36809,"52134":36799,"52135":37023,"52136":37025,"52137":37029,"52138":37022,"52139":37031,"52140":37024,"52141":38448,"52142":38440,"52143":38447,"52144":38445,"52145":20019,"52146":20376,"52147":20348,"52148":20357,"52149":20349,"52150":20352,"52151":20359,"52152":20342,"52153":20340,"52154":20361,"52155":20356,"52156":20343,"52157":20300,"52158":20375,"52159":20330,"52160":20378,"52161":20345,"52162":20353,"52163":20344,"52164":20368,"52165":20380,"52166":20372,"52167":20382,"52168":20370,"52169":20354,"52170":20373,"52171":20331,"52172":20334,"52173":20894,"52174":20924,"52175":20926,"52176":21045,"52177":21042,"52178":21043,"52179":21062,"52180":21041,"52181":21180,"52182":21258,"52183":21259,"52184":21308,"52185":21394,"52186":21396,"52187":21639,"52188":21631,"52189":21633,"52190":21649,"52191":21634,"52192":21640,"52193":21611,"52194":21626,"52195":21630,"52196":21605,"52197":21612,"52198":21620,"52199":21606,"52200":21645,"52201":21615,"52202":21601,"52203":21600,"52204":21656,"52205":21603,"52206":21607,"52207":21604,"52208":22263,"52209":22265,"52210":22383,"52211":22386,"52212":22381,"52213":22379,"52214":22385,"52215":22384,"52216":22390,"52217":22400,"52218":22389,"52219":22395,"52220":22387,"52221":22388,"52222":22370,"52288":22376,"52289":22397,"52290":22796,"52291":22853,"52292":22965,"52293":22970,"52294":22991,"52295":22990,"52296":22962,"52297":22988,"52298":22977,"52299":22966,"52300":22972,"52301":22979,"52302":22998,"52303":22961,"52304":22973,"52305":22976,"52306":22984,"52307":22964,"52308":22983,"52309":23394,"52310":23397,"52311":23443,"52312":23445,"52313":23620,"52314":23623,"52315":23726,"52316":23716,"52317":23712,"52318":23733,"52319":23727,"52320":23720,"52321":23724,"52322":23711,"52323":23715,"52324":23725,"52325":23714,"52326":23722,"52327":23719,"52328":23709,"52329":23717,"52330":23734,"52331":23728,"52332":23718,"52333":24087,"52334":24084,"52335":24089,"52336":24360,"52337":24354,"52338":24355,"52339":24356,"52340":24404,"52341":24450,"52342":24446,"52343":24445,"52344":24542,"52345":24549,"52346":24621,"52347":24614,"52348":24601,"52349":24626,"52350":24587,"52385":24628,"52386":24586,"52387":24599,"52388":24627,"52389":24602,"52390":24606,"52391":24620,"52392":24610,"52393":24589,"52394":24592,"52395":24622,"52396":24595,"52397":24593,"52398":24588,"52399":24585,"52400":24604,"52401":25108,"52402":25149,"52403":25261,"52404":25268,"52405":25297,"52406":25278,"52407":25258,"52408":25270,"52409":25290,"52410":25262,"52411":25267,"52412":25263,"52413":25275,"52414":25257,"52415":25264,"52416":25272,"52417":25917,"52418":26024,"52419":26043,"52420":26121,"52421":26108,"52422":26116,"52423":26130,"52424":26120,"52425":26107,"52426":26115,"52427":26123,"52428":26125,"52429":26117,"52430":26109,"52431":26129,"52432":26128,"52433":26358,"52434":26378,"52435":26501,"52436":26476,"52437":26510,"52438":26514,"52439":26486,"52440":26491,"52441":26520,"52442":26502,"52443":26500,"52444":26484,"52445":26509,"52446":26508,"52447":26490,"52448":26527,"52449":26513,"52450":26521,"52451":26499,"52452":26493,"52453":26497,"52454":26488,"52455":26489,"52456":26516,"52457":27429,"52458":27520,"52459":27518,"52460":27614,"52461":27677,"52462":27795,"52463":27884,"52464":27883,"52465":27886,"52466":27865,"52467":27830,"52468":27860,"52469":27821,"52470":27879,"52471":27831,"52472":27856,"52473":27842,"52474":27834,"52475":27843,"52476":27846,"52477":27885,"52478":27890,"52544":27858,"52545":27869,"52546":27828,"52547":27786,"52548":27805,"52549":27776,"52550":27870,"52551":27840,"52552":27952,"52553":27853,"52554":27847,"52555":27824,"52556":27897,"52557":27855,"52558":27881,"52559":27857,"52560":28820,"52561":28824,"52562":28805,"52563":28819,"52564":28806,"52565":28804,"52566":28817,"52567":28822,"52568":28802,"52569":28826,"52570":28803,"52571":29290,"52572":29398,"52573":29387,"52574":29400,"52575":29385,"52576":29404,"52577":29394,"52578":29396,"52579":29402,"52580":29388,"52581":29393,"52582":29604,"52583":29601,"52584":29613,"52585":29606,"52586":29602,"52587":29600,"52588":29612,"52589":29597,"52590":29917,"52591":29928,"52592":30015,"52593":30016,"52594":30014,"52595":30092,"52596":30104,"52597":30383,"52598":30451,"52599":30449,"52600":30448,"52601":30453,"52602":30712,"52603":30716,"52604":30713,"52605":30715,"52606":30714,"52641":30711,"52642":31042,"52643":31039,"52644":31173,"52645":31352,"52646":31355,"52647":31483,"52648":31861,"52649":31997,"52650":32821,"52651":32911,"52652":32942,"52653":32931,"52654":32952,"52655":32949,"52656":32941,"52657":33312,"52658":33440,"52659":33472,"52660":33451,"52661":33434,"52662":33432,"52663":33435,"52664":33461,"52665":33447,"52666":33454,"52667":33468,"52668":33438,"52669":33466,"52670":33460,"52671":33448,"52672":33441,"52673":33449,"52674":33474,"52675":33444,"52676":33475,"52677":33462,"52678":33442,"52679":34416,"52680":34415,"52681":34413,"52682":34414,"52683":35926,"52684":36818,"52685":36811,"52686":36819,"52687":36813,"52688":36822,"52689":36821,"52690":36823,"52691":37042,"52692":37044,"52693":37039,"52694":37043,"52695":37040,"52696":38457,"52697":38461,"52698":38460,"52699":38458,"52700":38467,"52701":20429,"52702":20421,"52703":20435,"52704":20402,"52705":20425,"52706":20427,"52707":20417,"52708":20436,"52709":20444,"52710":20441,"52711":20411,"52712":20403,"52713":20443,"52714":20423,"52715":20438,"52716":20410,"52717":20416,"52718":20409,"52719":20460,"52720":21060,"52721":21065,"52722":21184,"52723":21186,"52724":21309,"52725":21372,"52726":21399,"52727":21398,"52728":21401,"52729":21400,"52730":21690,"52731":21665,"52732":21677,"52733":21669,"52734":21711,"52800":21699,"52801":33549,"52802":21687,"52803":21678,"52804":21718,"52805":21686,"52806":21701,"52807":21702,"52808":21664,"52809":21616,"52810":21692,"52811":21666,"52812":21694,"52813":21618,"52814":21726,"52815":21680,"52816":22453,"52817":22430,"52818":22431,"52819":22436,"52820":22412,"52821":22423,"52822":22429,"52823":22427,"52824":22420,"52825":22424,"52826":22415,"52827":22425,"52828":22437,"52829":22426,"52830":22421,"52831":22772,"52832":22797,"52833":22867,"52834":23009,"52835":23006,"52836":23022,"52837":23040,"52838":23025,"52839":23005,"52840":23034,"52841":23037,"52842":23036,"52843":23030,"52844":23012,"52845":23026,"52846":23031,"52847":23003,"52848":23017,"52849":23027,"52850":23029,"52851":23008,"52852":23038,"52853":23028,"52854":23021,"52855":23464,"52856":23628,"52857":23760,"52858":23768,"52859":23756,"52860":23767,"52861":23755,"52862":23771,"52897":23774,"52898":23770,"52899":23753,"52900":23751,"52901":23754,"52902":23766,"52903":23763,"52904":23764,"52905":23759,"52906":23752,"52907":23750,"52908":23758,"52909":23775,"52910":23800,"52911":24057,"52912":24097,"52913":24098,"52914":24099,"52915":24096,"52916":24100,"52917":24240,"52918":24228,"52919":24226,"52920":24219,"52921":24227,"52922":24229,"52923":24327,"52924":24366,"52925":24406,"52926":24454,"52927":24631,"52928":24633,"52929":24660,"52930":24690,"52931":24670,"52932":24645,"52933":24659,"52934":24647,"52935":24649,"52936":24667,"52937":24652,"52938":24640,"52939":24642,"52940":24671,"52941":24612,"52942":24644,"52943":24664,"52944":24678,"52945":24686,"52946":25154,"52947":25155,"52948":25295,"52949":25357,"52950":25355,"52951":25333,"52952":25358,"52953":25347,"52954":25323,"52955":25337,"52956":25359,"52957":25356,"52958":25336,"52959":25334,"52960":25344,"52961":25363,"52962":25364,"52963":25338,"52964":25365,"52965":25339,"52966":25328,"52967":25921,"52968":25923,"52969":26026,"52970":26047,"52971":26166,"52972":26145,"52973":26162,"52974":26165,"52975":26140,"52976":26150,"52977":26146,"52978":26163,"52979":26155,"52980":26170,"52981":26141,"52982":26164,"52983":26169,"52984":26158,"52985":26383,"52986":26384,"52987":26561,"52988":26610,"52989":26568,"52990":26554,"53056":26588,"53057":26555,"53058":26616,"53059":26584,"53060":26560,"53061":26551,"53062":26565,"53063":26603,"53064":26596,"53065":26591,"53066":26549,"53067":26573,"53068":26547,"53069":26615,"53070":26614,"53071":26606,"53072":26595,"53073":26562,"53074":26553,"53075":26574,"53076":26599,"53077":26608,"53078":26546,"53079":26620,"53080":26566,"53081":26605,"53082":26572,"53083":26542,"53084":26598,"53085":26587,"53086":26618,"53087":26569,"53088":26570,"53089":26563,"53090":26602,"53091":26571,"53092":27432,"53093":27522,"53094":27524,"53095":27574,"53096":27606,"53097":27608,"53098":27616,"53099":27680,"53100":27681,"53101":27944,"53102":27956,"53103":27949,"53104":27935,"53105":27964,"53106":27967,"53107":27922,"53108":27914,"53109":27866,"53110":27955,"53111":27908,"53112":27929,"53113":27962,"53114":27930,"53115":27921,"53116":27904,"53117":27933,"53118":27970,"53153":27905,"53154":27928,"53155":27959,"53156":27907,"53157":27919,"53158":27968,"53159":27911,"53160":27936,"53161":27948,"53162":27912,"53163":27938,"53164":27913,"53165":27920,"53166":28855,"53167":28831,"53168":28862,"53169":28849,"53170":28848,"53171":28833,"53172":28852,"53173":28853,"53174":28841,"53175":29249,"53176":29257,"53177":29258,"53178":29292,"53179":29296,"53180":29299,"53181":29294,"53182":29386,"53183":29412,"53184":29416,"53185":29419,"53186":29407,"53187":29418,"53188":29414,"53189":29411,"53190":29573,"53191":29644,"53192":29634,"53193":29640,"53194":29637,"53195":29625,"53196":29622,"53197":29621,"53198":29620,"53199":29675,"53200":29631,"53201":29639,"53202":29630,"53203":29635,"53204":29638,"53205":29624,"53206":29643,"53207":29932,"53208":29934,"53209":29998,"53210":30023,"53211":30024,"53212":30119,"53213":30122,"53214":30329,"53215":30404,"53216":30472,"53217":30467,"53218":30468,"53219":30469,"53220":30474,"53221":30455,"53222":30459,"53223":30458,"53224":30695,"53225":30696,"53226":30726,"53227":30737,"53228":30738,"53229":30725,"53230":30736,"53231":30735,"53232":30734,"53233":30729,"53234":30723,"53235":30739,"53236":31050,"53237":31052,"53238":31051,"53239":31045,"53240":31044,"53241":31189,"53242":31181,"53243":31183,"53244":31190,"53245":31182,"53246":31360,"53312":31358,"53313":31441,"53314":31488,"53315":31489,"53316":31866,"53317":31864,"53318":31865,"53319":31871,"53320":31872,"53321":31873,"53322":32003,"53323":32008,"53324":32001,"53325":32600,"53326":32657,"53327":32653,"53328":32702,"53329":32775,"53330":32782,"53331":32783,"53332":32788,"53333":32823,"53334":32984,"53335":32967,"53336":32992,"53337":32977,"53338":32968,"53339":32962,"53340":32976,"53341":32965,"53342":32995,"53343":32985,"53344":32988,"53345":32970,"53346":32981,"53347":32969,"53348":32975,"53349":32983,"53350":32998,"53351":32973,"53352":33279,"53353":33313,"53354":33428,"53355":33497,"53356":33534,"53357":33529,"53358":33543,"53359":33512,"53360":33536,"53361":33493,"53362":33594,"53363":33515,"53364":33494,"53365":33524,"53366":33516,"53367":33505,"53368":33522,"53369":33525,"53370":33548,"53371":33531,"53372":33526,"53373":33520,"53374":33514,"53409":33508,"53410":33504,"53411":33530,"53412":33523,"53413":33517,"53414":34423,"53415":34420,"53416":34428,"53417":34419,"53418":34881,"53419":34894,"53420":34919,"53421":34922,"53422":34921,"53423":35283,"53424":35332,"53425":35335,"53426":36210,"53427":36835,"53428":36833,"53429":36846,"53430":36832,"53431":37105,"53432":37053,"53433":37055,"53434":37077,"53435":37061,"53436":37054,"53437":37063,"53438":37067,"53439":37064,"53440":37332,"53441":37331,"53442":38484,"53443":38479,"53444":38481,"53445":38483,"53446":38474,"53447":38478,"53448":20510,"53449":20485,"53450":20487,"53451":20499,"53452":20514,"53453":20528,"53454":20507,"53455":20469,"53456":20468,"53457":20531,"53458":20535,"53459":20524,"53460":20470,"53461":20471,"53462":20503,"53463":20508,"53464":20512,"53465":20519,"53466":20533,"53467":20527,"53468":20529,"53469":20494,"53470":20826,"53471":20884,"53472":20883,"53473":20938,"53474":20932,"53475":20933,"53476":20936,"53477":20942,"53478":21089,"53479":21082,"53480":21074,"53481":21086,"53482":21087,"53483":21077,"53484":21090,"53485":21197,"53486":21262,"53487":21406,"53488":21798,"53489":21730,"53490":21783,"53491":21778,"53492":21735,"53493":21747,"53494":21732,"53495":21786,"53496":21759,"53497":21764,"53498":21768,"53499":21739,"53500":21777,"53501":21765,"53502":21745,"53568":21770,"53569":21755,"53570":21751,"53571":21752,"53572":21728,"53573":21774,"53574":21763,"53575":21771,"53576":22273,"53577":22274,"53578":22476,"53579":22578,"53580":22485,"53581":22482,"53582":22458,"53583":22470,"53584":22461,"53585":22460,"53586":22456,"53587":22454,"53588":22463,"53589":22471,"53590":22480,"53591":22457,"53592":22465,"53593":22798,"53594":22858,"53595":23065,"53596":23062,"53597":23085,"53598":23086,"53599":23061,"53600":23055,"53601":23063,"53602":23050,"53603":23070,"53604":23091,"53605":23404,"53606":23463,"53607":23469,"53608":23468,"53609":23555,"53610":23638,"53611":23636,"53612":23788,"53613":23807,"53614":23790,"53615":23793,"53616":23799,"53617":23808,"53618":23801,"53619":24105,"53620":24104,"53621":24232,"53622":24238,"53623":24234,"53624":24236,"53625":24371,"53626":24368,"53627":24423,"53628":24669,"53629":24666,"53630":24679,"53665":24641,"53666":24738,"53667":24712,"53668":24704,"53669":24722,"53670":24705,"53671":24733,"53672":24707,"53673":24725,"53674":24731,"53675":24727,"53676":24711,"53677":24732,"53678":24718,"53679":25113,"53680":25158,"53681":25330,"53682":25360,"53683":25430,"53684":25388,"53685":25412,"53686":25413,"53687":25398,"53688":25411,"53689":25572,"53690":25401,"53691":25419,"53692":25418,"53693":25404,"53694":25385,"53695":25409,"53696":25396,"53697":25432,"53698":25428,"53699":25433,"53700":25389,"53701":25415,"53702":25395,"53703":25434,"53704":25425,"53705":25400,"53706":25431,"53707":25408,"53708":25416,"53709":25930,"53710":25926,"53711":26054,"53712":26051,"53713":26052,"53714":26050,"53715":26186,"53716":26207,"53717":26183,"53718":26193,"53719":26386,"53720":26387,"53721":26655,"53722":26650,"53723":26697,"53724":26674,"53725":26675,"53726":26683,"53727":26699,"53728":26703,"53729":26646,"53730":26673,"53731":26652,"53732":26677,"53733":26667,"53734":26669,"53735":26671,"53736":26702,"53737":26692,"53738":26676,"53739":26653,"53740":26642,"53741":26644,"53742":26662,"53743":26664,"53744":26670,"53745":26701,"53746":26682,"53747":26661,"53748":26656,"53749":27436,"53750":27439,"53751":27437,"53752":27441,"53753":27444,"53754":27501,"53755":32898,"53756":27528,"53757":27622,"53758":27620,"53824":27624,"53825":27619,"53826":27618,"53827":27623,"53828":27685,"53829":28026,"53830":28003,"53831":28004,"53832":28022,"53833":27917,"53834":28001,"53835":28050,"53836":27992,"53837":28002,"53838":28013,"53839":28015,"53840":28049,"53841":28045,"53842":28143,"53843":28031,"53844":28038,"53845":27998,"53846":28007,"53847":28000,"53848":28055,"53849":28016,"53850":28028,"53851":27999,"53852":28034,"53853":28056,"53854":27951,"53855":28008,"53856":28043,"53857":28030,"53858":28032,"53859":28036,"53860":27926,"53861":28035,"53862":28027,"53863":28029,"53864":28021,"53865":28048,"53866":28892,"53867":28883,"53868":28881,"53869":28893,"53870":28875,"53871":32569,"53872":28898,"53873":28887,"53874":28882,"53875":28894,"53876":28896,"53877":28884,"53878":28877,"53879":28869,"53880":28870,"53881":28871,"53882":28890,"53883":28878,"53884":28897,"53885":29250,"53886":29304,"53921":29303,"53922":29302,"53923":29440,"53924":29434,"53925":29428,"53926":29438,"53927":29430,"53928":29427,"53929":29435,"53930":29441,"53931":29651,"53932":29657,"53933":29669,"53934":29654,"53935":29628,"53936":29671,"53937":29667,"53938":29673,"53939":29660,"53940":29650,"53941":29659,"53942":29652,"53943":29661,"53944":29658,"53945":29655,"53946":29656,"53947":29672,"53948":29918,"53949":29919,"53950":29940,"53951":29941,"53952":29985,"53953":30043,"53954":30047,"53955":30128,"53956":30145,"53957":30139,"53958":30148,"53959":30144,"53960":30143,"53961":30134,"53962":30138,"53963":30346,"53964":30409,"53965":30493,"53966":30491,"53967":30480,"53968":30483,"53969":30482,"53970":30499,"53971":30481,"53972":30485,"53973":30489,"53974":30490,"53975":30498,"53976":30503,"53977":30755,"53978":30764,"53979":30754,"53980":30773,"53981":30767,"53982":30760,"53983":30766,"53984":30763,"53985":30753,"53986":30761,"53987":30771,"53988":30762,"53989":30769,"53990":31060,"53991":31067,"53992":31055,"53993":31068,"53994":31059,"53995":31058,"53996":31057,"53997":31211,"53998":31212,"53999":31200,"54000":31214,"54001":31213,"54002":31210,"54003":31196,"54004":31198,"54005":31197,"54006":31366,"54007":31369,"54008":31365,"54009":31371,"54010":31372,"54011":31370,"54012":31367,"54013":31448,"54014":31504,"54080":31492,"54081":31507,"54082":31493,"54083":31503,"54084":31496,"54085":31498,"54086":31502,"54087":31497,"54088":31506,"54089":31876,"54090":31889,"54091":31882,"54092":31884,"54093":31880,"54094":31885,"54095":31877,"54096":32030,"54097":32029,"54098":32017,"54099":32014,"54100":32024,"54101":32022,"54102":32019,"54103":32031,"54104":32018,"54105":32015,"54106":32012,"54107":32604,"54108":32609,"54109":32606,"54110":32608,"54111":32605,"54112":32603,"54113":32662,"54114":32658,"54115":32707,"54116":32706,"54117":32704,"54118":32790,"54119":32830,"54120":32825,"54121":33018,"54122":33010,"54123":33017,"54124":33013,"54125":33025,"54126":33019,"54127":33024,"54128":33281,"54129":33327,"54130":33317,"54131":33587,"54132":33581,"54133":33604,"54134":33561,"54135":33617,"54136":33573,"54137":33622,"54138":33599,"54139":33601,"54140":33574,"54141":33564,"54142":33570,"54177":33602,"54178":33614,"54179":33563,"54180":33578,"54181":33544,"54182":33596,"54183":33613,"54184":33558,"54185":33572,"54186":33568,"54187":33591,"54188":33583,"54189":33577,"54190":33607,"54191":33605,"54192":33612,"54193":33619,"54194":33566,"54195":33580,"54196":33611,"54197":33575,"54198":33608,"54199":34387,"54200":34386,"54201":34466,"54202":34472,"54203":34454,"54204":34445,"54205":34449,"54206":34462,"54207":34439,"54208":34455,"54209":34438,"54210":34443,"54211":34458,"54212":34437,"54213":34469,"54214":34457,"54215":34465,"54216":34471,"54217":34453,"54218":34456,"54219":34446,"54220":34461,"54221":34448,"54222":34452,"54223":34883,"54224":34884,"54225":34925,"54226":34933,"54227":34934,"54228":34930,"54229":34944,"54230":34929,"54231":34943,"54232":34927,"54233":34947,"54234":34942,"54235":34932,"54236":34940,"54237":35346,"54238":35911,"54239":35927,"54240":35963,"54241":36004,"54242":36003,"54243":36214,"54244":36216,"54245":36277,"54246":36279,"54247":36278,"54248":36561,"54249":36563,"54250":36862,"54251":36853,"54252":36866,"54253":36863,"54254":36859,"54255":36868,"54256":36860,"54257":36854,"54258":37078,"54259":37088,"54260":37081,"54261":37082,"54262":37091,"54263":37087,"54264":37093,"54265":37080,"54266":37083,"54267":37079,"54268":37084,"54269":37092,"54270":37200,"54336":37198,"54337":37199,"54338":37333,"54339":37346,"54340":37338,"54341":38492,"54342":38495,"54343":38588,"54344":39139,"54345":39647,"54346":39727,"54347":20095,"54348":20592,"54349":20586,"54350":20577,"54351":20574,"54352":20576,"54353":20563,"54354":20555,"54355":20573,"54356":20594,"54357":20552,"54358":20557,"54359":20545,"54360":20571,"54361":20554,"54362":20578,"54363":20501,"54364":20549,"54365":20575,"54366":20585,"54367":20587,"54368":20579,"54369":20580,"54370":20550,"54371":20544,"54372":20590,"54373":20595,"54374":20567,"54375":20561,"54376":20944,"54377":21099,"54378":21101,"54379":21100,"54380":21102,"54381":21206,"54382":21203,"54383":21293,"54384":21404,"54385":21877,"54386":21878,"54387":21820,"54388":21837,"54389":21840,"54390":21812,"54391":21802,"54392":21841,"54393":21858,"54394":21814,"54395":21813,"54396":21808,"54397":21842,"54398":21829,"54433":21772,"54434":21810,"54435":21861,"54436":21838,"54437":21817,"54438":21832,"54439":21805,"54440":21819,"54441":21824,"54442":21835,"54443":22282,"54444":22279,"54445":22523,"54446":22548,"54447":22498,"54448":22518,"54449":22492,"54450":22516,"54451":22528,"54452":22509,"54453":22525,"54454":22536,"54455":22520,"54456":22539,"54457":22515,"54458":22479,"54459":22535,"54460":22510,"54461":22499,"54462":22514,"54463":22501,"54464":22508,"54465":22497,"54466":22542,"54467":22524,"54468":22544,"54469":22503,"54470":22529,"54471":22540,"54472":22513,"54473":22505,"54474":22512,"54475":22541,"54476":22532,"54477":22876,"54478":23136,"54479":23128,"54480":23125,"54481":23143,"54482":23134,"54483":23096,"54484":23093,"54485":23149,"54486":23120,"54487":23135,"54488":23141,"54489":23148,"54490":23123,"54491":23140,"54492":23127,"54493":23107,"54494":23133,"54495":23122,"54496":23108,"54497":23131,"54498":23112,"54499":23182,"54500":23102,"54501":23117,"54502":23097,"54503":23116,"54504":23152,"54505":23145,"54506":23111,"54507":23121,"54508":23126,"54509":23106,"54510":23132,"54511":23410,"54512":23406,"54513":23489,"54514":23488,"54515":23641,"54516":23838,"54517":23819,"54518":23837,"54519":23834,"54520":23840,"54521":23820,"54522":23848,"54523":23821,"54524":23846,"54525":23845,"54526":23823,"54592":23856,"54593":23826,"54594":23843,"54595":23839,"54596":23854,"54597":24126,"54598":24116,"54599":24241,"54600":24244,"54601":24249,"54602":24242,"54603":24243,"54604":24374,"54605":24376,"54606":24475,"54607":24470,"54608":24479,"54609":24714,"54610":24720,"54611":24710,"54612":24766,"54613":24752,"54614":24762,"54615":24787,"54616":24788,"54617":24783,"54618":24804,"54619":24793,"54620":24797,"54621":24776,"54622":24753,"54623":24795,"54624":24759,"54625":24778,"54626":24767,"54627":24771,"54628":24781,"54629":24768,"54630":25394,"54631":25445,"54632":25482,"54633":25474,"54634":25469,"54635":25533,"54636":25502,"54637":25517,"54638":25501,"54639":25495,"54640":25515,"54641":25486,"54642":25455,"54643":25479,"54644":25488,"54645":25454,"54646":25519,"54647":25461,"54648":25500,"54649":25453,"54650":25518,"54651":25468,"54652":25508,"54653":25403,"54654":25503,"54689":25464,"54690":25477,"54691":25473,"54692":25489,"54693":25485,"54694":25456,"54695":25939,"54696":26061,"54697":26213,"54698":26209,"54699":26203,"54700":26201,"54701":26204,"54702":26210,"54703":26392,"54704":26745,"54705":26759,"54706":26768,"54707":26780,"54708":26733,"54709":26734,"54710":26798,"54711":26795,"54712":26966,"54713":26735,"54714":26787,"54715":26796,"54716":26793,"54717":26741,"54718":26740,"54719":26802,"54720":26767,"54721":26743,"54722":26770,"54723":26748,"54724":26731,"54725":26738,"54726":26794,"54727":26752,"54728":26737,"54729":26750,"54730":26779,"54731":26774,"54732":26763,"54733":26784,"54734":26761,"54735":26788,"54736":26744,"54737":26747,"54738":26769,"54739":26764,"54740":26762,"54741":26749,"54742":27446,"54743":27443,"54744":27447,"54745":27448,"54746":27537,"54747":27535,"54748":27533,"54749":27534,"54750":27532,"54751":27690,"54752":28096,"54753":28075,"54754":28084,"54755":28083,"54756":28276,"54757":28076,"54758":28137,"54759":28130,"54760":28087,"54761":28150,"54762":28116,"54763":28160,"54764":28104,"54765":28128,"54766":28127,"54767":28118,"54768":28094,"54769":28133,"54770":28124,"54771":28125,"54772":28123,"54773":28148,"54774":28106,"54775":28093,"54776":28141,"54777":28144,"54778":28090,"54779":28117,"54780":28098,"54781":28111,"54782":28105,"54848":28112,"54849":28146,"54850":28115,"54851":28157,"54852":28119,"54853":28109,"54854":28131,"54855":28091,"54856":28922,"54857":28941,"54858":28919,"54859":28951,"54860":28916,"54861":28940,"54862":28912,"54863":28932,"54864":28915,"54865":28944,"54866":28924,"54867":28927,"54868":28934,"54869":28947,"54870":28928,"54871":28920,"54872":28918,"54873":28939,"54874":28930,"54875":28942,"54876":29310,"54877":29307,"54878":29308,"54879":29311,"54880":29469,"54881":29463,"54882":29447,"54883":29457,"54884":29464,"54885":29450,"54886":29448,"54887":29439,"54888":29455,"54889":29470,"54890":29576,"54891":29686,"54892":29688,"54893":29685,"54894":29700,"54895":29697,"54896":29693,"54897":29703,"54898":29696,"54899":29690,"54900":29692,"54901":29695,"54902":29708,"54903":29707,"54904":29684,"54905":29704,"54906":30052,"54907":30051,"54908":30158,"54909":30162,"54910":30159,"54945":30155,"54946":30156,"54947":30161,"54948":30160,"54949":30351,"54950":30345,"54951":30419,"54952":30521,"54953":30511,"54954":30509,"54955":30513,"54956":30514,"54957":30516,"54958":30515,"54959":30525,"54960":30501,"54961":30523,"54962":30517,"54963":30792,"54964":30802,"54965":30793,"54966":30797,"54967":30794,"54968":30796,"54969":30758,"54970":30789,"54971":30800,"54972":31076,"54973":31079,"54974":31081,"54975":31082,"54976":31075,"54977":31083,"54978":31073,"54979":31163,"54980":31226,"54981":31224,"54982":31222,"54983":31223,"54984":31375,"54985":31380,"54986":31376,"54987":31541,"54988":31559,"54989":31540,"54990":31525,"54991":31536,"54992":31522,"54993":31524,"54994":31539,"54995":31512,"54996":31530,"54997":31517,"54998":31537,"54999":31531,"55000":31533,"55001":31535,"55002":31538,"55003":31544,"55004":31514,"55005":31523,"55006":31892,"55007":31896,"55008":31894,"55009":31907,"55010":32053,"55011":32061,"55012":32056,"55013":32054,"55014":32058,"55015":32069,"55016":32044,"55017":32041,"55018":32065,"55019":32071,"55020":32062,"55021":32063,"55022":32074,"55023":32059,"55024":32040,"55025":32611,"55026":32661,"55027":32668,"55028":32669,"55029":32667,"55030":32714,"55031":32715,"55032":32717,"55033":32720,"55034":32721,"55035":32711,"55036":32719,"55037":32713,"55038":32799,"55104":32798,"55105":32795,"55106":32839,"55107":32835,"55108":32840,"55109":33048,"55110":33061,"55111":33049,"55112":33051,"55113":33069,"55114":33055,"55115":33068,"55116":33054,"55117":33057,"55118":33045,"55119":33063,"55120":33053,"55121":33058,"55122":33297,"55123":33336,"55124":33331,"55125":33338,"55126":33332,"55127":33330,"55128":33396,"55129":33680,"55130":33699,"55131":33704,"55132":33677,"55133":33658,"55134":33651,"55135":33700,"55136":33652,"55137":33679,"55138":33665,"55139":33685,"55140":33689,"55141":33653,"55142":33684,"55143":33705,"55144":33661,"55145":33667,"55146":33676,"55147":33693,"55148":33691,"55149":33706,"55150":33675,"55151":33662,"55152":33701,"55153":33711,"55154":33672,"55155":33687,"55156":33712,"55157":33663,"55158":33702,"55159":33671,"55160":33710,"55161":33654,"55162":33690,"55163":34393,"55164":34390,"55165":34495,"55166":34487,"55201":34498,"55202":34497,"55203":34501,"55204":34490,"55205":34480,"55206":34504,"55207":34489,"55208":34483,"55209":34488,"55210":34508,"55211":34484,"55212":34491,"55213":34492,"55214":34499,"55215":34493,"55216":34494,"55217":34898,"55218":34953,"55219":34965,"55220":34984,"55221":34978,"55222":34986,"55223":34970,"55224":34961,"55225":34977,"55226":34975,"55227":34968,"55228":34983,"55229":34969,"55230":34971,"55231":34967,"55232":34980,"55233":34988,"55234":34956,"55235":34963,"55236":34958,"55237":35202,"55238":35286,"55239":35289,"55240":35285,"55241":35376,"55242":35367,"55243":35372,"55244":35358,"55245":35897,"55246":35899,"55247":35932,"55248":35933,"55249":35965,"55250":36005,"55251":36221,"55252":36219,"55253":36217,"55254":36284,"55255":36290,"55256":36281,"55257":36287,"55258":36289,"55259":36568,"55260":36574,"55261":36573,"55262":36572,"55263":36567,"55264":36576,"55265":36577,"55266":36900,"55267":36875,"55268":36881,"55269":36892,"55270":36876,"55271":36897,"55272":37103,"55273":37098,"55274":37104,"55275":37108,"55276":37106,"55277":37107,"55278":37076,"55279":37099,"55280":37100,"55281":37097,"55282":37206,"55283":37208,"55284":37210,"55285":37203,"55286":37205,"55287":37356,"55288":37364,"55289":37361,"55290":37363,"55291":37368,"55292":37348,"55293":37369,"55294":37354,"55360":37355,"55361":37367,"55362":37352,"55363":37358,"55364":38266,"55365":38278,"55366":38280,"55367":38524,"55368":38509,"55369":38507,"55370":38513,"55371":38511,"55372":38591,"55373":38762,"55374":38916,"55375":39141,"55376":39319,"55377":20635,"55378":20629,"55379":20628,"55380":20638,"55381":20619,"55382":20643,"55383":20611,"55384":20620,"55385":20622,"55386":20637,"55387":20584,"55388":20636,"55389":20626,"55390":20610,"55391":20615,"55392":20831,"55393":20948,"55394":21266,"55395":21265,"55396":21412,"55397":21415,"55398":21905,"55399":21928,"55400":21925,"55401":21933,"55402":21879,"55403":22085,"55404":21922,"55405":21907,"55406":21896,"55407":21903,"55408":21941,"55409":21889,"55410":21923,"55411":21906,"55412":21924,"55413":21885,"55414":21900,"55415":21926,"55416":21887,"55417":21909,"55418":21921,"55419":21902,"55420":22284,"55421":22569,"55422":22583,"55457":22553,"55458":22558,"55459":22567,"55460":22563,"55461":22568,"55462":22517,"55463":22600,"55464":22565,"55465":22556,"55466":22555,"55467":22579,"55468":22591,"55469":22582,"55470":22574,"55471":22585,"55472":22584,"55473":22573,"55474":22572,"55475":22587,"55476":22881,"55477":23215,"55478":23188,"55479":23199,"55480":23162,"55481":23202,"55482":23198,"55483":23160,"55484":23206,"55485":23164,"55486":23205,"55487":23212,"55488":23189,"55489":23214,"55490":23095,"55491":23172,"55492":23178,"55493":23191,"55494":23171,"55495":23179,"55496":23209,"55497":23163,"55498":23165,"55499":23180,"55500":23196,"55501":23183,"55502":23187,"55503":23197,"55504":23530,"55505":23501,"55506":23499,"55507":23508,"55508":23505,"55509":23498,"55510":23502,"55511":23564,"55512":23600,"55513":23863,"55514":23875,"55515":23915,"55516":23873,"55517":23883,"55518":23871,"55519":23861,"55520":23889,"55521":23886,"55522":23893,"55523":23859,"55524":23866,"55525":23890,"55526":23869,"55527":23857,"55528":23897,"55529":23874,"55530":23865,"55531":23881,"55532":23864,"55533":23868,"55534":23858,"55535":23862,"55536":23872,"55537":23877,"55538":24132,"55539":24129,"55540":24408,"55541":24486,"55542":24485,"55543":24491,"55544":24777,"55545":24761,"55546":24780,"55547":24802,"55548":24782,"55549":24772,"55550":24852,"55616":24818,"55617":24842,"55618":24854,"55619":24837,"55620":24821,"55621":24851,"55622":24824,"55623":24828,"55624":24830,"55625":24769,"55626":24835,"55627":24856,"55628":24861,"55629":24848,"55630":24831,"55631":24836,"55632":24843,"55633":25162,"55634":25492,"55635":25521,"55636":25520,"55637":25550,"55638":25573,"55639":25576,"55640":25583,"55641":25539,"55642":25757,"55643":25587,"55644":25546,"55645":25568,"55646":25590,"55647":25557,"55648":25586,"55649":25589,"55650":25697,"55651":25567,"55652":25534,"55653":25565,"55654":25564,"55655":25540,"55656":25560,"55657":25555,"55658":25538,"55659":25543,"55660":25548,"55661":25547,"55662":25544,"55663":25584,"55664":25559,"55665":25561,"55666":25906,"55667":25959,"55668":25962,"55669":25956,"55670":25948,"55671":25960,"55672":25957,"55673":25996,"55674":26013,"55675":26014,"55676":26030,"55677":26064,"55678":26066,"55713":26236,"55714":26220,"55715":26235,"55716":26240,"55717":26225,"55718":26233,"55719":26218,"55720":26226,"55721":26369,"55722":26892,"55723":26835,"55724":26884,"55725":26844,"55726":26922,"55727":26860,"55728":26858,"55729":26865,"55730":26895,"55731":26838,"55732":26871,"55733":26859,"55734":26852,"55735":26870,"55736":26899,"55737":26896,"55738":26867,"55739":26849,"55740":26887,"55741":26828,"55742":26888,"55743":26992,"55744":26804,"55745":26897,"55746":26863,"55747":26822,"55748":26900,"55749":26872,"55750":26832,"55751":26877,"55752":26876,"55753":26856,"55754":26891,"55755":26890,"55756":26903,"55757":26830,"55758":26824,"55759":26845,"55760":26846,"55761":26854,"55762":26868,"55763":26833,"55764":26886,"55765":26836,"55766":26857,"55767":26901,"55768":26917,"55769":26823,"55770":27449,"55771":27451,"55772":27455,"55773":27452,"55774":27540,"55775":27543,"55776":27545,"55777":27541,"55778":27581,"55779":27632,"55780":27634,"55781":27635,"55782":27696,"55783":28156,"55784":28230,"55785":28231,"55786":28191,"55787":28233,"55788":28296,"55789":28220,"55790":28221,"55791":28229,"55792":28258,"55793":28203,"55794":28223,"55795":28225,"55796":28253,"55797":28275,"55798":28188,"55799":28211,"55800":28235,"55801":28224,"55802":28241,"55803":28219,"55804":28163,"55805":28206,"55806":28254,"55872":28264,"55873":28252,"55874":28257,"55875":28209,"55876":28200,"55877":28256,"55878":28273,"55879":28267,"55880":28217,"55881":28194,"55882":28208,"55883":28243,"55884":28261,"55885":28199,"55886":28280,"55887":28260,"55888":28279,"55889":28245,"55890":28281,"55891":28242,"55892":28262,"55893":28213,"55894":28214,"55895":28250,"55896":28960,"55897":28958,"55898":28975,"55899":28923,"55900":28974,"55901":28977,"55902":28963,"55903":28965,"55904":28962,"55905":28978,"55906":28959,"55907":28968,"55908":28986,"55909":28955,"55910":29259,"55911":29274,"55912":29320,"55913":29321,"55914":29318,"55915":29317,"55916":29323,"55917":29458,"55918":29451,"55919":29488,"55920":29474,"55921":29489,"55922":29491,"55923":29479,"55924":29490,"55925":29485,"55926":29478,"55927":29475,"55928":29493,"55929":29452,"55930":29742,"55931":29740,"55932":29744,"55933":29739,"55934":29718,"55969":29722,"55970":29729,"55971":29741,"55972":29745,"55973":29732,"55974":29731,"55975":29725,"55976":29737,"55977":29728,"55978":29746,"55979":29947,"55980":29999,"55981":30063,"55982":30060,"55983":30183,"55984":30170,"55985":30177,"55986":30182,"55987":30173,"55988":30175,"55989":30180,"55990":30167,"55991":30357,"55992":30354,"55993":30426,"55994":30534,"55995":30535,"55996":30532,"55997":30541,"55998":30533,"55999":30538,"56000":30542,"56001":30539,"56002":30540,"56003":30686,"56004":30700,"56005":30816,"56006":30820,"56007":30821,"56008":30812,"56009":30829,"56010":30833,"56011":30826,"56012":30830,"56013":30832,"56014":30825,"56015":30824,"56016":30814,"56017":30818,"56018":31092,"56019":31091,"56020":31090,"56021":31088,"56022":31234,"56023":31242,"56024":31235,"56025":31244,"56026":31236,"56027":31385,"56028":31462,"56029":31460,"56030":31562,"56031":31547,"56032":31556,"56033":31560,"56034":31564,"56035":31566,"56036":31552,"56037":31576,"56038":31557,"56039":31906,"56040":31902,"56041":31912,"56042":31905,"56043":32088,"56044":32111,"56045":32099,"56046":32083,"56047":32086,"56048":32103,"56049":32106,"56050":32079,"56051":32109,"56052":32092,"56053":32107,"56054":32082,"56055":32084,"56056":32105,"56057":32081,"56058":32095,"56059":32078,"56060":32574,"56061":32575,"56062":32613,"56128":32614,"56129":32674,"56130":32672,"56131":32673,"56132":32727,"56133":32849,"56134":32847,"56135":32848,"56136":33022,"56137":32980,"56138":33091,"56139":33098,"56140":33106,"56141":33103,"56142":33095,"56143":33085,"56144":33101,"56145":33082,"56146":33254,"56147":33262,"56148":33271,"56149":33272,"56150":33273,"56151":33284,"56152":33340,"56153":33341,"56154":33343,"56155":33397,"56156":33595,"56157":33743,"56158":33785,"56159":33827,"56160":33728,"56161":33768,"56162":33810,"56163":33767,"56164":33764,"56165":33788,"56166":33782,"56167":33808,"56168":33734,"56169":33736,"56170":33771,"56171":33763,"56172":33727,"56173":33793,"56174":33757,"56175":33765,"56176":33752,"56177":33791,"56178":33761,"56179":33739,"56180":33742,"56181":33750,"56182":33781,"56183":33737,"56184":33801,"56185":33807,"56186":33758,"56187":33809,"56188":33798,"56189":33730,"56190":33779,"56225":33749,"56226":33786,"56227":33735,"56228":33745,"56229":33770,"56230":33811,"56231":33731,"56232":33772,"56233":33774,"56234":33732,"56235":33787,"56236":33751,"56237":33762,"56238":33819,"56239":33755,"56240":33790,"56241":34520,"56242":34530,"56243":34534,"56244":34515,"56245":34531,"56246":34522,"56247":34538,"56248":34525,"56249":34539,"56250":34524,"56251":34540,"56252":34537,"56253":34519,"56254":34536,"56255":34513,"56256":34888,"56257":34902,"56258":34901,"56259":35002,"56260":35031,"56261":35001,"56262":35000,"56263":35008,"56264":35006,"56265":34998,"56266":35004,"56267":34999,"56268":35005,"56269":34994,"56270":35073,"56271":35017,"56272":35221,"56273":35224,"56274":35223,"56275":35293,"56276":35290,"56277":35291,"56278":35406,"56279":35405,"56280":35385,"56281":35417,"56282":35392,"56283":35415,"56284":35416,"56285":35396,"56286":35397,"56287":35410,"56288":35400,"56289":35409,"56290":35402,"56291":35404,"56292":35407,"56293":35935,"56294":35969,"56295":35968,"56296":36026,"56297":36030,"56298":36016,"56299":36025,"56300":36021,"56301":36228,"56302":36224,"56303":36233,"56304":36312,"56305":36307,"56306":36301,"56307":36295,"56308":36310,"56309":36316,"56310":36303,"56311":36309,"56312":36313,"56313":36296,"56314":36311,"56315":36293,"56316":36591,"56317":36599,"56318":36602,"56384":36601,"56385":36582,"56386":36590,"56387":36581,"56388":36597,"56389":36583,"56390":36584,"56391":36598,"56392":36587,"56393":36593,"56394":36588,"56395":36596,"56396":36585,"56397":36909,"56398":36916,"56399":36911,"56400":37126,"56401":37164,"56402":37124,"56403":37119,"56404":37116,"56405":37128,"56406":37113,"56407":37115,"56408":37121,"56409":37120,"56410":37127,"56411":37125,"56412":37123,"56413":37217,"56414":37220,"56415":37215,"56416":37218,"56417":37216,"56418":37377,"56419":37386,"56420":37413,"56421":37379,"56422":37402,"56423":37414,"56424":37391,"56425":37388,"56426":37376,"56427":37394,"56428":37375,"56429":37373,"56430":37382,"56431":37380,"56432":37415,"56433":37378,"56434":37404,"56435":37412,"56436":37401,"56437":37399,"56438":37381,"56439":37398,"56440":38267,"56441":38285,"56442":38284,"56443":38288,"56444":38535,"56445":38526,"56446":38536,"56481":38537,"56482":38531,"56483":38528,"56484":38594,"56485":38600,"56486":38595,"56487":38641,"56488":38640,"56489":38764,"56490":38768,"56491":38766,"56492":38919,"56493":39081,"56494":39147,"56495":40166,"56496":40697,"56497":20099,"56498":20100,"56499":20150,"56500":20669,"56501":20671,"56502":20678,"56503":20654,"56504":20676,"56505":20682,"56506":20660,"56507":20680,"56508":20674,"56509":20656,"56510":20673,"56511":20666,"56512":20657,"56513":20683,"56514":20681,"56515":20662,"56516":20664,"56517":20951,"56518":21114,"56519":21112,"56520":21115,"56521":21116,"56522":21955,"56523":21979,"56524":21964,"56525":21968,"56526":21963,"56527":21962,"56528":21981,"56529":21952,"56530":21972,"56531":21956,"56532":21993,"56533":21951,"56534":21970,"56535":21901,"56536":21967,"56537":21973,"56538":21986,"56539":21974,"56540":21960,"56541":22002,"56542":21965,"56543":21977,"56544":21954,"56545":22292,"56546":22611,"56547":22632,"56548":22628,"56549":22607,"56550":22605,"56551":22601,"56552":22639,"56553":22613,"56554":22606,"56555":22621,"56556":22617,"56557":22629,"56558":22619,"56559":22589,"56560":22627,"56561":22641,"56562":22780,"56563":23239,"56564":23236,"56565":23243,"56566":23226,"56567":23224,"56568":23217,"56569":23221,"56570":23216,"56571":23231,"56572":23240,"56573":23227,"56574":23238,"56640":23223,"56641":23232,"56642":23242,"56643":23220,"56644":23222,"56645":23245,"56646":23225,"56647":23184,"56648":23510,"56649":23512,"56650":23513,"56651":23583,"56652":23603,"56653":23921,"56654":23907,"56655":23882,"56656":23909,"56657":23922,"56658":23916,"56659":23902,"56660":23912,"56661":23911,"56662":23906,"56663":24048,"56664":24143,"56665":24142,"56666":24138,"56667":24141,"56668":24139,"56669":24261,"56670":24268,"56671":24262,"56672":24267,"56673":24263,"56674":24384,"56675":24495,"56676":24493,"56677":24823,"56678":24905,"56679":24906,"56680":24875,"56681":24901,"56682":24886,"56683":24882,"56684":24878,"56685":24902,"56686":24879,"56687":24911,"56688":24873,"56689":24896,"56690":25120,"56691":37224,"56692":25123,"56693":25125,"56694":25124,"56695":25541,"56696":25585,"56697":25579,"56698":25616,"56699":25618,"56700":25609,"56701":25632,"56702":25636,"56737":25651,"56738":25667,"56739":25631,"56740":25621,"56741":25624,"56742":25657,"56743":25655,"56744":25634,"56745":25635,"56746":25612,"56747":25638,"56748":25648,"56749":25640,"56750":25665,"56751":25653,"56752":25647,"56753":25610,"56754":25626,"56755":25664,"56756":25637,"56757":25639,"56758":25611,"56759":25575,"56760":25627,"56761":25646,"56762":25633,"56763":25614,"56764":25967,"56765":26002,"56766":26067,"56767":26246,"56768":26252,"56769":26261,"56770":26256,"56771":26251,"56772":26250,"56773":26265,"56774":26260,"56775":26232,"56776":26400,"56777":26982,"56778":26975,"56779":26936,"56780":26958,"56781":26978,"56782":26993,"56783":26943,"56784":26949,"56785":26986,"56786":26937,"56787":26946,"56788":26967,"56789":26969,"56790":27002,"56791":26952,"56792":26953,"56793":26933,"56794":26988,"56795":26931,"56796":26941,"56797":26981,"56798":26864,"56799":27000,"56800":26932,"56801":26985,"56802":26944,"56803":26991,"56804":26948,"56805":26998,"56806":26968,"56807":26945,"56808":26996,"56809":26956,"56810":26939,"56811":26955,"56812":26935,"56813":26972,"56814":26959,"56815":26961,"56816":26930,"56817":26962,"56818":26927,"56819":27003,"56820":26940,"56821":27462,"56822":27461,"56823":27459,"56824":27458,"56825":27464,"56826":27457,"56827":27547,"56828":64013,"56829":27643,"56830":27644,"56896":27641,"56897":27639,"56898":27640,"56899":28315,"56900":28374,"56901":28360,"56902":28303,"56903":28352,"56904":28319,"56905":28307,"56906":28308,"56907":28320,"56908":28337,"56909":28345,"56910":28358,"56911":28370,"56912":28349,"56913":28353,"56914":28318,"56915":28361,"56916":28343,"56917":28336,"56918":28365,"56919":28326,"56920":28367,"56921":28338,"56922":28350,"56923":28355,"56924":28380,"56925":28376,"56926":28313,"56927":28306,"56928":28302,"56929":28301,"56930":28324,"56931":28321,"56932":28351,"56933":28339,"56934":28368,"56935":28362,"56936":28311,"56937":28334,"56938":28323,"56939":28999,"56940":29012,"56941":29010,"56942":29027,"56943":29024,"56944":28993,"56945":29021,"56946":29026,"56947":29042,"56948":29048,"56949":29034,"56950":29025,"56951":28994,"56952":29016,"56953":28995,"56954":29003,"56955":29040,"56956":29023,"56957":29008,"56958":29011,"56993":28996,"56994":29005,"56995":29018,"56996":29263,"56997":29325,"56998":29324,"56999":29329,"57000":29328,"57001":29326,"57002":29500,"57003":29506,"57004":29499,"57005":29498,"57006":29504,"57007":29514,"57008":29513,"57009":29764,"57010":29770,"57011":29771,"57012":29778,"57013":29777,"57014":29783,"57015":29760,"57016":29775,"57017":29776,"57018":29774,"57019":29762,"57020":29766,"57021":29773,"57022":29780,"57023":29921,"57024":29951,"57025":29950,"57026":29949,"57027":29981,"57028":30073,"57029":30071,"57030":27011,"57031":30191,"57032":30223,"57033":30211,"57034":30199,"57035":30206,"57036":30204,"57037":30201,"57038":30200,"57039":30224,"57040":30203,"57041":30198,"57042":30189,"57043":30197,"57044":30205,"57045":30361,"57046":30389,"57047":30429,"57048":30549,"57049":30559,"57050":30560,"57051":30546,"57052":30550,"57053":30554,"57054":30569,"57055":30567,"57056":30548,"57057":30553,"57058":30573,"57059":30688,"57060":30855,"57061":30874,"57062":30868,"57063":30863,"57064":30852,"57065":30869,"57066":30853,"57067":30854,"57068":30881,"57069":30851,"57070":30841,"57071":30873,"57072":30848,"57073":30870,"57074":30843,"57075":31100,"57076":31106,"57077":31101,"57078":31097,"57079":31249,"57080":31256,"57081":31257,"57082":31250,"57083":31255,"57084":31253,"57085":31266,"57086":31251,"57152":31259,"57153":31248,"57154":31395,"57155":31394,"57156":31390,"57157":31467,"57158":31590,"57159":31588,"57160":31597,"57161":31604,"57162":31593,"57163":31602,"57164":31589,"57165":31603,"57166":31601,"57167":31600,"57168":31585,"57169":31608,"57170":31606,"57171":31587,"57172":31922,"57173":31924,"57174":31919,"57175":32136,"57176":32134,"57177":32128,"57178":32141,"57179":32127,"57180":32133,"57181":32122,"57182":32142,"57183":32123,"57184":32131,"57185":32124,"57186":32140,"57187":32148,"57188":32132,"57189":32125,"57190":32146,"57191":32621,"57192":32619,"57193":32615,"57194":32616,"57195":32620,"57196":32678,"57197":32677,"57198":32679,"57199":32731,"57200":32732,"57201":32801,"57202":33124,"57203":33120,"57204":33143,"57205":33116,"57206":33129,"57207":33115,"57208":33122,"57209":33138,"57210":26401,"57211":33118,"57212":33142,"57213":33127,"57214":33135,"57249":33092,"57250":33121,"57251":33309,"57252":33353,"57253":33348,"57254":33344,"57255":33346,"57256":33349,"57257":34033,"57258":33855,"57259":33878,"57260":33910,"57261":33913,"57262":33935,"57263":33933,"57264":33893,"57265":33873,"57266":33856,"57267":33926,"57268":33895,"57269":33840,"57270":33869,"57271":33917,"57272":33882,"57273":33881,"57274":33908,"57275":33907,"57276":33885,"57277":34055,"57278":33886,"57279":33847,"57280":33850,"57281":33844,"57282":33914,"57283":33859,"57284":33912,"57285":33842,"57286":33861,"57287":33833,"57288":33753,"57289":33867,"57290":33839,"57291":33858,"57292":33837,"57293":33887,"57294":33904,"57295":33849,"57296":33870,"57297":33868,"57298":33874,"57299":33903,"57300":33989,"57301":33934,"57302":33851,"57303":33863,"57304":33846,"57305":33843,"57306":33896,"57307":33918,"57308":33860,"57309":33835,"57310":33888,"57311":33876,"57312":33902,"57313":33872,"57314":34571,"57315":34564,"57316":34551,"57317":34572,"57318":34554,"57319":34518,"57320":34549,"57321":34637,"57322":34552,"57323":34574,"57324":34569,"57325":34561,"57326":34550,"57327":34573,"57328":34565,"57329":35030,"57330":35019,"57331":35021,"57332":35022,"57333":35038,"57334":35035,"57335":35034,"57336":35020,"57337":35024,"57338":35205,"57339":35227,"57340":35295,"57341":35301,"57342":35300,"57408":35297,"57409":35296,"57410":35298,"57411":35292,"57412":35302,"57413":35446,"57414":35462,"57415":35455,"57416":35425,"57417":35391,"57418":35447,"57419":35458,"57420":35460,"57421":35445,"57422":35459,"57423":35457,"57424":35444,"57425":35450,"57426":35900,"57427":35915,"57428":35914,"57429":35941,"57430":35940,"57431":35942,"57432":35974,"57433":35972,"57434":35973,"57435":36044,"57436":36200,"57437":36201,"57438":36241,"57439":36236,"57440":36238,"57441":36239,"57442":36237,"57443":36243,"57444":36244,"57445":36240,"57446":36242,"57447":36336,"57448":36320,"57449":36332,"57450":36337,"57451":36334,"57452":36304,"57453":36329,"57454":36323,"57455":36322,"57456":36327,"57457":36338,"57458":36331,"57459":36340,"57460":36614,"57461":36607,"57462":36609,"57463":36608,"57464":36613,"57465":36615,"57466":36616,"57467":36610,"57468":36619,"57469":36946,"57470":36927,"57505":36932,"57506":36937,"57507":36925,"57508":37136,"57509":37133,"57510":37135,"57511":37137,"57512":37142,"57513":37140,"57514":37131,"57515":37134,"57516":37230,"57517":37231,"57518":37448,"57519":37458,"57520":37424,"57521":37434,"57522":37478,"57523":37427,"57524":37477,"57525":37470,"57526":37507,"57527":37422,"57528":37450,"57529":37446,"57530":37485,"57531":37484,"57532":37455,"57533":37472,"57534":37479,"57535":37487,"57536":37430,"57537":37473,"57538":37488,"57539":37425,"57540":37460,"57541":37475,"57542":37456,"57543":37490,"57544":37454,"57545":37459,"57546":37452,"57547":37462,"57548":37426,"57549":38303,"57550":38300,"57551":38302,"57552":38299,"57553":38546,"57554":38547,"57555":38545,"57556":38551,"57557":38606,"57558":38650,"57559":38653,"57560":38648,"57561":38645,"57562":38771,"57563":38775,"57564":38776,"57565":38770,"57566":38927,"57567":38925,"57568":38926,"57569":39084,"57570":39158,"57571":39161,"57572":39343,"57573":39346,"57574":39344,"57575":39349,"57576":39597,"57577":39595,"57578":39771,"57579":40170,"57580":40173,"57581":40167,"57582":40576,"57583":40701,"57584":20710,"57585":20692,"57586":20695,"57587":20712,"57588":20723,"57589":20699,"57590":20714,"57591":20701,"57592":20708,"57593":20691,"57594":20716,"57595":20720,"57596":20719,"57597":20707,"57598":20704,"57664":20952,"57665":21120,"57666":21121,"57667":21225,"57668":21227,"57669":21296,"57670":21420,"57671":22055,"57672":22037,"57673":22028,"57674":22034,"57675":22012,"57676":22031,"57677":22044,"57678":22017,"57679":22035,"57680":22018,"57681":22010,"57682":22045,"57683":22020,"57684":22015,"57685":22009,"57686":22665,"57687":22652,"57688":22672,"57689":22680,"57690":22662,"57691":22657,"57692":22655,"57693":22644,"57694":22667,"57695":22650,"57696":22663,"57697":22673,"57698":22670,"57699":22646,"57700":22658,"57701":22664,"57702":22651,"57703":22676,"57704":22671,"57705":22782,"57706":22891,"57707":23260,"57708":23278,"57709":23269,"57710":23253,"57711":23274,"57712":23258,"57713":23277,"57714":23275,"57715":23283,"57716":23266,"57717":23264,"57718":23259,"57719":23276,"57720":23262,"57721":23261,"57722":23257,"57723":23272,"57724":23263,"57725":23415,"57726":23520,"57761":23523,"57762":23651,"57763":23938,"57764":23936,"57765":23933,"57766":23942,"57767":23930,"57768":23937,"57769":23927,"57770":23946,"57771":23945,"57772":23944,"57773":23934,"57774":23932,"57775":23949,"57776":23929,"57777":23935,"57778":24152,"57779":24153,"57780":24147,"57781":24280,"57782":24273,"57783":24279,"57784":24270,"57785":24284,"57786":24277,"57787":24281,"57788":24274,"57789":24276,"57790":24388,"57791":24387,"57792":24431,"57793":24502,"57794":24876,"57795":24872,"57796":24897,"57797":24926,"57798":24945,"57799":24947,"57800":24914,"57801":24915,"57802":24946,"57803":24940,"57804":24960,"57805":24948,"57806":24916,"57807":24954,"57808":24923,"57809":24933,"57810":24891,"57811":24938,"57812":24929,"57813":24918,"57814":25129,"57815":25127,"57816":25131,"57817":25643,"57818":25677,"57819":25691,"57820":25693,"57821":25716,"57822":25718,"57823":25714,"57824":25715,"57825":25725,"57826":25717,"57827":25702,"57828":25766,"57829":25678,"57830":25730,"57831":25694,"57832":25692,"57833":25675,"57834":25683,"57835":25696,"57836":25680,"57837":25727,"57838":25663,"57839":25708,"57840":25707,"57841":25689,"57842":25701,"57843":25719,"57844":25971,"57845":26016,"57846":26273,"57847":26272,"57848":26271,"57849":26373,"57850":26372,"57851":26402,"57852":27057,"57853":27062,"57854":27081,"57920":27040,"57921":27086,"57922":27030,"57923":27056,"57924":27052,"57925":27068,"57926":27025,"57927":27033,"57928":27022,"57929":27047,"57930":27021,"57931":27049,"57932":27070,"57933":27055,"57934":27071,"57935":27076,"57936":27069,"57937":27044,"57938":27092,"57939":27065,"57940":27082,"57941":27034,"57942":27087,"57943":27059,"57944":27027,"57945":27050,"57946":27041,"57947":27038,"57948":27097,"57949":27031,"57950":27024,"57951":27074,"57952":27061,"57953":27045,"57954":27078,"57955":27466,"57956":27469,"57957":27467,"57958":27550,"57959":27551,"57960":27552,"57961":27587,"57962":27588,"57963":27646,"57964":28366,"57965":28405,"57966":28401,"57967":28419,"57968":28453,"57969":28408,"57970":28471,"57971":28411,"57972":28462,"57973":28425,"57974":28494,"57975":28441,"57976":28442,"57977":28455,"57978":28440,"57979":28475,"57980":28434,"57981":28397,"57982":28426,"58017":28470,"58018":28531,"58019":28409,"58020":28398,"58021":28461,"58022":28480,"58023":28464,"58024":28476,"58025":28469,"58026":28395,"58027":28423,"58028":28430,"58029":28483,"58030":28421,"58031":28413,"58032":28406,"58033":28473,"58034":28444,"58035":28412,"58036":28474,"58037":28447,"58038":28429,"58039":28446,"58040":28424,"58041":28449,"58042":29063,"58043":29072,"58044":29065,"58045":29056,"58046":29061,"58047":29058,"58048":29071,"58049":29051,"58050":29062,"58051":29057,"58052":29079,"58053":29252,"58054":29267,"58055":29335,"58056":29333,"58057":29331,"58058":29507,"58059":29517,"58060":29521,"58061":29516,"58062":29794,"58063":29811,"58064":29809,"58065":29813,"58066":29810,"58067":29799,"58068":29806,"58069":29952,"58070":29954,"58071":29955,"58072":30077,"58073":30096,"58074":30230,"58075":30216,"58076":30220,"58077":30229,"58078":30225,"58079":30218,"58080":30228,"58081":30392,"58082":30593,"58083":30588,"58084":30597,"58085":30594,"58086":30574,"58087":30592,"58088":30575,"58089":30590,"58090":30595,"58091":30898,"58092":30890,"58093":30900,"58094":30893,"58095":30888,"58096":30846,"58097":30891,"58098":30878,"58099":30885,"58100":30880,"58101":30892,"58102":30882,"58103":30884,"58104":31128,"58105":31114,"58106":31115,"58107":31126,"58108":31125,"58109":31124,"58110":31123,"58176":31127,"58177":31112,"58178":31122,"58179":31120,"58180":31275,"58181":31306,"58182":31280,"58183":31279,"58184":31272,"58185":31270,"58186":31400,"58187":31403,"58188":31404,"58189":31470,"58190":31624,"58191":31644,"58192":31626,"58193":31633,"58194":31632,"58195":31638,"58196":31629,"58197":31628,"58198":31643,"58199":31630,"58200":31621,"58201":31640,"58202":21124,"58203":31641,"58204":31652,"58205":31618,"58206":31931,"58207":31935,"58208":31932,"58209":31930,"58210":32167,"58211":32183,"58212":32194,"58213":32163,"58214":32170,"58215":32193,"58216":32192,"58217":32197,"58218":32157,"58219":32206,"58220":32196,"58221":32198,"58222":32203,"58223":32204,"58224":32175,"58225":32185,"58226":32150,"58227":32188,"58228":32159,"58229":32166,"58230":32174,"58231":32169,"58232":32161,"58233":32201,"58234":32627,"58235":32738,"58236":32739,"58237":32741,"58238":32734,"58273":32804,"58274":32861,"58275":32860,"58276":33161,"58277":33158,"58278":33155,"58279":33159,"58280":33165,"58281":33164,"58282":33163,"58283":33301,"58284":33943,"58285":33956,"58286":33953,"58287":33951,"58288":33978,"58289":33998,"58290":33986,"58291":33964,"58292":33966,"58293":33963,"58294":33977,"58295":33972,"58296":33985,"58297":33997,"58298":33962,"58299":33946,"58300":33969,"58301":34000,"58302":33949,"58303":33959,"58304":33979,"58305":33954,"58306":33940,"58307":33991,"58308":33996,"58309":33947,"58310":33961,"58311":33967,"58312":33960,"58313":34006,"58314":33944,"58315":33974,"58316":33999,"58317":33952,"58318":34007,"58319":34004,"58320":34002,"58321":34011,"58322":33968,"58323":33937,"58324":34401,"58325":34611,"58326":34595,"58327":34600,"58328":34667,"58329":34624,"58330":34606,"58331":34590,"58332":34593,"58333":34585,"58334":34587,"58335":34627,"58336":34604,"58337":34625,"58338":34622,"58339":34630,"58340":34592,"58341":34610,"58342":34602,"58343":34605,"58344":34620,"58345":34578,"58346":34618,"58347":34609,"58348":34613,"58349":34626,"58350":34598,"58351":34599,"58352":34616,"58353":34596,"58354":34586,"58355":34608,"58356":34577,"58357":35063,"58358":35047,"58359":35057,"58360":35058,"58361":35066,"58362":35070,"58363":35054,"58364":35068,"58365":35062,"58366":35067,"58432":35056,"58433":35052,"58434":35051,"58435":35229,"58436":35233,"58437":35231,"58438":35230,"58439":35305,"58440":35307,"58441":35304,"58442":35499,"58443":35481,"58444":35467,"58445":35474,"58446":35471,"58447":35478,"58448":35901,"58449":35944,"58450":35945,"58451":36053,"58452":36047,"58453":36055,"58454":36246,"58455":36361,"58456":36354,"58457":36351,"58458":36365,"58459":36349,"58460":36362,"58461":36355,"58462":36359,"58463":36358,"58464":36357,"58465":36350,"58466":36352,"58467":36356,"58468":36624,"58469":36625,"58470":36622,"58471":36621,"58472":37155,"58473":37148,"58474":37152,"58475":37154,"58476":37151,"58477":37149,"58478":37146,"58479":37156,"58480":37153,"58481":37147,"58482":37242,"58483":37234,"58484":37241,"58485":37235,"58486":37541,"58487":37540,"58488":37494,"58489":37531,"58490":37498,"58491":37536,"58492":37524,"58493":37546,"58494":37517,"58529":37542,"58530":37530,"58531":37547,"58532":37497,"58533":37527,"58534":37503,"58535":37539,"58536":37614,"58537":37518,"58538":37506,"58539":37525,"58540":37538,"58541":37501,"58542":37512,"58543":37537,"58544":37514,"58545":37510,"58546":37516,"58547":37529,"58548":37543,"58549":37502,"58550":37511,"58551":37545,"58552":37533,"58553":37515,"58554":37421,"58555":38558,"58556":38561,"58557":38655,"58558":38744,"58559":38781,"58560":38778,"58561":38782,"58562":38787,"58563":38784,"58564":38786,"58565":38779,"58566":38788,"58567":38785,"58568":38783,"58569":38862,"58570":38861,"58571":38934,"58572":39085,"58573":39086,"58574":39170,"58575":39168,"58576":39175,"58577":39325,"58578":39324,"58579":39363,"58580":39353,"58581":39355,"58582":39354,"58583":39362,"58584":39357,"58585":39367,"58586":39601,"58587":39651,"58588":39655,"58589":39742,"58590":39743,"58591":39776,"58592":39777,"58593":39775,"58594":40177,"58595":40178,"58596":40181,"58597":40615,"58598":20735,"58599":20739,"58600":20784,"58601":20728,"58602":20742,"58603":20743,"58604":20726,"58605":20734,"58606":20747,"58607":20748,"58608":20733,"58609":20746,"58610":21131,"58611":21132,"58612":21233,"58613":21231,"58614":22088,"58615":22082,"58616":22092,"58617":22069,"58618":22081,"58619":22090,"58620":22089,"58621":22086,"58622":22104,"58688":22106,"58689":22080,"58690":22067,"58691":22077,"58692":22060,"58693":22078,"58694":22072,"58695":22058,"58696":22074,"58697":22298,"58698":22699,"58699":22685,"58700":22705,"58701":22688,"58702":22691,"58703":22703,"58704":22700,"58705":22693,"58706":22689,"58707":22783,"58708":23295,"58709":23284,"58710":23293,"58711":23287,"58712":23286,"58713":23299,"58714":23288,"58715":23298,"58716":23289,"58717":23297,"58718":23303,"58719":23301,"58720":23311,"58721":23655,"58722":23961,"58723":23959,"58724":23967,"58725":23954,"58726":23970,"58727":23955,"58728":23957,"58729":23968,"58730":23964,"58731":23969,"58732":23962,"58733":23966,"58734":24169,"58735":24157,"58736":24160,"58737":24156,"58738":32243,"58739":24283,"58740":24286,"58741":24289,"58742":24393,"58743":24498,"58744":24971,"58745":24963,"58746":24953,"58747":25009,"58748":25008,"58749":24994,"58750":24969,"58785":24987,"58786":24979,"58787":25007,"58788":25005,"58789":24991,"58790":24978,"58791":25002,"58792":24993,"58793":24973,"58794":24934,"58795":25011,"58796":25133,"58797":25710,"58798":25712,"58799":25750,"58800":25760,"58801":25733,"58802":25751,"58803":25756,"58804":25743,"58805":25739,"58806":25738,"58807":25740,"58808":25763,"58809":25759,"58810":25704,"58811":25777,"58812":25752,"58813":25974,"58814":25978,"58815":25977,"58816":25979,"58817":26034,"58818":26035,"58819":26293,"58820":26288,"58821":26281,"58822":26290,"58823":26295,"58824":26282,"58825":26287,"58826":27136,"58827":27142,"58828":27159,"58829":27109,"58830":27128,"58831":27157,"58832":27121,"58833":27108,"58834":27168,"58835":27135,"58836":27116,"58837":27106,"58838":27163,"58839":27165,"58840":27134,"58841":27175,"58842":27122,"58843":27118,"58844":27156,"58845":27127,"58846":27111,"58847":27200,"58848":27144,"58849":27110,"58850":27131,"58851":27149,"58852":27132,"58853":27115,"58854":27145,"58855":27140,"58856":27160,"58857":27173,"58858":27151,"58859":27126,"58860":27174,"58861":27143,"58862":27124,"58863":27158,"58864":27473,"58865":27557,"58866":27555,"58867":27554,"58868":27558,"58869":27649,"58870":27648,"58871":27647,"58872":27650,"58873":28481,"58874":28454,"58875":28542,"58876":28551,"58877":28614,"58878":28562,"58944":28557,"58945":28553,"58946":28556,"58947":28514,"58948":28495,"58949":28549,"58950":28506,"58951":28566,"58952":28534,"58953":28524,"58954":28546,"58955":28501,"58956":28530,"58957":28498,"58958":28496,"58959":28503,"58960":28564,"58961":28563,"58962":28509,"58963":28416,"58964":28513,"58965":28523,"58966":28541,"58967":28519,"58968":28560,"58969":28499,"58970":28555,"58971":28521,"58972":28543,"58973":28565,"58974":28515,"58975":28535,"58976":28522,"58977":28539,"58978":29106,"58979":29103,"58980":29083,"58981":29104,"58982":29088,"58983":29082,"58984":29097,"58985":29109,"58986":29085,"58987":29093,"58988":29086,"58989":29092,"58990":29089,"58991":29098,"58992":29084,"58993":29095,"58994":29107,"58995":29336,"58996":29338,"58997":29528,"58998":29522,"58999":29534,"59000":29535,"59001":29536,"59002":29533,"59003":29531,"59004":29537,"59005":29530,"59006":29529,"59041":29538,"59042":29831,"59043":29833,"59044":29834,"59045":29830,"59046":29825,"59047":29821,"59048":29829,"59049":29832,"59050":29820,"59051":29817,"59052":29960,"59053":29959,"59054":30078,"59055":30245,"59056":30238,"59057":30233,"59058":30237,"59059":30236,"59060":30243,"59061":30234,"59062":30248,"59063":30235,"59064":30364,"59065":30365,"59066":30366,"59067":30363,"59068":30605,"59069":30607,"59070":30601,"59071":30600,"59072":30925,"59073":30907,"59074":30927,"59075":30924,"59076":30929,"59077":30926,"59078":30932,"59079":30920,"59080":30915,"59081":30916,"59082":30921,"59083":31130,"59084":31137,"59085":31136,"59086":31132,"59087":31138,"59088":31131,"59089":27510,"59090":31289,"59091":31410,"59092":31412,"59093":31411,"59094":31671,"59095":31691,"59096":31678,"59097":31660,"59098":31694,"59099":31663,"59100":31673,"59101":31690,"59102":31669,"59103":31941,"59104":31944,"59105":31948,"59106":31947,"59107":32247,"59108":32219,"59109":32234,"59110":32231,"59111":32215,"59112":32225,"59113":32259,"59114":32250,"59115":32230,"59116":32246,"59117":32241,"59118":32240,"59119":32238,"59120":32223,"59121":32630,"59122":32684,"59123":32688,"59124":32685,"59125":32749,"59126":32747,"59127":32746,"59128":32748,"59129":32742,"59130":32744,"59131":32868,"59132":32871,"59133":33187,"59134":33183,"59200":33182,"59201":33173,"59202":33186,"59203":33177,"59204":33175,"59205":33302,"59206":33359,"59207":33363,"59208":33362,"59209":33360,"59210":33358,"59211":33361,"59212":34084,"59213":34107,"59214":34063,"59215":34048,"59216":34089,"59217":34062,"59218":34057,"59219":34061,"59220":34079,"59221":34058,"59222":34087,"59223":34076,"59224":34043,"59225":34091,"59226":34042,"59227":34056,"59228":34060,"59229":34036,"59230":34090,"59231":34034,"59232":34069,"59233":34039,"59234":34027,"59235":34035,"59236":34044,"59237":34066,"59238":34026,"59239":34025,"59240":34070,"59241":34046,"59242":34088,"59243":34077,"59244":34094,"59245":34050,"59246":34045,"59247":34078,"59248":34038,"59249":34097,"59250":34086,"59251":34023,"59252":34024,"59253":34032,"59254":34031,"59255":34041,"59256":34072,"59257":34080,"59258":34096,"59259":34059,"59260":34073,"59261":34095,"59262":34402,"59297":34646,"59298":34659,"59299":34660,"59300":34679,"59301":34785,"59302":34675,"59303":34648,"59304":34644,"59305":34651,"59306":34642,"59307":34657,"59308":34650,"59309":34641,"59310":34654,"59311":34669,"59312":34666,"59313":34640,"59314":34638,"59315":34655,"59316":34653,"59317":34671,"59318":34668,"59319":34682,"59320":34670,"59321":34652,"59322":34661,"59323":34639,"59324":34683,"59325":34677,"59326":34658,"59327":34663,"59328":34665,"59329":34906,"59330":35077,"59331":35084,"59332":35092,"59333":35083,"59334":35095,"59335":35096,"59336":35097,"59337":35078,"59338":35094,"59339":35089,"59340":35086,"59341":35081,"59342":35234,"59343":35236,"59344":35235,"59345":35309,"59346":35312,"59347":35308,"59348":35535,"59349":35526,"59350":35512,"59351":35539,"59352":35537,"59353":35540,"59354":35541,"59355":35515,"59356":35543,"59357":35518,"59358":35520,"59359":35525,"59360":35544,"59361":35523,"59362":35514,"59363":35517,"59364":35545,"59365":35902,"59366":35917,"59367":35983,"59368":36069,"59369":36063,"59370":36057,"59371":36072,"59372":36058,"59373":36061,"59374":36071,"59375":36256,"59376":36252,"59377":36257,"59378":36251,"59379":36384,"59380":36387,"59381":36389,"59382":36388,"59383":36398,"59384":36373,"59385":36379,"59386":36374,"59387":36369,"59388":36377,"59389":36390,"59390":36391,"59456":36372,"59457":36370,"59458":36376,"59459":36371,"59460":36380,"59461":36375,"59462":36378,"59463":36652,"59464":36644,"59465":36632,"59466":36634,"59467":36640,"59468":36643,"59469":36630,"59470":36631,"59471":36979,"59472":36976,"59473":36975,"59474":36967,"59475":36971,"59476":37167,"59477":37163,"59478":37161,"59479":37162,"59480":37170,"59481":37158,"59482":37166,"59483":37253,"59484":37254,"59485":37258,"59486":37249,"59487":37250,"59488":37252,"59489":37248,"59490":37584,"59491":37571,"59492":37572,"59493":37568,"59494":37593,"59495":37558,"59496":37583,"59497":37617,"59498":37599,"59499":37592,"59500":37609,"59501":37591,"59502":37597,"59503":37580,"59504":37615,"59505":37570,"59506":37608,"59507":37578,"59508":37576,"59509":37582,"59510":37606,"59511":37581,"59512":37589,"59513":37577,"59514":37600,"59515":37598,"59516":37607,"59517":37585,"59518":37587,"59553":37557,"59554":37601,"59555":37574,"59556":37556,"59557":38268,"59558":38316,"59559":38315,"59560":38318,"59561":38320,"59562":38564,"59563":38562,"59564":38611,"59565":38661,"59566":38664,"59567":38658,"59568":38746,"59569":38794,"59570":38798,"59571":38792,"59572":38864,"59573":38863,"59574":38942,"59575":38941,"59576":38950,"59577":38953,"59578":38952,"59579":38944,"59580":38939,"59581":38951,"59582":39090,"59583":39176,"59584":39162,"59585":39185,"59586":39188,"59587":39190,"59588":39191,"59589":39189,"59590":39388,"59591":39373,"59592":39375,"59593":39379,"59594":39380,"59595":39374,"59596":39369,"59597":39382,"59598":39384,"59599":39371,"59600":39383,"59601":39372,"59602":39603,"59603":39660,"59604":39659,"59605":39667,"59606":39666,"59607":39665,"59608":39750,"59609":39747,"59610":39783,"59611":39796,"59612":39793,"59613":39782,"59614":39798,"59615":39797,"59616":39792,"59617":39784,"59618":39780,"59619":39788,"59620":40188,"59621":40186,"59622":40189,"59623":40191,"59624":40183,"59625":40199,"59626":40192,"59627":40185,"59628":40187,"59629":40200,"59630":40197,"59631":40196,"59632":40579,"59633":40659,"59634":40719,"59635":40720,"59636":20764,"59637":20755,"59638":20759,"59639":20762,"59640":20753,"59641":20958,"59642":21300,"59643":21473,"59644":22128,"59645":22112,"59646":22126,"59712":22131,"59713":22118,"59714":22115,"59715":22125,"59716":22130,"59717":22110,"59718":22135,"59719":22300,"59720":22299,"59721":22728,"59722":22717,"59723":22729,"59724":22719,"59725":22714,"59726":22722,"59727":22716,"59728":22726,"59729":23319,"59730":23321,"59731":23323,"59732":23329,"59733":23316,"59734":23315,"59735":23312,"59736":23318,"59737":23336,"59738":23322,"59739":23328,"59740":23326,"59741":23535,"59742":23980,"59743":23985,"59744":23977,"59745":23975,"59746":23989,"59747":23984,"59748":23982,"59749":23978,"59750":23976,"59751":23986,"59752":23981,"59753":23983,"59754":23988,"59755":24167,"59756":24168,"59757":24166,"59758":24175,"59759":24297,"59760":24295,"59761":24294,"59762":24296,"59763":24293,"59764":24395,"59765":24508,"59766":24989,"59767":25000,"59768":24982,"59769":25029,"59770":25012,"59771":25030,"59772":25025,"59773":25036,"59774":25018,"59809":25023,"59810":25016,"59811":24972,"59812":25815,"59813":25814,"59814":25808,"59815":25807,"59816":25801,"59817":25789,"59818":25737,"59819":25795,"59820":25819,"59821":25843,"59822":25817,"59823":25907,"59824":25983,"59825":25980,"59826":26018,"59827":26312,"59828":26302,"59829":26304,"59830":26314,"59831":26315,"59832":26319,"59833":26301,"59834":26299,"59835":26298,"59836":26316,"59837":26403,"59838":27188,"59839":27238,"59840":27209,"59841":27239,"59842":27186,"59843":27240,"59844":27198,"59845":27229,"59846":27245,"59847":27254,"59848":27227,"59849":27217,"59850":27176,"59851":27226,"59852":27195,"59853":27199,"59854":27201,"59855":27242,"59856":27236,"59857":27216,"59858":27215,"59859":27220,"59860":27247,"59861":27241,"59862":27232,"59863":27196,"59864":27230,"59865":27222,"59866":27221,"59867":27213,"59868":27214,"59869":27206,"59870":27477,"59871":27476,"59872":27478,"59873":27559,"59874":27562,"59875":27563,"59876":27592,"59877":27591,"59878":27652,"59879":27651,"59880":27654,"59881":28589,"59882":28619,"59883":28579,"59884":28615,"59885":28604,"59886":28622,"59887":28616,"59888":28510,"59889":28612,"59890":28605,"59891":28574,"59892":28618,"59893":28584,"59894":28676,"59895":28581,"59896":28590,"59897":28602,"59898":28588,"59899":28586,"59900":28623,"59901":28607,"59902":28600,"59968":28578,"59969":28617,"59970":28587,"59971":28621,"59972":28591,"59973":28594,"59974":28592,"59975":29125,"59976":29122,"59977":29119,"59978":29112,"59979":29142,"59980":29120,"59981":29121,"59982":29131,"59983":29140,"59984":29130,"59985":29127,"59986":29135,"59987":29117,"59988":29144,"59989":29116,"59990":29126,"59991":29146,"59992":29147,"59993":29341,"59994":29342,"59995":29545,"59996":29542,"59997":29543,"59998":29548,"59999":29541,"60000":29547,"60001":29546,"60002":29823,"60003":29850,"60004":29856,"60005":29844,"60006":29842,"60007":29845,"60008":29857,"60009":29963,"60010":30080,"60011":30255,"60012":30253,"60013":30257,"60014":30269,"60015":30259,"60016":30268,"60017":30261,"60018":30258,"60019":30256,"60020":30395,"60021":30438,"60022":30618,"60023":30621,"60024":30625,"60025":30620,"60026":30619,"60027":30626,"60028":30627,"60029":30613,"60030":30617,"60065":30615,"60066":30941,"60067":30953,"60068":30949,"60069":30954,"60070":30942,"60071":30947,"60072":30939,"60073":30945,"60074":30946,"60075":30957,"60076":30943,"60077":30944,"60078":31140,"60079":31300,"60080":31304,"60081":31303,"60082":31414,"60083":31416,"60084":31413,"60085":31409,"60086":31415,"60087":31710,"60088":31715,"60089":31719,"60090":31709,"60091":31701,"60092":31717,"60093":31706,"60094":31720,"60095":31737,"60096":31700,"60097":31722,"60098":31714,"60099":31708,"60100":31723,"60101":31704,"60102":31711,"60103":31954,"60104":31956,"60105":31959,"60106":31952,"60107":31953,"60108":32274,"60109":32289,"60110":32279,"60111":32268,"60112":32287,"60113":32288,"60114":32275,"60115":32270,"60116":32284,"60117":32277,"60118":32282,"60119":32290,"60120":32267,"60121":32271,"60122":32278,"60123":32269,"60124":32276,"60125":32293,"60126":32292,"60127":32579,"60128":32635,"60129":32636,"60130":32634,"60131":32689,"60132":32751,"60133":32810,"60134":32809,"60135":32876,"60136":33201,"60137":33190,"60138":33198,"60139":33209,"60140":33205,"60141":33195,"60142":33200,"60143":33196,"60144":33204,"60145":33202,"60146":33207,"60147":33191,"60148":33266,"60149":33365,"60150":33366,"60151":33367,"60152":34134,"60153":34117,"60154":34155,"60155":34125,"60156":34131,"60157":34145,"60158":34136,"60224":34112,"60225":34118,"60226":34148,"60227":34113,"60228":34146,"60229":34116,"60230":34129,"60231":34119,"60232":34147,"60233":34110,"60234":34139,"60235":34161,"60236":34126,"60237":34158,"60238":34165,"60239":34133,"60240":34151,"60241":34144,"60242":34188,"60243":34150,"60244":34141,"60245":34132,"60246":34149,"60247":34156,"60248":34403,"60249":34405,"60250":34404,"60251":34715,"60252":34703,"60253":34711,"60254":34707,"60255":34706,"60256":34696,"60257":34689,"60258":34710,"60259":34712,"60260":34681,"60261":34695,"60262":34723,"60263":34693,"60264":34704,"60265":34705,"60266":34717,"60267":34692,"60268":34708,"60269":34716,"60270":34714,"60271":34697,"60272":35102,"60273":35110,"60274":35120,"60275":35117,"60276":35118,"60277":35111,"60278":35121,"60279":35106,"60280":35113,"60281":35107,"60282":35119,"60283":35116,"60284":35103,"60285":35313,"60286":35552,"60321":35554,"60322":35570,"60323":35572,"60324":35573,"60325":35549,"60326":35604,"60327":35556,"60328":35551,"60329":35568,"60330":35528,"60331":35550,"60332":35553,"60333":35560,"60334":35583,"60335":35567,"60336":35579,"60337":35985,"60338":35986,"60339":35984,"60340":36085,"60341":36078,"60342":36081,"60343":36080,"60344":36083,"60345":36204,"60346":36206,"60347":36261,"60348":36263,"60349":36403,"60350":36414,"60351":36408,"60352":36416,"60353":36421,"60354":36406,"60355":36412,"60356":36413,"60357":36417,"60358":36400,"60359":36415,"60360":36541,"60361":36662,"60362":36654,"60363":36661,"60364":36658,"60365":36665,"60366":36663,"60367":36660,"60368":36982,"60369":36985,"60370":36987,"60371":36998,"60372":37114,"60373":37171,"60374":37173,"60375":37174,"60376":37267,"60377":37264,"60378":37265,"60379":37261,"60380":37263,"60381":37671,"60382":37662,"60383":37640,"60384":37663,"60385":37638,"60386":37647,"60387":37754,"60388":37688,"60389":37692,"60390":37659,"60391":37667,"60392":37650,"60393":37633,"60394":37702,"60395":37677,"60396":37646,"60397":37645,"60398":37579,"60399":37661,"60400":37626,"60401":37669,"60402":37651,"60403":37625,"60404":37623,"60405":37684,"60406":37634,"60407":37668,"60408":37631,"60409":37673,"60410":37689,"60411":37685,"60412":37674,"60413":37652,"60414":37644,"60480":37643,"60481":37630,"60482":37641,"60483":37632,"60484":37627,"60485":37654,"60486":38332,"60487":38349,"60488":38334,"60489":38329,"60490":38330,"60491":38326,"60492":38335,"60493":38325,"60494":38333,"60495":38569,"60496":38612,"60497":38667,"60498":38674,"60499":38672,"60500":38809,"60501":38807,"60502":38804,"60503":38896,"60504":38904,"60505":38965,"60506":38959,"60507":38962,"60508":39204,"60509":39199,"60510":39207,"60511":39209,"60512":39326,"60513":39406,"60514":39404,"60515":39397,"60516":39396,"60517":39408,"60518":39395,"60519":39402,"60520":39401,"60521":39399,"60522":39609,"60523":39615,"60524":39604,"60525":39611,"60526":39670,"60527":39674,"60528":39673,"60529":39671,"60530":39731,"60531":39808,"60532":39813,"60533":39815,"60534":39804,"60535":39806,"60536":39803,"60537":39810,"60538":39827,"60539":39826,"60540":39824,"60541":39802,"60542":39829,"60577":39805,"60578":39816,"60579":40229,"60580":40215,"60581":40224,"60582":40222,"60583":40212,"60584":40233,"60585":40221,"60586":40216,"60587":40226,"60588":40208,"60589":40217,"60590":40223,"60591":40584,"60592":40582,"60593":40583,"60594":40622,"60595":40621,"60596":40661,"60597":40662,"60598":40698,"60599":40722,"60600":40765,"60601":20774,"60602":20773,"60603":20770,"60604":20772,"60605":20768,"60606":20777,"60607":21236,"60608":22163,"60609":22156,"60610":22157,"60611":22150,"60612":22148,"60613":22147,"60614":22142,"60615":22146,"60616":22143,"60617":22145,"60618":22742,"60619":22740,"60620":22735,"60621":22738,"60622":23341,"60623":23333,"60624":23346,"60625":23331,"60626":23340,"60627":23335,"60628":23334,"60629":23343,"60630":23342,"60631":23419,"60632":23537,"60633":23538,"60634":23991,"60635":24172,"60636":24170,"60637":24510,"60638":24507,"60639":25027,"60640":25013,"60641":25020,"60642":25063,"60643":25056,"60644":25061,"60645":25060,"60646":25064,"60647":25054,"60648":25839,"60649":25833,"60650":25827,"60651":25835,"60652":25828,"60653":25832,"60654":25985,"60655":25984,"60656":26038,"60657":26074,"60658":26322,"60659":27277,"60660":27286,"60661":27265,"60662":27301,"60663":27273,"60664":27295,"60665":27291,"60666":27297,"60667":27294,"60668":27271,"60669":27283,"60670":27278,"60736":27285,"60737":27267,"60738":27304,"60739":27300,"60740":27281,"60741":27263,"60742":27302,"60743":27290,"60744":27269,"60745":27276,"60746":27282,"60747":27483,"60748":27565,"60749":27657,"60750":28620,"60751":28585,"60752":28660,"60753":28628,"60754":28643,"60755":28636,"60756":28653,"60757":28647,"60758":28646,"60759":28638,"60760":28658,"60761":28637,"60762":28642,"60763":28648,"60764":29153,"60765":29169,"60766":29160,"60767":29170,"60768":29156,"60769":29168,"60770":29154,"60771":29555,"60772":29550,"60773":29551,"60774":29847,"60775":29874,"60776":29867,"60777":29840,"60778":29866,"60779":29869,"60780":29873,"60781":29861,"60782":29871,"60783":29968,"60784":29969,"60785":29970,"60786":29967,"60787":30084,"60788":30275,"60789":30280,"60790":30281,"60791":30279,"60792":30372,"60793":30441,"60794":30645,"60795":30635,"60796":30642,"60797":30647,"60798":30646,"60833":30644,"60834":30641,"60835":30632,"60836":30704,"60837":30963,"60838":30973,"60839":30978,"60840":30971,"60841":30972,"60842":30962,"60843":30981,"60844":30969,"60845":30974,"60846":30980,"60847":31147,"60848":31144,"60849":31324,"60850":31323,"60851":31318,"60852":31320,"60853":31316,"60854":31322,"60855":31422,"60856":31424,"60857":31425,"60858":31749,"60859":31759,"60860":31730,"60861":31744,"60862":31743,"60863":31739,"60864":31758,"60865":31732,"60866":31755,"60867":31731,"60868":31746,"60869":31753,"60870":31747,"60871":31745,"60872":31736,"60873":31741,"60874":31750,"60875":31728,"60876":31729,"60877":31760,"60878":31754,"60879":31976,"60880":32301,"60881":32316,"60882":32322,"60883":32307,"60884":38984,"60885":32312,"60886":32298,"60887":32329,"60888":32320,"60889":32327,"60890":32297,"60891":32332,"60892":32304,"60893":32315,"60894":32310,"60895":32324,"60896":32314,"60897":32581,"60898":32639,"60899":32638,"60900":32637,"60901":32756,"60902":32754,"60903":32812,"60904":33211,"60905":33220,"60906":33228,"60907":33226,"60908":33221,"60909":33223,"60910":33212,"60911":33257,"60912":33371,"60913":33370,"60914":33372,"60915":34179,"60916":34176,"60917":34191,"60918":34215,"60919":34197,"60920":34208,"60921":34187,"60922":34211,"60923":34171,"60924":34212,"60925":34202,"60926":34206,"60992":34167,"60993":34172,"60994":34185,"60995":34209,"60996":34170,"60997":34168,"60998":34135,"60999":34190,"61000":34198,"61001":34182,"61002":34189,"61003":34201,"61004":34205,"61005":34177,"61006":34210,"61007":34178,"61008":34184,"61009":34181,"61010":34169,"61011":34166,"61012":34200,"61013":34192,"61014":34207,"61015":34408,"61016":34750,"61017":34730,"61018":34733,"61019":34757,"61020":34736,"61021":34732,"61022":34745,"61023":34741,"61024":34748,"61025":34734,"61026":34761,"61027":34755,"61028":34754,"61029":34764,"61030":34743,"61031":34735,"61032":34756,"61033":34762,"61034":34740,"61035":34742,"61036":34751,"61037":34744,"61038":34749,"61039":34782,"61040":34738,"61041":35125,"61042":35123,"61043":35132,"61044":35134,"61045":35137,"61046":35154,"61047":35127,"61048":35138,"61049":35245,"61050":35247,"61051":35246,"61052":35314,"61053":35315,"61054":35614,"61089":35608,"61090":35606,"61091":35601,"61092":35589,"61093":35595,"61094":35618,"61095":35599,"61096":35602,"61097":35605,"61098":35591,"61099":35597,"61100":35592,"61101":35590,"61102":35612,"61103":35603,"61104":35610,"61105":35919,"61106":35952,"61107":35954,"61108":35953,"61109":35951,"61110":35989,"61111":35988,"61112":36089,"61113":36207,"61114":36430,"61115":36429,"61116":36435,"61117":36432,"61118":36428,"61119":36423,"61120":36675,"61121":36672,"61122":36997,"61123":36990,"61124":37176,"61125":37274,"61126":37282,"61127":37275,"61128":37273,"61129":37279,"61130":37281,"61131":37277,"61132":37280,"61133":37793,"61134":37763,"61135":37807,"61136":37732,"61137":37718,"61138":37703,"61139":37756,"61140":37720,"61141":37724,"61142":37750,"61143":37705,"61144":37712,"61145":37713,"61146":37728,"61147":37741,"61148":37775,"61149":37708,"61150":37738,"61151":37753,"61152":37719,"61153":37717,"61154":37714,"61155":37711,"61156":37745,"61157":37751,"61158":37755,"61159":37729,"61160":37726,"61161":37731,"61162":37735,"61163":37760,"61164":37710,"61165":37721,"61166":38343,"61167":38336,"61168":38345,"61169":38339,"61170":38341,"61171":38327,"61172":38574,"61173":38576,"61174":38572,"61175":38688,"61176":38687,"61177":38680,"61178":38685,"61179":38681,"61180":38810,"61181":38817,"61182":38812,"61248":38814,"61249":38813,"61250":38869,"61251":38868,"61252":38897,"61253":38977,"61254":38980,"61255":38986,"61256":38985,"61257":38981,"61258":38979,"61259":39205,"61260":39211,"61261":39212,"61262":39210,"61263":39219,"61264":39218,"61265":39215,"61266":39213,"61267":39217,"61268":39216,"61269":39320,"61270":39331,"61271":39329,"61272":39426,"61273":39418,"61274":39412,"61275":39415,"61276":39417,"61277":39416,"61278":39414,"61279":39419,"61280":39421,"61281":39422,"61282":39420,"61283":39427,"61284":39614,"61285":39678,"61286":39677,"61287":39681,"61288":39676,"61289":39752,"61290":39834,"61291":39848,"61292":39838,"61293":39835,"61294":39846,"61295":39841,"61296":39845,"61297":39844,"61298":39814,"61299":39842,"61300":39840,"61301":39855,"61302":40243,"61303":40257,"61304":40295,"61305":40246,"61306":40238,"61307":40239,"61308":40241,"61309":40248,"61310":40240,"61345":40261,"61346":40258,"61347":40259,"61348":40254,"61349":40247,"61350":40256,"61351":40253,"61352":32757,"61353":40237,"61354":40586,"61355":40585,"61356":40589,"61357":40624,"61358":40648,"61359":40666,"61360":40699,"61361":40703,"61362":40740,"61363":40739,"61364":40738,"61365":40788,"61366":40864,"61367":20785,"61368":20781,"61369":20782,"61370":22168,"61371":22172,"61372":22167,"61373":22170,"61374":22173,"61375":22169,"61376":22896,"61377":23356,"61378":23657,"61379":23658,"61380":24000,"61381":24173,"61382":24174,"61383":25048,"61384":25055,"61385":25069,"61386":25070,"61387":25073,"61388":25066,"61389":25072,"61390":25067,"61391":25046,"61392":25065,"61393":25855,"61394":25860,"61395":25853,"61396":25848,"61397":25857,"61398":25859,"61399":25852,"61400":26004,"61401":26075,"61402":26330,"61403":26331,"61404":26328,"61405":27333,"61406":27321,"61407":27325,"61408":27361,"61409":27334,"61410":27322,"61411":27318,"61412":27319,"61413":27335,"61414":27316,"61415":27309,"61416":27486,"61417":27593,"61418":27659,"61419":28679,"61420":28684,"61421":28685,"61422":28673,"61423":28677,"61424":28692,"61425":28686,"61426":28671,"61427":28672,"61428":28667,"61429":28710,"61430":28668,"61431":28663,"61432":28682,"61433":29185,"61434":29183,"61435":29177,"61436":29187,"61437":29181,"61438":29558,"61504":29880,"61505":29888,"61506":29877,"61507":29889,"61508":29886,"61509":29878,"61510":29883,"61511":29890,"61512":29972,"61513":29971,"61514":30300,"61515":30308,"61516":30297,"61517":30288,"61518":30291,"61519":30295,"61520":30298,"61521":30374,"61522":30397,"61523":30444,"61524":30658,"61525":30650,"61526":30975,"61527":30988,"61528":30995,"61529":30996,"61530":30985,"61531":30992,"61532":30994,"61533":30993,"61534":31149,"61535":31148,"61536":31327,"61537":31772,"61538":31785,"61539":31769,"61540":31776,"61541":31775,"61542":31789,"61543":31773,"61544":31782,"61545":31784,"61546":31778,"61547":31781,"61548":31792,"61549":32348,"61550":32336,"61551":32342,"61552":32355,"61553":32344,"61554":32354,"61555":32351,"61556":32337,"61557":32352,"61558":32343,"61559":32339,"61560":32693,"61561":32691,"61562":32759,"61563":32760,"61564":32885,"61565":33233,"61566":33234,"61601":33232,"61602":33375,"61603":33374,"61604":34228,"61605":34246,"61606":34240,"61607":34243,"61608":34242,"61609":34227,"61610":34229,"61611":34237,"61612":34247,"61613":34244,"61614":34239,"61615":34251,"61616":34254,"61617":34248,"61618":34245,"61619":34225,"61620":34230,"61621":34258,"61622":34340,"61623":34232,"61624":34231,"61625":34238,"61626":34409,"61627":34791,"61628":34790,"61629":34786,"61630":34779,"61631":34795,"61632":34794,"61633":34789,"61634":34783,"61635":34803,"61636":34788,"61637":34772,"61638":34780,"61639":34771,"61640":34797,"61641":34776,"61642":34787,"61643":34724,"61644":34775,"61645":34777,"61646":34817,"61647":34804,"61648":34792,"61649":34781,"61650":35155,"61651":35147,"61652":35151,"61653":35148,"61654":35142,"61655":35152,"61656":35153,"61657":35145,"61658":35626,"61659":35623,"61660":35619,"61661":35635,"61662":35632,"61663":35637,"61664":35655,"61665":35631,"61666":35644,"61667":35646,"61668":35633,"61669":35621,"61670":35639,"61671":35622,"61672":35638,"61673":35630,"61674":35620,"61675":35643,"61676":35645,"61677":35642,"61678":35906,"61679":35957,"61680":35993,"61681":35992,"61682":35991,"61683":36094,"61684":36100,"61685":36098,"61686":36096,"61687":36444,"61688":36450,"61689":36448,"61690":36439,"61691":36438,"61692":36446,"61693":36453,"61694":36455,"61760":36443,"61761":36442,"61762":36449,"61763":36445,"61764":36457,"61765":36436,"61766":36678,"61767":36679,"61768":36680,"61769":36683,"61770":37160,"61771":37178,"61772":37179,"61773":37182,"61774":37288,"61775":37285,"61776":37287,"61777":37295,"61778":37290,"61779":37813,"61780":37772,"61781":37778,"61782":37815,"61783":37787,"61784":37789,"61785":37769,"61786":37799,"61787":37774,"61788":37802,"61789":37790,"61790":37798,"61791":37781,"61792":37768,"61793":37785,"61794":37791,"61795":37773,"61796":37809,"61797":37777,"61798":37810,"61799":37796,"61800":37800,"61801":37812,"61802":37795,"61803":37797,"61804":38354,"61805":38355,"61806":38353,"61807":38579,"61808":38615,"61809":38618,"61810":24002,"61811":38623,"61812":38616,"61813":38621,"61814":38691,"61815":38690,"61816":38693,"61817":38828,"61818":38830,"61819":38824,"61820":38827,"61821":38820,"61822":38826,"61857":38818,"61858":38821,"61859":38871,"61860":38873,"61861":38870,"61862":38872,"61863":38906,"61864":38992,"61865":38993,"61866":38994,"61867":39096,"61868":39233,"61869":39228,"61870":39226,"61871":39439,"61872":39435,"61873":39433,"61874":39437,"61875":39428,"61876":39441,"61877":39434,"61878":39429,"61879":39431,"61880":39430,"61881":39616,"61882":39644,"61883":39688,"61884":39684,"61885":39685,"61886":39721,"61887":39733,"61888":39754,"61889":39756,"61890":39755,"61891":39879,"61892":39878,"61893":39875,"61894":39871,"61895":39873,"61896":39861,"61897":39864,"61898":39891,"61899":39862,"61900":39876,"61901":39865,"61902":39869,"61903":40284,"61904":40275,"61905":40271,"61906":40266,"61907":40283,"61908":40267,"61909":40281,"61910":40278,"61911":40268,"61912":40279,"61913":40274,"61914":40276,"61915":40287,"61916":40280,"61917":40282,"61918":40590,"61919":40588,"61920":40671,"61921":40705,"61922":40704,"61923":40726,"61924":40741,"61925":40747,"61926":40746,"61927":40745,"61928":40744,"61929":40780,"61930":40789,"61931":20788,"61932":20789,"61933":21142,"61934":21239,"61935":21428,"61936":22187,"61937":22189,"61938":22182,"61939":22183,"61940":22186,"61941":22188,"61942":22746,"61943":22749,"61944":22747,"61945":22802,"61946":23357,"61947":23358,"61948":23359,"61949":24003,"61950":24176,"62016":24511,"62017":25083,"62018":25863,"62019":25872,"62020":25869,"62021":25865,"62022":25868,"62023":25870,"62024":25988,"62025":26078,"62026":26077,"62027":26334,"62028":27367,"62029":27360,"62030":27340,"62031":27345,"62032":27353,"62033":27339,"62034":27359,"62035":27356,"62036":27344,"62037":27371,"62038":27343,"62039":27341,"62040":27358,"62041":27488,"62042":27568,"62043":27660,"62044":28697,"62045":28711,"62046":28704,"62047":28694,"62048":28715,"62049":28705,"62050":28706,"62051":28707,"62052":28713,"62053":28695,"62054":28708,"62055":28700,"62056":28714,"62057":29196,"62058":29194,"62059":29191,"62060":29186,"62061":29189,"62062":29349,"62063":29350,"62064":29348,"62065":29347,"62066":29345,"62067":29899,"62068":29893,"62069":29879,"62070":29891,"62071":29974,"62072":30304,"62073":30665,"62074":30666,"62075":30660,"62076":30705,"62077":31005,"62078":31003,"62113":31009,"62114":31004,"62115":30999,"62116":31006,"62117":31152,"62118":31335,"62119":31336,"62120":31795,"62121":31804,"62122":31801,"62123":31788,"62124":31803,"62125":31980,"62126":31978,"62127":32374,"62128":32373,"62129":32376,"62130":32368,"62131":32375,"62132":32367,"62133":32378,"62134":32370,"62135":32372,"62136":32360,"62137":32587,"62138":32586,"62139":32643,"62140":32646,"62141":32695,"62142":32765,"62143":32766,"62144":32888,"62145":33239,"62146":33237,"62147":33380,"62148":33377,"62149":33379,"62150":34283,"62151":34289,"62152":34285,"62153":34265,"62154":34273,"62155":34280,"62156":34266,"62157":34263,"62158":34284,"62159":34290,"62160":34296,"62161":34264,"62162":34271,"62163":34275,"62164":34268,"62165":34257,"62166":34288,"62167":34278,"62168":34287,"62169":34270,"62170":34274,"62171":34816,"62172":34810,"62173":34819,"62174":34806,"62175":34807,"62176":34825,"62177":34828,"62178":34827,"62179":34822,"62180":34812,"62181":34824,"62182":34815,"62183":34826,"62184":34818,"62185":35170,"62186":35162,"62187":35163,"62188":35159,"62189":35169,"62190":35164,"62191":35160,"62192":35165,"62193":35161,"62194":35208,"62195":35255,"62196":35254,"62197":35318,"62198":35664,"62199":35656,"62200":35658,"62201":35648,"62202":35667,"62203":35670,"62204":35668,"62205":35659,"62206":35669,"62272":35665,"62273":35650,"62274":35666,"62275":35671,"62276":35907,"62277":35959,"62278":35958,"62279":35994,"62280":36102,"62281":36103,"62282":36105,"62283":36268,"62284":36266,"62285":36269,"62286":36267,"62287":36461,"62288":36472,"62289":36467,"62290":36458,"62291":36463,"62292":36475,"62293":36546,"62294":36690,"62295":36689,"62296":36687,"62297":36688,"62298":36691,"62299":36788,"62300":37184,"62301":37183,"62302":37296,"62303":37293,"62304":37854,"62305":37831,"62306":37839,"62307":37826,"62308":37850,"62309":37840,"62310":37881,"62311":37868,"62312":37836,"62313":37849,"62314":37801,"62315":37862,"62316":37834,"62317":37844,"62318":37870,"62319":37859,"62320":37845,"62321":37828,"62322":37838,"62323":37824,"62324":37842,"62325":37863,"62326":38269,"62327":38362,"62328":38363,"62329":38625,"62330":38697,"62331":38699,"62332":38700,"62333":38696,"62334":38694,"62369":38835,"62370":38839,"62371":38838,"62372":38877,"62373":38878,"62374":38879,"62375":39004,"62376":39001,"62377":39005,"62378":38999,"62379":39103,"62380":39101,"62381":39099,"62382":39102,"62383":39240,"62384":39239,"62385":39235,"62386":39334,"62387":39335,"62388":39450,"62389":39445,"62390":39461,"62391":39453,"62392":39460,"62393":39451,"62394":39458,"62395":39456,"62396":39463,"62397":39459,"62398":39454,"62399":39452,"62400":39444,"62401":39618,"62402":39691,"62403":39690,"62404":39694,"62405":39692,"62406":39735,"62407":39914,"62408":39915,"62409":39904,"62410":39902,"62411":39908,"62412":39910,"62413":39906,"62414":39920,"62415":39892,"62416":39895,"62417":39916,"62418":39900,"62419":39897,"62420":39909,"62421":39893,"62422":39905,"62423":39898,"62424":40311,"62425":40321,"62426":40330,"62427":40324,"62428":40328,"62429":40305,"62430":40320,"62431":40312,"62432":40326,"62433":40331,"62434":40332,"62435":40317,"62436":40299,"62437":40308,"62438":40309,"62439":40304,"62440":40297,"62441":40325,"62442":40307,"62443":40315,"62444":40322,"62445":40303,"62446":40313,"62447":40319,"62448":40327,"62449":40296,"62450":40596,"62451":40593,"62452":40640,"62453":40700,"62454":40749,"62455":40768,"62456":40769,"62457":40781,"62458":40790,"62459":40791,"62460":40792,"62461":21303,"62462":22194,"62528":22197,"62529":22195,"62530":22755,"62531":23365,"62532":24006,"62533":24007,"62534":24302,"62535":24303,"62536":24512,"62537":24513,"62538":25081,"62539":25879,"62540":25878,"62541":25877,"62542":25875,"62543":26079,"62544":26344,"62545":26339,"62546":26340,"62547":27379,"62548":27376,"62549":27370,"62550":27368,"62551":27385,"62552":27377,"62553":27374,"62554":27375,"62555":28732,"62556":28725,"62557":28719,"62558":28727,"62559":28724,"62560":28721,"62561":28738,"62562":28728,"62563":28735,"62564":28730,"62565":28729,"62566":28736,"62567":28731,"62568":28723,"62569":28737,"62570":29203,"62571":29204,"62572":29352,"62573":29565,"62574":29564,"62575":29882,"62576":30379,"62577":30378,"62578":30398,"62579":30445,"62580":30668,"62581":30670,"62582":30671,"62583":30669,"62584":30706,"62585":31013,"62586":31011,"62587":31015,"62588":31016,"62589":31012,"62590":31017,"62625":31154,"62626":31342,"62627":31340,"62628":31341,"62629":31479,"62630":31817,"62631":31816,"62632":31818,"62633":31815,"62634":31813,"62635":31982,"62636":32379,"62637":32382,"62638":32385,"62639":32384,"62640":32698,"62641":32767,"62642":32889,"62643":33243,"62644":33241,"62645":33291,"62646":33384,"62647":33385,"62648":34338,"62649":34303,"62650":34305,"62651":34302,"62652":34331,"62653":34304,"62654":34294,"62655":34308,"62656":34313,"62657":34309,"62658":34316,"62659":34301,"62660":34841,"62661":34832,"62662":34833,"62663":34839,"62664":34835,"62665":34838,"62666":35171,"62667":35174,"62668":35257,"62669":35319,"62670":35680,"62671":35690,"62672":35677,"62673":35688,"62674":35683,"62675":35685,"62676":35687,"62677":35693,"62678":36270,"62679":36486,"62680":36488,"62681":36484,"62682":36697,"62683":36694,"62684":36695,"62685":36693,"62686":36696,"62687":36698,"62688":37005,"62689":37187,"62690":37185,"62691":37303,"62692":37301,"62693":37298,"62694":37299,"62695":37899,"62696":37907,"62697":37883,"62698":37920,"62699":37903,"62700":37908,"62701":37886,"62702":37909,"62703":37904,"62704":37928,"62705":37913,"62706":37901,"62707":37877,"62708":37888,"62709":37879,"62710":37895,"62711":37902,"62712":37910,"62713":37906,"62714":37882,"62715":37897,"62716":37880,"62717":37898,"62718":37887,"62784":37884,"62785":37900,"62786":37878,"62787":37905,"62788":37894,"62789":38366,"62790":38368,"62791":38367,"62792":38702,"62793":38703,"62794":38841,"62795":38843,"62796":38909,"62797":38910,"62798":39008,"62799":39010,"62800":39011,"62801":39007,"62802":39105,"62803":39106,"62804":39248,"62805":39246,"62806":39257,"62807":39244,"62808":39243,"62809":39251,"62810":39474,"62811":39476,"62812":39473,"62813":39468,"62814":39466,"62815":39478,"62816":39465,"62817":39470,"62818":39480,"62819":39469,"62820":39623,"62821":39626,"62822":39622,"62823":39696,"62824":39698,"62825":39697,"62826":39947,"62827":39944,"62828":39927,"62829":39941,"62830":39954,"62831":39928,"62832":40000,"62833":39943,"62834":39950,"62835":39942,"62836":39959,"62837":39956,"62838":39945,"62839":40351,"62840":40345,"62841":40356,"62842":40349,"62843":40338,"62844":40344,"62845":40336,"62846":40347,"62881":40352,"62882":40340,"62883":40348,"62884":40362,"62885":40343,"62886":40353,"62887":40346,"62888":40354,"62889":40360,"62890":40350,"62891":40355,"62892":40383,"62893":40361,"62894":40342,"62895":40358,"62896":40359,"62897":40601,"62898":40603,"62899":40602,"62900":40677,"62901":40676,"62902":40679,"62903":40678,"62904":40752,"62905":40750,"62906":40795,"62907":40800,"62908":40798,"62909":40797,"62910":40793,"62911":40849,"62912":20794,"62913":20793,"62914":21144,"62915":21143,"62916":22211,"62917":22205,"62918":22206,"62919":23368,"62920":23367,"62921":24011,"62922":24015,"62923":24305,"62924":25085,"62925":25883,"62926":27394,"62927":27388,"62928":27395,"62929":27384,"62930":27392,"62931":28739,"62932":28740,"62933":28746,"62934":28744,"62935":28745,"62936":28741,"62937":28742,"62938":29213,"62939":29210,"62940":29209,"62941":29566,"62942":29975,"62943":30314,"62944":30672,"62945":31021,"62946":31025,"62947":31023,"62948":31828,"62949":31827,"62950":31986,"62951":32394,"62952":32391,"62953":32392,"62954":32395,"62955":32390,"62956":32397,"62957":32589,"62958":32699,"62959":32816,"62960":33245,"62961":34328,"62962":34346,"62963":34342,"62964":34335,"62965":34339,"62966":34332,"62967":34329,"62968":34343,"62969":34350,"62970":34337,"62971":34336,"62972":34345,"62973":34334,"62974":34341,"63040":34857,"63041":34845,"63042":34843,"63043":34848,"63044":34852,"63045":34844,"63046":34859,"63047":34890,"63048":35181,"63049":35177,"63050":35182,"63051":35179,"63052":35322,"63053":35705,"63054":35704,"63055":35653,"63056":35706,"63057":35707,"63058":36112,"63059":36116,"63060":36271,"63061":36494,"63062":36492,"63063":36702,"63064":36699,"63065":36701,"63066":37190,"63067":37188,"63068":37189,"63069":37305,"63070":37951,"63071":37947,"63072":37942,"63073":37929,"63074":37949,"63075":37948,"63076":37936,"63077":37945,"63078":37930,"63079":37943,"63080":37932,"63081":37952,"63082":37937,"63083":38373,"63084":38372,"63085":38371,"63086":38709,"63087":38714,"63088":38847,"63089":38881,"63090":39012,"63091":39113,"63092":39110,"63093":39104,"63094":39256,"63095":39254,"63096":39481,"63097":39485,"63098":39494,"63099":39492,"63100":39490,"63101":39489,"63102":39482,"63137":39487,"63138":39629,"63139":39701,"63140":39703,"63141":39704,"63142":39702,"63143":39738,"63144":39762,"63145":39979,"63146":39965,"63147":39964,"63148":39980,"63149":39971,"63150":39976,"63151":39977,"63152":39972,"63153":39969,"63154":40375,"63155":40374,"63156":40380,"63157":40385,"63158":40391,"63159":40394,"63160":40399,"63161":40382,"63162":40389,"63163":40387,"63164":40379,"63165":40373,"63166":40398,"63167":40377,"63168":40378,"63169":40364,"63170":40392,"63171":40369,"63172":40365,"63173":40396,"63174":40371,"63175":40397,"63176":40370,"63177":40570,"63178":40604,"63179":40683,"63180":40686,"63181":40685,"63182":40731,"63183":40728,"63184":40730,"63185":40753,"63186":40782,"63187":40805,"63188":40804,"63189":40850,"63190":20153,"63191":22214,"63192":22213,"63193":22219,"63194":22897,"63195":23371,"63196":23372,"63197":24021,"63198":24017,"63199":24306,"63200":25889,"63201":25888,"63202":25894,"63203":25890,"63204":27403,"63205":27400,"63206":27401,"63207":27661,"63208":28757,"63209":28758,"63210":28759,"63211":28754,"63212":29214,"63213":29215,"63214":29353,"63215":29567,"63216":29912,"63217":29909,"63218":29913,"63219":29911,"63220":30317,"63221":30381,"63222":31029,"63223":31156,"63224":31344,"63225":31345,"63226":31831,"63227":31836,"63228":31833,"63229":31835,"63230":31834,"63296":31988,"63297":31985,"63298":32401,"63299":32591,"63300":32647,"63301":33246,"63302":33387,"63303":34356,"63304":34357,"63305":34355,"63306":34348,"63307":34354,"63308":34358,"63309":34860,"63310":34856,"63311":34854,"63312":34858,"63313":34853,"63314":35185,"63315":35263,"63316":35262,"63317":35323,"63318":35710,"63319":35716,"63320":35714,"63321":35718,"63322":35717,"63323":35711,"63324":36117,"63325":36501,"63326":36500,"63327":36506,"63328":36498,"63329":36496,"63330":36502,"63331":36503,"63332":36704,"63333":36706,"63334":37191,"63335":37964,"63336":37968,"63337":37962,"63338":37963,"63339":37967,"63340":37959,"63341":37957,"63342":37960,"63343":37961,"63344":37958,"63345":38719,"63346":38883,"63347":39018,"63348":39017,"63349":39115,"63350":39252,"63351":39259,"63352":39502,"63353":39507,"63354":39508,"63355":39500,"63356":39503,"63357":39496,"63358":39498,"63393":39497,"63394":39506,"63395":39504,"63396":39632,"63397":39705,"63398":39723,"63399":39739,"63400":39766,"63401":39765,"63402":40006,"63403":40008,"63404":39999,"63405":40004,"63406":39993,"63407":39987,"63408":40001,"63409":39996,"63410":39991,"63411":39988,"63412":39986,"63413":39997,"63414":39990,"63415":40411,"63416":40402,"63417":40414,"63418":40410,"63419":40395,"63420":40400,"63421":40412,"63422":40401,"63423":40415,"63424":40425,"63425":40409,"63426":40408,"63427":40406,"63428":40437,"63429":40405,"63430":40413,"63431":40630,"63432":40688,"63433":40757,"63434":40755,"63435":40754,"63436":40770,"63437":40811,"63438":40853,"63439":40866,"63440":20797,"63441":21145,"63442":22760,"63443":22759,"63444":22898,"63445":23373,"63446":24024,"63447":34863,"63448":24399,"63449":25089,"63450":25091,"63451":25092,"63452":25897,"63453":25893,"63454":26006,"63455":26347,"63456":27409,"63457":27410,"63458":27407,"63459":27594,"63460":28763,"63461":28762,"63462":29218,"63463":29570,"63464":29569,"63465":29571,"63466":30320,"63467":30676,"63468":31847,"63469":31846,"63470":32405,"63471":33388,"63472":34362,"63473":34368,"63474":34361,"63475":34364,"63476":34353,"63477":34363,"63478":34366,"63479":34864,"63480":34866,"63481":34862,"63482":34867,"63483":35190,"63484":35188,"63485":35187,"63486":35326,"63552":35724,"63553":35726,"63554":35723,"63555":35720,"63556":35909,"63557":36121,"63558":36504,"63559":36708,"63560":36707,"63561":37308,"63562":37986,"63563":37973,"63564":37981,"63565":37975,"63566":37982,"63567":38852,"63568":38853,"63569":38912,"63570":39510,"63571":39513,"63572":39710,"63573":39711,"63574":39712,"63575":40018,"63576":40024,"63577":40016,"63578":40010,"63579":40013,"63580":40011,"63581":40021,"63582":40025,"63583":40012,"63584":40014,"63585":40443,"63586":40439,"63587":40431,"63588":40419,"63589":40427,"63590":40440,"63591":40420,"63592":40438,"63593":40417,"63594":40430,"63595":40422,"63596":40434,"63597":40432,"63598":40418,"63599":40428,"63600":40436,"63601":40435,"63602":40424,"63603":40429,"63604":40642,"63605":40656,"63606":40690,"63607":40691,"63608":40710,"63609":40732,"63610":40760,"63611":40759,"63612":40758,"63613":40771,"63614":40783,"63649":40817,"63650":40816,"63651":40814,"63652":40815,"63653":22227,"63654":22221,"63655":23374,"63656":23661,"63657":25901,"63658":26349,"63659":26350,"63660":27411,"63661":28767,"63662":28769,"63663":28765,"63664":28768,"63665":29219,"63666":29915,"63667":29925,"63668":30677,"63669":31032,"63670":31159,"63671":31158,"63672":31850,"63673":32407,"63674":32649,"63675":33389,"63676":34371,"63677":34872,"63678":34871,"63679":34869,"63680":34891,"63681":35732,"63682":35733,"63683":36510,"63684":36511,"63685":36512,"63686":36509,"63687":37310,"63688":37309,"63689":37314,"63690":37995,"63691":37992,"63692":37993,"63693":38629,"63694":38726,"63695":38723,"63696":38727,"63697":38855,"63698":38885,"63699":39518,"63700":39637,"63701":39769,"63702":40035,"63703":40039,"63704":40038,"63705":40034,"63706":40030,"63707":40032,"63708":40450,"63709":40446,"63710":40455,"63711":40451,"63712":40454,"63713":40453,"63714":40448,"63715":40449,"63716":40457,"63717":40447,"63718":40445,"63719":40452,"63720":40608,"63721":40734,"63722":40774,"63723":40820,"63724":40821,"63725":40822,"63726":22228,"63727":25902,"63728":26040,"63729":27416,"63730":27417,"63731":27415,"63732":27418,"63733":28770,"63734":29222,"63735":29354,"63736":30680,"63737":30681,"63738":31033,"63739":31849,"63740":31851,"63741":31990,"63742":32410,"63808":32408,"63809":32411,"63810":32409,"63811":33248,"63812":33249,"63813":34374,"63814":34375,"63815":34376,"63816":35193,"63817":35194,"63818":35196,"63819":35195,"63820":35327,"63821":35736,"63822":35737,"63823":36517,"63824":36516,"63825":36515,"63826":37998,"63827":37997,"63828":37999,"63829":38001,"63830":38003,"63831":38729,"63832":39026,"63833":39263,"63834":40040,"63835":40046,"63836":40045,"63837":40459,"63838":40461,"63839":40464,"63840":40463,"63841":40466,"63842":40465,"63843":40609,"63844":40693,"63845":40713,"63846":40775,"63847":40824,"63848":40827,"63849":40826,"63850":40825,"63851":22302,"63852":28774,"63853":31855,"63854":34876,"63855":36274,"63856":36518,"63857":37315,"63858":38004,"63859":38008,"63860":38006,"63861":38005,"63862":39520,"63863":40052,"63864":40051,"63865":40049,"63866":40053,"63867":40468,"63868":40467,"63869":40694,"63870":40714,"63905":40868,"63906":28776,"63907":28773,"63908":31991,"63909":34410,"63910":34878,"63911":34877,"63912":34879,"63913":35742,"63914":35996,"63915":36521,"63916":36553,"63917":38731,"63918":39027,"63919":39028,"63920":39116,"63921":39265,"63922":39339,"63923":39524,"63924":39526,"63925":39527,"63926":39716,"63927":40469,"63928":40471,"63929":40776,"63930":25095,"63931":27422,"63932":29223,"63933":34380,"63934":36520,"63935":38018,"63936":38016,"63937":38017,"63938":39529,"63939":39528,"63940":39726,"63941":40473,"63942":29225,"63943":34379,"63944":35743,"63945":38019,"63946":40057,"63947":40631,"63948":30325,"63949":39531,"63950":40058,"63951":40477,"63952":28777,"63953":28778,"63954":40612,"63955":40830,"63956":40777,"63957":40856,"63958":30849,"63959":37561,"63960":35023,"63961":22715,"63962":24658,"63963":31911,"63964":23290,"63965":9556,"63966":9574,"63967":9559,"63968":9568,"63969":9580,"63970":9571,"63971":9562,"63972":9577,"63973":9565,"63974":9554,"63975":9572,"63976":9557,"63977":9566,"63978":9578,"63979":9569,"63980":9560,"63981":9575,"63982":9563,"63983":9555,"63984":9573,"63985":9558,"63986":9567,"63987":9579,"63988":9570,"63989":9561,"63990":9576,"63991":9564,"63992":9553,"63993":9552,"63994":9581,"63995":9582,"63996":9584,"63997":9583,"63998":9619,"64064":57344,"64065":57345,"64066":57346,"64067":57347,"64068":57348,"64069":57349,"64070":57350,"64071":57351,"64072":57352,"64073":57353,"64074":57354,"64075":57355,"64076":57356,"64077":57357,"64078":57358,"64079":57359,"64080":57360,"64081":57361,"64082":57362,"64083":57363,"64084":57364,"64085":57365,"64086":57366,"64087":57367,"64088":57368,"64089":57369,"64090":57370,"64091":57371,"64092":57372,"64093":57373,"64094":57374,"64095":57375,"64096":57376,"64097":57377,"64098":57378,"64099":57379,"64100":29234,"64101":29244,"64102":29286,"64103":29314,"64104":29327,"64105":29343,"64106":29357,"64107":29361,"64108":29368,"64109":29374,"64110":29389,"64111":29403,"64112":29476,"64113":29487,"64114":29496,"64115":29497,"64116":29629,"64117":29646,"64118":29681,"64119":29814,"64120":29858,"64121":29953,"64122":29977,"64123":29987,"64124":30012,"64125":30020,"64126":30025,"64161":30029,"64162":30061,"64163":30082,"64164":30083,"64165":30089,"64166":30124,"64167":30166,"64168":30185,"64169":30272,"64170":30285,"64171":30292,"64172":30312,"64173":30336,"64174":30339,"64175":30352,"64176":30391,"64177":30393,"64178":30477,"64179":30494,"64180":30531,"64181":30744,"64182":30748,"64183":30777,"64184":30780,"64185":30791,"64186":30806,"64187":30842,"64188":30901,"64189":30905,"64190":30918,"64191":30937,"64192":30983,"64193":31024,"64194":31028,"64195":31035,"64196":31104,"64197":31133,"64198":31171,"64199":31201,"64200":31238,"64201":31246,"64202":31299,"64203":31312,"64204":31427,"64205":31442,"64206":31458,"64207":31463,"64208":31480,"64209":31542,"64210":31586,"64211":31596,"64212":31610,"64213":31611,"64214":31642,"64215":31646,"64216":31647,"64217":31650,"64218":31655,"64219":31734,"64220":31762,"64221":31764,"64222":31823,"64223":31830,"64224":31832,"64225":31915,"64226":31994,"64227":32072,"64228":32075,"64229":32119,"64230":32212,"64231":32213,"64232":32214,"64233":32228,"64234":32333,"64235":32349,"64236":32383,"64237":32393,"64238":32398,"64239":32402,"64240":32468,"64241":32497,"64242":32530,"64243":32560,"64244":32625,"64245":32642,"64246":32686,"64247":32710,"64248":32800,"64249":32802,"64250":32805,"64251":32817,"64252":32863,"64253":32872,"64254":32940,"64320":32951,"64321":20890,"64322":21526,"64323":21524,"64324":13535,"64325":19581,"64326":25283,"64327":57508,"64328":57509,"64329":57510,"64330":21707,"64331":57512,"64332":21948,"64333":32950,"64334":20903,"64335":57516,"64336":57517,"64337":57518,"64338":21779,"64339":33318,"64340":57521,"64341":21790,"64342":21982,"64343":25529,"64344":26776,"64345":57526,"64346":21762,"64347":21865,"64348":30132,"64349":25596,"64350":40580,"64351":37418,"64352":57533,"64353":57534,"64354":57535,"64355":35015,"64356":24734,"64357":22053,"64358":28997,"64359":23282,"64360":57541,"64361":21135,"64362":22095,"64363":30611,"64364":34694,"64365":36397,"64366":33206,"64367":13822,"64368":29174,"64369":57550,"64370":34820,"64371":37765,"64372":57553,"64373":57554,"64374":30310,"64375":57556,"64376":40050,"64377":57558,"64378":25294,"64379":57560,"64380":40598,"64381":18825,"64382":31955,"64417":36570,"64418":40619,"64419":25831,"64420":57567,"64421":33450,"64422":26471,"64423":28018,"64424":30982,"64425":31172,"64426":32590,"64427":34798,"64428":57575,"64429":33726,"64430":34351,"64431":35237,"64432":17935,"64433":57580,"64434":39112,"64435":39232,"64436":39245,"64437":39436,"64438":39639,"64439":40600,"64440":40742,"64441":57588,"64442":20227,"64443":57590,"64444":20281,"64445":20274,"64446":20395,"64447":20566,"64448":57595,"64449":20526,"64450":20646,"64451":20697,"64452":20750,"64453":20717,"64454":20737,"64455":20980,"64456":21023,"64457":21088,"64458":21079,"64459":21146,"64460":21201,"64461":21216,"64462":21217,"64463":20947,"64464":20959,"64465":30022,"64466":20990,"64467":21298,"64468":21292,"64469":21299,"64470":21419,"64471":21418,"64472":40846,"64473":21609,"64474":21660,"64475":21466,"64476":27338,"64477":21875,"64478":57625,"64479":13782,"64480":57627,"64481":22033,"64482":22093,"64483":57630,"64484":22100,"64485":13811,"64486":57633,"64487":22342,"64488":22394,"64489":22375,"64490":22586,"64491":22502,"64492":22493,"64493":22592,"64494":57641,"64495":22566,"64496":22748,"64497":22967,"64498":23001,"64499":23584,"64500":57647,"64501":23761,"64502":23785,"64503":23878,"64504":23950,"64505":57652,"64506":24053,"64507":24075,"64508":24082,"64509":24110,"64510":24158,"64576":57658,"64577":24397,"64578":31357,"64579":23491,"64580":31419,"64581":57663,"64582":57664,"64583":24484,"64584":24506,"64585":24508,"64586":57668,"64587":24695,"64588":24740,"64589":24755,"64590":24829,"64591":24880,"64592":57674,"64593":24988,"64594":24921,"64595":24957,"64596":24924,"64597":25471,"64598":25058,"64599":28885,"64600":25145,"64601":25192,"64602":25221,"64603":25218,"64604":25254,"64605":25301,"64606":25444,"64607":25397,"64608":25744,"64609":14940,"64610":26184,"64611":26215,"64612":26398,"64613":26627,"64614":26540,"64615":26617,"64616":26806,"64617":26924,"64618":26881,"64619":26880,"64620":26826,"64621":26995,"64622":27008,"64623":26942,"64624":57706,"64625":27058,"64626":27072,"64627":27018,"64628":27130,"64629":27113,"64630":27314,"64631":27218,"64632":27293,"64633":27421,"64634":27474,"64635":27642,"64636":15569,"64637":27854,"64638":28239,"64673":28089,"64674":28484,"64675":57723,"64676":28634,"64677":28801,"64678":31180,"64679":28980,"64680":15820,"64681":29046,"64682":57730,"64683":57731,"64684":29205,"64685":29264,"64686":29319,"64687":29484,"64688":29362,"64689":29410,"64690":29442,"64691":29512,"64692":29480,"64693":29519,"64694":29553,"64695":25989,"64696":57744,"64697":29789,"64698":29800,"64699":29982,"64700":30035,"64701":30074,"64702":30369,"64703":30412,"64704":30500,"64705":30507,"64706":16485,"64707":30803,"64708":30931,"64709":30936,"64710":40318,"64711":30895,"64712":57760,"64713":24898,"64714":31145,"64715":39994,"64716":31188,"64717":57765,"64718":31277,"64719":31294,"64720":31305,"64721":31453,"64722":31450,"64723":30147,"64724":30215,"64725":30210,"64726":57774,"64727":30311,"64728":30319,"64729":22048,"64730":35431,"64731":40727,"64732":31519,"64733":31634,"64734":31651,"64735":31695,"64736":57784,"64737":31740,"64738":31810,"64739":31825,"64740":31837,"64741":31856,"64742":31870,"64743":31878,"64744":31875,"64745":31916,"64746":31943,"64747":31938,"64748":57796,"64749":31962,"64750":57798,"64751":32077,"64752":32090,"64753":32245,"64754":32295,"64755":32366,"64756":40597,"64757":21107,"64758":32797,"64759":32866,"64760":32867,"64761":32870,"64762":32859,"64763":32934,"64764":33027,"64765":40577,"64766":33224,"64832":57815,"64833":36768,"64834":33270,"64835":33306,"64836":57819,"64837":34673,"64838":34729,"64839":34700,"64840":40606,"64841":34753,"64842":40476,"64843":57826,"64844":34774,"64845":34805,"64846":34831,"64847":34840,"64848":34861,"64849":34882,"64850":34885,"64851":39989,"64852":34926,"64853":34986,"64854":34976,"64855":25245,"64856":35139,"64857":35149,"64858":29042,"64859":34910,"64860":57843,"64861":33533,"64862":17591,"64863":33488,"64864":33669,"64865":40194,"64866":40809,"64867":33824,"64868":57851,"64869":34010,"64870":33965,"64871":17659,"64872":34123,"64873":57856,"64874":34306,"64875":34320,"64876":25553,"64877":35209,"64878":35210,"64879":35220,"64880":40005,"64881":35260,"64882":35454,"64883":35401,"64884":35596,"64885":35651,"64886":35713,"64887":35660,"64888":57871,"64889":36013,"64890":36075,"64891":36087,"64892":36108,"64893":36226,"64894":36262,"64929":36308,"64930":36392,"64931":36431,"64932":36471,"64933":36469,"64934":36519,"64935":36633,"64936":57885,"64937":36700,"64938":40260,"64939":37060,"64940":37201,"64941":57890,"64942":37212,"64943":37209,"64944":37223,"64945":37244,"64946":37262,"64947":37307,"64948":40616,"64949":36950,"64950":36940,"64951":37374,"64952":37474,"64953":37566,"64954":37739,"64955":37742,"64956":37818,"64957":37927,"64958":38295,"64959":38311,"64960":57909,"64961":38456,"64962":57911,"64963":38531,"64964":38550,"64965":38529,"64966":38589,"64967":38659,"64968":38689,"64969":38705,"64970":38751,"64971":38815,"64972":38836,"64973":38840,"64974":38842,"64975":38846,"64976":38856,"64977":40639,"64978":38943,"64979":38958,"64980":40869,"64981":38983,"64982":38987,"64983":39014,"64984":39020,"64985":39092,"64986":40794,"64987":39132,"64988":39142,"64989":39234,"64990":39225,"64991":39227,"64992":40787,"64993":39242,"64994":40773,"64995":19326,"64996":39386,"64997":31432,"64998":39610,"64999":39613,"65000":40706,"65001":39722,"65002":57951,"65003":39725,"65004":39650,"65005":39682,"65006":39679,"65007":19463,"65008":39689,"65009":19460,"65010":19515,"65011":39823,"65012":39837,"65013":39856,"65014":39948,"65015":39957,"65016":39946,"65017":39935,"65018":39982,"65019":33000,"65020":33001,"65021":33004,"65022":33038,"65088":27705,"65089":20074,"65090":38465,"65091":22770,"65092":31074,"65093":26658,"65094":57978,"65095":57979,"65096":33031,"65097":22487,"65098":17642,"65099":25653,"65100":34100,"65101":16607,"65102":57986,"65103":26906,"65104":39938,"65105":30129,"65106":33747,"65107":29041,"65108":27147,"65109":57993,"65110":27258,"65111":39668,"65112":57996,"65113":57997,"65114":30649,"65115":25904,"65116":28054,"65117":22071,"65118":26405,"65119":27179,"65120":32093,"65121":36961,"65122":20120,"65123":31910,"65124":31545,"65125":58009,"65126":22901,"65127":14023,"65128":28799,"65129":58013,"65130":28299,"65131":58015,"65132":58016,"65133":38749,"65134":37584,"65135":22356,"65136":58020,"65137":16089,"65138":58022,"65139":58023,"65140":24985,"65141":29792,"65142":28991,"65143":31022,"65144":23190,"65145":37704,"65146":26254,"65147":20477,"65148":37697,"65149":13908,"65150":23925,"65185":28702,"65186":25979,"65187":28813,"65188":24269,"65189":58039,"65190":24743,"65191":31408,"65192":24419,"65193":58043,"65194":29687,"65195":58045,"65196":29800,"65197":30132,"65198":58048,"65199":39785,"65200":189,"65201":8531,"65202":8532,"65203":188,"65204":190,"65205":8533,"65206":8534,"65207":8535,"65208":8536,"65209":8537,"65210":8538,"65211":34450,"65212":34464,"65213":34477,"65214":34482,"65215":34725,"65216":34737,"65217":8539,"65218":8540,"65219":8541,"65220":8542,"65221":34778,"65222":34895,"65223":34912,"65224":34951,"65225":34959,"65226":34960,"65227":35046,"65228":35071,"65229":35072,"65230":35108,"65231":35143,"65232":35156,"65233":35173,"65234":35200,"65235":35217,"65236":35356,"65237":35369,"65238":35371,"65239":35384,"65240":35389,"65241":8978,"65242":35472,"65243":35476,"65244":35484,"65245":35497,"65246":35503,"65247":35508,"65248":35562,"65249":35615,"65250":8240,"65251":35647,"65252":35661,"65253":35678,"65254":35682,"65255":35689,"65256":35739,"65257":35921,"65258":35995,"65259":35999,"65260":36052,"65261":36054,"65262":33042,"65263":33073,"65264":33078,"65265":33119,"65266":33133,"65267":33149,"65268":33171,"65269":33194,"65270":33208,"65271":33217,"65272":33321,"65273":33325,"65274":33326,"65275":33342,"65276":33378,"65277":33386,"65278":33416,"NaN":null} \ No newline at end of file diff --git a/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/file-utils/node_modules/iconv-lite/encodings/table/gbk.js b/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/file-utils/node_modules/iconv-lite/encodings/table/gbk.js new file mode 100644 index 0000000..c464623 --- /dev/null +++ b/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/file-utils/node_modules/iconv-lite/encodings/table/gbk.js @@ -0,0 +1 @@ +module.exports={33088:19970,33089:19972,33090:19973,33091:19974,33092:19983,33093:19986,33094:19991,33095:19999,33096:20000,33097:20001,33098:20003,33099:20006,33100:20009,33101:20014,33102:20015,33103:20017,33104:20019,33105:20021,33106:20023,33107:20028,33108:20032,33109:20033,33110:20034,33111:20036,33112:20038,33113:20042,33114:20049,33115:20053,33116:20055,33117:20058,33118:20059,33119:20066,33120:20067,33121:20068,33122:20069,33123:20071,33124:20072,33125:20074,33126:20075,33127:20076,33128:20077,33129:20078,33130:20079,33131:20082,33132:20084,33133:20085,33134:20086,33135:20087,33136:20088,33137:20089,33138:20090,33139:20091,33140:20092,33141:20093,33142:20095,33143:20096,33144:20097,33145:20098,33146:20099,33147:20100,33148:20101,33149:20103,33150:20106,33152:20112,33153:20118,33154:20119,33155:20121,33156:20124,33157:20125,33158:20126,33159:20131,33160:20138,33161:20143,33162:20144,33163:20145,33164:20148,33165:20150,33166:20151,33167:20152,33168:20153,33169:20156,33170:20157,33171:20158,33172:20168,33173:20172,33174:20175,33175:20176,33176:20178,33177:20186,33178:20187,33179:20188,33180:20192,33181:20194,33182:20198,33183:20199,33184:20201,33185:20205,33186:20206,33187:20207,33188:20209,33189:20212,33190:20216,33191:20217,33192:20218,33193:20220,33194:20222,33195:20224,33196:20226,33197:20227,33198:20228,33199:20229,33200:20230,33201:20231,33202:20232,33203:20235,33204:20236,33205:20242,33206:20243,33207:20244,33208:20245,33209:20246,33210:20252,33211:20253,33212:20257,33213:20259,33214:20264,33215:20265,33216:20268,33217:20269,33218:20270,33219:20273,33220:20275,33221:20277,33222:20279,33223:20281,33224:20283,33225:20286,33226:20287,33227:20288,33228:20289,33229:20290,33230:20292,33231:20293,33232:20295,33233:20296,33234:20297,33235:20298,33236:20299,33237:20300,33238:20306,33239:20308,33240:20310,33241:20321,33242:20322,33243:20326,33244:20328,33245:20330,33246:20331,33247:20333,33248:20334,33249:20337,33250:20338,33251:20341,33252:20343,33253:20344,33254:20345,33255:20346,33256:20349,33257:20352,33258:20353,33259:20354,33260:20357,33261:20358,33262:20359,33263:20362,33264:20364,33265:20366,33266:20368,33267:20370,33268:20371,33269:20373,33270:20374,33271:20376,33272:20377,33273:20378,33274:20380,33275:20382,33276:20383,33277:20385,33278:20386,33344:20388,33345:20395,33346:20397,33347:20400,33348:20401,33349:20402,33350:20403,33351:20404,33352:20406,33353:20407,33354:20408,33355:20409,33356:20410,33357:20411,33358:20412,33359:20413,33360:20414,33361:20416,33362:20417,33363:20418,33364:20422,33365:20423,33366:20424,33367:20425,33368:20427,33369:20428,33370:20429,33371:20434,33372:20435,33373:20436,33374:20437,33375:20438,33376:20441,33377:20443,33378:20448,33379:20450,33380:20452,33381:20453,33382:20455,33383:20459,33384:20460,33385:20464,33386:20466,33387:20468,33388:20469,33389:20470,33390:20471,33391:20473,33392:20475,33393:20476,33394:20477,33395:20479,33396:20480,33397:20481,33398:20482,33399:20483,33400:20484,33401:20485,33402:20486,33403:20487,33404:20488,33405:20489,33406:20490,33408:20491,33409:20494,33410:20496,33411:20497,33412:20499,33413:20501,33414:20502,33415:20503,33416:20507,33417:20509,33418:20510,33419:20512,33420:20514,33421:20515,33422:20516,33423:20519,33424:20523,33425:20527,33426:20528,33427:20529,33428:20530,33429:20531,33430:20532,33431:20533,33432:20534,33433:20535,33434:20536,33435:20537,33436:20539,33437:20541,33438:20543,33439:20544,33440:20545,33441:20546,33442:20548,33443:20549,33444:20550,33445:20553,33446:20554,33447:20555,33448:20557,33449:20560,33450:20561,33451:20562,33452:20563,33453:20564,33454:20566,33455:20567,33456:20568,33457:20569,33458:20571,33459:20573,33460:20574,33461:20575,33462:20576,33463:20577,33464:20578,33465:20579,33466:20580,33467:20582,33468:20583,33469:20584,33470:20585,33471:20586,33472:20587,33473:20589,33474:20590,33475:20591,33476:20592,33477:20593,33478:20594,33479:20595,33480:20596,33481:20597,33482:20600,33483:20601,33484:20602,33485:20604,33486:20605,33487:20609,33488:20610,33489:20611,33490:20612,33491:20614,33492:20615,33493:20617,33494:20618,33495:20619,33496:20620,33497:20622,33498:20623,33499:20624,33500:20625,33501:20626,33502:20627,33503:20628,33504:20629,33505:20630,33506:20631,33507:20632,33508:20633,33509:20634,33510:20635,33511:20636,33512:20637,33513:20638,33514:20639,33515:20640,33516:20641,33517:20642,33518:20644,33519:20646,33520:20650,33521:20651,33522:20653,33523:20654,33524:20655,33525:20656,33526:20657,33527:20659,33528:20660,33529:20661,33530:20662,33531:20663,33532:20664,33533:20665,33534:20668,33600:20669,33601:20670,33602:20671,33603:20672,33604:20673,33605:20674,33606:20675,33607:20676,33608:20677,33609:20678,33610:20679,33611:20680,33612:20681,33613:20682,33614:20683,33615:20684,33616:20685,33617:20686,33618:20688,33619:20689,33620:20690,33621:20691,33622:20692,33623:20693,33624:20695,33625:20696,33626:20697,33627:20699,33628:20700,33629:20701,33630:20702,33631:20703,33632:20704,33633:20705,33634:20706,33635:20707,33636:20708,33637:20709,33638:20712,33639:20713,33640:20714,33641:20715,33642:20719,33643:20720,33644:20721,33645:20722,33646:20724,33647:20726,33648:20727,33649:20728,33650:20729,33651:20730,33652:20732,33653:20733,33654:20734,33655:20735,33656:20736,33657:20737,33658:20738,33659:20739,33660:20740,33661:20741,33662:20744,33664:20745,33665:20746,33666:20748,33667:20749,33668:20750,33669:20751,33670:20752,33671:20753,33672:20755,33673:20756,33674:20757,33675:20758,33676:20759,33677:20760,33678:20761,33679:20762,33680:20763,33681:20764,33682:20765,33683:20766,33684:20767,33685:20768,33686:20770,33687:20771,33688:20772,33689:20773,33690:20774,33691:20775,33692:20776,33693:20777,33694:20778,33695:20779,33696:20780,33697:20781,33698:20782,33699:20783,33700:20784,33701:20785,33702:20786,33703:20787,33704:20788,33705:20789,33706:20790,33707:20791,33708:20792,33709:20793,33710:20794,33711:20795,33712:20796,33713:20797,33714:20798,33715:20802,33716:20807,33717:20810,33718:20812,33719:20814,33720:20815,33721:20816,33722:20818,33723:20819,33724:20823,33725:20824,33726:20825,33727:20827,33728:20829,33729:20830,33730:20831,33731:20832,33732:20833,33733:20835,33734:20836,33735:20838,33736:20839,33737:20841,33738:20842,33739:20847,33740:20850,33741:20858,33742:20862,33743:20863,33744:20867,33745:20868,33746:20870,33747:20871,33748:20874,33749:20875,33750:20878,33751:20879,33752:20880,33753:20881,33754:20883,33755:20884,33756:20888,33757:20890,33758:20893,33759:20894,33760:20895,33761:20897,33762:20899,33763:20902,33764:20903,33765:20904,33766:20905,33767:20906,33768:20909,33769:20910,33770:20916,33771:20920,33772:20921,33773:20922,33774:20926,33775:20927,33776:20929,33777:20930,33778:20931,33779:20933,33780:20936,33781:20938,33782:20941,33783:20942,33784:20944,33785:20946,33786:20947,33787:20948,33788:20949,33789:20950,33790:20951,33856:20952,33857:20953,33858:20954,33859:20956,33860:20958,33861:20959,33862:20962,33863:20963,33864:20965,33865:20966,33866:20967,33867:20968,33868:20969,33869:20970,33870:20972,33871:20974,33872:20977,33873:20978,33874:20980,33875:20983,33876:20990,33877:20996,33878:20997,33879:21001,33880:21003,33881:21004,33882:21007,33883:21008,33884:21011,33885:21012,33886:21013,33887:21020,33888:21022,33889:21023,33890:21025,33891:21026,33892:21027,33893:21029,33894:21030,33895:21031,33896:21034,33897:21036,33898:21039,33899:21041,33900:21042,33901:21044,33902:21045,33903:21052,33904:21054,33905:21060,33906:21061,33907:21062,33908:21063,33909:21064,33910:21065,33911:21067,33912:21070,33913:21071,33914:21074,33915:21075,33916:21077,33917:21079,33918:21080,33920:21081,33921:21082,33922:21083,33923:21085,33924:21087,33925:21088,33926:21090,33927:21091,33928:21092,33929:21094,33930:21096,33931:21099,33932:21100,33933:21101,33934:21102,33935:21104,33936:21105,33937:21107,33938:21108,33939:21109,33940:21110,33941:21111,33942:21112,33943:21113,33944:21114,33945:21115,33946:21116,33947:21118,33948:21120,33949:21123,33950:21124,33951:21125,33952:21126,33953:21127,33954:21129,33955:21130,33956:21131,33957:21132,33958:21133,33959:21134,33960:21135,33961:21137,33962:21138,33963:21140,33964:21141,33965:21142,33966:21143,33967:21144,33968:21145,33969:21146,33970:21148,33971:21156,33972:21157,33973:21158,33974:21159,33975:21166,33976:21167,33977:21168,33978:21172,33979:21173,33980:21174,33981:21175,33982:21176,33983:21177,33984:21178,33985:21179,33986:21180,33987:21181,33988:21184,33989:21185,33990:21186,33991:21188,33992:21189,33993:21190,33994:21192,33995:21194,33996:21196,33997:21197,33998:21198,33999:21199,34000:21201,34001:21203,34002:21204,34003:21205,34004:21207,34005:21209,34006:21210,34007:21211,34008:21212,34009:21213,34010:21214,34011:21216,34012:21217,34013:21218,34014:21219,34015:21221,34016:21222,34017:21223,34018:21224,34019:21225,34020:21226,34021:21227,34022:21228,34023:21229,34024:21230,34025:21231,34026:21233,34027:21234,34028:21235,34029:21236,34030:21237,34031:21238,34032:21239,34033:21240,34034:21243,34035:21244,34036:21245,34037:21249,34038:21250,34039:21251,34040:21252,34041:21255,34042:21257,34043:21258,34044:21259,34045:21260,34046:21262,34112:21265,34113:21266,34114:21267,34115:21268,34116:21272,34117:21275,34118:21276,34119:21278,34120:21279,34121:21282,34122:21284,34123:21285,34124:21287,34125:21288,34126:21289,34127:21291,34128:21292,34129:21293,34130:21295,34131:21296,34132:21297,34133:21298,34134:21299,34135:21300,34136:21301,34137:21302,34138:21303,34139:21304,34140:21308,34141:21309,34142:21312,34143:21314,34144:21316,34145:21318,34146:21323,34147:21324,34148:21325,34149:21328,34150:21332,34151:21336,34152:21337,34153:21339,34154:21341,34155:21349,34156:21352,34157:21354,34158:21356,34159:21357,34160:21362,34161:21366,34162:21369,34163:21371,34164:21372,34165:21373,34166:21374,34167:21376,34168:21377,34169:21379,34170:21383,34171:21384,34172:21386,34173:21390,34174:21391,34176:21392,34177:21393,34178:21394,34179:21395,34180:21396,34181:21398,34182:21399,34183:21401,34184:21403,34185:21404,34186:21406,34187:21408,34188:21409,34189:21412,34190:21415,34191:21418,34192:21419,34193:21420,34194:21421,34195:21423,34196:21424,34197:21425,34198:21426,34199:21427,34200:21428,34201:21429,34202:21431,34203:21432,34204:21433,34205:21434,34206:21436,34207:21437,34208:21438,34209:21440,34210:21443,34211:21444,34212:21445,34213:21446,34214:21447,34215:21454,34216:21455,34217:21456,34218:21458,34219:21459,34220:21461,34221:21466,34222:21468,34223:21469,34224:21470,34225:21473,34226:21474,34227:21479,34228:21492,34229:21498,34230:21502,34231:21503,34232:21504,34233:21506,34234:21509,34235:21511,34236:21515,34237:21524,34238:21528,34239:21529,34240:21530,34241:21532,34242:21538,34243:21540,34244:21541,34245:21546,34246:21552,34247:21555,34248:21558,34249:21559,34250:21562,34251:21565,34252:21567,34253:21569,34254:21570,34255:21572,34256:21573,34257:21575,34258:21577,34259:21580,34260:21581,34261:21582,34262:21583,34263:21585,34264:21594,34265:21597,34266:21598,34267:21599,34268:21600,34269:21601,34270:21603,34271:21605,34272:21607,34273:21609,34274:21610,34275:21611,34276:21612,34277:21613,34278:21614,34279:21615,34280:21616,34281:21620,34282:21625,34283:21626,34284:21630,34285:21631,34286:21633,34287:21635,34288:21637,34289:21639,34290:21640,34291:21641,34292:21642,34293:21645,34294:21649,34295:21651,34296:21655,34297:21656,34298:21660,34299:21662,34300:21663,34301:21664,34302:21665,34368:21666,34369:21669,34370:21678,34371:21680,34372:21682,34373:21685,34374:21686,34375:21687,34376:21689,34377:21690,34378:21692,34379:21694,34380:21699,34381:21701,34382:21706,34383:21707,34384:21718,34385:21720,34386:21723,34387:21728,34388:21729,34389:21730,34390:21731,34391:21732,34392:21739,34393:21740,34394:21743,34395:21744,34396:21745,34397:21748,34398:21749,34399:21750,34400:21751,34401:21752,34402:21753,34403:21755,34404:21758,34405:21760,34406:21762,34407:21763,34408:21764,34409:21765,34410:21768,34411:21770,34412:21771,34413:21772,34414:21773,34415:21774,34416:21778,34417:21779,34418:21781,34419:21782,34420:21783,34421:21784,34422:21785,34423:21786,34424:21788,34425:21789,34426:21790,34427:21791,34428:21793,34429:21797,34430:21798,34432:21800,34433:21801,34434:21803,34435:21805,34436:21810,34437:21812,34438:21813,34439:21814,34440:21816,34441:21817,34442:21818,34443:21819,34444:21821,34445:21824,34446:21826,34447:21829,34448:21831,34449:21832,34450:21835,34451:21836,34452:21837,34453:21838,34454:21839,34455:21841,34456:21842,34457:21843,34458:21844,34459:21847,34460:21848,34461:21849,34462:21850,34463:21851,34464:21853,34465:21854,34466:21855,34467:21856,34468:21858,34469:21859,34470:21864,34471:21865,34472:21867,34473:21871,34474:21872,34475:21873,34476:21874,34477:21875,34478:21876,34479:21881,34480:21882,34481:21885,34482:21887,34483:21893,34484:21894,34485:21900,34486:21901,34487:21902,34488:21904,34489:21906,34490:21907,34491:21909,34492:21910,34493:21911,34494:21914,34495:21915,34496:21918,34497:21920,34498:21921,34499:21922,34500:21923,34501:21924,34502:21925,34503:21926,34504:21928,34505:21929,34506:21930,34507:21931,34508:21932,34509:21933,34510:21934,34511:21935,34512:21936,34513:21938,34514:21940,34515:21942,34516:21944,34517:21946,34518:21948,34519:21951,34520:21952,34521:21953,34522:21954,34523:21955,34524:21958,34525:21959,34526:21960,34527:21962,34528:21963,34529:21966,34530:21967,34531:21968,34532:21973,34533:21975,34534:21976,34535:21977,34536:21978,34537:21979,34538:21982,34539:21984,34540:21986,34541:21991,34542:21993,34543:21997,34544:21998,34545:22000,34546:22001,34547:22004,34548:22006,34549:22008,34550:22009,34551:22010,34552:22011,34553:22012,34554:22015,34555:22018,34556:22019,34557:22020,34558:22021,34624:22022,34625:22023,34626:22026,34627:22027,34628:22029,34629:22032,34630:22033,34631:22034,34632:22035,34633:22036,34634:22037,34635:22038,34636:22039,34637:22041,34638:22042,34639:22044,34640:22045,34641:22048,34642:22049,34643:22050,34644:22053,34645:22054,34646:22056,34647:22057,34648:22058,34649:22059,34650:22062,34651:22063,34652:22064,34653:22067,34654:22069,34655:22071,34656:22072,34657:22074,34658:22076,34659:22077,34660:22078,34661:22080,34662:22081,34663:22082,34664:22083,34665:22084,34666:22085,34667:22086,34668:22087,34669:22088,34670:22089,34671:22090,34672:22091,34673:22095,34674:22096,34675:22097,34676:22098,34677:22099,34678:22101,34679:22102,34680:22106,34681:22107,34682:22109,34683:22110,34684:22111,34685:22112,34686:22113,34688:22115,34689:22117,34690:22118,34691:22119,34692:22125,34693:22126,34694:22127,34695:22128,34696:22130,34697:22131,34698:22132,34699:22133,34700:22135,34701:22136,34702:22137,34703:22138,34704:22141,34705:22142,34706:22143,34707:22144,34708:22145,34709:22146,34710:22147,34711:22148,34712:22151,34713:22152,34714:22153,34715:22154,34716:22155,34717:22156,34718:22157,34719:22160,34720:22161,34721:22162,34722:22164,34723:22165,34724:22166,34725:22167,34726:22168,34727:22169,34728:22170,34729:22171,34730:22172,34731:22173,34732:22174,34733:22175,34734:22176,34735:22177,34736:22178,34737:22180,34738:22181,34739:22182,34740:22183,34741:22184,34742:22185,34743:22186,34744:22187,34745:22188,34746:22189,34747:22190,34748:22192,34749:22193,34750:22194,34751:22195,34752:22196,34753:22197,34754:22198,34755:22200,34756:22201,34757:22202,34758:22203,34759:22205,34760:22206,34761:22207,34762:22208,34763:22209,34764:22210,34765:22211,34766:22212,34767:22213,34768:22214,34769:22215,34770:22216,34771:22217,34772:22219,34773:22220,34774:22221,34775:22222,34776:22223,34777:22224,34778:22225,34779:22226,34780:22227,34781:22229,34782:22230,34783:22232,34784:22233,34785:22236,34786:22243,34787:22245,34788:22246,34789:22247,34790:22248,34791:22249,34792:22250,34793:22252,34794:22254,34795:22255,34796:22258,34797:22259,34798:22262,34799:22263,34800:22264,34801:22267,34802:22268,34803:22272,34804:22273,34805:22274,34806:22277,34807:22279,34808:22283,34809:22284,34810:22285,34811:22286,34812:22287,34813:22288,34814:22289,34880:22290,34881:22291,34882:22292,34883:22293,34884:22294,34885:22295,34886:22296,34887:22297,34888:22298,34889:22299,34890:22301,34891:22302,34892:22304,34893:22305,34894:22306,34895:22308,34896:22309,34897:22310,34898:22311,34899:22315,34900:22321,34901:22322,34902:22324,34903:22325,34904:22326,34905:22327,34906:22328,34907:22332,34908:22333,34909:22335,34910:22337,34911:22339,34912:22340,34913:22341,34914:22342,34915:22344,34916:22345,34917:22347,34918:22354,34919:22355,34920:22356,34921:22357,34922:22358,34923:22360,34924:22361,34925:22370,34926:22371,34927:22373,34928:22375,34929:22380,34930:22382,34931:22384,34932:22385,34933:22386,34934:22388,34935:22389,34936:22392,34937:22393,34938:22394,34939:22397,34940:22398,34941:22399,34942:22400,34944:22401,34945:22407,34946:22408,34947:22409,34948:22410,34949:22413,34950:22414,34951:22415,34952:22416,34953:22417,34954:22420,34955:22421,34956:22422,34957:22423,34958:22424,34959:22425,34960:22426,34961:22428,34962:22429,34963:22430,34964:22431,34965:22437,34966:22440,34967:22442,34968:22444,34969:22447,34970:22448,34971:22449,34972:22451,34973:22453,34974:22454,34975:22455,34976:22457,34977:22458,34978:22459,34979:22460,34980:22461,34981:22462,34982:22463,34983:22464,34984:22465,34985:22468,34986:22469,34987:22470,34988:22471,34989:22472,34990:22473,34991:22474,34992:22476,34993:22477,34994:22480,34995:22481,34996:22483,34997:22486,34998:22487,34999:22491,35000:22492,35001:22494,35002:22497,35003:22498,35004:22499,35005:22501,35006:22502,35007:22503,35008:22504,35009:22505,35010:22506,35011:22507,35012:22508,35013:22510,35014:22512,35015:22513,35016:22514,35017:22515,35018:22517,35019:22518,35020:22519,35021:22523,35022:22524,35023:22526,35024:22527,35025:22529,35026:22531,35027:22532,35028:22533,35029:22536,35030:22537,35031:22538,35032:22540,35033:22542,35034:22543,35035:22544,35036:22546,35037:22547,35038:22548,35039:22550,35040:22551,35041:22552,35042:22554,35043:22555,35044:22556,35045:22557,35046:22559,35047:22562,35048:22563,35049:22565,35050:22566,35051:22567,35052:22568,35053:22569,35054:22571,35055:22572,35056:22573,35057:22574,35058:22575,35059:22577,35060:22578,35061:22579,35062:22580,35063:22582,35064:22583,35065:22584,35066:22585,35067:22586,35068:22587,35069:22588,35070:22589,35136:22590,35137:22591,35138:22592,35139:22593,35140:22594,35141:22595,35142:22597,35143:22598,35144:22599,35145:22600,35146:22601,35147:22602,35148:22603,35149:22606,35150:22607,35151:22608,35152:22610,35153:22611,35154:22613,35155:22614,35156:22615,35157:22617,35158:22618,35159:22619,35160:22620,35161:22621,35162:22623,35163:22624,35164:22625,35165:22626,35166:22627,35167:22628,35168:22630,35169:22631,35170:22632,35171:22633,35172:22634,35173:22637,35174:22638,35175:22639,35176:22640,35177:22641,35178:22642,35179:22643,35180:22644,35181:22645,35182:22646,35183:22647,35184:22648,35185:22649,35186:22650,35187:22651,35188:22652,35189:22653,35190:22655,35191:22658,35192:22660,35193:22662,35194:22663,35195:22664,35196:22666,35197:22667,35198:22668,35200:22669,35201:22670,35202:22671,35203:22672,35204:22673,35205:22676,35206:22677,35207:22678,35208:22679,35209:22680,35210:22683,35211:22684,35212:22685,35213:22688,35214:22689,35215:22690,35216:22691,35217:22692,35218:22693,35219:22694,35220:22695,35221:22698,35222:22699,35223:22700,35224:22701,35225:22702,35226:22703,35227:22704,35228:22705,35229:22706,35230:22707,35231:22708,35232:22709,35233:22710,35234:22711,35235:22712,35236:22713,35237:22714,35238:22715,35239:22717,35240:22718,35241:22719,35242:22720,35243:22722,35244:22723,35245:22724,35246:22726,35247:22727,35248:22728,35249:22729,35250:22730,35251:22731,35252:22732,35253:22733,35254:22734,35255:22735,35256:22736,35257:22738,35258:22739,35259:22740,35260:22742,35261:22743,35262:22744,35263:22745,35264:22746,35265:22747,35266:22748,35267:22749,35268:22750,35269:22751,35270:22752,35271:22753,35272:22754,35273:22755,35274:22757,35275:22758,35276:22759,35277:22760,35278:22761,35279:22762,35280:22765,35281:22767,35282:22769,35283:22770,35284:22772,35285:22773,35286:22775,35287:22776,35288:22778,35289:22779,35290:22780,35291:22781,35292:22782,35293:22783,35294:22784,35295:22785,35296:22787,35297:22789,35298:22790,35299:22792,35300:22793,35301:22794,35302:22795,35303:22796,35304:22798,35305:22800,35306:22801,35307:22802,35308:22803,35309:22807,35310:22808,35311:22811,35312:22813,35313:22814,35314:22816,35315:22817,35316:22818,35317:22819,35318:22822,35319:22824,35320:22828,35321:22832,35322:22834,35323:22835,35324:22837,35325:22838,35326:22843,35392:22845,35393:22846,35394:22847,35395:22848,35396:22851,35397:22853,35398:22854,35399:22858,35400:22860,35401:22861,35402:22864,35403:22866,35404:22867,35405:22873,35406:22875,35407:22876,35408:22877,35409:22878,35410:22879,35411:22881,35412:22883,35413:22884,35414:22886,35415:22887,35416:22888,35417:22889,35418:22890,35419:22891,35420:22892,35421:22893,35422:22894,35423:22895,35424:22896,35425:22897,35426:22898,35427:22901,35428:22903,35429:22906,35430:22907,35431:22908,35432:22910,35433:22911,35434:22912,35435:22917,35436:22921,35437:22923,35438:22924,35439:22926,35440:22927,35441:22928,35442:22929,35443:22932,35444:22933,35445:22936,35446:22938,35447:22939,35448:22940,35449:22941,35450:22943,35451:22944,35452:22945,35453:22946,35454:22950,35456:22951,35457:22956,35458:22957,35459:22960,35460:22961,35461:22963,35462:22964,35463:22965,35464:22966,35465:22967,35466:22968,35467:22970,35468:22972,35469:22973,35470:22975,35471:22976,35472:22977,35473:22978,35474:22979,35475:22980,35476:22981,35477:22983,35478:22984,35479:22985,35480:22988,35481:22989,35482:22990,35483:22991,35484:22997,35485:22998,35486:23001,35487:23003,35488:23006,35489:23007,35490:23008,35491:23009,35492:23010,35493:23012,35494:23014,35495:23015,35496:23017,35497:23018,35498:23019,35499:23021,35500:23022,35501:23023,35502:23024,35503:23025,35504:23026,35505:23027,35506:23028,35507:23029,35508:23030,35509:23031,35510:23032,35511:23034,35512:23036,35513:23037,35514:23038,35515:23040,35516:23042,35517:23050,35518:23051,35519:23053,35520:23054,35521:23055,35522:23056,35523:23058,35524:23060,35525:23061,35526:23062,35527:23063,35528:23065,35529:23066,35530:23067,35531:23069,35532:23070,35533:23073,35534:23074,35535:23076,35536:23078,35537:23079,35538:23080,35539:23082,35540:23083,35541:23084,35542:23085,35543:23086,35544:23087,35545:23088,35546:23091,35547:23093,35548:23095,35549:23096,35550:23097,35551:23098,35552:23099,35553:23101,35554:23102,35555:23103,35556:23105,35557:23106,35558:23107,35559:23108,35560:23109,35561:23111,35562:23112,35563:23115,35564:23116,35565:23117,35566:23118,35567:23119,35568:23120,35569:23121,35570:23122,35571:23123,35572:23124,35573:23126,35574:23127,35575:23128,35576:23129,35577:23131,35578:23132,35579:23133,35580:23134,35581:23135,35582:23136,35648:23137,35649:23139,35650:23140,35651:23141,35652:23142,35653:23144,35654:23145,35655:23147,35656:23148,35657:23149,35658:23150,35659:23151,35660:23152,35661:23153,35662:23154,35663:23155,35664:23160,35665:23161,35666:23163,35667:23164,35668:23165,35669:23166,35670:23168,35671:23169,35672:23170,35673:23171,35674:23172,35675:23173,35676:23174,35677:23175,35678:23176,35679:23177,35680:23178,35681:23179,35682:23180,35683:23181,35684:23182,35685:23183,35686:23184,35687:23185,35688:23187,35689:23188,35690:23189,35691:23190,35692:23191,35693:23192,35694:23193,35695:23196,35696:23197,35697:23198,35698:23199,35699:23200,35700:23201,35701:23202,35702:23203,35703:23204,35704:23205,35705:23206,35706:23207,35707:23208,35708:23209,35709:23211,35710:23212,35712:23213,35713:23214,35714:23215,35715:23216,35716:23217,35717:23220,35718:23222,35719:23223,35720:23225,35721:23226,35722:23227,35723:23228,35724:23229,35725:23231,35726:23232,35727:23235,35728:23236,35729:23237,35730:23238,35731:23239,35732:23240,35733:23242,35734:23243,35735:23245,35736:23246,35737:23247,35738:23248,35739:23249,35740:23251,35741:23253,35742:23255,35743:23257,35744:23258,35745:23259,35746:23261,35747:23262,35748:23263,35749:23266,35750:23268,35751:23269,35752:23271,35753:23272,35754:23274,35755:23276,35756:23277,35757:23278,35758:23279,35759:23280,35760:23282,35761:23283,35762:23284,35763:23285,35764:23286,35765:23287,35766:23288,35767:23289,35768:23290,35769:23291,35770:23292,35771:23293,35772:23294,35773:23295,35774:23296,35775:23297,35776:23298,35777:23299,35778:23300,35779:23301,35780:23302,35781:23303,35782:23304,35783:23306,35784:23307,35785:23308,35786:23309,35787:23310,35788:23311,35789:23312,35790:23313,35791:23314,35792:23315,35793:23316,35794:23317,35795:23320,35796:23321,35797:23322,35798:23323,35799:23324,35800:23325,35801:23326,35802:23327,35803:23328,35804:23329,35805:23330,35806:23331,35807:23332,35808:23333,35809:23334,35810:23335,35811:23336,35812:23337,35813:23338,35814:23339,35815:23340,35816:23341,35817:23342,35818:23343,35819:23344,35820:23345,35821:23347,35822:23349,35823:23350,35824:23352,35825:23353,35826:23354,35827:23355,35828:23356,35829:23357,35830:23358,35831:23359,35832:23361,35833:23362,35834:23363,35835:23364,35836:23365,35837:23366,35838:23367,35904:23368,35905:23369,35906:23370,35907:23371,35908:23372,35909:23373,35910:23374,35911:23375,35912:23378,35913:23382,35914:23390,35915:23392,35916:23393,35917:23399,35918:23400,35919:23403,35920:23405,35921:23406,35922:23407,35923:23410,35924:23412,35925:23414,35926:23415,35927:23416,35928:23417,35929:23419,35930:23420,35931:23422,35932:23423,35933:23426,35934:23430,35935:23434,35936:23437,35937:23438,35938:23440,35939:23441,35940:23442,35941:23444,35942:23446,35943:23455,35944:23463,35945:23464,35946:23465,35947:23468,35948:23469,35949:23470,35950:23471,35951:23473,35952:23474,35953:23479,35954:23482,35955:23483,35956:23484,35957:23488,35958:23489,35959:23491,35960:23496,35961:23497,35962:23498,35963:23499,35964:23501,35965:23502,35966:23503,35968:23505,35969:23508,35970:23509,35971:23510,35972:23511,35973:23512,35974:23513,35975:23514,35976:23515,35977:23516,35978:23520,35979:23522,35980:23523,35981:23526,35982:23527,35983:23529,35984:23530,35985:23531,35986:23532,35987:23533,35988:23535,35989:23537,35990:23538,35991:23539,35992:23540,35993:23541,35994:23542,35995:23543,35996:23549,35997:23550,35998:23552,35999:23554,36000:23555,36001:23557,36002:23559,36003:23560,36004:23563,36005:23564,36006:23565,36007:23566,36008:23568,36009:23570,36010:23571,36011:23575,36012:23577,36013:23579,36014:23582,36015:23583,36016:23584,36017:23585,36018:23587,36019:23590,36020:23592,36021:23593,36022:23594,36023:23595,36024:23597,36025:23598,36026:23599,36027:23600,36028:23602,36029:23603,36030:23605,36031:23606,36032:23607,36033:23619,36034:23620,36035:23622,36036:23623,36037:23628,36038:23629,36039:23634,36040:23635,36041:23636,36042:23638,36043:23639,36044:23640,36045:23642,36046:23643,36047:23644,36048:23645,36049:23647,36050:23650,36051:23652,36052:23655,36053:23656,36054:23657,36055:23658,36056:23659,36057:23660,36058:23661,36059:23664,36060:23666,36061:23667,36062:23668,36063:23669,36064:23670,36065:23671,36066:23672,36067:23675,36068:23676,36069:23677,36070:23678,36071:23680,36072:23683,36073:23684,36074:23685,36075:23686,36076:23687,36077:23689,36078:23690,36079:23691,36080:23694,36081:23695,36082:23698,36083:23699,36084:23701,36085:23709,36086:23710,36087:23711,36088:23712,36089:23713,36090:23716,36091:23717,36092:23718,36093:23719,36094:23720,36160:23722,36161:23726,36162:23727,36163:23728,36164:23730,36165:23732,36166:23734,36167:23737,36168:23738,36169:23739,36170:23740,36171:23742,36172:23744,36173:23746,36174:23747,36175:23749,36176:23750,36177:23751,36178:23752,36179:23753,36180:23754,36181:23756,36182:23757,36183:23758,36184:23759,36185:23760,36186:23761,36187:23763,36188:23764,36189:23765,36190:23766,36191:23767,36192:23768,36193:23770,36194:23771,36195:23772,36196:23773,36197:23774,36198:23775,36199:23776,36200:23778,36201:23779,36202:23783,36203:23785,36204:23787,36205:23788,36206:23790,36207:23791,36208:23793,36209:23794,36210:23795,36211:23796,36212:23797,36213:23798,36214:23799,36215:23800,36216:23801,36217:23802,36218:23804,36219:23805,36220:23806,36221:23807,36222:23808,36224:23809,36225:23812,36226:23813,36227:23816,36228:23817,36229:23818,36230:23819,36231:23820,36232:23821,36233:23823,36234:23824,36235:23825,36236:23826,36237:23827,36238:23829,36239:23831,36240:23832,36241:23833,36242:23834,36243:23836,36244:23837,36245:23839,36246:23840,36247:23841,36248:23842,36249:23843,36250:23845,36251:23848,36252:23850,36253:23851,36254:23852,36255:23855,36256:23856,36257:23857,36258:23858,36259:23859,36260:23861,36261:23862,36262:23863,36263:23864,36264:23865,36265:23866,36266:23867,36267:23868,36268:23871,36269:23872,36270:23873,36271:23874,36272:23875,36273:23876,36274:23877,36275:23878,36276:23880,36277:23881,36278:23885,36279:23886,36280:23887,36281:23888,36282:23889,36283:23890,36284:23891,36285:23892,36286:23893,36287:23894,36288:23895,36289:23897,36290:23898,36291:23900,36292:23902,36293:23903,36294:23904,36295:23905,36296:23906,36297:23907,36298:23908,36299:23909,36300:23910,36301:23911,36302:23912,36303:23914,36304:23917,36305:23918,36306:23920,36307:23921,36308:23922,36309:23923,36310:23925,36311:23926,36312:23927,36313:23928,36314:23929,36315:23930,36316:23931,36317:23932,36318:23933,36319:23934,36320:23935,36321:23936,36322:23937,36323:23939,36324:23940,36325:23941,36326:23942,36327:23943,36328:23944,36329:23945,36330:23946,36331:23947,36332:23948,36333:23949,36334:23950,36335:23951,36336:23952,36337:23953,36338:23954,36339:23955,36340:23956,36341:23957,36342:23958,36343:23959,36344:23960,36345:23962,36346:23963,36347:23964,36348:23966,36349:23967,36350:23968,36416:23969,36417:23970,36418:23971,36419:23972,36420:23973,36421:23974,36422:23975,36423:23976,36424:23977,36425:23978,36426:23979,36427:23980,36428:23981,36429:23982,36430:23983,36431:23984,36432:23985,36433:23986,36434:23987,36435:23988,36436:23989,36437:23990,36438:23992,36439:23993,36440:23994,36441:23995,36442:23996,36443:23997,36444:23998,36445:23999,36446:24000,36447:24001,36448:24002,36449:24003,36450:24004,36451:24006,36452:24007,36453:24008,36454:24009,36455:24010,36456:24011,36457:24012,36458:24014,36459:24015,36460:24016,36461:24017,36462:24018,36463:24019,36464:24020,36465:24021,36466:24022,36467:24023,36468:24024,36469:24025,36470:24026,36471:24028,36472:24031,36473:24032,36474:24035,36475:24036,36476:24042,36477:24044,36478:24045,36480:24048,36481:24053,36482:24054,36483:24056,36484:24057,36485:24058,36486:24059,36487:24060,36488:24063,36489:24064,36490:24068,36491:24071,36492:24073,36493:24074,36494:24075,36495:24077,36496:24078,36497:24082,36498:24083,36499:24087,36500:24094,36501:24095,36502:24096,36503:24097,36504:24098,36505:24099,36506:24100,36507:24101,36508:24104,36509:24105,36510:24106,36511:24107,36512:24108,36513:24111,36514:24112,36515:24114,36516:24115,36517:24116,36518:24117,36519:24118,36520:24121,36521:24122,36522:24126,36523:24127,36524:24128,36525:24129,36526:24131,36527:24134,36528:24135,36529:24136,36530:24137,36531:24138,36532:24139,36533:24141,36534:24142,36535:24143,36536:24144,36537:24145,36538:24146,36539:24147,36540:24150,36541:24151,36542:24152,36543:24153,36544:24154,36545:24156,36546:24157,36547:24159,36548:24160,36549:24163,36550:24164,36551:24165,36552:24166,36553:24167,36554:24168,36555:24169,36556:24170,36557:24171,36558:24172,36559:24173,36560:24174,36561:24175,36562:24176,36563:24177,36564:24181,36565:24183,36566:24185,36567:24190,36568:24193,36569:24194,36570:24195,36571:24197,36572:24200,36573:24201,36574:24204,36575:24205,36576:24206,36577:24210,36578:24216,36579:24219,36580:24221,36581:24225,36582:24226,36583:24227,36584:24228,36585:24232,36586:24233,36587:24234,36588:24235,36589:24236,36590:24238,36591:24239,36592:24240,36593:24241,36594:24242,36595:24244,36596:24250,36597:24251,36598:24252,36599:24253,36600:24255,36601:24256,36602:24257,36603:24258,36604:24259,36605:24260,36606:24261,36672:24262,36673:24263,36674:24264,36675:24267,36676:24268,36677:24269,36678:24270,36679:24271,36680:24272,36681:24276,36682:24277,36683:24279,36684:24280,36685:24281,36686:24282,36687:24284,36688:24285,36689:24286,36690:24287,36691:24288,36692:24289,36693:24290,36694:24291,36695:24292,36696:24293,36697:24294,36698:24295,36699:24297,36700:24299,36701:24300,36702:24301,36703:24302,36704:24303,36705:24304,36706:24305,36707:24306,36708:24307,36709:24309,36710:24312,36711:24313,36712:24315,36713:24316,36714:24317,36715:24325,36716:24326,36717:24327,36718:24329,36719:24332,36720:24333,36721:24334,36722:24336,36723:24338,36724:24340,36725:24342,36726:24345,36727:24346,36728:24348,36729:24349,36730:24350,36731:24353,36732:24354,36733:24355,36734:24356,36736:24360,36737:24363,36738:24364,36739:24366,36740:24368,36741:24370,36742:24371,36743:24372,36744:24373,36745:24374,36746:24375,36747:24376,36748:24379,36749:24381,36750:24382,36751:24383,36752:24385,36753:24386,36754:24387,36755:24388,36756:24389,36757:24390,36758:24391,36759:24392,36760:24393,36761:24394,36762:24395,36763:24396,36764:24397,36765:24398,36766:24399,36767:24401,36768:24404,36769:24409,36770:24410,36771:24411,36772:24412,36773:24414,36774:24415,36775:24416,36776:24419,36777:24421,36778:24423,36779:24424,36780:24427,36781:24430,36782:24431,36783:24434,36784:24436,36785:24437,36786:24438,36787:24440,36788:24442,36789:24445,36790:24446,36791:24447,36792:24451,36793:24454,36794:24461,36795:24462,36796:24463,36797:24465,36798:24467,36799:24468,36800:24470,36801:24474,36802:24475,36803:24477,36804:24478,36805:24479,36806:24480,36807:24482,36808:24483,36809:24484,36810:24485,36811:24486,36812:24487,36813:24489,36814:24491,36815:24492,36816:24495,36817:24496,36818:24497,36819:24498,36820:24499,36821:24500,36822:24502,36823:24504,36824:24505,36825:24506,36826:24507,36827:24510,36828:24511,36829:24512,36830:24513,36831:24514,36832:24519,36833:24520,36834:24522,36835:24523,36836:24526,36837:24531,36838:24532,36839:24533,36840:24538,36841:24539,36842:24540,36843:24542,36844:24543,36845:24546,36846:24547,36847:24549,36848:24550,36849:24552,36850:24553,36851:24556,36852:24559,36853:24560,36854:24562,36855:24563,36856:24564,36857:24566,36858:24567,36859:24569,36860:24570,36861:24572,36862:24583,36928:24584,36929:24585,36930:24587,36931:24588,36932:24592,36933:24593,36934:24595,36935:24599,36936:24600,36937:24602,36938:24606,36939:24607,36940:24610,36941:24611,36942:24612,36943:24620,36944:24621,36945:24622,36946:24624,36947:24625,36948:24626,36949:24627,36950:24628,36951:24630,36952:24631,36953:24632,36954:24633,36955:24634,36956:24637,36957:24638,36958:24640,36959:24644,36960:24645,36961:24646,36962:24647,36963:24648,36964:24649,36965:24650,36966:24652,36967:24654,36968:24655,36969:24657,36970:24659,36971:24660,36972:24662,36973:24663,36974:24664,36975:24667,36976:24668,36977:24670,36978:24671,36979:24672,36980:24673,36981:24677,36982:24678,36983:24686,36984:24689,36985:24690,36986:24692,36987:24693,36988:24695,36989:24702,36990:24704,36992:24705,36993:24706,36994:24709,36995:24710,36996:24711,36997:24712,36998:24714,36999:24715,37000:24718,37001:24719,37002:24720,37003:24721,37004:24723,37005:24725,37006:24727,37007:24728,37008:24729,37009:24732,37010:24734,37011:24737,37012:24738,37013:24740,37014:24741,37015:24743,37016:24745,37017:24746,37018:24750,37019:24752,37020:24755,37021:24757,37022:24758,37023:24759,37024:24761,37025:24762,37026:24765,37027:24766,37028:24767,37029:24768,37030:24769,37031:24770,37032:24771,37033:24772,37034:24775,37035:24776,37036:24777,37037:24780,37038:24781,37039:24782,37040:24783,37041:24784,37042:24786,37043:24787,37044:24788,37045:24790,37046:24791,37047:24793,37048:24795,37049:24798,37050:24801,37051:24802,37052:24803,37053:24804,37054:24805,37055:24810,37056:24817,37057:24818,37058:24821,37059:24823,37060:24824,37061:24827,37062:24828,37063:24829,37064:24830,37065:24831,37066:24834,37067:24835,37068:24836,37069:24837,37070:24839,37071:24842,37072:24843,37073:24844,37074:24848,37075:24849,37076:24850,37077:24851,37078:24852,37079:24854,37080:24855,37081:24856,37082:24857,37083:24859,37084:24860,37085:24861,37086:24862,37087:24865,37088:24866,37089:24869,37090:24872,37091:24873,37092:24874,37093:24876,37094:24877,37095:24878,37096:24879,37097:24880,37098:24881,37099:24882,37100:24883,37101:24884,37102:24885,37103:24886,37104:24887,37105:24888,37106:24889,37107:24890,37108:24891,37109:24892,37110:24893,37111:24894,37112:24896,37113:24897,37114:24898,37115:24899,37116:24900,37117:24901,37118:24902,37184:24903,37185:24905,37186:24907,37187:24909,37188:24911,37189:24912,37190:24914,37191:24915,37192:24916,37193:24918,37194:24919,37195:24920,37196:24921,37197:24922,37198:24923,37199:24924,37200:24926,37201:24927,37202:24928,37203:24929,37204:24931,37205:24932,37206:24933,37207:24934,37208:24937,37209:24938,37210:24939,37211:24940,37212:24941,37213:24942,37214:24943,37215:24945,37216:24946,37217:24947,37218:24948,37219:24950,37220:24952,37221:24953,37222:24954,37223:24955,37224:24956,37225:24957,37226:24958,37227:24959,37228:24960,37229:24961,37230:24962,37231:24963,37232:24964,37233:24965,37234:24966,37235:24967,37236:24968,37237:24969,37238:24970,37239:24972,37240:24973,37241:24975,37242:24976,37243:24977,37244:24978,37245:24979,37246:24981,37248:24982,37249:24983,37250:24984,37251:24985,37252:24986,37253:24987,37254:24988,37255:24990,37256:24991,37257:24992,37258:24993,37259:24994,37260:24995,37261:24996,37262:24997,37263:24998,37264:25002,37265:25003,37266:25005,37267:25006,37268:25007,37269:25008,37270:25009,37271:25010,37272:25011,37273:25012,37274:25013,37275:25014,37276:25016,37277:25017,37278:25018,37279:25019,37280:25020,37281:25021,37282:25023,37283:25024,37284:25025,37285:25027,37286:25028,37287:25029,37288:25030,37289:25031,37290:25033,37291:25036,37292:25037,37293:25038,37294:25039,37295:25040,37296:25043,37297:25045,37298:25046,37299:25047,37300:25048,37301:25049,37302:25050,37303:25051,37304:25052,37305:25053,37306:25054,37307:25055,37308:25056,37309:25057,37310:25058,37311:25059,37312:25060,37313:25061,37314:25063,37315:25064,37316:25065,37317:25066,37318:25067,37319:25068,37320:25069,37321:25070,37322:25071,37323:25072,37324:25073,37325:25074,37326:25075,37327:25076,37328:25078,37329:25079,37330:25080,37331:25081,37332:25082,37333:25083,37334:25084,37335:25085,37336:25086,37337:25088,37338:25089,37339:25090,37340:25091,37341:25092,37342:25093,37343:25095,37344:25097,37345:25107,37346:25108,37347:25113,37348:25116,37349:25117,37350:25118,37351:25120,37352:25123,37353:25126,37354:25127,37355:25128,37356:25129,37357:25131,37358:25133,37359:25135,37360:25136,37361:25137,37362:25138,37363:25141,37364:25142,37365:25144,37366:25145,37367:25146,37368:25147,37369:25148,37370:25154,37371:25156,37372:25157,37373:25158,37374:25162,37440:25167,37441:25168,37442:25173,37443:25174,37444:25175,37445:25177,37446:25178,37447:25180,37448:25181,37449:25182,37450:25183,37451:25184,37452:25185,37453:25186,37454:25188,37455:25189,37456:25192,37457:25201,37458:25202,37459:25204,37460:25205,37461:25207,37462:25208,37463:25210,37464:25211,37465:25213,37466:25217,37467:25218,37468:25219,37469:25221,37470:25222,37471:25223,37472:25224,37473:25227,37474:25228,37475:25229,37476:25230,37477:25231,37478:25232,37479:25236,37480:25241,37481:25244,37482:25245,37483:25246,37484:25251,37485:25254,37486:25255,37487:25257,37488:25258,37489:25261,37490:25262,37491:25263,37492:25264,37493:25266,37494:25267,37495:25268,37496:25270,37497:25271,37498:25272,37499:25274,37500:25278,37501:25280,37502:25281,37504:25283,37505:25291,37506:25295,37507:25297,37508:25301,37509:25309,37510:25310,37511:25312,37512:25313,37513:25316,37514:25322,37515:25323,37516:25328,37517:25330,37518:25333,37519:25336,37520:25337,37521:25338,37522:25339,37523:25344,37524:25347,37525:25348,37526:25349,37527:25350,37528:25354,37529:25355,37530:25356,37531:25357,37532:25359,37533:25360,37534:25362,37535:25363,37536:25364,37537:25365,37538:25367,37539:25368,37540:25369,37541:25372,37542:25382,37543:25383,37544:25385,37545:25388,37546:25389,37547:25390,37548:25392,37549:25393,37550:25395,37551:25396,37552:25397,37553:25398,37554:25399,37555:25400,37556:25403,37557:25404,37558:25406,37559:25407,37560:25408,37561:25409,37562:25412,37563:25415,37564:25416,37565:25418,37566:25425,37567:25426,37568:25427,37569:25428,37570:25430,37571:25431,37572:25432,37573:25433,37574:25434,37575:25435,37576:25436,37577:25437,37578:25440,37579:25444,37580:25445,37581:25446,37582:25448,37583:25450,37584:25451,37585:25452,37586:25455,37587:25456,37588:25458,37589:25459,37590:25460,37591:25461,37592:25464,37593:25465,37594:25468,37595:25469,37596:25470,37597:25471,37598:25473,37599:25475,37600:25476,37601:25477,37602:25478,37603:25483,37604:25485,37605:25489,37606:25491,37607:25492,37608:25493,37609:25495,37610:25497,37611:25498,37612:25499,37613:25500,37614:25501,37615:25502,37616:25503,37617:25505,37618:25508,37619:25510,37620:25515,37621:25519,37622:25521,37623:25522,37624:25525,37625:25526,37626:25529,37627:25531,37628:25533,37629:25535,37630:25536,37696:25537,37697:25538,37698:25539,37699:25541,37700:25543,37701:25544,37702:25546,37703:25547,37704:25548,37705:25553,37706:25555,37707:25556,37708:25557,37709:25559,37710:25560,37711:25561,37712:25562,37713:25563,37714:25564,37715:25565,37716:25567,37717:25570,37718:25572,37719:25573,37720:25574,37721:25575,37722:25576,37723:25579,37724:25580,37725:25582,37726:25583,37727:25584,37728:25585,37729:25587,37730:25589,37731:25591,37732:25593,37733:25594,37734:25595,37735:25596,37736:25598,37737:25603,37738:25604,37739:25606,37740:25607,37741:25608,37742:25609,37743:25610,37744:25613,37745:25614,37746:25617,37747:25618,37748:25621,37749:25622,37750:25623,37751:25624,37752:25625,37753:25626,37754:25629,37755:25631,37756:25634,37757:25635,37758:25636,37760:25637,37761:25639,37762:25640,37763:25641,37764:25643,37765:25646,37766:25647,37767:25648,37768:25649,37769:25650,37770:25651,37771:25653,37772:25654,37773:25655,37774:25656,37775:25657,37776:25659,37777:25660,37778:25662,37779:25664,37780:25666,37781:25667,37782:25673,37783:25675,37784:25676,37785:25677,37786:25678,37787:25679,37788:25680,37789:25681,37790:25683,37791:25685,37792:25686,37793:25687,37794:25689,37795:25690,37796:25691,37797:25692,37798:25693,37799:25695,37800:25696,37801:25697,37802:25698,37803:25699,37804:25700,37805:25701,37806:25702,37807:25704,37808:25706,37809:25707,37810:25708,37811:25710,37812:25711,37813:25712,37814:25713,37815:25714,37816:25715,37817:25716,37818:25717,37819:25718,37820:25719,37821:25723,37822:25724,37823:25725,37824:25726,37825:25727,37826:25728,37827:25729,37828:25731,37829:25734,37830:25736,37831:25737,37832:25738,37833:25739,37834:25740,37835:25741,37836:25742,37837:25743,37838:25744,37839:25747,37840:25748,37841:25751,37842:25752,37843:25754,37844:25755,37845:25756,37846:25757,37847:25759,37848:25760,37849:25761,37850:25762,37851:25763,37852:25765,37853:25766,37854:25767,37855:25768,37856:25770,37857:25771,37858:25775,37859:25777,37860:25778,37861:25779,37862:25780,37863:25782,37864:25785,37865:25787,37866:25789,37867:25790,37868:25791,37869:25793,37870:25795,37871:25796,37872:25798,37873:25799,37874:25800,37875:25801,37876:25802,37877:25803,37878:25804,37879:25807,37880:25809,37881:25811,37882:25812,37883:25813,37884:25814,37885:25817,37886:25818,37952:25819,37953:25820,37954:25821,37955:25823,37956:25824,37957:25825,37958:25827,37959:25829,37960:25831,37961:25832,37962:25833,37963:25834,37964:25835,37965:25836,37966:25837,37967:25838,37968:25839,37969:25840,37970:25841,37971:25842,37972:25843,37973:25844,37974:25845,37975:25846,37976:25847,37977:25848,37978:25849,37979:25850,37980:25851,37981:25852,37982:25853,37983:25854,37984:25855,37985:25857,37986:25858,37987:25859,37988:25860,37989:25861,37990:25862,37991:25863,37992:25864,37993:25866,37994:25867,37995:25868,37996:25869,37997:25870,37998:25871,37999:25872,38000:25873,38001:25875,38002:25876,38003:25877,38004:25878,38005:25879,38006:25881,38007:25882,38008:25883,38009:25884,38010:25885,38011:25886,38012:25887,38013:25888,38014:25889,38016:25890,38017:25891,38018:25892,38019:25894,38020:25895,38021:25896,38022:25897,38023:25898,38024:25900,38025:25901,38026:25904,38027:25905,38028:25906,38029:25907,38030:25911,38031:25914,38032:25916,38033:25917,38034:25920,38035:25921,38036:25922,38037:25923,38038:25924,38039:25926,38040:25927,38041:25930,38042:25931,38043:25933,38044:25934,38045:25936,38046:25938,38047:25939,38048:25940,38049:25943,38050:25944,38051:25946,38052:25948,38053:25951,38054:25952,38055:25953,38056:25956,38057:25957,38058:25959,38059:25960,38060:25961,38061:25962,38062:25965,38063:25966,38064:25967,38065:25969,38066:25971,38067:25973,38068:25974,38069:25976,38070:25977,38071:25978,38072:25979,38073:25980,38074:25981,38075:25982,38076:25983,38077:25984,38078:25985,38079:25986,38080:25987,38081:25988,38082:25989,38083:25990,38084:25992,38085:25993,38086:25994,38087:25997,38088:25998,38089:25999,38090:26002,38091:26004,38092:26005,38093:26006,38094:26008,38095:26010,38096:26013,38097:26014,38098:26016,38099:26018,38100:26019,38101:26022,38102:26024,38103:26026,38104:26028,38105:26030,38106:26033,38107:26034,38108:26035,38109:26036,38110:26037,38111:26038,38112:26039,38113:26040,38114:26042,38115:26043,38116:26046,38117:26047,38118:26048,38119:26050,38120:26055,38121:26056,38122:26057,38123:26058,38124:26061,38125:26064,38126:26065,38127:26067,38128:26068,38129:26069,38130:26072,38131:26073,38132:26074,38133:26075,38134:26076,38135:26077,38136:26078,38137:26079,38138:26081,38139:26083,38140:26084,38141:26090,38142:26091,38208:26098,38209:26099,38210:26100,38211:26101,38212:26104,38213:26105,38214:26107,38215:26108,38216:26109,38217:26110,38218:26111,38219:26113,38220:26116,38221:26117,38222:26119,38223:26120,38224:26121,38225:26123,38226:26125,38227:26128,38228:26129,38229:26130,38230:26134,38231:26135,38232:26136,38233:26138,38234:26139,38235:26140,38236:26142,38237:26145,38238:26146,38239:26147,38240:26148,38241:26150,38242:26153,38243:26154,38244:26155,38245:26156,38246:26158,38247:26160,38248:26162,38249:26163,38250:26167,38251:26168,38252:26169,38253:26170,38254:26171,38255:26173,38256:26175,38257:26176,38258:26178,38259:26180,38260:26181,38261:26182,38262:26183,38263:26184,38264:26185,38265:26186,38266:26189,38267:26190,38268:26192,38269:26193,38270:26200,38272:26201,38273:26203,38274:26204,38275:26205,38276:26206,38277:26208,38278:26210,38279:26211,38280:26213,38281:26215,38282:26217,38283:26218,38284:26219,38285:26220,38286:26221,38287:26225,38288:26226,38289:26227,38290:26229,38291:26232,38292:26233,38293:26235,38294:26236,38295:26237,38296:26239,38297:26240,38298:26241,38299:26243,38300:26245,38301:26246,38302:26248,38303:26249,38304:26250,38305:26251,38306:26253,38307:26254,38308:26255,38309:26256,38310:26258,38311:26259,38312:26260,38313:26261,38314:26264,38315:26265,38316:26266,38317:26267,38318:26268,38319:26270,38320:26271,38321:26272,38322:26273,38323:26274,38324:26275,38325:26276,38326:26277,38327:26278,38328:26281,38329:26282,38330:26283,38331:26284,38332:26285,38333:26287,38334:26288,38335:26289,38336:26290,38337:26291,38338:26293,38339:26294,38340:26295,38341:26296,38342:26298,38343:26299,38344:26300,38345:26301,38346:26303,38347:26304,38348:26305,38349:26306,38350:26307,38351:26308,38352:26309,38353:26310,38354:26311,38355:26312,38356:26313,38357:26314,38358:26315,38359:26316,38360:26317,38361:26318,38362:26319,38363:26320,38364:26321,38365:26322,38366:26323,38367:26324,38368:26325,38369:26326,38370:26327,38371:26328,38372:26330,38373:26334,38374:26335,38375:26336,38376:26337,38377:26338,38378:26339,38379:26340,38380:26341,38381:26343,38382:26344,38383:26346,38384:26347,38385:26348,38386:26349,38387:26350,38388:26351,38389:26353,38390:26357,38391:26358,38392:26360,38393:26362,38394:26363,38395:26365,38396:26369,38397:26370,38398:26371,38464:26372,38465:26373,38466:26374,38467:26375,38468:26380,38469:26382,38470:26383,38471:26385,38472:26386,38473:26387,38474:26390,38475:26392,38476:26393,38477:26394,38478:26396,38479:26398,38480:26400,38481:26401,38482:26402,38483:26403,38484:26404,38485:26405,38486:26407,38487:26409,38488:26414,38489:26416,38490:26418,38491:26419,38492:26422,38493:26423,38494:26424,38495:26425,38496:26427,38497:26428,38498:26430,38499:26431,38500:26433,38501:26436,38502:26437,38503:26439,38504:26442,38505:26443,38506:26445,38507:26450,38508:26452,38509:26453,38510:26455,38511:26456,38512:26457,38513:26458,38514:26459,38515:26461,38516:26466,38517:26467,38518:26468,38519:26470,38520:26471,38521:26475,38522:26476,38523:26478,38524:26481,38525:26484,38526:26486,38528:26488,38529:26489,38530:26490,38531:26491,38532:26493,38533:26496,38534:26498,38535:26499,38536:26501,38537:26502,38538:26504,38539:26506,38540:26508,38541:26509,38542:26510,38543:26511,38544:26513,38545:26514,38546:26515,38547:26516,38548:26518,38549:26521,38550:26523,38551:26527,38552:26528,38553:26529,38554:26532,38555:26534,38556:26537,38557:26540,38558:26542,38559:26545,38560:26546,38561:26548,38562:26553,38563:26554,38564:26555,38565:26556,38566:26557,38567:26558,38568:26559,38569:26560,38570:26562,38571:26565,38572:26566,38573:26567,38574:26568,38575:26569,38576:26570,38577:26571,38578:26572,38579:26573,38580:26574,38581:26581,38582:26582,38583:26583,38584:26587,38585:26591,38586:26593,38587:26595,38588:26596,38589:26598,38590:26599,38591:26600,38592:26602,38593:26603,38594:26605,38595:26606,38596:26610,38597:26613,38598:26614,38599:26615,38600:26616,38601:26617,38602:26618,38603:26619,38604:26620,38605:26622,38606:26625,38607:26626,38608:26627,38609:26628,38610:26630,38611:26637,38612:26640,38613:26642,38614:26644,38615:26645,38616:26648,38617:26649,38618:26650,38619:26651,38620:26652,38621:26654,38622:26655,38623:26656,38624:26658,38625:26659,38626:26660,38627:26661,38628:26662,38629:26663,38630:26664,38631:26667,38632:26668,38633:26669,38634:26670,38635:26671,38636:26672,38637:26673,38638:26676,38639:26677,38640:26678,38641:26682,38642:26683,38643:26687,38644:26695,38645:26699,38646:26701,38647:26703,38648:26706,38649:26710,38650:26711,38651:26712,38652:26713,38653:26714,38654:26715,38720:26716,38721:26717,38722:26718,38723:26719,38724:26730,38725:26732,38726:26733,38727:26734,38728:26735,38729:26736,38730:26737,38731:26738,38732:26739,38733:26741,38734:26744,38735:26745,38736:26746,38737:26747,38738:26748,38739:26749,38740:26750,38741:26751,38742:26752,38743:26754,38744:26756,38745:26759,38746:26760,38747:26761,38748:26762,38749:26763,38750:26764,38751:26765,38752:26766,38753:26768,38754:26769,38755:26770,38756:26772,38757:26773,38758:26774,38759:26776,38760:26777,38761:26778,38762:26779,38763:26780,38764:26781,38765:26782,38766:26783,38767:26784,38768:26785,38769:26787,38770:26788,38771:26789,38772:26793,38773:26794,38774:26795,38775:26796,38776:26798,38777:26801,38778:26802,38779:26804,38780:26806,38781:26807,38782:26808,38784:26809,38785:26810,38786:26811,38787:26812,38788:26813,38789:26814,38790:26815,38791:26817,38792:26819,38793:26820,38794:26821,38795:26822,38796:26823,38797:26824,38798:26826,38799:26828,38800:26830,38801:26831,38802:26832,38803:26833,38804:26835,38805:26836,38806:26838,38807:26839,38808:26841,38809:26843,38810:26844,38811:26845,38812:26846,38813:26847,38814:26849,38815:26850,38816:26852,38817:26853,38818:26854,38819:26855,38820:26856,38821:26857,38822:26858,38823:26859,38824:26860,38825:26861,38826:26863,38827:26866,38828:26867,38829:26868,38830:26870,38831:26871,38832:26872,38833:26875,38834:26877,38835:26878,38836:26879,38837:26880,38838:26882,38839:26883,38840:26884,38841:26886,38842:26887,38843:26888,38844:26889,38845:26890,38846:26892,38847:26895,38848:26897,38849:26899,38850:26900,38851:26901,38852:26902,38853:26903,38854:26904,38855:26905,38856:26906,38857:26907,38858:26908,38859:26909,38860:26910,38861:26913,38862:26914,38863:26915,38864:26917,38865:26918,38866:26919,38867:26920,38868:26921,38869:26922,38870:26923,38871:26924,38872:26926,38873:26927,38874:26929,38875:26930,38876:26931,38877:26933,38878:26934,38879:26935,38880:26936,38881:26938,38882:26939,38883:26940,38884:26942,38885:26944,38886:26945,38887:26947,38888:26948,38889:26949,38890:26950,38891:26951,38892:26952,38893:26953,38894:26954,38895:26955,38896:26956,38897:26957,38898:26958,38899:26959,38900:26960,38901:26961,38902:26962,38903:26963,38904:26965,38905:26966,38906:26968,38907:26969,38908:26971,38909:26972,38910:26975,38976:26977,38977:26978,38978:26980,38979:26981,38980:26983,38981:26984,38982:26985,38983:26986,38984:26988,38985:26989,38986:26991,38987:26992,38988:26994,38989:26995,38990:26996,38991:26997,38992:26998,38993:27002,38994:27003,38995:27005,38996:27006,38997:27007,38998:27009,38999:27011,39000:27013,39001:27018,39002:27019,39003:27020,39004:27022,39005:27023,39006:27024,39007:27025,39008:27026,39009:27027,39010:27030,39011:27031,39012:27033,39013:27034,39014:27037,39015:27038,39016:27039,39017:27040,39018:27041,39019:27042,39020:27043,39021:27044,39022:27045,39023:27046,39024:27049,39025:27050,39026:27052,39027:27054,39028:27055,39029:27056,39030:27058,39031:27059,39032:27061,39033:27062,39034:27064,39035:27065,39036:27066,39037:27068,39038:27069,39040:27070,39041:27071,39042:27072,39043:27074,39044:27075,39045:27076,39046:27077,39047:27078,39048:27079,39049:27080,39050:27081,39051:27083,39052:27085,39053:27087,39054:27089,39055:27090,39056:27091,39057:27093,39058:27094,39059:27095,39060:27096,39061:27097,39062:27098,39063:27100,39064:27101,39065:27102,39066:27105,39067:27106,39068:27107,39069:27108,39070:27109,39071:27110,39072:27111,39073:27112,39074:27113,39075:27114,39076:27115,39077:27116,39078:27118,39079:27119,39080:27120,39081:27121,39082:27123,39083:27124,39084:27125,39085:27126,39086:27127,39087:27128,39088:27129,39089:27130,39090:27131,39091:27132,39092:27134,39093:27136,39094:27137,39095:27138,39096:27139,39097:27140,39098:27141,39099:27142,39100:27143,39101:27144,39102:27145,39103:27147,39104:27148,39105:27149,39106:27150,39107:27151,39108:27152,39109:27153,39110:27154,39111:27155,39112:27156,39113:27157,39114:27158,39115:27161,39116:27162,39117:27163,39118:27164,39119:27165,39120:27166,39121:27168,39122:27170,39123:27171,39124:27172,39125:27173,39126:27174,39127:27175,39128:27177,39129:27179,39130:27180,39131:27181,39132:27182,39133:27184,39134:27186,39135:27187,39136:27188,39137:27190,39138:27191,39139:27192,39140:27193,39141:27194,39142:27195,39143:27196,39144:27199,39145:27200,39146:27201,39147:27202,39148:27203,39149:27205,39150:27206,39151:27208,39152:27209,39153:27210,39154:27211,39155:27212,39156:27213,39157:27214,39158:27215,39159:27217,39160:27218,39161:27219,39162:27220,39163:27221,39164:27222,39165:27223,39166:27226,39232:27228,39233:27229,39234:27230,39235:27231,39236:27232,39237:27234,39238:27235,39239:27236,39240:27238,39241:27239,39242:27240,39243:27241,39244:27242,39245:27243,39246:27244,39247:27245,39248:27246,39249:27247,39250:27248,39251:27250,39252:27251,39253:27252,39254:27253,39255:27254,39256:27255,39257:27256,39258:27258,39259:27259,39260:27261,39261:27262,39262:27263,39263:27265,39264:27266,39265:27267,39266:27269,39267:27270,39268:27271,39269:27272,39270:27273,39271:27274,39272:27275,39273:27276,39274:27277,39275:27279,39276:27282,39277:27283,39278:27284,39279:27285,39280:27286,39281:27288,39282:27289,39283:27290,39284:27291,39285:27292,39286:27293,39287:27294,39288:27295,39289:27297,39290:27298,39291:27299,39292:27300,39293:27301,39294:27302,39296:27303,39297:27304,39298:27306,39299:27309,39300:27310,39301:27311,39302:27312,39303:27313,39304:27314,39305:27315,39306:27316,39307:27317,39308:27318,39309:27319,39310:27320,39311:27321,39312:27322,39313:27323,39314:27324,39315:27325,39316:27326,39317:27327,39318:27328,39319:27329,39320:27330,39321:27331,39322:27332,39323:27333,39324:27334,39325:27335,39326:27336,39327:27337,39328:27338,39329:27339,39330:27340,39331:27341,39332:27342,39333:27343,39334:27344,39335:27345,39336:27346,39337:27347,39338:27348,39339:27349,39340:27350,39341:27351,39342:27352,39343:27353,39344:27354,39345:27355,39346:27356,39347:27357,39348:27358,39349:27359,39350:27360,39351:27361,39352:27362,39353:27363,39354:27364,39355:27365,39356:27366,39357:27367,39358:27368,39359:27369,39360:27370,39361:27371,39362:27372,39363:27373,39364:27374,39365:27375,39366:27376,39367:27377,39368:27378,39369:27379,39370:27380,39371:27381,39372:27382,39373:27383,39374:27384,39375:27385,39376:27386,39377:27387,39378:27388,39379:27389,39380:27390,39381:27391,39382:27392,39383:27393,39384:27394,39385:27395,39386:27396,39387:27397,39388:27398,39389:27399,39390:27400,39391:27401,39392:27402,39393:27403,39394:27404,39395:27405,39396:27406,39397:27407,39398:27408,39399:27409,39400:27410,39401:27411,39402:27412,39403:27413,39404:27414,39405:27415,39406:27416,39407:27417,39408:27418,39409:27419,39410:27420,39411:27421,39412:27422,39413:27423,39414:27429,39415:27430,39416:27432,39417:27433,39418:27434,39419:27435,39420:27436,39421:27437,39422:27438,39488:27439,39489:27440,39490:27441,39491:27443,39492:27444,39493:27445,39494:27446,39495:27448,39496:27451,39497:27452,39498:27453,39499:27455,39500:27456,39501:27457,39502:27458,39503:27460,39504:27461,39505:27464,39506:27466,39507:27467,39508:27469,39509:27470,39510:27471,39511:27472,39512:27473,39513:27474,39514:27475,39515:27476,39516:27477,39517:27478,39518:27479,39519:27480,39520:27482,39521:27483,39522:27484,39523:27485,39524:27486,39525:27487,39526:27488,39527:27489,39528:27496,39529:27497,39530:27499,39531:27500,39532:27501,39533:27502,39534:27503,39535:27504,39536:27505,39537:27506,39538:27507,39539:27508,39540:27509,39541:27510,39542:27511,39543:27512,39544:27514,39545:27517,39546:27518,39547:27519,39548:27520,39549:27525,39550:27528,39552:27532,39553:27534,39554:27535,39555:27536,39556:27537,39557:27540,39558:27541,39559:27543,39560:27544,39561:27545,39562:27548,39563:27549,39564:27550,39565:27551,39566:27552,39567:27554,39568:27555,39569:27556,39570:27557,39571:27558,39572:27559,39573:27560,39574:27561,39575:27563,39576:27564,39577:27565,39578:27566,39579:27567,39580:27568,39581:27569,39582:27570,39583:27574,39584:27576,39585:27577,39586:27578,39587:27579,39588:27580,39589:27581,39590:27582,39591:27584,39592:27587,39593:27588,39594:27590,39595:27591,39596:27592,39597:27593,39598:27594,39599:27596,39600:27598,39601:27600,39602:27601,39603:27608,39604:27610,39605:27612,39606:27613,39607:27614,39608:27615,39609:27616,39610:27618,39611:27619,39612:27620,39613:27621,39614:27622,39615:27623,39616:27624,39617:27625,39618:27628,39619:27629,39620:27630,39621:27632,39622:27633,39623:27634,39624:27636,39625:27638,39626:27639,39627:27640,39628:27642,39629:27643,39630:27644,39631:27646,39632:27647,39633:27648,39634:27649,39635:27650,39636:27651,39637:27652,39638:27656,39639:27657,39640:27658,39641:27659,39642:27660,39643:27662,39644:27666,39645:27671,39646:27676,39647:27677,39648:27678,39649:27680,39650:27683,39651:27685,39652:27691,39653:27692,39654:27693,39655:27697,39656:27699,39657:27702,39658:27703,39659:27705,39660:27706,39661:27707,39662:27708,39663:27710,39664:27711,39665:27715,39666:27716,39667:27717,39668:27720,39669:27723,39670:27724,39671:27725,39672:27726,39673:27727,39674:27729,39675:27730,39676:27731,39677:27734,39678:27736,39744:27737,39745:27738,39746:27746,39747:27747,39748:27749,39749:27750,39750:27751,39751:27755,39752:27756,39753:27757,39754:27758,39755:27759,39756:27761,39757:27763,39758:27765,39759:27767,39760:27768,39761:27770,39762:27771,39763:27772,39764:27775,39765:27776,39766:27780,39767:27783,39768:27786,39769:27787,39770:27789,39771:27790,39772:27793,39773:27794,39774:27797,39775:27798,39776:27799,39777:27800,39778:27802,39779:27804,39780:27805,39781:27806,39782:27808,39783:27810,39784:27816,39785:27820,39786:27823,39787:27824,39788:27828,39789:27829,39790:27830,39791:27831,39792:27834,39793:27840,39794:27841,39795:27842,39796:27843,39797:27846,39798:27847,39799:27848,39800:27851,39801:27853,39802:27854,39803:27855,39804:27857,39805:27858,39806:27864,39808:27865,39809:27866,39810:27868,39811:27869,39812:27871,39813:27876,39814:27878,39815:27879,39816:27881,39817:27884,39818:27885,39819:27890,39820:27892,39821:27897,39822:27903,39823:27904,39824:27906,39825:27907,39826:27909,39827:27910,39828:27912,39829:27913,39830:27914,39831:27917,39832:27919,39833:27920,39834:27921,39835:27923,39836:27924,39837:27925,39838:27926,39839:27928,39840:27932,39841:27933,39842:27935,39843:27936,39844:27937,39845:27938,39846:27939,39847:27940,39848:27942,39849:27944,39850:27945,39851:27948,39852:27949,39853:27951,39854:27952,39855:27956,39856:27958,39857:27959,39858:27960,39859:27962,39860:27967,39861:27968,39862:27970,39863:27972,39864:27977,39865:27980,39866:27984,39867:27989,39868:27990,39869:27991,39870:27992,39871:27995,39872:27997,39873:27999,39874:28001,39875:28002,39876:28004,39877:28005,39878:28007,39879:28008,39880:28011,39881:28012,39882:28013,39883:28016,39884:28017,39885:28018,39886:28019,39887:28021,39888:28022,39889:28025,39890:28026,39891:28027,39892:28029,39893:28030,39894:28031,39895:28032,39896:28033,39897:28035,39898:28036,39899:28038,39900:28039,39901:28042,39902:28043,39903:28045,39904:28047,39905:28048,39906:28050,39907:28054,39908:28055,39909:28056,39910:28057,39911:28058,39912:28060,39913:28066,39914:28069,39915:28076,39916:28077,39917:28080,39918:28081,39919:28083,39920:28084,39921:28086,39922:28087,39923:28089,39924:28090,39925:28091,39926:28092,39927:28093,39928:28094,39929:28097,39930:28098,39931:28099,39932:28104,39933:28105,39934:28106,40000:28109,40001:28110,40002:28111,40003:28112,40004:28114,40005:28115,40006:28116,40007:28117,40008:28119,40009:28122,40010:28123,40011:28124,40012:28127,40013:28130,40014:28131,40015:28133,40016:28135,40017:28136,40018:28137,40019:28138,40020:28141,40021:28143,40022:28144,40023:28146,40024:28148,40025:28149,40026:28150,40027:28152,40028:28154,40029:28157,40030:28158,40031:28159,40032:28160,40033:28161,40034:28162,40035:28163,40036:28164,40037:28166,40038:28167,40039:28168,40040:28169,40041:28171,40042:28175,40043:28178,40044:28179,40045:28181,40046:28184,40047:28185,40048:28187,40049:28188,40050:28190,40051:28191,40052:28194,40053:28198,40054:28199,40055:28200,40056:28202,40057:28204,40058:28206,40059:28208,40060:28209,40061:28211,40062:28213,40064:28214,40065:28215,40066:28217,40067:28219,40068:28220,40069:28221,40070:28222,40071:28223,40072:28224,40073:28225,40074:28226,40075:28229,40076:28230,40077:28231,40078:28232,40079:28233,40080:28234,40081:28235,40082:28236,40083:28239,40084:28240,40085:28241,40086:28242,40087:28245,40088:28247,40089:28249,40090:28250,40091:28252,40092:28253,40093:28254,40094:28256,40095:28257,40096:28258,40097:28259,40098:28260,40099:28261,40100:28262,40101:28263,40102:28264,40103:28265,40104:28266,40105:28268,40106:28269,40107:28271,40108:28272,40109:28273,40110:28274,40111:28275,40112:28276,40113:28277,40114:28278,40115:28279,40116:28280,40117:28281,40118:28282,40119:28283,40120:28284,40121:28285,40122:28288,40123:28289,40124:28290,40125:28292,40126:28295,40127:28296,40128:28298,40129:28299,40130:28300,40131:28301,40132:28302,40133:28305,40134:28306,40135:28307,40136:28308,40137:28309,40138:28310,40139:28311,40140:28313,40141:28314,40142:28315,40143:28317,40144:28318,40145:28320,40146:28321,40147:28323,40148:28324,40149:28326,40150:28328,40151:28329,40152:28331,40153:28332,40154:28333,40155:28334,40156:28336,40157:28339,40158:28341,40159:28344,40160:28345,40161:28348,40162:28350,40163:28351,40164:28352,40165:28355,40166:28356,40167:28357,40168:28358,40169:28360,40170:28361,40171:28362,40172:28364,40173:28365,40174:28366,40175:28368,40176:28370,40177:28374,40178:28376,40179:28377,40180:28379,40181:28380,40182:28381,40183:28387,40184:28391,40185:28394,40186:28395,40187:28396,40188:28397,40189:28398,40190:28399,40256:28400,40257:28401,40258:28402,40259:28403,40260:28405,40261:28406,40262:28407,40263:28408,40264:28410,40265:28411,40266:28412,40267:28413,40268:28414,40269:28415,40270:28416,40271:28417,40272:28419,40273:28420,40274:28421,40275:28423,40276:28424,40277:28426,40278:28427,40279:28428,40280:28429,40281:28430,40282:28432,40283:28433,40284:28434,40285:28438,40286:28439,40287:28440,40288:28441,40289:28442,40290:28443,40291:28444,40292:28445,40293:28446,40294:28447,40295:28449,40296:28450,40297:28451,40298:28453,40299:28454,40300:28455,40301:28456,40302:28460,40303:28462,40304:28464,40305:28466,40306:28468,40307:28469,40308:28471,40309:28472,40310:28473,40311:28474,40312:28475,40313:28476,40314:28477,40315:28479,40316:28480,40317:28481,40318:28482,40320:28483,40321:28484,40322:28485,40323:28488,40324:28489,40325:28490,40326:28492,40327:28494,40328:28495,40329:28496,40330:28497,40331:28498,40332:28499,40333:28500,40334:28501,40335:28502,40336:28503,40337:28505,40338:28506,40339:28507,40340:28509,40341:28511,40342:28512,40343:28513,40344:28515,40345:28516,40346:28517,40347:28519,40348:28520,40349:28521,40350:28522,40351:28523,40352:28524,40353:28527,40354:28528,40355:28529,40356:28531,40357:28533,40358:28534,40359:28535,40360:28537,40361:28539,40362:28541,40363:28542,40364:28543,40365:28544,40366:28545,40367:28546,40368:28547,40369:28549,40370:28550,40371:28551,40372:28554,40373:28555,40374:28559,40375:28560,40376:28561,40377:28562,40378:28563,40379:28564,40380:28565,40381:28566,40382:28567,40383:28568,40384:28569,40385:28570,40386:28571,40387:28573,40388:28574,40389:28575,40390:28576,40391:28578,40392:28579,40393:28580,40394:28581,40395:28582,40396:28584,40397:28585,40398:28586,40399:28587,40400:28588,40401:28589,40402:28590,40403:28591,40404:28592,40405:28593,40406:28594,40407:28596,40408:28597,40409:28599,40410:28600,40411:28602,40412:28603,40413:28604,40414:28605,40415:28606,40416:28607,40417:28609,40418:28611,40419:28612,40420:28613,40421:28614,40422:28615,40423:28616,40424:28618,40425:28619,40426:28620,40427:28621,40428:28622,40429:28623,40430:28624,40431:28627,40432:28628,40433:28629,40434:28630,40435:28631,40436:28632,40437:28633,40438:28634,40439:28635,40440:28636,40441:28637,40442:28639,40443:28642,40444:28643,40445:28644,40446:28645,40512:28646,40513:28647,40514:28648,40515:28649,40516:28650,40517:28651,40518:28652,40519:28653,40520:28656,40521:28657,40522:28658,40523:28659,40524:28660,40525:28661,40526:28662,40527:28663,40528:28664,40529:28665,40530:28666,40531:28667,40532:28668,40533:28669,40534:28670,40535:28671,40536:28672,40537:28673,40538:28674,40539:28675,40540:28676,40541:28677,40542:28678,40543:28679,40544:28680,40545:28681,40546:28682,40547:28683,40548:28684,40549:28685,40550:28686,40551:28687,40552:28688,40553:28690,40554:28691,40555:28692,40556:28693,40557:28694,40558:28695,40559:28696,40560:28697,40561:28700,40562:28701,40563:28702,40564:28703,40565:28704,40566:28705,40567:28706,40568:28708,40569:28709,40570:28710,40571:28711,40572:28712,40573:28713,40574:28714,40576:28715,40577:28716,40578:28717,40579:28718,40580:28719,40581:28720,40582:28721,40583:28722,40584:28723,40585:28724,40586:28726,40587:28727,40588:28728,40589:28730,40590:28731,40591:28732,40592:28733,40593:28734,40594:28735,40595:28736,40596:28737,40597:28738,40598:28739,40599:28740,40600:28741,40601:28742,40602:28743,40603:28744,40604:28745,40605:28746,40606:28747,40607:28749,40608:28750,40609:28752,40610:28753,40611:28754,40612:28755,40613:28756,40614:28757,40615:28758,40616:28759,40617:28760,40618:28761,40619:28762,40620:28763,40621:28764,40622:28765,40623:28767,40624:28768,40625:28769,40626:28770,40627:28771,40628:28772,40629:28773,40630:28774,40631:28775,40632:28776,40633:28777,40634:28778,40635:28782,40636:28785,40637:28786,40638:28787,40639:28788,40640:28791,40641:28793,40642:28794,40643:28795,40644:28797,40645:28801,40646:28802,40647:28803,40648:28804,40649:28806,40650:28807,40651:28808,40652:28811,40653:28812,40654:28813,40655:28815,40656:28816,40657:28817,40658:28819,40659:28823,40660:28824,40661:28826,40662:28827,40663:28830,40664:28831,40665:28832,40666:28833,40667:28834,40668:28835,40669:28836,40670:28837,40671:28838,40672:28839,40673:28840,40674:28841,40675:28842,40676:28848,40677:28850,40678:28852,40679:28853,40680:28854,40681:28858,40682:28862,40683:28863,40684:28868,40685:28869,40686:28870,40687:28871,40688:28873,40689:28875,40690:28876,40691:28877,40692:28878,40693:28879,40694:28880,40695:28881,40696:28882,40697:28883,40698:28884,40699:28885,40700:28886,40701:28887,40702:28890,40768:28892,40769:28893,40770:28894,40771:28896,40772:28897,40773:28898,40774:28899,40775:28901,40776:28906,40777:28910,40778:28912,40779:28913,40780:28914,40781:28915,40782:28916,40783:28917,40784:28918,40785:28920,40786:28922,40787:28923,40788:28924,40789:28926,40790:28927,40791:28928,40792:28929,40793:28930,40794:28931,40795:28932,40796:28933,40797:28934,40798:28935,40799:28936,40800:28939,40801:28940,40802:28941,40803:28942,40804:28943,40805:28945,40806:28946,40807:28948,40808:28951,40809:28955,40810:28956,40811:28957,40812:28958,40813:28959,40814:28960,40815:28961,40816:28962,40817:28963,40818:28964,40819:28965,40820:28967,40821:28968,40822:28969,40823:28970,40824:28971,40825:28972,40826:28973,40827:28974,40828:28978,40829:28979,40830:28980,40832:28981,40833:28983,40834:28984,40835:28985,40836:28986,40837:28987,40838:28988,40839:28989,40840:28990,40841:28991,40842:28992,40843:28993,40844:28994,40845:28995,40846:28996,40847:28998,40848:28999,40849:29000,40850:29001,40851:29003,40852:29005,40853:29007,40854:29008,40855:29009,40856:29010,40857:29011,40858:29012,40859:29013,40860:29014,40861:29015,40862:29016,40863:29017,40864:29018,40865:29019,40866:29021,40867:29023,40868:29024,40869:29025,40870:29026,40871:29027,40872:29029,40873:29033,40874:29034,40875:29035,40876:29036,40877:29037,40878:29039,40879:29040,40880:29041,40881:29044,40882:29045,40883:29046,40884:29047,40885:29049,40886:29051,40887:29052,40888:29054,40889:29055,40890:29056,40891:29057,40892:29058,40893:29059,40894:29061,40895:29062,40896:29063,40897:29064,40898:29065,40899:29067,40900:29068,40901:29069,40902:29070,40903:29072,40904:29073,40905:29074,40906:29075,40907:29077,40908:29078,40909:29079,40910:29082,40911:29083,40912:29084,40913:29085,40914:29086,40915:29089,40916:29090,40917:29091,40918:29092,40919:29093,40920:29094,40921:29095,40922:29097,40923:29098,40924:29099,40925:29101,40926:29102,40927:29103,40928:29104,40929:29105,40930:29106,40931:29108,40932:29110,40933:29111,40934:29112,40935:29114,40936:29115,40937:29116,40938:29117,40939:29118,40940:29119,40941:29120,40942:29121,40943:29122,40944:29124,40945:29125,40946:29126,40947:29127,40948:29128,40949:29129,40950:29130,40951:29131,40952:29132,40953:29133,40954:29135,40955:29136,40956:29137,40957:29138,40958:29139,41024:29142,41025:29143,41026:29144,41027:29145,41028:29146,41029:29147,41030:29148,41031:29149,41032:29150,41033:29151,41034:29153,41035:29154,41036:29155,41037:29156,41038:29158,41039:29160,41040:29161,41041:29162,41042:29163,41043:29164,41044:29165,41045:29167,41046:29168,41047:29169,41048:29170,41049:29171,41050:29172,41051:29173,41052:29174,41053:29175,41054:29176,41055:29178,41056:29179,41057:29180,41058:29181,41059:29182,41060:29183,41061:29184,41062:29185,41063:29186,41064:29187,41065:29188,41066:29189,41067:29191,41068:29192,41069:29193,41070:29194,41071:29195,41072:29196,41073:29197,41074:29198,41075:29199,41076:29200,41077:29201,41078:29202,41079:29203,41080:29204,41081:29205,41082:29206,41083:29207,41084:29208,41085:29209,41086:29210,41088:29211,41089:29212,41090:29214,41091:29215,41092:29216,41093:29217,41094:29218,41095:29219,41096:29220,41097:29221,41098:29222,41099:29223,41100:29225,41101:29227,41102:29229,41103:29230,41104:29231,41105:29234,41106:29235,41107:29236,41108:29242,41109:29244,41110:29246,41111:29248,41112:29249,41113:29250,41114:29251,41115:29252,41116:29253,41117:29254,41118:29257,41119:29258,41120:29259,41121:29262,41122:29263,41123:29264,41124:29265,41125:29267,41126:29268,41127:29269,41128:29271,41129:29272,41130:29274,41131:29276,41132:29278,41133:29280,41134:29283,41135:29284,41136:29285,41137:29288,41138:29290,41139:29291,41140:29292,41141:29293,41142:29296,41143:29297,41144:29299,41145:29300,41146:29302,41147:29303,41148:29304,41149:29307,41150:29308,41151:29309,41152:29314,41153:29315,41154:29317,41155:29318,41156:29319,41157:29320,41158:29321,41159:29324,41160:29326,41161:29328,41162:29329,41163:29331,41164:29332,41165:29333,41166:29334,41167:29335,41168:29336,41169:29337,41170:29338,41171:29339,41172:29340,41173:29341,41174:29342,41175:29344,41176:29345,41177:29346,41178:29347,41179:29348,41180:29349,41181:29350,41182:29351,41183:29352,41184:29353,41185:29354,41186:29355,41187:29358,41188:29361,41189:29362,41190:29363,41191:29365,41192:29370,41193:29371,41194:29372,41195:29373,41196:29374,41197:29375,41198:29376,41199:29381,41200:29382,41201:29383,41202:29385,41203:29386,41204:29387,41205:29388,41206:29391,41207:29393,41208:29395,41209:29396,41210:29397,41211:29398,41212:29400,41213:29402,41214:29403,41280:58566,41281:58567,41282:58568,41283:58569,41284:58570,41285:58571,41286:58572,41287:58573,41288:58574,41289:58575,41290:58576,41291:58577,41292:58578,41293:58579,41294:58580,41295:58581,41296:58582,41297:58583,41298:58584,41299:58585,41300:58586,41301:58587,41302:58588,41303:58589,41304:58590,41305:58591,41306:58592,41307:58593,41308:58594,41309:58595,41310:58596,41311:58597,41312:58598,41313:58599,41314:58600,41315:58601,41316:58602,41317:58603,41318:58604,41319:58605,41320:58606,41321:58607,41322:58608,41323:58609,41324:58610,41325:58611,41326:58612,41327:58613,41328:58614,41329:58615,41330:58616,41331:58617,41332:58618,41333:58619,41334:58620,41335:58621,41336:58622,41337:58623,41338:58624,41339:58625,41340:58626,41341:58627,41342:58628,41344:58629,41345:58630,41346:58631,41347:58632,41348:58633,41349:58634,41350:58635,41351:58636,41352:58637,41353:58638,41354:58639,41355:58640,41356:58641,41357:58642,41358:58643,41359:58644,41360:58645,41361:58646,41362:58647,41363:58648,41364:58649,41365:58650,41366:58651,41367:58652,41368:58653,41369:58654,41370:58655,41371:58656,41372:58657,41373:58658,41374:58659,41375:58660,41376:58661,41377:12288,41378:12289,41379:12290,41380:183,41381:713,41382:711,41383:168,41384:12291,41385:12293,41386:8212,41387:65374,41388:8214,41389:8230,41390:8216,41391:8217,41392:8220,41393:8221,41394:12308,41395:12309,41396:12296,41397:12297,41398:12298,41399:12299,41400:12300,41401:12301,41402:12302,41403:12303,41404:12310,41405:12311,41406:12304,41407:12305,41408:177,41409:215,41410:247,41411:8758,41412:8743,41413:8744,41414:8721,41415:8719,41416:8746,41417:8745,41418:8712,41419:8759,41420:8730,41421:8869,41422:8741,41423:8736,41424:8978,41425:8857,41426:8747,41427:8750,41428:8801,41429:8780,41430:8776,41431:8765,41432:8733,41433:8800,41434:8814,41435:8815,41436:8804,41437:8805,41438:8734,41439:8757,41440:8756,41441:9794,41442:9792,41443:176,41444:8242,41445:8243,41446:8451,41447:65284,41448:164,41449:65504,41450:65505,41451:8240,41452:167,41453:8470,41454:9734,41455:9733,41456:9675,41457:9679,41458:9678,41459:9671,41460:9670,41461:9633,41462:9632,41463:9651,41464:9650,41465:8251,41466:8594,41467:8592,41468:8593,41469:8595,41470:12307,41536:58662,41537:58663,41538:58664,41539:58665,41540:58666,41541:58667,41542:58668,41543:58669,41544:58670,41545:58671,41546:58672,41547:58673,41548:58674,41549:58675,41550:58676,41551:58677,41552:58678,41553:58679,41554:58680,41555:58681,41556:58682,41557:58683,41558:58684,41559:58685,41560:58686,41561:58687,41562:58688,41563:58689,41564:58690,41565:58691,41566:58692,41567:58693,41568:58694,41569:58695,41570:58696,41571:58697,41572:58698,41573:58699,41574:58700,41575:58701,41576:58702,41577:58703,41578:58704,41579:58705,41580:58706,41581:58707,41582:58708,41583:58709,41584:58710,41585:58711,41586:58712,41587:58713,41588:58714,41589:58715,41590:58716,41591:58717,41592:58718,41593:58719,41594:58720,41595:58721,41596:58722,41597:58723,41598:58724,41600:58725,41601:58726,41602:58727,41603:58728,41604:58729,41605:58730,41606:58731,41607:58732,41608:58733,41609:58734,41610:58735,41611:58736,41612:58737,41613:58738,41614:58739,41615:58740,41616:58741,41617:58742,41618:58743,41619:58744,41620:58745,41621:58746,41622:58747,41623:58748,41624:58749,41625:58750,41626:58751,41627:58752,41628:58753,41629:58754,41630:58755,41631:58756,41632:58757,41633:8560,41634:8561,41635:8562,41636:8563,41637:8564,41638:8565,41639:8566,41640:8567,41641:8568,41642:8569,41643:59238,41644:59239,41645:59240,41646:59241,41647:59242,41648:59243,41649:9352,41650:9353,41651:9354,41652:9355,41653:9356,41654:9357,41655:9358,41656:9359,41657:9360,41658:9361,41659:9362,41660:9363,41661:9364,41662:9365,41663:9366,41664:9367,41665:9368,41666:9369,41667:9370,41668:9371,41669:9332,41670:9333,41671:9334,41672:9335,41673:9336,41674:9337,41675:9338,41676:9339,41677:9340,41678:9341,41679:9342,41680:9343,41681:9344,41682:9345,41683:9346,41684:9347,41685:9348,41686:9349,41687:9350,41688:9351,41689:9312,41690:9313,41691:9314,41692:9315,41693:9316,41694:9317,41695:9318,41696:9319,41697:9320,41698:9321,41699:8364,41700:59245,41701:12832,41702:12833,41703:12834,41704:12835,41705:12836,41706:12837,41707:12838,41708:12839,41709:12840,41710:12841,41711:59246,41712:59247,41713:8544,41714:8545,41715:8546,41716:8547,41717:8548,41718:8549,41719:8550,41720:8551,41721:8552,41722:8553,41723:8554,41724:8555,41725:59248,41726:59249,41792:58758,41793:58759,41794:58760,41795:58761,41796:58762,41797:58763,41798:58764,41799:58765,41800:58766,41801:58767,41802:58768,41803:58769,41804:58770,41805:58771,41806:58772,41807:58773,41808:58774,41809:58775,41810:58776,41811:58777,41812:58778,41813:58779,41814:58780,41815:58781,41816:58782,41817:58783,41818:58784,41819:58785,41820:58786,41821:58787,41822:58788,41823:58789,41824:58790,41825:58791,41826:58792,41827:58793,41828:58794,41829:58795,41830:58796,41831:58797,41832:58798,41833:58799,41834:58800,41835:58801,41836:58802,41837:58803,41838:58804,41839:58805,41840:58806,41841:58807,41842:58808,41843:58809,41844:58810,41845:58811,41846:58812,41847:58813,41848:58814,41849:58815,41850:58816,41851:58817,41852:58818,41853:58819,41854:58820,41856:58821,41857:58822,41858:58823,41859:58824,41860:58825,41861:58826,41862:58827,41863:58828,41864:58829,41865:58830,41866:58831,41867:58832,41868:58833,41869:58834,41870:58835,41871:58836,41872:58837,41873:58838,41874:58839,41875:58840,41876:58841,41877:58842,41878:58843,41879:58844,41880:58845,41881:58846,41882:58847,41883:58848,41884:58849,41885:58850,41886:58851,41887:58852,41888:58853,41889:65281,41890:65282,41891:65283,41892:65509,41893:65285,41894:65286,41895:65287,41896:65288,41897:65289,41898:65290,41899:65291,41900:65292,41901:65293,41902:65294,41903:65295,41904:65296,41905:65297,41906:65298,41907:65299,41908:65300,41909:65301,41910:65302,41911:65303,41912:65304,41913:65305,41914:65306,41915:65307,41916:65308,41917:65309,41918:65310,41919:65311,41920:65312,41921:65313,41922:65314,41923:65315,41924:65316,41925:65317,41926:65318,41927:65319,41928:65320,41929:65321,41930:65322,41931:65323,41932:65324,41933:65325,41934:65326,41935:65327,41936:65328,41937:65329,41938:65330,41939:65331,41940:65332,41941:65333,41942:65334,41943:65335,41944:65336,41945:65337,41946:65338,41947:65339,41948:65340,41949:65341,41950:65342,41951:65343,41952:65344,41953:65345,41954:65346,41955:65347,41956:65348,41957:65349,41958:65350,41959:65351,41960:65352,41961:65353,41962:65354,41963:65355,41964:65356,41965:65357,41966:65358,41967:65359,41968:65360,41969:65361,41970:65362,41971:65363,41972:65364,41973:65365,41974:65366,41975:65367,41976:65368,41977:65369,41978:65370,41979:65371,41980:65372,41981:65373,41982:65507,42048:58854,42049:58855,42050:58856,42051:58857,42052:58858,42053:58859,42054:58860,42055:58861,42056:58862,42057:58863,42058:58864,42059:58865,42060:58866,42061:58867,42062:58868,42063:58869,42064:58870,42065:58871,42066:58872,42067:58873,42068:58874,42069:58875,42070:58876,42071:58877,42072:58878,42073:58879,42074:58880,42075:58881,42076:58882,42077:58883,42078:58884,42079:58885,42080:58886,42081:58887,42082:58888,42083:58889,42084:58890,42085:58891,42086:58892,42087:58893,42088:58894,42089:58895,42090:58896,42091:58897,42092:58898,42093:58899,42094:58900,42095:58901,42096:58902,42097:58903,42098:58904,42099:58905,42100:58906,42101:58907,42102:58908,42103:58909,42104:58910,42105:58911,42106:58912,42107:58913,42108:58914,42109:58915,42110:58916,42112:58917,42113:58918,42114:58919,42115:58920,42116:58921,42117:58922,42118:58923,42119:58924,42120:58925,42121:58926,42122:58927,42123:58928,42124:58929,42125:58930,42126:58931,42127:58932,42128:58933,42129:58934,42130:58935,42131:58936,42132:58937,42133:58938,42134:58939,42135:58940,42136:58941,42137:58942,42138:58943,42139:58944,42140:58945,42141:58946,42142:58947,42143:58948,42144:58949,42145:12353,42146:12354,42147:12355,42148:12356,42149:12357,42150:12358,42151:12359,42152:12360,42153:12361,42154:12362,42155:12363,42156:12364,42157:12365,42158:12366,42159:12367,42160:12368,42161:12369,42162:12370,42163:12371,42164:12372,42165:12373,42166:12374,42167:12375,42168:12376,42169:12377,42170:12378,42171:12379,42172:12380,42173:12381,42174:12382,42175:12383,42176:12384,42177:12385,42178:12386,42179:12387,42180:12388,42181:12389,42182:12390,42183:12391,42184:12392,42185:12393,42186:12394,42187:12395,42188:12396,42189:12397,42190:12398,42191:12399,42192:12400,42193:12401,42194:12402,42195:12403,42196:12404,42197:12405,42198:12406,42199:12407,42200:12408,42201:12409,42202:12410,42203:12411,42204:12412,42205:12413,42206:12414,42207:12415,42208:12416,42209:12417,42210:12418,42211:12419,42212:12420,42213:12421,42214:12422,42215:12423,42216:12424,42217:12425,42218:12426,42219:12427,42220:12428,42221:12429,42222:12430,42223:12431,42224:12432,42225:12433,42226:12434,42227:12435,42228:59250,42229:59251,42230:59252,42231:59253,42232:59254,42233:59255,42234:59256,42235:59257,42236:59258,42237:59259,42238:59260,42304:58950,42305:58951,42306:58952,42307:58953,42308:58954,42309:58955,42310:58956,42311:58957,42312:58958,42313:58959,42314:58960,42315:58961,42316:58962,42317:58963,42318:58964,42319:58965,42320:58966,42321:58967,42322:58968,42323:58969,42324:58970,42325:58971,42326:58972,42327:58973,42328:58974,42329:58975,42330:58976,42331:58977,42332:58978,42333:58979,42334:58980,42335:58981,42336:58982,42337:58983,42338:58984,42339:58985,42340:58986,42341:58987,42342:58988,42343:58989,42344:58990,42345:58991,42346:58992,42347:58993,42348:58994,42349:58995,42350:58996,42351:58997,42352:58998,42353:58999,42354:59000,42355:59001,42356:59002,42357:59003,42358:59004,42359:59005,42360:59006,42361:59007,42362:59008,42363:59009,42364:59010,42365:59011,42366:59012,42368:59013,42369:59014,42370:59015,42371:59016,42372:59017,42373:59018,42374:59019,42375:59020,42376:59021,42377:59022,42378:59023,42379:59024,42380:59025,42381:59026,42382:59027,42383:59028,42384:59029,42385:59030,42386:59031,42387:59032,42388:59033,42389:59034,42390:59035,42391:59036,42392:59037,42393:59038,42394:59039,42395:59040,42396:59041,42397:59042,42398:59043,42399:59044,42400:59045,42401:12449,42402:12450,42403:12451,42404:12452,42405:12453,42406:12454,42407:12455,42408:12456,42409:12457,42410:12458,42411:12459,42412:12460,42413:12461,42414:12462,42415:12463,42416:12464,42417:12465,42418:12466,42419:12467,42420:12468,42421:12469,42422:12470,42423:12471,42424:12472,42425:12473,42426:12474,42427:12475,42428:12476,42429:12477,42430:12478,42431:12479,42432:12480,42433:12481,42434:12482,42435:12483,42436:12484,42437:12485,42438:12486,42439:12487,42440:12488,42441:12489,42442:12490,42443:12491,42444:12492,42445:12493,42446:12494,42447:12495,42448:12496,42449:12497,42450:12498,42451:12499,42452:12500,42453:12501,42454:12502,42455:12503,42456:12504,42457:12505,42458:12506,42459:12507,42460:12508,42461:12509,42462:12510,42463:12511,42464:12512,42465:12513,42466:12514,42467:12515,42468:12516,42469:12517,42470:12518,42471:12519,42472:12520,42473:12521,42474:12522,42475:12523,42476:12524,42477:12525,42478:12526,42479:12527,42480:12528,42481:12529,42482:12530,42483:12531,42484:12532,42485:12533,42486:12534,42487:59261,42488:59262,42489:59263,42490:59264,42491:59265,42492:59266,42493:59267,42494:59268,42560:59046,42561:59047,42562:59048,42563:59049,42564:59050,42565:59051,42566:59052,42567:59053,42568:59054,42569:59055,42570:59056,42571:59057,42572:59058,42573:59059,42574:59060,42575:59061,42576:59062,42577:59063,42578:59064,42579:59065,42580:59066,42581:59067,42582:59068,42583:59069,42584:59070,42585:59071,42586:59072,42587:59073,42588:59074,42589:59075,42590:59076,42591:59077,42592:59078,42593:59079,42594:59080,42595:59081,42596:59082,42597:59083,42598:59084,42599:59085,42600:59086,42601:59087,42602:59088,42603:59089,42604:59090,42605:59091,42606:59092,42607:59093,42608:59094,42609:59095,42610:59096,42611:59097,42612:59098,42613:59099,42614:59100,42615:59101,42616:59102,42617:59103,42618:59104,42619:59105,42620:59106,42621:59107,42622:59108,42624:59109,42625:59110,42626:59111,42627:59112,42628:59113,42629:59114,42630:59115,42631:59116,42632:59117,42633:59118,42634:59119,42635:59120,42636:59121,42637:59122,42638:59123,42639:59124,42640:59125,42641:59126,42642:59127,42643:59128,42644:59129,42645:59130,42646:59131,42647:59132,42648:59133,42649:59134,42650:59135,42651:59136,42652:59137,42653:59138,42654:59139,42655:59140,42656:59141,42657:913,42658:914,42659:915,42660:916,42661:917,42662:918,42663:919,42664:920,42665:921,42666:922,42667:923,42668:924,42669:925,42670:926,42671:927,42672:928,42673:929,42674:931,42675:932,42676:933,42677:934,42678:935,42679:936,42680:937,42681:59269,42682:59270,42683:59271,42684:59272,42685:59273,42686:59274,42687:59275,42688:59276,42689:945,42690:946,42691:947,42692:948,42693:949,42694:950,42695:951,42696:952,42697:953,42698:954,42699:955,42700:956,42701:957,42702:958,42703:959,42704:960,42705:961,42706:963,42707:964,42708:965,42709:966,42710:967,42711:968,42712:969,42713:59277,42714:59278,42715:59279,42716:59280,42717:59281,42718:59282,42719:59283,42720:65077,42721:65078,42722:65081,42723:65082,42724:65087,42725:65088,42726:65085,42727:65086,42728:65089,42729:65090,42730:65091,42731:65092,42732:59284,42733:59285,42734:65083,42735:65084,42736:65079,42737:65080,42738:65073,42739:59286,42740:65075,42741:65076,42742:59287,42743:59288,42744:59289,42745:59290,42746:59291,42747:59292,42748:59293,42749:59294,42750:59295,42816:59142,42817:59143,42818:59144,42819:59145,42820:59146,42821:59147,42822:59148,42823:59149,42824:59150,42825:59151,42826:59152,42827:59153,42828:59154,42829:59155,42830:59156,42831:59157,42832:59158,42833:59159,42834:59160,42835:59161,42836:59162,42837:59163,42838:59164,42839:59165,42840:59166,42841:59167,42842:59168,42843:59169,42844:59170,42845:59171,42846:59172,42847:59173,42848:59174,42849:59175,42850:59176,42851:59177,42852:59178,42853:59179,42854:59180,42855:59181,42856:59182,42857:59183,42858:59184,42859:59185,42860:59186,42861:59187,42862:59188,42863:59189,42864:59190,42865:59191,42866:59192,42867:59193,42868:59194,42869:59195,42870:59196,42871:59197,42872:59198,42873:59199,42874:59200,42875:59201,42876:59202,42877:59203,42878:59204,42880:59205,42881:59206,42882:59207,42883:59208,42884:59209,42885:59210,42886:59211,42887:59212,42888:59213,42889:59214,42890:59215,42891:59216,42892:59217,42893:59218,42894:59219,42895:59220,42896:59221,42897:59222,42898:59223,42899:59224,42900:59225,42901:59226,42902:59227,42903:59228,42904:59229,42905:59230,42906:59231,42907:59232,42908:59233,42909:59234,42910:59235,42911:59236,42912:59237,42913:1040,42914:1041,42915:1042,42916:1043,42917:1044,42918:1045,42919:1025,42920:1046,42921:1047,42922:1048,42923:1049,42924:1050,42925:1051,42926:1052,42927:1053,42928:1054,42929:1055,42930:1056,42931:1057,42932:1058,42933:1059,42934:1060,42935:1061,42936:1062,42937:1063,42938:1064,42939:1065,42940:1066,42941:1067,42942:1068,42943:1069,42944:1070,42945:1071,42946:59296,42947:59297,42948:59298,42949:59299,42950:59300,42951:59301,42952:59302,42953:59303,42954:59304,42955:59305,42956:59306,42957:59307,42958:59308,42959:59309,42960:59310,42961:1072,42962:1073,42963:1074,42964:1075,42965:1076,42966:1077,42967:1105,42968:1078,42969:1079,42970:1080,42971:1081,42972:1082,42973:1083,42974:1084,42975:1085,42976:1086,42977:1087,42978:1088,42979:1089,42980:1090,42981:1091,42982:1092,42983:1093,42984:1094,42985:1095,42986:1096,42987:1097,42988:1098,42989:1099,42990:1100,42991:1101,42992:1102,42993:1103,42994:59311,42995:59312,42996:59313,42997:59314,42998:59315,42999:59316,43000:59317,43001:59318,43002:59319,43003:59320,43004:59321,43005:59322,43006:59323,43072:714,43073:715,43074:729,43075:8211,43076:8213,43077:8229,43078:8245,43079:8453,43080:8457,43081:8598,43082:8599,43083:8600,43084:8601,43085:8725,43086:8735,43087:8739,43088:8786,43089:8806,43090:8807,43091:8895,43092:9552,43093:9553,43094:9554,43095:9555,43096:9556,43097:9557,43098:9558,43099:9559,43100:9560,43101:9561,43102:9562,43103:9563,43104:9564,43105:9565,43106:9566,43107:9567,43108:9568,43109:9569,43110:9570,43111:9571,43112:9572,43113:9573,43114:9574,43115:9575,43116:9576,43117:9577,43118:9578,43119:9579,43120:9580,43121:9581,43122:9582,43123:9583,43124:9584,43125:9585,43126:9586,43127:9587,43128:9601,43129:9602,43130:9603,43131:9604,43132:9605,43133:9606,43134:9607,43136:9608,43137:9609,43138:9610,43139:9611,43140:9612,43141:9613,43142:9614,43143:9615,43144:9619,43145:9620,43146:9621,43147:9660,43148:9661,43149:9698,43150:9699,43151:9700,43152:9701,43153:9737,43154:8853,43155:12306,43156:12317,43157:12318,43158:59324,43159:59325,43160:59326,43161:59327,43162:59328,43163:59329,43164:59330,43165:59331,43166:59332,43167:59333,43168:59334,43169:257,43170:225,43171:462,43172:224,43173:275,43174:233,43175:283,43176:232,43177:299,43178:237,43179:464,43180:236,43181:333,43182:243,43183:466,43184:242,43185:363,43186:250,43187:468,43188:249,43189:470,43190:472,43191:474,43192:476,43193:252,43194:234,43195:593,43196:59335,43197:324,43198:328,43199:505,43200:609,43201:59337,43202:59338,43203:59339,43204:59340,43205:12549,43206:12550,43207:12551,43208:12552,43209:12553,43210:12554,43211:12555,43212:12556,43213:12557,43214:12558,43215:12559,43216:12560,43217:12561,43218:12562,43219:12563,43220:12564,43221:12565,43222:12566,43223:12567,43224:12568,43225:12569,43226:12570,43227:12571,43228:12572,43229:12573,43230:12574,43231:12575,43232:12576,43233:12577,43234:12578,43235:12579,43236:12580,43237:12581,43238:12582,43239:12583,43240:12584,43241:12585,43242:59341,43243:59342,43244:59343,43245:59344,43246:59345,43247:59346,43248:59347,43249:59348,43250:59349,43251:59350,43252:59351,43253:59352,43254:59353,43255:59354,43256:59355,43257:59356,43258:59357,43259:59358,43260:59359,43261:59360,43262:59361,43328:12321,43329:12322,43330:12323,43331:12324,43332:12325,43333:12326,43334:12327,43335:12328,43336:12329,43337:12963,43338:13198,43339:13199,43340:13212,43341:13213,43342:13214,43343:13217,43344:13252,43345:13262,43346:13265,43347:13266,43348:13269,43349:65072,43350:65506,43351:65508,43352:59362,43353:8481,43354:12849,43355:59363,43356:8208,43357:59364,43358:59365,43359:59366,43360:12540,43361:12443,43362:12444,43363:12541,43364:12542,43365:12294,43366:12445,43367:12446,43368:65097,43369:65098,43370:65099,43371:65100,43372:65101,43373:65102,43374:65103,43375:65104,43376:65105,43377:65106,43378:65108,43379:65109,43380:65110,43381:65111,43382:65113,43383:65114,43384:65115,43385:65116,43386:65117,43387:65118,43388:65119,43389:65120,43390:65121,43392:65122,43393:65123,43394:65124,43395:65125,43396:65126,43397:65128,43398:65129,43399:65130,43400:65131,43401:12350,43402:12272,43403:12273,43404:12274,43405:12275,43406:12276,43407:12277,43408:12278,43409:12279,43410:12280,43411:12281,43412:12282,43413:12283,43414:12295,43415:59380,43416:59381,43417:59382,43418:59383,43419:59384,43420:59385,43421:59386,43422:59387,43423:59388,43424:59389,43425:59390,43426:59391,43427:59392,43428:9472,43429:9473,43430:9474,43431:9475,43432:9476,43433:9477,43434:9478,43435:9479,43436:9480,43437:9481,43438:9482,43439:9483,43440:9484,43441:9485,43442:9486,43443:9487,43444:9488,43445:9489,43446:9490,43447:9491,43448:9492,43449:9493,43450:9494,43451:9495,43452:9496,43453:9497,43454:9498,43455:9499,43456:9500,43457:9501,43458:9502,43459:9503,43460:9504,43461:9505,43462:9506,43463:9507,43464:9508,43465:9509,43466:9510,43467:9511,43468:9512,43469:9513,43470:9514,43471:9515,43472:9516,43473:9517,43474:9518,43475:9519,43476:9520,43477:9521,43478:9522,43479:9523,43480:9524,43481:9525,43482:9526,43483:9527,43484:9528,43485:9529,43486:9530,43487:9531,43488:9532,43489:9533,43490:9534,43491:9535,43492:9536,43493:9537,43494:9538,43495:9539,43496:9540,43497:9541,43498:9542,43499:9543,43500:9544,43501:9545,43502:9546,43503:9547,43504:59393,43505:59394,43506:59395,43507:59396,43508:59397,43509:59398,43510:59399,43511:59400,43512:59401,43513:59402,43514:59403,43515:59404,43516:59405,43517:59406,43518:59407,43584:29404,43585:29405,43586:29407,43587:29410,43588:29411,43589:29412,43590:29413,43591:29414,43592:29415,43593:29418,43594:29419,43595:29429,43596:29430,43597:29433,43598:29437,43599:29438,43600:29439,43601:29440,43602:29442,43603:29444,43604:29445,43605:29446,43606:29447,43607:29448,43608:29449,43609:29451,43610:29452,43611:29453,43612:29455,43613:29456,43614:29457,43615:29458,43616:29460,43617:29464,43618:29465,43619:29466,43620:29471,43621:29472,43622:29475,43623:29476,43624:29478,43625:29479,43626:29480,43627:29485,43628:29487,43629:29488,43630:29490,43631:29491,43632:29493,43633:29494,43634:29498,43635:29499,43636:29500,43637:29501,43638:29504,43639:29505,43640:29506,43641:29507,43642:29508,43643:29509,43644:29510,43645:29511,43646:29512,43648:29513,43649:29514,43650:29515,43651:29516,43652:29518,43653:29519,43654:29521,43655:29523,43656:29524,43657:29525,43658:29526,43659:29528,43660:29529,43661:29530,43662:29531,43663:29532,43664:29533,43665:29534,43666:29535,43667:29537,43668:29538,43669:29539,43670:29540,43671:29541,43672:29542,43673:29543,43674:29544,43675:29545,43676:29546,43677:29547,43678:29550,43679:29552,43680:29553,43681:57344,43682:57345,43683:57346,43684:57347,43685:57348,43686:57349,43687:57350,43688:57351,43689:57352,43690:57353,43691:57354,43692:57355,43693:57356,43694:57357,43695:57358,43696:57359,43697:57360,43698:57361,43699:57362,43700:57363,43701:57364,43702:57365,43703:57366,43704:57367,43705:57368,43706:57369,43707:57370,43708:57371,43709:57372,43710:57373,43711:57374,43712:57375,43713:57376,43714:57377,43715:57378,43716:57379,43717:57380,43718:57381,43719:57382,43720:57383,43721:57384,43722:57385,43723:57386,43724:57387,43725:57388,43726:57389,43727:57390,43728:57391,43729:57392,43730:57393,43731:57394,43732:57395,43733:57396,43734:57397,43735:57398,43736:57399,43737:57400,43738:57401,43739:57402,43740:57403,43741:57404,43742:57405,43743:57406,43744:57407,43745:57408,43746:57409,43747:57410,43748:57411,43749:57412,43750:57413,43751:57414,43752:57415,43753:57416,43754:57417,43755:57418,43756:57419,43757:57420,43758:57421,43759:57422,43760:57423,43761:57424,43762:57425,43763:57426,43764:57427,43765:57428,43766:57429,43767:57430,43768:57431,43769:57432,43770:57433,43771:57434,43772:57435,43773:57436,43774:57437,43840:29554,43841:29555,43842:29556,43843:29557,43844:29558,43845:29559,43846:29560,43847:29561,43848:29562,43849:29563,43850:29564,43851:29565,43852:29567,43853:29568,43854:29569,43855:29570,43856:29571,43857:29573,43858:29574,43859:29576,43860:29578,43861:29580,43862:29581,43863:29583,43864:29584,43865:29586,43866:29587,43867:29588,43868:29589,43869:29591,43870:29592,43871:29593,43872:29594,43873:29596,43874:29597,43875:29598,43876:29600,43877:29601,43878:29603,43879:29604,43880:29605,43881:29606,43882:29607,43883:29608,43884:29610,43885:29612,43886:29613,43887:29617,43888:29620,43889:29621,43890:29622,43891:29624,43892:29625,43893:29628,43894:29629,43895:29630,43896:29631,43897:29633,43898:29635,43899:29636,43900:29637,43901:29638,43902:29639,43904:29643,43905:29644,43906:29646,43907:29650,43908:29651,43909:29652,43910:29653,43911:29654,43912:29655,43913:29656,43914:29658,43915:29659,43916:29660,43917:29661,43918:29663,43919:29665,43920:29666,43921:29667,43922:29668,43923:29670,43924:29672,43925:29674,43926:29675,43927:29676,43928:29678,43929:29679,43930:29680,43931:29681,43932:29683,43933:29684,43934:29685,43935:29686,43936:29687,43937:57438,43938:57439,43939:57440,43940:57441,43941:57442,43942:57443,43943:57444,43944:57445,43945:57446,43946:57447,43947:57448,43948:57449,43949:57450,43950:57451,43951:57452,43952:57453,43953:57454,43954:57455,43955:57456,43956:57457,43957:57458,43958:57459,43959:57460,43960:57461,43961:57462,43962:57463,43963:57464,43964:57465,43965:57466,43966:57467,43967:57468,43968:57469,43969:57470,43970:57471,43971:57472,43972:57473,43973:57474,43974:57475,43975:57476,43976:57477,43977:57478,43978:57479,43979:57480,43980:57481,43981:57482,43982:57483,43983:57484,43984:57485,43985:57486,43986:57487,43987:57488,43988:57489,43989:57490,43990:57491,43991:57492,43992:57493,43993:57494,43994:57495,43995:57496,43996:57497,43997:57498,43998:57499,43999:57500,44000:57501,44001:57502,44002:57503,44003:57504,44004:57505,44005:57506,44006:57507,44007:57508,44008:57509,44009:57510,44010:57511,44011:57512,44012:57513,44013:57514,44014:57515,44015:57516,44016:57517,44017:57518,44018:57519,44019:57520,44020:57521,44021:57522,44022:57523,44023:57524,44024:57525,44025:57526,44026:57527,44027:57528,44028:57529,44029:57530,44030:57531,44096:29688,44097:29689,44098:29690,44099:29691,44100:29692,44101:29693,44102:29694,44103:29695,44104:29696,44105:29697,44106:29698,44107:29700,44108:29703,44109:29704,44110:29707,44111:29708,44112:29709,44113:29710,44114:29713,44115:29714,44116:29715,44117:29716,44118:29717,44119:29718,44120:29719,44121:29720,44122:29721,44123:29724,44124:29725,44125:29726,44126:29727,44127:29728,44128:29729,44129:29731,44130:29732,44131:29735,44132:29737,44133:29739,44134:29741,44135:29743,44136:29745,44137:29746,44138:29751,44139:29752,44140:29753,44141:29754,44142:29755,44143:29757,44144:29758,44145:29759,44146:29760,44147:29762,44148:29763,44149:29764,44150:29765,44151:29766,44152:29767,44153:29768,44154:29769,44155:29770,44156:29771,44157:29772,44158:29773,44160:29774,44161:29775,44162:29776,44163:29777,44164:29778,44165:29779,44166:29780,44167:29782,44168:29784,44169:29789,44170:29792,44171:29793,44172:29794,44173:29795,44174:29796,44175:29797,44176:29798,44177:29799,44178:29800,44179:29801,44180:29802,44181:29803,44182:29804,44183:29806,44184:29807,44185:29809,44186:29810,44187:29811,44188:29812,44189:29813,44190:29816,44191:29817,44192:29818,44193:57532,44194:57533,44195:57534,44196:57535,44197:57536,44198:57537,44199:57538,44200:57539,44201:57540,44202:57541,44203:57542,44204:57543,44205:57544,44206:57545,44207:57546,44208:57547,44209:57548,44210:57549,44211:57550,44212:57551,44213:57552,44214:57553,44215:57554,44216:57555,44217:57556,44218:57557,44219:57558,44220:57559,44221:57560,44222:57561,44223:57562,44224:57563,44225:57564,44226:57565,44227:57566,44228:57567,44229:57568,44230:57569,44231:57570,44232:57571,44233:57572,44234:57573,44235:57574,44236:57575,44237:57576,44238:57577,44239:57578,44240:57579,44241:57580,44242:57581,44243:57582,44244:57583,44245:57584,44246:57585,44247:57586,44248:57587,44249:57588,44250:57589,44251:57590,44252:57591,44253:57592,44254:57593,44255:57594,44256:57595,44257:57596,44258:57597,44259:57598,44260:57599,44261:57600,44262:57601,44263:57602,44264:57603,44265:57604,44266:57605,44267:57606,44268:57607,44269:57608,44270:57609,44271:57610,44272:57611,44273:57612,44274:57613,44275:57614,44276:57615,44277:57616,44278:57617,44279:57618,44280:57619,44281:57620,44282:57621,44283:57622,44284:57623,44285:57624,44286:57625,44352:29819,44353:29820,44354:29821,44355:29823,44356:29826,44357:29828,44358:29829,44359:29830,44360:29832,44361:29833,44362:29834,44363:29836,44364:29837,44365:29839,44366:29841,44367:29842,44368:29843,44369:29844,44370:29845,44371:29846,44372:29847,44373:29848,44374:29849,44375:29850,44376:29851,44377:29853,44378:29855,44379:29856,44380:29857,44381:29858,44382:29859,44383:29860,44384:29861,44385:29862,44386:29866,44387:29867,44388:29868,44389:29869,44390:29870,44391:29871,44392:29872,44393:29873,44394:29874,44395:29875,44396:29876,44397:29877,44398:29878,44399:29879,44400:29880,44401:29881,44402:29883,44403:29884,44404:29885,44405:29886,44406:29887,44407:29888,44408:29889,44409:29890,44410:29891,44411:29892,44412:29893,44413:29894,44414:29895,44416:29896,44417:29897,44418:29898,44419:29899,44420:29900,44421:29901,44422:29902,44423:29903,44424:29904,44425:29905,44426:29907,44427:29908,44428:29909,44429:29910,44430:29911,44431:29912,44432:29913,44433:29914,44434:29915,44435:29917,44436:29919,44437:29921,44438:29925,44439:29927,44440:29928,44441:29929,44442:29930,44443:29931,44444:29932,44445:29933,44446:29936,44447:29937,44448:29938,44449:57626,44450:57627,44451:57628,44452:57629,44453:57630,44454:57631,44455:57632,44456:57633,44457:57634,44458:57635,44459:57636,44460:57637,44461:57638,44462:57639,44463:57640,44464:57641,44465:57642,44466:57643,44467:57644,44468:57645,44469:57646,44470:57647,44471:57648,44472:57649,44473:57650,44474:57651,44475:57652,44476:57653,44477:57654,44478:57655,44479:57656,44480:57657,44481:57658,44482:57659,44483:57660,44484:57661,44485:57662,44486:57663,44487:57664,44488:57665,44489:57666,44490:57667,44491:57668,44492:57669,44493:57670,44494:57671,44495:57672,44496:57673,44497:57674,44498:57675,44499:57676,44500:57677,44501:57678,44502:57679,44503:57680,44504:57681,44505:57682,44506:57683,44507:57684,44508:57685,44509:57686,44510:57687,44511:57688,44512:57689,44513:57690,44514:57691,44515:57692,44516:57693,44517:57694,44518:57695,44519:57696,44520:57697,44521:57698,44522:57699,44523:57700,44524:57701,44525:57702,44526:57703,44527:57704,44528:57705,44529:57706,44530:57707,44531:57708,44532:57709,44533:57710,44534:57711,44535:57712,44536:57713,44537:57714,44538:57715,44539:57716,44540:57717,44541:57718,44542:57719,44608:29939,44609:29941,44610:29944,44611:29945,44612:29946,44613:29947,44614:29948,44615:29949,44616:29950,44617:29952,44618:29953,44619:29954,44620:29955,44621:29957,44622:29958,44623:29959,44624:29960,44625:29961,44626:29962,44627:29963,44628:29964,44629:29966,44630:29968,44631:29970,44632:29972,44633:29973,44634:29974,44635:29975,44636:29979,44637:29981,44638:29982,44639:29984,44640:29985,44641:29986,44642:29987,44643:29988,44644:29990,44645:29991,44646:29994,44647:29998,44648:30004,44649:30006,44650:30009,44651:30012,44652:30013,44653:30015,44654:30017,44655:30018,44656:30019,44657:30020,44658:30022,44659:30023,44660:30025,44661:30026,44662:30029,44663:30032,44664:30033,44665:30034,44666:30035,44667:30037,44668:30038,44669:30039,44670:30040,44672:30045,44673:30046,44674:30047,44675:30048,44676:30049,44677:30050,44678:30051,44679:30052,44680:30055,44681:30056,44682:30057,44683:30059,44684:30060,44685:30061,44686:30062,44687:30063,44688:30064,44689:30065,44690:30067,44691:30069,44692:30070,44693:30071,44694:30074,44695:30075,44696:30076,44697:30077,44698:30078,44699:30080,44700:30081,44701:30082,44702:30084,44703:30085,44704:30087,44705:57720,44706:57721,44707:57722,44708:57723,44709:57724,44710:57725,44711:57726,44712:57727,44713:57728,44714:57729,44715:57730,44716:57731,44717:57732,44718:57733,44719:57734,44720:57735,44721:57736,44722:57737,44723:57738,44724:57739,44725:57740,44726:57741,44727:57742,44728:57743,44729:57744,44730:57745,44731:57746,44732:57747,44733:57748,44734:57749,44735:57750,44736:57751,44737:57752,44738:57753,44739:57754,44740:57755,44741:57756,44742:57757,44743:57758,44744:57759,44745:57760,44746:57761,44747:57762,44748:57763,44749:57764,44750:57765,44751:57766,44752:57767,44753:57768,44754:57769,44755:57770,44756:57771,44757:57772,44758:57773,44759:57774,44760:57775,44761:57776,44762:57777,44763:57778,44764:57779,44765:57780,44766:57781,44767:57782,44768:57783,44769:57784,44770:57785,44771:57786,44772:57787,44773:57788,44774:57789,44775:57790,44776:57791,44777:57792,44778:57793,44779:57794,44780:57795,44781:57796,44782:57797,44783:57798,44784:57799,44785:57800,44786:57801,44787:57802,44788:57803,44789:57804,44790:57805,44791:57806,44792:57807,44793:57808,44794:57809,44795:57810,44796:57811,44797:57812,44798:57813,44864:30088,44865:30089,44866:30090,44867:30092,44868:30093,44869:30094,44870:30096,44871:30099,44872:30101,44873:30104,44874:30107,44875:30108,44876:30110,44877:30114,44878:30118,44879:30119,44880:30120,44881:30121,44882:30122,44883:30125,44884:30134,44885:30135,44886:30138,44887:30139,44888:30143,44889:30144,44890:30145,44891:30150,44892:30155,44893:30156,44894:30158,44895:30159,44896:30160,44897:30161,44898:30163,44899:30167,44900:30169,44901:30170,44902:30172,44903:30173,44904:30175,44905:30176,44906:30177,44907:30181,44908:30185,44909:30188,44910:30189,44911:30190,44912:30191,44913:30194,44914:30195,44915:30197,44916:30198,44917:30199,44918:30200,44919:30202,44920:30203,44921:30205,44922:30206,44923:30210,44924:30212,44925:30214,44926:30215,44928:30216,44929:30217,44930:30219,44931:30221,44932:30222,44933:30223,44934:30225,44935:30226,44936:30227,44937:30228,44938:30230,44939:30234,44940:30236,44941:30237,44942:30238,44943:30241,44944:30243,44945:30247,44946:30248,44947:30252,44948:30254,44949:30255,44950:30257,44951:30258,44952:30262,44953:30263,44954:30265,44955:30266,44956:30267,44957:30269,44958:30273,44959:30274,44960:30276,44961:57814,44962:57815,44963:57816,44964:57817,44965:57818,44966:57819,44967:57820,44968:57821,44969:57822,44970:57823,44971:57824,44972:57825,44973:57826,44974:57827,44975:57828,44976:57829,44977:57830,44978:57831,44979:57832,44980:57833,44981:57834,44982:57835,44983:57836,44984:57837,44985:57838,44986:57839,44987:57840,44988:57841,44989:57842,44990:57843,44991:57844,44992:57845,44993:57846,44994:57847,44995:57848,44996:57849,44997:57850,44998:57851,44999:57852,45000:57853,45001:57854,45002:57855,45003:57856,45004:57857,45005:57858,45006:57859,45007:57860,45008:57861,45009:57862,45010:57863,45011:57864,45012:57865,45013:57866,45014:57867,45015:57868,45016:57869,45017:57870,45018:57871,45019:57872,45020:57873,45021:57874,45022:57875,45023:57876,45024:57877,45025:57878,45026:57879,45027:57880,45028:57881,45029:57882,45030:57883,45031:57884,45032:57885,45033:57886,45034:57887,45035:57888,45036:57889,45037:57890,45038:57891,45039:57892,45040:57893,45041:57894,45042:57895,45043:57896,45044:57897,45045:57898,45046:57899,45047:57900,45048:57901,45049:57902,45050:57903,45051:57904,45052:57905,45053:57906,45054:57907,45120:30277,45121:30278,45122:30279,45123:30280,45124:30281,45125:30282,45126:30283,45127:30286,45128:30287,45129:30288,45130:30289,45131:30290,45132:30291,45133:30293,45134:30295,45135:30296,45136:30297,45137:30298,45138:30299,45139:30301,45140:30303,45141:30304,45142:30305,45143:30306,45144:30308,45145:30309,45146:30310,45147:30311,45148:30312,45149:30313,45150:30314,45151:30316,45152:30317,45153:30318,45154:30320,45155:30321,45156:30322,45157:30323,45158:30324,45159:30325,45160:30326,45161:30327,45162:30329,45163:30330,45164:30332,45165:30335,45166:30336,45167:30337,45168:30339,45169:30341,45170:30345,45171:30346,45172:30348,45173:30349,45174:30351,45175:30352,45176:30354,45177:30356,45178:30357,45179:30359,45180:30360,45181:30362,45182:30363,45184:30364,45185:30365,45186:30366,45187:30367,45188:30368,45189:30369,45190:30370,45191:30371,45192:30373,45193:30374,45194:30375,45195:30376,45196:30377,45197:30378,45198:30379,45199:30380,45200:30381,45201:30383,45202:30384,45203:30387,45204:30389,45205:30390,45206:30391,45207:30392,45208:30393,45209:30394,45210:30395,45211:30396,45212:30397,45213:30398,45214:30400,45215:30401,45216:30403,45217:21834,45218:38463,45219:22467,45220:25384,45221:21710,45222:21769,45223:21696,45224:30353,45225:30284,45226:34108,45227:30702,45228:33406,45229:30861,45230:29233,45231:38552,45232:38797,45233:27688,45234:23433,45235:20474,45236:25353,45237:26263,45238:23736,45239:33018,45240:26696,45241:32942,45242:26114,45243:30414,45244:20985,45245:25942,45246:29100,45247:32753,45248:34948,45249:20658,45250:22885,45251:25034,45252:28595,45253:33453,45254:25420,45255:25170,45256:21485,45257:21543,45258:31494,45259:20843,45260:30116,45261:24052,45262:25300,45263:36299,45264:38774,45265:25226,45266:32793,45267:22365,45268:38712,45269:32610,45270:29240,45271:30333,45272:26575,45273:30334,45274:25670,45275:20336,45276:36133,45277:25308,45278:31255,45279:26001,45280:29677,45281:25644,45282:25203,45283:33324,45284:39041,45285:26495,45286:29256,45287:25198,45288:25292,45289:20276,45290:29923,45291:21322,45292:21150,45293:32458,45294:37030,45295:24110,45296:26758,45297:27036,45298:33152,45299:32465,45300:26834,45301:30917,45302:34444,45303:38225,45304:20621,45305:35876,45306:33502,45307:32990,45308:21253,45309:35090,45310:21093,45376:30404,45377:30407,45378:30409,45379:30411,45380:30412,45381:30419,45382:30421,45383:30425,45384:30426,45385:30428,45386:30429,45387:30430,45388:30432,45389:30433,45390:30434,45391:30435,45392:30436,45393:30438,45394:30439,45395:30440,45396:30441,45397:30442,45398:30443,45399:30444,45400:30445,45401:30448,45402:30451,45403:30453,45404:30454,45405:30455,45406:30458,45407:30459,45408:30461,45409:30463,45410:30464,45411:30466,45412:30467,45413:30469,45414:30470,45415:30474,45416:30476,45417:30478,45418:30479,45419:30480,45420:30481,45421:30482,45422:30483,45423:30484,45424:30485,45425:30486,45426:30487,45427:30488,45428:30491,45429:30492,45430:30493,45431:30494,45432:30497,45433:30499,45434:30500,45435:30501,45436:30503,45437:30506,45438:30507,45440:30508,45441:30510,45442:30512,45443:30513,45444:30514,45445:30515,45446:30516,45447:30521,45448:30523,45449:30525,45450:30526,45451:30527,45452:30530,45453:30532,45454:30533,45455:30534,45456:30536,45457:30537,45458:30538,45459:30539,45460:30540,45461:30541,45462:30542,45463:30543,45464:30546,45465:30547,45466:30548,45467:30549,45468:30550,45469:30551,45470:30552,45471:30553,45472:30556,45473:34180,45474:38649,45475:20445,45476:22561,45477:39281,45478:23453,45479:25265,45480:25253,45481:26292,45482:35961,45483:40077,45484:29190,45485:26479,45486:30865,45487:24754,45488:21329,45489:21271,45490:36744,45491:32972,45492:36125,45493:38049,45494:20493,45495:29384,45496:22791,45497:24811,45498:28953,45499:34987,45500:22868,45501:33519,45502:26412,45503:31528,45504:23849,45505:32503,45506:29997,45507:27893,45508:36454,45509:36856,45510:36924,45511:40763,45512:27604,45513:37145,45514:31508,45515:24444,45516:30887,45517:34006,45518:34109,45519:27605,45520:27609,45521:27606,45522:24065,45523:24199,45524:30201,45525:38381,45526:25949,45527:24330,45528:24517,45529:36767,45530:22721,45531:33218,45532:36991,45533:38491,45534:38829,45535:36793,45536:32534,45537:36140,45538:25153,45539:20415,45540:21464,45541:21342,45542:36776,45543:36777,45544:36779,45545:36941,45546:26631,45547:24426,45548:33176,45549:34920,45550:40150,45551:24971,45552:21035,45553:30250,45554:24428,45555:25996,45556:28626,45557:28392,45558:23486,45559:25672,45560:20853,45561:20912,45562:26564,45563:19993,45564:31177,45565:39292,45566:28851,45632:30557,45633:30558,45634:30559,45635:30560,45636:30564,45637:30567,45638:30569,45639:30570,45640:30573,45641:30574,45642:30575,45643:30576,45644:30577,45645:30578,45646:30579,45647:30580,45648:30581,45649:30582,45650:30583,45651:30584,45652:30586,45653:30587,45654:30588,45655:30593,45656:30594,45657:30595,45658:30598,45659:30599,45660:30600,45661:30601,45662:30602,45663:30603,45664:30607,45665:30608,45666:30611,45667:30612,45668:30613,45669:30614,45670:30615,45671:30616,45672:30617,45673:30618,45674:30619,45675:30620,45676:30621,45677:30622,45678:30625,45679:30627,45680:30628,45681:30630,45682:30632,45683:30635,45684:30637,45685:30638,45686:30639,45687:30641,45688:30642,45689:30644,45690:30646,45691:30647,45692:30648,45693:30649,45694:30650,45696:30652,45697:30654,45698:30656,45699:30657,45700:30658,45701:30659,45702:30660,45703:30661,45704:30662,45705:30663,45706:30664,45707:30665,45708:30666,45709:30667,45710:30668,45711:30670,45712:30671,45713:30672,45714:30673,45715:30674,45716:30675,45717:30676,45718:30677,45719:30678,45720:30680,45721:30681,45722:30682,45723:30685,45724:30686,45725:30687,45726:30688,45727:30689,45728:30692,45729:30149,45730:24182,45731:29627,45732:33760,45733:25773,45734:25320,45735:38069,45736:27874,45737:21338,45738:21187,45739:25615,45740:38082,45741:31636,45742:20271,45743:24091,45744:33334,45745:33046,45746:33162,45747:28196,45748:27850,45749:39539,45750:25429,45751:21340,45752:21754,45753:34917,45754:22496,45755:19981,45756:24067,45757:27493,45758:31807,45759:37096,45760:24598,45761:25830,45762:29468,45763:35009,45764:26448,45765:25165,45766:36130,45767:30572,45768:36393,45769:37319,45770:24425,45771:33756,45772:34081,45773:39184,45774:21442,45775:34453,45776:27531,45777:24813,45778:24808,45779:28799,45780:33485,45781:33329,45782:20179,45783:27815,45784:34255,45785:25805,45786:31961,45787:27133,45788:26361,45789:33609,45790:21397,45791:31574,45792:20391,45793:20876,45794:27979,45795:23618,45796:36461,45797:25554,45798:21449,45799:33580,45800:33590,45801:26597,45802:30900,45803:25661,45804:23519,45805:23700,45806:24046,45807:35815,45808:25286,45809:26612,45810:35962,45811:25600,45812:25530,45813:34633,45814:39307,45815:35863,45816:32544,45817:38130,45818:20135,45819:38416,45820:39076,45821:26124,45822:29462,45888:30694,45889:30696,45890:30698,45891:30703,45892:30704,45893:30705,45894:30706,45895:30708,45896:30709,45897:30711,45898:30713,45899:30714,45900:30715,45901:30716,45902:30723,45903:30724,45904:30725,45905:30726,45906:30727,45907:30728,45908:30730,45909:30731,45910:30734,45911:30735,45912:30736,45913:30739,45914:30741,45915:30745,45916:30747,45917:30750,45918:30752,45919:30753,45920:30754,45921:30756,45922:30760,45923:30762,45924:30763,45925:30766,45926:30767,45927:30769,45928:30770,45929:30771,45930:30773,45931:30774,45932:30781,45933:30783,45934:30785,45935:30786,45936:30787,45937:30788,45938:30790,45939:30792,45940:30793,45941:30794,45942:30795,45943:30797,45944:30799,45945:30801,45946:30803,45947:30804,45948:30808,45949:30809,45950:30810,45952:30811,45953:30812,45954:30814,45955:30815,45956:30816,45957:30817,45958:30818,45959:30819,45960:30820,45961:30821,45962:30822,45963:30823,45964:30824,45965:30825,45966:30831,45967:30832,45968:30833,45969:30834,45970:30835,45971:30836,45972:30837,45973:30838,45974:30840,45975:30841,45976:30842,45977:30843,45978:30845,45979:30846,45980:30847,45981:30848,45982:30849,45983:30850,45984:30851,45985:22330,45986:23581,45987:24120,45988:38271,45989:20607,45990:32928,45991:21378,45992:25950,45993:30021,45994:21809,45995:20513,45996:36229,45997:25220,45998:38046,45999:26397,46000:22066,46001:28526,46002:24034,46003:21557,46004:28818,46005:36710,46006:25199,46007:25764,46008:25507,46009:24443,46010:28552,46011:37108,46012:33251,46013:36784,46014:23576,46015:26216,46016:24561,46017:27785,46018:38472,46019:36225,46020:34924,46021:25745,46022:31216,46023:22478,46024:27225,46025:25104,46026:21576,46027:20056,46028:31243,46029:24809,46030:28548,46031:35802,46032:25215,46033:36894,46034:39563,46035:31204,46036:21507,46037:30196,46038:25345,46039:21273,46040:27744,46041:36831,46042:24347,46043:39536,46044:32827,46045:40831,46046:20360,46047:23610,46048:36196,46049:32709,46050:26021,46051:28861,46052:20805,46053:20914,46054:34411,46055:23815,46056:23456,46057:25277,46058:37228,46059:30068,46060:36364,46061:31264,46062:24833,46063:31609,46064:20167,46065:32504,46066:30597,46067:19985,46068:33261,46069:21021,46070:20986,46071:27249,46072:21416,46073:36487,46074:38148,46075:38607,46076:28353,46077:38500,46078:26970,46144:30852,46145:30853,46146:30854,46147:30856,46148:30858,46149:30859,46150:30863,46151:30864,46152:30866,46153:30868,46154:30869,46155:30870,46156:30873,46157:30877,46158:30878,46159:30880,46160:30882,46161:30884,46162:30886,46163:30888,46164:30889,46165:30890,46166:30891,46167:30892,46168:30893,46169:30894,46170:30895,46171:30901,46172:30902,46173:30903,46174:30904,46175:30906,46176:30907,46177:30908,46178:30909,46179:30911,46180:30912,46181:30914,46182:30915,46183:30916,46184:30918,46185:30919,46186:30920,46187:30924,46188:30925,46189:30926,46190:30927,46191:30929,46192:30930,46193:30931,46194:30934,46195:30935,46196:30936,46197:30938,46198:30939,46199:30940,46200:30941,46201:30942,46202:30943,46203:30944,46204:30945,46205:30946,46206:30947,46208:30948,46209:30949,46210:30950,46211:30951,46212:30953,46213:30954,46214:30955,46215:30957,46216:30958,46217:30959,46218:30960,46219:30961,46220:30963,46221:30965,46222:30966,46223:30968,46224:30969,46225:30971,46226:30972,46227:30973,46228:30974,46229:30975,46230:30976,46231:30978,46232:30979,46233:30980,46234:30982,46235:30983,46236:30984,46237:30985,46238:30986,46239:30987,46240:30988,46241:30784,46242:20648,46243:30679,46244:25616,46245:35302,46246:22788,46247:25571,46248:24029,46249:31359,46250:26941,46251:20256,46252:33337,46253:21912,46254:20018,46255:30126,46256:31383,46257:24162,46258:24202,46259:38383,46260:21019,46261:21561,46262:28810,46263:25462,46264:38180,46265:22402,46266:26149,46267:26943,46268:37255,46269:21767,46270:28147,46271:32431,46272:34850,46273:25139,46274:32496,46275:30133,46276:33576,46277:30913,46278:38604,46279:36766,46280:24904,46281:29943,46282:35789,46283:27492,46284:21050,46285:36176,46286:27425,46287:32874,46288:33905,46289:22257,46290:21254,46291:20174,46292:19995,46293:20945,46294:31895,46295:37259,46296:31751,46297:20419,46298:36479,46299:31713,46300:31388,46301:25703,46302:23828,46303:20652,46304:33030,46305:30209,46306:31929,46307:28140,46308:32736,46309:26449,46310:23384,46311:23544,46312:30923,46313:25774,46314:25619,46315:25514,46316:25387,46317:38169,46318:25645,46319:36798,46320:31572,46321:30249,46322:25171,46323:22823,46324:21574,46325:27513,46326:20643,46327:25140,46328:24102,46329:27526,46330:20195,46331:36151,46332:34955,46333:24453,46334:36910,46400:30989,46401:30990,46402:30991,46403:30992,46404:30993,46405:30994,46406:30996,46407:30997,46408:30998,46409:30999,46410:31000,46411:31001,46412:31002,46413:31003,46414:31004,46415:31005,46416:31007,46417:31008,46418:31009,46419:31010,46420:31011,46421:31013,46422:31014,46423:31015,46424:31016,46425:31017,46426:31018,46427:31019,46428:31020,46429:31021,46430:31022,46431:31023,46432:31024,46433:31025,46434:31026,46435:31027,46436:31029,46437:31030,46438:31031,46439:31032,46440:31033,46441:31037,46442:31039,46443:31042,46444:31043,46445:31044,46446:31045,46447:31047,46448:31050,46449:31051,46450:31052,46451:31053,46452:31054,46453:31055,46454:31056,46455:31057,46456:31058,46457:31060,46458:31061,46459:31064,46460:31065,46461:31073,46462:31075,46464:31076,46465:31078,46466:31081,46467:31082,46468:31083,46469:31084,46470:31086,46471:31088,46472:31089,46473:31090,46474:31091,46475:31092,46476:31093,46477:31094,46478:31097,46479:31099,46480:31100,46481:31101,46482:31102,46483:31103,46484:31106,46485:31107,46486:31110,46487:31111,46488:31112,46489:31113,46490:31115,46491:31116,46492:31117,46493:31118,46494:31120,46495:31121,46496:31122,46497:24608,46498:32829,46499:25285,46500:20025,46501:21333,46502:37112,46503:25528,46504:32966,46505:26086,46506:27694,46507:20294,46508:24814,46509:28129,46510:35806,46511:24377,46512:34507,46513:24403,46514:25377,46515:20826,46516:33633,46517:26723,46518:20992,46519:25443,46520:36424,46521:20498,46522:23707,46523:31095,46524:23548,46525:21040,46526:31291,46527:24764,46528:36947,46529:30423,46530:24503,46531:24471,46532:30340,46533:36460,46534:28783,46535:30331,46536:31561,46537:30634,46538:20979,46539:37011,46540:22564,46541:20302,46542:28404,46543:36842,46544:25932,46545:31515,46546:29380,46547:28068,46548:32735,46549:23265,46550:25269,46551:24213,46552:22320,46553:33922,46554:31532,46555:24093,46556:24351,46557:36882,46558:32532,46559:39072,46560:25474,46561:28359,46562:30872,46563:28857,46564:20856,46565:38747,46566:22443,46567:30005,46568:20291,46569:30008,46570:24215,46571:24806,46572:22880,46573:28096,46574:27583,46575:30857,46576:21500,46577:38613,46578:20939,46579:20993,46580:25481,46581:21514,46582:38035,46583:35843,46584:36300,46585:29241,46586:30879,46587:34678,46588:36845,46589:35853,46590:21472,46656:31123,46657:31124,46658:31125,46659:31126,46660:31127,46661:31128,46662:31129,46663:31131,46664:31132,46665:31133,46666:31134,46667:31135,46668:31136,46669:31137,46670:31138,46671:31139,46672:31140,46673:31141,46674:31142,46675:31144,46676:31145,46677:31146,46678:31147,46679:31148,46680:31149,46681:31150,46682:31151,46683:31152,46684:31153,46685:31154,46686:31156,46687:31157,46688:31158,46689:31159,46690:31160,46691:31164,46692:31167,46693:31170,46694:31172,46695:31173,46696:31175,46697:31176,46698:31178,46699:31180,46700:31182,46701:31183,46702:31184,46703:31187,46704:31188,46705:31190,46706:31191,46707:31193,46708:31194,46709:31195,46710:31196,46711:31197,46712:31198,46713:31200,46714:31201,46715:31202,46716:31205,46717:31208,46718:31210,46720:31212,46721:31214,46722:31217,46723:31218,46724:31219,46725:31220,46726:31221,46727:31222,46728:31223,46729:31225,46730:31226,46731:31228,46732:31230,46733:31231,46734:31233,46735:31236,46736:31237,46737:31239,46738:31240,46739:31241,46740:31242,46741:31244,46742:31247,46743:31248,46744:31249,46745:31250,46746:31251,46747:31253,46748:31254,46749:31256,46750:31257,46751:31259,46752:31260,46753:19969,46754:30447,46755:21486,46756:38025,46757:39030,46758:40718,46759:38189,46760:23450,46761:35746,46762:20002,46763:19996,46764:20908,46765:33891,46766:25026,46767:21160,46768:26635,46769:20375,46770:24683,46771:20923,46772:27934,46773:20828,46774:25238,46775:26007,46776:38497,46777:35910,46778:36887,46779:30168,46780:37117,46781:30563,46782:27602,46783:29322,46784:29420,46785:35835,46786:22581,46787:30585,46788:36172,46789:26460,46790:38208,46791:32922,46792:24230,46793:28193,46794:22930,46795:31471,46796:30701,46797:38203,46798:27573,46799:26029,46800:32526,46801:22534,46802:20817,46803:38431,46804:23545,46805:22697,46806:21544,46807:36466,46808:25958,46809:39039,46810:22244,46811:38045,46812:30462,46813:36929,46814:25479,46815:21702,46816:22810,46817:22842,46818:22427,46819:36530,46820:26421,46821:36346,46822:33333,46823:21057,46824:24816,46825:22549,46826:34558,46827:23784,46828:40517,46829:20420,46830:39069,46831:35769,46832:23077,46833:24694,46834:21380,46835:25212,46836:36943,46837:37122,46838:39295,46839:24681,46840:32780,46841:20799,46842:32819,46843:23572,46844:39285,46845:27953,46846:20108,46912:31261,46913:31263,46914:31265,46915:31266,46916:31268,46917:31269,46918:31270,46919:31271,46920:31272,46921:31273,46922:31274,46923:31275,46924:31276,46925:31277,46926:31278,46927:31279,46928:31280,46929:31281,46930:31282,46931:31284,46932:31285,46933:31286,46934:31288,46935:31290,46936:31294,46937:31296,46938:31297,46939:31298,46940:31299,46941:31300,46942:31301,46943:31303,46944:31304,46945:31305,46946:31306,46947:31307,46948:31308,46949:31309,46950:31310,46951:31311,46952:31312,46953:31314,46954:31315,46955:31316,46956:31317,46957:31318,46958:31320,46959:31321,46960:31322,46961:31323,46962:31324,46963:31325,46964:31326,46965:31327,46966:31328,46967:31329,46968:31330,46969:31331,46970:31332,46971:31333,46972:31334,46973:31335,46974:31336,46976:31337,46977:31338,46978:31339,46979:31340,46980:31341,46981:31342,46982:31343,46983:31345,46984:31346,46985:31347,46986:31349,46987:31355,46988:31356,46989:31357,46990:31358,46991:31362,46992:31365,46993:31367,46994:31369,46995:31370,46996:31371,46997:31372,46998:31374,46999:31375,47000:31376,47001:31379,47002:31380,47003:31385,47004:31386,47005:31387,47006:31390,47007:31393,47008:31394,47009:36144,47010:21457,47011:32602,47012:31567,47013:20240,47014:20047,47015:38400,47016:27861,47017:29648,47018:34281,47019:24070,47020:30058,47021:32763,47022:27146,47023:30718,47024:38034,47025:32321,47026:20961,47027:28902,47028:21453,47029:36820,47030:33539,47031:36137,47032:29359,47033:39277,47034:27867,47035:22346,47036:33459,47037:26041,47038:32938,47039:25151,47040:38450,47041:22952,47042:20223,47043:35775,47044:32442,47045:25918,47046:33778,47047:38750,47048:21857,47049:39134,47050:32933,47051:21290,47052:35837,47053:21536,47054:32954,47055:24223,47056:27832,47057:36153,47058:33452,47059:37210,47060:21545,47061:27675,47062:20998,47063:32439,47064:22367,47065:28954,47066:27774,47067:31881,47068:22859,47069:20221,47070:24575,47071:24868,47072:31914,47073:20016,47074:23553,47075:26539,47076:34562,47077:23792,47078:38155,47079:39118,47080:30127,47081:28925,47082:36898,47083:20911,47084:32541,47085:35773,47086:22857,47087:20964,47088:20315,47089:21542,47090:22827,47091:25975,47092:32932,47093:23413,47094:25206,47095:25282,47096:36752,47097:24133,47098:27679,47099:31526,47100:20239,47101:20440,47102:26381,47168:31395,47169:31396,47170:31399,47171:31401,47172:31402,47173:31403,47174:31406,47175:31407,47176:31408,47177:31409,47178:31410,47179:31412,47180:31413,47181:31414,47182:31415,47183:31416,47184:31417,47185:31418,47186:31419,47187:31420,47188:31421,47189:31422,47190:31424,47191:31425,47192:31426,47193:31427,47194:31428,47195:31429,47196:31430,47197:31431,47198:31432,47199:31433,47200:31434,47201:31436,47202:31437,47203:31438,47204:31439,47205:31440,47206:31441,47207:31442,47208:31443,47209:31444,47210:31445,47211:31447,47212:31448,47213:31450,47214:31451,47215:31452,47216:31453,47217:31457,47218:31458,47219:31460,47220:31463,47221:31464,47222:31465,47223:31466,47224:31467,47225:31468,47226:31470,47227:31472,47228:31473,47229:31474,47230:31475,47232:31476,47233:31477,47234:31478,47235:31479,47236:31480,47237:31483,47238:31484,47239:31486,47240:31488,47241:31489,47242:31490,47243:31493,47244:31495,47245:31497,47246:31500,47247:31501,47248:31502,47249:31504,47250:31506,47251:31507,47252:31510,47253:31511,47254:31512,47255:31514,47256:31516,47257:31517,47258:31519,47259:31521,47260:31522,47261:31523,47262:31527,47263:31529,47264:31533,47265:28014,47266:28074,47267:31119,47268:34993,47269:24343,47270:29995,47271:25242,47272:36741,47273:20463,47274:37340,47275:26023,47276:33071,47277:33105,47278:24220,47279:33104,47280:36212,47281:21103,47282:35206,47283:36171,47284:22797,47285:20613,47286:20184,47287:38428,47288:29238,47289:33145,47290:36127,47291:23500,47292:35747,47293:38468,47294:22919,47295:32538,47296:21648,47297:22134,47298:22030,47299:35813,47300:25913,47301:27010,47302:38041,47303:30422,47304:28297,47305:24178,47306:29976,47307:26438,47308:26577,47309:31487,47310:32925,47311:36214,47312:24863,47313:31174,47314:25954,47315:36195,47316:20872,47317:21018,47318:38050,47319:32568,47320:32923,47321:32434,47322:23703,47323:28207,47324:26464,47325:31705,47326:30347,47327:39640,47328:33167,47329:32660,47330:31957,47331:25630,47332:38224,47333:31295,47334:21578,47335:21733,47336:27468,47337:25601,47338:25096,47339:40509,47340:33011,47341:30105,47342:21106,47343:38761,47344:33883,47345:26684,47346:34532,47347:38401,47348:38548,47349:38124,47350:20010,47351:21508,47352:32473,47353:26681,47354:36319,47355:32789,47356:26356,47357:24218,47358:32697,47424:31535,47425:31536,47426:31538,47427:31540,47428:31541,47429:31542,47430:31543,47431:31545,47432:31547,47433:31549,47434:31551,47435:31552,47436:31553,47437:31554,47438:31555,47439:31556,47440:31558,47441:31560,47442:31562,47443:31565,47444:31566,47445:31571,47446:31573,47447:31575,47448:31577,47449:31580,47450:31582,47451:31583,47452:31585,47453:31587,47454:31588,47455:31589,47456:31590,47457:31591,47458:31592,47459:31593,47460:31594,47461:31595,47462:31596,47463:31597,47464:31599,47465:31600,47466:31603,47467:31604,47468:31606,47469:31608,47470:31610,47471:31612,47472:31613,47473:31615,47474:31617,47475:31618,47476:31619,47477:31620,47478:31622,47479:31623,47480:31624,47481:31625,47482:31626,47483:31627,47484:31628,47485:31630,47486:31631,47488:31633,47489:31634,47490:31635,47491:31638,47492:31640,47493:31641,47494:31642,47495:31643,47496:31646,47497:31647,47498:31648,47499:31651,47500:31652,47501:31653,47502:31662,47503:31663,47504:31664,47505:31666,47506:31667,47507:31669,47508:31670,47509:31671,47510:31673,47511:31674,47512:31675,47513:31676,47514:31677,47515:31678,47516:31679,47517:31680,47518:31682,47519:31683,47520:31684,47521:22466,47522:32831,47523:26775,47524:24037,47525:25915,47526:21151,47527:24685,47528:40858,47529:20379,47530:36524,47531:20844,47532:23467,47533:24339,47534:24041,47535:27742,47536:25329,47537:36129,47538:20849,47539:38057,47540:21246,47541:27807,47542:33503,47543:29399,47544:22434,47545:26500,47546:36141,47547:22815,47548:36764,47549:33735,47550:21653,47551:31629,47552:20272,47553:27837,47554:23396,47555:22993,47556:40723,47557:21476,47558:34506,47559:39592,47560:35895,47561:32929,47562:25925,47563:39038,47564:22266,47565:38599,47566:21038,47567:29916,47568:21072,47569:23521,47570:25346,47571:35074,47572:20054,47573:25296,47574:24618,47575:26874,47576:20851,47577:23448,47578:20896,47579:35266,47580:31649,47581:39302,47582:32592,47583:24815,47584:28748,47585:36143,47586:20809,47587:24191,47588:36891,47589:29808,47590:35268,47591:22317,47592:30789,47593:24402,47594:40863,47595:38394,47596:36712,47597:39740,47598:35809,47599:30328,47600:26690,47601:26588,47602:36330,47603:36149,47604:21053,47605:36746,47606:28378,47607:26829,47608:38149,47609:37101,47610:22269,47611:26524,47612:35065,47613:36807,47614:21704,47680:31685,47681:31688,47682:31689,47683:31690,47684:31691,47685:31693,47686:31694,47687:31695,47688:31696,47689:31698,47690:31700,47691:31701,47692:31702,47693:31703,47694:31704,47695:31707,47696:31708,47697:31710,47698:31711,47699:31712,47700:31714,47701:31715,47702:31716,47703:31719,47704:31720,47705:31721,47706:31723,47707:31724,47708:31725,47709:31727,47710:31728,47711:31730,47712:31731,47713:31732,47714:31733,47715:31734,47716:31736,47717:31737,47718:31738,47719:31739,47720:31741,47721:31743,47722:31744,47723:31745,47724:31746,47725:31747,47726:31748,47727:31749,47728:31750,47729:31752,47730:31753,47731:31754,47732:31757,47733:31758,47734:31760,47735:31761,47736:31762,47737:31763,47738:31764,47739:31765,47740:31767,47741:31768,47742:31769,47744:31770,47745:31771,47746:31772,47747:31773,47748:31774,47749:31776,47750:31777,47751:31778,47752:31779,47753:31780,47754:31781,47755:31784,47756:31785,47757:31787,47758:31788,47759:31789,47760:31790,47761:31791,47762:31792,47763:31793,47764:31794,47765:31795,47766:31796,47767:31797,47768:31798,47769:31799,47770:31801,47771:31802,47772:31803,47773:31804,47774:31805,47775:31806,47776:31810,47777:39608,47778:23401,47779:28023,47780:27686,47781:20133,47782:23475,47783:39559,47784:37219,47785:25000,47786:37039,47787:38889,47788:21547,47789:28085,47790:23506,47791:20989,47792:21898,47793:32597,47794:32752,47795:25788,47796:25421,47797:26097,47798:25022,47799:24717,47800:28938,47801:27735,47802:27721,47803:22831,47804:26477,47805:33322,47806:22741,47807:22158,47808:35946,47809:27627,47810:37085,47811:22909,47812:32791,47813:21495,47814:28009,47815:21621,47816:21917,47817:33655,47818:33743,47819:26680,47820:31166,47821:21644,47822:20309,47823:21512,47824:30418,47825:35977,47826:38402,47827:27827,47828:28088,47829:36203,47830:35088,47831:40548,47832:36154,47833:22079,47834:40657,47835:30165,47836:24456,47837:29408,47838:24680,47839:21756,47840:20136,47841:27178,47842:34913,47843:24658,47844:36720,47845:21700,47846:28888,47847:34425,47848:40511,47849:27946,47850:23439,47851:24344,47852:32418,47853:21897,47854:20399,47855:29492,47856:21564,47857:21402,47858:20505,47859:21518,47860:21628,47861:20046,47862:24573,47863:29786,47864:22774,47865:33899,47866:32993,47867:34676,47868:29392,47869:31946,47870:28246,47936:31811,47937:31812,47938:31813,47939:31814,47940:31815,47941:31816,47942:31817,47943:31818,47944:31819,47945:31820,47946:31822,47947:31823,47948:31824,47949:31825,47950:31826,47951:31827,47952:31828,47953:31829,47954:31830,47955:31831,47956:31832,47957:31833,47958:31834,47959:31835,47960:31836,47961:31837,47962:31838,47963:31839,47964:31840,47965:31841,47966:31842,47967:31843,47968:31844,47969:31845,47970:31846,47971:31847,47972:31848,47973:31849,47974:31850,47975:31851,47976:31852,47977:31853,47978:31854,47979:31855,47980:31856,47981:31857,47982:31858,47983:31861,47984:31862,47985:31863,47986:31864,47987:31865,47988:31866,47989:31870,47990:31871,47991:31872,47992:31873,47993:31874,47994:31875,47995:31876,47996:31877,47997:31878,47998:31879,48000:31880,48001:31882,48002:31883,48003:31884,48004:31885,48005:31886,48006:31887,48007:31888,48008:31891,48009:31892,48010:31894,48011:31897,48012:31898,48013:31899,48014:31904,48015:31905,48016:31907,48017:31910,48018:31911,48019:31912,48020:31913,48021:31915,48022:31916,48023:31917,48024:31919,48025:31920,48026:31924,48027:31925,48028:31926,48029:31927,48030:31928,48031:31930,48032:31931,48033:24359,48034:34382,48035:21804,48036:25252,48037:20114,48038:27818,48039:25143,48040:33457,48041:21719,48042:21326,48043:29502,48044:28369,48045:30011,48046:21010,48047:21270,48048:35805,48049:27088,48050:24458,48051:24576,48052:28142,48053:22351,48054:27426,48055:29615,48056:26707,48057:36824,48058:32531,48059:25442,48060:24739,48061:21796,48062:30186,48063:35938,48064:28949,48065:28067,48066:23462,48067:24187,48068:33618,48069:24908,48070:40644,48071:30970,48072:34647,48073:31783,48074:30343,48075:20976,48076:24822,48077:29004,48078:26179,48079:24140,48080:24653,48081:35854,48082:28784,48083:25381,48084:36745,48085:24509,48086:24674,48087:34516,48088:22238,48089:27585,48090:24724,48091:24935,48092:21321,48093:24800,48094:26214,48095:36159,48096:31229,48097:20250,48098:28905,48099:27719,48100:35763,48101:35826,48102:32472,48103:33636,48104:26127,48105:23130,48106:39746,48107:27985,48108:28151,48109:35905,48110:27963,48111:20249,48112:28779,48113:33719,48114:25110,48115:24785,48116:38669,48117:36135,48118:31096,48119:20987,48120:22334,48121:22522,48122:26426,48123:30072,48124:31293,48125:31215,48126:31637,48192:31935,48193:31936,48194:31938,48195:31939,48196:31940,48197:31942,48198:31945,48199:31947,48200:31950,48201:31951,48202:31952,48203:31953,48204:31954,48205:31955,48206:31956,48207:31960,48208:31962,48209:31963,48210:31965,48211:31966,48212:31969,48213:31970,48214:31971,48215:31972,48216:31973,48217:31974,48218:31975,48219:31977,48220:31978,48221:31979,48222:31980,48223:31981,48224:31982,48225:31984,48226:31985,48227:31986,48228:31987,48229:31988,48230:31989,48231:31990,48232:31991,48233:31993,48234:31994,48235:31996,48236:31997,48237:31998,48238:31999,48239:32000,48240:32001,48241:32002,48242:32003,48243:32004,48244:32005,48245:32006,48246:32007,48247:32008,48248:32009,48249:32011,48250:32012,48251:32013,48252:32014,48253:32015,48254:32016,48256:32017,48257:32018,48258:32019,48259:32020,48260:32021,48261:32022,48262:32023,48263:32024,48264:32025,48265:32026,48266:32027,48267:32028,48268:32029,48269:32030,48270:32031,48271:32033,48272:32035,48273:32036,48274:32037,48275:32038,48276:32040,48277:32041,48278:32042,48279:32044,48280:32045,48281:32046,48282:32048,48283:32049,48284:32050,48285:32051,48286:32052,48287:32053,48288:32054,48289:32908,48290:39269,48291:36857,48292:28608,48293:35749,48294:40481,48295:23020,48296:32489,48297:32521,48298:21513,48299:26497,48300:26840,48301:36753,48302:31821,48303:38598,48304:21450,48305:24613,48306:30142,48307:27762,48308:21363,48309:23241,48310:32423,48311:25380,48312:20960,48313:33034,48314:24049,48315:34015,48316:25216,48317:20864,48318:23395,48319:20238,48320:31085,48321:21058,48322:24760,48323:27982,48324:23492,48325:23490,48326:35745,48327:35760,48328:26082,48329:24524,48330:38469,48331:22931,48332:32487,48333:32426,48334:22025,48335:26551,48336:22841,48337:20339,48338:23478,48339:21152,48340:33626,48341:39050,48342:36158,48343:30002,48344:38078,48345:20551,48346:31292,48347:20215,48348:26550,48349:39550,48350:23233,48351:27516,48352:30417,48353:22362,48354:23574,48355:31546,48356:38388,48357:29006,48358:20860,48359:32937,48360:33392,48361:22904,48362:32516,48363:33575,48364:26816,48365:26604,48366:30897,48367:30839,48368:25315,48369:25441,48370:31616,48371:20461,48372:21098,48373:20943,48374:33616,48375:27099,48376:37492,48377:36341,48378:36145,48379:35265,48380:38190,48381:31661,48382:20214,48448:32055,48449:32056,48450:32057,48451:32058,48452:32059,48453:32060,48454:32061,48455:32062,48456:32063,48457:32064,48458:32065,48459:32066,48460:32067,48461:32068,48462:32069,48463:32070,48464:32071,48465:32072,48466:32073,48467:32074,48468:32075,48469:32076,48470:32077,48471:32078,48472:32079,48473:32080,48474:32081,48475:32082,48476:32083,48477:32084,48478:32085,48479:32086,48480:32087,48481:32088,48482:32089,48483:32090,48484:32091,48485:32092,48486:32093,48487:32094,48488:32095,48489:32096,48490:32097,48491:32098,48492:32099,48493:32100,48494:32101,48495:32102,48496:32103,48497:32104,48498:32105,48499:32106,48500:32107,48501:32108,48502:32109,48503:32111,48504:32112,48505:32113,48506:32114,48507:32115,48508:32116,48509:32117,48510:32118,48512:32120,48513:32121,48514:32122,48515:32123,48516:32124,48517:32125,48518:32126,48519:32127,48520:32128,48521:32129,48522:32130,48523:32131,48524:32132,48525:32133,48526:32134,48527:32135,48528:32136,48529:32137,48530:32138,48531:32139,48532:32140,48533:32141,48534:32142,48535:32143,48536:32144,48537:32145,48538:32146,48539:32147,48540:32148,48541:32149,48542:32150,48543:32151,48544:32152,48545:20581,48546:33328,48547:21073,48548:39279,48549:28176,48550:28293,48551:28071,48552:24314,48553:20725,48554:23004,48555:23558,48556:27974,48557:27743,48558:30086,48559:33931,48560:26728,48561:22870,48562:35762,48563:21280,48564:37233,48565:38477,48566:34121,48567:26898,48568:30977,48569:28966,48570:33014,48571:20132,48572:37066,48573:27975,48574:39556,48575:23047,48576:22204,48577:25605,48578:38128,48579:30699,48580:20389,48581:33050,48582:29409,48583:35282,48584:39290,48585:32564,48586:32478,48587:21119,48588:25945,48589:37237,48590:36735,48591:36739,48592:21483,48593:31382,48594:25581,48595:25509,48596:30342,48597:31224,48598:34903,48599:38454,48600:25130,48601:21163,48602:33410,48603:26708,48604:26480,48605:25463,48606:30571,48607:31469,48608:27905,48609:32467,48610:35299,48611:22992,48612:25106,48613:34249,48614:33445,48615:30028,48616:20511,48617:20171,48618:30117,48619:35819,48620:23626,48621:24062,48622:31563,48623:26020,48624:37329,48625:20170,48626:27941,48627:35167,48628:32039,48629:38182,48630:20165,48631:35880,48632:36827,48633:38771,48634:26187,48635:31105,48636:36817,48637:28908,48638:28024,48704:32153,48705:32154,48706:32155,48707:32156,48708:32157,48709:32158,48710:32159,48711:32160,48712:32161,48713:32162,48714:32163,48715:32164,48716:32165,48717:32167,48718:32168,48719:32169,48720:32170,48721:32171,48722:32172,48723:32173,48724:32175,48725:32176,48726:32177,48727:32178,48728:32179,48729:32180,48730:32181,48731:32182,48732:32183,48733:32184,48734:32185,48735:32186,48736:32187,48737:32188,48738:32189,48739:32190,48740:32191,48741:32192,48742:32193,48743:32194,48744:32195,48745:32196,48746:32197,48747:32198,48748:32199,48749:32200,48750:32201,48751:32202,48752:32203,48753:32204,48754:32205,48755:32206,48756:32207,48757:32208,48758:32209,48759:32210,48760:32211,48761:32212,48762:32213,48763:32214,48764:32215,48765:32216,48766:32217,48768:32218,48769:32219,48770:32220,48771:32221,48772:32222,48773:32223,48774:32224,48775:32225,48776:32226,48777:32227,48778:32228,48779:32229,48780:32230,48781:32231,48782:32232,48783:32233,48784:32234,48785:32235,48786:32236,48787:32237,48788:32238,48789:32239,48790:32240,48791:32241,48792:32242,48793:32243,48794:32244,48795:32245,48796:32246,48797:32247,48798:32248,48799:32249,48800:32250,48801:23613,48802:21170,48803:33606,48804:20834,48805:33550,48806:30555,48807:26230,48808:40120,48809:20140,48810:24778,48811:31934,48812:31923,48813:32463,48814:20117,48815:35686,48816:26223,48817:39048,48818:38745,48819:22659,48820:25964,48821:38236,48822:24452,48823:30153,48824:38742,48825:31455,48826:31454,48827:20928,48828:28847,48829:31384,48830:25578,48831:31350,48832:32416,48833:29590,48834:38893,48835:20037,48836:28792,48837:20061,48838:37202,48839:21417,48840:25937,48841:26087,48842:33276,48843:33285,48844:21646,48845:23601,48846:30106,48847:38816,48848:25304,48849:29401,48850:30141,48851:23621,48852:39545,48853:33738,48854:23616,48855:21632,48856:30697,48857:20030,48858:27822,48859:32858,48860:25298,48861:25454,48862:24040,48863:20855,48864:36317,48865:36382,48866:38191,48867:20465,48868:21477,48869:24807,48870:28844,48871:21095,48872:25424,48873:40515,48874:23071,48875:20518,48876:30519,48877:21367,48878:32482,48879:25733,48880:25899,48881:25225,48882:25496,48883:20500,48884:29237,48885:35273,48886:20915,48887:35776,48888:32477,48889:22343,48890:33740,48891:38055,48892:20891,48893:21531,48894:23803,48960:32251,48961:32252,48962:32253,48963:32254,48964:32255,48965:32256,48966:32257,48967:32258,48968:32259,48969:32260,48970:32261,48971:32262,48972:32263,48973:32264,48974:32265,48975:32266,48976:32267,48977:32268,48978:32269,48979:32270,48980:32271,48981:32272,48982:32273,48983:32274,48984:32275,48985:32276,48986:32277,48987:32278,48988:32279,48989:32280,48990:32281,48991:32282,48992:32283,48993:32284,48994:32285,48995:32286,48996:32287,48997:32288,48998:32289,48999:32290,49000:32291,49001:32292,49002:32293,49003:32294,49004:32295,49005:32296,49006:32297,49007:32298,49008:32299,49009:32300,49010:32301,49011:32302,49012:32303,49013:32304,49014:32305,49015:32306,49016:32307,49017:32308,49018:32309,49019:32310,49020:32311,49021:32312,49022:32313,49024:32314,49025:32316,49026:32317,49027:32318,49028:32319,49029:32320,49030:32322,49031:32323,49032:32324,49033:32325,49034:32326,49035:32328,49036:32329,49037:32330,49038:32331,49039:32332,49040:32333,49041:32334,49042:32335,49043:32336,49044:32337,49045:32338,49046:32339,49047:32340,49048:32341,49049:32342,49050:32343,49051:32344,49052:32345,49053:32346,49054:32347,49055:32348,49056:32349,49057:20426,49058:31459,49059:27994,49060:37089,49061:39567,49062:21888,49063:21654,49064:21345,49065:21679,49066:24320,49067:25577,49068:26999,49069:20975,49070:24936,49071:21002,49072:22570,49073:21208,49074:22350,49075:30733,49076:30475,49077:24247,49078:24951,49079:31968,49080:25179,49081:25239,49082:20130,49083:28821,49084:32771,49085:25335,49086:28900,49087:38752,49088:22391,49089:33499,49090:26607,49091:26869,49092:30933,49093:39063,49094:31185,49095:22771,49096:21683,49097:21487,49098:28212,49099:20811,49100:21051,49101:23458,49102:35838,49103:32943,49104:21827,49105:22438,49106:24691,49107:22353,49108:21549,49109:31354,49110:24656,49111:23380,49112:25511,49113:25248,49114:21475,49115:25187,49116:23495,49117:26543,49118:21741,49119:31391,49120:33510,49121:37239,49122:24211,49123:35044,49124:22840,49125:22446,49126:25358,49127:36328,49128:33007,49129:22359,49130:31607,49131:20393,49132:24555,49133:23485,49134:27454,49135:21281,49136:31568,49137:29378,49138:26694,49139:30719,49140:30518,49141:26103,49142:20917,49143:20111,49144:30420,49145:23743,49146:31397,49147:33909,49148:22862,49149:39745,49150:20608,49216:32350,49217:32351,49218:32352,49219:32353,49220:32354,49221:32355,49222:32356,49223:32357,49224:32358,49225:32359,49226:32360,49227:32361,49228:32362,49229:32363,49230:32364,49231:32365,49232:32366,49233:32367,49234:32368,49235:32369,49236:32370,49237:32371,49238:32372,49239:32373,49240:32374,49241:32375,49242:32376,49243:32377,49244:32378,49245:32379,49246:32380,49247:32381,49248:32382,49249:32383,49250:32384,49251:32385,49252:32387,49253:32388,49254:32389,49255:32390,49256:32391,49257:32392,49258:32393,49259:32394,49260:32395,49261:32396,49262:32397,49263:32398,49264:32399,49265:32400,49266:32401,49267:32402,49268:32403,49269:32404,49270:32405,49271:32406,49272:32407,49273:32408,49274:32409,49275:32410,49276:32412,49277:32413,49278:32414,49280:32430,49281:32436,49282:32443,49283:32444,49284:32470,49285:32484,49286:32492,49287:32505,49288:32522,49289:32528,49290:32542,49291:32567,49292:32569,49293:32571,49294:32572,49295:32573,49296:32574,49297:32575,49298:32576,49299:32577,49300:32579,49301:32582,49302:32583,49303:32584,49304:32585,49305:32586,49306:32587,49307:32588,49308:32589,49309:32590,49310:32591,49311:32594,49312:32595,49313:39304,49314:24871,49315:28291,49316:22372,49317:26118,49318:25414,49319:22256,49320:25324,49321:25193,49322:24275,49323:38420,49324:22403,49325:25289,49326:21895,49327:34593,49328:33098,49329:36771,49330:21862,49331:33713,49332:26469,49333:36182,49334:34013,49335:23146,49336:26639,49337:25318,49338:31726,49339:38417,49340:20848,49341:28572,49342:35888,49343:25597,49344:35272,49345:25042,49346:32518,49347:28866,49348:28389,49349:29701,49350:27028,49351:29436,49352:24266,49353:37070,49354:26391,49355:28010,49356:25438,49357:21171,49358:29282,49359:32769,49360:20332,49361:23013,49362:37226,49363:28889,49364:28061,49365:21202,49366:20048,49367:38647,49368:38253,49369:34174,49370:30922,49371:32047,49372:20769,49373:22418,49374:25794,49375:32907,49376:31867,49377:27882,49378:26865,49379:26974,49380:20919,49381:21400,49382:26792,49383:29313,49384:40654,49385:31729,49386:29432,49387:31163,49388:28435,49389:29702,49390:26446,49391:37324,49392:40100,49393:31036,49394:33673,49395:33620,49396:21519,49397:26647,49398:20029,49399:21385,49400:21169,49401:30782,49402:21382,49403:21033,49404:20616,49405:20363,49406:20432,49472:32598,49473:32601,49474:32603,49475:32604,49476:32605,49477:32606,49478:32608,49479:32611,49480:32612,49481:32613,49482:32614,49483:32615,49484:32619,49485:32620,49486:32621,49487:32623,49488:32624,49489:32627,49490:32629,49491:32630,49492:32631,49493:32632,49494:32634,49495:32635,49496:32636,49497:32637,49498:32639,49499:32640,49500:32642,49501:32643,49502:32644,49503:32645,49504:32646,49505:32647,49506:32648,49507:32649,49508:32651,49509:32653,49510:32655,49511:32656,49512:32657,49513:32658,49514:32659,49515:32661,49516:32662,49517:32663,49518:32664,49519:32665,49520:32667,49521:32668,49522:32672,49523:32674,49524:32675,49525:32677,49526:32678,49527:32680,49528:32681,49529:32682,49530:32683,49531:32684,49532:32685,49533:32686,49534:32689,49536:32691,49537:32692,49538:32693,49539:32694,49540:32695,49541:32698,49542:32699,49543:32702,49544:32704,49545:32706,49546:32707,49547:32708,49548:32710,49549:32711,49550:32712,49551:32713,49552:32715,49553:32717,49554:32719,49555:32720,49556:32721,49557:32722,49558:32723,49559:32726,49560:32727,49561:32729,49562:32730,49563:32731,49564:32732,49565:32733,49566:32734,49567:32738,49568:32739,49569:30178,49570:31435,49571:31890,49572:27813,49573:38582,49574:21147,49575:29827,49576:21737,49577:20457,49578:32852,49579:33714,49580:36830,49581:38256,49582:24265,49583:24604,49584:28063,49585:24088,49586:25947,49587:33080,49588:38142,49589:24651,49590:28860,49591:32451,49592:31918,49593:20937,49594:26753,49595:31921,49596:33391,49597:20004,49598:36742,49599:37327,49600:26238,49601:20142,49602:35845,49603:25769,49604:32842,49605:20698,49606:30103,49607:29134,49608:23525,49609:36797,49610:28518,49611:20102,49612:25730,49613:38243,49614:24278,49615:26009,49616:21015,49617:35010,49618:28872,49619:21155,49620:29454,49621:29747,49622:26519,49623:30967,49624:38678,49625:20020,49626:37051,49627:40158,49628:28107,49629:20955,49630:36161,49631:21533,49632:25294,49633:29618,49634:33777,49635:38646,49636:40836,49637:38083,49638:20278,49639:32666,49640:20940,49641:28789,49642:38517,49643:23725,49644:39046,49645:21478,49646:20196,49647:28316,49648:29705,49649:27060,49650:30827,49651:39311,49652:30041,49653:21016,49654:30244,49655:27969,49656:26611,49657:20845,49658:40857,49659:32843,49660:21657,49661:31548,49662:31423,49728:32740,49729:32743,49730:32744,49731:32746,49732:32747,49733:32748,49734:32749,49735:32751,49736:32754,49737:32756,49738:32757,49739:32758,49740:32759,49741:32760,49742:32761,49743:32762,49744:32765,49745:32766,49746:32767,49747:32770,49748:32775,49749:32776,49750:32777,49751:32778,49752:32782,49753:32783,49754:32785,49755:32787,49756:32794,49757:32795,49758:32797,49759:32798,49760:32799,49761:32801,49762:32803,49763:32804,49764:32811,49765:32812,49766:32813,49767:32814,49768:32815,49769:32816,49770:32818,49771:32820,49772:32825,49773:32826,49774:32828,49775:32830,49776:32832,49777:32833,49778:32836,49779:32837,49780:32839,49781:32840,49782:32841,49783:32846,49784:32847,49785:32848,49786:32849,49787:32851,49788:32853,49789:32854,49790:32855,49792:32857,49793:32859,49794:32860,49795:32861,49796:32862,49797:32863,49798:32864,49799:32865,49800:32866,49801:32867,49802:32868,49803:32869,49804:32870,49805:32871,49806:32872,49807:32875,49808:32876,49809:32877,49810:32878,49811:32879,49812:32880,49813:32882,49814:32883,49815:32884,49816:32885,49817:32886,49818:32887,49819:32888,49820:32889,49821:32890,49822:32891,49823:32892,49824:32893,49825:38534,49826:22404,49827:25314,49828:38471,49829:27004,49830:23044,49831:25602,49832:31699,49833:28431,49834:38475,49835:33446,49836:21346,49837:39045,49838:24208,49839:28809,49840:25523,49841:21348,49842:34383,49843:40065,49844:40595,49845:30860,49846:38706,49847:36335,49848:36162,49849:40575,49850:28510,49851:31108,49852:24405,49853:38470,49854:25134,49855:39540,49856:21525,49857:38109,49858:20387,49859:26053,49860:23653,49861:23649,49862:32533,49863:34385,49864:27695,49865:24459,49866:29575,49867:28388,49868:32511,49869:23782,49870:25371,49871:23402,49872:28390,49873:21365,49874:20081,49875:25504,49876:30053,49877:25249,49878:36718,49879:20262,49880:20177,49881:27814,49882:32438,49883:35770,49884:33821,49885:34746,49886:32599,49887:36923,49888:38179,49889:31657,49890:39585,49891:35064,49892:33853,49893:27931,49894:39558,49895:32476,49896:22920,49897:40635,49898:29595,49899:30721,49900:34434,49901:39532,49902:39554,49903:22043,49904:21527,49905:22475,49906:20080,49907:40614,49908:21334,49909:36808,49910:33033,49911:30610,49912:39314,49913:34542,49914:28385,49915:34067,49916:26364,49917:24930,49918:28459,49984:32894,49985:32897,49986:32898,49987:32901,49988:32904,49989:32906,49990:32909,49991:32910,49992:32911,49993:32912,49994:32913,49995:32914,49996:32916,49997:32917,49998:32919,49999:32921,50000:32926,50001:32931,50002:32934,50003:32935,50004:32936,50005:32940,50006:32944,50007:32947,50008:32949,50009:32950,50010:32952,50011:32953,50012:32955,50013:32965,50014:32967,50015:32968,50016:32969,50017:32970,50018:32971,50019:32975,50020:32976,50021:32977,50022:32978,50023:32979,50024:32980,50025:32981,50026:32984,50027:32991,50028:32992,50029:32994,50030:32995,50031:32998,50032:33006,50033:33013,50034:33015,50035:33017,50036:33019,50037:33022,50038:33023,50039:33024,50040:33025,50041:33027,50042:33028,50043:33029,50044:33031,50045:33032,50046:33035,50048:33036,50049:33045,50050:33047,50051:33049,50052:33051,50053:33052,50054:33053,50055:33055,50056:33056,50057:33057,50058:33058,50059:33059,50060:33060,50061:33061,50062:33062,50063:33063,50064:33064,50065:33065,50066:33066,50067:33067,50068:33069,50069:33070,50070:33072,50071:33075,50072:33076,50073:33077,50074:33079,50075:33081,50076:33082,50077:33083,50078:33084,50079:33085,50080:33087,50081:35881,50082:33426,50083:33579,50084:30450,50085:27667,50086:24537,50087:33725,50088:29483,50089:33541,50090:38170,50091:27611,50092:30683,50093:38086,50094:21359,50095:33538,50096:20882,50097:24125,50098:35980,50099:36152,50100:20040,50101:29611,50102:26522,50103:26757,50104:37238,50105:38665,50106:29028,50107:27809,50108:30473,50109:23186,50110:38209,50111:27599,50112:32654,50113:26151,50114:23504,50115:22969,50116:23194,50117:38376,50118:38391,50119:20204,50120:33804,50121:33945,50122:27308,50123:30431,50124:38192,50125:29467,50126:26790,50127:23391,50128:30511,50129:37274,50130:38753,50131:31964,50132:36855,50133:35868,50134:24357,50135:31859,50136:31192,50137:35269,50138:27852,50139:34588,50140:23494,50141:24130,50142:26825,50143:30496,50144:32501,50145:20885,50146:20813,50147:21193,50148:23081,50149:32517,50150:38754,50151:33495,50152:25551,50153:30596,50154:34256,50155:31186,50156:28218,50157:24217,50158:22937,50159:34065,50160:28781,50161:27665,50162:25279,50163:30399,50164:25935,50165:24751,50166:38397,50167:26126,50168:34719,50169:40483,50170:38125,50171:21517,50172:21629,50173:35884,50174:25720,50240:33088,50241:33089,50242:33090,50243:33091,50244:33092,50245:33093,50246:33095,50247:33097,50248:33101,50249:33102,50250:33103,50251:33106,50252:33110,50253:33111,50254:33112,50255:33115,50256:33116,50257:33117,50258:33118,50259:33119,50260:33121,50261:33122,50262:33123,50263:33124,50264:33126,50265:33128,50266:33130,50267:33131,50268:33132,50269:33135,50270:33138,50271:33139,50272:33141,50273:33142,50274:33143,50275:33144,50276:33153,50277:33155,50278:33156,50279:33157,50280:33158,50281:33159,50282:33161,50283:33163,50284:33164,50285:33165,50286:33166,50287:33168,50288:33170,50289:33171,50290:33172,50291:33173,50292:33174,50293:33175,50294:33177,50295:33178,50296:33182,50297:33183,50298:33184,50299:33185,50300:33186,50301:33188,50302:33189,50304:33191,50305:33193,50306:33195,50307:33196,50308:33197,50309:33198,50310:33199,50311:33200,50312:33201,50313:33202,50314:33204,50315:33205,50316:33206,50317:33207,50318:33208,50319:33209,50320:33212,50321:33213,50322:33214,50323:33215,50324:33220,50325:33221,50326:33223,50327:33224,50328:33225,50329:33227,50330:33229,50331:33230,50332:33231,50333:33232,50334:33233,50335:33234,50336:33235,50337:25721,50338:34321,50339:27169,50340:33180,50341:30952,50342:25705,50343:39764,50344:25273,50345:26411,50346:33707,50347:22696,50348:40664,50349:27819,50350:28448,50351:23518,50352:38476,50353:35851,50354:29279,50355:26576,50356:25287,50357:29281,50358:20137,50359:22982,50360:27597,50361:22675,50362:26286,50363:24149,50364:21215,50365:24917,50366:26408,50367:30446,50368:30566,50369:29287,50370:31302,50371:25343,50372:21738,50373:21584,50374:38048,50375:37027,50376:23068,50377:32435,50378:27670,50379:20035,50380:22902,50381:32784,50382:22856,50383:21335,50384:30007,50385:38590,50386:22218,50387:25376,50388:33041,50389:24700,50390:38393,50391:28118,50392:21602,50393:39297,50394:20869,50395:23273,50396:33021,50397:22958,50398:38675,50399:20522,50400:27877,50401:23612,50402:25311,50403:20320,50404:21311,50405:33147,50406:36870,50407:28346,50408:34091,50409:25288,50410:24180,50411:30910,50412:25781,50413:25467,50414:24565,50415:23064,50416:37247,50417:40479,50418:23615,50419:25423,50420:32834,50421:23421,50422:21870,50423:38218,50424:38221,50425:28037,50426:24744,50427:26592,50428:29406,50429:20957,50430:23425,50496:33236,50497:33237,50498:33238,50499:33239,50500:33240,50501:33241,50502:33242,50503:33243,50504:33244,50505:33245,50506:33246,50507:33247,50508:33248,50509:33249,50510:33250,50511:33252,50512:33253,50513:33254,50514:33256,50515:33257,50516:33259,50517:33262,50518:33263,50519:33264,50520:33265,50521:33266,50522:33269,50523:33270,50524:33271,50525:33272,50526:33273,50527:33274,50528:33277,50529:33279,50530:33283,50531:33287,50532:33288,50533:33289,50534:33290,50535:33291,50536:33294,50537:33295,50538:33297,50539:33299,50540:33301,50541:33302,50542:33303,50543:33304,50544:33305,50545:33306,50546:33309,50547:33312,50548:33316,50549:33317,50550:33318,50551:33319,50552:33321,50553:33326,50554:33330,50555:33338,50556:33340,50557:33341,50558:33343,50560:33344,50561:33345,50562:33346,50563:33347,50564:33349,50565:33350,50566:33352,50567:33354,50568:33356,50569:33357,50570:33358,50571:33360,50572:33361,50573:33362,50574:33363,50575:33364,50576:33365,50577:33366,50578:33367,50579:33369,50580:33371,50581:33372,50582:33373,50583:33374,50584:33376,50585:33377,50586:33378,50587:33379,50588:33380,50589:33381,50590:33382,50591:33383,50592:33385,50593:25319,50594:27870,50595:29275,50596:25197,50597:38062,50598:32445,50599:33043,50600:27987,50601:20892,50602:24324,50603:22900,50604:21162,50605:24594,50606:22899,50607:26262,50608:34384,50609:30111,50610:25386,50611:25062,50612:31983,50613:35834,50614:21734,50615:27431,50616:40485,50617:27572,50618:34261,50619:21589,50620:20598,50621:27812,50622:21866,50623:36276,50624:29228,50625:24085,50626:24597,50627:29750,50628:25293,50629:25490,50630:29260,50631:24472,50632:28227,50633:27966,50634:25856,50635:28504,50636:30424,50637:30928,50638:30460,50639:30036,50640:21028,50641:21467,50642:20051,50643:24222,50644:26049,50645:32810,50646:32982,50647:25243,50648:21638,50649:21032,50650:28846,50651:34957,50652:36305,50653:27873,50654:21624,50655:32986,50656:22521,50657:35060,50658:36180,50659:38506,50660:37197,50661:20329,50662:27803,50663:21943,50664:30406,50665:30768,50666:25256,50667:28921,50668:28558,50669:24429,50670:34028,50671:26842,50672:30844,50673:31735,50674:33192,50675:26379,50676:40527,50677:25447,50678:30896,50679:22383,50680:30738,50681:38713,50682:25209,50683:25259,50684:21128,50685:29749,50686:27607,50752:33386,50753:33387,50754:33388,50755:33389,50756:33393,50757:33397,50758:33398,50759:33399,50760:33400,50761:33403,50762:33404,50763:33408,50764:33409,50765:33411,50766:33413,50767:33414,50768:33415,50769:33417,50770:33420,50771:33424,50772:33427,50773:33428,50774:33429,50775:33430,50776:33434,50777:33435,50778:33438,50779:33440,50780:33442,50781:33443,50782:33447,50783:33458,50784:33461,50785:33462,50786:33466,50787:33467,50788:33468,50789:33471,50790:33472,50791:33474,50792:33475,50793:33477,50794:33478,50795:33481,50796:33488,50797:33494,50798:33497,50799:33498,50800:33501,50801:33506,50802:33511,50803:33512,50804:33513,50805:33514,50806:33516,50807:33517,50808:33518,50809:33520,50810:33522,50811:33523,50812:33525,50813:33526,50814:33528,50816:33530,50817:33532,50818:33533,50819:33534,50820:33535,50821:33536,50822:33546,50823:33547,50824:33549,50825:33552,50826:33554,50827:33555,50828:33558,50829:33560,50830:33561,50831:33565,50832:33566,50833:33567,50834:33568,50835:33569,50836:33570,50837:33571,50838:33572,50839:33573,50840:33574,50841:33577,50842:33578,50843:33582,50844:33584,50845:33586,50846:33591,50847:33595,50848:33597,50849:21860,50850:33086,50851:30130,50852:30382,50853:21305,50854:30174,50855:20731,50856:23617,50857:35692,50858:31687,50859:20559,50860:29255,50861:39575,50862:39128,50863:28418,50864:29922,50865:31080,50866:25735,50867:30629,50868:25340,50869:39057,50870:36139,50871:21697,50872:32856,50873:20050,50874:22378,50875:33529,50876:33805,50877:24179,50878:20973,50879:29942,50880:35780,50881:23631,50882:22369,50883:27900,50884:39047,50885:23110,50886:30772,50887:39748,50888:36843,50889:31893,50890:21078,50891:25169,50892:38138,50893:20166,50894:33670,50895:33889,50896:33769,50897:33970,50898:22484,50899:26420,50900:22275,50901:26222,50902:28006,50903:35889,50904:26333,50905:28689,50906:26399,50907:27450,50908:26646,50909:25114,50910:22971,50911:19971,50912:20932,50913:28422,50914:26578,50915:27791,50916:20854,50917:26827,50918:22855,50919:27495,50920:30054,50921:23822,50922:33040,50923:40784,50924:26071,50925:31048,50926:31041,50927:39569,50928:36215,50929:23682,50930:20062,50931:20225,50932:21551,50933:22865,50934:30732,50935:22120,50936:27668,50937:36804,50938:24323,50939:27773,50940:27875,50941:35755,50942:25488,51008:33598,51009:33599,51010:33601,51011:33602,51012:33604,51013:33605,51014:33608,51015:33610,51016:33611,51017:33612,51018:33613,51019:33614,51020:33619,51021:33621,51022:33622,51023:33623,51024:33624,51025:33625,51026:33629,51027:33634,51028:33648,51029:33649,51030:33650,51031:33651,51032:33652,51033:33653,51034:33654,51035:33657,51036:33658,51037:33662,51038:33663,51039:33664,51040:33665,51041:33666,51042:33667,51043:33668,51044:33671,51045:33672,51046:33674,51047:33675,51048:33676,51049:33677,51050:33679,51051:33680,51052:33681,51053:33684,51054:33685,51055:33686,51056:33687,51057:33689,51058:33690,51059:33693,51060:33695,51061:33697,51062:33698,51063:33699,51064:33700,51065:33701,51066:33702,51067:33703,51068:33708,51069:33709,51070:33710,51072:33711,51073:33717,51074:33723,51075:33726,51076:33727,51077:33730,51078:33731,51079:33732,51080:33734,51081:33736,51082:33737,51083:33739,51084:33741,51085:33742,51086:33744,51087:33745,51088:33746,51089:33747,51090:33749,51091:33751,51092:33753,51093:33754,51094:33755,51095:33758,51096:33762,51097:33763,51098:33764,51099:33766,51100:33767,51101:33768,51102:33771,51103:33772,51104:33773,51105:24688,51106:27965,51107:29301,51108:25190,51109:38030,51110:38085,51111:21315,51112:36801,51113:31614,51114:20191,51115:35878,51116:20094,51117:40660,51118:38065,51119:38067,51120:21069,51121:28508,51122:36963,51123:27973,51124:35892,51125:22545,51126:23884,51127:27424,51128:27465,51129:26538,51130:21595,51131:33108,51132:32652,51133:22681,51134:34103,51135:24378,51136:25250,51137:27207,51138:38201,51139:25970,51140:24708,51141:26725,51142:30631,51143:20052,51144:20392,51145:24039,51146:38808,51147:25772,51148:32728,51149:23789,51150:20431,51151:31373,51152:20999,51153:33540,51154:19988,51155:24623,51156:31363,51157:38054,51158:20405,51159:20146,51160:31206,51161:29748,51162:21220,51163:33465,51164:25810,51165:31165,51166:23517,51167:27777,51168:38738,51169:36731,51170:27682,51171:20542,51172:21375,51173:28165,51174:25806,51175:26228,51176:27696,51177:24773,51178:39031,51179:35831,51180:24198,51181:29756,51182:31351,51183:31179,51184:19992,51185:37041,51186:29699,51187:27714,51188:22234,51189:37195,51190:27845,51191:36235,51192:21306,51193:34502,51194:26354,51195:36527,51196:23624,51197:39537,51198:28192,51264:33774,51265:33775,51266:33779,51267:33780,51268:33781,51269:33782,51270:33783,51271:33786,51272:33787,51273:33788,51274:33790,51275:33791,51276:33792,51277:33794,51278:33797,51279:33799,51280:33800,51281:33801,51282:33802,51283:33808,51284:33810,51285:33811,51286:33812,51287:33813,51288:33814,51289:33815,51290:33817,51291:33818,51292:33819,51293:33822,51294:33823,51295:33824,51296:33825,51297:33826,51298:33827,51299:33833,51300:33834,51301:33835,51302:33836,51303:33837,51304:33838,51305:33839,51306:33840,51307:33842,51308:33843,51309:33844,51310:33845,51311:33846,51312:33847,51313:33849,51314:33850,51315:33851,51316:33854,51317:33855,51318:33856,51319:33857,51320:33858,51321:33859,51322:33860,51323:33861,51324:33863,51325:33864,51326:33865,51328:33866,51329:33867,51330:33868,51331:33869,51332:33870,51333:33871,51334:33872,51335:33874,51336:33875,51337:33876,51338:33877,51339:33878,51340:33880,51341:33885,51342:33886,51343:33887,51344:33888,51345:33890,51346:33892,51347:33893,51348:33894,51349:33895,51350:33896,51351:33898,51352:33902,51353:33903,51354:33904,51355:33906,51356:33908,51357:33911,51358:33913,51359:33915,51360:33916,51361:21462,51362:23094,51363:40843,51364:36259,51365:21435,51366:22280,51367:39079,51368:26435,51369:37275,51370:27849,51371:20840,51372:30154,51373:25331,51374:29356,51375:21048,51376:21149,51377:32570,51378:28820,51379:30264,51380:21364,51381:40522,51382:27063,51383:30830,51384:38592,51385:35033,51386:32676,51387:28982,51388:29123,51389:20873,51390:26579,51391:29924,51392:22756,51393:25880,51394:22199,51395:35753,51396:39286,51397:25200,51398:32469,51399:24825,51400:28909,51401:22764,51402:20161,51403:20154,51404:24525,51405:38887,51406:20219,51407:35748,51408:20995,51409:22922,51410:32427,51411:25172,51412:20173,51413:26085,51414:25102,51415:33592,51416:33993,51417:33635,51418:34701,51419:29076,51420:28342,51421:23481,51422:32466,51423:20887,51424:25545,51425:26580,51426:32905,51427:33593,51428:34837,51429:20754,51430:23418,51431:22914,51432:36785,51433:20083,51434:27741,51435:20837,51436:35109,51437:36719,51438:38446,51439:34122,51440:29790,51441:38160,51442:38384,51443:28070,51444:33509,51445:24369,51446:25746,51447:27922,51448:33832,51449:33134,51450:40131,51451:22622,51452:36187,51453:19977,51454:21441,51520:33917,51521:33918,51522:33919,51523:33920,51524:33921,51525:33923,51526:33924,51527:33925,51528:33926,51529:33930,51530:33933,51531:33935,51532:33936,51533:33937,51534:33938,51535:33939,51536:33940,51537:33941,51538:33942,51539:33944,51540:33946,51541:33947,51542:33949,51543:33950,51544:33951,51545:33952,51546:33954,51547:33955,51548:33956,51549:33957,51550:33958,51551:33959,51552:33960,51553:33961,51554:33962,51555:33963,51556:33964,51557:33965,51558:33966,51559:33968,51560:33969,51561:33971,51562:33973,51563:33974,51564:33975,51565:33979,51566:33980,51567:33982,51568:33984,51569:33986,51570:33987,51571:33989,51572:33990,51573:33991,51574:33992,51575:33995,51576:33996,51577:33998,51578:33999,51579:34002,51580:34004,51581:34005,51582:34007,51584:34008,51585:34009,51586:34010,51587:34011,51588:34012,51589:34014,51590:34017,51591:34018,51592:34020,51593:34023,51594:34024,51595:34025,51596:34026,51597:34027,51598:34029,51599:34030,51600:34031,51601:34033,51602:34034,51603:34035,51604:34036,51605:34037,51606:34038,51607:34039,51608:34040,51609:34041,51610:34042,51611:34043,51612:34045,51613:34046,51614:34048,51615:34049,51616:34050,51617:20254,51618:25955,51619:26705,51620:21971,51621:20007,51622:25620,51623:39578,51624:25195,51625:23234,51626:29791,51627:33394,51628:28073,51629:26862,51630:20711,51631:33678,51632:30722,51633:26432,51634:21049,51635:27801,51636:32433,51637:20667,51638:21861,51639:29022,51640:31579,51641:26194,51642:29642,51643:33515,51644:26441,51645:23665,51646:21024,51647:29053,51648:34923,51649:38378,51650:38485,51651:25797,51652:36193,51653:33203,51654:21892,51655:27733,51656:25159,51657:32558,51658:22674,51659:20260,51660:21830,51661:36175,51662:26188,51663:19978,51664:23578,51665:35059,51666:26786,51667:25422,51668:31245,51669:28903,51670:33421,51671:21242,51672:38902,51673:23569,51674:21736,51675:37045,51676:32461,51677:22882,51678:36170,51679:34503,51680:33292,51681:33293,51682:36198,51683:25668,51684:23556,51685:24913,51686:28041,51687:31038,51688:35774,51689:30775,51690:30003,51691:21627,51692:20280,51693:36523,51694:28145,51695:23072,51696:32453,51697:31070,51698:27784,51699:23457,51700:23158,51701:29978,51702:32958,51703:24910,51704:28183,51705:22768,51706:29983,51707:29989,51708:29298,51709:21319,51710:32499,51776:34051,51777:34052,51778:34053,51779:34054,51780:34055,51781:34056,51782:34057,51783:34058,51784:34059,51785:34061,51786:34062,51787:34063,51788:34064,51789:34066,51790:34068,51791:34069,51792:34070,51793:34072,51794:34073,51795:34075,51796:34076,51797:34077,51798:34078,51799:34080,51800:34082,51801:34083,51802:34084,51803:34085,51804:34086,51805:34087,51806:34088,51807:34089,51808:34090,51809:34093,51810:34094,51811:34095,51812:34096,51813:34097,51814:34098,51815:34099,51816:34100,51817:34101,51818:34102,51819:34110,51820:34111,51821:34112,51822:34113,51823:34114,51824:34116,51825:34117,51826:34118,51827:34119,51828:34123,51829:34124,51830:34125,51831:34126,51832:34127,51833:34128,51834:34129,51835:34130,51836:34131,51837:34132,51838:34133,51840:34135,51841:34136,51842:34138,51843:34139,51844:34140,51845:34141,51846:34143,51847:34144,51848:34145,51849:34146,51850:34147,51851:34149,51852:34150,51853:34151,51854:34153,51855:34154,51856:34155,51857:34156,51858:34157,51859:34158,51860:34159,51861:34160,51862:34161,51863:34163,51864:34165,51865:34166,51866:34167,51867:34168,51868:34172,51869:34173,51870:34175,51871:34176,51872:34177,51873:30465,51874:30427,51875:21097,51876:32988,51877:22307,51878:24072,51879:22833,51880:29422,51881:26045,51882:28287,51883:35799,51884:23608,51885:34417,51886:21313,51887:30707,51888:25342,51889:26102,51890:20160,51891:39135,51892:34432,51893:23454,51894:35782,51895:21490,51896:30690,51897:20351,51898:23630,51899:39542,51900:22987,51901:24335,51902:31034,51903:22763,51904:19990,51905:26623,51906:20107,51907:25325,51908:35475,51909:36893,51910:21183,51911:26159,51912:21980,51913:22124,51914:36866,51915:20181,51916:20365,51917:37322,51918:39280,51919:27663,51920:24066,51921:24643,51922:23460,51923:35270,51924:35797,51925:25910,51926:25163,51927:39318,51928:23432,51929:23551,51930:25480,51931:21806,51932:21463,51933:30246,51934:20861,51935:34092,51936:26530,51937:26803,51938:27530,51939:25234,51940:36755,51941:21460,51942:33298,51943:28113,51944:30095,51945:20070,51946:36174,51947:23408,51948:29087,51949:34223,51950:26257,51951:26329,51952:32626,51953:34560,51954:40653,51955:40736,51956:23646,51957:26415,51958:36848,51959:26641,51960:26463,51961:25101,51962:31446,51963:22661,51964:24246,51965:25968,51966:28465,52032:34178,52033:34179,52034:34182,52035:34184,52036:34185,52037:34186,52038:34187,52039:34188,52040:34189,52041:34190,52042:34192,52043:34193,52044:34194,52045:34195,52046:34196,52047:34197,52048:34198,52049:34199,52050:34200,52051:34201,52052:34202,52053:34205,52054:34206,52055:34207,52056:34208,52057:34209,52058:34210,52059:34211,52060:34213,52061:34214,52062:34215,52063:34217,52064:34219,52065:34220,52066:34221,52067:34225,52068:34226,52069:34227,52070:34228,52071:34229,52072:34230,52073:34232,52074:34234,52075:34235,52076:34236,52077:34237,52078:34238,52079:34239,52080:34240,52081:34242,52082:34243,52083:34244,52084:34245,52085:34246,52086:34247,52087:34248,52088:34250,52089:34251,52090:34252,52091:34253,52092:34254,52093:34257,52094:34258,52096:34260,52097:34262,52098:34263,52099:34264,52100:34265,52101:34266,52102:34267,52103:34269,52104:34270,52105:34271,52106:34272,52107:34273,52108:34274,52109:34275,52110:34277,52111:34278,52112:34279,52113:34280,52114:34282,52115:34283,52116:34284,52117:34285,52118:34286,52119:34287,52120:34288,52121:34289,52122:34290,52123:34291,52124:34292,52125:34293,52126:34294,52127:34295,52128:34296,52129:24661,52130:21047,52131:32781,52132:25684,52133:34928,52134:29993,52135:24069,52136:26643,52137:25332,52138:38684,52139:21452,52140:29245,52141:35841,52142:27700,52143:30561,52144:31246,52145:21550,52146:30636,52147:39034,52148:33308,52149:35828,52150:30805,52151:26388,52152:28865,52153:26031,52154:25749,52155:22070,52156:24605,52157:31169,52158:21496,52159:19997,52160:27515,52161:32902,52162:23546,52163:21987,52164:22235,52165:20282,52166:20284,52167:39282,52168:24051,52169:26494,52170:32824,52171:24578,52172:39042,52173:36865,52174:23435,52175:35772,52176:35829,52177:25628,52178:33368,52179:25822,52180:22013,52181:33487,52182:37221,52183:20439,52184:32032,52185:36895,52186:31903,52187:20723,52188:22609,52189:28335,52190:23487,52191:35785,52192:32899,52193:37240,52194:33948,52195:31639,52196:34429,52197:38539,52198:38543,52199:32485,52200:39635,52201:30862,52202:23681,52203:31319,52204:36930,52205:38567,52206:31071,52207:23385,52208:25439,52209:31499,52210:34001,52211:26797,52212:21766,52213:32553,52214:29712,52215:32034,52216:38145,52217:25152,52218:22604,52219:20182,52220:23427,52221:22905,52222:22612,52288:34297,52289:34298,52290:34300,52291:34301,52292:34302,52293:34304,52294:34305,52295:34306,52296:34307,52297:34308,52298:34310,52299:34311,52300:34312,52301:34313,52302:34314,52303:34315,52304:34316,52305:34317,52306:34318,52307:34319,52308:34320,52309:34322,52310:34323,52311:34324,52312:34325,52313:34327,52314:34328,52315:34329,52316:34330,52317:34331,52318:34332,52319:34333,52320:34334,52321:34335,52322:34336,52323:34337,52324:34338,52325:34339,52326:34340,52327:34341,52328:34342,52329:34344,52330:34346,52331:34347,52332:34348,52333:34349,52334:34350,52335:34351,52336:34352,52337:34353,52338:34354,52339:34355,52340:34356,52341:34357,52342:34358,52343:34359,52344:34361,52345:34362,52346:34363,52347:34365,52348:34366,52349:34367,52350:34368,52352:34369,52353:34370,52354:34371,52355:34372,52356:34373,52357:34374,52358:34375,52359:34376,52360:34377,52361:34378,52362:34379,52363:34380,52364:34386,52365:34387,52366:34389,52367:34390,52368:34391,52369:34392,52370:34393,52371:34395,52372:34396,52373:34397,52374:34399,52375:34400,52376:34401,52377:34403,52378:34404,52379:34405,52380:34406,52381:34407,52382:34408,52383:34409,52384:34410,52385:29549,52386:25374,52387:36427,52388:36367,52389:32974,52390:33492,52391:25260,52392:21488,52393:27888,52394:37214,52395:22826,52396:24577,52397:27760,52398:22349,52399:25674,52400:36138,52401:30251,52402:28393,52403:22363,52404:27264,52405:30192,52406:28525,52407:35885,52408:35848,52409:22374,52410:27631,52411:34962,52412:30899,52413:25506,52414:21497,52415:28845,52416:27748,52417:22616,52418:25642,52419:22530,52420:26848,52421:33179,52422:21776,52423:31958,52424:20504,52425:36538,52426:28108,52427:36255,52428:28907,52429:25487,52430:28059,52431:28372,52432:32486,52433:33796,52434:26691,52435:36867,52436:28120,52437:38518,52438:35752,52439:22871,52440:29305,52441:34276,52442:33150,52443:30140,52444:35466,52445:26799,52446:21076,52447:36386,52448:38161,52449:25552,52450:39064,52451:36420,52452:21884,52453:20307,52454:26367,52455:22159,52456:24789,52457:28053,52458:21059,52459:23625,52460:22825,52461:28155,52462:22635,52463:30000,52464:29980,52465:24684,52466:33300,52467:33094,52468:25361,52469:26465,52470:36834,52471:30522,52472:36339,52473:36148,52474:38081,52475:24086,52476:21381,52477:21548,52478:28867,52544:34413,52545:34415,52546:34416,52547:34418,52548:34419,52549:34420,52550:34421,52551:34422,52552:34423,52553:34424,52554:34435,52555:34436,52556:34437,52557:34438,52558:34439,52559:34440,52560:34441,52561:34446,52562:34447,52563:34448,52564:34449,52565:34450,52566:34452,52567:34454,52568:34455,52569:34456,52570:34457,52571:34458,52572:34459,52573:34462,52574:34463,52575:34464,52576:34465,52577:34466,52578:34469,52579:34470,52580:34475,52581:34477,52582:34478,52583:34482,52584:34483,52585:34487,52586:34488,52587:34489,52588:34491,52589:34492,52590:34493,52591:34494,52592:34495,52593:34497,52594:34498,52595:34499,52596:34501,52597:34504,52598:34508,52599:34509,52600:34514,52601:34515,52602:34517,52603:34518,52604:34519,52605:34522,52606:34524,52608:34525,52609:34528,52610:34529,52611:34530,52612:34531,52613:34533,52614:34534,52615:34535,52616:34536,52617:34538,52618:34539,52619:34540,52620:34543,52621:34549,52622:34550,52623:34551,52624:34554,52625:34555,52626:34556,52627:34557,52628:34559,52629:34561,52630:34564,52631:34565,52632:34566,52633:34571,52634:34572,52635:34574,52636:34575,52637:34576,52638:34577,52639:34580,52640:34582,52641:27712,52642:24311,52643:20572,52644:20141,52645:24237,52646:25402,52647:33351,52648:36890,52649:26704,52650:37230,52651:30643,52652:21516,52653:38108,52654:24420,52655:31461,52656:26742,52657:25413,52658:31570,52659:32479,52660:30171,52661:20599,52662:25237,52663:22836,52664:36879,52665:20984,52666:31171,52667:31361,52668:22270,52669:24466,52670:36884,52671:28034,52672:23648,52673:22303,52674:21520,52675:20820,52676:28237,52677:22242,52678:25512,52679:39059,52680:33151,52681:34581,52682:35114,52683:36864,52684:21534,52685:23663,52686:33216,52687:25302,52688:25176,52689:33073,52690:40501,52691:38464,52692:39534,52693:39548,52694:26925,52695:22949,52696:25299,52697:21822,52698:25366,52699:21703,52700:34521,52701:27964,52702:23043,52703:29926,52704:34972,52705:27498,52706:22806,52707:35916,52708:24367,52709:28286,52710:29609,52711:39037,52712:20024,52713:28919,52714:23436,52715:30871,52716:25405,52717:26202,52718:30358,52719:24779,52720:23451,52721:23113,52722:19975,52723:33109,52724:27754,52725:29579,52726:20129,52727:26505,52728:32593,52729:24448,52730:26106,52731:26395,52732:24536,52733:22916,52734:23041,52800:34585,52801:34587,52802:34589,52803:34591,52804:34592,52805:34596,52806:34598,52807:34599,52808:34600,52809:34602,52810:34603,52811:34604,52812:34605,52813:34607,52814:34608,52815:34610,52816:34611,52817:34613,52818:34614,52819:34616,52820:34617,52821:34618,52822:34620,52823:34621,52824:34624,52825:34625,52826:34626,52827:34627,52828:34628,52829:34629,52830:34630,52831:34634,52832:34635,52833:34637,52834:34639,52835:34640,52836:34641,52837:34642,52838:34644,52839:34645,52840:34646,52841:34648,52842:34650,52843:34651,52844:34652,52845:34653,52846:34654,52847:34655,52848:34657,52849:34658,52850:34662,52851:34663,52852:34664,52853:34665,52854:34666,52855:34667,52856:34668,52857:34669,52858:34671,52859:34673,52860:34674,52861:34675,52862:34677,52864:34679,52865:34680,52866:34681,52867:34682,52868:34687,52869:34688,52870:34689,52871:34692,52872:34694,52873:34695,52874:34697,52875:34698,52876:34700,52877:34702,52878:34703,52879:34704,52880:34705,52881:34706,52882:34708,52883:34709,52884:34710,52885:34712,52886:34713,52887:34714,52888:34715,52889:34716,52890:34717,52891:34718,52892:34720,52893:34721,52894:34722,52895:34723,52896:34724,52897:24013,52898:24494,52899:21361,52900:38886,52901:36829,52902:26693,52903:22260,52904:21807,52905:24799,52906:20026,52907:28493,52908:32500,52909:33479,52910:33806,52911:22996,52912:20255,52913:20266,52914:23614,52915:32428,52916:26410,52917:34074,52918:21619,52919:30031,52920:32963,52921:21890,52922:39759,52923:20301,52924:28205,52925:35859,52926:23561,52927:24944,52928:21355,52929:30239,52930:28201,52931:34442,52932:25991,52933:38395,52934:32441,52935:21563,52936:31283,52937:32010,52938:38382,52939:21985,52940:32705,52941:29934,52942:25373,52943:34583,52944:28065,52945:31389,52946:25105,52947:26017,52948:21351,52949:25569,52950:27779,52951:24043,52952:21596,52953:38056,52954:20044,52955:27745,52956:35820,52957:23627,52958:26080,52959:33436,52960:26791,52961:21566,52962:21556,52963:27595,52964:27494,52965:20116,52966:25410,52967:21320,52968:33310,52969:20237,52970:20398,52971:22366,52972:25098,52973:38654,52974:26212,52975:29289,52976:21247,52977:21153,52978:24735,52979:35823,52980:26132,52981:29081,52982:26512,52983:35199,52984:30802,52985:30717,52986:26224,52987:22075,52988:21560,52989:38177,52990:29306,53056:34725,53057:34726,53058:34727,53059:34729,53060:34730,53061:34734,53062:34736,53063:34737,53064:34738,53065:34740,53066:34742,53067:34743,53068:34744,53069:34745,53070:34747,53071:34748,53072:34750,53073:34751,53074:34753,53075:34754,53076:34755,53077:34756,53078:34757,53079:34759,53080:34760,53081:34761,53082:34764,53083:34765,53084:34766,53085:34767,53086:34768,53087:34772,53088:34773,53089:34774,53090:34775,53091:34776,53092:34777,53093:34778,53094:34780,53095:34781,53096:34782,53097:34783,53098:34785,53099:34786,53100:34787,53101:34788,53102:34790,53103:34791,53104:34792,53105:34793,53106:34795,53107:34796,53108:34797,53109:34799,53110:34800,53111:34801,53112:34802,53113:34803,53114:34804,53115:34805,53116:34806,53117:34807,53118:34808,53120:34810,53121:34811,53122:34812,53123:34813,53124:34815,53125:34816,53126:34817,53127:34818,53128:34820,53129:34821,53130:34822,53131:34823,53132:34824,53133:34825,53134:34827,53135:34828,53136:34829,53137:34830,53138:34831,53139:34832,53140:34833,53141:34834,53142:34836,53143:34839,53144:34840,53145:34841,53146:34842,53147:34844,53148:34845,53149:34846,53150:34847,53151:34848,53152:34851,53153:31232,53154:24687,53155:24076,53156:24713,53157:33181,53158:22805,53159:24796,53160:29060,53161:28911,53162:28330,53163:27728,53164:29312,53165:27268,53166:34989,53167:24109,53168:20064,53169:23219,53170:21916,53171:38115,53172:27927,53173:31995,53174:38553,53175:25103,53176:32454,53177:30606,53178:34430,53179:21283,53180:38686,53181:36758,53182:26247,53183:23777,53184:20384,53185:29421,53186:19979,53187:21414,53188:22799,53189:21523,53190:25472,53191:38184,53192:20808,53193:20185,53194:40092,53195:32420,53196:21688,53197:36132,53198:34900,53199:33335,53200:38386,53201:28046,53202:24358,53203:23244,53204:26174,53205:38505,53206:29616,53207:29486,53208:21439,53209:33146,53210:39301,53211:32673,53212:23466,53213:38519,53214:38480,53215:32447,53216:30456,53217:21410,53218:38262,53219:39321,53220:31665,53221:35140,53222:28248,53223:20065,53224:32724,53225:31077,53226:35814,53227:24819,53228:21709,53229:20139,53230:39033,53231:24055,53232:27233,53233:20687,53234:21521,53235:35937,53236:33831,53237:30813,53238:38660,53239:21066,53240:21742,53241:22179,53242:38144,53243:28040,53244:23477,53245:28102,53246:26195,53312:34852,53313:34853,53314:34854,53315:34855,53316:34856,53317:34857,53318:34858,53319:34859,53320:34860,53321:34861,53322:34862,53323:34863,53324:34864,53325:34865,53326:34867,53327:34868,53328:34869,53329:34870,53330:34871,53331:34872,53332:34874,53333:34875,53334:34877,53335:34878,53336:34879,53337:34881,53338:34882,53339:34883,53340:34886,53341:34887,53342:34888,53343:34889,53344:34890,53345:34891,53346:34894,53347:34895,53348:34896,53349:34897,53350:34898,53351:34899,53352:34901,53353:34902,53354:34904,53355:34906,53356:34907,53357:34908,53358:34909,53359:34910,53360:34911,53361:34912,53362:34918,53363:34919,53364:34922,53365:34925,53366:34927,53367:34929,53368:34931,53369:34932,53370:34933,53371:34934,53372:34936,53373:34937,53374:34938,53376:34939,53377:34940,53378:34944,53379:34947,53380:34950,53381:34951,53382:34953,53383:34954,53384:34956,53385:34958,53386:34959,53387:34960,53388:34961,53389:34963,53390:34964,53391:34965,53392:34967,53393:34968,53394:34969,53395:34970,53396:34971,53397:34973,53398:34974,53399:34975,53400:34976,53401:34977,53402:34979,53403:34981,53404:34982,53405:34983,53406:34984,53407:34985,53408:34986,53409:23567,53410:23389,53411:26657,53412:32918,53413:21880,53414:31505,53415:25928,53416:26964,53417:20123,53418:27463,53419:34638,53420:38795,53421:21327,53422:25375,53423:25658,53424:37034,53425:26012,53426:32961,53427:35856,53428:20889,53429:26800,53430:21368,53431:34809,53432:25032,53433:27844,53434:27899,53435:35874,53436:23633,53437:34218,53438:33455,53439:38156,53440:27427,53441:36763,53442:26032,53443:24571,53444:24515,53445:20449,53446:34885,53447:26143,53448:33125,53449:29481,53450:24826,53451:20852,53452:21009,53453:22411,53454:24418,53455:37026,53456:34892,53457:37266,53458:24184,53459:26447,53460:24615,53461:22995,53462:20804,53463:20982,53464:33016,53465:21256,53466:27769,53467:38596,53468:29066,53469:20241,53470:20462,53471:32670,53472:26429,53473:21957,53474:38152,53475:31168,53476:34966,53477:32483,53478:22687,53479:25100,53480:38656,53481:34394,53482:22040,53483:39035,53484:24464,53485:35768,53486:33988,53487:37207,53488:21465,53489:26093,53490:24207,53491:30044,53492:24676,53493:32110,53494:23167,53495:32490,53496:32493,53497:36713,53498:21927,53499:23459,53500:24748,53501:26059,53502:29572,53568:34988,53569:34990,53570:34991,53571:34992,53572:34994,53573:34995,53574:34996,53575:34997,53576:34998,53577:35000,53578:35001,53579:35002,53580:35003,53581:35005,53582:35006,53583:35007,53584:35008,53585:35011,53586:35012,53587:35015,53588:35016,53589:35018,53590:35019,53591:35020,53592:35021,53593:35023,53594:35024,53595:35025,53596:35027,53597:35030,53598:35031,53599:35034,53600:35035,53601:35036,53602:35037,53603:35038,53604:35040,53605:35041,53606:35046,53607:35047,53608:35049,53609:35050,53610:35051,53611:35052,53612:35053,53613:35054,53614:35055,53615:35058,53616:35061,53617:35062,53618:35063,53619:35066,53620:35067,53621:35069,53622:35071,53623:35072,53624:35073,53625:35075,53626:35076,53627:35077,53628:35078,53629:35079,53630:35080,53632:35081,53633:35083,53634:35084,53635:35085,53636:35086,53637:35087,53638:35089,53639:35092,53640:35093,53641:35094,53642:35095,53643:35096,53644:35100,53645:35101,53646:35102,53647:35103,53648:35104,53649:35106,53650:35107,53651:35108,53652:35110,53653:35111,53654:35112,53655:35113,53656:35116,53657:35117,53658:35118,53659:35119,53660:35121,53661:35122,53662:35123,53663:35125,53664:35127,53665:36873,53666:30307,53667:30505,53668:32474,53669:38772,53670:34203,53671:23398,53672:31348,53673:38634,53674:34880,53675:21195,53676:29071,53677:24490,53678:26092,53679:35810,53680:23547,53681:39535,53682:24033,53683:27529,53684:27739,53685:35757,53686:35759,53687:36874,53688:36805,53689:21387,53690:25276,53691:40486,53692:40493,53693:21568,53694:20011,53695:33469,53696:29273,53697:34460,53698:23830,53699:34905,53700:28079,53701:38597,53702:21713,53703:20122,53704:35766,53705:28937,53706:21693,53707:38409,53708:28895,53709:28153,53710:30416,53711:20005,53712:30740,53713:34578,53714:23721,53715:24310,53716:35328,53717:39068,53718:38414,53719:28814,53720:27839,53721:22852,53722:25513,53723:30524,53724:34893,53725:28436,53726:33395,53727:22576,53728:29141,53729:21388,53730:30746,53731:38593,53732:21761,53733:24422,53734:28976,53735:23476,53736:35866,53737:39564,53738:27523,53739:22830,53740:40495,53741:31207,53742:26472,53743:25196,53744:20335,53745:30113,53746:32650,53747:27915,53748:38451,53749:27687,53750:20208,53751:30162,53752:20859,53753:26679,53754:28478,53755:36992,53756:33136,53757:22934,53758:29814,53824:35128,53825:35129,53826:35130,53827:35131,53828:35132,53829:35133,53830:35134,53831:35135,53832:35136,53833:35138,53834:35139,53835:35141,53836:35142,53837:35143,53838:35144,53839:35145,53840:35146,53841:35147,53842:35148,53843:35149,53844:35150,53845:35151,53846:35152,53847:35153,53848:35154,53849:35155,53850:35156,53851:35157,53852:35158,53853:35159,53854:35160,53855:35161,53856:35162,53857:35163,53858:35164,53859:35165,53860:35168,53861:35169,53862:35170,53863:35171,53864:35172,53865:35173,53866:35175,53867:35176,53868:35177,53869:35178,53870:35179,53871:35180,53872:35181,53873:35182,53874:35183,53875:35184,53876:35185,53877:35186,53878:35187,53879:35188,53880:35189,53881:35190,53882:35191,53883:35192,53884:35193,53885:35194,53886:35196,53888:35197,53889:35198,53890:35200,53891:35202,53892:35204,53893:35205,53894:35207,53895:35208,53896:35209,53897:35210,53898:35211,53899:35212,53900:35213,53901:35214,53902:35215,53903:35216,53904:35217,53905:35218,53906:35219,53907:35220,53908:35221,53909:35222,53910:35223,53911:35224,53912:35225,53913:35226,53914:35227,53915:35228,53916:35229,53917:35230,53918:35231,53919:35232,53920:35233,53921:25671,53922:23591,53923:36965,53924:31377,53925:35875,53926:23002,53927:21676,53928:33280,53929:33647,53930:35201,53931:32768,53932:26928,53933:22094,53934:32822,53935:29239,53936:37326,53937:20918,53938:20063,53939:39029,53940:25494,53941:19994,53942:21494,53943:26355,53944:33099,53945:22812,53946:28082,53947:19968,53948:22777,53949:21307,53950:25558,53951:38129,53952:20381,53953:20234,53954:34915,53955:39056,53956:22839,53957:36951,53958:31227,53959:20202,53960:33008,53961:30097,53962:27778,53963:23452,53964:23016,53965:24413,53966:26885,53967:34433,53968:20506,53969:24050,53970:20057,53971:30691,53972:20197,53973:33402,53974:25233,53975:26131,53976:37009,53977:23673,53978:20159,53979:24441,53980:33222,53981:36920,53982:32900,53983:30123,53984:20134,53985:35028,53986:24847,53987:27589,53988:24518,53989:20041,53990:30410,53991:28322,53992:35811,53993:35758,53994:35850,53995:35793,53996:24322,53997:32764,53998:32716,53999:32462,54000:33589,54001:33643,54002:22240,54003:27575,54004:38899,54005:38452,54006:23035,54007:21535,54008:38134,54009:28139,54010:23493,54011:39278,54012:23609,54013:24341,54014:38544,54080:35234,54081:35235,54082:35236,54083:35237,54084:35238,54085:35239,54086:35240,54087:35241,54088:35242,54089:35243,54090:35244,54091:35245,54092:35246,54093:35247,54094:35248,54095:35249,54096:35250,54097:35251,54098:35252,54099:35253,54100:35254,54101:35255,54102:35256,54103:35257,54104:35258,54105:35259,54106:35260,54107:35261,54108:35262,54109:35263,54110:35264,54111:35267,54112:35277,54113:35283,54114:35284,54115:35285,54116:35287,54117:35288,54118:35289,54119:35291,54120:35293,54121:35295,54122:35296,54123:35297,54124:35298,54125:35300,54126:35303,54127:35304,54128:35305,54129:35306,54130:35308,54131:35309,54132:35310,54133:35312,54134:35313,54135:35314,54136:35316,54137:35317,54138:35318,54139:35319,54140:35320,54141:35321,54142:35322,54144:35323,54145:35324,54146:35325,54147:35326,54148:35327,54149:35329,54150:35330,54151:35331,54152:35332,54153:35333,54154:35334,54155:35336,54156:35337,54157:35338,54158:35339,54159:35340,54160:35341,54161:35342,54162:35343,54163:35344,54164:35345,54165:35346,54166:35347,54167:35348,54168:35349,54169:35350,54170:35351,54171:35352,54172:35353,54173:35354,54174:35355,54175:35356,54176:35357,54177:21360,54178:33521,54179:27185,54180:23156,54181:40560,54182:24212,54183:32552,54184:33721,54185:33828,54186:33829,54187:33639,54188:34631,54189:36814,54190:36194,54191:30408,54192:24433,54193:39062,54194:30828,54195:26144,54196:21727,54197:25317,54198:20323,54199:33219,54200:30152,54201:24248,54202:38605,54203:36362,54204:34553,54205:21647,54206:27891,54207:28044,54208:27704,54209:24703,54210:21191,54211:29992,54212:24189,54213:20248,54214:24736,54215:24551,54216:23588,54217:30001,54218:37038,54219:38080,54220:29369,54221:27833,54222:28216,54223:37193,54224:26377,54225:21451,54226:21491,54227:20305,54228:37321,54229:35825,54230:21448,54231:24188,54232:36802,54233:28132,54234:20110,54235:30402,54236:27014,54237:34398,54238:24858,54239:33286,54240:20313,54241:20446,54242:36926,54243:40060,54244:24841,54245:28189,54246:28180,54247:38533,54248:20104,54249:23089,54250:38632,54251:19982,54252:23679,54253:31161,54254:23431,54255:35821,54256:32701,54257:29577,54258:22495,54259:33419,54260:37057,54261:21505,54262:36935,54263:21947,54264:23786,54265:24481,54266:24840,54267:27442,54268:29425,54269:32946,54270:35465,54336:35358,54337:35359,54338:35360,54339:35361,54340:35362,54341:35363,54342:35364,54343:35365,54344:35366,54345:35367,54346:35368,54347:35369,54348:35370,54349:35371,54350:35372,54351:35373,54352:35374,54353:35375,54354:35376,54355:35377,54356:35378,54357:35379,54358:35380,54359:35381,54360:35382,54361:35383,54362:35384,54363:35385,54364:35386,54365:35387,54366:35388,54367:35389,54368:35391,54369:35392,54370:35393,54371:35394,54372:35395,54373:35396,54374:35397,54375:35398,54376:35399,54377:35401,54378:35402,54379:35403,54380:35404,54381:35405,54382:35406,54383:35407,54384:35408,54385:35409,54386:35410,54387:35411,54388:35412,54389:35413,54390:35414,54391:35415,54392:35416,54393:35417,54394:35418,54395:35419,54396:35420,54397:35421,54398:35422,54400:35423,54401:35424,54402:35425,54403:35426,54404:35427,54405:35428,54406:35429,54407:35430,54408:35431,54409:35432,54410:35433,54411:35434,54412:35435,54413:35436,54414:35437,54415:35438,54416:35439,54417:35440,54418:35441,54419:35442,54420:35443,54421:35444,54422:35445,54423:35446,54424:35447,54425:35448,54426:35450,54427:35451,54428:35452,54429:35453,54430:35454,54431:35455,54432:35456,54433:28020,54434:23507,54435:35029,54436:39044,54437:35947,54438:39533,54439:40499,54440:28170,54441:20900,54442:20803,54443:22435,54444:34945,54445:21407,54446:25588,54447:36757,54448:22253,54449:21592,54450:22278,54451:29503,54452:28304,54453:32536,54454:36828,54455:33489,54456:24895,54457:24616,54458:38498,54459:26352,54460:32422,54461:36234,54462:36291,54463:38053,54464:23731,54465:31908,54466:26376,54467:24742,54468:38405,54469:32792,54470:20113,54471:37095,54472:21248,54473:38504,54474:20801,54475:36816,54476:34164,54477:37213,54478:26197,54479:38901,54480:23381,54481:21277,54482:30776,54483:26434,54484:26685,54485:21705,54486:28798,54487:23472,54488:36733,54489:20877,54490:22312,54491:21681,54492:25874,54493:26242,54494:36190,54495:36163,54496:33039,54497:33900,54498:36973,54499:31967,54500:20991,54501:34299,54502:26531,54503:26089,54504:28577,54505:34468,54506:36481,54507:22122,54508:36896,54509:30338,54510:28790,54511:29157,54512:36131,54513:25321,54514:21017,54515:27901,54516:36156,54517:24590,54518:22686,54519:24974,54520:26366,54521:36192,54522:25166,54523:21939,54524:28195,54525:26413,54526:36711,54592:35457,54593:35458,54594:35459,54595:35460,54596:35461,54597:35462,54598:35463,54599:35464,54600:35467,54601:35468,54602:35469,54603:35470,54604:35471,54605:35472,54606:35473,54607:35474,54608:35476,54609:35477,54610:35478,54611:35479,54612:35480,54613:35481,54614:35482,54615:35483,54616:35484,54617:35485,54618:35486,54619:35487,54620:35488,54621:35489,54622:35490,54623:35491,54624:35492,54625:35493,54626:35494,54627:35495,54628:35496,54629:35497,54630:35498,54631:35499,54632:35500,54633:35501,54634:35502,54635:35503,54636:35504,54637:35505,54638:35506,54639:35507,54640:35508,54641:35509,54642:35510,54643:35511,54644:35512,54645:35513,54646:35514,54647:35515,54648:35516,54649:35517,54650:35518,54651:35519,54652:35520,54653:35521,54654:35522,54656:35523,54657:35524,54658:35525,54659:35526,54660:35527,54661:35528,54662:35529,54663:35530,54664:35531,54665:35532,54666:35533,54667:35534,54668:35535,54669:35536,54670:35537,54671:35538,54672:35539,54673:35540,54674:35541,54675:35542,54676:35543,54677:35544,54678:35545,54679:35546,54680:35547,54681:35548,54682:35549,54683:35550,54684:35551,54685:35552,54686:35553,54687:35554,54688:35555,54689:38113,54690:38392,54691:30504,54692:26629,54693:27048,54694:21643,54695:20045,54696:28856,54697:35784,54698:25688,54699:25995,54700:23429,54701:31364,54702:20538,54703:23528,54704:30651,54705:27617,54706:35449,54707:31896,54708:27838,54709:30415,54710:26025,54711:36759,54712:23853,54713:23637,54714:34360,54715:26632,54716:21344,54717:25112,54718:31449,54719:28251,54720:32509,54721:27167,54722:31456,54723:24432,54724:28467,54725:24352,54726:25484,54727:28072,54728:26454,54729:19976,54730:24080,54731:36134,54732:20183,54733:32960,54734:30260,54735:38556,54736:25307,54737:26157,54738:25214,54739:27836,54740:36213,54741:29031,54742:32617,54743:20806,54744:32903,54745:21484,54746:36974,54747:25240,54748:21746,54749:34544,54750:36761,54751:32773,54752:38167,54753:34071,54754:36825,54755:27993,54756:29645,54757:26015,54758:30495,54759:29956,54760:30759,54761:33275,54762:36126,54763:38024,54764:20390,54765:26517,54766:30137,54767:35786,54768:38663,54769:25391,54770:38215,54771:38453,54772:33976,54773:25379,54774:30529,54775:24449,54776:29424,54777:20105,54778:24596,54779:25972,54780:25327,54781:27491,54782:25919,54848:35556,54849:35557,54850:35558,54851:35559,54852:35560,54853:35561,54854:35562,54855:35563,54856:35564,54857:35565,54858:35566,54859:35567,54860:35568,54861:35569,54862:35570,54863:35571,54864:35572,54865:35573,54866:35574,54867:35575,54868:35576,54869:35577,54870:35578,54871:35579,54872:35580,54873:35581,54874:35582,54875:35583,54876:35584,54877:35585,54878:35586,54879:35587,54880:35588,54881:35589,54882:35590,54883:35592,54884:35593,54885:35594,54886:35595,54887:35596,54888:35597,54889:35598,54890:35599,54891:35600,54892:35601,54893:35602,54894:35603,54895:35604,54896:35605,54897:35606,54898:35607,54899:35608,54900:35609,54901:35610,54902:35611,54903:35612,54904:35613,54905:35614,54906:35615,54907:35616,54908:35617,54909:35618,54910:35619,54912:35620,54913:35621,54914:35623,54915:35624,54916:35625,54917:35626,54918:35627,54919:35628,54920:35629,54921:35630,54922:35631,54923:35632,54924:35633,54925:35634,54926:35635,54927:35636,54928:35637,54929:35638,54930:35639,54931:35640,54932:35641,54933:35642,54934:35643,54935:35644,54936:35645,54937:35646,54938:35647,54939:35648,54940:35649,54941:35650,54942:35651,54943:35652,54944:35653,54945:24103,54946:30151,54947:37073,54948:35777,54949:33437,54950:26525,54951:25903,54952:21553,54953:34584,54954:30693,54955:32930,54956:33026,54957:27713,54958:20043,54959:32455,54960:32844,54961:30452,54962:26893,54963:27542,54964:25191,54965:20540,54966:20356,54967:22336,54968:25351,54969:27490,54970:36286,54971:21482,54972:26088,54973:32440,54974:24535,54975:25370,54976:25527,54977:33267,54978:33268,54979:32622,54980:24092,54981:23769,54982:21046,54983:26234,54984:31209,54985:31258,54986:36136,54987:28825,54988:30164,54989:28382,54990:27835,54991:31378,54992:20013,54993:30405,54994:24544,54995:38047,54996:34935,54997:32456,54998:31181,54999:32959,55000:37325,55001:20210,55002:20247,55003:33311,55004:21608,55005:24030,55006:27954,55007:35788,55008:31909,55009:36724,55010:32920,55011:24090,55012:21650,55013:30385,55014:23449,55015:26172,55016:39588,55017:29664,55018:26666,55019:34523,55020:26417,55021:29482,55022:35832,55023:35803,55024:36880,55025:31481,55026:28891,55027:29038,55028:25284,55029:30633,55030:22065,55031:20027,55032:33879,55033:26609,55034:21161,55035:34496,55036:36142,55037:38136,55038:31569,55104:35654,55105:35655,55106:35656,55107:35657,55108:35658,55109:35659,55110:35660,55111:35661,55112:35662,55113:35663,55114:35664,55115:35665,55116:35666,55117:35667,55118:35668,55119:35669,55120:35670,55121:35671,55122:35672,55123:35673,55124:35674,55125:35675,55126:35676,55127:35677,55128:35678,55129:35679,55130:35680,55131:35681,55132:35682,55133:35683,55134:35684,55135:35685,55136:35687,55137:35688,55138:35689,55139:35690,55140:35691,55141:35693,55142:35694,55143:35695,55144:35696,55145:35697,55146:35698,55147:35699,55148:35700,55149:35701,55150:35702,55151:35703,55152:35704,55153:35705,55154:35706,55155:35707,55156:35708,55157:35709,55158:35710,55159:35711,55160:35712,55161:35713,55162:35714,55163:35715,55164:35716,55165:35717,55166:35718,55168:35719,55169:35720,55170:35721,55171:35722,55172:35723,55173:35724,55174:35725,55175:35726,55176:35727,55177:35728,55178:35729,55179:35730,55180:35731,55181:35732,55182:35733,55183:35734,55184:35735,55185:35736,55186:35737,55187:35738,55188:35739,55189:35740,55190:35741,55191:35742,55192:35743,55193:35756,55194:35761,55195:35771,55196:35783,55197:35792,55198:35818,55199:35849,55200:35870,55201:20303,55202:27880,55203:31069,55204:39547,55205:25235,55206:29226,55207:25341,55208:19987,55209:30742,55210:36716,55211:25776,55212:36186,55213:31686,55214:26729,55215:24196,55216:35013,55217:22918,55218:25758,55219:22766,55220:29366,55221:26894,55222:38181,55223:36861,55224:36184,55225:22368,55226:32512,55227:35846,55228:20934,55229:25417,55230:25305,55231:21331,55232:26700,55233:29730,55234:33537,55235:37196,55236:21828,55237:30528,55238:28796,55239:27978,55240:20857,55241:21672,55242:36164,55243:23039,55244:28363,55245:28100,55246:23388,55247:32043,55248:20180,55249:31869,55250:28371,55251:23376,55252:33258,55253:28173,55254:23383,55255:39683,55256:26837,55257:36394,55258:23447,55259:32508,55260:24635,55261:32437,55262:37049,55263:36208,55264:22863,55265:25549,55266:31199,55267:36275,55268:21330,55269:26063,55270:31062,55271:35781,55272:38459,55273:32452,55274:38075,55275:32386,55276:22068,55277:37257,55278:26368,55279:32618,55280:23562,55281:36981,55282:26152,55283:24038,55284:20304,55285:26590,55286:20570,55287:20316,55288:22352,55289:24231,55290:59408,55291:59409,55292:59410,55293:59411,55294:59412,55360:35896,55361:35897,55362:35898,55363:35899,55364:35900,55365:35901,55366:35902,55367:35903,55368:35904,55369:35906,55370:35907,55371:35908,55372:35909,55373:35912,55374:35914,55375:35915,55376:35917,55377:35918,55378:35919,55379:35920,55380:35921,55381:35922,55382:35923,55383:35924,55384:35926,55385:35927,55386:35928,55387:35929,55388:35931,55389:35932,55390:35933,55391:35934,55392:35935,55393:35936,55394:35939,55395:35940,55396:35941,55397:35942,55398:35943,55399:35944,55400:35945,55401:35948,55402:35949,55403:35950,55404:35951,55405:35952,55406:35953,55407:35954,55408:35956,55409:35957,55410:35958,55411:35959,55412:35963,55413:35964,55414:35965,55415:35966,55416:35967,55417:35968,55418:35969,55419:35971,55420:35972,55421:35974,55422:35975,55424:35976,55425:35979,55426:35981,55427:35982,55428:35983,55429:35984,55430:35985,55431:35986,55432:35987,55433:35989,55434:35990,55435:35991,55436:35993,55437:35994,55438:35995,55439:35996,55440:35997,55441:35998,55442:35999,55443:36000,55444:36001,55445:36002,55446:36003,55447:36004,55448:36005,55449:36006,55450:36007,55451:36008,55452:36009,55453:36010,55454:36011,55455:36012,55456:36013,55457:20109,55458:19980,55459:20800,55460:19984,55461:24319,55462:21317,55463:19989,55464:20120,55465:19998,55466:39730,55467:23404,55468:22121,55469:20008,55470:31162,55471:20031,55472:21269,55473:20039,55474:22829,55475:29243,55476:21358,55477:27664,55478:22239,55479:32996,55480:39319,55481:27603,55482:30590,55483:40727,55484:20022,55485:20127,55486:40720,55487:20060,55488:20073,55489:20115,55490:33416,55491:23387,55492:21868,55493:22031,55494:20164,55495:21389,55496:21405,55497:21411,55498:21413,55499:21422,55500:38757,55501:36189,55502:21274,55503:21493,55504:21286,55505:21294,55506:21310,55507:36188,55508:21350,55509:21347,55510:20994,55511:21000,55512:21006,55513:21037,55514:21043,55515:21055,55516:21056,55517:21068,55518:21086,55519:21089,55520:21084,55521:33967,55522:21117,55523:21122,55524:21121,55525:21136,55526:21139,55527:20866,55528:32596,55529:20155,55530:20163,55531:20169,55532:20162,55533:20200,55534:20193,55535:20203,55536:20190,55537:20251,55538:20211,55539:20258,55540:20324,55541:20213,55542:20261,55543:20263,55544:20233,55545:20267,55546:20318,55547:20327,55548:25912,55549:20314,55550:20317,55616:36014,55617:36015,55618:36016,55619:36017,55620:36018,55621:36019,55622:36020,55623:36021,55624:36022,55625:36023,55626:36024,55627:36025,55628:36026,55629:36027,55630:36028,55631:36029,55632:36030,55633:36031,55634:36032,55635:36033,55636:36034,55637:36035,55638:36036,55639:36037,55640:36038,55641:36039,55642:36040,55643:36041,55644:36042,55645:36043,55646:36044,55647:36045,55648:36046,55649:36047,55650:36048,55651:36049,55652:36050,55653:36051,55654:36052,55655:36053,55656:36054,55657:36055,55658:36056,55659:36057,55660:36058,55661:36059,55662:36060,55663:36061,55664:36062,55665:36063,55666:36064,55667:36065,55668:36066,55669:36067,55670:36068,55671:36069,55672:36070,55673:36071,55674:36072,55675:36073,55676:36074,55677:36075,55678:36076,55680:36077,55681:36078,55682:36079,55683:36080,55684:36081,55685:36082,55686:36083,55687:36084,55688:36085,55689:36086,55690:36087,55691:36088,55692:36089,55693:36090,55694:36091,55695:36092,55696:36093,55697:36094,55698:36095,55699:36096,55700:36097,55701:36098,55702:36099,55703:36100,55704:36101,55705:36102,55706:36103,55707:36104,55708:36105,55709:36106,55710:36107,55711:36108,55712:36109,55713:20319,55714:20311,55715:20274,55716:20285,55717:20342,55718:20340,55719:20369,55720:20361,55721:20355,55722:20367,55723:20350,55724:20347,55725:20394,55726:20348,55727:20396,55728:20372,55729:20454,55730:20456,55731:20458,55732:20421,55733:20442,55734:20451,55735:20444,55736:20433,55737:20447,55738:20472,55739:20521,55740:20556,55741:20467,55742:20524,55743:20495,55744:20526,55745:20525,55746:20478,55747:20508,55748:20492,55749:20517,55750:20520,55751:20606,55752:20547,55753:20565,55754:20552,55755:20558,55756:20588,55757:20603,55758:20645,55759:20647,55760:20649,55761:20666,55762:20694,55763:20742,55764:20717,55765:20716,55766:20710,55767:20718,55768:20743,55769:20747,55770:20189,55771:27709,55772:20312,55773:20325,55774:20430,55775:40864,55776:27718,55777:31860,55778:20846,55779:24061,55780:40649,55781:39320,55782:20865,55783:22804,55784:21241,55785:21261,55786:35335,55787:21264,55788:20971,55789:22809,55790:20821,55791:20128,55792:20822,55793:20147,55794:34926,55795:34980,55796:20149,55797:33044,55798:35026,55799:31104,55800:23348,55801:34819,55802:32696,55803:20907,55804:20913,55805:20925,55806:20924,55872:36110,55873:36111,55874:36112,55875:36113,55876:36114,55877:36115,55878:36116,55879:36117,55880:36118,55881:36119,55882:36120,55883:36121,55884:36122,55885:36123,55886:36124,55887:36128,55888:36177,55889:36178,55890:36183,55891:36191,55892:36197,55893:36200,55894:36201,55895:36202,55896:36204,55897:36206,55898:36207,55899:36209,55900:36210,55901:36216,55902:36217,55903:36218,55904:36219,55905:36220,55906:36221,55907:36222,55908:36223,55909:36224,55910:36226,55911:36227,55912:36230,55913:36231,55914:36232,55915:36233,55916:36236,55917:36237,55918:36238,55919:36239,55920:36240,55921:36242,55922:36243,55923:36245,55924:36246,55925:36247,55926:36248,55927:36249,55928:36250,55929:36251,55930:36252,55931:36253,55932:36254,55933:36256,55934:36257,55936:36258,55937:36260,55938:36261,55939:36262,55940:36263,55941:36264,55942:36265,55943:36266,55944:36267,55945:36268,55946:36269,55947:36270,55948:36271,55949:36272,55950:36274,55951:36278,55952:36279,55953:36281,55954:36283,55955:36285,55956:36288,55957:36289,55958:36290,55959:36293,55960:36295,55961:36296,55962:36297,55963:36298,55964:36301,55965:36304,55966:36306,55967:36307,55968:36308,55969:20935,55970:20886,55971:20898,55972:20901,55973:35744,55974:35750,55975:35751,55976:35754,55977:35764,55978:35765,55979:35767,55980:35778,55981:35779,55982:35787,55983:35791,55984:35790,55985:35794,55986:35795,55987:35796,55988:35798,55989:35800,55990:35801,55991:35804,55992:35807,55993:35808,55994:35812,55995:35816,55996:35817,55997:35822,55998:35824,55999:35827,56000:35830,56001:35833,56002:35836,56003:35839,56004:35840,56005:35842,56006:35844,56007:35847,56008:35852,56009:35855,56010:35857,56011:35858,56012:35860,56013:35861,56014:35862,56015:35865,56016:35867,56017:35864,56018:35869,56019:35871,56020:35872,56021:35873,56022:35877,56023:35879,56024:35882,56025:35883,56026:35886,56027:35887,56028:35890,56029:35891,56030:35893,56031:35894,56032:21353,56033:21370,56034:38429,56035:38434,56036:38433,56037:38449,56038:38442,56039:38461,56040:38460,56041:38466,56042:38473,56043:38484,56044:38495,56045:38503,56046:38508,56047:38514,56048:38516,56049:38536,56050:38541,56051:38551,56052:38576,56053:37015,56054:37019,56055:37021,56056:37017,56057:37036,56058:37025,56059:37044,56060:37043,56061:37046,56062:37050,56128:36309,56129:36312,56130:36313,56131:36316,56132:36320,56133:36321,56134:36322,56135:36325,56136:36326,56137:36327,56138:36329,56139:36333,56140:36334,56141:36336,56142:36337,56143:36338,56144:36340,56145:36342,56146:36348,56147:36350,56148:36351,56149:36352,56150:36353,56151:36354,56152:36355,56153:36356,56154:36358,56155:36359,56156:36360,56157:36363,56158:36365,56159:36366,56160:36368,56161:36369,56162:36370,56163:36371,56164:36373,56165:36374,56166:36375,56167:36376,56168:36377,56169:36378,56170:36379,56171:36380,56172:36384,56173:36385,56174:36388,56175:36389,56176:36390,56177:36391,56178:36392,56179:36395,56180:36397,56181:36400,56182:36402,56183:36403,56184:36404,56185:36406,56186:36407,56187:36408,56188:36411,56189:36412,56190:36414,56192:36415,56193:36419,56194:36421,56195:36422,56196:36428,56197:36429,56198:36430,56199:36431,56200:36432,56201:36435,56202:36436,56203:36437,56204:36438,56205:36439,56206:36440,56207:36442,56208:36443,56209:36444,56210:36445,56211:36446,56212:36447,56213:36448,56214:36449,56215:36450,56216:36451,56217:36452,56218:36453,56219:36455,56220:36456,56221:36458,56222:36459,56223:36462,56224:36465,56225:37048,56226:37040,56227:37071,56228:37061,56229:37054,56230:37072,56231:37060,56232:37063,56233:37075,56234:37094,56235:37090,56236:37084,56237:37079,56238:37083,56239:37099,56240:37103,56241:37118,56242:37124,56243:37154,56244:37150,56245:37155,56246:37169,56247:37167,56248:37177,56249:37187,56250:37190,56251:21005,56252:22850,56253:21154,56254:21164,56255:21165,56256:21182,56257:21759,56258:21200,56259:21206,56260:21232,56261:21471,56262:29166,56263:30669,56264:24308,56265:20981,56266:20988,56267:39727,56268:21430,56269:24321,56270:30042,56271:24047,56272:22348,56273:22441,56274:22433,56275:22654,56276:22716,56277:22725,56278:22737,56279:22313,56280:22316,56281:22314,56282:22323,56283:22329,56284:22318,56285:22319,56286:22364,56287:22331,56288:22338,56289:22377,56290:22405,56291:22379,56292:22406,56293:22396,56294:22395,56295:22376,56296:22381,56297:22390,56298:22387,56299:22445,56300:22436,56301:22412,56302:22450,56303:22479,56304:22439,56305:22452,56306:22419,56307:22432,56308:22485,56309:22488,56310:22490,56311:22489,56312:22482,56313:22456,56314:22516,56315:22511,56316:22520,56317:22500,56318:22493,56384:36467,56385:36469,56386:36471,56387:36472,56388:36473,56389:36474,56390:36475,56391:36477,56392:36478,56393:36480,56394:36482,56395:36483,56396:36484,56397:36486,56398:36488,56399:36489,56400:36490,56401:36491,56402:36492,56403:36493,56404:36494,56405:36497,56406:36498,56407:36499,56408:36501,56409:36502,56410:36503,56411:36504,56412:36505,56413:36506,56414:36507,56415:36509,56416:36511,56417:36512,56418:36513,56419:36514,56420:36515,56421:36516,56422:36517,56423:36518,56424:36519,56425:36520,56426:36521,56427:36522,56428:36525,56429:36526,56430:36528,56431:36529,56432:36531,56433:36532,56434:36533,56435:36534,56436:36535,56437:36536,56438:36537,56439:36539,56440:36540,56441:36541,56442:36542,56443:36543,56444:36544,56445:36545,56446:36546,56448:36547,56449:36548,56450:36549,56451:36550,56452:36551,56453:36552,56454:36553,56455:36554,56456:36555,56457:36556,56458:36557,56459:36559,56460:36560,56461:36561,56462:36562,56463:36563,56464:36564,56465:36565,56466:36566,56467:36567,56468:36568,56469:36569,56470:36570,56471:36571,56472:36572,56473:36573,56474:36574,56475:36575,56476:36576,56477:36577,56478:36578,56479:36579,56480:36580,56481:22539,56482:22541,56483:22525,56484:22509,56485:22528,56486:22558,56487:22553,56488:22596,56489:22560,56490:22629,56491:22636,56492:22657,56493:22665,56494:22682,56495:22656,56496:39336,56497:40729,56498:25087,56499:33401,56500:33405,56501:33407,56502:33423,56503:33418,56504:33448,56505:33412,56506:33422,56507:33425,56508:33431,56509:33433,56510:33451,56511:33464,56512:33470,56513:33456,56514:33480,56515:33482,56516:33507,56517:33432,56518:33463,56519:33454,56520:33483,56521:33484,56522:33473,56523:33449,56524:33460,56525:33441,56526:33450,56527:33439,56528:33476,56529:33486,56530:33444,56531:33505,56532:33545,56533:33527,56534:33508,56535:33551,56536:33543,56537:33500,56538:33524,56539:33490,56540:33496,56541:33548,56542:33531,56543:33491,56544:33553,56545:33562,56546:33542,56547:33556,56548:33557,56549:33504,56550:33493,56551:33564,56552:33617,56553:33627,56554:33628,56555:33544,56556:33682,56557:33596,56558:33588,56559:33585,56560:33691,56561:33630,56562:33583,56563:33615,56564:33607,56565:33603,56566:33631,56567:33600,56568:33559,56569:33632,56570:33581,56571:33594,56572:33587,56573:33638,56574:33637,56640:36581,56641:36582,56642:36583,56643:36584,56644:36585,56645:36586,56646:36587,56647:36588,56648:36589,56649:36590,56650:36591,56651:36592,56652:36593,56653:36594,56654:36595,56655:36596,56656:36597,56657:36598,56658:36599,56659:36600,56660:36601,56661:36602,56662:36603,56663:36604,56664:36605,56665:36606,56666:36607,56667:36608,56668:36609,56669:36610,56670:36611,56671:36612,56672:36613,56673:36614,56674:36615,56675:36616,56676:36617,56677:36618,56678:36619,56679:36620,56680:36621,56681:36622,56682:36623,56683:36624,56684:36625,56685:36626,56686:36627,56687:36628,56688:36629,56689:36630,56690:36631,56691:36632,56692:36633,56693:36634,56694:36635,56695:36636,56696:36637,56697:36638,56698:36639,56699:36640,56700:36641,56701:36642,56702:36643,56704:36644,56705:36645,56706:36646,56707:36647,56708:36648,56709:36649,56710:36650,56711:36651,56712:36652,56713:36653,56714:36654,56715:36655,56716:36656,56717:36657,56718:36658,56719:36659,56720:36660,56721:36661,56722:36662,56723:36663,56724:36664,56725:36665,56726:36666,56727:36667,56728:36668,56729:36669,56730:36670,56731:36671,56732:36672,56733:36673,56734:36674,56735:36675,56736:36676,56737:33640,56738:33563,56739:33641,56740:33644,56741:33642,56742:33645,56743:33646,56744:33712,56745:33656,56746:33715,56747:33716,56748:33696,56749:33706,56750:33683,56751:33692,56752:33669,56753:33660,56754:33718,56755:33705,56756:33661,56757:33720,56758:33659,56759:33688,56760:33694,56761:33704,56762:33722,56763:33724,56764:33729,56765:33793,56766:33765,56767:33752,56768:22535,56769:33816,56770:33803,56771:33757,56772:33789,56773:33750,56774:33820,56775:33848,56776:33809,56777:33798,56778:33748,56779:33759,56780:33807,56781:33795,56782:33784,56783:33785,56784:33770,56785:33733,56786:33728,56787:33830,56788:33776,56789:33761,56790:33884,56791:33873,56792:33882,56793:33881,56794:33907,56795:33927,56796:33928,56797:33914,56798:33929,56799:33912,56800:33852,56801:33862,56802:33897,56803:33910,56804:33932,56805:33934,56806:33841,56807:33901,56808:33985,56809:33997,56810:34000,56811:34022,56812:33981,56813:34003,56814:33994,56815:33983,56816:33978,56817:34016,56818:33953,56819:33977,56820:33972,56821:33943,56822:34021,56823:34019,56824:34060,56825:29965,56826:34104,56827:34032,56828:34105,56829:34079,56830:34106,56896:36677,56897:36678,56898:36679,56899:36680,56900:36681,56901:36682,56902:36683,56903:36684,56904:36685,56905:36686,56906:36687,56907:36688,56908:36689,56909:36690,56910:36691,56911:36692,56912:36693,56913:36694,56914:36695,56915:36696,56916:36697,56917:36698,56918:36699,56919:36700,56920:36701,56921:36702,56922:36703,56923:36704,56924:36705,56925:36706,56926:36707,56927:36708,56928:36709,56929:36714,56930:36736,56931:36748,56932:36754,56933:36765,56934:36768,56935:36769,56936:36770,56937:36772,56938:36773,56939:36774,56940:36775,56941:36778,56942:36780,56943:36781,56944:36782,56945:36783,56946:36786,56947:36787,56948:36788,56949:36789,56950:36791,56951:36792,56952:36794,56953:36795,56954:36796,56955:36799,56956:36800,56957:36803,56958:36806,56960:36809,56961:36810,56962:36811,56963:36812,56964:36813,56965:36815,56966:36818,56967:36822,56968:36823,56969:36826,56970:36832,56971:36833,56972:36835,56973:36839,56974:36844,56975:36847,56976:36849,56977:36850,56978:36852,56979:36853,56980:36854,56981:36858,56982:36859,56983:36860,56984:36862,56985:36863,56986:36871,56987:36872,56988:36876,56989:36878,56990:36883,56991:36885,56992:36888,56993:34134,56994:34107,56995:34047,56996:34044,56997:34137,56998:34120,56999:34152,57000:34148,57001:34142,57002:34170,57003:30626,57004:34115,57005:34162,57006:34171,57007:34212,57008:34216,57009:34183,57010:34191,57011:34169,57012:34222,57013:34204,57014:34181,57015:34233,57016:34231,57017:34224,57018:34259,57019:34241,57020:34268,57021:34303,57022:34343,57023:34309,57024:34345,57025:34326,57026:34364,57027:24318,57028:24328,57029:22844,57030:22849,57031:32823,57032:22869,57033:22874,57034:22872,57035:21263,57036:23586,57037:23589,57038:23596,57039:23604,57040:25164,57041:25194,57042:25247,57043:25275,57044:25290,57045:25306,57046:25303,57047:25326,57048:25378,57049:25334,57050:25401,57051:25419,57052:25411,57053:25517,57054:25590,57055:25457,57056:25466,57057:25486,57058:25524,57059:25453,57060:25516,57061:25482,57062:25449,57063:25518,57064:25532,57065:25586,57066:25592,57067:25568,57068:25599,57069:25540,57070:25566,57071:25550,57072:25682,57073:25542,57074:25534,57075:25669,57076:25665,57077:25611,57078:25627,57079:25632,57080:25612,57081:25638,57082:25633,57083:25694,57084:25732,57085:25709,57086:25750,57152:36889,57153:36892,57154:36899,57155:36900,57156:36901,57157:36903,57158:36904,57159:36905,57160:36906,57161:36907,57162:36908,57163:36912,57164:36913,57165:36914,57166:36915,57167:36916,57168:36919,57169:36921,57170:36922,57171:36925,57172:36927,57173:36928,57174:36931,57175:36933,57176:36934,57177:36936,57178:36937,57179:36938,57180:36939,57181:36940,57182:36942,57183:36948,57184:36949,57185:36950,57186:36953,57187:36954,57188:36956,57189:36957,57190:36958,57191:36959,57192:36960,57193:36961,57194:36964,57195:36966,57196:36967,57197:36969,57198:36970,57199:36971,57200:36972,57201:36975,57202:36976,57203:36977,57204:36978,57205:36979,57206:36982,57207:36983,57208:36984,57209:36985,57210:36986,57211:36987,57212:36988,57213:36990,57214:36993,57216:36996,57217:36997,57218:36998,57219:36999,57220:37001,57221:37002,57222:37004,57223:37005,57224:37006,57225:37007,57226:37008,57227:37010,57228:37012,57229:37014,57230:37016,57231:37018,57232:37020,57233:37022,57234:37023,57235:37024,57236:37028,57237:37029,57238:37031,57239:37032,57240:37033,57241:37035,57242:37037,57243:37042,57244:37047,57245:37052,57246:37053,57247:37055,57248:37056,57249:25722,57250:25783,57251:25784,57252:25753,57253:25786,57254:25792,57255:25808,57256:25815,57257:25828,57258:25826,57259:25865,57260:25893,57261:25902,57262:24331,57263:24530,57264:29977,57265:24337,57266:21343,57267:21489,57268:21501,57269:21481,57270:21480,57271:21499,57272:21522,57273:21526,57274:21510,57275:21579,57276:21586,57277:21587,57278:21588,57279:21590,57280:21571,57281:21537,57282:21591,57283:21593,57284:21539,57285:21554,57286:21634,57287:21652,57288:21623,57289:21617,57290:21604,57291:21658,57292:21659,57293:21636,57294:21622,57295:21606,57296:21661,57297:21712,57298:21677,57299:21698,57300:21684,57301:21714,57302:21671,57303:21670,57304:21715,57305:21716,57306:21618,57307:21667,57308:21717,57309:21691,57310:21695,57311:21708,57312:21721,57313:21722,57314:21724,57315:21673,57316:21674,57317:21668,57318:21725,57319:21711,57320:21726,57321:21787,57322:21735,57323:21792,57324:21757,57325:21780,57326:21747,57327:21794,57328:21795,57329:21775,57330:21777,57331:21799,57332:21802,57333:21863,57334:21903,57335:21941,57336:21833,57337:21869,57338:21825,57339:21845,57340:21823,57341:21840,57342:21820,57408:37058,57409:37059,57410:37062,57411:37064,57412:37065,57413:37067,57414:37068,57415:37069,57416:37074,57417:37076,57418:37077,57419:37078,57420:37080,57421:37081,57422:37082,57423:37086,57424:37087,57425:37088,57426:37091,57427:37092,57428:37093,57429:37097,57430:37098,57431:37100,57432:37102,57433:37104,57434:37105,57435:37106,57436:37107,57437:37109,57438:37110,57439:37111,57440:37113,57441:37114,57442:37115,57443:37116,57444:37119,57445:37120,57446:37121,57447:37123,57448:37125,57449:37126,57450:37127,57451:37128,57452:37129,57453:37130,57454:37131,57455:37132,57456:37133,57457:37134,57458:37135,57459:37136,57460:37137,57461:37138,57462:37139,57463:37140,57464:37141,57465:37142,57466:37143,57467:37144,57468:37146,57469:37147,57470:37148,57472:37149,57473:37151,57474:37152,57475:37153,57476:37156,57477:37157,57478:37158,57479:37159,57480:37160,57481:37161,57482:37162,57483:37163,57484:37164,57485:37165,57486:37166,57487:37168,57488:37170,57489:37171,57490:37172,57491:37173,57492:37174,57493:37175,57494:37176,57495:37178,57496:37179,57497:37180,57498:37181,57499:37182,57500:37183,57501:37184,57502:37185,57503:37186,57504:37188,57505:21815,57506:21846,57507:21877,57508:21878,57509:21879,57510:21811,57511:21808,57512:21852,57513:21899,57514:21970,57515:21891,57516:21937,57517:21945,57518:21896,57519:21889,57520:21919,57521:21886,57522:21974,57523:21905,57524:21883,57525:21983,57526:21949,57527:21950,57528:21908,57529:21913,57530:21994,57531:22007,57532:21961,57533:22047,57534:21969,57535:21995,57536:21996,57537:21972,57538:21990,57539:21981,57540:21956,57541:21999,57542:21989,57543:22002,57544:22003,57545:21964,57546:21965,57547:21992,57548:22005,57549:21988,57550:36756,57551:22046,57552:22024,57553:22028,57554:22017,57555:22052,57556:22051,57557:22014,57558:22016,57559:22055,57560:22061,57561:22104,57562:22073,57563:22103,57564:22060,57565:22093,57566:22114,57567:22105,57568:22108,57569:22092,57570:22100,57571:22150,57572:22116,57573:22129,57574:22123,57575:22139,57576:22140,57577:22149,57578:22163,57579:22191,57580:22228,57581:22231,57582:22237,57583:22241,57584:22261,57585:22251,57586:22265,57587:22271,57588:22276,57589:22282,57590:22281,57591:22300,57592:24079,57593:24089,57594:24084,57595:24081,57596:24113,57597:24123,57598:24124,57664:37189,57665:37191,57666:37192,57667:37201,57668:37203,57669:37204,57670:37205,57671:37206,57672:37208,57673:37209,57674:37211,57675:37212,57676:37215,57677:37216,57678:37222,57679:37223,57680:37224,57681:37227,57682:37229,57683:37235,57684:37242,57685:37243,57686:37244,57687:37248,57688:37249,57689:37250,57690:37251,57691:37252,57692:37254,57693:37256,57694:37258,57695:37262,57696:37263,57697:37267,57698:37268,57699:37269,57700:37270,57701:37271,57702:37272,57703:37273,57704:37276,57705:37277,57706:37278,57707:37279,57708:37280,57709:37281,57710:37284,57711:37285,57712:37286,57713:37287,57714:37288,57715:37289,57716:37291,57717:37292,57718:37296,57719:37297,57720:37298,57721:37299,57722:37302,57723:37303,57724:37304,57725:37305,57726:37307,57728:37308,57729:37309,57730:37310,57731:37311,57732:37312,57733:37313,57734:37314,57735:37315,57736:37316,57737:37317,57738:37318,57739:37320,57740:37323,57741:37328,57742:37330,57743:37331,57744:37332,57745:37333,57746:37334,57747:37335,57748:37336,57749:37337,57750:37338,57751:37339,57752:37341,57753:37342,57754:37343,57755:37344,57756:37345,57757:37346,57758:37347,57759:37348,57760:37349,57761:24119,57762:24132,57763:24148,57764:24155,57765:24158,57766:24161,57767:23692,57768:23674,57769:23693,57770:23696,57771:23702,57772:23688,57773:23704,57774:23705,57775:23697,57776:23706,57777:23708,57778:23733,57779:23714,57780:23741,57781:23724,57782:23723,57783:23729,57784:23715,57785:23745,57786:23735,57787:23748,57788:23762,57789:23780,57790:23755,57791:23781,57792:23810,57793:23811,57794:23847,57795:23846,57796:23854,57797:23844,57798:23838,57799:23814,57800:23835,57801:23896,57802:23870,57803:23860,57804:23869,57805:23916,57806:23899,57807:23919,57808:23901,57809:23915,57810:23883,57811:23882,57812:23913,57813:23924,57814:23938,57815:23961,57816:23965,57817:35955,57818:23991,57819:24005,57820:24435,57821:24439,57822:24450,57823:24455,57824:24457,57825:24460,57826:24469,57827:24473,57828:24476,57829:24488,57830:24493,57831:24501,57832:24508,57833:34914,57834:24417,57835:29357,57836:29360,57837:29364,57838:29367,57839:29368,57840:29379,57841:29377,57842:29390,57843:29389,57844:29394,57845:29416,57846:29423,57847:29417,57848:29426,57849:29428,57850:29431,57851:29441,57852:29427,57853:29443,57854:29434,57920:37350,57921:37351,57922:37352,57923:37353,57924:37354,57925:37355,57926:37356,57927:37357,57928:37358,57929:37359,57930:37360,57931:37361,57932:37362,57933:37363,57934:37364,57935:37365,57936:37366,57937:37367,57938:37368,57939:37369,57940:37370,57941:37371,57942:37372,57943:37373,57944:37374,57945:37375,57946:37376,57947:37377,57948:37378,57949:37379,57950:37380,57951:37381,57952:37382,57953:37383,57954:37384,57955:37385,57956:37386,57957:37387,57958:37388,57959:37389,57960:37390,57961:37391,57962:37392,57963:37393,57964:37394,57965:37395,57966:37396,57967:37397,57968:37398,57969:37399,57970:37400,57971:37401,57972:37402,57973:37403,57974:37404,57975:37405,57976:37406,57977:37407,57978:37408,57979:37409,57980:37410,57981:37411,57982:37412,57984:37413,57985:37414,57986:37415,57987:37416,57988:37417,57989:37418,57990:37419,57991:37420,57992:37421,57993:37422,57994:37423,57995:37424,57996:37425,57997:37426,57998:37427,57999:37428,58000:37429,58001:37430,58002:37431,58003:37432,58004:37433,58005:37434,58006:37435,58007:37436,58008:37437,58009:37438,58010:37439,58011:37440,58012:37441,58013:37442,58014:37443,58015:37444,58016:37445,58017:29435,58018:29463,58019:29459,58020:29473,58021:29450,58022:29470,58023:29469,58024:29461,58025:29474,58026:29497,58027:29477,58028:29484,58029:29496,58030:29489,58031:29520,58032:29517,58033:29527,58034:29536,58035:29548,58036:29551,58037:29566,58038:33307,58039:22821,58040:39143,58041:22820,58042:22786,58043:39267,58044:39271,58045:39272,58046:39273,58047:39274,58048:39275,58049:39276,58050:39284,58051:39287,58052:39293,58053:39296,58054:39300,58055:39303,58056:39306,58057:39309,58058:39312,58059:39313,58060:39315,58061:39316,58062:39317,58063:24192,58064:24209,58065:24203,58066:24214,58067:24229,58068:24224,58069:24249,58070:24245,58071:24254,58072:24243,58073:36179,58074:24274,58075:24273,58076:24283,58077:24296,58078:24298,58079:33210,58080:24516,58081:24521,58082:24534,58083:24527,58084:24579,58085:24558,58086:24580,58087:24545,58088:24548,58089:24574,58090:24581,58091:24582,58092:24554,58093:24557,58094:24568,58095:24601,58096:24629,58097:24614,58098:24603,58099:24591,58100:24589,58101:24617,58102:24619,58103:24586,58104:24639,58105:24609,58106:24696,58107:24697,58108:24699,58109:24698,58110:24642,58176:37446,58177:37447,58178:37448,58179:37449,58180:37450,58181:37451,58182:37452,58183:37453,58184:37454,58185:37455,58186:37456,58187:37457,58188:37458,58189:37459,58190:37460,58191:37461,58192:37462,58193:37463,58194:37464,58195:37465,58196:37466,58197:37467,58198:37468,58199:37469,58200:37470,58201:37471,58202:37472,58203:37473,58204:37474,58205:37475,58206:37476,58207:37477,58208:37478,58209:37479,58210:37480,58211:37481,58212:37482,58213:37483,58214:37484,58215:37485,58216:37486,58217:37487,58218:37488,58219:37489,58220:37490,58221:37491,58222:37493,58223:37494,58224:37495,58225:37496,58226:37497,58227:37498,58228:37499,58229:37500,58230:37501,58231:37502,58232:37503,58233:37504,58234:37505,58235:37506,58236:37507,58237:37508,58238:37509,58240:37510,58241:37511,58242:37512,58243:37513,58244:37514,58245:37515,58246:37516,58247:37517,58248:37519,58249:37520,58250:37521,58251:37522,58252:37523,58253:37524,58254:37525,58255:37526,58256:37527,58257:37528,58258:37529,58259:37530,58260:37531,58261:37532,58262:37533,58263:37534,58264:37535,58265:37536,58266:37537,58267:37538,58268:37539,58269:37540,58270:37541,58271:37542,58272:37543,58273:24682,58274:24701,58275:24726,58276:24730,58277:24749,58278:24733,58279:24707,58280:24722,58281:24716,58282:24731,58283:24812,58284:24763,58285:24753,58286:24797,58287:24792,58288:24774,58289:24794,58290:24756,58291:24864,58292:24870,58293:24853,58294:24867,58295:24820,58296:24832,58297:24846,58298:24875,58299:24906,58300:24949,58301:25004,58302:24980,58303:24999,58304:25015,58305:25044,58306:25077,58307:24541,58308:38579,58309:38377,58310:38379,58311:38385,58312:38387,58313:38389,58314:38390,58315:38396,58316:38398,58317:38403,58318:38404,58319:38406,58320:38408,58321:38410,58322:38411,58323:38412,58324:38413,58325:38415,58326:38418,58327:38421,58328:38422,58329:38423,58330:38425,58331:38426,58332:20012,58333:29247,58334:25109,58335:27701,58336:27732,58337:27740,58338:27722,58339:27811,58340:27781,58341:27792,58342:27796,58343:27788,58344:27752,58345:27753,58346:27764,58347:27766,58348:27782,58349:27817,58350:27856,58351:27860,58352:27821,58353:27895,58354:27896,58355:27889,58356:27863,58357:27826,58358:27872,58359:27862,58360:27898,58361:27883,58362:27886,58363:27825,58364:27859,58365:27887,58366:27902,58432:37544,58433:37545,58434:37546,58435:37547,58436:37548,58437:37549,58438:37551,58439:37552,58440:37553,58441:37554,58442:37555,58443:37556,58444:37557,58445:37558,58446:37559,58447:37560,58448:37561,58449:37562,58450:37563,58451:37564,58452:37565,58453:37566,58454:37567,58455:37568,58456:37569,58457:37570,58458:37571,58459:37572,58460:37573,58461:37574,58462:37575,58463:37577,58464:37578,58465:37579,58466:37580,58467:37581,58468:37582,58469:37583,58470:37584,58471:37585,58472:37586,58473:37587,58474:37588,58475:37589,58476:37590,58477:37591,58478:37592,58479:37593,58480:37594,58481:37595,58482:37596,58483:37597,58484:37598,58485:37599,58486:37600,58487:37601,58488:37602,58489:37603,58490:37604,58491:37605,58492:37606,58493:37607,58494:37608,58496:37609,58497:37610,58498:37611,58499:37612,58500:37613,58501:37614,58502:37615,58503:37616,58504:37617,58505:37618,58506:37619,58507:37620,58508:37621,58509:37622,58510:37623,58511:37624,58512:37625,58513:37626,58514:37627,58515:37628,58516:37629,58517:37630,58518:37631,58519:37632,58520:37633,58521:37634,58522:37635,58523:37636,58524:37637,58525:37638,58526:37639,58527:37640,58528:37641,58529:27961,58530:27943,58531:27916,58532:27971,58533:27976,58534:27911,58535:27908,58536:27929,58537:27918,58538:27947,58539:27981,58540:27950,58541:27957,58542:27930,58543:27983,58544:27986,58545:27988,58546:27955,58547:28049,58548:28015,58549:28062,58550:28064,58551:27998,58552:28051,58553:28052,58554:27996,58555:28000,58556:28028,58557:28003,58558:28186,58559:28103,58560:28101,58561:28126,58562:28174,58563:28095,58564:28128,58565:28177,58566:28134,58567:28125,58568:28121,58569:28182,58570:28075,58571:28172,58572:28078,58573:28203,58574:28270,58575:28238,58576:28267,58577:28338,58578:28255,58579:28294,58580:28243,58581:28244,58582:28210,58583:28197,58584:28228,58585:28383,58586:28337,58587:28312,58588:28384,58589:28461,58590:28386,58591:28325,58592:28327,58593:28349,58594:28347,58595:28343,58596:28375,58597:28340,58598:28367,58599:28303,58600:28354,58601:28319,58602:28514,58603:28486,58604:28487,58605:28452,58606:28437,58607:28409,58608:28463,58609:28470,58610:28491,58611:28532,58612:28458,58613:28425,58614:28457,58615:28553,58616:28557,58617:28556,58618:28536,58619:28530,58620:28540,58621:28538,58622:28625,58688:37642,58689:37643,58690:37644,58691:37645,58692:37646,58693:37647,58694:37648,58695:37649,58696:37650,58697:37651,58698:37652,58699:37653,58700:37654,58701:37655,58702:37656,58703:37657,58704:37658,58705:37659,58706:37660,58707:37661,58708:37662,58709:37663,58710:37664,58711:37665,58712:37666,58713:37667,58714:37668,58715:37669,58716:37670,58717:37671,58718:37672,58719:37673,58720:37674,58721:37675,58722:37676,58723:37677,58724:37678,58725:37679,58726:37680,58727:37681,58728:37682,58729:37683,58730:37684,58731:37685,58732:37686,58733:37687,58734:37688,58735:37689,58736:37690,58737:37691,58738:37692,58739:37693,58740:37695,58741:37696,58742:37697,58743:37698,58744:37699,58745:37700,58746:37701,58747:37702,58748:37703,58749:37704,58750:37705,58752:37706,58753:37707,58754:37708,58755:37709,58756:37710,58757:37711,58758:37712,58759:37713,58760:37714,58761:37715,58762:37716,58763:37717,58764:37718,58765:37719,58766:37720,58767:37721,58768:37722,58769:37723,58770:37724,58771:37725,58772:37726,58773:37727,58774:37728,58775:37729,58776:37730,58777:37731,58778:37732,58779:37733,58780:37734,58781:37735,58782:37736,58783:37737,58784:37739,58785:28617,58786:28583,58787:28601,58788:28598,58789:28610,58790:28641,58791:28654,58792:28638,58793:28640,58794:28655,58795:28698,58796:28707,58797:28699,58798:28729,58799:28725,58800:28751,58801:28766,58802:23424,58803:23428,58804:23445,58805:23443,58806:23461,58807:23480,58808:29999,58809:39582,58810:25652,58811:23524,58812:23534,58813:35120,58814:23536,58815:36423,58816:35591,58817:36790,58818:36819,58819:36821,58820:36837,58821:36846,58822:36836,58823:36841,58824:36838,58825:36851,58826:36840,58827:36869,58828:36868,58829:36875,58830:36902,58831:36881,58832:36877,58833:36886,58834:36897,58835:36917,58836:36918,58837:36909,58838:36911,58839:36932,58840:36945,58841:36946,58842:36944,58843:36968,58844:36952,58845:36962,58846:36955,58847:26297,58848:36980,58849:36989,58850:36994,58851:37000,58852:36995,58853:37003,58854:24400,58855:24407,58856:24406,58857:24408,58858:23611,58859:21675,58860:23632,58861:23641,58862:23409,58863:23651,58864:23654,58865:32700,58866:24362,58867:24361,58868:24365,58869:33396,58870:24380,58871:39739,58872:23662,58873:22913,58874:22915,58875:22925,58876:22953,58877:22954,58878:22947,58944:37740,58945:37741,58946:37742,58947:37743,58948:37744,58949:37745,58950:37746,58951:37747,58952:37748,58953:37749,58954:37750,58955:37751,58956:37752,58957:37753,58958:37754,58959:37755,58960:37756,58961:37757,58962:37758,58963:37759,58964:37760,58965:37761,58966:37762,58967:37763,58968:37764,58969:37765,58970:37766,58971:37767,58972:37768,58973:37769,58974:37770,58975:37771,58976:37772,58977:37773,58978:37774,58979:37776,58980:37777,58981:37778,58982:37779,58983:37780,58984:37781,58985:37782,58986:37783,58987:37784,58988:37785,58989:37786,58990:37787,58991:37788,58992:37789,58993:37790,58994:37791,58995:37792,58996:37793,58997:37794,58998:37795,58999:37796,59000:37797,59001:37798,59002:37799,59003:37800,59004:37801,59005:37802,59006:37803,59008:37804,59009:37805,59010:37806,59011:37807,59012:37808,59013:37809,59014:37810,59015:37811,59016:37812,59017:37813,59018:37814,59019:37815,59020:37816,59021:37817,59022:37818,59023:37819,59024:37820,59025:37821,59026:37822,59027:37823,59028:37824,59029:37825,59030:37826,59031:37827,59032:37828,59033:37829,59034:37830,59035:37831,59036:37832,59037:37833,59038:37835,59039:37836,59040:37837,59041:22935,59042:22986,59043:22955,59044:22942,59045:22948,59046:22994,59047:22962,59048:22959,59049:22999,59050:22974,59051:23045,59052:23046,59053:23005,59054:23048,59055:23011,59056:23000,59057:23033,59058:23052,59059:23049,59060:23090,59061:23092,59062:23057,59063:23075,59064:23059,59065:23104,59066:23143,59067:23114,59068:23125,59069:23100,59070:23138,59071:23157,59072:33004,59073:23210,59074:23195,59075:23159,59076:23162,59077:23230,59078:23275,59079:23218,59080:23250,59081:23252,59082:23224,59083:23264,59084:23267,59085:23281,59086:23254,59087:23270,59088:23256,59089:23260,59090:23305,59091:23319,59092:23318,59093:23346,59094:23351,59095:23360,59096:23573,59097:23580,59098:23386,59099:23397,59100:23411,59101:23377,59102:23379,59103:23394,59104:39541,59105:39543,59106:39544,59107:39546,59108:39551,59109:39549,59110:39552,59111:39553,59112:39557,59113:39560,59114:39562,59115:39568,59116:39570,59117:39571,59118:39574,59119:39576,59120:39579,59121:39580,59122:39581,59123:39583,59124:39584,59125:39586,59126:39587,59127:39589,59128:39591,59129:32415,59130:32417,59131:32419,59132:32421,59133:32424,59134:32425,59200:37838,59201:37839,59202:37840,59203:37841,59204:37842,59205:37843,59206:37844,59207:37845,59208:37847,59209:37848,59210:37849,59211:37850,59212:37851,59213:37852,59214:37853,59215:37854,59216:37855,59217:37856,59218:37857,59219:37858,59220:37859,59221:37860,59222:37861,59223:37862,59224:37863,59225:37864,59226:37865,59227:37866,59228:37867,59229:37868,59230:37869,59231:37870,59232:37871,59233:37872,59234:37873,59235:37874,59236:37875,59237:37876,59238:37877,59239:37878,59240:37879,59241:37880,59242:37881,59243:37882,59244:37883,59245:37884,59246:37885,59247:37886,59248:37887,59249:37888,59250:37889,59251:37890,59252:37891,59253:37892,59254:37893,59255:37894,59256:37895,59257:37896,59258:37897,59259:37898,59260:37899,59261:37900,59262:37901,59264:37902,59265:37903,59266:37904,59267:37905,59268:37906,59269:37907,59270:37908,59271:37909,59272:37910,59273:37911,59274:37912,59275:37913,59276:37914,59277:37915,59278:37916,59279:37917,59280:37918,59281:37919,59282:37920,59283:37921,59284:37922,59285:37923,59286:37924,59287:37925,59288:37926,59289:37927,59290:37928,59291:37929,59292:37930,59293:37931,59294:37932,59295:37933,59296:37934,59297:32429,59298:32432,59299:32446,59300:32448,59301:32449,59302:32450,59303:32457,59304:32459,59305:32460,59306:32464,59307:32468,59308:32471,59309:32475,59310:32480,59311:32481,59312:32488,59313:32491,59314:32494,59315:32495,59316:32497,59317:32498,59318:32525,59319:32502,59320:32506,59321:32507,59322:32510,59323:32513,59324:32514,59325:32515,59326:32519,59327:32520,59328:32523,59329:32524,59330:32527,59331:32529,59332:32530,59333:32535,59334:32537,59335:32540,59336:32539,59337:32543,59338:32545,59339:32546,59340:32547,59341:32548,59342:32549,59343:32550,59344:32551,59345:32554,59346:32555,59347:32556,59348:32557,59349:32559,59350:32560,59351:32561,59352:32562,59353:32563,59354:32565,59355:24186,59356:30079,59357:24027,59358:30014,59359:37013,59360:29582,59361:29585,59362:29614,59363:29602,59364:29599,59365:29647,59366:29634,59367:29649,59368:29623,59369:29619,59370:29632,59371:29641,59372:29640,59373:29669,59374:29657,59375:39036,59376:29706,59377:29673,59378:29671,59379:29662,59380:29626,59381:29682,59382:29711,59383:29738,59384:29787,59385:29734,59386:29733,59387:29736,59388:29744,59389:29742,59390:29740,59456:37935,59457:37936,59458:37937,59459:37938,59460:37939,59461:37940,59462:37941,59463:37942,59464:37943,59465:37944,59466:37945,59467:37946,59468:37947,59469:37948,59470:37949,59471:37951,59472:37952,59473:37953,59474:37954,59475:37955,59476:37956,59477:37957,59478:37958,59479:37959,59480:37960,59481:37961,59482:37962,59483:37963,59484:37964,59485:37965,59486:37966,59487:37967,59488:37968,59489:37969,59490:37970,59491:37971,59492:37972,59493:37973,59494:37974,59495:37975,59496:37976,59497:37977,59498:37978,59499:37979,59500:37980,59501:37981,59502:37982,59503:37983,59504:37984,59505:37985,59506:37986,59507:37987,59508:37988,59509:37989,59510:37990,59511:37991,59512:37992,59513:37993,59514:37994,59515:37996,59516:37997,59517:37998,59518:37999,59520:38000,59521:38001,59522:38002,59523:38003,59524:38004,59525:38005,59526:38006,59527:38007,59528:38008,59529:38009,59530:38010,59531:38011,59532:38012,59533:38013,59534:38014,59535:38015,59536:38016,59537:38017,59538:38018,59539:38019,59540:38020,59541:38033,59542:38038,59543:38040,59544:38087,59545:38095,59546:38099,59547:38100,59548:38106,59549:38118,59550:38139,59551:38172,59552:38176,59553:29723,59554:29722,59555:29761,59556:29788,59557:29783,59558:29781,59559:29785,59560:29815,59561:29805,59562:29822,59563:29852,59564:29838,59565:29824,59566:29825,59567:29831,59568:29835,59569:29854,59570:29864,59571:29865,59572:29840,59573:29863,59574:29906,59575:29882,59576:38890,59577:38891,59578:38892,59579:26444,59580:26451,59581:26462,59582:26440,59583:26473,59584:26533,59585:26503,59586:26474,59587:26483,59588:26520,59589:26535,59590:26485,59591:26536,59592:26526,59593:26541,59594:26507,59595:26487,59596:26492,59597:26608,59598:26633,59599:26584,59600:26634,59601:26601,59602:26544,59603:26636,59604:26585,59605:26549,59606:26586,59607:26547,59608:26589,59609:26624,59610:26563,59611:26552,59612:26594,59613:26638,59614:26561,59615:26621,59616:26674,59617:26675,59618:26720,59619:26721,59620:26702,59621:26722,59622:26692,59623:26724,59624:26755,59625:26653,59626:26709,59627:26726,59628:26689,59629:26727,59630:26688,59631:26686,59632:26698,59633:26697,59634:26665,59635:26805,59636:26767,59637:26740,59638:26743,59639:26771,59640:26731,59641:26818,59642:26990,59643:26876,59644:26911,59645:26912,59646:26873,59712:38183,59713:38195,59714:38205,59715:38211,59716:38216,59717:38219,59718:38229,59719:38234,59720:38240,59721:38254,59722:38260,59723:38261,59724:38263,59725:38264,59726:38265,59727:38266,59728:38267,59729:38268,59730:38269,59731:38270,59732:38272,59733:38273,59734:38274,59735:38275,59736:38276,59737:38277,59738:38278,59739:38279,59740:38280,59741:38281,59742:38282,59743:38283,59744:38284,59745:38285,59746:38286,59747:38287,59748:38288,59749:38289,59750:38290,59751:38291,59752:38292,59753:38293,59754:38294,59755:38295,59756:38296,59757:38297,59758:38298,59759:38299,59760:38300,59761:38301,59762:38302,59763:38303,59764:38304,59765:38305,59766:38306,59767:38307,59768:38308,59769:38309,59770:38310,59771:38311,59772:38312,59773:38313,59774:38314,59776:38315,59777:38316,59778:38317,59779:38318,59780:38319,59781:38320,59782:38321,59783:38322,59784:38323,59785:38324,59786:38325,59787:38326,59788:38327,59789:38328,59790:38329,59791:38330,59792:38331,59793:38332,59794:38333,59795:38334,59796:38335,59797:38336,59798:38337,59799:38338,59800:38339,59801:38340,59802:38341,59803:38342,59804:38343,59805:38344,59806:38345,59807:38346,59808:38347,59809:26916,59810:26864,59811:26891,59812:26881,59813:26967,59814:26851,59815:26896,59816:26993,59817:26937,59818:26976,59819:26946,59820:26973,59821:27012,59822:26987,59823:27008,59824:27032,59825:27000,59826:26932,59827:27084,59828:27015,59829:27016,59830:27086,59831:27017,59832:26982,59833:26979,59834:27001,59835:27035,59836:27047,59837:27067,59838:27051,59839:27053,59840:27092,59841:27057,59842:27073,59843:27082,59844:27103,59845:27029,59846:27104,59847:27021,59848:27135,59849:27183,59850:27117,59851:27159,59852:27160,59853:27237,59854:27122,59855:27204,59856:27198,59857:27296,59858:27216,59859:27227,59860:27189,59861:27278,59862:27257,59863:27197,59864:27176,59865:27224,59866:27260,59867:27281,59868:27280,59869:27305,59870:27287,59871:27307,59872:29495,59873:29522,59874:27521,59875:27522,59876:27527,59877:27524,59878:27538,59879:27539,59880:27533,59881:27546,59882:27547,59883:27553,59884:27562,59885:36715,59886:36717,59887:36721,59888:36722,59889:36723,59890:36725,59891:36726,59892:36728,59893:36727,59894:36729,59895:36730,59896:36732,59897:36734,59898:36737,59899:36738,59900:36740,59901:36743,59902:36747,59968:38348,59969:38349,59970:38350,59971:38351,59972:38352,59973:38353,59974:38354,59975:38355,59976:38356,59977:38357,59978:38358,59979:38359,59980:38360,59981:38361,59982:38362,59983:38363,59984:38364,59985:38365,59986:38366,59987:38367,59988:38368,59989:38369,59990:38370,59991:38371,59992:38372,59993:38373,59994:38374,59995:38375,59996:38380,59997:38399,59998:38407,59999:38419,60000:38424,60001:38427,60002:38430,60003:38432,60004:38435,60005:38436,60006:38437,60007:38438,60008:38439,60009:38440,60010:38441,60011:38443,60012:38444,60013:38445,60014:38447,60015:38448,60016:38455,60017:38456,60018:38457,60019:38458,60020:38462,60021:38465,60022:38467,60023:38474,60024:38478,60025:38479,60026:38481,60027:38482,60028:38483,60029:38486,60030:38487,60032:38488,60033:38489,60034:38490,60035:38492,60036:38493,60037:38494,60038:38496,60039:38499,60040:38501,60041:38502,60042:38507,60043:38509,60044:38510,60045:38511,60046:38512,60047:38513,60048:38515,60049:38520,60050:38521,60051:38522,60052:38523,60053:38524,60054:38525,60055:38526,60056:38527,60057:38528,60058:38529,60059:38530,60060:38531,60061:38532,60062:38535,60063:38537,60064:38538,60065:36749,60066:36750,60067:36751,60068:36760,60069:36762,60070:36558,60071:25099,60072:25111,60073:25115,60074:25119,60075:25122,60076:25121,60077:25125,60078:25124,60079:25132,60080:33255,60081:29935,60082:29940,60083:29951,60084:29967,60085:29969,60086:29971,60087:25908,60088:26094,60089:26095,60090:26096,60091:26122,60092:26137,60093:26482,60094:26115,60095:26133,60096:26112,60097:28805,60098:26359,60099:26141,60100:26164,60101:26161,60102:26166,60103:26165,60104:32774,60105:26207,60106:26196,60107:26177,60108:26191,60109:26198,60110:26209,60111:26199,60112:26231,60113:26244,60114:26252,60115:26279,60116:26269,60117:26302,60118:26331,60119:26332,60120:26342,60121:26345,60122:36146,60123:36147,60124:36150,60125:36155,60126:36157,60127:36160,60128:36165,60129:36166,60130:36168,60131:36169,60132:36167,60133:36173,60134:36181,60135:36185,60136:35271,60137:35274,60138:35275,60139:35276,60140:35278,60141:35279,60142:35280,60143:35281,60144:29294,60145:29343,60146:29277,60147:29286,60148:29295,60149:29310,60150:29311,60151:29316,60152:29323,60153:29325,60154:29327,60155:29330,60156:25352,60157:25394,60158:25520,60224:38540,60225:38542,60226:38545,60227:38546,60228:38547,60229:38549,60230:38550,60231:38554,60232:38555,60233:38557,60234:38558,60235:38559,60236:38560,60237:38561,60238:38562,60239:38563,60240:38564,60241:38565,60242:38566,60243:38568,60244:38569,60245:38570,60246:38571,60247:38572,60248:38573,60249:38574,60250:38575,60251:38577,60252:38578,60253:38580,60254:38581,60255:38583,60256:38584,60257:38586,60258:38587,60259:38591,60260:38594,60261:38595,60262:38600,60263:38602,60264:38603,60265:38608,60266:38609,60267:38611,60268:38612,60269:38614,60270:38615,60271:38616,60272:38617,60273:38618,60274:38619,60275:38620,60276:38621,60277:38622,60278:38623,60279:38625,60280:38626,60281:38627,60282:38628,60283:38629,60284:38630,60285:38631,60286:38635,60288:38636,60289:38637,60290:38638,60291:38640,60292:38641,60293:38642,60294:38644,60295:38645,60296:38648,60297:38650,60298:38651,60299:38652,60300:38653,60301:38655,60302:38658,60303:38659,60304:38661,60305:38666,60306:38667,60307:38668,60308:38672,60309:38673,60310:38674,60311:38676,60312:38677,60313:38679,60314:38680,60315:38681,60316:38682,60317:38683,60318:38685,60319:38687,60320:38688,60321:25663,60322:25816,60323:32772,60324:27626,60325:27635,60326:27645,60327:27637,60328:27641,60329:27653,60330:27655,60331:27654,60332:27661,60333:27669,60334:27672,60335:27673,60336:27674,60337:27681,60338:27689,60339:27684,60340:27690,60341:27698,60342:25909,60343:25941,60344:25963,60345:29261,60346:29266,60347:29270,60348:29232,60349:34402,60350:21014,60351:32927,60352:32924,60353:32915,60354:32956,60355:26378,60356:32957,60357:32945,60358:32939,60359:32941,60360:32948,60361:32951,60362:32999,60363:33000,60364:33001,60365:33002,60366:32987,60367:32962,60368:32964,60369:32985,60370:32973,60371:32983,60372:26384,60373:32989,60374:33003,60375:33009,60376:33012,60377:33005,60378:33037,60379:33038,60380:33010,60381:33020,60382:26389,60383:33042,60384:35930,60385:33078,60386:33054,60387:33068,60388:33048,60389:33074,60390:33096,60391:33100,60392:33107,60393:33140,60394:33113,60395:33114,60396:33137,60397:33120,60398:33129,60399:33148,60400:33149,60401:33133,60402:33127,60403:22605,60404:23221,60405:33160,60406:33154,60407:33169,60408:28373,60409:33187,60410:33194,60411:33228,60412:26406,60413:33226,60414:33211,60480:38689,60481:38690,60482:38691,60483:38692,60484:38693,60485:38694,60486:38695,60487:38696,60488:38697,60489:38699,60490:38700,60491:38702,60492:38703,60493:38705,60494:38707,60495:38708,60496:38709,60497:38710,60498:38711,60499:38714,60500:38715,60501:38716,60502:38717,60503:38719,60504:38720,60505:38721,60506:38722,60507:38723,60508:38724,60509:38725,60510:38726,60511:38727,60512:38728,60513:38729,60514:38730,60515:38731,60516:38732,60517:38733,60518:38734,60519:38735,60520:38736,60521:38737,60522:38740,60523:38741,60524:38743,60525:38744,60526:38746,60527:38748,60528:38749,60529:38751,60530:38755,60531:38756,60532:38758,60533:38759,60534:38760,60535:38762,60536:38763,60537:38764,60538:38765,60539:38766,60540:38767,60541:38768,60542:38769,60544:38770,60545:38773,60546:38775,60547:38776,60548:38777,60549:38778,60550:38779,60551:38781,60552:38782,60553:38783,60554:38784,60555:38785,60556:38786,60557:38787,60558:38788,60559:38790,60560:38791,60561:38792,60562:38793,60563:38794,60564:38796,60565:38798,60566:38799,60567:38800,60568:38803,60569:38805,60570:38806,60571:38807,60572:38809,60573:38810,60574:38811,60575:38812,60576:38813,60577:33217,60578:33190,60579:27428,60580:27447,60581:27449,60582:27459,60583:27462,60584:27481,60585:39121,60586:39122,60587:39123,60588:39125,60589:39129,60590:39130,60591:27571,60592:24384,60593:27586,60594:35315,60595:26000,60596:40785,60597:26003,60598:26044,60599:26054,60600:26052,60601:26051,60602:26060,60603:26062,60604:26066,60605:26070,60606:28800,60607:28828,60608:28822,60609:28829,60610:28859,60611:28864,60612:28855,60613:28843,60614:28849,60615:28904,60616:28874,60617:28944,60618:28947,60619:28950,60620:28975,60621:28977,60622:29043,60623:29020,60624:29032,60625:28997,60626:29042,60627:29002,60628:29048,60629:29050,60630:29080,60631:29107,60632:29109,60633:29096,60634:29088,60635:29152,60636:29140,60637:29159,60638:29177,60639:29213,60640:29224,60641:28780,60642:28952,60643:29030,60644:29113,60645:25150,60646:25149,60647:25155,60648:25160,60649:25161,60650:31035,60651:31040,60652:31046,60653:31049,60654:31067,60655:31068,60656:31059,60657:31066,60658:31074,60659:31063,60660:31072,60661:31087,60662:31079,60663:31098,60664:31109,60665:31114,60666:31130,60667:31143,60668:31155,60669:24529,60670:24528,60736:38814,60737:38815,60738:38817,60739:38818,60740:38820,60741:38821,60742:38822,60743:38823,60744:38824,60745:38825,60746:38826,60747:38828,60748:38830,60749:38832,60750:38833,60751:38835,60752:38837,60753:38838,60754:38839,60755:38840,60756:38841,60757:38842,60758:38843,60759:38844,60760:38845,60761:38846,60762:38847,60763:38848,60764:38849,60765:38850,60766:38851,60767:38852,60768:38853,60769:38854,60770:38855,60771:38856,60772:38857,60773:38858,60774:38859,60775:38860,60776:38861,60777:38862,60778:38863,60779:38864,60780:38865,60781:38866,60782:38867,60783:38868,60784:38869,60785:38870,60786:38871,60787:38872,60788:38873,60789:38874,60790:38875,60791:38876,60792:38877,60793:38878,60794:38879,60795:38880,60796:38881,60797:38882,60798:38883,60800:38884,60801:38885,60802:38888,60803:38894,60804:38895,60805:38896,60806:38897,60807:38898,60808:38900,60809:38903,60810:38904,60811:38905,60812:38906,60813:38907,60814:38908,60815:38909,60816:38910,60817:38911,60818:38912,60819:38913,60820:38914,60821:38915,60822:38916,60823:38917,60824:38918,60825:38919,60826:38920,60827:38921,60828:38922,60829:38923,60830:38924,60831:38925,60832:38926,60833:24636,60834:24669,60835:24666,60836:24679,60837:24641,60838:24665,60839:24675,60840:24747,60841:24838,60842:24845,60843:24925,60844:25001,60845:24989,60846:25035,60847:25041,60848:25094,60849:32896,60850:32895,60851:27795,60852:27894,60853:28156,60854:30710,60855:30712,60856:30720,60857:30729,60858:30743,60859:30744,60860:30737,60861:26027,60862:30765,60863:30748,60864:30749,60865:30777,60866:30778,60867:30779,60868:30751,60869:30780,60870:30757,60871:30764,60872:30755,60873:30761,60874:30798,60875:30829,60876:30806,60877:30807,60878:30758,60879:30800,60880:30791,60881:30796,60882:30826,60883:30875,60884:30867,60885:30874,60886:30855,60887:30876,60888:30881,60889:30883,60890:30898,60891:30905,60892:30885,60893:30932,60894:30937,60895:30921,60896:30956,60897:30962,60898:30981,60899:30964,60900:30995,60901:31012,60902:31006,60903:31028,60904:40859,60905:40697,60906:40699,60907:40700,60908:30449,60909:30468,60910:30477,60911:30457,60912:30471,60913:30472,60914:30490,60915:30498,60916:30489,60917:30509,60918:30502,60919:30517,60920:30520,60921:30544,60922:30545,60923:30535,60924:30531,60925:30554,60926:30568,60992:38927,60993:38928,60994:38929,60995:38930,60996:38931,60997:38932,60998:38933,60999:38934,61000:38935,61001:38936,61002:38937,61003:38938,61004:38939,61005:38940,61006:38941,61007:38942,61008:38943,61009:38944,61010:38945,61011:38946,61012:38947,61013:38948,61014:38949,61015:38950,61016:38951,61017:38952,61018:38953,61019:38954,61020:38955,61021:38956,61022:38957,61023:38958,61024:38959,61025:38960,61026:38961,61027:38962,61028:38963,61029:38964,61030:38965,61031:38966,61032:38967,61033:38968,61034:38969,61035:38970,61036:38971,61037:38972,61038:38973,61039:38974,61040:38975,61041:38976,61042:38977,61043:38978,61044:38979,61045:38980,61046:38981,61047:38982,61048:38983,61049:38984,61050:38985,61051:38986,61052:38987,61053:38988,61054:38989,61056:38990,61057:38991,61058:38992,61059:38993,61060:38994,61061:38995,61062:38996,61063:38997,61064:38998,61065:38999,61066:39000,61067:39001,61068:39002,61069:39003,61070:39004,61071:39005,61072:39006,61073:39007,61074:39008,61075:39009,61076:39010,61077:39011,61078:39012,61079:39013,61080:39014,61081:39015,61082:39016,61083:39017,61084:39018,61085:39019,61086:39020,61087:39021,61088:39022,61089:30562,61090:30565,61091:30591,61092:30605,61093:30589,61094:30592,61095:30604,61096:30609,61097:30623,61098:30624,61099:30640,61100:30645,61101:30653,61102:30010,61103:30016,61104:30030,61105:30027,61106:30024,61107:30043,61108:30066,61109:30073,61110:30083,61111:32600,61112:32609,61113:32607,61114:35400,61115:32616,61116:32628,61117:32625,61118:32633,61119:32641,61120:32638,61121:30413,61122:30437,61123:34866,61124:38021,61125:38022,61126:38023,61127:38027,61128:38026,61129:38028,61130:38029,61131:38031,61132:38032,61133:38036,61134:38039,61135:38037,61136:38042,61137:38043,61138:38044,61139:38051,61140:38052,61141:38059,61142:38058,61143:38061,61144:38060,61145:38063,61146:38064,61147:38066,61148:38068,61149:38070,61150:38071,61151:38072,61152:38073,61153:38074,61154:38076,61155:38077,61156:38079,61157:38084,61158:38088,61159:38089,61160:38090,61161:38091,61162:38092,61163:38093,61164:38094,61165:38096,61166:38097,61167:38098,61168:38101,61169:38102,61170:38103,61171:38105,61172:38104,61173:38107,61174:38110,61175:38111,61176:38112,61177:38114,61178:38116,61179:38117,61180:38119,61181:38120,61182:38122,61248:39023,61249:39024,61250:39025,61251:39026,61252:39027,61253:39028,61254:39051,61255:39054,61256:39058,61257:39061,61258:39065,61259:39075,61260:39080,61261:39081,61262:39082,61263:39083,61264:39084,61265:39085,61266:39086,61267:39087,61268:39088,61269:39089,61270:39090,61271:39091,61272:39092,61273:39093,61274:39094,61275:39095,61276:39096,61277:39097,61278:39098,61279:39099,61280:39100,61281:39101,61282:39102,61283:39103,61284:39104,61285:39105,61286:39106,61287:39107,61288:39108,61289:39109,61290:39110,61291:39111,61292:39112,61293:39113,61294:39114,61295:39115,61296:39116,61297:39117,61298:39119,61299:39120,61300:39124,61301:39126,61302:39127,61303:39131,61304:39132,61305:39133,61306:39136,61307:39137,61308:39138,61309:39139,61310:39140,61312:39141,61313:39142,61314:39145,61315:39146,61316:39147,61317:39148,61318:39149,61319:39150,61320:39151,61321:39152,61322:39153,61323:39154,61324:39155,61325:39156,61326:39157,61327:39158,61328:39159,61329:39160,61330:39161,61331:39162,61332:39163,61333:39164,61334:39165,61335:39166,61336:39167,61337:39168,61338:39169,61339:39170,61340:39171,61341:39172,61342:39173,61343:39174,61344:39175,61345:38121,61346:38123,61347:38126,61348:38127,61349:38131,61350:38132,61351:38133,61352:38135,61353:38137,61354:38140,61355:38141,61356:38143,61357:38147,61358:38146,61359:38150,61360:38151,61361:38153,61362:38154,61363:38157,61364:38158,61365:38159,61366:38162,61367:38163,61368:38164,61369:38165,61370:38166,61371:38168,61372:38171,61373:38173,61374:38174,61375:38175,61376:38178,61377:38186,61378:38187,61379:38185,61380:38188,61381:38193,61382:38194,61383:38196,61384:38198,61385:38199,61386:38200,61387:38204,61388:38206,61389:38207,61390:38210,61391:38197,61392:38212,61393:38213,61394:38214,61395:38217,61396:38220,61397:38222,61398:38223,61399:38226,61400:38227,61401:38228,61402:38230,61403:38231,61404:38232,61405:38233,61406:38235,61407:38238,61408:38239,61409:38237,61410:38241,61411:38242,61412:38244,61413:38245,61414:38246,61415:38247,61416:38248,61417:38249,61418:38250,61419:38251,61420:38252,61421:38255,61422:38257,61423:38258,61424:38259,61425:38202,61426:30695,61427:30700,61428:38601,61429:31189,61430:31213,61431:31203,61432:31211,61433:31238,61434:23879,61435:31235,61436:31234,61437:31262,61438:31252,61504:39176,61505:39177,61506:39178,61507:39179,61508:39180,61509:39182,61510:39183,61511:39185,61512:39186,61513:39187,61514:39188,61515:39189,61516:39190,61517:39191,61518:39192,61519:39193,61520:39194,61521:39195,61522:39196,61523:39197,61524:39198,61525:39199,61526:39200,61527:39201,61528:39202,61529:39203,61530:39204,61531:39205,61532:39206,61533:39207,61534:39208,61535:39209,61536:39210,61537:39211,61538:39212,61539:39213,61540:39215,61541:39216,61542:39217,61543:39218,61544:39219,61545:39220,61546:39221,61547:39222,61548:39223,61549:39224,61550:39225,61551:39226,61552:39227,61553:39228,61554:39229,61555:39230,61556:39231,61557:39232,61558:39233,61559:39234,61560:39235,61561:39236,61562:39237,61563:39238,61564:39239,61565:39240,61566:39241,61568:39242,61569:39243,61570:39244,61571:39245,61572:39246,61573:39247,61574:39248,61575:39249,61576:39250,61577:39251,61578:39254,61579:39255,61580:39256,61581:39257,61582:39258,61583:39259,61584:39260,61585:39261,61586:39262,61587:39263,61588:39264,61589:39265,61590:39266,61591:39268,61592:39270,61593:39283,61594:39288,61595:39289,61596:39291,61597:39294,61598:39298,61599:39299,61600:39305,61601:31289,61602:31287,61603:31313,61604:40655,61605:39333,61606:31344,61607:30344,61608:30350,61609:30355,61610:30361,61611:30372,61612:29918,61613:29920,61614:29996,61615:40480,61616:40482,61617:40488,61618:40489,61619:40490,61620:40491,61621:40492,61622:40498,61623:40497,61624:40502,61625:40504,61626:40503,61627:40505,61628:40506,61629:40510,61630:40513,61631:40514,61632:40516,61633:40518,61634:40519,61635:40520,61636:40521,61637:40523,61638:40524,61639:40526,61640:40529,61641:40533,61642:40535,61643:40538,61644:40539,61645:40540,61646:40542,61647:40547,61648:40550,61649:40551,61650:40552,61651:40553,61652:40554,61653:40555,61654:40556,61655:40561,61656:40557,61657:40563,61658:30098,61659:30100,61660:30102,61661:30112,61662:30109,61663:30124,61664:30115,61665:30131,61666:30132,61667:30136,61668:30148,61669:30129,61670:30128,61671:30147,61672:30146,61673:30166,61674:30157,61675:30179,61676:30184,61677:30182,61678:30180,61679:30187,61680:30183,61681:30211,61682:30193,61683:30204,61684:30207,61685:30224,61686:30208,61687:30213,61688:30220,61689:30231,61690:30218,61691:30245,61692:30232,61693:30229,61694:30233,61760:39308,61761:39310,61762:39322,61763:39323,61764:39324,61765:39325,61766:39326,61767:39327,61768:39328,61769:39329,61770:39330,61771:39331,61772:39332,61773:39334,61774:39335,61775:39337,61776:39338,61777:39339,61778:39340,61779:39341,61780:39342,61781:39343,61782:39344,61783:39345,61784:39346,61785:39347,61786:39348,61787:39349,61788:39350,61789:39351,61790:39352,61791:39353,61792:39354,61793:39355,61794:39356,61795:39357,61796:39358,61797:39359,61798:39360,61799:39361,61800:39362,61801:39363,61802:39364,61803:39365,61804:39366,61805:39367,61806:39368,61807:39369,61808:39370,61809:39371,61810:39372,61811:39373,61812:39374,61813:39375,61814:39376,61815:39377,61816:39378,61817:39379,61818:39380,61819:39381,61820:39382,61821:39383,61822:39384,61824:39385,61825:39386,61826:39387,61827:39388,61828:39389,61829:39390,61830:39391,61831:39392,61832:39393,61833:39394,61834:39395,61835:39396,61836:39397,61837:39398,61838:39399,61839:39400,61840:39401,61841:39402,61842:39403,61843:39404,61844:39405,61845:39406,61846:39407,61847:39408,61848:39409,61849:39410,61850:39411,61851:39412,61852:39413,61853:39414,61854:39415,61855:39416,61856:39417,61857:30235,61858:30268,61859:30242,61860:30240,61861:30272,61862:30253,61863:30256,61864:30271,61865:30261,61866:30275,61867:30270,61868:30259,61869:30285,61870:30302,61871:30292,61872:30300,61873:30294,61874:30315,61875:30319,61876:32714,61877:31462,61878:31352,61879:31353,61880:31360,61881:31366,61882:31368,61883:31381,61884:31398,61885:31392,61886:31404,61887:31400,61888:31405,61889:31411,61890:34916,61891:34921,61892:34930,61893:34941,61894:34943,61895:34946,61896:34978,61897:35014,61898:34999,61899:35004,61900:35017,61901:35042,61902:35022,61903:35043,61904:35045,61905:35057,61906:35098,61907:35068,61908:35048,61909:35070,61910:35056,61911:35105,61912:35097,61913:35091,61914:35099,61915:35082,61916:35124,61917:35115,61918:35126,61919:35137,61920:35174,61921:35195,61922:30091,61923:32997,61924:30386,61925:30388,61926:30684,61927:32786,61928:32788,61929:32790,61930:32796,61931:32800,61932:32802,61933:32805,61934:32806,61935:32807,61936:32809,61937:32808,61938:32817,61939:32779,61940:32821,61941:32835,61942:32838,61943:32845,61944:32850,61945:32873,61946:32881,61947:35203,61948:39032,61949:39040,61950:39043,62016:39418,62017:39419,62018:39420,62019:39421,62020:39422,62021:39423,62022:39424,62023:39425,62024:39426,62025:39427,62026:39428,62027:39429,62028:39430,62029:39431,62030:39432,62031:39433,62032:39434,62033:39435,62034:39436,62035:39437,62036:39438,62037:39439,62038:39440,62039:39441,62040:39442,62041:39443,62042:39444,62043:39445,62044:39446,62045:39447,62046:39448,62047:39449,62048:39450,62049:39451,62050:39452,62051:39453,62052:39454,62053:39455,62054:39456,62055:39457,62056:39458,62057:39459,62058:39460,62059:39461,62060:39462,62061:39463,62062:39464,62063:39465,62064:39466,62065:39467,62066:39468,62067:39469,62068:39470,62069:39471,62070:39472,62071:39473,62072:39474,62073:39475,62074:39476,62075:39477,62076:39478,62077:39479,62078:39480,62080:39481,62081:39482,62082:39483,62083:39484,62084:39485,62085:39486,62086:39487,62087:39488,62088:39489,62089:39490,62090:39491,62091:39492,62092:39493,62093:39494,62094:39495,62095:39496,62096:39497,62097:39498,62098:39499,62099:39500,62100:39501,62101:39502,62102:39503,62103:39504,62104:39505,62105:39506,62106:39507,62107:39508,62108:39509,62109:39510,62110:39511,62111:39512,62112:39513,62113:39049,62114:39052,62115:39053,62116:39055,62117:39060,62118:39066,62119:39067,62120:39070,62121:39071,62122:39073,62123:39074,62124:39077,62125:39078,62126:34381,62127:34388,62128:34412,62129:34414,62130:34431,62131:34426,62132:34428,62133:34427,62134:34472,62135:34445,62136:34443,62137:34476,62138:34461,62139:34471,62140:34467,62141:34474,62142:34451,62143:34473,62144:34486,62145:34500,62146:34485,62147:34510,62148:34480,62149:34490,62150:34481,62151:34479,62152:34505,62153:34511,62154:34484,62155:34537,62156:34545,62157:34546,62158:34541,62159:34547,62160:34512,62161:34579,62162:34526,62163:34548,62164:34527,62165:34520,62166:34513,62167:34563,62168:34567,62169:34552,62170:34568,62171:34570,62172:34573,62173:34569,62174:34595,62175:34619,62176:34590,62177:34597,62178:34606,62179:34586,62180:34622,62181:34632,62182:34612,62183:34609,62184:34601,62185:34615,62186:34623,62187:34690,62188:34594,62189:34685,62190:34686,62191:34683,62192:34656,62193:34672,62194:34636,62195:34670,62196:34699,62197:34643,62198:34659,62199:34684,62200:34660,62201:34649,62202:34661,62203:34707,62204:34735,62205:34728,62206:34770,62272:39514,62273:39515,62274:39516,62275:39517,62276:39518,62277:39519,62278:39520,62279:39521,62280:39522,62281:39523,62282:39524,62283:39525,62284:39526,62285:39527,62286:39528,62287:39529,62288:39530,62289:39531,62290:39538,62291:39555,62292:39561,62293:39565,62294:39566,62295:39572,62296:39573,62297:39577,62298:39590,62299:39593,62300:39594,62301:39595,62302:39596,62303:39597,62304:39598,62305:39599,62306:39602,62307:39603,62308:39604,62309:39605,62310:39609,62311:39611,62312:39613,62313:39614,62314:39615,62315:39619,62316:39620,62317:39622,62318:39623,62319:39624,62320:39625,62321:39626,62322:39629,62323:39630,62324:39631,62325:39632,62326:39634,62327:39636,62328:39637,62329:39638,62330:39639,62331:39641,62332:39642,62333:39643,62334:39644,62336:39645,62337:39646,62338:39648,62339:39650,62340:39651,62341:39652,62342:39653,62343:39655,62344:39656,62345:39657,62346:39658,62347:39660,62348:39662,62349:39664,62350:39665,62351:39666,62352:39667,62353:39668,62354:39669,62355:39670,62356:39671,62357:39672,62358:39674,62359:39676,62360:39677,62361:39678,62362:39679,62363:39680,62364:39681,62365:39682,62366:39684,62367:39685,62368:39686,62369:34758,62370:34696,62371:34693,62372:34733,62373:34711,62374:34691,62375:34731,62376:34789,62377:34732,62378:34741,62379:34739,62380:34763,62381:34771,62382:34749,62383:34769,62384:34752,62385:34762,62386:34779,62387:34794,62388:34784,62389:34798,62390:34838,62391:34835,62392:34814,62393:34826,62394:34843,62395:34849,62396:34873,62397:34876,62398:32566,62399:32578,62400:32580,62401:32581,62402:33296,62403:31482,62404:31485,62405:31496,62406:31491,62407:31492,62408:31509,62409:31498,62410:31531,62411:31503,62412:31559,62413:31544,62414:31530,62415:31513,62416:31534,62417:31537,62418:31520,62419:31525,62420:31524,62421:31539,62422:31550,62423:31518,62424:31576,62425:31578,62426:31557,62427:31605,62428:31564,62429:31581,62430:31584,62431:31598,62432:31611,62433:31586,62434:31602,62435:31601,62436:31632,62437:31654,62438:31655,62439:31672,62440:31660,62441:31645,62442:31656,62443:31621,62444:31658,62445:31644,62446:31650,62447:31659,62448:31668,62449:31697,62450:31681,62451:31692,62452:31709,62453:31706,62454:31717,62455:31718,62456:31722,62457:31756,62458:31742,62459:31740,62460:31759,62461:31766,62462:31755,62528:39687,62529:39689,62530:39690,62531:39691,62532:39692,62533:39693,62534:39694,62535:39696,62536:39697,62537:39698,62538:39700,62539:39701,62540:39702,62541:39703,62542:39704,62543:39705,62544:39706,62545:39707,62546:39708,62547:39709,62548:39710,62549:39712,62550:39713,62551:39714,62552:39716,62553:39717,62554:39718,62555:39719,62556:39720,62557:39721,62558:39722,62559:39723,62560:39724,62561:39725,62562:39726,62563:39728,62564:39729,62565:39731,62566:39732,62567:39733,62568:39734,62569:39735,62570:39736,62571:39737,62572:39738,62573:39741,62574:39742,62575:39743,62576:39744,62577:39750,62578:39754,62579:39755,62580:39756,62581:39758,62582:39760,62583:39762,62584:39763,62585:39765,62586:39766,62587:39767,62588:39768,62589:39769,62590:39770,62592:39771,62593:39772,62594:39773,62595:39774,62596:39775,62597:39776,62598:39777,62599:39778,62600:39779,62601:39780,62602:39781,62603:39782,62604:39783,62605:39784,62606:39785,62607:39786,62608:39787,62609:39788,62610:39789,62611:39790,62612:39791,62613:39792,62614:39793,62615:39794,62616:39795,62617:39796,62618:39797,62619:39798,62620:39799,62621:39800,62622:39801,62623:39802,62624:39803,62625:31775,62626:31786,62627:31782,62628:31800,62629:31809,62630:31808,62631:33278,62632:33281,62633:33282,62634:33284,62635:33260,62636:34884,62637:33313,62638:33314,62639:33315,62640:33325,62641:33327,62642:33320,62643:33323,62644:33336,62645:33339,62646:33331,62647:33332,62648:33342,62649:33348,62650:33353,62651:33355,62652:33359,62653:33370,62654:33375,62655:33384,62656:34942,62657:34949,62658:34952,62659:35032,62660:35039,62661:35166,62662:32669,62663:32671,62664:32679,62665:32687,62666:32688,62667:32690,62668:31868,62669:25929,62670:31889,62671:31901,62672:31900,62673:31902,62674:31906,62675:31922,62676:31932,62677:31933,62678:31937,62679:31943,62680:31948,62681:31949,62682:31944,62683:31941,62684:31959,62685:31976,62686:33390,62687:26280,62688:32703,62689:32718,62690:32725,62691:32741,62692:32737,62693:32742,62694:32745,62695:32750,62696:32755,62697:31992,62698:32119,62699:32166,62700:32174,62701:32327,62702:32411,62703:40632,62704:40628,62705:36211,62706:36228,62707:36244,62708:36241,62709:36273,62710:36199,62711:36205,62712:35911,62713:35913,62714:37194,62715:37200,62716:37198,62717:37199,62718:37220,62784:39804,62785:39805,62786:39806,62787:39807,62788:39808,62789:39809,62790:39810,62791:39811,62792:39812,62793:39813,62794:39814,62795:39815,62796:39816,62797:39817,62798:39818,62799:39819,62800:39820,62801:39821,62802:39822,62803:39823,62804:39824,62805:39825,62806:39826,62807:39827,62808:39828,62809:39829,62810:39830,62811:39831,62812:39832,62813:39833,62814:39834,62815:39835,62816:39836,62817:39837,62818:39838,62819:39839,62820:39840,62821:39841,62822:39842,62823:39843,62824:39844,62825:39845,62826:39846,62827:39847,62828:39848,62829:39849,62830:39850,62831:39851,62832:39852,62833:39853,62834:39854,62835:39855,62836:39856,62837:39857,62838:39858,62839:39859,62840:39860,62841:39861,62842:39862,62843:39863,62844:39864,62845:39865,62846:39866,62848:39867,62849:39868,62850:39869,62851:39870,62852:39871,62853:39872,62854:39873,62855:39874,62856:39875,62857:39876,62858:39877,62859:39878,62860:39879,62861:39880,62862:39881,62863:39882,62864:39883,62865:39884,62866:39885,62867:39886,62868:39887,62869:39888,62870:39889,62871:39890,62872:39891,62873:39892,62874:39893,62875:39894,62876:39895,62877:39896,62878:39897,62879:39898,62880:39899,62881:37218,62882:37217,62883:37232,62884:37225,62885:37231,62886:37245,62887:37246,62888:37234,62889:37236,62890:37241,62891:37260,62892:37253,62893:37264,62894:37261,62895:37265,62896:37282,62897:37283,62898:37290,62899:37293,62900:37294,62901:37295,62902:37301,62903:37300,62904:37306,62905:35925,62906:40574,62907:36280,62908:36331,62909:36357,62910:36441,62911:36457,62912:36277,62913:36287,62914:36284,62915:36282,62916:36292,62917:36310,62918:36311,62919:36314,62920:36318,62921:36302,62922:36303,62923:36315,62924:36294,62925:36332,62926:36343,62927:36344,62928:36323,62929:36345,62930:36347,62931:36324,62932:36361,62933:36349,62934:36372,62935:36381,62936:36383,62937:36396,62938:36398,62939:36387,62940:36399,62941:36410,62942:36416,62943:36409,62944:36405,62945:36413,62946:36401,62947:36425,62948:36417,62949:36418,62950:36433,62951:36434,62952:36426,62953:36464,62954:36470,62955:36476,62956:36463,62957:36468,62958:36485,62959:36495,62960:36500,62961:36496,62962:36508,62963:36510,62964:35960,62965:35970,62966:35978,62967:35973,62968:35992,62969:35988,62970:26011,62971:35286,62972:35294,62973:35290,62974:35292,63040:39900,63041:39901,63042:39902,63043:39903,63044:39904,63045:39905,63046:39906,63047:39907,63048:39908,63049:39909,63050:39910,63051:39911,63052:39912,63053:39913,63054:39914,63055:39915,63056:39916,63057:39917,63058:39918,63059:39919,63060:39920,63061:39921,63062:39922,63063:39923,63064:39924,63065:39925,63066:39926,63067:39927,63068:39928,63069:39929,63070:39930,63071:39931,63072:39932,63073:39933,63074:39934,63075:39935,63076:39936,63077:39937,63078:39938,63079:39939,63080:39940,63081:39941,63082:39942,63083:39943,63084:39944,63085:39945,63086:39946,63087:39947,63088:39948,63089:39949,63090:39950,63091:39951,63092:39952,63093:39953,63094:39954,63095:39955,63096:39956,63097:39957,63098:39958,63099:39959,63100:39960,63101:39961,63102:39962,63104:39963,63105:39964,63106:39965,63107:39966,63108:39967,63109:39968,63110:39969,63111:39970,63112:39971,63113:39972,63114:39973,63115:39974,63116:39975,63117:39976,63118:39977,63119:39978,63120:39979,63121:39980,63122:39981,63123:39982,63124:39983,63125:39984,63126:39985,63127:39986,63128:39987,63129:39988,63130:39989,63131:39990,63132:39991,63133:39992,63134:39993,63135:39994,63136:39995,63137:35301,63138:35307,63139:35311,63140:35390,63141:35622,63142:38739,63143:38633,63144:38643,63145:38639,63146:38662,63147:38657,63148:38664,63149:38671,63150:38670,63151:38698,63152:38701,63153:38704,63154:38718,63155:40832,63156:40835,63157:40837,63158:40838,63159:40839,63160:40840,63161:40841,63162:40842,63163:40844,63164:40702,63165:40715,63166:40717,63167:38585,63168:38588,63169:38589,63170:38606,63171:38610,63172:30655,63173:38624,63174:37518,63175:37550,63176:37576,63177:37694,63178:37738,63179:37834,63180:37775,63181:37950,63182:37995,63183:40063,63184:40066,63185:40069,63186:40070,63187:40071,63188:40072,63189:31267,63190:40075,63191:40078,63192:40080,63193:40081,63194:40082,63195:40084,63196:40085,63197:40090,63198:40091,63199:40094,63200:40095,63201:40096,63202:40097,63203:40098,63204:40099,63205:40101,63206:40102,63207:40103,63208:40104,63209:40105,63210:40107,63211:40109,63212:40110,63213:40112,63214:40113,63215:40114,63216:40115,63217:40116,63218:40117,63219:40118,63220:40119,63221:40122,63222:40123,63223:40124,63224:40125,63225:40132,63226:40133,63227:40134,63228:40135,63229:40138,63230:40139,63296:39996,63297:39997,63298:39998,63299:39999,63300:40000,63301:40001,63302:40002,63303:40003,63304:40004,63305:40005,63306:40006,63307:40007,63308:40008,63309:40009,63310:40010,63311:40011,63312:40012,63313:40013,63314:40014,63315:40015,63316:40016,63317:40017,63318:40018,63319:40019,63320:40020,63321:40021,63322:40022,63323:40023,63324:40024,63325:40025,63326:40026,63327:40027,63328:40028,63329:40029,63330:40030,63331:40031,63332:40032,63333:40033,63334:40034,63335:40035,63336:40036,63337:40037,63338:40038,63339:40039,63340:40040,63341:40041,63342:40042,63343:40043,63344:40044,63345:40045,63346:40046,63347:40047,63348:40048,63349:40049,63350:40050,63351:40051,63352:40052,63353:40053,63354:40054,63355:40055,63356:40056,63357:40057,63358:40058,63360:40059,63361:40061,63362:40062,63363:40064,63364:40067,63365:40068,63366:40073,63367:40074,63368:40076,63369:40079,63370:40083,63371:40086,63372:40087,63373:40088,63374:40089,63375:40093,63376:40106,63377:40108,63378:40111,63379:40121,63380:40126,63381:40127,63382:40128,63383:40129,63384:40130,63385:40136,63386:40137,63387:40145,63388:40146,63389:40154,63390:40155,63391:40160,63392:40161,63393:40140,63394:40141,63395:40142,63396:40143,63397:40144,63398:40147,63399:40148,63400:40149,63401:40151,63402:40152,63403:40153,63404:40156,63405:40157,63406:40159,63407:40162,63408:38780,63409:38789,63410:38801,63411:38802,63412:38804,63413:38831,63414:38827,63415:38819,63416:38834,63417:38836,63418:39601,63419:39600,63420:39607,63421:40536,63422:39606,63423:39610,63424:39612,63425:39617,63426:39616,63427:39621,63428:39618,63429:39627,63430:39628,63431:39633,63432:39749,63433:39747,63434:39751,63435:39753,63436:39752,63437:39757,63438:39761,63439:39144,63440:39181,63441:39214,63442:39253,63443:39252,63444:39647,63445:39649,63446:39654,63447:39663,63448:39659,63449:39675,63450:39661,63451:39673,63452:39688,63453:39695,63454:39699,63455:39711,63456:39715,63457:40637,63458:40638,63459:32315,63460:40578,63461:40583,63462:40584,63463:40587,63464:40594,63465:37846,63466:40605,63467:40607,63468:40667,63469:40668,63470:40669,63471:40672,63472:40671,63473:40674,63474:40681,63475:40679,63476:40677,63477:40682,63478:40687,63479:40738,63480:40748,63481:40751,63482:40761,63483:40759,63484:40765,63485:40766,63486:40772,63552:40163,63553:40164,63554:40165,63555:40166,63556:40167,63557:40168,63558:40169,63559:40170,63560:40171,63561:40172,63562:40173,63563:40174,63564:40175,63565:40176,63566:40177,63567:40178,63568:40179,63569:40180,63570:40181,63571:40182,63572:40183,63573:40184,63574:40185,63575:40186,63576:40187,63577:40188,63578:40189,63579:40190,63580:40191,63581:40192,63582:40193,63583:40194,63584:40195,63585:40196,63586:40197,63587:40198,63588:40199,63589:40200,63590:40201,63591:40202,63592:40203,63593:40204,63594:40205,63595:40206,63596:40207,63597:40208,63598:40209,63599:40210,63600:40211,63601:40212,63602:40213,63603:40214,63604:40215,63605:40216,63606:40217,63607:40218,63608:40219,63609:40220,63610:40221,63611:40222,63612:40223,63613:40224,63614:40225,63616:40226,63617:40227,63618:40228,63619:40229,63620:40230,63621:40231,63622:40232,63623:40233,63624:40234,63625:40235,63626:40236,63627:40237,63628:40238,63629:40239,63630:40240,63631:40241,63632:40242,63633:40243,63634:40244,63635:40245,63636:40246,63637:40247,63638:40248,63639:40249,63640:40250,63641:40251,63642:40252,63643:40253,63644:40254,63645:40255,63646:40256,63647:40257,63648:40258,63649:57908,63650:57909,63651:57910,63652:57911,63653:57912,63654:57913,63655:57914,63656:57915,63657:57916,63658:57917,63659:57918,63660:57919,63661:57920,63662:57921,63663:57922,63664:57923,63665:57924,63666:57925,63667:57926,63668:57927,63669:57928,63670:57929,63671:57930,63672:57931,63673:57932,63674:57933,63675:57934,63676:57935,63677:57936,63678:57937,63679:57938,63680:57939,63681:57940,63682:57941,63683:57942,63684:57943,63685:57944,63686:57945,63687:57946,63688:57947,63689:57948,63690:57949,63691:57950,63692:57951,63693:57952,63694:57953,63695:57954,63696:57955,63697:57956,63698:57957,63699:57958,63700:57959,63701:57960,63702:57961,63703:57962,63704:57963,63705:57964,63706:57965,63707:57966,63708:57967,63709:57968,63710:57969,63711:57970,63712:57971,63713:57972,63714:57973,63715:57974,63716:57975,63717:57976,63718:57977,63719:57978,63720:57979,63721:57980,63722:57981,63723:57982,63724:57983,63725:57984,63726:57985,63727:57986,63728:57987,63729:57988,63730:57989,63731:57990,63732:57991,63733:57992,63734:57993,63735:57994,63736:57995,63737:57996,63738:57997,63739:57998,63740:57999,63741:58000,63742:58001,63808:40259,63809:40260,63810:40261,63811:40262,63812:40263,63813:40264,63814:40265,63815:40266,63816:40267,63817:40268,63818:40269,63819:40270,63820:40271,63821:40272,63822:40273,63823:40274,63824:40275,63825:40276,63826:40277,63827:40278,63828:40279,63829:40280,63830:40281,63831:40282,63832:40283,63833:40284,63834:40285,63835:40286,63836:40287,63837:40288,63838:40289,63839:40290,63840:40291,63841:40292,63842:40293,63843:40294,63844:40295,63845:40296,63846:40297,63847:40298,63848:40299,63849:40300,63850:40301,63851:40302,63852:40303,63853:40304,63854:40305,63855:40306,63856:40307,63857:40308,63858:40309,63859:40310,63860:40311,63861:40312,63862:40313,63863:40314,63864:40315,63865:40316,63866:40317,63867:40318,63868:40319,63869:40320,63870:40321,63872:40322,63873:40323,63874:40324,63875:40325,63876:40326,63877:40327,63878:40328,63879:40329,63880:40330,63881:40331,63882:40332,63883:40333,63884:40334,63885:40335,63886:40336,63887:40337,63888:40338,63889:40339,63890:40340,63891:40341,63892:40342,63893:40343,63894:40344,63895:40345,63896:40346,63897:40347,63898:40348,63899:40349,63900:40350,63901:40351,63902:40352,63903:40353,63904:40354,63905:58002,63906:58003,63907:58004,63908:58005,63909:58006,63910:58007,63911:58008,63912:58009,63913:58010,63914:58011,63915:58012,63916:58013,63917:58014,63918:58015,63919:58016,63920:58017,63921:58018,63922:58019,63923:58020,63924:58021,63925:58022,63926:58023,63927:58024,63928:58025,63929:58026,63930:58027,63931:58028,63932:58029,63933:58030,63934:58031,63935:58032,63936:58033,63937:58034,63938:58035,63939:58036,63940:58037,63941:58038,63942:58039,63943:58040,63944:58041,63945:58042,63946:58043,63947:58044,63948:58045,63949:58046,63950:58047,63951:58048,63952:58049,63953:58050,63954:58051,63955:58052,63956:58053,63957:58054,63958:58055,63959:58056,63960:58057,63961:58058,63962:58059,63963:58060,63964:58061,63965:58062,63966:58063,63967:58064,63968:58065,63969:58066,63970:58067,63971:58068,63972:58069,63973:58070,63974:58071,63975:58072,63976:58073,63977:58074,63978:58075,63979:58076,63980:58077,63981:58078,63982:58079,63983:58080,63984:58081,63985:58082,63986:58083,63987:58084,63988:58085,63989:58086,63990:58087,63991:58088,63992:58089,63993:58090,63994:58091,63995:58092,63996:58093,63997:58094,63998:58095,64064:40355,64065:40356,64066:40357,64067:40358,64068:40359,64069:40360,64070:40361,64071:40362,64072:40363,64073:40364,64074:40365,64075:40366,64076:40367,64077:40368,64078:40369,64079:40370,64080:40371,64081:40372,64082:40373,64083:40374,64084:40375,64085:40376,64086:40377,64087:40378,64088:40379,64089:40380,64090:40381,64091:40382,64092:40383,64093:40384,64094:40385,64095:40386,64096:40387,64097:40388,64098:40389,64099:40390,64100:40391,64101:40392,64102:40393,64103:40394,64104:40395,64105:40396,64106:40397,64107:40398,64108:40399,64109:40400,64110:40401,64111:40402,64112:40403,64113:40404,64114:40405,64115:40406,64116:40407,64117:40408,64118:40409,64119:40410,64120:40411,64121:40412,64122:40413,64123:40414,64124:40415,64125:40416,64126:40417,64128:40418,64129:40419,64130:40420,64131:40421,64132:40422,64133:40423,64134:40424,64135:40425,64136:40426,64137:40427,64138:40428,64139:40429,64140:40430,64141:40431,64142:40432,64143:40433,64144:40434,64145:40435,64146:40436,64147:40437,64148:40438,64149:40439,64150:40440,64151:40441,64152:40442,64153:40443,64154:40444,64155:40445,64156:40446,64157:40447,64158:40448,64159:40449,64160:40450,64161:58096,64162:58097,64163:58098,64164:58099,64165:58100,64166:58101,64167:58102,64168:58103,64169:58104,64170:58105,64171:58106,64172:58107,64173:58108,64174:58109,64175:58110,64176:58111,64177:58112,64178:58113,64179:58114,64180:58115,64181:58116,64182:58117,64183:58118,64184:58119,64185:58120,64186:58121,64187:58122,64188:58123,64189:58124,64190:58125,64191:58126,64192:58127,64193:58128,64194:58129,64195:58130,64196:58131,64197:58132,64198:58133,64199:58134,64200:58135,64201:58136,64202:58137,64203:58138,64204:58139,64205:58140,64206:58141,64207:58142,64208:58143,64209:58144,64210:58145,64211:58146,64212:58147,64213:58148,64214:58149,64215:58150,64216:58151,64217:58152,64218:58153,64219:58154,64220:58155,64221:58156,64222:58157,64223:58158,64224:58159,64225:58160,64226:58161,64227:58162,64228:58163,64229:58164,64230:58165,64231:58166,64232:58167,64233:58168,64234:58169,64235:58170,64236:58171,64237:58172,64238:58173,64239:58174,64240:58175,64241:58176,64242:58177,64243:58178,64244:58179,64245:58180,64246:58181,64247:58182,64248:58183,64249:58184,64250:58185,64251:58186,64252:58187,64253:58188,64254:58189,64320:40451,64321:40452,64322:40453,64323:40454,64324:40455,64325:40456,64326:40457,64327:40458,64328:40459,64329:40460,64330:40461,64331:40462,64332:40463,64333:40464,64334:40465,64335:40466,64336:40467,64337:40468,64338:40469,64339:40470,64340:40471,64341:40472,64342:40473,64343:40474,64344:40475,64345:40476,64346:40477,64347:40478,64348:40484,64349:40487,64350:40494,64351:40496,64352:40500,64353:40507,64354:40508,64355:40512,64356:40525,64357:40528,64358:40530,64359:40531,64360:40532,64361:40534,64362:40537,64363:40541,64364:40543,64365:40544,64366:40545,64367:40546,64368:40549,64369:40558,64370:40559,64371:40562,64372:40564,64373:40565,64374:40566,64375:40567,64376:40568,64377:40569,64378:40570,64379:40571,64380:40572,64381:40573,64382:40576,64384:40577,64385:40579,64386:40580,64387:40581,64388:40582,64389:40585,64390:40586,64391:40588,64392:40589,64393:40590,64394:40591,64395:40592,64396:40593,64397:40596,64398:40597,64399:40598,64400:40599,64401:40600,64402:40601,64403:40602,64404:40603,64405:40604,64406:40606,64407:40608,64408:40609,64409:40610,64410:40611,64411:40612,64412:40613,64413:40615,64414:40616,64415:40617,64416:40618,64417:58190,64418:58191,64419:58192,64420:58193,64421:58194,64422:58195,64423:58196,64424:58197,64425:58198,64426:58199,64427:58200,64428:58201,64429:58202,64430:58203,64431:58204,64432:58205,64433:58206,64434:58207,64435:58208,64436:58209,64437:58210,64438:58211,64439:58212,64440:58213,64441:58214,64442:58215,64443:58216,64444:58217,64445:58218,64446:58219,64447:58220,64448:58221,64449:58222,64450:58223,64451:58224,64452:58225,64453:58226,64454:58227,64455:58228,64456:58229,64457:58230,64458:58231,64459:58232,64460:58233,64461:58234,64462:58235,64463:58236,64464:58237,64465:58238,64466:58239,64467:58240,64468:58241,64469:58242,64470:58243,64471:58244,64472:58245,64473:58246,64474:58247,64475:58248,64476:58249,64477:58250,64478:58251,64479:58252,64480:58253,64481:58254,64482:58255,64483:58256,64484:58257,64485:58258,64486:58259,64487:58260,64488:58261,64489:58262,64490:58263,64491:58264,64492:58265,64493:58266,64494:58267,64495:58268,64496:58269,64497:58270,64498:58271,64499:58272,64500:58273,64501:58274,64502:58275,64503:58276,64504:58277,64505:58278,64506:58279,64507:58280,64508:58281,64509:58282,64510:58283,64576:40619,64577:40620,64578:40621,64579:40622,64580:40623,64581:40624,64582:40625,64583:40626,64584:40627,64585:40629,64586:40630,64587:40631,64588:40633,64589:40634,64590:40636,64591:40639,64592:40640,64593:40641,64594:40642,64595:40643,64596:40645,64597:40646,64598:40647,64599:40648,64600:40650,64601:40651,64602:40652,64603:40656,64604:40658,64605:40659,64606:40661,64607:40662,64608:40663,64609:40665,64610:40666,64611:40670,64612:40673,64613:40675,64614:40676,64615:40678,64616:40680,64617:40683,64618:40684,64619:40685,64620:40686,64621:40688,64622:40689,64623:40690,64624:40691,64625:40692,64626:40693,64627:40694,64628:40695,64629:40696,64630:40698,64631:40701,64632:40703,64633:40704,64634:40705,64635:40706,64636:40707,64637:40708,64638:40709,64640:40710,64641:40711,64642:40712,64643:40713,64644:40714,64645:40716,64646:40719,64647:40721,64648:40722,64649:40724,64650:40725,64651:40726,64652:40728,64653:40730,64654:40731,64655:40732,64656:40733,64657:40734,64658:40735,64659:40737,64660:40739,64661:40740,64662:40741,64663:40742,64664:40743,64665:40744,64666:40745,64667:40746,64668:40747,64669:40749,64670:40750,64671:40752,64672:40753,64673:58284,64674:58285,64675:58286,64676:58287,64677:58288,64678:58289,64679:58290,64680:58291,64681:58292,64682:58293,64683:58294,64684:58295,64685:58296,64686:58297,64687:58298,64688:58299,64689:58300,64690:58301,64691:58302,64692:58303,64693:58304,64694:58305,64695:58306,64696:58307,64697:58308,64698:58309,64699:58310,64700:58311,64701:58312,64702:58313,64703:58314,64704:58315,64705:58316,64706:58317,64707:58318,64708:58319,64709:58320,64710:58321,64711:58322,64712:58323,64713:58324,64714:58325,64715:58326,64716:58327,64717:58328,64718:58329,64719:58330,64720:58331,64721:58332,64722:58333,64723:58334,64724:58335,64725:58336,64726:58337,64727:58338,64728:58339,64729:58340,64730:58341,64731:58342,64732:58343,64733:58344,64734:58345,64735:58346,64736:58347,64737:58348,64738:58349,64739:58350,64740:58351,64741:58352,64742:58353,64743:58354,64744:58355,64745:58356,64746:58357,64747:58358,64748:58359,64749:58360,64750:58361,64751:58362,64752:58363,64753:58364,64754:58365,64755:58366,64756:58367,64757:58368,64758:58369,64759:58370,64760:58371,64761:58372,64762:58373,64763:58374,64764:58375,64765:58376,64766:58377,64832:40754,64833:40755,64834:40756,64835:40757,64836:40758,64837:40760,64838:40762,64839:40764,64840:40767,64841:40768,64842:40769,64843:40770,64844:40771,64845:40773,64846:40774,64847:40775,64848:40776,64849:40777,64850:40778,64851:40779,64852:40780,64853:40781,64854:40782,64855:40783,64856:40786,64857:40787,64858:40788,64859:40789,64860:40790,64861:40791,64862:40792,64863:40793,64864:40794,64865:40795,64866:40796,64867:40797,64868:40798,64869:40799,64870:40800,64871:40801,64872:40802,64873:40803,64874:40804,64875:40805,64876:40806,64877:40807,64878:40808,64879:40809,64880:40810,64881:40811,64882:40812,64883:40813,64884:40814,64885:40815,64886:40816,64887:40817,64888:40818,64889:40819,64890:40820,64891:40821,64892:40822,64893:40823,64894:40824,64896:40825,64897:40826,64898:40827,64899:40828,64900:40829,64901:40830,64902:40833,64903:40834,64904:40845,64905:40846,64906:40847,64907:40848,64908:40849,64909:40850,64910:40851,64911:40852,64912:40853,64913:40854,64914:40855,64915:40856,64916:40860,64917:40861,64918:40862,64919:40865,64920:40866,64921:40867,64922:40868,64923:40869,64924:63788,64925:63865,64926:63893,64927:63975,64928:63985,64929:58378,64930:58379,64931:58380,64932:58381,64933:58382,64934:58383,64935:58384,64936:58385,64937:58386,64938:58387,64939:58388,64940:58389,64941:58390,64942:58391,64943:58392,64944:58393,64945:58394,64946:58395,64947:58396,64948:58397,64949:58398,64950:58399,64951:58400,64952:58401,64953:58402,64954:58403,64955:58404,64956:58405,64957:58406,64958:58407,64959:58408,64960:58409,64961:58410,64962:58411,64963:58412,64964:58413,64965:58414,64966:58415,64967:58416,64968:58417,64969:58418,64970:58419,64971:58420,64972:58421,64973:58422,64974:58423,64975:58424,64976:58425,64977:58426,64978:58427,64979:58428,64980:58429,64981:58430,64982:58431,64983:58432,64984:58433,64985:58434,64986:58435,64987:58436,64988:58437,64989:58438,64990:58439,64991:58440,64992:58441,64993:58442,64994:58443,64995:58444,64996:58445,64997:58446,64998:58447,64999:58448,65000:58449,65001:58450,65002:58451,65003:58452,65004:58453,65005:58454,65006:58455,65007:58456,65008:58457,65009:58458,65010:58459,65011:58460,65012:58461,65013:58462,65014:58463,65015:58464,65016:58465,65017:58466,65018:58467,65019:58468,65020:58469,65021:58470,65022:58471,65088:64012,65089:64013,65090:64014,65091:64015,65092:64017,65093:64019,65094:64020,65095:64024,65096:64031,65097:64032,65098:64033,65099:64035,65100:64036,65101:64039,65102:64040,65103:64041,65104:11905,65105:59414,65106:59415,65107:59416,65108:11908,65109:13427,65110:13383,65111:11912,65112:11915,65113:59422,65114:13726,65115:13850,65116:13838,65117:11916,65118:11927,65119:14702,65120:14616,65121:59430,65122:14799,65123:14815,65124:14963,65125:14800,65126:59435,65127:59436,65128:15182,65129:15470,65130:15584,65131:11943,65132:59441,65133:59442,65134:11946,65135:16470,65136:16735,65137:11950,65138:17207,65139:11955,65140:11958,65141:11959,65142:59451,65143:17329,65144:17324,65145:11963,65146:17373,65147:17622,65148:18017,65149:17996,65150:59459,65152:18211,65153:18217,65154:18300,65155:18317,65156:11978,65157:18759,65158:18810,65159:18813,65160:18818,65161:18819,65162:18821,65163:18822,65164:18847,65165:18843,65166:18871,65167:18870,65168:59476,65169:59477,65170:19619,65171:19615,65172:19616,65173:19617,65174:19575,65175:19618,65176:19731,65177:19732,65178:19733,65179:19734,65180:19735,65181:19736,65182:19737,65183:19886,65184:59492,65185:58472,65186:58473,65187:58474,65188:58475,65189:58476,65190:58477,65191:58478,65192:58479,65193:58480,65194:58481,65195:58482,65196:58483,65197:58484,65198:58485,65199:58486,65200:58487,65201:58488,65202:58489,65203:58490,65204:58491,65205:58492,65206:58493,65207:58494,65208:58495,65209:58496,65210:58497,65211:58498,65212:58499,65213:58500,65214:58501,65215:58502,65216:58503,65217:58504,65218:58505,65219:58506,65220:58507,65221:58508,65222:58509,65223:58510,65224:58511,65225:58512,65226:58513,65227:58514,65228:58515,65229:58516,65230:58517,65231:58518,65232:58519,65233:58520,65234:58521,65235:58522,65236:58523,65237:58524,65238:58525,65239:58526,65240:58527,65241:58528,65242:58529,65243:58530,65244:58531,65245:58532,65246:58533,65247:58534,65248:58535,65249:58536,65250:58537,65251:58538,65252:58539,65253:58540,65254:58541,65255:58542,65256:58543,65257:58544,65258:58545,65259:58546,65260:58547,65261:58548,65262:58549,65263:58550,65264:58551,65265:58552,65266:58553,65267:58554,65268:58555,65269:58556,65270:58557,65271:58558,65272:58559,65273:58560,65274:58561,65275:58562,65276:58563,65277:58564,65278:58565} \ No newline at end of file diff --git a/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/file-utils/node_modules/iconv-lite/generation/generate-big5-table.js b/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/file-utils/node_modules/iconv-lite/generation/generate-big5-table.js new file mode 100644 index 0000000..909e433 --- /dev/null +++ b/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/file-utils/node_modules/iconv-lite/generation/generate-big5-table.js @@ -0,0 +1,25 @@ +var http = require('http'); +var fs = require('fs'); +// BIG5 +var cp950_b2u = {host:'moztw.org',path:'/docs/big5/table/cp950-b2u.txt'}, + cp950_u2b = {host:'moztw.org',path:'/docs/big5/table/cp950-u2b.txt'}, + cp950_moz18_b2u = {host:'moztw.org',path:'/docs/big5/table/moz18-b2u.txt'}; + +http.get(cp950_moz18_b2u, function(res) { + var data = ''; + res.on('data', function(chunk) { + data += chunk; + }); + res.on('end', function() { + var table = {}; + data = data.split('\n').slice(1); + data.forEach(function(line, idx) { + var pair = line.split(' '); + var key = parseInt(pair[0]); + var val = parseInt(pair[1]); + table[key] = val; + }); + fs.createWriteSync('encodings/table/big5.js', + 'module.exports = ' + JSON.stringify(table) + ';'); + }); +}); diff --git a/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/file-utils/node_modules/iconv-lite/generation/generate-singlebyte.js b/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/file-utils/node_modules/iconv-lite/generation/generate-singlebyte.js new file mode 100644 index 0000000..2cbebec --- /dev/null +++ b/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/file-utils/node_modules/iconv-lite/generation/generate-singlebyte.js @@ -0,0 +1,142 @@ +var fs = require("fs"); +var Iconv = require("iconv").Iconv; + + +var encodingFamilies = [ + { + // Windows code pages + encodings: [1250, 1251, 1252, 1253, 1254, 1255, 1256, 1257, 1258], + convert: function(cp) { + return { + name: "windows-"+cp, + aliases: ["win"+cp, "cp"+cp, ""+cp], + } + } + }, + { + // ISO-8859 code pages + encodings: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 14, 15, 16], + convert: function(i) { + return { + name: "iso-8859-"+i, + aliases: ["cp"+(28590+i), (28590+i)], + } + } + }, + { + // IBM/DOS code pages + encodings: [437, 737, 775, 850, 852, 855, 857, 858, 860, 861, 862, 863, 864, 865, 866, 869], + convert: function(cp) { + return { + name: "CP"+cp, + aliases: ["ibm"+cp, ""+cp], + } + } + }, + { + // Macintosh code pages + encodings: ["macCroatian", "macCyrillic", "macGreek", + "macIceland", "macRoman", "macRomania", + "macThai", "macTurkish", "macUkraine"], + }, + { + // KOI8 code pages + encodings: ["KOI8-R", "KOI8-U"], + }, +]; + + +var encodings = { + // Aliases. + "ascii8bit": "ascii", + "usascii": "ascii", + + "latin1": "iso88591", + "latin2": "iso88592", + "latin3": "iso88593", + "latin4": "iso88594", + "latin6": "iso885910", + "latin7": "iso885913", + "latin8": "iso885914", + "latin9": "iso885915", + "latin10": "iso885916", + + "cp819": "iso88951", + "arabic": "iso88596", + "arabic8": "iso88596", + "greek" : "iso88597", + "greek8" : "iso88597", + "hebrew": "iso88598", + "hebrew8": "iso88598", + "turkish": "iso88599", + "turkish8": "iso88599", + "thai": "iso885911", + "thai8": "iso885911", + "tis620": "iso885911", + "windows874": "iso885911", + "win874": "iso885911", + "cp874": "iso885911", + "874": "iso885911", + "celtic": "iso885914", + "celtic8": "iso885914", + + "cp20866": "koi8r", + "20866": "koi8r", + "ibm878": "koi8r", + "cp21866": "koi8u", + "21866": "koi8u", + "ibm1168": "koi8u", + +}; + +// Add all encodings from encodingFamilies. +encodingFamilies.forEach(function(family){ + family.encodings.forEach(function(encoding){ + if (family.convert) + encoding = family.convert(encoding); + + var encodingIconvName = encoding.name ? encoding.name : encoding; + var encodingName = encodingIconvName.replace(/[-_]/g, "").toLowerCase(); + + encodings[encodingName] = { + type: "singlebyte", + chars: generateCharsString(encodingIconvName) + }; + + if (encoding.aliases) + encoding.aliases.forEach(function(alias){ + encodings[alias] = encodingName; + }); + }); +}); + +// Write encodings. +fs.writeFileSync("encodings/singlebyte.js", + "module.exports = " + JSON.stringify(encodings, undefined, " ") + ";"); + + +function generateCharsString(encoding) { + console.log("Generate encoding for " + encoding); + var iconvToUtf8 = new Iconv(encoding, "UTF-8"); + var chars = ""; + + for (var b = 0x80; b < 0x100; b++) { + + try { + var convertedChar = iconvToUtf8.convert(new Buffer([b])).toString(); + + if (convertedChar.length != 1) + throw new Error("Single-byte encoding error: Must return single char."); + } catch (exception) { + if (exception.code === "EILSEQ") { + convertedChar = "\ufffd"; + } else { + throw exception; + } + } + + chars += convertedChar; + } + + return chars; +} diff --git a/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/file-utils/node_modules/iconv-lite/index.js b/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/file-utils/node_modules/iconv-lite/index.js new file mode 100644 index 0000000..a55691b --- /dev/null +++ b/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/file-utils/node_modules/iconv-lite/index.js @@ -0,0 +1,231 @@ +var RE_SPACEDASH = /[- ]/g; +// Module exports +var iconv = module.exports = { + toEncoding: function(str, encoding) { + return iconv.getCodec(encoding).toEncoding(str); + }, + fromEncoding: function(buf, encoding) { + return iconv.getCodec(encoding).fromEncoding(buf); + }, + encodingExists: function(enc) { + loadEncodings(); + enc = enc.replace(RE_SPACEDASH, "").toLowerCase(); + return (iconv.encodings[enc] !== undefined); + }, + + defaultCharUnicode: '�', + defaultCharSingleByte: '?', + + encodingsLoaded: false, + + // Get correct codec for given encoding. + getCodec: function(encoding) { + loadEncodings(); + var enc = encoding || "utf8"; + var codecOptions = undefined; + while (1) { + if (getType(enc) === "String") + enc = enc.replace(RE_SPACEDASH, "").toLowerCase(); + var codec = iconv.encodings[enc]; + var type = getType(codec); + if (type === "String") { + // Link to other encoding. + codecOptions = {originalEncoding: enc}; + enc = codec; + } + else if (type === "Object" && codec.type != undefined) { + // Options for other encoding. + codecOptions = codec; + enc = codec.type; + } + else if (type === "Function") + // Codec itself. + return codec(codecOptions); + else + throw new Error("Encoding not recognized: '" + encoding + "' (searched as: '"+enc+"')"); + } + }, + + // Define basic encodings + encodings: { + internal: function(options) { + return { + toEncoding: toInternalEncoding, + fromEncoding: fromInternalEncoding, + options: options + }; + }, + utf8: "internal", + ucs2: "internal", + binary: "internal", + ascii: "internal", + base64: "internal", + + // Codepage single-byte encodings. + singlebyte: function(options) { + // Prepare chars if needed + if (!options.charsBuf) { + if (!options.chars || (options.chars.length !== 128 && options.chars.length !== 256)) + throw new Error("Encoding '"+options.type+"' has incorrect 'chars' (must be of len 128 or 256)"); + + if (options.chars.length === 128) + options.chars = asciiString + options.chars; + + options.charsBuf = new Buffer(options.chars, 'ucs2'); + } + + if (!options.revCharsBuf) { + options.revCharsBuf = new Buffer(65536); + var defChar = iconv.defaultCharSingleByte.charCodeAt(0); + for (var i = 0; i < options.revCharsBuf.length; i++) + options.revCharsBuf[i] = defChar; + for (var i = 0; i < options.chars.length; i++) + options.revCharsBuf[options.chars.charCodeAt(i)] = i; + } + + return { + toEncoding: toSingleByteEncoding, + fromEncoding: fromSingleByteEncoding, + options: options, + }; + }, + + // Codepage double-byte encodings. + table: function(options) { + if (!options.table) { + throw new Error("Encoding '" + options.type + "' has incorect 'table' option"); + } + if (!options.revCharsTable) { + var revCharsTable = options.revCharsTable = {}; + for (var i = 0; i <= 0xFFFF; i++) { + revCharsTable[i] = 0; + } + + var table = options.table; + for (var key in table) { + revCharsTable[table[key]] = +key; + } + } + + return { + toEncoding: toTableEncoding, + fromEncoding: fromTableEncoding, + options: options, + }; + } + } +}; + +function toInternalEncoding(str) { + return new Buffer(ensureString(str), this.options.originalEncoding); +} + +function fromInternalEncoding(buf) { + return ensureBuffer(buf).toString(this.options.originalEncoding); +} + +function toTableEncoding(str) { + str = ensureString(str); + var strLen = str.length; + var revCharsTable = this.options.revCharsTable; + var newBuf = new Buffer(strLen*2), gbkcode, unicode, + defaultChar = revCharsTable[iconv.defaultCharUnicode.charCodeAt(0)]; + + for (var i = 0, j = 0; i < strLen; i++) { + unicode = str.charCodeAt(i); + if (unicode >> 7) { + gbkcode = revCharsTable[unicode] || defaultChar; + newBuf[j++] = gbkcode >> 8; //high byte; + newBuf[j++] = gbkcode & 0xFF; //low byte + } else {//ascii + newBuf[j++] = unicode; + } + } + return newBuf.slice(0, j); +} + +function fromTableEncoding(buf) { + buf = ensureBuffer(buf); + var bufLen = buf.length; + var table = this.options.table; + var newBuf = new Buffer(bufLen*2), unicode, gbkcode, + defaultChar = iconv.defaultCharUnicode.charCodeAt(0); + + for (var i = 0, j = 0; i < bufLen; i++, j+=2) { + gbkcode = buf[i]; + if (gbkcode & 0x80) { + gbkcode = (gbkcode << 8) + buf[++i]; + unicode = table[gbkcode] || defaultChar; + } else { + unicode = gbkcode; + } + newBuf[j] = unicode & 0xFF; //low byte + newBuf[j+1] = unicode >> 8; //high byte + } + return newBuf.slice(0, j).toString('ucs2'); +} + +function toSingleByteEncoding(str) { + str = ensureString(str); + + var buf = new Buffer(str.length); + var revCharsBuf = this.options.revCharsBuf; + for (var i = 0; i < str.length; i++) + buf[i] = revCharsBuf[str.charCodeAt(i)]; + + return buf; +} + +function fromSingleByteEncoding(buf) { + buf = ensureBuffer(buf); + + // Strings are immutable in JS -> we use ucs2 buffer to speed up computations. + var charsBuf = this.options.charsBuf; + var newBuf = new Buffer(buf.length*2); + var idx1 = 0, idx2 = 0; + for (var i = 0, _len = buf.length; i < _len; i++) { + idx1 = buf[i]*2; idx2 = i*2; + newBuf[idx2] = charsBuf[idx1]; + newBuf[idx2+1] = charsBuf[idx1+1]; + } + return newBuf.toString('ucs2'); +} + +// Add aliases to convert functions +iconv.encode = iconv.toEncoding; +iconv.decode = iconv.fromEncoding; + +// Load other encodings manually from files in /encodings dir. +function loadEncodings() { + if (!iconv.encodingsLoaded) { + [ require('./encodings/singlebyte'), + require('./encodings/gbk'), + require('./encodings/big5') + ].forEach(function(encodings) { + for (var key in encodings) + iconv.encodings[key] = encodings[key] + }); + iconv.encodingsLoaded = true; + } +} + + + +// Utilities +var asciiString = '\x00\x01\x02\x03\x04\x05\x06\x07\x08\t\n\x0b\x0c\r\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f'+ + ' !"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x7f'; + +var ensureBuffer = function(buf) { + buf = buf || new Buffer(0); + return (buf instanceof Buffer) ? buf : new Buffer(""+buf, "binary"); +} + +var ensureString = function(str) { + str = str || ""; + return (str instanceof Buffer) ? str.toString('utf8') : (""+str); +} + +var getType = function(obj) { + return Object.prototype.toString.call(obj).slice(8, -1); +} + diff --git a/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/file-utils/node_modules/iconv-lite/package.json b/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/file-utils/node_modules/iconv-lite/package.json new file mode 100644 index 0000000..8a33a2d --- /dev/null +++ b/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/file-utils/node_modules/iconv-lite/package.json @@ -0,0 +1,96 @@ +{ + "name": "iconv-lite", + "description": "Convert character encodings in pure javascript.", + "version": "0.2.11", + "license": "MIT", + "keywords": [ + "iconv", + "convert", + "charset" + ], + "author": { + "name": "Alexander Shtuchkin", + "email": "ashtuchkin@gmail.com" + }, + "contributors": [ + { + "name": "Jinwu Zhan", + "url": "https://github.com/jenkinv" + }, + { + "name": "Adamansky Anton", + "url": "https://github.com/adamansky" + }, + { + "name": "George Stagas", + "url": "https://github.com/stagas" + }, + { + "name": "Mike D Pilsbury", + "url": "https://github.com/pekim" + }, + { + "name": "Niggler", + "url": "https://github.com/Niggler" + }, + { + "name": "wychi", + "url": "https://github.com/wychi" + }, + { + "name": "David Kuo", + "url": "https://github.com/david50407" + }, + { + "name": "ChangZhuo Chen", + "url": "https://github.com/czchen" + }, + { + "name": "Lee Treveil", + "url": "https://github.com/leetreveil" + }, + { + "name": "Brian White", + "url": "https://github.com/mscdex" + } + ], + "main": "index.js", + "homepage": "https://github.com/ashtuchkin/iconv-lite", + "repository": { + "type": "git", + "url": "git://github.com/ashtuchkin/iconv-lite.git" + }, + "engines": { + "node": ">=0.4.0" + }, + "scripts": { + "test": "vows --spec" + }, + "devDependencies": { + "vows": "", + "iconv": ">=1.1" + }, + "bugs": { + "url": "https://github.com/ashtuchkin/iconv-lite/issues" + }, + "_id": "iconv-lite@0.2.11", + "dist": { + "shasum": "1ce60a3a57864a292d1321ff4609ca4bb965adc8", + "tarball": "http://registry.npmjs.org/iconv-lite/-/iconv-lite-0.2.11.tgz" + }, + "_from": "iconv-lite@~0.2.11", + "_npmVersion": "1.3.2", + "_npmUser": { + "name": "ashtuchkin", + "email": "ashtuchkin@gmail.com" + }, + "maintainers": [ + { + "name": "ashtuchkin", + "email": "ashtuchkin@gmail.com" + } + ], + "directories": {}, + "_shasum": "1ce60a3a57864a292d1321ff4609ca4bb965adc8", + "_resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.2.11.tgz" +} diff --git a/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/file-utils/node_modules/isbinaryfile/index.js b/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/file-utils/node_modules/isbinaryfile/index.js new file mode 100644 index 0000000..6cea180 --- /dev/null +++ b/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/file-utils/node_modules/isbinaryfile/index.js @@ -0,0 +1,87 @@ +var fs = require('fs'); +var path = require("path"); +var max_bytes = 512; + +module.exports = function(bytes, size) { + // Read the file with no encoding for raw buffer access. + if (size === undefined) { + var file = bytes, existsSync = fs.existsSync || path.existsSync; + if (!existsSync(file)) + return false; + var descriptor = fs.openSync(file, 'r'); + try { + bytes = new Buffer(max_bytes); + size = fs.readSync(descriptor, bytes, 0, bytes.length, 0); + } finally { + fs.closeSync(descriptor); + } + } + else if (typeof size === "function") { + var file = bytes, callback = size; + var exists = fs.exists || path.exists; + exists(file, function (exists) { + if (!exists) return callback(null, false); + + fs.open(file, 'r', function(err, descriptor){ + if (err) return callback(err); + var bytes = new Buffer(max_bytes); + // Read the file with no encoding for raw buffer access. + fs.read(descriptor, bytes, 0, bytes.length, 0, function(err, size, bytes){ + fs.close(descriptor, function(err2){ + if (err || err2) + return callback(err || err2); + return callback(null, isBinaryCheck(bytes, size)); + }); + }); + }); + }); + } + + return isBinaryCheck(bytes, size); +} + +function isBinaryCheck(bytes, size) { + if (size === 0) + return false; + + var suspicious_bytes = 0; + var total_bytes = Math.min(size, max_bytes); + + if (size >= 3 && bytes[0] == 0xEF && bytes[1] == 0xBB && bytes[2] == 0xBF) { + // UTF-8 BOM. This isn't binary. + return false; + } + + for (var i = 0; i < total_bytes; i++) { + if (bytes[i] === 0) { // NULL byte--it's binary! + return true; + } + else if ((bytes[i] < 7 || bytes[i] > 14) && (bytes[i] < 32 || bytes[i] > 127)) { + // UTF-8 detection + if (bytes[i] > 191 && bytes[i] < 224 && i + 1 < total_bytes) { + i++; + if (bytes[i] < 192) { + continue; + } + } + else if (bytes[i] > 223 && bytes[i] < 239 && i + 2 < total_bytes) { + i++; + if (bytes[i] < 192 && bytes[i + 1] < 192) { + i++; + continue; + } + } + suspicious_bytes++; + // Read at least 32 bytes before making a decision + if (i > 32 && (suspicious_bytes * 100) / total_bytes > 10) { + return true; + } + } + } + + if ((suspicious_bytes * 100) / total_bytes > 10) { + return true; + } + + return false; +} diff --git a/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/file-utils/node_modules/isbinaryfile/package.json b/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/file-utils/node_modules/isbinaryfile/package.json new file mode 100644 index 0000000..1d45aca --- /dev/null +++ b/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/file-utils/node_modules/isbinaryfile/package.json @@ -0,0 +1,39 @@ +{ + "name": "isbinaryfile", + "version": "2.0.1", + "description": "Detects if a file is binary in Node.js. Similar to Perl's -B.", + "main": "./lib/panino.js", + "engines": { + "node": ">=0.6.0" + }, + "maintainers": [ + { + "name": "gjtorikian", + "email": "gjtorikian@gmail.com" + } + ], + "repository": { + "type": "git", + "url": "https://github.com/gjtorikian/isBinaryFile" + }, + "devDependencies": { + "mocha": "" + }, + "scripts": { + "test": "mocha tests/test.js" + }, + "_id": "isbinaryfile@2.0.1", + "dist": { + "shasum": "b92369bfdaf616027133e077c5ba145f36699d55", + "tarball": "http://registry.npmjs.org/isbinaryfile/-/isbinaryfile-2.0.1.tgz" + }, + "_from": "isbinaryfile@~2.0.0", + "_npmVersion": "1.2.17", + "_npmUser": { + "name": "gjtorikian", + "email": "gjtorikian@gmail.com" + }, + "directories": {}, + "_shasum": "b92369bfdaf616027133e077c5ba145f36699d55", + "_resolved": "https://registry.npmjs.org/isbinaryfile/-/isbinaryfile-2.0.1.tgz" +} diff --git a/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/file-utils/node_modules/lru-cache/lib/lru-cache.js b/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/file-utils/node_modules/lru-cache/lib/lru-cache.js new file mode 100644 index 0000000..d1d1381 --- /dev/null +++ b/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/file-utils/node_modules/lru-cache/lib/lru-cache.js @@ -0,0 +1,252 @@ +;(function () { // closure for web browsers + +if (typeof module === 'object' && module.exports) { + module.exports = LRUCache +} else { + // just set the global for non-node platforms. + this.LRUCache = LRUCache +} + +function hOP (obj, key) { + return Object.prototype.hasOwnProperty.call(obj, key) +} + +function naiveLength () { return 1 } + +function LRUCache (options) { + if (!(this instanceof LRUCache)) + return new LRUCache(options) + + if (typeof options === 'number') + options = { max: options } + + if (!options) + options = {} + + this._max = options.max + // Kind of weird to have a default max of Infinity, but oh well. + if (!this._max || !(typeof this._max === "number") || this._max <= 0 ) + this._max = Infinity + + this._lengthCalculator = options.length || naiveLength + if (typeof this._lengthCalculator !== "function") + this._lengthCalculator = naiveLength + + this._allowStale = options.stale || false + this._maxAge = options.maxAge || null + this._dispose = options.dispose + this.reset() +} + +// resize the cache when the max changes. +Object.defineProperty(LRUCache.prototype, "max", + { set : function (mL) { + if (!mL || !(typeof mL === "number") || mL <= 0 ) mL = Infinity + this._max = mL + if (this._length > this._max) trim(this) + } + , get : function () { return this._max } + , enumerable : true + }) + +// resize the cache when the lengthCalculator changes. +Object.defineProperty(LRUCache.prototype, "lengthCalculator", + { set : function (lC) { + if (typeof lC !== "function") { + this._lengthCalculator = naiveLength + this._length = this._itemCount + for (var key in this._cache) { + this._cache[key].length = 1 + } + } else { + this._lengthCalculator = lC + this._length = 0 + for (var key in this._cache) { + this._cache[key].length = this._lengthCalculator(this._cache[key].value) + this._length += this._cache[key].length + } + } + + if (this._length > this._max) trim(this) + } + , get : function () { return this._lengthCalculator } + , enumerable : true + }) + +Object.defineProperty(LRUCache.prototype, "length", + { get : function () { return this._length } + , enumerable : true + }) + + +Object.defineProperty(LRUCache.prototype, "itemCount", + { get : function () { return this._itemCount } + , enumerable : true + }) + +LRUCache.prototype.forEach = function (fn, thisp) { + thisp = thisp || this + var i = 0; + for (var k = this._mru - 1; k >= 0 && i < this._itemCount; k--) if (this._lruList[k]) { + i++ + var hit = this._lruList[k] + if (this._maxAge && (Date.now() - hit.now > this._maxAge)) { + del(this, hit) + if (!this._allowStale) hit = undefined + } + if (hit) { + fn.call(thisp, hit.value, hit.key, this) + } + } +} + +LRUCache.prototype.keys = function () { + var keys = new Array(this._itemCount) + var i = 0 + for (var k = this._mru - 1; k >= 0 && i < this._itemCount; k--) if (this._lruList[k]) { + var hit = this._lruList[k] + keys[i++] = hit.key + } + return keys +} + +LRUCache.prototype.values = function () { + var values = new Array(this._itemCount) + var i = 0 + for (var k = this._mru - 1; k >= 0 && i < this._itemCount; k--) if (this._lruList[k]) { + var hit = this._lruList[k] + values[i++] = hit.value + } + return values +} + +LRUCache.prototype.reset = function () { + if (this._dispose && this._cache) { + for (var k in this._cache) { + this._dispose(k, this._cache[k].value) + } + } + + this._cache = Object.create(null) // hash of items by key + this._lruList = Object.create(null) // list of items in order of use recency + this._mru = 0 // most recently used + this._lru = 0 // least recently used + this._length = 0 // number of items in the list + this._itemCount = 0 +} + +// Provided for debugging/dev purposes only. No promises whatsoever that +// this API stays stable. +LRUCache.prototype.dump = function () { + return this._cache +} + +LRUCache.prototype.dumpLru = function () { + return this._lruList +} + +LRUCache.prototype.set = function (key, value) { + if (hOP(this._cache, key)) { + // dispose of the old one before overwriting + if (this._dispose) this._dispose(key, this._cache[key].value) + if (this._maxAge) this._cache[key].now = Date.now() + this._cache[key].value = value + this.get(key) + return true + } + + var len = this._lengthCalculator(value) + var age = this._maxAge ? Date.now() : 0 + var hit = new Entry(key, value, this._mru++, len, age) + + // oversized objects fall out of cache automatically. + if (hit.length > this._max) { + if (this._dispose) this._dispose(key, value) + return false + } + + this._length += hit.length + this._lruList[hit.lu] = this._cache[key] = hit + this._itemCount ++ + + if (this._length > this._max) trim(this) + return true +} + +LRUCache.prototype.has = function (key) { + if (!hOP(this._cache, key)) return false + var hit = this._cache[key] + if (this._maxAge && (Date.now() - hit.now > this._maxAge)) { + return false + } + return true +} + +LRUCache.prototype.get = function (key) { + return get(this, key, true) +} + +LRUCache.prototype.peek = function (key) { + return get(this, key, false) +} + +LRUCache.prototype.pop = function () { + var hit = this._lruList[this._lru] + del(this, hit) + return hit || null +} + +LRUCache.prototype.del = function (key) { + del(this, this._cache[key]) +} + +function get (self, key, doUse) { + var hit = self._cache[key] + if (hit) { + if (self._maxAge && (Date.now() - hit.now > self._maxAge)) { + del(self, hit) + if (!self._allowStale) hit = undefined + } else { + if (doUse) use(self, hit) + } + if (hit) hit = hit.value + } + return hit +} + +function use (self, hit) { + shiftLU(self, hit) + hit.lu = self._mru ++ + self._lruList[hit.lu] = hit +} + +function trim (self) { + while (self._lru < self._mru && self._length > self._max) + del(self, self._lruList[self._lru]) +} + +function shiftLU (self, hit) { + delete self._lruList[ hit.lu ] + while (self._lru < self._mru && !self._lruList[self._lru]) self._lru ++ +} + +function del (self, hit) { + if (hit) { + if (self._dispose) self._dispose(hit.key, hit.value) + self._length -= hit.length + self._itemCount -- + delete self._cache[ hit.key ] + shiftLU(self, hit) + } +} + +// classy, since V8 prefers predictable objects. +function Entry (key, value, lu, length, now) { + this.key = key + this.value = value + this.lu = lu + this.length = length + this.now = now +} + +})() diff --git a/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/file-utils/node_modules/lru-cache/package.json b/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/file-utils/node_modules/lru-cache/package.json new file mode 100644 index 0000000..2040b70 --- /dev/null +++ b/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/file-utils/node_modules/lru-cache/package.json @@ -0,0 +1,50 @@ +{ + "name": "lru-cache", + "description": "A cache object that deletes the least-recently-used items.", + "version": "2.5.0", + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me" + }, + "scripts": { + "test": "tap test --gc" + }, + "main": "lib/lru-cache.js", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/node-lru-cache.git" + }, + "devDependencies": { + "tap": "", + "weak": "" + }, + "license": { + "type": "MIT", + "url": "http://github.com/isaacs/node-lru-cache/raw/master/LICENSE" + }, + "bugs": { + "url": "https://github.com/isaacs/node-lru-cache/issues" + }, + "homepage": "https://github.com/isaacs/node-lru-cache", + "_id": "lru-cache@2.5.0", + "dist": { + "shasum": "d82388ae9c960becbea0c73bb9eb79b6c6ce9aeb", + "tarball": "http://registry.npmjs.org/lru-cache/-/lru-cache-2.5.0.tgz" + }, + "_from": "lru-cache@2.5.0", + "_npmVersion": "1.3.15", + "_npmUser": { + "name": "isaacs", + "email": "i@izs.me" + }, + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + } + ], + "directories": {}, + "_shasum": "d82388ae9c960becbea0c73bb9eb79b6c6ce9aeb", + "_resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.5.0.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/file-utils/node_modules/minimatch/minimatch.js b/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/file-utils/node_modules/minimatch/minimatch.js new file mode 100644 index 0000000..c633f89 --- /dev/null +++ b/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/file-utils/node_modules/minimatch/minimatch.js @@ -0,0 +1,1055 @@ +;(function (require, exports, module, platform) { + +if (module) module.exports = minimatch +else exports.minimatch = minimatch + +if (!require) { + require = function (id) { + switch (id) { + case "sigmund": return function sigmund (obj) { + return JSON.stringify(obj) + } + case "path": return { basename: function (f) { + f = f.split(/[\/\\]/) + var e = f.pop() + if (!e) e = f.pop() + return e + }} + case "lru-cache": return function LRUCache () { + // not quite an LRU, but still space-limited. + var cache = {} + var cnt = 0 + this.set = function (k, v) { + cnt ++ + if (cnt >= 100) cache = {} + cache[k] = v + } + this.get = function (k) { return cache[k] } + } + } + } +} + +minimatch.Minimatch = Minimatch + +var LRU = require("lru-cache") + , cache = minimatch.cache = new LRU({max: 100}) + , GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {} + , sigmund = require("sigmund") + +var path = require("path") + // any single thing other than / + // don't need to escape / when using new RegExp() + , qmark = "[^/]" + + // * => any number of characters + , star = qmark + "*?" + + // ** when dots are allowed. Anything goes, except .. and . + // not (^ or / followed by one or two dots followed by $ or /), + // followed by anything, any number of times. + , twoStarDot = "(?:(?!(?:\\\/|^)(?:\\.{1,2})($|\\\/)).)*?" + + // not a ^ or / followed by a dot, + // followed by anything, any number of times. + , twoStarNoDot = "(?:(?!(?:\\\/|^)\\.).)*?" + + // characters that need to be escaped in RegExp. + , reSpecials = charSet("().*{}+?[]^$\\!") + +// "abc" -> { a:true, b:true, c:true } +function charSet (s) { + return s.split("").reduce(function (set, c) { + set[c] = true + return set + }, {}) +} + +// normalizes slashes. +var slashSplit = /\/+/ + +minimatch.filter = filter +function filter (pattern, options) { + options = options || {} + return function (p, i, list) { + return minimatch(p, pattern, options) + } +} + +function ext (a, b) { + a = a || {} + b = b || {} + var t = {} + Object.keys(b).forEach(function (k) { + t[k] = b[k] + }) + Object.keys(a).forEach(function (k) { + t[k] = a[k] + }) + return t +} + +minimatch.defaults = function (def) { + if (!def || !Object.keys(def).length) return minimatch + + var orig = minimatch + + var m = function minimatch (p, pattern, options) { + return orig.minimatch(p, pattern, ext(def, options)) + } + + m.Minimatch = function Minimatch (pattern, options) { + return new orig.Minimatch(pattern, ext(def, options)) + } + + return m +} + +Minimatch.defaults = function (def) { + if (!def || !Object.keys(def).length) return Minimatch + return minimatch.defaults(def).Minimatch +} + + +function minimatch (p, pattern, options) { + if (typeof pattern !== "string") { + throw new TypeError("glob pattern string required") + } + + if (!options) options = {} + + // shortcut: comments match nothing. + if (!options.nocomment && pattern.charAt(0) === "#") { + return false + } + + // "" only matches "" + if (pattern.trim() === "") return p === "" + + return new Minimatch(pattern, options).match(p) +} + +function Minimatch (pattern, options) { + if (!(this instanceof Minimatch)) { + return new Minimatch(pattern, options, cache) + } + + if (typeof pattern !== "string") { + throw new TypeError("glob pattern string required") + } + + if (!options) options = {} + pattern = pattern.trim() + + // windows: need to use /, not \ + // On other platforms, \ is a valid (albeit bad) filename char. + if (platform === "win32") { + pattern = pattern.split("\\").join("/") + } + + // lru storage. + // these things aren't particularly big, but walking down the string + // and turning it into a regexp can get pretty costly. + var cacheKey = pattern + "\n" + sigmund(options) + var cached = minimatch.cache.get(cacheKey) + if (cached) return cached + minimatch.cache.set(cacheKey, this) + + this.options = options + this.set = [] + this.pattern = pattern + this.regexp = null + this.negate = false + this.comment = false + this.empty = false + + // make the set of regexps etc. + this.make() +} + +Minimatch.prototype.debug = function() {} + +Minimatch.prototype.make = make +function make () { + // don't do it more than once. + if (this._made) return + + var pattern = this.pattern + var options = this.options + + // empty patterns and comments match nothing. + if (!options.nocomment && pattern.charAt(0) === "#") { + this.comment = true + return + } + if (!pattern) { + this.empty = true + return + } + + // step 1: figure out negation, etc. + this.parseNegate() + + // step 2: expand braces + var set = this.globSet = this.braceExpand() + + if (options.debug) this.debug = console.error + + this.debug(this.pattern, set) + + // step 3: now we have a set, so turn each one into a series of path-portion + // matching patterns. + // These will be regexps, except in the case of "**", which is + // set to the GLOBSTAR object for globstar behavior, + // and will not contain any / characters + set = this.globParts = set.map(function (s) { + return s.split(slashSplit) + }) + + this.debug(this.pattern, set) + + // glob --> regexps + set = set.map(function (s, si, set) { + return s.map(this.parse, this) + }, this) + + this.debug(this.pattern, set) + + // filter out everything that didn't compile properly. + set = set.filter(function (s) { + return -1 === s.indexOf(false) + }) + + this.debug(this.pattern, set) + + this.set = set +} + +Minimatch.prototype.parseNegate = parseNegate +function parseNegate () { + var pattern = this.pattern + , negate = false + , options = this.options + , negateOffset = 0 + + if (options.nonegate) return + + for ( var i = 0, l = pattern.length + ; i < l && pattern.charAt(i) === "!" + ; i ++) { + negate = !negate + negateOffset ++ + } + + if (negateOffset) this.pattern = pattern.substr(negateOffset) + this.negate = negate +} + +// Brace expansion: +// a{b,c}d -> abd acd +// a{b,}c -> abc ac +// a{0..3}d -> a0d a1d a2d a3d +// a{b,c{d,e}f}g -> abg acdfg acefg +// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg +// +// Invalid sets are not expanded. +// a{2..}b -> a{2..}b +// a{b}c -> a{b}c +minimatch.braceExpand = function (pattern, options) { + return new Minimatch(pattern, options).braceExpand() +} + +Minimatch.prototype.braceExpand = braceExpand +function braceExpand (pattern, options) { + options = options || this.options + pattern = typeof pattern === "undefined" + ? this.pattern : pattern + + if (typeof pattern === "undefined") { + throw new Error("undefined pattern") + } + + if (options.nobrace || + !pattern.match(/\{.*\}/)) { + // shortcut. no need to expand. + return [pattern] + } + + var escaping = false + + // examples and comments refer to this crazy pattern: + // a{b,c{d,e},{f,g}h}x{y,z} + // expected: + // abxy + // abxz + // acdxy + // acdxz + // acexy + // acexz + // afhxy + // afhxz + // aghxy + // aghxz + + // everything before the first \{ is just a prefix. + // So, we pluck that off, and work with the rest, + // and then prepend it to everything we find. + if (pattern.charAt(0) !== "{") { + this.debug(pattern) + var prefix = null + for (var i = 0, l = pattern.length; i < l; i ++) { + var c = pattern.charAt(i) + this.debug(i, c) + if (c === "\\") { + escaping = !escaping + } else if (c === "{" && !escaping) { + prefix = pattern.substr(0, i) + break + } + } + + // actually no sets, all { were escaped. + if (prefix === null) { + this.debug("no sets") + return [pattern] + } + + var tail = braceExpand.call(this, pattern.substr(i), options) + return tail.map(function (t) { + return prefix + t + }) + } + + // now we have something like: + // {b,c{d,e},{f,g}h}x{y,z} + // walk through the set, expanding each part, until + // the set ends. then, we'll expand the suffix. + // If the set only has a single member, then'll put the {} back + + // first, handle numeric sets, since they're easier + var numset = pattern.match(/^\{(-?[0-9]+)\.\.(-?[0-9]+)\}/) + if (numset) { + this.debug("numset", numset[1], numset[2]) + var suf = braceExpand.call(this, pattern.substr(numset[0].length), options) + , start = +numset[1] + , end = +numset[2] + , inc = start > end ? -1 : 1 + , set = [] + for (var i = start; i != (end + inc); i += inc) { + // append all the suffixes + for (var ii = 0, ll = suf.length; ii < ll; ii ++) { + set.push(i + suf[ii]) + } + } + return set + } + + // ok, walk through the set + // We hope, somewhat optimistically, that there + // will be a } at the end. + // If the closing brace isn't found, then the pattern is + // interpreted as braceExpand("\\" + pattern) so that + // the leading \{ will be interpreted literally. + var i = 1 // skip the \{ + , depth = 1 + , set = [] + , member = "" + , sawEnd = false + , escaping = false + + function addMember () { + set.push(member) + member = "" + } + + this.debug("Entering for") + FOR: for (i = 1, l = pattern.length; i < l; i ++) { + var c = pattern.charAt(i) + this.debug("", i, c) + + if (escaping) { + escaping = false + member += "\\" + c + } else { + switch (c) { + case "\\": + escaping = true + continue + + case "{": + depth ++ + member += "{" + continue + + case "}": + depth -- + // if this closes the actual set, then we're done + if (depth === 0) { + addMember() + // pluck off the close-brace + i ++ + break FOR + } else { + member += c + continue + } + + case ",": + if (depth === 1) { + addMember() + } else { + member += c + } + continue + + default: + member += c + continue + } // switch + } // else + } // for + + // now we've either finished the set, and the suffix is + // pattern.substr(i), or we have *not* closed the set, + // and need to escape the leading brace + if (depth !== 0) { + this.debug("didn't close", pattern) + return braceExpand.call(this, "\\" + pattern, options) + } + + // x{y,z} -> ["xy", "xz"] + this.debug("set", set) + this.debug("suffix", pattern.substr(i)) + var suf = braceExpand.call(this, pattern.substr(i), options) + // ["b", "c{d,e}","{f,g}h"] -> + // [["b"], ["cd", "ce"], ["fh", "gh"]] + var addBraces = set.length === 1 + this.debug("set pre-expanded", set) + set = set.map(function (p) { + return braceExpand.call(this, p, options) + }, this) + this.debug("set expanded", set) + + + // [["b"], ["cd", "ce"], ["fh", "gh"]] -> + // ["b", "cd", "ce", "fh", "gh"] + set = set.reduce(function (l, r) { + return l.concat(r) + }) + + if (addBraces) { + set = set.map(function (s) { + return "{" + s + "}" + }) + } + + // now attach the suffixes. + var ret = [] + for (var i = 0, l = set.length; i < l; i ++) { + for (var ii = 0, ll = suf.length; ii < ll; ii ++) { + ret.push(set[i] + suf[ii]) + } + } + return ret +} + +// parse a component of the expanded set. +// At this point, no pattern may contain "/" in it +// so we're going to return a 2d array, where each entry is the full +// pattern, split on '/', and then turned into a regular expression. +// A regexp is made at the end which joins each array with an +// escaped /, and another full one which joins each regexp with |. +// +// Following the lead of Bash 4.1, note that "**" only has special meaning +// when it is the *only* thing in a path portion. Otherwise, any series +// of * is equivalent to a single *. Globstar behavior is enabled by +// default, and can be disabled by setting options.noglobstar. +Minimatch.prototype.parse = parse +var SUBPARSE = {} +function parse (pattern, isSub) { + var options = this.options + + // shortcuts + if (!options.noglobstar && pattern === "**") return GLOBSTAR + if (pattern === "") return "" + + var re = "" + , hasMagic = !!options.nocase + , escaping = false + // ? => one single character + , patternListStack = [] + , plType + , stateChar + , inClass = false + , reClassStart = -1 + , classStart = -1 + // . and .. never match anything that doesn't start with ., + // even when options.dot is set. + , patternStart = pattern.charAt(0) === "." ? "" // anything + // not (start or / followed by . or .. followed by / or end) + : options.dot ? "(?!(?:^|\\\/)\\.{1,2}(?:$|\\\/))" + : "(?!\\.)" + , self = this + + function clearStateChar () { + if (stateChar) { + // we had some state-tracking character + // that wasn't consumed by this pass. + switch (stateChar) { + case "*": + re += star + hasMagic = true + break + case "?": + re += qmark + hasMagic = true + break + default: + re += "\\"+stateChar + break + } + self.debug('clearStateChar %j %j', stateChar, re) + stateChar = false + } + } + + for ( var i = 0, len = pattern.length, c + ; (i < len) && (c = pattern.charAt(i)) + ; i ++ ) { + + this.debug("%s\t%s %s %j", pattern, i, re, c) + + // skip over any that are escaped. + if (escaping && reSpecials[c]) { + re += "\\" + c + escaping = false + continue + } + + SWITCH: switch (c) { + case "/": + // completely not allowed, even escaped. + // Should already be path-split by now. + return false + + case "\\": + clearStateChar() + escaping = true + continue + + // the various stateChar values + // for the "extglob" stuff. + case "?": + case "*": + case "+": + case "@": + case "!": + this.debug("%s\t%s %s %j <-- stateChar", pattern, i, re, c) + + // all of those are literals inside a class, except that + // the glob [!a] means [^a] in regexp + if (inClass) { + this.debug(' in class') + if (c === "!" && i === classStart + 1) c = "^" + re += c + continue + } + + // if we already have a stateChar, then it means + // that there was something like ** or +? in there. + // Handle the stateChar, then proceed with this one. + self.debug('call clearStateChar %j', stateChar) + clearStateChar() + stateChar = c + // if extglob is disabled, then +(asdf|foo) isn't a thing. + // just clear the statechar *now*, rather than even diving into + // the patternList stuff. + if (options.noext) clearStateChar() + continue + + case "(": + if (inClass) { + re += "(" + continue + } + + if (!stateChar) { + re += "\\(" + continue + } + + plType = stateChar + patternListStack.push({ type: plType + , start: i - 1 + , reStart: re.length }) + // negation is (?:(?!js)[^/]*) + re += stateChar === "!" ? "(?:(?!" : "(?:" + this.debug('plType %j %j', stateChar, re) + stateChar = false + continue + + case ")": + if (inClass || !patternListStack.length) { + re += "\\)" + continue + } + + clearStateChar() + hasMagic = true + re += ")" + plType = patternListStack.pop().type + // negation is (?:(?!js)[^/]*) + // The others are (?:) + switch (plType) { + case "!": + re += "[^/]*?)" + break + case "?": + case "+": + case "*": re += plType + case "@": break // the default anyway + } + continue + + case "|": + if (inClass || !patternListStack.length || escaping) { + re += "\\|" + escaping = false + continue + } + + clearStateChar() + re += "|" + continue + + // these are mostly the same in regexp and glob + case "[": + // swallow any state-tracking char before the [ + clearStateChar() + + if (inClass) { + re += "\\" + c + continue + } + + inClass = true + classStart = i + reClassStart = re.length + re += c + continue + + case "]": + // a right bracket shall lose its special + // meaning and represent itself in + // a bracket expression if it occurs + // first in the list. -- POSIX.2 2.8.3.2 + if (i === classStart + 1 || !inClass) { + re += "\\" + c + escaping = false + continue + } + + // finish up the class. + hasMagic = true + inClass = false + re += c + continue + + default: + // swallow any state char that wasn't consumed + clearStateChar() + + if (escaping) { + // no need + escaping = false + } else if (reSpecials[c] + && !(c === "^" && inClass)) { + re += "\\" + } + + re += c + + } // switch + } // for + + + // handle the case where we left a class open. + // "[abc" is valid, equivalent to "\[abc" + if (inClass) { + // split where the last [ was, and escape it + // this is a huge pita. We now have to re-walk + // the contents of the would-be class to re-translate + // any characters that were passed through as-is + var cs = pattern.substr(classStart + 1) + , sp = this.parse(cs, SUBPARSE) + re = re.substr(0, reClassStart) + "\\[" + sp[0] + hasMagic = hasMagic || sp[1] + } + + // handle the case where we had a +( thing at the *end* + // of the pattern. + // each pattern list stack adds 3 chars, and we need to go through + // and escape any | chars that were passed through as-is for the regexp. + // Go through and escape them, taking care not to double-escape any + // | chars that were already escaped. + var pl + while (pl = patternListStack.pop()) { + var tail = re.slice(pl.reStart + 3) + // maybe some even number of \, then maybe 1 \, followed by a | + tail = tail.replace(/((?:\\{2})*)(\\?)\|/g, function (_, $1, $2) { + if (!$2) { + // the | isn't already escaped, so escape it. + $2 = "\\" + } + + // need to escape all those slashes *again*, without escaping the + // one that we need for escaping the | character. As it works out, + // escaping an even number of slashes can be done by simply repeating + // it exactly after itself. That's why this trick works. + // + // I am sorry that you have to see this. + return $1 + $1 + $2 + "|" + }) + + this.debug("tail=%j\n %s", tail, tail) + var t = pl.type === "*" ? star + : pl.type === "?" ? qmark + : "\\" + pl.type + + hasMagic = true + re = re.slice(0, pl.reStart) + + t + "\\(" + + tail + } + + // handle trailing things that only matter at the very end. + clearStateChar() + if (escaping) { + // trailing \\ + re += "\\\\" + } + + // only need to apply the nodot start if the re starts with + // something that could conceivably capture a dot + var addPatternStart = false + switch (re.charAt(0)) { + case ".": + case "[": + case "(": addPatternStart = true + } + + // if the re is not "" at this point, then we need to make sure + // it doesn't match against an empty path part. + // Otherwise a/* will match a/, which it should not. + if (re !== "" && hasMagic) re = "(?=.)" + re + + if (addPatternStart) re = patternStart + re + + // parsing just a piece of a larger pattern. + if (isSub === SUBPARSE) { + return [ re, hasMagic ] + } + + // skip the regexp for non-magical patterns + // unescape anything in it, though, so that it'll be + // an exact match against a file etc. + if (!hasMagic) { + return globUnescape(pattern) + } + + var flags = options.nocase ? "i" : "" + , regExp = new RegExp("^" + re + "$", flags) + + regExp._glob = pattern + regExp._src = re + + return regExp +} + +minimatch.makeRe = function (pattern, options) { + return new Minimatch(pattern, options || {}).makeRe() +} + +Minimatch.prototype.makeRe = makeRe +function makeRe () { + if (this.regexp || this.regexp === false) return this.regexp + + // at this point, this.set is a 2d array of partial + // pattern strings, or "**". + // + // It's better to use .match(). This function shouldn't + // be used, really, but it's pretty convenient sometimes, + // when you just want to work with a regex. + var set = this.set + + if (!set.length) return this.regexp = false + var options = this.options + + var twoStar = options.noglobstar ? star + : options.dot ? twoStarDot + : twoStarNoDot + , flags = options.nocase ? "i" : "" + + var re = set.map(function (pattern) { + return pattern.map(function (p) { + return (p === GLOBSTAR) ? twoStar + : (typeof p === "string") ? regExpEscape(p) + : p._src + }).join("\\\/") + }).join("|") + + // must match entire pattern + // ending in a * or ** will make it less strict. + re = "^(?:" + re + ")$" + + // can match anything, as long as it's not this. + if (this.negate) re = "^(?!" + re + ").*$" + + try { + return this.regexp = new RegExp(re, flags) + } catch (ex) { + return this.regexp = false + } +} + +minimatch.match = function (list, pattern, options) { + var mm = new Minimatch(pattern, options) + list = list.filter(function (f) { + return mm.match(f) + }) + if (options.nonull && !list.length) { + list.push(pattern) + } + return list +} + +Minimatch.prototype.match = match +function match (f, partial) { + this.debug("match", f, this.pattern) + // short-circuit in the case of busted things. + // comments, etc. + if (this.comment) return false + if (this.empty) return f === "" + + if (f === "/" && partial) return true + + var options = this.options + + // windows: need to use /, not \ + // On other platforms, \ is a valid (albeit bad) filename char. + if (platform === "win32") { + f = f.split("\\").join("/") + } + + // treat the test path as a set of pathparts. + f = f.split(slashSplit) + this.debug(this.pattern, "split", f) + + // just ONE of the pattern sets in this.set needs to match + // in order for it to be valid. If negating, then just one + // match means that we have failed. + // Either way, return on the first hit. + + var set = this.set + this.debug(this.pattern, "set", set) + + var splitFile = path.basename(f.join("/")).split("/") + + for (var i = 0, l = set.length; i < l; i ++) { + var pattern = set[i], file = f + if (options.matchBase && pattern.length === 1) { + file = splitFile + } + var hit = this.matchOne(file, pattern, partial) + if (hit) { + if (options.flipNegate) return true + return !this.negate + } + } + + // didn't get any hits. this is success if it's a negative + // pattern, failure otherwise. + if (options.flipNegate) return false + return this.negate +} + +// set partial to true to test if, for example, +// "/a/b" matches the start of "/*/b/*/d" +// Partial means, if you run out of file before you run +// out of pattern, then that's fine, as long as all +// the parts match. +Minimatch.prototype.matchOne = function (file, pattern, partial) { + var options = this.options + + this.debug("matchOne", + { "this": this + , file: file + , pattern: pattern }) + + this.debug("matchOne", file.length, pattern.length) + + for ( var fi = 0 + , pi = 0 + , fl = file.length + , pl = pattern.length + ; (fi < fl) && (pi < pl) + ; fi ++, pi ++ ) { + + this.debug("matchOne loop") + var p = pattern[pi] + , f = file[fi] + + this.debug(pattern, p, f) + + // should be impossible. + // some invalid regexp stuff in the set. + if (p === false) return false + + if (p === GLOBSTAR) { + this.debug('GLOBSTAR', [pattern, p, f]) + + // "**" + // a/**/b/**/c would match the following: + // a/b/x/y/z/c + // a/x/y/z/b/c + // a/b/x/b/x/c + // a/b/c + // To do this, take the rest of the pattern after + // the **, and see if it would match the file remainder. + // If so, return success. + // If not, the ** "swallows" a segment, and try again. + // This is recursively awful. + // + // a/**/b/**/c matching a/b/x/y/z/c + // - a matches a + // - doublestar + // - matchOne(b/x/y/z/c, b/**/c) + // - b matches b + // - doublestar + // - matchOne(x/y/z/c, c) -> no + // - matchOne(y/z/c, c) -> no + // - matchOne(z/c, c) -> no + // - matchOne(c, c) yes, hit + var fr = fi + , pr = pi + 1 + if (pr === pl) { + this.debug('** at the end') + // a ** at the end will just swallow the rest. + // We have found a match. + // however, it will not swallow /.x, unless + // options.dot is set. + // . and .. are *never* matched by **, for explosively + // exponential reasons. + for ( ; fi < fl; fi ++) { + if (file[fi] === "." || file[fi] === ".." || + (!options.dot && file[fi].charAt(0) === ".")) return false + } + return true + } + + // ok, let's see if we can swallow whatever we can. + WHILE: while (fr < fl) { + var swallowee = file[fr] + + this.debug('\nglobstar while', + file, fr, pattern, pr, swallowee) + + // XXX remove this slice. Just pass the start index. + if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) { + this.debug('globstar found match!', fr, fl, swallowee) + // found a match. + return true + } else { + // can't swallow "." or ".." ever. + // can only swallow ".foo" when explicitly asked. + if (swallowee === "." || swallowee === ".." || + (!options.dot && swallowee.charAt(0) === ".")) { + this.debug("dot detected!", file, fr, pattern, pr) + break WHILE + } + + // ** swallows a segment, and continue. + this.debug('globstar swallow a segment, and continue') + fr ++ + } + } + // no match was found. + // However, in partial mode, we can't say this is necessarily over. + // If there's more *pattern* left, then + if (partial) { + // ran out of file + this.debug("\n>>> no match, partial?", file, fr, pattern, pr) + if (fr === fl) return true + } + return false + } + + // something other than ** + // non-magic patterns just have to match exactly + // patterns with magic have been turned into regexps. + var hit + if (typeof p === "string") { + if (options.nocase) { + hit = f.toLowerCase() === p.toLowerCase() + } else { + hit = f === p + } + this.debug("string match", p, f, hit) + } else { + hit = f.match(p) + this.debug("pattern match", p, f, hit) + } + + if (!hit) return false + } + + // Note: ending in / means that we'll get a final "" + // at the end of the pattern. This can only match a + // corresponding "" at the end of the file. + // If the file ends in /, then it can only match a + // a pattern that ends in /, unless the pattern just + // doesn't have any more for it. But, a/b/ should *not* + // match "a/b/*", even though "" matches against the + // [^/]*? pattern, except in partial mode, where it might + // simply not be reached yet. + // However, a/b/ should still satisfy a/* + + // now either we fell off the end of the pattern, or we're done. + if (fi === fl && pi === pl) { + // ran out of pattern and filename at the same time. + // an exact hit! + return true + } else if (fi === fl) { + // ran out of file, but still had pattern left. + // this is ok if we're doing the match as part of + // a glob fs traversal. + return partial + } else if (pi === pl) { + // ran out of pattern, still have file left. + // this is only acceptable if we're on the very last + // empty segment of a file with a trailing slash. + // a/* should match a/b/ + var emptyFileEnd = (fi === fl - 1) && (file[fi] === "") + return emptyFileEnd + } + + // should be unreachable. + throw new Error("wtf?") +} + + +// replace stuff like \* with * +function globUnescape (s) { + return s.replace(/\\(.)/g, "$1") +} + + +function regExpEscape (s) { + return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&") +} + +})( typeof require === "function" ? require : null, + this, + typeof module === "object" ? module : null, + typeof process === "object" ? process.platform : "win32" + ) diff --git a/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/file-utils/node_modules/minimatch/node_modules/_._ b/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/file-utils/node_modules/minimatch/node_modules/_._ new file mode 100644 index 0000000..e69de29 diff --git a/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/file-utils/node_modules/minimatch/package.json b/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/file-utils/node_modules/minimatch/package.json new file mode 100644 index 0000000..a4f31df --- /dev/null +++ b/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/file-utils/node_modules/minimatch/package.json @@ -0,0 +1,56 @@ +{ + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me" + }, + "name": "minimatch", + "description": "a glob matcher in javascript", + "version": "0.2.14", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/minimatch.git" + }, + "main": "minimatch.js", + "scripts": { + "test": "tap test/*.js" + }, + "engines": { + "node": "*" + }, + "dependencies": { + "lru-cache": "2", + "sigmund": "~1.0.0" + }, + "devDependencies": { + "tap": "" + }, + "license": { + "type": "MIT", + "url": "http://github.com/isaacs/minimatch/raw/master/LICENSE" + }, + "bugs": { + "url": "https://github.com/isaacs/minimatch/issues" + }, + "homepage": "https://github.com/isaacs/minimatch", + "_id": "minimatch@0.2.14", + "dist": { + "shasum": "c74e780574f63c6f9a090e90efbe6ef53a6a756a", + "tarball": "http://registry.npmjs.org/minimatch/-/minimatch-0.2.14.tgz" + }, + "_from": "minimatch@~0.2.12", + "_npmVersion": "1.3.17", + "_npmUser": { + "name": "isaacs", + "email": "i@izs.me" + }, + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + } + ], + "directories": {}, + "_shasum": "c74e780574f63c6f9a090e90efbe6ef53a6a756a", + "_resolved": "https://registry.npmjs.org/minimatch/-/minimatch-0.2.14.tgz" +} diff --git a/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/file-utils/node_modules/rimraf/bin.js b/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/file-utils/node_modules/rimraf/bin.js new file mode 100644 index 0000000..29bfa8a --- /dev/null +++ b/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/file-utils/node_modules/rimraf/bin.js @@ -0,0 +1,33 @@ +#!/usr/bin/env node + +var rimraf = require('./') + +var help = false +var dashdash = false +var args = process.argv.slice(2).filter(function(arg) { + if (dashdash) + return !!arg + else if (arg === '--') + dashdash = true + else if (arg.match(/^(-+|\/)(h(elp)?|\?)$/)) + help = true + else + return !!arg +}); + +if (help || args.length === 0) { + // If they didn't ask for help, then this is not a "success" + var log = help ? console.log : console.error + log('Usage: rimraf ') + log('') + log(' Deletes all files and folders at "path" recursively.') + log('') + log('Options:') + log('') + log(' -h, --help Display this usage info') + process.exit(help ? 0 : 1) +} else { + args.forEach(function(arg) { + rimraf.sync(arg) + }) +} diff --git a/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/file-utils/node_modules/rimraf/package.json b/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/file-utils/node_modules/rimraf/package.json new file mode 100644 index 0000000..a629288 --- /dev/null +++ b/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/file-utils/node_modules/rimraf/package.json @@ -0,0 +1,72 @@ +{ + "name": "rimraf", + "version": "2.2.8", + "main": "rimraf.js", + "description": "A deep deletion module for node (like `rm -rf`)", + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "license": { + "type": "MIT", + "url": "https://github.com/isaacs/rimraf/raw/master/LICENSE" + }, + "repository": { + "type": "git", + "url": "git://github.com/isaacs/rimraf.git" + }, + "scripts": { + "test": "cd test && bash run.sh" + }, + "bin": { + "rimraf": "./bin.js" + }, + "contributors": [ + { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me" + }, + { + "name": "Wayne Larsen", + "email": "wayne@larsen.st", + "url": "http://github.com/wvl" + }, + { + "name": "ritch", + "email": "skawful@gmail.com" + }, + { + "name": "Marcel Laverdet" + }, + { + "name": "Yosef Dinerstein", + "email": "yosefd@microsoft.com" + } + ], + "bugs": { + "url": "https://github.com/isaacs/rimraf/issues" + }, + "homepage": "https://github.com/isaacs/rimraf", + "_id": "rimraf@2.2.8", + "_shasum": "e439be2aaee327321952730f99a8929e4fc50582", + "_from": "rimraf@~2.2.2", + "_npmVersion": "1.4.10", + "_npmUser": { + "name": "isaacs", + "email": "i@izs.me" + }, + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + } + ], + "dist": { + "shasum": "e439be2aaee327321952730f99a8929e4fc50582", + "tarball": "http://registry.npmjs.org/rimraf/-/rimraf-2.2.8.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.2.8.tgz" +} diff --git a/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/file-utils/node_modules/rimraf/rimraf.js b/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/file-utils/node_modules/rimraf/rimraf.js new file mode 100644 index 0000000..eb96c46 --- /dev/null +++ b/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/file-utils/node_modules/rimraf/rimraf.js @@ -0,0 +1,248 @@ +module.exports = rimraf +rimraf.sync = rimrafSync + +var assert = require("assert") +var path = require("path") +var fs = require("fs") + +// for EMFILE handling +var timeout = 0 +exports.EMFILE_MAX = 1000 +exports.BUSYTRIES_MAX = 3 + +var isWindows = (process.platform === "win32") + +function defaults (options) { + var methods = [ + 'unlink', + 'chmod', + 'stat', + 'rmdir', + 'readdir' + ] + methods.forEach(function(m) { + options[m] = options[m] || fs[m] + m = m + 'Sync' + options[m] = options[m] || fs[m] + }) +} + +function rimraf (p, options, cb) { + if (typeof options === 'function') { + cb = options + options = {} + } + assert(p) + assert(options) + assert(typeof cb === 'function') + + defaults(options) + + if (!cb) throw new Error("No callback passed to rimraf()") + + var busyTries = 0 + rimraf_(p, options, function CB (er) { + if (er) { + if (isWindows && (er.code === "EBUSY" || er.code === "ENOTEMPTY") && + busyTries < exports.BUSYTRIES_MAX) { + busyTries ++ + var time = busyTries * 100 + // try again, with the same exact callback as this one. + return setTimeout(function () { + rimraf_(p, options, CB) + }, time) + } + + // this one won't happen if graceful-fs is used. + if (er.code === "EMFILE" && timeout < exports.EMFILE_MAX) { + return setTimeout(function () { + rimraf_(p, options, CB) + }, timeout ++) + } + + // already gone + if (er.code === "ENOENT") er = null + } + + timeout = 0 + cb(er) + }) +} + +// Two possible strategies. +// 1. Assume it's a file. unlink it, then do the dir stuff on EPERM or EISDIR +// 2. Assume it's a directory. readdir, then do the file stuff on ENOTDIR +// +// Both result in an extra syscall when you guess wrong. However, there +// are likely far more normal files in the world than directories. This +// is based on the assumption that a the average number of files per +// directory is >= 1. +// +// If anyone ever complains about this, then I guess the strategy could +// be made configurable somehow. But until then, YAGNI. +function rimraf_ (p, options, cb) { + assert(p) + assert(options) + assert(typeof cb === 'function') + + options.unlink(p, function (er) { + if (er) { + if (er.code === "ENOENT") + return cb(null) + if (er.code === "EPERM") + return (isWindows) + ? fixWinEPERM(p, options, er, cb) + : rmdir(p, options, er, cb) + if (er.code === "EISDIR") + return rmdir(p, options, er, cb) + } + return cb(er) + }) +} + +function fixWinEPERM (p, options, er, cb) { + assert(p) + assert(options) + assert(typeof cb === 'function') + if (er) + assert(er instanceof Error) + + options.chmod(p, 666, function (er2) { + if (er2) + cb(er2.code === "ENOENT" ? null : er) + else + options.stat(p, function(er3, stats) { + if (er3) + cb(er3.code === "ENOENT" ? null : er) + else if (stats.isDirectory()) + rmdir(p, options, er, cb) + else + options.unlink(p, cb) + }) + }) +} + +function fixWinEPERMSync (p, options, er) { + assert(p) + assert(options) + if (er) + assert(er instanceof Error) + + try { + options.chmodSync(p, 666) + } catch (er2) { + if (er2.code === "ENOENT") + return + else + throw er + } + + try { + var stats = options.statSync(p) + } catch (er3) { + if (er3.code === "ENOENT") + return + else + throw er + } + + if (stats.isDirectory()) + rmdirSync(p, options, er) + else + options.unlinkSync(p) +} + +function rmdir (p, options, originalEr, cb) { + assert(p) + assert(options) + if (originalEr) + assert(originalEr instanceof Error) + assert(typeof cb === 'function') + + // try to rmdir first, and only readdir on ENOTEMPTY or EEXIST (SunOS) + // if we guessed wrong, and it's not a directory, then + // raise the original error. + options.rmdir(p, function (er) { + if (er && (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM")) + rmkids(p, options, cb) + else if (er && er.code === "ENOTDIR") + cb(originalEr) + else + cb(er) + }) +} + +function rmkids(p, options, cb) { + assert(p) + assert(options) + assert(typeof cb === 'function') + + options.readdir(p, function (er, files) { + if (er) + return cb(er) + var n = files.length + if (n === 0) + return options.rmdir(p, cb) + var errState + files.forEach(function (f) { + rimraf(path.join(p, f), options, function (er) { + if (errState) + return + if (er) + return cb(errState = er) + if (--n === 0) + options.rmdir(p, cb) + }) + }) + }) +} + +// this looks simpler, and is strictly *faster*, but will +// tie up the JavaScript thread and fail on excessively +// deep directory trees. +function rimrafSync (p, options) { + options = options || {} + defaults(options) + + assert(p) + assert(options) + + try { + options.unlinkSync(p) + } catch (er) { + if (er.code === "ENOENT") + return + if (er.code === "EPERM") + return isWindows ? fixWinEPERMSync(p, options, er) : rmdirSync(p, options, er) + if (er.code !== "EISDIR") + throw er + rmdirSync(p, options, er) + } +} + +function rmdirSync (p, options, originalEr) { + assert(p) + assert(options) + if (originalEr) + assert(originalEr instanceof Error) + + try { + options.rmdirSync(p) + } catch (er) { + if (er.code === "ENOENT") + return + if (er.code === "ENOTDIR") + throw originalEr + if (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM") + rmkidsSync(p, options) + } +} + +function rmkidsSync (p, options) { + assert(p) + assert(options) + options.readdirSync(p).forEach(function (f) { + rimrafSync(path.join(p, f), options) + }) + options.rmdirSync(p, options) +} diff --git a/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/file-utils/node_modules/sigmund/bench.js b/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/file-utils/node_modules/sigmund/bench.js new file mode 100644 index 0000000..5acfd6d --- /dev/null +++ b/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/file-utils/node_modules/sigmund/bench.js @@ -0,0 +1,283 @@ +// different ways to id objects +// use a req/res pair, since it's crazy deep and cyclical + +// sparseFE10 and sigmund are usually pretty close, which is to be expected, +// since they are essentially the same algorithm, except that sigmund handles +// regular expression objects properly. + + +var http = require('http') +var util = require('util') +var sigmund = require('./sigmund.js') +var sreq, sres, creq, cres, test + +http.createServer(function (q, s) { + sreq = q + sres = s + sres.end('ok') + this.close(function () { setTimeout(function () { + start() + }, 200) }) +}).listen(1337, function () { + creq = http.get({ port: 1337 }) + creq.on('response', function (s) { cres = s }) +}) + +function start () { + test = [sreq, sres, creq, cres] + // test = sreq + // sreq.sres = sres + // sreq.creq = creq + // sreq.cres = cres + + for (var i in exports.compare) { + console.log(i) + var hash = exports.compare[i]() + console.log(hash) + console.log(hash.length) + console.log('') + } + + require('bench').runMain() +} + +function customWs (obj, md, d) { + d = d || 0 + var to = typeof obj + if (to === 'undefined' || to === 'function' || to === null) return '' + if (d > md || !obj || to !== 'object') return ('' + obj).replace(/[\n ]+/g, '') + + if (Array.isArray(obj)) { + return obj.map(function (i, _, __) { + return customWs(i, md, d + 1) + }).reduce(function (a, b) { return a + b }, '') + } + + var keys = Object.keys(obj) + return keys.map(function (k, _, __) { + return k + ':' + customWs(obj[k], md, d + 1) + }).reduce(function (a, b) { return a + b }, '') +} + +function custom (obj, md, d) { + d = d || 0 + var to = typeof obj + if (to === 'undefined' || to === 'function' || to === null) return '' + if (d > md || !obj || to !== 'object') return '' + obj + + if (Array.isArray(obj)) { + return obj.map(function (i, _, __) { + return custom(i, md, d + 1) + }).reduce(function (a, b) { return a + b }, '') + } + + var keys = Object.keys(obj) + return keys.map(function (k, _, __) { + return k + ':' + custom(obj[k], md, d + 1) + }).reduce(function (a, b) { return a + b }, '') +} + +function sparseFE2 (obj, maxDepth) { + var seen = [] + var soFar = '' + function ch (v, depth) { + if (depth > maxDepth) return + if (typeof v === 'function' || typeof v === 'undefined') return + if (typeof v !== 'object' || !v) { + soFar += v + return + } + if (seen.indexOf(v) !== -1 || depth === maxDepth) return + seen.push(v) + soFar += '{' + Object.keys(v).forEach(function (k, _, __) { + // pseudo-private values. skip those. + if (k.charAt(0) === '_') return + var to = typeof v[k] + if (to === 'function' || to === 'undefined') return + soFar += k + ':' + ch(v[k], depth + 1) + }) + soFar += '}' + } + ch(obj, 0) + return soFar +} + +function sparseFE (obj, maxDepth) { + var seen = [] + var soFar = '' + function ch (v, depth) { + if (depth > maxDepth) return + if (typeof v === 'function' || typeof v === 'undefined') return + if (typeof v !== 'object' || !v) { + soFar += v + return + } + if (seen.indexOf(v) !== -1 || depth === maxDepth) return + seen.push(v) + soFar += '{' + Object.keys(v).forEach(function (k, _, __) { + // pseudo-private values. skip those. + if (k.charAt(0) === '_') return + var to = typeof v[k] + if (to === 'function' || to === 'undefined') return + soFar += k + ch(v[k], depth + 1) + }) + } + ch(obj, 0) + return soFar +} + +function sparse (obj, maxDepth) { + var seen = [] + var soFar = '' + function ch (v, depth) { + if (depth > maxDepth) return + if (typeof v === 'function' || typeof v === 'undefined') return + if (typeof v !== 'object' || !v) { + soFar += v + return + } + if (seen.indexOf(v) !== -1 || depth === maxDepth) return + seen.push(v) + soFar += '{' + for (var k in v) { + // pseudo-private values. skip those. + if (k.charAt(0) === '_') continue + var to = typeof v[k] + if (to === 'function' || to === 'undefined') continue + soFar += k + ch(v[k], depth + 1) + } + } + ch(obj, 0) + return soFar +} + +function noCommas (obj, maxDepth) { + var seen = [] + var soFar = '' + function ch (v, depth) { + if (depth > maxDepth) return + if (typeof v === 'function' || typeof v === 'undefined') return + if (typeof v !== 'object' || !v) { + soFar += v + return + } + if (seen.indexOf(v) !== -1 || depth === maxDepth) return + seen.push(v) + soFar += '{' + for (var k in v) { + // pseudo-private values. skip those. + if (k.charAt(0) === '_') continue + var to = typeof v[k] + if (to === 'function' || to === 'undefined') continue + soFar += k + ':' + ch(v[k], depth + 1) + } + soFar += '}' + } + ch(obj, 0) + return soFar +} + + +function flatten (obj, maxDepth) { + var seen = [] + var soFar = '' + function ch (v, depth) { + if (depth > maxDepth) return + if (typeof v === 'function' || typeof v === 'undefined') return + if (typeof v !== 'object' || !v) { + soFar += v + return + } + if (seen.indexOf(v) !== -1 || depth === maxDepth) return + seen.push(v) + soFar += '{' + for (var k in v) { + // pseudo-private values. skip those. + if (k.charAt(0) === '_') continue + var to = typeof v[k] + if (to === 'function' || to === 'undefined') continue + soFar += k + ':' + ch(v[k], depth + 1) + soFar += ',' + } + soFar += '}' + } + ch(obj, 0) + return soFar +} + +exports.compare = +{ + // 'custom 2': function () { + // return custom(test, 2, 0) + // }, + // 'customWs 2': function () { + // return customWs(test, 2, 0) + // }, + 'JSON.stringify (guarded)': function () { + var seen = [] + return JSON.stringify(test, function (k, v) { + if (typeof v !== 'object' || !v) return v + if (seen.indexOf(v) !== -1) return undefined + seen.push(v) + return v + }) + }, + + 'flatten 10': function () { + return flatten(test, 10) + }, + + // 'flattenFE 10': function () { + // return flattenFE(test, 10) + // }, + + 'noCommas 10': function () { + return noCommas(test, 10) + }, + + 'sparse 10': function () { + return sparse(test, 10) + }, + + 'sparseFE 10': function () { + return sparseFE(test, 10) + }, + + 'sparseFE2 10': function () { + return sparseFE2(test, 10) + }, + + sigmund: function() { + return sigmund(test, 10) + }, + + + // 'util.inspect 1': function () { + // return util.inspect(test, false, 1, false) + // }, + // 'util.inspect undefined': function () { + // util.inspect(test) + // }, + // 'util.inspect 2': function () { + // util.inspect(test, false, 2, false) + // }, + // 'util.inspect 3': function () { + // util.inspect(test, false, 3, false) + // }, + // 'util.inspect 4': function () { + // util.inspect(test, false, 4, false) + // }, + // 'util.inspect Infinity': function () { + // util.inspect(test, false, Infinity, false) + // } +} + +/** results +**/ diff --git a/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/file-utils/node_modules/sigmund/package.json b/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/file-utils/node_modules/sigmund/package.json new file mode 100644 index 0000000..fc88970 --- /dev/null +++ b/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/file-utils/node_modules/sigmund/package.json @@ -0,0 +1,58 @@ +{ + "name": "sigmund", + "version": "1.0.0", + "description": "Quick and dirty signatures for Objects.", + "main": "sigmund.js", + "directories": { + "test": "test" + }, + "dependencies": {}, + "devDependencies": { + "tap": "~0.3.0" + }, + "scripts": { + "test": "tap test/*.js", + "bench": "node bench.js" + }, + "repository": { + "type": "git", + "url": "git://github.com/isaacs/sigmund" + }, + "keywords": [ + "object", + "signature", + "key", + "data", + "psychoanalysis" + ], + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "license": "BSD", + "readme": "# sigmund\n\nQuick and dirty signatures for Objects.\n\nThis is like a much faster `deepEquals` comparison, which returns a\nstring key suitable for caches and the like.\n\n## Usage\n\n```javascript\nfunction doSomething (someObj) {\n var key = sigmund(someObj, maxDepth) // max depth defaults to 10\n var cached = cache.get(key)\n if (cached) return cached)\n\n var result = expensiveCalculation(someObj)\n cache.set(key, result)\n return result\n}\n```\n\nThe resulting key will be as unique and reproducible as calling\n`JSON.stringify` or `util.inspect` on the object, but is much faster.\nIn order to achieve this speed, some differences are glossed over.\nFor example, the object `{0:'foo'}` will be treated identically to the\narray `['foo']`.\n\nAlso, just as there is no way to summon the soul from the scribblings\nof a cocain-addled psychoanalyst, there is no way to revive the object\nfrom the signature string that sigmund gives you. In fact, it's\nbarely even readable.\n\nAs with `sys.inspect` and `JSON.stringify`, larger objects will\nproduce larger signature strings.\n\nBecause sigmund is a bit less strict than the more thorough\nalternatives, the strings will be shorter, and also there is a\nslightly higher chance for collisions. For example, these objects\nhave the same signature:\n\n var obj1 = {a:'b',c:/def/,g:['h','i',{j:'',k:'l'}]}\n var obj2 = {a:'b',c:'/def/',g:['h','i','{jkl']}\n\nLike a good Freudian, sigmund is most effective when you already have\nsome understanding of what you're looking for. It can help you help\nyourself, but you must be willing to do some work as well.\n\nCycles are handled, and cyclical objects are silently omitted (though\nthe key is included in the signature output.)\n\nThe second argument is the maximum depth, which defaults to 10,\nbecause that is the maximum object traversal depth covered by most\ninsurance carriers.\n", + "_id": "sigmund@1.0.0", + "dist": { + "shasum": "66a2b3a749ae8b5fb89efd4fcc01dc94fbe02296", + "tarball": "http://registry.npmjs.org/sigmund/-/sigmund-1.0.0.tgz" + }, + "_npmVersion": "1.1.48", + "_npmUser": { + "name": "isaacs", + "email": "i@izs.me" + }, + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + } + ], + "_shasum": "66a2b3a749ae8b5fb89efd4fcc01dc94fbe02296", + "_from": "sigmund@1.0.0", + "_resolved": "https://registry.npmjs.org/sigmund/-/sigmund-1.0.0.tgz", + "bugs": { + "url": "https://github.com/isaacs/sigmund/issues" + }, + "homepage": "https://github.com/isaacs/sigmund" +} diff --git a/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/file-utils/node_modules/sigmund/sigmund.js b/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/file-utils/node_modules/sigmund/sigmund.js new file mode 100644 index 0000000..82c7ab8 --- /dev/null +++ b/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/file-utils/node_modules/sigmund/sigmund.js @@ -0,0 +1,39 @@ +module.exports = sigmund +function sigmund (subject, maxSessions) { + maxSessions = maxSessions || 10; + var notes = []; + var analysis = ''; + var RE = RegExp; + + function psychoAnalyze (subject, session) { + if (session > maxSessions) return; + + if (typeof subject === 'function' || + typeof subject === 'undefined') { + return; + } + + if (typeof subject !== 'object' || !subject || + (subject instanceof RE)) { + analysis += subject; + return; + } + + if (notes.indexOf(subject) !== -1 || session === maxSessions) return; + + notes.push(subject); + analysis += '{'; + Object.keys(subject).forEach(function (issue, _, __) { + // pseudo-private values. skip those. + if (issue.charAt(0) === '_') return; + var to = typeof subject[issue]; + if (to === 'function' || to === 'undefined') return; + analysis += issue; + psychoAnalyze(subject[issue], session + 1); + }); + } + psychoAnalyze(subject, 0); + return analysis; +} + +// vim: set softtabstop=4 shiftwidth=4: diff --git a/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/file-utils/package.json b/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/file-utils/package.json new file mode 100644 index 0000000..97d3af8 --- /dev/null +++ b/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/file-utils/package.json @@ -0,0 +1,68 @@ +{ + "name": "file-utils", + "version": "0.2.0", + "description": "Sync file utility for Node.js command line tools", + "main": "index.js", + "directories": { + "test": "tests" + }, + "scripts": { + "test": "grunt test" + }, + "license": "MIT", + "dependencies": { + "lodash": "~2.4.1", + "iconv-lite": "~0.2.11", + "rimraf": "~2.2.2", + "glob": "~3.2.6", + "minimatch": "~0.2.12", + "findup-sync": "~0.1.2", + "isbinaryfile": "~2.0.0" + }, + "devDependencies": { + "temporary": "~0.0.4", + "grunt-contrib-jshint": "~0.8.0", + "grunt-contrib-nodeunit": "~0.2.0", + "grunt-contrib-watch": "~0.5.3", + "grunt-release": "~0.6.0" + }, + "repository": { + "type": "git", + "url": "git://github.com/SBoudrias/file-utils.git" + }, + "keywords": [ + "file", + "utils", + "scaffold", + "tool", + "cli" + ], + "author": { + "name": "Simon Boudrias" + }, + "bugs": { + "url": "https://github.com/SBoudrias/file-utils/issues" + }, + "engines": { + "node": ">=0.10.0" + }, + "_id": "file-utils@0.2.0", + "dist": { + "shasum": "0372c89b19bd96fc9a02a180c91fad29e4dbacaa", + "tarball": "http://registry.npmjs.org/file-utils/-/file-utils-0.2.0.tgz" + }, + "_from": "file-utils@~0.2.0", + "_npmVersion": "1.3.5", + "_npmUser": { + "name": "sboudrias", + "email": "admin@simonboudrias.com" + }, + "maintainers": [ + { + "name": "sboudrias", + "email": "admin@simonboudrias.com" + } + ], + "_shasum": "0372c89b19bd96fc9a02a180c91fad29e4dbacaa", + "_resolved": "https://registry.npmjs.org/file-utils/-/file-utils-0.2.0.tgz" +} diff --git a/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/inherits/inherits.js b/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/inherits/inherits.js new file mode 100644 index 0000000..29f5e24 --- /dev/null +++ b/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/inherits/inherits.js @@ -0,0 +1 @@ +module.exports = require('util').inherits diff --git a/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/inherits/inherits_browser.js b/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/inherits/inherits_browser.js new file mode 100644 index 0000000..c1e78a7 --- /dev/null +++ b/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/inherits/inherits_browser.js @@ -0,0 +1,23 @@ +if (typeof Object.create === 'function') { + // implementation from standard node.js 'util' module + module.exports = function inherits(ctor, superCtor) { + ctor.super_ = superCtor + ctor.prototype = Object.create(superCtor.prototype, { + constructor: { + value: ctor, + enumerable: false, + writable: true, + configurable: true + } + }); + }; +} else { + // old school shim for old browsers + module.exports = function inherits(ctor, superCtor) { + ctor.super_ = superCtor + var TempCtor = function () {} + TempCtor.prototype = superCtor.prototype + ctor.prototype = new TempCtor() + ctor.prototype.constructor = ctor + } +} diff --git a/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/inherits/package.json b/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/inherits/package.json new file mode 100644 index 0000000..c701ed6 --- /dev/null +++ b/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/inherits/package.json @@ -0,0 +1,51 @@ +{ + "name": "inherits", + "description": "Browser-friendly inheritance fully compatible with standard node.js inherits()", + "version": "2.0.1", + "keywords": [ + "inheritance", + "class", + "klass", + "oop", + "object-oriented", + "inherits", + "browser", + "browserify" + ], + "main": "./inherits.js", + "browser": "./inherits_browser.js", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/inherits" + }, + "license": "ISC", + "scripts": { + "test": "node test" + }, + "readme": "Browser-friendly inheritance fully compatible with standard node.js\n[inherits](http://nodejs.org/api/util.html#util_util_inherits_constructor_superconstructor).\n\nThis package exports standard `inherits` from node.js `util` module in\nnode environment, but also provides alternative browser-friendly\nimplementation through [browser\nfield](https://gist.github.com/shtylman/4339901). Alternative\nimplementation is a literal copy of standard one located in standalone\nmodule to avoid requiring of `util`. It also has a shim for old\nbrowsers with no `Object.create` support.\n\nWhile keeping you sure you are using standard `inherits`\nimplementation in node.js environment, it allows bundlers such as\n[browserify](https://github.com/substack/node-browserify) to not\ninclude full `util` package to your client code if all you need is\njust `inherits` function. It worth, because browser shim for `util`\npackage is large and `inherits` is often the single function you need\nfrom it.\n\nIt's recommended to use this package instead of\n`require('util').inherits` for any code that has chances to be used\nnot only in node.js but in browser too.\n\n## usage\n\n```js\nvar inherits = require('inherits');\n// then use exactly as the standard one\n```\n\n## note on version ~1.0\n\nVersion ~1.0 had completely different motivation and is not compatible\nneither with 2.0 nor with standard node.js `inherits`.\n\nIf you are using version ~1.0 and planning to switch to ~2.0, be\ncareful:\n\n* new version uses `super_` instead of `super` for referencing\n superclass\n* new version overwrites current prototype while old one preserves any\n existing fields on it\n", + "readmeFilename": "README.md", + "bugs": { + "url": "https://github.com/isaacs/inherits/issues" + }, + "_id": "inherits@2.0.1", + "dist": { + "shasum": "b17d08d326b4423e568eff719f91b0b1cbdf69f1", + "tarball": "http://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz" + }, + "_from": "inherits@2.0.1", + "_npmVersion": "1.3.8", + "_npmUser": { + "name": "isaacs", + "email": "i@izs.me" + }, + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + } + ], + "directories": {}, + "_shasum": "b17d08d326b4423e568eff719f91b0b1cbdf69f1", + "_resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz", + "homepage": "https://github.com/isaacs/inherits" +} diff --git a/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/lazystream/lib/lazystream.js b/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/lazystream/lib/lazystream.js new file mode 100644 index 0000000..c6fbb39 --- /dev/null +++ b/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/lazystream/lib/lazystream.js @@ -0,0 +1,52 @@ + +var util = require('util'); +var PassThrough = require('stream').PassThrough || require('readable-stream/passthrough'); + +module.exports = { + Readable: Readable, + Writable: Writable +}; + +util.inherits(Readable, PassThrough); +util.inherits(Writable, PassThrough); + +// Patch the given method of instance so that the callback +// is executed once, before the actual method is called the +// first time. +function beforeFirstCall(instance, method, callback) { + instance[method] = function() { + delete instance[method]; + callback.apply(this, arguments); + return this[method].apply(this, arguments); + }; +} + +function Readable(fn, options) { + if (!(this instanceof Readable)) + return new Readable(fn, options); + + PassThrough.call(this, options); + + beforeFirstCall(this, '_read', function() { + var source = fn.call(this, options); + var that = this; + source.pipe(this); + }); + + this.emit('readable'); +} + +function Writable(fn, options) { + if (!(this instanceof Writable)) + return new Writable(fn, options); + + PassThrough.call(this, options); + + beforeFirstCall(this, '_write', function() { + var destination = fn.call(this, options); + this.pipe(destination); + }); + + this.emit('writable'); +} + diff --git a/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/lazystream/package.json b/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/lazystream/package.json new file mode 100644 index 0000000..fb506c5 --- /dev/null +++ b/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/lazystream/package.json @@ -0,0 +1,61 @@ +{ + "name": "lazystream", + "version": "0.1.0", + "description": "Open Node Streams on demand.", + "homepage": "https://github.com/jpommerening/node-lazystream", + "author": { + "name": "J. Pommerening" + }, + "repository": { + "type": "git", + "url": "https://github.com/jpommerening/node-lazystream.git" + }, + "bugs": { + "url": "https://github.com/jpommerening/node-lazystream/issues" + }, + "licenses": [ + { + "type": "MIT", + "url": "https://github.com/jpommerening/node-lazystream/blob/master/LICENSE-MIT" + } + ], + "main": "lib/lazystream.js", + "engines": { + "node": ">= 0.6.3" + }, + "scripts": { + "test": "nodeunit test/readable_test.js test/writable_test.js test/pipe_test.js test/fs_test.js" + }, + "dependencies": { + "readable-stream": "~1.0.2" + }, + "devDependencies": { + "nodeunit": "~0.7.4" + }, + "keywords": [ + "streams", + "stream" + ], + "readme": "# Lazy Streams\n\n> *Create streams lazily when they are read from or written to.* \n> `lazystream: 0.0.2` [![Build Status](https://travis-ci.org/jpommerening/node-lazystream.png?branch=master)](https://travis-ci.org/jpommerening/node-lazystream) \n\n## Why?\n\nSometimes you feel the itch to open *all the files* at once. You want to pass a bunch of streams around, so the consumer does not need to worry where the data comes from.\nFrom a software design point-of-view this sounds entirely reasonable. Then there is that neat little function `fs.createReadStream()` that opens a file and gives you a nice `fs.ReadStream` to pass around, so you use what the mighty creator deities of node bestowed upon you.\n\n> `Error: EMFILE, too many open files` \n> ─ *node*\n\nThis package provides two classes based on the node's new streams API (or `readable-stream` if you are using node a node version earlier than 0.10):\n\n## Class: lazystream.Readable\n\nA wrapper for readable streams. Extends [`stream.PassThrough`](http://nodejs.org/api/stream.html#stream_class_stream_passthrough).\n\n### new lazystream.Readable(fn [, options])\n\n* `fn` *{Function}* \n The function that the lazy stream will call to obtain the stream to actually read from.\n* `options` *{Object}* \n Options for the underlying `PassThrough` stream, accessible by `fn`.\n\nCreates a new readable stream. Once the stream is accessed (for example when you call its `read()` method, or attach a `data`-event listener) the `fn` function is called with the outer `lazystream.Readable` instance bound to `this`.\n\nIf you pass an `options` object to the constuctor, you can access it in your `fn` function.\n\n```javascript\nnew lazystream.Readable(function (options) {\n return fs.createReadStream('/dev/urandom');\n});\n```\n\n## Class: lazystream.Writable\n\nA wrapper for writable streams. Extends [`stream.PassThrough`](http://nodejs.org/api/stream.html#stream_class_stream_passthrough).\n\n### new lazystream.Writable(fn [, options])\n\n* `fn` *{Function}* \n The function that the lazy stream will call to obtain the stream to actually write to.\n* `options` *{Object}* \n Options for the underlying `PassThrough` stream, accessible by `fn`.\n\nCreates a new writable stream. Just like the one above but for writable streams.\n\n```javascript\nnew lazystream.Writable(function () {\n return fs.createWriteStream('/dev/null');\n});\n```\n\n## Install\n\n```console\n$ npm install lazystream --save\nnpm http GET https://registry.npmjs.org/readable-stream\nnpm http 200 https://registry.npmjs.org/readable-stream\nnpm http GET https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.2.tgz\nnpm http 200 https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.2.tgz\nlazystream@0.0.2 node_modules/lazystream\n└── readable-stream@1.0.2\n```\n\n## Contributing\n\nFork it, branch it, send me a pull request. We'll work out the rest together.\n\n## Credits\n\n[Chris Talkington](https://github.com/ctalkington) and his [node-archiver](https://github.com/ctalkington/node-archiver) for providing a use-case.\n\n## [License](LICENSE-MIT)\n\nCopyright (c) 2013 J. Pommerening, contributors.\n\nPermission is hereby granted, free of charge, to any person\nobtaining a copy of this software and associated documentation\nfiles (the \"Software\"), to deal in the Software without\nrestriction, including without limitation the rights to use,\ncopy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the\nSoftware is furnished to do so, subject to the following\nconditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\nOF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\nHOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\nWHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\nFROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\nOTHER DEALINGS IN THE SOFTWARE.\n\n", + "readmeFilename": "README.md", + "_id": "lazystream@0.1.0", + "dist": { + "shasum": "1b25d63c772a4c20f0a5ed0a9d77f484b6e16920", + "tarball": "http://registry.npmjs.org/lazystream/-/lazystream-0.1.0.tgz" + }, + "_from": "lazystream@~0.1.0", + "_npmVersion": "1.2.17", + "_npmUser": { + "name": "jpommerening", + "email": "jonas.pommerening@gmail.com" + }, + "maintainers": [ + { + "name": "jpommerening", + "email": "jonas.pommerening@gmail.com" + } + ], + "directories": {}, + "_shasum": "1b25d63c772a4c20f0a5ed0a9d77f484b6e16920", + "_resolved": "https://registry.npmjs.org/lazystream/-/lazystream-0.1.0.tgz" +} diff --git a/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/lodash/dist/lodash.js b/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/lodash/dist/lodash.js new file mode 100644 index 0000000..d653e5a --- /dev/null +++ b/packages/NoGit.0.0.8/node_modules/nogit/node_modules/archiver/node_modules/lodash/dist/lodash.js @@ -0,0 +1,6785 @@ +/** + * @license + * Lo-Dash 2.4.1 (Custom Build) + * Build: `lodash modern -o ./dist/lodash.js` + * Copyright 2012-2013 The Dojo Foundation + * Based on Underscore.js 1.5.2 + * Copyright 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ +;(function() { + + /** Used as a safe reference for `undefined` in pre ES5 environments */ + var undefined; + + /** Used to pool arrays and objects used internally */ + var arrayPool = [], + objectPool = []; + + /** Used to generate unique IDs */ + var idCounter = 0; + + /** Used to prefix keys to avoid issues with `__proto__` and properties on `Object.prototype` */ + var keyPrefix = +new Date + ''; + + /** Used as the size when optimizations are enabled for large arrays */ + var largeArraySize = 75; + + /** Used as the max size of the `arrayPool` and `objectPool` */ + var maxPoolSize = 40; + + /** Used to detect and test whitespace */ + var whitespace = ( + // whitespace + ' \t\x0B\f\xA0\ufeff' + + + // line terminators + '\n\r\u2028\u2029' + + + // unicode category "Zs" space separators + '\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000' + ); + + /** Used to match empty string literals in compiled template source */ + var reEmptyStringLeading = /\b__p \+= '';/g, + reEmptyStringMiddle = /\b(__p \+=) '' \+/g, + reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g; + + /** + * Used to match ES6 template delimiters + * http://people.mozilla.org/~jorendorff/es6-draft.html#sec-literals-string-literals + */ + var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g; + + /** Used to match regexp flags from their coerced string values */ + var reFlags = /\w*$/; + + /** Used to detected named functions */ + var reFuncName = /^\s*function[ \n\r\t]+\w/; + + /** Used to match "interpolate" template delimiters */ + var reInterpolate = /<%=([\s\S]+?)%>/g; + + /** Used to match leading whitespace and zeros to be removed */ + var reLeadingSpacesAndZeros = RegExp('^[' + whitespace + ']*0+(?=.$)'); + + /** Used to ensure capturing order of template delimiters */ + var reNoMatch = /($^)/; + + /** Used to detect functions containing a `this` reference */ + var reThis = /\bthis\b/; + + /** Used to match unescaped characters in compiled string literals */ + var reUnescapedString = /['\n\r\t\u2028\u2029\\]/g; + + /** Used to assign default `context` object properties */ + var contextProps = [ + 'Array', 'Boolean', 'Date', 'Function', 'Math', 'Number', 'Object', + 'RegExp', 'String', '_', 'attachEvent', 'clearTimeout', 'isFinite', 'isNaN', + 'parseInt', 'setTimeout' + ]; + + /** Used to make template sourceURLs easier to identify */ + var templateCounter = 0; + + /** `Object#toString` result shortcuts */ + var argsClass = '[object Arguments]', + arrayClass = '[object Array]', + boolClass = '[object Boolean]', + dateClass = '[object Date]', + funcClass = '[object Function]', + numberClass = '[object Number]', + objectClass = '[object Object]', + regexpClass = '[object RegExp]', + stringClass = '[object String]'; + + /** Used to identify object classifications that `_.clone` supports */ + var cloneableClasses = {}; + cloneableClasses[funcClass] = false; + cloneableClasses[argsClass] = cloneableClasses[arrayClass] = + cloneableClasses[boolClass] = cloneableClasses[dateClass] = + cloneableClasses[numberClass] = cloneableClasses[objectClass] = + cloneableClasses[regexpClass] = cloneableClasses[stringClass] = true; + + /** Used as an internal `_.debounce` options object */ + var debounceOptions = { + 'leading': false, + 'maxWait': 0, + 'trailing': false + }; + + /** Used as the property descriptor for `__bindData__` */ + var descriptor = { + 'configurable': false, + 'enumerable': false, + 'value': null, + 'writable': false + }; + + /** Used to determine if values are of the language type Object */ + var objectTypes = { + 'boolean': false, + 'function': true, + 'object': true, + 'number': false, + 'string': false, + 'undefined': false + }; + + /** Used to escape characters for inclusion in compiled string literals */ + var stringEscapes = { + '\\': '\\', + "'": "'", + '\n': 'n', + '\r': 'r', + '\t': 't', + '\u2028': 'u2028', + '\u2029': 'u2029' + }; + + /** Used as a reference to the global object */ + var root = (objectTypes[typeof window] && window) || this; + + /** Detect free variable `exports` */ + var freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports; + + /** Detect free variable `module` */ + var freeModule = objectTypes[typeof module] && module && !module.nodeType && module; + + /** Detect the popular CommonJS extension `module.exports` */ + var moduleExports = freeModule && freeModule.exports === freeExports && freeExports; + + /** Detect free variable `global` from Node.js or Browserified code and use it as `root` */ + var freeGlobal = objectTypes[typeof global] && global; + if (freeGlobal && (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal)) { + root = freeGlobal; + } + + /*--------------------------------------------------------------------------*/ + + /** + * The base implementation of `_.indexOf` without support for binary searches + * or `fromIndex` constraints. + * + * @private + * @param {Array} array The array to search. + * @param {*} value The value to search for. + * @param {number} [fromIndex=0] The index to search from. + * @returns {number} Returns the index of the matched value or `-1`. + */ + function baseIndexOf(array, value, fromIndex) { + var index = (fromIndex || 0) - 1, + length = array ? array.length : 0; + + while (++index < length) { + if (array[index] === value) { + return index; + } + } + return -1; + } + + /** + * An implementation of `_.contains` for cache objects that mimics the return + * signature of `_.indexOf` by returning `0` if the value is found, else `-1`. + * + * @private + * @param {Object} cache The cache object to inspect. + * @param {*} value The value to search for. + * @returns {number} Returns `0` if `value` is found, else `-1`. + */ + function cacheIndexOf(cache, value) { + var type = typeof value; + cache = cache.cache; + + if (type == 'boolean' || value == null) { + return cache[value] ? 0 : -1; + } + if (type != 'number' && type != 'string') { + type = 'object'; + } + var key = type == 'number' ? value : keyPrefix + value; + cache = (cache = cache[type]) && cache[key]; + + return type == 'object' + ? (cache && baseIndexOf(cache, value) > -1 ? 0 : -1) + : (cache ? 0 : -1); + } + + /** + * Adds a given value to the corresponding cache object. + * + * @private + * @param {*} value The value to add to the cache. + */ + function cachePush(value) { + var cache = this.cache, + type = typeof value; + + if (type == 'boolean' || value == null) { + cache[value] = true; + } else { + if (type != 'number' && type != 'string') { + type = 'object'; + } + var key = type == 'number' ? value : keyPrefix + value, + typeCache = cache[type] || (cache[type] = {}); + + if (type == 'object') { + (typeCache[key] || (typeCache[key] = [])).push(value); + } else { + typeCache[key] = true; + } + } + } + + /** + * Used by `_.max` and `_.min` as the default callback when a given + * collection is a string value. + * + * @private + * @param {string} value The character to inspect. + * @returns {number} Returns the code unit of given character. + */ + function charAtCallback(value) { + return value.charCodeAt(0); + } + + /** + * Used by `sortBy` to compare transformed `collection` elements, stable sorting + * them in ascending order. + * + * @private + * @param {Object} a The object to compare to `b`. + * @param {Object} b The object to compare to `a`. + * @returns {number} Returns the sort order indicator of `1` or `-1`. + */ + function compareAscending(a, b) { + var ac = a.criteria, + bc = b.criteria, + index = -1, + length = ac.length; + + while (++index < length) { + var value = ac[index], + other = bc[index]; + + if (value !== other) { + if (value > other || typeof value == 'undefined') { + return 1; + } + if (value < other || typeof other == 'undefined') { + return -1; + } + } + } + // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications + // that causes it, under certain circumstances, to return the same value for + // `a` and `b`. See https://github.com/jashkenas/underscore/pull/1247 + // + // This also ensures a stable sort in V8 and other engines. + // See http://code.google.com/p/v8/issues/detail?id=90 + return a.index - b.index; + } + + /** + * Creates a cache object to optimize linear searches of large arrays. + * + * @private + * @param {Array} [array=[]] The array to search. + * @returns {null|Object} Returns the cache object or `null` if caching should not be used. + */ + function createCache(array) { + var index = -1, + length = array.length, + first = array[0], + mid = array[(length / 2) | 0], + last = array[length - 1]; + + if (first && typeof first == 'object' && + mid && typeof mid == 'object' && last && typeof last == 'object') { + return false; + } + var cache = getObject(); + cache['false'] = cache['null'] = cache['true'] = cache['undefined'] = false; + + var result = getObject(); + result.array = array; + result.cache = cache; + result.push = cachePush; + + while (++index < length) { + result.push(array[index]); + } + return result; + } + + /** + * Used by `template` to escape characters for inclusion in compiled + * string literals. + * + * @private + * @param {string} match The matched character to escape. + * @returns {string} Returns the escaped character. + */ + function escapeStringChar(match) { + return '\\' + stringEscapes[match]; + } + + /** + * Gets an array from the array pool or creates a new one if the pool is empty. + * + * @private + * @returns {Array} The array from the pool. + */ + function getArray() { + return arrayPool.pop() || []; + } + + /** + * Gets an object from the object pool or creates a new one if the pool is empty. + * + * @private + * @returns {Object} The object from the pool. + */ + function getObject() { + return objectPool.pop() || { + 'array': null, + 'cache': null, + 'criteria': null, + 'false': false, + 'index': 0, + 'null': false, + 'number': null, + 'object': null, + 'push': null, + 'string': null, + 'true': false, + 'undefined': false, + 'value': null + }; + } + + /** + * Releases the given array back to the array pool. + * + * @private + * @param {Array} [array] The array to release. + */ + function releaseArray(array) { + array.length = 0; + if (arrayPool.length < maxPoolSize) { + arrayPool.push(array); + } + } + + /** + * Releases the given object back to the object pool. + * + * @private + * @param {Object} [object] The object to release. + */ + function releaseObject(object) { + var cache = object.cache; + if (cache) { + releaseObject(cache); + } + object.array = object.cache = object.criteria = object.object = object.number = object.string = object.value = null; + if (objectPool.length < maxPoolSize) { + objectPool.push(object); + } + } + + /** + * Slices the `collection` from the `start` index up to, but not including, + * the `end` index. + * + * Note: This function is used instead of `Array#slice` to support node lists + * in IE < 9 and to ensure dense arrays are returned. + * + * @private + * @param {Array|Object|string} collection The collection to slice. + * @param {number} start The start index. + * @param {number} end The end index. + * @returns {Array} Returns the new array. + */ + function slice(array, start, end) { + start || (start = 0); + if (typeof end == 'undefined') { + end = array ? array.length : 0; + } + var index = -1, + length = end - start || 0, + result = Array(length < 0 ? 0 : length); + + while (++index < length) { + result[index] = array[start + index]; + } + return result; + } + + /*--------------------------------------------------------------------------*/ + + /** + * Create a new `lodash` function using the given context object. + * + * @static + * @memberOf _ + * @category Utilities + * @param {Object} [context=root] The context object. + * @returns {Function} Returns the `lodash` function. + */ + function runInContext(context) { + // Avoid issues with some ES3 environments that attempt to use values, named + // after built-in constructors like `Object`, for the creation of literals. + // ES5 clears this up by stating that literals must use built-in constructors. + // See http://es5.github.io/#x11.1.5. + context = context ? _.defaults(root.Object(), context, _.pick(root, contextProps)) : root; + + /** Native constructor references */ + var Array = context.Array, + Boolean = context.Boolean, + Date = context.Date, + Function = context.Function, + Math = context.Math, + Number = context.Number, + Object = context.Object, + RegExp = context.RegExp, + String = context.String, + TypeError = context.TypeError; + + /** + * Used for `Array` method references. + * + * Normally `Array.prototype` would suffice, however, using an array literal + * avoids issues in Narwhal. + */ + var arrayRef = []; + + /** Used for native method references */ + var objectProto = Object.prototype; + + /** Used to restore the original `_` reference in `noConflict` */ + var oldDash = context._; + + /** Used to resolve the internal [[Class]] of values */ + var toString = objectProto.toString; + + /** Used to detect if a method is native */ + var reNative = RegExp('^' + + String(toString) + .replace(/[.*+?^${}()|[\]\\]/g, '\\$&') + .replace(/toString| for [^\]]+/g, '.*?') + '$' + ); + + /** Native method shortcuts */ + var ceil = Math.ceil, + clearTimeout = context.clearTimeout, + floor = Math.floor, + fnToString = Function.prototype.toString, + getPrototypeOf = isNative(getPrototypeOf = Object.getPrototypeOf) && getPrototypeOf, + hasOwnProperty = objectProto.hasOwnProperty, + push = arrayRef.push, + setTimeout = context.setTimeout, + splice = arrayRef.splice, + unshift = arrayRef.unshift; + + /** Used to set meta data on functions */ + var defineProperty = (function() { + // IE 8 only accepts DOM elements + try { + var o = {}, + func = isNative(func = Object.defineProperty) && func, + result = func(o, o, o) && func; + } catch(e) { } + return result; + }()); + + /* Native method shortcuts for methods with the same name as other `lodash` methods */ + var nativeCreate = isNative(nativeCreate = Object.create) && nativeCreate, + nativeIsArray = isNative(nativeIsArray = Array.isArray) && nativeIsArray, + nativeIsFinite = context.isFinite, + nativeIsNaN = context.isNaN, + nativeKeys = isNative(nativeKeys = Object.keys) && nativeKeys, + nativeMax = Math.max, + nativeMin = Math.min, + nativeParseInt = context.parseInt, + nativeRandom = Math.random; + + /** Used to lookup a built-in constructor by [[Class]] */ + var ctorByClass = {}; + ctorByClass[arrayClass] = Array; + ctorByClass[boolClass] = Boolean; + ctorByClass[dateClass] = Date; + ctorByClass[funcClass] = Function; + ctorByClass[objectClass] = Object; + ctorByClass[numberClass] = Number; + ctorByClass[regexpClass] = RegExp; + ctorByClass[stringClass] = String; + + /*--------------------------------------------------------------------------*/ + + /** + * Creates a `lodash` object which wraps the given value to enable intuitive + * method chaining. + * + * In addition to Lo-Dash methods, wrappers also have the following `Array` methods: + * `concat`, `join`, `pop`, `push`, `reverse`, `shift`, `slice`, `sort`, `splice`, + * and `unshift` + * + * Chaining is supported in custom builds as long as the `value` method is + * implicitly or explicitly included in the build. + * + * The chainable wrapper functions are: + * `after`, `assign`, `bind`, `bindAll`, `bindKey`, `chain`, `compact`, + * `compose`, `concat`, `countBy`, `create`, `createCallback`, `curry`, + * `debounce`, `defaults`, `defer`, `delay`, `difference`, `filter`, `flatten`, + * `forEach`, `forEachRight`, `forIn`, `forInRight`, `forOwn`, `forOwnRight`, + * `functions`, `groupBy`, `indexBy`, `initial`, `intersection`, `invert`, + * `invoke`, `keys`, `map`, `max`, `memoize`, `merge`, `min`, `object`, `omit`, + * `once`, `pairs`, `partial`, `partialRight`, `pick`, `pluck`, `pull`, `push`, + * `range`, `reject`, `remove`, `rest`, `reverse`, `shuffle`, `slice`, `sort`, + * `sortBy`, `splice`, `tap`, `throttle`, `times`, `toArray`, `transform`, + * `union`, `uniq`, `unshift`, `unzip`, `values`, `where`, `without`, `wrap`, + * and `zip` + * + * The non-chainable wrapper functions are: + * `clone`, `cloneDeep`, `contains`, `escape`, `every`, `find`, `findIndex`, + * `findKey`, `findLast`, `findLastIndex`, `findLastKey`, `has`, `identity`, + * `indexOf`, `isArguments`, `isArray`, `isBoolean`, `isDate`, `isElement`, + * `isEmpty`, `isEqual`, `isFinite`, `isFunction`, `isNaN`, `isNull`, `isNumber`, + * `isObject`, `isPlainObject`, `isRegExp`, `isString`, `isUndefined`, `join`, + * `lastIndexOf`, `mixin`, `noConflict`, `parseInt`, `pop`, `random`, `reduce`, + * `reduceRight`, `result`, `shift`, `size`, `some`, `sortedIndex`, `runInContext`, + * `template`, `unescape`, `uniqueId`, and `value` + * + * The wrapper functions `first` and `last` return wrapped values when `n` is + * provided, otherwise they return unwrapped values. + * + * Explicit chaining can be enabled by using the `_.chain` method. + * + * @name _ + * @constructor + * @category Chaining + * @param {*} value The value to wrap in a `lodash` instance. + * @returns {Object} Returns a `lodash` instance. + * @example + * + * var wrapped = _([1, 2, 3]); + * + * // returns an unwrapped value + * wrapped.reduce(function(sum, num) { + * return sum + num; + * }); + * // => 6 + * + * // returns a wrapped value + * var squares = wrapped.map(function(num) { + * return num * num; + * }); + * + * _.isArray(squares); + * // => false + * + * _.isArray(squares.value()); + * // => true + */ + function lodash(value) { + // don't wrap if already wrapped, even if wrapped by a different `lodash` constructor + return (value && typeof value == 'object' && !isArray(value) && hasOwnProperty.call(value, '__wrapped__')) + ? value + : new lodashWrapper(value); + } + + /** + * A fast path for creating `lodash` wrapper objects. + * + * @private + * @param {*} value The value to wrap in a `lodash` instance. + * @param {boolean} chainAll A flag to enable chaining for all methods + * @returns {Object} Returns a `lodash` instance. + */ + function lodashWrapper(value, chainAll) { + this.__chain__ = !!chainAll; + this.__wrapped__ = value; + } + // ensure `new lodashWrapper` is an instance of `lodash` + lodashWrapper.prototype = lodash.prototype; + + /** + * An object used to flag environments features. + * + * @static + * @memberOf _ + * @type Object + */ + var support = lodash.support = {}; + + /** + * Detect if functions can be decompiled by `Function#toString` + * (all but PS3 and older Opera mobile browsers & avoided in Windows 8 apps). + * + * @memberOf _.support + * @type boolean + */ + support.funcDecomp = !isNative(context.WinRTError) && reThis.test(runInContext); + + /** + * Detect if `Function#name` is supported (all but IE). + * + * @memberOf _.support + * @type boolean + */ + support.funcNames = typeof Function.name == 'string'; + + /** + * By default, the template delimiters used by Lo-Dash are similar to those in + * embedded Ruby (ERB). Change the following template settings to use alternative + * delimiters. + * + * @static + * @memberOf _ + * @type Object + */ + lodash.templateSettings = { + + /** + * Used to detect `data` property values to be HTML-escaped. + * + * @memberOf _.templateSettings + * @type RegExp + */ + 'escape': /<%-([\s\S]+?)%>/g, + + /** + * Used to detect code to be evaluated. + * + * @memberOf _.templateSettings + * @type RegExp + */ + 'evaluate': /<%([\s\S]+?)%>/g, + + /** + * Used to detect `data` property values to inject. + * + * @memberOf _.templateSettings + * @type RegExp + */ + 'interpolate': reInterpolate, + + /** + * Used to reference the data object in the template text. + * + * @memberOf _.templateSettings + * @type string + */ + 'variable': '', + + /** + * Used to import variables into the compiled template. + * + * @memberOf _.templateSettings + * @type Object + */ + 'imports': { + + /** + * A reference to the `lodash` function. + * + * @memberOf _.templateSettings.imports + * @type Function + */ + '_': lodash + } + }; + + /*--------------------------------------------------------------------------*/ + + /** + * The base implementation of `_.bind` that creates the bound function and + * sets its meta data. + * + * @private + * @param {Array} bindData The bind data array. + * @returns {Function} Returns the new bound function. + */ + function baseBind(bindData) { + var func = bindData[0], + partialArgs = bindData[2], + thisArg = bindData[4]; + + function bound() { + // `Function#bind` spec + // http://es5.github.io/#x15.3.4.5 + if (partialArgs) { + // avoid `arguments` object deoptimizations by using `slice` instead + // of `Array.prototype.slice.call` and not assigning `arguments` to a + // variable as a ternary expression + var args = slice(partialArgs); + push.apply(args, arguments); + } + // mimic the constructor's `return` behavior + // http://es5.github.io/#x13.2.2 + if (this instanceof bound) { + // ensure `new bound` is an instance of `func` + var thisBinding = baseCreate(func.prototype), + result = func.apply(thisBinding, args || arguments); + return isObject(result) ? result : thisBinding; + } + return func.apply(thisArg, args || arguments); + } + setBindData(bound, bindData); + return bound; + } + + /** + * The base implementation of `_.clone` without argument juggling or support + * for `thisArg` binding. + * + * @private + * @param {*} value The value to clone. + * @param {boolean} [isDeep=false] Specify a deep clone. + * @param {Function} [callback] The function to customize cloning values. + * @param {Array} [stackA=[]] Tracks traversed source objects. + * @param {Array} [stackB=[]] Associates clones with source counterparts. + * @returns {*} Returns the cloned value. + */ + function baseClone(value, isDeep, callback, stackA, stackB) { + if (callback) { + var result = callback(value); + if (typeof result != 'undefined') { + return result; + } + } + // inspect [[Class]] + var isObj = isObject(value); + if (isObj) { + var className = toString.call(value); + if (!cloneableClasses[className]) { + return value; + } + var ctor = ctorByClass[className]; + switch (className) { + case boolClass: + case dateClass: + return new ctor(+value); + + case numberClass: + case stringClass: + return new ctor(value); + + case regexpClass: + result = ctor(value.source, reFlags.exec(value)); + result.lastIndex = value.lastIndex; + return result; + } + } else { + return value; + } + var isArr = isArray(value); + if (isDeep) { + // check for circular references and return corresponding clone + var initedStack = !stackA; + stackA || (stackA = getArray()); + stackB || (stackB = getArray()); + + var length = stackA.length; + while (length--) { + if (stackA[length] == value) { + return stackB[length]; + } + } + result = isArr ? ctor(value.length) : {}; + } + else { + result = isArr ? slice(value) : assign({}, value); + } + // add array properties assigned by `RegExp#exec` + if (isArr) { + if (hasOwnProperty.call(value, 'index')) { + result.index = value.index; + } + if (hasOwnProperty.call(value, 'input')) { + result.input = value.input; + } + } + // exit for shallow clone + if (!isDeep) { + return result; + } + // add the source value to the stack of traversed objects + // and associate it with its clone + stackA.push(value); + stackB.push(result); + + // recursively populate clone (susceptible to call stack limits) + (isArr ? forEach : forOwn)(value, function(objValue, key) { + result[key] = baseClone(objValue, isDeep, callback, stackA, stackB); + }); + + if (initedStack) { + releaseArray(stackA); + releaseArray(stackB); + } + return result; + } + + /** + * The base implementation of `_.create` without support for assigning + * properties to the created object. + * + * @private + * @param {Object} prototype The object to inherit from. + * @returns {Object} Returns the new object. + */ + function baseCreate(prototype, properties) { + return isObject(prototype) ? nativeCreate(prototype) : {}; + } + // fallback for browsers without `Object.create` + if (!nativeCreate) { + baseCreate = (function() { + function Object() {} + return function(prototype) { + if (isObject(prototype)) { + Object.prototype = prototype; + var result = new Object; + Object.prototype = null; + } + return result || context.Object(); + }; + }()); + } + + /** + * The base implementation of `_.createCallback` without support for creating + * "_.pluck" or "_.where" style callbacks. + * + * @private + * @param {*} [func=identity] The value to convert to a callback. + * @param {*} [thisArg] The `this` binding of the created callback. + * @param {number} [argCount] The number of arguments the callback accepts. + * @returns {Function} Returns a callback function. + */ + function baseCreateCallback(func, thisArg, argCount) { + if (typeof func != 'function') { + return identity; + } + // exit early for no `thisArg` or already bound by `Function#bind` + if (typeof thisArg == 'undefined' || !('prototype' in func)) { + return func; + } + var bindData = func.__bindData__; + if (typeof bindData == 'undefined') { + if (support.funcNames) { + bindData = !func.name; + } + bindData = bindData || !support.funcDecomp; + if (!bindData) { + var source = fnToString.call(func); + if (!support.funcNames) { + bindData = !reFuncName.test(source); + } + if (!bindData) { + // checks if `func` references the `this` keyword and stores the result + bindData = reThis.test(source); + setBindData(func, bindData); + } + } + } + // exit early if there are no `this` references or `func` is bound + if (bindData === false || (bindData !== true && bindData[1] & 1)) { + return func; + } + switch (argCount) { + case 1: return function(value) { + return func.call(thisArg, value); + }; + case 2: return function(a, b) { + return func.call(thisArg, a, b); + }; + case 3: return function(value, index, collection) { + return func.call(thisArg, value, index, collection); + }; + case 4: return function(accumulator, value, index, collection) { + return func.call(thisArg, accumulator, value, index, collection); + }; + } + return bind(func, thisArg); + } + + /** + * The base implementation of `createWrapper` that creates the wrapper and + * sets its meta data. + * + * @private + * @param {Array} bindData The bind data array. + * @returns {Function} Returns the new function. + */ + function baseCreateWrapper(bindData) { + var func = bindData[0], + bitmask = bindData[1], + partialArgs = bindData[2], + partialRightArgs = bindData[3], + thisArg = bindData[4], + arity = bindData[5]; + + var isBind = bitmask & 1, + isBindKey = bitmask & 2, + isCurry = bitmask & 4, + isCurryBound = bitmask & 8, + key = func; + + function bound() { + var thisBinding = isBind ? thisArg : this; + if (partialArgs) { + var args = slice(partialArgs); + push.apply(args, arguments); + } + if (partialRightArgs || isCurry) { + args || (args = slice(arguments)); + if (partialRightArgs) { + push.apply(args, partialRightArgs); + } + if (isCurry && args.length < arity) { + bitmask |= 16 & ~32; + return baseCreateWrapper([func, (isCurryBound ? bitmask : bitmask & ~3), args, null, thisArg, arity]); + } + } + args || (args = arguments); + if (isBindKey) { + func = thisBinding[key]; + } + if (this instanceof bound) { + thisBinding = baseCreate(func.prototype); + var result = func.apply(thisBinding, args); + return isObject(result) ? result : thisBinding; + } + return func.apply(thisBinding, args); + } + setBindData(bound, bindData); + return bound; + } + + /** + * The base implementation of `_.difference` that accepts a single array + * of values to exclude. + * + * @private + * @param {Array} array The array to process. + * @param {Array} [values] The array of values to exclude. + * @returns {Array} Returns a new array of filtered values. + */ + function baseDifference(array, values) { + var index = -1, + indexOf = getIndexOf(), + length = array ? array.length : 0, + isLarge = length >= largeArraySize && indexOf === baseIndexOf, + result = []; + + if (isLarge) { + var cache = createCache(values); + if (cache) { + indexOf = cacheIndexOf; + values = cache; + } else { + isLarge = false; + } + } + while (++index < length) { + var value = array[index]; + if (indexOf(values, value) < 0) { + result.push(value); + } + } + if (isLarge) { + releaseObject(values); + } + return result; + } + + /** + * The base implementation of `_.flatten` without support for callback + * shorthands or `thisArg` binding. + * + * @private + * @param {Array} array The array to flatten. + * @param {boolean} [isShallow=false] A flag to restrict flattening to a single level. + * @param {boolean} [isStrict=false] A flag to restrict flattening to arrays and `arguments` objects. + * @param {number} [fromIndex=0] The index to start from. + * @returns {Array} Returns a new flattened array. + */ + function baseFlatten(array, isShallow, isStrict, fromIndex) { + var index = (fromIndex || 0) - 1, + length = array ? array.length : 0, + result = []; + + while (++index < length) { + var value = array[index]; + + if (value && typeof value == 'object' && typeof value.length == 'number' + && (isArray(value) || isArguments(value))) { + // recursively flatten arrays (susceptible to call stack limits) + if (!isShallow) { + value = baseFlatten(value, isShallow, isStrict); + } + var valIndex = -1, + valLength = value.length, + resIndex = result.length; + + result.length += valLength; + while (++valIndex < valLength) { + result[resIndex++] = value[valIndex]; + } + } else if (!isStrict) { + result.push(value); + } + } + return result; + } + + /** + * The base implementation of `_.isEqual`, without support for `thisArg` binding, + * that allows partial "_.where" style comparisons. + * + * @private + * @param {*} a The value to compare. + * @param {*} b The other value to compare. + * @param {Function} [callback] The function to customize comparing values. + * @param {Function} [isWhere=false] A flag to indicate performing partial comparisons. + * @param {Array} [stackA=[]] Tracks traversed `a` objects. + * @param {Array} [stackB=[]] Tracks traversed `b` objects. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + */ + function baseIsEqual(a, b, callback, isWhere, stackA, stackB) { + // used to indicate that when comparing objects, `a` has at least the properties of `b` + if (callback) { + var result = callback(a, b); + if (typeof result != 'undefined') { + return !!result; + } + } + // exit early for identical values + if (a === b) { + // treat `+0` vs. `-0` as not equal + return a !== 0 || (1 / a == 1 / b); + } + var type = typeof a, + otherType = typeof b; + + // exit early for unlike primitive values + if (a === a && + !(a && objectTypes[type]) && + !(b && objectTypes[otherType])) { + return false; + } + // exit early for `null` and `undefined` avoiding ES3's Function#call behavior + // http://es5.github.io/#x15.3.4.4 + if (a == null || b == null) { + return a === b; + } + // compare [[Class]] names + var className = toString.call(a), + otherClass = toString.call(b); + + if (className == argsClass) { + className = objectClass; + } + if (otherClass == argsClass) { + otherClass = objectClass; + } + if (className != otherClass) { + return false; + } + switch (className) { + case boolClass: + case dateClass: + // coerce dates and booleans to numbers, dates to milliseconds and booleans + // to `1` or `0` treating invalid dates coerced to `NaN` as not equal + return +a == +b; + + case numberClass: + // treat `NaN` vs. `NaN` as equal + return (a != +a) + ? b != +b + // but treat `+0` vs. `-0` as not equal + : (a == 0 ? (1 / a == 1 / b) : a == +b); + + case regexpClass: + case stringClass: + // coerce regexes to strings (http://es5.github.io/#x15.10.6.4) + // treat string primitives and their corresponding object instances as equal + return a == String(b); + } + var isArr = className == arrayClass; + if (!isArr) { + // unwrap any `lodash` wrapped values + var aWrapped = hasOwnProperty.call(a, '__wrapped__'), + bWrapped = hasOwnProperty.call(b, '__wrapped__'); + + if (aWrapped || bWrapped) { + return baseIsEqual(aWrapped ? a.__wrapped__ : a, bWrapped ? b.__wrapped__ : b, callback, isWhere, stackA, stackB); + } + // exit for functions and DOM nodes + if (className != objectClass) { + return false; + } + // in older versions of Opera, `arguments` objects have `Array` constructors + var ctorA = a.constructor, + ctorB = b.constructor; + + // non `Object` object instances with different constructors are not equal + if (ctorA != ctorB && + !(isFunction(ctorA) && ctorA instanceof ctorA && isFunction(ctorB) && ctorB instanceof ctorB) && + ('constructor' in a && 'constructor' in b) + ) { + return false; + } + } + // assume cyclic structures are equal + // the algorithm for detecting cyclic structures is adapted from ES 5.1 + // section 15.12.3, abstract operation `JO` (http://es5.github.io/#x15.12.3) + var initedStack = !stackA; + stackA || (stackA = getArray()); + stackB || (stackB = getArray()); + + var length = stackA.length; + while (length--) { + if (stackA[length] == a) { + return stackB[length] == b; + } + } + var size = 0; + result = true; + + // add `a` and `b` to the stack of traversed objects + stackA.push(a); + stackB.push(b); + + // recursively compare objects and arrays (susceptible to call stack limits) + if (isArr) { + // compare lengths to determine if a deep comparison is necessary + length = a.length; + size = b.length; + result = size == length; + + if (result || isWhere) { + // deep compare the contents, ignoring non-numeric properties + while (size--) { + var index = length, + value = b[size]; + + if (isWhere) { + while (index--) { + if ((result = baseIsEqual(a[index], value, callback, isWhere, stackA, stackB))) { + break; + } + } + } else if (!(result = baseIsEqual(a[size], value, callback, isWhere, stackA, stackB))) { + break; + } + } + } + } + else { + // deep compare objects using `forIn`, instead of `forOwn`, to avoid `Object.keys` + // which, in this case, is more costly + forIn(b, function(value, key, b) { + if (hasOwnProperty.call(b, key)) { + // count the number of properties. + size++; + // deep compare each property value. + return (result = hasOwnProperty.call(a, key) && baseIsEqual(a[key], value, callback, isWhere, stackA, stackB)); + } + }); + + if (result && !isWhere) { + // ensure both objects have the same number of properties + forIn(a, function(value, key, a) { + if (hasOwnProperty.call(a, key)) { + // `size` will be `-1` if `a` has more properties than `b` + return (result = --size > -1); + } + }); + } + } + stackA.pop(); + stackB.pop(); + + if (initedStack) { + releaseArray(stackA); + releaseArray(stackB); + } + return result; + } + + /** + * The base implementation of `_.merge` without argument juggling or support + * for `thisArg` binding. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @param {Function} [callback] The function to customize merging properties. + * @param {Array} [stackA=[]] Tracks traversed source objects. + * @param {Array} [stackB=[]] Associates values with source counterparts. + */ + function baseMerge(object, source, callback, stackA, stackB) { + (isArray(source) ? forEach : forOwn)(source, function(source, key) { + var found, + isArr, + result = source, + value = object[key]; + + if (source && ((isArr = isArray(source)) || isPlainObject(source))) { + // avoid merging previously merged cyclic sources + var stackLength = stackA.length; + while (stackLength--) { + if ((found = stackA[stackLength] == source)) { + value = stackB[stackLength]; + break; + } + } + if (!found) { + var isShallow; + if (callback) { + result = callback(value, source); + if ((isShallow = typeof result != 'undefined')) { + value = result; + } + } + if (!isShallow) { + value = isArr + ? (isArray(value) ? value : []) + : (isPlainObject(value) ? value : {}); + } + // add `source` and associated `value` to the stack of traversed objects + stackA.push(source); + stackB.push(value); + + // recursively merge objects and arrays (susceptible to call stack limits) + if (!isShallow) { + baseMerge(value, source, callback, stackA, stackB); + } + } + } + else { + if (callback) { + result = callback(value, source); + if (typeof result == 'undefined') { + result = source; + } + } + if (typeof result != 'undefined') { + value = result; + } + } + object[key] = value; + }); + } + + /** + * The base implementation of `_.random` without argument juggling or support + * for returning floating-point numbers. + * + * @private + * @param {number} min The minimum possible value. + * @param {number} max The maximum possible value. + * @returns {number} Returns a random number. + */ + function baseRandom(min, max) { + return min + floor(nativeRandom() * (max - min + 1)); + } + + /** + * The base implementation of `_.uniq` without support for callback shorthands + * or `thisArg` binding. + * + * @private + * @param {Array} array The array to process. + * @param {boolean} [isSorted=false] A flag to indicate that `array` is sorted. + * @param {Function} [callback] The function called per iteration. + * @returns {Array} Returns a duplicate-value-free array. + */ + function baseUniq(array, isSorted, callback) { + var index = -1, + indexOf = getIndexOf(), + length = array ? array.length : 0, + result = []; + + var isLarge = !isSorted && length >= largeArraySize && indexOf === baseIndexOf, + seen = (callback || isLarge) ? getArray() : result; + + if (isLarge) { + var cache = createCache(seen); + indexOf = cacheIndexOf; + seen = cache; + } + while (++index < length) { + var value = array[index], + computed = callback ? callback(value, index, array) : value; + + if (isSorted + ? !index || seen[seen.length - 1] !== computed + : indexOf(seen, computed) < 0 + ) { + if (callback || isLarge) { + seen.push(computed); + } + result.push(value); + } + } + if (isLarge) { + releaseArray(seen.array); + releaseObject(seen); + } else if (callback) { + releaseArray(seen); + } + return result; + } + + /** + * Creates a function that aggregates a collection, creating an object composed + * of keys generated from the results of running each element of the collection + * through a callback. The given `setter` function sets the keys and values + * of the composed object. + * + * @private + * @param {Function} setter The setter function. + * @returns {Function} Returns the new aggregator function. + */ + function createAggregator(setter) { + return function(collection, callback, thisArg) { + var result = {}; + callback = lodash.createCallback(callback, thisArg, 3); + + var index = -1, + length = collection ? collection.length : 0; + + if (typeof length == 'number') { + while (++index < length) { + var value = collection[index]; + setter(result, value, callback(value, index, collection), collection); + } + } else { + forOwn(collection, function(value, key, collection) { + setter(result, value, callback(value, key, collection), collection); + }); + } + return result; + }; + } + + /** + * Creates a function that, when called, either curries or invokes `func` + * with an optional `this` binding and partially applied arguments. + * + * @private + * @param {Function|string} func The function or method name to reference. + * @param {number} bitmask The bitmask of method flags to compose. + * The bitmask may be composed of the following flags: + * 1 - `_.bind` + * 2 - `_.bindKey` + * 4 - `_.curry` + * 8 - `_.curry` (bound) + * 16 - `_.partial` + * 32 - `_.partialRight` + * @param {Array} [partialArgs] An array of arguments to prepend to those + * provided to the new function. + * @param {Array} [partialRightArgs] An array of arguments to append to those + * provided to the new function. + * @param {*} [thisArg] The `this` binding of `func`. + * @param {number} [arity] The arity of `func`. + * @returns {Function} Returns the new function. + */ + function createWrapper(func, bitmask, partialArgs, partialRightArgs, thisArg, arity) { + var isBind = bitmask & 1, + isBindKey = bitmask & 2, + isCurry = bitmask & 4, + isCurryBound = bitmask & 8, + isPartial = bitmask & 16, + isPartialRight = bitmask & 32; + + if (!isBindKey && !isFunction(func)) { + throw new TypeError; + } + if (isPartial && !partialArgs.length) { + bitmask &= ~16; + isPartial = partialArgs = false; + } + if (isPartialRight && !partialRightArgs.length) { + bitmask &= ~32; + isPartialRight = partialRightArgs = false; + } + var bindData = func && func.__bindData__; + if (bindData && bindData !== true) { + // clone `bindData` + bindData = slice(bindData); + if (bindData[2]) { + bindData[2] = slice(bindData[2]); + } + if (bindData[3]) { + bindData[3] = slice(bindData[3]); + } + // set `thisBinding` is not previously bound + if (isBind && !(bindData[1] & 1)) { + bindData[4] = thisArg; + } + // set if previously bound but not currently (subsequent curried functions) + if (!isBind && bindData[1] & 1) { + bitmask |= 8; + } + // set curried arity if not yet set + if (isCurry && !(bindData[1] & 4)) { + bindData[5] = arity; + } + // append partial left arguments + if (isPartial) { + push.apply(bindData[2] || (bindData[2] = []), partialArgs); + } + // append partial right arguments + if (isPartialRight) { + unshift.apply(bindData[3] || (bindData[3] = []), partialRightArgs); + } + // merge flags + bindData[1] |= bitmask; + return createWrapper.apply(null, bindData); + } + // fast path for `_.bind` + var creater = (bitmask == 1 || bitmask === 17) ? baseBind : baseCreateWrapper; + return creater([func, bitmask, partialArgs, partialRightArgs, thisArg, arity]); + } + + /** + * Used by `escape` to convert characters to HTML entities. + * + * @private + * @param {string} match The matched character to escape. + * @returns {string} Returns the escaped character. + */ + function escapeHtmlChar(match) { + return htmlEscapes[match]; + } + + /** + * Gets the appropriate "indexOf" function. If the `_.indexOf` method is + * customized, this method returns the custom method, otherwise it returns + * the `baseIndexOf` function. + * + * @private + * @returns {Function} Returns the "indexOf" function. + */ + function getIndexOf() { + var result = (result = lodash.indexOf) === indexOf ? baseIndexOf : result; + return result; + } + + /** + * Checks if `value` is a native function. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if the `value` is a native function, else `false`. + */ + function isNative(value) { + return typeof value == 'function' && reNative.test(value); + } + + /** + * Sets `this` binding data on a given function. + * + * @private + * @param {Function} func The function to set data on. + * @param {Array} value The data array to set. + */ + var setBindData = !defineProperty ? noop : function(func, value) { + descriptor.value = value; + defineProperty(func, '__bindData__', descriptor); + }; + + /** + * A fallback implementation of `isPlainObject` which checks if a given value + * is an object created by the `Object` constructor, assuming objects created + * by the `Object` constructor have no inherited enumerable properties and that + * there are no `Object.prototype` extensions. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. + */ + function shimIsPlainObject(value) { + var ctor, + result; + + // avoid non Object objects, `arguments` objects, and DOM elements + if (!(value && toString.call(value) == objectClass) || + (ctor = value.constructor, isFunction(ctor) && !(ctor instanceof ctor))) { + return false; + } + // In most environments an object's own properties are iterated before + // its inherited properties. If the last iterated property is an object's + // own property then there are no inherited enumerable properties. + forIn(value, function(value, key) { + result = key; + }); + return typeof result == 'undefined' || hasOwnProperty.call(value, result); + } + + /** + * Used by `unescape` to convert HTML entities to characters. + * + * @private + * @param {string} match The matched character to unescape. + * @returns {string} Returns the unescaped character. + */ + function unescapeHtmlChar(match) { + return htmlUnescapes[match]; + } + + /*--------------------------------------------------------------------------*/ + + /** + * Checks if `value` is an `arguments` object. + * + * @static + * @memberOf _ + * @category Objects + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if the `value` is an `arguments` object, else `false`. + * @example + * + * (function() { return _.isArguments(arguments); })(1, 2, 3); + * // => true + * + * _.isArguments([1, 2, 3]); + * // => false + */ + function isArguments(value) { + return value && typeof value == 'object' && typeof value.length == 'number' && + toString.call(value) == argsClass || false; + } + + /** + * Checks if `value` is an array. + * + * @static + * @memberOf _ + * @type Function + * @category Objects + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if the `value` is an array, else `false`. + * @example + * + * (function() { return _.isArray(arguments); })(); + * // => false + * + * _.isArray([1, 2, 3]); + * // => true + */ + var isArray = nativeIsArray || function(value) { + return value && typeof value == 'object' && typeof value.length == 'number' && + toString.call(value) == arrayClass || false; + }; + + /** + * A fallback implementation of `Object.keys` which produces an array of the + * given object's own enumerable property names. + * + * @private + * @type Function + * @param {Object} object The object to inspect. + * @returns {Array} Returns an array of property names. + */ + var shimKeys = function(object) { + var index, iterable = object, result = []; + if (!iterable) return result; + if (!(objectTypes[typeof object])) return result; + for (index in iterable) { + if (hasOwnProperty.call(iterable, index)) { + result.push(index); + } + } + return result + }; + + /** + * Creates an array composed of the own enumerable property names of an object. + * + * @static + * @memberOf _ + * @category Objects + * @param {Object} object The object to inspect. + * @returns {Array} Returns an array of property names. + * @example + * + * _.keys({ 'one': 1, 'two': 2, 'three': 3 }); + * // => ['one', 'two', 'three'] (property order is not guaranteed across environments) + */ + var keys = !nativeKeys ? shimKeys : function(object) { + if (!isObject(object)) { + return []; + } + return nativeKeys(object); + }; + + /** + * Used to convert characters to HTML entities: + * + * Though the `>` character is escaped for symmetry, characters like `>` and `/` + * don't require escaping in HTML and have no special meaning unless they're part + * of a tag or an unquoted attribute value. + * http://mathiasbynens.be/notes/ambiguous-ampersands (under "semi-related fun fact") + */ + var htmlEscapes = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + "'": ''' + }; + + /** Used to convert HTML entities to characters */ + var htmlUnescapes = invert(htmlEscapes); + + /** Used to match HTML entities and HTML characters */ + var reEscapedHtml = RegExp('(' + keys(htmlUnescapes).join('|') + ')', 'g'), + reUnescapedHtml = RegExp('[' + keys(htmlEscapes).join('') + ']', 'g'); + + /*--------------------------------------------------------------------------*/ + + /** + * Assigns own enumerable properties of source object(s) to the destination + * object. Subsequent sources will overwrite property assignments of previous + * sources. If a callback is provided it will be executed to produce the + * assigned values. The callback is bound to `thisArg` and invoked with two + * arguments; (objectValue, sourceValue). + * + * @static + * @memberOf _ + * @type Function + * @alias extend + * @category Objects + * @param {Object} object The destination object. + * @param {...Object} [source] The source objects. + * @param {Function} [callback] The function to customize assigning values. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {Object} Returns the destination object. + * @example + * + * _.assign({ 'name': 'fred' }, { 'employer': 'slate' }); + * // => { 'name': 'fred', 'employer': 'slate' } + * + * var defaults = _.partialRight(_.assign, function(a, b) { + * return typeof a == 'undefined' ? b : a; + * }); + * + * var object = { 'name': 'barney' }; + * defaults(object, { 'name': 'fred', 'employer': 'slate' }); + * // => { 'name': 'barney', 'employer': 'slate' } + */ + var assign = function(object, source, guard) { + var index, iterable = object, result = iterable; + if (!iterable) return result; + var args = arguments, + argsIndex = 0, + argsLength = typeof guard == 'number' ? 2 : args.length; + if (argsLength > 3 && typeof args[argsLength - 2] == 'function') { + var callback = baseCreateCallback(args[--argsLength - 1], args[argsLength--], 2); + } else if (argsLength > 2 && typeof args[argsLength - 1] == 'function') { + callback = args[--argsLength]; + } + while (++argsIndex < argsLength) { + iterable = args[argsIndex]; + if (iterable && objectTypes[typeof iterable]) { + var ownIndex = -1, + ownProps = objectTypes[typeof iterable] && keys(iterable), + length = ownProps ? ownProps.length : 0; + + while (++ownIndex < length) { + index = ownProps[ownIndex]; + result[index] = callback ? callback(result[index], iterable[index]) : iterable[index]; + } + } + } + return result + }; + + /** + * Creates a clone of `value`. If `isDeep` is `true` nested objects will also + * be cloned, otherwise they will be assigned by reference. If a callback + * is provided it will be executed to produce the cloned values. If the + * callback returns `undefined` cloning will be handled by the method instead. + * The callback is bound to `thisArg` and invoked with one argument; (value). + * + * @static + * @memberOf _ + * @category Objects + * @param {*} value The value to clone. + * @param {boolean} [isDeep=false] Specify a deep clone. + * @param {Function} [callback] The function to customize cloning values. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {*} Returns the cloned value. + * @example + * + * var characters = [ + * { 'name': 'barney', 'age': 36 }, + * { 'name': 'fred', 'age': 40 } + * ]; + * + * var shallow = _.clone(characters); + * shallow[0] === characters[0]; + * // => true + * + * var deep = _.clone(characters, true); + * deep[0] === characters[0]; + * // => false + * + * _.mixin({ + * 'clone': _.partialRight(_.clone, function(value) { + * return _.isElement(value) ? value.cloneNode(false) : undefined; + * }) + * }); + * + * var clone = _.clone(document.body); + * clone.childNodes.length; + * // => 0 + */ + function clone(value, isDeep, callback, thisArg) { + // allows working with "Collections" methods without using their `index` + // and `collection` arguments for `isDeep` and `callback` + if (typeof isDeep != 'boolean' && isDeep != null) { + thisArg = callback; + callback = isDeep; + isDeep = false; + } + return baseClone(value, isDeep, typeof callback == 'function' && baseCreateCallback(callback, thisArg, 1)); + } + + /** + * Creates a deep clone of `value`. If a callback is provided it will be + * executed to produce the cloned values. If the callback returns `undefined` + * cloning will be handled by the method instead. The callback is bound to + * `thisArg` and invoked with one argument; (value). + * + * Note: This method is loosely based on the structured clone algorithm. Functions + * and DOM nodes are **not** cloned. The enumerable properties of `arguments` objects and + * objects created by constructors other than `Object` are cloned to plain `Object` objects. + * See http://www.w3.org/TR/html5/infrastructure.html#internal-structured-cloning-algorithm. + * + * @static + * @memberOf _ + * @category Objects + * @param {*} value The value to deep clone. + * @param {Function} [callback] The function to customize cloning values. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {*} Returns the deep cloned value. + * @example + * + * var characters = [ + * { 'name': 'barney', 'age': 36 }, + * { 'name': 'fred', 'age': 40 } + * ]; + * + * var deep = _.cloneDeep(characters); + * deep[0] === characters[0]; + * // => false + * + * var view = { + * 'label': 'docs', + * 'node': element + * }; + * + * var clone = _.cloneDeep(view, function(value) { + * return _.isElement(value) ? value.cloneNode(true) : undefined; + * }); + * + * clone.node == view.node; + * // => false + */ + function cloneDeep(value, callback, thisArg) { + return baseClone(value, true, typeof callback == 'function' && baseCreateCallback(callback, thisArg, 1)); + } + + /** + * Creates an object that inherits from the given `prototype` object. If a + * `properties` object is provided its own enumerable properties are assigned + * to the created object. + * + * @static + * @memberOf _ + * @category Objects + * @param {Object} prototype The object to inherit from. + * @param {Object} [properties] The properties to assign to the object. + * @returns {Object} Returns the new object. + * @example + * + * function Shape() { + * this.x = 0; + * this.y = 0; + * } + * + * function Circle() { + * Shape.call(this); + * } + * + * Circle.prototype = _.create(Shape.prototype, { 'constructor': Circle }); + * + * var circle = new Circle; + * circle instanceof Circle; + * // => true + * + * circle instanceof Shape; + * // => true + */ + function create(prototype, properties) { + var result = baseCreate(prototype); + return properties ? assign(result, properties) : result; + } + + /** + * Assigns own enumerable properties of source object(s) to the destination + * object for all destination properties that resolve to `undefined`. Once a + * property is set, additional defaults of the same property will be ignored. + * + * @static + * @memberOf _ + * @type Function + * @category Objects + * @param {Object} object The destination object. + * @param {...Object} [source] The source objects. + * @param- {Object} [guard] Allows working with `_.reduce` without using its + * `key` and `object` arguments as sources. + * @returns {Object} Returns the destination object. + * @example + * + * var object = { 'name': 'barney' }; + * _.defaults(object, { 'name': 'fred', 'employer': 'slate' }); + * // => { 'name': 'barney', 'employer': 'slate' } + */ + var defaults = function(object, source, guard) { + var index, iterable = object, result = iterable; + if (!iterable) return result; + var args = arguments, + argsIndex = 0, + argsLength = typeof guard == 'number' ? 2 : args.length; + while (++argsIndex < argsLength) { + iterable = args[argsIndex]; + if (iterable && objectTypes[typeof iterable]) { + var ownIndex = -1, + ownProps = objectTypes[typeof iterable] && keys(iterable), + length = ownProps ? ownProps.length : 0; + + while (++ownIndex < length) { + index = ownProps[ownIndex]; + if (typeof result[index] == 'undefined') result[index] = iterable[index]; + } + } + } + return result + }; + + /** + * This method is like `_.findIndex` except that it returns the key of the + * first element that passes the callback check, instead of the element itself. + * + * If a property name is provided for `callback` the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is provided for `callback` the created "_.where" style callback + * will return `true` for elements that have the properties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @category Objects + * @param {Object} object The object to search. + * @param {Function|Object|string} [callback=identity] The function called per + * iteration. If a property name or object is provided it will be used to + * create a "_.pluck" or "_.where" style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {string|undefined} Returns the key of the found element, else `undefined`. + * @example + * + * var characters = { + * 'barney': { 'age': 36, 'blocked': false }, + * 'fred': { 'age': 40, 'blocked': true }, + * 'pebbles': { 'age': 1, 'blocked': false } + * }; + * + * _.findKey(characters, function(chr) { + * return chr.age < 40; + * }); + * // => 'barney' (property order is not guaranteed across environments) + * + * // using "_.where" callback shorthand + * _.findKey(characters, { 'age': 1 }); + * // => 'pebbles' + * + * // using "_.pluck" callback shorthand + * _.findKey(characters, 'blocked'); + * // => 'fred' + */ + function findKey(object, callback, thisArg) { + var result; + callback = lodash.createCallback(callback, thisArg, 3); + forOwn(object, function(value, key, object) { + if (callback(value, key, object)) { + result = key; + return false; + } + }); + return result; + } + + /** + * This method is like `_.findKey` except that it iterates over elements + * of a `collection` in the opposite order. + * + * If a property name is provided for `callback` the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is provided for `callback` the created "_.where" style callback + * will return `true` for elements that have the properties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @category Objects + * @param {Object} object The object to search. + * @param {Function|Object|string} [callback=identity] The function called per + * iteration. If a property name or object is provided it will be used to + * create a "_.pluck" or "_.where" style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {string|undefined} Returns the key of the found element, else `undefined`. + * @example + * + * var characters = { + * 'barney': { 'age': 36, 'blocked': true }, + * 'fred': { 'age': 40, 'blocked': false }, + * 'pebbles': { 'age': 1, 'blocked': true } + * }; + * + * _.findLastKey(characters, function(chr) { + * return chr.age < 40; + * }); + * // => returns `pebbles`, assuming `_.findKey` returns `barney` + * + * // using "_.where" callback shorthand + * _.findLastKey(characters, { 'age': 40 }); + * // => 'fred' + * + * // using "_.pluck" callback shorthand + * _.findLastKey(characters, 'blocked'); + * // => 'pebbles' + */ + function findLastKey(object, callback, thisArg) { + var result; + callback = lodash.createCallback(callback, thisArg, 3); + forOwnRight(object, function(value, key, object) { + if (callback(value, key, object)) { + result = key; + return false; + } + }); + return result; + } + + /** + * Iterates over own and inherited enumerable properties of an object, + * executing the callback for each property. The callback is bound to `thisArg` + * and invoked with three arguments; (value, key, object). Callbacks may exit + * iteration early by explicitly returning `false`. + * + * @static + * @memberOf _ + * @type Function + * @category Objects + * @param {Object} object The object to iterate over. + * @param {Function} [callback=identity] The function called per iteration. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {Object} Returns `object`. + * @example + * + * function Shape() { + * this.x = 0; + * this.y = 0; + * } + * + * Shape.prototype.move = function(x, y) { + * this.x += x; + * this.y += y; + * }; + * + * _.forIn(new Shape, function(value, key) { + * console.log(key); + * }); + * // => logs 'x', 'y', and 'move' (property order is not guaranteed across environments) + */ + var forIn = function(collection, callback, thisArg) { + var index, iterable = collection, result = iterable; + if (!iterable) return result; + if (!objectTypes[typeof iterable]) return result; + callback = callback && typeof thisArg == 'undefined' ? callback : baseCreateCallback(callback, thisArg, 3); + for (index in iterable) { + if (callback(iterable[index], index, collection) === false) return result; + } + return result + }; + + /** + * This method is like `_.forIn` except that it iterates over elements + * of a `collection` in the opposite order. + * + * @static + * @memberOf _ + * @category Objects + * @param {Object} object The object to iterate over. + * @param {Function} [callback=identity] The function called per iteration. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {Object} Returns `object`. + * @example + * + * function Shape() { + * this.x = 0; + * this.y = 0; + * } + * + * Shape.prototype.move = function(x, y) { + * this.x += x; + * this.y += y; + * }; + * + * _.forInRight(new Shape, function(value, key) { + * console.log(key); + * }); + * // => logs 'move', 'y', and 'x' assuming `_.forIn ` logs 'x', 'y', and 'move' + */ + function forInRight(object, callback, thisArg) { + var pairs = []; + + forIn(object, function(value, key) { + pairs.push(key, value); + }); + + var length = pairs.length; + callback = baseCreateCallback(callback, thisArg, 3); + while (length--) { + if (callback(pairs[length--], pairs[length], object) === false) { + break; + } + } + return object; + } + + /** + * Iterates over own enumerable properties of an object, executing the callback + * for each property. The callback is bound to `thisArg` and invoked with three + * arguments; (value, key, object). Callbacks may exit iteration early by + * explicitly returning `false`. + * + * @static + * @memberOf _ + * @type Function + * @category Objects + * @param {Object} object The object to iterate over. + * @param {Function} [callback=identity] The function called per iteration. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {Object} Returns `object`. + * @example + * + * _.forOwn({ '0': 'zero', '1': 'one', 'length': 2 }, function(num, key) { + * console.log(key); + * }); + * // => logs '0', '1', and 'length' (property order is not guaranteed across environments) + */ + var forOwn = function(collection, callback, thisArg) { + var index, iterable = collection, result = iterable; + if (!iterable) return result; + if (!objectTypes[typeof iterable]) return result; + callback = callback && typeof thisArg == 'undefined' ? callback : baseCreateCallback(callback, thisArg, 3); + var ownIndex = -1, + ownProps = objectTypes[typeof iterable] && keys(iterable), + length = ownProps ? ownProps.length : 0; + + while (++ownIndex < length) { + index = ownProps[ownIndex]; + if (callback(iterable[index], index, collection) === false) return result; + } + return result + }; + + /** + * This method is like `_.forOwn` except that it iterates over elements + * of a `collection` in the opposite order. + * + * @static + * @memberOf _ + * @category Objects + * @param {Object} object The object to iterate over. + * @param {Function} [callback=identity] The function called per iteration. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {Object} Returns `object`. + * @example + * + * _.forOwnRight({ '0': 'zero', '1': 'one', 'length': 2 }, function(num, key) { + * console.log(key); + * }); + * // => logs 'length', '1', and '0' assuming `_.forOwn` logs '0', '1', and 'length' + */ + function forOwnRight(object, callback, thisArg) { + var props = keys(object), + length = props.length; + + callback = baseCreateCallback(callback, thisArg, 3); + while (length--) { + var key = props[length]; + if (callback(object[key], key, object) === false) { + break; + } + } + return object; + } + + /** + * Creates a sorted array of property names of all enumerable properties, + * own and inherited, of `object` that have function values. + * + * @static + * @memberOf _ + * @alias methods + * @category Objects + * @param {Object} object The object to inspect. + * @returns {Array} Returns an array of property names that have function values. + * @example + * + * _.functions(_); + * // => ['all', 'any', 'bind', 'bindAll', 'clone', 'compact', 'compose', ...] + */ + function functions(object) { + var result = []; + forIn(object, function(value, key) { + if (isFunction(value)) { + result.push(key); + } + }); + return result.sort(); + } + + /** + * Checks if the specified property name exists as a direct property of `object`, + * instead of an inherited property. + * + * @static + * @memberOf _ + * @category Objects + * @param {Object} object The object to inspect. + * @param {string} key The name of the property to check. + * @returns {boolean} Returns `true` if key is a direct property, else `false`. + * @example + * + * _.has({ 'a': 1, 'b': 2, 'c': 3 }, 'b'); + * // => true + */ + function has(object, key) { + return object ? hasOwnProperty.call(object, key) : false; + } + + /** + * Creates an object composed of the inverted keys and values of the given object. + * + * @static + * @memberOf _ + * @category Objects + * @param {Object} object The object to invert. + * @returns {Object} Returns the created inverted object. + * @example + * + * _.invert({ 'first': 'fred', 'second': 'barney' }); + * // => { 'fred': 'first', 'barney': 'second' } + */ + function invert(object) { + var index = -1, + props = keys(object), + length = props.length, + result = {}; + + while (++index < length) { + var key = props[index]; + result[object[key]] = key; + } + return result; + } + + /** + * Checks if `value` is a boolean value. + * + * @static + * @memberOf _ + * @category Objects + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if the `value` is a boolean value, else `false`. + * @example + * + * _.isBoolean(null); + * // => false + */ + function isBoolean(value) { + return value === true || value === false || + value && typeof value == 'object' && toString.call(value) == boolClass || false; + } + + /** + * Checks if `value` is a date. + * + * @static + * @memberOf _ + * @category Objects + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if the `value` is a date, else `false`. + * @example + * + * _.isDate(new Date); + * // => true + */ + function isDate(value) { + return value && typeof value == 'object' && toString.call(value) == dateClass || false; + } + + /** + * Checks if `value` is a DOM element. + * + * @static + * @memberOf _ + * @category Objects + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if the `value` is a DOM element, else `false`. + * @example + * + * _.isElement(document.body); + * // => true + */ + function isElement(value) { + return value && value.nodeType === 1 || false; + } + + /** + * Checks if `value` is empty. Arrays, strings, or `arguments` objects with a + * length of `0` and objects with no own enumerable properties are considered + * "empty". + * + * @static + * @memberOf _ + * @category Objects + * @param {Array|Object|string} value The value to inspect. + * @returns {boolean} Returns `true` if the `value` is empty, else `false`. + * @example + * + * _.isEmpty([1, 2, 3]); + * // => false + * + * _.isEmpty({}); + * // => true + * + * _.isEmpty(''); + * // => true + */ + function isEmpty(value) { + var result = true; + if (!value) { + return result; + } + var className = toString.call(value), + length = value.length; + + if ((className == arrayClass || className == stringClass || className == argsClass ) || + (className == objectClass && typeof length == 'number' && isFunction(value.splice))) { + return !length; + } + forOwn(value, function() { + return (result = false); + }); + return result; + } + + /** + * Performs a deep comparison between two values to determine if they are + * equivalent to each other. If a callback is provided it will be executed + * to compare values. If the callback returns `undefined` comparisons will + * be handled by the method instead. The callback is bound to `thisArg` and + * invoked with two arguments; (a, b). + * + * @static + * @memberOf _ + * @category Objects + * @param {*} a The value to compare. + * @param {*} b The other value to compare. + * @param {Function} [callback] The function to customize comparing values. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'name': 'fred' }; + * var copy = { 'name': 'fred' }; + * + * object == copy; + * // => false + * + * _.isEqual(object, copy); + * // => true + * + * var words = ['hello', 'goodbye']; + * var otherWords = ['hi', 'goodbye']; + * + * _.isEqual(words, otherWords, function(a, b) { + * var reGreet = /^(?:hello|hi)$/i, + * aGreet = _.isString(a) && reGreet.test(a), + * bGreet = _.isString(b) && reGreet.test(b); + * + * return (aGreet || bGreet) ? (aGreet == bGreet) : undefined; + * }); + * // => true + */ + function isEqual(a, b, callback, thisArg) { + return baseIsEqual(a, b, typeof callback == 'function' && baseCreateCallback(callback, thisArg, 2)); + } + + /** + * Checks if `value` is, or can be coerced to, a finite number. + * + * Note: This is not the same as native `isFinite` which will return true for + * booleans and empty strings. See http://es5.github.io/#x15.1.2.5. + * + * @static + * @memberOf _ + * @category Objects + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if the `value` is finite, else `false`. + * @example + * + * _.isFinite(-101); + * // => true + * + * _.isFinite('10'); + * // => true + * + * _.isFinite(true); + * // => false + * + * _.isFinite(''); + * // => false + * + * _.isFinite(Infinity); + * // => false + */ + function isFinite(value) { + return nativeIsFinite(value) && !nativeIsNaN(parseFloat(value)); + } + + /** + * Checks if `value` is a function. + * + * @static + * @memberOf _ + * @category Objects + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if the `value` is a function, else `false`. + * @example + * + * _.isFunction(_); + * // => true + */ + function isFunction(value) { + return typeof value == 'function'; + } + + /** + * Checks if `value` is the language type of Object. + * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @category Objects + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if the `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(1); + * // => false + */ + function isObject(value) { + // check if the value is the ECMAScript language type of Object + // http://es5.github.io/#x8 + // and avoid a V8 bug + // http://code.google.com/p/v8/issues/detail?id=2291 + return !!(value && objectTypes[typeof value]); + } + + /** + * Checks if `value` is `NaN`. + * + * Note: This is not the same as native `isNaN` which will return `true` for + * `undefined` and other non-numeric values. See http://es5.github.io/#x15.1.2.4. + * + * @static + * @memberOf _ + * @category Objects + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if the `value` is `NaN`, else `false`. + * @example + * + * _.isNaN(NaN); + * // => true + * + * _.isNaN(new Number(NaN)); + * // => true + * + * isNaN(undefined); + * // => true + * + * _.isNaN(undefined); + * // => false + */ + function isNaN(value) { + // `NaN` as a primitive is the only value that is not equal to itself + // (perform the [[Class]] check first to avoid errors with some host objects in IE) + return isNumber(value) && value != +value; + } + + /** + * Checks if `value` is `null`. + * + * @static + * @memberOf _ + * @category Objects + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if the `value` is `null`, else `false`. + * @example + * + * _.isNull(null); + * // => true + * + * _.isNull(undefined); + * // => false + */ + function isNull(value) { + return value === null; + } + + /** + * Checks if `value` is a number. + * + * Note: `NaN` is considered a number. See http://es5.github.io/#x8.5. + * + * @static + * @memberOf _ + * @category Objects + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if the `value` is a number, else `false`. + * @example + * + * _.isNumber(8.4 * 5); + * // => true + */ + function isNumber(value) { + return typeof value == 'number' || + value && typeof value == 'object' && toString.call(value) == numberClass || false; + } + + /** + * Checks if `value` is an object created by the `Object` constructor. + * + * @static + * @memberOf _ + * @category Objects + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. + * @example + * + * function Shape() { + * this.x = 0; + * this.y = 0; + * } + * + * _.isPlainObject(new Shape); + * // => false + * + * _.isPlainObject([1, 2, 3]); + * // => false + * + * _.isPlainObject({ 'x': 0, 'y': 0 }); + * // => true + */ + var isPlainObject = !getPrototypeOf ? shimIsPlainObject : function(value) { + if (!(value && toString.call(value) == objectClass)) { + return false; + } + var valueOf = value.valueOf, + objProto = isNative(valueOf) && (objProto = getPrototypeOf(valueOf)) && getPrototypeOf(objProto); + + return objProto + ? (value == objProto || getPrototypeOf(value) == objProto) + : shimIsPlainObject(value); + }; + + /** + * Checks if `value` is a regular expression. + * + * @static + * @memberOf _ + * @category Objects + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if the `value` is a regular expression, else `false`. + * @example + * + * _.isRegExp(/fred/); + * // => true + */ + function isRegExp(value) { + return value && typeof value == 'object' && toString.call(value) == regexpClass || false; + } + + /** + * Checks if `value` is a string. + * + * @static + * @memberOf _ + * @category Objects + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if the `value` is a string, else `false`. + * @example + * + * _.isString('fred'); + * // => true + */ + function isString(value) { + return typeof value == 'string' || + value && typeof value == 'object' && toString.call(value) == stringClass || false; + } + + /** + * Checks if `value` is `undefined`. + * + * @static + * @memberOf _ + * @category Objects + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if the `value` is `undefined`, else `false`. + * @example + * + * _.isUndefined(void 0); + * // => true + */ + function isUndefined(value) { + return typeof value == 'undefined'; + } + + /** + * Creates an object with the same keys as `object` and values generated by + * running each own enumerable property of `object` through the callback. + * The callback is bound to `thisArg` and invoked with three arguments; + * (value, key, object). + * + * If a property name is provided for `callback` the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is provided for `callback` the created "_.where" style callback + * will return `true` for elements that have the properties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @category Objects + * @param {Object} object The object to iterate over. + * @param {Function|Object|string} [callback=identity] The function called + * per iteration. If a property name or object is provided it will be used + * to create a "_.pluck" or "_.where" style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {Array} Returns a new object with values of the results of each `callback` execution. + * @example + * + * _.mapValues({ 'a': 1, 'b': 2, 'c': 3} , function(num) { return num * 3; }); + * // => { 'a': 3, 'b': 6, 'c': 9 } + * + * var characters = { + * 'fred': { 'name': 'fred', 'age': 40 }, + * 'pebbles': { 'name': 'pebbles', 'age': 1 } + * }; + * + * // using "_.pluck" callback shorthand + * _.mapValues(characters, 'age'); + * // => { 'fred': 40, 'pebbles': 1 } + */ + function mapValues(object, callback, thisArg) { + var result = {}; + callback = lodash.createCallback(callback, thisArg, 3); + + forOwn(object, function(value, key, object) { + result[key] = callback(value, key, object); + }); + return result; + } + + /** + * Recursively merges own enumerable properties of the source object(s), that + * don't resolve to `undefined` into the destination object. Subsequent sources + * will overwrite property assignments of previous sources. If a callback is + * provided it will be executed to produce the merged values of the destination + * and source properties. If the callback returns `undefined` merging will + * be handled by the method instead. The callback is bound to `thisArg` and + * invoked with two arguments; (objectValue, sourceValue). + * + * @static + * @memberOf _ + * @category Objects + * @param {Object} object The destination object. + * @param {...Object} [source] The source objects. + * @param {Function} [callback] The function to customize merging properties. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {Object} Returns the destination object. + * @example + * + * var names = { + * 'characters': [ + * { 'name': 'barney' }, + * { 'name': 'fred' } + * ] + * }; + * + * var ages = { + * 'characters': [ + * { 'age': 36 }, + * { 'age': 40 } + * ] + * }; + * + * _.merge(names, ages); + * // => { 'characters': [{ 'name': 'barney', 'age': 36 }, { 'name': 'fred', 'age': 40 }] } + * + * var food = { + * 'fruits': ['apple'], + * 'vegetables': ['beet'] + * }; + * + * var otherFood = { + * 'fruits': ['banana'], + * 'vegetables': ['carrot'] + * }; + * + * _.merge(food, otherFood, function(a, b) { + * return _.isArray(a) ? a.concat(b) : undefined; + * }); + * // => { 'fruits': ['apple', 'banana'], 'vegetables': ['beet', 'carrot] } + */ + function merge(object) { + var args = arguments, + length = 2; + + if (!isObject(object)) { + return object; + } + // allows working with `_.reduce` and `_.reduceRight` without using + // their `index` and `collection` arguments + if (typeof args[2] != 'number') { + length = args.length; + } + if (length > 3 && typeof args[length - 2] == 'function') { + var callback = baseCreateCallback(args[--length - 1], args[length--], 2); + } else if (length > 2 && typeof args[length - 1] == 'function') { + callback = args[--length]; + } + var sources = slice(arguments, 1, length), + index = -1, + stackA = getArray(), + stackB = getArray(); + + while (++index < length) { + baseMerge(object, sources[index], callback, stackA, stackB); + } + releaseArray(stackA); + releaseArray(stackB); + return object; + } + + /** + * Creates a shallow clone of `object` excluding the specified properties. + * Property names may be specified as individual arguments or as arrays of + * property names. If a callback is provided it will be executed for each + * property of `object` omitting the properties the callback returns truey + * for. The callback is bound to `thisArg` and invoked with three arguments; + * (value, key, object). + * + * @static + * @memberOf _ + * @category Objects + * @param {Object} object The source object. + * @param {Function|...string|string[]} [callback] The properties to omit or the + * function called per iteration. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {Object} Returns an object without the omitted properties. + * @example + * + * _.omit({ 'name': 'fred', 'age': 40 }, 'age'); + * // => { 'name': 'fred' } + * + * _.omit({ 'name': 'fred', 'age': 40 }, function(value) { + * return typeof value == 'number'; + * }); + * // => { 'name': 'fred' } + */ + function omit(object, callback, thisArg) { + var result = {}; + if (typeof callback != 'function') { + var props = []; + forIn(object, function(value, key) { + props.push(key); + }); + props = baseDifference(props, baseFlatten(arguments, true, false, 1)); + + var index = -1, + length = props.length; + + while (++index < length) { + var key = props[index]; + result[key] = object[key]; + } + } else { + callback = lodash.createCallback(callback, thisArg, 3); + forIn(object, function(value, key, object) { + if (!callback(value, key, object)) { + result[key] = value; + } + }); + } + return result; + } + + /** + * Creates a two dimensional array of an object's key-value pairs, + * i.e. `[[key1, value1], [key2, value2]]`. + * + * @static + * @memberOf _ + * @category Objects + * @param {Object} object The object to inspect. + * @returns {Array} Returns new array of key-value pairs. + * @example + * + * _.pairs({ 'barney': 36, 'fred': 40 }); + * // => [['barney', 36], ['fred', 40]] (property order is not guaranteed across environments) + */ + function pairs(object) { + var index = -1, + props = keys(object), + length = props.length, + result = Array(length); + + while (++index < length) { + var key = props[index]; + result[index] = [key, object[key]]; + } + return result; + } + + /** + * Creates a shallow clone of `object` composed of the specified properties. + * Property names may be specified as individual arguments or as arrays of + * property names. If a callback is provided it will be executed for each + * property of `object` picking the properties the callback returns truey + * for. The callback is bound to `thisArg` and invoked with three arguments; + * (value, key, object). + * + * @static + * @memberOf _ + * @category Objects + * @param {Object} object The source object. + * @param {Function|...string|string[]} [callback] The function called per + * iteration or property names to pick, specified as individual property + * names or arrays of property names. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {Object} Returns an object composed of the picked properties. + * @example + * + * _.pick({ 'name': 'fred', '_userid': 'fred1' }, 'name'); + * // => { 'name': 'fred' } + * + * _.pick({ 'name': 'fred', '_userid': 'fred1' }, function(value, key) { + * return key.charAt(0) != '_'; + * }); + * // => { 'name': 'fred' } + */ + function pick(object, callback, thisArg) { + var result = {}; + if (typeof callback != 'function') { + var index = -1, + props = baseFlatten(arguments, true, false, 1), + length = isObject(object) ? props.length : 0; + + while (++index < length) { + var key = props[index]; + if (key in object) { + result[key] = object[key]; + } + } + } else { + callback = lodash.createCallback(callback, thisArg, 3); + forIn(object, function(value, key, object) { + if (callback(value, key, object)) { + result[key] = value; + } + }); + } + return result; + } + + /** + * An alternative to `_.reduce` this method transforms `object` to a new + * `accumulator` object which is the result of running each of its own + * enumerable properties through a callback, with each callback execution + * potentially mutating the `accumulator` object. The callback is bound to + * `thisArg` and invoked with four arguments; (accumulator, value, key, object). + * Callbacks may exit iteration early by explicitly returning `false`. + * + * @static + * @memberOf _ + * @category Objects + * @param {Array|Object} object The object to iterate over. + * @param {Function} [callback=identity] The function called per iteration. + * @param {*} [accumulator] The custom accumulator value. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {*} Returns the accumulated value. + * @example + * + * var squares = _.transform([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], function(result, num) { + * num *= num; + * if (num % 2) { + * return result.push(num) < 3; + * } + * }); + * // => [1, 9, 25] + * + * var mapped = _.transform({ 'a': 1, 'b': 2, 'c': 3 }, function(result, num, key) { + * result[key] = num * 3; + * }); + * // => { 'a': 3, 'b': 6, 'c': 9 } + */ + function transform(object, callback, accumulator, thisArg) { + var isArr = isArray(object); + if (accumulator == null) { + if (isArr) { + accumulator = []; + } else { + var ctor = object && object.constructor, + proto = ctor && ctor.prototype; + + accumulator = baseCreate(proto); + } + } + if (callback) { + callback = lodash.createCallback(callback, thisArg, 4); + (isArr ? forEach : forOwn)(object, function(value, index, object) { + return callback(accumulator, value, index, object); + }); + } + return accumulator; + } + + /** + * Creates an array composed of the own enumerable property values of `object`. + * + * @static + * @memberOf _ + * @category Objects + * @param {Object} object The object to inspect. + * @returns {Array} Returns an array of property values. + * @example + * + * _.values({ 'one': 1, 'two': 2, 'three': 3 }); + * // => [1, 2, 3] (property order is not guaranteed across environments) + */ + function values(object) { + var index = -1, + props = keys(object), + length = props.length, + result = Array(length); + + while (++index < length) { + result[index] = object[props[index]]; + } + return result; + } + + /*--------------------------------------------------------------------------*/ + + /** + * Creates an array of elements from the specified indexes, or keys, of the + * `collection`. Indexes may be specified as individual arguments or as arrays + * of indexes. + * + * @static + * @memberOf _ + * @category Collections + * @param {Array|Object|string} collection The collection to iterate over. + * @param {...(number|number[]|string|string[])} [index] The indexes of `collection` + * to retrieve, specified as individual indexes or arrays of indexes. + * @returns {Array} Returns a new array of elements corresponding to the + * provided indexes. + * @example + * + * _.at(['a', 'b', 'c', 'd', 'e'], [0, 2, 4]); + * // => ['a', 'c', 'e'] + * + * _.at(['fred', 'barney', 'pebbles'], 0, 2); + * // => ['fred', 'pebbles'] + */ + function at(collection) { + var args = arguments, + index = -1, + props = baseFlatten(args, true, false, 1), + length = (args[2] && args[2][args[1]] === collection) ? 1 : props.length, + result = Array(length); + + while(++index < length) { + result[index] = collection[props[index]]; + } + return result; + } + + /** + * Checks if a given value is present in a collection using strict equality + * for comparisons, i.e. `===`. If `fromIndex` is negative, it is used as the + * offset from the end of the collection. + * + * @static + * @memberOf _ + * @alias include + * @category Collections + * @param {Array|Object|string} collection The collection to iterate over. + * @param {*} target The value to check for. + * @param {number} [fromIndex=0] The index to search from. + * @returns {boolean} Returns `true` if the `target` element is found, else `false`. + * @example + * + * _.contains([1, 2, 3], 1); + * // => true + * + * _.contains([1, 2, 3], 1, 2); + * // => false + * + * _.contains({ 'name': 'fred', 'age': 40 }, 'fred'); + * // => true + * + * _.contains('pebbles', 'eb'); + * // => true + */ + function contains(collection, target, fromIndex) { + var index = -1, + indexOf = getIndexOf(), + length = collection ? collection.length : 0, + result = false; + + fromIndex = (fromIndex < 0 ? nativeMax(0, length + fromIndex) : fromIndex) || 0; + if (isArray(collection)) { + result = indexOf(collection, target, fromIndex) > -1; + } else if (typeof length == 'number') { + result = (isString(collection) ? collection.indexOf(target, fromIndex) : indexOf(collection, target, fromIndex)) > -1; + } else { + forOwn(collection, function(value) { + if (++index >= fromIndex) { + return !(result = value === target); + } + }); + } + return result; + } + + /** + * Creates an object composed of keys generated from the results of running + * each element of `collection` through the callback. The corresponding value + * of each key is the number of times the key was returned by the callback. + * The callback is bound to `thisArg` and invoked with three arguments; + * (value, index|key, collection). + * + * If a property name is provided for `callback` the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is provided for `callback` the created "_.where" style callback + * will return `true` for elements that have the properties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @category Collections + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function|Object|string} [callback=identity] The function called + * per iteration. If a property name or object is provided it will be used + * to create a "_.pluck" or "_.where" style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {Object} Returns the composed aggregate object. + * @example + * + * _.countBy([4.3, 6.1, 6.4], function(num) { return Math.floor(num); }); + * // => { '4': 1, '6': 2 } + * + * _.countBy([4.3, 6.1, 6.4], function(num) { return this.floor(num); }, Math); + * // => { '4': 1, '6': 2 } + * + * _.countBy(['one', 'two', 'three'], 'length'); + * // => { '3': 2, '5': 1 } + */ + var countBy = createAggregator(function(result, value, key) { + (hasOwnProperty.call(result, key) ? result[key]++ : result[key] = 1); + }); + + /** + * Checks if the given callback returns truey value for **all** elements of + * a collection. The callback is bound to `thisArg` and invoked with three + * arguments; (value, index|key, collection). + * + * If a property name is provided for `callback` the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is provided for `callback` the created "_.where" style callback + * will return `true` for elements that have the properties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @alias all + * @category Collections + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function|Object|string} [callback=identity] The function called + * per iteration. If a property name or object is provided it will be used + * to create a "_.pluck" or "_.where" style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {boolean} Returns `true` if all elements passed the callback check, + * else `false`. + * @example + * + * _.every([true, 1, null, 'yes']); + * // => false + * + * var characters = [ + * { 'name': 'barney', 'age': 36 }, + * { 'name': 'fred', 'age': 40 } + * ]; + * + * // using "_.pluck" callback shorthand + * _.every(characters, 'age'); + * // => true + * + * // using "_.where" callback shorthand + * _.every(characters, { 'age': 36 }); + * // => false + */ + function every(collection, callback, thisArg) { + var result = true; + callback = lodash.createCallback(callback, thisArg, 3); + + var index = -1, + length = collection ? collection.length : 0; + + if (typeof length == 'number') { + while (++index < length) { + if (!(result = !!callback(collection[index], index, collection))) { + break; + } + } + } else { + forOwn(collection, function(value, index, collection) { + return (result = !!callback(value, index, collection)); + }); + } + return result; + } + + /** + * Iterates over elements of a collection, returning an array of all elements + * the callback returns truey for. The callback is bound to `thisArg` and + * invoked with three arguments; (value, index|key, collection). + * + * If a property name is provided for `callback` the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is provided for `callback` the created "_.where" style callback + * will return `true` for elements that have the properties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @alias select + * @category Collections + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function|Object|string} [callback=identity] The function called + * per iteration. If a property name or object is provided it will be used + * to create a "_.pluck" or "_.where" style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {Array} Returns a new array of elements that passed the callback check. + * @example + * + * var evens = _.filter([1, 2, 3, 4, 5, 6], function(num) { return num % 2 == 0; }); + * // => [2, 4, 6] + * + * var characters = [ + * { 'name': 'barney', 'age': 36, 'blocked': false }, + * { 'name': 'fred', 'age': 40, 'blocked': true } + * ]; + * + * // using "_.pluck" callback shorthand + * _.filter(characters, 'blocked'); + * // => [{ 'name': 'fred', 'age': 40, 'blocked': true }] + * + * // using "_.where" callback shorthand + * _.filter(characters, { 'age': 36 }); + * // => [{ 'name': 'barney', 'age': 36, 'blocked': false }] + */ + function filter(collection, callback, thisArg) { + var result = []; + callback = lodash.createCallback(callback, thisArg, 3); + + var index = -1, + length = collection ? collection.length : 0; + + if (typeof length == 'number') { + while (++index < length) { + var value = collection[index]; + if (callback(value, index, collection)) { + result.push(value); + } + } + } else { + forOwn(collection, function(value, index, collection) { + if (callback(value, index, collection)) { + result.push(value); + } + }); + } + return result; + } + + /** + * Iterates over elements of a collection, returning the first element that + * the callback returns truey for. The callback is bound to `thisArg` and + * invoked with three arguments; (value, index|key, collection). + * + * If a property name is provided for `callback` the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is provided for `callback` the created "_.where" style callback + * will return `true` for elements that have the properties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @alias detect, findWhere + * @category Collections + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function|Object|string} [callback=identity] The function called + * per iteration. If a property name or object is provided it will be used + * to create a "_.pluck" or "_.where" style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {*} Returns the found element, else `undefined`. + * @example + * + * var characters = [ + * { 'name': 'barney', 'age': 36, 'blocked': false }, + * { 'name': 'fred', 'age': 40, 'blocked': true }, + * { 'name': 'pebbles', 'age': 1, 'blocked': false } + * ]; + * + * _.find(characters, function(chr) { + * return chr.age < 40; + * }); + * // => { 'name': 'barney', 'age': 36, 'blocked': false } + * + * // using "_.where" callback shorthand + * _.find(characters, { 'age': 1 }); + * // => { 'name': 'pebbles', 'age': 1, 'blocked': false } + * + * // using "_.pluck" callback shorthand + * _.find(characters, 'blocked'); + * // => { 'name': 'fred', 'age': 40, 'blocked': true } + */ + function find(collection, callback, thisArg) { + callback = lodash.createCallback(callback, thisArg, 3); + + var index = -1, + length = collection ? collection.length : 0; + + if (typeof length == 'number') { + while (++index < length) { + var value = collection[index]; + if (callback(value, index, collection)) { + return value; + } + } + } else { + var result; + forOwn(collection, function(value, index, collection) { + if (callback(value, index, collection)) { + result = value; + return false; + } + }); + return result; + } + } + + /** + * This method is like `_.find` except that it iterates over elements + * of a `collection` from right to left. + * + * @static + * @memberOf _ + * @category Collections + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function|Object|string} [callback=identity] The function called + * per iteration. If a property name or object is provided it will be used + * to create a "_.pluck" or "_.where" style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {*} Returns the found element, else `undefined`. + * @example + * + * _.findLast([1, 2, 3, 4], function(num) { + * return num % 2 == 1; + * }); + * // => 3 + */ + function findLast(collection, callback, thisArg) { + var result; + callback = lodash.createCallback(callback, thisArg, 3); + forEachRight(collection, function(value, index, collection) { + if (callback(value, index, collection)) { + result = value; + return false; + } + }); + return result; + } + + /** + * Iterates over elements of a collection, executing the callback for each + * element. The callback is bound to `thisArg` and invoked with three arguments; + * (value, index|key, collection). Callbacks may exit iteration early by + * explicitly returning `false`. + * + * Note: As with other "Collections" methods, objects with a `length` property + * are iterated like arrays. To avoid this behavior `_.forIn` or `_.forOwn` + * may be used for object iteration. + * + * @static + * @memberOf _ + * @alias each + * @category Collections + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function} [callback=identity] The function called per iteration. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {Array|Object|string} Returns `collection`. + * @example + * + * _([1, 2, 3]).forEach(function(num) { console.log(num); }).join(','); + * // => logs each number and returns '1,2,3' + * + * _.forEach({ 'one': 1, 'two': 2, 'three': 3 }, function(num) { console.log(num); }); + * // => logs each number and returns the object (property order is not guaranteed across environments) + */ + function forEach(collection, callback, thisArg) { + var index = -1, + length = collection ? collection.length : 0; + + callback = callback && typeof thisArg == 'undefined' ? callback : baseCreateCallback(callback, thisArg, 3); + if (typeof length == 'number') { + while (++index < length) { + if (callback(collection[index], index, collection) === false) { + break; + } + } + } else { + forOwn(collection, callback); + } + return collection; + } + + /** + * This method is like `_.forEach` except that it iterates over elements + * of a `collection` from right to left. + * + * @static + * @memberOf _ + * @alias eachRight + * @category Collections + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function} [callback=identity] The function called per iteration. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {Array|Object|string} Returns `collection`. + * @example + * + * _([1, 2, 3]).forEachRight(function(num) { console.log(num); }).join(','); + * // => logs each number from right to left and returns '3,2,1' + */ + function forEachRight(collection, callback, thisArg) { + var length = collection ? collection.length : 0; + callback = callback && typeof thisArg == 'undefined' ? callback : baseCreateCallback(callback, thisArg, 3); + if (typeof length == 'number') { + while (length--) { + if (callback(collection[length], length, collection) === false) { + break; + } + } + } else { + var props = keys(collection); + length = props.length; + forOwn(collection, function(value, key, collection) { + key = props ? props[--length] : --length; + return callback(collection[key], key, collection); + }); + } + return collection; + } + + /** + * Creates an object composed of keys generated from the results of running + * each element of a collection through the callback. The corresponding value + * of each key is an array of the elements responsible for generating the key. + * The callback is bound to `thisArg` and invoked with three arguments; + * (value, index|key, collection). + * + * If a property name is provided for `callback` the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is provided for `callback` the created "_.where" style callback + * will return `true` for elements that have the properties of the given object, + * else `false` + * + * @static + * @memberOf _ + * @category Collections + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function|Object|string} [callback=identity] The function called + * per iteration. If a property name or object is provided it will be used + * to create a "_.pluck" or "_.where" style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {Object} Returns the composed aggregate object. + * @example + * + * _.groupBy([4.2, 6.1, 6.4], function(num) { return Math.floor(num); }); + * // => { '4': [4.2], '6': [6.1, 6.4] } + * + * _.groupBy([4.2, 6.1, 6.4], function(num) { return this.floor(num); }, Math); + * // => { '4': [4.2], '6': [6.1, 6.4] } + * + * // using "_.pluck" callback shorthand + * _.groupBy(['one', 'two', 'three'], 'length'); + * // => { '3': ['one', 'two'], '5': ['three'] } + */ + var groupBy = createAggregator(function(result, value, key) { + (hasOwnProperty.call(result, key) ? result[key] : result[key] = []).push(value); + }); + + /** + * Creates an object composed of keys generated from the results of running + * each element of the collection through the given callback. The corresponding + * value of each key is the last element responsible for generating the key. + * The callback is bound to `thisArg` and invoked with three arguments; + * (value, index|key, collection). + * + * If a property name is provided for `callback` the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is provided for `callback` the created "_.where" style callback + * will return `true` for elements that have the properties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @category Collections + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function|Object|string} [callback=identity] The function called + * per iteration. If a property name or object is provided it will be used + * to create a "_.pluck" or "_.where" style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {Object} Returns the composed aggregate object. + * @example + * + * var keys = [ + * { 'dir': 'left', 'code': 97 }, + * { 'dir': 'right', 'code': 100 } + * ]; + * + * _.indexBy(keys, 'dir'); + * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } } + * + * _.indexBy(keys, function(key) { return String.fromCharCode(key.code); }); + * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } } + * + * _.indexBy(characters, function(key) { this.fromCharCode(key.code); }, String); + * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } } + */ + var indexBy = createAggregator(function(result, value, key) { + result[key] = value; + }); + + /** + * Invokes the method named by `methodName` on each element in the `collection` + * returning an array of the results of each invoked method. Additional arguments + * will be provided to each invoked method. If `methodName` is a function it + * will be invoked for, and `this` bound to, each element in the `collection`. + * + * @static + * @memberOf _ + * @category Collections + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function|string} methodName The name of the method to invoke or + * the function invoked per iteration. + * @param {...*} [arg] Arguments to invoke the method with. + * @returns {Array} Returns a new array of the results of each invoked method. + * @example + * + * _.invoke([[5, 1, 7], [3, 2, 1]], 'sort'); + * // => [[1, 5, 7], [1, 2, 3]] + * + * _.invoke([123, 456], String.prototype.split, ''); + * // => [['1', '2', '3'], ['4', '5', '6']] + */ + function invoke(collection, methodName) { + var args = slice(arguments, 2), + index = -1, + isFunc = typeof methodName == 'function', + length = collection ? collection.length : 0, + result = Array(typeof length == 'number' ? length : 0); + + forEach(collection, function(value) { + result[++index] = (isFunc ? methodName : value[methodName]).apply(value, args); + }); + return result; + } + + /** + * Creates an array of values by running each element in the collection + * through the callback. The callback is bound to `thisArg` and invoked with + * three arguments; (value, index|key, collection). + * + * If a property name is provided for `callback` the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is provided for `callback` the created "_.where" style callback + * will return `true` for elements that have the properties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @alias collect + * @category Collections + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function|Object|string} [callback=identity] The function called + * per iteration. If a property name or object is provided it will be used + * to create a "_.pluck" or "_.where" style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {Array} Returns a new array of the results of each `callback` execution. + * @example + * + * _.map([1, 2, 3], function(num) { return num * 3; }); + * // => [3, 6, 9] + * + * _.map({ 'one': 1, 'two': 2, 'three': 3 }, function(num) { return num * 3; }); + * // => [3, 6, 9] (property order is not guaranteed across environments) + * + * var characters = [ + * { 'name': 'barney', 'age': 36 }, + * { 'name': 'fred', 'age': 40 } + * ]; + * + * // using "_.pluck" callback shorthand + * _.map(characters, 'name'); + * // => ['barney', 'fred'] + */ + function map(collection, callback, thisArg) { + var index = -1, + length = collection ? collection.length : 0; + + callback = lodash.createCallback(callback, thisArg, 3); + if (typeof length == 'number') { + var result = Array(length); + while (++index < length) { + result[index] = callback(collection[index], index, collection); + } + } else { + result = []; + forOwn(collection, function(value, key, collection) { + result[++index] = callback(value, key, collection); + }); + } + return result; + } + + /** + * Retrieves the maximum value of a collection. If the collection is empty or + * falsey `-Infinity` is returned. If a callback is provided it will be executed + * for each value in the collection to generate the criterion by which the value + * is ranked. The callback is bound to `thisArg` and invoked with three + * arguments; (value, index, collection). + * + * If a property name is provided for `callback` the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is provided for `callback` the created "_.where" style callback + * will return `true` for elements that have the properties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @category Collections + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function|Object|string} [callback=identity] The function called + * per iteration. If a property name or object is provided it will be used + * to create a "_.pluck" or "_.where" style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {*} Returns the maximum value. + * @example + * + * _.max([4, 2, 8, 6]); + * // => 8 + * + * var characters = [ + * { 'name': 'barney', 'age': 36 }, + * { 'name': 'fred', 'age': 40 } + * ]; + * + * _.max(characters, function(chr) { return chr.age; }); + * // => { 'name': 'fred', 'age': 40 }; + * + * // using "_.pluck" callback shorthand + * _.max(characters, 'age'); + * // => { 'name': 'fred', 'age': 40 }; + */ + function max(collection, callback, thisArg) { + var computed = -Infinity, + result = computed; + + // allows working with functions like `_.map` without using + // their `index` argument as a callback + if (typeof callback != 'function' && thisArg && thisArg[callback] === collection) { + callback = null; + } + if (callback == null && isArray(collection)) { + var index = -1, + length = collection.length; + + while (++index < length) { + var value = collection[index]; + if (value > result) { + result = value; + } + } + } else { + callback = (callback == null && isString(collection)) + ? charAtCallback + : lodash.createCallback(callback, thisArg, 3); + + forEach(collection, function(value, index, collection) { + var current = callback(value, index, collection); + if (current > computed) { + computed = current; + result = value; + } + }); + } + return result; + } + + /** + * Retrieves the minimum value of a collection. If the collection is empty or + * falsey `Infinity` is returned. If a callback is provided it will be executed + * for each value in the collection to generate the criterion by which the value + * is ranked. The callback is bound to `thisArg` and invoked with three + * arguments; (value, index, collection). + * + * If a property name is provided for `callback` the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is provided for `callback` the created "_.where" style callback + * will return `true` for elements that have the properties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @category Collections + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function|Object|string} [callback=identity] The function called + * per iteration. If a property name or object is provided it will be used + * to create a "_.pluck" or "_.where" style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {*} Returns the minimum value. + * @example + * + * _.min([4, 2, 8, 6]); + * // => 2 + * + * var characters = [ + * { 'name': 'barney', 'age': 36 }, + * { 'name': 'fred', 'age': 40 } + * ]; + * + * _.min(characters, function(chr) { return chr.age; }); + * // => { 'name': 'barney', 'age': 36 }; + * + * // using "_.pluck" callback shorthand + * _.min(characters, 'age'); + * // => { 'name': 'barney', 'age': 36 }; + */ + function min(collection, callback, thisArg) { + var computed = Infinity, + result = computed; + + // allows working with functions like `_.map` without using + // their `index` argument as a callback + if (typeof callback != 'function' && thisArg && thisArg[callback] === collection) { + callback = null; + } + if (callback == null && isArray(collection)) { + var index = -1, + length = collection.length; + + while (++index < length) { + var value = collection[index]; + if (value < result) { + result = value; + } + } + } else { + callback = (callback == null && isString(collection)) + ? charAtCallback + : lodash.createCallback(callback, thisArg, 3); + + forEach(collection, function(value, index, collection) { + var current = callback(value, index, collection); + if (current < computed) { + computed = current; + result = value; + } + }); + } + return result; + } + + /** + * Retrieves the value of a specified property from all elements in the collection. + * + * @static + * @memberOf _ + * @type Function + * @category Collections + * @param {Array|Object|string} collection The collection to iterate over. + * @param {string} property The name of the property to pluck. + * @returns {Array} Returns a new array of property values. + * @example + * + * var characters = [ + * { 'name': 'barney', 'age': 36 }, + * { 'name': 'fred', 'age': 40 } + * ]; + * + * _.pluck(characters, 'name'); + * // => ['barney', 'fred'] + */ + var pluck = map; + + /** + * Reduces a collection to a value which is the accumulated result of running + * each element in the collection through the callback, where each successive + * callback execution consumes the return value of the previous execution. If + * `accumulator` is not provided the first element of the collection will be + * used as the initial `accumulator` value. The callback is bound to `thisArg` + * and invoked with four arguments; (accumulator, value, index|key, collection). + * + * @static + * @memberOf _ + * @alias foldl, inject + * @category Collections + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function} [callback=identity] The function called per iteration. + * @param {*} [accumulator] Initial value of the accumulator. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {*} Returns the accumulated value. + * @example + * + * var sum = _.reduce([1, 2, 3], function(sum, num) { + * return sum + num; + * }); + * // => 6 + * + * var mapped = _.reduce({ 'a': 1, 'b': 2, 'c': 3 }, function(result, num, key) { + * result[key] = num * 3; + * return result; + * }, {}); + * // => { 'a': 3, 'b': 6, 'c': 9 } + */ + function reduce(collection, callback, accumulator, thisArg) { + if (!collection) return accumulator; + var noaccum = arguments.length < 3; + callback = lodash.createCallback(callback, thisArg, 4); + + var index = -1, + length = collection.length; + + if (typeof length == 'number') { + if (noaccum) { + accumulator = collection[++index]; + } + while (++index < length) { + accumulator = callback(accumulator, collection[index], index, collection); + } + } else { + forOwn(collection, function(value, index, collection) { + accumulator = noaccum + ? (noaccum = false, value) + : callback(accumulator, value, index, collection) + }); + } + return accumulator; + } + + /** + * This method is like `_.reduce` except that it iterates over elements + * of a `collection` from right to left. + * + * @static + * @memberOf _ + * @alias foldr + * @category Collections + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function} [callback=identity] The function called per iteration. + * @param {*} [accumulator] Initial value of the accumulator. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {*} Returns the accumulated value. + * @example + * + * var list = [[0, 1], [2, 3], [4, 5]]; + * var flat = _.reduceRight(list, function(a, b) { return a.concat(b); }, []); + * // => [4, 5, 2, 3, 0, 1] + */ + function reduceRight(collection, callback, accumulator, thisArg) { + var noaccum = arguments.length < 3; + callback = lodash.createCallback(callback, thisArg, 4); + forEachRight(collection, function(value, index, collection) { + accumulator = noaccum + ? (noaccum = false, value) + : callback(accumulator, value, index, collection); + }); + return accumulator; + } + + /** + * The opposite of `_.filter` this method returns the elements of a + * collection that the callback does **not** return truey for. + * + * If a property name is provided for `callback` the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is provided for `callback` the created "_.where" style callback + * will return `true` for elements that have the properties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @category Collections + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function|Object|string} [callback=identity] The function called + * per iteration. If a property name or object is provided it will be used + * to create a "_.pluck" or "_.where" style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {Array} Returns a new array of elements that failed the callback check. + * @example + * + * var odds = _.reject([1, 2, 3, 4, 5, 6], function(num) { return num % 2 == 0; }); + * // => [1, 3, 5] + * + * var characters = [ + * { 'name': 'barney', 'age': 36, 'blocked': false }, + * { 'name': 'fred', 'age': 40, 'blocked': true } + * ]; + * + * // using "_.pluck" callback shorthand + * _.reject(characters, 'blocked'); + * // => [{ 'name': 'barney', 'age': 36, 'blocked': false }] + * + * // using "_.where" callback shorthand + * _.reject(characters, { 'age': 36 }); + * // => [{ 'name': 'fred', 'age': 40, 'blocked': true }] + */ + function reject(collection, callback, thisArg) { + callback = lodash.createCallback(callback, thisArg, 3); + return filter(collection, function(value, index, collection) { + return !callback(value, index, collection); + }); + } + + /** + * Retrieves a random element or `n` random elements from a collection. + * + * @static + * @memberOf _ + * @category Collections + * @param {Array|Object|string} collection The collection to sample. + * @param {number} [n] The number of elements to sample. + * @param- {Object} [guard] Allows working with functions like `_.map` + * without using their `index` arguments as `n`. + * @returns {Array} Returns the random sample(s) of `collection`. + * @example + * + * _.sample([1, 2, 3, 4]); + * // => 2 + * + * _.sample([1, 2, 3, 4], 2); + * // => [3, 1] + */ + function sample(collection, n, guard) { + if (collection && typeof collection.length != 'number') { + collection = values(collection); + } + if (n == null || guard) { + return collection ? collection[baseRandom(0, collection.length - 1)] : undefined; + } + var result = shuffle(collection); + result.length = nativeMin(nativeMax(0, n), result.length); + return result; + } + + /** + * Creates an array of shuffled values, using a version of the Fisher-Yates + * shuffle. See http://en.wikipedia.org/wiki/Fisher-Yates_shuffle. + * + * @static + * @memberOf _ + * @category Collections + * @param {Array|Object|string} collection The collection to shuffle. + * @returns {Array} Returns a new shuffled collection. + * @example + * + * _.shuffle([1, 2, 3, 4, 5, 6]); + * // => [4, 1, 6, 3, 5, 2] + */ + function shuffle(collection) { + var index = -1, + length = collection ? collection.length : 0, + result = Array(typeof length == 'number' ? length : 0); + + forEach(collection, function(value) { + var rand = baseRandom(0, ++index); + result[index] = result[rand]; + result[rand] = value; + }); + return result; + } + + /** + * Gets the size of the `collection` by returning `collection.length` for arrays + * and array-like objects or the number of own enumerable properties for objects. + * + * @static + * @memberOf _ + * @category Collections + * @param {Array|Object|string} collection The collection to inspect. + * @returns {number} Returns `collection.length` or number of own enumerable properties. + * @example + * + * _.size([1, 2]); + * // => 2 + * + * _.size({ 'one': 1, 'two': 2, 'three': 3 }); + * // => 3 + * + * _.size('pebbles'); + * // => 7 + */ + function size(collection) { + var length = collection ? collection.length : 0; + return typeof length == 'number' ? length : keys(collection).length; + } + + /** + * Checks if the callback returns a truey value for **any** element of a + * collection. The function returns as soon as it finds a passing value and + * does not iterate over the entire collection. The callback is bound to + * `thisArg` and invoked with three arguments; (value, index|key, collection). + * + * If a property name is provided for `callback` the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is provided for `callback` the created "_.where" style callback + * will return `true` for elements that have the properties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @alias any + * @category Collections + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Function|Object|string} [callback=identity] The function called + * per iteration. If a property name or object is provided it will be used + * to create a "_.pluck" or "_.where" style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {boolean} Returns `true` if any element passed the callback check, + * else `false`. + * @example + * + * _.some([null, 0, 'yes', false], Boolean); + * // => true + * + * var characters = [ + * { 'name': 'barney', 'age': 36, 'blocked': false }, + * { 'name': 'fred', 'age': 40, 'blocked': true } + * ]; + * + * // using "_.pluck" callback shorthand + * _.some(characters, 'blocked'); + * // => true + * + * // using "_.where" callback shorthand + * _.some(characters, { 'age': 1 }); + * // => false + */ + function some(collection, callback, thisArg) { + var result; + callback = lodash.createCallback(callback, thisArg, 3); + + var index = -1, + length = collection ? collection.length : 0; + + if (typeof length == 'number') { + while (++index < length) { + if ((result = callback(collection[index], index, collection))) { + break; + } + } + } else { + forOwn(collection, function(value, index, collection) { + return !(result = callback(value, index, collection)); + }); + } + return !!result; + } + + /** + * Creates an array of elements, sorted in ascending order by the results of + * running each element in a collection through the callback. This method + * performs a stable sort, that is, it will preserve the original sort order + * of equal elements. The callback is bound to `thisArg` and invoked with + * three arguments; (value, index|key, collection). + * + * If a property name is provided for `callback` the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an array of property names is provided for `callback` the collection + * will be sorted by each property value. + * + * If an object is provided for `callback` the created "_.where" style callback + * will return `true` for elements that have the properties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @category Collections + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Array|Function|Object|string} [callback=identity] The function called + * per iteration. If a property name or object is provided it will be used + * to create a "_.pluck" or "_.where" style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {Array} Returns a new array of sorted elements. + * @example + * + * _.sortBy([1, 2, 3], function(num) { return Math.sin(num); }); + * // => [3, 1, 2] + * + * _.sortBy([1, 2, 3], function(num) { return this.sin(num); }, Math); + * // => [3, 1, 2] + * + * var characters = [ + * { 'name': 'barney', 'age': 36 }, + * { 'name': 'fred', 'age': 40 }, + * { 'name': 'barney', 'age': 26 }, + * { 'name': 'fred', 'age': 30 } + * ]; + * + * // using "_.pluck" callback shorthand + * _.map(_.sortBy(characters, 'age'), _.values); + * // => [['barney', 26], ['fred', 30], ['barney', 36], ['fred', 40]] + * + * // sorting by multiple properties + * _.map(_.sortBy(characters, ['name', 'age']), _.values); + * // = > [['barney', 26], ['barney', 36], ['fred', 30], ['fred', 40]] + */ + function sortBy(collection, callback, thisArg) { + var index = -1, + isArr = isArray(callback), + length = collection ? collection.length : 0, + result = Array(typeof length == 'number' ? length : 0); + + if (!isArr) { + callback = lodash.createCallback(callback, thisArg, 3); + } + forEach(collection, function(value, key, collection) { + var object = result[++index] = getObject(); + if (isArr) { + object.criteria = map(callback, function(key) { return value[key]; }); + } else { + (object.criteria = getArray())[0] = callback(value, key, collection); + } + object.index = index; + object.value = value; + }); + + length = result.length; + result.sort(compareAscending); + while (length--) { + var object = result[length]; + result[length] = object.value; + if (!isArr) { + releaseArray(object.criteria); + } + releaseObject(object); + } + return result; + } + + /** + * Converts the `collection` to an array. + * + * @static + * @memberOf _ + * @category Collections + * @param {Array|Object|string} collection The collection to convert. + * @returns {Array} Returns the new converted array. + * @example + * + * (function() { return _.toArray(arguments).slice(1); })(1, 2, 3, 4); + * // => [2, 3, 4] + */ + function toArray(collection) { + if (collection && typeof collection.length == 'number') { + return slice(collection); + } + return values(collection); + } + + /** + * Performs a deep comparison of each element in a `collection` to the given + * `properties` object, returning an array of all elements that have equivalent + * property values. + * + * @static + * @memberOf _ + * @type Function + * @category Collections + * @param {Array|Object|string} collection The collection to iterate over. + * @param {Object} props The object of property values to filter by. + * @returns {Array} Returns a new array of elements that have the given properties. + * @example + * + * var characters = [ + * { 'name': 'barney', 'age': 36, 'pets': ['hoppy'] }, + * { 'name': 'fred', 'age': 40, 'pets': ['baby puss', 'dino'] } + * ]; + * + * _.where(characters, { 'age': 36 }); + * // => [{ 'name': 'barney', 'age': 36, 'pets': ['hoppy'] }] + * + * _.where(characters, { 'pets': ['dino'] }); + * // => [{ 'name': 'fred', 'age': 40, 'pets': ['baby puss', 'dino'] }] + */ + var where = filter; + + /*--------------------------------------------------------------------------*/ + + /** + * Creates an array with all falsey values removed. The values `false`, `null`, + * `0`, `""`, `undefined`, and `NaN` are all falsey. + * + * @static + * @memberOf _ + * @category Arrays + * @param {Array} array The array to compact. + * @returns {Array} Returns a new array of filtered values. + * @example + * + * _.compact([0, 1, false, 2, '', 3]); + * // => [1, 2, 3] + */ + function compact(array) { + var index = -1, + length = array ? array.length : 0, + result = []; + + while (++index < length) { + var value = array[index]; + if (value) { + result.push(value); + } + } + return result; + } + + /** + * Creates an array excluding all values of the provided arrays using strict + * equality for comparisons, i.e. `===`. + * + * @static + * @memberOf _ + * @category Arrays + * @param {Array} array The array to process. + * @param {...Array} [values] The arrays of values to exclude. + * @returns {Array} Returns a new array of filtered values. + * @example + * + * _.difference([1, 2, 3, 4, 5], [5, 2, 10]); + * // => [1, 3, 4] + */ + function difference(array) { + return baseDifference(array, baseFlatten(arguments, true, true, 1)); + } + + /** + * This method is like `_.find` except that it returns the index of the first + * element that passes the callback check, instead of the element itself. + * + * If a property name is provided for `callback` the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is provided for `callback` the created "_.where" style callback + * will return `true` for elements that have the properties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @category Arrays + * @param {Array} array The array to search. + * @param {Function|Object|string} [callback=identity] The function called + * per iteration. If a property name or object is provided it will be used + * to create a "_.pluck" or "_.where" style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {number} Returns the index of the found element, else `-1`. + * @example + * + * var characters = [ + * { 'name': 'barney', 'age': 36, 'blocked': false }, + * { 'name': 'fred', 'age': 40, 'blocked': true }, + * { 'name': 'pebbles', 'age': 1, 'blocked': false } + * ]; + * + * _.findIndex(characters, function(chr) { + * return chr.age < 20; + * }); + * // => 2 + * + * // using "_.where" callback shorthand + * _.findIndex(characters, { 'age': 36 }); + * // => 0 + * + * // using "_.pluck" callback shorthand + * _.findIndex(characters, 'blocked'); + * // => 1 + */ + function findIndex(array, callback, thisArg) { + var index = -1, + length = array ? array.length : 0; + + callback = lodash.createCallback(callback, thisArg, 3); + while (++index < length) { + if (callback(array[index], index, array)) { + return index; + } + } + return -1; + } + + /** + * This method is like `_.findIndex` except that it iterates over elements + * of a `collection` from right to left. + * + * If a property name is provided for `callback` the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is provided for `callback` the created "_.where" style callback + * will return `true` for elements that have the properties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @category Arrays + * @param {Array} array The array to search. + * @param {Function|Object|string} [callback=identity] The function called + * per iteration. If a property name or object is provided it will be used + * to create a "_.pluck" or "_.where" style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {number} Returns the index of the found element, else `-1`. + * @example + * + * var characters = [ + * { 'name': 'barney', 'age': 36, 'blocked': true }, + * { 'name': 'fred', 'age': 40, 'blocked': false }, + * { 'name': 'pebbles', 'age': 1, 'blocked': true } + * ]; + * + * _.findLastIndex(characters, function(chr) { + * return chr.age > 30; + * }); + * // => 1 + * + * // using "_.where" callback shorthand + * _.findLastIndex(characters, { 'age': 36 }); + * // => 0 + * + * // using "_.pluck" callback shorthand + * _.findLastIndex(characters, 'blocked'); + * // => 2 + */ + function findLastIndex(array, callback, thisArg) { + var length = array ? array.length : 0; + callback = lodash.createCallback(callback, thisArg, 3); + while (length--) { + if (callback(array[length], length, array)) { + return length; + } + } + return -1; + } + + /** + * Gets the first element or first `n` elements of an array. If a callback + * is provided elements at the beginning of the array are returned as long + * as the callback returns truey. The callback is bound to `thisArg` and + * invoked with three arguments; (value, index, array). + * + * If a property name is provided for `callback` the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is provided for `callback` the created "_.where" style callback + * will return `true` for elements that have the properties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @alias head, take + * @category Arrays + * @param {Array} array The array to query. + * @param {Function|Object|number|string} [callback] The function called + * per element or the number of elements to return. If a property name or + * object is provided it will be used to create a "_.pluck" or "_.where" + * style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {*} Returns the first element(s) of `array`. + * @example + * + * _.first([1, 2, 3]); + * // => 1 + * + * _.first([1, 2, 3], 2); + * // => [1, 2] + * + * _.first([1, 2, 3], function(num) { + * return num < 3; + * }); + * // => [1, 2] + * + * var characters = [ + * { 'name': 'barney', 'blocked': true, 'employer': 'slate' }, + * { 'name': 'fred', 'blocked': false, 'employer': 'slate' }, + * { 'name': 'pebbles', 'blocked': true, 'employer': 'na' } + * ]; + * + * // using "_.pluck" callback shorthand + * _.first(characters, 'blocked'); + * // => [{ 'name': 'barney', 'blocked': true, 'employer': 'slate' }] + * + * // using "_.where" callback shorthand + * _.pluck(_.first(characters, { 'employer': 'slate' }), 'name'); + * // => ['barney', 'fred'] + */ + function first(array, callback, thisArg) { + var n = 0, + length = array ? array.length : 0; + + if (typeof callback != 'number' && callback != null) { + var index = -1; + callback = lodash.createCallback(callback, thisArg, 3); + while (++index < length && callback(array[index], index, array)) { + n++; + } + } else { + n = callback; + if (n == null || thisArg) { + return array ? array[0] : undefined; + } + } + return slice(array, 0, nativeMin(nativeMax(0, n), length)); + } + + /** + * Flattens a nested array (the nesting can be to any depth). If `isShallow` + * is truey, the array will only be flattened a single level. If a callback + * is provided each element of the array is passed through the callback before + * flattening. The callback is bound to `thisArg` and invoked with three + * arguments; (value, index, array). + * + * If a property name is provided for `callback` the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is provided for `callback` the created "_.where" style callback + * will return `true` for elements that have the properties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @category Arrays + * @param {Array} array The array to flatten. + * @param {boolean} [isShallow=false] A flag to restrict flattening to a single level. + * @param {Function|Object|string} [callback=identity] The function called + * per iteration. If a property name or object is provided it will be used + * to create a "_.pluck" or "_.where" style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {Array} Returns a new flattened array. + * @example + * + * _.flatten([1, [2], [3, [[4]]]]); + * // => [1, 2, 3, 4]; + * + * _.flatten([1, [2], [3, [[4]]]], true); + * // => [1, 2, 3, [[4]]]; + * + * var characters = [ + * { 'name': 'barney', 'age': 30, 'pets': ['hoppy'] }, + * { 'name': 'fred', 'age': 40, 'pets': ['baby puss', 'dino'] } + * ]; + * + * // using "_.pluck" callback shorthand + * _.flatten(characters, 'pets'); + * // => ['hoppy', 'baby puss', 'dino'] + */ + function flatten(array, isShallow, callback, thisArg) { + // juggle arguments + if (typeof isShallow != 'boolean' && isShallow != null) { + thisArg = callback; + callback = (typeof isShallow != 'function' && thisArg && thisArg[isShallow] === array) ? null : isShallow; + isShallow = false; + } + if (callback != null) { + array = map(array, callback, thisArg); + } + return baseFlatten(array, isShallow); + } + + /** + * Gets the index at which the first occurrence of `value` is found using + * strict equality for comparisons, i.e. `===`. If the array is already sorted + * providing `true` for `fromIndex` will run a faster binary search. + * + * @static + * @memberOf _ + * @category Arrays + * @param {Array} array The array to search. + * @param {*} value The value to search for. + * @param {boolean|number} [fromIndex=0] The index to search from or `true` + * to perform a binary search on a sorted array. + * @returns {number} Returns the index of the matched value or `-1`. + * @example + * + * _.indexOf([1, 2, 3, 1, 2, 3], 2); + * // => 1 + * + * _.indexOf([1, 2, 3, 1, 2, 3], 2, 3); + * // => 4 + * + * _.indexOf([1, 1, 2, 2, 3, 3], 2, true); + * // => 2 + */ + function indexOf(array, value, fromIndex) { + if (typeof fromIndex == 'number') { + var length = array ? array.length : 0; + fromIndex = (fromIndex < 0 ? nativeMax(0, length + fromIndex) : fromIndex || 0); + } else if (fromIndex) { + var index = sortedIndex(array, value); + return array[index] === value ? index : -1; + } + return baseIndexOf(array, value, fromIndex); + } + + /** + * Gets all but the last element or last `n` elements of an array. If a + * callback is provided elements at the end of the array are excluded from + * the result as long as the callback returns truey. The callback is bound + * to `thisArg` and invoked with three arguments; (value, index, array). + * + * If a property name is provided for `callback` the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is provided for `callback` the created "_.where" style callback + * will return `true` for elements that have the properties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @category Arrays + * @param {Array} array The array to query. + * @param {Function|Object|number|string} [callback=1] The function called + * per element or the number of elements to exclude. If a property name or + * object is provided it will be used to create a "_.pluck" or "_.where" + * style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {Array} Returns a slice of `array`. + * @example + * + * _.initial([1, 2, 3]); + * // => [1, 2] + * + * _.initial([1, 2, 3], 2); + * // => [1] + * + * _.initial([1, 2, 3], function(num) { + * return num > 1; + * }); + * // => [1] + * + * var characters = [ + * { 'name': 'barney', 'blocked': false, 'employer': 'slate' }, + * { 'name': 'fred', 'blocked': true, 'employer': 'slate' }, + * { 'name': 'pebbles', 'blocked': true, 'employer': 'na' } + * ]; + * + * // using "_.pluck" callback shorthand + * _.initial(characters, 'blocked'); + * // => [{ 'name': 'barney', 'blocked': false, 'employer': 'slate' }] + * + * // using "_.where" callback shorthand + * _.pluck(_.initial(characters, { 'employer': 'na' }), 'name'); + * // => ['barney', 'fred'] + */ + function initial(array, callback, thisArg) { + var n = 0, + length = array ? array.length : 0; + + if (typeof callback != 'number' && callback != null) { + var index = length; + callback = lodash.createCallback(callback, thisArg, 3); + while (index-- && callback(array[index], index, array)) { + n++; + } + } else { + n = (callback == null || thisArg) ? 1 : callback || n; + } + return slice(array, 0, nativeMin(nativeMax(0, length - n), length)); + } + + /** + * Creates an array of unique values present in all provided arrays using + * strict equality for comparisons, i.e. `===`. + * + * @static + * @memberOf _ + * @category Arrays + * @param {...Array} [array] The arrays to inspect. + * @returns {Array} Returns an array of shared values. + * @example + * + * _.intersection([1, 2, 3], [5, 2, 1, 4], [2, 1]); + * // => [1, 2] + */ + function intersection() { + var args = [], + argsIndex = -1, + argsLength = arguments.length, + caches = getArray(), + indexOf = getIndexOf(), + trustIndexOf = indexOf === baseIndexOf, + seen = getArray(); + + while (++argsIndex < argsLength) { + var value = arguments[argsIndex]; + if (isArray(value) || isArguments(value)) { + args.push(value); + caches.push(trustIndexOf && value.length >= largeArraySize && + createCache(argsIndex ? args[argsIndex] : seen)); + } + } + var array = args[0], + index = -1, + length = array ? array.length : 0, + result = []; + + outer: + while (++index < length) { + var cache = caches[0]; + value = array[index]; + + if ((cache ? cacheIndexOf(cache, value) : indexOf(seen, value)) < 0) { + argsIndex = argsLength; + (cache || seen).push(value); + while (--argsIndex) { + cache = caches[argsIndex]; + if ((cache ? cacheIndexOf(cache, value) : indexOf(args[argsIndex], value)) < 0) { + continue outer; + } + } + result.push(value); + } + } + while (argsLength--) { + cache = caches[argsLength]; + if (cache) { + releaseObject(cache); + } + } + releaseArray(caches); + releaseArray(seen); + return result; + } + + /** + * Gets the last element or last `n` elements of an array. If a callback is + * provided elements at the end of the array are returned as long as the + * callback returns truey. The callback is bound to `thisArg` and invoked + * with three arguments; (value, index, array). + * + * If a property name is provided for `callback` the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is provided for `callback` the created "_.where" style callback + * will return `true` for elements that have the properties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @category Arrays + * @param {Array} array The array to query. + * @param {Function|Object|number|string} [callback] The function called + * per element or the number of elements to return. If a property name or + * object is provided it will be used to create a "_.pluck" or "_.where" + * style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {*} Returns the last element(s) of `array`. + * @example + * + * _.last([1, 2, 3]); + * // => 3 + * + * _.last([1, 2, 3], 2); + * // => [2, 3] + * + * _.last([1, 2, 3], function(num) { + * return num > 1; + * }); + * // => [2, 3] + * + * var characters = [ + * { 'name': 'barney', 'blocked': false, 'employer': 'slate' }, + * { 'name': 'fred', 'blocked': true, 'employer': 'slate' }, + * { 'name': 'pebbles', 'blocked': true, 'employer': 'na' } + * ]; + * + * // using "_.pluck" callback shorthand + * _.pluck(_.last(characters, 'blocked'), 'name'); + * // => ['fred', 'pebbles'] + * + * // using "_.where" callback shorthand + * _.last(characters, { 'employer': 'na' }); + * // => [{ 'name': 'pebbles', 'blocked': true, 'employer': 'na' }] + */ + function last(array, callback, thisArg) { + var n = 0, + length = array ? array.length : 0; + + if (typeof callback != 'number' && callback != null) { + var index = length; + callback = lodash.createCallback(callback, thisArg, 3); + while (index-- && callback(array[index], index, array)) { + n++; + } + } else { + n = callback; + if (n == null || thisArg) { + return array ? array[length - 1] : undefined; + } + } + return slice(array, nativeMax(0, length - n)); + } + + /** + * Gets the index at which the last occurrence of `value` is found using strict + * equality for comparisons, i.e. `===`. If `fromIndex` is negative, it is used + * as the offset from the end of the collection. + * + * If a property name is provided for `callback` the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is provided for `callback` the created "_.where" style callback + * will return `true` for elements that have the properties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @category Arrays + * @param {Array} array The array to search. + * @param {*} value The value to search for. + * @param {number} [fromIndex=array.length-1] The index to search from. + * @returns {number} Returns the index of the matched value or `-1`. + * @example + * + * _.lastIndexOf([1, 2, 3, 1, 2, 3], 2); + * // => 4 + * + * _.lastIndexOf([1, 2, 3, 1, 2, 3], 2, 3); + * // => 1 + */ + function lastIndexOf(array, value, fromIndex) { + var index = array ? array.length : 0; + if (typeof fromIndex == 'number') { + index = (fromIndex < 0 ? nativeMax(0, index + fromIndex) : nativeMin(fromIndex, index - 1)) + 1; + } + while (index--) { + if (array[index] === value) { + return index; + } + } + return -1; + } + + /** + * Removes all provided values from the given array using strict equality for + * comparisons, i.e. `===`. + * + * @static + * @memberOf _ + * @category Arrays + * @param {Array} array The array to modify. + * @param {...*} [value] The values to remove. + * @returns {Array} Returns `array`. + * @example + * + * var array = [1, 2, 3, 1, 2, 3]; + * _.pull(array, 2, 3); + * console.log(array); + * // => [1, 1] + */ + function pull(array) { + var args = arguments, + argsIndex = 0, + argsLength = args.length, + length = array ? array.length : 0; + + while (++argsIndex < argsLength) { + var index = -1, + value = args[argsIndex]; + while (++index < length) { + if (array[index] === value) { + splice.call(array, index--, 1); + length--; + } + } + } + return array; + } + + /** + * Creates an array of numbers (positive and/or negative) progressing from + * `start` up to but not including `end`. If `start` is less than `stop` a + * zero-length range is created unless a negative `step` is specified. + * + * @static + * @memberOf _ + * @category Arrays + * @param {number} [start=0] The start of the range. + * @param {number} end The end of the range. + * @param {number} [step=1] The value to increment or decrement by. + * @returns {Array} Returns a new range array. + * @example + * + * _.range(4); + * // => [0, 1, 2, 3] + * + * _.range(1, 5); + * // => [1, 2, 3, 4] + * + * _.range(0, 20, 5); + * // => [0, 5, 10, 15] + * + * _.range(0, -4, -1); + * // => [0, -1, -2, -3] + * + * _.range(1, 4, 0); + * // => [1, 1, 1] + * + * _.range(0); + * // => [] + */ + function range(start, end, step) { + start = +start || 0; + step = typeof step == 'number' ? step : (+step || 1); + + if (end == null) { + end = start; + start = 0; + } + // use `Array(length)` so engines like Chakra and V8 avoid slower modes + // http://youtu.be/XAqIpGU8ZZk#t=17m25s + var index = -1, + length = nativeMax(0, ceil((end - start) / (step || 1))), + result = Array(length); + + while (++index < length) { + result[index] = start; + start += step; + } + return result; + } + + /** + * Removes all elements from an array that the callback returns truey for + * and returns an array of removed elements. The callback is bound to `thisArg` + * and invoked with three arguments; (value, index, array). + * + * If a property name is provided for `callback` the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is provided for `callback` the created "_.where" style callback + * will return `true` for elements that have the properties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @category Arrays + * @param {Array} array The array to modify. + * @param {Function|Object|string} [callback=identity] The function called + * per iteration. If a property name or object is provided it will be used + * to create a "_.pluck" or "_.where" style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {Array} Returns a new array of removed elements. + * @example + * + * var array = [1, 2, 3, 4, 5, 6]; + * var evens = _.remove(array, function(num) { return num % 2 == 0; }); + * + * console.log(array); + * // => [1, 3, 5] + * + * console.log(evens); + * // => [2, 4, 6] + */ + function remove(array, callback, thisArg) { + var index = -1, + length = array ? array.length : 0, + result = []; + + callback = lodash.createCallback(callback, thisArg, 3); + while (++index < length) { + var value = array[index]; + if (callback(value, index, array)) { + result.push(value); + splice.call(array, index--, 1); + length--; + } + } + return result; + } + + /** + * The opposite of `_.initial` this method gets all but the first element or + * first `n` elements of an array. If a callback function is provided elements + * at the beginning of the array are excluded from the result as long as the + * callback returns truey. The callback is bound to `thisArg` and invoked + * with three arguments; (value, index, array). + * + * If a property name is provided for `callback` the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is provided for `callback` the created "_.where" style callback + * will return `true` for elements that have the properties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @alias drop, tail + * @category Arrays + * @param {Array} array The array to query. + * @param {Function|Object|number|string} [callback=1] The function called + * per element or the number of elements to exclude. If a property name or + * object is provided it will be used to create a "_.pluck" or "_.where" + * style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {Array} Returns a slice of `array`. + * @example + * + * _.rest([1, 2, 3]); + * // => [2, 3] + * + * _.rest([1, 2, 3], 2); + * // => [3] + * + * _.rest([1, 2, 3], function(num) { + * return num < 3; + * }); + * // => [3] + * + * var characters = [ + * { 'name': 'barney', 'blocked': true, 'employer': 'slate' }, + * { 'name': 'fred', 'blocked': false, 'employer': 'slate' }, + * { 'name': 'pebbles', 'blocked': true, 'employer': 'na' } + * ]; + * + * // using "_.pluck" callback shorthand + * _.pluck(_.rest(characters, 'blocked'), 'name'); + * // => ['fred', 'pebbles'] + * + * // using "_.where" callback shorthand + * _.rest(characters, { 'employer': 'slate' }); + * // => [{ 'name': 'pebbles', 'blocked': true, 'employer': 'na' }] + */ + function rest(array, callback, thisArg) { + if (typeof callback != 'number' && callback != null) { + var n = 0, + index = -1, + length = array ? array.length : 0; + + callback = lodash.createCallback(callback, thisArg, 3); + while (++index < length && callback(array[index], index, array)) { + n++; + } + } else { + n = (callback == null || thisArg) ? 1 : nativeMax(0, callback); + } + return slice(array, n); + } + + /** + * Uses a binary search to determine the smallest index at which a value + * should be inserted into a given sorted array in order to maintain the sort + * order of the array. If a callback is provided it will be executed for + * `value` and each element of `array` to compute their sort ranking. The + * callback is bound to `thisArg` and invoked with one argument; (value). + * + * If a property name is provided for `callback` the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is provided for `callback` the created "_.where" style callback + * will return `true` for elements that have the properties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @category Arrays + * @param {Array} array The array to inspect. + * @param {*} value The value to evaluate. + * @param {Function|Object|string} [callback=identity] The function called + * per iteration. If a property name or object is provided it will be used + * to create a "_.pluck" or "_.where" style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. + * @example + * + * _.sortedIndex([20, 30, 50], 40); + * // => 2 + * + * // using "_.pluck" callback shorthand + * _.sortedIndex([{ 'x': 20 }, { 'x': 30 }, { 'x': 50 }], { 'x': 40 }, 'x'); + * // => 2 + * + * var dict = { + * 'wordToNumber': { 'twenty': 20, 'thirty': 30, 'fourty': 40, 'fifty': 50 } + * }; + * + * _.sortedIndex(['twenty', 'thirty', 'fifty'], 'fourty', function(word) { + * return dict.wordToNumber[word]; + * }); + * // => 2 + * + * _.sortedIndex(['twenty', 'thirty', 'fifty'], 'fourty', function(word) { + * return this.wordToNumber[word]; + * }, dict); + * // => 2 + */ + function sortedIndex(array, value, callback, thisArg) { + var low = 0, + high = array ? array.length : low; + + // explicitly reference `identity` for better inlining in Firefox + callback = callback ? lodash.createCallback(callback, thisArg, 1) : identity; + value = callback(value); + + while (low < high) { + var mid = (low + high) >>> 1; + (callback(array[mid]) < value) + ? low = mid + 1 + : high = mid; + } + return low; + } + + /** + * Creates an array of unique values, in order, of the provided arrays using + * strict equality for comparisons, i.e. `===`. + * + * @static + * @memberOf _ + * @category Arrays + * @param {...Array} [array] The arrays to inspect. + * @returns {Array} Returns an array of combined values. + * @example + * + * _.union([1, 2, 3], [5, 2, 1, 4], [2, 1]); + * // => [1, 2, 3, 5, 4] + */ + function union() { + return baseUniq(baseFlatten(arguments, true, true)); + } + + /** + * Creates a duplicate-value-free version of an array using strict equality + * for comparisons, i.e. `===`. If the array is sorted, providing + * `true` for `isSorted` will use a faster algorithm. If a callback is provided + * each element of `array` is passed through the callback before uniqueness + * is computed. The callback is bound to `thisArg` and invoked with three + * arguments; (value, index, array). + * + * If a property name is provided for `callback` the created "_.pluck" style + * callback will return the property value of the given element. + * + * If an object is provided for `callback` the created "_.where" style callback + * will return `true` for elements that have the properties of the given object, + * else `false`. + * + * @static + * @memberOf _ + * @alias unique + * @category Arrays + * @param {Array} array The array to process. + * @param {boolean} [isSorted=false] A flag to indicate that `array` is sorted. + * @param {Function|Object|string} [callback=identity] The function called + * per iteration. If a property name or object is provided it will be used + * to create a "_.pluck" or "_.where" style callback, respectively. + * @param {*} [thisArg] The `this` binding of `callback`. + * @returns {Array} Returns a duplicate-value-free array. + * @example + * + * _.uniq([1, 2, 1, 3, 1]); + * // => [1, 2, 3] + * + * _.uniq([1, 1, 2, 2, 3], true); + * // => [1, 2, 3] + * + * _.uniq(['A', 'b', 'C', 'a', 'B', 'c'], function(letter) { return letter.toLowerCase(); }); + * // => ['A', 'b', 'C'] + * + * _.uniq([1, 2.5, 3, 1.5, 2, 3.5], function(num) { return this.floor(num); }, Math); + * // => [1, 2.5, 3] + * + * // using "_.pluck" callback shorthand + * _.uniq([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x'); + * // => [{ 'x': 1 }, { 'x': 2 }] + */ + function uniq(array, isSorted, callback, thisArg) { + // juggle arguments + if (typeof isSorted != 'boolean' && isSorted != null) { + thisArg = callback; + callback = (typeof isSorted != 'function' && thisArg && thisArg[isSorted] === array) ? null : isSorted; + isSorted = false; + } + if (callback != null) { + callback = lodash.createCallback(callback, thisArg, 3); + } + return baseUniq(array, isSorted, callback); + } + + /** + * Creates an array excluding all provided values using strict equality for + * comparisons, i.e. `===`. + * + * @static + * @memberOf _ + * @category Arrays + * @param {Array} array The array to filter. + * @param {...*} [value] The values to exclude. + * @returns {Array} Returns a new array of filtered values. + * @example + * + * _.without([1, 2, 1, 0, 3, 1, 4], 0, 1); + * // => [2, 3, 4] + */ + function without(array) { + return baseDifference(array, slice(arguments, 1)); + } + + /** + * Creates an array that is the symmetric difference of the provided arrays. + * See http://en.wikipedia.org/wiki/Symmetric_difference. + * + * @static + * @memberOf _ + * @category Arrays + * @param {...Array} [array] The arrays to inspect. + * @returns {Array} Returns an array of values. + * @example + * + * _.xor([1, 2, 3], [5, 2, 1, 4]); + * // => [3, 5, 4] + * + * _.xor([1, 2, 5], [2, 3, 5], [3, 4, 5]); + * // => [1, 4, 5] + */ + function xor() { + var index = -1, + length = arguments.length; + + while (++index < length) { + var array = arguments[index]; + if (isArray(array) || isArguments(array)) { + var result = result + ? baseUniq(baseDifference(result, array).concat(baseDifference(array, result))) + : array; + } + } + return result || []; + } + + /** + * Creates an array of grouped elements, the first of which contains the first + * elements of the given arrays, the second of which contains the second + * elements of the given arrays, and so on. + * + * @static + * @memberOf _ + * @alias unzip + * @category Arrays + * @param {...Array} [array] Arrays to process. + * @returns {Array} Returns a new array of grouped elements. + * @example + * + * _.zip(['fred', 'barney'], [30, 40], [true, false]); + * // => [['fred', 30, true], ['barney', 40, false]] + */ + function zip() { + var array = arguments.length > 1 ? arguments : arguments[0], + index = -1, + length = array ? max(pluck(array, 'length')) : 0, + result = Array(length < 0 ? 0 : length); + + while (++index < length) { + result[index] = pluck(array, index); + } + return result; + } + + /** + * Creates an object composed from arrays of `keys` and `values`. Provide + * either a single two dimensional array, i.e. `[[key1, value1], [key2, value2]]` + * or two arrays, one of `keys` and one of corresponding `values`. + * + * @static + * @memberOf _ + * @alias object + * @category Arrays + * @param {Array} keys The array of keys. + * @param {Array} [values=[]] The array of values. + * @returns {Object} Returns an object composed of the given keys and + * corresponding values. + * @example + * + * _.zipObject(['fred', 'barney'], [30, 40]); + * // => { 'fred': 30, 'barney': 40 } + */ + function zipObject(keys, values) { + var index = -1, + length = keys ? keys.length : 0, + result = {}; + + if (!values && length && !isArray(keys[0])) { + values = []; + } + while (++index < length) { + var key = keys[index]; + if (values) { + result[key] = values[index]; + } else if (key) { + result[key[0]] = key[1]; + } + } + return result; + } + + /*--------------------------------------------------------------------------*/ + + /** + * Creates a function that executes `func`, with the `this` binding and + * arguments of the created function, only after being called `n` times. + * + * @static + * @memberOf _ + * @category Functions + * @param {number} n The number of times the function must be called before + * `func` is executed. + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new restricted function. + * @example + * + * var saves = ['profile', 'settings']; + * + * var done = _.after(saves.length, function() { + * console.log('Done saving!'); + * }); + * + * _.forEach(saves, function(type) { + * asyncSave({ 'type': type, 'complete': done }); + * }); + * // => logs 'Done saving!', after all saves have completed + */ + function after(n, func) { + if (!isFunction(func)) { + throw new TypeError; + } + return function() { + if (--n < 1) { + return func.apply(this, arguments); + } + }; + } + + /** + * Creates a function that, when called, invokes `func` with the `this` + * binding of `thisArg` and prepends any additional `bind` arguments to those + * provided to the bound function. + * + * @static + * @memberOf _ + * @category Functions + * @param {Function} func The function to bind. + * @param {*} [thisArg] The `this` binding of `func`. + * @param {...*} [arg] Arguments to be partially applied. + * @returns {Function} Returns the new bound function. + * @example + * + * var func = function(greeting) { + * return greeting + ' ' + this.name; + * }; + * + * func = _.bind(func, { 'name': 'fred' }, 'hi'); + * func(); + * // => 'hi fred' + */ + function bind(func, thisArg) { + return arguments.length > 2 + ? createWrapper(func, 17, slice(arguments, 2), null, thisArg) + : createWrapper(func, 1, null, null, thisArg); + } + + /** + * Binds methods of an object to the object itself, overwriting the existing + * method. Method names may be specified as individual arguments or as arrays + * of method names. If no method names are provided all the function properties + * of `object` will be bound. + * + * @static + * @memberOf _ + * @category Functions + * @param {Object} object The object to bind and assign the bound methods to. + * @param {...string} [methodName] The object method names to + * bind, specified as individual method names or arrays of method names. + * @returns {Object} Returns `object`. + * @example + * + * var view = { + * 'label': 'docs', + * 'onClick': function() { console.log('clicked ' + this.label); } + * }; + * + * _.bindAll(view); + * jQuery('#docs').on('click', view.onClick); + * // => logs 'clicked docs', when the button is clicked + */ + function bindAll(object) { + var funcs = arguments.length > 1 ? baseFlatten(arguments, true, false, 1) : functions(object), + index = -1, + length = funcs.length; + + while (++index < length) { + var key = funcs[index]; + object[key] = createWrapper(object[key], 1, null, null, object); + } + return object; + } + + /** + * Creates a function that, when called, invokes the method at `object[key]` + * and prepends any additional `bindKey` arguments to those provided to the bound + * function. This method differs from `_.bind` by allowing bound functions to + * reference methods that will be redefined or don't yet exist. + * See http://michaux.ca/articles/lazy-function-definition-pattern. + * + * @static + * @memberOf _ + * @category Functions + * @param {Object} object The object the method belongs to. + * @param {string} key The key of the method. + * @param {...*} [arg] Arguments to be partially applied. + * @returns {Function} Returns the new bound function. + * @example + * + * var object = { + * 'name': 'fred', + * 'greet': function(greeting) { + * return greeting + ' ' + this.name; + * } + * }; + * + * var func = _.bindKey(object, 'greet', 'hi'); + * func(); + * // => 'hi fred' + * + * object.greet = function(greeting) { + * return greeting + 'ya ' + this.name + '!'; + * }; + * + * func(); + * // => 'hiya fred!' + */ + function bindKey(object, key) { + return arguments.length > 2 + ? createWrapper(key, 19, slice(arguments, 2), null, object) + : createWrapper(key, 3, null, null, object); + } + + /** + * Creates a function that is the composition of the provided functions, + * where each function consumes the return value of the function that follows. + * For example, composing the functions `f()`, `g()`, and `h()` produces `f(g(h()))`. + * Each function is executed with the `this` binding of the composed function. + * + * @static + * @memberOf _ + * @category Functions + * @param {...Function} [func] Functions to compose. + * @returns {Function} Returns the new composed function. + * @example + * + * var realNameMap = { + * 'pebbles': 'penelope' + * }; + * + * var format = function(name) { + * name = realNameMap[name.toLowerCase()] || name; + * return name.charAt(0).toUpperCase() + name.slice(1).toLowerCase(); + * }; + * + * var greet = function(formatted) { + * return 'Hiya ' + formatted + '!'; + * }; + * + * var welcome = _.compose(greet, format); + * welcome('pebbles'); + * // => 'Hiya Penelope!' + */ + function compose() { + var funcs = arguments, + length = funcs.length; + + while (length--) { + if (!isFunction(funcs[length])) { + throw new TypeError; + } + } + return function() { + var args = arguments, + length = funcs.length; + + while (length--) { + args = [funcs[length].apply(this, args)]; + } + return args[0]; + }; + } + + /** + * Creates a function which accepts one or more arguments of `func` that when + * invoked either executes `func` returning its result, if all `func` arguments + * have been provided, or returns a function that accepts one or more of the + * remaining `func` arguments, and so on. The arity of `func` can be specified + * if `func.length` is not sufficient. + * + * @static + * @memberOf _ + * @category Functions + * @param {Function} func The function to curry. + * @param {number} [arity=func.length] The arity of `func`. + * @returns {Function} Returns the new curried function. + * @example + * + * var curried = _.curry(function(a, b, c) { + * console.log(a + b + c); + * }); + * + * curried(1)(2)(3); + * // => 6 + * + * curried(1, 2)(3); + * // => 6 + * + * curried(1, 2, 3); + * // => 6 + */ + function curry(func, arity) { + arity = typeof arity == 'number' ? arity : (+arity || func.length); + return createWrapper(func, 4, null, null, null, arity); + } + + /** + * Creates a function that will delay the execution of `func` until after + * `wait` milliseconds have elapsed since the last time it was invoked. + * Provide an options object to indicate that `func` should be invoked on + * the leading and/or trailing edge of the `wait` timeout. Subsequent calls + * to the debounced function will return the result of the last `func` call. + * + * Note: If `leading` and `trailing` options are `true` `func` will be called + * on the trailing edge of the timeout only if the the debounced function is + * invoked more than once during the `wait` timeout. + * + * @static + * @memberOf _ + * @category Functions + * @param {Function} func The function to debounce. + * @param {number} wait The number of milliseconds to delay. + * @param {Object} [options] The options object. + * @param {boolean} [options.leading=false] Specify execution on the leading edge of the timeout. + * @param {number} [options.maxWait] The maximum time `func` is allowed to be delayed before it's called. + * @param {boolean} [options.trailing=true] Specify execution on the trailing edge of the timeout. + * @returns {Function} Returns the new debounced function. + * @example + * + * // avoid costly calculations while the window size is in flux + * var lazyLayout = _.debounce(calculateLayout, 150); + * jQuery(window).on('resize', lazyLayout); + * + * // execute `sendMail` when the click event is fired, debouncing subsequent calls + * jQuery('#postbox').on('click', _.debounce(sendMail, 300, { + * 'leading': true, + * 'trailing': false + * }); + * + * // ensure `batchLog` is executed once after 1 second of debounced calls + * var source = new EventSource('/stream'); + * source.addEventListener('message', _.debounce(batchLog, 250, { + * 'maxWait': 1000 + * }, false); + */ + function debounce(func, wait, options) { + var args, + maxTimeoutId, + result, + stamp, + thisArg, + timeoutId, + trailingCall, + lastCalled = 0, + maxWait = false, + trailing = true; + + if (!isFunction(func)) { + throw new TypeError; + } + wait = nativeMax(0, wait) || 0; + if (options === true) { + var leading = true; + trailing = false; + } else if (isObject(options)) { + leading = options.leading; + maxWait = 'maxWait' in options && (nativeMax(wait, options.maxWait) || 0); + trailing = 'trailing' in options ? options.trailing : trailing; + } + var delayed = function() { + var remaining = wait - (now() - stamp); + if (remaining <= 0) { + if (maxTimeoutId) { + clearTimeout(maxTimeoutId); + } + var isCalled = trailingCall; + maxTimeoutId = timeoutId = trailingCall = undefined; + if (isCalled) { + lastCalled = now(); + result = func.apply(thisArg, args); + if (!timeoutId && !maxTimeoutId) { + args = thisArg = null; + } + } + } else { + timeoutId = setTimeout(delayed, remaining); + } + }; + + var maxDelayed = function() { + if (timeoutId) { + clearTimeout(timeoutId); + } + maxTimeoutId = timeoutId = trailingCall = undefined; + if (trailing || (maxWait !== wait)) { + lastCalled = now(); + result = func.apply(thisArg, args); + if (!timeoutId && !maxTimeoutId) { + args = thisArg = null; + } + } + }; + + return function() { + args = arguments; + stamp = now(); + thisArg = this; + trailingCall = trailing && (timeoutId || !leading); + + if (maxWait === false) { + var leadingCall = leading && !timeoutId; + } else { + if (!maxTimeoutId && !leading) { + lastCalled = stamp; + } + var remaining = maxWait - (stamp - lastCalled), + isCalled = remaining <= 0; + + if (isCalled) { + if (maxTimeoutId) { + maxTimeoutId = clearTimeout(maxTimeoutId); + } + lastCalled = stamp; + result = func.apply(thisArg, args); + } + else if (!maxTimeoutId) { + maxTimeoutId = setTimeout(maxDelayed, remaining); + } + } + if (isCalled && timeoutId) { + timeoutId = clearTimeout(timeoutId); + } + else if (!timeoutId && wait !== maxWait) { + timeoutId = setTimeout(delayed, wait); + } + if (leadingCall) { + isCalled = true; + result = func.apply(thisArg, args); + } + if (isCalled && !timeoutId && !maxTimeoutId) { + args = thisArg = null; + } + return result; + }; + } + + /** + * Defers executing the `func` function until the current call stack has cleared. + * Additional arguments will be provided to `func` when it is invoked. + * + * @static + * @memberOf _ + * @category Functions + * @param {Function} func The function to defer. + * @param {...*} [arg] Arguments to invoke the function with. + * @returns {number} Returns the timer id. + * @example + * + * _.defer(function(text) { console.log(text); }, 'deferred'); + * // logs 'deferred' after one or more milliseconds + */ + function defer(func) { + if (!isFunction(func)) { + throw new TypeError; + } + var args = slice(arguments, 1); + return setTimeout(function() { func.apply(undefined, args); }, 1); + } + + /** + * Executes the `func` function after `wait` milliseconds. Additional arguments + * will be provided to `func` when it is invoked. + * + * @static + * @memberOf _ + * @category Functions + * @param {Function} func The function to delay. + * @param {number} wait The number of milliseconds to delay execution. + * @param {...*} [arg] Arguments to invoke the function with. + * @returns {number} Returns the timer id. + * @example + * + * _.delay(function(text) { console.log(text); }, 1000, 'later'); + * // => logs 'later' after one second + */ + function delay(func, wait) { + if (!isFunction(func)) { + throw new TypeError; + } + var args = slice(arguments, 2); + return setTimeout(function() { func.apply(undefined, args); }, wait); + } + + /** + * Creates a function that memoizes the result of `func`. If `resolver` is + * provided it will be used to determine the cache key for storing the result + * based on the arguments provided to the memoized function. By default, the + * first argument provided to the memoized function is used as the cache key. + * The `func` is executed with the `this` binding of the memoized function. + * The result cache is exposed as the `cache` property on the memoized function. + * + * @static + * @memberOf _ + * @category Functions + * @param {Function} func The function to have its output memoized. + * @param {Function} [resolver] A function used to resolve the cache key. + * @returns {Function} Returns the new memoizing function. + * @example + * + * var fibonacci = _.memoize(function(n) { + * return n < 2 ? n : fibonacci(n - 1) + fibonacci(n - 2); + * }); + * + * fibonacci(9) + * // => 34 + * + * var data = { + * 'fred': { 'name': 'fred', 'age': 40 }, + * 'pebbles': { 'name': 'pebbles', 'age': 1 } + * }; + * + * // modifying the result cache + * var get = _.memoize(function(name) { return data[name]; }, _.identity); + * get('pebbles'); + * // => { 'name': 'pebbles', 'age': 1 } + * + * get.cache.pebbles.name = 'penelope'; + * get('pebbles'); + * // => { 'name': 'penelope', 'age': 1 } + */ + function memoize(func, resolver) { + if (!isFunction(func)) { + throw new TypeError; + } + var memoized = function() { + var cache = memoized.cache, + key = resolver ? resolver.apply(this, arguments) : keyPrefix + arguments[0]; + + return hasOwnProperty.call(cache, key) + ? cache[key] + : (cache[key] = func.apply(this, arguments)); + } + memoized.cache = {}; + return memoized; + } + + /** + * Creates a function that is restricted to execute `func` once. Repeat calls to + * the function will return the value of the first call. The `func` is executed + * with the `this` binding of the created function. + * + * @static + * @memberOf _ + * @category Functions + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new restricted function. + * @example + * + * var initialize = _.once(createApplication); + * initialize(); + * initialize(); + * // `initialize` executes `createApplication` once + */ + function once(func) { + var ran, + result; + + if (!isFunction(func)) { + throw new TypeError; + } + return function() { + if (ran) { + return result; + } + ran = true; + result = func.apply(this, arguments); + + // clear the `func` variable so the function may be garbage collected + func = null; + return result; + }; + } + + /** + * Creates a function that, when called, invokes `func` with any additional + * `partial` arguments prepended to those provided to the new function. This + * method is similar to `_.bind` except it does **not** alter the `this` binding. + * + * @static + * @memberOf _ + * @category Functions + * @param {Function} func The function to partially apply arguments to. + * @param {...*} [arg] Arguments to be partially applied. + * @returns {Function} Returns the new partially applied function. + * @example + * + * var greet = function(greeting, name) { return greeting + ' ' + name; }; + * var hi = _.partial(greet, 'hi'); + * hi('fred'); + * // => 'hi fred' + */ + function partial(func) { + return createWrapper(func, 16, slice(arguments, 1)); + } + + /** + * This method is like `_.partial` except that `partial` arguments are + * appended to those provided to the new function. + * + * @static + * @memberOf _ + * @category Functions + * @param {Function} func The function to partially apply arguments to. + * @param {...*} [arg] Arguments to be partially applied. + * @returns {Function} Returns the new partially applied function. + * @example + * + * var defaultsDeep = _.partialRight(_.merge, _.defaults); + * + * var options = { + * 'variable': 'data', + * 'imports': { 'jq': $ } + * }; + * + * defaultsDeep(options, _.templateSettings); + * + * options.variable + * // => 'data' + * + * options.imports + * // => { '_': _, 'jq': $ } + */ + function partialRight(func) { + return createWrapper(func, 32, null, slice(arguments, 1)); + } + + /** + * Creates a function that, when executed, will only call the `func` function + * at most once per every `wait` milliseconds. Provide an options object to + * indicate that `func` should be invoked on the leading and/or trailing edge + * of the `wait` timeout. Subsequent calls to the throttled function will + * return the result of the last `func` call. + * + * Note: If `leading` and `trailing` options are `true` `func` will be called + * on the trailing edge of the timeout only if the the throttled function is + * invoked more than once during the `wait` timeout. + * + * @static + * @memberOf _ + * @category Functions + * @param {Function} func The function to throttle. + * @param {number} wait The number of milliseconds to throttle executions to. + * @param {Object} [options] The options object. + * @param {boolean} [options.leading=true] Specify execution on the leading edge of the timeout. + * @param {boolean} [options.trailing=true] Specify execution on the trailing edge of the timeout. + * @returns {Function} Returns the new throttled function. + * @example + * + * // avoid excessively updating the position while scrolling + * var throttled = _.throttle(updatePosition, 100); + * jQuery(window).on('scroll', throttled); + * + * // execute `renewToken` when the click event is fired, but not more than once every 5 minutes + * jQuery('.interactive').on('click', _.throttle(renewToken, 300000, { + * 'trailing': false + * })); + */ + function throttle(func, wait, options) { + var leading = true, + trailing = true; + + if (!isFunction(func)) { + throw new TypeError; + } + if (options === false) { + leading = false; + } else if (isObject(options)) { + leading = 'leading' in options ? options.leading : leading; + trailing = 'trailing' in options ? options.trailing : trailing; + } + debounceOptions.leading = leading; + debounceOptions.maxWait = wait; + debounceOptions.trailing = trailing; + + return debounce(func, wait, debounceOptions); + } + + /** + * Creates a function that provides `value` to the wrapper function as its + * first argument. Additional arguments provided to the function are appended + * to those provided to the wrapper function. The wrapper is executed with + * the `this` binding of the created function. + * + * @static + * @memberOf _ + * @category Functions + * @param {*} value The value to wrap. + * @param {Function} wrapper The wrapper function. + * @returns {Function} Returns the new function. + * @example + * + * var p = _.wrap(_.escape, function(func, text) { + * return '

' + func(text) + '

'; + * }); + * + * p('Fred, Wilma, & Pebbles'); + * // => '

Fred, Wilma, & Pebbles

' + */ + function wrap(value, wrapper) { + return createWrapper(wrapper, 16, [value]); + } + + /*--------------------------------------------------------------------------*/ + + /** + * Creates a function that returns `value`. + * + * @static + * @memberOf _ + * @category Utilities + * @param {*} value The value to return from the new function. + * @returns {Function} Returns the new function. + * @example + * + * var object = { 'name': 'fred' }; + * var getter = _.constant(object); + * getter() === object; + * // => true + */ + function constant(value) { + return function() { + return value; + }; + } + + /** + * Produces a callback bound to an optional `thisArg`. If `func` is a property + * name the created callback will return the property value for a given element. + * If `func` is an object the created callback will return `true` for elements + * that contain the equivalent object properties, otherwise it will return `false`. + * + * @static + * @memberOf _ + * @category Utilities + * @param {*} [func=identity] The value to convert to a callback. + * @param {*} [thisArg] The `this` binding of the created callback. + * @param {number} [argCount] The number of arguments the callback accepts. + * @returns {Function} Returns a callback function. + * @example + * + * var characters = [ + * { 'name': 'barney', 'age': 36 }, + * { 'name': 'fred', 'age': 40 } + * ]; + * + * // wrap to create custom callback shorthands + * _.createCallback = _.wrap(_.createCallback, function(func, callback, thisArg) { + * var match = /^(.+?)__([gl]t)(.+)$/.exec(callback); + * return !match ? func(callback, thisArg) : function(object) { + * return match[2] == 'gt' ? object[match[1]] > match[3] : object[match[1]] < match[3]; + * }; + * }); + * + * _.filter(characters, 'age__gt38'); + * // => [{ 'name': 'fred', 'age': 40 }] + */ + function createCallback(func, thisArg, argCount) { + var type = typeof func; + if (func == null || type == 'function') { + return baseCreateCallback(func, thisArg, argCount); + } + // handle "_.pluck" style callback shorthands + if (type != 'object') { + return property(func); + } + var props = keys(func), + key = props[0], + a = func[key]; + + // handle "_.where" style callback shorthands + if (props.length == 1 && a === a && !isObject(a)) { + // fast path the common case of providing an object with a single + // property containing a primitive value + return function(object) { + var b = object[key]; + return a === b && (a !== 0 || (1 / a == 1 / b)); + }; + } + return function(object) { + var length = props.length, + result = false; + + while (length--) { + if (!(result = baseIsEqual(object[props[length]], func[props[length]], null, true))) { + break; + } + } + return result; + }; + } + + /** + * Converts the characters `&`, `<`, `>`, `"`, and `'` in `string` to their + * corresponding HTML entities. + * + * @static + * @memberOf _ + * @category Utilities + * @param {string} string The string to escape. + * @returns {string} Returns the escaped string. + * @example + * + * _.escape('Fred, Wilma, & Pebbles'); + * // => 'Fred, Wilma, & Pebbles' + */ + function escape(string) { + return string == null ? '' : String(string).replace(reUnescapedHtml, escapeHtmlChar); + } + + /** + * This method returns the first argument provided to it. + * + * @static + * @memberOf _ + * @category Utilities + * @param {*} value Any value. + * @returns {*} Returns `value`. + * @example + * + * var object = { 'name': 'fred' }; + * _.identity(object) === object; + * // => true + */ + function identity(value) { + return value; + } + + /** + * Adds function properties of a source object to the destination object. + * If `object` is a function methods will be added to its prototype as well. + * + * @static + * @memberOf _ + * @category Utilities + * @param {Function|Object} [object=lodash] object The destination object. + * @param {Object} source The object of functions to add. + * @param {Object} [options] The options object. + * @param {boolean} [options.chain=true] Specify whether the functions added are chainable. + * @example + * + * function capitalize(string) { + * return string.charAt(0).toUpperCase() + string.slice(1).toLowerCase(); + * } + * + * _.mixin({ 'capitalize': capitalize }); + * _.capitalize('fred'); + * // => 'Fred' + * + * _('fred').capitalize().value(); + * // => 'Fred' + * + * _.mixin({ 'capitalize': capitalize }, { 'chain': false }); + * _('fred').capitalize(); + * // => 'Fred' + */ + function mixin(object, source, options) { + var chain = true, + methodNames = source && functions(source); + + if (!source || (!options && !methodNames.length)) { + if (options == null) { + options = source; + } + ctor = lodashWrapper; + source = object; + object = lodash; + methodNames = functions(source); + } + if (options === false) { + chain = false; + } else if (isObject(options) && 'chain' in options) { + chain = options.chain; + } + var ctor = object, + isFunc = isFunction(ctor); + + forEach(methodNames, function(methodName) { + var func = object[methodName] = source[methodName]; + if (isFunc) { + ctor.prototype[methodName] = function() { + var chainAll = this.__chain__, + value = this.__wrapped__, + args = [value]; + + push.apply(args, arguments); + var result = func.apply(object, args); + if (chain || chainAll) { + if (value === result && isObject(result)) { + return this; + } + result = new ctor(result); + result.__chain__ = chainAll; + } + return result; + }; + } + }); + } + + /** + * Reverts the '_' variable to its previous value and returns a reference to + * the `lodash` function. + * + * @static + * @memberOf _ + * @category Utilities + * @returns {Function} Returns the `lodash` function. + * @example + * + * var lodash = _.noConflict(); + */ + function noConflict() { + context._ = oldDash; + return this; + } + + /** + * A no-operation function. + * + * @static + * @memberOf _ + * @category Utilities + * @example + * + * var object = { 'name': 'fred' }; + * _.noop(object) === undefined; + * // => true + */ + function noop() { + // no operation performed + } + + /** + * Gets the number of milliseconds that have elapsed since the Unix epoch + * (1 January 1970 00:00:00 UTC). + * + * @static + * @memberOf _ + * @category Utilities + * @example + * + * var stamp = _.now(); + * _.defer(function() { console.log(_.now() - stamp); }); + * // => logs the number of milliseconds it took for the deferred function to be called + */ + var now = isNative(now = Date.now) && now || function() { + return new Date().getTime(); + }; + + /** + * Converts the given value into an integer of the specified radix. + * If `radix` is `undefined` or `0` a `radix` of `10` is used unless the + * `value` is a hexadecimal, in which case a `radix` of `16` is used. + * + * Note: This method avoids differences in native ES3 and ES5 `parseInt` + * implementations. See http://es5.github.io/#E. + * + * @static + * @memberOf _ + * @category Utilities + * @param {string} value The value to parse. + * @param {number} [radix] The radix used to interpret the value to parse. + * @returns {number} Returns the new integer value. + * @example + * + * _.parseInt('08'); + * // => 8 + */ + var parseInt = nativeParseInt(whitespace + '08') == 8 ? nativeParseInt : function(value, radix) { + // Firefox < 21 and Opera < 15 follow the ES3 specified implementation of `parseInt` + return nativeParseInt(isString(value) ? value.replace(reLeadingSpacesAndZeros, '') : value, radix || 0); + }; + + /** + * Creates a "_.pluck" style function, which returns the `key` value of a + * given object. + * + * @static + * @memberOf _ + * @category Utilities + * @param {string} key The name of the property to retrieve. + * @returns {Function} Returns the new function. + * @example + * + * var characters = [ + * { 'name': 'fred', 'age': 40 }, + * { 'name': 'barney', 'age': 36 } + * ]; + * + * var getName = _.property('name'); + * + * _.map(characters, getName); + * // => ['barney', 'fred'] + * + * _.sortBy(characters, getName); + * // => [{ 'name': 'barney', 'age': 36 }, { 'name': 'fred', 'age': 40 }] + */ + function property(key) { + return function(object) { + return object[key]; + }; + } + + /** + * Produces a random number between `min` and `max` (inclusive). If only one + * argument is provided a number between `0` and the given number will be + * returned. If `floating` is truey or either `min` or `max` are floats a + * floating-point number will be returned instead of an integer. + * + * @static + * @memberOf _ + * @category Utilities + * @param {number} [min=0] The minimum possible value. + * @param {number} [max=1] The maximum possible value. + * @param {boolean} [floating=false] Specify returning a floating-point number. + * @returns {number} Returns a random number. + * @example + * + * _.random(0, 5); + * // => an integer between 0 and 5 + * + * _.random(5); + * // => also an integer between 0 and 5 + * + * _.random(5, true); + * // => a floating-point number between 0 and 5 + * + * _.random(1.2, 5.2); + * // => a floating-point number between 1.2 and 5.2 + */ + function random(min, max, floating) { + var noMin = min == null, + noMax = max == null; + + if (floating == null) { + if (typeof min == 'boolean' && noMax) { + floating = min; + min = 1; + } + else if (!noMax && typeof max == 'boolean') { + floating = max; + noMax = true; + } + } + if (noMin && noMax) { + max = 1; + } + min = +min || 0; + if (noMax) { + max = min; + min = 0; + } else { + max = +max || 0; + } + if (floating || min % 1 || max % 1) { + var rand = nativeRandom(); + return nativeMin(min + (rand * (max - min + parseFloat('1e-' + ((rand +'').length - 1)))), max); + } + return baseRandom(min, max); + } + + /** + * Resolves the value of property `key` on `object`. If `key` is a function + * it will be invoked with the `this` binding of `object` and its result returned, + * else the property value is returned. If `object` is falsey then `undefined` + * is returned. + * + * @static + * @memberOf _ + * @category Utilities + * @param {Object} object The object to inspect. + * @param {string} key The name of the property to resolve. + * @returns {*} Returns the resolved value. + * @example + * + * var object = { + * 'cheese': 'crumpets', + * 'stuff': function() { + * return 'nonsense'; + * } + * }; + * + * _.result(object, 'cheese'); + * // => 'crumpets' + * + * _.result(object, 'stuff'); + * // => 'nonsense' + */ + function result(object, key) { + if (object) { + var value = object[key]; + return isFunction(value) ? object[key]() : value; + } + } + + /** + * A micro-templating method that handles arbitrary delimiters, preserves + * whitespace, and correctly escapes quotes within interpolated code. + * + * Note: In the development build, `_.template` utilizes sourceURLs for easier + * debugging. See http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl + * + * For more information on precompiling templates see: + * http://lodash.com/custom-builds + * + * For more information on Chrome extension sandboxes see: + * http://developer.chrome.com/stable/extensions/sandboxingEval.html + * + * @static + * @memberOf _ + * @category Utilities + * @param {string} text The template text. + * @param {Object} data The data object used to populate the text. + * @param {Object} [options] The options object. + * @param {RegExp} [options.escape] The "escape" delimiter. + * @param {RegExp} [options.evaluate] The "evaluate" delimiter. + * @param {Object} [options.imports] An object to import into the template as local variables. + * @param {RegExp} [options.interpolate] The "interpolate" delimiter. + * @param {string} [sourceURL] The sourceURL of the template's compiled source. + * @param {string} [variable] The data object variable name. + * @returns {Function|string} Returns a compiled function when no `data` object + * is given, else it returns the interpolated text. + * @example + * + * // using the "interpolate" delimiter to create a compiled template + * var compiled = _.template('hello <%= name %>'); + * compiled({ 'name': 'fred' }); + * // => 'hello fred' + * + * // using the "escape" delimiter to escape HTML in data property values + * _.template('<%- value %>', { 'value': '