UNPKG

@singleton-i18n/angular-client

Version:

Singleton client code for Angular 10.

15 lines (13 loc) 141 kB
!function(e,a){"object"==typeof exports&&"undefined"!=typeof module?a(exports,require("rxjs/operators"),require("@angular/core"),require("@angular/common/http"),require("rxjs"),require("decimal.js-light")):"function"==typeof define&&define.amd?define("@singleton-i18n/angular-client",["exports","rxjs/operators","@angular/core","@angular/common/http","rxjs","decimal.js-light"],a):a(((e=e||self)["singleton-i18n"]=e["singleton-i18n"]||{},e["singleton-i18n"]["angular-client"]={}),e.rxjs.operators,e.ng.core,e.ng.common.http,e.rxjs,e.decimal)}(this,(function(e,a,t,n,o,r){"use strict"; /*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */var i=function(e,a){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,a){e.__proto__=a}||function(e,a){for(var t in a)Object.prototype.hasOwnProperty.call(a,t)&&(e[t]=a[t])})(e,a)};function s(e,a){if("function"!=typeof a&&null!==a)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");function t(){this.constructor=e}i(e,a),e.prototype=null===a?Object.create(a):(t.prototype=a.prototype,new t)}function l(e,a,t,n){return new(t||(t=Promise))((function(o,r){function i(e){try{l(n.next(e))}catch(e){r(e)}}function s(e){try{l(n.throw(e))}catch(e){r(e)}}function l(e){var a;e.done?o(e.value):(a=e.value,a instanceof t?a:new t((function(e){e(a)}))).then(i,s)}l((n=n.apply(e,a||[])).next())}))}function u(e,a){var t,n,o,r,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return r={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function s(r){return function(s){return function(r){if(t)throw new TypeError("Generator is already executing.");for(;i;)try{if(t=1,n&&(o=2&r[0]?n.return:r[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,r[1])).done)return o;switch(n=0,o&&(r=[2&r[0],o.value]),r[0]){case 0:case 1:o=r;break;case 4:return i.label++,{value:r[1],done:!1};case 5:i.label++,n=r[1],r=[0];continue;case 7:r=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==r[0]&&2!==r[0])){i=0;continue}if(3===r[0]&&(!o||r[1]>o[0]&&r[1]<o[3])){i.label=r[1];break}if(6===r[0]&&i.label<o[1]){i.label=o[1],o=r;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(r);break}o[2]&&i.ops.pop(),i.trys.pop();continue}r=a.call(e,i)}catch(e){r=[6,e],n=0}finally{t=o=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,s])}}}Object.create;function c(e){var a="function"==typeof Symbol&&Symbol.iterator,t=a&&e[a],n=0;if(t)return t.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")}function m(e,a){var t="function"==typeof Symbol&&e[Symbol.iterator];if(!t)return e;var n,o,r=t.call(e),i=[];try{for(;(void 0===a||a-- >0)&&!(n=r.next()).done;)i.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(t=r.return)&&t.call(r)}finally{if(o)throw o.error}}return i}Object.create;var d=function(e){function a(t){var n=e.call(this,t)||this;return n.message=n.message+"; Please check the network connection with VIP server and timeout settings.",Object.setPrototypeOf(n,a.prototype),n}return s(a,e),a}(Error);function p(e,a){return Error("InvalidPipeArgument: '"+a+"' for pipe '"+t.ɵstringify(e)+"'")}function y(e){return Error("InvalidParamater: '"+e+"'")}var h=function(){};function N(e){return null!=e&&""!==e}function g(e,a){for(var t=/{\s?([\d]*)\s?}/g,n=function(n){e=e.replace(t,(function(e,t){return t.trim()===n.toString()&&N(a[n])?a[n]:e}))},o=0;o<a.length;o+=1)n(o);return e}function f(e,a){return e=e instanceof Object?e:{},a=a instanceof Object?a:{},Object.keys(e).forEach((function(t){a[t]&&a[t]instanceof Object&&e[t]instanceof Object&&Object.assign(a[t],e[t])})),Object.assign(e,a)}function b(e,a){if(e===a)return!0;if(null===e||null===a)return!1;if(e!=e&&a!=a)return!0;var t,n,o,r=typeof e;if(r===typeof a&&"object"===r){if(!Array.isArray(e)){if(Array.isArray(a))return!1;if(e instanceof Date&&a instanceof Date)return e.getTime()===a.getTime();for(n in o=Object.create(null),e){if(!b(e[n],a[n]))return!1;o[n]=!0}for(n in a)if(!(n in o)&&void 0!==a[n])return!1;return!0}if(!Array.isArray(a))return!1;if((t=e.length)===a.length){for(n=0;n<t;n++)if(!b(e[n],a[n]))return!1;return!0}}return!1}function v(e,a,t){console.warn(e+" is deprecated, will be removed in "+a+", Please use "+t+" instead.")}function S(e,a){var t,n,o,r=function(e){return e&&"object"==typeof e};if(!r(e))throw new TypeError("Target must be an object");for(t=0;t<a.length;++t){var i;if(!r(i=a[t]))throw new TypeError("Source must be an object");for(o=Object.keys(Object(i)),n=0;n<o.length;++n)e.hasOwnProperty(o[n])&&console.warn("Duplicate message key:",o[n]),e[o[n]]=i[o[n]]}return e}function M(e){return!N(e)||0===Object.keys(e).length}function D(e,a,t){var n=parseInt(t);if(isNaN(n))throw Error(e+" is not a number");if(n<a[0]||n>a[1])throw Error(e+" value is out of range.");return n}h.L10N_COMPONENT_API_ENDPOINT="i18n/api/v2/translation",h.L10N_STRING_API_ENDPOINT="i18n/api/v2/translation",h.I18N_API_ENDPOINT="i18n/api/v2/formatting/patterns",h.L10N_LOCAL_API_ENDPOINT="i18n/api/v2/locale",h.TRANSLATION_PATTERN="i18n/api/v2/combination/translationsAndPattern",h.PseudoTag="#@",h.ASSETS_SUFFIX=".json",h.I18N_ASSETS_PREFIX="locale_",h.L10N_ASSETS_PREFIX="translation_",h.NAME_SPACE_SEPARATOR=":",h.ENGLISH={languageCode:"en",languageName:"English",regionCode:"US",regionName:"United States"};var P,L=new t.InjectionToken("VIP_CONFIG");function C(e){if(e)return[e.productID,e.component,e.version].join("-").toString().toLowerCase().replace(/\s+/g,"-").replace(/[^\w\-]+/g,"").replace(/\-\-+/g,"-").replace(/^-+/,"").replace(/-+$/,"")}function R(e,a){var t=N(a.pseudoEnabled)?a.pseudoEnabled:e.isPseudo||!1;return{productID:e.productID||void 0,component:e.component||void 0,version:e.version||void 0,host:e.host||void 0,isPseudo:t,locale:e.locale||void 0,region:e.region||void 0,language:e.language||"en",i18nScope:e.i18nScope||[],sourceBundle:e.sourceBundle||void 0,sourceBundles:e.sourceBundles||void 0,translationBundles:e.translationBundles||void 0,i18nAssets:e.i18nAssets||void 0,collectSource:e.collectSource||!1,timeout:e.timeout||3e3}}(P=e.PatternCategories||(e.PatternCategories={})).DATE="dates",P.NUMBER="numbers",P.PLURAL="plurals",P.CURRENCIES="currencies",P.DATEFIELDS="dateFields";var E=function(){},w=function(){function e(){}return e.prototype.validateResponse=function(e){if(!e||!e.response)return null;var a=e.response;if(a.code&&200!==a.code)throw Error(a.message);return e.data&&e.data.pattern&&!e.data.pattern.isExistPattern&&(e.data.pattern=null),e.data},e.prototype.ParseLocaleData=function(e,a){var t={},n=this.validateResponse(e),o=C(a),r=this.ParsePatternsData(n);return t[o]=this.ParseTranslationsData(n),{categories:r,messages:t}},e.prototype.ParsePatternsData=function(e){return e&&e.pattern&&e.pattern.categories?e.pattern.categories:void 0},e.prototype.ParseTranslationsData=function(e){return e.messages?e.messages:e&&e.components&&e.components[0].messages?e.components[0].messages:void 0},e.prototype.ParseSupportedLanguagesData=function(e){var a=this.validateResponse(e);return a&&a.languages?a.languages:null},e.prototype.ParseSupportedRegionsData=function(e){var a=this.validateResponse(e);return a&&a[0]?a[0]:null},e}();w.decorators=[{type:t.Injectable}],w.ctorParameters=function(){return[]};var T=function(){},A=function(){function e(e,a){this.responseParser=e,this.http=a}return e.prototype.getLocaleData=function(e,a,t){this.validateConfig(e);var n=e.i18nScope?e.i18nScope.join(","):"";return N(e.i18nAssets)?""===n?this.getTranslationByComponent(a,e):this.getCombineDataFromAssets(a,e):""===n?this.getTranslationByComponent(a,e):this.getCombineLocaleData(e,a,t)},e.prototype.getCombineDataFromAssets=function(e,a){var t=this,n=this.getI18nResourceUrl(a,e);return this.getRequest(n,a.timeout,(function(e){return t.responseParser.ParseLocaleData(e,a)}))},e.prototype.getTranslationByComponent=function(e,a){var t=this,n=this.getComponentTranslationUrl(e,a);return this.getRequest(n,a.timeout,(function(e){return t.responseParser.ParseLocaleData(e,a)}))},e.prototype.getCombineLocaleData=function(e,a,t){var n=this,o=e.i18nScope.join(","),r=this.getI18nResourceUrl(e),i=t?1:2;return this.postRequest(r,{language:a,region:t,productName:e.productID,version:e.version,components:[e.component],scope:o,pseudo:e.isPseudo,combine:i,machineTranslation:!1},e.timeout,(function(a){return n.responseParser.ParseLocaleData(a,e)}))},e.prototype.getSupportedLanguages=function(e){var a=this,t=this.getSupportedLanguagesUrl(e);return this.getRequest(t,e.timeout,(function(e){return a.responseParser.ParseSupportedLanguagesData(e)}))},e.prototype.getSupportedRegions=function(e,a){var t=this,n=this.getSupportedRegionsUrl(e,a.host);return this.getRequest(n,a.timeout,(function(e){return t.responseParser.ParseSupportedRegionsData(e)}))},e.prototype.getLocalizedCities=function(e,a,t){var n=this,o=this.getLocalizedCitiesUrl(e,a,t.host);return this.getRequest(o,t.timeout,(function(e){return n.responseParser.ParseSupportedRegionsData(e)}))},e.prototype.getRequest=function(e,t,n){return this.http.get(e).pipe(a.timeoutWith(t,o.defer((function(){return o.throwError(new d("Timeout error"))}))),a.map((function(e){return n&&"function"==typeof n?n(e):e})),a.catchError((function(e){return o.throwError(e)})))},e.prototype.postRequest=function(e,t,n,r){return this.http.post(e,t).pipe(a.timeoutWith(n,o.defer((function(){return o.throwError(new d("Timeout error"))}))),a.map((function(e){return r&&"function"==typeof r?r(e):e})),a.catchError((function(e){return o.throwError(e)})))},e.prototype.getI18nResourceUrl=function(e,a){return e.i18nAssets?""+e.i18nAssets+a+h.ASSETS_SUFFIX:e.host.concat(h.TRANSLATION_PATTERN)},e.prototype.getComponentTranslationUrl=function(e,a){return N(a.i18nAssets)?""+a.i18nAssets+h.L10N_ASSETS_PREFIX+e+h.ASSETS_SUFFIX:a.host.concat(h.L10N_COMPONENT_API_ENDPOINT).concat("/products/"+a.productID).concat("/versions/"+a.version).concat("/locales/"+e).concat("/components/"+a.component).concat("?pseudo="+a.isPseudo)},e.prototype.getSupportedLanguagesUrl=function(e){return e.host.concat(h.L10N_LOCAL_API_ENDPOINT).concat("/supportedLanguageList?").concat("productName="+e.productID).concat("&version="+e.version)},e.prototype.getSupportedRegionsUrl=function(e,a){return a.concat(h.L10N_LOCAL_API_ENDPOINT).concat("/regionList?").concat("supportedLanguageList="+e)},e.prototype.getLocalizedCitiesUrl=function(e,a,t){return t.concat(h.L10N_LOCAL_API_ENDPOINT).concat("/regionList?").concat("supportedLanguageList="+e).concat("&displayCity=true&regions="+a)},e.prototype.validateConfig=function(e){var a=" in VIPLoader";if(!N(e.productID)||!e.productID.length)throw y("productID"+a);if(!N(e.version)||!e.version.length)throw y("version"+a);if(!N(e.host)&&!N(e.i18nAssets))throw y("host"+a);if(!N(e.language))throw y("language"+a);return!0},e}();A.decorators=[{type:t.Injectable}],A.ctorParameters=function(){return[{type:E},{type:n.HttpClient}]};var F={en:["en"],"en-gb":["en-GB"],"en-us":["en"],fr:["fr"],"fr-fr":["fr"],de:["de"],"de-de":["de"],es:["es"],"es-es":["es"],ja:["ja"],"ja-jp":["ja"],ko:["ko"],"ko-kr":["ko"],"pt-br":["pt"],"pt-pt":["pt-PT"],"zh-hans":["zh-Hans"],"zh-hant":["zh-Hant"],"zh-cn":["zh-Hans"],"zh-hk":["zh-Hant-HK"],"zh-tw":["zh-Hant"]},B="vip.i18nEnabled",U="vip.preferredLanguage",I="vip.preferredRegion",O=function(){};function k(){try{return"localStorage"in window&&null!==window.localStorage}catch(e){return!1}}var _=function(e){function a(){var a=e.call(this)||this;return a.localstore={},k&&(a.store=window.localStorage),a}return s(a,e),a.prototype.toBoolean=function(e){if(void 0!==e&&"undefined"!==e)return"true"===e},a.prototype.setItem=function(e,a){this.localstore[e]=a,this.store&&this.store.setItem(e,a)},a.prototype.getItem=function(e){return this.store&&N(this.store.getItem(e))?this.store.getItem(e):N(this.localstore[e])?this.localstore[e]:void 0},Object.defineProperty(a.prototype,"pseudoEnabled",{get:function(){return this.toBoolean(this.getItem("vip.pseudoEnabled"))},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"i18nEnabled",{get:function(){return this.toBoolean(this.getItem(B))},set:function(e){this.setItem(B,String(e))},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"preferredLanguage",{get:function(){return this.getItem(U)},set:function(e){this.setItem(U,e)},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"preferredRegion",{get:function(){return this.getItem(I)},set:function(e){this.setItem(I,e)},enumerable:!1,configurable:!0}),a}(O);_.decorators=[{type:t.Injectable}],_.ctorParameters=function(){return[]};var G=function(){function e(e){this.i18nContext=e,this.userLocaleChanged=new o.Subject,this.defaultLocale=h.ENGLISH,this.setLocale(this.defaultLocale.languageCode,this.defaultLocale.regionCode)}return e.prototype.init=function(e,a){N(e)&&(this.setLocale(e,a),this.i18nContext.preferredLanguage=e),N(a)&&(this.i18nContext.preferredRegion=a)},e.prototype.setDefaultLocale=function(e){this.defaultLocale=e||this.defaultLocale,this.setLocale(this.defaultLocale.languageCode,this.defaultLocale.regionCode)},e.prototype.setLocale=function(e,a){e===this.currentLanguage&&a===this.currentRegion||(this.currentLanguage=e,this.currentRegion=a)},e.prototype.getCurrentLanguage=function(){return this.currentLanguage},e.prototype.setCurrentLanguage=function(e){e!==this.currentLanguage&&(this.currentLanguage=e,this.sendUserLocaleEvent())},e.prototype.getCurrentRegion=function(){return this.currentRegion},e.prototype.setCurrentRegion=function(e){e!==this.currentRegion&&(this.currentRegion=e,this.sendUserLocaleEvent())},e.prototype.getCurrentLocale=function(){return this.composeLocale(this.currentLanguage,this.currentRegion)},e.prototype.setCurrentLocale=function(e,a){this.setLocale(e,a),this.sendUserLocaleEvent()},e.prototype.composeLocale=function(e,a){return e&&a?e+"-"+a:e},e.prototype.sendUserLocaleEvent=function(){this.userLocaleChanged.next(this.getCurrentLocale())},Object.defineProperty(e.prototype,"isSourceLocale",{get:function(){return this.shouldSourceLocale(this.currentLanguage,this.currentRegion)},enumerable:!1,configurable:!0}),e.prototype.shouldSourceLocale=function(e,a){return!(!this.shouldSourceLanguage(e)||!N(a)||a.toUpperCase()!==this.defaultLocale.regionCode)||!(!this.shouldSourceLanguage(e)||N(a))},e.prototype.resolveLanguageTag=function(e){return N(e)?e.split("_").join("-").toLocaleLowerCase():e},Object.defineProperty(e.prototype,"isSourceLanguage",{get:function(){return this.shouldSourceLanguage(this.currentLanguage)},enumerable:!1,configurable:!0}),e.prototype.shouldSourceLanguage=function(e){return e.toLowerCase()===this.defaultLocale.languageName||(this.defaultLocale.languageCode.toLowerCase()===this.resolveLanguageTag(e)||(this.defaultLocale.languageCode+"-"+this.defaultLocale.regionCode).toLowerCase()===this.resolveLanguageTag(e))},e.prototype.normalizeLanguageCode=function(e){var a=e.replace("_","-").toLowerCase();return F[a]?F[a][0]:e},e}();G.ɵprov=t.ɵɵdefineInjectable({factory:function(){return new G(t.ɵɵinject(O))},token:G,providedIn:"root"}),G.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],G.ctorParameters=function(){return[{type:O}]};var K=function(){function e(e,a,n){this.localeService=e,this.i18nContext=a,this.currentLoader=n,this.pending=!1,this.configs=[],this.availableLocales=[],this._onLocaleChange=new t.EventEmitter,this._i18nScope=[],this._localeData={}}return Object.defineProperty(e.prototype,"onLocaleChange",{get:function(){return this._onLocaleChange},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"localeData",{get:function(){return this._localeData},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"i18nScope",{get:function(){return this._i18nScope},enumerable:!1,configurable:!0}),e.prototype.initData=function(e){return l(this,void 0,void 0,(function(){return u(this,(function(a){switch(a.label){case 0:return this.subscribeLocaleSubject(),this.registerComponent(e,!0),this.initLocale(e),[4,this.loadLocaleData()];case 1:return a.sent(),[2]}}))}))},e.prototype.initLocale=function(e){(e.locale||e.language||e.region)&&(console.warn("Set language and region by configuration is deprecated, will be removed in v9. Please use LocaleService.init instead."),e.language&&e.region?this.localeService.init(e.language,e.region):e.locale&&this.localeService.init(e.locale))},e.prototype.subscribeLocaleSubject=function(){var e=this;this.localeSubscription||(this.localeSubscription=this.localeService.userLocaleChanged.subscribe((function(){e.loadLocaleData()})))},e.prototype.registerComponent=function(e,a){if(void 0===a&&(a=!1),this.subscribeLocaleSubject(),e=R(e,this.i18nContext),this.mainConfig=a?e:this.mainConfig,this.configs.push(e),this.updateI18nScope(e),e.sourceBundles||e.sourceBundle){e.sourceBundle&&v("The sourceBundle option in i18n config","v10","sourceBundles");var t=e.sourceBundles?this.resetBundle(e.sourceBundles):e.sourceBundle;this.processBundle(t,this.localeService.defaultLocale.languageCode,e)}},e.prototype.updateI18nScope=function(e){e.i18nScope&&!e.translationBundles&&(this._i18nScope=this._i18nScope.concat(e.i18nScope).filter((function(e,a,t){return a===t.indexOf(e)})))},e.prototype.loadLocaleData=function(){return l(this,void 0,void 0,(function(){var e,a,t;return u(this,(function(n){switch(n.label){case 0:return e=this.localeService.getCurrentLanguage(),a=this.localeService.getCurrentRegion(),t=this.localeService.getCurrentLocale(),this.localeService.isSourceLocale||-1!==this.availableLocales.indexOf(t)||!1===this.i18nContext.i18nEnabled?[3,2]:[4,this.getLocaleData(e,a,t).toPromise()];case 1:n.sent(),n.label=2;case 2:return this.releaseLocale(t),[2]}}))}))},e.prototype.getLocaleData=function(e,t,n){var r,i,s,l=this,u=[],m=function(r){if(r.translationBundles){var i=d.localeService.normalizeLanguageCode(e),s=r.translationBundles[e]||r.translationBundles[i];s&&d.processBundle(s,n,r)}else u.push(d.currentLoader.getLocaleData(r,e,t).pipe(a.share(),a.catchError((function(e){return console.error("Can't fetch locale data.",r,e),o.of(void 0)}))))},d=this;try{for(var p=c(this.configs),y=p.next();!y.done;y=p.next()){m(y.value)}}catch(e){r={error:e}}finally{try{y&&!y.done&&(i=p.return)&&i.call(p)}finally{if(r)throw r.error}}return u.length<1?(this.availableLocales.push(n),o.of([])):(s=o.forkJoin(u),this.loadingLocaleData={data:s.pipe(a.take(1),a.share()),locale:n},this.pending=!0,this.loadingLocaleData.data.subscribe((function(e){l.storeResource(e,l._localeData,n),l.availableLocales.push(n),l.pending=!1}),(function(e){l.pending=!1})),s)},e.prototype.resetBundle=function(e){if(Array.isArray(e))return S({},e)},e.prototype.processBundle=function(e,a,t){var n={messages:{}},o=C(t);n.messages[o]=e,this.storeResource([n],this._localeData,a)},e.prototype.storeResource=function(e,a,t){if(e){var n={};a[t]=a[t]||{},e.forEach((function(e){e&&(e.messages&&(a[t].messages=f(a[t].messages,e.messages)),e.categories&&(a[t].categories=f(a[t].categories,e.categories),e.categories.supplemental&&Object.assign(n,e.categories.supplemental)))})),a[t].categories&&(a[t].categories.supplemental=n)}},Object.defineProperty(e.prototype,"current",{get:function(){var e=this;if(this.pending){var a=this.loadingLocaleData.locale;return o.Observable.create((function(t){var n=function(){t.next(a),t.complete()};e.loadingLocaleData.data.subscribe((function(e){n()}),n)}))}return o.of(this.localeService.getCurrentLocale())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"stream",{get:function(){return o.concat(this.current,this.onLocaleChange.pipe(a.switchMap((function(e){return o.of(e)}))))},enumerable:!1,configurable:!0}),e.prototype.releaseLocale=function(e){this.onLocaleChange.emit(e)},e.prototype.registerSourceBundles=function(e,a){if(e){var t=this.resetBundle(e);this.processBundle(t,this.localeService.defaultLocale.languageCode,a)}},e}();K.decorators=[{type:t.Injectable}],K.ctorParameters=function(){return[{type:G},{type:O},{type:T}]};var H,z,x,j=function(){function e(){}return e.prototype.getStandardTime=function(e){return"string"==typeof e&&(e=/^-?\d+$/.test(e)?$(e):function(e){var a,t,n=navigator.userAgent.indexOf("Trident"),o=navigator.userAgent.indexOf("Safari")>-1&&navigator.userAgent.indexOf("Chrome")<0;a=e.indexOf("/")?e.replace(/\//g,"-"):e,(o||n)&&a.indexOf("T")<0&&(a=a.replace(/-/g,"/"));var r=/^(\d{4})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/;if(t=a.match(r))return function(e){var a=new Date(0),t=e[8]?a.setUTCFullYear:a.setFullYear,n=e[8]?a.setUTCHours:a.setHours,o=0,r=0;e[9]&&(o=$(e[9]+e[10]),r=$(e[9]+e[11]));t.call(a,$(e[1]),$(e[2])-1,$(e[3]));var i=$(e[4]||0)-o,s=$(e[5]||0)-r,l=$(e[6]||0),u=Math.round(1e3*parseFloat("0."+(e[7]||0)));return n.call(a,i,s,l,u),a}(t);var i=new Date(a);return"Invalid Date"===i.toString()?e:i}(e)),"number"==typeof e&&(e=new Date(e)),e},e.prototype.getformattedString=function(e,a,t,n,o){var r=this;void 0===n&&(n="-"),this.localeData=t;var i=this.getRulesByPattern(a,t),s=this.patternFilter(i),l=e.getTimezoneOffset();o&&(l=X(o,l),e=function(e,a){var t=e.getTimezoneOffset(),n=X(a,t);return function(e,a){return(e=new Date(e.getTime())).setMinutes(e.getMinutes()+a),e}(e,-1*(n-t))}(e,o));var u="";return s.forEach((function(a){var t=r.getFormatFunctionByRule(a,n);u+=t?t(e,l):"''"===a?"'":a.replace(/(^'|'$)/g,"").replace(/''/g,"'")})),u},e.prototype.getRulesByPattern=function(e,a){return this.localeData=a,this.getRules(e)?this.getRules(e):e},e.prototype.getRules=function(e){var a;switch(e){case"shortTime":a=this.getRulesInPattern("time","short");break;case"mediumTime":a=this.getRulesInPattern("time","medium");break;case"longTime":a=this.getRulesInPattern("time","long");break;case"fullTime":a=this.getRulesInPattern("time","full");break;case"shortDate":a=this.getRulesInPattern("date","short");break;case"mediumDate":a=this.getRulesInPattern("date","medium");break;case"longDate":a=this.getRulesInPattern("date","long");break;case"fullDate":a=this.getRulesInPattern("date","full");break;case"short":var t=this.getRulesInPattern("date","short"),n=this.getRulesInPattern("time","short");a=this.formatDateTimeRules("short",[n,t]);break;case"medium":var o=this.getRulesInPattern("date","medium"),r=this.getRulesInPattern("time","medium");a=this.formatDateTimeRules("medium",[r,o]);break;case"full":var i=this.getRulesInPattern("date","full"),s=this.getRulesInPattern("time","full");a=this.formatDateTimeRules("full",[s,i]);break;case"long":var l=this.getRulesInPattern("date","long"),u=this.getRulesInPattern("time","long");a=this.formatDateTimeRules("long",[u,l]);break;default:a=this.getRulesInPattern("dateTime",e)}return a},e.prototype.getRulesInPattern=function(e,a){return"dateTime"!==e?this.localeData[e+"Formats"][a]:this.localeData[e+"Formats"].availableFormats[a]},e.prototype.formatDateTimeRules=function(e,a){return this.localeData.dateTimeFormats[e].replace(/\{([^}]+)}/g,(function(e,t){return null!=a&&t in a?a[t]:e}))},e.prototype.dateStrGetter=function(e,a,t){var n=this;return void 0===t&&(t="format"),function(o){var r="";switch(e){case"Day":case"Month":r=n.getLocaleString(o,e,a,t);break;case"dayPeriods":r=n.getDaysPeriods(o,e,a);break;case"eras":r=n.getEras(o,e,a)}return r}},e.prototype.getLocaleString=function(e,a,t,n){void 0===n&&(n="format");var o=n.slice(0,1);n=n.replace(o,o.toUpperCase());var r=(a+"s").toLowerCase()+n,i=V(e,a);return this.localeData[r][t][i]},e.prototype.getDaysPeriods=function(e,a,t){var n=this.localeData.dayPeriodsFormat[t];return e.getHours()<12?n[0]:n[1]},e.prototype.getEras=function(e,a,t){var n=this.localeData.eras[t];return e.getFullYear()<0?n[0]:n[1]},e.prototype.patternFilter=function(e){for(var a,t=[],n=new RegExp("((?:[^GyMLwWdEahHKmsSzZO']+)|(?:'(?:[^']|'')*')|(?:G{1,5}|y{1,4}|M{1,5}|L{1,5}|w{1,2}|W{1}|d{1,2}|E{1,6}|a{1,5}|h{1,2}|H{1,2}|K{1,2}|m{1,2}|s{1,2}|S{1,3}|z{1,4}|Z{1,5}|O{1,4}))([\\s\\S]*)");e;)(a=n.exec(e))?e=(t=this.concat(t,a,1)).pop():(t.push(e),e=null);return t},e.prototype.concat=function(e,a,t){return e.concat([].slice.call(a,t))},e.prototype.getFormatFunctionByRule=function(e,a){var t=null;switch(e){case"G":case"GG":case"GGG":t=this.dateStrGetter("eras","abbreviated");break;case"GGGG":t=this.dateStrGetter("eras","wide");break;case"GGGGG":t=this.dateStrGetter("eras","narrow");break;case"y":t=Y("FullYear",1,0,!1,!0);break;case"yy":t=Y("FullYear",2,0,!0,!0);break;case"yyy":t=Y("FullYear",3,0,!1,!0);break;case"yyyy":t=Y("FullYear",4,0,!1,!0);break;case"M":case"L":t=Y("Month",1,1);break;case"MM":case"LL":t=Y("Month",2,1);break;case"MMM":t=this.dateStrGetter("Month","abbreviated");break;case"MMMM":t=this.dateStrGetter("Month","wide");break;case"MMMMM":t=this.dateStrGetter("Month","narrow");break;case"LLL":t=this.dateStrGetter("Month","abbreviated","standalone");break;case"LLLL":t=this.dateStrGetter("Month","wide","standalone");break;case"LLLLL":t=this.dateStrGetter("Month","narrow","standalone");break;case"w":t=J(1);break;case"ww":t=J(2);break;case"W":t=J(1,!0);break;case"d":t=Y("Date",1);break;case"dd":t=Y("Date",2);break;case"E":case"EE":case"EEE":t=this.dateStrGetter("Day","abbreviated");break;case"EEEE":t=this.dateStrGetter("Day","wide");break;case"EEEEE":t=this.dateStrGetter("Day","narrow");break;case"EEEEEE":t=this.dateStrGetter("Day","short");break;case"a":case"aa":case"aaa":t=this.dateStrGetter("dayPeriods","abbreviated");break;case"aaaa":t=this.dateStrGetter("dayPeriods","wide");break;case"aaaaa":t=this.dateStrGetter("dayPeriods","narrow");break;case"h":t=Y("Hours",1,-12);break;case"hh":t=Y("Hours",2,-12);break;case"H":t=Y("Hours",1);break;case"HH":t=Y("Hours",2);break;case"K":t=Y("Hours",1,-13);break;case"KK":t=Y("Hours",2,-13);break;case"m":t=Y("Minutes",1);break;case"mm":t=Y("Minutes",2);break;case"s":t=Y("Seconds",1);break;case"ss":t=Y("Seconds",2);break;case"S":t=Y("Milliseconds",1);break;case"SS":t=Y("Milliseconds",2);break;case"SSS":t=Y("Milliseconds",3);break;case"Z":case"ZZ":case"ZZZ":t=W("short",a);break;case"ZZZZZ":t=W("extended",a);break;case"O":case"OO":case"OOO":case"z":case"zz":case"zzz":t=W("shortGMT",a);break;case"OOOO":case"ZZZZ":case"zzzz":t=W("long",a);break;default:return null}return t},e}();function Z(e,a,t,n){var o="";for((e<0||n&&e<=0)&&(n?e=1-e:(e=-e,o="-")),e=""+e;e.length<a;)e="0"+e;return t&&(e=e.substr(e.length-a)),o+e}function Y(e,a,t,n,o){return t=t||0,function(r){var i=V(r,e);return(t>0||i>-t)&&(i+=t),0===i&&-12===t&&(i=12),Z(i,a,n,o)}}function V(e,a){switch(a){case"FullYear":return e.getFullYear();case"Month":return e.getMonth();case"Date":return e.getDate();case"Hours":return e.getHours();case"Minutes":return e.getMinutes();case"Seconds":return e.getSeconds();case"Milliseconds":return e.getMilliseconds();case"Day":return e.getDay();default:throw new Error('Unknown DateType value "'+a+'".')}}function X(e,a){if("Z"===e)return 0;e=e.replace(/:/g,"");var t=Date.parse("Jan 01, 1970 00:00:00 "+e)/6e4;return(Number.isNaN||function(e){return e!=e})(t)?a:t}function W(e,a){return function(a,t){var n=-1*t,o=n>0?Math.floor(n/60):Math.ceil(n/60);switch(e){case"short":return(n>=0?"+":"")+Z(o,2)+Z(Math.abs(n%60),2);case"shortGMT":return"GMT"+(n>=0?"+":"")+Z(o,1);case"long":return"GMT"+(n>=0?"+":"")+Z(o,2)+":"+Z(Math.abs(n%60),2);case"extended":return 0===t?"Z":(n>=0?"+":"")+Z(o,2)+":"+Z(Math.abs(n%60),2)}}}function J(e,a){return void 0===a&&(a=!1),function(t){var n,o,r,i;if(a){var s=new Date(t.getFullYear(),t.getMonth(),1).getDay()-1,l=t.getDate();n=1+Math.floor((l+s)/7)}else{var u=(r=t.getFullYear(),i=new Date(r,0,1).getDay(),new Date(r,0,(i<=4?5:12)-i)),c=+(o=t,new Date(o.getFullYear(),o.getMonth(),o.getDate()+(4-o.getDay())))-+u;n=1+Math.round(c/6048e5)}return Z(n,e)}}function $(e){return parseInt(e,10)}j.decorators=[{type:t.Injectable}],j.ctorParameters=function(){return[]},function(e){e.DIGIST="_digits",e.ROUNDING="_rounding"}(H||(H={})),function(e){e[e.ROUND_UP=0]="ROUND_UP",e[e.ROUND_DOWN=1]="ROUND_DOWN",e[e.ROUND_CEIL=2]="ROUND_CEIL",e[e.ROUND_FLOOR=3]="ROUND_FLOOR",e[e.ROUND_HALF_UP=4]="ROUND_HALF_UP",e[e.ROUND_HALF_DOWN=5]="ROUND_HALF_DOWN",e[e.ROUND_HALF_EVEN=6]="ROUND_HALF_EVEN",e[e.ROUND_HALF_CEIL=7]="ROUND_HALF_CEIL",e[e.ROUND_HALF_FLOOR=8]="ROUND_HALF_FLOOR",e[e.EUCLID=9]="EUCLID"}(z||(z={})),function(e){e.DECIMAL="decimal",e.PERCENT="percent",e.CURRENCIES="currencies",e.PLURAL="plural",e.CURRENCYSYMBOL="currencySymbol"}(x||(x={}));var Q=[function(e,a){return"other"},function(e,a){return a?"other":1===e?"one":"other"},function(e,a){return a?"other":0===e||1===e?"one":"other"},function(e,a){var t=!String(e).split(".")[1];return a?"other":1===e&&t?"one":"other"}],q={af:Q[1],ak:Q[2],am:function(e,a){return a?"other":e>=0&&e<=1?"one":"other"},ar:function(e,a){var t=String(e).split("."),n=Number(t[0])===e&&Number(t[0].slice(-2));return a?"other":0===e?"zero":1===e?"one":2===e?"two":n>=3&&n<=10?"few":n>=11&&n<=99?"many":"other"},ars:function(e,a){var t=String(e).split("."),n=Number(t[0])===e&&+t[0].slice(-2);return a?"other":0===e?"zero":1===e?"one":2===e?"two":n>=3&&n<=10?"few":n>=11&&n<=99?"many":"other"},as:function(e,a){return a?1===e||5===e||7===e||8===e||9===e||10===e?"one":2===e||3===e?"two":4===e?"few":6===e?"many":"other":e>=0&&e<=1?"one":"other"},asa:Q[1],ast:Q[3],az:function(e,a){var t=String(e).split(".")[0],n=Number(t.slice(-1)),o=Number(t.slice(-2)),r=Number(t.slice(-3));return a?1===n||2===n||5===n||7===n||8===n||20===o||50===o||70===o||80===o?"one":3===n||4===n||100===r||200===r||300===r||400===r||500===r||600===r||700===r||800===r||900===r?"few":0==+Number(t)||6===n||40===o||60===o||90===o?"many":"other":1===e?"one":"other"},be:function(e,a){var t=String(e).split("."),n=Number(t[0])===e,o=n&&Number(t[0].slice(-1)),r=n&&Number(t[0].slice(-2));return a?2!==o&&3!==o||12===r||13===r?"other":"few":1===o&&11!==r?"one":o>=2&&o<=4&&(r<12||r>14)?"few":n&&0===o||o>=5&&o<=9||r>=11&&r<=14?"many":"other"},bem:Q[1],bez:Q[1],bg:Q[1],bh:Q[2],bm:Q[0],bn:function(e,a){return a?1===e||5===e||7===e||8===e||9===e||10===e?"one":2===e||3===e?"two":4===e?"few":6===e?"many":"other":e>=0&&e<=1?"one":"other"},bo:Q[0],br:function(e,a){var t=String(e).split("."),n=Number(t[0])===e,o=n&&Number(t[0].slice(-1)),r=n&&Number(t[0].slice(-2)),i=n&&Number(t[0].slice(-6));return a?"other":1===o&&11!==r&&71!==r&&91!==r?"one":2===o&&12!==r&&72!==r&&92!==r?"two":(3===o||4===o||9===o)&&(r<10||r>19)&&(r<70||r>79)&&(r<90||r>99)?"few":0!==e&&n&&0===i?"many":"other"},brx:Q[1],bs:function(e,a){var t=String(e).split("."),n=t[0],o=t[1]||"",r=!t[1],i=Number(n.slice(-1)),s=Number(n.slice(-2)),l=Number(o.slice(-1)),u=Number(o.slice(-2));return a?"other":r&&1===i&&11!==s||1===l&&11!==u?"one":r&&i>=2&&i<=4&&(s<12||s>14)||l>=2&&l<=4&&(u<12||u>14)?"few":"other"},ca:function(e,a){var t=!String(e).split(".")[1];return a?1===e||3===e?"one":2===e?"two":4===e?"few":"other":1===e&&t?"one":"other"},ce:Q[1],cgg:Q[1],chr:Q[1],ckb:Q[1],cs:function(e,a){var t=String(e).split("."),n=t[0],o=!t[1];return a?"other":1===e&&o?"one":Number(n)>=2&&Number(n)<=4&&o?"few":o?"other":"many"},cy:function(e,a){return a?0===e||7===e||8===e||9===e?"zero":1===e?"one":2===e?"two":3===e||4===e?"few":5===e||6===e?"many":"other":0===e?"zero":1===e?"one":2===e?"two":3===e?"few":6===e?"many":"other"},da:function(e,a){var t=String(e).split("."),n=t[0],o=Number(t[0])===e;return a||1!==e&&(o||0!==Number(n)&&1!==Number(n))?"other":"one"},de:Q[3],dsb:function(e,a){var t=String(e).split("."),n=t[0],o=t[1]||"",r=!t[1],i=Number(n.slice(-2)),s=Number(o.slice(-2));return a?"other":r&&1===i||1===s?"one":r&&2===i||2===s?"two":r&&(3===i||4===i)||3===s||4===s?"few":"other"},dv:Q[1],dz:Q[0],ee:Q[1],el:Q[1],en:function(e,a){var t=String(e).split("."),n=!t[1],o=Number(t[0])===e,r=o&&Number(t[0].slice(-1)),i=o&&Number(t[0].slice(-2));return a?1===r&&11!==i?"one":2===r&&12!==i?"two":3===r&&13!==i?"few":"other":1===e&&n?"one":"other"},eo:Q[1],es:Q[1],et:Q[3],eu:Q[1],fa:function(e,a){return a?"other":e>=0&&e<=1?"one":"other"},ff:function(e,a){return a?"other":e>=0&&e<2?"one":"other"},fi:Q[3],fil:function(e,a){var t=String(e).split("."),n=t[0],o=t[1]||"",r=!t[1],i=Number(n.slice(-1)),s=Number(o.slice(-1));return a?1===e?"one":"other":r&&(1===Number(n)||2===Number(n)||3===Number(n))||r&&4!==i&&6!==i&&9!==i||!r&&4!==s&&6!==s&&9!==s?"one":"other"},fo:Q[1],fr:function(e,a){return a?1===e?"one":"other":e>=0&&e<2?"one":"other"},fur:Q[1],fy:Q[3],ga:function(e,a){var t=String(e).split("."),n=Number(t[0])===e;return a?1===e?"one":"other":1===e?"one":2===e?"two":n&&e>=3&&e<=6?"few":n&&e>=7&&e<=10?"many":"other"},gd:function(e,a){var t=String(e).split("."),n=Number(t[0])===e;return a?1===e||11===e?"one":2===e||12===e?"two":3===e||13===e?"few":"other":1===e||11===e?"one":2===e||12===e?"two":n&&e>=3&&e<=10||n&&e>=13&&e<=19?"few":"other"},gl:Q[3],gsw:Q[1],gu:function(e,a){return a?1===e?"one":2===e||3===e?"two":4===e?"few":6===e?"many":"other":e>=0&&e<=1?"one":"other"},guw:Q[2],gv:function(e,a){var t=String(e).split("."),n=t[0],o=!t[1],r=Number(n.slice(-1)),i=Number(n.slice(-2));return a?"other":o&&1===r?"one":o&&2===r?"two":!o||0!==i&&20!==i&&40!==i&&60!==i&&80!==i?o?"other":"many":"few"},ha:Q[1],haw:Q[1],he:function(e,a){var t=String(e).split("."),n=t[0],o=!t[1],r=Number(t[0])===e,i=r&&Number(t[0].slice(-1));return a?"other":1===e&&o?"one":2===Number(n)&&o?"two":o&&(e<0||e>10)&&r&&0===i?"many":"other"},hi:function(e,a){return a?1===e?"one":2===e||3===e?"two":4===e?"few":6===e?"many":"other":e>=0&&e<=1?"one":"other"},hr:function(e,a){var t=String(e).split("."),n=t[0],o=t[1]||"",r=!t[1],i=Number(n.slice(-1)),s=Number(n.slice(-2)),l=Number(o.slice(-1)),u=Number(o.slice(-2));return a?"other":r&&1===i&&11!==s||1===l&&11!==u?"one":r&&i>=2&&i<=4&&(s<12||s>14)||l>=2&&l<=4&&(u<12||u>14)?"few":"other"},hsb:function(e,a){var t=String(e).split("."),n=t[0],o=t[1]||"",r=!t[1],i=Number(n.slice(-2)),s=Number(o.slice(-2));return a?"other":r&&1===i||1===s?"one":r&&2===i||2===s?"two":r&&(3===i||4===i)||3===s||4===s?"few":"other"},hu:function(e,a){return a?1===e||5===e?"one":"other":1===e?"one":"other"},hy:function(e,a){return a?1===e?"one":"other":e>=0&&e<2?"one":"other"},ia:Q[3],id:Q[0],ig:Q[0],ii:Q[0],in:Q[0],io:Q[3],is:function(e,a){var t=String(e).split("."),n=t[0],o=Number(t[0])===e,r=Number(n.slice(-1)),i=Number(n.slice(-2));return a?"other":o&&1===r&&11!==i||!o?"one":"other"},it:function(e,a){var t=!String(e).split(".")[1];return a?11===e||8===e||80===e||800===e?"many":"other":1===e&&t?"one":"other"},iu:function(e,a){return a?"other":1===e?"one":2===e?"two":"other"},iw:function(e,a){var t=String(e).split("."),n=t[0],o=!t[1],r=Number(t[0])===e,i=r&&Number(t[0].slice(-1));return a?"other":1===e&&o?"one":2===Number(n)&&o?"two":o&&(e<0||e>10)&&r&&0===i?"many":"other"},ja:Q[0],jbo:Q[0],jgo:Q[1],ji:Q[3],jmc:Q[1],jv:Q[0],jw:Q[0],ka:function(e,a){var t=String(e).split(".")[0],n=Number(t.slice(-2));return a?1===Number(t)?"one":0===Number(t)||n>=2&&n<=20||40===n||60===n||80===n?"many":"other":1===e?"one":"other"},kab:function(e,a){return a?"other":e>=0&&e<2?"one":"other"},kaj:Q[1],kcg:Q[1],kde:Q[0],kea:Q[0],kk:function(e,a){var t=String(e).split("."),n=Number(t[0])===e,o=n&&Number(t[0].slice(-1));return a?6===o||9===o||n&&0===o&&0!==e?"many":"other":1===e?"one":"other"},kkj:Q[1],kl:Q[1],km:Q[0],kn:function(e,a){return a?"other":e>=0&&e<=1?"one":"other"},ko:Q[0],ks:Q[1],ksb:Q[1],ksh:function(e,a){return a?"other":0===e?"zero":1===e?"one":"other"},ku:Q[1],kw:function(e,a){return a?"other":1===e?"one":2===e?"two":"other"},ky:Q[1],lag:function(e,a){var t=String(e).split(".")[0];return a?"other":0===e?"zero":0!==Number(t)&&1!==Number(t)||0===e?"other":"one"},lb:Q[1],lg:Q[1],lkt:Q[0],ln:Q[2],lo:function(e,a){return a&&1===e?"one":"other"},lt:function(e,a){var t=String(e).split("."),n=t[1]||"",o=Number(t[0])===e,r=o&&Number(t[0].slice(-1)),i=o&&Number(t[0].slice(-2));return a?"other":1===r&&(i<11||i>19)?"one":r>=2&&r<=9&&(i<11||i>19)?"few":0!==Number(n)?"many":"other"},lv:function(e,a){var t=String(e).split("."),n=t[1]||"",o=n.length,r=Number(t[0])===e,i=r&&Number(t[0].slice(-1)),s=r&&Number(t[0].slice(-2)),l=Number(n.slice(-2)),u=Number(n.slice(-1));return a?"other":r&&0===i||s>=11&&s<=19||2===o&&l>=11&&l<=19?"zero":1===i&&11!==s||2===o&&1===u&&11!==l||2!==o&&1===u?"one":"other"},mas:Q[1],mg:Q[2],mgo:Q[1],mk:function(e,a){var t=String(e).split("."),n=t[0],o=t[1]||"",r=!t[1],i=Number(n.slice(-1)),s=Number(n.slice(-2)),l=Number(o.slice(-1)),u=Number(o.slice(-2));return a?1===i&&11!==s?"one":2===i&&12!==s?"two":7!==i&&8!==i||17===s||18===s?"other":"many":r&&1===i&&11!==s||1===l&&11!==u?"one":"other"},ml:Q[1],mn:Q[1],mo:function(e,a){var t=String(e).split("."),n=!t[1],o=Number(t[0])===e&&Number(t[0].slice(-2));return a?1===e?"one":"other":1===e&&n?"one":!n||0===e||1!==e&&o>=1&&o<=19?"few":"other"},mr:function(e,a){return a?1===e?"one":2===e||3===e?"two":4===e?"few":"other":e>=0&&e<=1?"one":"other"},ms:function(e,a){return a&&1===e?"one":"other"},mt:function(e,a){var t=String(e).split("."),n=Number(t[0])===e&&Number(t[0].slice(-2));return a?"other":1===e?"one":0===e||n>=2&&n<=10?"few":n>=11&&n<=19?"many":"other"},my:Q[0],nah:Q[1],naq:function(e,a){return a?"other":1===e?"one":2===e?"two":"other"},nb:Q[1],nd:Q[1],ne:function(e,a){var t=String(e).split("."),n=Number(t[0])===e;return a?n&&e>=1&&e<=4?"one":"other":1===e?"one":"other"},nl:Q[3],nn:Q[1],nnh:Q[1],no:Q[1],nqo:Q[0],nr:Q[1],nso:Q[2],ny:Q[1],nyn:Q[1],om:Q[1],or:function(e,a){var t=String(e).split("."),n=Number(t[0])===e;return a?1===e||5===e||n&&e>=7&&e<=9?"one":2===e||3===e?"two":4===e?"few":6===e?"many":"other":1===e?"one":"other"},os:Q[1],pa:Q[2],pap:Q[1],pl:function(e,a){var t=String(e).split("."),n=t[0],o=!t[1],r=Number(n.slice(-1)),i=Number(n.slice(-2));return a?"other":1===e&&o?"one":o&&r>=2&&r<=4&&(i<12||i>14)?"few":o&&1!==Number(n)&&(0===r||1===r)||o&&r>=5&&r<=9||o&&i>=12&&i<=14?"many":"other"},prg:function(e,a){var t=String(e).split("."),n=t[1]||"",o=n.length,r=Number(t[0])===e,i=r&&Number(t[0].slice(-1)),s=r&&Number(t[0].slice(-2)),l=Number(n.slice(-2)),u=Number(n.slice(-1));return a?"other":r&&0===i||s>=11&&s<=19||2===o&&l>=11&&l<=19?"zero":1===i&&11!==s||2===o&&1===u&&11!==l||2!==o&&1===u?"one":"other"},ps:Q[1],pt:function(e,a){var t=String(e).split(".")[0];return a?"other":0===Number(t)||1===Number(t)?"one":"other"},"pt-PT":Q[3],rm:Q[1],ro:function(e,a){var t=String(e).split("."),n=!t[1],o=Number(t[0])===e&&Number(t[0].slice(-2));return a?1===e?"one":"other":1===e&&n?"one":!n||0===e||1!==e&&o>=1&&o<=19?"few":"other"},rof:Q[1],root:Q[0],ru:function(e,a){var t=String(e).split("."),n=t[0],o=!t[1],r=Number(n.slice(-1)),i=Number(n.slice(-2));return a?"other":o&&1===r&&11!==i?"one":o&&r>=2&&r<=4&&(i<12||i>14)?"few":o&&0===r||o&&r>=5&&r<=9||o&&i>=11&&i<=14?"many":"other"},rwk:Q[1],sah:Q[0],saq:Q[1],sc:function(e,a){var t=!String(e).split(".")[1];return a?11===e||8===e||80===e||800===e?"many":"other":1===e&&t?"one":"other"},scn:function(e,a){var t=!String(e).split(".")[1];return a?11===e||8===e||80===e||800===e?"many":"other":1===e&&t?"one":"other"},sd:Q[1],sdh:Q[1],se:function(e,a){return a?"other":1===e?"one":2===e?"two":"other"},seh:Q[1],ses:Q[0],sg:Q[0],sh:function(e,a){var t=String(e).split("."),n=t[0],o=t[1]||"",r=!t[1],i=Number(n.slice(-1)),s=Number(n.slice(-2)),l=Number(o.slice(-1)),u=Number(o.slice(-2));return a?"other":r&&1===i&&11!==s||1===l&&11!==u?"one":r&&i>=2&&i<=4&&(s<12||s>14)||l>=2&&l<=4&&(u<12||u>14)?"few":"other"},shi:function(e,a){var t=String(e).split("."),n=Number(t[0])===e;return a?"other":e>=0&&e<=1?"one":n&&e>=2&&e<=10?"few":"other"},si:function(e,a){var t=String(e).split("."),n=t[0],o=t[1]||"";return a?"other":0===e||1===e||0===Number(n)&&1===Number(o)?"one":"other"},sk:function(e,a){var t=String(e).split("."),n=t[0],o=!t[1];return a?"other":1===e&&o?"one":Number(n)>=2&&Number(n)<=4&&o?"few":o?"other":"many"},sl:function(e,a){var t=String(e).split("."),n=t[0],o=!t[1],r=Number(n.slice(-2));return a?"other":o&&1===r?"one":o&&2===r?"two":o&&(3===r||4===r)||!o?"few":"other"},sma:function(e,a){return a?"other":1===e?"one":2===e?"two":"other"},smi:function(e,a){return a?"other":1===e?"one":2===e?"two":"other"},smj:function(e,a){return a?"other":1===e?"one":2===e?"two":"other"},smn:function(e,a){return a?"other":1===e?"one":2===e?"two":"other"},sms:function(e,a){return a?"other":1===e?"one":2===e?"two":"other"},sn:Q[1],so:Q[1],sq:function(e,a){var t=String(e).split("."),n=Number(t[0])===e,o=n&&Number(t[0].slice(-1)),r=n&&Number(t[0].slice(-2));return a?1===e?"one":4===o&&14!==r?"many":"other":1===e?"one":"other"},sr:function(e,a){var t=String(e).split("."),n=t[0],o=t[1]||"",r=!t[1],i=Number(n.slice(-1)),s=Number(n.slice(-2)),l=Number(o.slice(-1)),u=Number(o.slice(-2));return a?"other":r&&1===i&&11!==s||1===l&&11!==u?"one":r&&i>=2&&i<=4&&(s<12||s>14)||l>=2&&l<=4&&(u<12||u>14)?"few":"other"},ss:Q[1],ssy:Q[1],st:Q[1],sv:function(e,a){var t=String(e).split("."),n=!t[1],o=Number(t[0])===e,r=o&&Number(t[0].slice(-1)),i=o&&Number(t[0].slice(-2));return a?1!==r&&2!==r||11===i||12===i?"other":"one":1===e&&n?"one":"other"},sw:Q[3],syr:Q[1],ta:Q[1],te:Q[1],teo:Q[1],th:Q[0],ti:Q[2],tig:Q[1],tk:function(e,a){var t=String(e).split("."),n=Number(t[0])===e&&Number(t[0].slice(-1));return a?6===n||9===n||10===e?"few":"other":1===e?"one":"other"},tl:function(e,a){var t=String(e).split("."),n=t[0],o=t[1]||"",r=!t[1],i=Number(n.slice(-1)),s=Number(o.slice(-1));return a?1===e?"one":"other":r&&(1===Number(n)||2===Number(n)||3===Number(n))||r&&4!==i&&6!==i&&9!==i||!r&&4!==s&&6!==s&&9!==s?"one":"other"},tn:Q[1],to:Q[0],tr:Q[1],ts:Q[1],tzm:function(e,a){var t=String(e).split("."),n=Number(t[0])===e;return a?"other":0===e||1===e||n&&e>=11&&e<=99?"one":"other"},ug:Q[1],uk:function(e,a){var t=String(e).split("."),n=t[0],o=!t[1],r=Number(t[0])===e,i=r&&Number(t[0].slice(-1)),s=r&&Number(t[0].slice(-2)),l=Number(n.slice(-1)),u=Number(n.slice(-2));return a?3===i&&13!==s?"few":"other":o&&1===l&&11!==u?"one":o&&l>=2&&l<=4&&(u<12||u>14)?"few":o&&0===l||o&&l>=5&&l<=9||o&&u>=11&&u<=14?"many":"other"},ur:Q[3],uz:Q[1],ve:Q[1],vi:function(e,a){return a&&1===e?"one":"other"},vo:Q[1],vun:Q[1],wa:Q[2],wae:Q[1],wo:Q[0],xh:Q[1],xog:Q[1],yi:Q[3],yo:Q[0],yue:Q[0],zh:Q[0],zu:function(e,a){return a?"other":e>=0&&e<=1?"one":"other"}},ee=function(){function e(){}return e.prototype.resolveLocale=function(e){do{if(q[e])return e;if(q[e.toLocaleLowerCase()])return e.toLocaleLowerCase();e=e.replace(/(-|_)?[^-_]*$/,"")}while(e);return null},e.prototype.getFunc=function(e){return this._locale=this.resolveLocale(e),q[this._locale]},e}(),ae=".";function te(e,a){var t,n=e["decimalFormats-"+("long"===a?"long":"short")].decimalFormat,o=0;return(t=Object.keys(n).reduce((function(e,a){var t=a.split("0").length-1,r=a.split("-")[2];return e[t]=e[t]||{},e[t][r]=n[a],o=Math.max(t,o),e}),{})).maxExponent=o,t}var ne,oe,re,ie=function(){function e(){}return e.prototype.decimal=function(e,a){var t=this,n=e.numberFormats.decimalFormats,o=e.numberSymbols,r=this.parseFormats(n),i=e.numberFormats;return function(e,n){var s,l=r;return M(n)||(l=t.resetFormats(r,z.ROUND_HALF_EVEN,n),n.notation&&"compact"===n.notation&&(s=te(i,n.compactDisplay))),t.resetString(l,o,e,s,a)}},e.prototype.currencies=function(e,a){var t,n=this,o=e.numberFormats,r=e.currencyFormats,i=e.numberSymbols,s=this.parseFormats(r);"latn"!==e.defaultNumberingSystem&&(t=e.numberingSystem._digits||void 0);var l=this.currencySymbol(e);return function(r,u,c){var m,d=n.resetCurrencyFormatsInfo(s,e,u,c);M(c)||"compact"!==c.notation||((m=te(o,c.compactDisplay)).nuDigits=t);var p=n.resetString(d,i,r,m,a),y=l(u);return p.replace(/\u00A4/g,y)}},e.prototype.currencySymbol=function(e){return function(a){return e.currencySymbols[a]&&e.currencySymbols[a].symbol?e.currencySymbols[a].symbol:a}},e.prototype.percent=function(e){var a=this,t=e.numberFormats.percentFormats,n=e.numberSymbols,o=this.parseFormats(t);return function(e,t){var r=o;return M(t)||(r=a.resetFormats(o,z.ROUND_HALF_EVEN,t)),e=+a.resetPercentNumber(e),a.resetString(r,n,e)}},e.prototype.plural=function(e){var a=this,t=e.numberFormats.decimalFormats,n=this.parseFormats(t);return function(e,t,o){return(N(o)||N(t))&&(n=a.resetFormats(n,z.ROUND_HALF_EVEN)),a.roundingNumber(e,n.minFrac,n.maxFrac,n.round)}},e.prototype.resetFormats=function(e,a,t){var n=Object.assign({},e);return t.notation&&t.compactDisplay&&(n.maxFrac=0,n.minFrac=0,n.minInt=1),N(t.minFractionDigits)&&(n.minFrac=D("minFractionDigits",[0,20],t.minFractionDigits)),N(t.maxFractionDigits)?n.maxFrac=D("maxFractionDigits",[0,20],t.maxFractionDigits):null!==n.minFrac&&n.minFrac>n.maxFrac&&(n.maxFrac=n.minFrac),N(t.minIntegerDigits)&&(n.minInt=D("minIntegerDigits",[1,21],t.minIntegerDigits)),N(a)&&(n.round=a),n},e.prototype.parseFormats=function(e,a){void 0===a&&(a="-");var t={minInt:1,minFrac:0,maxFrac:0,posPre:"",posSuf:"",negPre:"",negSuf:"",gSize:0,lgSize:0,round:z.ROUND_HALF_EVEN},n=e.split(";"),o=n[0],r=n[1],i=-1!==o.indexOf(ae)?o.split(ae):[o.substring(0,o.lastIndexOf("0")+1),o.substring(o.lastIndexOf("0")+1)],s=i[0],l=i[1]||"";t.posPre=s.substr(0,s.indexOf("#"));for(var u=0;u<l.length;u++){var c=l.charAt(u);"0"===c?t.minFrac=t.maxFrac=u+1:"#"===c?t.maxFrac=u+1:t.posSuf+=c}var m=s.split(",");if(t.gSize=m[1]?m[1].length:0,t.lgSize=m[2]||m[1]?(m[2]||m[1]).length:0,r){var d=o.length-t.posPre.length-t.posSuf.length,p=r.indexOf("#");t.negPre=r.substr(0,p).replace(/'/g,""),t.negSuf=r.substr(p+d).replace(/'/g,"")}else t.negPre=a+t.posPre,t.negSuf=t.posSuf;return t},e.prototype.parseNumber=function(e){var a,t,n=[];for((a=e.indexOf(ae))>-1&&(e=e.replace(ae,"")),a<0&&(a=e.length),t=0;t<e.length;t++)n.push(+e.charAt(t));return{digits:n,integerLen:a}},e.prototype.roundingNumber=function(e,a,t,n){var o=e.toString().replace(ae,"").length,i=e.toString().indexOf(ae),s=o-(i>-1?i:o);if(a>t)throw new Error("The minimum number of digits after fraction ("+a+") is higher than the maximum ("+t+").");var l=new r.Decimal(e),u=Math.min(Math.max(a,s),t);return l.toFixed(u,n)},e.prototype.resetCurrencyFormatsInfo=function(e,a,t,n){if(!a.fractions[t]&&M(n))return e;var o=Object.assign({},e);a.fractions[t]&&(o.maxFrac=a.fractions[t][H.DIGIST],o.minFrac=o.maxFrac);var r=a.fractions[t]&&a.fractions[t][H.ROUNDING];return o.round=r&&"0"!==r?r:e.round,M(n)||(o=this.resetFormats(o,o.round,n)),o},e.prototype.resetPercentNumber=function(e){return new r.Decimal(e).times(100).valueOf()},e.prototype.resetString=function(e,a,t,n,o){var r,i,s,l=e.minFrac,u=e.maxFrac,c=e.minInt;if(!M(n))if(i=Math.abs(Math.floor(t)).toString().length-1,(i=Math.min(i,n.maxExponent))>=3&&(s=n[i]&&n[i].other),"0"===s)s=null;else if(s){var m=i-(s.split("0").length-1-1);t/=Math.pow(10,m)}var d=this.roundingNumber(Math.abs(t),l,u,e.round);l||(d=+d>=1e21?d:String(+d));var p="",y="";if(n&&s){var h=(new ee).getFunc(o),N=h&&h(+t)?h(+t):"other",g=(s=(s=n[i][N]||s).replace("'.'",".")).match(/^([^0]*)(0+)([^0]*)$/);p=g[1],y=g[3]}for(var f=this.parseNumber(d),b=f.digits,v=f.integerLen,S=[];v<c;v++)b.unshift(0);v>0?S=b.splice(v,b.length):(S=b,b=[0]),n&&n.nuDigits&&(b.forEach((function(e,a){b[a]=n.nuDigits[+e]})),S.forEach((function(e,a){S[a]=n.nuDigits[+e]})));var D=[];for(b.length>=e.lgSize&&D.unshift(b.splice(-e.lgSize,b.length).join(""));b.length>e.gSize;)D.unshift(b.splice(-e.gSize,b.length).join(""));return b.length&&D.unshift(b.join("")),r=D.join(a.group),S.length&&(r+=a.decimal+S.join("")),r=p+r+y,t<0?e.negPre+r+e.negSuf:e.posPre+r+e.posSuf},e}(),se=function(){function e(){this.mapping={},this.formatter=new ie}return e.prototype.getFormatter=function(e,a){var t;return this.mapping[e]||(this.mapping[e]={}),this.mapping[e]&&this.mapping[e][a]&&(t=this.mapping[e]&&this.mapping[e][a]),t},e.prototype.currencies=function(e,a){var t=this.getFormatter(a,x.CURRENCIES);return t||(t=this.formatter.currencies(e,a),this.mapping[a][x.CURRENCIES]=t),t},e.prototype.currenySymbol=function(e,a){var t=this.getFormatter(a,x.CURRENCYSYMBOL);return t||(t=this.formatter.currencySymbol(e),this.mapping[a][x.CURRENCYSYMBOL]=t),t},e.prototype.percent=function(e,a){var t=this.getFormatter(a,x.PERCENT);return t||(t=this.formatter.percent(e),this.mapping[a][x.PERCENT]=t),t},e.prototype.decimal=function(e,a){var t=this.getFormatter(a,x.DECIMAL);return t||(t=this.formatter.decimal(e,a),this.mapping[a][x.DECIMAL]=t),t},e.prototype.roundNumberForPlural=function(e,a){var t=this.getFormatter(a,x.PLURAL);return t||(t=this.formatter.plural(e),this.mapping[a][x.PLURAL]=t),t},e}(),le={localeID:"en_US",language:"en",region:"US",categories:{dates:{dayPeriodsFormat:{narrow:["a","p"],abbreviated:["AM","PM"],wide:["AM","PM"]},dayPeriodsStandalone:{narrow:["AM","PM"],abbreviated:["AM","PM"],wide:["AM","PM"]},daysFormat:{narrow:["S","M","T","W","T","F","S"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],short:["Su","Mo","Tu","We","Th","Fr","Sa"]},daysStandalo