Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

intl-messageformat

Package Overview
Dependencies
Maintainers
10
Versions
268
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

intl-messageformat - npm Package Compare versions

Comparing version 6.0.3 to 6.0.4

8

CHANGELOG.md

@@ -6,2 +6,10 @@ # Change Log

## [6.0.4](https://github.com/formatjs/formatjs/compare/intl-messageformat@6.0.3...intl-messageformat@6.0.4) (2019-08-07)
**Note:** Version bump only for package intl-messageformat
## [6.0.3](https://github.com/formatjs/formatjs/compare/intl-messageformat@6.0.2...intl-messageformat@6.0.3) (2019-08-06)

@@ -8,0 +16,0 @@

2

dist/umd/intl-messageformat.min.js

@@ -1,2 +0,2 @@

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e=e||self).IntlMessageFormat={})}(this,function(e){"use strict";var tt,t;function v(e){return e.type===tt.literal}function d(e){return e.type===tt.argument}function y(e){return e.type===tt.number}function g(e){return e.type===tt.date}function b(e){return e.type===tt.time}function A(e){return e.type===tt.select}function x(e){return e.type===tt.plural}(t=tt||(tt={}))[t.literal=0]="literal",t[t.argument=1]="argument",t[t.number=2]="number",t[t.date=3]="date",t[t.time=4]="time",t[t.select=5]="select",t[t.plural=6]="plural";var n,o,r=(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),rt=function(){return(rt=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var u in t=arguments[r])Object.prototype.hasOwnProperty.call(t,u)&&(e[u]=t[u]);return e}).apply(this,arguments)},nt=(o=Error,r(a,o),a.buildMessage=function(e,t){function r(e){return e.charCodeAt(0).toString(16).toUpperCase()}function n(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(e){return"\\x0"+r(e)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(e){return"\\x"+r(e)})}function u(e){return e.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(e){return"\\x0"+r(e)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(e){return"\\x"+r(e)})}function o(e){switch(e.type){case"literal":return'"'+n(e.text)+'"';case"class":var t=e.parts.map(function(e){return Array.isArray(e)?u(e[0])+"-"+u(e[1]):u(e)});return"["+(e.inverted?"^":"")+t+"]";case"any":return"any character";case"end":return"end of input";case"other":return e.description}}return"Expected "+function(e){var t,r,n=e.map(o);if(n.sort(),0<n.length){for(r=t=1;t<n.length;t++)n[t-1]!==n[t]&&(n[r]=n[t],r++);n.length=r}switch(n.length){case 1:return n[0];case 2:return n[0]+" or "+n[1];default:return n.slice(0,-1).join(", ")+", or "+n[n.length-1]}}(e)+" but "+((a=t)?'"'+n(a)+'"':"end of input")+" found.";var a},a);function a(e,t,r,n){var u=o.call(this)||this;return u.message=e,u.expected=t,u.found=r,u.location=n,u.name="SyntaxError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(u,a),u}var f=function(f,e){e=void 0!==e?e:{};var t,r,n,u,p={},o={start:Re},a=Re,i=function(e){return e.join("")},s=function(e){return rt({type:tt.literal,value:e},et())},c=Pe("argumentElement"),h="{",m=Me("{",!1),v="}",d=Me("}",!1),l=function(e){return rt({type:tt.argument,value:e},et())},y=Pe("numberSkeletonId"),g=/^['\/{}]/,b=ke(["'","/","{","}"],!1,!1),A={type:"any"},x=Pe("numberSkeletonTokenOption"),w="/",C=Me("/",!1),F=function(e){return e},O=Pe("numberSkeletonToken"),E=function(e,t){return{stem:e,options:t}},_=function(e){return rt({type:0,tokens:e},et())},T="::",j=Me("::",!1),M=function(e){return e},k=function(e){return e.replace(/\s*$/,"")},P=",",D=Me(",",!1),I="number",N=Me("number",!1),R=function(e,t,r){return rt({type:"number"===t?tt.number:"date"===t?tt.date:tt.time,style:r&&r[2],value:e},et())},S=function(e){return rt({type:1,pattern:e},et())},B="date",L=Me("date",!1),X="time",H=Me("time",!1),Z="plural",$=Me("plural",!1),z="selectordinal",J=Me("selectordinal",!1),U="offset:",q=Me("offset:",!1),G=function(e,t,r,n){return rt({type:tt.plural,pluralType:"plural"===t?"cardinal":"ordinal",value:e,offset:r?r[2]:0,options:n.reduce(function(e,t){var r=t.id,n=t.value,u=t.location;return e[r]={value:n,location:u},e},{})},et())},K="select",Q=Me("select",!1),V=function(e,t){return rt({type:tt.select,value:e,options:t.reduce(function(e,t){var r=t.id,n=t.value,u=t.location;return e[r]={value:n,location:u},e},{})},et())},W="=",Y=Me("=",!1),ee=function(e,t){return rt({id:e,value:t},et())},te=function(e,t){return rt({id:e,value:t},et())},re=/^[\t-\r \x85\u200E\u200F\u2028\u2029]/,ne=ke([["\t","\r"]," ","…","‎","‏","\u2028","\u2029"],!1,!1),ue=/^[!-\/:-@[-\^`{-~\xA1-\xA7\xA9\xAB\xAC\xAE\xB0\xB1\xB6\xBB\xBF\xD7\xF7\u2010-\u2027\u2030-\u203E\u2041-\u2053\u2055-\u205E\u2190-\u245F\u2500-\u2775\u2794-\u2BFF\u2E00-\u2E7F\u3001-\u3003\u3008-\u3020\u3030\uFD3E\uFD3F\uFE45\uFE46]/,oe=ke([["!","/"],[":","@"],["[","^"],"`",["{","~"],["¡","§"],"©","«","¬","®","°","±","¶","»","¿","×","÷",["‐","‧"],["‰","‾"],["⁁","⁓"],["⁕","⁞"],["←","⑟"],["─","❵"],["➔","⯿"],["⸀","⹿"],["、","〃"],["〈","〠"],"〰","﴾","﴿","﹅","﹆"],!1,!1),ae=Pe("optional whitespace"),ie=/^[0-9]/,se=ke([["0","9"]],!1,!1),ce=function(e){return parseInt(e.join(""),10)},le="'",fe=Me("'",!1),pe=Pe("double apostrophes"),he="''",me=Me("''",!1),ve=function(){return"'"},de=/^[{}]/,ye=ke(["{","}"],!1,!1),ge=/^[^']/,be=ke(["'"],!0,!1),Ae=function(e,t){return e+t.replace("''","'")},xe=/^[^{}]/,we=ke(["{","}"],!0,!1),Ce=Pe("keyword"),Fe=0,Oe=0,Ee=[{line:1,column:1}],_e=0,Te=[],je=0;if(void 0!==e.startRule){if(!(e.startRule in o))throw new Error("Can't start parsing from rule \""+e.startRule+'".');a=o[e.startRule]}function Me(e,t){return{type:"literal",text:e,ignoreCase:t}}function ke(e,t,r){return{type:"class",parts:e,inverted:t,ignoreCase:r}}function Pe(e){return{type:"other",description:e}}function De(e){var t,r=Ee[e];if(r)return r;for(t=e-1;!Ee[t];)t--;for(r={line:(r=Ee[t]).line,column:r.column};t<e;)10===f.charCodeAt(t)?(r.line++,r.column=1):r.column++,t++;return Ee[e]=r}function Ie(e,t){var r=De(e),n=De(t);return{start:{offset:e,line:r.line,column:r.column},end:{offset:t,line:n.line,column:n.column}}}function Ne(e){Fe<_e||(_e<Fe&&(_e=Fe,Te=[]),Te.push(e))}function Re(){return Se()}function Se(){var e,t;for(e=[],t=Be();t!==p;)e.push(t),t=Be();return e}function Be(){var e;return(e=function(){var e,t;e=Fe,(t=Le())!==p&&(Oe=e,t=s(t));return e=t}())===p&&(e=function(){var e,t,r,n,u;je++,e=Fe,123===f.charCodeAt(Fe)?(t=h,Fe++):(t=p,0===je&&Ne(m));e=t!==p?(r=Ge(),r!==p?(n=Xe())!==p?Ge()!==p?(125===f.charCodeAt(Fe)?(u=v,Fe++):(u=p,0===je&&Ne(d)),u!==p?(Oe=e,t=l(n)):(Fe=e,p)):(Fe=e,p):(Fe=e,p):(Fe=e,p)):(Fe=e,p);je--,e===p&&(t=p,0===je&&Ne(c));return e}())===p&&(e=function(){var e;(e=function(){var e,t,r,n,u,o,a,i,s,c;e=Fe,123===f.charCodeAt(Fe)?(t=h,Fe++):(t=p,0===je&&Ne(m));e=t!==p?(r=Ge(),r!==p?(n=Xe())!==p?Ge()!==p?(44===f.charCodeAt(Fe)?(u=P,Fe++):(u=p,0===je&&Ne(D)),u!==p?Ge()!==p?(f.substr(Fe,6)===I?(o=I,Fe+=6):(o=p,0===je&&Ne(N)),o!==p?Ge()!==p?(a=Fe,44===f.charCodeAt(Fe)?(i=P,Fe++):(i=p,0===je&&Ne(D)),(a=i!==p?(s=Ge())!==p?(c=function(){var e,t,r;e=Fe,f.substr(Fe,2)===T?(t=T,Fe+=2):(t=p,0===je&&Ne(j));e=t!==p?(r=function(){var e,t,r;if(e=Fe,t=[],(r=$e())!==p)for(;r!==p;)t.push(r),r=$e();else t=p;t!==p&&(Oe=e,t=_(t));return e=t}(),r!==p?(Oe=e,t=M(r)):(Fe=e,p)):(Fe=e,p);e===p&&(e=Fe,(t=Le())!==p&&(Oe=e,t=k(t)),e=t);return e}())!==p?i=[i,s,c]:(Fe=a,p):(Fe=a,p):(Fe=a,p))===p&&(a=null),a!==p?(i=Ge())!==p?(125===f.charCodeAt(Fe)?(s=v,Fe++):(s=p,0===je&&Ne(d)),s!==p?(Oe=e,t=R(n,o,a)):(Fe=e,p)):(Fe=e,p):(Fe=e,p)):(Fe=e,p):(Fe=e,p)):(Fe=e,p):(Fe=e,p)):(Fe=e,p):(Fe=e,p):(Fe=e,p)):(Fe=e,p);return e}())===p&&(e=function(){var e,t,r,n,u,o,a,i,s,c;e=Fe,123===f.charCodeAt(Fe)?(t=h,Fe++):(t=p,0===je&&Ne(m));e=t!==p?(r=Ge(),r!==p?(n=Xe())!==p?Ge()!==p?(44===f.charCodeAt(Fe)?(u=P,Fe++):(u=p,0===je&&Ne(D)),u!==p?Ge()!==p?(f.substr(Fe,4)===B?(o=B,Fe+=4):(o=p,0===je&&Ne(L)),o===p&&(f.substr(Fe,4)===X?(o=X,Fe+=4):(o=p,0===je&&Ne(H))),o!==p?Ge()!==p?(a=Fe,44===f.charCodeAt(Fe)?(i=P,Fe++):(i=p,0===je&&Ne(D)),(a=i!==p?(s=Ge())!==p?(c=function(){var e,t,r;e=Fe,f.substr(Fe,2)===T?(t=T,Fe+=2):(t=p,0===je&&Ne(j));e=t!==p?(r=function(){var e,t;e=Fe,(t=Le())!==p&&(Oe=e,t=S(t));return e=t}(),r!==p?(Oe=e,t=M(r)):(Fe=e,p)):(Fe=e,p);e===p&&(e=Fe,(t=Le())!==p&&(Oe=e,t=k(t)),e=t);return e}())!==p?i=[i,s,c]:(Fe=a,p):(Fe=a,p):(Fe=a,p))===p&&(a=null),a!==p?(i=Ge())!==p?(125===f.charCodeAt(Fe)?(s=v,Fe++):(s=p,0===je&&Ne(d)),s!==p?(Oe=e,t=R(n,o,a)):(Fe=e,p)):(Fe=e,p):(Fe=e,p)):(Fe=e,p):(Fe=e,p)):(Fe=e,p):(Fe=e,p)):(Fe=e,p):(Fe=e,p):(Fe=e,p)):(Fe=e,p);return e}());return e}())===p&&(e=function(){var e,t,r,n,u,o,a,i,s,c,l;e=Fe,123===f.charCodeAt(Fe)?(t=h,Fe++):(t=p,0===je&&Ne(m));if(t!==p)if(Ge()!==p)if((r=Xe())!==p)if(Ge()!==p)if(44===f.charCodeAt(Fe)?(n=P,Fe++):(n=p,0===je&&Ne(D)),n!==p)if(Ge()!==p)if(f.substr(Fe,6)===Z?(u=Z,Fe+=6):(u=p,0===je&&Ne($)),u===p&&(f.substr(Fe,13)===z?(u=z,Fe+=13):(u=p,0===je&&Ne(J))),u!==p)if(Ge()!==p)if(44===f.charCodeAt(Fe)?(o=P,Fe++):(o=p,0===je&&Ne(D)),o!==p)if(Ge()!==p)if(a=Fe,f.substr(Fe,7)===U?(i=U,Fe+=7):(i=p,0===je&&Ne(q)),(a=i!==p?(s=Ge())!==p?(c=Ke())!==p?i=[i,s,c]:(Fe=a,p):(Fe=a,p):(Fe=a,p))===p&&(a=null),a!==p)if((i=Ge())!==p){if(s=[],(c=Je())!==p)for(;c!==p;)s.push(c),c=Je();else s=p;e=s!==p?(c=Ge())!==p?(125===f.charCodeAt(Fe)?(l=v,Fe++):(l=p,0===je&&Ne(d)),l!==p?(Oe=e,t=G(r,u,a,s)):(Fe=e,p)):(Fe=e,p):(Fe=e,p)}else Fe=e,e=p;else Fe=e,e=p;else Fe=e,e=p;else Fe=e,e=p;else Fe=e,e=p;else Fe=e,e=p;else Fe=e,e=p;else Fe=e,e=p;else Fe=e,e=p;else Fe=e,e=p;else Fe=e,e=p;else Fe=e,e=p;return e}())===p&&(e=function(){var e,t,r,n,u,o,a,i,s;e=Fe,123===f.charCodeAt(Fe)?(t=h,Fe++):(t=p,0===je&&Ne(m));if(t!==p)if(Ge()!==p)if((r=Xe())!==p)if(Ge()!==p)if(44===f.charCodeAt(Fe)?(n=P,Fe++):(n=p,0===je&&Ne(D)),n!==p)if(Ge()!==p)if(f.substr(Fe,6)===K?(u=K,Fe+=6):(u=p,0===je&&Ne(Q)),u!==p)if(Ge()!==p)if(44===f.charCodeAt(Fe)?(o=P,Fe++):(o=p,0===je&&Ne(D)),o!==p)if(Ge()!==p){if(a=[],(i=ze())!==p)for(;i!==p;)a.push(i),i=ze();else a=p;e=a!==p?(i=Ge())!==p?(125===f.charCodeAt(Fe)?(s=v,Fe++):(s=p,0===je&&Ne(d)),s!==p?(Oe=e,t=V(r,a)):(Fe=e,p)):(Fe=e,p):(Fe=e,p)}else Fe=e,e=p;else Fe=e,e=p;else Fe=e,e=p;else Fe=e,e=p;else Fe=e,e=p;else Fe=e,e=p;else Fe=e,e=p;else Fe=e,e=p;else Fe=e,e=p;else Fe=e,e=p;return e}()),e}function Le(){var e,t,r;if(e=Fe,t=[],(r=Qe())===p&&(r=Ve())===p&&(r=We()),r!==p)for(;r!==p;)t.push(r),(r=Qe())===p&&(r=Ve())===p&&(r=We());else t=p;return t!==p&&(Oe=e,t=i(t)),e=t}function Xe(){var e,t;return e=Fe,(t=Ke())===p&&(t=Ye()),e=t!==p?f.substring(e,Fe):t}function He(){var e,t,r,n,u;if(je++,t=[],n=r=e=Fe,je++,(u=Ue())===p&&(g.test(f.charAt(Fe))?(u=f.charAt(Fe),Fe++):(u=p,0===je&&Ne(b))),je--,(r=(n=u===p?void 0:(Fe=n,p))!==p?(f.length>Fe?(u=f.charAt(Fe),Fe++):(u=p,0===je&&Ne(A)),u!==p?n=[n,u]:(Fe=r,p)):(Fe=r,p))!==p)for(;r!==p;)t.push(r),n=r=Fe,je++,(u=Ue())===p&&(g.test(f.charAt(Fe))?(u=f.charAt(Fe),Fe++):(u=p,0===je&&Ne(b))),je--,r=(n=u===p?void 0:(Fe=n,p))!==p?(f.length>Fe?(u=f.charAt(Fe),Fe++):(u=p,0===je&&Ne(A)),u!==p?n=[n,u]:(Fe=r,p)):(Fe=r,p);else t=p;return e=t!==p?f.substring(e,Fe):t,je--,e===p&&(t=p,0===je&&Ne(y)),e}function Ze(){var e,t,r;return je++,e=Fe,47===f.charCodeAt(Fe)?(t=w,Fe++):(t=p,0===je&&Ne(C)),e=t!==p&&(r=He())!==p?(Oe=e,t=F(r)):(Fe=e,p),je--,e===p&&(t=p,0===je&&Ne(x)),e}function $e(){var e,t,r,n;if(je++,e=Fe,Ge()!==p)if((t=He())!==p){for(r=[],n=Ze();n!==p;)r.push(n),n=Ze();e=r!==p?(Oe=e,E(t,r)):(Fe=e,p)}else Fe=e,e=p;else Fe=e,e=p;return je--,e===p&&(p,0===je&&Ne(O)),e}function ze(){var e,t,r,n,u;return e=Fe,e=Ge()!==p&&(t=Ye())!==p&&Ge()!==p?(123===f.charCodeAt(Fe)?(r=h,Fe++):(r=p,0===je&&Ne(m)),r!==p&&(n=Se())!==p?(125===f.charCodeAt(Fe)?(u=v,Fe++):(u=p,0===je&&Ne(d)),u!==p?(Oe=e,ee(t,n)):(Fe=e,p)):(Fe=e,p)):(Fe=e,p)}function Je(){var e,t,r,n,u;return e=Fe,e=Ge()!==p&&(t=function(){var e,t,r,n;return t=e=Fe,61===f.charCodeAt(Fe)?(r=W,Fe++):(r=p,0===je&&Ne(Y)),(e=(t=r!==p&&(n=Ke())!==p?r=[r,n]:(Fe=t,p))!==p?f.substring(e,Fe):t)===p&&(e=Ye()),e}())!==p&&Ge()!==p?(123===f.charCodeAt(Fe)?(r=h,Fe++):(r=p,0===je&&Ne(m)),r!==p&&(n=Se())!==p?(125===f.charCodeAt(Fe)?(u=v,Fe++):(u=p,0===je&&Ne(d)),u!==p?(Oe=e,te(t,n)):(Fe=e,p)):(Fe=e,p)):(Fe=e,p)}function Ue(){var e;return re.test(f.charAt(Fe))?(e=f.charAt(Fe),Fe++):(e=p,0===je&&Ne(ne)),e}function qe(){var e;return ue.test(f.charAt(Fe))?(e=f.charAt(Fe),Fe++):(e=p,0===je&&Ne(oe)),e}function Ge(){var e,t,r;for(je++,e=Fe,t=[],r=Ue();r!==p;)t.push(r),r=Ue();return e=t!==p?f.substring(e,Fe):t,je--,e===p&&(t=p,0===je&&Ne(ae)),e}function Ke(){var e,t,r;if(e=Fe,t=[],ie.test(f.charAt(Fe))?(r=f.charAt(Fe),Fe++):(r=p,0===je&&Ne(se)),r!==p)for(;r!==p;)t.push(r),ie.test(f.charAt(Fe))?(r=f.charAt(Fe),Fe++):(r=p,0===je&&Ne(se));else t=p;return t!==p&&(Oe=e,t=ce(t)),e=t}function Qe(){var e,t;return je++,e=Fe,f.substr(Fe,2)===he?(t=he,Fe+=2):(t=p,0===je&&Ne(me)),t!==p&&(Oe=e,t=ve()),je--,(e=t)===p&&(t=p,0===je&&Ne(pe)),e}function Ve(){var e,t,r,n,u,o;if(e=Fe,39===f.charCodeAt(Fe)?(t=le,Fe++):(t=p,0===je&&Ne(fe)),t!==p)if(de.test(f.charAt(Fe))?(r=f.charAt(Fe),Fe++):(r=p,0===je&&Ne(ye)),r!==p){for(n=Fe,u=[],f.substr(Fe,2)===he?(o=he,Fe+=2):(o=p,0===je&&Ne(me)),o===p&&(ge.test(f.charAt(Fe))?(o=f.charAt(Fe),Fe++):(o=p,0===je&&Ne(be)));o!==p;)u.push(o),f.substr(Fe,2)===he?(o=he,Fe+=2):(o=p,0===je&&Ne(me)),o===p&&(ge.test(f.charAt(Fe))?(o=f.charAt(Fe),Fe++):(o=p,0===je&&Ne(be)));e=(n=u!==p?f.substring(n,Fe):u)!==p?(39===f.charCodeAt(Fe)?(u=le,Fe++):(u=p,0===je&&Ne(fe)),u!==p?(Oe=e,t=Ae(r,n)):(Fe=e,p)):(Fe=e,p)}else Fe=e,e=p;else Fe=e,e=p;return e}function We(){var e,t;return e=Fe,xe.test(f.charAt(Fe))?(t=f.charAt(Fe),Fe++):(t=p,0===je&&Ne(we)),e=t!==p?f.substring(e,Fe):t}function Ye(){var e,t,r,n,u;if(je++,t=[],n=r=e=Fe,je++,(u=Ue())===p&&(u=qe()),je--,(r=(n=u===p?void 0:(Fe=n,p))!==p?(f.length>Fe?(u=f.charAt(Fe),Fe++):(u=p,0===je&&Ne(A)),u!==p?n=[n,u]:(Fe=r,p)):(Fe=r,p))!==p)for(;r!==p;)t.push(r),n=r=Fe,je++,(u=Ue())===p&&(u=qe()),je--,r=(n=u===p?void 0:(Fe=n,p))!==p?(f.length>Fe?(u=f.charAt(Fe),Fe++):(u=p,0===je&&Ne(A)),u!==p?n=[n,u]:(Fe=r,p)):(Fe=r,p);else t=p;return e=t!==p?f.substring(e,Fe):t,je--,e===p&&(t=p,0===je&&Ne(Ce)),e}function et(){return e&&e.captureLocation?{location:Ie(Oe,Fe)}:{}}if((t=a())!==p&&Fe===f.length)return t;throw t!==p&&Fe<f.length&&Ne({type:"end"}),r=Te,n=_e<f.length?f.charAt(_e):null,u=_e<f.length?Ie(_e,_e+1):Ie(_e,_e),new nt(nt.buildMessage(r,n),r,n,u)},p=/(^|[^\\])#/g;function i(e){return JSON.stringify(e.map(function(e){return e&&"object"==typeof e?function(r){return Object.keys(r).sort().map(function(e){var t;return(t={})[e]=r[e],t})}(e):e}))}var u,s,h,c=function(o,a){return void 0===a&&(a={}),function(){for(var e,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=i(t),u=n&&a[n];return u||(u=new((e=o).bind.apply(e,[void 0].concat(t))),n&&(a[n]=u)),u}},l=(u=function(e,t){return(u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}u(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),w=/\\#/g,C=(s=Error,l(m,s),m);function m(e,t){var r=s.call(this,e)||this;return r.variableId=t,r}function F(e,t,r,n,u,o){if(1===e.length&&v(e[0]))return[{type:0,value:e[0].value.replace(w,"#")}];for(var a=[],i=0,s=e;i<s.length;i++){var c=s[i];if(v(c))a.push({type:0,value:c.value.replace(w,"#")});else{var l=c.value;if(!(u&&l in u))throw new C('The intl string context variable "'+l+'" was not provided to the string "'+o+'"');var f=u[l];if(d(c))f&&"string"!=typeof f&&"number"!=typeof f?a.push({type:1,value:f}):a.push({type:0,value:"string"==typeof f||"number"==typeof f?String(f):""});else if(g(c)){var p="string"==typeof c.style?n.date[c.style]:void 0;a.push({type:0,value:r.getDateTimeFormat(t,p).format(f)})}else if(b(c)){p="string"==typeof c.style?n.time[c.style]:void 0;a.push({type:0,value:r.getDateTimeFormat(t,p).format(f)})}else if(y(c)){p="string"==typeof c.style?n.number[c.style]:void 0;a.push({type:0,value:r.getNumberFormat(t,p).format(f)})}else if(A(c)){if(!(h=c.options[f]||c.options.other))throw new RangeError('Invalid values for "'+c.value+'": "'+f+'". Options are "'+Object.keys(c.options).join('", "')+'"');a.push.apply(a,F(h.value,t,r,n,u))}else if(x(c)){var h;if(!(h=c.options["="+f])){var m=r.getPluralRules(t,{type:c.pluralType}).select(f-(c.offset||0));h=c.options[m]||c.options.other}if(!h)throw new RangeError('Invalid values for "'+c.value+'": "'+f+'". Options are "'+Object.keys(c.options).join('", "')+'"');a.push.apply(a,F(h.value,t,r,n,u))}else;}}return function(e){return e.length<2?e:e.reduce(function(e,t){var r=e[e.length-1];return r&&0===r.type&&0===t.type?r.value+=t.value:e.push(t),e},[])}(a)}function O(e,t,r,n,u,o){var a=F(e,t,r,n,u,o);return 1===a.length?a[0].value:a.reduce(function(e,t){return e+t.value},"")}var E="@@",_=/@@(.*?)@@/g,T=0;function j(e,t){return e.split(_).filter(Boolean).map(function(e){return t[e]||e})}function M(e,t,r,n,i,u){var o=F(e,t,r,n,i,u),s={},a=o.reduce(function(e,t){if("string"==typeof t.value||0===t.type)return e+t.value;var r=Date.now()+"_"+ ++T;return s[r]=t.value,e+(E+r)+E},"");if(!~a.indexOf("<"))return j(a,s);if(!i)throw new C("Message has placeholders but no values was given");if("undefined"==typeof DOMParser)throw new C("Cannot format XML message without DOMParser");h||(h=new DOMParser);var c=h.parseFromString("<template>"+a+"</template>","application/xml");if(c.getElementsByTagName("parsererror").length)throw new C("Malformed XML message "+c.getElementsByTagName("parsererror")[0].innerHTML);var l=c.firstChild;if(!l)throw new C("Malformed XML message "+a);return Object.keys(i).filter(function(e){return!!c.getElementsByTagName(e).length}).length?Array.prototype.slice.call(l.childNodes).reduce(function(e,t){var r=t.tagName,n=t.outerHTML,u=t.textContent;if(!r){var o=j(u||"",s);return e.concat(o)}if(!i[r])return 1===(o=j(n,s)).length?e.concat([o[0]]):e.concat(o);var a=i[r];if("function"!=typeof a)return e.concat([a]);if(null==u)return e.concat([a(u||void 0)]);o=j(u,s);return e.concat([a.apply(void 0,o)])},[]):j(a,s)}var k=function(){return(k=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var u in t=arguments[r])Object.prototype.hasOwnProperty.call(t,u)&&(e[u]=t[u]);return e}).apply(this,arguments)};function P(r,n){return n?Object.keys(r).reduce(function(e,t){return e[t]=function(r,n){return n?k({},r||{},n||{},Object.keys(r).reduce(function(e,t){return e[t]=k({},r[t],n[t]||{}),e},{})):r}(r[t],n[t]),e},k({},r)):r}function D(e){return void 0===e&&(e={number:{},dateTime:{},pluralRules:{}}),{getNumberFormat:c(Intl.NumberFormat,e.number),getDateTimeFormat:c(Intl.DateTimeFormat,e.dateTime),getPluralRules:c(Intl.PluralRules,e.pluralRules)}}var I=(N.defaultLocale="en",N.__parse=void 0,N.formats={number:{currency:{style:"currency"},percent:{style:"percent"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}},N);function N(e,t,r,n){var u=this;if(void 0===t&&(t=N.defaultLocale),this.formatterCache={number:{},dateTime:{},pluralRules:{}},this.format=function(e){return O(u.ast,u.locale,u.formatters,u.formats,e,u.message)},this.formatToParts=function(e){return F(u.ast,u.locale,u.formatters,u.formats,e,u.message)},this.formatXMLMessage=function(e){return M(u.ast,u.locale,u.formatters,u.formats,e,u.message)},this.resolvedOptions=function(){return{locale:u.locale}},this.getAst=function(){return u.ast},"string"==typeof e){if(this.message=e,!N.__parse)throw new TypeError("IntlMessageFormat.__parse must be set to process `message` of type `string`");this.ast=N.__parse(e)}else this.ast=e;if(!Array.isArray(this.ast))throw new TypeError("A message must be provided as a String or AST.");this.formats=P(N.formats,r),this.locale=function(e){"string"==typeof e&&(e=[e]);try{return Intl.NumberFormat.supportedLocalesOf(e,{localeMatcher:"best fit"})[0]}catch(e){return I.defaultLocale}}(t||[]),this.formatters=n&&n.formatters||D(this.formatterCache),function r(e,n,u,o){e.filter(function(e){return!d(e)&&!v(e)}).forEach(function(t){if(g(t)){var e="string"==typeof t.style?o.date[t.style]:void 0;u.getDateTimeFormat(n,e)}b(t)&&(e="string"==typeof t.style?o.time[t.style]:void 0,u.getDateTimeFormat(n,e)),y(t)&&(e="string"==typeof t.style?o.number[t.style]:void 0,u.getNumberFormat(n,e)),A(t)&&Object.keys(t.options).forEach(function(e){return r(t.options[e].value,n,u,o)}),x(t)&&(u.getPluralRules(n,{type:t.pluralType}),Object.keys(t.options).forEach(function(e){return r(t.options[e].value,n,u,o)}))})}(this.ast,this.locale,this.formatters,this.formats)}I.__parse=function(e,t){var r=f(e,t);return t&&!1===t.normalizeHashtagInPlural||function l(e){e.forEach(function(c){x(c)&&Object.keys(c.options).forEach(function(e){for(var t,r=c.options[e],n=-1,u=void 0,o=0;o<r.value.length;o++){var a=r.value[o];if(v(a)&&p.test(a.value)){n=o,u=a;break}}if(u){var i=u.value.replace(p,"$1{"+c.value+", number}"),s=f(i);(t=r.value).splice.apply(t,[n,1].concat(s))}l(r.value)})})}(r),r},e.IntlMessageFormat=I,e.createDefaultFormatters=D,e.default=I,e.formatToParts=F,e.formatToString=O,e.formatXMLMessage=M,Object.defineProperty(e,"__esModule",{value:!0})});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e=e||self).IntlMessageFormat={})}(this,function(e){"use strict";var tt,t;function v(e){return e.type===tt.literal}function d(e){return e.type===tt.argument}function y(e){return e.type===tt.number}function g(e){return e.type===tt.date}function b(e){return e.type===tt.time}function A(e){return e.type===tt.select}function x(e){return e.type===tt.plural}(t=tt||(tt={}))[t.literal=0]="literal",t[t.argument=1]="argument",t[t.number=2]="number",t[t.date=3]="date",t[t.time=4]="time",t[t.select=5]="select",t[t.plural=6]="plural";var n,o,r=(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),rt=function(){return(rt=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var u in t=arguments[r])Object.prototype.hasOwnProperty.call(t,u)&&(e[u]=t[u]);return e}).apply(this,arguments)},nt=(o=Error,r(a,o),a.buildMessage=function(e,t){function r(e){return e.charCodeAt(0).toString(16).toUpperCase()}function n(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(e){return"\\x0"+r(e)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(e){return"\\x"+r(e)})}function u(e){return e.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(e){return"\\x0"+r(e)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(e){return"\\x"+r(e)})}function o(e){switch(e.type){case"literal":return'"'+n(e.text)+'"';case"class":var t=e.parts.map(function(e){return Array.isArray(e)?u(e[0])+"-"+u(e[1]):u(e)});return"["+(e.inverted?"^":"")+t+"]";case"any":return"any character";case"end":return"end of input";case"other":return e.description}}return"Expected "+function(e){var t,r,n=e.map(o);if(n.sort(),0<n.length){for(r=t=1;t<n.length;t++)n[t-1]!==n[t]&&(n[r]=n[t],r++);n.length=r}switch(n.length){case 1:return n[0];case 2:return n[0]+" or "+n[1];default:return n.slice(0,-1).join(", ")+", or "+n[n.length-1]}}(e)+" but "+((a=t)?'"'+n(a)+'"':"end of input")+" found.";var a},a);function a(e,t,r,n){var u=o.call(this)||this;return u.message=e,u.expected=t,u.found=r,u.location=n,u.name="SyntaxError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(u,a),u}var f=function(f,e){e=void 0!==e?e:{};var t,r,n,u,p={},o={start:Re},a=Re,i=function(e){return e.join("")},s=function(e){return rt({type:tt.literal,value:e},et())},c=Pe("argumentElement"),h="{",m=Me("{",!1),v="}",d=Me("}",!1),l=function(e){return rt({type:tt.argument,value:e},et())},y=Pe("numberSkeletonId"),g=/^['\/{}]/,b=ke(["'","/","{","}"],!1,!1),A={type:"any"},x=Pe("numberSkeletonTokenOption"),w="/",C=Me("/",!1),F=function(e){return e},O=Pe("numberSkeletonToken"),E=function(e,t){return{stem:e,options:t}},_=function(e){return rt({type:0,tokens:e},et())},T="::",j=Me("::",!1),M=function(e){return e},k=function(e){return e.replace(/\s*$/,"")},P=",",D=Me(",",!1),I="number",N=Me("number",!1),R=function(e,t,r){return rt({type:"number"===t?tt.number:"date"===t?tt.date:tt.time,style:r&&r[2],value:e},et())},S=function(e){return rt({type:1,pattern:e},et())},B="date",L=Me("date",!1),X="time",H=Me("time",!1),Z="plural",$=Me("plural",!1),z="selectordinal",J=Me("selectordinal",!1),U="offset:",q=Me("offset:",!1),G=function(e,t,r,n){return rt({type:tt.plural,pluralType:"plural"===t?"cardinal":"ordinal",value:e,offset:r?r[2]:0,options:n.reduce(function(e,t){var r=t.id,n=t.value,u=t.location;return e[r]={value:n,location:u},e},{})},et())},K="select",Q=Me("select",!1),V=function(e,t){return rt({type:tt.select,value:e,options:t.reduce(function(e,t){var r=t.id,n=t.value,u=t.location;return e[r]={value:n,location:u},e},{})},et())},W="=",Y=Me("=",!1),ee=function(e,t){return rt({id:e,value:t},et())},te=function(e,t){return rt({id:e,value:t},et())},re=/^[\t-\r \x85\u200E\u200F\u2028\u2029]/,ne=ke([["\t","\r"]," ","…","‎","‏","\u2028","\u2029"],!1,!1),ue=/^[!-\/:-@[-\^`{-~\xA1-\xA7\xA9\xAB\xAC\xAE\xB0\xB1\xB6\xBB\xBF\xD7\xF7\u2010-\u2027\u2030-\u203E\u2041-\u2053\u2055-\u205E\u2190-\u245F\u2500-\u2775\u2794-\u2BFF\u2E00-\u2E7F\u3001-\u3003\u3008-\u3020\u3030\uFD3E\uFD3F\uFE45\uFE46]/,oe=ke([["!","/"],[":","@"],["[","^"],"`",["{","~"],["¡","§"],"©","«","¬","®","°","±","¶","»","¿","×","÷",["‐","‧"],["‰","‾"],["⁁","⁓"],["⁕","⁞"],["←","⑟"],["─","❵"],["➔","⯿"],["⸀","⹿"],["、","〃"],["〈","〠"],"〰","﴾","﴿","﹅","﹆"],!1,!1),ae=Pe("optional whitespace"),ie=/^[0-9]/,se=ke([["0","9"]],!1,!1),ce=function(e){return parseInt(e.join(""),10)},le="'",fe=Me("'",!1),pe=Pe("double apostrophes"),he="''",me=Me("''",!1),ve=function(){return"'"},de=/^[{}]/,ye=ke(["{","}"],!1,!1),ge=/^[^']/,be=ke(["'"],!0,!1),Ae=function(e,t){return e+t.replace("''","'")},xe=/^[^{}]/,we=ke(["{","}"],!0,!1),Ce=Pe("keyword"),Fe=0,Oe=0,Ee=[{line:1,column:1}],_e=0,Te=[],je=0;if(void 0!==e.startRule){if(!(e.startRule in o))throw new Error("Can't start parsing from rule \""+e.startRule+'".');a=o[e.startRule]}function Me(e,t){return{type:"literal",text:e,ignoreCase:t}}function ke(e,t,r){return{type:"class",parts:e,inverted:t,ignoreCase:r}}function Pe(e){return{type:"other",description:e}}function De(e){var t,r=Ee[e];if(r)return r;for(t=e-1;!Ee[t];)t--;for(r={line:(r=Ee[t]).line,column:r.column};t<e;)10===f.charCodeAt(t)?(r.line++,r.column=1):r.column++,t++;return Ee[e]=r}function Ie(e,t){var r=De(e),n=De(t);return{start:{offset:e,line:r.line,column:r.column},end:{offset:t,line:n.line,column:n.column}}}function Ne(e){Fe<_e||(_e<Fe&&(_e=Fe,Te=[]),Te.push(e))}function Re(){return Se()}function Se(){var e,t;for(e=[],t=Be();t!==p;)e.push(t),t=Be();return e}function Be(){var e;return(e=function(){var e,t;e=Fe,(t=Le())!==p&&(Oe=e,t=s(t));return e=t}())===p&&(e=function(){var e,t,r,n,u;je++,e=Fe,123===f.charCodeAt(Fe)?(t=h,Fe++):(t=p,0===je&&Ne(m));e=t!==p?(r=Ge(),r!==p?(n=Xe())!==p?Ge()!==p?(125===f.charCodeAt(Fe)?(u=v,Fe++):(u=p,0===je&&Ne(d)),u!==p?(Oe=e,t=l(n)):(Fe=e,p)):(Fe=e,p):(Fe=e,p):(Fe=e,p)):(Fe=e,p);je--,e===p&&(t=p,0===je&&Ne(c));return e}())===p&&(e=function(){var e;(e=function(){var e,t,r,n,u,o,a,i,s,c;e=Fe,123===f.charCodeAt(Fe)?(t=h,Fe++):(t=p,0===je&&Ne(m));e=t!==p?(r=Ge(),r!==p?(n=Xe())!==p?Ge()!==p?(44===f.charCodeAt(Fe)?(u=P,Fe++):(u=p,0===je&&Ne(D)),u!==p?Ge()!==p?(f.substr(Fe,6)===I?(o=I,Fe+=6):(o=p,0===je&&Ne(N)),o!==p?Ge()!==p?(a=Fe,44===f.charCodeAt(Fe)?(i=P,Fe++):(i=p,0===je&&Ne(D)),(a=i!==p?(s=Ge())!==p?(c=function(){var e,t,r;e=Fe,f.substr(Fe,2)===T?(t=T,Fe+=2):(t=p,0===je&&Ne(j));e=t!==p?(r=function(){var e,t,r;if(e=Fe,t=[],(r=$e())!==p)for(;r!==p;)t.push(r),r=$e();else t=p;t!==p&&(Oe=e,t=_(t));return e=t}(),r!==p?(Oe=e,t=M(r)):(Fe=e,p)):(Fe=e,p);e===p&&(e=Fe,(t=Le())!==p&&(Oe=e,t=k(t)),e=t);return e}())!==p?i=[i,s,c]:(Fe=a,p):(Fe=a,p):(Fe=a,p))===p&&(a=null),a!==p?(i=Ge())!==p?(125===f.charCodeAt(Fe)?(s=v,Fe++):(s=p,0===je&&Ne(d)),s!==p?(Oe=e,t=R(n,o,a)):(Fe=e,p)):(Fe=e,p):(Fe=e,p)):(Fe=e,p):(Fe=e,p)):(Fe=e,p):(Fe=e,p)):(Fe=e,p):(Fe=e,p):(Fe=e,p)):(Fe=e,p);return e}())===p&&(e=function(){var e,t,r,n,u,o,a,i,s,c;e=Fe,123===f.charCodeAt(Fe)?(t=h,Fe++):(t=p,0===je&&Ne(m));e=t!==p?(r=Ge(),r!==p?(n=Xe())!==p?Ge()!==p?(44===f.charCodeAt(Fe)?(u=P,Fe++):(u=p,0===je&&Ne(D)),u!==p?Ge()!==p?(f.substr(Fe,4)===B?(o=B,Fe+=4):(o=p,0===je&&Ne(L)),o===p&&(f.substr(Fe,4)===X?(o=X,Fe+=4):(o=p,0===je&&Ne(H))),o!==p?Ge()!==p?(a=Fe,44===f.charCodeAt(Fe)?(i=P,Fe++):(i=p,0===je&&Ne(D)),(a=i!==p?(s=Ge())!==p?(c=function(){var e,t,r;e=Fe,f.substr(Fe,2)===T?(t=T,Fe+=2):(t=p,0===je&&Ne(j));e=t!==p?(r=function(){var e,t;e=Fe,(t=Le())!==p&&(Oe=e,t=S(t));return e=t}(),r!==p?(Oe=e,t=M(r)):(Fe=e,p)):(Fe=e,p);e===p&&(e=Fe,(t=Le())!==p&&(Oe=e,t=k(t)),e=t);return e}())!==p?i=[i,s,c]:(Fe=a,p):(Fe=a,p):(Fe=a,p))===p&&(a=null),a!==p?(i=Ge())!==p?(125===f.charCodeAt(Fe)?(s=v,Fe++):(s=p,0===je&&Ne(d)),s!==p?(Oe=e,t=R(n,o,a)):(Fe=e,p)):(Fe=e,p):(Fe=e,p)):(Fe=e,p):(Fe=e,p)):(Fe=e,p):(Fe=e,p)):(Fe=e,p):(Fe=e,p):(Fe=e,p)):(Fe=e,p);return e}());return e}())===p&&(e=function(){var e,t,r,n,u,o,a,i,s,c,l;e=Fe,123===f.charCodeAt(Fe)?(t=h,Fe++):(t=p,0===je&&Ne(m));if(t!==p)if(Ge()!==p)if((r=Xe())!==p)if(Ge()!==p)if(44===f.charCodeAt(Fe)?(n=P,Fe++):(n=p,0===je&&Ne(D)),n!==p)if(Ge()!==p)if(f.substr(Fe,6)===Z?(u=Z,Fe+=6):(u=p,0===je&&Ne($)),u===p&&(f.substr(Fe,13)===z?(u=z,Fe+=13):(u=p,0===je&&Ne(J))),u!==p)if(Ge()!==p)if(44===f.charCodeAt(Fe)?(o=P,Fe++):(o=p,0===je&&Ne(D)),o!==p)if(Ge()!==p)if(a=Fe,f.substr(Fe,7)===U?(i=U,Fe+=7):(i=p,0===je&&Ne(q)),(a=i!==p?(s=Ge())!==p?(c=Ke())!==p?i=[i,s,c]:(Fe=a,p):(Fe=a,p):(Fe=a,p))===p&&(a=null),a!==p)if((i=Ge())!==p){if(s=[],(c=Je())!==p)for(;c!==p;)s.push(c),c=Je();else s=p;e=s!==p?(c=Ge())!==p?(125===f.charCodeAt(Fe)?(l=v,Fe++):(l=p,0===je&&Ne(d)),l!==p?(Oe=e,t=G(r,u,a,s)):(Fe=e,p)):(Fe=e,p):(Fe=e,p)}else Fe=e,e=p;else Fe=e,e=p;else Fe=e,e=p;else Fe=e,e=p;else Fe=e,e=p;else Fe=e,e=p;else Fe=e,e=p;else Fe=e,e=p;else Fe=e,e=p;else Fe=e,e=p;else Fe=e,e=p;else Fe=e,e=p;return e}())===p&&(e=function(){var e,t,r,n,u,o,a,i,s;e=Fe,123===f.charCodeAt(Fe)?(t=h,Fe++):(t=p,0===je&&Ne(m));if(t!==p)if(Ge()!==p)if((r=Xe())!==p)if(Ge()!==p)if(44===f.charCodeAt(Fe)?(n=P,Fe++):(n=p,0===je&&Ne(D)),n!==p)if(Ge()!==p)if(f.substr(Fe,6)===K?(u=K,Fe+=6):(u=p,0===je&&Ne(Q)),u!==p)if(Ge()!==p)if(44===f.charCodeAt(Fe)?(o=P,Fe++):(o=p,0===je&&Ne(D)),o!==p)if(Ge()!==p){if(a=[],(i=ze())!==p)for(;i!==p;)a.push(i),i=ze();else a=p;e=a!==p?(i=Ge())!==p?(125===f.charCodeAt(Fe)?(s=v,Fe++):(s=p,0===je&&Ne(d)),s!==p?(Oe=e,t=V(r,a)):(Fe=e,p)):(Fe=e,p):(Fe=e,p)}else Fe=e,e=p;else Fe=e,e=p;else Fe=e,e=p;else Fe=e,e=p;else Fe=e,e=p;else Fe=e,e=p;else Fe=e,e=p;else Fe=e,e=p;else Fe=e,e=p;else Fe=e,e=p;return e}()),e}function Le(){var e,t,r;if(e=Fe,t=[],(r=Qe())===p&&(r=Ve())===p&&(r=We()),r!==p)for(;r!==p;)t.push(r),(r=Qe())===p&&(r=Ve())===p&&(r=We());else t=p;return t!==p&&(Oe=e,t=i(t)),e=t}function Xe(){var e,t;return e=Fe,(t=Ke())===p&&(t=Ye()),e=t!==p?f.substring(e,Fe):t}function He(){var e,t,r,n,u;if(je++,t=[],n=r=e=Fe,je++,(u=Ue())===p&&(g.test(f.charAt(Fe))?(u=f.charAt(Fe),Fe++):(u=p,0===je&&Ne(b))),je--,(r=(n=u===p?void 0:(Fe=n,p))!==p?(f.length>Fe?(u=f.charAt(Fe),Fe++):(u=p,0===je&&Ne(A)),u!==p?n=[n,u]:(Fe=r,p)):(Fe=r,p))!==p)for(;r!==p;)t.push(r),n=r=Fe,je++,(u=Ue())===p&&(g.test(f.charAt(Fe))?(u=f.charAt(Fe),Fe++):(u=p,0===je&&Ne(b))),je--,r=(n=u===p?void 0:(Fe=n,p))!==p?(f.length>Fe?(u=f.charAt(Fe),Fe++):(u=p,0===je&&Ne(A)),u!==p?n=[n,u]:(Fe=r,p)):(Fe=r,p);else t=p;return e=t!==p?f.substring(e,Fe):t,je--,e===p&&(t=p,0===je&&Ne(y)),e}function Ze(){var e,t,r;return je++,e=Fe,47===f.charCodeAt(Fe)?(t=w,Fe++):(t=p,0===je&&Ne(C)),e=t!==p&&(r=He())!==p?(Oe=e,t=F(r)):(Fe=e,p),je--,e===p&&(t=p,0===je&&Ne(x)),e}function $e(){var e,t,r,n;if(je++,e=Fe,Ge()!==p)if((t=He())!==p){for(r=[],n=Ze();n!==p;)r.push(n),n=Ze();e=r!==p?(Oe=e,E(t,r)):(Fe=e,p)}else Fe=e,e=p;else Fe=e,e=p;return je--,e===p&&(p,0===je&&Ne(O)),e}function ze(){var e,t,r,n,u;return e=Fe,e=Ge()!==p&&(t=Ye())!==p&&Ge()!==p?(123===f.charCodeAt(Fe)?(r=h,Fe++):(r=p,0===je&&Ne(m)),r!==p&&(n=Se())!==p?(125===f.charCodeAt(Fe)?(u=v,Fe++):(u=p,0===je&&Ne(d)),u!==p?(Oe=e,ee(t,n)):(Fe=e,p)):(Fe=e,p)):(Fe=e,p)}function Je(){var e,t,r,n,u;return e=Fe,e=Ge()!==p&&(t=function(){var e,t,r,n;return t=e=Fe,61===f.charCodeAt(Fe)?(r=W,Fe++):(r=p,0===je&&Ne(Y)),(e=(t=r!==p&&(n=Ke())!==p?r=[r,n]:(Fe=t,p))!==p?f.substring(e,Fe):t)===p&&(e=Ye()),e}())!==p&&Ge()!==p?(123===f.charCodeAt(Fe)?(r=h,Fe++):(r=p,0===je&&Ne(m)),r!==p&&(n=Se())!==p?(125===f.charCodeAt(Fe)?(u=v,Fe++):(u=p,0===je&&Ne(d)),u!==p?(Oe=e,te(t,n)):(Fe=e,p)):(Fe=e,p)):(Fe=e,p)}function Ue(){var e;return re.test(f.charAt(Fe))?(e=f.charAt(Fe),Fe++):(e=p,0===je&&Ne(ne)),e}function qe(){var e;return ue.test(f.charAt(Fe))?(e=f.charAt(Fe),Fe++):(e=p,0===je&&Ne(oe)),e}function Ge(){var e,t,r;for(je++,e=Fe,t=[],r=Ue();r!==p;)t.push(r),r=Ue();return e=t!==p?f.substring(e,Fe):t,je--,e===p&&(t=p,0===je&&Ne(ae)),e}function Ke(){var e,t,r;if(e=Fe,t=[],ie.test(f.charAt(Fe))?(r=f.charAt(Fe),Fe++):(r=p,0===je&&Ne(se)),r!==p)for(;r!==p;)t.push(r),ie.test(f.charAt(Fe))?(r=f.charAt(Fe),Fe++):(r=p,0===je&&Ne(se));else t=p;return t!==p&&(Oe=e,t=ce(t)),e=t}function Qe(){var e,t;return je++,e=Fe,f.substr(Fe,2)===he?(t=he,Fe+=2):(t=p,0===je&&Ne(me)),t!==p&&(Oe=e,t=ve()),je--,(e=t)===p&&(t=p,0===je&&Ne(pe)),e}function Ve(){var e,t,r,n,u,o;if(e=Fe,39===f.charCodeAt(Fe)?(t=le,Fe++):(t=p,0===je&&Ne(fe)),t!==p)if(de.test(f.charAt(Fe))?(r=f.charAt(Fe),Fe++):(r=p,0===je&&Ne(ye)),r!==p){for(n=Fe,u=[],f.substr(Fe,2)===he?(o=he,Fe+=2):(o=p,0===je&&Ne(me)),o===p&&(ge.test(f.charAt(Fe))?(o=f.charAt(Fe),Fe++):(o=p,0===je&&Ne(be)));o!==p;)u.push(o),f.substr(Fe,2)===he?(o=he,Fe+=2):(o=p,0===je&&Ne(me)),o===p&&(ge.test(f.charAt(Fe))?(o=f.charAt(Fe),Fe++):(o=p,0===je&&Ne(be)));e=(n=u!==p?f.substring(n,Fe):u)!==p?(39===f.charCodeAt(Fe)?(u=le,Fe++):(u=p,0===je&&Ne(fe)),u!==p?(Oe=e,t=Ae(r,n)):(Fe=e,p)):(Fe=e,p)}else Fe=e,e=p;else Fe=e,e=p;return e}function We(){var e,t;return e=Fe,xe.test(f.charAt(Fe))?(t=f.charAt(Fe),Fe++):(t=p,0===je&&Ne(we)),e=t!==p?f.substring(e,Fe):t}function Ye(){var e,t,r,n,u;if(je++,t=[],n=r=e=Fe,je++,(u=Ue())===p&&(u=qe()),je--,(r=(n=u===p?void 0:(Fe=n,p))!==p?(f.length>Fe?(u=f.charAt(Fe),Fe++):(u=p,0===je&&Ne(A)),u!==p?n=[n,u]:(Fe=r,p)):(Fe=r,p))!==p)for(;r!==p;)t.push(r),n=r=Fe,je++,(u=Ue())===p&&(u=qe()),je--,r=(n=u===p?void 0:(Fe=n,p))!==p?(f.length>Fe?(u=f.charAt(Fe),Fe++):(u=p,0===je&&Ne(A)),u!==p?n=[n,u]:(Fe=r,p)):(Fe=r,p);else t=p;return e=t!==p?f.substring(e,Fe):t,je--,e===p&&(t=p,0===je&&Ne(Ce)),e}function et(){return e&&e.captureLocation?{location:Ie(Oe,Fe)}:{}}if((t=a())!==p&&Fe===f.length)return t;throw t!==p&&Fe<f.length&&Ne({type:"end"}),r=Te,n=_e<f.length?f.charAt(_e):null,u=_e<f.length?Ie(_e,_e+1):Ie(_e,_e),new nt(nt.buildMessage(r,n),r,n,u)},p=/(^|[^\\])#/g;function i(e){return JSON.stringify(e.map(function(e){return e&&"object"==typeof e?function(r){return Object.keys(r).sort().map(function(e){var t;return(t={})[e]=r[e],t})}(e):e}))}var u,s,h,c=function(o,a){return void 0===a&&(a={}),function(){for(var e,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=i(t),u=n&&a[n];return u||(u=new((e=o).bind.apply(e,[void 0].concat(t))),n&&(a[n]=u)),u}},l=(u=function(e,t){return(u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}u(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),w=/\\#/g,C=(s=Error,l(m,s),m);function m(e,t){var r=s.call(this,e)||this;return r.variableId=t,r}function F(e,t,r,n,u,o){if(1===e.length&&v(e[0]))return[{type:0,value:e[0].value.replace(w,"#")}];for(var a=[],i=0,s=e;i<s.length;i++){var c=s[i];if(v(c))a.push({type:0,value:c.value.replace(w,"#")});else{var l=c.value;if(!(u&&l in u))throw new C('The intl string context variable "'+l+'" was not provided to the string "'+o+'"');var f=u[l];if(d(c))f&&"string"!=typeof f&&"number"!=typeof f?a.push({type:1,value:f}):a.push({type:0,value:"string"==typeof f||"number"==typeof f?String(f):""});else if(g(c)){var p="string"==typeof c.style?n.date[c.style]:void 0;a.push({type:0,value:r.getDateTimeFormat(t,p).format(f)})}else if(b(c)){p="string"==typeof c.style?n.time[c.style]:void 0;a.push({type:0,value:r.getDateTimeFormat(t,p).format(f)})}else if(y(c)){p="string"==typeof c.style?n.number[c.style]:void 0;a.push({type:0,value:r.getNumberFormat(t,p).format(f)})}else if(A(c)){if(!(h=c.options[f]||c.options.other))throw new RangeError('Invalid values for "'+c.value+'": "'+f+'". Options are "'+Object.keys(c.options).join('", "')+'"');a.push.apply(a,F(h.value,t,r,n,u))}else if(x(c)){var h;if(!(h=c.options["="+f])){var m=r.getPluralRules(t,{type:c.pluralType}).select(f-(c.offset||0));h=c.options[m]||c.options.other}if(!h)throw new RangeError('Invalid values for "'+c.value+'": "'+f+'". Options are "'+Object.keys(c.options).join('", "')+'"');a.push.apply(a,F(h.value,t,r,n,u))}else;}}return function(e){return e.length<2?e:e.reduce(function(e,t){var r=e[e.length-1];return r&&0===r.type&&0===t.type?r.value+=t.value:e.push(t),e},[])}(a)}function O(e,t,r,n,u,o){var a=F(e,t,r,n,u,o);return 1===a.length?a[0].value:a.reduce(function(e,t){return e+t.value},"")}var E="@@",_=/@@(.*?)@@/g,T=0;function j(e,t){return e.split(_).filter(Boolean).map(function(e){return t[e]||e})}function M(e,t,r,n,i,u){var o=F(e,t,r,n,i,u),s={},a=o.reduce(function(e,t){if("string"==typeof t.value||0===t.type)return e+t.value;var r=Date.now()+"_"+ ++T;return s[r]=t.value,e+(E+r)+E},"");if(!~a.indexOf("<"))return j(a,s);if(!i)throw new C("Message has placeholders but no values was given");if("undefined"==typeof DOMParser)throw new C("Cannot format XML message without DOMParser");h||(h=new DOMParser);var c=h.parseFromString("<template>"+a+"</template>","application/xml");if(c.getElementsByTagName("parsererror").length)throw new C("Malformed XML message "+c.getElementsByTagName("parsererror")[0].innerHTML);var l=c.firstChild;if(!l)throw new C("Malformed XML message "+a);return Object.keys(i).filter(function(e){return!!c.getElementsByTagName(e).length}).length?Array.prototype.slice.call(l.childNodes).reduce(function(e,t){var r=t.tagName,n=t.outerHTML,u=t.textContent;if(!r){var o=j(u||"",s);return e.concat(o)}if(!i[r])return 1===(o=j(n,s)).length?e.concat([o[0]]):e.concat(o);var a=i[r];if("function"!=typeof a)return e.concat([a]);if(null==u)return e.concat([a(u||void 0)]);o=j(u,s);return e.concat([a.apply(void 0,o)])},[]):j(a,s)}var k=function(){return(k=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var u in t=arguments[r])Object.prototype.hasOwnProperty.call(t,u)&&(e[u]=t[u]);return e}).apply(this,arguments)};function P(r,n){return n?Object.keys(r).reduce(function(e,t){return e[t]=function(r,n){return n?k({},r||{},n||{},Object.keys(r).reduce(function(e,t){return e[t]=k({},r[t],n[t]||{}),e},{})):r}(r[t],n[t]),e},k({},r)):r}function D(e){return void 0===e&&(e={number:{},dateTime:{},pluralRules:{}}),{getNumberFormat:c(Intl.NumberFormat,e.number),getDateTimeFormat:c(Intl.DateTimeFormat,e.dateTime),getPluralRules:c(Intl.PluralRules,e.pluralRules)}}var I=(N.defaultLocale="en",N.__parse=void 0,N.formats={number:{currency:{style:"currency"},percent:{style:"percent"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}},N);function N(e,t,r,n){var u=this;if(void 0===t&&(t=N.defaultLocale),this.formatterCache={number:{},dateTime:{},pluralRules:{}},this.format=function(e){return O(u.ast,u.locale,u.formatters,u.formats,e,u.message)},this.formatToParts=function(e){return F(u.ast,u.locale,u.formatters,u.formats,e,u.message)},this.formatXMLMessage=function(e){return M(u.ast,u.locale,u.formatters,u.formats,e,u.message)},this.resolvedOptions=function(){return{locale:u.locale}},this.getAst=function(){return u.ast},"string"==typeof e){if(this.message=e,!N.__parse)throw new TypeError("IntlMessageFormat.__parse must be set to process `message` of type `string`");this.ast=N.__parse(e)}else this.ast=e;if(!Array.isArray(this.ast))throw new TypeError("A message must be provided as a String or AST.");this.formats=P(N.formats,r),this.locale=function(e){"string"==typeof e&&(e=[e]);try{return Intl.NumberFormat.supportedLocalesOf(e,{localeMatcher:"best fit"})[0]}catch(e){return I.defaultLocale}}(t||[]),this.formatters=n&&n.formatters||D(this.formatterCache),function r(e,n,u,o){e.filter(function(e){return!d(e)&&!v(e)}).forEach(function(t){if(g(t)){var e="string"==typeof t.style?o.date[t.style]:void 0;u.getDateTimeFormat(n,e)}b(t)&&(e="string"==typeof t.style?o.time[t.style]:void 0,u.getDateTimeFormat(n,e)),y(t)&&(e="string"==typeof t.style?o.number[t.style]:void 0,u.getNumberFormat(n,e)),A(t)&&Object.keys(t.options).forEach(function(e){return r(t.options[e].value,n,u,o)}),x(t)&&(u.getPluralRules(n,{type:t.pluralType}),Object.keys(t.options).forEach(function(e){return r(t.options[e].value,n,u,o)}))})}(this.ast,this.locale,this.formatters,this.formats)}I.__parse=function(e,t){var r=f(e,t);return t&&!1===t.normalizeHashtagInPlural||function l(e){e.forEach(function(c){(x(c)||A(c))&&Object.keys(c.options).forEach(function(e){for(var t,r=c.options[e],n=-1,u=void 0,o=0;o<r.value.length;o++){var a=r.value[o];if(v(a)&&p.test(a.value)){n=o,u=a;break}}if(u){var i=u.value.replace(p,"$1{"+c.value+", number}"),s=f(i);(t=r.value).splice.apply(t,[n,1].concat(s))}l(r.value)})})}(r),r},e.IntlMessageFormat=I,e.createDefaultFormatters=D,e.default=I,e.formatToParts=F,e.formatToString=O,e.formatXMLMessage=M,Object.defineProperty(e,"__esModule",{value:!0})});
//# sourceMappingURL=intl-messageformat.min.js.map
{
"name": "intl-messageformat",
"version": "6.0.3",
"version": "6.0.4",
"description": "Formats ICU Message strings with number, date, plural, and select placeholders to create localized messages.",

@@ -35,3 +35,3 @@ "keywords": [

"intl-format-cache": "^4.1.6",
"intl-messageformat-parser": "^3.0.2"
"intl-messageformat-parser": "^3.0.3"
},

@@ -55,3 +55,3 @@ "scripts": {

"license": "BSD-3-Clause",
"gitHead": "5712b2950f1ca82c7ea987a88a490a28157838fc"
"gitHead": "e4991d253408fd29bbdbf20f9d133fa7f3714ac0"
}

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc