'use strict';

var tslib_es6 = require('./tslib.es6-2c2ed574.js');
var React = require('react');
var core = require('@mantine/core');
require('./index-1e5e2223.js');
require('@mantine/dates');
require('./index-6ce6e395.js');
require('./index-da3b86cd.js');
require('./index-b0ce6f8f.js');
require('./index-024542ed.js');
var index$2 = require('./index-a31ed3e1.js');
var index$3 = require('./index-3d563586.js');
require('./index-59a9827e.js');
require('./index.styles-691de58f.js');
var index = require('./index-3643ff1b.js');
require('@mantine/hooks');
require('./utils-b92a8b1c.js');
require('./index-eba09ec0.js');
var context = require('./context-f7fe7a26.js');
var index$1 = require('./index-8df498d5.js');

function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }

var React__default = /*#__PURE__*/_interopDefault(React);

var useStyles = core.createStyles((theme, { hasOnClickFn }) => {
    return {
        root: {
            position: 'relative',
            display: 'flex',
            flexDirection: 'column',
            gap: core.rem(16),
        },
        sponsorBox: {
            display: 'flex',
            gap: core.rem(12),
            alignItems: 'center',
            backgroundColor: theme.colors.neutral[0],
            border: `1px solid ${theme.colors.neutral[1]}`,
            borderRadius: core.rem(4),
            padding: '4px 12px',
            alignSelf: 'flex-start',
        },
        sponsorLogo: {
            maxHeight: core.rem(32),
        },
        btn: {
            minWidth: core.rem(180),
            [theme.fn.largerThan('sm')]: {
                alignSelf: 'flex-end',
            },
            visibility: hasOnClickFn ? 'visible' : 'hidden',
        },
    };
});

const BabyPoopForm = (_a) => {
    var { babyPoopPage, onClickFindOut, currentUrl, sponsorLogo, btnProps, styles, classNames } = _a, props = tslib_es6.__rest(_a, ["babyPoopPage", "onClickFindOut", "currentUrl", "sponsorLogo", "btnProps", "styles", "classNames"]);
    const { t } = index.useTranslations();
    const { classes } = useStyles({ hasOnClickFn: Boolean(onClickFindOut) }, { name: 'BabyPoopForm', styles, classNames });
    const { classes: wrapperClasses = {} } = React.useContext(context.CardWrapperContext);
    return (React__default["default"].createElement(index$1.HealthToolFormWrapper.FormRow, null,
        React__default["default"].createElement(core.Box, Object.assign({ className: classes.root }, props),
            sponsorLogo && (React__default["default"].createElement(core.Box, { className: classes.sponsorBox },
                React__default["default"].createElement(index$2.Text, { size: "p4" }, t('common.sponsoredBy')),
                React__default["default"].createElement("img", { loading: "lazy", src: sponsorLogo, alt: "sponsor", className: classes.sponsorLogo }))),
            React__default["default"].createElement(index$2.Text, { size: "p3", as: "div", className: "description", dangerouslySetInnerHTML: {
                    __html: babyPoopPage.description,
                } }),
            React__default["default"].createElement(index$3.Button, Object.assign({ className: core.clsx(classes.btn, wrapperClasses.submitBtn), onClick: onClickFindOut, dataEventCategory: "Health Tool", dataEventAction: "Baby Stool Inquiry", dataEventLabel: currentUrl }, btnProps), t('babyPoop.findOut')))));
};

exports.BabyPoopForm = BabyPoopForm;
