var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  return c > 3 && r && Object.defineProperty(target, key, r), r;
};
import { MapToComponentField, MapToComponentMethod, VegaSlimmer } from 'vega-slimmer/core';
/** Controller class for managing the render mode of the VegaInput component. */
export class VegaInputRenderModeController extends VegaSlimmer {
  constructor() {
    super(...arguments);
    this.hasItemsSlot = false;
  }
  /** Sets the render mode based on the presence of the items slot. */
  connectedCallback() {
    this.setRenderMode();
  }
  /**
   * Checks if the render mode is source mode.
   *
   * @returns {boolean} True if in source render mode, false otherwise.
   */
  isSource() {
    return Array.isArray(this.suggestionsDropdownSource);
  }
  /**
   * Checks if the render mode is template mode.
   *
   * @returns {boolean} True if in template render mode, false otherwise.
   */
  isTemplate() {
    return this.hasItemsSlot;
  }
  /**
   * Sets the render mode based on the presence of the items slot.
   */
  setRenderMode() {
    this.hasItemsSlot = !!this.host.querySelector('[slot=items]');
  }
}
__decorate([
  MapToComponentField()
], VegaInputRenderModeController.prototype, "host", void 0);
__decorate([
  MapToComponentField()
], VegaInputRenderModeController.prototype, "suggestionsDropdownSource", void 0);
__decorate([
  MapToComponentMethod('connectedCallback')
], VegaInputRenderModeController.prototype, "connectedCallback", null);
