import { Host, h } from '@stencil/core';
/**
 * A user's information when displayed in the profile block.
 */
export class BsProfileDetails {
  constructor() {
    this.profileName = undefined;
    this.company = undefined;
    this.jobTitle = undefined;
    this.email = undefined;
    this.action = undefined;
    this.actionIcon = undefined;
    this.miscMeta = undefined;
    this.miscMetaIcon = undefined;
  }
  handleActionToggle(e) {
    if (e.target.tagName !== 'BUTTON')
      return;
    e.preventDefault();
    e.stopPropagation();
    this.actionToggled.emit();
  }
  get actionButton() {
    if (!this.action)
      return null;
    const ActionIcon = this.actionIcon ? `bs-icon-${this.actionIcon}` : null;
    return (h("button", { "data-icon": true }, ActionIcon && h(ActionIcon, { size: "sm" }), this.action));
  }
  get metaText() {
    if (!this.miscMeta)
      return null;
    const MetaIcon = this.miscMetaIcon ? `bs-icon-${this.miscMetaIcon}` : null;
    return (h("span", { "data-icon": true }, MetaIcon && h(MetaIcon, { size: "sm" }), this.miscMeta));
  }
  render() {
    return (h(Host, { class: "bs-profile-details" }, this.actionButton, h("span", { class: "bs-profile-name", "data-size": "sm", "data-weight": "bold" }, this.profileName), this.company && h("span", { "data-weight": "bold" }, this.company), this.jobTitle && h("span", null, this.jobTitle), this.email && h("span", null, this.email), this.metaText));
  }
  static get is() { return "bs-profile-details"; }
  static get originalStyleUrls() {
    return {
      "$": ["bs-profile-details.scss"]
    };
  }
  static get styleUrls() {
    return {
      "$": ["bs-profile-details.css"]
    };
  }
  static get properties() {
    return {
      "profileName": {
        "type": "string",
        "mutable": false,
        "complexType": {
          "original": "string",
          "resolved": "string",
          "references": {}
        },
        "required": false,
        "optional": false,
        "docs": {
          "tags": [],
          "text": "Name of the user. This is used to add a descriptive alt tag to the image."
        },
        "attribute": "profile-name",
        "reflect": false
      },
      "company": {
        "type": "string",
        "mutable": false,
        "complexType": {
          "original": "string",
          "resolved": "string",
          "references": {}
        },
        "required": false,
        "optional": true,
        "docs": {
          "tags": [],
          "text": "The name of the company that the user works for."
        },
        "attribute": "company",
        "reflect": false
      },
      "jobTitle": {
        "type": "string",
        "mutable": false,
        "complexType": {
          "original": "string",
          "resolved": "string",
          "references": {}
        },
        "required": false,
        "optional": true,
        "docs": {
          "tags": [],
          "text": "Job title of the user."
        },
        "attribute": "job-title",
        "reflect": false
      },
      "email": {
        "type": "string",
        "mutable": false,
        "complexType": {
          "original": "string",
          "resolved": "string",
          "references": {}
        },
        "required": false,
        "optional": true,
        "docs": {
          "tags": [],
          "text": "The user's email address"
        },
        "attribute": "email",
        "reflect": false
      },
      "action": {
        "type": "string",
        "mutable": false,
        "complexType": {
          "original": "string",
          "resolved": "string",
          "references": {}
        },
        "required": false,
        "optional": true,
        "docs": {
          "tags": [],
          "text": "Optional 'action' text, first item listed if provided. ex: \"Follow\""
        },
        "attribute": "action",
        "reflect": false
      },
      "actionIcon": {
        "type": "string",
        "mutable": false,
        "complexType": {
          "original": "string",
          "resolved": "string",
          "references": {}
        },
        "required": false,
        "optional": true,
        "docs": {
          "tags": [],
          "text": "Optional icon to show with the action text."
        },
        "attribute": "action-icon",
        "reflect": false
      },
      "miscMeta": {
        "type": "string",
        "mutable": false,
        "complexType": {
          "original": "string",
          "resolved": "string",
          "references": {}
        },
        "required": false,
        "optional": true,
        "docs": {
          "tags": [],
          "text": "Optional miscellaneous text, appears last. ex: \"10 contributions\""
        },
        "attribute": "misc-meta",
        "reflect": false
      },
      "miscMetaIcon": {
        "type": "string",
        "mutable": false,
        "complexType": {
          "original": "string",
          "resolved": "string",
          "references": {}
        },
        "required": false,
        "optional": true,
        "docs": {
          "tags": [],
          "text": "Optional icon to show with the miscellaneous text."
        },
        "attribute": "misc-meta-icon",
        "reflect": false
      }
    };
  }
  static get events() {
    return [{
        "method": "actionToggled",
        "name": "action-toggled",
        "bubbles": true,
        "cancelable": true,
        "composed": true,
        "docs": {
          "tags": [],
          "text": "Fire when action is clicked."
        },
        "complexType": {
          "original": "void",
          "resolved": "void",
          "references": {}
        }
      }];
  }
  static get listeners() {
    return [{
        "name": "click",
        "method": "handleActionToggle",
        "target": undefined,
        "capture": false,
        "passive": false
      }];
  }
}
//# sourceMappingURL=bs-profile-details.js.map
