sugar-rails 1.3.4 → 1.3.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (24) hide show
  1. data/copy_release.sh +28 -0
  2. data/lib/sugar/rails/version.rb +2 -2
  3. data/vendor/assets/javascripts/precompiled/development/array.js +6 -4
  4. data/vendor/assets/javascripts/precompiled/development/date.js +45 -31
  5. data/vendor/assets/javascripts/precompiled/development/date_locales.js +274 -47
  6. data/vendor/assets/javascripts/precompiled/development/number.js +2 -2
  7. data/vendor/assets/javascripts/precompiled/development/object.js +2 -2
  8. data/vendor/assets/javascripts/precompiled/minified/array.js +15 -15
  9. data/vendor/assets/javascripts/precompiled/minified/core.js +9 -9
  10. data/vendor/assets/javascripts/precompiled/minified/date.js +40 -40
  11. data/vendor/assets/javascripts/precompiled/minified/date_locales.js +33 -22
  12. data/vendor/assets/javascripts/precompiled/minified/date_ranges.js +2 -2
  13. data/vendor/assets/javascripts/precompiled/minified/es5.js +8 -8
  14. data/vendor/assets/javascripts/precompiled/minified/function.js +4 -4
  15. data/vendor/assets/javascripts/precompiled/minified/inflections.js +5 -5
  16. data/vendor/assets/javascripts/precompiled/minified/language.js +5 -5
  17. data/vendor/assets/javascripts/precompiled/minified/number.js +5 -5
  18. data/vendor/assets/javascripts/precompiled/minified/object.js +5 -5
  19. data/vendor/assets/javascripts/precompiled/minified/regexp.js +2 -2
  20. data/vendor/assets/javascripts/precompiled/minified/string.js +11 -11
  21. data/vendor/assets/javascripts/sugar-development.js +330 -87
  22. data/vendor/assets/javascripts/sugar-full.js +145 -134
  23. data/vendor/assets/javascripts/sugar.js +102 -102
  24. metadata +5 -4
@@ -1,3 +1,85 @@
1
+ /*
2
+ *
3
+ * Date.addLocale(<code>) adds this locale to Sugar.
4
+ * To set the locale globally, simply call:
5
+ *
6
+ * Date.setLocale('da');
7
+ *
8
+ * var locale = Date.getLocale(<code>) will return this object, which
9
+ * can be tweaked to change the behavior of parsing/formatting in the locales.
10
+ *
11
+ * locale.addFormat adds a date format (see this file for examples).
12
+ * Special tokens in the date format will be parsed out into regex tokens:
13
+ *
14
+ * {0} is a reference to an entry in locale.tokens. Output: (?:the)?
15
+ * {unit} is a reference to all units. Output: (day|week|month|...)
16
+ * {unit3} is a reference to a specific unit. Output: (hour)
17
+ * {unit3-5} is a reference to a subset of the units array. Output: (hour|day|week)
18
+ * {unit?} "?" makes that token optional. Output: (day|week|month)?
19
+ *
20
+ * {day} Any reference to tokens in the modifiers array will include all with the same name. Output: (yesterday|today|tomorrow)
21
+ *
22
+ * All spaces are optional and will be converted to "\s*"
23
+ *
24
+ * Locale arrays months, weekdays, units, numbers, as well as the "src" field for
25
+ * all entries in the modifiers array follow a special format indicated by a colon:
26
+ *
27
+ * minute:|s = minute|minutes
28
+ * thicke:n|r = thicken|thicker
29
+ *
30
+ * Additionally in the months, weekdays, units, and numbers array these will be added at indexes that are multiples
31
+ * of the relevant number for retrieval. For example having "sunday:|s" in the units array will result in:
32
+ *
33
+ * units: ['sunday', 'monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday', 'sundays']
34
+ *
35
+ * When matched, the index will be found using:
36
+ *
37
+ * units.indexOf(match) % 7;
38
+ *
39
+ * Resulting in the correct index with any number of alternates for that entry.
40
+ *
41
+ */
42
+
43
+ Date.addLocale('da', {
44
+ 'plural': true,
45
+ 'months': 'januar,februar,marts,april,maj,juni,juli,august,september,oktober,november,december',
46
+ 'weekdays': 'søndag|sondag,mandag,tirsdag,onsdag,torsdag,fredag,lørdag|lordag',
47
+ 'units': 'millisekund:|er,sekund:|er,minut:|ter,tim:e|er,dag:|e,ug:e|er|en,måned:|er|en+maaned:|er|en,år:||et+aar:||et',
48
+ 'numbers': 'en|et,to,tre,fire,fem,seks,syv,otte,ni,ti',
49
+ 'tokens': 'den,for',
50
+ 'articles': 'den',
51
+ 'short':'d. {d}. {month} {yyyy}',
52
+ 'long': 'den {d}. {month} {yyyy} {H}:{mm}',
53
+ 'full': '{Weekday} den {d}. {month} {yyyy} {H}:{mm}:{ss}',
54
+ 'past': '{num} {unit} {sign}',
55
+ 'future': '{sign} {num} {unit}',
56
+ 'duration': '{num} {unit}',
57
+ 'ampm': 'am,pm',
58
+ 'modifiers': [
59
+ { 'name': 'day', 'src': 'forgårs|i forgårs|forgaars|i forgaars', 'value': -2 },
60
+ { 'name': 'day', 'src': 'i går|igår|i gaar|igaar', 'value': -1 },
61
+ { 'name': 'day', 'src': 'i dag|idag', 'value': 0 },
62
+ { 'name': 'day', 'src': 'i morgen|imorgen', 'value': 1 },
63
+ { 'name': 'day', 'src': 'over morgon|overmorgen|i over morgen|i overmorgen|iovermorgen', 'value': 2 },
64
+ { 'name': 'sign', 'src': 'siden', 'value': -1 },
65
+ { 'name': 'sign', 'src': 'om', 'value': 1 },
66
+ { 'name': 'shift', 'src': 'i sidste|sidste', 'value': -1 },
67
+ { 'name': 'shift', 'src': 'denne', 'value': 0 },
68
+ { 'name': 'shift', 'src': 'næste|naeste', 'value': 1 }
69
+ ],
70
+ 'dateParse': [
71
+ '{num} {unit} {sign}',
72
+ '{sign} {num} {unit}',
73
+ '{1?} {num} {unit} {sign}',
74
+ '{shift} {unit=5-7}'
75
+ ],
76
+ 'timeParse': [
77
+ '{0?} {weekday?} {date?} {month} {year}',
78
+ '{date} {month}',
79
+ '{shift} {weekday}'
80
+ ]
81
+ });
82
+
1
83
  /*
2
84
  *
3
85
  * Date.addLocale(<code>) adds this locale to Sugar.
@@ -11,7 +93,7 @@
11
93
  * locale.addFormat adds a date format (see this file for examples).
12
94
  * Special tokens in the date format will be parsed out into regex tokens:
13
95
  *
14
- * {0} is a reference to an entry in locale.optionals. Output: (?:the)?
96
+ * {0} is a reference to an entry in locale.tokens. Output: (?:the)?
15
97
  * {unit} is a reference to all units. Output: (day|week|month|...)
16
98
  * {unit3} is a reference to a specific unit. Output: (hour)
17
99
  * {unit3-5} is a reference to a subset of the units array. Output: (hour|day|week)
@@ -47,7 +129,7 @@ Date.addLocale('de', {
47
129
  'weekdays': 'Sonntag,Montag,Dienstag,Mittwoch,Donnerstag,Freitag,Samstag',
48
130
  'units': 'Millisekunde:|n,Sekunde:|n,Minute:|n,Stunde:|n,Tag:|en,Woche:|n,Monat:|en,Jahr:|en',
49
131
  'numbers': 'ein:|e|er|en|em,zwei,drei,vier,fuenf,sechs,sieben,acht,neun,zehn',
50
- 'optionals': 'der',
132
+ 'tokens': 'der',
51
133
  'short':'{d}. {Month} {yyyy}',
52
134
  'long': '{d}. {Month} {yyyy} {H}:{mm}',
53
135
  'full': '{Weekday} {d}. {Month} {yyyy} {H}:{mm}:{ss}',
@@ -91,7 +173,7 @@ Date.addLocale('de', {
91
173
  * locale.addFormat adds a date format (see this file for examples).
92
174
  * Special tokens in the date format will be parsed out into regex tokens:
93
175
  *
94
- * {0} is a reference to an entry in locale.optionals. Output: (?:the)?
176
+ * {0} is a reference to an entry in locale.tokens. Output: (?:the)?
95
177
  * {unit} is a reference to all units. Output: (day|week|month|...)
96
178
  * {unit3} is a reference to a specific unit. Output: (hour)
97
179
  * {unit3-5} is a reference to a subset of the units array. Output: (hour|day|week)
@@ -126,7 +208,7 @@ Date.addLocale('es', {
126
208
  'weekdays': 'domingo,lunes,martes,miércoles|miercoles,jueves,viernes,sábado|sabado',
127
209
  'units': 'milisegundo:|s,segundo:|s,minuto:|s,hora:|s,día|días|dia|dias,semana:|s,mes:|es,año|años|ano|anos',
128
210
  'numbers': 'uno,dos,tres,cuatro,cinco,seis,siete,ocho,nueve,diez',
129
- 'optionals': 'el,de',
211
+ 'tokens': 'el,de',
130
212
  'short':'{d} {month} {yyyy}',
131
213
  'long': '{d} {month} {yyyy} {H}:{mm}',
132
214
  'full': '{Weekday} {d} {month} {yyyy} {H}:{mm}:{ss}',
@@ -148,15 +230,72 @@ Date.addLocale('es', {
148
230
  'dateParse': [
149
231
  '{sign} {num} {unit}',
150
232
  '{num} {unit} {sign}',
151
- '{0} {unit=5-7} {shift}',
152
- '{0} {shift} {unit=5-7}'
233
+ '{0?} {unit=5-7} {shift}',
234
+ '{0?} {shift} {unit=5-7}'
153
235
  ],
154
236
  'timeParse': [
155
237
  '{shift} {weekday}',
156
238
  '{weekday} {shift}',
157
- '{date?} {1} {month} {1} {year?}'
239
+ '{date?} {1?} {month} {1?} {year?}'
158
240
  ]
159
241
  });
242
+ Date.addLocale('fi', {
243
+ 'plural': true,
244
+ 'timeMarker': 'kello',
245
+ 'ampm': ',',
246
+ 'months': 'tammikuu,helmikuu,maaliskuu,huhtikuu,toukokuu,kesäkuu,heinäkuu,elokuu,syyskuu,lokakuu,marraskuu,joulukuu',
247
+ 'weekdays': 'sunnuntai,maanantai,tiistai,keskiviikko,torstai,perjantai,lauantai',
248
+ 'units': 'millisekun:ti|tia|teja|tina|nin,sekun:ti|tia|teja|tina|nin,minuut:ti|tia|teja|tina|in,tun:ti|tia|teja|tina|nin,päiv:ä|ää|iä|änä|än,viik:ko|koa|koja|on|kona,kuukau:si|sia|tta|den|tena,vuo:si|sia|tta|den|tena',
249
+ 'numbers': 'yksi|ensimmäinen,kaksi|toinen,kolm:e|as,neljä:s,vii:si|des,kuu:si|des,seitsemä:n|s,kahdeksa:n|s,yhdeksä:n|s,kymmene:n|s',
250
+ 'articles': '',
251
+ 'optionals': '',
252
+ 'short': '{d}. {month}ta {yyyy}',
253
+ 'long': '{d}. {month}ta {yyyy} kello {H}.{mm}',
254
+ 'full': '{Weekday}na {d}. {month}ta {yyyy} kello {H}.{mm}',
255
+ 'relative': function(num, unit, ms, format) {
256
+ var units = this['units'];
257
+ function numberWithUnit(mult) {
258
+ return (num === 1 ? '' : num + ' ') + units[(8 * mult) + unit];
259
+ }
260
+ switch(format) {
261
+ case 'duration': return numberWithUnit(0);
262
+ case 'past': return numberWithUnit(num > 1 ? 1 : 0) + ' sitten';
263
+ case 'future': return numberWithUnit(4) + ' päästä';
264
+ }
265
+ },
266
+ 'modifiers': [
267
+ { 'name': 'day', 'src': 'toissa päivänä|toissa päiväistä', 'value': -2 },
268
+ { 'name': 'day', 'src': 'eilen|eilistä', 'value': -1 },
269
+ { 'name': 'day', 'src': 'tänään', 'value': 0 },
270
+ { 'name': 'day', 'src': 'huomenna|huomista', 'value': 1 },
271
+ { 'name': 'day', 'src': 'ylihuomenna|ylihuomista', 'value': 2 },
272
+ { 'name': 'sign', 'src': 'sitten|aiemmin', 'value': -1 },
273
+ { 'name': 'sign', 'src': 'päästä|kuluttua|myöhemmin', 'value': 1 },
274
+ { 'name': 'edge', 'src': 'viimeinen|viimeisenä', 'value': -2 },
275
+ { 'name': 'edge', 'src': 'lopussa', 'value': -1 },
276
+ { 'name': 'edge', 'src': 'ensimmäinen|ensimmäisenä', 'value': 1 },
277
+ { 'name': 'shift', 'src': 'edellinen|edellisenä|edeltävä|edeltävänä|viime|toissa', 'value': -1 },
278
+ { 'name': 'shift', 'src': 'tänä|tämän', 'value': 0 },
279
+ { 'name': 'shift', 'src': 'seuraava|seuraavana|tuleva|tulevana|ensi', 'value': 1 }
280
+ ],
281
+ 'dateParse': [
282
+ '{num} {unit} {sign}',
283
+ '{sign} {num} {unit}',
284
+ '{num} {unit=4-5} {sign} {day}',
285
+ '{month} {year}',
286
+ '{shift} {unit=5-7}'
287
+ ],
288
+ 'timeParse': [
289
+ '{0} {num}{1} {day} of {month} {year?}',
290
+ '{weekday?} {month} {date}{1} {year?}',
291
+ '{date} {month} {year}',
292
+ '{shift} {weekday}',
293
+ '{shift} week {weekday}',
294
+ '{weekday} {2} {shift} week',
295
+ '{0} {date}{1} of {month}',
296
+ '{0}{month?} {date?}{1} of {shift} {unit=6-7}'
297
+ ]
298
+ });
160
299
  /*
161
300
  *
162
301
  * Date.addLocale(<code>) adds this locale to Sugar.
@@ -170,7 +309,7 @@ Date.addLocale('es', {
170
309
  * locale.addFormat adds a date format (see this file for examples).
171
310
  * Special tokens in the date format will be parsed out into regex tokens:
172
311
  *
173
- * {0} is a reference to an entry in locale.optionals. Output: (?:the)?
312
+ * {0} is a reference to an entry in locale.tokens. Output: (?:the)?
174
313
  * {unit} is a reference to all units. Output: (day|week|month|...)
175
314
  * {unit3} is a reference to a specific unit. Output: (hour)
176
315
  * {unit3-5} is a reference to a subset of the units array. Output: (hour|day|week)
@@ -205,7 +344,7 @@ Date.addLocale('fr', {
205
344
  'weekdays': 'dimanche,lundi,mardi,mercredi,jeudi,vendredi,samedi',
206
345
  'units': 'milliseconde:|s,seconde:|s,minute:|s,heure:|s,jour:|s,semaine:|s,mois,an:|s|née|nee',
207
346
  'numbers': 'un:|e,deux,trois,quatre,cinq,six,sept,huit,neuf,dix',
208
- 'optionals': ["l'|la|le"],
347
+ 'tokens': ["l'|la|le"],
209
348
  'short':'{d} {month} {yyyy}',
210
349
  'long': '{d} {month} {yyyy} {H}:{mm}',
211
350
  'full': '{Weekday} {d} {month} {yyyy} {H}:{mm}:{ss}',
@@ -226,11 +365,11 @@ Date.addLocale('fr', {
226
365
  'dateParse': [
227
366
  '{sign} {num} {unit}',
228
367
  '{sign} {num} {unit}',
229
- '{0} {unit=5-7} {shift}'
368
+ '{0?} {unit=5-7} {shift}'
230
369
  ],
231
370
  'timeParse': [
232
- '{0} {date?} {month} {year?}',
233
- '{0} {weekday} {shift}'
371
+ '{0?} {date?} {month} {year?}',
372
+ '{0?} {weekday} {shift}'
234
373
  ]
235
374
  });
236
375
 
@@ -247,7 +386,7 @@ Date.addLocale('fr', {
247
386
  * locale.addFormat adds a date format (see this file for examples).
248
387
  * Special tokens in the date format will be parsed out into regex tokens:
249
388
  *
250
- * {0} is a reference to an entry in locale.optionals. Output: (?:the)?
389
+ * {0} is a reference to an entry in locale.tokens. Output: (?:the)?
251
390
  * {unit} is a reference to all units. Output: (day|week|month|...)
252
391
  * {unit3} is a reference to a specific unit. Output: (hour)
253
392
  * {unit3-5} is a reference to a subset of the units array. Output: (hour|day|week)
@@ -282,7 +421,7 @@ Date.addLocale('it', {
282
421
  'weekdays': 'Domenica,Luned:ì|i,Marted:ì|i,Mercoled:ì|i,Gioved:ì|i,Venerd:ì|i,Sabato',
283
422
  'units': 'millisecond:o|i,second:o|i,minut:o|i,or:a|e,giorn:o|i,settiman:a|e,mes:e|i,ann:o|i',
284
423
  'numbers': "un:|a|o|',due,tre,quattro,cinque,sei,sette,otto,nove,dieci",
285
- 'optionals': "l'|la|il",
424
+ 'tokens': "l'|la|il",
286
425
  'short':'{d} {Month} {yyyy}',
287
426
  'long': '{d} {Month} {yyyy} {H}:{mm}',
288
427
  'full': '{Weekday} {d} {Month} {yyyy} {H}:{mm}:{ss}',
@@ -303,8 +442,8 @@ Date.addLocale('it', {
303
442
  ],
304
443
  'dateParse': [
305
444
  '{num} {unit} {sign}',
306
- '{0} {unit=5-7} {shift}',
307
- '{0} {shift} {unit=5-7}'
445
+ '{0?} {unit=5-7} {shift}',
446
+ '{0?} {shift} {unit=5-7}'
308
447
  ],
309
448
  'timeParse': [
310
449
  '{weekday?} {date?} {month} {year?}',
@@ -325,7 +464,7 @@ Date.addLocale('it', {
325
464
  * locale.addFormat adds a date format (see this file for examples).
326
465
  * Special tokens in the date format will be parsed out into regex tokens:
327
466
  *
328
- * {0} is a reference to an entry in locale.optionals. Output: (?:the)?
467
+ * {0} is a reference to an entry in locale.tokens. Output: (?:the)?
329
468
  * {unit} is a reference to all units. Output: (day|week|month|...)
330
469
  * {unit3} is a reference to a specific unit. Output: (hour)
331
470
  * {unit3-5} is a reference to a subset of the units array. Output: (hour|day|week)
@@ -401,7 +540,7 @@ Date.addLocale('ja', {
401
540
  * locale.addFormat adds a date format (see this file for examples).
402
541
  * Special tokens in the date format will be parsed out into regex tokens:
403
542
  *
404
- * {0} is a reference to an entry in locale.optionals. Output: (?:the)?
543
+ * {0} is a reference to an entry in locale.tokens. Output: (?:the)?
405
544
  * {unit} is a reference to all units. Output: (day|week|month|...)
406
545
  * {unit3} is a reference to a specific unit. Output: (hour)
407
546
  * {unit3-5} is a reference to a subset of the units array. Output: (hour|day|week)
@@ -468,6 +607,82 @@ Date.addLocale('ko', {
468
607
  ]
469
608
  });
470
609
 
610
+ /*
611
+ *
612
+ * Date.addLocale(<code>) adds this locale to Sugar.
613
+ * To set the locale globally, simply call:
614
+ *
615
+ * Date.setLocale('nl');
616
+ *
617
+ * var locale = Date.getLocale(<code>) will return this object, which
618
+ * can be tweaked to change the behavior of parsing/formatting in the locales.
619
+ *
620
+ * locale.addFormat adds a date format (see this file for examples).
621
+ * Special tokens in the date format will be parsed out into regex tokens:
622
+ *
623
+ * {0} is a reference to an entry in locale.tokens. Output: (?:the)?
624
+ * {unit} is a reference to all units. Output: (day|week|month|...)
625
+ * {unit3} is a reference to a specific unit. Output: (hour)
626
+ * {unit3-5} is a reference to a subset of the units array. Output: (hour|day|week)
627
+ * {unit?} "?" makes that token optional. Output: (day|week|month)?
628
+ *
629
+ * {day} Any reference to tokens in the modifiers array will include all with the same name. Output: (yesterday|today|tomorrow)
630
+ *
631
+ * All spaces are optional and will be converted to "\s*"
632
+ *
633
+ * Locale arrays months, weekdays, units, numbers, as well as the "src" field for
634
+ * all entries in the modifiers array follow a special format indicated by a colon:
635
+ *
636
+ * minute:|s = minute|minutes
637
+ * thicke:n|r = thicken|thicker
638
+ *
639
+ * Additionally in the months, weekdays, units, and numbers array these will be added at indexes that are multiples
640
+ * of the relevant number for retrieval. For example having "sunday:|s" in the units array will result in:
641
+ *
642
+ * units: ['sunday', 'monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday', 'sundays']
643
+ *
644
+ * When matched, the index will be found using:
645
+ *
646
+ * units.indexOf(match) % 7;
647
+ *
648
+ * Resulting in the correct index with any number of alternates for that entry.
649
+ *
650
+ */
651
+
652
+ Date.addLocale('nl', {
653
+ 'plural': true,
654
+ 'months': 'januari,februari,maart,april,mei,juni,juli,augustus,september,oktober,november,december',
655
+ 'weekdays': 'zondag|zo,maandag|ma,dinsdag|di,woensdag|woe|wo,donderdag|do,vrijdag|vrij|vr,zaterdag|za',
656
+ 'units': 'milliseconde:|n,seconde:|n,minu:ut|ten,uur,dag:|en,we:ek|ken,maand:|en,jaar',
657
+ 'numbers': 'een,twee,drie,vier,vijf,zes,zeven,acht,negen',
658
+ 'tokens': '',
659
+ 'short':'{d} {Month} {yyyy}',
660
+ 'long': '{d} {Month} {yyyy} {H}:{mm}',
661
+ 'full': '{Weekday} {d} {Month} {yyyy} {H}:{mm}:{ss}',
662
+ 'past': '{num} {unit} {sign}',
663
+ 'future': '{num} {unit} {sign}',
664
+ 'duration': '{num} {unit}',
665
+ 'timeMarker': "'s|om",
666
+ 'modifiers': [
667
+ { 'name': 'day', 'src': 'gisteren', 'value': -1 },
668
+ { 'name': 'day', 'src': 'vandaag', 'value': 0 },
669
+ { 'name': 'day', 'src': 'morgen', 'value': 1 },
670
+ { 'name': 'day', 'src': 'overmorgen', 'value': 2 },
671
+ { 'name': 'sign', 'src': 'geleden', 'value': -1 },
672
+ { 'name': 'sign', 'src': 'vanaf nu', 'value': 1 },
673
+ { 'name': 'shift', 'src': 'laatste|vorige|afgelopen', 'value': -1 },
674
+ { 'name': 'shift', 'src': 'volgend:|e', 'value': 1 }
675
+ ],
676
+ 'dateParse': [
677
+ '{num} {unit} {sign}',
678
+ '{0?} {unit=5-7} {shift}',
679
+ '{0?} {shift} {unit=5-7}'
680
+ ],
681
+ 'timeParse': [
682
+ '{weekday?} {date?} {month} {year?}',
683
+ '{shift} {weekday}'
684
+ ]
685
+ });
471
686
  /*
472
687
  *
473
688
  * Date.addLocale(<code>) adds this locale to Sugar.
@@ -562,7 +777,7 @@ Date.addLocale('pl', {
562
777
  * locale.addFormat adds a date format (see this file for examples).
563
778
  * Special tokens in the date format will be parsed out into regex tokens:
564
779
  *
565
- * {0} is a reference to an entry in locale.optionals. Output: (?:the)?
780
+ * {0} is a reference to an entry in locale.tokens. Output: (?:the)?
566
781
  * {unit} is a reference to all units. Output: (day|week|month|...)
567
782
  * {unit3} is a reference to a specific unit. Output: (hour)
568
783
  * {unit3-5} is a reference to a subset of the units array. Output: (hour|day|week)
@@ -597,7 +812,7 @@ Date.addLocale('pt', {
597
812
  'weekdays': 'domingo,segunda-feira,terça-feira,quarta-feira,quinta-feira,sexta-feira,sábado|sabado',
598
813
  'units': 'milisegundo:|s,segundo:|s,minuto:|s,hora:|s,dia:|s,semana:|s,mês|mêses|mes|meses,ano:|s',
599
814
  'numbers': 'um,dois,três|tres,quatro,cinco,seis,sete,oito,nove,dez,uma,duas',
600
- 'optionals': 'a,de',
815
+ 'tokens': 'a,de',
601
816
  'short':'{d} de {month} de {yyyy}',
602
817
  'long': '{d} de {month} de {yyyy} {H}:{mm}',
603
818
  'full': '{Weekday}, {d} de {month} de {yyyy} {H}:{mm}:{ss}',
@@ -619,12 +834,12 @@ Date.addLocale('pt', {
619
834
  'dateParse': [
620
835
  '{num} {unit} {sign}',
621
836
  '{sign} {num} {unit}',
622
- '{0} {unit=5-7} {shift}',
623
- '{0} {shift} {unit=5-7}'
837
+ '{0?} {unit=5-7} {shift}',
838
+ '{0?} {shift} {unit=5-7}'
624
839
  ],
625
840
  'timeParse': [
626
- '{date?} {1} {month} {1} {year?}',
627
- '{0} {shift} {weekday}'
841
+ '{date?} {1?} {month} {1?} {year?}',
842
+ '{0?} {shift} {weekday}'
628
843
  ]
629
844
  });
630
845
 
@@ -641,7 +856,7 @@ Date.addLocale('pt', {
641
856
  * locale.addFormat adds a date format (see this file for examples).
642
857
  * Special tokens in the date format will be parsed out into regex tokens:
643
858
  *
644
- * {0} is a reference to an entry in locale.optionals. Output: (?:the)?
859
+ * {0} is a reference to an entry in locale.tokens. Output: (?:the)?
645
860
  * {unit} is a reference to all units. Output: (day|week|month|...)
646
861
  * {unit3} is a reference to a specific unit. Output: (hour)
647
862
  * {unit3-5} is a reference to a subset of the units array. Output: (hour|day|week)
@@ -675,13 +890,25 @@ Date.addLocale('ru', {
675
890
  'weekdays': 'Воскресенье,Понедельник,Вторник,Среда,Четверг,Пятница,Суббота',
676
891
  'units': 'миллисекунд:а|у|ы|,секунд:а|у|ы|,минут:а|у|ы|,час:||а|ов,день|день|дня|дней,недел:я|ю|и|ь|е,месяц:||а|ев|е,год|год|года|лет|году',
677
892
  'numbers': 'од:ин|ну,дв:а|е,три,четыре,пять,шесть,семь,восемь,девять,десять',
678
- 'optionals': 'в|на,года',
893
+ 'tokens': 'в|на,года',
679
894
  'short':'{d} {month} {yyyy} года',
680
895
  'long': '{d} {month} {yyyy} года {H}:{mm}',
681
896
  'full': '{Weekday} {d} {month} {yyyy} года {H}:{mm}:{ss}',
682
- 'past': '{num} {unit} {sign}',
683
- 'future': '{sign} {num} {unit}',
684
- 'duration': '{num} {unit}',
897
+ 'relative': function(num, unit, ms, format) {
898
+ var numberWithUnit, last = num.toString().slice(-1);
899
+ switch(true) {
900
+ case num >= 11 && num <= 15: mult = 3; break;
901
+ case last == 1: mult = 1; break;
902
+ case last >= 2 && last <= 4: mult = 2; break;
903
+ default: mult = 3;
904
+ }
905
+ numberWithUnit = num + ' ' + this['units'][(mult * 8) + unit];
906
+ switch(format) {
907
+ case 'duration': return numberWithUnit;
908
+ case 'past': return numberWithUnit + ' назад';
909
+ case 'future': return 'через ' + numberWithUnit;
910
+ }
911
+ },
685
912
  'timeMarker': 'в',
686
913
  'ampm': ' утра, вечера',
687
914
  'modifiers': [
@@ -699,11 +926,11 @@ Date.addLocale('ru', {
699
926
  '{num} {unit} {sign}',
700
927
  '{sign} {num} {unit}',
701
928
  '{month} {year}',
702
- '{0} {shift} {unit=5-7}'
929
+ '{0?} {shift} {unit=5-7}'
703
930
  ],
704
931
  'timeParse': [
705
- '{date} {month} {year?} {1}',
706
- '{0} {shift} {weekday}'
932
+ '{date} {month} {year?} {1?}',
933
+ '{0?} {shift} {weekday}'
707
934
  ]
708
935
  });
709
936
 
@@ -720,7 +947,7 @@ Date.addLocale('ru', {
720
947
  * locale.addFormat adds a date format (see this file for examples).
721
948
  * Special tokens in the date format will be parsed out into regex tokens:
722
949
  *
723
- * {0} is a reference to an entry in locale.optionals. Output: (?:the)?
950
+ * {0} is a reference to an entry in locale.tokens. Output: (?:the)?
724
951
  * {unit} is a reference to all units. Output: (day|week|month|...)
725
952
  * {unit3} is a reference to a specific unit. Output: (hour)
726
953
  * {unit3-5} is a reference to a subset of the units array. Output: (hour|day|week)
@@ -755,7 +982,7 @@ Date.addLocale('sv', {
755
982
  'weekdays': 'söndag|sondag,måndag:|en+mandag:|en,tisdag,onsdag,torsdag,fredag,lördag|lordag',
756
983
  'units': 'millisekund:|er,sekund:|er,minut:|er,timm:e|ar,dag:|ar,veck:a|or|an,månad:|er|en+manad:|er|en,år:||et+ar:||et',
757
984
  'numbers': 'en|ett,två|tva,tre,fyra,fem,sex,sju,åtta|atta,nio,tio',
758
- 'optionals': 'den,för|for',
985
+ 'tokens': 'den,för|for',
759
986
  'articles': 'den',
760
987
  'short':'den {d} {month} {yyyy}',
761
988
  'long': 'den {d} {month} {yyyy} {H}:{mm}',
@@ -779,11 +1006,11 @@ Date.addLocale('sv', {
779
1006
  'dateParse': [
780
1007
  '{num} {unit} {sign}',
781
1008
  '{sign} {num} {unit}',
782
- '{1} {num} {unit} {sign}',
783
- '{shift} {unit5-7}'
1009
+ '{1?} {num} {unit} {sign}',
1010
+ '{shift} {unit=5-7}'
784
1011
  ],
785
1012
  'timeParse': [
786
- '{0} {weekday?} {date?} {month} {year}',
1013
+ '{0?} {weekday?} {date?} {month} {year}',
787
1014
  '{date} {month}',
788
1015
  '{shift} {weekday}'
789
1016
  ]
@@ -802,7 +1029,7 @@ Date.addLocale('sv', {
802
1029
  * locale.addFormat adds a date format (see this file for examples).
803
1030
  * Special tokens in the date format will be parsed out into regex tokens:
804
1031
  *
805
- * {0} is a reference to an entry in locale.optionals. Output: (?:the)?
1032
+ * {0} is a reference to an entry in locale.tokens. Output: (?:the)?
806
1033
  * {unit} is a reference to all units. Output: (day|week|month|...)
807
1034
  * {unit3} is a reference to a specific unit. Output: (hour)
808
1035
  * {unit3-5} is a reference to a subset of the units array. Output: (hour|day|week)
@@ -836,7 +1063,7 @@ Date.addLocale('zh-CN', {
836
1063
  'monthSuffix': '月',
837
1064
  'weekdays': '星期日|周日,星期一|周一,星期二|周二,星期三|周三,星期四|周四,星期五|周五,星期六|周六',
838
1065
  'units': '毫秒,秒钟,分钟,小时,天,个星期|周,个月,年',
839
- 'optionals': '日|号',
1066
+ 'tokens': '日|号',
840
1067
  'short':'{yyyy}年{M}月{d}日',
841
1068
  'long': '{yyyy}年{M}月{d}日 {tt}{h}:{mm}',
842
1069
  'full': '{yyyy}年{M}月{d}日 {weekday} {tt}{h}:{mm}:{ss}',
@@ -863,9 +1090,9 @@ Date.addLocale('zh-CN', {
863
1090
  ],
864
1091
  'timeParse': [
865
1092
  '{shift}{weekday}',
866
- '{year}年{month?}月?{date?}{0}',
867
- '{month}月{date?}{0}',
868
- '{date}{0}'
1093
+ '{year}年{month?}月?{date?}{0?}',
1094
+ '{month}月{date?}{0?}',
1095
+ '{date}[日号]'
869
1096
  ]
870
1097
  });
871
1098
 
@@ -882,7 +1109,7 @@ Date.addLocale('zh-CN', {
882
1109
  * locale.addFormat adds a date format (see this file for examples).
883
1110
  * Special tokens in the date format will be parsed out into regex tokens:
884
1111
  *
885
- * {0} is a reference to an entry in locale.optionals. Output: (?:the)?
1112
+ * {0} is a reference to an entry in locale.tokens. Output: (?:the)?
886
1113
  * {unit} is a reference to all units. Output: (day|week|month|...)
887
1114
  * {unit3} is a reference to a specific unit. Output: (hour)
888
1115
  * {unit3-5} is a reference to a subset of the units array. Output: (hour|day|week)
@@ -917,7 +1144,7 @@ Date.addLocale('zh-TW', {
917
1144
  'monthSuffix': '月',
918
1145
  'weekdays': '星期日|週日,星期一|週一,星期二|週二,星期三|週三,星期四|週四,星期五|週五,星期六|週六',
919
1146
  'units': '毫秒,秒鐘,分鐘,小時,天,個星期|週,個月,年',
920
- 'optionals': '日|號',
1147
+ 'tokens': '日|號',
921
1148
  'short':'{yyyy}年{M}月{d}日',
922
1149
  'long': '{yyyy}年{M}月{d}日 {tt}{h}:{mm}',
923
1150
  'full': '{yyyy}年{M}月{d}日 {Weekday} {tt}{h}:{mm}:{ss}',
@@ -944,9 +1171,9 @@ Date.addLocale('zh-TW', {
944
1171
  ],
945
1172
  'timeParse': [
946
1173
  '{shift}{weekday}',
947
- '{year}年{month?}月?{date?}{0}',
948
- '{month}月{date?}{0}',
949
- '{date}{0}'
1174
+ '{year}年{month?}月?{date?}{0?}',
1175
+ '{month}月{date?}{0?}',
1176
+ '{date}[日號]'
950
1177
  ]
951
1178
  });
952
1179
 
@@ -46,8 +46,8 @@
46
46
  var min, max;
47
47
  if(arguments.length == 1) n2 = n1, n1 = 0;
48
48
  min = math.min(n1 || 0, isUndefined(n2) ? 1 : n2);
49
- max = math.max(n1 || 0, isUndefined(n2) ? 1 : n2);
50
- return round((math.random() * (max - min)) + min);
49
+ max = math.max(n1 || 0, isUndefined(n2) ? 1 : n2) + 1;
50
+ return floor((math.random() * (max - min)) + min);
51
51
  }
52
52
 
53
53
  });
@@ -292,10 +292,10 @@
292
292
  'fromQueryString': function(str, deep) {
293
293
  var result = object.extended(), split;
294
294
  str = str && str.toString ? str.toString() : '';
295
- decodeURIComponent(str.replace(/^.*?\?/, '')).split('&').forEach(function(p) {
295
+ str.replace(/^.*?\?/, '').split('&').forEach(function(p) {
296
296
  var split = p.split('=');
297
297
  if(split.length !== 2) return;
298
- setParamsObject(result, split[0], split[1], deep);
298
+ setParamsObject(result, split[0], decodeURIComponent(split[1]), deep);
299
299
  });
300
300
  return result;
301
301
  },
@@ -1,16 +1,16 @@
1
- function Ba(a,b,c,d){var e=k;if(a===b)return k;else if(E(b)&&D(a))return q(b).test(a);else if(A(b)&&!A(a))return b.apply(c,d);else if(L(b)&&la(a)){H(b,function(f){Ba(a[f],b[f],c,[a[f],a])||(e=m)});return e}else return ua(a)&&ua(b)?ta(a)===ta(b):a===b}function S(a,b,c,d){return K(b)?a:A(b)?b.apply(c,d||[]):A(a[b])?a[b].call(a):a[b]}
2
- function T(a,b,c,d){var e,f;if(c<0)c=a.length+c;f=isNaN(c)?0:c;for(c=d===k?a.length+f:a.length;f<c;){e=f%a.length;if(e in a){if(b.call(a,a[e],e,a)===m)break}else return Ca(a,b,f,d);f++}}function Ca(a,b,c){var d=[],e;for(e in a)e in a&&e>>>0==e&&e!=4294967295&&e>=c&&d.push(parseInt(e));d.sort().each(function(f){return b.call(a,a[f],f,a)});return a}function Ea(a,b,c,d,e){var f,g;T(a,function(j,i,h){if(Ba(j,b,h,[j,i,h])){f=j;g=i;return m}},c,d);return e?g:f}
3
- function Fa(a,b){var c=[],d={},e;T(a,function(f,g){e=b?S(f,b,a,[f,g,a]):f;Ga(d,e)||c.push(f)});return c}function Ha(a,b,c){var d=[],e={};b.each(function(f){Ga(e,f)});a.each(function(f){var g=ta(f),j=!ua(f);if(Ia(e,g,f,j)!=c){var i=0;if(j)for(g=e[g];i<g.length;)if(g[i]===f)g.splice(i,1);else i+=1;else delete e[g];d.push(f)}});return d}function Ja(a,b,c){b=b||Infinity;c=c||0;var d=[];T(a,function(e){if(fa(e)&&c<b)d=d.concat(Ja(e,b,c+1));else d.push(e)});return d}
4
- function Ka(a){var b=[];G(a,function(c){b=b.concat(c)});return b}function Ia(a,b,c,d){var e=b in a;if(d){a[b]||(a[b]=[]);e=a[b].indexOf(c)!==-1}return e}function Ga(a,b){var c=ta(b),d=!ua(b),e=Ia(a,c,b,d);if(d)a[c].push(b);else a[c]=b;return e}function La(a,b,c,d){var e,f=[],g=c==="max",j=c==="min",i=Array.isArray(a);H(a,function(h){var n=a[h];h=S(n,b,a,i?[n,parseInt(h),a]:[]);if(h===e)f.push(n);else if(K(e)||g&&h>e||j&&h<e){f=[n];e=h}});i||(f=Ja(f,1));return d?f:f[0]}
5
- function Ma(a){if(p[Na])a=a.toLowerCase();return a.replace(p[Oa],"")}function Pa(a,b){var c=a.charAt(b);return(p[Qa]||{})[c]||c}function Ra(a){var b=p[Sa];return a?b.indexOf(a):l}var Sa="AlphanumericSortOrder",Oa="AlphanumericSortIgnore",Na="AlphanumericSortIgnoreCase",Qa="AlphanumericSortEquivalents";F(p,m,m,{create:function(){var a=[];G(arguments,function(b){if(la(b))a=a.concat(p.prototype.slice.call(b));else a.push(b)});return a}});
6
- F(p,k,m,{find:function(a,b,c){return Ea(this,a,b,c)},findAll:function(a,b,c){var d=[];T(this,function(e,f,g){Ba(e,a,g,[e,f,g])&&d.push(e)},b,c);return d},findIndex:function(a,b,c){a=Ea(this,a,b,c,k);return K(a)?-1:a},count:function(a){if(K(a))return this.length;return this.findAll(a).length},removeAt:function(a,b){if(K(a))return this;if(K(b))b=a;for(var c=0;c<=b-a;c++)this.splice(a,1);return this},include:function(a,b){return this.clone().add(a,b)},exclude:function(){return p.prototype.remove.apply(this.clone(),
7
- arguments)},clone:function(){return na([],this)},unique:function(a){return Fa(this,a)},flatten:function(a){return Ja(this,a)},union:function(){return Fa(this.concat(Ka(arguments)))},intersect:function(){return Ha(this,Ka(arguments),m)},subtract:function(){return Ha(this,Ka(arguments),k)},at:function(){return va(this,arguments)},first:function(a){if(K(a))return this[0];if(a<0)a=0;return this.slice(0,a)},last:function(a){if(K(a))return this[this.length-1];return this.slice(this.length-a<0?0:this.length-
1
+ function Ba(a,b,c,d){var e=k;if(a===b)return k;else if(D(b)&&C(a))return r(b).test(a);else if(z(b)&&!z(a))return b.apply(c,d);else if(L(b)&&ka(a)){G(b,function(g){Ba(a[g],b[g],c,[a[g],a])||(e=n)});return e}else return ua(a)&&ua(b)?ta(a)===ta(b):a===b}function R(a,b,c,d){return K(b)?a:z(b)?b.apply(c,d||[]):z(a[b])?a[b].call(a):a[b]}
2
+ function T(a,b,c,d){var e,g;if(c<0)c=a.length+c;g=isNaN(c)?0:c;for(c=d===k?a.length+g:a.length;g<c;){e=g%a.length;if(e in a){if(b.call(a,a[e],e,a)===n)break}else return Ca(a,b,g,d);g++}}function Ca(a,b,c){var d=[],e;for(e in a)e in a&&e>>>0==e&&e!=4294967295&&e>=c&&d.push(parseInt(e));d.sort().each(function(g){return b.call(a,a[g],g,a)});return a}function Ea(a,b,c,d,e){var g,f;T(a,function(i,j,h){if(Ba(i,b,h,[i,j,h])){g=i;f=j;return n}},c,d);return e?f:g}
3
+ function Fa(a,b){var c=[],d={},e;T(a,function(g,f){e=b?R(g,b,a,[g,f,a]):g;Ga(d,e)||c.push(g)});return c}function Ha(a,b,c){var d=[],e={};b.each(function(g){Ga(e,g)});a.each(function(g){var f=ta(g),i=!ua(g);if(Ia(e,f,g,i)!=c){var j=0;if(i)for(f=e[f];j<f.length;)if(f[j]===g)f.splice(j,1);else j+=1;else delete e[f];d.push(g)}});return d}function Ja(a,b,c){b=b||Infinity;c=c||0;var d=[];T(a,function(e){if(da(e)&&c<b)d=d.concat(Ja(e,b,c+1));else d.push(e)});return d}
4
+ function Ka(a){var b=[];F(a,function(c){b=b.concat(c)});return b}function Ia(a,b,c,d){var e=b in a;if(d){a[b]||(a[b]=[]);e=a[b].indexOf(c)!==-1}return e}function Ga(a,b){var c=ta(b),d=!ua(b),e=Ia(a,c,b,d);if(d)a[c].push(b);else a[c]=b;return e}function La(a,b,c,d){var e,g=[],f=c==="max",i=c==="min",j=Array.isArray(a);G(a,function(h){var m=a[h];h=R(m,b,a,j?[m,parseInt(h),a]:[]);if(h===e)g.push(m);else if(K(e)||f&&h>e||i&&h<e){g=[m];e=h}});j||(g=Ja(g,1));return d?g:g[0]}
5
+ function Ma(a){if(q[Na])a=a.toLowerCase();return a.replace(q[Oa],"")}function Pa(a,b){var c=a.charAt(b);return(q[Qa]||{})[c]||c}function Ra(a){var b=q[Sa];return a?b.indexOf(a):l}var Sa="AlphanumericSortOrder",Oa="AlphanumericSortIgnore",Na="AlphanumericSortIgnoreCase",Qa="AlphanumericSortEquivalents";E(q,n,n,{create:function(){var a=[],b;F(arguments,function(c){if(ka(c)){b=q.prototype.slice.call(c);if(b.length>0)c=b}a=a.concat(c)});return a}});
6
+ E(q,k,n,{find:function(a,b,c){return Ea(this,a,b,c)},findAll:function(a,b,c){var d=[];T(this,function(e,g,f){Ba(e,a,f,[e,g,f])&&d.push(e)},b,c);return d},findIndex:function(a,b,c){a=Ea(this,a,b,c,k);return K(a)?-1:a},count:function(a){if(K(a))return this.length;return this.findAll(a).length},removeAt:function(a,b){if(K(a))return this;if(K(b))b=a;for(var c=0;c<=b-a;c++)this.splice(a,1);return this},include:function(a,b){return this.clone().add(a,b)},exclude:function(){return q.prototype.remove.apply(this.clone(),
7
+ arguments)},clone:function(){return ma([],this)},unique:function(a){return Fa(this,a)},flatten:function(a){return Ja(this,a)},union:function(){return Fa(this.concat(Ka(arguments)))},intersect:function(){return Ha(this,Ka(arguments),n)},subtract:function(){return Ha(this,Ka(arguments),k)},at:function(){return va(this,arguments)},first:function(a){if(K(a))return this[0];if(a<0)a=0;return this.slice(0,a)},last:function(a){if(K(a))return this[this.length-1];return this.slice(this.length-a<0?0:this.length-
8
8
  a)},from:function(a){return this.slice(a)},to:function(a){if(K(a))a=this.length;return this.slice(0,a)},min:function(a,b){return La(this,a,"min",b)},max:function(a,b){return La(this,a,"max",b)},least:function(a,b){return La(this.groupBy.apply(this,[a]),"length","min",b)},most:function(a,b){return La(this.groupBy.apply(this,[a]),"length","max",b)},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?
9
- a.sum()/a.length:0},inGroups:function(a,b){var c=arguments.length>1,d=this,e=[],f=O(this.length/a,void 0,"ceil");N(0,a-1,function(g){g=g*f;var j=d.slice(g,g+f);c&&j.length<f&&N(1,f-j.length,function(){j=j.add(b)});e.push(j)});return e},inGroupsOf:function(a,b){var c=[],d=this.length,e=this,f;if(d===0||a===0)return e;if(K(a))a=1;if(K(b))b=l;N(0,O(d/a,void 0,"ceil")-1,function(g){for(f=e.slice(a*g,a*g+a);f.length<a;)f.push(b);c.push(f)});return c},isEmpty:function(){return this.compact().length==0},
10
- sortBy:function(a,b){var c=this.clone();c.sort(function(d,e){var f,g;f=S(d,a,c,[d]);g=S(e,a,c,[e]);if(D(f)&&D(g)){f=f;g=g;var j,i,h,n,r=0,y=0;f=Ma(f);g=Ma(g);do{h=Pa(f,r);n=Pa(g,r);j=Ra(h);i=Ra(n);if(j===-1||i===-1){j=f.charCodeAt(r)||l;i=g.charCodeAt(r)||l}h=h!==f.charAt(r);n=n!==g.charAt(r);if(h!==n&&y===0)y=h-n;r+=1}while(j!=l&&i!=l&&j===i);f=j===i?y:j<i?-1:1}else f=f<g?-1:f>g?1:0;return f*(b?-1:1)});return c},randomize:function(){for(var a=this.concat(),b,c,d=a.length;d;b=parseInt(v.random()*
11
- d),c=a[--d],a[d]=a[b],a[b]=c);return a},zip:function(){var a=G(arguments);return this.map(function(b,c){return[b].concat(a.map(function(d){return c in d?d[c]:l}))})},sample:function(a){var b=[],c=this.clone(),d;if(K(a))a=1;for(;b.length<a;){d=oa(v.random()*(c.length-1));b.push(c[d]);c.removeAt(d);if(c.length==0)break}return arguments.length>0?b:b[0]},each:function(a,b,c){T(this,a,b,c);return this},add:function(a,b){if(!B(u(b))||isNaN(b))b=this.length;p.prototype.splice.apply(this,[b,0].concat(a));
12
- return this},remove:function(){var a,b=this;G(arguments,function(c){for(a=0;a<b.length;)if(Ba(b[a],c,b,[b[a],a,b]))b.splice(a,1);else a++});return b},compact:function(a){var b=[];T(this,function(c){if(fa(c))b.push(c.compact());else if(a&&c)b.push(c);else!a&&c!=l&&c.valueOf()===c.valueOf()&&b.push(c)});return b},groupBy:function(a,b){var c=this,d={},e;T(c,function(f,g){e=S(f,a,c,[f,g,c]);d[e]||(d[e]=[]);d[e].push(f)});b&&H(d,b);return d},none:function(){return!this.any.apply(this,arguments)}});
13
- F(p,k,m,{all:p.prototype.every,any:p.prototype.some,insert:p.prototype.add});function Ta(a){if(a&&a.valueOf)a=a.valueOf();return o.keys(a)}function Ua(a,b){I(o,m,m,a,function(c,d){c[d]=function(e,f,g){g=p.prototype[d].call(Ta(e),function(j){return b?S(e[j],f,e,[j,e[j],e]):Ba(e[j],f,e,[j,e[j],e])},g);if(fa(g))g=g.reduce(function(j,i){j[i]=e[i];return j},{});return g}});wa(a,M)}
14
- F(o,m,m,{map:function(a,b){return Ta(a).reduce(function(c,d){c[d]=S(a[d],b,a,[d,a[d],a]);return c},{})},reduce:function(a){var b=Ta(a).map(function(c){return a[c]});return b.reduce.apply(b,G(arguments).slice(1))},size:function(a){return Ta(a).length}});(function(){I(p,k,function(){var a=arguments;return a.length>0&&!A(a[0])},"map,every,all,some,any,none,filter",function(a,b){a[b]=function(c){return this[b](function(d,e){return b==="map"?S(d,c,this,[d,e,this]):Ba(d,c,this,[d,e,this])})}})})();
15
- (function(){p[Sa]="A\u00c1\u00c0\u00c2\u00c3\u0104BC\u0106\u010c\u00c7D\u010e\u00d0E\u00c9\u00c8\u011a\u00ca\u00cb\u0118FG\u011eH\u0131I\u00cd\u00cc\u0130\u00ce\u00cfJKL\u0141MN\u0143\u0147\u00d1O\u00d3\u00d2\u00d4PQR\u0158S\u015a\u0160\u015eT\u0164U\u00da\u00d9\u016e\u00db\u00dcVWXY\u00ddZ\u0179\u017b\u017d\u00de\u00c6\u0152\u00d8\u00d5\u00c5\u00c4\u00d6".split("").map(function(b){return b+b.toLowerCase()}).join("");var a={};T("A\u00c1\u00c0\u00c2\u00c3\u00c4,C\u00c7,E\u00c9\u00c8\u00ca\u00cb,I\u00cd\u00cc\u0130\u00ce\u00cf,O\u00d3\u00d2\u00d4\u00d5\u00d6,S\u00df,U\u00da\u00d9\u00db\u00dc".split(","),
16
- function(b){var c=b.charAt(0);T(b.slice(1).split(""),function(d){a[d]=c;a[d.toLowerCase()]=c.toLowerCase()})});p[Na]=k;p[Qa]=a})();Ua("each,any,all,none,count,find,findAll,isEmpty");Ua("sum,average,min,max,least,most",k);wa("map,reduce,size",M);
9
+ a.sum()/a.length:0},inGroups:function(a,b){var c=arguments.length>1,d=this,e=[],g=M(this.length/a,void 0,"ceil");oa(0,a-1,function(f){f=f*g;var i=d.slice(f,f+g);c&&i.length<g&&oa(1,g-i.length,function(){i=i.add(b)});e.push(i)});return e},inGroupsOf:function(a,b){var c=[],d=this.length,e=this,g;if(d===0||a===0)return e;if(K(a))a=1;if(K(b))b=l;oa(0,M(d/a,void 0,"ceil")-1,function(f){for(g=e.slice(a*f,a*f+a);g.length<a;)g.push(b);c.push(g)});return c},isEmpty:function(){return this.compact().length==
10
+ 0},sortBy:function(a,b){var c=this.clone();c.sort(function(d,e){var g,f;g=R(d,a,c,[d]);f=R(e,a,c,[e]);if(C(g)&&C(f)){g=g;f=f;var i,j,h,m,o=0,w=0;g=Ma(g);f=Ma(f);do{h=Pa(g,o);m=Pa(f,o);i=Ra(h);j=Ra(m);if(i===-1||j===-1){i=g.charCodeAt(o)||l;j=f.charCodeAt(o)||l}h=h!==g.charAt(o);m=m!==f.charAt(o);if(h!==m&&w===0)w=h-m;o+=1}while(i!=l&&j!=l&&i===j);g=i===j?w:i<j?-1:1}else g=g<f?-1:g>f?1:0;return g*(b?-1:1)});return c},randomize:function(){for(var a=this.concat(),b,c,d=a.length;d;b=parseInt(v.random()*
11
+ d),c=a[--d],a[d]=a[b],a[b]=c);return a},zip:function(){var a=F(arguments);return this.map(function(b,c){return[b].concat(a.map(function(d){return c in d?d[c]:l}))})},sample:function(a){var b=[],c=this.clone(),d;if(K(a))a=1;for(;b.length<a;){d=N(v.random()*(c.length-1));b.push(c[d]);c.removeAt(d);if(c.length==0)break}return arguments.length>0?b:b[0]},each:function(a,b,c){T(this,a,b,c);return this},add:function(a,b){if(!A(u(b))||isNaN(b))b=this.length;q.prototype.splice.apply(this,[b,0].concat(a));
12
+ return this},remove:function(){var a,b=this;F(arguments,function(c){for(a=0;a<b.length;)if(Ba(b[a],c,b,[b[a],a,b]))b.splice(a,1);else a++});return b},compact:function(a){var b=[];T(this,function(c){if(da(c))b.push(c.compact());else if(a&&c)b.push(c);else!a&&c!=l&&c.valueOf()===c.valueOf()&&b.push(c)});return b},groupBy:function(a,b){var c=this,d={},e;T(c,function(g,f){e=R(g,a,c,[g,f,c]);d[e]||(d[e]=[]);d[e].push(g)});b&&G(d,b);return d},none:function(){return!this.any.apply(this,arguments)}});
13
+ E(q,k,n,{all:q.prototype.every,any:q.prototype.some,insert:q.prototype.add});function Ta(a){if(a&&a.valueOf)a=a.valueOf();return p.keys(a)}function Ua(a,b){H(p,n,n,a,function(c,d){c[d]=function(e,g,f){f=q.prototype[d].call(Ta(e),function(i){return b?R(e[i],g,e,[i,e[i],e]):Ba(e[i],g,e,[i,e[i],e])},f);if(da(f))f=f.reduce(function(i,j){i[j]=e[j];return i},{});return f}});wa(a,na)}
14
+ E(p,n,n,{map:function(a,b){return Ta(a).reduce(function(c,d){c[d]=R(a[d],b,a,[d,a[d],a]);return c},{})},reduce:function(a){var b=Ta(a).map(function(c){return a[c]});return b.reduce.apply(b,F(arguments).slice(1))},size:function(a){return Ta(a).length}});(function(){H(q,k,function(){var a=arguments;return a.length>0&&!z(a[0])},"map,every,all,some,any,none,filter",function(a,b){a[b]=function(c){return this[b](function(d,e){return b==="map"?R(d,c,this,[d,e,this]):Ba(d,c,this,[d,e,this])})}})})();
15
+ (function(){q[Sa]="A\u00c1\u00c0\u00c2\u00c3\u0104BC\u0106\u010c\u00c7D\u010e\u00d0E\u00c9\u00c8\u011a\u00ca\u00cb\u0118FG\u011eH\u0131I\u00cd\u00cc\u0130\u00ce\u00cfJKL\u0141MN\u0143\u0147\u00d1O\u00d3\u00d2\u00d4PQR\u0158S\u015a\u0160\u015eT\u0164U\u00da\u00d9\u016e\u00db\u00dcVWXY\u00ddZ\u0179\u017b\u017d\u00de\u00c6\u0152\u00d8\u00d5\u00c5\u00c4\u00d6".split("").map(function(b){return b+b.toLowerCase()}).join("");var a={};T("A\u00c1\u00c0\u00c2\u00c3\u00c4,C\u00c7,E\u00c9\u00c8\u00ca\u00cb,I\u00cd\u00cc\u0130\u00ce\u00cf,O\u00d3\u00d2\u00d4\u00d5\u00d6,S\u00df,U\u00da\u00d9\u00db\u00dc".split(","),
16
+ function(b){var c=b.charAt(0);T(b.slice(1).split(""),function(d){a[d]=c;a[d.toLowerCase()]=c.toLowerCase()})});q[Na]=k;q[Qa]=a})();Ua("each,any,all,none,count,find,findAll,isEmpty");Ua("sum,average,min,max,least,most",k);wa("map,reduce,size",na);