'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

const index$1 = require('./index-df541290.js');
const index$2 = require('./index-c12b8888.js');
const index = require('./index-b7493032.js');
require('./index-0b6f1dd9.js');
require('./_commonjsHelpers-10109b76.js');
require('./index-fe328b96.js');

const sv = {
  "total count: ": "totalt antal: ",
  "active: ": "aktiva: ",
  "created: ": "skapade: ",
  "inactive: ": "inaktiva: ",
  "pending: ": "väntande: ",
  "suspended: ": "avstängda: ",
};

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

const styleCss = "footer.sc-ig-customers-footer{display:block;margin:auto;border:1px solid rgb(var(--smoothly-medium-color));width:100%;max-width:90em;z-index:1;position:-webkit-sticky;position:sticky;bottom:0;color:rgb(var(--smoothly-light-contrast));background-color:rgb(var(--smoothly-light-color));padding:.5em 0 .5em 0em}.sc-ig-customers-footer-h>footer.sc-ig-customers-footer>td.sc-ig-customers-footer>span.sc-ig-customers-footer{display:inline-block;margin-left:0.4em;margin-right:0.6em}.sc-ig-customers-footer-h>footer.sc-ig-customers-footer>td.sc-ig-customers-footer{display:inline-block;padding-top:0.2em;margin-left:2em}";

const IntergiroCustomerFooter = class {
  constructor(hostRef) {
    index$1.registerInstance(this, hostRef);
  }
  componentWillLoad() {
    this.t = create(this.element);
  }
  render() {
    var _a;
    const [active, created, pending, suspended] = this.customers
      ? this.customers.reduce(([a, c, p, s], customer) => {
        var _a, _b;
        const status = (_a = customer.status) !== null && _a !== void 0 ? _a : index$2.Customer.Status.getStatus(customer, this.orders ? (_b = this.orders[customer.id]) === null || _b === void 0 ? void 0 : _b.slice(0, 1).shift() : undefined);
        return status == "active"
          ? [++a, c, p, s]
          : status == "created"
            ? [a, ++c, p, s]
            : status == "pending"
              ? [a, c, ++p, s]
              : [a, c, p, ++s];
      }, [0, 0, 0, 0])
      : [0, 0, 0, 0];
    return (index$1.h("footer", null, index$1.h("td", null, index$1.h("span", null, this.t("total count: ")), index$1.h("span", null, this.customers ? (_a = this.customers) === null || _a === void 0 ? void 0 : _a.length : 0)), index$1.h("td", null, index$1.h("span", null, this.t("active: ")), index$1.h("span", null, active)), index$1.h("td", null, index$1.h("span", null, this.t("created: ")), index$1.h("span", null, created)), index$1.h("td", null, index$1.h("span", null, this.t("pending: ")), index$1.h("span", null, pending)), index$1.h("td", null, index$1.h("span", null, this.t("suspended: ")), index$1.h("span", null, suspended))));
  }
  get element() { return index$1.getElement(this); }
};
IntergiroCustomerFooter.style = styleCss;

exports.ig_customers_footer = IntergiroCustomerFooter;
