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 { ClientEnum, ModeEnum, PayRouteEnum, StatusEnum } from "../const.js";
import { locales } from "@pisell/utils";
//#region src/components/eftposPay/adyenScan/const.ts
const _excluded = [
	"order_id",
	"name",
	"symbol",
	"amount",
	"mode",
	"number",
	"pay",
	"device",
	"net",
	"client"
];
/**
* 初始步骤配置
* AdyenScan 仅一个 loading 步骤，支付结果由扫码回调驱动
*/
const getStep = (mode = ModeEnum.Pay) => [{
	key: Date.now(),
	title: locales.getText("page.eftpos-pay.text.loading")(mode),
	text: locales.getText("page.eftpos-pay.text.waiting.processing"),
	warn: "",
	tip: locales.getText("page.eftpos-pay.text.processing"),
	status: StatusEnum.Loading
}];
/**
* Adyen 扫码支付初始 State 工厂（商家被扫模式）
*/
const getAdyenScanInitState = (params, eftposType) => {
	const _ref = params || { mode: ModeEnum.Pay }, { order_id, name, symbol, amount, mode, number, pay, device, net, client } = _ref, other = _objectWithoutProperties(_ref, _excluded);
	const isPay = mode === ModeEnum.Pay || mode === ModeEnum.FullPay;
	return _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({
		order_id,
		name,
		symbol,
		amount,
		mode,
		eftpos: eftposType,
		key: Date.now(),
		step: 0,
		type: PayRouteEnum.Step,
		title: isPay ? "" : locales.getText("page.eftpos-pay.text.loading")(mode),
		component: "",
		status: StatusEnum.Loading,
		steps: getStep(mode),
		render: true,
		client: client !== "undefined" && client !== void 0 ? client : ClientEnum.Merchant,
		warn: "",
		custom: other || {}
	}, typeof net !== "undefined" ? { net } : {}), typeof number !== "undefined" ? { number } : {}), typeof pay !== "undefined" ? { pay } : {}), typeof device !== "undefined" ? { device } : {});
};
//#endregion
export { getAdyenScanInitState as default };
