import { coerceNumberProperty } from '@angular/cdk/coercion';
import { NgTemplateOutlet } from '@angular/common';
import * as i0 from '@angular/core';
import { Pipe, input, booleanAttribute, output, inject, ElementRef, computed, signal, effect, forwardRef, ChangeDetectionStrategy, ViewEncapsulation, Component, NgModule } from '@angular/core';
import { toSignal } from '@angular/core/rxjs-interop';
import { NG_VALUE_ACCESSOR } from '@angular/forms';
import { registerFormItemControl } from '@fundamental-ngx/core/form';
import { PopoverTriggerDirective, PopoverComponent } from '@fundamental-ngx/core/popover';
import { TranslationResolver, FD_LANGUAGE, FdTranslatePipe } from '@fundamental-ngx/i18n';

const INDICATOR_PREFIX = 'fd-rating-indicator';
const INDICATOR_CLASSES = {
    halves: `${INDICATOR_PREFIX}--half-star`,
    icon: `${INDICATOR_PREFIX}--icon`,
    hideDynamicText: `${INDICATOR_PREFIX}--hide-dynamic-text`
};
const INDICATOR_DEFAULT_CAPACITY = 5;
var RatingIndicatorSizeEnum;
(function (RatingIndicatorSizeEnum) {
    RatingIndicatorSizeEnum[RatingIndicatorSizeEnum["xs"] = 0] = "xs";
    RatingIndicatorSizeEnum[RatingIndicatorSizeEnum["sm"] = 1] = "sm";
    RatingIndicatorSizeEnum[RatingIndicatorSizeEnum["md"] = 2] = "md";
    RatingIndicatorSizeEnum[RatingIndicatorSizeEnum["lg"] = 3] = "lg";
    RatingIndicatorSizeEnum[RatingIndicatorSizeEnum["cozy"] = 4] = "cozy";
    RatingIndicatorSizeEnum[RatingIndicatorSizeEnum["compact"] = 5] = "compact";
    RatingIndicatorSizeEnum[RatingIndicatorSizeEnum["condensed"] = 6] = "condensed";
})(RatingIndicatorSizeEnum || (RatingIndicatorSizeEnum = {}));

class RatingStarLabelPipe {
    constructor() {
        /** @hidden */
        this._translationResolver = new TranslationResolver();
    }
    /** Transforms the value to a rating value string. */
    transform(index, controlsCount, useHalves, currentLanguage) {
        const ofTranslation = this._translationResolver.resolve(currentLanguage, 'coreRatingIndicator.ariaLabelValue');
        if (useHalves) {
            return `${index / 2 + 0.5} ${ofTranslation} ${controlsCount / 2}`;
        }
        return `${index + 1} ${ofTranslation} ${controlsCount}`;
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: RatingStarLabelPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
    static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "21.1.0", ngImport: i0, type: RatingStarLabelPipe, isStandalone: true, name: "ratingStarLabel" }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: RatingStarLabelPipe, decorators: [{
            type: Pipe,
            args: [{
                    name: 'ratingStarLabel'
                }]
        }] });

let ratingUID = 0;
class RatingIndicatorComponent {
    /** @hidden */
    constructor() {
        /** Sets [name] attribute of input. */
        this.name = input(...(ngDevMode ? [undefined, { debugName: "name" }] : []));
        /**
         * Sets the aria-label attribute to the element.
         */
        this.ariaLabel = input(...(ngDevMode ? [undefined, { debugName: "ariaLabel" }] : []));
        /**
         * Sets the aria-labelledby attribute to the element.
         */
        this.ariaLabelledBy = input(...(ngDevMode ? [undefined, { debugName: "ariaLabelledBy" }] : []));
        /**
         * Sets the aria-roledescription attribute to the element.
         */
        this.ariaRoledescription = input(...(ngDevMode ? [undefined, { debugName: "ariaRoledescription" }] : []));
        /**
         * Input for disabled state from parent component.
         * Sets the aria-disabled attribute to the element.
         * Sets the is-disabled class to the element.
         */
        this.disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : {}), transform: booleanAttribute });
        /**
         * Whether the rating indicator is in displayMode
         */
        this.displayMode = input(false, { ...(ngDevMode ? { debugName: "displayMode" } : {}), transform: booleanAttribute });
        /**
         * Whether the rating indicator is in non-interactive state.
         */
        this.nonInteractive = input(false, { ...(ngDevMode ? { debugName: "nonInteractive" } : {}), transform: booleanAttribute });
        /**
         * Number of rates to display
         */
        this.indicatorCapacity = input(INDICATOR_DEFAULT_CAPACITY, { ...(ngDevMode ? { debugName: "indicatorCapacity" } : {}), transform: (value) => {
                const val = coerceNumberProperty(value, INDICATOR_DEFAULT_CAPACITY);
                return val < 1 ? INDICATOR_DEFAULT_CAPACITY : val;
            } });
        /**
         * Whether or not to display half values.
         */
        this.allowHalves = input(false, { ...(ngDevMode ? { debugName: "allowHalves" } : {}), transform: booleanAttribute });
        /**
         * User's value number of ratings. If provided, Overrides ratingAverage.
         */
        this.value = input(0, ...(ngDevMode ? [{ debugName: "value" }] : []));
        /**
         * Total number of ratings. If provided, will display text showing the total number of ratings.
         */
        this.totalRatings = input(undefined, ...(ngDevMode ? [{ debugName: "totalRatings" }] : []));
        /**
         * Rating average
         */
        this.ratingAverage = input(undefined, ...(ngDevMode ? [{ debugName: "ratingAverage" }] : []));
        /**
         * Object containing key-value pairs where the key is the rating and the value is the total sum of those ratings.
         * Overrides totalRatings and ratingAverage.
         */
        this.ratings = input(undefined, ...(ngDevMode ? [{ debugName: "ratings" }] : []));
        /**
         * Whether or not to display the popover that shows the sum of each rating. Requires [ratings] object.
         */
        this.displayAllRatings = input(false, { ...(ngDevMode ? { debugName: "displayAllRatings" } : {}), transform: booleanAttribute });
        /**
         * Icon class for rated icon from fundamental-styles lib https://sap.github.io/fundamental-styles/?path=/docs/components-icon--sizes
         */
        this.ratedIcon = input(undefined, ...(ngDevMode ? [{ debugName: "ratedIcon" }] : []));
        /**
         * Icon class for unrated icon from fundamental-styles lib https://sap.github.io/fundamental-styles/?path=/docs/components-icon--sizes
         */
        this.unratedIcon = input(undefined, ...(ngDevMode ? [{ debugName: "unratedIcon" }] : []));
        /**
         * Possible values are 'xs', 'sm', 'md', 'lg', 'cozy', 'compact', 'condensed'
         */
        this.size = input('md', ...(ngDevMode ? [{ debugName: "size" }] : []));
        /**
         * Text divider label between view value and indicator count.
         */
        this.dynamicTextIndicator = input('of', ...(ngDevMode ? [{ debugName: "dynamicTextIndicator" }] : []));
        /**
         * Whether to display the dynamic text (rating value and count) after the rating indicator.
         * When false, only the star rating UI is shown without any text.
         */
        this.showDynamicText = input(true, { ...(ngDevMode ? { debugName: "showDynamicText" } : {}), transform: booleanAttribute });
        /**
         * Fired when the user sets or changes their rating.
         */
        this.ratingChanged = output();
        /** @hidden */
        this.elementRef = inject((ElementRef));
        /** Computed display value - returns the current internal value */
        this.displayValue = computed(() => this.internalValue(), ...(ngDevMode ? [{ debugName: "displayValue" }] : []));
        /** @hidden Current language signal for i18n */
        this.language = toSignal(inject(FD_LANGUAGE), {
            initialValue: {}
        });
        /** @hidden Internal mutable value for CVA and computed display value */
        this.internalValue = signal(0, ...(ngDevMode ? [{ debugName: "internalValue" }] : []));
        /**
         * Internal mutable disabled state.
         * Allows ControlValueAccessor to modify disabled state independently of input.
         */
        this.internalDisabled = signal(false, ...(ngDevMode ? [{ debugName: "internalDisabled" }] : []));
        /** @hidden Internal total ratings for computed state */
        this.internalTotalRatings = signal(undefined, ...(ngDevMode ? [{ debugName: "internalTotalRatings" }] : []));
        /** @hidden Internal rating average for computed state */
        this.internalRatingAverage = signal(undefined, ...(ngDevMode ? [{ debugName: "internalRatingAverage" }] : []));
        /** @hidden Rating items for popover content */
        this.ratingItems = signal([], ...(ngDevMode ? [{ debugName: "ratingItems" }] : []));
        /** @hidden Unique ID for this rating indicator instance */
        this.ratingUID = ratingUID++;
        /** @hidden Computed size class based on size input */
        this.sizeClass = computed(() => this._getSizeClass(this.size()), ...(ngDevMode ? [{ debugName: "sizeClass" }] : []));
        /** @hidden Computed rates array based on capacity and halves setting */
        this.rates = computed(() => this._getRates(), ...(ngDevMode ? [{ debugName: "rates" }] : []));
        /** @hidden Computed signal to determine if dynamic text should be hidden */
        this.hideDynamicText = computed(() => {
            const value = this.displayValue();
            const totalRatings = this.computedTotalRatings;
            // Only hide if value is 0 AND we don't have total ratings to show
            return !value && (totalRatings === undefined || totalRatings === null);
        }, ...(ngDevMode ? [{ debugName: "hideDynamicText" }] : []));
        /** @hidden Computed CSS classes for host binding */
        this.cssClass = computed(() => {
            const classes = [
                INDICATOR_PREFIX,
                this.sizeClass(),
                this.allowHalves() ? INDICATOR_CLASSES.halves : '',
                this.ratedIcon() && this.unratedIcon() ? INDICATOR_CLASSES.icon : '',
                this.hideDynamicText() ? INDICATOR_CLASSES.hideDynamicText : '',
                this.disabled() || this.internalDisabled() ? 'is-disabled' : '',
                this.displayMode() ? 'fd-rating-indicator--display-mode' : '',
                this.nonInteractive() ? 'fd-rating-indicator--non-interactive' : ''
            ];
            return classes.filter(Boolean).join(' ');
        }, ...(ngDevMode ? [{ debugName: "cssClass" }] : []));
        /** @hidden CVA onChange callback */
        this.onChange = () => { };
        /** @hidden CVA onTouched callback */
        this.onTouched = () => { };
        // Sync ratings input with internal state
        effect(() => {
            const ratingsInput = this.ratings();
            if (ratingsInput) {
                this._generateRatings(ratingsInput);
            }
        });
        // Initialize internalValue from inputs once, then let CVA handle updates
        let initialized = false;
        effect(() => {
            // Only run once for initialization
            if (initialized) {
                return;
            }
            // Read all potential sources
            const inputValue = this.value();
            const internalAvg = this.internalRatingAverage();
            const avgValue = this.ratingAverage();
            // Determine source value with proper priority
            let sourceValue = 0;
            if (inputValue && inputValue !== 0) {
                sourceValue = inputValue;
            }
            else if (internalAvg !== undefined && internalAvg !== null) {
                sourceValue = internalAvg;
            }
            else if (avgValue !== undefined && avgValue !== null) {
                sourceValue = avgValue;
            }
            const parsedValue = this._parseValue(sourceValue);
            this.internalValue.set(parsedValue);
            initialized = true;
        });
    }
    /**
     * @deprecated Use `displayValue()` signal directly instead
     * @hidden Backward compatibility getter
     */
    get viewValue() {
        return this.displayValue();
    }
    /**
     * @deprecated Use `ratingUID` property directly instead
     * @hidden Backward compatibility getter
     */
    get viewRatingUID() {
        return this.ratingUID;
    }
    /**
     * @deprecated Use `indicatorCapacity()` signal directly instead
     * @hidden Backward compatibility getter
     */
    get indicatorCount() {
        return this.indicatorCapacity();
    }
    /** Public getter for computed rating average value. */
    get computedRatingAverage() {
        return this.internalRatingAverage() ?? this.ratingAverage();
    }
    /** Public getter for computed total ratings value. */
    get computedTotalRatings() {
        return this.internalTotalRatings() ?? this.totalRatings();
    }
    /** @hidden CVA writeValue - updates internal value signal */
    writeValue(value) {
        this.internalValue.set(this._parseValue(value));
    }
    /** @hidden */
    registerOnChange(fn) {
        this.onChange = fn;
    }
    /** @hidden */
    registerOnTouched(fn) {
        this.onTouched = fn;
    }
    /** @hidden */
    setDisabledState(isDisabled) {
        this.internalDisabled.set(isDisabled);
    }
    /** @hidden User selection handler */
    onSelect(value) {
        this.internalValue.set(value);
        this.onChange(value);
        this.onTouched();
        this.ratingChanged.emit(value);
    }
    /**
     * @hidden
     * Generate rating items for popover content from ratings object
     */
    _generateRatings(ratingsInput) {
        const ratings = Object.entries(ratingsInput)
            .filter(([rate, vote]) => {
            const numRate = +rate;
            const numVote = +vote;
            return !isNaN(numRate) && !isNaN(numVote) && numRate > 0;
        })
            .map(([rate, votes]) => ({ rate: +rate, votes }));
        if (ratings.length === 0) {
            return;
        }
        const { totalVotes, totalRating } = ratings.reduce((acc, rating) => ({
            totalVotes: acc.totalVotes + rating.votes,
            totalRating: acc.totalRating + rating.rate * rating.votes
        }), { totalVotes: 0, totalRating: 0 });
        this.ratingItems.set(ratings);
        this.internalRatingAverage.set(totalRating / totalVotes);
        this.internalTotalRatings.set(totalVotes);
    }
    /**
     * @hidden
     * get converted value from original to view value with depends on halves
     * For example,
     *  original value is equal to 2.34, you will get and render 2
     *  original value is equal to 3.74, you will get and render 4
     */
    _parseValue(value) {
        if (!value || value === 0) {
            return 0;
        }
        const integer = Math.floor(value);
        const fractional = value % 1;
        let v = integer;
        if (this.allowHalves() && fractional > 0.25 && fractional <= 0.5) {
            v = integer + 0.5;
        }
        else if (fractional > 0.5) {
            v = integer + 1;
        }
        return Math.min(this.indicatorCapacity(), v);
    }
    /**
     * @hidden
     * get rating icons array with value and unique id
     */
    _getRates() {
        const withHalves = this.allowHalves() ? 2 : 1;
        const capacity = this.indicatorCapacity();
        return Array(capacity * withHalves)
            .fill(`rating-${this.ratingUID}`)
            .map((name, index) => ({
            id: `${name}-${index + 1}`,
            value: (index + 1) / withHalves
        }));
    }
    /**
     * @hidden
     * Get size class for the rating indicator
     */
    _getSizeClass(size) {
        return `${INDICATOR_PREFIX}--${size in RatingIndicatorSizeEnum ? size : 'md'}`;
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: RatingIndicatorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.0", type: RatingIndicatorComponent, isStandalone: true, selector: "fd-rating-indicator", inputs: { name: { classPropertyName: "name", publicName: "name", 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 }, ariaRoledescription: { classPropertyName: "ariaRoledescription", publicName: "ariaRoledescription", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, displayMode: { classPropertyName: "displayMode", publicName: "displayMode", isSignal: true, isRequired: false, transformFunction: null }, nonInteractive: { classPropertyName: "nonInteractive", publicName: "nonInteractive", isSignal: true, isRequired: false, transformFunction: null }, indicatorCapacity: { classPropertyName: "indicatorCapacity", publicName: "indicatorCapacity", isSignal: true, isRequired: false, transformFunction: null }, allowHalves: { classPropertyName: "allowHalves", publicName: "allowHalves", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, totalRatings: { classPropertyName: "totalRatings", publicName: "totalRatings", isSignal: true, isRequired: false, transformFunction: null }, ratingAverage: { classPropertyName: "ratingAverage", publicName: "ratingAverage", isSignal: true, isRequired: false, transformFunction: null }, ratings: { classPropertyName: "ratings", publicName: "ratings", isSignal: true, isRequired: false, transformFunction: null }, displayAllRatings: { classPropertyName: "displayAllRatings", publicName: "displayAllRatings", isSignal: true, isRequired: false, transformFunction: null }, ratedIcon: { classPropertyName: "ratedIcon", publicName: "ratedIcon", isSignal: true, isRequired: false, transformFunction: null }, unratedIcon: { classPropertyName: "unratedIcon", publicName: "unratedIcon", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, dynamicTextIndicator: { classPropertyName: "dynamicTextIndicator", publicName: "dynamicTextIndicator", isSignal: true, isRequired: false, transformFunction: null }, showDynamicText: { classPropertyName: "showDynamicText", publicName: "showDynamicText", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { ratingChanged: "ratingChanged" }, host: { properties: { "class": "cssClass()", "attr.aria-label": "ariaLabel()", "attr.aria-labelledby": "ariaLabelledBy()", "attr.disabled": "disabled()" } }, providers: [
            {
                provide: NG_VALUE_ACCESSOR,
                useExisting: forwardRef(() => RatingIndicatorComponent),
                multi: true
            },
            registerFormItemControl(RatingIndicatorComponent)
        ], ngImport: i0, template: "<ng-template #zeroRate let-halves=\"halves\">\n    <input\n        [attr.aria-label]=\"'coreRatingIndicator.ariaLabelReset' | fdTranslate\"\n        role=\"button\"\n        type=\"radio\"\n        class=\"fd-rating-indicator__input fd-rating-indicator__input--zero-rating\"\n        (change)=\"onSelect(0)\"\n        [disabled]=\"disabled() || nonInteractive() || displayMode()\"\n        name=\"rating-{{ ratingUID }}{{ halves ? '-halves' : '' }}\"\n        [attr.checked]=\"displayValue() === 0 ? true : null\"\n        value=\"0\"\n    />\n    <label class=\"fd-rating-indicator__label fd-rating-indicator__label--zero-rating\" aria-hidden=\"true\"></label>\n</ng-template>\n<!--  role=\"application\" is used in order to let user to change value with left/right arrows in JAWS, since JAWS ovverrides these actions -->\n<div\n    class=\"fd-rating-indicator__container\"\n    role=\"application\"\n    [attr.aria-roledescription]=\"ariaRoledescription() || ('coreRatingIndicator.ariaRoleDescription' | fdTranslate)\"\n>\n    <!-- Zero value if we don't have provided value from user, `ratingAverage` or `ratings` -->\n    <ng-template [ngTemplateOutlet]=\"zeroRate\"></ng-template>\n    <!-- Available rate values -->\n    @for (rate of rates(); track rate.id; let i = $index) {\n        <input\n            [attr.aria-label]=\"i | ratingStarLabel: rates().length : allowHalves() : language()\"\n            role=\"button\"\n            type=\"radio\"\n            class=\"fd-rating-indicator__input\"\n            [disabled]=\"disabled() || nonInteractive() || displayMode()\"\n            [id]=\"rate.id\"\n            name=\"rating-{{ ratingUID }}\"\n            [value]=\"rate.value\"\n            [attr.checked]=\"displayValue() === rate.value ? true : null\"\n            (change)=\"onSelect(rate.value)\"\n        />\n        <label class=\"fd-rating-indicator__label\" [for]=\"rate.id\" aria-hidden=\"true\">\n            @if (ratedIcon()) {\n                <i class=\"fd-rating-indicator__label-rated\" [class]=\"unratedIcon()\"></i>\n            }\n            @if (unratedIcon()) {\n                <i class=\"fd-rating-indicator__label-unrated\" [class]=\"ratedIcon()\"></i>\n            }\n        </label>\n    }\n</div>\n<!-- Popover if displayAllRatings is true and we have ratings object -->\n@if (showDynamicText()) {\n    @if (displayAllRatings() && ratingItems().length) {\n        <span [fdPopoverTrigger]=\"allRatingContent\" class=\"fd-rating-indicator__dynamic-text\">\n            (<span [attr.aria-label]=\"'coreRatingIndicator.ariaLabelTotalRating' | fdTranslate\" fd-link>{{\n                computedTotalRatings\n            }}</span\n            >)\n        </span>\n    } @else if (computedTotalRatings !== undefined && computedTotalRatings !== null) {\n        <span class=\"fd-rating-indicator__dynamic-text\">({{ computedTotalRatings }})</span>\n    } @else {\n        <span class=\"fd-rating-indicator__dynamic-text\"\n            >({{ displayValue() }} {{ dynamicTextIndicator() }} {{ indicatorCapacity() }})</span\n        >\n    }\n}\n<fd-popover\n    #allRatingContent\n    [triggers]=\"['mouseenter', 'mouseleave']\"\n    [noArrow]=\"false\"\n    placement=\"top\"\n    additionalBodyClass=\"fd-rating-indicator__popover\"\n>\n    @for (rating of ratingItems(); track rating) {\n        <div class=\"fd-rating-indicator__sum-row\" [class]=\"sizeClass()\">\n            <div class=\"fd-rating-indicator__container\">\n                @for (rate of rates(); track rate.id) {\n                    <span\n                        [class.fd-rating-indicator__input-checked]=\"rate.value === rating.rate\"\n                        class=\"fd-rating-indicator__input\"\n                    ></span>\n                    <label class=\"fd-rating-indicator__label\">\n                        @if (ratedIcon()) {\n                            <i class=\"fd-rating-indicator__label-rated\" [class]=\"unratedIcon()\"></i>\n                        }\n                        @if (unratedIcon()) {\n                            <i class=\"fd-rating-indicator__label-unrated\" [class]=\"ratedIcon()\"></i>\n                        }\n                    </label>\n                }\n            </div>\n            ({{ rating.votes }})\n        </div>\n    }\n</fd-popover>\n", styles: [".fd-rating-indicator{--fontSize:1.375rem;--spacingBetweenIcons:.1875rem;border:0;-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--sapTextColor);display:-webkit-box;display:-ms-flexbox;display:flex;font-family:var(--sapFontFamily);font-size:var(--sapFontSize);font-weight:400;forced-color-adjust:none;line-height:normal;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;margin-block:0;margin-inline:0;padding-block:0;padding-inline:0;position:relative}.fd-rating-indicator:after,.fd-rating-indicator:before{-webkit-box-sizing:inherit;box-sizing:inherit;font-size:inherit}.fd-rating-indicator--cozy{--fontSize:1.5rem;--spacingBetweenIcons:.1875rem;margin-block:.8125rem;margin-inline:0}.fd-rating-indicator--compact{margin-block:.5rem;margin-inline:0}.fd-rating-indicator--compact,.fd-rating-indicator--condensed{--fontSize:1rem;--spacingBetweenIcons:.125rem}.fd-rating-indicator--xs{--fontSize:.75rem;--spacingBetweenIcons:1px}.fd-rating-indicator--sm{--fontSize:1rem;--spacingBetweenIcons:.125rem}.fd-rating-indicator--md{--fontSize:1.375rem;--spacingBetweenIcons:.1875rem}.fd-rating-indicator--lg{--fontSize:2rem;--spacingBetweenIcons:.25rem}.fd-rating-indicator__container{border:0;border-radius:var(--fdRating_Indicator_Border_Radius);-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--sapTextColor);font-family:var(--sapFontFamily);font-size:var(--sapFontSize);font-weight:400;forced-color-adjust:none;line-height:normal;margin-block:0;margin-inline:0;padding-block:0;padding-inline:0}.fd-rating-indicator__container:after,.fd-rating-indicator__container:before{-webkit-box-sizing:inherit;box-sizing:inherit;font-size:inherit}.fd-rating-indicator__container:focus-within{outline:var(--sapContent_FocusColor) var(--sapContent_FocusStyle) var(--sapContent_FocusWidth);outline-offset:var(--fdRating_Indicator_Focus_Outline_Offset,0)}.fd-rating-indicator__container:focus-within .fd-rating-indicator__input,.fd-rating-indicator__container:focus-within .fd-rating-indicator__label{outline:none!important}.fd-rating-indicator__input{border:0;-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--sapTextColor);font-family:var(--sapFontFamily);font-size:var(--sapFontSize);font-weight:400;forced-color-adjust:none;height:var(--fontSize);line-height:normal;margin-block:0;margin-inline:0;opacity:.0001;padding-block:0;padding-inline:0;position:absolute;top:0;width:var(--fontSize);z-index:-1}.fd-rating-indicator__input:after,.fd-rating-indicator__input:before{-webkit-box-sizing:inherit;box-sizing:inherit;font-size:inherit}.fd-rating-indicator__input:checked.is-focus,.fd-rating-indicator__input:checked:focus{outline:var(--sapContent_FocusColor) var(--sapContent_FocusStyle) var(--sapContent_FocusWidth)}.fd-rating-indicator__input:checked.is-focus+.fd-rating-indicator__label,.fd-rating-indicator__input:checked:focus+.fd-rating-indicator__label{outline:var(--sapContent_FocusColor) var(--sapContent_FocusStyle) var(--sapContent_FocusWidth);outline-offset:0}.fd-rating-indicator__label{border:0;-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--sapTextColor);cursor:pointer;display:-webkit-box;display:-ms-flexbox;display:flex;font-family:var(--sapFontFamily);font-size:var(--sapFontSize);font-weight:400;forced-color-adjust:none;line-height:normal;margin-block:0;margin-inline:0;padding-block:0;padding-inline:0;-webkit-box-align:center;-ms-flex-align:center;align-items:center;float:left;height:var(--fontSize);opacity:1;-webkit-margin-end:var(--spacingBetweenIcons);margin-inline-end:var(--spacingBetweenIcons)}.fd-rating-indicator__label:after,.fd-rating-indicator__label:before{-webkit-box-sizing:inherit;box-sizing:inherit;font-size:inherit}.fd-rating-indicator__label:before{color:var(--sapContent_RatedColor);content:\"\\e065\";font-family:SAP-icons;font-size:var(--fontSize)}.fd-rating-indicator__label:last-child{-webkit-margin-end:0;margin-inline-end:0}.fd-rating-indicator__label:hover:before{opacity:var(--fdRating_Indicator_Selected_Hover_Opacity);-webkit-transition:opacity .125s ease-in;transition:opacity .125s ease-in}.fd-rating-indicator .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label:before{color:var(--sapContent_UnratedColor);content:\"\\e0a1\"}.fd-rating-indicator__dynamic-text{border:0;-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--sapTextColor);color:var(--sapContent_LabelColor);font-family:var(--sapFontFamily);font-size:var(--sapFontSize);font-size:var(--sapFontSmallSize);font-weight:400;forced-color-adjust:none;line-height:normal;margin-block:0;margin-inline:0;overflow:hidden;padding-block:0;padding-inline:0;text-overflow:ellipsis;white-space:nowrap;-webkit-margin-start:.5rem;margin-inline-start:.5rem}.fd-rating-indicator__dynamic-text:after,.fd-rating-indicator__dynamic-text:before{-webkit-box-sizing:inherit;box-sizing:inherit;font-size:inherit}.fd-rating-indicator--hide-dynamic-text>.fd-rating-indicator__dynamic-text{display:none}.fd-rating-indicator[dir=rtl] .fd-rating-indicator__label,[dir=rtl] .fd-rating-indicator .fd-rating-indicator__label{float:right}.fd-rating-indicator.is-disabled,.fd-rating-indicator:disabled,.fd-rating-indicator[aria-disabled=true]{opacity:var(--fdRating_Indicator_Disabled_Control_Opacity);pointer-events:none}.fd-rating-indicator.is-disabled .fd-rating-indicator__input:before,.fd-rating-indicator:disabled .fd-rating-indicator__input:before,.fd-rating-indicator[aria-disabled=true] .fd-rating-indicator__input:before{color:var(--fdRating_Indicator_Disabled_Selected_Color);content:\"\\e065\"}.fd-rating-indicator.is-disabled .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label:before,.fd-rating-indicator:disabled .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label:before,.fd-rating-indicator[aria-disabled=true] .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label:before{color:var(--fdRating_Indicator_Disabled_Unselected_Color);content:\"\\e065\";font-size:calc(var(--fontSize)*var(--fdRating_Indicator_View_Mode_Unselected_Icon_Size_Ratio))}.fd-rating-indicator--display-mode{--fontSize:1rem}.fd-rating-indicator--display-mode .fd-rating-indicator__label{-webkit-margin-end:.125rem;margin-inline-end:.125rem}.fd-rating-indicator--display-mode .fd-rating-indicator__label:before{color:var(--fdRating_Indicator_Display_Only_Selected_Color);content:\"\\e065\";font-size:var(--fontSize)}.fd-rating-indicator--display-mode,.fd-rating-indicator--non-interactive{pointer-events:none}.fd-rating-indicator--display-mode .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label:before,.fd-rating-indicator--non-interactive .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label:before{color:var(--sapContent_UnratedColor);content:\"\\e065\";font-size:calc(var(--fontSize)*var(--fdRating_Indicator_View_Mode_Unselected_Icon_Size_Ratio))}.fd-rating-indicator--icon .fd-rating-indicator__label{height:var(--fontSize);width:var(--fontSize)}.fd-rating-indicator--icon .fd-rating-indicator__label:after,.fd-rating-indicator--icon .fd-rating-indicator__label:before{content:none!important}.fd-rating-indicator--icon .fd-rating-indicator__label-rated,.fd-rating-indicator--icon .fd-rating-indicator__label-unrated{font-size:var(--fontSize);height:100%;line-height:1}.fd-rating-indicator--icon .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label .fd-rating-indicator__label-rated,.fd-rating-indicator--icon .fd-rating-indicator__label-unrated{display:none}.fd-rating-indicator--icon .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label .fd-rating-indicator__label-unrated{display:block}.fd-rating-indicator--half-star .fd-rating-indicator__input{height:var(--fontSize);width:calc(var(--fontSize)*.5)}.fd-rating-indicator--half-star .fd-rating-indicator__label{-webkit-margin-end:0;margin-inline-end:0;overflow:hidden;width:calc(var(--fontSize)*.5)}.fd-rating-indicator--half-star .fd-rating-indicator__label:nth-child(4n+6){-webkit-margin-end:var(--spacingBetweenIcons);margin-inline-end:var(--spacingBetweenIcons);-webkit-box-orient:horizontal;-webkit-box-direction:reverse;-ms-flex-direction:row-reverse;flex-direction:row-reverse}.fd-rating-indicator--half-star .fd-rating-indicator__label:last-child{-webkit-margin-end:0;margin-inline-end:0}.fd-rating-indicator--half-star .fd-rating-indicator--icon .fd-rating-indicator__label{width:calc(var(--fontSize)*.5)}.fd-rating-indicator--half-star .fd-rating-indicator .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label{width:calc(var(--fontSize)*var(--fdRating_Indicator_View_Mode_Unselected_Icon_Size_Ratio)*.5)}.fd-rating-indicator--half-star.fd-rating-indicator--display-mode .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label,.fd-rating-indicator--half-star.fd-rating-indicator--non-interactive .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label,.fd-rating-indicator--half-star.is-disabled .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label,.fd-rating-indicator--half-star:disabled .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label,.fd-rating-indicator--half-star[aria-disabled=true] .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label{width:calc(var(--fontSize)*.5)}.fd-rating-indicator--half-star.fd-rating-indicator--display-mode .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label .fd-rating-indicator__label-unrated:before,.fd-rating-indicator--half-star.fd-rating-indicator--display-mode .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label:before,.fd-rating-indicator--half-star.fd-rating-indicator--non-interactive .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label .fd-rating-indicator__label-unrated:before,.fd-rating-indicator--half-star.fd-rating-indicator--non-interactive .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label:before,.fd-rating-indicator--half-star.is-disabled .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label .fd-rating-indicator__label-unrated:before,.fd-rating-indicator--half-star.is-disabled .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label:before,.fd-rating-indicator--half-star:disabled .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label .fd-rating-indicator__label-unrated:before,.fd-rating-indicator--half-star:disabled .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label:before,.fd-rating-indicator--half-star[aria-disabled=true] .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label .fd-rating-indicator__label-unrated:before,.fd-rating-indicator--half-star[aria-disabled=true] .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label:before{font-size:var(--fontSize)}.fd-rating-indicator--half-star.fd-rating-indicator--display-mode .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label,.fd-rating-indicator--half-star.fd-rating-indicator--non-interactive .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label,.fd-rating-indicator--half-star.is-disabled .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label,.fd-rating-indicator--half-star:disabled .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label,.fd-rating-indicator--half-star[aria-disabled=true] .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label{width:calc(var(--fontSize)*var(--fdRating_Indicator_View_Mode_Unselected_Icon_Size_Ratio)*.5)}.fd-rating-indicator--half-star.fd-rating-indicator--display-mode .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label .fd-rating-indicator__label-unrated:before,.fd-rating-indicator--half-star.fd-rating-indicator--non-interactive .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label .fd-rating-indicator__label-unrated:before,.fd-rating-indicator--half-star.is-disabled .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label .fd-rating-indicator__label-unrated:before,.fd-rating-indicator--half-star:disabled .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label .fd-rating-indicator__label-unrated:before,.fd-rating-indicator--half-star[aria-disabled=true] .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label .fd-rating-indicator__label-unrated:before{font-size:calc(var(--fontSize)*var(--fdRating_Indicator_View_Mode_Unselected_Icon_Size_Ratio))}.fd-rating-indicator[class*=fd-rating-indicator--] .fd-rating-indicator__input--zero-rating,.fd-rating-indicator[class*=fd-rating-indicator--] .fd-rating-indicator__label--zero-rating,.fd-rating-indicator__input--zero-rating,.fd-rating-indicator__label--zero-rating{margin-block:0;margin-inline:0;opacity:.0001;overflow:hidden;padding-block:0;padding-inline:0;width:0}.fd-rating-indicator__popover{padding:.5rem 0!important}.fd-rating-indicator__popover .fd-rating-indicator__sum-row{display:flex;align-items:center;padding:.5rem 1rem;margin:0}.fd-rating-indicator__popover .fd-rating-indicator__sum-row .fd-rating-indicator__container{margin-right:.5rem}\n/*! Bundled license information:\n\nfundamental-styles/dist/rating-indicator.css:\n  (*!\n   * Fundamental Library Styles v0.40.1\n   * Copyright (c) 2025 SAP SE or an SAP affiliate company.\n   * Licensed under Apache License 2.0 (https://github.com/SAP/fundamental-styles/blob/main/LICENSE)\n   *)\n*/\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: PopoverTriggerDirective, selector: "[fdPopoverTrigger], [fd-popover-trigger]", inputs: ["fdPopoverTrigger"] }, { kind: "component", type: PopoverComponent, selector: "fd-popover", inputs: ["config", "title", "trigger", "id", "mobile", "mobileConfig", "preventSpaceKeyScroll", "placement", "maxWidth", "fillControlMode", "closeOnOutsideClick", "closeOnEscapeKey", "disabled", "triggers", "focusTrapped", "focusAutoCapture", "restoreFocusOnClose", "noArrow", "disableScrollbar", "appendTo", "placementContainer", "scrollStrategy", "cdkPositions", "applyOverlay", "additionalBodyClass", "additionalTriggerClass", "closeOnNavigation", "fixedPosition", "resizable", "isOpen"], outputs: ["triggerChange", "isOpenChange", "beforeOpen"] }, { kind: "pipe", type: RatingStarLabelPipe, name: "ratingStarLabel" }, { kind: "pipe", type: FdTranslatePipe, name: "fdTranslate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: RatingIndicatorComponent, decorators: [{
            type: Component,
            args: [{ selector: 'fd-rating-indicator', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [
                        {
                            provide: NG_VALUE_ACCESSOR,
                            useExisting: forwardRef(() => RatingIndicatorComponent),
                            multi: true
                        },
                        registerFormItemControl(RatingIndicatorComponent)
                    ], imports: [NgTemplateOutlet, PopoverTriggerDirective, PopoverComponent, RatingStarLabelPipe, FdTranslatePipe], host: {
                        '[class]': 'cssClass()',
                        '[attr.aria-label]': 'ariaLabel()',
                        '[attr.aria-labelledby]': 'ariaLabelledBy()',
                        '[attr.disabled]': 'disabled()'
                    }, template: "<ng-template #zeroRate let-halves=\"halves\">\n    <input\n        [attr.aria-label]=\"'coreRatingIndicator.ariaLabelReset' | fdTranslate\"\n        role=\"button\"\n        type=\"radio\"\n        class=\"fd-rating-indicator__input fd-rating-indicator__input--zero-rating\"\n        (change)=\"onSelect(0)\"\n        [disabled]=\"disabled() || nonInteractive() || displayMode()\"\n        name=\"rating-{{ ratingUID }}{{ halves ? '-halves' : '' }}\"\n        [attr.checked]=\"displayValue() === 0 ? true : null\"\n        value=\"0\"\n    />\n    <label class=\"fd-rating-indicator__label fd-rating-indicator__label--zero-rating\" aria-hidden=\"true\"></label>\n</ng-template>\n<!--  role=\"application\" is used in order to let user to change value with left/right arrows in JAWS, since JAWS ovverrides these actions -->\n<div\n    class=\"fd-rating-indicator__container\"\n    role=\"application\"\n    [attr.aria-roledescription]=\"ariaRoledescription() || ('coreRatingIndicator.ariaRoleDescription' | fdTranslate)\"\n>\n    <!-- Zero value if we don't have provided value from user, `ratingAverage` or `ratings` -->\n    <ng-template [ngTemplateOutlet]=\"zeroRate\"></ng-template>\n    <!-- Available rate values -->\n    @for (rate of rates(); track rate.id; let i = $index) {\n        <input\n            [attr.aria-label]=\"i | ratingStarLabel: rates().length : allowHalves() : language()\"\n            role=\"button\"\n            type=\"radio\"\n            class=\"fd-rating-indicator__input\"\n            [disabled]=\"disabled() || nonInteractive() || displayMode()\"\n            [id]=\"rate.id\"\n            name=\"rating-{{ ratingUID }}\"\n            [value]=\"rate.value\"\n            [attr.checked]=\"displayValue() === rate.value ? true : null\"\n            (change)=\"onSelect(rate.value)\"\n        />\n        <label class=\"fd-rating-indicator__label\" [for]=\"rate.id\" aria-hidden=\"true\">\n            @if (ratedIcon()) {\n                <i class=\"fd-rating-indicator__label-rated\" [class]=\"unratedIcon()\"></i>\n            }\n            @if (unratedIcon()) {\n                <i class=\"fd-rating-indicator__label-unrated\" [class]=\"ratedIcon()\"></i>\n            }\n        </label>\n    }\n</div>\n<!-- Popover if displayAllRatings is true and we have ratings object -->\n@if (showDynamicText()) {\n    @if (displayAllRatings() && ratingItems().length) {\n        <span [fdPopoverTrigger]=\"allRatingContent\" class=\"fd-rating-indicator__dynamic-text\">\n            (<span [attr.aria-label]=\"'coreRatingIndicator.ariaLabelTotalRating' | fdTranslate\" fd-link>{{\n                computedTotalRatings\n            }}</span\n            >)\n        </span>\n    } @else if (computedTotalRatings !== undefined && computedTotalRatings !== null) {\n        <span class=\"fd-rating-indicator__dynamic-text\">({{ computedTotalRatings }})</span>\n    } @else {\n        <span class=\"fd-rating-indicator__dynamic-text\"\n            >({{ displayValue() }} {{ dynamicTextIndicator() }} {{ indicatorCapacity() }})</span\n        >\n    }\n}\n<fd-popover\n    #allRatingContent\n    [triggers]=\"['mouseenter', 'mouseleave']\"\n    [noArrow]=\"false\"\n    placement=\"top\"\n    additionalBodyClass=\"fd-rating-indicator__popover\"\n>\n    @for (rating of ratingItems(); track rating) {\n        <div class=\"fd-rating-indicator__sum-row\" [class]=\"sizeClass()\">\n            <div class=\"fd-rating-indicator__container\">\n                @for (rate of rates(); track rate.id) {\n                    <span\n                        [class.fd-rating-indicator__input-checked]=\"rate.value === rating.rate\"\n                        class=\"fd-rating-indicator__input\"\n                    ></span>\n                    <label class=\"fd-rating-indicator__label\">\n                        @if (ratedIcon()) {\n                            <i class=\"fd-rating-indicator__label-rated\" [class]=\"unratedIcon()\"></i>\n                        }\n                        @if (unratedIcon()) {\n                            <i class=\"fd-rating-indicator__label-unrated\" [class]=\"ratedIcon()\"></i>\n                        }\n                    </label>\n                }\n            </div>\n            ({{ rating.votes }})\n        </div>\n    }\n</fd-popover>\n", styles: [".fd-rating-indicator{--fontSize:1.375rem;--spacingBetweenIcons:.1875rem;border:0;-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--sapTextColor);display:-webkit-box;display:-ms-flexbox;display:flex;font-family:var(--sapFontFamily);font-size:var(--sapFontSize);font-weight:400;forced-color-adjust:none;line-height:normal;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;margin-block:0;margin-inline:0;padding-block:0;padding-inline:0;position:relative}.fd-rating-indicator:after,.fd-rating-indicator:before{-webkit-box-sizing:inherit;box-sizing:inherit;font-size:inherit}.fd-rating-indicator--cozy{--fontSize:1.5rem;--spacingBetweenIcons:.1875rem;margin-block:.8125rem;margin-inline:0}.fd-rating-indicator--compact{margin-block:.5rem;margin-inline:0}.fd-rating-indicator--compact,.fd-rating-indicator--condensed{--fontSize:1rem;--spacingBetweenIcons:.125rem}.fd-rating-indicator--xs{--fontSize:.75rem;--spacingBetweenIcons:1px}.fd-rating-indicator--sm{--fontSize:1rem;--spacingBetweenIcons:.125rem}.fd-rating-indicator--md{--fontSize:1.375rem;--spacingBetweenIcons:.1875rem}.fd-rating-indicator--lg{--fontSize:2rem;--spacingBetweenIcons:.25rem}.fd-rating-indicator__container{border:0;border-radius:var(--fdRating_Indicator_Border_Radius);-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--sapTextColor);font-family:var(--sapFontFamily);font-size:var(--sapFontSize);font-weight:400;forced-color-adjust:none;line-height:normal;margin-block:0;margin-inline:0;padding-block:0;padding-inline:0}.fd-rating-indicator__container:after,.fd-rating-indicator__container:before{-webkit-box-sizing:inherit;box-sizing:inherit;font-size:inherit}.fd-rating-indicator__container:focus-within{outline:var(--sapContent_FocusColor) var(--sapContent_FocusStyle) var(--sapContent_FocusWidth);outline-offset:var(--fdRating_Indicator_Focus_Outline_Offset,0)}.fd-rating-indicator__container:focus-within .fd-rating-indicator__input,.fd-rating-indicator__container:focus-within .fd-rating-indicator__label{outline:none!important}.fd-rating-indicator__input{border:0;-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--sapTextColor);font-family:var(--sapFontFamily);font-size:var(--sapFontSize);font-weight:400;forced-color-adjust:none;height:var(--fontSize);line-height:normal;margin-block:0;margin-inline:0;opacity:.0001;padding-block:0;padding-inline:0;position:absolute;top:0;width:var(--fontSize);z-index:-1}.fd-rating-indicator__input:after,.fd-rating-indicator__input:before{-webkit-box-sizing:inherit;box-sizing:inherit;font-size:inherit}.fd-rating-indicator__input:checked.is-focus,.fd-rating-indicator__input:checked:focus{outline:var(--sapContent_FocusColor) var(--sapContent_FocusStyle) var(--sapContent_FocusWidth)}.fd-rating-indicator__input:checked.is-focus+.fd-rating-indicator__label,.fd-rating-indicator__input:checked:focus+.fd-rating-indicator__label{outline:var(--sapContent_FocusColor) var(--sapContent_FocusStyle) var(--sapContent_FocusWidth);outline-offset:0}.fd-rating-indicator__label{border:0;-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--sapTextColor);cursor:pointer;display:-webkit-box;display:-ms-flexbox;display:flex;font-family:var(--sapFontFamily);font-size:var(--sapFontSize);font-weight:400;forced-color-adjust:none;line-height:normal;margin-block:0;margin-inline:0;padding-block:0;padding-inline:0;-webkit-box-align:center;-ms-flex-align:center;align-items:center;float:left;height:var(--fontSize);opacity:1;-webkit-margin-end:var(--spacingBetweenIcons);margin-inline-end:var(--spacingBetweenIcons)}.fd-rating-indicator__label:after,.fd-rating-indicator__label:before{-webkit-box-sizing:inherit;box-sizing:inherit;font-size:inherit}.fd-rating-indicator__label:before{color:var(--sapContent_RatedColor);content:\"\\e065\";font-family:SAP-icons;font-size:var(--fontSize)}.fd-rating-indicator__label:last-child{-webkit-margin-end:0;margin-inline-end:0}.fd-rating-indicator__label:hover:before{opacity:var(--fdRating_Indicator_Selected_Hover_Opacity);-webkit-transition:opacity .125s ease-in;transition:opacity .125s ease-in}.fd-rating-indicator .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label:before{color:var(--sapContent_UnratedColor);content:\"\\e0a1\"}.fd-rating-indicator__dynamic-text{border:0;-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--sapTextColor);color:var(--sapContent_LabelColor);font-family:var(--sapFontFamily);font-size:var(--sapFontSize);font-size:var(--sapFontSmallSize);font-weight:400;forced-color-adjust:none;line-height:normal;margin-block:0;margin-inline:0;overflow:hidden;padding-block:0;padding-inline:0;text-overflow:ellipsis;white-space:nowrap;-webkit-margin-start:.5rem;margin-inline-start:.5rem}.fd-rating-indicator__dynamic-text:after,.fd-rating-indicator__dynamic-text:before{-webkit-box-sizing:inherit;box-sizing:inherit;font-size:inherit}.fd-rating-indicator--hide-dynamic-text>.fd-rating-indicator__dynamic-text{display:none}.fd-rating-indicator[dir=rtl] .fd-rating-indicator__label,[dir=rtl] .fd-rating-indicator .fd-rating-indicator__label{float:right}.fd-rating-indicator.is-disabled,.fd-rating-indicator:disabled,.fd-rating-indicator[aria-disabled=true]{opacity:var(--fdRating_Indicator_Disabled_Control_Opacity);pointer-events:none}.fd-rating-indicator.is-disabled .fd-rating-indicator__input:before,.fd-rating-indicator:disabled .fd-rating-indicator__input:before,.fd-rating-indicator[aria-disabled=true] .fd-rating-indicator__input:before{color:var(--fdRating_Indicator_Disabled_Selected_Color);content:\"\\e065\"}.fd-rating-indicator.is-disabled .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label:before,.fd-rating-indicator:disabled .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label:before,.fd-rating-indicator[aria-disabled=true] .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label:before{color:var(--fdRating_Indicator_Disabled_Unselected_Color);content:\"\\e065\";font-size:calc(var(--fontSize)*var(--fdRating_Indicator_View_Mode_Unselected_Icon_Size_Ratio))}.fd-rating-indicator--display-mode{--fontSize:1rem}.fd-rating-indicator--display-mode .fd-rating-indicator__label{-webkit-margin-end:.125rem;margin-inline-end:.125rem}.fd-rating-indicator--display-mode .fd-rating-indicator__label:before{color:var(--fdRating_Indicator_Display_Only_Selected_Color);content:\"\\e065\";font-size:var(--fontSize)}.fd-rating-indicator--display-mode,.fd-rating-indicator--non-interactive{pointer-events:none}.fd-rating-indicator--display-mode .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label:before,.fd-rating-indicator--non-interactive .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label:before{color:var(--sapContent_UnratedColor);content:\"\\e065\";font-size:calc(var(--fontSize)*var(--fdRating_Indicator_View_Mode_Unselected_Icon_Size_Ratio))}.fd-rating-indicator--icon .fd-rating-indicator__label{height:var(--fontSize);width:var(--fontSize)}.fd-rating-indicator--icon .fd-rating-indicator__label:after,.fd-rating-indicator--icon .fd-rating-indicator__label:before{content:none!important}.fd-rating-indicator--icon .fd-rating-indicator__label-rated,.fd-rating-indicator--icon .fd-rating-indicator__label-unrated{font-size:var(--fontSize);height:100%;line-height:1}.fd-rating-indicator--icon .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label .fd-rating-indicator__label-rated,.fd-rating-indicator--icon .fd-rating-indicator__label-unrated{display:none}.fd-rating-indicator--icon .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label .fd-rating-indicator__label-unrated{display:block}.fd-rating-indicator--half-star .fd-rating-indicator__input{height:var(--fontSize);width:calc(var(--fontSize)*.5)}.fd-rating-indicator--half-star .fd-rating-indicator__label{-webkit-margin-end:0;margin-inline-end:0;overflow:hidden;width:calc(var(--fontSize)*.5)}.fd-rating-indicator--half-star .fd-rating-indicator__label:nth-child(4n+6){-webkit-margin-end:var(--spacingBetweenIcons);margin-inline-end:var(--spacingBetweenIcons);-webkit-box-orient:horizontal;-webkit-box-direction:reverse;-ms-flex-direction:row-reverse;flex-direction:row-reverse}.fd-rating-indicator--half-star .fd-rating-indicator__label:last-child{-webkit-margin-end:0;margin-inline-end:0}.fd-rating-indicator--half-star .fd-rating-indicator--icon .fd-rating-indicator__label{width:calc(var(--fontSize)*.5)}.fd-rating-indicator--half-star .fd-rating-indicator .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label{width:calc(var(--fontSize)*var(--fdRating_Indicator_View_Mode_Unselected_Icon_Size_Ratio)*.5)}.fd-rating-indicator--half-star.fd-rating-indicator--display-mode .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label,.fd-rating-indicator--half-star.fd-rating-indicator--non-interactive .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label,.fd-rating-indicator--half-star.is-disabled .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label,.fd-rating-indicator--half-star:disabled .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label,.fd-rating-indicator--half-star[aria-disabled=true] .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label{width:calc(var(--fontSize)*.5)}.fd-rating-indicator--half-star.fd-rating-indicator--display-mode .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label .fd-rating-indicator__label-unrated:before,.fd-rating-indicator--half-star.fd-rating-indicator--display-mode .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label:before,.fd-rating-indicator--half-star.fd-rating-indicator--non-interactive .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label .fd-rating-indicator__label-unrated:before,.fd-rating-indicator--half-star.fd-rating-indicator--non-interactive .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label:before,.fd-rating-indicator--half-star.is-disabled .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label .fd-rating-indicator__label-unrated:before,.fd-rating-indicator--half-star.is-disabled .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label:before,.fd-rating-indicator--half-star:disabled .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label .fd-rating-indicator__label-unrated:before,.fd-rating-indicator--half-star:disabled .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label:before,.fd-rating-indicator--half-star[aria-disabled=true] .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label .fd-rating-indicator__label-unrated:before,.fd-rating-indicator--half-star[aria-disabled=true] .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label:before{font-size:var(--fontSize)}.fd-rating-indicator--half-star.fd-rating-indicator--display-mode .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label,.fd-rating-indicator--half-star.fd-rating-indicator--non-interactive .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label,.fd-rating-indicator--half-star.is-disabled .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label,.fd-rating-indicator--half-star:disabled .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label,.fd-rating-indicator--half-star[aria-disabled=true] .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label{width:calc(var(--fontSize)*var(--fdRating_Indicator_View_Mode_Unselected_Icon_Size_Ratio)*.5)}.fd-rating-indicator--half-star.fd-rating-indicator--display-mode .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label .fd-rating-indicator__label-unrated:before,.fd-rating-indicator--half-star.fd-rating-indicator--non-interactive .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label .fd-rating-indicator__label-unrated:before,.fd-rating-indicator--half-star.is-disabled .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label .fd-rating-indicator__label-unrated:before,.fd-rating-indicator--half-star:disabled .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label .fd-rating-indicator__label-unrated:before,.fd-rating-indicator--half-star[aria-disabled=true] .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label .fd-rating-indicator__label-unrated:before{font-size:calc(var(--fontSize)*var(--fdRating_Indicator_View_Mode_Unselected_Icon_Size_Ratio))}.fd-rating-indicator[class*=fd-rating-indicator--] .fd-rating-indicator__input--zero-rating,.fd-rating-indicator[class*=fd-rating-indicator--] .fd-rating-indicator__label--zero-rating,.fd-rating-indicator__input--zero-rating,.fd-rating-indicator__label--zero-rating{margin-block:0;margin-inline:0;opacity:.0001;overflow:hidden;padding-block:0;padding-inline:0;width:0}.fd-rating-indicator__popover{padding:.5rem 0!important}.fd-rating-indicator__popover .fd-rating-indicator__sum-row{display:flex;align-items:center;padding:.5rem 1rem;margin:0}.fd-rating-indicator__popover .fd-rating-indicator__sum-row .fd-rating-indicator__container{margin-right:.5rem}\n/*! Bundled license information:\n\nfundamental-styles/dist/rating-indicator.css:\n  (*!\n   * Fundamental Library Styles v0.40.1\n   * Copyright (c) 2025 SAP SE or an SAP affiliate company.\n   * Licensed under Apache License 2.0 (https://github.com/SAP/fundamental-styles/blob/main/LICENSE)\n   *)\n*/\n"] }]
        }], ctorParameters: () => [], propDecorators: { name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], ariaLabelledBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabelledBy", required: false }] }], ariaRoledescription: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaRoledescription", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], displayMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "displayMode", required: false }] }], nonInteractive: [{ type: i0.Input, args: [{ isSignal: true, alias: "nonInteractive", required: false }] }], indicatorCapacity: [{ type: i0.Input, args: [{ isSignal: true, alias: "indicatorCapacity", required: false }] }], allowHalves: [{ type: i0.Input, args: [{ isSignal: true, alias: "allowHalves", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], totalRatings: [{ type: i0.Input, args: [{ isSignal: true, alias: "totalRatings", required: false }] }], ratingAverage: [{ type: i0.Input, args: [{ isSignal: true, alias: "ratingAverage", required: false }] }], ratings: [{ type: i0.Input, args: [{ isSignal: true, alias: "ratings", required: false }] }], displayAllRatings: [{ type: i0.Input, args: [{ isSignal: true, alias: "displayAllRatings", required: false }] }], ratedIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "ratedIcon", required: false }] }], unratedIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "unratedIcon", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], dynamicTextIndicator: [{ type: i0.Input, args: [{ isSignal: true, alias: "dynamicTextIndicator", required: false }] }], showDynamicText: [{ type: i0.Input, args: [{ isSignal: true, alias: "showDynamicText", required: false }] }], ratingChanged: [{ type: i0.Output, args: ["ratingChanged"] }] } });

/**
 * @deprecated
 * Use direct import of `RatingIndicatorComponent`
 */
class RatingIndicatorModule {
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: RatingIndicatorModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
    static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.1.0", ngImport: i0, type: RatingIndicatorModule, imports: [RatingIndicatorComponent, RatingStarLabelPipe], exports: [RatingIndicatorComponent, RatingStarLabelPipe] }); }
    static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: RatingIndicatorModule, imports: [RatingIndicatorComponent] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: RatingIndicatorModule, decorators: [{
            type: NgModule,
            args: [{
                    imports: [RatingIndicatorComponent, RatingStarLabelPipe],
                    exports: [RatingIndicatorComponent, RatingStarLabelPipe]
                }]
        }] });

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

export { INDICATOR_CLASSES, INDICATOR_DEFAULT_CAPACITY, INDICATOR_PREFIX, RatingIndicatorComponent, RatingIndicatorModule, RatingIndicatorSizeEnum, RatingStarLabelPipe };
//# sourceMappingURL=fundamental-ngx-core-rating-indicator.mjs.map
