'use strict';

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

const index = require('./index-e0385008.js');
const index$1 = require('./index-ba857994.js');

const logItemCss = "fireenjin-log-item{display:block}fireenjin-log-item ion-label{margin-top:0}fireenjin-log-item fireenjin-json-viewer{max-height:60px;display:block;overflow:hidden;transition:all ease 0.3s}fireenjin-log-item:hover fireenjin-json-viewer{cursor:pointer;max-height:none}fireenjin-log-item h3{color:var(--ion-color-medium);text-indent:10px}";

const LogItem = class {
  constructor(hostRef) {
    index.registerInstance(this, hostRef);
    this.type = undefined;
    this.name = undefined;
    this.resolveTime = undefined;
    this.input = undefined;
    this.output = undefined;
    this.createdAt = undefined;
    this.lines = undefined;
  }
  formatDate(timestamp) {
    return index$1.format(new Date(Date.parse(timestamp)), "MM/dd/yyyy @ hh:mm aaa");
  }
  render() {
    return (index.h("ion-item", { lines: this.lines }, index.h("ion-label", { class: "ion-text-wrap" }, index.h("ion-grid", null, index.h("ion-row", null, index.h("ion-col", null, index.h("h2", null, this.type, " - ", this.name, " ", this.resolveTime ? `(${this.resolveTime}ms)` : "")), index.h("ion-col", { style: {
        display: "flex",
        justifyContent: "flex-end",
      } }, index.h("small", { style: {
        color: "var(--ion-color-medium)",
      } }, this.formatDate(this.createdAt)))), index.h("ion-row", null, index.h("ion-col", null, index.h("h3", null, "Input"), index.h("fireenjin-json-viewer", { innerHTML: typeof this.input === "object"
        ? JSON.stringify(this.input)
        : this.input })), index.h("ion-col", null, index.h("h3", null, "Output"), index.h("fireenjin-json-viewer", { innerHTML: typeof this.output === "object"
        ? JSON.stringify(this.output)
        : this.output })))))));
  }
};
LogItem.style = logItemCss;

exports.fireenjin_log_item = LogItem;
