@burdenoff/microfe-headshotmarketing 2026.703.1 → 2026.704.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.
Files changed (137) hide show
  1. package/dist/generated/wspace-operations.js +970 -52
  2. package/dist/generated/wspace-operations.js.map +1 -1
  3. package/dist/generated/wspace-types.js +26 -10
  4. package/dist/generated/wspace-types.js.map +1 -1
  5. package/dist/headshotmarketing/HeadshotMarketingRoot.js +45 -44
  6. package/dist/headshotmarketing/HeadshotMarketingRoot.js.map +1 -1
  7. package/dist/headshotmarketing/HeadshotMarketingRoutes.js +20 -0
  8. package/dist/headshotmarketing/HeadshotMarketingRoutes.js.map +1 -1
  9. package/dist/headshotmarketing/components/ActionMenu.js +57 -0
  10. package/dist/headshotmarketing/components/ActionMenu.js.map +1 -0
  11. package/dist/headshotmarketing/components/AssetUploadButton.js +47 -0
  12. package/dist/headshotmarketing/components/AssetUploadButton.js.map +1 -0
  13. package/dist/headshotmarketing/components/FilterBar.js.map +1 -1
  14. package/dist/headshotmarketing/components/InfluencerModals.js +606 -0
  15. package/dist/headshotmarketing/components/InfluencerModals.js.map +1 -0
  16. package/dist/headshotmarketing/components/LoadingSkeleton.js +11 -1
  17. package/dist/headshotmarketing/components/LoadingSkeleton.js.map +1 -0
  18. package/dist/headshotmarketing/components/Modal.js +6 -3
  19. package/dist/headshotmarketing/components/Modal.js.map +1 -1
  20. package/dist/headshotmarketing/components/Pagination.js +117 -0
  21. package/dist/headshotmarketing/components/Pagination.js.map +1 -0
  22. package/dist/headshotmarketing/components/QueryStateBoundary.js +46 -0
  23. package/dist/headshotmarketing/components/QueryStateBoundary.js.map +1 -0
  24. package/dist/headshotmarketing/components/StatusBadge.js.map +1 -1
  25. package/dist/headshotmarketing/components/TagChipsInput.js +74 -0
  26. package/dist/headshotmarketing/components/TagChipsInput.js.map +1 -0
  27. package/dist/headshotmarketing/components/index.js +6 -0
  28. package/dist/headshotmarketing/context/HeadshotMarketingContext.js +26 -22
  29. package/dist/headshotmarketing/context/HeadshotMarketingContext.js.map +1 -1
  30. package/dist/headshotmarketing/context/HeadshotmarketingBootstrapContext.js +29 -0
  31. package/dist/headshotmarketing/context/HeadshotmarketingBootstrapContext.js.map +1 -0
  32. package/dist/headshotmarketing/hooks/index.js +4 -0
  33. package/dist/headshotmarketing/hooks/useAssetUpload.js +86 -0
  34. package/dist/headshotmarketing/hooks/useAssetUpload.js.map +1 -0
  35. package/dist/headshotmarketing/hooks/useHeadshotmarketingBootstrap.js +12 -0
  36. package/dist/headshotmarketing/hooks/useHeadshotmarketingBootstrap.js.map +1 -0
  37. package/dist/headshotmarketing/hooks/usePagination.js +53 -0
  38. package/dist/headshotmarketing/hooks/usePagination.js.map +1 -0
  39. package/dist/headshotmarketing/pages/HomePage.js +334 -301
  40. package/dist/headshotmarketing/pages/HomePage.js.map +1 -1
  41. package/dist/headshotmarketing/pages/ads/AdCampaignsPage.js +522 -225
  42. package/dist/headshotmarketing/pages/ads/AdCampaignsPage.js.map +1 -1
  43. package/dist/headshotmarketing/pages/ads/AdCreativesPage.js +749 -147
  44. package/dist/headshotmarketing/pages/ads/AdCreativesPage.js.map +1 -1
  45. package/dist/headshotmarketing/pages/ads/AdsPage.js +197 -188
  46. package/dist/headshotmarketing/pages/ads/AdsPage.js.map +1 -1
  47. package/dist/headshotmarketing/pages/ads/AudiencesPage.js +583 -147
  48. package/dist/headshotmarketing/pages/ads/AudiencesPage.js.map +1 -1
  49. package/dist/headshotmarketing/pages/ads/CreateAdCampaignPage.js +218 -206
  50. package/dist/headshotmarketing/pages/ads/CreateAdCampaignPage.js.map +1 -1
  51. package/dist/headshotmarketing/pages/analytics/AdAnalyticsPage.js +244 -237
  52. package/dist/headshotmarketing/pages/analytics/AdAnalyticsPage.js.map +1 -1
  53. package/dist/headshotmarketing/pages/analytics/AnalyticsPage.js +278 -272
  54. package/dist/headshotmarketing/pages/analytics/AnalyticsPage.js.map +1 -1
  55. package/dist/headshotmarketing/pages/analytics/CampaignAnalyticsPage.js +197 -193
  56. package/dist/headshotmarketing/pages/analytics/CampaignAnalyticsPage.js.map +1 -1
  57. package/dist/headshotmarketing/pages/analytics/ReportsPage.js +254 -295
  58. package/dist/headshotmarketing/pages/analytics/ReportsPage.js.map +1 -1
  59. package/dist/headshotmarketing/pages/analytics/SocialAnalyticsPage.js +221 -211
  60. package/dist/headshotmarketing/pages/analytics/SocialAnalyticsPage.js.map +1 -1
  61. package/dist/headshotmarketing/pages/automation/AutomationPage.js +239 -168
  62. package/dist/headshotmarketing/pages/automation/AutomationPage.js.map +1 -1
  63. package/dist/headshotmarketing/pages/automation/TriggersPage.js +150 -102
  64. package/dist/headshotmarketing/pages/automation/TriggersPage.js.map +1 -1
  65. package/dist/headshotmarketing/pages/automation/WorkflowActions.js +287 -0
  66. package/dist/headshotmarketing/pages/automation/WorkflowActions.js.map +1 -0
  67. package/dist/headshotmarketing/pages/automation/WorkflowBuilderPage.js +56 -58
  68. package/dist/headshotmarketing/pages/automation/WorkflowBuilderPage.js.map +1 -1
  69. package/dist/headshotmarketing/pages/automation/WorkflowsPage.js +211 -179
  70. package/dist/headshotmarketing/pages/automation/WorkflowsPage.js.map +1 -1
  71. package/dist/headshotmarketing/pages/builder/LandingPageBuilderPage.js +444 -306
  72. package/dist/headshotmarketing/pages/builder/LandingPageBuilderPage.js.map +1 -1
  73. package/dist/headshotmarketing/pages/campaigns/CampaignDetailsPage.js +290 -217
  74. package/dist/headshotmarketing/pages/campaigns/CampaignDetailsPage.js.map +1 -1
  75. package/dist/headshotmarketing/pages/campaigns/CampaignTemplatesPage.js +189 -151
  76. package/dist/headshotmarketing/pages/campaigns/CampaignTemplatesPage.js.map +1 -1
  77. package/dist/headshotmarketing/pages/campaigns/CampaignsPage.js +417 -274
  78. package/dist/headshotmarketing/pages/campaigns/CampaignsPage.js.map +1 -1
  79. package/dist/headshotmarketing/pages/campaigns/CreateCampaignPage.js +345 -260
  80. package/dist/headshotmarketing/pages/campaigns/CreateCampaignPage.js.map +1 -1
  81. package/dist/headshotmarketing/pages/content/AIToolsPage.js +261 -192
  82. package/dist/headshotmarketing/pages/content/AIToolsPage.js.map +1 -1
  83. package/dist/headshotmarketing/pages/content/AssetLibraryPage.js +213 -141
  84. package/dist/headshotmarketing/pages/content/AssetLibraryPage.js.map +1 -1
  85. package/dist/headshotmarketing/pages/content/ContentAnalyticsPage.js +242 -246
  86. package/dist/headshotmarketing/pages/content/ContentAnalyticsPage.js.map +1 -1
  87. package/dist/headshotmarketing/pages/content/ContentCreationPage.js +184 -136
  88. package/dist/headshotmarketing/pages/content/ContentCreationPage.js.map +1 -1
  89. package/dist/headshotmarketing/pages/content/ContentPage.js +208 -159
  90. package/dist/headshotmarketing/pages/content/ContentPage.js.map +1 -1
  91. package/dist/headshotmarketing/pages/crm/ContactsPage.js +336 -265
  92. package/dist/headshotmarketing/pages/crm/ContactsPage.js.map +1 -1
  93. package/dist/headshotmarketing/pages/crm/CreateContactPage.js +76 -87
  94. package/dist/headshotmarketing/pages/crm/CreateContactPage.js.map +1 -1
  95. package/dist/headshotmarketing/pages/crm/CreateDealPage.js +195 -196
  96. package/dist/headshotmarketing/pages/crm/CreateDealPage.js.map +1 -1
  97. package/dist/headshotmarketing/pages/crm/CrmActions.js +663 -0
  98. package/dist/headshotmarketing/pages/crm/CrmActions.js.map +1 -0
  99. package/dist/headshotmarketing/pages/crm/CrmPage.js +237 -207
  100. package/dist/headshotmarketing/pages/crm/CrmPage.js.map +1 -1
  101. package/dist/headshotmarketing/pages/crm/LeadsPage.js +168 -165
  102. package/dist/headshotmarketing/pages/crm/LeadsPage.js.map +1 -1
  103. package/dist/headshotmarketing/pages/crm/PipelinePage.js +189 -178
  104. package/dist/headshotmarketing/pages/crm/PipelinePage.js.map +1 -1
  105. package/dist/headshotmarketing/pages/events/CreateEventPage.js +188 -190
  106. package/dist/headshotmarketing/pages/events/CreateEventPage.js.map +1 -1
  107. package/dist/headshotmarketing/pages/events/EventsPage.js +256 -238
  108. package/dist/headshotmarketing/pages/events/EventsPage.js.map +1 -1
  109. package/dist/headshotmarketing/pages/influencers/InfluencerCampaignsPage.js +195 -167
  110. package/dist/headshotmarketing/pages/influencers/InfluencerCampaignsPage.js.map +1 -1
  111. package/dist/headshotmarketing/pages/influencers/InfluencerDiscoveryPage.js +280 -243
  112. package/dist/headshotmarketing/pages/influencers/InfluencerDiscoveryPage.js.map +1 -1
  113. package/dist/headshotmarketing/pages/influencers/InfluencersPage.js +186 -183
  114. package/dist/headshotmarketing/pages/influencers/InfluencersPage.js.map +1 -1
  115. package/dist/headshotmarketing/pages/influencers/RelationshipsPage.js +303 -231
  116. package/dist/headshotmarketing/pages/influencers/RelationshipsPage.js.map +1 -1
  117. package/dist/headshotmarketing/pages/seo/SeoToolsPage.js +460 -310
  118. package/dist/headshotmarketing/pages/seo/SeoToolsPage.js.map +1 -1
  119. package/dist/headshotmarketing/pages/social-media/AccountsPage.js +318 -104
  120. package/dist/headshotmarketing/pages/social-media/AccountsPage.js.map +1 -1
  121. package/dist/headshotmarketing/pages/social-media/ContentCalendarPage.js +266 -255
  122. package/dist/headshotmarketing/pages/social-media/ContentCalendarPage.js.map +1 -1
  123. package/dist/headshotmarketing/pages/social-media/PostsPage.js +365 -202
  124. package/dist/headshotmarketing/pages/social-media/PostsPage.js.map +1 -1
  125. package/dist/headshotmarketing/pages/social-media/SocialMediaComposePage.js +321 -233
  126. package/dist/headshotmarketing/pages/social-media/SocialMediaComposePage.js.map +1 -1
  127. package/dist/headshotmarketing/pages/social-media/SocialMediaPage.js +324 -308
  128. package/dist/headshotmarketing/pages/social-media/SocialMediaPage.js.map +1 -1
  129. package/dist/headshotmarketing/utils/adsMapper.js +74 -51
  130. package/dist/headshotmarketing/utils/adsMapper.js.map +1 -1
  131. package/dist/headshotmarketing/utils/helpers.js +11 -1
  132. package/dist/headshotmarketing/utils/helpers.js.map +1 -1
  133. package/dist/headshotmarketing/utils/influencerMapper.js +1 -0
  134. package/dist/headshotmarketing/utils/influencerMapper.js.map +1 -1
  135. package/package.json +1 -1
  136. package/dist/headshotmarketing/utils/reportMapper.js +0 -33
  137. package/dist/headshotmarketing/utils/reportMapper.js.map +0 -1
@@ -0,0 +1,663 @@
1
+ import { useDeleteHeadshotmarketingContactMutation as e, useDeleteHeadshotmarketingDealMutation as t, useDeleteHeadshotmarketingLeadMutation as n, useUpdateHeadshotmarketingContactMutation as r, useUpdateHeadshotmarketingDealMutation as i, useUpdateHeadshotmarketingLeadMutation as a } from "../../../generated/wspace-operations.js";
2
+ import { cn as o } from "../../utils/helpers.js";
3
+ import { HeadshotmarketingDealStatus as s, HeadshotmarketingLeadSource as c, HeadshotmarketingLeadStatus as l } from "../../../generated/wspace-types.js";
4
+ import { Modal as u } from "../../components/Modal.js";
5
+ import { TagChipsInput as d } from "../../components/TagChipsInput.js";
6
+ import { ActionMenu as f } from "../../components/ActionMenu.js";
7
+ import "../../components/index.js";
8
+ import { useState as p } from "react";
9
+ import { AlertTriangle as m, Pencil as h, Trash2 as g } from "lucide-react";
10
+ import { Fragment as _, jsx as v, jsxs as y } from "react/jsx-runtime";
11
+ //#region src/headshotmarketing/pages/crm/CrmActions.tsx
12
+ var b = "w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]", x = "block text-sm font-medium text-text-primary mb-1", S = ({ message: e }) => e ? /* @__PURE__ */ v("div", {
13
+ className: "rounded-lg border border-status-error-border/30 bg-status-error-bg/10 px-4 py-3 text-sm text-status-error-text",
14
+ children: e
15
+ }) : null, C = ({ open: e, onClose: t, title: n, description: r, saving: i, error: a, onSave: o, children: s }) => /* @__PURE__ */ v(u, {
16
+ open: e,
17
+ onClose: t,
18
+ title: n,
19
+ description: r,
20
+ size: "lg",
21
+ footer: /* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v("button", {
22
+ type: "button",
23
+ onClick: t,
24
+ className: "inline-flex 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",
25
+ children: "Cancel"
26
+ }), /* @__PURE__ */ v("button", {
27
+ type: "button",
28
+ onClick: o,
29
+ disabled: i,
30
+ 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 disabled:opacity-60",
31
+ children: i ? "Saving…" : "Save changes"
32
+ })] }),
33
+ children: /* @__PURE__ */ y("div", {
34
+ className: "space-y-4",
35
+ children: [s, /* @__PURE__ */ v(S, { message: a })]
36
+ })
37
+ }), w = ({ open: e, onClose: t, title: n, message: r, deleting: i, error: a, onConfirm: o }) => /* @__PURE__ */ y(u, {
38
+ open: e,
39
+ onClose: t,
40
+ title: n,
41
+ size: "sm",
42
+ footer: /* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v("button", {
43
+ type: "button",
44
+ onClick: t,
45
+ className: "inline-flex 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",
46
+ children: "Cancel"
47
+ }), /* @__PURE__ */ y("button", {
48
+ type: "button",
49
+ onClick: o,
50
+ disabled: i,
51
+ className: "inline-flex items-center gap-2 rounded-md bg-status-error-text px-4 py-2 text-sm font-medium text-action-primary-text hover:bg-status-error-text/90 disabled:opacity-60",
52
+ children: [/* @__PURE__ */ v(g, { className: "h-4 w-4" }), i ? "Deleting…" : "Delete"]
53
+ })] }),
54
+ children: [/* @__PURE__ */ y("div", {
55
+ className: "flex items-start gap-3",
56
+ children: [/* @__PURE__ */ v(m, {
57
+ className: "mt-0.5 h-5 w-5 flex-shrink-0 text-status-error-text",
58
+ "aria-hidden": "true"
59
+ }), /* @__PURE__ */ v("p", {
60
+ className: "text-sm text-text-secondary",
61
+ children: r
62
+ })]
63
+ }), /* @__PURE__ */ v("div", {
64
+ className: "mt-3",
65
+ children: /* @__PURE__ */ v(S, { message: a })
66
+ })]
67
+ });
68
+ function T(e, t) {
69
+ return [{
70
+ key: "edit",
71
+ label: "Edit",
72
+ onClick: e,
73
+ icon: /* @__PURE__ */ v(h, { className: "h-4 w-4" })
74
+ }, {
75
+ key: "delete",
76
+ label: "Delete",
77
+ onClick: t,
78
+ danger: !0,
79
+ icon: /* @__PURE__ */ v(g, { className: "h-4 w-4" })
80
+ }];
81
+ }
82
+ var E = ({ contact: t, onChanged: n }) => {
83
+ let [i, a] = p(!1), [o, s] = p(!1), [c, l] = p({
84
+ firstName: t.firstName,
85
+ lastName: t.lastName,
86
+ email: t.email,
87
+ phone: t.phone,
88
+ company: t.company,
89
+ title: t.title,
90
+ tags: t.tags
91
+ }), [u, m] = p(null), [h, { loading: g }] = r(), [S, { loading: E }] = e(), D = () => {
92
+ l({
93
+ firstName: t.firstName,
94
+ lastName: t.lastName,
95
+ email: t.email,
96
+ phone: t.phone,
97
+ company: t.company,
98
+ title: t.title,
99
+ tags: t.tags
100
+ }), m(null), a(!0);
101
+ }, O = async () => {
102
+ if (!c.firstName.trim() || !c.lastName.trim()) {
103
+ m("First and last name are required.");
104
+ return;
105
+ }
106
+ m(null);
107
+ try {
108
+ await h({ variables: {
109
+ id: t.id,
110
+ input: {
111
+ firstName: c.firstName,
112
+ lastName: c.lastName,
113
+ email: c.email || null,
114
+ phone: c.phone || null,
115
+ company: c.company || null,
116
+ jobTitle: c.title || null,
117
+ tags: c.tags
118
+ }
119
+ } }), a(!1), n();
120
+ } catch (e) {
121
+ m(e instanceof Error ? e.message : "Failed to update contact.");
122
+ }
123
+ }, k = async () => {
124
+ m(null);
125
+ try {
126
+ await S({ variables: { id: t.id } }), s(!1), n();
127
+ } catch (e) {
128
+ m(e instanceof Error ? e.message : "Failed to delete contact.");
129
+ }
130
+ };
131
+ return /* @__PURE__ */ y(_, { children: [
132
+ /* @__PURE__ */ v(f, {
133
+ id: `contact-actions-${t.id}`,
134
+ buttonLabel: `Actions for ${t.firstName} ${t.lastName}`,
135
+ items: T(D, () => {
136
+ m(null), s(!0);
137
+ })
138
+ }),
139
+ /* @__PURE__ */ y(C, {
140
+ open: i,
141
+ onClose: () => a(!1),
142
+ title: "Edit contact",
143
+ description: "Update this contact's details.",
144
+ saving: g,
145
+ error: u,
146
+ onSave: () => void O(),
147
+ children: [
148
+ /* @__PURE__ */ y("div", {
149
+ className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
150
+ children: [/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("label", {
151
+ className: x,
152
+ children: "First name"
153
+ }), /* @__PURE__ */ v("input", {
154
+ className: b,
155
+ value: c.firstName,
156
+ onChange: (e) => l((t) => ({
157
+ ...t,
158
+ firstName: e.target.value
159
+ }))
160
+ })] }), /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("label", {
161
+ className: x,
162
+ children: "Last name"
163
+ }), /* @__PURE__ */ v("input", {
164
+ className: b,
165
+ value: c.lastName,
166
+ onChange: (e) => l((t) => ({
167
+ ...t,
168
+ lastName: e.target.value
169
+ }))
170
+ })] })]
171
+ }),
172
+ /* @__PURE__ */ y("div", {
173
+ className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
174
+ children: [/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("label", {
175
+ className: x,
176
+ children: "Email"
177
+ }), /* @__PURE__ */ v("input", {
178
+ type: "email",
179
+ className: b,
180
+ value: c.email,
181
+ onChange: (e) => l((t) => ({
182
+ ...t,
183
+ email: e.target.value
184
+ }))
185
+ })] }), /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("label", {
186
+ className: x,
187
+ children: "Phone"
188
+ }), /* @__PURE__ */ v("input", {
189
+ className: b,
190
+ value: c.phone,
191
+ onChange: (e) => l((t) => ({
192
+ ...t,
193
+ phone: e.target.value
194
+ }))
195
+ })] })]
196
+ }),
197
+ /* @__PURE__ */ y("div", {
198
+ className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
199
+ children: [/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("label", {
200
+ className: x,
201
+ children: "Company"
202
+ }), /* @__PURE__ */ v("input", {
203
+ className: b,
204
+ value: c.company,
205
+ onChange: (e) => l((t) => ({
206
+ ...t,
207
+ company: e.target.value
208
+ }))
209
+ })] }), /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("label", {
210
+ className: x,
211
+ children: "Title"
212
+ }), /* @__PURE__ */ v("input", {
213
+ className: b,
214
+ value: c.title,
215
+ onChange: (e) => l((t) => ({
216
+ ...t,
217
+ title: e.target.value
218
+ }))
219
+ })] })]
220
+ }),
221
+ /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("label", {
222
+ className: x,
223
+ children: "Tags"
224
+ }), /* @__PURE__ */ v(d, {
225
+ value: c.tags,
226
+ onChange: (e) => l((t) => ({
227
+ ...t,
228
+ tags: e
229
+ }))
230
+ })] })
231
+ ]
232
+ }),
233
+ /* @__PURE__ */ v(w, {
234
+ open: o,
235
+ onClose: () => s(!1),
236
+ title: "Delete contact",
237
+ message: `Delete ${t.firstName} ${t.lastName}? This can’t be undone.`,
238
+ deleting: E,
239
+ error: u,
240
+ onConfirm: () => void k()
241
+ })
242
+ ] });
243
+ }, D = [
244
+ {
245
+ value: s.Open,
246
+ label: "Open"
247
+ },
248
+ {
249
+ value: s.Won,
250
+ label: "Won"
251
+ },
252
+ {
253
+ value: s.Lost,
254
+ label: "Lost"
255
+ },
256
+ {
257
+ value: s.Stale,
258
+ label: "Stale"
259
+ }
260
+ ];
261
+ function O(e) {
262
+ return e === "closed_won" ? s.Won : e === "closed_lost" ? s.Lost : s.Open;
263
+ }
264
+ var k = ({ deal: e, onChanged: n }) => {
265
+ let [r, a] = p(!1), [s, c] = p(!1), [l, u] = p(null), [m, h] = p({
266
+ name: e.name,
267
+ value: String(e.value ?? ""),
268
+ probability: String(e.probability ?? ""),
269
+ expectedCloseDate: e.expectedCloseDate ? e.expectedCloseDate.slice(0, 10) : "",
270
+ status: O(e.stage),
271
+ description: e.notes,
272
+ tags: e.tags
273
+ }), [g, { loading: S }] = i(), [E, { loading: k }] = t(), A = () => {
274
+ h({
275
+ name: e.name,
276
+ value: String(e.value ?? ""),
277
+ probability: String(e.probability ?? ""),
278
+ expectedCloseDate: e.expectedCloseDate ? e.expectedCloseDate.slice(0, 10) : "",
279
+ status: O(e.stage),
280
+ description: e.notes,
281
+ tags: e.tags
282
+ }), u(null), a(!0);
283
+ }, j = async () => {
284
+ if (!m.name.trim()) {
285
+ u("Deal name is required.");
286
+ return;
287
+ }
288
+ let t = Number(m.probability);
289
+ if (m.probability && (!Number.isFinite(t) || t < 0 || t > 100)) {
290
+ u("Probability must be between 0 and 100.");
291
+ return;
292
+ }
293
+ let r = m.value ? Number(m.value) : null;
294
+ if (m.value && (!Number.isFinite(Number(m.value)) || Number(m.value) < 0)) {
295
+ u("Deal value must be a valid non-negative number.");
296
+ return;
297
+ }
298
+ u(null);
299
+ try {
300
+ await g({ variables: {
301
+ id: e.id,
302
+ input: {
303
+ title: m.name,
304
+ description: m.description || null,
305
+ value: r,
306
+ probability: m.probability ? Math.round(t) : null,
307
+ expectedCloseDate: m.expectedCloseDate || null,
308
+ status: m.status,
309
+ tags: m.tags
310
+ }
311
+ } }), a(!1), n();
312
+ } catch (e) {
313
+ u(e instanceof Error ? e.message : "Failed to update deal.");
314
+ }
315
+ }, M = async () => {
316
+ u(null);
317
+ try {
318
+ await E({ variables: { id: e.id } }), c(!1), n();
319
+ } catch (e) {
320
+ u(e instanceof Error ? e.message : "Failed to delete deal.");
321
+ }
322
+ };
323
+ return /* @__PURE__ */ y(_, { children: [
324
+ /* @__PURE__ */ v(f, {
325
+ id: `deal-actions-${e.id}`,
326
+ buttonLabel: `Actions for ${e.name}`,
327
+ items: T(A, () => {
328
+ u(null), c(!0);
329
+ })
330
+ }),
331
+ /* @__PURE__ */ y(C, {
332
+ open: r,
333
+ onClose: () => a(!1),
334
+ title: "Edit deal",
335
+ description: "Update this deal's details.",
336
+ saving: S,
337
+ error: l,
338
+ onSave: () => void j(),
339
+ children: [
340
+ /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("label", {
341
+ className: x,
342
+ children: "Deal name"
343
+ }), /* @__PURE__ */ v("input", {
344
+ className: b,
345
+ value: m.name,
346
+ onChange: (e) => h((t) => ({
347
+ ...t,
348
+ name: e.target.value
349
+ }))
350
+ })] }),
351
+ /* @__PURE__ */ y("div", {
352
+ className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
353
+ children: [/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("label", {
354
+ className: x,
355
+ children: "Value ($)"
356
+ }), /* @__PURE__ */ v("input", {
357
+ type: "number",
358
+ className: b,
359
+ value: m.value,
360
+ onChange: (e) => h((t) => ({
361
+ ...t,
362
+ value: e.target.value
363
+ }))
364
+ })] }), /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("label", {
365
+ className: x,
366
+ children: "Probability (%)"
367
+ }), /* @__PURE__ */ v("input", {
368
+ type: "number",
369
+ min: "0",
370
+ max: "100",
371
+ className: b,
372
+ value: m.probability,
373
+ onChange: (e) => h((t) => ({
374
+ ...t,
375
+ probability: e.target.value
376
+ }))
377
+ })] })]
378
+ }),
379
+ /* @__PURE__ */ y("div", {
380
+ className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
381
+ children: [/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("label", {
382
+ className: x,
383
+ children: "Status"
384
+ }), /* @__PURE__ */ v("select", {
385
+ className: b,
386
+ value: m.status,
387
+ onChange: (e) => h((t) => ({
388
+ ...t,
389
+ status: e.target.value
390
+ })),
391
+ children: D.map((e) => /* @__PURE__ */ v("option", {
392
+ value: e.value,
393
+ children: e.label
394
+ }, e.value))
395
+ })] }), /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("label", {
396
+ className: x,
397
+ children: "Expected close date"
398
+ }), /* @__PURE__ */ v("input", {
399
+ type: "date",
400
+ className: b,
401
+ value: m.expectedCloseDate,
402
+ onChange: (e) => h((t) => ({
403
+ ...t,
404
+ expectedCloseDate: e.target.value
405
+ }))
406
+ })] })]
407
+ }),
408
+ /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("label", {
409
+ className: x,
410
+ children: "Description"
411
+ }), /* @__PURE__ */ v("textarea", {
412
+ rows: 3,
413
+ className: o(b, "resize-none"),
414
+ value: m.description,
415
+ onChange: (e) => h((t) => ({
416
+ ...t,
417
+ description: e.target.value
418
+ }))
419
+ })] }),
420
+ /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("label", {
421
+ className: x,
422
+ children: "Tags"
423
+ }), /* @__PURE__ */ v(d, {
424
+ value: m.tags,
425
+ onChange: (e) => h((t) => ({
426
+ ...t,
427
+ tags: e
428
+ }))
429
+ })] })
430
+ ]
431
+ }),
432
+ /* @__PURE__ */ v(w, {
433
+ open: s,
434
+ onClose: () => c(!1),
435
+ title: "Delete deal",
436
+ message: `Delete “${e.name}”? This can’t be undone.`,
437
+ deleting: k,
438
+ error: l,
439
+ onConfirm: () => void M()
440
+ })
441
+ ] });
442
+ }, A = [
443
+ {
444
+ value: l.New,
445
+ label: "New"
446
+ },
447
+ {
448
+ value: l.Contacted,
449
+ label: "Contacted"
450
+ },
451
+ {
452
+ value: l.Qualified,
453
+ label: "Qualified"
454
+ },
455
+ {
456
+ value: l.Unqualified,
457
+ label: "Unqualified"
458
+ },
459
+ {
460
+ value: l.Converted,
461
+ label: "Converted"
462
+ },
463
+ {
464
+ value: l.Lost,
465
+ label: "Lost"
466
+ }
467
+ ], j = [
468
+ {
469
+ value: c.Website,
470
+ label: "Website"
471
+ },
472
+ {
473
+ value: c.SocialMedia,
474
+ label: "Social media"
475
+ },
476
+ {
477
+ value: c.AdCampaign,
478
+ label: "Ad campaign"
479
+ },
480
+ {
481
+ value: c.Email,
482
+ label: "Email"
483
+ },
484
+ {
485
+ value: c.Referral,
486
+ label: "Referral"
487
+ },
488
+ {
489
+ value: c.Event,
490
+ label: "Event"
491
+ },
492
+ {
493
+ value: c.ColdOutreach,
494
+ label: "Cold outreach"
495
+ },
496
+ {
497
+ value: c.Other,
498
+ label: "Other"
499
+ }
500
+ ];
501
+ function M(e) {
502
+ switch (e) {
503
+ case "contacted": return l.Contacted;
504
+ case "qualified": return l.Qualified;
505
+ case "disqualified": return l.Unqualified;
506
+ default: return l.New;
507
+ }
508
+ }
509
+ function N(e) {
510
+ let t = e.trim().toUpperCase().replace(/[\s-]+/g, "_"), n = j.find((e) => e.value === t);
511
+ return n ? n.value : c.Other;
512
+ }
513
+ var P = ({ lead: e, onChanged: t }) => {
514
+ let [r, i] = p(!1), [s, c] = p(!1), [l, u] = p(null), [d, m] = p({
515
+ title: e.title,
516
+ status: M(e.status),
517
+ source: N(e.source),
518
+ score: String(e.score ?? ""),
519
+ description: e.notes
520
+ }), [h, { loading: g }] = a(), [S, { loading: E }] = n(), D = () => {
521
+ m({
522
+ title: e.title,
523
+ status: M(e.status),
524
+ source: N(e.source),
525
+ score: String(e.score ?? ""),
526
+ description: e.notes
527
+ }), u(null), i(!0);
528
+ }, O = async () => {
529
+ if (!d.title.trim()) {
530
+ u("Lead title is required.");
531
+ return;
532
+ }
533
+ let n = Number(d.score);
534
+ if (d.score && (!Number.isFinite(n) || n < 0 || n > 100)) {
535
+ u("Score must be between 0 and 100.");
536
+ return;
537
+ }
538
+ u(null);
539
+ try {
540
+ await h({ variables: {
541
+ id: e.id,
542
+ input: {
543
+ title: d.title,
544
+ status: d.status,
545
+ source: d.source,
546
+ score: d.score ? Math.round(n) : null,
547
+ description: d.description || null
548
+ }
549
+ } }), i(!1), t();
550
+ } catch (e) {
551
+ u(e instanceof Error ? e.message : "Failed to update lead.");
552
+ }
553
+ }, k = async () => {
554
+ u(null);
555
+ try {
556
+ await S({ variables: { id: e.id } }), c(!1), t();
557
+ } catch (e) {
558
+ u(e instanceof Error ? e.message : "Failed to delete lead.");
559
+ }
560
+ };
561
+ return /* @__PURE__ */ y(_, { children: [
562
+ /* @__PURE__ */ v(f, {
563
+ id: `lead-actions-${e.id}`,
564
+ buttonLabel: `Actions for ${e.title}`,
565
+ items: T(D, () => {
566
+ u(null), c(!0);
567
+ })
568
+ }),
569
+ /* @__PURE__ */ y(C, {
570
+ open: r,
571
+ onClose: () => i(!1),
572
+ title: "Edit lead",
573
+ description: "Update this lead's stage and details.",
574
+ saving: g,
575
+ error: l,
576
+ onSave: () => void O(),
577
+ children: [
578
+ /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("label", {
579
+ className: x,
580
+ children: "Title"
581
+ }), /* @__PURE__ */ v("input", {
582
+ className: b,
583
+ value: d.title,
584
+ onChange: (e) => m((t) => ({
585
+ ...t,
586
+ title: e.target.value
587
+ }))
588
+ })] }),
589
+ /* @__PURE__ */ y("div", {
590
+ className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
591
+ children: [/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("label", {
592
+ className: x,
593
+ children: "Status"
594
+ }), /* @__PURE__ */ v("select", {
595
+ className: b,
596
+ value: d.status,
597
+ onChange: (e) => m((t) => ({
598
+ ...t,
599
+ status: e.target.value
600
+ })),
601
+ children: A.map((e) => /* @__PURE__ */ v("option", {
602
+ value: e.value,
603
+ children: e.label
604
+ }, e.value))
605
+ })] }), /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("label", {
606
+ className: x,
607
+ children: "Source"
608
+ }), /* @__PURE__ */ v("select", {
609
+ className: b,
610
+ value: d.source,
611
+ onChange: (e) => m((t) => ({
612
+ ...t,
613
+ source: e.target.value
614
+ })),
615
+ children: j.map((e) => /* @__PURE__ */ v("option", {
616
+ value: e.value,
617
+ children: e.label
618
+ }, e.value))
619
+ })] })]
620
+ }),
621
+ /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("label", {
622
+ className: x,
623
+ children: "Score (0–100)"
624
+ }), /* @__PURE__ */ v("input", {
625
+ type: "number",
626
+ min: "0",
627
+ max: "100",
628
+ className: b,
629
+ value: d.score,
630
+ onChange: (e) => m((t) => ({
631
+ ...t,
632
+ score: e.target.value
633
+ }))
634
+ })] }),
635
+ /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("label", {
636
+ className: x,
637
+ children: "Notes"
638
+ }), /* @__PURE__ */ v("textarea", {
639
+ rows: 3,
640
+ className: o(b, "resize-none"),
641
+ value: d.description,
642
+ onChange: (e) => m((t) => ({
643
+ ...t,
644
+ description: e.target.value
645
+ }))
646
+ })] })
647
+ ]
648
+ }),
649
+ /* @__PURE__ */ v(w, {
650
+ open: s,
651
+ onClose: () => c(!1),
652
+ title: "Delete lead",
653
+ message: `Delete “${e.title}”? This can’t be undone.`,
654
+ deleting: E,
655
+ error: l,
656
+ onConfirm: () => void k()
657
+ })
658
+ ] });
659
+ };
660
+ //#endregion
661
+ export { E as ContactActionsMenu, k as DealActionsMenu, P as LeadActionsMenu };
662
+
663
+ //# sourceMappingURL=CrmActions.js.map