require("./Button.css");
var $e991cbcdf82ced71$exports = require("./CenterBaseline.cjs");
var $bde97c91243ed164$exports = require("../icons/Icon.cjs");
var $4526404114e78c80$exports = require("./intlStrings.cjs");
var $2061c83559b50a66$exports = require("./pressScale.cjs");
var $1c116ea4b0d2d023$exports = require("./ProgressCircle.cjs");
var $5eb75e0c130e0669$exports = require("../icons/Skeleton.cjs");
var $6367bc87eb7d24ad$exports = require("./Content.cjs");
var $bfa4962d90c8af48$exports = require("./Form.cjs");
var $ac757a4c2bd72aee$exports = require("../icons/useSpectrumContextProps.cjs");
var $8owBJ$reactjsxruntime = require("react/jsx-runtime");
var $8owBJ$reactariacomponents = require("react-aria-components");
var $8owBJ$react = require("react");
var $8owBJ$reactspectrumutils = require("@react-spectrum/utils");
var $8owBJ$reactariai18n = require("@react-aria/i18n");


function $parcel$interopDefault(a) {
  return a && a.__esModule ? a.default : a;
}

function $parcel$export(e, n, v, s) {
  Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
}

$parcel$export(module.exports, "ButtonContext", () => $25d06cf8d4e72761$export$24d547caef80ccd1);
$parcel$export(module.exports, "LinkButtonContext", () => $25d06cf8d4e72761$export$1c1a176f3b9e48d3);
$parcel$export(module.exports, "usePendingState", () => $25d06cf8d4e72761$export$edc9ced5c3e5ff00);
$parcel$export(module.exports, "Button", () => $25d06cf8d4e72761$export$353f5b6fc5456de1);
$parcel$export(module.exports, "LinkButton", () => $25d06cf8d4e72761$export$29d11c0fe2fc51d8);
/*
 * 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 $25d06cf8d4e72761$export$24d547caef80ccd1 = /*#__PURE__*/ (0, $8owBJ$react.createContext)(null);
const $25d06cf8d4e72761$export$1c1a176f3b9e48d3 = /*#__PURE__*/ (0, $8owBJ$react.createContext)(null);
const $25d06cf8d4e72761$var$button = function anonymous(props, overrides) {
    let rules = " ";
    let minWidth = false;
    let position = false;
    let width = 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] === "N") minWidth = true;
        if (p[1] === "_P") position = true;
        if (p[1] === "Z") width = true;
        rules += p[0];
    }
    if (props.isFocusVisible) rules += ' _Lf1';
    else rules += ' _Le1';
    if (props.isStaticColor) rules += ' Oe1';
    else rules += ' Oh1';
    rules += ' Olc1';
    rules += ' _Mc1';
    rules += ' _Kd1';
    if (props.staticColor === "white") rules += ' -Ovbhqd-gcwrnr1';
    else if (props.staticColor === "black") rules += ' -Ovbhqd-g4hn3s1';
    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';
    }
    rules += ' xd1';
    rules += ' _xa1';
    rules += ' xX0cczbc1';
    rules += ' _xX0cczba1';
    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.isStaticColor) {
        if (props.isDisabled) rules += ' pi1';
        else if (props.fillStyle === "outline") {
            if (props.variant === "genai") rules += ' px1';
            else if (props.variant === "premium") rules += ' px1';
            else {
                if (props.isPressed) rules += ' pk1';
                else if (props.isFocusVisible) rules += ' pk1';
                else if (props.isHovered) rules += ' pk1';
                else rules += ' pj1';
            }
        } else if (props.fillStyle === "fill") {
            if (props.variant === "genai") rules += ' px1';
            else if (props.variant === "premium") rules += ' px1';
            else if (props.variant === "secondary") {
                if (props.isPressed) rules += ' pk1';
                else if (props.isFocusVisible) rules += ' pk1';
                else if (props.isHovered) rules += ' pk1';
                else rules += ' pj1';
            } else if (props.variant === "primary") rules += ' ph1';
        }
    } else if (props.fillStyle === "outline") {
        if (props.isDisabled) rules += ' pp1';
        else if (props.variant === "genai") rules += ' px1';
        else if (props.variant === "premium") rules += ' px1';
        else {
            if (props.isPressed) rules += ' po1';
            else if (props.isFocusVisible) rules += ' po1';
            else if (props.isHovered) rules += ' po1';
            else rules += ' pt1';
        }
    } else if (props.fillStyle === "fill") {
        if (props.isDisabled) rules += ' pp1';
        else if (props.variant === "genai") rules += ' px1';
        else if (props.variant === "premium") rules += ' px1';
        else if (props.variant === "negative") rules += ' px1';
        else if (props.variant === "accent") rules += ' px1';
        else if (props.variant === "secondary") {
            if (props.isPressed) rules += ' po1';
            else if (props.isFocusVisible) rules += ' po1';
            else if (props.isHovered) rules += ' po1';
            else rules += ' pt1';
        } else if (props.variant === "primary") rules += ' pr1';
    }
    if (props.fillStyle === "outline") {
        if (props.isDisabled) rules += ' plc1';
        else rules += ' plb1';
    } else if (props.fillStyle === "fill") {
        if (props.isDisabled) rules += ' ple1';
        else rules += ' pla1';
    }
    rules += ' sd1';
    rules += ' ea1';
    rules += ' egLWx3bb1';
    rules += ' _oa1';
    rules += ' Sw1';
    rules += ' SgLWx3bd1';
    rules += ' Rw1';
    rules += ' RgLWx3bd1';
    if (props.size === "XL") {
        if (!minWidth) rules += ' Nl1';
    } else if (props.size === "L") {
        if (!minWidth) rules += ' Nj1';
    } else if (props.size === "S") {
        if (!minWidth) rules += ' Nf1';
    } else if (props.size === "XS") {
        if (!minWidth) rules += ' Ne1';
    } else if (!minWidth) rules += ' Nk1';
    rules += ' oh1';
    rules += ' nh1';
    rules += ' kh1';
    rules += ' jh1';
    rules += ' qc1';
    rules += ' qsd1';
    rules += ' -Qg41Lb-IAxCW0c1';
    rules += ' -Qg41Lb-gLWx3bIy1';
    rules += ' MAyFGYc1';
    rules += ' Td1';
    rules += ' Qd1';
    rules += ' -aRvJDd-Tu7Fubd1';
    if (!position) rules += ' _Pc1';
    rules += ' _Ca1';
    rules += ' _Wd1';
    rules += ' _4c1';
    if (!width) rules += ' ZJ1';
    rules += ' _Xa1';
    rules += ' Yd1';
    rules += ' Xb1';
    rules += ' _2b1';
    rules += ' _jf1';
    rules += ' _kJ8iPYd1';
    rules += ' hXMFGYc1';
    if (props.variant === "genai") rules += ' ma1';
    else if (props.variant === "premium") rules += ' ma1';
    else if (props.fillStyle === "outline") rules += ' mc1';
    else if (props.fillStyle === "fill") rules += ' ma1';
    if (props.variant === "genai") rules += ' la1';
    else if (props.variant === "premium") rules += ' la1';
    else if (props.fillStyle === "outline") rules += ' lc1';
    else if (props.fillStyle === "fill") rules += ' la1';
    if (props.isStaticColor) {
        if (props.isDisabled) rules += ' ig1';
        else if (props.variant === "secondary") {
            if (props.isPressed) rules += ' ih1';
            else if (props.isFocusVisible) rules += ' ih1';
            else if (props.isHovered) rules += ' ih1';
            else rules += ' ig1';
        } else if (props.variant === "primary") {
            if (props.isPressed) rules += ' ij1';
            else if (props.isFocusVisible) rules += ' ij1';
            else if (props.isHovered) rules += ' ij1';
            else rules += ' ii1';
        }
    } else if (props.isDisabled) rules += ' iq1';
    else if (props.variant === "secondary") {
        if (props.isPressed) rules += ' io1';
        else if (props.isFocusVisible) rules += ' io1';
        else if (props.isHovered) rules += ' io1';
        else rules += ' iq1';
    } else if (props.variant === "primary") {
        if (props.isPressed) rules += ' in1';
        else if (props.isFocusVisible) rules += ' in1';
        else if (props.isHovered) rules += ' in1';
        else rules += ' iv1';
    }
    if (props.isDisabled) rules += ' ilc1';
    else if (props.isHovered) rules += ' ild1';
    else rules += ' ila1';
    rules += ' gqMFGYc1';
    rules += ' -_8sjo0b-t5ZbAob1';
    rules += ' _yb1';
    rules += ' __ca1';
    if (props.size === "XL") rules += ' -M_-Mk1';
    else if (props.size === "L") rules += ' -M_-Mh1';
    else if (props.size === "S") rules += ' -M_-Mg1';
    else if (props.size === "XS") rules += ' -M_-Mf1';
    else rules += ' -M_-Mi1';
    if (props.variant === "genai") rules += ' -_k_-_ka1';
    else if (props.variant === "premium") rules += ' -_k_-_ka1';
    else if (props.fillStyle === "outline") rules += ' -_k_-_kc1';
    else if (props.fillStyle === "fill") rules += ' -_k_-_ka1';
    if (props.variant === "genai") rules += ' -h_-ha1';
    else if (props.variant === "premium") rules += ' -h_-ha1';
    else if (props.fillStyle === "outline") rules += ' -h_-hc1';
    else if (props.fillStyle === "fill") rules += ' -h_-ha1';
    if (props.isStaticColor) {
        if (props.fillStyle === "outline") {
            if (props.isDisabled) {
                if (props.variant === "genai") rules += ' -g_-gf1';
                else if (props.variant === "premium") rules += ' -g_-gf1';
                else rules += ' -g_-g91';
            } else if (props.isFocusVisible) rules += ' -g_-gf1';
            else if (props.isPressed) rules += ' -g_-gf1';
            else if (props.isHovered) rules += ' -g_-gf1';
            else if (props.variant === "genai") rules += ' -g_-gf1';
            else if (props.variant === "premium") rules += ' -g_-gf1';
            else rules += ' -g_-g91';
        } else if (props.fillStyle === "fill") {
            if (props.isDisabled) rules += ' -g_-gf1';
            else if (props.variant === "genai") rules += ' -g_-gf1';
            else if (props.variant === "premium") rules += ' -g_-gf1';
            else if (props.variant === "secondary") {
                if (props.isPressed) rules += ' -g_-gg1';
                else if (props.isFocusVisible) rules += ' -g_-gg1';
                else if (props.isHovered) rules += ' -g_-gg1';
                else rules += ' -g_-gf1';
            } else if (props.variant === "primary") {
                if (props.isPressed) rules += ' -g_-gj1';
                else if (props.isFocusVisible) rules += ' -g_-gj1';
                else if (props.isHovered) rules += ' -g_-gj1';
                else rules += ' -g_-gi1';
            }
        }
    } else if (props.fillStyle === "outline") {
        if (props.isDisabled) {
            if (props.variant === "genai") rules += ' -g_-gH1';
            else if (props.variant === "premium") rules += ' -g_-gH1';
            else rules += ' -g_-g91';
        } else if (props.isFocusVisible) rules += ' -g_-gH1';
        else if (props.isPressed) rules += ' -g_-gH1';
        else if (props.isHovered) rules += ' -g_-gH1';
        else if (props.variant === "genai") rules += ' -g_-gH1';
        else if (props.variant === "premium") rules += ' -g_-gH1';
        else rules += ' -g_-g91';
    } else if (props.fillStyle === "fill") {
        if (props.isDisabled) rules += ' -g_-gH1';
        else if (props.variant === "genai") rules += ' -g_-gH1';
        else if (props.variant === "premium") rules += ' -g_-gH1';
        else if (props.variant === "negative") {
            if (props.isFocusVisible) rules += ' -g_-gYvV9s1';
            else if (props.isPressed) rules += ' -g_-gYvV9s1';
            else if (props.isHovered) rules += ' -g_-gYvV9s1';
            else rules += ' -g_-g7aei81';
        } else if (props.variant === "accent") {
            if (props.isFocusVisible) rules += ' -g_-gUgARdd1';
            else if (props.isPressed) rules += ' -g_-gUgARdd1';
            else if (props.isHovered) rules += ' -g_-gUgARdd1';
            else rules += ' -g_-g5qAiPc1';
        } else if (props.variant === "secondary") {
            if (props.isPressed) rules += ' -g_-gF1';
            else if (props.isFocusVisible) rules += ' -g_-gF1';
            else if (props.isHovered) rules += ' -g_-gF1';
            else rules += ' -g_-gH1';
        } else if (props.variant === "primary") {
            if (props.isPressed) rules += ' -g_-gu1';
            else if (props.isFocusVisible) rules += ' -g_-gu1';
            else if (props.isHovered) rules += ' -g_-gu1';
            else rules += ' -g_-g01';
        }
    }
    if (props.fillStyle === "outline") rules += ' -g_-lgb1';
    else if (props.fillStyle === "fill") {
        if (props.isDisabled) rules += ' -g_-lgd1';
        else if (props.isHovered) rules += ' -g_-lge1';
        else rules += ' -g_-lgc1';
    }
    return rules;
};
// Put the gradient background on a separate element from the button to work around a Safari
// bug where transitions of custom properties cause layout flickering if any properties use rems. 🤣
// https://bugs.webkit.org/show_bug.cgi?id=285622
const $25d06cf8d4e72761$var$gradient = function anonymous(props) {
    let rules = " ";
    rules += ' _Pa1';
    rules += ' Wr1';
    rules += ' _lr1';
    rules += ' _Ar1';
    rules += ' _zr1';
    rules += ' _9a1';
    rules += ' Yd1';
    rules += ' Xb1';
    rules += ' _2b1';
    rules += ' oi1';
    rules += ' ni1';
    rules += ' ki1';
    rules += ' ji1';
    if (props.isDisabled) rules += ' _ic1';
    else if (props.variant === "genai") {
        if (props.isFocusVisible) {
            rules += ' _ia1';
            rules += ' -yBNtrc-37ZLpd1';
            rules += ' -zBNtrc-plLfSc1';
            rules += ' -ABNtrc-z2bZib1';
            rules += ' -ACNtrc-tQ56Od1';
        } else if (props.isPressed) {
            rules += ' _ia1';
            rules += ' -yBNtrc-37ZLpd1';
            rules += ' -zBNtrc-plLfSc1';
            rules += ' -ABNtrc-z2bZib1';
            rules += ' -ACNtrc-tQ56Od1';
        } else if (props.isHovered) {
            rules += ' _ia1';
            rules += ' -yBNtrc-37ZLpd1';
            rules += ' -zBNtrc-plLfSc1';
            rules += ' -ABNtrc-z2bZib1';
            rules += ' -ACNtrc-tQ56Od1';
        } else {
            rules += ' _ia1';
            rules += ' -yBNtrc-Nitqwc1';
            rules += ' -zBNtrc-ugAmz1';
            rules += ' -ABNtrc-j7ulPc1';
            rules += ' -ACNtrc-tQ56Od1';
        }
    } else if (props.variant === "premium") {
        if (props.isFocusVisible) {
            rules += ' _ib1';
            rules += ' -yBNtrc-1gYRFc1';
            rules += ' -zBNtrc-z2bZib1';
            rules += ' -ABNtrc-BorWLb1';
            rules += ' -ACNtrc-tQ56Od1';
        } else if (props.isPressed) {
            rules += ' _ib1';
            rules += ' -yBNtrc-1gYRFc1';
            rules += ' -zBNtrc-z2bZib1';
            rules += ' -ABNtrc-BorWLb1';
            rules += ' -ACNtrc-tQ56Od1';
        } else if (props.isHovered) {
            rules += ' _ib1';
            rules += ' -yBNtrc-1gYRFc1';
            rules += ' -zBNtrc-z2bZib1';
            rules += ' -ABNtrc-BorWLb1';
            rules += ' -ACNtrc-tQ56Od1';
        } else {
            rules += ' _ib1';
            rules += ' -yBNtrc-X7W3Sb1';
            rules += ' -zBNtrc-j7ulPc1';
            rules += ' -ABNtrc-fHZGqb1';
            rules += ' -ACNtrc-tQ56Od1';
        }
    }
    rules += ' _ilc1';
    if (props.variant === "genai") rules += ' _pb1';
    else if (props.variant === "premium") rules += ' _pb1';
    return rules;
};
function $25d06cf8d4e72761$export$edc9ced5c3e5ff00(isPending) {
    let [isProgressVisible, setIsProgressVisible] = (0, $8owBJ$react.useState)(false);
    (0, $8owBJ$react.useEffect)(()=>{
        let timeout;
        if (isPending) timeout = setTimeout(()=>{
            setIsProgressVisible(true);
        }, 1000);
        else setIsProgressVisible(false);
        return ()=>{
            clearTimeout(timeout);
        };
    }, [
        isPending
    ]);
    return {
        isProgressVisible: isProgressVisible
    };
}
const $25d06cf8d4e72761$export$353f5b6fc5456de1 = /*#__PURE__*/ (0, $8owBJ$react.forwardRef)(function Button(props1, ref) {
    [props1, ref] = (0, $ac757a4c2bd72aee$exports.useSpectrumContextProps)(props1, ref, $25d06cf8d4e72761$export$24d547caef80ccd1);
    props1 = (0, $bfa4962d90c8af48$exports.useFormProps)(props1);
    let stringFormatter = (0, $8owBJ$reactariai18n.useLocalizedStringFormatter)((0, ($parcel$interopDefault($4526404114e78c80$exports))), '@react-spectrum/s2');
    let { isPending: isPending = false, variant: variant = 'primary', fillStyle: fillStyle = 'fill', size: size = 'M', staticColor: staticColor } = props1;
    let domRef = (0, $8owBJ$reactspectrumutils.useFocusableRef)(ref);
    let overlayTriggerState = (0, $8owBJ$react.useContext)((0, $8owBJ$reactariacomponents.OverlayTriggerStateContext));
    let { isProgressVisible: isProgressVisible } = $25d06cf8d4e72761$export$edc9ced5c3e5ff00(isPending);
    return /*#__PURE__*/ (0, $8owBJ$reactjsxruntime.jsx)((0, $8owBJ$reactariacomponents.Button), {
        ...props1,
        ref: domRef,
        style: (0, $2061c83559b50a66$exports.pressScale)(domRef, props1.UNSAFE_style),
        className: (renderProps)=>(props1.UNSAFE_className || '') + $25d06cf8d4e72761$var$button({
                ...renderProps,
                // Retain hover styles when an overlay is open.
                isHovered: renderProps.isHovered || overlayTriggerState?.isOpen || false,
                isDisabled: renderProps.isDisabled || isProgressVisible,
                variant: variant,
                fillStyle: fillStyle,
                size: size,
                staticColor: staticColor,
                isStaticColor: !!staticColor
            }, props1.styles),
        children: (renderProps)=>/*#__PURE__*/ (0, $8owBJ$reactjsxruntime.jsxs)((0, $8owBJ$reactjsxruntime.Fragment), {
                children: [
                    variant === 'genai' || variant === 'premium' ? /*#__PURE__*/ (0, $8owBJ$reactjsxruntime.jsx)("span", {
                        className: $25d06cf8d4e72761$var$gradient({
                            ...renderProps,
                            // Retain hover styles when an overlay is open.
                            isHovered: renderProps.isHovered || overlayTriggerState?.isOpen || false,
                            isDisabled: renderProps.isDisabled || isProgressVisible,
                            variant: variant
                        })
                    }) : null,
                    /*#__PURE__*/ (0, $8owBJ$reactjsxruntime.jsxs)((0, $8owBJ$reactariacomponents.Provider), {
                        values: [
                            [
                                (0, $5eb75e0c130e0669$exports.SkeletonContext),
                                null
                            ],
                            [
                                (0, $6367bc87eb7d24ad$exports.TextContext),
                                {
                                    styles: function anonymous(props) {
                                        let rules = " ";
                                        rules += ' TAzEcG1';
                                        rules += ' QAzEcG1';
                                        rules += ' _Jb1';
                                        if (props.isProgressVisible) rules += ' _6b1';
                                        return rules;
                                    }({
                                        isProgressVisible: isProgressVisible
                                    }),
                                    // @ts-ignore data-attributes allowed on all JSX elements, but adding to DOMProps has been problematic in the past
                                    'data-rsp-slot': 'text'
                                }
                            ],
                            [
                                (0, $bde97c91243ed164$exports.IconContext),
                                {
                                    render: (0, $e991cbcdf82ced71$exports.centerBaseline)({
                                        slot: 'icon',
                                        styles: " _Ja1"
                                    }),
                                    styles: function anonymous(props) {
                                        let rules = " ";
                                        rules += ' ZuUmpre1';
                                        rules += ' FuUmpre1';
                                        rules += ' I67logd1';
                                        rules += ' _va1';
                                        if (props.isProgressVisible) rules += ' _6b1';
                                        return rules;
                                    }({
                                        isProgressVisible: isProgressVisible
                                    })
                                }
                            ]
                        ],
                        children: [
                            typeof props1.children === 'string' ? /*#__PURE__*/ (0, $8owBJ$reactjsxruntime.jsx)((0, $6367bc87eb7d24ad$exports.Text), {
                                children: props1.children
                            }) : props1.children,
                            isPending && /*#__PURE__*/ (0, $8owBJ$reactjsxruntime.jsx)("div", {
                                className: function anonymous(props) {
                                    let rules = " ";
                                    rules += ' _Pa1';
                                    rules += ' WF1';
                                    rules += ' _EF1';
                                    rules += ' _Zc1';
                                    if (props.isProgressVisible) rules += ' _6c1';
                                    else rules += ' _6b1';
                                    return rules;
                                }({
                                    isProgressVisible: isProgressVisible,
                                    isPending: isPending
                                }),
                                children: /*#__PURE__*/ (0, $8owBJ$reactjsxruntime.jsx)((0, $1c116ea4b0d2d023$exports.ProgressCircle), {
                                    isIndeterminate: true,
                                    "aria-label": stringFormatter.format('button.pending'),
                                    size: "S",
                                    staticColor: staticColor,
                                    styles: function anonymous(props) {
                                        let rules = " ";
                                        if (props.size === "XL") rules += ' Zo1';
                                        else if (props.size === "L") rules += ' Zm1';
                                        else if (props.size === "M") rules += ' Zl1';
                                        else if (props.size === "S") rules += ' Zk1';
                                        if (props.size === "XL") rules += ' Fp1';
                                        else if (props.size === "L") rules += ' Fn1';
                                        else if (props.size === "M") rules += ' Fm1';
                                        else if (props.size === "S") rules += ' Fl1';
                                        return rules;
                                    }({
                                        size: size
                                    })
                                })
                            })
                        ]
                    })
                ]
            })
    });
});
const $25d06cf8d4e72761$export$29d11c0fe2fc51d8 = /*#__PURE__*/ (0, $8owBJ$react.forwardRef)(function LinkButton(props, ref) {
    [props, ref] = (0, $ac757a4c2bd72aee$exports.useSpectrumContextProps)(props, ref, $25d06cf8d4e72761$export$1c1a176f3b9e48d3);
    props = (0, $bfa4962d90c8af48$exports.useFormProps)(props);
    let domRef = (0, $8owBJ$reactspectrumutils.useFocusableRef)(ref);
    let overlayTriggerState = (0, $8owBJ$react.useContext)((0, $8owBJ$reactariacomponents.OverlayTriggerStateContext));
    let { fillStyle: fillStyle = 'fill', size: size = 'M', variant: variant = 'primary', staticColor: staticColor, styles: styles, children: children } = props;
    return /*#__PURE__*/ (0, $8owBJ$reactjsxruntime.jsx)((0, $8owBJ$reactariacomponents.Link), {
        ...props,
        ref: domRef,
        style: (0, $2061c83559b50a66$exports.pressScale)(domRef, props.UNSAFE_style),
        className: (renderProps)=>(props.UNSAFE_className || '') + $25d06cf8d4e72761$var$button({
                ...renderProps,
                // Retain hover styles when an overlay is open.
                isHovered: renderProps.isHovered || overlayTriggerState?.isOpen || false,
                variant: variant,
                fillStyle: fillStyle,
                size: size,
                staticColor: staticColor,
                isStaticColor: !!staticColor,
                isPending: false
            }, styles),
        children: (renderProps)=>/*#__PURE__*/ (0, $8owBJ$reactjsxruntime.jsxs)((0, $8owBJ$reactjsxruntime.Fragment), {
                children: [
                    variant === 'genai' || variant === 'premium' ? /*#__PURE__*/ (0, $8owBJ$reactjsxruntime.jsx)("span", {
                        className: $25d06cf8d4e72761$var$gradient({
                            ...renderProps,
                            // Retain hover styles when an overlay is open.
                            isHovered: renderProps.isHovered || overlayTriggerState?.isOpen || false,
                            variant: variant
                        })
                    }) : null,
                    /*#__PURE__*/ (0, $8owBJ$reactjsxruntime.jsx)((0, $8owBJ$reactariacomponents.Provider), {
                        values: [
                            [
                                (0, $5eb75e0c130e0669$exports.SkeletonContext),
                                null
                            ],
                            [
                                (0, $6367bc87eb7d24ad$exports.TextContext),
                                {
                                    styles: " TAzEcG1 QAzEcG1 _Jb1",
                                    // @ts-ignore data-attributes allowed on all JSX elements, but adding to DOMProps has been problematic in the past
                                    'data-rsp-slot': 'text'
                                }
                            ],
                            [
                                (0, $bde97c91243ed164$exports.IconContext),
                                {
                                    render: (0, $e991cbcdf82ced71$exports.centerBaseline)({
                                        slot: 'icon',
                                        styles: " _Ja1"
                                    }),
                                    styles: " ZuUmpre1 FuUmpre1 I67logd1 _va1"
                                }
                            ]
                        ],
                        children: typeof children === 'string' ? /*#__PURE__*/ (0, $8owBJ$reactjsxruntime.jsx)((0, $6367bc87eb7d24ad$exports.Text), {
                            children: children
                        }) : children
                    })
                ]
            })
    });
});


//# sourceMappingURL=Button.cjs.map
