import PisellContext, { globalConfig } from "./context.js";
import useResponsive from "../../hooks/useResponsive.js";
import { setModal } from "../pisellModal/components/functions/index.js";
import useEngineContext from "../../hooks/useEngineContext.js";
import { setMessage } from "../pisellMessage/index.js";
import React from "react";
import { App } from "antd";
//#region src/components/pisell-config-provider/index.tsx
const platformMap = {
	phone: "h5",
	pc: "pc",
	ipad: "ipad"
};
const PisellConfigProvider = (props) => {
	var _context$appHelper;
	const { children, platform: propsPlatform, symbol: propsSymbol, locale } = props;
	const platform = useResponsive();
	const { getSymbolic } = ((_context$appHelper = useEngineContext().appHelper) === null || _context$appHelper === void 0 ? void 0 : _context$appHelper.utils) || {};
	const config = {
		platform: propsPlatform || platformMap[platform],
		symbol: propsSymbol || (getSymbolic === null || getSymbolic === void 0 ? void 0 : getSymbolic()) || "",
		locale: locale || "en",
		getSymbolic
	};
	const staticFunction = App.useApp();
	setMessage(staticFunction.message);
	setModal(staticFunction.modal);
	globalConfig.setConfig(config);
	return /* @__PURE__ */ React.createElement(PisellContext.Provider, { value: config }, children);
};
//#endregion
export { PisellConfigProvider as default };
