import { t as p, v as P, w as g, r as x, q as e, W as f } from "./index-jYYVpIDL.js";
import { useMemo as v, useState as S } from "react";
import { A as b } from "./AppCard-pSUVQRE0.js";
import w from "./EventTypeAppSettingsInterface-aAUqc7Oo.js";
const k = function({
  app: a,
  eventType: i,
  eventTypeFormMetadata: c
}) {
  const t = p.useSearchParams(), s = p.usePathname(), m = v(
    () => `${s}${t ? `?${t.toString()}` : ""}`,
    [s, t]
  ), { getAppData: n, setAppData: h, disabled: d } = P(), [r, l] = S(n("enabled")), u = g(c), { t: A } = x(), o = !r && u;
  return /* @__PURE__ */ e.jsx(
    b,
    {
      returnTo: f + m,
      app: a,
      switchChecked: r,
      switchOnClick: (y) => {
        l(y);
      },
      description: /* @__PURE__ */ e.jsx(e.Fragment, { children: "Add Paypal payment to your events" }),
      disableSwitch: o,
      switchTooltip: o ? A("other_payment_app_enabled") : void 0,
      children: /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsx(
        w,
        {
          eventType: i,
          slug: a.slug,
          disabled: d,
          getAppData: n,
          setAppData: h
        }
      ) })
    }
  );
};
export {
  k as default
};
