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

const sv = {
  Limit: "Gräns",
  "Soft limit": "Mjuk gräns",
  Margin: "Marginal",
  "Credit limit": "Kreditgräns",
  "Automatic charge limit.": "Gräns för automatisk debitering.",
  "Automatic charge margin.": "Marginal för automatisk debitering.",
};

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

const styleCss = ".sc-payfunc-limit-h{width:100%;display:flex;flex-direction:row;justify-content:space-around}[hidden].sc-payfunc-limit-h{display:none}.sc-payfunc-limit-h>section.sc-payfunc-limit{width:100%}.sc-payfunc-limit-h>section.sc-payfunc-limit>label.sc-payfunc-limit{font-weight:bold;text-align:left;padding-bottom:.2em}.sc-payfunc-limit-h>section.sc-payfunc-limit>smoothly-display.sc-payfunc-limit{width:10em;max-width:10em;text-transform:capitalize;align-self:flex-start}.sc-payfunc-limit-h>section.sc-payfunc-limit>span.sc-payfunc-limit{background:rgba(0, 0, 0, 0.5);text-align:center;border-radius:6px;padding:.6em;position:absolute;z-index:1;visibility:hidden}.sc-payfunc-limit-h>section.sc-payfunc-limit:hover>span.sc-payfunc-limit{visibility:visible;-moz-transition-delay:.5s;transition-delay:.5s}";

const PayfuncLimit = class {
  constructor(hostRef) {
    registerInstance(this, hostRef);
  }
  componentWillLoad() {
    this.t = create(this.element);
  }
  render() {
    const limit = typeof this.account.limit == "number" ? this.account.limit : undefined;
    const hard = typeof this.account.limit == "object" && this.account.limit.hard ? this.account.limit.hard : undefined;
    const soft = typeof this.account.limit == "object" && this.account.limit.soft ? this.account.limit.soft : undefined;
    const margin = typeof this.account.limit == "object" && this.account.limit.margin ? this.account.limit.margin : undefined;
    return limit ? (h("section", null, h("label", null, this.t("Credit limit")), h("smoothly-display", null, limit + " " + this.account.currency))) : ([
      hard && (h("section", null, h("label", null, this.t("Credit limit")), h("smoothly-display", null, hard + " " + this.account.currency))),
      soft && (h("section", null, h("label", null, this.t("Soft limit")), h("smoothly-display", null, soft + " " + this.account.currency), h("span", null, this.t("Automatic charge limit.")))),
      margin && (h("section", null, h("label", null, this.t("Margin")), h("smoothly-display", null, margin + " " + this.account.currency), h("span", null, this.t("Automatic charge margin.")))),
    ]);
  }
  get element() { return getElement(this); }
};
PayfuncLimit.style = styleCss;

export { PayfuncLimit as payfunc_limit };
