import { jsx as r } from "../../../../../external/.pnpm/preact@10.28.2/node_modules/preact/jsx-runtime/dist/jsxRuntime.module.js";
import u from "../PreQualifiedIntro.js";
import { useState as d, useCallback as s, useMemo as C } from "../../../../../external/.pnpm/preact@10.28.2/node_modules/preact/hooks/dist/hooks.module.js";
import { CapitalOffer as g } from "../../../CapitalOffer/components/CapitalOffer/CapitalOffer.js";
import { Fragment as h } from "../../../../../external/.pnpm/preact@10.28.2/node_modules/preact/dist/preact.module.js";
const q = ({
  hideTitle: f,
  dynamicOffer: o,
  skipPreQualifiedIntro: e,
  onOfferOptionsRequest: a,
  onFundsRequest: n,
  onOfferDismiss: t
}) => {
  const [l, i] = d(e ? "capitalOffer" : "intro"), m = s(() => {
    a ? a() : i("capitalOffer");
  }, [a]), c = C(() => !e || !!t, [t, e]), p = s(() => {
    t ? t() : i("intro");
  }, [t]);
  return /* @__PURE__ */ r(h, { children: l === "intro" ? /* @__PURE__ */ r(u, { hideTitle: f, dynamicOfferConfig: o, onOfferOptionsRequest: m }) : /* @__PURE__ */ r(
    g,
    {
      onFundsRequest: n,
      onOfferDismiss: c ? p : void 0,
      externalDynamicOffersConfig: o
    }
  ) });
};
export {
  q as PreQualified
};
