import * as import0 from '../../../../../../tmp/app/shared/components/home/home.component';
import * as import1 from '@angular/core/src/linker/view';
import * as import3 from '@angular/core/src/linker/element';
import * as import4 from '@angular/core/src/linker/view_utils';
import * as import6 from '@angular/core/src/linker/view_type';
import * as import7 from '@angular/core/src/change_detection/change_detection';
import * as import8 from '@angular/core/src/metadata/view';
import * as import9 from '@angular/core/src/linker/component_factory';
import * as import10 from './home.component.css.shim';
import * as import11 from '@angular/core/src/animation/animation_transition';
import * as import12 from '@angular/core/src/animation/animation_style_util';
import * as import13 from '@angular/core/src/animation/animation_sequence_player';
import * as import14 from '@angular/core/src/animation/animation_styles';
import * as import15 from '@angular/core/src/animation/animation_keyframe';
import * as import16 from '@angular/core/src/animation/animation_player';
import * as import17 from '../../../../../node_modules/@angular/common/src/directives/ng_class.ngfactory';
import * as import18 from '@angular/core/src/change_detection/differs/iterable_differs';
import * as import19 from '@angular/core/src/change_detection/differs/keyvalue_differs';
import * as import20 from '@angular/core/src/linker/element_ref';
import * as import21 from '@angular/common/src/directives/ng_class';
export class Wrapper_HomeComponent {
    constructor() {
        this.changed = false;
        this.context = new import0.HomeComponent();
    }
    detectChangesInInputProps(view, el, throwOnChange) {
        var changed = this.changed;
        this.changed = false;
        return changed;
    }
    detectChangesInHostProps(view, el, throwOnChange) {
    }
}
var renderType_HomeComponent_Host = null;
class _View_HomeComponent_Host0 extends import1.AppView {
    constructor(viewUtils, parentInjector, declarationEl) {
        super(_View_HomeComponent_Host0, renderType_HomeComponent_Host, import6.ViewType.HOST, viewUtils, parentInjector, declarationEl, import7.ChangeDetectorStatus.CheckAlways);
    }
    createInternal(rootSelector) {
        this._el_0 = import4.selectOrCreateRenderHostElement(this.renderer, 'my-app-home', import4.EMPTY_INLINE_ARRAY, rootSelector, null);
        this._appEl_0 = new import3.AppElement(0, null, this, this._el_0);
        var compView_0 = viewFactory_HomeComponent0(this.viewUtils, this.injector(0), this._appEl_0);
        this._HomeComponent_0_4 = new Wrapper_HomeComponent();
        this._appEl_0.initComponent(this._HomeComponent_0_4.context, [], compView_0);
        compView_0.create(this._HomeComponent_0_4.context, this.projectableNodes, null);
        this.init([].concat([this._el_0]), [this._el_0], [], []);
        return this._appEl_0;
    }
    injectorGetInternal(token, requestNodeIndex, notFoundResult) {
        if (((token === import0.HomeComponent) && (0 === requestNodeIndex))) {
            return this._HomeComponent_0_4.context;
        }
        return notFoundResult;
    }
    detectChangesInternal(throwOnChange) {
        this._HomeComponent_0_4.detectChangesInInputProps(this, this._el_0, throwOnChange);
        this.detectContentChildrenChanges(throwOnChange);
        this._HomeComponent_0_4.detectChangesInHostProps(this, this._el_0, throwOnChange);
        this.detectViewChildrenChanges(throwOnChange);
    }
    destroyInternal() {
        this._HomeComponent_0_4.context.ngOnDestroy();
    }
}
function viewFactory_HomeComponent_Host0(viewUtils, parentInjector, declarationEl) {
    if ((renderType_HomeComponent_Host === null)) {
        (renderType_HomeComponent_Host = viewUtils.createRenderComponentType('', 0, import8.ViewEncapsulation.None, [], {}));
    }
    return new _View_HomeComponent_Host0(viewUtils, parentInjector, declarationEl);
}
export const HomeComponentNgFactory = new import9.ComponentFactory('my-app-home', viewFactory_HomeComponent_Host0, import0.HomeComponent);
const styles_HomeComponent = [import10.styles];
var HomeComponent_intro_states = {
    void: {
        opacity: '0.0',
        transform: 'translateZ(-1000px)'
    },
    active: {
        opacity: '1.0',
        transform: 'translateZ(0px)',
        perspective: '1000px'
    },
    inactive: {
        opacity: '0.0',
        transform: 'translateZ(-1000px)',
        perspective: '1000px'
    },
    '*': {}
};
function HomeComponent_intro_factory(view, element, currentState, nextState) {
    view.animationContext.cancelActiveAnimation(element, 'intro', (nextState == 'void'));
    var collectedStyles = {};
    var player = null;
    var totalTime = 0;
    var defaultStateStyles = HomeComponent_intro_states['*'];
    var startStateStyles = HomeComponent_intro_states[currentState];
    if ((startStateStyles == null)) {
        (startStateStyles = defaultStateStyles);
    }
    var endStateStyles = HomeComponent_intro_states[nextState];
    if ((endStateStyles == null)) {
        (endStateStyles = defaultStateStyles);
    }
    import12.renderStyles(element, view.renderer, import12.clearStyles(startStateStyles));
    if (((player == null) && ((currentState == 'active') && (nextState == 'void')))) {
        player = new import13.AnimationSequencePlayer([view.renderer.animate(element, new import14.AnimationStyles(import12.collectAndResolveStyles(collectedStyles, [startStateStyles])), import12.balanceAnimationKeyframes(collectedStyles, endStateStyles, [
                new import15.AnimationKeyframe(0, new import14.AnimationStyles(import12.collectAndResolveStyles(collectedStyles, [{}]))),
                new import15.AnimationKeyframe(1, new import14.AnimationStyles(import12.collectAndResolveStyles(collectedStyles, [{}])))
            ]), 5000, 0, 'cubic-bezier(0.19, 1, 0.22, 1)')]);
        totalTime = 5000;
    }
    if (((player == null) && ((currentState == 'void') && (nextState == 'active')))) {
        player = new import13.AnimationSequencePlayer([view.renderer.animate(element, new import14.AnimationStyles(import12.collectAndResolveStyles(collectedStyles, [startStateStyles])), import12.balanceAnimationKeyframes(collectedStyles, endStateStyles, [
                new import15.AnimationKeyframe(0, new import14.AnimationStyles(import12.collectAndResolveStyles(collectedStyles, [{}]))),
                new import15.AnimationKeyframe(1, new import14.AnimationStyles(import12.collectAndResolveStyles(collectedStyles, [{}])))
            ]), 5000, 0, 'cubic-bezier(0.19, 1, 0.22, 1)')]);
        totalTime = 5000;
    }
    if (((player == null) && ((currentState == 'inactive') && (nextState == 'active')))) {
        player = new import13.AnimationSequencePlayer([view.renderer.animate(element, new import14.AnimationStyles(import12.collectAndResolveStyles(collectedStyles, [startStateStyles])), import12.balanceAnimationKeyframes(collectedStyles, endStateStyles, [
                new import15.AnimationKeyframe(0, new import14.AnimationStyles(import12.collectAndResolveStyles(collectedStyles, [{}]))),
                new import15.AnimationKeyframe(1, new import14.AnimationStyles(import12.collectAndResolveStyles(collectedStyles, [{}])))
            ]), 5000, 0, 'cubic-bezier(0.19, 1, 0.22, 1)')]);
        totalTime = 5000;
    }
    if (((player == null) && ((currentState == 'active') && (nextState == 'inactive')))) {
        player = new import13.AnimationSequencePlayer([view.renderer.animate(element, new import14.AnimationStyles(import12.collectAndResolveStyles(collectedStyles, [startStateStyles])), import12.balanceAnimationKeyframes(collectedStyles, endStateStyles, [
                new import15.AnimationKeyframe(0, new import14.AnimationStyles(import12.collectAndResolveStyles(collectedStyles, [{}]))),
                new import15.AnimationKeyframe(1, new import14.AnimationStyles(import12.collectAndResolveStyles(collectedStyles, [{}])))
            ]), 5000, 0, 'cubic-bezier(0.19, 1, 0.22, 1)')]);
        totalTime = 5000;
    }
    if ((player == null)) {
        (player = new import16.NoOpAnimationPlayer());
    }
    player.onDone(() => {
        import12.renderStyles(element, view.renderer, import12.prepareFinalAnimationStyles(startStateStyles, endStateStyles));
    });
    view.animationContext.queueAnimation(element, 'intro', player);
    return new import11.AnimationTransition(player, currentState, nextState, totalTime);
}
var renderType_HomeComponent = null;
class _View_HomeComponent0 extends import1.AppView {
    constructor(viewUtils, parentInjector, declarationEl) {
        super(_View_HomeComponent0, renderType_HomeComponent, import6.ViewType.COMPONENT, viewUtils, parentInjector, declarationEl, import7.ChangeDetectorStatus.CheckAlways);
        this._expr_3 = import7.UNINITIALIZED;
        this._map_4 = import4.pureProxy2((p0, p1) => {
            return {
                'is--active': p0,
                'is--inactive': p1
            };
        });
    }
    createInternal(rootSelector) {
        const parentRenderNode = this.renderer.createViewRoot(this.declarationAppElement.nativeElement);
        this._el_0 = import4.createRenderElement(this.renderer, parentRenderNode, 'img', new import4.InlineArray4(4, 'class', 'app__icon', 'src', '/assets/ng2-stealth.png'), null);
        this._NgClass_0_3 = new import17.Wrapper_NgClass(this.parentInjector.get(import18.IterableDiffers), this.parentInjector.get(import19.KeyValueDiffers), new import20.ElementRef(this._el_0), this.renderer);
        this._text_1 = this.renderer.createText(parentRenderNode, '\n', null);
        this.init([], [
            this._el_0,
            this._text_1
        ], [], []);
        return null;
    }
    injectorGetInternal(token, requestNodeIndex, notFoundResult) {
        if (((token === import21.NgClass) && (0 === requestNodeIndex))) {
            return this._NgClass_0_3.context;
        }
        return notFoundResult;
    }
    detectChangesInternal(throwOnChange) {
        const currVal_3 = this.context.stealthMode;
        if (import4.checkBinding(throwOnChange, this._expr_3, currVal_3)) {
            var animationTransition_intro = this.componentType.animations['intro'](this, this._el_0, ((this._expr_3 == import7.UNINITIALIZED) ? 'void' : this._expr_3), ((currVal_3 == import7.UNINITIALIZED) ? 'void' : currVal_3));
            this._expr_3 = currVal_3;
        }
        const currVal_0_0_0 = 'app__icon';
        this._NgClass_0_3.check_klass(currVal_0_0_0, throwOnChange, false);
        const currVal_0_0_1 = this._map_4((this.context.stealthMode === 'active'), (this.context.stealthMode === 'inactive'));
        this._NgClass_0_3.check_ngClass(currVal_0_0_1, throwOnChange, false);
        this._NgClass_0_3.detectChangesInInputProps(this, this._el_0, throwOnChange);
        this.detectContentChildrenChanges(throwOnChange);
        this._NgClass_0_3.detectChangesInHostProps(this, this._el_0, throwOnChange);
        this.detectViewChildrenChanges(throwOnChange);
    }
    detachInternal() {
        var animationTransition_intro = this.componentType.animations['intro'](this, this._el_0, this._expr_3, 'void');
    }
}
export function viewFactory_HomeComponent0(viewUtils, parentInjector, declarationEl) {
    if ((renderType_HomeComponent === null)) {
        (renderType_HomeComponent = viewUtils.createRenderComponentType('', 0, import8.ViewEncapsulation.Emulated, styles_HomeComponent, { intro: HomeComponent_intro_factory }));
    }
    return new _View_HomeComponent0(viewUtils, parentInjector, declarationEl);
}
