{"version":3,"file":null,"sources":["../src/util.js","../src/6.locales-currencies-tz.js","../src/9.negotiation.js","../src/8.intl.js","../src/11.numberformat.js","../src/cldr.js","../src/12.datetimeformat.js","../src/14.pluralrules.js","../src/core.js","../src/exp.js","../src/13.locale-sensitive-functions.js","../node_modules/make-plural/es6/plurals.js","../src/browser-main.js"],"sourcesContent":["const realDefineProp = (function () {\n let sentinel = function(){};\n try {\n Object.defineProperty(sentinel, 'a', {\n get: function () {\n return 1;\n }\n });\n Object.defineProperty(sentinel, 'prototype', { writable: false });\n return sentinel.a === 1 && sentinel.prototype instanceof Object;\n } catch (e) {\n return false;\n }\n })();\n\n// Need a workaround for getters in ES3\nexport const es3 = !realDefineProp && !Object.prototype.__defineGetter__;\n\n// We use this a lot (and need it for proto-less objects)\nexport const hop = Object.prototype.hasOwnProperty;\n\n// Naive defineProperty for compatibility\nexport const defineProperty = realDefineProp ? Object.defineProperty : function (obj, name, desc) {\n if ('get' in desc && obj.__defineGetter__)\n obj.__defineGetter__(name, desc.get);\n\n else if (!hop.call(obj, name) || 'value' in desc)\n obj[name] = desc.value;\n};\n\n// Array.prototype.indexOf, as good as we need it to be\nexport const arrIndexOf = Array.prototype.indexOf || function (search) {\n /*jshint validthis:true */\n let t = this;\n if (!t.length)\n return -1;\n\n for (let i = arguments[1] || 0, max = t.length; i < max; i++) {\n if (t[i] === search)\n return i;\n }\n\n return -1;\n};\n\n// Create an object with the specified prototype (2nd arg required for Record)\nexport const objCreate = Object.create || function (proto, props) {\n let obj;\n\n function F() {}\n F.prototype = proto;\n obj = new F();\n\n for (let k in props) {\n if (hop.call(props, k))\n defineProperty(obj, k, props[k]);\n }\n\n return obj;\n};\n\n// Snapshot some (hopefully still) native built-ins\nexport const arrSlice = Array.prototype.slice;\nexport const arrConcat = Array.prototype.concat;\nexport const arrPush = Array.prototype.push;\nexport const arrJoin = Array.prototype.join;\nexport const arrShift = Array.prototype.shift;\n\n// Naive Function.prototype.bind for compatibility\nexport const fnBind = Function.prototype.bind || function (thisObj) {\n let fn = this,\n args = arrSlice.call(arguments, 1);\n\n // All our (presently) bound functions have either 1 or 0 arguments. By returning\n // different function signatures, we can pass some tests in ES3 environments\n if (fn.length === 1) {\n return function () {\n return fn.apply(thisObj, arrConcat.call(args, arrSlice.call(arguments)));\n };\n }\n return function () {\n return fn.apply(thisObj, arrConcat.call(args, arrSlice.call(arguments)));\n };\n};\n\n// Object housing internal properties for constructors\nexport const internals = objCreate(null);\n\n// Keep internal properties internal\nexport const secret = Math.random();\n\n// Helper functions\n// ================\n\n/**\n * A function to deal with the inaccuracy of calculating log10 in pre-ES6\n * JavaScript environments. Math.log(num) / Math.LN10 was responsible for\n * causing issue #62.\n */\nexport function log10Floor (n) {\n // ES6 provides the more accurate Math.log10\n if (typeof Math.log10 === 'function')\n return Math.floor(Math.log10(n));\n\n let x = Math.round(Math.log(n) * Math.LOG10E);\n return x - (Number('1e' + x) > n);\n}\n\n/**\n * A map that doesn't contain Object in its prototype chain\n */\nexport function Record (obj) {\n // Copy only own properties over unless this object is already a Record instance\n for (let k in obj) {\n if (obj instanceof Record || hop.call(obj, k))\n defineProperty(this, k, { value: obj[k], enumerable: true, writable: true, configurable: true });\n }\n}\nRecord.prototype = objCreate(null);\n\n/**\n * An ordered list\n */\nexport function List() {\n defineProperty(this, 'length', { writable:true, value: 0 });\n\n if (arguments.length)\n arrPush.apply(this, arrSlice.call(arguments));\n}\nList.prototype = objCreate(null);\n\n/**\n * Constructs a regular expression to restore tainted RegExp properties\n */\nexport function createRegExpRestore () {\n if (internals.disableRegExpRestore) {\n return function() { /* no-op */ };\n }\n\n let regExpCache = {\n lastMatch: RegExp.lastMatch || '',\n leftContext: RegExp.leftContext,\n multiline: RegExp.multiline,\n input: RegExp.input\n },\n has = false;\n\n // Create a snapshot of all the 'captured' properties\n for (let i = 1; i <= 9; i++)\n has = (regExpCache['$'+i] = RegExp['$'+i]) || has;\n\n return function() {\n // Now we've snapshotted some properties, escape the lastMatch string\n let esc = /[.?*+^$[\\]\\\\(){}|-]/g,\n lastMatch = regExpCache.lastMatch.replace(esc, '\\\\$&'),\n exprStr = '';\n\n // If any of the captured strings were non-empty, iterate over them all\n if (has) {\n for (let i = 1; i <= 9; i++) {\n let m = regExpCache['$'+i];\n\n // If it's empty, add an empty capturing group\n if (!m) {\n exprStr += '(';\n lastMatch = ')' + lastMatch;\n }\n // Else find the string in lm and escape & wrap it to capture it\n else {\n m = m.replace(esc, '\\\\$&');\n exprStr += lastMatch.substring(0, lastMatch.indexOf(m)) + '(';\n lastMatch = m + ')' + lastMatch.substring(lastMatch.indexOf(m) + m.length);\n }\n }\n }\n\n exprStr += lastMatch;\n\n // Shorten the regex by replacing each part of the expression with a match\n // for a string of that exact length. This is safe for the type of\n // expressions generated above, because the expression matches the whole\n // match string, so we know each group and each segment between capturing\n // groups can be matched by its length alone.\n //\n // The purpose of the regex is to match sequences of characters other\n // than unescaped parentheses. This is a more complicated requirement\n // than it seems at first glance, because it's necessary to match a\n // parenthesis which appears immediately after a backslash (\"\\(\"), but\n // not a parenthesis which appears immediately after an escaped backslash\n // (\"\\\\(\"). We can't simply match [^\\\\]\\\\(, because the previous\n // backslash could itself have a backslash preceding (and escaping) it.\n //\n // Any attempts to simplify this regex are encouraged! A replacement\n // regex should match the strings \"a\\\\\\(\\\\\\)\\\\\" and \"a\\\\\\)\\\\\\(\" in the\n // test string \"a\\\\\\(\\\\\\)\\\\(a\\\\\\)\\\\\\()\".\n exprStr = exprStr.replace(/((^|[^\\\\])((\\\\\\\\)*\\\\[()])+|[^()])+/g, (match) => {\n return `[\\\\s\\\\S]{${match.replace(/\\\\(.)/g, '$1').length}}`;\n });\n\n // Create the regular expression that will reconstruct the RegExp properties\n let expr = new RegExp(exprStr, regExpCache.multiline ? 'gm' : 'g');\n\n // Set the lastIndex of the generated expression to ensure that the match\n // is found in the correct index.\n expr.lastIndex = regExpCache.leftContext.length;\n\n expr.exec(regExpCache.input);\n };\n}\n\n/**\n * Mimics ES5's abstract ToObject() function\n */\nexport function toObject (arg) {\n if (arg === null)\n throw new TypeError('Cannot convert null or undefined to object');\n\n if (typeof arg === 'object')\n return arg;\n return Object(arg);\n}\n\nexport function toNumber (arg) {\n if (typeof arg === 'number')\n return arg;\n return Number(arg);\n}\n\nexport function toInteger (arg) {\n let number = toNumber(arg);\n if (isNaN(number))\n return 0;\n if (number === +0 ||\n number === -0 ||\n number === +Infinity ||\n number === -Infinity)\n return number;\n if (number < 0)\n return Math.floor(Math.abs(number)) * -1;\n return Math.floor(Math.abs(number));\n}\n\nexport function toLength (arg) {\n let len = toInteger(arg);\n if (len <= 0)\n return 0;\n if (len === Infinity)\n return Math.pow(2, 53) - 1;\n return Math.min(len, Math.pow(2, 53) - 1);\n}\n\n/**\n * Returns \"internal\" properties for an object\n */\nexport function getInternalProperties (obj) {\n if (hop.call(obj, '__getInternalProperties'))\n return obj.__getInternalProperties(secret);\n\n return objCreate(null);\n}\n","// Sect 6.2 Language Tags\n// ======================\n\nimport {\n expBCP47Syntax,\n expExtSequences,\n expVariantDupes,\n expSingletonDupes\n} from './exp';\n\nimport {\n hop,\n arrJoin,\n arrSlice\n} from \"./util.js\";\n\n// Default locale is the first-added locale data for us\nexport let defaultLocale;\nexport function setDefaultLocale(locale) {\n defaultLocale = locale;\n}\n\n// IANA Subtag Registry redundant tag and subtag maps\nconst redundantTags = {\n tags: {\n \"art-lojban\": \"jbo\",\n \"i-ami\": \"ami\",\n \"i-bnn\": \"bnn\",\n \"i-hak\": \"hak\",\n \"i-klingon\": \"tlh\",\n \"i-lux\": \"lb\",\n \"i-navajo\": \"nv\",\n \"i-pwn\": \"pwn\",\n \"i-tao\": \"tao\",\n \"i-tay\": \"tay\",\n \"i-tsu\": \"tsu\",\n \"no-bok\": \"nb\",\n \"no-nyn\": \"nn\",\n \"sgn-BE-FR\": \"sfb\",\n \"sgn-BE-NL\": \"vgt\",\n \"sgn-CH-DE\": \"sgg\",\n \"zh-guoyu\": \"cmn\",\n \"zh-hakka\": \"hak\",\n \"zh-min-nan\": \"nan\",\n \"zh-xiang\": \"hsn\",\n \"sgn-BR\": \"bzs\",\n \"sgn-CO\": \"csn\",\n \"sgn-DE\": \"gsg\",\n \"sgn-DK\": \"dsl\",\n \"sgn-ES\": \"ssp\",\n \"sgn-FR\": \"fsl\",\n \"sgn-GB\": \"bfi\",\n \"sgn-GR\": \"gss\",\n \"sgn-IE\": \"isg\",\n \"sgn-IT\": \"ise\",\n \"sgn-JP\": \"jsl\",\n \"sgn-MX\": \"mfs\",\n \"sgn-NI\": \"ncs\",\n \"sgn-NL\": \"dse\",\n \"sgn-NO\": \"nsl\",\n \"sgn-PT\": \"psr\",\n \"sgn-SE\": \"swl\",\n \"sgn-US\": \"ase\",\n \"sgn-ZA\": \"sfs\",\n \"zh-cmn\": \"cmn\",\n \"zh-cmn-Hans\": \"cmn-Hans\",\n \"zh-cmn-Hant\": \"cmn-Hant\",\n \"zh-gan\": \"gan\",\n \"zh-wuu\": \"wuu\",\n \"zh-yue\": \"yue\"\n },\n subtags: {\n BU: \"MM\",\n DD: \"DE\",\n FX: \"FR\",\n TP: \"TL\",\n YD: \"YE\",\n ZR: \"CD\",\n heploc: \"alalc97\",\n 'in': \"id\",\n iw: \"he\",\n ji: \"yi\",\n jw: \"jv\",\n mo: \"ro\",\n ayx: \"nun\",\n bjd: \"drl\",\n ccq: \"rki\",\n cjr: \"mom\",\n cka: \"cmr\",\n cmk: \"xch\",\n drh: \"khk\",\n drw: \"prs\",\n gav: \"dev\",\n hrr: \"jal\",\n ibi: \"opa\",\n kgh: \"kml\",\n lcq: \"ppr\",\n mst: \"mry\",\n myt: \"mry\",\n sca: \"hle\",\n tie: \"ras\",\n tkk: \"twm\",\n tlw: \"weo\",\n tnf: \"prs\",\n ybd: \"rki\",\n yma: \"lrr\"\n },\n extLang: {\n aao: [\"aao\", \"ar\"],\n abh: [\"abh\", \"ar\"],\n abv: [\"abv\", \"ar\"],\n acm: [\"acm\", \"ar\"],\n acq: [\"acq\", \"ar\"],\n acw: [\"acw\", \"ar\"],\n acx: [\"acx\", \"ar\"],\n acy: [\"acy\", \"ar\"],\n adf: [\"adf\", \"ar\"],\n ads: [\"ads\", \"sgn\"],\n aeb: [\"aeb\", \"ar\"],\n aec: [\"aec\", \"ar\"],\n aed: [\"aed\", \"sgn\"],\n aen: [\"aen\", \"sgn\"],\n afb: [\"afb\", \"ar\"],\n afg: [\"afg\", \"sgn\"],\n ajp: [\"ajp\", \"ar\"],\n apc: [\"apc\", \"ar\"],\n apd: [\"apd\", \"ar\"],\n arb: [\"arb\", \"ar\"],\n arq: [\"arq\", \"ar\"],\n ars: [\"ars\", \"ar\"],\n ary: [\"ary\", \"ar\"],\n arz: [\"arz\", \"ar\"],\n ase: [\"ase\", \"sgn\"],\n asf: [\"asf\", \"sgn\"],\n asp: [\"asp\", \"sgn\"],\n asq: [\"asq\", \"sgn\"],\n asw: [\"asw\", \"sgn\"],\n auz: [\"auz\", \"ar\"],\n avl: [\"avl\", \"ar\"],\n ayh: [\"ayh\", \"ar\"],\n ayl: [\"ayl\", \"ar\"],\n ayn: [\"ayn\", \"ar\"],\n ayp: [\"ayp\", \"ar\"],\n bbz: [\"bbz\", \"ar\"],\n bfi: [\"bfi\", \"sgn\"],\n bfk: [\"bfk\", \"sgn\"],\n bjn: [\"bjn\", \"ms\"],\n bog: [\"bog\", \"sgn\"],\n bqn: [\"bqn\", \"sgn\"],\n bqy: [\"bqy\", \"sgn\"],\n btj: [\"btj\", \"ms\"],\n bve: [\"bve\", \"ms\"],\n bvl: [\"bvl\", \"sgn\"],\n bvu: [\"bvu\", \"ms\"],\n bzs: [\"bzs\", \"sgn\"],\n cdo: [\"cdo\", \"zh\"],\n cds: [\"cds\", \"sgn\"],\n cjy: [\"cjy\", \"zh\"],\n cmn: [\"cmn\", \"zh\"],\n coa: [\"coa\", \"ms\"],\n cpx: [\"cpx\", \"zh\"],\n csc: [\"csc\", \"sgn\"],\n csd: [\"csd\", \"sgn\"],\n cse: [\"cse\", \"sgn\"],\n csf: [\"csf\", \"sgn\"],\n csg: [\"csg\", \"sgn\"],\n csl: [\"csl\", \"sgn\"],\n csn: [\"csn\", \"sgn\"],\n csq: [\"csq\", \"sgn\"],\n csr: [\"csr\", \"sgn\"],\n czh: [\"czh\", \"zh\"],\n czo: [\"czo\", \"zh\"],\n doq: [\"doq\", \"sgn\"],\n dse: [\"dse\", \"sgn\"],\n dsl: [\"dsl\", \"sgn\"],\n dup: [\"dup\", \"ms\"],\n ecs: [\"ecs\", \"sgn\"],\n esl: [\"esl\", \"sgn\"],\n esn: [\"esn\", \"sgn\"],\n eso: [\"eso\", \"sgn\"],\n eth: [\"eth\", \"sgn\"],\n fcs: [\"fcs\", \"sgn\"],\n fse: [\"fse\", \"sgn\"],\n fsl: [\"fsl\", \"sgn\"],\n fss: [\"fss\", \"sgn\"],\n gan: [\"gan\", \"zh\"],\n gds: [\"gds\", \"sgn\"],\n gom: [\"gom\", \"kok\"],\n gse: [\"gse\", \"sgn\"],\n gsg: [\"gsg\", \"sgn\"],\n gsm: [\"gsm\", \"sgn\"],\n gss: [\"gss\", \"sgn\"],\n gus: [\"gus\", \"sgn\"],\n hab: [\"hab\", \"sgn\"],\n haf: [\"haf\", \"sgn\"],\n hak: [\"hak\", \"zh\"],\n hds: [\"hds\", \"sgn\"],\n hji: [\"hji\", \"ms\"],\n hks: [\"hks\", \"sgn\"],\n hos: [\"hos\", \"sgn\"],\n hps: [\"hps\", \"sgn\"],\n hsh: [\"hsh\", \"sgn\"],\n hsl: [\"hsl\", \"sgn\"],\n hsn: [\"hsn\", \"zh\"],\n icl: [\"icl\", \"sgn\"],\n ils: [\"ils\", \"sgn\"],\n inl: [\"inl\", \"sgn\"],\n ins: [\"ins\", \"sgn\"],\n ise: [\"ise\", \"sgn\"],\n isg: [\"isg\", \"sgn\"],\n isr: [\"isr\", \"sgn\"],\n jak: [\"jak\", \"ms\"],\n jax: [\"jax\", \"ms\"],\n jcs: [\"jcs\", \"sgn\"],\n jhs: [\"jhs\", \"sgn\"],\n jls: [\"jls\", \"sgn\"],\n jos: [\"jos\", \"sgn\"],\n jsl: [\"jsl\", \"sgn\"],\n jus: [\"jus\", \"sgn\"],\n kgi: [\"kgi\", \"sgn\"],\n knn: [\"knn\", \"kok\"],\n kvb: [\"kvb\", \"ms\"],\n kvk: [\"kvk\", \"sgn\"],\n kvr: [\"kvr\", \"ms\"],\n kxd: [\"kxd\", \"ms\"],\n lbs: [\"lbs\", \"sgn\"],\n lce: [\"lce\", \"ms\"],\n lcf: [\"lcf\", \"ms\"],\n liw: [\"liw\", \"ms\"],\n lls: [\"lls\", \"sgn\"],\n lsg: [\"lsg\", \"sgn\"],\n lsl: [\"lsl\", \"sgn\"],\n lso: [\"lso\", \"sgn\"],\n lsp: [\"lsp\", \"sgn\"],\n lst: [\"lst\", \"sgn\"],\n lsy: [\"lsy\", \"sgn\"],\n ltg: [\"ltg\", \"lv\"],\n lvs: [\"lvs\", \"lv\"],\n lzh: [\"lzh\", \"zh\"],\n max: [\"max\", \"ms\"],\n mdl: [\"mdl\", \"sgn\"],\n meo: [\"meo\", \"ms\"],\n mfa: [\"mfa\", \"ms\"],\n mfb: [\"mfb\", \"ms\"],\n mfs: [\"mfs\", \"sgn\"],\n min: [\"min\", \"ms\"],\n mnp: [\"mnp\", \"zh\"],\n mqg: [\"mqg\", \"ms\"],\n mre: [\"mre\", \"sgn\"],\n msd: [\"msd\", \"sgn\"],\n msi: [\"msi\", \"ms\"],\n msr: [\"msr\", \"sgn\"],\n mui: [\"mui\", \"ms\"],\n mzc: [\"mzc\", \"sgn\"],\n mzg: [\"mzg\", \"sgn\"],\n mzy: [\"mzy\", \"sgn\"],\n nan: [\"nan\", \"zh\"],\n nbs: [\"nbs\", \"sgn\"],\n ncs: [\"ncs\", \"sgn\"],\n nsi: [\"nsi\", \"sgn\"],\n nsl: [\"nsl\", \"sgn\"],\n nsp: [\"nsp\", \"sgn\"],\n nsr: [\"nsr\", \"sgn\"],\n nzs: [\"nzs\", \"sgn\"],\n okl: [\"okl\", \"sgn\"],\n orn: [\"orn\", \"ms\"],\n ors: [\"ors\", \"ms\"],\n pel: [\"pel\", \"ms\"],\n pga: [\"pga\", \"ar\"],\n pks: [\"pks\", \"sgn\"],\n prl: [\"prl\", \"sgn\"],\n prz: [\"prz\", \"sgn\"],\n psc: [\"psc\", \"sgn\"],\n psd: [\"psd\", \"sgn\"],\n pse: [\"pse\", \"ms\"],\n psg: [\"psg\", \"sgn\"],\n psl: [\"psl\", \"sgn\"],\n pso: [\"pso\", \"sgn\"],\n psp: [\"psp\", \"sgn\"],\n psr: [\"psr\", \"sgn\"],\n pys: [\"pys\", \"sgn\"],\n rms: [\"rms\", \"sgn\"],\n rsi: [\"rsi\", \"sgn\"],\n rsl: [\"rsl\", \"sgn\"],\n sdl: [\"sdl\", \"sgn\"],\n sfb: [\"sfb\", \"sgn\"],\n sfs: [\"sfs\", \"sgn\"],\n sgg: [\"sgg\", \"sgn\"],\n sgx: [\"sgx\", \"sgn\"],\n shu: [\"shu\", \"ar\"],\n slf: [\"slf\", \"sgn\"],\n sls: [\"sls\", \"sgn\"],\n sqk: [\"sqk\", \"sgn\"],\n sqs: [\"sqs\", \"sgn\"],\n ssh: [\"ssh\", \"ar\"],\n ssp: [\"ssp\", \"sgn\"],\n ssr: [\"ssr\", \"sgn\"],\n svk: [\"svk\", \"sgn\"],\n swc: [\"swc\", \"sw\"],\n swh: [\"swh\", \"sw\"],\n swl: [\"swl\", \"sgn\"],\n syy: [\"syy\", \"sgn\"],\n tmw: [\"tmw\", \"ms\"],\n tse: [\"tse\", \"sgn\"],\n tsm: [\"tsm\", \"sgn\"],\n tsq: [\"tsq\", \"sgn\"],\n tss: [\"tss\", \"sgn\"],\n tsy: [\"tsy\", \"sgn\"],\n tza: [\"tza\", \"sgn\"],\n ugn: [\"ugn\", \"sgn\"],\n ugy: [\"ugy\", \"sgn\"],\n ukl: [\"ukl\", \"sgn\"],\n uks: [\"uks\", \"sgn\"],\n urk: [\"urk\", \"ms\"],\n uzn: [\"uzn\", \"uz\"],\n uzs: [\"uzs\", \"uz\"],\n vgt: [\"vgt\", \"sgn\"],\n vkk: [\"vkk\", \"ms\"],\n vkt: [\"vkt\", \"ms\"],\n vsi: [\"vsi\", \"sgn\"],\n vsl: [\"vsl\", \"sgn\"],\n vsv: [\"vsv\", \"sgn\"],\n wuu: [\"wuu\", \"zh\"],\n xki: [\"xki\", \"sgn\"],\n xml: [\"xml\", \"sgn\"],\n xmm: [\"xmm\", \"ms\"],\n xms: [\"xms\", \"sgn\"],\n yds: [\"yds\", \"sgn\"],\n ysl: [\"ysl\", \"sgn\"],\n yue: [\"yue\", \"zh\"],\n zib: [\"zib\", \"sgn\"],\n zlm: [\"zlm\", \"ms\"],\n zmi: [\"zmi\", \"ms\"],\n zsl: [\"zsl\", \"sgn\"],\n zsm: [\"zsm\", \"ms\"]\n }\n};\n\n/**\n * Convert only a-z to uppercase as per section 6.1 of the spec\n */\nexport function toLatinUpperCase (str) {\n let i = str.length;\n\n while (i--) {\n let ch = str.charAt(i);\n\n if (ch >= \"a\" && ch <= \"z\")\n str = str.slice(0, i) + ch.toUpperCase() + str.slice(i+1);\n }\n\n return str;\n}\n\n/**\n * The IsStructurallyValidLanguageTag abstract operation verifies that the locale\n * argument (which must be a String value)\n *\n * - represents a well-formed BCP 47 language tag as specified in RFC 5646 section\n * 2.1, or successor,\n * - does not include duplicate variant subtags, and\n * - does not include duplicate singleton subtags.\n *\n * The abstract operation returns true if locale can be generated from the ABNF\n * grammar in section 2.1 of the RFC, starting with Language-Tag, and does not\n * contain duplicate variant or singleton subtags (other than as a private use\n * subtag). It returns false otherwise. Terminal value characters in the grammar are\n * interpreted as the Unicode equivalents of the ASCII octet values given.\n */\nexport function /* 6.2.2 */IsStructurallyValidLanguageTag(locale) {\n // represents a well-formed BCP 47 language tag as specified in RFC 5646\n if (!expBCP47Syntax.test(locale))\n return false;\n\n // does not include duplicate variant subtags, and\n if (expVariantDupes.test(locale))\n return false;\n\n // does not include duplicate singleton subtags.\n if (expSingletonDupes.test(locale))\n return false;\n\n return true;\n}\n\n/**\n * The CanonicalizeLanguageTag abstract operation returns the canonical and case-\n * regularized form of the locale argument (which must be a String value that is\n * a structurally valid BCP 47 language tag as verified by the\n * IsStructurallyValidLanguageTag abstract operation). It takes the steps\n * specified in RFC 5646 section 4.5, or successor, to bring the language tag\n * into canonical form, and to regularize the case of the subtags, but does not\n * take the steps to bring a language tag into “extlang form” and to reorder\n * variant subtags.\n\n * The specifications for extensions to BCP 47 language tags, such as RFC 6067,\n * may include canonicalization rules for the extension subtag sequences they\n * define that go beyond the canonicalization rules of RFC 5646 section 4.5.\n * Implementations are allowed, but not required, to apply these additional rules.\n */\nexport function /* 6.2.3 */CanonicalizeLanguageTag (locale) {\n let match, parts;\n\n // A language tag is in 'canonical form' when the tag is well-formed\n // according to the rules in Sections 2.1 and 2.2\n\n // Section 2.1 says all subtags use lowercase...\n locale = locale.toLowerCase();\n\n // ...with 2 exceptions: 'two-letter and four-letter subtags that neither\n // appear at the start of the tag nor occur after singletons. Such two-letter\n // subtags are all uppercase (as in the tags \"en-CA-x-ca\" or \"sgn-BE-FR\") and\n // four-letter subtags are titlecase (as in the tag \"az-Latn-x-latn\").\n parts = locale.split('-');\n for (let i = 1, max = parts.length; i < max; i++) {\n // Two-letter subtags are all uppercase\n if (parts[i].length === 2)\n parts[i] = parts[i].toUpperCase();\n\n // Four-letter subtags are titlecase\n else if (parts[i].length === 4)\n parts[i] = parts[i].charAt(0).toUpperCase() + parts[i].slice(1);\n\n // Is it a singleton?\n else if (parts[i].length === 1 && parts[i] !== 'x')\n break;\n }\n locale = arrJoin.call(parts, '-');\n\n // The steps laid out in RFC 5646 section 4.5 are as follows:\n\n // 1. Extension sequences are ordered into case-insensitive ASCII order\n // by singleton subtag.\n if ((match = locale.match(expExtSequences)) && match.length > 1) {\n // The built-in sort() sorts by ASCII order, so use that\n match.sort();\n\n // Replace all extensions with the joined, sorted array\n locale = locale.replace(\n RegExp('(?:' + expExtSequences.source + ')+', 'i'),\n arrJoin.call(match, '')\n );\n }\n\n // 2. Redundant or grandfathered tags are replaced by their 'Preferred-\n // Value', if there is one.\n if (hop.call(redundantTags.tags, locale))\n locale = redundantTags.tags[locale];\n\n // 3. Subtags are replaced by their 'Preferred-Value', if there is one.\n // For extlangs, the original primary language subtag is also\n // replaced if there is a primary language subtag in the 'Preferred-\n // Value'.\n parts = locale.split('-');\n\n for (let i = 1, max = parts.length; i < max; i++) {\n if (hop.call(redundantTags.subtags, parts[i]))\n parts[i] = redundantTags.subtags[parts[i]];\n\n else if (hop.call(redundantTags.extLang, parts[i])) {\n parts[i] = redundantTags.extLang[parts[i]][0];\n\n // For extlang tags, the prefix needs to be removed if it is redundant\n if (i === 1 && redundantTags.extLang[parts[1]][1] === parts[0]) {\n parts = arrSlice.call(parts, i++);\n max -= 1;\n }\n }\n }\n\n return arrJoin.call(parts, '-');\n}\n\n/**\n * The DefaultLocale abstract operation returns a String value representing the\n * structurally valid (6.2.2) and canonicalized (6.2.3) BCP 47 language tag for the\n * host environment’s current locale.\n */\nexport function /* 6.2.4 */DefaultLocale () {\n return defaultLocale;\n}\n\n// Sect 6.3 Currency Codes\n// =======================\n\nconst expCurrencyCode = /^[A-Z]{3}$/;\n\n/**\n * The IsWellFormedCurrencyCode abstract operation verifies that the currency argument\n * (after conversion to a String value) represents a well-formed 3-letter ISO currency\n * code. The following steps are taken:\n */\nexport function /* 6.3.1 */IsWellFormedCurrencyCode(currency) {\n // 1. Let `c` be ToString(currency)\n let c = String(currency);\n\n // 2. Let `normalized` be the result of mapping c to upper case as described\n // in 6.1.\n let normalized = toLatinUpperCase(c);\n\n // 3. If the string length of normalized is not 3, return false.\n // 4. If normalized contains any character that is not in the range \"A\" to \"Z\"\n // (U+0041 to U+005A), return false.\n if (expCurrencyCode.test(normalized) === false)\n return false;\n\n // 5. Return true\n return true;\n}\n","// Sect 9.2 Abstract Operations\n// ============================\n\nimport {\n List,\n toObject,\n toLength,\n arrIndexOf,\n arrPush,\n arrSlice,\n Record,\n hop,\n defineProperty\n} from \"./util.js\";\n\nimport {\n IsStructurallyValidLanguageTag,\n CanonicalizeLanguageTag,\n DefaultLocale\n} from \"./6.locales-currencies-tz.js\";\n\nconst expUnicodeExSeq = /-u(?:-[0-9a-z]{2,8})+/gi; // See `extension` below\n\nexport function /* 9.2.1 */CanonicalizeLocaleList (locales) {\n// The abstract operation CanonicalizeLocaleList takes the following steps:\n\n // 1. If locales is undefined, then a. Return a new empty List\n if (locales === undefined)\n return new List();\n\n // 2. Let seen be a new empty List.\n let seen = new List();\n\n // 3. If locales is a String value, then\n // a. Let locales be a new array created as if by the expression new\n // Array(locales) where Array is the standard built-in constructor with\n // that name and locales is the value of locales.\n locales = typeof locales === 'string' ? [ locales ] : locales;\n\n // 4. Let O be ToObject(locales).\n let O = toObject(locales);\n\n // 5. Let lenValue be the result of calling the [[Get]] internal method of\n // O with the argument \"length\".\n // 6. Let len be ToUint32(lenValue).\n let len = toLength(O.length);\n\n // 7. Let k be 0.\n let k = 0;\n\n // 8. Repeat, while k < len\n while (k < len) {\n // a. Let Pk be ToString(k).\n let Pk = String(k);\n\n // b. Let kPresent be the result of calling the [[HasProperty]] internal\n // method of O with argument Pk.\n let kPresent = Pk in O;\n\n // c. If kPresent is true, then\n if (kPresent) {\n // i. Let kValue be the result of calling the [[Get]] internal\n // method of O with argument Pk.\n let kValue = O[Pk];\n\n // ii. If the type of kValue is not String or Object, then throw a\n // TypeError exception.\n if (kValue === null || (typeof kValue !== 'string' && typeof kValue !== 'object'))\n throw new TypeError('String or Object type expected');\n\n // iii. Let tag be ToString(kValue).\n let tag = String(kValue);\n\n // iv. If the result of calling the abstract operation\n // IsStructurallyValidLanguageTag (defined in 6.2.2), passing tag as\n // the argument, is false, then throw a RangeError exception.\n if (!IsStructurallyValidLanguageTag(tag))\n throw new RangeError(\"'\" + tag + \"' is not a structurally valid language tag\");\n\n // v. Let tag be the result of calling the abstract operation\n // CanonicalizeLanguageTag (defined in 6.2.3), passing tag as the\n // argument.\n tag = CanonicalizeLanguageTag(tag);\n\n // vi. If tag is not an element of seen, then append tag as the last\n // element of seen.\n if (arrIndexOf.call(seen, tag) === -1)\n arrPush.call(seen, tag);\n }\n\n // d. Increase k by 1.\n k++;\n }\n\n // 9. Return seen.\n return seen;\n}\n\n/**\n * The BestAvailableLocale abstract operation compares the provided argument\n * locale, which must be a String value with a structurally valid and\n * canonicalized BCP 47 language tag, against the locales in availableLocales and\n * returns either the longest non-empty prefix of locale that is an element of\n * availableLocales, or undefined if there is no such element. It uses the\n * fallback mechanism of RFC 4647, section 3.4. The following steps are taken:\n */\nexport function /* 9.2.2 */BestAvailableLocale (availableLocales, locale) {\n // 1. Let candidate be locale\n let candidate = locale;\n\n // 2. Repeat\n while (candidate) {\n // a. If availableLocales contains an element equal to candidate, then return\n // candidate.\n if (arrIndexOf.call(availableLocales, candidate) > -1)\n return candidate;\n\n // b. Let pos be the character index of the last occurrence of \"-\"\n // (U+002D) within candidate. If that character does not occur, return\n // undefined.\n let pos = candidate.lastIndexOf('-');\n\n if (pos < 0)\n return;\n\n // c. If pos ≥ 2 and the character \"-\" occurs at index pos-2 of candidate,\n // then decrease pos by 2.\n if (pos >= 2 && candidate.charAt(pos - 2) === '-')\n pos -= 2;\n\n // d. Let candidate be the substring of candidate from position 0, inclusive,\n // to position pos, exclusive.\n candidate = candidate.substring(0, pos);\n }\n}\n\n/**\n * The LookupMatcher abstract operation compares requestedLocales, which must be\n * a List as returned by CanonicalizeLocaleList, against the locales in\n * availableLocales and determines the best available language to meet the\n * request. The following steps are taken:\n */\nexport function /* 9.2.3 */LookupMatcher (availableLocales, requestedLocales) {\n // 1. Let i be 0.\n let i = 0;\n\n // 2. Let len be the number of elements in requestedLocales.\n let len = requestedLocales.length;\n\n // 3. Let availableLocale be undefined.\n let availableLocale;\n\n let locale, noExtensionsLocale;\n\n // 4. Repeat while i < len and availableLocale is undefined:\n while (i < len && !availableLocale) {\n // a. Let locale be the element of requestedLocales at 0-origined list\n // position i.\n locale = requestedLocales[i];\n\n // b. Let noExtensionsLocale be the String value that is locale with all\n // Unicode locale extension sequences removed.\n noExtensionsLocale = String(locale).replace(expUnicodeExSeq, '');\n\n // c. Let availableLocale be the result of calling the\n // BestAvailableLocale abstract operation (defined in 9.2.2) with\n // arguments availableLocales and noExtensionsLocale.\n availableLocale = BestAvailableLocale(availableLocales, noExtensionsLocale);\n\n // d. Increase i by 1.\n i++;\n }\n\n // 5. Let result be a new Record.\n let result = new Record();\n\n // 6. If availableLocale is not undefined, then\n if (availableLocale !== undefined) {\n // a. Set result.[[locale]] to availableLocale.\n result['[[locale]]'] = availableLocale;\n\n // b. If locale and noExtensionsLocale are not the same String value, then\n if (String(locale) !== String(noExtensionsLocale)) {\n // i. Let extension be the String value consisting of the first\n // substring of locale that is a Unicode locale extension sequence.\n let extension = locale.match(expUnicodeExSeq)[0];\n\n // ii. Let extensionIndex be the character position of the initial\n // \"-\" of the first Unicode locale extension sequence within locale.\n let extensionIndex = locale.indexOf('-u-');\n\n // iii. Set result.[[extension]] to extension.\n result['[[extension]]'] = extension;\n\n // iv. Set result.[[extensionIndex]] to extensionIndex.\n result['[[extensionIndex]]'] = extensionIndex;\n }\n }\n // 7. Else\n else\n // a. Set result.[[locale]] to the value returned by the DefaultLocale abstract\n // operation (defined in 6.2.4).\n result['[[locale]]'] = DefaultLocale();\n\n // 8. Return result\n return result;\n}\n\n/**\n * The BestFitMatcher abstract operation compares requestedLocales, which must be\n * a List as returned by CanonicalizeLocaleList, against the locales in\n * availableLocales and determines the best available language to meet the\n * request. The algorithm is implementation dependent, but should produce results\n * that a typical user of the requested locales would perceive as at least as\n * good as those produced by the LookupMatcher abstract operation. Options\n * specified through Unicode locale extension sequences must be ignored by the\n * algorithm. Information about such subsequences is returned separately.\n * The abstract operation returns a record with a [[locale]] field, whose value\n * is the language tag of the selected locale, which must be an element of\n * availableLocales. If the language tag of the request locale that led to the\n * selected locale contained a Unicode locale extension sequence, then the\n * returned record also contains an [[extension]] field whose value is the first\n * Unicode locale extension sequence, and an [[extensionIndex]] field whose value\n * is the index of the first Unicode locale extension sequence within the request\n * locale language tag.\n */\nexport function /* 9.2.4 */BestFitMatcher (availableLocales, requestedLocales) {\n return LookupMatcher(availableLocales, requestedLocales);\n}\n\n// @spec[tc39/ecma402/master/spec/negotiation.html]\n// @clause[sec-unicodeextensionsubtags]\nexport function UnicodeExtensionSubtags(extension) {\n // 1. Let size be the number of elements in extension.\n let size = extension.length;\n // 2. If size = 0, then\n if (size === 0) {\n // a. Return « ».\n return [];\n }\n // 3. Let extensionSubtags be « ».\n let extensionSubtags = [];\n // 4. Let attribute be true.\n let attribute = true;\n // 5. Let q be 3.\n let q = 3;\n // 6. Let p be q.\n let p = q;\n // 7. Let t be q.\n let t = q;\n // 8. Repeat, while q < size\n while (q < size) {\n // a. Let c be the code unit value of the element at index q in the String extension.\n let c = extension.codePointAt(q);\n // a. If c is 0x002D (HYPHEN-MINUS), then\n if (c === 0x002D) {\n // i. If q - p = 2, then\n if (q - p === 2) {\n // 1. If p - t > 1, then\n if (p - t > 1) {\n // a. Let type be a String value equal to the substring of extension consisting of the code units at indices t (inclusive) through p - 1 (exclusive).\n let type = extension.substring(t, p - 1);\n // a. Append type as the last element of extensionSubtags.\n extensionSubtags.push(type);\n }\n // 2. Let key be a String value equal to the substring of extension consisting of the code units at indices p (inclusive) through q (exclusive).\n let key = extension.substring(p, q);\n // 3. Append key as the last element of extensionSubtags.\n extensionSubtags.push(key);\n // 4. Let t be q + 1.\n t = q + 1;\n // 5. Let attribute be false.\n attribute = false;\n // ii. Else if attribute is true, then\n } else if (attribute === true) {\n // 1. Let attr be a String value equal to the substring of extension consisting of the code units at indices p (inclusive) through q (exclusive).\n let attr = extension.substring(p, q);\n // 2. Append attr as the last element of extensionSubtags.\n extensionSubtags.push(attr);\n // 3. Let t be q + 1.\n t = q + 1;\n }\n // iii. Let p be q + 1.\n p = q + 1;\n }\n // a. Let q be q + 1.\n q = q + 1;\n }\n // 9. If size - p = 2, then\n if (size - p === 2) {\n // a. If p - t > 1, then\n if (p - t > 1) {\n // i. Let type be a String value equal to the substring of extension consisting of the code units at indices t (inclusive) through p - 1 (exclusive).\n let type = extension.substring(t, p - 1);\n // ii. Append type as the last element of extensionSubtags.\n extensionSubtags.push(type);\n }\n // a. Let t be p.\n t = p;\n }\n // 10. Let tail be a String value equal to the substring of extension consisting of the code units at indices t (inclusive) through size (exclusive).\n let tail = extension.substring(t, size);\n // 11. Append tail as the last element of extensionSubtags.\n extensionSubtags.push(tail);\n // 12. Return extensionSubtags.\n return extensionSubtags;\n}\n\n/**\n * The ResolveLocale abstract operation compares a BCP 47 language priority list\n * requestedLocales against the locales in availableLocales and determines the\n * best available language to meet the request. availableLocales and\n * requestedLocales must be provided as List values, options as a Record.\n */\nexport function /* 9.2.5 */ResolveLocale (availableLocales, requestedLocales, options, relevantExtensionKeys, localeData) {\n if (availableLocales.length === 0) {\n throw new ReferenceError('No locale data has been provided for this object yet.');\n }\n\n // The following steps are taken:\n // 1. Let matcher be the value of options.[[localeMatcher]].\n let matcher = options['[[localeMatcher]]'];\n\n let r;\n\n // 2. If matcher is \"lookup\", then\n if (matcher === 'lookup')\n // a. Let r be the result of calling the LookupMatcher abstract operation\n // (defined in 9.2.3) with arguments availableLocales and\n // requestedLocales.\n r = LookupMatcher(availableLocales, requestedLocales);\n\n // 3. Else\n else\n // a. Let r be the result of calling the BestFitMatcher abstract\n // operation (defined in 9.2.4) with arguments availableLocales and\n // requestedLocales.\n r = BestFitMatcher(availableLocales, requestedLocales);\n\n // 4. Let foundLocale be the value of r.[[locale]].\n let foundLocale = r['[[locale]]'];\n\n let extensionSubtags, extensionSubtagsLength;\n\n // 5. If r has an [[extension]] field, then\n if (hop.call(r, '[[extension]]')) {\n // a. Let extension be the value of r.[[extension]].\n let extension = r['[[extension]]'];\n // b. Let _extensionSubtags_ be\n // CreateArrayFromList(UnicodeExtensionSubtags(_extension_)).\n extensionSubtags = UnicodeExtensionSubtags(extension);\n // c. Let _extensionSubtagsLength_ be Get(_extensionSubtags_, *\"length\"*)\n extensionSubtagsLength = extensionSubtags.length;\n }\n\n // 6. Let result be a new Record.\n let result = new Record();\n\n // 7. Set result.[[dataLocale]] to foundLocale.\n result['[[dataLocale]]'] = foundLocale;\n\n // 8. Let supportedExtension be \"-u\".\n let supportedExtension = '-u';\n // 9. Let i be 0.\n let i = 0;\n // 10. Let len be the result of calling the [[Get]] internal method of\n // relevantExtensionKeys with argument \"length\".\n let len = relevantExtensionKeys.length;\n\n // 11 Repeat while i < len:\n while (i < len) {\n // a. Let key be the result of calling the [[Get]] internal method of\n // relevantExtensionKeys with argument ToString(i).\n let key = relevantExtensionKeys[i];\n // b. Let foundLocaleData be the result of calling the [[Get]] internal\n // method of localeData with the argument foundLocale.\n let foundLocaleData = localeData[foundLocale];\n // c. Let keyLocaleData be the result of calling the [[Get]] internal\n // method of foundLocaleData with the argument key.\n let keyLocaleData = foundLocaleData[key];\n // d. Let value be the result of calling the [[Get]] internal method of\n // keyLocaleData with argument \"0\".\n let value = keyLocaleData['0'];\n // e. Let supportedExtensionAddition be \"\".\n let supportedExtensionAddition = '';\n // f. Let indexOf be the standard built-in function object defined in\n // ES5, 15.4.4.14.\n let indexOf = arrIndexOf;\n\n // g. If extensionSubtags is not undefined, then\n if (extensionSubtags !== undefined) {\n // i. Let keyPos be the result of calling the [[Call]] internal\n // method of indexOf with extensionSubtags as the this value and\n // an argument list containing the single item key.\n let keyPos = indexOf.call(extensionSubtags, key);\n\n // ii. If keyPos ≠ -1, then\n if (keyPos !== -1) {\n // 1. If keyPos + 1 < extensionSubtagsLength and the length of the\n // result of calling the [[Get]] internal method of\n // extensionSubtags with argument ToString(keyPos +1) is greater\n // than 2, then\n if (keyPos + 1 < extensionSubtagsLength\n && extensionSubtags[keyPos + 1].length > 2) {\n // a. Let requestedValue be the result of calling the [[Get]]\n // internal method of extensionSubtags with argument\n // ToString(keyPos + 1).\n let requestedValue = extensionSubtags[keyPos + 1];\n // b. Let valuePos be the result of calling the [[Call]]\n // internal method of indexOf with keyLocaleData as the\n // this value and an argument list containing the single\n // item requestedValue.\n let valuePos = indexOf.call(keyLocaleData, requestedValue);\n\n // c. If valuePos ≠ -1, then\n if (valuePos !== -1) {\n // i. Let value be requestedValue.\n value = requestedValue,\n // ii. Let supportedExtensionAddition be the\n // concatenation of \"-\", key, \"-\", and value.\n supportedExtensionAddition = '-' + key + '-' + value;\n }\n }\n // 2. Else\n else {\n // a. Let valuePos be the result of calling the [[Call]]\n // internal method of indexOf with keyLocaleData as the this\n // value and an argument list containing the single item\n // \"true\".\n let valuePos = indexOf(keyLocaleData, 'true');\n\n // b. If valuePos ≠ -1, then\n if (valuePos !== -1)\n // i. Let value be \"true\".\n value = 'true';\n }\n }\n }\n // h. If options has a field [[]], then\n if (hop.call(options, '[[' + key + ']]')) {\n // i. Let optionsValue be the value of options.[[]].\n let optionsValue = options['[[' + key + ']]'];\n\n // ii. If the result of calling the [[Call]] internal method of indexOf\n // with keyLocaleData as the this value and an argument list\n // containing the single item optionsValue is not -1, then\n if (indexOf.call(keyLocaleData, optionsValue) !== -1) {\n // 1. If optionsValue is not equal to value, then\n if (optionsValue !== value) {\n // a. Let value be optionsValue.\n value = optionsValue;\n // b. Let supportedExtensionAddition be \"\".\n supportedExtensionAddition = '';\n }\n }\n }\n // i. Set result.[[]] to value.\n result['[[' + key + ']]'] = value;\n\n // j. Append supportedExtensionAddition to supportedExtension.\n supportedExtension += supportedExtensionAddition;\n\n // k. Increase i by 1.\n i++;\n }\n // 12. If the length of supportedExtension is greater than 2, then\n if (supportedExtension.length > 2) {\n // a.\n let privateIndex = foundLocale.indexOf(\"-x-\");\n // b.\n if (privateIndex === -1) {\n // i.\n foundLocale = foundLocale + supportedExtension;\n }\n // c.\n else {\n // i.\n let preExtension = foundLocale.substring(0, privateIndex);\n // ii.\n let postExtension = foundLocale.substring(privateIndex);\n // iii.\n foundLocale = preExtension + supportedExtension + postExtension;\n }\n // d. asserting - skipping\n // e.\n foundLocale = CanonicalizeLanguageTag(foundLocale);\n }\n // 13. Set result.[[locale]] to foundLocale.\n result['[[locale]]'] = foundLocale;\n\n // 14. Return result.\n return result;\n}\n\n/**\n * The LookupSupportedLocales abstract operation returns the subset of the\n * provided BCP 47 language priority list requestedLocales for which\n * availableLocales has a matching locale when using the BCP 47 Lookup algorithm.\n * Locales appear in the same order in the returned list as in requestedLocales.\n * The following steps are taken:\n */\nexport function /* 9.2.6 */LookupSupportedLocales (availableLocales, requestedLocales) {\n // 1. Let len be the number of elements in requestedLocales.\n let len = requestedLocales.length;\n // 2. Let subset be a new empty List.\n let subset = new List();\n // 3. Let k be 0.\n let k = 0;\n\n // 4. Repeat while k < len\n while (k < len) {\n // a. Let locale be the element of requestedLocales at 0-origined list\n // position k.\n let locale = requestedLocales[k];\n // b. Let noExtensionsLocale be the String value that is locale with all\n // Unicode locale extension sequences removed.\n let noExtensionsLocale = String(locale).replace(expUnicodeExSeq, '');\n // c. Let availableLocale be the result of calling the\n // BestAvailableLocale abstract operation (defined in 9.2.2) with\n // arguments availableLocales and noExtensionsLocale.\n let availableLocale = BestAvailableLocale(availableLocales, noExtensionsLocale);\n\n // d. If availableLocale is not undefined, then append locale to the end of\n // subset.\n if (availableLocale !== undefined)\n arrPush.call(subset, locale);\n\n // e. Increment k by 1.\n k++;\n }\n\n // 5. Let subsetArray be a new Array object whose elements are the same\n // values in the same order as the elements of subset.\n let subsetArray = arrSlice.call(subset);\n\n // 6. Return subsetArray.\n return subsetArray;\n}\n\n/**\n * The BestFitSupportedLocales abstract operation returns the subset of the\n * provided BCP 47 language priority list requestedLocales for which\n * availableLocales has a matching locale when using the Best Fit Matcher\n * algorithm. Locales appear in the same order in the returned list as in\n * requestedLocales. The steps taken are implementation dependent.\n */\nexport function /*9.2.7 */BestFitSupportedLocales (availableLocales, requestedLocales) {\n // ###TODO: implement this function as described by the specification###\n return LookupSupportedLocales(availableLocales, requestedLocales);\n}\n\n/**\n * The SupportedLocales abstract operation returns the subset of the provided BCP\n * 47 language priority list requestedLocales for which availableLocales has a\n * matching locale. Two algorithms are available to match the locales: the Lookup\n * algorithm described in RFC 4647 section 3.4, and an implementation dependent\n * best-fit algorithm. Locales appear in the same order in the returned list as\n * in requestedLocales. The following steps are taken:\n */\nexport function /*9.2.8 */SupportedLocales (availableLocales, requestedLocales, options) {\n let matcher, subset;\n\n // 1. If options is not undefined, then\n if (options !== undefined) {\n // a. Let options be ToObject(options).\n options = new Record(toObject(options));\n // b. Let matcher be the result of calling the [[Get]] internal method of\n // options with argument \"localeMatcher\".\n matcher = options.localeMatcher;\n\n // c. If matcher is not undefined, then\n if (matcher !== undefined) {\n // i. Let matcher be ToString(matcher).\n matcher = String(matcher);\n\n // ii. If matcher is not \"lookup\" or \"best fit\", then throw a RangeError\n // exception.\n if (matcher !== 'lookup' && matcher !== 'best fit')\n throw new RangeError('matcher should be \"lookup\" or \"best fit\"');\n }\n }\n // 2. If matcher is undefined or \"best fit\", then\n if (matcher === undefined || matcher === 'best fit')\n // a. Let subset be the result of calling the BestFitSupportedLocales\n // abstract operation (defined in 9.2.7) with arguments\n // availableLocales and requestedLocales.\n subset = BestFitSupportedLocales(availableLocales, requestedLocales);\n // 3. Else\n else\n // a. Let subset be the result of calling the LookupSupportedLocales\n // abstract operation (defined in 9.2.6) with arguments\n // availableLocales and requestedLocales.\n subset = LookupSupportedLocales(availableLocales, requestedLocales);\n\n // 4. For each named own property name P of subset,\n for (let P in subset) {\n if (!hop.call(subset, P))\n continue;\n\n // a. Let desc be the result of calling the [[GetOwnProperty]] internal\n // method of subset with P.\n // b. Set desc.[[Writable]] to false.\n // c. Set desc.[[Configurable]] to false.\n // d. Call the [[DefineOwnProperty]] internal method of subset with P, desc,\n // and true as arguments.\n defineProperty(subset, P, {\n writable: false, configurable: false, value: subset[P]\n });\n }\n \n // Wrap in try catch for older browsers that don't support setting length of\n // array such as FF 22 and below.\n try {\n // \"Freeze\" the array so no new elements can be added\n defineProperty(subset, 'length', { writable: false });\n } catch (e) {}\n\n // 5. Return subset\n return subset;\n}\n\n/**\n * The GetOption abstract operation extracts the value of the property named\n * property from the provided options object, converts it to the required type,\n * checks whether it is one of a List of allowed values, and fills in a fallback\n * value if necessary.\n */\nexport function /*9.2.9 */GetOption (options, property, type, values, fallback) {\n // 1. Let value be the result of calling the [[Get]] internal method of\n // options with argument property.\n let value = options[property];\n\n // 2. If value is not undefined, then\n if (value !== undefined) {\n // a. Assert: type is \"boolean\" or \"string\".\n // b. If type is \"boolean\", then let value be ToBoolean(value).\n // c. If type is \"string\", then let value be ToString(value).\n value = type === 'boolean' ? Boolean(value)\n : (type === 'string' ? String(value) : value);\n\n // d. If values is not undefined, then\n if (values !== undefined) {\n // i. If values does not contain an element equal to value, then throw a\n // RangeError exception.\n if (arrIndexOf.call(values, value) === -1)\n throw new RangeError(\"'\" + value + \"' is not an allowed value for `\" + property +'`');\n }\n\n // e. Return value.\n return value;\n }\n // Else return fallback.\n return fallback;\n}\n\n/**\n * The GetNumberOption abstract operation extracts a property value from the\n * provided options object, converts it to a Number value, checks whether it is\n * in the allowed range, and fills in a fallback value if necessary.\n */\nexport function /* 9.2.10 */GetNumberOption (options, property, minimum, maximum, fallback) {\n // 1. Let value be the result of calling the [[Get]] internal method of\n // options with argument property.\n let value = options[property];\n\n // 2. If value is not undefined, then\n if (value !== undefined) {\n // a. Let value be ToNumber(value).\n value = Number(value);\n\n // b. If value is NaN or less than minimum or greater than maximum, throw a\n // RangeError exception.\n if (isNaN(value) || value < minimum || value > maximum)\n throw new RangeError('Value is not a number or outside accepted range');\n\n // c. Return floor(value).\n return Math.floor(value);\n }\n // 3. Else return fallback.\n return fallback;\n}\n","import {\n CanonicalizeLocaleList\n} from \"./9.negotiation.js\";\n\n// 8 The Intl Object\nexport const Intl = {};\n\n// 8.2 Function Properties of the Intl Object\n\n// 8.2.1\n// @spec[tc39/ecma402/master/spec/intl.html]\n// @clause[sec-intl.getcanonicallocales]\nfunction getCanonicalLocales (locales) {\n // 1. Let ll be ? CanonicalizeLocaleList(locales).\n let ll = CanonicalizeLocaleList(locales);\n // 2. Return CreateArrayFromList(ll).\n {\n let result = [];\n\n let len = ll.length;\n let k = 0;\n\n while (k < len) {\n result[k] = ll[k];\n k++;\n }\n return result;\n }\n}\n\nObject.defineProperty(Intl, 'getCanonicalLocales', {\n enumerable: false,\n configurable: true,\n writable: true,\n value: getCanonicalLocales\n});\n","// 11.1 The Intl.NumberFormat constructor\n// ======================================\n\nimport {\n IsWellFormedCurrencyCode\n} from \"./6.locales-currencies-tz.js\";\n\nimport {\n Intl\n} from \"./8.intl.js\";\n\nimport {\n CanonicalizeLocaleList,\n SupportedLocales,\n ResolveLocale,\n GetNumberOption,\n GetOption\n} from \"./9.negotiation.js\";\n\nimport {\n internals,\n log10Floor,\n List,\n toObject,\n arrPush,\n arrJoin,\n arrShift,\n Record,\n hop,\n defineProperty,\n es3,\n fnBind,\n getInternalProperties,\n createRegExpRestore,\n secret,\n objCreate\n} from \"./util.js\";\n\n// Currency minor units output from get-4217 grunt task, formatted\nconst currencyMinorUnits = {\n BHD: 3, BYR: 0, XOF: 0, BIF: 0, XAF: 0, CLF: 4, CLP: 0, KMF: 0, DJF: 0,\n XPF: 0, GNF: 0, ISK: 0, IQD: 3, JPY: 0, JOD: 3, KRW: 0, KWD: 3, LYD: 3,\n OMR: 3, PYG: 0, RWF: 0, TND: 3, UGX: 0, UYI: 0, VUV: 0, VND: 0\n};\n\n// Define the NumberFormat constructor internally so it cannot be tainted\nexport function NumberFormatConstructor () {\n let locales = arguments[0];\n let options = arguments[1];\n\n if (!this || this === Intl) {\n return new Intl.NumberFormat(locales, options);\n }\n\n return InitializeNumberFormat(toObject(this), locales, options);\n}\n\ndefineProperty(Intl, 'NumberFormat', {\n configurable: true,\n writable: true,\n value: NumberFormatConstructor\n});\n\n// Must explicitly set prototypes as unwritable\ndefineProperty(Intl.NumberFormat, 'prototype', {\n writable: false\n});\n\n/*\n * @spec[tc39/ecma402/master/spec/numberformat.html]\n * @clause[sec-setnumberformatdigitoptions]\n */\nexport function /*11.1.1 */SetNumberFormatDigitOptions (intlObj, options, mnfdDefault) {\n // 1. Assert: Type(intlObj) is Object and intlObj.[[initializedIntlObject]] is true.\n\n // 2. Assert: Type(options) is Object.\n\n // 3. Assert: type(mnfdDefault) is Number.\n\n // 4. Let mnid be ? GetNumberOption(options, \"minimumIntegerDigits,\", 1, 21, 1).\n let mnid = GetNumberOption(options, 'minimumIntegerDigits', 1, 21, 1);\n\n // 5. Let mnfd be ? GetNumberOption(options, \"minimumFractionDigits\", 0, 20, mnfdDefault).\n let mnfd = GetNumberOption(options, 'minimumFractionDigits', 0, 20, mnfdDefault);\n\n // 6. Let mxfd be ? GetNumberOption(options, \"maximumFractionDigits\", mnfd, 20).\n let mxfd = GetNumberOption(options, 'maximumFractionDigits', mnfd, 20);\n\n // 7. Let mnsd be ? Get(options, \"minimumSignificantDigits\").\n let mnsd = options.minimumSignificantDigits;\n\n // 8. Let mxsd be ? Get(options, \"maximumSignificantDigits\").\n let mxsd = options.maximumSignificantDigits;\n\n // 9. Set intlObj.[[minimumIntegerDigits]] to mnid.\n intlObj['[[minimumIntegerDigits]]'] = mnid;\n\n // 10. Set intlObj.[[minimumFractionDigits]] to mnfd.\n intlObj['[[minimumFractionDigits]]'] = mnfd;\n\n // 11. Set intlObj.[[maximumFractionDigits]] to mxfd.\n intlObj['[[maximumFractionDigits]]'] = mxfd;\n\n // 12. If mnsd is not undefined or mxsd is not undefined, then\n if (mnsd !== undefined || mxsd !== undefined) {\n // a. Let mnsd be ? GetNumberOption(options, \"minimumSignificantDigits\", 1, 21, 1).\n mnsd = GetNumberOption(options, \"minimumSignificantDigits\", 1, 21, 1);\n\n // b. Let mxsd be ? GetNumberOption(options, \"maximumSignificantDigits\", mnsd, 21, 21).\n mxsd = GetNumberOption(options, \"maximumSignificantDigits\", mnsd, 21, 21);\n\n // c. Set intlObj.[[minimumSignificantDigits]] to mnsd.\n intlObj['[[minimumSignificantDigits]]'] = mnsd;\n\n // d. Set intlObj.[[maximumSignificantDigits]] to mxsd.\n intlObj['[[maximumSignificantDigits]]'] = mxsd;\n }\n\n}\n\n/**\n * The abstract operation InitializeNumberFormat accepts the arguments\n * numberFormat (which must be an object), locales, and options. It initializes\n * numberFormat as a NumberFormat object.\n */\nexport function /*11.1.2 */InitializeNumberFormat (numberFormat, locales, options) {\n // This will be a internal properties object if we're not already initialized\n let internal = getInternalProperties(numberFormat);\n\n // Create an object whose props can be used to restore the values of RegExp props\n let regexpRestore = createRegExpRestore();\n\n // 1. If numberFormat has an [[initializedIntlObject]] internal property with\n // value true, throw a TypeError exception.\n if (internal['[[initializedIntlObject]]'] === true)\n throw new TypeError('`this` object has already been initialized as an Intl object');\n\n // Need this to access the `internal` object\n defineProperty(numberFormat, '__getInternalProperties', {\n value: function () {\n // NOTE: Non-standard, for internal use only\n if (arguments[0] === secret)\n return internal;\n }\n });\n\n // 2. Set the [[initializedIntlObject]] internal property of numberFormat to true.\n internal['[[initializedIntlObject]]'] = true;\n\n // 3. Let requestedLocales be the result of calling the CanonicalizeLocaleList\n // abstract operation (defined in 9.2.1) with argument locales.\n let requestedLocales = CanonicalizeLocaleList(locales);\n\n // 4. If options is undefined, then\n if (options === undefined)\n // a. Let options be the result of creating a new object as if by the\n // expression new Object() where Object is the standard built-in constructor\n // with that name.\n options = {};\n\n // 5. Else\n else\n // a. Let options be ToObject(options).\n options = toObject(options);\n\n // 6. Let opt be a new Record.\n let opt = new Record(),\n\n // 7. Let matcher be the result of calling the GetOption abstract operation\n // (defined in 9.2.9) with the arguments options, \"localeMatcher\", \"string\",\n // a List containing the two String values \"lookup\" and \"best fit\", and\n // \"best fit\".\n matcher = GetOption(options, 'localeMatcher', 'string', new List('lookup', 'best fit'), 'best fit');\n\n // 8. Set opt.[[localeMatcher]] to matcher.\n opt['[[localeMatcher]]'] = matcher;\n\n // 9. Let localeData be the value of the [[localeData]] internal property of\n // NumberFormat.\n let localeData = internals.NumberFormat['[[localeData]]'];\n\n // 10. Let r be the result of calling the ResolveLocale abstract operation\n // (defined in 9.2.5) with the [[availableLocales]] internal property of\n // NumberFormat, requestedLocales, opt, the [[relevantExtensionKeys]]\n // internal property of NumberFormat, and localeData.\n let r = ResolveLocale(\n internals.NumberFormat['[[availableLocales]]'], requestedLocales,\n opt, internals.NumberFormat['[[relevantExtensionKeys]]'], localeData\n );\n\n // 11. Set the [[locale]] internal property of numberFormat to the value of\n // r.[[locale]].\n internal['[[locale]]'] = r['[[locale]]'];\n\n // 12. Set the [[numberingSystem]] internal property of numberFormat to the value\n // of r.[[nu]].\n internal['[[numberingSystem]]'] = r['[[nu]]'];\n\n // The specification doesn't tell us to do this, but it's helpful later on\n internal['[[dataLocale]]'] = r['[[dataLocale]]'];\n\n // 13. Let dataLocale be the value of r.[[dataLocale]].\n let dataLocale = r['[[dataLocale]]'];\n\n // 14. Let s be the result of calling the GetOption abstract operation with the\n // arguments options, \"style\", \"string\", a List containing the three String\n // values \"decimal\", \"percent\", and \"currency\", and \"decimal\".\n let s = GetOption(options, 'style', 'string', new List('decimal', 'percent', 'currency'), 'decimal');\n\n // 15. Set the [[style]] internal property of numberFormat to s.\n internal['[[style]]'] = s;\n\n // 16. Let c be the result of calling the GetOption abstract operation with the\n // arguments options, \"currency\", \"string\", undefined, and undefined.\n let c = GetOption(options, 'currency', 'string');\n\n // 17. If c is not undefined and the result of calling the\n // IsWellFormedCurrencyCode abstract operation (defined in 6.3.1) with\n // argument c is false, then throw a RangeError exception.\n if (c !== undefined && !IsWellFormedCurrencyCode(c))\n throw new RangeError(\"'\" + c + \"' is not a valid currency code\");\n\n // 18. If s is \"currency\" and c is undefined, throw a TypeError exception.\n if (s === 'currency' && c === undefined)\n throw new TypeError('Currency code is required when style is currency');\n\n let cDigits;\n\n // 19. If s is \"currency\", then\n if (s === 'currency') {\n // a. Let c be the result of converting c to upper case as specified in 6.1.\n c = c.toUpperCase();\n\n // b. Set the [[currency]] internal property of numberFormat to c.\n internal['[[currency]]'] = c;\n\n // c. Let cDigits be the result of calling the CurrencyDigits abstract\n // operation (defined below) with argument c.\n cDigits = CurrencyDigits(c);\n }\n\n // 20. Let cd be the result of calling the GetOption abstract operation with the\n // arguments options, \"currencyDisplay\", \"string\", a List containing the\n // three String values \"code\", \"symbol\", and \"name\", and \"symbol\".\n let cd = GetOption(options, 'currencyDisplay', 'string', new List('code', 'symbol', 'name'), 'symbol');\n\n // 21. If s is \"currency\", then set the [[currencyDisplay]] internal property of\n // numberFormat to cd.\n if (s === 'currency')\n internal['[[currencyDisplay]]'] = cd;\n\n // 22. If s is \"currency\", then\n // a. Let mnfdDefault be cDigits.\n // 23. Else,\n // a. Let mnfdDefault be 0.\n let mnfdDefault = s === \"currency\" ? cDigits : 0;\n\n // 24. Perform ? SetNumberFormatDigitOptions(numberFormat, options, mnfdDefault).\n SetNumberFormatDigitOptions(internal, options, mnfdDefault);\n\n // 25. If numberFormat.[[maximumFractionDigits]] is undefined, then\n if (internal['[[maximumFractionDigits]]'] === undefined) {\n // a. If s is \"currency\", then\n if (s === 'currency') {\n // i. Set numberFormat.[[maximumFractionDigits]] to max(numberFormat.[[minimumFractionDigits]], cDigits).\n internal['[[maximumFractionDigits]]'] = Math.max(internal['[[minimumFractionDigits]]'], cDigits);\n // b. Else if s is \"percent\", then\n } else if (s === 'percent') {\n // i. Set numberFormat.[[maximumFractionDigits]] to max(numberFormat.[[minimumFractionDigits]], 0).\n internal['[[maximumFractionDigits]]'] = Math.max(internal['[[minimumFractionDigits]]'], 0);\n // c. Else,\n } else {\n // i. Set numberFormat.[[maximumFractionDigits]] to max(numberFormat.[[minimumFractionDigits]], 3).\n internal['[[maximumFractionDigits]]'] = Math.max(internal['[[minimumFractionDigits]]'], 3);\n }\n }\n\n // 26. Let g be the result of calling the GetOption abstract operation with the\n // arguments options, \"useGrouping\", \"boolean\", undefined, and true.\n let g = GetOption(options, 'useGrouping', 'boolean', undefined, true);\n\n // 27. Set the [[useGrouping]] internal property of numberFormat to g.\n internal['[[useGrouping]]'] = g;\n\n // 28. Let dataLocaleData be the result of calling the [[Get]] internal method of\n // localeData with argument dataLocale.\n let dataLocaleData = localeData[dataLocale];\n\n // 29. Let patterns be the result of calling the [[Get]] internal method of\n // dataLocaleData with argument \"patterns\".\n let patterns = dataLocaleData.patterns;\n\n // 30. Assert: patterns is an object (see 11.2.3)\n\n // 31. Let stylePatterns be the result of calling the [[Get]] internal method of\n // patterns with argument s.\n let stylePatterns = patterns[s];\n\n // 32. Set the [[positivePattern]] internal property of numberFormat to the\n // result of calling the [[Get]] internal method of stylePatterns with the\n // argument \"positivePattern\".\n internal['[[positivePattern]]'] = stylePatterns.positivePattern;\n\n // 33. Set the [[negativePattern]] internal property of numberFormat to the\n // result of calling the [[Get]] internal method of stylePatterns with the\n // argument \"negativePattern\".\n internal['[[negativePattern]]'] = stylePatterns.negativePattern;\n\n // 34. Set the [[boundFormat]] internal property of numberFormat to undefined.\n internal['[[boundFormat]]'] = undefined;\n\n // 35. Set the [[initializedNumberFormat]] internal property of numberFormat to\n // true.\n internal['[[initializedNumberFormat]]'] = true;\n\n // In ES3, we need to pre-bind the format() function\n if (es3)\n numberFormat.format = GetFormatNumber.call(numberFormat);\n\n // Restore the RegExp properties\n regexpRestore();\n\n // 36. Return the newly initialised object\n return numberFormat;\n}\n\nfunction CurrencyDigits(currency) {\n // When the CurrencyDigits abstract operation is called with an argument currency\n // (which must be an upper case String value), the following steps are taken:\n\n // 1. If the ISO 4217 currency and funds code list contains currency as an\n // alphabetic code, then return the minor unit value corresponding to the\n // currency from the list; else return 2.\n return currencyMinorUnits[currency] !== undefined\n ? currencyMinorUnits[currency]\n : 2;\n}\n\n/* 11.2.3 */internals.NumberFormat = {\n '[[availableLocales]]': [],\n '[[relevantExtensionKeys]]': ['nu'],\n '[[localeData]]': {}\n};\n\n/**\n * When the supportedLocalesOf method of Intl.NumberFormat is called, the\n * following steps are taken:\n */\n/* 11.2.2 */\ndefineProperty(Intl.NumberFormat, 'supportedLocalesOf', {\n configurable: true,\n writable: true,\n value: fnBind.call(function (locales) {\n // Bound functions only have the `this` value altered if being used as a constructor,\n // this lets us imitate a native function that has no constructor\n if (!hop.call(this, '[[availableLocales]]'))\n throw new TypeError('supportedLocalesOf() is not a constructor');\n\n // Create an object whose props can be used to restore the values of RegExp props\n let regexpRestore = createRegExpRestore(),\n\n // 1. If options is not provided, then let options be undefined.\n options = arguments[1],\n\n // 2. Let availableLocales be the value of the [[availableLocales]] internal\n // property of the standard built-in object that is the initial value of\n // Intl.NumberFormat.\n\n availableLocales = this['[[availableLocales]]'],\n\n // 3. Let requestedLocales be the result of calling the CanonicalizeLocaleList\n // abstract operation (defined in 9.2.1) with argument locales.\n requestedLocales = CanonicalizeLocaleList(locales);\n\n // Restore the RegExp properties\n regexpRestore();\n\n // 4. Return the result of calling the SupportedLocales abstract operation\n // (defined in 9.2.8) with arguments availableLocales, requestedLocales,\n // and options.\n return SupportedLocales(availableLocales, requestedLocales, options);\n }, internals.NumberFormat)\n});\n\n/**\n * This named accessor property returns a function that formats a number\n * according to the effective locale and the formatting options of this\n * NumberFormat object.\n */\n/* 11.3.2 */defineProperty(Intl.NumberFormat.prototype, 'format', {\n configurable: true,\n get: GetFormatNumber\n});\n\nfunction GetFormatNumber() {\n let internal = this !== null && typeof this === 'object' && getInternalProperties(this);\n\n // Satisfy test 11.3_b\n if (!internal || !internal['[[initializedNumberFormat]]'])\n throw new TypeError('`this` value for format() is not an initialized Intl.NumberFormat object.');\n\n // The value of the [[Get]] attribute is a function that takes the following\n // steps:\n\n // 1. If the [[boundFormat]] internal property of this NumberFormat object\n // is undefined, then:\n if (internal['[[boundFormat]]'] === undefined) {\n // a. Let F be a Function object, with internal properties set as\n // specified for built-in functions in ES5, 15, or successor, and the\n // length property set to 1, that takes the argument value and\n // performs the following steps:\n let F = function (value) {\n // i. If value is not provided, then let value be undefined.\n // ii. Let x be ToNumber(value).\n // iii. Return the result of calling the FormatNumber abstract\n // operation (defined below) with arguments this and x.\n return FormatNumber(this, /* x = */Number(value));\n };\n\n // b. Let bind be the standard built-in function object defined in ES5,\n // 15.3.4.5.\n // c. Let bf be the result of calling the [[Call]] internal method of\n // bind with F as the this value and an argument list containing\n // the single item this.\n let bf = fnBind.call(F, this);\n\n // d. Set the [[boundFormat]] internal property of this NumberFormat\n // object to bf.\n internal['[[boundFormat]]'] = bf;\n }\n // Return the value of the [[boundFormat]] internal property of this\n // NumberFormat object.\n return internal['[[boundFormat]]'];\n }\n\nfunction formatToParts(value = undefined) {\n let internal = this !== null && typeof this === 'object' && getInternalProperties(this);\n if (!internal || !internal['[[initializedNumberFormat]]'])\n throw new TypeError('`this` value for formatToParts() is not an initialized Intl.NumberFormat object.');\n\n let x = Number(value);\n return FormatNumberToParts(this, x);\n}\n\nObject.defineProperty(Intl.NumberFormat.prototype, 'formatToParts', {\n configurable: true,\n enumerable: false,\n writable: true,\n value: formatToParts\n});\n\n/*\n * @spec[tc39/ecma402/master/spec/numberformat.html]\n * @clause[sec-formatnumbertoparts]\n */\nfunction FormatNumberToParts(numberFormat, x) {\n // 1. Let parts be ? PartitionNumberPattern(numberFormat, x).\n let parts = PartitionNumberPattern(numberFormat, x);\n // 2. Let result be ArrayCreate(0).\n let result = [];\n // 3. Let n be 0.\n let n = 0;\n // 4. For each part in parts, do:\n for (let i = 0; parts.length > i; i++) {\n let part = parts[i];\n // a. Let O be ObjectCreate(%ObjectPrototype%).\n let O = {};\n // a. Perform ? CreateDataPropertyOrThrow(O, \"type\", part.[[type]]).\n O.type = part['[[type]]'];\n // a. Perform ? CreateDataPropertyOrThrow(O, \"value\", part.[[value]]).\n O.value = part['[[value]]'];\n // a. Perform ? CreateDataPropertyOrThrow(result, ? ToString(n), O).\n result[n] = O;\n // a. Increment n by 1.\n n += 1;\n }\n // 5. Return result.\n return result;\n}\n\n/*\n * @spec[tc39/ecma402/master/spec/numberformat.html]\n * @clause[sec-formatnumberstring]\n */\nexport function FormatNumberToString(numberFormat, x) {\n let internal = getInternalProperties(numberFormat);\n let result;\n\n // 1. Assert: numberFormat.[[initializedIntlObject]] is true.\n\n // 2. If the numberFormat.[[minimumSignificantDigits]] and numberFormat.[[maximumSignificantDigits]] are present, then\n if (hop.call(internal, '[[minimumSignificantDigits]]') &&\n hop.call(internal, '[[maximumSignificantDigits]]')) {\n // a. Let result be ToRawPrecision(x, numberFormat.[[minimumSignificantDigits]], numberFormat.[[maximumSignificantDigits]]).\n result = ToRawPrecision(x,\n internal['[[minimumSignificantDigits]]'],\n internal['[[maximumSignificantDigits]]']);\n }\n // 3. Else,\n else {\n // a. Let result be ToRawFixed(x, numberFormat.[[minimumIntegerDigits]], numberFormat.[[minimumFractionDigits]], numberFormat.[[maximumFractionDigits]]).\n result = ToRawFixed(x,\n internal['[[minimumIntegerDigits]]'],\n internal['[[minimumFractionDigits]]'],\n internal['[[maximumFractionDigits]]']);\n }\n // 4. Return result.\n return result;\n}\n\n/*\n * @spec[tc39/ecma402/master/spec/numberformat.html]\n * @clause[sec-partitionnumberpattern]\n */\nfunction PartitionNumberPattern(numberFormat, x) {\n\n let internal = getInternalProperties(numberFormat),\n locale = internal['[[dataLocale]]'],\n nums = internal['[[numberingSystem]]'],\n data = internals.NumberFormat['[[localeData]]'][locale],\n ild = data.symbols[nums] || data.symbols.latn,\n pattern;\n\n // 1. If x is not NaN and x < 0, then:\n if (!isNaN(x) && x < 0) {\n // a. Let x be -x.\n x = -x;\n // b. Let pattern be the value of numberFormat.[[negativePattern]].\n pattern = internal['[[negativePattern]]'];\n }\n // 2. Else,\n else {\n // a. Let pattern be the value of numberFormat.[[positivePattern]].\n pattern = internal['[[positivePattern]]'];\n }\n // 3. Let result be a new empty List.\n let result = new List();\n // 4. Let beginIndex be Call(%StringProto_indexOf%, pattern, \"{\", 0).\n let beginIndex = pattern.indexOf('{', 0);\n // 5. Let endIndex be 0.\n let endIndex = 0;\n // 6. Let nextIndex be 0.\n let nextIndex = 0;\n // 7. Let length be the number of code units in pattern.\n let length = pattern.length;\n // 8. Repeat while beginIndex is an integer index into pattern:\n while (beginIndex > -1 && beginIndex < length) {\n // a. Set endIndex to Call(%StringProto_indexOf%, pattern, \"}\", beginIndex)\n endIndex = pattern.indexOf('}', beginIndex);\n // b. If endIndex = -1, throw new Error exception.\n if (endIndex === -1) throw new Error();\n // c. If beginIndex is greater than nextIndex, then:\n if (beginIndex > nextIndex) {\n // i. Let literal be a substring of pattern from position nextIndex, inclusive, to position beginIndex, exclusive.\n let literal = pattern.substring(nextIndex, beginIndex);\n // ii. Add new part record { [[type]]: \"literal\", [[value]]: literal } as a new element of the list result.\n arrPush.call(result, { '[[type]]': 'literal', '[[value]]': literal });\n }\n // d. Let p be the substring of pattern from position beginIndex, exclusive, to position endIndex, exclusive.\n let p = pattern.substring(beginIndex + 1, endIndex);\n // e. If p is equal \"number\", then:\n if (p === \"number\") {\n // i. If x is NaN,\n if (isNaN(x)) {\n // 1. Let n be an ILD String value indicating the NaN value.\n let n = ild.nan;\n // 2. Add new part record { [[type]]: \"nan\", [[value]]: n } as a new element of the list result.\n arrPush.call(result, { '[[type]]': 'nan', '[[value]]': n });\n }\n // ii. Else if isFinite(x) is false,\n else if (!isFinite(x)) {\n // 1. Let n be an ILD String value indicating infinity.\n let n = ild.infinity;\n // 2. Add new part record { [[type]]: \"infinity\", [[value]]: n } as a new element of the list result.\n arrPush.call(result, { '[[type]]': 'infinity', '[[value]]': n });\n }\n // iii. Else,\n else {\n // 1. If numberFormat.[[style]] is \"percent\", let x be 100 × x.\n if (internal['[[style]]'] === 'percent') x *= 100;\n\n // 2. Let n be FormatNumberToString(numberFormat, x).\n let n = FormatNumberToString(numberFormat, x);\n\n // 3. If the numberFormat.[[numberingSystem]] matches one of the values in the \"Numbering System\" column of Table 3 below, then\n if (numSys[nums]) {\n // a. Let digits be an array whose 10 String valued elements are the UTF-16 string representations of the 10 digits specified in the \"Digits\" column of the matching row in Table 2.\n let digits = numSys[nums];\n // a. Replace each digit in n with the value of digits[digit].\n n = String(n).replace(/\\d/g, (digit) => {\n return digits[digit];\n });\n }\n // 4. Else use an implementation dependent algorithm to map n to the appropriate representation of n in the given numbering system.\n else n = String(n); // ###TODO###\n\n let integer;\n let fraction;\n // 5. Let decimalSepIndex be Call(%StringProto_indexOf%, n, \".\", 0).\n let decimalSepIndex = n.indexOf('.', 0);\n // 6. If decimalSepIndex > 0, then:\n if (decimalSepIndex > 0) {\n // a. Let integer be the substring of n from position 0, inclusive, to position decimalSepIndex, exclusive.\n integer = n.substring(0, decimalSepIndex);\n // b. Let fraction be the substring of n from position decimalSepIndex, exclusive, to the end of n.\n fraction = n.substring(decimalSepIndex + 1, decimalSepIndex.length);\n }\n // 7. Else:\n else {\n // a. Let integer be n.\n integer = n;\n // b. Let fraction be undefined.\n fraction = undefined;\n }\n // 8. If the value of the numberFormat.[[useGrouping]] is true,\n if (internal['[[useGrouping]]'] === true) {\n // a. Let groupSepSymbol be the ILND String representing the grouping separator.\n let groupSepSymbol = ild.group;\n // b. Let groups be a List whose elements are, in left to right order, the substrings defined by ILND set of locations within the integer.\n let groups = [];\n // ----> implementation:\n // Primary group represents the group closest to the decimal\n let pgSize = data.patterns.primaryGroupSize || 3;\n // Secondary group is every other group\n let sgSize = data.patterns.secondaryGroupSize || pgSize;\n // Group only if necessary\n if (integer.length > pgSize) {\n // Index of the primary grouping separator\n let end = integer.length - pgSize;\n // Starting index for our loop\n let idx = end % sgSize;\n let start = integer.slice(0, idx);\n if (start.length) arrPush.call(groups, start);\n // Loop to separate into secondary grouping digits\n while (idx < end) {\n arrPush.call(groups, integer.slice(idx, idx + sgSize));\n idx += sgSize;\n }\n // Add the primary grouping digits\n arrPush.call(groups, integer.slice(end));\n } else {\n arrPush.call(groups, integer);\n }\n // c. Assert: The number of elements in groups List is greater than 0.\n if (groups.length === 0) throw new Error();\n // d. Repeat, while groups List is not empty:\n while (groups.length) {\n // i. Remove the first element from groups and let integerGroup be the value of that element.\n let integerGroup = arrShift.call(groups);\n // ii. Add new part record { [[type]]: \"integer\", [[value]]: integerGroup } as a new element of the list result.\n arrPush.call(result, { '[[type]]': 'integer', '[[value]]': integerGroup });\n // iii. If groups List is not empty, then:\n if (groups.length) {\n // 1. Add new part record { [[type]]: \"group\", [[value]]: groupSepSymbol } as a new element of the list result.\n arrPush.call(result, { '[[type]]': 'group', '[[value]]': groupSepSymbol });\n }\n }\n }\n // 9. Else,\n else {\n // a. Add new part record { [[type]]: \"integer\", [[value]]: integer } as a new element of the list result.\n arrPush.call(result, { '[[type]]': 'integer', '[[value]]': integer });\n }\n // 10. If fraction is not undefined, then:\n if (fraction !== undefined) {\n // a. Let decimalSepSymbol be the ILND String representing the decimal separator.\n let decimalSepSymbol = ild.decimal;\n // b. Add new part record { [[type]]: \"decimal\", [[value]]: decimalSepSymbol } as a new element of the list result.\n arrPush.call(result, { '[[type]]': 'decimal', '[[value]]': decimalSepSymbol });\n // c. Add new part record { [[type]]: \"fraction\", [[value]]: fraction } as a new element of the list result.\n arrPush.call(result, { '[[type]]': 'fraction', '[[value]]': fraction });\n }\n }\n }\n // f. Else if p is equal \"plusSign\", then:\n else if (p === \"plusSign\") {\n // i. Let plusSignSymbol be the ILND String representing the plus sign.\n let plusSignSymbol = ild.plusSign;\n // ii. Add new part record { [[type]]: \"plusSign\", [[value]]: plusSignSymbol } as a new element of the list result.\n arrPush.call(result, { '[[type]]': 'plusSign', '[[value]]': plusSignSymbol });\n }\n // g. Else if p is equal \"minusSign\", then:\n else if (p === \"minusSign\") {\n // i. Let minusSignSymbol be the ILND String representing the minus sign.\n let minusSignSymbol = ild.minusSign;\n // ii. Add new part record { [[type]]: \"minusSign\", [[value]]: minusSignSymbol } as a new element of the list result.\n arrPush.call(result, { '[[type]]': 'minusSign', '[[value]]': minusSignSymbol });\n }\n // h. Else if p is equal \"percentSign\" and numberFormat.[[style]] is \"percent\", then:\n else if (p === \"percentSign\" && internal['[[style]]'] === \"percent\") {\n // i. Let percentSignSymbol be the ILND String representing the percent sign.\n let percentSignSymbol = ild.percentSign;\n // ii. Add new part record { [[type]]: \"percentSign\", [[value]]: percentSignSymbol } as a new element of the list result.\n arrPush.call(result, { '[[type]]': 'literal', '[[value]]': percentSignSymbol });\n }\n // i. Else if p is equal \"currency\" and numberFormat.[[style]] is \"currency\", then:\n else if (p === \"currency\" && internal['[[style]]'] === \"currency\") {\n // i. Let currency be the value of numberFormat.[[currency]].\n let currency = internal['[[currency]]'];\n\n let cd;\n\n // iii. If numberFormat.[[currencyDisplay]] is \"code\", then\n if (internal['[[currencyDisplay]]'] === \"code\") {\n // 1. Let cd be currency.\n cd = currency;\n }\n // iv. Else if numberFormat.[[currencyDisplay]] is \"symbol\", then\n else if (internal['[[currencyDisplay]]'] === \"symbol\") {\n // 1. Let cd be an ILD string representing currency in short form. If the implementation does not have such a representation of currency, use currency itself.\n cd = data.currencies[currency] || currency;\n }\n // v. Else if numberFormat.[[currencyDisplay]] is \"name\", then\n else if (internal['[[currencyDisplay]]'] === \"name\") {\n // 1. Let cd be an ILD string representing currency in long form. If the implementation does not have such a representation of currency, then use currency itself.\n cd = currency;\n }\n // vi. Add new part record { [[type]]: \"currency\", [[value]]: cd } as a new element of the list result.\n arrPush.call(result, { '[[type]]': 'currency', '[[value]]': cd });\n }\n // j. Else,\n else {\n // i. Let literal be the substring of pattern from position beginIndex, inclusive, to position endIndex, inclusive.\n let literal = pattern.substring(beginIndex, endIndex);\n // ii. Add new part record { [[type]]: \"literal\", [[value]]: literal } as a new element of the list result.\n arrPush.call(result, { '[[type]]': 'literal', '[[value]]': literal });\n }\n // k. Set nextIndex to endIndex + 1.\n nextIndex = endIndex + 1;\n // l. Set beginIndex to Call(%StringProto_indexOf%, pattern, \"{\", nextIndex)\n beginIndex = pattern.indexOf('{', nextIndex);\n }\n // 9. If nextIndex is less than length, then:\n if (nextIndex < length) {\n // a. Let literal be the substring of pattern from position nextIndex, inclusive, to position length, exclusive.\n let literal = pattern.substring(nextIndex, length);\n // b. Add new part record { [[type]]: \"literal\", [[value]]: literal } as a new element of the list result.\n arrPush.call(result, { '[[type]]': 'literal', '[[value]]': literal });\n }\n // 10. Return result.\n return result;\n}\n\n/*\n * @spec[tc39/ecma402/master/spec/numberformat.html]\n * @clause[sec-formatnumber]\n */\nexport function FormatNumber(numberFormat, x) {\n // 1. Let parts be ? PartitionNumberPattern(numberFormat, x).\n let parts = PartitionNumberPattern(numberFormat, x);\n // 2. Let result be an empty String.\n let result = '';\n // 3. For each part in parts, do:\n for (let i = 0; parts.length > i; i++) {\n let part = parts[i];\n // a. Set result to a String value produced by concatenating result and part.[[value]].\n result += part['[[value]]'];\n }\n // 4. Return result.\n return result;\n}\n\n/**\n * When the ToRawPrecision abstract operation is called with arguments x (which\n * must be a finite non-negative number), minPrecision, and maxPrecision (both\n * must be integers between 1 and 21) the following steps are taken:\n */\nfunction ToRawPrecision (x, minPrecision, maxPrecision) {\n // 1. Let p be maxPrecision.\n let p = maxPrecision;\n\n let m, e;\n\n // 2. If x = 0, then\n if (x === 0) {\n // a. Let m be the String consisting of p occurrences of the character \"0\".\n m = arrJoin.call(Array (p + 1), '0');\n // b. Let e be 0.\n e = 0;\n }\n // 3. Else\n else {\n // a. Let e and n be integers such that 10ᵖ⁻¹ ≤ n < 10ᵖ and for which the\n // exact mathematical value of n × 10ᵉ⁻ᵖ⁺¹ – x is as close to zero as\n // possible. If there are two such sets of e and n, pick the e and n for\n // which n × 10ᵉ⁻ᵖ⁺¹ is larger.\n e = log10Floor(Math.abs(x));\n\n // Easier to get to m from here\n let f = Math.round(Math.exp((Math.abs(e - p + 1)) * Math.LN10));\n\n // b. Let m be the String consisting of the digits of the decimal\n // representation of n (in order, with no leading zeroes)\n m = String(Math.round(e - p + 1 < 0 ? x * f : x / f));\n }\n\n // 4. If e ≥ p, then\n if (e >= p)\n // a. Return the concatenation of m and e-p+1 occurrences of the character \"0\".\n return m + arrJoin.call(Array(e-p+1 + 1), '0');\n\n // 5. If e = p-1, then\n else if (e === p - 1)\n // a. Return m.\n return m;\n\n // 6. If e ≥ 0, then\n else if (e >= 0)\n // a. Let m be the concatenation of the first e+1 characters of m, the character\n // \".\", and the remaining p–(e+1) characters of m.\n m = m.slice(0, e + 1) + '.' + m.slice(e + 1);\n\n // 7. If e < 0, then\n else if (e < 0)\n // a. Let m be the concatenation of the String \"0.\", –(e+1) occurrences of the\n // character \"0\", and the string m.\n m = '0.' + arrJoin.call(Array (-(e+1) + 1), '0') + m;\n\n // 8. If m contains the character \".\", and maxPrecision > minPrecision, then\n if (m.indexOf(\".\") >= 0 && maxPrecision > minPrecision) {\n // a. Let cut be maxPrecision – minPrecision.\n let cut = maxPrecision - minPrecision;\n\n // b. Repeat while cut > 0 and the last character of m is \"0\":\n while (cut > 0 && m.charAt(m.length-1) === '0') {\n // i. Remove the last character from m.\n m = m.slice(0, -1);\n\n // ii. Decrease cut by 1.\n cut--;\n }\n\n // c. If the last character of m is \".\", then\n if (m.charAt(m.length-1) === '.')\n // i. Remove the last character from m.\n m = m.slice(0, -1);\n }\n // 9. Return m.\n return m;\n}\n\n/**\n * @spec[tc39/ecma402/master/spec/numberformat.html]\n * @clause[sec-torawfixed]\n * When the ToRawFixed abstract operation is called with arguments x (which must\n * be a finite non-negative number), minInteger (which must be an integer between\n * 1 and 21), minFraction, and maxFraction (which must be integers between 0 and\n * 20) the following steps are taken:\n */\nfunction ToRawFixed(x, minInteger, minFraction, maxFraction) {\n // 1. Let f be maxFraction.\n let f = maxFraction;\n // 2. Let n be an integer for which the exact mathematical value of n ÷ 10f – x is as close to zero as possible. If there are two such n, pick the larger n.\n let n = Math.pow(10, f) * x; // diverging...\n // 3. If n = 0, let m be the String \"0\". Otherwise, let m be the String consisting of the digits of the decimal representation of n (in order, with no leading zeroes).\n let m = (n === 0 ? \"0\" : n.toFixed(0)); // divering...\n\n {\n // this diversion is needed to take into consideration big numbers, e.g.:\n // 1.2344501e+37 -> 12344501000000000000000000000000000000\n let idx;\n let exp = (idx = m.indexOf('e')) > -1 ? m.slice(idx + 1) : 0;\n if (exp) {\n m = m.slice(0, idx).replace('.', '');\n m += arrJoin.call(Array(exp - (m.length - 1) + 1), '0');\n }\n }\n\n let int;\n // 4. If f ≠ 0, then\n if (f !== 0) {\n // a. Let k be the number of characters in m.\n let k = m.length;\n // a. If k ≤ f, then\n if (k <= f) {\n // i. Let z be the String consisting of f+1–k occurrences of the character \"0\".\n let z = arrJoin.call(Array(f + 1 - k + 1), '0');\n // ii. Let m be the concatenation of Strings z and m.\n m = z + m;\n // iii. Let k be f+1.\n k = f + 1;\n }\n // a. Let a be the first k–f characters of m, and let b be the remaining f characters of m.\n let a = m.substring(0, k - f), b = m.substring(k - f, m.length);\n // a. Let m be the concatenation of the three Strings a, \".\", and b.\n m = a + \".\" + b;\n // a. Let int be the number of characters in a.\n int = a.length;\n }\n // 5. Else, let int be the number of characters in m.\n else int = m.length;\n // 6. Let cut be maxFraction – minFraction.\n let cut = maxFraction - minFraction;\n // 7. Repeat while cut > 0 and the last character of m is \"0\":\n while (cut > 0 && m.slice(-1) === \"0\") {\n // a. Remove the last character from m.\n m = m.slice(0, -1);\n // a. Decrease cut by 1.\n cut--;\n }\n // 8. If the last character of m is \".\", then\n if (m.slice(-1) === \".\") {\n // a. Remove the last character from m.\n m = m.slice(0, -1);\n }\n // 9. If int < minInteger, then\n if (int < minInteger) {\n // a. Let z be the String consisting of minInteger–int occurrences of the character \"0\".\n let z = arrJoin.call(Array(minInteger - int + 1), '0');\n // a. Let m be the concatenation of Strings z and m.\n m = z + m;\n }\n // 10. Return m.\n return m;\n}\n\n// Sect 11.3.2 Table 2, Numbering systems\n// ======================================\nlet numSys = {\n arab: ['\\u0660', '\\u0661', '\\u0662', '\\u0663', '\\u0664', '\\u0665', '\\u0666', '\\u0667', '\\u0668', '\\u0669'],\n arabext: ['\\u06F0', '\\u06F1', '\\u06F2', '\\u06F3', '\\u06F4', '\\u06F5', '\\u06F6', '\\u06F7', '\\u06F8', '\\u06F9'],\n bali: ['\\u1B50', '\\u1B51', '\\u1B52', '\\u1B53', '\\u1B54', '\\u1B55', '\\u1B56', '\\u1B57', '\\u1B58', '\\u1B59'],\n beng: ['\\u09E6', '\\u09E7', '\\u09E8', '\\u09E9', '\\u09EA', '\\u09EB', '\\u09EC', '\\u09ED', '\\u09EE', '\\u09EF'],\n deva: ['\\u0966', '\\u0967', '\\u0968', '\\u0969', '\\u096A', '\\u096B', '\\u096C', '\\u096D', '\\u096E', '\\u096F'],\n fullwide: ['\\uFF10', '\\uFF11', '\\uFF12', '\\uFF13', '\\uFF14', '\\uFF15', '\\uFF16', '\\uFF17', '\\uFF18', '\\uFF19'],\n gujr: ['\\u0AE6', '\\u0AE7', '\\u0AE8', '\\u0AE9', '\\u0AEA', '\\u0AEB', '\\u0AEC', '\\u0AED', '\\u0AEE', '\\u0AEF'],\n guru: ['\\u0A66', '\\u0A67', '\\u0A68', '\\u0A69', '\\u0A6A', '\\u0A6B', '\\u0A6C', '\\u0A6D', '\\u0A6E', '\\u0A6F'],\n hanidec: ['\\u3007', '\\u4E00', '\\u4E8C', '\\u4E09', '\\u56DB', '\\u4E94', '\\u516D', '\\u4E03', '\\u516B', '\\u4E5D'],\n khmr: ['\\u17E0', '\\u17E1', '\\u17E2', '\\u17E3', '\\u17E4', '\\u17E5', '\\u17E6', '\\u17E7', '\\u17E8', '\\u17E9'],\n knda: ['\\u0CE6', '\\u0CE7', '\\u0CE8', '\\u0CE9', '\\u0CEA', '\\u0CEB', '\\u0CEC', '\\u0CED', '\\u0CEE', '\\u0CEF'],\n laoo: ['\\u0ED0', '\\u0ED1', '\\u0ED2', '\\u0ED3', '\\u0ED4', '\\u0ED5', '\\u0ED6', '\\u0ED7', '\\u0ED8', '\\u0ED9'],\n latn: ['\\u0030', '\\u0031', '\\u0032', '\\u0033', '\\u0034', '\\u0035', '\\u0036', '\\u0037', '\\u0038', '\\u0039'],\n limb: ['\\u1946', '\\u1947', '\\u1948', '\\u1949', '\\u194A', '\\u194B', '\\u194C', '\\u194D', '\\u194E', '\\u194F'],\n mlym: ['\\u0D66', '\\u0D67', '\\u0D68', '\\u0D69', '\\u0D6A', '\\u0D6B', '\\u0D6C', '\\u0D6D', '\\u0D6E', '\\u0D6F'],\n mong: ['\\u1810', '\\u1811', '\\u1812', '\\u1813', '\\u1814', '\\u1815', '\\u1816', '\\u1817', '\\u1818', '\\u1819'],\n mymr: ['\\u1040', '\\u1041', '\\u1042', '\\u1043', '\\u1044', '\\u1045', '\\u1046', '\\u1047', '\\u1048', '\\u1049'],\n orya: ['\\u0B66', '\\u0B67', '\\u0B68', '\\u0B69', '\\u0B6A', '\\u0B6B', '\\u0B6C', '\\u0B6D', '\\u0B6E', '\\u0B6F'],\n tamldec: ['\\u0BE6', '\\u0BE7', '\\u0BE8', '\\u0BE9', '\\u0BEA', '\\u0BEB', '\\u0BEC', '\\u0BED', '\\u0BEE', '\\u0BEF'],\n telu: ['\\u0C66', '\\u0C67', '\\u0C68', '\\u0C69', '\\u0C6A', '\\u0C6B', '\\u0C6C', '\\u0C6D', '\\u0C6E', '\\u0C6F'],\n thai: ['\\u0E50', '\\u0E51', '\\u0E52', '\\u0E53', '\\u0E54', '\\u0E55', '\\u0E56', '\\u0E57', '\\u0E58', '\\u0E59'],\n tibt: ['\\u0F20', '\\u0F21', '\\u0F22', '\\u0F23', '\\u0F24', '\\u0F25', '\\u0F26', '\\u0F27', '\\u0F28', '\\u0F29']\n};\n\n/**\n * This function provides access to the locale and formatting options computed\n * during initialization of the object.\n *\n * The function returns a new object whose properties and attributes are set as\n * if constructed by an object literal assigning to each of the following\n * properties the value of the corresponding internal property of this\n * NumberFormat object (see 11.4): locale, numberingSystem, style, currency,\n * currencyDisplay, minimumIntegerDigits, minimumFractionDigits,\n * maximumFractionDigits, minimumSignificantDigits, maximumSignificantDigits, and\n * useGrouping. Properties whose corresponding internal properties are not present\n * are not assigned.\n */\n/* 11.3.3 */defineProperty(Intl.NumberFormat.prototype, 'resolvedOptions', {\n configurable: true,\n writable: true,\n value: function () {\n let prop,\n descs = new Record(),\n props = [\n 'locale', 'numberingSystem', 'style', 'currency', 'currencyDisplay',\n 'minimumIntegerDigits', 'minimumFractionDigits', 'maximumFractionDigits',\n 'minimumSignificantDigits', 'maximumSignificantDigits', 'useGrouping'\n ],\n internal = this !== null && typeof this === 'object' && getInternalProperties(this);\n\n // Satisfy test 11.3_b\n if (!internal || !internal['[[initializedNumberFormat]]'])\n throw new TypeError('`this` value for resolvedOptions() is not an initialized Intl.NumberFormat object.');\n\n for (let i = 0, max = props.length; i < max; i++) {\n if (hop.call(internal, prop = '[['+ props[i] +']]'))\n descs[props[i]] = { value: internal[prop], writable: true, configurable: true, enumerable: true };\n }\n\n return objCreate({}, descs);\n }\n});\n","/* jslint esnext: true */\n\n// Match these datetime components in a CLDR pattern, except those in single quotes\nlet expDTComponents = /(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g;\n// trim patterns after transformations\nlet expPatternTrimmer = /^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g;\n// Skip over patterns with these datetime components because we don't have data\n// to back them up:\n// timezone, weekday, amoung others\nlet unwantedDTCs = /[rqQASjJgwWIQq]/; // xXVO were removed from this list in favor of computing matches with timeZoneName values but printing as empty string\n\nlet dtKeys = [\"era\", \"year\", \"month\", \"day\", \"weekday\", \"quarter\"];\nlet tmKeys = [\"hour\", \"minute\", \"second\", \"hour12\", \"timeZoneName\"];\n\nfunction isDateFormatOnly(obj) {\n for (let i = 0; i < tmKeys.length; i += 1) {\n if (obj.hasOwnProperty(tmKeys[i])) {\n return false;\n }\n }\n return true;\n}\n\nfunction isTimeFormatOnly(obj) {\n for (let i = 0; i < dtKeys.length; i += 1) {\n if (obj.hasOwnProperty(dtKeys[i])) {\n return false;\n }\n }\n return true;\n}\n\nfunction joinDateAndTimeFormats(dateFormatObj, timeFormatObj) {\n let o = { _: {} };\n for (let i = 0; i < dtKeys.length; i += 1) {\n if (dateFormatObj[dtKeys[i]]) {\n o[dtKeys[i]] = dateFormatObj[dtKeys[i]];\n }\n if (dateFormatObj._[dtKeys[i]]) {\n o._[dtKeys[i]] = dateFormatObj._[dtKeys[i]];\n }\n }\n for (let j = 0; j < tmKeys.length; j += 1) {\n if (timeFormatObj[tmKeys[j]]) {\n o[tmKeys[j]] = timeFormatObj[tmKeys[j]];\n }\n if (timeFormatObj._[tmKeys[j]]) {\n o._[tmKeys[j]] = timeFormatObj._[tmKeys[j]];\n }\n }\n return o;\n}\n\nfunction computeFinalPatterns(formatObj) {\n // From http://www.unicode.org/reports/tr35/tr35-dates.html#Date_Format_Patterns:\n // 'In patterns, two single quotes represents a literal single quote, either\n // inside or outside single quotes. Text within single quotes is not\n // interpreted in any way (except for two adjacent single quotes).'\n formatObj.pattern12 = formatObj.extendedPattern.replace(/'([^']*)'/g, ($0, literal) => {\n return literal ? literal : \"'\";\n });\n\n // pattern 12 is always the default. we can produce the 24 by removing {ampm}\n formatObj.pattern = formatObj.pattern12.replace('{ampm}', '').replace(expPatternTrimmer, '');\n return formatObj;\n}\n\nfunction expDTComponentsMeta($0, formatObj) {\n switch ($0.charAt(0)) {\n // --- Era\n case 'G':\n formatObj.era = [ 'short', 'short', 'short', 'long', 'narrow' ][$0.length-1];\n return '{era}';\n\n // --- Year\n case 'y':\n case 'Y':\n case 'u':\n case 'U':\n case 'r':\n formatObj.year = $0.length === 2 ? '2-digit' : 'numeric';\n return '{year}';\n\n // --- Quarter (not supported in this polyfill)\n case 'Q':\n case 'q':\n formatObj.quarter = [ 'numeric', '2-digit', 'short', 'long', 'narrow' ][$0.length-1];\n return '{quarter}';\n\n // --- Month\n case 'M':\n case 'L':\n formatObj.month = [ 'numeric', '2-digit', 'short', 'long', 'narrow' ][$0.length-1];\n return '{month}';\n\n // --- Week (not supported in this polyfill)\n case 'w':\n // week of the year\n formatObj.week = $0.length === 2 ? '2-digit' : 'numeric';\n return '{weekday}';\n case 'W':\n // week of the month\n formatObj.week = 'numeric';\n return '{weekday}';\n\n // --- Day\n case 'd':\n // day of the month\n formatObj.day = $0.length === 2 ? '2-digit' : 'numeric';\n return '{day}';\n case 'D': // day of the year\n case 'F': // day of the week\n case 'g':\n // 1..n: Modified Julian day\n formatObj.day = 'numeric';\n return '{day}';\n\n // --- Week Day\n case 'E':\n // day of the week\n formatObj.weekday = [ 'short', 'short', 'short', 'long', 'narrow', 'short' ][$0.length-1];\n return '{weekday}';\n case 'e':\n // local day of the week\n formatObj.weekday = [ 'numeric', '2-digit', 'short', 'long', 'narrow', 'short' ][$0.length-1];\n return '{weekday}';\n case 'c':\n // stand alone local day of the week\n formatObj.weekday = [ 'numeric', undefined, 'short', 'long', 'narrow', 'short' ][$0.length-1];\n return '{weekday}';\n\n // --- Period\n case 'a': // AM, PM\n case 'b': // am, pm, noon, midnight\n case 'B': // flexible day periods\n formatObj.hour12 = true;\n return '{ampm}';\n\n // --- Hour\n case 'h':\n case 'H':\n formatObj.hour = $0.length === 2 ? '2-digit' : 'numeric';\n return '{hour}';\n case 'k':\n case 'K':\n formatObj.hour12 = true; // 12-hour-cycle time formats (using h or K)\n formatObj.hour = $0.length === 2 ? '2-digit' : 'numeric';\n return '{hour}';\n\n // --- Minute\n case 'm':\n formatObj.minute = $0.length === 2 ? '2-digit' : 'numeric';\n return '{minute}';\n\n // --- Second\n case 's':\n formatObj.second = $0.length === 2 ? '2-digit' : 'numeric';\n return '{second}';\n case 'S':\n case 'A':\n formatObj.second = 'numeric';\n return '{second}';\n\n // --- Timezone\n case 'z': // 1..3, 4: specific non-location format\n case 'Z': // 1..3, 4, 5: The ISO8601 varios formats\n case 'O': // 1, 4: miliseconds in day short, long\n case 'v': // 1, 4: generic non-location format\n case 'V': // 1, 2, 3, 4: time zone ID or city\n case 'X': // 1, 2, 3, 4: The ISO8601 varios formats\n case 'x': // 1, 2, 3, 4: The ISO8601 varios formats\n // this polyfill only supports much, for now, we are just doing something dummy\n formatObj.timeZoneName = $0.length < 4 ? 'short' : 'long';\n return '{timeZoneName}';\n }\n}\n\n\n/**\n * Converts the CLDR availableFormats into the objects and patterns required by\n * the ECMAScript Internationalization API specification.\n */\nexport function createDateTimeFormat(skeleton, pattern) {\n // we ignore certain patterns that are unsupported to avoid this expensive op.\n if (unwantedDTCs.test(pattern))\n return undefined;\n\n let formatObj = {\n originalPattern: pattern,\n _: {}\n };\n\n // Replace the pattern string with the one required by the specification, whilst\n // at the same time evaluating it for the subsets and formats\n formatObj.extendedPattern = pattern.replace(expDTComponents, ($0) => {\n // See which symbol we're dealing with\n return expDTComponentsMeta($0, formatObj._);\n });\n\n // Match the skeleton string with the one required by the specification\n // this implementation is based on the Date Field Symbol Table:\n // http://unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table\n // Note: we are adding extra data to the formatObject even though this polyfill\n // might not support it.\n skeleton.replace(expDTComponents, ($0) => {\n // See which symbol we're dealing with\n return expDTComponentsMeta($0, formatObj);\n });\n\n return computeFinalPatterns(formatObj);\n}\n\n/**\n * Processes DateTime formats from CLDR to an easier-to-parse format.\n * the result of this operation should be cached the first time a particular\n * calendar is analyzed.\n *\n * The specification requires we support at least the following subsets of\n * date/time components:\n *\n * - 'weekday', 'year', 'month', 'day', 'hour', 'minute', 'second'\n * - 'weekday', 'year', 'month', 'day'\n * - 'year', 'month', 'day'\n * - 'year', 'month'\n * - 'month', 'day'\n * - 'hour', 'minute', 'second'\n * - 'hour', 'minute'\n *\n * We need to cherry pick at least these subsets from the CLDR data and convert\n * them into the pattern objects used in the ECMA-402 API.\n */\nexport function createDateTimeFormats(formats) {\n let availableFormats = formats.availableFormats;\n let timeFormats = formats.timeFormats;\n let dateFormats = formats.dateFormats;\n let result = [];\n let skeleton, pattern, computed, i, j;\n let timeRelatedFormats = [];\n let dateRelatedFormats = [];\n\n // Map available (custom) formats into a pattern for createDateTimeFormats\n for (skeleton in availableFormats) {\n if (availableFormats.hasOwnProperty(skeleton)) {\n pattern = availableFormats[skeleton];\n computed = createDateTimeFormat(skeleton, pattern);\n if (computed) {\n result.push(computed);\n // in some cases, the format is only displaying date specific props\n // or time specific props, in which case we need to also produce the\n // combined formats.\n if (isDateFormatOnly(computed)) {\n dateRelatedFormats.push(computed);\n } else if (isTimeFormatOnly(computed)) {\n timeRelatedFormats.push(computed);\n }\n }\n }\n }\n\n // Map time formats into a pattern for createDateTimeFormats\n for (skeleton in timeFormats) {\n if (timeFormats.hasOwnProperty(skeleton)) {\n pattern = timeFormats[skeleton];\n computed = createDateTimeFormat(skeleton, pattern);\n if (computed) {\n result.push(computed);\n timeRelatedFormats.push(computed);\n }\n }\n }\n\n // Map date formats into a pattern for createDateTimeFormats\n for (skeleton in dateFormats) {\n if (dateFormats.hasOwnProperty(skeleton)) {\n pattern = dateFormats[skeleton];\n computed = createDateTimeFormat(skeleton, pattern);\n if (computed) {\n result.push(computed);\n dateRelatedFormats.push(computed);\n }\n }\n }\n\n // combine custom time and custom date formats when they are orthogonals to complete the\n // formats supported by CLDR.\n // This Algo is based on section \"Missing Skeleton Fields\" from:\n // http://unicode.org/reports/tr35/tr35-dates.html#availableFormats_appendItems\n for (i = 0; i < timeRelatedFormats.length; i += 1) {\n for (j = 0; j < dateRelatedFormats.length; j += 1) {\n if (dateRelatedFormats[j].month === 'long') {\n pattern = dateRelatedFormats[j].weekday ? formats.full : formats.long;\n } else if (dateRelatedFormats[j].month === 'short') {\n pattern = formats.medium;\n } else {\n pattern = formats.short;\n }\n computed = joinDateAndTimeFormats(dateRelatedFormats[j], timeRelatedFormats[i]);\n computed.originalPattern = pattern;\n computed.extendedPattern = pattern\n .replace('{0}', timeRelatedFormats[i].extendedPattern)\n .replace('{1}', dateRelatedFormats[j].extendedPattern)\n .replace(/^[,\\s]+|[,\\s]+$/gi, '');\n result.push(computeFinalPatterns(computed));\n }\n }\n\n return result;\n}\n\n// this represents the exceptions of the rule that are not covered by CLDR availableFormats\n// for single property configurations, they play no role when using multiple properties, and\n// those that are not in this table, are not exceptions or are not covered by the data we\n// provide.\nconst validSyntheticProps = {\n second: {\n numeric: 's',\n '2-digit': 'ss'\n },\n minute: {\n numeric: 'm',\n '2-digit': 'mm'\n },\n year: {\n numeric: 'y',\n '2-digit': 'yy'\n },\n day: {\n numeric: 'd',\n '2-digit': 'dd'\n },\n month: {\n numeric: 'L',\n '2-digit': 'LL',\n narrow: 'LLLLL',\n short: 'LLL',\n long: 'LLLL'\n },\n weekday: {\n narrow: 'ccccc',\n short: 'ccc',\n long: 'cccc'\n }\n};\n\nexport function generateSyntheticFormat(propName, propValue) {\n if (validSyntheticProps[propName] && validSyntheticProps[propName][propValue]) {\n return {\n originalPattern: validSyntheticProps[propName][propValue],\n _: {\n [propName]: propValue\n },\n extendedPattern: `{${propName}}`,\n [propName]: propValue,\n pattern12: `{${propName}}`,\n pattern: `{${propName}}`\n };\n }\n}\n","// 12.1 The Intl.DateTimeFormat constructor\n// ==================================\n\nimport {\n toLatinUpperCase\n} from './6.locales-currencies-tz.js';\n\nimport {\n Intl\n} from \"./8.intl.js\";\n\nimport {\n CanonicalizeLocaleList,\n ResolveLocale,\n GetOption,\n SupportedLocales\n} from \"./9.negotiation.js\";\n\nimport {\n FormatNumber\n} from \"./11.numberformat.js\";\n\nimport {\n generateSyntheticFormat,\n createDateTimeFormats\n} from \"./cldr\";\n\nimport {\n internals,\n es3,\n fnBind,\n defineProperty,\n toObject,\n getInternalProperties,\n createRegExpRestore,\n secret,\n Record,\n List,\n hop,\n objCreate,\n toNumber,\n arrPush,\n arrIndexOf\n} from './util.js';\n\n// An object map of date component keys, saves using a regex later\nconst dateWidths = objCreate(null, { narrow:{}, short:{}, long:{} });\n\n/**\n * Returns a string for a date component, resolved using multiple inheritance as specified\n * as specified in the Unicode Technical Standard 35.\n */\nfunction resolveDateString(data, ca, component, width, key) {\n // From http://www.unicode.org/reports/tr35/tr35.html#Multiple_Inheritance:\n // 'In clearly specified instances, resources may inherit from within the same locale.\n // For example, ... the Buddhist calendar inherits from the Gregorian calendar.'\n let obj = data[ca] && data[ca][component]\n ? data[ca][component]\n : data.gregory[component],\n\n // \"sideways\" inheritance resolves strings when a key doesn't exist\n alts = {\n narrow: ['short', 'long'],\n short: ['long', 'narrow'],\n long: ['short', 'narrow']\n },\n\n //\n resolved = hop.call(obj, width)\n ? obj[width]\n : hop.call(obj, alts[width][0])\n ? obj[alts[width][0]]\n : obj[alts[width][1]];\n\n // `key` wouldn't be specified for components 'dayPeriods'\n return key !== null ? resolved[key] : resolved;\n}\n\n// Define the DateTimeFormat constructor internally so it cannot be tainted\nexport function DateTimeFormatConstructor () {\n let locales = arguments[0];\n let options = arguments[1];\n\n if (!this || this === Intl) {\n return new Intl.DateTimeFormat(locales, options);\n }\n return InitializeDateTimeFormat(toObject(this), locales, options);\n}\n\ndefineProperty(Intl, 'DateTimeFormat', {\n configurable: true,\n writable: true,\n value: DateTimeFormatConstructor\n});\n\n// Must explicitly set prototypes as unwritable\ndefineProperty(DateTimeFormatConstructor, 'prototype', {\n writable: false\n});\n\n/**\n * The abstract operation InitializeDateTimeFormat accepts the arguments dateTimeFormat\n * (which must be an object), locales, and options. It initializes dateTimeFormat as a\n * DateTimeFormat object.\n */\nexport function/* 12.1.1.1 */InitializeDateTimeFormat (dateTimeFormat, locales, options) {\n // This will be a internal properties object if we're not already initialized\n let internal = getInternalProperties(dateTimeFormat);\n\n // Create an object whose props can be used to restore the values of RegExp props\n let regexpRestore = createRegExpRestore();\n\n // 1. If dateTimeFormat has an [[initializedIntlObject]] internal property with\n // value true, throw a TypeError exception.\n if (internal['[[initializedIntlObject]]'] === true)\n throw new TypeError('`this` object has already been initialized as an Intl object');\n\n // Need this to access the `internal` object\n defineProperty(dateTimeFormat, '__getInternalProperties', {\n value: function () {\n // NOTE: Non-standard, for internal use only\n if (arguments[0] === secret)\n return internal;\n }\n });\n\n // 2. Set the [[initializedIntlObject]] internal property of numberFormat to true.\n internal['[[initializedIntlObject]]'] = true;\n\n // 3. Let requestedLocales be the result of calling the CanonicalizeLocaleList\n // abstract operation (defined in 9.2.1) with argument locales.\n let requestedLocales = CanonicalizeLocaleList(locales);\n\n // 4. Let options be the result of calling the ToDateTimeOptions abstract\n // operation (defined below) with arguments options, \"any\", and \"date\".\n options = ToDateTimeOptions(options, 'any', 'date');\n\n // 5. Let opt be a new Record.\n let opt = new Record();\n\n // 6. Let matcher be the result of calling the GetOption abstract operation\n // (defined in 9.2.9) with arguments options, \"localeMatcher\", \"string\", a List\n // containing the two String values \"lookup\" and \"best fit\", and \"best fit\".\n let matcher = GetOption(options, 'localeMatcher', 'string', new List('lookup', 'best fit'), 'best fit');\n\n // 7. Set opt.[[localeMatcher]] to matcher.\n opt['[[localeMatcher]]'] = matcher;\n\n // 8. Let DateTimeFormat be the standard built-in object that is the initial\n // value of Intl.DateTimeFormat.\n let DateTimeFormat = internals.DateTimeFormat; // This is what we *really* need\n\n // 9. Let localeData be the value of the [[localeData]] internal property of\n // DateTimeFormat.\n let localeData = DateTimeFormat['[[localeData]]'];\n\n // 10. Let r be the result of calling the ResolveLocale abstract operation\n // (defined in 9.2.5) with the [[availableLocales]] internal property of\n // DateTimeFormat, requestedLocales, opt, the [[relevantExtensionKeys]]\n // internal property of DateTimeFormat, and localeData.\n let r = ResolveLocale(DateTimeFormat['[[availableLocales]]'], requestedLocales,\n opt, DateTimeFormat['[[relevantExtensionKeys]]'], localeData);\n\n // 11. Set the [[locale]] internal property of dateTimeFormat to the value of\n // r.[[locale]].\n internal['[[locale]]'] = r['[[locale]]'];\n\n // 12. Set the [[calendar]] internal property of dateTimeFormat to the value of\n // r.[[ca]].\n internal['[[calendar]]'] = r['[[ca]]'];\n\n // 13. Set the [[numberingSystem]] internal property of dateTimeFormat to the value of\n // r.[[nu]].\n internal['[[numberingSystem]]'] = r['[[nu]]'];\n\n // The specification doesn't tell us to do this, but it's helpful later on\n internal['[[dataLocale]]'] = r['[[dataLocale]]'];\n\n // 14. Let dataLocale be the value of r.[[dataLocale]].\n let dataLocale = r['[[dataLocale]]'];\n\n // 15. Let tz be the result of calling the [[Get]] internal method of options with\n // argument \"timeZone\".\n let tz = options.timeZone;\n\n // 16. If tz is not undefined, then\n if (tz !== undefined) {\n // a. Let tz be ToString(tz).\n // b. Convert tz to upper case as described in 6.1.\n // NOTE: If an implementation accepts additional time zone values, as permitted\n // under certain conditions by the Conformance clause, different casing\n // rules apply.\n tz = toLatinUpperCase(tz);\n\n // c. If tz is not \"UTC\", then throw a RangeError exception.\n // ###TODO: accept more time zones###\n if (tz !== 'UTC')\n throw new RangeError('timeZone is not supported.');\n }\n\n // 17. Set the [[timeZone]] internal property of dateTimeFormat to tz.\n internal['[[timeZone]]'] = tz;\n\n // 18. Let opt be a new Record.\n opt = new Record();\n\n // 19. For each row of Table 3, except the header row, do:\n for (let prop in dateTimeComponents) {\n if (!hop.call(dateTimeComponents, prop))\n continue;\n\n // 20. Let prop be the name given in the Property column of the row.\n // 21. Let value be the result of calling the GetOption abstract operation,\n // passing as argument options, the name given in the Property column of the\n // row, \"string\", a List containing the strings given in the Values column of\n // the row, and undefined.\n let value = GetOption(options, prop, 'string', dateTimeComponents[prop]);\n\n // 22. Set opt.[[]] to value.\n opt['[['+prop+']]'] = value;\n }\n\n // Assigned a value below\n let bestFormat;\n\n // 23. Let dataLocaleData be the result of calling the [[Get]] internal method of\n // localeData with argument dataLocale.\n let dataLocaleData = localeData[dataLocale];\n\n // 24. Let formats be the result of calling the [[Get]] internal method of\n // dataLocaleData with argument \"formats\".\n // Note: we process the CLDR formats into the spec'd structure\n let formats = ToDateTimeFormats(dataLocaleData.formats);\n\n // 25. Let matcher be the result of calling the GetOption abstract operation with\n // arguments options, \"formatMatcher\", \"string\", a List containing the two String\n // values \"basic\" and \"best fit\", and \"best fit\".\n matcher = GetOption(options, 'formatMatcher', 'string', new List('basic', 'best fit'), 'best fit');\n\n // Optimization: caching the processed formats as a one time operation by\n // replacing the initial structure from localeData\n dataLocaleData.formats = formats;\n\n // 26. If matcher is \"basic\", then\n if (matcher === 'basic') {\n // 27. Let bestFormat be the result of calling the BasicFormatMatcher abstract\n // operation (defined below) with opt and formats.\n bestFormat = BasicFormatMatcher(opt, formats);\n\n // 28. Else\n } else {\n {\n // diverging\n let hr12 = GetOption(options, 'hour12', 'boolean'/*, undefined, undefined*/);\n opt.hour12 = hr12 === undefined ? dataLocaleData.hour12 : hr12;\n }\n // 29. Let bestFormat be the result of calling the BestFitFormatMatcher\n // abstract operation (defined below) with opt and formats.\n bestFormat = BestFitFormatMatcher(opt, formats);\n }\n\n // 30. For each row in Table 3, except the header row, do\n for (let prop in dateTimeComponents) {\n if (!hop.call(dateTimeComponents, prop))\n continue;\n\n // a. Let prop be the name given in the Property column of the row.\n // b. Let pDesc be the result of calling the [[GetOwnProperty]] internal method of\n // bestFormat with argument prop.\n // c. If pDesc is not undefined, then\n if (hop.call(bestFormat, prop)) {\n // i. Let p be the result of calling the [[Get]] internal method of bestFormat\n // with argument prop.\n let p = bestFormat[prop];\n {\n // diverging\n p = bestFormat._ && hop.call(bestFormat._, prop) ? bestFormat._[prop] : p;\n }\n\n // ii. Set the [[]] internal property of dateTimeFormat to p.\n internal['[['+prop+']]'] = p;\n }\n }\n\n let pattern; // Assigned a value below\n\n // 31. Let hr12 be the result of calling the GetOption abstract operation with\n // arguments options, \"hour12\", \"boolean\", undefined, and undefined.\n let hr12 = GetOption(options, 'hour12', 'boolean'/*, undefined, undefined*/);\n\n // 32. If dateTimeFormat has an internal property [[hour]], then\n if (internal['[[hour]]']) {\n // a. If hr12 is undefined, then let hr12 be the result of calling the [[Get]]\n // internal method of dataLocaleData with argument \"hour12\".\n hr12 = hr12 === undefined ? dataLocaleData.hour12 : hr12;\n\n // b. Set the [[hour12]] internal property of dateTimeFormat to hr12.\n internal['[[hour12]]'] = hr12;\n\n // c. If hr12 is true, then\n if (hr12 === true) {\n // i. Let hourNo0 be the result of calling the [[Get]] internal method of\n // dataLocaleData with argument \"hourNo0\".\n let hourNo0 = dataLocaleData.hourNo0;\n\n // ii. Set the [[hourNo0]] internal property of dateTimeFormat to hourNo0.\n internal['[[hourNo0]]'] = hourNo0;\n\n // iii. Let pattern be the result of calling the [[Get]] internal method of\n // bestFormat with argument \"pattern12\".\n pattern = bestFormat.pattern12;\n }\n\n // d. Else\n else\n // i. Let pattern be the result of calling the [[Get]] internal method of\n // bestFormat with argument \"pattern\".\n pattern = bestFormat.pattern;\n }\n\n // 33. Else\n else\n // a. Let pattern be the result of calling the [[Get]] internal method of\n // bestFormat with argument \"pattern\".\n pattern = bestFormat.pattern;\n\n // 34. Set the [[pattern]] internal property of dateTimeFormat to pattern.\n internal['[[pattern]]'] = pattern;\n\n // 35. Set the [[boundFormat]] internal property of dateTimeFormat to undefined.\n internal['[[boundFormat]]'] = undefined;\n\n // 36. Set the [[initializedDateTimeFormat]] internal property of dateTimeFormat to\n // true.\n internal['[[initializedDateTimeFormat]]'] = true;\n\n // In ES3, we need to pre-bind the format() function\n if (es3)\n dateTimeFormat.format = GetFormatDateTime.call(dateTimeFormat);\n\n // Restore the RegExp properties\n regexpRestore();\n\n // Return the newly initialised object\n return dateTimeFormat;\n}\n\n/**\n * Several DateTimeFormat algorithms use values from the following table, which provides\n * property names and allowable values for the components of date and time formats:\n */\nlet dateTimeComponents = {\n weekday: [ \"narrow\", \"short\", \"long\" ],\n era: [ \"narrow\", \"short\", \"long\" ],\n year: [ \"2-digit\", \"numeric\" ],\n month: [ \"2-digit\", \"numeric\", \"narrow\", \"short\", \"long\" ],\n day: [ \"2-digit\", \"numeric\" ],\n hour: [ \"2-digit\", \"numeric\" ],\n minute: [ \"2-digit\", \"numeric\" ],\n second: [ \"2-digit\", \"numeric\" ],\n timeZoneName: [ \"short\", \"long\" ]\n};\n\n/**\n * When the ToDateTimeOptions abstract operation is called with arguments options,\n * required, and defaults, the following steps are taken:\n */\nfunction ToDateTimeFormats(formats) {\n if (Object.prototype.toString.call(formats) === '[object Array]') {\n return formats;\n }\n return createDateTimeFormats(formats);\n}\n\n/**\n * When the ToDateTimeOptions abstract operation is called with arguments options,\n * required, and defaults, the following steps are taken:\n */\nexport function ToDateTimeOptions (options, required, defaults) {\n // 1. If options is undefined, then let options be null, else let options be\n // ToObject(options).\n if (options === undefined)\n options = null;\n\n else {\n // (#12) options needs to be a Record, but it also needs to inherit properties\n let opt2 = toObject(options);\n options = new Record();\n\n for (let k in opt2)\n options[k] = opt2[k];\n }\n\n // 2. Let create be the standard built-in function object defined in ES5, 15.2.3.5.\n let create = objCreate;\n\n // 3. Let options be the result of calling the [[Call]] internal method of create with\n // undefined as the this value and an argument list containing the single item\n // options.\n options = create(options);\n\n // 4. Let needDefaults be true.\n let needDefaults = true;\n\n // 5. If required is \"date\" or \"any\", then\n if (required === 'date' || required === 'any') {\n // a. For each of the property names \"weekday\", \"year\", \"month\", \"day\":\n // i. If the result of calling the [[Get]] internal method of options with the\n // property name is not undefined, then let needDefaults be false.\n if (options.weekday !== undefined || options.year !== undefined\n || options.month !== undefined || options.day !== undefined)\n needDefaults = false;\n }\n\n // 6. If required is \"time\" or \"any\", then\n if (required === 'time' || required === 'any') {\n // a. For each of the property names \"hour\", \"minute\", \"second\":\n // i. If the result of calling the [[Get]] internal method of options with the\n // property name is not undefined, then let needDefaults be false.\n if (options.hour !== undefined || options.minute !== undefined || options.second !== undefined)\n needDefaults = false;\n }\n\n // 7. If needDefaults is true and defaults is either \"date\" or \"all\", then\n if (needDefaults && (defaults === 'date' || defaults === 'all'))\n // a. For each of the property names \"year\", \"month\", \"day\":\n // i. Call the [[DefineOwnProperty]] internal method of options with the\n // property name, Property Descriptor {[[Value]]: \"numeric\", [[Writable]]:\n // true, [[Enumerable]]: true, [[Configurable]]: true}, and false.\n options.year = options.month = options.day = 'numeric';\n\n // 8. If needDefaults is true and defaults is either \"time\" or \"all\", then\n if (needDefaults && (defaults === 'time' || defaults === 'all'))\n // a. For each of the property names \"hour\", \"minute\", \"second\":\n // i. Call the [[DefineOwnProperty]] internal method of options with the\n // property name, Property Descriptor {[[Value]]: \"numeric\", [[Writable]]:\n // true, [[Enumerable]]: true, [[Configurable]]: true}, and false.\n options.hour = options.minute = options.second = 'numeric';\n\n // 9. Return options.\n return options;\n}\n\n/**\n * When the BasicFormatMatcher abstract operation is called with two arguments options and\n * formats, the following steps are taken:\n */\nfunction BasicFormatMatcher (options, formats) {\n // 1. Let removalPenalty be 120.\n let removalPenalty = 120;\n\n // 2. Let additionPenalty be 20.\n let additionPenalty = 20;\n\n // 3. Let longLessPenalty be 8.\n let longLessPenalty = 8;\n\n // 4. Let longMorePenalty be 6.\n let longMorePenalty = 6;\n\n // 5. Let shortLessPenalty be 6.\n let shortLessPenalty = 6;\n\n // 6. Let shortMorePenalty be 3.\n let shortMorePenalty = 3;\n\n // 7. Let bestScore be -Infinity.\n let bestScore = -Infinity;\n\n // 8. Let bestFormat be undefined.\n let bestFormat;\n\n // 9. Let i be 0.\n let i = 0;\n\n // 10. Assert: formats is an Array object.\n\n // 11. Let len be the result of calling the [[Get]] internal method of formats with argument \"length\".\n let len = formats.length;\n\n // 12. Repeat while i < len:\n while (i < len) {\n // a. Let format be the result of calling the [[Get]] internal method of formats with argument ToString(i).\n let format = formats[i];\n\n // b. Let score be 0.\n let score = 0;\n\n // c. For each property shown in Table 3:\n for (let property in dateTimeComponents) {\n if (!hop.call(dateTimeComponents, property))\n continue;\n\n // i. Let optionsProp be options.[[]].\n let optionsProp = options['[['+ property +']]'];\n\n // ii. Let formatPropDesc be the result of calling the [[GetOwnProperty]] internal method of format\n // with argument property.\n // iii. If formatPropDesc is not undefined, then\n // 1. Let formatProp be the result of calling the [[Get]] internal method of format with argument property.\n let formatProp = hop.call(format, property) ? format[property] : undefined;\n\n // iv. If optionsProp is undefined and formatProp is not undefined, then decrease score by\n // additionPenalty.\n if (optionsProp === undefined && formatProp !== undefined)\n score -= additionPenalty;\n\n // v. Else if optionsProp is not undefined and formatProp is undefined, then decrease score by\n // removalPenalty.\n else if (optionsProp !== undefined && formatProp === undefined)\n score -= removalPenalty;\n\n // vi. Else\n else {\n // 1. Let values be the array [\"2-digit\", \"numeric\", \"narrow\", \"short\",\n // \"long\"].\n let values = [ '2-digit', 'numeric', 'narrow', 'short', 'long' ];\n\n // 2. Let optionsPropIndex be the index of optionsProp within values.\n let optionsPropIndex = arrIndexOf.call(values, optionsProp);\n\n // 3. Let formatPropIndex be the index of formatProp within values.\n let formatPropIndex = arrIndexOf.call(values, formatProp);\n\n // 4. Let delta be max(min(formatPropIndex - optionsPropIndex, 2), -2).\n let delta = Math.max(Math.min(formatPropIndex - optionsPropIndex, 2), -2);\n\n // 5. If delta = 2, decrease score by longMorePenalty.\n if (delta === 2)\n score -= longMorePenalty;\n\n // 6. Else if delta = 1, decrease score by shortMorePenalty.\n else if (delta === 1)\n score -= shortMorePenalty;\n\n // 7. Else if delta = -1, decrease score by shortLessPenalty.\n else if (delta === -1)\n score -= shortLessPenalty;\n\n // 8. Else if delta = -2, decrease score by longLessPenalty.\n else if (delta === -2)\n score -= longLessPenalty;\n }\n }\n\n // d. If score > bestScore, then\n if (score > bestScore) {\n // i. Let bestScore be score.\n bestScore = score;\n\n // ii. Let bestFormat be format.\n bestFormat = format;\n }\n\n // e. Increase i by 1.\n i++;\n }\n\n // 13. Return bestFormat.\n return bestFormat;\n}\n\n/**\n * When the BestFitFormatMatcher abstract operation is called with two arguments options\n * and formats, it performs implementation dependent steps, which should return a set of\n * component representations that a typical user of the selected locale would perceive as\n * at least as good as the one returned by BasicFormatMatcher.\n *\n * This polyfill defines the algorithm to be the same as BasicFormatMatcher,\n * with the addition of bonus points awarded where the requested format is of\n * the same data type as the potentially matching format.\n *\n * This algo relies on the concept of closest distance matching described here:\n * http://unicode.org/reports/tr35/tr35-dates.html#Matching_Skeletons\n * Typically a “best match” is found using a closest distance match, such as:\n *\n * Symbols requesting a best choice for the locale are replaced.\n * j → one of {H, k, h, K}; C → one of {a, b, B}\n * -> Covered by cldr.js matching process\n *\n * For fields with symbols representing the same type (year, month, day, etc):\n * Most symbols have a small distance from each other.\n * M ≅ L; E ≅ c; a ≅ b ≅ B; H ≅ k ≅ h ≅ K; ...\n * -> Covered by cldr.js matching process\n *\n * Width differences among fields, other than those marking text vs numeric, are given small distance from each other.\n * MMM ≅ MMMM\n * MM ≅ M\n * Numeric and text fields are given a larger distance from each other.\n * MMM ≈ MM\n * Symbols representing substantial differences (week of year vs week of month) are given much larger a distances from each other.\n * d ≋ D; ...\n * Missing or extra fields cause a match to fail. (But see Missing Skeleton Fields).\n *\n *\n * For example,\n *\n * { month: 'numeric', day: 'numeric' }\n *\n * should match\n *\n * { month: '2-digit', day: '2-digit' }\n *\n * rather than\n *\n * { month: 'short', day: 'numeric' }\n *\n * This makes sense because a user requesting a formatted date with numeric parts would\n * not expect to see the returned format containing narrow, short or long part names\n */\nfunction BestFitFormatMatcher (options, formats) {\n /** Diverging: this block implements the hack for single property configuration, eg.:\n *\n * `new Intl.DateTimeFormat('en', {day: 'numeric'})`\n *\n * should produce a single digit with the day of the month. This is needed because\n * CLDR `availableFormats` data structure doesn't cover these cases.\n */\n {\n const optionsPropNames = [];\n for (let property in dateTimeComponents) {\n if (!hop.call(dateTimeComponents, property))\n continue;\n\n if (options['[['+ property +']]'] !== undefined) {\n optionsPropNames.push(property);\n }\n }\n if (optionsPropNames.length === 1) {\n const bestFormat = generateSyntheticFormat(optionsPropNames[0], options['[['+ optionsPropNames[0] +']]']);\n if (bestFormat) {\n return bestFormat;\n }\n }\n }\n\n // 1. Let removalPenalty be 120.\n let removalPenalty = 120;\n\n // 2. Let additionPenalty be 20.\n let additionPenalty = 20;\n\n // 3. Let longLessPenalty be 8.\n let longLessPenalty = 8;\n\n // 4. Let longMorePenalty be 6.\n let longMorePenalty = 6;\n\n // 5. Let shortLessPenalty be 6.\n let shortLessPenalty = 6;\n\n // 6. Let shortMorePenalty be 3.\n let shortMorePenalty = 3;\n\n let patternPenalty = 2;\n\n let hour12Penalty = 1;\n\n // 7. Let bestScore be -Infinity.\n let bestScore = -Infinity;\n\n // 8. Let bestFormat be undefined.\n let bestFormat;\n\n // 9. Let i be 0.\n let i = 0;\n\n // 10. Assert: formats is an Array object.\n\n // 11. Let len be the result of calling the [[Get]] internal method of formats with argument \"length\".\n let len = formats.length;\n\n // 12. Repeat while i < len:\n while (i < len) {\n // a. Let format be the result of calling the [[Get]] internal method of formats with argument ToString(i).\n let format = formats[i];\n\n // b. Let score be 0.\n let score = 0;\n\n // c. For each property shown in Table 3:\n for (let property in dateTimeComponents) {\n if (!hop.call(dateTimeComponents, property))\n continue;\n\n // i. Let optionsProp be options.[[]].\n let optionsProp = options['[['+ property +']]'];\n\n // ii. Let formatPropDesc be the result of calling the [[GetOwnProperty]] internal method of format\n // with argument property.\n // iii. If formatPropDesc is not undefined, then\n // 1. Let formatProp be the result of calling the [[Get]] internal method of format with argument property.\n let formatProp = hop.call(format, property) ? format[property] : undefined;\n\n // Diverging: using the default properties produced by the pattern/skeleton\n // to match it with user options, and apply a penalty\n let patternProp = hop.call(format._, property) ? format._[property] : undefined;\n if (optionsProp !== patternProp) {\n score -= patternPenalty;\n }\n\n // iv. If optionsProp is undefined and formatProp is not undefined, then decrease score by\n // additionPenalty.\n if (optionsProp === undefined && formatProp !== undefined)\n score -= additionPenalty;\n\n // v. Else if optionsProp is not undefined and formatProp is undefined, then decrease score by\n // removalPenalty.\n else if (optionsProp !== undefined && formatProp === undefined)\n score -= removalPenalty;\n\n // vi. Else\n else {\n // 1. Let values be the array [\"2-digit\", \"numeric\", \"narrow\", \"short\",\n // \"long\"].\n let values = [ '2-digit', 'numeric', 'narrow', 'short', 'long' ];\n\n // 2. Let optionsPropIndex be the index of optionsProp within values.\n let optionsPropIndex = arrIndexOf.call(values, optionsProp);\n\n // 3. Let formatPropIndex be the index of formatProp within values.\n let formatPropIndex = arrIndexOf.call(values, formatProp);\n\n // 4. Let delta be max(min(formatPropIndex - optionsPropIndex, 2), -2).\n let delta = Math.max(Math.min(formatPropIndex - optionsPropIndex, 2), -2);\n\n {\n // diverging from spec\n // When the bestFit argument is true, subtract additional penalty where data types are not the same\n if ((formatPropIndex <= 1 && optionsPropIndex >= 2) || (formatPropIndex >= 2 && optionsPropIndex <= 1)) {\n // 5. If delta = 2, decrease score by longMorePenalty.\n if (delta > 0)\n score -= longMorePenalty;\n else if (delta < 0)\n score -= longLessPenalty;\n } else {\n // 5. If delta = 2, decrease score by longMorePenalty.\n if (delta > 1)\n score -= shortMorePenalty;\n else if (delta < -1)\n score -= shortLessPenalty;\n }\n }\n }\n }\n\n {\n // diverging to also take into consideration differences between 12 or 24 hours\n // which is special for the best fit only.\n if (format._.hour12 !== options.hour12) {\n score -= hour12Penalty;\n }\n }\n\n // d. If score > bestScore, then\n if (score > bestScore) {\n // i. Let bestScore be score.\n bestScore = score;\n // ii. Let bestFormat be format.\n bestFormat = format;\n }\n\n // e. Increase i by 1.\n i++;\n }\n\n // 13. Return bestFormat.\n return bestFormat;\n}\n\n/* 12.2.3 */internals.DateTimeFormat = {\n '[[availableLocales]]': [],\n '[[relevantExtensionKeys]]': ['ca', 'nu'],\n '[[localeData]]': {}\n};\n\n/**\n * When the supportedLocalesOf method of Intl.DateTimeFormat is called, the\n * following steps are taken:\n */\n/* 12.2.2 */\ndefineProperty(Intl.DateTimeFormat, 'supportedLocalesOf', {\n configurable: true,\n writable: true,\n value: fnBind.call(function (locales) {\n // Bound functions only have the `this` value altered if being used as a constructor,\n // this lets us imitate a native function that has no constructor\n if (!hop.call(this, '[[availableLocales]]'))\n throw new TypeError('supportedLocalesOf() is not a constructor');\n\n // Create an object whose props can be used to restore the values of RegExp props\n let regexpRestore = createRegExpRestore(),\n\n // 1. If options is not provided, then let options be undefined.\n options = arguments[1],\n\n // 2. Let availableLocales be the value of the [[availableLocales]] internal\n // property of the standard built-in object that is the initial value of\n // Intl.NumberFormat.\n\n availableLocales = this['[[availableLocales]]'],\n\n // 3. Let requestedLocales be the result of calling the CanonicalizeLocaleList\n // abstract operation (defined in 9.2.1) with argument locales.\n requestedLocales = CanonicalizeLocaleList(locales);\n\n // Restore the RegExp properties\n regexpRestore();\n\n // 4. Return the result of calling the SupportedLocales abstract operation\n // (defined in 9.2.8) with arguments availableLocales, requestedLocales,\n // and options.\n return SupportedLocales(availableLocales, requestedLocales, options);\n }, internals.NumberFormat)\n});\n\n/**\n * This named accessor property returns a function that formats a number\n * according to the effective locale and the formatting options of this\n * DateTimeFormat object.\n */\n/* 12.3.2 */defineProperty(Intl.DateTimeFormat.prototype, 'format', {\n configurable: true,\n get: GetFormatDateTime\n});\n\nfunction GetFormatDateTime() {\n let internal = this !== null && typeof this === 'object' && getInternalProperties(this);\n\n // Satisfy test 12.3_b\n if (!internal || !internal['[[initializedDateTimeFormat]]'])\n throw new TypeError('`this` value for format() is not an initialized Intl.DateTimeFormat object.');\n\n // The value of the [[Get]] attribute is a function that takes the following\n // steps:\n\n // 1. If the [[boundFormat]] internal property of this DateTimeFormat object\n // is undefined, then:\n if (internal['[[boundFormat]]'] === undefined) {\n // a. Let F be a Function object, with internal properties set as\n // specified for built-in functions in ES5, 15, or successor, and the\n // length property set to 0, that takes the argument date and\n // performs the following steps:\n let F = function (date = undefined) {\n // i. If date is not provided or is undefined, then let x be the\n // result as if by the expression Date.now() where Date.now is\n // the standard built-in function defined in ES5, 15.9.4.4.\n // ii. Else let x be ToNumber(date).\n // iii. Return the result of calling the FormatDateTime abstract\n // operation (defined below) with arguments this and x.\n let x = date === undefined ? Date.now() : toNumber(date);\n return FormatDateTime(this, x);\n };\n // b. Let bind be the standard built-in function object defined in ES5,\n // 15.3.4.5.\n // c. Let bf be the result of calling the [[Call]] internal method of\n // bind with F as the this value and an argument list containing\n // the single item this.\n let bf = fnBind.call(F, this);\n // d. Set the [[boundFormat]] internal property of this NumberFormat\n // object to bf.\n internal['[[boundFormat]]'] = bf;\n }\n // Return the value of the [[boundFormat]] internal property of this\n // NumberFormat object.\n return internal['[[boundFormat]]'];\n}\n\nfunction formatToParts(date = undefined) {\n let internal = this !== null && typeof this === 'object' && getInternalProperties(this);\n\n if (!internal || !internal['[[initializedDateTimeFormat]]'])\n throw new TypeError('`this` value for formatToParts() is not an initialized Intl.DateTimeFormat object.');\n\n let x = date === undefined ? Date.now() : toNumber(date);\n return FormatToPartsDateTime(this, x);\n}\n\nObject.defineProperty(Intl.DateTimeFormat.prototype, 'formatToParts', {\n enumerable: false,\n writable: true,\n configurable: true,\n value: formatToParts\n});\n\nfunction CreateDateTimeParts(dateTimeFormat, x) {\n // 1. If x is not a finite Number, then throw a RangeError exception.\n if (!isFinite(x))\n throw new RangeError('Invalid valid date passed to format');\n\n let internal = dateTimeFormat.__getInternalProperties(secret);\n\n // Creating restore point for properties on the RegExp object... please wait\n /* let regexpRestore = */createRegExpRestore(); // ###TODO: review this\n\n // 2. Let locale be the value of the [[locale]] internal property of dateTimeFormat.\n let locale = internal['[[locale]]'];\n\n // 3. Let nf be the result of creating a new NumberFormat object as if by the\n // expression new Intl.NumberFormat([locale], {useGrouping: false}) where\n // Intl.NumberFormat is the standard built-in constructor defined in 11.1.3.\n let nf = new Intl.NumberFormat([locale], {useGrouping: false});\n\n // 4. Let nf2 be the result of creating a new NumberFormat object as if by the\n // expression new Intl.NumberFormat([locale], {minimumIntegerDigits: 2, useGrouping:\n // false}) where Intl.NumberFormat is the standard built-in constructor defined in\n // 11.1.3.\n let nf2 = new Intl.NumberFormat([locale], {minimumIntegerDigits: 2, useGrouping: false});\n\n // 5. Let tm be the result of calling the ToLocalTime abstract operation (defined\n // below) with x, the value of the [[calendar]] internal property of dateTimeFormat,\n // and the value of the [[timeZone]] internal property of dateTimeFormat.\n let tm = ToLocalTime(x, internal['[[calendar]]'], internal['[[timeZone]]']);\n\n // 6. Let result be the value of the [[pattern]] internal property of dateTimeFormat.\n let pattern = internal['[[pattern]]'];\n\n // 7.\n let result = new List();\n\n // 8.\n let index = 0;\n\n // 9.\n let beginIndex = pattern.indexOf('{');\n\n // 10.\n let endIndex = 0;\n\n // Need the locale minus any extensions\n let dataLocale = internal['[[dataLocale]]'];\n\n // Need the calendar data from CLDR\n let localeData = internals.DateTimeFormat['[[localeData]]'][dataLocale].calendars;\n let ca = internal['[[calendar]]'];\n\n // 11.\n while (beginIndex !== -1) {\n let fv;\n // a.\n endIndex = pattern.indexOf('}', beginIndex);\n // b.\n if (endIndex === -1) {\n throw new Error('Unclosed pattern');\n }\n // c.\n if (beginIndex > index) {\n arrPush.call(result, {\n type: 'literal',\n value: pattern.substring(index, beginIndex)\n });\n }\n // d.\n let p = pattern.substring(beginIndex + 1, endIndex);\n // e.\n if (dateTimeComponents.hasOwnProperty(p)) {\n // i. Let f be the value of the [[

]] internal property of dateTimeFormat.\n let f = internal['[['+ p +']]'];\n // ii. Let v be the value of tm.[[

]].\n let v = tm['[['+ p +']]'];\n // iii. If p is \"year\" and v ≤ 0, then let v be 1 - v.\n if (p === 'year' && v <= 0) {\n v = 1 - v;\n }\n // iv. If p is \"month\", then increase v by 1.\n else if (p === 'month') {\n v++;\n }\n // v. If p is \"hour\" and the value of the [[hour12]] internal property of\n // dateTimeFormat is true, then\n else if (p === 'hour' && internal['[[hour12]]'] === true) {\n // 1. Let v be v modulo 12.\n v = v % 12;\n // 2. If v is 0 and the value of the [[hourNo0]] internal property of\n // dateTimeFormat is true, then let v be 12.\n if (v === 0 && internal['[[hourNo0]]'] === true) {\n v = 12;\n }\n }\n\n // vi. If f is \"numeric\", then\n if (f === 'numeric') {\n // 1. Let fv be the result of calling the FormatNumber abstract operation\n // (defined in 11.3.2) with arguments nf and v.\n fv = FormatNumber(nf, v);\n }\n // vii. Else if f is \"2-digit\", then\n else if (f === '2-digit') {\n // 1. Let fv be the result of calling the FormatNumber abstract operation\n // with arguments nf2 and v.\n fv = FormatNumber(nf2, v);\n // 2. If the length of fv is greater than 2, let fv be the substring of fv\n // containing the last two characters.\n if (fv.length > 2) {\n fv = fv.slice(-2);\n }\n }\n // viii. Else if f is \"narrow\", \"short\", or \"long\", then let fv be a String\n // value representing f in the desired form; the String value depends upon\n // the implementation and the effective locale and calendar of\n // dateTimeFormat. If p is \"month\", then the String value may also depend\n // on whether dateTimeFormat has a [[day]] internal property. If p is\n // \"timeZoneName\", then the String value may also depend on the value of\n // the [[inDST]] field of tm.\n else if (f in dateWidths) {\n switch (p) {\n case 'month':\n fv = resolveDateString(localeData, ca, 'months', f, tm['[['+ p +']]']);\n break;\n\n case 'weekday':\n try {\n fv = resolveDateString(localeData, ca, 'days', f, tm['[['+ p +']]']);\n // fv = resolveDateString(ca.days, f)[tm['[['+ p +']]']];\n } catch (e) {\n throw new Error('Could not find weekday data for locale '+locale);\n }\n break;\n\n case 'timeZoneName':\n fv = ''; // ###TODO\n break;\n\n case 'era':\n try {\n fv = resolveDateString(localeData, ca, 'eras', f, tm['[['+ p +']]']);\n } catch (e) {\n throw new Error('Could not find era data for locale '+locale);\n }\n break;\n\n default:\n fv = tm['[['+ p +']]'];\n }\n }\n // ix\n arrPush.call(result, {\n type: p,\n value: fv\n });\n // f.\n } else if (p === 'ampm') {\n // i.\n let v = tm['[[hour]]'];\n // ii./iii.\n fv = resolveDateString(localeData, ca, 'dayPeriods', v > 11 ? 'pm' : 'am', null);\n // iv.\n arrPush.call(result, {\n type: 'dayPeriod',\n value: fv\n });\n // g.\n } else {\n arrPush.call(result, {\n type: 'literal',\n value: pattern.substring(beginIndex, endIndex + 1)\n });\n }\n // h.\n index = endIndex + 1;\n // i.\n beginIndex = pattern.indexOf('{', index);\n }\n // 12.\n if (endIndex < pattern.length - 1) {\n arrPush.call(result, {\n type: 'literal',\n value: pattern.substr(endIndex + 1)\n });\n }\n // 13.\n return result;\n}\n\n/**\n * When the FormatDateTime abstract operation is called with arguments dateTimeFormat\n * (which must be an object initialized as a DateTimeFormat) and x (which must be a Number\n * value), it returns a String value representing x (interpreted as a time value as\n * specified in ES5, 15.9.1.1) according to the effective locale and the formatting\n * options of dateTimeFormat.\n */\nexport function FormatDateTime(dateTimeFormat, x) {\n let parts = CreateDateTimeParts(dateTimeFormat, x);\n let result = '';\n\n for (let i = 0; parts.length > i; i++) {\n let part = parts[i];\n result += part.value;\n }\n return result;\n}\n\nfunction FormatToPartsDateTime(dateTimeFormat, x) {\n let parts = CreateDateTimeParts(dateTimeFormat, x);\n let result = [];\n for (let i = 0; parts.length > i; i++) {\n let part = parts[i];\n result.push({\n type: part.type,\n value: part.value\n });\n }\n return result;\n}\n\n\n/**\n * When the ToLocalTime abstract operation is called with arguments date, calendar, and\n * timeZone, the following steps are taken:\n */\nfunction ToLocalTime(date, calendar, timeZone) {\n // 1. Apply calendrical calculations on date for the given calendar and time zone to\n // produce weekday, era, year, month, day, hour, minute, second, and inDST values.\n // The calculations should use best available information about the specified\n // calendar and time zone. If the calendar is \"gregory\", then the calculations must\n // match the algorithms specified in ES5, 15.9.1, except that calculations are not\n // bound by the restrictions on the use of best available information on time zones\n // for local time zone adjustment and daylight saving time adjustment imposed by\n // ES5, 15.9.1.7 and 15.9.1.8.\n // ###TODO###\n let d = new Date(date),\n m = 'get' + (timeZone || '');\n\n // 2. Return a Record with fields [[weekday]], [[era]], [[year]], [[month]], [[day]],\n // [[hour]], [[minute]], [[second]], and [[inDST]], each with the corresponding\n // calculated value.\n return new Record({\n '[[weekday]]': d[m + 'Day'](),\n '[[era]]' : +(d[m + 'FullYear']() >= 0),\n '[[year]]' : d[m + 'FullYear'](),\n '[[month]]' : d[m + 'Month'](),\n '[[day]]' : d[m + 'Date'](),\n '[[hour]]' : d[m + 'Hours'](),\n '[[minute]]' : d[m + 'Minutes'](),\n '[[second]]' : d[m + 'Seconds'](),\n '[[inDST]]' : false // ###TODO###\n });\n}\n\n/**\n * The function returns a new object whose properties and attributes are set as if\n * constructed by an object literal assigning to each of the following properties the\n * value of the corresponding internal property of this DateTimeFormat object (see 12.4):\n * locale, calendar, numberingSystem, timeZone, hour12, weekday, era, year, month, day,\n * hour, minute, second, and timeZoneName. Properties whose corresponding internal\n * properties are not present are not assigned.\n */\n/* 12.3.3 */defineProperty(Intl.DateTimeFormat.prototype, 'resolvedOptions', {\n writable: true,\n configurable: true,\n value: function () {\n let prop,\n descs = new Record(),\n props = [\n 'locale', 'calendar', 'numberingSystem', 'timeZone', 'hour12', 'weekday',\n 'era', 'year', 'month', 'day', 'hour', 'minute', 'second', 'timeZoneName'\n ],\n internal = this !== null && typeof this === 'object' && getInternalProperties(this);\n\n // Satisfy test 12.3_b\n if (!internal || !internal['[[initializedDateTimeFormat]]'])\n throw new TypeError('`this` value for resolvedOptions() is not an initialized Intl.DateTimeFormat object.');\n\n for (let i = 0, max = props.length; i < max; i++) {\n if (hop.call(internal, prop = '[[' + props[i] + ']]'))\n descs[props[i]] = { value: internal[prop], writable: true, configurable: true, enumerable: true };\n }\n\n return objCreate({}, descs);\n }\n});\n","import plurals from '../node_modules/make-plural/es6/plurals';\n\nimport {\n Intl\n} from './8.intl.js';\n\nimport {\n GetOption,\n SupportedLocales,\n ResolveLocale,\n CanonicalizeLocaleList\n} from './9.negotiation.js';\n\nimport {\n FormatNumberToString,\n SetNumberFormatDigitOptions\n} from './11.numberformat.js';\n\nimport {\n internals,\n getInternalProperties,\n Record,\n List,\n hop,\n objCreate,\n fnBind,\n toObject,\n secret,\n createRegExpRestore,\n defineProperty\n} from './util.js';\n\nexport function PluralRules() {\n let locales = arguments[0];\n let options = arguments[1];\n\n if (!this || this === Intl) {\n return new Intl.PluralRules(locales, options);\n }\n return InitializePluralRules(toObject(this), locales, options);\n}\n\ndefineProperty(Intl, 'PluralRules', {\n configurable: true,\n writable: true,\n value: PluralRules\n});\n\ndefineProperty(PluralRules, 'prototype', {\n writable: false\n});\n\nexport function InitializePluralRules (pluralRules, locales, options) {\n let internal = getInternalProperties(pluralRules);\n\n // 1. If pluralRules.[[InitializedIntlObject]] is true, throw a TypeError exception.\n if (internal['[[InitializedIntlObject]]'] === true)\n throw new TypeError('`this` object has already been initialized as an Intl object');\n\n defineProperty(pluralRules, '__getInternalProperties', {\n value: function () {\n // NOTE: Non-standard, for internal use only\n if (arguments[0] === secret)\n return internal;\n }\n });\n\n // 2. Set pluralRules.[[InitializedIntlObject]] to true.\n internal['[[InitializedIntlObject]]'] = true;\n\n // 3. Let requestedLocales be ? CanonicalizeLocaleList(locales).\n let requestedLocales = CanonicalizeLocaleList(locales);\n\n // 4. If options is undefined, then\n if (options === undefined)\n // a. Let options be ObjectCreate(%ObjectPrototype%).\n options = {};\n // 5. Else\n else\n // a. Let options be ? ToObject(options).\n options = toObject(options);\n\n // 6. Let t be ? GetOption(options, \"type\", \"string\", « \"cardinal\", \"ordinal\" », \"cardinal\").\n let t = GetOption(options, 'type', 'string', new List('cardinal', 'ordinal'), 'cardinal');\n\n // 7 . Set pluralRules.[[Type]] to t.\n internal['[[type]]'] = t;\n\n // 8. Let opt be a new Record.\n let opt = new Record();\n\n // 9. Let matcher be ? GetOption(options, \"localeMatcher\", \"string\", « \"lookup\", \"best fit\" », \"best fit\").\n let matcher = GetOption(options, 'localeMatcher', 'string', new List('lookup', 'best fit'), 'best fit');\n // 10. Set opt.[[localeMatcher]] to matcher.\n opt['[[localeMatcher]]'] = matcher;\n\n // 11. Perform ? SetNumberFormatOptions(pluralRules, options, 0).\n SetNumberFormatDigitOptions(internals, options, 0);\n\n // 12. If pluralRules.[[maximumFractionDigits]] is undefined, then\n if (internals['[[maximumFractionDigits]]'] === undefined) {\n // a. Set pluralRules.[[maximumFractionDigits]] to max(pluralRules.[[minimumFractionDigits]], 3).\n internals['[[maximumFractionDigits]]'] = Math.max(internals['[[minimumFractionDigits]]'], 3);\n }\n\n let localeData = internals.PluralRules['[[localeData]]'];\n\n // 13. Let r be ResolveLocale(%PluralRules%.[[AvailableLocales]], requestedLocales, opt).\n let r = ResolveLocale(\n internals.PluralRules['[[availableLocales]]'], requestedLocales,\n opt, internals.PluralRules['[[relevantExtensionKeys]]'], localeData\n );\n\n // 14. Set pluralRules.[[Locale]] to the value of r.[[Locale]].\n internal['[[locale]]'] = r['[[locale]]'];\n\n // 15. Set pluralRules.[[InitializedPluralRules]] to true.\n internal['[[InitializedPluralRules]]'] = true;\n\n // 16. Return pluralRules.\n return pluralRules;\n}\n\n// make-plurals handls GetOperands\nfunction PluralRuleSelection(locale, type, s) {\n for (let l = locale; l; l = l.replace(/[-_]?[^-_]*$/, '')) {\n const pf = plurals[l];\n if (pf) return pf(s, type === 'ordinal');\n }\n return 'other';\n}\n\nfunction ResolvePlural(pluralRules, n) {\n // 1. Assert: Type(pluralRules) is Object and pluralRules has an [[InitializedPluralRules]] internal slot whose value is true.\n\n // 2. Assert: Type(n) is Number.\n\n // 3. If isFinite(n) is false, then\n if (!Number.isFinite(n)) {\n // a. Return \"other\".\n return 'other';\n }\n\n let internal = getInternalProperties(pluralRules);\n\n // 4. Let locale be pluralRules.[[Locale]].\n let locale = internal['[[locale]]'];\n\n // 5. Let type be pluralRules.[[Type]].\n let type = internal['[[type]]'];\n\n // 8. Return ? PluralRuleSelection(locale, type, n, operands). \n return PluralRuleSelection(locale, type, n);\n}\n\ninternals.PluralRules = {\n '[[availableLocales]]' : Object.keys(plurals),\n '[[relevantExtensionKeys]]': [],\n '[[localeData]]': {}\n};\n\ndefineProperty(Intl.PluralRules, 'supportedLocalesOf', {\n configurable: true,\n writable: true,\n value: fnBind.call(function (locales) {\n // Bound functions only have the `this` value altered if being used as a constructor,\n // this lets us imitate a native function that has no constructor\n if (!hop.call(this, '[[availableLocales]]'))\n throw new TypeError('supportedLocalesOf() is not a constructor');\n\n // Create an object whose props can be used to restore the values of RegExp props\n let regexpRestore = createRegExpRestore(),\n\n // 1. If options is not provided, then let options be undefined.\n options = arguments[1],\n\n // 2. Let availableLocales be the value of the [[availableLocales]] internal\n // property of the standard built-in object that is the initial value of\n // Intl.NumberFormat.\n\n availableLocales = this['[[availableLocales]]'],\n\n // 3. Let requestedLocales be the result of calling the CanonicalizeLocaleList\n // abstract operation (defined in 9.2.1) with argument locales.\n requestedLocales = CanonicalizeLocaleList(locales);\n\n // Restore the RegExp properties\n regexpRestore();\n\n // 4. Return the result of calling the SupportedLocales abstract operation\n // (defined in 9.2.8) with arguments availableLocales, requestedLocales,\n // and options.\n return SupportedLocales(availableLocales, requestedLocales, options);\n }, internals.PluralRules)\n});\n\n\n\ndefineProperty(Intl.PluralRules.prototype, 'select', {\n configurable: true,\n value: function(value) {\n let pluralRules = this;\n let n = Number(value);\n return ResolvePlural(pluralRules, n);\n }\n});\n\ndefineProperty(Intl.PluralRules.prototype, 'resolvedOptions', {\n configurable: true,\n writable: true,\n value: function() {\n let prop,\n descs = new Record(),\n props = [\n 'locale', 'type',\n 'minimumIntegerDigits', 'minimumFractionDigits', 'maximumFractionDigits',\n 'minimumSignificantDigits', 'maximumSignificantDigits'\n ],\n internal = this !== null && typeof this === 'object' && getInternalProperties(this);\n\n if (!internal || !internal['[[InitializedPluralRules]]'])\n throw new TypeError('`this` value for resolvedOptions() is not an initialized Intl.PluralRules object.');\n\n for (let i = 0, max = props.length; i < max; i++) {\n if (hop.call(internal, prop = '[['+ props[i] +']]'))\n descs[props[i]] = { value: internal[prop], writable: true, configurable: true, enumerable: true };\n }\n\n return objCreate({}, descs);\n }\n});\n","/**\n * @license Copyright 2013 Andy Earnshaw, MIT License\n *\n * Implements the ECMAScript Internationalization API in ES5-compatible environments,\n * following the ECMA-402 specification as closely as possible\n *\n * ECMA-402: http://ecma-international.org/ecma-402/1.0/\n *\n * CLDR format locale data should be provided using IntlPolyfill.__addLocaleData().\n */\n\nimport {\n defineProperty,\n hop,\n arrPush,\n arrShift,\n internals\n} from \"./util.js\";\n\nimport {\n IsStructurallyValidLanguageTag,\n defaultLocale,\n setDefaultLocale\n} from \"./6.locales-currencies-tz.js\";\n\nimport {\n Intl\n} from \"./8.intl.js\";\n\nimport \"./11.numberformat.js\";\n\nimport \"./12.datetimeformat.js\";\n\nimport ls from \"./13.locale-sensitive-functions.js\";\n\nimport \"./14.pluralrules.js\";\n\ndefineProperty(Intl, '__applyLocaleSensitivePrototypes', {\n writable: true,\n configurable: true,\n value: function () {\n defineProperty(Number.prototype, 'toLocaleString', { writable: true, configurable: true, value: ls.Number.toLocaleString });\n // Need this here for IE 8, to avoid the _DontEnum_ bug\n defineProperty(Date.prototype, 'toLocaleString', { writable: true, configurable: true, value: ls.Date.toLocaleString });\n\n for (let k in ls.Date) {\n if (hop.call(ls.Date, k))\n defineProperty(Date.prototype, k, { writable: true, configurable: true, value: ls.Date[k] });\n }\n }\n});\n\n/**\n * Can't really ship a single script with data for hundreds of locales, so we provide\n * this __addLocaleData method as a means for the developer to add the data on an\n * as-needed basis\n */\ndefineProperty(Intl, '__addLocaleData', {\n value: function (data) {\n if (!IsStructurallyValidLanguageTag(data.locale))\n throw new Error(`Invalid language tag \"${data.locale}\" when calling __addLocaleData(\"${data.locale}\", ...) to register new locale data.`);\n\n addLocaleData(data, data.locale);\n }\n});\n\nfunction addLocaleData (data, tag) {\n // Both NumberFormat and DateTimeFormat require number data, so throw if it isn't present\n if (!data.number)\n throw new Error(\"Object passed doesn't contain locale data for Intl.NumberFormat\");\n\n let locale,\n locales = [ tag ],\n parts = tag.split('-');\n\n // Create fallbacks for locale data with scripts, e.g. Latn, Hans, Vaii, etc\n if (parts.length > 2 && parts[1].length === 4)\n arrPush.call(locales, parts[0] + '-' + parts[2]);\n\n while ((locale = arrShift.call(locales))) {\n // Add to NumberFormat internal properties as per 11.2.3\n arrPush.call(internals.NumberFormat['[[availableLocales]]'], locale);\n internals.NumberFormat['[[localeData]]'][locale] = data.number;\n\n // ...and DateTimeFormat internal properties as per 12.2.3\n if (data.date) {\n data.date.nu = data.number.nu;\n arrPush.call(internals.DateTimeFormat['[[availableLocales]]'], locale);\n internals.DateTimeFormat['[[localeData]]'][locale] = data.date;\n }\n }\n\n\n // If this is the first set of locale data added, make it the default\n if (defaultLocale === undefined)\n setDefaultLocale(tag);\n}\n\ndefineProperty(Intl, '__disableRegExpRestore', {\n value: function () {\n internals.disableRegExpRestore = true;\n }\n});\n\nexport default Intl;\n","/**\n* Defines regular expressions for various operations related to the BCP 47 syntax,\n* as defined at http://tools.ietf.org/html/bcp47#section-2.1\n*/\n\n// extlang = 3ALPHA ; selected ISO 639 codes\n// *2(\"-\" 3ALPHA) ; permanently reserved\nconst extlang = '[a-z]{3}(?:-[a-z]{3}){0,2}';\n\n// language = 2*3ALPHA ; shortest ISO 639 code\n// [\"-\" extlang] ; sometimes followed by\n// ; extended language subtags\n// / 4ALPHA ; or reserved for future use\n// / 5*8ALPHA ; or registered language subtag\nconst language = '(?:[a-z]{2,3}(?:-' + extlang + ')?|[a-z]{4}|[a-z]{5,8})';\n\n// script = 4ALPHA ; ISO 15924 code\nconst script = '[a-z]{4}';\n\n// region = 2ALPHA ; ISO 3166-1 code\n// / 3DIGIT ; UN M.49 code\nconst region = '(?:[a-z]{2}|\\\\d{3})';\n\n// variant = 5*8alphanum ; registered variants\n// / (DIGIT 3alphanum)\nconst variant = '(?:[a-z0-9]{5,8}|\\\\d[a-z0-9]{3})';\n\n// ; Single alphanumerics\n// ; \"x\" reserved for private use\n// singleton = DIGIT ; 0 - 9\n// / %x41-57 ; A - W\n// / %x59-5A ; Y - Z\n// / %x61-77 ; a - w\n// / %x79-7A ; y - z\nconst singleton = '[0-9a-wy-z]';\n\n// extension = singleton 1*(\"-\" (2*8alphanum))\nconst extension = singleton + '(?:-[a-z0-9]{2,8})+';\n\n// privateuse = \"x\" 1*(\"-\" (1*8alphanum))\nconst privateuse = 'x(?:-[a-z0-9]{1,8})+';\n\n// irregular = \"en-GB-oed\" ; irregular tags do not match\n// / \"i-ami\" ; the 'langtag' production and\n// / \"i-bnn\" ; would not otherwise be\n// / \"i-default\" ; considered 'well-formed'\n// / \"i-enochian\" ; These tags are all valid,\n// / \"i-hak\" ; but most are deprecated\n// / \"i-klingon\" ; in favor of more modern\n// / \"i-lux\" ; subtags or subtag\n// / \"i-mingo\" ; combination\n// / \"i-navajo\"\n// / \"i-pwn\"\n// / \"i-tao\"\n// / \"i-tay\"\n// / \"i-tsu\"\n// / \"sgn-BE-FR\"\n// / \"sgn-BE-NL\"\n// / \"sgn-CH-DE\"\nconst irregular = '(?:en-GB-oed'\n + '|i-(?:ami|bnn|default|enochian|hak|klingon|lux|mingo|navajo|pwn|tao|tay|tsu)'\n + '|sgn-(?:BE-FR|BE-NL|CH-DE))';\n\n// regular = \"art-lojban\" ; these tags match the 'langtag'\n// / \"cel-gaulish\" ; production, but their subtags\n// / \"no-bok\" ; are not extended language\n// / \"no-nyn\" ; or variant subtags: their meaning\n// / \"zh-guoyu\" ; is defined by their registration\n// / \"zh-hakka\" ; and all of these are deprecated\n// / \"zh-min\" ; in favor of a more modern\n// / \"zh-min-nan\" ; subtag or sequence of subtags\n// / \"zh-xiang\"\nconst regular = '(?:art-lojban|cel-gaulish|no-bok|no-nyn'\n + '|zh-(?:guoyu|hakka|min|min-nan|xiang))';\n\n// grandfathered = irregular ; non-redundant tags registered\n// / regular ; during the RFC 3066 era\nconst grandfathered = '(?:' + irregular + '|' + regular + ')';\n\n// langtag = language\n// [\"-\" script]\n// [\"-\" region]\n// *(\"-\" variant)\n// *(\"-\" extension)\n// [\"-\" privateuse]\nconst langtag = language + '(?:-' + script + ')?(?:-' + region + ')?(?:-'\n + variant + ')*(?:-' + extension + ')*(?:-' + privateuse + ')?';\n\n// Language-Tag = langtag ; normal language tags\n// / privateuse ; private use tag\n// / grandfathered ; grandfathered tags\nexport let expBCP47Syntax = RegExp('^(?:'+langtag+'|'+privateuse+'|'+grandfathered+')$', 'i');\n\n// Match duplicate variants in a language tag\nexport let expVariantDupes = RegExp('^(?!x).*?-('+variant+')-(?:\\\\w{4,8}-(?!x-))*\\\\1\\\\b', 'i');\n\n// Match duplicate singletons in a language tag (except in private use)\nexport let expSingletonDupes = RegExp('^(?!x).*?-('+singleton+')-(?:\\\\w+-(?!x-))*\\\\1\\\\b', 'i');\n\n// Match all extension sequences\nexport let expExtSequences = RegExp('-'+extension, 'ig');\n","// Sect 13 Locale Sensitive Functions of the ECMAScript Language Specification\n// ===========================================================================\n\nimport {\n Intl\n} from \"./8.intl.js\";\n\nimport {\n FormatNumber,\n NumberFormatConstructor\n} from \"./11.numberformat.js\";\n\nimport {\n ToDateTimeOptions,\n DateTimeFormatConstructor,\n FormatDateTime\n} from \"./12.datetimeformat.js\";\n\nlet ls = Intl.__localeSensitiveProtos = {\n Number: {},\n Date: {}\n};\n\n/**\n * When the toLocaleString method is called with optional arguments locales and options,\n * the following steps are taken:\n */\n/* 13.2.1 */ls.Number.toLocaleString = function () {\n // Satisfy test 13.2.1_1\n if (Object.prototype.toString.call(this) !== '[object Number]')\n throw new TypeError('`this` value must be a number for Number.prototype.toLocaleString()');\n\n // 1. Let x be this Number value (as defined in ES5, 15.7.4).\n // 2. If locales is not provided, then let locales be undefined.\n // 3. If options is not provided, then let options be undefined.\n // 4. Let numberFormat be the result of creating a new object as if by the\n // expression new Intl.NumberFormat(locales, options) where\n // Intl.NumberFormat is the standard built-in constructor defined in 11.1.3.\n // 5. Return the result of calling the FormatNumber abstract operation\n // (defined in 11.3.2) with arguments numberFormat and x.\n return FormatNumber(new NumberFormatConstructor(arguments[0], arguments[1]), this);\n};\n\n/**\n * When the toLocaleString method is called with optional arguments locales and options,\n * the following steps are taken:\n */\n/* 13.3.1 */ls.Date.toLocaleString = function () {\n // Satisfy test 13.3.0_1\n if (Object.prototype.toString.call(this) !== '[object Date]')\n throw new TypeError('`this` value must be a Date instance for Date.prototype.toLocaleString()');\n\n // 1. Let x be this time value (as defined in ES5, 15.9.5).\n let x = +this;\n\n // 2. If x is NaN, then return \"Invalid Date\".\n if (isNaN(x))\n return 'Invalid Date';\n\n // 3. If locales is not provided, then let locales be undefined.\n let locales = arguments[0];\n\n // 4. If options is not provided, then let options be undefined.\n let options = arguments[1];\n\n // 5. Let options be the result of calling the ToDateTimeOptions abstract\n // operation (defined in 12.1.1) with arguments options, \"any\", and \"all\".\n options = ToDateTimeOptions(options, 'any', 'all');\n\n // 6. Let dateTimeFormat be the result of creating a new object as if by the\n // expression new Intl.DateTimeFormat(locales, options) where\n // Intl.DateTimeFormat is the standard built-in constructor defined in 12.1.3.\n let dateTimeFormat = new DateTimeFormatConstructor(locales, options);\n\n // 7. Return the result of calling the FormatDateTime abstract operation (defined\n // in 12.3.2) with arguments dateTimeFormat and x.\n return FormatDateTime(dateTimeFormat, x);\n};\n\n/**\n * When the toLocaleDateString method is called with optional arguments locales and\n * options, the following steps are taken:\n */\n/* 13.3.2 */ls.Date.toLocaleDateString = function () {\n // Satisfy test 13.3.0_1\n if (Object.prototype.toString.call(this) !== '[object Date]')\n throw new TypeError('`this` value must be a Date instance for Date.prototype.toLocaleDateString()');\n\n // 1. Let x be this time value (as defined in ES5, 15.9.5).\n let x = +this;\n\n // 2. If x is NaN, then return \"Invalid Date\".\n if (isNaN(x))\n return 'Invalid Date';\n\n // 3. If locales is not provided, then let locales be undefined.\n let locales = arguments[0],\n\n // 4. If options is not provided, then let options be undefined.\n options = arguments[1];\n\n // 5. Let options be the result of calling the ToDateTimeOptions abstract\n // operation (defined in 12.1.1) with arguments options, \"date\", and \"date\".\n options = ToDateTimeOptions(options, 'date', 'date');\n\n // 6. Let dateTimeFormat be the result of creating a new object as if by the\n // expression new Intl.DateTimeFormat(locales, options) where\n // Intl.DateTimeFormat is the standard built-in constructor defined in 12.1.3.\n let dateTimeFormat = new DateTimeFormatConstructor(locales, options);\n\n // 7. Return the result of calling the FormatDateTime abstract operation (defined\n // in 12.3.2) with arguments dateTimeFormat and x.\n return FormatDateTime(dateTimeFormat, x);\n};\n\n/**\n * When the toLocaleTimeString method is called with optional arguments locales and\n * options, the following steps are taken:\n */\n/* 13.3.3 */ls.Date.toLocaleTimeString = function () {\n // Satisfy test 13.3.0_1\n if (Object.prototype.toString.call(this) !== '[object Date]')\n throw new TypeError('`this` value must be a Date instance for Date.prototype.toLocaleTimeString()');\n\n // 1. Let x be this time value (as defined in ES5, 15.9.5).\n let x = +this;\n\n // 2. If x is NaN, then return \"Invalid Date\".\n if (isNaN(x))\n return 'Invalid Date';\n\n // 3. If locales is not provided, then let locales be undefined.\n let locales = arguments[0];\n\n // 4. If options is not provided, then let options be undefined.\n let options = arguments[1];\n\n // 5. Let options be the result of calling the ToDateTimeOptions abstract\n // operation (defined in 12.1.1) with arguments options, \"time\", and \"time\".\n options = ToDateTimeOptions(options, 'time', 'time');\n\n // 6. Let dateTimeFormat be the result of creating a new object as if by the\n // expression new Intl.DateTimeFormat(locales, options) where\n // Intl.DateTimeFormat is the standard built-in constructor defined in 12.1.3.\n let dateTimeFormat = new DateTimeFormatConstructor(locales, options);\n\n // 7. Return the result of calling the FormatDateTime abstract operation (defined\n // in 12.3.2) with arguments dateTimeFormat and x.\n return FormatDateTime(dateTimeFormat, x);\n};\n\nexport default ls;\n","const _cp = [\nfunction(n, ord) {\n if (ord) return 'other';\n return 'other';\n},\nfunction(n, ord) {\n if (ord) return 'other';\n return (n == 1) ? 'one' : 'other';\n},\nfunction(n, ord) {\n if (ord) return 'other';\n return ((n == 0\n || n == 1)) ? 'one' : 'other';\n},\nfunction(n, ord) {\n var s = String(n).split('.'), v0 = !s[1];\n if (ord) return 'other';\n return (n == 1 && v0) ? 'one' : 'other';\n}\n];\n\nexport default {\naf: _cp[1],\n\nak: _cp[2],\n\nam: function(n, ord) {\n if (ord) return 'other';\n return (n >= 0 && n <= 1) ? 'one' : 'other';\n},\n\nar: function(n, ord) {\n var s = String(n).split('.'), t0 = Number(s[0]) == n,\n n100 = t0 && s[0].slice(-2);\n if (ord) return 'other';\n return (n == 0) ? 'zero'\n : (n == 1) ? 'one'\n : (n == 2) ? 'two'\n : ((n100 >= 3 && n100 <= 10)) ? 'few'\n : ((n100 >= 11 && n100 <= 99)) ? 'many'\n : 'other';\n},\n\nars: function(n, ord) {\n var s = String(n).split('.'), t0 = Number(s[0]) == n,\n n100 = t0 && s[0].slice(-2);\n if (ord) return 'other';\n return (n == 0) ? 'zero'\n : (n == 1) ? 'one'\n : (n == 2) ? 'two'\n : ((n100 >= 3 && n100 <= 10)) ? 'few'\n : ((n100 >= 11 && n100 <= 99)) ? 'many'\n : 'other';\n},\n\nas: function(n, ord) {\n if (ord) return ((n == 1 || n == 5 || n == 7 || n == 8 || n == 9\n || n == 10)) ? 'one'\n : ((n == 2\n || n == 3)) ? 'two'\n : (n == 4) ? 'few'\n : (n == 6) ? 'many'\n : 'other';\n return (n >= 0 && n <= 1) ? 'one' : 'other';\n},\n\nasa: _cp[1],\n\nast: _cp[3],\n\naz: function(n, ord) {\n var s = String(n).split('.'), i = s[0], i10 = i.slice(-1),\n i100 = i.slice(-2), i1000 = i.slice(-3);\n if (ord) return ((i10 == 1 || i10 == 2 || i10 == 5 || i10 == 7 || i10 == 8)\n || (i100 == 20 || i100 == 50 || i100 == 70\n || i100 == 80)) ? 'one'\n : ((i10 == 3 || i10 == 4) || (i1000 == 100 || i1000 == 200\n || i1000 == 300 || i1000 == 400 || i1000 == 500 || i1000 == 600 || i1000 == 700\n || i1000 == 800\n || i1000 == 900)) ? 'few'\n : (i == 0 || i10 == 6 || (i100 == 40 || i100 == 60\n || i100 == 90)) ? 'many'\n : 'other';\n return (n == 1) ? 'one' : 'other';\n},\n\nbe: function(n, ord) {\n var s = String(n).split('.'), t0 = Number(s[0]) == n,\n n10 = t0 && s[0].slice(-1), n100 = t0 && s[0].slice(-2);\n if (ord) return ((n10 == 2\n || n10 == 3) && n100 != 12 && n100 != 13) ? 'few' : 'other';\n return (n10 == 1 && n100 != 11) ? 'one'\n : ((n10 >= 2 && n10 <= 4) && (n100 < 12\n || n100 > 14)) ? 'few'\n : (t0 && n10 == 0 || (n10 >= 5 && n10 <= 9)\n || (n100 >= 11 && n100 <= 14)) ? 'many'\n : 'other';\n},\n\nbem: _cp[1],\n\nbez: _cp[1],\n\nbg: _cp[1],\n\nbh: _cp[2],\n\nbm: _cp[0],\n\nbn: function(n, ord) {\n if (ord) return ((n == 1 || n == 5 || n == 7 || n == 8 || n == 9\n || n == 10)) ? 'one'\n : ((n == 2\n || n == 3)) ? 'two'\n : (n == 4) ? 'few'\n : (n == 6) ? 'many'\n : 'other';\n return (n >= 0 && n <= 1) ? 'one' : 'other';\n},\n\nbo: _cp[0],\n\nbr: function(n, ord) {\n var s = String(n).split('.'), t0 = Number(s[0]) == n,\n n10 = t0 && s[0].slice(-1), n100 = t0 && s[0].slice(-2),\n n1000000 = t0 && s[0].slice(-6);\n if (ord) return 'other';\n return (n10 == 1 && n100 != 11 && n100 != 71 && n100 != 91) ? 'one'\n : (n10 == 2 && n100 != 12 && n100 != 72 && n100 != 92) ? 'two'\n : (((n10 == 3 || n10 == 4) || n10 == 9) && (n100 < 10\n || n100 > 19) && (n100 < 70 || n100 > 79) && (n100 < 90\n || n100 > 99)) ? 'few'\n : (n != 0 && t0 && n1000000 == 0) ? 'many'\n : 'other';\n},\n\nbrx: _cp[1],\n\nbs: function(n, ord) {\n var s = String(n).split('.'), i = s[0], f = s[1] || '', v0 = !s[1],\n i10 = i.slice(-1), i100 = i.slice(-2), f10 = f.slice(-1), f100 = f.slice(-2);\n if (ord) return 'other';\n return (v0 && i10 == 1 && i100 != 11\n || f10 == 1 && f100 != 11) ? 'one'\n : (v0 && (i10 >= 2 && i10 <= 4) && (i100 < 12 || i100 > 14)\n || (f10 >= 2 && f10 <= 4) && (f100 < 12\n || f100 > 14)) ? 'few'\n : 'other';\n},\n\nca: function(n, ord) {\n var s = String(n).split('.'), v0 = !s[1];\n if (ord) return ((n == 1\n || n == 3)) ? 'one'\n : (n == 2) ? 'two'\n : (n == 4) ? 'few'\n : 'other';\n return (n == 1 && v0) ? 'one' : 'other';\n},\n\nce: _cp[1],\n\ncgg: _cp[1],\n\nchr: _cp[1],\n\nckb: _cp[1],\n\ncs: function(n, ord) {\n var s = String(n).split('.'), i = s[0], v0 = !s[1];\n if (ord) return 'other';\n return (n == 1 && v0) ? 'one'\n : ((i >= 2 && i <= 4) && v0) ? 'few'\n : (!v0) ? 'many'\n : 'other';\n},\n\ncy: function(n, ord) {\n if (ord) return ((n == 0 || n == 7 || n == 8\n || n == 9)) ? 'zero'\n : (n == 1) ? 'one'\n : (n == 2) ? 'two'\n : ((n == 3\n || n == 4)) ? 'few'\n : ((n == 5\n || n == 6)) ? 'many'\n : 'other';\n return (n == 0) ? 'zero'\n : (n == 1) ? 'one'\n : (n == 2) ? 'two'\n : (n == 3) ? 'few'\n : (n == 6) ? 'many'\n : 'other';\n},\n\nda: function(n, ord) {\n var s = String(n).split('.'), i = s[0], t0 = Number(s[0]) == n;\n if (ord) return 'other';\n return (n == 1 || !t0 && (i == 0\n || i == 1)) ? 'one' : 'other';\n},\n\nde: _cp[3],\n\ndsb: function(n, ord) {\n var s = String(n).split('.'), i = s[0], f = s[1] || '', v0 = !s[1],\n i100 = i.slice(-2), f100 = f.slice(-2);\n if (ord) return 'other';\n return (v0 && i100 == 1\n || f100 == 1) ? 'one'\n : (v0 && i100 == 2\n || f100 == 2) ? 'two'\n : (v0 && (i100 == 3 || i100 == 4) || (f100 == 3\n || f100 == 4)) ? 'few'\n : 'other';\n},\n\ndv: _cp[1],\n\ndz: _cp[0],\n\nee: _cp[1],\n\nel: _cp[1],\n\nen: function(n, ord) {\n var s = String(n).split('.'), v0 = !s[1], t0 = Number(s[0]) == n,\n n10 = t0 && s[0].slice(-1), n100 = t0 && s[0].slice(-2);\n if (ord) return (n10 == 1 && n100 != 11) ? 'one'\n : (n10 == 2 && n100 != 12) ? 'two'\n : (n10 == 3 && n100 != 13) ? 'few'\n : 'other';\n return (n == 1 && v0) ? 'one' : 'other';\n},\n\neo: _cp[1],\n\nes: _cp[1],\n\net: _cp[3],\n\neu: _cp[1],\n\nfa: function(n, ord) {\n if (ord) return 'other';\n return (n >= 0 && n <= 1) ? 'one' : 'other';\n},\n\nff: function(n, ord) {\n if (ord) return 'other';\n return (n >= 0 && n < 2) ? 'one' : 'other';\n},\n\nfi: _cp[3],\n\nfil: function(n, ord) {\n var s = String(n).split('.'), i = s[0], f = s[1] || '', v0 = !s[1],\n i10 = i.slice(-1), f10 = f.slice(-1);\n if (ord) return (n == 1) ? 'one' : 'other';\n return (v0 && (i == 1 || i == 2 || i == 3)\n || v0 && i10 != 4 && i10 != 6 && i10 != 9\n || !v0 && f10 != 4 && f10 != 6 && f10 != 9) ? 'one' : 'other';\n},\n\nfo: _cp[1],\n\nfr: function(n, ord) {\n if (ord) return (n == 1) ? 'one' : 'other';\n return (n >= 0 && n < 2) ? 'one' : 'other';\n},\n\nfur: _cp[1],\n\nfy: _cp[3],\n\nga: function(n, ord) {\n var s = String(n).split('.'), t0 = Number(s[0]) == n;\n if (ord) return (n == 1) ? 'one' : 'other';\n return (n == 1) ? 'one'\n : (n == 2) ? 'two'\n : ((t0 && n >= 3 && n <= 6)) ? 'few'\n : ((t0 && n >= 7 && n <= 10)) ? 'many'\n : 'other';\n},\n\ngd: function(n, ord) {\n var s = String(n).split('.'), t0 = Number(s[0]) == n;\n if (ord) return 'other';\n return ((n == 1\n || n == 11)) ? 'one'\n : ((n == 2\n || n == 12)) ? 'two'\n : (((t0 && n >= 3 && n <= 10)\n || (t0 && n >= 13 && n <= 19))) ? 'few'\n : 'other';\n},\n\ngl: _cp[3],\n\ngsw: _cp[1],\n\ngu: function(n, ord) {\n if (ord) return (n == 1) ? 'one'\n : ((n == 2\n || n == 3)) ? 'two'\n : (n == 4) ? 'few'\n : (n == 6) ? 'many'\n : 'other';\n return (n >= 0 && n <= 1) ? 'one' : 'other';\n},\n\nguw: _cp[2],\n\ngv: function(n, ord) {\n var s = String(n).split('.'), i = s[0], v0 = !s[1], i10 = i.slice(-1),\n i100 = i.slice(-2);\n if (ord) return 'other';\n return (v0 && i10 == 1) ? 'one'\n : (v0 && i10 == 2) ? 'two'\n : (v0 && (i100 == 0 || i100 == 20 || i100 == 40 || i100 == 60\n || i100 == 80)) ? 'few'\n : (!v0) ? 'many'\n : 'other';\n},\n\nha: _cp[1],\n\nhaw: _cp[1],\n\nhe: function(n, ord) {\n var s = String(n).split('.'), i = s[0], v0 = !s[1], t0 = Number(s[0]) == n,\n n10 = t0 && s[0].slice(-1);\n if (ord) return 'other';\n return (n == 1 && v0) ? 'one'\n : (i == 2 && v0) ? 'two'\n : (v0 && (n < 0\n || n > 10) && t0 && n10 == 0) ? 'many'\n : 'other';\n},\n\nhi: function(n, ord) {\n if (ord) return (n == 1) ? 'one'\n : ((n == 2\n || n == 3)) ? 'two'\n : (n == 4) ? 'few'\n : (n == 6) ? 'many'\n : 'other';\n return (n >= 0 && n <= 1) ? 'one' : 'other';\n},\n\nhr: function(n, ord) {\n var s = String(n).split('.'), i = s[0], f = s[1] || '', v0 = !s[1],\n i10 = i.slice(-1), i100 = i.slice(-2), f10 = f.slice(-1), f100 = f.slice(-2);\n if (ord) return 'other';\n return (v0 && i10 == 1 && i100 != 11\n || f10 == 1 && f100 != 11) ? 'one'\n : (v0 && (i10 >= 2 && i10 <= 4) && (i100 < 12 || i100 > 14)\n || (f10 >= 2 && f10 <= 4) && (f100 < 12\n || f100 > 14)) ? 'few'\n : 'other';\n},\n\nhsb: function(n, ord) {\n var s = String(n).split('.'), i = s[0], f = s[1] || '', v0 = !s[1],\n i100 = i.slice(-2), f100 = f.slice(-2);\n if (ord) return 'other';\n return (v0 && i100 == 1\n || f100 == 1) ? 'one'\n : (v0 && i100 == 2\n || f100 == 2) ? 'two'\n : (v0 && (i100 == 3 || i100 == 4) || (f100 == 3\n || f100 == 4)) ? 'few'\n : 'other';\n},\n\nhu: function(n, ord) {\n if (ord) return ((n == 1\n || n == 5)) ? 'one' : 'other';\n return (n == 1) ? 'one' : 'other';\n},\n\nhy: function(n, ord) {\n if (ord) return (n == 1) ? 'one' : 'other';\n return (n >= 0 && n < 2) ? 'one' : 'other';\n},\n\nid: _cp[0],\n\nig: _cp[0],\n\nii: _cp[0],\n\n\"in\": _cp[0],\n\nis: function(n, ord) {\n var s = String(n).split('.'), i = s[0], t0 = Number(s[0]) == n,\n i10 = i.slice(-1), i100 = i.slice(-2);\n if (ord) return 'other';\n return (t0 && i10 == 1 && i100 != 11\n || !t0) ? 'one' : 'other';\n},\n\nit: function(n, ord) {\n var s = String(n).split('.'), v0 = !s[1];\n if (ord) return ((n == 11 || n == 8 || n == 80\n || n == 800)) ? 'many' : 'other';\n return (n == 1 && v0) ? 'one' : 'other';\n},\n\niu: function(n, ord) {\n if (ord) return 'other';\n return (n == 1) ? 'one'\n : (n == 2) ? 'two'\n : 'other';\n},\n\niw: function(n, ord) {\n var s = String(n).split('.'), i = s[0], v0 = !s[1], t0 = Number(s[0]) == n,\n n10 = t0 && s[0].slice(-1);\n if (ord) return 'other';\n return (n == 1 && v0) ? 'one'\n : (i == 2 && v0) ? 'two'\n : (v0 && (n < 0\n || n > 10) && t0 && n10 == 0) ? 'many'\n : 'other';\n},\n\nja: _cp[0],\n\njbo: _cp[0],\n\njgo: _cp[1],\n\nji: _cp[3],\n\njmc: _cp[1],\n\njv: _cp[0],\n\njw: _cp[0],\n\nka: function(n, ord) {\n var s = String(n).split('.'), i = s[0], i100 = i.slice(-2);\n if (ord) return (i == 1) ? 'one'\n : (i == 0 || ((i100 >= 2 && i100 <= 20) || i100 == 40 || i100 == 60\n || i100 == 80)) ? 'many'\n : 'other';\n return (n == 1) ? 'one' : 'other';\n},\n\nkab: function(n, ord) {\n if (ord) return 'other';\n return (n >= 0 && n < 2) ? 'one' : 'other';\n},\n\nkaj: _cp[1],\n\nkcg: _cp[1],\n\nkde: _cp[0],\n\nkea: _cp[0],\n\nkk: function(n, ord) {\n var s = String(n).split('.'), t0 = Number(s[0]) == n,\n n10 = t0 && s[0].slice(-1);\n if (ord) return (n10 == 6 || n10 == 9\n || t0 && n10 == 0 && n != 0) ? 'many' : 'other';\n return (n == 1) ? 'one' : 'other';\n},\n\nkkj: _cp[1],\n\nkl: _cp[1],\n\nkm: _cp[0],\n\nkn: function(n, ord) {\n if (ord) return 'other';\n return (n >= 0 && n <= 1) ? 'one' : 'other';\n},\n\nko: _cp[0],\n\nks: _cp[1],\n\nksb: _cp[1],\n\nksh: function(n, ord) {\n if (ord) return 'other';\n return (n == 0) ? 'zero'\n : (n == 1) ? 'one'\n : 'other';\n},\n\nku: _cp[1],\n\nkw: function(n, ord) {\n if (ord) return 'other';\n return (n == 1) ? 'one'\n : (n == 2) ? 'two'\n : 'other';\n},\n\nky: _cp[1],\n\nlag: function(n, ord) {\n var s = String(n).split('.'), i = s[0];\n if (ord) return 'other';\n return (n == 0) ? 'zero'\n : ((i == 0\n || i == 1) && n != 0) ? 'one'\n : 'other';\n},\n\nlb: _cp[1],\n\nlg: _cp[1],\n\nlkt: _cp[0],\n\nln: _cp[2],\n\nlo: function(n, ord) {\n if (ord) return (n == 1) ? 'one' : 'other';\n return 'other';\n},\n\nlt: function(n, ord) {\n var s = String(n).split('.'), f = s[1] || '', t0 = Number(s[0]) == n,\n n10 = t0 && s[0].slice(-1), n100 = t0 && s[0].slice(-2);\n if (ord) return 'other';\n return (n10 == 1 && (n100 < 11\n || n100 > 19)) ? 'one'\n : ((n10 >= 2 && n10 <= 9) && (n100 < 11\n || n100 > 19)) ? 'few'\n : (f != 0) ? 'many'\n : 'other';\n},\n\nlv: function(n, ord) {\n var s = String(n).split('.'), f = s[1] || '', v = f.length,\n t0 = Number(s[0]) == n, n10 = t0 && s[0].slice(-1),\n n100 = t0 && s[0].slice(-2), f100 = f.slice(-2), f10 = f.slice(-1);\n if (ord) return 'other';\n return (t0 && n10 == 0 || (n100 >= 11 && n100 <= 19)\n || v == 2 && (f100 >= 11 && f100 <= 19)) ? 'zero'\n : (n10 == 1 && n100 != 11 || v == 2 && f10 == 1 && f100 != 11\n || v != 2 && f10 == 1) ? 'one'\n : 'other';\n},\n\nmas: _cp[1],\n\nmg: _cp[2],\n\nmgo: _cp[1],\n\nmk: function(n, ord) {\n var s = String(n).split('.'), i = s[0], f = s[1] || '', v0 = !s[1],\n i10 = i.slice(-1), i100 = i.slice(-2), f10 = f.slice(-1);\n if (ord) return (i10 == 1 && i100 != 11) ? 'one'\n : (i10 == 2 && i100 != 12) ? 'two'\n : ((i10 == 7\n || i10 == 8) && i100 != 17 && i100 != 18) ? 'many'\n : 'other';\n return (v0 && i10 == 1\n || f10 == 1) ? 'one' : 'other';\n},\n\nml: _cp[1],\n\nmn: _cp[1],\n\nmo: function(n, ord) {\n var s = String(n).split('.'), v0 = !s[1], t0 = Number(s[0]) == n,\n n100 = t0 && s[0].slice(-2);\n if (ord) return (n == 1) ? 'one' : 'other';\n return (n == 1 && v0) ? 'one'\n : (!v0 || n == 0\n || n != 1 && (n100 >= 1 && n100 <= 19)) ? 'few'\n : 'other';\n},\n\nmr: function(n, ord) {\n if (ord) return (n == 1) ? 'one'\n : ((n == 2\n || n == 3)) ? 'two'\n : (n == 4) ? 'few'\n : 'other';\n return (n >= 0 && n <= 1) ? 'one' : 'other';\n},\n\nms: function(n, ord) {\n if (ord) return (n == 1) ? 'one' : 'other';\n return 'other';\n},\n\nmt: function(n, ord) {\n var s = String(n).split('.'), t0 = Number(s[0]) == n,\n n100 = t0 && s[0].slice(-2);\n if (ord) return 'other';\n return (n == 1) ? 'one'\n : (n == 0\n || (n100 >= 2 && n100 <= 10)) ? 'few'\n : ((n100 >= 11 && n100 <= 19)) ? 'many'\n : 'other';\n},\n\nmy: _cp[0],\n\nnah: _cp[1],\n\nnaq: function(n, ord) {\n if (ord) return 'other';\n return (n == 1) ? 'one'\n : (n == 2) ? 'two'\n : 'other';\n},\n\nnb: _cp[1],\n\nnd: _cp[1],\n\nne: function(n, ord) {\n var s = String(n).split('.'), t0 = Number(s[0]) == n;\n if (ord) return ((t0 && n >= 1 && n <= 4)) ? 'one' : 'other';\n return (n == 1) ? 'one' : 'other';\n},\n\nnl: _cp[3],\n\nnn: _cp[1],\n\nnnh: _cp[1],\n\nno: _cp[1],\n\nnqo: _cp[0],\n\nnr: _cp[1],\n\nnso: _cp[2],\n\nny: _cp[1],\n\nnyn: _cp[1],\n\nom: _cp[1],\n\nor: _cp[1],\n\nos: _cp[1],\n\npa: _cp[2],\n\npap: _cp[1],\n\npl: function(n, ord) {\n var s = String(n).split('.'), i = s[0], v0 = !s[1], i10 = i.slice(-1),\n i100 = i.slice(-2);\n if (ord) return 'other';\n return (n == 1 && v0) ? 'one'\n : (v0 && (i10 >= 2 && i10 <= 4) && (i100 < 12\n || i100 > 14)) ? 'few'\n : (v0 && i != 1 && (i10 == 0 || i10 == 1)\n || v0 && (i10 >= 5 && i10 <= 9)\n || v0 && (i100 >= 12 && i100 <= 14)) ? 'many'\n : 'other';\n},\n\nprg: function(n, ord) {\n var s = String(n).split('.'), f = s[1] || '', v = f.length,\n t0 = Number(s[0]) == n, n10 = t0 && s[0].slice(-1),\n n100 = t0 && s[0].slice(-2), f100 = f.slice(-2), f10 = f.slice(-1);\n if (ord) return 'other';\n return (t0 && n10 == 0 || (n100 >= 11 && n100 <= 19)\n || v == 2 && (f100 >= 11 && f100 <= 19)) ? 'zero'\n : (n10 == 1 && n100 != 11 || v == 2 && f10 == 1 && f100 != 11\n || v != 2 && f10 == 1) ? 'one'\n : 'other';\n},\n\nps: _cp[1],\n\npt: function(n, ord) {\n var s = String(n).split('.'), t0 = Number(s[0]) == n;\n if (ord) return 'other';\n return ((t0 && n >= 0 && n <= 2) && n != 2) ? 'one' : 'other';\n},\n\n\"pt-PT\": _cp[3],\n\nrm: _cp[1],\n\nro: function(n, ord) {\n var s = String(n).split('.'), v0 = !s[1], t0 = Number(s[0]) == n,\n n100 = t0 && s[0].slice(-2);\n if (ord) return (n == 1) ? 'one' : 'other';\n return (n == 1 && v0) ? 'one'\n : (!v0 || n == 0\n || n != 1 && (n100 >= 1 && n100 <= 19)) ? 'few'\n : 'other';\n},\n\nrof: _cp[1],\n\nroot: _cp[0],\n\nru: function(n, ord) {\n var s = String(n).split('.'), i = s[0], v0 = !s[1], i10 = i.slice(-1),\n i100 = i.slice(-2);\n if (ord) return 'other';\n return (v0 && i10 == 1 && i100 != 11) ? 'one'\n : (v0 && (i10 >= 2 && i10 <= 4) && (i100 < 12\n || i100 > 14)) ? 'few'\n : (v0 && i10 == 0 || v0 && (i10 >= 5 && i10 <= 9)\n || v0 && (i100 >= 11 && i100 <= 14)) ? 'many'\n : 'other';\n},\n\nrwk: _cp[1],\n\nsah: _cp[0],\n\nsaq: _cp[1],\n\nsdh: _cp[1],\n\nse: function(n, ord) {\n if (ord) return 'other';\n return (n == 1) ? 'one'\n : (n == 2) ? 'two'\n : 'other';\n},\n\nseh: _cp[1],\n\nses: _cp[0],\n\nsg: _cp[0],\n\nsh: function(n, ord) {\n var s = String(n).split('.'), i = s[0], f = s[1] || '', v0 = !s[1],\n i10 = i.slice(-1), i100 = i.slice(-2), f10 = f.slice(-1), f100 = f.slice(-2);\n if (ord) return 'other';\n return (v0 && i10 == 1 && i100 != 11\n || f10 == 1 && f100 != 11) ? 'one'\n : (v0 && (i10 >= 2 && i10 <= 4) && (i100 < 12 || i100 > 14)\n || (f10 >= 2 && f10 <= 4) && (f100 < 12\n || f100 > 14)) ? 'few'\n : 'other';\n},\n\nshi: function(n, ord) {\n var s = String(n).split('.'), t0 = Number(s[0]) == n;\n if (ord) return 'other';\n return (n >= 0 && n <= 1) ? 'one'\n : ((t0 && n >= 2 && n <= 10)) ? 'few'\n : 'other';\n},\n\nsi: function(n, ord) {\n var s = String(n).split('.'), i = s[0], f = s[1] || '';\n if (ord) return 'other';\n return ((n == 0 || n == 1)\n || i == 0 && f == 1) ? 'one' : 'other';\n},\n\nsk: function(n, ord) {\n var s = String(n).split('.'), i = s[0], v0 = !s[1];\n if (ord) return 'other';\n return (n == 1 && v0) ? 'one'\n : ((i >= 2 && i <= 4) && v0) ? 'few'\n : (!v0) ? 'many'\n : 'other';\n},\n\nsl: function(n, ord) {\n var s = String(n).split('.'), i = s[0], v0 = !s[1], i100 = i.slice(-2);\n if (ord) return 'other';\n return (v0 && i100 == 1) ? 'one'\n : (v0 && i100 == 2) ? 'two'\n : (v0 && (i100 == 3 || i100 == 4)\n || !v0) ? 'few'\n : 'other';\n},\n\nsma: function(n, ord) {\n if (ord) return 'other';\n return (n == 1) ? 'one'\n : (n == 2) ? 'two'\n : 'other';\n},\n\nsmi: function(n, ord) {\n if (ord) return 'other';\n return (n == 1) ? 'one'\n : (n == 2) ? 'two'\n : 'other';\n},\n\nsmj: function(n, ord) {\n if (ord) return 'other';\n return (n == 1) ? 'one'\n : (n == 2) ? 'two'\n : 'other';\n},\n\nsmn: function(n, ord) {\n if (ord) return 'other';\n return (n == 1) ? 'one'\n : (n == 2) ? 'two'\n : 'other';\n},\n\nsms: function(n, ord) {\n if (ord) return 'other';\n return (n == 1) ? 'one'\n : (n == 2) ? 'two'\n : 'other';\n},\n\nsn: _cp[1],\n\nso: _cp[1],\n\nsq: function(n, ord) {\n var s = String(n).split('.'), t0 = Number(s[0]) == n,\n n10 = t0 && s[0].slice(-1), n100 = t0 && s[0].slice(-2);\n if (ord) return (n == 1) ? 'one'\n : (n10 == 4 && n100 != 14) ? 'many'\n : 'other';\n return (n == 1) ? 'one' : 'other';\n},\n\nsr: function(n, ord) {\n var s = String(n).split('.'), i = s[0], f = s[1] || '', v0 = !s[1],\n i10 = i.slice(-1), i100 = i.slice(-2), f10 = f.slice(-1), f100 = f.slice(-2);\n if (ord) return 'other';\n return (v0 && i10 == 1 && i100 != 11\n || f10 == 1 && f100 != 11) ? 'one'\n : (v0 && (i10 >= 2 && i10 <= 4) && (i100 < 12 || i100 > 14)\n || (f10 >= 2 && f10 <= 4) && (f100 < 12\n || f100 > 14)) ? 'few'\n : 'other';\n},\n\nss: _cp[1],\n\nssy: _cp[1],\n\nst: _cp[1],\n\nsv: function(n, ord) {\n var s = String(n).split('.'), v0 = !s[1], t0 = Number(s[0]) == n,\n n10 = t0 && s[0].slice(-1), n100 = t0 && s[0].slice(-2);\n if (ord) return ((n10 == 1\n || n10 == 2) && n100 != 11 && n100 != 12) ? 'one' : 'other';\n return (n == 1 && v0) ? 'one' : 'other';\n},\n\nsw: _cp[3],\n\nsyr: _cp[1],\n\nta: _cp[1],\n\nte: _cp[1],\n\nteo: _cp[1],\n\nth: _cp[0],\n\nti: _cp[2],\n\ntig: _cp[1],\n\ntk: _cp[1],\n\ntl: function(n, ord) {\n var s = String(n).split('.'), i = s[0], f = s[1] || '', v0 = !s[1],\n i10 = i.slice(-1), f10 = f.slice(-1);\n if (ord) return (n == 1) ? 'one' : 'other';\n return (v0 && (i == 1 || i == 2 || i == 3)\n || v0 && i10 != 4 && i10 != 6 && i10 != 9\n || !v0 && f10 != 4 && f10 != 6 && f10 != 9) ? 'one' : 'other';\n},\n\ntn: _cp[1],\n\nto: _cp[0],\n\ntr: _cp[1],\n\nts: _cp[1],\n\ntzm: function(n, ord) {\n var s = String(n).split('.'), t0 = Number(s[0]) == n;\n if (ord) return 'other';\n return ((n == 0 || n == 1)\n || (t0 && n >= 11 && n <= 99)) ? 'one' : 'other';\n},\n\nug: _cp[1],\n\nuk: function(n, ord) {\n var s = String(n).split('.'), i = s[0], v0 = !s[1], t0 = Number(s[0]) == n,\n n10 = t0 && s[0].slice(-1), n100 = t0 && s[0].slice(-2), i10 = i.slice(-1),\n i100 = i.slice(-2);\n if (ord) return (n10 == 3 && n100 != 13) ? 'few' : 'other';\n return (v0 && i10 == 1 && i100 != 11) ? 'one'\n : (v0 && (i10 >= 2 && i10 <= 4) && (i100 < 12\n || i100 > 14)) ? 'few'\n : (v0 && i10 == 0 || v0 && (i10 >= 5 && i10 <= 9)\n || v0 && (i100 >= 11 && i100 <= 14)) ? 'many'\n : 'other';\n},\n\nur: _cp[3],\n\nuz: _cp[1],\n\nve: _cp[1],\n\nvi: function(n, ord) {\n if (ord) return (n == 1) ? 'one' : 'other';\n return 'other';\n},\n\nvo: _cp[1],\n\nvun: _cp[1],\n\nwa: _cp[2],\n\nwae: _cp[1],\n\nwo: _cp[0],\n\nxh: _cp[1],\n\nxog: _cp[1],\n\nyi: _cp[3],\n\nyo: _cp[0],\n\nyue: _cp[0],\n\nzh: _cp[0],\n\nzu: function(n, ord) {\n if (ord) return 'other';\n return (n >= 0 && n <= 1) ? 'one' : 'other';\n}\n}\n","import IntlPolyfill from \"./core.js\";\n\n// hack to export the polyfill as global Intl if needed\nif (typeof Intl === 'undefined') {\n try {\n window.Intl = IntlPolyfill;\n IntlPolyfill.__applyLocaleSensitivePrototypes();\n } catch (e) {\n // can be read only property\n }\n}\n\nexport default IntlPolyfill;\n"],"names":["log10Floor","n","Math","log10","floor","x","round","log","LOG10E","Number","Record","obj","k","hop","call","defineProperty","this","value","enumerable","writable","configurable","List","arguments","length","arrPush","apply","arrSlice","createRegExpRestore","internals","disableRegExpRestore","regExpCache","RegExp","lastMatch","leftContext","multiline","input","has","i","esc","replace","exprStr","m","substring","indexOf","match","expr","lastIndex","exec","toObject","arg","TypeError","Object","toNumber","toInteger","number","isNaN","Infinity","abs","toLength","len","pow","min","getInternalProperties","__getInternalProperties","secret","objCreate","setDefaultLocale","locale","toLatinUpperCase","str","ch","charAt","slice","toUpperCase","IsStructurallyValidLanguageTag","expBCP47Syntax","test","expVariantDupes","expSingletonDupes","CanonicalizeLanguageTag","parts","toLowerCase","split","max","arrJoin","expExtSequences","sort","source","redundantTags","tags","subtags","extLang","DefaultLocale","defaultLocale","IsWellFormedCurrencyCode","currency","c","String","normalized","expCurrencyCode","CanonicalizeLocaleList","locales","undefined","seen","O","Pk","kValue","tag","RangeError","arrIndexOf","BestAvailableLocale","availableLocales","candidate","pos","lastIndexOf","LookupMatcher","requestedLocales","availableLocale","noExtensionsLocale","expUnicodeExSeq","result","extension","extensionIndex","BestFitMatcher","UnicodeExtensionSubtags","size","extensionSubtags","attribute","q","p","t","codePointAt","type","push","key","attr","tail","ResolveLocale","options","relevantExtensionKeys","localeData","ReferenceError","matcher","r","foundLocale","extensionSubtagsLength","supportedExtension","foundLocaleData","keyLocaleData","supportedExtensionAddition","keyPos","requestedValue","valuePos","optionsValue","privateIndex","LookupSupportedLocales","subset","BestFitSupportedLocales","SupportedLocales","localeMatcher","P","e","GetOption","property","values","fallback","Boolean","GetNumberOption","minimum","maximum","getCanonicalLocales","ll","NumberFormatConstructor","Intl","InitializeNumberFormat","NumberFormat","SetNumberFormatDigitOptions","intlObj","mnfdDefault","mnid","mnfd","mxfd","mnsd","minimumSignificantDigits","mxsd","maximumSignificantDigits","numberFormat","internal","regexpRestore","opt","dataLocale","s","cDigits","CurrencyDigits","cd","g","dataLocaleData","patterns","stylePatterns","positivePattern","negativePattern","es3","format","GetFormatNumber","currencyMinorUnits","babelHelpers","F","FormatNumber","bf","fnBind","formatToParts","FormatNumberToParts","PartitionNumberPattern","part","FormatNumberToString","ToRawPrecision","ToRawFixed","nums","data","ild","symbols","latn","pattern","beginIndex","endIndex","nextIndex","Error","literal","[[type]]","[[value]]","nan","isFinite","numSys","digits","digit","integer","fraction","decimalSepIndex","groupSepSymbol","group","groups","pgSize","primaryGroupSize","sgSize","secondaryGroupSize","end","idx","start","integerGroup","arrShift","decimalSepSymbol","decimal","infinity","plusSignSymbol","plusSign","minusSignSymbol","minusSign","percentSignSymbol","percentSign","currencies","minPrecision","maxPrecision","Array","f","exp","LN10","cut","minInteger","minFraction","maxFraction","toFixed","int","a","isDateFormatOnly","tmKeys","hasOwnProperty","isTimeFormatOnly","dtKeys","joinDateAndTimeFormats","dateFormatObj","timeFormatObj","o","_","j","computeFinalPatterns","formatObj","pattern12","extendedPattern","$0","expPatternTrimmer","expDTComponentsMeta","era","year","quarter","month","week","day","weekday","hour12","hour","minute","second","timeZoneName","createDateTimeFormat","skeleton","unwantedDTCs","expDTComponents","createDateTimeFormats","formats","availableFormats","timeFormats","dateFormats","computed","timeRelatedFormats","dateRelatedFormats","full","long","medium","short","originalPattern","generateSyntheticFormat","propName","propValue","validSyntheticProps","resolveDateString","ca","component","width","gregory","alts","resolved","DateTimeFormatConstructor","InitializeDateTimeFormat","DateTimeFormat","dateTimeFormat","ToDateTimeOptions","tz","timeZone","prop","dateTimeComponents","bestFormat","ToDateTimeFormats","BasicFormatMatcher","hr12","BestFitFormatMatcher","hourNo0","GetFormatDateTime","prototype","toString","required","defaults","opt2","needDefaults","bestScore","score","optionsProp","formatProp","optionsPropIndex","formatPropIndex","delta","optionsPropNames","patternProp","date","FormatDateTime","Date","now","FormatToPartsDateTime","CreateDateTimeParts","nf","useGrouping","nf2","minimumIntegerDigits","tm","ToLocalTime","index","calendars","fv","v","dateWidths","substr","calendar","d","PluralRules","InitializePluralRules","pluralRules","PluralRuleSelection","l","pf","plurals","ResolvePlural","addLocaleData","nu","realDefineProp","sentinel","__defineGetter__","name","desc","get","search","create","proto","props","arrConcat","concat","join","shift","Function","bind","thisObj","fn","args","random","variant","singleton","BYR","XOF","BIF","XAF","CLF","CLP","KMF","DJF","GNF","ISK","IQD","JPY","JOD","KRW","KWD","LYD","PYG","RWF","TND","UGX","UYI","VUV","VND","descs","narrow","ls","__localeSensitiveProtos","toLocaleString","toLocaleDateString","toLocaleTimeString","_cp","ord","v0","t0","n100","i10","i100","i1000","n10","n1000000","f10","f100","keys","IntlPolyfill","__applyLocaleSensitivePrototypes"],"mappings":"uLAmGA,SAAgBA,GAAYC,MAEE,kBAAfC,MAAKC,MACZ,MAAOD,MAAKE,MAAMF,KAAKC,MAAMF,OAE7BI,GAAIH,KAAKI,MAAMJ,KAAKK,IAAIN,GAAKC,KAAKM,cAC/BH,IAAKI,OAAO,KAAOJ,GAAKJ,GAMnC,QAAgBS,GAAQC,OAEf,GAAIC,KAAKD,IACNA,YAAeD,IAAUG,GAAIC,KAAKH,EAAKC,KACvCG,GAAeC,KAAMJ,GAAKK,MAAON,EAAIC,GAAIM,YAAY,EAAMC,UAAU,EAAMC,cAAc,IAQrG,QAAgBC,QACGL,KAAM,UAAYG,UAAS,EAAMF,MAAO,IAEnDK,UAAUC,QACVC,GAAQC,MAAMT,KAAMU,GAASZ,KAAKQ,YAO1C,QAAgBK,QACRC,GAAUC,2BACH,kBAYN,GATDC,cACeC,OAAOC,WAAa,eAClBD,OAAOE,sBACTF,OAAOG,gBACXH,OAAOI,OAElBC,GAAM,EAGDC,EAAI,EAAGA,GAAK,EAAGA,OACbP,EAAY,IAAIO,GAAKN,OAAO,IAAIM,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A,cACA,kBACI,cACJ,gBACG,aACH,cACA,cACA,cACA,eACC,cACA,iBACG,kBACA,kBACA,iBACD,iBACA,mBACE,iBACF,eACF,eACA,eACA,eACA,eACA,eACA,eACA,eACA,eACA,eACA,eACA,eACA,eACA,eACA,eACA,eACA,eACA,eACA,eACA,eACA,oBACK,yBACA,oBACL,eACA,eACA,mBAGN,QACA,QACA,QACA,QACA,QACA,YACI,aACF,QACF,QACA,QACA,QACA,SACC,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,qBAGC,MAAO,WACP,MAAO,WACP,MAAO,WACP,MAAO,WACP,MAAO,WACP,MAAO,WACP,MAAO,WACP,MAAO,WACP,MAAO,WACP,MAAO,YACP,MAAO,WACP,MAAO,WACP,MAAO,YACP,MAAO,YACP,MAAO,WACP,MAAO,YACP,MAAO,WACP,MAAO,WACP,MAAO,WACP,MAAO,WACP,MAAO,WACP,MAAO,WACP,MAAO,WACP,MAAO,WACP,MAAO,YACP,MAAO,YACP,MAAO,YACP,MAAO,YACP,MAAO,YACP,MAAO,WACP,MAAO,WACP,MAAO,WACP,MAAO,WACP,MAAO,WACP,MAAO,WACP,MAAO,WACP,MAAO,YACP,MAAO,YACP,MAAO,WACP,MAAO,YACP,MAAO,YACP,MAAO,YACP,MAAO,WACP,MAAO,WACP,MAAO,YACP,MAAO,WACP,MAAO,YACP,MAAO,WACP,MAAO,YACP,MAAO,WACP,MAAO,WACP,MAAO,WACP,MAAO,WACP,MAAO,YACP,MAAO,YACP,MAAO,YACP,MAAO,YACP,MAAO,YACP,MAAO,YACP,MAAO,YACP,MAAO,YACP,MAAO,YACP,MAAO,WACP,MAAO,WACP,MAAO,YACP,MAAO,YACP,MAAO,YACP,MAAO,WACP,MAAO,YACP,MAAO,YACP,MAAO,YACP,MAAO,YACP,MAAO,YACP,MAAO,YACP,MAAO,YACP,MAAO,YACP,MAAO,YACP,MAAO,WACP,MAAO,YACP,MAAO,YACP,MAAO,YACP,MAAO,YACP,MAAO,YACP,MAAO,YACP,MAAO,YACP,MAAO,YACP,MAAO,YACP,MAAO,WACP,MAAO,YACP,MAAO,WACP,MAAO,YACP,MAAO,YACP,MAAO,YACP,MAAO,YACP,MAAO,YACP,MAAO,WACP,MAAO,YACP,MAAO,YACP,MAAO,YACP,MAAO,YACP,MAAO,YACP,MAAO,YACP,MAAO,YACP,MAAO,WACP,MAAO,WACP,MAAO,YACP,MAAO,YACP,MAAO,YACP,MAAO,YACP,MAAO,YACP,MAAO,YACP,MAAO,YACP,MAAO,YACP,MAAO,WACP,MAAO,YACP,MAAO,WACP,MAAO,WACP,MAAO,YACP,MAAO,WACP,MAAO,WACP,MAAO,WACP,MAAO,YACP,MAAO,YACP,MAAO,YACP,MAAO,YACP,MAAO,YACP,MAAO,YACP,MAAO,YACP,MAAO,WACP,MAAO,WACP,MAAO,WACP,MAAO,WACP,MAAO,YACP,MAAO,WACP,MAAO,WACP,MAAO,WACP,MAAO,YACP,MAAO,WACP,MAAO,WACP,MAAO,WACP,MAAO,YACP,MAAO,YACP,MAAO,WACP,MAAO,YACP,MAAO,WACP,MAAO,YACP,MAAO,YACP,MAAO,YACP,MAAO,WACP,MAAO,YACP,MAAO,YACP,MAAO,YACP,MAAO,YACP,MAAO,YACP,MAAO,YACP,MAAO,YACP,MAAO,YACP,MAAO,WACP,MAAO,WACP,MAAO,WACP,MAAO,WACP,MAAO,YACP,MAAO,YACP,MAAO,YACP,MAAO,YACP,MAAO,YACP,MAAO,WACP,MAAO,YACP,MAAO,YACP,MAAO,YACP,MAAO,YACP,MAAO,YACP,MAAO,YACP,MAAO,YACP,MAAO,YACP,MAAO,YACP,MAAO,YACP,MAAO,YACP,MAAO,YACP,MAAO,YACP,MAAO,YACP,MAAO,WACP,MAAO,YACP,MAAO,YACP,MAAO,YACP,MAAO,YACP,MAAO,WACP,MAAO,YACP,MAAO,YACP,MAAO,YACP,MAAO,WACP,MA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