require("./CustomDialog.css");
var $8e678305a8c10028$exports = require("./Modal.cjs");
var $f8dpT$reactjsxruntime = require("react/jsx-runtime");
var $f8dpT$reactariacomponents = require("react-aria-components");
var $f8dpT$react = require("react");
var $f8dpT$reactspectrumutils = require("@react-spectrum/utils");


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

$parcel$export(module.exports, "CustomDialog", () => $a05aa0b0345f1846$export$82e1fa7406db6ec);
/*
 * 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 $a05aa0b0345f1846$var$dialogStyle = function anonymous(props, overrides) {
    let rules = " ";
    let position = false;
    let width = false;
    let height = false;
    let maxWidth = false;
    let maxHeight = false;
    let matches = String(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|F|M|K)[^\s]+/g);
    for (let p of matches){
        if (p[1] === "_P") position = true;
        if (p[1] === "Z") width = true;
        if (p[1] === "F") height = true;
        if (p[1] === "L") maxWidth = true;
        if (p[1] === "K") maxHeight = true;
        rules += p[0];
    }
    if (props.padding === "none") rules += ' Td12';
    else if (props.padding === "default") {
        rules += ' Th12';
        rules += ' Tnk12';
    }
    if (props.padding === "none") rules += ' Qd12';
    else if (props.padding === "default") {
        rules += ' Qh12';
        rules += ' Qnk12';
    }
    if (props.padding === "none") rules += ' Sd12';
    else if (props.padding === "default") {
        rules += ' Sh12';
        rules += ' Snk12';
    }
    if (props.padding === "none") rules += ' Rd12';
    else if (props.padding === "default") {
        rules += ' Rh12';
        rules += ' Rnk12';
    }
    rules += ' _oa12';
    rules += ' _Le12';
    rules += ' oi12';
    rules += ' ni12';
    rules += ' ki12';
    rules += ' ji12';
    rules += ' _Na12';
    rules += ' Pa12';
    if (!position) rules += ' _Pc12';
    if (!width) rules += ' Za12';
    if (!height) rules += ' Fb12';
    if (!maxWidth) rules += ' L40ub4c12';
    if (!maxHeight) rules += ' K40ub4c12';
    return rules;
};
const $a05aa0b0345f1846$export$82e1fa7406db6ec = /*#__PURE__*/ (0, $f8dpT$react.forwardRef)(function CustomDialog(props, ref) {
    let { size: size, isDismissible: isDismissible, isKeyboardDismissDisabled: isKeyboardDismissDisabled, padding: padding = 'default' } = props;
    let domRef = (0, $f8dpT$reactspectrumutils.useDOMRef)(ref);
    return /*#__PURE__*/ (0, $f8dpT$reactjsxruntime.jsx)((0, $8e678305a8c10028$exports.Modal), {
        size: size,
        isDismissable: isDismissible,
        isKeyboardDismissDisabled: isKeyboardDismissDisabled,
        children: /*#__PURE__*/ (0, $f8dpT$reactjsxruntime.jsx)((0, $f8dpT$reactariacomponents.Dialog), {
            ...props,
            ref: domRef,
            style: props.UNSAFE_style,
            className: (props.UNSAFE_className || '') + $a05aa0b0345f1846$var$dialogStyle({
                padding: padding
            }, props.styles),
            children: (0, $f8dpT$reactariacomponents.composeRenderProps)(props.children, (children)=>// Reset OverlayTriggerStateContext so the buttons inside the dialog don't retain their hover state.
                /*#__PURE__*/ (0, $f8dpT$reactjsxruntime.jsx)((0, $f8dpT$reactariacomponents.OverlayTriggerStateContext).Provider, {
                    value: null,
                    children: children
                }))
        })
    });
});


//# sourceMappingURL=CustomDialog.cjs.map
