const require_runtime = require("../../_virtual/_rolldown/runtime.js");
const require_pisell_components = require("../../theme/pisell-components.js");
const require_ReadOnlyView = require("./components/ReadOnlyView.js");
const require_EditView = require("./components/EditView.js");
const require_DisabledView = require("./components/DisabledView.js");
let react = require("react");
react = require_runtime.__toESM(react);
let _pisell_utils = require("@pisell/utils");
let antd = require("antd");
require("./PisellEmail.less");
//#region src/components/pisellEmail/PisellEmail.tsx
/**
* PisellEmail 邮箱地址组件
* 
* 邮箱地址输入/展示组件，支持只读、编辑、禁用三种状态。
* 基于 Ant Design AutoComplete 和 Input 组件开发，提供邮箱格式校验、域名智能补全、
* mailto 邮件发送和域名隐藏功能。
* 
* @param props 组件 Props
* 
* @example
* // 编辑态（邮箱输入）
* <PisellEmail 
*   placeholder="请输入邮箱地址"
*   required
* />
* 
* @example
* // 只读态（可发邮件）
* <PisellEmail 
*   mode="read"
*   value="user@example.com"
*   enableMailto
* />
* 
* @example
* // 域名补全
* <PisellEmail 
*   enableAutoComplete
*   autoCompleteDomains={['gmail.com', 'company.com']}
* />
*/
const PisellEmail = (props) => {
	const { mode = "edit", disabled = false } = props;
	const displayState = (0, _pisell_utils.getDisplayState)(mode, disabled);
	const render = () => {
		switch (displayState) {
			case "read": return /* @__PURE__ */ react.default.createElement(require_ReadOnlyView.default, props);
			case "edit": return /* @__PURE__ */ react.default.createElement(require_EditView.default, props);
			case "disabled": return /* @__PURE__ */ react.default.createElement(require_DisabledView.default, props);
			default: return null;
		}
	};
	const theme = require_pisell_components.getPisellComponentsThemeConfig();
	return /* @__PURE__ */ react.default.createElement(antd.ConfigProvider, { theme }, render());
};
var PisellEmail_default = react.default.memo(PisellEmail, (prevProps, nextProps) => {
	return prevProps.value === nextProps.value && prevProps.mode === nextProps.mode && prevProps.disabled === nextProps.disabled && prevProps.enableAutoComplete === nextProps.enableAutoComplete;
});
//#endregion
exports.default = PisellEmail_default;
