react-localize-redux
Advanced tools
Comparing version 3.0.1 to 3.0.2
@@ -1,2 +0,2 @@ | ||
## 3.0.1 (June 3, 2018) | ||
## 3.0.1 (June 4, 2018) | ||
@@ -3,0 +3,0 @@ * Update package.json peerDependencies react version to 16.3.0 as the `Translate` component requires [getDerivedStateFromProps](https://reactjs.org/docs/react-component.html#static-getderivedstatefromprops). |
@@ -1,2 +0,2 @@ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):"object"==typeof exports?exports.ReactLocalizeRedux=t(require("react")):e.ReactLocalizeRedux=t(e.React)}(this,function(e){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};return t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=18)}([function(t,n){t.exports=e},function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function a(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments[1];switch(t.type){case g:var n=t.payload.options||{};return t.payload.languages.map(function(e,t){var r=function(e){return void 0!==n.defaultLanguage?e===n.defaultLanguage:0===t};return"string"==typeof e?{code:e,active:r(e)}:l({},e,{active:r(e.code)})});case h:return e.map(function(e){return e.code===t.payload.languageCode?l({},e,{active:!0}):l({},e,{active:!1})});default:return e}}function i(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments[1],n=void 0,r=void 0;switch(t.type){case g:if(!t.payload.translation)return e;n=(0,f.flatten)(t.payload.translation,{safe:!0});var o=t.payload.options||{},a="string"==typeof t.payload.languages[0]?t.payload.languages[0]:t.payload.languages[0].code,i=o.defaultLanguage||a,u=Object.keys(n).some(function(e){return Array.isArray(n[e])}),c=u?n:(0,p.getSingleToMultilanguageTranslation)(i,t.languageCodes,n,e);return l({},e,c);case v:return r=t.payload.translationOptions&&void 0!==t.payload.translationOptions.translationTransform?t.payload.translationOptions.translationTransform(t.payload.translation||{},t.languageCodes):t.payload.translation,l({},e,(0,f.flatten)(r,{safe:!0}));case y:return n=(0,f.flatten)(t.payload.translation,{safe:!0}),l({},e,(0,p.getSingleToMultilanguageTranslation)(t.payload.language,t.languageCodes,n,e));default:return e}}function u(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:b,t=arguments[1];switch(t.type){case g:var n=t.payload.options||{};return l({},e,(0,p.validateOptions)(n));default:return e}}Object.defineProperty(t,"__esModule",{value:!0}),t.getTranslate=t.getTranslationsForSpecificLanguage=t.getTranslationsForActiveLanguage=t.translationsEqualSelector=t.getActiveLanguage=t.getOptions=t.getLanguages=t.getTranslations=t.setActiveLanguage=t.addTranslationForLanguage=t.addTranslation=t.initialize=t.localizeReducer=t.defaultTranslateOptions=t.TRANSLATE=t.SET_ACTIVE_LANGUAGE=t.ADD_TRANSLATION_FOR_LANGUAGE=t.ADD_TRANSLATION=t.INITIALIZE=void 0;var c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};t.languages=a,t.translations=i,t.options=u;var s=n(0),f=(function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);t.default=e}(s),n(4),n(8)),d=n(15),p=n(3),g=t.INITIALIZE="@@localize/INITIALIZE",v=t.ADD_TRANSLATION="@@localize/ADD_TRANSLATION",y=t.ADD_TRANSLATION_FOR_LANGUAGE="@@localize/ADD_TRANSLATION_FOR_LANGUAGE",h=t.SET_ACTIVE_LANGUAGE="@@localize/SET_ACTIVE_LANGUAGE",b=(t.TRANSLATE="@@localize/TRANSLATE",t.defaultTranslateOptions={renderToStaticMarkup:!1,renderInnerHtml:!1,ignoreTranslateChildren:!1,onMissingTranslation:function(e){e.translationId,e.languageCode;return"Missing translationId: ${ translationId } for language: ${ languageCode }"}}),O={languages:[],translations:{},options:b},m=(t.localizeReducer=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:O,t=arguments[1],n=e.languages.map(function(e){return e.code});return{languages:a(e.languages,t),translations:i(e.translations,l({},t,{languageCodes:n})),options:u(e.options,t)}},t.initialize=function(e){return{type:g,payload:e}},t.addTranslation=function(e,t){return{type:v,payload:{translation:e,translationOptions:t}}},t.addTranslationForLanguage=function(e,t){return{type:y,payload:{translation:e,language:t}}},t.setActiveLanguage=function(e){return{type:h,payload:{languageCode:e}}},t.getTranslations=function(e){return e.translations}),T=t.getLanguages=function(e){return e.languages},j=t.getOptions=function(e){return e.options},w=t.getActiveLanguage=function(e){return T(e).filter(function(e){return!0===e.active})[0]},_=t.translationsEqualSelector=(0,d.createSelectorCreator)(d.defaultMemoize,function(e,t){var n="object"===(void 0===e?"undefined":c(e))?Object.keys(e).toString():void 0,r="object"===(void 0===t?"undefined":c(t))?Object.keys(t).toString():void 0,o="object"===(void 0===e?"undefined":c(e))?(0,p.objectValuesToString)(e):void 0,a="object"===(void 0===t?"undefined":c(t))?(0,p.objectValuesToString)(t):void 0;return(void 0!==n&&void 0!==o?n+" - "+o:e)===(void 0!==r&&void 0!==a?r+" - "+a:t)}),S=t.getTranslationsForActiveLanguage=_(w,T,m,p.getTranslationsForLanguage),A=t.getTranslationsForSpecificLanguage=_(T,m,function(e,t){return(0,d.defaultMemoize)(function(n){return(0,p.getTranslationsForLanguage)({code:n,active:!1},e,t)})}),L=(0,d.createSelector)(S,A,w,j,function(e,t,n,a){return function(i){var u=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=(a.defaultLanguage,o(a,["defaultLanguage"])),f=c.language,d=void 0!==f?t(f):e,g=n&&n.code===a.defaultLanguage?e:void 0!==a.defaultLanguage?t(a.defaultLanguage):{},v=void 0!==f?f:n&&n.code,y=function(e){return h.onMissingTranslation({translationId:e,languageCode:v,defaultTranslation:g[e]})},h=l({},s,c),b=h.renderInnerHtml,O={translations:d,data:u,languageCode:v,renderInnerHtml:b,onMissingTranslation:y};if("string"==typeof i)return(0,p.getLocalizedElement)(l({translationId:i},O));if(Array.isArray(i))return i.reduce(function(e,t){return l({},e,r({},t,(0,p.getLocalizedElement)(l({translationId:t},O))))},{});throw new Error("react-localize-redux: Invalid key passed to getTranslate.")}});t.getTranslate=L},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.LocalizeContext=t.getContextPropsFromState=void 0;var o=n(0),a=(r(o),n(20)),i=r(a),u=n(15),c=n(1),l=function(e){return function(t){return e((0,c.initialize)(t))}},s=function(e){return function(t){return e((0,c.addTranslation)(t))}},f=function(e){return function(t,n){return e((0,c.addTranslationForLanguage)(t,n))}},d=function(e){return function(t){return e((0,c.setActiveLanguage)(t))}},p=t.getContextPropsFromState=function(e){return(0,u.createSelector)(c.getTranslate,c.getLanguages,c.getActiveLanguage,c.getOptions,function(t,n,r,o){var a=o.defaultLanguage||n[0]&&n[0].code,i=o.renderToStaticMarkup;return{translate:t,languages:n,defaultLanguage:a,activeLanguage:r,initialize:l(e),addTranslation:s(e),addTranslationForLanguage:f(e),setActiveLanguage:d(e),renderToStaticMarkup:i}})},g=(0,c.localizeReducer)(void 0,{}),v=p(function(){})(g);t.LocalizeContext=(0,i.default)(v)},function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Object.defineProperty(t,"__esModule",{value:!0}),t.warning=t.getSingleToMultilanguageTranslation=t.storeDidChange=t.getTranslationsForLanguage=t.validateOptions=t.objectValuesToString=t.getIndexForLanguageCode=t.templater=t.hasHtmlTags=t.getLocalizedElement=void 0;var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},a=n(0),i=function(e){return e&&e.__esModule?e:{default:e}}(a);n(4);var u=(n(8),n(1),t.getLocalizedElement=function(e){var t=e.translationId,n=e.translations,r=e.data,o=e.renderInnerHtml,a=e.onMissingTranslation,l=n[t]||a(t),s=n[t]?r:{translationId:e.translationId,languageCode:e.languageCode},f=c(l,s);return!0===o&&u(f)?i.default.createElement("span",{dangerouslySetInnerHTML:{__html:f}}):f},t.hasHtmlTags=function(e){var t=/(&[^\s]*;|<\/?\w+((\s+\w+(\s*=\s*(?:".*?"|'.*?'|[\^'">\s]+))?)+\s*|\s*)\/?>)/;return e.search(t)>=0}),c=t.templater=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};for(var n in t){var r="\\${\\s*"+n+"\\s*}",o=new RegExp(r,"gmi");e=e.replace(o,t[n])}return e},l=t.getIndexForLanguageCode=function(e,t){return t.map(function(e){return e.code}).indexOf(e)};t.objectValuesToString=function(e){return Object.values?Object.values(e).toString():Object.keys(e).map(function(t){return e[t].toString()}).toString()},t.validateOptions=function(e){if(void 0!==e.onMissingTranslation&&"function"!=typeof e.onMissingTranslation)throw new Error("react-localize-redux: an invalid onMissingTranslation function was provided.");if(!1!==e.renderToStaticMarkup&&"function"!=typeof e.renderToStaticMarkup)throw new Error("\n react-localize-redux: initialize option renderToStaticMarkup is invalid. \n Please see https://ryandrewjohnson.github.io/react-localize-docs/#initialize.\n ");return e},t.getTranslationsForLanguage=function(e,t,n){if(!e)return{};var a=e.code,i=l(a,t);return Object.keys(n).reduce(function(e,t){return o({},e,r({},t,n[t][i]))},{})},t.storeDidChange=function(e,t){function n(){var n=e.getState();n!==r&&(t(r),r=n)}var r=void 0,o=e.subscribe(n);return n(),o},t.getSingleToMultilanguageTranslation=function(e,t,n,a){var i=t.indexOf(e),u=i>=0?n:{};return Object.keys(u).reduce(function(e,u){var c=t.map(function(e,t){var r=a[u]||[];return t===i?n[u]:r[t]});return o({},e,r({},u,c))},{})},t.warning=function(e){"undefined"!=typeof console&&"function"==typeof console.error&&console.error(e);try{throw new Error(e)}catch(e){}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(13),o=n(37),a=n(36),i=n(35),u=n(12);n(14);n.d(t,"createStore",function(){return r.a}),n.d(t,"combineReducers",function(){return o.a}),n.d(t,"bindActionCreators",function(){return a.a}),n.d(t,"applyMiddleware",function(){return i.a}),n.d(t,"compose",function(){return u.a})},function(e,t){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";function r(e){return function(t){return i.default.createElement(u.LocalizeContext.Consumer,null,function(n){return i.default.createElement(e,o({},n,t))})}}Object.defineProperty(t,"__esModule",{value:!0});var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};t.withLocalize=r;var a=n(0),i=function(e){return e&&e.__esModule?e:{default:e}}(a),u=n(2)},function(e,t,n){"use strict";function r(e){return function(){return e}}var o=function(){};o.thatReturns=r,o.thatReturnsFalse=r(!1),o.thatReturnsTrue=r(!0),o.thatReturnsNull=r(null),o.thatReturnsThis=function(){return this},o.thatReturnsArgument=function(e){return e},e.exports=o},function(e,t,n){function r(e,t){function n(e,u,c){c=c||1,Object.keys(e).forEach(function(l){var s=e[l],f=t.safe&&Array.isArray(s),d=Object.prototype.toString.call(s),p=a(s),g="[object Object]"===d||"[object Array]"===d,v=u?u+r+l:l;if(!f&&!p&&g&&Object.keys(s).length&&(!t.maxDepth||c<o))return n(s,v,c+1);i[v]=s})}t=t||{};var r=t.delimiter||".",o=t.maxDepth,i={};return n(e),i}function o(e,t){function n(e){var t=Number(e);return isNaN(t)||-1!==e.indexOf(".")?e:t}t=t||{};var r=t.delimiter||".",i=t.overwrite||!1,u={};return a(e)||"[object Object]"!==Object.prototype.toString.call(e)?e:(Object.keys(e).forEach(function(a){for(var c=a.split(r),l=n(c.shift()),s=n(c[0]),f=u;void 0!==s;){var d=Object.prototype.toString.call(f[l]),p="[object Object]"===d||"[object Array]"===d;if(!i&&!p&&void 0!==f[l])return;(i&&!p||!i&&null==f[l])&&(f[l]="number"!=typeof s||t.object?{}:[]),f=f[l],c.length>0&&(l=n(c.shift()),s=n(c[0]))}f[l]=o(e[a],t)}),u)}var a=n(24);e.exports=r;r.flatten=r,r.unflatten=o},function(e,t,n){"use strict";var r=n(31),o=r.a.Symbol;t.a=o},function(e,t,n){"use strict";function r(e){if(!n.i(i.a)(e)||n.i(o.a)(e)!=u)return!1;var t=n.i(a.a)(e);if(null===t)return!0;var r=f.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&s.call(r)==d}var o=n(25),a=n(27),i=n(32),u="[object Object]",c=Function.prototype,l=Object.prototype,s=c.toString,f=l.hasOwnProperty,d=s.call(Object);t.a=r},function(e,t,n){e.exports=n(33)()},function(e,t,n){"use strict";function r(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return 0===t.length?function(e){return e}:1===t.length?t[0]:t.reduce(function(e,t){return function(){return e(t.apply(void 0,arguments))}})}t.a=r},function(e,t,n){"use strict";function r(e,t,u){function c(){b===h&&(b=h.slice())}function l(){return y}function s(e){if("function"!=typeof e)throw new Error("Expected listener to be a function.");var t=!0;return c(),b.push(e),function(){if(t){t=!1,c();var n=b.indexOf(e);b.splice(n,1)}}}function f(e){if(!n.i(o.a)(e))throw new Error("Actions must be plain objects. Use custom middleware for async actions.");if(void 0===e.type)throw new Error('Actions may not have an undefined "type" property. Have you misspelled a constant?');if(O)throw new Error("Reducers may not dispatch actions.");try{O=!0,y=v(y,e)}finally{O=!1}for(var t=h=b,r=0;r<t.length;r++){(0,t[r])()}return e}function d(e){if("function"!=typeof e)throw new Error("Expected the nextReducer to be a function.");v=e,f({type:i.INIT})}function p(){var e,t=s;return e={subscribe:function(e){function n(){e.next&&e.next(l())}if("object"!=typeof e)throw new TypeError("Expected the observer to be an object.");return n(),{unsubscribe:t(n)}}},e[a.a]=function(){return this},e}var g;if("function"==typeof t&&void 0===u&&(u=t,t=void 0),void 0!==u){if("function"!=typeof u)throw new Error("Expected the enhancer to be a function.");return u(r)(e,t)}if("function"!=typeof e)throw new Error("Expected the reducer to be a function.");var v=e,y=t,h=[],b=h,O=!1;return f({type:i.INIT}),g={dispatch:f,subscribe:s,getState:l,replaceReducer:d},g[a.a]=p,g}n.d(t,"b",function(){return i}),t.a=r;var o=n(10),a=n(38),i={INIT:"@@redux/INIT"}},function(e,t,n){"use strict"},function(e,t,n){"use strict";function r(e,t){return e===t}function o(e,t,n){if(null===t||null===n||t.length!==n.length)return!1;for(var r=t.length,o=0;o<r;o++)if(!e(t[o],n[o]))return!1;return!0}function a(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:r,n=null,a=null;return function(){return o(t,n,arguments)||(a=e.apply(null,arguments)),n=arguments,a}}function i(e){var t=Array.isArray(e[0])?e[0]:e;if(!t.every(function(e){return"function"==typeof e})){var n=t.map(function(e){return typeof e}).join(", ");throw new Error("Selector creators expect all input-selectors to be functions, instead received the following types: ["+n+"]")}return t}function u(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return function(){for(var t=arguments.length,r=Array(t),o=0;o<t;o++)r[o]=arguments[o];var u=0,c=r.pop(),l=i(r),s=e.apply(void 0,[function(){return u++,c.apply(null,arguments)}].concat(n)),f=a(function(){for(var e=[],t=l.length,n=0;n<t;n++)e.push(l[n].apply(null,arguments));return s.apply(null,e)});return f.resultFunc=c,f.recomputations=function(){return u},f.resetRecomputations=function(){return u=0},f}}function c(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l;if("object"!=typeof e)throw new Error("createStructuredSelector expects first argument to be an object where each property is a selector, instead received a "+typeof e);var n=Object.keys(e);return t(n.map(function(t){return e[t]}),function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return t.reduce(function(e,t,r){return e[n[r]]=t,e},{})})}t.__esModule=!0,t.defaultMemoize=a,t.createSelectorCreator=u,t.createStructuredSelector=c;var l=t.createSelector=u(a)},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0}),t.LocalizeProvider=void 0;var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(0),c=function(e){return e&&e.__esModule?e:{default:e}}(u);n(4);var l=n(1),s=n(2),f=n(3);t.LocalizeProvider=function(e){function t(e){r(this,t);var n=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e)),a=n.props.store?n.props.store.dispatch:n.dispatch.bind(n);return n.getContextPropsSelector=(0,s.getContextPropsFromState)(a),n.state={localize:(0,l.localizeReducer)(void 0,{})},n}return a(t,e),i(t,[{key:"componentDidMount",value:function(){this.props.store&&(this.unsubscribeFromStore=(0,f.storeDidChange)(this.props.store,this.onStateDidChange.bind(this)))}},{key:"componentWillUnmount",value:function(){this.unsubscribeFromStore&&this.unsubscribeFromStore()}},{key:"onStateDidChange",value:function(e){if(this.props.store){var t=e&&e.localize,n=this.props.store.getState().localize,r=e&&(0,l.getActiveLanguage)(t),o=(0,l.getActiveLanguage)(n),a=e&&(0,l.getOptions)(t),i=(0,l.getOptions)(n),u=e&&(0,l.getTranslationsForActiveLanguage)(t),c=(0,l.getTranslationsForActiveLanguage)(n),s=(r&&r.code)!==(o&&o.code),f=a!==i,d=u!==c;(s||f||d)&&this.setState({localize:n})}}},{key:"dispatch",value:function(e){console.log("action",e),this.setState(function(t){return{localize:(0,l.localizeReducer)(t.localize,e)}})}},{key:"render",value:function(){return this.contextProps=this.getContextPropsSelector(this.state.localize),c.default.createElement(s.LocalizeContext.Provider,{value:this.contextProps},this.props.children)}}],[{key:"getDerivedStateFromProps",value:function(e,t){return null}}]),t}(u.Component)},function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0}),t.Translate=void 0;var u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),c=n(0),l=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(c),s=n(11),f=(function(e){e&&e.__esModule}(s),n(1),n(3),n(2));n(6),t.Translate=function(e){function t(e){o(this,t);var n=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.state={hasAddedDefaultTranslation:!1,lastKnownId:""},n}return i(t,e),u(t,[{key:"componentDidMount",value:function(){this.setState({hasAddedDefaultTranslation:!0})}},{key:"addDefaultTranslation",value:function(e){if(!this.state.hasAddedDefaultTranslation){var t=this.props,n=t.id,o=t.children,a=t.options,i=void 0===a?{}:a,u=i.language||e.defaultLanguage,c=function(e){return e},l=e.renderToStaticMarkup||c;if(void 0!==o&&"function"!=typeof o&&!i.ignoreTranslateChildren&&void 0!==n&&void 0!==u){var s=l(o);e.addTranslationForLanguage&&e.addTranslationForLanguage(r({},n,s),u)}}}},{key:"renderChildren",value:function(e){var t=this.props,n=t.id,r=void 0===n?"":n,o=t.options,a=t.data;return this.addDefaultTranslation(e),"function"==typeof this.props.children?this.props.children(e):e.translate&&e.translate(r,a,o)}},{key:"render",value:function(){var e=this;return l.createElement(f.LocalizeContext.Consumer,null,function(t){return e.renderChildren(t)})}}],[{key:"getDerivedStateFromProps",value:function(e,t){return t.lastKnownId===e.id?{hasAddedDefaultTranslation:!0}:{lastKnownId:e.id,hasAddedDefaultTranslation:!1}}}]),t}(l.Component)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(17);Object.defineProperty(t,"Translate",{enumerable:!0,get:function(){return r.Translate}});var o=n(6);Object.defineProperty(t,"withLocalize",{enumerable:!0,get:function(){return o.withLocalize}});var a=n(16);Object.defineProperty(t,"LocalizeProvider",{enumerable:!0,get:function(){return a.LocalizeProvider}});var i=n(2);Object.defineProperty(t,"LocalizeContext",{enumerable:!0,get:function(){return i.LocalizeContext}});var u=n(1);Object.defineProperty(t,"localizeReducer",{enumerable:!0,get:function(){return u.localizeReducer}}),Object.defineProperty(t,"initialize",{enumerable:!0,get:function(){return u.initialize}}),Object.defineProperty(t,"addTranslation",{enumerable:!0,get:function(){return u.addTranslation}}),Object.defineProperty(t,"addTranslationForLanguage",{enumerable:!0,get:function(){return u.addTranslationForLanguage}}),Object.defineProperty(t,"setActiveLanguage",{enumerable:!0,get:function(){return u.setActiveLanguage}}),Object.defineProperty(t,"getTranslate",{enumerable:!0,get:function(){return u.getTranslate}}),Object.defineProperty(t,"getActiveLanguage",{enumerable:!0,get:function(){return u.getActiveLanguage}}),Object.defineProperty(t,"getLanguages",{enumerable:!0,get:function(){return u.getLanguages}}),Object.defineProperty(t,"getTranslations",{enumerable:!0,get:function(){return u.getTranslations}}),Object.defineProperty(t,"getOptions",{enumerable:!0,get:function(){return u.getOptions}})},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function u(e,t){return e===t?0!==e||1/e==1/t:e!==e&&t!==t}function c(e){var t=[];return{on:function(e){t.push(e)},off:function(e){t=t.filter(function(t){return t!==e})},get:function(){return e},set:function(n,r){e=n,t.forEach(function(t){return t(e,r)})}}}function l(e){return Array.isArray(e)?e[0]:e}function s(e,t){var n,r,s="__create-react-context-"+(0,v.default)()+"__",d=function(e){function n(){var t,r,i;o(this,n);for(var u=arguments.length,l=Array(u),s=0;s<u;s++)l[s]=arguments[s];return t=r=a(this,e.call.apply(e,[this].concat(l))),r.emitter=c(r.props.value),i=t,a(r,i)}return i(n,e),n.prototype.getChildContext=function(){var e;return e={},e[s]=this.emitter,e},n.prototype.componentWillReceiveProps=function(e){if(this.props.value!==e.value){var n=this.props.value,r=e.value,o=void 0;u(n,r)?o=0:(o="function"==typeof t?t(n,r):h,0!==(o|=0)&&this.emitter.set(e.value,o))}},n.prototype.render=function(){return this.props.children},n}(f.Component);d.childContextTypes=(n={},n[s]=p.default.object.isRequired,n);var g=function(t){function n(){var e,r,i;o(this,n);for(var u=arguments.length,c=Array(u),l=0;l<u;l++)c[l]=arguments[l];return e=r=a(this,t.call.apply(t,[this].concat(c))),r.state={value:r.getValue()},r.onUpdate=function(e,t){0!=((0|r.observedBits)&t)&&r.setState({value:r.getValue()})},i=e,a(r,i)}return i(n,t),n.prototype.componentWillReceiveProps=function(e){var t=e.observedBits;this.observedBits=void 0===t||null===t?h:t},n.prototype.componentDidMount=function(){this.context[s]&&this.context[s].on(this.onUpdate);var e=this.props.observedBits;this.observedBits=void 0===e||null===e?h:e},n.prototype.componentWillUnmount=function(){this.context[s]&&this.context[s].off(this.onUpdate)},n.prototype.getValue=function(){return this.context[s]?this.context[s].get():e},n.prototype.render=function(){return l(this.props.children)(this.state.value)},n}(f.Component);return g.contextTypes=(r={},r[s]=p.default.object,r),{Provider:d,Consumer:g}}t.__esModule=!0;var f=n(0),d=(r(f),n(11)),p=r(d),g=n(23),v=r(g),y=n(22),h=(r(y),1073741823);t.default=s,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var o=n(0),a=r(o),i=n(19),u=r(i);t.default=a.default.createContext||u.default,e.exports=t.default},function(e,t,n){"use strict";function r(e,t,n,r,a,i,u,c){if(o(t),!e){var l;if(void 0===t)l=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var s=[n,r,a,i,u,c],f=0;l=new Error(t.replace(/%s/g,function(){return s[f++]})),l.name="Invariant Violation"}throw l.framesToPop=1,l}}var o=function(e){};e.exports=r},function(e,t,n){"use strict";var r=n(7),o=r;e.exports=o},function(e,t,n){"use strict";(function(t){var n="__global_unique_id__";e.exports=function(){return t[n]=(t[n]||0)+1}}).call(t,n(5))},function(e,t){function n(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}function r(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&n(e.slice(0,0))}/*! | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):"object"==typeof exports?exports.ReactLocalizeRedux=t(require("react")):e.ReactLocalizeRedux=t(e.React)}(this,function(e){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};return t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=18)}([function(t,n){t.exports=e},function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function a(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments[1];switch(t.type){case g:var n=t.payload.options||{};return t.payload.languages.map(function(e,t){var r=function(e){return void 0!==n.defaultLanguage?e===n.defaultLanguage:0===t};return"string"==typeof e?{code:e,active:r(e)}:l({},e,{active:r(e.code)})});case h:return e.map(function(e){return e.code===t.payload.languageCode?l({},e,{active:!0}):l({},e,{active:!1})});default:return e}}function i(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments[1],n=void 0,r=void 0;switch(t.type){case g:if(!t.payload.translation)return e;n=(0,f.flatten)(t.payload.translation,{safe:!0});var o=t.payload.options||{},a="string"==typeof t.payload.languages[0]?t.payload.languages[0]:t.payload.languages[0].code,i=o.defaultLanguage||a,u=Object.keys(n).some(function(e){return Array.isArray(n[e])}),c=u?n:(0,p.getSingleToMultilanguageTranslation)(i,t.languageCodes,n,e);return l({},e,c);case v:return r=t.payload.translationOptions&&void 0!==t.payload.translationOptions.translationTransform?t.payload.translationOptions.translationTransform(t.payload.translation||{},t.languageCodes):t.payload.translation,l({},e,(0,f.flatten)(r,{safe:!0}));case y:return n=(0,f.flatten)(t.payload.translation,{safe:!0}),l({},e,(0,p.getSingleToMultilanguageTranslation)(t.payload.language,t.languageCodes,n,e));default:return e}}function u(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:b,t=arguments[1];switch(t.type){case g:var n=t.payload.options||{};return l({},e,(0,p.validateOptions)(n));default:return e}}Object.defineProperty(t,"__esModule",{value:!0}),t.getTranslate=t.getTranslationsForSpecificLanguage=t.getTranslationsForActiveLanguage=t.translationsEqualSelector=t.getActiveLanguage=t.getOptions=t.getLanguages=t.getTranslations=t.setActiveLanguage=t.addTranslationForLanguage=t.addTranslation=t.initialize=t.localizeReducer=t.defaultTranslateOptions=t.TRANSLATE=t.SET_ACTIVE_LANGUAGE=t.ADD_TRANSLATION_FOR_LANGUAGE=t.ADD_TRANSLATION=t.INITIALIZE=void 0;var c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};t.languages=a,t.translations=i,t.options=u;var s=n(0),f=(function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);t.default=e}(s),n(4),n(8)),d=n(15),p=n(3),g=t.INITIALIZE="@@localize/INITIALIZE",v=t.ADD_TRANSLATION="@@localize/ADD_TRANSLATION",y=t.ADD_TRANSLATION_FOR_LANGUAGE="@@localize/ADD_TRANSLATION_FOR_LANGUAGE",h=t.SET_ACTIVE_LANGUAGE="@@localize/SET_ACTIVE_LANGUAGE",b=(t.TRANSLATE="@@localize/TRANSLATE",t.defaultTranslateOptions={renderToStaticMarkup:!1,renderInnerHtml:!1,ignoreTranslateChildren:!1,onMissingTranslation:function(e){e.translationId,e.languageCode;return"Missing translationId: ${ translationId } for language: ${ languageCode }"}}),O={languages:[],translations:{},options:b},m=(t.localizeReducer=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:O,t=arguments[1],n=e.languages.map(function(e){return e.code});return{languages:a(e.languages,t),translations:i(e.translations,l({},t,{languageCodes:n})),options:u(e.options,t)}},t.initialize=function(e){return{type:g,payload:e}},t.addTranslation=function(e,t){return{type:v,payload:{translation:e,translationOptions:t}}},t.addTranslationForLanguage=function(e,t){return{type:y,payload:{translation:e,language:t}}},t.setActiveLanguage=function(e){return{type:h,payload:{languageCode:e}}},t.getTranslations=function(e){return e.translations}),T=t.getLanguages=function(e){return e.languages},j=t.getOptions=function(e){return e.options},w=t.getActiveLanguage=function(e){return T(e).filter(function(e){return!0===e.active})[0]},_=t.translationsEqualSelector=(0,d.createSelectorCreator)(d.defaultMemoize,function(e,t){var n="object"===(void 0===e?"undefined":c(e))?Object.keys(e).toString():void 0,r="object"===(void 0===t?"undefined":c(t))?Object.keys(t).toString():void 0,o="object"===(void 0===e?"undefined":c(e))?(0,p.objectValuesToString)(e):void 0,a="object"===(void 0===t?"undefined":c(t))?(0,p.objectValuesToString)(t):void 0;return(void 0!==n&&void 0!==o?n+" - "+o:e)===(void 0!==r&&void 0!==a?r+" - "+a:t)}),S=t.getTranslationsForActiveLanguage=_(w,T,m,p.getTranslationsForLanguage),A=t.getTranslationsForSpecificLanguage=_(T,m,function(e,t){return(0,d.defaultMemoize)(function(n){return(0,p.getTranslationsForLanguage)({code:n,active:!1},e,t)})}),L=(0,d.createSelector)(S,A,w,j,function(e,t,n,a){return function(i){var u=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=(a.defaultLanguage,o(a,["defaultLanguage"])),f=c.language,d=void 0!==f?t(f):e,g=n&&n.code===a.defaultLanguage?e:void 0!==a.defaultLanguage?t(a.defaultLanguage):{},v=void 0!==f?f:n&&n.code,y=function(e){return h.onMissingTranslation({translationId:e,languageCode:v,defaultTranslation:g[e]})},h=l({},s,c),b=h.renderInnerHtml,O={translations:d,data:u,languageCode:v,renderInnerHtml:b,onMissingTranslation:y};if("string"==typeof i)return(0,p.getLocalizedElement)(l({translationId:i},O));if(Array.isArray(i))return i.reduce(function(e,t){return l({},e,r({},t,(0,p.getLocalizedElement)(l({translationId:t},O))))},{});throw new Error("react-localize-redux: Invalid key passed to getTranslate.")}});t.getTranslate=L},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.LocalizeContext=t.getContextPropsFromState=void 0;var o=n(0),a=(r(o),n(20)),i=r(a),u=n(15),c=n(1),l=function(e){return function(t){return e((0,c.initialize)(t))}},s=function(e){return function(t){return e((0,c.addTranslation)(t))}},f=function(e){return function(t,n){return e((0,c.addTranslationForLanguage)(t,n))}},d=function(e){return function(t){return e((0,c.setActiveLanguage)(t))}},p=t.getContextPropsFromState=function(e){return(0,u.createSelector)(c.getTranslate,c.getLanguages,c.getActiveLanguage,c.getOptions,function(t,n,r,o){var a=o.defaultLanguage||n[0]&&n[0].code,i=o.renderToStaticMarkup;return{translate:t,languages:n,defaultLanguage:a,activeLanguage:r,initialize:l(e),addTranslation:s(e),addTranslationForLanguage:f(e),setActiveLanguage:d(e),renderToStaticMarkup:i}})},g=(0,c.localizeReducer)(void 0,{}),v=p(function(){})(g);t.LocalizeContext=(0,i.default)(v)},function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Object.defineProperty(t,"__esModule",{value:!0}),t.warning=t.getSingleToMultilanguageTranslation=t.storeDidChange=t.getTranslationsForLanguage=t.validateOptions=t.objectValuesToString=t.getIndexForLanguageCode=t.templater=t.hasHtmlTags=t.getLocalizedElement=void 0;var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},a=n(0),i=function(e){return e&&e.__esModule?e:{default:e}}(a);n(4);var u=(n(8),n(1),t.getLocalizedElement=function(e){var t=e.translationId,n=e.translations,r=e.data,o=e.renderInnerHtml,a=e.onMissingTranslation,l=n[t]||a(t),s=n[t]?r:{translationId:e.translationId,languageCode:e.languageCode},f=c(l,s);return!0===o&&u(f)?i.default.createElement("span",{dangerouslySetInnerHTML:{__html:f}}):f},t.hasHtmlTags=function(e){var t=/(&[^\s]*;|<\/?\w+((\s+\w+(\s*=\s*(?:".*?"|'.*?'|[\^'">\s]+))?)+\s*|\s*)\/?>)/;return e.search(t)>=0}),c=t.templater=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};for(var n in t){var r="\\${\\s*"+n+"\\s*}",o=new RegExp(r,"gmi");e=e.replace(o,t[n])}return e},l=t.getIndexForLanguageCode=function(e,t){return t.map(function(e){return e.code}).indexOf(e)};t.objectValuesToString=function(e){return Object.values?Object.values(e).toString():Object.keys(e).map(function(t){return e[t].toString()}).toString()},t.validateOptions=function(e){if(void 0!==e.onMissingTranslation&&"function"!=typeof e.onMissingTranslation)throw new Error("react-localize-redux: an invalid onMissingTranslation function was provided.");if(!1!==e.renderToStaticMarkup&&"function"!=typeof e.renderToStaticMarkup)throw new Error("\n react-localize-redux: initialize option renderToStaticMarkup is invalid. \n Please see https://ryandrewjohnson.github.io/react-localize-docs/#initialize.\n ");return e},t.getTranslationsForLanguage=function(e,t,n){if(!e)return{};var a=e.code,i=l(a,t);return Object.keys(n).reduce(function(e,t){return o({},e,r({},t,n[t][i]))},{})},t.storeDidChange=function(e,t){function n(){var n=e.getState();n!==r&&(t(r),r=n)}var r=void 0,o=e.subscribe(n);return n(),o},t.getSingleToMultilanguageTranslation=function(e,t,n,a){var i=t.indexOf(e),u=i>=0?n:{};return Object.keys(u).reduce(function(e,u){var c=t.map(function(e,t){var r=a[u]||[];return t===i?n[u]:r[t]});return o({},e,r({},u,c))},{})},t.warning=function(e){"undefined"!=typeof console&&"function"==typeof console.error&&console.error(e);try{throw new Error(e)}catch(e){}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(13),o=n(37),a=n(36),i=n(35),u=n(12);n(14);n.d(t,"createStore",function(){return r.a}),n.d(t,"combineReducers",function(){return o.a}),n.d(t,"bindActionCreators",function(){return a.a}),n.d(t,"applyMiddleware",function(){return i.a}),n.d(t,"compose",function(){return u.a})},function(e,t){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";function r(e){return function(t){return i.default.createElement(u.LocalizeContext.Consumer,null,function(n){return i.default.createElement(e,o({},n,t))})}}Object.defineProperty(t,"__esModule",{value:!0});var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};t.withLocalize=r;var a=n(0),i=function(e){return e&&e.__esModule?e:{default:e}}(a),u=n(2)},function(e,t,n){"use strict";function r(e){return function(){return e}}var o=function(){};o.thatReturns=r,o.thatReturnsFalse=r(!1),o.thatReturnsTrue=r(!0),o.thatReturnsNull=r(null),o.thatReturnsThis=function(){return this},o.thatReturnsArgument=function(e){return e},e.exports=o},function(e,t,n){function r(e,t){function n(e,u,c){c=c||1,Object.keys(e).forEach(function(l){var s=e[l],f=t.safe&&Array.isArray(s),d=Object.prototype.toString.call(s),p=a(s),g="[object Object]"===d||"[object Array]"===d,v=u?u+r+l:l;if(!f&&!p&&g&&Object.keys(s).length&&(!t.maxDepth||c<o))return n(s,v,c+1);i[v]=s})}t=t||{};var r=t.delimiter||".",o=t.maxDepth,i={};return n(e),i}function o(e,t){function n(e){var t=Number(e);return isNaN(t)||-1!==e.indexOf(".")?e:t}t=t||{};var r=t.delimiter||".",i=t.overwrite||!1,u={};return a(e)||"[object Object]"!==Object.prototype.toString.call(e)?e:(Object.keys(e).forEach(function(a){for(var c=a.split(r),l=n(c.shift()),s=n(c[0]),f=u;void 0!==s;){var d=Object.prototype.toString.call(f[l]),p="[object Object]"===d||"[object Array]"===d;if(!i&&!p&&void 0!==f[l])return;(i&&!p||!i&&null==f[l])&&(f[l]="number"!=typeof s||t.object?{}:[]),f=f[l],c.length>0&&(l=n(c.shift()),s=n(c[0]))}f[l]=o(e[a],t)}),u)}var a=n(24);e.exports=r;r.flatten=r,r.unflatten=o},function(e,t,n){"use strict";var r=n(31),o=r.a.Symbol;t.a=o},function(e,t,n){"use strict";function r(e){if(!n.i(i.a)(e)||n.i(o.a)(e)!=u)return!1;var t=n.i(a.a)(e);if(null===t)return!0;var r=f.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&s.call(r)==d}var o=n(25),a=n(27),i=n(32),u="[object Object]",c=Function.prototype,l=Object.prototype,s=c.toString,f=l.hasOwnProperty,d=s.call(Object);t.a=r},function(e,t,n){e.exports=n(33)()},function(e,t,n){"use strict";function r(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return 0===t.length?function(e){return e}:1===t.length?t[0]:t.reduce(function(e,t){return function(){return e(t.apply(void 0,arguments))}})}t.a=r},function(e,t,n){"use strict";function r(e,t,u){function c(){b===h&&(b=h.slice())}function l(){return y}function s(e){if("function"!=typeof e)throw new Error("Expected listener to be a function.");var t=!0;return c(),b.push(e),function(){if(t){t=!1,c();var n=b.indexOf(e);b.splice(n,1)}}}function f(e){if(!n.i(o.a)(e))throw new Error("Actions must be plain objects. Use custom middleware for async actions.");if(void 0===e.type)throw new Error('Actions may not have an undefined "type" property. Have you misspelled a constant?');if(O)throw new Error("Reducers may not dispatch actions.");try{O=!0,y=v(y,e)}finally{O=!1}for(var t=h=b,r=0;r<t.length;r++){(0,t[r])()}return e}function d(e){if("function"!=typeof e)throw new Error("Expected the nextReducer to be a function.");v=e,f({type:i.INIT})}function p(){var e,t=s;return e={subscribe:function(e){function n(){e.next&&e.next(l())}if("object"!=typeof e)throw new TypeError("Expected the observer to be an object.");return n(),{unsubscribe:t(n)}}},e[a.a]=function(){return this},e}var g;if("function"==typeof t&&void 0===u&&(u=t,t=void 0),void 0!==u){if("function"!=typeof u)throw new Error("Expected the enhancer to be a function.");return u(r)(e,t)}if("function"!=typeof e)throw new Error("Expected the reducer to be a function.");var v=e,y=t,h=[],b=h,O=!1;return f({type:i.INIT}),g={dispatch:f,subscribe:s,getState:l,replaceReducer:d},g[a.a]=p,g}n.d(t,"b",function(){return i}),t.a=r;var o=n(10),a=n(38),i={INIT:"@@redux/INIT"}},function(e,t,n){"use strict"},function(e,t,n){"use strict";function r(e,t){return e===t}function o(e,t,n){if(null===t||null===n||t.length!==n.length)return!1;for(var r=t.length,o=0;o<r;o++)if(!e(t[o],n[o]))return!1;return!0}function a(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:r,n=null,a=null;return function(){return o(t,n,arguments)||(a=e.apply(null,arguments)),n=arguments,a}}function i(e){var t=Array.isArray(e[0])?e[0]:e;if(!t.every(function(e){return"function"==typeof e})){var n=t.map(function(e){return typeof e}).join(", ");throw new Error("Selector creators expect all input-selectors to be functions, instead received the following types: ["+n+"]")}return t}function u(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return function(){for(var t=arguments.length,r=Array(t),o=0;o<t;o++)r[o]=arguments[o];var u=0,c=r.pop(),l=i(r),s=e.apply(void 0,[function(){return u++,c.apply(null,arguments)}].concat(n)),f=a(function(){for(var e=[],t=l.length,n=0;n<t;n++)e.push(l[n].apply(null,arguments));return s.apply(null,e)});return f.resultFunc=c,f.recomputations=function(){return u},f.resetRecomputations=function(){return u=0},f}}function c(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l;if("object"!=typeof e)throw new Error("createStructuredSelector expects first argument to be an object where each property is a selector, instead received a "+typeof e);var n=Object.keys(e);return t(n.map(function(t){return e[t]}),function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return t.reduce(function(e,t,r){return e[n[r]]=t,e},{})})}t.__esModule=!0,t.defaultMemoize=a,t.createSelectorCreator=u,t.createStructuredSelector=c;var l=t.createSelector=u(a)},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0}),t.LocalizeProvider=void 0;var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(0),c=function(e){return e&&e.__esModule?e:{default:e}}(u);n(4);var l=n(1),s=n(2),f=n(3);t.LocalizeProvider=function(e){function t(e){r(this,t);var n=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e)),a=n.props.store?n.props.store.dispatch:n.dispatch.bind(n);return n.getContextPropsSelector=(0,s.getContextPropsFromState)(a),n.state={localize:(0,l.localizeReducer)(void 0,{})},n}return a(t,e),i(t,[{key:"componentDidMount",value:function(){this.props.store&&(this.unsubscribeFromStore=(0,f.storeDidChange)(this.props.store,this.onStateDidChange.bind(this)))}},{key:"componentWillUnmount",value:function(){this.unsubscribeFromStore&&this.unsubscribeFromStore()}},{key:"onStateDidChange",value:function(e){if(this.props.store){var t=e&&e.localize,n=this.props.store.getState().localize,r=e&&(0,l.getActiveLanguage)(t),o=(0,l.getActiveLanguage)(n),a=e&&(0,l.getOptions)(t),i=(0,l.getOptions)(n),u=e&&(0,l.getTranslationsForActiveLanguage)(t),c=(0,l.getTranslationsForActiveLanguage)(n),s=(r&&r.code)!==(o&&o.code),f=a!==i,d=u!==c;(s||f||d)&&this.setState({localize:n})}}},{key:"dispatch",value:function(e){this.setState(function(t){return{localize:(0,l.localizeReducer)(t.localize,e)}})}},{key:"render",value:function(){return this.contextProps=this.getContextPropsSelector(this.state.localize),c.default.createElement(s.LocalizeContext.Provider,{value:this.contextProps},this.props.children)}}],[{key:"getDerivedStateFromProps",value:function(e,t){return null}}]),t}(u.Component)},function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0}),t.Translate=void 0;var u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),c=n(0),l=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(c),s=n(11),f=(function(e){e&&e.__esModule}(s),n(1),n(3),n(2));n(6),t.Translate=function(e){function t(e){o(this,t);var n=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.state={hasAddedDefaultTranslation:!1,lastKnownId:""},n}return i(t,e),u(t,[{key:"componentDidMount",value:function(){this.setState({hasAddedDefaultTranslation:!0})}},{key:"addDefaultTranslation",value:function(e){if(!this.state.hasAddedDefaultTranslation){var t=this.props,n=t.id,o=t.children,a=t.options,i=void 0===a?{}:a,u=i.language||e.defaultLanguage,c=function(e){return e},l=e.renderToStaticMarkup||c;if(void 0!==o&&"function"!=typeof o&&!i.ignoreTranslateChildren&&void 0!==n&&void 0!==u){var s=l(o);e.addTranslationForLanguage&&e.addTranslationForLanguage(r({},n,s),u)}}}},{key:"renderChildren",value:function(e){var t=this.props,n=t.id,r=void 0===n?"":n,o=t.options,a=t.data;return this.addDefaultTranslation(e),"function"==typeof this.props.children?this.props.children(e):e.translate&&e.translate(r,a,o)}},{key:"render",value:function(){var e=this;return l.createElement(f.LocalizeContext.Consumer,null,function(t){return e.renderChildren(t)})}}],[{key:"getDerivedStateFromProps",value:function(e,t){return t.lastKnownId===e.id?{hasAddedDefaultTranslation:!0}:{lastKnownId:e.id,hasAddedDefaultTranslation:!1}}}]),t}(l.Component)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(17);Object.defineProperty(t,"Translate",{enumerable:!0,get:function(){return r.Translate}});var o=n(6);Object.defineProperty(t,"withLocalize",{enumerable:!0,get:function(){return o.withLocalize}});var a=n(16);Object.defineProperty(t,"LocalizeProvider",{enumerable:!0,get:function(){return a.LocalizeProvider}});var i=n(2);Object.defineProperty(t,"LocalizeContext",{enumerable:!0,get:function(){return i.LocalizeContext}});var u=n(1);Object.defineProperty(t,"localizeReducer",{enumerable:!0,get:function(){return u.localizeReducer}}),Object.defineProperty(t,"initialize",{enumerable:!0,get:function(){return u.initialize}}),Object.defineProperty(t,"addTranslation",{enumerable:!0,get:function(){return u.addTranslation}}),Object.defineProperty(t,"addTranslationForLanguage",{enumerable:!0,get:function(){return u.addTranslationForLanguage}}),Object.defineProperty(t,"setActiveLanguage",{enumerable:!0,get:function(){return u.setActiveLanguage}}),Object.defineProperty(t,"getTranslate",{enumerable:!0,get:function(){return u.getTranslate}}),Object.defineProperty(t,"getActiveLanguage",{enumerable:!0,get:function(){return u.getActiveLanguage}}),Object.defineProperty(t,"getLanguages",{enumerable:!0,get:function(){return u.getLanguages}}),Object.defineProperty(t,"getTranslations",{enumerable:!0,get:function(){return u.getTranslations}}),Object.defineProperty(t,"getOptions",{enumerable:!0,get:function(){return u.getOptions}})},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function u(e,t){return e===t?0!==e||1/e==1/t:e!==e&&t!==t}function c(e){var t=[];return{on:function(e){t.push(e)},off:function(e){t=t.filter(function(t){return t!==e})},get:function(){return e},set:function(n,r){e=n,t.forEach(function(t){return t(e,r)})}}}function l(e){return Array.isArray(e)?e[0]:e}function s(e,t){var n,r,s="__create-react-context-"+(0,v.default)()+"__",d=function(e){function n(){var t,r,i;o(this,n);for(var u=arguments.length,l=Array(u),s=0;s<u;s++)l[s]=arguments[s];return t=r=a(this,e.call.apply(e,[this].concat(l))),r.emitter=c(r.props.value),i=t,a(r,i)}return i(n,e),n.prototype.getChildContext=function(){var e;return e={},e[s]=this.emitter,e},n.prototype.componentWillReceiveProps=function(e){if(this.props.value!==e.value){var n=this.props.value,r=e.value,o=void 0;u(n,r)?o=0:(o="function"==typeof t?t(n,r):h,0!==(o|=0)&&this.emitter.set(e.value,o))}},n.prototype.render=function(){return this.props.children},n}(f.Component);d.childContextTypes=(n={},n[s]=p.default.object.isRequired,n);var g=function(t){function n(){var e,r,i;o(this,n);for(var u=arguments.length,c=Array(u),l=0;l<u;l++)c[l]=arguments[l];return e=r=a(this,t.call.apply(t,[this].concat(c))),r.state={value:r.getValue()},r.onUpdate=function(e,t){0!=((0|r.observedBits)&t)&&r.setState({value:r.getValue()})},i=e,a(r,i)}return i(n,t),n.prototype.componentWillReceiveProps=function(e){var t=e.observedBits;this.observedBits=void 0===t||null===t?h:t},n.prototype.componentDidMount=function(){this.context[s]&&this.context[s].on(this.onUpdate);var e=this.props.observedBits;this.observedBits=void 0===e||null===e?h:e},n.prototype.componentWillUnmount=function(){this.context[s]&&this.context[s].off(this.onUpdate)},n.prototype.getValue=function(){return this.context[s]?this.context[s].get():e},n.prototype.render=function(){return l(this.props.children)(this.state.value)},n}(f.Component);return g.contextTypes=(r={},r[s]=p.default.object,r),{Provider:d,Consumer:g}}t.__esModule=!0;var f=n(0),d=(r(f),n(11)),p=r(d),g=n(23),v=r(g),y=n(22),h=(r(y),1073741823);t.default=s,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var o=n(0),a=r(o),i=n(19),u=r(i);t.default=a.default.createContext||u.default,e.exports=t.default},function(e,t,n){"use strict";function r(e,t,n,r,a,i,u,c){if(o(t),!e){var l;if(void 0===t)l=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var s=[n,r,a,i,u,c],f=0;l=new Error(t.replace(/%s/g,function(){return s[f++]})),l.name="Invariant Violation"}throw l.framesToPop=1,l}}var o=function(e){};e.exports=r},function(e,t,n){"use strict";var r=n(7),o=r;e.exports=o},function(e,t,n){"use strict";(function(t){var n="__global_unique_id__";e.exports=function(){return t[n]=(t[n]||0)+1}}).call(t,n(5))},function(e,t){function n(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}function r(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&n(e.slice(0,0))}/*! | ||
* Determine if an object is a Buffer | ||
@@ -3,0 +3,0 @@ * |
@@ -75,4 +75,2 @@ var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); | ||
value: function dispatch(action) { | ||
console.log('action', action); | ||
this.setState(function (prevState) { | ||
@@ -79,0 +77,0 @@ return { |
@@ -90,4 +90,2 @@ 'use strict'; | ||
value: function dispatch(action) { | ||
console.log('action', action); | ||
this.setState(function (prevState) { | ||
@@ -94,0 +92,0 @@ return { |
{ | ||
"name": "react-localize-redux", | ||
"version": "3.0.1", | ||
"version": "3.0.2", | ||
"description": "Localization library for handling translations in React", | ||
@@ -5,0 +5,0 @@ "main": "./lib/index.js", |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
480166
4574