import "./Radio.css";
import {CenterBaseline as $1f4b04be3f24aae3$export$768dac55bb57081d} from "./CenterBaseline.mjs";
import {FormContext as $9b916426527cebe7$export$c24727297075ec6a, useFormProps as $9b916426527cebe7$export$a6b5be5c6b451665} from "./Form.mjs";
import {pressScale as $10ea7662e51a285b$export$56e8cba416805d8d} from "./pressScale.mjs";
import {jsx as $Ipfg8$jsx, jsxs as $Ipfg8$jsxs, Fragment as $Ipfg8$Fragment} from "react/jsx-runtime";
import {Radio as $Ipfg8$Radio} from "react-aria-components";
import {forwardRef as $Ipfg8$forwardRef, useRef as $Ipfg8$useRef, useContext as $Ipfg8$useContext} from "react";
import {useFocusableRef as $Ipfg8$useFocusableRef} from "@react-spectrum/utils";

/*
 * Copyright 2024 Adobe. All rights reserved.
 * This file is licensed to you under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License. You may obtain a copy
 * of the License at http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under
 * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
 * OF ANY KIND, either express or implied. See the License for the specific language
 * governing permissions and limitations under the License.
 */ 






const $1ae2870af9a200f8$var$wrapper = function anonymous(props, overrides) {
    let rules = " ";
    let position = false;
    let gridColumnStart = false;
    let matches = (overrides || '').matchAll(/(?:^|\s)(J|G|I|H|_u|_v|_s|__A|_d|_J|z|y|B|A|_P|_9|W|_l|_A|_z|_6|Z|N|L)[^\s]+/g);
    for (let p of matches){
        if (p[1] === "_P") position = true;
        if (p[1] === "z") gridColumnStart = true;
        rules += p[0];
    }
    rules += ' sd1';
    if (!position) rules += ' _Pc1';
    rules += ' qf1';
    rules += ' ea1';
    if (props.size === "XL") {
        rules += ' uk1';
        rules += ' ucJ9TBTb1';
        rules += ' ud3Euai1';
        rules += ' uea1';
        rules += ' ugb1';
        rules += ' uhd1';
        rules += ' uje1';
        rules += ' u2NhKxcl1';
        rules += ' uic1';
    } else if (props.size === "L") {
        rules += ' uk1';
        rules += ' ucJ9TBTb1';
        rules += ' ud3Euai1';
        rules += ' uea1';
        rules += ' ugb1';
        rules += ' uhd1';
        rules += ' uje1';
        rules += ' u2NhKxcl1';
        rules += ' uic1';
    } else if (props.size === "S") {
        rules += ' uk1';
        rules += ' ucJ9TBTb1';
        rules += ' ud3Euai1';
        rules += ' uea1';
        rules += ' ugb1';
        rules += ' uhd1';
        rules += ' uje1';
        rules += ' u2NhKxcl1';
        rules += ' uic1';
    } else if (props.size === "XS") {
        rules += ' uk1';
        rules += ' ucJ9TBTb1';
        rules += ' ud3Euai1';
        rules += ' uea1';
        rules += ' ugb1';
        rules += ' uhd1';
        rules += ' uje1';
        rules += ' u2NhKxcl1';
        rules += ' uic1';
    } else {
        rules += ' uk1';
        rules += ' ucJ9TBTb1';
        rules += ' ud3Euai1';
        rules += ' uea1';
        rules += ' ugb1';
        rules += ' uhd1';
        rules += ' uje1';
        rules += ' u2NhKxcl1';
        rules += ' uic1';
    }
    if (props.size === "XL") {
        rules += ' -_6BNtrc-e1';
        rules += ' vx1';
    } else if (props.size === "L") {
        rules += ' -_6BNtrc-d1';
        rules += ' vx1';
    } else if (props.size === "S") {
        rules += ' -_6BNtrc-b1';
        rules += ' vx1';
    } else if (props.size === "XS") {
        rules += ' -_6BNtrc-a1';
        rules += ' vx1';
    } else {
        rules += ' -_6BNtrc-c1';
        rules += ' vx1';
    }
    if (props.size === "XL") {
        rules += ' xb1';
        rules += ' _xa1';
    } else if (props.size === "L") {
        rules += ' xb1';
        rules += ' _xa1';
    } else if (props.size === "S") {
        rules += ' xb1';
        rules += ' _xa1';
    } else if (props.size === "XS") {
        rules += ' xb1';
        rules += ' _xa1';
    } else {
        rules += ' xb1';
        rules += ' _xa1';
    }
    if (props.size === "XL") {
        rules += ' _Fd1';
        rules += ' _FnuYUweb1';
    } else if (props.size === "L") {
        rules += ' _Fd1';
        rules += ' _FnuYUweb1';
    } else if (props.size === "S") {
        rules += ' _Fd1';
        rules += ' _FnuYUweb1';
    } else if (props.size === "XS") {
        rules += ' _Fd1';
        rules += ' _FnuYUweb1';
    } else {
        rules += ' _Fd1';
        rules += ' _FnuYUweb1';
    }
    if (props.isDisabled) {
        rules += ' pp1';
        rules += ' plc1';
    } else {
        if (props.isPressed) rules += ' po1';
        else if (props.isFocusVisible) rules += ' po1';
        else if (props.isHovered) rules += ' po1';
        else rules += ' pt1';
    }
    rules += ' Yc1';
    rules += ' Xb1';
    rules += ' _2b1';
    if (props.isInForm) {
        if (!gridColumnStart) rules += ' zhJUGr1';
    }
    rules += ' __ca1';
    return rules;
};
const $1ae2870af9a200f8$var$circle = function anonymous(props) {
    let rules = " ";
    if (props.isFocusVisible) rules += ' _Lf1';
    else rules += ' _Le1';
    rules += ' Oh1';
    rules += ' Olc1';
    rules += ' _Mc1';
    rules += ' _Kd1';
    if (props.size === "XL") rules += ' Zm1';
    else if (props.size === "L") rules += ' Zl1';
    else if (props.size === "S") rules += ' Zk1';
    else rules += ' Zu1';
    rules += ' FRuFGYc1';
    rules += ' _va1';
    rules += ' sd1';
    rules += ' eb1';
    rules += ' _Ca1';
    rules += ' Yd1';
    rules += ' Xb1';
    rules += ' _2b1';
    rules += ' og1';
    rules += ' ng1';
    rules += ' kg1';
    rules += ' jg1';
    rules += ' _jf1';
    rules += ' _oa1';
    if (props.isSelected) rules += ' _kUXU7p1';
    else rules += ' _k7m7Gv1';
    if (props.isSelected) rules += ' hUXU7p1';
    else rules += ' h7m7Gv1';
    if (props.isSelected) rules += ' mUXU7p1';
    else rules += ' m7m7Gv1';
    if (props.isSelected) rules += ' lUXU7p1';
    else rules += ' l7m7Gv1';
    rules += ' _yb1';
    rules += ' gX1';
    if (props.isDisabled) {
        rules += ' io1';
        rules += ' ilc1';
    } else if (props.isInvalid) {
        if (props.isPressed) rules += ' im1';
        else if (props.isFocusVisible) rules += ' im1';
        else if (props.isHovered) rules += ' im1';
        else rules += ' ip1';
        rules += ' ile1';
    } else if (props.isSelected) {
        if (props.isEmphasized) {
            if (props.isPressed) rules += ' iu1';
            else if (props.isFocusVisible) rules += ' iu1';
            else if (props.isHovered) rules += ' iu1';
            else rules += ' iw1';
        }
        rules += ' ild1';
    } else {
        if (props.isPressed) rules += ' in1';
        else if (props.isFocusVisible) rules += ' in1';
        else if (props.isHovered) rules += ' in1';
        else rules += ' iv1';
        rules += ' ila1';
    }
    if (props.size === "XL") rules += ' -F_-Fn1';
    else if (props.size === "L") rules += ' -F_-Fm1';
    else if (props.size === "S") rules += ' -F_-Fl1';
    else rules += ' -F_-Ft1';
    return rules;
};
const $1ae2870af9a200f8$export$d7b12c4107be0d61 = /*#__PURE__*/ (0, $Ipfg8$forwardRef)(function Radio(props, ref) {
    let { children: children, UNSAFE_className: UNSAFE_className = '', UNSAFE_style: UNSAFE_style } = props;
    let circleRef = (0, $Ipfg8$useRef)(null);
    let inputRef = (0, $Ipfg8$useRef)(null);
    let domRef = (0, $Ipfg8$useFocusableRef)(ref, inputRef);
    let isInForm = !!(0, $Ipfg8$useContext)((0, $9b916426527cebe7$export$c24727297075ec6a));
    let { size: size = 'M', ...allProps } = (0, $9b916426527cebe7$export$a6b5be5c6b451665)(props);
    return /*#__PURE__*/ (0, $Ipfg8$jsx)((0, $Ipfg8$Radio), {
        ...allProps,
        ref: domRef,
        inputRef: inputRef,
        style: UNSAFE_style,
        className: (renderProps)=>UNSAFE_className + $1ae2870af9a200f8$var$wrapper({
                ...renderProps,
                isInForm: isInForm,
                size: size
            }, allProps.styles),
        children: (renderProps)=>/*#__PURE__*/ (0, $Ipfg8$jsxs)((0, $Ipfg8$Fragment), {
                children: [
                    /*#__PURE__*/ (0, $Ipfg8$jsx)((0, $1f4b04be3f24aae3$export$768dac55bb57081d), {
                        children: /*#__PURE__*/ (0, $Ipfg8$jsx)("div", {
                            ref: circleRef,
                            style: (0, $10ea7662e51a285b$export$56e8cba416805d8d)(circleRef)(renderProps),
                            className: $1ae2870af9a200f8$var$circle({
                                ...renderProps,
                                isEmphasized: allProps.isEmphasized,
                                isSelected: renderProps.isSelected,
                                size: size
                            })
                        })
                    }),
                    children
                ]
            })
    });
});


export {$1ae2870af9a200f8$export$d7b12c4107be0d61 as Radio};
//# sourceMappingURL=Radio.mjs.map
