import { _objectSpread2 } from "../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js";
import store, { initialState } from "./store.js";
//#region src/plus/skuOptionsSelection/store/actions.ts
const actions = {
	updateDataSource: (dataSource) => {
		store.setState({ dataSource });
	},
	updateValue: (value) => {
		store.setState({ value });
	},
	updateConfig: (config) => {
		store.setState({ config });
	},
	updateSymbol: (symbol) => {
		store.setState({ symbol });
	},
	updateSelectorDataSource: (selectorDataSource) => {
		store.setState({ selectorDataSource });
	},
	updateSelectorValue: (selectorValue) => {
		store.setState({ selectorValue });
	},
	updateSkuCardConfig: (skuCardConfig) => {
		store.setState((prev) => {
			var _prev$skuCardConfig, _prev$skuCardConfig2, _prev$skuCardConfig3, _prev$skuCardConfig4;
			return { skuCardConfig: _objectSpread2(_objectSpread2(_objectSpread2({}, prev.skuCardConfig || {}), skuCardConfig || {}), {}, {
				title: _objectSpread2(_objectSpread2({}, ((_prev$skuCardConfig = prev.skuCardConfig) === null || _prev$skuCardConfig === void 0 ? void 0 : _prev$skuCardConfig.title) || {}), (skuCardConfig === null || skuCardConfig === void 0 ? void 0 : skuCardConfig.title) || {}),
				subTitle: _objectSpread2(_objectSpread2({}, ((_prev$skuCardConfig2 = prev.skuCardConfig) === null || _prev$skuCardConfig2 === void 0 ? void 0 : _prev$skuCardConfig2.subTitle) || {}), (skuCardConfig === null || skuCardConfig === void 0 ? void 0 : skuCardConfig.subTitle) || {}),
				price: _objectSpread2(_objectSpread2({}, ((_prev$skuCardConfig3 = prev.skuCardConfig) === null || _prev$skuCardConfig3 === void 0 ? void 0 : _prev$skuCardConfig3.price) || {}), (skuCardConfig === null || skuCardConfig === void 0 ? void 0 : skuCardConfig.price) || {}),
				image: _objectSpread2(_objectSpread2({}, ((_prev$skuCardConfig4 = prev.skuCardConfig) === null || _prev$skuCardConfig4 === void 0 ? void 0 : _prev$skuCardConfig4.image) || {}), (skuCardConfig === null || skuCardConfig === void 0 ? void 0 : skuCardConfig.image) || {})
			}) };
		});
	},
	updateCustomConfig: (customConfig) => {
		store.setState({ customConfig });
	},
	clearStore: () => {
		store.setState(initialState);
	}
};
//#endregion
export { actions as default };
