{"version":3,"file":"main.bundle.js","sources":["webpack:///webpack/bootstrap 331037c2620305839baf","webpack:///./~/@angular/animations/@angular/animations/browser.es5.js","webpack:///./~/@angular/common/@angular/common/http.es5.js","webpack:///./~/@angular/platform-browser/@angular/platform-browser/animations.es5.js","webpack:///./~/@celine/tracker/dist/experience.utils.js","webpack:///./~/@celine/tracker/dist/hello-world.js","webpack:///./~/@celine/tracker/dist/index.js","webpack:///./~/@celine/tracker/dist/interface-layer.js","webpack:///./~/@celine/tracker/dist/passive-tracker-event-listener.js","webpack:///./~/@celine/tracker/dist/publish-subscribe.js","webpack:///./~/@celine/tracker/dist/types.js","webpack:///./~/@solar-web/newsflash/bundle/index.js","webpack:///./~/@solar/hero-banner/fesm5/solar-hero-banner.js","webpack:///./~/@solar/lunar/fesm5/solar-lunar.js","webpack:///./~/@solar/starlink/fesm5/solar-starlink.js","webpack:///./~/@solar/tooltip/fesm5/solar-tooltip.js","webpack:///./~/@solar/vortex/fesm5/solar-vortex.js","webpack:///./~/angularx-qrcode/dist/angularx-qrcode.module.js","webpack:///./~/angularx-qrcode/dist/components/angularx-qrcode/angularx-qrcode.component.js","webpack:///./~/angularx-qrcode/dist/components/angularx-qrcode/index.js","webpack:///./~/angularx-qrcode/dist/components/index.js","webpack:///./~/angularx-qrcode/dist/index.js","webpack:///./~/base64-js/index.js","webpack:///./~/buffer/index.js","webpack:///./~/ieee754/index.js","webpack:///./~/isarray/index.js","webpack:///./~/ng2-toastr/ng2-toastr.js","webpack:///./~/ng2-toastr/src/toast-container.component.js","webpack:///./~/ng2-toastr/src/toast-manager.js","webpack:///./~/ng2-toastr/src/toast-options.js","webpack:///./~/ng2-toastr/src/toast.js","webpack:///./~/ng2-toastr/src/toast.module.js","webpack:///./~/process/browser.js","webpack:///./~/qrcodejs2/qrcode.js","webpack:///./~/rxjs/AsyncSubject.js","webpack:///./~/rxjs/BehaviorSubject.js","webpack:///./~/rxjs/InnerSubscriber.js","webpack:///./~/rxjs/Notification.js","webpack:///./~/rxjs/Observable.js","webpack:///./~/rxjs/Observer.js","webpack:///./~/rxjs/OuterSubscriber.js","webpack:///./~/rxjs/ReplaySubject.js","webpack:///./~/rxjs/Rx.js","webpack:///./~/rxjs/Scheduler.js","webpack:///./~/rxjs/Subject.js","webpack:///./~/rxjs/SubjectSubscription.js","webpack:///./~/rxjs/Subscriber.js","webpack:///./~/rxjs/Subscription.js","webpack:///./~/rxjs/add/observable/bindCallback.js","webpack:///./~/rxjs/add/observable/bindNodeCallback.js","webpack:///./~/rxjs/add/observable/combineLatest.js","webpack:///./~/rxjs/add/observable/concat.js","webpack:///./~/rxjs/add/observable/defer.js","webpack:///./~/rxjs/add/observable/dom/ajax.js","webpack:///./~/rxjs/add/observable/dom/webSocket.js","webpack:///./~/rxjs/add/observable/empty.js","webpack:///./~/rxjs/add/observable/forkJoin.js","webpack:///./~/rxjs/add/observable/from.js","webpack:///./~/rxjs/add/observable/fromEvent.js","webpack:///./~/rxjs/add/observable/fromEventPattern.js","webpack:///./~/rxjs/add/observable/fromPromise.js","webpack:///./~/rxjs/add/observable/generate.js","webpack:///./~/rxjs/add/observable/if.js","webpack:///./~/rxjs/add/observable/interval.js","webpack:///./~/rxjs/add/observable/merge.js","webpack:///./~/rxjs/add/observable/never.js","webpack:///./~/rxjs/add/observable/of.js","webpack:///./~/rxjs/add/observable/onErrorResumeNext.js","webpack:///./~/rxjs/add/observable/pairs.js","webpack:///./~/rxjs/add/observable/race.js","webpack:///./~/rxjs/add/observable/range.js","webpack:///./~/rxjs/add/observable/throw.js","webpack:///./~/rxjs/add/observable/timer.js","webpack:///./~/rxjs/add/observable/using.js","webpack:///./~/rxjs/add/observable/zip.js","webpack:///./~/rxjs/add/operator/audit.js","webpack:///./~/rxjs/add/operator/auditTime.js","webpack:///./~/rxjs/add/operator/buffer.js","webpack:///./~/rxjs/add/operator/bufferCount.js","webpack:///./~/rxjs/add/operator/bufferTime.js","webpack:///./~/rxjs/add/operator/bufferToggle.js","webpack:///./~/rxjs/add/operator/bufferWhen.js","webpack:///./~/rxjs/add/operator/catch.js","webpack:///./~/rxjs/add/operator/combineAll.js","webpack:///./~/rxjs/add/operator/combineLatest.js","webpack:///./~/rxjs/add/operator/concat.js","webpack:///./~/rxjs/add/operator/concatAll.js","webpack:///./~/rxjs/add/operator/concatMap.js","webpack:///./~/rxjs/add/operator/concatMapTo.js","webpack:///./~/rxjs/add/operator/count.js","webpack:///./~/rxjs/add/operator/debounce.js","webpack:///./~/rxjs/add/operator/debounceTime.js","webpack:///./~/rxjs/add/operator/defaultIfEmpty.js","webpack:///./~/rxjs/add/operator/delay.js","webpack:///./~/rxjs/add/operator/delayWhen.js","webpack:///./~/rxjs/add/operator/dematerialize.js","webpack:///./~/rxjs/add/operator/distinct.js","webpack:///./~/rxjs/add/operator/distinctUntilChanged.js","webpack:///./~/rxjs/add/operator/distinctUntilKeyChanged.js","webpack:///./~/rxjs/add/operator/do.js","webpack:///./~/rxjs/add/operator/elementAt.js","webpack:///./~/rxjs/add/operator/every.js","webpack:///./~/rxjs/add/operator/exhaust.js","webpack:///./~/rxjs/add/operator/exhaustMap.js","webpack:///./~/rxjs/add/operator/expand.js","webpack:///./~/rxjs/add/operator/filter.js","webpack:///./~/rxjs/add/operator/finally.js","webpack:///./~/rxjs/add/operator/find.js","webpack:///./~/rxjs/add/operator/findIndex.js","webpack:///./~/rxjs/add/operator/first.js","webpack:///./~/rxjs/add/operator/groupBy.js","webpack:///./~/rxjs/add/operator/ignoreElements.js","webpack:///./~/rxjs/add/operator/isEmpty.js","webpack:///./~/rxjs/add/operator/last.js","webpack:///./~/rxjs/add/operator/let.js","webpack:///./~/rxjs/add/operator/map.js","webpack:///./~/rxjs/add/operator/mapTo.js","webpack:///./~/rxjs/add/operator/materialize.js","webpack:///./~/rxjs/add/operator/max.js","webpack:///./~/rxjs/add/operator/merge.js","webpack:///./~/rxjs/add/operator/mergeAll.js","webpack:///./~/rxjs/add/operator/mergeMap.js","webpack:///./~/rxjs/add/operator/mergeMapTo.js","webpack:///./~/rxjs/add/operator/mergeScan.js","webpack:///./~/rxjs/add/operator/min.js","webpack:///./~/rxjs/add/operator/multicast.js","webpack:///./~/rxjs/add/operator/observeOn.js","webpack:///./~/rxjs/add/operator/onErrorResumeNext.js","webpack:///./~/rxjs/add/operator/pairwise.js","webpack:///./~/rxjs/add/operator/partition.js","webpack:///./~/rxjs/add/operator/pluck.js","webpack:///./~/rxjs/add/operator/publish.js","webpack:///./~/rxjs/add/operator/publishBehavior.js","webpack:///./~/rxjs/add/operator/publishLast.js","webpack:///./~/rxjs/add/operator/publishReplay.js","webpack:///./~/rxjs/add/operator/race.js","webpack:///./~/rxjs/add/operator/reduce.js","webpack:///./~/rxjs/add/operator/repeat.js","webpack:///./~/rxjs/add/operator/repeatWhen.js","webpack:///./~/rxjs/add/operator/retry.js","webpack:///./~/rxjs/add/operator/retryWhen.js","webpack:///./~/rxjs/add/operator/sample.js","webpack:///./~/rxjs/add/operator/sampleTime.js","webpack:///./~/rxjs/add/operator/scan.js","webpack:///./~/rxjs/add/operator/sequenceEqual.js","webpack:///./~/rxjs/add/operator/share.js","webpack:///./~/rxjs/add/operator/shareReplay.js","webpack:///./~/rxjs/add/operator/single.js","webpack:///./~/rxjs/add/operator/skip.js","webpack:///./~/rxjs/add/operator/skipLast.js","webpack:///./~/rxjs/add/operator/skipUntil.js","webpack:///./~/rxjs/add/operator/skipWhile.js","webpack:///./~/rxjs/add/operator/startWith.js","webpack:///./~/rxjs/add/operator/subscribeOn.js","webpack:///./~/rxjs/add/operator/switch.js","webpack:///./~/rxjs/add/operator/switchMap.js","webpack:///./~/rxjs/add/operator/switchMapTo.js","webpack:///./~/rxjs/add/operator/take.js","webpack:///./~/rxjs/add/operator/takeLast.js","webpack:///./~/rxjs/add/operator/takeUntil.js","webpack:///./~/rxjs/add/operator/takeWhile.js","webpack:///./~/rxjs/add/operator/throttle.js","webpack:///./~/rxjs/add/operator/throttleTime.js","webpack:///./~/rxjs/add/operator/timeInterval.js","webpack:///./~/rxjs/add/operator/timeout.js","webpack:///./~/rxjs/add/operator/timeoutWith.js","webpack:///./~/rxjs/add/operator/timestamp.js","webpack:///./~/rxjs/add/operator/toArray.js","webpack:///./~/rxjs/add/operator/toPromise.js","webpack:///./~/rxjs/add/operator/window.js","webpack:///./~/rxjs/add/operator/windowCount.js","webpack:///./~/rxjs/add/operator/windowTime.js","webpack:///./~/rxjs/add/operator/windowToggle.js","webpack:///./~/rxjs/add/operator/windowWhen.js","webpack:///./~/rxjs/add/operator/withLatestFrom.js","webpack:///./~/rxjs/add/operator/zip.js","webpack:///./~/rxjs/add/operator/zipAll.js","webpack:///./~/rxjs/observable/ArrayLikeObservable.js","webpack:///./~/rxjs/observable/ArrayObservable.js","webpack:///./~/rxjs/observable/BoundCallbackObservable.js","webpack:///./~/rxjs/observable/BoundNodeCallbackObservable.js","webpack:///./~/rxjs/observable/ConnectableObservable.js","webpack:///./~/rxjs/observable/DeferObservable.js","webpack:///./~/rxjs/observable/EmptyObservable.js","webpack:///./~/rxjs/observable/ErrorObservable.js","webpack:///./~/rxjs/observable/ForkJoinObservable.js","webpack:///./~/rxjs/observable/FromEventObservable.js","webpack:///./~/rxjs/observable/FromEventPatternObservable.js","webpack:///./~/rxjs/observable/FromObservable.js","webpack:///./~/rxjs/observable/GenerateObservable.js","webpack:///./~/rxjs/observable/IfObservable.js","webpack:///./~/rxjs/observable/IntervalObservable.js","webpack:///./~/rxjs/observable/IteratorObservable.js","webpack:///./~/rxjs/observable/NeverObservable.js","webpack:///./~/rxjs/observable/PairsObservable.js","webpack:///./~/rxjs/observable/PromiseObservable.js","webpack:///./~/rxjs/observable/RangeObservable.js","webpack:///./~/rxjs/observable/ScalarObservable.js","webpack:///./~/rxjs/observable/SubscribeOnObservable.js","webpack:///./~/rxjs/observable/TimerObservable.js","webpack:///./~/rxjs/observable/UsingObservable.js","webpack:///./~/rxjs/observable/bindCallback.js","webpack:///./~/rxjs/observable/bindNodeCallback.js","webpack:///./~/rxjs/observable/combineLatest.js","webpack:///./~/rxjs/observable/concat.js","webpack:///./~/rxjs/observable/defer.js","webpack:///./~/rxjs/observable/dom/AjaxObservable.js","webpack:///./~/rxjs/observable/dom/WebSocketSubject.js","webpack:///./~/rxjs/observable/dom/ajax.js","webpack:///./~/rxjs/observable/dom/webSocket.js","webpack:///./~/rxjs/observable/empty.js","webpack:///./~/rxjs/observable/forkJoin.js","webpack:///./~/rxjs/observable/from.js","webpack:///./~/rxjs/observable/fromEvent.js","webpack:///./~/rxjs/observable/fromEventPattern.js","webpack:///./~/rxjs/observable/fromPromise.js","webpack:///./~/rxjs/observable/generate.js","webpack:///./~/rxjs/observable/if.js","webpack:///./~/rxjs/observable/interval.js","webpack:///./~/rxjs/observable/merge.js","webpack:///./~/rxjs/observable/never.js","webpack:///./~/rxjs/observable/of.js","webpack:///./~/rxjs/observable/onErrorResumeNext.js","webpack:///./~/rxjs/observable/pairs.js","webpack:///./~/rxjs/observable/race.js","webpack:///./~/rxjs/observable/range.js","webpack:///./~/rxjs/observable/throw.js","webpack:///./~/rxjs/observable/timer.js","webpack:///./~/rxjs/observable/using.js","webpack:///./~/rxjs/observable/zip.js","webpack:///./~/rxjs/operator/audit.js","webpack:///./~/rxjs/operator/auditTime.js","webpack:///./~/rxjs/operator/buffer.js","webpack:///./~/rxjs/operator/bufferCount.js","webpack:///./~/rxjs/operator/bufferTime.js","webpack:///./~/rxjs/operator/bufferToggle.js","webpack:///./~/rxjs/operator/bufferWhen.js","webpack:///./~/rxjs/operator/catch.js","webpack:///./~/rxjs/operator/combineAll.js","webpack:///./~/rxjs/operator/combineLatest.js","webpack:///./~/rxjs/operator/concat.js","webpack:///./~/rxjs/operator/concatAll.js","webpack:///./~/rxjs/operator/concatMap.js","webpack:///./~/rxjs/operator/concatMapTo.js","webpack:///./~/rxjs/operator/count.js","webpack:///./~/rxjs/operator/debounce.js","webpack:///./~/rxjs/operator/debounceTime.js","webpack:///./~/rxjs/operator/defaultIfEmpty.js","webpack:///./~/rxjs/operator/delay.js","webpack:///./~/rxjs/operator/delayWhen.js","webpack:///./~/rxjs/operator/dematerialize.js","webpack:///./~/rxjs/operator/distinct.js","webpack:///./~/rxjs/operator/distinctUntilChanged.js","webpack:///./~/rxjs/operator/distinctUntilKeyChanged.js","webpack:///./~/rxjs/operator/do.js","webpack:///./~/rxjs/operator/elementAt.js","webpack:///./~/rxjs/operator/every.js","webpack:///./~/rxjs/operator/exhaust.js","webpack:///./~/rxjs/operator/exhaustMap.js","webpack:///./~/rxjs/operator/expand.js","webpack:///./~/rxjs/operator/filter.js","webpack:///./~/rxjs/operator/finally.js","webpack:///./~/rxjs/operator/find.js","webpack:///./~/rxjs/operator/findIndex.js","webpack:///./~/rxjs/operator/first.js","webpack:///./~/rxjs/operator/groupBy.js","webpack:///./~/rxjs/operator/ignoreElements.js","webpack:///./~/rxjs/operator/isEmpty.js","webpack:///./~/rxjs/operator/last.js","webpack:///./~/rxjs/operator/let.js","webpack:///./~/rxjs/operator/map.js","webpack:///./~/rxjs/operator/mapTo.js","webpack:///./~/rxjs/operator/materialize.js","webpack:///./~/rxjs/operator/max.js","webpack:///./~/rxjs/operator/merge.js","webpack:///./~/rxjs/operator/mergeAll.js","webpack:///./~/rxjs/operator/mergeMap.js","webpack:///./~/rxjs/operator/mergeMapTo.js","webpack:///./~/rxjs/operator/mergeScan.js","webpack:///./~/rxjs/operator/min.js","webpack:///./~/rxjs/operator/multicast.js","webpack:///./~/rxjs/operator/observeOn.js","webpack:///./~/rxjs/operator/onErrorResumeNext.js","webpack:///./~/rxjs/operator/pairwise.js","webpack:///./~/rxjs/operator/partition.js","webpack:///./~/rxjs/operator/pluck.js","webpack:///./~/rxjs/operator/publish.js","webpack:///./~/rxjs/operator/publishBehavior.js","webpack:///./~/rxjs/operator/publishLast.js","webpack:///./~/rxjs/operator/publishReplay.js","webpack:///./~/rxjs/operator/race.js","webpack:///./~/rxjs/operator/reduce.js","webpack:///./~/rxjs/operator/repeat.js","webpack:///./~/rxjs/operator/repeatWhen.js","webpack:///./~/rxjs/operator/retry.js","webpack:///./~/rxjs/operator/retryWhen.js","webpack:///./~/rxjs/operator/sample.js","webpack:///./~/rxjs/operator/sampleTime.js","webpack:///./~/rxjs/operator/scan.js","webpack:///./~/rxjs/operator/sequenceEqual.js","webpack:///./~/rxjs/operator/share.js","webpack:///./~/rxjs/operator/shareReplay.js","webpack:///./~/rxjs/operator/single.js","webpack:///./~/rxjs/operator/skip.js","webpack:///./~/rxjs/operator/skipLast.js","webpack:///./~/rxjs/operator/skipUntil.js","webpack:///./~/rxjs/operator/skipWhile.js","webpack:///./~/rxjs/operator/startWith.js","webpack:///./~/rxjs/operator/subscribeOn.js","webpack:///./~/rxjs/operator/switch.js","webpack:///./~/rxjs/operator/switchMap.js","webpack:///./~/rxjs/operator/switchMapTo.js","webpack:///./~/rxjs/operator/take.js","webpack:///./~/rxjs/operator/takeLast.js","webpack:///./~/rxjs/operator/takeUntil.js","webpack:///./~/rxjs/operator/takeWhile.js","webpack:///./~/rxjs/operator/throttle.js","webpack:///./~/rxjs/operator/throttleTime.js","webpack:///./~/rxjs/operator/timeInterval.js","webpack:///./~/rxjs/operator/timeout.js","webpack:///./~/rxjs/operator/timeoutWith.js","webpack:///./~/rxjs/operator/timestamp.js","webpack:///./~/rxjs/operator/toArray.js","webpack:///./~/rxjs/operator/window.js","webpack:///./~/rxjs/operator/windowCount.js","webpack:///./~/rxjs/operator/windowTime.js","webpack:///./~/rxjs/operator/windowToggle.js","webpack:///./~/rxjs/operator/windowWhen.js","webpack:///./~/rxjs/operator/withLatestFrom.js","webpack:///./~/rxjs/operator/zip.js","webpack:///./~/rxjs/operator/zipAll.js","webpack:///./~/rxjs/operators.js","webpack:///./~/rxjs/operators/audit.js","webpack:///./~/rxjs/operators/auditTime.js","webpack:///./~/rxjs/operators/buffer.js","webpack:///./~/rxjs/operators/bufferCount.js","webpack:///./~/rxjs/operators/bufferTime.js","webpack:///./~/rxjs/operators/bufferToggle.js","webpack:///./~/rxjs/operators/bufferWhen.js","webpack:///./~/rxjs/operators/catchError.js","webpack:///./~/rxjs/operators/combineAll.js","webpack:///./~/rxjs/operators/combineLatest.js","webpack:///./~/rxjs/operators/concat.js","webpack:///./~/rxjs/operators/concatAll.js","webpack:///./~/rxjs/operators/concatMap.js","webpack:///./~/rxjs/operators/concatMapTo.js","webpack:///./~/rxjs/operators/count.js","webpack:///./~/rxjs/operators/debounce.js","webpack:///./~/rxjs/operators/debounceTime.js","webpack:///./~/rxjs/operators/defaultIfEmpty.js","webpack:///./~/rxjs/operators/delay.js","webpack:///./~/rxjs/operators/delayWhen.js","webpack:///./~/rxjs/operators/dematerialize.js","webpack:///./~/rxjs/operators/distinct.js","webpack:///./~/rxjs/operators/distinctUntilChanged.js","webpack:///./~/rxjs/operators/distinctUntilKeyChanged.js","webpack:///./~/rxjs/operators/elementAt.js","webpack:///./~/rxjs/operators/every.js","webpack:///./~/rxjs/operators/exhaust.js","webpack:///./~/rxjs/operators/exhaustMap.js","webpack:///./~/rxjs/operators/expand.js","webpack:///./~/rxjs/operators/filter.js","webpack:///./~/rxjs/operators/finalize.js","webpack:///./~/rxjs/operators/find.js","webpack:///./~/rxjs/operators/findIndex.js","webpack:///./~/rxjs/operators/first.js","webpack:///./~/rxjs/operators/groupBy.js","webpack:///./~/rxjs/operators/ignoreElements.js","webpack:///./~/rxjs/operators/isEmpty.js","webpack:///./~/rxjs/operators/last.js","webpack:///./~/rxjs/operators/map.js","webpack:///./~/rxjs/operators/mapTo.js","webpack:///./~/rxjs/operators/materialize.js","webpack:///./~/rxjs/operators/max.js","webpack:///./~/rxjs/operators/merge.js","webpack:///./~/rxjs/operators/mergeAll.js","webpack:///./~/rxjs/operators/mergeMap.js","webpack:///./~/rxjs/operators/mergeMapTo.js","webpack:///./~/rxjs/operators/mergeScan.js","webpack:///./~/rxjs/operators/min.js","webpack:///./~/rxjs/operators/multicast.js","webpack:///./~/rxjs/operators/observeOn.js","webpack:///./~/rxjs/operators/onErrorResumeNext.js","webpack:///./~/rxjs/operators/pairwise.js","webpack:///./~/rxjs/operators/partition.js","webpack:///./~/rxjs/operators/pluck.js","webpack:///./~/rxjs/operators/publish.js","webpack:///./~/rxjs/operators/publishBehavior.js","webpack:///./~/rxjs/operators/publishLast.js","webpack:///./~/rxjs/operators/publishReplay.js","webpack:///./~/rxjs/operators/race.js","webpack:///./~/rxjs/operators/reduce.js","webpack:///./~/rxjs/operators/refCount.js","webpack:///./~/rxjs/operators/repeat.js","webpack:///./~/rxjs/operators/repeatWhen.js","webpack:///./~/rxjs/operators/retry.js","webpack:///./~/rxjs/operators/retryWhen.js","webpack:///./~/rxjs/operators/sample.js","webpack:///./~/rxjs/operators/sampleTime.js","webpack:///./~/rxjs/operators/scan.js","webpack:///./~/rxjs/operators/sequenceEqual.js","webpack:///./~/rxjs/operators/share.js","webpack:///./~/rxjs/operators/shareReplay.js","webpack:///./~/rxjs/operators/single.js","webpack:///./~/rxjs/operators/skip.js","webpack:///./~/rxjs/operators/skipLast.js","webpack:///./~/rxjs/operators/skipUntil.js","webpack:///./~/rxjs/operators/skipWhile.js","webpack:///./~/rxjs/operators/startWith.js","webpack:///./~/rxjs/operators/subscribeOn.js","webpack:///./~/rxjs/operators/switchAll.js","webpack:///./~/rxjs/operators/switchMap.js","webpack:///./~/rxjs/operators/switchMapTo.js","webpack:///./~/rxjs/operators/take.js","webpack:///./~/rxjs/operators/takeLast.js","webpack:///./~/rxjs/operators/takeUntil.js","webpack:///./~/rxjs/operators/takeWhile.js","webpack:///./~/rxjs/operators/tap.js","webpack:///./~/rxjs/operators/throttle.js","webpack:///./~/rxjs/operators/throttleTime.js","webpack:///./~/rxjs/operators/timeInterval.js","webpack:///./~/rxjs/operators/timeout.js","webpack:///./~/rxjs/operators/timeoutWith.js","webpack:///./~/rxjs/operators/timestamp.js","webpack:///./~/rxjs/operators/toArray.js","webpack:///./~/rxjs/operators/window.js","webpack:///./~/rxjs/operators/windowCount.js","webpack:///./~/rxjs/operators/windowTime.js","webpack:///./~/rxjs/operators/windowToggle.js","webpack:///./~/rxjs/operators/windowWhen.js","webpack:///./~/rxjs/operators/withLatestFrom.js","webpack:///./~/rxjs/operators/zip.js","webpack:///./~/rxjs/operators/zipAll.js","webpack:///./~/rxjs/scheduler/Action.js","webpack:///./~/rxjs/scheduler/AnimationFrameAction.js","webpack:///./~/rxjs/scheduler/AnimationFrameScheduler.js","webpack:///./~/rxjs/scheduler/AsapAction.js","webpack:///./~/rxjs/scheduler/AsapScheduler.js","webpack:///./~/rxjs/scheduler/AsyncAction.js","webpack:///./~/rxjs/scheduler/AsyncScheduler.js","webpack:///./~/rxjs/scheduler/QueueAction.js","webpack:///./~/rxjs/scheduler/QueueScheduler.js","webpack:///./~/rxjs/scheduler/VirtualTimeScheduler.js","webpack:///./~/rxjs/scheduler/animationFrame.js","webpack:///./~/rxjs/scheduler/asap.js","webpack:///./~/rxjs/scheduler/async.js","webpack:///./~/rxjs/scheduler/queue.js","webpack:///./~/rxjs/symbol/iterator.js","webpack:///./~/rxjs/symbol/observable.js","webpack:///./~/rxjs/symbol/rxSubscriber.js","webpack:///./~/rxjs/testing/ColdObservable.js","webpack:///./~/rxjs/testing/HotObservable.js","webpack:///./~/rxjs/testing/SubscriptionLog.js","webpack:///./~/rxjs/testing/SubscriptionLoggable.js","webpack:///./~/rxjs/testing/TestScheduler.js","webpack:///./~/rxjs/util/AnimationFrame.js","webpack:///./~/rxjs/util/ArgumentOutOfRangeError.js","webpack:///./~/rxjs/util/EmptyError.js","webpack:///./~/rxjs/util/FastMap.js","webpack:///./~/rxjs/util/Immediate.js","webpack:///./~/rxjs/util/Map.js","webpack:///./~/rxjs/util/MapPolyfill.js","webpack:///./~/rxjs/util/ObjectUnsubscribedError.js","webpack:///./~/rxjs/util/Set.js","webpack:///./~/rxjs/util/TimeoutError.js","webpack:///./~/rxjs/util/UnsubscriptionError.js","webpack:///./~/rxjs/util/applyMixins.js","webpack:///./~/rxjs/util/assign.js","webpack:///./~/rxjs/util/errorObject.js","webpack:///./~/rxjs/util/identity.js","webpack:///./~/rxjs/util/isArray.js","webpack:///./~/rxjs/util/isArrayLike.js","webpack:///./~/rxjs/util/isDate.js","webpack:///./~/rxjs/util/isFunction.js","webpack:///./~/rxjs/util/isNumeric.js","webpack:///./~/rxjs/util/isObject.js","webpack:///./~/rxjs/util/isPromise.js","webpack:///./~/rxjs/util/isScheduler.js","webpack:///./~/rxjs/util/noop.js","webpack:///./~/rxjs/util/not.js","webpack:///./~/rxjs/util/pipe.js","webpack:///./~/rxjs/util/root.js","webpack:///./~/rxjs/util/subscribeToResult.js","webpack:///./~/rxjs/util/toSubscriber.js","webpack:///./~/rxjs/util/tryCatch.js","webpack:///./~/setimmediate/setImmediate.js","webpack:///./~/timers-browserify/main.js","webpack:///(webpack)/buildin/global.js","webpack:///./src/app/celine/base-app.module.ts","webpack:///./src/app/celine/components/dashboard/dashboard.component.html","webpack:///./src/app/celine/components/dashboard/dashboard.component.ts","webpack:///./src/app/celine/components/header/header.component.html","webpack:///./src/app/celine/components/header/header.component.ts","webpack:///./src/app/celine/components/index.ts","webpack:///./src/app/celine/components/navbar/navbar.component.html","webpack:///./src/app/celine/components/navbar/navbar.component.ts","webpack:///./src/app/celine/components/page-not-found.component.html","webpack:///./src/app/celine/components/page-not-found.component.ts","webpack:///./src/app/celine/components/pipes/safe-widget.pipe.ts","webpack:///./src/app/celine/components/smart-widget/smart-widget.component.html","webpack:///./src/app/celine/components/smart-widget/smart-widget.component.ts","webpack:///./src/app/celine/components/widget-frame/widget-frame.component.html","webpack:///./src/app/celine/components/widget-frame/widget-frame.component.ts","webpack:///./src/app/celine/components/widget/widget.component.html","webpack:///./src/app/celine/components/widget/widget.component.ts","webpack:///./src/app/celine/index.ts","webpack:///./src/app/celine/rxjs-operators.ts","webpack:///./src/app/celine/services/auth-guard.ts","webpack:///./src/app/celine/services/authentication.service.ts","webpack:///./src/app/celine/services/dashboard.service.ts","webpack:///./src/app/celine/services/index.ts","webpack:///./src/app/celine/services/menu.service.ts","webpack:///./src/app/celine/services/module-loader.service.ts","webpack:///./src/app/celine/services/route-guard-mfa.ts","webpack:///./src/app/celine/services/router.service.ts","webpack:///./src/app/celine/services/theme.service.ts","webpack:///./src/app/celine/store/actions/ui-header/ui-contextnav.actions.ts","webpack:///./src/app/celine/store/actions/ui-header/ui-header.actions.ts","webpack:///./src/app/celine/store/actions/ui-header/ui-jumbo.actions.ts","webpack:///./src/app/celine/store/actions/ui-header/ui-masthead.actions.ts","webpack:///./src/app/celine/store/actions/ui-header/ui-topnav.actions.ts","webpack:///./src/app/celine/store/actions/ui.actions.ts","webpack:///./src/app/celine/store/actions/user.actions.ts","webpack:///./src/app/celine/store/app-store.ts","webpack:///./src/app/celine/store/effects/ui.effects.ts","webpack:///./src/app/celine/store/effects/user.effects.ts","webpack:///./src/app/celine/store/index.ts","webpack:///./src/app/celine/store/reducers/ui-header.reducer.ts","webpack:///./src/app/celine/store/reducers/ui.reducer.ts","webpack:///./src/app/celine/store/reducers/user.reducer.ts","webpack:///./src/app/celine/utils/index.ts","webpack:///./src/app/celine/utils/router-data-extractor.ts","webpack:///./src/app/celine/utils/url-helpers.ts","webpack:///./src/app/threshold/app.module.ts","webpack:///./src/app/threshold/components/app.component.html","webpack:///./src/app/threshold/components/app.component.ts","webpack:///./src/app/threshold/components/celine-footer/celine-footer.component.html","webpack:///./src/app/threshold/components/celine-footer/celine-footer.component.ts","webpack:///./src/app/threshold/components/complaints/complaints.component.html","webpack:///./src/app/threshold/components/complaints/complaints.component.ts","webpack:///./src/app/threshold/components/feature-flag/feature-flag.directive.ts","webpack:///./src/app/threshold/components/feature-flag/feature-flag.module.ts","webpack:///./src/app/threshold/components/footer/footer.component.ts","webpack:///./src/app/threshold/components/index.ts","webpack:///./src/app/threshold/components/logout/logout.component.html","webpack:///./src/app/threshold/components/logout/logout.component.ts","webpack:///./src/app/threshold/components/manage-mfa-device/activate-device-v2/activate-device-v2.component.html","webpack:///./src/app/threshold/components/manage-mfa-device/activate-device-v2/activate-device-v2.component.ts","webpack:///./src/app/threshold/components/manage-mfa-device/activate-device/activate-device.component.html","webpack:///./src/app/threshold/components/manage-mfa-device/activate-device/activate-device.component.ts","webpack:///./src/app/threshold/components/manage-mfa-device/delink-device-v2/delink-device-v2.component.html","webpack:///./src/app/threshold/components/manage-mfa-device/delink-device-v2/delink-device-v2.component.ts","webpack:///./src/app/threshold/components/manage-mfa-device/delink-device/delink-device.component.html","webpack:///./src/app/threshold/components/manage-mfa-device/delink-device/delink-device.component.ts","webpack:///./src/app/threshold/components/manage-mfa-device/edit-device/edit-device.component.html","webpack:///./src/app/threshold/components/manage-mfa-device/edit-device/edit-device.component.ts","webpack:///./src/app/threshold/components/manage-mfa-device/manage-mfa-device-component.ts","webpack:///./src/app/threshold/components/manage-mfa-device/manage-mfa-device.component.html","webpack:///./src/app/threshold/components/manage-mfa-device/manage-mfa-device.module.ts","webpack:///./src/app/threshold/components/manage-mfa-device/services/mfa-device.service.ts","webpack:///./src/app/threshold/components/mobile/download-mobile-app.component.html","webpack:///./src/app/threshold/components/mobile/download-mobile-app.component.ts","webpack:///./src/app/threshold/components/mobile/download-mobile-app.module.ts","webpack:///./src/app/threshold/components/newsflash/newsflash.component.ts","webpack:///./src/app/threshold/components/no-access/no-access.component.ts","webpack:///./src/app/threshold/components/no-widget/no-widget.component.ts","webpack:///./src/app/threshold/components/notifications/notifications-bell.component.ts","webpack:///./src/app/threshold/components/notifications/notifications.component.html","webpack:///./src/app/threshold/components/notifications/notifications.component.ts","webpack:///./src/app/threshold/components/notifications/notifications.module.ts","webpack:///./src/app/threshold/components/notifications/services/messages.service.ts","webpack:///./src/app/threshold/components/notifications/services/notification.service.ts","webpack:///./src/app/threshold/components/notifications/services/toast/toast.service.ts","webpack:///./src/app/threshold/components/pipes/format-language.pipe.ts","webpack:///./src/app/threshold/components/script/celine-script.component.ts","webpack:///./src/app/threshold/components/search/search-bar.component.html","webpack:///./src/app/threshold/components/search/search-bar.component.ts","webpack:///./src/app/threshold/components/search/search-category-checkbox.component.html","webpack:///./src/app/threshold/components/search/search-category-checkbox.component.ts","webpack:///./src/app/threshold/components/search/search-category-filter.component.html","webpack:///./src/app/threshold/components/search/search-category-filter.component.ts","webpack:///./src/app/threshold/components/search/search-control.component.html","webpack:///./src/app/threshold/components/search/search-control.component.ts","webpack:///./src/app/threshold/components/search/search-results-list.component.html","webpack:///./src/app/threshold/components/search/search-results-list.component.ts","webpack:///./src/app/threshold/components/session-expired/session-expired.component.ts","webpack:///./src/app/threshold/components/user/index.ts","webpack:///./src/app/threshold/components/user/user-dropdown.component.html","webpack:///./src/app/threshold/components/user/user-dropdown.component.ts","webpack:///./src/app/threshold/components/user/user-profile-switch-item.component.html","webpack:///./src/app/threshold/components/user/user-profile-switch-item.component.ts","webpack:///./src/app/threshold/components/user/user-profile-switch-redirect.component.ts","webpack:///./src/app/threshold/components/user/user-profile-switch.component.html","webpack:///./src/app/threshold/components/user/user-profile-switch.component.ts","webpack:///./src/app/threshold/main.ts","webpack:///./src/app/threshold/oidc-helper.ts","webpack:///./src/app/threshold/services/app-threshold-config.service.ts","webpack:///./src/app/threshold/services/authentication-threshold.service.ts","webpack:///./src/app/threshold/services/connection-service.service.ts","webpack:///./src/app/threshold/services/custom-url-serializer.service.ts","webpack:///./src/app/threshold/services/dashboard-threshold.service.ts","webpack:///./src/app/threshold/services/experience.service.ts","webpack:///./src/app/threshold/services/feature-flag.service.ts","webpack:///./src/app/threshold/services/feature-toggle.service.ts","webpack:///./src/app/threshold/services/fgw.service.ts","webpack:///./src/app/threshold/services/history.service.ts","webpack:///./src/app/threshold/services/http-threshold.service.ts","webpack:///./src/app/threshold/services/index.ts","webpack:///./src/app/threshold/services/menu-threshold.service.ts","webpack:///./src/app/threshold/services/new-relic.service.ts","webpack:///./src/app/threshold/services/portal-messages.service.ts","webpack:///./src/app/threshold/services/reportToInstana.errorHandler.ts","webpack:///./src/app/threshold/services/router-threshold.service.ts","webpack:///./src/app/threshold/services/script.service.ts","webpack:///./src/app/threshold/services/search-threshold.service.ts","webpack:///./src/app/threshold/services/text-encoder.service.ts","webpack:///./src/app/threshold/services/toast.service.ts","webpack:///./src/app/threshold/services/translate-loader-threshold.service.ts","webpack:///./src/app/threshold/services/ui-environment.service.ts","webpack:///./src/app/threshold/services/user-preferences.service.ts","webpack:///./src/app/threshold/services/user-profile.service.ts","webpack:///./src/app/threshold/storage-helper.ts","webpack:///./src/app/threshold/store/actions/actions.ts","webpack:///./src/app/threshold/store/actions/experience.actions.ts","webpack:///./src/app/threshold/store/actions/user.actions.ts","webpack:///./src/app/threshold/store/effects/effects.ts","webpack:///./src/app/threshold/store/effects/user.effects.ts","webpack:///./src/app/threshold/store/reducers/experience.reducer.ts","webpack:///./src/app/threshold/store/reducers/reducer.ts","webpack:///./src/app/threshold/store/reducers/user.reducer.ts","webpack:///./src/app/threshold/store/store.ts","webpack:///external \"ng.core\"","webpack:///external \"tslib\"","webpack:///external \"Rx\"","webpack:///external \"components\"","webpack:///external \"ng.platformBrowser\"","webpack:///external \"ngrx.routerStore\"","webpack:///external \"Oidc\"","webpack:///external \"Reselect\"","webpack:///external \"ng.animations\"","webpack:///external \"ng.platformBrowserDynamic\"","webpack:///external \"ngrx.storeDevtools\"","webpack:///external \"ngrx.storeLogMonitor\"","webpack:///external \"ngrx.store\"","webpack:///external \"ng.router\"","webpack:///external \"ng.common\"","webpack:///external \"ng.http\"","webpack:///external \"ngb\"","webpack:///external \"ngxTranslateCore\"","webpack:///external \"ng.forms\"","webpack:///external \"ngrx.effects\""],"sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// identity function for calling harmony imports with the correct context\n \t__webpack_require__.i = function(value) { return value; };\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 20);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 331037c2620305839baf","import * as tslib_1 from \"tslib\";\n/**\n * @license Angular v4.4.6\n * (c) 2010-2017 Google, Inc. https://angular.io/\n * License: MIT\n */\nimport { AUTO_STYLE, NoopAnimationPlayer, sequence, style, ɵAnimationGroupPlayer, ɵPRE_STYLE } from '@angular/animations';\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 */\nfunction optimizeGroupPlayer(players) {\n switch (players.length) {\n case 0:\n return new NoopAnimationPlayer();\n case 1:\n return players[0];\n default:\n return new ɵAnimationGroupPlayer(players);\n }\n}\nfunction normalizeKeyframes(driver, normalizer, element, keyframes, preStyles, postStyles) {\n if (preStyles === void 0) { preStyles = {}; }\n if (postStyles === void 0) { postStyles = {}; }\n var errors = [];\n var normalizedKeyframes = [];\n var previousOffset = -1;\n var previousKeyframe = null;\n keyframes.forEach(function (kf) {\n var offset = kf['offset'];\n var isSameOffset = offset == previousOffset;\n var normalizedKeyframe = (isSameOffset && previousKeyframe) || {};\n Object.keys(kf).forEach(function (prop) {\n var normalizedProp = prop;\n var normalizedValue = kf[prop];\n if (prop !== 'offset') {\n normalizedProp = normalizer.normalizePropertyName(normalizedProp, errors);\n switch (normalizedValue) {\n case ɵPRE_STYLE:\n normalizedValue = preStyles[prop];\n break;\n case AUTO_STYLE:\n normalizedValue = postStyles[prop];\n break;\n default:\n normalizedValue =\n normalizer.normalizeStyleValue(prop, normalizedProp, normalizedValue, errors);\n break;\n }\n }\n normalizedKeyframe[normalizedProp] = normalizedValue;\n });\n if (!isSameOffset) {\n normalizedKeyframes.push(normalizedKeyframe);\n }\n previousKeyframe = normalizedKeyframe;\n previousOffset = offset;\n });\n if (errors.length) {\n var LINE_START = '\\n - ';\n throw new Error(\"Unable to animate due to the following errors:\" + LINE_START + errors.join(LINE_START));\n }\n return normalizedKeyframes;\n}\nfunction listenOnPlayer(player, eventName, event, callback) {\n switch (eventName) {\n case 'start':\n player.onStart(function () { return callback(event && copyAnimationEvent(event, 'start', player.totalTime)); });\n break;\n case 'done':\n player.onDone(function () { return callback(event && copyAnimationEvent(event, 'done', player.totalTime)); });\n break;\n case 'destroy':\n player.onDestroy(function () { return callback(event && copyAnimationEvent(event, 'destroy', player.totalTime)); });\n break;\n }\n}\nfunction copyAnimationEvent(e, phaseName, totalTime) {\n var event = makeAnimationEvent(e.element, e.triggerName, e.fromState, e.toState, phaseName || e.phaseName, totalTime == undefined ? e.totalTime : totalTime);\n var data = e['_data'];\n if (data != null) {\n event['_data'] = data;\n }\n return event;\n}\nfunction makeAnimationEvent(element, triggerName, fromState, toState, phaseName, totalTime) {\n if (phaseName === void 0) { phaseName = ''; }\n if (totalTime === void 0) { totalTime = 0; }\n return { element: element, triggerName: triggerName, fromState: fromState, toState: toState, phaseName: phaseName, totalTime: totalTime };\n}\nfunction getOrSetAsInMap(map, key, defaultValue) {\n var value;\n if (map instanceof Map) {\n value = map.get(key);\n if (!value) {\n map.set(key, value = defaultValue);\n }\n }\n else {\n value = map[key];\n if (!value) {\n value = map[key] = defaultValue;\n }\n }\n return value;\n}\nfunction parseTimelineCommand(command) {\n var separatorPos = command.indexOf(':');\n var id = command.substring(1, separatorPos);\n var action = command.substr(separatorPos + 1);\n return [id, action];\n}\nvar _contains = function (elm1, elm2) { return false; };\nvar _matches = function (element, selector) { return false; };\nvar _query = function (element, selector, multi) {\n return [];\n};\nif (typeof Element != 'undefined') {\n // this is well supported in all browsers\n _contains = function (elm1, elm2) { return elm1.contains(elm2); };\n if (Element.prototype.matches) {\n _matches = function (element, selector) { return element.matches(selector); };\n }\n else {\n var proto = Element.prototype;\n var fn_1 = proto.matchesSelector || proto.mozMatchesSelector || proto.msMatchesSelector ||\n proto.oMatchesSelector || proto.webkitMatchesSelector;\n if (fn_1) {\n _matches = function (element, selector) { return fn_1.apply(element, [selector]); };\n }\n }\n _query = function (element, selector, multi) {\n var results = [];\n if (multi) {\n results.push.apply(results, element.querySelectorAll(selector));\n }\n else {\n var elm = element.querySelector(selector);\n if (elm) {\n results.push(elm);\n }\n }\n return results;\n };\n}\nvar matchesElement = _matches;\nvar containsElement = _contains;\nvar invokeQuery = _query;\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 * @experimental\n */\nvar NoopAnimationDriver = (function () {\n function NoopAnimationDriver() {\n }\n NoopAnimationDriver.prototype.matchesElement = function (element, selector) {\n return matchesElement(element, selector);\n };\n NoopAnimationDriver.prototype.containsElement = function (elm1, elm2) { return containsElement(elm1, elm2); };\n NoopAnimationDriver.prototype.query = function (element, selector, multi) {\n return invokeQuery(element, selector, multi);\n };\n NoopAnimationDriver.prototype.computeStyle = function (element, prop, defaultValue) {\n return defaultValue || '';\n };\n NoopAnimationDriver.prototype.animate = function (element, keyframes, duration, delay, easing, previousPlayers) {\n if (previousPlayers === void 0) { previousPlayers = []; }\n return new NoopAnimationPlayer();\n };\n return NoopAnimationDriver;\n}());\n/**\n * @experimental\n */\nvar AnimationDriver = (function () {\n function AnimationDriver() {\n }\n return AnimationDriver;\n}());\nAnimationDriver.NOOP = new NoopAnimationDriver();\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 */\nvar ONE_SECOND = 1000;\nvar SUBSTITUTION_EXPR_START = '{{';\nvar SUBSTITUTION_EXPR_END = '}}';\nvar ENTER_CLASSNAME = 'ng-enter';\nvar LEAVE_CLASSNAME = 'ng-leave';\nvar ENTER_SELECTOR = '.ng-enter';\nvar LEAVE_SELECTOR = '.ng-leave';\nvar NG_TRIGGER_CLASSNAME = 'ng-trigger';\nvar NG_TRIGGER_SELECTOR = '.ng-trigger';\nvar NG_ANIMATING_CLASSNAME = 'ng-animating';\nvar NG_ANIMATING_SELECTOR = '.ng-animating';\nfunction resolveTimingValue(value) {\n if (typeof value == 'number')\n return value;\n var matches = value.match(/^(-?[\\.\\d]+)(m?s)/);\n if (!matches || matches.length < 2)\n return 0;\n return _convertTimeValueToMS(parseFloat(matches[1]), matches[2]);\n}\nfunction _convertTimeValueToMS(value, unit) {\n switch (unit) {\n case 's':\n return value * ONE_SECOND;\n default:\n return value;\n }\n}\nfunction resolveTiming(timings, errors, allowNegativeValues) {\n return timings.hasOwnProperty('duration') ?\n timings :\n parseTimeExpression(timings, errors, allowNegativeValues);\n}\nfunction parseTimeExpression(exp, errors, allowNegativeValues) {\n var regex = /^(-?[\\.\\d]+)(m?s)(?:\\s+(-?[\\.\\d]+)(m?s))?(?:\\s+([-a-z]+(?:\\(.+?\\))?))?$/i;\n var duration;\n var delay = 0;\n var easing = '';\n if (typeof exp === 'string') {\n var matches = exp.match(regex);\n if (matches === null) {\n errors.push(\"The provided timing value \\\"\" + exp + \"\\\" is invalid.\");\n return { duration: 0, delay: 0, easing: '' };\n }\n duration = _convertTimeValueToMS(parseFloat(matches[1]), matches[2]);\n var delayMatch = matches[3];\n if (delayMatch != null) {\n delay = _convertTimeValueToMS(Math.floor(parseFloat(delayMatch)), matches[4]);\n }\n var easingVal = matches[5];\n if (easingVal) {\n easing = easingVal;\n }\n }\n else {\n duration = exp;\n }\n if (!allowNegativeValues) {\n var containsErrors = false;\n var startIndex = errors.length;\n if (duration < 0) {\n errors.push(\"Duration values below 0 are not allowed for this animation step.\");\n containsErrors = true;\n }\n if (delay < 0) {\n errors.push(\"Delay values below 0 are not allowed for this animation step.\");\n containsErrors = true;\n }\n if (containsErrors) {\n errors.splice(startIndex, 0, \"The provided timing value \\\"\" + exp + \"\\\" is invalid.\");\n }\n }\n return { duration: duration, delay: delay, easing: easing };\n}\nfunction copyObj(obj, destination) {\n if (destination === void 0) { destination = {}; }\n Object.keys(obj).forEach(function (prop) { destination[prop] = obj[prop]; });\n return destination;\n}\nfunction normalizeStyles(styles) {\n var normalizedStyles = {};\n if (Array.isArray(styles)) {\n styles.forEach(function (data) { return copyStyles(data, false, normalizedStyles); });\n }\n else {\n copyStyles(styles, false, normalizedStyles);\n }\n return normalizedStyles;\n}\nfunction copyStyles(styles, readPrototype, destination) {\n if (destination === void 0) { destination = {}; }\n if (readPrototype) {\n // we make use of a for-in loop so that the\n // prototypically inherited properties are\n // revealed from the backFill map\n for (var prop in styles) {\n destination[prop] = styles[prop];\n }\n }\n else {\n copyObj(styles, destination);\n }\n return destination;\n}\nfunction setStyles(element, styles) {\n if (element['style']) {\n Object.keys(styles).forEach(function (prop) {\n var camelProp = dashCaseToCamelCase(prop);\n element.style[camelProp] = styles[prop];\n });\n }\n}\nfunction eraseStyles(element, styles) {\n if (element['style']) {\n Object.keys(styles).forEach(function (prop) {\n var camelProp = dashCaseToCamelCase(prop);\n element.style[camelProp] = '';\n });\n }\n}\nfunction normalizeAnimationEntry(steps) {\n if (Array.isArray(steps)) {\n if (steps.length == 1)\n return steps[0];\n return sequence(steps);\n }\n return steps;\n}\nfunction validateStyleParams(value, options, errors) {\n var params = options.params || {};\n var matches = extractStyleParams(value);\n if (matches.length) {\n matches.forEach(function (varName) {\n if (!params.hasOwnProperty(varName)) {\n errors.push(\"Unable to resolve the local animation param \" + varName + \" in the given list of values\");\n }\n });\n }\n}\nvar PARAM_REGEX = new RegExp(SUBSTITUTION_EXPR_START + \"\\\\s*(.+?)\\\\s*\" + SUBSTITUTION_EXPR_END, 'g');\nfunction extractStyleParams(value) {\n var params = [];\n if (typeof value === 'string') {\n var val = value.toString();\n var match = void 0;\n while (match = PARAM_REGEX.exec(val)) {\n params.push(match[1]);\n }\n PARAM_REGEX.lastIndex = 0;\n }\n return params;\n}\nfunction interpolateParams(value, params, errors) {\n var original = value.toString();\n var str = original.replace(PARAM_REGEX, function (_, varName) {\n var localVal = params[varName];\n // this means that the value was never overidden by the data passed in by the user\n if (!params.hasOwnProperty(varName)) {\n errors.push(\"Please provide a value for the animation param \" + varName);\n localVal = '';\n }\n return localVal.toString();\n });\n // we do this to assert that numeric values stay as they are\n return str == original ? value : str;\n}\nfunction iteratorToArray(iterator) {\n var arr = [];\n var item = iterator.next();\n while (!item.done) {\n arr.push(item.value);\n item = iterator.next();\n }\n return arr;\n}\nvar DASH_CASE_REGEXP = /-+([a-z0-9])/g;\nfunction dashCaseToCamelCase(input) {\n return input.replace(DASH_CASE_REGEXP, function () {\n var m = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n m[_i] = arguments[_i];\n }\n return m[1].toUpperCase();\n });\n}\nfunction allowPreviousPlayerStylesMerge(duration, delay) {\n return duration === 0 || delay === 0;\n}\nfunction visitDslNode(visitor, node, context) {\n switch (node.type) {\n case 7 /* Trigger */:\n return visitor.visitTrigger(node, context);\n case 0 /* State */:\n return visitor.visitState(node, context);\n case 1 /* Transition */:\n return visitor.visitTransition(node, context);\n case 2 /* Sequence */:\n return visitor.visitSequence(node, context);\n case 3 /* Group */:\n return visitor.visitGroup(node, context);\n case 4 /* Animate */:\n return visitor.visitAnimate(node, context);\n case 5 /* Keyframes */:\n return visitor.visitKeyframes(node, context);\n case 6 /* Style */:\n return visitor.visitStyle(node, context);\n case 8 /* Reference */:\n return visitor.visitReference(node, context);\n case 9 /* AnimateChild */:\n return visitor.visitAnimateChild(node, context);\n case 10 /* AnimateRef */:\n return visitor.visitAnimateRef(node, context);\n case 11 /* Query */:\n return visitor.visitQuery(node, context);\n case 12 /* Stagger */:\n return visitor.visitStagger(node, context);\n default:\n throw new Error(\"Unable to resolve animation metadata node #\" + node.type);\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 */\nvar ANY_STATE = '*';\n/**\n * @param {?} transitionValue\n * @param {?} errors\n * @return {?}\n */\nfunction parseTransitionExpr(transitionValue, errors) {\n var /** @type {?} */ expressions = [];\n if (typeof transitionValue == 'string') {\n ((transitionValue))\n .split(/\\s*,\\s*/)\n .forEach(function (str) { return parseInnerTransitionStr(str, expressions, errors); });\n }\n else {\n expressions.push(/** @type {?} */ (transitionValue));\n }\n return expressions;\n}\n/**\n * @param {?} eventStr\n * @param {?} expressions\n * @param {?} errors\n * @return {?}\n */\nfunction parseInnerTransitionStr(eventStr, expressions, errors) {\n if (eventStr[0] == ':') {\n eventStr = parseAnimationAlias(eventStr, errors);\n }\n var /** @type {?} */ match = eventStr.match(/^(\\*|[-\\w]+)\\s*()\\s*(\\*|[-\\w]+)$/);\n if (match == null || match.length < 4) {\n errors.push(\"The provided transition expression \\\"\" + eventStr + \"\\\" is not supported\");\n return expressions;\n }\n var /** @type {?} */ fromState = match[1];\n var /** @type {?} */ separator = match[2];\n var /** @type {?} */ toState = match[3];\n expressions.push(makeLambdaFromStates(fromState, toState));\n var /** @type {?} */ isFullAnyStateExpr = fromState == ANY_STATE && toState == ANY_STATE;\n if (separator[0] == '<' && !isFullAnyStateExpr) {\n expressions.push(makeLambdaFromStates(toState, fromState));\n }\n}\n/**\n * @param {?} alias\n * @param {?} errors\n * @return {?}\n */\nfunction parseAnimationAlias(alias, errors) {\n switch (alias) {\n case ':enter':\n return 'void => *';\n case ':leave':\n return '* => void';\n default:\n errors.push(\"The transition alias value \\\"\" + alias + \"\\\" is not supported\");\n return '* => *';\n }\n}\nvar TRUE_BOOLEAN_VALUES = new Set();\nTRUE_BOOLEAN_VALUES.add('true');\nTRUE_BOOLEAN_VALUES.add('1');\nvar FALSE_BOOLEAN_VALUES = new Set();\nFALSE_BOOLEAN_VALUES.add('false');\nFALSE_BOOLEAN_VALUES.add('0');\n/**\n * @param {?} lhs\n * @param {?} rhs\n * @return {?}\n */\nfunction makeLambdaFromStates(lhs, rhs) {\n var /** @type {?} */ LHS_MATCH_BOOLEAN = TRUE_BOOLEAN_VALUES.has(lhs) || FALSE_BOOLEAN_VALUES.has(lhs);\n var /** @type {?} */ RHS_MATCH_BOOLEAN = TRUE_BOOLEAN_VALUES.has(rhs) || FALSE_BOOLEAN_VALUES.has(rhs);\n return function (fromState, toState) {\n var /** @type {?} */ lhsMatch = lhs == ANY_STATE || lhs == fromState;\n var /** @type {?} */ rhsMatch = rhs == ANY_STATE || rhs == toState;\n if (!lhsMatch && LHS_MATCH_BOOLEAN && typeof fromState === 'boolean') {\n lhsMatch = fromState ? TRUE_BOOLEAN_VALUES.has(lhs) : FALSE_BOOLEAN_VALUES.has(lhs);\n }\n if (!rhsMatch && RHS_MATCH_BOOLEAN && typeof toState === 'boolean') {\n rhsMatch = toState ? TRUE_BOOLEAN_VALUES.has(rhs) : FALSE_BOOLEAN_VALUES.has(rhs);\n }\n return lhsMatch && rhsMatch;\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 */\nvar SELF_TOKEN = ':self';\nvar SELF_TOKEN_REGEX = new RegExp(\"s*\" + SELF_TOKEN + \"s*,?\", 'g');\n/**\n * @param {?} metadata\n * @param {?} errors\n * @return {?}\n */\nfunction buildAnimationAst(metadata, errors) {\n return new AnimationAstBuilderVisitor().build(metadata, errors);\n}\nvar LEAVE_TOKEN = ':leave';\nvar LEAVE_TOKEN_REGEX = new RegExp(LEAVE_TOKEN, 'g');\nvar ENTER_TOKEN = ':enter';\nvar ENTER_TOKEN_REGEX = new RegExp(ENTER_TOKEN, 'g');\nvar ROOT_SELECTOR = '';\nvar AnimationAstBuilderVisitor = (function () {\n function AnimationAstBuilderVisitor() {\n }\n /**\n * @param {?} metadata\n * @param {?} errors\n * @return {?}\n */\n AnimationAstBuilderVisitor.prototype.build = function (metadata, errors) {\n var /** @type {?} */ context = new AnimationAstBuilderContext(errors);\n this._resetContextStyleTimingState(context);\n return (visitDslNode(this, normalizeAnimationEntry(metadata), context));\n };\n /**\n * @param {?} context\n * @return {?}\n */\n AnimationAstBuilderVisitor.prototype._resetContextStyleTimingState = function (context) {\n context.currentQuerySelector = ROOT_SELECTOR;\n context.collectedStyles = {};\n context.collectedStyles[ROOT_SELECTOR] = {};\n context.currentTime = 0;\n };\n /**\n * @param {?} metadata\n * @param {?} context\n * @return {?}\n */\n AnimationAstBuilderVisitor.prototype.visitTrigger = function (metadata, context) {\n var _this = this;\n var /** @type {?} */ queryCount = context.queryCount = 0;\n var /** @type {?} */ depCount = context.depCount = 0;\n var /** @type {?} */ states = [];\n var /** @type {?} */ transitions = [];\n metadata.definitions.forEach(function (def) {\n _this._resetContextStyleTimingState(context);\n if (def.type == 0 /* State */) {\n var /** @type {?} */ stateDef_1 = (def);\n var /** @type {?} */ name = stateDef_1.name;\n name.split(/\\s*,\\s*/).forEach(function (n) {\n stateDef_1.name = n;\n states.push(_this.visitState(stateDef_1, context));\n });\n stateDef_1.name = name;\n }\n else if (def.type == 1 /* Transition */) {\n var /** @type {?} */ transition = _this.visitTransition(/** @type {?} */ (def), context);\n queryCount += transition.queryCount;\n depCount += transition.depCount;\n transitions.push(transition);\n }\n else {\n context.errors.push('only state() and transition() definitions can sit inside of a trigger()');\n }\n });\n return {\n type: 7 /* Trigger */,\n name: metadata.name, states: states, transitions: transitions, queryCount: queryCount, depCount: depCount,\n options: null\n };\n };\n /**\n * @param {?} metadata\n * @param {?} context\n * @return {?}\n */\n AnimationAstBuilderVisitor.prototype.visitState = function (metadata, context) {\n var /** @type {?} */ styleAst = this.visitStyle(metadata.styles, context);\n var /** @type {?} */ astParams = (metadata.options && metadata.options.params) || null;\n if (styleAst.containsDynamicStyles) {\n var /** @type {?} */ missingSubs_1 = new Set();\n var /** @type {?} */ params_1 = astParams || {};\n styleAst.styles.forEach(function (value) {\n if (isObject(value)) {\n var /** @type {?} */ stylesObj_1 = (value);\n Object.keys(stylesObj_1).forEach(function (prop) {\n extractStyleParams(stylesObj_1[prop]).forEach(function (sub) {\n if (!params_1.hasOwnProperty(sub)) {\n missingSubs_1.add(sub);\n }\n });\n });\n }\n });\n if (missingSubs_1.size) {\n var /** @type {?} */ missingSubsArr = iteratorToArray(missingSubs_1.values());\n context.errors.push(\"state(\\\"\" + metadata.name + \"\\\", ...) must define default values for all the following style substitutions: \" + missingSubsArr.join(', '));\n }\n }\n return {\n type: 0 /* State */,\n name: metadata.name,\n style: styleAst,\n options: astParams ? { params: astParams } : null\n };\n };\n /**\n * @param {?} metadata\n * @param {?} context\n * @return {?}\n */\n AnimationAstBuilderVisitor.prototype.visitTransition = function (metadata, context) {\n context.queryCount = 0;\n context.depCount = 0;\n var /** @type {?} */ animation = visitDslNode(this, normalizeAnimationEntry(metadata.animation), context);\n var /** @type {?} */ matchers = parseTransitionExpr(metadata.expr, context.errors);\n return {\n type: 1 /* Transition */,\n matchers: matchers,\n animation: animation,\n queryCount: context.queryCount,\n depCount: context.depCount,\n options: normalizeAnimationOptions(metadata.options)\n };\n };\n /**\n * @param {?} metadata\n * @param {?} context\n * @return {?}\n */\n AnimationAstBuilderVisitor.prototype.visitSequence = function (metadata, context) {\n var _this = this;\n return {\n type: 2 /* Sequence */,\n steps: metadata.steps.map(function (s) { return visitDslNode(_this, s, context); }),\n options: normalizeAnimationOptions(metadata.options)\n };\n };\n /**\n * @param {?} metadata\n * @param {?} context\n * @return {?}\n */\n AnimationAstBuilderVisitor.prototype.visitGroup = function (metadata, context) {\n var _this = this;\n var /** @type {?} */ currentTime = context.currentTime;\n var /** @type {?} */ furthestTime = 0;\n var /** @type {?} */ steps = metadata.steps.map(function (step) {\n context.currentTime = currentTime;\n var /** @type {?} */ innerAst = visitDslNode(_this, step, context);\n furthestTime = Math.max(furthestTime, context.currentTime);\n return innerAst;\n });\n context.currentTime = furthestTime;\n return {\n type: 3 /* Group */,\n steps: steps,\n options: normalizeAnimationOptions(metadata.options)\n };\n };\n /**\n * @param {?} metadata\n * @param {?} context\n * @return {?}\n */\n AnimationAstBuilderVisitor.prototype.visitAnimate = function (metadata, context) {\n var /** @type {?} */ timingAst = constructTimingAst(metadata.timings, context.errors);\n context.currentAnimateTimings = timingAst;\n var /** @type {?} */ styleAst;\n var /** @type {?} */ styleMetadata = metadata.styles ? metadata.styles : style({});\n if (styleMetadata.type == 5 /* Keyframes */) {\n styleAst = this.visitKeyframes(/** @type {?} */ (styleMetadata), context);\n }\n else {\n var /** @type {?} */ styleMetadata_1 = (metadata.styles);\n var /** @type {?} */ isEmpty = false;\n if (!styleMetadata_1) {\n isEmpty = true;\n var /** @type {?} */ newStyleData = {};\n if (timingAst.easing) {\n newStyleData['easing'] = timingAst.easing;\n }\n styleMetadata_1 = style(newStyleData);\n }\n context.currentTime += timingAst.duration + timingAst.delay;\n var /** @type {?} */ _styleAst = this.visitStyle(styleMetadata_1, context);\n _styleAst.isEmptyStep = isEmpty;\n styleAst = _styleAst;\n }\n context.currentAnimateTimings = null;\n return {\n type: 4 /* Animate */,\n timings: timingAst,\n style: styleAst,\n options: null\n };\n };\n /**\n * @param {?} metadata\n * @param {?} context\n * @return {?}\n */\n AnimationAstBuilderVisitor.prototype.visitStyle = function (metadata, context) {\n var /** @type {?} */ ast = this._makeStyleAst(metadata, context);\n this._validateStyleAst(ast, context);\n return ast;\n };\n /**\n * @param {?} metadata\n * @param {?} context\n * @return {?}\n */\n AnimationAstBuilderVisitor.prototype._makeStyleAst = function (metadata, context) {\n var /** @type {?} */ styles = [];\n if (Array.isArray(metadata.styles)) {\n ((metadata.styles)).forEach(function (styleTuple) {\n if (typeof styleTuple == 'string') {\n if (styleTuple == AUTO_STYLE) {\n styles.push(/** @type {?} */ (styleTuple));\n }\n else {\n context.errors.push(\"The provided style string value \" + styleTuple + \" is not allowed.\");\n }\n }\n else {\n styles.push(/** @type {?} */ (styleTuple));\n }\n });\n }\n else {\n styles.push(metadata.styles);\n }\n var /** @type {?} */ containsDynamicStyles = false;\n var /** @type {?} */ collectedEasing = null;\n styles.forEach(function (styleData) {\n if (isObject(styleData)) {\n var /** @type {?} */ styleMap = (styleData);\n var /** @type {?} */ easing = styleMap['easing'];\n if (easing) {\n collectedEasing = (easing);\n delete styleMap['easing'];\n }\n if (!containsDynamicStyles) {\n for (var /** @type {?} */ prop in styleMap) {\n var /** @type {?} */ value = styleMap[prop];\n if (value.toString().indexOf(SUBSTITUTION_EXPR_START) >= 0) {\n containsDynamicStyles = true;\n break;\n }\n }\n }\n }\n });\n return {\n type: 6 /* Style */,\n styles: styles,\n easing: collectedEasing,\n offset: metadata.offset, containsDynamicStyles: containsDynamicStyles,\n options: null\n };\n };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n AnimationAstBuilderVisitor.prototype._validateStyleAst = function (ast, context) {\n var /** @type {?} */ timings = context.currentAnimateTimings;\n var /** @type {?} */ endTime = context.currentTime;\n var /** @type {?} */ startTime = context.currentTime;\n if (timings && startTime > 0) {\n startTime -= timings.duration + timings.delay;\n }\n ast.styles.forEach(function (tuple) {\n if (typeof tuple == 'string')\n return;\n Object.keys(tuple).forEach(function (prop) {\n var /** @type {?} */ collectedStyles = context.collectedStyles[((context.currentQuerySelector))];\n var /** @type {?} */ collectedEntry = collectedStyles[prop];\n var /** @type {?} */ updateCollectedStyle = true;\n if (collectedEntry) {\n if (startTime != endTime && startTime >= collectedEntry.startTime &&\n endTime <= collectedEntry.endTime) {\n context.errors.push(\"The CSS property \\\"\" + prop + \"\\\" that exists between the times of \\\"\" + collectedEntry.startTime + \"ms\\\" and \\\"\" + collectedEntry.endTime + \"ms\\\" is also being animated in a parallel animation between the times of \\\"\" + startTime + \"ms\\\" and \\\"\" + endTime + \"ms\\\"\");\n updateCollectedStyle = false;\n }\n // we always choose the smaller start time value since we\n // want to have a record of the entire animation window where\n // the style property is being animated in between\n startTime = collectedEntry.startTime;\n }\n if (updateCollectedStyle) {\n collectedStyles[prop] = { startTime: startTime, endTime: endTime };\n }\n if (context.options) {\n validateStyleParams(tuple[prop], context.options, context.errors);\n }\n });\n });\n };\n /**\n * @param {?} metadata\n * @param {?} context\n * @return {?}\n */\n AnimationAstBuilderVisitor.prototype.visitKeyframes = function (metadata, context) {\n var _this = this;\n var /** @type {?} */ ast = { type: 5 /* Keyframes */, styles: [], options: null };\n if (!context.currentAnimateTimings) {\n context.errors.push(\"keyframes() must be placed inside of a call to animate()\");\n return ast;\n }\n var /** @type {?} */ MAX_KEYFRAME_OFFSET = 1;\n var /** @type {?} */ totalKeyframesWithOffsets = 0;\n var /** @type {?} */ offsets = [];\n var /** @type {?} */ offsetsOutOfOrder = false;\n var /** @type {?} */ keyframesOutOfRange = false;\n var /** @type {?} */ previousOffset = 0;\n var /** @type {?} */ keyframes = metadata.steps.map(function (styles) {\n var /** @type {?} */ style$$1 = _this._makeStyleAst(styles, context);\n var /** @type {?} */ offsetVal = style$$1.offset != null ? style$$1.offset : consumeOffset(style$$1.styles);\n var /** @type {?} */ offset = 0;\n if (offsetVal != null) {\n totalKeyframesWithOffsets++;\n offset = style$$1.offset = offsetVal;\n }\n keyframesOutOfRange = keyframesOutOfRange || offset < 0 || offset > 1;\n offsetsOutOfOrder = offsetsOutOfOrder || offset < previousOffset;\n previousOffset = offset;\n offsets.push(offset);\n return style$$1;\n });\n if (keyframesOutOfRange) {\n context.errors.push(\"Please ensure that all keyframe offsets are between 0 and 1\");\n }\n if (offsetsOutOfOrder) {\n context.errors.push(\"Please ensure that all keyframe offsets are in order\");\n }\n var /** @type {?} */ length = metadata.steps.length;\n var /** @type {?} */ generatedOffset = 0;\n if (totalKeyframesWithOffsets > 0 && totalKeyframesWithOffsets < length) {\n context.errors.push(\"Not all style() steps within the declared keyframes() contain offsets\");\n }\n else if (totalKeyframesWithOffsets == 0) {\n generatedOffset = MAX_KEYFRAME_OFFSET / (length - 1);\n }\n var /** @type {?} */ limit = length - 1;\n var /** @type {?} */ currentTime = context.currentTime;\n var /** @type {?} */ currentAnimateTimings = ((context.currentAnimateTimings));\n var /** @type {?} */ animateDuration = currentAnimateTimings.duration;\n keyframes.forEach(function (kf, i) {\n var /** @type {?} */ offset = generatedOffset > 0 ? (i == limit ? 1 : (generatedOffset * i)) : offsets[i];\n var /** @type {?} */ durationUpToThisFrame = offset * animateDuration;\n context.currentTime = currentTime + currentAnimateTimings.delay + durationUpToThisFrame;\n currentAnimateTimings.duration = durationUpToThisFrame;\n _this._validateStyleAst(kf, context);\n kf.offset = offset;\n ast.styles.push(kf);\n });\n return ast;\n };\n /**\n * @param {?} metadata\n * @param {?} context\n * @return {?}\n */\n AnimationAstBuilderVisitor.prototype.visitReference = function (metadata, context) {\n return {\n type: 8 /* Reference */,\n animation: visitDslNode(this, normalizeAnimationEntry(metadata.animation), context),\n options: normalizeAnimationOptions(metadata.options)\n };\n };\n /**\n * @param {?} metadata\n * @param {?} context\n * @return {?}\n */\n AnimationAstBuilderVisitor.prototype.visitAnimateChild = function (metadata, context) {\n context.depCount++;\n return {\n type: 9 /* AnimateChild */,\n options: normalizeAnimationOptions(metadata.options)\n };\n };\n /**\n * @param {?} metadata\n * @param {?} context\n * @return {?}\n */\n AnimationAstBuilderVisitor.prototype.visitAnimateRef = function (metadata, context) {\n return {\n type: 10 /* AnimateRef */,\n animation: this.visitReference(metadata.animation, context),\n options: normalizeAnimationOptions(metadata.options)\n };\n };\n /**\n * @param {?} metadata\n * @param {?} context\n * @return {?}\n */\n AnimationAstBuilderVisitor.prototype.visitQuery = function (metadata, context) {\n var /** @type {?} */ parentSelector = ((context.currentQuerySelector));\n var /** @type {?} */ options = ((metadata.options || {}));\n context.queryCount++;\n context.currentQuery = metadata;\n var _a = normalizeSelector(metadata.selector), selector = _a[0], includeSelf = _a[1];\n context.currentQuerySelector =\n parentSelector.length ? (parentSelector + ' ' + selector) : selector;\n getOrSetAsInMap(context.collectedStyles, context.currentQuerySelector, {});\n var /** @type {?} */ animation = visitDslNode(this, normalizeAnimationEntry(metadata.animation), context);\n context.currentQuery = null;\n context.currentQuerySelector = parentSelector;\n return {\n type: 11 /* Query */,\n selector: selector,\n limit: options.limit || 0,\n optional: !!options.optional, includeSelf: includeSelf, animation: animation,\n originalSelector: metadata.selector,\n options: normalizeAnimationOptions(metadata.options)\n };\n };\n /**\n * @param {?} metadata\n * @param {?} context\n * @return {?}\n */\n AnimationAstBuilderVisitor.prototype.visitStagger = function (metadata, context) {\n if (!context.currentQuery) {\n context.errors.push(\"stagger() can only be used inside of query()\");\n }\n var /** @type {?} */ timings = metadata.timings === 'full' ?\n { duration: 0, delay: 0, easing: 'full' } :\n resolveTiming(metadata.timings, context.errors, true);\n return {\n type: 12 /* Stagger */,\n animation: visitDslNode(this, normalizeAnimationEntry(metadata.animation), context), timings: timings,\n options: null\n };\n };\n return AnimationAstBuilderVisitor;\n}());\n/**\n * @param {?} selector\n * @return {?}\n */\nfunction normalizeSelector(selector) {\n var /** @type {?} */ hasAmpersand = selector.split(/\\s*,\\s*/).find(function (token) { return token == SELF_TOKEN; }) ? true : false;\n if (hasAmpersand) {\n selector = selector.replace(SELF_TOKEN_REGEX, '');\n }\n selector = selector.replace(ENTER_TOKEN_REGEX, ENTER_SELECTOR)\n .replace(LEAVE_TOKEN_REGEX, LEAVE_SELECTOR)\n .replace(/@\\*/g, NG_TRIGGER_SELECTOR)\n .replace(/@\\w+/g, function (match) { return NG_TRIGGER_SELECTOR + '-' + match.substr(1); })\n .replace(/:animating/g, NG_ANIMATING_SELECTOR);\n return [selector, hasAmpersand];\n}\n/**\n * @param {?} obj\n * @return {?}\n */\nfunction normalizeParams(obj) {\n return obj ? copyObj(obj) : null;\n}\nvar AnimationAstBuilderContext = (function () {\n /**\n * @param {?} errors\n */\n function AnimationAstBuilderContext(errors) {\n this.errors = errors;\n this.queryCount = 0;\n this.depCount = 0;\n this.currentTransition = null;\n this.currentQuery = null;\n this.currentQuerySelector = null;\n this.currentAnimateTimings = null;\n this.currentTime = 0;\n this.collectedStyles = {};\n this.options = null;\n }\n return AnimationAstBuilderContext;\n}());\n/**\n * @param {?} styles\n * @return {?}\n */\nfunction consumeOffset(styles) {\n if (typeof styles == 'string')\n return null;\n var /** @type {?} */ offset = null;\n if (Array.isArray(styles)) {\n styles.forEach(function (styleTuple) {\n if (isObject(styleTuple) && styleTuple.hasOwnProperty('offset')) {\n var /** @type {?} */ obj = (styleTuple);\n offset = parseFloat(/** @type {?} */ (obj['offset']));\n delete obj['offset'];\n }\n });\n }\n else if (isObject(styles) && styles.hasOwnProperty('offset')) {\n var /** @type {?} */ obj = (styles);\n offset = parseFloat(/** @type {?} */ (obj['offset']));\n delete obj['offset'];\n }\n return offset;\n}\n/**\n * @param {?} value\n * @return {?}\n */\nfunction isObject(value) {\n return !Array.isArray(value) && typeof value == 'object';\n}\n/**\n * @param {?} value\n * @param {?} errors\n * @return {?}\n */\nfunction constructTimingAst(value, errors) {\n var /** @type {?} */ timings = null;\n if (value.hasOwnProperty('duration')) {\n timings = (value);\n }\n else if (typeof value == 'number') {\n var /** @type {?} */ duration = resolveTiming(/** @type {?} */ (value), errors).duration;\n return makeTimingAst(/** @type {?} */ (duration), 0, '');\n }\n var /** @type {?} */ strValue = (value);\n var /** @type {?} */ isDynamic = strValue.split(/\\s+/).some(function (v) { return v.charAt(0) == '{' && v.charAt(1) == '{'; });\n if (isDynamic) {\n var /** @type {?} */ ast = (makeTimingAst(0, 0, ''));\n ast.dynamic = true;\n ast.strValue = strValue;\n return (ast);\n }\n timings = timings || resolveTiming(strValue, errors);\n return makeTimingAst(timings.duration, timings.delay, timings.easing);\n}\n/**\n * @param {?} options\n * @return {?}\n */\nfunction normalizeAnimationOptions(options) {\n if (options) {\n options = copyObj(options);\n if (options['params']) {\n options['params'] = ((normalizeParams(options['params'])));\n }\n }\n else {\n options = {};\n }\n return options;\n}\n/**\n * @param {?} duration\n * @param {?} delay\n * @param {?} easing\n * @return {?}\n */\nfunction makeTimingAst(duration, delay, easing) {\n return { duration: duration, delay: delay, easing: easing };\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/**\n * @param {?} element\n * @param {?} keyframes\n * @param {?} preStyleProps\n * @param {?} postStyleProps\n * @param {?} duration\n * @param {?} delay\n * @param {?=} easing\n * @param {?=} subTimeline\n * @return {?}\n */\nfunction createTimelineInstruction(element, keyframes, preStyleProps, postStyleProps, duration, delay, easing, subTimeline) {\n if (easing === void 0) { easing = null; }\n if (subTimeline === void 0) { subTimeline = false; }\n return {\n type: 1 /* TimelineAnimation */,\n element: element,\n keyframes: keyframes,\n preStyleProps: preStyleProps,\n postStyleProps: postStyleProps,\n duration: duration,\n delay: delay,\n totalTime: duration + delay, easing: easing, subTimeline: subTimeline\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 */\nvar ElementInstructionMap = (function () {\n function ElementInstructionMap() {\n this._map = new Map();\n }\n /**\n * @param {?} element\n * @return {?}\n */\n ElementInstructionMap.prototype.consume = function (element) {\n var /** @type {?} */ instructions = this._map.get(element);\n if (instructions) {\n this._map.delete(element);\n }\n else {\n instructions = [];\n }\n return instructions;\n };\n /**\n * @param {?} element\n * @param {?} instructions\n * @return {?}\n */\n ElementInstructionMap.prototype.append = function (element, instructions) {\n var /** @type {?} */ existingInstructions = this._map.get(element);\n if (!existingInstructions) {\n this._map.set(element, existingInstructions = []);\n }\n existingInstructions.push.apply(existingInstructions, instructions);\n };\n /**\n * @param {?} element\n * @return {?}\n */\n ElementInstructionMap.prototype.has = function (element) { return this._map.has(element); };\n /**\n * @return {?}\n */\n ElementInstructionMap.prototype.clear = function () { this._map.clear(); };\n return ElementInstructionMap;\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 */\nvar ONE_FRAME_IN_MILLISECONDS = 1;\n/**\n * @param {?} driver\n * @param {?} rootElement\n * @param {?} ast\n * @param {?=} startingStyles\n * @param {?=} finalStyles\n * @param {?=} options\n * @param {?=} subInstructions\n * @param {?=} errors\n * @return {?}\n */\nfunction buildAnimationTimelines(driver, rootElement, ast, startingStyles, finalStyles, options, subInstructions, errors) {\n if (startingStyles === void 0) { startingStyles = {}; }\n if (finalStyles === void 0) { finalStyles = {}; }\n if (errors === void 0) { errors = []; }\n return new AnimationTimelineBuilderVisitor().buildKeyframes(driver, rootElement, ast, startingStyles, finalStyles, options, subInstructions, errors);\n}\nvar AnimationTimelineBuilderVisitor = (function () {\n function AnimationTimelineBuilderVisitor() {\n }\n /**\n * @param {?} driver\n * @param {?} rootElement\n * @param {?} ast\n * @param {?} startingStyles\n * @param {?} finalStyles\n * @param {?} options\n * @param {?=} subInstructions\n * @param {?=} errors\n * @return {?}\n */\n AnimationTimelineBuilderVisitor.prototype.buildKeyframes = function (driver, rootElement, ast, startingStyles, finalStyles, options, subInstructions, errors) {\n if (errors === void 0) { errors = []; }\n subInstructions = subInstructions || new ElementInstructionMap();\n var /** @type {?} */ context = new AnimationTimelineContext(driver, rootElement, subInstructions, errors, []);\n context.options = options;\n context.currentTimeline.setStyles([startingStyles], null, context.errors, options);\n visitDslNode(this, ast, context);\n // this checks to see if an actual animation happened\n var /** @type {?} */ timelines = context.timelines.filter(function (timeline) { return timeline.containsAnimation(); });\n if (timelines.length && Object.keys(finalStyles).length) {\n var /** @type {?} */ tl = timelines[timelines.length - 1];\n if (!tl.allowOnlyTimelineStyles()) {\n tl.setStyles([finalStyles], null, context.errors, options);\n }\n }\n return timelines.length ? timelines.map(function (timeline) { return timeline.buildKeyframes(); }) :\n [createTimelineInstruction(rootElement, [], [], [], 0, 0, '', false)];\n };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n AnimationTimelineBuilderVisitor.prototype.visitTrigger = function (ast, context) {\n // these values are not visited in this AST\n };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n AnimationTimelineBuilderVisitor.prototype.visitState = function (ast, context) {\n // these values are not visited in this AST\n };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n AnimationTimelineBuilderVisitor.prototype.visitTransition = function (ast, context) {\n // these values are not visited in this AST\n };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n AnimationTimelineBuilderVisitor.prototype.visitAnimateChild = function (ast, context) {\n var /** @type {?} */ elementInstructions = context.subInstructions.consume(context.element);\n if (elementInstructions) {\n var /** @type {?} */ innerContext = context.createSubContext(ast.options);\n var /** @type {?} */ startTime = context.currentTimeline.currentTime;\n var /** @type {?} */ endTime = this._visitSubInstructions(elementInstructions, innerContext, /** @type {?} */ (innerContext.options));\n if (startTime != endTime) {\n // we do this on the upper context because we created a sub context for\n // the sub child animations\n context.transformIntoNewTimeline(endTime);\n }\n }\n context.previousNode = ast;\n };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n AnimationTimelineBuilderVisitor.prototype.visitAnimateRef = function (ast, context) {\n var /** @type {?} */ innerContext = context.createSubContext(ast.options);\n innerContext.transformIntoNewTimeline();\n this.visitReference(ast.animation, innerContext);\n context.transformIntoNewTimeline(innerContext.currentTimeline.currentTime);\n context.previousNode = ast;\n };\n /**\n * @param {?} instructions\n * @param {?} context\n * @param {?} options\n * @return {?}\n */\n AnimationTimelineBuilderVisitor.prototype._visitSubInstructions = function (instructions, context, options) {\n var /** @type {?} */ startTime = context.currentTimeline.currentTime;\n var /** @type {?} */ furthestTime = startTime;\n // this is a special-case for when a user wants to skip a sub\n // animation from being fired entirely.\n var /** @type {?} */ duration = options.duration != null ? resolveTimingValue(options.duration) : null;\n var /** @type {?} */ delay = options.delay != null ? resolveTimingValue(options.delay) : null;\n if (duration !== 0) {\n instructions.forEach(function (instruction) {\n var /** @type {?} */ instructionTimings = context.appendInstructionToTimeline(instruction, duration, delay);\n furthestTime =\n Math.max(furthestTime, instructionTimings.duration + instructionTimings.delay);\n });\n }\n return furthestTime;\n };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n AnimationTimelineBuilderVisitor.prototype.visitReference = function (ast, context) {\n context.updateOptions(ast.options, true);\n visitDslNode(this, ast.animation, context);\n context.previousNode = ast;\n };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n AnimationTimelineBuilderVisitor.prototype.visitSequence = function (ast, context) {\n var _this = this;\n var /** @type {?} */ subContextCount = context.subContextCount;\n var /** @type {?} */ ctx = context;\n var /** @type {?} */ options = ast.options;\n if (options && (options.params || options.delay)) {\n ctx = context.createSubContext(options);\n ctx.transformIntoNewTimeline();\n if (options.delay != null) {\n if (ctx.previousNode.type == 6 /* Style */) {\n ctx.currentTimeline.snapshotCurrentStyles();\n ctx.previousNode = DEFAULT_NOOP_PREVIOUS_NODE;\n }\n var /** @type {?} */ delay = resolveTimingValue(options.delay);\n ctx.delayNextStep(delay);\n }\n }\n if (ast.steps.length) {\n ast.steps.forEach(function (s) { return visitDslNode(_this, s, ctx); });\n // this is here just incase the inner steps only contain or end with a style() call\n ctx.currentTimeline.applyStylesToKeyframe();\n // this means that some animation function within the sequence\n // ended up creating a sub timeline (which means the current\n // timeline cannot overlap with the contents of the sequence)\n if (ctx.subContextCount > subContextCount) {\n ctx.transformIntoNewTimeline();\n }\n }\n context.previousNode = ast;\n };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n AnimationTimelineBuilderVisitor.prototype.visitGroup = function (ast, context) {\n var _this = this;\n var /** @type {?} */ innerTimelines = [];\n var /** @type {?} */ furthestTime = context.currentTimeline.currentTime;\n var /** @type {?} */ delay = ast.options && ast.options.delay ? resolveTimingValue(ast.options.delay) : 0;\n ast.steps.forEach(function (s) {\n var /** @type {?} */ innerContext = context.createSubContext(ast.options);\n if (delay) {\n innerContext.delayNextStep(delay);\n }\n visitDslNode(_this, s, innerContext);\n furthestTime = Math.max(furthestTime, innerContext.currentTimeline.currentTime);\n innerTimelines.push(innerContext.currentTimeline);\n });\n // this operation is run after the AST loop because otherwise\n // if the parent timeline's collected styles were updated then\n // it would pass in invalid data into the new-to-be forked items\n innerTimelines.forEach(function (timeline) { return context.currentTimeline.mergeTimelineCollectedStyles(timeline); });\n context.transformIntoNewTimeline(furthestTime);\n context.previousNode = ast;\n };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n AnimationTimelineBuilderVisitor.prototype._visitTiming = function (ast, context) {\n if (((ast)).dynamic) {\n var /** @type {?} */ strValue = ((ast)).strValue;\n var /** @type {?} */ timingValue = context.params ? interpolateParams(strValue, context.params, context.errors) : strValue;\n return resolveTiming(timingValue, context.errors);\n }\n else {\n return { duration: ast.duration, delay: ast.delay, easing: ast.easing };\n }\n };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n AnimationTimelineBuilderVisitor.prototype.visitAnimate = function (ast, context) {\n var /** @type {?} */ timings = context.currentAnimateTimings = this._visitTiming(ast.timings, context);\n var /** @type {?} */ timeline = context.currentTimeline;\n if (timings.delay) {\n context.incrementTime(timings.delay);\n timeline.snapshotCurrentStyles();\n }\n var /** @type {?} */ style$$1 = ast.style;\n if (style$$1.type == 5 /* Keyframes */) {\n this.visitKeyframes(style$$1, context);\n }\n else {\n context.incrementTime(timings.duration);\n this.visitStyle(/** @type {?} */ (style$$1), context);\n timeline.applyStylesToKeyframe();\n }\n context.currentAnimateTimings = null;\n context.previousNode = ast;\n };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n AnimationTimelineBuilderVisitor.prototype.visitStyle = function (ast, context) {\n var /** @type {?} */ timeline = context.currentTimeline;\n var /** @type {?} */ timings = ((context.currentAnimateTimings));\n // this is a special case for when a style() call\n // directly follows an animate() call (but not inside of an animate() call)\n if (!timings && timeline.getCurrentStyleProperties().length) {\n timeline.forwardFrame();\n }\n var /** @type {?} */ easing = (timings && timings.easing) || ast.easing;\n if (ast.isEmptyStep) {\n timeline.applyEmptyStep(easing);\n }\n else {\n timeline.setStyles(ast.styles, easing, context.errors, context.options);\n }\n context.previousNode = ast;\n };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n AnimationTimelineBuilderVisitor.prototype.visitKeyframes = function (ast, context) {\n var /** @type {?} */ currentAnimateTimings = ((context.currentAnimateTimings));\n var /** @type {?} */ startTime = (((context.currentTimeline))).duration;\n var /** @type {?} */ duration = currentAnimateTimings.duration;\n var /** @type {?} */ innerContext = context.createSubContext();\n var /** @type {?} */ innerTimeline = innerContext.currentTimeline;\n innerTimeline.easing = currentAnimateTimings.easing;\n ast.styles.forEach(function (step) {\n var /** @type {?} */ offset = step.offset || 0;\n innerTimeline.forwardTime(offset * duration);\n innerTimeline.setStyles(step.styles, step.easing, context.errors, context.options);\n innerTimeline.applyStylesToKeyframe();\n });\n // this will ensure that the parent timeline gets all the styles from\n // the child even if the new timeline below is not used\n context.currentTimeline.mergeTimelineCollectedStyles(innerTimeline);\n // we do this because the window between this timeline and the sub timeline\n // should ensure that the styles within are exactly the same as they were before\n context.transformIntoNewTimeline(startTime + duration);\n context.previousNode = ast;\n };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n AnimationTimelineBuilderVisitor.prototype.visitQuery = function (ast, context) {\n var _this = this;\n // in the event that the first step before this is a style step we need\n // to ensure the styles are applied before the children are animated\n var /** @type {?} */ startTime = context.currentTimeline.currentTime;\n var /** @type {?} */ options = ((ast.options || {}));\n var /** @type {?} */ delay = options.delay ? resolveTimingValue(options.delay) : 0;\n if (delay && (context.previousNode.type === 6 /* Style */ ||\n (startTime == 0 && context.currentTimeline.getCurrentStyleProperties().length))) {\n context.currentTimeline.snapshotCurrentStyles();\n context.previousNode = DEFAULT_NOOP_PREVIOUS_NODE;\n }\n var /** @type {?} */ furthestTime = startTime;\n var /** @type {?} */ elms = context.invokeQuery(ast.selector, ast.originalSelector, ast.limit, ast.includeSelf, options.optional ? true : false, context.errors);\n context.currentQueryTotal = elms.length;\n var /** @type {?} */ sameElementTimeline = null;\n elms.forEach(function (element, i) {\n context.currentQueryIndex = i;\n var /** @type {?} */ innerContext = context.createSubContext(ast.options, element);\n if (delay) {\n innerContext.delayNextStep(delay);\n }\n if (element === context.element) {\n sameElementTimeline = innerContext.currentTimeline;\n }\n visitDslNode(_this, ast.animation, innerContext);\n // this is here just incase the inner steps only contain or end\n // with a style() call (which is here to signal that this is a preparatory\n // call to style an element before it is animated again)\n innerContext.currentTimeline.applyStylesToKeyframe();\n var /** @type {?} */ endTime = innerContext.currentTimeline.currentTime;\n furthestTime = Math.max(furthestTime, endTime);\n });\n context.currentQueryIndex = 0;\n context.currentQueryTotal = 0;\n context.transformIntoNewTimeline(furthestTime);\n if (sameElementTimeline) {\n context.currentTimeline.mergeTimelineCollectedStyles(sameElementTimeline);\n context.currentTimeline.snapshotCurrentStyles();\n }\n context.previousNode = ast;\n };\n /**\n * @param {?} ast\n * @param {?} context\n * @return {?}\n */\n AnimationTimelineBuilderVisitor.prototype.visitStagger = function (ast, context) {\n var /** @type {?} */ parentContext = ((context.parentContext));\n var /** @type {?} */ tl = context.currentTimeline;\n var /** @type {?} */ timings = ast.timings;\n var /** @type {?} */ duration = Math.abs(timings.duration);\n var /** @type {?} */ maxTime = duration * (context.currentQueryTotal - 1);\n var /** @type {?} */ delay = duration * context.currentQueryIndex;\n var /** @type {?} */ staggerTransformer = timings.duration < 0 ? 'reverse' : timings.easing;\n switch (staggerTransformer) {\n case 'reverse':\n delay = maxTime - delay;\n break;\n case 'full':\n delay = parentContext.currentStaggerTime;\n break;\n }\n var /** @type {?} */ timeline = context.currentTimeline;\n if (delay) {\n timeline.delayNextStep(delay);\n }\n var /** @type {?} */ startingTime = timeline.currentTime;\n visitDslNode(this, ast.animation, context);\n context.previousNode = ast;\n // time = duration + delay\n // the reason why this computation is so complex is because\n // the inner timeline may either have a delay value or a stretched\n // keyframe depending on if a subtimeline is not used or is used.\n parentContext.currentStaggerTime =\n (tl.currentTime - startingTime) + (tl.startTime - parentContext.currentTimeline.startTime);\n };\n return AnimationTimelineBuilderVisitor;\n}());\nvar DEFAULT_NOOP_PREVIOUS_NODE = ({});\nvar AnimationTimelineContext = (function () {\n /**\n * @param {?} _driver\n * @param {?} element\n * @param {?} subInstructions\n * @param {?} errors\n * @param {?} timelines\n * @param {?=} initialTimeline\n */\n function AnimationTimelineContext(_driver, element, subInstructions, errors, timelines, initialTimeline) {\n this._driver = _driver;\n this.element = element;\n this.subInstructions = subInstructions;\n this.errors = errors;\n this.timelines = timelines;\n this.parentContext = null;\n this.currentAnimateTimings = null;\n this.previousNode = DEFAULT_NOOP_PREVIOUS_NODE;\n this.subContextCount = 0;\n this.options = {};\n this.currentQueryIndex = 0;\n this.currentQueryTotal = 0;\n this.currentStaggerTime = 0;\n this.currentTimeline = initialTimeline || new TimelineBuilder(element, 0);\n timelines.push(this.currentTimeline);\n }\n Object.defineProperty(AnimationTimelineContext.prototype, \"params\", {\n /**\n * @return {?}\n */\n get: function () { return this.options.params; },\n enumerable: true,\n configurable: true\n });\n /**\n * @param {?} options\n * @param {?=} skipIfExists\n * @return {?}\n */\n AnimationTimelineContext.prototype.updateOptions = function (options, skipIfExists) {\n var _this = this;\n if (!options)\n return;\n var /** @type {?} */ newOptions = (options);\n var /** @type {?} */ optionsToUpdate = this.options;\n // NOTE: this will get patched up when other animation methods support duration overrides\n if (newOptions.duration != null) {\n ((optionsToUpdate)).duration = resolveTimingValue(newOptions.duration);\n }\n if (newOptions.delay != null) {\n optionsToUpdate.delay = resolveTimingValue(newOptions.delay);\n }\n var /** @type {?} */ newParams = newOptions.params;\n if (newParams) {\n var /** @type {?} */ paramsToUpdate_1 = ((optionsToUpdate.params));\n if (!paramsToUpdate_1) {\n paramsToUpdate_1 = this.options.params = {};\n }\n Object.keys(newParams).forEach(function (name) {\n if (!skipIfExists || !paramsToUpdate_1.hasOwnProperty(name)) {\n paramsToUpdate_1[name] = interpolateParams(newParams[name], paramsToUpdate_1, _this.errors);\n }\n });\n }\n };\n /**\n * @return {?}\n */\n AnimationTimelineContext.prototype._copyOptions = function () {\n var /** @type {?} */ options = {};\n if (this.options) {\n var /** @type {?} */ oldParams_1 = this.options.params;\n if (oldParams_1) {\n var /** @type {?} */ params_2 = options['params'] = {};\n Object.keys(oldParams_1).forEach(function (name) { params_2[name] = oldParams_1[name]; });\n }\n }\n return options;\n };\n /**\n * @param {?=} options\n * @param {?=} element\n * @param {?=} newTime\n * @return {?}\n */\n AnimationTimelineContext.prototype.createSubContext = function (options, element, newTime) {\n if (options === void 0) { options = null; }\n var /** @type {?} */ target = element || this.element;\n var /** @type {?} */ context = new AnimationTimelineContext(this._driver, target, this.subInstructions, this.errors, this.timelines, this.currentTimeline.fork(target, newTime || 0));\n context.previousNode = this.previousNode;\n context.currentAnimateTimings = this.currentAnimateTimings;\n context.options = this._copyOptions();\n context.updateOptions(options);\n context.currentQueryIndex = this.currentQueryIndex;\n context.currentQueryTotal = this.currentQueryTotal;\n context.parentContext = this;\n this.subContextCount++;\n return context;\n };\n /**\n * @param {?=} newTime\n * @return {?}\n */\n AnimationTimelineContext.prototype.transformIntoNewTimeline = function (newTime) {\n this.previousNode = DEFAULT_NOOP_PREVIOUS_NODE;\n this.currentTimeline = this.currentTimeline.fork(this.element, newTime);\n this.timelines.push(this.currentTimeline);\n return this.currentTimeline;\n };\n /**\n * @param {?} instruction\n * @param {?} duration\n * @param {?} delay\n * @return {?}\n */\n AnimationTimelineContext.prototype.appendInstructionToTimeline = function (instruction, duration, delay) {\n var /** @type {?} */ updatedTimings = {\n duration: duration != null ? duration : instruction.duration,\n delay: this.currentTimeline.currentTime + (delay != null ? delay : 0) + instruction.delay,\n easing: ''\n };\n var /** @type {?} */ builder = new SubTimelineBuilder(instruction.element, instruction.keyframes, instruction.preStyleProps, instruction.postStyleProps, updatedTimings, instruction.stretchStartingKeyframe);\n this.timelines.push(builder);\n return updatedTimings;\n };\n /**\n * @param {?} time\n * @return {?}\n */\n AnimationTimelineContext.prototype.incrementTime = function (time) {\n this.currentTimeline.forwardTime(this.currentTimeline.duration + time);\n };\n /**\n * @param {?} delay\n * @return {?}\n */\n AnimationTimelineContext.prototype.delayNextStep = function (delay) {\n // negative delays are not yet supported\n if (delay > 0) {\n this.currentTimeline.delayNextStep(delay);\n }\n };\n /**\n * @param {?} selector\n * @param {?} originalSelector\n * @param {?} limit\n * @param {?} includeSelf\n * @param {?} optional\n * @param {?} errors\n * @return {?}\n */\n AnimationTimelineContext.prototype.invokeQuery = function (selector, originalSelector, limit, includeSelf, optional, errors) {\n var /** @type {?} */ results = [];\n if (includeSelf) {\n results.push(this.element);\n }\n if (selector.length > 0) {\n var /** @type {?} */ multi = limit != 1;\n var /** @type {?} */ elements = this._driver.query(this.element, selector, multi);\n if (limit !== 0) {\n elements = elements.slice(0, limit);\n }\n results.push.apply(results, elements);\n }\n if (!optional && results.length == 0) {\n errors.push(\"`query(\\\"\" + originalSelector + \"\\\")` returned zero elements. (Use `query(\\\"\" + originalSelector + \"\\\", { optional: true })` if you wish to allow this.)\");\n }\n return results;\n };\n return AnimationTimelineContext;\n}());\nvar TimelineBuilder = (function () {\n /**\n * @param {?} element\n * @param {?} startTime\n * @param {?=} _elementTimelineStylesLookup\n */\n function TimelineBuilder(element, startTime, _elementTimelineStylesLookup) {\n this.element = element;\n this.startTime = startTime;\n this._elementTimelineStylesLookup = _elementTimelineStylesLookup;\n this.duration = 0;\n this._previousKeyframe = {};\n this._currentKeyframe = {};\n this._keyframes = new Map();\n this._styleSummary = {};\n this._pendingStyles = {};\n this._backFill = {};\n this._currentEmptyStepKeyframe = null;\n if (!this._elementTimelineStylesLookup) {\n this._elementTimelineStylesLookup = new Map();\n }\n this._localTimelineStyles = Object.create(this._backFill, {});\n this._globalTimelineStyles = this._elementTimelineStylesLookup.get(element);\n if (!this._globalTimelineStyles) {\n this._globalTimelineStyles = this._localTimelineStyles;\n this._elementTimelineStylesLookup.set(element, this._localTimelineStyles);\n }\n this._loadKeyframe();\n }\n /**\n * @return {?}\n */\n TimelineBuilder.prototype.containsAnimation = function () {\n switch (this._keyframes.size) {\n case 0:\n return false;\n case 1:\n return this.getCurrentStyleProperties().length > 0;\n default:\n return true;\n }\n };\n /**\n * @return {?}\n */\n TimelineBuilder.prototype.getCurrentStyleProperties = function () { return Object.keys(this._currentKeyframe); };\n Object.defineProperty(TimelineBuilder.prototype, \"currentTime\", {\n /**\n * @return {?}\n */\n get: function () { return this.startTime + this.duration; },\n enumerable: true,\n configurable: true\n });\n /**\n * @param {?} delay\n * @return {?}\n */\n TimelineBuilder.prototype.delayNextStep = function (delay) {\n // in the event that a style() step is placed right before a stagger()\n // and that style() step is the very first style() value in the animation\n // then we need to make a copy of the keyframe [0, copy, 1] so that the delay\n // properly applies the style() values to work with the stagger...\n var /** @type {?} */ hasPreStyleStep = this._keyframes.size == 1 && Object.keys(this._pendingStyles).length;\n if (this.duration || hasPreStyleStep) {\n this.forwardTime(this.currentTime + delay);\n if (hasPreStyleStep) {\n this.snapshotCurrentStyles();\n }\n }\n else {\n this.startTime += delay;\n }\n };\n /**\n * @param {?} element\n * @param {?=} currentTime\n * @return {?}\n */\n TimelineBuilder.prototype.fork = function (element, currentTime) {\n this.applyStylesToKeyframe();\n return new TimelineBuilder(element, currentTime || this.currentTime, this._elementTimelineStylesLookup);\n };\n /**\n * @return {?}\n */\n TimelineBuilder.prototype._loadKeyframe = function () {\n if (this._currentKeyframe) {\n this._previousKeyframe = this._currentKeyframe;\n }\n this._currentKeyframe = ((this._keyframes.get(this.duration)));\n if (!this._currentKeyframe) {\n this._currentKeyframe = Object.create(this._backFill, {});\n this._keyframes.set(this.duration, this._currentKeyframe);\n }\n };\n /**\n * @return {?}\n */\n TimelineBuilder.prototype.forwardFrame = function () {\n this.duration += ONE_FRAME_IN_MILLISECONDS;\n this._loadKeyframe();\n };\n /**\n * @param {?} time\n * @return {?}\n */\n TimelineBuilder.prototype.forwardTime = function (time) {\n this.applyStylesToKeyframe();\n this.duration = time;\n this._loadKeyframe();\n };\n /**\n * @param {?} prop\n * @param {?} value\n * @return {?}\n */\n TimelineBuilder.prototype._updateStyle = function (prop, value) {\n this._localTimelineStyles[prop] = value;\n this._globalTimelineStyles[prop] = value;\n this._styleSummary[prop] = { time: this.currentTime, value: value };\n };\n /**\n * @return {?}\n */\n TimelineBuilder.prototype.allowOnlyTimelineStyles = function () { return this._currentEmptyStepKeyframe !== this._currentKeyframe; };\n /**\n * @param {?} easing\n * @return {?}\n */\n TimelineBuilder.prototype.applyEmptyStep = function (easing) {\n var _this = this;\n if (easing) {\n this._previousKeyframe['easing'] = easing;\n }\n // special case for animate(duration):\n // all missing styles are filled with a `*` value then\n // if any destination styles are filled in later on the same\n // keyframe then they will override the overridden styles\n // We use `_globalTimelineStyles` here because there may be\n // styles in previous keyframes that are not present in this timeline\n Object.keys(this._globalTimelineStyles).forEach(function (prop) {\n _this._backFill[prop] = _this._globalTimelineStyles[prop] || AUTO_STYLE;\n _this._currentKeyframe[prop] = AUTO_STYLE;\n });\n this._currentEmptyStepKeyframe = this._currentKeyframe;\n };\n /**\n * @param {?} input\n * @param {?} easing\n * @param {?} errors\n * @param {?=} options\n * @return {?}\n */\n TimelineBuilder.prototype.setStyles = function (input, easing, errors, options) {\n var _this = this;\n if (easing) {\n this._previousKeyframe['easing'] = easing;\n }\n var /** @type {?} */ params = (options && options.params) || {};\n var /** @type {?} */ styles = flattenStyles(input, this._globalTimelineStyles);\n Object.keys(styles).forEach(function (prop) {\n var /** @type {?} */ val = interpolateParams(styles[prop], params, errors);\n _this._pendingStyles[prop] = val;\n if (!_this._localTimelineStyles.hasOwnProperty(prop)) {\n _this._backFill[prop] = _this._globalTimelineStyles.hasOwnProperty(prop) ?\n _this._globalTimelineStyles[prop] :\n AUTO_STYLE;\n }\n _this._updateStyle(prop, val);\n });\n };\n /**\n * @return {?}\n */\n TimelineBuilder.prototype.applyStylesToKeyframe = function () {\n var _this = this;\n var /** @type {?} */ styles = this._pendingStyles;\n var /** @type {?} */ props = Object.keys(styles);\n if (props.length == 0)\n return;\n this._pendingStyles = {};\n props.forEach(function (prop) {\n var /** @type {?} */ val = styles[prop];\n _this._currentKeyframe[prop] = val;\n });\n Object.keys(this._localTimelineStyles).forEach(function (prop) {\n if (!_this._currentKeyframe.hasOwnProperty(prop)) {\n _this._currentKeyframe[prop] = _this._localTimelineStyles[prop];\n }\n });\n };\n /**\n * @return {?}\n */\n TimelineBuilder.prototype.snapshotCurrentStyles = function () {\n var _this = this;\n Object.keys(this._localTimelineStyles).forEach(function (prop) {\n var /** @type {?} */ val = _this._localTimelineStyles[prop];\n _this._pendingStyles[prop] = val;\n _this._updateStyle(prop, val);\n });\n };\n /**\n * @return {?}\n */\n TimelineBuilder.prototype.getFinalKeyframe = function () { return this._keyframes.get(this.duration); };\n Object.defineProperty(TimelineBuilder.prototype, \"properties\", {\n /**\n * @return {?}\n */\n get: function () {\n var /** @type {?} */ properties = [];\n for (var /** @type {?} */ prop in this._currentKeyframe) {\n properties.push(prop);\n }\n return properties;\n },\n enumerable: true,\n configurable: true\n });\n /**\n * @param {?} timeline\n * @return {?}\n */\n TimelineBuilder.prototype.mergeTimelineCollectedStyles = function (timeline) {\n var _this = this;\n Object.keys(timeline._styleSummary).forEach(function (prop) {\n var /** @type {?} */ details0 = _this._styleSummary[prop];\n var /** @type {?} */ details1 = timeline._styleSummary[prop];\n if (!details0 || details1.time > details0.time) {\n _this._updateStyle(prop, details1.value);\n }\n });\n };\n /**\n * @return {?}\n */\n TimelineBuilder.prototype.buildKeyframes = function () {\n var _this = this;\n this.applyStylesToKeyframe();\n var /** @type {?} */ preStyleProps = new Set();\n var /** @type {?} */ postStyleProps = new Set();\n var /** @type {?} */ isEmpty = this._keyframes.size === 1 && this.duration === 0;\n var /** @type {?} */ finalKeyframes = [];\n this._keyframes.forEach(function (keyframe, time) {\n var /** @type {?} */ finalKeyframe = copyStyles(keyframe, true);\n Object.keys(finalKeyframe).forEach(function (prop) {\n var /** @type {?} */ value = finalKeyframe[prop];\n if (value == ɵPRE_STYLE) {\n preStyleProps.add(prop);\n }\n else if (value == AUTO_STYLE) {\n postStyleProps.add(prop);\n }\n });\n if (!isEmpty) {\n finalKeyframe['offset'] = time / _this.duration;\n }\n finalKeyframes.push(finalKeyframe);\n });\n var /** @type {?} */ preProps = preStyleProps.size ? iteratorToArray(preStyleProps.values()) : [];\n var /** @type {?} */ postProps = postStyleProps.size ? iteratorToArray(postStyleProps.values()) : [];\n // special case for a 0-second animation (which is designed just to place styles onscreen)\n if (isEmpty) {\n var /** @type {?} */ kf0 = finalKeyframes[0];\n var /** @type {?} */ kf1 = copyObj(kf0);\n kf0['offset'] = 0;\n kf1['offset'] = 1;\n finalKeyframes = [kf0, kf1];\n }\n return createTimelineInstruction(this.element, finalKeyframes, preProps, postProps, this.duration, this.startTime, this.easing, false);\n };\n return TimelineBuilder;\n}());\nvar SubTimelineBuilder = (function (_super) {\n tslib_1.__extends(SubTimelineBuilder, _super);\n /**\n * @param {?} element\n * @param {?} keyframes\n * @param {?} preStyleProps\n * @param {?} postStyleProps\n * @param {?} timings\n * @param {?=} _stretchStartingKeyframe\n */\n function SubTimelineBuilder(element, keyframes, preStyleProps, postStyleProps, timings, _stretchStartingKeyframe) {\n if (_stretchStartingKeyframe === void 0) { _stretchStartingKeyframe = false; }\n var _this = _super.call(this, element, timings.delay) || this;\n _this.element = element;\n _this.keyframes = keyframes;\n _this.preStyleProps = preStyleProps;\n _this.postStyleProps = postStyleProps;\n _this._stretchStartingKeyframe = _stretchStartingKeyframe;\n _this.timings = { duration: timings.duration, delay: timings.delay, easing: timings.easing };\n return _this;\n }\n /**\n * @return {?}\n */\n SubTimelineBuilder.prototype.containsAnimation = function () { return this.keyframes.length > 1; };\n /**\n * @return {?}\n */\n SubTimelineBuilder.prototype.buildKeyframes = function () {\n var /** @type {?} */ keyframes = this.keyframes;\n var _a = this.timings, delay = _a.delay, duration = _a.duration, easing = _a.easing;\n if (this._stretchStartingKeyframe && delay) {\n var /** @type {?} */ newKeyframes = [];\n var /** @type {?} */ totalTime = duration + delay;\n var /** @type {?} */ startingGap = delay / totalTime;\n // the original starting keyframe now starts once the delay is done\n var /** @type {?} */ newFirstKeyframe = copyStyles(keyframes[0], false);\n newFirstKeyframe['offset'] = 0;\n newKeyframes.push(newFirstKeyframe);\n var /** @type {?} */ oldFirstKeyframe = copyStyles(keyframes[0], false);\n oldFirstKeyframe['offset'] = roundOffset(startingGap);\n newKeyframes.push(oldFirstKeyframe);\n /*\n When the keyframe is stretched then it means that the delay before the animation\n starts is gone. Instead the first keyframe is placed at the start of the animation\n and it is then copied to where it starts when the original delay is over. This basically\n means nothing animates during that delay, but the styles are still renderered. For this\n to work the original offset values that exist in the original keyframes must be \"warped\"\n so that they can take the new keyframe + delay into account.\n \n delay=1000, duration=1000, keyframes = 0 .5 1\n \n turns into\n \n delay=0, duration=2000, keyframes = 0 .33 .66 1\n */\n // offsets between 1 ... n -1 are all warped by the keyframe stretch\n var /** @type {?} */ limit = keyframes.length - 1;\n for (var /** @type {?} */ i = 1; i <= limit; i++) {\n var /** @type {?} */ kf = copyStyles(keyframes[i], false);\n var /** @type {?} */ oldOffset = (kf['offset']);\n var /** @type {?} */ timeAtKeyframe = delay + oldOffset * duration;\n kf['offset'] = roundOffset(timeAtKeyframe / totalTime);\n newKeyframes.push(kf);\n }\n // the new starting keyframe should be added at the start\n duration = totalTime;\n delay = 0;\n easing = '';\n keyframes = newKeyframes;\n }\n return createTimelineInstruction(this.element, keyframes, this.preStyleProps, this.postStyleProps, duration, delay, easing, true);\n };\n return SubTimelineBuilder;\n}(TimelineBuilder));\n/**\n * @param {?} offset\n * @param {?=} decimalPoints\n * @return {?}\n */\nfunction roundOffset(offset, decimalPoints) {\n if (decimalPoints === void 0) { decimalPoints = 3; }\n var /** @type {?} */ mult = Math.pow(10, decimalPoints - 1);\n return Math.round(offset * mult) / mult;\n}\n/**\n * @param {?} input\n * @param {?} allStyles\n * @return {?}\n */\nfunction flattenStyles(input, allStyles) {\n var /** @type {?} */ styles = {};\n var /** @type {?} */ allProperties;\n input.forEach(function (token) {\n if (token === '*') {\n allProperties = allProperties || Object.keys(allStyles);\n allProperties.forEach(function (prop) { styles[prop] = AUTO_STYLE; });\n }\n else {\n copyStyles(/** @type {?} */ (token), false, styles);\n }\n });\n return styles;\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 */\nvar Animation = (function () {\n /**\n * @param {?} _driver\n * @param {?} input\n */\n function Animation(_driver, input) {\n this._driver = _driver;\n var errors = [];\n var ast = buildAnimationAst(input, errors);\n if (errors.length) {\n var errorMessage = \"animation validation failed:\\n\" + errors.join(\"\\n\");\n throw new Error(errorMessage);\n }\n this._animationAst = ast;\n }\n /**\n * @param {?} element\n * @param {?} startingStyles\n * @param {?} destinationStyles\n * @param {?} options\n * @param {?=} subInstructions\n * @return {?}\n */\n Animation.prototype.buildTimelines = function (element, startingStyles, destinationStyles, options, subInstructions) {\n var /** @type {?} */ start = Array.isArray(startingStyles) ? normalizeStyles(startingStyles) : (startingStyles);\n var /** @type {?} */ dest = Array.isArray(destinationStyles) ? normalizeStyles(destinationStyles) : (destinationStyles);\n var /** @type {?} */ errors = [];\n subInstructions = subInstructions || new ElementInstructionMap();\n var /** @type {?} */ result = buildAnimationTimelines(this._driver, element, this._animationAst, start, dest, options, subInstructions, errors);\n if (errors.length) {\n var /** @type {?} */ errorMessage = \"animation building failed:\\n\" + errors.join(\"\\n\");\n throw new Error(errorMessage);\n }\n return result;\n };\n return Animation;\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/**\n * @experimental Animation support is experimental.\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 */ var AnimationStyleNormalizer = (function () {\n function AnimationStyleNormalizer() {\n }\n return AnimationStyleNormalizer;\n}());\n/**\n * @experimental Animation support is experimental.\n */\nvar NoopAnimationStyleNormalizer = (function () {\n function NoopAnimationStyleNormalizer() {\n }\n NoopAnimationStyleNormalizer.prototype.normalizePropertyName = function (propertyName, errors) { return propertyName; };\n NoopAnimationStyleNormalizer.prototype.normalizeStyleValue = function (userProvidedProperty, normalizedProperty, value, errors) {\n return value;\n };\n return NoopAnimationStyleNormalizer;\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 */\nvar WebAnimationsStyleNormalizer = (function (_super) {\n tslib_1.__extends(WebAnimationsStyleNormalizer, _super);\n function WebAnimationsStyleNormalizer() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * @param {?} propertyName\n * @param {?} errors\n * @return {?}\n */\n WebAnimationsStyleNormalizer.prototype.normalizePropertyName = function (propertyName, errors) {\n return dashCaseToCamelCase(propertyName);\n };\n /**\n * @param {?} userProvidedProperty\n * @param {?} normalizedProperty\n * @param {?} value\n * @param {?} errors\n * @return {?}\n */\n WebAnimationsStyleNormalizer.prototype.normalizeStyleValue = function (userProvidedProperty, normalizedProperty, value, errors) {\n var /** @type {?} */ unit = '';\n var /** @type {?} */ strVal = value.toString().trim();\n if (DIMENSIONAL_PROP_MAP[normalizedProperty] && value !== 0 && value !== '0') {\n if (typeof value === 'number') {\n unit = 'px';\n }\n else {\n var /** @type {?} */ valAndSuffixMatch = value.match(/^[+-]?[\\d\\.]+([a-z]*)$/);\n if (valAndSuffixMatch && valAndSuffixMatch[1].length == 0) {\n errors.push(\"Please provide a CSS unit value for \" + userProvidedProperty + \":\" + value);\n }\n }\n }\n return strVal + unit;\n };\n return WebAnimationsStyleNormalizer;\n}(AnimationStyleNormalizer));\nvar DIMENSIONAL_PROP_MAP = makeBooleanMap('width,height,minWidth,minHeight,maxWidth,maxHeight,left,top,bottom,right,fontSize,outlineWidth,outlineOffset,paddingTop,paddingLeft,paddingBottom,paddingRight,marginTop,marginLeft,marginBottom,marginRight,borderRadius,borderWidth,borderTopWidth,borderLeftWidth,borderRightWidth,borderBottomWidth,textIndent,perspective'\n .split(','));\n/**\n * @param {?} keys\n * @return {?}\n */\nfunction makeBooleanMap(keys) {\n var /** @type {?} */ map = {};\n keys.forEach(function (key) { return map[key] = true; });\n return map;\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/**\n * @param {?} element\n * @param {?} triggerName\n * @param {?} fromState\n * @param {?} toState\n * @param {?} isRemovalTransition\n * @param {?} fromStyles\n * @param {?} toStyles\n * @param {?} timelines\n * @param {?} queriedElements\n * @param {?} preStyleProps\n * @param {?} postStyleProps\n * @param {?=} errors\n * @return {?}\n */\nfunction createTransitionInstruction(element, triggerName, fromState, toState, isRemovalTransition, fromStyles, toStyles, timelines, queriedElements, preStyleProps, postStyleProps, errors) {\n return {\n type: 0 /* TransitionAnimation */,\n element: element,\n triggerName: triggerName,\n isRemovalTransition: isRemovalTransition,\n fromState: fromState,\n fromStyles: fromStyles,\n toState: toState,\n toStyles: toStyles,\n timelines: timelines,\n queriedElements: queriedElements,\n preStyleProps: preStyleProps,\n postStyleProps: postStyleProps,\n errors: errors\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 */\nvar EMPTY_OBJECT = {};\nvar AnimationTransitionFactory = (function () {\n /**\n * @param {?} _triggerName\n * @param {?} ast\n * @param {?} _stateStyles\n */\n function AnimationTransitionFactory(_triggerName, ast, _stateStyles) {\n this._triggerName = _triggerName;\n this.ast = ast;\n this._stateStyles = _stateStyles;\n }\n /**\n * @param {?} currentState\n * @param {?} nextState\n * @return {?}\n */\n AnimationTransitionFactory.prototype.match = function (currentState, nextState) {\n return oneOrMoreTransitionsMatch(this.ast.matchers, currentState, nextState);\n };\n /**\n * @param {?} stateName\n * @param {?} params\n * @param {?} errors\n * @return {?}\n */\n AnimationTransitionFactory.prototype.buildStyles = function (stateName, params, errors) {\n var /** @type {?} */ backupStateStyler = this._stateStyles['*'];\n var /** @type {?} */ stateStyler = this._stateStyles[stateName];\n var /** @type {?} */ backupStyles = backupStateStyler ? backupStateStyler.buildStyles(params, errors) : {};\n return stateStyler ? stateStyler.buildStyles(params, errors) : backupStyles;\n };\n /**\n * @param {?} driver\n * @param {?} element\n * @param {?} currentState\n * @param {?} nextState\n * @param {?=} currentOptions\n * @param {?=} nextOptions\n * @param {?=} subInstructions\n * @return {?}\n */\n AnimationTransitionFactory.prototype.build = function (driver, element, currentState, nextState, currentOptions, nextOptions, subInstructions) {\n var /** @type {?} */ errors = [];\n var /** @type {?} */ transitionAnimationParams = this.ast.options && this.ast.options.params || EMPTY_OBJECT;\n var /** @type {?} */ currentAnimationParams = currentOptions && currentOptions.params || EMPTY_OBJECT;\n var /** @type {?} */ currentStateStyles = this.buildStyles(currentState, currentAnimationParams, errors);\n var /** @type {?} */ nextAnimationParams = nextOptions && nextOptions.params || EMPTY_OBJECT;\n var /** @type {?} */ nextStateStyles = this.buildStyles(nextState, nextAnimationParams, errors);\n var /** @type {?} */ queriedElements = new Set();\n var /** @type {?} */ preStyleMap = new Map();\n var /** @type {?} */ postStyleMap = new Map();\n var /** @type {?} */ isRemoval = nextState === 'void';\n var /** @type {?} */ animationOptions = { params: Object.assign({}, transitionAnimationParams, nextAnimationParams) };\n var /** @type {?} */ timelines = buildAnimationTimelines(driver, element, this.ast.animation, currentStateStyles, nextStateStyles, animationOptions, subInstructions, errors);\n if (errors.length) {\n return createTransitionInstruction(element, this._triggerName, currentState, nextState, isRemoval, currentStateStyles, nextStateStyles, [], [], preStyleMap, postStyleMap, errors);\n }\n timelines.forEach(function (tl) {\n var /** @type {?} */ elm = tl.element;\n var /** @type {?} */ preProps = getOrSetAsInMap(preStyleMap, elm, {});\n tl.preStyleProps.forEach(function (prop) { return preProps[prop] = true; });\n var /** @type {?} */ postProps = getOrSetAsInMap(postStyleMap, elm, {});\n tl.postStyleProps.forEach(function (prop) { return postProps[prop] = true; });\n if (elm !== element) {\n queriedElements.add(elm);\n }\n });\n var /** @type {?} */ queriedElementsList = iteratorToArray(queriedElements.values());\n return createTransitionInstruction(element, this._triggerName, currentState, nextState, isRemoval, currentStateStyles, nextStateStyles, timelines, queriedElementsList, preStyleMap, postStyleMap);\n };\n return AnimationTransitionFactory;\n}());\n/**\n * @param {?} matchFns\n * @param {?} currentState\n * @param {?} nextState\n * @return {?}\n */\nfunction oneOrMoreTransitionsMatch(matchFns, currentState, nextState) {\n return matchFns.some(function (fn) { return fn(currentState, nextState); });\n}\nvar AnimationStateStyles = (function () {\n /**\n * @param {?} styles\n * @param {?} defaultParams\n */\n function AnimationStateStyles(styles, defaultParams) {\n this.styles = styles;\n this.defaultParams = defaultParams;\n }\n /**\n * @param {?} params\n * @param {?} errors\n * @return {?}\n */\n AnimationStateStyles.prototype.buildStyles = function (params, errors) {\n var /** @type {?} */ finalStyles = {};\n var /** @type {?} */ combinedParams = copyObj(this.defaultParams);\n Object.keys(params).forEach(function (key) {\n var /** @type {?} */ value = params[key];\n if (value != null) {\n combinedParams[key] = value;\n }\n });\n this.styles.styles.forEach(function (value) {\n if (typeof value !== 'string') {\n var /** @type {?} */ styleObj_1 = (value);\n Object.keys(styleObj_1).forEach(function (prop) {\n var /** @type {?} */ val = styleObj_1[prop];\n if (val.length > 1) {\n val = interpolateParams(val, combinedParams, errors);\n }\n finalStyles[prop] = val;\n });\n }\n });\n return finalStyles;\n };\n return AnimationStateStyles;\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/**\n * \\@experimental Animation support is experimental.\n * @param {?} name\n * @param {?} ast\n * @return {?}\n */\nfunction buildTrigger(name, ast) {\n return new AnimationTrigger(name, ast);\n}\n/**\n * \\@experimental Animation support is experimental.\n */\nvar AnimationTrigger = (function () {\n /**\n * @param {?} name\n * @param {?} ast\n */\n function AnimationTrigger(name, ast) {\n var _this = this;\n this.name = name;\n this.ast = ast;\n this.transitionFactories = [];\n this.states = {};\n ast.states.forEach(function (ast) {\n var defaultParams = (ast.options && ast.options.params) || {};\n _this.states[ast.name] = new AnimationStateStyles(ast.style, defaultParams);\n });\n balanceProperties(this.states, 'true', '1');\n balanceProperties(this.states, 'false', '0');\n ast.transitions.forEach(function (ast) {\n _this.transitionFactories.push(new AnimationTransitionFactory(name, ast, _this.states));\n });\n this.fallbackTransition = createFallbackTransition(name, this.states);\n }\n Object.defineProperty(AnimationTrigger.prototype, \"containsQueries\", {\n /**\n * @return {?}\n */\n get: function () { return this.ast.queryCount > 0; },\n enumerable: true,\n configurable: true\n });\n /**\n * @param {?} currentState\n * @param {?} nextState\n * @return {?}\n */\n AnimationTrigger.prototype.matchTransition = function (currentState, nextState) {\n var /** @type {?} */ entry = this.transitionFactories.find(function (f) { return f.match(currentState, nextState); });\n return entry || null;\n };\n /**\n * @param {?} currentState\n * @param {?} params\n * @param {?} errors\n * @return {?}\n */\n AnimationTrigger.prototype.matchStyles = function (currentState, params, errors) {\n return this.fallbackTransition.buildStyles(currentState, params, errors);\n };\n return AnimationTrigger;\n}());\n/**\n * @param {?} triggerName\n * @param {?} states\n * @return {?}\n */\nfunction createFallbackTransition(triggerName, states) {\n var /** @type {?} */ matchers = [function (fromState, toState) { return true; }];\n var /** @type {?} */ animation = { type: 2 /* Sequence */, steps: [], options: null };\n var /** @type {?} */ transition = {\n type: 1 /* Transition */,\n animation: animation,\n matchers: matchers,\n options: null,\n queryCount: 0,\n depCount: 0\n };\n return new AnimationTransitionFactory(triggerName, transition, states);\n}\n/**\n * @param {?} obj\n * @param {?} key1\n * @param {?} key2\n * @return {?}\n */\nfunction balanceProperties(obj, key1, key2) {\n if (obj.hasOwnProperty(key1)) {\n if (!obj.hasOwnProperty(key2)) {\n obj[key2] = obj[key1];\n }\n }\n else if (obj.hasOwnProperty(key2)) {\n obj[key1] = obj[key2];\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 */\nvar EMPTY_INSTRUCTION_MAP = new ElementInstructionMap();\nvar TimelineAnimationEngine = (function () {\n /**\n * @param {?} _driver\n * @param {?} _normalizer\n */\n function TimelineAnimationEngine(_driver, _normalizer) {\n this._driver = _driver;\n this._normalizer = _normalizer;\n this._animations = {};\n this._playersById = {};\n this.players = [];\n }\n /**\n * @param {?} id\n * @param {?} metadata\n * @return {?}\n */\n TimelineAnimationEngine.prototype.register = function (id, metadata) {\n var /** @type {?} */ errors = [];\n var /** @type {?} */ ast = buildAnimationAst(metadata, errors);\n if (errors.length) {\n throw new Error(\"Unable to build the animation due to the following errors: \" + errors.join(\"\\n\"));\n }\n else {\n this._animations[id] = ast;\n }\n };\n /**\n * @param {?} i\n * @param {?} preStyles\n * @param {?=} postStyles\n * @return {?}\n */\n TimelineAnimationEngine.prototype._buildPlayer = function (i, preStyles, postStyles) {\n var /** @type {?} */ element = i.element;\n var /** @type {?} */ keyframes = normalizeKeyframes(this._driver, this._normalizer, element, i.keyframes, preStyles, postStyles);\n return this._driver.animate(element, keyframes, i.duration, i.delay, i.easing, []);\n };\n /**\n * @param {?} id\n * @param {?} element\n * @param {?=} options\n * @return {?}\n */\n TimelineAnimationEngine.prototype.create = function (id, element, options) {\n var _this = this;\n if (options === void 0) { options = {}; }\n var /** @type {?} */ errors = [];\n var /** @type {?} */ ast = this._animations[id];\n var /** @type {?} */ instructions;\n var /** @type {?} */ autoStylesMap = new Map();\n if (ast) {\n instructions = buildAnimationTimelines(this._driver, element, ast, {}, {}, options, EMPTY_INSTRUCTION_MAP, errors);\n instructions.forEach(function (inst) {\n var /** @type {?} */ styles = getOrSetAsInMap(autoStylesMap, inst.element, {});\n inst.postStyleProps.forEach(function (prop) { return styles[prop] = null; });\n });\n }\n else {\n errors.push('The requested animation doesn\\'t exist or has already been destroyed');\n instructions = [];\n }\n if (errors.length) {\n throw new Error(\"Unable to create the animation due to the following errors: \" + errors.join(\"\\n\"));\n }\n autoStylesMap.forEach(function (styles, element) {\n Object.keys(styles).forEach(function (prop) { styles[prop] = _this._driver.computeStyle(element, prop, AUTO_STYLE); });\n });\n var /** @type {?} */ players = instructions.map(function (i) {\n var /** @type {?} */ styles = autoStylesMap.get(i.element);\n return _this._buildPlayer(i, {}, styles);\n });\n var /** @type {?} */ player = optimizeGroupPlayer(players);\n this._playersById[id] = player;\n player.onDestroy(function () { return _this.destroy(id); });\n this.players.push(player);\n return player;\n };\n /**\n * @param {?} id\n * @return {?}\n */\n TimelineAnimationEngine.prototype.destroy = function (id) {\n var /** @type {?} */ player = this._getPlayer(id);\n player.destroy();\n delete this._playersById[id];\n var /** @type {?} */ index = this.players.indexOf(player);\n if (index >= 0) {\n this.players.splice(index, 1);\n }\n };\n /**\n * @param {?} id\n * @return {?}\n */\n TimelineAnimationEngine.prototype._getPlayer = function (id) {\n var /** @type {?} */ player = this._playersById[id];\n if (!player) {\n throw new Error(\"Unable to find the timeline player referenced by \" + id);\n }\n return player;\n };\n /**\n * @param {?} id\n * @param {?} element\n * @param {?} eventName\n * @param {?} callback\n * @return {?}\n */\n TimelineAnimationEngine.prototype.listen = function (id, element, eventName, callback) {\n // triggerName, fromState, toState are all ignored for timeline animations\n var /** @type {?} */ baseEvent = makeAnimationEvent(element, '', '', '');\n listenOnPlayer(this._getPlayer(id), eventName, baseEvent, callback);\n return function () { };\n };\n /**\n * @param {?} id\n * @param {?} element\n * @param {?} command\n * @param {?} args\n * @return {?}\n */\n TimelineAnimationEngine.prototype.command = function (id, element, command, args) {\n if (command == 'register') {\n this.register(id, /** @type {?} */ (args[0]));\n return;\n }\n if (command == 'create') {\n var /** @type {?} */ options = ((args[0] || {}));\n this.create(id, element, options);\n return;\n }\n var /** @type {?} */ player = this._getPlayer(id);\n switch (command) {\n case 'play':\n player.play();\n break;\n case 'pause':\n player.pause();\n break;\n case 'reset':\n player.reset();\n break;\n case 'restart':\n player.restart();\n break;\n case 'finish':\n player.finish();\n break;\n case 'init':\n player.init();\n break;\n case 'setPosition':\n player.setPosition(parseFloat(/** @type {?} */ (args[0])));\n break;\n case 'destroy':\n this.destroy(id);\n break;\n }\n };\n return TimelineAnimationEngine;\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 */\nvar QUEUED_CLASSNAME = 'ng-animate-queued';\nvar QUEUED_SELECTOR = '.ng-animate-queued';\nvar DISABLED_CLASSNAME = 'ng-animate-disabled';\nvar DISABLED_SELECTOR = '.ng-animate-disabled';\nvar EMPTY_PLAYER_ARRAY = [];\nvar NULL_REMOVAL_STATE = {\n namespaceId: '',\n setForRemoval: null,\n hasAnimation: false,\n removedBeforeQueried: false\n};\nvar NULL_REMOVED_QUERIED_STATE = {\n namespaceId: '',\n setForRemoval: null,\n hasAnimation: false,\n removedBeforeQueried: true\n};\nvar REMOVAL_FLAG = '__ng_removed';\nvar StateValue = (function () {\n /**\n * @param {?} input\n */\n function StateValue(input) {\n var isObj = input && input.hasOwnProperty('value');\n var value = isObj ? input['value'] : input;\n this.value = normalizeTriggerValue(value);\n if (isObj) {\n var options = copyObj(input);\n delete options['value'];\n this.options = options;\n }\n else {\n this.options = {};\n }\n if (!this.options.params) {\n this.options.params = {};\n }\n }\n Object.defineProperty(StateValue.prototype, \"params\", {\n /**\n * @return {?}\n */\n get: function () { return (this.options.params); },\n enumerable: true,\n configurable: true\n });\n /**\n * @param {?} options\n * @return {?}\n */\n StateValue.prototype.absorbOptions = function (options) {\n var /** @type {?} */ newParams = options.params;\n if (newParams) {\n var /** @type {?} */ oldParams_2 = ((this.options.params));\n Object.keys(newParams).forEach(function (prop) {\n if (oldParams_2[prop] == null) {\n oldParams_2[prop] = newParams[prop];\n }\n });\n }\n };\n return StateValue;\n}());\nvar VOID_VALUE = 'void';\nvar DEFAULT_STATE_VALUE = new StateValue(VOID_VALUE);\nvar DELETED_STATE_VALUE = new StateValue('DELETED');\nvar AnimationTransitionNamespace = (function () {\n /**\n * @param {?} id\n * @param {?} hostElement\n * @param {?} _engine\n */\n function AnimationTransitionNamespace(id, hostElement, _engine) {\n this.id = id;\n this.hostElement = hostElement;\n this._engine = _engine;\n this.players = [];\n this._triggers = {};\n this._queue = [];\n this._elementListeners = new Map();\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 */\n AnimationTransitionNamespace.prototype.listen = function (element, name, phase, callback) {\n var _this = this;\n if (!this._triggers.hasOwnProperty(name)) {\n throw new Error(\"Unable to listen on the animation trigger event \\\"\" + phase + \"\\\" because the animation trigger \\\"\" + name + \"\\\" doesn't exist!\");\n }\n if (phase == null || phase.length == 0) {\n throw new Error(\"Unable to listen on the animation trigger \\\"\" + name + \"\\\" because the provided event is undefined!\");\n }\n if (!isTriggerEventValid(phase)) {\n throw new Error(\"The provided animation trigger event \\\"\" + phase + \"\\\" for the animation trigger \\\"\" + name + \"\\\" is not supported!\");\n }\n var /** @type {?} */ listeners = getOrSetAsInMap(this._elementListeners, element, []);\n var /** @type {?} */ data = { name: name, phase: phase, callback: callback };\n listeners.push(data);\n var /** @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 return function () {\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(function () {\n var /** @type {?} */ index = listeners.indexOf(data);\n if (index >= 0) {\n listeners.splice(index, 1);\n }\n if (!_this._triggers[name]) {\n delete triggersWithStates[name];\n }\n });\n };\n };\n /**\n * @param {?} name\n * @param {?} ast\n * @return {?}\n */\n AnimationTransitionNamespace.prototype.register = function (name, ast) {\n if (this._triggers[name]) {\n // throw\n return false;\n }\n else {\n this._triggers[name] = ast;\n return true;\n }\n };\n /**\n * @param {?} name\n * @return {?}\n */\n AnimationTransitionNamespace.prototype._getTrigger = function (name) {\n var /** @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 */\n AnimationTransitionNamespace.prototype.trigger = function (element, triggerName, value, defaultToFallback) {\n var _this = this;\n if (defaultToFallback === void 0) { defaultToFallback = true; }\n var /** @type {?} */ trigger = this._getTrigger(triggerName);\n var /** @type {?} */ player = new TransitionAnimationPlayer(this.id, triggerName, element);\n var /** @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 var /** @type {?} */ fromState = triggersWithStates[triggerName];\n var /** @type {?} */ toState = new StateValue(value);\n var /** @type {?} */ isObj = value && value.hasOwnProperty('value');\n if (!isObj && fromState) {\n toState.absorbOptions(fromState.options);\n }\n triggersWithStates[triggerName] = toState;\n if (!fromState) {\n fromState = DEFAULT_STATE_VALUE;\n }\n else if (fromState === DELETED_STATE_VALUE) {\n return player;\n }\n var /** @type {?} */ isRemoval = toState.value === VOID_VALUE;\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 var /** @type {?} */ errors = [];\n var /** @type {?} */ fromStyles_1 = trigger.matchStyles(fromState.value, fromState.params, errors);\n var /** @type {?} */ toStyles_1 = trigger.matchStyles(toState.value, toState.params, errors);\n if (errors.length) {\n this._engine.reportError(errors);\n }\n else {\n this._engine.afterFlush(function () {\n eraseStyles(element, fromStyles_1);\n setStyles(element, toStyles_1);\n });\n }\n }\n return;\n }\n var /** @type {?} */ playersOnElement = getOrSetAsInMap(this._engine.playersByElement, element, []);\n playersOnElement.forEach(function (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 var /** @type {?} */ transition = trigger.matchTransition(fromState.value, toState.value);\n var /** @type {?} */ isFallbackTransition = false;\n if (!transition) {\n if (!defaultToFallback)\n return;\n transition = trigger.fallbackTransition;\n isFallbackTransition = true;\n }\n this._engine.totalQueuedPlayers++;\n this._queue.push({ element: element, triggerName: triggerName, transition: transition, fromState: fromState, toState: toState, player: player, isFallbackTransition: isFallbackTransition });\n if (!isFallbackTransition) {\n addClass(element, QUEUED_CLASSNAME);\n player.onStart(function () { removeClass(element, QUEUED_CLASSNAME); });\n }\n player.onDone(function () {\n var /** @type {?} */ index = _this.players.indexOf(player);\n if (index >= 0) {\n _this.players.splice(index, 1);\n }\n var /** @type {?} */ players = _this._engine.playersByElement.get(element);\n if (players) {\n var /** @type {?} */ index_1 = players.indexOf(player);\n if (index_1 >= 0) {\n players.splice(index_1, 1);\n }\n }\n });\n this.players.push(player);\n playersOnElement.push(player);\n return player;\n };\n /**\n * @param {?} name\n * @return {?}\n */\n AnimationTransitionNamespace.prototype.deregister = function (name) {\n var _this = this;\n delete this._triggers[name];\n this._engine.statesByElement.forEach(function (stateMap, element) { delete stateMap[name]; });\n this._elementListeners.forEach(function (listeners, element) {\n _this._elementListeners.set(element, listeners.filter(function (entry) { return entry.name != name; }));\n });\n };\n /**\n * @param {?} element\n * @return {?}\n */\n AnimationTransitionNamespace.prototype.clearElementCache = function (element) {\n this._engine.statesByElement.delete(element);\n this._elementListeners.delete(element);\n var /** @type {?} */ elementPlayers = this._engine.playersByElement.get(element);\n if (elementPlayers) {\n elementPlayers.forEach(function (player) { return player.destroy(); });\n this._engine.playersByElement.delete(element);\n }\n };\n /**\n * @param {?} rootElement\n * @param {?} context\n * @param {?=} animate\n * @return {?}\n */\n AnimationTransitionNamespace.prototype._destroyInnerNodes = function (rootElement, context, animate) {\n var _this = this;\n if (animate === void 0) { animate = false; }\n this._engine.driver.query(rootElement, NG_TRIGGER_SELECTOR, true).forEach(function (elm) {\n if (animate && containsClass(elm, _this._hostClassName)) {\n var /** @type {?} */ innerNs = _this._engine.namespacesByHostElement.get(elm);\n // special case for a host element with animations on the same element\n if (innerNs) {\n innerNs.removeNode(elm, context, true);\n }\n _this.removeNode(elm, context, true);\n }\n else {\n _this.clearElementCache(elm);\n }\n });\n };\n /**\n * @param {?} element\n * @param {?} context\n * @param {?=} doNotRecurse\n * @return {?}\n */\n AnimationTransitionNamespace.prototype.removeNode = function (element, context, doNotRecurse) {\n var _this = this;\n var /** @type {?} */ engine = this._engine;\n if (!doNotRecurse && element.childElementCount) {\n this._destroyInnerNodes(element, context, true);\n }\n var /** @type {?} */ triggerStates = engine.statesByElement.get(element);\n if (triggerStates) {\n var /** @type {?} */ players_1 = [];\n Object.keys(triggerStates).forEach(function (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 var /** @type {?} */ player = _this.trigger(element, triggerName, VOID_VALUE, false);\n if (player) {\n players_1.push(player);\n }\n }\n });\n if (players_1.length) {\n engine.markElementAsRemoved(this.id, element, true, context);\n optimizeGroupPlayer(players_1).onDone(function () { return engine.processLeaveNode(element); });\n return;\n }\n }\n // find the player that is animating and make sure that the\n // removal is delayed until that player has completed\n var /** @type {?} */ containsPotentialParentTransition = false;\n if (engine.totalAnimations) {\n var /** @type {?} */ currentPlayers = engine.players.length ? engine.playersByQueriedElement.get(element) : [];\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 }\n else {\n var /** @type {?} */ parent = element;\n while (parent = parent.parentNode) {\n var /** @type {?} */ triggers = engine.statesByElement.get(parent);\n if (triggers) {\n containsPotentialParentTransition = true;\n break;\n }\n }\n }\n }\n // at this stage 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 var /** @type {?} */ listeners = this._elementListeners.get(element);\n if (listeners) {\n var /** @type {?} */ visitedTriggers_1 = new Set();\n listeners.forEach(function (listener) {\n var /** @type {?} */ triggerName = listener.name;\n if (visitedTriggers_1.has(triggerName))\n return;\n visitedTriggers_1.add(triggerName);\n var /** @type {?} */ trigger = _this._triggers[triggerName];\n var /** @type {?} */ transition = trigger.fallbackTransition;\n var /** @type {?} */ elementStates = ((engine.statesByElement.get(element)));\n var /** @type {?} */ fromState = elementStates[triggerName] || DEFAULT_STATE_VALUE;\n var /** @type {?} */ toState = new StateValue(VOID_VALUE);\n var /** @type {?} */ player = new TransitionAnimationPlayer(_this.id, triggerName, element);\n _this._engine.totalQueuedPlayers++;\n _this._queue.push({\n element: element,\n triggerName: triggerName,\n transition: transition,\n fromState: fromState,\n toState: toState,\n player: player,\n isFallbackTransition: true\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 }\n else {\n // we do this after the flush has occurred such\n // that the callbacks can be fired\n engine.afterFlush(function () { return _this.clearElementCache(element); });\n engine.destroyInnerAnimations(element);\n engine._onRemovalComplete(element, context);\n }\n };\n /**\n * @param {?} element\n * @param {?} parent\n * @return {?}\n */\n AnimationTransitionNamespace.prototype.insertNode = function (element, parent) { addClass(element, this._hostClassName); };\n /**\n * @param {?} microtaskId\n * @return {?}\n */\n AnimationTransitionNamespace.prototype.drainQueuedTransitions = function (microtaskId) {\n var _this = this;\n var /** @type {?} */ instructions = [];\n this._queue.forEach(function (entry) {\n var /** @type {?} */ player = entry.player;\n if (player.destroyed)\n return;\n var /** @type {?} */ element = entry.element;\n var /** @type {?} */ listeners = _this._elementListeners.get(element);\n if (listeners) {\n listeners.forEach(function (listener) {\n if (listener.name == entry.triggerName) {\n var /** @type {?} */ baseEvent = makeAnimationEvent(element, entry.triggerName, entry.fromState.value, entry.toState.value);\n ((baseEvent))['_data'] = microtaskId;\n listenOnPlayer(entry.player, listener.phase, baseEvent, listener.callback);\n }\n });\n }\n if (player.markedForDestroy) {\n _this._engine.afterFlush(function () {\n // now we can destroy the element properly since the event listeners have\n // been bound to the player\n player.destroy();\n });\n }\n else {\n instructions.push(entry);\n }\n });\n this._queue = [];\n return instructions.sort(function (a, b) {\n // if depCount == 0 them move to front\n // otherwise if a contains b then move back\n var /** @type {?} */ d0 = a.transition.ast.depCount;\n var /** @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 */\n AnimationTransitionNamespace.prototype.destroy = function (context) {\n this.players.forEach(function (p) { return p.destroy(); });\n this._destroyInnerNodes(this.hostElement, context);\n };\n /**\n * @param {?} element\n * @return {?}\n */\n AnimationTransitionNamespace.prototype.elementContainsData = function (element) {\n var /** @type {?} */ containsData = false;\n if (this._elementListeners.has(element))\n containsData = true;\n containsData =\n (this._queue.find(function (entry) { return entry.element === element; }) ? true : false) || containsData;\n return containsData;\n };\n return AnimationTransitionNamespace;\n}());\nvar TransitionAnimationEngine = (function () {\n /**\n * @param {?} driver\n * @param {?} _normalizer\n */\n function TransitionAnimationEngine(driver, _normalizer) {\n this.driver = driver;\n this._normalizer = _normalizer;\n this.players = [];\n this.newHostElements = new Map();\n this.playersByElement = new Map();\n this.playersByQueriedElement = new Map();\n this.statesByElement = new Map();\n this.disabledNodes = new Set();\n this.totalAnimations = 0;\n this.totalQueuedPlayers = 0;\n this._namespaceLookup = {};\n this._namespaceList = [];\n this._flushFns = [];\n this._whenQuietFns = [];\n this.namespacesByHostElement = new Map();\n this.collectedEnterElements = [];\n this.collectedLeaveElements = [];\n this.onRemovalComplete = function (element, context) { };\n }\n /**\n * @param {?} element\n * @param {?} context\n * @return {?}\n */\n TransitionAnimationEngine.prototype._onRemovalComplete = function (element, context) { this.onRemovalComplete(element, context); };\n Object.defineProperty(TransitionAnimationEngine.prototype, \"queuedPlayers\", {\n /**\n * @return {?}\n */\n get: function () {\n var /** @type {?} */ players = [];\n this._namespaceList.forEach(function (ns) {\n ns.players.forEach(function (player) {\n if (player.queued) {\n players.push(player);\n }\n });\n });\n return players;\n },\n enumerable: true,\n configurable: true\n });\n /**\n * @param {?} namespaceId\n * @param {?} hostElement\n * @return {?}\n */\n TransitionAnimationEngine.prototype.createNamespace = function (namespaceId, hostElement) {\n var /** @type {?} */ ns = new AnimationTransitionNamespace(namespaceId, hostElement, this);\n if (hostElement.parentNode) {\n this._balanceNamespaceList(ns, hostElement);\n }\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 // 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 */\n TransitionAnimationEngine.prototype._balanceNamespaceList = function (ns, hostElement) {\n var /** @type {?} */ limit = this._namespaceList.length - 1;\n if (limit >= 0) {\n var /** @type {?} */ found = false;\n for (var /** @type {?} */ i = limit; i >= 0; i--) {\n var /** @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 }\n else {\n this._namespaceList.push(ns);\n }\n this.namespacesByHostElement.set(hostElement, ns);\n return ns;\n };\n /**\n * @param {?} namespaceId\n * @param {?} hostElement\n * @return {?}\n */\n TransitionAnimationEngine.prototype.register = function (namespaceId, hostElement) {\n var /** @type {?} */ ns = this._namespaceLookup[namespaceId];\n if (!ns) {\n ns = this.createNamespace(namespaceId, hostElement);\n }\n return ns;\n };\n /**\n * @param {?} namespaceId\n * @param {?} name\n * @param {?} trigger\n * @return {?}\n */\n TransitionAnimationEngine.prototype.registerTrigger = function (namespaceId, name, trigger) {\n var /** @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 */\n TransitionAnimationEngine.prototype.destroy = function (namespaceId, context) {\n var _this = this;\n if (!namespaceId)\n return;\n var /** @type {?} */ ns = this._fetchNamespace(namespaceId);\n this.afterFlush(function () {\n _this.namespacesByHostElement.delete(ns.hostElement);\n delete _this._namespaceLookup[namespaceId];\n var /** @type {?} */ index = _this._namespaceList.indexOf(ns);\n if (index >= 0) {\n _this._namespaceList.splice(index, 1);\n }\n });\n this.afterFlushAnimationsDone(function () { return ns.destroy(context); });\n };\n /**\n * @param {?} id\n * @return {?}\n */\n TransitionAnimationEngine.prototype._fetchNamespace = function (id) { return this._namespaceLookup[id]; };\n /**\n * @param {?} namespaceId\n * @param {?} element\n * @param {?} name\n * @param {?} value\n * @return {?}\n */\n TransitionAnimationEngine.prototype.trigger = function (namespaceId, element, name, value) {\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 */\n TransitionAnimationEngine.prototype.insertNode = function (namespaceId, element, parent, insertBefore) {\n if (!isElementNode(element))\n return;\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 var /** @type {?} */ details = (element[REMOVAL_FLAG]);\n if (details && details.setForRemoval) {\n details.setForRemoval = false;\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 // only *directives and host elements are inserted before\n if (insertBefore) {\n this.collectEnterElement(element);\n }\n };\n /**\n * @param {?} element\n * @return {?}\n */\n TransitionAnimationEngine.prototype.collectEnterElement = function (element) { this.collectedEnterElements.push(element); };\n /**\n * @param {?} element\n * @param {?} value\n * @return {?}\n */\n TransitionAnimationEngine.prototype.markElementAsDisabled = function (element, value) {\n if (value) {\n if (!this.disabledNodes.has(element)) {\n this.disabledNodes.add(element);\n addClass(element, DISABLED_CLASSNAME);\n }\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 */\n TransitionAnimationEngine.prototype.removeNode = function (namespaceId, element, context, doNotRecurse) {\n if (!isElementNode(element)) {\n this._onRemovalComplete(element, context);\n return;\n }\n var /** @type {?} */ ns = namespaceId ? this._fetchNamespace(namespaceId) : null;\n if (ns) {\n ns.removeNode(element, context, doNotRecurse);\n }\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 */\n TransitionAnimationEngine.prototype.markElementAsRemoved = function (namespaceId, element, hasAnimation, context) {\n this.collectedLeaveElements.push(element);\n element[REMOVAL_FLAG] = {\n namespaceId: namespaceId,\n setForRemoval: context, hasAnimation: 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 */\n TransitionAnimationEngine.prototype.listen = function (namespaceId, element, name, phase, callback) {\n if (isElementNode(element)) {\n return this._fetchNamespace(namespaceId).listen(element, name, phase, callback);\n }\n return function () { };\n };\n /**\n * @param {?} entry\n * @param {?} subTimelines\n * @return {?}\n */\n TransitionAnimationEngine.prototype._buildInstruction = function (entry, subTimelines) {\n return entry.transition.build(this.driver, entry.element, entry.fromState.value, entry.toState.value, entry.fromState.options, entry.toState.options, subTimelines);\n };\n /**\n * @param {?} containerElement\n * @return {?}\n */\n TransitionAnimationEngine.prototype.destroyInnerAnimations = function (containerElement) {\n var _this = this;\n var /** @type {?} */ elements = this.driver.query(containerElement, NG_TRIGGER_SELECTOR, true);\n elements.forEach(function (element) {\n var /** @type {?} */ players = _this.playersByElement.get(element);\n if (players) {\n players.forEach(function (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 }\n else {\n player.destroy();\n }\n });\n }\n var /** @type {?} */ stateMap = _this.statesByElement.get(element);\n if (stateMap) {\n Object.keys(stateMap).forEach(function (triggerName) { return stateMap[triggerName] = DELETED_STATE_VALUE; });\n }\n });\n if (this.playersByQueriedElement.size == 0)\n return;\n elements = this.driver.query(containerElement, NG_ANIMATING_SELECTOR, true);\n if (elements.length) {\n elements.forEach(function (element) {\n var /** @type {?} */ players = _this.playersByQueriedElement.get(element);\n if (players) {\n players.forEach(function (player) { return player.finish(); });\n }\n });\n }\n };\n /**\n * @return {?}\n */\n TransitionAnimationEngine.prototype.whenRenderingDone = function () {\n var _this = this;\n return new Promise(function (resolve) {\n if (_this.players.length) {\n return optimizeGroupPlayer(_this.players).onDone(function () { return resolve(); });\n }\n else {\n resolve();\n }\n });\n };\n /**\n * @param {?} element\n * @return {?}\n */\n TransitionAnimationEngine.prototype.processLeaveNode = function (element) {\n var _this = this;\n var /** @type {?} */ details = (element[REMOVAL_FLAG]);\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.destroyInnerAnimations(element);\n var /** @type {?} */ ns = this._fetchNamespace(details.namespaceId);\n if (ns) {\n ns.clearElementCache(element);\n }\n }\n this._onRemovalComplete(element, details.setForRemoval);\n }\n if (this.driver.matchesElement(element, DISABLED_SELECTOR)) {\n this.markElementAsDisabled(element, false);\n }\n this.driver.query(element, DISABLED_SELECTOR, true).forEach(function (node) {\n _this.markElementAsDisabled(element, false);\n });\n };\n /**\n * @param {?=} microtaskId\n * @return {?}\n */\n TransitionAnimationEngine.prototype.flush = function (microtaskId) {\n var _this = this;\n if (microtaskId === void 0) { microtaskId = -1; }\n var /** @type {?} */ players = [];\n if (this.newHostElements.size) {\n this.newHostElements.forEach(function (ns, element) { return _this._balanceNamespaceList(ns, element); });\n this.newHostElements.clear();\n }\n if (this._namespaceList.length &&\n (this.totalQueuedPlayers || this.collectedLeaveElements.length)) {\n var /** @type {?} */ cleanupFns = [];\n try {\n players = this._flushAnimations(cleanupFns, microtaskId);\n }\n finally {\n for (var /** @type {?} */ i = 0; i < cleanupFns.length; i++) {\n cleanupFns[i]();\n }\n }\n }\n else {\n for (var /** @type {?} */ i = 0; i < this.collectedLeaveElements.length; i++) {\n var /** @type {?} */ element = this.collectedLeaveElements[i];\n this.processLeaveNode(element);\n }\n }\n this.totalQueuedPlayers = 0;\n this.collectedEnterElements.length = 0;\n this.collectedLeaveElements.length = 0;\n this._flushFns.forEach(function (fn) { return fn(); });\n this._flushFns = [];\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 var /** @type {?} */ quietFns_1 = this._whenQuietFns;\n this._whenQuietFns = [];\n if (players.length) {\n optimizeGroupPlayer(players).onDone(function () { quietFns_1.forEach(function (fn) { return fn(); }); });\n }\n else {\n quietFns_1.forEach(function (fn) { return fn(); });\n }\n }\n };\n /**\n * @param {?} errors\n * @return {?}\n */\n TransitionAnimationEngine.prototype.reportError = function (errors) {\n throw new Error(\"Unable to process animations due to the following failed trigger transitions\\n \" + errors.join('\\n'));\n };\n /**\n * @param {?} cleanupFns\n * @param {?} microtaskId\n * @return {?}\n */\n TransitionAnimationEngine.prototype._flushAnimations = function (cleanupFns, microtaskId) {\n var _this = this;\n var /** @type {?} */ subTimelines = new ElementInstructionMap();\n var /** @type {?} */ skippedPlayers = [];\n var /** @type {?} */ skippedPlayersMap = new Map();\n var /** @type {?} */ queuedInstructions = [];\n var /** @type {?} */ queriedElements = new Map();\n var /** @type {?} */ allPreStyleElements = new Map();\n var /** @type {?} */ allPostStyleElements = new Map();\n var /** @type {?} */ disabledElementsSet = new Set();\n this.disabledNodes.forEach(function (node) {\n disabledElementsSet.add(node);\n var /** @type {?} */ nodesThatAreDisabled = _this.driver.query(node, QUEUED_SELECTOR, true);\n for (var /** @type {?} */ i = 0; i < nodesThatAreDisabled.length; i++) {\n disabledElementsSet.add(nodesThatAreDisabled[i]);\n }\n });\n var /** @type {?} */ bodyNode = getBodyNode();\n var /** @type {?} */ allEnterNodes = this.collectedEnterElements.length ?\n this.collectedEnterElements.filter(createIsRootFilterFn(this.collectedEnterElements)) :\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 (var /** @type {?} */ i = 0; i < allEnterNodes.length; i++) {\n addClass(allEnterNodes[i], ENTER_CLASSNAME);\n }\n var /** @type {?} */ allLeaveNodes = [];\n var /** @type {?} */ leaveNodesWithoutAnimations = new Set();\n for (var /** @type {?} */ i = 0; i < this.collectedLeaveElements.length; i++) {\n var /** @type {?} */ element = this.collectedLeaveElements[i];\n var /** @type {?} */ details = (element[REMOVAL_FLAG]);\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 cleanupFns.push(function () {\n allEnterNodes.forEach(function (element) { return removeClass(element, ENTER_CLASSNAME); });\n allLeaveNodes.forEach(function (element) {\n removeClass(element, LEAVE_CLASSNAME);\n _this.processLeaveNode(element);\n });\n });\n var /** @type {?} */ allPlayers = [];\n var /** @type {?} */ erroneousTransitions = [];\n for (var /** @type {?} */ i = this._namespaceList.length - 1; i >= 0; i--) {\n var /** @type {?} */ ns = this._namespaceList[i];\n ns.drainQueuedTransitions(microtaskId).forEach(function (entry) {\n var /** @type {?} */ player = entry.player;\n allPlayers.push(player);\n var /** @type {?} */ element = entry.element;\n if (!bodyNode || !_this.driver.containsElement(bodyNode, element)) {\n player.destroy();\n return;\n }\n var /** @type {?} */ instruction = ((_this._buildInstruction(entry, subTimelines)));\n if (instruction.errors && instruction.errors.length) {\n erroneousTransitions.push(instruction);\n return;\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(function () { return eraseStyles(element, instruction.fromStyles); });\n player.onDestroy(function () { return setStyles(element, instruction.toStyles); });\n skippedPlayers.push(player);\n return;\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(function (tl) { return tl.stretchStartingKeyframe = true; });\n subTimelines.append(element, instruction.timelines);\n var /** @type {?} */ tuple = { instruction: instruction, player: player, element: element };\n queuedInstructions.push(tuple);\n instruction.queriedElements.forEach(function (element) { return getOrSetAsInMap(queriedElements, element, []).push(player); });\n instruction.preStyleProps.forEach(function (stringMap, element) {\n var /** @type {?} */ props = Object.keys(stringMap);\n if (props.length) {\n var /** @type {?} */ setVal_1 = ((allPreStyleElements.get(element)));\n if (!setVal_1) {\n allPreStyleElements.set(element, setVal_1 = new Set());\n }\n props.forEach(function (prop) { return setVal_1.add(prop); });\n }\n });\n instruction.postStyleProps.forEach(function (stringMap, element) {\n var /** @type {?} */ props = Object.keys(stringMap);\n var /** @type {?} */ setVal = ((allPostStyleElements.get(element)));\n if (!setVal) {\n allPostStyleElements.set(element, setVal = new Set());\n }\n props.forEach(function (prop) { return setVal.add(prop); });\n });\n });\n }\n if (erroneousTransitions.length) {\n var /** @type {?} */ errors_1 = [];\n erroneousTransitions.forEach(function (instruction) {\n errors_1.push(\"@\" + instruction.triggerName + \" has failed due to:\\n\"); /** @type {?} */\n ((instruction.errors)).forEach(function (error) { return errors_1.push(\"- \" + error + \"\\n\"); });\n });\n allPlayers.forEach(function (player) { return player.destroy(); });\n this.reportError(errors_1);\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 var /** @type {?} */ enterNodesWithoutAnimations = new Set();\n for (var /** @type {?} */ i = 0; i < allEnterNodes.length; i++) {\n var /** @type {?} */ element = allEnterNodes[i];\n if (!subTimelines.has(element)) {\n enterNodesWithoutAnimations.add(element);\n }\n }\n var /** @type {?} */ allPreviousPlayersMap = new Map();\n var /** @type {?} */ sortedParentElements = [];\n queuedInstructions.forEach(function (entry) {\n var /** @type {?} */ element = entry.element;\n if (subTimelines.has(element)) {\n sortedParentElements.unshift(element);\n _this._beforeAnimationBuild(entry.player.namespaceId, entry.instruction, allPreviousPlayersMap);\n }\n });\n skippedPlayers.forEach(function (player) {\n var /** @type {?} */ element = player.element;\n var /** @type {?} */ previousPlayers = _this._getPreviousPlayers(element, false, player.namespaceId, player.triggerName, null);\n previousPlayers.forEach(function (prevPlayer) {\n getOrSetAsInMap(allPreviousPlayersMap, element, []).push(prevPlayer);\n prevPlayer.destroy();\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 var /** @type {?} */ replaceNodes = allLeaveNodes.filter(function (node) {\n return replacePostStylesAsPre(node, allPreStyleElements, allPostStyleElements);\n });\n // POST STAGE: fill the * styles\n var _a = cloakAndComputeStyles(this.driver, leaveNodesWithoutAnimations, allPostStyleElements, AUTO_STYLE), postStylesMap = _a[0], allLeaveQueriedNodes = _a[1];\n allLeaveQueriedNodes.forEach(function (node) {\n if (replacePostStylesAsPre(node, allPreStyleElements, allPostStyleElements)) {\n replaceNodes.push(node);\n }\n });\n // PRE STAGE: fill the ! styles\n var preStylesMap = (allPreStyleElements.size ?\n cloakAndComputeStyles(this.driver, enterNodesWithoutAnimations, allPreStyleElements, ɵPRE_STYLE) :\n [new Map()])[0];\n replaceNodes.forEach(function (node) {\n var /** @type {?} */ post = postStylesMap.get(node);\n var /** @type {?} */ pre = preStylesMap.get(node);\n postStylesMap.set(node, /** @type {?} */ (Object.assign({}, post, pre)));\n });\n var /** @type {?} */ rootPlayers = [];\n var /** @type {?} */ subPlayers = [];\n queuedInstructions.forEach(function (entry) {\n var element = entry.element, player = entry.player, instruction = entry.instruction;\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 var /** @type {?} */ innerPlayer = _this._buildAnimation(player.namespaceId, instruction, allPreviousPlayersMap, skippedPlayersMap, preStylesMap, postStylesMap);\n player.setRealPlayer(innerPlayer);\n var /** @type {?} */ parentHasPriority = null;\n for (var /** @type {?} */ i = 0; i < sortedParentElements.length; i++) {\n var /** @type {?} */ parent = sortedParentElements[i];\n if (parent === element)\n break;\n if (_this.driver.containsElement(parent, element)) {\n parentHasPriority = parent;\n break;\n }\n }\n if (parentHasPriority) {\n var /** @type {?} */ parentPlayers = _this.playersByElement.get(parentHasPriority);\n if (parentPlayers && parentPlayers.length) {\n player.parentPlayer = optimizeGroupPlayer(parentPlayers);\n }\n skippedPlayers.push(player);\n }\n else {\n rootPlayers.push(player);\n }\n }\n else {\n eraseStyles(element, instruction.fromStyles);\n player.onDestroy(function () { return 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 // find all of the sub players' corresponding inner animation player\n subPlayers.forEach(function (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 var /** @type {?} */ playersForElement = skippedPlayersMap.get(player.element);\n if (playersForElement && playersForElement.length) {\n var /** @type {?} */ innerPlayer = optimizeGroupPlayer(playersForElement);\n player.setRealPlayer(innerPlayer);\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(function (player) {\n if (player.parentPlayer) {\n player.parentPlayer.onDestroy(function () { return player.destroy(); });\n }\n else {\n player.destroy();\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 (var /** @type {?} */ i = 0; i < allLeaveNodes.length; i++) {\n var /** @type {?} */ element = allLeaveNodes[i];\n var /** @type {?} */ details = (element[REMOVAL_FLAG]);\n removeClass(element, LEAVE_CLASSNAME);\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)\n continue;\n var /** @type {?} */ players = [];\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 var /** @type {?} */ queriedPlayerResults = queriedElements.get(element);\n if (queriedPlayerResults && queriedPlayerResults.length) {\n players.push.apply(players, queriedPlayerResults);\n }\n var /** @type {?} */ queriedInnerElements = this.driver.query(element, NG_ANIMATING_SELECTOR, true);\n for (var /** @type {?} */ j = 0; j < queriedInnerElements.length; j++) {\n var /** @type {?} */ queriedPlayers = queriedElements.get(queriedInnerElements[j]);\n if (queriedPlayers && queriedPlayers.length) {\n players.push.apply(players, queriedPlayers);\n }\n }\n }\n var /** @type {?} */ activePlayers = players.filter(function (p) { return !p.destroyed; });\n if (activePlayers.length) {\n removeNodesAfterAnimationDone(this, element, activePlayers);\n }\n else {\n this.processLeaveNode(element);\n }\n }\n // this is required so the cleanup method doesn't remove them\n allLeaveNodes.length = 0;\n rootPlayers.forEach(function (player) {\n _this.players.push(player);\n player.onDone(function () {\n player.destroy();\n var /** @type {?} */ index = _this.players.indexOf(player);\n _this.players.splice(index, 1);\n });\n player.play();\n });\n return rootPlayers;\n };\n /**\n * @param {?} namespaceId\n * @param {?} element\n * @return {?}\n */\n TransitionAnimationEngine.prototype.elementContainsData = function (namespaceId, element) {\n var /** @type {?} */ containsData = false;\n var /** @type {?} */ details = (element[REMOVAL_FLAG]);\n if (details && details.setForRemoval)\n containsData = true;\n if (this.playersByElement.has(element))\n containsData = true;\n if (this.playersByQueriedElement.has(element))\n containsData = true;\n if (this.statesByElement.has(element))\n containsData = true;\n return this._fetchNamespace(namespaceId).elementContainsData(element) || containsData;\n };\n /**\n * @param {?} callback\n * @return {?}\n */\n TransitionAnimationEngine.prototype.afterFlush = function (callback) { this._flushFns.push(callback); };\n /**\n * @param {?} callback\n * @return {?}\n */\n TransitionAnimationEngine.prototype.afterFlushAnimationsDone = function (callback) { this._whenQuietFns.push(callback); };\n /**\n * @param {?} element\n * @param {?} isQueriedElement\n * @param {?=} namespaceId\n * @param {?=} triggerName\n * @param {?=} toStateValue\n * @return {?}\n */\n TransitionAnimationEngine.prototype._getPreviousPlayers = function (element, isQueriedElement, namespaceId, triggerName, toStateValue) {\n var /** @type {?} */ players = [];\n if (isQueriedElement) {\n var /** @type {?} */ queriedElementPlayers = this.playersByQueriedElement.get(element);\n if (queriedElementPlayers) {\n players = queriedElementPlayers;\n }\n }\n else {\n var /** @type {?} */ elementPlayers = this.playersByElement.get(element);\n if (elementPlayers) {\n var /** @type {?} */ isRemovalAnimation_1 = !toStateValue || toStateValue == VOID_VALUE;\n elementPlayers.forEach(function (player) {\n if (player.queued)\n return;\n if (!isRemovalAnimation_1 && player.triggerName != triggerName)\n return;\n players.push(player);\n });\n }\n }\n if (namespaceId || triggerName) {\n players = players.filter(function (player) {\n if (namespaceId && namespaceId != player.namespaceId)\n return false;\n if (triggerName && triggerName != player.triggerName)\n return false;\n return true;\n });\n }\n return players;\n };\n /**\n * @param {?} namespaceId\n * @param {?} instruction\n * @param {?} allPreviousPlayersMap\n * @return {?}\n */\n TransitionAnimationEngine.prototype._beforeAnimationBuild = function (namespaceId, instruction, allPreviousPlayersMap) {\n var _this = this;\n var /** @type {?} */ triggerName = instruction.triggerName;\n var /** @type {?} */ rootElement = instruction.element;\n // when a removal animation occurs, ALL previous players are collected\n // and destroyed (even if they are outside of the current namespace)\n var /** @type {?} */ targetNameSpaceId = instruction.isRemovalTransition ? undefined : namespaceId;\n var /** @type {?} */ targetTriggerName = instruction.isRemovalTransition ? undefined : triggerName;\n instruction.timelines.map(function (timelineInstruction) {\n var /** @type {?} */ element = timelineInstruction.element;\n var /** @type {?} */ isQueriedElement = element !== rootElement;\n var /** @type {?} */ players = getOrSetAsInMap(allPreviousPlayersMap, element, []);\n var /** @type {?} */ previousPlayers = _this._getPreviousPlayers(element, isQueriedElement, targetNameSpaceId, targetTriggerName, instruction.toState);\n previousPlayers.forEach(function (player) {\n var /** @type {?} */ realPlayer = (player.getRealPlayer());\n if (realPlayer.beforeDestroy) {\n realPlayer.beforeDestroy();\n }\n player.destroy();\n players.push(player);\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 */\n TransitionAnimationEngine.prototype._buildAnimation = function (namespaceId, instruction, allPreviousPlayersMap, skippedPlayersMap, preStylesMap, postStylesMap) {\n var _this = this;\n var /** @type {?} */ triggerName = instruction.triggerName;\n var /** @type {?} */ rootElement = instruction.element;\n // we first run this so that the previous animation player\n // data can be passed into the successive animation players\n var /** @type {?} */ allQueriedPlayers = [];\n var /** @type {?} */ allConsumedElements = new Set();\n var /** @type {?} */ allSubElements = new Set();\n var /** @type {?} */ allNewPlayers = instruction.timelines.map(function (timelineInstruction) {\n var /** @type {?} */ element = timelineInstruction.element;\n allConsumedElements.add(element);\n // FIXME (matsko): make sure to-be-removed animations are removed properly\n var /** @type {?} */ details = element[REMOVAL_FLAG];\n if (details && details.removedBeforeQueried)\n return new NoopAnimationPlayer();\n var /** @type {?} */ isQueriedElement = element !== rootElement;\n var /** @type {?} */ previousPlayers = flattenGroupPlayers((allPreviousPlayersMap.get(element) || EMPTY_PLAYER_ARRAY)\n .map(function (p) { return p.getRealPlayer(); }))\n .filter(function (p) {\n // the `element` 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 var /** @type {?} */ pp = (p);\n return pp.element ? pp.element === element : false;\n });\n var /** @type {?} */ preStyles = preStylesMap.get(element);\n var /** @type {?} */ postStyles = postStylesMap.get(element);\n var /** @type {?} */ keyframes = normalizeKeyframes(_this.driver, _this._normalizer, element, timelineInstruction.keyframes, preStyles, postStyles);\n var /** @type {?} */ player = _this._buildPlayer(timelineInstruction, keyframes, previousPlayers);\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 if (isQueriedElement) {\n var /** @type {?} */ wrappedPlayer = new TransitionAnimationPlayer(namespaceId, triggerName, element);\n wrappedPlayer.setRealPlayer(player);\n allQueriedPlayers.push(wrappedPlayer);\n }\n return player;\n });\n allQueriedPlayers.forEach(function (player) {\n getOrSetAsInMap(_this.playersByQueriedElement, player.element, []).push(player);\n player.onDone(function () { return deleteOrUnsetInMap(_this.playersByQueriedElement, player.element, player); });\n });\n allConsumedElements.forEach(function (element) { return addClass(element, NG_ANIMATING_CLASSNAME); });\n var /** @type {?} */ player = optimizeGroupPlayer(allNewPlayers);\n player.onDestroy(function () {\n allConsumedElements.forEach(function (element) { return removeClass(element, NG_ANIMATING_CLASSNAME); });\n setStyles(rootElement, instruction.toStyles);\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(function (element) { getOrSetAsInMap(skippedPlayersMap, element, []).push(player); });\n return player;\n };\n /**\n * @param {?} instruction\n * @param {?} keyframes\n * @param {?} previousPlayers\n * @return {?}\n */\n TransitionAnimationEngine.prototype._buildPlayer = function (instruction, keyframes, previousPlayers) {\n if (keyframes.length > 0) {\n return this.driver.animate(instruction.element, keyframes, instruction.duration, instruction.delay, instruction.easing, previousPlayers);\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 return TransitionAnimationEngine;\n}());\nvar TransitionAnimationPlayer = (function () {\n /**\n * @param {?} namespaceId\n * @param {?} triggerName\n * @param {?} element\n */\n function TransitionAnimationPlayer(namespaceId, triggerName, element) {\n this.namespaceId = namespaceId;\n this.triggerName = triggerName;\n this.element = element;\n this._player = new NoopAnimationPlayer();\n this._containsRealPlayer = false;\n this._queuedCallbacks = {};\n this._destroyed = false;\n this.markedForDestroy = false;\n }\n Object.defineProperty(TransitionAnimationPlayer.prototype, \"queued\", {\n /**\n * @return {?}\n */\n get: function () { return this._containsRealPlayer == false; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(TransitionAnimationPlayer.prototype, \"destroyed\", {\n /**\n * @return {?}\n */\n get: function () { return this._destroyed; },\n enumerable: true,\n configurable: true\n });\n /**\n * @param {?} player\n * @return {?}\n */\n TransitionAnimationPlayer.prototype.setRealPlayer = function (player) {\n var _this = this;\n if (this._containsRealPlayer)\n return;\n this._player = player;\n Object.keys(this._queuedCallbacks).forEach(function (phase) {\n _this._queuedCallbacks[phase].forEach(function (callback) { return listenOnPlayer(player, phase, undefined, callback); });\n });\n this._queuedCallbacks = {};\n this._containsRealPlayer = true;\n };\n /**\n * @return {?}\n */\n TransitionAnimationPlayer.prototype.getRealPlayer = function () { return this._player; };\n /**\n * @param {?} name\n * @param {?} callback\n * @return {?}\n */\n TransitionAnimationPlayer.prototype._queueEvent = function (name, callback) {\n getOrSetAsInMap(this._queuedCallbacks, name, []).push(callback);\n };\n /**\n * @param {?} fn\n * @return {?}\n */\n TransitionAnimationPlayer.prototype.onDone = function (fn) {\n if (this.queued) {\n this._queueEvent('done', fn);\n }\n this._player.onDone(fn);\n };\n /**\n * @param {?} fn\n * @return {?}\n */\n TransitionAnimationPlayer.prototype.onStart = function (fn) {\n if (this.queued) {\n this._queueEvent('start', fn);\n }\n this._player.onStart(fn);\n };\n /**\n * @param {?} fn\n * @return {?}\n */\n TransitionAnimationPlayer.prototype.onDestroy = function (fn) {\n if (this.queued) {\n this._queueEvent('destroy', fn);\n }\n this._player.onDestroy(fn);\n };\n /**\n * @return {?}\n */\n TransitionAnimationPlayer.prototype.init = function () { this._player.init(); };\n /**\n * @return {?}\n */\n TransitionAnimationPlayer.prototype.hasStarted = function () { return this.queued ? false : this._player.hasStarted(); };\n /**\n * @return {?}\n */\n TransitionAnimationPlayer.prototype.play = function () { !this.queued && this._player.play(); };\n /**\n * @return {?}\n */\n TransitionAnimationPlayer.prototype.pause = function () { !this.queued && this._player.pause(); };\n /**\n * @return {?}\n */\n TransitionAnimationPlayer.prototype.restart = function () { !this.queued && this._player.restart(); };\n /**\n * @return {?}\n */\n TransitionAnimationPlayer.prototype.finish = function () { this._player.finish(); };\n /**\n * @return {?}\n */\n TransitionAnimationPlayer.prototype.destroy = function () {\n this._destroyed = true;\n this._player.destroy();\n };\n /**\n * @return {?}\n */\n TransitionAnimationPlayer.prototype.reset = function () { !this.queued && this._player.reset(); };\n /**\n * @param {?} p\n * @return {?}\n */\n TransitionAnimationPlayer.prototype.setPosition = function (p) {\n if (!this.queued) {\n this._player.setPosition(p);\n }\n };\n /**\n * @return {?}\n */\n TransitionAnimationPlayer.prototype.getPosition = function () { return this.queued ? 0 : this._player.getPosition(); };\n Object.defineProperty(TransitionAnimationPlayer.prototype, \"totalTime\", {\n /**\n * @return {?}\n */\n get: function () { return this._player.totalTime; },\n enumerable: true,\n configurable: true\n });\n return TransitionAnimationPlayer;\n}());\n/**\n * @param {?} map\n * @param {?} key\n * @param {?} value\n * @return {?}\n */\nfunction deleteOrUnsetInMap(map, key, value) {\n var /** @type {?} */ currentValues;\n if (map instanceof Map) {\n currentValues = map.get(key);\n if (currentValues) {\n if (currentValues.length) {\n var /** @type {?} */ index = currentValues.indexOf(value);\n currentValues.splice(index, 1);\n }\n if (currentValues.length == 0) {\n map.delete(key);\n }\n }\n }\n else {\n currentValues = map[key];\n if (currentValues) {\n if (currentValues.length) {\n var /** @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(value) {\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) {\n return node && node['nodeType'] === 1;\n}\n/**\n * @param {?} eventName\n * @return {?}\n */\nfunction isTriggerEventValid(eventName) {\n return eventName == 'start' || eventName == 'done';\n}\n/**\n * @param {?} element\n * @param {?=} value\n * @return {?}\n */\nfunction cloakElement(element, value) {\n var /** @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(driver, elements, elementPropsMap, defaultStyle) {\n var /** @type {?} */ cloakVals = [];\n elements.forEach(function (element) { return cloakVals.push(cloakElement(element)); });\n var /** @type {?} */ valuesMap = new Map();\n var /** @type {?} */ failedElements = [];\n elementPropsMap.forEach(function (props, element) {\n var /** @type {?} */ styles = {};\n props.forEach(function (prop) {\n var /** @type {?} */ value = styles[prop] = driver.computeStyle(element, prop, defaultStyle);\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 // we use a index variable here since Set.forEach(a, i) does not return\n // an index value for the closure (but instead just the value)\n var /** @type {?} */ i = 0;\n elements.forEach(function (element) { return cloakElement(element, cloakVals[i++]); });\n return [valuesMap, failedElements];\n}\n/**\n * @param {?} nodes\n * @return {?}\n */\nfunction createIsRootFilterFn(nodes) {\n var /** @type {?} */ nodeSet = new Set(nodes);\n var /** @type {?} */ knownRootContainer = new Set();\n var /** @type {?} */ isRoot;\n isRoot = function (node) {\n if (!node)\n return true;\n if (nodeSet.has(node.parentNode))\n return false;\n if (knownRootContainer.has(node.parentNode))\n return true;\n if (isRoot(node.parentNode)) {\n knownRootContainer.add(node);\n return true;\n }\n return false;\n };\n return isRoot;\n}\nvar CLASSES_CACHE_KEY = '$$classes';\n/**\n * @param {?} element\n * @param {?} className\n * @return {?}\n */\nfunction containsClass(element, className) {\n if (element.classList) {\n return element.classList.contains(className);\n }\n else {\n var /** @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, className) {\n if (element.classList) {\n element.classList.add(className);\n }\n else {\n var /** @type {?} */ classes = 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, className) {\n if (element.classList) {\n element.classList.remove(className);\n }\n else {\n var /** @type {?} */ classes = element[CLASSES_CACHE_KEY];\n if (classes) {\n delete classes[className];\n }\n }\n}\n/**\n * @return {?}\n */\nfunction getBodyNode() {\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(engine, element, players) {\n optimizeGroupPlayer(players).onDone(function () { return engine.processLeaveNode(element); });\n}\n/**\n * @param {?} players\n * @return {?}\n */\nfunction flattenGroupPlayers(players) {\n var /** @type {?} */ finalPlayers = [];\n _flattenGroupPlayersRecur(players, finalPlayers);\n return finalPlayers;\n}\n/**\n * @param {?} players\n * @param {?} finalPlayers\n * @return {?}\n */\nfunction _flattenGroupPlayersRecur(players, finalPlayers) {\n for (var /** @type {?} */ i = 0; i < players.length; i++) {\n var /** @type {?} */ player = players[i];\n if (player instanceof ɵAnimationGroupPlayer) {\n _flattenGroupPlayersRecur(player.players, finalPlayers);\n }\n else {\n finalPlayers.push(/** @type {?} */ (player));\n }\n }\n}\n/**\n * @param {?} a\n * @param {?} b\n * @return {?}\n */\nfunction objEquals(a, b) {\n var /** @type {?} */ k1 = Object.keys(a);\n var /** @type {?} */ k2 = Object.keys(b);\n if (k1.length != k2.length)\n return false;\n for (var /** @type {?} */ i = 0; i < k1.length; i++) {\n var /** @type {?} */ prop = k1[i];\n if (!b.hasOwnProperty(prop) || a[prop] !== b[prop])\n return false;\n }\n return true;\n}\n/**\n * @param {?} element\n * @param {?} allPreStyleElements\n * @param {?} allPostStyleElements\n * @return {?}\n */\nfunction replacePostStylesAsPre(element, allPreStyleElements, allPostStyleElements) {\n var /** @type {?} */ postEntry = allPostStyleElements.get(element);\n if (!postEntry)\n return false;\n var /** @type {?} */ preEntry = allPreStyleElements.get(element);\n if (preEntry) {\n postEntry.forEach(function (data) { return ((preEntry)).add(data); });\n }\n else {\n allPreStyleElements.set(element, postEntry);\n }\n allPostStyleElements.delete(element);\n return true;\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 */\nvar AnimationEngine = (function () {\n /**\n * @param {?} driver\n * @param {?} normalizer\n */\n function AnimationEngine(driver, normalizer) {\n var _this = this;\n this._triggerCache = {};\n this.onRemovalComplete = function (element, context) { };\n this._transitionEngine = new TransitionAnimationEngine(driver, normalizer);\n this._timelineEngine = new TimelineAnimationEngine(driver, normalizer);\n this._transitionEngine.onRemovalComplete = function (element, context) { return _this.onRemovalComplete(element, context); };\n }\n /**\n * @param {?} componentId\n * @param {?} namespaceId\n * @param {?} hostElement\n * @param {?} name\n * @param {?} metadata\n * @return {?}\n */\n AnimationEngine.prototype.registerTrigger = function (componentId, namespaceId, hostElement, name, metadata) {\n var /** @type {?} */ cacheKey = componentId + '-' + name;\n var /** @type {?} */ trigger = this._triggerCache[cacheKey];\n if (!trigger) {\n var /** @type {?} */ errors = [];\n var /** @type {?} */ ast = (buildAnimationAst(/** @type {?} */ (metadata), errors));\n if (errors.length) {\n throw new Error(\"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 */\n AnimationEngine.prototype.register = function (namespaceId, hostElement) {\n this._transitionEngine.register(namespaceId, hostElement);\n };\n /**\n * @param {?} namespaceId\n * @param {?} context\n * @return {?}\n */\n AnimationEngine.prototype.destroy = function (namespaceId, context) {\n this._transitionEngine.destroy(namespaceId, context);\n };\n /**\n * @param {?} namespaceId\n * @param {?} element\n * @param {?} parent\n * @param {?} insertBefore\n * @return {?}\n */\n AnimationEngine.prototype.onInsert = function (namespaceId, element, parent, insertBefore) {\n this._transitionEngine.insertNode(namespaceId, element, parent, insertBefore);\n };\n /**\n * @param {?} namespaceId\n * @param {?} element\n * @param {?} context\n * @return {?}\n */\n AnimationEngine.prototype.onRemove = function (namespaceId, element, context) {\n this._transitionEngine.removeNode(namespaceId, element, context);\n };\n /**\n * @param {?} element\n * @param {?} disable\n * @return {?}\n */\n AnimationEngine.prototype.disableAnimations = function (element, disable) {\n this._transitionEngine.markElementAsDisabled(element, disable);\n };\n /**\n * @param {?} namespaceId\n * @param {?} element\n * @param {?} property\n * @param {?} value\n * @return {?}\n */\n AnimationEngine.prototype.process = function (namespaceId, element, property, value) {\n if (property.charAt(0) == '@') {\n var _a = parseTimelineCommand(property), id = _a[0], action = _a[1];\n var /** @type {?} */ args = (value);\n this._timelineEngine.command(id, element, action, args);\n }\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 */\n AnimationEngine.prototype.listen = function (namespaceId, element, eventName, eventPhase, callback) {\n // @@listen\n if (eventName.charAt(0) == '@') {\n var _a = parseTimelineCommand(eventName), id = _a[0], action = _a[1];\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 */\n AnimationEngine.prototype.flush = function (microtaskId) {\n if (microtaskId === void 0) { microtaskId = -1; }\n this._transitionEngine.flush(microtaskId);\n };\n Object.defineProperty(AnimationEngine.prototype, \"players\", {\n /**\n * @return {?}\n */\n get: function () {\n return ((this._transitionEngine.players))\n .concat(/** @type {?} */ (this._timelineEngine.players));\n },\n enumerable: true,\n configurable: true\n });\n /**\n * @return {?}\n */\n AnimationEngine.prototype.whenRenderingDone = function () { return this._transitionEngine.whenRenderingDone(); };\n return AnimationEngine;\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 */\nvar WebAnimationsPlayer = (function () {\n /**\n * @param {?} element\n * @param {?} keyframes\n * @param {?} options\n * @param {?=} previousPlayers\n */\n function WebAnimationsPlayer(element, keyframes, options, previousPlayers) {\n if (previousPlayers === void 0) { previousPlayers = []; }\n var _this = this;\n this.element = element;\n this.keyframes = keyframes;\n this.options = options;\n this.previousPlayers = previousPlayers;\n this._onDoneFns = [];\n this._onStartFns = [];\n this._onDestroyFns = [];\n this._initialized = false;\n this._finished = false;\n this._started = false;\n this._destroyed = false;\n this.time = 0;\n this.parentPlayer = null;\n this.previousStyles = {};\n this.currentSnapshot = {};\n this._duration = options['duration'];\n this._delay = options['delay'] || 0;\n this.time = this._duration + this._delay;\n if (allowPreviousPlayerStylesMerge(this._duration, this._delay)) {\n previousPlayers.forEach(function (player) {\n var styles = player.currentSnapshot;\n Object.keys(styles).forEach(function (prop) { return _this.previousStyles[prop] = styles[prop]; });\n });\n }\n }\n /**\n * @return {?}\n */\n WebAnimationsPlayer.prototype._onFinish = function () {\n if (!this._finished) {\n this._finished = true;\n this._onDoneFns.forEach(function (fn) { return fn(); });\n this._onDoneFns = [];\n }\n };\n /**\n * @return {?}\n */\n WebAnimationsPlayer.prototype.init = function () {\n this._buildPlayer();\n this._preparePlayerBeforeStart();\n };\n /**\n * @return {?}\n */\n WebAnimationsPlayer.prototype._buildPlayer = function () {\n var _this = this;\n if (this._initialized)\n return;\n this._initialized = true;\n var /** @type {?} */ keyframes = this.keyframes.map(function (styles) { return copyStyles(styles, false); });\n var /** @type {?} */ previousStyleProps = Object.keys(this.previousStyles);\n if (previousStyleProps.length) {\n var /** @type {?} */ startingKeyframe_1 = keyframes[0];\n var /** @type {?} */ missingStyleProps_1 = [];\n previousStyleProps.forEach(function (prop) {\n if (!startingKeyframe_1.hasOwnProperty(prop)) {\n missingStyleProps_1.push(prop);\n }\n startingKeyframe_1[prop] = _this.previousStyles[prop];\n });\n if (missingStyleProps_1.length) {\n var /** @type {?} */ self_1 = this;\n var _loop_1 = function () {\n var /** @type {?} */ kf = keyframes[i];\n missingStyleProps_1.forEach(function (prop) {\n kf[prop] = _computeStyle(self_1.element, prop);\n });\n };\n // tslint:disable-next-line\n for (var /** @type {?} */ i = 1; i < keyframes.length; i++) {\n _loop_1();\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', function () { return _this._onFinish(); });\n };\n /**\n * @return {?}\n */\n WebAnimationsPlayer.prototype._preparePlayerBeforeStart = function () {\n // this is required so that the player doesn't start to animate right away\n if (this._delay) {\n this._resetDomPlayerState();\n }\n else {\n this._player.pause();\n }\n };\n /**\n * \\@internal\n * @param {?} element\n * @param {?} keyframes\n * @param {?} options\n * @return {?}\n */\n WebAnimationsPlayer.prototype._triggerWebAnimation = function (element, keyframes, options) {\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 (element['animate'](keyframes, options));\n };\n Object.defineProperty(WebAnimationsPlayer.prototype, \"domPlayer\", {\n /**\n * @return {?}\n */\n get: function () { return this._player; },\n enumerable: true,\n configurable: true\n });\n /**\n * @param {?} fn\n * @return {?}\n */\n WebAnimationsPlayer.prototype.onStart = function (fn) { this._onStartFns.push(fn); };\n /**\n * @param {?} fn\n * @return {?}\n */\n WebAnimationsPlayer.prototype.onDone = function (fn) { this._onDoneFns.push(fn); };\n /**\n * @param {?} fn\n * @return {?}\n */\n WebAnimationsPlayer.prototype.onDestroy = function (fn) { this._onDestroyFns.push(fn); };\n /**\n * @return {?}\n */\n WebAnimationsPlayer.prototype.play = function () {\n this._buildPlayer();\n if (!this.hasStarted()) {\n this._onStartFns.forEach(function (fn) { return fn(); });\n this._onStartFns = [];\n this._started = true;\n }\n this._player.play();\n };\n /**\n * @return {?}\n */\n WebAnimationsPlayer.prototype.pause = function () {\n this.init();\n this._player.pause();\n };\n /**\n * @return {?}\n */\n WebAnimationsPlayer.prototype.finish = function () {\n this.init();\n this._onFinish();\n this._player.finish();\n };\n /**\n * @return {?}\n */\n WebAnimationsPlayer.prototype.reset = function () {\n this._resetDomPlayerState();\n this._destroyed = false;\n this._finished = false;\n this._started = false;\n };\n /**\n * @return {?}\n */\n WebAnimationsPlayer.prototype._resetDomPlayerState = function () {\n if (this._player) {\n this._player.cancel();\n }\n };\n /**\n * @return {?}\n */\n WebAnimationsPlayer.prototype.restart = function () {\n this.reset();\n this.play();\n };\n /**\n * @return {?}\n */\n WebAnimationsPlayer.prototype.hasStarted = function () { return this._started; };\n /**\n * @return {?}\n */\n WebAnimationsPlayer.prototype.destroy = function () {\n if (!this._destroyed) {\n this._destroyed = true;\n this._resetDomPlayerState();\n this._onFinish();\n this._onDestroyFns.forEach(function (fn) { return fn(); });\n this._onDestroyFns = [];\n }\n };\n /**\n * @param {?} p\n * @return {?}\n */\n WebAnimationsPlayer.prototype.setPosition = function (p) { this._player.currentTime = p * this.time; };\n /**\n * @return {?}\n */\n WebAnimationsPlayer.prototype.getPosition = function () { return this._player.currentTime / this.time; };\n Object.defineProperty(WebAnimationsPlayer.prototype, \"totalTime\", {\n /**\n * @return {?}\n */\n get: function () { return this._delay + this._duration; },\n enumerable: true,\n configurable: true\n });\n /**\n * @return {?}\n */\n WebAnimationsPlayer.prototype.beforeDestroy = function () {\n var _this = this;\n var /** @type {?} */ styles = {};\n if (this.hasStarted()) {\n Object.keys(this._finalKeyframe).forEach(function (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 return WebAnimationsPlayer;\n}());\n/**\n * @param {?} element\n * @param {?} prop\n * @return {?}\n */\nfunction _computeStyle(element, prop) {\n return ((window.getComputedStyle(element)))[prop];\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 */\nvar WebAnimationsDriver = (function () {\n function WebAnimationsDriver() {\n }\n /**\n * @param {?} element\n * @param {?} selector\n * @return {?}\n */\n WebAnimationsDriver.prototype.matchesElement = function (element, selector) {\n return matchesElement(element, selector);\n };\n /**\n * @param {?} elm1\n * @param {?} elm2\n * @return {?}\n */\n WebAnimationsDriver.prototype.containsElement = function (elm1, elm2) { return containsElement(elm1, elm2); };\n /**\n * @param {?} element\n * @param {?} selector\n * @param {?} multi\n * @return {?}\n */\n WebAnimationsDriver.prototype.query = function (element, selector, multi) {\n return invokeQuery(element, selector, multi);\n };\n /**\n * @param {?} element\n * @param {?} prop\n * @param {?=} defaultValue\n * @return {?}\n */\n WebAnimationsDriver.prototype.computeStyle = function (element, prop, defaultValue) {\n return (((window.getComputedStyle(element)))[prop]);\n };\n /**\n * @param {?} element\n * @param {?} keyframes\n * @param {?} duration\n * @param {?} delay\n * @param {?} easing\n * @param {?=} previousPlayers\n * @return {?}\n */\n WebAnimationsDriver.prototype.animate = function (element, keyframes, duration, delay, easing, previousPlayers) {\n if (previousPlayers === void 0) { previousPlayers = []; }\n var /** @type {?} */ fill = delay == 0 ? 'both' : 'forwards';\n var /** @type {?} */ playerOptions = { duration: duration, delay: delay, fill: fill };\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 var /** @type {?} */ previousWebAnimationPlayers = (previousPlayers.filter(function (player) { return player instanceof WebAnimationsPlayer; }));\n return new WebAnimationsPlayer(element, keyframes, playerOptions, previousWebAnimationPlayers);\n };\n return WebAnimationsDriver;\n}());\n/**\n * @return {?}\n */\nfunction supportsWebAnimations() {\n return typeof Element !== 'undefined' && typeof ((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/**\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 * @module\n * @description\n * Entry point for all animation APIs of the animation browser package.\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/**\n * @module\n * @description\n * Entry point for all public APIs of the animation package.\n */\n/**\n * Generated bundle index. Do not edit.\n */\nexport { AnimationDriver, Animation as ɵAnimation, AnimationStyleNormalizer as ɵAnimationStyleNormalizer, NoopAnimationStyleNormalizer as ɵNoopAnimationStyleNormalizer, WebAnimationsStyleNormalizer as ɵWebAnimationsStyleNormalizer, NoopAnimationDriver as ɵNoopAnimationDriver, AnimationEngine as ɵAnimationEngine, WebAnimationsDriver as ɵWebAnimationsDriver, supportsWebAnimations as ɵsupportsWebAnimations, WebAnimationsPlayer as ɵWebAnimationsPlayer };\n//# sourceMappingURL=browser.es5.js.map\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/@angular/animations/@angular/animations/browser.es5.js\n// module id = ./node_modules/@angular/animations/@angular/animations/browser.es5.js\n// module chunks = 0","import * as tslib_1 from \"tslib\";\n/**\n * @license Angular v4.4.6\n * (c) 2010-2017 Google, Inc. https://angular.io/\n * License: MIT\n */\nimport { Inject, Injectable, InjectionToken, NgModule, Optional, PLATFORM_ID } from '@angular/core';\nimport { of } from 'rxjs/observable/of';\nimport { concatMap } from 'rxjs/operator/concatMap';\nimport { filter } from 'rxjs/operator/filter';\nimport { map } from 'rxjs/operator/map';\nimport { DOCUMENT, ɵparseCookieValue } from '@angular/common';\nimport { Observable } from 'rxjs/Observable';\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 * Transforms an `HttpRequest` into a stream of `HttpEvent`s, one of which will likely be a\n * `HttpResponse`.\n *\n * `HttpHandler` is injectable. When injected, the handler instance dispatches requests to the\n * first interceptor in the chain, which dispatches to the second, etc, eventually reaching the\n * `HttpBackend`.\n *\n * In an `HttpInterceptor`, the `HttpHandler` parameter is the next interceptor in the chain.\n *\n * \\@experimental\n * @abstract\n */\nvar HttpHandler = (function () {\n function HttpHandler() {\n }\n /**\n * @abstract\n * @param {?} req\n * @return {?}\n */\n HttpHandler.prototype.handle = function (req) { };\n return HttpHandler;\n}());\n/**\n * A final `HttpHandler` which will dispatch the request via browser HTTP APIs to a backend.\n *\n * Interceptors sit between the `HttpClient` interface and the `HttpBackend`.\n *\n * When injected, `HttpBackend` dispatches requests directly to the backend, without going\n * through the interceptor chain.\n *\n * \\@experimental\n * @abstract\n */\nvar HttpBackend = (function () {\n function HttpBackend() {\n }\n /**\n * @abstract\n * @param {?} req\n * @return {?}\n */\n HttpBackend.prototype.handle = function (req) { };\n return HttpBackend;\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/**\n * A `HttpParameterCodec` that uses `encodeURIComponent` and `decodeURIComponent` to\n * serialize and parse URL parameter keys and values.\n *\n * \\@experimental\n */\nvar HttpUrlEncodingCodec = (function () {\n function HttpUrlEncodingCodec() {\n }\n /**\n * @param {?} k\n * @return {?}\n */\n HttpUrlEncodingCodec.prototype.encodeKey = function (k) { return standardEncoding(k); };\n /**\n * @param {?} v\n * @return {?}\n */\n HttpUrlEncodingCodec.prototype.encodeValue = function (v) { return standardEncoding(v); };\n /**\n * @param {?} k\n * @return {?}\n */\n HttpUrlEncodingCodec.prototype.decodeKey = function (k) { return decodeURIComponent(k); };\n /**\n * @param {?} v\n * @return {?}\n */\n HttpUrlEncodingCodec.prototype.decodeValue = function (v) { return decodeURIComponent(v); };\n return HttpUrlEncodingCodec;\n}());\n/**\n * @param {?} rawParams\n * @param {?} codec\n * @return {?}\n */\nfunction paramParser(rawParams, codec) {\n var /** @type {?} */ map$$1 = new Map();\n if (rawParams.length > 0) {\n var /** @type {?} */ params = rawParams.split('&');\n params.forEach(function (param) {\n var /** @type {?} */ eqIdx = param.indexOf('=');\n var _a = eqIdx == -1 ?\n [codec.decodeKey(param), ''] :\n [codec.decodeKey(param.slice(0, eqIdx)), codec.decodeValue(param.slice(eqIdx + 1))], key = _a[0], val = _a[1];\n var /** @type {?} */ list = map$$1.get(key) || [];\n list.push(val);\n map$$1.set(key, list);\n });\n }\n return map$$1;\n}\n/**\n * @param {?} v\n * @return {?}\n */\nfunction standardEncoding(v) {\n return encodeURIComponent(v)\n .replace(/%40/gi, '@')\n .replace(/%3A/gi, ':')\n .replace(/%24/gi, '$')\n .replace(/%2C/gi, ',')\n .replace(/%3B/gi, ';')\n .replace(/%2B/gi, '+')\n .replace(/%3D/gi, '=')\n .replace(/%3F/gi, '?')\n .replace(/%2F/gi, '/');\n}\n/**\n * An HTTP request/response body that represents serialized parameters,\n * per the MIME type `application/x-www-form-urlencoded`.\n *\n * This class is immuatable - all mutation operations return a new instance.\n *\n * \\@experimental\n */\nvar HttpParams = (function () {\n /**\n * @param {?=} options\n */\n function HttpParams(options) {\n if (options === void 0) { options = {}; }\n this.updates = null;\n this.cloneFrom = null;\n this.encoder = options.encoder || new HttpUrlEncodingCodec();\n this.map = !!options.fromString ? paramParser(options.fromString, this.encoder) : null;\n }\n /**\n * Check whether the body has one or more values for the given parameter name.\n * @param {?} param\n * @return {?}\n */\n HttpParams.prototype.has = function (param) {\n this.init();\n return ((this.map)).has(param);\n };\n /**\n * Get the first value for the given parameter name, or `null` if it's not present.\n * @param {?} param\n * @return {?}\n */\n HttpParams.prototype.get = function (param) {\n this.init();\n var /** @type {?} */ res = ((this.map)).get(param);\n return !!res ? res[0] : null;\n };\n /**\n * Get all values for the given parameter name, or `null` if it's not present.\n * @param {?} param\n * @return {?}\n */\n HttpParams.prototype.getAll = function (param) {\n this.init();\n return ((this.map)).get(param) || null;\n };\n /**\n * Get all the parameter names for this body.\n * @return {?}\n */\n HttpParams.prototype.keys = function () {\n this.init();\n return Array.from(/** @type {?} */ ((this.map)).keys());\n };\n /**\n * Construct a new body with an appended value for the given parameter name.\n * @param {?} param\n * @param {?} value\n * @return {?}\n */\n HttpParams.prototype.append = function (param, value) { return this.clone({ param: param, value: value, op: 'a' }); };\n /**\n * Construct a new body with a new value for the given parameter name.\n * @param {?} param\n * @param {?} value\n * @return {?}\n */\n HttpParams.prototype.set = function (param, value) { return this.clone({ param: param, value: value, op: 's' }); };\n /**\n * Construct a new body with either the given value for the given parameter\n * removed, if a value is given, or all values for the given parameter removed\n * if not.\n * @param {?} param\n * @param {?=} value\n * @return {?}\n */\n HttpParams.prototype.delete = function (param, value) { return this.clone({ param: param, value: value, op: 'd' }); };\n /**\n * Serialize the body to an encoded string, where key-value pairs (separated by `=`) are\n * separated by `&`s.\n * @return {?}\n */\n HttpParams.prototype.toString = function () {\n var _this = this;\n this.init();\n return this.keys()\n .map(function (key) {\n var /** @type {?} */ eKey = _this.encoder.encodeKey(key);\n return ((((_this.map)).get(key))).map(function (value) { return eKey + '=' + _this.encoder.encodeValue(value); })\n .join('&');\n })\n .join('&');\n };\n /**\n * @param {?} update\n * @return {?}\n */\n HttpParams.prototype.clone = function (update) {\n var /** @type {?} */ clone = new HttpParams({ encoder: this.encoder });\n clone.cloneFrom = this.cloneFrom || this;\n clone.updates = (this.updates || []).concat([update]);\n return clone;\n };\n /**\n * @return {?}\n */\n HttpParams.prototype.init = function () {\n var _this = this;\n if (this.map === null) {\n this.map = new Map();\n }\n if (this.cloneFrom !== null) {\n this.cloneFrom.init();\n this.cloneFrom.keys().forEach(function (key) { return ((_this.map)).set(key, /** @type {?} */ ((((((_this.cloneFrom)).map)).get(key)))); }); /** @type {?} */\n ((this.updates)).forEach(function (update) {\n switch (update.op) {\n case 'a':\n case 's':\n var /** @type {?} */ base = (update.op === 'a' ? ((_this.map)).get(update.param) : undefined) || [];\n base.push(/** @type {?} */ ((update.value))); /** @type {?} */\n ((_this.map)).set(update.param, base);\n break;\n case 'd':\n if (update.value !== undefined) {\n var /** @type {?} */ base_1 = ((_this.map)).get(update.param) || [];\n var /** @type {?} */ idx = base_1.indexOf(update.value);\n if (idx !== -1) {\n base_1.splice(idx, 1);\n }\n if (base_1.length > 0) {\n ((_this.map)).set(update.param, base_1);\n }\n else {\n ((_this.map)).delete(update.param);\n }\n }\n else {\n ((_this.map)).delete(update.param);\n break;\n }\n }\n });\n this.cloneFrom = null;\n }\n };\n return HttpParams;\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/**\n * Immutable set of Http headers, with lazy parsing.\n * \\@experimental\n */\nvar HttpHeaders = (function () {\n /**\n * @param {?=} headers\n */\n function HttpHeaders(headers) {\n var _this = this;\n /**\n * Internal map of lowercased header names to the normalized\n * form of the name (the form seen first).\n */\n this.normalizedNames = new Map();\n /**\n * Queued updates to be materialized the next initialization.\n */\n this.lazyUpdate = null;\n if (!headers) {\n this.headers = new Map();\n }\n else if (typeof headers === 'string') {\n this.lazyInit = function () {\n _this.headers = new Map();\n headers.split('\\n').forEach(function (line) {\n var index = line.indexOf(':');\n if (index > 0) {\n var name = line.slice(0, index);\n var key = name.toLowerCase();\n var value = line.slice(index + 1).trim();\n _this.maybeSetNormalizedName(name, key);\n if (_this.headers.has(key)) {\n _this.headers.get(key).push(value);\n }\n else {\n _this.headers.set(key, [value]);\n }\n }\n });\n };\n }\n else {\n this.lazyInit = function () {\n _this.headers = new Map();\n Object.keys(headers).forEach(function (name) {\n var values = headers[name];\n var key = name.toLowerCase();\n if (typeof values === 'string') {\n values = [values];\n }\n if (values.length > 0) {\n _this.headers.set(key, values);\n _this.maybeSetNormalizedName(name, key);\n }\n });\n };\n }\n }\n /**\n * Checks for existence of header by given name.\n * @param {?} name\n * @return {?}\n */\n HttpHeaders.prototype.has = function (name) {\n this.init();\n return this.headers.has(name.toLowerCase());\n };\n /**\n * Returns first header that matches given name.\n * @param {?} name\n * @return {?}\n */\n HttpHeaders.prototype.get = function (name) {\n this.init();\n var /** @type {?} */ values = this.headers.get(name.toLowerCase());\n return values && values.length > 0 ? values[0] : null;\n };\n /**\n * Returns the names of the headers\n * @return {?}\n */\n HttpHeaders.prototype.keys = function () {\n this.init();\n return Array.from(this.normalizedNames.values());\n };\n /**\n * Returns list of header values for a given name.\n * @param {?} name\n * @return {?}\n */\n HttpHeaders.prototype.getAll = function (name) {\n this.init();\n return this.headers.get(name.toLowerCase()) || null;\n };\n /**\n * @param {?} name\n * @param {?} value\n * @return {?}\n */\n HttpHeaders.prototype.append = function (name, value) {\n return this.clone({ name: name, value: value, op: 'a' });\n };\n /**\n * @param {?} name\n * @param {?} value\n * @return {?}\n */\n HttpHeaders.prototype.set = function (name, value) {\n return this.clone({ name: name, value: value, op: 's' });\n };\n /**\n * @param {?} name\n * @param {?=} value\n * @return {?}\n */\n HttpHeaders.prototype.delete = function (name, value) {\n return this.clone({ name: name, value: value, op: 'd' });\n };\n /**\n * @param {?} name\n * @param {?} lcName\n * @return {?}\n */\n HttpHeaders.prototype.maybeSetNormalizedName = function (name, lcName) {\n if (!this.normalizedNames.has(lcName)) {\n this.normalizedNames.set(lcName, name);\n }\n };\n /**\n * @return {?}\n */\n HttpHeaders.prototype.init = function () {\n var _this = this;\n if (!!this.lazyInit) {\n if (this.lazyInit instanceof HttpHeaders) {\n this.copyFrom(this.lazyInit);\n }\n else {\n this.lazyInit();\n }\n this.lazyInit = null;\n if (!!this.lazyUpdate) {\n this.lazyUpdate.forEach(function (update) { return _this.applyUpdate(update); });\n this.lazyUpdate = null;\n }\n }\n };\n /**\n * @param {?} other\n * @return {?}\n */\n HttpHeaders.prototype.copyFrom = function (other) {\n var _this = this;\n other.init();\n Array.from(other.headers.keys()).forEach(function (key) {\n _this.headers.set(key, /** @type {?} */ ((other.headers.get(key))));\n _this.normalizedNames.set(key, /** @type {?} */ ((other.normalizedNames.get(key))));\n });\n };\n /**\n * @param {?} update\n * @return {?}\n */\n HttpHeaders.prototype.clone = function (update) {\n var /** @type {?} */ clone = new HttpHeaders();\n clone.lazyInit =\n (!!this.lazyInit && this.lazyInit instanceof HttpHeaders) ? this.lazyInit : this;\n clone.lazyUpdate = (this.lazyUpdate || []).concat([update]);\n return clone;\n };\n /**\n * @param {?} update\n * @return {?}\n */\n HttpHeaders.prototype.applyUpdate = function (update) {\n var /** @type {?} */ key = update.name.toLowerCase();\n switch (update.op) {\n case 'a':\n case 's':\n var /** @type {?} */ value = ((update.value));\n if (typeof value === 'string') {\n value = [value];\n }\n if (value.length === 0) {\n return;\n }\n this.maybeSetNormalizedName(update.name, key);\n var /** @type {?} */ base = (update.op === 'a' ? this.headers.get(key) : undefined) || [];\n base.push.apply(base, value);\n this.headers.set(key, base);\n break;\n case 'd':\n var /** @type {?} */ toDelete_1 = (update.value);\n if (!toDelete_1) {\n this.headers.delete(key);\n this.normalizedNames.delete(key);\n }\n else {\n var /** @type {?} */ existing = this.headers.get(key);\n if (!existing) {\n return;\n }\n existing = existing.filter(function (value) { return toDelete_1.indexOf(value) === -1; });\n if (existing.length === 0) {\n this.headers.delete(key);\n this.normalizedNames.delete(key);\n }\n else {\n this.headers.set(key, existing);\n }\n }\n break;\n }\n };\n /**\n * \\@internal\n * @param {?} fn\n * @return {?}\n */\n HttpHeaders.prototype.forEach = function (fn) {\n var _this = this;\n this.init();\n Array.from(this.normalizedNames.keys())\n .forEach(function (key) { return fn(/** @type {?} */ ((_this.normalizedNames.get(key))), /** @type {?} */ ((_this.headers.get(key)))); });\n };\n return HttpHeaders;\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/**\n * Determine whether the given HTTP method may include a body.\n * @param {?} method\n * @return {?}\n */\nfunction mightHaveBody(method) {\n switch (method) {\n case 'DELETE':\n case 'GET':\n case 'HEAD':\n case 'OPTIONS':\n case 'JSONP':\n return false;\n default:\n return true;\n }\n}\n/**\n * Safely assert whether the given value is an ArrayBuffer.\n *\n * In some execution environments ArrayBuffer is not defined.\n * @param {?} value\n * @return {?}\n */\nfunction isArrayBuffer(value) {\n return typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer;\n}\n/**\n * Safely assert whether the given value is a Blob.\n *\n * In some execution environments Blob is not defined.\n * @param {?} value\n * @return {?}\n */\nfunction isBlob(value) {\n return typeof Blob !== 'undefined' && value instanceof Blob;\n}\n/**\n * Safely assert whether the given value is a FormData instance.\n *\n * In some execution environments FormData is not defined.\n * @param {?} value\n * @return {?}\n */\nfunction isFormData(value) {\n return typeof FormData !== 'undefined' && value instanceof FormData;\n}\n/**\n * An outgoing HTTP request with an optional typed body.\n *\n * `HttpRequest` represents an outgoing request, including URL, method,\n * headers, body, and other request configuration options. Instances should be\n * assumed to be immutable. To modify a `HttpRequest`, the `clone`\n * method should be used.\n *\n * \\@experimental\n */\nvar HttpRequest = (function () {\n /**\n * @param {?} method\n * @param {?} url\n * @param {?=} third\n * @param {?=} fourth\n */\n function HttpRequest(method, url, third, fourth) {\n this.url = url;\n /**\n * The request body, or `null` if one isn't set.\n *\n * Bodies are not enforced to be immutable, as they can include a reference to any\n * user-defined data type. However, interceptors should take care to preserve\n * idempotence by treating them as such.\n */\n this.body = null;\n /**\n * Whether this request should be made in a way that exposes progress events.\n *\n * Progress events are expensive (change detection runs on each event) and so\n * they should only be requested if the consumer intends to monitor them.\n */\n this.reportProgress = false;\n /**\n * Whether this request should be sent with outgoing credentials (cookies).\n */\n this.withCredentials = false;\n /**\n * The expected response type of the server.\n *\n * This is used to parse the response appropriately before returning it to\n * the requestee.\n */\n this.responseType = 'json';\n this.method = method.toUpperCase();\n // Next, need to figure out which argument holds the HttpRequestInit\n // options, if any.\n var options;\n // Check whether a body argument is expected. The only valid way to omit\n // the body argument is to use a known no-body method like GET.\n if (mightHaveBody(this.method) || !!fourth) {\n // Body is the third argument, options are the fourth.\n this.body = third || null;\n options = fourth;\n }\n else {\n // No body required, options are the third argument. The body stays null.\n options = third;\n }\n // If options have been passed, interpret them.\n if (options) {\n // Normalize reportProgress and withCredentials.\n this.reportProgress = !!options.reportProgress;\n this.withCredentials = !!options.withCredentials;\n // Override default response type of 'json' if one is provided.\n if (!!options.responseType) {\n this.responseType = options.responseType;\n }\n // Override headers if they're provided.\n if (!!options.headers) {\n this.headers = options.headers;\n }\n if (!!options.params) {\n this.params = options.params;\n }\n }\n // If no headers have been passed in, construct a new HttpHeaders instance.\n if (!this.headers) {\n this.headers = new HttpHeaders();\n }\n // If no parameters have been passed in, construct a new HttpUrlEncodedParams instance.\n if (!this.params) {\n this.params = new HttpParams();\n this.urlWithParams = url;\n }\n else {\n // Encode the parameters to a string in preparation for inclusion in the URL.\n var params = this.params.toString();\n if (params.length === 0) {\n // No parameters, the visible URL is just the URL given at creation time.\n this.urlWithParams = url;\n }\n else {\n // Does the URL already have query parameters? Look for '?'.\n var qIdx = url.indexOf('?');\n // There are 3 cases to handle:\n // 1) No existing parameters -> append '?' followed by params.\n // 2) '?' exists and is followed by existing query string ->\n // append '&' followed by params.\n // 3) '?' exists at the end of the url -> append params directly.\n // This basically amounts to determining the character, if any, with\n // which to join the URL and parameters.\n var sep = qIdx === -1 ? '?' : (qIdx < url.length - 1 ? '&' : '');\n this.urlWithParams = url + sep + params;\n }\n }\n }\n /**\n * Transform the free-form body into a serialized format suitable for\n * transmission to the server.\n * @return {?}\n */\n HttpRequest.prototype.serializeBody = function () {\n // If no body is present, no need to serialize it.\n if (this.body === null) {\n return null;\n }\n // Check whether the body is already in a serialized form. If so,\n // it can just be returned directly.\n if (isArrayBuffer(this.body) || isBlob(this.body) || isFormData(this.body) ||\n typeof this.body === 'string') {\n return this.body;\n }\n // Check whether the body is an instance of HttpUrlEncodedParams.\n if (this.body instanceof HttpParams) {\n return this.body.toString();\n }\n // Check whether the body is an object or array, and serialize with JSON if so.\n if (typeof this.body === 'object' || typeof this.body === 'boolean' ||\n Array.isArray(this.body)) {\n return JSON.stringify(this.body);\n }\n // Fall back on toString() for everything else.\n return ((this.body)).toString();\n };\n /**\n * Examine the body and attempt to infer an appropriate MIME type\n * for it.\n *\n * If no such type can be inferred, this method will return `null`.\n * @return {?}\n */\n HttpRequest.prototype.detectContentTypeHeader = function () {\n // An empty body has no content type.\n if (this.body === null) {\n return null;\n }\n // FormData bodies rely on the browser's content type assignment.\n if (isFormData(this.body)) {\n return null;\n }\n // Blobs usually have their own content type. If it doesn't, then\n // no type can be inferred.\n if (isBlob(this.body)) {\n return this.body.type || null;\n }\n // Array buffers have unknown contents and thus no type can be inferred.\n if (isArrayBuffer(this.body)) {\n return null;\n }\n // Technically, strings could be a form of JSON data, but it's safe enough\n // to assume they're plain strings.\n if (typeof this.body === 'string') {\n return 'text/plain';\n }\n // `HttpUrlEncodedParams` has its own content-type.\n if (this.body instanceof HttpParams) {\n return 'application/x-www-form-urlencoded;charset=UTF-8';\n }\n // Arrays, objects, and numbers will be encoded as JSON.\n if (typeof this.body === 'object' || typeof this.body === 'number' ||\n Array.isArray(this.body)) {\n return 'application/json';\n }\n // No type could be inferred.\n return null;\n };\n /**\n * @param {?=} update\n * @return {?}\n */\n HttpRequest.prototype.clone = function (update) {\n if (update === void 0) { update = {}; }\n // For method, url, and responseType, take the current value unless\n // it is overridden in the update hash.\n var /** @type {?} */ method = update.method || this.method;\n var /** @type {?} */ url = update.url || this.url;\n var /** @type {?} */ responseType = update.responseType || this.responseType;\n // The body is somewhat special - a `null` value in update.body means\n // whatever current body is present is being overridden with an empty\n // body, whereas an `undefined` value in update.body implies no\n // override.\n var /** @type {?} */ body = (update.body !== undefined) ? update.body : this.body;\n // Carefully handle the boolean options to differentiate between\n // `false` and `undefined` in the update args.\n var /** @type {?} */ withCredentials = (update.withCredentials !== undefined) ? update.withCredentials : this.withCredentials;\n var /** @type {?} */ reportProgress = (update.reportProgress !== undefined) ? update.reportProgress : this.reportProgress;\n // Headers and params may be appended to if `setHeaders` or\n // `setParams` are used.\n var /** @type {?} */ headers = update.headers || this.headers;\n var /** @type {?} */ params = update.params || this.params;\n // Check whether the caller has asked to add headers.\n if (update.setHeaders !== undefined) {\n // Set every requested header.\n headers =\n Object.keys(update.setHeaders)\n .reduce(function (headers, name) { return headers.set(name, /** @type {?} */ ((update.setHeaders))[name]); }, headers);\n }\n // Check whether the caller has asked to set params.\n if (update.setParams) {\n // Set every requested param.\n params = Object.keys(update.setParams)\n .reduce(function (params, param) { return params.set(param, /** @type {?} */ ((update.setParams))[param]); }, params);\n }\n // Finally, construct the new HttpRequest using the pieces from above.\n return new HttpRequest(method, url, body, {\n params: params, headers: headers, reportProgress: reportProgress, responseType: responseType, withCredentials: withCredentials,\n });\n };\n return HttpRequest;\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 */\nvar HttpEventType = {};\nHttpEventType.Sent = 0;\nHttpEventType.UploadProgress = 1;\nHttpEventType.ResponseHeader = 2;\nHttpEventType.DownloadProgress = 3;\nHttpEventType.Response = 4;\nHttpEventType.User = 5;\nHttpEventType[HttpEventType.Sent] = \"Sent\";\nHttpEventType[HttpEventType.UploadProgress] = \"UploadProgress\";\nHttpEventType[HttpEventType.ResponseHeader] = \"ResponseHeader\";\nHttpEventType[HttpEventType.DownloadProgress] = \"DownloadProgress\";\nHttpEventType[HttpEventType.Response] = \"Response\";\nHttpEventType[HttpEventType.User] = \"User\";\n/**\n * Base class for both `HttpResponse` and `HttpHeaderResponse`.\n *\n * \\@experimental\n * @abstract\n */\nvar HttpResponseBase = (function () {\n /**\n * Super-constructor for all responses.\n *\n * The single parameter accepted is an initialization hash. Any properties\n * of the response passed there will override the default values.\n * @param {?} init\n * @param {?=} defaultStatus\n * @param {?=} defaultStatusText\n */\n function HttpResponseBase(init, defaultStatus, defaultStatusText) {\n if (defaultStatus === void 0) { defaultStatus = 200; }\n if (defaultStatusText === void 0) { defaultStatusText = 'OK'; }\n // If the hash has values passed, use them to initialize the response.\n // Otherwise use the default values.\n this.headers = init.headers || new HttpHeaders();\n this.status = init.status !== undefined ? init.status : defaultStatus;\n this.statusText = init.statusText || defaultStatusText;\n this.url = init.url || null;\n // Cache the ok value to avoid defining a getter.\n this.ok = this.status >= 200 && this.status < 300;\n }\n return HttpResponseBase;\n}());\n/**\n * A partial HTTP response which only includes the status and header data,\n * but no response body.\n *\n * `HttpHeaderResponse` is a `HttpEvent` available on the response\n * event stream, only when progress events are requested.\n *\n * \\@experimental\n */\nvar HttpHeaderResponse = (function (_super) {\n tslib_1.__extends(HttpHeaderResponse, _super);\n /**\n * Create a new `HttpHeaderResponse` with the given parameters.\n * @param {?=} init\n */\n function HttpHeaderResponse(init) {\n if (init === void 0) { init = {}; }\n var _this = _super.call(this, init) || this;\n _this.type = HttpEventType.ResponseHeader;\n return _this;\n }\n /**\n * Copy this `HttpHeaderResponse`, overriding its contents with the\n * given parameter hash.\n * @param {?=} update\n * @return {?}\n */\n HttpHeaderResponse.prototype.clone = function (update) {\n if (update === void 0) { update = {}; }\n // Perform a straightforward initialization of the new HttpHeaderResponse,\n // overriding the current parameters with new ones if given.\n return new HttpHeaderResponse({\n headers: update.headers || this.headers,\n status: update.status !== undefined ? update.status : this.status,\n statusText: update.statusText || this.statusText,\n url: update.url || this.url || undefined,\n });\n };\n return HttpHeaderResponse;\n}(HttpResponseBase));\n/**\n * A full HTTP response, including a typed response body (which may be `null`\n * if one was not returned).\n *\n * `HttpResponse` is a `HttpEvent` available on the response event\n * stream.\n *\n * \\@experimental\n */\nvar HttpResponse = (function (_super) {\n tslib_1.__extends(HttpResponse, _super);\n /**\n * Construct a new `HttpResponse`.\n * @param {?=} init\n */\n function HttpResponse(init) {\n if (init === void 0) { init = {}; }\n var _this = _super.call(this, init) || this;\n _this.type = HttpEventType.Response;\n _this.body = init.body || null;\n return _this;\n }\n /**\n * @param {?=} update\n * @return {?}\n */\n HttpResponse.prototype.clone = function (update) {\n if (update === void 0) { update = {}; }\n return new HttpResponse({\n body: (update.body !== undefined) ? update.body : this.body,\n headers: update.headers || this.headers,\n status: (update.status !== undefined) ? update.status : this.status,\n statusText: update.statusText || this.statusText,\n url: update.url || this.url || undefined,\n });\n };\n return HttpResponse;\n}(HttpResponseBase));\n/**\n * A response that represents an error or failure, either from a\n * non-successful HTTP status, an error while executing the request,\n * or some other failure which occurred during the parsing of the response.\n *\n * Any error returned on the `Observable` response stream will be\n * wrapped in an `HttpErrorResponse` to provide additional context about\n * the state of the HTTP layer when the error occurred. The error property\n * will contain either a wrapped Error object or the error response returned\n * from the server.\n *\n * \\@experimental\n */\nvar HttpErrorResponse = (function (_super) {\n tslib_1.__extends(HttpErrorResponse, _super);\n /**\n * @param {?} init\n */\n function HttpErrorResponse(init) {\n var _this = \n // Initialize with a default status of 0 / Unknown Error.\n _super.call(this, init, 0, 'Unknown Error') || this;\n _this.name = 'HttpErrorResponse';\n /**\n * Errors are never okay, even when the status code is in the 2xx success range.\n */\n _this.ok = false;\n // If the response was successful, then this was a parse error. Otherwise, it was\n // a protocol-level failure of some sort. Either the request failed in transit\n // or the server returned an unsuccessful status code.\n if (_this.status >= 200 && _this.status < 300) {\n _this.message = \"Http failure during parsing for \" + (init.url || '(unknown url)');\n }\n else {\n _this.message =\n \"Http failure response for \" + (init.url || '(unknown url)') + \": \" + init.status + \" \" + init.statusText;\n }\n _this.error = init.error || null;\n return _this;\n }\n return HttpErrorResponse;\n}(HttpResponseBase));\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 * Construct an instance of `HttpRequestOptions` from a source `HttpMethodOptions` and\n * the given `body`. Basically, this clones the object and adds the body.\n * @template T\n * @param {?} options\n * @param {?} body\n * @return {?}\n */\nfunction addBody(options, body) {\n return {\n body: body,\n headers: options.headers,\n observe: options.observe,\n params: options.params,\n reportProgress: options.reportProgress,\n responseType: options.responseType,\n withCredentials: options.withCredentials,\n };\n}\n/**\n * Perform HTTP requests.\n *\n * `HttpClient` is available as an injectable class, with methods to perform HTTP requests.\n * Each request method has multiple signatures, and the return type varies according to which\n * signature is called (mainly the values of `observe` and `responseType`).\n *\n * \\@experimental\n */\nvar HttpClient = (function () {\n /**\n * @param {?} handler\n */\n function HttpClient(handler) {\n this.handler = handler;\n }\n /**\n * Constructs an `Observable` for a particular HTTP request that, when subscribed,\n * fires the request through the chain of registered interceptors and on to the\n * server.\n *\n * This method can be called in one of two ways. Either an `HttpRequest`\n * instance can be passed directly as the only parameter, or a method can be\n * passed as the first parameter, a string URL as the second, and an\n * options hash as the third.\n *\n * If a `HttpRequest` object is passed directly, an `Observable` of the\n * raw `HttpEvent` stream will be returned.\n *\n * If a request is instead built by providing a URL, the options object\n * determines the return type of `request()`. In addition to configuring\n * request parameters such as the outgoing headers and/or the body, the options\n * hash specifies two key pieces of information about the request: the\n * `responseType` and what to `observe`.\n *\n * The `responseType` value determines how a successful response body will be\n * parsed. If `responseType` is the default `json`, a type interface for the\n * resulting object may be passed as a type parameter to `request()`.\n *\n * The `observe` value determines the return type of `request()`, based on what\n * the consumer is interested in observing. A value of `events` will return an\n * `Observable` representing the raw `HttpEvent` stream,\n * including progress events by default. A value of `response` will return an\n * `Observable>` where the `T` parameter of `HttpResponse`\n * depends on the `responseType` and any optionally provided type parameter.\n * A value of `body` will return an `Observable` with the same `T` body type.\n * @param {?} first\n * @param {?=} url\n * @param {?=} options\n * @return {?}\n */\n HttpClient.prototype.request = function (first, url, options) {\n var _this = this;\n if (options === void 0) { options = {}; }\n var /** @type {?} */ req;\n // Firstly, check whether the primary argument is an instance of `HttpRequest`.\n if (first instanceof HttpRequest) {\n // It is. The other arguments must be undefined (per the signatures) and can be\n // ignored.\n req = (first);\n }\n else {\n // It's a string, so it represents a URL. Construct a request based on it,\n // and incorporate the remaining arguments (assuming GET unless a method is\n // provided.\n req = new HttpRequest(first, /** @type {?} */ ((url)), options.body || null, {\n headers: options.headers,\n params: options.params,\n reportProgress: options.reportProgress,\n // By default, JSON is assumed to be returned for all calls.\n responseType: options.responseType || 'json',\n withCredentials: options.withCredentials,\n });\n }\n // Start with an Observable.of() the initial request, and run the handler (which\n // includes all interceptors) inside a concatMap(). This way, the handler runs\n // inside an Observable chain, which causes interceptors to be re-run on every\n // subscription (this also makes retries re-run the handler, including interceptors).\n var /** @type {?} */ events$ = concatMap.call(of(req), function (req) { return _this.handler.handle(req); });\n // If coming via the API signature which accepts a previously constructed HttpRequest,\n // the only option is to get the event stream. Otherwise, return the event stream if\n // that is what was requested.\n if (first instanceof HttpRequest || options.observe === 'events') {\n return events$;\n }\n // The requested stream contains either the full response or the body. In either\n // case, the first step is to filter the event stream to extract a stream of\n // responses(s).\n var /** @type {?} */ res$ = filter.call(events$, function (event) { return event instanceof HttpResponse; });\n // Decide which stream to return.\n switch (options.observe || 'body') {\n case 'body':\n // The requested stream is the body. Map the response stream to the response\n // body. This could be done more simply, but a misbehaving interceptor might\n // transform the response body into a different format and ignore the requested\n // responseType. Guard against this by validating that the response is of the\n // requested type.\n switch (req.responseType) {\n case 'arraybuffer':\n return map.call(res$, function (res) {\n // Validate that the body is an ArrayBuffer.\n if (res.body !== null && !(res.body instanceof ArrayBuffer)) {\n throw new Error('Response is not an ArrayBuffer.');\n }\n return res.body;\n });\n case 'blob':\n return map.call(res$, function (res) {\n // Validate that the body is a Blob.\n if (res.body !== null && !(res.body instanceof Blob)) {\n throw new Error('Response is not a Blob.');\n }\n return res.body;\n });\n case 'text':\n return map.call(res$, function (res) {\n // Validate that the body is a string.\n if (res.body !== null && typeof res.body !== 'string') {\n throw new Error('Response is not a string.');\n }\n return res.body;\n });\n case 'json':\n default:\n // No validation needed for JSON responses, as they can be of any type.\n return map.call(res$, function (res) { return res.body; });\n }\n case 'response':\n // The response stream was requested directly, so return it.\n return res$;\n default:\n // Guard against new future observe types being added.\n throw new Error(\"Unreachable: unhandled observe type \" + options.observe + \"}\");\n }\n };\n /**\n * Constructs an `Observable` which, when subscribed, will cause the configured\n * DELETE request to be executed on the server. See the individual overloads for\n * details of `delete()`'s return type based on the provided options.\n * @param {?} url\n * @param {?=} options\n * @return {?}\n */\n HttpClient.prototype.delete = function (url, options) {\n if (options === void 0) { options = {}; }\n return this.request('DELETE', url, /** @type {?} */ (options));\n };\n /**\n * Constructs an `Observable` which, when subscribed, will cause the configured\n * GET request to be executed on the server. See the individual overloads for\n * details of `get()`'s return type based on the provided options.\n * @param {?} url\n * @param {?=} options\n * @return {?}\n */\n HttpClient.prototype.get = function (url, options) {\n if (options === void 0) { options = {}; }\n return this.request('GET', url, /** @type {?} */ (options));\n };\n /**\n * Constructs an `Observable` which, when subscribed, will cause the configured\n * HEAD request to be executed on the server. See the individual overloads for\n * details of `head()`'s return type based on the provided options.\n * @param {?} url\n * @param {?=} options\n * @return {?}\n */\n HttpClient.prototype.head = function (url, options) {\n if (options === void 0) { options = {}; }\n return this.request('HEAD', url, /** @type {?} */ (options));\n };\n /**\n * Constructs an `Observable` which, when subscribed, will cause a request\n * with the special method `JSONP` to be dispatched via the interceptor pipeline.\n *\n * A suitable interceptor must be installed (e.g. via the `HttpClientJsonpModule`).\n * If no such interceptor is reached, then the `JSONP` request will likely be\n * rejected by the configured backend.\n * @template T\n * @param {?} url\n * @param {?} callbackParam\n * @return {?}\n */\n HttpClient.prototype.jsonp = function (url, callbackParam) {\n return this.request('JSONP', url, {\n params: new HttpParams().append(callbackParam, 'JSONP_CALLBACK'),\n observe: 'body',\n responseType: 'json',\n });\n };\n /**\n * Constructs an `Observable` which, when subscribed, will cause the configured\n * OPTIONS request to be executed on the server. See the individual overloads for\n * details of `options()`'s return type based on the provided options.\n * @param {?} url\n * @param {?=} options\n * @return {?}\n */\n HttpClient.prototype.options = function (url, options) {\n if (options === void 0) { options = {}; }\n return this.request('OPTIONS', url, /** @type {?} */ (options));\n };\n /**\n * Constructs an `Observable` which, when subscribed, will cause the configured\n * PATCH request to be executed on the server. See the individual overloads for\n * details of `patch()`'s return type based on the provided options.\n * @param {?} url\n * @param {?} body\n * @param {?=} options\n * @return {?}\n */\n HttpClient.prototype.patch = function (url, body, options) {\n if (options === void 0) { options = {}; }\n return this.request('PATCH', url, addBody(options, body));\n };\n /**\n * Constructs an `Observable` which, when subscribed, will cause the configured\n * POST request to be executed on the server. See the individual overloads for\n * details of `post()`'s return type based on the provided options.\n * @param {?} url\n * @param {?} body\n * @param {?=} options\n * @return {?}\n */\n HttpClient.prototype.post = function (url, body, options) {\n if (options === void 0) { options = {}; }\n return this.request('POST', url, addBody(options, body));\n };\n /**\n * Constructs an `Observable` which, when subscribed, will cause the configured\n * POST request to be executed on the server. See the individual overloads for\n * details of `post()`'s return type based on the provided options.\n * @param {?} url\n * @param {?} body\n * @param {?=} options\n * @return {?}\n */\n HttpClient.prototype.put = function (url, body, options) {\n if (options === void 0) { options = {}; }\n return this.request('PUT', url, addBody(options, body));\n };\n return HttpClient;\n}());\nHttpClient.decorators = [\n { type: Injectable },\n];\n/**\n * @nocollapse\n */\nHttpClient.ctorParameters = function () { return [\n { type: HttpHandler, },\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/**\n * `HttpHandler` which applies an `HttpInterceptor` to an `HttpRequest`.\n *\n * \\@experimental\n */\nvar HttpInterceptorHandler = (function () {\n /**\n * @param {?} next\n * @param {?} interceptor\n */\n function HttpInterceptorHandler(next, interceptor) {\n this.next = next;\n this.interceptor = interceptor;\n }\n /**\n * @param {?} req\n * @return {?}\n */\n HttpInterceptorHandler.prototype.handle = function (req) {\n return this.interceptor.intercept(req, this.next);\n };\n return HttpInterceptorHandler;\n}());\n/**\n * A multi-provider token which represents the array of `HttpInterceptor`s that\n * are registered.\n *\n * \\@experimental\n */\nvar HTTP_INTERCEPTORS = new InjectionToken('HTTP_INTERCEPTORS');\nvar NoopInterceptor = (function () {\n function NoopInterceptor() {\n }\n /**\n * @param {?} req\n * @param {?} next\n * @return {?}\n */\n NoopInterceptor.prototype.intercept = function (req, next) {\n return next.handle(req);\n };\n return NoopInterceptor;\n}());\nNoopInterceptor.decorators = [\n { type: Injectable },\n];\n/**\n * @nocollapse\n */\nNoopInterceptor.ctorParameters = function () { return []; };\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// Every request made through JSONP needs a callback name that's unique across the\n// whole page. Each request is assigned an id and the callback name is constructed\n// from that. The next id to be assigned is tracked in a global variable here that\n// is shared among all applications on the page.\nvar nextRequestId = 0;\n// Error text given when a JSONP script is injected, but doesn't invoke the callback\n// passed in its URL.\nvar JSONP_ERR_NO_CALLBACK = 'JSONP injected script did not invoke callback.';\n// Error text given when a request is passed to the JsonpClientBackend that doesn't\n// have a request method JSONP.\nvar JSONP_ERR_WRONG_METHOD = 'JSONP requests must use JSONP request method.';\nvar JSONP_ERR_WRONG_RESPONSE_TYPE = 'JSONP requests must use Json response type.';\n/**\n * DI token/abstract type representing a map of JSONP callbacks.\n *\n * In the browser, this should always be the `window` object.\n *\n * \\@experimental\n * @abstract\n */\nvar JsonpCallbackContext = (function () {\n function JsonpCallbackContext() {\n }\n return JsonpCallbackContext;\n}());\n/**\n * `HttpBackend` that only processes `HttpRequest` with the JSONP method,\n * by performing JSONP style requests.\n *\n * \\@experimental\n */\nvar JsonpClientBackend = (function () {\n /**\n * @param {?} callbackMap\n * @param {?} document\n */\n function JsonpClientBackend(callbackMap, document) {\n this.callbackMap = callbackMap;\n this.document = document;\n }\n /**\n * Get the name of the next callback method, by incrementing the global `nextRequestId`.\n * @return {?}\n */\n JsonpClientBackend.prototype.nextCallback = function () { return \"ng_jsonp_callback_\" + nextRequestId++; };\n /**\n * Process a JSONP request and return an event stream of the results.\n * @param {?} req\n * @return {?}\n */\n JsonpClientBackend.prototype.handle = function (req) {\n var _this = this;\n // Firstly, check both the method and response type. If either doesn't match\n // then the request was improperly routed here and cannot be handled.\n if (req.method !== 'JSONP') {\n throw new Error(JSONP_ERR_WRONG_METHOD);\n }\n else if (req.responseType !== 'json') {\n throw new Error(JSONP_ERR_WRONG_RESPONSE_TYPE);\n }\n // Everything else happens inside the Observable boundary.\n return new Observable(function (observer) {\n // The first step to make a request is to generate the callback name, and replace the\n // callback placeholder in the URL with the name. Care has to be taken here to ensure\n // a trailing &, if matched, gets inserted back into the URL in the correct place.\n var /** @type {?} */ callback = _this.nextCallback();\n var /** @type {?} */ url = req.urlWithParams.replace(/=JSONP_CALLBACK(&|$)/, \"=\" + callback + \"$1\");\n // Construct the