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 1.2.2 to 1.3.0

lib/DefaultCloseButton.js

3

dist/ReactToastify.min.js

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

!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react"),require("react-addons-transition-group")):"function"==typeof define&&define.amd?define(["react","react-addons-transition-group"],e):"object"==typeof exports?exports.ReactToastify=e(require("react"),require("react-addons-transition-group")):t.ReactToastify=e(t.React,t.React.addons.TransitionGroup)}(this,function(t,e){return function(t){function e(o){if(n[o])return n[o].exports;var r=n[o]={exports:{},id:o,loaded:!1};return t[o].call(r.exports,r,r.exports,e),r.loaded=!0,r.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){"use strict";function o(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0}),e.toast=e.ToastContainer=void 0,n(16);var r=n(18),i=o(r),u=n(19),s=o(u);e.ToastContainer=i.default,e.toast=s.default},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={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"},TYPE:{INFO:"info",SUCCESS:"success",WARNING:"warning",ERROR:"error",DEFAULT:"default"},ACTION:{SHOW:"SHOW_TOAST",CLEAR:"CLEAR_TOAST"}}},function(t,e,n){var o=n(27);t.exports=Function.prototype.bind||o},function(t,e){"use strict";var n=Function.prototype.toString,o=/^\s*class /,r=function(t){try{var e=n.call(t),r=e.replace(/\/\/.*\n/g,""),i=r.replace(/\/\*[.\s\S]*\*\//g,""),u=i.replace(/\n/gm," ").replace(/ {2}/g," ");return o.test(u)}catch(t){return!1}},i=function(t){try{return!r(t)&&(n.call(t),!0)}catch(t){return!1}},u=Object.prototype.toString,s="[object Function]",a="[object GeneratorFunction]",l="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;t.exports=function(t){if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;if(l)return i(t);if(r(t))return!1;var e=u.call(t);return e===s||e===a}},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n={eventList:new Map,on:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return this.eventList.has(t)||this.eventList.set(t,[]),this.eventList.get(t).push({callback:e,context:n||this}),this},off:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(null!=t&&null==e)return this.eventList.delete(t);if(null!=t&&null!=e){var n=this.eventList.get(t);return this.eventList.set(t,n.filter(function(t){return!(t.callback===e||t.callback.toString()===e.toString())})),n.length>0||this.eventList.delete(t),!0}return null===t&&null===e&&(this.eventList.clear(),!0)},once:function(t,e,n){this.on(t,e,n);var o=this.eventList.get(t),r=o.length-1;return o[r].once=!0,this},emit:function(t){for(var e=arguments.length,n=Array(e>1?e-1:0),o=1;o<e;o++)n[o-1]=arguments[o];if(!this.eventList.has(t))return console.warn("<"+t+"> Event is not registered. Did you forgot to bind the event ?"),!1;var r=this.eventList.get(t);return this.eventList.set(t,r.filter(function(t){var e;return(e=t.callback).call.apply(e,[t.context].concat(n)),!t.once})),!0}};e.default=n},function(t,e,n){"use strict";var o=n(31),r=n(26),i="function"==typeof Symbol&&"symbol"==typeof Symbol(),u=Object.prototype.toString,s=function(t){return"function"==typeof t&&"[object Function]"===u.call(t)},a=function(){var t={};try{Object.defineProperty(t,"x",{enumerable:!1,value:t});for(var e in t)return!1;return t.x===t}catch(t){return!1}},l=Object.defineProperty&&a(),c=function(t,e,n,o){(!(e in t)||s(o)&&o())&&(l?Object.defineProperty(t,e,{configurable:!0,enumerable:!1,value:n,writable:!0}):t[e]=n)},f=function(t,e){var n=arguments.length>2?arguments[2]:{},u=o(e);i&&(u=u.concat(Object.getOwnPropertySymbols(e))),r(u,function(o){c(t,o,e[o],n[o])})};f.supportsDescriptors=!!l,t.exports=f},function(t,e){var n=Object.prototype.hasOwnProperty;t.exports=Object.assign||function(t,e){for(var o in e)n.call(e,o)&&(t[o]=e[o]);return t}},function(t,e){var n=Number.isNaN||function(t){return t!==t};t.exports=Number.isFinite||function(t){return"number"==typeof t&&!n(t)&&t!==1/0&&t!==-(1/0)}},function(t,e){t.exports=Number.isNaN||function(t){return t!==t}},function(t,e){t.exports=function(t,e){var n=t%e;return Math.floor(n>=0?n:n+e)}},function(t,e){t.exports=function(t){return t>=0?1:-1}},function(t,e){t.exports=function(t){return null===t||"function"!=typeof t&&"object"!=typeof t}},function(t,e,n){var o=n(2);t.exports=o.call(Function.call,Object.prototype.hasOwnProperty)},function(t,e,n){"use strict";var o=n(22),r=n(12),i=n(2),u=i.call(Function.call,Object.prototype.propertyIsEnumerable);t.exports=function(t){var e=o.RequireObjectCoercible(t),n=[];for(var i in e)r(e,i)&&u(e,i)&&n.push(e[i]);return n}},function(t,e,n){"use strict";var o=n(13);t.exports=function(){return"function"==typeof Object.values?Object.values:o}},function(e,n){e.exports=t},function(t,e,n){"use strict";var o=n(33);Object.values||o.shim()},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 u(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)}Object.defineProperty(e,"__esModule",{value:!0});var s=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=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=n(15),c=o(l),f=n(1),p=o(f),y={id:l.PropTypes.number.isRequired,handleCloseBtn:l.PropTypes.func.isRequired,children:l.PropTypes.node.isRequired,autoCloseId:l.PropTypes.number,autoCloseDelay:l.PropTypes.number,handleMouseEnter:l.PropTypes.func,handleMouseLeave:l.PropTypes.func,onOpen:l.PropTypes.func,onClose:l.PropTypes.func,type:l.PropTypes.oneOf(Object.values(p.default.TYPE)),childrenProps:l.PropTypes.object,position:l.PropTypes.oneOf(Object.values(p.default.POSITION))},b={type:p.default.TYPE.DEFAULT,childrenProps:{}},h=function(t){function e(t){r(this,e);var n=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return n.setRef=n.setRef.bind(n),n.ref=null,n}return u(e,t),a(e,[{key:"componentDidMount",value:function(){this.props.onOpen(this.getChildrenProps())}},{key:"componentWillUnmount",value:function(){this.props.onClose(this.getChildrenProps())}},{key:"setRef",value:function(t){this.ref=t}},{key:"getChildrenProps",value:function(){return Object.assign({},this.props.childrenProps,this.props.children.props)}},{key:"getChildren",value:function(){var t=this.props.childrenProps;return l.Children.map(this.props.children,function(e){return(0,l.cloneElement)(e,s({},t,e.props))})}},{key:"getToastProps",value:function(){var t=this.props,e=t.autoCloseId,n=t.autoCloseDelay,o=t.handleMouseEnter,r=t.handleMouseLeave,i={"data-toast-id":this.props.id,className:"toastify-content toastify-content--"+this.props.type,ref:this.setRef};return this.props.autoCloseId&&(i["data-auto-close-id"]=e,i["data-auto-close-delay"]=n,i.onMouseEnter=o,i.onMouseLeave=r),i}},{key:"componentWillEnter",value:function(t){this.ref.classList.add("bounceIn--"+this.props.position,"animated"),t()}},{key:"componentWillLeave",value:function(t){this.ref.classList.remove("bounceIn--"+this.props.position,"animated"),this.ref.classList.add("bounceOut--"+this.props.position,"animated"),setTimeout(function(){return t()},1e3)}},{key:"render",value:function(){return c.default.createElement("div",this.getToastProps(),c.default.createElement("button",{className:"toastify__close",type:"button",onClick:this.props.handleCloseBtn,value:this.props.id},"×"),c.default.createElement("div",{className:"toastify__body"},this.getChildren()))}}]),e}(l.Component);h.defaultProps=b,h.propTypes=y,e.default=h},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,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function u(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(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)}Object.defineProperty(e,"__esModule",{value:!0});var 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="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},f=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}}(),p=n(15),y=o(p),b=n(35),h=o(b),d=n(4),v=o(d),m=n(17),O=o(m),g=n(1),T=o(g),j={position:p.PropTypes.oneOf(Object.values(T.default.POSITION)),autoClose:p.PropTypes.oneOfType([p.PropTypes.bool,p.PropTypes.number]),className:p.PropTypes.string,style:p.PropTypes.object},S={position:T.default.POSITION.TOP_RIGHT,autoClose:5e3},w=function(t){function e(t){u(this,e);var n=s(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return n.state={toast:[]},n.toastId=0,n.collection={},n.handleCloseBtn=n.handleCloseBtn.bind(n),n.handleMouseEnter=n.handleMouseEnter.bind(n),n.handleMouseLeave=n.handleMouseLeave.bind(n),n}return a(e,t),f(e,[{key:"componentDidMount",value:function(){var t=this;v.default.on(T.default.ACTION.SHOW,function(e,n){return t.show(e,n)}).on(T.default.ACTION.CLEAR,function(){return t.clear()})}},{key:"componentWillUnmount",value:function(){v.default.off(T.default.ACTION.SHOW),v.default.off(T.default.ACTION.CLEAR)}},{key:"setAutoClose",value:function(t,e){var n=this;return setTimeout(function(){return n.removeToast(t)},e)}},{key:"isContentValid",value:function(t){return(0,p.isValidElement)(t)}},{key:"isFunction",value:function(t){return!!(t&&t.constructor&&t.call&&t.apply)}},{key:"childrenHasProps",value:function(t){return"object"===("undefined"==typeof t?"undefined":c(t))&&"Object"===t.constructor.name}},{key:"shouldAutoClose",value:function(t){return!!(this.props.autoClose!==!1&&t!==!1||this.props.autoClose===!1&&t!==!1&&null!==t)}},{key:"removeToast",value:function(t){this.setState({toast:this.state.toast.filter(function(e){return e!==parseInt(t,10)})})}},{key:"show",value:function(t,e){if(t="string"==typeof t?y.default.createElement("div",null,t):t,this.isContentValid(t)){var n=++this.toastId,o=e.autoClose,u=function(){},s={id:n,type:e.type,onOpen:this.isFunction(e.onOpen)?e.onOpen:u,onClose:this.isFunction(e.onClose)?e.onClose:u};if(this.childrenHasProps(e.props)&&(s.childrenProps=e.props),this.shouldAutoClose(o)){var a=null!==o?parseInt(o,10):this.props.autoClose;s.autoCloseId=this.setAutoClose(n,a),s.autoCloseDelay=a,s.handleMouseEnter=this.handleMouseEnter,s.handleMouseLeave=this.handleMouseLeave}this.collection=Object.assign({},this.collection,i({},n,this.makeToast(t,s))),this.setState({toast:[].concat(r(this.state.toast),[n])})}}},{key:"makeToast",value:function(t,e){return y.default.createElement(O.default,l({},e,{position:this.props.position,key:"toast-"+e.id+" ",handleCloseBtn:this.handleCloseBtn}),t)}},{key:"clear",value:function(){this.collection={},this.setState({toast:[]})}},{key:"handleCloseBtn",value:function(t){this.removeToast(t.target.value)}},{key:"handleMouseEnter",value:function(t){clearTimeout(t.currentTarget.dataset.autoCloseId)}},{key:"handleMouseLeave",value:function(t){var e=t.currentTarget.dataset,n=e.toastId,o=e.autoCloseDelay;this.state.toast.length>0&&"undefined"!=typeof this.collection[n]&&(this.collection[n]=(0,p.cloneElement)(this.collection[n],{autoCloseId:this.setAutoClose(n,o)}),this.forceUpdate())}},{key:"isObjectEmpty",value:function(){return 0===this.state.toast.length}},{key:"renderProps",value:function(){var t={className:"toastify toastify--"+this.props.position};return this.props.className&&(t.className=t.className+" "+this.props.className),this.props.style&&(t.style=this.props.style),t}},{key:"renderToast",value:function(){var t=this;return Object.keys(this.collection).map(function(e){return t.state.toast.includes(parseInt(e,10))?t.collection[e]:void delete t.collection[e]})}},{key:"render",value:function(){return y.default.createElement("div",this.renderProps(),y.default.createElement(h.default,null,this.isObjectEmpty()?null:this.renderToast()))}}]),e}(p.Component);w.defaultProps=S,w.propTypes=j,e.default=w},function(t,e,n){"use strict";function o(t){return t&&t.__esModule?t:{default:t}}function r(t){return Object.assign({},p,t)}Object.defineProperty(e,"__esModule",{value:!0});var i=n(4),u=o(i),s=n(1),a=o(s),l=a.default.POSITION,c=a.default.TYPE,f=a.default.ACTION,p={type:c.DEFAULT,autoClose:null},y=function(t,e){return u.default.emit(f.SHOW,t,e)};e.default=Object.assign(function(t,e){return y(t,r(e))},{success:function(t,e){return y(t,Object.assign(r(e),{type:c.SUCCESS}))},info:function(t,e){return y(t,Object.assign(r(e),{type:c.INFO}))},warn:function(t,e){return y(t,Object.assign(r(e),{type:c.WARNING}))},error:function(t,e){return y(t,Object.assign(r(e),{type:c.ERROR}))},dismiss:function(){return u.default.emit(f.CLEAR)}},{POSITION:l,TYPE:c})},function(t,e,n){"use strict";var o=n(8),r=n(7),i=n(10),u=n(9),s=n(3),a=n(24),l={ToPrimitive:a,ToBoolean:function(t){return Boolean(t)},ToNumber:function(t){return Number(t)},ToInteger:function(t){var e=this.ToNumber(t);return o(e)?0:0!==e&&r(e)?i(e)*Math.floor(Math.abs(e)):e},ToInt32:function(t){return this.ToNumber(t)>>0},ToUint32:function(t){return this.ToNumber(t)>>>0},ToUint16:function(t){var e=this.ToNumber(t);if(o(e)||0===e||!r(e))return 0;var n=i(e)*Math.floor(Math.abs(e));return u(n,65536)},ToString:function(t){return String(t)},ToObject:function(t){return this.CheckObjectCoercible(t),Object(t)},CheckObjectCoercible:function(t,e){if(null==t)throw new TypeError(e||"Cannot call method on "+t);return t},IsCallable:s,SameValue:function(t,e){return t===e?0!==t||1/t===1/e:o(t)&&o(e)},Type:function(t){return null===t?"Null":"undefined"==typeof t?"Undefined":"function"==typeof t||"object"==typeof t?"Object":"number"==typeof t?"Number":"boolean"==typeof t?"Boolean":"string"==typeof t?"String":void 0}};t.exports=l},function(t,e,n){"use strict";var o=Object.prototype.toString,r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator,i=r?Symbol.prototype.toString:o,u=n(8),s=n(7),a=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,l=n(6),c=n(10),f=n(9),p=n(23),y=n(25),b=parseInt,h=n(2),d=h.call(Function.call,String.prototype.slice),v=h.call(Function.call,RegExp.prototype.test,/^0b[01]+$/i),m=h.call(Function.call,RegExp.prototype.test,/^0o[0-7]+$/i),O=["…","​","￾"].join(""),g=new RegExp("["+O+"]","g"),T=h.call(Function.call,RegExp.prototype.test,g),j=/^[-+]0x[0-9a-f]+$/i,S=h.call(Function.call,RegExp.prototype.test,j),w=["\t\n\v\f\r   ᠎    ","          \u2028","\u2029\ufeff"].join(""),E=new RegExp("(^["+w+"]+)|(["+w+"]+$)","g"),P=h.call(Function.call,String.prototype.replace),C=function(t){return P(t,E,"")},I=n(20),x=n(29),N=l(l({},I),{Call:function(t,e){var n=arguments.length>2?arguments[2]:[];if(!this.IsCallable(t))throw new TypeError(t+" is not a function");return t.apply(e,n)},ToPrimitive:y,ToNumber:function(t){var e=p(t)?t:y(t,"number");if("symbol"==typeof e)throw new TypeError("Cannot convert a Symbol value to a number");if("string"==typeof e){if(v(e))return this.ToNumber(b(d(e,2),2));if(m(e))return this.ToNumber(b(d(e,2),8));if(T(e)||S(e))return NaN;var n=C(e);if(n!==e)return this.ToNumber(n)}return Number(e)},ToInt16:function(t){var e=this.ToUint16(t);return e>=32768?e-65536:e},ToInt8:function(t){var e=this.ToUint8(t);return e>=128?e-256:e},ToUint8:function(t){var e=this.ToNumber(t);if(u(e)||0===e||!s(e))return 0;var n=c(e)*Math.floor(Math.abs(e));return f(n,256)},ToUint8Clamp:function(t){var e=this.ToNumber(t);if(u(e)||e<=0)return 0;if(e>=255)return 255;var n=Math.floor(t);return n+.5<e?n+1:e<n+.5?n:n%2!==0?n+1:n},ToString:function(t){if("symbol"==typeof t)throw new TypeError("Cannot convert a Symbol value to a string");return String(t)},ToObject:function(t){return this.RequireObjectCoercible(t),Object(t)},ToPropertyKey:function(t){var e=this.ToPrimitive(t,String);return"symbol"==typeof e?i.call(e):this.ToString(e)},ToLength:function(t){var e=this.ToInteger(t);return e<=0?0:e>a?a:e},CanonicalNumericIndexString:function(t){if("[object String]"!==o.call(t))throw new TypeError("must be a string");if("-0"===t)return-0;var e=this.ToNumber(t);return this.SameValue(this.ToString(e),t)?e:void 0},RequireObjectCoercible:I.CheckObjectCoercible,IsArray:Array.isArray||function(t){return"[object Array]"===o.call(t)},IsConstructor:function(t){return"function"==typeof t&&!!t.prototype},IsExtensible:function(t){return!Object.preventExtensions||!p(t)&&Object.isExtensible(t)},IsInteger:function(t){if("number"!=typeof t||u(t)||!s(t))return!1;var e=Math.abs(t);return Math.floor(e)===e},IsPropertyKey:function(t){return"string"==typeof t||"symbol"==typeof t},IsRegExp:function(t){if(!t||"object"!=typeof t)return!1;if(r){var e=t[Symbol.match];if("undefined"!=typeof e)return I.ToBoolean(e)}return x(t)},SameValueZero:function(t,e){return t===e||u(t)&&u(e)},GetV:function(t,e){if(!this.IsPropertyKey(e))throw new TypeError("Assertion failed: IsPropertyKey(P) is not true");var n=this.ToObject(t);return n[e]},GetMethod:function(t,e){if(!this.IsPropertyKey(e))throw new TypeError("Assertion failed: IsPropertyKey(P) is not true");var n=this.GetV(t,e);if(null!=n){if(!this.IsCallable(n))throw new TypeError(e+"is not a function");return n}},Get:function(t,e){if("Object"!==this.Type(t))throw new TypeError("Assertion failed: Type(O) is not Object");if(!this.IsPropertyKey(e))throw new TypeError("Assertion failed: IsPropertyKey(P) is not true");return t[e]},Type:function(t){return"symbol"==typeof t?"Symbol":I.Type(t)},SpeciesConstructor:function(t,e){if("Object"!==this.Type(t))throw new TypeError("Assertion failed: Type(O) is not Object");var n=t.constructor;if("undefined"==typeof n)return e;if("Object"!==this.Type(n))throw new TypeError("O.constructor is not an Object");var o=r&&Symbol.species?n[Symbol.species]:void 0;if(null==o)return e;if(this.IsConstructor(o))return o;throw new TypeError("no constructor found")}});delete N.CheckObjectCoercible,t.exports=N},function(t,e,n){"use strict";var o=n(21),r=n(6),i=r(o,{SameValueNonNumber:function(t,e){if("number"==typeof t||typeof t!=typeof e)throw new TypeError("SameValueNonNumber requires two non-number values of the same type.");return this.SameValue(t,e)}});t.exports=i},function(t,e){t.exports=function(t){return null===t||"function"!=typeof t&&"object"!=typeof t}},function(t,e,n){"use strict";var o=Object.prototype.toString,r=n(11),i=n(3),u={"[[DefaultValue]]":function(t,e){var n=e||("[object Date]"===o.call(t)?String:Number);if(n===String||n===Number){var u,s,a=n===String?["toString","valueOf"]:["valueOf","toString"];for(s=0;s<a.length;++s)if(i(t[a[s]])&&(u=t[a[s]](),r(u)))return u;throw new TypeError("No default value")}throw new TypeError("invalid [[DefaultValue]] hint supplied")}};t.exports=function(t,e){return r(t)?t:u["[[DefaultValue]]"](t,e)}},function(t,e,n){"use strict";var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator,r=n(11),i=n(3),u=n(28),s=n(30),a=function(t,e){if("undefined"==typeof t||null===t)throw new TypeError("Cannot call method on "+t);if("string"!=typeof e||"number"!==e&&"string"!==e)throw new TypeError('hint must be "string" or "number"');var n,o,u,s="string"===e?["toString","valueOf"]:["valueOf","toString"];for(u=0;u<s.length;++u)if(n=t[s[u]],i(n)&&(o=n.call(t),r(o)))return o;throw new TypeError("No default value")},l=function(t,e){var n=t[e];if(null!==n&&"undefined"!=typeof n){if(!i(n))throw new TypeError(n+" returned for property "+e+" of object "+t+" is not a function");return n}};t.exports=function(t,e){if(r(t))return t;var n="default";arguments.length>1&&(e===String?n="string":e===Number&&(n="number"));var i;if(o&&(Symbol.toPrimitive?i=l(t,Symbol.toPrimitive):s(t)&&(i=Symbol.prototype.valueOf)),"undefined"!=typeof i){var c=i.call(t,n);if(r(c))return c;throw new TypeError("unable to convert exotic object to primitive")}return"default"===n&&(u(t)||s(t))&&(n="string"),a(t,"default"===n?"number":n)}},function(t,e){var n=Object.prototype.hasOwnProperty,o=Object.prototype.toString;t.exports=function(t,e,r){if("[object Function]"!==o.call(e))throw new TypeError("iterator must be a function");var i=t.length;if(i===+i)for(var u=0;u<i;u++)e.call(r,t[u],u,t);else for(var s in t)n.call(t,s)&&e.call(r,t[s],s,t)}},function(t,e){var n="Function.prototype.bind called on incompatible ",o=Array.prototype.slice,r=Object.prototype.toString,i="[object Function]";t.exports=function(t){var e=this;if("function"!=typeof e||r.call(e)!==i)throw new TypeError(n+e);for(var u,s=o.call(arguments,1),a=function(){if(this instanceof u){var n=e.apply(this,s.concat(o.call(arguments)));return Object(n)===n?n:this}return e.apply(t,s.concat(o.call(arguments)))},l=Math.max(0,e.length-s.length),c=[],f=0;f<l;f++)c.push("$"+f);if(u=Function("binder","return function ("+c.join(",")+"){ return binder.apply(this,arguments); }")(a),e.prototype){var p=function(){};p.prototype=e.prototype,u.prototype=new p,p.prototype=null}return u}},function(t,e){"use strict";var n=Date.prototype.getDay,o=function(t){try{return n.call(t),!0}catch(t){return!1}},r=Object.prototype.toString,i="[object Date]",u="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;t.exports=function(t){return"object"==typeof t&&null!==t&&(u?o(t):r.call(t)===i)}},function(t,e,n){"use strict";var o=n(12),r=RegExp.prototype.exec,i=Object.getOwnPropertyDescriptor,u=function(t){try{var e=t.lastIndex;return t.lastIndex=0,r.call(t),!0}catch(t){return!1}finally{t.lastIndex=e}},s=Object.prototype.toString,a="[object RegExp]",l="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;t.exports=function(t){if(!t||"object"!=typeof t)return!1;if(!l)return s.call(t)===a;var e=i(t,"lastIndex"),n=e&&o(e,"value");return!!n&&u(t)}},function(t,e){"use strict";var n=Object.prototype.toString,o="function"==typeof Symbol&&"symbol"==typeof Symbol();if(o){var r=Symbol.prototype.toString,i=/^Symbol\(.*\)$/,u=function(t){return"symbol"==typeof t.valueOf()&&i.test(r.call(t))};t.exports=function(t){if("symbol"==typeof t)return!0;if("[object Symbol]"!==n.call(t))return!1;try{return u(t)}catch(t){return!1}}}else t.exports=function(t){return!1}},function(t,e,n){"use strict";var o=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Array.prototype.slice,u=n(32),s=Object.prototype.propertyIsEnumerable,a=!s.call({toString:null},"toString"),l=s.call(function(){},"prototype"),c=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],f=function(t){var e=t.constructor;return e&&e.prototype===t},p={$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},y=function(){if("undefined"==typeof window)return!1;for(var t in window)try{if(!p["$"+t]&&o.call(window,t)&&null!==window[t]&&"object"==typeof window[t])try{f(window[t])}catch(t){return!0}}catch(t){return!0}return!1}(),b=function(t){if("undefined"==typeof window||!y)return f(t);try{return f(t)}catch(t){return!1}},h=function(t){var e=null!==t&&"object"==typeof t,n="[object Function]"===r.call(t),i=u(t),s=e&&"[object String]"===r.call(t),f=[];if(!e&&!n&&!i)throw new TypeError("Object.keys called on a non-object");var p=l&&n;if(s&&t.length>0&&!o.call(t,0))for(var y=0;y<t.length;++y)f.push(String(y));if(i&&t.length>0)for(var h=0;h<t.length;++h)f.push(String(h));else for(var d in t)p&&"prototype"===d||!o.call(t,d)||f.push(String(d));if(a)for(var v=b(t),m=0;m<c.length;++m)v&&"constructor"===c[m]||!o.call(t,c[m])||f.push(c[m]);return f};h.shim=function(){if(Object.keys){var t=function(){return 2===(Object.keys(arguments)||"").length}(1,2);if(!t){var e=Object.keys;Object.keys=function(t){return e(u(t)?i.call(t):t)}}}else Object.keys=h;return Object.keys||h},t.exports=h},function(t,e){"use strict";var n=Object.prototype.toString;t.exports=function(t){var e=n.call(t),o="[object Arguments]"===e;return o||(o="[object Array]"!==e&&null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Function]"===n.call(t.callee)),o}},function(t,e,n){"use strict";var o=n(5),r=n(13),i=n(14),u=n(34),s=i();o(s,{getPolyfill:i,implementation:r,shim:u}),t.exports=s},function(t,e,n){"use strict";var o=n(14),r=n(5);t.exports=function(){var t=o();return r(Object,{values:t},{values:function(){return Object.values!==t}}),t}},function(t,n){t.exports=e}])});
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react"),require("react-addons-transition-group")):"function"==typeof define&&define.amd?define(["react","react-addons-transition-group"],e):"object"==typeof exports?exports.ReactToastify=e(require("react"),require("react-addons-transition-group")):t.ReactToastify=e(t.React,t.React.addons.TransitionGroup)}(this,function(t,e){return function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return t[r].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0}),e.toast=e.ToastContainer=void 0,n(23);var o=n(25),i=r(o),u=n(26),a=r(u);e.ToastContainer=i.default,e.toast=a.default},function(t,e){function n(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function o(t){if(s===setTimeout)return setTimeout(t,0);if((s===n||!s)&&setTimeout)return s=setTimeout,setTimeout(t,0);try{return s(t,0)}catch(e){try{return s.call(null,t,0)}catch(e){return s.call(this,t,0)}}}function i(t){if(f===clearTimeout)return clearTimeout(t);if((f===r||!f)&&clearTimeout)return f=clearTimeout,clearTimeout(t);try{return f(t)}catch(e){try{return f.call(null,t)}catch(e){return f.call(this,t)}}}function u(){h&&y&&(h=!1,y.length?d=y.concat(d):b=-1,d.length&&a())}function a(){if(!h){var t=o(u);h=!0;for(var e=d.length;e;){for(y=d,d=[];++b<e;)y&&y[b].run();b=-1,e=d.length}y=null,h=!1,i(t)}}function c(t,e){this.fun=t,this.array=e}function l(){}var s,f,p=t.exports={};!function(){try{s="function"==typeof setTimeout?setTimeout:n}catch(t){s=n}try{f="function"==typeof clearTimeout?clearTimeout:r}catch(t){f=r}}();var y,d=[],h=!1,b=-1;p.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];d.push(new c(t,e)),1!==d.length||h||o(a)},c.prototype.run=function(){this.fun.apply(null,this.array)},p.title="browser",p.browser=!0,p.env={},p.argv=[],p.version="",p.versions={},p.on=l,p.addListener=l,p.once=l,p.off=l,p.removeListener=l,p.removeAllListeners=l,p.emit=l,p.binding=function(t){throw new Error("process.binding is not supported")},p.cwd=function(){return"/"},p.chdir=function(t){throw new Error("process.chdir is not supported")},p.umask=function(){return 0}},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={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"},TYPE:{INFO:"info",SUCCESS:"success",WARNING:"warning",ERROR:"error",DEFAULT:"default"},ACTION:{SHOW:"SHOW_TOAST",CLEAR:"CLEAR_TOAST"}}},function(t,e,n){var r=n(34);t.exports=Function.prototype.bind||r},function(t,e){"use strict";var n=Function.prototype.toString,r=/^\s*class /,o=function(t){try{var e=n.call(t),o=e.replace(/\/\/.*\n/g,""),i=o.replace(/\/\*[.\s\S]*\*\//g,""),u=i.replace(/\n/gm," ").replace(/ {2}/g," ");return r.test(u)}catch(t){return!1}},i=function(t){try{return!o(t)&&(n.call(t),!0)}catch(t){return!1}},u=Object.prototype.toString,a="[object Function]",c="[object GeneratorFunction]",l="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;t.exports=function(t){if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;if(l)return i(t);if(o(t))return!1;var e=u.call(t);return e===a||e===c}},function(t,e,n){function r(t){return"object"==typeof t&&null!==t&&t.$$typeof===i}var o=n(43),i="function"==typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103;t.exports=o(r)},function(e,n){e.exports=t},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n={eventList:new Map,on:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return this.eventList.has(t)||this.eventList.set(t,[]),this.eventList.get(t).push({callback:e,context:n||this}),this},off:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(null!=t&&null==e)return this.eventList.delete(t);if(null!=t&&null!=e){var n=this.eventList.get(t);return this.eventList.set(t,n.filter(function(t){return!(t.callback===e||t.callback.toString()===e.toString())})),n.length>0||this.eventList.delete(t),!0}return null===t&&null===e&&(this.eventList.clear(),!0)},once:function(t,e,n){this.on(t,e,n);var r=this.eventList.get(t),o=r.length-1;return r[o].once=!0,this},emit:function(t){for(var e=arguments.length,n=Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];if(!this.eventList.has(t))return console.warn("<"+t+"> Event is not registered. Did you forgot to bind the event ?"),!1;var o=this.eventList.get(t);return this.eventList.set(t,o.filter(function(t){var e;return(e=t.callback).call.apply(e,[t.context].concat(n)),!t.once})),!0}};e.default=n},function(t,e,n){"use strict";var r=n(38),o=n(33),i="function"==typeof Symbol&&"symbol"==typeof Symbol(),u=Object.prototype.toString,a=function(t){return"function"==typeof t&&"[object Function]"===u.call(t)},c=function(){var t={};try{Object.defineProperty(t,"x",{enumerable:!1,value:t});for(var e in t)return!1;return t.x===t}catch(t){return!1}},l=Object.defineProperty&&c(),s=function(t,e,n,r){(!(e in t)||a(r)&&r())&&(l?Object.defineProperty(t,e,{configurable:!0,enumerable:!1,value:n,writable:!0}):t[e]=n)},f=function(t,e){var n=arguments.length>2?arguments[2]:{},u=r(e);i&&(u=u.concat(Object.getOwnPropertySymbols(e))),o(u,function(r){s(t,r,e[r],n[r])})};f.supportsDescriptors=!!l,t.exports=f},function(t,e){var n=Object.prototype.hasOwnProperty;t.exports=Object.assign||function(t,e){for(var r in e)n.call(e,r)&&(t[r]=e[r]);return t}},function(t,e){var n=Number.isNaN||function(t){return t!==t};t.exports=Number.isFinite||function(t){return"number"==typeof t&&!n(t)&&t!==1/0&&t!==-(1/0)}},function(t,e){t.exports=Number.isNaN||function(t){return t!==t}},function(t,e){t.exports=function(t,e){var n=t%e;return Math.floor(n>=0?n:n+e)}},function(t,e){t.exports=function(t){return t>=0?1:-1}},function(t,e){t.exports=function(t){return null===t||"function"!=typeof t&&"object"!=typeof t}},function(t,e){"use strict";function n(t){return function(){return t}}var r=function(){};r.thatReturns=n,r.thatReturnsFalse=n(!1),r.thatReturnsTrue=n(!0),r.thatReturnsNull=n(null),r.thatReturnsThis=function(){return this},r.thatReturnsArgument=function(t){return t},t.exports=r},function(t,e,n){(function(e){"use strict";function n(t,e,n,o,i,u,a,c){if(r(e),!t){var l;if(void 0===e)l=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var s=[n,o,i,u,a,c],f=0;l=new Error(e.replace(/%s/g,function(){return s[f++]})),l.name="Invariant Violation"}throw l.framesToPop=1,l}}var r=function(t){};"production"!==e.env.NODE_ENV&&(r=function(t){if(void 0===t)throw new Error("invariant requires an error message argument")}),t.exports=n}).call(e,n(1))},function(t,e,n){(function(e){"use strict";var r=n(15),o=r;"production"!==e.env.NODE_ENV&&!function(){var t=function(t){for(var e=arguments.length,n=Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];var o=0,i="Warning: "+t.replace(/%s/g,function(){return n[o++]});"undefined"!=typeof console&&console.error(i);try{throw new Error(i)}catch(t){}};o=function(e,n){if(void 0===n)throw new Error("`warning(condition, format, ...args)` requires a warning message argument");if(0!==n.indexOf("Failed Composite propType: ")&&!e){for(var r=arguments.length,o=Array(r>2?r-2:0),i=2;i<r;i++)o[i-2]=arguments[i];t.apply(void 0,[n].concat(o))}}}(),t.exports=o}).call(e,n(1))},function(t,e,n){var r=n(3);t.exports=r.call(Function.call,Object.prototype.hasOwnProperty)},function(t,e,n){"use strict";var r=n(29),o=n(18),i=n(3),u=i.call(Function.call,Object.prototype.propertyIsEnumerable);t.exports=function(t){var e=r.RequireObjectCoercible(t),n=[];for(var i in e)o(e,i)&&u(e,i)&&n.push(e[i]);return n}},function(t,e,n){"use strict";var r=n(19);t.exports=function(){return"function"==typeof Object.values?Object.values:r}},function(t,e){"use strict";var n="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";t.exports=n},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var o=n(6),i=r(o),u=n(5),a=r(u),c=function(t){var e=t.closeToast;return i.default.createElement("button",{className:"toastify__close",type:"button",onClick:e},"×")};c.propTypes={closeToast:a.default.func},e.default=c},function(t,e,n){"use strict";var r=n(40);Object.values||r.shim()},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(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 u(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)}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),c=n(6),l=r(c),s=n(5),f=r(s),p=n(2),y=r(p),d={id:f.default.number.isRequired,closeButton:f.default.element.isRequired,children:f.default.node.isRequired,autoCloseId:f.default.number,autoCloseDelay:f.default.number,handleMouseEnter:f.default.func,handleMouseLeave:f.default.func,onOpen:f.default.func,onClose:f.default.func,type:f.default.oneOf(Object.values(y.default.TYPE)),position:f.default.oneOf(Object.values(y.default.POSITION))},h={type:y.default.TYPE.DEFAULT},b=function(t){function e(t){o(this,e);var n=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return n.setRef=n.setRef.bind(n),n.ref=null,n}return u(e,t),a(e,[{key:"componentDidMount",value:function(){this.props.onOpen(this.getChildrenProps())}},{key:"componentWillUnmount",value:function(){this.props.onClose(this.getChildrenProps())}},{key:"setRef",value:function(t){this.ref=t}},{key:"getChildrenProps",value:function(){return this.props.children.props}},{key:"getToastProps",value:function(){var t=this.props,e=t.autoCloseId,n=t.autoCloseDelay,r=t.handleMouseEnter,o=t.handleMouseLeave,i={"data-toast-id":this.props.id,className:"toastify-content toastify-content--"+this.props.type,ref:this.setRef};return this.props.autoCloseId&&(i["data-auto-close-id"]=e,i["data-auto-close-delay"]=n,i.onMouseEnter=r,i.onMouseLeave=o),i}},{key:"componentWillEnter",value:function(t){this.ref.classList.add("bounceIn--"+this.props.position,"animated"),t()}},{key:"componentWillLeave",value:function(t){this.ref.classList.remove("bounceIn--"+this.props.position,"animated"),this.ref.classList.add("bounceOut--"+this.props.position,"animated"),setTimeout(function(){return t()},1e3)}},{key:"render",value:function(){return l.default.createElement("div",this.getToastProps(),this.props.closeButton,l.default.createElement("div",{className:"toastify__body"},this.props.children))}}]),e}(c.Component);b.defaultProps=h,b.propTypes=d,e.default=b},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}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)}function i(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function u(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 c(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)}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},s=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},f=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),p=n(6),y=r(p),d=n(5),h=r(d),b=n(44),v=r(b),m=n(7),g=r(m),O=n(24),T=r(O),w=n(22),j=r(w),E=n(2),S=r(E),x={position:h.default.oneOf(Object.values(S.default.POSITION)),autoClose:h.default.oneOfType([h.default.bool,h.default.number]),closeButton:h.default.element,className:h.default.string,style:h.default.object},N={position:S.default.POSITION.TOP_RIGHT,autoClose:5e3,closeButton:null},I=function(t){function e(t){u(this,e);var n=a(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return n.state={toast:[]},n.toastId=0,n.collection={},n.handleMouseEnter=n.handleMouseEnter.bind(n),n.handleMouseLeave=n.handleMouseLeave.bind(n),n}return c(e,t),f(e,[{key:"componentDidMount",value:function(){var t=this;g.default.on(S.default.ACTION.SHOW,function(e,n){return t.show(e,n)}).on(S.default.ACTION.CLEAR,function(){return t.clear()})}},{key:"componentWillUnmount",value:function(){g.default.off(S.default.ACTION.SHOW),g.default.off(S.default.ACTION.CLEAR)}},{key:"setAutoClose",value:function(t,e){var n=this;return setTimeout(function(){return n.removeToast(t)},e)}},{key:"isFunction",value:function(t){return!!(t&&t.constructor&&t.call&&t.apply)}},{key:"shouldAutoClose",value:function(t){return!!(this.props.autoClose!==!1&&t!==!1||this.props.autoClose===!1&&t!==!1&&null!==t)}},{key:"removeToast",value:function(t){this.setState({toast:this.state.toast.filter(function(e){return e!==parseInt(t,10)})})}},{key:"withClose",value:function(t,e){return(0,p.cloneElement)(t,s({},e,t.props))}},{key:"validateCloseButton",value:function(t){if(!(0,p.isValidElement)(t))throw new Error("CloseButton must be a valid react element instead of "+("undefined"==typeof t?"undefined":l(t)))}},{key:"makeCloseButton",value:function(t,e){var n=this,r=y.default.createElement(j.default,null);return null===t&&null!==this.props.closeButton?r=this.props.closeButton:null!==t&&(this.validateCloseButton(t),r=t),this.withClose(r,{closeToast:function(){return n.removeToast(e)}})}},{key:"show",value:function(t,e){if(t="string"==typeof t?y.default.createElement("div",null,t):t,(0,p.isValidElement)(t)){var n=++this.toastId,r=e.autoClose,u=function(){},a={id:n,type:e.type,onOpen:this.isFunction(e.onOpen)?e.onOpen:u,onClose:this.isFunction(e.onClose)?e.onClose:u,closeButton:this.makeCloseButton(e.closeButton,n)};if(this.shouldAutoClose(r)){var c=null!==r?parseInt(r,10):this.props.autoClose;a.autoCloseId=this.setAutoClose(n,c),a.autoCloseDelay=c,a.handleMouseEnter=this.handleMouseEnter,a.handleMouseLeave=this.handleMouseLeave}this.collection=Object.assign({},this.collection,i({},n,this.makeToast(t,a))),this.setState({toast:[].concat(o(this.state.toast),[n])})}}},{key:"makeToast",value:function(t,e){return y.default.createElement(T.default,s({},e,{position:this.props.position,key:"toast-"+e.id+" "}),t)}},{key:"clear",value:function(){this.collection={},this.setState({toast:[]})}},{key:"handleMouseEnter",value:function(t){clearTimeout(t.currentTarget.dataset.autoCloseId)}},{key:"handleMouseLeave",value:function(t){var e=t.currentTarget.dataset,n=e.toastId,r=e.autoCloseDelay;this.state.toast.length>0&&"undefined"!=typeof this.collection[n]&&(this.collection[n]=(0,p.cloneElement)(this.collection[n],{autoCloseId:this.setAutoClose(n,r)}),this.forceUpdate())}},{key:"isObjectEmpty",value:function(){return 0===this.state.toast.length}},{key:"renderProps",value:function(){var t={className:"toastify toastify--"+this.props.position};return this.props.className&&(t.className=t.className+" "+this.props.className),this.props.style&&(t.style=this.props.style),t}},{key:"renderToast",value:function(){var t=this;return Object.keys(this.collection).map(function(e){return t.state.toast.includes(parseInt(e,10))?t.collection[e]:void delete t.collection[e]})}},{key:"render",value:function(){return y.default.createElement("div",this.renderProps(),y.default.createElement(v.default,null,this.isObjectEmpty()?null:this.renderToast()))}}]),e}(p.Component);I.defaultProps=N,I.propTypes=x,e.default=I},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t){return Object.assign({},p,t)}Object.defineProperty(e,"__esModule",{value:!0});var i=n(7),u=r(i),a=n(2),c=r(a),l=c.default.POSITION,s=c.default.TYPE,f=c.default.ACTION,p={type:s.DEFAULT,autoClose:null,closeButton:null},y=function(t,e){return u.default.emit(f.SHOW,t,e)};e.default=Object.assign(function(t,e){return y(t,o(e))},{success:function(t,e){return y(t,Object.assign(o(e),{type:s.SUCCESS}))},info:function(t,e){return y(t,Object.assign(o(e),{type:s.INFO}))},warn:function(t,e){return y(t,Object.assign(o(e),{type:s.WARNING}))},error:function(t,e){return y(t,Object.assign(o(e),{type:s.ERROR}))},dismiss:function(){return u.default.emit(f.CLEAR)}},{POSITION:l,TYPE:s})},function(t,e,n){"use strict";var r=n(11),o=n(10),i=n(13),u=n(12),a=n(4),c=n(31),l={ToPrimitive:c,ToBoolean:function(t){return Boolean(t)},ToNumber:function(t){return Number(t)},ToInteger:function(t){var e=this.ToNumber(t);return r(e)?0:0!==e&&o(e)?i(e)*Math.floor(Math.abs(e)):e},ToInt32:function(t){return this.ToNumber(t)>>0},ToUint32:function(t){return this.ToNumber(t)>>>0},ToUint16:function(t){var e=this.ToNumber(t);if(r(e)||0===e||!o(e))return 0;var n=i(e)*Math.floor(Math.abs(e));return u(n,65536)},ToString:function(t){return String(t)},ToObject:function(t){return this.CheckObjectCoercible(t),Object(t)},CheckObjectCoercible:function(t,e){if(null==t)throw new TypeError(e||"Cannot call method on "+t);return t},IsCallable:a,SameValue:function(t,e){return t===e?0!==t||1/t===1/e:r(t)&&r(e)},Type:function(t){return null===t?"Null":"undefined"==typeof t?"Undefined":"function"==typeof t||"object"==typeof t?"Object":"number"==typeof t?"Number":"boolean"==typeof t?"Boolean":"string"==typeof t?"String":void 0}};t.exports=l},function(t,e,n){"use strict";var r=Object.prototype.toString,o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator,i=o?Symbol.prototype.toString:r,u=n(11),a=n(10),c=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,l=n(9),s=n(13),f=n(12),p=n(30),y=n(32),d=parseInt,h=n(3),b=h.call(Function.call,String.prototype.slice),v=h.call(Function.call,RegExp.prototype.test,/^0b[01]+$/i),m=h.call(Function.call,RegExp.prototype.test,/^0o[0-7]+$/i),g=["…","​","￾"].join(""),O=new RegExp("["+g+"]","g"),T=h.call(Function.call,RegExp.prototype.test,O),w=/^[-+]0x[0-9a-f]+$/i,j=h.call(Function.call,RegExp.prototype.test,w),E=["\t\n\v\f\r   ᠎    ","          \u2028","\u2029\ufeff"].join(""),S=new RegExp("(^["+E+"]+)|(["+E+"]+$)","g"),x=h.call(Function.call,String.prototype.replace),N=function(t){return x(t,S,"")},I=n(27),C=n(36),P=l(l({},I),{Call:function(t,e){var n=arguments.length>2?arguments[2]:[];if(!this.IsCallable(t))throw new TypeError(t+" is not a function");return t.apply(e,n)},ToPrimitive:y,ToNumber:function(t){var e=p(t)?t:y(t,"number");if("symbol"==typeof e)throw new TypeError("Cannot convert a Symbol value to a number");if("string"==typeof e){if(v(e))return this.ToNumber(d(b(e,2),2));if(m(e))return this.ToNumber(d(b(e,2),8));if(T(e)||j(e))return NaN;var n=N(e);if(n!==e)return this.ToNumber(n)}return Number(e)},ToInt16:function(t){var e=this.ToUint16(t);return e>=32768?e-65536:e},ToInt8:function(t){var e=this.ToUint8(t);return e>=128?e-256:e},ToUint8:function(t){var e=this.ToNumber(t);if(u(e)||0===e||!a(e))return 0;var n=s(e)*Math.floor(Math.abs(e));return f(n,256)},ToUint8Clamp:function(t){var e=this.ToNumber(t);if(u(e)||e<=0)return 0;if(e>=255)return 255;var n=Math.floor(t);return n+.5<e?n+1:e<n+.5?n:n%2!==0?n+1:n},ToString:function(t){if("symbol"==typeof t)throw new TypeError("Cannot convert a Symbol value to a string");return String(t)},ToObject:function(t){return this.RequireObjectCoercible(t),Object(t)},ToPropertyKey:function(t){var e=this.ToPrimitive(t,String);return"symbol"==typeof e?i.call(e):this.ToString(e)},ToLength:function(t){var e=this.ToInteger(t);return e<=0?0:e>c?c:e},CanonicalNumericIndexString:function(t){if("[object String]"!==r.call(t))throw new TypeError("must be a string");if("-0"===t)return-0;var e=this.ToNumber(t);return this.SameValue(this.ToString(e),t)?e:void 0},RequireObjectCoercible:I.CheckObjectCoercible,IsArray:Array.isArray||function(t){return"[object Array]"===r.call(t)},IsConstructor:function(t){return"function"==typeof t&&!!t.prototype},IsExtensible:function(t){return!Object.preventExtensions||!p(t)&&Object.isExtensible(t)},IsInteger:function(t){if("number"!=typeof t||u(t)||!a(t))return!1;var e=Math.abs(t);return Math.floor(e)===e},IsPropertyKey:function(t){return"string"==typeof t||"symbol"==typeof t},IsRegExp:function(t){if(!t||"object"!=typeof t)return!1;if(o){var e=t[Symbol.match];if("undefined"!=typeof e)return I.ToBoolean(e)}return C(t)},SameValueZero:function(t,e){return t===e||u(t)&&u(e)},GetV:function(t,e){if(!this.IsPropertyKey(e))throw new TypeError("Assertion failed: IsPropertyKey(P) is not true");var n=this.ToObject(t);return n[e]},GetMethod:function(t,e){if(!this.IsPropertyKey(e))throw new TypeError("Assertion failed: IsPropertyKey(P) is not true");var n=this.GetV(t,e);if(null!=n){if(!this.IsCallable(n))throw new TypeError(e+"is not a function");return n}},Get:function(t,e){if("Object"!==this.Type(t))throw new TypeError("Assertion failed: Type(O) is not Object");if(!this.IsPropertyKey(e))throw new TypeError("Assertion failed: IsPropertyKey(P) is not true");return t[e]},Type:function(t){return"symbol"==typeof t?"Symbol":I.Type(t)},SpeciesConstructor:function(t,e){if("Object"!==this.Type(t))throw new TypeError("Assertion failed: Type(O) is not Object");var n=t.constructor;if("undefined"==typeof n)return e;if("Object"!==this.Type(n))throw new TypeError("O.constructor is not an Object");var r=o&&Symbol.species?n[Symbol.species]:void 0;if(null==r)return e;if(this.IsConstructor(r))return r;throw new TypeError("no constructor found")}});delete P.CheckObjectCoercible,t.exports=P},function(t,e,n){"use strict";var r=n(28),o=n(9),i=o(r,{SameValueNonNumber:function(t,e){if("number"==typeof t||typeof t!=typeof e)throw new TypeError("SameValueNonNumber requires two non-number values of the same type.");return this.SameValue(t,e)}});t.exports=i},function(t,e){t.exports=function(t){return null===t||"function"!=typeof t&&"object"!=typeof t}},function(t,e,n){"use strict";var r=Object.prototype.toString,o=n(14),i=n(4),u={"[[DefaultValue]]":function(t,e){var n=e||("[object Date]"===r.call(t)?String:Number);if(n===String||n===Number){var u,a,c=n===String?["toString","valueOf"]:["valueOf","toString"];for(a=0;a<c.length;++a)if(i(t[c[a]])&&(u=t[c[a]](),o(u)))return u;throw new TypeError("No default value")}throw new TypeError("invalid [[DefaultValue]] hint supplied")}};t.exports=function(t,e){return o(t)?t:u["[[DefaultValue]]"](t,e)}},function(t,e,n){"use strict";var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator,o=n(14),i=n(4),u=n(35),a=n(37),c=function(t,e){if("undefined"==typeof t||null===t)throw new TypeError("Cannot call method on "+t);if("string"!=typeof e||"number"!==e&&"string"!==e)throw new TypeError('hint must be "string" or "number"');var n,r,u,a="string"===e?["toString","valueOf"]:["valueOf","toString"];for(u=0;u<a.length;++u)if(n=t[a[u]],i(n)&&(r=n.call(t),o(r)))return r;throw new TypeError("No default value")},l=function(t,e){var n=t[e];if(null!==n&&"undefined"!=typeof n){if(!i(n))throw new TypeError(n+" returned for property "+e+" of object "+t+" is not a function");return n}};t.exports=function(t,e){if(o(t))return t;var n="default";arguments.length>1&&(e===String?n="string":e===Number&&(n="number"));var i;if(r&&(Symbol.toPrimitive?i=l(t,Symbol.toPrimitive):a(t)&&(i=Symbol.prototype.valueOf)),"undefined"!=typeof i){var s=i.call(t,n);if(o(s))return s;throw new TypeError("unable to convert exotic object to primitive")}return"default"===n&&(u(t)||a(t))&&(n="string"),c(t,"default"===n?"number":n)}},function(t,e){var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString;t.exports=function(t,e,o){if("[object Function]"!==r.call(e))throw new TypeError("iterator must be a function");var i=t.length;if(i===+i)for(var u=0;u<i;u++)e.call(o,t[u],u,t);else for(var a in t)n.call(t,a)&&e.call(o,t[a],a,t)}},function(t,e){var n="Function.prototype.bind called on incompatible ",r=Array.prototype.slice,o=Object.prototype.toString,i="[object Function]";t.exports=function(t){var e=this;if("function"!=typeof e||o.call(e)!==i)throw new TypeError(n+e);for(var u,a=r.call(arguments,1),c=function(){if(this instanceof u){var n=e.apply(this,a.concat(r.call(arguments)));return Object(n)===n?n:this}return e.apply(t,a.concat(r.call(arguments)))},l=Math.max(0,e.length-a.length),s=[],f=0;f<l;f++)s.push("$"+f);if(u=Function("binder","return function ("+s.join(",")+"){ return binder.apply(this,arguments); }")(c),e.prototype){var p=function(){};p.prototype=e.prototype,u.prototype=new p,p.prototype=null}return u}},function(t,e){"use strict";var n=Date.prototype.getDay,r=function(t){try{return n.call(t),!0}catch(t){return!1}},o=Object.prototype.toString,i="[object Date]",u="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;t.exports=function(t){return"object"==typeof t&&null!==t&&(u?r(t):o.call(t)===i)}},function(t,e,n){"use strict";var r=n(18),o=RegExp.prototype.exec,i=Object.getOwnPropertyDescriptor,u=function(t){try{var e=t.lastIndex;return t.lastIndex=0,o.call(t),!0}catch(t){return!1}finally{t.lastIndex=e}},a=Object.prototype.toString,c="[object RegExp]",l="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;t.exports=function(t){if(!t||"object"!=typeof t)return!1;if(!l)return a.call(t)===c;var e=i(t,"lastIndex"),n=e&&r(e,"value");return!!n&&u(t)}},function(t,e){"use strict";var n=Object.prototype.toString,r="function"==typeof Symbol&&"symbol"==typeof Symbol();if(r){var o=Symbol.prototype.toString,i=/^Symbol\(.*\)$/,u=function(t){return"symbol"==typeof t.valueOf()&&i.test(o.call(t))};t.exports=function(t){if("symbol"==typeof t)return!0;if("[object Symbol]"!==n.call(t))return!1;try{return u(t)}catch(t){return!1}}}else t.exports=function(t){return!1}},function(t,e,n){"use strict";var r=Object.prototype.hasOwnProperty,o=Object.prototype.toString,i=Array.prototype.slice,u=n(39),a=Object.prototype.propertyIsEnumerable,c=!a.call({toString:null},"toString"),l=a.call(function(){},"prototype"),s=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],f=function(t){var e=t.constructor;return e&&e.prototype===t},p={$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},y=function(){if("undefined"==typeof window)return!1;for(var t in window)try{if(!p["$"+t]&&r.call(window,t)&&null!==window[t]&&"object"==typeof window[t])try{f(window[t])}catch(t){return!0}}catch(t){return!0}return!1}(),d=function(t){if("undefined"==typeof window||!y)return f(t);try{return f(t)}catch(t){return!1}},h=function(t){var e=null!==t&&"object"==typeof t,n="[object Function]"===o.call(t),i=u(t),a=e&&"[object String]"===o.call(t),f=[];if(!e&&!n&&!i)throw new TypeError("Object.keys called on a non-object");var p=l&&n;if(a&&t.length>0&&!r.call(t,0))for(var y=0;y<t.length;++y)f.push(String(y));if(i&&t.length>0)for(var h=0;h<t.length;++h)f.push(String(h));else for(var b in t)p&&"prototype"===b||!r.call(t,b)||f.push(String(b));if(c)for(var v=d(t),m=0;m<s.length;++m)v&&"constructor"===s[m]||!r.call(t,s[m])||f.push(s[m]);return f};h.shim=function(){if(Object.keys){var t=function(){return 2===(Object.keys(arguments)||"").length}(1,2);if(!t){var e=Object.keys;Object.keys=function(t){return e(u(t)?i.call(t):t)}}}else Object.keys=h;return Object.keys||h},t.exports=h},function(t,e){"use strict";var n=Object.prototype.toString;t.exports=function(t){var e=n.call(t),r="[object Arguments]"===e;return r||(r="[object Array]"!==e&&null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Function]"===n.call(t.callee)),r}},function(t,e,n){"use strict";var r=n(8),o=n(19),i=n(20),u=n(41),a=i();r(a,{getPolyfill:i,implementation:o,shim:u}),t.exports=a},function(t,e,n){"use strict";var r=n(20),o=n(8);t.exports=function(){var t=r();return o(Object,{values:t},{values:function(){return Object.values!==t}}),t}},function(t,e,n){(function(e){"use strict";function r(t,n,r,c,l){if("production"!==e.env.NODE_ENV)for(var s in t)if(t.hasOwnProperty(s)){var f;try{o("function"==typeof t[s],"%s: %s type `%s` is invalid; it must be a function, usually from React.PropTypes.",c||"React class",r,s),f=t[s](n,s,c,r,null,u)}catch(t){f=t}if("production"!==e.env.NODE_ENV?i(!f||f instanceof Error,"%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",c||"React class",r,s,typeof f):void 0,f instanceof Error&&!(f.message in a)){a[f.message]=!0;var p=l?l():"";"production"!==e.env.NODE_ENV?i(!1,"Failed %s type: %s%s",r,f.message,null!=p?p:""):void 0}}}var o=n(16),i=n(17),u=n(21),a={};t.exports=r}).call(e,n(1))},function(t,e,n){(function(e){"use strict";var r=n(15),o=n(16),i=n(17),u=n(21),a=n(42);t.exports=function(t){function n(t){var e=t&&(N&&t[N]||t[I]);if("function"==typeof e)return e}function c(t,e){return t===e?0!==t||1/t===1/e:t!==t&&e!==e}function l(t){this.message=t,this.stack=""}function s(t){function n(n,o,a,c,s,f,p){if(c=c||C,f=f||a,"production"!==e.env.NODE_ENV&&p!==u&&"undefined"!=typeof console){var y=c+":"+a;r[y]||("production"!==e.env.NODE_ENV?i(!1,"You are manually calling a React.PropTypes validation function for the `%s` prop on `%s`. This is deprecated and will not work in production with the next major version. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details.",f,c):void 0,r[y]=!0)}return null==o[a]?n?new l(null===o[a]?"The "+s+" `"+f+"` is marked as required "+("in `"+c+"`, but its value is `null`."):"The "+s+" `"+f+"` is marked as required in "+("`"+c+"`, but its value is `undefined`.")):null:t(o,a,c,s,f)}if("production"!==e.env.NODE_ENV)var r={};var o=n.bind(null,!1);return o.isRequired=n.bind(null,!0),o}function f(t){function e(e,n,r,o,i,u){var a=e[n],c=j(a);if(c!==t){var s=E(a);return new l("Invalid "+o+" `"+i+"` of type "+("`"+s+"` supplied to `"+r+"`, expected ")+("`"+t+"`."))}return null}return s(e)}function p(){return s(r.thatReturnsNull)}function y(t){function e(e,n,r,o,i){if("function"!=typeof t)return new l("Property `"+i+"` of component `"+r+"` has invalid PropType notation inside arrayOf.");var a=e[n];if(!Array.isArray(a)){
var c=j(a);return new l("Invalid "+o+" `"+i+"` of type "+("`"+c+"` supplied to `"+r+"`, expected an array."))}for(var s=0;s<a.length;s++){var f=t(a,s,r,o,i+"["+s+"]",u);if(f instanceof Error)return f}return null}return s(e)}function d(){function e(e,n,r,o,i){var u=e[n];if(!t(u)){var a=j(u);return new l("Invalid "+o+" `"+i+"` of type "+("`"+a+"` supplied to `"+r+"`, expected a single ReactElement."))}return null}return s(e)}function h(t){function e(e,n,r,o,i){if(!(e[n]instanceof t)){var u=t.name||C,a=S(e[n]);return new l("Invalid "+o+" `"+i+"` of type "+("`"+a+"` supplied to `"+r+"`, expected ")+("instance of `"+u+"`."))}return null}return s(e)}function b(t){function n(e,n,r,o,i){for(var u=e[n],a=0;a<t.length;a++)if(c(u,t[a]))return null;var s=JSON.stringify(t);return new l("Invalid "+o+" `"+i+"` of value `"+u+"` "+("supplied to `"+r+"`, expected one of "+s+"."))}return Array.isArray(t)?s(n):("production"!==e.env.NODE_ENV?i(!1,"Invalid argument supplied to oneOf, expected an instance of array."):void 0,r.thatReturnsNull)}function v(t){function e(e,n,r,o,i){if("function"!=typeof t)return new l("Property `"+i+"` of component `"+r+"` has invalid PropType notation inside objectOf.");var a=e[n],c=j(a);if("object"!==c)return new l("Invalid "+o+" `"+i+"` of type "+("`"+c+"` supplied to `"+r+"`, expected an object."));for(var s in a)if(a.hasOwnProperty(s)){var f=t(a,s,r,o,i+"."+s,u);if(f instanceof Error)return f}return null}return s(e)}function m(t){function n(e,n,r,o,i){for(var a=0;a<t.length;a++){var c=t[a];if(null==c(e,n,r,o,i,u))return null}return new l("Invalid "+o+" `"+i+"` supplied to "+("`"+r+"`."))}return Array.isArray(t)?s(n):("production"!==e.env.NODE_ENV?i(!1,"Invalid argument supplied to oneOfType, expected an instance of array."):void 0,r.thatReturnsNull)}function g(){function t(t,e,n,r,o){return T(t[e])?null:new l("Invalid "+r+" `"+o+"` supplied to "+("`"+n+"`, expected a ReactNode."))}return s(t)}function O(t){function e(e,n,r,o,i){var a=e[n],c=j(a);if("object"!==c)return new l("Invalid "+o+" `"+i+"` of type `"+c+"` "+("supplied to `"+r+"`, expected `object`."));for(var s in t){var f=t[s];if(f){var p=f(a,s,r,o,i+"."+s,u);if(p)return p}}return null}return s(e)}function T(e){switch(typeof e){case"number":case"string":case"undefined":return!0;case"boolean":return!e;case"object":if(Array.isArray(e))return e.every(T);if(null===e||t(e))return!0;var r=n(e);if(!r)return!1;var o,i=r.call(e);if(r!==e.entries){for(;!(o=i.next()).done;)if(!T(o.value))return!1}else for(;!(o=i.next()).done;){var u=o.value;if(u&&!T(u[1]))return!1}return!0;default:return!1}}function w(t,e){return"symbol"===t||"Symbol"===e["@@toStringTag"]||"function"==typeof Symbol&&e instanceof Symbol}function j(t){var e=typeof t;return Array.isArray(t)?"array":t instanceof RegExp?"object":w(e,t)?"symbol":e}function E(t){var e=j(t);if("object"===e){if(t instanceof Date)return"date";if(t instanceof RegExp)return"regexp"}return e}function S(t){return t.constructor&&t.constructor.name?t.constructor.name:C}var x,N="function"==typeof Symbol&&Symbol.iterator,I="@@iterator",C="<<anonymous>>";if("production"!==e.env.NODE_ENV)x={array:f("array"),bool:f("boolean"),func:f("function"),number:f("number"),object:f("object"),string:f("string"),symbol:f("symbol"),any:p(),arrayOf:y,element:d(),instanceOf:h,node:g(),objectOf:v,oneOf:b,oneOfType:m,shape:O};else{var P=function(){o(!1,"React.PropTypes type checking code is stripped in production.")};P.isRequired=P;var _=function(){return P};x={array:P,bool:P,func:P,number:P,object:P,string:P,symbol:P,any:P,arrayOf:_,element:P,instanceOf:_,node:P,objectOf:_,oneOf:_,oneOfType:_,shape:_}}return l.prototype=Error.prototype,x.checkPropTypes=a,x.PropTypes=x,x}}).call(e,n(1))},function(t,n){t.exports=e}])});

@@ -7,4 +7,2 @@ 'use strict';

var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();

@@ -16,2 +14,6 @@

var _propTypes = require('prop-types');
var _propTypes2 = _interopRequireDefault(_propTypes);
var _config = require('./config');

@@ -30,19 +32,17 @@

var propTypes = {
id: _react.PropTypes.number.isRequired,
handleCloseBtn: _react.PropTypes.func.isRequired,
children: _react.PropTypes.node.isRequired,
autoCloseId: _react.PropTypes.number,
autoCloseDelay: _react.PropTypes.number,
handleMouseEnter: _react.PropTypes.func,
handleMouseLeave: _react.PropTypes.func,
onOpen: _react.PropTypes.func,
onClose: _react.PropTypes.func,
type: _react.PropTypes.oneOf(Object.values(_config2.default.TYPE)),
childrenProps: _react.PropTypes.object,
position: _react.PropTypes.oneOf(Object.values(_config2.default.POSITION))
id: _propTypes2.default.number.isRequired,
closeButton: _propTypes2.default.element.isRequired,
children: _propTypes2.default.node.isRequired,
autoCloseId: _propTypes2.default.number,
autoCloseDelay: _propTypes2.default.number,
handleMouseEnter: _propTypes2.default.func,
handleMouseLeave: _propTypes2.default.func,
onOpen: _propTypes2.default.func,
onClose: _propTypes2.default.func,
type: _propTypes2.default.oneOf(Object.values(_config2.default.TYPE)),
position: _propTypes2.default.oneOf(Object.values(_config2.default.POSITION))
};
var defaultProps = {
type: _config2.default.TYPE.DEFAULT,
childrenProps: {}
type: _config2.default.TYPE.DEFAULT
};

@@ -81,13 +81,5 @@

value: function getChildrenProps() {
return Object.assign({}, this.props.childrenProps, this.props.children.props);
return this.props.children.props;
}
}, {
key: 'getChildren',
value: function getChildren() {
var props = this.props.childrenProps;
return _react.Children.map(this.props.children, function (child) {
return (0, _react.cloneElement)(child, _extends({}, props, child.props));
});
}
}, {
key: 'getToastProps',

@@ -137,16 +129,7 @@ value: function getToastProps() {

this.getToastProps(),
this.props.closeButton,
_react2.default.createElement(
'button',
{
className: 'toastify__close',
type: 'button',
onClick: this.props.handleCloseBtn,
value: this.props.id
},
'\xD7'
),
_react2.default.createElement(
'div',
{ className: 'toastify__body' },
this.getChildren()
this.props.children
)

@@ -153,0 +136,0 @@ );

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

var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();

@@ -18,2 +18,6 @@

var _propTypes = require('prop-types');
var _propTypes2 = _interopRequireDefault(_propTypes);
var _reactAddonsTransitionGroup = require('react-addons-transition-group');

@@ -31,2 +35,6 @@

var _DefaultCloseButton = require('./DefaultCloseButton');
var _DefaultCloseButton2 = _interopRequireDefault(_DefaultCloseButton);
var _config = require('./config');

@@ -49,6 +57,7 @@

var propTypes = {
position: _react.PropTypes.oneOf(Object.values(_config2.default.POSITION)),
autoClose: _react.PropTypes.oneOfType([_react.PropTypes.bool, _react.PropTypes.number]),
className: _react.PropTypes.string,
style: _react.PropTypes.object
position: _propTypes2.default.oneOf(Object.values(_config2.default.POSITION)),
autoClose: _propTypes2.default.oneOfType([_propTypes2.default.bool, _propTypes2.default.number]),
closeButton: _propTypes2.default.element,
className: _propTypes2.default.string,
style: _propTypes2.default.object
};

@@ -58,3 +67,4 @@

position: _config2.default.POSITION.TOP_RIGHT,
autoClose: 5000
autoClose: 5000,
closeButton: null
};

@@ -75,3 +85,2 @@

_this.collection = {};
_this.handleCloseBtn = _this.handleCloseBtn.bind(_this);
_this.handleMouseEnter = _this.handleMouseEnter.bind(_this);

@@ -109,7 +118,2 @@ _this.handleMouseLeave = _this.handleMouseLeave.bind(_this);

}, {
key: 'isContentValid',
value: function isContentValid(content) {
return (0, _react.isValidElement)(content);
}
}, {
key: 'isFunction',

@@ -120,7 +124,2 @@ value: function isFunction(object) {

}, {
key: 'childrenHasProps',
value: function childrenHasProps(props) {
return (typeof props === 'undefined' ? 'undefined' : _typeof(props)) === 'object' && props.constructor.name === 'Object';
}
}, {
key: 'shouldAutoClose',

@@ -138,2 +137,32 @@ value: function shouldAutoClose(autoCloseOpt) {

}, {
key: 'withClose',
value: function withClose(component, props) {
return (0, _react.cloneElement)(component, _extends({}, props, component.props));
}
}, {
key: 'validateCloseButton',
value: function validateCloseButton(closeButton) {
if (!(0, _react.isValidElement)(closeButton)) {
throw new Error('CloseButton must be a valid react element instead of ' + (typeof closeButton === 'undefined' ? 'undefined' : _typeof(closeButton)));
}
}
}, {
key: 'makeCloseButton',
value: function makeCloseButton(optCloseButton, toastId) {
var _this4 = this;
var closeButton = _react2.default.createElement(_DefaultCloseButton2.default, null);
if (optCloseButton === null && this.props.closeButton !== null) {
closeButton = this.props.closeButton;
} else if (optCloseButton !== null) {
this.validateCloseButton(optCloseButton);
closeButton = optCloseButton;
}
return this.withClose(closeButton, { closeToast: function closeToast() {
return _this4.removeToast(toastId);
} });
}
}, {
key: 'show',

@@ -147,3 +176,3 @@ value: function show(content, options) {

if (this.isContentValid(content)) {
if ((0, _react.isValidElement)(content)) {
var toastId = ++this.toastId;

@@ -156,9 +185,6 @@ var autoCloseOpt = options.autoClose;

onOpen: this.isFunction(options.onOpen) ? options.onOpen : fn,
onClose: this.isFunction(options.onClose) ? options.onClose : fn
onClose: this.isFunction(options.onClose) ? options.onClose : fn,
closeButton: this.makeCloseButton(options.closeButton, toastId)
};
if (this.childrenHasProps(options.props)) {
toastOptions.childrenProps = options.props;
}
if (this.shouldAutoClose(autoCloseOpt)) {

@@ -187,4 +213,3 @@ var delay = autoCloseOpt !== null ? parseInt(autoCloseOpt, 10) : this.props.autoClose;

position: this.props.position,
key: 'toast-' + options.id + ' ',
handleCloseBtn: this.handleCloseBtn
key: 'toast-' + options.id + ' '
}),

@@ -201,7 +226,2 @@ content

}, {
key: 'handleCloseBtn',
value: function handleCloseBtn(e) {
this.removeToast(e.target.value);
}
}, {
key: 'handleMouseEnter',

@@ -251,9 +271,9 @@ value: function handleMouseEnter(e) {

value: function renderToast() {
var _this4 = this;
var _this5 = this;
return Object.keys(this.collection).map(function (idx) {
if (_this4.state.toast.includes(parseInt(idx, 10))) {
return _this4.collection[idx];
if (_this5.state.toast.includes(parseInt(idx, 10))) {
return _this5.collection[idx];
} else {
delete _this4.collection[idx];
delete _this5.collection[idx];
}

@@ -260,0 +280,0 @@ });

@@ -24,3 +24,4 @@ 'use strict';

type: TYPE.DEFAULT,
autoClose: null
autoClose: null,
closeButton: null
};

@@ -27,0 +28,0 @@

{
"name": "react-toastify",
"version": "1.2.2",
"version": "1.3.0",
"description": "React notification made easy",

@@ -37,2 +37,3 @@ "keywords": [

"object.values": "^1.0.3",
"prop-types": "^15.5.6",
"react": "^15.3.2",

@@ -39,0 +40,0 @@ "react-addons-transition-group": "^15.3.2"

@@ -13,2 +13,3 @@ # React Toastify [![npm](https://img.shields.io/npm/dt/react-toastify.svg)]() [![npm](https://img.shields.io/npm/v/react-toastify.svg)]() [![license](https://img.shields.io/github/license/sniphpet/react-toastify.svg?maxAge=2592000)]()

$ npm install --save react-toastify
$ yarn add react-toastify
```

@@ -28,25 +29,7 @@

- Define behavior per toast
- Super easy to style
- Super easy to customize
## Deprecation Notice
Starting v1.2.0 passing props using toast options will be removed. Use the react way instead :
```javascript
toast(<MyComponent foo="bar" foorbar={myFunction} />);
//instead of
toast(<MyComponent />, {
props: {
foo: "bar",
foorbar: myFunction
}
});
```
Thank you for your understanding, God bless you !
## How it works ?
The component use a dead simple pubsub to listen and trigger event. The pubsub allow us to display a toast from everywhere in your app.
The component use a dead simple pubsub(observer pattern) to listen and trigger event. The pubsub allow us to display a toast from everywhere in your app.

@@ -57,3 +40,3 @@ - Add a ToastContainer to your app

import React from 'react';
import { render } from ReactDOM;
import { render } from 'react-dom';
import { ToastContainer } from 'react-toastify';

@@ -83,5 +66,7 @@ import 'react-toastify/dist/ReactToastify.min.css';

import { toast } from 'react-toastify';
const Greet = ({ name }) => <div>Hello {name}</div>
function handleClick() {
toast('Hello', {
toast(<Greet name="John" />, {
type: toast.TYPE.INFO

@@ -108,5 +93,6 @@ });

|style|object|-|Add inline style to the container|
|closeButton|React Element|-|A React Component to replace the default close button|
Position accept the following value :
position accept the following value :
```javascript

@@ -124,3 +110,20 @@ top-right, top-center, top-left, bottom-right, bottom-center, bottom-left

```
When using a custom close button, the component will receive a prop ```closeToast```. You need to call it to close the toast.
```javascript
//The classname toastify__close is used to position the icon on the top right side, you don't need it.
const FontAwesomeCloseButton = ({ closeToast }) => (
<i
className="toastify__close fa fa-times"
onClick={closeToast}
/>
);
...
<ToastContainer autoClose={false} position="top-center" closeButton={<FontAwesomeCloseButton />}/>
...
```
### toast (Type: Object)

@@ -133,5 +136,5 @@

|content|string\|React Element|✓|Element that will be displayed|
|options|object|✘|Possible keys : autoClose, type, props
|options|object|✘|Possible keys : autoClose, type, closeButton
If you pass an autoClose parameter it will overwrite the autoClose behavior defined in the container.
The autoClose and closeButton both take precedence over the container's props.

@@ -145,7 +148,3 @@ ```javascript

autoClose: false, //The user need to close the toast to remove it
// props will be passed to the component displayed by the notification
// Will be removed at the next release. Pass the props directly to the component instead
props: {
foo: 'bar'
},
closeButton: <FontAwesomeCloseButton />,
type: toast.TYPE.INFO

@@ -164,4 +163,13 @@ };

### 1.2.2
### v1.3.0
- PropTypes package update
- Dead code elimination
#### Features
- Possibility to use a custom close button. Check the api docs of ToastContainer and toast.
### v1.2.2
I was storing react component into state which is a bad practice. [What should Go in State](http://web.archive.org/web/20150419023006/http://facebook.github.io/react/docs/interactivity-and-dynamic-uis.html)

@@ -175,9 +183,9 @@ This is no more the case now. The separation of concern between the data and the view is respected.

### 1.2.1
### v1.2.1
#### Bug fix
- Added Object.values polyfill otherwise won't work with IE or EDGE
- Added Object.values polyfill otherwise won't work with IE or EDGE. I ♥ IE.
### 1.1.1
### v1.1.1

@@ -194,3 +202,3 @@ #### Bug fix

### 1.1.0
### v1.1.0

@@ -197,0 +205,0 @@ #### Features

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