@js-joda/locale_fr 4.8.6 → 4.8.11
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.
- package/dist/index.esm.js +1304 -1817
- package/dist/index.js +1304 -1819
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +22 -22
- package/package.json +2 -2
package/dist/index.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//! @version @js-joda/locale - 4.8.
|
|
1
|
+
//! @version @js-joda/locale - 4.8.10
|
|
2
2
|
//! @copyright (c) 2015-present, Philipp Thürwächter, Pattrick Hüper & js-joda contributors
|
|
3
3
|
//! @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos
|
|
4
4
|
//! @license BSD-3-Clause (see LICENSE in the root directory of this source tree)
|
|
@@ -6,39 +6,31 @@
|
|
|
6
6
|
import { IllegalArgumentException, DateTimeFormatterBuilder, SignStyle, TextStyle, ChronoField, IsoFields, _, TemporalQueries, ZoneOffset, ZoneRulesProvider, ZoneId, ValueRange, DayOfWeek, ChronoUnit, IllegalStateException, LocalDate, Year, ResolverStyle, DateTimeException, IsoChronology, TemporalField, DateTimeFormatter, use } from '@js-joda/core';
|
|
7
7
|
|
|
8
8
|
function _extends() {
|
|
9
|
-
_extends = Object.assign
|
|
9
|
+
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
10
10
|
for (var i = 1; i < arguments.length; i++) {
|
|
11
11
|
var source = arguments[i];
|
|
12
|
-
|
|
13
12
|
for (var key in source) {
|
|
14
13
|
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
15
14
|
target[key] = source[key];
|
|
16
15
|
}
|
|
17
16
|
}
|
|
18
17
|
}
|
|
19
|
-
|
|
20
18
|
return target;
|
|
21
19
|
};
|
|
22
|
-
|
|
23
20
|
return _extends.apply(this, arguments);
|
|
24
21
|
}
|
|
25
|
-
|
|
26
22
|
function _inheritsLoose(subClass, superClass) {
|
|
27
23
|
subClass.prototype = Object.create(superClass.prototype);
|
|
28
24
|
subClass.prototype.constructor = subClass;
|
|
29
|
-
|
|
30
25
|
_setPrototypeOf(subClass, superClass);
|
|
31
26
|
}
|
|
32
|
-
|
|
33
27
|
function _setPrototypeOf(o, p) {
|
|
34
|
-
_setPrototypeOf = Object.setPrototypeOf
|
|
28
|
+
_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
|
|
35
29
|
o.__proto__ = p;
|
|
36
30
|
return o;
|
|
37
31
|
};
|
|
38
|
-
|
|
39
32
|
return _setPrototypeOf(o, p);
|
|
40
33
|
}
|
|
41
|
-
|
|
42
34
|
function _unsupportedIterableToArray(o, minLen) {
|
|
43
35
|
if (!o) return;
|
|
44
36
|
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
@@ -47,19 +39,14 @@ function _unsupportedIterableToArray(o, minLen) {
|
|
|
47
39
|
if (n === "Map" || n === "Set") return Array.from(o);
|
|
48
40
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
49
41
|
}
|
|
50
|
-
|
|
51
42
|
function _arrayLikeToArray(arr, len) {
|
|
52
43
|
if (len == null || len > arr.length) len = arr.length;
|
|
53
|
-
|
|
54
44
|
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
55
|
-
|
|
56
45
|
return arr2;
|
|
57
46
|
}
|
|
58
|
-
|
|
59
47
|
function _createForOfIteratorHelperLoose(o, allowArrayLike) {
|
|
60
48
|
var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
|
|
61
49
|
if (it) return (it = it.call(o)).next.bind(it);
|
|
62
|
-
|
|
63
50
|
if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
|
|
64
51
|
if (it) o = it;
|
|
65
52
|
var i = 0;
|
|
@@ -73,7 +60,6 @@ function _createForOfIteratorHelperLoose(o, allowArrayLike) {
|
|
|
73
60
|
};
|
|
74
61
|
};
|
|
75
62
|
}
|
|
76
|
-
|
|
77
63
|
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
78
64
|
}
|
|
79
65
|
|
|
@@ -83,83 +69,61 @@ var TextPrinterParser = function () {
|
|
|
83
69
|
this._textStyle = textStyle;
|
|
84
70
|
this._provider = provider;
|
|
85
71
|
}
|
|
86
|
-
|
|
87
72
|
var _proto = TextPrinterParser.prototype;
|
|
88
|
-
|
|
89
73
|
_proto.field = function field() {
|
|
90
74
|
return this._field;
|
|
91
75
|
};
|
|
92
|
-
|
|
93
76
|
_proto.textStyle = function textStyle() {
|
|
94
77
|
return this._textStyle;
|
|
95
78
|
};
|
|
96
|
-
|
|
97
79
|
_proto.provider = function provider() {
|
|
98
80
|
return this._provider;
|
|
99
81
|
};
|
|
100
|
-
|
|
101
82
|
_proto.print = function print(context, buf) {
|
|
102
83
|
var value = context.getValue(this._field);
|
|
103
|
-
|
|
104
84
|
if (value === null) {
|
|
105
85
|
return false;
|
|
106
86
|
}
|
|
107
|
-
|
|
108
87
|
var text = this._provider.getText(this._field, value, this._textStyle, context.locale());
|
|
109
|
-
|
|
110
88
|
if (text === null) {
|
|
111
89
|
return this._numberPrinterParser().print(context, buf);
|
|
112
90
|
}
|
|
113
|
-
|
|
114
91
|
buf.append(text);
|
|
115
92
|
return true;
|
|
116
93
|
};
|
|
117
|
-
|
|
118
94
|
_proto.parse = function parse(context, parseText, position) {
|
|
119
95
|
var length = parseText.length;
|
|
120
|
-
|
|
121
96
|
if (position < 0 || position > length) {
|
|
122
97
|
throw new IllegalArgumentException("The position is invalid: " + position);
|
|
123
98
|
}
|
|
124
|
-
|
|
125
99
|
var style = context.isStrict() ? this._textStyle : null;
|
|
126
|
-
|
|
127
100
|
var it = this._provider.getTextIterator(this._field, style, context.locale());
|
|
128
|
-
|
|
129
101
|
if (it != null) {
|
|
130
102
|
for (var _iterator = _createForOfIteratorHelperLoose(it), _step; !(_step = _iterator()).done;) {
|
|
131
103
|
var entry = _step.value;
|
|
132
104
|
var itText = entry.key;
|
|
133
|
-
|
|
134
105
|
if (context.subSequenceEquals(itText, 0, parseText, position, itText.length)) {
|
|
135
106
|
return context.setParsedField(this._field, entry.value, position, position + itText.length);
|
|
136
107
|
}
|
|
137
108
|
}
|
|
138
|
-
|
|
139
109
|
if (context.isStrict()) {
|
|
140
110
|
return ~position;
|
|
141
111
|
}
|
|
142
112
|
}
|
|
143
|
-
|
|
144
113
|
return this._numberPrinterParser().parse(context, parseText, position);
|
|
145
114
|
};
|
|
146
|
-
|
|
147
115
|
_proto._numberPrinterParser = function _numberPrinterParser() {
|
|
148
116
|
if (this._currentNumberPrinterParser == null) {
|
|
149
117
|
this._currentNumberPrinterParser = new DateTimeFormatterBuilder.NumberPrinterParser(this._field, 1, 19, SignStyle.NORMAL);
|
|
150
118
|
}
|
|
151
|
-
|
|
152
119
|
return this._currentNumberPrinterParser;
|
|
153
120
|
};
|
|
154
|
-
|
|
155
121
|
_proto.toString = function toString() {
|
|
156
122
|
if (this._textStyle === TextStyle.FULL) {
|
|
157
123
|
return "Text(" + this._field + ")";
|
|
158
124
|
}
|
|
159
|
-
|
|
160
125
|
return "Text(" + this._field + "," + this._textStyle + ")";
|
|
161
126
|
};
|
|
162
|
-
|
|
163
127
|
return TextPrinterParser;
|
|
164
128
|
}();
|
|
165
129
|
|
|
@@ -139984,8 +139948,7 @@ function cldrData(path) {
|
|
|
139984
139948
|
/*
|
|
139985
139949
|
* @copyright (c) 2017, Philipp Thuerwaechter & Pattrick Hueper
|
|
139986
139950
|
* @license BSD-3-Clause (see LICENSE.md in the root directory of this source tree)
|
|
139987
|
-
*/
|
|
139988
|
-
var createEntry = function createEntry(text, field) {
|
|
139951
|
+
*/var createEntry = function createEntry(text, field) {
|
|
139989
139952
|
return {
|
|
139990
139953
|
key: text,
|
|
139991
139954
|
value: field,
|
|
@@ -139994,11 +139957,9 @@ var createEntry = function createEntry(text, field) {
|
|
|
139994
139957
|
}
|
|
139995
139958
|
};
|
|
139996
139959
|
};
|
|
139997
|
-
|
|
139998
139960
|
var _comparator = function _comparator(obj1, obj2) {
|
|
139999
139961
|
return obj2.key.length - obj1.key.length;
|
|
140000
139962
|
};
|
|
140001
|
-
|
|
140002
139963
|
var LocaleStore = function () {
|
|
140003
139964
|
function LocaleStore(valueTextMap) {
|
|
140004
139965
|
this._valueTextMap = valueTextMap;
|
|
@@ -140009,7 +139970,6 @@ var LocaleStore = function () {
|
|
|
140009
139970
|
var list = [];
|
|
140010
139971
|
Object.keys(valueTextMap[style]).forEach(function (key) {
|
|
140011
139972
|
var value = valueTextMap[style][key];
|
|
140012
|
-
|
|
140013
139973
|
if (reverse[value] === undefined) {
|
|
140014
139974
|
reverse[value] = createEntry(value, parseInt(key));
|
|
140015
139975
|
list.push(reverse[value]);
|
|
@@ -140023,25 +139983,35 @@ var LocaleStore = function () {
|
|
|
140023
139983
|
allList.sort(_comparator);
|
|
140024
139984
|
this._parsable = map;
|
|
140025
139985
|
}
|
|
140026
|
-
|
|
140027
139986
|
var _proto = LocaleStore.prototype;
|
|
140028
|
-
|
|
140029
139987
|
_proto.getText = function getText(value, style) {
|
|
140030
139988
|
var map = this._valueTextMap[style];
|
|
140031
139989
|
return map != null ? map[value] : null;
|
|
140032
139990
|
};
|
|
140033
|
-
|
|
140034
139991
|
_proto.getTextIterator = function getTextIterator(style) {
|
|
140035
139992
|
var list = this._parsable[style];
|
|
140036
139993
|
return list != null ? list[Symbol.iterator]() : null;
|
|
140037
139994
|
};
|
|
140038
|
-
|
|
140039
139995
|
return LocaleStore;
|
|
140040
139996
|
}();
|
|
140041
139997
|
|
|
140042
139998
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
140043
139999
|
|
|
140044
|
-
|
|
140000
|
+
function getDefaultExportFromCjs (x) {
|
|
140001
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
140002
|
+
}
|
|
140003
|
+
|
|
140004
|
+
var node_mainExports = {};
|
|
140005
|
+
var node_main = {
|
|
140006
|
+
get exports(){ return node_mainExports; },
|
|
140007
|
+
set exports(v){ node_mainExports = v; },
|
|
140008
|
+
};
|
|
140009
|
+
|
|
140010
|
+
var cldrExports = {};
|
|
140011
|
+
var cldr = {
|
|
140012
|
+
get exports(){ return cldrExports; },
|
|
140013
|
+
set exports(v){ cldrExports = v; },
|
|
140014
|
+
};
|
|
140045
140015
|
|
|
140046
140016
|
/**
|
|
140047
140017
|
* CLDR JavaScript Library v0.5.4
|
|
@@ -140055,616 +140025,554 @@ var cldr = {exports: {}};
|
|
|
140055
140025
|
*/
|
|
140056
140026
|
|
|
140057
140027
|
(function (module) {
|
|
140058
|
-
/*!
|
|
140059
|
-
|
|
140060
|
-
|
|
140061
|
-
|
|
140062
|
-
(function (root, factory) {
|
|
140063
|
-
|
|
140064
|
-
|
|
140065
|
-
|
|
140066
|
-
|
|
140067
|
-
})(commonjsGlobal, function () {
|
|
140068
|
-
|
|
140069
|
-
|
|
140070
|
-
|
|
140071
|
-
|
|
140072
|
-
|
|
140073
|
-
|
|
140074
|
-
|
|
140075
|
-
|
|
140076
|
-
|
|
140077
|
-
|
|
140078
|
-
|
|
140079
|
-
|
|
140080
|
-
|
|
140081
|
-
|
|
140082
|
-
|
|
140083
|
-
|
|
140084
|
-
|
|
140085
|
-
|
|
140086
|
-
|
|
140087
|
-
|
|
140088
|
-
|
|
140089
|
-
|
|
140090
|
-
|
|
140091
|
-
|
|
140092
|
-
|
|
140093
|
-
|
|
140094
|
-
|
|
140095
|
-
|
|
140096
|
-
|
|
140097
|
-
|
|
140098
|
-
|
|
140099
|
-
|
|
140100
|
-
|
|
140101
|
-
|
|
140102
|
-
|
|
140103
|
-
|
|
140104
|
-
|
|
140105
|
-
|
|
140106
|
-
|
|
140107
|
-
|
|
140108
|
-
|
|
140109
|
-
|
|
140110
|
-
|
|
140111
|
-
|
|
140112
|
-
|
|
140113
|
-
|
|
140114
|
-
|
|
140115
|
-
|
|
140116
|
-
|
|
140117
|
-
|
|
140118
|
-
|
|
140119
|
-
|
|
140120
|
-
|
|
140121
|
-
|
|
140122
|
-
|
|
140123
|
-
|
|
140124
|
-
|
|
140125
|
-
|
|
140126
|
-
|
|
140127
|
-
|
|
140128
|
-
|
|
140129
|
-
|
|
140130
|
-
|
|
140131
|
-
|
|
140132
|
-
|
|
140133
|
-
|
|
140134
|
-
|
|
140135
|
-
|
|
140136
|
-
|
|
140137
|
-
|
|
140138
|
-
|
|
140139
|
-
|
|
140140
|
-
|
|
140141
|
-
|
|
140142
|
-
|
|
140143
|
-
|
|
140144
|
-
|
|
140145
|
-
|
|
140146
|
-
|
|
140147
|
-
|
|
140148
|
-
|
|
140149
|
-
|
|
140150
|
-
|
|
140151
|
-
|
|
140152
|
-
|
|
140153
|
-
|
|
140154
|
-
|
|
140155
|
-
|
|
140156
|
-
|
|
140157
|
-
|
|
140158
|
-
|
|
140159
|
-
|
|
140160
|
-
|
|
140161
|
-
|
|
140162
|
-
|
|
140163
|
-
|
|
140164
|
-
|
|
140165
|
-
|
|
140166
|
-
|
|
140167
|
-
|
|
140168
|
-
|
|
140169
|
-
|
|
140170
|
-
|
|
140171
|
-
|
|
140172
|
-
|
|
140173
|
-
|
|
140174
|
-
|
|
140175
|
-
|
|
140176
|
-
|
|
140177
|
-
|
|
140178
|
-
|
|
140179
|
-
|
|
140180
|
-
|
|
140181
|
-
|
|
140182
|
-
|
|
140183
|
-
|
|
140184
|
-
|
|
140185
|
-
|
|
140186
|
-
|
|
140187
|
-
|
|
140188
|
-
|
|
140189
|
-
|
|
140190
|
-
|
|
140191
|
-
|
|
140192
|
-
|
|
140193
|
-
|
|
140194
|
-
|
|
140195
|
-
|
|
140196
|
-
|
|
140197
|
-
|
|
140198
|
-
|
|
140199
|
-
|
|
140200
|
-
|
|
140201
|
-
|
|
140202
|
-
|
|
140203
|
-
|
|
140204
|
-
|
|
140205
|
-
|
|
140206
|
-
|
|
140207
|
-
|
|
140208
|
-
|
|
140209
|
-
|
|
140210
|
-
|
|
140211
|
-
|
|
140212
|
-
|
|
140213
|
-
|
|
140214
|
-
|
|
140215
|
-
|
|
140216
|
-
|
|
140217
|
-
|
|
140218
|
-
|
|
140219
|
-
|
|
140220
|
-
|
|
140221
|
-
|
|
140222
|
-
|
|
140223
|
-
|
|
140224
|
-
|
|
140225
|
-
|
|
140226
|
-
|
|
140227
|
-
|
|
140228
|
-
|
|
140229
|
-
|
|
140230
|
-
|
|
140231
|
-
|
|
140232
|
-
|
|
140233
|
-
|
|
140234
|
-
|
|
140235
|
-
|
|
140236
|
-
|
|
140237
|
-
|
|
140238
|
-
|
|
140239
|
-
|
|
140240
|
-
|
|
140241
|
-
|
|
140242
|
-
|
|
140243
|
-
|
|
140244
|
-
|
|
140245
|
-
|
|
140246
|
-
|
|
140247
|
-
|
|
140248
|
-
|
|
140249
|
-
|
|
140250
|
-
|
|
140251
|
-
|
|
140252
|
-
|
|
140253
|
-
|
|
140254
|
-
|
|
140255
|
-
|
|
140256
|
-
|
|
140257
|
-
|
|
140258
|
-
|
|
140259
|
-
|
|
140260
|
-
|
|
140261
|
-
|
|
140262
|
-
|
|
140263
|
-
|
|
140264
|
-
|
|
140265
|
-
|
|
140266
|
-
|
|
140267
|
-
|
|
140268
|
-
|
|
140269
|
-
|
|
140270
|
-
|
|
140271
|
-
|
|
140272
|
-
|
|
140273
|
-
|
|
140274
|
-
|
|
140275
|
-
|
|
140276
|
-
|
|
140277
|
-
|
|
140278
|
-
|
|
140279
|
-
|
|
140280
|
-
|
|
140281
|
-
|
|
140282
|
-
|
|
140283
|
-
|
|
140284
|
-
|
|
140285
|
-
|
|
140286
|
-
|
|
140287
|
-
|
|
140288
|
-
|
|
140289
|
-
|
|
140290
|
-
|
|
140291
|
-
|
|
140292
|
-
|
|
140293
|
-
|
|
140294
|
-
|
|
140295
|
-
|
|
140296
|
-
|
|
140297
|
-
|
|
140298
|
-
|
|
140299
|
-
|
|
140300
|
-
|
|
140301
|
-
|
|
140302
|
-
|
|
140303
|
-
|
|
140304
|
-
|
|
140305
|
-
|
|
140306
|
-
|
|
140307
|
-
|
|
140308
|
-
|
|
140309
|
-
|
|
140310
|
-
|
|
140311
|
-
|
|
140312
|
-
|
|
140313
|
-
|
|
140314
|
-
|
|
140315
|
-
|
|
140316
|
-
|
|
140317
|
-
|
|
140318
|
-
|
|
140319
|
-
|
|
140320
|
-
|
|
140321
|
-
|
|
140322
|
-
|
|
140323
|
-
|
|
140324
|
-
|
|
140325
|
-
|
|
140326
|
-
|
|
140327
|
-
|
|
140328
|
-
|
|
140329
|
-
|
|
140330
|
-
|
|
140331
|
-
|
|
140332
|
-
|
|
140333
|
-
|
|
140334
|
-
|
|
140335
|
-
|
|
140336
|
-
|
|
140337
|
-
|
|
140338
|
-
|
|
140339
|
-
|
|
140340
|
-
|
|
140341
|
-
|
|
140342
|
-
|
|
140343
|
-
|
|
140344
|
-
|
|
140345
|
-
|
|
140346
|
-
|
|
140347
|
-
|
|
140348
|
-
|
|
140349
|
-
|
|
140350
|
-
|
|
140351
|
-
|
|
140352
|
-
|
|
140353
|
-
|
|
140354
|
-
|
|
140355
|
-
|
|
140356
|
-
|
|
140357
|
-
|
|
140358
|
-
|
|
140359
|
-
|
|
140360
|
-
|
|
140361
|
-
|
|
140362
|
-
|
|
140363
|
-
|
|
140364
|
-
|
|
140365
|
-
|
|
140366
|
-
|
|
140367
|
-
|
|
140368
|
-
|
|
140369
|
-
|
|
140370
|
-
|
|
140371
|
-
|
|
140372
|
-
|
|
140373
|
-
|
|
140374
|
-
|
|
140375
|
-
|
|
140376
|
-
|
|
140377
|
-
|
|
140378
|
-
|
|
140379
|
-
|
|
140380
|
-
|
|
140381
|
-
|
|
140382
|
-
|
|
140383
|
-
|
|
140384
|
-
|
|
140385
|
-
|
|
140386
|
-
|
|
140387
|
-
|
|
140388
|
-
|
|
140389
|
-
|
|
140390
|
-
|
|
140391
|
-
|
|
140392
|
-
|
|
140393
|
-
|
|
140394
|
-
|
|
140395
|
-
|
|
140396
|
-
|
|
140397
|
-
|
|
140398
|
-
|
|
140399
|
-
|
|
140400
|
-
|
|
140401
|
-
|
|
140402
|
-
|
|
140403
|
-
|
|
140404
|
-
|
|
140405
|
-
|
|
140406
|
-
|
|
140407
|
-
|
|
140408
|
-
|
|
140409
|
-
|
|
140410
|
-
|
|
140411
|
-
|
|
140412
|
-
|
|
140413
|
-
|
|
140414
|
-
|
|
140415
|
-
|
|
140416
|
-
|
|
140417
|
-
|
|
140418
|
-
|
|
140419
|
-
|
|
140420
|
-
|
|
140421
|
-
|
|
140422
|
-
|
|
140423
|
-
|
|
140424
|
-
|
|
140425
|
-
|
|
140426
|
-
|
|
140427
|
-
|
|
140428
|
-
|
|
140429
|
-
|
|
140430
|
-
|
|
140431
|
-
|
|
140432
|
-
|
|
140433
|
-
|
|
140434
|
-
|
|
140435
|
-
|
|
140436
|
-
|
|
140437
|
-
|
|
140438
|
-
|
|
140439
|
-
|
|
140440
|
-
|
|
140441
|
-
|
|
140442
|
-
|
|
140443
|
-
|
|
140444
|
-
|
|
140445
|
-
|
|
140446
|
-
|
|
140447
|
-
|
|
140448
|
-
|
|
140449
|
-
|
|
140450
|
-
|
|
140451
|
-
|
|
140452
|
-
|
|
140453
|
-
|
|
140454
|
-
|
|
140455
|
-
|
|
140456
|
-
|
|
140457
|
-
|
|
140458
|
-
|
|
140459
|
-
|
|
140460
|
-
|
|
140461
|
-
|
|
140462
|
-
|
|
140463
|
-
|
|
140464
|
-
|
|
140465
|
-
|
|
140466
|
-
|
|
140467
|
-
|
|
140468
|
-
|
|
140469
|
-
|
|
140470
|
-
|
|
140471
|
-
|
|
140472
|
-
|
|
140473
|
-
|
|
140474
|
-
|
|
140475
|
-
|
|
140476
|
-
|
|
140477
|
-
|
|
140478
|
-
|
|
140479
|
-
|
|
140480
|
-
|
|
140481
|
-
|
|
140482
|
-
|
|
140483
|
-
|
|
140484
|
-
|
|
140485
|
-
|
|
140486
|
-
|
|
140487
|
-
|
|
140488
|
-
|
|
140489
|
-
|
|
140490
|
-
|
|
140491
|
-
|
|
140492
|
-
|
|
140493
|
-
|
|
140494
|
-
|
|
140495
|
-
|
|
140496
|
-
|
|
140497
|
-
|
|
140498
|
-
|
|
140499
|
-
|
|
140500
|
-
|
|
140501
|
-
|
|
140502
|
-
|
|
140503
|
-
|
|
140504
|
-
|
|
140505
|
-
|
|
140506
|
-
|
|
140507
|
-
|
|
140508
|
-
|
|
140509
|
-
|
|
140510
|
-
|
|
140511
|
-
|
|
140512
|
-
|
|
140513
|
-
|
|
140514
|
-
|
|
140515
|
-
|
|
140516
|
-
|
|
140517
|
-
|
|
140518
|
-
|
|
140519
|
-
|
|
140520
|
-
|
|
140521
|
-
|
|
140522
|
-
|
|
140523
|
-
|
|
140524
|
-
|
|
140525
|
-
|
|
140526
|
-
|
|
140527
|
-
|
|
140528
|
-
|
|
140529
|
-
|
|
140530
|
-
|
|
140531
|
-
|
|
140532
|
-
|
|
140533
|
-
|
|
140534
|
-
|
|
140535
|
-
|
|
140536
|
-
|
|
140537
|
-
|
|
140538
|
-
|
|
140539
|
-
|
|
140540
|
-
|
|
140541
|
-
|
|
140542
|
-
|
|
140543
|
-
|
|
140544
|
-
|
|
140545
|
-
|
|
140546
|
-
|
|
140547
|
-
|
|
140548
|
-
|
|
140549
|
-
|
|
140550
|
-
|
|
140551
|
-
|
|
140552
|
-
|
|
140553
|
-
|
|
140554
|
-
|
|
140555
|
-
|
|
140556
|
-
|
|
140557
|
-
|
|
140558
|
-
|
|
140559
|
-
|
|
140560
|
-
|
|
140561
|
-
|
|
140562
|
-
|
|
140563
|
-
|
|
140564
|
-
|
|
140565
|
-
|
|
140566
|
-
|
|
140567
|
-
|
|
140568
|
-
|
|
140569
|
-
|
|
140570
|
-
|
|
140571
|
-
|
|
140572
|
-
|
|
140573
|
-
|
|
140574
|
-
|
|
140575
|
-
|
|
140576
|
-
|
|
140577
|
-
|
|
140578
|
-
|
|
140579
|
-
|
|
140580
|
-
|
|
140581
|
-
|
|
140582
|
-
|
|
140583
|
-
|
|
140584
|
-
|
|
140585
|
-
|
|
140586
|
-
|
|
140587
|
-
|
|
140588
|
-
|
|
140589
|
-
|
|
140590
|
-
|
|
140591
|
-
|
|
140592
|
-
|
|
140593
|
-
|
|
140594
|
-
|
|
140595
|
-
|
|
140596
|
-
|
|
140597
|
-
|
|
140598
|
-
|
|
140599
|
-
|
|
140600
|
-
|
|
140601
|
-
|
|
140602
|
-
|
|
140603
|
-
|
|
140604
|
-
|
|
140605
|
-
|
|
140606
|
-
}) || subtags;
|
|
140607
|
-
language = maxLanguageId[0];
|
|
140608
|
-
script = maxLanguageId[1];
|
|
140609
|
-
territory = maxLanguageId[2];
|
|
140610
|
-
minLanguageId = coreRemoveLikelySubtags(Cldr, this, maxLanguageId).join(sep); // Set attributes
|
|
140611
|
-
|
|
140612
|
-
this.attributes = attributes = {
|
|
140613
|
-
bundle: bundleLookup(Cldr, this, minLanguageId),
|
|
140614
|
-
// Unicode Language Id
|
|
140615
|
-
minLanguageId: minLanguageId + unicodeLocaleExtensionsRaw,
|
|
140616
|
-
maxLanguageId: maxLanguageId.join(sep) + unicodeLocaleExtensionsRaw,
|
|
140617
|
-
// Unicode Language Id Subtabs
|
|
140618
|
-
language: language,
|
|
140619
|
-
script: script,
|
|
140620
|
-
territory: territory,
|
|
140621
|
-
region: territory,
|
|
140622
|
-
|
|
140623
|
-
/* alias */
|
|
140624
|
-
variant: variant
|
|
140625
|
-
}; // Unicode locale extensions.
|
|
140626
|
-
|
|
140627
|
-
unicodeLocaleExtensions && ("-" + unicodeLocaleExtensions).replace(/-[a-z]{3,8}|(-[a-z]{2})-([a-z]{3,8})/g, function (attribute, key, type) {
|
|
140628
|
-
if (key) {
|
|
140629
|
-
// Extension is in the `keyword` form.
|
|
140630
|
-
attributes["u" + key] = type;
|
|
140631
|
-
} else {
|
|
140632
|
-
// Extension is in the `attribute` form.
|
|
140633
|
-
attributes["u" + attribute] = true;
|
|
140634
|
-
}
|
|
140635
|
-
});
|
|
140636
|
-
this.locale = locale;
|
|
140637
|
-
};
|
|
140638
|
-
/**
|
|
140639
|
-
* .get()
|
|
140640
|
-
*/
|
|
140641
|
-
|
|
140642
|
-
|
|
140643
|
-
Cldr.prototype.get = function (path) {
|
|
140644
|
-
validatePresence(path, "path");
|
|
140645
|
-
validateTypePath(path, "path");
|
|
140646
|
-
return itemGetResolved(Cldr, path, this.attributes);
|
|
140647
|
-
};
|
|
140648
|
-
/**
|
|
140649
|
-
* .main()
|
|
140650
|
-
*/
|
|
140651
|
-
|
|
140652
|
-
|
|
140653
|
-
Cldr.prototype.main = function (path) {
|
|
140654
|
-
validatePresence(path, "path");
|
|
140655
|
-
validateTypePath(path, "path");
|
|
140656
|
-
validate("E_MISSING_BUNDLE", this.attributes.bundle !== null, {
|
|
140657
|
-
locale: this.locale
|
|
140658
|
-
});
|
|
140659
|
-
path = alwaysArray(path);
|
|
140660
|
-
return this.get(["main/{bundle}"].concat(path));
|
|
140661
|
-
};
|
|
140662
|
-
|
|
140663
|
-
return Cldr;
|
|
140664
|
-
});
|
|
140665
|
-
}(cldr));
|
|
140666
|
-
|
|
140667
|
-
var event = {exports: {}};
|
|
140028
|
+
/*!
|
|
140029
|
+
* CLDR JavaScript Library v0.5.4 2020-10-22T15:56Z MIT license © Rafael Xavier
|
|
140030
|
+
* http://git.io/h4lmVg
|
|
140031
|
+
*/
|
|
140032
|
+
(function (root, factory) {
|
|
140033
|
+
{
|
|
140034
|
+
// Node. CommonJS.
|
|
140035
|
+
module.exports = factory();
|
|
140036
|
+
}
|
|
140037
|
+
})(commonjsGlobal, function () {
|
|
140038
|
+
var arrayIsArray = Array.isArray || function (obj) {
|
|
140039
|
+
return Object.prototype.toString.call(obj) === "[object Array]";
|
|
140040
|
+
};
|
|
140041
|
+
var pathNormalize = function (path, attributes) {
|
|
140042
|
+
if (arrayIsArray(path)) {
|
|
140043
|
+
path = path.join("/");
|
|
140044
|
+
}
|
|
140045
|
+
if (typeof path !== "string") {
|
|
140046
|
+
throw new Error("invalid path \"" + path + "\"");
|
|
140047
|
+
}
|
|
140048
|
+
// 1: Ignore leading slash `/`
|
|
140049
|
+
// 2: Ignore leading `cldr/`
|
|
140050
|
+
path = path.replace(/^\//, "") /* 1 */.replace(/^cldr\//, ""); /* 2 */
|
|
140051
|
+
|
|
140052
|
+
// Replace {attribute}'s
|
|
140053
|
+
path = path.replace(/{[a-zA-Z]+}/g, function (name) {
|
|
140054
|
+
name = name.replace(/^{([^}]*)}$/, "$1");
|
|
140055
|
+
return attributes[name];
|
|
140056
|
+
});
|
|
140057
|
+
return path.split("/");
|
|
140058
|
+
};
|
|
140059
|
+
var arraySome = function (array, callback) {
|
|
140060
|
+
var i, length;
|
|
140061
|
+
if (array.some) {
|
|
140062
|
+
return array.some(callback);
|
|
140063
|
+
}
|
|
140064
|
+
for (i = 0, length = array.length; i < length; i++) {
|
|
140065
|
+
if (callback(array[i], i, array)) {
|
|
140066
|
+
return true;
|
|
140067
|
+
}
|
|
140068
|
+
}
|
|
140069
|
+
return false;
|
|
140070
|
+
};
|
|
140071
|
+
|
|
140072
|
+
/**
|
|
140073
|
+
* Return the maximized language id as defined in
|
|
140074
|
+
* http://www.unicode.org/reports/tr35/#Likely_Subtags
|
|
140075
|
+
* 1. Canonicalize.
|
|
140076
|
+
* 1.1 Make sure the input locale is in canonical form: uses the right
|
|
140077
|
+
* separator, and has the right casing.
|
|
140078
|
+
* TODO Right casing? What df? It seems languages are lowercase, scripts are
|
|
140079
|
+
* Capitalized, territory is uppercase. I am leaving this as an exercise to
|
|
140080
|
+
* the user.
|
|
140081
|
+
*
|
|
140082
|
+
* 1.2 Replace any deprecated subtags with their canonical values using the
|
|
140083
|
+
* <alias> data in supplemental metadata. Use the first value in the
|
|
140084
|
+
* replacement list, if it exists. Language tag replacements may have multiple
|
|
140085
|
+
* parts, such as "sh" ➞ "sr_Latn" or mo" ➞ "ro_MD". In such a case, the
|
|
140086
|
+
* original script and/or region are retained if there is one. Thus
|
|
140087
|
+
* "sh_Arab_AQ" ➞ "sr_Arab_AQ", not "sr_Latn_AQ".
|
|
140088
|
+
* TODO What <alias> data?
|
|
140089
|
+
*
|
|
140090
|
+
* 1.3 If the tag is grandfathered (see <variable id="$grandfathered"
|
|
140091
|
+
* type="choice"> in the supplemental data), then return it.
|
|
140092
|
+
* TODO grandfathered?
|
|
140093
|
+
*
|
|
140094
|
+
* 1.4 Remove the script code 'Zzzz' and the region code 'ZZ' if they occur.
|
|
140095
|
+
* 1.5 Get the components of the cleaned-up source tag (languages, scripts,
|
|
140096
|
+
* and regions), plus any variants and extensions.
|
|
140097
|
+
* 2. Lookup. Lookup each of the following in order, and stop on the first
|
|
140098
|
+
* match:
|
|
140099
|
+
* 2.1 languages_scripts_regions
|
|
140100
|
+
* 2.2 languages_regions
|
|
140101
|
+
* 2.3 languages_scripts
|
|
140102
|
+
* 2.4 languages
|
|
140103
|
+
* 2.5 und_scripts
|
|
140104
|
+
* 3. Return
|
|
140105
|
+
* 3.1 If there is no match, either return an error value, or the match for
|
|
140106
|
+
* "und" (in APIs where a valid language tag is required).
|
|
140107
|
+
* 3.2 Otherwise there is a match = languagem_scriptm_regionm
|
|
140108
|
+
* 3.3 Let xr = xs if xs is not empty, and xm otherwise.
|
|
140109
|
+
* 3.4 Return the language tag composed of languager _ scriptr _ regionr +
|
|
140110
|
+
* variants + extensions.
|
|
140111
|
+
*
|
|
140112
|
+
* @subtags [Array] normalized language id subtags tuple (see init.js).
|
|
140113
|
+
*/
|
|
140114
|
+
var coreLikelySubtags = function (Cldr, cldr, subtags, options) {
|
|
140115
|
+
var match,
|
|
140116
|
+
matchFound,
|
|
140117
|
+
language = subtags[0],
|
|
140118
|
+
script = subtags[1],
|
|
140119
|
+
sep = Cldr.localeSep,
|
|
140120
|
+
territory = subtags[2],
|
|
140121
|
+
variants = subtags.slice(3, 4);
|
|
140122
|
+
options = options || {};
|
|
140123
|
+
|
|
140124
|
+
// Skip if (language, script, territory) is not empty [3.3]
|
|
140125
|
+
if (language !== "und" && script !== "Zzzz" && territory !== "ZZ") {
|
|
140126
|
+
return [language, script, territory].concat(variants);
|
|
140127
|
+
}
|
|
140128
|
+
|
|
140129
|
+
// Skip if no supplemental likelySubtags data is present
|
|
140130
|
+
if (typeof cldr.get("supplemental/likelySubtags") === "undefined") {
|
|
140131
|
+
return;
|
|
140132
|
+
}
|
|
140133
|
+
|
|
140134
|
+
// [2]
|
|
140135
|
+
matchFound = arraySome([[language, script, territory], [language, territory], [language, script], [language], ["und", script]], function (test) {
|
|
140136
|
+
return match = !/\b(Zzzz|ZZ)\b/.test(test.join(sep)) /* [1.4] */ && cldr.get(["supplemental/likelySubtags", test.join(sep)]);
|
|
140137
|
+
});
|
|
140138
|
+
|
|
140139
|
+
// [3]
|
|
140140
|
+
if (matchFound) {
|
|
140141
|
+
// [3.2 .. 3.4]
|
|
140142
|
+
match = match.split(sep);
|
|
140143
|
+
return [language !== "und" ? language : match[0], script !== "Zzzz" ? script : match[1], territory !== "ZZ" ? territory : match[2]].concat(variants);
|
|
140144
|
+
} else if (options.force) {
|
|
140145
|
+
// [3.1.2]
|
|
140146
|
+
return cldr.get("supplemental/likelySubtags/und").split(sep);
|
|
140147
|
+
} else {
|
|
140148
|
+
// [3.1.1]
|
|
140149
|
+
return;
|
|
140150
|
+
}
|
|
140151
|
+
};
|
|
140152
|
+
|
|
140153
|
+
/**
|
|
140154
|
+
* Given a locale, remove any fields that Add Likely Subtags would add.
|
|
140155
|
+
* http://www.unicode.org/reports/tr35/#Likely_Subtags
|
|
140156
|
+
* 1. First get max = AddLikelySubtags(inputLocale). If an error is signaled,
|
|
140157
|
+
* return it.
|
|
140158
|
+
* 2. Remove the variants from max.
|
|
140159
|
+
* 3. Then for trial in {language, language _ region, language _ script}. If
|
|
140160
|
+
* AddLikelySubtags(trial) = max, then return trial + variants.
|
|
140161
|
+
* 4. If you do not get a match, return max + variants.
|
|
140162
|
+
*
|
|
140163
|
+
* @maxLanguageId [Array] maxLanguageId tuple (see init.js).
|
|
140164
|
+
*/
|
|
140165
|
+
var coreRemoveLikelySubtags = function (Cldr, cldr, maxLanguageId) {
|
|
140166
|
+
var match,
|
|
140167
|
+
matchFound,
|
|
140168
|
+
language = maxLanguageId[0],
|
|
140169
|
+
script = maxLanguageId[1],
|
|
140170
|
+
territory = maxLanguageId[2],
|
|
140171
|
+
variants = maxLanguageId[3];
|
|
140172
|
+
|
|
140173
|
+
// [3]
|
|
140174
|
+
matchFound = arraySome([[[language, "Zzzz", "ZZ"], [language]], [[language, "Zzzz", territory], [language, territory]], [[language, script, "ZZ"], [language, script]]], function (test) {
|
|
140175
|
+
var result = coreLikelySubtags(Cldr, cldr, test[0]);
|
|
140176
|
+
match = test[1];
|
|
140177
|
+
return result && result[0] === maxLanguageId[0] && result[1] === maxLanguageId[1] && result[2] === maxLanguageId[2];
|
|
140178
|
+
});
|
|
140179
|
+
if (matchFound) {
|
|
140180
|
+
if (variants) {
|
|
140181
|
+
match.push(variants);
|
|
140182
|
+
}
|
|
140183
|
+
return match;
|
|
140184
|
+
}
|
|
140185
|
+
|
|
140186
|
+
// [4]
|
|
140187
|
+
return maxLanguageId;
|
|
140188
|
+
};
|
|
140189
|
+
|
|
140190
|
+
/**
|
|
140191
|
+
* subtags( locale )
|
|
140192
|
+
*
|
|
140193
|
+
* @locale [String]
|
|
140194
|
+
*/
|
|
140195
|
+
var coreSubtags = function (locale) {
|
|
140196
|
+
var aux,
|
|
140197
|
+
unicodeLanguageId,
|
|
140198
|
+
subtags = [];
|
|
140199
|
+
locale = locale.replace(/_/, "-");
|
|
140200
|
+
|
|
140201
|
+
// Unicode locale extensions.
|
|
140202
|
+
aux = locale.split("-u-");
|
|
140203
|
+
if (aux[1]) {
|
|
140204
|
+
aux[1] = aux[1].split("-t-");
|
|
140205
|
+
locale = aux[0] + (aux[1][1] ? "-t-" + aux[1][1] : "");
|
|
140206
|
+
subtags[4 /* unicodeLocaleExtensions */] = aux[1][0];
|
|
140207
|
+
}
|
|
140208
|
+
|
|
140209
|
+
// TODO normalize transformed extensions. Currently, skipped.
|
|
140210
|
+
// subtags[ x ] = locale.split( "-t-" )[ 1 ];
|
|
140211
|
+
unicodeLanguageId = locale.split("-t-")[0];
|
|
140212
|
+
|
|
140213
|
+
// unicode_language_id = "root"
|
|
140214
|
+
// | unicode_language_subtag
|
|
140215
|
+
// (sep unicode_script_subtag)?
|
|
140216
|
+
// (sep unicode_region_subtag)?
|
|
140217
|
+
// (sep unicode_variant_subtag)* ;
|
|
140218
|
+
//
|
|
140219
|
+
// Although unicode_language_subtag = alpha{2,8}, I'm using alpha{2,3}. Because, there's no language on CLDR lengthier than 3.
|
|
140220
|
+
aux = unicodeLanguageId.match(/^(([a-z]{2,3})(-([A-Z][a-z]{3}))?(-([A-Z]{2}|[0-9]{3}))?)((-([a-zA-Z0-9]{5,8}|[0-9][a-zA-Z0-9]{3}))*)$|^(root)$/);
|
|
140221
|
+
if (aux === null) {
|
|
140222
|
+
return ["und", "Zzzz", "ZZ"];
|
|
140223
|
+
}
|
|
140224
|
+
subtags[0 /* language */] = aux[10] /* root */ || aux[2] || "und";
|
|
140225
|
+
subtags[1 /* script */] = aux[4] || "Zzzz";
|
|
140226
|
+
subtags[2 /* territory */] = aux[6] || "ZZ";
|
|
140227
|
+
if (aux[7] && aux[7].length) {
|
|
140228
|
+
subtags[3 /* variant */] = aux[7].slice(1) /* remove leading "-" */;
|
|
140229
|
+
}
|
|
140230
|
+
|
|
140231
|
+
// 0: language
|
|
140232
|
+
// 1: script
|
|
140233
|
+
// 2: territory (aka region)
|
|
140234
|
+
// 3: variant
|
|
140235
|
+
// 4: unicodeLocaleExtensions
|
|
140236
|
+
return subtags;
|
|
140237
|
+
};
|
|
140238
|
+
var arrayForEach = function (array, callback) {
|
|
140239
|
+
var i, length;
|
|
140240
|
+
if (array.forEach) {
|
|
140241
|
+
return array.forEach(callback);
|
|
140242
|
+
}
|
|
140243
|
+
for (i = 0, length = array.length; i < length; i++) {
|
|
140244
|
+
callback(array[i], i, array);
|
|
140245
|
+
}
|
|
140246
|
+
};
|
|
140247
|
+
|
|
140248
|
+
/**
|
|
140249
|
+
* bundleLookup( minLanguageId )
|
|
140250
|
+
*
|
|
140251
|
+
* @Cldr [Cldr class]
|
|
140252
|
+
*
|
|
140253
|
+
* @cldr [Cldr instance]
|
|
140254
|
+
*
|
|
140255
|
+
* @minLanguageId [String] requested languageId after applied remove likely subtags.
|
|
140256
|
+
*/
|
|
140257
|
+
var bundleLookup = function (Cldr, cldr, minLanguageId) {
|
|
140258
|
+
var availableBundleMap = Cldr._availableBundleMap,
|
|
140259
|
+
availableBundleMapQueue = Cldr._availableBundleMapQueue;
|
|
140260
|
+
if (availableBundleMapQueue.length) {
|
|
140261
|
+
arrayForEach(availableBundleMapQueue, function (bundle, i) {
|
|
140262
|
+
var existing, maxBundle, minBundle, subtags;
|
|
140263
|
+
subtags = coreSubtags(bundle);
|
|
140264
|
+
maxBundle = coreLikelySubtags(Cldr, cldr, subtags);
|
|
140265
|
+
if (maxBundle === undefined) {
|
|
140266
|
+
availableBundleMapQueue.splice(i, 1);
|
|
140267
|
+
throw new Error("Could not find likelySubtags for " + bundle);
|
|
140268
|
+
}
|
|
140269
|
+
minBundle = coreRemoveLikelySubtags(Cldr, cldr, maxBundle);
|
|
140270
|
+
minBundle = minBundle.join(Cldr.localeSep);
|
|
140271
|
+
existing = availableBundleMap[minBundle];
|
|
140272
|
+
if (existing && existing.length < bundle.length) {
|
|
140273
|
+
return;
|
|
140274
|
+
}
|
|
140275
|
+
availableBundleMap[minBundle] = bundle;
|
|
140276
|
+
});
|
|
140277
|
+
Cldr._availableBundleMapQueue = [];
|
|
140278
|
+
}
|
|
140279
|
+
return availableBundleMap[minLanguageId] || null;
|
|
140280
|
+
};
|
|
140281
|
+
var objectKeys = function (object) {
|
|
140282
|
+
var i,
|
|
140283
|
+
result = [];
|
|
140284
|
+
if (Object.keys) {
|
|
140285
|
+
return Object.keys(object);
|
|
140286
|
+
}
|
|
140287
|
+
for (i in object) {
|
|
140288
|
+
result.push(i);
|
|
140289
|
+
}
|
|
140290
|
+
return result;
|
|
140291
|
+
};
|
|
140292
|
+
var createError = function (code, attributes) {
|
|
140293
|
+
var error, message;
|
|
140294
|
+
message = code + (attributes && JSON ? ": " + JSON.stringify(attributes) : "");
|
|
140295
|
+
error = new Error(message);
|
|
140296
|
+
error.code = code;
|
|
140297
|
+
|
|
140298
|
+
// extend( error, attributes );
|
|
140299
|
+
arrayForEach(objectKeys(attributes), function (attribute) {
|
|
140300
|
+
error[attribute] = attributes[attribute];
|
|
140301
|
+
});
|
|
140302
|
+
return error;
|
|
140303
|
+
};
|
|
140304
|
+
var validate = function (code, check, attributes) {
|
|
140305
|
+
if (!check) {
|
|
140306
|
+
throw createError(code, attributes);
|
|
140307
|
+
}
|
|
140308
|
+
};
|
|
140309
|
+
var validatePresence = function (value, name) {
|
|
140310
|
+
validate("E_MISSING_PARAMETER", typeof value !== "undefined", {
|
|
140311
|
+
name: name
|
|
140312
|
+
});
|
|
140313
|
+
};
|
|
140314
|
+
var validateType = function (value, name, check, expected) {
|
|
140315
|
+
validate("E_INVALID_PAR_TYPE", check, {
|
|
140316
|
+
expected: expected,
|
|
140317
|
+
name: name,
|
|
140318
|
+
value: value
|
|
140319
|
+
});
|
|
140320
|
+
};
|
|
140321
|
+
var validateTypePath = function (value, name) {
|
|
140322
|
+
validateType(value, name, typeof value === "string" || arrayIsArray(value), "String or Array");
|
|
140323
|
+
};
|
|
140324
|
+
|
|
140325
|
+
/**
|
|
140326
|
+
* Function inspired by jQuery Core, but reduced to our use case.
|
|
140327
|
+
*/
|
|
140328
|
+
var isPlainObject = function (obj) {
|
|
140329
|
+
return obj !== null && "" + obj === "[object Object]";
|
|
140330
|
+
};
|
|
140331
|
+
var validateTypePlainObject = function (value, name) {
|
|
140332
|
+
validateType(value, name, typeof value === "undefined" || isPlainObject(value), "Plain Object");
|
|
140333
|
+
};
|
|
140334
|
+
var validateTypeString = function (value, name) {
|
|
140335
|
+
validateType(value, name, typeof value === "string", "a string");
|
|
140336
|
+
};
|
|
140337
|
+
|
|
140338
|
+
// @path: normalized path
|
|
140339
|
+
var resourceGet = function (data, path) {
|
|
140340
|
+
var i,
|
|
140341
|
+
node = data,
|
|
140342
|
+
length = path.length;
|
|
140343
|
+
for (i = 0; i < length - 1; i++) {
|
|
140344
|
+
node = node[path[i]];
|
|
140345
|
+
if (!node) {
|
|
140346
|
+
return undefined;
|
|
140347
|
+
}
|
|
140348
|
+
}
|
|
140349
|
+
return node[path[i]];
|
|
140350
|
+
};
|
|
140351
|
+
|
|
140352
|
+
/**
|
|
140353
|
+
* setAvailableBundles( Cldr, json )
|
|
140354
|
+
*
|
|
140355
|
+
* @Cldr [Cldr class]
|
|
140356
|
+
*
|
|
140357
|
+
* @json resolved/unresolved cldr data.
|
|
140358
|
+
*
|
|
140359
|
+
* Set available bundles queue based on passed json CLDR data. Considers a bundle as any String at /main/{bundle}.
|
|
140360
|
+
*/
|
|
140361
|
+
var coreSetAvailableBundles = function (Cldr, json) {
|
|
140362
|
+
var bundle,
|
|
140363
|
+
availableBundleMapQueue = Cldr._availableBundleMapQueue,
|
|
140364
|
+
main = resourceGet(json, ["main"]);
|
|
140365
|
+
if (main) {
|
|
140366
|
+
for (bundle in main) {
|
|
140367
|
+
if (main.hasOwnProperty(bundle) && bundle !== "root" && availableBundleMapQueue.indexOf(bundle) === -1) {
|
|
140368
|
+
availableBundleMapQueue.push(bundle);
|
|
140369
|
+
}
|
|
140370
|
+
}
|
|
140371
|
+
}
|
|
140372
|
+
};
|
|
140373
|
+
var alwaysArray = function (somethingOrArray) {
|
|
140374
|
+
return arrayIsArray(somethingOrArray) ? somethingOrArray : [somethingOrArray];
|
|
140375
|
+
};
|
|
140376
|
+
var jsonMerge = function () {
|
|
140377
|
+
// Returns new deeply merged JSON.
|
|
140378
|
+
//
|
|
140379
|
+
// Eg.
|
|
140380
|
+
// merge( { a: { b: 1, c: 2 } }, { a: { b: 3, d: 4 } } )
|
|
140381
|
+
// -> { a: { b: 3, c: 2, d: 4 } }
|
|
140382
|
+
//
|
|
140383
|
+
// @arguments JSON's
|
|
140384
|
+
//
|
|
140385
|
+
var merge = function () {
|
|
140386
|
+
var destination = {},
|
|
140387
|
+
sources = [].slice.call(arguments, 0);
|
|
140388
|
+
arrayForEach(sources, function (source) {
|
|
140389
|
+
var prop;
|
|
140390
|
+
for (prop in source) {
|
|
140391
|
+
if (prop in destination && typeof destination[prop] === "object" && !arrayIsArray(destination[prop])) {
|
|
140392
|
+
// Merge Objects
|
|
140393
|
+
destination[prop] = merge(destination[prop], source[prop]);
|
|
140394
|
+
} else {
|
|
140395
|
+
// Set new values
|
|
140396
|
+
destination[prop] = source[prop];
|
|
140397
|
+
}
|
|
140398
|
+
}
|
|
140399
|
+
});
|
|
140400
|
+
return destination;
|
|
140401
|
+
};
|
|
140402
|
+
return merge;
|
|
140403
|
+
}();
|
|
140404
|
+
|
|
140405
|
+
/**
|
|
140406
|
+
* load( Cldr, source, jsons )
|
|
140407
|
+
*
|
|
140408
|
+
* @Cldr [Cldr class]
|
|
140409
|
+
*
|
|
140410
|
+
* @source [Object]
|
|
140411
|
+
*
|
|
140412
|
+
* @jsons [arguments]
|
|
140413
|
+
*/
|
|
140414
|
+
var coreLoad = function (Cldr, source, jsons) {
|
|
140415
|
+
var i, j, json;
|
|
140416
|
+
validatePresence(jsons[0], "json");
|
|
140417
|
+
|
|
140418
|
+
// Support arbitrary parameters, e.g., `Cldr.load({...}, {...})`.
|
|
140419
|
+
for (i = 0; i < jsons.length; i++) {
|
|
140420
|
+
// Support array parameters, e.g., `Cldr.load([{...}, {...}])`.
|
|
140421
|
+
json = alwaysArray(jsons[i]);
|
|
140422
|
+
for (j = 0; j < json.length; j++) {
|
|
140423
|
+
validateTypePlainObject(json[j], "json");
|
|
140424
|
+
source = jsonMerge(source, json[j]);
|
|
140425
|
+
coreSetAvailableBundles(Cldr, json[j]);
|
|
140426
|
+
}
|
|
140427
|
+
}
|
|
140428
|
+
return source;
|
|
140429
|
+
};
|
|
140430
|
+
var itemGetResolved = function (Cldr, path, attributes) {
|
|
140431
|
+
// Resolve path
|
|
140432
|
+
var normalizedPath = pathNormalize(path, attributes);
|
|
140433
|
+
return resourceGet(Cldr._resolved, normalizedPath);
|
|
140434
|
+
};
|
|
140435
|
+
|
|
140436
|
+
/**
|
|
140437
|
+
* new Cldr()
|
|
140438
|
+
*/
|
|
140439
|
+
var Cldr = function (locale) {
|
|
140440
|
+
this.init(locale);
|
|
140441
|
+
};
|
|
140442
|
+
|
|
140443
|
+
// Build optimization hack to avoid duplicating functions across modules.
|
|
140444
|
+
Cldr._alwaysArray = alwaysArray;
|
|
140445
|
+
Cldr._coreLoad = coreLoad;
|
|
140446
|
+
Cldr._createError = createError;
|
|
140447
|
+
Cldr._itemGetResolved = itemGetResolved;
|
|
140448
|
+
Cldr._jsonMerge = jsonMerge;
|
|
140449
|
+
Cldr._pathNormalize = pathNormalize;
|
|
140450
|
+
Cldr._resourceGet = resourceGet;
|
|
140451
|
+
Cldr._validatePresence = validatePresence;
|
|
140452
|
+
Cldr._validateType = validateType;
|
|
140453
|
+
Cldr._validateTypePath = validateTypePath;
|
|
140454
|
+
Cldr._validateTypePlainObject = validateTypePlainObject;
|
|
140455
|
+
Cldr._availableBundleMap = {};
|
|
140456
|
+
Cldr._availableBundleMapQueue = [];
|
|
140457
|
+
Cldr._resolved = {};
|
|
140458
|
+
|
|
140459
|
+
// Allow user to override locale separator "-" (default) | "_". According to http://www.unicode.org/reports/tr35/#Unicode_language_identifier, both "-" and "_" are valid locale separators (eg. "en_GB", "en-GB"). According to http://unicode.org/cldr/trac/ticket/6786 its usage must be consistent throughout the data set.
|
|
140460
|
+
Cldr.localeSep = "-";
|
|
140461
|
+
|
|
140462
|
+
/**
|
|
140463
|
+
* Cldr.load( json [, json, ...] )
|
|
140464
|
+
*
|
|
140465
|
+
* @json [JSON] CLDR data or [Array] Array of @json's.
|
|
140466
|
+
*
|
|
140467
|
+
* Load resolved cldr data.
|
|
140468
|
+
*/
|
|
140469
|
+
Cldr.load = function () {
|
|
140470
|
+
Cldr._resolved = coreLoad(Cldr, Cldr._resolved, arguments);
|
|
140471
|
+
};
|
|
140472
|
+
|
|
140473
|
+
/**
|
|
140474
|
+
* .init() automatically run on instantiation/construction.
|
|
140475
|
+
*/
|
|
140476
|
+
Cldr.prototype.init = function (locale) {
|
|
140477
|
+
var attributes,
|
|
140478
|
+
language,
|
|
140479
|
+
maxLanguageId,
|
|
140480
|
+
minLanguageId,
|
|
140481
|
+
script,
|
|
140482
|
+
subtags,
|
|
140483
|
+
territory,
|
|
140484
|
+
unicodeLocaleExtensions,
|
|
140485
|
+
variant,
|
|
140486
|
+
sep = Cldr.localeSep,
|
|
140487
|
+
unicodeLocaleExtensionsRaw = "";
|
|
140488
|
+
validatePresence(locale, "locale");
|
|
140489
|
+
validateTypeString(locale, "locale");
|
|
140490
|
+
subtags = coreSubtags(locale);
|
|
140491
|
+
if (subtags.length === 5) {
|
|
140492
|
+
unicodeLocaleExtensions = subtags.pop();
|
|
140493
|
+
unicodeLocaleExtensionsRaw = sep + "u" + sep + unicodeLocaleExtensions;
|
|
140494
|
+
// Remove trailing null when there is unicodeLocaleExtensions but no variants.
|
|
140495
|
+
if (!subtags[3]) {
|
|
140496
|
+
subtags.pop();
|
|
140497
|
+
}
|
|
140498
|
+
}
|
|
140499
|
+
variant = subtags[3];
|
|
140500
|
+
|
|
140501
|
+
// Normalize locale code.
|
|
140502
|
+
// Get (or deduce) the "triple subtags": language, territory (also aliased as region), and script subtags.
|
|
140503
|
+
// Get the variant subtags (calendar, collation, currency, etc).
|
|
140504
|
+
// refs:
|
|
140505
|
+
// - http://www.unicode.org/reports/tr35/#Field_Definitions
|
|
140506
|
+
// - http://www.unicode.org/reports/tr35/#Language_and_Locale_IDs
|
|
140507
|
+
// - http://www.unicode.org/reports/tr35/#Unicode_locale_identifier
|
|
140508
|
+
|
|
140509
|
+
// When a locale id does not specify a language, or territory (region), or script, they are obtained by Likely Subtags.
|
|
140510
|
+
maxLanguageId = coreLikelySubtags(Cldr, this, subtags, {
|
|
140511
|
+
force: true
|
|
140512
|
+
}) || subtags;
|
|
140513
|
+
language = maxLanguageId[0];
|
|
140514
|
+
script = maxLanguageId[1];
|
|
140515
|
+
territory = maxLanguageId[2];
|
|
140516
|
+
minLanguageId = coreRemoveLikelySubtags(Cldr, this, maxLanguageId).join(sep);
|
|
140517
|
+
|
|
140518
|
+
// Set attributes
|
|
140519
|
+
this.attributes = attributes = {
|
|
140520
|
+
bundle: bundleLookup(Cldr, this, minLanguageId),
|
|
140521
|
+
// Unicode Language Id
|
|
140522
|
+
minLanguageId: minLanguageId + unicodeLocaleExtensionsRaw,
|
|
140523
|
+
maxLanguageId: maxLanguageId.join(sep) + unicodeLocaleExtensionsRaw,
|
|
140524
|
+
// Unicode Language Id Subtabs
|
|
140525
|
+
language: language,
|
|
140526
|
+
script: script,
|
|
140527
|
+
territory: territory,
|
|
140528
|
+
region: territory,
|
|
140529
|
+
/* alias */
|
|
140530
|
+
variant: variant
|
|
140531
|
+
};
|
|
140532
|
+
|
|
140533
|
+
// Unicode locale extensions.
|
|
140534
|
+
unicodeLocaleExtensions && ("-" + unicodeLocaleExtensions).replace(/-[a-z]{3,8}|(-[a-z]{2})-([a-z]{3,8})/g, function (attribute, key, type) {
|
|
140535
|
+
if (key) {
|
|
140536
|
+
// Extension is in the `keyword` form.
|
|
140537
|
+
attributes["u" + key] = type;
|
|
140538
|
+
} else {
|
|
140539
|
+
// Extension is in the `attribute` form.
|
|
140540
|
+
attributes["u" + attribute] = true;
|
|
140541
|
+
}
|
|
140542
|
+
});
|
|
140543
|
+
this.locale = locale;
|
|
140544
|
+
};
|
|
140545
|
+
|
|
140546
|
+
/**
|
|
140547
|
+
* .get()
|
|
140548
|
+
*/
|
|
140549
|
+
Cldr.prototype.get = function (path) {
|
|
140550
|
+
validatePresence(path, "path");
|
|
140551
|
+
validateTypePath(path, "path");
|
|
140552
|
+
return itemGetResolved(Cldr, path, this.attributes);
|
|
140553
|
+
};
|
|
140554
|
+
|
|
140555
|
+
/**
|
|
140556
|
+
* .main()
|
|
140557
|
+
*/
|
|
140558
|
+
Cldr.prototype.main = function (path) {
|
|
140559
|
+
validatePresence(path, "path");
|
|
140560
|
+
validateTypePath(path, "path");
|
|
140561
|
+
validate("E_MISSING_BUNDLE", this.attributes.bundle !== null, {
|
|
140562
|
+
locale: this.locale
|
|
140563
|
+
});
|
|
140564
|
+
path = alwaysArray(path);
|
|
140565
|
+
return this.get(["main/{bundle}"].concat(path));
|
|
140566
|
+
};
|
|
140567
|
+
return Cldr;
|
|
140568
|
+
});
|
|
140569
|
+
} (cldr));
|
|
140570
|
+
|
|
140571
|
+
var eventExports = {};
|
|
140572
|
+
var event = {
|
|
140573
|
+
get exports(){ return eventExports; },
|
|
140574
|
+
set exports(v){ eventExports = v; },
|
|
140575
|
+
};
|
|
140668
140576
|
|
|
140669
140577
|
/**
|
|
140670
140578
|
* CLDR JavaScript Library v0.5.4
|
|
@@ -140678,580 +140586,529 @@ var event = {exports: {}};
|
|
|
140678
140586
|
*/
|
|
140679
140587
|
|
|
140680
140588
|
(function (module) {
|
|
140681
|
-
/*!
|
|
140682
|
-
|
|
140683
|
-
|
|
140684
|
-
|
|
140685
|
-
(function (factory) {
|
|
140686
|
-
|
|
140687
|
-
|
|
140688
|
-
|
|
140689
|
-
|
|
140690
|
-
})(function (Cldr) {
|
|
140691
|
-
|
|
140692
|
-
|
|
140693
|
-
|
|
140694
|
-
|
|
140695
|
-
|
|
140696
|
-
|
|
140697
|
-
|
|
140698
|
-
|
|
140699
|
-
|
|
140700
|
-
|
|
140701
|
-
|
|
140702
|
-
|
|
140703
|
-
|
|
140704
|
-
|
|
140705
|
-
|
|
140706
|
-
|
|
140707
|
-
|
|
140708
|
-
|
|
140709
|
-
|
|
140710
|
-
|
|
140711
|
-
|
|
140712
|
-
|
|
140713
|
-
|
|
140714
|
-
|
|
140715
|
-
|
|
140716
|
-
|
|
140717
|
-
|
|
140718
|
-
|
|
140719
|
-
|
|
140720
|
-
|
|
140721
|
-
|
|
140722
|
-
|
|
140723
|
-
|
|
140724
|
-
|
|
140725
|
-
|
|
140726
|
-
|
|
140727
|
-
|
|
140728
|
-
|
|
140729
|
-
|
|
140730
|
-
|
|
140731
|
-
|
|
140732
|
-
|
|
140733
|
-
|
|
140734
|
-
|
|
140735
|
-
|
|
140736
|
-
|
|
140737
|
-
|
|
140738
|
-
|
|
140739
|
-
|
|
140740
|
-
|
|
140741
|
-
|
|
140742
|
-
|
|
140743
|
-
|
|
140744
|
-
|
|
140745
|
-
|
|
140746
|
-
|
|
140747
|
-
|
|
140748
|
-
|
|
140749
|
-
|
|
140750
|
-
|
|
140751
|
-
|
|
140752
|
-
|
|
140753
|
-
|
|
140754
|
-
|
|
140755
|
-
|
|
140756
|
-
|
|
140757
|
-
|
|
140758
|
-
|
|
140759
|
-
|
|
140760
|
-
|
|
140761
|
-
|
|
140762
|
-
|
|
140763
|
-
|
|
140764
|
-
|
|
140765
|
-
|
|
140766
|
-
|
|
140767
|
-
|
|
140768
|
-
|
|
140769
|
-
|
|
140770
|
-
|
|
140771
|
-
|
|
140772
|
-
|
|
140773
|
-
|
|
140774
|
-
|
|
140775
|
-
|
|
140776
|
-
|
|
140777
|
-
|
|
140778
|
-
|
|
140779
|
-
|
|
140780
|
-
|
|
140781
|
-
|
|
140782
|
-
|
|
140783
|
-
|
|
140784
|
-
|
|
140785
|
-
|
|
140786
|
-
|
|
140787
|
-
|
|
140788
|
-
|
|
140789
|
-
|
|
140790
|
-
|
|
140791
|
-
|
|
140792
|
-
|
|
140793
|
-
|
|
140794
|
-
|
|
140795
|
-
|
|
140796
|
-
|
|
140797
|
-
|
|
140798
|
-
|
|
140799
|
-
|
|
140800
|
-
|
|
140801
|
-
|
|
140802
|
-
|
|
140803
|
-
|
|
140804
|
-
|
|
140805
|
-
|
|
140806
|
-
|
|
140807
|
-
|
|
140808
|
-
|
|
140809
|
-
|
|
140810
|
-
|
|
140811
|
-
|
|
140812
|
-
|
|
140813
|
-
|
|
140814
|
-
|
|
140815
|
-
|
|
140816
|
-
|
|
140817
|
-
|
|
140818
|
-
|
|
140819
|
-
|
|
140820
|
-
|
|
140821
|
-
|
|
140822
|
-
|
|
140823
|
-
|
|
140824
|
-
|
|
140825
|
-
|
|
140826
|
-
|
|
140827
|
-
|
|
140828
|
-
|
|
140829
|
-
|
|
140830
|
-
|
|
140831
|
-
|
|
140832
|
-
|
|
140833
|
-
|
|
140834
|
-
|
|
140835
|
-
|
|
140836
|
-
|
|
140837
|
-
|
|
140838
|
-
|
|
140839
|
-
|
|
140840
|
-
|
|
140841
|
-
|
|
140842
|
-
|
|
140843
|
-
|
|
140844
|
-
|
|
140845
|
-
|
|
140846
|
-
|
|
140847
|
-
|
|
140848
|
-
|
|
140849
|
-
|
|
140850
|
-
|
|
140851
|
-
|
|
140852
|
-
|
|
140853
|
-
|
|
140854
|
-
|
|
140855
|
-
|
|
140856
|
-
|
|
140857
|
-
|
|
140858
|
-
|
|
140859
|
-
|
|
140860
|
-
|
|
140861
|
-
|
|
140862
|
-
|
|
140863
|
-
|
|
140864
|
-
|
|
140865
|
-
|
|
140866
|
-
|
|
140867
|
-
|
|
140868
|
-
|
|
140869
|
-
|
|
140870
|
-
|
|
140871
|
-
|
|
140872
|
-
|
|
140873
|
-
|
|
140874
|
-
|
|
140875
|
-
|
|
140876
|
-
|
|
140877
|
-
|
|
140878
|
-
|
|
140879
|
-
|
|
140880
|
-
|
|
140881
|
-
|
|
140882
|
-
|
|
140883
|
-
|
|
140884
|
-
|
|
140885
|
-
|
|
140886
|
-
|
|
140887
|
-
|
|
140888
|
-
|
|
140889
|
-
|
|
140890
|
-
|
|
140891
|
-
|
|
140892
|
-
|
|
140893
|
-
|
|
140894
|
-
|
|
140895
|
-
|
|
140896
|
-
|
|
140897
|
-
|
|
140898
|
-
|
|
140899
|
-
|
|
140900
|
-
|
|
140901
|
-
|
|
140902
|
-
|
|
140903
|
-
|
|
140904
|
-
|
|
140905
|
-
|
|
140906
|
-
|
|
140907
|
-
|
|
140908
|
-
|
|
140909
|
-
|
|
140910
|
-
|
|
140911
|
-
|
|
140912
|
-
|
|
140913
|
-
|
|
140914
|
-
|
|
140915
|
-
|
|
140916
|
-
|
|
140917
|
-
|
|
140918
|
-
|
|
140919
|
-
|
|
140920
|
-
|
|
140921
|
-
|
|
140922
|
-
|
|
140923
|
-
|
|
140924
|
-
|
|
140925
|
-
|
|
140926
|
-
|
|
140927
|
-
|
|
140928
|
-
|
|
140929
|
-
|
|
140930
|
-
|
|
140931
|
-
|
|
140932
|
-
|
|
140933
|
-
|
|
140934
|
-
|
|
140935
|
-
|
|
140936
|
-
|
|
140937
|
-
|
|
140938
|
-
|
|
140939
|
-
|
|
140940
|
-
|
|
140941
|
-
|
|
140942
|
-
|
|
140943
|
-
|
|
140944
|
-
|
|
140945
|
-
|
|
140946
|
-
|
|
140947
|
-
|
|
140948
|
-
|
|
140949
|
-
|
|
140950
|
-
|
|
140951
|
-
|
|
140952
|
-
|
|
140953
|
-
|
|
140954
|
-
|
|
140955
|
-
|
|
140956
|
-
|
|
140957
|
-
|
|
140958
|
-
|
|
140959
|
-
|
|
140960
|
-
|
|
140961
|
-
|
|
140962
|
-
|
|
140963
|
-
|
|
140964
|
-
|
|
140965
|
-
|
|
140966
|
-
|
|
140967
|
-
|
|
140968
|
-
|
|
140969
|
-
|
|
140970
|
-
|
|
140971
|
-
|
|
140972
|
-
|
|
140973
|
-
|
|
140974
|
-
|
|
140975
|
-
|
|
140976
|
-
|
|
140977
|
-
|
|
140978
|
-
|
|
140979
|
-
|
|
140980
|
-
|
|
140981
|
-
|
|
140982
|
-
|
|
140983
|
-
|
|
140984
|
-
|
|
140985
|
-
|
|
140986
|
-
|
|
140987
|
-
|
|
140988
|
-
|
|
140989
|
-
|
|
140990
|
-
|
|
140991
|
-
|
|
140992
|
-
|
|
140993
|
-
|
|
140994
|
-
|
|
140995
|
-
|
|
140996
|
-
|
|
140997
|
-
|
|
140998
|
-
|
|
140999
|
-
|
|
141000
|
-
|
|
141001
|
-
|
|
141002
|
-
|
|
141003
|
-
|
|
141004
|
-
|
|
141005
|
-
|
|
141006
|
-
|
|
141007
|
-
|
|
141008
|
-
|
|
141009
|
-
|
|
141010
|
-
|
|
141011
|
-
|
|
141012
|
-
|
|
141013
|
-
|
|
141014
|
-
|
|
141015
|
-
|
|
141016
|
-
|
|
141017
|
-
|
|
141018
|
-
|
|
141019
|
-
|
|
141020
|
-
|
|
141021
|
-
|
|
141022
|
-
|
|
141023
|
-
|
|
141024
|
-
|
|
141025
|
-
|
|
141026
|
-
|
|
141027
|
-
|
|
141028
|
-
|
|
141029
|
-
|
|
141030
|
-
|
|
141031
|
-
|
|
141032
|
-
|
|
141033
|
-
|
|
141034
|
-
|
|
141035
|
-
|
|
141036
|
-
|
|
141037
|
-
|
|
141038
|
-
|
|
141039
|
-
|
|
141040
|
-
|
|
141041
|
-
|
|
141042
|
-
|
|
141043
|
-
|
|
141044
|
-
|
|
141045
|
-
|
|
141046
|
-
|
|
141047
|
-
|
|
141048
|
-
|
|
141049
|
-
|
|
141050
|
-
|
|
141051
|
-
|
|
141052
|
-
|
|
141053
|
-
|
|
141054
|
-
|
|
141055
|
-
|
|
141056
|
-
|
|
141057
|
-
|
|
141058
|
-
|
|
141059
|
-
|
|
141060
|
-
|
|
141061
|
-
|
|
141062
|
-
|
|
141063
|
-
|
|
141064
|
-
|
|
141065
|
-
|
|
141066
|
-
|
|
141067
|
-
|
|
141068
|
-
|
|
141069
|
-
|
|
141070
|
-
|
|
141071
|
-
|
|
141072
|
-
|
|
141073
|
-
|
|
141074
|
-
|
|
141075
|
-
|
|
141076
|
-
|
|
141077
|
-
|
|
141078
|
-
|
|
141079
|
-
|
|
141080
|
-
|
|
141081
|
-
|
|
141082
|
-
|
|
141083
|
-
|
|
141084
|
-
|
|
141085
|
-
|
|
141086
|
-
|
|
141087
|
-
|
|
141088
|
-
|
|
141089
|
-
|
|
141090
|
-
|
|
141091
|
-
|
|
141092
|
-
|
|
141093
|
-
|
|
141094
|
-
|
|
141095
|
-
|
|
141096
|
-
|
|
141097
|
-
|
|
141098
|
-
|
|
141099
|
-
|
|
141100
|
-
|
|
141101
|
-
|
|
141102
|
-
|
|
141103
|
-
|
|
141104
|
-
|
|
141105
|
-
|
|
141106
|
-
|
|
141107
|
-
|
|
141108
|
-
|
|
141109
|
-
|
|
141110
|
-
|
|
141111
|
-
|
|
141112
|
-
|
|
141113
|
-
|
|
141114
|
-
|
|
141115
|
-
|
|
141116
|
-
|
|
141117
|
-
|
|
141118
|
-
|
|
141119
|
-
|
|
141120
|
-
|
|
141121
|
-
|
|
141122
|
-
|
|
141123
|
-
|
|
141124
|
-
|
|
141125
|
-
|
|
141126
|
-
|
|
141127
|
-
|
|
141128
|
-
|
|
141129
|
-
|
|
141130
|
-
|
|
141131
|
-
|
|
141132
|
-
|
|
141133
|
-
|
|
141134
|
-
|
|
141135
|
-
|
|
141136
|
-
|
|
141137
|
-
|
|
141138
|
-
|
|
141139
|
-
|
|
141140
|
-
|
|
141141
|
-
|
|
141142
|
-
|
|
141143
|
-
|
|
141144
|
-
|
|
141145
|
-
|
|
141146
|
-
|
|
141147
|
-
|
|
141148
|
-
|
|
141149
|
-
|
|
141150
|
-
|
|
141151
|
-
|
|
141152
|
-
|
|
141153
|
-
|
|
141154
|
-
|
|
141155
|
-
|
|
141156
|
-
|
|
141157
|
-
|
|
141158
|
-
|
|
141159
|
-
|
|
141160
|
-
|
|
141161
|
-
|
|
141162
|
-
|
|
141163
|
-
|
|
141164
|
-
|
|
141165
|
-
|
|
141166
|
-
|
|
141167
|
-
|
|
141168
|
-
|
|
141169
|
-
|
|
141170
|
-
|
|
141171
|
-
|
|
141172
|
-
|
|
141173
|
-
|
|
141174
|
-
|
|
141175
|
-
|
|
141176
|
-
|
|
141177
|
-
|
|
141178
|
-
|
|
141179
|
-
|
|
141180
|
-
|
|
141181
|
-
|
|
141182
|
-
|
|
141183
|
-
|
|
141184
|
-
|
|
141185
|
-
|
|
141186
|
-
|
|
141187
|
-
|
|
141188
|
-
|
|
141189
|
-
|
|
141190
|
-
|
|
141191
|
-
|
|
141192
|
-
|
|
141193
|
-
|
|
141194
|
-
|
|
141195
|
-
|
|
141196
|
-
|
|
141197
|
-
|
|
141198
|
-
|
|
141199
|
-
|
|
141200
|
-
|
|
141201
|
-
|
|
141202
|
-
|
|
141203
|
-
|
|
141204
|
-
|
|
141205
|
-
function once(self) {
|
|
141206
|
-
return validateThenCall("once", self);
|
|
141207
|
-
}
|
|
141208
|
-
|
|
141209
|
-
Cldr.off = off(globalEe);
|
|
141210
|
-
Cldr.on = on(globalEe);
|
|
141211
|
-
Cldr.once = once(globalEe);
|
|
141212
|
-
/**
|
|
141213
|
-
* Overload Cldr.prototype.init().
|
|
141214
|
-
*/
|
|
141215
|
-
|
|
141216
|
-
superInit = Cldr.prototype.init;
|
|
141217
|
-
|
|
141218
|
-
Cldr.prototype.init = function () {
|
|
141219
|
-
var ee;
|
|
141220
|
-
this.ee = ee = new EventEmitter();
|
|
141221
|
-
this.off = off(ee);
|
|
141222
|
-
this.on = on(ee);
|
|
141223
|
-
this.once = once(ee);
|
|
141224
|
-
superInit.apply(this, arguments);
|
|
141225
|
-
};
|
|
141226
|
-
/**
|
|
141227
|
-
* getOverload is encapsulated, because of cldr/unresolved. If it's loaded
|
|
141228
|
-
* after cldr/event (and note it overwrites .get), it can trigger this
|
|
141229
|
-
* overload again.
|
|
141230
|
-
*/
|
|
141231
|
-
|
|
141232
|
-
|
|
141233
|
-
function getOverload() {
|
|
141234
|
-
/**
|
|
141235
|
-
* Overload Cldr.prototype.get().
|
|
141236
|
-
*/
|
|
141237
|
-
superGet = Cldr.prototype.get;
|
|
141238
|
-
|
|
141239
|
-
Cldr.prototype.get = function (path) {
|
|
141240
|
-
var value = superGet.apply(this, arguments);
|
|
141241
|
-
path = pathNormalize(path, this.attributes).join("/");
|
|
141242
|
-
globalEe.trigger("get", [path, value]);
|
|
141243
|
-
this.ee.trigger("get", [path, value]);
|
|
141244
|
-
return value;
|
|
141245
|
-
};
|
|
141246
|
-
}
|
|
141247
|
-
|
|
141248
|
-
Cldr._eventInit = getOverload;
|
|
141249
|
-
getOverload();
|
|
141250
|
-
return Cldr;
|
|
141251
|
-
});
|
|
141252
|
-
}(event));
|
|
141253
|
-
|
|
141254
|
-
var supplemental = {exports: {}};
|
|
140589
|
+
/*!
|
|
140590
|
+
* CLDR JavaScript Library v0.5.4 2020-10-22T15:56Z MIT license © Rafael Xavier
|
|
140591
|
+
* http://git.io/h4lmVg
|
|
140592
|
+
*/
|
|
140593
|
+
(function (factory) {
|
|
140594
|
+
{
|
|
140595
|
+
// Node. CommonJS.
|
|
140596
|
+
module.exports = factory(cldrExports);
|
|
140597
|
+
}
|
|
140598
|
+
})(function (Cldr) {
|
|
140599
|
+
// Build optimization hack to avoid duplicating functions across modules.
|
|
140600
|
+
var pathNormalize = Cldr._pathNormalize,
|
|
140601
|
+
validatePresence = Cldr._validatePresence,
|
|
140602
|
+
validateType = Cldr._validateType;
|
|
140603
|
+
|
|
140604
|
+
/*!
|
|
140605
|
+
* EventEmitter v4.2.7 - git.io/ee
|
|
140606
|
+
* Oliver Caldwell
|
|
140607
|
+
* MIT license
|
|
140608
|
+
* @preserve
|
|
140609
|
+
*/
|
|
140610
|
+
|
|
140611
|
+
var EventEmitter;
|
|
140612
|
+
/* jshint ignore:start */
|
|
140613
|
+
EventEmitter = function () {
|
|
140614
|
+
/**
|
|
140615
|
+
* Class for managing events.
|
|
140616
|
+
* Can be extended to provide event functionality in other classes.
|
|
140617
|
+
*
|
|
140618
|
+
* @class EventEmitter Manages event registering and emitting.
|
|
140619
|
+
*/
|
|
140620
|
+
function EventEmitter() {}
|
|
140621
|
+
|
|
140622
|
+
// Shortcuts to improve speed and size
|
|
140623
|
+
var proto = EventEmitter.prototype;
|
|
140624
|
+
|
|
140625
|
+
/**
|
|
140626
|
+
* Finds the index of the listener for the event in it's storage array.
|
|
140627
|
+
*
|
|
140628
|
+
* @param {Function[]} listeners Array of listeners to search through.
|
|
140629
|
+
* @param {Function} listener Method to look for.
|
|
140630
|
+
* @return {Number} Index of the specified listener, -1 if not found
|
|
140631
|
+
* @api private
|
|
140632
|
+
*/
|
|
140633
|
+
function indexOfListener(listeners, listener) {
|
|
140634
|
+
var i = listeners.length;
|
|
140635
|
+
while (i--) {
|
|
140636
|
+
if (listeners[i].listener === listener) {
|
|
140637
|
+
return i;
|
|
140638
|
+
}
|
|
140639
|
+
}
|
|
140640
|
+
return -1;
|
|
140641
|
+
}
|
|
140642
|
+
|
|
140643
|
+
/**
|
|
140644
|
+
* Alias a method while keeping the context correct, to allow for overwriting of target method.
|
|
140645
|
+
*
|
|
140646
|
+
* @param {String} name The name of the target method.
|
|
140647
|
+
* @return {Function} The aliased method
|
|
140648
|
+
* @api private
|
|
140649
|
+
*/
|
|
140650
|
+
function alias(name) {
|
|
140651
|
+
return function aliasClosure() {
|
|
140652
|
+
return this[name].apply(this, arguments);
|
|
140653
|
+
};
|
|
140654
|
+
}
|
|
140655
|
+
|
|
140656
|
+
/**
|
|
140657
|
+
* Returns the listener array for the specified event.
|
|
140658
|
+
* Will initialise the event object and listener arrays if required.
|
|
140659
|
+
* Will return an object if you use a regex search. The object contains keys for each matched event. So /ba[rz]/ might return an object containing bar and baz. But only if you have either defined them with defineEvent or added some listeners to them.
|
|
140660
|
+
* Each property in the object response is an array of listener functions.
|
|
140661
|
+
*
|
|
140662
|
+
* @param {String|RegExp} evt Name of the event to return the listeners from.
|
|
140663
|
+
* @return {Function[]|Object} All listener functions for the event.
|
|
140664
|
+
*/
|
|
140665
|
+
proto.getListeners = function getListeners(evt) {
|
|
140666
|
+
var events = this._getEvents();
|
|
140667
|
+
var response;
|
|
140668
|
+
var key;
|
|
140669
|
+
|
|
140670
|
+
// Return a concatenated array of all matching events if
|
|
140671
|
+
// the selector is a regular expression.
|
|
140672
|
+
if (evt instanceof RegExp) {
|
|
140673
|
+
response = {};
|
|
140674
|
+
for (key in events) {
|
|
140675
|
+
if (events.hasOwnProperty(key) && evt.test(key)) {
|
|
140676
|
+
response[key] = events[key];
|
|
140677
|
+
}
|
|
140678
|
+
}
|
|
140679
|
+
} else {
|
|
140680
|
+
response = events[evt] || (events[evt] = []);
|
|
140681
|
+
}
|
|
140682
|
+
return response;
|
|
140683
|
+
};
|
|
140684
|
+
|
|
140685
|
+
/**
|
|
140686
|
+
* Takes a list of listener objects and flattens it into a list of listener functions.
|
|
140687
|
+
*
|
|
140688
|
+
* @param {Object[]} listeners Raw listener objects.
|
|
140689
|
+
* @return {Function[]} Just the listener functions.
|
|
140690
|
+
*/
|
|
140691
|
+
proto.flattenListeners = function flattenListeners(listeners) {
|
|
140692
|
+
var flatListeners = [];
|
|
140693
|
+
var i;
|
|
140694
|
+
for (i = 0; i < listeners.length; i += 1) {
|
|
140695
|
+
flatListeners.push(listeners[i].listener);
|
|
140696
|
+
}
|
|
140697
|
+
return flatListeners;
|
|
140698
|
+
};
|
|
140699
|
+
|
|
140700
|
+
/**
|
|
140701
|
+
* Fetches the requested listeners via getListeners but will always return the results inside an object. This is mainly for internal use but others may find it useful.
|
|
140702
|
+
*
|
|
140703
|
+
* @param {String|RegExp} evt Name of the event to return the listeners from.
|
|
140704
|
+
* @return {Object} All listener functions for an event in an object.
|
|
140705
|
+
*/
|
|
140706
|
+
proto.getListenersAsObject = function getListenersAsObject(evt) {
|
|
140707
|
+
var listeners = this.getListeners(evt);
|
|
140708
|
+
var response;
|
|
140709
|
+
if (listeners instanceof Array) {
|
|
140710
|
+
response = {};
|
|
140711
|
+
response[evt] = listeners;
|
|
140712
|
+
}
|
|
140713
|
+
return response || listeners;
|
|
140714
|
+
};
|
|
140715
|
+
|
|
140716
|
+
/**
|
|
140717
|
+
* Adds a listener function to the specified event.
|
|
140718
|
+
* The listener will not be added if it is a duplicate.
|
|
140719
|
+
* If the listener returns true then it will be removed after it is called.
|
|
140720
|
+
* If you pass a regular expression as the event name then the listener will be added to all events that match it.
|
|
140721
|
+
*
|
|
140722
|
+
* @param {String|RegExp} evt Name of the event to attach the listener to.
|
|
140723
|
+
* @param {Function} listener Method to be called when the event is emitted. If the function returns true then it will be removed after calling.
|
|
140724
|
+
* @return {Object} Current instance of EventEmitter for chaining.
|
|
140725
|
+
*/
|
|
140726
|
+
proto.addListener = function addListener(evt, listener) {
|
|
140727
|
+
var listeners = this.getListenersAsObject(evt);
|
|
140728
|
+
var listenerIsWrapped = typeof listener === 'object';
|
|
140729
|
+
var key;
|
|
140730
|
+
for (key in listeners) {
|
|
140731
|
+
if (listeners.hasOwnProperty(key) && indexOfListener(listeners[key], listener) === -1) {
|
|
140732
|
+
listeners[key].push(listenerIsWrapped ? listener : {
|
|
140733
|
+
listener: listener,
|
|
140734
|
+
once: false
|
|
140735
|
+
});
|
|
140736
|
+
}
|
|
140737
|
+
}
|
|
140738
|
+
return this;
|
|
140739
|
+
};
|
|
140740
|
+
|
|
140741
|
+
/**
|
|
140742
|
+
* Alias of addListener
|
|
140743
|
+
*/
|
|
140744
|
+
proto.on = alias('addListener');
|
|
140745
|
+
|
|
140746
|
+
/**
|
|
140747
|
+
* Semi-alias of addListener. It will add a listener that will be
|
|
140748
|
+
* automatically removed after it's first execution.
|
|
140749
|
+
*
|
|
140750
|
+
* @param {String|RegExp} evt Name of the event to attach the listener to.
|
|
140751
|
+
* @param {Function} listener Method to be called when the event is emitted. If the function returns true then it will be removed after calling.
|
|
140752
|
+
* @return {Object} Current instance of EventEmitter for chaining.
|
|
140753
|
+
*/
|
|
140754
|
+
proto.addOnceListener = function addOnceListener(evt, listener) {
|
|
140755
|
+
return this.addListener(evt, {
|
|
140756
|
+
listener: listener,
|
|
140757
|
+
once: true
|
|
140758
|
+
});
|
|
140759
|
+
};
|
|
140760
|
+
|
|
140761
|
+
/**
|
|
140762
|
+
* Alias of addOnceListener.
|
|
140763
|
+
*/
|
|
140764
|
+
proto.once = alias('addOnceListener');
|
|
140765
|
+
|
|
140766
|
+
/**
|
|
140767
|
+
* Defines an event name. This is required if you want to use a regex to add a listener to multiple events at once. If you don't do this then how do you expect it to know what event to add to? Should it just add to every possible match for a regex? No. That is scary and bad.
|
|
140768
|
+
* You need to tell it what event names should be matched by a regex.
|
|
140769
|
+
*
|
|
140770
|
+
* @param {String} evt Name of the event to create.
|
|
140771
|
+
* @return {Object} Current instance of EventEmitter for chaining.
|
|
140772
|
+
*/
|
|
140773
|
+
proto.defineEvent = function defineEvent(evt) {
|
|
140774
|
+
this.getListeners(evt);
|
|
140775
|
+
return this;
|
|
140776
|
+
};
|
|
140777
|
+
|
|
140778
|
+
/**
|
|
140779
|
+
* Uses defineEvent to define multiple events.
|
|
140780
|
+
*
|
|
140781
|
+
* @param {String[]} evts An array of event names to define.
|
|
140782
|
+
* @return {Object} Current instance of EventEmitter for chaining.
|
|
140783
|
+
*/
|
|
140784
|
+
proto.defineEvents = function defineEvents(evts) {
|
|
140785
|
+
for (var i = 0; i < evts.length; i += 1) {
|
|
140786
|
+
this.defineEvent(evts[i]);
|
|
140787
|
+
}
|
|
140788
|
+
return this;
|
|
140789
|
+
};
|
|
140790
|
+
|
|
140791
|
+
/**
|
|
140792
|
+
* Removes a listener function from the specified event.
|
|
140793
|
+
* When passed a regular expression as the event name, it will remove the listener from all events that match it.
|
|
140794
|
+
*
|
|
140795
|
+
* @param {String|RegExp} evt Name of the event to remove the listener from.
|
|
140796
|
+
* @param {Function} listener Method to remove from the event.
|
|
140797
|
+
* @return {Object} Current instance of EventEmitter for chaining.
|
|
140798
|
+
*/
|
|
140799
|
+
proto.removeListener = function removeListener(evt, listener) {
|
|
140800
|
+
var listeners = this.getListenersAsObject(evt);
|
|
140801
|
+
var index;
|
|
140802
|
+
var key;
|
|
140803
|
+
for (key in listeners) {
|
|
140804
|
+
if (listeners.hasOwnProperty(key)) {
|
|
140805
|
+
index = indexOfListener(listeners[key], listener);
|
|
140806
|
+
if (index !== -1) {
|
|
140807
|
+
listeners[key].splice(index, 1);
|
|
140808
|
+
}
|
|
140809
|
+
}
|
|
140810
|
+
}
|
|
140811
|
+
return this;
|
|
140812
|
+
};
|
|
140813
|
+
|
|
140814
|
+
/**
|
|
140815
|
+
* Alias of removeListener
|
|
140816
|
+
*/
|
|
140817
|
+
proto.off = alias('removeListener');
|
|
140818
|
+
|
|
140819
|
+
/**
|
|
140820
|
+
* Adds listeners in bulk using the manipulateListeners method.
|
|
140821
|
+
* If you pass an object as the second argument you can add to multiple events at once. The object should contain key value pairs of events and listeners or listener arrays. You can also pass it an event name and an array of listeners to be added.
|
|
140822
|
+
* You can also pass it a regular expression to add the array of listeners to all events that match it.
|
|
140823
|
+
* Yeah, this function does quite a bit. That's probably a bad thing.
|
|
140824
|
+
*
|
|
140825
|
+
* @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to add to multiple events at once.
|
|
140826
|
+
* @param {Function[]} [listeners] An optional array of listener functions to add.
|
|
140827
|
+
* @return {Object} Current instance of EventEmitter for chaining.
|
|
140828
|
+
*/
|
|
140829
|
+
proto.addListeners = function addListeners(evt, listeners) {
|
|
140830
|
+
// Pass through to manipulateListeners
|
|
140831
|
+
return this.manipulateListeners(false, evt, listeners);
|
|
140832
|
+
};
|
|
140833
|
+
|
|
140834
|
+
/**
|
|
140835
|
+
* Removes listeners in bulk using the manipulateListeners method.
|
|
140836
|
+
* If you pass an object as the second argument you can remove from multiple events at once. The object should contain key value pairs of events and listeners or listener arrays.
|
|
140837
|
+
* You can also pass it an event name and an array of listeners to be removed.
|
|
140838
|
+
* You can also pass it a regular expression to remove the listeners from all events that match it.
|
|
140839
|
+
*
|
|
140840
|
+
* @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to remove from multiple events at once.
|
|
140841
|
+
* @param {Function[]} [listeners] An optional array of listener functions to remove.
|
|
140842
|
+
* @return {Object} Current instance of EventEmitter for chaining.
|
|
140843
|
+
*/
|
|
140844
|
+
proto.removeListeners = function removeListeners(evt, listeners) {
|
|
140845
|
+
// Pass through to manipulateListeners
|
|
140846
|
+
return this.manipulateListeners(true, evt, listeners);
|
|
140847
|
+
};
|
|
140848
|
+
|
|
140849
|
+
/**
|
|
140850
|
+
* Edits listeners in bulk. The addListeners and removeListeners methods both use this to do their job. You should really use those instead, this is a little lower level.
|
|
140851
|
+
* The first argument will determine if the listeners are removed (true) or added (false).
|
|
140852
|
+
* If you pass an object as the second argument you can add/remove from multiple events at once. The object should contain key value pairs of events and listeners or listener arrays.
|
|
140853
|
+
* You can also pass it an event name and an array of listeners to be added/removed.
|
|
140854
|
+
* You can also pass it a regular expression to manipulate the listeners of all events that match it.
|
|
140855
|
+
*
|
|
140856
|
+
* @param {Boolean} remove True if you want to remove listeners, false if you want to add.
|
|
140857
|
+
* @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to add/remove from multiple events at once.
|
|
140858
|
+
* @param {Function[]} [listeners] An optional array of listener functions to add/remove.
|
|
140859
|
+
* @return {Object} Current instance of EventEmitter for chaining.
|
|
140860
|
+
*/
|
|
140861
|
+
proto.manipulateListeners = function manipulateListeners(remove, evt, listeners) {
|
|
140862
|
+
var i;
|
|
140863
|
+
var value;
|
|
140864
|
+
var single = remove ? this.removeListener : this.addListener;
|
|
140865
|
+
var multiple = remove ? this.removeListeners : this.addListeners;
|
|
140866
|
+
|
|
140867
|
+
// If evt is an object then pass each of it's properties to this method
|
|
140868
|
+
if (typeof evt === 'object' && !(evt instanceof RegExp)) {
|
|
140869
|
+
for (i in evt) {
|
|
140870
|
+
if (evt.hasOwnProperty(i) && (value = evt[i])) {
|
|
140871
|
+
// Pass the single listener straight through to the singular method
|
|
140872
|
+
if (typeof value === 'function') {
|
|
140873
|
+
single.call(this, i, value);
|
|
140874
|
+
} else {
|
|
140875
|
+
// Otherwise pass back to the multiple function
|
|
140876
|
+
multiple.call(this, i, value);
|
|
140877
|
+
}
|
|
140878
|
+
}
|
|
140879
|
+
}
|
|
140880
|
+
} else {
|
|
140881
|
+
// So evt must be a string
|
|
140882
|
+
// And listeners must be an array of listeners
|
|
140883
|
+
// Loop over it and pass each one to the multiple method
|
|
140884
|
+
i = listeners.length;
|
|
140885
|
+
while (i--) {
|
|
140886
|
+
single.call(this, evt, listeners[i]);
|
|
140887
|
+
}
|
|
140888
|
+
}
|
|
140889
|
+
return this;
|
|
140890
|
+
};
|
|
140891
|
+
|
|
140892
|
+
/**
|
|
140893
|
+
* Removes all listeners from a specified event.
|
|
140894
|
+
* If you do not specify an event then all listeners will be removed.
|
|
140895
|
+
* That means every event will be emptied.
|
|
140896
|
+
* You can also pass a regex to remove all events that match it.
|
|
140897
|
+
*
|
|
140898
|
+
* @param {String|RegExp} [evt] Optional name of the event to remove all listeners for. Will remove from every event if not passed.
|
|
140899
|
+
* @return {Object} Current instance of EventEmitter for chaining.
|
|
140900
|
+
*/
|
|
140901
|
+
proto.removeEvent = function removeEvent(evt) {
|
|
140902
|
+
var type = typeof evt;
|
|
140903
|
+
var events = this._getEvents();
|
|
140904
|
+
var key;
|
|
140905
|
+
|
|
140906
|
+
// Remove different things depending on the state of evt
|
|
140907
|
+
if (type === 'string') {
|
|
140908
|
+
// Remove all listeners for the specified event
|
|
140909
|
+
delete events[evt];
|
|
140910
|
+
} else if (evt instanceof RegExp) {
|
|
140911
|
+
// Remove all events matching the regex.
|
|
140912
|
+
for (key in events) {
|
|
140913
|
+
if (events.hasOwnProperty(key) && evt.test(key)) {
|
|
140914
|
+
delete events[key];
|
|
140915
|
+
}
|
|
140916
|
+
}
|
|
140917
|
+
} else {
|
|
140918
|
+
// Remove all listeners in all events
|
|
140919
|
+
delete this._events;
|
|
140920
|
+
}
|
|
140921
|
+
return this;
|
|
140922
|
+
};
|
|
140923
|
+
|
|
140924
|
+
/**
|
|
140925
|
+
* Alias of removeEvent.
|
|
140926
|
+
*
|
|
140927
|
+
* Added to mirror the node API.
|
|
140928
|
+
*/
|
|
140929
|
+
proto.removeAllListeners = alias('removeEvent');
|
|
140930
|
+
|
|
140931
|
+
/**
|
|
140932
|
+
* Emits an event of your choice.
|
|
140933
|
+
* When emitted, every listener attached to that event will be executed.
|
|
140934
|
+
* If you pass the optional argument array then those arguments will be passed to every listener upon execution.
|
|
140935
|
+
* Because it uses `apply`, your array of arguments will be passed as if you wrote them out separately.
|
|
140936
|
+
* So they will not arrive within the array on the other side, they will be separate.
|
|
140937
|
+
* You can also pass a regular expression to emit to all events that match it.
|
|
140938
|
+
*
|
|
140939
|
+
* @param {String|RegExp} evt Name of the event to emit and execute listeners for.
|
|
140940
|
+
* @param {Array} [args] Optional array of arguments to be passed to each listener.
|
|
140941
|
+
* @return {Object} Current instance of EventEmitter for chaining.
|
|
140942
|
+
*/
|
|
140943
|
+
proto.emitEvent = function emitEvent(evt, args) {
|
|
140944
|
+
var listeners = this.getListenersAsObject(evt);
|
|
140945
|
+
var listener;
|
|
140946
|
+
var i;
|
|
140947
|
+
var key;
|
|
140948
|
+
var response;
|
|
140949
|
+
for (key in listeners) {
|
|
140950
|
+
if (listeners.hasOwnProperty(key)) {
|
|
140951
|
+
i = listeners[key].length;
|
|
140952
|
+
while (i--) {
|
|
140953
|
+
// If the listener returns true then it shall be removed from the event
|
|
140954
|
+
// The function is executed either with a basic call or an apply if there is an args array
|
|
140955
|
+
listener = listeners[key][i];
|
|
140956
|
+
if (listener.once === true) {
|
|
140957
|
+
this.removeListener(evt, listener.listener);
|
|
140958
|
+
}
|
|
140959
|
+
response = listener.listener.apply(this, args || []);
|
|
140960
|
+
if (response === this._getOnceReturnValue()) {
|
|
140961
|
+
this.removeListener(evt, listener.listener);
|
|
140962
|
+
}
|
|
140963
|
+
}
|
|
140964
|
+
}
|
|
140965
|
+
}
|
|
140966
|
+
return this;
|
|
140967
|
+
};
|
|
140968
|
+
|
|
140969
|
+
/**
|
|
140970
|
+
* Alias of emitEvent
|
|
140971
|
+
*/
|
|
140972
|
+
proto.trigger = alias('emitEvent');
|
|
140973
|
+
|
|
140974
|
+
/**
|
|
140975
|
+
* Subtly different from emitEvent in that it will pass its arguments on to the listeners, as opposed to taking a single array of arguments to pass on.
|
|
140976
|
+
* As with emitEvent, you can pass a regex in place of the event name to emit to all events that match it.
|
|
140977
|
+
*
|
|
140978
|
+
* @param {String|RegExp} evt Name of the event to emit and execute listeners for.
|
|
140979
|
+
* @param {...*} Optional additional arguments to be passed to each listener.
|
|
140980
|
+
* @return {Object} Current instance of EventEmitter for chaining.
|
|
140981
|
+
*/
|
|
140982
|
+
proto.emit = function emit(evt) {
|
|
140983
|
+
var args = Array.prototype.slice.call(arguments, 1);
|
|
140984
|
+
return this.emitEvent(evt, args);
|
|
140985
|
+
};
|
|
140986
|
+
|
|
140987
|
+
/**
|
|
140988
|
+
* Sets the current value to check against when executing listeners. If a
|
|
140989
|
+
* listeners return value matches the one set here then it will be removed
|
|
140990
|
+
* after execution. This value defaults to true.
|
|
140991
|
+
*
|
|
140992
|
+
* @param {*} value The new value to check for when executing listeners.
|
|
140993
|
+
* @return {Object} Current instance of EventEmitter for chaining.
|
|
140994
|
+
*/
|
|
140995
|
+
proto.setOnceReturnValue = function setOnceReturnValue(value) {
|
|
140996
|
+
this._onceReturnValue = value;
|
|
140997
|
+
return this;
|
|
140998
|
+
};
|
|
140999
|
+
|
|
141000
|
+
/**
|
|
141001
|
+
* Fetches the current value to check against when executing listeners. If
|
|
141002
|
+
* the listeners return value matches this one then it should be removed
|
|
141003
|
+
* automatically. It will return true by default.
|
|
141004
|
+
*
|
|
141005
|
+
* @return {*|Boolean} The current value to check for or the default, true.
|
|
141006
|
+
* @api private
|
|
141007
|
+
*/
|
|
141008
|
+
proto._getOnceReturnValue = function _getOnceReturnValue() {
|
|
141009
|
+
if (this.hasOwnProperty('_onceReturnValue')) {
|
|
141010
|
+
return this._onceReturnValue;
|
|
141011
|
+
} else {
|
|
141012
|
+
return true;
|
|
141013
|
+
}
|
|
141014
|
+
};
|
|
141015
|
+
|
|
141016
|
+
/**
|
|
141017
|
+
* Fetches the events object and creates one if required.
|
|
141018
|
+
*
|
|
141019
|
+
* @return {Object} The events storage object.
|
|
141020
|
+
* @api private
|
|
141021
|
+
*/
|
|
141022
|
+
proto._getEvents = function _getEvents() {
|
|
141023
|
+
return this._events || (this._events = {});
|
|
141024
|
+
};
|
|
141025
|
+
|
|
141026
|
+
/**
|
|
141027
|
+
* Reverts the global {@link EventEmitter} to its previous value and returns a reference to this version.
|
|
141028
|
+
*
|
|
141029
|
+
* @return {Function} Non conflicting EventEmitter class.
|
|
141030
|
+
*/
|
|
141031
|
+
EventEmitter.noConflict = function noConflict() {
|
|
141032
|
+
originalGlobalValue;
|
|
141033
|
+
return EventEmitter;
|
|
141034
|
+
};
|
|
141035
|
+
return EventEmitter;
|
|
141036
|
+
}();
|
|
141037
|
+
/* jshint ignore:end */
|
|
141038
|
+
|
|
141039
|
+
var validateTypeFunction = function (value, name) {
|
|
141040
|
+
validateType(value, name, typeof value === "undefined" || typeof value === "function", "Function");
|
|
141041
|
+
};
|
|
141042
|
+
var superGet,
|
|
141043
|
+
superInit,
|
|
141044
|
+
globalEe = new EventEmitter();
|
|
141045
|
+
function validateTypeEvent(value, name) {
|
|
141046
|
+
validateType(value, name, typeof value === "string" || value instanceof RegExp, "String or RegExp");
|
|
141047
|
+
}
|
|
141048
|
+
function validateThenCall(method, self) {
|
|
141049
|
+
return function (event, listener) {
|
|
141050
|
+
validatePresence(event, "event");
|
|
141051
|
+
validateTypeEvent(event, "event");
|
|
141052
|
+
validatePresence(listener, "listener");
|
|
141053
|
+
validateTypeFunction(listener, "listener");
|
|
141054
|
+
return self[method].apply(self, arguments);
|
|
141055
|
+
};
|
|
141056
|
+
}
|
|
141057
|
+
function off(self) {
|
|
141058
|
+
return validateThenCall("off", self);
|
|
141059
|
+
}
|
|
141060
|
+
function on(self) {
|
|
141061
|
+
return validateThenCall("on", self);
|
|
141062
|
+
}
|
|
141063
|
+
function once(self) {
|
|
141064
|
+
return validateThenCall("once", self);
|
|
141065
|
+
}
|
|
141066
|
+
Cldr.off = off(globalEe);
|
|
141067
|
+
Cldr.on = on(globalEe);
|
|
141068
|
+
Cldr.once = once(globalEe);
|
|
141069
|
+
|
|
141070
|
+
/**
|
|
141071
|
+
* Overload Cldr.prototype.init().
|
|
141072
|
+
*/
|
|
141073
|
+
superInit = Cldr.prototype.init;
|
|
141074
|
+
Cldr.prototype.init = function () {
|
|
141075
|
+
var ee;
|
|
141076
|
+
this.ee = ee = new EventEmitter();
|
|
141077
|
+
this.off = off(ee);
|
|
141078
|
+
this.on = on(ee);
|
|
141079
|
+
this.once = once(ee);
|
|
141080
|
+
superInit.apply(this, arguments);
|
|
141081
|
+
};
|
|
141082
|
+
|
|
141083
|
+
/**
|
|
141084
|
+
* getOverload is encapsulated, because of cldr/unresolved. If it's loaded
|
|
141085
|
+
* after cldr/event (and note it overwrites .get), it can trigger this
|
|
141086
|
+
* overload again.
|
|
141087
|
+
*/
|
|
141088
|
+
function getOverload() {
|
|
141089
|
+
/**
|
|
141090
|
+
* Overload Cldr.prototype.get().
|
|
141091
|
+
*/
|
|
141092
|
+
superGet = Cldr.prototype.get;
|
|
141093
|
+
Cldr.prototype.get = function (path) {
|
|
141094
|
+
var value = superGet.apply(this, arguments);
|
|
141095
|
+
path = pathNormalize(path, this.attributes).join("/");
|
|
141096
|
+
globalEe.trigger("get", [path, value]);
|
|
141097
|
+
this.ee.trigger("get", [path, value]);
|
|
141098
|
+
return value;
|
|
141099
|
+
};
|
|
141100
|
+
}
|
|
141101
|
+
Cldr._eventInit = getOverload;
|
|
141102
|
+
getOverload();
|
|
141103
|
+
return Cldr;
|
|
141104
|
+
});
|
|
141105
|
+
} (event));
|
|
141106
|
+
|
|
141107
|
+
var supplementalExports = {};
|
|
141108
|
+
var supplemental = {
|
|
141109
|
+
get exports(){ return supplementalExports; },
|
|
141110
|
+
set exports(v){ supplementalExports = v; },
|
|
141111
|
+
};
|
|
141255
141112
|
|
|
141256
141113
|
/**
|
|
141257
141114
|
* CLDR JavaScript Library v0.5.4
|
|
@@ -141265,75 +141122,70 @@ var supplemental = {exports: {}};
|
|
|
141265
141122
|
*/
|
|
141266
141123
|
|
|
141267
141124
|
(function (module) {
|
|
141268
|
-
/*!
|
|
141269
|
-
|
|
141270
|
-
|
|
141271
|
-
|
|
141272
|
-
(function (factory) {
|
|
141273
|
-
|
|
141274
|
-
|
|
141275
|
-
|
|
141276
|
-
|
|
141277
|
-
})(function (Cldr) {
|
|
141278
|
-
|
|
141279
|
-
|
|
141280
|
-
|
|
141281
|
-
|
|
141282
|
-
|
|
141283
|
-
|
|
141284
|
-
|
|
141285
|
-
|
|
141286
|
-
|
|
141287
|
-
|
|
141288
|
-
|
|
141289
|
-
|
|
141290
|
-
|
|
141291
|
-
|
|
141292
|
-
|
|
141293
|
-
|
|
141294
|
-
|
|
141295
|
-
|
|
141296
|
-
|
|
141297
|
-
|
|
141298
|
-
|
|
141299
|
-
|
|
141300
|
-
|
|
141301
|
-
|
|
141302
|
-
|
|
141303
|
-
|
|
141304
|
-
|
|
141305
|
-
|
|
141306
|
-
|
|
141307
|
-
|
|
141308
|
-
|
|
141309
|
-
|
|
141310
|
-
|
|
141311
|
-
|
|
141312
|
-
|
|
141313
|
-
|
|
141314
|
-
|
|
141315
|
-
|
|
141316
|
-
|
|
141317
|
-
|
|
141318
|
-
|
|
141319
|
-
|
|
141320
|
-
|
|
141321
|
-
|
|
141322
|
-
|
|
141323
|
-
|
|
141324
|
-
|
|
141325
|
-
|
|
141326
|
-
|
|
141327
|
-
|
|
141328
|
-
|
|
141329
|
-
|
|
141330
|
-
}
|
|
141331
|
-
|
|
141332
|
-
return Cldr;
|
|
141333
|
-
});
|
|
141334
|
-
}(supplemental));
|
|
141335
|
-
|
|
141336
|
-
var unresolved = {exports: {}};
|
|
141125
|
+
/*!
|
|
141126
|
+
* CLDR JavaScript Library v0.5.4 2020-10-22T15:56Z MIT license © Rafael Xavier
|
|
141127
|
+
* http://git.io/h4lmVg
|
|
141128
|
+
*/
|
|
141129
|
+
(function (factory) {
|
|
141130
|
+
{
|
|
141131
|
+
// Node. CommonJS.
|
|
141132
|
+
module.exports = factory(cldrExports);
|
|
141133
|
+
}
|
|
141134
|
+
})(function (Cldr) {
|
|
141135
|
+
// Build optimization hack to avoid duplicating functions across modules.
|
|
141136
|
+
var alwaysArray = Cldr._alwaysArray;
|
|
141137
|
+
var supplementalMain = function (cldr) {
|
|
141138
|
+
var prepend, supplemental;
|
|
141139
|
+
prepend = function (prepend) {
|
|
141140
|
+
return function (path) {
|
|
141141
|
+
path = alwaysArray(path);
|
|
141142
|
+
return cldr.get([prepend].concat(path));
|
|
141143
|
+
};
|
|
141144
|
+
};
|
|
141145
|
+
supplemental = prepend("supplemental");
|
|
141146
|
+
|
|
141147
|
+
// Week Data
|
|
141148
|
+
// http://www.unicode.org/reports/tr35/tr35-dates.html#Week_Data
|
|
141149
|
+
supplemental.weekData = prepend("supplemental/weekData");
|
|
141150
|
+
supplemental.weekData.firstDay = function () {
|
|
141151
|
+
return cldr.get("supplemental/weekData/firstDay/{territory}") || cldr.get("supplemental/weekData/firstDay/001");
|
|
141152
|
+
};
|
|
141153
|
+
supplemental.weekData.minDays = function () {
|
|
141154
|
+
var minDays = cldr.get("supplemental/weekData/minDays/{territory}") || cldr.get("supplemental/weekData/minDays/001");
|
|
141155
|
+
return parseInt(minDays, 10);
|
|
141156
|
+
};
|
|
141157
|
+
|
|
141158
|
+
// Time Data
|
|
141159
|
+
// http://www.unicode.org/reports/tr35/tr35-dates.html#Time_Data
|
|
141160
|
+
supplemental.timeData = prepend("supplemental/timeData");
|
|
141161
|
+
supplemental.timeData.allowed = function () {
|
|
141162
|
+
return cldr.get("supplemental/timeData/{territory}/_allowed") || cldr.get("supplemental/timeData/001/_allowed");
|
|
141163
|
+
};
|
|
141164
|
+
supplemental.timeData.preferred = function () {
|
|
141165
|
+
return cldr.get("supplemental/timeData/{territory}/_preferred") || cldr.get("supplemental/timeData/001/_preferred");
|
|
141166
|
+
};
|
|
141167
|
+
return supplemental;
|
|
141168
|
+
};
|
|
141169
|
+
var initSuper = Cldr.prototype.init;
|
|
141170
|
+
|
|
141171
|
+
/**
|
|
141172
|
+
* .init() automatically ran on construction.
|
|
141173
|
+
*
|
|
141174
|
+
* Overload .init().
|
|
141175
|
+
*/
|
|
141176
|
+
Cldr.prototype.init = function () {
|
|
141177
|
+
initSuper.apply(this, arguments);
|
|
141178
|
+
this.supplemental = supplementalMain(this);
|
|
141179
|
+
};
|
|
141180
|
+
return Cldr;
|
|
141181
|
+
});
|
|
141182
|
+
} (supplemental));
|
|
141183
|
+
|
|
141184
|
+
var unresolvedExports = {};
|
|
141185
|
+
var unresolved = {
|
|
141186
|
+
get exports(){ return unresolvedExports; },
|
|
141187
|
+
set exports(v){ unresolvedExports = v; },
|
|
141188
|
+
};
|
|
141337
141189
|
|
|
141338
141190
|
/**
|
|
141339
141191
|
* CLDR JavaScript Library v0.5.4
|
|
@@ -141347,154 +141199,129 @@ var unresolved = {exports: {}};
|
|
|
141347
141199
|
*/
|
|
141348
141200
|
|
|
141349
141201
|
(function (module) {
|
|
141350
|
-
/*!
|
|
141351
|
-
|
|
141352
|
-
|
|
141353
|
-
|
|
141354
|
-
(function (factory) {
|
|
141355
|
-
|
|
141356
|
-
|
|
141357
|
-
|
|
141358
|
-
|
|
141359
|
-
})(function (Cldr) {
|
|
141360
|
-
|
|
141361
|
-
|
|
141362
|
-
|
|
141363
|
-
|
|
141364
|
-
|
|
141365
|
-
|
|
141366
|
-
|
|
141367
|
-
|
|
141368
|
-
|
|
141369
|
-
|
|
141370
|
-
|
|
141371
|
-
|
|
141372
|
-
|
|
141373
|
-
|
|
141374
|
-
|
|
141375
|
-
|
|
141376
|
-
|
|
141377
|
-
|
|
141378
|
-
|
|
141379
|
-
|
|
141380
|
-
|
|
141381
|
-
|
|
141382
|
-
|
|
141383
|
-
|
|
141384
|
-
|
|
141385
|
-
|
|
141386
|
-
|
|
141387
|
-
|
|
141388
|
-
|
|
141389
|
-
|
|
141390
|
-
|
|
141391
|
-
|
|
141392
|
-
|
|
141393
|
-
|
|
141394
|
-
|
|
141395
|
-
|
|
141396
|
-
|
|
141397
|
-
|
|
141398
|
-
|
|
141399
|
-
|
|
141400
|
-
|
|
141401
|
-
|
|
141402
|
-
|
|
141403
|
-
|
|
141404
|
-
|
|
141405
|
-
|
|
141406
|
-
|
|
141407
|
-
|
|
141408
|
-
|
|
141409
|
-
|
|
141410
|
-
|
|
141411
|
-
|
|
141412
|
-
|
|
141413
|
-
|
|
141414
|
-
|
|
141415
|
-
|
|
141416
|
-
|
|
141417
|
-
|
|
141418
|
-
|
|
141419
|
-
|
|
141420
|
-
|
|
141421
|
-
|
|
141422
|
-
|
|
141423
|
-
|
|
141424
|
-
|
|
141425
|
-
|
|
141426
|
-
|
|
141427
|
-
|
|
141428
|
-
|
|
141429
|
-
|
|
141430
|
-
|
|
141431
|
-
|
|
141432
|
-
|
|
141433
|
-
|
|
141434
|
-
|
|
141435
|
-
|
|
141436
|
-
|
|
141437
|
-
|
|
141438
|
-
|
|
141439
|
-
|
|
141440
|
-
|
|
141441
|
-
|
|
141442
|
-
|
|
141443
|
-
|
|
141444
|
-
|
|
141445
|
-
|
|
141446
|
-
|
|
141447
|
-
|
|
141448
|
-
|
|
141449
|
-
|
|
141450
|
-
|
|
141451
|
-
|
|
141452
|
-
|
|
141453
|
-
|
|
141454
|
-
|
|
141455
|
-
|
|
141456
|
-
|
|
141457
|
-
|
|
141458
|
-
|
|
141459
|
-
|
|
141460
|
-
|
|
141461
|
-
|
|
141462
|
-
|
|
141463
|
-
|
|
141464
|
-
|
|
141465
|
-
|
|
141466
|
-
|
|
141467
|
-
|
|
141468
|
-
|
|
141469
|
-
|
|
141470
|
-
|
|
141471
|
-
|
|
141472
|
-
|
|
141473
|
-
/**
|
|
141474
|
-
* Overwrite Cldr.prototype.get().
|
|
141475
|
-
*/
|
|
141476
|
-
|
|
141477
|
-
|
|
141478
|
-
Cldr.prototype.get = function (path) {
|
|
141479
|
-
validatePresence(path, "path");
|
|
141480
|
-
validateTypePath(path, "path"); // 1: use bundle as locale on item lookup for simplification purposes, because no other extended subtag is used anyway on bundle parent lookup.
|
|
141481
|
-
// 2: during init(), this method is called, but bundle is yet not defined. Use "" as a workaround in this very specific scenario.
|
|
141482
|
-
|
|
141483
|
-
return itemLookup(Cldr, this.attributes && this.attributes.bundle
|
|
141484
|
-
/* 1 */
|
|
141485
|
-
|| ""
|
|
141486
|
-
/* 2 */
|
|
141487
|
-
, path, this.attributes);
|
|
141488
|
-
}; // In case cldr/unresolved is loaded after cldr/event, we trigger its overloads again. Because, .get is overwritten in here.
|
|
141489
|
-
|
|
141490
|
-
|
|
141491
|
-
if (Cldr._eventInit) {
|
|
141492
|
-
Cldr._eventInit();
|
|
141493
|
-
}
|
|
141494
|
-
|
|
141495
|
-
return Cldr;
|
|
141496
|
-
});
|
|
141497
|
-
}(unresolved));
|
|
141202
|
+
/*!
|
|
141203
|
+
* CLDR JavaScript Library v0.5.4 2020-10-22T15:56Z MIT license © Rafael Xavier
|
|
141204
|
+
* http://git.io/h4lmVg
|
|
141205
|
+
*/
|
|
141206
|
+
(function (factory) {
|
|
141207
|
+
{
|
|
141208
|
+
// Node. CommonJS.
|
|
141209
|
+
module.exports = factory(cldrExports);
|
|
141210
|
+
}
|
|
141211
|
+
})(function (Cldr) {
|
|
141212
|
+
// Build optimization hack to avoid duplicating functions across modules.
|
|
141213
|
+
var coreLoad = Cldr._coreLoad;
|
|
141214
|
+
var jsonMerge = Cldr._jsonMerge;
|
|
141215
|
+
var pathNormalize = Cldr._pathNormalize;
|
|
141216
|
+
var resourceGet = Cldr._resourceGet;
|
|
141217
|
+
var validatePresence = Cldr._validatePresence;
|
|
141218
|
+
var validateTypePath = Cldr._validateTypePath;
|
|
141219
|
+
var bundleParentLookup = function (Cldr, locale) {
|
|
141220
|
+
var normalizedPath, parent;
|
|
141221
|
+
if (locale === "root") {
|
|
141222
|
+
return;
|
|
141223
|
+
}
|
|
141224
|
+
|
|
141225
|
+
// First, try to find parent on supplemental data.
|
|
141226
|
+
normalizedPath = pathNormalize(["supplemental/parentLocales/parentLocale", locale]);
|
|
141227
|
+
parent = resourceGet(Cldr._resolved, normalizedPath) || resourceGet(Cldr._raw, normalizedPath);
|
|
141228
|
+
if (parent) {
|
|
141229
|
+
return parent;
|
|
141230
|
+
}
|
|
141231
|
+
|
|
141232
|
+
// Or truncate locale.
|
|
141233
|
+
parent = locale.substr(0, locale.lastIndexOf(Cldr.localeSep));
|
|
141234
|
+
if (!parent) {
|
|
141235
|
+
return "root";
|
|
141236
|
+
}
|
|
141237
|
+
return parent;
|
|
141238
|
+
};
|
|
141239
|
+
|
|
141240
|
+
// @path: normalized path
|
|
141241
|
+
var resourceSet = function (data, path, value) {
|
|
141242
|
+
var i,
|
|
141243
|
+
node = data,
|
|
141244
|
+
length = path.length;
|
|
141245
|
+
for (i = 0; i < length - 1; i++) {
|
|
141246
|
+
if (!node[path[i]]) {
|
|
141247
|
+
node[path[i]] = {};
|
|
141248
|
+
}
|
|
141249
|
+
node = node[path[i]];
|
|
141250
|
+
}
|
|
141251
|
+
node[path[i]] = value;
|
|
141252
|
+
};
|
|
141253
|
+
var itemLookup = function () {
|
|
141254
|
+
var lookup;
|
|
141255
|
+
lookup = function (Cldr, locale, path, attributes, childLocale) {
|
|
141256
|
+
var normalizedPath, parent, value;
|
|
141257
|
+
|
|
141258
|
+
// 1: Finish recursion
|
|
141259
|
+
// 2: Avoid infinite loop
|
|
141260
|
+
if (typeof locale === "undefined" /* 1 */ || locale === childLocale /* 2 */) {
|
|
141261
|
+
return;
|
|
141262
|
+
}
|
|
141263
|
+
|
|
141264
|
+
// Resolve path
|
|
141265
|
+
normalizedPath = pathNormalize(path, attributes);
|
|
141266
|
+
|
|
141267
|
+
// Check resolved (cached) data first
|
|
141268
|
+
// 1: Due to #16, never use the cached resolved non-leaf nodes. It may not
|
|
141269
|
+
// represent its leafs in its entirety.
|
|
141270
|
+
value = resourceGet(Cldr._resolved, normalizedPath);
|
|
141271
|
+
if (value !== undefined && typeof value !== "object" /* 1 */) {
|
|
141272
|
+
return value;
|
|
141273
|
+
}
|
|
141274
|
+
|
|
141275
|
+
// Check raw data
|
|
141276
|
+
value = resourceGet(Cldr._raw, normalizedPath);
|
|
141277
|
+
if (value === undefined) {
|
|
141278
|
+
// Or, lookup at parent locale
|
|
141279
|
+
parent = bundleParentLookup(Cldr, locale);
|
|
141280
|
+
value = lookup(Cldr, parent, path, jsonMerge(attributes, {
|
|
141281
|
+
bundle: parent
|
|
141282
|
+
}), locale);
|
|
141283
|
+
}
|
|
141284
|
+
if (value !== undefined) {
|
|
141285
|
+
// Set resolved (cached)
|
|
141286
|
+
resourceSet(Cldr._resolved, normalizedPath, value);
|
|
141287
|
+
}
|
|
141288
|
+
return value;
|
|
141289
|
+
};
|
|
141290
|
+
return lookup;
|
|
141291
|
+
}();
|
|
141292
|
+
Cldr._raw = {};
|
|
141293
|
+
|
|
141294
|
+
/**
|
|
141295
|
+
* Cldr.load( json [, json, ...] )
|
|
141296
|
+
*
|
|
141297
|
+
* @json [JSON] CLDR data or [Array] Array of @json's.
|
|
141298
|
+
*
|
|
141299
|
+
* Load resolved or unresolved cldr data.
|
|
141300
|
+
* Overwrite Cldr.load().
|
|
141301
|
+
*/
|
|
141302
|
+
Cldr.load = function () {
|
|
141303
|
+
Cldr._raw = coreLoad(Cldr, Cldr._raw, arguments);
|
|
141304
|
+
};
|
|
141305
|
+
|
|
141306
|
+
/**
|
|
141307
|
+
* Overwrite Cldr.prototype.get().
|
|
141308
|
+
*/
|
|
141309
|
+
Cldr.prototype.get = function (path) {
|
|
141310
|
+
validatePresence(path, "path");
|
|
141311
|
+
validateTypePath(path, "path");
|
|
141312
|
+
|
|
141313
|
+
// 1: use bundle as locale on item lookup for simplification purposes, because no other extended subtag is used anyway on bundle parent lookup.
|
|
141314
|
+
// 2: during init(), this method is called, but bundle is yet not defined. Use "" as a workaround in this very specific scenario.
|
|
141315
|
+
return itemLookup(Cldr, this.attributes && this.attributes.bundle /* 1 */ || "" /* 2 */, path, this.attributes);
|
|
141316
|
+
};
|
|
141317
|
+
|
|
141318
|
+
// In case cldr/unresolved is loaded after cldr/event, we trigger its overloads again. Because, .get is overwritten in here.
|
|
141319
|
+
if (Cldr._eventInit) {
|
|
141320
|
+
Cldr._eventInit();
|
|
141321
|
+
}
|
|
141322
|
+
return Cldr;
|
|
141323
|
+
});
|
|
141324
|
+
} (unresolved));
|
|
141498
141325
|
|
|
141499
141326
|
/**
|
|
141500
141327
|
* CLDR JavaScript Library v0.5.4
|
|
@@ -141507,12 +141334,19 @@ var unresolved = {exports: {}};
|
|
|
141507
141334
|
* Date: 2020-10-22T15:56Z
|
|
141508
141335
|
*/
|
|
141509
141336
|
|
|
141510
|
-
|
|
141511
|
-
|
|
141512
|
-
|
|
141513
|
-
|
|
141514
|
-
|
|
141515
|
-
|
|
141337
|
+
(function (module) {
|
|
141338
|
+
/*!
|
|
141339
|
+
* CLDR JavaScript Library v0.5.4 2020-10-22T15:56Z MIT license © Rafael Xavier
|
|
141340
|
+
* http://git.io/h4lmVg
|
|
141341
|
+
*/
|
|
141342
|
+
|
|
141343
|
+
// Cldr
|
|
141344
|
+
module.exports = cldrExports;
|
|
141345
|
+
|
|
141346
|
+
// Extent Cldr with the following modules
|
|
141347
|
+
} (node_main));
|
|
141348
|
+
|
|
141349
|
+
var Cldr = /*@__PURE__*/getDefaultExportFromCjs(node_mainExports);
|
|
141516
141350
|
|
|
141517
141351
|
/*
|
|
141518
141352
|
* @copyright (c) 2020, Philipp Thuerwaechter & Pattrick Hueper
|
|
@@ -141521,16 +141355,15 @@ var node_main = cldr.exports; // Extent Cldr with the following modules
|
|
|
141521
141355
|
var cldrDataLoaded = new Set();
|
|
141522
141356
|
var loadCldrData = function loadCldrData(path) {
|
|
141523
141357
|
if (!cldrDataLoaded.has(path)) {
|
|
141524
|
-
|
|
141358
|
+
Cldr.load(cldrData(path));
|
|
141525
141359
|
cldrDataLoaded.add(path);
|
|
141526
141360
|
}
|
|
141527
141361
|
};
|
|
141528
141362
|
var localeToCldrInstanceCache = {};
|
|
141529
141363
|
var getOrCreateCldrInstance = function getOrCreateCldrInstance(locale) {
|
|
141530
141364
|
if (localeToCldrInstanceCache[locale] == null) {
|
|
141531
|
-
localeToCldrInstanceCache[locale] = new
|
|
141365
|
+
localeToCldrInstanceCache[locale] = new Cldr(locale);
|
|
141532
141366
|
}
|
|
141533
|
-
|
|
141534
141367
|
return localeToCldrInstanceCache[locale];
|
|
141535
141368
|
};
|
|
141536
141369
|
var localeToMapZonesCache = {};
|
|
@@ -141542,13 +141375,11 @@ var getOrCreateMapZones = function getOrCreateMapZones(cldr) {
|
|
|
141542
141375
|
if (!mapZones[metaZone.mapZone._other]) {
|
|
141543
141376
|
mapZones[metaZone.mapZone._other] = {};
|
|
141544
141377
|
}
|
|
141545
|
-
|
|
141546
141378
|
mapZones[metaZone.mapZone._other][metaZone.mapZone._territory] = metaZone.mapZone._type;
|
|
141547
141379
|
}
|
|
141548
141380
|
});
|
|
141549
141381
|
localeToMapZonesCache[cldr.locale] = mapZones;
|
|
141550
141382
|
}
|
|
141551
|
-
|
|
141552
141383
|
return localeToMapZonesCache[cldr.locale];
|
|
141553
141384
|
};
|
|
141554
141385
|
|
|
@@ -141556,55 +141387,41 @@ var getOrCreateMapZones = function getOrCreateMapZones(cldr) {
|
|
|
141556
141387
|
* @copyright (c) 2017, Philipp Thuerwaechter & Pattrick Hueper
|
|
141557
141388
|
* @license BSD-3-Clause (see LICENSE.md in the root directory of this source tree)
|
|
141558
141389
|
*/
|
|
141559
|
-
|
|
141560
141390
|
var CldrDateTimeTextProvider = function () {
|
|
141561
141391
|
function CldrDateTimeTextProvider() {
|
|
141562
141392
|
this._cache = {};
|
|
141563
141393
|
loadCldrData('supplemental/likelySubtags.json');
|
|
141564
141394
|
}
|
|
141565
|
-
|
|
141566
141395
|
var _proto = CldrDateTimeTextProvider.prototype;
|
|
141567
|
-
|
|
141568
141396
|
_proto.getAvailableLocales = function getAvailableLocales() {
|
|
141569
141397
|
return cldrData('availableLocales.json').availableLocales;
|
|
141570
141398
|
};
|
|
141571
|
-
|
|
141572
141399
|
_proto.getText = function getText(field, value, style, locale) {
|
|
141573
141400
|
var store = this._findStore(field, locale);
|
|
141574
|
-
|
|
141575
141401
|
if (store instanceof LocaleStore) {
|
|
141576
141402
|
return store.getText(value, style);
|
|
141577
141403
|
}
|
|
141578
|
-
|
|
141579
141404
|
return null;
|
|
141580
141405
|
};
|
|
141581
|
-
|
|
141582
141406
|
_proto.getTextIterator = function getTextIterator(field, style, locale) {
|
|
141583
141407
|
var store = this._findStore(field, locale);
|
|
141584
|
-
|
|
141585
141408
|
if (store instanceof LocaleStore) {
|
|
141586
141409
|
return store.getTextIterator(style);
|
|
141587
141410
|
}
|
|
141588
|
-
|
|
141589
141411
|
return null;
|
|
141590
141412
|
};
|
|
141591
|
-
|
|
141592
141413
|
_proto._findStore = function _findStore(field, locale) {
|
|
141593
141414
|
var key = createEntry(field, locale);
|
|
141594
141415
|
var store = this._cache[key];
|
|
141595
|
-
|
|
141596
141416
|
if (store === undefined) {
|
|
141597
141417
|
store = this._createStore(field, locale);
|
|
141598
141418
|
this._cache[key] = store;
|
|
141599
141419
|
}
|
|
141600
|
-
|
|
141601
141420
|
return store;
|
|
141602
141421
|
};
|
|
141603
|
-
|
|
141604
141422
|
_proto._createStore = function _createStore(field, locale) {
|
|
141605
141423
|
loadCldrData("main/" + locale.localeString() + "/ca-gregorian.json");
|
|
141606
141424
|
var cldr = getOrCreateCldrInstance(locale.localeString());
|
|
141607
|
-
|
|
141608
141425
|
if (field === ChronoField.MONTH_OF_YEAR) {
|
|
141609
141426
|
var monthsData = cldr.main('dates/calendars/gregorian/months/format');
|
|
141610
141427
|
var styleMap = {};
|
|
@@ -141652,7 +141469,6 @@ var CldrDateTimeTextProvider = function () {
|
|
|
141652
141469
|
styleMap[TextStyle.SHORT] = data;
|
|
141653
141470
|
return this._createLocaleStore(styleMap);
|
|
141654
141471
|
}
|
|
141655
|
-
|
|
141656
141472
|
if (field === ChronoField.DAY_OF_WEEK) {
|
|
141657
141473
|
var daysData = cldr.main('dates/calendars/gregorian/days/format');
|
|
141658
141474
|
var _styleMap = {};
|
|
@@ -141685,7 +141501,6 @@ var CldrDateTimeTextProvider = function () {
|
|
|
141685
141501
|
_styleMap[TextStyle.SHORT] = _data;
|
|
141686
141502
|
return this._createLocaleStore(_styleMap);
|
|
141687
141503
|
}
|
|
141688
|
-
|
|
141689
141504
|
if (field === ChronoField.AMPM_OF_DAY) {
|
|
141690
141505
|
var dayPeriodsData = cldr.main('dates/calendars/gregorian/dayPeriods/format');
|
|
141691
141506
|
var _styleMap2 = {};
|
|
@@ -141703,7 +141518,6 @@ var CldrDateTimeTextProvider = function () {
|
|
|
141703
141518
|
_styleMap2[TextStyle.SHORT] = _data2;
|
|
141704
141519
|
return this._createLocaleStore(_styleMap2);
|
|
141705
141520
|
}
|
|
141706
|
-
|
|
141707
141521
|
if (field === ChronoField.ERA) {
|
|
141708
141522
|
var erasData = cldr.main('dates/calendars/gregorian/eras');
|
|
141709
141523
|
var _styleMap3 = {};
|
|
@@ -141721,7 +141535,6 @@ var CldrDateTimeTextProvider = function () {
|
|
|
141721
141535
|
_styleMap3[TextStyle.SHORT] = _data3;
|
|
141722
141536
|
return this._createLocaleStore(_styleMap3);
|
|
141723
141537
|
}
|
|
141724
|
-
|
|
141725
141538
|
if (field === IsoFields.QUARTER_OF_YEAR) {
|
|
141726
141539
|
var quartersData = cldr.main('dates/calendars/gregorian/quarters/format');
|
|
141727
141540
|
var _styleMap4 = {};
|
|
@@ -141745,40 +141558,30 @@ var CldrDateTimeTextProvider = function () {
|
|
|
141745
141558
|
_styleMap4[TextStyle.SHORT] = _data4;
|
|
141746
141559
|
return this._createLocaleStore(_styleMap4);
|
|
141747
141560
|
}
|
|
141748
|
-
|
|
141749
141561
|
return null;
|
|
141750
141562
|
};
|
|
141751
|
-
|
|
141752
141563
|
_proto._createLocaleStore = function _createLocaleStore(valueTextMap) {
|
|
141753
141564
|
valueTextMap[TextStyle.FULL_STANDALONE] = valueTextMap[TextStyle.FULL];
|
|
141754
141565
|
valueTextMap[TextStyle.SHORT_STANDALONE] = valueTextMap[TextStyle.SHORT];
|
|
141755
|
-
|
|
141756
141566
|
if (Object.keys(valueTextMap).indexOf(TextStyle.NARROW) > -1 && Object.keys(valueTextMap).indexOf(TextStyle.NARROW_STANDALONE) === -1) {
|
|
141757
141567
|
valueTextMap[TextStyle.NARROW_STANDALONE] = valueTextMap[TextStyle.NARROW];
|
|
141758
141568
|
}
|
|
141759
|
-
|
|
141760
141569
|
return new LocaleStore(valueTextMap);
|
|
141761
141570
|
};
|
|
141762
|
-
|
|
141763
141571
|
return CldrDateTimeTextProvider;
|
|
141764
141572
|
}();
|
|
141765
141573
|
|
|
141766
141574
|
var _jodaInternal$assert$2 = _.assert,
|
|
141767
|
-
|
|
141768
|
-
|
|
141769
|
-
|
|
141575
|
+
requireNonNull$3 = _jodaInternal$assert$2.requireNonNull,
|
|
141576
|
+
requireInstance$2 = _jodaInternal$assert$2.requireInstance;
|
|
141770
141577
|
var LENGTH_COMPARATOR = function LENGTH_COMPARATOR(str1, str2) {
|
|
141771
141578
|
var cmp = str2.length - str1.length;
|
|
141772
|
-
|
|
141773
141579
|
if (cmp === 0) {
|
|
141774
141580
|
cmp = str1.localeCompare(str2);
|
|
141775
141581
|
}
|
|
141776
|
-
|
|
141777
141582
|
return cmp;
|
|
141778
141583
|
};
|
|
141779
|
-
|
|
141780
141584
|
var resolveZoneIdTextCache = {};
|
|
141781
|
-
|
|
141782
141585
|
var CldrZoneTextPrinterParser = function () {
|
|
141783
141586
|
function CldrZoneTextPrinterParser(textStyle) {
|
|
141784
141587
|
requireNonNull$3(textStyle, 'textStyle');
|
|
@@ -141788,69 +141591,52 @@ var CldrZoneTextPrinterParser = function () {
|
|
|
141788
141591
|
loadCldrData('supplemental/likelySubtags.json');
|
|
141789
141592
|
loadCldrData('supplemental/metaZones.json');
|
|
141790
141593
|
}
|
|
141791
|
-
|
|
141792
141594
|
var _proto = CldrZoneTextPrinterParser.prototype;
|
|
141793
|
-
|
|
141794
141595
|
_proto._cachedResolveZoneIdText = function _cachedResolveZoneIdText(cldr, zoneId, style, type) {
|
|
141795
141596
|
if (resolveZoneIdTextCache[cldr.locale] == null) {
|
|
141796
141597
|
resolveZoneIdTextCache[cldr.locale] = {};
|
|
141797
141598
|
}
|
|
141798
|
-
|
|
141799
141599
|
var zoneIdToStyle = resolveZoneIdTextCache[cldr.locale];
|
|
141800
|
-
|
|
141801
141600
|
if (zoneIdToStyle[zoneId] == null) {
|
|
141802
141601
|
zoneIdToStyle[zoneId] = {};
|
|
141803
141602
|
}
|
|
141804
|
-
|
|
141805
141603
|
var styleToType = zoneIdToStyle[zoneId];
|
|
141806
|
-
|
|
141807
141604
|
if (styleToType[style] == null) {
|
|
141808
141605
|
styleToType[style] = {};
|
|
141809
141606
|
}
|
|
141810
|
-
|
|
141811
141607
|
var typeToResolvedZoneIdText = styleToType[style];
|
|
141812
|
-
|
|
141813
141608
|
if (typeToResolvedZoneIdText[type] == null) {
|
|
141814
141609
|
typeToResolvedZoneIdText[type] = this._resolveZoneIdText(cldr, zoneId, style, type);
|
|
141815
141610
|
}
|
|
141816
|
-
|
|
141817
141611
|
return typeToResolvedZoneIdText[type];
|
|
141818
141612
|
};
|
|
141819
|
-
|
|
141820
141613
|
_proto._resolveZoneIdText = function _resolveZoneIdText(cldr, zoneId, style, type) {
|
|
141821
141614
|
var zoneData = cldr.main("dates/timeZoneNames/zone/" + zoneId + "/" + style + "/" + type);
|
|
141822
|
-
|
|
141823
141615
|
if (zoneData) {
|
|
141824
141616
|
return zoneData;
|
|
141825
141617
|
} else {
|
|
141826
141618
|
var metazoneInfo = cldr.get("supplemental/metaZones/metazoneInfo/timezone/" + zoneId);
|
|
141827
|
-
|
|
141828
141619
|
if (metazoneInfo) {
|
|
141829
141620
|
var metazone = metazoneInfo[metazoneInfo.length - 1]['usesMetazone']['_mzone'];
|
|
141830
141621
|
var metaZoneData = cldr.main("dates/timeZoneNames/metazone/" + metazone + "/" + style + "/" + type);
|
|
141831
|
-
|
|
141832
141622
|
if (metaZoneData) {
|
|
141833
141623
|
return metaZoneData;
|
|
141834
141624
|
} else {
|
|
141835
141625
|
metaZoneData = cldr.main("dates/timeZoneNames/metazone/" + metazone + "/" + style + "/generic");
|
|
141836
|
-
|
|
141837
141626
|
if (!metaZoneData) {
|
|
141838
141627
|
metaZoneData = cldr.main("dates/timeZoneNames/metazone/" + metazone + "/" + style + "/standard");
|
|
141839
141628
|
}
|
|
141840
|
-
|
|
141841
141629
|
if (metaZoneData) {
|
|
141842
141630
|
return metaZoneData;
|
|
141843
141631
|
} else {
|
|
141844
141632
|
var mapZones = getOrCreateMapZones(cldr);
|
|
141845
141633
|
var preferredZone = mapZones[metazone][cldr.attributes.territory];
|
|
141846
|
-
|
|
141847
141634
|
if (preferredZone) {
|
|
141848
141635
|
if (preferredZone !== zoneId) {
|
|
141849
141636
|
return this._cachedResolveZoneIdText(cldr, preferredZone, style, type);
|
|
141850
141637
|
}
|
|
141851
141638
|
} else {
|
|
141852
141639
|
var goldenZone = mapZones[metazone]['001'];
|
|
141853
|
-
|
|
141854
141640
|
if (goldenZone !== zoneId) {
|
|
141855
141641
|
return this._cachedResolveZoneIdText(cldr, goldenZone, style, type);
|
|
141856
141642
|
}
|
|
@@ -141860,14 +141646,11 @@ var CldrZoneTextPrinterParser = function () {
|
|
|
141860
141646
|
}
|
|
141861
141647
|
}
|
|
141862
141648
|
};
|
|
141863
|
-
|
|
141864
141649
|
_proto.print = function print(context, buf) {
|
|
141865
141650
|
var zone = context.getValueQuery(TemporalQueries.zoneId());
|
|
141866
|
-
|
|
141867
141651
|
if (zone == null) {
|
|
141868
141652
|
return false;
|
|
141869
141653
|
}
|
|
141870
|
-
|
|
141871
141654
|
if (zone.normalized() instanceof ZoneOffset) {
|
|
141872
141655
|
buf.append(zone.id());
|
|
141873
141656
|
return true;
|
|
@@ -141876,51 +141659,38 @@ var CldrZoneTextPrinterParser = function () {
|
|
|
141876
141659
|
var tzstyle = this._textStyle.asNormal() === TextStyle.FULL ? 'long' : 'short';
|
|
141877
141660
|
loadCldrData("main/" + context.locale().localeString() + "/timeZoneNames.json");
|
|
141878
141661
|
var cldr = getOrCreateCldrInstance(context.locale().localeString());
|
|
141879
|
-
|
|
141880
141662
|
var text = this._cachedResolveZoneIdText(cldr, zone.id(), tzstyle, tzType);
|
|
141881
|
-
|
|
141882
141663
|
if (text) {
|
|
141883
141664
|
buf.append(text);
|
|
141884
141665
|
} else {
|
|
141885
141666
|
buf.append(zone.id());
|
|
141886
141667
|
}
|
|
141887
|
-
|
|
141888
141668
|
return true;
|
|
141889
141669
|
};
|
|
141890
|
-
|
|
141891
141670
|
_proto._resolveZoneIds = function _resolveZoneIds(localString) {
|
|
141892
141671
|
if (this._zoneIdsLocales[localString] != null) {
|
|
141893
141672
|
return this._zoneIdsLocales[localString];
|
|
141894
141673
|
}
|
|
141895
|
-
|
|
141896
141674
|
var ids = {};
|
|
141897
141675
|
loadCldrData("main/" + localString + "/timeZoneNames.json");
|
|
141898
141676
|
var cldr = getOrCreateCldrInstance(localString);
|
|
141899
|
-
|
|
141900
141677
|
for (var _iterator = _createForOfIteratorHelperLoose(ZoneRulesProvider.getAvailableZoneIds()), _step; !(_step = _iterator()).done;) {
|
|
141901
141678
|
var id = _step.value;
|
|
141902
141679
|
ids[id] = id;
|
|
141903
141680
|
var tzstyle = this._textStyle.asNormal() === TextStyle.FULL ? 'long' : 'short';
|
|
141904
|
-
|
|
141905
141681
|
var genericText = this._cachedResolveZoneIdText(cldr, id, tzstyle, 'generic');
|
|
141906
|
-
|
|
141907
141682
|
if (genericText) {
|
|
141908
141683
|
ids[genericText] = id;
|
|
141909
141684
|
}
|
|
141910
|
-
|
|
141911
141685
|
var standardText = this._cachedResolveZoneIdText(cldr, id, tzstyle, 'standard');
|
|
141912
|
-
|
|
141913
141686
|
if (standardText) {
|
|
141914
141687
|
ids[standardText] = id;
|
|
141915
141688
|
}
|
|
141916
|
-
|
|
141917
141689
|
var daylightText = this._cachedResolveZoneIdText(cldr, id, tzstyle, 'daylight');
|
|
141918
|
-
|
|
141919
141690
|
if (daylightText) {
|
|
141920
141691
|
ids[daylightText] = id;
|
|
141921
141692
|
}
|
|
141922
141693
|
}
|
|
141923
|
-
|
|
141924
141694
|
var sortedKeys = Object.keys(ids).sort(LENGTH_COMPARATOR);
|
|
141925
141695
|
this._zoneIdsLocales[localString] = {
|
|
141926
141696
|
ids: ids,
|
|
@@ -141928,37 +141698,29 @@ var CldrZoneTextPrinterParser = function () {
|
|
|
141928
141698
|
};
|
|
141929
141699
|
return this._zoneIdsLocales[localString];
|
|
141930
141700
|
};
|
|
141931
|
-
|
|
141932
141701
|
_proto.parse = function parse(context, text, position) {
|
|
141933
141702
|
for (var _i = 0, _arr = ['UTC', 'GMT']; _i < _arr.length; _i++) {
|
|
141934
141703
|
var name = _arr[_i];
|
|
141935
|
-
|
|
141936
141704
|
if (context.subSequenceEquals(text, position, name, 0, name.length)) {
|
|
141937
141705
|
context.setParsedZone(ZoneId.of(name));
|
|
141938
141706
|
return position + name.length;
|
|
141939
141707
|
}
|
|
141940
141708
|
}
|
|
141941
|
-
|
|
141942
141709
|
var _this$_resolveZoneIds = this._resolveZoneIds(context.locale().localeString()),
|
|
141943
|
-
|
|
141944
|
-
|
|
141945
|
-
|
|
141710
|
+
ids = _this$_resolveZoneIds.ids,
|
|
141711
|
+
sortedKeys = _this$_resolveZoneIds.sortedKeys;
|
|
141946
141712
|
for (var _iterator2 = _createForOfIteratorHelperLoose(sortedKeys), _step2; !(_step2 = _iterator2()).done;) {
|
|
141947
141713
|
var _name = _step2.value;
|
|
141948
|
-
|
|
141949
141714
|
if (context.subSequenceEquals(text, position, _name, 0, _name.length)) {
|
|
141950
141715
|
context.setParsedZone(ZoneId.of(ids[_name]));
|
|
141951
141716
|
return position + _name.length;
|
|
141952
141717
|
}
|
|
141953
141718
|
}
|
|
141954
|
-
|
|
141955
141719
|
return ~position;
|
|
141956
141720
|
};
|
|
141957
|
-
|
|
141958
141721
|
_proto.toString = function toString() {
|
|
141959
141722
|
return "ZoneText(" + this._textStyle + ")";
|
|
141960
141723
|
};
|
|
141961
|
-
|
|
141962
141724
|
return CldrZoneTextPrinterParser;
|
|
141963
141725
|
}();
|
|
141964
141726
|
|
|
@@ -141968,178 +141730,127 @@ var CldrZoneTextPrinterParser = function () {
|
|
|
141968
141730
|
* @license BSD-3-Clause (see LICENSE in the root directory of this source tree)
|
|
141969
141731
|
*/
|
|
141970
141732
|
var MathUtil$1 = _.MathUtil;
|
|
141971
|
-
|
|
141972
141733
|
var LocalizedOffsetPrinterParser = function () {
|
|
141973
141734
|
function LocalizedOffsetPrinterParser(textStyle) {
|
|
141974
141735
|
this._textStyle = textStyle;
|
|
141975
141736
|
}
|
|
141976
|
-
|
|
141977
141737
|
var _proto = LocalizedOffsetPrinterParser.prototype;
|
|
141978
|
-
|
|
141979
141738
|
_proto.textStyle = function textStyle() {
|
|
141980
141739
|
return this._textStyle;
|
|
141981
141740
|
};
|
|
141982
|
-
|
|
141983
141741
|
_proto.print = function print(context, buf) {
|
|
141984
141742
|
var offsetSecs = context.getValue(ChronoField.OFFSET_SECONDS);
|
|
141985
|
-
|
|
141986
141743
|
if (offsetSecs == null) {
|
|
141987
141744
|
return false;
|
|
141988
141745
|
}
|
|
141989
|
-
|
|
141990
141746
|
buf.append('GMT');
|
|
141991
|
-
|
|
141992
141747
|
if (this._textStyle === TextStyle.FULL) {
|
|
141993
141748
|
return new DateTimeFormatterBuilder.OffsetIdPrinterParser('', '+HH:MM:ss').print(context, buf);
|
|
141994
141749
|
}
|
|
141995
|
-
|
|
141996
141750
|
var totalSecs = MathUtil$1.safeToInt(offsetSecs);
|
|
141997
|
-
|
|
141998
141751
|
if (totalSecs !== 0) {
|
|
141999
141752
|
var absHours = Math.abs(MathUtil$1.intMod(MathUtil$1.intDiv(totalSecs, 3600), 100));
|
|
142000
141753
|
var absMinutes = Math.abs(MathUtil$1.intMod(MathUtil$1.intDiv(totalSecs, 60), 60));
|
|
142001
141754
|
var absSeconds = Math.abs(MathUtil$1.intMod(totalSecs, 60));
|
|
142002
141755
|
buf.append(totalSecs < 0 ? '-' : '+').append(absHours);
|
|
142003
|
-
|
|
142004
141756
|
if (absMinutes > 0 || absSeconds > 0) {
|
|
142005
141757
|
buf.append(':').append(MathUtil$1.intDiv(absMinutes, 10)).append(MathUtil$1.intMod(absMinutes, 10));
|
|
142006
|
-
|
|
142007
141758
|
if (absSeconds > 0) {
|
|
142008
141759
|
buf.append(':').append(MathUtil$1.intDiv(absSeconds, 10)).append(MathUtil$1.intMod(absSeconds, 10));
|
|
142009
141760
|
}
|
|
142010
141761
|
}
|
|
142011
141762
|
}
|
|
142012
|
-
|
|
142013
141763
|
return true;
|
|
142014
141764
|
};
|
|
142015
|
-
|
|
142016
141765
|
_proto.parse = function parse(context, text, position) {
|
|
142017
141766
|
if (context.subSequenceEquals(text, position, 'GMT', 0, 3) === false) {
|
|
142018
141767
|
return ~position;
|
|
142019
141768
|
}
|
|
142020
|
-
|
|
142021
141769
|
position += 3;
|
|
142022
|
-
|
|
142023
141770
|
if (this._textStyle === TextStyle.FULL) {
|
|
142024
141771
|
return new DateTimeFormatterBuilder.OffsetIdPrinterParser('', '+HH:MM:ss').parse(context, text, position);
|
|
142025
141772
|
}
|
|
142026
|
-
|
|
142027
141773
|
var end = text.length;
|
|
142028
|
-
|
|
142029
141774
|
if (position === end) {
|
|
142030
141775
|
return context.setParsedField(ChronoField.OFFSET_SECONDS, 0, position, position);
|
|
142031
141776
|
}
|
|
142032
|
-
|
|
142033
141777
|
var sign = text.charAt(position);
|
|
142034
|
-
|
|
142035
141778
|
if (sign !== '+' && sign !== '-') {
|
|
142036
141779
|
return context.setParsedField(ChronoField.OFFSET_SECONDS, 0, position, position);
|
|
142037
141780
|
}
|
|
142038
|
-
|
|
142039
141781
|
var negative = sign === '-' ? -1 : 1;
|
|
142040
|
-
|
|
142041
141782
|
if (position === end) {
|
|
142042
141783
|
return ~position;
|
|
142043
141784
|
}
|
|
142044
|
-
|
|
142045
141785
|
position++;
|
|
142046
141786
|
var ch = text.charAt(position);
|
|
142047
|
-
|
|
142048
141787
|
if (ch < '0' || ch > '9') {
|
|
142049
141788
|
return ~position;
|
|
142050
141789
|
}
|
|
142051
|
-
|
|
142052
141790
|
position++;
|
|
142053
141791
|
var hour = MathUtil$1.parseInt(ch);
|
|
142054
|
-
|
|
142055
141792
|
if (position !== end) {
|
|
142056
141793
|
ch = text.charAt(position);
|
|
142057
|
-
|
|
142058
141794
|
if (ch >= '0' && ch <= '9') {
|
|
142059
141795
|
hour = hour * 10 + MathUtil$1.parseInt(ch);
|
|
142060
|
-
|
|
142061
141796
|
if (hour > 23) {
|
|
142062
141797
|
return ~position;
|
|
142063
141798
|
}
|
|
142064
|
-
|
|
142065
141799
|
position++;
|
|
142066
141800
|
}
|
|
142067
141801
|
}
|
|
142068
|
-
|
|
142069
141802
|
if (position === end || text.charAt(position) !== ':') {
|
|
142070
141803
|
var _offset = negative * 3600 * hour;
|
|
142071
|
-
|
|
142072
141804
|
return context.setParsedField(ChronoField.OFFSET_SECONDS, _offset, position, position);
|
|
142073
141805
|
}
|
|
142074
|
-
|
|
142075
141806
|
position++;
|
|
142076
|
-
|
|
142077
141807
|
if (position > end - 2) {
|
|
142078
141808
|
return ~position;
|
|
142079
141809
|
}
|
|
142080
|
-
|
|
142081
141810
|
ch = text.charAt(position);
|
|
142082
|
-
|
|
142083
141811
|
if (ch < '0' || ch > '9') {
|
|
142084
141812
|
return ~position;
|
|
142085
141813
|
}
|
|
142086
|
-
|
|
142087
141814
|
position++;
|
|
142088
141815
|
var min = MathUtil$1.parseInt(ch);
|
|
142089
141816
|
ch = text.charAt(position);
|
|
142090
|
-
|
|
142091
141817
|
if (ch < '0' || ch > '9') {
|
|
142092
141818
|
return ~position;
|
|
142093
141819
|
}
|
|
142094
|
-
|
|
142095
141820
|
position++;
|
|
142096
141821
|
min = min * 10 + MathUtil$1.parseInt(ch);
|
|
142097
|
-
|
|
142098
141822
|
if (min > 59) {
|
|
142099
141823
|
return ~position;
|
|
142100
141824
|
}
|
|
142101
|
-
|
|
142102
141825
|
if (position === end || text.charAt(position) !== ':') {
|
|
142103
141826
|
var _offset2 = negative * (3600 * hour + 60 * min);
|
|
142104
|
-
|
|
142105
141827
|
return context.setParsedField(ChronoField.OFFSET_SECONDS, _offset2, position, position);
|
|
142106
141828
|
}
|
|
142107
|
-
|
|
142108
141829
|
position++;
|
|
142109
|
-
|
|
142110
141830
|
if (position > end - 2) {
|
|
142111
141831
|
return ~position;
|
|
142112
141832
|
}
|
|
142113
|
-
|
|
142114
141833
|
ch = text.charAt(position);
|
|
142115
|
-
|
|
142116
141834
|
if (ch < '0' || ch > '9') {
|
|
142117
141835
|
return ~position;
|
|
142118
141836
|
}
|
|
142119
|
-
|
|
142120
141837
|
position++;
|
|
142121
141838
|
var sec = MathUtil$1.parseInt(ch);
|
|
142122
141839
|
ch = text.charAt(position);
|
|
142123
|
-
|
|
142124
141840
|
if (ch < '0' || ch > '9') {
|
|
142125
141841
|
return ~position;
|
|
142126
141842
|
}
|
|
142127
|
-
|
|
142128
141843
|
position++;
|
|
142129
141844
|
sec = sec * 10 + MathUtil$1.parseInt(ch);
|
|
142130
|
-
|
|
142131
141845
|
if (sec > 59) {
|
|
142132
141846
|
return ~position;
|
|
142133
141847
|
}
|
|
142134
|
-
|
|
142135
141848
|
var offset = negative * (3600 * hour + 60 * min + sec);
|
|
142136
141849
|
return context.setParsedField(ChronoField.OFFSET_SECONDS, offset, position, position);
|
|
142137
141850
|
};
|
|
142138
|
-
|
|
142139
141851
|
_proto.toString = function toString() {
|
|
142140
141852
|
return "LocalizedOffset(" + this._textStyle + ")";
|
|
142141
141853
|
};
|
|
142142
|
-
|
|
142143
141854
|
return LocalizedOffsetPrinterParser;
|
|
142144
141855
|
}();
|
|
142145
141856
|
|
|
@@ -142148,9 +141859,9 @@ var LocalizedOffsetPrinterParser = function () {
|
|
|
142148
141859
|
* @license BSD-3-Clause (see LICENSE.md in the root directory of this source tree)
|
|
142149
141860
|
*/
|
|
142150
141861
|
var MathUtil = _.MathUtil,
|
|
142151
|
-
|
|
142152
|
-
|
|
142153
|
-
|
|
141862
|
+
_jodaInternal$assert$1 = _.assert,
|
|
141863
|
+
requireNonNull$2 = _jodaInternal$assert$1.requireNonNull,
|
|
141864
|
+
requireInstance$1 = _jodaInternal$assert$1.requireInstance;
|
|
142154
141865
|
var DAY_OF_WEEK_RANGE = ValueRange.of(1, 7);
|
|
142155
141866
|
var WEEK_OF_MONTH_RANGE = ValueRange.of(0, 1, 4, 6);
|
|
142156
141867
|
var WEEK_OF_YEAR_RANGE = ValueRange.of(0, 1, 52, 54);
|
|
@@ -142169,23 +141880,18 @@ var ComputedDayOfField = function () {
|
|
|
142169
141880
|
ComputedDayOfField.ofDayOfWeekField = function ofDayOfWeekField(weekDef) {
|
|
142170
141881
|
return new ComputedDayOfField('DayOfWeek', weekDef, ChronoUnit.DAYS, ChronoUnit.WEEKS, DAY_OF_WEEK_RANGE);
|
|
142171
141882
|
};
|
|
142172
|
-
|
|
142173
141883
|
ComputedDayOfField.ofWeekOfMonthField = function ofWeekOfMonthField(weekDef) {
|
|
142174
141884
|
return new ComputedDayOfField('WeekOfMonth', weekDef, ChronoUnit.WEEKS, ChronoUnit.MONTHS, WEEK_OF_MONTH_RANGE);
|
|
142175
141885
|
};
|
|
142176
|
-
|
|
142177
141886
|
ComputedDayOfField.ofWeekOfYearField = function ofWeekOfYearField(weekDef) {
|
|
142178
141887
|
return new ComputedDayOfField('WeekOfYear', weekDef, ChronoUnit.WEEKS, ChronoUnit.YEARS, WEEK_OF_YEAR_RANGE);
|
|
142179
141888
|
};
|
|
142180
|
-
|
|
142181
141889
|
ComputedDayOfField.ofWeekOfWeekBasedYearField = function ofWeekOfWeekBasedYearField(weekDef) {
|
|
142182
141890
|
return new ComputedDayOfField('WeekOfWeekBasedYear', weekDef, ChronoUnit.WEEKS, IsoFields.WEEK_BASED_YEARS, WEEK_OF_WEEK_BASED_YEAR_RANGE);
|
|
142183
141891
|
};
|
|
142184
|
-
|
|
142185
141892
|
ComputedDayOfField.ofWeekBasedYearField = function ofWeekBasedYearField(weekDef) {
|
|
142186
141893
|
return new ComputedDayOfField('WeekBasedYear', weekDef, IsoFields.WEEK_BASED_YEARS, ChronoUnit.FOREVER, WEEK_BASED_YEAR_RANGE);
|
|
142187
141894
|
};
|
|
142188
|
-
|
|
142189
141895
|
function ComputedDayOfField(name, weekDef, baseUnit, rangeUnit, range) {
|
|
142190
141896
|
this._name = name;
|
|
142191
141897
|
this._weekDef = weekDef;
|
|
@@ -142193,14 +141899,10 @@ var ComputedDayOfField = function () {
|
|
|
142193
141899
|
this._rangeUnit = rangeUnit;
|
|
142194
141900
|
this._range = range;
|
|
142195
141901
|
}
|
|
142196
|
-
|
|
142197
141902
|
var _proto = ComputedDayOfField.prototype;
|
|
142198
|
-
|
|
142199
141903
|
_proto.getFrom = function getFrom(temporal) {
|
|
142200
141904
|
var sow = this._weekDef.firstDayOfWeek().value();
|
|
142201
|
-
|
|
142202
141905
|
var dow = this._localizedDayOfWeek(temporal, sow);
|
|
142203
|
-
|
|
142204
141906
|
if (this._rangeUnit === ChronoUnit.WEEKS) {
|
|
142205
141907
|
return dow;
|
|
142206
141908
|
} else if (this._rangeUnit === ChronoUnit.MONTHS) {
|
|
@@ -142215,112 +141917,79 @@ var ComputedDayOfField = function () {
|
|
|
142215
141917
|
throw new IllegalStateException('unreachable');
|
|
142216
141918
|
}
|
|
142217
141919
|
};
|
|
142218
|
-
|
|
142219
141920
|
_proto._localizedDayOfWeek = function _localizedDayOfWeek(temporal, sow) {
|
|
142220
141921
|
var isoDow = temporal.get(ChronoField.DAY_OF_WEEK);
|
|
142221
141922
|
return MathUtil.floorMod(isoDow - sow, 7) + 1;
|
|
142222
141923
|
};
|
|
142223
|
-
|
|
142224
141924
|
_proto._localizedWeekOfMonth = function _localizedWeekOfMonth(temporal, dow) {
|
|
142225
141925
|
var dom = temporal.get(ChronoField.DAY_OF_MONTH);
|
|
142226
|
-
|
|
142227
141926
|
var offset = this._startOfWeekOffset(dom, dow);
|
|
142228
|
-
|
|
142229
141927
|
return ComputedDayOfField._computeWeek(offset, dom);
|
|
142230
141928
|
};
|
|
142231
|
-
|
|
142232
141929
|
_proto._localizedWeekOfYear = function _localizedWeekOfYear(temporal, dow) {
|
|
142233
141930
|
var doy = temporal.get(ChronoField.DAY_OF_YEAR);
|
|
142234
|
-
|
|
142235
141931
|
var offset = this._startOfWeekOffset(doy, dow);
|
|
142236
|
-
|
|
142237
141932
|
return ComputedDayOfField._computeWeek(offset, doy);
|
|
142238
141933
|
};
|
|
142239
|
-
|
|
142240
141934
|
_proto._localizedWOWBY = function _localizedWOWBY(temporal) {
|
|
142241
141935
|
var sow = this._weekDef.firstDayOfWeek().value();
|
|
142242
|
-
|
|
142243
141936
|
var isoDow = temporal.get(ChronoField.DAY_OF_WEEK);
|
|
142244
141937
|
var dow = MathUtil.floorMod(isoDow - sow, 7) + 1;
|
|
142245
|
-
|
|
142246
141938
|
var woy = this._localizedWeekOfYear(temporal, dow);
|
|
142247
|
-
|
|
142248
141939
|
if (woy === 0) {
|
|
142249
141940
|
var previous = LocalDate.from(temporal).minus(1, ChronoUnit.WEEKS);
|
|
142250
141941
|
return this._localizedWeekOfYear(previous, dow) + 1;
|
|
142251
141942
|
} else if (woy >= 53) {
|
|
142252
141943
|
var offset = this._startOfWeekOffset(temporal.get(ChronoField.DAY_OF_YEAR), dow);
|
|
142253
|
-
|
|
142254
141944
|
var year = temporal.get(ChronoField.YEAR);
|
|
142255
141945
|
var yearLen = Year.isLeap(year) ? 366 : 365;
|
|
142256
|
-
|
|
142257
141946
|
var weekIndexOfFirstWeekNextYear = ComputedDayOfField._computeWeek(offset, yearLen + this._weekDef.minimalDaysInFirstWeek());
|
|
142258
|
-
|
|
142259
141947
|
if (woy >= weekIndexOfFirstWeekNextYear) {
|
|
142260
141948
|
return woy - (weekIndexOfFirstWeekNextYear - 1);
|
|
142261
141949
|
}
|
|
142262
141950
|
}
|
|
142263
|
-
|
|
142264
141951
|
return woy;
|
|
142265
141952
|
};
|
|
142266
|
-
|
|
142267
141953
|
_proto._localizedWBY = function _localizedWBY(temporal) {
|
|
142268
141954
|
var sow = this._weekDef.firstDayOfWeek().value();
|
|
142269
|
-
|
|
142270
141955
|
var isoDow = temporal.get(ChronoField.DAY_OF_WEEK);
|
|
142271
141956
|
var dow = MathUtil.floorMod(isoDow - sow, 7) + 1;
|
|
142272
141957
|
var year = temporal.get(ChronoField.YEAR);
|
|
142273
|
-
|
|
142274
141958
|
var woy = this._localizedWeekOfYear(temporal, dow);
|
|
142275
|
-
|
|
142276
141959
|
if (woy === 0) {
|
|
142277
141960
|
return year - 1;
|
|
142278
141961
|
} else if (woy < 53) {
|
|
142279
141962
|
return year;
|
|
142280
141963
|
}
|
|
142281
|
-
|
|
142282
141964
|
var offset = this._startOfWeekOffset(temporal.get(ChronoField.DAY_OF_YEAR), dow);
|
|
142283
|
-
|
|
142284
141965
|
var yearLen = Year.isLeap(year) ? 366 : 365;
|
|
142285
|
-
|
|
142286
141966
|
var weekIndexOfFirstWeekNextYear = ComputedDayOfField._computeWeek(offset, yearLen + this._weekDef.minimalDaysInFirstWeek());
|
|
142287
|
-
|
|
142288
141967
|
if (woy >= weekIndexOfFirstWeekNextYear) {
|
|
142289
141968
|
return year + 1;
|
|
142290
141969
|
}
|
|
142291
|
-
|
|
142292
141970
|
return year;
|
|
142293
141971
|
};
|
|
142294
|
-
|
|
142295
141972
|
_proto._startOfWeekOffset = function _startOfWeekOffset(day, dow) {
|
|
142296
141973
|
var weekStart = MathUtil.floorMod(day - dow, 7);
|
|
142297
141974
|
var offset = -weekStart;
|
|
142298
|
-
|
|
142299
141975
|
if (weekStart + 1 > this._weekDef.minimalDaysInFirstWeek()) {
|
|
142300
141976
|
offset = 7 - weekStart;
|
|
142301
141977
|
}
|
|
142302
|
-
|
|
142303
141978
|
return offset;
|
|
142304
141979
|
};
|
|
142305
|
-
|
|
142306
141980
|
ComputedDayOfField._computeWeek = function _computeWeek(offset, day) {
|
|
142307
141981
|
return MathUtil.intDiv(7 + offset + (day - 1), 7);
|
|
142308
141982
|
};
|
|
142309
|
-
|
|
142310
141983
|
_proto.adjustInto = function adjustInto(temporal, newValue) {
|
|
142311
141984
|
var newVal = this._range.checkValidIntValue(newValue, this);
|
|
142312
|
-
|
|
142313
141985
|
var currentVal = temporal.get(this);
|
|
142314
|
-
|
|
142315
141986
|
if (newVal === currentVal) {
|
|
142316
141987
|
return temporal;
|
|
142317
141988
|
}
|
|
142318
|
-
|
|
142319
141989
|
if (this._rangeUnit === ChronoUnit.FOREVER) {
|
|
142320
141990
|
var baseWowby = temporal.get(this._weekDef.weekOfWeekBasedYear());
|
|
142321
141991
|
var diffWeeks = MathUtil.roundDown((newValue - currentVal) * 52.1775);
|
|
142322
141992
|
var result = temporal.plus(diffWeeks, ChronoUnit.WEEKS);
|
|
142323
|
-
|
|
142324
141993
|
if (result.get(this) > newVal) {
|
|
142325
141994
|
var newWowby = result.get(this._weekDef.weekOfWeekBasedYear());
|
|
142326
141995
|
result = result.minus(newWowby, ChronoUnit.WEEKS);
|
|
@@ -142328,140 +141997,96 @@ var ComputedDayOfField = function () {
|
|
|
142328
141997
|
if (result.get(this) < newVal) {
|
|
142329
141998
|
result = result.plus(2, ChronoUnit.WEEKS);
|
|
142330
141999
|
}
|
|
142331
|
-
|
|
142332
142000
|
var _newWowby = result.get(this._weekDef.weekOfWeekBasedYear());
|
|
142333
|
-
|
|
142334
142001
|
result = result.plus(baseWowby - _newWowby, ChronoUnit.WEEKS);
|
|
142335
|
-
|
|
142336
142002
|
if (result.get(this) > newVal) {
|
|
142337
142003
|
result = result.minus(1, ChronoUnit.WEEKS);
|
|
142338
142004
|
}
|
|
142339
142005
|
}
|
|
142340
|
-
|
|
142341
142006
|
return result;
|
|
142342
142007
|
}
|
|
142343
|
-
|
|
142344
142008
|
var delta = newVal - currentVal;
|
|
142345
142009
|
return temporal.plus(delta, this._baseUnit);
|
|
142346
142010
|
};
|
|
142347
|
-
|
|
142348
142011
|
_proto.resolve = function resolve(fieldValues, partialTemporal, resolverStyle) {
|
|
142349
142012
|
var sow = this._weekDef.firstDayOfWeek().value();
|
|
142350
|
-
|
|
142351
142013
|
if (this._rangeUnit === ChronoUnit.WEEKS) {
|
|
142352
142014
|
var value = fieldValues.remove(this);
|
|
142353
|
-
|
|
142354
142015
|
var localDow = this._range.checkValidIntValue(value, this);
|
|
142355
|
-
|
|
142356
142016
|
var _isoDow = MathUtil.floorMod(sow - 1 + (localDow - 1), 7) + 1;
|
|
142357
|
-
|
|
142358
142017
|
fieldValues.put(ChronoField.DAY_OF_WEEK, _isoDow);
|
|
142359
142018
|
return null;
|
|
142360
142019
|
}
|
|
142361
|
-
|
|
142362
142020
|
if (fieldValues.containsKey(ChronoField.DAY_OF_WEEK) === false) {
|
|
142363
142021
|
return null;
|
|
142364
142022
|
}
|
|
142365
|
-
|
|
142366
142023
|
if (this._rangeUnit === ChronoUnit.FOREVER) {
|
|
142367
142024
|
if (fieldValues.containsKey(this._weekDef.weekOfWeekBasedYear()) === false) {
|
|
142368
142025
|
return null;
|
|
142369
142026
|
}
|
|
142370
|
-
|
|
142371
142027
|
var _isoDow2 = ChronoField.DAY_OF_WEEK.checkValidIntValue(fieldValues.get(ChronoField.DAY_OF_WEEK));
|
|
142372
|
-
|
|
142373
142028
|
var _dow = MathUtil.floorMod(_isoDow2 - sow, 7) + 1;
|
|
142374
|
-
|
|
142375
142029
|
var wby = this.range().checkValidIntValue(fieldValues.get(this), this);
|
|
142376
142030
|
var date;
|
|
142377
142031
|
var days;
|
|
142378
|
-
|
|
142379
142032
|
if (resolverStyle === ResolverStyle.LENIENT) {
|
|
142380
142033
|
date = LocalDate.of(wby, 1, this._weekDef.minimalDaysInFirstWeek());
|
|
142381
142034
|
var wowby = fieldValues.get(this._weekDef.weekOfWeekBasedYear());
|
|
142382
|
-
|
|
142383
142035
|
var dateDow = this._localizedDayOfWeek(date, sow);
|
|
142384
|
-
|
|
142385
142036
|
var weeks = wowby - this._localizedWeekOfYear(date, dateDow);
|
|
142386
|
-
|
|
142387
142037
|
days = weeks * 7 + (_dow - dateDow);
|
|
142388
142038
|
} else {
|
|
142389
142039
|
date = LocalDate.of(wby, 1, this._weekDef.minimalDaysInFirstWeek());
|
|
142390
|
-
|
|
142391
142040
|
var _wowby = this._weekDef.weekOfWeekBasedYear().range().checkValidIntValue(fieldValues.get(this._weekDef.weekOfWeekBasedYear()), this._weekDef.weekOfWeekBasedYear);
|
|
142392
|
-
|
|
142393
142041
|
var _dateDow = this._localizedDayOfWeek(date, sow);
|
|
142394
|
-
|
|
142395
142042
|
var _weeks = _wowby - this._localizedWeekOfYear(date, _dateDow);
|
|
142396
|
-
|
|
142397
142043
|
days = _weeks * 7 + (_dow - _dateDow);
|
|
142398
142044
|
}
|
|
142399
|
-
|
|
142400
142045
|
date = date.plus(days, ChronoUnit.DAYS);
|
|
142401
|
-
|
|
142402
142046
|
if (resolverStyle === ResolverStyle.STRICT) {
|
|
142403
142047
|
if (date.getLong(this) !== fieldValues.get(this)) {
|
|
142404
142048
|
throw new DateTimeException('Strict mode rejected date parsed to a different year');
|
|
142405
142049
|
}
|
|
142406
142050
|
}
|
|
142407
|
-
|
|
142408
142051
|
fieldValues.remove(this);
|
|
142409
142052
|
fieldValues.remove(this._weekDef.weekOfWeekBasedYear());
|
|
142410
142053
|
fieldValues.remove(ChronoField.DAY_OF_WEEK);
|
|
142411
142054
|
return date;
|
|
142412
142055
|
}
|
|
142413
|
-
|
|
142414
142056
|
if (fieldValues.containsKey(ChronoField.YEAR) === false) {
|
|
142415
142057
|
return null;
|
|
142416
142058
|
}
|
|
142417
|
-
|
|
142418
142059
|
var isoDow = ChronoField.DAY_OF_WEEK.checkValidIntValue(fieldValues.get(ChronoField.DAY_OF_WEEK));
|
|
142419
142060
|
var dow = MathUtil.floorMod(isoDow - sow, 7) + 1;
|
|
142420
142061
|
var year = ChronoField.YEAR.checkValidIntValue(fieldValues.get(ChronoField.YEAR));
|
|
142421
|
-
|
|
142422
142062
|
if (this._rangeUnit === ChronoUnit.MONTHS) {
|
|
142423
142063
|
if (fieldValues.containsKey(ChronoField.MONTH_OF_YEAR) === false) {
|
|
142424
142064
|
return null;
|
|
142425
142065
|
}
|
|
142426
|
-
|
|
142427
142066
|
var _value = fieldValues.remove(this);
|
|
142428
|
-
|
|
142429
142067
|
var _date;
|
|
142430
|
-
|
|
142431
142068
|
var _days;
|
|
142432
|
-
|
|
142433
142069
|
if (resolverStyle === ResolverStyle.LENIENT) {
|
|
142434
142070
|
var month = fieldValues.get(ChronoField.MONTH_OF_YEAR);
|
|
142435
142071
|
_date = LocalDate.of(year, 1, 1);
|
|
142436
142072
|
_date = _date.plus(month - 1, ChronoUnit.MONTHS);
|
|
142437
|
-
|
|
142438
142073
|
var _dateDow2 = this._localizedDayOfWeek(_date, sow);
|
|
142439
|
-
|
|
142440
142074
|
var _weeks2 = _value - this._localizedWeekOfMonth(_date, _dateDow2);
|
|
142441
|
-
|
|
142442
142075
|
_days = _weeks2 * 7 + (dow - _dateDow2);
|
|
142443
142076
|
} else {
|
|
142444
142077
|
var _month = ChronoField.MONTH_OF_YEAR.checkValidIntValue(fieldValues.get(ChronoField.MONTH_OF_YEAR));
|
|
142445
|
-
|
|
142446
142078
|
_date = LocalDate.of(year, _month, 8);
|
|
142447
|
-
|
|
142448
142079
|
var _dateDow3 = this._localizedDayOfWeek(_date, sow);
|
|
142449
|
-
|
|
142450
142080
|
var wom = this._range.checkValidIntValue(_value, this);
|
|
142451
|
-
|
|
142452
142081
|
var _weeks3 = wom - this._localizedWeekOfMonth(_date, _dateDow3);
|
|
142453
|
-
|
|
142454
142082
|
_days = _weeks3 * 7 + (dow - _dateDow3);
|
|
142455
142083
|
}
|
|
142456
|
-
|
|
142457
142084
|
_date = _date.plus(_days, ChronoUnit.DAYS);
|
|
142458
|
-
|
|
142459
142085
|
if (resolverStyle === ResolverStyle.STRICT) {
|
|
142460
142086
|
if (_date.getLong(ChronoField.MONTH_OF_YEAR) !== fieldValues.get(ChronoField.MONTH_OF_YEAR)) {
|
|
142461
142087
|
throw new DateTimeException('Strict mode rejected date parsed to a different month');
|
|
142462
142088
|
}
|
|
142463
142089
|
}
|
|
142464
|
-
|
|
142465
142090
|
fieldValues.remove(this);
|
|
142466
142091
|
fieldValues.remove(ChronoField.YEAR);
|
|
142467
142092
|
fieldValues.remove(ChronoField.MONTH_OF_YEAR);
|
|
@@ -142469,35 +142094,24 @@ var ComputedDayOfField = function () {
|
|
|
142469
142094
|
return _date;
|
|
142470
142095
|
} else if (this._rangeUnit === ChronoUnit.YEARS) {
|
|
142471
142096
|
var _value2 = fieldValues.remove(this);
|
|
142472
|
-
|
|
142473
142097
|
var _date2 = LocalDate.of(year, 1, 1);
|
|
142474
|
-
|
|
142475
142098
|
var _days2;
|
|
142476
|
-
|
|
142477
142099
|
if (resolverStyle === ResolverStyle.LENIENT) {
|
|
142478
142100
|
var _dateDow4 = this._localizedDayOfWeek(_date2, sow);
|
|
142479
|
-
|
|
142480
142101
|
var _weeks4 = _value2 - this._localizedWeekOfYear(_date2, _dateDow4);
|
|
142481
|
-
|
|
142482
142102
|
_days2 = _weeks4 * 7 + (dow - _dateDow4);
|
|
142483
142103
|
} else {
|
|
142484
142104
|
var _dateDow5 = this._localizedDayOfWeek(_date2, sow);
|
|
142485
|
-
|
|
142486
142105
|
var woy = this._range.checkValidIntValue(_value2, this);
|
|
142487
|
-
|
|
142488
142106
|
var _weeks5 = woy - this._localizedWeekOfYear(_date2, _dateDow5);
|
|
142489
|
-
|
|
142490
142107
|
_days2 = _weeks5 * 7 + (dow - _dateDow5);
|
|
142491
142108
|
}
|
|
142492
|
-
|
|
142493
142109
|
_date2 = _date2.plus(_days2, ChronoUnit.DAYS);
|
|
142494
|
-
|
|
142495
142110
|
if (resolverStyle === ResolverStyle.STRICT) {
|
|
142496
142111
|
if (_date2.getLong(ChronoField.YEAR) !== fieldValues.get(ChronoField.YEAR)) {
|
|
142497
142112
|
throw new DateTimeException('Strict mode rejected date parsed to a different year');
|
|
142498
142113
|
}
|
|
142499
142114
|
}
|
|
142500
|
-
|
|
142501
142115
|
fieldValues.remove(this);
|
|
142502
142116
|
fieldValues.remove(ChronoField.YEAR);
|
|
142503
142117
|
fieldValues.remove(ChronoField.DAY_OF_WEEK);
|
|
@@ -142506,31 +142120,24 @@ var ComputedDayOfField = function () {
|
|
|
142506
142120
|
throw new IllegalStateException('unreachable');
|
|
142507
142121
|
}
|
|
142508
142122
|
};
|
|
142509
|
-
|
|
142510
142123
|
_proto.name = function name() {
|
|
142511
142124
|
return this._name;
|
|
142512
142125
|
};
|
|
142513
|
-
|
|
142514
142126
|
_proto.baseUnit = function baseUnit() {
|
|
142515
142127
|
return this._baseUnit;
|
|
142516
142128
|
};
|
|
142517
|
-
|
|
142518
142129
|
_proto.rangeUnit = function rangeUnit() {
|
|
142519
142130
|
return this._rangeUnit;
|
|
142520
142131
|
};
|
|
142521
|
-
|
|
142522
142132
|
_proto.range = function range() {
|
|
142523
142133
|
return this._range;
|
|
142524
142134
|
};
|
|
142525
|
-
|
|
142526
142135
|
_proto.isDateBased = function isDateBased() {
|
|
142527
142136
|
return true;
|
|
142528
142137
|
};
|
|
142529
|
-
|
|
142530
142138
|
_proto.isTimeBased = function isTimeBased() {
|
|
142531
142139
|
return false;
|
|
142532
142140
|
};
|
|
142533
|
-
|
|
142534
142141
|
_proto.isSupportedBy = function isSupportedBy(temporal) {
|
|
142535
142142
|
if (temporal.isSupported(ChronoField.DAY_OF_WEEK)) {
|
|
142536
142143
|
if (this._rangeUnit === ChronoUnit.WEEKS) {
|
|
@@ -142545,17 +142152,13 @@ var ComputedDayOfField = function () {
|
|
|
142545
142152
|
return temporal.isSupported(ChronoField.EPOCH_DAY);
|
|
142546
142153
|
}
|
|
142547
142154
|
}
|
|
142548
|
-
|
|
142549
142155
|
return false;
|
|
142550
142156
|
};
|
|
142551
|
-
|
|
142552
142157
|
_proto.rangeRefinedBy = function rangeRefinedBy(temporal) {
|
|
142553
142158
|
if (this._rangeUnit === ChronoUnit.WEEKS) {
|
|
142554
142159
|
return this._range;
|
|
142555
142160
|
}
|
|
142556
|
-
|
|
142557
142161
|
var field = null;
|
|
142558
|
-
|
|
142559
142162
|
if (this._rangeUnit === ChronoUnit.MONTHS) {
|
|
142560
142163
|
field = ChronoField.DAY_OF_MONTH;
|
|
142561
142164
|
} else if (this._rangeUnit === ChronoUnit.YEARS) {
|
|
@@ -142567,58 +142170,40 @@ var ComputedDayOfField = function () {
|
|
|
142567
142170
|
} else {
|
|
142568
142171
|
throw new IllegalStateException('unreachable');
|
|
142569
142172
|
}
|
|
142570
|
-
|
|
142571
142173
|
var sow = this._weekDef.firstDayOfWeek().value();
|
|
142572
|
-
|
|
142573
142174
|
var isoDow = temporal.get(ChronoField.DAY_OF_WEEK);
|
|
142574
142175
|
var dow = MathUtil.floorMod(isoDow - sow, 7) + 1;
|
|
142575
|
-
|
|
142576
142176
|
var offset = this._startOfWeekOffset(temporal.get(field), dow);
|
|
142577
|
-
|
|
142578
142177
|
var fieldRange = temporal.range(field);
|
|
142579
142178
|
return ValueRange.of(ComputedDayOfField._computeWeek(offset, fieldRange.minimum()), ComputedDayOfField._computeWeek(offset, fieldRange.maximum()));
|
|
142580
142179
|
};
|
|
142581
|
-
|
|
142582
142180
|
_proto._rangeWOWBY = function _rangeWOWBY(temporal) {
|
|
142583
142181
|
var sow = this._weekDef.firstDayOfWeek().value();
|
|
142584
|
-
|
|
142585
142182
|
var isoDow = temporal.get(ChronoField.DAY_OF_WEEK);
|
|
142586
142183
|
var dow = MathUtil.floorMod(isoDow - sow, 7) + 1;
|
|
142587
|
-
|
|
142588
142184
|
var woy = this._localizedWeekOfYear(temporal, dow);
|
|
142589
|
-
|
|
142590
142185
|
if (woy === 0) {
|
|
142591
142186
|
return this._rangeWOWBY(IsoChronology.INSTANCE.date(temporal).minus(2, ChronoUnit.WEEKS));
|
|
142592
142187
|
}
|
|
142593
|
-
|
|
142594
142188
|
var offset = this._startOfWeekOffset(temporal.get(ChronoField.DAY_OF_YEAR), dow);
|
|
142595
|
-
|
|
142596
142189
|
var year = temporal.get(ChronoField.YEAR);
|
|
142597
142190
|
var yearLen = Year.isLeap(year) ? 366 : 365;
|
|
142598
|
-
|
|
142599
142191
|
var weekIndexOfFirstWeekNextYear = ComputedDayOfField._computeWeek(offset, yearLen + this._weekDef.minimalDaysInFirstWeek());
|
|
142600
|
-
|
|
142601
142192
|
if (woy >= weekIndexOfFirstWeekNextYear) {
|
|
142602
142193
|
return this._rangeWOWBY(IsoChronology.INSTANCE.date(temporal).plus(2, ChronoUnit.WEEKS));
|
|
142603
142194
|
}
|
|
142604
|
-
|
|
142605
142195
|
return ValueRange.of(1, weekIndexOfFirstWeekNextYear - 1);
|
|
142606
142196
|
};
|
|
142607
|
-
|
|
142608
142197
|
_proto.displayName = function displayName(locale) {
|
|
142609
142198
|
requireNonNull$2(locale, 'locale');
|
|
142610
|
-
|
|
142611
142199
|
if (this._rangeUnit === ChronoUnit.YEARS) {
|
|
142612
142200
|
return 'Week';
|
|
142613
142201
|
}
|
|
142614
|
-
|
|
142615
142202
|
return this.toString();
|
|
142616
142203
|
};
|
|
142617
|
-
|
|
142618
142204
|
_proto.toString = function toString() {
|
|
142619
142205
|
return this._name + "[" + this._weekDef.toString() + "]";
|
|
142620
142206
|
};
|
|
142621
|
-
|
|
142622
142207
|
return ComputedDayOfField;
|
|
142623
142208
|
}();
|
|
142624
142209
|
var WeekFieldsCache = new Map();
|
|
@@ -142630,54 +142215,42 @@ var WeekFields = function () {
|
|
|
142630
142215
|
return WeekFields.ofFirstDayOfWeekMinDays(firstDayOrLocale, minDays);
|
|
142631
142216
|
}
|
|
142632
142217
|
};
|
|
142633
|
-
|
|
142634
142218
|
WeekFields.ofLocale = function ofLocale(locale) {
|
|
142635
142219
|
requireNonNull$2(locale, 'locale');
|
|
142636
|
-
|
|
142637
|
-
var cldr = new
|
|
142220
|
+
Cldr.load(cldrData('supplemental/weekData.json'));
|
|
142221
|
+
var cldr = new Cldr(locale.localeString());
|
|
142638
142222
|
var worldRegion = '001';
|
|
142639
142223
|
var weekData = cldr.get('supplemental/weekData');
|
|
142640
|
-
|
|
142641
142224
|
var dow = _weekDayMap[weekData.firstDay[locale.country()]];
|
|
142642
|
-
|
|
142643
142225
|
if (!dow) {
|
|
142644
142226
|
dow = _weekDayMap[weekData.firstDay[worldRegion]];
|
|
142645
142227
|
}
|
|
142646
|
-
|
|
142647
142228
|
var minDays = weekData.minDays[locale.country()];
|
|
142648
|
-
|
|
142649
142229
|
if (!minDays) {
|
|
142650
142230
|
minDays = weekData.minDays[worldRegion];
|
|
142651
142231
|
}
|
|
142652
|
-
|
|
142653
142232
|
return WeekFields.ofFirstDayOfWeekMinDays(dow, minDays);
|
|
142654
142233
|
};
|
|
142655
|
-
|
|
142656
142234
|
WeekFields.ofFirstDayOfWeekMinDays = function ofFirstDayOfWeekMinDays(firstDayOfWeek, minimalDaysInFirstWeek) {
|
|
142657
142235
|
requireNonNull$2(firstDayOfWeek, 'firstDayOfWeek');
|
|
142658
142236
|
requireInstance$1(firstDayOfWeek, DayOfWeek, 'firstDayOfWeek');
|
|
142659
142237
|
requireNonNull$2(minimalDaysInFirstWeek, 'minimalDaysInFirstWeek');
|
|
142660
142238
|
var key = firstDayOfWeek.toString() + minimalDaysInFirstWeek;
|
|
142661
142239
|
var rules = WeekFieldsCache.get(key);
|
|
142662
|
-
|
|
142663
142240
|
if (rules == null) {
|
|
142664
142241
|
rules = new WeekFields(firstDayOfWeek, minimalDaysInFirstWeek);
|
|
142665
142242
|
WeekFieldsCache.set(key, rules);
|
|
142666
142243
|
rules = WeekFieldsCache.get(key);
|
|
142667
142244
|
}
|
|
142668
|
-
|
|
142669
142245
|
return rules;
|
|
142670
142246
|
};
|
|
142671
|
-
|
|
142672
142247
|
function WeekFields(firstDayOfWeek, minimalDaysInFirstWeek) {
|
|
142673
142248
|
requireNonNull$2(firstDayOfWeek, 'firstDayOfWeek');
|
|
142674
142249
|
requireInstance$1(firstDayOfWeek, DayOfWeek, 'firstDayOfWeek');
|
|
142675
142250
|
requireNonNull$2(minimalDaysInFirstWeek, 'minimalDaysInFirstWeek');
|
|
142676
|
-
|
|
142677
142251
|
if (minimalDaysInFirstWeek < 1 || minimalDaysInFirstWeek > 7) {
|
|
142678
142252
|
throw new IllegalArgumentException('Minimal number of days is invalid');
|
|
142679
142253
|
}
|
|
142680
|
-
|
|
142681
142254
|
this._firstDayOfWeek = firstDayOfWeek;
|
|
142682
142255
|
this._minimalDays = minimalDaysInFirstWeek;
|
|
142683
142256
|
this._dayOfWeek = ComputedDayOfField.ofDayOfWeekField(this);
|
|
@@ -142685,59 +142258,45 @@ var WeekFields = function () {
|
|
|
142685
142258
|
this._weekOfYear = ComputedDayOfField.ofWeekOfYearField(this);
|
|
142686
142259
|
this._weekOfWeekBasedYear = ComputedDayOfField.ofWeekOfWeekBasedYearField(this);
|
|
142687
142260
|
this._weekBasedYear = ComputedDayOfField.ofWeekBasedYearField(this);
|
|
142688
|
-
|
|
142261
|
+
Cldr.load(cldrData('supplemental/likelySubtags.json'));
|
|
142689
142262
|
}
|
|
142690
|
-
|
|
142691
142263
|
var _proto2 = WeekFields.prototype;
|
|
142692
|
-
|
|
142693
142264
|
_proto2.firstDayOfWeek = function firstDayOfWeek() {
|
|
142694
142265
|
return this._firstDayOfWeek;
|
|
142695
142266
|
};
|
|
142696
|
-
|
|
142697
142267
|
_proto2.minimalDaysInFirstWeek = function minimalDaysInFirstWeek() {
|
|
142698
142268
|
return this._minimalDays;
|
|
142699
142269
|
};
|
|
142700
|
-
|
|
142701
142270
|
_proto2.dayOfWeek = function dayOfWeek() {
|
|
142702
142271
|
return this._dayOfWeek;
|
|
142703
142272
|
};
|
|
142704
|
-
|
|
142705
142273
|
_proto2.weekOfMonth = function weekOfMonth() {
|
|
142706
142274
|
return this._weekOfMonth;
|
|
142707
142275
|
};
|
|
142708
|
-
|
|
142709
142276
|
_proto2.weekOfYear = function weekOfYear() {
|
|
142710
142277
|
return this._weekOfYear;
|
|
142711
142278
|
};
|
|
142712
|
-
|
|
142713
142279
|
_proto2.weekOfWeekBasedYear = function weekOfWeekBasedYear() {
|
|
142714
142280
|
return this._weekOfWeekBasedYear;
|
|
142715
142281
|
};
|
|
142716
|
-
|
|
142717
142282
|
_proto2.weekBasedYear = function weekBasedYear() {
|
|
142718
142283
|
return this._weekBasedYear;
|
|
142719
142284
|
};
|
|
142720
|
-
|
|
142721
142285
|
_proto2.equals = function equals(other) {
|
|
142722
142286
|
if (this === other) {
|
|
142723
142287
|
return true;
|
|
142724
142288
|
}
|
|
142725
|
-
|
|
142726
142289
|
if (other instanceof WeekFields) {
|
|
142727
142290
|
return this.hashCode() === other.hashCode();
|
|
142728
142291
|
}
|
|
142729
|
-
|
|
142730
142292
|
return false;
|
|
142731
142293
|
};
|
|
142732
|
-
|
|
142733
142294
|
_proto2.hashCode = function hashCode() {
|
|
142734
142295
|
return this._firstDayOfWeek.ordinal() * 7 + this._minimalDays;
|
|
142735
142296
|
};
|
|
142736
|
-
|
|
142737
142297
|
_proto2.toString = function toString() {
|
|
142738
142298
|
return "WeekFields[" + this._firstDayOfWeek + "," + this._minimalDays + "]";
|
|
142739
142299
|
};
|
|
142740
|
-
|
|
142741
142300
|
return WeekFields;
|
|
142742
142301
|
}();
|
|
142743
142302
|
function _init$2() {
|
|
@@ -142750,68 +142309,50 @@ function _init$2() {
|
|
|
142750
142309
|
* @license BSD-3-Clause (see LICENSE.md in the root directory of this source tree)
|
|
142751
142310
|
*/
|
|
142752
142311
|
var StringBuilder = _.StringBuilder;
|
|
142753
|
-
|
|
142754
142312
|
var WeekFieldsPrinterParser = function () {
|
|
142755
142313
|
function WeekFieldsPrinterParser(letter, count) {
|
|
142756
142314
|
this._letter = letter;
|
|
142757
142315
|
this._count = count;
|
|
142758
142316
|
}
|
|
142759
|
-
|
|
142760
142317
|
var _proto = WeekFieldsPrinterParser.prototype;
|
|
142761
|
-
|
|
142762
142318
|
_proto.print = function print(context, buf) {
|
|
142763
142319
|
var weekFields = WeekFields.of(context.locale());
|
|
142764
|
-
|
|
142765
142320
|
var pp = this._evaluate(weekFields);
|
|
142766
|
-
|
|
142767
142321
|
return pp.print(context, buf);
|
|
142768
142322
|
};
|
|
142769
|
-
|
|
142770
142323
|
_proto.parse = function parse(context, text, position) {
|
|
142771
142324
|
var weekFields = WeekFields.of(context.locale());
|
|
142772
|
-
|
|
142773
142325
|
var pp = this._evaluate(weekFields);
|
|
142774
|
-
|
|
142775
142326
|
return pp.parse(context, text, position);
|
|
142776
142327
|
};
|
|
142777
|
-
|
|
142778
142328
|
_proto._evaluate = function _evaluate(weekFields) {
|
|
142779
142329
|
var pp = null;
|
|
142780
|
-
|
|
142781
142330
|
switch (this._letter) {
|
|
142782
142331
|
case 'e':
|
|
142783
142332
|
pp = new DateTimeFormatterBuilder.NumberPrinterParser(weekFields.dayOfWeek(), this._count, 2, SignStyle.NOT_NEGATIVE);
|
|
142784
142333
|
break;
|
|
142785
|
-
|
|
142786
142334
|
case 'c':
|
|
142787
142335
|
pp = new DateTimeFormatterBuilder.NumberPrinterParser(weekFields.dayOfWeek(), this._count, 2, SignStyle.NOT_NEGATIVE);
|
|
142788
142336
|
break;
|
|
142789
|
-
|
|
142790
142337
|
case 'w':
|
|
142791
142338
|
pp = new DateTimeFormatterBuilder.NumberPrinterParser(weekFields.weekOfWeekBasedYear(), this._count, 2, SignStyle.NOT_NEGATIVE);
|
|
142792
142339
|
break;
|
|
142793
|
-
|
|
142794
142340
|
case 'W':
|
|
142795
142341
|
pp = new DateTimeFormatterBuilder.NumberPrinterParser(weekFields.weekOfMonth(), 1, 2, SignStyle.NOT_NEGATIVE);
|
|
142796
142342
|
break;
|
|
142797
|
-
|
|
142798
142343
|
case 'Y':
|
|
142799
142344
|
if (this._count === 2) {
|
|
142800
142345
|
pp = new DateTimeFormatterBuilder.ReducedPrinterParser(weekFields.weekBasedYear(), 2, 2, 0, DateTimeFormatterBuilder.ReducedPrinterParser.BASE_DATE);
|
|
142801
142346
|
} else {
|
|
142802
142347
|
pp = new DateTimeFormatterBuilder.NumberPrinterParser(weekFields.weekBasedYear(), this._count, 19, this._count < 4 ? SignStyle.NORMAL : SignStyle.EXCEEDS_PAD, -1);
|
|
142803
142348
|
}
|
|
142804
|
-
|
|
142805
142349
|
break;
|
|
142806
142350
|
}
|
|
142807
|
-
|
|
142808
142351
|
return pp;
|
|
142809
142352
|
};
|
|
142810
|
-
|
|
142811
142353
|
_proto.toString = function toString() {
|
|
142812
142354
|
var sb = new StringBuilder(30);
|
|
142813
142355
|
sb.append('Localized(');
|
|
142814
|
-
|
|
142815
142356
|
if (this._letter === 'Y') {
|
|
142816
142357
|
if (this._count === 1) {
|
|
142817
142358
|
sb.append('WeekBasedYear');
|
|
@@ -142828,31 +142369,24 @@ var WeekFieldsPrinterParser = function () {
|
|
|
142828
142369
|
} else if (this._letter === 'W') {
|
|
142829
142370
|
sb.append('WeekOfMonth');
|
|
142830
142371
|
}
|
|
142831
|
-
|
|
142832
142372
|
sb.append(',');
|
|
142833
142373
|
sb.append(this._count);
|
|
142834
142374
|
}
|
|
142835
|
-
|
|
142836
142375
|
sb.append(')');
|
|
142837
142376
|
return sb.toString();
|
|
142838
142377
|
};
|
|
142839
|
-
|
|
142840
142378
|
return WeekFieldsPrinterParser;
|
|
142841
142379
|
}();
|
|
142842
142380
|
|
|
142843
142381
|
var _jodaInternal$assert = _.assert,
|
|
142844
|
-
|
|
142845
|
-
|
|
142846
|
-
|
|
142382
|
+
requireNonNull$1 = _jodaInternal$assert.requireNonNull,
|
|
142383
|
+
requireInstance = _jodaInternal$assert.requireInstance;
|
|
142847
142384
|
var CldrDateTimeFormatterBuilder = function (_DateTimeFormatterBui) {
|
|
142848
142385
|
_inheritsLoose(CldrDateTimeFormatterBuilder, _DateTimeFormatterBui);
|
|
142849
|
-
|
|
142850
142386
|
function CldrDateTimeFormatterBuilder() {
|
|
142851
142387
|
return _DateTimeFormatterBui.apply(this, arguments) || this;
|
|
142852
142388
|
}
|
|
142853
|
-
|
|
142854
142389
|
var _proto = CldrDateTimeFormatterBuilder.prototype;
|
|
142855
|
-
|
|
142856
142390
|
_proto.appendText = function appendText(field, styleOrMap) {
|
|
142857
142391
|
if (styleOrMap === undefined) {
|
|
142858
142392
|
return this.appendTextField(field);
|
|
@@ -142862,29 +142396,22 @@ var CldrDateTimeFormatterBuilder = function (_DateTimeFormatterBui) {
|
|
|
142862
142396
|
return this.appendTextFieldMap(field, styleOrMap);
|
|
142863
142397
|
}
|
|
142864
142398
|
};
|
|
142865
|
-
|
|
142866
142399
|
_proto.appendTextField = function appendTextField(field) {
|
|
142867
142400
|
return this.appendTextFieldStyle(field, TextStyle.FULL);
|
|
142868
142401
|
};
|
|
142869
|
-
|
|
142870
142402
|
_proto.appendTextFieldStyle = function appendTextFieldStyle(field, textStyle) {
|
|
142871
142403
|
requireNonNull$1(field, 'field');
|
|
142872
142404
|
requireInstance(field, TemporalField, 'field');
|
|
142873
142405
|
requireNonNull$1(textStyle, 'textStyle');
|
|
142874
142406
|
requireInstance(textStyle, TextStyle, 'textStyle');
|
|
142875
|
-
|
|
142876
142407
|
this._appendInternal(new TextPrinterParser(field, textStyle, new CldrDateTimeTextProvider()));
|
|
142877
|
-
|
|
142878
142408
|
return this;
|
|
142879
142409
|
};
|
|
142880
|
-
|
|
142881
142410
|
_proto.appendTextFieldMap = function appendTextFieldMap(field, textLookup) {
|
|
142882
142411
|
requireNonNull$1(field, 'field');
|
|
142883
142412
|
requireInstance(field, ChronoField, 'field');
|
|
142884
142413
|
requireNonNull$1(textLookup, 'textLookup');
|
|
142885
|
-
|
|
142886
142414
|
var copy = _extends({}, textLookup);
|
|
142887
|
-
|
|
142888
142415
|
var map = {};
|
|
142889
142416
|
map[TextStyle.FULL] = copy;
|
|
142890
142417
|
var store = new LocaleStore(map);
|
|
@@ -142896,39 +142423,27 @@ var CldrDateTimeFormatterBuilder = function (_DateTimeFormatterBui) {
|
|
|
142896
142423
|
return store.getTextIterator(style);
|
|
142897
142424
|
}
|
|
142898
142425
|
};
|
|
142899
|
-
|
|
142900
142426
|
this._appendInternal(new TextPrinterParser(field, TextStyle.FULL, provider));
|
|
142901
|
-
|
|
142902
142427
|
return this;
|
|
142903
142428
|
};
|
|
142904
|
-
|
|
142905
142429
|
_proto.appendWeekField = function appendWeekField(field, count) {
|
|
142906
142430
|
requireNonNull$1(field, 'field');
|
|
142907
142431
|
requireNonNull$1(count, 'count');
|
|
142908
|
-
|
|
142909
142432
|
this._appendInternal(new WeekFieldsPrinterParser(field, count));
|
|
142910
|
-
|
|
142911
142433
|
return this;
|
|
142912
142434
|
};
|
|
142913
|
-
|
|
142914
142435
|
_proto.appendZoneText = function appendZoneText(textStyle) {
|
|
142915
142436
|
this._appendInternal(new CldrZoneTextPrinterParser(textStyle));
|
|
142916
|
-
|
|
142917
142437
|
return this;
|
|
142918
142438
|
};
|
|
142919
|
-
|
|
142920
142439
|
_proto.appendLocalizedOffset = function appendLocalizedOffset(textStyle) {
|
|
142921
142440
|
requireNonNull$1(textStyle, 'textStyle');
|
|
142922
|
-
|
|
142923
142441
|
if (textStyle !== TextStyle.FULL && textStyle !== TextStyle.SHORT) {
|
|
142924
142442
|
throw new IllegalArgumentException('Style must be either full or short');
|
|
142925
142443
|
}
|
|
142926
|
-
|
|
142927
142444
|
this._appendInternal(new LocalizedOffsetPrinterParser(textStyle));
|
|
142928
|
-
|
|
142929
142445
|
return this;
|
|
142930
142446
|
};
|
|
142931
|
-
|
|
142932
142447
|
return CldrDateTimeFormatterBuilder;
|
|
142933
142448
|
}(DateTimeFormatterBuilder);
|
|
142934
142449
|
|
|
@@ -142936,64 +142451,50 @@ var CldrDateTimeFormatterBuilder = function (_DateTimeFormatterBui) {
|
|
|
142936
142451
|
* @copyright (c) 2017, Philipp Thuerwaechter & Pattrick Hueper
|
|
142937
142452
|
* @license BSD-3-Clause (see LICENSE.md in the root directory of this source tree)
|
|
142938
142453
|
*/
|
|
142939
|
-
|
|
142940
142454
|
var Locale = function () {
|
|
142941
142455
|
Locale.getAvailableLocales = function getAvailableLocales() {
|
|
142942
142456
|
return new CldrDateTimeTextProvider().getAvailableLocales();
|
|
142943
142457
|
};
|
|
142944
|
-
|
|
142945
142458
|
function Locale(language, country, localeString) {
|
|
142946
142459
|
if (country === void 0) {
|
|
142947
142460
|
country = '';
|
|
142948
142461
|
}
|
|
142949
|
-
|
|
142950
142462
|
if (localeString === void 0) {
|
|
142951
142463
|
localeString = '';
|
|
142952
142464
|
}
|
|
142953
|
-
|
|
142954
142465
|
this._language = language;
|
|
142955
142466
|
this._country = country;
|
|
142956
142467
|
this._localeString = localeString;
|
|
142957
142468
|
}
|
|
142958
|
-
|
|
142959
142469
|
var _proto = Locale.prototype;
|
|
142960
|
-
|
|
142961
142470
|
_proto.language = function language() {
|
|
142962
142471
|
return this._language;
|
|
142963
142472
|
};
|
|
142964
|
-
|
|
142965
142473
|
_proto.country = function country() {
|
|
142966
142474
|
return this._country;
|
|
142967
142475
|
};
|
|
142968
|
-
|
|
142969
142476
|
_proto.localeString = function localeString() {
|
|
142970
142477
|
if (this._localeString.length > 0) {
|
|
142971
142478
|
return this._localeString;
|
|
142972
142479
|
}
|
|
142973
|
-
|
|
142974
142480
|
if (this._country.length > 0) {
|
|
142975
142481
|
return this._language + "-" + this._country;
|
|
142976
142482
|
} else {
|
|
142977
142483
|
return this._language;
|
|
142978
142484
|
}
|
|
142979
142485
|
};
|
|
142980
|
-
|
|
142981
142486
|
_proto.toString = function toString() {
|
|
142982
142487
|
return "Locale[" + this.localeString() + "]";
|
|
142983
142488
|
};
|
|
142984
|
-
|
|
142985
142489
|
_proto.equals = function equals(other) {
|
|
142986
142490
|
if (!other) {
|
|
142987
142491
|
return false;
|
|
142988
142492
|
}
|
|
142989
|
-
|
|
142990
142493
|
if (!(other instanceof Locale)) {
|
|
142991
142494
|
return false;
|
|
142992
142495
|
}
|
|
142993
|
-
|
|
142994
142496
|
return this.localeString() === other.localeString();
|
|
142995
142497
|
};
|
|
142996
|
-
|
|
142997
142498
|
return Locale;
|
|
142998
142499
|
}();
|
|
142999
142500
|
function _init$1() {
|
|
@@ -143019,26 +142520,19 @@ function _init$1() {
|
|
|
143019
142520
|
}
|
|
143020
142521
|
|
|
143021
142522
|
var requireNonNull = _.assert.requireNonNull;
|
|
143022
|
-
|
|
143023
142523
|
var LocaleDateTimeFormatter = function (_DateTimeFormatter) {
|
|
143024
142524
|
_inheritsLoose(LocaleDateTimeFormatter, _DateTimeFormatter);
|
|
143025
|
-
|
|
143026
142525
|
function LocaleDateTimeFormatter() {
|
|
143027
142526
|
return _DateTimeFormatter.apply(this, arguments) || this;
|
|
143028
142527
|
}
|
|
143029
|
-
|
|
143030
142528
|
var _proto = LocaleDateTimeFormatter.prototype;
|
|
143031
|
-
|
|
143032
142529
|
_proto.withLocale = function withLocale(locale) {
|
|
143033
142530
|
requireNonNull(locale, 'locale');
|
|
143034
|
-
|
|
143035
142531
|
if (locale.equals(this._locale)) {
|
|
143036
142532
|
return this;
|
|
143037
142533
|
}
|
|
143038
|
-
|
|
143039
142534
|
return new DateTimeFormatter(this._printerParser, locale, this._decimalStyle, this._resolverStyle, this._resolverFields, this._chrono, this._zone);
|
|
143040
142535
|
};
|
|
143041
|
-
|
|
143042
142536
|
return LocaleDateTimeFormatter;
|
|
143043
142537
|
}(DateTimeFormatter);
|
|
143044
142538
|
function _init() {
|
|
@@ -143073,24 +142567,17 @@ function _init() {
|
|
|
143073
142567
|
* @license BSD-3-Clause (see LICENSE in the root directory of this source tree)
|
|
143074
142568
|
*/
|
|
143075
142569
|
var isInit = false;
|
|
143076
|
-
|
|
143077
142570
|
function init() {
|
|
143078
142571
|
if (isInit) {
|
|
143079
142572
|
return;
|
|
143080
142573
|
}
|
|
143081
|
-
|
|
143082
142574
|
isInit = true;
|
|
143083
142575
|
_init$1();
|
|
143084
142576
|
_init$2();
|
|
143085
142577
|
_init();
|
|
143086
142578
|
}
|
|
143087
|
-
|
|
143088
142579
|
init();
|
|
143089
142580
|
|
|
143090
|
-
/*
|
|
143091
|
-
* @copyright (c) 2017, Philipp Thuerwaechter & Pattrick Hueper
|
|
143092
|
-
* @license BSD-3-Clause (see LICENSE.md in the root directory of this source tree)
|
|
143093
|
-
*/
|
|
143094
142581
|
function plug (jsJoda) {
|
|
143095
142582
|
Object.getOwnPropertyNames(CldrDateTimeFormatterBuilder.prototype).forEach(function (prop) {
|
|
143096
142583
|
if (prop !== 'constructor') {
|