import "./TabsPicker.css";
import {centerBaseline as $1f4b04be3f24aae3$export$9d7e2342a7e53afa} from "./CenterBaseline.mjs";
import {checkmark as $13afb0ea5f0ed767$export$292abbf31ed842a, description as $13afb0ea5f0ed767$export$6d59db4903f20f7d, icon as $13afb0ea5f0ed767$export$1ca1ec8b29a4ce27, label as $13afb0ea5f0ed767$export$1237798dc640739a, menuitem as $13afb0ea5f0ed767$export$f68e44d881264486, sectionHeader as $13afb0ea5f0ed767$export$562e61a0817eb32e, sectionHeading as $13afb0ea5f0ed767$export$300ac6f106ef584d} from "./Menu.mjs";
import $81cf3d4588736e7d$export$2e2bcd8739ae039 from "./Checkmark.mjs";
import $4b69f02ec06b9226$export$2e2bcd8739ae039 from "./Chevron.mjs";
import {FieldLabel as $9afd80978c252040$export$1acdcf5a973a8414} from "./Field.mjs";
import {HeaderContext as $8e847109a6ab556d$export$e0e4026c12a8bdbb, HeadingContext as $8e847109a6ab556d$export$d688439359537581, Text as $8e847109a6ab556d$export$5f1af8db9871e1d6, TextContext as $8e847109a6ab556d$export$9afb8bc826b033ea} from "./Content.mjs";
import {IconContext as $ac8c32e6775ddd1f$export$a49f528ae1a4d0ed} from "../icons/Icon.mjs";
import {Popover as $88b746eba92c8d0d$export$5b6b19405a83ff9d} from "./Popover.mjs";
import {pressScale as $10ea7662e51a285b$export$56e8cba416805d8d} from "./pressScale.mjs";
import {useFormProps as $9b916426527cebe7$export$a6b5be5c6b451665} from "./Form.mjs";
import {useSpectrumContextProps as $5ce63c423902f47d$export$764f6146fadd77f7} from "../icons/useSpectrumContextProps.mjs";
import {jsxs as $vecDw$jsxs, jsx as $vecDw$jsx, Fragment as $vecDw$Fragment} from "react/jsx-runtime";
import {Select as $vecDw$Select, Button as $vecDw$Button, SelectValue as $vecDw$SelectValue, Provider as $vecDw$Provider, DEFAULT_SLOT as $vecDw$DEFAULT_SLOT, ListBox as $vecDw$ListBox, ListBoxItem as $vecDw$ListBoxItem} from "react-aria-components";
import {useLocale as $vecDw$useLocale} from "react-aria";
import {createContext as $vecDw$createContext, forwardRef as $vecDw$forwardRef, useRef as $vecDw$useRef, useContext as $vecDw$useContext} from "react";
import {useFocusableRef as $vecDw$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 $0067ea932a992b6a$export$b72b8dade9393cd5 = /*#__PURE__*/ (0, $vecDw$createContext)(null);
const $0067ea932a992b6a$var$inputButton = function anonymous(props) {
    let rules = " ";
    if (props.isFocusVisible) rules += ' _Lf1';
    else rules += ' _Le1';
    rules += ' Oh1';
    rules += ' Olc1';
    rules += ' _Mc1';
    rules += ' _Kd1';
    rules += ' zXcEWr1';
    rules += ' yXcEWr1';
    rules += ' BXcEWr1';
    rules += ' AXcEWr1';
    if (props.size === "XL") rules += ' Nl1';
    else if (props.size === "L") rules += ' Nj1';
    else if (props.size === "S") rules += ' Nf1';
    else if (props.size === "XS") rules += ' Ne1';
    else rules += ' Nk1';
    if (props.isQuiet) rules += ' _qd1';
    else rules += ' _qtb1';
    if (props.size === "XL") rules += ' -Anxdcc-Zt1';
    else if (props.size === "L") rules += ' -Anxdcc-ZStdtne1';
    else if (props.size === "S") rules += ' -Anxdcc-Zr1';
    else rules += ' -Anxdcc-Z3fn9H1';
    rules += ' __v6TNLWb1';
    rules += ' _Pc1';
    rules += ' uk1';
    rules += ' ucJ9TBTb1';
    rules += ' ud3Euai1';
    rules += ' uea1';
    rules += ' ugb1';
    rules += ' uhd1';
    rules += ' uje1';
    rules += ' u2NhKxcl1';
    rules += ' uic1';
    rules += ' -_6BNtrc-c1';
    rules += ' vx1';
    rules += ' xb1';
    rules += ' _xa1';
    rules += ' _Fd1';
    rules += ' _FnuYUweb1';
    if (props.isDisabled) rules += ' pp1';
    else {
        if (props.isPressed) rules += ' po1';
        else if (props.isFocusVisible) rules += ' po1';
        else if (props.isHovered) rules += ' po1';
        else rules += ' pt1';
    }
    rules += ' sd1';
    rules += ' _Wd1';
    rules += ' _je1';
    rules += ' oa1';
    rules += ' na1';
    rules += ' ka1';
    rules += ' ja1';
    rules += ' eb1';
    rules += ' Yd1';
    rules += ' Xb1';
    rules += ' _2b1';
    rules += ' qc1';
    rules += ' qsd1';
    rules += ' SMBFGYc1';
    rules += ' RfBFGYc1';
    rules += ' g91';
    if (props.isQuiet) rules += ' Ln1';
    rules += ' __ca1';
    if (props.density === "compact") rules += ' Fx1';
    else rules += ' Fz1';
    rules += ' _oa1';
    rules += ' -S_-Sd1';
    rules += ' -R_-Rd1';
    return rules;
};
let $0067ea932a992b6a$export$b1e5508a851be14d = function anonymous(props) {
    let rules = " ";
    rules += ' _Le1';
    rules += ' se1';
    rules += ' Deb5jcb1';
    rules += ' _oa1';
    rules += ' Za1';
    rules += ' K40ub4c1';
    rules += ' _Na1';
    rules += ' Pa1';
    rules += ' Tt1';
    rules += ' Qt1';
    rules += ' St1';
    rules += ' Rt1';
    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';
    }
    return rules;
};
const $0067ea932a992b6a$var$valueStyles = " _ua1 _Nc1 Pc1 _Yb1 _7c1 sd1 eb1 Fb1";
const $0067ea932a992b6a$var$iconStyles = " _va1 _Sd1 -_8sjo0b-t5ZbAob1";
const $0067ea932a992b6a$var$iconCenterWrapper = function anonymous(props) {
    let rules = " ";
    rules += ' sd1';
    rules += ' z2U5Crc1';
    rules += ' y2U5Crc1';
    rules += ' B2U5Crc1';
    rules += ' A2U5Crc1';
    if (props.labelBehavior === "hide") rules += ' SssxDec1';
    return rules;
};
let $0067ea932a992b6a$var$InsideSelectValueContext = /*#__PURE__*/ (0, $vecDw$createContext)(false);
function $0067ea932a992b6a$var$Picker(props1, ref) {
    [props1, ref] = (0, $5ce63c423902f47d$export$764f6146fadd77f7)(props1, ref, $0067ea932a992b6a$export$b72b8dade9393cd5);
    let domRef = (0, $vecDw$useFocusableRef)(ref);
    props1 = (0, $9b916426527cebe7$export$a6b5be5c6b451665)(props1);
    let { direction: direction = 'bottom', align: align = 'start', shouldFlip: shouldFlip = true, children: children, items: items, density: density, labelBehavior: labelBehavior = 'show', valueId: valueId, ...pickerProps } = props1;
    let isQuiet = true;
    const menuOffset = 6;
    const size = 'M';
    let ariaLabelledby = props1['aria-labelledby'] ?? '';
    let { direction: dir } = (0, $vecDw$useLocale)();
    let RTLFlipOffset = dir === 'rtl' ? -1 : 1;
    return /*#__PURE__*/ (0, $vecDw$jsxs)("div", {
        children: [
            /*#__PURE__*/ (0, $vecDw$jsx)((0, $vecDw$Select), {
                ...pickerProps,
                className: "",
                "aria-labelledby": `${labelBehavior === 'hide' ? valueId : ''} ${ariaLabelledby}`,
                children: ({ isOpen: isOpen })=>/*#__PURE__*/ (0, $vecDw$jsxs)((0, $vecDw$Fragment), {
                        children: [
                            /*#__PURE__*/ (0, $vecDw$jsx)((0, $9afd80978c252040$export$1acdcf5a973a8414), {
                                isQuiet: isQuiet
                            }),
                            /*#__PURE__*/ (0, $vecDw$jsxs)((0, $vecDw$Button), {
                                ref: domRef,
                                style: (renderProps)=>(0, $10ea7662e51a285b$export$56e8cba416805d8d)(domRef)(renderProps),
                                // Prevent press scale from sticking while Picker is open.
                                // @ts-ignore
                                isPressed: false,
                                className: (renderProps)=>$0067ea932a992b6a$var$inputButton({
                                        ...renderProps,
                                        size: 'M',
                                        isOpen: isOpen,
                                        isQuiet: isQuiet,
                                        density: density
                                    }),
                                children: [
                                    /*#__PURE__*/ (0, $vecDw$jsx)((0, $vecDw$SelectValue), {
                                        className: $0067ea932a992b6a$var$valueStyles + ' ' + "WzII9b",
                                        children: ({ defaultChildren: defaultChildren })=>{
                                            return /*#__PURE__*/ (0, $vecDw$jsx)((0, $vecDw$Provider), {
                                                values: [
                                                    [
                                                        (0, $ac8c32e6775ddd1f$export$a49f528ae1a4d0ed),
                                                        {
                                                            slots: {
                                                                icon: {
                                                                    render: (0, $1f4b04be3f24aae3$export$9d7e2342a7e53afa)({
                                                                        slot: 'icon',
                                                                        styles: $0067ea932a992b6a$var$iconCenterWrapper({
                                                                            labelBehavior: labelBehavior
                                                                        })
                                                                    }),
                                                                    styles: (0, $13afb0ea5f0ed767$export$1ca1ec8b29a4ce27)
                                                                }
                                                            }
                                                        }
                                                    ],
                                                    [
                                                        (0, $8e847109a6ab556d$export$9afb8bc826b033ea),
                                                        {
                                                            slots: {
                                                                // Default slot is useful when converting other collections to PickerItems.
                                                                [(0, $vecDw$DEFAULT_SLOT)]: {
                                                                    id: valueId,
                                                                    styles: function anonymous(props) {
                                                                        let rules = " ";
                                                                        if (props.labelBehavior === "hide") rules += ' sk1';
                                                                        else rules += ' sb1';
                                                                        rules += ' _ub1';
                                                                        rules += ' _Nc1';
                                                                        rules += ' Pc1';
                                                                        rules += ' _Yb1';
                                                                        rules += ' _7c1';
                                                                        return rules;
                                                                    }({
                                                                        labelBehavior: labelBehavior
                                                                    })
                                                                }
                                                            }
                                                        }
                                                    ],
                                                    [
                                                        $0067ea932a992b6a$var$InsideSelectValueContext,
                                                        true
                                                    ]
                                                ],
                                                children: defaultChildren
                                            });
                                        }
                                    }),
                                    /*#__PURE__*/ (0, $vecDw$jsx)((0, $4b69f02ec06b9226$export$2e2bcd8739ae039), {
                                        size: size,
                                        className: $0067ea932a992b6a$var$iconStyles
                                    })
                                ]
                            }),
                            /*#__PURE__*/ (0, $vecDw$jsx)((0, $88b746eba92c8d0d$export$5b6b19405a83ff9d), {
                                hideArrow: true,
                                offset: menuOffset,
                                crossOffset: RTLFlipOffset * -12,
                                placement: `${direction} ${align}`,
                                shouldFlip: shouldFlip,
                                styles: " Nh1 ZbWuche1",
                                children: /*#__PURE__*/ (0, $vecDw$jsx)("div", {
                                    className: " sd1 Za1 Fb1",
                                    children: /*#__PURE__*/ (0, $vecDw$jsx)((0, $vecDw$Provider), {
                                        values: [
                                            [
                                                (0, $8e847109a6ab556d$export$e0e4026c12a8bdbb),
                                                {
                                                    styles: (0, $13afb0ea5f0ed767$export$562e61a0817eb32e)({
                                                        size: size
                                                    })
                                                }
                                            ],
                                            [
                                                (0, $8e847109a6ab556d$export$d688439359537581),
                                                {
                                                    // @ts-ignore
                                                    role: 'presentation',
                                                    styles: (0, $13afb0ea5f0ed767$export$300ac6f106ef584d)
                                                }
                                            ],
                                            [
                                                (0, $8e847109a6ab556d$export$9afb8bc826b033ea),
                                                {
                                                    slots: {
                                                        description: {
                                                            styles: (0, $13afb0ea5f0ed767$export$6d59db4903f20f7d)({
                                                                size: size
                                                            })
                                                        }
                                                    }
                                                }
                                            ]
                                        ],
                                        children: /*#__PURE__*/ (0, $vecDw$jsx)((0, $vecDw$ListBox), {
                                            items: items,
                                            className: $0067ea932a992b6a$export$b1e5508a851be14d,
                                            children: children
                                        })
                                    })
                                })
                            })
                        ]
                    })
            }),
            /*#__PURE__*/ (0, $vecDw$jsx)($0067ea932a992b6a$var$TabLine, {
                isDisabled: props1.isDisabled
            })
        ]
    });
}
/**
 * Pickers allow users to choose a single option from a collapsible list of options when space is limited.
 */ let $0067ea932a992b6a$export$ba25329847403e11 = /*#__PURE__*/ (0, $vecDw$forwardRef)($0067ea932a992b6a$var$Picker);
const $0067ea932a992b6a$var$selectedIndicator = function anonymous(props) {
    let rules = " ";
    if (props.isDisabled) rules += ' gH1';
    else rules += ' g01';
    if (props.isDisabled) rules += ' gld1';
    else rules += ' gle1';
    rules += ' FLvNfn1';
    rules += ' _je1';
    rules += ' og1';
    rules += ' ng1';
    rules += ' kg1';
    rules += ' jg1';
    rules += ' Jk7Otrc1';
    rules += ' Xa1';
    rules += ' _2b1';
    return rules;
};
function $0067ea932a992b6a$var$TabLine(props) {
    return /*#__PURE__*/ (0, $vecDw$jsx)("div", {
        className: $0067ea932a992b6a$var$selectedIndicator(props)
    });
}
function $0067ea932a992b6a$export$d601881f38163e28(props) {
    let ref = (0, $vecDw$useRef)(null);
    let isLink = props.href != null;
    const size = 'M';
    return /*#__PURE__*/ (0, $vecDw$jsx)((0, $vecDw$ListBoxItem), {
        ...props,
        ref: ref,
        textValue: props.textValue || (typeof props.children === 'string' ? props.children : undefined),
        style: (0, $10ea7662e51a285b$export$56e8cba416805d8d)(ref, props.UNSAFE_style),
        className: (renderProps)=>(props.UNSAFE_className || '') + (0, $13afb0ea5f0ed767$export$f68e44d881264486)({
                ...renderProps,
                size: size,
                isLink: isLink
            }, props.styles),
        children: (renderProps)=>{
            let { children: children } = props;
            return /*#__PURE__*/ (0, $vecDw$jsx)($0067ea932a992b6a$var$DefaultProvider, {
                context: (0, $ac8c32e6775ddd1f$export$a49f528ae1a4d0ed),
                value: {
                    slots: {
                        icon: {
                            render: (0, $1f4b04be3f24aae3$export$9d7e2342a7e53afa)({
                                slot: 'icon',
                                styles: $0067ea932a992b6a$var$iconCenterWrapper({})
                            }),
                            styles: (0, $13afb0ea5f0ed767$export$1ca1ec8b29a4ce27)
                        }
                    }
                },
                children: /*#__PURE__*/ (0, $vecDw$jsxs)($0067ea932a992b6a$var$DefaultProvider, {
                    context: (0, $8e847109a6ab556d$export$9afb8bc826b033ea),
                    value: {
                        slots: {
                            [(0, $vecDw$DEFAULT_SLOT)]: {
                                styles: (0, $13afb0ea5f0ed767$export$1237798dc640739a)({
                                    size: size
                                })
                            }
                        }
                    },
                    children: [
                        !isLink && /*#__PURE__*/ (0, $vecDw$jsx)((0, $81cf3d4588736e7d$export$2e2bcd8739ae039), {
                            size: size,
                            className: (0, $13afb0ea5f0ed767$export$292abbf31ed842a)({
                                ...renderProps,
                                size: size
                            })
                        }),
                        typeof children === 'string' ? /*#__PURE__*/ (0, $vecDw$jsx)((0, $8e847109a6ab556d$export$5f1af8db9871e1d6), {
                            children: children
                        }) : children
                    ]
                })
            });
        }
    });
}
// A Context.Provider that only sets a value if not inside SelectValue.
function $0067ea932a992b6a$var$DefaultProvider({ context: context, value: value, children: children }) {
    let inSelectValue = (0, $vecDw$useContext)($0067ea932a992b6a$var$InsideSelectValueContext);
    if (inSelectValue) return children;
    return /*#__PURE__*/ (0, $vecDw$jsx)(context.Provider, {
        value: value,
        children: children
    });
}


export {$0067ea932a992b6a$export$b72b8dade9393cd5 as PickerContext, $0067ea932a992b6a$export$b1e5508a851be14d as menu, $0067ea932a992b6a$export$ba25329847403e11 as Picker, $0067ea932a992b6a$export$d601881f38163e28 as PickerItem};
//# sourceMappingURL=TabsPicker.mjs.map
