/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
import { c as d } from "../../chunks/runtime.js";
import { css as c, html as t } from "lit";
import { watch as e } from "@arcgis/core/core/reactiveUtils.js";
import { LitElement as l } from "@arcgis/lumina";
const r = c`.table{display:flex;flex-direction:column;border-top:1px solid var(--calcite-color-border-1)}.row{display:flex;flex-direction:row;border-bottom:1px solid var(--calcite-color-border-1);border-right:1px solid var(--calcite-color-border-1)}.data{flex:1;border-left:1px solid var(--calcite-color-border-1);padding:5px}.empty-state{width:100%;max-inline-size:unset;transition-duration:0ms;margin-top:var(--calcite-spacing-md)}`;
class n extends l {
  constructor() {
    super(...arguments), this._disabled = !1, this._hasMetadata = !1, this._missionInfo = {}, this._platformInfo = {}, this._frameInfo = {};
  }
  static {
    this.properties = { _disabled: 16, _hasMetadata: 16, _missionInfo: 16, _platformInfo: 16, _frameInfo: 16, viewModel: 0, messages: 0 };
  }
  static {
    this.styles = r;
  }
  loaded() {
    this.manager.onLifecycle(() => [
      e(() => this.viewModel.state, (a) => {
        this._disabled = a === "not-ready" || a === "waiting";
      }, { initial: !0 }),
      e(() => [
        this.viewModel.metadata?.missionInfo,
        this.viewModel.metadata?.platformInfo,
        this.viewModel.metadata?.frameInfo
      ], () => {
        const { metadata: a } = this.viewModel;
        if (this._hasMetadata = !!a, !this._hasMetadata)
          return;
        const { missionInfo: i, platformInfo: s, frameInfo: o } = a;
        this._missionInfo = i, this._platformInfo = s, this._frameInfo = o;
      }, { initial: !0 })
    ]);
  }
  render() {
    const { messages: a } = this;
    return this._disabled || !this._hasMetadata ? t`<calcite-tile class="empty-state" .description=${a.metadataDescription} .heading=${a.metadataNotLoaded}></calcite-tile>` : t`<calcite-block .heading=${a.metadata} expanded><calcite-accordion appearance=solid selection-mode=single><calcite-accordion-item .heading=${a.missionInfo}><div class="table">${Object.keys(this._missionInfo).map((i) => t`<div class="row"><div class="data">${i}</div><div class="data">${this._missionInfo[i]}</div></div>`)}</div></calcite-accordion-item><calcite-accordion-item .heading=${a.platformInfo}><div class="table">${Object.keys(this._platformInfo).map((i) => t`<div class="row"><div class="data">${i}</div><div class="data">${this._platformInfo[i]}</div></div>`)}</div></calcite-accordion-item><calcite-accordion-item .heading=${a.frameInfo}><div class="table">${Object.keys(this._frameInfo).map((i) => t`<div class="row"><div class="data">${i}</div><div class="data">${this._frameInfo[i]}</div></div>`)}</div></calcite-accordion-item></calcite-accordion></calcite-block>`;
  }
}
d("arcgis-video-player-metadata", n);
export {
  n as VideoPlayerMetadata
};
