import * as i0 from '@angular/core';
import { InjectionToken, input, inject, ChangeDetectionStrategy, Component, booleanAttribute, ElementRef, ViewContainerRef, ChangeDetectorRef, computed, Injector, Directive, Injectable, NgModule } from '@angular/core';
import { t, SiTranslatePipe } from '@siemens/element-translate-ng/translate';
import { ComponentPortal, DomPortalOutlet } from '@angular/cdk/portal';
import { BehaviorSubject, merge, timer, combineLatest } from 'rxjs';
import { filter, switchMap, map, takeUntil } from 'rxjs/operators';

/**
 * Copyright (c) Siemens 2016 - 2026
 * SPDX-License-Identifier: MIT
 */
const LOADING_SPINNER_BLOCKING = new InjectionToken('isBlockingSpinner');
const LOADING_SPINNER_OVERLAY = new InjectionToken('isSpinnerOverlay');
class SiLoadingSpinnerComponent {
    /**
     * @defaultValue
     * ```
     * inject(LOADING_SPINNER_BLOCKING, { optional: true })
     * ```
     */
    isBlockingSpinner = input(inject(LOADING_SPINNER_BLOCKING, { optional: true }), ...(ngDevMode ? [{ debugName: "isBlockingSpinner" }] : []));
    /**
     * @defaultValue
     * ```
     * inject(LOADING_SPINNER_OVERLAY, { optional: true })
     * ```
     */
    isSpinnerOverlay = input(inject(LOADING_SPINNER_OVERLAY, { optional: true }), ...(ngDevMode ? [{ debugName: "isSpinnerOverlay" }] : []));
    /**
     * Needed for a11y
     *
     * @defaultValue
     * ```
     * t(() => $localize`:@@SI_LOADING_SPINNER.LABEL:Loading`)
     * ```
     */
    ariaLabel = input(t(() => $localize `:@@SI_LOADING_SPINNER.LABEL:Loading`), ...(ngDevMode ? [{ debugName: "ariaLabel" }] : []));
    static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiLoadingSpinnerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
    static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.0.8", type: SiLoadingSpinnerComponent, isStandalone: true, selector: "si-loading-spinner", inputs: { isBlockingSpinner: { classPropertyName: "isBlockingSpinner", publicName: "isBlockingSpinner", isSignal: true, isRequired: false, transformFunction: null }, isSpinnerOverlay: { classPropertyName: "isSpinnerOverlay", publicName: "isSpinnerOverlay", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "animate.leave": "spinner-leave" } }, ngImport: i0, template: "<div\n  class=\"loading\"\n  aria-atomic=\"true\"\n  aria-live=\"assertive\"\n  [class.blocking-spinner]=\"isBlockingSpinner()\"\n  [class.spinner-overlay]=\"isSpinnerOverlay()\"\n>\n  <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\">\n    <title>{{ ariaLabel() | translate }}</title>\n    <g>\n      <path d=\"M256,156a16,16,0,0,1-16-16V80a16,16,0,0,1,32,0v60A16,16,0,0,1,256,156Z\" />\n      <path\n        d=\"M314.78,175.1a16,16,0,0,1-3.54-22.35l35.27-48.54A16,16,0,1,1,372.39,123l-35.26,48.54A16,16,0,0,1,314.78,175.1Z\"\n      />\n      <path\n        d=\"M351.11,225.1a16,16,0,0,1,10.27-20.16l57.06-18.54a16,16,0,1,1,9.89,30.43l-57.06,18.54A16,16,0,0,1,351.11,225.1Z\"\n      />\n      <path\n        d=\"M351.11,286.9a16,16,0,0,1,20.16-10.27l57.06,18.54a16,16,0,1,1-9.89,30.43l-57.06-18.54A16,16,0,0,1,351.11,286.9Z\"\n      />\n      <path\n        d=\"M314.78,336.9a16,16,0,0,1,22.35,3.54L372.39,389a16,16,0,1,1-25.88,18.81l-35.27-48.54A16,16,0,0,1,314.78,336.9Z\"\n      />\n      <path d=\"M256,356a16,16,0,0,1,16,16v60a16,16,0,0,1-32,0V372A16,16,0,0,1,256,356Z\" />\n      <path\n        d=\"M197.22,336.9a16,16,0,0,1,3.54,22.35l-35.27,48.54A16,16,0,1,1,139.61,389l35.26-48.54A16,16,0,0,1,197.22,336.9Z\"\n      />\n      <path\n        d=\"M160.89,286.9a16,16,0,0,1-10.27,20.16L93.56,325.6a16,16,0,0,1-9.89-30.43l57.06-18.54A16,16,0,0,1,160.89,286.9Z\"\n      />\n      <path\n        d=\"M160.89,225.1a16,16,0,0,1-20.16,10.27L83.67,216.83a16,16,0,1,1,9.89-30.43l57.06,18.54A16,16,0,0,1,160.89,225.1Z\"\n      />\n      <path\n        d=\"M197.22,175.1a16,16,0,0,1-22.35-3.54L139.61,123a16,16,0,1,1,25.88-18.81l35.27,48.54A16,16,0,0,1,197.22,175.1Z\"\n      />\n    </g>\n  </svg>\n</div>\n", styles: ["@keyframes spinner-fade{0%{opacity:1}to{opacity:.05}}:host{opacity:1;transition:opacity calc(.2s * var(--element-animations-enabled, 1)) ease-in}@starting-style{:host{opacity:0}}:host.spinner-leave{opacity:0;transition:opacity calc(.2s * var(--element-animations-enabled, 1)) ease-out}.loading{display:block;text-align:center}.blocking-spinner{background:var(--element-base-translucent-1)}.spinner-overlay{position:absolute;inset:0;z-index:1090;display:flex;justify-content:center;align-items:center}svg{inline-size:var(--loading-spinner-size, 64px);block-size:var(--loading-spinner-size, 64px)}path{--spinner-speed: calc(.2s - .1s * var(--element-animations-enabled, 1));fill:var(--loading-spinner-color, var(--element-ui-2));animation:spinner-fade calc(2s - 1s * var(--element-animations-enabled, 1)) infinite linear}path:nth-child(1){animation-delay:calc(0 * var(--spinner-speed));opacity:1}path:nth-child(2){animation-delay:calc(1 * var(--spinner-speed));opacity:.9}path:nth-child(3){animation-delay:calc(2 * var(--spinner-speed));opacity:.8}path:nth-child(4){animation-delay:calc(3 * var(--spinner-speed));opacity:.7}path:nth-child(5){animation-delay:calc(4 * var(--spinner-speed));opacity:.6}path:nth-child(6){animation-delay:calc(5 * var(--spinner-speed));opacity:.5}path:nth-child(7){animation-delay:calc(6 * var(--spinner-speed));opacity:.4}path:nth-child(8){animation-delay:calc(7 * var(--spinner-speed));opacity:.3}path:nth-child(9){animation-delay:calc(8 * var(--spinner-speed));opacity:.2}path:nth-child(10){animation-delay:calc(9 * var(--spinner-speed));opacity:.1}\n"], dependencies: [{ kind: "pipe", type: SiTranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiLoadingSpinnerComponent, decorators: [{
            type: Component,
            args: [{ selector: 'si-loading-spinner', imports: [SiTranslatePipe], changeDetection: ChangeDetectionStrategy.OnPush, host: {
                        'animate.leave': 'spinner-leave'
                    }, template: "<div\n  class=\"loading\"\n  aria-atomic=\"true\"\n  aria-live=\"assertive\"\n  [class.blocking-spinner]=\"isBlockingSpinner()\"\n  [class.spinner-overlay]=\"isSpinnerOverlay()\"\n>\n  <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\">\n    <title>{{ ariaLabel() | translate }}</title>\n    <g>\n      <path d=\"M256,156a16,16,0,0,1-16-16V80a16,16,0,0,1,32,0v60A16,16,0,0,1,256,156Z\" />\n      <path\n        d=\"M314.78,175.1a16,16,0,0,1-3.54-22.35l35.27-48.54A16,16,0,1,1,372.39,123l-35.26,48.54A16,16,0,0,1,314.78,175.1Z\"\n      />\n      <path\n        d=\"M351.11,225.1a16,16,0,0,1,10.27-20.16l57.06-18.54a16,16,0,1,1,9.89,30.43l-57.06,18.54A16,16,0,0,1,351.11,225.1Z\"\n      />\n      <path\n        d=\"M351.11,286.9a16,16,0,0,1,20.16-10.27l57.06,18.54a16,16,0,1,1-9.89,30.43l-57.06-18.54A16,16,0,0,1,351.11,286.9Z\"\n      />\n      <path\n        d=\"M314.78,336.9a16,16,0,0,1,22.35,3.54L372.39,389a16,16,0,1,1-25.88,18.81l-35.27-48.54A16,16,0,0,1,314.78,336.9Z\"\n      />\n      <path d=\"M256,356a16,16,0,0,1,16,16v60a16,16,0,0,1-32,0V372A16,16,0,0,1,256,356Z\" />\n      <path\n        d=\"M197.22,336.9a16,16,0,0,1,3.54,22.35l-35.27,48.54A16,16,0,1,1,139.61,389l35.26-48.54A16,16,0,0,1,197.22,336.9Z\"\n      />\n      <path\n        d=\"M160.89,286.9a16,16,0,0,1-10.27,20.16L93.56,325.6a16,16,0,0,1-9.89-30.43l57.06-18.54A16,16,0,0,1,160.89,286.9Z\"\n      />\n      <path\n        d=\"M160.89,225.1a16,16,0,0,1-20.16,10.27L83.67,216.83a16,16,0,1,1,9.89-30.43l57.06,18.54A16,16,0,0,1,160.89,225.1Z\"\n      />\n      <path\n        d=\"M197.22,175.1a16,16,0,0,1-22.35-3.54L139.61,123a16,16,0,1,1,25.88-18.81l35.27,48.54A16,16,0,0,1,197.22,175.1Z\"\n      />\n    </g>\n  </svg>\n</div>\n", styles: ["@keyframes spinner-fade{0%{opacity:1}to{opacity:.05}}:host{opacity:1;transition:opacity calc(.2s * var(--element-animations-enabled, 1)) ease-in}@starting-style{:host{opacity:0}}:host.spinner-leave{opacity:0;transition:opacity calc(.2s * var(--element-animations-enabled, 1)) ease-out}.loading{display:block;text-align:center}.blocking-spinner{background:var(--element-base-translucent-1)}.spinner-overlay{position:absolute;inset:0;z-index:1090;display:flex;justify-content:center;align-items:center}svg{inline-size:var(--loading-spinner-size, 64px);block-size:var(--loading-spinner-size, 64px)}path{--spinner-speed: calc(.2s - .1s * var(--element-animations-enabled, 1));fill:var(--loading-spinner-color, var(--element-ui-2));animation:spinner-fade calc(2s - 1s * var(--element-animations-enabled, 1)) infinite linear}path:nth-child(1){animation-delay:calc(0 * var(--spinner-speed));opacity:1}path:nth-child(2){animation-delay:calc(1 * var(--spinner-speed));opacity:.9}path:nth-child(3){animation-delay:calc(2 * var(--spinner-speed));opacity:.8}path:nth-child(4){animation-delay:calc(3 * var(--spinner-speed));opacity:.7}path:nth-child(5){animation-delay:calc(4 * var(--spinner-speed));opacity:.6}path:nth-child(6){animation-delay:calc(5 * var(--spinner-speed));opacity:.5}path:nth-child(7){animation-delay:calc(6 * var(--spinner-speed));opacity:.4}path:nth-child(8){animation-delay:calc(7 * var(--spinner-speed));opacity:.3}path:nth-child(9){animation-delay:calc(8 * var(--spinner-speed));opacity:.2}path:nth-child(10){animation-delay:calc(9 * var(--spinner-speed));opacity:.1}\n"] }]
        }], propDecorators: { isBlockingSpinner: [{ type: i0.Input, args: [{ isSignal: true, alias: "isBlockingSpinner", required: false }] }], isSpinnerOverlay: [{ type: i0.Input, args: [{ isSignal: true, alias: "isSpinnerOverlay", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }] } });

/**
 * Copyright (c) Siemens 2016 - 2026
 * SPDX-License-Identifier: MIT
 */
class SiLoadingButtonComponent {
    /**
     * Whether the button is disabled.
     * @defaultValue false
     */
    disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : {}), transform: booleanAttribute });
    /**
     * Whether the loading state should be displayed.
     * @defaultValue false
     */
    loading = input(false, { ...(ngDevMode ? { debugName: "loading" } : {}), transform: booleanAttribute });
    /**
     * Type of the button.
     * @defaultValue 'button'
     **/
    type = input('button', ...(ngDevMode ? [{ debugName: "type" }] : []));
    /** aria-label for the button */
    ariaLabel = input(...(ngDevMode ? [undefined, { debugName: "ariaLabel" }] : []));
    /** aria-labelledby for the button */
    ariaLabelledBy = input(...(ngDevMode ? [undefined, { debugName: "ariaLabelledBy" }] : []));
    /**
     * CSS class for the button.
     * @defaultValue ''
     */
    buttonClass = input('', ...(ngDevMode ? [{ debugName: "buttonClass" }] : []));
    handleClick(event) {
        if (this.disabled() || this.loading()) {
            event.stopPropagation();
        }
    }
    static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiLoadingButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
    static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.8", type: SiLoadingButtonComponent, isStandalone: true, selector: "si-loading-button", inputs: { disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledBy: { classPropertyName: "ariaLabelledBy", publicName: "ariaLabelledBy", isSignal: true, isRequired: false, transformFunction: null }, buttonClass: { classPropertyName: "buttonClass", publicName: "buttonClass", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.pe-none": "disabled()" } }, ngImport: i0, template: "<button\n  [type]=\"type()\"\n  [class]=\"buttonClass()\"\n  [class.loading]=\"loading()\"\n  [class.disabled]=\"loading()\"\n  [disabled]=\"disabled()\"\n  [attr.aria-disabled]=\"disabled() || loading()\"\n  [attr.aria-label]=\"ariaLabel() | translate\"\n  [attr.aria-labelledby]=\"ariaLabelledBy()\"\n  [attr.tabindex]=\"loading() ? '-1' : null\"\n  (click)=\"handleClick($event)\"\n>\n  <div class=\"button-wrapper\">\n    <ng-content />\n  </div>\n</button>\n@if (loading()) {\n  <div class=\"spinner-wrapper\" (click)=\"$event.stopPropagation()\">\n    <si-loading-spinner />\n  </div>\n}\n", styles: [":host{position:relative;display:inline-flex;align-items:center;justify-content:center}button{inline-size:100%}button.loading .button-wrapper,button.loading:before{opacity:0}.button-wrapper,.spinner-wrapper{display:flex;align-items:center;justify-content:center}.spinner-wrapper{--loading-spinner-size: 24px;--loading-spinner-color: var(--element-ui-6);position:absolute;inset:0}:is(.btn-secondary,.btn-tertiary)+.spinner-wrapper{--loading-spinner-color: var(--element-action-secondary-text)}.btn-danger+.spinner-wrapper{--loading-spinner-color: var(--element-action-danger-text)}.btn-warning+.spinner-wrapper{--loading-spinner-color: var(--element-action-warning-text)}.btn-ghost+.spinner-wrapper{--loading-spinner-color: var(--element-ui-2)}:is(.btn-secondary-warning,.btn-tertiary-warning)+.spinner-wrapper{--loading-spinner-color: var(--element-action-secondary-warning)}:is(.btn-secondary-danger,.btn-tertiary-danger)+.spinner-wrapper{--loading-spinner-color: var(--element-action-secondary-danger)}\n"], dependencies: [{ kind: "component", type: SiLoadingSpinnerComponent, selector: "si-loading-spinner", inputs: ["isBlockingSpinner", "isSpinnerOverlay", "ariaLabel"] }, { kind: "pipe", type: SiTranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiLoadingButtonComponent, decorators: [{
            type: Component,
            args: [{ selector: 'si-loading-button', imports: [SiLoadingSpinnerComponent, SiTranslatePipe], changeDetection: ChangeDetectionStrategy.OnPush, host: {
                        '[class.pe-none]': 'disabled()'
                    }, template: "<button\n  [type]=\"type()\"\n  [class]=\"buttonClass()\"\n  [class.loading]=\"loading()\"\n  [class.disabled]=\"loading()\"\n  [disabled]=\"disabled()\"\n  [attr.aria-disabled]=\"disabled() || loading()\"\n  [attr.aria-label]=\"ariaLabel() | translate\"\n  [attr.aria-labelledby]=\"ariaLabelledBy()\"\n  [attr.tabindex]=\"loading() ? '-1' : null\"\n  (click)=\"handleClick($event)\"\n>\n  <div class=\"button-wrapper\">\n    <ng-content />\n  </div>\n</button>\n@if (loading()) {\n  <div class=\"spinner-wrapper\" (click)=\"$event.stopPropagation()\">\n    <si-loading-spinner />\n  </div>\n}\n", styles: [":host{position:relative;display:inline-flex;align-items:center;justify-content:center}button{inline-size:100%}button.loading .button-wrapper,button.loading:before{opacity:0}.button-wrapper,.spinner-wrapper{display:flex;align-items:center;justify-content:center}.spinner-wrapper{--loading-spinner-size: 24px;--loading-spinner-color: var(--element-ui-6);position:absolute;inset:0}:is(.btn-secondary,.btn-tertiary)+.spinner-wrapper{--loading-spinner-color: var(--element-action-secondary-text)}.btn-danger+.spinner-wrapper{--loading-spinner-color: var(--element-action-danger-text)}.btn-warning+.spinner-wrapper{--loading-spinner-color: var(--element-action-warning-text)}.btn-ghost+.spinner-wrapper{--loading-spinner-color: var(--element-ui-2)}:is(.btn-secondary-warning,.btn-tertiary-warning)+.spinner-wrapper{--loading-spinner-color: var(--element-action-secondary-warning)}:is(.btn-secondary-danger,.btn-tertiary-danger)+.spinner-wrapper{--loading-spinner-color: var(--element-action-secondary-danger)}\n"] }]
        }], propDecorators: { disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], ariaLabelledBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabelledBy", required: false }] }], buttonClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "buttonClass", required: false }] }] } });

/**
 * Copyright (c) Siemens 2016 - 2026
 * SPDX-License-Identifier: MIT
 */
class SiLoadingSpinnerDirective {
    /**
     * Displays the loading spinner when the value is either true or non-zero.
     */
    siLoading = input.required(...(ngDevMode ? [{ debugName: "siLoading" }] : []));
    /**
     * Displays semi-transparent backdrop for the spinner, default is false.
     *
     * @defaultValue false
     */
    blocking = input(false, { ...(ngDevMode ? { debugName: "blocking" } : {}), transform: booleanAttribute });
    /**
     * Specifies if the spinner should be displayed after a delay, default is true.
     *
     * @defaultValue true
     */
    initialDelay = input(true, { ...(ngDevMode ? { debugName: "initialDelay" } : {}), transform: booleanAttribute });
    el = inject(ElementRef);
    viewRef = inject(ViewContainerRef);
    cdRef = inject(ChangeDetectorRef);
    sub;
    progressSubject = new BehaviorSubject(false);
    off$ = this.progressSubject.pipe(filter(val => !val));
    on$ = this.progressSubject.pipe(filter(val => val));
    initialWaitTime = computed(() => (this.initialDelay() ? 500 : 0), ...(ngDevMode ? [{ debugName: "initialWaitTime" }] : []));
    minSpinTime = 500;
    portalOutlet;
    compPortal = new ComponentPortal(SiLoadingSpinnerComponent, this.viewRef, Injector.create({
        providers: [
            { provide: LOADING_SPINNER_BLOCKING, useFactory: () => this.blocking() },
            {
                provide: LOADING_SPINNER_OVERLAY,
                useValue: true
            }
        ]
    }));
    // this makes sure the spinner only displays with a delay of 500ms and stays for 500ms so
    // that it doesn't flicker
    spinner$ = this.on$.pipe(switchMap(() => merge(timer(this.initialWaitTime()).pipe(map(() => true), takeUntil(this.off$)), combineLatest([this.off$, timer(this.initialWaitTime() + this.minSpinTime)]).pipe(map(() => false)))));
    createPortal() {
        this.portalOutlet ??= new DomPortalOutlet(this.el.nativeElement);
        this.compPortal.attach(this.portalOutlet);
    }
    ngOnInit() {
        this.sub = this.spinner$.subscribe(val => {
            if (val) {
                if (!this.compPortal.isAttached) {
                    this.createPortal();
                }
            }
            else if (this.compPortal.isAttached) {
                this.compPortal.detach();
            }
            this.cdRef.markForCheck();
        });
    }
    ngOnChanges() {
        const newState = !!this.siLoading();
        if (newState !== this.progressSubject.value) {
            this.progressSubject.next(newState);
        }
    }
    ngOnDestroy() {
        this.sub?.unsubscribe();
        if (this.compPortal.isAttached) {
            this.compPortal.detach();
        }
        this.portalOutlet?.dispose();
    }
    static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiLoadingSpinnerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
    static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.0.8", type: SiLoadingSpinnerDirective, isStandalone: true, selector: "[siLoading]", inputs: { siLoading: { classPropertyName: "siLoading", publicName: "siLoading", isSignal: true, isRequired: true, transformFunction: null }, blocking: { classPropertyName: "blocking", publicName: "blocking", isSignal: true, isRequired: false, transformFunction: null }, initialDelay: { classPropertyName: "initialDelay", publicName: "initialDelay", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "position-relative" }, usesOnChanges: true, ngImport: i0 });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiLoadingSpinnerDirective, decorators: [{
            type: Directive,
            args: [{
                    selector: '[siLoading]',
                    host: {
                        class: 'position-relative'
                    }
                }]
        }], propDecorators: { siLoading: [{ type: i0.Input, args: [{ isSignal: true, alias: "siLoading", required: true }] }], blocking: [{ type: i0.Input, args: [{ isSignal: true, alias: "blocking", required: false }] }], initialDelay: [{ type: i0.Input, args: [{ isSignal: true, alias: "initialDelay", required: false }] }] } });

/**
 * Copyright (c) Siemens 2016 - 2026
 * SPDX-License-Identifier: MIT
 */
class SiLoadingService {
    /**
     * Counts the number of loads active, is `0` when all loading is finished (or hasn't started).
     */
    counter = new BehaviorSubject(0);
    /**
     * Start the loading.
     */
    startLoad() {
        this.counter.next(this.counter.value + 1);
    }
    /**
     * Stop the loading.
     */
    stopLoad() {
        if (this.counter.value > 0) {
            this.counter.next(this.counter.value - 1);
        }
    }
    static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiLoadingService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
    static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiLoadingService, providedIn: 'root' });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiLoadingService, decorators: [{
            type: Injectable,
            args: [{
                    providedIn: 'root'
                }]
        }] });

/**
 * Copyright (c) Siemens 2016 - 2026
 * SPDX-License-Identifier: MIT
 */
class SiLoadingSpinnerModule {
    static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiLoadingSpinnerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
    static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.0.8", ngImport: i0, type: SiLoadingSpinnerModule, imports: [SiLoadingSpinnerComponent, SiLoadingSpinnerDirective], exports: [SiLoadingSpinnerComponent, SiLoadingSpinnerDirective] });
    static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiLoadingSpinnerModule });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiLoadingSpinnerModule, decorators: [{
            type: NgModule,
            args: [{
                    imports: [SiLoadingSpinnerComponent, SiLoadingSpinnerDirective],
                    exports: [SiLoadingSpinnerComponent, SiLoadingSpinnerDirective]
                }]
        }] });

/**
 * Copyright (c) Siemens 2016 - 2026
 * SPDX-License-Identifier: MIT
 */

/**
 * Generated bundle index. Do not edit.
 */

export { LOADING_SPINNER_BLOCKING, LOADING_SPINNER_OVERLAY, SiLoadingButtonComponent, SiLoadingService, SiLoadingSpinnerComponent, SiLoadingSpinnerDirective, SiLoadingSpinnerModule };
//# sourceMappingURL=siemens-element-ng-loading-spinner.mjs.map
