import { EventEmitter, ComponentInterface } from '../../stencil-public-runtime';
import { BaseChoiceControl } from '../_shared/form/base-choice-control';
/**
* @component BcmSwitch
* @description
* A form-associated toggle switch component representing a boolean choice.
* It behaves like a checkbox and integrates with native HTML forms via ElementInternals.
*
* This component supports **three validation strategies** via `validation-mode`:
*
* - **`native`**:
* - Uses native browser constraint validation.
* - Sets the underlying input's `required` attribute.
* - Browser may show the native validation bubble when the form calls `reportValidity()` / submit validation runs.
*
* - **`silent`**:
* - Does **not** rely on native `required` (prevents the browser bubble).
* - Computes the "missing required" state internally and exposes it via `error` + `caption`.
* - UI errors are **gated**: they appear only after the control is touched or after a submit attempt.
*
* - **`none`**:
* - Value-only mode (headless): participates in form value submission but never becomes invalid.
*
* ## UI error gating (silent mode)
* To avoid showing errors on initial render, the component tracks:
* - `touched`: set after the first user interaction
* - `submitAttempted`: set when the parent form emits `submit`
*
* Only when `touched || submitAttempted` the component will show `error/caption` in `silent` mode.
*
* ## Value behavior
* - When checked, the component submits its `value` (default: `"on"`).
* - When unchecked, no value is submitted.
* - When disabled, the component does not participate in submission or validity.
*
* @example Basic usage
*