{"version":3,"file":"vendors-c5c248e0.47e839c4edc29ae0ca22.bundle.js","mappings":";;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","sources":["webpack://client-app/./node_modules/aurelia-animator-css/dist/native-modules/aurelia-animator-css.js"],"sourcesContent":["\n\nimport { animationEvent, TemplatingEngine } from 'aurelia-templating';\nimport { DOM } from 'aurelia-pal';\n\nexport var CssAnimator = function () {\n function CssAnimator() {\n \n\n this.useAnimationDoneClasses = false;\n this.animationEnteredClass = 'au-entered';\n this.animationLeftClass = 'au-left';\n this.isAnimating = false;\n\n this.verifyKeyframesExist = true;\n }\n\n CssAnimator.prototype._addMultipleEventListener = function _addMultipleEventListener(el, s, fn) {\n var evts = s.split(' ');\n for (var i = 0, ii = evts.length; i < ii; ++i) {\n el.addEventListener(evts[i], fn, false);\n }\n };\n\n CssAnimator.prototype._removeMultipleEventListener = function _removeMultipleEventListener(el, s, fn) {\n var evts = s.split(' ');\n for (var i = 0, ii = evts.length; i < ii; ++i) {\n el.removeEventListener(evts[i], fn, false);\n }\n };\n\n CssAnimator.prototype._getElementAnimationDelay = function _getElementAnimationDelay(element) {\n var styl = DOM.getComputedStyle(element);\n var prop = void 0;\n var delay = void 0;\n\n if (styl.getPropertyValue('animation-delay')) {\n prop = 'animation-delay';\n } else if (styl.getPropertyValue('-webkit-animation-delay')) {\n prop = '-webkit-animation-delay';\n } else if (styl.getPropertyValue('-moz-animation-delay')) {\n prop = '-moz-animation-delay';\n } else {\n return 0;\n }\n\n delay = styl.getPropertyValue(prop);\n delay = Number(delay.replace(/[^\\d\\.]/g, ''));\n\n return delay * 1000;\n };\n\n CssAnimator.prototype._getElementAnimationNames = function _getElementAnimationNames(element) {\n var styl = DOM.getComputedStyle(element);\n var prefix = void 0;\n\n if (styl.getPropertyValue('animation-name')) {\n prefix = '';\n } else if (styl.getPropertyValue('-webkit-animation-name')) {\n prefix = '-webkit-';\n } else if (styl.getPropertyValue('-moz-animation-name')) {\n prefix = '-moz-';\n } else {\n return [];\n }\n\n var animationNames = styl.getPropertyValue(prefix + 'animation-name');\n return animationNames ? animationNames.split(' ') : [];\n };\n\n CssAnimator.prototype._performSingleAnimate = function _performSingleAnimate(element, className) {\n var _this = this;\n\n this._triggerDOMEvent(animationEvent.animateBegin, element);\n\n return this.addClass(element, className, true).then(function (result) {\n _this._triggerDOMEvent(animationEvent.animateActive, element);\n\n if (result !== false) {\n return _this.removeClass(element, className, true).then(function () {\n _this._triggerDOMEvent(animationEvent.animateDone, element);\n });\n }\n\n return false;\n }).catch(function () {\n _this._triggerDOMEvent(animationEvent.animateTimeout, element);\n });\n };\n\n CssAnimator.prototype._triggerDOMEvent = function _triggerDOMEvent(eventType, element) {\n var evt = DOM.createCustomEvent(eventType, { bubbles: true, cancelable: true, detail: element });\n DOM.dispatchEvent(evt);\n };\n\n CssAnimator.prototype._animationChangeWithValidKeyframe = function _animationChangeWithValidKeyframe(animationNames, prevAnimationNames) {\n var newAnimationNames = animationNames.filter(function (name) {\n return prevAnimationNames.indexOf(name) === -1;\n });\n\n if (newAnimationNames.length === 0) {\n return false;\n }\n\n if (!this.verifyKeyframesExist) {\n return true;\n }\n\n var keyframesRuleType = window.CSSRule.KEYFRAMES_RULE || window.CSSRule.MOZ_KEYFRAMES_RULE || window.CSSRule.WEBKIT_KEYFRAMES_RULE;\n\n var styleSheets = document.styleSheets;\n\n try {\n for (var i = 0; i < styleSheets.length; ++i) {\n var cssRules = null;\n\n try {\n cssRules = styleSheets[i].cssRules;\n } catch (e) {}\n\n if (!cssRules) {\n continue;\n }\n\n for (var j = 0; j < cssRules.length; ++j) {\n var cssRule = cssRules[j];\n\n if (cssRule.type === keyframesRuleType) {\n if (newAnimationNames.indexOf(cssRule.name) !== -1) {\n return true;\n }\n }\n }\n }\n } catch (e) {}\n\n return false;\n };\n\n CssAnimator.prototype.animate = function animate(element, className) {\n var _this2 = this;\n\n if (Array.isArray(element)) {\n return Promise.all(element.map(function (el) {\n return _this2._performSingleAnimate(el, className);\n }));\n }\n\n return this._performSingleAnimate(element, className);\n };\n\n CssAnimator.prototype.runSequence = function runSequence(animations) {\n var _this3 = this;\n\n this._triggerDOMEvent(animationEvent.sequenceBegin, null);\n\n return animations.reduce(function (p, anim) {\n return p.then(function () {\n return _this3.animate(anim.element, anim.className);\n });\n }, Promise.resolve(true)).then(function () {\n _this3._triggerDOMEvent(animationEvent.sequenceDone, null);\n });\n };\n\n CssAnimator.prototype._stateAnim = function _stateAnim(element, direction, doneClass) {\n var _this4 = this;\n\n var auClass = 'au-' + direction;\n var auClassActive = auClass + '-active';\n return new Promise(function (resolve, reject) {\n var classList = element.classList;\n\n _this4._triggerDOMEvent(animationEvent[direction + 'Begin'], element);\n\n if (_this4.useAnimationDoneClasses) {\n classList.remove(_this4.animationEnteredClass);\n classList.remove(_this4.animationLeftClass);\n }\n\n classList.add(auClass);\n var prevAnimationNames = _this4._getElementAnimationNames(element);\n\n var _animStart = void 0;\n var animHasStarted = false;\n _this4._addMultipleEventListener(element, 'webkitAnimationStart animationstart', _animStart = function animStart(evAnimStart) {\n if (evAnimStart.target !== element) {\n return;\n }\n animHasStarted = true;\n _this4.isAnimating = true;\n\n _this4._triggerDOMEvent(animationEvent[direction + 'Active'], element);\n\n evAnimStart.stopPropagation();\n\n evAnimStart.target.removeEventListener(evAnimStart.type, _animStart);\n }, false);\n\n var _animEnd = void 0;\n _this4._addMultipleEventListener(element, 'webkitAnimationEnd animationend', _animEnd = function animEnd(evAnimEnd) {\n if (!animHasStarted) {\n return;\n }\n if (evAnimEnd.target !== element) {\n return;\n }\n\n evAnimEnd.stopPropagation();\n\n classList.remove(auClassActive);\n classList.remove(auClass);\n\n evAnimEnd.target.removeEventListener(evAnimEnd.type, _animEnd);\n\n if (_this4.useAnimationDoneClasses && doneClass !== undefined && doneClass !== null) {\n classList.add(doneClass);\n }\n\n _this4.isAnimating = false;\n _this4._triggerDOMEvent(animationEvent[direction + 'Done'], element);\n\n resolve(true);\n }, false);\n\n var parent = element.parentElement;\n var attrib = 'data-animator-pending' + direction;\n\n var cleanupAnimation = function cleanupAnimation() {\n var animationNames = _this4._getElementAnimationNames(element);\n if (!_this4._animationChangeWithValidKeyframe(animationNames, prevAnimationNames)) {\n classList.remove(auClassActive);\n classList.remove(auClass);\n\n _this4._removeMultipleEventListener(element, 'webkitAnimationEnd animationend', _animEnd);\n _this4._removeMultipleEventListener(element, 'webkitAnimationStart animationstart', _animStart);\n\n _this4._triggerDOMEvent(animationEvent[direction + 'Timeout'], element);\n resolve(false);\n }\n parent && parent.setAttribute(attrib, +(parent.getAttribute(attrib) || 1) - 1);\n };\n\n if (parent !== null && parent !== undefined && (parent.classList.contains('au-stagger') || parent.classList.contains('au-stagger-' + direction))) {\n var offset = +(parent.getAttribute(attrib) || 0);\n parent.setAttribute(attrib, offset + 1);\n var delay = _this4._getElementAnimationDelay(parent) * offset;\n _this4._triggerDOMEvent(animationEvent.staggerNext, element);\n\n setTimeout(function () {\n classList.add(auClassActive);\n cleanupAnimation();\n }, delay);\n } else {\n classList.add(auClassActive);\n cleanupAnimation();\n }\n });\n };\n\n CssAnimator.prototype.enter = function enter(element) {\n return this._stateAnim(element, 'enter', this.animationEnteredClass);\n };\n\n CssAnimator.prototype.leave = function leave(element) {\n return this._stateAnim(element, 'leave', this.animationLeftClass);\n };\n\n CssAnimator.prototype.removeClass = function removeClass(element, className) {\n var _this5 = this;\n\n var suppressEvents = arguments.length <= 2 || arguments[2] === undefined ? false : arguments[2];\n\n return new Promise(function (resolve, reject) {\n var classList = element.classList;\n\n if (!classList.contains(className) && !classList.contains(className + '-add')) {\n resolve(false);\n return;\n }\n\n if (suppressEvents !== true) {\n _this5._triggerDOMEvent(animationEvent.removeClassBegin, element);\n }\n\n if (classList.contains(className + '-add')) {\n classList.remove(className + '-add');\n classList.add(className);\n }\n\n classList.remove(className);\n var prevAnimationNames = _this5._getElementAnimationNames(element);\n\n var _animStart2 = void 0;\n var animHasStarted = false;\n _this5._addMultipleEventListener(element, 'webkitAnimationStart animationstart', _animStart2 = function animStart(evAnimStart) {\n if (evAnimStart.target !== element) {\n return;\n }\n animHasStarted = true;\n _this5.isAnimating = true;\n\n if (suppressEvents !== true) {\n _this5._triggerDOMEvent(animationEvent.removeClassActive, element);\n }\n\n evAnimStart.stopPropagation();\n\n evAnimStart.target.removeEventListener(evAnimStart.type, _animStart2);\n }, false);\n\n var _animEnd2 = void 0;\n _this5._addMultipleEventListener(element, 'webkitAnimationEnd animationend', _animEnd2 = function animEnd(evAnimEnd) {\n if (!animHasStarted) {\n return;\n }\n if (evAnimEnd.target !== element) {\n return;\n }\n\n if (!element.classList.contains(className + '-remove')) {\n resolve(true);\n }\n\n evAnimEnd.stopPropagation();\n\n classList.remove(className);\n\n classList.remove(className + '-remove');\n\n evAnimEnd.target.removeEventListener(evAnimEnd.type, _animEnd2);\n\n _this5.isAnimating = false;\n\n if (suppressEvents !== true) {\n _this5._triggerDOMEvent(animationEvent.removeClassDone, element);\n }\n\n resolve(true);\n }, false);\n\n classList.add(className + '-remove');\n\n var animationNames = _this5._getElementAnimationNames(element);\n if (!_this5._animationChangeWithValidKeyframe(animationNames, prevAnimationNames)) {\n classList.remove(className + '-remove');\n classList.remove(className);\n\n _this5._removeMultipleEventListener(element, 'webkitAnimationEnd animationend', _animEnd2);\n _this5._removeMultipleEventListener(element, 'webkitAnimationStart animationstart', _animStart2);\n\n if (suppressEvents !== true) {\n _this5._triggerDOMEvent(animationEvent.removeClassTimeout, element);\n }\n\n resolve(false);\n }\n });\n };\n\n CssAnimator.prototype.addClass = function addClass(element, className) {\n var _this6 = this;\n\n var suppressEvents = arguments.length <= 2 || arguments[2] === undefined ? false : arguments[2];\n\n return new Promise(function (resolve, reject) {\n var classList = element.classList;\n\n if (suppressEvents !== true) {\n _this6._triggerDOMEvent(animationEvent.addClassBegin, element);\n }\n\n if (classList.contains(className + '-remove')) {\n classList.remove(className + '-remove');\n classList.remove(className);\n }\n\n var _animStart3 = void 0;\n var animHasStarted = false;\n _this6._addMultipleEventListener(element, 'webkitAnimationStart animationstart', _animStart3 = function animStart(evAnimStart) {\n if (evAnimStart.target !== element) {\n return;\n }\n animHasStarted = true;\n _this6.isAnimating = true;\n\n if (suppressEvents !== true) {\n _this6._triggerDOMEvent(animationEvent.addClassActive, element);\n }\n\n evAnimStart.stopPropagation();\n\n evAnimStart.target.removeEventListener(evAnimStart.type, _animStart3);\n }, false);\n\n var _animEnd3 = void 0;\n _this6._addMultipleEventListener(element, 'webkitAnimationEnd animationend', _animEnd3 = function animEnd(evAnimEnd) {\n if (!animHasStarted) {\n return;\n }\n if (evAnimEnd.target !== element) {\n return;\n }\n\n if (!element.classList.contains(className + '-add')) {\n resolve(true);\n }\n\n evAnimEnd.stopPropagation();\n\n classList.add(className);\n\n classList.remove(className + '-add');\n\n evAnimEnd.target.removeEventListener(evAnimEnd.type, _animEnd3);\n\n _this6.isAnimating = false;\n\n if (suppressEvents !== true) {\n _this6._triggerDOMEvent(animationEvent.addClassDone, element);\n }\n\n resolve(true);\n }, false);\n\n var prevAnimationNames = _this6._getElementAnimationNames(element);\n\n classList.add(className + '-add');\n\n var animationNames = _this6._getElementAnimationNames(element);\n if (!_this6._animationChangeWithValidKeyframe(animationNames, prevAnimationNames)) {\n classList.remove(className + '-add');\n classList.add(className);\n\n _this6._removeMultipleEventListener(element, 'webkitAnimationEnd animationend', _animEnd3);\n _this6._removeMultipleEventListener(element, 'webkitAnimationStart animationstart', _animStart3);\n\n if (suppressEvents !== true) {\n _this6._triggerDOMEvent(animationEvent.addClassTimeout, element);\n }\n\n resolve(false);\n }\n });\n };\n\n return CssAnimator;\n}();\n\nexport function configure(config, callback) {\n var animator = config.container.get(CssAnimator);\n config.container.get(TemplatingEngine).configureAnimator(animator);\n if (typeof callback === 'function') {\n callback(animator);\n }\n}"],"names":[],"sourceRoot":""}