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

const sv = {
  Qty: "Antal",
  Name: "Namn",
  Price: "Pris",
  VAT: "Moms",
  Total: "Totalt",
  Status: "Status",
};

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

const styleCss = ".sc-payfunc-order-items-h{display:inline-block}[hidden].sc-payfunc-order-items-h{display:none}.sc-payfunc-order-items-h>table.sc-payfunc-order-items{table-layout:fixed;width:100%}.sc-payfunc-order-items-h>table.sc-payfunc-order-items>tr.sc-payfunc-order-items>th.sc-payfunc-order-items{text-align:left;padding-top:0.4em;padding-bottom:0.5em}.sc-payfunc-order-items-h>table.sc-payfunc-order-items>tr.sc-payfunc-order-items>th.wide.sc-payfunc-order-items{width:20%}.sc-payfunc-order-items-h>table.sc-payfunc-order-items>tr.sc-payfunc-order-items>th.status.sc-payfunc-order-items{width:19%;max-width:20em}";

const PayfuncOrderItems = class {
  constructor(hostRef) {
    registerInstance(this, hostRef);
    this.quantityStatus = false;
  }
  componentWillLoad() {
    this.t = create(this.element);
  }
  handleQuantityStatus(event) {
    this.quantityStatus = true;
  }
  render() {
    const t = this.t;
    return [
      h("table", null, h("tr", null, h("th", null, this.quantityStatus ? t("Qty") : ""), h("th", { class: "wide" }, this.quantityStatus ? t("Name") : ""), h("th", null, this.quantityStatus ? t("Price") : ""), h("th", null, this.quantityStatus ? t("VAT") : ""), h("th", null, t("Total")), h("th", { class: "status" }, t("Status"))), typeof this.order.items === "number"
        ? []
        : Item.asArray(this.order.items).map((item, index) => (h("payfunc-order-items-quantity", { order: this.order.id, currency: this.order.currency, item: item }))), h("payfunc-order-items-total", { currency: this.order.currency, items: this.order.items })),
    ];
  }
  get element() { return getElement(this); }
};
PayfuncOrderItems.style = styleCss;

export { PayfuncOrderItems as payfunc_order_items };
