import { Component, Element, Event, h, Prop, State } from "@stencil/core";
import * as translation from "./translation";
export class IntergiroCustomerCreatePopup {
  constructor() {
    this.opened = false;
    this.visible = false;
  }
  componentWillLoad() {
    this.t = translation.create(this.element);
  }
  onCreate(e) {
    this.create.emit(e.detail);
  }
  onClose(e) {
    this.opened = false;
  }
  render() {
    return [
      this.opened
        ? [
          h("ig-customer-create", { onClose: (e) => this.onClose(e), onCreateCustomer: (e) => this.onCreate(e) }),
          h("div", { class: "arrow" }),
          h("div", { class: "background", onClick: () => (this.opened = false) }),
        ]
        : [],
      h("smoothly-icon", { name: this.opened ? "chevron-down-circle" : "add-circle", size: "large", toolTip: this.opened ? this.t("Close") : this.t("Create customer"), onClick: () => (this.opened = !this.opened) }),
    ];
  }
  static get is() { return "ig-customer-create-popup"; }
  static get encapsulation() { return "scoped"; }
  static get originalStyleUrls() { return {
    "$": ["style.css"]
  }; }
  static get styleUrls() { return {
    "$": ["style.css"]
  }; }
  static get properties() { return {
    "visible": {
      "type": "boolean",
      "mutable": true,
      "complexType": {
        "original": "boolean",
        "resolved": "boolean",
        "references": {}
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [],
        "text": ""
      },
      "attribute": "visible",
      "reflect": true,
      "defaultValue": "false"
    }
  }; }
  static get states() { return {
    "opened": {},
    "t": {}
  }; }
  static get events() { return [{
      "method": "create",
      "name": "create",
      "bubbles": true,
      "cancelable": true,
      "composed": true,
      "docs": {
        "tags": [],
        "text": ""
      },
      "complexType": {
        "original": "any",
        "resolved": "any",
        "references": {}
      }
    }]; }
  static get elementRef() { return "element"; }
}
