import { NgIf } from '@angular/common';
import { ChangeDetectionStrategy, Component } from '@angular/core';
import { TuiAnimated } from '@taiga-ui/cdk/directives/animated';
import { TuiButton } from '@taiga-ui/core/components/button';
import { TuiIcon } from '@taiga-ui/core/components/icon';
import { TuiLink } from '@taiga-ui/core/components/link';
import { injectContext, PolymorpheusOutlet } from '@taiga-ui/polymorpheus';
import { TuiPushComponent } from './push.component';
import { TuiPushDirective } from './push.directive';
import * as i0 from "@angular/core";
import * as i1 from "@taiga-ui/cdk/directives/animated";
class TuiPushAlert {
    constructor() {
        this.context = injectContext();
    }
    get isDirective() {
        return this.context.content instanceof TuiPushDirective;
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiPushAlert, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: TuiPushAlert, isStandalone: true, selector: "ng-component", host: { attributes: { "role": "alert" } }, hostDirectives: [{ directive: i1.TuiAnimated }], ngImport: i0, template: "<div class=\"t-wrapper\">\n    <tui-push\n        *ngIf=\"!isDirective; else directive\"\n        [heading]=\"context.heading\"\n        [timestamp]=\"context.timestamp\"\n        [type]=\"context.type\"\n        (close)=\"context.$implicit.complete()\"\n    >\n        <img\n            *ngIf=\"context.image\"\n            alt=\"\"\n            [src]=\"context.image\"\n        />\n        <tui-icon\n            *ngIf=\"context.icon\"\n            [icon]=\"context.icon\"\n            [style.color]=\"context.iconColor\"\n        />\n        <div\n            *polymorpheusOutlet=\"context.content as text; context: context\"\n            [innerHTML]=\"text\"\n        ></div>\n        <button\n            *ngIf=\"context.buttons.length > 1\"\n            tuiButton\n            type=\"button\"\n            (click)=\"context.$implicit.next(context.buttons[0] || '')\"\n        >\n            {{ context.buttons[0] }}\n        </button>\n        <button\n            *ngIf=\"context.buttons.length\"\n            tuiLink\n            type=\"button\"\n            (click)=\"context.$implicit.next(context.buttons[context.buttons.length - 1] || '')\"\n        >\n            {{ context.buttons[context.buttons.length - 1] }}\n        </button>\n    </tui-push>\n    <ng-template #directive>\n        <ng-container *polymorpheusOutlet=\"context.content\" />\n    </ng-template>\n</div>\n", styles: [":host{position:relative;bottom:1rem;display:grid;flex-shrink:0;max-inline-size:calc(100% - 2rem);margin:0 1rem 0 auto;border-radius:var(--tui-radius-xl);box-shadow:var(--tui-shadow-small);overflow:hidden;--tui-from: translateX(100%)}:host.tui-enter,:host.tui-leave{animation-name:tuiFade,tuiSlide,tuiCollapse}:host.tui-leave:not(:first-child){transition-property:margin;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;margin-block-start:-1rem!important}:host:first-child{margin-block-start:auto}:host:not(:last-child){transition-property:margin;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;margin-block-end:1rem}.t-wrapper{grid-row:1 / span 2;overflow:hidden}\n"], dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: PolymorpheusOutlet, selector: "[polymorpheusOutlet]", inputs: ["polymorpheusOutlet", "polymorpheusOutletContext"] }, { kind: "directive", type: TuiButton, selector: "a[tuiButton],button[tuiButton],a[tuiIconButton],button[tuiIconButton]", inputs: ["size"] }, { kind: "component", type: TuiIcon, selector: "tui-icon", inputs: ["icon", "background"] }, { kind: "directive", type: TuiLink, selector: "a[tuiLink], button[tuiLink]", inputs: ["pseudo"] }, { kind: "component", type: TuiPushComponent, selector: "tui-push", inputs: ["heading", "type", "lines", "timestamp"], outputs: ["close"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
}
export { TuiPushAlert };
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiPushAlert, decorators: [{
            type: Component,
            args: [{ standalone: true, imports: [NgIf, PolymorpheusOutlet, TuiButton, TuiIcon, TuiLink, TuiPushComponent], changeDetection: ChangeDetectionStrategy.OnPush, hostDirectives: [TuiAnimated], host: {
                        role: 'alert',
                    }, template: "<div class=\"t-wrapper\">\n    <tui-push\n        *ngIf=\"!isDirective; else directive\"\n        [heading]=\"context.heading\"\n        [timestamp]=\"context.timestamp\"\n        [type]=\"context.type\"\n        (close)=\"context.$implicit.complete()\"\n    >\n        <img\n            *ngIf=\"context.image\"\n            alt=\"\"\n            [src]=\"context.image\"\n        />\n        <tui-icon\n            *ngIf=\"context.icon\"\n            [icon]=\"context.icon\"\n            [style.color]=\"context.iconColor\"\n        />\n        <div\n            *polymorpheusOutlet=\"context.content as text; context: context\"\n            [innerHTML]=\"text\"\n        ></div>\n        <button\n            *ngIf=\"context.buttons.length > 1\"\n            tuiButton\n            type=\"button\"\n            (click)=\"context.$implicit.next(context.buttons[0] || '')\"\n        >\n            {{ context.buttons[0] }}\n        </button>\n        <button\n            *ngIf=\"context.buttons.length\"\n            tuiLink\n            type=\"button\"\n            (click)=\"context.$implicit.next(context.buttons[context.buttons.length - 1] || '')\"\n        >\n            {{ context.buttons[context.buttons.length - 1] }}\n        </button>\n    </tui-push>\n    <ng-template #directive>\n        <ng-container *polymorpheusOutlet=\"context.content\" />\n    </ng-template>\n</div>\n", styles: [":host{position:relative;bottom:1rem;display:grid;flex-shrink:0;max-inline-size:calc(100% - 2rem);margin:0 1rem 0 auto;border-radius:var(--tui-radius-xl);box-shadow:var(--tui-shadow-small);overflow:hidden;--tui-from: translateX(100%)}:host.tui-enter,:host.tui-leave{animation-name:tuiFade,tuiSlide,tuiCollapse}:host.tui-leave:not(:first-child){transition-property:margin;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;margin-block-start:-1rem!important}:host:first-child{margin-block-start:auto}:host:not(:last-child){transition-property:margin;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;margin-block-end:1rem}.t-wrapper{grid-row:1 / span 2;overflow:hidden}\n"] }]
        }] });
//# sourceMappingURL=data:application/json;base64, 