You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by sc...@apache.org on 2018/04/30 19:32:23 UTC
[42/51] [partial] nifi-fds git commit: update gh-pages
http://git-wip-us.apache.org/repos/asf/nifi-fds/blob/4a326208/node_modules/@angular/animations/@angular/animations/browser.js.map
----------------------------------------------------------------------
diff --git a/node_modules/@angular/animations/@angular/animations/browser.js.map b/node_modules/@angular/animations/@angular/animations/browser.js.map
new file mode 100644
index 0000000..b4808b8
--- /dev/null
+++ b/node_modules/@angular/animations/@angular/animations/browser.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"browser.js","sources":["../../../../../packages/animations/browser/index.ts","../../../../../packages/animations/browser/public_api.ts","../../../../../packages/animations/browser/src/browser.ts","../../../../../packages/animations/browser/src/private_export.ts","../../../../../packages/animations/browser/src/render/web_animations/web_animations_driver.ts","../../../../../packages/animations/browser/src/render/web_animations/web_animations_player.ts","../../../../../packages/animations/browser/src/render/animation_engine_next.ts","../../../../../packages/animations/browser/src/render/transition_animation_engine.ts","../../../../../packages/animations/browser/src/render/timeline_animation_engine.ts","../../../../../packages/animations/browser/src/dsl/animation_trigger.ts","../../../../../packages/animations/browser/src/dsl/animation_transition_factory.ts","../../../../../packages/animations/browser/src/dsl/animation_transition_instruction.ts","../../../../../pack
ages/animations/browser/src/dsl/style_normalization/web_animations_style_normalizer.ts","../../../../../packages/animations/browser/src/dsl/style_normalization/animation_style_normalizer.ts","../../../../../packages/animations/browser/src/dsl/animation.ts","../../../../../packages/animations/browser/src/dsl/animation_timeline_builder.ts","../../../../../packages/animations/browser/src/dsl/element_instruction_map.ts","../../../../../packages/animations/browser/src/dsl/animation_timeline_instruction.ts","../../../../../packages/animations/browser/src/dsl/animation_ast_builder.ts","../../../../../packages/animations/browser/src/dsl/animation_transition_expr.ts","../../../../../packages/animations/browser/src/util.ts","../../../../../packages/animations/browser/src/render/animation_driver.ts","../../../../../packages/animations/browser/src/render/shared.ts"],"sourcesContent":["/**\n * Generated bundle index. Do not edit.\n */\n\nexport {AnimationDriver,ɵAnimation,ɵAnimationStyleNormal
izer,ɵNoopAnimationStyleNormalizer,ɵWebAnimationsStyleNormalizer,ɵNoopAnimationDriver,ɵAnimationEngine,ɵWebAnimationsDriver,ɵsupportsWebAnimations,ɵWebAnimationsPlayer} from './public_api';\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * @module\n * @description\n * Entry point for all public APIs of the animation package.\n */\nexport {AnimationDriver,ɵAnimation,ɵAnimationStyleNormalizer,ɵNoopAnimationStyleNormalizer,ɵWebAnimationsStyleNormalizer,ɵNoopAnimationDriver,ɵAnimationEngine,ɵWebAnimationsDriver,ɵsupportsWebAnimations,ɵWebAnimationsPlayer} from './src/browser';\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * @mo
dule\n * @description\n * Entry point for all animation APIs of the animation browser package.\n */\nexport {AnimationDriver} from './render/animation_driver';\nexport {ɵAnimation,ɵAnimationStyleNormalizer,ɵNoopAnimationStyleNormalizer,ɵWebAnimationsStyleNormalizer,ɵNoopAnimationDriver,ɵAnimationEngine,ɵWebAnimationsDriver,ɵsupportsWebAnimations,ɵWebAnimationsPlayer} from './private_export';\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nexport {Animation as ɵAnimation} from './dsl/animation';\nexport {AnimationStyleNormalizer as ɵAnimationStyleNormalizer, NoopAnimationStyleNormalizer as ɵNoopAnimationStyleNormalizer} from './dsl/style_normalization/animation_style_normalizer';\nexport {WebAnimationsStyleNormalizer as ɵWebAnimationsStyleNormalizer} from './dsl/style_normalization/web_animations_style_norma
lizer';\nexport {NoopAnimationDriver as ɵNoopAnimationDriver} from './render/animation_driver';\nexport {AnimationEngine as ɵAnimationEngine} from './render/animation_engine_next';\nexport {WebAnimationsDriver as ɵWebAnimationsDriver, supportsWebAnimations as ɵsupportsWebAnimations} from './render/web_animations/web_animations_driver';\nexport {WebAnimationsPlayer as ɵWebAnimationsPlayer} from './render/web_animations/web_animations_player';\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {AnimationPlayer, ɵStyleData} from '@angular/animations';\n\nimport {AnimationDriver} from '../animation_driver';\nimport {containsElement, invokeQuery, matchesElement} from '../shared';\n\nimport {WebAnimationsPlayer} from './web_animations_player';\nexport class WebAnimationsDriver implements AnimationDriver {\n/**\n *
@param {?} element\n * @param {?} selector\n * @return {?}\n */\nmatchesElement(element: any, selector: string): boolean {\n return matchesElement(element, selector);\n }\n/**\n * @param {?} elm1\n * @param {?} elm2\n * @return {?}\n */\ncontainsElement(elm1: any, elm2: any): boolean { return containsElement(elm1, elm2); }\n/**\n * @param {?} element\n * @param {?} selector\n * @param {?} multi\n * @return {?}\n */\nquery(element: any, selector: string, multi: boolean): any[] {\n return invokeQuery(element, selector, multi);\n }\n/**\n * @param {?} element\n * @param {?} prop\n * @param {?=} defaultValue\n * @return {?}\n */\ncomputeStyle(element: any, prop: string, defaultValue?: string): string {\n return /** @type {?} */(( ( /** @type {?} */((window.getComputedStyle(element) as any)))[prop] as string));\n }\n/**\n * @param {?} element\n * @param {?} keyframes\n * @param {?} duration\n * @param {?} delay\n * @param {?} easing\n * @param {?=} previousPlayers\n * @retur
n {?}\n */\nanimate(\n element: any, keyframes: ɵStyleData[], duration: number, delay: number, easing: string,\n previousPlayers: AnimationPlayer[] = []): WebAnimationsPlayer {\n const /** @type {?} */ fill = delay == 0 ? 'both' : 'forwards';\n const /** @type {?} */ playerOptions: {[key: string]: string | number} = {duration, delay, fill};\n\n // we check for this to avoid having a null|undefined value be present\n // for the easing (which results in an error for certain browsers #9752)\n if (easing) {\n playerOptions['easing'] = easing;\n }\n\n const /** @type {?} */ previousWebAnimationPlayers = /** @type {?} */(( <WebAnimationsPlayer[]>previousPlayers.filter(\n player => { return player instanceof WebAnimationsPlayer; })));\n return new WebAnimationsPlayer(element, keyframes, playerOptions, previousWebAnimationPlayers);\n }\n}\n/**\n * @return {?}\n */\nexport function supportsWebAnimations() {\n return typeof Element !== 'undefin
ed' && typeof( /** @type {?} */((<any>Element))).prototype['animate'] === 'function';\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {AnimationPlayer} from '@angular/animations';\n\nimport {allowPreviousPlayerStylesMerge, copyStyles} from '../../util';\n\nimport {DOMAnimation} from './dom_animation';\nexport class WebAnimationsPlayer implements AnimationPlayer {\nprivate _onDoneFns: Function[] = [];\nprivate _onStartFns: Function[] = [];\nprivate _onDestroyFns: Function[] = [];\nprivate _player: DOMAnimation;\nprivate _duration: number;\nprivate _delay: number;\nprivate _initialized = false;\nprivate _finished = false;\nprivate _started = false;\nprivate _destroyed = false;\nprivate _finalKeyframe: {[key: string]: string | number};\npublic time = 0;\npublic parentPlayer: AnimationPlayer|null = null;\npublic
previousStyles: {[styleName: string]: string | number} = {};\npublic currentSnapshot: {[styleName: string]: string | number} = {};\n/**\n * @param {?} element\n * @param {?} keyframes\n * @param {?} options\n * @param {?=} previousPlayers\n */\nconstructor(\npublic element: any,\npublic keyframes: {[key: string]: string | number}[],\npublic options: {[key: string]: string | number},\nprivate previousPlayers: WebAnimationsPlayer[] = []) {\n this._duration = <number>options['duration'];\n this._delay = <number>options['delay'] || 0;\n this.time = this._duration + this._delay;\n\n if (allowPreviousPlayerStylesMerge(this._duration, this._delay)) {\n previousPlayers.forEach(player => {\n let styles = player.currentSnapshot;\n Object.keys(styles).forEach(prop => this.previousStyles[prop] = styles[prop]);\n });\n }\n }\n/**\n * @return {?}\n */\nprivate _onFinish() {\n if (!this._finished) {\n this._finished = true;\n this._onDoneFns.fo
rEach(fn => fn());\n this._onDoneFns = [];\n }\n }\n/**\n * @return {?}\n */\ninit(): void {\n this._buildPlayer();\n this._preparePlayerBeforeStart();\n }\n/**\n * @return {?}\n */\nprivate _buildPlayer(): void {\n if (this._initialized) return;\n this._initialized = true;\n\n const /** @type {?} */ keyframes = this.keyframes.map(styles => copyStyles(styles, false));\n const /** @type {?} */ previousStyleProps = Object.keys(this.previousStyles);\n if (previousStyleProps.length) {\n let /** @type {?} */ startingKeyframe = keyframes[0];\n let /** @type {?} */ missingStyleProps: string[] = [];\n previousStyleProps.forEach(prop => {\n if (!startingKeyframe.hasOwnProperty(prop)) {\n missingStyleProps.push(prop);\n }\n startingKeyframe[prop] = this.previousStyles[prop];\n });\n\n if (missingStyleProps.length) {\n const /** @type {?} */ self = this;\n // tslint:disable-next-line\n fo
r (var /** @type {?} */ i = 1; i < keyframes.length; i++) {\n let /** @type {?} */ kf = keyframes[i];\n missingStyleProps.forEach(function(prop) {\n kf[prop] = _computeStyle(self.element, prop);\n });\n }\n }\n }\n\n this._player = this._triggerWebAnimation(this.element, keyframes, this.options);\n this._finalKeyframe = keyframes.length ? keyframes[keyframes.length - 1] : {};\n this._player.addEventListener('finish', () => this._onFinish());\n }\n/**\n * @return {?}\n */\nprivate _preparePlayerBeforeStart() {\n // this is required so that the player doesn't start to animate right away\n if (this._delay) {\n this._resetDomPlayerState();\n } else {\n this._player.pause();\n }\n }\n/**\n * \\@internal\n * @param {?} element\n * @param {?} keyframes\n * @param {?} options\n * @return {?}\n */\n_triggerWebAnimation(element: any, keyframes: any[], options: any): DOMAnimation {\n // jscompiler doesn't
seem to know animate is a native property because it's not fully\n // supported yet across common browsers (we polyfill it for Edge/Safari) [CL #143630929]\n return /** @type {?} */(( element['animate'](keyframes, options) as DOMAnimation));\n }\n/**\n * @return {?}\n */\nget domPlayer() { return this._player; }\n/**\n * @param {?} fn\n * @return {?}\n */\nonStart(fn: () => void): void { this._onStartFns.push(fn); }\n/**\n * @param {?} fn\n * @return {?}\n */\nonDone(fn: () => void): void { this._onDoneFns.push(fn); }\n/**\n * @param {?} fn\n * @return {?}\n */\nonDestroy(fn: () => void): void { this._onDestroyFns.push(fn); }\n/**\n * @return {?}\n */\nplay(): void {\n this._buildPlayer();\n if (!this.hasStarted()) {\n this._onStartFns.forEach(fn => fn());\n this._onStartFns = [];\n this._started = true;\n }\n this._player.play();\n }\n/**\n * @return {?}\n */\npause(): void {\n this.init();\n this._player.pause();\n }\n/**\n * @return {?}\n
*/\nfinish(): void {\n this.init();\n this._onFinish();\n this._player.finish();\n }\n/**\n * @return {?}\n */\nreset(): void {\n this._resetDomPlayerState();\n this._destroyed = false;\n this._finished = false;\n this._started = false;\n }\n/**\n * @return {?}\n */\nprivate _resetDomPlayerState() {\n if (this._player) {\n this._player.cancel();\n }\n }\n/**\n * @return {?}\n */\nrestart(): void {\n this.reset();\n this.play();\n }\n/**\n * @return {?}\n */\nhasStarted(): boolean { return this._started; }\n/**\n * @return {?}\n */\ndestroy(): void {\n if (!this._destroyed) {\n this._destroyed = true;\n this._resetDomPlayerState();\n this._onFinish();\n this._onDestroyFns.forEach(fn => fn());\n this._onDestroyFns = [];\n }\n }\n/**\n * @param {?} p\n * @return {?}\n */\nsetPosition(p: number): void { this._player.currentTime = p * this.time; }\n/**\n * @return {?}\n */\ngetPosition(): number { return this._pla
yer.currentTime / this.time; }\n/**\n * @return {?}\n */\nget totalTime(): number { return this._delay + this._duration; }\n/**\n * @return {?}\n */\nbeforeDestroy() {\n const /** @type {?} */ styles: {[key: string]: string | number} = {};\n if (this.hasStarted()) {\n Object.keys(this._finalKeyframe).forEach(prop => {\n if (prop != 'offset') {\n styles[prop] =\n this._finished ? this._finalKeyframe[prop] : _computeStyle(this.element, prop);\n }\n });\n }\n this.currentSnapshot = styles;\n }\n}\n\nfunction WebAnimationsPlayer_tsickle_Closure_declarations() {\n/** @type {?} */\nWebAnimationsPlayer.prototype._onDoneFns;\n/** @type {?} */\nWebAnimationsPlayer.prototype._onStartFns;\n/** @type {?} */\nWebAnimationsPlayer.prototype._onDestroyFns;\n/** @type {?} */\nWebAnimationsPlayer.prototype._player;\n/** @type {?} */\nWebAnimationsPlayer.prototype._duration;\n/** @type {?} */\nWebAnimationsPlayer.prototype._delay;\n/** @type {
?} */\nWebAnimationsPlayer.prototype._initialized;\n/** @type {?} */\nWebAnimationsPlayer.prototype._finished;\n/** @type {?} */\nWebAnimationsPlayer.prototype._started;\n/** @type {?} */\nWebAnimationsPlayer.prototype._destroyed;\n/** @type {?} */\nWebAnimationsPlayer.prototype._finalKeyframe;\n/** @type {?} */\nWebAnimationsPlayer.prototype.time;\n/** @type {?} */\nWebAnimationsPlayer.prototype.parentPlayer;\n/** @type {?} */\nWebAnimationsPlayer.prototype.previousStyles;\n/** @type {?} */\nWebAnimationsPlayer.prototype.currentSnapshot;\n/** @type {?} */\nWebAnimationsPlayer.prototype.element;\n/** @type {?} */\nWebAnimationsPlayer.prototype.keyframes;\n/** @type {?} */\nWebAnimationsPlayer.prototype.options;\n/** @type {?} */\nWebAnimationsPlayer.prototype.previousPlayers;\n}\n\n/**\n * @param {?} element\n * @param {?} prop\n * @return {?}\n */\nfunction _computeStyle(element: any, prop: string): string {\n return ( /** @type {?} */((<any>window.getComputedStyle(element))))[pro
p];\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {AnimationMetadata, AnimationPlayer, AnimationTriggerMetadata} from '@angular/animations';\nimport {TriggerAst} from '../dsl/animation_ast';\nimport {buildAnimationAst} from '../dsl/animation_ast_builder';\nimport {AnimationTrigger, buildTrigger} from '../dsl/animation_trigger';\nimport {AnimationStyleNormalizer} from '../dsl/style_normalization/animation_style_normalizer';\n\nimport {AnimationDriver} from './animation_driver';\nimport {parseTimelineCommand} from './shared';\nimport {TimelineAnimationEngine} from './timeline_animation_engine';\nimport {TransitionAnimationEngine} from './transition_animation_engine';\nexport class AnimationEngine {\nprivate _transitionEngine: TransitionAnimationEngine;\nprivate _timelineEngine: TimelineAnimationEngine;\npriv
ate _triggerCache: {[key: string]: AnimationTrigger} = {};\npublic onRemovalComplete = (element: any, context: any) => {};\n/**\n * @param {?} driver\n * @param {?} normalizer\n */\nconstructor(driver: AnimationDriver, normalizer: AnimationStyleNormalizer) {\n this._transitionEngine = new TransitionAnimationEngine(driver, normalizer);\n this._timelineEngine = new TimelineAnimationEngine(driver, normalizer);\n\n this._transitionEngine.onRemovalComplete = (element: any, context: any) =>\n this.onRemovalComplete(element, context);\n }\n/**\n * @param {?} componentId\n * @param {?} namespaceId\n * @param {?} hostElement\n * @param {?} name\n * @param {?} metadata\n * @return {?}\n */\nregisterTrigger(\n componentId: string, namespaceId: string, hostElement: any, name: string,\n metadata: AnimationTriggerMetadata): void {\n const /** @type {?} */ cacheKey = componentId + '-' + name;\n let /** @type {?} */ trigger = this._triggerCache[cacheKey];\n if (!
trigger) {\n const /** @type {?} */ errors: any[] = [];\n const /** @type {?} */ ast = /** @type {?} */(( buildAnimationAst( /** @type {?} */((metadata as AnimationMetadata)), errors) as TriggerAst));\n if (errors.length) {\n throw new Error(\n `The animation trigger \"${name}\" has failed to build due to the following errors:\\n - ${errors.join(\"\\n - \")}`);\n }\n trigger = buildTrigger(name, ast);\n this._triggerCache[cacheKey] = trigger;\n }\n this._transitionEngine.registerTrigger(namespaceId, name, trigger);\n }\n/**\n * @param {?} namespaceId\n * @param {?} hostElement\n * @return {?}\n */\nregister(namespaceId: string, hostElement: any) {\n this._transitionEngine.register(namespaceId, hostElement);\n }\n/**\n * @param {?} namespaceId\n * @param {?} context\n * @return {?}\n */\ndestroy(namespaceId: string, context: any) {\n this._transitionEngine.destroy(namespaceId, context);\n }\n/**\n * @param {?} namespaceId
\n * @param {?} element\n * @param {?} parent\n * @param {?} insertBefore\n * @return {?}\n */\nonInsert(namespaceId: string, element: any, parent: any, insertBefore: boolean): void {\n this._transitionEngine.insertNode(namespaceId, element, parent, insertBefore);\n }\n/**\n * @param {?} namespaceId\n * @param {?} element\n * @param {?} context\n * @return {?}\n */\nonRemove(namespaceId: string, element: any, context: any): void {\n this._transitionEngine.removeNode(namespaceId, element, context);\n }\n/**\n * @param {?} element\n * @param {?} disable\n * @return {?}\n */\ndisableAnimations(element: any, disable: boolean) {\n this._transitionEngine.markElementAsDisabled(element, disable);\n }\n/**\n * @param {?} namespaceId\n * @param {?} element\n * @param {?} property\n * @param {?} value\n * @return {?}\n */\nprocess(namespaceId: string, element: any, property: string, value: any) {\n if (property.charAt(0) == '@') {\n const [id, action] = parseTimelineCommand
(property);\n const /** @type {?} */ args = /** @type {?} */(( value as any[]));\n this._timelineEngine.command(id, element, action, args);\n } else {\n this._transitionEngine.trigger(namespaceId, element, property, value);\n }\n }\n/**\n * @param {?} namespaceId\n * @param {?} element\n * @param {?} eventName\n * @param {?} eventPhase\n * @param {?} callback\n * @return {?}\n */\nlisten(\n namespaceId: string, element: any, eventName: string, eventPhase: string,\n callback: (event: any) => any): () => any {\n // @@listen\n if (eventName.charAt(0) == '@') {\n const [id, action] = parseTimelineCommand(eventName);\n return this._timelineEngine.listen(id, element, action, callback);\n }\n return this._transitionEngine.listen(namespaceId, element, eventName, eventPhase, callback);\n }\n/**\n * @param {?=} microtaskId\n * @return {?}\n */\nflush(microtaskId: number = -1): void { this._transitionEngine.flush(microtaskId); }\n/**\n * @
return {?}\n */\nget players(): AnimationPlayer[] {\n return ( /** @type {?} */((this._transitionEngine.players as AnimationPlayer[])))\n .concat( /** @type {?} */((this._timelineEngine.players as AnimationPlayer[])));\n }\n/**\n * @return {?}\n */\nwhenRenderingDone(): Promise<any> { return this._transitionEngine.whenRenderingDone(); }\n}\n\nfunction AnimationEngine_tsickle_Closure_declarations() {\n/** @type {?} */\nAnimationEngine.prototype._transitionEngine;\n/** @type {?} */\nAnimationEngine.prototype._timelineEngine;\n/** @type {?} */\nAnimationEngine.prototype._triggerCache;\n/** @type {?} */\nAnimationEngine.prototype.onRemovalComplete;\n}\n\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {AUTO_STYLE, AnimationOptions, AnimationPlayer, NoopAnimationPlayer, ɵAnimationGroupPlayer as AnimationG
roupPlayer, ɵPRE_STYLE as PRE_STYLE, ɵStyleData} from '@angular/animations';\n\nimport {AnimationTimelineInstruction} from '../dsl/animation_timeline_instruction';\nimport {AnimationTransitionFactory} from '../dsl/animation_transition_factory';\nimport {AnimationTransitionInstruction} from '../dsl/animation_transition_instruction';\nimport {AnimationTrigger} from '../dsl/animation_trigger';\nimport {ElementInstructionMap} from '../dsl/element_instruction_map';\nimport {AnimationStyleNormalizer} from '../dsl/style_normalization/animation_style_normalizer';\nimport {ENTER_CLASSNAME, LEAVE_CLASSNAME, NG_ANIMATING_CLASSNAME, NG_ANIMATING_SELECTOR, NG_TRIGGER_CLASSNAME, NG_TRIGGER_SELECTOR, copyObj, eraseStyles, setStyles} from '../util';\n\nimport {AnimationDriver} from './animation_driver';\nimport {getOrSetAsInMap, listenOnPlayer, makeAnimationEvent, normalizeKeyframes, optimizeGroupPlayer} from './shared';\n\nconst /** @type {?} */ QUEUED_CLASSNAME = 'ng-animate-queued';\nconst /**
@type {?} */ QUEUED_SELECTOR = '.ng-animate-queued';\nconst /** @type {?} */ DISABLED_CLASSNAME = 'ng-animate-disabled';\nconst /** @type {?} */ DISABLED_SELECTOR = '.ng-animate-disabled';\n\nconst /** @type {?} */ EMPTY_PLAYER_ARRAY: TransitionAnimationPlayer[] = [];\nconst /** @type {?} */ NULL_REMOVAL_STATE: ElementAnimationState = {\n namespaceId: '',\n setForRemoval: null,\n hasAnimation: false,\n removedBeforeQueried: false\n};\nconst /** @type {?} */ NULL_REMOVED_QUERIED_STATE: ElementAnimationState = {\n namespaceId: '',\n setForRemoval: null,\n hasAnimation: false,\n removedBeforeQueried: true\n};\n\ninterface TriggerListener {\n name: string;\n phase: string;\n callback: (event: any) => any;\n}\n\nexport interface QueueInstruction {\n element: any;\n triggerName: string;\n fromState: StateValue;\n toState: StateValue;\n transition: AnimationTransitionFactory;\n player: TransitionAnimationPlayer;\n isFallbackTransition: boolean;\n}\n\nexport const /** @ty
pe {?} */ REMOVAL_FLAG = '__ng_removed';\n\nexport interface ElementAnimationState {\n setForRemoval: any;\n hasAnimation: boolean;\n namespaceId: string;\n removedBeforeQueried: boolean;\n}\nexport class StateValue {\npublic value: string;\npublic options: AnimationOptions;\n/**\n * @return {?}\n */\nget params(): {[key: string]: any} { return /** @type {?} */(( this.options.params as{[key: string]: any})); }\n/**\n * @param {?} input\n */\nconstructor(input: any) {\n const isObj = input && input.hasOwnProperty('value');\n const value = isObj ? input['value'] : input;\n this.value = normalizeTriggerValue(value);\n if (isObj) {\n const options = copyObj(input as any);\n delete options['value'];\n this.options = options as AnimationOptions;\n } else {\n this.options = {};\n }\n if (!this.options.params) {\n this.options.params = {};\n }\n }\n/**\n * @param {?} options\n * @return {?}\n */\nabsorbOptions(options: AnimationOptions)
{\n const /** @type {?} */ newParams = options.params;\n if (newParams) {\n const /** @type {?} */ oldParams = /** @type {?} */(( this.options.params));\n Object.keys(newParams).forEach(prop => {\n if (oldParams[prop] == null) {\n oldParams[prop] = newParams[prop];\n }\n });\n }\n }\n}\n\nfunction StateValue_tsickle_Closure_declarations() {\n/** @type {?} */\nStateValue.prototype.value;\n/** @type {?} */\nStateValue.prototype.options;\n}\n\n\nexport const /** @type {?} */ VOID_VALUE = 'void';\nexport const /** @type {?} */ DEFAULT_STATE_VALUE = new StateValue(VOID_VALUE);\nexport const /** @type {?} */ DELETED_STATE_VALUE = new StateValue('DELETED');\nexport class AnimationTransitionNamespace {\npublic players: TransitionAnimationPlayer[] = [];\nprivate _triggers: {[triggerName: string]: AnimationTrigger} = {};\nprivate _queue: QueueInstruction[] = [];\nprivate _elementListeners = new Map<any, TriggerListener[]>();\nprivate _hostClassN
ame: string;\n/**\n * @param {?} id\n * @param {?} hostElement\n * @param {?} _engine\n */\nconstructor(\npublic id: string,\npublic hostElement: any,\nprivate _engine: TransitionAnimationEngine) {\n this._hostClassName = 'ng-tns-' + id;\n addClass(hostElement, this._hostClassName);\n }\n/**\n * @param {?} element\n * @param {?} name\n * @param {?} phase\n * @param {?} callback\n * @return {?}\n */\nlisten(element: any, name: string, phase: string, callback: (event: any) => boolean): () => any {\n if (!this._triggers.hasOwnProperty(name)) {\n throw new Error(`Unable to listen on the animation trigger event \"${\n phase}\" because the animation trigger \"${name}\" doesn\\'t exist!`);\n }\n\n if (phase == null || phase.length == 0) {\n throw new Error(`Unable to listen on the animation trigger \"${\n name}\" because the provided event is undefined!`);\n }\n\n if (!isTriggerEventValid(phase)) {\n throw new Error(`The provided anima
tion trigger event \"${phase}\" for the animation trigger \"${\n name}\" is not supported!`);\n }\n\n const /** @type {?} */ listeners = getOrSetAsInMap(this._elementListeners, element, []);\n const /** @type {?} */ data = {name, phase, callback};\n listeners.push(data);\n\n const /** @type {?} */ triggersWithStates = getOrSetAsInMap(this._engine.statesByElement, element, {});\n if (!triggersWithStates.hasOwnProperty(name)) {\n addClass(element, NG_TRIGGER_CLASSNAME);\n addClass(element, NG_TRIGGER_CLASSNAME + '-' + name);\n triggersWithStates[name] = null;\n }\n\n return () => {\n // the event listener is removed AFTER the flush has occurred such\n // that leave animations callbacks can fire (otherwise if the node\n // is removed in between then the listeners would be deregistered)\n this._engine.afterFlush(() => {\n const /** @type {?} */ index = listeners.indexOf(data);\n if (index >= 0) {\n
listeners.splice(index, 1);\n }\n\n if (!this._triggers[name]) {\n delete triggersWithStates[name];\n }\n });\n };\n }\n/**\n * @param {?} name\n * @param {?} ast\n * @return {?}\n */\nregister(name: string, ast: AnimationTrigger): boolean {\n if (this._triggers[name]) {\n // throw\n return false;\n } else {\n this._triggers[name] = ast;\n return true;\n }\n }\n/**\n * @param {?} name\n * @return {?}\n */\nprivate _getTrigger(name: string) {\n const /** @type {?} */ trigger = this._triggers[name];\n if (!trigger) {\n throw new Error(`The provided animation trigger \"${name}\" has not been registered!`);\n }\n return trigger;\n }\n/**\n * @param {?} element\n * @param {?} triggerName\n * @param {?} value\n * @param {?=} defaultToFallback\n * @return {?}\n */\ntrigger(element: any, triggerName: string, value: any, defaultToFallback: boolean = true):\n TransitionAnimationPlayer|undefined {\n
const /** @type {?} */ trigger = this._getTrigger(triggerName);\n const /** @type {?} */ player = new TransitionAnimationPlayer(this.id, triggerName, element);\n\n let /** @type {?} */ triggersWithStates = this._engine.statesByElement.get(element);\n if (!triggersWithStates) {\n addClass(element, NG_TRIGGER_CLASSNAME);\n addClass(element, NG_TRIGGER_CLASSNAME + '-' + triggerName);\n this._engine.statesByElement.set(element, triggersWithStates = {});\n }\n\n let /** @type {?} */ fromState = triggersWithStates[triggerName];\n const /** @type {?} */ toState = new StateValue(value);\n\n const /** @type {?} */ isObj = value && value.hasOwnProperty('value');\n if (!isObj && fromState) {\n toState.absorbOptions(fromState.options);\n }\n\n triggersWithStates[triggerName] = toState;\n\n if (!fromState) {\n fromState = DEFAULT_STATE_VALUE;\n } else if (fromState === DELETED_STATE_VALUE) {\n return player;\n }\n\n const
/** @type {?} */ isRemoval = toState.value === VOID_VALUE;\n\n // normally this isn't reached by here, however, if an object expression\n // is passed in then it may be a new object each time. Comparing the value\n // is important since that will stay the same despite there being a new object.\n // The removal arc here is special cased because the same element is triggered\n // twice in the event that it contains animations on the outer/inner portions\n // of the host container\n if (!isRemoval && fromState.value === toState.value) {\n // this means that despite the value not changing, some inner params\n // have changed which means that the animation final styles need to be applied\n if (!objEquals(fromState.params, toState.params)) {\n const /** @type {?} */ errors: any[] = [];\n const /** @type {?} */ fromStyles = trigger.matchStyles(fromState.value, fromState.params, errors);\n const /** @type {?} */ toStyles = trigger.mat
chStyles(toState.value, toState.params, errors);\n if (errors.length) {\n this._engine.reportError(errors);\n } else {\n this._engine.afterFlush(() => {\n eraseStyles(element, fromStyles);\n setStyles(element, toStyles);\n });\n }\n }\n return;\n }\n\n const /** @type {?} */ playersOnElement: TransitionAnimationPlayer[] =\n getOrSetAsInMap(this._engine.playersByElement, element, []);\n playersOnElement.forEach(player => {\n // only remove the player if it is queued on the EXACT same trigger/namespace\n // we only also deal with queued players here because if the animation has\n // started then we want to keep the player alive until the flush happens\n // (which is where the previousPlayers are passed into the new palyer)\n if (player.namespaceId == this.id && player.triggerName == triggerName && player.queued) {\n player.destroy();\n }\n });\n\n
let /** @type {?} */ transition = trigger.matchTransition(fromState.value, toState.value);\n let /** @type {?} */ isFallbackTransition = false;\n if (!transition) {\n if (!defaultToFallback) return;\n transition = trigger.fallbackTransition;\n isFallbackTransition = true;\n }\n\n this._engine.totalQueuedPlayers++;\n this._queue.push(\n {element, triggerName, transition, fromState, toState, player, isFallbackTransition});\n\n if (!isFallbackTransition) {\n addClass(element, QUEUED_CLASSNAME);\n player.onStart(() => { removeClass(element, QUEUED_CLASSNAME); });\n }\n\n player.onDone(() => {\n let /** @type {?} */ index = this.players.indexOf(player);\n if (index >= 0) {\n this.players.splice(index, 1);\n }\n\n const /** @type {?} */ players = this._engine.playersByElement.get(element);\n if (players) {\n let /** @type {?} */ index = players.indexOf(player);\n if (index >= 0) {\n
players.splice(index, 1);\n }\n }\n });\n\n this.players.push(player);\n playersOnElement.push(player);\n\n return player;\n }\n/**\n * @param {?} name\n * @return {?}\n */\nderegister(name: string) {\n delete this._triggers[name];\n\n this._engine.statesByElement.forEach((stateMap, element) => { delete stateMap[name]; });\n\n this._elementListeners.forEach((listeners, element) => {\n this._elementListeners.set(\n element, listeners.filter(entry => { return entry.name != name; }));\n });\n }\n/**\n * @param {?} element\n * @return {?}\n */\nclearElementCache(element: any) {\n this._engine.statesByElement.delete(element);\n this._elementListeners.delete(element);\n const /** @type {?} */ elementPlayers = this._engine.playersByElement.get(element);\n if (elementPlayers) {\n elementPlayers.forEach(player => player.destroy());\n this._engine.playersByElement.delete(element);\n }\n }\n/**\n * @param {?} roo
tElement\n * @param {?} context\n * @param {?=} animate\n * @return {?}\n */\nprivate _destroyInnerNodes(rootElement: any, context: any, animate: boolean = false) {\n this._engine.driver.query(rootElement, NG_TRIGGER_SELECTOR, true).forEach(elm => {\n if (animate && containsClass(elm, this._hostClassName)) {\n const /** @type {?} */ innerNs = this._engine.namespacesByHostElement.get(elm);\n\n // special case for a host element with animations on the same element\n if (innerNs) {\n innerNs.removeNode(elm, context, true);\n }\n\n this.removeNode(elm, context, true);\n } else {\n this.clearElementCache(elm);\n }\n });\n }\n/**\n * @param {?} element\n * @param {?} context\n * @param {?=} doNotRecurse\n * @return {?}\n */\nremoveNode(element: any, context: any, doNotRecurse?: boolean): void {\n const /** @type {?} */ engine = this._engine;\n\n if (!doNotRecurse && element.childElementCount) {\n this._des
troyInnerNodes(element, context, true);\n }\n\n const /** @type {?} */ triggerStates = engine.statesByElement.get(element);\n if (triggerStates) {\n const /** @type {?} */ players: TransitionAnimationPlayer[] = [];\n Object.keys(triggerStates).forEach(triggerName => {\n // this check is here in the event that an element is removed\n // twice (both on the host level and the component level)\n if (this._triggers[triggerName]) {\n const /** @type {?} */ player = this.trigger(element, triggerName, VOID_VALUE, false);\n if (player) {\n players.push(player);\n }\n }\n });\n\n if (players.length) {\n engine.markElementAsRemoved(this.id, element, true, context);\n optimizeGroupPlayer(players).onDone(() => engine.processLeaveNode(element));\n return;\n }\n }\n\n // find the player that is animating and make sure that the\n // removal is delayed until that player h
as completed\n let /** @type {?} */ containsPotentialParentTransition = false;\n if (engine.totalAnimations) {\n const /** @type {?} */ currentPlayers =\n engine.players.length ? engine.playersByQueriedElement.get(element) : [];\n\n // when this `if statement` does not continue forward it means that\n // a previous animation query has selected the current element and\n // is animating it. In this situation want to continue fowards and\n // allow the element to be queued up for animation later.\n if (currentPlayers && currentPlayers.length) {\n containsPotentialParentTransition = true;\n } else {\n let /** @type {?} */ parent = element;\n while (parent = parent.parentNode) {\n const /** @type {?} */ triggers = engine.statesByElement.get(parent);\n if (triggers) {\n containsPotentialParentTransition = true;\n break;\n }\n }\n }\n }\n\n // at this st
age we know that the element will either get removed\n // during flush or will be picked up by a parent query. Either way\n // we need to fire the listeners for this element when it DOES get\n // removed (once the query parent animation is done or after flush)\n const /** @type {?} */ listeners = this._elementListeners.get(element);\n if (listeners) {\n const /** @type {?} */ visitedTriggers = new Set<string>();\n listeners.forEach(listener => {\n const /** @type {?} */ triggerName = listener.name;\n if (visitedTriggers.has(triggerName)) return;\n visitedTriggers.add(triggerName);\n\n const /** @type {?} */ trigger = this._triggers[triggerName];\n const /** @type {?} */ transition = trigger.fallbackTransition;\n const /** @type {?} */ elementStates = /** @type {?} */(( engine.statesByElement.get(element)));\n const /** @type {?} */ fromState = elementStates[triggerName] || DEFAULT_STATE_VALUE;\n const /
** @type {?} */ toState = new StateValue(VOID_VALUE);\n const /** @type {?} */ player = new TransitionAnimationPlayer(this.id, triggerName, element);\n\n this._engine.totalQueuedPlayers++;\n this._queue.push({\n element,\n triggerName,\n transition,\n fromState,\n toState,\n player,\n isFallbackTransition: true\n });\n });\n }\n\n // whether or not a parent has an animation we need to delay the deferral of the leave\n // operation until we have more information (which we do after flush() has been called)\n if (containsPotentialParentTransition) {\n engine.markElementAsRemoved(this.id, element, false, context);\n } else {\n // we do this after the flush has occurred such\n // that the callbacks can be fired\n engine.afterFlush(() => this.clearElementCache(element));\n engine.destroyInnerAnimations(element);\n engine._onRemovalComplete(element, c
ontext);\n }\n }\n/**\n * @param {?} element\n * @param {?} parent\n * @return {?}\n */\ninsertNode(element: any, parent: any): void { addClass(element, this._hostClassName); }\n/**\n * @param {?} microtaskId\n * @return {?}\n */\ndrainQueuedTransitions(microtaskId: number): QueueInstruction[] {\n const /** @type {?} */ instructions: QueueInstruction[] = [];\n this._queue.forEach(entry => {\n const /** @type {?} */ player = entry.player;\n if (player.destroyed) return;\n\n const /** @type {?} */ element = entry.element;\n const /** @type {?} */ listeners = this._elementListeners.get(element);\n if (listeners) {\n listeners.forEach((listener: TriggerListener) => {\n if (listener.name == entry.triggerName) {\n const /** @type {?} */ baseEvent = makeAnimationEvent(\n element, entry.triggerName, entry.fromState.value, entry.toState.value);\n ( /** @type {?} */((baseEvent as any)))['_data'] = microtas
kId;\n listenOnPlayer(entry.player, listener.phase, baseEvent, listener.callback);\n }\n });\n }\n\n if (player.markedForDestroy) {\n this._engine.afterFlush(() => {\n // now we can destroy the element properly since the event listeners have\n // been bound to the player\n player.destroy();\n });\n } else {\n instructions.push(entry);\n }\n });\n\n this._queue = [];\n\n return instructions.sort((a, b) => {\n // if depCount == 0 them move to front\n // otherwise if a contains b then move back\n const /** @type {?} */ d0 = a.transition.ast.depCount;\n const /** @type {?} */ d1 = b.transition.ast.depCount;\n if (d0 == 0 || d1 == 0) {\n return d0 - d1;\n }\n return this._engine.driver.containsElement(a.element, b.element) ? 1 : -1;\n });\n }\n/**\n * @param {?} context\n * @return {?}\n */\ndestroy(context: any) {\n this.players.forEach
(p => p.destroy());\n this._destroyInnerNodes(this.hostElement, context);\n }\n/**\n * @param {?} element\n * @return {?}\n */\nelementContainsData(element: any): boolean {\n let /** @type {?} */ containsData = false;\n if (this._elementListeners.has(element)) containsData = true;\n containsData =\n (this._queue.find(entry => entry.element === element) ? true : false) || containsData;\n return containsData;\n }\n}\n\nfunction AnimationTransitionNamespace_tsickle_Closure_declarations() {\n/** @type {?} */\nAnimationTransitionNamespace.prototype.players;\n/** @type {?} */\nAnimationTransitionNamespace.prototype._triggers;\n/** @type {?} */\nAnimationTransitionNamespace.prototype._queue;\n/** @type {?} */\nAnimationTransitionNamespace.prototype._elementListeners;\n/** @type {?} */\nAnimationTransitionNamespace.prototype._hostClassName;\n/** @type {?} */\nAnimationTransitionNamespace.prototype.id;\n/** @type {?} */\nAnimationTransitionNamespace.prototype.hostElem
ent;\n/** @type {?} */\nAnimationTransitionNamespace.prototype._engine;\n}\n\n\nexport interface QueuedTransition {\n element: any;\n instruction: AnimationTransitionInstruction;\n player: TransitionAnimationPlayer;\n}\nexport class TransitionAnimationEngine {\npublic players: TransitionAnimationPlayer[] = [];\npublic newHostElements = new Map<any, AnimationTransitionNamespace>();\npublic playersByElement = new Map<any, TransitionAnimationPlayer[]>();\npublic playersByQueriedElement = new Map<any, TransitionAnimationPlayer[]>();\npublic statesByElement = new Map<any, {[triggerName: string]: StateValue}>();\npublic disabledNodes = new Set<any>();\npublic totalAnimations = 0;\npublic totalQueuedPlayers = 0;\nprivate _namespaceLookup: {[id: string]: AnimationTransitionNamespace} = {};\nprivate _namespaceList: AnimationTransitionNamespace[] = [];\nprivate _flushFns: (() => any)[] = [];\nprivate _whenQuietFns: (() => any)[] = [];\npublic namespacesByHostElement = new Map<any, Animatio
nTransitionNamespace>();\npublic collectedEnterElements: any[] = [];\npublic collectedLeaveElements: any[] = [];\npublic onRemovalComplete = (element: any, context: any) => {};\n/**\n * @param {?} element\n * @param {?} context\n * @return {?}\n */\n_onRemovalComplete(element: any, context: any) { this.onRemovalComplete(element, context); }\n/**\n * @param {?} driver\n * @param {?} _normalizer\n */\nconstructor(public driver: AnimationDriver,\nprivate _normalizer: AnimationStyleNormalizer) {}\n/**\n * @return {?}\n */\nget queuedPlayers(): TransitionAnimationPlayer[] {\n const /** @type {?} */ players: TransitionAnimationPlayer[] = [];\n this._namespaceList.forEach(ns => {\n ns.players.forEach(player => {\n if (player.queued) {\n players.push(player);\n }\n });\n });\n return players;\n }\n/**\n * @param {?} namespaceId\n * @param {?} hostElement\n * @return {?}\n */\ncreateNamespace(namespaceId: string, hostElement: any) {\n const /*
* @type {?} */ ns = new AnimationTransitionNamespace(namespaceId, hostElement, this);\n if (hostElement.parentNode) {\n this._balanceNamespaceList(ns, hostElement);\n } else {\n // defer this later until flush during when the host element has\n // been inserted so that we know exactly where to place it in\n // the namespace list\n this.newHostElements.set(hostElement, ns);\n\n // given that this host element is apart of the animation code, it\n // may or may not be inserted by a parent node that is an of an\n // animation renderer type. If this happens then we can still have\n // access to this item when we query for :enter nodes. If the parent\n // is a renderer then the set data-structure will normalize the entry\n this.collectEnterElement(hostElement);\n }\n return this._namespaceLookup[namespaceId] = ns;\n }\n/**\n * @param {?} ns\n * @param {?} hostElement\n * @return {?}\n */\nprivate _balanceNamespaceList(ns:
AnimationTransitionNamespace, hostElement: any) {\n const /** @type {?} */ limit = this._namespaceList.length - 1;\n if (limit >= 0) {\n let /** @type {?} */ found = false;\n for (let /** @type {?} */ i = limit; i >= 0; i--) {\n const /** @type {?} */ nextNamespace = this._namespaceList[i];\n if (this.driver.containsElement(nextNamespace.hostElement, hostElement)) {\n this._namespaceList.splice(i + 1, 0, ns);\n found = true;\n break;\n }\n }\n if (!found) {\n this._namespaceList.splice(0, 0, ns);\n }\n } else {\n this._namespaceList.push(ns);\n }\n\n this.namespacesByHostElement.set(hostElement, ns);\n return ns;\n }\n/**\n * @param {?} namespaceId\n * @param {?} hostElement\n * @return {?}\n */\nregister(namespaceId: string, hostElement: any) {\n let /** @type {?} */ ns = this._namespaceLookup[namespaceId];\n if (!ns) {\n ns = this.createNamespace(namespaceId, hostEle
ment);\n }\n return ns;\n }\n/**\n * @param {?} namespaceId\n * @param {?} name\n * @param {?} trigger\n * @return {?}\n */\nregisterTrigger(namespaceId: string, name: string, trigger: AnimationTrigger) {\n let /** @type {?} */ ns = this._namespaceLookup[namespaceId];\n if (ns && ns.register(name, trigger)) {\n this.totalAnimations++;\n }\n }\n/**\n * @param {?} namespaceId\n * @param {?} context\n * @return {?}\n */\ndestroy(namespaceId: string, context: any) {\n if (!namespaceId) return;\n\n const /** @type {?} */ ns = this._fetchNamespace(namespaceId);\n\n this.afterFlush(() => {\n this.namespacesByHostElement.delete(ns.hostElement);\n delete this._namespaceLookup[namespaceId];\n const /** @type {?} */ index = this._namespaceList.indexOf(ns);\n if (index >= 0) {\n this._namespaceList.splice(index, 1);\n }\n });\n\n this.afterFlushAnimationsDone(() => ns.destroy(context));\n }\n/**\n * @param {?} id\n * @return
{?}\n */\nprivate _fetchNamespace(id: string) { return this._namespaceLookup[id]; }\n/**\n * @param {?} namespaceId\n * @param {?} element\n * @param {?} name\n * @param {?} value\n * @return {?}\n */\ntrigger(namespaceId: string, element: any, name: string, value: any): boolean {\n if (isElementNode(element)) {\n this._fetchNamespace(namespaceId).trigger(element, name, value);\n return true;\n }\n return false;\n }\n/**\n * @param {?} namespaceId\n * @param {?} element\n * @param {?} parent\n * @param {?} insertBefore\n * @return {?}\n */\ninsertNode(namespaceId: string, element: any, parent: any, insertBefore: boolean): void {\n if (!isElementNode(element)) return;\n\n // special case for when an element is removed and reinserted (move operation)\n // when this occurs we do not want to use the element for deletion later\n const /** @type {?} */ details = /** @type {?} */(( element[REMOVAL_FLAG] as ElementAnimationState));\n if (details && details
.setForRemoval) {\n details.setForRemoval = false;\n }\n\n // in the event that the namespaceId is blank then the caller\n // code does not contain any animation code in it, but it is\n // just being called so that the node is marked as being inserted\n if (namespaceId) {\n this._fetchNamespace(namespaceId).insertNode(element, parent);\n }\n\n // only *directives and host elements are inserted before\n if (insertBefore) {\n this.collectEnterElement(element);\n }\n }\n/**\n * @param {?} element\n * @return {?}\n */\ncollectEnterElement(element: any) { this.collectedEnterElements.push(element); }\n/**\n * @param {?} element\n * @param {?} value\n * @return {?}\n */\nmarkElementAsDisabled(element: any, value: boolean) {\n if (value) {\n if (!this.disabledNodes.has(element)) {\n this.disabledNodes.add(element);\n addClass(element, DISABLED_CLASSNAME);\n }\n } else if (this.disabledNodes.has(element)) {\n this.
disabledNodes.delete(element);\n removeClass(element, DISABLED_CLASSNAME);\n }\n }\n/**\n * @param {?} namespaceId\n * @param {?} element\n * @param {?} context\n * @param {?=} doNotRecurse\n * @return {?}\n */\nremoveNode(namespaceId: string, element: any, context: any, doNotRecurse?: boolean): void {\n if (!isElementNode(element)) {\n this._onRemovalComplete(element, context);\n return;\n }\n\n const /** @type {?} */ ns = namespaceId ? this._fetchNamespace(namespaceId) : null;\n if (ns) {\n ns.removeNode(element, context, doNotRecurse);\n } else {\n this.markElementAsRemoved(namespaceId, element, false, context);\n }\n }\n/**\n * @param {?} namespaceId\n * @param {?} element\n * @param {?=} hasAnimation\n * @param {?=} context\n * @return {?}\n */\nmarkElementAsRemoved(namespaceId: string, element: any, hasAnimation?: boolean, context?: any) {\n this.collectedLeaveElements.push(element);\n element[REMOVAL_FLAG] = {\n names
paceId,\n setForRemoval: context, hasAnimation,\n removedBeforeQueried: false\n };\n }\n/**\n * @param {?} namespaceId\n * @param {?} element\n * @param {?} name\n * @param {?} phase\n * @param {?} callback\n * @return {?}\n */\nlisten(\n namespaceId: string, element: any, name: string, phase: string,\n callback: (event: any) => boolean): () => any {\n if (isElementNode(element)) {\n return this._fetchNamespace(namespaceId).listen(element, name, phase, callback);\n }\n return () => {};\n }\n/**\n * @param {?} entry\n * @param {?} subTimelines\n * @return {?}\n */\nprivate _buildInstruction(entry: QueueInstruction, subTimelines: ElementInstructionMap) {\n return entry.transition.build(\n this.driver, entry.element, entry.fromState.value, entry.toState.value,\n entry.fromState.options, entry.toState.options, subTimelines);\n }\n/**\n * @param {?} containerElement\n * @return {?}\n */\ndestroyInnerAnimations(containerElement: any
) {\n let /** @type {?} */ elements = this.driver.query(containerElement, NG_TRIGGER_SELECTOR, true);\n elements.forEach(element => {\n const /** @type {?} */ players = this.playersByElement.get(element);\n if (players) {\n players.forEach(player => {\n // special case for when an element is set for destruction, but hasn't started.\n // in this situation we want to delay the destruction until the flush occurs\n // so that any event listeners attached to the player are triggered.\n if (player.queued) {\n player.markedForDestroy = true;\n } else {\n player.destroy();\n }\n });\n }\n const /** @type {?} */ stateMap = this.statesByElement.get(element);\n if (stateMap) {\n Object.keys(stateMap).forEach(triggerName => stateMap[triggerName] = DELETED_STATE_VALUE);\n }\n });\n\n if (this.playersByQueriedElement.size == 0) return;\n\n elements = this.d
river.query(containerElement, NG_ANIMATING_SELECTOR, true);\n if (elements.length) {\n elements.forEach(element => {\n const /** @type {?} */ players = this.playersByQueriedElement.get(element);\n if (players) {\n players.forEach(player => player.finish());\n }\n });\n }\n }\n/**\n * @return {?}\n */\nwhenRenderingDone(): Promise<any> {\n return new Promise(resolve => {\n if (this.players.length) {\n return optimizeGroupPlayer(this.players).onDone(() => resolve());\n } else {\n resolve();\n }\n });\n }\n/**\n * @param {?} element\n * @return {?}\n */\nprocessLeaveNode(element: any) {\n const /** @type {?} */ details = /** @type {?} */(( element[REMOVAL_FLAG] as ElementAnimationState));\n if (details && details.setForRemoval) {\n // this will prevent it from removing it twice\n element[REMOVAL_FLAG] = NULL_REMOVAL_STATE;\n if (details.namespaceId) {\n this.destroyInnerAnimat
ions(element);\n const /** @type {?} */ ns = this._fetchNamespace(details.namespaceId);\n if (ns) {\n ns.clearElementCache(element);\n }\n }\n this._onRemovalComplete(element, details.setForRemoval);\n }\n\n if (this.driver.matchesElement(element, DISABLED_SELECTOR)) {\n this.markElementAsDisabled(element, false);\n }\n\n this.driver.query(element, DISABLED_SELECTOR, true).forEach(node => {\n this.markElementAsDisabled(element, false);\n });\n }\n/**\n * @param {?=} microtaskId\n * @return {?}\n */\nflush(microtaskId: number = -1) {\n let /** @type {?} */ players: AnimationPlayer[] = [];\n if (this.newHostElements.size) {\n this.newHostElements.forEach((ns, element) => this._balanceNamespaceList(ns, element));\n this.newHostElements.clear();\n }\n\n if (this._namespaceList.length &&\n (this.totalQueuedPlayers || this.collectedLeaveElements.length)) {\n const /** @type {?} */ cleanupFn
s: Function[] = [];\n try {\n players = this._flushAnimations(cleanupFns, microtaskId);\n } finally {\n for (let /** @type {?} */ i = 0; i < cleanupFns.length; i++) {\n cleanupFns[i]();\n }\n }\n } else {\n for (let /** @type {?} */ i = 0; i < this.collectedLeaveElements.length; i++) {\n const /** @type {?} */ element = this.collectedLeaveElements[i];\n this.processLeaveNode(element);\n }\n }\n\n this.totalQueuedPlayers = 0;\n this.collectedEnterElements.length = 0;\n this.collectedLeaveElements.length = 0;\n this._flushFns.forEach(fn => fn());\n this._flushFns = [];\n\n if (this._whenQuietFns.length) {\n // we move these over to a variable so that\n // if any new callbacks are registered in another\n // flush they do not populate the existing set\n const /** @type {?} */ quietFns = this._whenQuietFns;\n this._whenQuietFns = [];\n\n if (players.length) {\n
optimizeGroupPlayer(players).onDone(() => { quietFns.forEach(fn => fn()); });\n } else {\n quietFns.forEach(fn => fn());\n }\n }\n }\n/**\n * @param {?} errors\n * @return {?}\n */\nreportError(errors: string[]) {\n throw new Error(\n `Unable to process animations due to the following failed trigger transitions\\n ${\n errors.join('\\n')}`);\n }\n/**\n * @param {?} cleanupFns\n * @param {?} microtaskId\n * @return {?}\n */\nprivate _flushAnimations(cleanupFns: Function[], microtaskId: number):\n TransitionAnimationPlayer[] {\n const /** @type {?} */ subTimelines = new ElementInstructionMap();\n const /** @type {?} */ skippedPlayers: TransitionAnimationPlayer[] = [];\n const /** @type {?} */ skippedPlayersMap = new Map<any, AnimationPlayer[]>();\n const /** @type {?} */ queuedInstructions: QueuedTransition[] = [];\n const /** @type {?} */ queriedElements = new Map<any, TransitionAnimationPlayer[]>();\n const /** @typ
e {?} */ allPreStyleElements = new Map<any, Set<string>>();\n const /** @type {?} */ allPostStyleElements = new Map<any, Set<string>>();\n\n const /** @type {?} */ disabledElementsSet = new Set<any>();\n this.disabledNodes.forEach(node => {\n disabledElementsSet.add(node);\n const /** @type {?} */ nodesThatAreDisabled = this.driver.query(node, QUEUED_SELECTOR, true);\n for (let /** @type {?} */ i = 0; i < nodesThatAreDisabled.length; i++) {\n disabledElementsSet.add(nodesThatAreDisabled[i]);\n }\n });\n\n const /** @type {?} */ bodyNode = getBodyNode();\n const /** @type {?} */ allEnterNodes: any[] = this.collectedEnterElements.length ?\n this.collectedEnterElements.filter(createIsRootFilterFn(this.collectedEnterElements)) :\n [];\n\n // this must occur before the instructions are built below such that\n // the :enter queries match the elements (since the timeline queries\n // are fired during instruction building).
\n for (let /** @type {?} */ i = 0; i < allEnterNodes.length; i++) {\n addClass(allEnterNodes[i], ENTER_CLASSNAME);\n }\n\n const /** @type {?} */ allLeaveNodes: any[] = [];\n const /** @type {?} */ leaveNodesWithoutAnimations = new Set<any>();\n for (let /** @type {?} */ i = 0; i < this.collectedLeaveElements.length; i++) {\n const /** @type {?} */ element = this.collectedLeaveElements[i];\n const /** @type {?} */ details = /** @type {?} */(( element[REMOVAL_FLAG] as ElementAnimationState));\n if (details && details.setForRemoval) {\n addClass(element, LEAVE_CLASSNAME);\n allLeaveNodes.push(element);\n if (!details.hasAnimation) {\n leaveNodesWithoutAnimations.add(element);\n }\n }\n }\n\n cleanupFns.push(() => {\n allEnterNodes.forEach(element => removeClass(element, ENTER_CLASSNAME));\n allLeaveNodes.forEach(element => {\n removeClass(element, LEAVE_CLASSNAME);\n this.proces
sLeaveNode(element);\n });\n });\n\n const /** @type {?} */ allPlayers: TransitionAnimationPlayer[] = [];\n const /** @type {?} */ erroneousTransitions: AnimationTransitionInstruction[] = [];\n for (let /** @type {?} */ i = this._namespaceList.length - 1; i >= 0; i--) {\n const /** @type {?} */ ns = this._namespaceList[i];\n ns.drainQueuedTransitions(microtaskId).forEach(entry => {\n const /** @type {?} */ player = entry.player;\n allPlayers.push(player);\n\n const /** @type {?} */ element = entry.element;\n if (!bodyNode || !this.driver.containsElement(bodyNode, element)) {\n player.destroy();\n return;\n }\n\n const /** @type {?} */ instruction = /** @type {?} */(( this._buildInstruction(entry, subTimelines)));\n if (instruction.errors && instruction.errors.length) {\n erroneousTransitions.push(instruction);\n return;\n }\n\n // if a unmatched transition is
queued to go then it SHOULD NOT render\n // an animation and cancel the previously running animations.\n if (entry.isFallbackTransition) {\n player.onStart(() => eraseStyles(element, instruction.fromStyles));\n player.onDestroy(() => setStyles(element, instruction.toStyles));\n skippedPlayers.push(player);\n return;\n }\n\n // this means that if a parent animation uses this animation as a sub trigger\n // then it will instruct the timeline builder to not add a player delay, but\n // instead stretch the first keyframe gap up until the animation starts. The\n // reason this is important is to prevent extra initialization styles from being\n // required by the user in the animation.\n instruction.timelines.forEach(tl => tl.stretchStartingKeyframe = true);\n\n subTimelines.append(element, instruction.timelines);\n\n const /** @type {?} */ tuple = {instruction, player, elemen
t};\n\n queuedInstructions.push(tuple);\n\n instruction.queriedElements.forEach(\n element => getOrSetAsInMap(queriedElements, element, []).push(player));\n\n instruction.preStyleProps.forEach((stringMap, element) => {\n const /** @type {?} */ props = Object.keys(stringMap);\n if (props.length) {\n let /** @type {?} */ setVal: Set<string> = /** @type {?} */(( allPreStyleElements.get(element)));\n if (!setVal) {\n allPreStyleElements.set(element, setVal = new Set<string>());\n }\n props.forEach(prop => setVal.add(prop));\n }\n });\n\n instruction.postStyleProps.forEach((stringMap, element) => {\n const /** @type {?} */ props = Object.keys(stringMap);\n let /** @type {?} */ setVal: Set<string> = /** @type {?} */(( allPostStyleElements.get(element)));\n if (!setVal) {\n allPostStyleElements.set(element, setVal = new Set<
string>());\n }\n props.forEach(prop => setVal.add(prop));\n });\n });\n }\n\n if (erroneousTransitions.length) {\n const /** @type {?} */ errors: string[] = [];\n erroneousTransitions.forEach(instruction => {\n errors.push(`@${instruction.triggerName} has failed due to:\\n`); /** @type {?} */((\n instruction.errors)).forEach(error => errors.push(`- ${error}\\n`));\n });\n\n allPlayers.forEach(player => player.destroy());\n this.reportError(errors);\n }\n\n // these can only be detected here since we have a map of all the elements\n // that have animations attached to them... We use a set here in the event\n // multiple enter captures on the same element were caught in different\n // renderer namespaces (e.g. when a @trigger was on a host binding that had *ngIf)\n const /** @type {?} */ enterNodesWithoutAnimations = new Set<any>();\n for (let /** @type {?} */ i = 0; i < allEnterNodes.leng
th; i++) {\n const /** @type {?} */ element = allEnterNodes[i];\n if (!subTimelines.has(element)) {\n enterNodesWithoutAnimations.add(element);\n }\n }\n\n const /** @type {?} */ allPreviousPlayersMap = new Map<any, TransitionAnimationPlayer[]>();\n let /** @type {?} */ sortedParentElements: any[] = [];\n queuedInstructions.forEach(entry => {\n const /** @type {?} */ element = entry.element;\n if (subTimelines.has(element)) {\n sortedParentElements.unshift(element);\n this._beforeAnimationBuild(\n entry.player.namespaceId, entry.instruction, allPreviousPlayersMap);\n }\n });\n\n skippedPlayers.forEach(player => {\n const /** @type {?} */ element = player.element;\n const /** @type {?} */ previousPlayers =\n this._getPreviousPlayers(element, false, player.namespaceId, player.triggerName, null);\n previousPlayers.forEach(prevPlayer => {\n getOrSetAsInMap(allPreviousPlayersMap
, element, []).push(prevPlayer);\n prevPlayer.destroy();\n });\n });\n\n // this is a special case for nodes that will be removed (either by)\n // having their own leave animations or by being queried in a container\n // that will be removed once a parent animation is complete. The idea\n // here is that * styles must be identical to ! styles because of\n // backwards compatibility (* is also filled in by default in many places).\n // Otherwise * styles will return an empty value or auto since the element\n // that is being getComputedStyle'd will not be visible (since * = destination)\n const /** @type {?} */ replaceNodes = allLeaveNodes.filter(node => {\n return replacePostStylesAsPre(node, allPreStyleElements, allPostStyleElements);\n });\n\n // POST STAGE: fill the * styles\n const [postStylesMap, allLeaveQueriedNodes] = cloakAndComputeStyles(\n this.driver, leaveNodesWithoutAnimations, allPostStyleElements, AUTO_STYLE)
;\n\n allLeaveQueriedNodes.forEach(node => {\n if (replacePostStylesAsPre(node, allPreStyleElements, allPostStyleElements)) {\n replaceNodes.push(node);\n }\n });\n\n // PRE STAGE: fill the ! styles\n const [preStylesMap] = allPreStyleElements.size ?\n cloakAndComputeStyles(\n this.driver, enterNodesWithoutAnimations, allPreStyleElements, PRE_STYLE) :\n [new Map<any, ɵStyleData>()];\n\n replaceNodes.forEach(node => {\n const /** @type {?} */ post = postStylesMap.get(node);\n const /** @type {?} */ pre = preStylesMap.get(node);\n postStylesMap.set(node, /** @type {?} */(( { ...post, ...pre } as any)));\n });\n\n const /** @type {?} */ rootPlayers: TransitionAnimationPlayer[] = [];\n const /** @type {?} */ subPlayers: TransitionAnimationPlayer[] = [];\n queuedInstructions.forEach(entry => {\n const {element, player, instruction} = entry;\n // this means that it was never consumed by a parent
animation which\n // means that it is independent and therefore should be set for animation\n if (subTimelines.has(element)) {\n if (disabledElementsSet.has(element)) {\n skippedPlayers.push(player);\n return;\n }\n\n const /** @type {?} */ innerPlayer = this._buildAnimation(\n player.namespaceId, instruction, allPreviousPlayersMap, skippedPlayersMap, preStylesMap,\n postStylesMap);\n player.setRealPlayer(innerPlayer);\n\n let /** @type {?} */ parentHasPriority: any = null;\n for (let /** @type {?} */ i = 0; i < sortedParentElements.length; i++) {\n const /** @type {?} */ parent = sortedParentElements[i];\n if (parent === element) break;\n if (this.driver.containsElement(parent, element)) {\n parentHasPriority = parent;\n break;\n }\n }\n\n if (parentHasPriority) {\n const /** @type {?} */ parentPlayers = this.p
layersByElement.get(parentHasPriority);\n if (parentPlayers && parentPlayers.length) {\n player.parentPlayer = optimizeGroupPlayer(parentPlayers);\n }\n skippedPlayers.push(player);\n } else {\n rootPlayers.push(player);\n }\n } else {\n eraseStyles(element, instruction.fromStyles);\n player.onDestroy(() => setStyles(element, instruction.toStyles));\n // there still might be a ancestor player animating this\n // element therefore we will still add it as a sub player\n // even if its animation may be disabled\n subPlayers.push(player);\n if (disabledElementsSet.has(element)) {\n skippedPlayers.push(player);\n }\n }\n });\n\n // find all of the sub players' corresponding inner animation player\n subPlayers.forEach(player => {\n // even if any players are not found for a sub animation then it\n // will still complete itself after the
next tick since it's Noop\n const /** @type {?} */ playersForElement = skippedPlayersMap.get(player.element);\n if (playersForElement && playersForElement.length) {\n const /** @type {?} */ innerPlayer = optimizeGroupPlayer(playersForElement);\n player.setRealPlayer(innerPlayer);\n }\n });\n\n // the reason why we don't actually play the animation is\n // because all that a skipped player is designed to do is to\n // fire the start/done transition callback events\n skippedPlayers.forEach(player => {\n if (player.parentPlayer) {\n player.parentPlayer.onDestroy(() => player.destroy());\n } else {\n player.destroy();\n }\n });\n\n // run through all of the queued removals and see if they\n // were picked up by a query. If not then perform the removal\n // operation right away unless a parent animation is ongoing.\n for (let /** @type {?} */ i = 0; i < allLeaveNodes.length; i++) {\n const /** @
type {?} */ element = allLeaveNodes[i];\n const /** @type {?} */ details = /** @type {?} */(( element[REMOVAL_FLAG] as ElementAnimationState));\n removeClass(element, LEAVE_CLASSNAME);\n\n // this means the element has a removal animation that is being\n // taken care of and therefore the inner elements will hang around\n // until that animation is over (or the parent queried animation)\n if (details && details.hasAnimation) continue;\n\n let /** @type {?} */ players: TransitionAnimationPlayer[] = [];\n\n // if this element is queried or if it contains queried children\n // then we want for the element not to be removed from the page\n // until the queried animations have finished\n if (queriedElements.size) {\n let /** @type {?} */ queriedPlayerResults = queriedElements.get(element);\n if (queriedPlayerResults && queriedPlayerResults.length) {\n players.push(...queriedPlayerResults);\n }\n\n
let /** @type {?} */ queriedInnerElements = this.driver.query(element, NG_ANIMATING_SELECTOR, true);\n for (let /** @type {?} */ j = 0; j < queriedInnerElements.length; j++) {\n let /** @type {?} */ queriedPlayers = queriedElements.get(queriedInnerElements[j]);\n if (queriedPlayers && queriedPlayers.length) {\n players.push(...queriedPlayers);\n }\n }\n }\n\n const /** @type {?} */ activePlayers = players.filter(p => !p.destroyed);\n if (activePlayers.length) {\n removeNodesAfterAnimationDone(this, element, activePlayers);\n } else {\n this.processLeaveNode(element);\n }\n }\n\n // this is required so the cleanup method doesn't remove them\n allLeaveNodes.length = 0;\n\n rootPlayers.forEach(player => {\n this.players.push(player);\n player.onDone(() => {\n player.destroy();\n\n const /** @type {?} */ index = this.players.indexOf(player);\n this.playe
rs.splice(index, 1);\n });\n player.play();\n });\n\n return rootPlayers;\n }\n/**\n * @param {?} namespaceId\n * @param {?} element\n * @return {?}\n */\nelementContainsData(namespaceId: string, element: any) {\n let /** @type {?} */ containsData = false;\n const /** @type {?} */ details = /** @type {?} */(( element[REMOVAL_FLAG] as ElementAnimationState));\n if (details && details.setForRemoval) containsData = true;\n if (this.playersByElement.has(element)) containsData = true;\n if (this.playersByQueriedElement.has(element)) containsData = true;\n if (this.statesByElement.has(element)) containsData = true;\n return this._fetchNamespace(namespaceId).elementContainsData(element) || containsData;\n }\n/**\n * @param {?} callback\n * @return {?}\n */\nafterFlush(callback: () => any) { this._flushFns.push(callback); }\n/**\n * @param {?} callback\n * @return {?}\n */\nafterFlushAnimationsDone(callback: () => any) { this._whenQuietFns.push(callbac
k); }\n/**\n * @param {?} element\n * @param {?} isQueriedElement\n * @param {?=} namespaceId\n * @param {?=} triggerName\n * @param {?=} toStateValue\n * @return {?}\n */\nprivate _getPreviousPlayers(\n element: string, isQueriedElement: boolean, namespaceId?: string, triggerName?: string,\n toStateValue?: any): TransitionAnimationPlayer[] {\n let /** @type {?} */ players: TransitionAnimationPlayer[] = [];\n if (isQueriedElement) {\n const /** @type {?} */ queriedElementPlayers = this.playersByQueriedElement.get(element);\n if (queriedElementPlayers) {\n players = queriedElementPlayers;\n }\n } else {\n const /** @type {?} */ elementPlayers = this.playersByElement.get(element);\n if (elementPlayers) {\n const /** @type {?} */ isRemovalAnimation = !toStateValue || toStateValue == VOID_VALUE;\n elementPlayers.forEach(player => {\n if (player.queued) return;\n if (!isRemovalAnimation && player.triggerNa
me != triggerName) return;\n players.push(player);\n });\n }\n }\n if (namespaceId || triggerName) {\n players = players.filter(player => {\n if (namespaceId && namespaceId != player.namespaceId) return false;\n if (triggerName && triggerName != player.triggerName) return false;\n return true;\n });\n }\n return players;\n }\n/**\n * @param {?} namespaceId\n * @param {?} instruction\n * @param {?} allPreviousPlayersMap\n * @return {?}\n */\nprivate _beforeAnimationBuild(\n namespaceId: string, instruction: AnimationTransitionInstruction,\n allPreviousPlayersMap: Map<any, TransitionAnimationPlayer[]>) {\n const /** @type {?} */ triggerName = instruction.triggerName;\n const /** @type {?} */ rootElement = instruction.element;\n\n // when a removal animation occurs, ALL previous players are collected\n // and destroyed (even if they are outside of the current namespace)\n const /** @type {?} */ ta
rgetNameSpaceId: string|undefined =\n instruction.isRemovalTransition ? undefined : namespaceId;\n const /** @type {?} */ targetTriggerName: string|undefined =\n instruction.isRemovalTransition ? undefined : triggerName;\n\n instruction.timelines.map(timelineInstruction => {\n const /** @type {?} */ element = timelineInstruction.element;\n const /** @type {?} */ isQueriedElement = element !== rootElement;\n const /** @type {?} */ players = getOrSetAsInMap(allPreviousPlayersMap, element, []);\n const /** @type {?} */ previousPlayers = this._getPreviousPlayers(\n element, isQueriedElement, targetNameSpaceId, targetTriggerName, instruction.toState);\n previousPlayers.forEach(player => {\n const /** @type {?} */ realPlayer = /** @type {?} */(( player.getRealPlayer() as any));\n if (realPlayer.beforeDestroy) {\n realPlayer.beforeDestroy();\n }\n player.destroy();\n players.push(player);\n
});\n });\n\n // this needs to be done so that the PRE/POST styles can be\n // computed properly without interfering with the previous animation\n eraseStyles(rootElement, instruction.fromStyles);\n }\n/**\n * @param {?} namespaceId\n * @param {?} instruction\n * @param {?} allPreviousPlayersMap\n * @param {?} skippedPlayersMap\n * @param {?} preStylesMap\n * @param {?} postStylesMap\n * @return {?}\n */\nprivate _buildAnimation(\n namespaceId: string, instruction: AnimationTransitionInstruction,\n allPreviousPlayersMap: Map<any, TransitionAnimationPlayer[]>,\n skippedPlayersMap: Map<any, AnimationPlayer[]>, preStylesMap: Map<any, ɵStyleData>,\n postStylesMap: Map<any, ɵStyleData>): AnimationPlayer {\n const /** @type {?} */ triggerName = instruction.triggerName;\n const /** @type {?} */ rootElement = instruction.element;\n\n // we first run this so that the previous animation player\n // data can be passed into the successive animat
ion players\n const /** @type {?} */ allQueriedPlayers: TransitionAnimationPlayer[] = [];\n const /** @type {?} */ allConsumedElements = new Set<any>();\n const /** @type {?} */ allSubElements = new Set<any>();\n const /** @type {?} */ allNewPlayers = instruction.timelines.map(timelineInstruction => {\n const /** @type {?} */ element = timelineInstruction.element;\n allConsumedElements.add(element);\n\n // FIXME (matsko): make sure to-be-removed animations are removed properly\n const /** @type {?} */ details = element[REMOVAL_FLAG];\n if (details && details.removedBeforeQueried) return new NoopAnimationPlayer();\n\n const /** @type {?} */ isQueriedElement = element !== rootElement;\n const /** @type {?} */ previousPlayers =\n flattenGroupPlayers((allPreviousPlayersMap.get(element) || EMPTY_PLAYER_ARRAY)\n .map(p => p.getRealPlayer()))\n .filter(p => {\n // the `eleme
nt` is not apart of the AnimationPlayer definition, but\n // Mock/WebAnimations\n // use the element within their implementation. This will be added in Angular5 to\n // AnimationPlayer\n const /** @type {?} */ pp = /** @type {?} */(( p as any));\n return pp.element ? pp.element === element : false;\n });\n\n const /** @type {?} */ preStyles = preStylesMap.get(element);\n const /** @type {?} */ postStyles = postStylesMap.get(element);\n const /** @type {?} */ keyframes = normalizeKeyframes(\n this.driver, this._normalizer, element, timelineInstruction.keyframes, preStyles,\n postStyles);\n const /** @type {?} */ player = this._buildPlayer(timelineInstruction, keyframes, previousPlayers);\n\n // this means that this particular player belongs to a sub trigger. It is\n // important that we match this player up with the corresponding (@trigger.listener)\
n if (timelineInstruction.subTimeline && skippedPlayersMap) {\n allSubElements.add(element);\n }\n\n if (isQueriedElement) {\n const /** @type {?} */ wrappedPlayer = new TransitionAnimationPlayer(namespaceId, triggerName, element);\n wrappedPlayer.setRealPlayer(player);\n allQueriedPlayers.push(wrappedPlayer);\n }\n\n return player;\n });\n\n allQueriedPlayers.forEach(player => {\n getOrSetAsInMap(this.playersByQueriedElement, player.element, []).push(player);\n player.onDone(() => deleteOrUnsetInMap(this.playersByQueriedElement, player.element, player));\n });\n\n allConsumedElements.forEach(element => addClass(element, NG_ANIMATING_CLASSNAME));\n const /** @type {?} */ player = optimizeGroupPlayer(allNewPlayers);\n player.onDestroy(() => {\n allConsumedElements.forEach(element => removeClass(element, NG_ANIMATING_CLASSNAME));\n setStyles(rootElement, instruction.toStyles);\n });\n\n //
this basically makes all of the callbacks for sub element animations\n // be dependent on the upper players for when they finish\n allSubElements.forEach(\n element => { getOrSetAsInMap(skippedPlayersMap, element, []).push(player); });\n\n return player;\n }\n/**\n * @param {?} instruction\n * @param {?} keyframes\n * @param {?} previousPlayers\n * @return {?}\n */\nprivate _buildPlayer(\n instruction: AnimationTimelineInstruction, keyframes: ɵStyleData[],\n previousPlayers: AnimationPlayer[]): AnimationPlayer {\n if (keyframes.length > 0) {\n return this.driver.animate(\n instruction.element, keyframes, instruction.duration, instruction.delay,\n instruction.easing, previousPlayers);\n }\n\n // special case for when an empty transition|definition is provided\n // ... there is no point in rendering an empty animation\n return new NoopAnimationPlayer();\n }\n}\n\nfunction TransitionAnimationEngine_tsickle_Closure_decl
arations() {\n/** @type {?} */\nTransitionAnimationEngine.prototype.players;\n/** @type {?} */\nTransitionAnimationEngine.prototype.newHostElements;\n/** @type {?} */\nTransitionAnimationEngine.prototype.playersByElement;\n/** @type {?} */\nTransitionAnimationEngine.prototype.playersByQueriedElement;\n/** @type {?} */\nTransitionAnimationEngine.prototype.statesByElement;\n/** @type {?} */\nTransitionAnimationEngine.prototype.disabledNodes;\n/** @type {?} */\nTransitionAnimationEngine.prototype.totalAnimations;\n/** @type {?} */\nTransitionAnimationEngine.prototype.totalQueuedPlayers;\n/** @type {?} */\nTransitionAnimationEngine.prototype._namespaceLookup;\n/** @type {?} */\nTransitionAnimationEngine.prototype._namespaceList;\n/** @type {?} */\nTransitionAnimationEngine.prototype._flushFns;\n/** @type {?} */\nTransitionAnimationEngine.prototype._whenQuietFns;\n/** @type {?} */\nTransitionAnimationEngine.prototype.namespacesByHostElement;\n/** @type {?} */\nTransitionAnimationEngine.p
rototype.collectedEnterElements;\n/** @type {?} */\nTransitionAnimationEngine.prototype.collectedLeaveElements;\n/** @type {?} */\nTransitionAnimationEngine.prototype.onRemovalComplete;\n/** @type {?} */\nTransitionAnimationEngine.prototype.driver;\n/** @type {?} */\nTransitionAnimationEngine.prototype._normalizer;\n}\n\nexport class TransitionAnimationPlayer implements AnimationPlayer {\nprivate _player: AnimationPlayer = new NoopAnimationPlayer();\nprivate _containsRealPlayer = false;\nprivate _queuedCallbacks: {[name: string]: (() => any)[]} = {};\nprivate _destroyed = false;\npublic parentPlayer: AnimationPlayer;\npublic markedForDestroy: boolean = false;\n/**\n * @param {?} namespaceId\n * @param {?} triggerName\n * @param {?} element\n */\nconstructor(public namespaceId: string,\npublic triggerName: string,\npublic element: any) {}\n/**\n * @return {?}\n */\nget queued() { return this._containsRealPlayer == false; }\n/**\n * @return {?}\n */\nget destroyed() { return this._des
troyed; }\n/**\n * @param {?} player\n * @return {?}\n */\nsetRealPlayer(player: AnimationPlayer) {\n if (this._containsRealPlayer) return;\n\n this._player = player;\n Object.keys(this._queuedCallbacks).forEach(phase => {\n this._queuedCallbacks[phase].forEach(\n callback => listenOnPlayer(player, phase, undefined, callback));\n });\n this._queuedCallbacks = {};\n this._containsRealPlayer = true;\n }\n/**\n * @return {?}\n */\ngetRealPlayer() { return this._player; }\n/**\n * @param {?} name\n * @param {?} callback\n * @return {?}\n */\nprivate _queueEvent(name: string, callback: (event: any) => any): void {\n getOrSetAsInMap(this._queuedCallbacks, name, []).push(callback);\n }\n/**\n * @param {?} fn\n * @return {?}\n */\nonDone(fn: () => void): void {\n if (this.queued) {\n this._queueEvent('done', fn);\n }\n this._player.onDone(fn);\n }\n/**\n * @param {?} fn\n * @return {?}\n */\nonStart(fn: () => void): void {\n if (this.qu
eued) {\n this._queueEvent('start', fn);\n }\n this._player.onStart(fn);\n }\n/**\n * @param {?} fn\n * @return {?}\n */\nonDestroy(fn: () => void): void {\n if (this.queued) {\n this._queueEvent('destroy', fn);\n }\n this._player.onDestroy(fn);\n }\n/**\n * @return {?}\n */\ninit(): void { this._player.init(); }\n/**\n * @return {?}\n */\nhasStarted(): boolean { return this.queued ? false : this._player.hasStarted(); }\n/**\n * @return {?}\n */\nplay(): void { !this.queued && this._player.play(); }\n/**\n * @return {?}\n */\npause(): void { !this.queued && this._player.pause(); }\n/**\n * @return {?}\n */\nrestart(): void { !this.queued && this._player.restart(); }\n/**\n * @return {?}\n */\nfinish(): void { this._player.finish(); }\n/**\n * @return {?}\n */\ndestroy(): void {\n this._destroyed = true;\n this._player.destroy();\n }\n/**\n * @return {?}\n */\nreset(): void { !this.queued && this._player.reset(); }\n/**\n * @param {?} p\n * @return {
?}\n */\nsetPosition(p: any): void {\n if (!this.queued) {\n this._player.setPosition(p);\n }\n }\n/**\n * @return {?}\n */\ngetPosition(): number { return this.queued ? 0 : this._player.getPosition(); }\n/**\n * @return {?}\n */\nget totalTime(): number { return this._player.totalTime; }\n}\n\nfunction TransitionAnimationPlayer_tsickle_Closure_declarations() {\n/** @type {?} */\nTransitionAnimationPlayer.prototype._player;\n/** @type {?} */\nTransitionAnimationPlayer.prototype._containsRealPlayer;\n/** @type {?} */\nTransitionAnimationPlayer.prototype._queuedCallbacks;\n/** @type {?} */\nTransitionAnimationPlayer.prototype._destroyed;\n/** @type {?} */\nTransitionAnimationPlayer.prototype.parentPlayer;\n/** @type {?} */\nTransitionAnimationPlayer.prototype.markedForDestroy;\n/** @type {?} */\nTransitionAnimationPlayer.prototype.namespaceId;\n/** @type {?} */\nTransitionAnimationPlayer.prototype.triggerName;\n/** @type {?} */\nTransitionAnimationPlayer.prototype.element;
\n}\n\n/**\n * @param {?} map\n * @param {?} key\n * @param {?} value\n * @return {?}\n */\nfunction deleteOrUnsetInMap(map: Map<any, any[]>| {[key: string]: any}, key: any, value: any) {\n let /** @type {?} */ currentValues: any[]|null|undefined;\n if (map instanceof Map) {\n currentValues = map.get(key);\n if (currentValues) {\n if (currentValues.length) {\n const /** @type {?} */ index = currentValues.indexOf(value);\n currentValues.splice(index, 1);\n }\n if (currentValues.length == 0) {\n map.delete(key);\n }\n }\n } else {\n currentValues = map[key];\n if (currentValues) {\n if (currentValues.length) {\n const /** @type {?} */ index = currentValues.indexOf(value);\n currentValues.splice(index, 1);\n }\n if (currentValues.length == 0) {\n delete map[key];\n }\n }\n }\n return currentValues;\n}\n/**\n * @param {?} value\n * @return {?}\n */\nfunction normalizeTriggerValue(val
ue: any): any {\n // we use `!= null` here because it's the most simple\n // way to test against a \"falsy\" value without mixing\n // in empty strings or a zero value. DO NOT OPTIMIZE.\n return value != null ? value : null;\n}\n/**\n * @param {?} node\n * @return {?}\n */\nfunction isElementNode(node: any) {\n return node && node['nodeType'] === 1;\n}\n/**\n * @param {?} eventName\n * @return {?}\n */\nfunction isTriggerEventValid(eventName: string): boolean {\n return eventName == 'start' || eventName == 'done';\n}\n/**\n * @param {?} element\n * @param {?=} value\n * @return {?}\n */\nfunction cloakElement(element: any, value?: string) {\n const /** @type {?} */ oldValue = element.style.display;\n element.style.display = value != null ? value : 'none';\n return oldValue;\n}\n/**\n * @param {?} driver\n * @param {?} elements\n * @param {?} elementPropsMap\n * @param {?} defaultStyle\n * @return {?}\n */\nfunction cloakAndComputeStyles(\n driver: AnimationDriver, elemen
ts: Set<any>, elementPropsMap: Map<any, Set<string>>,\n defaultStyle: string): [Map<any, ɵStyleData>, any[]] {\n const /** @type {?} */ cloakVals: string[] = [];\n elements.forEach(element => cloakVals.push(cloakElement(element)));\n\n const /** @type {?} */ valuesMap = new Map<any, ɵStyleData>();\n const /** @type {?} */ failedElements: any[] = [];\n\n elementPropsMap.forEach((props: Set<string>, element: any) => {\n const /** @type {?} */ styles: ɵStyleData = {};\n props.forEach(prop => {\n const /** @type {?} */ value = styles[prop] = driver.computeStyle(element, prop, defaultStyle);\n\n // there is no easy way to detect this because a sub element could be removed\n // by a parent animation element being detached.\n if (!value || value.length == 0) {\n element[REMOVAL_FLAG] = NULL_REMOVED_QUERIED_STATE;\n failedElements.push(element);\n }\n });\n valuesMap.set(element, styles);\n });\n\n // we use a index variable he
re since Set.forEach(a, i) does not return\n // an index value for the closure (but instead just the value)\n let /** @type {?} */ i = 0;\n elements.forEach(element => cloakElement(element, cloakVals[i++]));\n return [valuesMap, failedElements];\n}\n/**\n * @param {?} nodes\n * @return {?}\n */\nfunction createIsRootFilterFn(nodes: any): (node: any) => boolean {\n const /** @type {?} */ nodeSet = new Set(nodes);\n const /** @type {?} */ knownRootContainer = new Set();\n let /** @type {?} */ isRoot: (node: any) => boolean;\n isRoot = node => {\n if (!node) return true;\n if (nodeSet.has(node.parentNode)) return false;\n if (knownRootContainer.has(node.parentNode)) return true;\n if (isRoot(node.parentNode)) {\n knownRootContainer.add(node);\n return true;\n }\n return false;\n };\n return isRoot;\n}\n\nconst /** @type {?} */ CLASSES_CACHE_KEY = '$$classes';\n/**\n * @param {?} element\n * @param {?} className\n * @return {?}\n */\nfunction contai
nsClass(element: any, className: string): boolean {\n if (element.classList) {\n return element.classList.contains(className);\n } else {\n const /** @type {?} */ classes = element[CLASSES_CACHE_KEY];\n return classes && classes[className];\n }\n}\n/**\n * @param {?} element\n * @param {?} className\n * @return {?}\n */\nfunction addClass(element: any, className: string) {\n if (element.classList) {\n element.classList.add(className);\n } else {\n let /** @type {?} */ classes: {[className: string]: boolean} = element[CLASSES_CACHE_KEY];\n if (!classes) {\n classes = element[CLASSES_CACHE_KEY] = {};\n }\n classes[className] = true;\n }\n}\n/**\n * @param {?} element\n * @param {?} className\n * @return {?}\n */\nfunction removeClass(element: any, className: string) {\n if (element.classList) {\n element.classList.remove(className);\n } else {\n let /** @type {?} */ classes: {[className: string]: boolean} = element[CLASSES_CACHE_KEY];\n if
(classes) {\n delete classes[className];\n }\n }\n}\n/**\n * @return {?}\n */\nfunction getBodyNode(): any|null {\n if (typeof document != 'undefined') {\n return document.body;\n }\n return null;\n}\n/**\n * @param {?} engine\n * @param {?} element\n * @param {?} players\n * @return {?}\n */\nfunction removeNodesAfterAnimationDone(\n engine: TransitionAnimationEngine, element: any, players: AnimationPlayer[]) {\n optimizeGroupPlayer(players).onDone(() => engine.processLeaveNode(element));\n}\n/**\n * @param {?} players\n * @return {?}\n */\nfunction flattenGroupPlayers(players: AnimationPlayer[]): AnimationPlayer[] {\n const /** @type {?} */ finalPlayers: AnimationPlayer[] = [];\n _flattenGroupPlayersRecur(players, finalPlayers);\n return finalPlayers;\n}\n/**\n * @param {?} players\n * @param {?} finalPlayers\n * @return {?}\n */\nfunction _flattenGroupPlayersRecur(players: AnimationPlayer[], finalPlayers: AnimationPlayer[]) {\n for (let /** @type {?} */ i
= 0; i < players.length; i++) {\n const /** @type {?} */ player = players[i];\n if (player instanceof AnimationGroupPlayer) {\n _flattenGroupPlayersRecur(player.players, finalPlayers);\n } else {\n finalPlayers.push( /** @type {?} */((player as AnimationPlayer)));\n }\n }\n}\n/**\
<TRUNCATED>