require("./Badge.css");
var $e991cbcdf82ced71$exports = require("./CenterBaseline.cjs");
var $bde97c91243ed164$exports = require("../icons/Icon.cjs");
var $5eb75e0c130e0669$exports = require("../icons/Skeleton.cjs");
var $6367bc87eb7d24ad$exports = require("./Content.cjs");
var $ac757a4c2bd72aee$exports = require("../icons/useSpectrumContextProps.cjs");
var $26Nq1$reactjsxruntime = require("react/jsx-runtime");
var $26Nq1$reactariacomponents = require("react-aria-components");
var $26Nq1$reactariautils = require("@react-aria/utils");
var $26Nq1$react = require("react");
var $26Nq1$reactspectrumutils = require("@react-spectrum/utils");


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, "BadgeContext", () => $660a621e3a266afc$export$1d4627584e49159a);
$parcel$export(module.exports, "Badge", () => $660a621e3a266afc$export$37acb3580601e69a);
/*
 * 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 $660a621e3a266afc$export$1d4627584e49159a = /*#__PURE__*/ (0, $26Nq1$react.createContext)(null);
const $660a621e3a266afc$var$badge = function anonymous(props, overrides) {
    let rules = " ";
    let minWidth = 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;
        rules += p[0];
    }
    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.fillStyle === "outline") rules += ' pm1';
    else if (props.fillStyle === "subtle") rules += ' pm1';
    else if (props.fillStyle === "bold") {
        if (props.variant === "celery") rules += ' pg1';
        else if (props.variant === "chartreuse") rules += ' pg1';
        else if (props.variant === "yellow") rules += ' pg1';
        else if (props.variant === "orange") rules += ' pg1';
        else if (props.variant === "notice") rules += ' pg1';
        else rules += ' px1';
    }
    rules += ' sd1';
    rules += ' ea1';
    rules += ' egLWx3bb1';
    rules += ' _oa1';
    rules += ' Sv1';
    rules += ' SgLWx3bd1';
    rules += ' Rv1';
    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';
    if (props.size === "XL") rules += ' -SFnbic-_JaP8ec1';
    else if (props.size === "L") rules += ' -SFnbic-_J0K2hn1';
    else if (props.size === "S") rules += ' -SFnbic-_JJOW22b1';
    else if (props.size === "XS") rules += ' -SFnbic-_JICefdd1';
    else rules += ' -SFnbic-_Jb1';
    rules += ' -Bu7z1c-ob1';
    rules += ' oj1';
    rules += ' nj1';
    rules += ' kj1';
    rules += ' jj1';
    rules += ' qc1';
    rules += ' qsd1';
    rules += ' -Qg41Lb-IAxCW0c1';
    rules += ' -Qg41Lb-gLWx3bIy1';
    rules += ' MAyFGYc1';
    rules += ' Td1';
    rules += ' Qd1';
    rules += ' -aRvJDd-Tu7Fubd1';
    rules += ' _Ca1';
    if (props.fillStyle === "outline") rules += ' g_g1';
    else if (props.fillStyle === "subtle") {
        if (props.variant === "silver") rules += ' g_f1';
        else if (props.variant === "cinnamon") rules += ' gP1';
        else if (props.variant === "brown") rules += ' gO1';
        else if (props.variant === "turquoise") rules += ' gy1';
        else if (props.variant === "pink") rules += ' gT1';
        else if (props.variant === "magenta") rules += ' gS1';
        else if (props.variant === "fuchsia") rules += ' gR1';
        else if (props.variant === "purple") rules += ' gM1';
        else if (props.variant === "indigo") rules += ' gK1';
        else if (props.variant === "blue") rules += ' gG1';
        else if (props.variant === "cyan") rules += ' gC1';
        else if (props.variant === "seafoam") rules += ' gz1';
        else if (props.variant === "green") rules += ' gA1';
        else if (props.variant === "celery") rules += ' gv1';
        else if (props.variant === "chartreuse") rules += ' gJ1';
        else if (props.variant === "yellow") rules += ' gW1';
        else if (props.variant === "orange") rules += ' gV1';
        else if (props.variant === "red") rules += ' gU1';
        else if (props.variant === "gray") rules += ' gI1';
        else if (props.variant === "negative") rules += ' gU1';
        else if (props.variant === "notice") rules += ' gV1';
        else if (props.variant === "positive") rules += ' gA1';
        else if (props.variant === "neutral") rules += ' gI1';
        else if (props.variant === "informative") rules += ' gG1';
        else if (props.variant === "accent") rules += ' gG1';
    } else if (props.fillStyle === "bold") {
        if (props.variant === "silver") rules += ' gm1';
        else if (props.variant === "cinnamon") rules += ' gq1';
        else if (props.variant === "brown") rules += ' gn1';
        else if (props.variant === "turquoise") rules += ' g51';
        else if (props.variant === "pink") rules += ' gx1';
        else if (props.variant === "magenta") rules += ' gD1';
        else if (props.variant === "fuchsia") rules += ' gr1';
        else if (props.variant === "purple") rules += ' go1';
        else if (props.variant === "indigo") rules += ' gl1';
        else if (props.variant === "blue") rules += ' g21';
        else if (props.variant === "cyan") rules += ' gk1';
        else if (props.variant === "seafoam") rules += ' g41';
        else if (props.variant === "green") rules += ' g11';
        else if (props.variant === "celery") rules += ' g71';
        else if (props.variant === "chartreuse") rules += ' gp1';
        else if (props.variant === "yellow") rules += ' gN1';
        else if (props.variant === "orange") rules += ' gQ1';
        else if (props.variant === "red") rules += ' gB1';
        else if (props.variant === "gray") rules += ' g61';
        else if (props.variant === "negative") rules += ' gB1';
        else if (props.variant === "notice") rules += ' gQ1';
        else if (props.variant === "positive") rules += ' g11';
        else if (props.variant === "neutral") rules += ' g61';
        else if (props.variant === "informative") rules += ' g21';
        else if (props.variant === "accent") rules += ' g21';
    }
    rules += ' _jf1';
    rules += ' _kJ8iPYd1';
    rules += ' hXMFGYc1';
    rules += ' mc1';
    rules += ' lc1';
    if (props.fillStyle === "outline") {
        if (props.variant === "negative") rules += ' iFLVMS1';
        else if (props.variant === "notice") rules += ' i9VrKkd1';
        else if (props.variant === "positive") rules += ' ip17Jm1';
        else if (props.variant === "neutral") rules += ' i0ruhAb1';
        else if (props.variant === "informative") rules += ' iG1ze4d1';
        else if (props.variant === "accent") rules += ' iG1ze4d1';
    } else rules += ' iA1';
    rules += ' -_8sjo0b-t5ZbAob1';
    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';
    rules += ' -_k_-_kc1';
    rules += ' -h_-hc1';
    return rules;
};
const $660a621e3a266afc$export$37acb3580601e69a = /*#__PURE__*/ (0, $26Nq1$react.forwardRef)(function Badge(props1, ref) {
    [props1, ref] = (0, $ac757a4c2bd72aee$exports.useSpectrumContextProps)(props1, ref, $660a621e3a266afc$export$1d4627584e49159a);
    let { children: children, variant: variant = 'neutral', size: size = 'S', fillStyle: fillStyle = 'bold', overflowMode: overflowMode = 'wrap', ...otherProps } = props1; // useProviderProps(props) in v3
    let domRef = (0, $26Nq1$reactspectrumutils.useDOMRef)(ref);
    let isTextOnly = (0, ($parcel$interopDefault($26Nq1$react))).Children.toArray(props1.children).every((c)=>!/*#__PURE__*/ (0, ($parcel$interopDefault($26Nq1$react))).isValidElement(c));
    return /*#__PURE__*/ (0, $26Nq1$reactjsxruntime.jsx)((0, $26Nq1$reactariacomponents.Provider), {
        values: [
            [
                (0, $6367bc87eb7d24ad$exports.TextContext),
                {
                    styles: function anonymous(props) {
                        let rules = " ";
                        rules += ' TAzEcG1';
                        rules += ' QAzEcG1';
                        rules += ' _Jb1';
                        rules += ' _Nc1';
                        rules += ' Pc1';
                        rules += ' _Yb1';
                        if (props.overflowMode === "wrap") rules += ' _7b1';
                        else if (props.overflowMode === "truncate") rules += ' _7c1';
                        return rules;
                    }({
                        overflowMode: overflowMode
                    })
                }
            ],
            [
                (0, $26Nq1$reactariacomponents.TextContext),
                {}
            ],
            [
                (0, $bde97c91243ed164$exports.IconContext),
                {
                    render: (0, $e991cbcdf82ced71$exports.centerBaseline)({
                        slot: 'icon',
                        styles: " _Ja1"
                    }),
                    styles: " ZuUmpre1 FuUmpre1 I67logd1 _va1"
                }
            ]
        ],
        children: /*#__PURE__*/ (0, $26Nq1$reactjsxruntime.jsx)((0, $5eb75e0c130e0669$exports.SkeletonWrapper), {
            children: /*#__PURE__*/ (0, $26Nq1$reactjsxruntime.jsx)("span", {
                ...(0, $26Nq1$reactariautils.filterDOMProps)(otherProps),
                role: "presentation",
                className: (props1.UNSAFE_className || '') + $660a621e3a266afc$var$badge({
                    variant: variant,
                    size: size,
                    fillStyle: fillStyle
                }, props1.styles),
                style: props1.UNSAFE_style,
                ref: domRef,
                children: typeof children === 'string' || isTextOnly ? /*#__PURE__*/ (0, $26Nq1$reactjsxruntime.jsx)((0, $6367bc87eb7d24ad$exports.Text), {
                    children: children
                }) : children
            })
        })
    });
});


//# sourceMappingURL=Badge.cjs.map
