{"version":3,"sources":["node_modules/@progress/kendo-licensing/dist/index.mjs","node_modules/@progress/kendo-intl/dist/es2015/cldr/default-data.js","node_modules/@progress/kendo-intl/dist/es2015/common/is-string.js","node_modules/@progress/kendo-intl/dist/es2015/error-details.js","node_modules/@progress/kendo-intl/dist/es2015/errors.js","node_modules/@progress/kendo-intl/dist/es2015/cldr/info.js","node_modules/@progress/kendo-intl/dist/es2015/common/constants.js","node_modules/@progress/kendo-intl/dist/es2015/cldr/load-numbers.js","node_modules/@progress/kendo-intl/dist/es2015/cldr/load-dates.js","node_modules/@progress/kendo-intl/dist/es2015/cldr/territory.js","node_modules/@progress/kendo-intl/dist/es2015/cldr/load-units.js","node_modules/@progress/kendo-intl/dist/es2015/cldr/load.js","node_modules/@progress/kendo-intl/dist/es2015/cldr/set-data.js","node_modules/@progress/kendo-intl/dist/es2015/cldr/date-field-name.js","node_modules/@progress/kendo-intl/dist/es2015/cldr/date-format-names.js","node_modules/@progress/kendo-intl/dist/es2015/cldr/parse-range-date.js","node_modules/@progress/kendo-intl/dist/es2015/cldr/currency.js","node_modules/@progress/kendo-intl/dist/es2015/cldr/constants.js","node_modules/@progress/kendo-intl/dist/es2015/cldr/first-day.js","node_modules/@progress/kendo-intl/dist/es2015/cldr/weekend-range.js","node_modules/@progress/kendo-intl/dist/es2015/cldr/number-symbols.js","node_modules/@progress/kendo-intl/dist/es2015/cldr.js","node_modules/@progress/kendo-intl/dist/es2015/common/is-negative-zero.js","node_modules/@progress/kendo-intl/dist/es2015/numbers/format-currency-symbol.js","node_modules/@progress/kendo-intl/dist/es2015/numbers/group-integer.js","node_modules/@progress/kendo-intl/dist/es2015/numbers/is-currency-style.js","node_modules/@progress/kendo-intl/dist/es2015/common/pad.js","node_modules/@progress/kendo-intl/dist/es2015/common/round.js","node_modules/@progress/kendo-intl/dist/es2015/numbers/standard-number-format.js","node_modules/@progress/kendo-intl/dist/es2015/numbers/utils.js","node_modules/@progress/kendo-intl/dist/es2015/numbers/custom-number-format.js","node_modules/@progress/kendo-intl/dist/es2015/numbers/format-options.js","node_modules/@progress/kendo-intl/dist/es2015/numbers/format-number.js","node_modules/@progress/kendo-intl/dist/es2015/common/is-number.js","node_modules/@progress/kendo-intl/dist/es2015/numbers/parse-number.js","node_modules/@progress/kendo-intl/dist/es2015/numbers.js","node_modules/@progress/kendo-intl/dist/es2015/common/format-string.js","node_modules/@progress/kendo-intl/dist/es2015/dates/date-pattern.js","node_modules/@progress/kendo-intl/dist/es2015/dates/date-name-type.js","node_modules/@progress/kendo-intl/dist/es2015/dates/format-names.js","node_modules/@progress/kendo-intl/dist/es2015/common/is-date.js","node_modules/@progress/kendo-intl/dist/es2015/dates/constants.js","node_modules/@progress/kendo-intl/dist/es2015/dates/format-date.js","node_modules/@progress/kendo-intl/dist/es2015/dates/time-utils.js","node_modules/@progress/kendo-intl/dist/es2015/dates/parse-date.js","node_modules/@progress/kendo-intl/dist/es2015/dates/split-date-format.js","node_modules/@progress/kendo-intl/dist/es2015/dates.js","node_modules/@progress/kendo-intl/dist/es2015/format.js","node_modules/@progress/kendo-intl/dist/es2015/main.js","node_modules/@progress/kendo-angular-intl/fesm2022/progress-kendo-angular-intl.mjs"],"sourcesContent":["var _0x10f4 = ['z2v0vgLTzq==', 'ww91CIbSAwnLBNnLigv4CgLYzwqGB24G', 'zgf0yq==', 'uhjVz3jLC3mG', 'AgvmshG=', 'u2vLia==', 'ChjVzhvJDenVzgvZ', 'C2nYAxb0s2v5', 'D3rmuhm=', 'rKjcwKG=', 'tM8GBgLJzw5ZzsbMB3vUzc4k', 'CgfJA2fNzu5HBwu=', 'qvfYAMq=', 'CgfYC2u=', 'ChjVzhvJDhm=', 'igzVCIbTB3jLigLUzM9YBwf0Aw9UlGO=', 'sgr5sMW=', 'rg9iAwe=', 'zxDJr2C=', 'Du9wCuK=', 'z2v0rNvSBfLLyxi=', 'lcb0AguGCgfJA2fNzsb3yxmGChvIBgLZAgvKig9Uia==', 'C2v0', 'zxrNsxC=', 'C29YDa==', 'EeXMBLu=', 'AgfZ', 's0XeCe8=', 'rM1Ttxy=', 'tNvstvG=', 'ww91CIb0CMLHBcbSAwnLBNnLigv4CgLYzwqGB24G', 'z2v0rgf0zq==', 'BgvUz3rO', 'txPHwe8=', 'BgLJzw5Zzuv4CgLYyxrPB25eyxrL', 'DhjPywW=', 'vejxq3K=', 'r2Ltv1q=', 'uhPWBva=', 'z2v0', 'vgHLihbYB2r1y3qGAxmGBM90igLUy2X1zgvKigLUihrOzsbSAwnLBNnLlGO=', 'z2v0tw9UDgG=', 's2DnDfK=', 'DMvYC2LVBG==', 'rKj6sum=', 'DgLTzxn0yw1W', 'B2jQzwn0', 'DhLWzq==', 'BgLJzw5ZAw5Nrg9JC1vYBa==', 'BMfTzq==', 'DwTXAeq=', 'zg9JC1vYBa==', 'z3jVDxbfBMq=', 'z3jVDxa=', 'yuDyzhy=', 'zMLUza==', 'D2fYBG==', 'zNvUy3rPB24=', 'Dw5KzwzPBMvK', 'ChjVzhvJDe5HBwu=', 'y29Uy2f0', 'ChvIBgLZAerHDgu=', 'zxHWAxj5rgf0zq==', 'CeDhAfu=', 'y29Kzq==', 'Dg9mB2nHBgvtDhjPBMC=', 'tgLJzw5ZzsbHy3rPDMf0Aw9UigzHAwXLzcbMB3iG'];\n(function (_0x50aaef, _0x10f4b0) {\n var _0x145713 = function (_0x421c90) {\n while (--_0x421c90) {\n _0x50aaef['push'](_0x50aaef['shift']());\n }\n };\n _0x145713(++_0x10f4b0);\n})(_0x10f4, 0x1b7);\nvar _0x1457 = function (_0x50aaef, _0x10f4b0) {\n _0x50aaef = _0x50aaef - 0x0;\n var _0x145713 = _0x10f4[_0x50aaef];\n if (_0x1457['aWziBr'] === undefined) {\n var _0x421c90 = function (_0x1aecb4) {\n var _0x16aa36 = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=',\n _0x27d11b = String(_0x1aecb4)['replace'](/=+$/, '');\n var _0x46c2e8 = '';\n for (var _0x29c8dd = 0x0, _0x5ea27f, _0x25dc8b, _0xcce210 = 0x0; _0x25dc8b = _0x27d11b['charAt'](_0xcce210++); ~_0x25dc8b && (_0x5ea27f = _0x29c8dd % 0x4 ? _0x5ea27f * 0x40 + _0x25dc8b : _0x25dc8b, _0x29c8dd++ % 0x4) ? _0x46c2e8 += String['fromCharCode'](0xff & _0x5ea27f >> (-0x2 * _0x29c8dd & 0x6)) : 0x0) {\n _0x25dc8b = _0x16aa36['indexOf'](_0x25dc8b);\n }\n return _0x46c2e8;\n };\n _0x1457['XjGMHe'] = function (_0x2c6af5) {\n var _0x1b5a14 = _0x421c90(_0x2c6af5);\n var _0x2181c6 = [];\n for (var _0x4e0ecf = 0x0, _0x1a2fc4 = _0x1b5a14['length']; _0x4e0ecf < _0x1a2fc4; _0x4e0ecf++) {\n _0x2181c6 += '%' + ('00' + _0x1b5a14['charCodeAt'](_0x4e0ecf)['toString'](0x10))['slice'](-0x2);\n }\n return decodeURIComponent(_0x2181c6);\n }, _0x1457['XQgCdR'] = {}, _0x1457['aWziBr'] = !![];\n }\n var _0x1b62be = _0x1457['XQgCdR'][_0x50aaef];\n return _0x1b62be === undefined ? (_0x145713 = _0x1457['XjGMHe'](_0x145713), _0x1457['XQgCdR'][_0x50aaef] = _0x145713) : _0x145713 = _0x1b62be, _0x145713;\n};\nvar context = {\n data: ' {\\\"timestamp\\\":1722846000,\\\"products\\\":[{\\\"trial\\\":false,\\\"code\\\":\\\"KENDOUIREACT\\\",\\\"licenseExpirationDate\\\":1739749344},{\\\"trial\\\":false,\\\"code\\\":\\\"KENDOUICOMPLETE\\\",\\\"licenseExpirationDate\\\":1739749344},{\\\"trial\\\":false,\\\"code\\\":\\\"KENDOUIVUE\\\",\\\"licenseExpirationDate\\\":1739749344},{\\\"trial\\\":false,\\\"code\\\":\\\"KENDOUIANGULAR\\\",\\\"licenseExpirationDate\\\":1739749344}],\\\"integrity\\\":\\\"vEzeRUu73IY/4h8FSlsqkn5QYUY=\\\"} '\n },\n cache = new Map();\nfunction setScriptKey(_0x35d548) {}\nfunction validatePackage(_0x401145) {\n if (cache[_0x1457('0x38')](_0x401145[_0x1457('0xc')])) {\n if (_0x1457('0x3a') !== _0x1457('0x3a')) {\n function _0x40b483() {\n _0x55416e[_0x1457('0x10')](_0x394293);\n }\n } else return cache[_0x1457('0x2')](_0x401145[_0x1457('0xc')]);\n }\n var _0x13003c = _0x401145[_0x1457('0x6')] ? '\\x20v' + _0x401145[_0x1457('0x6')] : '',\n _0x487465 = _0x401145[_0x1457('0xc')] + _0x13003c,\n _0x5ac69b = JSON[_0x1457('0x2b')](context[_0x1457('0x20')]),\n _0x12f1b9 = !_0x5ac69b[_0x1457('0x25')] && !_0x5ac69b[_0x1457('0x8')],\n _0x404bc6 = _0x5ac69b[_0x1457('0x25')] && typeof KendoLicensing === _0x1457('0x15'),\n _0x21bd47 = matchProduct(_0x5ac69b, _0x401145[_0x1457('0x24')]),\n _0x379487;\n if (_0x12f1b9 || _0x404bc6) {\n if (_0x1457('0x2a') === _0x1457('0x2f')) {\n function _0x32c728() {\n var _0x210aed = _0x1457('0x21')[_0x1457('0x17')](_0x1ec4d4[_0x1457('0x16')]),\n _0x5a1943 = typeof _0x5077fd[_0x1457('0x10')] === _0x1457('0x14');\n _0x5a1943 ? _0x1cbf22[_0x1457('0x10')](_0x210aed) : _0x52c64a[_0x1457('0x13')](_0x210aed), _0x19add1[_0x1457('0x13')](_0x2bf2c1(_0x2b5d62)), _0x5a1943 && _0x210919[_0x1457('0xf')]();\n }\n } else _0x379487 = {\n 'type': 0x0,\n 'packageName': _0x487465,\n 'docsUrl': _0x401145[_0x1457('0xb')]\n };\n } else {\n if (_0x1457('0x39') === _0x1457('0x39')) {\n if (!_0x21bd47) {\n if (_0x1457('0x1a') !== _0x1457('0x1a')) {\n function _0x118e65() {\n return _0x388bef[_0x1457('0x38')](_0x14b8a6[_0x1457('0x1b')]);\n }\n } else _0x379487 = {\n 'type': 0x1,\n 'packageName': _0x487465,\n 'docsUrl': _0x401145[_0x1457('0xb')]\n };\n } else {\n if (_0x21bd47[_0x1457('0x41')] === !![] && isExpired(getCurrentDate(), _0x21bd47[_0x1457('0x40')])) {\n if (_0x1457('0x0') === _0x1457('0x0')) _0x379487 = {\n 'type': 0x3,\n 'packageName': _0x487465,\n 'expiryDate': parseDate(_0x21bd47[_0x1457('0x40')]),\n 'docsUrl': _0x401145[_0x1457('0xb')]\n };else {\n function _0x2acfd0() {\n return new _0x538141(_0x6547c3 * 0x3e8);\n }\n }\n } else {\n if (isExpired(_0x401145[_0x1457('0x18')], _0x21bd47[_0x1457('0x40')])) {\n if (_0x1457('0x22') !== _0x1457('0x22')) {\n function _0x54738d() {\n _0xff686d += _0x1457('0x28');\n }\n } else _0x379487 = {\n 'type': 0x2,\n 'packageName': _0x487465,\n 'publishDate': parseDate(_0x401145[_0x1457('0x18')]),\n 'expiryDate': parseDate(_0x21bd47[_0x1457('0x40')]),\n 'docsUrl': _0x401145[_0x1457('0xb')]\n };\n }\n }\n }\n } else {\n function _0x45a77a() {\n _0x4e0ecf = {\n 'type': 0x0,\n 'packageName': _0x1a2fc4,\n 'docsUrl': _0x281109[_0x1457('0xb')]\n };\n }\n }\n }\n if (_0x379487 && typeof console === _0x1457('0x9')) {\n if (_0x1457('0x5') !== _0x1457('0x5')) {\n function _0x27a0d3() {\n _0x23dc27[_0x1457('0xf')]();\n }\n } else {\n var _0x3e0d1b = _0x1457('0x21')[_0x1457('0x17')](_0x401145[_0x1457('0x16')]),\n _0x225671 = typeof console[_0x1457('0x10')] === _0x1457('0x14');\n if (_0x225671) {\n if (_0x1457('0x2e') === _0x1457('0x2e')) console[_0x1457('0x10')](_0x3e0d1b);else {\n function _0x1c2d92() {\n if (!_0x3e4ff8) _0x37b223 = {\n 'type': 0x1,\n 'packageName': _0x36e726,\n 'docsUrl': _0x3f80b8[_0x1457('0xb')]\n };else {\n if (_0x15d67c[_0x1457('0x41')] === !![] && _0x3b51a9(_0x102df8(), _0x3171d7[_0x1457('0x40')])) _0x1e0cab = {\n 'type': 0x3,\n 'packageName': _0x2724db,\n 'expiryDate': _0x33ff27(_0x4eb9e1[_0x1457('0x40')]),\n 'docsUrl': _0x2a3029[_0x1457('0xb')]\n };else _0x2a1aff(_0x3a6131[_0x1457('0x18')], _0x30ed8b[_0x1457('0x40')]) && (_0x36826b = {\n 'type': 0x2,\n 'packageName': _0x2a7f61,\n 'publishDate': _0x19d46e(_0x3f1d0c[_0x1457('0x18')]),\n 'expiryDate': _0x18bd78(_0x3231eb[_0x1457('0x40')]),\n 'docsUrl': _0x265a7c[_0x1457('0xb')]\n });\n }\n }\n }\n } else {\n if (_0x1457('0x30') !== _0x1457('0x7')) console[_0x1457('0x13')](_0x3e0d1b);else {\n function _0x135861() {\n _0x283aa0 += _0x1457('0x3c')[_0x1457('0x17')](_0x111d35[_0x1457('0x19')][_0x1457('0x1c')](), '.\\x0a');\n }\n }\n }\n console[_0x1457('0x13')](formatError(_0x379487));\n if (_0x225671) {\n if (_0x1457('0xd') !== _0x1457('0xd')) {\n function _0x21b2c4() {\n _0x2b9264 = {\n 'type': 0x1,\n 'packageName': _0x346bb2,\n 'docsUrl': _0x2e7146[_0x1457('0xb')]\n };\n }\n } else console[_0x1457('0xf')]();\n }\n }\n }\n var _0x415e0e = !_0x379487;\n return cache[_0x1457('0x34')](_0x401145[_0x1457('0xc')], _0x415e0e), _0x415e0e;\n}\nfunction formatError(_0x594e89) {\n var _0x2d7e52 = _0x1457('0x1d')[_0x1457('0x17')](_0x594e89[_0x1457('0x29')], '\\x0a');\n if (_0x594e89[_0x1457('0xa')] === 0x2) {\n if (_0x1457('0x3f') !== _0x1457('0x1')) _0x2d7e52 += _0x1457('0x1f')[_0x1457('0x17')](_0x594e89[_0x1457('0x19')][_0x1457('0x1c')](), _0x1457('0x33'))[_0x1457('0x17')](_0x594e89[_0x1457('0x18')][_0x1457('0x1c')](), '.\\x0a');else {\n function _0x4205ac() {\n _0x339f11 = {\n 'type': 0x3,\n 'packageName': _0x324919,\n 'expiryDate': _0x301701(_0xaf8b40[_0x1457('0x40')]),\n 'docsUrl': _0x5b91f9[_0x1457('0xb')]\n };\n }\n }\n }\n if (_0x594e89[_0x1457('0xa')] === 0x3) {\n if (_0x1457('0x11') === _0x1457('0x11')) _0x2d7e52 += _0x1457('0x3c')[_0x1457('0x17')](_0x594e89[_0x1457('0x19')][_0x1457('0x1c')](), '.\\x0a');else {\n function _0x3e8c99() {\n _0x3f28ec += _0x1457('0x1f')[_0x1457('0x17')](_0x4667d4[_0x1457('0x19')][_0x1457('0x1c')](), _0x1457('0x33'))[_0x1457('0x17')](_0x23b5da[_0x1457('0x18')][_0x1457('0x1c')](), '.\\x0a');\n }\n }\n } else {\n if (_0x594e89[_0x1457('0xa')] === 0x0) {\n if (_0x1457('0x35') === _0x1457('0x35')) _0x2d7e52 += _0x1457('0x28');else {\n function _0x3442b2() {\n _0x5ccb08 += _0x1457('0x3');\n }\n }\n } else {\n if (_0x594e89[_0x1457('0xa')] === 0x1) {\n if (_0x1457('0x26') !== _0x1457('0x26')) {\n function _0x23b1cd() {\n var _0x5bedaa = _0x465bb0(_0x2ba0db),\n _0x6c2ce2 = new _0x4a6023(_0x5bedaa[_0x1457('0x32')](), _0x5bedaa[_0x1457('0x4')](), _0x5bedaa[_0x1457('0x3d')]() + 0x1),\n _0x34ce8e = _0x6c2ce2[_0x1457('0x1e')]() / 0x3e8;\n return _0x2f1bc7 > _0x34ce8e;\n }\n } else _0x2d7e52 += _0x1457('0x3');\n }\n }\n }\n return _0x2d7e52 += _0x1457('0x23')[_0x1457('0x17')](_0x594e89[_0x1457('0xe')], _0x1457('0x2d')), _0x2d7e52;\n}\nfunction matchProduct(_0x408a16, _0x9b416b) {\n var _0x45ca78 = _0x408a16[_0x1457('0x2c')];\n if (!_0x45ca78 || !_0x45ca78[_0x1457('0x3e')]) {\n if (_0x1457('0x27') !== _0x1457('0x37')) return null;else {\n function _0x52a8d4() {\n return _0x25dc8b[_0x1457('0x2')](_0xcce210[_0x1457('0xc')]);\n }\n }\n }\n var _0x1880f2 = new Set(_0x9b416b);\n return _0x45ca78[_0x1457('0x36')](function (_0x226118, _0x16f928) {\n if (_0x1457('0x42') !== _0x1457('0x31')) return _0x16f928[_0x1457('0x40')] - _0x226118[_0x1457('0x40')];else {\n function _0x3dde91() {\n return null;\n }\n }\n })[_0x1457('0x12')](function (_0x4632fe) {\n if (_0x1457('0x3b') === _0x1457('0x3b')) return _0x1880f2[_0x1457('0x38')](_0x4632fe[_0x1457('0x1b')]);else {\n function _0x43b66d() {\n return _0x22688d[_0x1457('0x40')] - _0x522bbc[_0x1457('0x40')];\n }\n }\n });\n}\nfunction parseDate(_0xe99283) {\n return new Date(_0xe99283 * 0x3e8);\n}\nfunction getCurrentDate() {\n return new Date()[_0x1457('0x1e')]() / 0x3e8;\n}\nfunction isExpired(_0x4b71d2, _0x1df709) {\n var _0x4f97fc = parseDate(_0x1df709),\n _0xea6b1d = new Date(_0x4f97fc[_0x1457('0x32')](), _0x4f97fc[_0x1457('0x4')](), _0x4f97fc[_0x1457('0x3d')]() + 0x1),\n _0x302664 = _0xea6b1d[_0x1457('0x1e')]() / 0x3e8;\n return _0x4b71d2 > _0x302664;\n}\nexport { setScriptKey, validatePackage };","const defaultData = {\n en: {\n name: \"en\",\n identity: {\n version: {\n _unicodeVersion: \"14.0.0\",\n _cldrVersion: \"41\"\n },\n language: \"en\"\n },\n territory: \"US\",\n numbers: {\n symbols: {\n decimal: \".\",\n group: \",\",\n list: \";\",\n percentSign: \"%\",\n plusSign: \"+\",\n minusSign: \"-\",\n exponential: \"E\",\n superscriptingExponent: \"×\",\n perMille: \"‰\",\n infinity: \"∞\",\n nan: \"NaN\",\n timeSeparator: \":\",\n approximatelySign: \"~\"\n },\n decimal: {\n patterns: [\"n\"],\n groupSize: [3]\n },\n scientific: {\n patterns: [\"nEn\"],\n groupSize: []\n },\n percent: {\n patterns: [\"n%\"],\n groupSize: [3]\n },\n currency: {\n patterns: [\"$n\"],\n groupSize: [3],\n \"unitPattern-count-one\": \"n $\",\n \"unitPattern-count-other\": \"n $\"\n },\n currencies: {\n BGN: {\n displayName: \"Bulgarian Lev\",\n \"displayName-count-one\": \"Bulgarian lev\",\n \"displayName-count-other\": \"Bulgarian leva\",\n symbol: \"BGN\"\n },\n EUR: {\n displayName: \"Euro\",\n \"displayName-count-one\": \"euro\",\n \"displayName-count-other\": \"euros\",\n symbol: \"€\",\n \"symbol-alt-narrow\": \"€\"\n },\n USD: {\n displayName: \"US Dollar\",\n \"displayName-count-one\": \"US dollar\",\n \"displayName-count-other\": \"US dollars\",\n symbol: \"$\",\n \"symbol-alt-narrow\": \"$\"\n }\n },\n localeCurrency: \"USD\",\n accounting: {\n patterns: [\"$n\", \"($n)\"],\n groupSize: [3]\n }\n },\n calendar: {\n gmtFormat: \"GMT{0}\",\n gmtZeroFormat: \"GMT\",\n patterns: {\n d: \"M/d/y\",\n D: \"EEEE, MMMM d, y\",\n m: \"MMM d\",\n M: \"MMMM d\",\n y: \"MMM y\",\n Y: \"MMMM y\",\n F: \"EEEE, MMMM d, y h:mm:ss a\",\n g: \"M/d/y h:mm a\",\n G: \"M/d/y h:mm:ss a\",\n t: \"h:mm a\",\n T: \"h:mm:ss a\",\n s: \"yyyy'-'MM'-'dd'T'HH':'mm':'ss\",\n u: \"yyyy'-'MM'-'dd HH':'mm':'ss'Z'\"\n },\n dateTimeFormats: {\n full: \"{1} 'at' {0}\",\n long: \"{1} 'at' {0}\",\n medium: \"{1}, {0}\",\n short: \"{1}, {0}\",\n availableFormats: {\n Bh: \"h B\",\n Bhm: \"h:mm B\",\n Bhms: \"h:mm:ss B\",\n d: \"d\",\n E: \"ccc\",\n EBhm: \"E h:mm B\",\n EBhms: \"E h:mm:ss B\",\n Ed: \"d E\",\n Ehm: \"E h:mm a\",\n EHm: \"E HH:mm\",\n Ehms: \"E h:mm:ss a\",\n EHms: \"E HH:mm:ss\",\n Gy: \"y G\",\n GyMd: \"M/d/y GGGGG\",\n GyMMM: \"MMM y G\",\n GyMMMd: \"MMM d, y G\",\n GyMMMEd: \"E, MMM d, y G\",\n h: \"h a\",\n H: \"HH\",\n hm: \"h:mm a\",\n Hm: \"HH:mm\",\n hms: \"h:mm:ss a\",\n Hms: \"HH:mm:ss\",\n hmsv: \"h:mm:ss a v\",\n Hmsv: \"HH:mm:ss v\",\n hmv: \"h:mm a v\",\n Hmv: \"HH:mm v\",\n M: \"L\",\n Md: \"M/d\",\n MEd: \"E, M/d\",\n MMM: \"LLL\",\n MMMd: \"MMM d\",\n MMMEd: \"E, MMM d\",\n MMMMd: \"MMMM d\",\n \"MMMMW-count-one\": \"'week' W 'of' MMMM\",\n \"MMMMW-count-other\": \"'week' W 'of' MMMM\",\n ms: \"mm:ss\",\n y: \"y\",\n yM: \"M/y\",\n yMd: \"M/d/y\",\n yMEd: \"E, M/d/y\",\n yMMM: \"MMM y\",\n yMMMd: \"MMM d, y\",\n yMMMEd: \"E, MMM d, y\",\n yMMMM: \"MMMM y\",\n yQQQ: \"QQQ y\",\n yQQQQ: \"QQQQ y\",\n \"yw-count-one\": \"'week' w 'of' Y\",\n \"yw-count-other\": \"'week' w 'of' Y\"\n }\n },\n timeFormats: {\n full: \"h:mm:ss a zzzz\",\n long: \"h:mm:ss a z\",\n medium: \"h:mm:ss a\",\n short: \"h:mm a\"\n },\n dateFormats: {\n full: \"EEEE, MMMM d, y\",\n long: \"MMMM d, y\",\n medium: \"MMM d, y\",\n short: \"M/d/yy\"\n },\n days: {\n format: {\n abbreviated: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"],\n narrow: [\"S\", \"M\", \"T\", \"W\", \"T\", \"F\", \"S\"],\n short: [\"Su\", \"Mo\", \"Tu\", \"We\", \"Th\", \"Fr\", \"Sa\"],\n wide: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"]\n },\n \"stand-alone\": {\n abbreviated: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"],\n narrow: [\"S\", \"M\", \"T\", \"W\", \"T\", \"F\", \"S\"],\n short: [\"Su\", \"Mo\", \"Tu\", \"We\", \"Th\", \"Fr\", \"Sa\"],\n wide: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"]\n }\n },\n months: {\n format: {\n abbreviated: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"],\n narrow: [\"J\", \"F\", \"M\", \"A\", \"M\", \"J\", \"J\", \"A\", \"S\", \"O\", \"N\", \"D\"],\n wide: [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"]\n },\n \"stand-alone\": {\n abbreviated: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"],\n narrow: [\"J\", \"F\", \"M\", \"A\", \"M\", \"J\", \"J\", \"A\", \"S\", \"O\", \"N\", \"D\"],\n wide: [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"]\n }\n },\n quarters: {\n format: {\n abbreviated: [\"Q1\", \"Q2\", \"Q3\", \"Q4\"],\n narrow: [\"1\", \"2\", \"3\", \"4\"],\n wide: [\"1st quarter\", \"2nd quarter\", \"3rd quarter\", \"4th quarter\"]\n },\n \"stand-alone\": {\n abbreviated: [\"Q1\", \"Q2\", \"Q3\", \"Q4\"],\n narrow: [\"1\", \"2\", \"3\", \"4\"],\n wide: [\"1st quarter\", \"2nd quarter\", \"3rd quarter\", \"4th quarter\"]\n }\n },\n dayPeriods: {\n format: {\n abbreviated: {\n midnight: \"midnight\",\n am: \"AM\",\n \"am-alt-variant\": \"am\",\n noon: \"noon\",\n pm: \"PM\",\n \"pm-alt-variant\": \"pm\",\n morning1: \"in the morning\",\n afternoon1: \"in the afternoon\",\n evening1: \"in the evening\",\n night1: \"at night\"\n },\n narrow: {\n midnight: \"mi\",\n am: \"a\",\n \"am-alt-variant\": \"am\",\n noon: \"n\",\n pm: \"p\",\n \"pm-alt-variant\": \"pm\",\n morning1: \"in the morning\",\n afternoon1: \"in the afternoon\",\n evening1: \"in the evening\",\n night1: \"at night\"\n },\n wide: {\n midnight: \"midnight\",\n am: \"AM\",\n \"am-alt-variant\": \"am\",\n noon: \"noon\",\n pm: \"PM\",\n \"pm-alt-variant\": \"pm\",\n morning1: \"in the morning\",\n afternoon1: \"in the afternoon\",\n evening1: \"in the evening\",\n night1: \"at night\"\n }\n },\n \"stand-alone\": {\n abbreviated: {\n midnight: \"midnight\",\n am: \"AM\",\n \"am-alt-variant\": \"am\",\n noon: \"noon\",\n pm: \"PM\",\n \"pm-alt-variant\": \"pm\",\n morning1: \"morning\",\n afternoon1: \"afternoon\",\n evening1: \"evening\",\n night1: \"night\"\n },\n narrow: {\n midnight: \"midnight\",\n am: \"AM\",\n \"am-alt-variant\": \"am\",\n noon: \"noon\",\n pm: \"PM\",\n \"pm-alt-variant\": \"pm\",\n morning1: \"morning\",\n afternoon1: \"afternoon\",\n evening1: \"evening\",\n night1: \"night\"\n },\n wide: {\n midnight: \"midnight\",\n am: \"AM\",\n \"am-alt-variant\": \"am\",\n noon: \"noon\",\n pm: \"PM\",\n \"pm-alt-variant\": \"pm\",\n morning1: \"morning\",\n afternoon1: \"afternoon\",\n evening1: \"evening\",\n night1: \"night\"\n }\n }\n },\n eras: {\n format: {\n wide: {\n \"0\": \"Before Christ\",\n \"1\": \"Anno Domini\",\n \"0-alt-variant\": \"Before Common Era\",\n \"1-alt-variant\": \"Common Era\"\n },\n abbreviated: {\n \"0\": \"BC\",\n \"1\": \"AD\",\n \"0-alt-variant\": \"BCE\",\n \"1-alt-variant\": \"CE\"\n },\n narrow: {\n \"0\": \"B\",\n \"1\": \"A\",\n \"0-alt-variant\": \"BCE\",\n \"1-alt-variant\": \"CE\"\n }\n }\n },\n dateFields: {\n era: {\n wide: \"era\",\n short: \"era\",\n narrow: \"era\"\n },\n year: {\n wide: \"year\",\n short: \"yr.\",\n narrow: \"yr.\"\n },\n quarter: {\n wide: \"quarter\",\n short: \"qtr.\",\n narrow: \"qtr.\"\n },\n month: {\n wide: \"month\",\n short: \"mo.\",\n narrow: \"mo.\"\n },\n week: {\n wide: \"week\",\n short: \"wk.\",\n narrow: \"wk.\"\n },\n weekOfMonth: {\n wide: \"week of month\",\n short: \"wk. of mo.\",\n narrow: \"wk. of mo.\"\n },\n day: {\n wide: \"day\",\n short: \"day\",\n narrow: \"day\"\n },\n dayOfYear: {\n wide: \"day of year\",\n short: \"day of yr.\",\n narrow: \"day of yr.\"\n },\n weekday: {\n wide: \"day of the week\",\n short: \"day of wk.\",\n narrow: \"day of wk.\"\n },\n weekdayOfMonth: {\n wide: \"weekday of the month\",\n short: \"wkday. of mo.\",\n narrow: \"wkday. of mo.\"\n },\n dayperiod: {\n short: \"AM/PM\",\n wide: \"AM/PM\",\n narrow: \"AM/PM\"\n },\n hour: {\n wide: \"hour\",\n short: \"hr.\",\n narrow: \"hr.\"\n },\n minute: {\n wide: \"minute\",\n short: \"min.\",\n narrow: \"min.\"\n },\n second: {\n wide: \"second\",\n short: \"sec.\",\n narrow: \"sec.\"\n },\n zone: {\n wide: \"time zone\",\n short: \"zone\",\n narrow: \"zone\"\n },\n millisecond: {\n narrow: \"ms\",\n short: \"ms\",\n wide: \"millisecond\"\n }\n }\n }\n },\n supplemental: {\n likelySubtags: {\n en: \"en-Latn-US\"\n },\n currencyData: {\n region: {\n US: [{\n USD: {\n _from: \"1792-01-01\"\n }\n }]\n }\n },\n weekData: {\n firstDay: {\n US: \"sun\"\n },\n weekendStart: {\n \"001\": \"sat\"\n },\n weekendEnd: {\n \"001\": \"sun\"\n }\n }\n }\n};\nexport default defaultData;","export default function isString(value) {\n return typeof value === \"string\";\n}","//The error is represented by unique name and corresponding message\n//The message can contain placeholders with index, e.g. {0}, {1}\n\nexport default {\n \"NoLocale\": \"Missing locale info for '{0}'\",\n \"NoCurrency\": \"Cannot determine currency information. Please load the locale currencies data.\",\n \"NoSupplementalCurrency\": \"Cannot determine currency. Please load the supplemental currencyData.\",\n \"NoCurrencyRegion\": \"No currency data for region '{0}'\",\n \"NoCurrencyDisplay\": \"Cannot determine currency display information. Please load the locale currencies data. The default culture does not include the all currencies data.\",\n \"NoGMTInfo\": \"Cannot determine locale GMT format. Please load the locale timeZoneNames data.\",\n \"NoWeekData\": \"Cannot determine locale first day of week. Please load the supplemental weekData.\",\n \"NoFirstDay\": \"Cannot determine locale first day of week. Please load the supplemental weekData. The default culture includes only the 'en-US' first day info.\",\n \"NoValidCurrency\": \"Cannot determine a default currency for the {0} locale. Please specify explicitly the currency with the format options.\",\n \"NoDateFieldNames\": \"Cannot determine the locale date field names. Please load the locale dateFields data.\"\n};","import errorDetails from './error-details';\nconst formatRegExp = /\\{(\\d+)}?\\}/g;\nclass IntlError {\n constructor({\n name,\n message\n }) {\n if (!name || !message) {\n throw new Error(\"{ name: string, message: string } object is required!\");\n }\n this.name = name;\n this.message = message;\n }\n formatMessage(...values) {\n const flattenValues = flatten(values);\n const formattedMessage = this.message.replace(formatRegExp, function (match, index) {\n return flattenValues[parseInt(index, 10)];\n });\n return `${this.name}: ${formattedMessage}`;\n }\n error(...values) {\n return new Error(this.formatMessage(values));\n }\n}\nconst flatten = function (arr) {\n return arr.reduce((a, b) => a.concat(b), []);\n};\nconst toIntlErrors = function (errors) {\n const predicate = function (prev, name) {\n prev[name] = new IntlError({\n name,\n message: errors[name]\n });\n return prev;\n };\n return Object.keys(errors).reduce(predicate, {});\n};\nconst errors = toIntlErrors(errorDetails);\nexport { errors, IntlError, toIntlErrors };","import defaultData from './default-data';\nimport isString from '../common/is-string';\nimport { errors } from '../errors';\nfunction availableLocaleInfo(fullName, suffixes) {\n const parts = fullName.split(\"-\");\n const language = parts[0];\n const script = parts[1];\n const territory = parts[2];\n return cldr[fullName] || suffixes.indexOf(territory) !== -1 && cldr[language + \"-\" + territory] || suffixes.indexOf(script) !== -1 && cldr[language + \"-\" + script] || cldr[language];\n}\nfunction localeFullName(language, suffixes) {\n const likelySubtags = cldr.supplemental.likelySubtags;\n for (let idx = 0; idx < suffixes.length; idx++) {\n let name = likelySubtags[language + \"-\" + suffixes[idx]];\n if (name) {\n return name;\n }\n }\n if (likelySubtags[language]) {\n return likelySubtags[language];\n }\n}\nexport const cldr = defaultData;\nexport function getLocaleInfo(locale) {\n let info;\n if (isString(locale)) {\n info = localeInfo(locale);\n } else {\n info = locale;\n }\n return info;\n}\nexport function localeInfo(locale) {\n if (cldr[locale]) {\n return cldr[locale];\n }\n const likelySubtags = cldr.supplemental.likelySubtags;\n if (likelySubtags) {\n const parts = locale.split(\"-\");\n const language = parts[0];\n const suffixes = parts.slice(1);\n const fullName = localeFullName(language, suffixes);\n const info = fullName ? availableLocaleInfo(fullName, suffixes) : null;\n if (info) {\n return info;\n }\n }\n throw errors.NoLocale.error(locale);\n}","export const DECIMAL = \"decimal\";\nexport const CURRENCY = \"currency\";\nexport const ACCOUNTING = \"accounting\";\nexport const PERCENT = \"percent\";\nexport const SCIENTIFIC = \"scientific\";\nexport const CURRENCY_PLACEHOLDER = \"$\";\nexport const PERCENT_PLACEHOLDER = \"%\";\nexport const NUMBER_PLACEHOLDER = \"n\";\nexport const LIST_SEPARATOR = \";\";\nexport const GROUP_SEPARATOR = \",\";\nexport const POINT = \".\";\nexport const EMPTY = \"\";\nexport const DEFAULT_LOCALE = \"en\";","import { cldr } from './info';\nimport { CURRENCY, ACCOUNTING, DECIMAL, CURRENCY_PLACEHOLDER, NUMBER_PLACEHOLDER, LIST_SEPARATOR, GROUP_SEPARATOR, POINT } from '../common/constants';\nconst LATIN_NUMBER_FORMATS = \"Formats-numberSystem-latn\";\nconst LATIN_NUMBER_SYMBOLS = \"symbols-numberSystem-latn\";\nconst patternRegExp = /([#,0.]+)/g;\nconst cldrCurrencyRegExp = /¤/g;\nfunction getPatterns(pattern) {\n patternRegExp.lastIndex = 0;\n return pattern.replace(cldrCurrencyRegExp, CURRENCY_PLACEHOLDER).replace(patternRegExp, NUMBER_PLACEHOLDER).split(LIST_SEPARATOR);\n}\nfunction getGroupSize(pattern) {\n patternRegExp.lastIndex = 0;\n const numberPatterns = patternRegExp.exec(pattern.split(LIST_SEPARATOR)[0])[0].split(POINT);\n const integer = numberPatterns[0];\n const groupSize = integer.split(GROUP_SEPARATOR).slice(1).map(function (group) {\n return group.length;\n }).reverse();\n return groupSize;\n}\nfunction loadCurrencyUnitPatterns(currencyInfo, currencyFormats) {\n for (let field in currencyFormats) {\n if (field.startsWith(\"unitPattern\")) {\n currencyInfo[field] = currencyFormats[field].replace(\"{0}\", NUMBER_PLACEHOLDER).replace(\"{1}\", CURRENCY_PLACEHOLDER);\n }\n }\n}\nexport default function loadNumbersInfo(locale, info) {\n const localeInfo = cldr[locale];\n const numbers = localeInfo.numbers = localeInfo.numbers || {};\n numbers.symbols = numbers.symbols || {};\n for (let field in info) {\n if (field === LATIN_NUMBER_SYMBOLS) {\n Object.assign(numbers.symbols, info[field]);\n } else if (field.includes(LATIN_NUMBER_FORMATS)) {\n const style = field.substr(0, field.indexOf(LATIN_NUMBER_FORMATS));\n const pattern = info[field].standard;\n numbers[style] = {\n patterns: getPatterns(pattern)\n };\n if (style === CURRENCY) {\n numbers[style].groupSize = getGroupSize((info[DECIMAL + LATIN_NUMBER_FORMATS] || info[field]).standard);\n loadCurrencyUnitPatterns(numbers[style], info[field]);\n numbers[ACCOUNTING] = {\n patterns: getPatterns(info[field][ACCOUNTING]),\n groupSize: numbers[style].groupSize\n };\n } else {\n numbers[style].groupSize = getGroupSize(pattern);\n }\n } else if (field === \"currencies\") {\n numbers.currencies = info[field];\n }\n }\n}","import { cldr } from './info';\nconst predefinedDatePatterns = {\n s: \"yyyy'-'MM'-'dd'T'HH':'mm':'ss\",\n u: \"yyyy'-'MM'-'dd HH':'mm':'ss'Z'\"\n};\nconst YEAR_REGEX = /y+/g;\nconst SHORT_DATE = [[\"dateFormats\", \"short\"]];\nconst datePatterns = {\n D: [[\"dateFormats\", \"full\"]],\n m: [[\"dateTimeFormats\", \"availableFormats\", \"MMMd\"]],\n M: [[\"dateTimeFormats\", \"availableFormats\", \"MMMMd\"]],\n y: [[\"dateTimeFormats\", \"availableFormats\", \"yMMM\"]],\n Y: [[\"dateTimeFormats\", \"availableFormats\", \"yMMMM\"]],\n F: [[\"dateFormats\", \"full\"], [\"timeFormats\", \"medium\"]],\n g: [[\"dateTimeFormats\", \"availableFormats\", \"yMd\"], [\"timeFormats\", \"short\"]],\n G: [[\"dateTimeFormats\", \"availableFormats\", \"yMd\"], [\"timeFormats\", \"medium\"]],\n t: [[\"timeFormats\", \"short\"]],\n T: [[\"timeFormats\", \"medium\"]]\n};\nfunction toArray(obj) {\n let result = [];\n let names = Object.getOwnPropertyNames(obj);\n for (let idx = 0; idx < names.length; idx++) {\n let value = obj[names[idx]];\n result.push(value);\n }\n return result;\n}\nfunction getCalendarNames(info, isObj) {\n const result = {};\n for (let formatType in info) {\n let names = result[formatType] = {};\n for (let format in info[formatType]) {\n let formats = info[formatType][format];\n names[format] = isObj ? formats : toArray(formats);\n }\n }\n return result;\n}\nfunction getEraNames(eras) {\n const result = {};\n const format = result.format = {};\n const eraNameMap = {\n eraAbbr: \"abbreviated\",\n eraNames: \"wide\",\n eraNarrow: \"narrow\"\n };\n for (let eraFormatName in eras) {\n let formatName = eraNameMap[eraFormatName];\n format[formatName] = eras[eraFormatName];\n }\n return result;\n}\nfunction loadCalendarNames(locale, calendar) {\n const localeCalendar = cldr[locale].calendar;\n localeCalendar.days = getCalendarNames(calendar.days);\n localeCalendar.months = getCalendarNames(calendar.months);\n localeCalendar.quarters = getCalendarNames(calendar.quarters);\n localeCalendar.dayPeriods = getCalendarNames(calendar.dayPeriods, true);\n localeCalendar.eras = getEraNames(calendar.eras);\n}\nfunction loadCalendarDateFields(locale, fields) {\n const localeCalendar = cldr[locale].calendar;\n const dateFields = {};\n for (let field in fields) {\n const [fieldName, formatType = 'wide'] = field.split('-');\n const fieldInfo = dateFields[fieldName] || {};\n const displayName = fields[field].displayName;\n if (!displayName) {\n continue;\n }\n fieldInfo[formatType] = displayName;\n dateFields[fieldName] = fieldInfo;\n }\n localeCalendar.dateFields = dateFields;\n}\nfunction getPredefinedFormat(paths, calendar) {\n const result = [];\n for (let pathIdx = 0; pathIdx < paths.length; pathIdx++) {\n let fields = paths[pathIdx];\n let pattern = calendar;\n for (let idx = 0; idx < fields.length; idx++) {\n pattern = pattern[fields[idx]];\n }\n result.push(pattern);\n }\n return result.join(\" \");\n}\nfunction loadCalendarPatterns(locale, calendar) {\n const cldrCalendar = cldr[locale].calendar;\n const patterns = cldrCalendar.patterns = {};\n patterns.d = getPredefinedFormat(SHORT_DATE, calendar).replace(YEAR_REGEX, 'y');\n for (let pattern in datePatterns) {\n patterns[pattern] = getPredefinedFormat(datePatterns[pattern], calendar);\n }\n for (let pattern in predefinedDatePatterns) {\n patterns[pattern] = predefinedDatePatterns[pattern];\n }\n const dateTimeFormats = calendar.dateTimeFormats;\n cldrCalendar.dateTimeFormats = {\n full: dateTimeFormats.full,\n long: dateTimeFormats.long,\n medium: dateTimeFormats.medium,\n short: dateTimeFormats.short,\n availableFormats: dateTimeFormats.availableFormats\n };\n cldrCalendar.timeFormats = calendar.timeFormats;\n cldrCalendar.dateFormats = calendar.dateFormats;\n}\nexport default function loadCalendarInfo(locale, info) {\n const calendar = cldr[locale].calendar = cldr[locale].calendar || {};\n for (let field in info) {\n if (field === \"timeZoneNames\") {\n calendar.gmtFormat = info[field].gmtFormat;\n calendar.gmtZeroFormat = info[field].gmtZeroFormat;\n } else if (field === \"calendars\" && info[field].gregorian) {\n loadCalendarPatterns(locale, info[field].gregorian);\n loadCalendarNames(locale, info[field].gregorian);\n } else if (field === \"fields\") {\n loadCalendarDateFields(locale, info.fields);\n }\n }\n}","import { cldr } from './info';\nfunction territoryFromName(name, identity) {\n const likelySubtags = cldr.supplemental.likelySubtags;\n let parts = name.split(\"-\");\n if (likelySubtags) {\n const likelyName = likelySubtags[name] || likelySubtags[parts[0]];\n if (likelyName) {\n parts = likelyName.split(\"-\");\n }\n }\n if (identity) {\n for (let idx = parts.length - 1; idx >= 1; idx--) {\n const part = parts[idx];\n if (part === identity.variant || part === identity.script) {\n parts.splice(idx, 1);\n }\n }\n }\n const length = parts.length;\n if (length > 1) {\n const territory = parts[length - 1];\n return territory.toUpperCase();\n }\n}\nexport default function localeTerritory(info) {\n if (info.territory) {\n return info.territory;\n }\n const name = info.name;\n const identity = info.identity;\n let territory;\n if (identity && identity.territory) {\n territory = identity.territory;\n } else {\n territory = territoryFromName(name, identity);\n }\n info.territory = territory;\n return territory;\n}","const MILLISECOND = 'duration-millisecond';\nconst UNIT_PATTERN_ONE = 'unitPattern-count-one';\nconst UNIT_PATTERN_OTHER = 'unitPattern-count-other';\nconst placeholderPattern = /\\{0\\}\\s?/;\nfunction extractUnit(unit) {\n const value = unit[UNIT_PATTERN_ONE] || unit[UNIT_PATTERN_OTHER];\n return value.replace(placeholderPattern, '');\n}\nexport default function loadUnits(localeInfo, units) {\n localeInfo.calendar.dateFields.millisecond = {\n narrow: extractUnit(units.narrow[MILLISECOND]),\n short: extractUnit(units.short[MILLISECOND]),\n wide: extractUnit(units.long[MILLISECOND])\n };\n}","import { cldr } from './info';\nimport loadNumbersInfo from './load-numbers';\nimport loadCalendarInfo from './load-dates';\nimport localeTerritory from './territory';\nimport loadUnits from './load-units';\nfunction loadLocale(locale, info) {\n for (let field in info) {\n if (field === \"numbers\") {\n loadNumbersInfo(locale, info[field]);\n } else if (field === \"dates\") {\n loadCalendarInfo(locale, info[field]);\n }\n }\n}\nexport default function load() {\n const length = arguments.length;\n for (let idx = 0; idx < length; idx++) {\n let entry = arguments[idx];\n if (entry.main) {\n let locale = Object.keys(entry.main)[0];\n let info = entry.main[locale];\n let localeInfo = cldr[locale] = cldr[locale] || {};\n if (info.units) {\n loadUnits(localeInfo, info.units);\n } else {\n localeInfo.name = localeInfo.name || locale;\n localeInfo.identity = localeInfo.identity || info.identity;\n localeTerritory(localeInfo);\n loadLocale(locale, info);\n }\n } else if (entry.supplemental) {\n if (entry.supplemental.weekData) {\n cldr.supplemental.weekData = {\n firstDay: entry.supplemental.weekData.firstDay,\n weekendStart: entry.supplemental.weekData.weekendStart,\n weekendEnd: entry.supplemental.weekData.weekendEnd\n };\n } else if (entry.supplemental.likelySubtags) {\n cldr.supplemental.likelySubtags = Object.assign(cldr.supplemental.likelySubtags, entry.supplemental.likelySubtags);\n } else if (entry.supplemental.currencyData) {\n const currencyData = cldr.supplemental.currencyData;\n currencyData.region = Object.assign(currencyData.region || {}, entry.supplemental.currencyData.region);\n currencyData.fractions = Object.assign(currencyData.fractions || {}, entry.supplemental.currencyData.fractions);\n }\n }\n }\n}","import { cldr } from './info';\nexport default function setData(data) {\n const locale = data.name;\n const info = cldr[locale] = cldr[locale] || {};\n const supplemental = cldr.supplemental = cldr.supplemental || {};\n if (data.likelySubtags) {\n supplemental.likelySubtags = Object.assign(supplemental.likelySubtags || {}, data.likelySubtags);\n }\n if (data.currencyData) {\n supplemental.currencyData = supplemental.currencyData || {};\n supplemental.currencyData.fractions = Object.assign(supplemental.currencyData.fractions || {}, data.currencyData);\n }\n const numbers = info.numbers;\n Object.assign(info, data);\n if (numbers && data.numbers) {\n info.numbers = Object.assign({}, numbers, data.numbers);\n }\n}","import { localeInfo } from './info';\nimport { errors } from '../errors';\nimport { DEFAULT_LOCALE } from '../common/constants';\nexport default function dateFieldName(options, locale = DEFAULT_LOCALE) {\n const info = localeInfo(locale);\n const dateFields = info.calendar.dateFields;\n if (!dateFields) {\n throw errors.NoDateFieldNames.error();\n }\n const fieldNameInfo = dateFields[options.type] || {};\n return fieldNameInfo[options.nameType] || fieldNameInfo['wide'];\n}","import { getLocaleInfo } from './info';\nimport { EMPTY } from '../common/constants';\nfunction lowerArray(arr) {\n const result = [];\n for (let idx = 0; idx < arr.length; idx++) {\n result.push(arr[idx].toLowerCase());\n }\n return result;\n}\nfunction lowerObject(obj) {\n const result = {};\n for (let field in obj) {\n result[field] = obj[field].toLowerCase();\n }\n return result;\n}\nfunction cloneLower(obj) {\n let result = Array.isArray(obj) ? lowerArray(obj) : lowerObject(obj);\n return result;\n}\nexport default function dateFormatNames(locale, options) {\n const {\n type,\n nameType,\n standAlone,\n lower\n } = options;\n const info = getLocaleInfo(locale);\n const formatType = standAlone ? \"stand-alone\" : \"format\";\n const lowerNameType = (lower ? \"lower-\" : EMPTY) + nameType;\n const formatNames = info.calendar[type][formatType];\n let result = formatNames[lowerNameType];\n if (!result && lower) {\n result = formatNames[lowerNameType] = cloneLower(formatNames[nameType]);\n }\n return result;\n}","export default function parseRangeDate(value) {\n const parts = value.split('-');\n const year = parseInt(parts[0], 10);\n const month = parseInt(parts[1], 10) - 1;\n const day = parseInt(parts[2], 10);\n return new Date(year, month, day);\n}","import { cldr, getLocaleInfo } from './info';\nimport { errors } from '../errors';\nimport localeTerritory from './territory';\nimport parseRangeDate from './parse-range-date';\n\n/* eslint-disable consistent-return */\n\nconst {\n NoCurrency,\n NoCurrencyDisplay,\n NoSupplementalCurrency,\n NoCurrencyRegion,\n NoValidCurrency\n} = errors;\nconst DEFAULT_CURRENCY_FRACTIONS = 2;\nconst SYMBOL = \"symbol\";\nconst INVALID_CURRENCY_CODE = 'XXX';\nconst GLOBAL_CURRENCIES = {\n '001': 'USD',\n // 001 refers to world. not sure if it is correct to assume USD but seems better than throw an error\n '150': 'EUR' // 150 territory for Europe\n};\nfunction getCurrencyInfo(locale, currency, throwIfNoValid) {\n const info = getLocaleInfo(locale);\n const currencies = info.numbers.currencies;\n if (!currencies) {\n if (throwIfNoValid) {\n throw NoCurrency.error();\n }\n return;\n }\n const currencyDisplayInfo = currencies[currency];\n if (!currencyDisplayInfo) {\n if (throwIfNoValid) {\n throw NoCurrencyDisplay.error();\n }\n return;\n }\n return currencyDisplayInfo;\n}\nfunction lengthComparer(a, b) {\n return b.length - a.length;\n}\nfunction regionCurrency(regionCurrencies) {\n let latestValidUntil, latestValidUntilRange;\n let latestStillValid, latestStillValidDate;\n for (let idx = 0; idx < regionCurrencies.length; idx++) {\n const currency = regionCurrencies[idx];\n const code = Object.keys(currency)[0];\n const info = currency[code];\n if (code !== INVALID_CURRENCY_CODE && info._tender !== 'false' && info._from) {\n if (!info._to) {\n const stillValidDate = parseRangeDate(info._from);\n if (!latestStillValidDate || latestStillValidDate < stillValidDate) {\n latestStillValid = code;\n latestStillValidDate = stillValidDate;\n }\n } else if (!latestStillValid) {\n const validFrom = parseRangeDate(info._from);\n const validTo = parseRangeDate(info._to);\n if (!latestValidUntilRange || latestValidUntilRange.to < validTo || latestValidUntilRange.from < validFrom) {\n latestValidUntil = code;\n latestValidUntilRange = {\n from: validFrom,\n to: validTo\n };\n }\n }\n }\n }\n return latestStillValid || latestValidUntil;\n}\nexport function currencyDisplays(locale, currency, throwIfNoValid = true) {\n const currencyInfo = getCurrencyInfo(locale, currency, throwIfNoValid);\n if (!currencyInfo) {\n return;\n }\n if (!currencyInfo.displays) {\n const displays = [currency];\n for (let field in currencyInfo) {\n displays.push(currencyInfo[field]);\n }\n displays.sort(lengthComparer);\n currencyInfo.displays = displays;\n }\n return currencyInfo.displays;\n}\nexport function currencyDisplay(locale, options) {\n const {\n value,\n currency,\n currencyDisplay = SYMBOL\n } = options;\n if (currencyDisplay === \"code\") {\n return currency;\n }\n const currencyInfo = getCurrencyInfo(locale, currency, true);\n let result;\n if (currencyDisplay === SYMBOL) {\n result = currencyInfo[\"symbol-alt-narrow\"] || currencyInfo[SYMBOL] || currency;\n } else {\n if (typeof value === \"undefined\" || value !== 1) {\n result = currencyInfo[\"displayName-count-other\"];\n } else {\n result = currencyInfo[\"displayName-count-one\"];\n }\n }\n return result;\n}\nexport function currencyFractionOptions(code) {\n let minimumFractionDigits = DEFAULT_CURRENCY_FRACTIONS;\n let maximumFractionDigits = DEFAULT_CURRENCY_FRACTIONS;\n const fractions = ((cldr.supplemental.currencyData || {}).fractions || {})[code];\n if (fractions && fractions._digits) {\n maximumFractionDigits = minimumFractionDigits = parseInt(fractions._digits, 10);\n }\n return {\n minimumFractionDigits: minimumFractionDigits,\n maximumFractionDigits: maximumFractionDigits\n };\n}\nexport function territoryCurrencyCode(territory, throwIfNoValid = true) {\n if (GLOBAL_CURRENCIES[territory]) {\n return GLOBAL_CURRENCIES[territory];\n }\n const currencyData = cldr.supplemental.currencyData;\n if (!currencyData) {\n if (throwIfNoValid) {\n throw NoSupplementalCurrency.error();\n }\n return;\n }\n const regionCurrencies = currencyData.region[territory];\n if (!regionCurrencies) {\n if (throwIfNoValid) {\n throw NoCurrencyRegion.error(territory);\n }\n return;\n }\n const currencyCode = regionCurrency(regionCurrencies);\n return currencyCode;\n}\nexport function localeCurrency(locale, throwIfNoValid) {\n const info = getLocaleInfo(locale);\n const numbers = info.numbers;\n if (!numbers.localeCurrency) {\n const currency = territoryCurrencyCode(localeTerritory(info), throwIfNoValid);\n if (!currency && throwIfNoValid) {\n throw NoValidCurrency.error(info.name);\n }\n numbers.localeCurrency = currency;\n }\n return numbers.localeCurrency;\n}","export const DAYS_OF_WEEK = [\"sun\", \"mon\", \"tue\", \"wed\", \"thu\", \"fri\", \"sat\"];\nexport const DEFAULT_TERRITORY = '001';","import { cldr, getLocaleInfo } from './info';\nimport localeTerritory from './territory';\nimport { DAYS_OF_WEEK, DEFAULT_TERRITORY } from './constants';\nimport { errors } from '../errors';\nconst {\n NoWeekData,\n NoFirstDay\n} = errors;\nexport default function firstDay(locale) {\n const info = getLocaleInfo(locale);\n if (!isNaN(info.firstDay)) {\n return info.firstDay;\n }\n const weekData = cldr.supplemental.weekData;\n if (!weekData) {\n throw NoWeekData.error();\n }\n const firstDay = weekData.firstDay[localeTerritory(info)] || weekData.firstDay[DEFAULT_TERRITORY];\n if (!firstDay) {\n throw NoFirstDay.error();\n }\n info.firstDay = DAYS_OF_WEEK.indexOf(firstDay);\n return info.firstDay;\n}","import { cldr, getLocaleInfo } from './info';\nimport localeTerritory from './territory';\nimport { DAYS_OF_WEEK, DEFAULT_TERRITORY } from './constants';\nimport { errors } from '../errors';\nconst {\n NoWeekData\n} = errors;\nexport default function weekendRange(locale) {\n const info = getLocaleInfo(locale);\n if (info.weekendRange) {\n return info.weekendRange;\n }\n const weekData = cldr.supplemental.weekData;\n if (!weekData) {\n throw NoWeekData.error();\n }\n const territory = localeTerritory(info);\n const start = weekData.weekendStart[territory] || weekData.weekendStart[DEFAULT_TERRITORY];\n const end = weekData.weekendEnd[territory] || weekData.weekendEnd[DEFAULT_TERRITORY];\n info.weekendRange = {\n start: DAYS_OF_WEEK.indexOf(start),\n end: DAYS_OF_WEEK.indexOf(end)\n };\n return info.weekendRange;\n}","import { getLocaleInfo } from './info';\nexport default function numberSymbols(locale) {\n const info = getLocaleInfo(locale);\n return info.numbers.symbols;\n}","export { default as load } from './cldr/load';\nexport { default as setData } from './cldr/set-data';\nexport { default as dateFieldName } from './cldr/date-field-name';\nexport { default as dateFormatNames } from './cldr/date-format-names';\nexport { cldr, localeInfo } from './cldr/info';\nexport { currencyDisplays, currencyDisplay, currencyFractionOptions, territoryCurrencyCode, localeCurrency } from './cldr/currency';\nexport { default as firstDay } from './cldr/first-day';\nexport { default as weekendRange } from './cldr/weekend-range';\nexport { default as numberSymbols } from './cldr/number-symbols';","export default function isNegativeZero(value) {\n return 1 / value === -Infinity;\n}","import { currencyDisplay, localeCurrency } from '../cldr';\nexport default function formatCurrencySymbol(info, options = {}) {\n if (!options.currency) {\n options.currency = localeCurrency(info, true);\n }\n const display = currencyDisplay(info, options);\n return display;\n}","export default function groupInteger(number, start, end, options, info) {\n const symbols = info.numbers.symbols;\n const decimalIndex = number.indexOf(symbols.decimal);\n const groupSizes = options.groupSize.slice();\n let groupSize = groupSizes.shift();\n let integerEnd = decimalIndex !== -1 ? decimalIndex : end + 1;\n let integer = number.substring(start, integerEnd);\n let result = number;\n const integerLength = integer.length;\n if (integerLength >= groupSize) {\n let idx = integerLength;\n let parts = [];\n while (idx > -1) {\n let value = integer.substring(idx - groupSize, idx);\n if (value) {\n parts.push(value);\n }\n idx -= groupSize;\n let newGroupSize = groupSizes.shift();\n groupSize = newGroupSize !== undefined ? newGroupSize : groupSize;\n if (groupSize === 0) {\n value = integer.substring(0, idx);\n if (value) {\n parts.push(value);\n }\n break;\n }\n }\n integer = parts.reverse().join(symbols.group);\n result = number.substring(0, start) + integer + number.substring(integerEnd);\n }\n return result;\n}","import { CURRENCY, ACCOUNTING } from '../common/constants';\nexport default function isCurrencyStyle(style) {\n return style === CURRENCY || style === ACCOUNTING;\n}","export default function pad(number, digits = 2, right = false) {\n const count = digits - String(number).length;\n let result = number;\n if (count > 0) {\n const padString = new Array(count + 1).join(\"0\");\n result = right ? number + padString : padString + number;\n }\n return result;\n}","const MAX_PRECISION = 20;\nexport default function round(value, precision) {\n let result = value;\n let decimals = precision || 0;\n result = result.toString().split('e');\n result = Math.round(Number(result[0] + 'e' + (result[1] ? Number(result[1]) + decimals : decimals)));\n result = result.toString().split('e');\n result = Number(result[0] + 'e' + (result[1] ? Number(result[1]) - decimals : -decimals));\n return result.toFixed(Math.min(decimals, MAX_PRECISION));\n}","import { PERCENT, SCIENTIFIC, NUMBER_PLACEHOLDER, CURRENCY_PLACEHOLDER, PERCENT_PLACEHOLDER, EMPTY, POINT } from '../common/constants';\nimport isNegativeZero from '../common/is-negative-zero';\nimport formatCurrencySymbol from './format-currency-symbol';\nimport groupInteger from './group-integer';\nimport isCurrencyStyle from './is-currency-style';\nimport pad from '../common/pad';\nimport round from '../common/round';\nimport { currencyFractionOptions } from '../cldr';\nconst DEFAULT_DECIMAL_ROUNDING = 3;\nconst DEFAULT_PERCENT_ROUNDING = 0;\nconst trailingZeroRegex = /0+$/;\nfunction fractionOptions(options) {\n let {\n minimumFractionDigits,\n maximumFractionDigits,\n style\n } = options;\n const isCurrency = isCurrencyStyle(style);\n let currencyFractions;\n if (isCurrency) {\n currencyFractions = currencyFractionOptions(options.currency);\n }\n if (minimumFractionDigits === undefined) {\n minimumFractionDigits = isCurrency ? currencyFractions.minimumFractionDigits : 0;\n }\n if (maximumFractionDigits === undefined) {\n if (style === PERCENT) {\n maximumFractionDigits = Math.max(minimumFractionDigits, DEFAULT_PERCENT_ROUNDING);\n } else if (isCurrency) {\n maximumFractionDigits = Math.max(minimumFractionDigits, currencyFractions.maximumFractionDigits);\n } else {\n maximumFractionDigits = Math.max(minimumFractionDigits, DEFAULT_DECIMAL_ROUNDING);\n }\n }\n return {\n minimumFractionDigits: minimumFractionDigits,\n maximumFractionDigits: maximumFractionDigits\n };\n}\nfunction applyPattern(value, pattern, symbol) {\n let result = EMPTY;\n for (let idx = 0, length = pattern.length; idx < length; idx++) {\n let ch = pattern.charAt(idx);\n if (ch === NUMBER_PLACEHOLDER) {\n result += value;\n } else if (ch === CURRENCY_PLACEHOLDER || ch === PERCENT_PLACEHOLDER) {\n result += symbol;\n } else {\n result += ch;\n }\n }\n return result;\n}\nfunction currencyUnitPattern(info, value) {\n const currencyInfo = info.numbers.currency;\n let pattern = value !== 1 ? currencyInfo[\"unitPattern-count-other\"] : currencyInfo[\"unitPattern-count-one\"];\n if (value < 0) {\n pattern = pattern.replace(NUMBER_PLACEHOLDER, `-${NUMBER_PLACEHOLDER}`);\n }\n return pattern;\n}\nexport default function standardNumberFormat(number, options, info) {\n const symbols = info.numbers.symbols;\n const {\n style\n } = options;\n const isCurrency = isCurrencyStyle(style);\n\n //return number in exponential format\n if (style === SCIENTIFIC) {\n let exponential = options.minimumFractionDigits !== undefined ? number.toExponential(options.minimumFractionDigits) : number.toExponential();\n return exponential.replace(POINT, symbols.decimal);\n }\n let value = number;\n let symbol;\n if (isCurrency) {\n options.value = value;\n symbol = formatCurrencySymbol(info, options);\n }\n if (style === PERCENT) {\n value *= 100;\n symbol = symbols.percentSign;\n }\n const {\n minimumFractionDigits,\n maximumFractionDigits\n } = fractionOptions(options);\n value = round(value, maximumFractionDigits);\n const negative = value < 0;\n const negativeZero = isNegativeZero(number);\n const parts = value.split(POINT);\n let integer = parts[0];\n let fraction = pad(parts[1] ? parts[1].replace(trailingZeroRegex, EMPTY) : EMPTY, minimumFractionDigits, true);\n\n //exclude \"-\" if number is negative.\n if (negative) {\n integer = integer.substring(1);\n }\n if (options.minimumIntegerDigits) {\n integer = pad(integer, options.minimumIntegerDigits);\n }\n let formattedValue = options.useGrouping !== false ? groupInteger(integer, 0, integer.length, options, info) : integer;\n if (fraction) {\n formattedValue += symbols.decimal + fraction;\n }\n let pattern;\n if (isCurrency && options.currencyDisplay === \"name\") {\n pattern = currencyUnitPattern(info, number);\n } else {\n const patterns = options.patterns;\n pattern = negative || negativeZero ? patterns[1] || \"-\" + patterns[0] : patterns[0];\n }\n if (pattern === NUMBER_PLACEHOLDER && !negative) {\n return formattedValue;\n }\n const result = applyPattern(formattedValue, pattern, symbol);\n return result;\n}","import { PERCENT_PLACEHOLDER, CURRENCY_PLACEHOLDER, CURRENCY, PERCENT, EMPTY } from '../common/constants';\nimport formatCurrencySymbol from './format-currency-symbol';\nconst literalRegExp = /(\\\\.)|(['][^']*[']?)|([\"][^\"]*[\"]?)/g;\nconst PLACEHOLDER = \"__??__\";\nexport function setStyleOptions(formatOptions, info) {\n const format = formatOptions.format;\n\n //multiply number if the format has percent\n if (format.indexOf(PERCENT_PLACEHOLDER) !== -1) {\n formatOptions.style = PERCENT;\n formatOptions.symbol = info.numbers.symbols.percentSign;\n formatOptions.number *= 100;\n }\n if (format.indexOf(CURRENCY_PLACEHOLDER) !== -1) {\n formatOptions.style = CURRENCY;\n formatOptions.symbol = formatCurrencySymbol(info);\n }\n}\nexport function setFormatLiterals(formatOptions) {\n let format = formatOptions.format;\n if (format.indexOf(\"'\") > -1 || format.indexOf(\"\\\"\") > -1 || format.indexOf(\"\\\\\") > -1) {\n const literals = formatOptions.literals = [];\n formatOptions.format = format.replace(literalRegExp, function (match) {\n const quoteChar = match.charAt(0).replace(\"\\\\\", EMPTY);\n const literal = match.slice(1).replace(quoteChar, EMPTY);\n literals.push(literal);\n return PLACEHOLDER;\n });\n }\n}\nexport function replaceLiterals(number, literals) {\n let result = number;\n if (literals) {\n const length = literals.length;\n for (let idx = 0; idx < length; idx++) {\n result = result.replace(PLACEHOLDER, literals[idx]);\n }\n }\n return result;\n}","import { CURRENCY, PERCENT, LIST_SEPARATOR, GROUP_SEPARATOR, CURRENCY_PLACEHOLDER, PERCENT_PLACEHOLDER, POINT, EMPTY } from '../common/constants';\nimport isNegativeZero from '../common/is-negative-zero';\nimport groupInteger from './group-integer';\nimport round from '../common/round';\nimport { setStyleOptions, setFormatLiterals, replaceLiterals } from './utils';\nconst SHARP = \"#\";\nconst ZERO = \"0\";\nconst trailingZerosRegExp = /(\\.(?:[0-9]*[1-9])?)0+$/g;\nconst trailingPointRegExp = /\\.$/;\nconst commaRegExp = /,/g;\nfunction trimTrailingZeros(value, lastZero) {\n let trimRegex;\n if (lastZero === 0) {\n trimRegex = trailingZerosRegExp;\n } else {\n trimRegex = new RegExp(`(\\\\.[0-9]{${lastZero}}[1-9]*)0+$`, 'g');\n }\n return value.replace(trimRegex, '$1').replace(trailingPointRegExp, EMPTY);\n}\nfunction roundNumber(formatOptions) {\n let {\n number,\n format\n } = formatOptions;\n let decimalIndex = format.indexOf(POINT);\n if (decimalIndex !== -1) {\n const zeroIndex = format.lastIndexOf(ZERO) - decimalIndex;\n const sharpIndex = format.lastIndexOf(SHARP) - decimalIndex;\n const hasZero = zeroIndex > -1;\n const hasSharp = sharpIndex > -1;\n let fraction = number.toString().split(\"e\");\n if (fraction[1]) {\n fraction = round(number, Math.abs(fraction[1]));\n } else {\n fraction = fraction[0];\n }\n fraction = fraction.split(POINT)[1] || EMPTY;\n let precision = fraction.length;\n let trailingZeros = -1;\n if (!hasZero && !hasSharp) {\n formatOptions.format = format.substring(0, decimalIndex) + format.substring(decimalIndex + 1);\n decimalIndex = -1;\n precision = 0;\n } else if (hasZero && zeroIndex > sharpIndex) {\n precision = zeroIndex;\n } else if (sharpIndex > zeroIndex) {\n if (hasSharp && precision > sharpIndex) {\n precision = sharpIndex;\n } else if (hasZero && precision < zeroIndex) {\n precision = zeroIndex;\n }\n trailingZeros = hasZero ? zeroIndex : 0;\n }\n if (precision > -1) {\n number = round(number, precision);\n if (trailingZeros > -1) {\n number = trimTrailingZeros(number, trailingZeros);\n }\n }\n } else {\n number = round(number);\n }\n if (formatOptions.negative && number * -1 >= 0 && !formatOptions.negativeZero) {\n formatOptions.negative = false;\n }\n formatOptions.number = number;\n formatOptions.decimalIndex = decimalIndex;\n}\nfunction isConstantFormat(format) {\n return format.indexOf(SHARP) === -1 && format.indexOf(ZERO) === -1;\n}\nfunction setValueSpecificFormat(formatOptions) {\n let {\n number,\n format\n } = formatOptions;\n format = format.split(LIST_SEPARATOR);\n if ((formatOptions.negative || formatOptions.negativeZero) && format[1]) {\n format = format[1];\n formatOptions.hasNegativeFormat = true;\n } else if (number === 0) {\n const zeroFormat = format[2];\n format = zeroFormat || format[0];\n if (zeroFormat && isConstantFormat(zeroFormat)) {\n formatOptions.constant = zeroFormat;\n }\n } else {\n format = format[0];\n }\n formatOptions.format = format;\n}\nfunction setGroupOptions(formatOptions) {\n formatOptions.hasGroup = formatOptions.format.indexOf(GROUP_SEPARATOR) > -1;\n if (formatOptions.hasGroup) {\n formatOptions.format = formatOptions.format.replace(commaRegExp, EMPTY);\n }\n}\nfunction placeholderIndex(index1, index2, start) {\n let index;\n if (index1 === -1 && index2 !== -1) {\n index = index2;\n } else if (index1 !== -1 && index2 === -1) {\n index = index1;\n } else {\n index = start ? Math.min(index1, index2) : Math.max(index1, index2);\n }\n return index;\n}\nfunction setPlaceholderIndices(formatOptions) {\n const format = formatOptions.format;\n let sharpIndex = format.indexOf(SHARP);\n let zeroIndex = format.indexOf(ZERO);\n let start = placeholderIndex(sharpIndex, zeroIndex, true);\n sharpIndex = format.lastIndexOf(SHARP);\n zeroIndex = format.lastIndexOf(ZERO);\n let end = placeholderIndex(sharpIndex, zeroIndex);\n if (start === format.length) {\n end = start;\n }\n formatOptions.start = start;\n formatOptions.end = end;\n formatOptions.lastZeroIndex = zeroIndex;\n}\nfunction replaceStyleSymbols(number, style, symbol) {\n let result = number;\n if (style === CURRENCY || style === PERCENT) {\n result = EMPTY;\n for (let idx = 0, length = number.length; idx < length; idx++) {\n let ch = number.charAt(idx);\n result += ch === CURRENCY_PLACEHOLDER || ch === PERCENT_PLACEHOLDER ? symbol : ch;\n }\n }\n return result;\n}\nfunction replacePlaceHolders(formatOptions, info) {\n const {\n start,\n end,\n negative,\n negativeZero,\n format,\n decimalIndex,\n lastZeroIndex,\n hasNegativeFormat,\n hasGroup\n } = formatOptions;\n let number = formatOptions.number;\n const value = number.toString().split(POINT);\n const length = format.length;\n const integer = value[0];\n const fraction = value[1] || EMPTY;\n const integerLength = integer.length;\n let replacement = EMPTY;\n number = format.substring(0, start);\n if ((negative || negativeZero) && !hasNegativeFormat) {\n number += \"-\";\n }\n for (let idx = start; idx < length; idx++) {\n let ch = format.charAt(idx);\n if (decimalIndex === -1) {\n if (end - idx < integerLength) {\n number += integer;\n break;\n }\n } else {\n if (lastZeroIndex !== -1 && lastZeroIndex < idx) {\n replacement = EMPTY;\n }\n if (decimalIndex - idx <= integerLength && decimalIndex - idx > -1) {\n number += integer;\n idx = decimalIndex;\n }\n if (decimalIndex === idx) {\n number += (fraction ? info.numbers.symbols.decimal : EMPTY) + fraction;\n idx += end - decimalIndex + 1;\n continue;\n }\n }\n if (ch === ZERO) {\n number += ch;\n replacement = ch;\n } else if (ch === SHARP) {\n number += replacement;\n }\n }\n if (hasGroup) {\n number = groupInteger(number, start + (negative && !hasNegativeFormat ? 1 : 0), Math.max(end, integerLength + start), info.numbers.decimal, info);\n }\n if (end >= start) {\n number += format.substring(end + 1);\n }\n return number;\n}\nfunction applyCustomFormat(formatOptions, info) {\n let number = formatOptions.number;\n if (formatOptions.start !== -1) {\n number = replacePlaceHolders(formatOptions, info);\n number = replaceStyleSymbols(number, formatOptions.style, formatOptions.symbol);\n number = replaceLiterals(number, formatOptions.literals);\n }\n return number;\n}\nexport default function customNumberFormat(number, format, info) {\n const formatOptions = {\n negative: number < 0,\n number: Math.abs(number),\n negativeZero: isNegativeZero(number),\n format: format\n };\n setValueSpecificFormat(formatOptions);\n if (formatOptions.constant) {\n return formatOptions.constant;\n }\n setFormatLiterals(formatOptions);\n setStyleOptions(formatOptions, info);\n setGroupOptions(formatOptions);\n roundNumber(formatOptions);\n setPlaceholderIndices(formatOptions);\n return applyCustomFormat(formatOptions, info);\n}","import { CURRENCY, ACCOUNTING, DECIMAL, PERCENT, SCIENTIFIC } from '../common/constants';\nimport isString from '../common/is-string';\nconst standardFormatRegExp = /^(n|c|p|e|a)(\\d*)$/i;\nfunction standardFormatOptions(format) {\n const formatAndPrecision = standardFormatRegExp.exec(format);\n if (formatAndPrecision) {\n const options = {\n style: DECIMAL\n };\n let style = formatAndPrecision[1].toLowerCase();\n if (style === \"c\") {\n options.style = CURRENCY;\n } else if (style === \"a\") {\n options.style = ACCOUNTING;\n } else if (style === \"p\") {\n options.style = PERCENT;\n } else if (style === \"e\") {\n options.style = SCIENTIFIC;\n }\n if (formatAndPrecision[2]) {\n options.minimumFractionDigits = options.maximumFractionDigits = parseInt(formatAndPrecision[2], 10);\n }\n return options;\n }\n}\nexport default function formatOptions(format) {\n let options;\n if (isString(format)) {\n options = standardFormatOptions(format);\n } else {\n options = format;\n }\n return options;\n}","import { localeInfo } from '../cldr';\nimport { DECIMAL, DEFAULT_LOCALE, NUMBER_PLACEHOLDER, EMPTY } from '../common/constants';\nimport standardNumberFormat from './standard-number-format';\nimport customNumberFormat from './custom-number-format';\nimport formatOptions from './format-options';\nexport default function formatNumber(number, format = NUMBER_PLACEHOLDER, locale = DEFAULT_LOCALE) {\n if (number === undefined || number === null) {\n return EMPTY;\n }\n if (!isFinite(number)) {\n return String(number);\n }\n const info = localeInfo(locale);\n const options = formatOptions(format);\n let result;\n if (options) {\n const style = options.style || DECIMAL;\n result = standardNumberFormat(number, Object.assign({}, info.numbers[style], options), info);\n } else {\n result = customNumberFormat(number, format, info);\n }\n return result;\n}","export default function isNumber(value) {\n return typeof value === \"number\";\n}","import { localeInfo, localeCurrency, currencyDisplays } from '../cldr';\nimport { PERCENT, NUMBER_PLACEHOLDER, CURRENCY_PLACEHOLDER, DEFAULT_LOCALE, EMPTY, POINT } from '../common/constants';\nimport { setStyleOptions, setFormatLiterals } from './utils';\nimport isNumber from '../common/is-number';\nimport isCurrencyStyle from './is-currency-style';\nimport formatOptions from './format-options';\nimport isString from '../common/is-string';\nconst exponentRegExp = /[eE][-+]?[0-9]+/;\nconst nonBreakingSpaceRegExp = /\\u00A0/g;\nfunction cleanNegativePattern(number, patterns) {\n if (patterns.length > 1) {\n const parts = (patterns[1] || EMPTY).replace(CURRENCY_PLACEHOLDER, EMPTY).split(NUMBER_PLACEHOLDER);\n if (number.indexOf(parts[0]) > -1 && number.indexOf(parts[1]) > -1) {\n return number.replace(parts[0], EMPTY).replace(parts[1], EMPTY);\n }\n }\n}\nfunction cleanCurrencyNumber(value, info, format) {\n const options = formatOptions(format) || {};\n let isCurrency = isCurrencyStyle(options.style);\n let number = value;\n let negative;\n const currency = options.currency || localeCurrency(info, isCurrency);\n if (currency) {\n const displays = currencyDisplays(info, currency, isCurrency);\n if (displays) {\n for (let idx = 0; idx < displays.length; idx++) {\n let display = displays[idx];\n if (number.includes(display)) {\n number = number.replace(display, EMPTY);\n isCurrency = true;\n break;\n }\n }\n }\n if (isCurrency) {\n const cleanNumber = cleanNegativePattern(number, info.numbers.currency.patterns) || cleanNegativePattern(number, info.numbers.accounting.patterns);\n if (cleanNumber) {\n negative = true;\n number = cleanNumber;\n }\n }\n }\n return {\n number: number,\n negative: negative\n };\n}\nfunction cleanLiterals(number, formatOptions) {\n const literals = formatOptions.literals;\n let result = number;\n if (literals) {\n for (let idx = 0; idx < literals.length; idx++) {\n result = result.replace(literals[idx], EMPTY);\n }\n }\n return result;\n}\nfunction divideBy100(number) {\n const strNumber = String(number);\n const pointIndex = strNumber.indexOf(POINT);\n const zeroesCount = 2;\n let result = number / Math.pow(10, zeroesCount);\n if (pointIndex === -1 || String(result).length <= strNumber.length + zeroesCount) {\n return result;\n }\n const fractionDigits = strNumber.length - pointIndex + 1 + zeroesCount;\n return parseFloat(result.toFixed(fractionDigits));\n}\nexport default function parseNumber(value, locale = DEFAULT_LOCALE, format = {}) {\n if (!value && value !== 0) {\n return null;\n }\n if (isNumber(value)) {\n return value;\n }\n const info = localeInfo(locale);\n const symbols = info.numbers.symbols;\n let number = value.toString();\n let formatOptions = format || {};\n let isPercent;\n if (isString(format)) {\n formatOptions = {\n format: format\n };\n setFormatLiterals(formatOptions);\n number = cleanLiterals(number, formatOptions);\n setStyleOptions(formatOptions, info);\n }\n if (formatOptions.style === PERCENT || number.indexOf(symbols.percentSign) > -1) {\n number = number.replace(symbols.percentSign, EMPTY);\n isPercent = true;\n }\n if (exponentRegExp.test(number)) {\n number = parseFloat(number.replace(symbols.decimal, POINT));\n return isNaN(number) ? null : number;\n }\n const {\n negative: negativeCurrency,\n number: currencyNumber\n } = cleanCurrencyNumber(number, info, formatOptions);\n number = String(currencyNumber).trim();\n const negativeSignIndex = number.indexOf(\"-\");\n if (negativeSignIndex > 0) {\n return null;\n }\n let isNegative = negativeSignIndex > -1;\n isNegative = negativeCurrency !== undefined ? negativeCurrency : isNegative;\n number = number.replace(\"-\", EMPTY).replace(nonBreakingSpaceRegExp, \" \").split(symbols.group.replace(nonBreakingSpaceRegExp, \" \")).join(EMPTY).replace(symbols.decimal, POINT);\n number = parseFloat(number);\n if (isNaN(number)) {\n number = null;\n } else if (isNegative) {\n number *= -1;\n }\n if (number && isPercent) {\n number = divideBy100(number);\n }\n return number;\n}","export { default as formatNumber } from './numbers/format-number';\nexport { default as parseNumber } from './numbers/parse-number';","const formatRegExp = /\\{(\\d+)}/g;\nexport default function formatString(format) {\n const values = arguments;\n return format.replace(formatRegExp, (match, index) => {\n const value = values[parseInt(index, 10) + 1];\n return value;\n });\n}","import formatString from '../common/format-string';\nimport isString from '../common/is-string';\nimport { EMPTY } from '../common/constants';\nconst REMOVAL_PENALTY = 120;\nconst ADDITION_PENALTY = 20;\nconst LENGHT_DELTA = [2, 1, 5, 3, 4];\nconst LONG_LESS_PENALTY_DELTA = -2;\nconst SHORT_LESS_PENALTY_DELTA = -1;\nconst SHORT_MORE_PENALTY_DELTA = 1;\nconst LONG_MORE_PENALTY_DELTA = 2;\nconst PENALTIES = {\n [LONG_LESS_PENALTY_DELTA.toString()]: 8,\n [SHORT_LESS_PENALTY_DELTA.toString()]: 6,\n [LONG_MORE_PENALTY_DELTA.toString()]: 6,\n [SHORT_MORE_PENALTY_DELTA.toString()]: 3\n};\nconst VALUE_FORMAT_LENGTH = {\n numeric: 1,\n \"2-digit\": 2,\n short: 3,\n long: 4,\n narrow: 5\n};\nconst TIME_SPECIFIERS_REGEX = /[hHmsSzZoOvVxX]/;\nfunction getHourSpecifier(options) {\n return options.hour12 ? \"h\" : \"H\";\n}\nconst DATE_OPTIONS_MAP = [{\n key: \"era\",\n specifier: \"G\"\n}, {\n key: \"year\",\n specifier: \"y\"\n}, {\n key: \"month\",\n specifier: \"M\"\n}, {\n key: \"day\",\n specifier: \"d\"\n}, {\n key: \"weekday\",\n specifier: \"E\"\n}, {\n key: \"hour\",\n getSpecifier: getHourSpecifier\n}, {\n key: \"minute\",\n specifier: \"m\"\n}, {\n key: \"second\",\n specifier: \"s\"\n}, {\n key: \"timeZoneName\",\n specifier: \"z\"\n}];\nconst STAND_ALONE_SPECIFIERS = {\n e: 'c',\n E: 'c',\n M: 'L',\n Q: 'q'\n};\nconst specifiersRegex = {};\nconst resolvedFormats = {};\nfunction getSpecifierRegex(specifier) {\n if (!specifiersRegex[specifier]) {\n specifiersRegex[specifier] = new RegExp(specifier + \"+\");\n }\n return specifiersRegex[specifier];\n}\nfunction skeletonSpecifiers(skeleton) {\n const result = [];\n let current = skeleton.charAt(0);\n let specifier = current;\n for (let idx = 1; idx < skeleton.length; idx++) {\n let character = skeleton.charAt(idx);\n if (character === specifier) {\n current += character;\n } else {\n result.push(current);\n current = specifier = character;\n }\n }\n result.push(current);\n return result;\n}\nfunction findBestMatch(specifiers, availableFormats) {\n const specifiersLength = specifiers.length;\n let maxScore = -Number.MAX_VALUE;\n let bestMatches, result;\n for (let format in availableFormats) {\n const matches = [];\n let currentFormat = format.replace(\"v\", \"z\");\n let score = 0;\n for (let idx = 0; idx < specifiersLength; idx++) {\n const specifier = specifiers[idx];\n let specifierRegex = getSpecifierRegex(specifier[0]);\n let match = (specifierRegex.exec(currentFormat) || [])[0];\n if (!match) {\n score -= REMOVAL_PENALTY;\n } else {\n currentFormat = currentFormat.replace(match, EMPTY);\n if (match.length !== specifier.length) {\n let delta = Math.max(Math.min(LENGHT_DELTA[match.length] - LENGHT_DELTA[specifier.length], 2), -2);\n score -= PENALTIES[delta];\n }\n }\n matches.push(match);\n if (score < maxScore) {\n break;\n }\n }\n if (currentFormat.length) {\n score -= skeletonSpecifiers(currentFormat).length * ADDITION_PENALTY;\n }\n if (score > maxScore) {\n maxScore = score;\n bestMatches = matches;\n result = availableFormats[format];\n }\n }\n result = result.replace(\"v\", \"z\");\n for (let idx = 0; idx < specifiersLength; idx++) {\n const bestMatch = bestMatches[idx];\n if (bestMatch && bestMatch !== specifiers[idx]) {\n const matchSpecifier = bestMatches[idx][0];\n result = result.replace(getSpecifierRegex(matchSpecifier), specifiers[idx]);\n if (STAND_ALONE_SPECIFIERS[matchSpecifier]) {\n result = result.replace(getSpecifierRegex(STAND_ALONE_SPECIFIERS[matchSpecifier]), specifiers[idx]);\n }\n }\n }\n return result;\n}\nfunction cacheFormat(skeleton, format, locale) {\n if (!resolvedFormats[locale]) {\n resolvedFormats[locale] = {};\n }\n resolvedFormats[locale][skeleton] = format;\n}\nfunction skeletonFormat(skeleton, info) {\n const availableFormats = info.calendar.dateTimeFormats.availableFormats;\n if (availableFormats[skeleton]) {\n return availableFormats[skeleton];\n }\n if (resolvedFormats[info.name] && resolvedFormats[info.name][skeleton]) {\n return resolvedFormats[info.name][skeleton];\n }\n const timeStartIndex = skeleton.search(TIME_SPECIFIERS_REGEX);\n let result;\n if (timeStartIndex > 0) {\n const dateSkeleton = skeleton.substr(0, timeStartIndex);\n const timeSkeleton = skeleton.substr(timeStartIndex);\n result = formatString(info.calendar.dateTimeFormats.short,\n //should be deterimed based on specifiers\n availableFormats[timeSkeleton] || findBestMatch(skeletonSpecifiers(timeSkeleton), availableFormats), availableFormats[dateSkeleton] || findBestMatch(skeletonSpecifiers(dateSkeleton), availableFormats));\n } else {\n result = findBestMatch(skeletonSpecifiers(skeleton), availableFormats);\n }\n cacheFormat(skeleton, result, info.name);\n return result;\n}\nfunction skeletonFromOptions(options) {\n let result = [];\n for (let idx = 0; idx < DATE_OPTIONS_MAP.length; idx++) {\n let option = DATE_OPTIONS_MAP[idx];\n let field = option.key;\n let value = options[field];\n if (value) {\n let spcifier = option.specifier || option.getSpecifier(options);\n result.push(spcifier.repeat(VALUE_FORMAT_LENGTH[value]));\n }\n }\n return result.join(EMPTY);\n}\nexport default function datePattern(format, info) {\n const calendar = info.calendar;\n let result;\n if (isString(format)) {\n if (calendar.patterns[format]) {\n result = calendar.patterns[format];\n } else {\n result = format;\n }\n } else if (format) {\n if (format.pattern) {\n return format.pattern;\n }\n let skeleton = format.skeleton;\n if (!skeleton) {\n if (format.datetime) {\n result = formatString(calendar.dateTimeFormats[format.datetime], calendar.timeFormats[format.datetime], calendar.dateFormats[format.datetime]);\n } else if (format.date) {\n result = calendar.dateFormats[format.date];\n } else if (format.time) {\n result = calendar.timeFormats[format.time];\n } else {\n skeleton = skeletonFromOptions(format);\n }\n }\n if (skeleton) {\n result = skeletonFormat(skeleton, info);\n }\n }\n if (!result) {\n result = calendar.patterns.d;\n }\n return result;\n}","export default function dateNameType(formatLength) {\n let nameType;\n if (formatLength <= 3) {\n nameType = \"abbreviated\";\n } else if (formatLength === 4) {\n nameType = \"wide\";\n } else if (formatLength === 5) {\n nameType = \"narrow\";\n } else if (formatLength === 6) {\n nameType = \"short\";\n }\n return nameType;\n}","import dateFormatNames from '../cldr/date-format-names';\nimport dateNameType from './date-name-type';\nexport default function formatNames(locale, type, formatLength, standAlone, lower) {\n return dateFormatNames(locale, {\n type: type,\n nameType: dateNameType(formatLength),\n standAlone: standAlone,\n lower: lower\n });\n}","function isFunction(fun) {\n return typeof fun === 'function';\n}\nexport default function isDate(value) {\n return Boolean(value) && isFunction(value.getTime) && isFunction(value.getMonth);\n}","const MONTH = 'month';\nconst HOUR = 'hour';\nconst ZONE = 'zone';\nconst WEEKDAY = 'weekday';\nconst QUARTER = 'quarter';\nconst DATE_FIELD_MAP = {\n 'G': 'era',\n 'y': 'year',\n 'q': QUARTER,\n 'Q': QUARTER,\n 'M': MONTH,\n 'L': MONTH,\n 'd': 'day',\n 'E': WEEKDAY,\n 'c': WEEKDAY,\n 'e': WEEKDAY,\n 'h': HOUR,\n 'H': HOUR,\n 'k': HOUR,\n 'K': HOUR,\n 'm': 'minute',\n 's': 'second',\n 'S': 'millisecond',\n 'a': 'dayperiod',\n 'x': ZONE,\n 'X': ZONE,\n 'z': ZONE,\n 'Z': ZONE\n};\nconst dateFormatRegExp = /d{1,2}|E{1,6}|e{1,6}|c{3,6}|c{1}|M{1,5}|L{1,5}|y{1,4}|H{1,2}|h{1,2}|k{1,2}|K{1,2}|m{1,2}|a{1,5}|s{1,2}|S{1,3}|z{1,4}|Z{1,5}|x{1,5}|X{1,5}|G{1,5}|q{1,5}|Q{1,5}|\"[^\"]*\"|'[^']*'/g;\nexport { dateFormatRegExp, DATE_FIELD_MAP };","import { localeInfo, firstDay } from '../cldr';\nimport { DEFAULT_LOCALE, EMPTY } from '../common/constants';\nimport formatString from '../common/format-string';\nimport datePattern from './date-pattern';\nimport formatNames from './format-names';\nimport pad from '../common/pad';\nimport isDate from '../common/is-date';\nimport { dateFormatRegExp } from './constants';\nfunction formatDayOfWeekIndex(day, formatLength, localeInfo) {\n const firstDayIndex = firstDay(localeInfo);\n let dayIndex;\n if (day < firstDayIndex) {\n dayIndex = 7 - firstDayIndex + day;\n } else {\n dayIndex = day - firstDayIndex;\n }\n return dayIndex + 1;\n}\nfunction formatMonth(month, formatLength, info, standAlone) {\n if (formatLength <= 2) {\n return pad(month + 1, formatLength);\n }\n return formatNames(info, \"months\", formatLength, standAlone)[month];\n}\nfunction formatQuarter(date, formatLength, info, standAlone) {\n const quarter = Math.floor(date.getMonth() / 3);\n if (formatLength < 3) {\n return quarter + 1;\n }\n return formatNames(info, \"quarters\", formatLength, standAlone)[quarter];\n}\nfunction formatTimeZone(date, info, options) {\n const {\n shortHours,\n optionalMinutes,\n separator,\n localizedName,\n zZeroOffset\n } = options;\n const offset = date.getTimezoneOffset() / 60;\n if (offset === 0 && zZeroOffset) {\n return \"Z\";\n }\n const sign = offset <= 0 ? \"+\" : \"-\";\n const hoursMinutes = Math.abs(offset).toString().split(\".\");\n const minutes = hoursMinutes[1] || 0;\n let result = sign + (shortHours ? hoursMinutes[0] : pad(hoursMinutes[0], 2));\n if (minutes || !optionalMinutes) {\n result += (separator ? \":\" : EMPTY) + pad(minutes, 2);\n }\n if (localizedName) {\n const localizedFormat = offset === 0 ? info.calendar.gmtZeroFormat : info.calendar.gmtFormat;\n result = formatString(localizedFormat, result);\n }\n return result;\n}\nfunction formatDayOfWeek(date, formatLength, info, standAlone) {\n let result;\n if (formatLength < 3) {\n result = formatDayOfWeekIndex(date.getDay(), formatLength, info);\n } else {\n result = formatNames(info, \"days\", formatLength, standAlone)[date.getDay()];\n }\n return result;\n}\nconst formatters = {};\nformatters.d = function (date, formatLength) {\n return pad(date.getDate(), formatLength);\n};\nformatters.E = function (date, formatLength, info) {\n return formatNames(info, \"days\", formatLength)[date.getDay()];\n};\nformatters.M = function (date, formatLength, info) {\n return formatMonth(date.getMonth(), formatLength, info, false);\n};\nformatters.L = function (date, formatLength, info) {\n return formatMonth(date.getMonth(), formatLength, info, true);\n};\nformatters.y = function (date, formatLength) {\n let year = date.getFullYear();\n if (formatLength === 2) {\n year = year % 100;\n }\n return pad(year, formatLength);\n};\nformatters.h = function (date, formatLength) {\n const hours = date.getHours() % 12 || 12;\n return pad(hours, formatLength);\n};\nformatters.H = function (date, formatLength) {\n return pad(date.getHours(), formatLength);\n};\nformatters.k = function (date, formatLength) {\n return pad(date.getHours() || 24, formatLength);\n};\nformatters.K = function (date, formatLength) {\n return pad(date.getHours() % 12, formatLength);\n};\nformatters.m = function (date, formatLength) {\n return pad(date.getMinutes(), formatLength);\n};\nformatters.s = function (date, formatLength) {\n return pad(date.getSeconds(), formatLength);\n};\nformatters.S = function (date, formatLength) {\n const milliseconds = date.getMilliseconds();\n let result;\n if (milliseconds !== 0) {\n result = pad(String(milliseconds / 1000).split(\".\")[1].substr(0, formatLength), formatLength, true);\n } else {\n result = pad(EMPTY, formatLength);\n }\n return result;\n};\nformatters.a = function (date, formatLength, info) {\n return formatNames(info, \"dayPeriods\", formatLength)[date.getHours() < 12 ? \"am\" : \"pm\"];\n};\nformatters.z = function (date, formatLength, info) {\n return formatTimeZone(date, info, {\n shortHours: formatLength < 4,\n optionalMinutes: formatLength < 4,\n separator: true,\n localizedName: true\n });\n};\nformatters.Z = function (date, formatLength, info) {\n return formatTimeZone(date, info, {\n separator: formatLength > 3,\n localizedName: formatLength === 4,\n zZeroOffset: formatLength === 5\n });\n};\nformatters.x = function (date, formatLength, info) {\n return formatTimeZone(date, info, {\n optionalMinutes: formatLength === 1,\n separator: formatLength === 3 || formatLength === 5\n });\n};\nformatters.X = function (date, formatLength, info) {\n return formatTimeZone(date, info, {\n optionalMinutes: formatLength === 1,\n separator: formatLength === 3 || formatLength === 5,\n zZeroOffset: true\n });\n};\nformatters.G = function (date, formatLength, info) {\n let era = date.getFullYear() >= 0 ? 1 : 0;\n return formatNames(info, \"eras\", formatLength)[era];\n};\nformatters.e = formatDayOfWeek;\nformatters.c = function (date, formatLength, info) {\n return formatDayOfWeek(date, formatLength, info, true);\n};\nformatters.q = function (date, formatLength, info) {\n return formatQuarter(date, formatLength, info, true);\n};\nformatters.Q = formatQuarter;\nexport default function formatDate(date, format, locale = DEFAULT_LOCALE) {\n if (!isDate(date)) {\n if (date === undefined || date === null) {\n return EMPTY;\n }\n return date;\n }\n const info = localeInfo(locale);\n const pattern = datePattern(format, info);\n return pattern.replace(dateFormatRegExp, function (match) {\n let formatLength = match.length;\n let result;\n if (match.includes(\"'\") || match.includes(\"\\\"\")) {\n result = match.slice(1, formatLength - 1);\n } else {\n result = formatters[match[0]](date, formatLength, info);\n }\n return result;\n });\n}","export function convertTimeZone(date, fromOffset, toOffset) {\n const fromLocalOffset = date.getTimezoneOffset();\n const offsetDate = new Date(date.getTime() + (fromOffset - toOffset) * 60000);\n const toLocalOffset = offsetDate.getTimezoneOffset();\n return new Date(offsetDate.getTime() + (toLocalOffset - fromLocalOffset) * 60000);\n}\nexport function adjustDST(date, hours) {\n if (!hours && date.getHours() === 23) {\n date.setHours(date.getHours() + 2);\n }\n}","import { adjustDST, convertTimeZone } from './time-utils';\nimport { localeInfo } from '../cldr';\nimport { DEFAULT_LOCALE, EMPTY } from '../common/constants';\nimport { errors } from '../errors';\nimport formatNames from './format-names';\nimport datePattern from './date-pattern';\nimport round from '../common/round';\nimport isDate from '../common/is-date';\nconst timeZoneOffsetRegExp = /([+|-]\\d{1,2})(:?)(\\d{2})?/;\nconst dateRegExp = /^\\/Date\\((.*?)\\)\\/$/;\nconst offsetRegExp = /[+-]\\d*/;\nconst numberRegExp = {\n 2: /^\\d{1,2}/,\n 3: /^\\d{1,3}/,\n 4: /^\\d{4}/\n};\nconst numberRegex = /\\d+/;\nconst PLACEHOLDER = \"{0}\";\nconst leadingSpacesRegex = /^ */;\nconst trailingSpacesRegex = / *$/;\nconst standardDateFormats = [\"yyyy/MM/dd HH:mm:ss\", \"yyyy/MM/dd HH:mm\", \"yyyy/MM/dd\", \"E MMM dd yyyy HH:mm:ss\", \"yyyy-MM-ddTHH:mm:ss.SSSSSSSXXX\", \"yyyy-MM-ddTHH:mm:ss.SSSXXX\", \"yyyy-MM-ddTHH:mm:ss.SSXXX\", \"yyyy-MM-ddTHH:mm:ssXXX\", \"yyyy-MM-ddTHH:mm:ss.SSSSSSS\", \"yyyy-MM-ddTHH:mm:ss.SSS\", \"yyyy-MM-ddTHH:mmXXX\", \"yyyy-MM-ddTHH:mmX\", \"yyyy-MM-ddTHH:mm:ss\", \"yyyy-MM-ddTHH:mm\", \"yyyy-MM-dd HH:mm:ss\", \"yyyy-MM-dd HH:mm\", \"yyyy-MM-dd\", \"HH:mm:ss\", \"HH:mm\"];\nconst FORMATS_SEQUENCE = [\"G\", \"g\", \"F\", \"Y\", \"y\", \"M\", \"m\", \"D\", \"d\", \"y\", \"T\", \"t\"];\nconst TWO_DIGIT_YEAR_MAX = 2029;\nfunction outOfRange(value, start, end) {\n return !(value >= start && value <= end);\n}\nfunction lookAhead(match, state) {\n let {\n format,\n idx\n } = state;\n let i = 0;\n while (format[idx] === match) {\n i++;\n idx++;\n }\n if (i > 0) {\n idx -= 1;\n }\n state.idx = idx;\n return i;\n}\nfunction getNumber(size, state) {\n let regex = size ? numberRegExp[size] || new RegExp('^\\\\d{1,' + size + '}') : numberRegex,\n match = state.value.substr(state.valueIdx, size).match(regex);\n if (match) {\n match = match[0];\n state.valueIdx += match.length;\n return parseInt(match, 10);\n }\n return null;\n}\nfunction getIndexByName(names, state, lower) {\n let i = 0,\n length = names.length,\n name,\n nameLength,\n matchLength = 0,\n matchIdx = 0,\n subValue;\n for (; i < length; i++) {\n name = names[i];\n nameLength = name.length;\n subValue = state.value.substr(state.valueIdx, nameLength);\n if (lower) {\n subValue = subValue.toLowerCase();\n }\n if (subValue === name && nameLength > matchLength) {\n matchLength = nameLength;\n matchIdx = i;\n }\n }\n if (matchLength) {\n state.valueIdx += matchLength;\n return matchIdx + 1;\n }\n return null;\n}\nfunction checkLiteral(state) {\n let result = false;\n if (state.value.charAt(state.valueIdx) === state.format[state.idx]) {\n state.valueIdx++;\n result = true;\n }\n return result;\n}\nfunction calendarGmtFormats(calendar) {\n const {\n gmtFormat,\n gmtZeroFormat\n } = calendar;\n if (!gmtFormat) {\n throw errors.NoGMTInfo.error();\n }\n return [gmtFormat.replace(PLACEHOLDER, EMPTY).toLowerCase(), gmtZeroFormat.replace(PLACEHOLDER, EMPTY).toLowerCase()];\n}\nfunction parseTimeZoneOffset(state, info, options) {\n const {\n shortHours,\n noSeparator,\n optionalMinutes,\n localizedName,\n zLiteral\n } = options;\n state.UTC = true;\n if (zLiteral && state.value.charAt(state.valueIdx) === \"Z\") {\n state.valueIdx++;\n return false;\n }\n if (localizedName && !getIndexByName(calendarGmtFormats(info.calendar), state, true)) {\n return true;\n }\n const matches = timeZoneOffsetRegExp.exec(state.value.substr(state.valueIdx, 6));\n if (!matches) {\n return !localizedName;\n }\n const hoursMatch = matches[1];\n const minutesMatch = matches[3];\n const hoursOffset = parseInt(hoursMatch, 10);\n const separator = matches[2];\n let minutesOffset = parseInt(minutesMatch, 10);\n if (isNaN(hoursOffset) || !shortHours && hoursMatch.length !== 3 || !optionalMinutes && isNaN(minutesOffset) || noSeparator && separator) {\n return true;\n }\n if (isNaN(minutesOffset)) {\n minutesOffset = null;\n }\n if (outOfRange(hoursOffset, -12, 13) || minutesOffset && outOfRange(minutesOffset, 0, 59)) {\n return true;\n }\n state.valueIdx += matches[0].length;\n state.hoursOffset = hoursOffset;\n state.minutesOffset = minutesOffset;\n}\nfunction parseMonth(ch, state, info) {\n const count = lookAhead(ch, state);\n const names = formatNames(info, \"months\", count, ch === \"L\", true);\n const month = count < 3 ? getNumber(2, state) : getIndexByName(names, state, true);\n if (month === null || outOfRange(month, 1, 12)) {\n return true;\n }\n state.month = month - 1;\n}\nfunction parseDayOfWeek(ch, state, info) {\n const count = lookAhead(ch, state);\n const names = formatNames(info, \"days\", count, ch === \"c\", true);\n let dayOfWeek = count < 3 ? getNumber(1, state) : getIndexByName(names, state, true);\n if (!dayOfWeek && dayOfWeek !== 0 || outOfRange(dayOfWeek, 1, 7)) {\n return true;\n }\n}\nconst parsers = {};\nparsers.d = function (state) {\n lookAhead(\"d\", state);\n const day = getNumber(2, state);\n if (day === null || outOfRange(day, 1, 31)) {\n return true;\n }\n if (state.day === null) {\n state.day = day;\n }\n};\nparsers.E = function (state, info) {\n const count = lookAhead(\"E\", state);\n //validate if it matches the day?\n let dayOfWeek = getIndexByName(formatNames(info, \"days\", count, false, true), state, true);\n if (dayOfWeek === null) {\n return true;\n }\n};\nparsers.M = function (state, info) {\n return parseMonth(\"M\", state, info);\n};\nparsers.L = function (state, info) {\n return parseMonth(\"L\", state, info);\n};\nparsers.y = function (state) {\n const count = lookAhead(\"y\", state);\n let year = getNumber(count === 1 ? undefined : count, state);\n if (year === null) {\n return true;\n }\n if (count === 2) {\n const currentYear = new Date().getFullYear();\n year = currentYear - currentYear % 100 + year;\n if (year > TWO_DIGIT_YEAR_MAX) {\n year -= 100;\n }\n }\n state.year = year;\n};\nparsers.h = function (state) {\n lookAhead(\"h\", state);\n let hours = getNumber(2, state);\n if (hours === 12) {\n hours = 0;\n }\n if (hours === null || outOfRange(hours, 0, 11)) {\n return true;\n }\n state.hours = hours;\n};\nparsers.K = function (state) {\n lookAhead(\"K\", state);\n let hours = getNumber(2, state);\n if (hours === null || outOfRange(hours, 0, 11)) {\n return true;\n }\n state.hours = hours;\n};\nparsers.a = function (state, info) {\n const count = lookAhead(\"a\", state);\n let periodFormats = formatNames(info, \"dayPeriods\", count, false, true);\n const pmHour = getIndexByName([periodFormats.pm], state, true);\n if (!pmHour && !getIndexByName([periodFormats.am], state, true)) {\n return true;\n }\n state.pmHour = pmHour;\n};\nparsers.H = function (state) {\n lookAhead(\"H\", state);\n const hours = getNumber(2, state);\n if (hours === null || outOfRange(hours, 0, 23)) {\n return true;\n }\n state.hours = hours;\n};\nparsers.k = function (state) {\n lookAhead(\"k\", state);\n let hours = getNumber(2, state);\n if (hours === null || outOfRange(hours, 1, 24)) {\n return true;\n }\n state.hours = hours === 24 ? 0 : hours;\n};\nparsers.m = function (state) {\n lookAhead(\"m\", state);\n const minutes = getNumber(2, state);\n if (minutes === null || outOfRange(minutes, 0, 59)) {\n return true;\n }\n state.minutes = minutes;\n};\nparsers.s = function (state) {\n lookAhead(\"s\", state);\n const seconds = getNumber(2, state);\n if (seconds === null || outOfRange(seconds, 0, 59)) {\n return true;\n }\n state.seconds = seconds;\n};\nparsers.S = function (state) {\n const count = lookAhead(\"S\", state);\n const match = state.value.substr(state.valueIdx, count);\n let milliseconds = null;\n if (!isNaN(parseInt(match, 10))) {\n milliseconds = parseFloat(\"0.\" + match, 10);\n milliseconds = round(milliseconds, 3);\n milliseconds *= 1000;\n state.valueIdx += count;\n }\n if (milliseconds === null || outOfRange(milliseconds, 0, 999)) {\n return true;\n }\n state.milliseconds = milliseconds;\n};\nparsers.z = function (state, info) {\n const count = lookAhead(\"z\", state);\n const shortFormat = count < 4;\n const invalid = parseTimeZoneOffset(state, info, {\n shortHours: shortFormat,\n optionalMinutes: shortFormat,\n localizedName: true\n });\n if (invalid) {\n return invalid;\n }\n};\nparsers.Z = function (state, info) {\n const count = lookAhead(\"Z\", state);\n const invalid = parseTimeZoneOffset(state, info, {\n noSeparator: count < 4,\n zLiteral: count === 5,\n localizedName: count === 4\n });\n if (invalid) {\n return invalid;\n }\n};\nparsers.x = function (state, info) {\n const count = lookAhead(\"x\", state);\n const invalid = parseTimeZoneOffset(state, info, {\n noSeparator: count !== 3 && count !== 5,\n optionalMinutes: count === 1\n });\n if (invalid) {\n return invalid;\n }\n};\nparsers.X = function (state, info) {\n const count = lookAhead(\"X\", state);\n const invalid = parseTimeZoneOffset(state, info, {\n noSeparator: count !== 3 && count !== 5,\n optionalMinutes: count === 1,\n zLiteral: true\n });\n if (invalid) {\n return invalid;\n }\n};\nparsers.G = function (state, info) {\n const count = lookAhead(\"G\", state);\n const eras = formatNames(info, \"eras\", count, false, true);\n const era = getIndexByName([eras[0], eras[1]], state, true);\n if (era === null) {\n return true;\n }\n};\nparsers.e = function (state, info) {\n return parseDayOfWeek(\"e\", state, info);\n};\nparsers.c = function (state, info) {\n return parseDayOfWeek(\"c\", state, info);\n};\nfunction createDate(state) {\n let {\n year,\n month,\n day,\n hours,\n minutes,\n seconds,\n milliseconds,\n pmHour,\n UTC,\n hoursOffset,\n minutesOffset\n } = state;\n const hasTime = hours !== null || minutes !== null || seconds || null;\n const date = new Date();\n let result;\n if (year === null && month === null && day === null && hasTime) {\n year = date.getFullYear();\n month = date.getMonth();\n day = date.getDate();\n } else {\n if (year === null) {\n year = date.getFullYear();\n }\n if (day === null) {\n day = 1;\n }\n }\n if (pmHour && hours < 12) {\n hours += 12;\n }\n if (UTC) {\n if (hoursOffset) {\n hours += -hoursOffset;\n }\n if (minutesOffset) {\n minutes += -minutesOffset * (hoursOffset < 0 ? -1 : 1);\n }\n result = new Date(Date.UTC(year, month, day, hours, minutes, seconds, milliseconds));\n } else {\n result = new Date(year, month, day, hours, minutes, seconds, milliseconds);\n adjustDST(result, hours);\n }\n if (year < 100) {\n result.setFullYear(year);\n }\n if (result.getDate() !== day && UTC === undefined) {\n return null;\n }\n return result;\n}\nfunction addFormatSpaces(value, format) {\n const leadingSpaces = leadingSpacesRegex.exec(format)[0];\n const trailingSpaces = trailingSpacesRegex.exec(format)[0];\n return `${leadingSpaces}${value}${trailingSpaces}`;\n}\nfunction parseExact(value, format, info) {\n let pattern = datePattern(format, info).split(EMPTY);\n const state = {\n format: pattern,\n idx: 0,\n value: addFormatSpaces(value, format),\n valueIdx: 0,\n year: null,\n month: null,\n day: null,\n hours: null,\n minutes: null,\n seconds: null,\n milliseconds: null\n };\n const length = pattern.length;\n let literal = false;\n for (; state.idx < length; state.idx++) {\n let ch = pattern[state.idx];\n if (literal) {\n if (ch === \"'\") {\n literal = false;\n }\n checkLiteral(state);\n } else {\n if (parsers[ch]) {\n let invalid = parsers[ch](state, info);\n if (invalid) {\n return null;\n }\n } else if (ch === \"'\") {\n literal = true;\n checkLiteral(state);\n } else if (!checkLiteral(state)) {\n return null;\n }\n }\n }\n if (state.valueIdx < value.length) {\n return null;\n }\n return createDate(state) || null;\n}\nfunction parseMicrosoftDateOffset(offset) {\n const sign = offset.substr(0, 1) === \"-\" ? -1 : 1;\n let result = offset.substring(1);\n result = parseInt(result.substr(0, 2), 10) * 60 + parseInt(result.substring(2), 10);\n return sign * result;\n}\nfunction parseMicrosoftDateFormat(value) {\n if (value && value.indexOf(\"/D\") === 0) {\n let date = dateRegExp.exec(value);\n if (date) {\n date = date[1];\n let tzoffset = offsetRegExp.exec(date.substring(1));\n date = new Date(parseInt(date, 10));\n if (tzoffset) {\n tzoffset = parseMicrosoftDateOffset(tzoffset[0]);\n date = convertTimeZone(date, date.getTimezoneOffset(), 0);\n date = convertTimeZone(date, 0, -1 * tzoffset);\n }\n return date;\n }\n }\n}\nfunction defaultFormats(calendar) {\n const formats = [];\n const patterns = calendar.patterns;\n const length = FORMATS_SEQUENCE.length;\n for (let idx = 0; idx < length; idx++) {\n formats.push(patterns[FORMATS_SEQUENCE[idx]]);\n }\n return formats.concat(standardDateFormats);\n}\nexport default function parseDate(value, formats, locale = DEFAULT_LOCALE) {\n if (!value) {\n return null;\n }\n if (isDate(value)) {\n return value;\n }\n let parseValue = String(value).trim();\n let date = parseMicrosoftDateFormat(parseValue);\n if (date) {\n return date;\n }\n const info = localeInfo(locale);\n let parseFormats = formats || defaultFormats(info.calendar);\n parseFormats = Array.isArray(parseFormats) ? parseFormats : [parseFormats];\n const length = parseFormats.length;\n for (let idx = 0; idx < length; idx++) {\n date = parseExact(parseValue, parseFormats[idx], info);\n if (date) {\n return date;\n }\n }\n return date;\n}","import { DEFAULT_LOCALE } from '../common/constants';\nimport isNumber from '../common/is-number';\nimport datePattern from './date-pattern';\nimport dateNameType from './date-name-type';\nimport { dateFormatRegExp, DATE_FIELD_MAP } from './constants';\nimport { localeInfo } from '../cldr';\nconst NAME_TYPES = {\n month: {\n type: 'months',\n minLength: 3,\n standAlone: 'L'\n },\n quarter: {\n type: 'quarters',\n minLength: 3,\n standAlone: 'q'\n },\n weekday: {\n type: 'days',\n minLength: {\n E: 0,\n c: 3,\n e: 3\n },\n standAlone: 'c'\n },\n dayperiod: {\n type: 'dayPeriods',\n minLength: 0\n },\n era: {\n type: 'eras',\n minLength: 0\n }\n};\nconst LITERAL = 'literal';\nfunction addLiteral(parts, value) {\n const lastPart = parts[parts.length - 1];\n if (lastPart && lastPart.type === LITERAL) {\n lastPart.pattern += value;\n } else {\n parts.push({\n type: LITERAL,\n pattern: value\n });\n }\n}\nfunction isHour12(pattern) {\n return pattern === 'h' || pattern === 'K';\n}\nexport default function splitDateFormat(format, locale = DEFAULT_LOCALE) {\n const info = localeInfo(locale);\n const pattern = datePattern(format, info);\n const parts = [];\n let lastIndex = dateFormatRegExp.lastIndex = 0;\n let match = dateFormatRegExp.exec(pattern);\n while (match) {\n let value = match[0];\n if (lastIndex < match.index) {\n addLiteral(parts, pattern.substring(lastIndex, match.index));\n }\n if (value.startsWith('\"') || value.startsWith(\"'\")) {\n addLiteral(parts, value);\n } else {\n const specifier = value[0];\n const type = DATE_FIELD_MAP[specifier];\n const part = {\n type: type,\n pattern: value\n };\n if (type === 'hour') {\n part.hour12 = isHour12(value);\n }\n const names = NAME_TYPES[type];\n if (names) {\n const minLength = isNumber(names.minLength) ? names.minLength : names.minLength[specifier];\n const patternLength = value.length;\n if (patternLength >= minLength) {\n part.names = {\n type: names.type,\n nameType: dateNameType(patternLength),\n standAlone: names.standAlone === specifier\n };\n }\n }\n parts.push(part);\n }\n lastIndex = dateFormatRegExp.lastIndex;\n match = dateFormatRegExp.exec(pattern);\n }\n if (lastIndex < pattern.length) {\n addLiteral(parts, pattern.substring(lastIndex));\n }\n return parts;\n}","export { default as formatDate } from './dates/format-date';\nexport { default as parseDate } from './dates/parse-date';\nexport { default as splitDateFormat } from './dates/split-date-format';","import { formatDate } from './dates';\nimport { formatNumber } from './numbers';\nimport { EMPTY } from './common/constants';\nimport isDate from './common/is-date';\nimport isNumber from './common/is-number';\nconst formatRegExp = /\\{(\\d+)(:[^}]+)?\\}/g;\nexport function toString(value, format, locale) {\n if (format) {\n if (isDate(value)) {\n return formatDate(value, format, locale);\n } else if (isNumber(value)) {\n return formatNumber(value, format, locale);\n }\n }\n return value !== undefined && value !== null ? value : EMPTY;\n}\nexport function format(format, values, locale) {\n return format.replace(formatRegExp, function (match, index, placeholderFormat) {\n let value = values[parseInt(index, 10)];\n return toString(value, placeholderFormat ? placeholderFormat.substring(1) : EMPTY, locale);\n });\n}","export * from './numbers';\nexport * from './dates';\nexport * from './cldr';\nexport * from './format';\nexport * from './errors';","/**-----------------------------------------------------------------------------------------\n* Copyright © 2024 Progress Software Corporation. All rights reserved.\n* Licensed under commercial license. See LICENSE.md in the project root for more information\n*-------------------------------------------------------------------------------------------*/\nimport * as i0 from '@angular/core';\nimport { EventEmitter, LOCALE_ID, Injectable, Inject, Pipe, NgModule } from '@angular/core';\nimport { validatePackage } from '@progress/kendo-licensing';\nimport * as intl from '@progress/kendo-intl';\n\n/**\n * @hidden\n */\nconst packageMetadata = {\n name: '@progress/kendo-angular-intl',\n productName: 'Kendo UI for Angular',\n productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],\n publishDate: 1734681633,\n version: '17.2.0',\n licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/'\n};\nconst DOCS_URL = 'https://www.telerik.com/kendo-angular-ui/components/internationalization/troubleshooting/';\n/**\n * @hidden\n */\nconst errorSolutions = {\n 'NoCurrency': `Solution: ${DOCS_URL}#toc-no-currency`,\n 'NoCurrencyDisplay': `Solution: ${DOCS_URL}#toc-no-currency-display`,\n 'NoCurrencyRegion': `Solution: ${DOCS_URL}#toc-no-currency-region`,\n 'NoDateFieldNames': `Solution: ${DOCS_URL}#toc-no-date-filed-names`,\n 'NoFirstDay': `Solution: ${DOCS_URL}#toc-no-first-day`,\n 'NoGMTInfo': `Solution: ${DOCS_URL}#toc-no-gmt-info`,\n 'NoLocale': `Solution: ${DOCS_URL}#toc-no-locale`,\n 'NoValidCurrency': `Solution: ${DOCS_URL}#toc-no-valid-currency`,\n 'NoWeekData': `Solution: ${DOCS_URL}#toc-no-week-data`\n};\nfunction formatMessage(error) {\n const message = error.message;\n const errorSolution = errorSolutions[Object.keys(errorSolutions).filter(key => message.indexOf(key) === 0)[0]];\n return errorSolution ? `${message} ${errorSolution}` : message;\n}\n// eslint-disable-next-line @typescript-eslint/ban-types\nfunction intlMethod(fn) {\n return function (...values) {\n try {\n return fn(...values);\n } catch (error) {\n error.message = formatMessage(error);\n throw error;\n }\n };\n}\n/**\n * @hidden\n */\nconst dateFormatNames = intlMethod(intl.dateFormatNames);\n/**\n * @hidden\n */\nconst dateFieldName = intlMethod(intl.dateFieldName);\n/**\n * @hidden\n */\nconst firstDay = intlMethod(intl.firstDay);\n/**\n * @hidden\n */\nconst format = intlMethod(intl.format);\n/**\n * @hidden\n */\nconst formatDate = intlMethod(intl.formatDate);\n/**\n * @hidden\n */\nconst formatNumber = intlMethod(intl.formatNumber);\n/**\n * @hidden\n */\nconst load = intlMethod(intl.load);\n/**\n * @hidden\n */\nconst numberSymbols = intlMethod(intl.numberSymbols);\n/**\n * @hidden\n */\nconst parseDate = intlMethod(intl.parseDate);\n/**\n * @hidden\n */\nconst parseNumber = intlMethod(intl.parseNumber);\n/**\n * @hidden\n */\nconst splitDateFormat = intlMethod(intl.splitDateFormat);\n/**\n * @hidden\n */\nconst toString = intlMethod(intl.toString);\n/**\n * @hidden\n */\nconst weekendRange = intlMethod(intl.weekendRange);\n/**\n * Sets a pre-built locale.\n *\n * @params data - The pre-built locale data.\n */\nconst setData = data => intl.setData(data);\n/**\n * Retrieves the locale data for the specified locale.\n *\n * @params locale - The locale id.\n * @returns data - The locale data.\n */\nconst localeData = locale => {\n try {\n return intl.localeInfo(locale);\n } catch (error) {\n error.message = formatMessage(error);\n throw error;\n }\n};\nconst LOCALE_REGEX = /_/g;\n/**\n * @hidden\n */\nfunction cldrServiceFactory(localeId) {\n return new CldrIntlService(localeId);\n}\n/**\n * An abstract base class that implements\n * the Internationalization service methods\n * for the current locale.\n */\nclass IntlService {\n /**\n * @hidden\n */\n changes = new EventEmitter();\n /**\n * @hidden\n */\n constructor() {\n validatePackage(packageMetadata);\n }\n /**\n * Notifies that the service was changed.\n */\n notify() {\n this.changes.emit();\n }\n static ɵfac = function IntlService_Factory(__ngFactoryType__) {\n return new (__ngFactoryType__ || IntlService)();\n };\n static ɵprov = /* @__PURE__ */i0.ɵɵdefineInjectable({\n token: IntlService,\n factory: function IntlService_Factory(__ngFactoryType__) {\n let __ngConditionalFactory__ = null;\n if (__ngFactoryType__) {\n __ngConditionalFactory__ = new __ngFactoryType__();\n } else {\n __ngConditionalFactory__ = cldrServiceFactory(i0.ɵɵinject(LOCALE_ID));\n }\n return __ngConditionalFactory__;\n },\n providedIn: 'root'\n });\n}\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && i0.ɵsetClassMetadata(IntlService, [{\n type: Injectable,\n args: [{\n providedIn: 'root',\n useFactory: cldrServiceFactory,\n deps: [LOCALE_ID]\n }]\n }], function () {\n return [];\n }, null);\n})();\n/**\n * The Internationalization service implemented by using\n * the CLDR Database via the `@progress/kendo-intl` package.\n */\nclass CldrIntlService extends IntlService {\n locale;\n /**\n * Gets or sets the current locale ID.\n */\n get localeId() {\n return this.locale;\n }\n set localeId(value) {\n // Angular locales use underscore, for example, en_US\n // while IETF BCP-47 specifies a dash.\n // https://tools.ietf.org/html/bcp47\n const locale = value.replace(LOCALE_REGEX, '-');\n if (locale !== this.locale) {\n this.locale = locale;\n this.notify();\n }\n }\n /**\n * Creates a new instance of the service with the ID of the specified locale.\n *\n * Note that the parts of the locale ID can be separated by either `_` (underscore)\n * or `-` (dash).\n *\n * @param localeId - The default locale ID.\n */\n constructor(localeId) {\n super();\n this.localeId = localeId;\n }\n /**\n * Formats a string with placeholders such as\n * `Total amount {0:c}`.\n *\n * @param format - The format string.\n * @param values - One or more values to output in the format string placeholders.\n * @return - The formatted string.\n */\n format(format$1, ...values) {\n return format(format$1, values, this.localeId);\n }\n /**\n * Converts an object into a string based on the specified format.\n *\n * @param value - The value to format.\n * @param format - The format to use.\n * @param localeId - The locale ID to use in place of the default one. Optional.\n * @return The formatted object.\n */\n toString(value, format, localeId) {\n return toString(value, format, localeId || this.localeId);\n }\n /**\n * Converts a `Date` object into a string based on the specified format.\n * If no format is provided, the default short date format is used.\n *\n * @param value - The date to format.\n * @param format - The format string or options.\n * @param localeId - The locale ID to use in place of the default one. Optional.\n * @return The formatted date.\n */\n formatDate(value, format, localeId) {\n return formatDate(value, format, localeId || this.localeId);\n }\n /**\n * Converts a string into a `Date` object based on the specified format.\n *\n * @param value - The string to convert.\n * @param format - The format strings or options.\n * @param localeId - The locale ID to use in place of the default one. Optional.\n * @return The parsed date.\n */\n parseDate(value, format, localeId) {\n return parseDate(value, format, localeId || this.localeId);\n }\n /**\n * Converts a string into a `Number`.\n *\n * @param value - The string to convert.\n * @param format - The format string or options.\n * @param localeId - The locale ID to use in place of the default one. Optional.\n * @return The parsed number.\n */\n parseNumber(value, format, localeId) {\n return parseNumber(value, localeId || this.localeId, format);\n }\n /**\n * Converts a `Number` into a string based on the specified format.\n *\n * @param value - The number to format.\n * @param format - The format string or options.\n * @param localeId - The locale ID to use in place of the default one. Optional.\n * @return The formatted number.\n */\n formatNumber(value, format, localeId) {\n return formatNumber(value, format, localeId || this.localeId);\n }\n /**\n * Returns the date names from the current locale based on the option.\n *\n * The available `type` values are:\n * - `era`\n * - `year`\n * - `quarter`\n * - `month`\n * - `week`\n * - `day`\n * - `dayperiod`\n * - `hour`\n * - `minute`\n * - `second`\n * - `zone`\n *\n * The available `nameType` values are:\n * - `wide`\n * - `narrow`\n * - `short`\n *\n * @param options - Detailed configuration for the desired date field name.\n * @param localeId - The locale ID to use in place of the default one. Optional.\n * @return - The day names from the current locale based on the option.\n * @returns The localized date field name from the current locale based on the option.\n *\n * @example\n * ```ts\n * dateFieldName({ type: 'day' }); //returns 'day';\n * dateFieldName({ type: 'day', nameType: 'wide' }); //returns 'day';\n * dateFieldName({ type: 'month', nameType: 'short' }); //returns 'mo.';\n * dateFieldName({ type: 'month', nameType: 'wide' }); //returns 'month';\n * ```\n */\n dateFieldName(options, localeId) {\n return dateFieldName(options, localeId || this.localeId);\n }\n /**\n * Returns a localized date field name based on specific dateFieldName options.\n *\n * The available type values are:\n * - `day`\n * - `dayperiod`\n * - `months`\n * - `quarters`\n * - `eras`\n *\n * @param options - Detailed configuration for the desired date format.\n * @param localeId - The locale ID to use in place of the default one. Optional.\n * @return - The day names from the current locale based on the option.\n */\n dateFormatNames(options, localeId) {\n return dateFormatNames(localeId || this.localeId, options);\n }\n /**\n * Splits the date format into objects containing information about each part of the pattern.\n *\n * @param format The format string or options.\n * @param localeId The optional locale id. If not specified, the `\"en\"` locale id is used.\n * @returns The date format parts.\n */\n splitDateFormat(format, localeId) {\n return splitDateFormat(format, localeId || this.localeId);\n }\n /**\n * Returns the number symbols from the current locale based on the option.\n *\n * @param localeId - The locale ID to use in place of the default one. Optional.\n * @return - The number symbols from the current locale.\n */\n numberSymbols(localeId) {\n return numberSymbols(localeId || this.localeId);\n }\n /**\n * Returns the first day index starting from Sunday.\n *\n * @param localeId - The locale ID. Defaults to the current locale ID.\n * @return - The index of the first day of the week (0 == Sunday).\n */\n firstDay(localeId) {\n return firstDay(localeId || this.localeId);\n }\n /**\n * Returns the start and end index of the locale weekend starting from Sunday.\n *\n * @param localeId - The locale ID. Defaults to the current locale ID.\n * @return - The start and end index of the locale weekend (0 == Sunday).\n */\n weekendRange(localeId) {\n return weekendRange(localeId || this.localeId);\n }\n static ɵfac = function CldrIntlService_Factory(__ngFactoryType__) {\n return new (__ngFactoryType__ || CldrIntlService)(i0.ɵɵinject(LOCALE_ID));\n };\n static ɵprov = /* @__PURE__ */i0.ɵɵdefineInjectable({\n token: CldrIntlService,\n factory: CldrIntlService.ɵfac\n });\n}\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && i0.ɵsetClassMetadata(CldrIntlService, [{\n type: Injectable\n }], function () {\n return [{\n type: undefined,\n decorators: [{\n type: Inject,\n args: [LOCALE_ID]\n }]\n }];\n }, null);\n})();\nconst isNumeric = value => !isNaN(value - parseFloat(value));\n/**\n * Formats a date value to a string based on the requested format.\n * This pipe uses the [IntlService]({% slug api_intl_intlservice %}).\n *\n * @example\n * ```ng-template-no-run\n *