import { c as e } from "../../chunks/runtime.js";
import { css as s, html as t } from "lit";
import { LitElement as a, safeClassMap as i } from "@arcgis/lumina";
import { createRef as h, ref as n } from "lit/directives/ref.js";
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
v4.34.7 */
const c = s``, r = "arcgis-feature-attachments", m = {
  base: r
};
class d extends a {
  constructor() {
    super(...arguments), this._attachmentsRef = h(), this.hideSection = !1, this.attachmentsLength = 0, this.headingLevel = 2;
  }
  static {
    this.properties = { hideSection: 16, attachmentsLength: 16, state: 16, attachmentKeywords: 0, attachmentTypes: 0, description: 1, displayType: 1, graphic: 0, heading: 1, headingLevel: 9, messages: 0 };
  }
  static {
    this.styles = c;
  }
  _updateAttachmentsState() {
    this.state = this._attachmentsRef.value?.state, this.attachmentsLength = this._attachmentsRef.value?.attachmentInfos?.length ?? 0;
  }
  render() {
    return t`<div class=${i(m.base)}>${this.renderContent()}</div>`;
  }
  renderContent() {
    return t`<div .hidden=${!(this.state === "loading" || this.attachmentsLength > 0)}><arcgis-feature-element-info .heading=${this.heading} .description=${this.description} .headingLevel=${this.headingLevel}></arcgis-feature-element-info><arcgis-attachments @arcgisPropertyChange=${this._updateAttachmentsState} .graphic=${this.graphic} .displayType=${this.displayType} .attachmentKeywords=${this.attachmentKeywords} .attachmentTypes=${this.attachmentTypes} ${n(this._attachmentsRef)}></arcgis-attachments></div>`;
  }
}
e("arcgis-feature-attachments", d);
export {
  d as ArcgisFeatureAttachments
};
