import { _objectWithoutProperties } from "../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectWithoutProperties.js";
import { StatusEnum } from "../const.js";
import { useContextData } from "../store/index.js";
import { Action, POS } from "./config.js";
import React from "react";
//#region src/components/eftposPay/payo/index.tsx
const _excluded = ["step", "steps"];
var payo_default = ({ api, onChange, children }) => {
	const _useContextData = useContextData(), { step, steps } = _useContextData, data = _objectWithoutProperties(_useContextData, _excluded);
	return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("div", { className: "pisell-lowcode__eft-pay-body " }, steps.map((item, idx) => {
		let Comm;
		if (idx === 0) Comm = POS;
		if (!Comm) throw new Error("no comm");
		if (step >= idx) return /* @__PURE__ */ React.createElement(Comm, {
			key: `${data.key}-${item.key}-${idx}`,
			api,
			onChange
		});
	}), children), data.status !== StatusEnum.Success ? /* @__PURE__ */ React.createElement(Action, { onChange }) : null);
};
//#endregion
export { payo_default as default };
