import "./Modal.css";
import {ColorSchemeContext as $9affbfa4e13b9582$export$374e0245597d19a3} from "./Provider.mjs";
import {jsx as $fdAcL$jsx} from "react/jsx-runtime";
import {forwardRef as $fdAcL$forwardRef, useContext as $fdAcL$useContext, useCallback as $fdAcL$useCallback} from "react";
import {useLocale as $fdAcL$useLocale, ModalOverlay as $fdAcL$ModalOverlay, Modal as $fdAcL$Modal} from "react-aria-components";
import {useDOMRef as $fdAcL$useDOMRef} 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 $c46d159bd615e407$var$modalOverlayStyles = function anonymous(props) {
    let rules = " ";
    if (props.colorScheme === "dark") rules += ' _pa11';
    else if (props.colorScheme === "light") rules += ' _pb11';
    else if (props.colorScheme === "light dark") rules += ' _pc11';
    else rules += ' _pN79Hzc11';
    rules += ' _Pa11';
    rules += ' Wr11';
    rules += ' _Er11';
    rules += ' Za11';
    rules += ' FKem6Ob11';
    rules += ' _Bb11';
    rules += ' g811';
    if (props.isExiting) rules += ' _Ia11';
    else if (props.isEntering) rules += ' _Ia11';
    rules += ' Yf11';
    if (props.isExiting) rules += ' Xa11';
    else rules += ' Xd11';
    rules += ' _2b11';
    return rules;
};
const $c46d159bd615e407$var$modalWrapper = function anonymous(props) {
    let rules = " ";
    rules += ' _Pe11';
    rules += ' Wr11';
    rules += ' _Er11';
    rules += ' Za11';
    rules += ' FE9bXU11';
    rules += ' sd11';
    if (props.size === "fullscreenTakeover") rules += ' ed11';
    else rules += ' eb11';
    rules += ' _Ca11';
    return rules;
};
const $c46d159bd615e407$export$2b77a92f1a5ad772 = /*#__PURE__*/ (0, $fdAcL$forwardRef)(function Modal(props1, ref) {
    let domRef = (0, $fdAcL$useDOMRef)(ref);
    let colorScheme = (0, $fdAcL$useContext)((0, $9affbfa4e13b9582$export$374e0245597d19a3));
    let { locale: locale, direction: direction } = (0, $fdAcL$useLocale)();
    // TODO: should we pass through lang and dir props in RAC?
    let modalRef = (0, $fdAcL$useCallback)((el)=>{
        domRef.current = el;
        if (el) {
            el.lang = locale;
            el.dir = direction;
        }
    }, [
        locale,
        direction,
        domRef
    ]);
    return /*#__PURE__*/ (0, $fdAcL$jsx)((0, $fdAcL$ModalOverlay), {
        ...props1,
        className: (renderProps)=>$c46d159bd615e407$var$modalOverlayStyles({
                ...renderProps,
                colorScheme: colorScheme
            }),
        children: /*#__PURE__*/ (0, $fdAcL$jsx)("div", {
            className: $c46d159bd615e407$var$modalWrapper({
                size: props1.size
            }),
            style: {
                containerType: 'size'
            },
            children: /*#__PURE__*/ (0, $fdAcL$jsx)((0, $fdAcL$Modal), {
                ...props1,
                ref: modalRef,
                className: (renderProps)=>(function anonymous(props) {
                        let rules = " ";
                        rules += ' sd11';
                        rules += ' _ta11';
                        if (props.size === "fullscreenTakeover") rules += ' od11';
                        else rules += ' oe11';
                        if (props.size === "fullscreenTakeover") rules += ' nd11';
                        else rules += ' ne11';
                        if (props.size === "fullscreenTakeover") rules += ' kd11';
                        else rules += ' ke11';
                        if (props.size === "fullscreenTakeover") rules += ' jd11';
                        else rules += ' je11';
                        if (props.size === "fullscreenTakeover") rules += ' Za11';
                        else if (props.size === "fullscreen") rules += ' ZGqsG7b11';
                        else if (props.size === "XL") rules += ' ZbRWaYd11';
                        else if (props.size === "L") rules += ' Zb4QY411';
                        else if (props.size === "M") rules += ' ZILqIYb11';
                        else if (props.size === "S") rules += ' ZA11';
                        if (props.size === "fullscreenTakeover") rules += ' Fb11';
                        else if (props.size === "fullscreen") rules += ' FGqsG7b11';
                        if (props.size === "fullscreenTakeover") rules += ' Lp11';
                        else if (props.size === "fullscreen") rules += ' Lp11';
                        else rules += ' Lc11';
                        if (props.size === "fullscreenTakeover") rules += ' Ki11';
                        else if (props.size === "fullscreen") rules += ' Ki11';
                        else rules += ' KjVOfn11';
                        if (props.size === "fullscreenTakeover") rules += ' QILlin11';
                        rules += ' -Ovbhqd-g_g11';
                        rules += ' gEzkoQe11';
                        if (props.isExiting) rules += ' _Ia11';
                        else if (props.isEntering) rules += ' _Ia11';
                        if (props.isEntering) {
                            rules += ' -_8PloMd-w11';
                            rules += ' __Ya11';
                        }
                        rules += ' YmenWad11';
                        if (props.isExiting) rules += ' Xa11';
                        else rules += ' Xd11';
                        rules += ' _2b11';
                        if (props.isExiting) rules += ' _1a11';
                        else rules += ' _1b11';
                        rules += ' _Lf11';
                        rules += ' _Mb11';
                        rules += ' Oj11';
                        return rules;
                    })({
                        ...renderProps,
                        size: props1.size
                    })
            })
        })
    });
});


export {$c46d159bd615e407$export$2b77a92f1a5ad772 as Modal};
//# sourceMappingURL=Modal.mjs.map
