import { Component, HostBinding } from '@angular/core';
import { Subscription } from 'rxjs';
import { ModeService } from '../services/mode.service';
import * as i0 from "@angular/core";
import * as i1 from "../services/mode.service";
import * as i2 from "@angular/common";
import * as i3 from "@aztrix/components/button";
import * as i4 from "@aztrix/helpers";
export class ModeSwitchComponent {
    constructor(modeService) {
        this.modeService = modeService;
        this.mode$ = this.modeService.mode$;
        this._subscription = new Subscription();
    }
    ngOnInit() {
        this._subscription = this.mode$.subscribe((mode) => {
            this.mode = mode;
        });
    }
    ngOnDestroy() {
        this._subscription.unsubscribe();
    }
}
ModeSwitchComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: ModeSwitchComponent, deps: [{ token: i1.ModeService }], target: i0.ɵɵFactoryTarget.Component });
ModeSwitchComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.5", type: ModeSwitchComponent, selector: "ax-mode-switch", host: { properties: { "class": "this.mode" } }, ngImport: i0, template: "<ng-container [ngSwitch]=\"mode$ | async\">\n  <ng-container *ngSwitchCase=\"'register'\">\n    <span>{{ 'login.has-account' | translate }}</span>\n    <button class=\"link\" axButton type=\"button\" (click)=\"this.modeService.setMode('login')\">\n      {{ 'label.login' | translate }}\n    </button>\n  </ng-container>\n  <ng-container *ngSwitchCase=\"'reset'\">\n    <button class=\"link\" axButton type=\"button\" (click)=\"this.modeService.setMode('login')\">\n      <span>{{ 'reset-password' | translate }}</span>\n    </button>\n  </ng-container>\n  <ng-container *ngSwitchCase=\"'login'\">\n    <span>{{ 'login.no-account' | translate }}</span>\n    <button class=\"link\" axButton type=\"button\" (click)=\"this.modeService.setMode('register')\">\n      {{ 'login.create-account' | translate }}\n    </button>\n  </ng-container>\n</ng-container>\n", styles: [":host{display:flex;flex-direction:column;align-items:center;margin-top:1rem;font-size:small;font-weight:bolder}:host.register{color:#fff}:host.register .link{color:#fff}\n", ".link{text-transform:none;text-decoration:underline;height:1rem;line-height:1rem;padding:0}\n"], dependencies: [{ kind: "directive", type: i2.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i2.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i3.ButtonDirective, selector: "[axButton]", inputs: ["color", "labelHideMobile", "smallButton", "bigButton", "fullWidth", "filled", "outline", "icon-button", "hoverLabel", "hover", "lowercase", "disabled"] }, { kind: "pipe", type: i2.AsyncPipe, name: "async" }, { kind: "pipe", type: i4.TranslatePipe, name: "translate" }] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: ModeSwitchComponent, decorators: [{
            type: Component,
            args: [{ selector: 'ax-mode-switch', template: "<ng-container [ngSwitch]=\"mode$ | async\">\n  <ng-container *ngSwitchCase=\"'register'\">\n    <span>{{ 'login.has-account' | translate }}</span>\n    <button class=\"link\" axButton type=\"button\" (click)=\"this.modeService.setMode('login')\">\n      {{ 'label.login' | translate }}\n    </button>\n  </ng-container>\n  <ng-container *ngSwitchCase=\"'reset'\">\n    <button class=\"link\" axButton type=\"button\" (click)=\"this.modeService.setMode('login')\">\n      <span>{{ 'reset-password' | translate }}</span>\n    </button>\n  </ng-container>\n  <ng-container *ngSwitchCase=\"'login'\">\n    <span>{{ 'login.no-account' | translate }}</span>\n    <button class=\"link\" axButton type=\"button\" (click)=\"this.modeService.setMode('register')\">\n      {{ 'login.create-account' | translate }}\n    </button>\n  </ng-container>\n</ng-container>\n", styles: [":host{display:flex;flex-direction:column;align-items:center;margin-top:1rem;font-size:small;font-weight:bolder}:host.register{color:#fff}:host.register .link{color:#fff}\n", ".link{text-transform:none;text-decoration:underline;height:1rem;line-height:1rem;padding:0}\n"] }]
        }], ctorParameters: function () { return [{ type: i1.ModeService }]; }, propDecorators: { mode: [{
                type: HostBinding,
                args: ['class']
            }] } });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibW9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