@absolutejs/absolute 0.18.0 → 0.18.1

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.
@@ -1,2820 +0,0 @@
1
- /**
2
- * @license Angular v21.1.5
3
- * (c) 2010-2026 Google LLC. https://angular.dev/
4
- * License: MIT
5
- */
6
-
7
- import * as i0 from '@angular/core';
8
- import { Injectable, Optional, Inject, ɵfindLocaleData as _findLocaleData, ɵLocaleDataIndex as _LocaleDataIndex, ɵgetLocaleCurrencyCode as _getLocaleCurrencyCode, ɵgetLocalePluralCase as _getLocalePluralCase, ɵRuntimeError as _RuntimeError, ɵformatRuntimeError as _formatRuntimeError, inject, LOCALE_ID, ɵstringify as _stringify, Directive, Input, createNgModule, NgModuleRef, Host, Attribute, RendererStyleFlags2, ɵINTERNAL_APPLICATION_ERROR_HANDLER as _INTERNAL_APPLICATION_ERROR_HANDLER, ɵisPromise as _isPromise, ɵisSubscribable as _isSubscribable, Pipe, untracked, InjectionToken, DEFAULT_CURRENCY_CODE, NgModule } from '@angular/core';
9
- import { LocationStrategy, joinWithSlash, normalizeQueryParams, APP_BASE_HREF } from './_location-chunk.mjs';
10
- import { PlatformLocation } from './_platform_location-chunk.mjs';
11
- class HashLocationStrategy extends LocationStrategy {
12
- _platformLocation;
13
- _baseHref = '';
14
- _removeListenerFns = [];
15
- constructor(_platformLocation, _baseHref) {
16
- super();
17
- this._platformLocation = _platformLocation;
18
- if (_baseHref != null) {
19
- this._baseHref = _baseHref;
20
- }
21
- }
22
- ngOnDestroy() {
23
- while (this._removeListenerFns.length) {
24
- this._removeListenerFns.pop()();
25
- }
26
- }
27
- onPopState(fn) {
28
- this._removeListenerFns.push(this._platformLocation.onPopState(fn), this._platformLocation.onHashChange(fn));
29
- }
30
- getBaseHref() {
31
- return this._baseHref;
32
- }
33
- path(includeHash = false) {
34
- const path = this._platformLocation.hash ?? '#';
35
- return path.length > 0 ? path.substring(1) : path;
36
- }
37
- prepareExternalUrl(internal) {
38
- const url = joinWithSlash(this._baseHref, internal);
39
- return url.length > 0 ? `#${ url}` : url;
40
- }
41
- pushState(state, title, path, queryParams) {
42
- const url = this.prepareExternalUrl(path + normalizeQueryParams(queryParams)) || this._platformLocation.pathname;
43
- this._platformLocation.pushState(state, title, url);
44
- }
45
- replaceState(state, title, path, queryParams) {
46
- const url = this.prepareExternalUrl(path + normalizeQueryParams(queryParams)) || this._platformLocation.pathname;
47
- this._platformLocation.replaceState(state, title, url);
48
- }
49
- forward() {
50
- this._platformLocation.forward();
51
- }
52
- back() {
53
- this._platformLocation.back();
54
- }
55
- getState() {
56
- return this._platformLocation.getState();
57
- }
58
- historyGo(relativePosition = 0) {
59
- this._platformLocation.historyGo?.(relativePosition);
60
- }
61
- static ɵfac = function HashLocationStrategy_Factory(__ngFactoryType__) {
62
- return new (__ngFactoryType__ || HashLocationStrategy)(i0.ɵɵinject(PlatformLocation), i0.ɵɵinject(APP_BASE_HREF, 8));
63
- };
64
- static ɵprov = /* @__PURE__ */i0.ɵɵdefineInjectable({
65
- factory: HashLocationStrategy.ɵfac,
66
- token: HashLocationStrategy
67
- });
68
- }
69
- (() => {
70
- (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HashLocationStrategy, [{
71
- type: Injectable
72
- }], () => [{
73
- type: PlatformLocation
74
- }, {
75
- decorators: [{
76
- type: Optional
77
- }, {
78
- args: [APP_BASE_HREF],
79
- type: Inject
80
- }],
81
- type: undefined
82
- }], null);
83
- })();
84
- const CURRENCIES_EN = {
85
- "ADP": [undefined, undefined, 0],
86
- "AFN": [undefined, "؋", 0],
87
- "ALL": [undefined, undefined, 0],
88
- "AMD": [undefined, "֏", 2],
89
- "AOA": [undefined, "Kz"],
90
- "ARS": [undefined, "$"],
91
- "AUD": ["A$", "$"],
92
- "AZN": [undefined, "₼"],
93
- "BAM": [undefined, "KM"],
94
- "BBD": [undefined, "$"],
95
- "BDT": [undefined, "৳"],
96
- "BHD": [undefined, undefined, 3],
97
- "BIF": [undefined, undefined, 0],
98
- "BMD": [undefined, "$"],
99
- "BND": [undefined, "$"],
100
- "BOB": [undefined, "Bs"],
101
- "BRL": ["R$"],
102
- "BSD": [undefined, "$"],
103
- "BWP": [undefined, "P"],
104
- "BYN": [undefined, undefined, 2],
105
- "BYR": [undefined, undefined, 0],
106
- "BZD": [undefined, "$"],
107
- "CAD": ["CA$", "$", 2],
108
- "CHF": [undefined, undefined, 2],
109
- "CLF": [undefined, undefined, 4],
110
- "CLP": [undefined, "$", 0],
111
- "CNY": ["CN¥", "¥"],
112
- "COP": [undefined, "$", 2],
113
- "CRC": [undefined, "₡", 2],
114
- "CUC": [undefined, "$"],
115
- "CUP": [undefined, "$"],
116
- "CZK": [undefined, "Kč", 2],
117
- "DJF": [undefined, undefined, 0],
118
- "DKK": [undefined, "kr", 2],
119
- "DOP": [undefined, "$"],
120
- "EGP": [undefined, "E£"],
121
- "ESP": [undefined, "₧", 0],
122
- "EUR": ["€"],
123
- "FJD": [undefined, "$"],
124
- "FKP": [undefined, "£"],
125
- "GBP": ["£"],
126
- "GEL": [undefined, "₾"],
127
- "GHS": [undefined, "GH₵"],
128
- "GIP": [undefined, "£"],
129
- "GNF": [undefined, "FG", 0],
130
- "GTQ": [undefined, "Q"],
131
- "GYD": [undefined, "$", 2],
132
- "HKD": ["HK$", "$"],
133
- "HNL": [undefined, "L"],
134
- "HRK": [undefined, "kn"],
135
- "HUF": [undefined, "Ft", 2],
136
- "IDR": [undefined, "Rp", 2],
137
- "ILS": ["₪"],
138
- "INR": ["₹"],
139
- "IQD": [undefined, undefined, 0],
140
- "IRR": [undefined, undefined, 0],
141
- "ISK": [undefined, "kr", 0],
142
- "ITL": [undefined, undefined, 0],
143
- "JMD": [undefined, "$"],
144
- "JOD": [undefined, undefined, 3],
145
- "JPY": ["¥", undefined, 0],
146
- "KGS": [undefined, "⃀"],
147
- "KHR": [undefined, "៛"],
148
- "KMF": [undefined, "CF", 0],
149
- "KPW": [undefined, "₩", 0],
150
- "KRW": ["₩", undefined, 0],
151
- "KWD": [undefined, undefined, 3],
152
- "KYD": [undefined, "$"],
153
- "KZT": [undefined, "₸"],
154
- "LAK": [undefined, "₭", 0],
155
- "LBP": [undefined, "L£", 0],
156
- "LKR": [undefined, "Rs"],
157
- "LRD": [undefined, "$"],
158
- "LTL": [undefined, "Lt"],
159
- "LUF": [undefined, undefined, 0],
160
- "LVL": [undefined, "Ls"],
161
- "LYD": [undefined, undefined, 3],
162
- "MGA": [undefined, "Ar", 0],
163
- "MGF": [undefined, undefined, 0],
164
- "MMK": [undefined, "K", 0],
165
- "MNT": [undefined, "₮", 2],
166
- "MRO": [undefined, undefined, 0],
167
- "MUR": [undefined, "Rs", 2],
168
- "MXN": ["MX$", "$"],
169
- "MYR": [undefined, "RM"],
170
- "NAD": [undefined, "$"],
171
- "NGN": [undefined, "₦"],
172
- "NIO": [undefined, "C$"],
173
- "NOK": [undefined, "kr", 2],
174
- "NPR": [undefined, "Rs"],
175
- "NZD": ["NZ$", "$"],
176
- "OMR": [undefined, undefined, 3],
177
- "PHP": ["₱"],
178
- "PKR": [undefined, "Rs", 2],
179
- "PLN": [undefined, "zł"],
180
- "PYG": [undefined, "₲", 0],
181
- "RON": [undefined, "lei"],
182
- "RSD": [undefined, undefined, 0],
183
- "RUB": [undefined, "₽"],
184
- "RWF": [undefined, "RF", 0],
185
- "SBD": [undefined, "$"],
186
- "SEK": [undefined, "kr", 2],
187
- "SGD": [undefined, "$"],
188
- "SHP": [undefined, "£"],
189
- "SLE": [undefined, undefined, 2],
190
- "SLL": [undefined, undefined, 0],
191
- "SOS": [undefined, undefined, 0],
192
- "SRD": [undefined, "$"],
193
- "SSP": [undefined, "£"],
194
- "STD": [undefined, undefined, 0],
195
- "STN": [undefined, "Db"],
196
- "SYP": [undefined, "£", 0],
197
- "THB": [undefined, "฿"],
198
- "TMM": [undefined, undefined, 0],
199
- "TND": [undefined, undefined, 3],
200
- "TOP": [undefined, "T$"],
201
- "TRL": [undefined, undefined, 0],
202
- "TRY": [undefined, "₺"],
203
- "TTD": [undefined, "$"],
204
- "TWD": ["NT$", "$", 2],
205
- "TZS": [undefined, undefined, 2],
206
- "UAH": [undefined, "₴"],
207
- "UGX": [undefined, undefined, 0],
208
- "USD": ["$"],
209
- "UYI": [undefined, undefined, 0],
210
- "UYU": [undefined, "$"],
211
- "UYW": [undefined, undefined, 4],
212
- "UZS": [undefined, undefined, 2],
213
- "VEF": [undefined, "Bs", 2],
214
- "VND": ["₫", undefined, 0],
215
- "VUV": [undefined, undefined, 0],
216
- "XAF": ["FCFA", undefined, 0],
217
- "XCD": ["EC$", "$"],
218
- "XCG": ["Cg."],
219
- "XOF": ["F CFA", undefined, 0],
220
- "XPF": ["CFPF", undefined, 0],
221
- "XXX": ["¤"],
222
- "YER": [undefined, undefined, 0],
223
- "ZAR": [undefined, "R"],
224
- "ZMK": [undefined, undefined, 0],
225
- "ZMW": [undefined, "ZK"],
226
- "ZWD": [undefined, undefined, 0]
227
- };
228
- let NumberFormatStyle;
229
- (function (NumberFormatStyle) {
230
- NumberFormatStyle[NumberFormatStyle["Decimal"] = 0] = "Decimal";
231
- NumberFormatStyle[NumberFormatStyle["Percent"] = 1] = "Percent";
232
- NumberFormatStyle[NumberFormatStyle["Currency"] = 2] = "Currency";
233
- NumberFormatStyle[NumberFormatStyle["Scientific"] = 3] = "Scientific";
234
- })(NumberFormatStyle || (NumberFormatStyle = {}));
235
- let Plural;
236
- (function (Plural) {
237
- Plural[Plural["Zero"] = 0] = "Zero";
238
- Plural[Plural["One"] = 1] = "One";
239
- Plural[Plural["Two"] = 2] = "Two";
240
- Plural[Plural["Few"] = 3] = "Few";
241
- Plural[Plural["Many"] = 4] = "Many";
242
- Plural[Plural["Other"] = 5] = "Other";
243
- })(Plural || (Plural = {}));
244
- let FormStyle;
245
- (function (FormStyle) {
246
- FormStyle[FormStyle["Format"] = 0] = "Format";
247
- FormStyle[FormStyle["Standalone"] = 1] = "Standalone";
248
- })(FormStyle || (FormStyle = {}));
249
- let TranslationWidth;
250
- (function (TranslationWidth) {
251
- TranslationWidth[TranslationWidth["Narrow"] = 0] = "Narrow";
252
- TranslationWidth[TranslationWidth["Abbreviated"] = 1] = "Abbreviated";
253
- TranslationWidth[TranslationWidth["Wide"] = 2] = "Wide";
254
- TranslationWidth[TranslationWidth["Short"] = 3] = "Short";
255
- })(TranslationWidth || (TranslationWidth = {}));
256
- let FormatWidth;
257
- (function (FormatWidth) {
258
- FormatWidth[FormatWidth["Short"] = 0] = "Short";
259
- FormatWidth[FormatWidth["Medium"] = 1] = "Medium";
260
- FormatWidth[FormatWidth["Long"] = 2] = "Long";
261
- FormatWidth[FormatWidth["Full"] = 3] = "Full";
262
- })(FormatWidth || (FormatWidth = {}));
263
- const NumberSymbol = {
264
- CurrencyDecimal: 12,
265
- CurrencyGroup: 13,
266
- Decimal: 0,
267
- Exponential: 6,
268
- Group: 1,
269
- Infinity: 9,
270
- List: 2,
271
- MinusSign: 5,
272
- NaN: 10,
273
- PercentSign: 3,
274
- PerMille: 8,
275
- PlusSign: 4,
276
- SuperscriptingExponent: 7,
277
- TimeSeparator: 11
278
- };
279
- let WeekDay;
280
- (function (WeekDay) {
281
- WeekDay[WeekDay["Sunday"] = 0] = "Sunday";
282
- WeekDay[WeekDay["Monday"] = 1] = "Monday";
283
- WeekDay[WeekDay["Tuesday"] = 2] = "Tuesday";
284
- WeekDay[WeekDay["Wednesday"] = 3] = "Wednesday";
285
- WeekDay[WeekDay["Thursday"] = 4] = "Thursday";
286
- WeekDay[WeekDay["Friday"] = 5] = "Friday";
287
- WeekDay[WeekDay["Saturday"] = 6] = "Saturday";
288
- })(WeekDay || (WeekDay = {}));
289
- function getLocaleId(locale) {
290
- return _findLocaleData(locale)[_LocaleDataIndex.LocaleId];
291
- }
292
- function getLocaleDayPeriods(locale, formStyle, width) {
293
- const data = _findLocaleData(locale);
294
- const amPmData = [data[_LocaleDataIndex.DayPeriodsFormat], data[_LocaleDataIndex.DayPeriodsStandalone]];
295
- const amPm = getLastDefinedValue(amPmData, formStyle);
296
- return getLastDefinedValue(amPm, width);
297
- }
298
- function getLocaleDayNames(locale, formStyle, width) {
299
- const data = _findLocaleData(locale);
300
- const daysData = [data[_LocaleDataIndex.DaysFormat], data[_LocaleDataIndex.DaysStandalone]];
301
- const days = getLastDefinedValue(daysData, formStyle);
302
- return getLastDefinedValue(days, width);
303
- }
304
- function getLocaleMonthNames(locale, formStyle, width) {
305
- const data = _findLocaleData(locale);
306
- const monthsData = [data[_LocaleDataIndex.MonthsFormat], data[_LocaleDataIndex.MonthsStandalone]];
307
- const months = getLastDefinedValue(monthsData, formStyle);
308
- return getLastDefinedValue(months, width);
309
- }
310
- function getLocaleEraNames(locale, width) {
311
- const data = _findLocaleData(locale);
312
- const erasData = data[_LocaleDataIndex.Eras];
313
- return getLastDefinedValue(erasData, width);
314
- }
315
- function getLocaleFirstDayOfWeek(locale) {
316
- const data = _findLocaleData(locale);
317
- return data[_LocaleDataIndex.FirstDayOfWeek];
318
- }
319
- function getLocaleWeekEndRange(locale) {
320
- const data = _findLocaleData(locale);
321
- return data[_LocaleDataIndex.WeekendRange];
322
- }
323
- function getLocaleDateFormat(locale, width) {
324
- const data = _findLocaleData(locale);
325
- return getLastDefinedValue(data[_LocaleDataIndex.DateFormat], width);
326
- }
327
- function getLocaleTimeFormat(locale, width) {
328
- const data = _findLocaleData(locale);
329
- return getLastDefinedValue(data[_LocaleDataIndex.TimeFormat], width);
330
- }
331
- function getLocaleDateTimeFormat(locale, width) {
332
- const data = _findLocaleData(locale);
333
- const dateTimeFormatData = data[_LocaleDataIndex.DateTimeFormat];
334
- return getLastDefinedValue(dateTimeFormatData, width);
335
- }
336
- function getLocaleNumberSymbol(locale, symbol) {
337
- const data = _findLocaleData(locale);
338
- const res = data[_LocaleDataIndex.NumberSymbols][symbol];
339
- if (typeof res === 'undefined') {
340
- if (symbol === NumberSymbol.CurrencyDecimal) {
341
- return data[_LocaleDataIndex.NumberSymbols][NumberSymbol.Decimal];
342
- } else if (symbol === NumberSymbol.CurrencyGroup) {
343
- return data[_LocaleDataIndex.NumberSymbols][NumberSymbol.Group];
344
- }
345
- }
346
- return res;
347
- }
348
- function getLocaleNumberFormat(locale, type) {
349
- const data = _findLocaleData(locale);
350
- return data[_LocaleDataIndex.NumberFormats][type];
351
- }
352
- function getLocaleCurrencySymbol(locale) {
353
- const data = _findLocaleData(locale);
354
- return data[_LocaleDataIndex.CurrencySymbol] || null;
355
- }
356
- function getLocaleCurrencyName(locale) {
357
- const data = _findLocaleData(locale);
358
- return data[_LocaleDataIndex.CurrencyName] || null;
359
- }
360
- function getLocaleCurrencyCode(locale) {
361
- return _getLocaleCurrencyCode(locale);
362
- }
363
- function getLocaleCurrencies(locale) {
364
- const data = _findLocaleData(locale);
365
- return data[_LocaleDataIndex.Currencies];
366
- }
367
- const getLocalePluralCase = _getLocalePluralCase;
368
- function checkFullData(data) {
369
- if (!data[_LocaleDataIndex.ExtraData]) {
370
- throw new _RuntimeError(2303, ngDevMode && `Missing extra locale data for the locale "${data[_LocaleDataIndex.LocaleId]}". Use "registerLocaleData" to load new data. See the "I18n guide" on angular.io to know more.`);
371
- }
372
- }
373
- function getLocaleExtraDayPeriodRules(locale) {
374
- const data = _findLocaleData(locale);
375
- checkFullData(data);
376
- const rules = data[_LocaleDataIndex.ExtraData][2] || [];
377
- return rules.map(rule => {
378
- if (typeof rule === 'string') {
379
- return extractTime(rule);
380
- }
381
- return [extractTime(rule[0]), extractTime(rule[1])];
382
- });
383
- }
384
- function getLocaleExtraDayPeriods(locale, formStyle, width) {
385
- const data = _findLocaleData(locale);
386
- checkFullData(data);
387
- const dayPeriodsData = [data[_LocaleDataIndex.ExtraData][0], data[_LocaleDataIndex.ExtraData][1]];
388
- const dayPeriods = getLastDefinedValue(dayPeriodsData, formStyle) || [];
389
- return getLastDefinedValue(dayPeriods, width) || [];
390
- }
391
- function getLocaleDirection(locale) {
392
- const data = _findLocaleData(locale);
393
- return data[_LocaleDataIndex.Directionality];
394
- }
395
- function getLastDefinedValue(data, index) {
396
- for (let i = index; i > -1; i--) {
397
- if (typeof data[i] !== 'undefined') {
398
- return data[i];
399
- }
400
- }
401
- throw new _RuntimeError(2304, ngDevMode && 'Locale data API: locale data undefined');
402
- }
403
- function extractTime(time) {
404
- const [h, m] = time.split(':');
405
- return {
406
- hours: +h,
407
- minutes: +m
408
- };
409
- }
410
- function getCurrencySymbol(code, format, locale = 'en') {
411
- const currency = getLocaleCurrencies(locale)[code] || CURRENCIES_EN[code] || [];
412
- const symbolNarrow = currency[1];
413
- if (format === 'narrow' && typeof symbolNarrow === 'string') {
414
- return symbolNarrow;
415
- }
416
- return currency[0] || code;
417
- }
418
- const DEFAULT_NB_OF_CURRENCY_DIGITS = 2;
419
- function getNumberOfCurrencyDigits(code) {
420
- let digits;
421
- const currency = CURRENCIES_EN[code];
422
- if (currency) {
423
- digits = currency[2];
424
- }
425
- return typeof digits === 'number' ? digits : DEFAULT_NB_OF_CURRENCY_DIGITS;
426
- }
427
- const ISO8601_DATE_REGEX = /^(\d{4,})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/;
428
- const NAMED_FORMATS = {};
429
- const DATE_FORMATS_SPLIT = /((?:[^BEGHLMOSWYZabcdhmswyz']+)|(?:'(?:[^']|'')*')|(?:G{1,5}|y{1,4}|Y{1,4}|M{1,5}|L{1,5}|w{1,2}|W{1}|d{1,2}|E{1,6}|c{1,6}|a{1,5}|b{1,5}|B{1,5}|h{1,2}|H{1,2}|m{1,2}|s{1,2}|S{1,3}|z{1,4}|Z{1,5}|O{1,4}))([\s\S]*)/;
430
- function formatDate(value, format, locale, timezone) {
431
- let date = toDate(value);
432
- const namedFormat = getNamedFormat(locale, format);
433
- format = namedFormat || format;
434
- let parts = [];
435
- let match;
436
- while (format) {
437
- match = DATE_FORMATS_SPLIT.exec(format);
438
- if (match) {
439
- parts = parts.concat(match.slice(1));
440
- const part = parts.pop();
441
- if (!part) {
442
- break;
443
- }
444
- format = part;
445
- } else {
446
- parts.push(format);
447
- break;
448
- }
449
- }
450
- if (typeof ngDevMode === 'undefined' || ngDevMode) {
451
- assertValidDateFormat(parts);
452
- }
453
- let dateTimezoneOffset = date.getTimezoneOffset();
454
- if (timezone) {
455
- dateTimezoneOffset = timezoneToOffset(timezone, dateTimezoneOffset);
456
- date = convertTimezoneToLocal(date, timezone);
457
- }
458
- let text = '';
459
- parts.forEach(value => {
460
- const dateFormatter = getDateFormatter(value);
461
- text += dateFormatter ? dateFormatter(date, locale, dateTimezoneOffset) : value === "''" ? "'" : value.replace(/(^'|'$)/g, '').replace(/''/g, "'");
462
- });
463
- return text;
464
- }
465
- function assertValidDateFormat(parts) {
466
- if (parts.some(part => /^Y+$/.test(part)) && !parts.some(part => /^w+$/.test(part))) {
467
- const message = `Suspicious use of week-based year "Y" in date pattern "${parts.join('')}". Did you mean to use calendar year "y" instead?`;
468
- if (parts.length === 1) {
469
- console.error(_formatRuntimeError(2300, message));
470
- } else {
471
- throw new _RuntimeError(2300, message);
472
- }
473
- }
474
- }
475
- function createDate(year, month, date) {
476
- const newDate = new Date(0);
477
- newDate.setFullYear(year, month, date);
478
- newDate.setHours(0, 0, 0);
479
- return newDate;
480
- }
481
- function getNamedFormat(locale, format) {
482
- const localeId = getLocaleId(locale);
483
- NAMED_FORMATS[localeId] ??= {};
484
- if (NAMED_FORMATS[localeId][format]) {
485
- return NAMED_FORMATS[localeId][format];
486
- }
487
- let formatValue = '';
488
- switch (format) {
489
- case 'shortDate':
490
- formatValue = getLocaleDateFormat(locale, FormatWidth.Short);
491
- break;
492
- case 'mediumDate':
493
- formatValue = getLocaleDateFormat(locale, FormatWidth.Medium);
494
- break;
495
- case 'longDate':
496
- formatValue = getLocaleDateFormat(locale, FormatWidth.Long);
497
- break;
498
- case 'fullDate':
499
- formatValue = getLocaleDateFormat(locale, FormatWidth.Full);
500
- break;
501
- case 'shortTime':
502
- formatValue = getLocaleTimeFormat(locale, FormatWidth.Short);
503
- break;
504
- case 'mediumTime':
505
- formatValue = getLocaleTimeFormat(locale, FormatWidth.Medium);
506
- break;
507
- case 'longTime':
508
- formatValue = getLocaleTimeFormat(locale, FormatWidth.Long);
509
- break;
510
- case 'fullTime':
511
- formatValue = getLocaleTimeFormat(locale, FormatWidth.Full);
512
- break;
513
- case 'short':
514
- const shortTime = getNamedFormat(locale, 'shortTime');
515
- const shortDate = getNamedFormat(locale, 'shortDate');
516
- formatValue = formatDateTime(getLocaleDateTimeFormat(locale, FormatWidth.Short), [shortTime, shortDate]);
517
- break;
518
- case 'medium':
519
- const mediumTime = getNamedFormat(locale, 'mediumTime');
520
- const mediumDate = getNamedFormat(locale, 'mediumDate');
521
- formatValue = formatDateTime(getLocaleDateTimeFormat(locale, FormatWidth.Medium), [mediumTime, mediumDate]);
522
- break;
523
- case 'long':
524
- const longTime = getNamedFormat(locale, 'longTime');
525
- const longDate = getNamedFormat(locale, 'longDate');
526
- formatValue = formatDateTime(getLocaleDateTimeFormat(locale, FormatWidth.Long), [longTime, longDate]);
527
- break;
528
- case 'full':
529
- const fullTime = getNamedFormat(locale, 'fullTime');
530
- const fullDate = getNamedFormat(locale, 'fullDate');
531
- formatValue = formatDateTime(getLocaleDateTimeFormat(locale, FormatWidth.Full), [fullTime, fullDate]);
532
- break;
533
- }
534
- if (formatValue) {
535
- NAMED_FORMATS[localeId][format] = formatValue;
536
- }
537
- return formatValue;
538
- }
539
- function formatDateTime(str, opt_values) {
540
- if (opt_values) {
541
- str = str.replace(/\{([^}]+)}/g, (match, key) => opt_values != null && key in opt_values ? opt_values[key] : match);
542
- }
543
- return str;
544
- }
545
- function padNumber(num, digits, minusSign = '-', trim, negWrap) {
546
- let neg = '';
547
- if (num < 0 || negWrap && num <= 0) {
548
- if (negWrap) {
549
- num = -num + 1;
550
- } else {
551
- num = -num;
552
- neg = minusSign;
553
- }
554
- }
555
- let strNum = String(num);
556
- while (strNum.length < digits) {
557
- strNum = `0${ strNum}`;
558
- }
559
- if (trim) {
560
- strNum = strNum.slice(strNum.length - digits);
561
- }
562
- return neg + strNum;
563
- }
564
- function formatFractionalSeconds(milliseconds, digits) {
565
- const strMs = padNumber(milliseconds, 3);
566
- return strMs.substring(0, digits);
567
- }
568
- function dateGetter(name, size, offset = 0, trim = false, negWrap = false) {
569
- return function (date, locale) {
570
- let part = getDatePart(name, date);
571
- if (offset > 0 || part > -offset) {
572
- part += offset;
573
- }
574
- if (name === 3) {
575
- if (part === 0 && offset === -12) {
576
- part = 12;
577
- }
578
- } else if (name === 6) {
579
- return formatFractionalSeconds(part, size);
580
- }
581
- const localeMinus = getLocaleNumberSymbol(locale, NumberSymbol.MinusSign);
582
- return padNumber(part, size, localeMinus, trim, negWrap);
583
- };
584
- }
585
- function getDatePart(part, date) {
586
- switch (part) {
587
- case 0:
588
- return date.getFullYear();
589
- case 1:
590
- return date.getMonth();
591
- case 2:
592
- return date.getDate();
593
- case 3:
594
- return date.getHours();
595
- case 4:
596
- return date.getMinutes();
597
- case 5:
598
- return date.getSeconds();
599
- case 6:
600
- return date.getMilliseconds();
601
- case 7:
602
- return date.getDay();
603
- default:
604
- throw new _RuntimeError(2301, ngDevMode && `Unknown DateType value "${part}".`);
605
- }
606
- }
607
- function dateStrGetter(name, width, form = FormStyle.Format, extended = false) {
608
- return function (date, locale) {
609
- return getDateTranslation(date, locale, name, width, form, extended);
610
- };
611
- }
612
- function getDateTranslation(date, locale, name, width, form, extended) {
613
- switch (name) {
614
- case 2:
615
- return getLocaleMonthNames(locale, form, width)[date.getMonth()];
616
- case 1:
617
- return getLocaleDayNames(locale, form, width)[date.getDay()];
618
- case 0:
619
- const currentHours = date.getHours();
620
- const currentMinutes = date.getMinutes();
621
- if (extended) {
622
- const rules = getLocaleExtraDayPeriodRules(locale);
623
- const dayPeriods = getLocaleExtraDayPeriods(locale, form, width);
624
- const index = rules.findIndex(rule => {
625
- if (Array.isArray(rule)) {
626
- const [from, to] = rule;
627
- const afterFrom = currentHours >= from.hours && currentMinutes >= from.minutes;
628
- const beforeTo = currentHours < to.hours || currentHours === to.hours && currentMinutes < to.minutes;
629
- if (from.hours < to.hours) {
630
- if (afterFrom && beforeTo) {
631
- return true;
632
- }
633
- } else if (afterFrom || beforeTo) {
634
- return true;
635
- }
636
- } else {
637
- if (rule.hours === currentHours && rule.minutes === currentMinutes) {
638
- return true;
639
- }
640
- }
641
- return false;
642
- });
643
- if (index !== -1) {
644
- return dayPeriods[index];
645
- }
646
- }
647
- return getLocaleDayPeriods(locale, form, width)[currentHours < 12 ? 0 : 1];
648
- case 3:
649
- return getLocaleEraNames(locale, width)[date.getFullYear() <= 0 ? 0 : 1];
650
- default:
651
- const unexpected = name;
652
- throw new _RuntimeError(2302, ngDevMode && `unexpected translation type ${unexpected}`);
653
- }
654
- }
655
- function timeZoneGetter(width) {
656
- return function (date, locale, offset) {
657
- const zone = -1 * offset;
658
- const minusSign = getLocaleNumberSymbol(locale, NumberSymbol.MinusSign);
659
- const hours = zone > 0 ? Math.floor(zone / 60) : Math.ceil(zone / 60);
660
- switch (width) {
661
- case 0:
662
- return (zone >= 0 ? '+' : '') + padNumber(hours, 2, minusSign) + padNumber(Math.abs(zone % 60), 2, minusSign);
663
- case 1:
664
- return `GMT${ zone >= 0 ? '+' : '' }${padNumber(hours, 1, minusSign)}`;
665
- case 2:
666
- return `GMT${ zone >= 0 ? '+' : '' }${padNumber(hours, 2, minusSign) }:${ padNumber(Math.abs(zone % 60), 2, minusSign)}`;
667
- case 3:
668
- if (offset === 0) {
669
- return 'Z';
670
- }
671
- return `${(zone >= 0 ? '+' : '') + padNumber(hours, 2, minusSign) }:${ padNumber(Math.abs(zone % 60), 2, minusSign)}`;
672
-
673
- default:
674
- throw new _RuntimeError(2310, ngDevMode && `Unknown zone width "${width}"`);
675
- }
676
- };
677
- }
678
- const JANUARY = 0;
679
- const THURSDAY = 4;
680
- function getFirstThursdayOfYear(year) {
681
- const firstDayOfYear = createDate(year, JANUARY, 1).getDay();
682
- return createDate(year, 0, 1 + (firstDayOfYear <= THURSDAY ? THURSDAY : THURSDAY + 7) - firstDayOfYear);
683
- }
684
- function getThursdayThisIsoWeek(datetime) {
685
- const currentDay = datetime.getDay();
686
- const deltaToThursday = currentDay === 0 ? -3 : THURSDAY - currentDay;
687
- return createDate(datetime.getFullYear(), datetime.getMonth(), datetime.getDate() + deltaToThursday);
688
- }
689
- function weekGetter(size, monthBased = false) {
690
- return function (date, locale) {
691
- let result;
692
- if (monthBased) {
693
- const nbDaysBefore1stDayOfMonth = new Date(date.getFullYear(), date.getMonth(), 1).getDay() - 1;
694
- const today = date.getDate();
695
- result = 1 + Math.floor((today + nbDaysBefore1stDayOfMonth) / 7);
696
- } else {
697
- const thisThurs = getThursdayThisIsoWeek(date);
698
- const firstThurs = getFirstThursdayOfYear(thisThurs.getFullYear());
699
- const diff = thisThurs.getTime() - firstThurs.getTime();
700
- result = 1 + Math.round(diff / 6.048e8);
701
- }
702
- return padNumber(result, size, getLocaleNumberSymbol(locale, NumberSymbol.MinusSign));
703
- };
704
- }
705
- function weekNumberingYearGetter(size, trim = false) {
706
- return function (date, locale) {
707
- const thisThurs = getThursdayThisIsoWeek(date);
708
- const weekNumberingYear = thisThurs.getFullYear();
709
- return padNumber(weekNumberingYear, size, getLocaleNumberSymbol(locale, NumberSymbol.MinusSign), trim);
710
- };
711
- }
712
- const DATE_FORMATS = {};
713
- function getDateFormatter(format) {
714
- if (DATE_FORMATS[format]) {
715
- return DATE_FORMATS[format];
716
- }
717
- let formatter;
718
- switch (format) {
719
- case 'G':
720
- case 'GG':
721
- case 'GGG':
722
- formatter = dateStrGetter(3, TranslationWidth.Abbreviated);
723
- break;
724
- case 'GGGG':
725
- formatter = dateStrGetter(3, TranslationWidth.Wide);
726
- break;
727
- case 'GGGGG':
728
- formatter = dateStrGetter(3, TranslationWidth.Narrow);
729
- break;
730
- case 'y':
731
- formatter = dateGetter(0, 1, 0, false, true);
732
- break;
733
- case 'yy':
734
- formatter = dateGetter(0, 2, 0, true, true);
735
- break;
736
- case 'yyy':
737
- formatter = dateGetter(0, 3, 0, false, true);
738
- break;
739
- case 'yyyy':
740
- formatter = dateGetter(0, 4, 0, false, true);
741
- break;
742
- case 'Y':
743
- formatter = weekNumberingYearGetter(1);
744
- break;
745
- case 'YY':
746
- formatter = weekNumberingYearGetter(2, true);
747
- break;
748
- case 'YYY':
749
- formatter = weekNumberingYearGetter(3);
750
- break;
751
- case 'YYYY':
752
- formatter = weekNumberingYearGetter(4);
753
- break;
754
- case 'M':
755
- case 'L':
756
- formatter = dateGetter(1, 1, 1);
757
- break;
758
- case 'MM':
759
- case 'LL':
760
- formatter = dateGetter(1, 2, 1);
761
- break;
762
- case 'MMM':
763
- formatter = dateStrGetter(2, TranslationWidth.Abbreviated);
764
- break;
765
- case 'MMMM':
766
- formatter = dateStrGetter(2, TranslationWidth.Wide);
767
- break;
768
- case 'MMMMM':
769
- formatter = dateStrGetter(2, TranslationWidth.Narrow);
770
- break;
771
- case 'LLL':
772
- formatter = dateStrGetter(2, TranslationWidth.Abbreviated, FormStyle.Standalone);
773
- break;
774
- case 'LLLL':
775
- formatter = dateStrGetter(2, TranslationWidth.Wide, FormStyle.Standalone);
776
- break;
777
- case 'LLLLL':
778
- formatter = dateStrGetter(2, TranslationWidth.Narrow, FormStyle.Standalone);
779
- break;
780
- case 'w':
781
- formatter = weekGetter(1);
782
- break;
783
- case 'ww':
784
- formatter = weekGetter(2);
785
- break;
786
- case 'W':
787
- formatter = weekGetter(1, true);
788
- break;
789
- case 'd':
790
- formatter = dateGetter(2, 1);
791
- break;
792
- case 'dd':
793
- formatter = dateGetter(2, 2);
794
- break;
795
- case 'c':
796
- case 'cc':
797
- formatter = dateGetter(7, 1);
798
- break;
799
- case 'ccc':
800
- formatter = dateStrGetter(1, TranslationWidth.Abbreviated, FormStyle.Standalone);
801
- break;
802
- case 'cccc':
803
- formatter = dateStrGetter(1, TranslationWidth.Wide, FormStyle.Standalone);
804
- break;
805
- case 'ccccc':
806
- formatter = dateStrGetter(1, TranslationWidth.Narrow, FormStyle.Standalone);
807
- break;
808
- case 'cccccc':
809
- formatter = dateStrGetter(1, TranslationWidth.Short, FormStyle.Standalone);
810
- break;
811
- case 'E':
812
- case 'EE':
813
- case 'EEE':
814
- formatter = dateStrGetter(1, TranslationWidth.Abbreviated);
815
- break;
816
- case 'EEEE':
817
- formatter = dateStrGetter(1, TranslationWidth.Wide);
818
- break;
819
- case 'EEEEE':
820
- formatter = dateStrGetter(1, TranslationWidth.Narrow);
821
- break;
822
- case 'EEEEEE':
823
- formatter = dateStrGetter(1, TranslationWidth.Short);
824
- break;
825
- case 'a':
826
- case 'aa':
827
- case 'aaa':
828
- formatter = dateStrGetter(0, TranslationWidth.Abbreviated);
829
- break;
830
- case 'aaaa':
831
- formatter = dateStrGetter(0, TranslationWidth.Wide);
832
- break;
833
- case 'aaaaa':
834
- formatter = dateStrGetter(0, TranslationWidth.Narrow);
835
- break;
836
- case 'b':
837
- case 'bb':
838
- case 'bbb':
839
- formatter = dateStrGetter(0, TranslationWidth.Abbreviated, FormStyle.Standalone, true);
840
- break;
841
- case 'bbbb':
842
- formatter = dateStrGetter(0, TranslationWidth.Wide, FormStyle.Standalone, true);
843
- break;
844
- case 'bbbbb':
845
- formatter = dateStrGetter(0, TranslationWidth.Narrow, FormStyle.Standalone, true);
846
- break;
847
- case 'B':
848
- case 'BB':
849
- case 'BBB':
850
- formatter = dateStrGetter(0, TranslationWidth.Abbreviated, FormStyle.Format, true);
851
- break;
852
- case 'BBBB':
853
- formatter = dateStrGetter(0, TranslationWidth.Wide, FormStyle.Format, true);
854
- break;
855
- case 'BBBBB':
856
- formatter = dateStrGetter(0, TranslationWidth.Narrow, FormStyle.Format, true);
857
- break;
858
- case 'h':
859
- formatter = dateGetter(3, 1, -12);
860
- break;
861
- case 'hh':
862
- formatter = dateGetter(3, 2, -12);
863
- break;
864
- case 'H':
865
- formatter = dateGetter(3, 1);
866
- break;
867
- case 'HH':
868
- formatter = dateGetter(3, 2);
869
- break;
870
- case 'm':
871
- formatter = dateGetter(4, 1);
872
- break;
873
- case 'mm':
874
- formatter = dateGetter(4, 2);
875
- break;
876
- case 's':
877
- formatter = dateGetter(5, 1);
878
- break;
879
- case 'ss':
880
- formatter = dateGetter(5, 2);
881
- break;
882
- case 'S':
883
- formatter = dateGetter(6, 1);
884
- break;
885
- case 'SS':
886
- formatter = dateGetter(6, 2);
887
- break;
888
- case 'SSS':
889
- formatter = dateGetter(6, 3);
890
- break;
891
- case 'Z':
892
- case 'ZZ':
893
- case 'ZZZ':
894
- formatter = timeZoneGetter(0);
895
- break;
896
- case 'ZZZZZ':
897
- formatter = timeZoneGetter(3);
898
- break;
899
- case 'O':
900
- case 'OO':
901
- case 'OOO':
902
- case 'z':
903
- case 'zz':
904
- case 'zzz':
905
- formatter = timeZoneGetter(1);
906
- break;
907
- case 'OOOO':
908
- case 'ZZZZ':
909
- case 'zzzz':
910
- formatter = timeZoneGetter(2);
911
- break;
912
- default:
913
- return null;
914
- }
915
- DATE_FORMATS[format] = formatter;
916
- return formatter;
917
- }
918
- function timezoneToOffset(timezone, fallback) {
919
- timezone = timezone.replace(/:/g, '');
920
- const requestedTimezoneOffset = Date.parse(`Jan 01, 1970 00:00:00 ${ timezone}`) / 60000;
921
- return isNaN(requestedTimezoneOffset) ? fallback : requestedTimezoneOffset;
922
- }
923
- function addDateMinutes(date, minutes) {
924
- date = new Date(date.getTime());
925
- date.setMinutes(date.getMinutes() + minutes);
926
- return date;
927
- }
928
- function convertTimezoneToLocal(date, timezone, reverse) {
929
- const reverseValue = -1;
930
- const dateTimezoneOffset = date.getTimezoneOffset();
931
- const timezoneOffset = timezoneToOffset(timezone, dateTimezoneOffset);
932
- return addDateMinutes(date, reverseValue * (timezoneOffset - dateTimezoneOffset));
933
- }
934
- function toDate(value) {
935
- if (isDate(value)) {
936
- return value;
937
- }
938
- if (typeof value === 'number' && !isNaN(value)) {
939
- return new Date(value);
940
- }
941
- if (typeof value === 'string') {
942
- value = value.trim();
943
- if (/^(\d{4}(-\d{1,2}(-\d{1,2})?)?)$/.test(value)) {
944
- const [y, m = 1, d = 1] = value.split('-').map(val => +val);
945
- return createDate(y, m - 1, d);
946
- }
947
- const parsedNb = parseFloat(value);
948
- if (!isNaN(value - parsedNb)) {
949
- return new Date(parsedNb);
950
- }
951
- let match;
952
- if (match = value.match(ISO8601_DATE_REGEX)) {
953
- return isoStringToDate(match);
954
- }
955
- }
956
- const date = new Date(value);
957
- if (!isDate(date)) {
958
- throw new _RuntimeError(2311, ngDevMode && `Unable to convert "${value}" into a date`);
959
- }
960
- return date;
961
- }
962
- function isoStringToDate(match) {
963
- const date = new Date(0);
964
- let tzHour = 0;
965
- let tzMin = 0;
966
- const dateSetter = match[8] ? date.setUTCFullYear : date.setFullYear;
967
- const timeSetter = match[8] ? date.setUTCHours : date.setHours;
968
- if (match[9]) {
969
- tzHour = Number(match[9] + match[10]);
970
- tzMin = Number(match[9] + match[11]);
971
- }
972
- dateSetter.call(date, Number(match[1]), Number(match[2]) - 1, Number(match[3]));
973
- const h = Number(match[4] || 0) - tzHour;
974
- const m = Number(match[5] || 0) - tzMin;
975
- const s = Number(match[6] || 0);
976
- const ms = Math.floor(parseFloat(`0.${ match[7] || 0}`) * 1000);
977
- timeSetter.call(date, h, m, s, ms);
978
- return date;
979
- }
980
- function isDate(value) {
981
- return value instanceof Date && !isNaN(value.valueOf());
982
- }
983
- const NUMBER_FORMAT_REGEXP = /^(\d+)?\.((\d+)(-(\d+))?)?$/;
984
- const MAX_DIGITS = 22;
985
- const DECIMAL_SEP = '.';
986
- const ZERO_CHAR = '0';
987
- const PATTERN_SEP = ';';
988
- const GROUP_SEP = ',';
989
- const DIGIT_CHAR = '#';
990
- const CURRENCY_CHAR = '¤';
991
- const PERCENT_CHAR = '%';
992
- function formatNumberToLocaleString(value, pattern, locale, groupSymbol, decimalSymbol, digitsInfo, isPercent = false) {
993
- let formattedText = '';
994
- let isZero = false;
995
- if (!isFinite(value)) {
996
- formattedText = getLocaleNumberSymbol(locale, NumberSymbol.Infinity);
997
- } else {
998
- let parsedNumber = parseNumber(value);
999
- if (isPercent) {
1000
- parsedNumber = toPercent(parsedNumber);
1001
- }
1002
- let {minInt} = pattern;
1003
- let minFraction = pattern.minFrac;
1004
- let maxFraction = pattern.maxFrac;
1005
- if (digitsInfo) {
1006
- const parts = digitsInfo.match(NUMBER_FORMAT_REGEXP);
1007
- if (parts === null) {
1008
- throw new _RuntimeError(2306, ngDevMode && `${digitsInfo} is not a valid digit info`);
1009
- }
1010
- const minIntPart = parts[1];
1011
- const minFractionPart = parts[3];
1012
- const maxFractionPart = parts[5];
1013
- if (minIntPart != null) {
1014
- minInt = parseIntAutoRadix(minIntPart);
1015
- }
1016
- if (minFractionPart != null) {
1017
- minFraction = parseIntAutoRadix(minFractionPart);
1018
- }
1019
- if (maxFractionPart != null) {
1020
- maxFraction = parseIntAutoRadix(maxFractionPart);
1021
- } else if (minFractionPart != null && minFraction > maxFraction) {
1022
- maxFraction = minFraction;
1023
- }
1024
- }
1025
- roundNumber(parsedNumber, minFraction, maxFraction);
1026
- let {digits} = parsedNumber;
1027
- let {integerLen} = parsedNumber;
1028
- const {exponent} = parsedNumber;
1029
- let decimals = [];
1030
- isZero = digits.every(d => !d);
1031
- for (; integerLen < minInt; integerLen++) {
1032
- digits.unshift(0);
1033
- }
1034
- for (; integerLen < 0; integerLen++) {
1035
- digits.unshift(0);
1036
- }
1037
- if (integerLen > 0) {
1038
- decimals = digits.splice(integerLen, digits.length);
1039
- } else {
1040
- decimals = digits;
1041
- digits = [0];
1042
- }
1043
- const groups = [];
1044
- if (digits.length >= pattern.lgSize) {
1045
- groups.unshift(digits.splice(-pattern.lgSize, digits.length).join(''));
1046
- }
1047
- while (digits.length > pattern.gSize) {
1048
- groups.unshift(digits.splice(-pattern.gSize, digits.length).join(''));
1049
- }
1050
- if (digits.length) {
1051
- groups.unshift(digits.join(''));
1052
- }
1053
- formattedText = groups.join(getLocaleNumberSymbol(locale, groupSymbol));
1054
- if (decimals.length) {
1055
- formattedText += getLocaleNumberSymbol(locale, decimalSymbol) + decimals.join('');
1056
- }
1057
- if (exponent) {
1058
- formattedText += `${getLocaleNumberSymbol(locale, NumberSymbol.Exponential) }+${ exponent}`;
1059
- }
1060
- }
1061
- if (value < 0 && !isZero) {
1062
- formattedText = pattern.negPre + formattedText + pattern.negSuf;
1063
- } else {
1064
- formattedText = pattern.posPre + formattedText + pattern.posSuf;
1065
- }
1066
- return formattedText;
1067
- }
1068
- function formatCurrency(value, locale, currency, currencyCode, digitsInfo) {
1069
- const format = getLocaleNumberFormat(locale, NumberFormatStyle.Currency);
1070
- const pattern = parseNumberFormat(format, getLocaleNumberSymbol(locale, NumberSymbol.MinusSign));
1071
- pattern.minFrac = getNumberOfCurrencyDigits(currencyCode);
1072
- pattern.maxFrac = pattern.minFrac;
1073
- const res = formatNumberToLocaleString(value, pattern, locale, NumberSymbol.CurrencyGroup, NumberSymbol.CurrencyDecimal, digitsInfo);
1074
- return res.replace(CURRENCY_CHAR, currency).replace(CURRENCY_CHAR, '').trim();
1075
- }
1076
- function formatPercent(value, locale, digitsInfo) {
1077
- const format = getLocaleNumberFormat(locale, NumberFormatStyle.Percent);
1078
- const pattern = parseNumberFormat(format, getLocaleNumberSymbol(locale, NumberSymbol.MinusSign));
1079
- const res = formatNumberToLocaleString(value, pattern, locale, NumberSymbol.Group, NumberSymbol.Decimal, digitsInfo, true);
1080
- return res.replace(new RegExp(PERCENT_CHAR, 'g'), getLocaleNumberSymbol(locale, NumberSymbol.PercentSign));
1081
- }
1082
- function formatNumber(value, locale, digitsInfo) {
1083
- const format = getLocaleNumberFormat(locale, NumberFormatStyle.Decimal);
1084
- const pattern = parseNumberFormat(format, getLocaleNumberSymbol(locale, NumberSymbol.MinusSign));
1085
- return formatNumberToLocaleString(value, pattern, locale, NumberSymbol.Group, NumberSymbol.Decimal, digitsInfo);
1086
- }
1087
- function parseNumberFormat(format, minusSign = '-') {
1088
- const p = {
1089
- gSize: 0,
1090
- lgSize: 0,
1091
- maxFrac: 0,
1092
- minFrac: 0,
1093
- minInt: 1,
1094
- negPre: '',
1095
- negSuf: '',
1096
- posPre: '',
1097
- posSuf: ''
1098
- };
1099
- const patternParts = format.split(PATTERN_SEP);
1100
- const positive = patternParts[0];
1101
- const negative = patternParts[1];
1102
- const positiveParts = positive.indexOf(DECIMAL_SEP) !== -1 ? positive.split(DECIMAL_SEP) : [positive.substring(0, positive.lastIndexOf(ZERO_CHAR) + 1), positive.substring(positive.lastIndexOf(ZERO_CHAR) + 1)],
1103
- integer = positiveParts[0],
1104
- fraction = positiveParts[1] || '';
1105
- p.posPre = integer.substring(0, integer.indexOf(DIGIT_CHAR));
1106
- for (let i = 0; i < fraction.length; i++) {
1107
- const ch = fraction.charAt(i);
1108
- if (ch === ZERO_CHAR) {
1109
- p.minFrac = p.maxFrac = i + 1;
1110
- } else if (ch === DIGIT_CHAR) {
1111
- p.maxFrac = i + 1;
1112
- } else {
1113
- p.posSuf += ch;
1114
- }
1115
- }
1116
- const groups = integer.split(GROUP_SEP);
1117
- p.gSize = groups[1] ? groups[1].length : 0;
1118
- p.lgSize = groups[2] || groups[1] ? (groups[2] || groups[1]).length : 0;
1119
- if (negative) {
1120
- const trunkLen = positive.length - p.posPre.length - p.posSuf.length,
1121
- pos = negative.indexOf(DIGIT_CHAR);
1122
- p.negPre = negative.substring(0, pos).replace(/'/g, '');
1123
- p.negSuf = negative.slice(pos + trunkLen).replace(/'/g, '');
1124
- } else {
1125
- p.negPre = minusSign + p.posPre;
1126
- p.negSuf = p.posSuf;
1127
- }
1128
- return p;
1129
- }
1130
- function toPercent(parsedNumber) {
1131
- if (parsedNumber.digits[0] === 0) {
1132
- return parsedNumber;
1133
- }
1134
- const fractionLen = parsedNumber.digits.length - parsedNumber.integerLen;
1135
- if (parsedNumber.exponent) {
1136
- parsedNumber.exponent += 2;
1137
- } else {
1138
- if (fractionLen === 0) {
1139
- parsedNumber.digits.push(0, 0);
1140
- } else if (fractionLen === 1) {
1141
- parsedNumber.digits.push(0);
1142
- }
1143
- parsedNumber.integerLen += 2;
1144
- }
1145
- return parsedNumber;
1146
- }
1147
- function parseNumber(num) {
1148
- let numStr = `${Math.abs(num) }`;
1149
- let exponent = 0,
1150
- digits,
1151
- integerLen;
1152
- let i, j, zeros;
1153
- if ((integerLen = numStr.indexOf(DECIMAL_SEP)) > -1) {
1154
- numStr = numStr.replace(DECIMAL_SEP, '');
1155
- }
1156
- if ((i = numStr.search(/e/i)) > 0) {
1157
- if (integerLen < 0) integerLen = i;
1158
- integerLen += +numStr.slice(i + 1);
1159
- numStr = numStr.substring(0, i);
1160
- } else if (integerLen < 0) {
1161
- integerLen = numStr.length;
1162
- }
1163
- for (i = 0; numStr.charAt(i) === ZERO_CHAR; i++) {}
1164
- if (i === (zeros = numStr.length)) {
1165
- digits = [0];
1166
- integerLen = 1;
1167
- } else {
1168
- zeros--;
1169
- while (numStr.charAt(zeros) === ZERO_CHAR) zeros--;
1170
- integerLen -= i;
1171
- digits = [];
1172
- for (j = 0; i <= zeros; i++, j++) {
1173
- digits[j] = Number(numStr.charAt(i));
1174
- }
1175
- }
1176
- if (integerLen > MAX_DIGITS) {
1177
- digits = digits.splice(0, MAX_DIGITS - 1);
1178
- exponent = integerLen - 1;
1179
- integerLen = 1;
1180
- }
1181
- return {
1182
- digits,
1183
- exponent,
1184
- integerLen
1185
- };
1186
- }
1187
- function roundNumber(parsedNumber, minFrac, maxFrac) {
1188
- if (minFrac > maxFrac) {
1189
- throw new _RuntimeError(2307, ngDevMode && `The minimum number of digits after fraction (${minFrac}) is higher than the maximum (${maxFrac}).`);
1190
- }
1191
- const {digits} = parsedNumber;
1192
- let fractionLen = digits.length - parsedNumber.integerLen;
1193
- const fractionSize = Math.min(Math.max(minFrac, fractionLen), maxFrac);
1194
- let roundAt = fractionSize + parsedNumber.integerLen;
1195
- const digit = digits[roundAt];
1196
- if (roundAt > 0) {
1197
- digits.splice(Math.max(parsedNumber.integerLen, roundAt));
1198
- for (let j = roundAt; j < digits.length; j++) {
1199
- digits[j] = 0;
1200
- }
1201
- } else {
1202
- fractionLen = Math.max(0, fractionLen);
1203
- parsedNumber.integerLen = 1;
1204
- digits.length = Math.max(1, roundAt = fractionSize + 1);
1205
- digits[0] = 0;
1206
- for (let i = 1; i < roundAt; i++) digits[i] = 0;
1207
- }
1208
- if (digit >= 5) {
1209
- if (roundAt - 1 < 0) {
1210
- for (let k = 0; k > roundAt; k--) {
1211
- digits.unshift(0);
1212
- parsedNumber.integerLen++;
1213
- }
1214
- digits.unshift(1);
1215
- parsedNumber.integerLen++;
1216
- } else {
1217
- digits[roundAt - 1]++;
1218
- }
1219
- }
1220
- for (; fractionLen < Math.max(0, fractionSize); fractionLen++) digits.push(0);
1221
- let dropTrailingZeros = fractionSize !== 0;
1222
- const minLen = minFrac + parsedNumber.integerLen;
1223
- const carry = digits.reduceRight((carry, d, i, digits) => {
1224
- d = d + carry;
1225
- digits[i] = d < 10 ? d : d - 10;
1226
- if (dropTrailingZeros) {
1227
- if (digits[i] === 0 && i >= minLen) {
1228
- digits.pop();
1229
- } else {
1230
- dropTrailingZeros = false;
1231
- }
1232
- }
1233
- return d >= 10 ? 1 : 0;
1234
- }, 0);
1235
- if (carry) {
1236
- digits.unshift(carry);
1237
- parsedNumber.integerLen++;
1238
- }
1239
- }
1240
- function parseIntAutoRadix(text) {
1241
- const result = parseInt(text);
1242
- if (isNaN(result)) {
1243
- throw new _RuntimeError(2305, ngDevMode && `Invalid integer literal when parsing ${ text}`);
1244
- }
1245
- return result;
1246
- }
1247
- class NgLocalization {
1248
- static ɵfac = function NgLocalization_Factory(__ngFactoryType__) {
1249
- return new (__ngFactoryType__ || NgLocalization)();
1250
- };
1251
- static ɵprov = /* @__PURE__ */i0.ɵɵdefineInjectable({
1252
- providedIn: 'root',
1253
- token: NgLocalization,
1254
- factory: () => (() => new NgLocaleLocalization(inject(LOCALE_ID)))()
1255
- });
1256
- }
1257
- (() => {
1258
- (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(NgLocalization, [{
1259
- args: [{
1260
- providedIn: 'root',
1261
- useFactory: () => new NgLocaleLocalization(inject(LOCALE_ID))
1262
- }],
1263
- type: Injectable
1264
- }], null, null);
1265
- })();
1266
- function getPluralCategory(value, cases, ngLocalization, locale) {
1267
- let key = `=${value}`;
1268
- if (cases.indexOf(key) > -1) {
1269
- return key;
1270
- }
1271
- key = ngLocalization.getPluralCategory(value, locale);
1272
- if (cases.indexOf(key) > -1) {
1273
- return key;
1274
- }
1275
- if (cases.indexOf('other') > -1) {
1276
- return 'other';
1277
- }
1278
- throw new _RuntimeError(2308, ngDevMode && `No plural message found for value "${value}"`);
1279
- }
1280
- class NgLocaleLocalization extends NgLocalization {
1281
- locale;
1282
- constructor(locale) {
1283
- super();
1284
- this.locale = locale;
1285
- }
1286
- getPluralCategory(value, locale) {
1287
- const plural = getLocalePluralCase(locale || this.locale)(value);
1288
- switch (plural) {
1289
- case Plural.Zero:
1290
- return 'zero';
1291
- case Plural.One:
1292
- return 'one';
1293
- case Plural.Two:
1294
- return 'two';
1295
- case Plural.Few:
1296
- return 'few';
1297
- case Plural.Many:
1298
- return 'many';
1299
- default:
1300
- return 'other';
1301
- }
1302
- }
1303
- static ɵfac = function NgLocaleLocalization_Factory(__ngFactoryType__) {
1304
- return new (__ngFactoryType__ || NgLocaleLocalization)(i0.ɵɵinject(LOCALE_ID));
1305
- };
1306
- static ɵprov = /* @__PURE__ */i0.ɵɵdefineInjectable({
1307
- factory: NgLocaleLocalization.ɵfac,
1308
- token: NgLocaleLocalization
1309
- });
1310
- }
1311
- (() => {
1312
- (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(NgLocaleLocalization, [{
1313
- type: Injectable
1314
- }], () => [{
1315
- decorators: [{
1316
- args: [LOCALE_ID],
1317
- type: Inject
1318
- }],
1319
- type: undefined
1320
- }], null);
1321
- })();
1322
- const WS_REGEXP = /\s+/;
1323
- const EMPTY_ARRAY = [];
1324
- class NgClass {
1325
- _ngEl;
1326
- _renderer;
1327
- initialClasses = EMPTY_ARRAY;
1328
- rawClass;
1329
- stateMap = new Map();
1330
- constructor(_ngEl, _renderer) {
1331
- this._ngEl = _ngEl;
1332
- this._renderer = _renderer;
1333
- }
1334
- set klass(value) {
1335
- this.initialClasses = value != null ? value.trim().split(WS_REGEXP) : EMPTY_ARRAY;
1336
- }
1337
- set ngClass(value) {
1338
- this.rawClass = typeof value === 'string' ? value.trim().split(WS_REGEXP) : value;
1339
- }
1340
- ngDoCheck() {
1341
- for (const klass of this.initialClasses) {
1342
- this._updateState(klass, true);
1343
- }
1344
- const {rawClass} = this;
1345
- if (Array.isArray(rawClass) || rawClass instanceof Set) {
1346
- for (const klass of rawClass) {
1347
- this._updateState(klass, true);
1348
- }
1349
- } else if (rawClass != null) {
1350
- for (const klass of Object.keys(rawClass)) {
1351
- this._updateState(klass, Boolean(rawClass[klass]));
1352
- }
1353
- }
1354
- this._applyStateDiff();
1355
- }
1356
- _updateState(klass, nextEnabled) {
1357
- const state = this.stateMap.get(klass);
1358
- if (state !== undefined) {
1359
- if (state.enabled !== nextEnabled) {
1360
- state.changed = true;
1361
- state.enabled = nextEnabled;
1362
- }
1363
- state.touched = true;
1364
- } else {
1365
- this.stateMap.set(klass, {
1366
- changed: true,
1367
- enabled: nextEnabled,
1368
- touched: true
1369
- });
1370
- }
1371
- }
1372
- _applyStateDiff() {
1373
- for (const stateEntry of this.stateMap) {
1374
- const klass = stateEntry[0];
1375
- const state = stateEntry[1];
1376
- if (state.changed) {
1377
- this._toggleClass(klass, state.enabled);
1378
- state.changed = false;
1379
- } else if (!state.touched) {
1380
- if (state.enabled) {
1381
- this._toggleClass(klass, false);
1382
- }
1383
- this.stateMap.delete(klass);
1384
- }
1385
- state.touched = false;
1386
- }
1387
- }
1388
- _toggleClass(klass, enabled) {
1389
- if (ngDevMode) {
1390
- if (typeof klass !== 'string') {
1391
- throw new Error(`NgClass can only toggle CSS classes expressed as strings, got ${_stringify(klass)}`);
1392
- }
1393
- }
1394
- klass = klass.trim();
1395
- if (klass.length > 0) {
1396
- klass.split(WS_REGEXP).forEach(klass => {
1397
- if (enabled) {
1398
- this._renderer.addClass(this._ngEl.nativeElement, klass);
1399
- } else {
1400
- this._renderer.removeClass(this._ngEl.nativeElement, klass);
1401
- }
1402
- });
1403
- }
1404
- }
1405
- static ɵfac = function NgClass_Factory(__ngFactoryType__) {
1406
- return new (__ngFactoryType__ || NgClass)(i0.ɵɵdirectiveInject(i0.ElementRef), i0.ɵɵdirectiveInject(i0.Renderer2));
1407
- };
1408
- static ɵdir = /* @__PURE__ */i0.ɵɵdefineDirective({
1409
- inputs: {
1410
- klass: [0, "class", "klass"],
1411
- ngClass: "ngClass"
1412
- },
1413
- selectors: [["", "ngClass", ""]],
1414
- type: NgClass
1415
- });
1416
- }
1417
- (() => {
1418
- (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(NgClass, [{
1419
- args: [{
1420
- selector: '[ngClass]'
1421
- }],
1422
- type: Directive
1423
- }], () => [{
1424
- type: i0.ElementRef
1425
- }, {
1426
- type: i0.Renderer2
1427
- }], {
1428
- klass: [{
1429
- args: ['class'],
1430
- type: Input
1431
- }],
1432
- ngClass: [{
1433
- args: ['ngClass'],
1434
- type: Input
1435
- }]
1436
- });
1437
- })();
1438
- class NgComponentOutlet {
1439
- _viewContainerRef;
1440
- ngComponentOutlet = null;
1441
- ngComponentOutletInputs;
1442
- ngComponentOutletInjector;
1443
- ngComponentOutletEnvironmentInjector;
1444
- ngComponentOutletContent;
1445
- ngComponentOutletNgModule;
1446
- _componentRef;
1447
- _moduleRef;
1448
- _inputsUsed = new Map();
1449
- get componentInstance() {
1450
- return this._componentRef?.instance ?? null;
1451
- }
1452
- constructor(_viewContainerRef) {
1453
- this._viewContainerRef = _viewContainerRef;
1454
- }
1455
- _needToReCreateNgModuleInstance(changes) {
1456
- return changes['ngComponentOutletNgModule'] !== undefined;
1457
- }
1458
- _needToReCreateComponentInstance(changes) {
1459
- return changes['ngComponentOutlet'] !== undefined || changes['ngComponentOutletContent'] !== undefined || changes['ngComponentOutletInjector'] !== undefined || changes['ngComponentOutletEnvironmentInjector'] !== undefined || this._needToReCreateNgModuleInstance(changes);
1460
- }
1461
- ngOnChanges(changes) {
1462
- if (this._needToReCreateComponentInstance(changes)) {
1463
- this._viewContainerRef.clear();
1464
- this._inputsUsed.clear();
1465
- this._componentRef = undefined;
1466
- if (this.ngComponentOutlet) {
1467
- const injector = this.ngComponentOutletInjector || this._viewContainerRef.parentInjector;
1468
- if (this._needToReCreateNgModuleInstance(changes)) {
1469
- this._moduleRef?.destroy();
1470
- if (this.ngComponentOutletNgModule) {
1471
- this._moduleRef = createNgModule(this.ngComponentOutletNgModule, getParentInjector(injector));
1472
- } else {
1473
- this._moduleRef = undefined;
1474
- }
1475
- }
1476
- this._componentRef = this._viewContainerRef.createComponent(this.ngComponentOutlet, {
1477
- environmentInjector: this.ngComponentOutletEnvironmentInjector,
1478
- injector,
1479
- ngModuleRef: this._moduleRef,
1480
- projectableNodes: this.ngComponentOutletContent
1481
- });
1482
- }
1483
- }
1484
- }
1485
- ngDoCheck() {
1486
- if (this._componentRef) {
1487
- if (this.ngComponentOutletInputs) {
1488
- for (const inputName of Object.keys(this.ngComponentOutletInputs)) {
1489
- this._inputsUsed.set(inputName, true);
1490
- }
1491
- }
1492
- this._applyInputStateDiff(this._componentRef);
1493
- }
1494
- }
1495
- ngOnDestroy() {
1496
- this._moduleRef?.destroy();
1497
- }
1498
- _applyInputStateDiff(componentRef) {
1499
- for (const [inputName, touched] of this._inputsUsed) {
1500
- if (!touched) {
1501
- componentRef.setInput(inputName, undefined);
1502
- this._inputsUsed.delete(inputName);
1503
- } else {
1504
- componentRef.setInput(inputName, this.ngComponentOutletInputs[inputName]);
1505
- this._inputsUsed.set(inputName, false);
1506
- }
1507
- }
1508
- }
1509
- static ɵfac = function NgComponentOutlet_Factory(__ngFactoryType__) {
1510
- return new (__ngFactoryType__ || NgComponentOutlet)(i0.ɵɵdirectiveInject(i0.ViewContainerRef));
1511
- };
1512
- static ɵdir = /* @__PURE__ */i0.ɵɵdefineDirective({
1513
- exportAs: ["ngComponentOutlet"],
1514
- features: [i0.ɵɵNgOnChangesFeature],
1515
- inputs: {
1516
- ngComponentOutlet: "ngComponentOutlet",
1517
- ngComponentOutletContent: "ngComponentOutletContent",
1518
- ngComponentOutletEnvironmentInjector: "ngComponentOutletEnvironmentInjector",
1519
- ngComponentOutletInjector: "ngComponentOutletInjector",
1520
- ngComponentOutletInputs: "ngComponentOutletInputs",
1521
- ngComponentOutletNgModule: "ngComponentOutletNgModule"
1522
- },
1523
- selectors: [["", "ngComponentOutlet", ""]],
1524
- type: NgComponentOutlet
1525
- });
1526
- }
1527
- (() => {
1528
- (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(NgComponentOutlet, [{
1529
- args: [{
1530
- exportAs: 'ngComponentOutlet',
1531
- selector: '[ngComponentOutlet]'
1532
- }],
1533
- type: Directive
1534
- }], () => [{
1535
- type: i0.ViewContainerRef
1536
- }], {
1537
- ngComponentOutlet: [{
1538
- type: Input
1539
- }],
1540
- ngComponentOutletContent: [{
1541
- type: Input
1542
- }],
1543
- ngComponentOutletEnvironmentInjector: [{
1544
- type: Input
1545
- }],
1546
- ngComponentOutletInjector: [{
1547
- type: Input
1548
- }],
1549
- ngComponentOutletInputs: [{
1550
- type: Input
1551
- }],
1552
- ngComponentOutletNgModule: [{
1553
- type: Input
1554
- }]
1555
- });
1556
- })();
1557
- function getParentInjector(injector) {
1558
- const parentNgModule = injector.get(NgModuleRef);
1559
- return parentNgModule.injector;
1560
- }
1561
- class NgForOfContext {
1562
- $implicit;
1563
- ngForOf;
1564
- index;
1565
- count;
1566
- constructor($implicit, ngForOf, index, count) {
1567
- this.$implicit = $implicit;
1568
- this.ngForOf = ngForOf;
1569
- this.index = index;
1570
- this.count = count;
1571
- }
1572
- get first() {
1573
- return this.index === 0;
1574
- }
1575
- get last() {
1576
- return this.index === this.count - 1;
1577
- }
1578
- get even() {
1579
- return this.index % 2 === 0;
1580
- }
1581
- get odd() {
1582
- return !this.even;
1583
- }
1584
- }
1585
- class NgForOf {
1586
- _viewContainer;
1587
- _template;
1588
- _differs;
1589
- set ngForOf(ngForOf) {
1590
- this._ngForOf = ngForOf;
1591
- this._ngForOfDirty = true;
1592
- }
1593
- set ngForTrackBy(fn) {
1594
- if ((typeof ngDevMode === 'undefined' || ngDevMode) && fn != null && typeof fn !== 'function') {
1595
- console.warn(`trackBy must be a function, but received ${JSON.stringify(fn)}. ` + `See https://angular.dev/api/common/NgForOf#change-propagation for more information.`);
1596
- }
1597
- this._trackByFn = fn;
1598
- }
1599
- get ngForTrackBy() {
1600
- return this._trackByFn;
1601
- }
1602
- _ngForOf = null;
1603
- _ngForOfDirty = true;
1604
- _differ = null;
1605
- _trackByFn;
1606
- constructor(_viewContainer, _template, _differs) {
1607
- this._viewContainer = _viewContainer;
1608
- this._template = _template;
1609
- this._differs = _differs;
1610
- }
1611
- set ngForTemplate(value) {
1612
- if (value) {
1613
- this._template = value;
1614
- }
1615
- }
1616
- ngDoCheck() {
1617
- if (this._ngForOfDirty) {
1618
- this._ngForOfDirty = false;
1619
- const value = this._ngForOf;
1620
- if (!this._differ && value) {
1621
- if (typeof ngDevMode === 'undefined' || ngDevMode) {
1622
- try {
1623
- this._differ = this._differs.find(value).create(this.ngForTrackBy);
1624
- } catch {
1625
- let errorMessage = `Cannot find a differ supporting object '${value}' of type '` + `${getTypeName(value)}'. NgFor only supports binding to Iterables, such as Arrays.`;
1626
- if (typeof value === 'object') {
1627
- errorMessage += ' Did you mean to use the keyvalue pipe?';
1628
- }
1629
- throw new _RuntimeError(-2200, errorMessage);
1630
- }
1631
- } else {
1632
- this._differ = this._differs.find(value).create(this.ngForTrackBy);
1633
- }
1634
- }
1635
- }
1636
- if (this._differ) {
1637
- const changes = this._differ.diff(this._ngForOf);
1638
- if (changes) this._applyChanges(changes);
1639
- }
1640
- }
1641
- _applyChanges(changes) {
1642
- const viewContainer = this._viewContainer;
1643
- changes.forEachOperation((item, adjustedPreviousIndex, currentIndex) => {
1644
- if (item.previousIndex == null) {
1645
- viewContainer.createEmbeddedView(this._template, new NgForOfContext(item.item, this._ngForOf, -1, -1), currentIndex === null ? undefined : currentIndex);
1646
- } else if (currentIndex == null) {
1647
- viewContainer.remove(adjustedPreviousIndex === null ? undefined : adjustedPreviousIndex);
1648
- } else if (adjustedPreviousIndex !== null) {
1649
- const view = viewContainer.get(adjustedPreviousIndex);
1650
- viewContainer.move(view, currentIndex);
1651
- applyViewChange(view, item);
1652
- }
1653
- });
1654
- for (let i = 0, ilen = viewContainer.length; i < ilen; i++) {
1655
- const viewRef = viewContainer.get(i);
1656
- const {context} = viewRef;
1657
- context.index = i;
1658
- context.count = ilen;
1659
- context.ngForOf = this._ngForOf;
1660
- }
1661
- changes.forEachIdentityChange(record => {
1662
- const viewRef = viewContainer.get(record.currentIndex);
1663
- applyViewChange(viewRef, record);
1664
- });
1665
- }
1666
- static ngTemplateContextGuard(dir, ctx) {
1667
- return true;
1668
- }
1669
- static ɵfac = function NgForOf_Factory(__ngFactoryType__) {
1670
- return new (__ngFactoryType__ || NgForOf)(i0.ɵɵdirectiveInject(i0.ViewContainerRef), i0.ɵɵdirectiveInject(i0.TemplateRef), i0.ɵɵdirectiveInject(i0.IterableDiffers));
1671
- };
1672
- static ɵdir = /* @__PURE__ */i0.ɵɵdefineDirective({
1673
- inputs: {
1674
- ngForOf: "ngForOf",
1675
- ngForTemplate: "ngForTemplate",
1676
- ngForTrackBy: "ngForTrackBy"
1677
- },
1678
- selectors: [["", "ngFor", "", "ngForOf", ""]],
1679
- type: NgForOf
1680
- });
1681
- }
1682
- (() => {
1683
- (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(NgForOf, [{
1684
- args: [{
1685
- selector: '[ngFor][ngForOf]'
1686
- }],
1687
- type: Directive
1688
- }], () => [{
1689
- type: i0.ViewContainerRef
1690
- }, {
1691
- type: i0.TemplateRef
1692
- }, {
1693
- type: i0.IterableDiffers
1694
- }], {
1695
- ngForOf: [{
1696
- type: Input
1697
- }],
1698
- ngForTemplate: [{
1699
- type: Input
1700
- }],
1701
- ngForTrackBy: [{
1702
- type: Input
1703
- }]
1704
- });
1705
- })();
1706
- function applyViewChange(view, record) {
1707
- view.context.$implicit = record.item;
1708
- }
1709
- function getTypeName(type) {
1710
- return type['name'] || typeof type;
1711
- }
1712
- class NgIf {
1713
- _viewContainer;
1714
- _context = new NgIfContext();
1715
- _thenTemplateRef = null;
1716
- _elseTemplateRef = null;
1717
- _thenViewRef = null;
1718
- _elseViewRef = null;
1719
- constructor(_viewContainer, templateRef) {
1720
- this._viewContainer = _viewContainer;
1721
- this._thenTemplateRef = templateRef;
1722
- }
1723
- set ngIf(condition) {
1724
- this._context.$implicit = this._context.ngIf = condition;
1725
- this._updateView();
1726
- }
1727
- set ngIfThen(templateRef) {
1728
- assertTemplate(templateRef, (typeof ngDevMode === 'undefined' || ngDevMode) && 'ngIfThen');
1729
- this._thenTemplateRef = templateRef;
1730
- this._thenViewRef = null;
1731
- this._updateView();
1732
- }
1733
- set ngIfElse(templateRef) {
1734
- assertTemplate(templateRef, (typeof ngDevMode === 'undefined' || ngDevMode) && 'ngIfElse');
1735
- this._elseTemplateRef = templateRef;
1736
- this._elseViewRef = null;
1737
- this._updateView();
1738
- }
1739
- _updateView() {
1740
- if (this._context.$implicit) {
1741
- if (!this._thenViewRef) {
1742
- this._viewContainer.clear();
1743
- this._elseViewRef = null;
1744
- if (this._thenTemplateRef) {
1745
- this._thenViewRef = this._viewContainer.createEmbeddedView(this._thenTemplateRef, this._context);
1746
- }
1747
- }
1748
- } else {
1749
- if (!this._elseViewRef) {
1750
- this._viewContainer.clear();
1751
- this._thenViewRef = null;
1752
- if (this._elseTemplateRef) {
1753
- this._elseViewRef = this._viewContainer.createEmbeddedView(this._elseTemplateRef, this._context);
1754
- }
1755
- }
1756
- }
1757
- }
1758
- static ngIfUseIfTypeGuard;
1759
- static ngTemplateGuard_ngIf;
1760
- static ngTemplateContextGuard(dir, ctx) {
1761
- return true;
1762
- }
1763
- static ɵfac = function NgIf_Factory(__ngFactoryType__) {
1764
- return new (__ngFactoryType__ || NgIf)(i0.ɵɵdirectiveInject(i0.ViewContainerRef), i0.ɵɵdirectiveInject(i0.TemplateRef));
1765
- };
1766
- static ɵdir = /* @__PURE__ */i0.ɵɵdefineDirective({
1767
- inputs: {
1768
- ngIf: "ngIf",
1769
- ngIfElse: "ngIfElse",
1770
- ngIfThen: "ngIfThen"
1771
- },
1772
- selectors: [["", "ngIf", ""]],
1773
- type: NgIf
1774
- });
1775
- }
1776
- (() => {
1777
- (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(NgIf, [{
1778
- args: [{
1779
- selector: '[ngIf]'
1780
- }],
1781
- type: Directive
1782
- }], () => [{
1783
- type: i0.ViewContainerRef
1784
- }, {
1785
- type: i0.TemplateRef
1786
- }], {
1787
- ngIf: [{
1788
- type: Input
1789
- }],
1790
- ngIfElse: [{
1791
- type: Input
1792
- }],
1793
- ngIfThen: [{
1794
- type: Input
1795
- }]
1796
- });
1797
- })();
1798
- class NgIfContext {
1799
- $implicit = null;
1800
- ngIf = null;
1801
- }
1802
- function assertTemplate(templateRef, property) {
1803
- if (templateRef && !templateRef.createEmbeddedView) {
1804
- throw new _RuntimeError(2020, (typeof ngDevMode === 'undefined' || ngDevMode) && `${property} must be a TemplateRef, but received '${_stringify(templateRef)}'.`);
1805
- }
1806
- }
1807
- class SwitchView {
1808
- _viewContainerRef;
1809
- _templateRef;
1810
- _created = false;
1811
- constructor(_viewContainerRef, _templateRef) {
1812
- this._viewContainerRef = _viewContainerRef;
1813
- this._templateRef = _templateRef;
1814
- }
1815
- create() {
1816
- this._created = true;
1817
- this._viewContainerRef.createEmbeddedView(this._templateRef);
1818
- }
1819
- destroy() {
1820
- this._created = false;
1821
- this._viewContainerRef.clear();
1822
- }
1823
- enforceState(created) {
1824
- if (created && !this._created) {
1825
- this.create();
1826
- } else if (!created && this._created) {
1827
- this.destroy();
1828
- }
1829
- }
1830
- }
1831
- class NgSwitch {
1832
- _defaultViews = [];
1833
- _defaultUsed = false;
1834
- _caseCount = 0;
1835
- _lastCaseCheckIndex = 0;
1836
- _lastCasesMatched = false;
1837
- _ngSwitch;
1838
- set ngSwitch(newValue) {
1839
- this._ngSwitch = newValue;
1840
- if (this._caseCount === 0) {
1841
- this._updateDefaultCases(true);
1842
- }
1843
- }
1844
- _addCase() {
1845
- return this._caseCount++;
1846
- }
1847
- _addDefault(view) {
1848
- this._defaultViews.push(view);
1849
- }
1850
- _matchCase(value) {
1851
- const matched = value === this._ngSwitch;
1852
- this._lastCasesMatched ||= matched;
1853
- this._lastCaseCheckIndex++;
1854
- if (this._lastCaseCheckIndex === this._caseCount) {
1855
- this._updateDefaultCases(!this._lastCasesMatched);
1856
- this._lastCaseCheckIndex = 0;
1857
- this._lastCasesMatched = false;
1858
- }
1859
- return matched;
1860
- }
1861
- _updateDefaultCases(useDefault) {
1862
- if (this._defaultViews.length > 0 && useDefault !== this._defaultUsed) {
1863
- this._defaultUsed = useDefault;
1864
- for (const defaultView of this._defaultViews) {
1865
- defaultView.enforceState(useDefault);
1866
- }
1867
- }
1868
- }
1869
- static ɵfac = function NgSwitch_Factory(__ngFactoryType__) {
1870
- return new (__ngFactoryType__ || NgSwitch)();
1871
- };
1872
- static ɵdir = /* @__PURE__ */i0.ɵɵdefineDirective({
1873
- inputs: {
1874
- ngSwitch: "ngSwitch"
1875
- },
1876
- selectors: [["", "ngSwitch", ""]],
1877
- type: NgSwitch
1878
- });
1879
- }
1880
- (() => {
1881
- (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(NgSwitch, [{
1882
- args: [{
1883
- selector: '[ngSwitch]'
1884
- }],
1885
- type: Directive
1886
- }], null, {
1887
- ngSwitch: [{
1888
- type: Input
1889
- }]
1890
- });
1891
- })();
1892
- class NgSwitchCase {
1893
- ngSwitch;
1894
- _view;
1895
- ngSwitchCase;
1896
- constructor(viewContainer, templateRef, ngSwitch) {
1897
- this.ngSwitch = ngSwitch;
1898
- if ((typeof ngDevMode === 'undefined' || ngDevMode) && !ngSwitch) {
1899
- throwNgSwitchProviderNotFoundError('ngSwitchCase', 'NgSwitchCase');
1900
- }
1901
- ngSwitch._addCase();
1902
- this._view = new SwitchView(viewContainer, templateRef);
1903
- }
1904
- ngDoCheck() {
1905
- this._view.enforceState(this.ngSwitch._matchCase(this.ngSwitchCase));
1906
- }
1907
- static ɵfac = function NgSwitchCase_Factory(__ngFactoryType__) {
1908
- return new (__ngFactoryType__ || NgSwitchCase)(i0.ɵɵdirectiveInject(i0.ViewContainerRef), i0.ɵɵdirectiveInject(i0.TemplateRef), i0.ɵɵdirectiveInject(NgSwitch, 9));
1909
- };
1910
- static ɵdir = /* @__PURE__ */i0.ɵɵdefineDirective({
1911
- inputs: {
1912
- ngSwitchCase: "ngSwitchCase"
1913
- },
1914
- selectors: [["", "ngSwitchCase", ""]],
1915
- type: NgSwitchCase
1916
- });
1917
- }
1918
- (() => {
1919
- (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(NgSwitchCase, [{
1920
- args: [{
1921
- selector: '[ngSwitchCase]'
1922
- }],
1923
- type: Directive
1924
- }], () => [{
1925
- type: i0.ViewContainerRef
1926
- }, {
1927
- type: i0.TemplateRef
1928
- }, {
1929
- decorators: [{
1930
- type: Optional
1931
- }, {
1932
- type: Host
1933
- }],
1934
- type: NgSwitch
1935
- }], {
1936
- ngSwitchCase: [{
1937
- type: Input
1938
- }]
1939
- });
1940
- })();
1941
- class NgSwitchDefault {
1942
- constructor(viewContainer, templateRef, ngSwitch) {
1943
- if ((typeof ngDevMode === 'undefined' || ngDevMode) && !ngSwitch) {
1944
- throwNgSwitchProviderNotFoundError('ngSwitchDefault', 'NgSwitchDefault');
1945
- }
1946
- ngSwitch._addDefault(new SwitchView(viewContainer, templateRef));
1947
- }
1948
- static ɵfac = function NgSwitchDefault_Factory(__ngFactoryType__) {
1949
- return new (__ngFactoryType__ || NgSwitchDefault)(i0.ɵɵdirectiveInject(i0.ViewContainerRef), i0.ɵɵdirectiveInject(i0.TemplateRef), i0.ɵɵdirectiveInject(NgSwitch, 9));
1950
- };
1951
- static ɵdir = /* @__PURE__ */i0.ɵɵdefineDirective({
1952
- selectors: [["", "ngSwitchDefault", ""]],
1953
- type: NgSwitchDefault
1954
- });
1955
- }
1956
- (() => {
1957
- (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(NgSwitchDefault, [{
1958
- args: [{
1959
- selector: '[ngSwitchDefault]'
1960
- }],
1961
- type: Directive
1962
- }], () => [{
1963
- type: i0.ViewContainerRef
1964
- }, {
1965
- type: i0.TemplateRef
1966
- }, {
1967
- decorators: [{
1968
- type: Optional
1969
- }, {
1970
- type: Host
1971
- }],
1972
- type: NgSwitch
1973
- }], null);
1974
- })();
1975
- function throwNgSwitchProviderNotFoundError(attrName, directiveName) {
1976
- throw new _RuntimeError(2000, `An element with the "${attrName}" attribute ` + `(matching the "${directiveName}" directive) must be located inside an element with the "ngSwitch" attribute ` + `(matching "NgSwitch" directive)`);
1977
- }
1978
- class NgPlural {
1979
- _localization;
1980
- _activeView;
1981
- _caseViews = {};
1982
- constructor(_localization) {
1983
- this._localization = _localization;
1984
- }
1985
- set ngPlural(value) {
1986
- this._updateView(value);
1987
- }
1988
- addCase(value, switchView) {
1989
- this._caseViews[value] = switchView;
1990
- }
1991
- _updateView(switchValue) {
1992
- this._clearViews();
1993
- const cases = Object.keys(this._caseViews);
1994
- const key = getPluralCategory(switchValue, cases, this._localization);
1995
- this._activateView(this._caseViews[key]);
1996
- }
1997
- _clearViews() {
1998
- if (this._activeView) this._activeView.destroy();
1999
- }
2000
- _activateView(view) {
2001
- if (view) {
2002
- this._activeView = view;
2003
- this._activeView.create();
2004
- }
2005
- }
2006
- static ɵfac = function NgPlural_Factory(__ngFactoryType__) {
2007
- return new (__ngFactoryType__ || NgPlural)(i0.ɵɵdirectiveInject(NgLocalization));
2008
- };
2009
- static ɵdir = /* @__PURE__ */i0.ɵɵdefineDirective({
2010
- inputs: {
2011
- ngPlural: "ngPlural"
2012
- },
2013
- selectors: [["", "ngPlural", ""]],
2014
- type: NgPlural
2015
- });
2016
- }
2017
- (() => {
2018
- (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(NgPlural, [{
2019
- args: [{
2020
- selector: '[ngPlural]'
2021
- }],
2022
- type: Directive
2023
- }], () => [{
2024
- type: NgLocalization
2025
- }], {
2026
- ngPlural: [{
2027
- type: Input
2028
- }]
2029
- });
2030
- })();
2031
- class NgPluralCase {
2032
- value;
2033
- constructor(value, template, viewContainer, ngPlural) {
2034
- this.value = value;
2035
- const isANumber = !isNaN(Number(value));
2036
- ngPlural.addCase(isANumber ? `=${value}` : value, new SwitchView(viewContainer, template));
2037
- }
2038
- static ɵfac = function NgPluralCase_Factory(__ngFactoryType__) {
2039
- return new (__ngFactoryType__ || NgPluralCase)(i0.ɵɵinjectAttribute('ngPluralCase'), i0.ɵɵdirectiveInject(i0.TemplateRef), i0.ɵɵdirectiveInject(i0.ViewContainerRef), i0.ɵɵdirectiveInject(NgPlural, 1));
2040
- };
2041
- static ɵdir = /* @__PURE__ */i0.ɵɵdefineDirective({
2042
- selectors: [["", "ngPluralCase", ""]],
2043
- type: NgPluralCase
2044
- });
2045
- }
2046
- (() => {
2047
- (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(NgPluralCase, [{
2048
- args: [{
2049
- selector: '[ngPluralCase]'
2050
- }],
2051
- type: Directive
2052
- }], () => [{
2053
- decorators: [{
2054
- args: ['ngPluralCase'],
2055
- type: Attribute
2056
- }],
2057
- type: undefined
2058
- }, {
2059
- type: i0.TemplateRef
2060
- }, {
2061
- type: i0.ViewContainerRef
2062
- }, {
2063
- decorators: [{
2064
- type: Host
2065
- }],
2066
- type: NgPlural
2067
- }], null);
2068
- })();
2069
- class NgStyle {
2070
- _ngEl;
2071
- _differs;
2072
- _renderer;
2073
- _ngStyle = null;
2074
- _differ = null;
2075
- constructor(_ngEl, _differs, _renderer) {
2076
- this._ngEl = _ngEl;
2077
- this._differs = _differs;
2078
- this._renderer = _renderer;
2079
- }
2080
- set ngStyle(values) {
2081
- this._ngStyle = values;
2082
- if (!this._differ && values) {
2083
- this._differ = this._differs.find(values).create();
2084
- }
2085
- }
2086
- ngDoCheck() {
2087
- if (this._differ) {
2088
- const changes = this._differ.diff(this._ngStyle);
2089
- if (changes) {
2090
- this._applyChanges(changes);
2091
- }
2092
- }
2093
- }
2094
- _setStyle(nameAndUnit, value) {
2095
- const [name, unit] = nameAndUnit.split('.');
2096
- const flags = name.indexOf('-') === -1 ? undefined : RendererStyleFlags2.DashCase;
2097
- if (value != null) {
2098
- this._renderer.setStyle(this._ngEl.nativeElement, name, unit ? `${value}${unit}` : value, flags);
2099
- } else {
2100
- this._renderer.removeStyle(this._ngEl.nativeElement, name, flags);
2101
- }
2102
- }
2103
- _applyChanges(changes) {
2104
- changes.forEachRemovedItem(record => this._setStyle(record.key, null));
2105
- changes.forEachAddedItem(record => this._setStyle(record.key, record.currentValue));
2106
- changes.forEachChangedItem(record => this._setStyle(record.key, record.currentValue));
2107
- }
2108
- static ɵfac = function NgStyle_Factory(__ngFactoryType__) {
2109
- return new (__ngFactoryType__ || NgStyle)(i0.ɵɵdirectiveInject(i0.ElementRef), i0.ɵɵdirectiveInject(i0.KeyValueDiffers), i0.ɵɵdirectiveInject(i0.Renderer2));
2110
- };
2111
- static ɵdir = /* @__PURE__ */i0.ɵɵdefineDirective({
2112
- inputs: {
2113
- ngStyle: "ngStyle"
2114
- },
2115
- selectors: [["", "ngStyle", ""]],
2116
- type: NgStyle
2117
- });
2118
- }
2119
- (() => {
2120
- (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(NgStyle, [{
2121
- args: [{
2122
- selector: '[ngStyle]'
2123
- }],
2124
- type: Directive
2125
- }], () => [{
2126
- type: i0.ElementRef
2127
- }, {
2128
- type: i0.KeyValueDiffers
2129
- }, {
2130
- type: i0.Renderer2
2131
- }], {
2132
- ngStyle: [{
2133
- args: ['ngStyle'],
2134
- type: Input
2135
- }]
2136
- });
2137
- })();
2138
- class NgTemplateOutlet {
2139
- _viewContainerRef;
2140
- _viewRef = null;
2141
- ngTemplateOutletContext = null;
2142
- ngTemplateOutlet = null;
2143
- ngTemplateOutletInjector = null;
2144
- constructor(_viewContainerRef) {
2145
- this._viewContainerRef = _viewContainerRef;
2146
- }
2147
- ngOnChanges(changes) {
2148
- if (this._shouldRecreateView(changes)) {
2149
- const viewContainerRef = this._viewContainerRef;
2150
- if (this._viewRef) {
2151
- viewContainerRef.remove(viewContainerRef.indexOf(this._viewRef));
2152
- }
2153
- if (!this.ngTemplateOutlet) {
2154
- this._viewRef = null;
2155
- return;
2156
- }
2157
- const viewContext = this._createContextForwardProxy();
2158
- this._viewRef = viewContainerRef.createEmbeddedView(this.ngTemplateOutlet, viewContext, {
2159
- injector: this.ngTemplateOutletInjector ?? undefined
2160
- });
2161
- }
2162
- }
2163
- _shouldRecreateView(changes) {
2164
- return Boolean(changes['ngTemplateOutlet']) || Boolean(changes['ngTemplateOutletInjector']);
2165
- }
2166
- _createContextForwardProxy() {
2167
- return new Proxy({}, {
2168
- get: (_target, prop, receiver) => {
2169
- if (!this.ngTemplateOutletContext) {
2170
- return undefined;
2171
- }
2172
- return Reflect.get(this.ngTemplateOutletContext, prop, receiver);
2173
- },
2174
- set: (_target, prop, newValue) => {
2175
- if (!this.ngTemplateOutletContext) {
2176
- return false;
2177
- }
2178
- return Reflect.set(this.ngTemplateOutletContext, prop, newValue);
2179
- }
2180
- });
2181
- }
2182
- static ɵfac = function NgTemplateOutlet_Factory(__ngFactoryType__) {
2183
- return new (__ngFactoryType__ || NgTemplateOutlet)(i0.ɵɵdirectiveInject(i0.ViewContainerRef));
2184
- };
2185
- static ɵdir = /* @__PURE__ */i0.ɵɵdefineDirective({
2186
- features: [i0.ɵɵNgOnChangesFeature],
2187
- inputs: {
2188
- ngTemplateOutlet: "ngTemplateOutlet",
2189
- ngTemplateOutletContext: "ngTemplateOutletContext",
2190
- ngTemplateOutletInjector: "ngTemplateOutletInjector"
2191
- },
2192
- selectors: [["", "ngTemplateOutlet", ""]],
2193
- type: NgTemplateOutlet
2194
- });
2195
- }
2196
- (() => {
2197
- (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(NgTemplateOutlet, [{
2198
- args: [{
2199
- selector: '[ngTemplateOutlet]'
2200
- }],
2201
- type: Directive
2202
- }], () => [{
2203
- type: i0.ViewContainerRef
2204
- }], {
2205
- ngTemplateOutlet: [{
2206
- type: Input
2207
- }],
2208
- ngTemplateOutletContext: [{
2209
- type: Input
2210
- }],
2211
- ngTemplateOutletInjector: [{
2212
- type: Input
2213
- }]
2214
- });
2215
- })();
2216
- const COMMON_DIRECTIVES = [NgClass, NgComponentOutlet, NgForOf, NgIf, NgTemplateOutlet, NgStyle, NgSwitch, NgSwitchCase, NgSwitchDefault, NgPlural, NgPluralCase];
2217
- function invalidPipeArgumentError(type, value) {
2218
- return new _RuntimeError(2100, ngDevMode && `InvalidPipeArgument: '${value}' for pipe '${_stringify(type)}'`);
2219
- }
2220
- class SubscribableStrategy {
2221
- createSubscription(async, updateLatestValue, onError) {
2222
- return untracked(() => async.subscribe({
2223
- error: onError,
2224
- next: updateLatestValue
2225
- }));
2226
- }
2227
- dispose(subscription) {
2228
- untracked(() => subscription.unsubscribe());
2229
- }
2230
- }
2231
- class PromiseStrategy {
2232
- createSubscription(async, updateLatestValue, onError) {
2233
- async.then(v => updateLatestValue?.(v), e => onError?.(e));
2234
- return {
2235
- unsubscribe: () => {
2236
- updateLatestValue = null;
2237
- onError = null;
2238
- }
2239
- };
2240
- }
2241
- dispose(subscription) {
2242
- subscription.unsubscribe();
2243
- }
2244
- }
2245
- const _promiseStrategy = new PromiseStrategy();
2246
- const _subscribableStrategy = new SubscribableStrategy();
2247
- class AsyncPipe {
2248
- _ref;
2249
- _latestValue = null;
2250
- markForCheckOnValueUpdate = true;
2251
- _subscription = null;
2252
- _obj = null;
2253
- _strategy = null;
2254
- applicationErrorHandler = inject(_INTERNAL_APPLICATION_ERROR_HANDLER);
2255
- constructor(ref) {
2256
- this._ref = ref;
2257
- }
2258
- ngOnDestroy() {
2259
- if (this._subscription) {
2260
- this._dispose();
2261
- }
2262
- this._ref = null;
2263
- }
2264
- transform(obj) {
2265
- if (!this._obj) {
2266
- if (obj) {
2267
- try {
2268
- this.markForCheckOnValueUpdate = false;
2269
- this._subscribe(obj);
2270
- } finally {
2271
- this.markForCheckOnValueUpdate = true;
2272
- }
2273
- }
2274
- return this._latestValue;
2275
- }
2276
- if (obj !== this._obj) {
2277
- this._dispose();
2278
- return this.transform(obj);
2279
- }
2280
- return this._latestValue;
2281
- }
2282
- _subscribe(obj) {
2283
- this._obj = obj;
2284
- this._strategy = this._selectStrategy(obj);
2285
- this._subscription = this._strategy.createSubscription(obj, value => this._updateLatestValue(obj, value), e => this.applicationErrorHandler(e));
2286
- }
2287
- _selectStrategy(obj) {
2288
- if (_isPromise(obj)) {
2289
- return _promiseStrategy;
2290
- }
2291
- if (_isSubscribable(obj)) {
2292
- return _subscribableStrategy;
2293
- }
2294
- throw invalidPipeArgumentError(AsyncPipe, obj);
2295
- }
2296
- _dispose() {
2297
- this._strategy.dispose(this._subscription);
2298
- this._latestValue = null;
2299
- this._subscription = null;
2300
- this._obj = null;
2301
- }
2302
- _updateLatestValue(async, value) {
2303
- if (async === this._obj) {
2304
- this._latestValue = value;
2305
- if (this.markForCheckOnValueUpdate) {
2306
- this._ref?.markForCheck();
2307
- }
2308
- }
2309
- }
2310
- static ɵfac = function AsyncPipe_Factory(__ngFactoryType__) {
2311
- return new (__ngFactoryType__ || AsyncPipe)(i0.ɵɵdirectiveInject(i0.ChangeDetectorRef, 16));
2312
- };
2313
- static ɵpipe = /* @__PURE__ */i0.ɵɵdefinePipe({
2314
- name: "async",
2315
- pure: false,
2316
- type: AsyncPipe
2317
- });
2318
- }
2319
- (() => {
2320
- (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(AsyncPipe, [{
2321
- args: [{
2322
- name: 'async',
2323
- pure: false
2324
- }],
2325
- type: Pipe
2326
- }], () => [{
2327
- type: i0.ChangeDetectorRef
2328
- }], null);
2329
- })();
2330
- class LowerCasePipe {
2331
- transform(value) {
2332
- if (value == null) return null;
2333
- assertPipeArgument(LowerCasePipe, value);
2334
- return value.toLowerCase();
2335
- }
2336
- static ɵfac = function LowerCasePipe_Factory(__ngFactoryType__) {
2337
- return new (__ngFactoryType__ || LowerCasePipe)();
2338
- };
2339
- static ɵpipe = /* @__PURE__ */i0.ɵɵdefinePipe({
2340
- name: "lowercase",
2341
- pure: true,
2342
- type: LowerCasePipe
2343
- });
2344
- }
2345
- (() => {
2346
- (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(LowerCasePipe, [{
2347
- args: [{
2348
- name: 'lowercase'
2349
- }],
2350
- type: Pipe
2351
- }], null, null);
2352
- })();
2353
- const unicodeWordMatch = /(?:[0-9A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF38\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])\S*/g;
2354
- class TitleCasePipe {
2355
- transform(value) {
2356
- if (value == null) return null;
2357
- assertPipeArgument(TitleCasePipe, value);
2358
- return value.replace(unicodeWordMatch, txt => txt[0].toUpperCase() + txt.slice(1).toLowerCase());
2359
- }
2360
- static ɵfac = function TitleCasePipe_Factory(__ngFactoryType__) {
2361
- return new (__ngFactoryType__ || TitleCasePipe)();
2362
- };
2363
- static ɵpipe = /* @__PURE__ */i0.ɵɵdefinePipe({
2364
- name: "titlecase",
2365
- pure: true,
2366
- type: TitleCasePipe
2367
- });
2368
- }
2369
- (() => {
2370
- (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(TitleCasePipe, [{
2371
- args: [{
2372
- name: 'titlecase'
2373
- }],
2374
- type: Pipe
2375
- }], null, null);
2376
- })();
2377
- class UpperCasePipe {
2378
- transform(value) {
2379
- if (value == null) return null;
2380
- assertPipeArgument(UpperCasePipe, value);
2381
- return value.toUpperCase();
2382
- }
2383
- static ɵfac = function UpperCasePipe_Factory(__ngFactoryType__) {
2384
- return new (__ngFactoryType__ || UpperCasePipe)();
2385
- };
2386
- static ɵpipe = /* @__PURE__ */i0.ɵɵdefinePipe({
2387
- name: "uppercase",
2388
- pure: true,
2389
- type: UpperCasePipe
2390
- });
2391
- }
2392
- (() => {
2393
- (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(UpperCasePipe, [{
2394
- args: [{
2395
- name: 'uppercase'
2396
- }],
2397
- type: Pipe
2398
- }], null, null);
2399
- })();
2400
- function assertPipeArgument(pipe, value) {
2401
- if (typeof value !== 'string') {
2402
- throw invalidPipeArgumentError(pipe, value);
2403
- }
2404
- }
2405
- const DEFAULT_DATE_FORMAT = 'mediumDate';
2406
- const DATE_PIPE_DEFAULT_TIMEZONE = new InjectionToken(typeof ngDevMode !== 'undefined' && ngDevMode ? 'DATE_PIPE_DEFAULT_TIMEZONE' : '');
2407
- const DATE_PIPE_DEFAULT_OPTIONS = new InjectionToken(typeof ngDevMode !== 'undefined' && ngDevMode ? 'DATE_PIPE_DEFAULT_OPTIONS' : '');
2408
- class DatePipe {
2409
- locale;
2410
- defaultTimezone;
2411
- defaultOptions;
2412
- constructor(locale, defaultTimezone, defaultOptions) {
2413
- this.locale = locale;
2414
- this.defaultTimezone = defaultTimezone;
2415
- this.defaultOptions = defaultOptions;
2416
- }
2417
- transform(value, format, timezone, locale) {
2418
- if (value == null || value === '' || value !== value) return null;
2419
- try {
2420
- const _format = format ?? this.defaultOptions?.dateFormat ?? DEFAULT_DATE_FORMAT;
2421
- const _timezone = timezone ?? this.defaultOptions?.timezone ?? this.defaultTimezone ?? undefined;
2422
- return formatDate(value, _format, locale || this.locale, _timezone);
2423
- } catch (error) {
2424
- throw invalidPipeArgumentError(DatePipe, error.message);
2425
- }
2426
- }
2427
- static ɵfac = function DatePipe_Factory(__ngFactoryType__) {
2428
- return new (__ngFactoryType__ || DatePipe)(i0.ɵɵdirectiveInject(LOCALE_ID, 16), i0.ɵɵdirectiveInject(DATE_PIPE_DEFAULT_TIMEZONE, 24), i0.ɵɵdirectiveInject(DATE_PIPE_DEFAULT_OPTIONS, 24));
2429
- };
2430
- static ɵpipe = /* @__PURE__ */i0.ɵɵdefinePipe({
2431
- name: "date",
2432
- pure: true,
2433
- type: DatePipe
2434
- });
2435
- }
2436
- (() => {
2437
- (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(DatePipe, [{
2438
- args: [{
2439
- name: 'date'
2440
- }],
2441
- type: Pipe
2442
- }], () => [{
2443
- decorators: [{
2444
- args: [LOCALE_ID],
2445
- type: Inject
2446
- }],
2447
- type: undefined
2448
- }, {
2449
- decorators: [{
2450
- args: [DATE_PIPE_DEFAULT_TIMEZONE],
2451
- type: Inject
2452
- }, {
2453
- type: Optional
2454
- }],
2455
- type: undefined
2456
- }, {
2457
- decorators: [{
2458
- args: [DATE_PIPE_DEFAULT_OPTIONS],
2459
- type: Inject
2460
- }, {
2461
- type: Optional
2462
- }],
2463
- type: undefined
2464
- }], null);
2465
- })();
2466
- const _INTERPOLATION_REGEXP = /#/g;
2467
- class I18nPluralPipe {
2468
- _localization;
2469
- constructor(_localization) {
2470
- this._localization = _localization;
2471
- }
2472
- transform(value, pluralMap, locale) {
2473
- if (value == null) return '';
2474
- if (typeof pluralMap !== 'object' || pluralMap === null) {
2475
- throw invalidPipeArgumentError(I18nPluralPipe, pluralMap);
2476
- }
2477
- const key = getPluralCategory(value, Object.keys(pluralMap), this._localization, locale);
2478
- return pluralMap[key].replace(_INTERPOLATION_REGEXP, value.toString());
2479
- }
2480
- static ɵfac = function I18nPluralPipe_Factory(__ngFactoryType__) {
2481
- return new (__ngFactoryType__ || I18nPluralPipe)(i0.ɵɵdirectiveInject(NgLocalization, 16));
2482
- };
2483
- static ɵpipe = /* @__PURE__ */i0.ɵɵdefinePipe({
2484
- name: "i18nPlural",
2485
- pure: true,
2486
- type: I18nPluralPipe
2487
- });
2488
- }
2489
- (() => {
2490
- (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(I18nPluralPipe, [{
2491
- args: [{
2492
- name: 'i18nPlural'
2493
- }],
2494
- type: Pipe
2495
- }], () => [{
2496
- type: NgLocalization
2497
- }], null);
2498
- })();
2499
- class I18nSelectPipe {
2500
- transform(value, mapping) {
2501
- if (value == null) return '';
2502
- if (typeof mapping !== 'object' || typeof value !== 'string') {
2503
- throw invalidPipeArgumentError(I18nSelectPipe, mapping);
2504
- }
2505
- if (mapping.hasOwnProperty(value)) {
2506
- return mapping[value];
2507
- }
2508
- if (mapping.hasOwnProperty('other')) {
2509
- return mapping['other'];
2510
- }
2511
- return '';
2512
- }
2513
- static ɵfac = function I18nSelectPipe_Factory(__ngFactoryType__) {
2514
- return new (__ngFactoryType__ || I18nSelectPipe)();
2515
- };
2516
- static ɵpipe = /* @__PURE__ */i0.ɵɵdefinePipe({
2517
- name: "i18nSelect",
2518
- pure: true,
2519
- type: I18nSelectPipe
2520
- });
2521
- }
2522
- (() => {
2523
- (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(I18nSelectPipe, [{
2524
- args: [{
2525
- name: 'i18nSelect'
2526
- }],
2527
- type: Pipe
2528
- }], null, null);
2529
- })();
2530
- class JsonPipe {
2531
- transform(value) {
2532
- return JSON.stringify(value, null, 2);
2533
- }
2534
- static ɵfac = function JsonPipe_Factory(__ngFactoryType__) {
2535
- return new (__ngFactoryType__ || JsonPipe)();
2536
- };
2537
- static ɵpipe = /* @__PURE__ */i0.ɵɵdefinePipe({
2538
- name: "json",
2539
- pure: false,
2540
- type: JsonPipe
2541
- });
2542
- }
2543
- (() => {
2544
- (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(JsonPipe, [{
2545
- args: [{
2546
- name: 'json',
2547
- pure: false
2548
- }],
2549
- type: Pipe
2550
- }], null, null);
2551
- })();
2552
- function makeKeyValuePair(key, value) {
2553
- return {
2554
- key: key,
2555
- value: value
2556
- };
2557
- }
2558
- class KeyValuePipe {
2559
- differs;
2560
- constructor(differs) {
2561
- this.differs = differs;
2562
- }
2563
- differ;
2564
- keyValues = [];
2565
- compareFn = defaultComparator;
2566
- transform(input, compareFn = defaultComparator) {
2567
- if (!input || !(input instanceof Map) && typeof input !== 'object') {
2568
- return null;
2569
- }
2570
- this.differ ??= this.differs.find(input).create();
2571
- const differChanges = this.differ.diff(input);
2572
- const compareFnChanged = compareFn !== this.compareFn;
2573
- if (differChanges) {
2574
- this.keyValues = [];
2575
- differChanges.forEachItem(r => {
2576
- this.keyValues.push(makeKeyValuePair(r.key, r.currentValue));
2577
- });
2578
- }
2579
- if (differChanges || compareFnChanged) {
2580
- if (compareFn) {
2581
- this.keyValues.sort(compareFn);
2582
- }
2583
- this.compareFn = compareFn;
2584
- }
2585
- return this.keyValues;
2586
- }
2587
- static ɵfac = function KeyValuePipe_Factory(__ngFactoryType__) {
2588
- return new (__ngFactoryType__ || KeyValuePipe)(i0.ɵɵdirectiveInject(i0.KeyValueDiffers, 16));
2589
- };
2590
- static ɵpipe = /* @__PURE__ */i0.ɵɵdefinePipe({
2591
- name: "keyvalue",
2592
- pure: false,
2593
- type: KeyValuePipe
2594
- });
2595
- }
2596
- (() => {
2597
- (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(KeyValuePipe, [{
2598
- args: [{
2599
- name: 'keyvalue',
2600
- pure: false
2601
- }],
2602
- type: Pipe
2603
- }], () => [{
2604
- type: i0.KeyValueDiffers
2605
- }], null);
2606
- })();
2607
- function defaultComparator(keyValueA, keyValueB) {
2608
- const a = keyValueA.key;
2609
- const b = keyValueB.key;
2610
- if (a === b) return 0;
2611
- if (a == null) return 1;
2612
- if (b == null) return -1;
2613
- if (typeof a === 'string' && typeof b === 'string') {
2614
- return a < b ? -1 : 1;
2615
- }
2616
- if (typeof a === 'number' && typeof b === 'number') {
2617
- return a - b;
2618
- }
2619
- if (typeof a === 'boolean' && typeof b === 'boolean') {
2620
- return a < b ? -1 : 1;
2621
- }
2622
- const aString = String(a);
2623
- const bString = String(b);
2624
- return aString == bString ? 0 : aString < bString ? -1 : 1;
2625
- }
2626
- class DecimalPipe {
2627
- _locale;
2628
- constructor(_locale) {
2629
- this._locale = _locale;
2630
- }
2631
- transform(value, digitsInfo, locale) {
2632
- if (!isValue(value)) return null;
2633
- locale ||= this._locale;
2634
- try {
2635
- const num = strToNumber(value);
2636
- return formatNumber(num, locale, digitsInfo);
2637
- } catch (error) {
2638
- throw invalidPipeArgumentError(DecimalPipe, error.message);
2639
- }
2640
- }
2641
- static ɵfac = function DecimalPipe_Factory(__ngFactoryType__) {
2642
- return new (__ngFactoryType__ || DecimalPipe)(i0.ɵɵdirectiveInject(LOCALE_ID, 16));
2643
- };
2644
- static ɵpipe = /* @__PURE__ */i0.ɵɵdefinePipe({
2645
- name: "number",
2646
- pure: true,
2647
- type: DecimalPipe
2648
- });
2649
- }
2650
- (() => {
2651
- (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(DecimalPipe, [{
2652
- args: [{
2653
- name: 'number'
2654
- }],
2655
- type: Pipe
2656
- }], () => [{
2657
- decorators: [{
2658
- args: [LOCALE_ID],
2659
- type: Inject
2660
- }],
2661
- type: undefined
2662
- }], null);
2663
- })();
2664
- class PercentPipe {
2665
- _locale;
2666
- constructor(_locale) {
2667
- this._locale = _locale;
2668
- }
2669
- transform(value, digitsInfo, locale) {
2670
- if (!isValue(value)) return null;
2671
- locale ||= this._locale;
2672
- try {
2673
- const num = strToNumber(value);
2674
- return formatPercent(num, locale, digitsInfo);
2675
- } catch (error) {
2676
- throw invalidPipeArgumentError(PercentPipe, error.message);
2677
- }
2678
- }
2679
- static ɵfac = function PercentPipe_Factory(__ngFactoryType__) {
2680
- return new (__ngFactoryType__ || PercentPipe)(i0.ɵɵdirectiveInject(LOCALE_ID, 16));
2681
- };
2682
- static ɵpipe = /* @__PURE__ */i0.ɵɵdefinePipe({
2683
- name: "percent",
2684
- pure: true,
2685
- type: PercentPipe
2686
- });
2687
- }
2688
- (() => {
2689
- (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(PercentPipe, [{
2690
- args: [{
2691
- name: 'percent'
2692
- }],
2693
- type: Pipe
2694
- }], () => [{
2695
- decorators: [{
2696
- args: [LOCALE_ID],
2697
- type: Inject
2698
- }],
2699
- type: undefined
2700
- }], null);
2701
- })();
2702
- class CurrencyPipe {
2703
- _locale;
2704
- _defaultCurrencyCode;
2705
- constructor(_locale, _defaultCurrencyCode = 'USD') {
2706
- this._locale = _locale;
2707
- this._defaultCurrencyCode = _defaultCurrencyCode;
2708
- }
2709
- transform(value, currencyCode = this._defaultCurrencyCode, display = 'symbol', digitsInfo, locale) {
2710
- if (!isValue(value)) return null;
2711
- locale ||= this._locale;
2712
- if (typeof display === 'boolean') {
2713
- if (typeof ngDevMode === 'undefined' || ngDevMode) {
2714
- console.warn(`Warning: the currency pipe has been changed in Angular v5. The symbolDisplay option (third parameter) is now a string instead of a boolean. The accepted values are "code", "symbol" or "symbol-narrow".`);
2715
- }
2716
- display = display ? 'symbol' : 'code';
2717
- }
2718
- let currency = currencyCode || this._defaultCurrencyCode;
2719
- if (display !== 'code') {
2720
- if (display === 'symbol' || display === 'symbol-narrow') {
2721
- currency = getCurrencySymbol(currency, display === 'symbol' ? 'wide' : 'narrow', locale);
2722
- } else {
2723
- currency = display;
2724
- }
2725
- }
2726
- try {
2727
- const num = strToNumber(value);
2728
- return formatCurrency(num, locale, currency, currencyCode, digitsInfo);
2729
- } catch (error) {
2730
- throw invalidPipeArgumentError(CurrencyPipe, error.message);
2731
- }
2732
- }
2733
- static ɵfac = function CurrencyPipe_Factory(__ngFactoryType__) {
2734
- return new (__ngFactoryType__ || CurrencyPipe)(i0.ɵɵdirectiveInject(LOCALE_ID, 16), i0.ɵɵdirectiveInject(DEFAULT_CURRENCY_CODE, 16));
2735
- };
2736
- static ɵpipe = /* @__PURE__ */i0.ɵɵdefinePipe({
2737
- name: "currency",
2738
- pure: true,
2739
- type: CurrencyPipe
2740
- });
2741
- }
2742
- (() => {
2743
- (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CurrencyPipe, [{
2744
- args: [{
2745
- name: 'currency'
2746
- }],
2747
- type: Pipe
2748
- }], () => [{
2749
- decorators: [{
2750
- args: [LOCALE_ID],
2751
- type: Inject
2752
- }],
2753
- type: undefined
2754
- }, {
2755
- decorators: [{
2756
- args: [DEFAULT_CURRENCY_CODE],
2757
- type: Inject
2758
- }],
2759
- type: undefined
2760
- }], null);
2761
- })();
2762
- function isValue(value) {
2763
- return !(value == null || value === '' || value !== value);
2764
- }
2765
- function strToNumber(value) {
2766
- if (typeof value === 'string' && !isNaN(Number(value) - parseFloat(value))) {
2767
- return Number(value);
2768
- }
2769
- if (typeof value !== 'number') {
2770
- throw new _RuntimeError(2309, ngDevMode && `${value} is not a number`);
2771
- }
2772
- return value;
2773
- }
2774
- class SlicePipe {
2775
- transform(value, start, end) {
2776
- if (value == null) return null;
2777
- const supports = typeof value === 'string' || Array.isArray(value);
2778
- if (!supports) {
2779
- throw invalidPipeArgumentError(SlicePipe, value);
2780
- }
2781
- return value.slice(start, end);
2782
- }
2783
- static ɵfac = function SlicePipe_Factory(__ngFactoryType__) {
2784
- return new (__ngFactoryType__ || SlicePipe)();
2785
- };
2786
- static ɵpipe = /* @__PURE__ */i0.ɵɵdefinePipe({
2787
- name: "slice",
2788
- pure: false,
2789
- type: SlicePipe
2790
- });
2791
- }
2792
- (() => {
2793
- (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SlicePipe, [{
2794
- args: [{
2795
- name: 'slice',
2796
- pure: false
2797
- }],
2798
- type: Pipe
2799
- }], null, null);
2800
- })();
2801
- const COMMON_PIPES = [AsyncPipe, UpperCasePipe, LowerCasePipe, JsonPipe, SlicePipe, DecimalPipe, PercentPipe, TitleCasePipe, CurrencyPipe, DatePipe, I18nPluralPipe, I18nSelectPipe, KeyValuePipe];
2802
- class CommonModule {
2803
- static ɵfac = function CommonModule_Factory(__ngFactoryType__) {
2804
- return new (__ngFactoryType__ || CommonModule)();
2805
- };
2806
- static ɵmod = /* @__PURE__ */i0.ɵɵdefineNgModule({
2807
- type: CommonModule
2808
- });
2809
- static ɵinj = /* @__PURE__ */i0.ɵɵdefineInjector({});
2810
- }
2811
- (() => {
2812
- (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CommonModule, [{
2813
- args: [{
2814
- exports: [COMMON_DIRECTIVES, COMMON_PIPES],
2815
- imports: [COMMON_DIRECTIVES, COMMON_PIPES]
2816
- }],
2817
- type: NgModule
2818
- }], null, null);
2819
- })();
2820
- export { AsyncPipe, CommonModule, CurrencyPipe, DATE_PIPE_DEFAULT_OPTIONS, DATE_PIPE_DEFAULT_TIMEZONE, DatePipe, DecimalPipe, FormStyle, FormatWidth, HashLocationStrategy, I18nPluralPipe, I18nSelectPipe, JsonPipe, KeyValuePipe, LowerCasePipe, NgClass, NgComponentOutlet, NgForOf, NgForOfContext, NgIf, NgIfContext, NgLocaleLocalization, NgLocalization, NgPlural, NgPluralCase, NgStyle, NgSwitch, NgSwitchCase, NgSwitchDefault, NgTemplateOutlet, NumberFormatStyle, NumberSymbol, PercentPipe, Plural, SlicePipe, TitleCasePipe, TranslationWidth, UpperCasePipe, WeekDay, formatCurrency, formatDate, formatNumber, formatPercent, getCurrencySymbol, getLocaleCurrencyCode, getLocaleCurrencyName, getLocaleCurrencySymbol, getLocaleDateFormat, getLocaleDateTimeFormat, getLocaleDayNames, getLocaleDayPeriods, getLocaleDirection, getLocaleEraNames, getLocaleExtraDayPeriodRules, getLocaleExtraDayPeriods, getLocaleFirstDayOfWeek, getLocaleId, getLocaleMonthNames, getLocaleNumberFormat, getLocaleNumberSymbol, getLocalePluralCase, getLocaleTimeFormat, getLocaleWeekEndRange, getNumberOfCurrencyDigits };