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

const sv = {
  Delete: "Radera",
  "Confirm removal": "Bekräfta borttagning",
};

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

const styleCss = ":host{display:-ms-flexbox;display:flex;position:relative}:host>.card{height:calc(14.49em - 1.4em);background-color:rgb(var(--smoothly-default-shade));-webkit-box-shadow:0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);box-shadow:0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);border-radius:.7em;width:calc(23em - 1.4em);padding:.7em;position:relative}:host>.card>smoothly-display:nth-of-type(1){position:absolute;top:45%;left:25%;font-size:120%;width:50%}:host>.card>p{position:absolute;bottom:15%;left:75%;font-size:80%;text-transform:uppercase}:host>.card>smoothly-display:nth-of-type(2){position:absolute;bottom:10%;left:75%;font-size:1.1em}:host>.card>smoothly-icon{position:absolute;top:7em;right:-3em;cursor:pointer}:host>.table{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between}:host>.table>*{width:10em}:host>.table>*:nth-child(2){width:15em}:host>.table>p{display:none}:host>.table>smoothly-icon{position:absolute;right:0em;cursor:pointer;display:none}:host>.table:hover>smoothly-icon{display:block}";

const IntergiroPaymentMethod = class {
  constructor(hostRef) {
    registerInstance(this, hostRef);
    this.deleteMethod = createEvent(this, "deleteMethod", 7);
    this.deletable = false;
    this.selected = false;
  }
  componentWillLoad() {
    this.t = create(this.element);
  }
  methodDeletedHandler(method) {
    this.deleteMethod.emit(method);
  }
  render() {
    return (h("div", { class: this.mode }, h("ig-scheme-logotype", { size: this.mode == "card" ? "large" : "small", scheme: this.method.scheme }), h("smoothly-display", { type: "card-number", value: this.method.iin + "******" + this.method.last4 }), h("p", null, "Expires"), h("smoothly-display", { type: "card-expires", value: this.method.expires }), this.deletable
      ? [
        h("smoothly-icon", { name: "trash-outline", toolTip: this.t("Delete"), style: { display: this.selected ? "none" : "" }, size: this.mode == "card" ? "medium" : "small", onClick: () => (this.selected = true) }),
        h("smoothly-icon", { name: "trash", toolTip: this.t("Confirm removal"), style: { display: this.selected ? "block" : "none" }, color: "danger", size: this.mode == "card" ? "medium" : "small", onClick: () => this.methodDeletedHandler(this.method) }),
      ]
      : null));
  }
  get element() { return getElement(this); }
};
IntergiroPaymentMethod.style = styleCss;

export { IntergiroPaymentMethod as ig_payment_method };
