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/components/pay/toC/PaymentMethods/MWCreditCard/components/TDSErrorModal/index.tsx
var TDSErrorModal_exports = {};
__export(TDSErrorModal_exports, {
  default: () => TDSErrorModal_default
});
module.exports = __toCommonJS(TDSErrorModal_exports);
var import_react = __toESM(require("react"));
var import_antd = require("antd");
var import_materials = require("@pisell/materials");
var import_utils = require("@pisell/utils");
var import_index = require("./index.less");
var TEXT_KEY_MAP = {
  /** 预检查：卡不支持 3DS 验证 */
  "tds-not-supported": {
    title: "tocPay.text.tdsErrorTitle",
    desc: "tocPay.text.tdsErrorDesc"
  },
  /** 支付中：银行安全验证失败（700500） */
  "bank-verify-failed": {
    title: "tocPay.text.bankVerifyFailedTitle",
    desc: "tocPay.text.bankVerifyFailedDesc"
  }
};
var TDSErrorModal = ({
  open,
  type = "tds-not-supported",
  shopPhone,
  shopEmail,
  onUseAnotherCard,
  onUseAnotherPayment,
  onPayLater
}) => {
  const showContact = !!(shopPhone || shopEmail);
  const textKeys = (0, import_react.useMemo)(() => TEXT_KEY_MAP[type], [type]);
  return /* @__PURE__ */ import_react.default.createElement(
    import_materials.PisellModal,
    {
      open,
      closable: false,
      footer: null,
      header: false,
      mobileModalHeight: "auto",
      headerDivider: false,
      footerDivider: false,
      bodyStyle: { padding: 24 },
      transitionName: "pisell-move-down"
    },
    /* @__PURE__ */ import_react.default.createElement("div", { className: "tds-error-modal" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "tds-error-modal-title" }, import_utils.locales.getText(textKeys.title)), /* @__PURE__ */ import_react.default.createElement("div", { className: "tds-error-modal-desc" }, import_utils.locales.getText(textKeys.desc)), /* @__PURE__ */ import_react.default.createElement("div", { className: "tds-error-modal-actions" }, /* @__PURE__ */ import_react.default.createElement(
      import_antd.Button,
      {
        type: "primary",
        block: true,
        className: "tds-error-modal-btn-primary",
        onClick: onUseAnotherCard
      },
      import_utils.locales.getText("tocPay.text.useAnotherCard")
    ), /* @__PURE__ */ import_react.default.createElement(
      import_antd.Button,
      {
        block: true,
        className: "tds-error-modal-btn-secondary",
        onClick: onUseAnotherPayment
      },
      import_utils.locales.getText("tocPay.text.useAnotherPayment")
    ), /* @__PURE__ */ import_react.default.createElement(
      import_antd.Button,
      {
        block: true,
        className: "tds-error-modal-btn-secondary",
        onClick: onPayLater
      },
      import_utils.locales.getText("tocPay.text.payLater")
    )), showContact && /* @__PURE__ */ import_react.default.createElement("div", { className: "tds-error-modal-contact" }, import_utils.locales.getText("tocPay.text.paymentTroubleContact")(
      shopPhone || "",
      shopEmail || ""
    )))
  );
};
var TDSErrorModal_default = TDSErrorModal;
