import { Component, Input } from '@angular/core';
import { gettext } from '@c8y/ngx-components/gettext';
import { NgIf } from '@angular/common';
import { C8yTranslatePipe } from '../i18n';
import * as i0 from "@angular/core";
export class LoadingComponent {
    constructor() {
        /**
         * Defining the layout of the loading component. By default the
         * component loading activity is used.
         */
        this.layout = 'component';
        /**
         * If set, a progress bar is shown. The layout property is ignored.
         */
        this.progress = null;
        /**
         * Showing a message while loading. The application layout by default shows the label `Loading…`.
         */
        this.message = null;
    }
    /**
     * @ignore
     */
    get defaultLoadingMessage() {
        if (this.message !== null) {
            return this.message;
        }
        return this.layout === 'application' ? gettext('Loading…') : null;
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LoadingComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: LoadingComponent, isStandalone: true, selector: "c8y-loading", inputs: { layout: "layout", progress: "progress", message: "message" }, ngImport: i0, template: "<div\n  class=\"spinner p-relative\"\n  *ngIf=\"layout === 'component' && progress === null\"\n>\n  <div class=\"rect1\"></div>\n  <div class=\"rect2\"></div>\n  <div class=\"rect3\"></div>\n  <div class=\"rect4\"></div>\n  <div class=\"rect5\"></div>\n</div>\n\n<div\n  class=\"spinner-snake\"\n  *ngIf=\"layout === 'application' && progress === null\"\n></div>\n\n<div\n  class=\"loading-bar active\"\n  *ngIf=\"layout === 'page' && progress === null\"\n></div>\n\n<div\n  class=\"progress progress-striped active\"\n  *ngIf=\"progress !== null\"\n>\n  <div\n    class=\"progress-bar\"\n    [style.width]=\"progress + '%'\"\n    [attr.aria-label]=\"'Progress' | translate\"\n    aria-valuemin=\"0\"\n    aria-valuemax=\"100\"\n    [attr.aria-valuenow]=\"progress\"\n    role=\"progressbar\"\n  ></div>\n</div>\n\n<p\n  class=\"text-center\"\n  *ngIf=\"defaultLoadingMessage\"\n>\n  {{ defaultLoadingMessage | translate }}\n</p>\n", dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: C8yTranslatePipe, name: "translate" }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LoadingComponent, decorators: [{
            type: Component,
            args: [{ selector: 'c8y-loading', standalone: true, imports: [NgIf, C8yTranslatePipe], template: "<div\n  class=\"spinner p-relative\"\n  *ngIf=\"layout === 'component' && progress === null\"\n>\n  <div class=\"rect1\"></div>\n  <div class=\"rect2\"></div>\n  <div class=\"rect3\"></div>\n  <div class=\"rect4\"></div>\n  <div class=\"rect5\"></div>\n</div>\n\n<div\n  class=\"spinner-snake\"\n  *ngIf=\"layout === 'application' && progress === null\"\n></div>\n\n<div\n  class=\"loading-bar active\"\n  *ngIf=\"layout === 'page' && progress === null\"\n></div>\n\n<div\n  class=\"progress progress-striped active\"\n  *ngIf=\"progress !== null\"\n>\n  <div\n    class=\"progress-bar\"\n    [style.width]=\"progress + '%'\"\n    [attr.aria-label]=\"'Progress' | translate\"\n    aria-valuemin=\"0\"\n    aria-valuemax=\"100\"\n    [attr.aria-valuenow]=\"progress\"\n    role=\"progressbar\"\n  ></div>\n</div>\n\n<p\n  class=\"text-center\"\n  *ngIf=\"defaultLoadingMessage\"\n>\n  {{ defaultLoadingMessage | translate }}\n</p>\n" }]
        }], propDecorators: { layout: [{
                type: Input
            }], progress: [{
                type: Input
            }], message: [{
                type: Input
            }] } });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibG9hZGluZy5jb21wb25lbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9jb3JlL2NvbW1vbi9sb2FkaW5nLmNvbXBvbmVudC50cyIsIi4uLy4uLy4uLy4uL2NvcmUvY29tbW9uL2xvYWRpbmcuY29tcG9uZW50Lmh0bWwiXSwibmFtZ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