import { unsafeCSS, LitElement, html } from "lit";
import { customElement } from "../../decorator.js";
import { classMap } from "lit/directives/class-map.js";
import compentStyle from "./progress-indicator-dots.css.js";
import { property } from "lit/decorators.js";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __decorateClass = (decorators, target, key, kind) => {
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
    if (decorator = decorators[i])
      result = (kind ? decorator(target, key, result) : decorator(result)) || result;
  if (kind && result) __defProp(target, key, result);
  return result;
};
let ObcProgressIndicatorDots = class extends LitElement {
  constructor() {
    super(...arguments);
    this.totalSteps = 5;
    this.currentStep = 1;
    this.fullwidth = false;
  }
  get validCurrentStep() {
    return Math.max(1, Math.min(this.currentStep, this.totalSteps));
  }
  get validTotalSteps() {
    return Math.max(1, this.totalSteps);
  }
  renderDots() {
    const dots = [];
    for (let i = 0; i < this.validTotalSteps; i++) {
      dots.push(html`
        <div
          class=${classMap({
        dot: true,
        "state-active": i === this.validCurrentStep - 1,
        "state-inactive": i !== this.validCurrentStep - 1
      })}
        ></div>
      `);
    }
    return dots;
  }
  render() {
    return html`
      <div
        class=${classMap({
      wrapper: true,
      "style-fullwidth": this.fullwidth,
      "style-compact": !this.fullwidth
    })}
      >
        <div class="content-container">${this.renderDots()}</div>
      </div>
    `;
  }
};
ObcProgressIndicatorDots.styles = unsafeCSS(compentStyle);
__decorateClass([
  property({ type: Number })
], ObcProgressIndicatorDots.prototype, "totalSteps", 2);
__decorateClass([
  property({ type: Number })
], ObcProgressIndicatorDots.prototype, "currentStep", 2);
__decorateClass([
  property({ type: Boolean })
], ObcProgressIndicatorDots.prototype, "fullwidth", 2);
ObcProgressIndicatorDots = __decorateClass([
  customElement("obc-progress-indicator-dots")
], ObcProgressIndicatorDots);
export {
  ObcProgressIndicatorDots
};
//# sourceMappingURL=progress-indicator-dots.js.map
