import { r as registerInstance, j as createEvent, h, g as getElement } from './index-07845439.js';
import { I as Item } from './index-e20749b7.js';
import { d as dist } from './index-63517df5.js';
import './index-b6cf748e.js';
import './_commonjsHelpers-8fe71198.js';
import './index-265fba1f.js';

const sv = {
  "@": "à",
  "Remove item": "Ta bort artikel",
};

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

const styleCss = ".sc-ig-display-item-h{display:block}[hidden].sc-ig-display-item-h{display:none}.sc-ig-display-item-h>section.sc-ig-display-item{margin-left:.3em;display:-ms-flexbox;display:flex;-ms-flex-wrap:nowrap;flex-wrap:nowrap}.sc-ig-display-item-h>section.sc-ig-display-item>span.sc-ig-display-item{margin-bottom:0.8em;padding-left:1.5em;white-space:nowrap;overflow:hidden;text-overflow:visible}.sc-ig-display-item-h>section.sc-ig-display-item>span.medium.sc-ig-display-item{-ms-flex-positive:2;flex-grow:2}.sc-ig-display-item-h>section.sc-ig-display-item>span.small.sc-ig-display-item{-ms-flex-positive:1;flex-grow:1}.sc-ig-display-item-h>section.sc-ig-display-item>span.big.sc-ig-display-item{-ms-flex-positive:3;flex-grow:3}.left.sc-ig-display-item{border-left:1px solid rgb(var(--smoothly-medium-color))}.sc-ig-display-item-h>section.sc-ig-display-item>smoothly-trigger.sc-ig-display-item{margin-right:0px;margin-left:8px;margin-top:-3px;float:right}";

const IntergiroDisplayItem = class {
  constructor(hostRef) {
    registerInstance(this, hostRef);
    this.itemDeleted = createEvent(this, "itemDeleted", 7);
    this.item = {};
    this.removable = true;
  }
  componentWillLoad() {
    this.t = create(this.element);
  }
  delete(event) {
    if (event.detail.name == "item") {
      event.stopPropagation();
      this.itemDeleted.emit({ index: this.index });
    }
  }
  render() {
    const t = this.t;
    return [
      this.item ? (h("section", null, h("span", { class: "small" }, this.item.quantity ? this.item.quantity : this.item.unit ? 1 : "", " ", this.item.unit), h("span", { class: "big" }, this.item.name), h("span", { class: "medium" }, t("@"), " ", Item.amount(this.item) / (this.item.quantity ? this.item.quantity : 1), " ", this.currency), h("span", { class: "medium" }, Item.amount(this.item), " ", this.currency), this.removable ? (h("smoothly-trigger", { fill: "clear", name: "item" }, h("smoothly-icon", { size: "small", toolTip: t("Remove item"), name: "trash" }))) : (""))) : (""),
    ];
  }
  get element() { return getElement(this); }
};
IntergiroDisplayItem.style = styleCss;

export { IntergiroDisplayItem as ig_display_item };
