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';
import changeManager from '../../../../../helpers/change-manager/change-manager';
import { FORM_ELEMENT_VALUE_CHANGE } from '../../../../../helpers/change-manager/subject/static-subject/static-subject-title';
/** The `VegaRadioGroupValueController` class in TypeScript manages the value and change events for a radio group component. */
export class VegaRadioGroupValueController extends VegaSlimmer {
  /**
   * The function syncs radio items status, emits an event with the new value, and notifies a change manager.
   *
   * @param {string} newValue - newValue is a string value that represents the new value to be set for the radio items.
   */
  emitEventAndNotifyValueChangeSubject(newValue) {
    this.changeEventEmitter.emit(newValue);
    changeManager.notify(FORM_ELEMENT_VALUE_CHANGE, {
      host: this.host,
      detail: newValue,
    });
  }
  /**
   * The function `setValue` in TypeScript sets a new value for a variable.
   *
   * @param {string} newValue - new value that will be assigned to the `value` property
   */
  setValue(newValue) {
    this.value = newValue;
  }
}
__decorate([
  MapToComponentField()
], VegaRadioGroupValueController.prototype, "host", void 0);
__decorate([
  MapToComponentField({ writable: true })
], VegaRadioGroupValueController.prototype, "value", void 0);
__decorate([
  MapToComponentField()
], VegaRadioGroupValueController.prototype, "changeEventEmitter", void 0);
__decorate([
  MapToComponentField()
], VegaRadioGroupValueController.prototype, "radioItemsController", void 0);
__decorate([
  MapToComponentMethod('watchValue')
], VegaRadioGroupValueController.prototype, "emitEventAndNotifyValueChangeSubject", null);
