import { r as registerInstance, h, H as Host } from './index-b6f10a81.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) {
    registerInstance(this, hostRef);
    this.meta = {};
  }
  render() {
    const { field, meta } = this;
    let value = this.value || '-';
    if (this.value && field.inputType === 'url') {
      value = h("a", { href: value.startsWith('http') ? value : `http://${value}`, target: "_blank" }, value);
    }
    // 0 means no limit
    const { lines = 0 } = meta;
    return (h(Host, { style: { '--line-count': lines } }, field.format === 'markdown'
      ? h("dvn-markdown", { content: value })
      : value));
  }
};
DvnFieldDisplayText.style = dvnFieldDisplayTextCss;

export { DvnFieldDisplayText as dvn_field_display_text };
