import { LitElement, html } from 'lit';
import { property } from 'lit/decorators.js';
import { watch } from './watch.mjs';

var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __decorateClass = (decorators, target, key, kind) => {
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
    if (decorator = decorators[i])
      result = (kind ? decorator(target, key, result) : decorator(result)) || result;
  if (kind && result)
    __defProp(target, key, result);
  return result;
};
class FlowRdfElement extends LitElement {
  emit(name, options) {
    const event = new CustomEvent(name, {
      bubbles: true,
      cancelable: false,
      composed: true,
      detail: {},
      ...options
    });
    this.dispatchEvent(event);
    return event;
  }
  static define(name, elementConstructor = this, options = {}) {
    const currentlyRegisteredConstructor = customElements.get(name);
    if (!currentlyRegisteredConstructor) {
      customElements.define(name, class extends elementConstructor {
      }, options);
      return;
    }
  }
}
__decorateClass([
  property()
], FlowRdfElement.prototype, "dir", 2);
__decorateClass([
  property()
], FlowRdfElement.prototype, "lang", 2);
const _FlowRdfFormControl = class _FlowRdfFormControl extends FlowRdfElement {
  constructor() {
    super(...arguments);
    this.divider = false;
  }
  handleClassChange() {
    this.classList.add(_FlowRdfFormControl.FLOW_UI_FORM_CONTROL_CLASS);
  }
  connectedCallback() {
    super.connectedCallback();
    this.classList.add(_FlowRdfFormControl.FLOW_UI_FORM_CONTROL_CLASS);
  }
  renderDivider() {
    return html`
      <flow-ui-divider class="form-control__divider"></flow-ui-divider>
    `;
  }
};
_FlowRdfFormControl.FLOW_UI_FORM_CONTROL_CLASS = "flow-ui-form-control";
__decorateClass([
  property({ reflect: true })
], _FlowRdfFormControl.prototype, "class", 2);
__decorateClass([
  property({ reflect: true })
], _FlowRdfFormControl.prototype, "size", 2);
__decorateClass([
  property({ type: Boolean, reflect: true })
], _FlowRdfFormControl.prototype, "divider", 2);
__decorateClass([
  watch("class")
], _FlowRdfFormControl.prototype, "handleClassChange", 1);
let FlowRdfFormControl = _FlowRdfFormControl;

export { FlowRdfFormControl, FlowRdfElement as default };
