const require_runtime = require("../../../../../_virtual/_rolldown/runtime.js");
const require_objectSpread2 = require("../../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js");
let react = require("react");
react = require_runtime.__toESM(react);
let antd = require("antd");
let _pisell_utils = require("@pisell/utils");
//#region src/components/authentication/admin/AuthMethods/components/PasswordRulesSettingsContent.tsx
const PasswordRulesSettingsContent = ({ onSettingsChange, initialSettings }) => {
	const [settings, setSettings] = (0, react.useState)(initialSettings !== null && initialSettings !== void 0 ? initialSettings : {
		minLength: 8,
		requireUppercase: false,
		requireLowercase: false,
		requireNumbers: false,
		requireSpecialChars: false
	});
	const updateSettings = (updates) => {
		const newSettings = require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, settings), updates);
		setSettings(newSettings);
		onSettingsChange === null || onSettingsChange === void 0 || onSettingsChange(newSettings);
	};
	return /* @__PURE__ */ react.default.createElement("div", { className: "settings-section" }, /* @__PURE__ */ react.default.createElement("div", { className: "settings-section-title" }, _pisell_utils.locales.getText("auth.password.requirements.title")), /* @__PURE__ */ react.default.createElement("div", { className: "settings-section-description" }, _pisell_utils.locales.getText("auth.password.requirements.description")), /* @__PURE__ */ react.default.createElement("div", {
		className: "settings-item",
		style: {
			display: "flex",
			alignItems: "flex-start",
			gap: 32
		}
	}, /* @__PURE__ */ react.default.createElement("div", {
		className: "settings-item-content",
		style: { flex: "0 0 240px" }
	}, /* @__PURE__ */ react.default.createElement("div", { className: "settings-item-title" }, _pisell_utils.locales.getText("auth.password.min.length")), /* @__PURE__ */ react.default.createElement("div", { className: "settings-item-description" }, _pisell_utils.locales.getText("auth.password.min.length.description"))), /* @__PURE__ */ react.default.createElement("div", { style: { flex: 1 } }, /* @__PURE__ */ react.default.createElement(antd.InputNumber, {
		min: 6,
		max: 20,
		value: settings.minLength,
		onChange: (value) => updateSettings({ minLength: value || 8 }),
		style: {
			width: "100%",
			maxWidth: 400
		}
	}))), /* @__PURE__ */ react.default.createElement("div", {
		className: "settings-item",
		style: {
			display: "flex",
			alignItems: "flex-start",
			gap: 32
		}
	}, /* @__PURE__ */ react.default.createElement("div", {
		className: "settings-item-content",
		style: { flex: "0 0 240px" }
	}, /* @__PURE__ */ react.default.createElement("div", { className: "settings-item-title" }, _pisell_utils.locales.getText("auth.password.requirements")), /* @__PURE__ */ react.default.createElement("div", { className: "settings-item-description" }, _pisell_utils.locales.getText("auth.password.requirements.character"))), /* @__PURE__ */ react.default.createElement("div", { style: {
		flex: 1,
		display: "flex",
		flexDirection: "column",
		gap: 16
	} }, /* @__PURE__ */ react.default.createElement(antd.Checkbox, {
		checked: settings.requireUppercase,
		onChange: (e) => updateSettings({ requireUppercase: e.target.checked })
	}, /* @__PURE__ */ react.default.createElement("div", null, /* @__PURE__ */ react.default.createElement("div", { style: {
		fontWeight: 500,
		fontSize: "14px",
		color: "#262626"
	} }, _pisell_utils.locales.getText("auth.password.require.uppercase")), /* @__PURE__ */ react.default.createElement("div", { style: {
		fontSize: "13px",
		color: "#8c8c8c"
	} }, _pisell_utils.locales.getText("auth.password.require.uppercase.description")))), /* @__PURE__ */ react.default.createElement(antd.Checkbox, {
		checked: settings.requireLowercase,
		onChange: (e) => updateSettings({ requireLowercase: e.target.checked })
	}, /* @__PURE__ */ react.default.createElement("div", null, /* @__PURE__ */ react.default.createElement("div", { style: {
		fontWeight: 500,
		fontSize: "14px",
		color: "#262626"
	} }, _pisell_utils.locales.getText("auth.password.require.lowercase")), /* @__PURE__ */ react.default.createElement("div", { style: {
		fontSize: "13px",
		color: "#8c8c8c"
	} }, _pisell_utils.locales.getText("auth.password.require.lowercase.description")))), /* @__PURE__ */ react.default.createElement(antd.Checkbox, {
		checked: settings.requireNumbers,
		onChange: (e) => updateSettings({ requireNumbers: e.target.checked })
	}, /* @__PURE__ */ react.default.createElement("div", null, /* @__PURE__ */ react.default.createElement("div", { style: {
		fontWeight: 500,
		fontSize: "14px",
		color: "#262626"
	} }, _pisell_utils.locales.getText("auth.password.require.numbers")), /* @__PURE__ */ react.default.createElement("div", { style: {
		fontSize: "13px",
		color: "#8c8c8c"
	} }, _pisell_utils.locales.getText("auth.password.require.numbers.description")))), /* @__PURE__ */ react.default.createElement(antd.Checkbox, {
		checked: settings.requireSpecialChars,
		onChange: (e) => updateSettings({ requireSpecialChars: e.target.checked })
	}, /* @__PURE__ */ react.default.createElement("div", null, /* @__PURE__ */ react.default.createElement("div", { style: {
		fontWeight: 500,
		fontSize: "14px",
		color: "#262626"
	} }, _pisell_utils.locales.getText("auth.password.require.special")), /* @__PURE__ */ react.default.createElement("div", { style: {
		fontSize: "13px",
		color: "#8c8c8c"
	} }, _pisell_utils.locales.getText("auth.password.require.special.description")))))));
};
//#endregion
exports.default = PasswordRulesSettingsContent;
