'use strict';

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

const index = require('./index-7cdf1df1.js');

const dvnFieldDisplayTextCss = "dvn-field-display-text{display:block;--line-count:0;overflow:hidden;display:-webkit-box;-webkit-line-clamp:var(--line-count);-webkit-box-orient:vertical;line-height:var(--line-height);min-height:calc(var(--line-count) * var(--line-height))}";

const DvnFieldDisplayText = class {
  constructor(hostRef) {
    index.registerInstance(this, hostRef);
    this.meta = {};
  }
  render() {
    const { field, meta } = this;
    let value = this.value || '-';
    if (this.value && field.inputType === 'url') {
      value = index.h("a", { href: value.startsWith('http') ? value : `http://${value}`, target: "_blank" }, value);
    }
    // 0 means no limit
    const { lines = 0 } = meta;
    return (index.h(index.Host, { style: { '--line-count': lines } }, field.format === 'markdown'
      ? index.h("dvn-markdown", { content: value })
      : value));
  }
};
DvnFieldDisplayText.style = dvnFieldDisplayTextCss;

exports.dvn_field_display_text = DvnFieldDisplayText;
