"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", { value: true });
const core_1 = require("@angular/core");
/**
 * Configuration service for the StarRating component.
 * You can inject this service, typically in your root component, and customize the values of its properties in
 * order to provide default values for all the star ratings used in the application.
 */
let StarRatingConfig = class StarRatingConfig {
    /**
     * Configuration service for the StarRating component.
     * You can inject this service, typically in your root component, and customize the values of its properties in
     * order to provide default values for all the star ratings used in the application.
     */
    constructor() {
        this.classEmpty = "default-star-empty-icon";
        this.classHalf = "default-star-half-icon";
        this.classFilled = "default-star-filled-icon";
        this.numOfStars = 5;
        this.size = "medium";
        this.speed = "noticeable";
        this.labelPosition = "left";
        this.starType = "svg";
        this.assetsPath = "assets/images/";
        this.svgPath = this.assetsPath + "star-rating.icons.svg";
        this.svgEmptySymbolId = "star-empty";
        this.svgHalfSymbolId = "star-half";
        this.svgFilledSymbolId = "star-filled";
        this.svgPathEmpty = this.svgPath + "#" + this.svgEmptySymbolId;
        this.svgPathHalf = this.svgPath + "#" + this.svgHalfSymbolId;
        this.svgPathFilled = this.svgPath + "#" + this.svgFilledSymbolId;
    }
    /*
    getColor(rating: number, numOfStars: number, staticColor?: starRatingColors): starRatingColors {
      rating = rating || 0;
  
      //if a fix color is set use this one
      if (staticColor) {
        return staticColor;
      }
  
      //calculate size of smallest fraction
      let fractionSize = numOfStars / 3;
  
      //apply color by fraction
      let color: starRatingColors = 'default';
      if (rating > 0) {
        color = 'negative';
      }
      if (rating > fractionSize) {
        color = 'ok';
      }
      if (rating > fractionSize * 2) {
        color = 'positive';
      }
  
      return color;
    }
  */
    getHalfStarVisible(rating) {
        return Math.abs(rating % 1) > 0;
    }
};
StarRatingConfig = __decorate([
    core_1.Injectable()
], StarRatingConfig);
exports.StarRatingConfig = StarRatingConfig;
//# sourceMappingURL=star-rating-config.js.map