"use client";
import { j as t } from "../../../node_modules/.pnpm/react@19.1.0/node_modules/react/jsx-runtime.mjs";
import i from "../../../node_modules/.pnpm/classnames@2.5.1/node_modules/classnames/index.mjs";
import q from "../Alert/index.mjs";
import H from "../AlertCard/index.mjs";
import D from "../Button/index.mjs";
import { DarkContainer as J } from "../DarkContainer/index.mjs";
import I from "../Loading/index.mjs";
import f from "../Sticker/index.mjs";
import n from "./index.module.scss.mjs";
import E from "dayjs";
import W from "../../../node_modules/.pnpm/dayjs@1.11.13/node_modules/dayjs/plugin/localizedFormat.mjs";
import X from "../../../node_modules/.pnpm/@tabler_icons-react@3.34.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconClock.mjs";
E.extend(W);
function dt({
  title: L,
  description: g,
  endDate: d,
  eligibilityComponent: b,
  i18n: r = {
    endsOn: "Quest ends",
    endedOn: "Quest ended",
    rewards: "Claimable Rewards",
    claim: "Claim",
    signIn: "Sign in",
    secondCTAText: "View Game",
    play: "Play",
    questType: {
      "REPUTATIONAL-AIRDROP": "Reputation",
      PLAYSTREAK: "Play Streak",
      LEADERBOARD: "Leaderboard"
    },
    sync: "Sync",
    claimsLeft: "Claims left",
    viewReward: "View Reward",
    claimed: "Claimed",
    connectSteamAccount: "Connect Steam account"
  },
  onSignInClick: A,
  onConnectSteamAccountClick: k,
  onPlayClick: x,
  onSecondCTAClick: w,
  isQuestsPage: p,
  showSecondCTA: S,
  ctaComponent: F,
  loading: B,
  classNames: e,
  ctaDisabled: U,
  alertProps: s,
  errorMessage: j,
  isSignedIn: y,
  questType: c,
  showSync: R,
  onSyncClick: T,
  isSyncing: K,
  steamAccountIsLinked: Q,
  rewardsComponent: Y,
  gameTitle: h,
  ...V
}) {
  let a = null, l = "", o = null;
  c === "REPUTATIONAL-AIRDROP" ? (c === "REPUTATIONAL-AIRDROP" && (a = /* @__PURE__ */ t.jsx(f, { styleType: "secondary", variant: "outlined", children: r.questType["REPUTATIONAL-AIRDROP"] })), c === "REPUTATIONAL-AIRDROP" && (y ? Q || (l = r.connectSteamAccount, o = k) : (l = r.signIn, o = A))) : c === "PLAYSTREAK" && (a = /* @__PURE__ */ t.jsx(f, { styleType: "secondary", variant: "outlined", children: r.questType.PLAYSTREAK }), y || (l = r.signIn, o = A)), p && (l = r.play ?? "Play", o = x === void 0 ? () => console.log("play click handler not set!") : x);
  const z = h ? /* @__PURE__ */ t.jsx(f, { styleType: "neutral", variant: "outlined", children: h }) : null;
  let C = "secondary";
  R && T && (l = r.sync ?? "Sync", o = T, C = "tertiary");
  let O = /* @__PURE__ */ t.jsx(t.Fragment, { children: l });
  R && K && (O = /* @__PURE__ */ t.jsx(I, { className: i(n.loader, e == null ? void 0 : e.loading) }));
  let m = null;
  j ? m = /* @__PURE__ */ t.jsx(q, { message: j }) : s && (m = /* @__PURE__ */ t.jsx(H, { ...s }));
  let v = null;
  S && (v = /* @__PURE__ */ t.jsx(
    D,
    {
      type: "tertiary",
      className: n.claimButton,
      onClick: w,
      children: r.secondCTAText
    }
  ));
  const u = d && new Date(d) > /* @__PURE__ */ new Date(), G = E(d).format("lll");
  let P = /* @__PURE__ */ t.jsxs("div", { className: i(n.rootContent, e == null ? void 0 : e.rootContent), children: [
    /* @__PURE__ */ t.jsxs("div", { className: n.badges, children: [
      /* @__PURE__ */ t.jsx("div", { className: i(e == null ? void 0 : e.content), children: z }),
      /* @__PURE__ */ t.jsx("div", { className: i(e == null ? void 0 : e.content), children: a })
    ] }),
    /* @__PURE__ */ t.jsx("div", { className: i("title", n.title), children: L }),
    /* @__PURE__ */ t.jsx("div", { className: i("body-sm", "color-neutral-400", n.description), children: g }),
    d && /* @__PURE__ */ t.jsx("div", { className: i("body-sm", "color-neutral-400", n.description), children: /* @__PURE__ */ t.jsxs("span", { className: n.endDate, children: [
      /* @__PURE__ */ t.jsx(
        X,
        {
          className: u ? n.iconFuture : void 0
        }
      ),
      /* @__PURE__ */ t.jsxs(
        "span",
        {
          className: u ? n.futureDate : n.pastDate,
          children: [
            u ? r.endsOn : r.endedOn,
            ":"
          ]
        }
      ),
      G
    ] }) }),
    b,
    Y,
    m,
    /* @__PURE__ */ t.jsx(
      "div",
      {
        className: i(n.ctaContainer, {
          [n.isQuestsPage]: p
        }),
        children: F ?? /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
          v,
          o !== null && /* @__PURE__ */ t.jsx(
            D,
            {
              type: C,
              className: n.claimButton,
              onClick: o,
              disabled: U,
              children: O
            }
          )
        ] })
      }
    )
  ] });
  return B && (P = /* @__PURE__ */ t.jsx(I, { className: i(n.loader, e == null ? void 0 : e.loading) })), /* @__PURE__ */ t.jsx(
    J,
    {
      className: i(n.darkContainer, e == null ? void 0 : e.root),
      ...V,
      children: P
    }
  );
}
export {
  dt as default
};
//# sourceMappingURL=index.mjs.map
