import { getPisellComponentsThemeConfig } from "../../theme/pisell-components.js";
import ReadOnlyView from "./components/ReadOnlyView.js";
import EditView from "./components/EditView.js";
import DisabledView from "./components/DisabledView.js";
import React from "react";
import { getDisplayState } from "@pisell/utils";
import { ConfigProvider } from "antd";
import "./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 = getDisplayState(mode, disabled);
	const render = () => {
		switch (displayState) {
			case "read": return /* @__PURE__ */ React.createElement(ReadOnlyView, props);
			case "edit": return /* @__PURE__ */ React.createElement(EditView, props);
			case "disabled": return /* @__PURE__ */ React.createElement(DisabledView, props);
			default: return null;
		}
	};
	const theme = getPisellComponentsThemeConfig();
	return /* @__PURE__ */ React.createElement(ConfigProvider, { theme }, render());
};
var PisellPhone_default = React.memo(PisellPhone, (prevProps, nextProps) => {
	return prevProps.value === nextProps.value && prevProps.mode === nextProps.mode && prevProps.disabled === nextProps.disabled && prevProps.countryCode === nextProps.countryCode;
});
//#endregion
export { PisellPhone_default as default };
