var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
  // If the importer is in node compatibility mode or this is not an ESM
  // file that has been converted to a CommonJS file using a Babel-
  // compatible transform (i.e. "__esModule" has not been set), then set
  // "default" to the CommonJS "module.exports" for node compatibility.
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
  mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);

// src/plus/skuOptionsSelection/store/actions.ts
var actions_exports = {};
__export(actions_exports, {
  default: () => actions_default
});
module.exports = __toCommonJS(actions_exports);
var import_store = __toESM(require("./store"));
var actions = {
  /** 更新数据源 */
  updateDataSource: (dataSource) => {
    import_store.default.setState({ dataSource });
  },
  /** 更新原始值 */
  updateValue: (value) => {
    import_store.default.setState({ value });
  },
  /** 更新配置 */
  updateConfig: (config) => {
    import_store.default.setState({ config });
  },
  /** 更新符号 */
  updateSymbol: (symbol) => {
    import_store.default.setState({ symbol });
  },
  /** 更新Selector数据源 */
  updateSelectorDataSource: (selectorDataSource) => {
    import_store.default.setState({ selectorDataSource });
  },
  /** 更新Selector识别的值 */
  updateSelectorValue: (selectorValue) => {
    import_store.default.setState({ selectorValue });
  },
  /** 更新 SKU Card 配置 */
  updateSkuCardConfig: (skuCardConfig) => {
    import_store.default.setState((prev) => {
      var _a, _b, _c, _d;
      return {
        skuCardConfig: {
          ...prev.skuCardConfig || {},
          ...skuCardConfig || {},
          title: {
            ...((_a = prev.skuCardConfig) == null ? void 0 : _a.title) || {},
            ...(skuCardConfig == null ? void 0 : skuCardConfig.title) || {}
          },
          subTitle: {
            ...((_b = prev.skuCardConfig) == null ? void 0 : _b.subTitle) || {},
            ...(skuCardConfig == null ? void 0 : skuCardConfig.subTitle) || {}
          },
          price: {
            ...((_c = prev.skuCardConfig) == null ? void 0 : _c.price) || {},
            ...(skuCardConfig == null ? void 0 : skuCardConfig.price) || {}
          },
          image: {
            ...((_d = prev.skuCardConfig) == null ? void 0 : _d.image) || {},
            ...(skuCardConfig == null ? void 0 : skuCardConfig.image) || {}
          }
        }
      };
    });
  },
  /** 更新自定义配置 */
  updateCustomConfig: (customConfig) => {
    import_store.default.setState({ customConfig });
  },
  /** 清空整个store的值 */
  clearStore: () => {
    import_store.default.setState(import_store.initialState);
  }
};
var actions_default = actions;
