require("./Link.css");
var $5eb75e0c130e0669$exports = require("../icons/Skeleton.cjs");
var $ac757a4c2bd72aee$exports = require("../icons/useSpectrumContextProps.cjs");
var $7PkpH$reactjsxruntime = require("react/jsx-runtime");
var $7PkpH$reactariacomponents = require("react-aria-components");
var $7PkpH$react = require("react");
var $7PkpH$reactspectrumutils = require("@react-spectrum/utils");
var $7PkpH$reactariautils = require("@react-aria/utils");


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

$parcel$export(module.exports, "LinkContext", () => $064658f378a85eef$export$e2509388b49734e7);
$parcel$export(module.exports, "Link", () => $064658f378a85eef$export$a6c7ac8248d6e38a);
/*
 * 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 $064658f378a85eef$export$e2509388b49734e7 = /*#__PURE__*/ (0, $7PkpH$react.createContext)(null);
const $064658f378a85eef$var$link = function anonymous(props, overrides) {
    let rules = " ";
    rules += (String(overrides || '').match(/(?:^|\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) || []).join('');
    if (props.isFocusVisible) rules += ' _Lf11';
    else rules += ' _Le11';
    if (props.isStaticColor) rules += ' Oe11';
    else rules += ' Oh11';
    rules += ' Olc11';
    rules += ' _Mc11';
    rules += ' _Kd11';
    if (props.staticColor === "white") rules += ' -Ovbhqd-gcwrnr11';
    else if (props.staticColor === "black") rules += ' -Ovbhqd-g4hn3s11';
    rules += ' oa11';
    rules += ' na11';
    rules += ' ka11';
    rules += ' ja11';
    if (props.isStandalone) {
        rules += ' uk11';
        rules += ' ucJ9TBTb11';
        rules += ' ud3Euai11';
        rules += ' uea11';
        rules += ' ugb11';
        rules += ' uhd11';
        rules += ' uje11';
        rules += ' u2NhKxcl11';
        rules += ' uic11';
    }
    if (props.isStandalone) {
        rules += ' -_6BNtrc-c11';
        rules += ' vx11';
    }
    if (props.isStandalone) {
        rules += ' xc11';
        rules += ' _xa11';
    }
    if (props.isStandalone) {
        rules += ' _Fd11';
        rules += ' _FnuYUweb11';
    }
    if (props.isStaticColor) rules += ' pl11';
    else if (props.variant === "secondary") {
        if (props.isPressed) rules += ' po11';
        else if (props.isFocusVisible) rules += ' po11';
        else if (props.isHovered) rules += ' po11';
        else rules += ' pt11';
    } else if (props.variant === "primary") {
        if (props.isPressed) rules += ' ps11';
        else if (props.isFocusVisible) rules += ' ps11';
        else if (props.isHovered) rules += ' ps11';
        else rules += ' pu11';
    }
    rules += ' plf11';
    rules += ' Yd11';
    rules += ' Xb11';
    rules += ' _2b11';
    if (props.isStandalone) {
        if (props.isQuiet) {
            if (props.isFocusVisible) {
                rules += ' _Xb11';
                rules += ' __Va11';
            } else if (props.isHovered) {
                rules += ' _Xb11';
                rules += ' __Va11';
            } else rules += ' _Xa11';
        }
    } else {
        rules += ' _Xb11';
        rules += ' __Va11';
    }
    rules += ' __ca11';
    return rules;
};
const $064658f378a85eef$export$a6c7ac8248d6e38a = /*#__PURE__*/ (0, $7PkpH$react.forwardRef)(function Link(props, ref) {
    [props, ref] = (0, $ac757a4c2bd72aee$exports.useSpectrumContextProps)(props, ref, $064658f378a85eef$export$e2509388b49734e7);
    let { variant: variant = 'primary', staticColor: staticColor, isQuiet: isQuiet, isStandalone: isStandalone, UNSAFE_style: UNSAFE_style, UNSAFE_className: UNSAFE_className = '', styles: styles, children: children } = props;
    let domRef = (0, $7PkpH$reactspectrumutils.useFocusableRef)(ref);
    let isSkeleton = (0, $7PkpH$react.useContext)((0, $5eb75e0c130e0669$exports.SkeletonContext)) || false;
    [children, UNSAFE_style] = (0, $5eb75e0c130e0669$exports.useSkeletonText)(children, UNSAFE_style);
    (0, $7PkpH$reactariautils.useLayoutEffect)(()=>{
        if (domRef.current) // TODO: should RAC Link pass through inert?
        domRef.current.inert = isSkeleton;
    }, [
        domRef,
        isSkeleton
    ]);
    return /*#__PURE__*/ (0, $7PkpH$reactjsxruntime.jsx)((0, $7PkpH$reactariacomponents.Link), {
        ...props,
        ref: domRef,
        style: UNSAFE_style,
        className: (renderProps)=>UNSAFE_className + $064658f378a85eef$var$link({
                ...renderProps,
                variant: variant,
                staticColor: staticColor,
                isStaticColor: !!staticColor,
                isQuiet: isQuiet,
                isStandalone: isStandalone,
                isSkeleton: isSkeleton
            }, styles),
        children: children
    });
});


//# sourceMappingURL=Link.cjs.map
