react-toastify
Advanced tools
Comparing version 3.4.1 to 3.4.2
@@ -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,right: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}])}); | ||
!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,right: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:"64px",boxSizing:"border-box",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, marginBottom 0.75s",t.style.minHeight=0,t.style.height=e>64?e+"px":"64px",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));o.to.padding=0,o.to.height=0,o.to.marginBottom=0;var 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 |
@@ -42,2 +42,8 @@ 'use strict'; | ||
}, enter)); | ||
// injected to the last state of the animation | ||
exit.to.padding = 0; | ||
exit.to.height = 0; | ||
exit.to.marginBottom = 0; | ||
var exitAnimation = _glamor.css.keyframes(exit); | ||
@@ -68,14 +74,6 @@ | ||
var height = node.getBoundingClientRect().height; | ||
node.style.transition = 'padding 0.75s, height 0.75s, maringBottom 0.75s'; | ||
node.style.transition = 'padding 0.75s, height 0.75s, marginBottom 0.75s'; | ||
node.style.minHeight = 0; | ||
node.style.height = height >= 48 ? height + 'px' : '48px'; | ||
requestAnimationFrame(function () { | ||
node.style.padding = 0; | ||
node.style.height = 0; | ||
node.style.marginBottom = 0; | ||
requestAnimationFrame(function () { | ||
return node.classList.add(exit); | ||
}); | ||
}); | ||
node.style.height = height > 64 ? height + 'px' : '64px'; | ||
node.classList.add(exit); | ||
}; | ||
@@ -82,0 +80,0 @@ |
@@ -49,3 +49,4 @@ 'use strict'; | ||
position: 'relative', | ||
minHeight: '48px', | ||
minHeight: '64px', | ||
boxSizing: 'border-box', | ||
marginBottom: '1rem', | ||
@@ -52,0 +53,0 @@ padding: '8px', |
{ | ||
"name": "react-toastify", | ||
"version": "3.4.1", | ||
"version": "3.4.2", | ||
"description": "React notification made easy", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -911,2 +911,6 @@ # 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) | ||
### V3.4.2 | ||
- Fix exit animation bug | ||
### V3.4.1 | ||
@@ -913,0 +917,0 @@ |
@@ -20,2 +20,8 @@ import React from 'react'; | ||
}); | ||
// injected to the last state of the animation | ||
exit.to.padding = 0; | ||
exit.to.height = 0; | ||
exit.to.marginBottom = 0; | ||
const exitAnimation = css.keyframes(exit); | ||
@@ -35,12 +41,6 @@ | ||
const height = node.getBoundingClientRect().height; | ||
node.style.transition = 'padding 0.75s, height 0.75s, maringBottom 0.75s'; | ||
node.style.transition = 'padding 0.75s, height 0.75s, marginBottom 0.75s'; | ||
node.style.minHeight = 0; | ||
node.style.height = height >= 48 ? height + 'px' : '48px'; | ||
requestAnimationFrame(() => { | ||
node.style.padding = 0; | ||
node.style.height = 0; | ||
node.style.marginBottom = 0; | ||
requestAnimationFrame(() => node.classList.add(exit)); | ||
}); | ||
node.style.height = height > 64 ? height + 'px' : '64px'; | ||
node.classList.add(exit); | ||
}; | ||
@@ -47,0 +47,0 @@ |
@@ -18,3 +18,4 @@ import React, { Component } from 'react'; | ||
position: 'relative', | ||
minHeight: '48px', | ||
minHeight: '64px', | ||
boxSizing: 'border-box', | ||
marginBottom: '1rem', | ||
@@ -21,0 +22,0 @@ padding: '8px', |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
1151
696069
2605