'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

const index$1 = require('./index-0b1e2673.js');
require('./_commonjsHelpers-937cd5b3.js');
const index = require('./index-36cf3884.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 index.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) {
    index$1.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 ? (index$1.h("section", null, index$1.h("label", null, this.t("Credit limit")), index$1.h("smoothly-display", null, limit + " " + this.account.currency))) : ([
      hard && (index$1.h("section", null, index$1.h("label", null, this.t("Credit limit")), index$1.h("smoothly-display", null, hard + " " + this.account.currency))),
      soft && (index$1.h("section", null, index$1.h("label", null, this.t("Soft limit")), index$1.h("smoothly-display", null, soft + " " + this.account.currency), index$1.h("span", null, this.t("Automatic charge limit.")))),
      margin && (index$1.h("section", null, index$1.h("label", null, this.t("Margin")), index$1.h("smoothly-display", null, margin + " " + this.account.currency), index$1.h("span", null, this.t("Automatic charge margin.")))),
    ]);
  }
  get element() { return index$1.getElement(this); }
};
PayfuncLimit.style = styleCss;

exports.payfunc_limit = PayfuncLimit;
