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 { MelodicComponent } from '@melodicdev/core';
import { radioCardTemplate } from './radio-card.template.js';
import { radioCardStyles } from './radio-card.styles.js';
/**
 * ml-radio-card - A card-style radio option for use within ml-radio-card-group
 *
 * @example
 * ```html
 * <ml-radio-card value="basic" label="Basic plan" description="Up to 5 users" detail="$10/mo" icon="user"></ml-radio-card>
 * ```
 *
 * @slot default - Additional content below label/description
 */
let RadioCardComponent = class RadioCardComponent {
    constructor() {
        /** Card value identifier */
        this.value = '';
        /** Primary label */
        this.label = '';
        /** Description text below label */
        this.description = '';
        /** Secondary detail text (e.g. price), shown on the right */
        this.detail = '';
        /** Optional icon name */
        this.icon = '';
        /** Selected state (managed by parent via attribute) */
        this.selected = false;
        /** Disabled state on this card */
        this.disabled = false;
        /** Disabled state from parent group */
        this.groupDisabled = false;
        this.handleClick = () => {
            if (this.isDisabled)
                return;
            this.elementRef.dispatchEvent(new CustomEvent('ml:card-select', {
                bubbles: true,
                composed: true,
                detail: { value: this.value }
            }));
        };
    }
    get isDisabled() {
        return this.disabled || this.groupDisabled;
    }
};
RadioCardComponent = __decorate([
    MelodicComponent({
        selector: 'ml-radio-card',
        template: radioCardTemplate,
        styles: radioCardStyles,
        attributes: ['value', 'label', 'description', 'detail', 'icon', 'selected', 'disabled', 'group-disabled']
    })
], RadioCardComponent);
export { RadioCardComponent };
