import * as __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__ from "react/jsx-runtime";
import "react";
import * as __WEBPACK_EXTERNAL_MODULE__tachybase_schema__ from "@tachybase/schema";
import * as __WEBPACK_EXTERNAL_MODULE_antd__ from "antd";
import * as __WEBPACK_EXTERNAL_MODULE__PasswordStrength_mjs__ from "./PasswordStrength.mjs";
const Password = (0, __WEBPACK_EXTERNAL_MODULE__tachybase_schema__.connect)((props)=>{
    const { value, className, checkStrength, ...others } = props;
    const blockStyle = {
        position: 'absolute',
        zIndex: 1,
        height: 8,
        top: 0,
        background: '#fff',
        width: 1,
        transform: 'translate(-50%, 0)'
    };
    return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsxs)("span", {
        className: className,
        children: [
            /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE_antd__.Input.Password, {
                ...others,
                value: value
            }),
            checkStrength && /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__PasswordStrength_mjs__.PasswordStrength, {
                value: value,
                children: (score)=>/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsxs)("div", {
                        style: {
                            background: '#e0e0e0',
                            marginBottom: 3,
                            position: 'relative'
                        },
                        children: [
                            /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)("div", {
                                style: {
                                    ...blockStyle,
                                    left: '20%'
                                }
                            }),
                            /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)("div", {
                                style: {
                                    ...blockStyle,
                                    left: '40%'
                                }
                            }),
                            /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)("div", {
                                style: {
                                    ...blockStyle,
                                    left: '60%'
                                }
                            }),
                            /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)("div", {
                                style: {
                                    ...blockStyle,
                                    left: '80%'
                                }
                            }),
                            /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)("div", {
                                style: {
                                    position: 'relative',
                                    backgroundImage: '-webkit-linear-gradient(left, #ff5500, #ff9300)',
                                    transition: 'all 0.35s ease-in-out',
                                    height: 8,
                                    width: '100%',
                                    marginTop: 5,
                                    clipPath: "polygon(0 0,".concat(score, "% 0,").concat(score, "% 100%,0 100%)")
                                }
                            })
                        ]
                    })
            })
        ]
    });
}, (0, __WEBPACK_EXTERNAL_MODULE__tachybase_schema__.mapReadPretty)((props)=>{
    if (!props.value) return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)("div", {});
    return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)("div", {
        children: "********"
    });
}));
const Password_rslib_entry_ = Password;
export { Password, Password_rslib_entry_ as default };
