@angular/animations 9.0.0-rc.6 → 9.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/animations.d.ts +2 -2
- package/browser/browser.d.ts +4 -4
- package/browser/testing/testing.d.ts +2 -2
- package/browser/testing.d.ts +2 -2
- package/browser.d.ts +2 -2
- package/bundles/animations-browser-testing.umd.js +2 -2
- package/bundles/animations-browser-testing.umd.min.js +2 -2
- package/bundles/animations-browser-testing.umd.min.js.map +1 -1
- package/bundles/animations-browser.umd.js +17 -11
- package/bundles/animations-browser.umd.js.map +1 -1
- package/bundles/animations-browser.umd.min.js +3 -3
- package/bundles/animations-browser.umd.min.js.map +1 -1
- package/bundles/animations.umd.js +2 -2
- package/bundles/animations.umd.min.js +2 -2
- package/bundles/animations.umd.min.js.map +1 -1
- package/esm2015/animations.externs.js +1 -1
- package/esm2015/browser/browser.externs.js +4 -4
- package/esm2015/browser/src/render/transition_animation_engine.js +28 -13
- package/esm2015/src/version.js +1 -1
- package/esm5/browser/src/render/transition_animation_engine.js +16 -10
- package/esm5/src/version.js +1 -1
- package/fesm2015/animations.js +2 -2
- package/fesm2015/browser/testing.js +2 -2
- package/fesm2015/browser.js +29 -14
- package/fesm2015/browser.js.map +1 -1
- package/fesm5/animations.js +2 -2
- package/fesm5/browser/testing.js +2 -2
- package/fesm5/browser.js +17 -11
- package/fesm5/browser.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v9.0.0
|
|
3
|
-
* (c) 2010-
|
|
2
|
+
* @license Angular v9.0.0
|
|
3
|
+
* (c) 2010-2020 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
6
6
|
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/animations"),require("@angular/core")):"function"==typeof define&&define.amd?define("@angular/animations/browser",["exports","@angular/animations","@angular/core"],e):e(((t=t||self).ng=t.ng||{},t.ng.animations=t.ng.animations||{},t.ng.animations.browser={}),t.ng.animations,t.ng.core)}(this,(function(t,e,n){"use strict";
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
*
|
|
39
39
|
* Use of this source code is governed by an MIT-style license that can be
|
|
40
40
|
* found in the LICENSE file at https://angular.io/license
|
|
41
|
-
*/var Ft=new lt,Dt=function(){function t(t,e,n){this.bodyNode=t,this._driver=e,this._normalizer=n,this._animations={},this._playersById={},this.players=[]}return t.prototype.register=function(t,e){var n=[],r=nt(this._driver,e,n);if(n.length)throw new Error("Unable to build the animation due to the following errors: "+n.join("\n"));this._animations[t]=r},t.prototype._buildPlayer=function(t,e,n){var r=t.element,i=h(0,this._normalizer,0,t.keyframes,e,n);return this._driver.animate(r,i,t.duration,t.delay,t.easing,[],!0)},t.prototype.create=function(t,n,r){var i=this;void 0===r&&(r={});var o,s=[],a=this._animations[t],u=new Map;if(a?(o=pt(this._driver,n,a,"ng-enter","ng-leave",{},{},r,Ft,s)).forEach((function(t){var e=y(u,t.element,{});t.postStyleProps.forEach((function(t){return e[t]=null}))})):(s.push("The requested animation doesn't exist or has already been destroyed"),o=[]),s.length)throw new Error("Unable to create the animation due to the following errors: "+s.join("\n"));u.forEach((function(t,n){Object.keys(t).forEach((function(r){t[r]=i._driver.computeStyle(n,r,e.AUTO_STYLE)}))}));var h=l(o.map((function(t){var e=u.get(t.element);return i._buildPlayer(t,{},e)})));return this._playersById[t]=h,h.onDestroy((function(){return i.destroy(t)})),this.players.push(h),h},t.prototype.destroy=function(t){var e=this._getPlayer(t);e.destroy(),delete this._playersById[t];var n=this.players.indexOf(e);n>=0&&this.players.splice(n,1)},t.prototype._getPlayer=function(t){var e=this._playersById[t];if(!e)throw new Error("Unable to find the timeline player referenced by "+t);return e},t.prototype.listen=function(t,e,n,r){var i=f(e,"","","");return c(this._getPlayer(t),n,i,r),function(){}},t.prototype.command=function(t,e,n,r){if("register"!=n)if("create"!=n){var i=this._getPlayer(t);switch(n){case"play":i.play();break;case"pause":i.pause();break;case"reset":i.reset();break;case"restart":i.restart();break;case"finish":i.finish();break;case"init":i.init();break;case"setPosition":i.setPosition(parseFloat(r[0]));break;case"destroy":this.destroy(t)}}else this.create(t,e,r[0]||{});else this.register(t,r[0])},t}(),Lt=[],jt={namespaceId:"",setForRemoval:!1,setForMove:!1,hasAnimation:!1,removedBeforeQueried:!1},xt={namespaceId:"",setForMove:!1,setForRemoval:!1,hasAnimation:!1,removedBeforeQueried:!0},qt="__ng_removed",Rt=function(){function t(t,e){void 0===e&&(e=""),this.namespaceId=e;var n=t&&t.hasOwnProperty("value");if(this.value=function r(t){return null!=t?t:null}(n?t.value:t),n){var i=L(t);delete i.value,this.options=i}else this.options={};this.options.params||(this.options.params={})}return Object.defineProperty(t.prototype,"params",{get:function(){return this.options.params},enumerable:!0,configurable:!0}),t.prototype.absorbOptions=function(t){var e=t.params;if(e){var n=this.options.params;Object.keys(e).forEach((function(t){null==n[t]&&(n[t]=e[t])}))}},t}(),It=new Rt("void"),Kt=function(){function t(t,e,n){this.id=t,this.hostElement=e,this._engine=n,this.players=[],this._triggers={},this._queue=[],this._elementListeners=new Map,this._hostClassName="ng-tns-"+t,Yt(e,this._hostClassName)}return t.prototype.listen=function(t,e,n,r){var i=this;if(!this._triggers.hasOwnProperty(e))throw new Error('Unable to listen on the animation trigger event "'+n+'" because the animation trigger "'+e+"\" doesn't exist!");if(null==n||0==n.length)throw new Error('Unable to listen on the animation trigger "'+e+'" because the provided event is undefined!');if(!function o(t){return"start"==t||"done"==t}(n))throw new Error('The provided animation trigger event "'+n+'" for the animation trigger "'+e+'" is not supported!');var s=y(this._elementListeners,t,[]),a={name:e,phase:n,callback:r};s.push(a);var u=y(this._engine.statesByElement,t,{});return u.hasOwnProperty(e)||(Yt(t,"ng-trigger"),Yt(t,"ng-trigger-"+e),u[e]=It),function(){i._engine.afterFlush((function(){var t=s.indexOf(a);t>=0&&s.splice(t,1),i._triggers[e]||delete u[e]}))}},t.prototype.register=function(t,e){return!this._triggers[t]&&(this._triggers[t]=e,!0)},t.prototype._getTrigger=function(t){var e=this._triggers[t];if(!e)throw new Error('The provided animation trigger "'+t+'" has not been registered!');return e},t.prototype.trigger=function(t,e,n,r){var i=this;void 0===r&&(r=!0);var o=this._getTrigger(e),s=new Bt(this.id,e,t),a=this._engine.statesByElement.get(t);a||(Yt(t,"ng-trigger"),Yt(t,"ng-trigger-"+e),this._engine.statesByElement.set(t,a={}));var u=a[e],l=new Rt(n,this.id);if(!(n&&n.hasOwnProperty("value"))&&u&&l.absorbOptions(u.options),a[e]=l,u||(u=It),"void"===l.value||u.value!==l.value){var h=y(this._engine.playersByElement,t,[]);h.forEach((function(t){t.namespaceId==i.id&&t.triggerName==e&&t.queued&&t.destroy()}));var c=o.matchTransition(u.value,l.value,t,l.params),p=!1;if(!c){if(!r)return;c=o.fallbackTransition,p=!0}return this._engine.totalQueuedPlayers++,this._queue.push({element:t,triggerName:e,transition:c,fromState:u,toState:l,player:s,isFallbackTransition:p}),p||(Yt(t,"ng-animate-queued"),s.onStart((function(){$t(t,"ng-animate-queued")}))),s.onDone((function(){var e=i.players.indexOf(s);e>=0&&i.players.splice(e,1);var n=i._engine.playersByElement.get(t);if(n){var r=n.indexOf(s);r>=0&&n.splice(r,1)}})),this.players.push(s),h.push(s),s}if(!function f(t,e){var n=Object.keys(t),r=Object.keys(e);if(n.length!=r.length)return!1;for(var i=0;i<n.length;i++){var o=n[i];if(!e.hasOwnProperty(o)||t[o]!==e[o])return!1}return!0}(u.params,l.params)){var m=[],d=o.matchStyles(u.value,u.params,m),v=o.matchStyles(l.value,l.params,m);m.length?this._engine.reportError(m):this._engine.afterFlush((function(){K(t,d),I(t,v)}))}},t.prototype.deregister=function(t){var e=this;delete this._triggers[t],this._engine.statesByElement.forEach((function(e,n){delete e[t]})),this._elementListeners.forEach((function(n,r){e._elementListeners.set(r,n.filter((function(e){return e.name!=t})))}))},t.prototype.clearElementCache=function(t){this._engine.statesByElement.delete(t),this._elementListeners.delete(t);var e=this._engine.playersByElement.get(t);e&&(e.forEach((function(t){return t.destroy()})),this._engine.playersByElement.delete(t))},t.prototype._signalRemovalForInnerTriggers=function(t,e,n){var r=this;void 0===n&&(n=!1),this._engine.driver.query(t,".ng-trigger",!0).forEach((function(t){if(!t[qt]){var n=r._engine.fetchNamespacesByElement(t);n.size?n.forEach((function(n){return n.triggerLeaveAnimation(t,e,!1,!0)})):r.clearElementCache(t)}}))},t.prototype.triggerLeaveAnimation=function(t,e,n,r){var i=this,o=this._engine.statesByElement.get(t);if(o){var s=[];if(Object.keys(o).forEach((function(e){if(i._triggers[e]){var n=i.trigger(t,e,"void",r);n&&s.push(n)}})),s.length)return this._engine.markElementAsRemoved(this.id,t,!0,e),n&&l(s).onDone((function(){return i._engine.processLeaveNode(t)})),!0}return!1},t.prototype.prepareLeaveAnimationListeners=function(t){var e=this,n=this._elementListeners.get(t);if(n){var r=new Set;n.forEach((function(n){var i=n.name;if(!r.has(i)){r.add(i);var o=e._triggers[i].fallbackTransition,s=e._engine.statesByElement.get(t)[i]||It,a=new Rt("void"),u=new Bt(e.id,i,t);e._engine.totalQueuedPlayers++,e._queue.push({element:t,triggerName:i,transition:o,fromState:s,toState:a,player:u,isFallbackTransition:!0})}}))}},t.prototype.removeNode=function(t,e){var n=this,r=this._engine;if(t.childElementCount&&this._signalRemovalForInnerTriggers(t,e,!0),!this.triggerLeaveAnimation(t,e,!0)){var i=!1;if(r.totalAnimations){var o=r.players.length?r.playersByQueriedElement.get(t):[];if(o&&o.length)i=!0;else for(var s=t;s=s.parentNode;)if(r.statesByElement.get(s)){i=!0;break}}this.prepareLeaveAnimationListeners(t),i?r.markElementAsRemoved(this.id,t,!1,e):(r.afterFlush((function(){return n.clearElementCache(t)})),r.destroyInnerAnimations(t),r._onRemovalComplete(t,e))}},t.prototype.insertNode=function(t,e){Yt(t,this._hostClassName)},t.prototype.drainQueuedTransitions=function(t){var e=this,n=[];return this._queue.forEach((function(r){var i=r.player;if(!i.destroyed){var o=r.element,s=e._elementListeners.get(o);s&&s.forEach((function(e){if(e.name==r.triggerName){var n=f(o,r.triggerName,r.fromState.value,r.toState.value);n._data=t,c(r.player,e.phase,n,e.callback)}})),i.markedForDestroy?e._engine.afterFlush((function(){i.destroy()})):n.push(r)}})),this._queue=[],n.sort((function(t,n){var r=t.transition.ast.depCount,i=n.transition.ast.depCount;return 0==r||0==i?r-i:e._engine.driver.containsElement(t.element,n.element)?1:-1}))},t.prototype.destroy=function(t){this.players.forEach((function(t){return t.destroy()})),this._signalRemovalForInnerTriggers(this.hostElement,t)},t.prototype.elementContainsData=function(t){var e=!1;return this._elementListeners.has(t)&&(e=!0),!!this._queue.find((function(e){return e.element===t}))||e},t}(),Qt=function(){function t(t,e,n){this.bodyNode=t,this.driver=e,this._normalizer=n,this.players=[],this.newHostElements=new Map,this.playersByElement=new Map,this.playersByQueriedElement=new Map,this.statesByElement=new Map,this.disabledNodes=new Set,this.totalAnimations=0,this.totalQueuedPlayers=0,this._namespaceLookup={},this._namespaceList=[],this._flushFns=[],this._whenQuietFns=[],this.namespacesByHostElement=new Map,this.collectedEnterElements=[],this.collectedLeaveElements=[],this.onRemovalComplete=function(t,e){}}return t.prototype._onRemovalComplete=function(t,e){this.onRemovalComplete(t,e)},Object.defineProperty(t.prototype,"queuedPlayers",{get:function(){var t=[];return this._namespaceList.forEach((function(e){e.players.forEach((function(e){e.queued&&t.push(e)}))})),t},enumerable:!0,configurable:!0}),t.prototype.createNamespace=function(t,e){var n=new Kt(t,e,this);return e.parentNode?this._balanceNamespaceList(n,e):(this.newHostElements.set(e,n),this.collectEnterElement(e)),this._namespaceLookup[t]=n},t.prototype._balanceNamespaceList=function(t,e){var n=this._namespaceList.length-1;if(n>=0){for(var r=!1,i=n;i>=0;i--)if(this.driver.containsElement(this._namespaceList[i].hostElement,e)){this._namespaceList.splice(i+1,0,t),r=!0;break}r||this._namespaceList.splice(0,0,t)}else this._namespaceList.push(t);return this.namespacesByHostElement.set(e,t),t},t.prototype.register=function(t,e){var n=this._namespaceLookup[t];return n||(n=this.createNamespace(t,e)),n},t.prototype.registerTrigger=function(t,e,n){var r=this._namespaceLookup[t];r&&r.register(e,n)&&this.totalAnimations++},t.prototype.destroy=function(t,e){var n=this;if(t){var r=this._fetchNamespace(t);this.afterFlush((function(){n.namespacesByHostElement.delete(r.hostElement),delete n._namespaceLookup[t];var e=n._namespaceList.indexOf(r);e>=0&&n._namespaceList.splice(e,1)})),this.afterFlushAnimationsDone((function(){return r.destroy(e)}))}},t.prototype._fetchNamespace=function(t){return this._namespaceLookup[t]},t.prototype.fetchNamespacesByElement=function(t){var e=new Set,n=this.statesByElement.get(t);if(n)for(var r=Object.keys(n),i=0;i<r.length;i++){var o=n[r[i]].namespaceId;if(o){var s=this._fetchNamespace(o);s&&e.add(s)}}return e},t.prototype.trigger=function(t,e,n,r){if(Mt(e)){var i=this._fetchNamespace(t);if(i)return i.trigger(e,n,r),!0}return!1},t.prototype.insertNode=function(t,e,n,r){if(Mt(e)){var i=e[qt];if(i&&i.setForRemoval){i.setForRemoval=!1,i.setForMove=!0;var o=this.collectedLeaveElements.indexOf(e);o>=0&&this.collectedLeaveElements.splice(o,1)}if(t){var s=this._fetchNamespace(t);s&&s.insertNode(e,n)}r&&this.collectEnterElement(e)}},t.prototype.collectEnterElement=function(t){this.collectedEnterElements.push(t)},t.prototype.markElementAsDisabled=function(t,e){e?this.disabledNodes.has(t)||(this.disabledNodes.add(t),Yt(t,"ng-animate-disabled")):this.disabledNodes.has(t)&&(this.disabledNodes.delete(t),$t(t,"ng-animate-disabled"))},t.prototype.removeNode=function(t,e,n,r){if(Mt(e)){var i=t?this._fetchNamespace(t):null;if(i?i.removeNode(e,r):this.markElementAsRemoved(t,e,!1,r),n){var o=this.namespacesByHostElement.get(e);o&&o.id!==t&&o.removeNode(e,r)}}else this._onRemovalComplete(e,r)},t.prototype.markElementAsRemoved=function(t,e,n,r){this.collectedLeaveElements.push(e),e[qt]={namespaceId:t,setForRemoval:r,hasAnimation:n,removedBeforeQueried:!1}},t.prototype.listen=function(t,e,n,r,i){return Mt(e)?this._fetchNamespace(t).listen(e,n,r,i):function(){}},t.prototype._buildInstruction=function(t,e,n,r,i){return t.transition.build(this.driver,t.element,t.fromState.value,t.toState.value,n,r,t.fromState.options,t.toState.options,e,i)},t.prototype.destroyInnerAnimations=function(t){var e=this,n=this.driver.query(t,".ng-trigger",!0);n.forEach((function(t){return e.destroyActiveAnimationsForElement(t)})),0!=this.playersByQueriedElement.size&&(n=this.driver.query(t,".ng-animating",!0)).forEach((function(t){return e.finishActiveQueriedAnimationOnElement(t)}))},t.prototype.destroyActiveAnimationsForElement=function(t){var e=this.playersByElement.get(t);e&&e.forEach((function(t){t.queued?t.markedForDestroy=!0:t.destroy()}))},t.prototype.finishActiveQueriedAnimationOnElement=function(t){var e=this.playersByQueriedElement.get(t);e&&e.forEach((function(t){return t.finish()}))},t.prototype.whenRenderingDone=function(){var t=this;return new Promise((function(e){if(t.players.length)return l(t.players).onDone((function(){return e()}));e()}))},t.prototype.processLeaveNode=function(t){var e=this,n=t[qt];if(n&&n.setForRemoval){if(t[qt]=jt,n.namespaceId){this.destroyInnerAnimations(t);var r=this._fetchNamespace(n.namespaceId);r&&r.clearElementCache(t)}this._onRemovalComplete(t,n.setForRemoval)}this.driver.matchesElement(t,".ng-animate-disabled")&&this.markElementAsDisabled(t,!1),this.driver.query(t,".ng-animate-disabled",!0).forEach((function(t){e.markElementAsDisabled(t,!1)}))},t.prototype.flush=function(t){var e=this;void 0===t&&(t=-1);var n=[];if(this.newHostElements.size&&(this.newHostElements.forEach((function(t,n){return e._balanceNamespaceList(t,n)})),this.newHostElements.clear()),this.totalAnimations&&this.collectedEnterElements.length)for(var r=0;r<this.collectedEnterElements.length;r++)Yt(this.collectedEnterElements[r],"ng-star-inserted");if(this._namespaceList.length&&(this.totalQueuedPlayers||this.collectedLeaveElements.length)){var i=[];try{n=this._flushAnimations(i,t)}finally{for(r=0;r<i.length;r++)i[r]()}}else for(r=0;r<this.collectedLeaveElements.length;r++)this.processLeaveNode(this.collectedLeaveElements[r]);if(this.totalQueuedPlayers=0,this.collectedEnterElements.length=0,this.collectedLeaveElements.length=0,this._flushFns.forEach((function(t){return t()})),this._flushFns=[],this._whenQuietFns.length){var o=this._whenQuietFns;this._whenQuietFns=[],n.length?l(n).onDone((function(){o.forEach((function(t){return t()}))})):o.forEach((function(t){return t()}))}},t.prototype.reportError=function(t){throw new Error("Unable to process animations due to the following failed trigger transitions\n "+t.join("\n"))},t.prototype._flushAnimations=function(t,n){var r=this,i=new lt,s=[],u=new Map,h=[],c=new Map,p=new Map,f=new Map,m=new Set;this.disabledNodes.forEach((function(t){m.add(t);for(var e=r.driver.query(t,".ng-animate-queued",!0),n=0;n<e.length;n++)m.add(e[n])}));var d=this.bodyNode,v=Array.from(this.statesByElement.keys()),g=Wt(v,this.collectedEnterElements),_=new Map,S=0;g.forEach((function(t,e){var n="ng-enter"+S++;_.set(e,n),t.forEach((function(t){return Yt(t,n)}))}));for(var E=[],b=new Set,T=new Set,w=0;w<this.collectedLeaveElements.length;w++)(z=(M=this.collectedLeaveElements[w])[qt])&&z.setForRemoval&&(E.push(M),b.add(M),z.hasAnimation?this.driver.query(M,".ng-star-inserted",!0).forEach((function(t){return b.add(t)})):T.add(M));var P=new Map,k=Wt(v,Array.from(b));k.forEach((function(t,e){var n="ng-leave"+S++;P.set(e,n),t.forEach((function(t){return Yt(t,n)}))})),t.push((function(){g.forEach((function(t,e){var n=_.get(e);t.forEach((function(t){return $t(t,n)}))})),k.forEach((function(t,e){var n=P.get(e);t.forEach((function(t){return $t(t,n)}))})),E.forEach((function(t){r.processLeaveNode(t)}))}));for(var A=[],N=[],O=this._namespaceList.length-1;O>=0;O--)this._namespaceList[O].drainQueuedTransitions(n).forEach((function(t){var e=t.player,n=t.element;if(A.push(e),r.collectedEnterElements.length){var o=n[qt];if(o&&o.setForMove)return void e.destroy()}var a=!d||!r.driver.containsElement(d,n),u=P.get(n),l=_.get(n),m=r._buildInstruction(t,i,l,u,a);if(m.errors&&m.errors.length)N.push(m);else{if(a)return e.onStart((function(){return K(n,m.fromStyles)})),e.onDestroy((function(){return I(n,m.toStyles)})),void s.push(e);if(t.isFallbackTransition)return e.onStart((function(){return K(n,m.fromStyles)})),e.onDestroy((function(){return I(n,m.toStyles)})),void s.push(e);m.timelines.forEach((function(t){return t.stretchStartingKeyframe=!0})),i.append(n,m.timelines),h.push({instruction:m,player:e,element:n}),m.queriedElements.forEach((function(t){return y(c,t,[]).push(e)})),m.preStyleProps.forEach((function(t,e){var n=Object.keys(t);if(n.length){var r=p.get(e);r||p.set(e,r=new Set),n.forEach((function(t){return r.add(t)}))}})),m.postStyleProps.forEach((function(t,e){var n=Object.keys(t),r=f.get(e);r||f.set(e,r=new Set),n.forEach((function(t){return r.add(t)}))}))}}));if(N.length){var C=[];N.forEach((function(t){C.push("@"+t.triggerName+" has failed due to:\n"),t.errors.forEach((function(t){return C.push("- "+t+"\n")}))})),A.forEach((function(t){return t.destroy()})),this.reportError(C)}var F=new Map,D=new Map;h.forEach((function(t){var e=t.element;i.has(e)&&(D.set(e,e),r._beforeAnimationBuild(t.player.namespaceId,t.instruction,F))})),s.forEach((function(t){var e=t.element;r._getPreviousPlayers(e,!1,t.namespaceId,t.triggerName,null).forEach((function(t){y(F,e,[]).push(t),t.destroy()}))}));var L=E.filter((function(t){return Gt(t,p,f)})),j=new Map;Ut(j,this.driver,T,f,e.AUTO_STYLE).forEach((function(t){Gt(t,p,f)&&L.push(t)}));var x=new Map;g.forEach((function(t,n){Ut(x,r.driver,new Set(t),p,e.ɵPRE_STYLE)})),L.forEach((function(t){var e=j.get(t),n=x.get(t);j.set(t,o(o({},e),n))}));var q=[],R=[],Q={};h.forEach((function(t){var e=t.element,n=t.player,o=t.instruction;if(i.has(e)){if(m.has(e))return n.onDestroy((function(){return I(e,o.toStyles)})),n.disabled=!0,n.overrideTotalTime(o.totalTime),void s.push(n);var a=Q;if(D.size>1){for(var h=e,c=[];h=h.parentNode;){var p=D.get(h);if(p){a=p;break}c.push(h)}c.forEach((function(t){return D.set(t,a)}))}var f=r._buildAnimation(n.namespaceId,o,F,u,x,j);if(n.setRealPlayer(f),a===Q)q.push(n);else{var y=r.playersByElement.get(a);y&&y.length&&(n.parentPlayer=l(y)),s.push(n)}}else K(e,o.fromStyles),n.onDestroy((function(){return I(e,o.toStyles)})),R.push(n),m.has(e)&&s.push(n)})),R.forEach((function(t){var e=u.get(t.element);if(e&&e.length){var n=l(e);t.setRealPlayer(n)}})),s.forEach((function(t){t.parentPlayer?t.syncPlayerEvents(t.parentPlayer):t.destroy()}));for(var B=0;B<E.length;B++){var M,z=(M=E[B])[qt];if($t(M,"ng-leave"),!z||!z.hasAnimation){var U=[];if(c.size){var W=c.get(M);W&&W.length&&U.push.apply(U,a(W));for(var H=this.driver.query(M,".ng-animating",!0),Y=0;Y<H.length;Y++){var $=c.get(H[Y]);$&&$.length&&U.push.apply(U,a($))}}var V=U.filter((function(t){return!t.destroyed}));V.length?Vt(this,M,V):this.processLeaveNode(M)}}return E.length=0,q.forEach((function(t){r.players.push(t),t.onDone((function(){t.destroy();var e=r.players.indexOf(t);r.players.splice(e,1)})),t.play()})),q},t.prototype.elementContainsData=function(t,e){var n=!1,r=e[qt];return r&&r.setForRemoval&&(n=!0),this.playersByElement.has(e)&&(n=!0),this.playersByQueriedElement.has(e)&&(n=!0),this.statesByElement.has(e)&&(n=!0),this._fetchNamespace(t).elementContainsData(e)||n},t.prototype.afterFlush=function(t){this._flushFns.push(t)},t.prototype.afterFlushAnimationsDone=function(t){this._whenQuietFns.push(t)},t.prototype._getPreviousPlayers=function(t,e,n,r,i){var o=[];if(e){var s=this.playersByQueriedElement.get(t);s&&(o=s)}else{var a=this.playersByElement.get(t);if(a){var u=!i||"void"==i;a.forEach((function(t){t.queued||(u||t.triggerName==r)&&o.push(t)}))}}return(n||r)&&(o=o.filter((function(t){return!(n&&n!=t.namespaceId||r&&r!=t.triggerName)}))),o},t.prototype._beforeAnimationBuild=function(t,e,n){var r,i,o=e.element,s=e.isRemovalTransition?void 0:t,a=e.isRemovalTransition?void 0:e.triggerName,u=function(t){var r=t.element,i=r!==o,u=y(n,r,[]);l._getPreviousPlayers(r,i,s,a,e.toState).forEach((function(t){var e=t.getRealPlayer();e.beforeDestroy&&e.beforeDestroy(),t.destroy(),u.push(t)}))},l=this;try{for(var h=function c(t){var e="function"==typeof Symbol&&t[Symbol.iterator],n=0;return e?e.call(t):{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}}}(e.timelines),p=h.next();!p.done;p=h.next())u(p.value)}catch(t){r={error:t}}finally{try{p&&!p.done&&(i=h.return)&&i.call(h)}finally{if(r)throw r.error}}K(o,e.fromStyles)},t.prototype._buildAnimation=function(t,n,r,i,o,s){var a=this,u=n.triggerName,c=n.element,p=[],f=new Set,m=new Set,d=n.timelines.map((function(n){var l=n.element;f.add(l);var y=l[qt];if(y&&y.removedBeforeQueried)return new e.NoopAnimationPlayer(n.duration,n.delay);var d=l!==c,v=function g(t){var n=[];return function t(n,r){for(var i=0;i<n.length;i++){var o=n[i];o instanceof e.ɵAnimationGroupPlayer?t(o.players,r):r.push(o)}}(t,n),n}((r.get(l)||Lt).map((function(t){return t.getRealPlayer()}))).filter((function(t){return!!t.element&&t.element===l})),_=o.get(l),S=s.get(l),E=h(0,a._normalizer,0,n.keyframes,_,S),b=a._buildPlayer(n,E,v);if(n.subTimeline&&i&&m.add(l),d){var T=new Bt(t,u,l);T.setRealPlayer(b),p.push(T)}return b}));p.forEach((function(t){y(a.playersByQueriedElement,t.element,[]).push(t),t.onDone((function(){return function e(t,n,r){var i;if(t instanceof Map){if(i=t.get(n)){if(i.length){var o=i.indexOf(r);i.splice(o,1)}0==i.length&&t.delete(n)}}else(i=t[n])&&(i.length&&(o=i.indexOf(r),i.splice(o,1)),0==i.length&&delete t[n]);return i}(a.playersByQueriedElement,t.element,t)}))})),f.forEach((function(t){return Yt(t,"ng-animating")}));var v=l(d);return v.onDestroy((function(){f.forEach((function(t){return $t(t,"ng-animating")})),I(c,n.toStyles)})),m.forEach((function(t){y(i,t,[]).push(v)})),v},t.prototype._buildPlayer=function(t,n,r){return n.length>0?this.driver.animate(t.element,n,t.duration,t.delay,t.easing,r):new e.NoopAnimationPlayer(t.duration,t.delay)},t}(),Bt=function(){function t(t,n,r){this.namespaceId=t,this.triggerName=n,this.element=r,this._player=new e.NoopAnimationPlayer,this._containsRealPlayer=!1,this._queuedCallbacks={},this.destroyed=!1,this.markedForDestroy=!1,this.disabled=!1,this.queued=!0,this.totalTime=0}return t.prototype.setRealPlayer=function(t){var e=this;this._containsRealPlayer||(this._player=t,Object.keys(this._queuedCallbacks).forEach((function(n){e._queuedCallbacks[n].forEach((function(e){return c(t,n,void 0,e)}))})),this._queuedCallbacks={},this._containsRealPlayer=!0,this.overrideTotalTime(t.totalTime),this.queued=!1)},t.prototype.getRealPlayer=function(){return this._player},t.prototype.overrideTotalTime=function(t){this.totalTime=t},t.prototype.syncPlayerEvents=function(t){var e=this,n=this._player;n.triggerCallback&&t.onStart((function(){return n.triggerCallback("start")})),t.onDone((function(){return e.finish()})),t.onDestroy((function(){return e.destroy()}))},t.prototype._queueEvent=function(t,e){y(this._queuedCallbacks,t,[]).push(e)},t.prototype.onDone=function(t){this.queued&&this._queueEvent("done",t),this._player.onDone(t)},t.prototype.onStart=function(t){this.queued&&this._queueEvent("start",t),this._player.onStart(t)},t.prototype.onDestroy=function(t){this.queued&&this._queueEvent("destroy",t),this._player.onDestroy(t)},t.prototype.init=function(){this._player.init()},t.prototype.hasStarted=function(){return!this.queued&&this._player.hasStarted()},t.prototype.play=function(){!this.queued&&this._player.play()},t.prototype.pause=function(){!this.queued&&this._player.pause()},t.prototype.restart=function(){!this.queued&&this._player.restart()},t.prototype.finish=function(){this._player.finish()},t.prototype.destroy=function(){this.destroyed=!0,this._player.destroy()},t.prototype.reset=function(){!this.queued&&this._player.reset()},t.prototype.setPosition=function(t){this.queued||this._player.setPosition(t)},t.prototype.getPosition=function(){return this.queued?0:this._player.getPosition()},t.prototype.triggerCallback=function(t){var e=this._player;e.triggerCallback&&e.triggerCallback(t)},t}();function Mt(t){return t&&1===t.nodeType}function zt(t,e){var n=t.style.display;return t.style.display=null!=e?e:"none",n}function Ut(t,e,n,r,i){var o=[];n.forEach((function(t){return o.push(zt(t))}));var s=[];r.forEach((function(n,r){var o={};n.forEach((function(t){var n=o[t]=e.computeStyle(r,t,i);n&&0!=n.length||(r[qt]=xt,s.push(r))})),t.set(r,o)}));var a=0;return n.forEach((function(t){return zt(t,o[a++])})),s}function Wt(t,e){var n=new Map;if(t.forEach((function(t){return n.set(t,[])})),0==e.length)return n;var r=new Set(e),i=new Map;return e.forEach((function(t){var e=function t(e){if(!e)return 1;var o=i.get(e);if(o)return o;var s=e.parentNode;return o=n.has(s)?s:r.has(s)?1:t(s),i.set(e,o),o}(t);1!==e&&n.get(e).push(t)})),n}var Ht="$$classes";function Yt(t,e){if(t.classList)t.classList.add(e);else{var n=t[Ht];n||(n=t[Ht]={}),n[e]=!0}}function $t(t,e){if(t.classList)t.classList.remove(e);else{var n=t[Ht];n&&delete n[e]}}function Vt(t,e,n){l(n).onDone((function(){return t.processLeaveNode(e)}))}function Gt(t,e,n){var r=n.get(t);if(!r)return!1;var i=e.get(t);return i?r.forEach((function(t){return i.add(t)})):e.set(t,r),n.delete(t),!0}var Zt=function(){function t(t,e,n){var r=this;this.bodyNode=t,this._driver=e,this._triggerCache={},this.onRemovalComplete=function(t,e){},this._transitionEngine=new Qt(t,e,n),this._timelineEngine=new Dt(t,e,n),this._transitionEngine.onRemovalComplete=function(t,e){return r.onRemovalComplete(t,e)}}return t.prototype.registerTrigger=function(t,e,n,r,i){var o=t+"-"+r,s=this._triggerCache[o];if(!s){var a=[],u=nt(this._driver,i,a);if(a.length)throw new Error('The animation trigger "'+r+'" has failed to build due to the following errors:\n - '+a.join("\n - "));s=function l(t,e){return new Ot(t,e)}(r,u),this._triggerCache[o]=s}this._transitionEngine.registerTrigger(e,r,s)},t.prototype.register=function(t,e){this._transitionEngine.register(t,e)},t.prototype.destroy=function(t,e){this._transitionEngine.destroy(t,e)},t.prototype.onInsert=function(t,e,n,r){this._transitionEngine.insertNode(t,e,n,r)},t.prototype.onRemove=function(t,e,n,r){this._transitionEngine.removeNode(t,e,r||!1,n)},t.prototype.disableAnimations=function(t,e){this._transitionEngine.markElementAsDisabled(t,e)},t.prototype.process=function(t,e,n,r){if("@"==n.charAt(0)){var i=s(m(n),2);this._timelineEngine.command(i[0],e,i[1],r)}else this._transitionEngine.trigger(t,e,n,r)},t.prototype.listen=function(t,e,n,r,i){if("@"==n.charAt(0)){var o=s(m(n),2);return this._timelineEngine.listen(o[0],e,o[1],i)}return this._transitionEngine.listen(t,e,n,r,i)},t.prototype.flush=function(t){void 0===t&&(t=-1),this._transitionEngine.flush(t)},Object.defineProperty(t.prototype,"players",{get:function(){return this._transitionEngine.players.concat(this._timelineEngine.players)},enumerable:!0,configurable:!0}),t.prototype.whenRenderingDone=function(){return this._transitionEngine.whenRenderingDone()},t}();
|
|
41
|
+
*/var Ft=new lt,Dt=function(){function t(t,e,n){this.bodyNode=t,this._driver=e,this._normalizer=n,this._animations={},this._playersById={},this.players=[]}return t.prototype.register=function(t,e){var n=[],r=nt(this._driver,e,n);if(n.length)throw new Error("Unable to build the animation due to the following errors: "+n.join("\n"));this._animations[t]=r},t.prototype._buildPlayer=function(t,e,n){var r=t.element,i=h(0,this._normalizer,0,t.keyframes,e,n);return this._driver.animate(r,i,t.duration,t.delay,t.easing,[],!0)},t.prototype.create=function(t,n,r){var i=this;void 0===r&&(r={});var o,s=[],a=this._animations[t],u=new Map;if(a?(o=pt(this._driver,n,a,"ng-enter","ng-leave",{},{},r,Ft,s)).forEach((function(t){var e=y(u,t.element,{});t.postStyleProps.forEach((function(t){return e[t]=null}))})):(s.push("The requested animation doesn't exist or has already been destroyed"),o=[]),s.length)throw new Error("Unable to create the animation due to the following errors: "+s.join("\n"));u.forEach((function(t,n){Object.keys(t).forEach((function(r){t[r]=i._driver.computeStyle(n,r,e.AUTO_STYLE)}))}));var h=l(o.map((function(t){var e=u.get(t.element);return i._buildPlayer(t,{},e)})));return this._playersById[t]=h,h.onDestroy((function(){return i.destroy(t)})),this.players.push(h),h},t.prototype.destroy=function(t){var e=this._getPlayer(t);e.destroy(),delete this._playersById[t];var n=this.players.indexOf(e);n>=0&&this.players.splice(n,1)},t.prototype._getPlayer=function(t){var e=this._playersById[t];if(!e)throw new Error("Unable to find the timeline player referenced by "+t);return e},t.prototype.listen=function(t,e,n,r){var i=f(e,"","","");return c(this._getPlayer(t),n,i,r),function(){}},t.prototype.command=function(t,e,n,r){if("register"!=n)if("create"!=n){var i=this._getPlayer(t);switch(n){case"play":i.play();break;case"pause":i.pause();break;case"reset":i.reset();break;case"restart":i.restart();break;case"finish":i.finish();break;case"init":i.init();break;case"setPosition":i.setPosition(parseFloat(r[0]));break;case"destroy":this.destroy(t)}}else this.create(t,e,r[0]||{});else this.register(t,r[0])},t}(),Lt=[],jt={namespaceId:"",setForRemoval:!1,setForMove:!1,hasAnimation:!1,removedBeforeQueried:!1},xt={namespaceId:"",setForMove:!1,setForRemoval:!1,hasAnimation:!1,removedBeforeQueried:!0},qt="__ng_removed",Rt=function(){function t(t,e){void 0===e&&(e=""),this.namespaceId=e;var n=t&&t.hasOwnProperty("value");if(this.value=function r(t){return null!=t?t:null}(n?t.value:t),n){var i=L(t);delete i.value,this.options=i}else this.options={};this.options.params||(this.options.params={})}return Object.defineProperty(t.prototype,"params",{get:function(){return this.options.params},enumerable:!0,configurable:!0}),t.prototype.absorbOptions=function(t){var e=t.params;if(e){var n=this.options.params;Object.keys(e).forEach((function(t){null==n[t]&&(n[t]=e[t])}))}},t}(),It=new Rt("void"),Kt=function(){function t(t,e,n){this.id=t,this.hostElement=e,this._engine=n,this.players=[],this._triggers={},this._queue=[],this._elementListeners=new Map,this._hostClassName="ng-tns-"+t,Yt(e,this._hostClassName)}return t.prototype.listen=function(t,e,n,r){var i=this;if(!this._triggers.hasOwnProperty(e))throw new Error('Unable to listen on the animation trigger event "'+n+'" because the animation trigger "'+e+"\" doesn't exist!");if(null==n||0==n.length)throw new Error('Unable to listen on the animation trigger "'+e+'" because the provided event is undefined!');if(!function o(t){return"start"==t||"done"==t}(n))throw new Error('The provided animation trigger event "'+n+'" for the animation trigger "'+e+'" is not supported!');var s=y(this._elementListeners,t,[]),a={name:e,phase:n,callback:r};s.push(a);var u=y(this._engine.statesByElement,t,{});return u.hasOwnProperty(e)||(Yt(t,"ng-trigger"),Yt(t,"ng-trigger-"+e),u[e]=It),function(){i._engine.afterFlush((function(){var t=s.indexOf(a);t>=0&&s.splice(t,1),i._triggers[e]||delete u[e]}))}},t.prototype.register=function(t,e){return!this._triggers[t]&&(this._triggers[t]=e,!0)},t.prototype._getTrigger=function(t){var e=this._triggers[t];if(!e)throw new Error('The provided animation trigger "'+t+'" has not been registered!');return e},t.prototype.trigger=function(t,e,n,r){var i=this;void 0===r&&(r=!0);var o=this._getTrigger(e),s=new Bt(this.id,e,t),a=this._engine.statesByElement.get(t);a||(Yt(t,"ng-trigger"),Yt(t,"ng-trigger-"+e),this._engine.statesByElement.set(t,a={}));var u=a[e],l=new Rt(n,this.id);if(!(n&&n.hasOwnProperty("value"))&&u&&l.absorbOptions(u.options),a[e]=l,u||(u=It),"void"===l.value||u.value!==l.value){var h=y(this._engine.playersByElement,t,[]);h.forEach((function(t){t.namespaceId==i.id&&t.triggerName==e&&t.queued&&t.destroy()}));var c=o.matchTransition(u.value,l.value,t,l.params),p=!1;if(!c){if(!r)return;c=o.fallbackTransition,p=!0}return this._engine.totalQueuedPlayers++,this._queue.push({element:t,triggerName:e,transition:c,fromState:u,toState:l,player:s,isFallbackTransition:p}),p||(Yt(t,"ng-animate-queued"),s.onStart((function(){$t(t,"ng-animate-queued")}))),s.onDone((function(){var e=i.players.indexOf(s);e>=0&&i.players.splice(e,1);var n=i._engine.playersByElement.get(t);if(n){var r=n.indexOf(s);r>=0&&n.splice(r,1)}})),this.players.push(s),h.push(s),s}if(!function f(t,e){var n=Object.keys(t),r=Object.keys(e);if(n.length!=r.length)return!1;for(var i=0;i<n.length;i++){var o=n[i];if(!e.hasOwnProperty(o)||t[o]!==e[o])return!1}return!0}(u.params,l.params)){var m=[],d=o.matchStyles(u.value,u.params,m),v=o.matchStyles(l.value,l.params,m);m.length?this._engine.reportError(m):this._engine.afterFlush((function(){K(t,d),I(t,v)}))}},t.prototype.deregister=function(t){var e=this;delete this._triggers[t],this._engine.statesByElement.forEach((function(e,n){delete e[t]})),this._elementListeners.forEach((function(n,r){e._elementListeners.set(r,n.filter((function(e){return e.name!=t})))}))},t.prototype.clearElementCache=function(t){this._engine.statesByElement.delete(t),this._elementListeners.delete(t);var e=this._engine.playersByElement.get(t);e&&(e.forEach((function(t){return t.destroy()})),this._engine.playersByElement.delete(t))},t.prototype._signalRemovalForInnerTriggers=function(t,e){var n=this,r=this._engine.driver.query(t,".ng-trigger",!0);r.forEach((function(t){if(!t[qt]){var r=n._engine.fetchNamespacesByElement(t);r.size?r.forEach((function(n){return n.triggerLeaveAnimation(t,e,!1,!0)})):n.clearElementCache(t)}})),this._engine.afterFlushAnimationsDone((function(){return r.forEach((function(t){return n.clearElementCache(t)}))}))},t.prototype.triggerLeaveAnimation=function(t,e,n,r){var i=this,o=this._engine.statesByElement.get(t);if(o){var s=[];if(Object.keys(o).forEach((function(e){if(i._triggers[e]){var n=i.trigger(t,e,"void",r);n&&s.push(n)}})),s.length)return this._engine.markElementAsRemoved(this.id,t,!0,e),n&&l(s).onDone((function(){return i._engine.processLeaveNode(t)})),!0}return!1},t.prototype.prepareLeaveAnimationListeners=function(t){var e=this,n=this._elementListeners.get(t);if(n){var r=new Set;n.forEach((function(n){var i=n.name;if(!r.has(i)){r.add(i);var o=e._triggers[i].fallbackTransition,s=e._engine.statesByElement.get(t)[i]||It,a=new Rt("void"),u=new Bt(e.id,i,t);e._engine.totalQueuedPlayers++,e._queue.push({element:t,triggerName:i,transition:o,fromState:s,toState:a,player:u,isFallbackTransition:!0})}}))}},t.prototype.removeNode=function(t,e){var n=this,r=this._engine;if(t.childElementCount&&this._signalRemovalForInnerTriggers(t,e),!this.triggerLeaveAnimation(t,e,!0)){var i=!1;if(r.totalAnimations){var o=r.players.length?r.playersByQueriedElement.get(t):[];if(o&&o.length)i=!0;else for(var s=t;s=s.parentNode;)if(r.statesByElement.get(s)){i=!0;break}}if(this.prepareLeaveAnimationListeners(t),i)r.markElementAsRemoved(this.id,t,!1,e);else{var a=t[qt];a&&a!==jt||(r.afterFlush((function(){return n.clearElementCache(t)})),r.destroyInnerAnimations(t),r._onRemovalComplete(t,e))}}},t.prototype.insertNode=function(t,e){Yt(t,this._hostClassName)},t.prototype.drainQueuedTransitions=function(t){var e=this,n=[];return this._queue.forEach((function(r){var i=r.player;if(!i.destroyed){var o=r.element,s=e._elementListeners.get(o);s&&s.forEach((function(e){if(e.name==r.triggerName){var n=f(o,r.triggerName,r.fromState.value,r.toState.value);n._data=t,c(r.player,e.phase,n,e.callback)}})),i.markedForDestroy?e._engine.afterFlush((function(){i.destroy()})):n.push(r)}})),this._queue=[],n.sort((function(t,n){var r=t.transition.ast.depCount,i=n.transition.ast.depCount;return 0==r||0==i?r-i:e._engine.driver.containsElement(t.element,n.element)?1:-1}))},t.prototype.destroy=function(t){this.players.forEach((function(t){return t.destroy()})),this._signalRemovalForInnerTriggers(this.hostElement,t)},t.prototype.elementContainsData=function(t){var e=!1;return this._elementListeners.has(t)&&(e=!0),!!this._queue.find((function(e){return e.element===t}))||e},t}(),Qt=function(){function t(t,e,n){this.bodyNode=t,this.driver=e,this._normalizer=n,this.players=[],this.newHostElements=new Map,this.playersByElement=new Map,this.playersByQueriedElement=new Map,this.statesByElement=new Map,this.disabledNodes=new Set,this.totalAnimations=0,this.totalQueuedPlayers=0,this._namespaceLookup={},this._namespaceList=[],this._flushFns=[],this._whenQuietFns=[],this.namespacesByHostElement=new Map,this.collectedEnterElements=[],this.collectedLeaveElements=[],this.onRemovalComplete=function(t,e){}}return t.prototype._onRemovalComplete=function(t,e){this.onRemovalComplete(t,e)},Object.defineProperty(t.prototype,"queuedPlayers",{get:function(){var t=[];return this._namespaceList.forEach((function(e){e.players.forEach((function(e){e.queued&&t.push(e)}))})),t},enumerable:!0,configurable:!0}),t.prototype.createNamespace=function(t,e){var n=new Kt(t,e,this);return e.parentNode?this._balanceNamespaceList(n,e):(this.newHostElements.set(e,n),this.collectEnterElement(e)),this._namespaceLookup[t]=n},t.prototype._balanceNamespaceList=function(t,e){var n=this._namespaceList.length-1;if(n>=0){for(var r=!1,i=n;i>=0;i--)if(this.driver.containsElement(this._namespaceList[i].hostElement,e)){this._namespaceList.splice(i+1,0,t),r=!0;break}r||this._namespaceList.splice(0,0,t)}else this._namespaceList.push(t);return this.namespacesByHostElement.set(e,t),t},t.prototype.register=function(t,e){var n=this._namespaceLookup[t];return n||(n=this.createNamespace(t,e)),n},t.prototype.registerTrigger=function(t,e,n){var r=this._namespaceLookup[t];r&&r.register(e,n)&&this.totalAnimations++},t.prototype.destroy=function(t,e){var n=this;if(t){var r=this._fetchNamespace(t);this.afterFlush((function(){n.namespacesByHostElement.delete(r.hostElement),delete n._namespaceLookup[t];var e=n._namespaceList.indexOf(r);e>=0&&n._namespaceList.splice(e,1)})),this.afterFlushAnimationsDone((function(){return r.destroy(e)}))}},t.prototype._fetchNamespace=function(t){return this._namespaceLookup[t]},t.prototype.fetchNamespacesByElement=function(t){var e=new Set,n=this.statesByElement.get(t);if(n)for(var r=Object.keys(n),i=0;i<r.length;i++){var o=n[r[i]].namespaceId;if(o){var s=this._fetchNamespace(o);s&&e.add(s)}}return e},t.prototype.trigger=function(t,e,n,r){if(Mt(e)){var i=this._fetchNamespace(t);if(i)return i.trigger(e,n,r),!0}return!1},t.prototype.insertNode=function(t,e,n,r){if(Mt(e)){var i=e[qt];if(i&&i.setForRemoval){i.setForRemoval=!1,i.setForMove=!0;var o=this.collectedLeaveElements.indexOf(e);o>=0&&this.collectedLeaveElements.splice(o,1)}if(t){var s=this._fetchNamespace(t);s&&s.insertNode(e,n)}r&&this.collectEnterElement(e)}},t.prototype.collectEnterElement=function(t){this.collectedEnterElements.push(t)},t.prototype.markElementAsDisabled=function(t,e){e?this.disabledNodes.has(t)||(this.disabledNodes.add(t),Yt(t,"ng-animate-disabled")):this.disabledNodes.has(t)&&(this.disabledNodes.delete(t),$t(t,"ng-animate-disabled"))},t.prototype.removeNode=function(t,e,n,r){if(Mt(e)){var i=t?this._fetchNamespace(t):null;if(i?i.removeNode(e,r):this.markElementAsRemoved(t,e,!1,r),n){var o=this.namespacesByHostElement.get(e);o&&o.id!==t&&o.removeNode(e,r)}}else this._onRemovalComplete(e,r)},t.prototype.markElementAsRemoved=function(t,e,n,r){this.collectedLeaveElements.push(e),e[qt]={namespaceId:t,setForRemoval:r,hasAnimation:n,removedBeforeQueried:!1}},t.prototype.listen=function(t,e,n,r,i){return Mt(e)?this._fetchNamespace(t).listen(e,n,r,i):function(){}},t.prototype._buildInstruction=function(t,e,n,r,i){return t.transition.build(this.driver,t.element,t.fromState.value,t.toState.value,n,r,t.fromState.options,t.toState.options,e,i)},t.prototype.destroyInnerAnimations=function(t){var e=this,n=this.driver.query(t,".ng-trigger",!0);n.forEach((function(t){return e.destroyActiveAnimationsForElement(t)})),0!=this.playersByQueriedElement.size&&(n=this.driver.query(t,".ng-animating",!0)).forEach((function(t){return e.finishActiveQueriedAnimationOnElement(t)}))},t.prototype.destroyActiveAnimationsForElement=function(t){var e=this.playersByElement.get(t);e&&e.forEach((function(t){t.queued?t.markedForDestroy=!0:t.destroy()}))},t.prototype.finishActiveQueriedAnimationOnElement=function(t){var e=this.playersByQueriedElement.get(t);e&&e.forEach((function(t){return t.finish()}))},t.prototype.whenRenderingDone=function(){var t=this;return new Promise((function(e){if(t.players.length)return l(t.players).onDone((function(){return e()}));e()}))},t.prototype.processLeaveNode=function(t){var e=this,n=t[qt];if(n&&n.setForRemoval){if(t[qt]=jt,n.namespaceId){this.destroyInnerAnimations(t);var r=this._fetchNamespace(n.namespaceId);r&&r.clearElementCache(t)}this._onRemovalComplete(t,n.setForRemoval)}this.driver.matchesElement(t,".ng-animate-disabled")&&this.markElementAsDisabled(t,!1),this.driver.query(t,".ng-animate-disabled",!0).forEach((function(t){e.markElementAsDisabled(t,!1)}))},t.prototype.flush=function(t){var e=this;void 0===t&&(t=-1);var n=[];if(this.newHostElements.size&&(this.newHostElements.forEach((function(t,n){return e._balanceNamespaceList(t,n)})),this.newHostElements.clear()),this.totalAnimations&&this.collectedEnterElements.length)for(var r=0;r<this.collectedEnterElements.length;r++)Yt(this.collectedEnterElements[r],"ng-star-inserted");if(this._namespaceList.length&&(this.totalQueuedPlayers||this.collectedLeaveElements.length)){var i=[];try{n=this._flushAnimations(i,t)}finally{for(r=0;r<i.length;r++)i[r]()}}else for(r=0;r<this.collectedLeaveElements.length;r++)this.processLeaveNode(this.collectedLeaveElements[r]);if(this.totalQueuedPlayers=0,this.collectedEnterElements.length=0,this.collectedLeaveElements.length=0,this._flushFns.forEach((function(t){return t()})),this._flushFns=[],this._whenQuietFns.length){var o=this._whenQuietFns;this._whenQuietFns=[],n.length?l(n).onDone((function(){o.forEach((function(t){return t()}))})):o.forEach((function(t){return t()}))}},t.prototype.reportError=function(t){throw new Error("Unable to process animations due to the following failed trigger transitions\n "+t.join("\n"))},t.prototype._flushAnimations=function(t,n){var r=this,i=new lt,s=[],u=new Map,h=[],c=new Map,p=new Map,f=new Map,m=new Set;this.disabledNodes.forEach((function(t){m.add(t);for(var e=r.driver.query(t,".ng-animate-queued",!0),n=0;n<e.length;n++)m.add(e[n])}));var d=this.bodyNode,v=Array.from(this.statesByElement.keys()),g=Wt(v,this.collectedEnterElements),_=new Map,S=0;g.forEach((function(t,e){var n="ng-enter"+S++;_.set(e,n),t.forEach((function(t){return Yt(t,n)}))}));for(var E=[],b=new Set,T=new Set,w=0;w<this.collectedLeaveElements.length;w++)(z=(M=this.collectedLeaveElements[w])[qt])&&z.setForRemoval&&(E.push(M),b.add(M),z.hasAnimation?this.driver.query(M,".ng-star-inserted",!0).forEach((function(t){return b.add(t)})):T.add(M));var P=new Map,k=Wt(v,Array.from(b));k.forEach((function(t,e){var n="ng-leave"+S++;P.set(e,n),t.forEach((function(t){return Yt(t,n)}))})),t.push((function(){g.forEach((function(t,e){var n=_.get(e);t.forEach((function(t){return $t(t,n)}))})),k.forEach((function(t,e){var n=P.get(e);t.forEach((function(t){return $t(t,n)}))})),E.forEach((function(t){r.processLeaveNode(t)}))}));for(var A=[],N=[],O=this._namespaceList.length-1;O>=0;O--)this._namespaceList[O].drainQueuedTransitions(n).forEach((function(t){var e=t.player,n=t.element;if(A.push(e),r.collectedEnterElements.length){var o=n[qt];if(o&&o.setForMove)return void e.destroy()}var a=!d||!r.driver.containsElement(d,n),u=P.get(n),l=_.get(n),m=r._buildInstruction(t,i,l,u,a);if(m.errors&&m.errors.length)N.push(m);else{if(a)return e.onStart((function(){return K(n,m.fromStyles)})),e.onDestroy((function(){return I(n,m.toStyles)})),void s.push(e);if(t.isFallbackTransition)return e.onStart((function(){return K(n,m.fromStyles)})),e.onDestroy((function(){return I(n,m.toStyles)})),void s.push(e);m.timelines.forEach((function(t){return t.stretchStartingKeyframe=!0})),i.append(n,m.timelines),h.push({instruction:m,player:e,element:n}),m.queriedElements.forEach((function(t){return y(c,t,[]).push(e)})),m.preStyleProps.forEach((function(t,e){var n=Object.keys(t);if(n.length){var r=p.get(e);r||p.set(e,r=new Set),n.forEach((function(t){return r.add(t)}))}})),m.postStyleProps.forEach((function(t,e){var n=Object.keys(t),r=f.get(e);r||f.set(e,r=new Set),n.forEach((function(t){return r.add(t)}))}))}}));if(N.length){var C=[];N.forEach((function(t){C.push("@"+t.triggerName+" has failed due to:\n"),t.errors.forEach((function(t){return C.push("- "+t+"\n")}))})),A.forEach((function(t){return t.destroy()})),this.reportError(C)}var F=new Map,D=new Map;h.forEach((function(t){var e=t.element;i.has(e)&&(D.set(e,e),r._beforeAnimationBuild(t.player.namespaceId,t.instruction,F))})),s.forEach((function(t){var e=t.element;r._getPreviousPlayers(e,!1,t.namespaceId,t.triggerName,null).forEach((function(t){y(F,e,[]).push(t),t.destroy()}))}));var L=E.filter((function(t){return Gt(t,p,f)})),j=new Map;Ut(j,this.driver,T,f,e.AUTO_STYLE).forEach((function(t){Gt(t,p,f)&&L.push(t)}));var x=new Map;g.forEach((function(t,n){Ut(x,r.driver,new Set(t),p,e.ɵPRE_STYLE)})),L.forEach((function(t){var e=j.get(t),n=x.get(t);j.set(t,o(o({},e),n))}));var q=[],R=[],Q={};h.forEach((function(t){var e=t.element,n=t.player,o=t.instruction;if(i.has(e)){if(m.has(e))return n.onDestroy((function(){return I(e,o.toStyles)})),n.disabled=!0,n.overrideTotalTime(o.totalTime),void s.push(n);var a=Q;if(D.size>1){for(var h=e,c=[];h=h.parentNode;){var p=D.get(h);if(p){a=p;break}c.push(h)}c.forEach((function(t){return D.set(t,a)}))}var f=r._buildAnimation(n.namespaceId,o,F,u,x,j);if(n.setRealPlayer(f),a===Q)q.push(n);else{var y=r.playersByElement.get(a);y&&y.length&&(n.parentPlayer=l(y)),s.push(n)}}else K(e,o.fromStyles),n.onDestroy((function(){return I(e,o.toStyles)})),R.push(n),m.has(e)&&s.push(n)})),R.forEach((function(t){var e=u.get(t.element);if(e&&e.length){var n=l(e);t.setRealPlayer(n)}})),s.forEach((function(t){t.parentPlayer?t.syncPlayerEvents(t.parentPlayer):t.destroy()}));for(var B=0;B<E.length;B++){var M,z=(M=E[B])[qt];if($t(M,"ng-leave"),!z||!z.hasAnimation){var U=[];if(c.size){var W=c.get(M);W&&W.length&&U.push.apply(U,a(W));for(var H=this.driver.query(M,".ng-animating",!0),Y=0;Y<H.length;Y++){var $=c.get(H[Y]);$&&$.length&&U.push.apply(U,a($))}}var V=U.filter((function(t){return!t.destroyed}));V.length?Vt(this,M,V):this.processLeaveNode(M)}}return E.length=0,q.forEach((function(t){r.players.push(t),t.onDone((function(){t.destroy();var e=r.players.indexOf(t);r.players.splice(e,1)})),t.play()})),q},t.prototype.elementContainsData=function(t,e){var n=!1,r=e[qt];return r&&r.setForRemoval&&(n=!0),this.playersByElement.has(e)&&(n=!0),this.playersByQueriedElement.has(e)&&(n=!0),this.statesByElement.has(e)&&(n=!0),this._fetchNamespace(t).elementContainsData(e)||n},t.prototype.afterFlush=function(t){this._flushFns.push(t)},t.prototype.afterFlushAnimationsDone=function(t){this._whenQuietFns.push(t)},t.prototype._getPreviousPlayers=function(t,e,n,r,i){var o=[];if(e){var s=this.playersByQueriedElement.get(t);s&&(o=s)}else{var a=this.playersByElement.get(t);if(a){var u=!i||"void"==i;a.forEach((function(t){t.queued||(u||t.triggerName==r)&&o.push(t)}))}}return(n||r)&&(o=o.filter((function(t){return!(n&&n!=t.namespaceId||r&&r!=t.triggerName)}))),o},t.prototype._beforeAnimationBuild=function(t,e,n){var r,i,o=e.element,s=e.isRemovalTransition?void 0:t,a=e.isRemovalTransition?void 0:e.triggerName,u=function(t){var r=t.element,i=r!==o,u=y(n,r,[]);l._getPreviousPlayers(r,i,s,a,e.toState).forEach((function(t){var e=t.getRealPlayer();e.beforeDestroy&&e.beforeDestroy(),t.destroy(),u.push(t)}))},l=this;try{for(var h=function c(t){var e="function"==typeof Symbol&&t[Symbol.iterator],n=0;return e?e.call(t):{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}}}(e.timelines),p=h.next();!p.done;p=h.next())u(p.value)}catch(t){r={error:t}}finally{try{p&&!p.done&&(i=h.return)&&i.call(h)}finally{if(r)throw r.error}}K(o,e.fromStyles)},t.prototype._buildAnimation=function(t,n,r,i,o,s){var a=this,u=n.triggerName,c=n.element,p=[],f=new Set,m=new Set,d=n.timelines.map((function(n){var l=n.element;f.add(l);var y=l[qt];if(y&&y.removedBeforeQueried)return new e.NoopAnimationPlayer(n.duration,n.delay);var d=l!==c,v=function g(t){var n=[];return function t(n,r){for(var i=0;i<n.length;i++){var o=n[i];o instanceof e.ɵAnimationGroupPlayer?t(o.players,r):r.push(o)}}(t,n),n}((r.get(l)||Lt).map((function(t){return t.getRealPlayer()}))).filter((function(t){return!!t.element&&t.element===l})),_=o.get(l),S=s.get(l),E=h(0,a._normalizer,0,n.keyframes,_,S),b=a._buildPlayer(n,E,v);if(n.subTimeline&&i&&m.add(l),d){var T=new Bt(t,u,l);T.setRealPlayer(b),p.push(T)}return b}));p.forEach((function(t){y(a.playersByQueriedElement,t.element,[]).push(t),t.onDone((function(){return function e(t,n,r){var i;if(t instanceof Map){if(i=t.get(n)){if(i.length){var o=i.indexOf(r);i.splice(o,1)}0==i.length&&t.delete(n)}}else(i=t[n])&&(i.length&&(o=i.indexOf(r),i.splice(o,1)),0==i.length&&delete t[n]);return i}(a.playersByQueriedElement,t.element,t)}))})),f.forEach((function(t){return Yt(t,"ng-animating")}));var v=l(d);return v.onDestroy((function(){f.forEach((function(t){return $t(t,"ng-animating")})),I(c,n.toStyles)})),m.forEach((function(t){y(i,t,[]).push(v)})),v},t.prototype._buildPlayer=function(t,n,r){return n.length>0?this.driver.animate(t.element,n,t.duration,t.delay,t.easing,r):new e.NoopAnimationPlayer(t.duration,t.delay)},t}(),Bt=function(){function t(t,n,r){this.namespaceId=t,this.triggerName=n,this.element=r,this._player=new e.NoopAnimationPlayer,this._containsRealPlayer=!1,this._queuedCallbacks={},this.destroyed=!1,this.markedForDestroy=!1,this.disabled=!1,this.queued=!0,this.totalTime=0}return t.prototype.setRealPlayer=function(t){var e=this;this._containsRealPlayer||(this._player=t,Object.keys(this._queuedCallbacks).forEach((function(n){e._queuedCallbacks[n].forEach((function(e){return c(t,n,void 0,e)}))})),this._queuedCallbacks={},this._containsRealPlayer=!0,this.overrideTotalTime(t.totalTime),this.queued=!1)},t.prototype.getRealPlayer=function(){return this._player},t.prototype.overrideTotalTime=function(t){this.totalTime=t},t.prototype.syncPlayerEvents=function(t){var e=this,n=this._player;n.triggerCallback&&t.onStart((function(){return n.triggerCallback("start")})),t.onDone((function(){return e.finish()})),t.onDestroy((function(){return e.destroy()}))},t.prototype._queueEvent=function(t,e){y(this._queuedCallbacks,t,[]).push(e)},t.prototype.onDone=function(t){this.queued&&this._queueEvent("done",t),this._player.onDone(t)},t.prototype.onStart=function(t){this.queued&&this._queueEvent("start",t),this._player.onStart(t)},t.prototype.onDestroy=function(t){this.queued&&this._queueEvent("destroy",t),this._player.onDestroy(t)},t.prototype.init=function(){this._player.init()},t.prototype.hasStarted=function(){return!this.queued&&this._player.hasStarted()},t.prototype.play=function(){!this.queued&&this._player.play()},t.prototype.pause=function(){!this.queued&&this._player.pause()},t.prototype.restart=function(){!this.queued&&this._player.restart()},t.prototype.finish=function(){this._player.finish()},t.prototype.destroy=function(){this.destroyed=!0,this._player.destroy()},t.prototype.reset=function(){!this.queued&&this._player.reset()},t.prototype.setPosition=function(t){this.queued||this._player.setPosition(t)},t.prototype.getPosition=function(){return this.queued?0:this._player.getPosition()},t.prototype.triggerCallback=function(t){var e=this._player;e.triggerCallback&&e.triggerCallback(t)},t}();function Mt(t){return t&&1===t.nodeType}function zt(t,e){var n=t.style.display;return t.style.display=null!=e?e:"none",n}function Ut(t,e,n,r,i){var o=[];n.forEach((function(t){return o.push(zt(t))}));var s=[];r.forEach((function(n,r){var o={};n.forEach((function(t){var n=o[t]=e.computeStyle(r,t,i);n&&0!=n.length||(r[qt]=xt,s.push(r))})),t.set(r,o)}));var a=0;return n.forEach((function(t){return zt(t,o[a++])})),s}function Wt(t,e){var n=new Map;if(t.forEach((function(t){return n.set(t,[])})),0==e.length)return n;var r=new Set(e),i=new Map;return e.forEach((function(t){var e=function t(e){if(!e)return 1;var o=i.get(e);if(o)return o;var s=e.parentNode;return o=n.has(s)?s:r.has(s)?1:t(s),i.set(e,o),o}(t);1!==e&&n.get(e).push(t)})),n}var Ht="$$classes";function Yt(t,e){if(t.classList)t.classList.add(e);else{var n=t[Ht];n||(n=t[Ht]={}),n[e]=!0}}function $t(t,e){if(t.classList)t.classList.remove(e);else{var n=t[Ht];n&&delete n[e]}}function Vt(t,e,n){l(n).onDone((function(){return t.processLeaveNode(e)}))}function Gt(t,e,n){var r=n.get(t);if(!r)return!1;var i=e.get(t);return i?r.forEach((function(t){return i.add(t)})):e.set(t,r),n.delete(t),!0}var Zt=function(){function t(t,e,n){var r=this;this.bodyNode=t,this._driver=e,this._triggerCache={},this.onRemovalComplete=function(t,e){},this._transitionEngine=new Qt(t,e,n),this._timelineEngine=new Dt(t,e,n),this._transitionEngine.onRemovalComplete=function(t,e){return r.onRemovalComplete(t,e)}}return t.prototype.registerTrigger=function(t,e,n,r,i){var o=t+"-"+r,s=this._triggerCache[o];if(!s){var a=[],u=nt(this._driver,i,a);if(a.length)throw new Error('The animation trigger "'+r+'" has failed to build due to the following errors:\n - '+a.join("\n - "));s=function l(t,e){return new Ot(t,e)}(r,u),this._triggerCache[o]=s}this._transitionEngine.registerTrigger(e,r,s)},t.prototype.register=function(t,e){this._transitionEngine.register(t,e)},t.prototype.destroy=function(t,e){this._transitionEngine.destroy(t,e)},t.prototype.onInsert=function(t,e,n,r){this._transitionEngine.insertNode(t,e,n,r)},t.prototype.onRemove=function(t,e,n,r){this._transitionEngine.removeNode(t,e,r||!1,n)},t.prototype.disableAnimations=function(t,e){this._transitionEngine.markElementAsDisabled(t,e)},t.prototype.process=function(t,e,n,r){if("@"==n.charAt(0)){var i=s(m(n),2);this._timelineEngine.command(i[0],e,i[1],r)}else this._transitionEngine.trigger(t,e,n,r)},t.prototype.listen=function(t,e,n,r,i){if("@"==n.charAt(0)){var o=s(m(n),2);return this._timelineEngine.listen(o[0],e,o[1],i)}return this._transitionEngine.listen(t,e,n,r,i)},t.prototype.flush=function(t){void 0===t&&(t=-1),this._transitionEngine.flush(t)},Object.defineProperty(t.prototype,"players",{get:function(){return this._transitionEngine.players.concat(this._timelineEngine.players)},enumerable:!0,configurable:!0}),t.prototype.whenRenderingDone=function(){return this._transitionEngine.whenRenderingDone()},t}();
|
|
42
42
|
/**
|
|
43
43
|
* @license
|
|
44
44
|
* Copyright Google Inc. All Rights Reserved.
|