{"version":3,"sources":["../node_modules/react-notifications-component/dist/index.js","../ReactNotifications/webpack/bootstrap","../webpack:/ReactNotifications/external {\"commonjs\":\"react\",\"commonjs2\":\"react\",\"amd\":\"react\",\"root\":\"React\"}","../ReactNotifications/node_modules/prop-types/index.js","../ReactNotifications/node_modules/prop-types/factoryWithThrowingShims.js","../ReactNotifications/node_modules/prop-types/lib/ReactPropTypesSecret.js","../ReactNotifications/src/utils/constants.js","../ReactNotifications/src/utils/helpers.js","../ReactNotifications/src/store/index.js","../ReactNotifications/src/utils/timer.js","../ReactNotifications/src/components/Notification.js","../ReactNotifications/src/components/Container.js","../ReactNotifications/src/index.js"],"names":["module","exports","require","installedModules","__webpack_require__","moduleId","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","ReactPropTypesSecret","emptyFunction","emptyFunctionWithReset","resetWarningCache","shim","props","propName","componentName","location","propFullName","secret","err","Error","getShim","isRequired","ReactPropTypes","array","bool","func","number","string","symbol","any","arrayOf","element","elementType","instanceOf","node","objectOf","oneOf","oneOfType","shape","exact","checkPropTypes","PropTypes","NOTIFICATION_BASE_CLASS","CONTAINER","NOTIFICATION_TYPE","REMOVAL","isNull","isBottomContainer","container","isTopContainer","getHtmlClassesForType","type","content","userDefinedTypes","base","NT","foundType","find","q","concat","htmlClasses","getTransition","duration","timingFunction","delay","defaultTransition","transition","transitionOptions","this","types","counter","add","addNotification","options","notification","id","insert","animationIn","animationOut","slidingEnter","slidingExit","touchRevert","touchSlidingExit","dismiss","width","onRemoval","store","toLowerCase","definedTypes","option","defaults","click","touch","onScreen","waitForAnimation","showIcon","keys","forEach","prop","touchExit","swipe","fade","parseNotification","removeNotification","register","callback","timerId","start","remaining","pause","clearTimeout","Date","now","resume","setTimeout","clear","Notification","rootElementRef","React","createRef","onClick","onTouchStart","onTouchMove","onTouchEnd","onMouseEnter","onMouseLeave","state","parentStyle","height","overflow","htmlClassList","animationPlayState","touchEnabled","timer","count","scrollHeight","current","willSlide","onTransitionEnd","Timer","setState","requestAnimationFrame","prevState","removed","removalFlag","toggleRemoval","onAnimationEnd","pageX","touches","startX","currentX","position","distance","offsetWidth","swipeTo","window","innerWidth","left","diffX","Math","abs","t1","t2","opacity","style","animationName","animationDuration","animationTimingFunction","animationFillMode","animationDelay","className","CustomContent","pauseOnHover","hasMouseEvents","join","isValidElement","title","message","renderTimer","ref","renderCustomContent","renderNotification","Component","propTypes","Container","isMobile","breakpoint","notifications","remove","handleResize","addEventListener","removeEventListener","map","filter","length","mobileNotifications","top","bottom","push","renderNotifications","items","topLeft","topRight","topCenter","bottomLeft","bottomRight","bottomCenter","center","renderMobileNotifications","renderScreenNotifications","defaultProps"],"mappings":"kHAAiDA,EAAOC,QAAQC,EAAQ,O,2CCCtE,IAAIC,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUJ,QAGnC,IAAID,EAASG,EAAiBE,GAAY,CACzCC,EAAGD,EACHE,KACAN,QAAS,IAUV,OANAO,EAAQH,GAAUI,KAAKT,EAAOC,QAASD,EAAQA,EAAOC,QAASG,GAG/DJ,EAAOO,KAGAP,EAAOC,QA0Df,OArDAG,EAAoBM,EAAIF,EAGxBJ,EAAoBO,EAAIR,EAGxBC,EAAoBQ,EAAI,SAASX,EAASY,EAAMC,GAC3CV,EAAoBW,EAAEd,EAASY,IAClCG,OAAOC,eAAehB,EAASY,EAAM,CAAEK,cAAkBC,IAAKL,KAKhEV,EAAoBgB,EAAI,SAASnB,GACX,oBAAXoB,QAA0BA,OAAOC,aAC1CN,OAAOC,eAAehB,EAASoB,OAAOC,YAAa,CAAEC,MAAO,WAE7DP,OAAOC,eAAehB,EAAS,aAAc,CAAEsB,YAQhDnB,EAAoBoB,EAAI,SAASD,EAAOE,GAEvC,GADU,EAAPA,IAAUF,EAAQnB,EAAoBmB,IAC/B,EAAP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AAoBC,EAAMM,cAC9CC,EAAS3I,KAAKmI,oBAAoBC,EAAMO,QAE9C,OACE,yBAAKpI,GAAIA,EAAI7E,IAAI,SAAS4K,UAAS,kCAA6BA,GAAa,KAC3E,yBAAKA,UAAU,mCAAmC+B,GAClD,yBAAK/B,UAAU,oCAAoCgC,GACnD,yBAAKhC,UAAU,sCAAsCkC,GACrD,yBAAKlC,UAAU,uCAAuCmC,GACtD,yBAAKnC,UAAU,qCAAqCiC,GACpD,yBAAKjC,UAAU,iCACb,yBAAKA,UAAU,gBAAgBqC,IAEjC,yBAAKrC,UAAU,wCAAwCoC,M,+BAKpD,IACCrB,EAAarH,KAAKxD,MAAlB6K,SADD,EAEuBrH,KAAK0D,MAA3B1C,EAFD,EAECA,MAAOsG,EAFR,EAEQA,WAEf,OAAID,GAAYrG,GAASsG,EAChBtH,KAAK4I,0BAA0B5I,KAAKxD,OAGtCwD,KAAK6I,0BAA0B7I,KAAKxD,Y,oBA/IvB0G,IAAMgE,WAAxBE,EAgBGD,UAAY,CACjBE,SAAUhJ,IAAUjB,KACpBkK,WAAYjJ,IAAUf,OACtB2C,MAAO5B,IAAUlB,OAnBfiK,EAsBG0B,aAAe,CACpBzB,YACAC,WAAY,KA2HDF,QCtJAxI,gB","file":"static/js/14.chunk.js?hash=24e907d8","sourcesContent":["\"use strict\";\"production\"===process.env.NODE_ENV?module.exports=require(\"./js/react-notifications.prod.js\"):module.exports=require(\"./js/react-notifications.dev.js\");"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 5);\n","module.exports = require(\"react\");","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nif (process.env.NODE_ENV !== 'production') {\n var ReactIs = require('react-is');\n\n // By explicitly using `prop-types` you are opting into new development behavior.\n // http://fb.me/prop-types-in-prod\n var throwOnDirectAccess = true;\n module.exports = require('./factoryWithTypeCheckers')(ReactIs.isElement, throwOnDirectAccess);\n} else {\n // By explicitly using `prop-types` you are opting into new production behavior.\n // http://fb.me/prop-types-in-prod\n module.exports = require('./factoryWithThrowingShims')();\n}\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nvar ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');\n\nfunction emptyFunction() {}\nfunction emptyFunctionWithReset() {}\nemptyFunctionWithReset.resetWarningCache = emptyFunction;\n\nmodule.exports = function() {\n function shim(props, propName, componentName, location, propFullName, secret) {\n if (secret === ReactPropTypesSecret) {\n // It is still safe when called from React.\n return;\n }\n var err = new Error(\n 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n 'Use PropTypes.checkPropTypes() to call them. ' +\n 'Read more at http://fb.me/use-check-prop-types'\n );\n err.name = 'Invariant Violation';\n throw err;\n };\n shim.isRequired = shim;\n function getShim() {\n return shim;\n };\n // Important!\n // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.\n var ReactPropTypes = {\n array: shim,\n bool: shim,\n func: shim,\n number: shim,\n object: shim,\n string: shim,\n symbol: shim,\n\n any: shim,\n arrayOf: getShim,\n element: shim,\n elementType: shim,\n instanceOf: getShim,\n node: shim,\n objectOf: getShim,\n oneOf: getShim,\n oneOfType: getShim,\n shape: getShim,\n exact: getShim,\n\n checkPropTypes: emptyFunctionWithReset,\n resetWarningCache: emptyFunction\n };\n\n ReactPropTypes.PropTypes = ReactPropTypes;\n\n return ReactPropTypes;\n};\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nvar ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';\n\nmodule.exports = ReactPropTypesSecret;\n","export const NOTIFICATION_BASE_CLASS = 'notification-item';\r\n\r\nexport const CONTAINER = {\r\n BOTTOM_LEFT: 'bottom-left',\r\n BOTTOM_RIGHT: 'bottom-right',\r\n BOTTOM_CENTER: 'bottom-center',\r\n TOP_LEFT: 'top-left',\r\n TOP_RIGHT: 'top-right',\r\n TOP_CENTER: 'top-center',\r\n CENTER: 'center'\r\n};\r\n\r\nexport const INSERTION = {\r\n TOP: 'top',\r\n BOTTOM: 'bottom'\r\n};\r\n\r\nexport const NOTIFICATION_TYPE = {\r\n SUCCESS: 'success',\r\n DANGER: 'danger',\r\n INFO: 'info',\r\n DEFAULT: 'default',\r\n WARNING: 'warning'\r\n};\r\n\r\nexport const REMOVAL = {\r\n TIMEOUT: 'timeout',\r\n CLICK: 'click',\r\n TOUCH: 'touch',\r\n MANUAL: 'manual'\r\n};\r\n\r\nexport const ERROR = {\r\n ANIMATION_IN: 'Validation error. `animationIn` option must be an array',\r\n ANIMATION_OUT: 'Validation error. `animationOut` option must be an array',\r\n\r\n DISMISS_REQUIRED: 'Validation error. `duration` property of `dismiss` option is required',\r\n DISMISS_NUMBER: 'Validation error. `duration` property of `dismiss` option must be a Number',\r\n DISMISS_POSITIVE:\r\n 'Validation error. `duration` property of `dismiss` option must be a positive Number',\r\n DISMISS_CLICK_BOOL: 'Validation error. `click` property of `dismiss` option must be a Boolean',\r\n DISMISS_TOUCH_BOOL: 'Validation error. `touch` property of `dismiss` option must be a Boolean',\r\n DISMISS_WAIT:\r\n 'Validation error. `waitForAnimation` property of `dismiss` option must be a Boolean',\r\n DISMISS_PAUSE_BOOL:\r\n 'Validation error. `pauseOnHover` property of `dismiss` option must be a Boolean',\r\n DISMISS_ONSCREEN_BOOL:\r\n 'Validation error. `onScreen` property of `dismiss` option must be a Boolean',\r\n DISMISS_ICON: 'Validation error. `showIcon` property of `dismiss` option must be a Boolean',\r\n\r\n TITLE_STRING: 'Validation error. `title` option must be a String',\r\n TITLE_ELEMENT: 'Validation error. `title` option must be a valid React element/function',\r\n\r\n MESSAGE_REQUIRED: 'Validation error. `message` option is required',\r\n MESSAGE_STRING: 'Validation error. `message` option must be a String',\r\n MESSAGE_ELEMENT: 'Validation error. `message` option must be a valid React element/function',\r\n\r\n TYPE_REQUIRED: 'Validation error. `type` option is required',\r\n TYPE_STRING: 'Validation error. `type` option must be a String',\r\n TYPE_NOT_EXISTENT: 'Validation error. `type` option not found',\r\n\r\n CONTAINER_REQUIRED: 'Validation error. `container` option is required',\r\n CONTAINER_STRING: 'Validation error. `container` option must be a String',\r\n CONTENT_INVALID:\r\n 'Validation error. `content` option must be a valid React component/function/element',\r\n \r\n WIDTH_NUMBER: 'Validation error. `width` option must be a Number',\r\n INSERT_STRING: 'Validation error. `insert` option must be a String',\r\n\r\n TRANSITION_DURATION_NUMBER:\r\n 'Validation error. `duration` property of `transition` option must be a Number',\r\n TRANSITION_TIMING_FUNCTION:\r\n 'Validation error. `timingFunction` property of `transition` option must be a String',\r\n TRANSITION_DELAY_NUMBER:\r\n 'Validation error. `delay` property of `transition` option must be a Number',\r\n \r\n TYPE_NOT_FOUND: 'Validation error. Custom type not found',\r\n REMOVAL_FUNC: 'Validation error. `onRemoval` must be a function'\r\n};\r\n","import store from '../store';\r\nimport {\r\n CONTAINER,\r\n INSERTION,\r\n NOTIFICATION_BASE_CLASS,\r\n NOTIFICATION_TYPE as NT\r\n} from './constants';\r\n\r\nconst isNull = object => object === null || object === undefined;\r\n\r\nexport function isBottomContainer(container) {\r\n return (\r\n container === CONTAINER.BOTTOM_LEFT ||\r\n container === CONTAINER.BOTTOM_RIGHT ||\r\n container === CONTAINER.BOTTOM_CENTER\r\n );\r\n}\r\n\r\nexport function isTopContainer(container) {\r\n return (\r\n container === CONTAINER.TOP_LEFT ||\r\n container === CONTAINER.TOP_RIGHT ||\r\n container === CONTAINER.TOP_CENTER\r\n );\r\n}\r\n\r\nexport function hasFullySwiped(diffX, width) {\r\n const swipeLength = Math.abs(diffX);\r\n const requiredSwipeLength = (40 / 100) * width;\r\n return swipeLength >= requiredSwipeLength;\r\n}\r\n\r\nexport function shouldNotificationHaveSliding(notification, count) {\r\n if (count <= 1) return false;\r\n\r\n return (\r\n count > 1 &&\r\n ((notification.insert === INSERTION.TOP && isTopContainer(notification.container)) ||\r\n (notification.insert === INSERTION.BOTTOM && isBottomContainer(notification.container)) ||\r\n notification.container === CONTAINER.CENTER)\r\n );\r\n}\r\n\r\nexport function htmlClassesForExistingType(type) {\r\n switch (type) {\r\n case NT.DEFAULT:\r\n return [NOTIFICATION_BASE_CLASS, 'notification-default'];\r\n case NT.SUCCESS:\r\n return [NOTIFICATION_BASE_CLASS, 'notification-success'];\r\n case NT.DANGER:\r\n return [NOTIFICATION_BASE_CLASS, 'notification-danger'];\r\n case NT.WARNING:\r\n return [NOTIFICATION_BASE_CLASS, 'notification-warning'];\r\n case NT.INFO:\r\n return [NOTIFICATION_BASE_CLASS, 'notification-info'];\r\n default:\r\n return [NOTIFICATION_BASE_CLASS];\r\n }\r\n}\r\n\r\nexport function getHtmlClassesForType({ type, content, userDefinedTypes }) {\r\n const base = [NOTIFICATION_BASE_CLASS];\r\n if (content) return base;\r\n\r\n if (isNull(userDefinedTypes)) {\r\n return htmlClassesForExistingType(type);\r\n }\r\n\r\n const foundType = userDefinedTypes.find(q => q.name === type);\r\n return base.concat(foundType.htmlClasses);\r\n}\r\n\r\nexport function getNotificationsForMobileView(notifications) {\r\n const top = [];\r\n const bottom = [];\r\n\r\n notifications.forEach(notification => {\r\n const { container } = notification;\r\n const { CENTER } = CONTAINER;\r\n\r\n if (isTopContainer(container) || container === CENTER) {\r\n top.push(notification);\r\n } else if (isBottomContainer(container)) {\r\n bottom.push(notification);\r\n }\r\n });\r\n\r\n return { top, bottom };\r\n}\r\n\r\nexport function getNotificationsForEachContainer(notifications) {\r\n const topLeft = [];\r\n const topRight = [];\r\n const topCenter = [];\r\n const bottomLeft = [];\r\n const bottomRight = [];\r\n const bottomCenter = [];\r\n const center = [];\r\n\r\n notifications.forEach(notification => {\r\n const { container } = notification;\r\n if (container === CONTAINER.TOP_LEFT) {\r\n topLeft.push(notification);\r\n } else if (container === CONTAINER.TOP_RIGHT) {\r\n topRight.push(notification);\r\n } else if (container === CONTAINER.TOP_CENTER) {\r\n topCenter.push(notification);\r\n } else if (container === CONTAINER.BOTTOM_LEFT) {\r\n bottomLeft.push(notification);\r\n } else if (container === CONTAINER.BOTTOM_RIGHT) {\r\n bottomRight.push(notification);\r\n } else if (container === CONTAINER.BOTTOM_CENTER) {\r\n bottomCenter.push(notification);\r\n } else if (container === CONTAINER.CENTER) {\r\n center.push(notification);\r\n }\r\n });\r\n\r\n return {\r\n topLeft,\r\n topRight,\r\n topCenter,\r\n bottomLeft,\r\n bottomRight,\r\n bottomCenter,\r\n center\r\n };\r\n}\r\n\r\nexport function getTransition({ duration, timingFunction, delay }, property) {\r\n return `${duration}ms ${property} ${timingFunction} ${delay}ms`;\r\n}\r\n\r\nfunction defaultTransition(transition, { duration, timingFunction, delay }) {\r\n const transitionOptions = transition || {};\r\n\r\n if (isNull(transitionOptions.duration)) {\r\n transitionOptions.duration = duration;\r\n }\r\n\r\n if (isNull(transitionOptions.timingFunction)) {\r\n transitionOptions.timingFunction = timingFunction;\r\n }\r\n\r\n if (isNull(transitionOptions.delay)) {\r\n transitionOptions.delay = delay;\r\n }\r\n\r\n return transitionOptions;\r\n}\r\n\r\nfunction defaultDismiss(dismiss) {\r\n const option = dismiss;\r\n const defaults = {\r\n duration: 0,\r\n click: true,\r\n touch: true,\r\n onScreen: false,\r\n waitForAnimation: false,\r\n showIcon: false\r\n };\r\n\r\n if (!option) {\r\n return defaults;\r\n }\r\n\r\n Object.keys(defaults).forEach(prop => {\r\n if (isNull(option[prop])) {\r\n option[prop] = defaults[prop];\r\n }\r\n });\r\n\r\n return option;\r\n}\r\n\r\nfunction defaultUserDefinedTypes({ content, type }, definedTypes) {\r\n if (content) return undefined;\r\n\r\n if (\r\n type === NT.SUCCESS ||\r\n type === NT.DANGER ||\r\n type === NT.INFO ||\r\n type === NT.DEFAULT ||\r\n type === NT.WARNING ||\r\n !definedTypes\r\n )\r\n return undefined;\r\n\r\n return definedTypes;\r\n}\r\n\r\nexport function parseNotification(options, userDefinedTypes) {\r\n const notification = options;\r\n const {\r\n id,\r\n type,\r\n insert,\r\n content,\r\n container,\r\n animationIn,\r\n animationOut,\r\n slidingEnter,\r\n slidingExit,\r\n touchRevert,\r\n touchSlidingExit,\r\n dismiss,\r\n width,\r\n onRemoval\r\n } = notification;\r\n\r\n notification.id = id || store.counter;\r\n notification.type = content ? null : type.toLowerCase();\r\n\r\n if (userDefinedTypes && !content) {\r\n notification.userDefinedTypes = defaultUserDefinedTypes(notification, userDefinedTypes);\r\n }\r\n\r\n if (!isNull(width)) {\r\n notification.width = width;\r\n }\r\n\r\n notification.container = container.toLowerCase();\r\n notification.insert = (insert || 'top').toLowerCase();\r\n notification.dismiss = defaultDismiss(dismiss);\r\n notification.animationIn = animationIn || [];\r\n notification.animationOut = animationOut || [];\r\n notification.onRemoval = onRemoval || (() => {});\r\n\r\n const t = (duration, timingFunction, delay) => ({\r\n duration,\r\n timingFunction,\r\n delay\r\n });\r\n\r\n notification.slidingEnter = defaultTransition(slidingEnter, t(600, 'linear', 0));\r\n notification.slidingExit = defaultTransition(slidingExit, t(600, 'linear', 0));\r\n notification.touchRevert = defaultTransition(touchRevert, t(600, 'linear', 0));\r\n\r\n const touchExit = touchSlidingExit || {};\r\n const { swipe, fade } = touchExit;\r\n notification.touchSlidingExit = touchExit;\r\n notification.touchSlidingExit.swipe = defaultTransition(swipe || {}, t(600, 'linear', 0));\r\n notification.touchSlidingExit.fade = defaultTransition(fade || {}, t(300, 'linear', 0));\r\n\r\n return notification;\r\n}\r\n","import { parseNotification } from '../utils/helpers';\r\nimport { validateTransition, validators } from '../utils/validators';\r\n\r\nfunction Store() {\r\n this.types = null;\r\n this.counter = 0;\r\n this.add = () => {};\r\n\r\n this.addNotification = notification => {\r\n const { types } = this;\r\n\r\n if (process.env.NODE_ENV === 'development') {\r\n const transitions = ['slidingEnter', 'slidingExit', 'touchRevert', 'touchSlidingExit'];\r\n transitions.forEach(transition => validateTransition(notification, transition));\r\n validators.forEach(validator => validator(notification, types));\r\n }\r\n\r\n this.counter += 1;\r\n return this.add(parseNotification(notification, types));\r\n };\r\n\r\n this.removeNotification = () => {};\r\n this.register = ({ addNotification, removeNotification, types }) => {\r\n this.add = addNotification;\r\n this.removeNotification = removeNotification;\r\n this.types = types;\r\n };\r\n\r\n return this;\r\n}\r\n\r\nexport default new Store();\r\n","export default function(callback, delay) {\r\n let timerId;\r\n let start;\r\n let remaining = delay;\r\n\r\n this.pause = function() {\r\n clearTimeout(timerId);\r\n remaining -= Date.now() - start;\r\n };\r\n\r\n this.resume = function() {\r\n start = Date.now();\r\n clearTimeout(timerId);\r\n timerId = setTimeout(callback, remaining);\r\n };\r\n\r\n this.clear = function() {\r\n clearTimeout(timerId);\r\n };\r\n\r\n this.resume();\r\n}\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport Timer from '../utils/timer';\r\nimport {\r\n getTransition,\r\n hasFullySwiped,\r\n getHtmlClassesForType,\r\n shouldNotificationHaveSliding\r\n} from '../utils/helpers';\r\nimport { REMOVAL } from '../utils/constants';\r\n\r\nclass Notification extends React.Component {\r\n constructor(props) {\r\n super(props);\r\n this.rootElementRef = React.createRef();\r\n this.onClick = this.onClick.bind(this);\r\n this.onTouchStart = this.onTouchStart.bind(this);\r\n this.onTouchMove = this.onTouchMove.bind(this);\r\n this.onTouchEnd = this.onTouchEnd.bind(this);\r\n this.onMouseEnter = this.onMouseEnter.bind(this);\r\n this.onMouseLeave = this.onMouseLeave.bind(this);\r\n\r\n const { notification: { width } } = props;\r\n\r\n this.state = {\r\n parentStyle: {\r\n height: 0,\r\n overflow: 'hidden',\r\n width: width ? `${width}px` : '100%'\r\n },\r\n htmlClassList: getHtmlClassesForType(props.notification),\r\n animationPlayState: 'running',\r\n touchEnabled: true\r\n };\r\n }\r\n\r\n static propTypes = {\r\n toggleRemoval: PropTypes.func.isRequired,\r\n count: PropTypes.number.isRequired,\r\n removed: PropTypes.bool\r\n };\r\n\r\n componentWillUnmount() {\r\n if (this.timer) {\r\n this.timer.clear();\r\n }\r\n }\r\n\r\n componentDidMount() {\r\n const { notification, count } = this.props;\r\n const { dismiss: { duration, onScreen } } = notification;\r\n const { scrollHeight } = this.rootElementRef.current;\r\n const willSlide = shouldNotificationHaveSliding(notification, count);\r\n\r\n const onTransitionEnd = () => {\r\n if (!duration || onScreen) return;\r\n const callback = () => this.removeNotification(REMOVAL.TIMEOUT);\r\n this.timer = new Timer(callback, duration);\r\n };\r\n\r\n const callback = () => {\r\n requestAnimationFrame(() => {\r\n this.setState(prevState => ({\r\n htmlClassList: [...notification.animationIn, ...prevState.htmlClassList]\r\n }));\r\n });\r\n };\r\n\r\n this.setState(\r\n ({ parentStyle: { width } }) => ({\r\n parentStyle: {\r\n width,\r\n height: `${scrollHeight}px`,\r\n transition: willSlide ? getTransition(notification.slidingEnter, 'height') : '10ms height'\r\n },\r\n onTransitionEnd\r\n }),\r\n callback\r\n );\r\n }\r\n\r\n componentDidUpdate({ removed }) {\r\n if (this.props.removed && !removed) {\r\n this.removeNotification(REMOVAL.MANUAL);\r\n }\r\n }\r\n\r\n removeNotification(removalFlag) {\r\n const { notification, toggleRemoval } = this.props;\r\n const {\r\n id,\r\n onRemoval,\r\n dismiss: { waitForAnimation }\r\n } = notification;\r\n const htmlClassList = [...notification.animationOut, ...getHtmlClassesForType(notification)];\r\n\r\n const onTransitionEnd = () => toggleRemoval(id, () => onRemoval(id, removalFlag));\r\n const parentStyle = {\r\n height: 0,\r\n transition: getTransition(notification.slidingExit, 'height')\r\n };\r\n\r\n if (waitForAnimation) {\r\n return this.setState(({ parentStyle: { width } }) => ({\r\n htmlClassList,\r\n onAnimationEnd: () => {\r\n this.setState({\r\n parentStyle: {\r\n width,\r\n ...parentStyle\r\n },\r\n onTransitionEnd\r\n });\r\n }\r\n }));\r\n }\r\n\r\n return this.setState(({ parentStyle: { width } }) => ({\r\n parentStyle: {\r\n width,\r\n ...parentStyle\r\n },\r\n onTransitionEnd,\r\n htmlClassList\r\n }));\r\n }\r\n\r\n onClick() {\r\n const {\r\n notification: { dismiss }\r\n } = this.props;\r\n if (dismiss.click || dismiss.showIcon) {\r\n this.removeNotification(REMOVAL.CLICK);\r\n }\r\n }\r\n\r\n onTouchStart({ touches }) {\r\n const [{ pageX }] = touches;\r\n this.setState(({ parentStyle }) => ({\r\n startX: pageX,\r\n currentX: pageX,\r\n parentStyle: {\r\n ...parentStyle,\r\n position: 'relative'\r\n }\r\n }));\r\n }\r\n\r\n onTouchMove({ touches }) {\r\n const { startX } = this.state;\r\n const {\r\n toggleRemoval,\r\n notification: {\r\n id,\r\n onRemoval,\r\n slidingExit,\r\n touchSlidingExit: { swipe, fade }\r\n }\r\n } = this.props;\r\n\r\n const [{ pageX }] = touches;\r\n const distance = pageX - startX;\r\n const { offsetWidth: width } = this.rootElementRef.current;\r\n const swipeTo = window.innerWidth + width;\r\n const left = `${pageX - startX >= 0 ? swipeTo : -swipeTo}px`;\r\n\r\n if (hasFullySwiped(distance, width)) {\r\n const t1 = getTransition(swipe, 'left');\r\n const t2 = getTransition(fade, 'opacity');\r\n const onTransitionEnd = () => {\r\n toggleRemoval(id, () => onRemoval(id, REMOVAL.TOUCH));\r\n };\r\n\r\n return this.setState(({ parentStyle }) => ({\r\n touchEnabled: false,\r\n parentStyle: {\r\n ...parentStyle,\r\n left,\r\n opacity: 0,\r\n transition: `${t1}, ${t2}`\r\n },\r\n onTransitionEnd: () => {\r\n this.setState(({ parentStyle }) => ({\r\n parentStyle: {\r\n ...parentStyle,\r\n height: 0,\r\n transition: getTransition(slidingExit, 'height')\r\n },\r\n onTransitionEnd\r\n }));\r\n }\r\n }));\r\n }\r\n\r\n return this.setState(({ parentStyle }) => ({\r\n currentX: pageX,\r\n parentStyle: {\r\n ...parentStyle,\r\n left: `${0 + distance}px`\r\n }\r\n }));\r\n }\r\n\r\n onTouchEnd() {\r\n const { notification: { touchRevert } } = this.props;\r\n\r\n this.setState(({ parentStyle }) => ({\r\n parentStyle: {\r\n ...parentStyle,\r\n left: 0,\r\n transition: getTransition(touchRevert, 'left')\r\n }\r\n }));\r\n }\r\n\r\n onMouseEnter() {\r\n if (this.timer) {\r\n this.timer.pause();\r\n } else {\r\n this.setState({ animationPlayState: 'paused' });\r\n }\r\n }\r\n\r\n onMouseLeave() {\r\n if (this.timer) {\r\n this.timer.resume();\r\n } else {\r\n this.setState({ animationPlayState: 'running' });\r\n }\r\n }\r\n\r\n renderTimer() {\r\n const {\r\n notification: { dismiss }\r\n } = this.props;\r\n const { duration, onScreen } = dismiss;\r\n const { animationPlayState } = this.state;\r\n\r\n if (!duration || !onScreen) return;\r\n\r\n const style = {\r\n animationName: 'timer',\r\n animationDuration: `${duration}ms`,\r\n animationTimingFunction: 'linear',\r\n animationFillMode: 'forwards',\r\n animationDelay: 0,\r\n animationPlayState\r\n };\r\n\r\n const onAnimationEnd = () => this.removeNotification(REMOVAL.TIMEOUT);\r\n return (\r\n