import { jsx as e, jsxs as o } from "react/jsx-runtime";
import { useRef as P, useState as z, useEffect as U } from "react";
import M from "prop-types";
import { useForm as ne, Controller as C } from "react-hook-form";
import { yupResolver as re } from "@hookform/resolvers/yup";
import f from "@mui/material/Grid2";
import * as N from "yup";
import { Modal as le, Typography as O, IconButton as J, Box as c, FormControl as h, Select as de, MenuItem as Y, Button as S, TableContainer as se, Paper as me, Table as ce, TableHead as ue, TableRow as B, TableCell as y, TableBody as fe, TextField as k, Stack as pe } from "@mui/material";
import A from "@/views/custom-components/CustomTextField";
import { retrieveAllNotifications as ye } from "@/common/services/GlobalApis";
import { showToast as be } from "@/common/toaster/toaster";
import "./ManageEventConfiguration-BJxS2Su0-CRATBMym.js";
import he from "@/hooks/useTrackEvent";
import { useTranslateProvider as ve } from "@/common/languageTranslator/TranslationContext";
import { faXmark as ge, faTrash as De } from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon as _ } from "@fortawesome/react-fontawesome";
const Ne = ({
  open: G,
  handleClose: H,
  handleClick: K,
  type: d
}) => {
  var I;
  const q = P(null), R = P(!1), Q = he(), [D, W] = z([]), [s, V] = z(null), [v, w] = z(
    []
  ), [X, j] = z(0), { translate: a } = ve(), Z = (t) => {
    v && v.forEach((i, n) => {
      u(`notificationCode${n}`, ""), u(`numberOfDaysAddedForOnDate${n}`, 0), u(`numberOfDaysAddedForExpiryDate${n}`, 0), u(`numberOfDaysAddedForDueDate${n}`, 0);
    }), w((i) => {
      const n = i.filter((l, r) => r !== t);
      return n.forEach((l, r) => {
        u(`notificationCode${r}`, l.notificationCode), u(
          `numberOfDaysAddedForOnDate${r}`,
          l.numberOfDaysAddedForOnDate
        ), u(
          `numberOfDaysAddedForExpiryDate${r}`,
          l.numberOfDaysAddedForExpiryDate
        ), u(
          `numberOfDaysAddedForDueDate${r}`,
          l.numberOfDaysAddedForDueDate
        );
      }), n;
    });
  }, x = (t, i, n) => {
    const l = [...v];
    l[t][i] = n, w(l);
  }, ee = N.object().shape({
    mobileNotificationType: N.string().required("Select notification type"),
    baseDateFieldName: N.string().required("Enter base date field"),
    familyFieldName: N.string().test(
      "is-required",
      "family name is required",
      function(t) {
        return (s == null ? void 0 : s.notificationFor) === "FAMILY" || (s == null ? void 0 : s.notificationFor) === "MEMBER" ? !!t : !0;
      }
    ),
    memberFieldName: N.string().test(
      "is-required",
      "member name is required",
      function(t) {
        return (s == null ? void 0 : s.notificationFor) === "MEMBER" ? !!t : !0;
      }
    ),
    userFieldName: N.string().test(
      "is-required",
      "user name is required",
      function(t) {
        return (s == null ? void 0 : s.notificationFor) === "USER" ? !!t : !0;
      }
    )
  }), {
    control: b,
    handleSubmit: ie,
    reset: $,
    setValue: u,
    setError: F,
    clearErrors: E,
    getValues: L,
    formState: { errors: m }
  } = ne({
    defaultValues: {},
    resolver: re(ee),
    mode: "onChange"
  });
  U(() => {
    var t;
    d && D.length > 0 && ((t = Object.keys(d)) == null || t.forEach((i) => {
      var n;
      if (i === "index" && u(i, d[i]), i === "mobileNotificationType") {
        const l = D.filter(
          (r) => r.id === parseInt(d[i])
        );
        V(...l);
      }
      i === "mobileNotificationConfigs" && d[i] ? (w(d[i] || []), j((n = d[i]) == null ? void 0 : n.length)) : d[i] && u(i, d[i]);
    }));
  }, [d, D]), U(() => {
    te();
  }, []);
  const T = () => {
    Q("conversion_event", {
      form: q.current,
      form_name: "Add Mobile Type Configuration",
      submit: R.current
    }), H();
  }, te = async () => {
    try {
      const t = await ye(!0);
      W(t == null ? void 0 : t.data);
    } catch {
      be({ message: "Error in retrieving notification", type: "error" });
    }
  }, ae = () => {
    let t = !0;
    v == null || v.forEach((i, n) => {
      if (i.notificationCode === "") {
        t = !1;
        const l = `notificationCode${n}`;
        F(l, {
          type: "manual",
          message: "Enter # of days to add"
        });
      }
    }), t && (j((i) => i + 1), w([
      ...v,
      {
        notificationCode: "",
        numberOfDaysAddedForOnDate: 0,
        numberOfDaysAddedForDueDate: 0,
        numberOfDaysAddedForExpiryDate: 0
      }
    ]));
  }, oe = (t) => {
    t = JSON.parse(JSON.stringify(t));
    for (let i = 0; i < X; i++)
      delete t[`notificationCode${i}`], delete t[`numberOfDaysAddedForOnDate${i}`], delete t[`numberOfDaysAddedForExpiryDate${i}`], delete t[`numberOfDaysAddedForDueDate${i}`];
    t.mobileNotificationConfigs = v, t.type = d == null ? void 0 : d.type, K(t), R.current = !0, T(), $();
  };
  return /* @__PURE__ */ e(
    le,
    {
      "data-testid": "mobiletypeeventconfigmodal-modal",
      open: G,
      className: "flex items-center justify-center",
      onClose: () => {
        T(), $();
      },
      sx: {
        "& .MuiBackdrop-root": {
          backgroundColor: "rgba(0, 0, 0, 0.1)"
        }
      },
      children: /* @__PURE__ */ o(
        f,
        {
          container: !0,
          className: "w-[90%] md:w-[80%]  shadow-md flex flex-col",
          sx: {
            // 1. Theme-aware background
            backgroundColor: (t) => t.palette.background.paper,
            // 2. Dynamic Border/Shadow for Dark Mode
            border: (t) => t.palette.mode === "dark" ? `1px solid ${t.palette.divider}` : "none",
            // 3. GitHub-style shadow (Soft in light, Deep in dark)
            boxShadow: (t) => t.palette.mode === "dark" ? "0 8px 24px rgba(0,0,0,0.4)" : t.shadows[2],
            // Standard MUI shadow for light mode
            borderRadius: "12px",
            // Matches your MuiCard configuration
            transition: "all 0.3s ease-in-out"
            // Keeps children inside the rounded corners
          },
          children: [
            /* @__PURE__ */ o(
              f,
              {
                className: "manageeventconfiguration-modal-header p-2.5 px-5 flex border-b",
                "data-testid": "mobiletypeeventconfigmodal-header",
                children: [
                  /* @__PURE__ */ o(O, { variant: "body1", className: "font-medium text-lg text-customBlue", children: [
                    a("Add"),
                    " ",
                    a(d == null ? void 0 : d.type),
                    " ",
                    a("Configuration")
                  ] }),
                  /* @__PURE__ */ e(
                    J,
                    {
                      size: "small",
                      onClick: () => {
                        T(), $();
                      },
                      "data-testid": "mobiletypeeventconfigmodal-close-button",
                      children: /* @__PURE__ */ e(_, { icon: ge })
                    }
                  )
                ]
              }
            ),
            /* @__PURE__ */ o(
              "form",
              {
                onSubmit: ie(oe),
                className: "w-full",
                "data-testid": "mobiletypeeventconfigmodal-form",
                ref: q,
                children: [
                  /* @__PURE__ */ o(
                    f,
                    {
                      container: !0,
                      className: "px-[40px]  max-h-[60vh] overflow-y-auto  w-full",
                      children: [
                        /* @__PURE__ */ o(
                          f,
                          {
                            container: !0,
                            spacing: 2,
                            className: "w-full flex flex-col md:flex-row  items-start",
                            children: [
                              /* @__PURE__ */ e(
                                f,
                                {
                                  item: !0,
                                  className: "border-b border-gray-300 p-2.5 flex flex-col items-start w-full ",
                                  size: { sm: 12 },
                                  "data-testid": "mobiletypeeventconfigmodal-implicit-params",
                                  children: /* @__PURE__ */ o(c, { className: "whitespace-normal w-full break-words", children: [
                                    /* @__PURE__ */ e("strong", { children: a("Available Implicit Parameters") }),
                                    ":",
                                    " ",
                                    d == null ? void 0 : d.implicitParam
                                  ] })
                                }
                              ),
                              /* @__PURE__ */ e(f, { item: !0, className: "w-[90%] sm:w-1/4", children: /* @__PURE__ */ o(
                                h,
                                {
                                  variant: "outlined",
                                  className: "w-full",
                                  "data-testid": "mobiletypeeventconfigmodal-notification-type",
                                  children: [
                                    /* @__PURE__ */ o("div", { children: [
                                      a("Notification"),
                                      " ",
                                      a("Type")
                                    ] }),
                                    /* @__PURE__ */ o(c, { className: "w-full", children: [
                                      /* @__PURE__ */ e(
                                        C,
                                        {
                                          name: "mobileNotificationType",
                                          control: b,
                                          defaultValue: "",
                                          render: ({ field: t }) => /* @__PURE__ */ o(
                                            de,
                                            {
                                              ...t,
                                              size: "small",
                                              error: !!m.mobileNotificationType,
                                              onChange: (i) => {
                                                t.onChange(i.target.value);
                                                const n = D.filter(
                                                  (l) => l.id === i.target.value
                                                );
                                                V(...n);
                                              },
                                              className: "w-full",
                                              "data-testid": "mobiletypeeventconfigmodal-notification-select",
                                              children: [
                                                /* @__PURE__ */ e(Y, { value: "", children: /* @__PURE__ */ e(O, { variant: "body2", children: a("None") }) }),
                                                D == null ? void 0 : D.map((i, n) => /* @__PURE__ */ e(Y, { value: i.id, children: /* @__PURE__ */ e(O, { variant: "body2", children: i.notificationName }) }, n + 1))
                                              ]
                                            }
                                          )
                                        }
                                      ),
                                      (m == null ? void 0 : m.mobileNotificationType) && /* @__PURE__ */ e(
                                        "p",
                                        {
                                          className: "error-helper",
                                          "data-testid": "mobiletypeeventconfigmodal-notification-error",
                                          children: (I = m == null ? void 0 : m.mobileNotificationType) == null ? void 0 : I.message
                                        }
                                      )
                                    ] })
                                  ]
                                }
                              ) }),
                              /* @__PURE__ */ e(f, { item: !0, sm: 4, size: { sm: 4 }, children: /* @__PURE__ */ o(
                                h,
                                {
                                  variant: "outlined",
                                  className: " w-full",
                                  "data-testid": "mobiletypeeventconfigmodal-base-date-field",
                                  children: [
                                    /* @__PURE__ */ o("div", { children: [
                                      a("Base"),
                                      " ",
                                      a("Date"),
                                      " ",
                                      a("Field"),
                                      " ",
                                      a("Name"),
                                      /* @__PURE__ */ e("span", { style: { color: "red", marginLeft: 4 }, children: "*" })
                                    ] }),
                                    /* @__PURE__ */ e(c, { className: " w-full", children: /* @__PURE__ */ e(
                                      A,
                                      {
                                        control: b,
                                        id: "baseDateFieldName",
                                        name: "baseDateFieldName",
                                        errors: m,
                                        label: "",
                                        size: "small",
                                        dataTestId: "mobiletypeeventconfigmodal-base-date-input"
                                      }
                                    ) })
                                  ]
                                }
                              ) }),
                              /* @__PURE__ */ e(f, { item: !0, sm: 4, size: { sm: 4 }, children: /* @__PURE__ */ o(
                                h,
                                {
                                  variant: "outlined",
                                  className: " w-full",
                                  "data-testid": "mobiletypeeventconfigmodal-ref-code-field",
                                  children: [
                                    /* @__PURE__ */ o("div", { children: [
                                      a("Ref"),
                                      " ",
                                      a("Code"),
                                      " ",
                                      a("Field"),
                                      " ",
                                      a("Name")
                                    ] }),
                                    /* @__PURE__ */ e(c, { className: " w-full", children: /* @__PURE__ */ e(
                                      A,
                                      {
                                        control: b,
                                        id: "refCode",
                                        name: "refCode",
                                        errors: m,
                                        label: "",
                                        size: "small",
                                        dataTestId: "mobiletypeeventconfigmodal-ref-code-input"
                                      }
                                    ) })
                                  ]
                                }
                              ) }),
                              (s == null ? void 0 : s.notificationFor) === "USER" && /* @__PURE__ */ e(f, { item: !0, size: { xs: 4 }, children: /* @__PURE__ */ o(
                                h,
                                {
                                  variant: "outlined",
                                  className: " w-full",
                                  "data-testid": "mobiletypeeventconfigmodal-user-field",
                                  children: [
                                    /* @__PURE__ */ o("div", { children: [
                                      a("User"),
                                      " ",
                                      a("Field"),
                                      " ",
                                      a("Name"),
                                      /* @__PURE__ */ e("span", { style: { color: "red", marginLeft: 4 }, children: "*" })
                                    ] }),
                                    /* @__PURE__ */ e(c, { className: " w-full", children: /* @__PURE__ */ e(
                                      A,
                                      {
                                        control: b,
                                        id: "userFieldName",
                                        name: "userFieldName",
                                        errors: m,
                                        label: "",
                                        size: "small",
                                        dataTestId: "mobiletypeeventconfigmodal-user-input"
                                      }
                                    ) })
                                  ]
                                }
                              ) }),
                              (s == null ? void 0 : s.notificationFor) === "MEMBER" && /* @__PURE__ */ e(f, { item: !0, size: { sm: 4 }, children: /* @__PURE__ */ o(
                                h,
                                {
                                  variant: "outlined",
                                  className: " w-full",
                                  "data-testid": "mobiletypeeventconfigmodal-member-field",
                                  children: [
                                    /* @__PURE__ */ o("div", { children: [
                                      a("Member"),
                                      " ",
                                      a("Field"),
                                      " ",
                                      a("Name"),
                                      /* @__PURE__ */ e("span", { style: { color: "red", marginLeft: 4 }, children: "*" })
                                    ] }),
                                    /* @__PURE__ */ e(c, { className: " w-full", children: /* @__PURE__ */ e(
                                      A,
                                      {
                                        control: b,
                                        id: "memberFieldName",
                                        name: "memberFieldName",
                                        errors: m,
                                        label: "",
                                        size: "small",
                                        dataTestId: "mobiletypeeventconfigmodal-member-input"
                                      }
                                    ) })
                                  ]
                                }
                              ) }),
                              ((s == null ? void 0 : s.notificationFor) === "FAMILY" || (s == null ? void 0 : s.notificationFor) === "MEMBER") && /* @__PURE__ */ e(f, { item: !0, sm: 4, size: { sm: 4 }, children: /* @__PURE__ */ o(
                                h,
                                {
                                  variant: "outlined",
                                  className: " w-full",
                                  "data-testid": "mobiletypeeventconfigmodal-family-field",
                                  children: [
                                    /* @__PURE__ */ o("div", { children: [
                                      a("Family"),
                                      " ",
                                      a("Field"),
                                      " ",
                                      a("Name"),
                                      /* @__PURE__ */ e("span", { style: { color: "red", marginLeft: 4 }, children: "*" })
                                    ] }),
                                    /* @__PURE__ */ e(c, { className: " w-full", children: /* @__PURE__ */ e(
                                      A,
                                      {
                                        control: b,
                                        id: "familyFieldName",
                                        name: "familyFieldName",
                                        errors: m,
                                        label: "",
                                        size: "small",
                                        dataTestId: "mobiletypeeventconfigmodal-family-input"
                                      }
                                    ) })
                                  ]
                                }
                              ) })
                            ]
                          }
                        ),
                        /* @__PURE__ */ o(f, { container: !0, className: "mt-2.5 w-full", children: [
                          /* @__PURE__ */ e(f, { item: !0, size: { xs: 12 }, children: /* @__PURE__ */ o(
                            S,
                            {
                              variant: "contained",
                              onClick: ae,
                              "data-testid": "mobiletypeeventconfigmodal-add-configuration",
                              children: [
                                a("Add"),
                                " ",
                                a("Configuration")
                              ]
                            }
                          ) }),
                          /* @__PURE__ */ e(f, { size: { xs: 12 }, children: /* @__PURE__ */ e(
                            se,
                            {
                              component: me,
                              className: "m-2.5 w-full mobile-type-event-config-table-container",
                              "data-testid": "mobiletypeeventconfigmodal-table",
                              children: /* @__PURE__ */ o(
                                ce,
                                {
                                  size: "small",
                                  className: "mobile-type-event-config-table",
                                  "aria-label": "mobile notification configuration table",
                                  children: [
                                    /* @__PURE__ */ e(ue, { children: /* @__PURE__ */ o(B, { children: [
                                      /* @__PURE__ */ e(y, { children: a("Code") }),
                                      /* @__PURE__ */ o(y, { children: [
                                        a("Added"),
                                        " ",
                                        a("Days"),
                                        " ",
                                        a("For"),
                                        " ",
                                        a("Schedule")
                                      ] }),
                                      /* @__PURE__ */ o(y, { children: [
                                        a("Added"),
                                        " ",
                                        a("Days"),
                                        " ",
                                        a("For"),
                                        " ",
                                        a("Due")
                                      ] }),
                                      /* @__PURE__ */ o(y, { children: [
                                        a("Added"),
                                        " ",
                                        a("Days"),
                                        " ",
                                        a("For"),
                                        " ",
                                        a("Expiry")
                                      ] }),
                                      /* @__PURE__ */ e(y, { children: a("Actions") })
                                    ] }) }),
                                    /* @__PURE__ */ e(fe, { children: v.length > 0 ? v.map((t, i) => {
                                      var n, l;
                                      return /* @__PURE__ */ o(B, { children: [
                                        /* @__PURE__ */ e(y, { children: /* @__PURE__ */ e(c, { children: /* @__PURE__ */ e(
                                          h,
                                          {
                                            variant: "outlined",
                                            className: " w-full",
                                            children: /* @__PURE__ */ o(c, { className: " w-full", children: [
                                              /* @__PURE__ */ e(
                                                C,
                                                {
                                                  control: b,
                                                  name: `notificationCode${i}`,
                                                  defaultValue: t.notificationCode,
                                                  render: ({ field: r }) => /* @__PURE__ */ e(
                                                    k,
                                                    {
                                                      required: !0,
                                                      variant: "outlined",
                                                      size: "small",
                                                      ...r,
                                                      error: !!m[`notificationCode${i}`],
                                                      onChange: (p) => {
                                                        u(
                                                          `notificationCode${i}`,
                                                          p.target.value
                                                        ), x(
                                                          i,
                                                          "notificationCode",
                                                          p.target.value
                                                        );
                                                        const g = `notificationCode${i}`;
                                                        L(g) === "" ? F(g, {
                                                          type: "manual",
                                                          message: "Enter # of days to add"
                                                        }) : E(g);
                                                      },
                                                      placeholder: "Enter # of days to add",
                                                      onBlur: () => {
                                                        r.value === "" ? F(
                                                          `notificationCode${i}`,
                                                          {
                                                            type: "manual",
                                                            message: "Enter # of days to add"
                                                          }
                                                        ) : E(
                                                          `notificationCode${i}`
                                                        );
                                                      },
                                                      "data-testid": `mobiletypeeventconfigmodal-notification-code-input-${i}`
                                                    }
                                                  )
                                                }
                                              ),
                                              m[`notificationCode${i}`] && /* @__PURE__ */ e(
                                                "p",
                                                {
                                                  className: "error-helper-table",
                                                  "data-testid": `mobiletypeeventconfigmodal-notification-code-error-${i}`,
                                                  children: (n = m[`notificationCode${i}`]) == null ? void 0 : n.message
                                                }
                                              )
                                            ] })
                                          }
                                        ) }) }),
                                        /* @__PURE__ */ e(y, { children: /* @__PURE__ */ e(c, { children: /* @__PURE__ */ e(
                                          h,
                                          {
                                            variant: "outlined",
                                            className: " w-full",
                                            children: /* @__PURE__ */ o(c, { className: " w-full", children: [
                                              /* @__PURE__ */ e(
                                                C,
                                                {
                                                  control: b,
                                                  name: `numberOfDaysAddedForOnDate${i}`,
                                                  defaultValue: t.numberOfDaysAddedForOnDate,
                                                  render: ({ field: r }) => /* @__PURE__ */ e(
                                                    k,
                                                    {
                                                      required: !0,
                                                      type: "number",
                                                      variant: "outlined",
                                                      size: "small",
                                                      ...r,
                                                      error: !!m[`numberOfDaysAddedForOnDate${i}`],
                                                      onChange: (p) => {
                                                        u(
                                                          `numberOfDaysAddedForOnDate${i}`,
                                                          p.target.value
                                                        ), x(
                                                          i,
                                                          "numberOfDaysAddedForOnDate",
                                                          Number(p.target.value)
                                                        );
                                                        const g = `numberOfDaysAddedForOnDate${i}`;
                                                        L(g) === "" ? F(g, {
                                                          type: "manual",
                                                          message: "Enter # of days to add"
                                                        }) : E(g);
                                                      },
                                                      placeholder: "Enter # of days to add",
                                                      onBlur: () => {
                                                        r.value === "" ? F(
                                                          `numberOfDaysAddedForOnDate${i}`,
                                                          {
                                                            type: "manual",
                                                            message: "Enter # of days to add"
                                                          }
                                                        ) : E(
                                                          `numberOfDaysAddedForOnDate${i}`
                                                        );
                                                      },
                                                      "data-testid": `mobiletypeeventconfigmodal-on-date-input-${i}`
                                                    }
                                                  )
                                                }
                                              ),
                                              m[`numberOfDaysAddedForOnDate${i}`] && /* @__PURE__ */ e(
                                                "p",
                                                {
                                                  className: "error-helper-table",
                                                  "data-testid": `mobiletypeeventconfigmodal-on-date-error-${i}`,
                                                  children: (l = m[`numberOfDaysAddedForOnDate${i}`]) == null ? void 0 : l.message
                                                }
                                              )
                                            ] })
                                          }
                                        ) }) }),
                                        /* @__PURE__ */ e(y, { children: /* @__PURE__ */ e(c, { children: /* @__PURE__ */ e(
                                          h,
                                          {
                                            variant: "outlined",
                                            className: " w-full",
                                            children: /* @__PURE__ */ e(c, { className: " w-full", children: /* @__PURE__ */ e(
                                              C,
                                              {
                                                control: b,
                                                name: `numberOfDaysAddedForDueDate${i}`,
                                                defaultValue: t.numberOfDaysAddedForDueDate,
                                                render: ({ field: r }) => /* @__PURE__ */ e(
                                                  k,
                                                  {
                                                    variant: "outlined",
                                                    size: "small",
                                                    type: "number",
                                                    ...r,
                                                    onChange: (p) => {
                                                      u(
                                                        `numberOfDaysAddedForDueDate${i}`,
                                                        p.target.value
                                                      ), x(
                                                        i,
                                                        "numberOfDaysAddedForDueDate",
                                                        Number(p.target.value)
                                                      );
                                                    },
                                                    "data-testid": `mobiletypeeventconfigmodal-due-date-input-${i}`
                                                  }
                                                )
                                              }
                                            ) })
                                          }
                                        ) }) }),
                                        /* @__PURE__ */ e(y, { children: /* @__PURE__ */ e(c, { children: /* @__PURE__ */ e(
                                          h,
                                          {
                                            variant: "outlined",
                                            className: " w-full",
                                            children: /* @__PURE__ */ e(c, { className: " w-full", children: /* @__PURE__ */ e(
                                              C,
                                              {
                                                control: b,
                                                name: `numberOfDaysAddedForExpiryDate${i}`,
                                                defaultValue: t.numberOfDaysAddedForExpiryDate,
                                                render: ({ field: r }) => /* @__PURE__ */ e(
                                                  k,
                                                  {
                                                    variant: "outlined",
                                                    type: "number",
                                                    size: "small",
                                                    ...r,
                                                    onChange: (p) => {
                                                      u(
                                                        `numberOfDaysAddedForExpiryDate${i}`,
                                                        p.target.value
                                                      ), x(
                                                        i,
                                                        "numberOfDaysAddedForExpiryDate",
                                                        Number(p.target.value)
                                                      );
                                                    },
                                                    "data-testid": `mobiletypeeventconfigmodal-expiry-date-input-${i}`
                                                  }
                                                )
                                              }
                                            ) })
                                          }
                                        ) }) }),
                                        /* @__PURE__ */ e(y, { children: /* @__PURE__ */ e(
                                          J,
                                          {
                                            color: "error",
                                            onClick: () => Z(i),
                                            "data-testid": `mobiletypeeventconfigmodal-delete-button-${i}`,
                                            children: /* @__PURE__ */ e(_, { icon: De })
                                          }
                                        ) })
                                      ] }, i + 1);
                                    }) : /* @__PURE__ */ e(B, { children: /* @__PURE__ */ e(y, { colSpan: 5, children: /* @__PURE__ */ e(
                                      O,
                                      {
                                        align: "center",
                                        "data-testid": "mobiletypeeventconfigmodal-no-config",
                                        children: "No Mobile Configuration added"
                                      }
                                    ) }) }) })
                                  ]
                                }
                              )
                            }
                          ) })
                        ] })
                      ]
                    }
                  ),
                  /* @__PURE__ */ o(
                    pe,
                    {
                      direction: "row",
                      className: "mr-5",
                      spacing: 2,
                      justifyContent: "flex-end",
                      mt: 1,
                      mb: 1,
                      children: [
                        /* @__PURE__ */ e(
                          S,
                          {
                            variant: "contained",
                            color: "secondary",
                            onClick: () => {
                              T(), $();
                            },
                            "data-testid": "mobiletypeeventconfigmodal-close-button",
                            children: /* @__PURE__ */ e(O, { variant: "body2", children: a("Cancel") })
                          }
                        ),
                        /* @__PURE__ */ e(
                          S,
                          {
                            type: "submit",
                            variant: "contained",
                            color: "primary",
                            "data-testid": "mobiletypeeventconfigmodal-submit-button",
                            children: a("Submit")
                          }
                        )
                      ]
                    }
                  )
                ]
              }
            )
          ]
        }
      )
    }
  );
};
Ne.propTypes = {
  open: M.any,
  handleClose: M.any,
  handleClick: M.any,
  type: M.any
};
export {
  Ne as default
};
//# sourceMappingURL=MobileTypeEventConfigModal-ChhO_A4f-DfJDqFB9.js.map
