@burdenoff/microfe-headshotmarketing 2026.1101.1 → 2026.1102.1

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.
@@ -3,42 +3,53 @@ import { useHeadshotMarketing as r } from "../../context/HeadshotMarketingContex
3
3
  import { cn as i, formatCurrency as a, formatNumber as o } from "../../utils/helpers.js";
4
4
  import { PageLayout as ee } from "../../components/PageLayout.js";
5
5
  import "../../components/index.js";
6
- import { AdPlatformChips as s, platformLabel as c, renderPlatformIcon as l } from "./AdPlatformChips.js";
7
- import { AdReachEstimatePanel as te } from "./AdReachEstimatePanel.js";
8
- import { AD_AGE_RANGES as ne, AD_BID_STRATEGIES as re, AD_CAMPAIGN_STEPS as u, AD_GENDERS as ie, AD_INTEREST_OPTIONS as ae, AD_OBJECTIVES as oe, EMPTY_AD_CAMPAIGN_FORM as d, buildAdCampaignInput as f, deriveDailyBudget as p, isStepComplete as m, parseAmount as h, scheduleDays as se, validateAdCampaignForm as ce } from "./adCampaignStepper.js";
9
- import { useCallback as le, useEffect as ue, useRef as de, useState as g } from "react";
10
- import { ArrowLeft as _, CalendarDays as fe, Check as pe, Rocket as v, Save as y, Sparkles as me, Target as he, Users as ge, Wallet as _e } from "lucide-react";
11
- import { useSearchParams as ve } from "react-router";
12
- import { Fragment as ye, jsx as b, jsxs as x } from "react/jsx-runtime";
13
- import { EmphasisPanel as S, GlassCard as be, PagePurpose as xe } from "@burdenoff/fe-libs/ui";
6
+ import { AdPlatformChips as te, platformLabel as s, renderPlatformIcon as c } from "./AdPlatformChips.js";
7
+ import { AdReachEstimatePanel as ne } from "./AdReachEstimatePanel.js";
8
+ import { useCampaignOptions as re } from "../../hooks/useCampaignOptions.js";
9
+ import { AD_AGE_RANGES as ie, AD_BID_STRATEGIES as ae, AD_CAMPAIGN_STEPS as l, AD_GENDERS as u, AD_INTEREST_OPTIONS as oe, AD_OBJECTIVES as se, EMPTY_AD_CAMPAIGN_FORM as ce, buildAdCampaignInput as le, deriveDailyBudget as ue, isStepComplete as d, parseAmount as f, scheduleDays as p, validateAdCampaignForm as m } from "./adCampaignStepper.js";
10
+ import { useCallback as de, useEffect as fe, useRef as pe, useState as h } from "react";
11
+ import { ArrowLeft as me, CalendarDays as he, Check as ge, Rocket as _e, Save as ve, Sparkles as ye, Target as be, Users as xe, Wallet as Se } from "lucide-react";
12
+ import { useSearchParams as Ce } from "react-router";
13
+ import { Fragment as we, jsx as g, jsxs as _ } from "react/jsx-runtime";
14
+ import { EmphasisPanel as v, GlassCard as Te, PagePurpose as Ee } from "@burdenoff/fe-libs/ui";
14
15
  //#region src/headshotmarketing/pages/ads/CreateAdCampaignPage.tsx
15
- var C = "w-full rounded-md border border-border-subtle bg-bg-surface px-4 py-2.5 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)] disabled:opacity-60", w = (e) => i("min-h-9 rounded-full border px-3 py-1.5 text-sm transition-colors", e ? "border-action-primary-bg bg-action-primary-bg text-action-primary-text" : "border-border-subtle text-text-primary hover:bg-bg-sunken"), T = (e) => `ad-create-step-${e}`, E = () => {
16
- let { navigate: S, basePath: T } = r(), [E] = ve(), j = E.get("audienceId"), M = E.get("audienceName"), [Se, { loading: N, error: Ce }] = t(), [we, P] = g(null), [F, I] = g(null), [L, R] = g("platform"), [z, B] = g({
17
- ...d,
18
- audienceId: j ?? ""
19
- }), V = de({}), H = (e, t) => B((n) => ({
16
+ var y = "w-full rounded-md border border-border-subtle bg-bg-surface px-4 py-2.5 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)] disabled:opacity-60", b = (e) => i("min-h-9 rounded-full border px-3 py-1.5 text-sm transition-colors", e ? "border-action-primary-bg bg-action-primary-bg text-action-primary-text" : "border-border-subtle text-text-primary hover:bg-bg-sunken"), x = (e) => `ad-create-step-${e}`, S = () => {
17
+ let { navigate: v, basePath: x } = r(), [S] = Ce(), D = S.get("audienceId"), O = S.get("audienceName"), k = S.get("campaignId"), A = S.get("campaignName"), [De, { loading: j, error: Oe }] = t(), [ke, M] = h(null), [N, P] = h(null), [F, I] = h("platform"), [L, R] = h({
18
+ ...ce,
19
+ audienceId: D ?? "",
20
+ campaignId: k ?? ""
21
+ }), [z, Ae] = h(k ? {
22
+ id: k,
23
+ name: A || "Selected campaign"
24
+ } : null), B = re(z), je = (e) => {
25
+ let t = B.options.find((t) => t.id === e) ?? null;
26
+ Ae(t), R((e) => ({
27
+ ...e,
28
+ campaignId: t?.id ?? ""
29
+ }));
30
+ }, V = pe({}), H = (e, t) => R((n) => ({
20
31
  ...n,
21
32
  [e]: t
22
- })), U = (e, t) => B((n) => ({
33
+ })), U = (e, t) => R((n) => ({
23
34
  ...n,
24
35
  [e]: n[e].includes(t) ? n[e].filter((e) => e !== t) : [...n[e], t]
25
- })), { data: Te, loading: W } = n({
36
+ })), { data: Me, loading: W } = n({
26
37
  variables: {
27
38
  limit: 200,
28
39
  offset: 0,
29
40
  search: null
30
41
  },
31
42
  errorPolicy: "all"
32
- }), G = Te?.headshotmarketingAudiences.items ?? [], K = G.find((e) => e.id === z.audienceId) ?? (z.audienceId && M ? {
33
- id: z.audienceId,
34
- name: M,
43
+ }), G = Me?.headshotmarketingAudiences.items ?? [], K = G.find((e) => e.id === L.audienceId) ?? (L.audienceId && O ? {
44
+ id: L.audienceId,
45
+ name: O,
35
46
  estimatedSize: null
36
47
  } : null);
37
- ue(() => {
48
+ fe(() => {
38
49
  if (typeof IntersectionObserver > "u") return;
39
50
  let e = new IntersectionObserver((e) => {
40
51
  let t = e.filter((e) => e.isIntersecting).sort((e, t) => e.boundingClientRect.top - t.boundingClientRect.top)[0]?.target.getAttribute("data-step");
41
- t && R(t);
52
+ t && I(t);
42
53
  }, {
43
54
  rootMargin: "-20% 0px -55% 0px",
44
55
  threshold: 0
@@ -46,458 +57,511 @@ var C = "w-full rounded-md border border-border-subtle bg-bg-surface px-4 py-2.5
46
57
  for (let t of Object.values(V.current)) t && e.observe(t);
47
58
  return () => e.disconnect();
48
59
  }, []);
49
- let q = le((e) => {
50
- R(e), V.current[e]?.scrollIntoView({
60
+ let q = de((e) => {
61
+ I(e), V.current[e]?.scrollIntoView({
51
62
  behavior: "smooth",
52
63
  block: "start"
53
64
  });
54
65
  }, []), J = (e) => (t) => {
55
66
  t && (V.current[e] = t);
56
- }, Y = h(z.dailyBudget), X = h(z.totalBudget), Z = se(z), Q = async (t) => {
57
- let n = ce(z);
67
+ }, Y = f(L.dailyBudget), X = f(L.totalBudget), Z = p(L), Q = async (t) => {
68
+ let n = m(L);
58
69
  if (n) {
59
- P(n.message), q(n.step);
70
+ M(n.message), q(n.step);
60
71
  return;
61
72
  }
62
- P(null), I(t);
73
+ M(null), P(t);
63
74
  try {
64
- await Se({
65
- variables: { input: f(z, t) },
75
+ await De({
76
+ variables: { input: le(L, t) },
66
77
  refetchQueries: [{
67
78
  query: e,
68
79
  variables: { limit: 200 }
69
80
  }],
70
81
  awaitRefetchQueries: !0
71
- }), S(T + "/ads/campaigns");
82
+ }), v(x + "/ads/campaigns");
72
83
  } catch (e) {
73
- P(e instanceof Error ? e.message : "Failed to create ad campaign.");
84
+ M(e instanceof Error ? e.message : "Failed to create ad campaign.");
74
85
  } finally {
75
- I(null);
86
+ P(null);
76
87
  }
77
- }, $ = we ?? Ce?.message ?? null, Ee = u.findIndex((e) => e.key === L);
78
- return /* @__PURE__ */ x(ee, {
88
+ }, $ = ke ?? Oe?.message ?? null, Ne = l.findIndex((e) => e.key === F);
89
+ return /* @__PURE__ */ _(ee, {
79
90
  title: "Create Ad Campaign",
80
- header: /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ x("nav", {
91
+ header: /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ _("nav", {
81
92
  "aria-label": "Breadcrumb",
82
93
  className: "text-sm text-text-secondary",
83
94
  children: [
84
- /* @__PURE__ */ b("button", {
95
+ /* @__PURE__ */ g("button", {
85
96
  type: "button",
86
- onClick: () => S(T + "/ads/campaigns"),
97
+ onClick: () => v(x + "/ads/campaigns"),
87
98
  className: "text-action-primary-bg hover:underline",
88
99
  children: "Ads"
89
100
  }),
90
- /* @__PURE__ */ b("span", {
101
+ /* @__PURE__ */ g("span", {
91
102
  className: "mx-2",
92
103
  children: "/"
93
104
  }),
94
- /* @__PURE__ */ b("span", { children: "New Ad Campaign" })
105
+ /* @__PURE__ */ g("span", { children: "New Ad Campaign" })
95
106
  ]
96
- }), /* @__PURE__ */ b("p", {
107
+ }), /* @__PURE__ */ g("p", {
97
108
  "aria-hidden": "true",
98
109
  className: "mt-1 text-2xl font-bold tracking-tight text-text-primary",
99
110
  children: "Create Ad Campaign"
100
111
  })] }),
101
112
  children: [
102
- /* @__PURE__ */ b(xe, { children: "Set up a paid campaign on one page — pick the platform, objective, budget and audience, then review everything before saving it as a draft or launching it." }),
103
- /* @__PURE__ */ b("nav", {
113
+ /* @__PURE__ */ g(Ee, { children: "Set up a paid campaign on one page — pick the platform, objective, budget and audience, then review everything before saving it as a draft or launching it." }),
114
+ /* @__PURE__ */ g("nav", {
104
115
  "aria-label": "Campaign setup steps",
105
116
  className: "sticky top-0 z-10 -mx-1 overflow-x-auto border-b border-border-seam bg-bg-canvas/95 px-1 py-3 backdrop-blur",
106
- children: /* @__PURE__ */ b("ol", {
117
+ children: /* @__PURE__ */ g("ol", {
107
118
  className: "flex min-w-max items-center gap-2",
108
- children: u.map((e, t) => {
109
- let n = m(e.key, z), r = e.key === L;
110
- return /* @__PURE__ */ x("li", {
119
+ children: l.map((e, t) => {
120
+ let n = d(e.key, L), r = e.key === F;
121
+ return /* @__PURE__ */ _("li", {
111
122
  className: "flex items-center gap-2",
112
- children: [/* @__PURE__ */ x("button", {
123
+ children: [/* @__PURE__ */ _("button", {
113
124
  type: "button",
114
125
  onClick: () => q(e.key),
115
126
  "aria-current": r ? "step" : void 0,
116
127
  className: i("inline-flex min-h-9 items-center gap-2 rounded-full px-3 py-1.5 text-sm transition-colors", r ? "font-semibold text-text-primary" : "text-text-secondary hover:text-text-primary"),
117
- children: [/* @__PURE__ */ b("span", {
128
+ children: [/* @__PURE__ */ g("span", {
118
129
  className: i("flex h-5 w-5 items-center justify-center rounded-full text-xs", n ? "bg-action-primary-bg text-action-primary-text" : r ? "border border-action-primary-bg text-action-primary-bg" : "border border-border-subtle"),
119
- children: n ? /* @__PURE__ */ b(pe, { className: "h-3 w-3" }) : t + 1
130
+ children: n ? /* @__PURE__ */ g(ge, { className: "h-3 w-3" }) : t + 1
120
131
  }), e.label]
121
- }), t < u.length - 1 && /* @__PURE__ */ b("span", {
132
+ }), t < l.length - 1 && /* @__PURE__ */ g("span", {
122
133
  "aria-hidden": "true",
123
- className: i("h-0.5 w-10 rounded-full sm:w-20", t < Ee || n ? "bg-action-primary-bg" : "bg-border-subtle")
134
+ className: i("h-0.5 w-10 rounded-full sm:w-20", t < Ne || n ? "bg-action-primary-bg" : "bg-border-subtle")
124
135
  })]
125
136
  }, e.key);
126
137
  })
127
138
  })
128
139
  }),
129
- /* @__PURE__ */ x("div", {
140
+ /* @__PURE__ */ _("div", {
130
141
  className: "grid gap-6 lg:grid-cols-[minmax(0,1fr)_320px]",
131
- children: [/* @__PURE__ */ x("div", {
142
+ children: [/* @__PURE__ */ _("div", {
132
143
  className: "min-w-0 space-y-6",
133
144
  children: [
134
- /* @__PURE__ */ x(D, {
145
+ /* @__PURE__ */ _(C, {
135
146
  step: "platform",
136
147
  index: 1,
137
148
  title: "Platform",
138
149
  register: J("platform"),
139
150
  children: [
140
- /* @__PURE__ */ b(O, {
151
+ /* @__PURE__ */ g(w, {
141
152
  label: "Campaign name",
142
153
  htmlFor: "ad-name",
143
- children: /* @__PURE__ */ b("input", {
154
+ children: /* @__PURE__ */ g("input", {
144
155
  id: "ad-name",
145
156
  type: "text",
146
- value: z.name,
157
+ value: L.name,
147
158
  onChange: (e) => H("name", e.target.value),
148
159
  placeholder: "e.g., Search - Brand Terms",
149
- className: C
160
+ className: y
150
161
  })
151
162
  }),
152
- /* @__PURE__ */ b(O, {
163
+ /* @__PURE__ */ g(w, {
153
164
  label: "Platform",
154
- children: /* @__PURE__ */ b(s, {
155
- value: z.platform,
165
+ children: /* @__PURE__ */ g(te, {
166
+ value: L.platform,
156
167
  onChange: (e) => H("platform", e)
157
168
  })
158
169
  }),
159
- /* @__PURE__ */ b(O, {
170
+ /* @__PURE__ */ g(w, {
160
171
  label: "Platform campaign ID",
161
172
  optional: !0,
162
173
  htmlFor: "ad-platform-campaign-id",
163
174
  hint: "Link an existing campaign on the ad platform so status, spend and performance sync back automatically.",
164
- children: /* @__PURE__ */ b("input", {
175
+ children: /* @__PURE__ */ g("input", {
165
176
  id: "ad-platform-campaign-id",
166
177
  type: "text",
167
- value: z.platformCampaignId,
178
+ value: L.platformCampaignId,
168
179
  onChange: (e) => H("platformCampaignId", e.target.value),
169
180
  placeholder: "e.g., 120200000001",
170
- className: C
181
+ className: y
171
182
  })
172
183
  })
173
184
  ]
174
185
  }),
175
- /* @__PURE__ */ x(D, {
186
+ /* @__PURE__ */ _(C, {
176
187
  step: "objective",
177
188
  index: 2,
178
189
  title: "Objective",
179
190
  register: J("objective"),
180
- children: [/* @__PURE__ */ b(O, {
181
- label: "Objective",
182
- htmlFor: "ad-objective",
183
- children: /* @__PURE__ */ x("select", {
184
- id: "ad-objective",
185
- value: z.objective,
186
- onChange: (e) => H("objective", e.target.value),
187
- className: C,
188
- children: [/* @__PURE__ */ b("option", {
189
- value: "",
190
- children: "Select an objective"
191
- }), oe.map((e) => /* @__PURE__ */ b("option", {
192
- value: e,
193
- children: e
194
- }, e))]
195
- })
196
- }), /* @__PURE__ */ b(O, {
197
- label: "Description",
198
- optional: !0,
199
- htmlFor: "ad-description",
200
- children: /* @__PURE__ */ b("textarea", {
201
- id: "ad-description",
202
- value: z.description,
203
- onChange: (e) => H("description", e.target.value),
204
- rows: 3,
205
- placeholder: "Describe your campaign goals...",
206
- className: i(C, "resize-none")
191
+ children: [
192
+ /* @__PURE__ */ g(w, {
193
+ label: "Objective",
194
+ htmlFor: "ad-objective",
195
+ children: /* @__PURE__ */ _("select", {
196
+ id: "ad-objective",
197
+ value: L.objective,
198
+ onChange: (e) => H("objective", e.target.value),
199
+ className: y,
200
+ children: [/* @__PURE__ */ g("option", {
201
+ value: "",
202
+ children: "Select an objective"
203
+ }), se.map((e) => /* @__PURE__ */ g("option", {
204
+ value: e,
205
+ children: e
206
+ }, e))]
207
+ })
208
+ }),
209
+ /* @__PURE__ */ _(w, {
210
+ label: "Marketing campaign",
211
+ optional: !0,
212
+ htmlFor: "ad-marketing-campaign",
213
+ hint: "Link this ad campaign to a marketing campaign so clicks on its tracked links, and the leads they bring in, count in that campaign's attribution.",
214
+ children: [
215
+ /* @__PURE__ */ _("div", {
216
+ className: "flex flex-col gap-2 sm:flex-row",
217
+ children: [/* @__PURE__ */ g("input", {
218
+ type: "search",
219
+ "aria-label": "Search marketing campaigns",
220
+ "data-testid": "ad-marketing-campaign-search",
221
+ placeholder: "Search campaigns…",
222
+ value: B.search,
223
+ onChange: (e) => B.setSearch(e.target.value),
224
+ className: i(y, "sm:max-w-xs")
225
+ }), /* @__PURE__ */ _("select", {
226
+ id: "ad-marketing-campaign",
227
+ "data-testid": "ad-marketing-campaign",
228
+ value: L.campaignId,
229
+ onChange: (e) => je(e.target.value),
230
+ className: y,
231
+ children: [/* @__PURE__ */ g("option", {
232
+ value: "",
233
+ children: B.loading && B.options.length === 0 ? "Loading campaigns…" : "Not linked to a marketing campaign"
234
+ }), B.options.map((e) => /* @__PURE__ */ g("option", {
235
+ value: e.id,
236
+ children: e.name
237
+ }, e.id))]
238
+ })]
239
+ }),
240
+ B.hasMore && /* @__PURE__ */ g("button", {
241
+ type: "button",
242
+ onClick: () => void B.loadMore(),
243
+ disabled: B.loadingMore,
244
+ "data-testid": "ad-marketing-campaign-more",
245
+ className: "mt-2 rounded-md border border-border-subtle px-2.5 py-1.5 text-xs font-medium text-text-primary hover:bg-bg-sunken disabled:opacity-60",
246
+ children: B.loadingMore ? "Loading…" : `More campaigns (${o(B.loadedCount)} of ${o(B.total)})`
247
+ }),
248
+ B.error && /* @__PURE__ */ _("p", {
249
+ role: "alert",
250
+ className: "mt-1.5 text-xs text-status-error-text",
251
+ children: ["Could not load campaigns: ", B.error.message]
252
+ })
253
+ ]
254
+ }),
255
+ /* @__PURE__ */ g(w, {
256
+ label: "Description",
257
+ optional: !0,
258
+ htmlFor: "ad-description",
259
+ children: /* @__PURE__ */ g("textarea", {
260
+ id: "ad-description",
261
+ value: L.description,
262
+ onChange: (e) => H("description", e.target.value),
263
+ rows: 3,
264
+ placeholder: "Describe your campaign goals...",
265
+ className: i(y, "resize-none")
266
+ })
207
267
  })
208
- })]
268
+ ]
209
269
  }),
210
- /* @__PURE__ */ x(D, {
270
+ /* @__PURE__ */ _(C, {
211
271
  step: "budget",
212
272
  index: 3,
213
273
  title: "Budget",
214
274
  register: J("budget"),
215
275
  children: [
216
- /* @__PURE__ */ x("div", {
276
+ /* @__PURE__ */ _("div", {
217
277
  className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
218
- children: [/* @__PURE__ */ b(O, {
278
+ children: [/* @__PURE__ */ g(w, {
219
279
  label: "Daily budget (USD)",
220
280
  htmlFor: "ad-daily-budget",
221
- children: /* @__PURE__ */ b("input", {
281
+ children: /* @__PURE__ */ g("input", {
222
282
  id: "ad-daily-budget",
223
283
  type: "number",
224
284
  min: 0,
225
- value: z.dailyBudget,
285
+ value: L.dailyBudget,
226
286
  onChange: (e) => H("dailyBudget", e.target.value),
227
287
  placeholder: "500",
228
- className: C
288
+ className: y
229
289
  })
230
- }), /* @__PURE__ */ b(O, {
290
+ }), /* @__PURE__ */ g(w, {
231
291
  label: "Total budget (USD)",
232
292
  htmlFor: "ad-total-budget",
233
- children: /* @__PURE__ */ b("input", {
293
+ children: /* @__PURE__ */ g("input", {
234
294
  id: "ad-total-budget",
235
295
  type: "number",
236
296
  min: 0,
237
- value: z.totalBudget,
297
+ value: L.totalBudget,
238
298
  onChange: (e) => H("totalBudget", e.target.value),
239
299
  placeholder: "15000",
240
- className: C
300
+ className: y
241
301
  })
242
302
  })]
243
303
  }),
244
- /* @__PURE__ */ x("div", {
304
+ /* @__PURE__ */ _("div", {
245
305
  className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
246
- children: [/* @__PURE__ */ b(O, {
306
+ children: [/* @__PURE__ */ g(w, {
247
307
  label: "Bid strategy",
248
308
  htmlFor: "ad-bid-strategy",
249
- children: /* @__PURE__ */ b("select", {
309
+ children: /* @__PURE__ */ g("select", {
250
310
  id: "ad-bid-strategy",
251
- value: z.bidStrategy,
311
+ value: L.bidStrategy,
252
312
  onChange: (e) => H("bidStrategy", e.target.value),
253
- className: C,
254
- children: re.map((e) => /* @__PURE__ */ b("option", {
313
+ className: y,
314
+ children: ae.map((e) => /* @__PURE__ */ g("option", {
255
315
  value: e,
256
316
  children: e
257
317
  }, e))
258
318
  })
259
- }), /* @__PURE__ */ x("div", {
319
+ }), /* @__PURE__ */ _("div", {
260
320
  className: "grid grid-cols-2 gap-3",
261
- children: [/* @__PURE__ */ b(O, {
321
+ children: [/* @__PURE__ */ g(w, {
262
322
  label: "Start date",
263
323
  htmlFor: "ad-start-date",
264
- children: /* @__PURE__ */ b("input", {
324
+ children: /* @__PURE__ */ g("input", {
265
325
  id: "ad-start-date",
266
326
  type: "date",
267
- value: z.startDate,
327
+ value: L.startDate,
268
328
  onChange: (e) => H("startDate", e.target.value),
269
- className: C
329
+ className: y
270
330
  })
271
- }), /* @__PURE__ */ b(O, {
331
+ }), /* @__PURE__ */ g(w, {
272
332
  label: "End date",
273
333
  htmlFor: "ad-end-date",
274
- children: /* @__PURE__ */ b("input", {
334
+ children: /* @__PURE__ */ g("input", {
275
335
  id: "ad-end-date",
276
336
  type: "date",
277
- value: z.endDate,
337
+ value: L.endDate,
278
338
  onChange: (e) => H("endDate", e.target.value),
279
- className: C
339
+ className: y
280
340
  })
281
341
  })]
282
342
  })]
283
343
  }),
284
- /* @__PURE__ */ b("p", {
344
+ /* @__PURE__ */ g("p", {
285
345
  className: "text-xs text-text-secondary",
286
346
  children: "Set a daily budget, a total budget, or both. The reach estimate uses the daily budget, or spreads the total across the schedule."
287
347
  })
288
348
  ]
289
349
  }),
290
- /* @__PURE__ */ x(D, {
350
+ /* @__PURE__ */ _(C, {
291
351
  step: "audience",
292
352
  index: 4,
293
353
  title: "Audience",
294
354
  register: J("audience"),
295
355
  children: [
296
- /* @__PURE__ */ b(O, {
356
+ /* @__PURE__ */ g(w, {
297
357
  label: "Saved audience",
298
358
  optional: !0,
299
359
  htmlFor: "ad-audience",
300
360
  hint: "Attach an audience you saved earlier, or set the targeting manually below.",
301
- children: /* @__PURE__ */ x("select", {
361
+ children: /* @__PURE__ */ _("select", {
302
362
  id: "ad-audience",
303
- value: z.audienceId,
363
+ value: L.audienceId,
304
364
  onChange: (e) => H("audienceId", e.target.value),
305
365
  disabled: W,
306
- className: C,
307
- children: [/* @__PURE__ */ b("option", {
366
+ className: y,
367
+ children: [/* @__PURE__ */ g("option", {
308
368
  value: "",
309
369
  children: W ? "Loading audiences…" : "No saved audience — target manually below"
310
- }), G.map((e) => /* @__PURE__ */ x("option", {
370
+ }), G.map((e) => /* @__PURE__ */ _("option", {
311
371
  value: e.id,
312
372
  children: [e.name, e.estimatedSize == null ? "" : ` — ${o(e.estimatedSize)} people`]
313
373
  }, e.id))]
314
374
  })
315
375
  }),
316
- /* @__PURE__ */ b(O, {
376
+ /* @__PURE__ */ g(w, {
317
377
  label: "Age range",
318
- children: /* @__PURE__ */ b("div", {
378
+ children: /* @__PURE__ */ g("div", {
319
379
  className: "flex flex-wrap gap-2",
320
- children: ne.map((e) => /* @__PURE__ */ b("button", {
380
+ children: ie.map((e) => /* @__PURE__ */ g("button", {
321
381
  type: "button",
322
- "aria-pressed": z.ages.includes(e),
382
+ "aria-pressed": L.ages.includes(e),
323
383
  onClick: () => U("ages", e),
324
- className: w(z.ages.includes(e)),
384
+ className: b(L.ages.includes(e)),
325
385
  children: e
326
386
  }, e))
327
387
  })
328
388
  }),
329
- /* @__PURE__ */ b(O, {
389
+ /* @__PURE__ */ g(w, {
330
390
  label: "Gender",
331
- children: /* @__PURE__ */ b("div", {
391
+ children: /* @__PURE__ */ g("div", {
332
392
  className: "flex flex-wrap gap-2",
333
- children: ie.map((e) => /* @__PURE__ */ b("button", {
393
+ children: u.map((e) => /* @__PURE__ */ g("button", {
334
394
  type: "button",
335
- "aria-pressed": z.gender === e,
395
+ "aria-pressed": L.gender === e,
336
396
  onClick: () => H("gender", e),
337
- className: w(z.gender === e),
397
+ className: b(L.gender === e),
338
398
  children: e
339
399
  }, e))
340
400
  })
341
401
  }),
342
- /* @__PURE__ */ b(O, {
402
+ /* @__PURE__ */ g(w, {
343
403
  label: "Locations",
344
404
  htmlFor: "ad-locations",
345
- children: /* @__PURE__ */ b("input", {
405
+ children: /* @__PURE__ */ g("input", {
346
406
  id: "ad-locations",
347
407
  type: "text",
348
- value: z.locations,
408
+ value: L.locations,
349
409
  onChange: (e) => H("locations", e.target.value),
350
410
  placeholder: "Enter locations (comma-separated)",
351
- className: C
411
+ className: y
352
412
  })
353
413
  }),
354
- /* @__PURE__ */ b(O, {
414
+ /* @__PURE__ */ g(w, {
355
415
  label: "Interests",
356
- children: /* @__PURE__ */ b("div", {
416
+ children: /* @__PURE__ */ g("div", {
357
417
  className: "flex flex-wrap gap-2",
358
- children: ae.map((e) => /* @__PURE__ */ b("button", {
418
+ children: oe.map((e) => /* @__PURE__ */ g("button", {
359
419
  type: "button",
360
- "aria-pressed": z.interests.includes(e),
420
+ "aria-pressed": L.interests.includes(e),
361
421
  onClick: () => U("interests", e),
362
- className: w(z.interests.includes(e)),
422
+ className: b(L.interests.includes(e)),
363
423
  children: e
364
424
  }, e))
365
425
  })
366
426
  })
367
427
  ]
368
428
  }),
369
- /* @__PURE__ */ b(D, {
429
+ /* @__PURE__ */ g(C, {
370
430
  step: "review",
371
431
  index: 5,
372
432
  title: "Review",
373
433
  register: J("review"),
374
- children: /* @__PURE__ */ x("div", {
434
+ children: /* @__PURE__ */ _("div", {
375
435
  className: "space-y-3",
376
436
  children: [
377
- /* @__PURE__ */ b(k, {
437
+ /* @__PURE__ */ g(T, {
378
438
  label: "Name",
379
- value: z.name || "(Not set)"
439
+ value: L.name || "(Not set)"
380
440
  }),
381
- /* @__PURE__ */ b(k, {
441
+ /* @__PURE__ */ g(T, {
382
442
  label: "Platform",
383
- value: c(z.platform)
443
+ value: s(L.platform)
384
444
  }),
385
- /* @__PURE__ */ b(k, {
445
+ /* @__PURE__ */ g(T, {
386
446
  label: "Platform campaign ID",
387
- value: z.platformCampaignId.trim() || "Not linked"
447
+ value: L.platformCampaignId.trim() || "Not linked"
448
+ }),
449
+ /* @__PURE__ */ g(T, {
450
+ label: "Marketing campaign",
451
+ value: z?.name ?? "Not linked"
388
452
  }),
389
- /* @__PURE__ */ b(k, {
453
+ /* @__PURE__ */ g(T, {
390
454
  label: "Objective",
391
- value: z.objective || "(Not set)"
455
+ value: L.objective || "(Not set)"
392
456
  }),
393
- /* @__PURE__ */ b(k, {
457
+ /* @__PURE__ */ g(T, {
394
458
  label: "Daily budget",
395
459
  value: Y ? a(Y) : "Not set"
396
460
  }),
397
- /* @__PURE__ */ b(k, {
461
+ /* @__PURE__ */ g(T, {
398
462
  label: "Total budget",
399
463
  value: X ? a(X) : "Not set"
400
464
  }),
401
- /* @__PURE__ */ b(k, {
465
+ /* @__PURE__ */ g(T, {
402
466
  label: "Bid strategy",
403
- value: z.bidStrategy
467
+ value: L.bidStrategy
404
468
  }),
405
- /* @__PURE__ */ b(k, {
469
+ /* @__PURE__ */ g(T, {
406
470
  label: "Schedule",
407
- value: z.startDate && z.endDate ? `${z.startDate} to ${z.endDate}` : "(Not set)"
471
+ value: L.startDate && L.endDate ? `${L.startDate} to ${L.endDate}` : "(Not set)"
408
472
  }),
409
- /* @__PURE__ */ b(k, {
473
+ /* @__PURE__ */ g(T, {
410
474
  label: "Audience",
411
475
  value: K?.name ?? "Manual targeting"
412
476
  }),
413
- /* @__PURE__ */ b(k, {
477
+ /* @__PURE__ */ g(T, {
414
478
  label: "Targeting",
415
479
  value: [
416
- z.ages.join(", "),
417
- z.gender,
418
- z.locations,
419
- z.interests.join(", ")
480
+ L.ages.join(", "),
481
+ L.gender,
482
+ L.locations,
483
+ L.interests.join(", ")
420
484
  ].filter(Boolean).join(" · ") || "(Not set)",
421
485
  last: !0
422
486
  })
423
487
  ]
424
488
  })
425
489
  }),
426
- $ && /* @__PURE__ */ b("div", {
490
+ $ && /* @__PURE__ */ g("div", {
427
491
  role: "alert",
428
492
  className: "rounded-lg border border-status-error-border/30 bg-status-error-bg/10 px-4 py-3 text-sm text-status-error-text",
429
493
  children: $
430
494
  })
431
495
  ]
432
- }), /* @__PURE__ */ x("aside", {
496
+ }), /* @__PURE__ */ _("aside", {
433
497
  className: "h-fit space-y-4 lg:sticky lg:top-20",
434
- children: [/* @__PURE__ */ b(te, {
435
- audienceId: z.audienceId || null,
436
- dailyBudget: p(z),
437
- platform: z.platform
438
- }), /* @__PURE__ */ x(be, {
498
+ children: [/* @__PURE__ */ g(ne, {
499
+ audienceId: L.audienceId || null,
500
+ dailyBudget: ue(L),
501
+ platform: L.platform
502
+ }), /* @__PURE__ */ _(Te, {
439
503
  treatment: "insight",
440
504
  className: "space-y-4 p-5",
441
505
  children: [
442
- /* @__PURE__ */ x("div", {
506
+ /* @__PURE__ */ _("div", {
443
507
  className: "flex items-center gap-2",
444
- children: [/* @__PURE__ */ b(me, { className: "h-4 w-4 text-action-primary-bg" }), /* @__PURE__ */ b("h3", {
508
+ children: [/* @__PURE__ */ g(ye, { className: "h-4 w-4 text-action-primary-bg" }), /* @__PURE__ */ g("h3", {
445
509
  className: "text-sm font-semibold text-text-primary",
446
510
  children: "Campaign summary"
447
511
  })]
448
512
  }),
449
- /* @__PURE__ */ x("div", {
513
+ /* @__PURE__ */ _("div", {
450
514
  className: "rounded-lg border border-border-seam bg-accent-wash p-4",
451
- children: [/* @__PURE__ */ b("p", {
515
+ children: [/* @__PURE__ */ g("p", {
452
516
  className: "text-xs text-text-secondary",
453
517
  children: "Estimated audience size"
454
- }), K && K.estimatedSize != null ? /* @__PURE__ */ x(ye, { children: [/* @__PURE__ */ x("div", {
518
+ }), K && K.estimatedSize != null ? /* @__PURE__ */ _(we, { children: [/* @__PURE__ */ _("div", {
455
519
  className: "mt-1 flex items-baseline gap-2",
456
520
  children: [
457
- /* @__PURE__ */ b(ge, { className: "h-5 w-5 shrink-0 text-action-primary-bg" }),
458
- /* @__PURE__ */ b("span", {
521
+ /* @__PURE__ */ g(xe, { className: "h-5 w-5 shrink-0 text-action-primary-bg" }),
522
+ /* @__PURE__ */ g("span", {
459
523
  className: "text-2xl font-bold text-text-primary",
460
524
  children: o(K.estimatedSize)
461
525
  }),
462
- /* @__PURE__ */ b("span", {
526
+ /* @__PURE__ */ g("span", {
463
527
  className: "text-xs text-text-secondary",
464
528
  children: "people"
465
529
  })
466
530
  ]
467
- }), /* @__PURE__ */ x("p", {
531
+ }), /* @__PURE__ */ _("p", {
468
532
  className: "mt-1 text-xs text-text-secondary",
469
533
  children: [
470
534
  "from “",
471
535
  K.name,
472
536
  "”"
473
537
  ]
474
- })] }) : /* @__PURE__ */ b("p", {
538
+ })] }) : /* @__PURE__ */ g("p", {
475
539
  className: "mt-1 text-sm text-text-secondary",
476
540
  children: "Attach a saved audience in the Audience step to see its estimated size."
477
541
  })]
478
542
  }),
479
- /* @__PURE__ */ x("dl", {
543
+ /* @__PURE__ */ _("dl", {
480
544
  className: "space-y-3 text-sm",
481
545
  children: [
482
- /* @__PURE__ */ b(A, {
483
- icon: l(z.platform, "h-4 w-4 shrink-0"),
546
+ /* @__PURE__ */ g(E, {
547
+ icon: c(L.platform, "h-4 w-4 shrink-0"),
484
548
  label: "Platform",
485
- value: c(z.platform)
549
+ value: s(L.platform)
486
550
  }),
487
- /* @__PURE__ */ b(A, {
488
- icon: /* @__PURE__ */ b(he, { className: "h-4 w-4 shrink-0" }),
551
+ /* @__PURE__ */ g(E, {
552
+ icon: /* @__PURE__ */ g(be, { className: "h-4 w-4 shrink-0" }),
489
553
  label: "Objective",
490
- value: z.objective || "Not set",
491
- muted: !z.objective
554
+ value: L.objective || "Not set",
555
+ muted: !L.objective
492
556
  }),
493
- /* @__PURE__ */ b(A, {
494
- icon: /* @__PURE__ */ b(_e, { className: "h-4 w-4 shrink-0" }),
557
+ /* @__PURE__ */ g(E, {
558
+ icon: /* @__PURE__ */ g(Se, { className: "h-4 w-4 shrink-0" }),
495
559
  label: "Budget",
496
560
  value: Y ? `${a(Y)} / day` : X ? `${a(X)} total` : "Not set",
497
561
  muted: !Y && !X
498
562
  }),
499
- /* @__PURE__ */ b(A, {
500
- icon: /* @__PURE__ */ b(fe, { className: "h-4 w-4 shrink-0" }),
563
+ /* @__PURE__ */ g(E, {
564
+ icon: /* @__PURE__ */ g(he, { className: "h-4 w-4 shrink-0" }),
501
565
  label: "Schedule",
502
566
  value: Z ? `${Z} day${Z === 1 ? "" : "s"}` : "Not set",
503
567
  muted: !Z
@@ -508,83 +572,83 @@ var C = "w-full rounded-md border border-border-subtle bg-bg-surface px-4 py-2.5
508
572
  })]
509
573
  })]
510
574
  }),
511
- /* @__PURE__ */ x("div", {
575
+ /* @__PURE__ */ _("div", {
512
576
  className: "sticky bottom-0 z-10 -mx-1 flex flex-wrap items-center justify-between gap-3 border-t border-border-seam bg-bg-canvas/95 px-1 py-4 backdrop-blur",
513
- children: [/* @__PURE__ */ x("button", {
577
+ children: [/* @__PURE__ */ _("button", {
514
578
  type: "button",
515
- onClick: () => S(T + "/ads/campaigns"),
579
+ onClick: () => v(x + "/ads/campaigns"),
516
580
  className: "inline-flex min-h-11 items-center gap-2 rounded-md border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken",
517
- children: [/* @__PURE__ */ b(_, { className: "h-4 w-4" }), "Back"]
518
- }), /* @__PURE__ */ x("div", {
581
+ children: [/* @__PURE__ */ g(me, { className: "h-4 w-4" }), "Back"]
582
+ }), /* @__PURE__ */ _("div", {
519
583
  className: "flex items-center gap-2",
520
- children: [/* @__PURE__ */ x("button", {
584
+ children: [/* @__PURE__ */ _("button", {
521
585
  type: "button",
522
586
  onClick: () => Q("draft"),
523
- disabled: N,
587
+ disabled: j,
524
588
  className: "inline-flex min-h-11 items-center gap-2 rounded-md border border-border-strong px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken disabled:opacity-60",
525
- children: [/* @__PURE__ */ b(y, { className: "h-4 w-4" }), F === "draft" ? "Saving…" : "Save Draft"]
526
- }), /* @__PURE__ */ x("button", {
589
+ children: [/* @__PURE__ */ g(ve, { className: "h-4 w-4" }), N === "draft" ? "Saving…" : "Save Draft"]
590
+ }), /* @__PURE__ */ _("button", {
527
591
  type: "button",
528
592
  onClick: () => Q("launch"),
529
- disabled: N,
593
+ disabled: j,
530
594
  className: "inline-flex min-h-11 items-center gap-2 rounded-md bg-action-primary-bg px-5 py-2 text-sm font-semibold text-action-primary-text hover:bg-action-primary-bg/90 disabled:opacity-60",
531
- children: [/* @__PURE__ */ b(v, { className: "h-4 w-4" }), F === "launch" ? "Launching…" : "Launch Campaign"]
595
+ children: [/* @__PURE__ */ g(_e, { className: "h-4 w-4" }), N === "launch" ? "Launching…" : "Launch Campaign"]
532
596
  })]
533
597
  })]
534
598
  })
535
599
  ]
536
600
  });
537
- }, D = ({ step: e, index: t, title: n, register: r, children: i }) => /* @__PURE__ */ b("section", {
538
- id: T(e),
601
+ }, C = ({ step: e, index: t, title: n, register: r, children: i }) => /* @__PURE__ */ g("section", {
602
+ id: x(e),
539
603
  "data-step": e,
540
604
  ref: r,
541
- "aria-labelledby": `${T(e)}-title`,
605
+ "aria-labelledby": `${x(e)}-title`,
542
606
  className: "scroll-mt-24",
543
- children: /* @__PURE__ */ x(S, {
607
+ children: /* @__PURE__ */ _(v, {
544
608
  className: "space-y-5 p-6",
545
- children: [/* @__PURE__ */ x("h2", {
546
- id: `${T(e)}-title`,
609
+ children: [/* @__PURE__ */ _("h2", {
610
+ id: `${x(e)}-title`,
547
611
  className: "flex items-center gap-2 text-base font-semibold text-text-primary",
548
- children: [/* @__PURE__ */ b("span", {
612
+ children: [/* @__PURE__ */ g("span", {
549
613
  className: "flex h-6 w-6 items-center justify-center rounded-full bg-bg-sunken text-xs text-text-secondary",
550
614
  children: t
551
615
  }), n]
552
616
  }), i]
553
617
  })
554
- }), O = ({ label: e, htmlFor: t, optional: n, hint: r, children: i }) => /* @__PURE__ */ x("div", { children: [
555
- /* @__PURE__ */ x("label", {
618
+ }), w = ({ label: e, htmlFor: t, optional: n, hint: r, children: i }) => /* @__PURE__ */ _("div", { children: [
619
+ /* @__PURE__ */ _("label", {
556
620
  htmlFor: t,
557
621
  className: "mb-1.5 block text-sm font-medium text-text-primary",
558
- children: [e, n && /* @__PURE__ */ b("span", {
622
+ children: [e, n && /* @__PURE__ */ g("span", {
559
623
  className: "ml-1 font-normal text-text-secondary",
560
624
  children: "(optional)"
561
625
  })]
562
626
  }),
563
627
  i,
564
- r && /* @__PURE__ */ b("p", {
628
+ r && /* @__PURE__ */ g("p", {
565
629
  className: "mt-1.5 text-xs text-text-secondary",
566
630
  children: r
567
631
  })
568
- ] }), k = ({ label: e, value: t, last: n }) => /* @__PURE__ */ x("div", {
632
+ ] }), T = ({ label: e, value: t, last: n }) => /* @__PURE__ */ _("div", {
569
633
  className: i("flex justify-between gap-4", !n && "border-b border-border-subtle pb-2"),
570
- children: [/* @__PURE__ */ b("span", {
634
+ children: [/* @__PURE__ */ g("span", {
571
635
  className: "text-sm text-text-secondary",
572
636
  children: e
573
- }), /* @__PURE__ */ b("span", {
637
+ }), /* @__PURE__ */ g("span", {
574
638
  className: "text-right text-sm font-medium text-text-primary",
575
639
  children: t
576
640
  })]
577
- }), A = ({ icon: e, label: t, value: n, muted: r }) => /* @__PURE__ */ x("div", {
641
+ }), E = ({ icon: e, label: t, value: n, muted: r }) => /* @__PURE__ */ _("div", {
578
642
  className: "flex items-center justify-between gap-3",
579
- children: [/* @__PURE__ */ x("dt", {
643
+ children: [/* @__PURE__ */ _("dt", {
580
644
  className: "flex items-center gap-2 text-text-secondary",
581
- children: [e, /* @__PURE__ */ b("span", { children: t })]
582
- }), /* @__PURE__ */ b("dd", {
645
+ children: [e, /* @__PURE__ */ g("span", { children: t })]
646
+ }), /* @__PURE__ */ g("dd", {
583
647
  className: i("truncate text-right font-medium", r ? "text-text-secondary" : "text-text-primary"),
584
648
  children: n
585
649
  })]
586
650
  });
587
651
  //#endregion
588
- export { E as CreateAdCampaignPage };
652
+ export { S as CreateAdCampaignPage };
589
653
 
590
654
  //# sourceMappingURL=CreateAdCampaignPage.js.map