import { jsx as e, jsxs as l } from "react/jsx-runtime";
import { a as h } from "./index.CfQlFjZU.js";
import { C as p } from "./card.CVCKhKP6.js";
import { a as y } from "./message.CHKnnsjy.js";
import { M as g } from "./shared.EdGf6tcG.js";
import { s as v, t as N } from "./index.dWlEA7uO.js";
import { useMemo as T } from "react";
import { a as u } from "./Stack.XB4icBMm.js";
import { C as S } from "./CardContentStatistic.tc-bsVHZ.js";
import { D as M } from "./DataTable.CDOMpN3l.js";
import { a as f, u as L } from "./useFormatDate.DZVq5Yc3.js";
import { f as C, u as x } from "./useFormatNumber.B91lpWtw.js";
import "./ProgressActivity.DYLCzf8q.js";
import "./index.B0wX8xO7.js";
import "./formInputIcon.module.CU3tuFAI.js";
import "./isEqual.Bk3xqtBB.js";
const B = "creator_container_f-cYS", _ = "creator_statisticCard_p2oIA", b = { container: B, statisticCard: _ }, F = ({
  loading: n,
  recipientCountLoading: m,
  recipientCount: a,
  completionDate: i,
  tableData: o
}) => {
  const c = T(() => o.map((r, D) => ({
    dayLabel: `Day ${D + 1}`,
    date: r.date ? f(r.date) : "TBD",
    dailySends: C(r.dailySends),
    sendsToDate: C(r.sendsToDate)
  })), [o]), d = L(a), s = x(a), t = i ? f(i) : "TBD";
  return {
    containerClassName: b.container,
    statisticCardClassName: b.statisticCard,
    loading: !!n,
    tableData: c,
    recipientCountLoading: !!m,
    recipientCountStatistic: d,
    recipientCountTooltip: s,
    completionDateStatistic: t
  };
}, P = ({
  loading: n,
  tableData: m,
  recipientCountLoading: a,
  recipientCountStatistic: i,
  recipientCountTooltip: o,
  completionDateStatistic: c,
  containerClassName: d,
  statisticCardClassName: s
}) => /* @__PURE__ */ e("div", { className: d, children: /* @__PURE__ */ l(u, { direction: "column", spacing: 3, children: [
  /* @__PURE__ */ e(
    y,
    {
      semantic: g.DEFAULT,
      text: "Schedule may change based on deliverability or fan segment size."
    }
  ),
  /* @__PURE__ */ l(u, { direction: "row", spacing: 3, children: [
    /* @__PURE__ */ e(
      p,
      {
        interaction: "static",
        elevation: "medium",
        className: s,
        children: /* @__PURE__ */ e(
          S,
          {
            icon: v,
            value: i,
            tooltipValue: o,
            label: "Recipients",
            loading: a
          }
        )
      }
    ),
    /* @__PURE__ */ e(
      p,
      {
        interaction: "static",
        elevation: "medium",
        className: s,
        children: /* @__PURE__ */ e(
          S,
          {
            icon: N,
            value: c,
            label: "Completion date"
          }
        )
      }
    )
  ] }),
  /* @__PURE__ */ e(
    M,
    {
      isLoading: n,
      head: ["", "Date", "Daily sends", "Sends to date"],
      data: m,
      row: (t) => [
        t.dayLabel,
        t.date,
        {
          element: t.dailySends,
          props: { isNumber: !0 }
        },
        {
          element: t.sendsToDate,
          props: { isNumber: !0 }
        }
      ]
    }
  )
] }) }), K = h(
  P,
  F
);
export {
  P as S,
  K as a,
  F as u
};
