import "./ContextualHelp.css";
import {ActionButton as $da878a05ab4a403e$export$cfc7921d29ef7b80} from "./ActionButton.mjs";
import {ContentContext as $8e847109a6ab556d$export$1cbdd774077931b4, FooterContext as $8e847109a6ab556d$export$5630640b68817ed6, HeadingContext as $8e847109a6ab556d$export$d688439359537581} from "./Content.mjs";
import {dialogInner as $9bbc115952dac5a6$export$6af31f836f9aa6f2} from "./Dialog.mjs";
import {DialogTrigger as $66262086fa190fcb$export$2e1e1122cf0cba88} from "./DialogTrigger.mjs";
import $410bd93c9b5189d7$export$2e2bcd8739ae039 from "../icons/HelpCircle.mjs";
import $4c8f17dac3ecefd9$export$2e2bcd8739ae039 from "../icons/InfoCircle.mjs";
import $bcd4U$intlStringsmjs from "./intlStrings.mjs";
import {mergeStyles as $feb886035e0d4633$export$e618dc39ac9ad607} from "../icons/runtime.mjs";
import {Popover as $88b746eba92c8d0d$export$5b6b19405a83ff9d} from "./Popover.mjs";
import {useSpectrumContextProps as $5ce63c423902f47d$export$764f6146fadd77f7} from "../icons/useSpectrumContextProps.mjs";
import {jsxs as $bcd4U$jsxs, jsx as $bcd4U$jsx} from "react/jsx-runtime";
import {Dialog as $bcd4U$Dialog, Provider as $bcd4U$Provider, TextContext as $bcd4U$TextContext, DEFAULT_SLOT as $bcd4U$DEFAULT_SLOT} from "react-aria-components";
import {createContext as $bcd4U$createContext, forwardRef as $bcd4U$forwardRef} from "react";
import {useLabels as $bcd4U$useLabels, filterDOMProps as $bcd4U$filterDOMProps, mergeProps as $bcd4U$mergeProps} from "@react-aria/utils";
import {useLocalizedStringFormatter as $bcd4U$useLocalizedStringFormatter} from "@react-aria/i18n";


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















const $8e176595bc49ca3f$var$wrappingDiv = " NOBje7c1 ZOBje7c1 Th1 Qh1 Sh1 Rh1 _oa1 Fb1";
const $8e176595bc49ca3f$export$41b9afaaba473494 = /*#__PURE__*/ (0, $bcd4U$createContext)(null);
const $8e176595bc49ca3f$export$7d3cdb256c2ba320 = /*#__PURE__*/ (0, $bcd4U$forwardRef)(function ContextualHelp(props, ref) {
    let stringFormatter = (0, $bcd4U$useLocalizedStringFormatter)((0, ($parcel$interopDefault($bcd4U$intlStringsmjs))), '@react-spectrum/s2');
    [props, ref] = (0, $5ce63c423902f47d$export$764f6146fadd77f7)(props, ref, $8e176595bc49ca3f$export$41b9afaaba473494);
    let { children: children, defaultOpen: defaultOpen, containerPadding: containerPadding = 8, size: size = 'XS', crossOffset: crossOffset, isOpen: isOpen, onOpenChange: onOpenChange, placement: placement = 'bottom start', shouldFlip: shouldFlip, UNSAFE_className: UNSAFE_className, UNSAFE_style: UNSAFE_style, styles: styles, variant: variant = 'help' } = props;
    // In a FieldLabel we're getting the context's aria-labeledby, so we need to
    // manually set the aria-label after useLabels() to keep the order of label
    // then ContextualHelp variant
    let labelProps = (0, $bcd4U$useLabels)(props);
    let label = stringFormatter.format(`contextualhelp.${variant}`);
    labelProps['aria-label'] = labelProps['aria-label'] ? labelProps['aria-label'] + ' ' + label : label;
    let buttonProps = (0, $bcd4U$filterDOMProps)(props, {
        labelable: true
    });
    return /*#__PURE__*/ (0, $bcd4U$jsxs)((0, $66262086fa190fcb$export$2e1e1122cf0cba88), {
        isOpen: isOpen,
        defaultOpen: defaultOpen,
        onOpenChange: onOpenChange,
        children: [
            /*#__PURE__*/ (0, $bcd4U$jsx)((0, $da878a05ab4a403e$export$cfc7921d29ef7b80), {
                slot: null,
                ref: ref,
                size: size,
                ...(0, $bcd4U$mergeProps)(buttonProps, labelProps),
                UNSAFE_style: UNSAFE_style,
                UNSAFE_className: UNSAFE_className,
                styles: styles,
                isQuiet: true,
                children: variant === 'info' ? /*#__PURE__*/ (0, $bcd4U$jsx)((0, $4c8f17dac3ecefd9$export$2e2bcd8739ae039), {}) : /*#__PURE__*/ (0, $bcd4U$jsx)((0, $410bd93c9b5189d7$export$2e2bcd8739ae039), {})
            }),
            /*#__PURE__*/ (0, $bcd4U$jsx)((0, $88b746eba92c8d0d$export$5b6b19405a83ff9d), {
                padding: "none",
                placement: placement,
                shouldFlip: shouldFlip,
                containerPadding: containerPadding,
                offset: 8,
                crossOffset: crossOffset,
                hideArrow: true,
                children: /*#__PURE__*/ (0, $bcd4U$jsx)("div", {
                    className: $8e176595bc49ca3f$var$wrappingDiv,
                    children: /*#__PURE__*/ (0, $bcd4U$jsx)((0, $bcd4U$Dialog), {
                        className: (0, $feb886035e0d4633$export$e618dc39ac9ad607)((0, $9bbc115952dac5a6$export$6af31f836f9aa6f2), " od1 nd1 kd1 jd1 Jnqb3Ob1 Gnqb3Ob1 Inqb3Ob1 Hnqb3Ob1 TjCFGYc1 Qh1 Sh1 Rh1 -T_-Th1"),
                        children: /*#__PURE__*/ (0, $bcd4U$jsx)((0, $bcd4U$Provider), {
                            values: [
                                [
                                    (0, $bcd4U$TextContext),
                                    {
                                        slots: {
                                            [(0, $bcd4U$DEFAULT_SLOT)]: {}
                                        }
                                    }
                                ],
                                [
                                    (0, $8e847109a6ab556d$export$d688439359537581),
                                    {
                                        styles: " uk1 ucJ9TBTb1 ud3Euai1 uea1 ugb1 uhd1 uje1 u2NhKxcl1 uic1 -_6BNtrc-e1 vx1 xe1 _xa1 xX0cczbd1 _xX0cczba1 xfe1 _xfa1 xfX0cczbd1 _xfX0cczba1 _Fd1 _FnuYUweb1 po1 Jy1 Gv1 Iy1 Hy1"
                                    }
                                ],
                                [
                                    (0, $8e847109a6ab556d$export$1cbdd774077931b4),
                                    {
                                        styles: " uk1 ucJ9TBTb1 ud3Euai1 uea1 ugb1 uhd1 uje1 u2NhKxcl1 uic1 -_6BNtrc-c1 vx1 xb1 _xa1 _Fb1 _FnuYUwec1 pt1"
                                    }
                                ],
                                [
                                    (0, $8e847109a6ab556d$export$5630640b68817ed6),
                                    {
                                        styles: " uk1 ucJ9TBTb1 ud3Euai1 uea1 ugb1 uhd1 uje1 u2NhKxcl1 uic1 -_6BNtrc-c1 vx1 xb1 _xa1 _Fb1 _FnuYUwec1 pt1 JC1"
                                    }
                                ]
                            ],
                            children: children
                        })
                    })
                })
            })
        ]
    });
});


export {$8e176595bc49ca3f$export$41b9afaaba473494 as ContextualHelpContext, $8e176595bc49ca3f$export$7d3cdb256c2ba320 as ContextualHelp};
//# sourceMappingURL=ContextualHelp.mjs.map
