import { r as registerInstance, g as getElement } from './index-aeac5cad.js';
import './_commonjsHelpers-91fffb88.js';
import { d as dist } from './index-fdd60c34.js';

const sv = {
  created: "skapad",
  ordered: "beställd",
  cancelled: "avbruten",
  charged: "godkänd",
  paid: "betald",
  refunded: "återbetald",
  denied: "nekad",
  pending: "väntande",
  deferred: "skickad",
  active: "aktiv",
  inactive: "inaktiv",
  suspended: "avstängd",
  settled: "utbetald",
};

function create(language) {
  return dist.create({
    sv,
  }, language);
}

const styleCss = ".sc-payfunc-status-h{display:inline-block;position:relative;top:.2em;padding:.2em .3em;border-radius:.6em;overflow:hidden;text-align:center;text-overflow:ellipsis;width:100%}[hidden].sc-payfunc-status-h{display:none}[status = \"suspended\"].sc-payfunc-status-h,[status = \"denied\"].sc-payfunc-status-h{background-color:rgb(var(--smoothly-danger-color));color:rgb(var(--smoothly-danger-contrast))}[status = \"active\"].sc-payfunc-status-h,[status = \"ordered\"].sc-payfunc-status-h{background-color:rgb(var(--smoothly-success-color));color:rgb(var(--smoothly-success-contrast))}[status = \"inactive\"].sc-payfunc-status-h,[status = \"cancelled\"].sc-payfunc-status-h,[status = \"refunded\"].sc-payfunc-status-h{background-color:rgb(var(--smoothly-medium-color));color:rgb(var(--smoothly-medium-contrast))}[status=\"created\"].sc-payfunc-status-h,[status=\"deferred\"].sc-payfunc-status-h,[status=\"pending\"].sc-payfunc-status-h{background-color:rgb(var(--smoothly-warning-color));color:rgb(var(--smoothly-warning-contrast))}[status = \"charged\"].sc-payfunc-status-h,[status = \"paid\"].sc-payfunc-status-h{background-color:rgb(var(--smoothly-tertiary-tint));color:rgb(var(--smoothly-success-contrast))}[status = \"settled\"].sc-payfunc-status-h{background-color:rgb(var(--smoothly-tertiary-color));color:rgb(var(--smoothly-tertiary-contrast))}";

const PayfuncStatus = class {
  constructor(hostRef) {
    registerInstance(this, hostRef);
  }
  componentWillLoad() {
    this.t = create(this.element);
  }
  render() {
    var _a, _b;
    const t = this.t;
    return [(_a = this.quantity) === null || _a === void 0 ? void 0 : _a.toString(), this.quantity && ((_b = this.unit) !== null && _b !== void 0 ? _b : "×"), t(this.status)].filter(e => e).join(" ");
  }
  get element() { return getElement(this); }
};
PayfuncStatus.style = styleCss;

export { PayfuncStatus as payfunc_status };
