var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
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 __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);

// src/components/pay/toC/PaymentMethods/CashManual/index.tsx
var CashManual_exports = {};
__export(CashManual_exports, {
  default: () => CashManual_default
});
module.exports = __toCommonJS(CashManual_exports);
var import_react = require("react");
var import_serve = require("./serve");
var import_model = require("../../model");
var import_payGroup = require("../../payGroup");
var import_index = require("./index.less");
var CashManual = (props, ref) => {
  const { state } = (0, import_react.useContext)(import_model.Context);
  const init = async ({ payGroup }) => {
    var _a, _b;
    let current = ((_a = state.payGroup) == null ? void 0 : _a.otherPayment) || {};
    const orderId = (payGroup == null ? void 0 : payGroup.order_id) || ((_b = state.payGroup) == null ? void 0 : _b.order_id);
    const values = (0, import_payGroup.getPayGroupParamsFromStorage)(orderId);
    try {
      await (0, import_serve.customPaymentApi)(orderId, {
        params: current.params,
        ...values
      });
      state.payCallback({
        key: "success"
      });
    } catch (err) {
    }
  };
  (0, import_react.useImperativeHandle)(
    ref,
    () => ({
      init
    })
  );
  return null;
};
var CashManual_default = (0, import_react.forwardRef)(CashManual);
