import { Host, h } from '@stencil/core';
/**
 * Displays an image as a Profile photo.
 */
export class BsProfileImg {
  constructor() {
    this.src = undefined;
    this.size = undefined;
    this.initials = undefined;
    this.profileName = undefined;
    this.showImage = !!this.src;
  }
  render() {
    return (h(Host, { class: "bs-profile-img", "data-img-size": this.size, "data-initials": this.initials, "data-no-img": !this.showImage }, this.showImage && h("img", { src: this.src, alt: `${this.profileName} Profile Photo.`, onError: () => this.showImage = false })));
  }
  static get is() { return "bs-profile-img"; }
  static get originalStyleUrls() {
    return {
      "$": ["bs-profile-img.scss"]
    };
  }
  static get styleUrls() {
    return {
      "$": ["bs-profile-img.css"]
    };
  }
  static get properties() {
    return {
      "src": {
        "type": "string",
        "mutable": false,
        "complexType": {
          "original": "string",
          "resolved": "string",
          "references": {}
        },
        "required": false,
        "optional": true,
        "docs": {
          "tags": [],
          "text": "The URL for the profile image."
        },
        "attribute": "src",
        "reflect": false
      },
      "size": {
        "type": "string",
        "mutable": false,
        "complexType": {
          "original": "ImageSizes",
          "resolved": "\"lg\" | \"md\" | \"sm\" | \"xl\" | \"xs\"",
          "references": {
            "ImageSizes": {
              "location": "import",
              "path": "../../types/propTypes"
            }
          }
        },
        "required": false,
        "optional": true,
        "docs": {
          "tags": [],
          "text": "Changes the size of the profile image"
        },
        "attribute": "size",
        "reflect": false
      },
      "initials": {
        "type": "string",
        "mutable": false,
        "complexType": {
          "original": "string",
          "resolved": "string",
          "references": {}
        },
        "required": false,
        "optional": false,
        "docs": {
          "tags": [],
          "text": "Initials to display if the image src is not present."
        },
        "attribute": "initials",
        "reflect": false
      },
      "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
      }
    };
  }
  static get states() {
    return {
      "showImage": {}
    };
  }
}
//# sourceMappingURL=bs-profile-img.js.map
