import { Component, h, Prop, State } from "@stencil/core";
import { Handler } from "../../Handler";
export class IntergiroMonitorSettlementDetails {
  componentWillLoad() {
    Handler.register((authorizations, _, merchants, settlements) => {
      this.authorizations = authorizations;
      this.merchants = merchants;
      this.settlements = settlements;
    });
  }
  render() {
    let result;
    switch (this.opened) {
      case "1":
        result =
          this.view == "single" ? (h("ig-monitor-settlements-transactions", { authorizations: this.authorizations, merchants: this.merchants, transactions: this.settlement.reduce((r, c) => r.concat(c.transactions), []), "cost-plus": this.costPlus })) : (h("ig-monitor-merchant-settlements", { color: "dark", settlements: this.settlement, "cost-plus": this.costPlus }));
        break;
      case "2":
        result = h("ig-monitor-settlements-fees", { fees: this.fees, "cost-plus": this.costPlus });
        break;
      default:
        return "";
    }
    return h("td", { colSpan: 4 }, result);
  }
  static get is() { return "ig-monitor-settlements-details"; }
  static get encapsulation() { return "scoped"; }
  static get originalStyleUrls() { return {
    "$": ["style.css"]
  }; }
  static get styleUrls() { return {
    "$": ["style.css"]
  }; }
  static get properties() { return {
    "settlement": {
      "type": "unknown",
      "mutable": false,
      "complexType": {
        "original": "AcquirerSettlement[]",
        "resolved": "Settlement[]",
        "references": {
          "AcquirerSettlement": {
            "location": "import",
            "path": "../../model"
          }
        }
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [],
        "text": ""
      }
    },
    "fees": {
      "type": "unknown",
      "mutable": false,
      "complexType": {
        "original": "{\n\t\tscheme: string\n\t\tgross: number\n\t\tfee: number\n\t\tnet: number\n\t\tinterchange: number\n\t\tcurrency: Currency\n\t}[]",
        "resolved": "{ scheme: string; gross: number; fee: number; net: number; interchange: number; currency: Currency; }[]",
        "references": {
          "Currency": {
            "location": "import",
            "path": "isoly"
          }
        }
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [],
        "text": ""
      }
    },
    "opened": {
      "type": "string",
      "mutable": false,
      "complexType": {
        "original": "string",
        "resolved": "string",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [],
        "text": ""
      },
      "attribute": "opened",
      "reflect": false
    },
    "costPlus": {
      "type": "boolean",
      "mutable": false,
      "complexType": {
        "original": "boolean",
        "resolved": "boolean | undefined",
        "references": {}
      },
      "required": false,
      "optional": true,
      "docs": {
        "tags": [],
        "text": ""
      },
      "attribute": "cost-plus",
      "reflect": false
    },
    "view": {
      "type": "string",
      "mutable": false,
      "complexType": {
        "original": "\"single\" | \"multiple\"",
        "resolved": "\"multiple\" | \"single\"",
        "references": {}
      },
      "required": true,
      "optional": false,
      "docs": {
        "tags": [],
        "text": ""
      },
      "attribute": "view",
      "reflect": true
    }
  }; }
  static get states() { return {
    "settlements": {},
    "authorizations": {},
    "merchants": {}
  }; }
}
