import { Component, computed, input } from '@angular/core';
import { StreamSlotComponent } from './stream-slot.component.js';
import * as i0 from "@angular/core";
export class DeferSlotComponent {
    constructor() {
        this.className = input(...(ngDevMode ? [undefined, { debugName: "className" }] : /* istanbul ignore next */ []));
        this.errorHtml = input(...(ngDevMode ? [undefined, { debugName: "errorHtml" }] : /* istanbul ignore next */ []));
        this.fallbackHtml = input('', ...(ngDevMode ? [{ debugName: "fallbackHtml" }] : /* istanbul ignore next */ []));
        this.id = input.required(...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
        this.promise = input(...(ngDevMode ? [undefined, { debugName: "promise" }] : /* istanbul ignore next */ []));
        this.resolve = input(...(ngDevMode ? [undefined, { debugName: "resolve" }] : /* istanbul ignore next */ []));
        this.timeoutMs = input(...(ngDevMode ? [undefined, { debugName: "timeoutMs" }] : /* istanbul ignore next */ []));
        this.resolvedResolver = computed(() => {
            const resolver = this.resolve();
            if (resolver)
                return resolver;
            const promise = this.promise();
            if (promise)
                return () => promise;
            return () => '';
        }, ...(ngDevMode ? [{ debugName: "resolvedResolver" }] : /* istanbul ignore next */ []));
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: DeferSlotComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.6", type: DeferSlotComponent, isStandalone: true, selector: "abs-defer-slot", inputs: { className: { classPropertyName: "className", publicName: "className", isSignal: true, isRequired: false, transformFunction: null }, errorHtml: { classPropertyName: "errorHtml", publicName: "errorHtml", isSignal: true, isRequired: false, transformFunction: null }, fallbackHtml: { classPropertyName: "fallbackHtml", publicName: "fallbackHtml", isSignal: true, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: true, transformFunction: null }, promise: { classPropertyName: "promise", publicName: "promise", isSignal: true, isRequired: false, transformFunction: null }, resolve: { classPropertyName: "resolve", publicName: "resolve", isSignal: true, isRequired: false, transformFunction: null }, timeoutMs: { classPropertyName: "timeoutMs", publicName: "timeoutMs", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
		<abs-stream-slot
			[className]="className()"
			[errorHtml]="errorHtml()"
			[fallbackHtml]="fallbackHtml()"
			[id]="id()"
			[resolve]="resolvedResolver()"
			[timeoutMs]="timeoutMs()"
		></abs-stream-slot>
	`, isInline: true, dependencies: [{ kind: "component", type: StreamSlotComponent, selector: "abs-stream-slot", inputs: ["className", "errorHtml", "fallbackHtml", "id", "resolve", "timeoutMs"] }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: DeferSlotComponent, decorators: [{
            type: Component,
            args: [{
                    selector: 'abs-defer-slot',
                    standalone: true,
                    template: `
		<abs-stream-slot
			[className]="className()"
			[errorHtml]="errorHtml()"
			[fallbackHtml]="fallbackHtml()"
			[id]="id()"
			[resolve]="resolvedResolver()"
			[timeoutMs]="timeoutMs()"
		></abs-stream-slot>
	`,
                    imports: [StreamSlotComponent]
                }]
        }], propDecorators: { className: [{ type: i0.Input, args: [{ isSignal: true, alias: "className", required: false }] }], errorHtml: [{ type: i0.Input, args: [{ isSignal: true, alias: "errorHtml", required: false }] }], fallbackHtml: [{ type: i0.Input, args: [{ isSignal: true, alias: "fallbackHtml", required: false }] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: true }] }], promise: [{ type: i0.Input, args: [{ isSignal: true, alias: "promise", required: false }] }], resolve: [{ type: i0.Input, args: [{ isSignal: true, alias: "resolve", required: false }] }], timeoutMs: [{ type: i0.Input, args: [{ isSignal: true, alias: "timeoutMs", required: false }] }] } });
