@burdenoff/microfe-headshotmarketing 2026.1029.6 → 2026.1030.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/dist/generated/wspace-operations.d.ts +2 -0
  2. package/dist/generated/wspace-operations.d.ts.map +1 -1
  3. package/dist/generated/wspace-operations.js +2 -0
  4. package/dist/generated/wspace-operations.js.map +1 -1
  5. package/dist/headshotmarketing/pages/ads/AdCampaignsPage.d.ts.map +1 -1
  6. package/dist/headshotmarketing/pages/ads/AdCampaignsPage.js +474 -386
  7. package/dist/headshotmarketing/pages/ads/AdCampaignsPage.js.map +1 -1
  8. package/dist/headshotmarketing/pages/ads/AdPlatformConnectionsSection.d.ts.map +1 -1
  9. package/dist/headshotmarketing/pages/ads/AdPlatformConnectionsSection.js +94 -94
  10. package/dist/headshotmarketing/pages/ads/AdPlatformConnectionsSection.js.map +1 -1
  11. package/dist/headshotmarketing/pages/ads/AudiencesPage.d.ts.map +1 -1
  12. package/dist/headshotmarketing/pages/ads/AudiencesPage.js +448 -339
  13. package/dist/headshotmarketing/pages/ads/AudiencesPage.js.map +1 -1
  14. package/dist/headshotmarketing/pages/ads/CreateAdCampaignPage.d.ts +7 -0
  15. package/dist/headshotmarketing/pages/ads/CreateAdCampaignPage.d.ts.map +1 -1
  16. package/dist/headshotmarketing/pages/ads/CreateAdCampaignPage.js +463 -446
  17. package/dist/headshotmarketing/pages/ads/CreateAdCampaignPage.js.map +1 -1
  18. package/dist/headshotmarketing/pages/ads/adCampaignStepper.d.ts +53 -0
  19. package/dist/headshotmarketing/pages/ads/adCampaignStepper.d.ts.map +1 -0
  20. package/dist/headshotmarketing/pages/ads/adCampaignStepper.js +151 -0
  21. package/dist/headshotmarketing/pages/ads/adCampaignStepper.js.map +1 -0
  22. package/dist/headshotmarketing/pages/ads/audienceDetails.d.ts +31 -0
  23. package/dist/headshotmarketing/pages/ads/audienceDetails.d.ts.map +1 -0
  24. package/dist/headshotmarketing/pages/ads/audienceDetails.js +64 -0
  25. package/dist/headshotmarketing/pages/ads/audienceDetails.js.map +1 -0
  26. package/dist/headshotmarketing/types/index.d.ts +14 -1
  27. package/dist/headshotmarketing/types/index.d.ts.map +1 -1
  28. package/dist/headshotmarketing/utils/adsMapper.d.ts +6 -1
  29. package/dist/headshotmarketing/utils/adsMapper.d.ts.map +1 -1
  30. package/dist/headshotmarketing/utils/adsMapper.js +27 -11
  31. package/dist/headshotmarketing/utils/adsMapper.js.map +1 -1
  32. package/dist/utils/pageContext.d.ts +60 -15
  33. package/dist/utils/pageContext.d.ts.map +1 -1
  34. package/dist/utils/pageContext.js +77 -57
  35. package/dist/utils/pageContext.js.map +1 -1
  36. package/package.json +1 -1
@@ -1,107 +1,125 @@
1
1
  import { useCreateHeadshotmarketingAdCampaignMutation as e, useDeleteHeadshotmarketingAdCampaignMutation as t, useHeadshotmarketingAdCampaignsListQuery as n, useUpdateHeadshotmarketingAdCampaignMutation as r } from "../../../generated/wspace-operations.js";
2
2
  import { useHeadshotMarketing as i } from "../../context/HeadshotMarketingContext.js";
3
- import { cn as a, formatCurrency as o, formatNumber as s, formatPercentage as c } from "../../utils/helpers.js";
4
- import { HeadshotmarketingAdCampaignStatus as l, HeadshotmarketingAdPlatform as u } from "../../../generated/wspace-types.js";
5
- import { toAdCampaignModel as d, toAdCampaignStatusEnum as f, toAdPlatformEnum as p } from "../../utils/adsMapper.js";
6
- import { PageLayout as ee } from "../../components/PageLayout.js";
7
- import { StatusBadge as m } from "../../components/StatusBadge.js";
3
+ import { cn as a, formatCurrency as o, formatNumber as s, formatPercentage as ee } from "../../utils/helpers.js";
4
+ import { HeadshotmarketingAdCampaignStatus as c, HeadshotmarketingAdPlatform as l } from "../../../generated/wspace-types.js";
5
+ import { toAdCampaignModel as u, toAdCampaignStatusEnum as d, toAdPlatformEnum as f } from "../../utils/adsMapper.js";
6
+ import { PageLayout as p } from "../../components/PageLayout.js";
7
+ import { StatCard as m } from "../../components/StatCard.js";
8
+ import { StatusBadge as h } from "../../components/StatusBadge.js";
8
9
  import { EmptyState as te } from "../../components/EmptyState.js";
9
10
  import { FilterBar as ne } from "../../components/FilterBar.js";
10
- import { Modal as h } from "../../components/Modal.js";
11
+ import { Modal as g } from "../../components/Modal.js";
11
12
  import { QueryStateBoundary as re } from "../../components/QueryStateBoundary.js";
12
13
  import { Pagination as ie } from "../../components/Pagination.js";
13
14
  import "../../components/index.js";
14
15
  import { useHeadshotmarketingBootstrap as ae } from "../../hooks/useHeadshotmarketingBootstrap.js";
15
16
  import { usePagination as oe } from "../../hooks/usePagination.js";
16
- import { useEffect as g, useMemo as _, useState as v } from "react";
17
- import { Copy as y, DollarSign as b, Eye as x, MoreHorizontal as S, MousePointerClick as C, Pause as w, Pencil as T, Play as E, Plus as D, Settings2 as O, Trash2 as k, TrendingUp as A } from "lucide-react";
18
- import { useExclusiveMenu as j } from "@burdenoff/fe-libs/shared/hooks";
19
- import { Fragment as M, jsx as N, jsxs as P } from "react/jsx-runtime";
20
- import { EmphasisPanel as se, PagePurpose as ce } from "@burdenoff/fe-libs/ui";
17
+ import { platformLabel as _, renderPlatformIcon as v } from "./AdPlatformChips.js";
18
+ import { useEffect as y, useMemo as b, useState as x } from "react";
19
+ import { Copy as S, DollarSign as se, Eye as ce, Megaphone as le, MoreHorizontal as C, MousePointerClick as ue, Pause as de, Pencil as fe, Play as pe, Plus as w, Settings2 as T, Trash2 as E, TrendingUp as me } from "lucide-react";
20
+ import { useExclusiveMenu as D } from "@burdenoff/fe-libs/shared/hooks";
21
+ import { Fragment as O, jsx as k, jsxs as A } from "react/jsx-runtime";
22
+ import { PagePurpose as he } from "@burdenoff/fe-libs/ui";
21
23
  //#region src/headshotmarketing/pages/ads/AdCampaignsPage.tsx
22
- var F = {
23
- google_ads: "Google Ads",
24
- facebook: "Facebook",
25
- instagram: "Instagram",
26
- linkedin: "LinkedIn",
27
- twitter: "Twitter"
28
- }, I = {
29
- google_ads: "bg-status-info-bg text-status-info-text",
30
- facebook: "bg-status-info-bg text-status-info-text",
31
- instagram: "bg-[var(--color-accent-soft)] text-action-primary-bg",
32
- linkedin: "bg-status-info-bg text-status-info-text",
33
- twitter: "bg-status-info-bg text-status-info-text"
34
- }, le = {
35
- active: l.Active,
36
- paused: l.Paused,
37
- completed: l.Completed,
38
- draft: l.Draft
39
- }, ue = {
40
- google_ads: u.GoogleAds,
41
- facebook: u.FacebookAds,
42
- instagram: u.InstagramAds,
43
- linkedin: u.LinkedinAds,
44
- twitter: u.TwitterAds
24
+ var ge = {
25
+ active: c.Active,
26
+ paused: c.Paused,
27
+ completed: c.Completed,
28
+ draft: c.Draft
29
+ }, _e = {
30
+ google_ads: l.GoogleAds,
31
+ facebook: l.FacebookAds,
32
+ instagram: l.InstagramAds,
33
+ linkedin: l.LinkedinAds,
34
+ twitter: l.TwitterAds,
35
+ tiktok: l.TiktokAds
45
36
  };
46
- function L(e) {
37
+ function j(e) {
47
38
  if (!e) return "";
48
39
  let t = new Date(e);
49
40
  return Number.isNaN(t.getTime()) ? "" : t.toISOString().slice(0, 10);
50
41
  }
51
- var R = () => {
52
- let { navigate: a, basePath: c } = i(), u = (e) => a(c + e), { data: m, refetch: y } = ae(), [b, x] = v(""), [S, C] = v(""), [w, T] = v("all"), [E, O] = v("all"), [k, A] = v(null), [j, F] = v(null), [I, R] = v(null), [z, B] = v(null), V = oe({ initialPageSize: 10 }), { limit: fe, offset: pe, setPage: H, setTotal: U } = V;
53
- g(() => {
54
- let e = setTimeout(() => C(b), 300);
42
+ var M = () => {
43
+ let { navigate: a, basePath: ee } = i(), l = (e) => a(ee + e), { data: h, refetch: _ } = ae(), [v, S] = x(""), [C, fe] = x(""), [T, E] = x("all"), [D, M] = x("all"), [N, P] = x(null), [F, I] = x(null), [L, R] = x(null), [z, B] = x(null), [V, H] = x(/* @__PURE__ */ new Set()), [ye, U] = x(!1), W = oe({ initialPageSize: 10 }), { limit: be, offset: xe, setPage: G, setTotal: K } = W;
44
+ y(() => {
45
+ let e = setTimeout(() => fe(v), 300);
55
46
  return () => clearTimeout(e);
56
- }, [b]), g(() => {
57
- H(1);
47
+ }, [v]), y(() => {
48
+ G(1);
58
49
  }, [
59
- S,
60
- w,
61
- E,
62
- H
50
+ C,
51
+ T,
52
+ D,
53
+ G
63
54
  ]);
64
- let { data: W, loading: G, error: me, refetch: K } = n({
55
+ let { data: q, loading: Se, error: Ce, refetch: we } = n({
65
56
  variables: {
66
- limit: fe,
67
- offset: pe,
68
- search: S || null,
69
- status: le[w] ?? null,
70
- platform: ue[E] ?? null
57
+ limit: be,
58
+ offset: xe,
59
+ search: C || null,
60
+ status: ge[T] ?? null,
61
+ platform: _e[D] ?? null
71
62
  },
72
63
  errorPolicy: "all",
73
64
  notifyOnNetworkStatusChange: !0
74
- }), q = W?.headshotmarketingAdCampaigns.total ?? 0;
75
- g(() => {
76
- U(q);
77
- }, [q, U]);
78
- let J = _(() => (W?.headshotmarketingAdCampaigns.items ?? []).map((e) => d(e)), [W?.headshotmarketingAdCampaigns.items]), Y = _(() => {
79
- let e = (m?.headshotmarketingAdCampaigns.items ?? []).map((e) => d(e)), t = e.filter((e) => e.status === "active").length, n = e.reduce((e, t) => e + t.metrics.spend, 0), r = e.reduce((e, t) => e + t.metrics.impressions, 0), i = e.filter((e) => e.metrics.roas > 0);
65
+ }), J = q?.headshotmarketingAdCampaigns.total ?? 0;
66
+ y(() => {
67
+ K(J);
68
+ }, [J, K]);
69
+ let Y = b(() => (q?.headshotmarketingAdCampaigns.items ?? []).map((e) => u(e)), [q?.headshotmarketingAdCampaigns.items]), X = b(() => {
70
+ let e = h?.headshotmarketingAdMetrics, t = (h?.headshotmarketingAdCampaigns.items ?? []).map((e) => u(e)), n = t.filter((e) => e.metrics.roas > 0), r = n.length > 0 ? n.reduce((e, t) => e + t.metrics.roas, 0) / n.length : 0;
80
71
  return {
81
- active: t,
82
- totalSpend: n,
83
- totalImpressions: r,
84
- avgRoas: i.length > 0 ? i.reduce((e, t) => e + t.metrics.roas, 0) / i.length : 0
72
+ active: e?.activeAdCampaigns ?? t.filter((e) => e.status === "active").length,
73
+ totalSpend: e?.totalSpent ?? t.reduce((e, t) => e + t.metrics.spend, 0),
74
+ totalImpressions: e?.totalImpressions ?? 0,
75
+ totalClicks: e?.totalClicks ?? 0,
76
+ avgRoas: r
85
77
  };
86
- }, [m?.headshotmarketingAdCampaigns.items]), [he] = e(), [X, { loading: Z }] = r(), [ge, { loading: Q }] = t(), $ = async () => {
87
- await Promise.all([K(), y()]);
88
- }, _e = async (e) => {
89
- A(null), B(null);
78
+ }, [h?.headshotmarketingAdCampaigns.items, h?.headshotmarketingAdMetrics]);
79
+ y(() => {
80
+ H((e) => {
81
+ let t = new Set(Y.map((e) => e.id)), n = new Set([...e].filter((e) => t.has(e)));
82
+ return n.size === e.size ? e : n;
83
+ });
84
+ }, [Y]);
85
+ let Te = Y.length > 0 && Y.every((e) => V.has(e.id)), Ee = (e) => {
86
+ H((t) => {
87
+ let n = new Set(t);
88
+ return n.has(e) ? n.delete(e) : n.add(e), n;
89
+ });
90
+ }, De = () => {
91
+ H(Te ? /* @__PURE__ */ new Set() : new Set(Y.map((e) => e.id)));
92
+ }, [Oe] = e(), [Z, { loading: Q }] = r(), [ke, { loading: Ae }] = t(), $ = async () => {
93
+ await Promise.all([we(), _()]);
94
+ }, je = async (e) => {
95
+ P(null), B(null);
90
96
  try {
91
- await X({ variables: {
97
+ await Z({ variables: {
92
98
  id: e.id,
93
- input: { status: e.status === "active" ? l.Paused : l.Active }
99
+ input: { status: e.status === "active" ? c.Paused : c.Active }
94
100
  } }), await $();
95
101
  } catch (e) {
96
102
  B(e instanceof Error ? e.message : "Failed to update campaign.");
97
103
  }
98
- }, ve = async (e) => {
99
- A(null), B(null);
104
+ }, Me = async (e) => {
105
+ B(null), U(!0);
106
+ try {
107
+ await Promise.all([...V].map((t) => Z({ variables: {
108
+ id: t,
109
+ input: { status: e }
110
+ } }))), H(/* @__PURE__ */ new Set()), await $();
111
+ } catch (e) {
112
+ B(e instanceof Error ? e.message : "Failed to update campaigns.");
113
+ } finally {
114
+ U(!1);
115
+ }
116
+ }, Ne = async (e) => {
117
+ P(null), B(null);
100
118
  try {
101
- await he({ variables: { input: {
119
+ await Oe({ variables: { input: {
102
120
  name: `${e.name} (Copy)`,
103
- platform: p(e.platform),
104
- status: l.Draft,
121
+ platform: f(e.platform),
122
+ status: c.Draft,
105
123
  bidStrategy: e.bidStrategy,
106
124
  totalBudget: e.budget.total > 0 ? e.budget.total : null,
107
125
  startDate: e.startDate ? new Date(e.startDate).toISOString() : null,
@@ -111,340 +129,447 @@ var R = () => {
111
129
  } catch (e) {
112
130
  B(e instanceof Error ? e.message : "Failed to duplicate campaign.");
113
131
  }
114
- }, ye = async () => {
115
- if (!j) return;
116
- if (!j.name.trim()) {
132
+ }, Pe = async () => {
133
+ if (!F) return;
134
+ if (!F.name.trim()) {
117
135
  B("Campaign name is required.");
118
136
  return;
119
137
  }
120
138
  B(null);
121
- let e = Number(j.totalBudget);
139
+ let e = Number(F.totalBudget);
122
140
  try {
123
- await X({ variables: {
124
- id: j.id,
141
+ await Z({ variables: {
142
+ id: F.id,
125
143
  input: {
126
- name: j.name.trim(),
127
- status: f(j.status),
128
- bidStrategy: j.bidStrategy || null,
129
- totalBudget: j.totalBudget && Number.isFinite(e) ? e : null,
130
- startDate: j.startDate ? new Date(j.startDate).toISOString() : null,
131
- endDate: j.endDate ? new Date(j.endDate).toISOString() : null
144
+ name: F.name.trim(),
145
+ status: d(F.status),
146
+ bidStrategy: F.bidStrategy || null,
147
+ totalBudget: F.totalBudget && Number.isFinite(e) ? e : null,
148
+ startDate: F.startDate ? new Date(F.startDate).toISOString() : null,
149
+ endDate: F.endDate ? new Date(F.endDate).toISOString() : null
132
150
  }
133
- } }), F(null), await $();
151
+ } }), I(null), await $();
134
152
  } catch (e) {
135
153
  B(e instanceof Error ? e.message : "Failed to save campaign.");
136
154
  }
137
- }, be = async () => {
138
- if (I) {
155
+ }, Fe = async () => {
156
+ if (L) {
139
157
  B(null);
140
158
  try {
141
- await ge({ variables: { id: I.id } }), R(null), await $();
159
+ await ke({ variables: { id: L.id } }), R(null), await $();
142
160
  } catch (e) {
143
161
  B(e instanceof Error ? e.message : "Failed to delete campaign.");
144
162
  }
145
163
  }
146
- }, xe = (e) => {
147
- A(null), B(null), F({
164
+ }, Ie = (e) => {
165
+ P(null), B(null), I({
148
166
  id: e.id,
149
167
  name: e.name,
150
168
  status: e.status,
151
169
  totalBudget: e.budget.total > 0 ? String(e.budget.total) : "",
152
170
  bidStrategy: e.bidStrategy,
153
- startDate: L(e.startDate),
154
- endDate: L(e.endDate)
171
+ startDate: j(e.startDate),
172
+ endDate: j(e.endDate)
155
173
  });
156
174
  };
157
- return /* @__PURE__ */ P(ee, {
175
+ return /* @__PURE__ */ A(p, {
158
176
  title: "Ad Campaigns",
159
177
  description: "Create and manage your advertising campaigns",
160
- actions: /* @__PURE__ */ P("button", {
161
- onClick: () => u("/ads/campaigns/new"),
178
+ actions: /* @__PURE__ */ A("button", {
179
+ onClick: () => l("/ads/campaigns/new"),
162
180
  className: "inline-flex items-center gap-2 rounded-md bg-foreground px-4 py-2 text-sm font-medium text-background hover:bg-foreground/90",
163
- children: [/* @__PURE__ */ N(D, { className: "h-4 w-4" }), "Create Campaign"]
181
+ children: [/* @__PURE__ */ k(w, { className: "h-4 w-4" }), "New Ad Campaign"]
164
182
  }),
165
183
  children: [
166
- /* @__PURE__ */ N(ce, { children: "A focused view of every ad campaign — filter by platform or status, watch budget pacing at a glance, and pause, edit or duplicate any campaign without leaving the list." }),
167
- /* @__PURE__ */ N(se, { children: /* @__PURE__ */ P("div", {
168
- className: "grid grid-cols-2 gap-4 sm:grid-cols-4",
184
+ /* @__PURE__ */ k(he, { children: "A focused view of every ad campaign — filter by platform or status, watch budget pacing at a glance, and pause, edit or duplicate any campaign without leaving the list." }),
185
+ /* @__PURE__ */ A("div", {
186
+ className: "grid grid-cols-2 gap-4 md:grid-cols-3 xl:grid-cols-5",
169
187
  children: [
170
- /* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N("p", {
171
- className: "text-xs text-text-secondary",
172
- children: "Active Campaigns"
173
- }), /* @__PURE__ */ N("p", {
174
- className: "text-2xl font-semibold text-text-primary",
175
- children: s(Y.active)
176
- })] }),
177
- /* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N("p", {
178
- className: "text-xs text-text-secondary",
179
- children: "Total Spend"
180
- }), /* @__PURE__ */ N("p", {
181
- className: "text-2xl font-semibold text-text-primary",
182
- children: o(Y.totalSpend)
183
- })] }),
184
- /* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N("p", {
185
- className: "text-xs text-text-secondary",
186
- children: "Impressions"
187
- }), /* @__PURE__ */ N("p", {
188
- className: "text-2xl font-semibold text-text-primary",
189
- children: s(Y.totalImpressions)
190
- })] }),
191
- /* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N("p", {
192
- className: "text-xs text-text-secondary",
193
- children: "Avg ROAS"
194
- }), /* @__PURE__ */ P("p", {
195
- className: "text-2xl font-semibold text-text-primary",
196
- children: [Y.avgRoas.toFixed(1), "x"]
197
- })] })
188
+ /* @__PURE__ */ k(m, {
189
+ featured: !0,
190
+ title: "Total Ad Spend",
191
+ value: o(X.totalSpend),
192
+ icon: /* @__PURE__ */ k(se, { className: "h-4 w-4" })
193
+ }),
194
+ /* @__PURE__ */ k(m, {
195
+ title: "Active Ad Campaigns",
196
+ value: s(X.active),
197
+ icon: /* @__PURE__ */ k(le, { className: "h-4 w-4" })
198
+ }),
199
+ /* @__PURE__ */ k(m, {
200
+ title: "Impressions",
201
+ value: s(X.totalImpressions),
202
+ icon: /* @__PURE__ */ k(ce, { className: "h-4 w-4" })
203
+ }),
204
+ /* @__PURE__ */ k(m, {
205
+ title: "Clicks",
206
+ value: s(X.totalClicks),
207
+ icon: /* @__PURE__ */ k(ue, { className: "h-4 w-4" })
208
+ }),
209
+ /* @__PURE__ */ k(m, {
210
+ title: "Avg ROAS",
211
+ value: `${X.avgRoas.toFixed(1)}x`,
212
+ icon: /* @__PURE__ */ k(me, { className: "h-4 w-4" })
213
+ })
198
214
  ]
199
- }) }),
200
- /* @__PURE__ */ N(ne, {
201
- searchValue: b,
202
- onSearchChange: x,
215
+ }),
216
+ /* @__PURE__ */ k(ne, {
217
+ searchValue: v,
218
+ onSearchChange: S,
203
219
  searchPlaceholder: "Search campaigns...",
204
- filters: /* @__PURE__ */ P(M, { children: [/* @__PURE__ */ P("select", {
205
- value: w,
206
- onChange: (e) => T(e.target.value),
220
+ filters: /* @__PURE__ */ A(O, { children: [/* @__PURE__ */ A("select", {
221
+ "aria-label": "Status",
222
+ value: T,
223
+ onChange: (e) => E(e.target.value),
207
224
  className: "rounded-md border border-border-seam bg-gloss-card shadow-pop px-3 py-2 text-sm text-text-primary",
208
225
  children: [
209
- /* @__PURE__ */ N("option", {
226
+ /* @__PURE__ */ k("option", {
210
227
  value: "all",
211
228
  children: "All Status"
212
229
  }),
213
- /* @__PURE__ */ N("option", {
230
+ /* @__PURE__ */ k("option", {
214
231
  value: "active",
215
232
  children: "Active"
216
233
  }),
217
- /* @__PURE__ */ N("option", {
234
+ /* @__PURE__ */ k("option", {
218
235
  value: "paused",
219
236
  children: "Paused"
220
237
  }),
221
- /* @__PURE__ */ N("option", {
238
+ /* @__PURE__ */ k("option", {
222
239
  value: "completed",
223
240
  children: "Completed"
224
241
  }),
225
- /* @__PURE__ */ N("option", {
242
+ /* @__PURE__ */ k("option", {
226
243
  value: "draft",
227
244
  children: "Draft"
228
245
  })
229
246
  ]
230
- }), /* @__PURE__ */ P("select", {
231
- value: E,
232
- onChange: (e) => O(e.target.value),
247
+ }), /* @__PURE__ */ A("select", {
248
+ "aria-label": "Platform",
249
+ value: D,
250
+ onChange: (e) => M(e.target.value),
233
251
  className: "rounded-md border border-border-seam bg-gloss-card shadow-pop px-3 py-2 text-sm text-text-primary",
234
252
  children: [
235
- /* @__PURE__ */ N("option", {
253
+ /* @__PURE__ */ k("option", {
236
254
  value: "all",
237
255
  children: "All Platforms"
238
256
  }),
239
- /* @__PURE__ */ N("option", {
257
+ /* @__PURE__ */ k("option", {
240
258
  value: "google_ads",
241
259
  children: "Google Ads"
242
260
  }),
243
- /* @__PURE__ */ N("option", {
261
+ /* @__PURE__ */ k("option", {
244
262
  value: "facebook",
245
263
  children: "Facebook"
246
264
  }),
247
- /* @__PURE__ */ N("option", {
265
+ /* @__PURE__ */ k("option", {
248
266
  value: "instagram",
249
267
  children: "Instagram"
250
268
  }),
251
- /* @__PURE__ */ N("option", {
269
+ /* @__PURE__ */ k("option", {
252
270
  value: "linkedin",
253
271
  children: "LinkedIn"
254
272
  }),
255
- /* @__PURE__ */ N("option", {
273
+ /* @__PURE__ */ k("option", {
256
274
  value: "twitter",
257
275
  children: "Twitter"
276
+ }),
277
+ /* @__PURE__ */ k("option", {
278
+ value: "tiktok",
279
+ children: "TikTok"
258
280
  })
259
281
  ]
260
282
  })] })
261
283
  }),
262
- z && /* @__PURE__ */ N("div", {
284
+ z && /* @__PURE__ */ k("div", {
263
285
  role: "alert",
264
286
  className: "rounded-lg border border-status-error-border/30 bg-status-error-bg/10 px-4 py-3 text-sm text-status-error-text",
265
287
  children: z
266
288
  }),
267
- /* @__PURE__ */ N(re, {
268
- loading: G,
269
- error: me,
270
- onRetry: K,
271
- hasData: !!W,
272
- children: J.length === 0 ? /* @__PURE__ */ N(te, {
273
- illustration: q === 0 ? "empty-generic" : "empty-search",
274
- title: q === 0 ? "No ad campaigns yet" : "No campaigns match your filters",
275
- description: q === 0 ? "Create your first ad campaign to start running paid traffic." : "Try a different search term, platform or status.",
276
- action: q === 0 ? /* @__PURE__ */ P("button", {
277
- onClick: () => u("/ads/campaigns/new"),
289
+ /* @__PURE__ */ k(re, {
290
+ loading: Se,
291
+ error: Ce,
292
+ onRetry: we,
293
+ hasData: !!q,
294
+ children: Y.length === 0 ? /* @__PURE__ */ k(te, {
295
+ illustration: J === 0 ? "empty-generic" : "empty-search",
296
+ title: J === 0 ? "No ad campaigns yet" : "No campaigns match your filters",
297
+ description: J === 0 ? "Create your first ad campaign to start running paid traffic." : "Try a different search term, platform or status.",
298
+ action: J === 0 ? /* @__PURE__ */ A("button", {
299
+ onClick: () => l("/ads/campaigns/new"),
278
300
  className: "inline-flex items-center gap-2 rounded-md bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:bg-action-primary-bg/90",
279
- children: [/* @__PURE__ */ N(D, { className: "h-4 w-4" }), "Create Campaign"]
301
+ children: [/* @__PURE__ */ k(w, { className: "h-4 w-4" }), "Create Campaign"]
280
302
  }) : void 0
281
- }) : /* @__PURE__ */ P(M, { children: [/* @__PURE__ */ N("div", {
282
- className: "space-y-4",
283
- children: J.map((e) => /* @__PURE__ */ N(de, {
284
- campaign: e,
285
- menuOpen: k === e.id,
286
- onToggleMenu: () => A(k === e.id ? null : e.id),
287
- onCloseMenu: () => A(null),
288
- onManage: () => u("/ads/campaigns/" + e.id),
289
- onEdit: () => xe(e),
290
- onToggleStatus: () => _e(e),
291
- onDuplicate: () => ve(e),
292
- onDelete: () => {
293
- A(null), R(e);
294
- }
295
- }, e.id))
296
- }), /* @__PURE__ */ N(ie, {
297
- page: V.page,
298
- pageSize: V.pageSize,
299
- total: V.total,
300
- onPageChange: V.setPage,
301
- onPageSizeChange: V.setPageSize,
302
- disabled: G,
303
- hideWhenSinglePage: !0
304
- })] })
303
+ }) : /* @__PURE__ */ A(O, { children: [
304
+ V.size > 0 && /* @__PURE__ */ A("div", {
305
+ className: "flex flex-wrap items-center gap-2 rounded-lg border border-border-seam bg-bg-surface px-4 py-2 text-sm",
306
+ children: [
307
+ /* @__PURE__ */ A("span", {
308
+ className: "font-medium text-text-primary",
309
+ children: [V.size, " selected"]
310
+ }),
311
+ /* @__PURE__ */ A("button", {
312
+ onClick: () => Me(c.Paused),
313
+ disabled: ye,
314
+ className: "inline-flex items-center gap-1.5 rounded-md border border-border-subtle px-3 py-1.5 text-text-primary hover:bg-bg-sunken disabled:opacity-60",
315
+ children: [/* @__PURE__ */ k(de, { className: "h-3.5 w-3.5" }), "Pause"]
316
+ }),
317
+ /* @__PURE__ */ A("button", {
318
+ onClick: () => Me(c.Active),
319
+ disabled: ye,
320
+ className: "inline-flex items-center gap-1.5 rounded-md border border-border-subtle px-3 py-1.5 text-text-primary hover:bg-bg-sunken disabled:opacity-60",
321
+ children: [/* @__PURE__ */ k(pe, { className: "h-3.5 w-3.5" }), "Activate"]
322
+ }),
323
+ /* @__PURE__ */ k("button", {
324
+ onClick: () => H(/* @__PURE__ */ new Set()),
325
+ className: "ml-auto text-text-secondary hover:text-text-primary",
326
+ children: "Clear"
327
+ })
328
+ ]
329
+ }),
330
+ /* @__PURE__ */ k("div", {
331
+ className: "overflow-x-auto rounded-lg border border-border-seam bg-gloss-card shadow-pop",
332
+ children: /* @__PURE__ */ A("table", {
333
+ className: "w-full min-w-[960px] text-sm",
334
+ "aria-label": "Ad campaigns",
335
+ children: [/* @__PURE__ */ k("thead", {
336
+ className: "border-b border-border-seam bg-bg-sunken/60 text-left text-xs font-medium text-text-secondary",
337
+ children: /* @__PURE__ */ A("tr", { children: [
338
+ /* @__PURE__ */ k("th", {
339
+ scope: "col",
340
+ className: "w-10 px-4 py-3",
341
+ children: /* @__PURE__ */ k("input", {
342
+ type: "checkbox",
343
+ "aria-label": "Select all campaigns on this page",
344
+ checked: Te,
345
+ onChange: De,
346
+ className: "h-4 w-4 rounded border-border-subtle"
347
+ })
348
+ }),
349
+ /* @__PURE__ */ k("th", {
350
+ scope: "col",
351
+ className: "px-3 py-3",
352
+ children: "Campaign"
353
+ }),
354
+ /* @__PURE__ */ k("th", {
355
+ scope: "col",
356
+ className: "px-3 py-3",
357
+ children: "Platform"
358
+ }),
359
+ /* @__PURE__ */ k("th", {
360
+ scope: "col",
361
+ className: "px-3 py-3",
362
+ children: "Status"
363
+ }),
364
+ /* @__PURE__ */ k("th", {
365
+ scope: "col",
366
+ className: "px-3 py-3 text-right",
367
+ children: "Daily Budget"
368
+ }),
369
+ /* @__PURE__ */ k("th", {
370
+ scope: "col",
371
+ className: "px-3 py-3",
372
+ children: "Spent"
373
+ }),
374
+ /* @__PURE__ */ k("th", {
375
+ scope: "col",
376
+ className: "px-3 py-3 text-right",
377
+ children: "Impressions"
378
+ }),
379
+ /* @__PURE__ */ k("th", {
380
+ scope: "col",
381
+ className: "px-3 py-3 text-right",
382
+ children: "Clicks"
383
+ }),
384
+ /* @__PURE__ */ k("th", {
385
+ scope: "col",
386
+ className: "px-3 py-3 text-right",
387
+ children: "CTR"
388
+ }),
389
+ /* @__PURE__ */ k("th", {
390
+ scope: "col",
391
+ className: "px-3 py-3 text-right",
392
+ children: "ROAS"
393
+ }),
394
+ /* @__PURE__ */ k("th", {
395
+ scope: "col",
396
+ className: "w-12 px-3 py-3",
397
+ children: /* @__PURE__ */ k("span", {
398
+ className: "sr-only",
399
+ children: "Actions"
400
+ })
401
+ })
402
+ ] })
403
+ }), /* @__PURE__ */ k("tbody", { children: Y.map((e) => /* @__PURE__ */ k(ve, {
404
+ campaign: e,
405
+ selected: V.has(e.id),
406
+ onToggleSelected: () => Ee(e.id),
407
+ menuOpen: N === e.id,
408
+ onToggleMenu: () => P(N === e.id ? null : e.id),
409
+ onCloseMenu: () => P(null),
410
+ onManage: () => l("/ads/campaigns/" + e.id),
411
+ onEdit: () => Ie(e),
412
+ onToggleStatus: () => je(e),
413
+ onDuplicate: () => Ne(e),
414
+ onDelete: () => {
415
+ P(null), R(e);
416
+ }
417
+ }, e.id)) })]
418
+ })
419
+ }),
420
+ /* @__PURE__ */ k(ie, {
421
+ page: W.page,
422
+ pageSize: W.pageSize,
423
+ total: W.total,
424
+ onPageChange: W.setPage,
425
+ onPageSizeChange: W.setPageSize,
426
+ disabled: Se,
427
+ hideWhenSinglePage: !0
428
+ })
429
+ ] })
305
430
  }),
306
- /* @__PURE__ */ N(h, {
307
- open: j !== null,
308
- onClose: () => F(null),
431
+ /* @__PURE__ */ k(g, {
432
+ open: F !== null,
433
+ onClose: () => I(null),
309
434
  title: "Edit Campaign",
310
435
  description: "Update campaign details",
311
436
  size: "lg",
312
- footer: /* @__PURE__ */ P(M, { children: [/* @__PURE__ */ N("button", {
313
- onClick: () => F(null),
437
+ footer: /* @__PURE__ */ A(O, { children: [/* @__PURE__ */ k("button", {
438
+ onClick: () => I(null),
314
439
  className: "rounded-md border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken",
315
440
  children: "Cancel"
316
- }), /* @__PURE__ */ N("button", {
317
- onClick: ye,
318
- disabled: Z,
441
+ }), /* @__PURE__ */ k("button", {
442
+ onClick: Pe,
443
+ disabled: Q,
319
444
  className: "rounded-md bg-foreground px-4 py-2 text-sm font-medium text-background hover:bg-foreground/90 disabled:opacity-60",
320
- children: Z ? "Saving..." : "Save Changes"
445
+ children: Q ? "Saving..." : "Save Changes"
321
446
  })] }),
322
- children: j && /* @__PURE__ */ P("div", {
447
+ children: F && /* @__PURE__ */ A("div", {
323
448
  className: "space-y-4",
324
449
  children: [
325
- /* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N("label", {
450
+ /* @__PURE__ */ A("div", { children: [/* @__PURE__ */ k("label", {
326
451
  className: "mb-1.5 block text-sm font-medium text-text-primary",
327
452
  children: "Campaign Name"
328
- }), /* @__PURE__ */ N("input", {
453
+ }), /* @__PURE__ */ k("input", {
329
454
  type: "text",
330
- value: j.name,
331
- onChange: (e) => F({
332
- ...j,
455
+ value: F.name,
456
+ onChange: (e) => I({
457
+ ...F,
333
458
  name: e.target.value
334
459
  }),
335
460
  className: "w-full rounded-md border border-border-subtle bg-bg-surface px-4 py-2.5 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
336
461
  })] }),
337
- /* @__PURE__ */ P("div", {
462
+ /* @__PURE__ */ A("div", {
338
463
  className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
339
- children: [/* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N("label", {
464
+ children: [/* @__PURE__ */ A("div", { children: [/* @__PURE__ */ k("label", {
340
465
  className: "mb-1.5 block text-sm font-medium text-text-primary",
341
466
  children: "Status"
342
- }), /* @__PURE__ */ P("select", {
343
- value: j.status,
344
- onChange: (e) => F({
345
- ...j,
467
+ }), /* @__PURE__ */ A("select", {
468
+ value: F.status,
469
+ onChange: (e) => I({
470
+ ...F,
346
471
  status: e.target.value
347
472
  }),
348
473
  className: "w-full rounded-md border border-border-subtle bg-bg-surface px-4 py-2.5 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]",
349
474
  children: [
350
- /* @__PURE__ */ N("option", {
475
+ /* @__PURE__ */ k("option", {
351
476
  value: "draft",
352
477
  children: "Draft"
353
478
  }),
354
- /* @__PURE__ */ N("option", {
479
+ /* @__PURE__ */ k("option", {
355
480
  value: "active",
356
481
  children: "Active"
357
482
  }),
358
- /* @__PURE__ */ N("option", {
483
+ /* @__PURE__ */ k("option", {
359
484
  value: "paused",
360
485
  children: "Paused"
361
486
  }),
362
- /* @__PURE__ */ N("option", {
487
+ /* @__PURE__ */ k("option", {
363
488
  value: "completed",
364
489
  children: "Completed"
365
490
  })
366
491
  ]
367
- })] }), /* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N("label", {
492
+ })] }), /* @__PURE__ */ A("div", { children: [/* @__PURE__ */ k("label", {
368
493
  className: "mb-1.5 block text-sm font-medium text-text-primary",
369
494
  children: "Total Budget (USD)"
370
- }), /* @__PURE__ */ N("input", {
495
+ }), /* @__PURE__ */ k("input", {
371
496
  type: "number",
372
- value: j.totalBudget,
373
- onChange: (e) => F({
374
- ...j,
497
+ value: F.totalBudget,
498
+ onChange: (e) => I({
499
+ ...F,
375
500
  totalBudget: e.target.value
376
501
  }),
377
502
  className: "w-full rounded-md border border-border-subtle bg-bg-surface px-4 py-2.5 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
378
503
  })] })]
379
504
  }),
380
- /* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N("label", {
505
+ /* @__PURE__ */ A("div", { children: [/* @__PURE__ */ k("label", {
381
506
  className: "mb-1.5 block text-sm font-medium text-text-primary",
382
507
  children: "Bid Strategy"
383
- }), /* @__PURE__ */ N("input", {
508
+ }), /* @__PURE__ */ k("input", {
384
509
  type: "text",
385
- value: j.bidStrategy,
386
- onChange: (e) => F({
387
- ...j,
510
+ value: F.bidStrategy,
511
+ onChange: (e) => I({
512
+ ...F,
388
513
  bidStrategy: e.target.value
389
514
  }),
390
515
  className: "w-full rounded-md border border-border-subtle bg-bg-surface px-4 py-2.5 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
391
516
  })] }),
392
- /* @__PURE__ */ P("div", {
517
+ /* @__PURE__ */ A("div", {
393
518
  className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
394
- children: [/* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N("label", {
519
+ children: [/* @__PURE__ */ A("div", { children: [/* @__PURE__ */ k("label", {
395
520
  className: "mb-1.5 block text-sm font-medium text-text-primary",
396
521
  children: "Start Date"
397
- }), /* @__PURE__ */ N("input", {
522
+ }), /* @__PURE__ */ k("input", {
398
523
  type: "date",
399
- value: j.startDate,
400
- onChange: (e) => F({
401
- ...j,
524
+ value: F.startDate,
525
+ onChange: (e) => I({
526
+ ...F,
402
527
  startDate: e.target.value
403
528
  }),
404
529
  className: "w-full rounded-md border border-border-subtle bg-bg-surface px-4 py-2.5 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
405
- })] }), /* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N("label", {
530
+ })] }), /* @__PURE__ */ A("div", { children: [/* @__PURE__ */ k("label", {
406
531
  className: "mb-1.5 block text-sm font-medium text-text-primary",
407
532
  children: "End Date"
408
- }), /* @__PURE__ */ N("input", {
533
+ }), /* @__PURE__ */ k("input", {
409
534
  type: "date",
410
- value: j.endDate,
411
- onChange: (e) => F({
412
- ...j,
535
+ value: F.endDate,
536
+ onChange: (e) => I({
537
+ ...F,
413
538
  endDate: e.target.value
414
539
  }),
415
540
  className: "w-full rounded-md border border-border-subtle bg-bg-surface px-4 py-2.5 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
416
541
  })] })]
417
542
  }),
418
- z && /* @__PURE__ */ N("p", {
543
+ z && /* @__PURE__ */ k("p", {
419
544
  className: "text-sm text-status-error-text",
420
545
  children: z
421
546
  })
422
547
  ]
423
548
  })
424
549
  }),
425
- /* @__PURE__ */ N(h, {
426
- open: I !== null,
550
+ /* @__PURE__ */ k(g, {
551
+ open: L !== null,
427
552
  onClose: () => R(null),
428
553
  title: "Delete Campaign",
429
554
  size: "sm",
430
- footer: /* @__PURE__ */ P(M, { children: [/* @__PURE__ */ N("button", {
555
+ footer: /* @__PURE__ */ A(O, { children: [/* @__PURE__ */ k("button", {
431
556
  onClick: () => R(null),
432
557
  className: "rounded-md border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken",
433
558
  children: "Cancel"
434
- }), /* @__PURE__ */ N("button", {
435
- onClick: be,
436
- disabled: Q,
559
+ }), /* @__PURE__ */ k("button", {
560
+ onClick: Fe,
561
+ disabled: Ae,
437
562
  className: "rounded-md bg-status-error-text px-4 py-2 text-sm font-medium text-background hover:opacity-90 disabled:opacity-60",
438
- children: Q ? "Deleting..." : "Delete"
563
+ children: Ae ? "Deleting..." : "Delete"
439
564
  })] }),
440
- children: /* @__PURE__ */ P("p", {
565
+ children: /* @__PURE__ */ A("p", {
441
566
  className: "text-sm text-text-secondary",
442
567
  children: [
443
568
  "Are you sure you want to delete",
444
569
  " ",
445
- /* @__PURE__ */ N("span", {
570
+ /* @__PURE__ */ k("span", {
446
571
  className: "font-semibold text-text-primary",
447
- children: I?.name
572
+ children: L?.name
448
573
  }),
449
574
  "? This action cannot be undone."
450
575
  ]
@@ -452,178 +577,141 @@ var R = () => {
452
577
  })
453
578
  ]
454
579
  });
455
- }, de = ({ campaign: e, menuOpen: t, onToggleMenu: n, onCloseMenu: r, onManage: i, onEdit: l, onToggleStatus: u, onDuplicate: d, onDelete: f }) => {
456
- j(`ad-campaign-${e.id}`, t, r);
457
- let p = e.budget.total > 0 ? e.budget.spent / e.budget.total * 100 : 0;
458
- return /* @__PURE__ */ P("div", {
459
- className: "rounded-lg border border-border-seam bg-gloss-card shadow-pop p-5",
580
+ }, ve = ({ campaign: e, selected: t, onToggleSelected: n, menuOpen: r, onToggleMenu: i, onCloseMenu: c, onManage: l, onEdit: u, onToggleStatus: d, onDuplicate: f, onDelete: p }) => {
581
+ D(`ad-campaign-${e.id}`, r, c);
582
+ let m = e.budget.total > 0 ? e.budget.spent / e.budget.total * 100 : 0;
583
+ return /* @__PURE__ */ A("tr", {
584
+ className: a("border-b border-border-subtle last:border-b-0 hover:bg-bg-sunken/40", t && "bg-bg-sunken/60"),
460
585
  children: [
461
- /* @__PURE__ */ P("div", {
462
- className: "mb-4 flex items-start justify-between gap-3",
463
- children: [/* @__PURE__ */ P("div", {
464
- className: "min-w-0",
465
- children: [/* @__PURE__ */ P("div", {
466
- className: "mb-1 flex flex-wrap items-center gap-2",
467
- children: [
468
- /* @__PURE__ */ N("button", {
469
- onClick: i,
470
- className: "rounded text-left text-sm font-semibold text-text-primary hover:underline focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]",
471
- children: e.name
472
- }),
473
- /* @__PURE__ */ N("span", {
474
- className: a("rounded-full px-2.5 py-0.5 text-xs font-medium", I[e.platform]),
475
- children: F[e.platform]
476
- }),
477
- /* @__PURE__ */ N(m, { status: e.status })
478
- ]
479
- }), /* @__PURE__ */ P("p", {
480
- className: "text-xs text-text-secondary",
481
- children: [
482
- e.adFormat,
483
- " · ",
484
- e.bidStrategy,
485
- " ·",
486
- " ",
487
- e.startDate,
488
- " to ",
489
- e.endDate
490
- ]
586
+ /* @__PURE__ */ k("td", {
587
+ className: "px-4 py-3",
588
+ children: /* @__PURE__ */ k("input", {
589
+ type: "checkbox",
590
+ "aria-label": `Select ${e.name}`,
591
+ checked: t,
592
+ onChange: n,
593
+ className: "h-4 w-4 rounded border-border-subtle"
594
+ })
595
+ }),
596
+ /* @__PURE__ */ A("td", {
597
+ className: "px-3 py-3",
598
+ children: [/* @__PURE__ */ k("button", {
599
+ onClick: l,
600
+ className: "block max-w-[260px] truncate rounded text-left font-medium text-text-primary hover:underline focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]",
601
+ children: e.name
602
+ }), /* @__PURE__ */ A("div", {
603
+ className: "mt-1 flex items-center gap-1.5 text-xs text-text-secondary",
604
+ children: [/* @__PURE__ */ k("span", { children: "Sync:" }), /* @__PURE__ */ k(h, {
605
+ status: e.syncStatus,
606
+ className: "px-1.5 py-0 text-[10px]"
607
+ })]
608
+ })]
609
+ }),
610
+ /* @__PURE__ */ k("td", {
611
+ className: "px-3 py-3",
612
+ children: /* @__PURE__ */ A("span", {
613
+ className: "inline-flex items-center gap-2 whitespace-nowrap text-text-primary",
614
+ children: [v(e.platform, "h-4 w-4 shrink-0"), _(e.platform)]
615
+ })
616
+ }),
617
+ /* @__PURE__ */ k("td", {
618
+ className: "px-3 py-3",
619
+ children: /* @__PURE__ */ k(h, { status: e.status })
620
+ }),
621
+ /* @__PURE__ */ k("td", {
622
+ className: "whitespace-nowrap px-3 py-3 text-right tabular-nums text-text-primary",
623
+ children: e.dailyBudget > 0 ? o(e.dailyBudget) : "—"
624
+ }),
625
+ /* @__PURE__ */ k("td", {
626
+ className: "px-3 py-3",
627
+ children: /* @__PURE__ */ A("div", {
628
+ className: "flex items-center gap-2",
629
+ children: [/* @__PURE__ */ k("span", {
630
+ className: "whitespace-nowrap tabular-nums text-text-primary",
631
+ children: o(e.budget.spent)
632
+ }), /* @__PURE__ */ k("div", {
633
+ className: "h-1.5 w-16 overflow-hidden rounded-full bg-bg-sunken",
634
+ role: "progressbar",
635
+ "aria-label": `Budget used for ${e.name}`,
636
+ "aria-valuemin": 0,
637
+ "aria-valuemax": 100,
638
+ "aria-valuenow": Math.round(Math.min(m, 100)),
639
+ children: /* @__PURE__ */ k("div", {
640
+ className: a("h-full rounded-full", m > 90 ? "bg-status-error-text" : m > 70 ? "bg-status-warning-text" : "bg-status-success-text"),
641
+ style: { width: `${Math.min(m, 100)}%` }
642
+ })
491
643
  })]
492
- }), /* @__PURE__ */ P("div", {
493
- className: "relative shrink-0",
494
- children: [/* @__PURE__ */ N("button", {
495
- onClick: n,
644
+ })
645
+ }),
646
+ /* @__PURE__ */ k("td", {
647
+ className: "px-3 py-3 text-right tabular-nums text-text-primary",
648
+ children: s(e.metrics.impressions)
649
+ }),
650
+ /* @__PURE__ */ k("td", {
651
+ className: "px-3 py-3 text-right tabular-nums text-text-primary",
652
+ children: s(e.metrics.clicks)
653
+ }),
654
+ /* @__PURE__ */ k("td", {
655
+ className: "px-3 py-3 text-right tabular-nums text-text-primary",
656
+ children: ee(e.metrics.ctr, 2)
657
+ }),
658
+ /* @__PURE__ */ A("td", {
659
+ className: "px-3 py-3 text-right tabular-nums text-text-primary",
660
+ children: [e.metrics.roas.toFixed(1), "x"]
661
+ }),
662
+ /* @__PURE__ */ k("td", {
663
+ className: "px-3 py-3",
664
+ children: /* @__PURE__ */ A("div", {
665
+ className: "relative flex justify-end",
666
+ children: [/* @__PURE__ */ k("button", {
667
+ onClick: i,
496
668
  "aria-haspopup": "menu",
497
- "aria-expanded": t,
498
- "aria-label": "Campaign actions",
499
- className: "rounded-md p-1.5 text-text-secondary hover:text-text-primary hover:bg-bg-sunken",
500
- children: /* @__PURE__ */ N(S, { className: "h-4 w-4" })
501
- }), t && /* @__PURE__ */ P("div", {
669
+ "aria-expanded": r,
670
+ "aria-label": `Actions for ${e.name}`,
671
+ className: "rounded-md p-1.5 text-text-secondary hover:bg-bg-sunken hover:text-text-primary",
672
+ children: /* @__PURE__ */ k(C, { className: "h-4 w-4" })
673
+ }), r && /* @__PURE__ */ A("div", {
502
674
  role: "menu",
503
675
  className: "absolute right-0 top-8 z-20 w-44 rounded-md border border-border-seam bg-gloss-card py-1 shadow-lg",
504
676
  children: [
505
- /* @__PURE__ */ P("button", {
506
- role: "menuitem",
507
- onClick: i,
508
- className: "flex w-full items-center gap-2 px-4 py-2 text-left text-sm text-text-primary hover:bg-bg-sunken",
509
- children: [/* @__PURE__ */ N(O, { className: "h-3.5 w-3.5" }), "Manage"]
510
- }),
511
- /* @__PURE__ */ P("button", {
677
+ /* @__PURE__ */ A("button", {
512
678
  role: "menuitem",
513
679
  onClick: l,
514
680
  className: "flex w-full items-center gap-2 px-4 py-2 text-left text-sm text-text-primary hover:bg-bg-sunken",
515
- children: [/* @__PURE__ */ N(T, { className: "h-3.5 w-3.5" }), "Edit"]
681
+ children: [/* @__PURE__ */ k(T, { className: "h-3.5 w-3.5" }), "Manage"]
516
682
  }),
517
- /* @__PURE__ */ N("button", {
683
+ /* @__PURE__ */ A("button", {
518
684
  role: "menuitem",
519
685
  onClick: u,
520
686
  className: "flex w-full items-center gap-2 px-4 py-2 text-left text-sm text-text-primary hover:bg-bg-sunken",
521
- children: e.status === "active" ? /* @__PURE__ */ P(M, { children: [/* @__PURE__ */ N(w, { className: "h-3.5 w-3.5" }), "Pause"] }) : /* @__PURE__ */ P(M, { children: [/* @__PURE__ */ N(E, { className: "h-3.5 w-3.5" }), "Resume"] })
687
+ children: [/* @__PURE__ */ k(fe, { className: "h-3.5 w-3.5" }), "Edit"]
522
688
  }),
523
- /* @__PURE__ */ P("button", {
689
+ /* @__PURE__ */ k("button", {
524
690
  role: "menuitem",
525
691
  onClick: d,
526
692
  className: "flex w-full items-center gap-2 px-4 py-2 text-left text-sm text-text-primary hover:bg-bg-sunken",
527
- children: [/* @__PURE__ */ N(y, { className: "h-3.5 w-3.5" }), "Duplicate"]
693
+ children: e.status === "active" ? /* @__PURE__ */ A(O, { children: [/* @__PURE__ */ k(de, { className: "h-3.5 w-3.5" }), "Pause"] }) : /* @__PURE__ */ A(O, { children: [/* @__PURE__ */ k(pe, { className: "h-3.5 w-3.5" }), "Resume"] })
528
694
  }),
529
- /* @__PURE__ */ P("button", {
695
+ /* @__PURE__ */ A("button", {
530
696
  role: "menuitem",
531
697
  onClick: f,
698
+ className: "flex w-full items-center gap-2 px-4 py-2 text-left text-sm text-text-primary hover:bg-bg-sunken",
699
+ children: [/* @__PURE__ */ k(S, { className: "h-3.5 w-3.5" }), "Duplicate"]
700
+ }),
701
+ /* @__PURE__ */ A("button", {
702
+ role: "menuitem",
703
+ onClick: p,
532
704
  className: "flex w-full items-center gap-2 px-4 py-2 text-left text-sm text-status-error-text hover:bg-bg-sunken",
533
- children: [/* @__PURE__ */ N(k, { className: "h-3.5 w-3.5" }), "Delete"]
705
+ children: [/* @__PURE__ */ k(E, { className: "h-3.5 w-3.5" }), "Delete"]
534
706
  })
535
707
  ]
536
708
  })]
537
- })]
538
- }),
539
- /* @__PURE__ */ P("div", {
540
- className: "mb-4",
541
- children: [/* @__PURE__ */ P("div", {
542
- className: "mb-1 flex items-center justify-between text-xs",
543
- children: [/* @__PURE__ */ P("span", {
544
- className: "text-text-secondary",
545
- children: [
546
- "Budget: ",
547
- o(e.budget.spent),
548
- " /",
549
- " ",
550
- o(e.budget.total)
551
- ]
552
- }), /* @__PURE__ */ P("span", {
553
- className: "text-text-secondary",
554
- children: [p.toFixed(0), "%"]
555
- })]
556
- }), /* @__PURE__ */ N("div", {
557
- className: "h-2 w-full overflow-hidden rounded-full bg-bg-sunken",
558
- children: /* @__PURE__ */ N("div", {
559
- className: a("h-full rounded-full", p > 90 ? "bg-status-error-text" : p > 70 ? "bg-status-warning-text" : "bg-status-success-text"),
560
- style: { width: `${Math.min(p, 100)}%` }
561
- })
562
- })]
563
- }),
564
- /* @__PURE__ */ P("div", {
565
- className: "grid grid-cols-2 gap-3 sm:grid-cols-4 lg:grid-cols-6",
566
- children: [
567
- /* @__PURE__ */ P("div", {
568
- className: "flex items-center gap-2",
569
- children: [/* @__PURE__ */ N(b, { className: "h-3.5 w-3.5 text-text-secondary" }), /* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N("p", {
570
- className: "text-xs text-text-secondary",
571
- children: "Spend"
572
- }), /* @__PURE__ */ N("p", {
573
- className: "text-sm font-medium text-text-primary",
574
- children: o(e.metrics.spend)
575
- })] })]
576
- }),
577
- /* @__PURE__ */ P("div", {
578
- className: "flex items-center gap-2",
579
- children: [/* @__PURE__ */ N(x, { className: "h-3.5 w-3.5 text-text-secondary" }), /* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N("p", {
580
- className: "text-xs text-text-secondary",
581
- children: "Impressions"
582
- }), /* @__PURE__ */ N("p", {
583
- className: "text-sm font-medium text-text-primary",
584
- children: s(e.metrics.impressions)
585
- })] })]
586
- }),
587
- /* @__PURE__ */ P("div", {
588
- className: "flex items-center gap-2",
589
- children: [/* @__PURE__ */ N(C, { className: "h-3.5 w-3.5 text-text-secondary" }), /* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N("p", {
590
- className: "text-xs text-text-secondary",
591
- children: "Clicks"
592
- }), /* @__PURE__ */ N("p", {
593
- className: "text-sm font-medium text-text-primary",
594
- children: s(e.metrics.clicks)
595
- })] })]
596
- }),
597
- /* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N("p", {
598
- className: "text-xs text-text-secondary",
599
- children: "CTR"
600
- }), /* @__PURE__ */ N("p", {
601
- className: "text-sm font-medium text-text-primary",
602
- children: c(e.metrics.ctr)
603
- })] }),
604
- /* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N("p", {
605
- className: "text-xs text-text-secondary",
606
- children: "CPC"
607
- }), /* @__PURE__ */ P("p", {
608
- className: "text-sm font-medium text-text-primary",
609
- children: ["$", e.metrics.cpc.toFixed(2)]
610
- })] }),
611
- /* @__PURE__ */ P("div", {
612
- className: "flex items-center gap-2",
613
- children: [/* @__PURE__ */ N(A, { className: "h-3.5 w-3.5 text-text-secondary" }), /* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N("p", {
614
- className: "text-xs text-text-secondary",
615
- children: "ROAS"
616
- }), /* @__PURE__ */ P("p", {
617
- className: "text-sm font-medium text-text-primary",
618
- children: [e.metrics.roas.toFixed(1), "x"]
619
- })] })]
620
- })
621
- ]
709
+ })
622
710
  })
623
711
  ]
624
712
  });
625
713
  };
626
714
  //#endregion
627
- export { R as AdCampaignsPage };
715
+ export { M as AdCampaignsPage };
628
716
 
629
717
  //# sourceMappingURL=AdCampaignsPage.js.map