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 { Fragment, h } from '@stencil/core';
import { MapToComponentField, VegaSlimmer } from 'vega-slimmer/core';
/** The class VegaInputRangeRenderer is a TypeScript React component that renders an input range field with custom label, hint, and styling options. */
export class VegaInputRangeRenderer extends VegaSlimmer {
  /**
   * This function returns the reference to the input range container element in a TypeScript React component.
   *
   * @returns {HTMLElement} An HTMLElement, specifically the inputRangeContainerRef.
   */
  getInputRangeContainerRef() {
    return this.inputRangeContainerRef;
  }
  /**
   * The render function returns a JSX structure that includes a vega-flex container with a vega-field-label and an input range input renderer.
   *
   * @returns {HTMLElement} An HTMLElement is being returned. The code snippet is a render method of a component that
   * returns a structure containing a vega-flex element with various attributes and child elements,
   * including a vega-field-label and the result of calling the render method of
   * inputRangeInputRenderer. Additionally, the renderHintDom method is being called and its result is
   * included in the returned structure.
   */
  render() {
    return (h(Fragment, null,
      h("vega-flex", { class: "vega-input-range-container", direction: this.stack !== 'horizontal' ? 'col' : 'row', alignItems: this.stack !== 'horizontal' ? 'start' : 'center', gap: "size-8", ref: (dom) => (this.inputRangeContainerRef = dom) },
        h("vega-field-label", { onClick: this.inputRangeInputRenderer.focusFirstInput, isFieldRequired: this.required, disabled: this.disabled, label: this.label }),
        this.inputRangeInputRenderer.render()),
      this.renderHintDom()));
  }
  /**
   * The function `renderHintDom` returns a label element with a hint text if the `hint` property is provided.
   *
   * @returns {Nullable<HTMLElement>} A `label` element with the class `vega-input-range-hint` containing a `vega-font` element
   * with the variant `font-footnote1-short` and color `text-secondary`, displaying the hint text stored
   * in the `this.hint` property.
   */
  renderHintDom() {
    if (this.hint) {
      return (h("label", { class: "vega-input-range-hint" },
        h("vega-font", { variant: "font-footnote1-short", color: "text-secondary" }, this.hint)));
    }
  }
}
__decorate([
  MapToComponentField()
], VegaInputRangeRenderer.prototype, "required", void 0);
__decorate([
  MapToComponentField()
], VegaInputRangeRenderer.prototype, "disabled", void 0);
__decorate([
  MapToComponentField()
], VegaInputRangeRenderer.prototype, "label", void 0);
__decorate([
  MapToComponentField()
], VegaInputRangeRenderer.prototype, "hint", void 0);
__decorate([
  MapToComponentField()
], VegaInputRangeRenderer.prototype, "stack", void 0);
__decorate([
  MapToComponentField()
], VegaInputRangeRenderer.prototype, "inputRangeInputRenderer", void 0);
