import { r as registerInstance, h, H as Host } from './index-55faf181.js';
import { h as hasLink, l as linkify } from './utils-c4a3ab3b.js';

const dvnFieldDisplayCellTextCss = ".sc-dvn-field-display-cell-text-h{display:block;padding:6px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}";

const DvnFieldDisplayCellText = class {
  constructor(hostRef) {
    registerInstance(this, hostRef);
  }
  render() {
    const { field } = this;
    let value = this.value;
    if (!value) {
      return (h(Host, null));
    }
    if (field.inputType === 'url') {
      value = h("a", { href: value.startsWith('http') ? value : `http://${value}`, target: "_blank" }, value);
    }
    else if (hasLink(this.value)) {
      return (h(Host, { innerHTML: linkify(value) }));
    }
    if (field.format === 'markdown') {
      return (h(Host, null, h("dvn-markdown", { content: value })));
    }
    return (h(Host, null, value));
  }
};
DvnFieldDisplayCellText.style = dvnFieldDisplayCellTextCss;

export { DvnFieldDisplayCellText as dvn_field_display_cell_text };
