Skip to content
Browse files

moving hash/type methods into their own array to opt-in later. restoring

toISOString and toJSON support in IE, which misses a decimal
  • Loading branch information...
1 parent 1f441b7 commit 63effbfb105a36bd0f1a3f89ef4f4af07e195da1 @andrewplummer committed Jan 30, 2012
View
2 CHANGELOG.md
@@ -8,6 +8,8 @@ v1.2.1
- Fixed issue with String#has not escaping regex tokens.
- Date.setLocale can now overwrite a default locale object.
- Date locales can now add their own formats.
+- Fix for Ender, which was broken when modularized in 1.2.
+- Workaround for Ender requiring externs.
### Internal Changes ###
View
13 lib/core.js
@@ -291,10 +291,15 @@
***/
+ var ObjectTypeMethods = ['isObject','isNaN'];
+ var ObjectHashMethods = ['keys','values','each','merge','isEmpty','clone','equal','watch','tap','has']
+
function buildTypeMethods() {
- var methods = {};
+ var methods = {}, name;
arrayEach(['Array','Boolean','Date','Function','Number','String','RegExp'], function(type) {
- methods['is' + type] = function(obj) {
+ name = 'is' + type;
+ ObjectTypeMethods.push(name);
+ methods[name] = function(obj) {
return isClass(obj, type);
}
});
@@ -313,11 +318,11 @@
function buildObject() {
buildTypeMethods();
- buildInstanceMethods(['keys','values','each','merge','isEmpty','clone','equal','watch','tap'], Hash);
+ buildInstanceMethods(ObjectHashMethods, Hash);
}
function mapObjectPrototypeMethods() {
- buildInstanceMethods(Object.keys(Object['SugarMethods']).remove('extended', 'fromQueryString'), Object);
+ buildInstanceMethods(ObjectTypeMethods.concat(ObjectHashMethods), Object);
}
extend(object, false, true, {
View
60 lib/dates.js
@@ -1617,11 +1617,41 @@
}
+ /***
+ * @method toISOString()
+ * @returns String
+ * @short Formats the string to ISO8601 format.
+ * @extra This will always format as UTC time. Provided for browsers that do not support this method.
+ * @example
+ *
+ * Date.create().toISOString() -> ex. 2011-07-05 12:24:55.528Z
+ *
+ ***
+ * @method toJSON()
+ * @returns String
+ * @short Returns a JSON representation of the date.
+ * @extra This is effectively an alias for %toISOString%. Will always return the date in UTC time. Implemented for browsers that do not support it.
+ * @example
+ *
+ * Date.create().toJSON() -> ex. 2011-07-05 12:24:55.528Z
+ *
+ ***/
+
+ function buildISOString(name) {
+ var d = new date(date.UTC(1999, 11, 31)), target = '1999-12-31T00:00:00.000Z', methods = {};
+ if(!d[name] || d[name]() !== target) {
+ methods[name] = function() { return formatDate(this.toUTC(), date['ISO8601_DATETIME']); }
+ date.extend(methods, true);
+ }
+ }
+
function buildDate() {
English = date.setLocale('en');
buildDateMethods();
buildDateInputFormats();
buildRelativeAliases();
+ buildISOString('toISOString');
+ buildISOString('toJSON');
setDateProperties();
}
@@ -1711,20 +1741,6 @@
date.extend({
/***
- * @method toISOString()
- * @returns String
- * @short Formats the string to ISO8601 format.
- * @extra This will always format as UTC time. Provided for browsers that do not support this method.
- * @example
- *
- * Date.create().toISOString() -> ex. 2011-07-05 12:24:55.528Z
- *
- ***/
- 'toISOString': function() {
- return formatDate(this.toUTC(), date['ISO8601_DATETIME']);
- },
-
- /***
* @method set(<set>, [reset] = false)
* @returns Date
* @short Sets the date object.
@@ -2124,23 +2140,13 @@
date.extend({
/***
- * @method toJSON()
- * @returns String
- * @short Returns a JSON representation of the date.
- * @extra This is effectively an alias for %toISOString%. Will always return the date in UTC time. Implemented for browsers that do not support it.
- * @example
- *
- * Date.create().toJSON() -> ex. 2011-07-05 12:24:55.528Z
- *
- ***/
- 'toJSON': date.prototype.toISOString,
-
- /***
* @method iso()
* @alias toISOString
*
***/
- 'iso': date.prototype.toISOString,
+ 'iso': function() {
+ return this.toISOString();
+ },
/***
* @method getWeekday()
View
3,910 release/1.2.1/development/sugar-1.2.1-core.development.js
3,910 additions, 0 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
3,092 release/1.2.1/development/sugar-1.2.1-dates-only.development.js
3,092 additions, 0 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
2,170 release/1.2.1/development/sugar-1.2.1-dates.development.js
2,170 additions, 0 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
511 release/1.2.1/development/sugar-1.2.1-inflections.development.js
@@ -0,0 +1,511 @@
+(function(context) {
+
+ /***
+ * String module
+ *
+ ***/
+
+
+ var globalContext,
+ plurals = [],
+ singulars = [],
+ uncountables = [],
+ humans = [],
+ acronyms = {},
+ Downcased,
+ Normalize,
+ Inflector;
+
+ globalContext = typeof global !== 'undefined' ? global : context;
+
+ function removeFromUncountablesAndAddTo(arr, rule, replacement) {
+ if(Object.isString(rule)) {
+ uncountables.remove(rule);
+ }
+ uncountables.remove(replacement)
+ arr.unshift({ rule: rule, replacement: replacement })
+ }
+
+ function paramMatchesType(param, type) {
+ return param == type || param == 'all' || !param;
+ }
+
+ function isUncountable(word) {
+ return uncountables.any(function(uncountable) {
+ return new RegExp('\\b' + uncountable + '$', 'i').test(word);
+ });
+ }
+
+ function inflect(word, pluralize) {
+ word = Object.isString(word) ? word.toString() : '';
+ if(word.isBlank() || isUncountable(word)) {
+ return word;
+ } else {
+ return runReplacements(word, pluralize ? plurals : singulars);
+ }
+ }
+
+ function runReplacements(word, table) {
+ table.each(function(inflection) {
+ if(word.match(inflection.rule)) {
+ word = word.replace(inflection.rule, inflection.replacement);
+ return false;
+ }
+ });
+ return word;
+ }
+
+ function capitalize(word) {
+ return word.replace(/^\W*[a-z]/, function(w){
+ return w.toUpperCase();
+ });
+ }
+
+ Inflector = {
+
+ /*
+ * Specifies a new acronym. An acronym must be specified as it will appear in a camelized string. An underscore
+ * string that contains the acronym will retain the acronym when passed to %camelize%, %humanize%, or %titleize%.
+ * A camelized string that contains the acronym will maintain the acronym when titleized or humanized, and will
+ * convert the acronym into a non-delimited single lowercase word when passed to String#underscore.
+ *
+ * Examples:
+ * String.Inflector.acronym('HTML')
+ * 'html'.titleize() -> 'HTML'
+ * 'html'.camelize() -> 'HTML'
+ * 'MyHTML'.underscore() -> 'my_html'
+ *
+ * The acronym, however, must occur as a delimited unit and not be part of another word for conversions to recognize it:
+ *
+ * String.Inflector.acronym('HTTP')
+ * 'my_http_delimited'.camelize() -> 'MyHTTPDelimited'
+ * 'https'.camelize() -> 'Https', not 'HTTPs'
+ * 'HTTPS'.underscore() -> 'http_s', not 'https'
+ *
+ * String.Inflector.acronym('HTTPS')
+ * 'https'.camelize() -> 'HTTPS'
+ * 'HTTPS'.underscore() -> 'https'
+ *
+ * Note: Acronyms that are passed to %pluralize% will no longer be recognized, since the acronym will not occur as
+ * a delimited unit in the pluralized result. To work around this, you must specify the pluralized form as an
+ * acronym as well:
+ *
+ * String.Inflector.acronym('API')
+ * 'api'.pluralize().camelize() -> 'Apis'
+ *
+ * String.Inflector.acronym('APIs')
+ * 'api'.pluralize().camelize() -> 'APIs'
+ *
+ * %acronym% may be used to specify any word that contains an acronym or otherwise needs to maintain a non-standard
+ * capitalization. The only restriction is that the word must begin with a capital letter.
+ *
+ * Examples:
+ * String.Inflector.acronym('RESTful')
+ * 'RESTful'.underscore() -> 'restful'
+ * 'RESTfulController'.underscore() -> 'restful_controller'
+ * 'RESTfulController'.titleize() -> 'RESTful Controller'
+ * 'restful'.camelize() -> 'RESTful'
+ * 'restful_controller'.camelize() -> 'RESTfulController'
+ *
+ * String.Inflector.acronym('McDonald')
+ * 'McDonald'.underscore() -> 'mcdonald'
+ * 'mcdonald'.camelize() -> 'McDonald'
+ */
+ 'acronym': function(word) {
+ acronyms[word.toLowerCase()] = word;
+ Inflector.acronymRegExp = new RegExp(Object.values(acronyms).join('|'), 'g');
+ },
+
+ /*
+ * Specifies a new pluralization rule and its replacement. The rule can either be a string or a regular expression.
+ * The replacement should always be a string that may include references to the matched data from the rule.
+ */
+ 'plural': function(rule, replacement) {
+ removeFromUncountablesAndAddTo(plurals, rule, replacement);
+ },
+
+ /*
+ * Specifies a new singularization rule and its replacement. The rule can either be a string or a regular expression.
+ * The replacement should always be a string that may include references to the matched data from the rule.
+ */
+ 'singular': function(rule, replacement) {
+ removeFromUncountablesAndAddTo(singulars, rule, replacement);
+ },
+
+ /*
+ * Specifies a new irregular that applies to both pluralization and singularization at the same time. This can only be used
+ * for strings, not regular expressions. You simply pass the irregular in singular and plural form.
+ *
+ * Examples:
+ * String.Inflector.irregular('octopus', 'octopi')
+ * String.Inflector.irregular('person', 'people')
+ */
+ 'irregular': function(singular, plural) {
+ var singularFirst = singular.first(),
+ singularRest = singular.from(1),
+ pluralFirst = plural.first(),
+ pluralRest = plural.from(1),
+ pluralFirstUpper = pluralFirst.toUpperCase(),
+ pluralFirstLower = pluralFirst.toLowerCase(),
+ singularFirstUpper = singularFirst.toUpperCase(),
+ singularFirstLower = singularFirst.toLowerCase();
+ uncountables.remove(singular)
+ uncountables.remove(plural)
+ if(singularFirstUpper == pluralFirstUpper) {
+ Inflector.plural(new RegExp('({1}){2}$'.assign(singularFirst, singularRest), 'i'), '$1' + pluralRest);
+ Inflector.plural(new RegExp('({1}){2}$'.assign(pluralFirst, pluralRest), 'i'), '$1' + pluralRest);
+ Inflector.singular(new RegExp('({1}){2}$'.assign(pluralFirst, pluralRest), 'i'), '$1' + singularRest);
+ } else {
+ Inflector.plural(new RegExp('{1}{2}$'.assign(singularFirstUpper, singularRest)), pluralFirstUpper + pluralRest);
+ Inflector.plural(new RegExp('{1}{2}$'.assign(singularFirstLower, singularRest)), pluralFirstLower + pluralRest);
+ Inflector.plural(new RegExp('{1}{2}$'.assign(pluralFirstUpper, pluralRest)), pluralFirstUpper + pluralRest);
+ Inflector.plural(new RegExp('{1}{2}$'.assign(pluralFirstLower, pluralRest)), pluralFirstLower + pluralRest);
+ Inflector.singular(new RegExp('{1}{2}$'.assign(pluralFirstUpper, pluralRest)), singularFirstUpper + singularRest);
+ Inflector.singular(new RegExp('{1}{2}$'.assign(pluralFirstLower, pluralRest)), singularFirstLower + singularRest);
+ }
+ },
+
+ /*
+ * Add uncountable words that shouldn't be attempted inflected.
+ *
+ * Examples:
+ * String.Inflector.uncountable('money')
+ * String.Inflector.uncountable('money', 'information')
+ * String.Inflector.uncountable(['money', 'information', 'rice'])
+ */
+ 'uncountable': function() {
+ uncountables.add(Array.create(arguments).flatten());
+ },
+
+ /*
+ * Specifies a humanized form of a string by a regular expression rule or by a string mapping.
+ * When using a regular expression based replacement, the normal humanize formatting is called after the replacement.
+ * When a string is used, the human form should be specified as desired (example: 'The name', not 'the_name')
+ *
+ * Examples:
+ * String.Inflector.human(/_cnt$/i, '_count')
+ * String.Inflector.human('legacy_col_person_name', 'Name')
+ */
+ 'human': function(rule, replacement) {
+ humans.unshift({ rule: rule, replacement: replacement })
+ },
+
+
+ /*
+ * Clears the loaded inflections within a given scope (default is 'all').
+ * Options are: 'all', 'plurals', 'singulars', 'uncountables', 'humans'.
+ *
+ * Examples:
+ * String.Inflector.clear('all')
+ * String.Inflector.clear('plurals')
+ */
+ 'clear': function(type) {
+ if(paramMatchesType(type, 'singulars')) singulars = [];
+ if(paramMatchesType(type, 'plurals')) plurals = [];
+ if(paramMatchesType(type, 'uncountables')) uncountables = [];
+ if(paramMatchesType(type, 'humans')) humans = [];
+ if(paramMatchesType(type, 'acronyms')) acronyms = {};
+ }
+
+ };
+
+ Downcased = [
+ 'and', 'or', 'nor', 'a', 'an', 'the', 'so', 'but', 'to', 'of', 'at',
+ 'by', 'from', 'into', 'on', 'onto', 'off', 'out', 'in', 'over',
+ 'with', 'for'
+ ];
+
+ Normalize = {
+ 'A': /[AⒶAÀÁÂẦẤẪẨÃĀĂẰẮẴẲȦǠÄǞẢÅǺǍȀȂẠẬẶḀĄȺⱯ]/g,
+ 'B': /[BⒷBḂḄḆɃƂƁ]/g,
+ 'C': /[CⒸCĆĈĊČÇḈƇȻꜾ]/g,
+ 'D': /[DⒹDḊĎḌḐḒḎĐƋƊƉꝹ]/g,
+ 'E': /[EⒺEÈÉÊỀẾỄỂẼĒḔḖĔĖËẺĚȄȆẸỆȨḜĘḘḚƐƎ]/g,
+ 'F': /[FⒻFḞƑꝻ]/g,
+ 'G': /[GⒼGǴĜḠĞĠǦĢǤƓꞠꝽꝾ]/g,
+ 'H': /[HⒽHĤḢḦȞḤḨḪĦⱧⱵꞍ]/g,
+ 'I': /[IⒾIÌÍÎĨĪĬİÏḮỈǏȈȊỊĮḬƗ]/g,
+ 'J': /[JⒿJĴɈ]/g,
+ 'K': /[KⓀKḰǨḲĶḴƘⱩꝀꝂꝄꞢ]/g,
+ 'L': /[LⓁLĿĹĽḶḸĻḼḺŁȽⱢⱠꝈꝆꞀ]/g,
+ 'M': /[MⓂMḾṀṂⱮƜ]/g,
+ 'N': /[NⓃNǸŃÑṄŇṆŅṊṈȠƝꞐꞤ]/g,
+ 'O': /[OⓄOÒÓÔỒỐỖỔÕṌȬṎŌṐṒŎȮȰÖȪỎŐǑȌȎƠỜỚỠỞỢỌỘǪǬØǾƆƟꝊꝌ]/g,
+ 'P': /[PⓅPṔṖƤⱣꝐꝒꝔ]/g,
+ 'Q': /[QⓆQꝖꝘɊ]/g,
+ 'R': /[RⓇRŔṘŘȐȒṚṜŖṞɌⱤꝚꞦꞂ]/g,
+ 'S': /[SⓈSẞŚṤŜṠŠṦṢṨȘŞⱾꞨꞄ]/g,
+ 'T': /[TⓉTṪŤṬȚŢṰṮŦƬƮȾꞆ]/g,
+ 'U': /[UⓊUÙÚÛŨṸŪṺŬÜǛǗǕǙỦŮŰǓȔȖƯỪỨỮỬỰỤṲŲṶṴɄ]/g,
+ 'V': /[VⓋVṼṾƲꝞɅ]/g,
+ 'W': /[WⓌWẀẂŴẆẄẈⱲ]/g,
+ 'X': /[XⓍXẊẌ]/g,
+ 'Y': /[YⓎYỲÝŶỸȲẎŸỶỴƳɎỾ]/g,
+ 'Z': /[ZⓏZŹẐŻŽẒẔƵȤⱿⱫꝢ]/g,
+ 'a': /[aⓐaẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐ]/g,
+ 'b': /[bⓑbḃḅḇƀƃɓ]/g,
+ 'c': /[cⓒcćĉċčçḉƈȼꜿↄ]/g,
+ 'd': /[dⓓdḋďḍḑḓḏđƌɖɗꝺ]/g,
+ 'e': /[eⓔeèéêềếễểẽēḕḗĕėëẻěȅȇẹệȩḝęḙḛɇɛǝ]/g,
+ 'f': /[fⓕfḟƒꝼ]/g,
+ 'g': /[gⓖgǵĝḡğġǧģǥɠꞡᵹꝿ]/g,
+ 'h': /[hⓗhĥḣḧȟḥḩḫẖħⱨⱶɥ]/g,
+ 'i': /[iⓘiìíîĩīĭïḯỉǐȉȋịįḭɨı]/g,
+ 'j': /[jⓙjĵǰɉ]/g,
+ 'k': /[kⓚkḱǩḳķḵƙⱪꝁꝃꝅꞣ]/g,
+ 'l': /[lⓛlŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇ]/g,
+ 'm': /[mⓜmḿṁṃɱɯ]/g,
+ 'n': /[nⓝnǹńñṅňṇņṋṉƞɲʼnꞑꞥ]/g,
+ 'o': /[oⓞoòóôồốỗổõṍȭṏōṑṓŏȯȱöȫỏőǒȍȏơờớỡởợọộǫǭøǿɔꝋꝍɵ]/g,
+ 'p': /[pⓟpṕṗƥᵽꝑꝓꝕ]/g,
+ 'q': /[qⓠqɋꝗꝙ]/g,
+ 'r': /[rⓡrŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ]/g,
+ 's': /[sⓢsśṥŝṡšṧṣṩșşȿꞩꞅẛ]/g,
+ 't': /[tⓣtṫẗťṭțţṱṯŧƭʈⱦꞇ]/g,
+ 'u': /[uⓤuùúûũṹūṻŭüǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ]/g,
+ 'v': /[vⓥvṽṿʋꝟʌ]/g,
+ 'w': /[wⓦwẁẃŵẇẅẘẉⱳ]/g,
+ 'x': /[xⓧxẋẍ]/g,
+ 'y': /[yⓨyỳýŷỹȳẏÿỷẙỵƴɏỿ]/g,
+ 'z': /[zⓩzźẑżžẓẕƶȥɀⱬꝣ]/g,
+ 'AA': /[Ꜳ]/g,
+ 'AE': /[ÆǼǢ]/g,
+ 'AO': /[Ꜵ]/g,
+ 'AU': /[Ꜷ]/g,
+ 'AV': /[ꜸꜺ]/g,
+ 'AY': /[Ꜽ]/g,
+ 'DZ': /[DZDŽ]/g,
+ 'Dz': /[DzDž]/g,
+ 'LJ': /[LJ]/g,
+ 'Lj': /[Lj]/g,
+ 'NJ': /[NJ]/g,
+ 'Nj': /[Nj]/g,
+ 'OI': /[Ƣ]/g,
+ 'OO': /[Ꝏ]/g,
+ 'OU': /[Ȣ]/g,
+ 'TZ': /[Ꜩ]/g,
+ 'VY': /[Ꝡ]/g,
+ 'aa': /[ꜳ]/g,
+ 'ae': /[æǽǣ]/g,
+ 'ao': /[ꜵ]/g,
+ 'au': /[ꜷ]/g,
+ 'av': /[ꜹꜻ]/g,
+ 'ay': /[ꜽ]/g,
+ 'dz': /[dzdž]/g,
+ 'hv': /[ƕ]/g,
+ 'lj': /[lj]/g,
+ 'nj': /[nj]/g,
+ 'oi': /[ƣ]/g,
+ 'ou': /[ȣ]/g,
+ 'oo': /[ꝏ]/g,
+ 'ss': /[ß]/g,
+ 'tz': /[ꜩ]/g,
+ 'vy': /[ꝡ]/
+ };
+
+
+ Inflector.plural(/$/, 's');
+ Inflector.plural(/s$/gi, 's');
+ Inflector.plural(/(ax|test)is$/gi, '$1es');
+ Inflector.plural(/(octop|vir)us$/gi, '$1i');
+ Inflector.plural(/(octop|vir)i$/gi, '$1i');
+ Inflector.plural(/(alias|status)$/gi, '$1es');
+ Inflector.plural(/(bu)s$/gi, '$1ses');
+ Inflector.plural(/(buffal|tomat)o$/gi, '$1oes');
+ Inflector.plural(/([ti])um$/gi, '$1a');
+ Inflector.plural(/([ti])a$/gi, '$1a');
+ Inflector.plural(/sis$/gi, 'ses');
+ Inflector.plural(/(?:([^f])fe|([lr])f)$/gi, '$1$2ves');
+ Inflector.plural(/(hive)$/gi, '$1s');
+ Inflector.plural(/([^aeiouy]|qu)y$/gi, '$1ies');
+ Inflector.plural(/(x|ch|ss|sh)$/gi, '$1es');
+ Inflector.plural(/(matr|vert|ind)(?:ix|ex)$/gi, '$1ices');
+ Inflector.plural(/([ml])ouse$/gi, '$1ice');
+ Inflector.plural(/([ml])ice$/gi, '$1ice');
+ Inflector.plural(/^(ox)$/gi, '$1en');
+ Inflector.plural(/^(oxen)$/gi, '$1');
+ Inflector.plural(/(quiz)$/gi, '$1zes');
+
+ Inflector.singular(/s$/gi, '');
+ Inflector.singular(/(n)ews$/gi, '$1ews');
+ Inflector.singular(/([ti])a$/gi, '$1um');
+ Inflector.singular(/((a)naly|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)ses$/gi, '$1$2sis');
+ Inflector.singular(/(^analy)ses$/gi, '$1sis');
+ Inflector.singular(/([^f])ves$/gi, '$1fe');
+ Inflector.singular(/(hive)s$/gi, '$1');
+ Inflector.singular(/(tive)s$/gi, '$1');
+ Inflector.singular(/([lr])ves$/gi, '$1f');
+ Inflector.singular(/([^aeiouy]|qu)ies$/gi, '$1y');
+ Inflector.singular(/(s)eries$/gi, '$1eries');
+ Inflector.singular(/(m)ovies$/gi, '$1ovie');
+ Inflector.singular(/(x|ch|ss|sh)es$/gi, '$1');
+ Inflector.singular(/([ml])ice$/gi, '$1ouse');
+ Inflector.singular(/(bus)es$/gi, '$1');
+ Inflector.singular(/(o)es$/gi, '$1');
+ Inflector.singular(/(shoe)s$/gi, '$1');
+ Inflector.singular(/(cris|ax|test)es$/gi, '$1is');
+ Inflector.singular(/(octop|vir)i$/gi, '$1us');
+ Inflector.singular(/(alias|status)es$/gi, '$1');
+ Inflector.singular(/^(ox)en/gi, '$1');
+ Inflector.singular(/(vert|ind)ices$/gi, '$1ex');
+ Inflector.singular(/(matr)ices$/gi, '$1ix');
+ Inflector.singular(/(quiz)zes$/gi, '$1');
+ Inflector.singular(/(database)s$/gi, '$1');
+
+ Inflector.irregular('person', 'people');
+ Inflector.irregular('man', 'men');
+ Inflector.irregular('child', 'children');
+ Inflector.irregular('sex', 'sexes');
+ Inflector.irregular('move', 'moves');
+ Inflector.irregular('cow', 'kine');
+ Inflector.irregular('zombie', 'zombies');
+
+ Inflector.uncountable('equipment,information,rice,money,species,series,fish,sheep,jeans'.split(','));
+
+
+ String.extend({
+
+ /***
+ * @method pluralize()
+ * @returns String
+ * @short Returns the plural form of the word in the string.
+ * @example
+ *
+ * 'post'.pluralize() -> 'posts'
+ * 'octopus'.pluralize() -> 'octopi'
+ * 'sheep'.pluralize() -> 'sheep'
+ * 'words'.pluralize() -> 'words'
+ * 'CamelOctopus'.pluralize() -> 'CamelOctopi'
+ *
+ ***/
+ 'pluralize': function() {
+ return inflect(this, true);
+ },
+
+ /***
+ * @method singularize()
+ * @returns String
+ * @short The reverse of String#pluralize. Returns the singular form of a word in a string.
+ * @example
+ *
+ * 'posts'.singularize() -> 'post'
+ * 'octopi'.singularize() -> 'octopus'
+ * 'sheep'.singularize() -> 'sheep'
+ * 'word'.singularize() -> 'word'
+ * 'CamelOctopi'.singularize() -> 'CamelOctopus'
+ *
+ ***/
+ 'singularize': function() {
+ return inflect(this, false);
+ },
+
+ /***
+ * @method humanize()
+ * @returns String
+ * @short Creates a human readable string.
+ * @extra Capitalizes the first word and turns underscores into spaces and strips a trailing '_id', if any. Like String#titleize, this is meant for creating pretty output.
+ * @example
+ *
+ * 'employee_salary'.humanize() -> 'Employee salary'
+ * 'author_id'.humanize() -> 'Author'
+ *
+ ***/
+ 'humanize': function() {
+ var str = runReplacements(this, humans);
+ str = str.replace(/_id$/g, '');
+ str = str.replace(/(_)?([a-z\d]*)/gi, function(match, _, word){
+ return (_ ? ' ' : '') + (acronyms[word] || word.toLowerCase());
+ });
+ return capitalize(str);
+ },
+
+ /***
+ * @method titleize()
+ * @returns String
+ * @short Creates a title version of the string.
+ * @extra Capitalizes all the words and replaces some characters in the string to create a nicer looking title. String#titleize is meant for creating pretty output.
+ * @example
+ *
+ * 'man from the boondocks'.titleize() -> 'Man from the Boondocks'
+ * 'x-men: the last stand'.titleize() -> 'X Men: The Last Stand'
+ * 'TheManWithoutAPast'.titleize() -> 'The Man Without a Past'
+ * 'raiders_of_the_lost_ark'.titleize() -> 'Raiders of the Lost Ark'
+ *
+ ***/
+ 'titleize': function() {
+ var fullStopPunctuation = /[.:;!]$/, hasPunctuation, lastHadPunctuation, isFirstOrLast;
+ return this.spacify().humanize().words(function(word, index, words) {
+ hasPunctuation = fullStopPunctuation.test(word);
+ isFirstOrLast = index == 0 || index == words.length - 1 || hasPunctuation || lastHadPunctuation;
+ lastHadPunctuation = hasPunctuation;
+ if(isFirstOrLast || !Downcased.any(word)) {
+ return capitalize(word);
+ } else {
+ return word;
+ }
+ }).join(' ');
+ },
+
+ /***
+ * @method namespace()
+ * @returns Mixed
+ * @short Tries to find the namespace or property with the name specified in the string.
+ * @extra Namespacing begins at the global level and operates on every "." in the string. If any level returns %undefined% the result will be %undefined%.
+ * @example
+ *
+ * 'Path.To.Namespace'.namespace() -> Path.To.Namespace
+ *
+ ***/
+ 'namespace': function() {
+ var spaces = this.split('.'), scope = globalContext;
+ spaces.each(function(s) {
+ return !!(scope = scope[s]);
+ });
+ return scope;
+ },
+
+ /***
+ * @method parameterize()
+ * @returns String
+ * @short Replaces special characters in a string so that it may be used as part of a pretty URL.
+ * @example
+ *
+ * 'hell, no!'.parameterize() -> 'hell-no'
+ *
+ ***/
+ 'parameterize': function(separator) {
+ if(separator === undefined) separator = '-';
+ var str = this.normalize();
+ str = str.replace(/[^a-z0-9\-_]+/gi, separator)
+ if(separator) {
+ str = str.replace(new RegExp('^{sep}+|{sep}+$|({sep}){sep}+'.assign({ 'sep': RegExp.escape(separator) }), 'g'), '$1');
+ }
+ return str.toLowerCase();
+ },
+
+ /***
+ * @method normalize()
+ * @returns String
+ * @short Returns the string with accented and non-standard Latin-based characters converted into ASCII approximate equivalents.
+ * @example
+ *
+ * 'á'.normalize() -> 'a'
+ * 'Ménage à trois'.normalize() -> 'Menage a trois'
+ * 'Volkswagen'.normalize() -> 'Volkswagen'
+ * 'FULLWIDTH'.normalize() -> 'FULLWIDTH'
+ *
+ ***/
+ 'normalize': function() {
+ var str = this.toString();
+ Object.each(Normalize, function(base, reg) {
+ str = str.replace(reg, base);
+ });
+ return str;
+ }
+
+ });
+
+ String.Inflector = Inflector;
+ String.Inflector.acronyms = acronyms;
+
+})(this);
View
6,080 release/1.2.1/development/sugar-1.2.1.development.js
6,080 additions, 0 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
67 release/1.2.1/minified/sugar-1.2.1-core.min.js
@@ -0,0 +1,67 @@
+/*
+ * Sugar Library v1.2.1
+ *
+ * Freely distributable and licensed under the MIT-style license.
+ * Copyright (c) 2012 Andrew Plummer
+ * http://sugarjs.com/
+ *
+ * ---------------------------- */
+(function(context){var h=true,j=null,k=false,m=Object,n=Array,o=RegExp,q=Date,r=String,s=Number,t=m.defineProperty&&m.defineProperties;function u(a,b,c,d){var e=b?a.prototype:a;v(a,b,d);w(d,function(f,g){if(typeof c==="function")x(e,f,aa(e[f],g,c));else if(c===h||!e[f])x(e,f,g);a.SugarMethods[f]={e:b,method:g}})}
+function v(a){if(!a.SugarMethods){x(a,"SugarMethods",{});u(a,k,k,{restore:function(){var b=arguments.length===0,c=y(arguments);w(a.SugarMethods,function(d,e){if(b||z(c,d))x(e.e?a.prototype:a,d,e.method)})},extend:function(b,c,d){a===m&&arguments.length===0?A(B.concat(C),Object):u(a,d!==k,c,b)}})}}function aa(a,b,c){return function(){return a&&(c===h||!c.apply(this,arguments))?a.apply(this,arguments):b.apply(this,arguments)}}
+function x(a,b,c){if(t)m.defineProperty(a,b,{value:c,configurable:h,enumerable:k,writable:h});else a[b]=c}function D(a,b){return m.prototype.hasOwnProperty.call(a,b)}function w(a,b){var c=0,d;for(d in a)if(D(a,d)){b.call(a,d,a[d],c);c++}}
+function ba(a,b,c){var d=m.prototype.toString.call(a).match(/\[object (\w+)\]/)[1];if(a===b)return a!==0||1/a===1/b;else if(a===j||E(a)||b===j||E(b))return k;else if(d=="RegExp")return a.ignoreCase==b.ignoreCase&&a.multiline==b.multiline&&a.source==b.source&&a.global==b.global;else if(d=="Array"||d=="Object"){for(d=c.length;d--;)if(c[d]==a)return h;c.push(a);for(var e in a)if(D(a,e))if(!D(b,e)||!ba(a[e],b[e],c))return k;c.pop();return m.keys(a).length===m.keys(b).length&&a.constructor===b.constructor&&
+a.length===b.length}else return F(b,d)&&a.valueOf()===b.valueOf()}function G(a,b,c,d){var e=h;if(a===b)return h;else if(m.isRegExp(b))return o(b).test(a);else if(m.isFunction(b))return b.apply(c,[a].concat(d));else if(m.isObject(b)&&m.isObject(a)){w(b,function(f){G(a[f],b[f],c,d)||(e=k)});return!m.isEmpty(b)&&e}else return m.equal(a,b)}function H(a,b,c,d){return E(b)?a:m.isFunction(b)?b.apply(c,d||[]):m.isFunction(a[b])?a[b].call(a):a[b]}function I(a,b){return Array.prototype.slice.call(a,b)}
+function y(a,b,c,d){a=I(a);if(c!==k)a=J(a);K(a,b||function(){},d);return a}function ca(a,b,c){var d=[],e=a.length,f=b[b.length-1]!==k,g;y(b,function(i){if(m.isBoolean(i))return k;if(f){i%=e;if(i<0)i=e+i}g=c?a.charAt(i)||"":a[i];d.push(g)});return d.length<2?d[0]:d}function F(a,b){return m.prototype.toString.call(a)==="[object "+b+"]"}function L(a){return typeof a=="object"}function E(a){return a===void 0}function M(a){return a!==void 0}
+function N(a,b,c,d){L(b)&&w(b,function(e,f){var g=a[e],i=M(g),l=m.isArray(f);if(c===h&&(l||m.isObject(f))){g||(g=l?[]:{});N(g,f,c)}else if(i&&m.isFunction(d))g=d.call(b,e,a[e],b[e]);else if(!i||i&&d!==k)g=b[e];a[e]=g});return a}
+function da(a,b,c,d){var e=/^(.+?)(\[.*\])$/,f,g,i;if(d!==k&&(g=b.match(e))){i=g[1];b=g[2].replace(/^\[|\]$/g,"").split("][");K(b,function(l){f=!l||l.match(/^\d+$/);if(!i&&m.isArray(a))i=a.length;a[i]||(a[i]=f?[]:{});a=a[i];i=l});if(!i&&f)i=a.length.toString();da(a,i,c)}else a[b]=c.match(/^[\d.]+$/)?parseFloat(c):c==="true"?h:c==="false"?k:c}function P(a){var b=this;w(a,function(c,d){b[c]=d})}P.prototype.constructor=m;
+var B=["isObject","isNaN"],C=["keys","values","each","merge","isEmpty","clone","equal","watch","tap","has"];function A(a,b){var c={};K(a,function(d){c[d+(d==="equal"?"s":"")]=function(){return Object[d].apply(j,[this].concat(I(arguments)))}});u(b,h,k,c)}u(m,k,h,{watch:function(a,b,c){if(t){var d=a[b];m.defineProperty(a,b,{get:function(){return d},set:function(e){d=c.call(a,b,d,e)},enumerable:h,configurable:h})}}});
+u(m,k,k,{extended:function(a){return new P(a)},isObject:function(a){return a===j||E(a)?k:F(a,"Object")&&a.constructor===m},isNaN:function(a){return m.isNumber(a)&&a.valueOf()!==a.valueOf()},each:function(a,b){b&&w(a,function(c,d){b.call(a,c,d,a)});return a},merge:function(a,b,c){return N(a,b,h,c)},isEmpty:function(a){if(!L(a)||a===j)return!(a&&a.length>0);return m.keys(a).length==0},equal:function(a,b){return ba(a,b,[])},values:function(a,b){var c=[];w(a,function(d,e){c.push(e);b&&b.call(a,e)});return c},
+clone:function(a,b){if(!L(a)||a===j)return a;var c=Object.isFunction(a.keys)?Object.extended():{};return N(c,a,b)},fromQueryString:function(a,b){var c=m.extended();a=a&&a.toString?a.toString():"";a.replace(/^.*?\?/,"").unescapeURL().split("&").each(function(d){d=d.split("=");d.length===2&&da(c,d[0],d[1],b)});return c},tap:function(a,b){H(a,b,a,[a]);return a},has:function(a,b){return D(a,b)}});
+u(m,k,function(){return arguments.length>1},{keys:function(a,b){if(a===j||!L(a)&&!m.isRegExp(a)&&!m.isFunction(a))throw new TypeError("Object required");var c=[];w(a,function(d,e){c.push(d);b&&b.call(a,d,e)});return c}});function K(a,b,c,d,e){var f,g;Q(b);if(c<0)c=a.length+c;g=isNaN(c)?0:parseInt(c>>0);for(c=d===h?a.length+g:a.length;g<c;){f=g%a.length;if(!(f in a)&&e===h)return ea(a,b,g,d);else if(b.call(a,a[f],f,a)===k)break;g++}}
+function fa(a,b,c,d,e){var f,g;K(a,function(i,l,p){if(G(i,b,p,[l,p])){f=i;g=l;return k}},c,d);return e?g:f}function z(a,b){return a.any(function(c){return m.equal(b,c)})}function R(a,b){function c(e){return H(e,b,a,[e])===d}var d;return a.reduce(function(e,f,g){d=H(f,b,a,[f,g,a]);if(e.none(b?c:f))e.push(f);return e},[])}function J(a,b,c){b=b||Infinity;c=c||0;var d=[];K(a,function(e){if(m.isArray(e)&&c<b)d=d.concat(J(e,b,c+1));else d.push(e)});return d}
+function ga(a,b,c){var d=[];a.each(function(e){if((c||!z(d,e))&&c!=z(b,e))d.push(e)});return d}function ha(a,b,c,d){var e=a.length,f=d==-1,g=f?e-1:0;c=isNaN(c)?g:parseInt(c>>0);if(c<0)c=e+c;if(!f&&c<0||f&&c>=e)c=g;for(;f&&c>=0||!f&&c<e;){if(a[c]===b)return c;c+=d}return-1}
+function ia(a,b,c,d){var e=a.length,f=0,g=M(c);Q(b);if(e==0&&!g)throw new TypeError("Reduce called on empty array with no initial value");else if(g)c=c;else{c=a[d?e-1:f];f++}for(;f<e;){g=d?e-f-1:f;if(g in a)c=b.call(void 0,c,a[g],g,a);f++}return c}function Q(a){if(!a||!a.call)throw new TypeError("Callback is not callable");}function S(a){if(a.length===0)throw new TypeError("First argument must be defined");}
+function ea(a,b,c){var d=[],e;for(e in a)e in a&&e>>>0==e&&e!=4294967295&&e>=c&&d.push(e.toNumber());d.sort().each(function(f){return b.call(a,a[f],f,a)});return a}function T(a,b,c,d){var e=c==="max",f=c==="min",g=e?-Infinity:Infinity,i=[];w(a,function(l){var p=a[l];l=H(p,b,a,d?[p,l.toNumber(),a]:[]);if(!E(l))if(l===g)i.push(p);else if(e&&l>g||f&&l<g){i=[p];g=l}});return i}
+u(n,k,k,{create:function(){var a=[];y(arguments,function(b){if(b&&b.callee)b=I(b);a=a.concat(b)});return a},isArray:function(a){return F(a,"Array")}});
+u(n,h,function(){var a=arguments;return a.length>0&&!m.isFunction(a[0])},{every:function(a,b){var c=this.length,d=0;for(S(arguments);d<c;){if(d in this&&!G(this[d],a,b,[d,this]))return k;d++}return h},some:function(a,b){var c=this.length,d=0;for(S(arguments);d<c;){if(d in this&&G(this[d],a,b,[d,this]))return h;d++}return k},map:function(a,b){var c=this.length,d=0,e,f=Array(c);for(S(arguments);d<c;){if(d in this){e=this[d];f[d]=H(e,a,b,[e,d,this])}d++}return f},filter:function(a,b){var c=this.length,
+d=0,e=[];for(S(arguments);d<c;){d in this&&G(this[d],a,b,[d,this])&&e.push(this[d]);d++}return e}});
+u(n,h,k,{indexOf:function(a,b){if(m.isString(this))return this.indexOf(a,b);return ha(this,a,b,1)},lastIndexOf:function(a,b){if(m.isString(this))return this.lastIndexOf(a,b);return ha(this,a,b,-1)},forEach:function(a,b){var c=this.length,d=0;for(Q(a);d<c;){d in this&&a.call(b,this[d],d,this);d++}},reduce:function(a,b){return ia(this,a,b)},reduceRight:function(a,b){return ia(this,a,b,h)},each:function(a,b,c){K(this,a,b,c,h);return this},find:function(a,b,c){return fa(this,a,b,c)},findAll:function(a,
+b,c){var d=[];K(this,function(e,f,g){G(e,a,g,[f,g])&&d.push(e)},b,c);return d},findIndex:function(a,b,c){a=fa(this,a,b,c,h);return M(a)?a:-1},count:function(a){if(E(a))return this.length;return this.findAll(a).length},none:function(){return!this.any.apply(this,arguments)},remove:function(){var a,b=this;y(arguments,function(c){for(a=0;a<b.length;)if(G(b[a],c,b,[a,b]))b.splice(a,1);else a++},k);return b},removeAt:function(a,b){if(E(a))return this;if(E(b))b=a;for(var c=0;c<=b-a;c++)this.splice(a,1);
+return this},add:function(a,b){if(!m.isNumber(s(b))||isNaN(b)||b==-1)b=this.length;else if(b<-1)b+=1;n.prototype.splice.apply(this,[b,0].concat(a));return this},include:function(a,b){return this.clone().add(a,b)},exclude:function(){return n.prototype.remove.apply(this.clone(),arguments)},clone:function(){return N([],this)},unique:function(a){return R(this,a)},union:function(){var a=this;y(arguments,function(b){a=a.concat(b)});return R(a)},intersect:function(){return ga(this,y(arguments),k)},subtract:function(){return ga(this,
+y(arguments),h)},at:function(){return ca(this,arguments)},first:function(a){if(E(a))return this[0];if(a<0)a=0;return this.slice(0,a)},last:function(a){if(E(a))return this[this.length-1];return this.slice(this.length-a<0?0:this.length-a)},from:function(a){return this.slice(a)},to:function(a){if(E(a))a=this.length;return this.slice(0,a)},min:function(a){return R(T(this,a,"min",h))},max:function(a){return R(T(this,a,"max",h))},least:function(){var a=J(T(this.groupBy.apply(this,arguments),"length","min"));
+return a.length===this.length?[]:R(a)},most:function(){var a=J(T(this.groupBy.apply(this,arguments),"length","max"));return a.length===this.length?[]:R(a)},sum:function(a){a=a?this.map(a):this;return a.length>0?a.reduce(function(b,c){return b+c}):0},average:function(a){a=a?this.map(a):this;return a.length>0?a.sum()/a.length:0},groupBy:function(a,b){var c=this,d=m.extended(),e;K(c,function(f,g){e=H(f,a,c,[f,g,c]);d[e]||(d[e]=[]);d[e].push(f)});return d.each(b)},inGroups:function(a,b){var c=arguments.length>
+1,d=this,e=[],f=(this.length/a).ceil();(0).upto(a-1,function(g){g=g*f;var i=d.slice(g,g+f);c&&i.length<f&&(f-i.length).times(function(){i=i.add(b)});e.push(i)});return e},inGroupsOf:function(a,b){if(this.length===0||a===0)return this;if(E(a))a=1;if(E(b))b=j;var c=[],d=j;this.each(function(e,f){if(f%a===0){d&&c.push(d);d=[]}if(E(e))e=b;d.push(e)});if(!this.length.isMultipleOf(a)){(a-this.length%a).times(function(){d.push(b)});this.length+=a-this.length%a}d.length>0&&c.push(d);return c},compact:function(a){var b=
+[];K(this,function(c){if(m.isArray(c))b.push(c.compact());else if(a&&c)b.push(c);else if(!a&&M(c)&&c!==j&&(!m.isNumber(c)||!isNaN(c)))b.push(c)});return b},isEmpty:function(){return this.compact().length==0},flatten:function(a){return J(this,a)},sortBy:function(a,b){var c=this.clone();c.sort(function(d,e){var f,g;f=H(d,a,c,[d]);g=H(e,a,c,[e]);return(f&&f.compare?f.compare(g):f<g)*(b?-1:1)});return c},randomize:function(){for(var a=this.concat(),b,c,d=a.length;d;b=parseInt(Math.random()*d),c=a[--d],
+a[d]=a[b],a[b]=c);return a},zip:function(){var a=I(arguments);return this.map(function(b,c){return[b].concat(a.map(function(d){return c in d?d[c]:j}))})},sample:function(a){var b=[],c=this.clone(),d;for(a>0||(a=1);b.length<a;){d=Number.random(0,c.length-1);b.push(c[d]);c.removeAt(d);if(c.length==0)break}return arguments.length>0?b:b[0]}});u(n,h,k,{all:n.prototype.every,any:n.prototype.some,has:n.prototype.some,insert:n.prototype.add});
+function U(a,b,c){c=Math[c||"round"];var d=Math.pow(10,(b||0).abs());if(b<0)d=1/d;return c(a*d)/d}function ja(a,b,c,d){var e=[];a=parseInt(a);for(var f=d>0;f&&a<=b||!f&&a>=b;){e.push(a);c&&c.call(this,a);a+=d}return e}
+function V(a,b,c,d,e,f){var g=a.toFixed(20),i=g.search(/\./);g=g.search(/[1-9]/);i=i-g;if(i>0)i-=1;e=Math.max(Math.min((i/3).floor(),e===k?c.length:e),-d);d=c.charAt(e+d-1);if(i<-9){e=-3;b=i.abs()-9;d=c.first()}return(a/(f?(2).pow(10*e):(10).pow(e*3))).round(b||0).format()+d.trim()}u(s,k,k,{random:function(a,b){var c;if(arguments.length==1){b=a;a=0}c=Math.min(a||0,M(b)?b:1);return U(Math.random()*(Math.max(a||0,M(b)?b:1)-c)+c)}});
+u(s,h,k,{toNumber:function(){return parseFloat(this,10)},abbr:function(a){return V(this,a,"kmbt",0,4)},metric:function(a,b){return V(this,a,"n\u03bcm kMGTPE",4,M(b)?b:1)},bytes:function(a,b){return V(this,a,"kMGTPE",0,M(b)?b:4,h)+"B"},isInteger:function(){return this%1==0},ceil:function(a){return U(this,a,"ceil")},floor:function(a){return U(this,a,"floor")},abs:function(){return Math.abs(this)},pow:function(a){if(E(a))a=1;return Math.pow(this,a)},round:function(a){return U(this,a,"round")},chr:function(){return r.fromCharCode(this)},
+isOdd:function(){return!this.isMultipleOf(2)},isEven:function(){return this.isMultipleOf(2)},isMultipleOf:function(a){return this%a===0},upto:function(a,b,c){return ja(this,a,b,c||1)},downto:function(a,b,c){return ja(this,a,b,-(c||1))},times:function(a){if(a)for(var b=0;b<this;b++)a.call(this,b);return this.toNumber()},ordinalize:function(){var a;a=this.abs();var b=a.toString().last(2).toNumber();if(b>=11&&b<=13)a="th";else switch(a%10){case 1:a="st";break;case 2:a="nd";break;case 3:a="rd";break;
+default:a="th"}return this.toString()+a},pad:function(a,b,c){c=c||10;c=this.toNumber()===0?"":this.toString(c).replace(/^-/,"");c=W(c,"0",a-c.replace(/\.\d+$/,"").length,0);if(b||this<0)c=(this<0?"-":"+")+c;return c},format:function(a,b,c){var d,e,f=/(\d+)(\d{3})/;if(r(b).match(/\d/))throw new TypeError("Thousands separator cannot contain numbers.");d=m.isNumber(a)?U(this,a).toFixed(Math.max(a,0)):this.toString();b=b||",";c=c||".";e=d.split(".");d=e[0];for(e=e[1]||"";d.match(f);)d=d.replace(f,"$1"+
+b+"$2");if(e.length>0)d+=c+W(e,"0",0,a-e.length);return d},hex:function(a){return this.pad(a||1,k,16)},compare:function(a){return this-Number(a)}});function X(){return"\t\n\u000b\u000c\r \u00a0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u2028\u2029\u3000\ufeff"}
+function ka(a,b,c,d){var e=I(b).join("");e=e.replace(/all/,"").replace(/(\w)lphabet|umbers?|atakana|paces?|unctuation/g,"$1");return a.replace(c,function(f){return d[f]&&(!e||e.has(d[f].type))?d[f].to:f})}
+var la=[{type:"a",shift:65248,start:65,end:90},{type:"a",shift:65248,start:97,end:122},{type:"n",shift:65248,start:48,end:57},{type:"p",shift:65248,start:33,end:47},{type:"p",shift:65248,start:58,end:64},{type:"p",shift:65248,start:91,end:96},{type:"p",shift:65248,start:123,end:126}],ma={},na={},oa=/[\u0020-\u00A5]|[\uFF61-\uFF9F][\uff9e\uff9f]?/g,pa=/[\u3000-\u301C]|[\u301A-\u30FC]|[\uFF01-\uFF60]|[\uFFE0-\uFFE6]/g,qa=/[\u30ab\u30ad\u30af\u30b1\u30b3\u30b5\u30b7\u30b9\u30bb\u30bd\u30bf\u30c1\u30c4\u30c6\u30c8\u30cf\u30d2\u30d5\u30d8\u30db]/,
+ra=/[\u30cf\u30d2\u30d5\u30d8\u30db\u30f2]/;function Y(a,b,c){ma[b]={type:a,to:c};na[c]={type:a,to:b}}function W(a,b,c,d){var e=String(b);if(e!=b)e="";m.isNumber(c)||(c=1);m.isNumber(d)||(d=1);return e.repeat(c)+a+e.repeat(d)}
+u(r,h,k,{escapeRegExp:function(){return o.escape(this)},escapeURL:function(a){return a?encodeURIComponent(this):encodeURI(this)},unescapeURL:function(a){return a?decodeURI(this):decodeURIComponent(this)},escapeHTML:function(){return this.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")},unescapeHTML:function(){return this.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&")},encodeBase64:function(){return btoa(this)},decodeBase64:function(){return atob(this)},capitalize:function(a){return this.toLowerCase().replace(a?
+/\b[a-z]/g:/^[a-z]/,function(b){return b.toUpperCase()})},pad:function(a,b){return W(this,a,b,b)},padLeft:function(a,b){return W(this,a,b,0)},padRight:function(a,b){return W(this,a,0,b)},repeat:function(a){var b="",c=0;if(m.isNumber(a)&&a>0)for(;c<a;){b+=this;c++}return b},each:function(a,b){if(m.isFunction(a)){b=a;a=/./g}else if(a)if(m.isString(a))a=o(o.escape(a),"gi");else{if(m.isRegExp(a))a=a.addFlag("g")}else a=/./g;var c=this.match(a)||[];if(b)for(var d=0;d<c.length;d++)c[d]=b.call(this,c[d],
+d,c)||c[d];return c},shift:function(a){var b="";a=a||0;this.codes(function(c){b+=(c+a).chr()});return b},codes:function(a){for(var b=[],c=0;c<this.length;c++){var d=this.charCodeAt(c);b.push(d);a&&a.call(this,d,c)}return b},chars:function(a){return this.trim().each(a)},words:function(a){return this.trim().each(/\S+/g,a)},lines:function(a){return this.trim().each(/^.*$/gm,a)},paragraphs:function(a){var b=this.trim().split(/[\r\n]{2,}/);return b=b.map(function(c){if(a)var d=a.call(c);return d?d:c})},
+startsWith:function(a,b){if(E(b))b=h;var c=m.isRegExp(a)?a.source.replace("^",""):o.escape(a);return o("^"+c,b?"":"i").test(this)},endsWith:function(a,b){if(E(b))b=h;var c=m.isRegExp(a)?a.source.replace("$",""):o.escape(a);return o(c+"$",b?"":"i").test(this)},isBlank:function(){return this.trim().length===0},has:function(a){return this.search(m.isRegExp(a)?a:RegExp.escape(a))!==-1},add:function(a,b){return this.split("").add(a,b).join("")},remove:function(a){return this.replace(a,"")},hankaku:function(){return ka(this,
+arguments,pa,na)},zenkaku:function(){return ka(this,arguments,oa,ma)},hiragana:function(a){var b=this;if(a!==k)b=b.zenkaku("k");return b.replace(/[\u30A1-\u30F6]/g,function(c){return c.shift(-96)})},katakana:function(){return this.replace(/[\u3041-\u3096]/g,function(a){return a.shift(96)})},toNumber:function(a){var b=this.replace(/,/g,"");return b.match(/\./)?parseFloat(b):parseInt(b,a||10)},reverse:function(){return this.split("").reverse().join("")},compact:function(){return this.replace(/[\r\n]/g,
+"").trim().replace(/([\s\u3000])+/g,"$1")},at:function(){return ca(this,arguments,h)},first:function(a){a=E(a)?1:a;return this.substr(0,a)},last:function(a){a=E(a)?1:a;return this.substr(this.length-a<0?0:this.length-a)},from:function(a){return this.slice(a)},to:function(a){if(E(a))a=this.length;return this.slice(0,a)},toDate:function(a){var b=this.toString();return q.create?q.create(b,a):new q(b)},dasherize:function(){return this.underscore().replace(/_/g,"-")},underscore:function(){return this.replace(/[-\s]+/g,
+"_").replace(String.Inflector&&String.Inflector.acronymRegExp,function(a,b){return(b>0?"_":"")+a.toLowerCase()}).replace(/([A-Z\d]+)([A-Z][a-z])/g,"$1_$2").replace(/([a-z\d])([A-Z])/g,"$1_$2").toLowerCase()},camelize:function(a){return this.underscore().replace(/(^|_)([^_]+)/g,function(b,c,d,e){b=r.Inflector&&r.Inflector.acronyms&&r.Inflector.acronyms[d];e=a!==k||e>0;if(b)return e?b:b.toLowerCase();return e?d.capitalize():d})},spacify:function(){return this.underscore().replace(/_/g," ")},stripTags:function(){var a=
+this;y(arguments.length>0?arguments:[""],function(b){a=a.replace(o("</?"+b.escapeRegExp()+"[^<>]*>","gi"),"")});return a},removeTags:function(){var a=this;y(arguments.length>0?arguments:["\\S+"],function(b){b=o("<("+b+")[^<>]*(?:\\/>|>.*?<\\/\\1>)","gi");a=a.replace(b,"")});return a},truncate:function(a,b,c){var d;b=E(b)?"...":String(b);a-=b.length;if(this.length<=a)return this.toString();d=b.match(/^(.)\1+$/)?b.slice(0,1):"";for(d=o("[^"+X()+d+"]["+X()+d+"]");a>0&&!d.test(this.slice(a-1,a+1))&&c!==
+h;)a--;return this.slice(0,a)+(a>0?b:"")},assign:function(){var a=m.extended();y(arguments,function(b,c){if(m.isObject(b))a.merge(b);else a[c+1]=b});return this.replace(/\{(.+?)\}/g,function(b,c){return D(a,c)?a[c]:b})},compare:function(a,b){var c=this;a=String(a);if(b===h)b=/\W/g;if(b){a=a.remove(b);c=c.remove(b)}return c==a?0:c<a?-1:1}});
+u(r,h,function(a){return m.isRegExp(a)},{split:function(a,b){var c=[],d=0;a=o(a).addFlag("g");var e,f,g,i;o.c||(e=RegExp("^"+a.source+"$(?!\\s)",a.getFlags()));if(E(b)||b<0)b=Infinity;else{b|=0;if(!b)return[]}for(;f=a.exec(this);){g=f.index+f[0].length;if(g>d){c.push(this.slice(d,f.index));!o.c&&f.length>1&&f[0].replace(e,function(){for(var l=1;l<arguments.length-2;l++)if(E(arguments[l]))f[l]=void 0});f.length>1&&f.index<this.length&&n.prototype.push.apply(c,f.slice(1));i=f[0].length;d=g;if(c.length>=
+b)break}a.lastIndex===f.index&&a.lastIndex++}if(d===this.length){if(i||!a.test(""))c.push("")}else c.push(this.slice(d));return c.length>b?c.slice(0,b):c}});u(r,h,k,{insert:r.prototype.add});o.c=E(o("()??").exec("")[1]);function Z(a,b){var c="";if(b=="g"||a.global)c+="g";if(b=="i"||a.ignoreCase)c+="i";if(b=="m"||a.multiline)c+="m";if(b=="y"||a.g)c+="y";return c}u(o,k,k,{escape:function(a){m.isString(a)||(a=String(a));return a.replace(/([\\/'*+?|()\[\]{}.^$])/g,"\\$1")}});
+u(o,h,k,{getFlags:function(){return Z(this)},setFlags:function(a){return o(this.source,a)},addFlag:function(a){return this.setFlags(Z(this,a))},removeFlag:function(a){return this.setFlags(Z(this).replace(a,""))}});function $(a,b,c,d,e){if(!a.b)a.b=[];a.b.push(setTimeout(function(){a.b.removeAt(f);c.apply(d,e||[])},b));var f=a.b.length}
+u(Function,h,k,{lazy:function(a,b){function c(){if(!(g||f.length==0)){for(var p=Math.max(f.length-l,0);f.length>p;)Function.prototype.apply.apply(e,f.shift());$(d,i,function(){g=k;c()});g=h}}function d(){if(!(g&&f.length>b-2)){f.push([this,arguments]);c()}}var e=this,f=[],g=k,i,l;a=a||1;b=b||Infinity;i=a.ceil();l=U(i/a);return d},delay:function(a){m.isNumber(a)||(a=0);var b=I(arguments,1);$(this,a,this,this,b);return this},debounce:function(a,b){var c=this;return b===k?this.lazy(a,1):function(){c.cancel();
+$(c,a,c,this,arguments)}},cancel:function(){if(m.isArray(this.b))for(;this.b.length>0;)clearTimeout(this.b.shift());return this},after:function(a){var b=this,c=0,d=[];if(m.isNumber(a)){if(a===0){b.call();return b}}else a=1;return function(){var e;d.push(Array.create(arguments));c++;if(c==a){e=b.call(this,d);c=0;d=[];return e}}},once:function(){var a=this;return function(){return D(a,"memo")?a.memo:a.memo=a.apply(this,arguments)}},fill:function(){var a=this,b=I(arguments);return function(){var c=I(arguments);
+K(b,function(d,e){if(M(d)||e>=c.length)c.splice(e,0,d)});return a.apply(this,c)}}});(function(){var a={},b;K(["Array","Boolean","Date","Function","Number","String","RegExp"],function(c){b="is"+c;B.push(b);a[b]=function(d){return F(d,c)}});u(Object,k,k,a)})();A(C,P);
+(function(a){if(!M(this.btoa)){var b=/[^A-Za-z0-9\+\/\=]/g;btoa=function(c){var d="",e,f,g,i,l,p,O=0;do{e=c.charCodeAt(O++);f=c.charCodeAt(O++);g=c.charCodeAt(O++);i=e>>2;e=(e&3)<<4|f>>4;l=(f&15)<<2|g>>6;p=g&63;if(isNaN(f))l=p=64;else if(isNaN(g))p=64;d=d+a.charAt(i)+a.charAt(e)+a.charAt(l)+a.charAt(p)}while(O<c.length);return d};atob=function(c){var d="",e,f,g,i,l,p=0;if(c.match(b))throw Error("String contains invalid base64 characters");c=c.replace(/[^A-Za-z0-9\+\/\=]/g,"");do{e=a.indexOf(c.charAt(p++));
+f=a.indexOf(c.charAt(p++));i=a.indexOf(c.charAt(p++));l=a.indexOf(c.charAt(p++));e=e<<2|f>>4;f=(f&15)<<4|i>>2;g=(i&3)<<6|l;d+=e.chr();if(i!=64)d+=f.chr();if(l!=64)d+=g.chr()}while(p<c.length);return unescape(d)}}})("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=");
+(function(){var a=X().match(/^\s+$/);try{r.prototype.trim.call([1])}catch(b){a=k}var c=o("^["+X()+"]+"),d=o("["+X()+"]+$");u(r,h,!a,{trim:function(){return this.toString().trimLeft().trimRight()},trimLeft:function(){return this.replace(c,"")},trimRight:function(){return this.replace(d,"")}})})();
+(function(){var a;K(la,function(b){b.start.upto(b.end,function(c){Y(b.type,c.chr(),(c+b.shift).chr())})});"\u30a2\u30a4\u30a6\u30a8\u30aa\u30a1\u30a3\u30a5\u30a7\u30a9\u30ab\u30ad\u30af\u30b1\u30b3\u30b5\u30b7\u30b9\u30bb\u30bd\u30bf\u30c1\u30c4\u30c3\u30c6\u30c8\u30ca\u30cb\u30cc\u30cd\u30ce\u30cf\u30d2\u30d5\u30d8\u30db\u30de\u30df\u30e0\u30e1\u30e2\u30e4\u30e3\u30e6\u30e5\u30e8\u30e7\u30e9\u30ea\u30eb\u30ec\u30ed\u30ef\u30f2\u30f3\u30fc\u30fb".each(function(b,c){a="\uff71\uff72\uff73\uff74\uff75\uff67\uff68\uff69\uff6a\uff6b\uff76\uff77\uff78\uff79\uff7a\uff7b\uff7c\uff7d\uff7e\uff7f\uff80\uff81\uff82\uff6f\uff83\uff84\uff85\uff86\uff87\uff88\uff89\uff8a\uff8b\uff8c\uff8d\uff8e\uff8f\uff90\uff91\uff92\uff93\uff94\uff6c\uff95\uff6d\uff96\uff6e\uff97\uff98\uff99\uff9a\uff9b\uff9c\uff66\uff9d\uff70\uff65".charAt(c);
+Y("k",a,b);b.match(qa)&&Y("k",a+"\uff9e",b.shift(1));b.match(ra)&&Y("k",a+"\uff9f",b.shift(2))});"\u3002\u3001\u300c\u300d\uffe5\uffe0\uffe1".each(function(b,c){Y("p","\uff61\uff64\uff62\uff63\u00a5\u00a2\u00a3".charAt(c),b)});Y("k","\uff73\uff9e","\u30f4");Y("k","\uff66\uff9e","\u30fa");Y("s"," ","\u3000")})();
+[{a:["Arabic"],source:"\u0600-\u06ff"},{a:["Cyrillic"],source:"\u0400-\u04ff"},{a:["Devanagari"],source:"\u0900-\u097f"},{a:["Greek"],source:"\u0370-\u03ff"},{a:["Hangul"],source:"\uac00-\ud7af\u1100-\u11ff"},{a:["Han","Kanji"],source:"\u4e00-\u9fff\uf900-\ufaff"},{a:["Hebrew"],source:"\u0590-\u05ff"},{a:["Hiragana"],source:"\u3040-\u309f\u30fb-\u30fc"},{a:["Kana"],source:"\u3040-\u30ff\uff61-\uff9f"},{a:["Katakana"],source:"\u30a0-\u30ff\uff61-\uff9f"},{a:["Latin"],source:"\u0001-\u0080-\u00ff\u0100-\u017f\u0180-\u024f"},
+{a:["Thai"],source:"\u0e00-\u0e7f"}].each(function(a){var b=o("^["+a.source+"\\s]+$"),c=o("["+a.source+"]");a.a.each(function(d){x(r.prototype,"is"+d,function(){return b.test(this.trim())});x(r.prototype,"has"+d,function(){return c.test(this)})})});
+(function(){var a=k;if(Function.prototype.d){a=function(){};var b=a.d();a=new b instanceof b&&!(new a instanceof b)}u(Function,h,!a,{bind:function(c){var d=this,e=I(arguments,1),f,g;if(!m.isFunction(this))throw new TypeError("Function.prototype.bind called on a non-function");g=function(){return d.apply(d.prototype&&this instanceof d?this:c,e.concat(I(arguments)))};f=function(){};f.prototype=this.prototype;g.prototype=new f;return g}})})();v(q);Object.f=v;})(this);
View
67 release/1.2.1/minified/sugar-1.2.1-dates-only.min.js
@@ -0,0 +1,67 @@
+/*
+ * Sugar Library v1.2.1
+ *
+ * Freely distributable and licensed under the MIT-style license.
+ * Copyright (c) 2012 Andrew Plummer
+ * http://sugarjs.com/
+ *
+ * ---------------------------- */
+(function(context){var i=true,j=false;function k(a){return function(){return a}}var l=Object,o=Array,r=RegExp,s=Date,t=String,u=Number,aa=l.defineProperty&&l.defineProperties;function v(a,b,c,d){var f=b?a.prototype:a;w(d,function(g,h){if(typeof c==="function")y(f,g,ba(f[g],h,c));else if(c===i||!f[g])y(f,g,h)})}function ba(a,b,c){return function(){return a&&(c===i||c.apply(this,arguments))?a.apply(this,arguments):b.apply(this,arguments)}}
+function y(a,b,c){if(aa)l.defineProperty(a,b,{value:c,configurable:i,enumerable:j,writable:i});else a[b]=c}function w(a,b){var c=0,d;for(d in a)if(a.hasOwnProperty(d)){b.call(a,d,a[d],c);c++}}function z(a,b,c,d){return a===b?i:l.isRegExp(b)?r(b).test(a):l.isFunction(b)?b.apply(c,[a].concat(d)):l.equal(b,a)}function A(a,b,c,d){return B(b)?a:l.isFunction(b)?b.apply(c,d||[]):l.isFunction(a[b])?a[b].call(a):a[b]}function da(a,b,c,d){a=Array.prototype.slice.call(a,void 0);if(c!==j)a=C(a);D(a,b,d)}
+function B(a){return a===void 0}function E(a){return a!==void 0}function F(a,b,c,d){typeof b=="object"&&w(b,function(f,g){var h=a[f],e=E(h),m=l.isArray(g);if(c===i&&(m||l.isObject(g))){h||(h=m?[]:{});F(h,g,c)}else if(e&&l.isFunction(d))h=d.call(b,f,a[f],b[f]);else if(!e||e&&d!==j)h=b[f];if(E(h))a[f]=h});return a}
+v(l,j,j,{isObject:function(a){return a===null||B(a)?j:l.prototype.toString.call(a)==="[object Object]"&&a.constructor===l},each:function(a,b){b&&w(a,function(c,d){b.call(a,c,d,a)});return a},merge:function(a,b,c){return F(a,b,i,c)}});function D(a,b,c,d){var f;G(b);if(c<0)c=a.length+c;c=isNaN(c)?0:parseInt(c>>0);for(d=d===i?a.length+c:a.length;c<d;){f=c%a.length;if(b.call(a,a[f],f,a)===j)break;c++}}
+function H(a,b,c,d,f){var g,h;D(a,function(e,m,q){if(z(e,b,q,[m,q])){g=e;h=m;return j}},c,d);return f?h:g}function C(a,b,c){b=b||Infinity;c=c||0;var d=[];D(a,function(f){if(l.isArray(f)&&c<b)d=d.concat(C(f,b,c+1));else d.push(f)});return d}function I(a,b,c,d){var f=a.length,g=d==-1,h=g?f-1:0;c=isNaN(c)?h:parseInt(c>>0);if(c<0)c=f+c;if(!g&&c<0||g&&c>=f)c=h;for(;g&&c>=0||!g&&c<f;){if(a[c]===b)return c;c+=d}return-1}function G(a){if(!a||!a.call)throw new TypeError("Callback is not callable");}
+function J(a){if(a.length===0)throw new TypeError("First argument must be defined");}
+v(o,i,function(){var a=arguments;return a.length===0||l.isFunction(a[0])},{every:function(a,b){var c=this.length,d=0;for(J(arguments);d<c;){if(d in this&&!z(this[d],a,b,[d,this]))return j;d++}return i},some:function(a,b){var c=this.length,d=0;for(J(arguments);d<c;){if(d in this&&z(this[d],a,b,[d,this]))return i;d++}return j},map:function(a,b){var c=this.length,d=0,f,g=Array(c);for(J(arguments);d<c;){if(d in this){f=this[d];g[d]=A(f,a,b,[f,d,this])}d++}return g},filter:function(a,b){var c=this.length,
+d=0,f=[];for(J(arguments);d<c;){d in this&&z(this[d],a,b,[d,this])&&f.push(this[d]);d++}return f}});
+v(o,i,j,{indexOf:function(a,b){if(l.isString(this))return this.indexOf(a,b);return I(this,a,b,1)},lastIndexOf:function(a,b){if(l.isString(this))return this.lastIndexOf(a,b);return I(this,a,b,-1)},forEach:function(a,b){var c=this.length,d=0;for(G(a);d<c;){d in this&&a.call(b,this[d],d,this);d++}},reduce:function(a,b){return arrayReduce(this,a,b)},reduceRight:function(a,b){return arrayReduce(this,a,b,i)},groupBy:function(a,b){var c=this,d={},f;D(c,function(g,h){f=A(g,a,c,[g,h,c]);d[f]||(d[f]=[]);d[f].push(g)});
+return l.each(d,b)},compact:function(a){var b=[];D(this,function(c){if(l.isArray(c))b.push(c.compact());else if(a&&c)b.push(c);else if(!a&&E(c)&&c!==null&&(!l.isNumber(c)||!isNaN(c)))b.push(c)});return b}});function K(a,b,c){c=Math[c||"round"];var d=Math.abs(Math.pow(10,b||0));if(b<0)d=1/d;return c(a*d)/d}function ea(a,b,c,d){var f=[];a=parseInt(a);for(var g=d>0;g&&a<=b||!g&&a>=b;){f.push(a);c&&c.call(this,a);a+=d}return f}
+v(u,i,j,{toNumber:function(){return parseFloat(this,10)},ordinalize:function(){var a;if(this>=11&&this<=13)a="th";else switch(this%10){case 1:a="st";break;case 2:a="nd";break;case 3:a="rd";break;default:a="th"}return this.toString()+a},pad:function(a,b,c){c=c||10;var d=this.toNumber()===0?"":this.toString(c).replace(/^-/,"");c=d;a=a-d.replace(/\.\d+$/,"").length;d=0;var f=String("0");if(f!="0")f="";l.isNumber(a)||(a=1);l.isNumber(d)||(d=1);d=f.repeat(a)+c+f.repeat(d);if(b||this<0)d=(this<0?"-":"+")+
+d;return d}});function fa(a,b){function c(){return K(this*b)}function d(){return L(arguments)[g](this)}function f(){return L(arguments)[g](-this)}var g="add"+a.capitalize()+"s";y(u.prototype,a,c);y(u.prototype,a+"s",c);y(u.prototype,a+"Before",f);y(u.prototype,a+"sBefore",f);y(u.prototype,a+"Ago",f);y(u.prototype,a+"sAgo",f);y(u.prototype,a+"After",d);y(u.prototype,a+"sAfter",d);y(u.prototype,a+"FromNow",d);y(u.prototype,a+"sFromNow",d)}
+function M(){return"\t\n\u000b\u000c\r \u00a0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u2028\u2029\u3000\ufeff"}
+v(t,i,j,{capitalize:function(a){return this.toLowerCase().replace(a?/\b[a-z]/g:/^[a-z]/,function(b){return b.toUpperCase()})},repeat:function(a){var b="",c=0;if(l.isNumber(a)&&a>0)for(;c<a;){b+=this;c++}return b},toNumber:function(a){var b=this.replace(/,/g,"");return b.match(/\./)?parseFloat(b):parseInt(b,a||10)},first:function(a){a=B(a)?1:a;return this.substr(0,a)},last:function(a){a=B(a)?1:a;return this.substr(this.length-a<0?0:this.length-a)},to:function(a){if(B(a))a=this.length;return this.slice(0,
+a)},toDate:function(a){return L([this.toString(),a])},assign:function(){var a={};da(arguments,function(b,c){if(l.isObject(b))l.merge(a,b);else a[c+1]=b});return this.replace(/\{(.+?)\}/g,function(b,c){return a.hasOwnProperty(c)?a[c]:b})}});
+var N=["hour","minute","second","millisecond","meridian","utc","offset_sign","offset_hours","offset_minutes"],O="(\\d{1,2}):?(\\d{2})?:?(\\d{2})?(?:\\.(\\d{1,6}))?(am|pm)?(?:(Z)|(?:([+-])(\\d{2})(?::?(\\d{2}))?)?)?",P="\\s*(?:(?:t|at |\\s+)"+O+")?",Q="\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d",R="\u5341\u767e\u5343\u4e07",ga=r("["+Q+R+"]","g"),S=[],T,U,ha=[{src:"(\\d{4})",to:["year"]},{src:"([+-])?(\\d{4})[-.]?({month})[-.]?(\\d{1,2})?",to:["year_sign","year","month","date"]},{src:"(\\d{1,2})[-.\\/]({month})[-.\\/]?(\\d{2,4})?",
+to:["month","date","year"],h:i},{src:"\\/Date\\((\\d+(?:\\+\\d{4})?)\\)\\/",to:["timestamp"],r:j}],ia=[{b:"f{1,4}|ms|milliseconds",format:function(a){return a.getMilliseconds()}},{b:"ss?|seconds",format:function(a){return a.getSeconds()}},{b:"mm?|minutes",format:function(a){return a.getMinutes()}},{b:"hh?|hours|12hr",format:function(a){a=a.getHours(void 0);return a===0?12:a-(a/13|0)*12}},{b:"HH?|24hr",format:function(a){return a.getHours()}},{b:"dd?|date|day",format:function(a){return a.getDate()}},
+{b:"dow|weekday",i:i,format:function(a,b,c){return b.weekdays[a.getDay()+(c-1)*7]}},{b:"MM?",format:function(a){return a.getMonth()+1}},{b:"mon|month",i:i,format:function(a,b,c){return b.months[a.getMonth()+(c-1)*12]}},{b:"y{2,4}|year",format:function(a){return a.getFullYear()}},{b:"[Tt]{1,2}",format:function(a,b,c,d){a=a.getHours(void 0)<12?"am":"pm";if(d.length===1)a=a.first();if(d.first()==="T")a=a.toUpperCase();return a}},{b:"z{1,4}|tz|timezone",text:i,format:function(a,b,c,d){a=a.getUTCOffset();
+if(d=="z"||d=="zz")a=a.replace(/(\d{2})(\d{2})/,function(f,g){return g.toNumber().pad(d.length)});return a}},{b:"iso(tz|timezone)",format:function(a){return a.getUTCOffset(i)}},{b:"ord",format:function(a){return a.getDate().ordinalize()}}],V=[{a:"year",method:"FullYear",c:function(a){return(365+(a?a.isLeapYear()?1:0:0.25))*24*60*60*1E3}},{a:"month",method:"Month",c:function(a,b){var c=30.4375,d;if(a){d=a.daysInMonth();if(b<=d.days())c=d}return c*24*60*60*1E3}},{a:"week",method:"Week",c:k(6048E5)},
+{a:"day",method:"Date",c:k(864E5)},{a:"hour",method:"Hours",c:k(36E5)},{a:"minute",method:"Minutes",c:k(6E4)},{a:"second",method:"Seconds",c:k(1E3)},{a:"millisecond",method:"Milliseconds",c:k(1)}],W={},ja={en:"2;;January,February,March,April,May,June,July,August,September,October,November,December;Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday;millisecond:|s,second:|s,minute:|s,hour:|s,day:|s,week:|s,month:|s,year:|s;one,two,three,four,five,six,seven,eight,nine,ten;a,an,the;the,st|nd|rd|th,of;{num} {unit} {sign},{num} {unit=4-5} {sign} {day},{weekday?} {month} {date}{2} {year?} {time?},{date} {month} {year},{month} {year},{shift?} {weekday} {time?},{shift} week {weekday} {time?},{shift} {unit=5-7},{1} {edge} of {shift?} {unit=4-7?}{month?}{year?},{weekday} {3} {shift} week,{1} {date}{2} of {month},{1}{month?} {date?}{2} of {shift} {unit=6-7},{day} at {time?},{time} {day};{Month} {d}, {yyyy};,yesterday,today,tomorrow;,ago|before,,from now|after|from;,last,the|this,next;last day,end,,first day|beginning",
+ja:"1;\u6708;;\u65e5\u66dc\u65e5,\u6708\u66dc\u65e5,\u706b\u66dc\u65e5,\u6c34\u66dc\u65e5,\u6728\u66dc\u65e5,\u91d1\u66dc\u65e5,\u571f\u66dc\u65e5;\u30df\u30ea\u79d2,\u79d2,\u5206,\u6642\u9593,\u65e5,\u9031\u9593|\u9031,\u30f6\u6708|\u30f5\u6708|\u6708,\u5e74;;;;{num}{unit}{sign},{shift}{unit=5-7}{weekday?},{year}\u5e74{month?}\u6708?{date?}\u65e5?,{month}\u6708{date?}\u65e5?,{date}\u65e5;{yyyy}\u5e74{M}\u6708{d}\u65e5;\u4e00\u6628\u65e5,\u6628\u65e5,\u4eca\u65e5,\u660e\u65e5,\u660e\u5f8c\u65e5;,\u524d,,\u5f8c;,\u53bb|\u5148,,\u6765",
+ko:"1;\uc6d4;;\uc77c\uc694\uc77c,\uc6d4\uc694\uc77c,\ud654\uc694\uc77c,\uc218\uc694\uc77c,\ubaa9\uc694\uc77c,\uae08\uc694\uc77c,\ud1a0\uc694\uc77c;\ubc00\ub9ac\ucd08,\ucd08,\ubd84,\uc2dc\uac04,\uc77c,\uc8fc,\uac1c\uc6d4|\ub2ec,\ub144;\uc77c|\ud55c,\uc774,\uc0bc,\uc0ac,\uc624,\uc721,\uce60,\ud314,\uad6c,\uc2ed;;;{num}{unit} {sign},{shift} {unit=5-7},{shift} {unit=5?} {weekday},{year}\ub144{month?}\uc6d4?{date?}\uc77c?,{month}\uc6d4{date?}\uc77c?,{date}\uc77c;{yyyy}\ub144{M}\uc6d4{d}\uc77c;\uadf8\uc800\uaed8,\uc5b4\uc81c,\uc624\ub298,\ub0b4\uc77c,\ubaa8\ub808;,\uc804,,\ud6c4;,\uc9c0\ub09c|\uc791,\uc774\ubc88,\ub2e4\uc74c|\ub0b4",
+ru:"4;;\u042f\u043d\u0432\u0430\u0440:\u044f|\u044c,\u0424\u0435\u0432\u0440\u0430\u043b:\u044f|\u044c,\u041c\u0430\u0440\u0442:\u0430|,\u0410\u043f\u0440\u0435\u043b:\u044f|\u044c,\u041c\u0430:\u044f|\u0439,\u0418\u044e\u043d:\u044f|\u044c,\u0418\u044e\u043b:\u044f|\u044c,\u0410\u0432\u0433\u0443\u0441\u0442:\u0430|,\u0421\u0435\u043d\u0442\u044f\u0431\u0440:\u044f|\u044c,\u041e\u043a\u0442\u044f\u0431\u0440:\u044f|\u044c,\u041d\u043e\u044f\u0431\u0440:\u044f|\u044c,\u0414\u0435\u043a\u0430\u0431\u0440:\u044f|\u044c;\u0412\u043e\u0441\u043a\u0440\u0435\u0441\u0435\u043d\u044c\u0435,\u041f\u043e\u043d\u0435\u0434\u0435\u043b\u044c\u043d\u0438\u043a,\u0412\u0442\u043e\u0440\u043d\u0438\u043a,\u0421\u0440\u0435\u0434\u0430,\u0427\u0435\u0442\u0432\u0435\u0440\u0433,\u041f\u044f\u0442\u043d\u0438\u0446\u0430,\u0421\u0443\u0431\u0431\u043e\u0442\u0430;\u043c\u0438\u043b\u043b\u0438\u0441\u0435\u043a\u0443\u043d\u0434:\u0430|\u0443|\u044b|,\u0441\u0435\u043a\u0443\u043d\u0434:\u0430|\u0443|\u044b|,\u043c\u0438\u043d\u0443\u0442:\u0430|\u0443|\u044b|,\u0447\u0430\u0441:||\u0430|\u043e\u0432,\u0434\u0435\u043d\u044c|\u0434\u0435\u043d\u044c|\u0434\u043d\u044f|\u0434\u043d\u0435\u0439,\u043d\u0435\u0434\u0435\u043b:\u044f|\u044e|\u0438|\u044c|\u0435,\u043c\u0435\u0441\u044f\u0446:||\u0430|\u0435\u0432|\u0435,\u0433\u043e\u0434|\u0433\u043e\u0434|\u0433\u043e\u0434\u0430|\u043b\u0435\u0442|\u0433\u043e\u0434\u0443;\u043e\u0434:\u0438\u043d|\u043d\u0443,\u0434\u0432:\u0430|\u0435,\u0442\u0440\u0438,\u0447\u0435\u0442\u044b\u0440\u0435,\u043f\u044f\u0442\u044c,\u0448\u0435\u0441\u0442\u044c,\u0441\u0435\u043c\u044c,\u0432\u043e\u0441\u0435\u043c\u044c,\u0434\u0435\u0432\u044f\u0442\u044c,\u0434\u0435\u0441\u044f\u0442\u044c;;\u0432|\u043d\u0430,\u0433\u043e\u0434\u0430;{num} {unit} {sign},{sign} {num} {unit},{date} {month} {year?} {2},{month} {year},{1} {shift} {unit=5-7};{d} {month} {yyyy} \u0433\u043e\u0434\u0430;\u043f\u043e\u0437\u0430\u0432\u0447\u0435\u0440\u0430,\u0432\u0447\u0435\u0440\u0430,\u0441\u0435\u0433\u043e\u0434\u043d\u044f,\u0437\u0430\u0432\u0442\u0440\u0430,\u043f\u043e\u0441\u043b\u0435\u0437\u0430\u0432\u0442\u0440\u0430;,\u043d\u0430\u0437\u0430\u0434,,\u0447\u0435\u0440\u0435\u0437;,\u043f\u0440\u043e\u0448\u043b\u043e:\u0439|\u043c,,\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435:\u0439|\u043c",
+es:"6;;enero,febrero,marzo,abril,mayo,junio,julio,agosto,septiembre,octubre,noviembre,diciembre;domingo,lunes,martes,mi\u00e9rcoles|miercoles,jueves,viernes,s\u00e1bado|sabado;milisegundo:|s,segundo:|s,minuto:|s,hora:|s,d\u00eda|d\u00edas|dia|dias,semana:|s,mes:|es,a\u00f1o|a\u00f1os|ano|anos;uno,dos,tres,cuatro,cinco,seis,siete,ocho,nueve,diez;;el,de;{sign} {num} {unit},{num} {unit} {sign},{date?} {2} {month} {2} {year?},{1} {unit=5-7} {shift},{1} {shift} {unit=5-7};{d} de {month} de {yyyy};anteayer,ayer,hoy,ma\u00f1ana|manana;,hace,,de ahora;,pasad:o|a,,pr\u00f3ximo|pr\u00f3xima|proximo|proxima",
+pt:"6;;janeiro,fevereiro,mar\u00e7o,abril,maio,junho,julho,agosto,setembro,outubro,novembro,dezembro;domingo,segunda-feira,ter\u00e7a-feira,quarta-feira,quinta-feira,sexta-feira,s\u00e1bado|sabado;milisegundo:|s,segundo:|s,minuto:|s,hora:|s,dia:|s,semana:|s,m\u00eas|m\u00eases|mes|meses,ano:|s;um,dois,tr\u00eas|tres,quatro,cinco,seis,sete,oito,nove,dez,uma,duas;;a,de;{num} {unit} {sign},{sign} {num} {unit},{date?} {2} {month} {2} {year?},{1} {unit=5-7} {shift},{1} {shift} {unit=5-7};{d} de {month} de {yyyy};anteontem,ontem,hoje,amanh:\u00e3|a;,atr\u00e1s|atras|h\u00e1|ha,,daqui a;,passad:o|a,,pr\u00f3ximo|pr\u00f3xima|proximo|proxima",
+fr:"2;;janvier,f\u00e9vrier|fevrier,mars,avril,mai,juin,juillet,ao\u00fbt,septembre,octobre,novembre,d\u00e9cembre|decembre;dimanche,lundi,mardi,mercredi,jeudi,vendredi,samedi;milliseconde:|s,seconde:|s,minute:|s,heure:|s,jour:|s,semaine:|s,mois,an:|s|n\u00e9e|nee;un:|e,deux,trois,quatre,cinq,six,sept,huit,neuf,dix;;l'|la|le;{sign} {num} {unit},{sign} {num} {unit},{1} {date?} {month} {year?},{1} {unit=5-7} {shift};{d} {month} {yyyy};,hier,aujourd'hui,demain;,il y a,,dans|d'ici;,derni:er|\u00e8re|ere,,prochain:|e",
+it:"2;;Gennaio,Febbraio,Marzo,Aprile,Maggio,Giugno,Luglio,Agosto,Settembre,Ottobre,Novembre,Dicembre;Domenica,Luned:\u00ec|i,Marted:\u00ec|i,Mercoled:\u00ec|i,Gioved:\u00ec|i,Venerd:\u00ec|i,Sabato;millisecond:o|i,second:o|i,minut:o|i,or:a|e,giorn:o|i,settiman:a|e,mes:e|i,ann:o|i;un:|'|a|o,due,tre,quattro,cinque,sei,sette,otto,nove,dieci;;l'|la|il;{num} {unit} {sign},{weekday?} {date?} {month} {year?},{1} {unit=5-7} {shift},{1} {shift} {unit=5-7};{d} {month} {yyyy};,ieri,oggi,domani,dopodomani;,fa,,da adesso;,scors:o|a,,prossim:o|a",
+de:"2;;Januar,Februar,M\u00e4rz|Marz,April,Mai,Juni,Juli,August,September,Oktober,November,Dezember;Sonntag,Montag,Dienstag,Mittwoch,Donnerstag,Freitag,Samstag;Millisekunde:|n,Sekunde:|n,Minute:|n,Stunde:|n,Tag:|en,Woche:|n,Monat:|en,Jahr:|en;ein:|e|er|em|en,zwei,drei,vier,fuenf,sechs,sieben,acht,neun,zehn;;der;{sign} {num} {unit},{num} {unit} {sign},{num} {unit} {sign},{sign} {num} {unit},{weekday?} {date?} {month} {year?},{shift} {unit=5-7};{d}. {Month} {yyyy};vorgestern,gestern,heute,morgen,\u00fcbermorgen|ubermorgen|uebermorgen;,vor:|her,,in;,letzte:|r|n|s,,n\u00e4chste:|r|n|s+naechste:|r|n|s",
+"zh-TW":"1;\u6708;;\u65e5,\u4e00,\u4e8c,\u4e09,\u56db,\u4e94,\u516d;\u6beb\u79d2,\u79d2\u9418,\u5206\u9418,\u5c0f\u6642,\u5929,\u500b\u661f\u671f|\u9031,\u500b\u6708,\u5e74;;;\u65e5|\u865f;{num}{unit}{sign},\u661f\u671f{weekday},{shift}{unit=5-7},{shift}{unit=5}{weekday},{year}\u5e74{month?}\u6708?{date?}{1},{month}\u6708{date?}{1},{date}{1};{yyyy}\u5e74{M}\u6708{d}\u65e5;\u524d\u5929,\u6628\u5929,\u4eca\u5929,\u660e\u5929,\u5f8c\u5929;,\u524d,,\u5f8c;,\u4e0a|\u53bb,\u9019,\u4e0b|\u660e","zh-CN":"1;\u6708;;\u65e5,\u4e00,\u4e8c,\u4e09,\u56db,\u4e94,\u516d;\u6beb\u79d2,\u79d2\u949f,\u5206\u949f,\u5c0f\u65f6,\u5929,\u4e2a\u661f\u671f|\u5468,\u4e2a\u6708,\u5e74;;;\u65e5|\u53f7;{num}{unit}{sign},\u661f\u671f{weekday},{shift}{unit=5-7},{shift}{unit=5}{weekday},{year}\u5e74{month?}\u6708?{date?}{1},{month}\u6708{date?}{1},{date}{1};{yyyy}\u5e74{M}\u6708{d}\u65e5;\u524d\u5929,\u6628\u5929,\u4eca\u5929,\u660e\u5929,\u540e\u5929;,\u524d,,\u540e;,\u4e0a|\u53bb,\u8fd9,\u4e0b|\u660e"};
+function ka(a){var b=s.addFormat,c=a.code;if(!a.l){b("("+a.months.compact().join("|")+")",["month"],c);b("("+a.weekdays.compact().join("|")+")",["weekday"],c);b("("+a.modifiers.filter(function(d){return d.name==="day"}).map("text").join("|")+")",["day"],c);D(a.formats,function(d){var f=[];d=d.replace(/\s+/g,"[-,. ]*");d=d.replace(/\{(.+?)\}/g,function(g,h){var e=h.match(/\?$/),m=h.match(/(\d)(?:-(\d))?/),q=h.match(/^\d+$/),n=h.replace(/[^a-z]+$/,""),p,x;if(n==="time"){f=f.concat(N);return e?P:O}if(q)p=
+a.optionals[q[0]-1];else if(a[n])p=a[n];else if(a[n+"s"]){p=a[n+"s"];if(m){x=[];D(p,function(pa,qa){var ca=qa%(a.units?8:p.length);if(ca>=m[1]&&ca<=(m[2]||m[1]))x.push(pa)});p=x}p=p.compact().join("|")}if(q)return"(?:"+p+")?";else{f.push(n);return"("+p+")"+(e?"?":"")}});b(d,f,c)});a.l=i}}function X(a,b,c){if(b&&(!l.isString(a)||!a))a=Date.currentLocale;a&&!W[a]&&la(a,c);return W[a]}
+function la(a,b){function c(g,h){g=g.split("+").map(function(e){return e.replace(/(.+):(.+)$/,function(m,q,n){return n.split("|").map(function(p){return q+p}).join("|")})}).join("|");return D(g.split("|"),h)}function d(g,h,e){var m=[];if(b[g]){D(b[g],function(q,n){c(q,function(p,x){m[x*e+n]=p.toLowerCase()})});if(h)m=m.concat(b[g].map(function(q){return q.slice(0,3).toLowerCase()}));return b[g]=m}}function f(g,h){var e="[0-9\uff10-\uff19]"+(g?"{"+g+","+h+"}":"+");if(b.digits)e+="|["+b.digits+"]+";
+return e}b=b||ma(a);if(!b)throw Error("Invalid locale.");d("months",i,12);d("weekdays",i,7);d("units",j,8);d("numbers",j,10);b.code=a;b.date=f(1,2);b.year=f(4,4);b.num=function(){var g=[f()].concat(b.articles);b.digits||(g=g.concat(b.numbers));return g.compact().join("|")}();(function(){var g=[];b.f={};D(b.modifiers,function(h){c(h.text,function(e){b.f[e]=h;g.push({name:h.name,text:e,value:h.value})})});g.groupBy("name",function(h,e){e=e.map("text");if(h==="day")e=e.concat(b.weekdays);b[h]=e.join("|")});
+b.modifiers=g})();if(b.monthSuffix){b.month=f(1,2);b.months=ea(1,12,null,1).map(function(g){return g+b.monthSuffix})}W[a]=new na(b)}
+function ma(a){function b(f){return!!(d[0]&Math.pow(2,f-1))}if(a.slice(0,3)=="en-")a="en";if(!ja[a])return null;var c={modifiers:[]},d=ja[a].split(";");D(["months","weekdays","units","numbers","articles","optionals","formats"],function(f,g){c[f]=d[g+2]?d[g+2].split(","):[]});c.outputFormat=d[9];D(["day","sign","shift","edge"],function(f,g){d[g+10]&&D(d[g+10].split(","),function(h,e){h&&c.modifiers.push({name:f,text:h,value:e-2})})});if(b(1)){c.digits=Q+R;if(c.numbers.length>0)c.digits+=c.numbers.join("");
+else c.numbers=Q.split("");c.monthSuffix=d[1]}c.capitalizeUnit=a=="de";c.hasPlural=b(2);c.pastRelativeFormat=c.formats[0];c.futureRelativeFormat=c.formats[b(3)?1:0];return c}function oa(a){a||(a=Date.currentLocale);return a!="en"&&a!="en-US"}function na(a){l.merge(this,a)}
+v(na,i,j,{getMonth:function(a){return l.isNumber(a)?a-1:H(this.months,r(a,"i"),0,j,i)%12},k:function(a){return H(this.weekdays,r(a,"i"),0,j,i)%7},j:function(a){var b;return l.isNumber(a)?a:a&&(b=this.numbers.indexOf(a))!==-1?(b+1)%10:1},n:function(a){var b=this;return a.replace(this.numbers[9],"").replace(/./g,function(c){return b.j(c)})},m:function(a){return English.units[this.units.indexOf(a)%8]},q:function(a,b,c){var d,f;d=c>0?this.futureRelativeFormat:this.pastRelativeFormat;if(this.code=="ru"){f=
+a.toString().slice(-1);switch(i){case f==1:f=1;break;case f>=2&&f<=4:f=2;break;default:f=3}}else f=this.hasPlural&&a>1?1:0;f=this.units[f*8+b]||this.units[b];if(this.capitalizeUnit)f=f.capitalize();b=H(this.modifiers,function(g){return g.name=="sign"&&g.value==(c>0?1:-1)});return d.assign({num:a,unit:f,sign:b.text})}});function Y(a){var b;if(typeof a[0]=="object")return a;else if(a.length==1&&l.isNumber(a[0]))return[a[0]];b={};D(T,function(c,d){b[c.a]=a[d]});return[b]}
+function ra(a,b){a=a.replace(/[\uff11\uff12\uff13\uff14\uff15\uff16\uff17\uff18\uff19\uff10]/g,function(c){return String.fromCharCode(c.charCodeAt(0)-65248)});if(b!="date"&&b!="month"&&b!="year")return a;return a.replace(ga,function(c){return Q.indexOf(c)+1||""})}function sa(a,b){var c={},d,f;D(b,function(g,h){d=a[h+1];if(!(B(d)||d==="")){d=ra(d,g);if(g==="year")c.s=d;if(g==="millisecond")d*=Math.pow(10,3-d.length);f=parseFloat(d);c[g]=!isNaN(f)?f:d.toLowerCase()}});return c}
+function ta(a,b){var c=new s,d=j,f,g,h,e,m,q,n;if(l.isDate(a))c=a;else if(l.isNumber(a))c=new s(a);else if(l.isObject(a)){c=(new s).set(a,i);e=a}else if(l.isString(a)){ka(X(b,i));g=oa(b);a=a.trim().replace(/\.+$/,"").replace(/^now$/,"");D(S,function(p){var x=a.match(p.p);if(x){h=p;e=sa(x,h.to);f=X(h.o,i);if(e.timestamp){c.setTime(0);e={milliseconds:e.timestamp};return j}if(h.h&&!l.isString(e.month)&&(l.isString(e.date)||g)){n=e.month;e.month=e.date;e.date=n}if(e.year&&e.s.length===2)e.year=K((new s).getFullYear()/
+100)*100-K(e.year/100)*100+e.year;if(e.month){e.month=f.getMonth(e.month);if(e.shift&&!e.unit)e.unit="year"}if(e.weekday&&e.date)delete e.weekday;else if(e.weekday){e.weekday=f.k(e.weekday);if(e.shift&&!e.unit)e.unit="week"}if(e.day&&(n=f.f[e.day])){e.day=n.value;c.resetTime();d=i}else if(e.day&&(n=f.k(e.day))>-1){delete e.day;e.weekday=n}if(e.date&&!l.isNumber(e.date))e.date=f.n(e.date);if(e.meridian)if(e.meridian==="pm"&&e.hour<12)e.hour+=12;if(e.offset_hours||e.offset_minutes){e.utc=i;e.offset_minutes=
+e.offset_minutes||0;e.offset_minutes+=e.offset_hours*60;if(e.offset_sign==="-")e.offset_minutes*=-1;e.minute-=e.offset_minutes}if(e.unit){d=i;q=f.j(e.num);m=f.m(e.unit);if(e.shift||e.edge){q*=(n=f.f[e.shift])?n.value:0;if(m==="month"&&E(e.date)){c.set({day:e.date},i);delete e.date}if(m==="year"&&E(e.month)){c.set({month:e.month,day:e.date},i);delete e.month;delete e.date}}if(e.sign&&(n=f.f[e.sign]))q*=n.value;if(E(e.weekday)){c.set({weekday:e.weekday},i);delete e.weekday}e[m]=(e[m]||0)+q}if(e.year_sign===
+"-")e.year*=-1;return j}});if(h)if(d)c.advance(e);else e.utc?c.setUTC(e,i):c.set(e,i);else c=a?new s(a):new s;if(e&&e.edge){n=f.f[e.edge];D(U.slice(4),function(p){if(E(e[p.a])){m=p.a;return j}});if(m==="year")e.d="month";else if(m==="month"||m==="week")e.d="day";c[(n.value<0?"endOf":"beginningOf")+m.capitalize()]();n.value===-2&&c.resetTime()}}return{e:c,set:e}}
+function Z(a,b,c,d){var f,g=X(d,i),h=r(/^[A-Z]/);if(a.isValid())if(Date[b])b=Date[b];else{if(l.isFunction(b)){f=ua(a);b=b.apply(a,f.concat(g))}}else return"Invalid Date";if(!b&&!c)b=g.outputFormat;else if(!b&&c){f=f||ua(a);if(f[1]===0){f[1]=1;f[0]=1}return g.q(f[0],f[1],f[2])}D(ia,function(e){b=b.replace(r("\\{("+e.b+")(\\d)?\\}",e.i?"i":""),function(m,q,n){m=e.format(a,g,n||1,q);n=q.length;var p=q.match(/^(.)\1+$/);if(e.i){if(n===3)m=m.slice(0,3);if(p||q.match(h))m=m.capitalize()}else if(p&&!e.text)m=
+(l.isNumber(m)?m.pad(n):m.toString()).last(n);return m})});return b}function va(a,b,c){var d=ta(b),f=0,g=b=0,h;if(c>0){b=g=c;h=i}if(!d.e.isValid())return j;if(d.set&&d.set.d){D(V,function(m){if(m.a===d.set.d)f=m.c(d.e,a-d.e)-1});if(d.set.edge||d.set.shift)d.e["beginningOf"+d.set.d.capitalize()]();if(!h&&d.set.sign&&d.set.d!="millisecond"){b=50;g=-50}}c=a.getTime();h=d.e.getTime();var e=h+f;if(d.set&&d.set.d=="week"&&(new Date(e+1)).getHours()!=0)e-=s.DSTOffset;return c>=h-b&&c<=e+g}
+function $(a,b,c,d,f){if(l.isNumber(b)&&f)b={milliseconds:b};else if(l.isNumber(b)){a.setTime(b);return a}if(b.date)b.day=b.date;if(!f&&B(b.day)&&E(b.weekday)){a["set"+(d?"UTC":"")+"Weekday"](b.weekday);b.day=a["get"+(d?"UTC":"")+"Date"](void 0);delete b.weekday}D(U,function(g){if(E(b[g.a])||E(b[g.a+"s"])){b.d=g.a;return j}else if(c&&g.a!=="week"&&g.a!=="year")a["set"+(d?"UTC":"")+g.method](g.a==="day"?1:0)});D(V,function(g){var h=g.a;g=g.method;var e=E(b[h])?b[h]:b[h+"s"];if(!B(e)){if(f){if(h===
+"week"){e=(b.day||0)+e*7;g="Date"}e=e*f+a["get"+g](void 0)}a["set"+(d?"UTC":"")+g](e);if(h==="month"){h=e;if(h<0)h+=12;h%12!=a.getMonth()&&a.setDate(0)}}});return a}function wa(a){a.addDays(4-(a.getDay()||7)).resetTime();return 1+(a.daysSince(a.clone().beginningOfYear())/7|0)}function ua(a){var b;a=a.millisecondsFromNow();var c=Math.abs(a),d=c,f=0;D(U.slice(1),function(g,h){b=K(c/g.c(),1)|0;if(b>=1){d=b;f=h+1}});return[d,f,a]}
+function L(a){var b;b=l.isNumber(a[1])?Y(a)[0]:a[0];return ta(b,a[1]).e}v(s,j,j,{create:function(){return L(arguments)},now:function(){return(new s).getTime()},setLocale:function(a,b){var c=X(a,j,b);if(c){Date.currentLocale=a;ka(c);return c}},getLocale:function(a){return X(a,i)},addFormat:function(a,b,c,d){S.push({h:d,o:c,p:r("^"+a+"$","i"),to:b})}});
+v(s,i,j,{set:function(){var a=Y(arguments);return $(this,a[0],a[1])},setUTC:function(){var a=Y(arguments);return $(this,a[0],a[1],i)},setWeekday:function(a){B(a)||this.setDate(this.getDate()+a-this.getDay())},setUTCWeekday:function(a){B(a)||this.setDate(this.getUTCDate()+a-this.getDay())},setWeek:function(a){if(!B(a)){this.setMonth(0);this.setDate(a*7+1)}},setUTCWeek:function(a){if(!B(a)){this.setMonth(0);this.setUTCDate(a*7+1)}},getWeek:function(){return wa(this)},getUTCWeek:function(){return wa(this.toUTC())},
+getUTCOffset:function(a){var b=this.g?0:this.getTimezoneOffset(),c=a===i?":":"";if(!b&&a)return"Z";return K(-b/60).pad(2,i)+c+(b%60).pad(2)},toUTC:function(){if(this.g)return this;var a=this.clone().addMinutes(this.getTimezoneOffset());a.g=i;return a},isUTC:function(){return this.g||this.getTimezoneOffset()===0},advance:function(){var a=Y(arguments);return $(this,a[0],j,j,1,i)},rewind:function(){var a=Y(arguments);return $(this,a[0],j,j,-1)},isValid:function(){return!isNaN(this.getTime())},isAfter:function(a,
+b){return this.getTime()>s.create(a).getTime()-(b||0)},isBefore:function(a,b){return this.getTime()<s.create(a).getTime()+(b||0)},isBetween:function(a,b,c){var d=this.getTime();a=s.create(a).getTime();var f=s.create(b).getTime();b=Math.min(a,f);a=Math.max(a,f);c=c||0;return b-c<d&&a+c>d},isLeapYear:function(){var a=this.getFullYear();return a%4===0&&a%100!==0||a%400===0},daysInMonth:function(){return 32-(new s(this.getFullYear(),this.getMonth(),32)).getDate()},format:function(a,b){return Z(this,a,
+j,b)},relative:function(a,b){if(l.isString(a)){b=a;a=null}return Z(this,a,i,b)},is:function(a,b){var c;if(l.isString(a)){a=a.trim().toLowerCase();switch(i){case a==="future":return this.getTime()>(new s).getTime();case a==="past":return this.getTime()<(new s).getTime();case a==="weekday":return this.getDay()>0&&this.getDay()<6;case a==="weekend":return this.getDay()===0||this.getDay()===6;case (c=English.weekdays.indexOf(a)%7)>-1:return this.getDay()===c;case (c=English.months.indexOf(a)%12)>-1:return this.getMonth()===
+c}}return va(this,a,b)},resetTime:function(){return this.set({hour:0,minute:0,second:0,millisecond:0})},clone:function(){return new s(this.getTime())},compare:function(){return this-L(arguments)}});v(s,i,j,{getWeekday:s.prototype.getDay,getUTCWeekday:s.prototype.getUTCDay});(function(){var a={};D(["Array","Boolean","Date","Function","Number","String","RegExp"],function(b){a["is"+b]=function(c){return l.prototype.toString.call(c)==="[object "+b+"]"}});v(Object,j,j,a)})();
+(function(){var a=M().match(/^\s+$/);try{t.prototype.trim.call([1])}catch(b){a=j}var c=r("^["+M()+"]+"),d=r("["+M()+"]+$");v(t,i,!a,{trim:function(){return this.toString().trimLeft().trimRight()},trimLeft:function(){return this.replace(c,"")},trimRight:function(){return this.replace(d,"")}})})();English=s.setLocale("en");
+D(V,function(a,b){var c=a.a,d=c.capitalize(),f=a.c();y(s.prototype,c+"sSince",function(g,h){return K((this.getTime()-s.create(g,h).getTime())/f)});y(s.prototype,c+"sUntil",function(g,h){return K((s.create(g,h).getTime()-this.getTime())/f)});y(s.prototype,c+"sAgo",s.prototype[c+"sUntil"]);y(s.prototype,c+"sFromNow",s.prototype[c+"sSince"]);y(s.prototype,"add"+d+"s",function(g){var h={};h[c]=g;return this.advance(h)});fa(c,f);b<3&&D(["Last","This","Next"],function(g){y(s.prototype,"is"+g+d,function(){return this.is(g+
+" "+c)})});if(b<4){y(s.prototype,"beginningOf"+d,function(){var g={};switch(c){case "year":g.year=this.getFullYear();break;case "month":g.month=this.getMonth();break;case "day":g.day=this.getDate();break;case "week":g.weekday=0}return this.set(g,i)});y(s.prototype,"endOf"+d,function(){var g={hours:23,minutes:59,seconds:59,milliseconds:999};switch(c){case "year":g.month=11;g.day=31;break;case "month":g.day=this.daysInMonth();break;case "week":g.weekday=6}return this.set(g,i)})}});
+(function(){T=V.concat();T.splice(2,1);U=V.concat().reverse();var a="\\d{1,2}|"+English.months.join("|");D(ha,function(b){s.addFormat(b.src.replace(/\{month\}/,a)+(b.r===j?"":P),b.to.concat(N),"en",b.h)});s.addFormat(O,N)})();(function(){var a=English.weekdays.slice(0,7),b=English.months.slice(0,12);D(["today","yesterday","tomorrow","weekday","weekend","future","past"].concat(a).concat(b),function(c){y(s.prototype,"is"+c.capitalize(),function(){return this.is(c)})})})();
+v(s,j,i,{DSTOffset:((new s(2E3,6,1)).getTimezoneOffset()-(new s(2E3,0,1)).getTimezoneOffset())*60*1E3,INTERNATIONAL_TIME:"{h}:{mm}:{ss}",RFC1123:"{Dow}, {dd} {Mon} {yyyy} {HH}:{mm}:{ss} {tz}",RFC1036:"{Weekday}, {dd}-{Mon}-{yy} {HH}:{mm}:{ss} {tz}",ISO8601_DATE:"{yyyy}-{MM}-{dd}",ISO8601_DATETIME:"{yyyy}-{MM}-{dd}T{HH}:{mm}:{ss}.{fff}{isotz}"});
+(function(){var a=new s(s.UTC(1999,11,31));if(!a.toISOString||a.toISOString()!=="1999-12-31T00:00:00.000Z")v(s,i,i,{toISOString:function(){return Z(this.toUTC(),s.ISO8601_DATETIME)}});if(!a.toJSON||a.toJSON()!=="1999-12-31T00:00:00.000Z")v(s,i,i,{toJSON:s.prototype.toISOString});v(s,i,j,{iso:s.prototype.toISOString})})();})(this);
View
54 release/1.2.1/minified/sugar-1.2.1-dates.min.js
@@ -0,0 +1,54 @@
+/*
+ * Sugar Library v1.2.1
+ *
+ * Freely distributable and licensed under the MIT-style license.
+ * Copyright (c) 2012 Andrew Plummer
+ * http://sugarjs.com/
+ *
+ * ---------------------------- */
+(function(context){var j=true,k=false;function o(a){return function(){return a}}var p=RegExp,q=Object,s=Date,t=Number;function u(a){return a!==void 0}
+var v=["hour","minute","second","millisecond","meridian","utc","offset_sign","offset_hours","offset_minutes"],w="\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d",x="\u5341\u767e\u5343\u4e07",y=p("["+w+x+"]","g"),z=[],A,B,C=[{src:"(\\d{4})",to:["year"]},{src:"([+-])?(\\d{4})[-.]?({month})[-.]?(\\d{1,2})?",to:["year_sign","year","month","date"]},{src:"(\\d{1,2})[-.\\/]({month})[-.\\/]?(\\d{2,4})?",to:["month","date","year"],h:j},{src:"\\/Date\\((\\d+(?:\\+\\d{4})?)\\)\\/",to:["timestamp"],r:k}],
+D=[{b:"f{1,4}|ms|milliseconds",format:function(a){return a.getMilliseconds()}},{b:"ss?|seconds",format:function(a){return a.getSeconds()}},{b:"mm?|minutes",format:function(a){return a.getMinutes()}},{b:"hh?|hours|12hr",format:function(a){a=a.getHours(void 0);return a===0?12:a-(a/13|0)*12}},{b:"HH?|24hr",format:function(a){return a.getHours()}},{b:"dd?|date|day",format:function(a){return a.getDate()}},{b:"dow|weekday",i:j,format:function(a,b,d){return b.weekdays[a.getDay()+(d-1)*7]}},{b:"MM?",format:function(a){return a.getMonth()+
+1}},{b:"mon|month",i:j,format:function(a,b,d){return b.months[a.getMonth()+(d-1)*12]}},{b:"y{2,4}|year",format:function(a){return a.getFullYear()}},{b:"[Tt]{1,2}",format:function(a,b,d,e){a=a.getHours(void 0)<12?"am":"pm";if(e.length===1)a=a.first();if(e.first()==="T")a=a.toUpperCase();return a}},{b:"z{1,4}|tz|timezone",text:j,format:function(a,b,d,e){a=a.getUTCOffset();if(e=="z"||e=="zz")a=a.replace(/(\d{2})(\d{2})/,function(f,g){return g.toNumber().pad(e.length)});return a}},{b:"iso(tz|timezone)",
+format:function(a){return a.getUTCOffset(j)}},{b:"ord",format:function(a){return a.getDate().ordinalize()}}],E=[{a:"year",method:"FullYear",c:function(a){return(365+(a?a.isLeapYear()?1:0:0.25))*24*60*60*1E3}},{a:"month",method:"Month",c:function(a,b){var d=30.4375,e;if(a){e=a.daysInMonth();if(b<=e.days())d=e}return d*24*60*60*1E3}},{a:"week",method:"Week",c:o(6048E5)},{a:"day",method:"Date",c:o(864E5)},{a:"hour",method:"Hours",c:o(36E5)},{a:"minute",method:"Minutes",c:o(6E4)},{a:"second",method:"Seconds",
+c:o(1E3)},{a:"millisecond",method:"Milliseconds",c:o(1)}],F={},G={en:"2;;January,February,March,April,May,June,July,August,September,October,November,December;Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday;millisecond:|s,second:|s,minute:|s,hour:|s,day:|s,week:|s,month:|s,year:|s;one,two,three,four,five,six,seven,eight,nine,ten;a,an,the;the,st|nd|rd|th,of;{num} {unit} {sign},{num} {unit=4-5} {sign} {day},{weekday?} {month} {date}{1} {year?} {time?},{date} {month} {year},{month} {year},{shift?} {weekday} {time?},{shift} week {weekday} {time?},{shift} {unit=5-7},{0} {edge} of {shift?} {unit=4-7?}{month?}{year?},{weekday} {2} {shift} week,{0} {date}{1} of {month},{0}{month?} {date?}{1} of {shift} {unit=6-7},{day} at {time?},{time} {day};{Month} {d}, {yyyy};,yesterday,today,tomorrow;,ago|before,,from now|after|from;,last,the|this,next;last day,end,,first day|beginning",
+ja:"1;\u6708;;\u65e5\u66dc\u65e5,\u6708\u66dc\u65e5,\u706b\u66dc\u65e5,\u6c34\u66dc\u65e5,\u6728\u66dc\u65e5,\u91d1\u66dc\u65e5,\u571f\u66dc\u65e5;\u30df\u30ea\u79d2,\u79d2,\u5206,\u6642\u9593,\u65e5,\u9031\u9593|\u9031,\u30f6\u6708|\u30f5\u6708|\u6708,\u5e74;;;;{num}{unit}{sign},{shift}{unit=5-7}{weekday?},{year}\u5e74{month?}\u6708?{date?}\u65e5?,{month}\u6708{date?}\u65e5?,{date}\u65e5;{yyyy}\u5e74{M}\u6708{d}\u65e5;\u4e00\u6628\u65e5,\u6628\u65e5,\u4eca\u65e5,\u660e\u65e5,\u660e\u5f8c\u65e5;,\u524d,,\u5f8c;,\u53bb|\u5148,,\u6765",
+ko:"1;\uc6d4;;\uc77c\uc694\uc77c,\uc6d4\uc694\uc77c,\ud654\uc694\uc77c,\uc218\uc694\uc77c,\ubaa9\uc694\uc77c,\uae08\uc694\uc77c,\ud1a0\uc694\uc77c;\ubc00\ub9ac\ucd08,\ucd08,\ubd84,\uc2dc\uac04,\uc77c,\uc8fc,\uac1c\uc6d4|\ub2ec,\ub144;\uc77c|\ud55c,\uc774,\uc0bc,\uc0ac,\uc624,\uc721,\uce60,\ud314,\uad6c,\uc2ed;;;{num}{unit} {sign},{shift} {unit=5-7},{shift} {unit=5?} {weekday},{year}\ub144{month?}\uc6d4?{date?}\uc77c?,{month}\uc6d4{date?}\uc77c?,{date}\uc77c;{yyyy}\ub144{M}\uc6d4{d}\uc77c;\uadf8\uc800\uaed8,\uc5b4\uc81c,\uc624\ub298,\ub0b4\uc77c,\ubaa8\ub808;,\uc804,,\ud6c4;,\uc9c0\ub09c|\uc791,\uc774\ubc88,\ub2e4\uc74c|\ub0b4",
+ru:"4;;\u042f\u043d\u0432\u0430\u0440:\u044f|\u044c,\u0424\u0435\u0432\u0440\u0430\u043b:\u044f|\u044c,\u041c\u0430\u0440\u0442:\u0430|,\u0410\u043f\u0440\u0435\u043b:\u044f|\u044c,\u041c\u0430:\u044f|\u0439,\u0418\u044e\u043d:\u044f|\u044c,\u0418\u044e\u043b:\u044f|\u044c,\u0410\u0432\u0433\u0443\u0441\u0442:\u0430|,\u0421\u0435\u043d\u0442\u044f\u0431\u0440:\u044f|\u044c,\u041e\u043a\u0442\u044f\u0431\u0440:\u044f|\u044c,\u041d\u043e\u044f\u0431\u0440:\u044f|\u044c,\u0414\u0435\u043a\u0430\u0431\u0440:\u044f|\u044c;\u0412\u043e\u0441\u043a\u0440\u0435\u0441\u0435\u043d\u044c\u0435,\u041f\u043e\u043d\u0435\u0434\u0435\u043b\u044c\u043d\u0438\u043a,\u0412\u0442\u043e\u0440\u043d\u0438\u043a,\u0421\u0440\u0435\u0434\u0430,\u0427\u0435\u0442\u0432\u0435\u0440\u0433,\u041f\u044f\u0442\u043d\u0438\u0446\u0430,\u0421\u0443\u0431\u0431\u043e\u0442\u0430;\u043c\u0438\u043b\u043b\u0438\u0441\u0435\u043a\u0443\u043d\u0434:\u0430|\u0443|\u044b|,\u0441\u0435\u043a\u0443\u043d\u0434:\u0430|\u0443|\u044b|,\u043c\u0438\u043d\u0443\u0442:\u0430|\u0443|\u044b|,\u0447\u0430\u0441:||\u0430|\u043e\u0432,\u0434\u0435\u043d\u044c|\u0434\u0435\u043d\u044c|\u0434\u043d\u044f|\u0434\u043d\u0435\u0439,\u043d\u0435\u0434\u0435\u043b:\u044f|\u044e|\u0438|\u044c|\u0435,\u043c\u0435\u0441\u044f\u0446:||\u0430|\u0435\u0432|\u0435,\u0433\u043e\u0434|\u0433\u043e\u0434|\u0433\u043e\u0434\u0430|\u043b\u0435\u0442|\u0433\u043e\u0434\u0443;\u043e\u0434:\u0438\u043d|\u043d\u0443,\u0434\u0432:\u0430|\u0435,\u0442\u0440\u0438,\u0447\u0435\u0442\u044b\u0440\u0435,\u043f\u044f\u0442\u044c,\u0448\u0435\u0441\u0442\u044c,\u0441\u0435\u043c\u044c,\u0432\u043e\u0441\u0435\u043c\u044c,\u0434\u0435\u0432\u044f\u0442\u044c,\u0434\u0435\u0441\u044f\u0442\u044c;;\u0432|\u043d\u0430,\u0433\u043e\u0434\u0430;{num} {unit} {sign},{sign} {num} {unit},{date} {month} {year?} {1},{month} {year},{0} {shift} {unit=5-7};{d} {month} {yyyy} \u0433\u043e\u0434\u0430;\u043f\u043e\u0437\u0430\u0432\u0447\u0435\u0440\u0430,\u0432\u0447\u0435\u0440\u0430,\u0441\u0435\u0433\u043e\u0434\u043d\u044f,\u0437\u0430\u0432\u0442\u0440\u0430,\u043f\u043e\u0441\u043b\u0435\u0437\u0430\u0432\u0442\u0440\u0430;,\u043d\u0430\u0437\u0430\u0434,,\u0447\u0435\u0440\u0435\u0437;,\u043f\u0440\u043e\u0448\u043b\u043e:\u0439|\u043c,,\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435:\u0439|\u043c",
+es:"6;;enero,febrero,marzo,abril,mayo,junio,julio,agosto,septiembre,octubre,noviembre,diciembre;domingo,lunes,martes,mi\u00e9rcoles|miercoles,jueves,viernes,s\u00e1bado|sabado;milisegundo:|s,segundo:|s,minuto:|s,hora:|s,d\u00eda|d\u00edas|dia|dias,semana:|s,mes:|es,a\u00f1o|a\u00f1os|ano|anos;uno,dos,tres,cuatro,cinco,seis,siete,ocho,nueve,diez;;el,de;{sign} {num} {unit},{num} {unit} {sign},{date?} {1} {month} {1} {year?},{0} {unit=5-7} {shift},{0} {shift} {unit=5-7};{d} de {month} de {yyyy};anteayer,ayer,hoy,ma\u00f1ana|manana;,hace,,de ahora;,pasad:o|a,,pr\u00f3ximo|pr\u00f3xima|proximo|proxima",
+pt:"6;;janeiro,fevereiro,mar\u00e7o,abril,maio,junho,julho,agosto,setembro,outubro,novembro,dezembro;domingo,segunda-feira,ter\u00e7a-feira,quarta-feira,quinta-feira,sexta-feira,s\u00e1bado|sabado;milisegundo:|s,segundo:|s,minuto:|s,hora:|s,dia:|s,semana:|s,m\u00eas|m\u00eases|mes|meses,ano:|s;um,dois,tr\u00eas|tres,quatro,cinco,seis,sete,oito,nove,dez,uma,duas;;a,de;{num} {unit} {sign},{sign} {num} {unit},{date?} {1} {month} {1} {year?},{0} {unit=5-7} {shift},{0} {shift} {unit=5-7};{d} de {month} de {yyyy};anteontem,ontem,hoje,amanh:\u00e3|a;,atr\u00e1s|atras|h\u00e1|ha,,daqui a;,passad:o|a,,pr\u00f3ximo|pr\u00f3xima|proximo|proxima",
+fr:"2;;janvier,f\u00e9vrier|fevrier,mars,avril,mai,juin,juillet,ao\u00fbt,septembre,octobre,novembre,d\u00e9cembre|decembre;dimanche,lundi,mardi,mercredi,jeudi,vendredi,samedi;milliseconde:|s,seconde:|s,minute:|s,heure:|s,jour:|s,semaine:|s,mois,an:|s|n\u00e9e|nee;un:|e,deux,trois,quatre,cinq,six,sept,huit,neuf,dix;;l'|la|le;{sign} {num} {unit},{sign} {num} {unit},{0} {date?} {month} {year?},{0} {unit=5-7} {shift};{d} {month} {yyyy};,hier,aujourd'hui,demain;,il y a,,dans|d'ici;,derni:er|\u00e8re|ere,,prochain:|e",
+it:"2;;Gennaio,Febbraio,Marzo,Aprile,Maggio,Giugno,Luglio,Agosto,Settembre,Ottobre,Novembre,Dicembre;Domenica,Luned:\u00ec|i,Marted:\u00ec|i,Mercoled:\u00ec|i,Gioved:\u00ec|i,Venerd:\u00ec|i,Sabato;millisecond:o|i,second:o|i,minut:o|i,or:a|e,giorn:o|i,settiman:a|e,mes:e|i,ann:o|i;un:|'|a|o,due,tre,quattro,cinque,sei,sette,otto,nove,dieci;;l'|la|il;{num} {unit} {sign},{weekday?} {date?} {month} {year?},{0} {unit=5-7} {shift},{0} {shift} {unit=5-7};{d} {month} {yyyy};,ieri,oggi,domani,dopodomani;,fa,,da adesso;,scors:o|a,,prossim:o|a",
+de:"2;;Januar,Februar,M\u00e4rz|Marz,April,Mai,Juni,Juli,August,September,Oktober,November,Dezember;Sonntag,Montag,Dienstag,Mittwoch,Donnerstag,Freitag,Samstag;Millisekunde:|n,Sekunde:|n,Minute:|n,Stunde:|n,Tag:|en,Woche:|n,Monat:|en,Jahr:|en;ein:|e|er|em|en,zwei,drei,vier,fuenf,sechs,sieben,acht,neun,zehn;;der;{sign} {num} {unit},{num} {unit} {sign},{num} {unit} {sign},{sign} {num} {unit},{weekday?} {date?} {month} {year?},{shift} {unit=5-7};{d}. {Month} {yyyy};vorgestern,gestern,heute,morgen,\u00fcbermorgen|ubermorgen|uebermorgen;,vor:|her,,in;,letzte:|r|n|s,,n\u00e4chste:|r|n|s+naechste:|r|n|s",
+"zh-TW":"1;\u6708;;\u65e5,\u4e00,\u4e8c,\u4e09,\u56db,\u4e94,\u516d;\u6beb\u79d2,\u79d2\u9418,\u5206\u9418,\u5c0f\u6642,\u5929,\u500b\u661f\u671f|\u9031,\u500b\u6708,\u5e74;;;\u65e5|\u865f;{num}{unit}{sign},\u661f\u671f{weekday},{shift}{unit=5-7},{shift}{unit=5}{weekday},{year}\u5e74{month?}\u6708?{date?}{0},{month}\u6708{date?}{0},{date}{0};{yyyy}\u5e74{M}\u6708{d}\u65e5;\u524d\u5929,\u6628\u5929,\u4eca\u5929,\u660e\u5929,\u5f8c\u5929;,\u524d,,\u5f8c;,\u4e0a|\u53bb,\u9019,\u4e0b|\u660e","zh-CN":"1;\u6708;;\u65e5,\u4e00,\u4e8c,\u4e09,\u56db,\u4e94,\u516d;\u6beb\u79d2,\u79d2\u949f,\u5206\u949f,\u5c0f\u65f6,\u5929,\u4e2a\u661f\u671f|\u5468,\u4e2a\u6708,\u5e74;;;\u65e5|\u53f7;{num}{unit}{sign},\u661f\u671f{weekday},{shift}{unit=5-7},{shift}{unit=5}{weekday},{year}\u5e74{month?}\u6708?{date?}{0},{month}\u6708{date?}{0},{date}{0};{yyyy}\u5e74{M}\u6708{d}\u65e5;\u524d\u5929,\u6628\u5929,\u4eca\u5929,\u660e\u5929,\u540e\u5929;,\u524d,,\u540e;,\u4e0a|\u53bb,\u8fd9,\u4e0b|\u660e"};
+function H(a){var b=a.code;if(!a.l){s.addFormat("("+a.months.compact().join("|")+")",["month"],b);s.addFormat("("+a.weekdays.compact().join("|")+")",["weekday"],b);s.addFormat("("+a.modifiers.filter(function(d){return d.name==="day"}).map("src").join("|")+")",["day"],b);a.formats.each(function(d){a.addFormat(d,b,k)});a.l=j}}function I(a,b,d){if(b&&(!q.isString(a)||!a))a=Date.currentLocale;if(a&&!F[a]||d)J(a,d);return F[a]}
+function J(a,b){function d(g,h){g=g.split("+").map(function(c){return c.replace(/(.+):(.+)$/,function(i,m,l){return l.split("|").map(function(n){return m+n}).join("|")})}).join("|");return g.split("|").each(h)}function e(g,h,c){var i=[];if(b[g]){b[g].forEach(function(m,l){d(m,function(n,r){i[r*c+l]=n.toLowerCase()})});if(h)i=i.concat(b[g].map(function(m){return m.slice(0,3).toLowerCase()}));return b[g]=i}}function f(g,h){var c="[0-9\uff10-\uff19]"+(g?"{"+g+","+h+"}":"+");if(b.digits)c+="|["+b.digits+
+"]+";return c}b=b||L(a);if(!b)throw Error("Invalid locale.");e("months",j,12);e("weekdays",j,7);e("units",k,8);e("numbers",k,10);b.code=a;b.date=f(1,2);b.year=f(4,4);b.num=function(){var g=[f()].concat(b.articles);b.digits||(g=g.concat(b.numbers));return g.compact().join("|")}();(function(){var g=[];b.f={};b.modifiers.each(function(h){d(h.src,function(c){b.f[c]=h;g.push({name:h.name,src:c,value:h.value})})});g.groupBy("name",function(h,c){c=c.map("src");if(h==="day")c=c.concat(b.weekdays);b[h]=c.join("|")});
+b.modifiers=g})();if(b.monthSuffix){b.month=f(1,2);b.months=(1).upto(12).map(function(g){return g+b.monthSuffix})}F[a]=new M(b)}
+function L(a){function b(f){return!!(e[0]&Math.pow(2,f-1))}if(a.slice(0,3)=="en-")a="en";if(!G[a])return null;var d={modifiers:[]},e=G[a].split(";");["months","weekdays","units","numbers","articles","optionals","formats"].each(function(f,g){d[f]=e[g+2]?e[g+2].split(","):[]});d.outputFormat=e[9];["day","sign","shift","edge"].each(function(f,g){e[g+10]&&e[g+10].split(",").each(function(h,c){h&&d.modifiers.push({name:f,src:h,value:c-2})})});if(b(1)){d.digits=w+x;if(d.numbers.length>0)d.digits+=d.numbers.join("");
+else d.numbers=w.split("");d.monthSuffix=e[1]}d.capitalizeUnit=a=="de";d.hasPlural=b(2);d.pastRelativeFormat=d.formats[0];d.futureRelativeFormat=d.formats[b(3)?1:0];return d}function N(a){a||(a=Date.currentLocale);return a!="en"&&a!="en-US"}function M(a){q.merge(this,a)}
+q.merge(M.prototype,{getMonth:function(a){return q.isNumber(a)?a-1:this.months.findIndex(p(a,"i"))%12},k:function(a){return this.weekdays.findIndex(p(a,"i"))%7},j:function(a){var b;return q.isNumber(a)?a:a&&(b=this.numbers.indexOf(a))!==-1?(b+1)%10:1},n:function(a){var b=this;return a.replace(this.numbers[9],"").each(function(d){return b.j(d)}).join("")},m:function(a){return English.units[this.units.indexOf(a)%8]},q:function(a,b,d){var e,f;e=d>0?this.futureRelativeFormat:this.pastRelativeFormat;if(this.code==
+"ru"){f=a.toString().from(-1);switch(j){case f==1:f=1;break;case f>=2&&f<=4:f=2;break;default:f=3}}else f=this.hasPlural&&a>1?1:0;f=this.units[f*8+b]||this.units[b];if(this.capitalizeUnit)f=f.capitalize();b=this.modifiers.find(function(g){return g.name=="sign"&&g.value==(d>0?1:-1)});return e.assign({num:a,unit:f,sign:b.src})},addFormat:function(a,b,d){var e=[],f=this;d!==k&&f.t.push(a);a=a.replace(/\s+/g,"[-,. ]*");a=a.replace(/\{(.+?)\}/g,function(g,h){var c=h.match(/\?$/),i=h.match(/(\d)(?:-(\d))?/),
+m=h.match(/^\d+$/),l=h.replace(/[^a-z]+$/,""),n,r;if(l==="time"){e=e.concat(v);return c?"\\s*(?:(?:t|at |\\s+)(\\d{1,2}):?(\\d{2})?:?(\\d{2})?(?:\\.(\\d{1,6}))?(am|pm)?(?:(Z)|(?:([+-])(\\d{2})(?::?(\\d{2}))?)?)?)?":"(\\d{1,2}):?(\\d{2})?:?(\\d{2})?(?:\\.(\\d{1,6}))?(am|pm)?(?:(Z)|(?:([+-])(\\d{2})(?::?(\\d{2}))?)?)?"}if(m)n=f.optionals[m[0]];else if(f[l])n=f[l];else if(f[l+"s"]){n=f[l+"s"];if(i){r=[];n.forEach(function(W,X){var K=X%(f.units?8:n.length);if(K>=i[1]&&K<=(i[2]||i[1]))r.push(W)});n=r}n=
+n.compact().join("|")}if(m)return"(?:"+n+")?";else{e.push(l);return"("+n+")"+(c?"?":"")}});s.addFormat(a,e,b)}});function O(a){var b;if(q.isObject(a[0]))return a;else if(a.length==1&&q.isNumber(a[0]))return[a[0]];b={};A.each(function(d,e){b[d.a]=a[e]});return[b]}function P(a,b){if(b!="date"&&b!="month"&&b!="year")return a;return a.replace(y,function(d){return w.indexOf(d)+1||""})}
+function Q(a,b){var d={},e,f;b.each(function(g,h){e=a[h+1];if(!(e===void 0||e==="")){e=P(e.hankaku("n"),g);if(g==="year")d.s=e;if(g==="millisecond")e*=Math.pow(10,3-e.length);f=parseFloat(e);d[g]=!isNaN(f)?f:e.toLowerCase()}});return d}
+function R(a,b){var d=new s,e=k,f,g,h,c,i,m,l;if(q.isDate(a))d=a;else if(q.isNumber(a))d=new s(a);else if(q.isObject(a)){d=(new s).set(a,j);c=a}else if(q.isString(a)){H(I(b,j));g=N(b);a=a.trim().replace(/\.+$/,"").replace(/^now$/,"");z.each(function(n){var r=a.match(n.p);if(r){h=n;c=Q(r,h.to);f=I(h.o,j);if(c.timestamp){d.setTime(0);c={milliseconds:c.timestamp};return k}if(h.h&&!q.isString(c.month)&&(q.isString(c.date)||g)){l=c.month;c.month=c.date;c.date=l}if(c.year&&c.s.length===2)c.year=((new s).getFullYear()/
+100).round()*100-(c.year/100).round()*100+c.year;if(c.month){c.month=f.getMonth(c.month);if(c.shift&&!c.unit)c.unit="year"}if(c.weekday&&c.date)delete c.weekday;else if(c.weekday){c.weekday=f.k(c.weekday);if(c.shift&&!c.unit)c.unit="week"}if(c.day&&(l=f.f[c.day])){c.day=l.value;d.resetTime();e=j}else if(c.day&&(l=f.k(c.day))>-1){delete c.day;c.weekday=l}if(c.date&&!q.isNumber(c.date))c.date=f.n(c.date);if(c.meridian)if(c.meridian==="pm"&&c.hour<12)c.hour+=12;if(c.offset_hours||c.offset_minutes){c.utc=
+j;c.offset_minutes=c.offset_minutes||0;c.offset_minutes+=c.offset_hours*60;if(c.offset_sign==="-")c.offset_minutes*=-1;c.minute-=c.offset_minutes}if(c.unit){e=j;m=f.j(c.num);i=f.m(c.unit);if(c.shift||c.edge){m*=(l=f.f[c.shift])?l.value:0;if(i==="month"&&u(c.date)){d.set({day:c.date},j);delete c.date}if(i==="year"&&u(c.month)){d.set({month:c.month,day:c.date},j);delete c.month;delete c.date}}if(c.sign&&(l=f.f[c.sign]))m*=l.value;if(u(c.weekday)){d.set({weekday:c.weekday},j);delete c.weekday}c[i]=(c[i]||
+0)+m}if(c.year_sign==="-")c.year*=-1;return k}});if(h)if(e)d.advance(c);else c.utc?d.setUTC(c,j):d.set(c,j);else d=a?new s(a):new s;if(c&&c.edge){l=f.f[c.edge];B.slice(4).each(function(n){if(u(c[n.a])){i=n.a;return k}});if(i==="year")c.d="month";else if(i==="month"||i==="week")c.d="day";d[(l.value<0?"endOf":"beginningOf")+i.capitalize()]();l.value===-2&&d.resetTime()}}return{e:d,set:c}}
+function S(a,b,d,e){var f,g=I(e,j),h=p(/^[A-Z]/);if(a.isValid())if(Date[b])b=Date[b];else{if(q.isFunction(b)){f=T(a);b=b.apply(a,f.concat(g))}}else return"Invalid Date";if(!b&&!d)b=g.outputFormat;else if(!b&&d){f=f||T(a);if(f[1]===0){f[1]=1;f[0]=1}return g.q(f[0],f[1],f[2])}D.each(function(c){b=b.replace(p("\\{("+c.b+")(\\d)?\\}",c.i?"i":""),function(i,m,l){i=c.format(a,g,l||1,m);l=m.length;var n=m.match(/^(.)\1+$/);if(c.i){if(l===3)i=i.to(3);if(n||m.match(h))i=i.capitalize()}else if(n&&!c.text)i=
+(q.isNumber(i)?i.pad(l):i.toString()).last(l);return i})});return b}function U(a,b,d){var e=R(b),f=0,g=b=0,h;if(d>0){b=g=d;h=j}if(!e.e.isValid())return k;if(e.set&&e.set.d){E.each(function(i){if(i.a===e.set.d)f=i.c(e.e,a-e.e)-1});if(e.set.edge||e.set.shift)e.e["beginningOf"+e.set.d.capitalize()]();if(!h&&e.set.sign&&e.set.d!="millisecond"){b=50;g=-50}}d=a.getTime();h=e.e.getTime();var c=h+f;if(e.set&&e.set.d=="week"&&(new Date(c+1)).getHours()!=0)c-=s.DSTOffset;return d>=h-b&&d<=c+g}
+function V(a,b,d,e,f){if(q.isNumber(b)&&f)b={milliseconds:b};else if(q.isNumber(b)){a.setTime(b);return a}if(b.date)b.day=b.date;if(!f&&b.day===void 0&&u(b.weekday)){a["set"+(e?"UTC":"")+"Weekday"](b.weekday);b.day=a["get"+(e?"UTC":"")+"Date"](void 0);delete b.weekday}B.each(function(g){if(u(b[g.a])||u(b[g.a+"s"])){b.d=g.a;return k}else if(d&&g.a!=="week"&&g.a!=="year")a["set"+(e?"UTC":"")+g.method](g.a==="day"?1:0)});E.each(function(g){var h=g.a;g=g.method;var c=u(b[h])?b[h]:b[h+"s"];if(c!==void 0){if(f){if(h===
+"week"){c=(b.day||0)+c*7;g="Date"}c=c*f+a["get"+g](void 0)}a["set"+(e?"UTC":"")+g](c);if(h==="month"){h=c;if(h<0)h+=12;h%12!=a.getMonth()&&a.setDate(0)}}});return a}function Y(a){a.addDays(4-(a.getDay()||7)).resetTime();return 1+(a.daysSince(a.clone().beginningOfYear())/7|0)}function T(a){var b;a=a.millisecondsFromNow();var d=a.abs(),e=d,f=0;B.from(1).each(function(g,h){b=(d/g.c()*10).round()/10|0;if(b>=1){e=b;f=h+1}});return[e,f,a]}
+function Z(a){var b;b=q.isNumber(a[1])?O(a)[0]:a[0];return R(b,a[1]).e}function aa(a,b){function d(){return(this*b).round()}function e(){return Z(arguments)[g](this)}function f(){return Z(arguments)[g](-this)}var g="add"+a.capitalize()+"s",h={};h[a]=d;h[a+"s"]=d;h[a+"Before"]=f;h[a+"sBefore"]=f;h[a+"Ago"]=f;h[a+"sAgo"]=f;h[a+"After"]=e;h[a+"sAfter"]=e;h[a+"FromNow"]=e;h[a+"sFromNow"]=e;t.extend(h)}
+function $(a){var b=new s(s.UTC(1999,11,31)),d={};if(!b[a]||b[a]()!=="1999-12-31T00:00:00.000Z"){d[a]=function(){return S(this.toUTC(),s.ISO8601_DATETIME)};s.extend(d,j)}}s.extend({create:function(){return Z(arguments)},now:function(){return(new s).getTime()},setLocale:function(a,b){var d=I(a,k,b);if(d){Date.currentLocale=a;H(d);return d}},getLocale:function(a){return I(a,j)},addFormat:function(a,b,d,e){z.push({h:e,o:d,p:p("^"+a+"$","i"),to:b})}},k,k);
+s.extend({set:function(){var a=O(arguments);return V(this,a[0],a[1])},setUTC:function(){var a=O(arguments);return V(this,a[0],a[1],j)},setWeekday:function(a){a===void 0||this.setDate(this.getDate()+a-this.getDay())},setUTCWeekday:function(a){a===void 0||this.setDate(this.getUTCDate()+a-this.getDay())},setWeek:function(a){if(a!==void 0){this.setMonth(0);this.setDate(a*7+1)}},setUTCWeek:function(a){if(a!==void 0){this.setMonth(0);this.setUTCDate(a*7+1)}},getWeek:function(){return Y(this)},getUTCWeek:function(){return Y(this.toUTC())},
+getUTCOffset:function(a){var b=this.g?0:this.getTimezoneOffset(),d=a===j?":":"";if(!b&&a)return"Z";return(-b/60).round().pad(2,j)+d+(b%60).pad(2)},toUTC:function(){if(this.g)return this;var a=this.clone().addMinutes(this.getTimezoneOffset());a.g=j;return a},isUTC:function(){return this.g||this.getTimezoneOffset()===0},advance:function(){var a=O(arguments);return V(this,a[0],k,k,1,j)},rewind:function(){var a=O(arguments);return V(this,a[0],k,k,-1)},isValid:function(){return!isNaN(this.getTime())},
+isAfter:function(a,b){return this.getTime()>s.create(a).getTime()-(b||0)},isBefore:function(a,b){return this.getTime()<s.create(a).getTime()+(b||0)},isBetween:function(a,b,d){var e=this.getTime();a=s.create(a).getTime();var f=s.create(b).getTime();b=Math.min(a,f);a=Math.max(a,f);d=d||0;return b-d<e&&a+d>e},isLeapYear:function(){var a=this.getFullYear();return a%4===0&&a%100!==0||a%400===0},daysInMonth:function(){return 32-(new s(this.getFullYear(),this.getMonth(),32)).getDate()},format:function(a,
+b){return S(this,a,k,b)},relative:function(a,b){if(q.isString(a)){b=a;a=null}return S(this,a,j,b)},is:function(a,b){var d;if(q.isString(a)){a=a.trim().toLowerCase();switch(j){case a==="future":return this.getTime()>(new s).getTime();case a==="past":return this.getTime()<(new s).getTime();case a==="weekday":return this.getDay()>0&&this.getDay()<6;case a==="weekend":return this.getDay()===0||this.getDay()===6;case (d=English.weekdays.indexOf(a)%7)>-1:return this.getDay()===d;case (d=English.months.indexOf(a)%
+12)>-1:return this.getMonth()===d}}return U(this,a,b)},resetTime:function(){return this.set({hour:0,minute:0,second:0,millisecond:0})},clone:function(){return new s(this.getTime())},compare:function(){return this-Z(arguments)}});s.extend({iso:function(){return this.toISOString()},getWeekday:s.prototype.getDay,getUTCWeekday:s.prototype.getUTCDay});English=s.setLocale("en");
+(function(){var a={};E.each(function(b,d){function e(i,m){return((s.create(i,m).getTime()-this.getTime())/c).round()}function f(i,m){return((this.getTime()-s.create(i,m).getTime())/c).round()}var g=b.a,h=g.capitalize(),c=b.c();a[g+"sAgo"]=e;a[g+"sUntil"]=e;a[g+"sSince"]=f;a[g+"sFromNow"]=f;a["add"+h+"s"]=function(i){var m={};m[g]=i;return this.advance(m)};aa(g,c);d<3&&["Last","This","Next"].each(function(i){a["is"+i+h]=function(){return this.is(i+" "+g)}});if(d<4){a["beginningOf"+h]=function(){var i=
+{};switch(g){case "year":i.year=this.getFullYear();break;case "month":i.month=this.getMonth();break;case "day":i.day=this.getDate();break;case "week":i.weekday=0}return this.set(i,j)};a["endOf"+h]=function(){var i={hours:23,minutes:59,seconds:59,milliseconds:999};switch(g){case "year":i.month=11;i.day=31;break;case "month":i.day=this.daysInMonth();break;case "week":i.weekday=6}return this.set(i,j)}}});s.extend(a)})();
+(function(){A=E.clone().removeAt(2);B=E.clone().reverse();var a="\\d{1,2}|"+English.months.join("|");C.each(function(b){s.addFormat(b.src.replace(/\{month\}/,a)+(b.r===k?"":"\\s*(?:(?:t|at |\\s+)(\\d{1,2}):?(\\d{2})?:?(\\d{2})?(?:\\.(\\d{1,6}))?(am|pm)?(?:(Z)|(?:([+-])(\\d{2})(?::?(\\d{2}))?)?)?)?"),b.to.concat(v),"en",b.h)});s.addFormat("(\\d{1,2}):?(\\d{2})?:?(\\d{2})?(?:\\.(\\d{1,6}))?(am|pm)?(?:(Z)|(?:([+-])(\\d{2})(?::?(\\d{2}))?)?)?",v)})();
+(function(){var a={},b=English.weekdays.slice(0,7),d=English.months.slice(0,12);["today","yesterday","tomorrow","weekday","weekend","future","past"].concat(b).concat(d).each(function(e){a["is"+e.capitalize()]=function(){return this.is(e)}});s.extend(a)})();$("toISOString");$("toJSON");
+s.extend({DSTOffset:((new s(2E3,6,1)).getTimezoneOffset()-(new s(2E3,0,1)).getTimezoneOffset())*60*1E3,INTERNATIONAL_TIME:"{h}:{mm}:{ss}",RFC1123:"{Dow}, {dd} {Mon} {yyyy} {HH}:{mm}:{ss} {tz}",RFC1036:"{Weekday}, {dd}-{Mon}-{yy} {HH}:{mm}:{ss} {tz}",ISO8601_DATE:"{yyyy}-{MM}-{dd}",ISO8601_DATETIME:"{yyyy}-{MM}-{dd}T{HH}:{mm}:{ss}.{fff}{isotz}"},k,k);})(this);
View
30 release/1.2.1/minified/sugar-1.2.1-inflections.min.js
@@ -0,0 +1,30 @@
+/*
+ * Sugar Library v1.2.1
+ *
+ * Freely distributable and licensed under the MIT-style license.
+ * Copyright (c) 2012 Andrew Plummer
+ * http://sugarjs.com/
+ *
+ * ---------------------------- */
+(function(context){var a,h=[],j=[],k=[],m=[],n={},o,q,r;a=typeof global!=="undefined"?global:context;function s(b,c,d){Object.isString(c)&&k.remove(c);k.remove(d);b.unshift({$:c,ba:d})}function t(b,c){return b==c||b=="all"||!b}function u(b){return k.any(function(c){return RegExp("\\b"+c+"$","i").test(b)})}function v(b,c){b=Object.isString(b)?b.toString():"";return b.isBlank()||u(b)?b:w(b,c?h:j)}function w(b,c){c.each(function(d){if(b.match(d.$)){b=b.replace(d.$,d.ba);return false}});return b}
+function y(b){return b.replace(/^\W*[a-z]/,function(c){return c.toUpperCase()})}
+r={acronym:function(b){n[b.toLowerCase()]=b;r.acronymRegExp=RegExp(Object.values(n).join("|"),"g")},plural:function(b,c){s(h,b,c)},singular:function(b,c){s(j,b,c)},irregular:function(b,c){var d=b.first(),f=b.from(1),g=c.first(),e=c.from(1),i=g.toUpperCase(),l=g.toLowerCase(),p=d.toUpperCase(),x=d.toLowerCase();k.remove(b);k.remove(c);if(p==i){r.plural(RegExp("({1}){2}$".assign(d,f),"i"),"$1"+e);r.plural(RegExp("({1}){2}$".assign(g,e),"i"),"$1"+e);r.singular(RegExp("({1}){2}$".assign(g,e),"i"),"$1"+
+f)}else{r.plural(RegExp("{1}{2}$".assign(p,f)),i+e);r.plural(RegExp("{1}{2}$".assign(x,f)),l+e);r.plural(RegExp("{1}{2}$".assign(i,e)),i+e);r.plural(RegExp("{1}{2}$".assign(l,e)),l+e);r.singular(RegExp("{1}{2}$".assign(i,e)),p+f);r.singular(RegExp("{1}{2}$".assign(l,e)),x+f)}},uncountable:function(){k.add(Array.create(arguments).flatten())},human:function(b,c){m.unshift({$:b,ba:c})},clear:function(b){if(t(b,"singulars"))j=[];if(t(b,"plurals"))h=[];if(t(b,"uncountables"))k=[];if(t(b,"humans"))m=[];
+if(t(b,"acronyms"))n={}}};o=["and","or","nor","a","an","the","so","but","to","of","at","by","from","into","on","onto","off","out","in","over","with","for"];
+q={A:/[A\u24b6\uff21\u00c0\u00c1\u00c2\u1ea6\u1ea4\u1eaa\u1ea8\u00c3\u0100\u0102\u1eb0\u1eae\u1eb4\u1eb2\u0226\u01e0\u00c4\u01de\u1ea2\u00c5\u01fa\u01cd\u0200\u0202\u1ea0\u1eac\u1eb6\u1e00\u0104\u023a\u2c6f]/g,B:/[B\u24b7\uff22\u1e02\u1e04\u1e06\u0243\u0182\u0181]/g,C:/[C\u24b8\uff23\u0106\u0108\u010a\u010c\u00c7\u1e08\u0187\u023b\ua73e]/g,D:/[D\u24b9\uff24\u1e0a\u010e\u1e0c\u1e10\u1e12\u1e0e\u0110\u018b\u018a\u0189\ua779]/g,E:/[E\u24ba\uff25\u00c8\u00c9\u00ca\u1ec0\u1ebe\u1ec4\u1ec2\u1ebc\u0112\u1e14\u1e16\u0114\u0116\u00cb\u1eba\u011a\u0204\u0206\u1eb8\u1ec6\u0228\u1e1c\u0118\u1e18\u1e1a\u0190\u018e]/g,
+F:/[F\u24bb\uff26\u1e1e\u0191\ua77b]/g,G:/[G\u24bc\uff27\u01f4\u011c\u1e20\u011e\u0120\u01e6\u0122\u01e4\u0193\ua7a0\ua77d\ua77e]/g,H:/[H\u24bd\uff28\u0124\u1e22\u1e26\u021e\u1e24\u1e28\u1e2a\u0126\u2c67\u2c75\ua78d]/g,I:/[I\u24be\uff29\u00cc\u00cd\u00ce\u0128\u012a\u012c\u0130\u00cf\u1e2e\u1ec8\u01cf\u0208\u020a\u1eca\u012e\u1e2c\u0197]/g,J:/[J\u24bf\uff2a\u0134\u0248]/g,K:/[K\u24c0\uff2b\u1e30\u01e8\u1e32\u0136\u1e34\u0198\u2c69\ua740\ua742\ua744\ua7a2]/g,L:/[L\u24c1\uff2c\u013f\u0139\u013d\u1e36\u1e38\u013b\u1e3c\u1e3a\u0141\u023d\u2c62\u2c60\ua748\ua746\ua780]/g,
+M:/[M\u24c2\uff2d\u1e3e\u1e40\u1e42\u2c6e\u019c]/g,N:/[N\u24c3\uff2e\u01f8\u0143\u00d1\u1e44\u0147\u1e46\u0145\u1e4a\u1e48\u0220\u019d\ua790\ua7a4]/g,O:/[O\u24c4\uff2f\u00d2\u00d3\u00d4\u1ed2\u1ed0\u1ed6\u1ed4\u00d5\u1e4c\u022c\u1e4e\u014c\u1e50\u1e52\u014e\u022e\u0230\u00d6\u022a\u1ece\u0150\u01d1\u020c\u020e\u01a0\u1edc\u1eda\u1ee0\u1ede\u1ee2\u1ecc\u1ed8\u01ea\u01ec\u00d8\u01fe\u0186\u019f\ua74a\ua74c]/g,P:/[P\u24c5\uff30\u1e54\u1e56\u01a4\u2c63\ua750\ua752\ua754]/g,Q:/[Q\u24c6\uff31\ua756\ua758\u024a]/g,
+R:/[R\u24c7\uff32\u0154\u1e58\u0158\u0210\u0212\u1e5a\u1e5c\u0156\u1e5e\u024c\u2c64\ua75a\ua7a6\ua782]/g,S:/[S\u24c8\uff33\u1e9e\u015a\u1e64\u015c\u1e60\u0160\u1e66\u1e62\u1e68\u0218\u015e\u2c7e\ua7a8\ua784]/g,T:/[T\u24c9\uff34\u1e6a\u0164\u1e6c\u021a\u0162\u1e70\u1e6e\u0166\u01ac\u01ae\u023e\ua786]/g,U:/[U\u24ca\uff35\u00d9\u00da\u00db\u0168\u1e78\u016a\u1e7a\u016c\u00dc\u01db\u01d7\u01d5\u01d9\u1ee6\u016e\u0170\u01d3\u0214\u0216\u01af\u1eea\u1ee8\u1eee\u1eec\u1ef0\u1ee4\u1e72\u0172\u1e76\u1e74\u0244]/g,
+V:/[V\u24cb\uff36\u1e7c\u1e7e\u01b2\ua75e\u0245]/g,W:/[W\u24cc\uff37\u1e80\u1e82\u0174\u1e86\u1e84\u1e88\u2c72]/g,X:/[X\u24cd\uff38\u1e8a\u1e8c]/g,Y:/[Y\u24ce\uff39\u1ef2\u00dd\u0176\u1ef8\u0232\u1e8e\u0178\u1ef6\u1ef4\u01b3\u024e\u1efe]/g,Z:/[Z\u24cf\uff3a\u0179\u1e90\u017b\u017d\u1e92\u1e94\u01b5\u0224\u2c7f\u2c6b\ua762]/g,a:/[a\u24d0\uff41\u1e9a\u00e0\u00e1\u00e2\u1ea7\u1ea5\u1eab\u1ea9\u00e3\u0101\u0103\u1eb1\u1eaf\u1eb5\u1eb3\u0227\u01e1\u00e4\u01df\u1ea3\u00e5\u01fb\u01ce\u0201\u0203\u1ea1\u1ead\u1eb7\u1e01\u0105\u2c65\u0250]/g,
+b:/[b\u24d1\uff42\u1e03\u1e05\u1e07\u0180\u0183\u0253]/g,c:/[c\u24d2\uff43\u0107\u0109\u010b\u010d\u00e7\u1e09\u0188\u023c\ua73f\u2184]/g,d:/[d\u24d3\uff44\u1e0b\u010f\u1e0d\u1e11\u1e13\u1e0f\u0111\u018c\u0256\u0257\ua77a]/g,e:/[e\u24d4\uff45\u00e8\u00e9\u00ea\u1ec1\u1ebf\u1ec5\u1ec3\u1ebd\u0113\u1e15\u1e17\u0115\u0117\u00eb\u1ebb\u011b\u0205\u0207\u1eb9\u1ec7\u0229\u1e1d\u0119\u1e19\u1e1b\u0247\u025b\u01dd]/g,f:/[f\u24d5\uff46\u1e1f\u0192\ua77c]/g,g:/[g\u24d6\uff47\u01f5\u011d\u1e21\u011f\u0121\u01e7\u0123\u01e5\u0260\ua7a1\u1d79\ua77f]/g,
+h:/[h\u24d7\uff48\u0125\u1e23\u1e27\u021f\u1e25\u1e29\u1e2b\u1e96\u0127\u2c68\u2c76\u0265]/g,i:/[i\u24d8\uff49\u00ec\u00ed\u00ee\u0129\u012b\u012d\u00ef\u1e2f\u1ec9\u01d0\u0209\u020b\u1ecb\u012f\u1e2d\u0268\u0131]/g,j:/[j\u24d9\uff4a\u0135\u01f0\u0249]/g,k:/[k\u24da\uff4b\u1e31\u01e9\u1e33\u0137\u1e35\u0199\u2c6a\ua741\ua743\ua745\ua7a3]/g,l:/[l\u24db\uff4c\u0140\u013a\u013e\u1e37\u1e39\u013c\u1e3d\u1e3b\u017f\u0142\u019a\u026b\u2c61\ua749\ua781\ua747]/g,m:/[m\u24dc\uff4d\u1e3f\u1e41\u1e43\u0271\u026f]/g,
+n:/[n\u24dd\uff4e\u01f9\u0144\u00f1\u1e45\u0148\u1e47\u0146\u1e4b\u1e49\u019e\u0272\u0149\ua791\ua7a5]/g,o:/[o\u24de\uff4f\u00f2\u00f3\u00f4\u1ed3\u1ed1\u1ed7\u1ed5\u00f5\u1e4d\u022d\u1e4f\u014d\u1e51\u1e53\u014f\u022f\u0231\u00f6\u022b\u1ecf\u0151\u01d2\u020d\u020f\u01a1\u1edd\u1edb\u1ee1\u1edf\u1ee3\u1ecd\u1ed9\u01eb\u01ed\u00f8\u01ff\u0254\ua74b\ua74d\u0275]/g,p:/[p\u24df\uff50\u1e55\u1e57\u01a5\u1d7d\ua751\ua753\ua755]/g,q:/[q\u24e0\uff51\u024b\ua757\ua759]/g,r:/[r\u24e1\uff52\u0155\u1e59\u0159\u0211\u0213\u1e5b\u1e5d\u0157\u1e5f\u024d\u027d\ua75b\ua7a7\ua783]/g,
+s:/[s\u24e2\uff53\u015b\u1e65\u015d\u1e61\u0161\u1e67\u1e63\u1e69\u0219\u015f\u023f\ua7a9\ua785\u1e9b]/g,t:/[t\u24e3\uff54\u1e6b\u1e97\u0165\u1e6d\u021b\u0163\u1e71\u1e6f\u0167\u01ad\u0288\u2c66\ua787]/g,u:/[u\u24e4\uff55\u00f9\u00fa\u00fb\u0169\u1e79\u016b\u1e7b\u016d\u00fc\u01dc\u01d8\u01d6\u01da\u1ee7\u016f\u0171\u01d4\u0215\u0217\u01b0\u1eeb\u1ee9\u1eef\u1eed\u1ef1\u1ee5\u1e73\u0173\u1e77\u1e75\u0289]/g,v:/[v\u24e5\uff56\u1e7d\u1e7f\u028b\ua75f\u028c]/g,w:/[w\u24e6\uff57\u1e81\u1e83\u0175\u1e87\u1e85\u1e98\u1e89\u2c73]/g,
+x:/[x\u24e7\uff58\u1e8b\u1e8d]/g,y:/[y\u24e8\uff59\u1ef3\u00fd\u0177\u1ef9\u0233\u1e8f\u00ff\u1ef7\u1e99\u1ef5\u01b4\u024f\u1eff]/g,z:/[z\u24e9\uff5a\u017a\u1e91\u017c\u017e\u1e93\u1e95\u01b6\u0225\u0240\u2c6c\ua763]/g,AA:/[\ua732]/g,AE:/[\u00c6\u01fc\u01e2]/g,AO:/[\ua734]/g,AU:/[\ua736]/g,AV:/[\ua738\ua73a]/g,AY:/[\ua73c]/g,DZ:/[\u01f1\u01c4]/g,Dz:/[\u01f2\u01c5]/g,LJ:/[\u01c7]/g,Lj:/[\u01c8]/g,NJ:/[\u01ca]/g,Nj:/[\u01cb]/g,OI:/[\u01a2]/g,OO:/[\ua74e]/g,OU:/[\u0222]/g,TZ:/[\ua728]/g,VY:/[\ua760]/g,
+aa:/[\ua733]/g,ae:/[\u00e6\u01fd\u01e3]/g,ao:/[\ua735]/g,au:/[\ua737]/g,av:/[\ua739\ua73b]/g,ay:/[\ua73d]/g,dz:/[\u01f3\u01c6]/g,hv:/[\u0195]/g,lj:/[\u01c9]/g,nj:/[\u01cc]/g,oi:/[\u01a3]/g,ou:/[\u0223]/g,oo:/[\ua74f]/g,ss:/[\u00df]/g,tz:/[\ua729]/g,vy:/[\ua761]/};r.plural(/$/,"s");r.plural(/s$/gi,"s");r.plural(/(ax|test)is$/gi,"$1es");r.plural(/(octop|vir)us$/gi,"$1i");r.plural(/(octop|vir)i$/gi,"$1i");r.plural(/(alias|status)$/gi,"$1es");r.plural(/(bu)s$/gi,"$1ses");
+r.plural(/(buffal|tomat)o$/gi,"$1oes");r.plural(/([ti])um$/gi,"$1a");r.plural(/([ti])a$/gi,"$1a");r.plural(/sis$/gi,"ses");r.plural(/(?:([^f])fe|([lr])f)$/gi,"$1$2ves");r.plural(/(hive)$/gi,"$1s");r.plural(/([^aeiouy]|qu)y$/gi,"$1ies");r.plural(/(x|ch|ss|sh)$/gi,"$1es");r.plural(/(matr|vert|ind)(?:ix|ex)$/gi,"$1ices");r.plural(/([ml])ouse$/gi,"$1ice");r.plural(/([ml])ice$/gi,"$1ice");r.plural(/^(ox)$/gi,"$1en");r.plural(/^(oxen)$/gi,"$1");r.plural(/(quiz)$/gi,"$1zes");r.singular(/s$/gi,"");
+r.singular(/(n)ews$/gi,"$1ews");r.singular(/([ti])a$/gi,"$1um");r.singular(/((a)naly|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)ses$/gi,"$1$2sis");r.singular(/(^analy)ses$/gi,"$1sis");r.singular(/([^f])ves$/gi,"$1fe");r.singular(/(hive)s$/gi,"$1");r.singular(/(tive)s$/gi,"$1");r.singular(/([lr])ves$/gi,"$1f");r.singular(/([^aeiouy]|qu)ies$/gi,"$1y");r.singular(/(s)eries$/gi,"$1eries");r.singular(/(m)ovies$/gi,"$1ovie");r.singular(/(x|ch|ss|sh)es$/gi,"$1");r.singular(/([ml])ice$/gi,"$1ouse");
+r.singular(/(bus)es$/gi,"$1");r.singular(/(o)es$/gi,"$1");r.singular(/(shoe)s$/gi,"$1");r.singular(/(cris|ax|test)es$/gi,"$1is");r.singular(/(octop|vir)i$/gi,"$1us");r.singular(/(alias|status)es$/gi,"$1");r.singular(/^(ox)en/gi,"$1");r.singular(/(vert|ind)ices$/gi,"$1ex");r.singular(/(matr)ices$/gi,"$1ix");r.singular(/(quiz)zes$/gi,"$1");r.singular(/(database)s$/gi,"$1");r.irregular("person","people");r.irregular("man","men");r.irregular("child","children");r.irregular("sex","sexes");
+r.irregular("move","moves");r.irregular("cow","kine");r.irregular("zombie","zombies");r.uncountable("equipment,information,rice,money,species,series,fish,sheep,jeans".split(","));
+String.extend({pluralize:function(){return v(this,true)},singularize:function(){return v(this,false)},humanize:function(){var b=w(this,m);b=b.replace(/_id$/g,"");b=b.replace(/(_)?([a-z\d]*)/gi,function(c,d,f){return(d?" ":"")+(n[f]||f.toLowerCase())});return y(b)},titleize:function(){var b=/[.:;!]$/,c,d,f;return this.spacify().humanize().words(function(g,e,i){c=b.test(g);f=e==0||e==i.length-1||c||d;d=c;return f||!o.any(g)?y(g):g}).join(" ")},namespace:function(){var b=a;this.split(".").each(function(c){return!!(b=
+b[c])});return b},parameterize:function(b){if(b===undefined)b="-";var c=this.normalize();c=c.replace(/[^a-z0-9\-_]+/gi,b);if(b)c=c.replace(RegExp("^{sep}+|{sep}+$|({sep}){sep}+".assign({sep:RegExp.escape(b)}),"g"),"$1");return c.toLowerCase()},normalize:function(){var b=this.toString();Object.each(q,function(c,d){b=b.replace(d,c)});return b}});String.Inflector=r;String.Inflector.acronyms=n;})(this);
View
113 release/1.2.1/minified/sugar-1.2.1.min.js
@@ -0,0 +1,113 @@
+/*
+ * Sugar Library v1.2.1
+ *
+ * Freely distributable and licensed under the MIT-style license.
+ * Copyright (c) 2012 Andrew Plummer
+ * http://sugarjs.com/
+ *
+ * ---------------------------- */
+(function(context){var h=true,j=null,k=false,m=Object,n=Array,o=RegExp,q=Date,r=String,s=Number,t=m.defineProperty&&m.defineProperties;function u(a,b,c,d){var e=b?a.prototype:a;v(a,b,d);w(d,function(f,g){if(typeof c==="function")x(e,f,aa(e[f],g,c));else if(c===h||!e[f])x(e,f,g);a.SugarMethods[f]={e:b,method:g}})}
+function v(a){if(!a.SugarMethods){x(a,"SugarMethods",{});u(a,k,k,{restore:function(){var b=arguments.length===0,c=y(arguments);w(a.SugarMethods,function(d,e){if(b||z(c,d))x(e.e?a.prototype:a,d,e.method)})},extend:function(b,c,d){a===m&&arguments.length===0?A(B.concat(C),Object):u(a,d!==k,c,b)}})}}function aa(a,b,c){return function(){return a&&(c===h||!c.apply(this,arguments))?a.apply(this,arguments):b.apply(this,arguments)}}
+function x(a,b,c){if(t)m.defineProperty(a,b,{value:c,configurable:h,enumerable:k,writable:h});else a[b]=c}function D(a,b){return m.prototype.hasOwnProperty.call(a,b)}function w(a,b){var c=0,d;for(d in a)if(D(a,d)){b.call(a,d,a[d],c);c++}}
+function ba(a,b,c){var d=m.prototype.toString.call(a).match(/\[object (\w+)\]/)[1];if(a===b)return a!==0||1/a===1/b;else if(a===j||E(a)||b===j||E(b))return k;else if(d=="RegExp")return a.ignoreCase==b.ignoreCase&&a.multiline==b.multiline&&a.source==b.source&&a.global==b.global;else if(d=="Array"||d=="Object"){for(d=c.length;d--;)if(c[d]==a)return h;c.push(a);for(var e in a)if(D(a,e))if(!D(b,e)||!ba(a[e],b[e],c))return k;c.pop();return m.keys(a).length===m.keys(b).length&&a.constructor===b.constructor&&
+a.length===b.length}else return F(b,d)&&a.valueOf()===b.valueOf()}function G(a,b,c,d){var e=h;if(a===b)return h;else if(m.isRegExp(b))return o(b).test(a);else if(m.isFunction(b))return b.apply(c,[a].concat(d));else if(m.isObject(b)&&m.isObject(a)){w(b,function(f){G(a[f],b[f],c,d)||(e=k)});return!m.isEmpty(b)&&e}else return m.equal(a,b)}function H(a,b,c,d){return E(b)?a:m.isFunction(b)?b.apply(c,d||[]):m.isFunction(a[b])?a[b].call(a):a[b]}function I(a,b){return Array.prototype.slice.call(a,b)}
+function y(a,b,c,d){a=I(a);if(c!==k)a=J(a);K(a,b||function(){},d);return a}function ca(a,b,c){var d=[],e=a.length,f=b[b.length-1]!==k,g;y(b,function(i){if(m.isBoolean(i))return k;if(f){i%=e;if(i<0)i=e+i}g=c?a.charAt(i)||"":a[i];d.push(g)});return d.length<2?d[0]:d}function F(a,b){return m.prototype.toString.call(a)==="[object "+b+"]"}function L(a){return typeof a=="object"}function E(a){return a===void 0}function M(a){return a!==void 0}
+function N(a,b,c,d){L(b)&&w(b,function(e,f){var g=a[e],i=M(g),l=m.isArray(f);if(c===h&&(l||m.isObject(f))){g||(g=l?[]:{});N(g,f,c)}else if(i&&m.isFunction(d))g=d.call(b,e,a[e],b[e]);else if(!i||i&&d!==k)g=b[e];a[e]=g});return a}
+function da(a,b,c,d){var e=/^(.+?)(\[.*\])$/,f,g,i;if(d!==k&&(g=b.match(e))){i=g[1];b=g[2].replace(/^\[|\]$/g,"").split("][");K(b,function(l){f=!l||l.match(/^\d+$/);if(!i&&m.isArray(a))i=a.length;a[i]||(a[i]=f?[]:{});a=a[i];i=l});if(!i&&f)i=a.length.toString();da(a,i,c)}else a[b]=c.match(/^[\d.]+$/)?parseFloat(c):c==="true"?h:c==="false"?k:c}function P(a){var b=this;w(a,function(c,d){b[c]=d})}P.prototype.constructor=m;
+var B=["isObject","isNaN"],C=["keys","values","each","merge","isEmpty","clone","equal","watch","tap","has"];function A(a,b){var c={};K(a,function(d){c[d+(d==="equal"?"s":"")]=function(){return Object[d].apply(j,[this].concat(I(arguments)))}});u(b,h,k,c)}u(m,k,h,{watch:function(a,b,c){if(t){var d=a[b];m.defineProperty(a,b,{get:function(){return d},set:function(e){d=c.call(a,b,d,e)},enumerable:h,configurable:h})}}});
+u(m,k,k,{extended:function(a){return new P(a)},isObject:function(a){return a===j||E(a)?k:F(a,"Object")&&a.constructor===m},isNaN:function(a){return m.isNumber(a)&&a.valueOf()!==a.valueOf()},each:function(a,b){b&&w(a,function(c,d){b.call(a,c,d,a)});return a},merge:function(a,b,c){return N(a,b,h,c)},isEmpty:function(a){if(!L(a)||a===j)return!(a&&a.length>0);return m.keys(a).length==0},equal:function(a,b){return ba(a,b,[])},values:function(a,b){var c=[];w(a,function(d,e){c.push(e);b&&b.call(a,e)});return c},
+clone:function(a,b){if(!L(a)||a===j)return a;var c=Object.isFunction(a.keys)?Object.extended():{};return N(c,a,b)},fromQueryString:function(a,b){var c=m.extended();a=a&&a.toString?a.toString():"";a.replace(/^.*?\?/,"").unescapeURL().split("&").each(function(d){d=d.split("=");d.length===2&&da(c,d[0],d[1],b)});return c},tap:function(a,b){H(a,b,a,[a]);return a},has:function(a,b){return D(a,b)}});
+u(m,k,function(){return arguments.length>1},{keys:function(a,b){if(a===j||!L(a)&&!m.isRegExp(a)&&!m.isFunction(a))throw new TypeError("Object required");var c=[];w(a,function(d,e){c.push(d);b&&b.call(a,d,e)});return c}});function K(a,b,c,d,e){var f,g;Q(b);if(c<0)c=a.length+c;g=isNaN(c)?0:parseInt(c>>0);for(c=d===h?a.length+g:a.length;g<c;){f=g%a.length;if(!(f in a)&&e===h)return ea(a,b,g,d);else if(b.call(a,a[f],f,a)===k)break;g++}}
+function fa(a,b,c,d,e){var f,g;K(a,function(i,l,p){if(G(i,b,p,[l,p])){f=i;g=l;return k}},c,d);return e?g:f}function z(a,b){return a.any(function(c){return m.equal(b,c)})}function R(a,b){function c(e){return H(e,b,a,[e])===d}var d;return a.reduce(function(e,f,g){d=H(f,b,a,[f,g,a]);if(e.none(b?c:f))e.push(f);return e},[])}function J(a,b,c){b=b||Infinity;c=c||0;var d=[];K(a,function(e){if(m.isArray(e)&&c<b)d=d.concat(J(e,b,c+1));else d.push(e)});return d}
+function ga(a,b,c){var d=[];a.each(function(e){if((c||!z(d,e))&&c!=z(b,e))d.push(e)});return d}function ha(a,b,c,d){var e=a.length,f=d==-1,g=f?e-1:0;c=isNaN(c)?g:parseInt(c>>0);if(c<0)c=e+c;if(!f&&c<0||f&&c>=e)c=g;for(;f&&c>=0||!f&&c<e;){if(a[c]===b)return c;c+=d}return-1}
+function ia(a,b,c,d){var e=a.length,f=0,g=M(c);Q(b);if(e==0&&!g)throw new TypeError("Reduce called on empty array with no initial value");else if(g)c=c;else{c=a[d?e-1:f];f++}for(;f<e;){g=d?e-f-1:f;if(g in a)c=b.call(void 0,c,a[g],g,a);f++}return c}function Q(a){if(!a||!a.call)throw new TypeError("Callback is not callable");}function S(a){if(a.length===0)throw new TypeError("First argument must be defined");}
+function ea(a,b,c){var d=[],e;for(e in a)e in a&&e>>>0==e&&e!=4294967295&&e>=c&&d.push(e.toNumber());d.sort().each(function(f){return b.call(a,a[f],f,a)});return a}function T(a,b,c,d){var e=c==="max",f=c==="min",g=e?-Infinity:Infinity,i=[];w(a,function(l){var p=a[l];l=H(p,b,a,d?[p,l.toNumber(),a]:[]);if(!E(l))if(l===g)i.push(p);else if(e&&l>g||f&&l<g){i=[p];g=l}});return i}
+u(n,k,k,{create:function(){var a=[];y(arguments,function(b){if(b&&b.callee)b=I(b);a=a.concat(b)});return a},isArray:function(a){return F(a,"Array")}});
+u(n,h,function(){var a=arguments;return a.length>0&&!m.isFunction(a[0])},{every:function(a,b){var c=this.length,d=0;for(S(arguments);d<c;){if(d in this&&!G(this[d],a,b,[d,this]))return k;d++}return h},some:function(a,b){var c=this.length,d=0;for(S(arguments);d<c;){if(d in this&&G(this[d],a,b,[d,this]))return h;d++}return k},map:function(a,b){var c=this.length,d=0,e,f=Array(c);for(S(arguments);d<c;){if(d in this){e=this[d];f[d]=H(e,a,b,[e,d,this])}d++}return f},filter:function(a,b){var c=this.length,
+d=0,e=[];for(S(arguments);d<c;){d in this&&G(this[d],a,b,[d,this])&&e.push(this[d]);d++}return e}});
+u(n,h,k,{indexOf:function(a,b){if(m.isString(this))return this.indexOf(a,b);return ha(this,a,b,1)},lastIndexOf:function(a,b){if(m.isString(this))return this.lastIndexOf(a,b);return ha(this,a,b,-1)},forEach:function(a,b){var c=this.length,d=0;for(Q(a);d<c;){d in this&&a.call(b,this[d],d,this);d++}},reduce:function(a,b){return ia(this,a,b)},reduceRight:function(a,b){return ia(this,a,b,h)},each:function(a,b,c){K(this,a,b,c,h);return this},find:function(a,b,c){return fa(this,a,b,c)},findAll:function(a,
+b,c){var d=[];K(this,function(e,f,g){G(e,a,g,[f,g])&&d.push(e)},b,c);return d},findIndex:function(a,b,c){a=fa(this,a,b,c,h);return M(a)?a:-1},count:function(a){if(E(a))return this.length;return this.findAll(a).length},none:function(){return!this.any.apply(this,arguments)},remove:function(){var a,b=this;y(arguments,function(c){for(a=0;a<b.length;)if(G(b[a],c,b,[a,b]))b.splice(a,1);else a++},k);return b},removeAt:function(a,b){if(E(a))return this;if(E(b))b=a;for(var c=0;c<=b-a;c++)this.splice(a,1);
+return this},add:function(a,b){if(!m.isNumber(s(b))||isNaN(b)||b==-1)b=this.length;else if(b<-1)b+=1;n.prototype.splice.apply(this,[b,0].concat(a));return this},include:function(a,b){return this.clone().add(a,b)},exclude:function(){return n.prototype.remove.apply(this.clone(),arguments)},clone:function(){return N([],this)},unique:function(a){return R(this,a)},union:function(){var a=this;y(arguments,function(b){a=a.concat(b)});return R(a)},intersect:function(){return ga(this,y(arguments),k)},subtract:function(){return ga(this,
+y(arguments),h)},at:function(){return ca(this,arguments)},first:function(a){if(E(a))return this[0];if(a<0)a=0;return this.slice(0,a)},last:function(a){if(E(a))return this[this.length-1];return this.slice(this.length-a<0?0:this.length-a)},from:function(a){return this.slice(a)},to:function(a){if(E(a))a=this.length;return this.slice(0,a)},min:function(a){return R(T(this,a,"min",h))},max:function(a){return R(T(this,a,"max",h))},least:function(){var a=J(T(this.groupBy.apply(this,arguments),"length","min"));
+return a.length===this.length?[]:R(a)},most:function(){var a=J(T(this.groupBy.apply(this,arguments),"length","max"));return a.length===this.length?[]:R(a)},sum:function(a){a=a?this.map(a):this;return a.length>0?a.reduce(function(b,c){return b+c}):0},average:function(a){a=a?this.map(a):this;return a.length>0?a.sum()/a.length:0},groupBy:function(a,b){var c=this,d=m.extended(),e;K(c,function(f,g){e=H(f,a,c,[f,g,c]);d[e]||(d[e]=[]);d[e].push(f)});return d.each(b)},inGroups:function(a,b){var c=arguments.length>
+1,d=this,e=[],f=(this.length/a).ceil();(0).upto(a-1,function(g){g=g*f;var i=d.slice(g,g+f);c&&i.length<f&&(f-i.length).times(function(){i=i.add(b)});e.push(i)});return e},inGroupsOf:function(a,b){if(this.length===0||a===0)return this;if(E(a))a=1;if(E(b))b=j;var c=[],d=j;this.each(function(e,f){if(f%a===0){d&&c.push(d);d=[]}if(E(e))e=b;d.push(e)});if(!this.length.isMultipleOf(a)){(a-this.length%a).times(function(){d.push(b)});this.length+=a-this.length%a}d.length>0&&c.push(d);return c},compact:function(a){var b=
+[];K(this,function(c){if(m.isArray(c))b.push(c.compact());else if(a&&c)b.push(c);else if(!a&&M(c)&&c!==j&&(!m.isNumber(c)||!isNaN(c)))