import { __decorate, __metadata } from "tslib";
/**
 * @packageDocumentation
 * @module k8s-resource-list
 */
import { ScrollDispatcher } from '@angular/cdk/overlay';
import { ChangeDetectionStrategy, Component, ContentChild, Directive, Input, ViewContainerRef, TemplateRef, } from '@angular/core';
import { Observable, Subject, combineLatest, concat, fromEvent, merge, debounceTime, distinctUntilChanged, filter, map, pairwise, startWith, switchMap, take, takeUntil, takeWhile, } from 'rxjs';
import { publishRef } from '../../core';
import { ObservableInput } from '../../core/utils/decorators';
import { TranslateService } from '../../translate/public-api';
import { K8SResourceList } from '../k8s-resource-list';
import { LoadAction } from '../types';
import * as i0 from "@angular/core";
import * as i1 from "../../translate/public-api";
import * as i2 from "@angular/cdk/overlay";
function K8SResourceListFooterComponent_div_0_ng_container_1_1_ng_template_0_Template(rf, ctx) { }
function K8SResourceListFooterComponent_div_0_ng_container_1_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵtemplate(0, K8SResourceListFooterComponent_div_0_ng_container_1_1_ng_template_0_Template, 0, 0, "ng-template");
} }
function K8SResourceListFooterComponent_div_0_ng_container_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainerStart(0);
    i0.ɵɵtemplate(1, K8SResourceListFooterComponent_div_0_ng_container_1_1_Template, 1, 0, null, 3);
    i0.ɵɵelementContainerEnd();
} if (rf & 2) {
    const ctx_r3 = i0.ɵɵnextContext(2);
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngTemplateOutlet", ctx_r3.noDataTemplate);
} }
function K8SResourceListFooterComponent_div_0_ng_container_2_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainerStart(0);
    i0.ɵɵtext(1);
    i0.ɵɵpipe(2, "async");
    i0.ɵɵelementContainerEnd();
} if (rf & 2) {
    const ctx_r4 = i0.ɵɵnextContext(2);
    i0.ɵɵadvance(1);
    i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(2, 1, ctx_r4.noDataHint$), " ");
} }
function K8SResourceListFooterComponent_div_0_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 2);
    i0.ɵɵtemplate(1, K8SResourceListFooterComponent_div_0_ng_container_1_Template, 2, 1, "ng-container", 1);
    i0.ɵɵtemplate(2, K8SResourceListFooterComponent_div_0_ng_container_2_Template, 3, 3, "ng-container", 1);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r0 = i0.ɵɵnextContext();
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngIf", ctx_r0.noDataTemplate);
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngIf", !ctx_r0.noDataTemplate);
} }
function K8SResourceListFooterComponent_ng_container_2_div_1_ng_container_1_Template(rf, ctx) { if (rf & 1) {
    const _r13 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementContainerStart(0);
    i0.ɵɵelementStart(1, "span");
    i0.ɵɵtext(2);
    i0.ɵɵpipe(3, "translate");
    i0.ɵɵpipe(4, "translate");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(5, "button", 6);
    i0.ɵɵlistener("click", function K8SResourceListFooterComponent_ng_container_2_div_1_ng_container_1_Template_button_click_5_listener() { i0.ɵɵrestoreView(_r13); const ctx_r12 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r12.retry()); });
    i0.ɵɵtext(6);
    i0.ɵɵpipe(7, "translate");
    i0.ɵɵelementEnd();
    i0.ɵɵelementContainerEnd();
} if (rf & 2) {
    i0.ɵɵadvance(2);
    i0.ɵɵtextInterpolate2("", i0.ɵɵpipeBind1(3, 3, "loading_error"), ", ", i0.ɵɵpipeBind1(4, 5, "please"), "");
    i0.ɵɵadvance(4);
    i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(7, 7, "retry"), " ");
} }
function K8SResourceListFooterComponent_ng_container_2_div_1_ng_container_3_Template(rf, ctx) { if (rf & 1) {
    const _r15 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementContainerStart(0);
    i0.ɵɵelementStart(1, "span");
    i0.ɵɵtext(2);
    i0.ɵɵpipe(3, "translate");
    i0.ɵɵpipe(4, "translate");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(5, "button", 6);
    i0.ɵɵlistener("click", function K8SResourceListFooterComponent_ng_container_2_div_1_ng_container_3_Template_button_click_5_listener() { i0.ɵɵrestoreView(_r15); const ctx_r14 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r14.list.reload()); });
    i0.ɵɵtext(6);
    i0.ɵɵpipe(7, "translate");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(8, "span");
    i0.ɵɵtext(9);
    i0.ɵɵpipe(10, "translate");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(11, "button", 6);
    i0.ɵɵlistener("click", function K8SResourceListFooterComponent_ng_container_2_div_1_ng_container_3_Template_button_click_11_listener() { i0.ɵɵrestoreView(_r15); const ctx_r16 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r16.list.loadMore()); });
    i0.ɵɵtext(12);
    i0.ɵɵpipe(13, "translate");
    i0.ɵɵelementEnd();
    i0.ɵɵelementContainerEnd();
} if (rf & 2) {
    i0.ɵɵadvance(2);
    i0.ɵɵtextInterpolate2(" ", i0.ɵɵpipeBind1(3, 5, "list_data_has_expired"), ", ", i0.ɵɵpipeBind1(4, 7, "please"), " ");
    i0.ɵɵadvance(4);
    i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(7, 9, "refresh"), " ");
    i0.ɵɵadvance(3);
    i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(10, 11, "or"));
    i0.ɵɵadvance(3);
    i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(13, 13, "continue_load"), " ");
} }
function K8SResourceListFooterComponent_ng_container_2_div_1_ng_container_5_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainerStart(0);
    i0.ɵɵelementStart(1, "span");
    i0.ɵɵtext(2);
    i0.ɵɵpipe(3, "translate");
    i0.ɵɵelementEnd();
    i0.ɵɵelementContainerEnd();
} if (rf & 2) {
    i0.ɵɵadvance(2);
    i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(3, 1, "no_permission_description"), " ");
} }
const _c0 = function () { return [410, 403]; };
function K8SResourceListFooterComponent_ng_container_2_div_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 5);
    i0.ɵɵtemplate(1, K8SResourceListFooterComponent_ng_container_2_div_1_ng_container_1_Template, 8, 9, "ng-container", 1);
    i0.ɵɵpipe(2, "async");
    i0.ɵɵtemplate(3, K8SResourceListFooterComponent_ng_container_2_div_1_ng_container_3_Template, 14, 15, "ng-container", 1);
    i0.ɵɵpipe(4, "async");
    i0.ɵɵtemplate(5, K8SResourceListFooterComponent_ng_container_2_div_1_ng_container_5_Template, 4, 3, "ng-container", 1);
    i0.ɵɵpipe(6, "async");
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r7 = i0.ɵɵnextContext(2);
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngIf", !i0.ɵɵpureFunction0(9, _c0).includes(i0.ɵɵpipeBind1(2, 3, ctx_r7.loadingErrorCode$)));
    i0.ɵɵadvance(2);
    i0.ɵɵproperty("ngIf", i0.ɵɵpipeBind1(4, 5, ctx_r7.loadingErrorCode$) === 410);
    i0.ɵɵadvance(2);
    i0.ɵɵproperty("ngIf", i0.ɵɵpipeBind1(6, 7, ctx_r7.loadingErrorCode$) === 403);
} }
function K8SResourceListFooterComponent_ng_container_2_ng_container_3_ng_container_1_div_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 5);
    i0.ɵɵelement(1, "aui-icon", 8);
    i0.ɵɵelementStart(2, "span");
    i0.ɵɵtext(3);
    i0.ɵɵpipe(4, "translate");
    i0.ɵɵelementEnd()();
} if (rf & 2) {
    i0.ɵɵadvance(3);
    i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(4, 1, "loading_please_wait"));
} }
function K8SResourceListFooterComponent_ng_container_2_ng_container_3_ng_container_1_div_2_Template(rf, ctx) { if (rf & 1) {
    const _r23 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "div", 5)(1, "button", 6);
    i0.ɵɵlistener("click", function K8SResourceListFooterComponent_ng_container_2_ng_container_3_ng_container_1_div_2_Template_button_click_1_listener() { i0.ɵɵrestoreView(_r23); const ctx_r22 = i0.ɵɵnextContext(4); return i0.ɵɵresetView(ctx_r22.list.loadMore()); });
    i0.ɵɵtext(2);
    i0.ɵɵpipe(3, "translate");
    i0.ɵɵelementEnd()();
} if (rf & 2) {
    i0.ɵɵadvance(2);
    i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(3, 1, "load_more"), " ");
} }
function K8SResourceListFooterComponent_ng_container_2_ng_container_3_ng_container_1_div_3_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 9);
    i0.ɵɵelement(1, "div", 10);
    i0.ɵɵelementEnd();
} }
function K8SResourceListFooterComponent_ng_container_2_ng_container_3_ng_container_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainerStart(0);
    i0.ɵɵtemplate(1, K8SResourceListFooterComponent_ng_container_2_ng_container_3_ng_container_1_div_1_Template, 5, 3, "div", 4);
    i0.ɵɵtemplate(2, K8SResourceListFooterComponent_ng_container_2_ng_container_3_ng_container_1_div_2_Template, 4, 3, "div", 4);
    i0.ɵɵtemplate(3, K8SResourceListFooterComponent_ng_container_2_ng_container_3_ng_container_1_div_3_Template, 2, 0, "div", 7);
    i0.ɵɵelementContainerEnd();
} if (rf & 2) {
    const meta_r18 = ctx.ngIf;
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngIf", meta_r18.loading);
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngIf", meta_r18.loadMore);
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngIf", !meta_r18.loadMore && !meta_r18.loading);
} }
const _c1 = function (a0, a1) { return { loading: a0, loadMore: a1 }; };
function K8SResourceListFooterComponent_ng_container_2_ng_container_3_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainerStart(0);
    i0.ɵɵtemplate(1, K8SResourceListFooterComponent_ng_container_2_ng_container_3_ng_container_1_Template, 4, 3, "ng-container", 1);
    i0.ɵɵpipe(2, "async");
    i0.ɵɵpipe(3, "async");
    i0.ɵɵpipe(4, "async");
    i0.ɵɵelementContainerEnd();
} if (rf & 2) {
    const ctx_r8 = i0.ɵɵnextContext(2);
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngIf", i0.ɵɵpureFunction2(7, _c1, i0.ɵɵpipeBind1(2, 1, ctx_r8.list.loading$), i0.ɵɵpipeBind1(3, 3, !ctx_r8.autoLoad && !i0.ɵɵpipeBind1(4, 5, ctx_r8.list.loading$) && ctx_r8.list.hasMore$)));
} }
function K8SResourceListFooterComponent_ng_container_2_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainerStart(0);
    i0.ɵɵtemplate(1, K8SResourceListFooterComponent_ng_container_2_div_1_Template, 7, 10, "div", 4);
    i0.ɵɵpipe(2, "async");
    i0.ɵɵtemplate(3, K8SResourceListFooterComponent_ng_container_2_ng_container_3_Template, 5, 10, "ng-container", 1);
    i0.ɵɵpipe(4, "async");
    i0.ɵɵelementContainerEnd();
} if (rf & 2) {
    const ctx_r1 = i0.ɵɵnextContext();
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngIf", i0.ɵɵpipeBind1(2, 2, ctx_r1.list.loadingError$));
    i0.ɵɵadvance(2);
    i0.ɵɵproperty("ngIf", !i0.ɵɵpipeBind1(4, 4, ctx_r1.list.loadingError$));
} }
function K8SResourceListFooterComponent_aui_back_top_4_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelement(0, "aui-back-top");
} }
export class K8sListFooterNoDataDirective {
    constructor(templateRef) {
        this.templateRef = templateRef;
    }
}
K8sListFooterNoDataDirective.ɵfac = function K8sListFooterNoDataDirective_Factory(t) { return new (t || K8sListFooterNoDataDirective)(i0.ɵɵdirectiveInject(i0.TemplateRef)); };
K8sListFooterNoDataDirective.ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: K8sListFooterNoDataDirective, selectors: [["", "aclK8sListFooterNoData", ""]] });
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(K8sListFooterNoDataDirective, [{
        type: Directive,
        args: [{
                selector: '[aclK8sListFooterNoData]',
            }]
    }], function () { return [{ type: i0.TemplateRef }]; }, null); })();
export class K8SResourceListFooterComponent {
    constructor(translate, scrollDispatcher, viewContainerRef) {
        this.translate = translate;
        this.scrollDispatcher = scrollDispatcher;
        this.viewContainerRef = viewContainerRef;
        this.autoLoad = true;
        this.backTop = true;
        this.bottomDistance = 60;
        this.destroy$$ = new Subject();
    }
    /** @ignore */
    ngOnInit() {
        this.scrollEl =
            this.scrollDispatcher
                .getAncestorScrollContainers(this.viewContainerRef.element.nativeElement)
                .pop()
                ?.getElementRef()?.nativeElement ?? window;
        this.loadingErrorCode$ = this.list.loadingError$.pipe(map(loadingError => loadingError && 'code' in loadingError && loadingError.code), distinctUntilChanged(), publishRef());
        this.isEmptyList$ = combineLatest([
            this.list.items$.pipe(map(items => items.length)),
            this.list.hasMore$,
            this.list.loading$,
            this.list.loadingError$,
        ]).pipe(map(([length, hasMore, loading, loadingError]) => !(length || hasMore || loading || loadingError)), distinctUntilChanged(), publishRef());
        this.noDataHint$ = combineLatest([
            this.list.rawResponse$,
            this.resourceName$,
            this.translate.locale$,
        ]).pipe(filter(([res]) => !!res), map(([{ kind }, resourceName]) => {
            if (resourceName || (kind?.endsWith('List') && kind.length > 4)) {
                return this.translate.get('no_named_data_hint', {
                    name: this.translate.get(resourceName ||
                        kind.slice(0, kind.lastIndexOf('List')).toLowerCase(), null, true),
                });
            }
            return this.translate.get('no_data');
        }));
        if (this.autoLoad) {
            this.setupAutoLoad();
        }
    }
    /** @ignore */
    ngOnDestroy() {
        this.destroy$$.next();
        this.destroy$$.complete();
    }
    retry() {
        this.list.items$.pipe(take(1)).subscribe(items => {
            if (items.length > 0) {
                this.list.loadMore();
            }
            else {
                this.list.reload();
            }
        });
    }
    setupAutoLoad() {
        const viewEl = this.scrollEl === window
            ? document.documentElement
            : this.scrollEl;
        // 当数据不够一屏时自动加载更多
        const autoLoadOneScreen$ = this.list.loadState$.pipe(map(state => state.rawResponse), filter(res => !!res), debounceTime(50), takeWhile(res => !!res.metadata?.continue &&
            viewEl.scrollHeight - viewEl.clientHeight < this.bottomDistance));
        const autoLoadMore$ = merge(fromEvent(this.scrollEl, 'scroll').pipe(startWith(viewEl.scrollTop), debounceTime(50), map(() => viewEl.scrollTop), pairwise(), 
        // 向下滚动
        filter(([prev, curr]) => curr > prev)), fromEvent(window, 'resize').pipe(startWith(document.body.clientHeight), debounceTime(50), map(() => document.body.clientHeight), pairwise(), 
        // 窗口扩大
        filter(([prev, curr]) => curr > prev), switchMap(() => autoLoadOneScreen$))).pipe(filter(() => viewEl.scrollTop >
            viewEl.scrollHeight - viewEl.clientHeight - this.bottomDistance));
        this.list.loadState$
            .pipe(filter(state => state.action === LoadAction.Reload), startWith(null), switchMap(() => concat(autoLoadOneScreen$, autoLoadMore$)), 
        // list.rawResponse$ 会处理好 loading 等状态时的 loadMore 请求，但有错误时主要主动停止
        filter(() => !this.list.snapshot.loadingError), takeUntil(this.destroy$$))
            .subscribe(() => {
            this.list.loadMore();
        });
    }
}
K8SResourceListFooterComponent.ɵfac = function K8SResourceListFooterComponent_Factory(t) { return new (t || K8SResourceListFooterComponent)(i0.ɵɵdirectiveInject(i1.TranslateService), i0.ɵɵdirectiveInject(i2.ScrollDispatcher), i0.ɵɵdirectiveInject(i0.ViewContainerRef)); };
K8SResourceListFooterComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: K8SResourceListFooterComponent, selectors: [["acl-k8s-resource-list-footer"]], contentQueries: function K8SResourceListFooterComponent_ContentQueries(rf, ctx, dirIndex) { if (rf & 1) {
        i0.ɵɵcontentQuery(dirIndex, K8sListFooterNoDataDirective, 5, TemplateRef);
    } if (rf & 2) {
        let _t;
        i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.noDataTemplate = _t.first);
    } }, inputs: { list: "list", autoLoad: "autoLoad", backTop: "backTop", bottomDistance: "bottomDistance", resourceName: "resourceName" }, decls: 5, vars: 7, consts: [["class", "empty-placeholder", 4, "ngIf"], [4, "ngIf"], [1, "empty-placeholder"], [4, "ngTemplateOutlet"], ["class", "table-placeholder", 4, "ngIf"], [1, "table-placeholder"], ["aui-button", "text", "size", "small", 3, "click"], ["class", "table-last-row--empty", 4, "ngIf"], ["icon", "spinner", "margin", "right"], [1, "table-last-row--empty"], [1, "table-last-row--empty-inner"]], template: function K8SResourceListFooterComponent_Template(rf, ctx) { if (rf & 1) {
        i0.ɵɵtemplate(0, K8SResourceListFooterComponent_div_0_Template, 3, 2, "div", 0);
        i0.ɵɵpipe(1, "async");
        i0.ɵɵtemplate(2, K8SResourceListFooterComponent_ng_container_2_Template, 5, 6, "ng-container", 1);
        i0.ɵɵpipe(3, "async");
        i0.ɵɵtemplate(4, K8SResourceListFooterComponent_aui_back_top_4_Template, 1, 0, "aui-back-top", 1);
    } if (rf & 2) {
        i0.ɵɵproperty("ngIf", i0.ɵɵpipeBind1(1, 3, ctx.isEmptyList$));
        i0.ɵɵadvance(2);
        i0.ɵɵproperty("ngIf", !i0.ɵɵpipeBind1(3, 5, ctx.isEmptyList$));
        i0.ɵɵadvance(2);
        i0.ɵɵproperty("ngIf", ctx.backTop);
    } }, styles: ["[_nghost-%COMP%] {position:sticky;left:0;display:flex;justify-content:center;align-items:center;font-size:14px;color:rgb(var(--aui-color-n-4))}[_nghost-%COMP%]  .empty-placeholder, [_nghost-%COMP%]  .table-placeholder{flex:1}[_nghost-%COMP%]  .table-last-row--empty{height:var(--aui-border-radius-l);background-color:rgb(var(--aui-color-n-9));position:relative;margin-top:-3px;flex:1}[_nghost-%COMP%]  .table-last-row--empty-inner{background-color:rgb(var(--aui-color-n-10));height:var(--aui-border-radius-l);border:1px solid rgb(var(--aui-color-n-8));border-top:0;border-bottom-left-radius:var(--aui-border-radius-l);border-bottom-right-radius:var(--aui-border-radius-l)}[_nghost-%COMP%]  .table-placeholder{box-sizing:border-box;display:flex;justify-content:center;align-items:center;padding:15px 10px;min-height:60px;font-size:var(--aui-font-size-m);line-height:var(--aui-line-height-m);color:rgb(var(--aui-color-placeholder-text));background-color:rgb(var(--aui-color-n-10));border:solid 1px rgb(var(--aui-color-n-8));border-radius:var(--aui-border-radius-l);position:sticky;left:0}[_nghost-%COMP%]  .table-placeholder>aui-icon:first-child{margin-right:var(--aui-spacing-m)}[_nghost-%COMP%]  .aui-table .aui-table__row+.table-placeholder{border-top-left-radius:0;border-top-right-radius:0}[_nghost-%COMP%]  .table-placeholder aui-icon{margin-right:8px}"], changeDetection: 0 });
__decorate([
    ObservableInput(),
    __metadata("design:type", Observable)
], K8SResourceListFooterComponent.prototype, "resourceName$", void 0);
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(K8SResourceListFooterComponent, [{
        type: Component,
        args: [{ selector: 'acl-k8s-resource-list-footer', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n  *ngIf=\"isEmptyList$ | async\"\n  class=\"empty-placeholder\"\n>\n  <ng-container *ngIf=\"noDataTemplate\">\n    <ng-template *ngTemplateOutlet=\"noDataTemplate\"></ng-template>\n  </ng-container>\n  <ng-container *ngIf=\"!noDataTemplate\">\n    {{ noDataHint$ | async }}\n  </ng-container>\n</div>\n\n<ng-container *ngIf=\"!(isEmptyList$ | async)\">\n  <div\n    class=\"table-placeholder\"\n    *ngIf=\"list.loadingError$ | async\"\n  >\n    <ng-container *ngIf=\"![410, 403].includes(loadingErrorCode$ | async)\">\n      <span>{{ 'loading_error' | translate }}, {{ 'please' | translate }}</span>\n      <button\n        aui-button=\"text\"\n        size=\"small\"\n        (click)=\"retry()\"\n      >\n        {{ 'retry' | translate }}\n      </button>\n    </ng-container>\n\n    <ng-container *ngIf=\"(loadingErrorCode$ | async) === 410\">\n      <span>\n        {{ 'list_data_has_expired' | translate }}, {{ 'please' | translate }}\n      </span>\n      <button\n        aui-button=\"text\"\n        size=\"small\"\n        (click)=\"list.reload()\"\n      >\n        {{ 'refresh' | translate }}\n      </button>\n      <span>{{ 'or' | translate }}</span>\n      <button\n        aui-button=\"text\"\n        size=\"small\"\n        (click)=\"list.loadMore()\"\n      >\n        {{ 'continue_load' | translate }}\n      </button>\n    </ng-container>\n\n    <ng-container *ngIf=\"(loadingErrorCode$ | async) === 403\">\n      <span>\n        {{ 'no_permission_description' | translate }}\n      </span>\n    </ng-container>\n  </div>\n\n  <ng-container *ngIf=\"!(list.loadingError$ | async)\">\n    <ng-container\n      *ngIf=\"{\n        loading: list.loading$ | async,\n        loadMore: !autoLoad && !(list.loading$ | async) && list.hasMore$ | async\n      } as meta\"\n    >\n      <div\n        class=\"table-placeholder\"\n        *ngIf=\"meta.loading\"\n      >\n        <aui-icon\n          icon=\"spinner\"\n          margin=\"right\"\n        ></aui-icon>\n        <span>{{ 'loading_please_wait' | translate }}</span>\n      </div>\n      <div\n        class=\"table-placeholder\"\n        *ngIf=\"meta.loadMore\"\n      >\n        <button\n          aui-button=\"text\"\n          size=\"small\"\n          (click)=\"list.loadMore()\"\n        >\n          {{ 'load_more' | translate }}\n        </button>\n      </div>\n      <div\n        class=\"table-last-row--empty\"\n        *ngIf=\"!meta.loadMore && !meta.loading\"\n      >\n        <div class=\"table-last-row--empty-inner\"></div>\n      </div>\n    </ng-container>\n  </ng-container>\n</ng-container>\n\n<aui-back-top *ngIf=\"backTop\"></aui-back-top>\n", styles: [":host::ng-deep{position:sticky;left:0;display:flex;justify-content:center;align-items:center;font-size:14px;color:rgb(var(--aui-color-n-4))}:host::ng-deep .empty-placeholder,:host::ng-deep .table-placeholder{flex:1}:host::ng-deep .table-last-row--empty{height:var(--aui-border-radius-l);background-color:rgb(var(--aui-color-n-9));position:relative;margin-top:-3px;flex:1}:host::ng-deep .table-last-row--empty-inner{background-color:rgb(var(--aui-color-n-10));height:var(--aui-border-radius-l);border:1px solid rgb(var(--aui-color-n-8));border-top:0;border-bottom-left-radius:var(--aui-border-radius-l);border-bottom-right-radius:var(--aui-border-radius-l)}:host::ng-deep .table-placeholder{box-sizing:border-box;display:flex;justify-content:center;align-items:center;padding:15px 10px;min-height:60px;font-size:var(--aui-font-size-m);line-height:var(--aui-line-height-m);color:rgb(var(--aui-color-placeholder-text));background-color:rgb(var(--aui-color-n-10));border:solid 1px rgb(var(--aui-color-n-8));border-radius:var(--aui-border-radius-l);position:sticky;left:0}:host::ng-deep .table-placeholder>aui-icon:first-child{margin-right:var(--aui-spacing-m)}:host::ng-deep .aui-table .aui-table__row+.table-placeholder{border-top-left-radius:0;border-top-right-radius:0}:host::ng-deep .table-placeholder aui-icon{margin-right:8px}\n"] }]
    }], function () { return [{ type: i1.TranslateService }, { type: i2.ScrollDispatcher }, { type: i0.ViewContainerRef }]; }, { list: [{
            type: Input
        }], autoLoad: [{
            type: Input
        }], backTop: [{
            type: Input
        }], bottomDistance: [{
            type: Input
        }], resourceName: [{
            type: Input
        }], resourceName$: [], noDataTemplate: [{
            type: ContentChild,
            args: [K8sListFooterNoDataDirective, {
                    read: TemplateRef,
                }]
        }] }); })();
//# sourceMappingURL=data:application/json;base64, 