'use strict';

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

const index = require('./index-6377956f.js');

const EclGalleryItem = class {
  constructor(hostRef) {
    index.registerInstance(this, hostRef);
    this.styleClass = '';
    this.theme = 'ec';
    this.imageAlt = undefined;
    this.mediaHref = undefined;
    this.mediaIframeHref = undefined;
    this.mediaSharePath = undefined;
    this.meta = undefined;
    this.type = 'image';
    this.icon = 'video';
  }
  getClass() {
    return [
      `ecl-gallery__item`,
      `sc-ecl-gallery-${this.theme}`,
      this.styleClass
    ].join(' ');
  }
  getLinkAttr() {
    const attrs = {
      'data-ecl-gallery-item': ''
    };
    if (this.mediaSharePath) {
      attrs['data-ecl-gallery-item-share'] = this.mediaSharePath;
    }
    if (this.mediaIframeHref) {
      attrs['data-ecl-gallery-item-embed-src'] = this.mediaIframeHref;
    }
    return attrs;
  }
  render() {
    return (index.h("li", { class: this.getClass() }, index.h("a", Object.assign({ href: this.mediaIframeHref ? this.mediaIframeHref : this.mediaHref, class: `ecl-gallery__item-link sc-ecl-gallery-${this.theme}` }, this.getLinkAttr()), index.h("figure", { class: `ecl-gallery__image-container sc-ecl-gallery-${this.theme}` }, index.h("slot", { name: "video" }), this.type !== 'html-video' ?
      index.h("img", { src: this.mediaHref, alt: this.imageAlt, class: `ecl-gallery__image sc-ecl-gallery-${this.theme}` }) : '', this.type !== 'image' ?
      index.h("ecl-icon", { "style-class": `ecl-gallery__image-icon sc-ecl-gallery-${this.theme}`, icon: this.icon, size: "l" }) : '', index.h("figcaption", { class: `ecl-gallery__description sc-ecl-gallery-${this.theme}`, "data-ecl-gallery-description": true }, index.h("slot", null), index.h("span", { class: `ecl-gallery__meta sc-ecl-gallery-${this.theme}`, "data-ecl-gallery-meta": true }, this.meta))))));
  }
};

exports.ecl_gallery_item = EclGalleryItem;

//# sourceMappingURL=ecl-gallery-item.cjs.entry.js.map