diff --git a/dist/Intl.js b/dist/Intl.js index 615d21cb1..5a1b2c4a6 100644 --- a/dist/Intl.js +++ b/dist/Intl.js @@ -2126,7 +2126,8 @@ var m = n === 0 ? "0" : n.toFixed(0); // divering... { - // this diversion is needed to take into consideration big numbers + // this diversion is needed to take into consideration big numbers, e.g.: + // 1.2344501e+37 -> 12344501000000000000000000000000000000 var idx = void 0; var exp = (idx = m.indexOf('e')) > -1 ? m.slice(idx + 1) : 0; if (exp) { diff --git a/dist/Intl.js.map b/dist/Intl.js.map index 93ef164b5..9ef32cfef 100644 --- a/dist/Intl.js.map +++ b/dist/Intl.js.map @@ -1 +1 @@ -{"version":3,"file":"Intl.js","sources":["../src/util.js","../src/exp.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/13.locale-sensitive-functions.js","../src/core.js","../src/main.js"],"sourcesContent":["const realDefineProp = (function () {\n let sentinel = {};\n try {\n Object.defineProperty(sentinel, 'a', {});\n return 'a' in sentinel;\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 let esc = /[.?*+^$[\\]\\\\(){}|-]/g,\n lm = RegExp.lastMatch || '',\n ml = RegExp.multiline ? 'm' : '',\n ret = { input: RegExp.input },\n reg = new List(),\n has = false,\n cap = {};\n\n // Create a snapshot of all the 'captured' properties\n for (let i = 1; i <= 9; i++)\n has = (cap['$'+i] = RegExp['$'+i]) || has;\n\n // Now we've snapshotted some properties, escape the lastMatch string\n lm = lm.replace(esc, '\\\\$&');\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 = cap['$'+i];\n\n // If it's empty, add an empty capturing group\n if (!m)\n lm = '()' + lm;\n\n // Else find the string in lm and escape & wrap it to capture it\n else {\n m = m.replace(esc, '\\\\$&');\n lm = lm.replace(m, '(' + m + ')');\n }\n\n // Push it to the reg and chop lm to make sure further groups come after\n arrPush.call(reg, lm.slice(0, lm.indexOf('(') + 1));\n lm = lm.slice(lm.indexOf('(') + 1);\n }\n }\n\n // Create the regular expression that will reconstruct the RegExp properties\n ret.exp = new RegExp(arrJoin.call(reg, '') + lm, ml);\n\n return ret;\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 return Object(arg);\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","/**\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 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 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 = 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/**\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 split be the standard built-in function object defined in ES5,\n // 15.5.4.14.\n let split = String.prototype.split;\n // c. Let extensionSubtags be the result of calling the [[Call]] internal\n // method of split with extension as the this value and an argument\n // list containing the single item \"-\".\n extensionSubtags = split.call(extension, '-');\n // d. Let extensionSubtagsLength be the result of calling the [[Get]]\n // internal method of extensionSubtags with argument \"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 // \"Freeze\" the array so no new elements can be added\n defineProperty(subset, 'length', { writable: false });\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]\nIntl.getCanonicalLocales = function (locales) {\n // 1. Let ll be ? CanonicalizeLocaleList(locales).\n let ll = CanonicalizeLocaleList(locales);\n // 2. Return CreateArrayFromList(ll).\n {\n let result = [];\n for (let code in ll) {\n result.push(ll[code]);\n }\n return result;\n }\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 * 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.1.1 */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 regexpState = 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 NumberFormat be the standard built-in object that is the initial value\n // of Intl.NumberFormat.\n // 10. Let localeData be the value of the [[localeData]] internal property of\n // NumberFormat.\n let localeData = internals.NumberFormat['[[localeData]]'];\n\n // 11. 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 // 12. Set the [[locale]] internal property of numberFormat to the value of\n // r.[[locale]].\n internal['[[locale]]'] = r['[[locale]]'];\n\n // 13. 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 // 14. Let dataLocale be the value of r.[[dataLocale]].\n let dataLocale = r['[[dataLocale]]'];\n\n // 15. 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 // 16. Set the [[style]] internal property of numberFormat to s.\n internal['[[style]]'] = s;\n\n // 17. 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 // 18. 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 // 19. 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 // 20. 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 // 21. 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 // 22. 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 // 23. Let mnid be the result of calling the GetNumberOption abstract operation\n // (defined in 9.2.10) with arguments options, \"minimumIntegerDigits\", 1, 21,\n // and 1.\n let mnid = GetNumberOption(options, 'minimumIntegerDigits', 1, 21, 1);\n\n // 24. Set the [[minimumIntegerDigits]] internal property of numberFormat to mnid.\n internal['[[minimumIntegerDigits]]'] = mnid;\n\n // 25. If s is \"currency\", then let mnfdDefault be cDigits; else let mnfdDefault\n // be 0.\n let mnfdDefault = s === 'currency' ? cDigits : 0;\n\n // 26. Let mnfd be the result of calling the GetNumberOption abstract operation\n // with arguments options, \"minimumFractionDigits\", 0, 20, and mnfdDefault.\n let mnfd = GetNumberOption(options, 'minimumFractionDigits', 0, 20, mnfdDefault);\n\n // 27. Set the [[minimumFractionDigits]] internal property of numberFormat to mnfd.\n internal['[[minimumFractionDigits]]'] = mnfd;\n\n // 28. If s is \"currency\", then let mxfdDefault be max(mnfd, cDigits); else if s\n // is \"percent\", then let mxfdDefault be max(mnfd, 0); else let mxfdDefault\n // be max(mnfd, 3).\n let mxfdDefault = s === 'currency' ? Math.max(mnfd, cDigits)\n : (s === 'percent' ? Math.max(mnfd, 0) : Math.max(mnfd, 3));\n\n // 29. Let mxfd be the result of calling the GetNumberOption abstract operation\n // with arguments options, \"maximumFractionDigits\", mnfd, 20, and mxfdDefault.\n let mxfd = GetNumberOption(options, 'maximumFractionDigits', mnfd, 20, mxfdDefault);\n\n // 30. Set the [[maximumFractionDigits]] internal property of numberFormat to mxfd.\n internal['[[maximumFractionDigits]]'] = mxfd;\n\n // 31. Let mnsd be the result of calling the [[Get]] internal method of options\n // with argument \"minimumSignificantDigits\".\n let mnsd = options.minimumSignificantDigits;\n\n // 32. Let mxsd be the result of calling the [[Get]] internal method of options\n // with argument \"maximumSignificantDigits\".\n let mxsd = options.maximumSignificantDigits;\n\n // 33. If mnsd is not undefined or mxsd is not undefined, then:\n if (mnsd !== undefined || mxsd !== undefined) {\n // a. Let mnsd be the result of calling the GetNumberOption abstract\n // operation with arguments options, \"minimumSignificantDigits\", 1, 21,\n // and 1.\n mnsd = GetNumberOption(options, 'minimumSignificantDigits', 1, 21, 1);\n\n // b. Let mxsd be the result of calling the GetNumberOption abstract\n // operation with arguments options, \"maximumSignificantDigits\", mnsd,\n // 21, and 21.\n mxsd = GetNumberOption(options, 'maximumSignificantDigits', mnsd, 21, 21);\n\n // c. Set the [[minimumSignificantDigits]] internal property of numberFormat\n // to mnsd, and the [[maximumSignificantDigits]] internal property of\n // numberFormat to mxsd.\n internal['[[minimumSignificantDigits]]'] = mnsd;\n internal['[[maximumSignificantDigits]]'] = mxsd;\n }\n // 34. 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 // 35. Set the [[useGrouping]] internal property of numberFormat to g.\n internal['[[useGrouping]]'] = g;\n\n // 36. Let dataLocaleData be the result of calling the [[Get]] internal method of\n // localeData with argument dataLocale.\n let dataLocaleData = localeData[dataLocale];\n\n // 37. Let patterns be the result of calling the [[Get]] internal method of\n // dataLocaleData with argument \"patterns\".\n let patterns = dataLocaleData.patterns;\n\n // 38. Assert: patterns is an object (see 11.2.3)\n\n // 39. Let stylePatterns be the result of calling the [[Get]] internal method of\n // patterns with argument s.\n let stylePatterns = patterns[s];\n\n // 40. 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 // 41. 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 // 42. Set the [[boundFormat]] internal property of numberFormat to undefined.\n internal['[[boundFormat]]'] = undefined;\n\n // 43. 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 regexpState.exp.test(regexpState.input);\n\n // 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 regexpState = 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 regexpState.exp.test(regexpState.input);\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\nIntl.NumberFormat.prototype.formatToParts = function(value) {\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\n/*\n * @spec[stasm/ecma402/number-format-to-parts/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 idx in parts) {\n let part = parts[idx];\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[stasm/ecma402/number-format-to-parts/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 // a. 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 // a. If endIndex = -1, throw new Error exception.\n if (endIndex === -1) throw new Error();\n // a. 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 // a. Let p be the substring of pattern from position beginIndex, exclusive, to position endIndex, exclusive.\n let p = pattern.substring(beginIndex + 1, endIndex);\n // a. 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 the value of numberFormat.[[style]] is \"percent\" and isFinite(x), let x be 100 × x.\n if (internal['[[style]]'] === 'percent' && isFinite(x)) x *= 100;\n\n let n;\n // 2. If the numberFormat.[[minimumSignificantDigits]] and numberFormat.[[maximumSignificantDigits]] are present, then\n if (hop.call(internal, '[[minimumSignificantDigits]]') && hop.call(internal, '[[maximumSignificantDigits]]')) {\n // a. Let n be ToRawPrecision(x, numberFormat.[[minimumSignificantDigits]], numberFormat.[[maximumSignificantDigits]]).\n n = ToRawPrecision(x, internal['[[minimumSignificantDigits]]'], internal['[[maximumSignificantDigits]]']);\n }\n // 3. Else,\n else {\n // a. Let n be ToRawFixed(x, numberFormat.[[minimumIntegerDigits]], numberFormat.[[minimumFractionDigits]], numberFormat.[[maximumFractionDigits]]).\n n = ToRawFixed(x, internal['[[minimumIntegerDigits]]'], internal['[[minimumFractionDigits]]'], internal['[[maximumFractionDigits]]']);\n }\n // 4. If the value of the numberFormat.[[numberingSystem]] matches one of the values in the \"Numbering System\" column of Table 2 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 // 5. 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 // 6. Let decimalSepIndex be Call(%StringProto_indexOf%, n, \".\", 0).\n let decimalSepIndex = n.indexOf('.', 0);\n // 7. 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 // a. 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 // 8. Else:\n else {\n // a. Let integer be n.\n integer = n;\n // a. Let fraction be undefined.\n fraction = undefined;\n }\n // 9. 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 // a. 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 = new List();\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 // a. Assert: The number of elements in groups List is greater than 0.\n if (groups.length === 0) throw new Error();\n // a. 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 // 10. 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 // 11. 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 // a. 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 // a. 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 // a. 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 // a. 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 // a. 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 // a. 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 // ii. If numberFormat.[[currencyDisplay]] is \"code\", then\n if (internal['[[currencyDisplay]]'] === \"code\") {\n // 1. Let cd be currency.\n cd = currency;\n }\n // iii. 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 // iv. 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 // v. 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 // a. 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 // a. Set nextIndex to endIndex + 1.\n nextIndex = endIndex + 1;\n // a. 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 // a. 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[stasm/ecma402/number-format-to-parts/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 idx in parts) {\n let part = parts[idx];\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\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 = [\"weekday\", \"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","// 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 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 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 regexpState = 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 regexpState.exp.test(regexpState.input);\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\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 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 // 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 regexpState = 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 regexpState.exp.test(regexpState.input);\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\ndefineProperty(Intl.DateTimeFormat.prototype, 'formatToParts', {\n configurable: true,\n get: GetFormatToPartsDateTime,\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 () {\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 = Number(arguments.length === 0 ? Date.now() : arguments[0]);\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 GetFormatToPartsDateTime() {\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 if (internal['[[boundFormatToParts]]'] === undefined) {\n let F = function () {\n let x = Number(arguments.length === 0 ? Date.now() : arguments[0]);\n return FormatToPartsDateTime(this, x);\n };\n let bf = fnBind.call(F, this);\n internal['[[boundFormatToParts]]'] = bf;\n }\n return internal['[[boundFormatToParts]]'];\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 regexpState = */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 part in parts) {\n result += parts[part].value;\n }\n return result;\n}\n\nfunction FormatToPartsDateTime(dateTimeFormat, x) {\n let parts = CreateDateTimeParts(dateTimeFormat, x);\n let result = [];\n for (let part in parts) {\n result.push({\n type: parts[part].type,\n value: parts[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","// 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","/**\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\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(\"Object passed doesn't identify itself with a valid language tag\");\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 // If this is the first set of locale data added, make it the default\n if (defaultLocale === undefined)\n setDefaultLocale(tag);\n}\n\nexport default Intl;\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 Intl = IntlPolyfill;\n IntlPolyfill.__applyLocaleSensitivePrototypes();\n } catch (e) {\n // can be read only property\n }\n}\n\nexport default IntlPolyfill;\n"],"names":["Intl","IntlPolyfill"],"mappings":";;;;;;;;;;;;;;IAAA,IAAM,iBAAkB,YAAY;AAC5B,IAAA,QAAI,WAAW,EAAf;AACA,IAAA,QAAI;AACA,IAAA,eAAO,cAAP,CAAsB,QAAtB,EAAgC,GAAhC,EAAqC,EAArC;AACA,IAAA,eAAO,OAAO,QAAd;AACH,IAAA,KAHD,CAGE,OA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Q,IAAR,CAAa,UAAU,YAAV,CAAuB,sBAAvB,CAAb,EAA6D,MAA7D;AACA,IAAA,kBAAU,YAAV,CAAuB,gBAAvB,EAAyC,MAAzC,IAAmD,KAAK,MAAxD;;;AAGA,IAAA,YAAI,KAAK,IAAT,EAAe;AACX,IAAA,iBAAK,IAAL,CAAU,EAAV,GAAe,KAAK,MAAL,CAAY,EAA3B;AACA,IAAA,oBAAQ,IAAR,CAAa,UAAU,cAAV,CAAyB,sBAAzB,CAAb,EAA+D,MAA/D;AACA,IAAA,sBAAU,cAAV,CAAyB,gBAAzB,EAA2C,MAA3C,IAAqD,KAAK,IAA1D;AACH,IAAA;AACJ,IAAA;;;AAGD,IAAA,QAAI,kBAAkB,SAAtB,EACI,iBAAiB,GAAjB;AACP,IAAA;;;AC1FD,IAAA,IAAI,OAAO,IAAP,KAAgB,WAApB,EAAiC;AAC7B,IAAA,QAAI;AACA,IAAA,eAAOC,MAAP;AACA,IAAA,eAAa,gCAAb;AACH,IAAA,KAHD,CAGE,OAAO,CAAP,EAAU;;AAEX,IAAA;AACJ,IAAA;;;;"} \ No newline at end of file +{"version":3,"file":"Intl.js","sources":["../src/util.js","../src/exp.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/13.locale-sensitive-functions.js","../src/core.js","../src/main.js"],"sourcesContent":["const realDefineProp = (function () {\n let sentinel = {};\n try {\n Object.defineProperty(sentinel, 'a', {});\n return 'a' in sentinel;\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 let esc = /[.?*+^$[\\]\\\\(){}|-]/g,\n lm = RegExp.lastMatch || '',\n ml = RegExp.multiline ? 'm' : '',\n ret = { input: RegExp.input },\n reg = new List(),\n has = false,\n cap = {};\n\n // Create a snapshot of all the 'captured' properties\n for (let i = 1; i <= 9; i++)\n has = (cap['$'+i] = RegExp['$'+i]) || has;\n\n // Now we've snapshotted some properties, escape the lastMatch string\n lm = lm.replace(esc, '\\\\$&');\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 = cap['$'+i];\n\n // If it's empty, add an empty capturing group\n if (!m)\n lm = '()' + lm;\n\n // Else find the string in lm and escape & wrap it to capture it\n else {\n m = m.replace(esc, '\\\\$&');\n lm = lm.replace(m, '(' + m + ')');\n }\n\n // Push it to the reg and chop lm to make sure further groups come after\n arrPush.call(reg, lm.slice(0, lm.indexOf('(') + 1));\n lm = lm.slice(lm.indexOf('(') + 1);\n }\n }\n\n // Create the regular expression that will reconstruct the RegExp properties\n ret.exp = new RegExp(arrJoin.call(reg, '') + lm, ml);\n\n return ret;\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 return Object(arg);\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","/**\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 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 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 = 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/**\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 split be the standard built-in function object defined in ES5,\n // 15.5.4.14.\n let split = String.prototype.split;\n // c. Let extensionSubtags be the result of calling the [[Call]] internal\n // method of split with extension as the this value and an argument\n // list containing the single item \"-\".\n extensionSubtags = split.call(extension, '-');\n // d. Let extensionSubtagsLength be the result of calling the [[Get]]\n // internal method of extensionSubtags with argument \"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 // \"Freeze\" the array so no new elements can be added\n defineProperty(subset, 'length', { writable: false });\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]\nIntl.getCanonicalLocales = function (locales) {\n // 1. Let ll be ? CanonicalizeLocaleList(locales).\n let ll = CanonicalizeLocaleList(locales);\n // 2. Return CreateArrayFromList(ll).\n {\n let result = [];\n for (let code in ll) {\n result.push(ll[code]);\n }\n return result;\n }\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 * 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.1.1 */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 regexpState = 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 NumberFormat be the standard built-in object that is the initial value\n // of Intl.NumberFormat.\n // 10. Let localeData be the value of the [[localeData]] internal property of\n // NumberFormat.\n let localeData = internals.NumberFormat['[[localeData]]'];\n\n // 11. 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 // 12. Set the [[locale]] internal property of numberFormat to the value of\n // r.[[locale]].\n internal['[[locale]]'] = r['[[locale]]'];\n\n // 13. 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 // 14. Let dataLocale be the value of r.[[dataLocale]].\n let dataLocale = r['[[dataLocale]]'];\n\n // 15. 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 // 16. Set the [[style]] internal property of numberFormat to s.\n internal['[[style]]'] = s;\n\n // 17. 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 // 18. 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 // 19. 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 // 20. 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 // 21. 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 // 22. 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 // 23. Let mnid be the result of calling the GetNumberOption abstract operation\n // (defined in 9.2.10) with arguments options, \"minimumIntegerDigits\", 1, 21,\n // and 1.\n let mnid = GetNumberOption(options, 'minimumIntegerDigits', 1, 21, 1);\n\n // 24. Set the [[minimumIntegerDigits]] internal property of numberFormat to mnid.\n internal['[[minimumIntegerDigits]]'] = mnid;\n\n // 25. If s is \"currency\", then let mnfdDefault be cDigits; else let mnfdDefault\n // be 0.\n let mnfdDefault = s === 'currency' ? cDigits : 0;\n\n // 26. Let mnfd be the result of calling the GetNumberOption abstract operation\n // with arguments options, \"minimumFractionDigits\", 0, 20, and mnfdDefault.\n let mnfd = GetNumberOption(options, 'minimumFractionDigits', 0, 20, mnfdDefault);\n\n // 27. Set the [[minimumFractionDigits]] internal property of numberFormat to mnfd.\n internal['[[minimumFractionDigits]]'] = mnfd;\n\n // 28. If s is \"currency\", then let mxfdDefault be max(mnfd, cDigits); else if s\n // is \"percent\", then let mxfdDefault be max(mnfd, 0); else let mxfdDefault\n // be max(mnfd, 3).\n let mxfdDefault = s === 'currency' ? Math.max(mnfd, cDigits)\n : (s === 'percent' ? Math.max(mnfd, 0) : Math.max(mnfd, 3));\n\n // 29. Let mxfd be the result of calling the GetNumberOption abstract operation\n // with arguments options, \"maximumFractionDigits\", mnfd, 20, and mxfdDefault.\n let mxfd = GetNumberOption(options, 'maximumFractionDigits', mnfd, 20, mxfdDefault);\n\n // 30. Set the [[maximumFractionDigits]] internal property of numberFormat to mxfd.\n internal['[[maximumFractionDigits]]'] = mxfd;\n\n // 31. Let mnsd be the result of calling the [[Get]] internal method of options\n // with argument \"minimumSignificantDigits\".\n let mnsd = options.minimumSignificantDigits;\n\n // 32. Let mxsd be the result of calling the [[Get]] internal method of options\n // with argument \"maximumSignificantDigits\".\n let mxsd = options.maximumSignificantDigits;\n\n // 33. If mnsd is not undefined or mxsd is not undefined, then:\n if (mnsd !== undefined || mxsd !== undefined) {\n // a. Let mnsd be the result of calling the GetNumberOption abstract\n // operation with arguments options, \"minimumSignificantDigits\", 1, 21,\n // and 1.\n mnsd = GetNumberOption(options, 'minimumSignificantDigits', 1, 21, 1);\n\n // b. Let mxsd be the result of calling the GetNumberOption abstract\n // operation with arguments options, \"maximumSignificantDigits\", mnsd,\n // 21, and 21.\n mxsd = GetNumberOption(options, 'maximumSignificantDigits', mnsd, 21, 21);\n\n // c. Set the [[minimumSignificantDigits]] internal property of numberFormat\n // to mnsd, and the [[maximumSignificantDigits]] internal property of\n // numberFormat to mxsd.\n internal['[[minimumSignificantDigits]]'] = mnsd;\n internal['[[maximumSignificantDigits]]'] = mxsd;\n }\n // 34. 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 // 35. Set the [[useGrouping]] internal property of numberFormat to g.\n internal['[[useGrouping]]'] = g;\n\n // 36. Let dataLocaleData be the result of calling the [[Get]] internal method of\n // localeData with argument dataLocale.\n let dataLocaleData = localeData[dataLocale];\n\n // 37. Let patterns be the result of calling the [[Get]] internal method of\n // dataLocaleData with argument \"patterns\".\n let patterns = dataLocaleData.patterns;\n\n // 38. Assert: patterns is an object (see 11.2.3)\n\n // 39. Let stylePatterns be the result of calling the [[Get]] internal method of\n // patterns with argument s.\n let stylePatterns = patterns[s];\n\n // 40. 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 // 41. 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 // 42. Set the [[boundFormat]] internal property of numberFormat to undefined.\n internal['[[boundFormat]]'] = undefined;\n\n // 43. 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 regexpState.exp.test(regexpState.input);\n\n // 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 regexpState = 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 regexpState.exp.test(regexpState.input);\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\nIntl.NumberFormat.prototype.formatToParts = function(value) {\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\n/*\n * @spec[stasm/ecma402/number-format-to-parts/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 idx in parts) {\n let part = parts[idx];\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[stasm/ecma402/number-format-to-parts/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 // a. 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 // a. If endIndex = -1, throw new Error exception.\n if (endIndex === -1) throw new Error();\n // a. 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 // a. Let p be the substring of pattern from position beginIndex, exclusive, to position endIndex, exclusive.\n let p = pattern.substring(beginIndex + 1, endIndex);\n // a. 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 the value of numberFormat.[[style]] is \"percent\" and isFinite(x), let x be 100 × x.\n if (internal['[[style]]'] === 'percent' && isFinite(x)) x *= 100;\n\n let n;\n // 2. If the numberFormat.[[minimumSignificantDigits]] and numberFormat.[[maximumSignificantDigits]] are present, then\n if (hop.call(internal, '[[minimumSignificantDigits]]') && hop.call(internal, '[[maximumSignificantDigits]]')) {\n // a. Let n be ToRawPrecision(x, numberFormat.[[minimumSignificantDigits]], numberFormat.[[maximumSignificantDigits]]).\n n = ToRawPrecision(x, internal['[[minimumSignificantDigits]]'], internal['[[maximumSignificantDigits]]']);\n }\n // 3. Else,\n else {\n // a. Let n be ToRawFixed(x, numberFormat.[[minimumIntegerDigits]], numberFormat.[[minimumFractionDigits]], numberFormat.[[maximumFractionDigits]]).\n n = ToRawFixed(x, internal['[[minimumIntegerDigits]]'], internal['[[minimumFractionDigits]]'], internal['[[maximumFractionDigits]]']);\n }\n // 4. If the value of the numberFormat.[[numberingSystem]] matches one of the values in the \"Numbering System\" column of Table 2 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 // 5. 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 // 6. Let decimalSepIndex be Call(%StringProto_indexOf%, n, \".\", 0).\n let decimalSepIndex = n.indexOf('.', 0);\n // 7. 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 // a. 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 // 8. Else:\n else {\n // a. Let integer be n.\n integer = n;\n // a. Let fraction be undefined.\n fraction = undefined;\n }\n // 9. 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 // a. 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 = new List();\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 // a. Assert: The number of elements in groups List is greater than 0.\n if (groups.length === 0) throw new Error();\n // a. 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 // 10. 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 // 11. 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 // a. 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 // a. 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 // a. 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 // a. 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 // a. 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 // a. 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 // ii. If numberFormat.[[currencyDisplay]] is \"code\", then\n if (internal['[[currencyDisplay]]'] === \"code\") {\n // 1. Let cd be currency.\n cd = currency;\n }\n // iii. 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 // iv. 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 // v. 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 // a. 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 // a. Set nextIndex to endIndex + 1.\n nextIndex = endIndex + 1;\n // a. 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 // a. 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[stasm/ecma402/number-format-to-parts/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 idx in parts) {\n let part = parts[idx];\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 = [\"weekday\", \"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","// 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 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 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 regexpState = 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 regexpState.exp.test(regexpState.input);\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\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 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 // 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 regexpState = 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 regexpState.exp.test(regexpState.input);\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\ndefineProperty(Intl.DateTimeFormat.prototype, 'formatToParts', {\n configurable: true,\n get: GetFormatToPartsDateTime,\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 () {\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 = Number(arguments.length === 0 ? Date.now() : arguments[0]);\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 GetFormatToPartsDateTime() {\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 if (internal['[[boundFormatToParts]]'] === undefined) {\n let F = function () {\n let x = Number(arguments.length === 0 ? Date.now() : arguments[0]);\n return FormatToPartsDateTime(this, x);\n };\n let bf = fnBind.call(F, this);\n internal['[[boundFormatToParts]]'] = bf;\n }\n return internal['[[boundFormatToParts]]'];\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 regexpState = */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 part in parts) {\n result += parts[part].value;\n }\n return result;\n}\n\nfunction FormatToPartsDateTime(dateTimeFormat, x) {\n let parts = CreateDateTimeParts(dateTimeFormat, x);\n let result = [];\n for (let part in parts) {\n result.push({\n type: parts[part].type,\n value: parts[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","// 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","/**\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\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(\"Object passed doesn't identify itself with a valid language tag\");\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 // If this is the first set of locale data added, make it the default\n if (defaultLocale === undefined)\n setDefaultLocale(tag);\n}\n\nexport default Intl;\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 Intl = IntlPolyfill;\n IntlPolyfill.__applyLocaleSensitivePrototypes();\n } catch (e) {\n // can be read only property\n }\n}\n\nexport default IntlPolyfill;\n"],"names":["Intl","IntlPolyfill"],"mappings":";;;;;;;;;;;;;;IAAA,IAAM,iBAAkB,YAAY;AAC5B,IAAA,QAAI,WAAW,EAAf;AACA,IAAA,QAAI;AACA,IAAA,eAAO,cAAP,CAAsB,QAAtB,EAAgC,GAAhC,EAAqC,EAArC;AACA,IAAA,eAAO,OAAO,QAAd;AACH,IAAA,KAHD,CAGE,OAAO,CAAP,EAAU;AACR,IAAA,eAAO,KAAP;AACH,IAAA;AACJ,IAAA,CARkB,EAAvB;;;AAWA,IAAO,IAAM,MAAM,CAAC,cAAD,IAAmB,CAAC,OAAO,SAAP,CAAiB,gBAAjD;;;AAGP,IAAO,IAAM,MAAM,OAAO,SAAP,CAAiB,cAA7B;;;AAGP,IAAO,IAAM,iBAAiB,iBAAiB,OAAO,cAAxB,GAAyC,UAAU,GAAV,EAAe,IAAf,EAAqB,IAArB,EAA2B;AAC9F,IAAA,QAAI,SAAS,IAAT,IAAiB,IAAI,gBAAzB,EACI,IAAI,gBAAJ,CAAqB,IAArB,EAA2B,KAAK,GAAhC,EADJ,KAGK,IAAI,CAAC,IAAI,IAAJ,CAAS,GAAT,EAAc,IAAd,CAAD,IAAwB,WAAW,IAAvC,EACD,IAAI,IAAJ,IAAY,KAAK,KAAjB;AACP,IAAA,CANM;;;AASP,IAAO,IAAM,aAAa,MAAM,SAAN,CAAgB,OAAhB,IAA2B,UAAU,MAAV,EAAkB;;AAEnE,IAAA,QAAI,IAAI,IAAR;AACA,IAAA,QAAI,CAAC,EAAE,MAAP,EACI,OAAO,CAAC,CAAR;;AAEJ,IAAA,SAAK,IAAI,IAAI,UAAU,CAAV,KAAgB,CAAxB,EAA2B,MAAM,EAAE,MAAxC,EAAgD,IAAI,GAApD,EAAyD,GAAzD,EAA8D;AAC1D,IAAA,YAAI,EAAE,CAAF,MAAS,MAAb,EAC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;YACI,UAAU,CAAE,GAAF,CADd;YAEI,QAAU,IAAI,KAAJ,CAAU,GAAV,CAFd;;;AAKA,IAAA,QAAI,MAAM,MAAN,GAAe,CAAf,IAAoB,MAAM,CAAN,EAAS,MAAT,KAAoB,CAA5C,EACI,QAAQ,IAAR,CAAa,OAAb,EAAsB,MAAM,CAAN,IAAW,GAAX,GAAiB,MAAM,CAAN,CAAvC;;AAEJ,IAAA,WAAQ,SAAS,SAAS,IAAT,CAAc,OAAd,CAAjB,EAA0C;;AAEtC,IAAA,gBAAQ,IAAR,CAAa,UAAU,YAAV,CAAuB,sBAAvB,CAAb,EAA6D,MAA7D;AACA,IAAA,kBAAU,YAAV,CAAuB,gBAAvB,EAAyC,MAAzC,IAAmD,KAAK,MAAxD;;;AAGA,IAAA,YAAI,KAAK,IAAT,EAAe;AACX,IAAA,iBAAK,IAAL,CAAU,EAAV,GAAe,KAAK,MAAL,CAAY,EAA3B;AACA,IAAA,oBAAQ,IAAR,CAAa,UAAU,cAAV,CAAyB,sBAAzB,CAAb,EAA+D,MAA/D;AACA,IAAA,sBAAU,cAAV,CAAyB,gBAAzB,EAA2C,MAA3C,IAAqD,KAAK,IAA1D;AACH,IAAA;AACJ,IAAA;;;AAGD,IAAA,QAAI,kBAAkB,SAAtB,EACI,iBAAiB,GAAjB;AACP,IAAA;;;AC1FD,IAAA,IAAI,OAAO,IAAP,KAAgB,WAApB,EAAiC;AAC7B,IAAA,QAAI;AACA,IAAA,eAAOC,MAAP;AACA,IAAA,eAAa,gCAAb;AACH,IAAA,KAHD,CAGE,OAAO,CAAP,EAAU;;AAEX,IAAA;AACJ,IAAA;;;;"} \ No newline at end of file diff --git a/dist/Intl.min.js.map b/dist/Intl.min.js.map index b543d4353..bca12f96f 100644 --- a/dist/Intl.min.js.map +++ b/dist/Intl.min.js.map @@ -1 +1 @@ -{"version":3,"file":"Intl.min.js","sources":["../src/util.js","../src/exp.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/13.locale-sensitive-functions.js","../src/core.js","../src/main.js"],"sourcesContent":["const realDefineProp = (function () {\n let sentinel = {};\n try {\n Object.defineProperty(sentinel, 'a', {});\n return 'a' in sentinel;\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 let esc = /[.?*+^$[\\]\\\\(){}|-]/g,\n lm = RegExp.lastMatch || '',\n ml = RegExp.multiline ? 'm' : '',\n ret = { input: RegExp.input },\n reg = new List(),\n has = false,\n cap = {};\n\n // Create a snapshot of all the 'captured' properties\n for (let i = 1; i <= 9; i++)\n has = (cap['$'+i] = RegExp['$'+i]) || has;\n\n // Now we've snapshotted some properties, escape the lastMatch string\n lm = lm.replace(esc, '\\\\$&');\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 = cap['$'+i];\n\n // If it's empty, add an empty capturing group\n if (!m)\n lm = '()' + lm;\n\n // Else find the string in lm and escape & wrap it to capture it\n else {\n m = m.replace(esc, '\\\\$&');\n lm = lm.replace(m, '(' + m + ')');\n }\n\n // Push it to the reg and chop lm to make sure further groups come after\n arrPush.call(reg, lm.slice(0, lm.indexOf('(') + 1));\n lm = lm.slice(lm.indexOf('(') + 1);\n }\n }\n\n // Create the regular expression that will reconstruct the RegExp properties\n ret.exp = new RegExp(arrJoin.call(reg, '') + lm, ml);\n\n return ret;\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 return Object(arg);\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","/**\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 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 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 = 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/**\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 split be the standard built-in function object defined in ES5,\n // 15.5.4.14.\n let split = String.prototype.split;\n // c. Let extensionSubtags be the result of calling the [[Call]] internal\n // method of split with extension as the this value and an argument\n // list containing the single item \"-\".\n extensionSubtags = split.call(extension, '-');\n // d. Let extensionSubtagsLength be the result of calling the [[Get]]\n // internal method of extensionSubtags with argument \"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 // \"Freeze\" the array so no new elements can be added\n defineProperty(subset, 'length', { writable: false });\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]\nIntl.getCanonicalLocales = function (locales) {\n // 1. Let ll be ? CanonicalizeLocaleList(locales).\n let ll = CanonicalizeLocaleList(locales);\n // 2. Return CreateArrayFromList(ll).\n {\n let result = [];\n for (let code in ll) {\n result.push(ll[code]);\n }\n return result;\n }\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 * 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.1.1 */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 regexpState = 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 NumberFormat be the standard built-in object that is the initial value\n // of Intl.NumberFormat.\n // 10. Let localeData be the value of the [[localeData]] internal property of\n // NumberFormat.\n let localeData = internals.NumberFormat['[[localeData]]'];\n\n // 11. 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 // 12. Set the [[locale]] internal property of numberFormat to the value of\n // r.[[locale]].\n internal['[[locale]]'] = r['[[locale]]'];\n\n // 13. 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 // 14. Let dataLocale be the value of r.[[dataLocale]].\n let dataLocale = r['[[dataLocale]]'];\n\n // 15. 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 // 16. Set the [[style]] internal property of numberFormat to s.\n internal['[[style]]'] = s;\n\n // 17. 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 // 18. 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 // 19. 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 // 20. 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 // 21. 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 // 22. 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 // 23. Let mnid be the result of calling the GetNumberOption abstract operation\n // (defined in 9.2.10) with arguments options, \"minimumIntegerDigits\", 1, 21,\n // and 1.\n let mnid = GetNumberOption(options, 'minimumIntegerDigits', 1, 21, 1);\n\n // 24. Set the [[minimumIntegerDigits]] internal property of numberFormat to mnid.\n internal['[[minimumIntegerDigits]]'] = mnid;\n\n // 25. If s is \"currency\", then let mnfdDefault be cDigits; else let mnfdDefault\n // be 0.\n let mnfdDefault = s === 'currency' ? cDigits : 0;\n\n // 26. Let mnfd be the result of calling the GetNumberOption abstract operation\n // with arguments options, \"minimumFractionDigits\", 0, 20, and mnfdDefault.\n let mnfd = GetNumberOption(options, 'minimumFractionDigits', 0, 20, mnfdDefault);\n\n // 27. Set the [[minimumFractionDigits]] internal property of numberFormat to mnfd.\n internal['[[minimumFractionDigits]]'] = mnfd;\n\n // 28. If s is \"currency\", then let mxfdDefault be max(mnfd, cDigits); else if s\n // is \"percent\", then let mxfdDefault be max(mnfd, 0); else let mxfdDefault\n // be max(mnfd, 3).\n let mxfdDefault = s === 'currency' ? Math.max(mnfd, cDigits)\n : (s === 'percent' ? Math.max(mnfd, 0) : Math.max(mnfd, 3));\n\n // 29. Let mxfd be the result of calling the GetNumberOption abstract operation\n // with arguments options, \"maximumFractionDigits\", mnfd, 20, and mxfdDefault.\n let mxfd = GetNumberOption(options, 'maximumFractionDigits', mnfd, 20, mxfdDefault);\n\n // 30. Set the [[maximumFractionDigits]] internal property of numberFormat to mxfd.\n internal['[[maximumFractionDigits]]'] = mxfd;\n\n // 31. Let mnsd be the result of calling the [[Get]] internal method of options\n // with argument \"minimumSignificantDigits\".\n let mnsd = options.minimumSignificantDigits;\n\n // 32. Let mxsd be the result of calling the [[Get]] internal method of options\n // with argument \"maximumSignificantDigits\".\n let mxsd = options.maximumSignificantDigits;\n\n // 33. If mnsd is not undefined or mxsd is not undefined, then:\n if (mnsd !== undefined || mxsd !== undefined) {\n // a. Let mnsd be the result of calling the GetNumberOption abstract\n // operation with arguments options, \"minimumSignificantDigits\", 1, 21,\n // and 1.\n mnsd = GetNumberOption(options, 'minimumSignificantDigits', 1, 21, 1);\n\n // b. Let mxsd be the result of calling the GetNumberOption abstract\n // operation with arguments options, \"maximumSignificantDigits\", mnsd,\n // 21, and 21.\n mxsd = GetNumberOption(options, 'maximumSignificantDigits', mnsd, 21, 21);\n\n // c. Set the [[minimumSignificantDigits]] internal property of numberFormat\n // to mnsd, and the [[maximumSignificantDigits]] internal property of\n // numberFormat to mxsd.\n internal['[[minimumSignificantDigits]]'] = mnsd;\n internal['[[maximumSignificantDigits]]'] = mxsd;\n }\n // 34. 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 // 35. Set the [[useGrouping]] internal property of numberFormat to g.\n internal['[[useGrouping]]'] = g;\n\n // 36. Let dataLocaleData be the result of calling the [[Get]] internal method of\n // localeData with argument dataLocale.\n let dataLocaleData = localeData[dataLocale];\n\n // 37. Let patterns be the result of calling the [[Get]] internal method of\n // dataLocaleData with argument \"patterns\".\n let patterns = dataLocaleData.patterns;\n\n // 38. Assert: patterns is an object (see 11.2.3)\n\n // 39. Let stylePatterns be the result of calling the [[Get]] internal method of\n // patterns with argument s.\n let stylePatterns = patterns[s];\n\n // 40. 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 // 41. 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 // 42. Set the [[boundFormat]] internal property of numberFormat to undefined.\n internal['[[boundFormat]]'] = undefined;\n\n // 43. 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 regexpState.exp.test(regexpState.input);\n\n // 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 regexpState = 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 regexpState.exp.test(regexpState.input);\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\nIntl.NumberFormat.prototype.formatToParts = function(value) {\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\n/*\n * @spec[stasm/ecma402/number-format-to-parts/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 idx in parts) {\n let part = parts[idx];\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[stasm/ecma402/number-format-to-parts/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 // a. 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 // a. If endIndex = -1, throw new Error exception.\n if (endIndex === -1) throw new Error();\n // a. 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 // a. Let p be the substring of pattern from position beginIndex, exclusive, to position endIndex, exclusive.\n let p = pattern.substring(beginIndex + 1, endIndex);\n // a. 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 the value of numberFormat.[[style]] is \"percent\" and isFinite(x), let x be 100 × x.\n if (internal['[[style]]'] === 'percent' && isFinite(x)) x *= 100;\n\n let n;\n // 2. If the numberFormat.[[minimumSignificantDigits]] and numberFormat.[[maximumSignificantDigits]] are present, then\n if (hop.call(internal, '[[minimumSignificantDigits]]') && hop.call(internal, '[[maximumSignificantDigits]]')) {\n // a. Let n be ToRawPrecision(x, numberFormat.[[minimumSignificantDigits]], numberFormat.[[maximumSignificantDigits]]).\n n = ToRawPrecision(x, internal['[[minimumSignificantDigits]]'], internal['[[maximumSignificantDigits]]']);\n }\n // 3. Else,\n else {\n // a. Let n be ToRawFixed(x, numberFormat.[[minimumIntegerDigits]], numberFormat.[[minimumFractionDigits]], numberFormat.[[maximumFractionDigits]]).\n n = ToRawFixed(x, internal['[[minimumIntegerDigits]]'], internal['[[minimumFractionDigits]]'], internal['[[maximumFractionDigits]]']);\n }\n // 4. If the value of the numberFormat.[[numberingSystem]] matches one of the values in the \"Numbering System\" column of Table 2 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 // 5. 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 // 6. Let decimalSepIndex be Call(%StringProto_indexOf%, n, \".\", 0).\n let decimalSepIndex = n.indexOf('.', 0);\n // 7. 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 // a. 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 // 8. Else:\n else {\n // a. Let integer be n.\n integer = n;\n // a. Let fraction be undefined.\n fraction = undefined;\n }\n // 9. 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 // a. 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 = new List();\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 // a. Assert: The number of elements in groups List is greater than 0.\n if (groups.length === 0) throw new Error();\n // a. 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 // 10. 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 // 11. 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 // a. 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 // a. 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 // a. 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 // a. 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 // a. 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 // a. 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 // ii. If numberFormat.[[currencyDisplay]] is \"code\", then\n if (internal['[[currencyDisplay]]'] === \"code\") {\n // 1. Let cd be currency.\n cd = currency;\n }\n // iii. 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 // iv. 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 // v. 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 // a. 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 // a. Set nextIndex to endIndex + 1.\n nextIndex = endIndex + 1;\n // a. 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 // a. 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[stasm/ecma402/number-format-to-parts/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 idx in parts) {\n let part = parts[idx];\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\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 = [\"weekday\", \"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","// 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 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 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 regexpState = 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 regexpState.exp.test(regexpState.input);\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\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 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 // 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 regexpState = 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 regexpState.exp.test(regexpState.input);\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\ndefineProperty(Intl.DateTimeFormat.prototype, 'formatToParts', {\n configurable: true,\n get: GetFormatToPartsDateTime,\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 () {\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 = Number(arguments.length === 0 ? Date.now() : arguments[0]);\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 GetFormatToPartsDateTime() {\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 if (internal['[[boundFormatToParts]]'] === undefined) {\n let F = function () {\n let x = Number(arguments.length === 0 ? Date.now() : arguments[0]);\n return FormatToPartsDateTime(this, x);\n };\n let bf = fnBind.call(F, this);\n internal['[[boundFormatToParts]]'] = bf;\n }\n return internal['[[boundFormatToParts]]'];\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 regexpState = */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 part in parts) {\n result += parts[part].value;\n }\n return result;\n}\n\nfunction FormatToPartsDateTime(dateTimeFormat, x) {\n let parts = CreateDateTimeParts(dateTimeFormat, x);\n let result = [];\n for (let part in parts) {\n result.push({\n type: parts[part].type,\n value: parts[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","// 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","/**\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\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(\"Object passed doesn't identify itself with a valid language tag\");\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 // If this is the first set of locale data added, make it the default\n if (defaultLocale === undefined)\n setDefaultLocale(tag);\n}\n\nexport default Intl;\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 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","esc","lm","RegExp","lastMatch","ml","multiline","ret","input","reg","has","cap","i","replace","_i","m","slice","indexOf","exp","arrJoin","toObject","arg","TypeError","Object","getInternalProperties","__getInternalProperties","secret","objCreate","setDefaultLocale","locale","toLatinUpperCase","str","ch","charAt","toUpperCase","IsStructurallyValidLanguageTag","expBCP47Syntax","test","expVariantDupes","expSingletonDupes","CanonicalizeLanguageTag","match","parts","toLowerCase","split","max","expExtSequences","sort","source","redundantTags","tags","_max","subtags","extLang","DefaultLocale","defaultLocale","IsWellFormedCurrencyCode","currency","c","String","normalized","expCurrencyCode","CanonicalizeLocaleList","locales","undefined","seen","O","len","Pk","kPresent","kValue","tag","RangeError","arrIndexOf","BestAvailableLocale","availableLocales","candidate","pos","lastIndexOf","substring","LookupMatcher","requestedLocales","availableLocale","noExtensionsLocale","expUnicodeExSeq","result","extension","extensionIndex","BestFitMatcher","ResolveLocale","options","relevantExtensionKeys","localeData","ReferenceError","matcher","r","foundLocale","extensionSubtags","extensionSubtagsLength","prototype","supportedExtension","key","foundLocaleData","keyLocaleData","supportedExtensionAddition","keyPos","requestedValue","valuePos","_valuePos","optionsValue","privateIndex","preExtension","postExtension","LookupSupportedLocales","subset","subsetArray","BestFitSupportedLocales","SupportedLocales","localeMatcher","P","GetOption","property","type","values","fallback","Boolean","GetNumberOption","minimum","maximum","isNaN","NumberFormatConstructor","Intl","InitializeNumberFormat","NumberFormat","numberFormat","internal","regexpState","opt","internals","dataLocale","s","cDigits","CurrencyDigits","cd","mnid","mnfdDefault","mnfd","mxfdDefault","mxfd","mnsd","minimumSignificantDigits","mxsd","maximumSignificantDigits","g","dataLocaleData","patterns","stylePatterns","positivePattern","negativePattern","es3","format","GetFormatNumber","currencyMinorUnits","babelHelpers","F","FormatNumber","bf","fnBind","FormatNumberToParts","PartitionNumberPattern","idx","part","nums","data","ild","symbols","latn","pattern","beginIndex","endIndex","nextIndex","Error","literal","[[type]]","[[value]]","p","nan","isFinite","_n2","ToRawPrecision","ToRawFixed","numSys","digits","digit","integer","fraction","decimalSepIndex","groupSepSymbol","group","groups","pgSize","primaryGroupSize","sgSize","secondaryGroupSize","end","start","integerGroup","arrShift","decimalSepSymbol","decimal","_n","infinity","plusSignSymbol","plusSign","minusSignSymbol","minusSign","percentSignSymbol","percentSign","currencies","_literal","_literal2","minPrecision","maxPrecision","e","Array","abs","f","LN10","cut","minInteger","minFraction","maxFraction","pow","toFixed","int","z","a","b","_z","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","push","full","medium","originalPattern","resolveDateString","ca","component","width","gregory","alts","resolved","DateTimeFormatConstructor","InitializeDateTimeFormat","DateTimeFormat","dateTimeFormat","ToDateTimeOptions","tz","timeZone","prop","dateTimeComponents","bestFormat","ToDateTimeFormats","BasicFormatMatcher","_hr","BestFitFormatMatcher","_prop","hr12","hourNo0","GetFormatDateTime","toString","required","defaults","opt2","create","needDefaults","removalPenalty","additionPenalty","longLessPenalty","longMorePenalty","shortLessPenalty","shortMorePenalty","bestScore","Infinity","score","optionsProp","formatProp","optionsPropIndex","formatPropIndex","delta","min","hour12Penalty","Date","now","FormatDateTime","GetFormatToPartsDateTime","FormatToPartsDateTime","CreateDateTimeParts","nf","useGrouping","nf2","minimumIntegerDigits","tm","ToLocalTime","index","calendars","fv","v","dateWidths","_v","substr","date","calendar","d","addLocaleData","number","nu","realDefineProp","sentinel","__defineGetter__","name","desc","get","search","t","proto","props","arrConcat","concat","join","shift","Function","bind","thisObj","fn","args","random","extlang","language","script","region","variant","singleton","privateuse","irregular","regular","grandfathered","langtag","getCanonicalLocales","ll","code","BYR","XOF","BIF","XAF","CLF","CLP","KMF","DJF","GNF","ISK","IQD","JPY","JOD","KRW","KWD","LYD","PYG","RWF","TND","UGX","UYI","VUV","VND","formatToParts","descs","narrow","short","long","ls","__localeSensitiveProtos","toLocaleString","toLocaleDateString","toLocaleTimeString","IntlPolyfill","__applyLocaleSensitivePrototypes"],"mappings":"uLA8FO,SAASA,GAAYC,MAEE,kBAAfC,MAAKC,MACZ,MAAOD,MAAKE,MAAMF,KAAKC,MAAMF,OAE7BI,GAAIH,KAAKI,MAAMJ,KAAKK,IAAIN,GAAKC,KAAKM,cAC/BH,IAAKI,OAAO,KAAOJ,GAAKJ,GAM5B,QAASS,GAAQC,OAEf,GAAIC,KAAKD,IACNA,YAAeD,IAAUG,GAAIC,KAAKH,EAAKC,KACvCG,GAAeC,KAAMJ,GAAKK,MAAON,EAAIC,GAAIM,YAAY,EAAMC,UAAU,EAAMC,cAAc,IAQ9F,QAASC,QACGL,KAAM,UAAYG,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AW,MCnFxC/B,UAMLN,uBAEgB,cACL,cACA,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,eACF,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,YAC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,cAAc,EAAMH,MAAO6a,GAAGvF,KAAKyF,qBAEjG,GAAIpb,KAAKkb,IAAGvF,KACT1V,GAAIC,KAAKgb,GAAGvF,KAAM3V,IAClBG,GAAewV,KAAKzO,UAAWlH,GAAKO,UAAU,EAAMC,cAAc,EAAMH,MAAO6a,GAAGvF,KAAK3V,QAUvGG,GAAe+I,GAAM,yBACV,SAAU0C,OACR1I,EAA+B0I,EAAKhJ,QACrC,KAAM,IAAIwJ,OAAM,qEAENR,EAAMA,EAAKhJ,WCzDb,mBAATsG,eAEIqS,MACMC,mCACf,MAAO1M"} \ No newline at end of file +{"version":3,"file":"Intl.min.js","sources":["../src/util.js","../src/exp.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/13.locale-sensitive-functions.js","../src/core.js","../src/main.js"],"sourcesContent":["const realDefineProp = (function () {\n let sentinel = {};\n try {\n Object.defineProperty(sentinel, 'a', {});\n return 'a' in sentinel;\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 let esc = /[.?*+^$[\\]\\\\(){}|-]/g,\n lm = RegExp.lastMatch || '',\n ml = RegExp.multiline ? 'm' : '',\n ret = { input: RegExp.input },\n reg = new List(),\n has = false,\n cap = {};\n\n // Create a snapshot of all the 'captured' properties\n for (let i = 1; i <= 9; i++)\n has = (cap['$'+i] = RegExp['$'+i]) || has;\n\n // Now we've snapshotted some properties, escape the lastMatch string\n lm = lm.replace(esc, '\\\\$&');\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 = cap['$'+i];\n\n // If it's empty, add an empty capturing group\n if (!m)\n lm = '()' + lm;\n\n // Else find the string in lm and escape & wrap it to capture it\n else {\n m = m.replace(esc, '\\\\$&');\n lm = lm.replace(m, '(' + m + ')');\n }\n\n // Push it to the reg and chop lm to make sure further groups come after\n arrPush.call(reg, lm.slice(0, lm.indexOf('(') + 1));\n lm = lm.slice(lm.indexOf('(') + 1);\n }\n }\n\n // Create the regular expression that will reconstruct the RegExp properties\n ret.exp = new RegExp(arrJoin.call(reg, '') + lm, ml);\n\n return ret;\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 return Object(arg);\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","/**\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 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 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 = 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/**\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 split be the standard built-in function object defined in ES5,\n // 15.5.4.14.\n let split = String.prototype.split;\n // c. Let extensionSubtags be the result of calling the [[Call]] internal\n // method of split with extension as the this value and an argument\n // list containing the single item \"-\".\n extensionSubtags = split.call(extension, '-');\n // d. Let extensionSubtagsLength be the result of calling the [[Get]]\n // internal method of extensionSubtags with argument \"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 // \"Freeze\" the array so no new elements can be added\n defineProperty(subset, 'length', { writable: false });\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]\nIntl.getCanonicalLocales = function (locales) {\n // 1. Let ll be ? CanonicalizeLocaleList(locales).\n let ll = CanonicalizeLocaleList(locales);\n // 2. Return CreateArrayFromList(ll).\n {\n let result = [];\n for (let code in ll) {\n result.push(ll[code]);\n }\n return result;\n }\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 * 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.1.1 */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 regexpState = 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 NumberFormat be the standard built-in object that is the initial value\n // of Intl.NumberFormat.\n // 10. Let localeData be the value of the [[localeData]] internal property of\n // NumberFormat.\n let localeData = internals.NumberFormat['[[localeData]]'];\n\n // 11. 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 // 12. Set the [[locale]] internal property of numberFormat to the value of\n // r.[[locale]].\n internal['[[locale]]'] = r['[[locale]]'];\n\n // 13. 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 // 14. Let dataLocale be the value of r.[[dataLocale]].\n let dataLocale = r['[[dataLocale]]'];\n\n // 15. 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 // 16. Set the [[style]] internal property of numberFormat to s.\n internal['[[style]]'] = s;\n\n // 17. 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 // 18. 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 // 19. 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 // 20. 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 // 21. 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 // 22. 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 // 23. Let mnid be the result of calling the GetNumberOption abstract operation\n // (defined in 9.2.10) with arguments options, \"minimumIntegerDigits\", 1, 21,\n // and 1.\n let mnid = GetNumberOption(options, 'minimumIntegerDigits', 1, 21, 1);\n\n // 24. Set the [[minimumIntegerDigits]] internal property of numberFormat to mnid.\n internal['[[minimumIntegerDigits]]'] = mnid;\n\n // 25. If s is \"currency\", then let mnfdDefault be cDigits; else let mnfdDefault\n // be 0.\n let mnfdDefault = s === 'currency' ? cDigits : 0;\n\n // 26. Let mnfd be the result of calling the GetNumberOption abstract operation\n // with arguments options, \"minimumFractionDigits\", 0, 20, and mnfdDefault.\n let mnfd = GetNumberOption(options, 'minimumFractionDigits', 0, 20, mnfdDefault);\n\n // 27. Set the [[minimumFractionDigits]] internal property of numberFormat to mnfd.\n internal['[[minimumFractionDigits]]'] = mnfd;\n\n // 28. If s is \"currency\", then let mxfdDefault be max(mnfd, cDigits); else if s\n // is \"percent\", then let mxfdDefault be max(mnfd, 0); else let mxfdDefault\n // be max(mnfd, 3).\n let mxfdDefault = s === 'currency' ? Math.max(mnfd, cDigits)\n : (s === 'percent' ? Math.max(mnfd, 0) : Math.max(mnfd, 3));\n\n // 29. Let mxfd be the result of calling the GetNumberOption abstract operation\n // with arguments options, \"maximumFractionDigits\", mnfd, 20, and mxfdDefault.\n let mxfd = GetNumberOption(options, 'maximumFractionDigits', mnfd, 20, mxfdDefault);\n\n // 30. Set the [[maximumFractionDigits]] internal property of numberFormat to mxfd.\n internal['[[maximumFractionDigits]]'] = mxfd;\n\n // 31. Let mnsd be the result of calling the [[Get]] internal method of options\n // with argument \"minimumSignificantDigits\".\n let mnsd = options.minimumSignificantDigits;\n\n // 32. Let mxsd be the result of calling the [[Get]] internal method of options\n // with argument \"maximumSignificantDigits\".\n let mxsd = options.maximumSignificantDigits;\n\n // 33. If mnsd is not undefined or mxsd is not undefined, then:\n if (mnsd !== undefined || mxsd !== undefined) {\n // a. Let mnsd be the result of calling the GetNumberOption abstract\n // operation with arguments options, \"minimumSignificantDigits\", 1, 21,\n // and 1.\n mnsd = GetNumberOption(options, 'minimumSignificantDigits', 1, 21, 1);\n\n // b. Let mxsd be the result of calling the GetNumberOption abstract\n // operation with arguments options, \"maximumSignificantDigits\", mnsd,\n // 21, and 21.\n mxsd = GetNumberOption(options, 'maximumSignificantDigits', mnsd, 21, 21);\n\n // c. Set the [[minimumSignificantDigits]] internal property of numberFormat\n // to mnsd, and the [[maximumSignificantDigits]] internal property of\n // numberFormat to mxsd.\n internal['[[minimumSignificantDigits]]'] = mnsd;\n internal['[[maximumSignificantDigits]]'] = mxsd;\n }\n // 34. 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 // 35. Set the [[useGrouping]] internal property of numberFormat to g.\n internal['[[useGrouping]]'] = g;\n\n // 36. Let dataLocaleData be the result of calling the [[Get]] internal method of\n // localeData with argument dataLocale.\n let dataLocaleData = localeData[dataLocale];\n\n // 37. Let patterns be the result of calling the [[Get]] internal method of\n // dataLocaleData with argument \"patterns\".\n let patterns = dataLocaleData.patterns;\n\n // 38. Assert: patterns is an object (see 11.2.3)\n\n // 39. Let stylePatterns be the result of calling the [[Get]] internal method of\n // patterns with argument s.\n let stylePatterns = patterns[s];\n\n // 40. 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 // 41. 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 // 42. Set the [[boundFormat]] internal property of numberFormat to undefined.\n internal['[[boundFormat]]'] = undefined;\n\n // 43. 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 regexpState.exp.test(regexpState.input);\n\n // 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 regexpState = 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 regexpState.exp.test(regexpState.input);\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\nIntl.NumberFormat.prototype.formatToParts = function(value) {\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\n/*\n * @spec[stasm/ecma402/number-format-to-parts/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 idx in parts) {\n let part = parts[idx];\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[stasm/ecma402/number-format-to-parts/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 // a. 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 // a. If endIndex = -1, throw new Error exception.\n if (endIndex === -1) throw new Error();\n // a. 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 // a. Let p be the substring of pattern from position beginIndex, exclusive, to position endIndex, exclusive.\n let p = pattern.substring(beginIndex + 1, endIndex);\n // a. 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 the value of numberFormat.[[style]] is \"percent\" and isFinite(x), let x be 100 × x.\n if (internal['[[style]]'] === 'percent' && isFinite(x)) x *= 100;\n\n let n;\n // 2. If the numberFormat.[[minimumSignificantDigits]] and numberFormat.[[maximumSignificantDigits]] are present, then\n if (hop.call(internal, '[[minimumSignificantDigits]]') && hop.call(internal, '[[maximumSignificantDigits]]')) {\n // a. Let n be ToRawPrecision(x, numberFormat.[[minimumSignificantDigits]], numberFormat.[[maximumSignificantDigits]]).\n n = ToRawPrecision(x, internal['[[minimumSignificantDigits]]'], internal['[[maximumSignificantDigits]]']);\n }\n // 3. Else,\n else {\n // a. Let n be ToRawFixed(x, numberFormat.[[minimumIntegerDigits]], numberFormat.[[minimumFractionDigits]], numberFormat.[[maximumFractionDigits]]).\n n = ToRawFixed(x, internal['[[minimumIntegerDigits]]'], internal['[[minimumFractionDigits]]'], internal['[[maximumFractionDigits]]']);\n }\n // 4. If the value of the numberFormat.[[numberingSystem]] matches one of the values in the \"Numbering System\" column of Table 2 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 // 5. 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 // 6. Let decimalSepIndex be Call(%StringProto_indexOf%, n, \".\", 0).\n let decimalSepIndex = n.indexOf('.', 0);\n // 7. 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 // a. 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 // 8. Else:\n else {\n // a. Let integer be n.\n integer = n;\n // a. Let fraction be undefined.\n fraction = undefined;\n }\n // 9. 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 // a. 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 = new List();\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 // a. Assert: The number of elements in groups List is greater than 0.\n if (groups.length === 0) throw new Error();\n // a. 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 // 10. 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 // 11. 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 // a. 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 // a. 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 // a. 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 // a. 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 // a. 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 // a. 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 // ii. If numberFormat.[[currencyDisplay]] is \"code\", then\n if (internal['[[currencyDisplay]]'] === \"code\") {\n // 1. Let cd be currency.\n cd = currency;\n }\n // iii. 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 // iv. 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 // v. 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 // a. 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 // a. Set nextIndex to endIndex + 1.\n nextIndex = endIndex + 1;\n // a. 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 // a. 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[stasm/ecma402/number-format-to-parts/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 idx in parts) {\n let part = parts[idx];\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 = [\"weekday\", \"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","// 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 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 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 regexpState = 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 regexpState.exp.test(regexpState.input);\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\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 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 // 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 regexpState = 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 regexpState.exp.test(regexpState.input);\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\ndefineProperty(Intl.DateTimeFormat.prototype, 'formatToParts', {\n configurable: true,\n get: GetFormatToPartsDateTime,\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 () {\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 = Number(arguments.length === 0 ? Date.now() : arguments[0]);\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 GetFormatToPartsDateTime() {\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 if (internal['[[boundFormatToParts]]'] === undefined) {\n let F = function () {\n let x = Number(arguments.length === 0 ? Date.now() : arguments[0]);\n return FormatToPartsDateTime(this, x);\n };\n let bf = fnBind.call(F, this);\n internal['[[boundFormatToParts]]'] = bf;\n }\n return internal['[[boundFormatToParts]]'];\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 regexpState = */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 part in parts) {\n result += parts[part].value;\n }\n return result;\n}\n\nfunction FormatToPartsDateTime(dateTimeFormat, x) {\n let parts = CreateDateTimeParts(dateTimeFormat, x);\n let result = [];\n for (let part in parts) {\n result.push({\n type: parts[part].type,\n value: parts[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","// 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","/**\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\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(\"Object passed doesn't identify itself with a valid language tag\");\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 // If this is the first set of locale data added, make it the default\n if (defaultLocale === undefined)\n setDefaultLocale(tag);\n}\n\nexport default Intl;\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 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","esc","lm","RegExp","lastMatch","ml","multiline","ret","input","reg","has","cap","i","replace","_i","m","slice","indexOf","exp","arrJoin","toObject","arg","TypeError","Object","getInternalProperties","__getInternalProperties","secret","objCreate","setDefaultLocale","locale","toLatinUpperCase","str","ch","charAt","toUpperCase","IsStructurallyValidLanguageTag","expBCP47Syntax","test","expVariantDupes","expSingletonDupes","CanonicalizeLanguageTag","match","parts","toLowerCase","split","max","expExtSequences","sort","source","redundantTags","tags","_max","subtags","extLang","DefaultLocale","defaultLocale","IsWellFormedCurrencyCode","currency","c","String","normalized","expCurrencyCode","CanonicalizeLocaleList","locales","undefined","seen","O","len","Pk","kPresent","kValue","tag","RangeError","arrIndexOf","BestAvailableLocale","availableLocales","candidate","pos","lastIndexOf","substring","LookupMatcher","requestedLocales","availableLocale","noExtensionsLocale","expUnicodeExSeq","result","extension","extensionIndex","BestFitMatcher","ResolveLocale","options","relevantExtensionKeys","localeData","ReferenceError","matcher","r","foundLocale","extensionSubtags","extensionSubtagsLength","prototype","supportedExtension","key","foundLocaleData","keyLocaleData","supportedExtensionAddition","keyPos","requestedValue","valuePos","_valuePos","optionsValue","privateIndex","preExtension","postExtension","LookupSupportedLocales","subset","subsetArray","BestFitSupportedLocales","SupportedLocales","localeMatcher","P","GetOption","property","type","values","fallback","Boolean","GetNumberOption","minimum","maximum","isNaN","NumberFormatConstructor","Intl","InitializeNumberFormat","NumberFormat","numberFormat","internal","regexpState","opt","internals","dataLocale","s","cDigits","CurrencyDigits","cd","mnid","mnfdDefault","mnfd","mxfdDefault","mxfd","mnsd","minimumSignificantDigits","mxsd","maximumSignificantDigits","g","dataLocaleData","patterns","stylePatterns","positivePattern","negativePattern","es3","format","GetFormatNumber","currencyMinorUnits","babelHelpers","F","FormatNumber","bf","fnBind","FormatNumberToParts","PartitionNumberPattern","idx","part","nums","data","ild","symbols","latn","pattern","beginIndex","endIndex","nextIndex","Error","literal","[[type]]","[[value]]","p","nan","isFinite","_n2","ToRawPrecision","ToRawFixed","numSys","digits","digit","integer","fraction","decimalSepIndex","groupSepSymbol","group","groups","pgSize","primaryGroupSize","sgSize","secondaryGroupSize","end","start","integerGroup","arrShift","decimalSepSymbol","decimal","_n","infinity","plusSignSymbol","plusSign","minusSignSymbol","minusSign","percentSignSymbol","percentSign","currencies","_literal","_literal2","minPrecision","maxPrecision","e","Array","abs","f","LN10","cut","minInteger","minFraction","maxFraction","pow","toFixed","int","z","a","b","_z","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","push","full","medium","originalPattern","resolveDateString","ca","component","width","gregory","alts","resolved","DateTimeFormatConstructor","InitializeDateTimeFormat","DateTimeFormat","dateTimeFormat","ToDateTimeOptions","tz","timeZone","prop","dateTimeComponents","bestFormat","ToDateTimeFormats","BasicFormatMatcher","_hr","BestFitFormatMatcher","_prop","hr12","hourNo0","GetFormatDateTime","toString","required","defaults","opt2","create","needDefaults","removalPenalty","additionPenalty","longLessPenalty","longMorePenalty","shortLessPenalty","shortMorePenalty","bestScore","Infinity","score","optionsProp","formatProp","optionsPropIndex","formatPropIndex","delta","min","hour12Penalty","Date","now","FormatDateTime","GetFormatToPartsDateTime","FormatToPartsDateTime","CreateDateTimeParts","nf","useGrouping","nf2","minimumIntegerDigits","tm","ToLocalTime","index","calendars","fv","v","dateWidths","_v","substr","date","calendar","d","addLocaleData","number","nu","realDefineProp","sentinel","__defineGetter__","name","desc","get","search","t","proto","props","arrConcat","concat","join","shift","Function","bind","thisObj","fn","args","random","extlang","language","script","region","variant","singleton","privateuse","irregular","regular","grandfathered","langtag","getCanonicalLocales","ll","code","BYR","XOF","BIF","XAF","CLF","CLP","KMF","DJF","GNF","ISK","IQD","JPY","JOD","KRW","KWD","LYD","PYG","RWF","TND","UGX","UYI","VUV","VND","formatToParts","descs","narrow","short","long","ls","__localeSensitiveProtos","toLocaleString","toLocaleDateString","toLocaleTimeString","IntlPolyfill","__applyLocaleSensitivePrototypes"],"mappings":"uLA8FO,SAASA,GAAYC,MAEE,kBAAfC,MAAKC,MACZ,MAAOD,MAAKE,MAAMF,KAAKC,MAAMF,OAE7BI,GAAIH,KAAKI,MAAMJ,KAAKK,IAAIN,GAAKC,KAAKM,cAC/BH,IAAKI,OAAO,KAAOJ,GAAKJ,GAM5B,QAASS,GAAQC,OAEf,GAAIC,KAAKD,IACNA,YAAeD,IAAUG,GAAIC,KAAKH,EAAKC,KACvCG,GAAeC,KAAMJ,GAAKK,MAAON,EAAIC,GAAIM,YAAY,EAAMC,UAAU,EAAMC,cAAc,IAQ9F,QAASC,QACGL,KAAM,UAAYG,UAAS,EAAMF,MAAO,IAEnDK,UAAUC,QACVC,GAAQC,MAAMT,KAAMU,GAASZ,KAAKQ,YAOnC,QAASK,SAUP,GATDC,GAAM,uBACNC,EAAMC,OAAOC,WAAa,GAC1BC,EAAMF,OAAOG,UAAY,IAAM,GAC/BC,GAAQC,MAAOL,OAAOK,OACtBC,EAAM,GAAIf,GACVgB,GAAM,EACNC,KAGKC,EAAI,EAAQ,GAALA,EAAQA,OACbD,EAAI,IAAIC,GAAKT,OAAO,IAAIS,KAAOF,OAGrCR,EAAGW,QAAQZ,EAAK,QAGjBS,MACK,GAAII,GAAI,EAAQ,GAALA,EAAQA,IAAK,IACrBC,GAAIJ,EAAI,IAAIG,EAGXC,MAKGA,EAAEF,QAAQZ,EAAK,UACdC,EAAGW,QAAQE,EAAG,IAAMA,EAAI,MAL7Bb,EAAK,KAAOA,KASRf,KAAKsB,EAAKP,EAAGc,MAAM,EAAGd,EAAGe,QAAQ,KAAO,MAC3Cf,EAAGc,MAAMd,EAAGe,QAAQ,KAAO,YAKpCC,IAAM,GAAIf,QAAOgB,GAAQhC,KAAKsB,EAAK,IAAMP,EAAIG,GAE1CE,EAMJ,QA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B,IAAM8V,IAAU,6BAOVC,GAAW,oBAAsBD,GAAU,0BAG3CE,GAAS,WAITC,GAAS,sBAITC,GAAU,mCASVC,GAAY,cAGZxS,GAAYwS,GAAY,sBAGxBC,GAAa,uBAmBbC,GAAY,sHAaZC,GAAU,gFAKVC,GAAgB,MAAQF,GAAY,IAAMC,GAAU,IAQpDE,GAAUT,GAAW,OAASC,GAAS,SAAWC,GAAS,SACvDC,GAAU,SAAWvS,GAAY,SAAWyS,GAAa,KAKxD3V,GAAiBjC,OAAO,OAAOgY,GAAQ,IAAIJ,GAAW,IAAIG,GAAc,KAAM,KAG9E5V,GAAkBnC,OAAO,cAAc0X,GAAQ,+BAAgC,KAG/EtV,GAAoBpC,OAAO,cAAc2X,GAAU,2BAA4B,KAG/EhV,GAAkB3C,OAAO,IAAImF,GAAW,MCnFxC/B,UAMLN,uBAEgB,cACL,cACA,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,eACF,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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