import { _objectSpread2 } from "../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js";
import { _objectWithoutProperties } from "../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectWithoutProperties.js";
import useEngineContext from "../../../../hooks/useEngineContext.js";
import CashKeyboardSimple from "./CashKeyboardSimple.js";
import CashKeyboardIntact from "./CashKeyboardIntact.js";
import locales_default from "./locales.js";
import React from "react";
import { locales } from "@pisell/utils";
import { useControllableValue } from "ahooks";
//#region src/pro/priceKeyboard/components/cashKeyboard/index.tsx
const _excluded = [
	"variant",
	"value",
	"onChange",
	"shortcutsSize"
];
const CashKeyboard = (props) => {
	var _context$appHelper$ut, _context$appHelper$ut2, _context$appHelper$ut3, _context$appHelper$ut4;
	const context = useEngineContext();
	locales.init(locales_default, ((_context$appHelper$ut = context.appHelper.utils) === null || _context$appHelper$ut === void 0 || (_context$appHelper$ut2 = _context$appHelper$ut.getApp) === null || _context$appHelper$ut2 === void 0 || (_context$appHelper$ut2 = _context$appHelper$ut2.call(_context$appHelper$ut)) === null || _context$appHelper$ut2 === void 0 || (_context$appHelper$ut2 = _context$appHelper$ut2.locales) === null || _context$appHelper$ut2 === void 0 || (_context$appHelper$ut3 = _context$appHelper$ut2.getLocale) === null || _context$appHelper$ut3 === void 0 ? void 0 : _context$appHelper$ut3.call(_context$appHelper$ut2)) || ((_context$appHelper$ut4 = context.appHelper.utils) === null || _context$appHelper$ut4 === void 0 || (_context$appHelper$ut4 = _context$appHelper$ut4.storage) === null || _context$appHelper$ut4 === void 0 ? void 0 : _context$appHelper$ut4.get("umi_locale")) || "en");
	const { getData } = context.appHelper.utils;
	const amountSymbol = props.amountSymbol || (getData === null || getData === void 0 ? void 0 : getData("shop_symbol")) || "$";
	const { variant = "intact", value, onChange, shortcutsSize } = props, otherProps = _objectWithoutProperties(props, _excluded);
	const [internalValue, setInternalValue] = useControllableValue(props);
	if (variant === "intact") return /* @__PURE__ */ React.createElement(CashKeyboardIntact, _objectSpread2(_objectSpread2({}, otherProps), {}, {
		amountSymbol,
		value: internalValue,
		placeholder: `${amountSymbol}0`,
		onChange: setInternalValue,
		shortcutsSize
	}));
	return /* @__PURE__ */ React.createElement(CashKeyboardSimple, _objectSpread2(_objectSpread2({}, otherProps), {}, {
		amountSymbol,
		placeholder: `${amountSymbol}0`,
		value: internalValue,
		onChange: setInternalValue
	}));
};
//#endregion
export { CashKeyboard as default };
