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("./PisellPhone.less");
//#region src/components/pisellPhone/PisellPhone.tsx
/**
* PisellPhone 电话号码组件
* 
* 电话号码输入/展示组件，支持只读、编辑、禁用三种状态。
* 基于 Ant Design Input 和 Select 组件开发，提供国家码选择、自动格式化、格式校验和拨号功能。
* 
* @param props 组件 Props
* 
* @example
* // 编辑态（中国手机号）
* <PisellPhone 
*   placeholder="请输入手机号"
*   required
* />
* 
* @example
* // 只读态（可拨号）
* <PisellPhone 
*   mode="read"
*   value="13800000000"
*   countryCode="+86"
* />
* 
* @example
* // 国家码选择
* <PisellPhone 
*   showCountrySelector
*   availableCountryCodes={['+86', '+1', '+44']}
* />
*/
const PisellPhone = (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 PisellPhone_default = react.default.memo(PisellPhone, (prevProps, nextProps) => {
	return prevProps.value === nextProps.value && prevProps.mode === nextProps.mode && prevProps.disabled === nextProps.disabled && prevProps.countryCode === nextProps.countryCode;
});
//#endregion
exports.default = PisellPhone_default;
