import * as i0 from '@angular/core';
import { Injectable, Pipe } from '@angular/core';

class CapitalizePipe {
    transform(value, { allWords, separator = ' ', combineWords, firstCharLower } = {}) {
        let newString;
        const newWordSeperator = combineWords ? '' : ' ';
        if (allWords) {
            newString = value
                .split(separator)
                .map(word => (word ? this._capitalizeWord(word) : word))
                .join(newWordSeperator);
        }
        else {
            newString = value ? this._capitalizeWord(value) : value;
        }
        if (firstCharLower) {
            newString = newString.charAt(0).toLowerCase() + newString.slice(1);
        }
        return newString;
    }
    _capitalizeWord(word) {
        return word.charAt(0).toUpperCase() + word.slice(1).toLowerCase();
    }
    static { this.ɵfac = function CapitalizePipe_Factory(t) { return new (t || CapitalizePipe)(); }; }
    static { this.ɵpipe = /*@__PURE__*/ i0.ɵɵdefinePipe({ name: "capitalize", type: CapitalizePipe, pure: true, standalone: true }); }
    static { this.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: CapitalizePipe, factory: CapitalizePipe.ɵfac, providedIn: 'root' }); }
}
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CapitalizePipe, [{
        type: Injectable,
        args: [{
                providedIn: 'root'
            }]
    }, {
        type: Pipe,
        args: [{
                name: 'capitalize',
                standalone: true
            }]
    }], null, null); })();

class TruncatePipe {
    transform(value, limit = 10, trail = '…') {
        if (!value) {
            return '';
        }
        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;
        }
    }
    static { this.ɵfac = function TruncatePipe_Factory(t) { return new (t || TruncatePipe)(); }; }
    static { this.ɵpipe = /*@__PURE__*/ i0.ɵɵdefinePipe({ name: "truncate", type: TruncatePipe, pure: true, standalone: true }); }
    static { this.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: TruncatePipe, factory: TruncatePipe.ɵfac, providedIn: 'root' }); }
}
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(TruncatePipe, [{
        type: Injectable,
        args: [{
                providedIn: 'root'
            }]
    }, {
        type: Pipe,
        args: [{
                name: 'truncate',
                standalone: true
            }]
    }], null, null); })();

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

export { CapitalizePipe, TruncatePipe };
//# sourceMappingURL=ironsource-fusion-ui-pipes-string.mjs.map
