const require_runtime = require("../../_virtual/_rolldown/runtime.js");
const require_useEngineContext = require("../../hooks/useEngineContext.js");
const require_useWindowSize = require("../../hooks/useWindowSize.js");
const require_index = require("./components/Header/index.js");
const require_index$1 = require("./components/Footer/index.js");
const require_index$2 = require("./components/Content/index.js");
const require_locales = require("./locales.js");
let react = require("react");
react = require_runtime.__toESM(react);
let _pisell_utils = require("@pisell/utils");
let _pisell_materials = require("@pisell/materials");
let classnames = require("classnames");
classnames = require_runtime.__toESM(classnames);
require("./index.less");
//#region src/components/stepController/index.tsx
const StepController = ({ steps, currentStep, children, onBack, confirmCloseProps, showFooter, footerContent, onClose }) => {
	var _context$engine;
	const context = require_useEngineContext.default();
	_pisell_utils.locales.init(require_locales.default, (context === null || context === void 0 || (_context$engine = context.engine) === null || _context$engine === void 0 || (_context$engine = _context$engine.props) === null || _context$engine === void 0 ? void 0 : _context$engine.locale) || "en");
	require_useWindowSize.default({ debounceMs: 200 });
	/**
	* @title: 是否是移动端
	* @description:
	* @return {*}
	* @Author: WangHan
	* @Date: 2025-06-12 15:56
	*/
	const isMobile = (0, react.useMemo)(() => {
		const config = (0, _pisell_materials.usePisellConfig)();
		return ((config === null || config === void 0 ? void 0 : config.platform) || "h5") === "h5";
	}, []);
	const currentStepIndex = (0, react.useMemo)(() => {
		return (steps === null || steps === void 0 ? void 0 : steps.findIndex((step) => step.key === currentStep)) || 0;
	}, [steps, currentStep]);
	return /* @__PURE__ */ react.default.createElement("div", { className: (0, classnames.default)("pisell-step-controller", { "pisell-step-controller-mobile": isMobile }) }, /* @__PURE__ */ react.default.createElement(require_index.default, {
		steps,
		currentStepIndex,
		confirmCloseProps,
		onBack,
		onClose
	}), /* @__PURE__ */ react.default.createElement(require_index$2.default, { children }), showFooter && footerContent ? /* @__PURE__ */ react.default.createElement(require_index$1.default, {
		children: footerContent,
		isMobile
	}) : null);
};
//#endregion
exports.default = StepController;
