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