import * as i0 from '@angular/core';
import { Pipe, NgModule } from '@angular/core';
import { coerceBooleanProperty } from '@angular/cdk/coercion';

class EuiTruncatePipe {
    transform(value, limit = 40, trail = '\u2026') {
        if (value) {
            if (limit < 0) {
                limit *= -1;
                return value.length > limit ? trail + value.substring(value.length - limit, value.length) : value;
            }
            else {
                return value.length > limit ? value.substring(0, limit) + trail : value;
            }
        }
        return;
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: EuiTruncatePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
    static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.17", ngImport: i0, type: EuiTruncatePipe, isStandalone: true, name: "euiTruncate" }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: EuiTruncatePipe, decorators: [{
            type: Pipe,
            args: [{
                    name: 'euiTruncate',
                }]
        }] });
/**
 * @description
 * Module that provides the EuiTruncatePipe pipe.
 *
 * @deprecated Use {@link EuiTruncatePipe} instead.
 */
class EuiTruncatePipeModule {
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: EuiTruncatePipeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
    static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.17", ngImport: i0, type: EuiTruncatePipeModule, imports: [EuiTruncatePipe], exports: [EuiTruncatePipe] }); }
    static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: EuiTruncatePipeModule }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: EuiTruncatePipeModule, decorators: [{
            type: NgModule,
            args: [{
                    imports: [EuiTruncatePipe],
                    exports: [EuiTruncatePipe],
                }]
        }] });

class EuiCoerceBooleanPipe {
    transform(value) {
        return coerceBooleanProperty(value);
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: EuiCoerceBooleanPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
    static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.17", ngImport: i0, type: EuiCoerceBooleanPipe, isStandalone: true, name: "coerceBool" }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: EuiCoerceBooleanPipe, decorators: [{
            type: Pipe,
            args: [{
                    name: 'coerceBool',
                    pure: true,
                }]
        }] });
/**
 * @description
 * Module that provides the EuiCoerceBooleanPipe pipe.
 *
 * @deprecated Use {@link EuiCoerceBooleanPipe} instead.
 */
class EuiCoerceBooleanPipeModule {
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: EuiCoerceBooleanPipeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
    static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.17", ngImport: i0, type: EuiCoerceBooleanPipeModule, imports: [EuiCoerceBooleanPipe], exports: [EuiCoerceBooleanPipe] }); }
    static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: EuiCoerceBooleanPipeModule }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: EuiCoerceBooleanPipeModule, decorators: [{
            type: NgModule,
            args: [{
                    imports: [EuiCoerceBooleanPipe],
                    exports: [EuiCoerceBooleanPipe],
                }]
        }] });

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

export { EuiCoerceBooleanPipe, EuiCoerceBooleanPipeModule, EuiTruncatePipe, EuiTruncatePipeModule };
//# sourceMappingURL=eui-components-pipes.mjs.map
