'use strict';

Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });

const shared_tailwindElement_index = require('../../chunks/index-BxQ_0s_1.js');
const property = require('../../chunks/property-D6IL6zax.js');
const styleMap = require('../../chunks/style-map-B7XFhSOK.js');
const safeCustomElement = require('../../chunks/safe-custom-element-tQ-epw6h.js');
require('../../tailwind-config.cjs');
const axe = require('../../chunks/axe-MHuN9KU0.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;
};
exports.LuksoProgress = class LuksoProgress extends shared_tailwindElement_index.TailwindElement {
  constructor() {
    super(...arguments);
    this.min = 0;
    this.max = 100;
    this.current = 0;
    this.variant = "success";
    this.height = 16;
  }
  progressWidth() {
    return this.current / this.max * 100;
  }
  render() {
    return shared_tailwindElement_index.x`
      <div
        data-testid="progress"
        style=${styleMap.o({
      height: this.height > 16 ? `${this.height}px` : "16px"
    })}
        class=${axe.cn("w-full rounded-24 bg-neutral-95 relative")}
      >
        <div
          style=${styleMap.o({
      width: `${this.progressWidth()}%`
    })}
          class=${axe.cn(
      "rounded-s-24 h-full rounded-e-24  transition-all w-[1%]",
      {
        "bg-green-85": !!this.variant || this.variant === "success",
        "bg-red-85": this.variant === "error",
        "bg-yellow-85": this.variant === "warning"
      }
    )}
        ></div>
        <div
          class=${axe.cn(
      "shadow-neutral-inner-shadow h-full absolute w-full top-0 rounded-24"
    )}
        ></div>
      </div>
    `;
  }
};
__decorateClass([
  property.n({ type: Number })
], exports.LuksoProgress.prototype, "min", 2);
__decorateClass([
  property.n({ type: Number })
], exports.LuksoProgress.prototype, "max", 2);
__decorateClass([
  property.n({ type: Number })
], exports.LuksoProgress.prototype, "current", 2);
__decorateClass([
  property.n({ type: String })
], exports.LuksoProgress.prototype, "variant", 2);
__decorateClass([
  property.n({ type: Number })
], exports.LuksoProgress.prototype, "height", 2);
exports.LuksoProgress = __decorateClass([
  safeCustomElement.safeCustomElement("lukso-progress")
], exports.LuksoProgress);
