import { Component, Input } from '@angular/core';
import { SkeletonComponent } from '@ironsource/fusion-ui/components/skeleton';
import * as i0 from "@angular/core";
const _c0 = ["fusionTableLoading", ""];
function TableLoadingComponent_Conditional_0_For_1_Conditional_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelement(0, "fusion-skeleton", 1);
} }
function TableLoadingComponent_Conditional_0_For_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "td", 0);
    i0.ɵɵtemplate(1, TableLoadingComponent_Conditional_0_For_1_Conditional_1_Template, 1, 0, "fusion-skeleton", 1);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ɵ$index_2_r1 = ctx.$index;
    i0.ɵɵadvance();
    i0.ɵɵconditional(!(ɵ$index_2_r1 === 0) ? 1 : -1);
} }
function TableLoadingComponent_Conditional_0_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵrepeaterCreate(0, TableLoadingComponent_Conditional_0_For_1_Template, 2, 1, "td", 0, i0.ɵɵrepeaterTrackByIdentity);
} if (rf & 2) {
    const ctx_r1 = i0.ɵɵnextContext();
    i0.ɵɵrepeater(ctx_r1.colsToShow);
} }
function TableLoadingComponent_Conditional_1_For_1_For_2_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "td", 2);
    i0.ɵɵelement(1, "fusion-skeleton", 1);
    i0.ɵɵelementEnd();
} }
function TableLoadingComponent_Conditional_1_For_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "tr");
    i0.ɵɵrepeaterCreate(1, TableLoadingComponent_Conditional_1_For_1_For_2_Template, 2, 0, "td", 2, i0.ɵɵrepeaterTrackByIdentity);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r1 = i0.ɵɵnextContext(2);
    i0.ɵɵadvance();
    i0.ɵɵrepeater(ctx_r1.colsToShow);
} }
function TableLoadingComponent_Conditional_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵrepeaterCreate(0, TableLoadingComponent_Conditional_1_For_1_Template, 3, 0, "tr", null, i0.ɵɵrepeaterTrackByIdentity);
} if (rf & 2) {
    const ctx_r1 = i0.ɵɵnextContext();
    i0.ɵɵrepeater(ctx_r1.rowsToShow);
} }
export class TableLoadingComponent {
    constructor() {
        this.fusionTableLoadingExpanding = false;
        this.fusionTableLoadingRows = 3;
    }
    get rowsToShow() {
        return [...Array(this.fusionTableLoadingRows).keys()];
    }
    get colsToShow() {
        return [...Array(this.fusionTableLoading ?? 1).keys()];
    }
    static { this.ɵfac = function TableLoadingComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || TableLoadingComponent)(); }; }
    static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: TableLoadingComponent, selectors: [["", "fusionTableLoading", ""]], inputs: { fusionTableLoading: "fusionTableLoading", fusionTableLoadingExpanding: "fusionTableLoadingExpanding", fusionTableLoadingRows: "fusionTableLoadingRows" }, standalone: true, features: [i0.ɵɵStandaloneFeature], attrs: _c0, decls: 2, vars: 1, consts: [[1, "fu-table-cell-loading", "fu-expanding-loader"], ["size", "16"], [1, "fu-table-cell-loading"]], template: function TableLoadingComponent_Template(rf, ctx) { if (rf & 1) {
            i0.ɵɵtemplate(0, TableLoadingComponent_Conditional_0_Template, 2, 0)(1, TableLoadingComponent_Conditional_1_Template, 2, 0);
        } if (rf & 2) {
            i0.ɵɵconditional(ctx.fusionTableLoadingExpanding ? 0 : 1);
        } }, dependencies: [SkeletonComponent], styles: ["[_nghost-%COMP%]   .fu-table-cell-loading[_ngcontent-%COMP%]{height:var(--table-row-height, 48px);padding:var(--table-row-cell-padding, 0 16px);border-bottom:var(--table-border)}[_nghost-%COMP%]   .fu-table-cell-loading.fu-expanding-loader[_ngcontent-%COMP%]:first-of-type   div[_ngcontent-%COMP%]{display:none}"] }); }
}
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(TableLoadingComponent, [{
        type: Component,
        args: [{ selector: '[fusionTableLoading]', imports: [SkeletonComponent], standalone: true, template: "@if(fusionTableLoadingExpanding){\n    @for(c of colsToShow; track c; let first = $first){\n        <td class=\"fu-table-cell-loading fu-expanding-loader\">\n            @if (!first){\n                <fusion-skeleton size=\"16\"></fusion-skeleton>\n            }\n        </td>\n    }\n} @else {\n    @for (r of rowsToShow; track r){\n        <tr>\n            @for(c of colsToShow; track c){\n                <td class=\"fu-table-cell-loading\"><fusion-skeleton size=\"16\"></fusion-skeleton></td>\n            }\n        </tr>\n    }\n}\n", styles: [":host .fu-table-cell-loading{height:var(--table-row-height, 48px);padding:var(--table-row-cell-padding, 0 16px);border-bottom:var(--table-border)}:host .fu-table-cell-loading.fu-expanding-loader:first-of-type div{display:none}\n"] }]
    }], null, { fusionTableLoading: [{
            type: Input
        }], fusionTableLoadingExpanding: [{
            type: Input
        }], fusionTableLoadingRows: [{
            type: Input
        }] }); })();
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(TableLoadingComponent, { className: "TableLoadingComponent", filePath: "components/table-loading/table-loading.component.ts", lineNumber: 12 }); })();
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGFibGUtbG9hZGluZy5jb21wb25lbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9mdXNpb24tdWkvY29tcG9uZW50cy90YWJsZS92NC9jb21wb25lbnRzL3RhYmxlLWxvYWRpbmcvdGFibGUtbG9hZGluZy5jb21wb25lbnQudHMiLCIuLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9mdXNpb24tdWkvY29tcG9uZW50cy90YWJsZS92NC9jb21wb25lbnRzL3RhYmxlLWxvYWRpbmcvdGFibGUtbG9hZGluZy5jb21wb25lbnQuaHRtbCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUMsU0FBUyxFQUFFL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