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

const sv = {
  Amount: "Summa",
  "Add item": "Lägg till artikel",
};

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

const styleCss = ".sc-payfunc-total-amount-h{display:flex}[hidden].sc-payfunc-total-amount-h{display:none}.sc-payfunc-total-amount-h>*.sc-payfunc-total-amount:first-child{flex-grow:1}smoothly-select.sc-payfunc-total-amount{margin-top:.25em}";

const PayfuncTotalAmount = class {
  constructor(hostRef) {
    registerInstance(this, hostRef);
    this.addItem = createEvent(this, "addItem", 7);
    this.currencies = [
      "SEK",
      "EUR",
      "USD",
      "DKK",
      "GBP",
      "ISK",
      "NOK",
      "AUD",
      "CAD",
      "JPY",
      "NZD",
      "CHF",
      "TRY",
      "PLN",
      "RUB",
    ];
    this.currency = "SEK";
    this.itemsvisible = false;
  }
  componentWillLoad() {
    this.t = create(this.element);
  }
  add(e) {
    this.addItem.emit(e);
  }
  render() {
    return [
      h("smoothly-input", { disabled: this.itemsvisible, type: "price", value: this.price, name: "price" }, this.t("Amount")),
      h("smoothly-select", { identifier: "currency", background: "transparent" }, this.currencies.map(option => this.currency == option ? (h("option", { value: option, selected: true }, option)) : (h("option", { value: option }, option)))),
      h("button", { type: "button", tabindex: "-1", onClick: e => this.add(e) }, h("smoothly-icon", { toolTip: this.t("Add item"), name: "add-circle-outline", fill: "clear", size: "medium", color: "medium" })),
    ];
  }
  get element() { return getElement(this); }
};
PayfuncTotalAmount.style = styleCss;

export { PayfuncTotalAmount as payfunc_total_amount };
