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