import { r as registerInstance, h, g as getElement } from './index-07845439.js';
import { d as dist } from './index-63517df5.js';
import './_commonjsHelpers-8fe71198.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-ig-customer-limit-h{width:100%;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:distribute;justify-content:space-around}[hidden].sc-ig-customer-limit-h{display:none}.sc-ig-customer-limit-h>section.sc-ig-customer-limit{width:100%}.sc-ig-customer-limit-h>section.sc-ig-customer-limit>label.sc-ig-customer-limit{font-weight:bold;text-align:left;padding-bottom:.2em}.sc-ig-customer-limit-h>section.sc-ig-customer-limit>smoothly-display.sc-ig-customer-limit{width:10em;max-width:10em;text-transform:capitalize;-ms-flex-item-align:start;align-self:flex-start}.sc-ig-customer-limit-h>section.sc-ig-customer-limit>span.sc-ig-customer-limit{background:rgba(0, 0, 0, 0.5);text-align:center;border-radius:6px;padding:.6em;position:absolute;z-index:1;visibility:hidden}.sc-ig-customer-limit-h>section.sc-ig-customer-limit:hover>span.sc-ig-customer-limit{visibility:visible;-moz-transition-delay:.5s;-webkit-transition-delay:.5s;transition-delay:.5s}";

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

export { IntergiroCustomerLimit as ig_customer_limit };
