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

react-toastify

Package Overview
Dependencies
Maintainers
1
Versions
154
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-toastify - npm Package Compare versions

Comparing version 3.3.5 to 3.4.0

yarn-error.log

2

dist/ReactToastify.min.js

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

!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react"),require("prop-types"),require("glamor"),require("react-dom")):"function"==typeof define&&define.amd?define(["react","prop-types","glamor","react-dom"],e):"object"==typeof exports?exports.ReactToastify=e(require("react"),require("prop-types"),require("glamor"),require("react-dom")):t.ReactToastify=e(t.react,t["prop-types"],t.glamor,t["react-dom"])}(this,function(t,e,n,o){return function(t){function e(o){if(n[o])return n[o].exports;var r=n[o]={i:o,l:!1,exports:{}};return t[o].call(r.exports,r,r.exports,e),r.l=!0,r.exports}var n={};return e.m=t,e.c=n,e.d=function(t,n,o){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:o})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=7)}([function(e,n){e.exports=t},function(t,n){t.exports=e},function(t,e){t.exports=n},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.POSITION={TOP_LEFT:"top-left",TOP_RIGHT:"top-right",TOP_CENTER:"top-center",BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",BOTTOM_CENTER:"bottom-center"},e.TYPE={INFO:"info",SUCCESS:"success",WARNING:"warning",ERROR:"error",DEFAULT:"default"},e.ACTION={SHOW:"SHOW_TOAST",CLEAR:"CLEAR_TOAST",MOUNTED:"CONTAINER_MOUNTED"}},function(t,e,n){"use strict";function o(t){for(var e in t)r[e]=t[e]}Object.defineProperty(e,"__esModule",{value:!0}),e.defineStyle=o;var r={width:"320px",colorDefault:"#fff",colorInfo:"#3498db",colorSuccess:"#07bc0c",colorWarning:"#f1c40f",colorError:"#e74c3c",colorProgressDefault:"linear-gradient(to right, #4cd964, #5ac8fa, #007aff, #34aadc, #5856d6, #ff2d55)",mobile:"only screen and (max-width : 480px)",fontFamily:"sans-serif",zIndex:9999,TOP_LEFT:{top:"1em",left:"1em"},TOP_CENTER:{top:"1em",left:"50%"},TOP_RIGHT:{top:"1em",right:"1em"},BOTTOM_LEFT:{bottom:"1em",left:"1em"},BOTTOM_CENTER:{bottom:"1em",left:"50%"},BOTTOM_RIGHT:{bottom:"1em",right:"1em"}};e.default=r},function(t,e,n){"use strict";function o(t){return"number"==typeof t&&!isNaN(t)&&t>0}function r(t){return Object.keys(t).map(function(e){return t[e]})}function i(t){return t.isRequired=function(e,n,o){if(void 0===e[n])return new Error("The prop "+n+" is marked as required in \n "+o+", but its value is undefined.");t(e,n,o)},t}Object.defineProperty(e,"__esModule",{value:!0}),e.falseOrElement=e.falseOrDelay=void 0,e.isValidDelay=o,e.objectValues=r;var a=n(0);e.falseOrDelay=i(function(t,e,n){var r=t[e];return!1===r||o(r)?null:new Error(n+" expect "+e+" \n to be a valid Number > 0 or equal to false. "+r+" given.")}),e.falseOrElement=i(function(t,e,n){var o=t[e];return!1===o||(0,a.isValidElement)(o)?null:new Error(n+" expect "+e+" \n to be a valid react element or equal to false. "+o+" given.")})},function(t,e,n){"use strict";function o(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e<t.length;e++)n[e]=t[e];return n}return Array.from(t)}Object.defineProperty(e,"__esModule",{value:!0});var r={eventList:new Map,on:function(t,e){return this.eventList.has(t)||this.eventList.set(t,[]),this.eventList.get(t).push(e),this},off:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return this.eventList.delete(t)},emit:function(t){for(var e=this,n=arguments.length,r=Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return this.eventList.has(t)?(this.eventList.get(t).forEach(function(t){return setTimeout(function(){return t.call.apply(t,[e].concat(o(r)))},0)}),!0):(console.warn("<"+t+"> Event is not registered. Did you forgot to bind the event ?"),!1)}};e.default=r},function(t,e,n){"use strict";function o(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0}),e.style=e.toast=e.ToastContainer=void 0;var r=n(8),i=o(r),a=n(19),s=o(a),u=n(4);e.ToastContainer=i.default,e.toast=s.default,e.style=u.defineStyle},function(t,e,n){"use strict";function o(t){return t&&t.__esModule?t:{default:t}}function r(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e<t.length;e++)n[e]=t[e];return n}return Array.from(t)}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(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}function s(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)}function u(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}Object.defineProperty(e,"__esModule",{value:!0});var l="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},c=function(){function t(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,n,o){return n&&t(e.prototype,n),o&&t(e,o),e}}(),f=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},p=n(0),d=o(p),h=n(1),m=o(h),y=n(2),b=n(9),O=o(b),v=n(11),g=o(v),T=n(13),E=o(T),x=n(14),C=o(x),N=n(3),P=n(4),_=o(P),S=n(6),I=o(S),j=n(5),w=function(t){var e=t.toUpperCase().replace("-","_"),n=void 0!==N.POSITION[e]?_.default[e]:_.default.TOP_RIGHT;return-1!==e.indexOf("CENTER")&&void 0===n.marginLeft&&(n.marginLeft="-"+parseInt(_.default.width,10)/2+"px"),n},R=function(t,e){return(0,y.css)(f({zIndex:_.default.zIndex,position:"fixed",padding:"4px",width:_.default.width,boxSizing:"border-box",color:"#fff"},t?{pointerEvents:"none"}:{},u({},"@media "+_.default.mobile,f({width:"100vw",padding:0,left:0,margin:0,position:"fixed"},"top"===e.substring(0,3)?{top:0}:{bottom:0}))),w(e))},k=function(t){function e(){var t,n,o,r;i(this,e);for(var s=arguments.length,u=Array(s),l=0;l<s;l++)u[l]=arguments[l];return n=o=a(this,(t=e.__proto__||Object.getPrototypeOf(e)).call.apply(t,[this].concat(u))),o.state={toast:[],isDocumentHidden:!1},o.collection={},o.isDocumentHidden=function(){return o.setState({isDocumentHidden:document.hidden})},o.isToastActive=function(t){return-1!==o.state.toast.indexOf(parseInt(t,10))},r=n,a(o,r)}return s(e,t),c(e,[{key:"componentDidMount",value:function(){var t=this,e=N.ACTION.SHOW,n=N.ACTION.CLEAR,o=N.ACTION.MOUNTED;I.default.on(e,function(e,n){return t.show(e,n)}).on(n,function(e){return null!==e?t.removeToast(e):t.clear()}).emit(o,this),document.addEventListener("visibilitychange",this.isDocumentHidden)}},{key:"componentWillUnmount",value:function(){I.default.off(N.ACTION.SHOW),I.default.off(N.ACTION.CLEAR),document.removeEventListener("visibilitychange",this.isDocumentHidden)}},{key:"removeToast",value:function(t){this.setState({toast:this.state.toast.filter(function(e){return e!==parseInt(t,10)})})}},{key:"makeCloseButton",value:function(t,e,n){var o=this,r=this.props.closeButton;return((0,p.isValidElement)(t)||!1===t)&&(r=t),!1!==r&&(0,p.cloneElement)(r,{closeToast:function(){return o.removeToast(e)},type:n})}},{key:"getAutoCloseDelay",value:function(t){return!1===t||(0,j.isValidDelay)(t)?t:this.props.autoClose}},{key:"isFunction",value:function(t){return!!(t&&t.constructor&&t.call&&t.apply)}},{key:"canBeRendered",value:function(t){return(0,p.isValidElement)(t)||"string"==typeof t||"number"==typeof t||this.isFunction(t)}},{key:"show",value:function(t,e){var n=this;if(!this.canBeRendered(t))throw new Error("The element you provided cannot be rendered. You provided an element of type "+(void 0===t?"undefined":l(t)));var o=e.toastId,i=function(){return n.removeToast(o)},a={id:o,type:e.type,closeToast:i,updateId:e.updateId,position:e.position||this.props.position,transition:e.transition||this.props.transition,className:e.className||this.props.toastClassName,bodyClassName:e.bodyClassName||this.props.bodyClassName,closeButton:this.makeCloseButton(e.closeButton,o,e.type),pauseOnHover:null!==e.pauseOnHover?e.pauseOnHover:this.props.pauseOnHover,closeOnClick:null!==e.closeOnClick?e.closeOnClick:this.props.closeOnClick,progressClassName:e.progressClassName||this.props.progressClassName,autoClose:this.getAutoCloseDelay(!1!==e.autoClose?parseInt(e.autoClose,10):e.autoClose),hideProgressBar:"boolean"==typeof e.hideProgressBar?e.hideProgressBar:this.props.hideProgressBar};this.isFunction(e.onOpen)&&(a.onOpen=e.onOpen),this.isFunction(e.onClose)&&(a.onClose=e.onClose),(0,p.isValidElement)(t)&&"string"!=typeof t.type&&"number"!=typeof t.type?t=(0,p.cloneElement)(t,{closeToast:i}):this.isFunction(t)&&(t=t({closeToast:i})),this.collection=f({},this.collection,u({},o,{position:a.position,options:a,content:t})),this.setState({toast:null!==a.updateId?[].concat(r(this.state.toast)):[].concat(r(this.state.toast),[o])})}},{key:"makeToast",value:function(t,e){return d.default.createElement(g.default,f({},e,{isDocumentHidden:this.state.isDocumentHidden,key:"toast-"+e.id}),t)}},{key:"clear",value:function(){this.setState({toast:[]})}},{key:"renderToast",value:function(){var t=this,e={},n=this.props,o=n.className,r=n.style;return(n.newestOnTop?Object.keys(this.collection).reverse():Object.keys(this.collection)).forEach(function(n){var o=t.collection[n];e[o.position]||(e[o.position]=[]),-1!==t.state.toast.indexOf(parseInt(n,10))?e[o.position].push(t.makeToast(o.content,o.options)):(e[o.position].push(null),delete t.collection[n])}),Object.keys(e).map(function(t){var n=1===e[t].length&&null===e[t][0];return d.default.createElement(O.default,f({},"string"!=typeof o?(0,y.css)(R(n,t),o):R(n,t),"string"==typeof o&&{className:o},null!==r&&{style:r},{key:"container-"+t}),e[t])})}},{key:"render",value:function(){return d.default.createElement("div",null,this.renderToast())}}]),e}(p.Component);k.propTypes={position:m.default.oneOf((0,j.objectValues)(N.POSITION)),autoClose:j.falseOrDelay,closeButton:j.falseOrElement,hideProgressBar:m.default.bool,pauseOnHover:m.default.bool,closeOnClick:m.default.bool,newestOnTop:m.default.bool,className:m.default.oneOfType([m.default.string,m.default.object]),style:m.default.object,toastClassName:m.default.oneOfType([m.default.string,m.default.object]),bodyClassName:m.default.oneOfType([m.default.string,m.default.object]),progressClassName:m.default.oneOfType([m.default.string,m.default.object]),transition:m.default.func},k.defaultProps={position:N.POSITION.TOP_RIGHT,transition:C.default,autoClose:5e3,hideProgressBar:!1,closeButton:d.default.createElement(E.default,null),pauseOnHover:!0,closeOnClick:!0,newestOnTop:!1,className:null,style:null,toastClassName:"",bodyClassName:"",progressClassName:""},e.default=k},function(t,e,n){"use strict";function o(t){return t&&t.__esModule?t:{default:t}}function r(t,e){var n={};for(var o in t)e.indexOf(o)>=0||Object.prototype.hasOwnProperty.call(t,o)&&(n[o]=t[o]);return n}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(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}function s(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)}e.__esModule=!0;var u=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},l=n(1),c=o(l),f=n(0),p=o(f),d=n(10),h=Object.values||function(t){return Object.keys(t).map(function(e){return t[e]})},m=(c.default.any,c.default.node,c.default.bool,c.default.bool,c.default.bool,c.default.func,{component:"div",childFactory:function(t){return t}}),y=function(t){function e(n,o){i(this,e);var r=a(this,t.call(this,n,o));return r.handleExited=function(t,e,n){var o=(0,d.getChildMapping)(r.props.children);t in o||(n&&n(e),r.setState(function(e){var n=u({},e.children);return delete n[t],{children:n}}))},r.state={children:(0,d.getChildMapping)(n.children,function(t){var e=function(e){r.handleExited(t.key,e,t.props.onExited)};return(0,f.cloneElement)(t,{onExited:e,in:!0,appear:r.getProp(t,"appear"),enter:r.getProp(t,"enter"),exit:r.getProp(t,"exit")})})},r}return s(e,t),e.prototype.getChildContext=function(){return{transitionGroup:{isMounting:!this.appeared}}},e.prototype.getProp=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.props;return null!=n[e]?n[e]:t.props[e]},e.prototype.componentDidMount=function(){this.appeared=!0},e.prototype.componentWillReceiveProps=function(t){var e=this,n=this.state.children,o=(0,d.getChildMapping)(t.children),r=(0,d.mergeChildMappings)(n,o);Object.keys(r).forEach(function(i){var a=r[i];if((0,f.isValidElement)(a)){var s=function(t){e.handleExited(a.key,t,a.props.onExited)},u=i in n,l=i in o,c=n[i],p=(0,f.isValidElement)(c)&&!c.props.in;!l||u&&!p?l||!u||p?l&&u&&(0,f.isValidElement)(c)&&(r[i]=(0,f.cloneElement)(a,{onExited:s,in:c.props.in,exit:e.getProp(a,"exit",t),enter:e.getProp(a,"enter",t)})):r[i]=(0,f.cloneElement)(a,{in:!1}):r[i]=(0,f.cloneElement)(a,{onExited:s,in:!0,exit:e.getProp(a,"exit",t),enter:e.getProp(a,"enter",t)})}}),this.setState({children:r})},e.prototype.render=function(){var t=this.props,e=t.component,n=t.childFactory,o=r(t,["component","childFactory"]),i=this.state.children;return delete o.appear,delete o.enter,delete o.exit,p.default.createElement(e,o,h(i).map(n))},e}(p.default.Component);y.childContextTypes={transitionGroup:c.default.object.isRequired},y.propTypes={},y.defaultProps=m,e.default=y,t.exports=e.default},function(t,e,n){"use strict";function o(t,e){var n=function(t){return e&&(0,i.isValidElement)(t)?e(t):t},o=Object.create(null);return t&&i.Children.map(t,function(t){return t}).forEach(function(t){o[t.key]=n(t)}),o}function r(t,e){function n(n){return n in e?e[n]:t[n]}t=t||{},e=e||{};var o=Object.create(null),r=[];for(var i in t)i in e?r.length&&(o[i]=r,r=[]):r.push(i);var a=void 0,s={};for(var u in e){if(o[u])for(a=0;a<o[u].length;a++){var l=o[u][a];s[o[u][a]]=n(l)}s[u]=n(u)}for(a=0;a<r.length;a++)s[r[a]]=n(r[a]);return s}e.__esModule=!0,e.getChildMapping=o,e.mergeChildMappings=r;var i=n(0)},function(t,e,n){"use strict";function o(t){return t&&t.__esModule?t:{default:t}}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(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}function a(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)}function s(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}Object.defineProperty(e,"__esModule",{value:!0});var u=function(){function t(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,n,o){return n&&t(e.prototype,n),o&&t(e,o),e}}(),l=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},c=n(0),f=o(c),p=n(1),d=o(p),h=n(2),m=n(12),y=o(m),b=n(3),O=n(4),v=o(O),g=n(5),T={container:function(t){return(0,h.css)(l({position:"relative",minHeight:"48px",marginBottom:"1rem",padding:"8px",borderRadius:"1px",boxShadow:"0 1px 10px 0 rgba(0, 0, 0, .1), 0 2px 15px 0 rgba(0, 0, 0, .05)",display:"flex",justifyContent:"space-between",maxHeight:"800px",overflow:"hidden",fontFamily:v.default.fontFamily,cursor:"pointer",background:v.default["color"+t.charAt(0).toUpperCase()+t.slice(1)]},"default"===t?{color:"#aaa"}:{},s({},"@media "+v.default.mobile,{marginBottom:0})))},body:(0,h.css)({margin:"auto 0",flex:1})},E=function(t){function e(){var t,n,o,a;r(this,e);for(var s=arguments.length,u=Array(s),l=0;l<s;l++)u[l]=arguments[l];return n=o=i(this,(t=e.__proto__||Object.getPrototypeOf(e)).call.apply(t,[this].concat(u))),o.state={isRunning:!0},o.pauseToast=function(){o.setState({isRunning:!1})},o.playToast=function(){o.setState({isRunning:!0})},a=n,i(o,a)}return a(e,t),u(e,[{key:"componentDidMount",value:function(){null!==this.props.onOpen&&this.props.onOpen(this.getChildrenProps())}},{key:"componentWillReceiveProps",value:function(t){this.props.isDocumentHidden!==t.isDocumentHidden&&this.setState({isRunning:!t.isDocumentHidden})}},{key:"componentWillUnmount",value:function(){null!==this.props.onClose&&this.props.onClose(this.getChildrenProps())}},{key:"getChildrenProps",value:function(){return this.props.children.props}},{key:"getToastProps",value:function(){var t={};return!1!==this.props.autoClose&&!0===this.props.pauseOnHover&&(t.onMouseEnter=this.pauseToast,t.onMouseLeave=this.playToast),"string"==typeof this.props.className&&(t.className=this.props.className),this.props.closeOnClick&&(t.onClick=this.props.closeToast),t}},{key:"render",value:function(){var t=this.props,e=t.closeButton,n=t.children,o=t.autoClose,r=t.type,i=t.hideProgressBar,a=t.closeToast,s=t.transition,u=t.position,c=t.onExited,p=t.className,d=t.bodyClassName,m=t.progressClassName,b=t.updateId,O=t.role;return f.default.createElement(s,{in:this.props.in,appear:!0,unmountOnExit:!0,onExited:c,position:u},f.default.createElement("div",l({},"string"!=typeof p?(0,h.css)(T.container(r),p):T.container(r),this.getToastProps()),f.default.createElement("div",l({},this.props.in&&{role:O},"string"!=typeof d?(0,h.css)(T.body,d):T.body,"string"==typeof d&&{className:d}),n),!1!==e&&e,!1!==o&&f.default.createElement(y.default,{key:"pb-"+b,delay:o,isRunning:this.state.isRunning,closeToast:a,hide:i,type:r,className:m})))}}]),e}(c.Component);E.propTypes={closeButton:g.falseOrElement.isRequired,autoClose:g.falseOrDelay.isRequired,children:d.default.node.isRequired,closeToast:d.default.func.isRequired,position:d.default.oneOf((0,g.objectValues)(b.POSITION)).isRequired,pauseOnHover:d.default.bool.isRequired,closeOnClick:d.default.bool.isRequired,transition:d.default.func.isRequired,isDocumentHidden:d.default.bool.isRequired,in:d.default.bool,onExited:d.default.func,hideProgressBar:d.default.bool,onOpen:d.default.func,onClose:d.default.func,type:d.default.oneOf((0,g.objectValues)(b.TYPE)),className:d.default.oneOfType([d.default.string,d.default.object]),bodyClassName:d.default.oneOfType([d.default.string,d.default.object]),progressClassName:d.default.oneOfType([d.default.string,d.default.object]),updateId:d.default.number,ariaLabel:d.default.string},E.defaultProps={type:b.TYPE.DEFAULT,in:!0,hideProgressBar:!1,onOpen:null,onClose:null,className:"",bodyClassName:"",progressClassName:"",updateId:null,role:"alert"},e.default=E},function(t,e,n){"use strict";function o(t){return t&&t.__esModule?t:{default:t}}function r(t){var e=t.delay,n=t.isRunning,o=t.closeToast,r=t.type,a=t.hide,u=t.className;return s.default.createElement("div",i({},"string"!=typeof u?(0,c.css)(m(r,n,a,e),u):m(r,n,a,e),"string"==typeof u&&{className:u},{onAnimationEnd:o}))}Object.defineProperty(e,"__esModule",{value:!0});var i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},a=n(0),s=o(a),u=n(1),l=o(u),c=n(2),f=n(3),p=n(4),d=o(p),h=c.css.keyframes({"0%":{width:"100%"},"100%":{width:0}}),m=function(t,e,n,o){return(0,c.css)(i({position:"absolute",bottom:0,left:0,width:0,height:"5px",zIndex:d.default.zIndex,opacity:n?0:.7,animation:h+" linear 1",animationPlayState:e?"running":"paused",animationDuration:o+"ms",backgroundColor:"rgba(255,255,255,.7)"},"default"===t?{background:d.default.colorProgressDefault}:{}))};r.propTypes={delay:l.default.number.isRequired,isRunning:l.default.bool.isRequired,closeToast:l.default.func.isRequired,type:l.default.string,hide:l.default.bool,className:l.default.oneOfType([l.default.string,l.default.object])},r.defaultProps={type:f.TYPE.DEFAULT,hide:!1,className:""},e.default=r},function(t,e,n){"use strict";function o(t){return t&&t.__esModule?t:{default:t}}function r(t){var e=t.closeToast,n=t.type,o=t.ariaLabel;return s.default.createElement("button",i({},f("default"===n),{type:"button",onClick:e,"aria-label":o}),"✖")}Object.defineProperty(e,"__esModule",{value:!0});var i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},a=n(0),s=o(a),u=n(1),l=o(u),c=n(2),f=function(t){return(0,c.css)({color:t?"#000":"#fff",fontWeight:"bold",fontSize:"14px",background:"transparent",outline:"none",border:"none",padding:0,cursor:"pointer",opacity:t?"0.3":"0.7",transition:".3s ease",alignSelf:"flex-start",":hover, :focus":{opacity:1}})};r.propTypes={closeToast:l.default.func,arialLabel:l.default.string},r.defaultProps={ariaLabel:"close"},e.default=r},function(t,e,n){"use strict";function o(t){return t&&t.__esModule?t:{default:t}}function r(t,e){var n={};for(var o in t)e.indexOf(o)>=0||Object.prototype.hasOwnProperty.call(t,o)&&(n[o]=t[o]);return n}function i(t){var e=t.children,n=t.position,o=r(t,["children","position"]),i=m(n),s=i.enter,l=i.exit,f=function(t){return t.classList.add(s)},p=function(t){return t.classList.remove(s)},d=function(t){var e=t.getBoundingClientRect().height;t.style.transition="padding 0.75s, height 0.75s, maringBottom 0.75s",t.style.minHeight=0,t.style.height=e>=48?e+"px":"48px",requestAnimationFrame(function(){t.style.padding=0,t.style.height=0,t.style.marginBottom=0,requestAnimationFrame(function(){return t.classList.add(l)})})};return u.default.createElement(c.default,a({},o,{timeout:750,onEnter:f,onEntered:p,onExit:d}),e)}Object.defineProperty(e,"__esModule",{value:!0});var a=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},s=n(0),u=o(s),l=n(15),c=o(l),f=n(2),p=n(18),d=o(p),h={animationDuration:"0.75s",animationFillMode:"both"},m=function(t){var e=(0,d.default)(t),n=e.enter,o=e.exit,r=f.css.keyframes(a({"from, 60%, 75%, 90%, to":{animationTimingFunction:"cubic-bezier(0.215, 0.610, 0.355, 1.000)"}},n)),i=f.css.keyframes(o);return{enter:(0,f.css)(a({},h,{animationName:r})),exit:(0,f.css)(a({},h,{animationName:i}))}};e.default=i},function(t,e,n){"use strict";function o(t){return t&&t.__esModule?t:{default:t}}function r(t,e){var n={};for(var o in t)e.indexOf(o)>=0||Object.prototype.hasOwnProperty.call(t,o)&&(n[o]=t[o]);return n}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(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}function s(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)}function u(){}e.__esModule=!0,e.EXITING=e.ENTERED=e.ENTERING=e.EXITED=e.UNMOUNTED=void 0;var l=n(1),c=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(l),f=n(0),p=o(f),d=n(16),h=o(d),m=(n(17),e.UNMOUNTED="unmounted"),y=e.EXITED="exited",b=e.ENTERING="entering",O=e.ENTERED="entered",v=e.EXITING="exiting",g=function(t){function e(n,o){i(this,e);var r=a(this,t.call(this,n,o)),s=o.transitionGroup,u=s&&!s.isMounting?n.enter:n.appear,l=void 0;return r.nextStatus=null,n.in?u?(l=y,r.nextStatus=b):l=O:l=n.unmountOnExit||n.mountOnEnter?m:y,r.state={status:l},r.nextCallback=null,r}return s(e,t),e.prototype.getChildContext=function(){return{transitionGroup:null}},e.prototype.componentDidMount=function(){this.updateStatus(!0)},e.prototype.componentWillReceiveProps=function(t){var e=this.pendingState||this.state,n=e.status;t.in?(n===m&&this.setState({status:y}),n!==b&&n!==O&&(this.nextStatus=b)):n!==b&&n!==O||(this.nextStatus=v)},e.prototype.componentDidUpdate=function(){this.updateStatus()},e.prototype.componentWillUnmount=function(){this.cancelNextCallback()},e.prototype.getTimeouts=function(){var t=this.props.timeout,e=void 0,n=void 0,o=void 0;return e=n=o=t,null!=t&&"number"!=typeof t&&(e=t.exit,n=t.enter,o=t.appear),{exit:e,enter:n,appear:o}},e.prototype.updateStatus=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=this.nextStatus;if(null!==e){this.nextStatus=null,this.cancelNextCallback();var n=h.default.findDOMNode(this);e===b?this.performEnter(n,t):this.performExit(n)}else this.props.unmountOnExit&&this.state.status===y&&this.setState({status:m})},e.prototype.performEnter=function(t,e){var n=this,o=this.props.enter,r=this.context.transitionGroup?this.context.transitionGroup.isMounting:e,i=this.getTimeouts();if(!e&&!o)return void this.safeSetState({status:O},function(){n.props.onEntered(t)});this.props.onEnter(t,r),this.safeSetState({status:b},function(){n.props.onEntering(t,r),n.onTransitionEnd(t,i.enter,function(){n.safeSetState({status:O},function(){n.props.onEntered(t,r)})})})},e.prototype.performExit=function(t){var e=this,n=this.props.exit,o=this.getTimeouts();if(!n)return void this.safeSetState({status:y},function(){e.props.onExited(t)});this.props.onExit(t),this.safeSetState({status:v},function(){e.props.onExiting(t),e.onTransitionEnd(t,o.exit,function(){e.safeSetState({status:y},function(){e.props.onExited(t)})})})},e.prototype.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},e.prototype.safeSetState=function(t,e){var n=this;this.pendingState=t,e=this.setNextCallback(e),this.setState(t,function(){n.pendingState=null,e()})},e.prototype.setNextCallback=function(t){var e=this,n=!0;return this.nextCallback=function(o){n&&(n=!1,e.nextCallback=null,t(o))},this.nextCallback.cancel=function(){n=!1},this.nextCallback},e.prototype.onTransitionEnd=function(t,e,n){this.setNextCallback(n),t?(this.props.addEndListener&&this.props.addEndListener(t,this.nextCallback),null!=e&&setTimeout(this.nextCallback,e)):setTimeout(this.nextCallback,0)},e.prototype.render=function(){var t=this.state.status;if(t===m)return null;var e=this.props,n=e.children,o=r(e,["children"]);if(delete o.in,delete o.mountOnEnter,delete o.unmountOnExit,delete o.appear,delete o.enter,delete o.exit,delete o.timeout,delete o.addEndListener,delete o.onEnter,delete o.onEntering,delete o.onEntered,delete o.onExit,delete o.onExiting,delete o.onExited,"function"==typeof n)return n(t,o);var i=p.default.Children.only(n);return p.default.cloneElement(i,o)},e}(p.default.Component);g.contextTypes={transitionGroup:c.object},g.childContextTypes={transitionGroup:function(){}},g.propTypes={},g.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:u,onEntering:u,onEntered:u,onExit:u,onExiting:u,onExited:u},g.UNMOUNTED=0,g.EXITED=1,g.ENTERING=2,g.ENTERED=3,g.EXITING=4,e.default=g},function(t,e){t.exports=o},function(t,e,n){"use strict";function o(t){var e="transition"+t+"Timeout",n="transition"+t;return function(t){if(t[n]){if(null==t[e])return new Error(e+" wasn't supplied to CSSTransitionGroup: this can cause unreliable animations and won't be supported in a future version of React. See https://fb.me/react-animation-transition-group-timeout for more information.");if("number"!=typeof t[e])return new Error(e+" must be a number (in milliseconds)")}return null}}e.__esModule=!0,e.classNamesShape=e.timeoutsShape=void 0,e.transitionTimeout=o;var r=n(1),i=function(t){return t&&t.__esModule?t:{default:t}}(r);e.timeoutsShape=i.default.oneOfType([i.default.number,i.default.shape({enter:i.default.number,exit:i.default.number}).isRequired]),e.classNamesShape=i.default.oneOfType([i.default.string,i.default.shape({enter:i.default.string,exit:i.default.string,active:i.default.string}),i.default.shape({enter:i.default.string,enterActive:i.default.string,exit:i.default.string,exitActive:i.default.string})])},function(t,e,n){"use strict";function o(t){switch(t){case r.POSITION.TOP_RIGHT:case r.POSITION.BOTTOM_RIGHT:default:return{enter:{from:{opacity:0,transform:"translate3d(3000px, 0, 0)"},"60%":{opacity:1,transform:"translate3d(-25px, 0, 0)"},"75%":{transform:"translate3d(10px, 0, 0)"},"90%":{transform:"translate3d(-5px, 0, 0)"},to:{transform:"none"}},exit:{"20%":{opacity:1,transform:"translate3d(-20px, 0, 0)"},to:{opacity:0,transform:"translate3d(2000px, 0, 0)"}}};case r.POSITION.TOP_LEFT:case r.POSITION.BOTTOM_LEFT:return{enter:{"0%":{opacity:0,transform:"translate3d(-3000px, 0, 0)"},"60%":{opacity:1,transform:"translate3d(25px, 0, 0)"},"75%":{transform:"translate3d(-10px, 0, 0)"},"90%":{transform:"translate3d(5px, 0, 0)"},to:{transform:"none"}},exit:{"20%":{opacity:1,transform:"translate3d(20px, 0, 0)"},to:{opacity:0,transform:"translate3d(-2000px, 0, 0)"}}};case r.POSITION.BOTTOM_CENTER:return{enter:{from:{opacity:0,transform:"translate3d(0, 3000px, 0)"},"60%":{opacity:1,transform:"translate3d(0, -20px, 0)"},"75%":{transform:"translate3d(0, 10px, 0)"},"90%":{transform:"translate3d(0, -5px, 0)"},to:{transform:"translate3d(0, 0, 0)"}},exit:{"20%":{transform:"translate3d(0, 10px, 0)"},"40%, 45%":{opacity:1,transform:"translate3d(0, -20px, 0)"},to:{opacity:0,transform:"translate3d(0, 2000px, 0)"}}};case r.POSITION.TOP_CENTER:return{enter:{"0%":{opacity:0,transform:"translate3d(0, -3000px, 0)"},"60%":{opacity:1,transform:"translate3d(0, 25px, 0)"},"75%":{transform:"translate3d(0, -10px, 0)"},"90%":{transform:"translate3d(0, 5px, 0)"},to:{transform:"none"}},exit:{"20%":{transform:"translate3d(0, -10px, 0)"},"40%, 45%":{opacity:1,transform:"translate3d(0, 20px, 0)"},to:{opacity:0,transform:"translate3d(0, -2000px, 0)"}}}}}Object.defineProperty(e,"__esModule",{value:!0}),e.default=o;var r=n(3)},function(t,e,n){"use strict";function o(t,e){return i({},l,t,{type:e,toastId:++p})}function r(t,e){return null!==c?s.default.emit(u.ACTION.SHOW,t,e):f.push({action:u.ACTION.SHOW,content:t,options:e}),e.toastId}Object.defineProperty(e,"__esModule",{value:!0});var i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},a=n(6),s=function(t){return t&&t.__esModule?t:{default:t}}(a),u=n(3),l={type:u.TYPE.DEFAULT,autoClose:null,closeButton:null,hideProgressBar:null,position:null,pauseOnHover:null,closeOnClick:null,className:null,bodyClassName:null,progressClassName:null,transition:null,updateId:null},c=null,f=[],p=0,d=i(function(t,e){return r(t,o(e,e&&e.type||u.TYPE.DEFAULT))},{success:function(t,e){return r(t,o(e,u.TYPE.SUCCESS))},info:function(t,e){return r(t,o(e,u.TYPE.INFO))},warn:function(t,e){return r(t,o(e,u.TYPE.WARNING))},warning:function(t,e){return r(t,o(e,u.TYPE.WARNING))},error:function(t,e){return r(t,o(e,u.TYPE.ERROR))},dismiss:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return c&&s.default.emit(u.ACTION.CLEAR,t)},isActive:function(){return!1},update:function(t,e){setTimeout(function(){if(c&&void 0!==c.collection[t]){var n=c.collection[t],o=n.options,a=n.content,s=null!==o.updateId?o.updateId+1:1,u=i({},o,e,{toastId:t,updateId:s}),l=void 0!==u.render?u.render:a;delete u.render,r(l,u)}},0)}},{POSITION:u.POSITION,TYPE:u.TYPE});s.default.on(u.ACTION.MOUNTED,function(t){c=t,d.isActive=function(t){return c.isToastActive(t)},f.forEach(function(t){s.default.emit(t.action,t.content,t.options)}),f=[]}),e.default=d}])});
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react"),require("prop-types"),require("glamor"),require("react-dom")):"function"==typeof define&&define.amd?define(["react","prop-types","glamor","react-dom"],e):"object"==typeof exports?exports.ReactToastify=e(require("react"),require("prop-types"),require("glamor"),require("react-dom")):t.ReactToastify=e(t.react,t["prop-types"],t.glamor,t["react-dom"])}(this,function(t,e,n,o){return function(t){function e(o){if(n[o])return n[o].exports;var r=n[o]={i:o,l:!1,exports:{}};return t[o].call(r.exports,r,r.exports,e),r.l=!0,r.exports}var n={};return e.m=t,e.c=n,e.d=function(t,n,o){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:o})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=7)}([function(e,n){e.exports=t},function(t,n){t.exports=e},function(t,e){t.exports=n},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.POSITION={TOP_LEFT:"top-left",TOP_RIGHT:"top-right",TOP_CENTER:"top-center",BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",BOTTOM_CENTER:"bottom-center"},e.TYPE={INFO:"info",SUCCESS:"success",WARNING:"warning",ERROR:"error",DEFAULT:"default"},e.ACTION={SHOW:"SHOW_TOAST",CLEAR:"CLEAR_TOAST",MOUNTED:"CONTAINER_MOUNTED"}},function(t,e,n){"use strict";function o(t){for(var e in t)r[e]=t[e]}Object.defineProperty(e,"__esModule",{value:!0}),e.defineStyle=o;var r={width:"320px",colorDefault:"#fff",colorInfo:"#3498db",colorSuccess:"#07bc0c",colorWarning:"#f1c40f",colorError:"#e74c3c",colorProgressDefault:"linear-gradient(to right, #4cd964, #5ac8fa, #007aff, #34aadc, #5856d6, #ff2d55)",mobile:"only screen and (max-width : 480px)",fontFamily:"sans-serif",zIndex:9999,TOP_LEFT:{top:"1em",left:"1em"},TOP_CENTER:{top:"1em",left:"50%"},TOP_RIGHT:{top:"1em",right:"1em"},BOTTOM_LEFT:{bottom:"1em",left:"1em"},BOTTOM_CENTER:{bottom:"1em",left:"50%"},BOTTOM_RIGHT:{bottom:"1em",right:"1em"}};e.default=r},function(t,e,n){"use strict";function o(t){return"number"==typeof t&&!isNaN(t)&&t>0}function r(t){return Object.keys(t).map(function(e){return t[e]})}function i(t){return t.isRequired=function(e,n,o){if(void 0===e[n])return new Error("The prop "+n+" is marked as required in \n "+o+", but its value is undefined.");t(e,n,o)},t}Object.defineProperty(e,"__esModule",{value:!0}),e.falseOrElement=e.falseOrDelay=void 0,e.isValidDelay=o,e.objectValues=r;var a=n(0);e.falseOrDelay=i(function(t,e,n){var r=t[e];return!1===r||o(r)?null:new Error(n+" expect "+e+" \n to be a valid Number > 0 or equal to false. "+r+" given.")}),e.falseOrElement=i(function(t,e,n){var o=t[e];return!1===o||(0,a.isValidElement)(o)?null:new Error(n+" expect "+e+" \n to be a valid react element or equal to false. "+o+" given.")})},function(t,e,n){"use strict";function o(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e<t.length;e++)n[e]=t[e];return n}return Array.from(t)}Object.defineProperty(e,"__esModule",{value:!0});var r={eventList:new Map,on:function(t,e){return this.eventList.has(t)||this.eventList.set(t,[]),this.eventList.get(t).push(e),this},off:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return this.eventList.delete(t)},emit:function(t){for(var e=this,n=arguments.length,r=Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return this.eventList.has(t)?(this.eventList.get(t).forEach(function(t){return setTimeout(function(){return t.call.apply(t,[e].concat(o(r)))},0)}),!0):(console.warn("<"+t+"> Event is not registered. Did you forgot to bind the event ?"),!1)}};e.default=r},function(t,e,n){"use strict";function o(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0}),e.style=e.toast=e.ToastContainer=void 0;var r=n(8),i=o(r),a=n(19),s=o(a),u=n(4);e.ToastContainer=i.default,e.toast=s.default,e.style=u.defineStyle},function(t,e,n){"use strict";function o(t){return t&&t.__esModule?t:{default:t}}function r(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e<t.length;e++)n[e]=t[e];return n}return Array.from(t)}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(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}function s(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)}function u(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}Object.defineProperty(e,"__esModule",{value:!0});var l="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},c=function(){function t(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,n,o){return n&&t(e.prototype,n),o&&t(e,o),e}}(),f=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},p=n(0),d=o(p),h=n(1),m=o(h),y=n(2),b=n(9),O=o(b),v=n(11),g=o(v),T=n(13),E=o(T),x=n(14),C=o(x),N=n(3),P=n(4),_=o(P),S=n(6),I=o(S),j=n(5),w=function(t){var e=t.toUpperCase().replace("-","_"),n=void 0!==N.POSITION[e]?_.default[e]:_.default.TOP_RIGHT;return-1!==e.indexOf("CENTER")&&void 0===n.marginLeft&&(n.marginLeft="-"+parseInt(_.default.width,10)/2+"px"),n},R=function(t,e){return(0,y.css)(f({zIndex:_.default.zIndex,position:"fixed",padding:"4px",width:_.default.width,boxSizing:"border-box",color:"#fff"},t?{pointerEvents:"none"}:{},u({},"@media "+_.default.mobile,f({width:"100vw",padding:0,left:0,margin:0,position:"fixed"},"top"===e.substring(0,3)?{top:0}:{bottom:0}))),w(e))},k=function(t){function e(){var t,n,o,r;i(this,e);for(var s=arguments.length,u=Array(s),l=0;l<s;l++)u[l]=arguments[l];return n=o=a(this,(t=e.__proto__||Object.getPrototypeOf(e)).call.apply(t,[this].concat(u))),o.state={toast:[],isDocumentHidden:!1},o.collection={},o.isDocumentHidden=function(){return o.setState({isDocumentHidden:document.hidden})},o.isToastActive=function(t){return-1!==o.state.toast.indexOf(parseInt(t,10))},r=n,a(o,r)}return s(e,t),c(e,[{key:"componentDidMount",value:function(){var t=this,e=N.ACTION.SHOW,n=N.ACTION.CLEAR,o=N.ACTION.MOUNTED;I.default.on(e,function(e,n){return t.show(e,n)}).on(n,function(e){return null!==e?t.removeToast(e):t.clear()}).emit(o,this),document.addEventListener("visibilitychange",this.isDocumentHidden)}},{key:"componentWillUnmount",value:function(){I.default.off(N.ACTION.SHOW),I.default.off(N.ACTION.CLEAR),document.removeEventListener("visibilitychange",this.isDocumentHidden)}},{key:"removeToast",value:function(t){this.setState({toast:this.state.toast.filter(function(e){return e!==parseInt(t,10)})})}},{key:"makeCloseButton",value:function(t,e,n){var o=this,r=this.props.closeButton;return((0,p.isValidElement)(t)||!1===t)&&(r=t),!1!==r&&(0,p.cloneElement)(r,{closeToast:function(){return o.removeToast(e)},type:n})}},{key:"getAutoCloseDelay",value:function(t){return!1===t||(0,j.isValidDelay)(t)?t:this.props.autoClose}},{key:"isFunction",value:function(t){return!!(t&&t.constructor&&t.call&&t.apply)}},{key:"canBeRendered",value:function(t){return(0,p.isValidElement)(t)||"string"==typeof t||"number"==typeof t||this.isFunction(t)}},{key:"show",value:function(t,e){var n=this;if(!this.canBeRendered(t))throw new Error("The element you provided cannot be rendered. You provided an element of type "+(void 0===t?"undefined":l(t)));var o=e.toastId,i=function(){return n.removeToast(o)},a={id:o,type:e.type,closeToast:i,updateId:e.updateId,rtl:this.props.rtl,position:e.position||this.props.position,transition:e.transition||this.props.transition,className:e.className||this.props.toastClassName,bodyClassName:e.bodyClassName||this.props.bodyClassName,closeButton:this.makeCloseButton(e.closeButton,o,e.type),pauseOnHover:null!==e.pauseOnHover?e.pauseOnHover:this.props.pauseOnHover,closeOnClick:null!==e.closeOnClick?e.closeOnClick:this.props.closeOnClick,progressClassName:e.progressClassName||this.props.progressClassName,autoClose:this.getAutoCloseDelay(!1!==e.autoClose?parseInt(e.autoClose,10):e.autoClose),hideProgressBar:"boolean"==typeof e.hideProgressBar?e.hideProgressBar:this.props.hideProgressBar};this.isFunction(e.onOpen)&&(a.onOpen=e.onOpen),this.isFunction(e.onClose)&&(a.onClose=e.onClose),(0,p.isValidElement)(t)&&"string"!=typeof t.type&&"number"!=typeof t.type?t=(0,p.cloneElement)(t,{closeToast:i}):this.isFunction(t)&&(t=t({closeToast:i})),this.collection=f({},this.collection,u({},o,{position:a.position,options:a,content:t})),this.setState({toast:null!==a.updateId?[].concat(r(this.state.toast)):[].concat(r(this.state.toast),[o])})}},{key:"makeToast",value:function(t,e){return d.default.createElement(g.default,f({},e,{isDocumentHidden:this.state.isDocumentHidden,key:"toast-"+e.id}),t)}},{key:"clear",value:function(){this.setState({toast:[]})}},{key:"renderToast",value:function(){var t=this,e={},n=this.props,o=n.className,r=n.style;return(n.newestOnTop?Object.keys(this.collection).reverse():Object.keys(this.collection)).forEach(function(n){var o=t.collection[n];e[o.position]||(e[o.position]=[]),-1!==t.state.toast.indexOf(parseInt(n,10))?e[o.position].push(t.makeToast(o.content,o.options)):(e[o.position].push(null),delete t.collection[n])}),Object.keys(e).map(function(t){var n=1===e[t].length&&null===e[t][0];return d.default.createElement(O.default,f({},(0,y.css)(R(n,t),"string"!=typeof o&&o),"string"==typeof o&&{className:o},null!==r&&{style:r},{key:"container-"+t}),e[t])})}},{key:"render",value:function(){return d.default.createElement("div",null,this.renderToast())}}]),e}(p.Component);k.propTypes={position:m.default.oneOf((0,j.objectValues)(N.POSITION)),autoClose:j.falseOrDelay,closeButton:j.falseOrElement,hideProgressBar:m.default.bool,pauseOnHover:m.default.bool,closeOnClick:m.default.bool,newestOnTop:m.default.bool,className:m.default.oneOfType([m.default.string,m.default.object]),style:m.default.object,toastClassName:m.default.oneOfType([m.default.string,m.default.object]),bodyClassName:m.default.oneOfType([m.default.string,m.default.object]),progressClassName:m.default.oneOfType([m.default.string,m.default.object]),transition:m.default.func,rtl:m.default.bool},k.defaultProps={position:N.POSITION.TOP_RIGHT,transition:C.default,rtl:!1,autoClose:5e3,hideProgressBar:!1,closeButton:d.default.createElement(E.default,null),pauseOnHover:!0,closeOnClick:!0,newestOnTop:!1,className:null,style:null,toastClassName:null,bodyClassName:null,progressClassName:null},e.default=k},function(t,e,n){"use strict";function o(t){return t&&t.__esModule?t:{default:t}}function r(t,e){var n={};for(var o in t)e.indexOf(o)>=0||Object.prototype.hasOwnProperty.call(t,o)&&(n[o]=t[o]);return n}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(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}function s(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)}e.__esModule=!0;var u=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},l=n(1),c=o(l),f=n(0),p=o(f),d=n(10),h=Object.values||function(t){return Object.keys(t).map(function(e){return t[e]})},m=(c.default.any,c.default.node,c.default.bool,c.default.bool,c.default.bool,c.default.func,{component:"div",childFactory:function(t){return t}}),y=function(t){function e(n,o){i(this,e);var r=a(this,t.call(this,n,o));return r.handleExited=function(t,e,n){var o=(0,d.getChildMapping)(r.props.children);t in o||(n&&n(e),r.setState(function(e){var n=u({},e.children);return delete n[t],{children:n}}))},r.state={children:(0,d.getChildMapping)(n.children,function(t){var e=function(e){r.handleExited(t.key,e,t.props.onExited)};return(0,f.cloneElement)(t,{onExited:e,in:!0,appear:r.getProp(t,"appear"),enter:r.getProp(t,"enter"),exit:r.getProp(t,"exit")})})},r}return s(e,t),e.prototype.getChildContext=function(){return{transitionGroup:{isMounting:!this.appeared}}},e.prototype.getProp=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.props;return null!=n[e]?n[e]:t.props[e]},e.prototype.componentDidMount=function(){this.appeared=!0},e.prototype.componentWillReceiveProps=function(t){var e=this,n=this.state.children,o=(0,d.getChildMapping)(t.children),r=(0,d.mergeChildMappings)(n,o);Object.keys(r).forEach(function(i){var a=r[i];if((0,f.isValidElement)(a)){var s=function(t){e.handleExited(a.key,t,a.props.onExited)},u=i in n,l=i in o,c=n[i],p=(0,f.isValidElement)(c)&&!c.props.in;!l||u&&!p?l||!u||p?l&&u&&(0,f.isValidElement)(c)&&(r[i]=(0,f.cloneElement)(a,{onExited:s,in:c.props.in,exit:e.getProp(a,"exit",t),enter:e.getProp(a,"enter",t)})):r[i]=(0,f.cloneElement)(a,{in:!1}):r[i]=(0,f.cloneElement)(a,{onExited:s,in:!0,exit:e.getProp(a,"exit",t),enter:e.getProp(a,"enter",t)})}}),this.setState({children:r})},e.prototype.render=function(){var t=this.props,e=t.component,n=t.childFactory,o=r(t,["component","childFactory"]),i=this.state.children;return delete o.appear,delete o.enter,delete o.exit,p.default.createElement(e,o,h(i).map(n))},e}(p.default.Component);y.childContextTypes={transitionGroup:c.default.object.isRequired},y.propTypes={},y.defaultProps=m,e.default=y,t.exports=e.default},function(t,e,n){"use strict";function o(t,e){var n=function(t){return e&&(0,i.isValidElement)(t)?e(t):t},o=Object.create(null);return t&&i.Children.map(t,function(t){return t}).forEach(function(t){o[t.key]=n(t)}),o}function r(t,e){function n(n){return n in e?e[n]:t[n]}t=t||{},e=e||{};var o=Object.create(null),r=[];for(var i in t)i in e?r.length&&(o[i]=r,r=[]):r.push(i);var a=void 0,s={};for(var u in e){if(o[u])for(a=0;a<o[u].length;a++){var l=o[u][a];s[o[u][a]]=n(l)}s[u]=n(u)}for(a=0;a<r.length;a++)s[r[a]]=n(r[a]);return s}e.__esModule=!0,e.getChildMapping=o,e.mergeChildMappings=r;var i=n(0)},function(t,e,n){"use strict";function o(t){return t&&t.__esModule?t:{default:t}}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(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}function a(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)}function s(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}Object.defineProperty(e,"__esModule",{value:!0});var u=function(){function t(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,n,o){return n&&t(e.prototype,n),o&&t(e,o),e}}(),l=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},c=n(0),f=o(c),p=n(1),d=o(p),h=n(2),m=n(12),y=o(m),b=n(3),O=n(4),v=o(O),g=n(5),T={container:function(t,e){var n;return(0,h.css)(l({position:"relative",minHeight:"48px",marginBottom:"1rem",padding:"8px",borderRadius:"1px",boxShadow:"0 1px 10px 0 rgba(0, 0, 0, .1), 0 2px 15px 0 rgba(0, 0, 0, .05)",display:"flex",justifyContent:"space-between",maxHeight:"800px",overflow:"hidden",fontFamily:v.default.fontFamily,cursor:"pointer",background:v.default["color"+t.charAt(0).toUpperCase()+t.slice(1)]},"default"===t?{color:"#aaa"}:{},(n={},s(n,"@media "+v.default.mobile,{marginBottom:0}),s(n,"direction",e?"rtl":"ltr"),n)))},body:(0,h.css)({margin:"auto 0",flex:1})},E=function(t){function e(){var t,n,o,a;r(this,e);for(var s=arguments.length,u=Array(s),l=0;l<s;l++)u[l]=arguments[l];return n=o=i(this,(t=e.__proto__||Object.getPrototypeOf(e)).call.apply(t,[this].concat(u))),o.state={isRunning:!0},o.pauseToast=function(){o.setState({isRunning:!1})},o.playToast=function(){o.setState({isRunning:!0})},a=n,i(o,a)}return a(e,t),u(e,[{key:"componentDidMount",value:function(){null!==this.props.onOpen&&this.props.onOpen(this.getChildrenProps())}},{key:"componentWillReceiveProps",value:function(t){this.props.isDocumentHidden!==t.isDocumentHidden&&this.setState({isRunning:!t.isDocumentHidden})}},{key:"componentWillUnmount",value:function(){null!==this.props.onClose&&this.props.onClose(this.getChildrenProps())}},{key:"getChildrenProps",value:function(){return this.props.children.props}},{key:"getToastProps",value:function(){var t={};return!1!==this.props.autoClose&&!0===this.props.pauseOnHover&&(t.onMouseEnter=this.pauseToast,t.onMouseLeave=this.playToast),"string"==typeof this.props.className&&(t.className=this.props.className),this.props.closeOnClick&&(t.onClick=this.props.closeToast),t}},{key:"render",value:function(){var t=this.props,e=t.closeButton,n=t.children,o=t.autoClose,r=t.type,i=t.hideProgressBar,a=t.closeToast,s=t.transition,u=t.position,c=t.onExited,p=t.className,d=t.bodyClassName,m=t.progressClassName,b=t.updateId,O=t.role,v=t.rtl;return f.default.createElement(s,{in:this.props.in,appear:!0,unmountOnExit:!0,onExited:c,position:u},f.default.createElement("div",l({},(0,h.css)(T.container(r,v),"string"!=typeof p&&p),this.getToastProps()),f.default.createElement("div",l({},this.props.in&&{role:O},(0,h.css)(T.body,"string"!=typeof d&&d),"string"==typeof d&&{className:d}),n),!1!==e&&e,!1!==o&&f.default.createElement(y.default,{key:"pb-"+b,rtl:v,delay:o,isRunning:this.state.isRunning,closeToast:a,hide:i,type:r,className:m})))}}]),e}(c.Component);E.propTypes={closeButton:g.falseOrElement.isRequired,autoClose:g.falseOrDelay.isRequired,children:d.default.node.isRequired,closeToast:d.default.func.isRequired,position:d.default.oneOf((0,g.objectValues)(b.POSITION)).isRequired,pauseOnHover:d.default.bool.isRequired,closeOnClick:d.default.bool.isRequired,transition:d.default.func.isRequired,isDocumentHidden:d.default.bool.isRequired,rtl:d.default.bool.isRequired,in:d.default.bool,onExited:d.default.func,hideProgressBar:d.default.bool,onOpen:d.default.func,onClose:d.default.func,type:d.default.oneOf((0,g.objectValues)(b.TYPE)),className:d.default.oneOfType([d.default.string,d.default.object]),bodyClassName:d.default.oneOfType([d.default.string,d.default.object]),progressClassName:d.default.oneOfType([d.default.string,d.default.object]),updateId:d.default.number,ariaLabel:d.default.string},E.defaultProps={type:b.TYPE.DEFAULT,in:!0,hideProgressBar:!1,onOpen:null,onClose:null,className:null,bodyClassName:null,progressClassName:null,updateId:null,role:"alert"},e.default=E},function(t,e,n){"use strict";function o(t){return t&&t.__esModule?t:{default:t}}function r(t){var e=t.delay,n=t.isRunning,o=t.closeToast,r=t.type,a=t.hide,u=t.className,l=t.rtl;return s.default.createElement("div",i({},(0,c.css)(m(r,n,a,e,l),"string"!=typeof u&&u),"string"==typeof u&&{className:u},{onAnimationEnd:o}))}Object.defineProperty(e,"__esModule",{value:!0});var i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},a=n(0),s=o(a),u=n(1),l=o(u),c=n(2),f=n(3),p=n(4),d=o(p),h=c.css.keyframes({"0%":{width:"100%"},"100%":{width:0}}),m=function(t,e,n,o,r){return(0,c.css)(i({position:"absolute",bottom:0,width:0,height:"5px",zIndex:d.default.zIndex,opacity:n?0:.7,animation:h+" linear 1",animationPlayState:e?"running":"paused",animationDuration:o+"ms",backgroundColor:"rgba(255,255,255,.7)"},"default"===t?{background:r?d.default.colorProgressDefault.replace("to right","to left"):d.default.colorProgressDefault}:{},r?{right:0}:{left:0}))};r.propTypes={delay:l.default.number.isRequired,isRunning:l.default.bool.isRequired,closeToast:l.default.func.isRequired,rtl:l.default.bool.isRequired,type:l.default.string,hide:l.default.bool,className:l.default.oneOfType([l.default.string,l.default.object])},r.defaultProps={type:f.TYPE.DEFAULT,hide:!1,className:""},e.default=r},function(t,e,n){"use strict";function o(t){return t&&t.__esModule?t:{default:t}}function r(t){var e=t.closeToast,n=t.type,o=t.ariaLabel;return s.default.createElement("button",i({},f("default"===n),{type:"button",onClick:e,"aria-label":o}),"✖")}Object.defineProperty(e,"__esModule",{value:!0});var i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},a=n(0),s=o(a),u=n(1),l=o(u),c=n(2),f=function(t){return(0,c.css)({color:t?"#000":"#fff",fontWeight:"bold",fontSize:"14px",background:"transparent",outline:"none",border:"none",padding:0,cursor:"pointer",opacity:t?"0.3":"0.7",transition:".3s ease",alignSelf:"flex-start",":hover, :focus":{opacity:1}})};r.propTypes={closeToast:l.default.func,arialLabel:l.default.string},r.defaultProps={ariaLabel:"close"},e.default=r},function(t,e,n){"use strict";function o(t){return t&&t.__esModule?t:{default:t}}function r(t,e){var n={};for(var o in t)e.indexOf(o)>=0||Object.prototype.hasOwnProperty.call(t,o)&&(n[o]=t[o]);return n}function i(t){var e=t.children,n=t.position,o=r(t,["children","position"]),i=m(n),s=i.enter,l=i.exit,f=function(t){return t.classList.add(s)},p=function(t){return t.classList.remove(s)},d=function(t){var e=t.getBoundingClientRect().height;t.style.transition="padding 0.75s, height 0.75s, maringBottom 0.75s",t.style.minHeight=0,t.style.height=e>=48?e+"px":"48px",requestAnimationFrame(function(){t.style.padding=0,t.style.height=0,t.style.marginBottom=0,requestAnimationFrame(function(){return t.classList.add(l)})})};return u.default.createElement(c.default,a({},o,{timeout:750,onEnter:f,onEntered:p,onExit:d}),e)}Object.defineProperty(e,"__esModule",{value:!0});var a=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},s=n(0),u=o(s),l=n(15),c=o(l),f=n(2),p=n(18),d=o(p),h={animationDuration:"0.75s",animationFillMode:"both"},m=function(t){var e=(0,d.default)(t),n=e.enter,o=e.exit,r=f.css.keyframes(a({"from, 60%, 75%, 90%, to":{animationTimingFunction:"cubic-bezier(0.215, 0.610, 0.355, 1.000)"}},n)),i=f.css.keyframes(o);return{enter:(0,f.css)(a({},h,{animationName:r})),exit:(0,f.css)(a({},h,{animationName:i}))}};e.default=i},function(t,e,n){"use strict";function o(t){return t&&t.__esModule?t:{default:t}}function r(t,e){var n={};for(var o in t)e.indexOf(o)>=0||Object.prototype.hasOwnProperty.call(t,o)&&(n[o]=t[o]);return n}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(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}function s(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)}function u(){}e.__esModule=!0,e.EXITING=e.ENTERED=e.ENTERING=e.EXITED=e.UNMOUNTED=void 0;var l=n(1),c=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(l),f=n(0),p=o(f),d=n(16),h=o(d),m=(n(17),e.UNMOUNTED="unmounted"),y=e.EXITED="exited",b=e.ENTERING="entering",O=e.ENTERED="entered",v=e.EXITING="exiting",g=function(t){function e(n,o){i(this,e);var r=a(this,t.call(this,n,o)),s=o.transitionGroup,u=s&&!s.isMounting?n.enter:n.appear,l=void 0;return r.nextStatus=null,n.in?u?(l=y,r.nextStatus=b):l=O:l=n.unmountOnExit||n.mountOnEnter?m:y,r.state={status:l},r.nextCallback=null,r}return s(e,t),e.prototype.getChildContext=function(){return{transitionGroup:null}},e.prototype.componentDidMount=function(){this.updateStatus(!0)},e.prototype.componentWillReceiveProps=function(t){var e=this.pendingState||this.state,n=e.status;t.in?(n===m&&this.setState({status:y}),n!==b&&n!==O&&(this.nextStatus=b)):n!==b&&n!==O||(this.nextStatus=v)},e.prototype.componentDidUpdate=function(){this.updateStatus()},e.prototype.componentWillUnmount=function(){this.cancelNextCallback()},e.prototype.getTimeouts=function(){var t=this.props.timeout,e=void 0,n=void 0,o=void 0;return e=n=o=t,null!=t&&"number"!=typeof t&&(e=t.exit,n=t.enter,o=t.appear),{exit:e,enter:n,appear:o}},e.prototype.updateStatus=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=this.nextStatus;if(null!==e){this.nextStatus=null,this.cancelNextCallback();var n=h.default.findDOMNode(this);e===b?this.performEnter(n,t):this.performExit(n)}else this.props.unmountOnExit&&this.state.status===y&&this.setState({status:m})},e.prototype.performEnter=function(t,e){var n=this,o=this.props.enter,r=this.context.transitionGroup?this.context.transitionGroup.isMounting:e,i=this.getTimeouts();if(!e&&!o)return void this.safeSetState({status:O},function(){n.props.onEntered(t)});this.props.onEnter(t,r),this.safeSetState({status:b},function(){n.props.onEntering(t,r),n.onTransitionEnd(t,i.enter,function(){n.safeSetState({status:O},function(){n.props.onEntered(t,r)})})})},e.prototype.performExit=function(t){var e=this,n=this.props.exit,o=this.getTimeouts();if(!n)return void this.safeSetState({status:y},function(){e.props.onExited(t)});this.props.onExit(t),this.safeSetState({status:v},function(){e.props.onExiting(t),e.onTransitionEnd(t,o.exit,function(){e.safeSetState({status:y},function(){e.props.onExited(t)})})})},e.prototype.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},e.prototype.safeSetState=function(t,e){var n=this;this.pendingState=t,e=this.setNextCallback(e),this.setState(t,function(){n.pendingState=null,e()})},e.prototype.setNextCallback=function(t){var e=this,n=!0;return this.nextCallback=function(o){n&&(n=!1,e.nextCallback=null,t(o))},this.nextCallback.cancel=function(){n=!1},this.nextCallback},e.prototype.onTransitionEnd=function(t,e,n){this.setNextCallback(n),t?(this.props.addEndListener&&this.props.addEndListener(t,this.nextCallback),null!=e&&setTimeout(this.nextCallback,e)):setTimeout(this.nextCallback,0)},e.prototype.render=function(){var t=this.state.status;if(t===m)return null;var e=this.props,n=e.children,o=r(e,["children"]);if(delete o.in,delete o.mountOnEnter,delete o.unmountOnExit,delete o.appear,delete o.enter,delete o.exit,delete o.timeout,delete o.addEndListener,delete o.onEnter,delete o.onEntering,delete o.onEntered,delete o.onExit,delete o.onExiting,delete o.onExited,"function"==typeof n)return n(t,o);var i=p.default.Children.only(n);return p.default.cloneElement(i,o)},e}(p.default.Component);g.contextTypes={transitionGroup:c.object},g.childContextTypes={transitionGroup:function(){}},g.propTypes={},g.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:u,onEntering:u,onEntered:u,onExit:u,onExiting:u,onExited:u},g.UNMOUNTED=0,g.EXITED=1,g.ENTERING=2,g.ENTERED=3,g.EXITING=4,e.default=g},function(t,e){t.exports=o},function(t,e,n){"use strict";function o(t){var e="transition"+t+"Timeout",n="transition"+t;return function(t){if(t[n]){if(null==t[e])return new Error(e+" wasn't supplied to CSSTransitionGroup: this can cause unreliable animations and won't be supported in a future version of React. See https://fb.me/react-animation-transition-group-timeout for more information.");if("number"!=typeof t[e])return new Error(e+" must be a number (in milliseconds)")}return null}}e.__esModule=!0,e.classNamesShape=e.timeoutsShape=void 0,e.transitionTimeout=o;var r=n(1),i=function(t){return t&&t.__esModule?t:{default:t}}(r);e.timeoutsShape=i.default.oneOfType([i.default.number,i.default.shape({enter:i.default.number,exit:i.default.number}).isRequired]),e.classNamesShape=i.default.oneOfType([i.default.string,i.default.shape({enter:i.default.string,exit:i.default.string,active:i.default.string}),i.default.shape({enter:i.default.string,enterActive:i.default.string,exit:i.default.string,exitActive:i.default.string})])},function(t,e,n){"use strict";function o(t){switch(t){case r.POSITION.TOP_RIGHT:case r.POSITION.BOTTOM_RIGHT:default:return{enter:{from:{opacity:0,transform:"translate3d(3000px, 0, 0)"},"60%":{opacity:1,transform:"translate3d(-25px, 0, 0)"},"75%":{transform:"translate3d(10px, 0, 0)"},"90%":{transform:"translate3d(-5px, 0, 0)"},to:{transform:"none"}},exit:{"20%":{opacity:1,transform:"translate3d(-20px, 0, 0)"},to:{opacity:0,transform:"translate3d(2000px, 0, 0)"}}};case r.POSITION.TOP_LEFT:case r.POSITION.BOTTOM_LEFT:return{enter:{"0%":{opacity:0,transform:"translate3d(-3000px, 0, 0)"},"60%":{opacity:1,transform:"translate3d(25px, 0, 0)"},"75%":{transform:"translate3d(-10px, 0, 0)"},"90%":{transform:"translate3d(5px, 0, 0)"},to:{transform:"none"}},exit:{"20%":{opacity:1,transform:"translate3d(20px, 0, 0)"},to:{opacity:0,transform:"translate3d(-2000px, 0, 0)"}}};case r.POSITION.BOTTOM_CENTER:return{enter:{from:{opacity:0,transform:"translate3d(0, 3000px, 0)"},"60%":{opacity:1,transform:"translate3d(0, -20px, 0)"},"75%":{transform:"translate3d(0, 10px, 0)"},"90%":{transform:"translate3d(0, -5px, 0)"},to:{transform:"translate3d(0, 0, 0)"}},exit:{"20%":{transform:"translate3d(0, 10px, 0)"},"40%, 45%":{opacity:1,transform:"translate3d(0, -20px, 0)"},to:{opacity:0,transform:"translate3d(0, 2000px, 0)"}}};case r.POSITION.TOP_CENTER:return{enter:{"0%":{opacity:0,transform:"translate3d(0, -3000px, 0)"},"60%":{opacity:1,transform:"translate3d(0, 25px, 0)"},"75%":{transform:"translate3d(0, -10px, 0)"},"90%":{transform:"translate3d(0, 5px, 0)"},to:{transform:"none"}},exit:{"20%":{transform:"translate3d(0, -10px, 0)"},"40%, 45%":{opacity:1,transform:"translate3d(0, 20px, 0)"},to:{opacity:0,transform:"translate3d(0, -2000px, 0)"}}}}}Object.defineProperty(e,"__esModule",{value:!0}),e.default=o;var r=n(3)},function(t,e,n){"use strict";function o(t,e){return i({},l,t,{type:e,toastId:++p})}function r(t,e){return null!==c?s.default.emit(u.ACTION.SHOW,t,e):f.push({action:u.ACTION.SHOW,content:t,options:e}),e.toastId}Object.defineProperty(e,"__esModule",{value:!0});var i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},a=n(6),s=function(t){return t&&t.__esModule?t:{default:t}}(a),u=n(3),l={type:u.TYPE.DEFAULT,autoClose:null,closeButton:null,hideProgressBar:null,position:null,pauseOnHover:null,closeOnClick:null,className:null,bodyClassName:null,progressClassName:null,transition:null,updateId:null},c=null,f=[],p=0,d=i(function(t,e){return r(t,o(e,e&&e.type||u.TYPE.DEFAULT))},{success:function(t,e){return r(t,o(e,u.TYPE.SUCCESS))},info:function(t,e){return r(t,o(e,u.TYPE.INFO))},warn:function(t,e){return r(t,o(e,u.TYPE.WARNING))},warning:function(t,e){return r(t,o(e,u.TYPE.WARNING))},error:function(t,e){return r(t,o(e,u.TYPE.ERROR))},dismiss:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return c&&s.default.emit(u.ACTION.CLEAR,t)},isActive:function(){return!1},update:function(t,e){setTimeout(function(){if(c&&void 0!==c.collection[t]){var n=c.collection[t],o=n.options,a=n.content,s=null!==o.updateId?o.updateId+1:1,u=i({},o,e,{toastId:t,updateId:s}),l=void 0!==u.render?u.render:a;delete u.render,r(l,u)}},0)}},{POSITION:u.POSITION,TYPE:u.TYPE});s.default.on(u.ACTION.MOUNTED,function(t){c=t,d.isActive=function(t){return c.isToastActive(t)},f.forEach(function(t){s.default.emit(t.action,t.content,t.options)}),f=[]}),e.default=d}])});
//# sourceMappingURL=ReactToastify.min.js.map

@@ -11,3 +11,3 @@ import * as React from 'react';

* Set the default toast width.
* Default: '320px'
* `Default: '320px'`
*/

@@ -18,3 +18,3 @@ width?: string;

* Set the toast color when no type is provided.
* Default: '#fff'
* `Default: '#fff'`
*/

@@ -25,3 +25,3 @@ colorDefault?: string;

* Set the toast color when the type is INFO.
* Default: '#3498db'
* `Default: '#3498db'`
*/

@@ -32,3 +32,3 @@ colorInfo?: string;

* Set the toast color when the type is SUCCESS.
* Default: '#07bc0c'
* `Default: '#07bc0c'`
*/

@@ -39,3 +39,3 @@ colorSuccess?: string;

* Set the toast color when the type is WARNING.
* Default: '#f1c40f'
* `Default: '#f1c40f'`
*/

@@ -46,3 +46,3 @@ colorWarning?: string;

* Set the toast color when the type is ERROR.
* Default: '#e74c3c'
* `Default: '#e74c3c'`
*/

@@ -53,3 +53,3 @@ colorError?: string;

* Set the progress bar color when no type is provided.
* Default: 'linear-gradient(to right, #4cd964, #5ac8fa, #007aff, #34aadc, #5856d6, #ff2d55)'
* `Default: 'linear-gradient(to right, #4cd964, #5ac8fa, #007aff, #34aadc, #5856d6, #ff2d55)'`
*/

@@ -60,3 +60,3 @@ colorProgressDefault?: string;

* Media query to apply mobile style.
* Default: 'only screen and (max-width : 480px)'
* `Default: 'only screen and (max-width : 480px)'`
*/

@@ -67,3 +67,3 @@ mobile?: string;

* Override the font-family style property.
* Default: 'sans-serif'
* `Default: 'sans-serif'`
*/

@@ -74,3 +74,3 @@ fontFamily?: string;

* Set the z-index for the ToastContainer.
* Default: 9999
* `Default: 9999`
*/

@@ -81,6 +81,6 @@ zIndex?: string | number;

* Override the default position.
* Default: {
* `Default: {
* top: '1em',
* left: '1em'
* }
* }`
*/

@@ -91,6 +91,6 @@ TOP_LEFT?: object;

* Override the default position.
* Default: {
* `Default: {
* top: '1em',
* left: '50%'
* }
* }`
*/

@@ -101,6 +101,6 @@ TOP_CENTER?: object;

* Override the default position.
* Default: {
* `Default: {
* top: '1em',
* right: '1em'
*}
* }`
*/

@@ -111,6 +111,6 @@ TOP_RIGHT?: object;

* Override the default position.
* Default: {
* `Default: {
* bottom: '1em',
* left: '1em'
* }
* }`
*/

@@ -121,6 +121,6 @@ BOTTOM_LEFT?: object;

* Override the default position.
* Default: {
* `Default: {
* bottom: '1em',
* left: '50%'
*}
* }`
*/

@@ -131,6 +131,6 @@ BOTTOM_CENTER?: object;

* Override the default position.
* Default: {
* `Default: {
* bottom: '1em',
* right: '1em'
*}
* }`
*/

@@ -143,2 +143,3 @@ BOTTOM_RIGHT?: object;

* Pause the timer when the mouse hover the toast.
* `Default: true`
*/

@@ -149,2 +150,3 @@ pauseOnHover?: boolean;

* Remove the toast when clicked.
* `Default: true`
*/

@@ -156,2 +158,3 @@ closeOnClick?: boolean;

* Use `false` to prevent the toast from closing.
* `Default: 5000`
*/

@@ -162,3 +165,4 @@ autoClose?: number | false;

* Set the default position to use.
* One of: 'top-right', 'top-center', 'top-left', 'bottom-right', 'bottom-center', 'bottom-left'
* `One of: 'top-right', 'top-center', 'top-left', 'bottom-right', 'bottom-center', 'bottom-left'`
* `Default: 'top-right'`
*/

@@ -192,3 +196,4 @@ position?: string;

/**
* Show or not the progress bar.
* Hide or show the progress bar.
* `Default: false`
*/

@@ -216,3 +221,3 @@ hideProgressBar?: boolean;

* Set the toast type.
* One of: 'info', 'success', 'warning', 'error', 'default'.
* `One of: 'info', 'success', 'warning', 'error', 'default'`
*/

@@ -233,3 +238,3 @@ type?: ToastType;

* Whether or not to display the newest toast on top.
* Default: false
* `Default: false`
*/

@@ -248,2 +253,8 @@ newestOnTop?: boolean;

toastClassName?: string | object;
/**
* Support right to left display.
* `Default: false`
*/
rtl?: boolean;
}

@@ -299,3 +310,3 @@

/**
* Set notification type to 'info'
* Set notification type to `'info'`
*/

@@ -305,3 +316,3 @@ INFO: string;

/**
* Set notification type to 'success'
* Set notification type to `'success'`
*/

@@ -311,3 +322,3 @@ SUCCESS: string;

/**
* Set notification type to 'warning'
* Set notification type to `'warning'`
*/

@@ -317,3 +328,3 @@ WARNING: string;

/**
* Set notification type to 'error'
* Set notification type to `'error'`
*/

@@ -323,3 +334,3 @@ ERROR: string;

/**
* Set notification type to 'default'
* Set notification type to `'default'`
*/

@@ -334,3 +345,3 @@ DEFAULT: string;

/**
* Set the position to 'top-left'
* Set the position to `'top-left'`
*/

@@ -340,3 +351,3 @@ TOP_LEFT: string;

/**
* Set the position to 'top-right'
* Set the position to `'top-right'`
*/

@@ -346,3 +357,3 @@ TOP_RIGHT: string;

/**
* Set the position to 'top-center'
* Set the position to `'top-center'`
*/

@@ -352,3 +363,3 @@ TOP_CENTER: string;

/**
* Set the position to 'bottom-left'
* Set the position to `'bottom-left'`
*/

@@ -358,3 +369,3 @@ BOTTOM_LEFT: string;

/**
* Set the position to 'bottom-right'
* Set the position to `'bottom-right'`
*/

@@ -364,3 +375,3 @@ BOTTOM_RIGHT: string;

/**
* Set the position to 'bottom-center'
* Set the position to `'bottom-center'`
*/

@@ -367,0 +378,0 @@ BOTTOM_CENTER: string;

@@ -32,7 +32,6 @@ 'use strict';

var styles = function styles(type, isRunning, hide, delay) {
var styles = function styles(type, isRunning, hide, delay, rtl) {
return (0, _glamor.css)(_extends({
position: 'absolute',
bottom: 0,
left: 0,
width: 0,

@@ -46,3 +45,6 @@ height: '5px',

backgroundColor: 'rgba(255,255,255,.7)'
}, type === 'default' ? { background: _defaultStyle2.default.colorProgressDefault } : {}));
}, type === 'default' ? {
// uumm, ok I was lazy
background: rtl ? _defaultStyle2.default.colorProgressDefault.replace('to right', 'to left') : _defaultStyle2.default.colorProgressDefault
} : {}, rtl ? { right: 0 } : { left: 0 }));
};

@@ -56,5 +58,6 @@

hide = _ref.hide,
className = _ref.className;
className = _ref.className,
rtl = _ref.rtl;
return _react2.default.createElement('div', _extends({}, typeof className !== 'string' ? (0, _glamor.css)(styles(type, isRunning, hide, delay), className) : styles(type, isRunning, hide, delay), typeof className === 'string' && { className: className }, {
return _react2.default.createElement('div', _extends({}, (0, _glamor.css)(styles(type, isRunning, hide, delay, rtl), typeof className !== 'string' && className), typeof className === 'string' && { className: className }, {
onAnimationEnd: closeToast

@@ -81,2 +84,7 @@ }));

/**
* Support rtl content
*/
rtl: _propTypes2.default.bool.isRequired,
/**
* Optional type : info, success ...

@@ -83,0 +91,0 @@ */

@@ -44,3 +44,5 @@ 'use strict';

var styles = {
container: function container(type) {
container: function container(type, rtl) {
var _extends2;
return (0, _glamor.css)(_extends({

@@ -60,5 +62,5 @@ position: 'relative',

background: _defaultStyle2.default['color' + type.charAt(0).toUpperCase() + type.slice(1)]
}, type === 'default' ? { color: '#aaa' } : {}, _defineProperty({}, '@media ' + _defaultStyle2.default.mobile, {
}, type === 'default' ? { color: '#aaa' } : {}, (_extends2 = {}, _defineProperty(_extends2, '@media ' + _defaultStyle2.default.mobile, {
marginBottom: 0
})));
}), _defineProperty(_extends2, 'direction', rtl ? 'rtl' : 'ltr'), _extends2)));
},

@@ -149,3 +151,4 @@ body: (0, _glamor.css)({

updateId = _props.updateId,
role = _props.role;
role = _props.role,
rtl = _props.rtl;

@@ -164,6 +167,6 @@

'div',
_extends({}, typeof className !== 'string' ? (0, _glamor.css)(styles.container(type), className) : styles.container(type), this.getToastProps()),
_extends({}, (0, _glamor.css)(styles.container(type, rtl), typeof className !== 'string' && className), this.getToastProps()),
_react2.default.createElement(
'div',
_extends({}, this.props.in && { role: role }, typeof bodyClassName !== 'string' ? (0, _glamor.css)(styles.body, bodyClassName) : styles.body, typeof bodyClassName === 'string' && {
_extends({}, this.props.in && { role: role }, (0, _glamor.css)(styles.body, typeof bodyClassName !== 'string' && bodyClassName), typeof bodyClassName === 'string' && {
className: bodyClassName

@@ -176,2 +179,3 @@ }),

key: 'pb-' + updateId,
rtl: rtl,
delay: autoClose,

@@ -202,2 +206,3 @@ isRunning: this.state.isRunning,

isDocumentHidden: _propTypes2.default.bool.isRequired,
rtl: _propTypes2.default.bool.isRequired,
in: _propTypes2.default.bool,

@@ -221,5 +226,5 @@ onExited: _propTypes2.default.func,

onClose: null,
className: '',
bodyClassName: '',
progressClassName: '',
className: null,
bodyClassName: null,
progressClassName: null,
updateId: null,

@@ -226,0 +231,0 @@ role: 'alert'

@@ -212,2 +212,3 @@ 'use strict';

updateId: options.updateId,
rtl: this.props.rtl,
position: options.position || this.props.position,

@@ -297,3 +298,3 @@ transition: options.transition || this.props.transition,

_TransitionGroup2.default,
_extends({}, typeof className !== 'string' ? (0, _glamor.css)(styles(disablePointer, position), className) : styles(disablePointer, position), typeof className === 'string' && { className: className }, style !== null && { style: style }, {
_extends({}, (0, _glamor.css)(styles(disablePointer, position), typeof className !== 'string' && className), typeof className === 'string' && { className: className }, style !== null && { style: style }, {
key: 'container-' + position

@@ -383,3 +384,8 @@ }),

*/
transition: _propTypes2.default.func
transition: _propTypes2.default.func,
/**
* Support rtl display
*/
rtl: _propTypes2.default.bool
};

@@ -389,2 +395,3 @@ ToastContainer.defaultProps = {

transition: _DefaultTransition2.default,
rtl: false,
autoClose: 5000,

@@ -398,6 +405,6 @@ hideProgressBar: false,

style: null,
toastClassName: '',
bodyClassName: '',
progressClassName: ''
toastClassName: null,
bodyClassName: null,
progressClassName: null
};
exports.default = ToastContainer;
{
"name": "react-toastify",
"version": "3.3.5",
"version": "3.4.0",
"description": "React notification made easy",

@@ -5,0 +5,0 @@ "keywords": [

@@ -34,2 +34,3 @@ # React Toastify [![Build Status](https://travis-ci.org/fkhadra/react-toastify.svg?branch=master)](https://travis-ci.org/fkhadra/react-toastify) [![npm](https://img.shields.io/npm/dm/react-toastify.svg)]() [![npm](https://img.shields.io/npm/v/react-toastify.svg)]() [![license](https://img.shields.io/github/license/fkhadra/react-toastify.svg?maxAge=2592000)]() [![Coverage Status](https://coveralls.io/repos/github/fkhadra/react-toastify/badge.svg?branch=master)](https://coveralls.io/github/fkhadra/react-toastify?branch=master)

- [Style with className](#style-with-classname)
- [Right to left support](#right-to-left-support)
+ [Mobile](#mobile)

@@ -59,2 +60,3 @@ * [Api](#api)

- Super easy to customize
- Rtl support
- Can display a react component inside the toast !

@@ -803,5 +805,19 @@ - Don't rely on `findDOMNode` or any DOM hack

#### Right to left support
Your app need to support rtl content? Set the rtl props to `true`:
```javascript
render(){
return(
{/*Component*/}
<ToastContainer rtl />
{/*Component*/}
);
}
```
### Mobile
On mobile the toast will take all the width available.
On mobile the toast will take all the available width.

@@ -822,2 +838,3 @@ ![react toastiy mobile](https://user-images.githubusercontent.com/5574267/28754040-ae7195ea-753d-11e7-86e1-f23c5e6bc531.gif)

| pauseOnHover | bool | true | Keep the timer running or not on hover |
| rtl | bool | false | Support right to left content |
| closeOnClick | bool | true | Dismiss toast on click |

@@ -898,2 +915,6 @@ | newestOnTop | bool | false | Display newest toast on top |

### V3.4.0
- Add `rtl` props to support right to left content.
### V3.3.5

@@ -900,0 +921,0 @@

@@ -13,7 +13,6 @@ import React from 'react';

const styles = (type, isRunning, hide, delay) =>
const styles = (type, isRunning, hide, delay, rtl) =>
css({
position: 'absolute',
bottom: 0,
left: 0,
width: 0,

@@ -28,12 +27,27 @@ height: '5px',

...(type === 'default'
? { background: defaultStyle.colorProgressDefault }
: {})
? {
// uumm, ok I was lazy
background: rtl
? defaultStyle.colorProgressDefault.replace('to right', 'to left')
: defaultStyle.colorProgressDefault
}
: {}),
...(rtl ? { right: 0 } : { left: 0 })
});
function ProgressBar({ delay, isRunning, closeToast, type, hide, className }) {
function ProgressBar({
delay,
isRunning,
closeToast,
type,
hide,
className,
rtl
}) {
return (
<div
{...(typeof className !== 'string'
? css(styles(type, isRunning, hide, delay), className)
: styles(type, isRunning, hide, delay))}
{...css(
styles(type, isRunning, hide, delay, rtl),
typeof className !== 'string' && className
)}
{...typeof className === 'string' && { className }}

@@ -62,2 +76,7 @@ onAnimationEnd={closeToast}

/**
* Support rtl content
*/
rtl: PropTypes.bool.isRequired,
/**
* Optional type : info, success ...

@@ -64,0 +83,0 @@ */

@@ -15,3 +15,3 @@ import React, { Component } from 'react';

const styles = {
container: type =>
container: (type, rtl) =>
css({

@@ -36,3 +36,4 @@ position: 'relative',

marginBottom: 0
}
},
direction: rtl ? 'rtl' : 'ltr'
}),

@@ -56,2 +57,3 @@ body: css({

isDocumentHidden: PropTypes.bool.isRequired,
rtl: PropTypes.bool.isRequired,
in: PropTypes.bool,

@@ -79,5 +81,5 @@ onExited: PropTypes.func,

onClose: null,
className: '',
bodyClassName: '',
progressClassName: '',
className: null,
bodyClassName: null,
progressClassName: null,
updateId: null,

@@ -148,3 +150,4 @@ role: 'alert'

updateId,
role
role,
rtl
} = this.props;

@@ -161,5 +164,6 @@

<div
{...(typeof className !== 'string'
? css(styles.container(type), className)
: styles.container(type))}
{...css(
styles.container(type, rtl),
typeof className !== 'string' && className
)}
{...this.getToastProps()}

@@ -169,5 +173,6 @@ >

{...this.props.in && { role: role }}
{...(typeof bodyClassName !== 'string'
? css(styles.body, bodyClassName)
: styles.body)}
{...css(
styles.body,
typeof bodyClassName !== 'string' && bodyClassName
)}
{...typeof bodyClassName === 'string' && {

@@ -183,2 +188,3 @@ className: bodyClassName

key={`pb-${updateId}`}
rtl={rtl}
delay={autoClose}

@@ -185,0 +191,0 @@ isRunning={this.state.isRunning}

@@ -127,3 +127,8 @@ import React, { Component, isValidElement, cloneElement } from 'react';

*/
transition: PropTypes.func
transition: PropTypes.func,
/**
* Support rtl display
*/
rtl: PropTypes.bool
};

@@ -134,2 +139,3 @@

transition: DefaultTransition,
rtl: false,
autoClose: 5000,

@@ -143,5 +149,5 @@ hideProgressBar: false,

style: null,
toastClassName: '',
bodyClassName: '',
progressClassName: ''
toastClassName: null,
bodyClassName: null,
progressClassName: null
};

@@ -237,2 +243,3 @@

updateId: options.updateId,
rtl: this.props.rtl,
position: options.position || this.props.position,

@@ -348,5 +355,6 @@ transition: options.transition || this.props.transition,

<TransitionGroup
{...(typeof className !== 'string'
? css(styles(disablePointer, position), className)
: styles(disablePointer, position))}
{...css(
styles(disablePointer, position),
typeof className !== 'string' && className
)}
{...typeof className === 'string' && { className }}

@@ -353,0 +361,0 @@ {...style !== null && { style }}

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc