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

const sv = {
  details: "detaljer",
  "excluding VAT": "exklusive moms",
};

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

const styleCss = ".sc-payfunc-items-display-h{display:block}[hidden].sc-payfunc-items-display-h{display:none}.sc-payfunc-items-display-h>*.sc-payfunc-items-display{text-align:center;margin-bottom:1em}.sc-payfunc-items-display-h>section.sc-payfunc-items-display>smoothly-display.sc-payfunc-items-display{font-size:140%}.sc-payfunc-items-display-h>details.sc-payfunc-items-display>summary.sc-payfunc-items-display{list-style-image:none}";

const PayfuncItemsDisplay = class {
  constructor(hostRef) {
    registerInstance(this, hostRef);
  }
  componentWillLoad() {
    this.t = create(this.element);
  }
  render() {
    const t = this.t;
    const vat = Item.vat(this.items);
    return [
      h("details", null, h("summary", null, t("details")), h("section", null, h("payfunc-items-list", { items: this.items, currency: this.currency }))),
      h("section", null, h("smoothly-display", { type: "price", value: Item.amount(this.items), currency: this.currency }), vat != undefined ? (h("p", { style: { fontSize: "90%", margin: "0" } }, "(", h("smoothly-display", { style: { display: "inline" }, type: "price", value: Item.amount(this.items) - vat, currency: this.currency }), "\u00A0", t("excluding VAT"), ")")) : ([])),
    ];
  }
  get element() { return getElement(this); }
};
PayfuncItemsDisplay.style = styleCss;

export { PayfuncItemsDisplay as payfunc_items_display };
