10 lines
41 KiB
JavaScript
10 lines
41 KiB
JavaScript
/*
|
||
* ReactIntl v2.2.3
|
||
*
|
||
* Copyright 2017, Yahoo Inc.
|
||
* Copyrights licensed under the New BSD License.
|
||
* See the accompanying LICENSE file for terms.
|
||
*/
|
||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],e):e(t.ReactIntl=t.ReactIntl||{},t.React)}(this,function(t,e){"use strict";function r(t){var e,r,n,o,a=Array.prototype.slice.call(arguments,1);for(e=0,r=a.length;e<r;e+=1)if(n=a[e])for(o in n)q.call(n,o)&&(t[o]=n[o]);return t}function n(t,e,r){this.locales=t,this.formats=e,this.pluralFn=r}function o(t){this.id=t}function a(t,e,r,n,o){this.id=t,this.useOrdinal=e,this.offset=r,this.options=n,this.pluralFn=o}function i(t,e,r,n){this.id=t,this.offset=e,this.numberFormat=r,this.string=n}function l(t,e){this.id=t,this.options=e}function u(t,e,r){var n="string"==typeof t?u.__parse(t):t;if(!n||"messageFormatPattern"!==n.type)throw new TypeError("A message must be provided as a String or AST.");r=this._mergeFormats(u.formats,r),W(this,"_locale",{value:this._resolveLocale(e)});var o=this._findPluralRuleFunction(this._locale),a=this._compilePattern(n,e,r,o),i=this;this.format=function(t){return i._format(a,t)}}function s(t){return 400*t/146097}function c(t,e){e=e||{},et(t)&&(t=t.concat()),X(this,"_locale",{value:this._resolveLocale(t)}),X(this,"_options",{value:{style:this._resolveStyle(e.style),units:this._isValidUnits(e.units)&&e.units}}),X(this,"_locales",{value:t}),X(this,"_fields",{value:this._findFields(this._locale)}),X(this,"_messages",{value:Y(null)});var r=this;this.format=function(t,e){return r._format(t,e)}}function f(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=Array.isArray(t)?t:[t];e.forEach(function(t){t&&t.locale&&(u.__addLocaleData(t),c.__addLocaleData(t))})}function p(t){for(var e=(t||"").split("-");e.length>0;){if(h(e.join("-")))return!0;e.pop()}return!1}function h(t){var e=t&&t.toLowerCase();return!(!u.__localeData__[e]||!c.__localeData__[e])}function m(t){return(""+t).replace(Ut,function(t){return St[t]})}function d(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return e.reduce(function(e,n){return t.hasOwnProperty(n)?e[n]=t[n]:r.hasOwnProperty(n)&&(e[n]=r[n]),e},{})}function y(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.intl;Lt(e,"[React Intl] Could not find required `intl` object. <IntlProvider> needs to exist in the component ancestry.")}function v(t,e){if(t===e)return!0;if("object"!==("undefined"==typeof t?"undefined":it(t))||null===t||"object"!==("undefined"==typeof e?"undefined":it(e))||null===e)return!1;var r=Object.keys(t),n=Object.keys(e);if(r.length!==n.length)return!1;for(var o=Object.prototype.hasOwnProperty.bind(e),a=0;a<r.length;a++)if(!o(r[a])||t[r[a]]!==e[r[a]])return!1;return!0}function g(t,e,r){var n=t.props,o=t.state,a=t.context,i=void 0===a?{}:a,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},u=i.intl,s=void 0===u?{}:u,c=l.intl,f=void 0===c?{}:c;return!v(e,n)||!v(r,o)||!(f===s||v(d(f,It),d(s,It)))}function _(t){return t.displayName||t.name||"Component"}function b(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=r.intlPropName,o=void 0===n?"intl":n,a=r.withRef,i=void 0!==a&&a,l=function(e){function r(t,e){lt(this,r);var n=ht(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,t,e));return y(e),n}return ft(r,e),ut(r,[{key:"getWrappedInstance",value:function(){return Lt(i,"[React Intl] To access the wrapped instance, the `{withRef: true}` option must be set when calling: `injectIntl()`"),this.refs.wrappedInstance}},{key:"render",value:function(){return U.createElement(t,ct({},this.props,st({},o,this.context.intl),{ref:i?"wrappedInstance":null}))}}]),r}(e.Component);return l.displayName="InjectIntl("+_(t)+")",l.contextTypes={intl:At},l.WrappedComponent=t,l}function w(t){return t}function F(t){return u.prototype._resolveLocale(t)}function O(t){return u.prototype._findPluralRuleFunction(t)}function x(t){var e=Zt(null);return function(){var r=Array.prototype.slice.call(arguments),n=P(r),o=n&&e[n];return o||(o=new(qt.apply(t,[null].concat(r))),n&&(e[n]=o)),o}}function P(t){if("undefined"!=typeof JSON){var e,r,n,o=[];for(e=0,r=t.length;e<r;e+=1)n=t[e],n&&"object"==typeof n?o.push(T(n)):o.push(n);return JSON.stringify(o)}}function T(t){var e,r,n,o,a=[],i=[];for(e in t)t.hasOwnProperty(e)&&i.push(e);var l=i.sort();for(r=0,n=l.length;r<n;r+=1)e=l[r],o={},o[e]=t[e],a[r]=o;return a}function j(t){var e=c.thresholds;e.second=t.second,e.minute=t.minute,e.hour=t.hour,e.day=t.day,e.month=t.month}function C(t,e,r){var n=t&&t[e]&&t[e][r];if(n)return n}function A(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=t.locale,a=t.formats,i=n.format,l=new Date(r),u=i&&C(a,"date",i),s=d(n,Bt,u);try{return e.getDateTimeFormat(o,s).format(l)}catch(t){}return String(l)}function N(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=t.locale,a=t.formats,i=n.format,l=new Date(r),u=i&&C(a,"time",i),s=d(n,Bt,u);s.hour||s.minute||s.second||(s=ct({},s,{hour:"numeric",minute:"numeric"}));try{return e.getDateTimeFormat(o,s).format(l)}catch(t){}return String(l)}function M(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=t.locale,a=t.formats,i=n.format,l=new Date(r),u=new Date(n.now),s=i&&C(a,"relative",i),f=d(n,$t,s),p=ct({},c.thresholds);j(Kt);try{return e.getRelativeFormat(o,f).format(l,{now:isFinite(u)?u:e.now()})}catch(t){}finally{j(p)}return String(l)}function R(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=t.locale,a=t.formats,i=n.format,l=i&&C(a,"number",i),u=d(n,Jt,l);try{return e.getNumberFormat(o,u).format(r)}catch(t){}return String(r)}function k(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=t.locale,a=d(n,zt);try{return e.getPluralFormat(o,a).format(r)}catch(t){}return"other"}function D(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=t.locale,a=t.formats,i=t.messages,l=t.defaultLocale,u=t.defaultFormats,s=r.id,c=r.defaultMessage;Lt(s,"[React Intl] An `id` must be provided to format a message.");var f=i&&i[s],p=Object.keys(n).length>0;if(!p)return f||c||s;var h=void 0;if(f)try{var m=e.getMessageFormat(f,o,a);h=m.format(n)}catch(t){}if(!h&&c)try{var d=e.getMessageFormat(c,l,u);h=d.format(n)}catch(t){}return h||f||c||s}function E(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=Object.keys(n).reduce(function(t,e){var r=n[e];return t[e]="string"==typeof r?m(r):r,t},{});return D(t,e,r,o)}function L(t){var e=Math.abs(t);return e<ae?"second":e<ie?"minute":e<le?"hour":"day"}function I(t){switch(t){case"second":return oe;case"minute":return ae;case"hour":return ie;case"day":return le;default:return ue}}function S(t,e){if(t===e)return!0;var r=new Date(t).getTime(),n=new Date(e).getTime();return isFinite(r)&&isFinite(n)&&r===n}if("undefined"==typeof e)throw new ReferenceError("React must be loaded before ReactIntl.");var U="default"in e?e.default:e,G={locale:"en",pluralRuleFunction:function(t,e){var r=String(t).split("."),n=!r[1],o=Number(r[0])==t,a=o&&r[0].slice(-1),i=o&&r[0].slice(-2);return e?1==a&&11!=i?"one":2==a&&12!=i?"two":3==a&&13!=i?"few":"other":1==t&&n?"one":"other"},fields:{year:{displayName:"year",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{one:"in {0} year",other:"in {0} years"},past:{one:"{0} year ago",other:"{0} years ago"}}},month:{displayName:"month",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{one:"in {0} month",other:"in {0} months"},past:{one:"{0} month ago",other:"{0} months ago"}}},day:{displayName:"day",relative:{0:"today",1:"tomorrow","-1":"yesterday"},relativeTime:{future:{one:"in {0} day",other:"in {0} days"},past:{one:"{0} day ago",other:"{0} days ago"}}},hour:{displayName:"hour",relativeTime:{future:{one:"in {0} hour",other:"in {0} hours"},past:{one:"{0} hour ago",other:"{0} hours ago"}}},minute:{displayName:"minute",relativeTime:{future:{one:"in {0} minute",other:"in {0} minutes"},past:{one:"{0} minute ago",other:"{0} minutes ago"}}},second:{displayName:"second",relative:{0:"now"},relativeTime:{future:{one:"in {0} second",other:"in {0} seconds"},past:{one:"{0} second ago",other:"{0} seconds ago"}}}}},q=Object.prototype.hasOwnProperty,H=function(){try{return!!Object.defineProperty({},"a",{})}catch(t){return!1}}(),W=H?Object.defineProperty:function(t,e,r){"get"in r&&t.__defineGetter__?t.__defineGetter__(e,r.get):(!q.call(t,e)||"value"in r)&&(t[e]=r.value)},V=Object.create||function(t,e){function r(){}var n,o;r.prototype=t,n=new r;for(o in e)q.call(e,o)&&W(n,o,e[o]);return n};n.prototype.compile=function(t){return this.pluralStack=[],this.currentPlural=null,this.pluralNumberFormat=null,this.compileMessage(t)},n.prototype.compileMessage=function(t){if(!t||"messageFormatPattern"!==t.type)throw new Error('Message AST is not of type: "messageFormatPattern"');var e,r,n,o=t.elements,a=[];for(e=0,r=o.length;e<r;e+=1)switch(n=o[e],n.type){case"messageTextElement":a.push(this.compileMessageText(n));break;case"argumentElement":a.push(this.compileArgument(n));break;default:throw new Error("Message element does not have a valid type")}return a},n.prototype.compileMessageText=function(t){return this.currentPlural&&/(^|[^\\])#/g.test(t.value)?(this.pluralNumberFormat||(this.pluralNumberFormat=new Intl.NumberFormat(this.locales)),new i(this.currentPlural.id,this.currentPlural.format.offset,this.pluralNumberFormat,t.value)):t.value.replace(/\\#/g,"#")},n.prototype.compileArgument=function(t){var e=t.format;if(!e)return new o(t.id);var r,n=this.formats,i=this.locales,u=this.pluralFn;switch(e.type){case"numberFormat":return r=n.number[e.style],{id:t.id,format:new Intl.NumberFormat(i,r).format};case"dateFormat":return r=n.date[e.style],{id:t.id,format:new Intl.DateTimeFormat(i,r).format};case"timeFormat":return r=n.time[e.style],{id:t.id,format:new Intl.DateTimeFormat(i,r).format};case"pluralFormat":return r=this.compileOptions(t),new a(t.id,e.ordinal,e.offset,r,u);case"selectFormat":return r=this.compileOptions(t),new l(t.id,r);default:throw new Error("Message element does not have a valid format type")}},n.prototype.compileOptions=function(t){var e=t.format,r=e.options,n={};this.pluralStack.push(this.currentPlural),this.currentPlural="pluralFormat"===e.type?t:null;var o,a,i;for(o=0,a=r.length;o<a;o+=1)i=r[o],n[i.selector]=this.compileMessage(i.value);return this.currentPlural=this.pluralStack.pop(),n},o.prototype.format=function(t){return t?"string"==typeof t?t:String(t):""},a.prototype.getOption=function(t){var e=this.options,r=e["="+t]||e[this.pluralFn(t-this.offset,this.useOrdinal)];return r||e.other},i.prototype.format=function(t){var e=this.numberFormat.format(t-this.offset);return this.string.replace(/(^|[^\\])#/g,"$1"+e).replace(/\\#/g,"#")},l.prototype.getOption=function(t){var e=this.options;return e[t]||e.other};var Z=function(){function t(t,e){function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r}function e(t,e,r,n,o,a){this.message=t,this.expected=e,this.found=r,this.offset=n,this.line=o,this.column=a,this.name="SyntaxError"}function r(t){function r(e){function r(e,r,n){var o,a;for(o=r;o<n;o++)a=t.charAt(o),"\n"===a?(e.seenCR||e.line++,e.column=1,e.seenCR=!1):"\r"===a||"\u2028"===a||"\u2029"===a?(e.line++,e.column=1,e.seenCR=!0):(e.column++,e.seenCR=!1)}return zt!==e&&(zt>e&&(zt=0,Kt={line:1,column:1,seenCR:!1}),r(Kt,zt,e),zt=e),Kt}function n(t){Jt<Qt||(Jt>Qt&&(Qt=Jt,Xt=[]),Xt.push(t))}function o(n,o,a){function i(t){var e=1;for(t.sort(function(t,e){return t.description<e.description?-1:t.description>e.description?1:0});e<t.length;)t[e-1]===t[e]?t.splice(e,1):e++}function l(t,e){function r(t){function e(t){return t.charCodeAt(0).toString(16).toUpperCase()}return t.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\x08/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/[\x00-\x07\x0B\x0E\x0F]/g,function(t){return"\\x0"+e(t)}).replace(/[\x10-\x1F\x80-\xFF]/g,function(t){return"\\x"+e(t)}).replace(/[\u0180-\u0FFF]/g,function(t){return"\\u0"+e(t)}).replace(/[\u1080-\uFFFF]/g,function(t){return"\\u"+e(t)})}var n,o,a,i=new Array(t.length);for(a=0;a<t.length;a++)i[a]=t[a].description;return n=t.length>1?i.slice(0,-1).join(", ")+" or "+i[t.length-1]:i[0],o=e?'"'+r(e)+'"':"end of input","Expected "+n+" but "+o+" found."}var u=r(a),s=a<t.length?t.charAt(a):null;return null!==o&&i(o),new e(null!==n?n:l(o,s),o,s,a,u.line,u.column)}function a(){var t;return t=i()}function i(){var t,e,r;for(t=Jt,e=[],r=l();r!==N;)e.push(r),r=l();return e!==N&&($t=t,e=k(e)),t=e}function l(){var t;return t=s(),t===N&&(t=f()),t}function u(){var e,r,n,o,a,i;if(e=Jt,r=[],n=Jt,o=F(),o!==N?(a=j(),a!==N?(i=F(),i!==N?(o=[o,a,i],n=o):(Jt=n,n=D)):(Jt=n,n=D)):(Jt=n,n=D),n!==N)for(;n!==N;)r.push(n),n=Jt,o=F(),o!==N?(a=j(),a!==N?(i=F(),i!==N?(o=[o,a,i],n=o):(Jt=n,n=D)):(Jt=n,n=D)):(Jt=n,n=D);else r=D;return r!==N&&($t=e,r=E(r)),e=r,e===N&&(e=Jt,r=w(),r!==N&&(r=t.substring(e,Jt)),e=r),e}function s(){var t,e;return t=Jt,e=u(),e!==N&&($t=t,e=L(e)),t=e}function c(){var e,r,o;if(e=P(),e===N){if(e=Jt,r=[],I.test(t.charAt(Jt))?(o=t.charAt(Jt),Jt++):(o=N,0===Yt&&n(S)),o!==N)for(;o!==N;)r.push(o),I.test(t.charAt(Jt))?(o=t.charAt(Jt),Jt++):(o=N,0===Yt&&n(S));else r=D;r!==N&&(r=t.substring(e,Jt)),e=r}return e}function f(){var e,r,o,a,i,l,u,s,f;return e=Jt,123===t.charCodeAt(Jt)?(r=U,Jt++):(r=N,0===Yt&&n(G)),r!==N?(o=F(),o!==N?(a=c(),a!==N?(i=F(),i!==N?(l=Jt,44===t.charCodeAt(Jt)?(u=H,Jt++):(u=N,0===Yt&&n(W)),u!==N?(s=F(),s!==N?(f=p(),f!==N?(u=[u,s,f],l=u):(Jt=l,l=D)):(Jt=l,l=D)):(Jt=l,l=D),l===N&&(l=q),l!==N?(u=F(),u!==N?(125===t.charCodeAt(Jt)?(s=V,Jt++):(s=N,0===Yt&&n(Z)),s!==N?($t=e,r=B(a,l),e=r):(Jt=e,e=D)):(Jt=e,e=D)):(Jt=e,e=D)):(Jt=e,e=D)):(Jt=e,e=D)):(Jt=e,e=D)):(Jt=e,e=D),e}function p(){var t;return t=h(),t===N&&(t=m(),t===N&&(t=d(),t===N&&(t=y()))),t}function h(){var e,r,o,a,i,l,u;return e=Jt,t.substr(Jt,6)===J?(r=J,Jt+=6):(r=N,0===Yt&&n($)),r===N&&(t.substr(Jt,4)===z?(r=z,Jt+=4):(r=N,0===Yt&&n(K)),r===N&&(t.substr(Jt,4)===Q?(r=Q,Jt+=4):(r=N,0===Yt&&n(X)))),r!==N?(o=F(),o!==N?(a=Jt,44===t.charCodeAt(Jt)?(i=H,Jt++):(i=N,0===Yt&&n(W)),i!==N?(l=F(),l!==N?(u=j(),u!==N?(i=[i,l,u],a=i):(Jt=a,a=D)):(Jt=a,a=D)):(Jt=a,a=D),a===N&&(a=q),a!==N?($t=e,r=Y(r,a),e=r):(Jt=e,e=D)):(Jt=e,e=D)):(Jt=e,e=D),e}function m(){var e,r,o,a,i,l;return e=Jt,t.substr(Jt,6)===tt?(r=tt,Jt+=6):(r=N,0===Yt&&n(et)),r!==N?(o=F(),o!==N?(44===t.charCodeAt(Jt)?(a=H,Jt++):(a=N,0===Yt&&n(W)),a!==N?(i=F(),i!==N?(l=b(),l!==N?($t=e,r=rt(l),e=r):(Jt=e,e=D)):(Jt=e,e=D)):(Jt=e,e=D)):(Jt=e,e=D)):(Jt=e,e=D),e}function d(){var e,r,o,a,i,l;return e=Jt,t.substr(Jt,13)===nt?(r=nt,Jt+=13):(r=N,0===Yt&&n(ot)),r!==N?(o=F(),o!==N?(44===t.charCodeAt(Jt)?(a=H,Jt++):(a=N,0===Yt&&n(W)),a!==N?(i=F(),i!==N?(l=b(),l!==N?($t=e,r=at(l),e=r):(Jt=e,e=D)):(Jt=e,e=D)):(Jt=e,e=D)):(Jt=e,e=D)):(Jt=e,e=D),e}function y(){var e,r,o,a,i,l,u;if(e=Jt,t.substr(Jt,6)===it?(r=it,Jt+=6):(r=N,0===Yt&&n(lt)),r!==N)if(o=F(),o!==N)if(44===t.charCodeAt(Jt)?(a=H,Jt++):(a=N,0===Yt&&n(W)),a!==N)if(i=F(),i!==N){if(l=[],u=g(),u!==N)for(;u!==N;)l.push(u),u=g();else l=D;l!==N?($t=e,r=ut(l),e=r):(Jt=e,e=D)}else Jt=e,e=D;else Jt=e,e=D;else Jt=e,e=D;else Jt=e,e=D;return e}function v(){var e,r,o,a;return e=Jt,r=Jt,61===t.charCodeAt(Jt)?(o=st,Jt++):(o=N,0===Yt&&n(ct)),o!==N?(a=P(),a!==N?(o=[o,a],r=o):(Jt=r,r=D)):(Jt=r,r=D),r!==N&&(r=t.substring(e,Jt)),e=r,e===N&&(e=j()),e}function g(){var e,r,o,a,l,u,s,c,f;return e=Jt,r=F(),r!==N?(o=v(),o!==N?(a=F(),a!==N?(123===t.charCodeAt(Jt)?(l=U,Jt++):(l=N,0===Yt&&n(G)),l!==N?(u=F(),u!==N?(s=i(),s!==N?(c=F(),c!==N?(125===t.charCodeAt(Jt)?(f=V,Jt++):(f=N,0===Yt&&n(Z)),f!==N?($t=e,r=ft(o,s),e=r):(Jt=e,e=D)):(Jt=e,e=D)):(Jt=e,e=D)):(Jt=e,e=D)):(Jt=e,e=D)):(Jt=e,e=D)):(Jt=e,e=D)):(Jt=e,e=D),e}function _(){var e,r,o,a;return e=Jt,t.substr(Jt,7)===pt?(r=pt,Jt+=7):(r=N,0===Yt&&n(ht)),r!==N?(o=F(),o!==N?(a=P(),a!==N?($t=e,r=mt(a),e=r):(Jt=e,e=D)):(Jt=e,e=D)):(Jt=e,e=D),e}function b(){var t,e,r,n,o;if(t=Jt,e=_(),e===N&&(e=q),e!==N)if(r=F(),r!==N){if(n=[],o=g(),o!==N)for(;o!==N;)n.push(o),o=g();else n=D;n!==N?($t=t,e=dt(e,n),t=e):(Jt=t,t=D)}else Jt=t,t=D;else Jt=t,t=D;return t}function w(){var e,r;if(Yt++,e=[],vt.test(t.charAt(Jt))?(r=t.charAt(Jt),Jt++):(r=N,0===Yt&&n(gt)),r!==N)for(;r!==N;)e.push(r),vt.test(t.charAt(Jt))?(r=t.charAt(Jt),Jt++):(r=N,0===Yt&&n(gt));else e=D;return Yt--,e===N&&(r=N,0===Yt&&n(yt)),e}function F(){var e,r,o;for(Yt++,e=Jt,r=[],o=w();o!==N;)r.push(o),o=w();return r!==N&&(r=t.substring(e,Jt)),e=r,Yt--,e===N&&(r=N,0===Yt&&n(_t)),e}function O(){var e;return bt.test(t.charAt(Jt))?(e=t.charAt(Jt),Jt++):(e=N,0===Yt&&n(wt)),e}function x(){var e;return Ft.test(t.charAt(Jt))?(e=t.charAt(Jt),Jt++):(e=N,0===Yt&&n(Ot)),e}function P(){var e,r,o,a,i,l;if(e=Jt,48===t.charCodeAt(Jt)?(r=xt,Jt++):(r=N,0===Yt&&n(Pt)),r===N){if(r=Jt,o=Jt,Tt.test(t.charAt(Jt))?(a=t.charAt(Jt),Jt++):(a=N,0===Yt&&n(jt)),a!==N){for(i=[],l=O();l!==N;)i.push(l),l=O();i!==N?(a=[a,i],o=a):(Jt=o,o=D)}else Jt=o,o=D;o!==N&&(o=t.substring(r,Jt)),r=o}return r!==N&&($t=e,r=Ct(r)),e=r}function T(){var e,r,o,a,i,l,u,s;return At.test(t.charAt(Jt))?(e=t.charAt(Jt),Jt++):(e=N,0===Yt&&n(Nt)),e===N&&(e=Jt,t.substr(Jt,2)===Mt?(r=Mt,Jt+=2):(r=N,0===Yt&&n(Rt)),r!==N&&($t=e,r=kt()),e=r,e===N&&(e=Jt,t.substr(Jt,2)===Dt?(r=Dt,Jt+=2):(r=N,0===Yt&&n(Et)),r!==N&&($t=e,r=Lt()),e=r,e===N&&(e=Jt,t.substr(Jt,2)===It?(r=It,Jt+=2):(r=N,0===Yt&&n(St)),r!==N&&($t=e,r=Ut()),e=r,e===N&&(e=Jt,t.substr(Jt,2)===Gt?(r=Gt,Jt+=2):(r=N,0===Yt&&n(qt)),r!==N&&($t=e,r=Ht()),e=r,e===N&&(e=Jt,t.substr(Jt,2)===Wt?(r=Wt,Jt+=2):(r=N,0===Yt&&n(Vt)),r!==N?(o=Jt,a=Jt,i=x(),i!==N?(l=x(),l!==N?(u=x(),u!==N?(s=x(),s!==N?(i=[i,l,u,s],a=i):(Jt=a,a=D)):(Jt=a,a=D)):(Jt=a,a=D)):(Jt=a,a=D),a!==N&&(a=t.substring(o,Jt)),o=a,o!==N?($t=e,r=Zt(o),e=r):(Jt=e,e=D)):(Jt=e,e=D)))))),e}function j(){var t,e,r;if(t=Jt,e=[],r=T(),r!==N)for(;r!==N;)e.push(r),r=T();else e=D;return e!==N&&($t=t,e=Bt(e)),t=e}var C,A=arguments.length>1?arguments[1]:{},N={},M={start:a},R=a,k=function(t){return{type:"messageFormatPattern",elements:t}},D=N,E=function(t){var e,r,n,o,a,i="";for(e=0,n=t.length;e<n;e+=1)for(o=t[e],r=0,a=o.length;r<a;r+=1)i+=o[r];return i},L=function(t){return{type:"messageTextElement",value:t}},I=/^[^ \t\n\r,.+={}#]/,S={type:"class",value:"[^ \\t\\n\\r,.+={}#]",description:"[^ \\t\\n\\r,.+={}#]"},U="{",G={type:"literal",value:"{",description:'"{"'},q=null,H=",",W={type:"literal",value:",",description:'","'},V="}",Z={type:"literal",value:"}",description:'"}"'},B=function(t,e){return{type:"argumentElement",id:t,format:e&&e[2]}},J="number",$={type:"literal",value:"number",description:'"number"'},z="date",K={type:"literal",value:"date",description:'"date"'},Q="time",X={type:"literal",value:"time",description:'"time"'},Y=function(t,e){return{type:t+"Format",style:e&&e[2]}},tt="plural",et={type:"literal",value:"plural",description:'"plural"'},rt=function(t){return{type:t.type,ordinal:!1,offset:t.offset||0,options:t.options}},nt="selectordinal",ot={type:"literal",value:"selectordinal",description:'"selectordinal"'},at=function(t){return{type:t.type,ordinal:!0,offset:t.offset||0,options:t.options}},it="select",lt={type:"literal",value:"select",description:'"select"'},ut=function(t){return{type:"selectFormat",options:t}},st="=",ct={type:"literal",value:"=",description:'"="'},ft=function(t,e){return{type:"optionalFormatPattern",selector:t,value:e}},pt="offset:",ht={type:"literal",value:"offset:",description:'"offset:"'},mt=function(t){return t},dt=function(t,e){return{type:"pluralFormat",offset:t,options:e}},yt={type:"other",description:"whitespace"},vt=/^[ \t\n\r]/,gt={type:"class",value:"[ \\t\\n\\r]",description:"[ \\t\\n\\r]"},_t={type:"other",description:"optionalWhitespace"},bt=/^[0-9]/,wt={type:"class",value:"[0-9]",description:"[0-9]"},Ft=/^[0-9a-f]/i,Ot={type:"class",value:"[0-9a-f]i",description:"[0-9a-f]i"},xt="0",Pt={type:"literal",value:"0",description:'"0"'},Tt=/^[1-9]/,jt={type:"class",value:"[1-9]",description:"[1-9]"},Ct=function(t){return parseInt(t,10)},At=/^[^{}\\\0-\x1F \t\n\r]/,Nt={type:"class",value:"[^{}\\\\\\0-\\x1F \\t\\n\\r]",description:"[^{}\\\\\\0-\\x1F \\t\\n\\r]"},Mt="\\\\",Rt={type:"literal",value:"\\\\",description:'"\\\\\\\\"'},kt=function(){return"\\"},Dt="\\#",Et={type:"literal",value:"\\#",description:'"\\\\#"'},Lt=function(){return"\\#"},It="\\{",St={type:"literal",value:"\\{",description:'"\\\\{"'},Ut=function(){return"{"},Gt="\\}",qt={type:"literal",value:"\\}",description:'"\\\\}"'},Ht=function(){return"}"},Wt="\\u",Vt={type:"literal",value:"\\u",description:'"\\\\u"'},Zt=function(t){return String.fromCharCode(parseInt(t,16))},Bt=function(t){return t.join("")},Jt=0,$t=0,zt=0,Kt={line:1,column:1,seenCR:!1},Qt=0,Xt=[],Yt=0;if("startRule"in A){if(!(A.startRule in M))throw new Error("Can't start parsing from rule \""+A.startRule+'".');R=M[A.startRule]}if(C=R(),C!==N&&Jt===t.length)return C;throw C!==N&&Jt<t.length&&n({type:"end",description:"end of input"}),o(null,Xt,Qt)}return t(e,Error),{SyntaxError:e,parse:r}}();W(u,"formats",{enumerable:!0,value:{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"}}}}),W(u,"__localeData__",{value:V(null)}),W(u,"__addLocaleData",{value:function(t){if(!t||!t.locale)throw new Error("Locale data provided to IntlMessageFormat is missing a `locale` property");u.__localeData__[t.locale.toLowerCase()]=t}}),W(u,"__parse",{value:Z.parse}),W(u,"defaultLocale",{enumerable:!0,writable:!0,value:void 0}),u.prototype.resolvedOptions=function(){return{locale:this._locale}},u.prototype._compilePattern=function(t,e,r,o){var a=new n(e,r,o);return a.compile(t)},u.prototype._findPluralRuleFunction=function(t){for(var e=u.__localeData__,r=e[t.toLowerCase()];r;){if(r.pluralRuleFunction)return r.pluralRuleFunction;r=r.parentLocale&&e[r.parentLocale.toLowerCase()]}throw new Error("Locale data added to IntlMessageFormat is missing a `pluralRuleFunction` for :"+t)},u.prototype._format=function(t,e){var r,n,o,a,i,l="";for(r=0,n=t.length;r<n;r+=1)if(o=t[r],"string"!=typeof o){if(a=o.id,!e||!q.call(e,a))throw new Error("A value must be provided for: "+a);i=e[a],l+=o.options?this._format(o.getOption(i),e):o.format(i)}else l+=o;return l},u.prototype._mergeFormats=function(t,e){var n,o,a={};for(n in t)q.call(t,n)&&(a[n]=o=V(t[n]),e&&q.call(e,n)&&r(o,e[n]));return a},u.prototype._resolveLocale=function(t){"string"==typeof t&&(t=[t]),t=(t||[]).concat(u.defaultLocale);var e,r,n,o,a=u.__localeData__;for(e=0,r=t.length;e<r;e+=1)for(n=t[e].toLowerCase().split("-");n.length;){if(o=a[n.join("-")])return o.locale;n.pop()}var i=t.pop();throw new Error("No locale data has been added to IntlMessageFormat for: "+t.join(", ")+", or the default locale: "+i)};var B={locale:"en",pluralRuleFunction:function(t,e){var r=String(t).split("."),n=!r[1],o=Number(r[0])==t,a=o&&r[0].slice(-1),i=o&&r[0].slice(-2);return e?1==a&&11!=i?"one":2==a&&12!=i?"two":3==a&&13!=i?"few":"other":1==t&&n?"one":"other"}};u.__addLocaleData(B),u.defaultLocale="en";var J=Math.round,$=function(t,e){t=+t,e=+e;var r=J(e-t),n=J(r/1e3),o=J(n/60),a=J(o/60),i=J(a/24),l=J(i/7),u=s(i),c=J(12*u),f=J(u);return{millisecond:r,second:n,minute:o,hour:a,day:i,week:l,month:c,year:f}},z=Object.prototype.hasOwnProperty,K=Object.prototype.toString,Q=function(){try{return!!Object.defineProperty({},"a",{})}catch(t){return!1}}(),X=Q?Object.defineProperty:function(t,e,r){"get"in r&&t.__defineGetter__?t.__defineGetter__(e,r.get):(!z.call(t,e)||"value"in r)&&(t[e]=r.value)},Y=Object.create||function(t,e){function r(){}var n,o;r.prototype=t,n=new r;for(o in e)z.call(e,o)&&X(n,o,e[o]);return n},tt=Array.prototype.indexOf||function(t,e){var r=this;if(!r.length)return-1;for(var n=e||0,o=r.length;n<o;n++)if(r[n]===t)return n;return-1},et=Array.isArray||function(t){return"[object Array]"===K.call(t)},rt=Date.now||function(){return(new Date).getTime()},nt=["second","minute","hour","day","month","year"],ot=["best fit","numeric"];X(c,"__localeData__",{value:Y(null)}),X(c,"__addLocaleData",{value:function(t){if(!t||!t.locale)throw new Error("Locale data provided to IntlRelativeFormat is missing a `locale` property value");c.__localeData__[t.locale.toLowerCase()]=t,u.__addLocaleData(t)}}),X(c,"defaultLocale",{enumerable:!0,writable:!0,value:void 0}),X(c,"thresholds",{enumerable:!0,value:{second:45,minute:45,hour:22,day:26,month:11}}),c.prototype.resolvedOptions=function(){return{locale:this._locale,style:this._options.style,units:this._options.units}},c.prototype._compileMessage=function(t){var e,r=this._locales,n=(this._locale,this._fields[t]),o=n.relativeTime,a="",i="";for(e in o.future)o.future.hasOwnProperty(e)&&(a+=" "+e+" {"+o.future[e].replace("{0}","#")+"}");for(e in o.past)o.past.hasOwnProperty(e)&&(i+=" "+e+" {"+o.past[e].replace("{0}","#")+"}");var l="{when, select, future {{0, plural, "+a+"}}past {{0, plural, "+i+"}}}";return new u(l,r)},c.prototype._getMessage=function(t){var e=this._messages;return e[t]||(e[t]=this._compileMessage(t)),e[t]},c.prototype._getRelativeUnits=function(t,e){var r=this._fields[e];if(r.relative)return r.relative[t]},c.prototype._findFields=function(t){for(var e=c.__localeData__,r=e[t.toLowerCase()];r;){if(r.fields)return r.fields;r=r.parentLocale&&e[r.parentLocale.toLowerCase()]}throw new Error("Locale data added to IntlRelativeFormat is missing `fields` for :"+t)},c.prototype._format=function(t,e){var r=e&&void 0!==e.now?e.now:rt();if(void 0===t&&(t=r),!isFinite(r))throw new RangeError("The `now` option provided to IntlRelativeFormat#format() is not in valid range.");if(!isFinite(t))throw new RangeError("The date value provided to IntlRelativeFormat#format() is not in valid range.");var n=$(r,t),o=this._options.units||this._selectUnits(n),a=n[o];if("numeric"!==this._options.style){var i=this._getRelativeUnits(a,o);if(i)return i}return this._getMessage(o).format({0:Math.abs(a),when:a<0?"past":"future"})},c.prototype._isValidUnits=function(t){if(!t||tt.call(nt,t)>=0)return!0;if("string"==typeof t){var e=/s$/.test(t)&&t.substr(0,t.length-1);if(e&&tt.call(nt,e)>=0)throw new Error('"'+t+'" is not a valid IntlRelativeFormat `units` value, did you mean: '+e)}throw new Error('"'+t+'" is not a valid IntlRelativeFormat `units` value, it must be one of: "'+nt.join('", "')+'"')},c.prototype._resolveLocale=function(t){"string"==typeof t&&(t=[t]),t=(t||[]).concat(c.defaultLocale);var e,r,n,o,a=c.__localeData__;for(e=0,r=t.length;e<r;e+=1)for(n=t[e].toLowerCase().split("-");n.length;){if(o=a[n.join("-")])return o.locale;n.pop()}var i=t.pop();throw new Error("No locale data has been added to IntlRelativeFormat for: "+t.join(", ")+", or the default locale: "+i)},c.prototype._resolveStyle=function(t){if(!t)return ot[0];if(tt.call(ot,t)>=0)return t;throw new Error('"'+t+'" is not a valid IntlRelativeFormat `style` value, it must be one of: "'+ot.join('", "')+'"')},c.prototype._selectUnits=function(t){var e,r,n;for(e=0,r=nt.length;e<r&&(n=nt[e],!(Math.abs(t[n])<c.thresholds[n]));e+=1);return n};var at={locale:"en",pluralRuleFunction:function(t,e){var r=String(t).split("."),n=!r[1],o=Number(r[0])==t,a=o&&r[0].slice(-1),i=o&&r[0].slice(-2);return e?1==a&&11!=i?"one":2==a&&12!=i?"two":3==a&&13!=i?"few":"other":1==t&&n?"one":"other"},fields:{year:{displayName:"year",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{one:"in {0} year",other:"in {0} years"},past:{one:"{0} year ago",other:"{0} years ago"}}},month:{displayName:"month",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{one:"in {0} month",other:"in {0} months"},past:{one:"{0} month ago",other:"{0} months ago"}}},day:{displayName:"day",relative:{0:"today",1:"tomorrow","-1":"yesterday"},relativeTime:{future:{one:"in {0} day",other:"in {0} days"},past:{one:"{0} day ago",other:"{0} days ago"}}},hour:{displayName:"hour",relativeTime:{future:{one:"in {0} hour",other:"in {0} hours"},past:{one:"{0} hour ago",other:"{0} hours ago"}}},minute:{displayName:"minute",relativeTime:{future:{one:"in {0} minute",other:"in {0} minutes"},past:{one:"{0} minute ago",other:"{0} minutes ago"}}},second:{displayName:"second",relative:{0:"now"},relativeTime:{future:{one:"in {0} second",other:"in {0} seconds"},past:{one:"{0} second ago",other:"{0} seconds ago"}}}}};c.__addLocaleData(at),c.defaultLocale="en";var it="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},lt=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},ut=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),st=function(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t},ct=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},ft=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)},pt=function(t,e){var r={};for(var n in t)e.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=t[n]);return r},ht=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e},mt=function(t){if(Array.isArray(t)){for(var e=0,r=Array(t.length);e<t.length;e++)r[e]=t[e];return r}return Array.from(t)},dt=e.PropTypes.bool,yt=e.PropTypes.number,vt=e.PropTypes.string,gt=e.PropTypes.func,_t=e.PropTypes.object,bt=e.PropTypes.oneOf,wt=e.PropTypes.shape,Ft=e.PropTypes.any,Ot=bt(["best fit","lookup"]),xt=bt(["narrow","short","long"]),Pt=bt(["numeric","2-digit"]),Tt=gt.isRequired,jt={locale:vt,formats:_t,messages:_t,textComponent:Ft,defaultLocale:vt,defaultFormats:_t},Ct={formatDate:Tt,formatTime:Tt,formatRelative:Tt,formatNumber:Tt,formatPlural:Tt,formatMessage:Tt,formatHTMLMessage:Tt},At=wt(ct({},jt,Ct,{formatters:_t,now:Tt})),Nt={localeMatcher:Ot,formatMatcher:bt(["basic","best fit"]),timeZone:vt,hour12:dt,weekday:xt,era:xt,year:Pt,month:bt(["numeric","2-digit","narrow","short","long"]),day:Pt,hour:Pt,minute:Pt,second:Pt,timeZoneName:bt(["short","long"])},Mt={localeMatcher:Ot,style:bt(["decimal","currency","percent"]),currency:vt,currencyDisplay:bt(["symbol","code","name"]),useGrouping:dt,minimumIntegerDigits:yt,minimumFractionDigits:yt,maximumFractionDigits:yt,minimumSignificantDigits:yt,maximumSignificantDigits:yt},Rt={style:bt(["best fit","numeric"]),units:bt(["second","minute","hour","day","month","year"])},kt={style:bt(["cardinal","ordinal"])},Dt="production",Et=function(t,e,r,n,o,a,i,l){if("production"!==Dt&&void 0===e)throw new Error("invariant requires an error message argument");if(!t){var u;if(void 0===e)u=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var s=[r,n,o,a,i,l],c=0;u=new Error(e.replace(/%s/g,function(){return s[c++]})),u.name="Invariant Violation";
|
||
}throw u.framesToPop=1,u}},Lt=Et,It=Object.keys(jt),St={"&":"&",">":">","<":"<",'"':""","'":"'"},Ut=/[&><"']/g,Gt=function t(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};lt(this,t);var n="ordinal"===r.style,o=O(F(e));this.format=function(t){return o(t,n)}},qt=Function.prototype.bind||function(t){if("function"!=typeof this)throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");var e=Array.prototype.slice.call(arguments,1),r=this,n=function(){},o=function(){return r.apply(this instanceof n?this:t,e.concat(Array.prototype.slice.call(arguments)))};return this.prototype&&(n.prototype=this.prototype),o.prototype=new n,o},Ht=Object.prototype.hasOwnProperty,Wt=function(){try{return!!Object.defineProperty({},"a",{})}catch(t){return!1}}(),Vt=Wt?Object.defineProperty:function(t,e,r){"get"in r&&t.__defineGetter__?t.__defineGetter__(e,r.get):(!Ht.call(t,e)||"value"in r)&&(t[e]=r.value)},Zt=Object.create||function(t,e){function r(){}var n,o;r.prototype=t,n=new r;for(o in e)Ht.call(e,o)&&Vt(n,o,e[o]);return n},Bt=Object.keys(Nt),Jt=Object.keys(Mt),$t=Object.keys(Rt),zt=Object.keys(kt),Kt={second:60,minute:60,hour:24,day:30,month:12},Qt=Object.freeze({formatDate:A,formatTime:N,formatRelative:M,formatNumber:R,formatPlural:k,formatMessage:D,formatHTMLMessage:E}),Xt=Object.keys(jt),Yt=Object.keys(Ct),te={formats:{},messages:{},textComponent:"span",defaultLocale:"en",defaultFormats:{}},ee=function(t){function r(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};lt(this,r);var n=ht(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,t,e));Lt("undefined"!=typeof Intl,"[React Intl] The `Intl` APIs must be available in the runtime, and do not appear to be built-in. An `Intl` polyfill should be loaded.\nSee: http://formatjs.io/guides/runtime-environments/");var o=e.intl,a=void 0;a=isFinite(t.initialNow)?Number(t.initialNow):o?o.now():Date.now();var i=o||{},l=i.formatters,s=void 0===l?{getDateTimeFormat:x(Intl.DateTimeFormat),getNumberFormat:x(Intl.NumberFormat),getMessageFormat:x(u),getRelativeFormat:x(c),getPluralFormat:x(Gt)}:l;return n.state=ct({},s,{now:function(){return n._didDisplay?Date.now():a}}),n}return ft(r,t),ut(r,[{key:"getConfig",value:function(){var t=this.context.intl,e=d(this.props,Xt,t);for(var r in te)void 0===e[r]&&(e[r]=te[r]);if(!p(e.locale)){var n=e,o=(n.locale,n.defaultLocale),a=n.defaultFormats;e=ct({},e,{locale:o,formats:a,messages:te.messages})}return e}},{key:"getBoundFormatFns",value:function(t,e){return Yt.reduce(function(r,n){return r[n]=Qt[n].bind(null,t,e),r},{})}},{key:"getChildContext",value:function(){var t=this.getConfig(),e=this.getBoundFormatFns(t,this.state),r=this.state,n=r.now,o=pt(r,["now"]);return{intl:ct({},t,e,{formatters:o,now:n})}}},{key:"shouldComponentUpdate",value:function(){for(var t=arguments.length,e=Array(t),r=0;r<t;r++)e[r]=arguments[r];return g.apply(void 0,[this].concat(e))}},{key:"componentDidMount",value:function(){this._didDisplay=!0}},{key:"render",value:function(){return e.Children.only(this.props.children)}}]),r}(e.Component);ee.displayName="IntlProvider",ee.contextTypes={intl:At},ee.childContextTypes={intl:At.isRequired};var re=function(t){function e(t,r){lt(this,e);var n=ht(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,r));return y(r),n}return ft(e,t),ut(e,[{key:"shouldComponentUpdate",value:function(){for(var t=arguments.length,e=Array(t),r=0;r<t;r++)e[r]=arguments[r];return g.apply(void 0,[this].concat(e))}},{key:"render",value:function(){var t=this.context.intl,e=t.formatDate,r=t.textComponent,n=this.props,o=n.value,a=n.children,i=e(o,this.props);return"function"==typeof a?a(i):U.createElement(r,null,i)}}]),e}(e.Component);re.displayName="FormattedDate",re.contextTypes={intl:At};var ne=function(t){function e(t,r){lt(this,e);var n=ht(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,r));return y(r),n}return ft(e,t),ut(e,[{key:"shouldComponentUpdate",value:function(){for(var t=arguments.length,e=Array(t),r=0;r<t;r++)e[r]=arguments[r];return g.apply(void 0,[this].concat(e))}},{key:"render",value:function(){var t=this.context.intl,e=t.formatTime,r=t.textComponent,n=this.props,o=n.value,a=n.children,i=e(o,this.props);return"function"==typeof a?a(i):U.createElement(r,null,i)}}]),e}(e.Component);ne.displayName="FormattedTime",ne.contextTypes={intl:At};var oe=1e3,ae=6e4,ie=36e5,le=864e5,ue=2147483647,se=function(t){function e(t,r){lt(this,e);var n=ht(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,r));y(r);var o=isFinite(t.initialNow)?Number(t.initialNow):r.intl.now();return n.state={now:o},n}return ft(e,t),ut(e,[{key:"scheduleNextUpdate",value:function(t,e){var r=this,n=t.updateInterval;if(n){var o=new Date(t.value).getTime(),a=o-e.now,i=t.units||L(a),l=I(i),u=Math.abs(a%l),s=a<0?Math.max(n,l-u):Math.max(n,u);clearTimeout(this._timer),this._timer=setTimeout(function(){r.setState({now:r.context.intl.now()})},s)}}},{key:"componentDidMount",value:function(){this.scheduleNextUpdate(this.props,this.state)}},{key:"componentWillReceiveProps",value:function(t){var e=t.value;S(e,this.props.value)||this.setState({now:this.context.intl.now()})}},{key:"shouldComponentUpdate",value:function(){for(var t=arguments.length,e=Array(t),r=0;r<t;r++)e[r]=arguments[r];return g.apply(void 0,[this].concat(e))}},{key:"componentWillUpdate",value:function(t,e){this.scheduleNextUpdate(t,e)}},{key:"componentWillUnmount",value:function(){clearTimeout(this._timer)}},{key:"render",value:function(){var t=this.context.intl,e=t.formatRelative,r=t.textComponent,n=this.props,o=n.value,a=n.children,i=e(o,ct({},this.props,this.state));return"function"==typeof a?a(i):U.createElement(r,null,i)}}]),e}(e.Component);se.displayName="FormattedRelative",se.contextTypes={intl:At},se.defaultProps={updateInterval:1e4};var ce=function(t){function e(t,r){lt(this,e);var n=ht(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,r));return y(r),n}return ft(e,t),ut(e,[{key:"shouldComponentUpdate",value:function(){for(var t=arguments.length,e=Array(t),r=0;r<t;r++)e[r]=arguments[r];return g.apply(void 0,[this].concat(e))}},{key:"render",value:function(){var t=this.context.intl,e=t.formatNumber,r=t.textComponent,n=this.props,o=n.value,a=n.children,i=e(o,this.props);return"function"==typeof a?a(i):U.createElement(r,null,i)}}]),e}(e.Component);ce.displayName="FormattedNumber",ce.contextTypes={intl:At};var fe=function(t){function e(t,r){lt(this,e);var n=ht(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,r));return y(r),n}return ft(e,t),ut(e,[{key:"shouldComponentUpdate",value:function(){for(var t=arguments.length,e=Array(t),r=0;r<t;r++)e[r]=arguments[r];return g.apply(void 0,[this].concat(e))}},{key:"render",value:function(){var t=this.context.intl,e=t.formatPlural,r=t.textComponent,n=this.props,o=n.value,a=n.other,i=n.children,l=e(o,this.props),u=this.props[l]||a;return"function"==typeof i?i(u):U.createElement(r,null,u)}}]),e}(e.Component);fe.displayName="FormattedPlural",fe.contextTypes={intl:At},fe.defaultProps={style:"cardinal"};var pe=function(t){function r(t,e){lt(this,r);var n=ht(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,t,e));return y(e),n}return ft(r,t),ut(r,[{key:"shouldComponentUpdate",value:function(t){var e=this.props.values,r=t.values;if(!v(r,e))return!0;for(var n=ct({},t,{values:e}),o=arguments.length,a=Array(o>1?o-1:0),i=1;i<o;i++)a[i-1]=arguments[i];return g.apply(void 0,[this,n].concat(a))}},{key:"render",value:function(){var t=this.context.intl,r=t.formatMessage,n=t.textComponent,o=this.props,a=o.id,i=o.description,l=o.defaultMessage,u=o.values,s=o.tagName,c=void 0===s?n:s,f=o.children,p=void 0,h=void 0,m=void 0,d=u&&Object.keys(u).length>0;d&&!function(){var t=Math.floor(1099511627776*Math.random()).toString(16),r=function(){var e=0;return function(){return"ELEMENT-"+t+"-"+(e+=1)}}();p="@__"+t+"__@",h={},m={},Object.keys(u).forEach(function(t){var n=u[t];if(e.isValidElement(n)){var o=r();h[t]=p+o+p,m[o]=n}else h[t]=n})}();var y={id:a,description:i,defaultMessage:l},v=r(y,h||u),g=void 0,_=m&&Object.keys(m).length>0;return g=_?v.split(p).filter(function(t){return!!t}).map(function(t){return m[t]||t}):[v],"function"==typeof f?f.apply(void 0,mt(g)):e.createElement.apply(void 0,[c,null].concat(mt(g)))}}]),r}(e.Component);pe.displayName="FormattedMessage",pe.contextTypes={intl:At},pe.defaultProps={values:{}};var he=function(t){function e(t,r){lt(this,e);var n=ht(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,r));return y(r),n}return ft(e,t),ut(e,[{key:"shouldComponentUpdate",value:function(t){var e=this.props.values,r=t.values;if(!v(r,e))return!0;for(var n=ct({},t,{values:e}),o=arguments.length,a=Array(o>1?o-1:0),i=1;i<o;i++)a[i-1]=arguments[i];return g.apply(void 0,[this,n].concat(a))}},{key:"render",value:function(){var t=this.context.intl,e=t.formatHTMLMessage,r=t.textComponent,n=this.props,o=n.id,a=n.description,i=n.defaultMessage,l=n.values,u=n.tagName,s=void 0===u?r:u,c=n.children,f={id:o,description:a,defaultMessage:i},p=e(f,l);if("function"==typeof c)return c(p);var h={__html:p};return U.createElement(s,{dangerouslySetInnerHTML:h})}}]),e}(e.Component);he.displayName="FormattedHTMLMessage",he.contextTypes={intl:At},he.defaultProps={values:{}},f(G),t.addLocaleData=f,t.intlShape=At,t.injectIntl=b,t.defineMessages=w,t.IntlProvider=ee,t.FormattedDate=re,t.FormattedTime=ne,t.FormattedRelative=se,t.FormattedNumber=ce,t.FormattedPlural=fe,t.FormattedMessage=pe,t.FormattedHTMLMessage=he,Object.defineProperty(t,"__esModule",{value:!0})});
|