@consilioweb/payload-support 0.6.1 → 0.6.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 (70) hide show
  1. package/dist/views/BillingView/client.cjs +209 -0
  2. package/dist/views/BillingView/client.js +204 -0
  3. package/dist/views/BillingView/index.cjs +34 -0
  4. package/dist/views/BillingView/index.js +29 -0
  5. package/dist/views/ChatView/client.cjs +253 -0
  6. package/dist/views/ChatView/client.js +252 -0
  7. package/dist/views/ChatView/index.cjs +34 -0
  8. package/dist/views/ChatView/index.js +29 -0
  9. package/dist/views/CrmView/client.cjs +233 -0
  10. package/dist/views/CrmView/client.js +232 -0
  11. package/dist/views/CrmView/index.cjs +34 -0
  12. package/dist/views/CrmView/index.js +29 -0
  13. package/dist/views/EmailTrackingView/client.cjs +159 -0
  14. package/dist/views/EmailTrackingView/client.js +154 -0
  15. package/dist/views/EmailTrackingView/index.cjs +34 -0
  16. package/dist/views/EmailTrackingView/index.js +29 -0
  17. package/dist/views/ImportConversationView/client.cjs +205 -0
  18. package/dist/views/ImportConversationView/client.js +204 -0
  19. package/dist/views/ImportConversationView/index.cjs +34 -0
  20. package/dist/views/ImportConversationView/index.js +29 -0
  21. package/dist/views/LogsView/client.cjs +149 -0
  22. package/dist/views/LogsView/client.js +148 -0
  23. package/dist/views/LogsView/index.cjs +32 -0
  24. package/dist/views/LogsView/index.js +27 -0
  25. package/dist/views/NewTicketView/client.cjs +229 -0
  26. package/dist/views/NewTicketView/client.js +224 -0
  27. package/dist/views/NewTicketView/index.cjs +32 -0
  28. package/dist/views/NewTicketView/index.js +27 -0
  29. package/dist/views/PendingEmailsView/client.cjs +173 -0
  30. package/dist/views/PendingEmailsView/client.js +172 -0
  31. package/dist/views/PendingEmailsView/index.cjs +34 -0
  32. package/dist/views/PendingEmailsView/index.js +29 -0
  33. package/dist/views/SupportDashboardView/client.cjs +301 -0
  34. package/dist/views/SupportDashboardView/client.js +296 -0
  35. package/dist/views/SupportDashboardView/index.cjs +34 -0
  36. package/dist/views/SupportDashboardView/index.js +29 -0
  37. package/dist/views/TicketDetailView/client.cjs +850 -0
  38. package/dist/views/TicketDetailView/client.js +844 -0
  39. package/dist/views/TicketDetailView/index.cjs +34 -0
  40. package/dist/views/TicketDetailView/index.js +29 -0
  41. package/dist/views/TicketInboxView/client.cjs +299 -0
  42. package/dist/views/TicketInboxView/client.js +294 -0
  43. package/dist/views/TicketInboxView/index.cjs +32 -0
  44. package/dist/views/TicketInboxView/index.js +27 -0
  45. package/dist/{views.css → views/TicketingSettingsView/TicketingSettings.module.scss} +138 -66
  46. package/dist/views/TicketingSettingsView/client.cjs +733 -0
  47. package/dist/views/TicketingSettingsView/client.js +728 -0
  48. package/dist/views/TicketingSettingsView/index.cjs +34 -0
  49. package/dist/views/TicketingSettingsView/index.js +29 -0
  50. package/dist/views/TimeDashboardView/client.cjs +169 -0
  51. package/dist/views/TimeDashboardView/client.js +164 -0
  52. package/dist/views/TimeDashboardView/index.cjs +34 -0
  53. package/dist/views/TimeDashboardView/index.js +29 -0
  54. package/dist/views/shared/AdminViewHeader.cjs +68 -0
  55. package/dist/views/shared/AdminViewHeader.js +67 -0
  56. package/dist/views/shared/ErrorBoundary.cjs +55 -0
  57. package/dist/views/shared/ErrorBoundary.js +50 -0
  58. package/dist/views/shared/Skeleton.cjs +77 -0
  59. package/dist/views/shared/Skeleton.js +72 -0
  60. package/dist/views/shared/adminTokens.cjs +34 -0
  61. package/dist/views/shared/adminTokens.js +31 -0
  62. package/dist/views/shared/config.cjs +44 -0
  63. package/dist/views/shared/config.js +40 -0
  64. package/dist/views/shared/index.cjs +58 -0
  65. package/dist/views/shared/index.js +5 -0
  66. package/dist/views.cjs +77 -6175
  67. package/dist/views.d.cts +13 -30
  68. package/dist/views.d.ts +13 -30
  69. package/dist/views.js +13 -6165
  70. package/package.json +1 -1
@@ -0,0 +1,159 @@
1
+ 'use strict';
2
+
3
+ var jsxRuntime = require('react/jsx-runtime');
4
+ var React = require('react');
5
+ var useTranslation = require('../../components/TicketConversation/hooks/useTranslation');
6
+
7
+ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
8
+
9
+ var React__default = /*#__PURE__*/_interopDefault(React);
10
+
11
+ const STATUS_CFG = {
12
+ success: { key: "emailTracking.status.success", bg: "#dcfce7", color: "#16a34a" },
13
+ error: { key: "emailTracking.status.error", bg: "#fef2f2", color: "#dc2626" },
14
+ ignored: { key: "emailTracking.status.ignored", bg: "#f3f4f6", color: "#6b7280" }
15
+ };
16
+ function fmtDate(d) {
17
+ return new Date(d).toLocaleDateString("fr-FR", { day: "2-digit", month: "2-digit", year: "2-digit", hour: "2-digit", minute: "2-digit" });
18
+ }
19
+ const EmailTrackingClient = () => {
20
+ const { t } = useTranslation.useTranslation();
21
+ const [logs, setLogs] = React.useState([]);
22
+ const [stats, setStats] = React.useState(null);
23
+ const [loading, setLoading] = React.useState(true);
24
+ const [tab, setTab] = React.useState("all");
25
+ const [dateRange, setDateRange] = React.useState(7);
26
+ const [search, setSearch] = React.useState("");
27
+ const [expandedRow, setExpandedRow] = React.useState(null);
28
+ const [page, setPage] = React.useState(1);
29
+ const [hasMore, setHasMore] = React.useState(false);
30
+ const [totalDocs, setTotalDocs] = React.useState(0);
31
+ const fetchStats = React.useCallback(async () => {
32
+ try {
33
+ const r = await fetch(`/api/support/email-stats?days=${dateRange}`);
34
+ if (r.ok) setStats(await r.json());
35
+ } catch (err) {
36
+ console.warn("[support] fetchStats error:", err);
37
+ }
38
+ }, [dateRange]);
39
+ const fetchLogs = React.useCallback(async () => {
40
+ const cutoff = new Date(Date.now() - dateRange * 864e5).toISOString();
41
+ const where = [`where[createdAt][greater_than]=${cutoff}`];
42
+ if (tab !== "all") where.push(`where[status][equals]=${tab}`);
43
+ if (search.trim()) {
44
+ where.push(`where[or][0][recipientEmail][contains]=${encodeURIComponent(search)}`, `where[or][1][subject][contains]=${encodeURIComponent(search)}`);
45
+ }
46
+ try {
47
+ const r = await fetch(`/api/email-logs?${where.join("&")}&sort=-createdAt&limit=30&page=${page}&depth=0`);
48
+ if (r.ok) {
49
+ const d = await r.json();
50
+ setLogs(d.docs);
51
+ setHasMore(d.hasNextPage);
52
+ setTotalDocs(d.totalDocs);
53
+ }
54
+ } catch (err) {
55
+ console.warn("[support] fetchLogs error:", err);
56
+ }
57
+ setLoading(false);
58
+ }, [dateRange, tab, search, page]);
59
+ React.useEffect(() => {
60
+ setLoading(true);
61
+ setPage(1);
62
+ }, [dateRange, tab, search]);
63
+ React.useEffect(() => {
64
+ fetchStats();
65
+ fetchLogs();
66
+ }, [fetchStats, fetchLogs]);
67
+ const S = {
68
+ page: { padding: "20px 30px", maxWidth: 1100, margin: "0 auto" },
69
+ statGrid: { display: "grid", gridTemplateColumns: "repeat(4, 1fr)", gap: 12, marginBottom: 20 },
70
+ statCard: { padding: "12px 16px", borderRadius: 8, border: "1px solid var(--theme-elevation-150)" },
71
+ statLabel: { fontSize: 11, color: "var(--theme-elevation-500)" },
72
+ statValue: { fontSize: 22, fontWeight: 700, color: "var(--theme-text)" },
73
+ filters: { display: "flex", gap: 12, alignItems: "center", marginBottom: 16, flexWrap: "wrap" },
74
+ tab: { padding: "4px 10px", borderRadius: 6, border: "none", background: "none", cursor: "pointer", fontSize: 12, color: "var(--theme-elevation-500)" },
75
+ tabActive: { background: "var(--theme-elevation-100)", fontWeight: 700, color: "var(--theme-text)" },
76
+ dateBtn: { padding: "4px 8px", borderRadius: 4, border: "1px solid var(--theme-elevation-200)", fontSize: 11, cursor: "pointer", background: "var(--theme-elevation-0)", color: "var(--theme-text)" },
77
+ dateBtnActive: { background: "#2563eb", color: "#fff", borderColor: "#2563eb" },
78
+ table: { width: "100%", borderCollapse: "collapse", fontSize: 13 },
79
+ th: { textAlign: "left", padding: "6px 8px", borderBottom: "1px solid var(--theme-elevation-200)", fontSize: 11, color: "var(--theme-elevation-500)" },
80
+ td: { padding: "6px 8px", borderBottom: "1px solid var(--theme-elevation-100)" },
81
+ badge: { padding: "2px 6px", borderRadius: 4, fontSize: 11, fontWeight: 600 },
82
+ btn: { padding: "4px 10px", borderRadius: 6, border: "1px solid var(--theme-elevation-200)", fontSize: 11, cursor: "pointer", background: "var(--theme-elevation-0)", color: "var(--theme-text)" }
83
+ };
84
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: S.page, children: [
85
+ /* @__PURE__ */ jsxRuntime.jsx("h1", { style: { fontSize: 22, fontWeight: 700, marginBottom: 16, color: "var(--theme-text)" }, children: t("emailTracking.title") }),
86
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { style: S.statGrid, children: [
87
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { style: S.statCard, children: [
88
+ /* @__PURE__ */ jsxRuntime.jsx("div", { style: S.statLabel, children: t("emailTracking.stats.emailsSent") }),
89
+ /* @__PURE__ */ jsxRuntime.jsx("div", { style: S.statValue, children: stats?.total ?? "--" })
90
+ ] }),
91
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { style: S.statCard, children: [
92
+ /* @__PURE__ */ jsxRuntime.jsx("div", { style: S.statLabel, children: t("emailTracking.stats.successRate") }),
93
+ /* @__PURE__ */ jsxRuntime.jsx("div", { style: S.statValue, children: stats ? `${stats.successRate}%` : "--" })
94
+ ] }),
95
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { style: S.statCard, children: [
96
+ /* @__PURE__ */ jsxRuntime.jsx("div", { style: S.statLabel, children: t("emailTracking.stats.errors") }),
97
+ /* @__PURE__ */ jsxRuntime.jsx("div", { style: S.statValue, children: stats?.errors ?? "--" })
98
+ ] }),
99
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { style: S.statCard, children: [
100
+ /* @__PURE__ */ jsxRuntime.jsx("div", { style: S.statLabel, children: t("emailTracking.stats.avgTime") }),
101
+ /* @__PURE__ */ jsxRuntime.jsx("div", { style: S.statValue, children: stats ? `${stats.avgProcessingTime}ms` : "--" })
102
+ ] })
103
+ ] }),
104
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { style: S.filters, children: [
105
+ /* @__PURE__ */ jsxRuntime.jsx("div", { style: { display: "flex", gap: 4 }, children: ["all", "success", "error", "ignored"].map((st) => /* @__PURE__ */ jsxRuntime.jsx("button", { style: { ...S.tab, ...tab === st ? S.tabActive : {} }, onClick: () => setTab(st), children: t(`emailTracking.tabs.${st === "error" ? "errors" : st}`) }, st)) }),
106
+ /* @__PURE__ */ jsxRuntime.jsx("div", { style: { display: "flex", gap: 4 }, children: [7, 30, 90].map((v) => /* @__PURE__ */ jsxRuntime.jsxs("button", { style: { ...S.dateBtn, ...dateRange === v ? S.dateBtnActive : {} }, onClick: () => setDateRange(v), children: [
107
+ v,
108
+ "j"
109
+ ] }, v)) }),
110
+ /* @__PURE__ */ jsxRuntime.jsx("input", { type: "text", placeholder: t("emailTracking.searchPlaceholder"), value: search, onChange: (e) => setSearch(e.target.value), style: { padding: "6px 10px", borderRadius: 6, border: "1px solid var(--theme-elevation-200)", fontSize: 12, color: "var(--theme-text)", background: "var(--theme-elevation-0)" } })
111
+ ] }),
112
+ loading ? /* @__PURE__ */ jsxRuntime.jsx("div", { style: { padding: 40, textAlign: "center", color: "#94a3b8" }, children: t("common.loading") }) : logs.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("div", { style: { padding: 40, textAlign: "center", color: "#94a3b8" }, children: t("emailTracking.noLogs") }) : /* @__PURE__ */ jsxRuntime.jsxs("table", { style: S.table, children: [
113
+ /* @__PURE__ */ jsxRuntime.jsx("thead", { children: /* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
114
+ /* @__PURE__ */ jsxRuntime.jsx("th", { style: S.th, children: t("emailTracking.tableHeaders.date") }),
115
+ /* @__PURE__ */ jsxRuntime.jsx("th", { style: S.th, children: t("emailTracking.tableHeaders.recipient") }),
116
+ /* @__PURE__ */ jsxRuntime.jsx("th", { style: S.th, children: t("emailTracking.tableHeaders.subject") }),
117
+ /* @__PURE__ */ jsxRuntime.jsx("th", { style: S.th, children: t("emailTracking.tableHeaders.ticket") }),
118
+ /* @__PURE__ */ jsxRuntime.jsx("th", { style: S.th, children: t("emailTracking.tableHeaders.status") }),
119
+ /* @__PURE__ */ jsxRuntime.jsx("th", { style: S.th, children: t("emailTracking.tableHeaders.action") }),
120
+ /* @__PURE__ */ jsxRuntime.jsx("th", { style: { ...S.th, textAlign: "right" }, children: t("emailTracking.tableHeaders.time") })
121
+ ] }) }),
122
+ /* @__PURE__ */ jsxRuntime.jsx("tbody", { children: logs.map((log) => /* @__PURE__ */ jsxRuntime.jsxs(React__default.default.Fragment, { children: [
123
+ /* @__PURE__ */ jsxRuntime.jsxs("tr", { onClick: () => log.status === "error" && log.errorMessage ? setExpandedRow(expandedRow === log.id ? null : log.id) : null, style: { cursor: log.status === "error" ? "pointer" : "default" }, children: [
124
+ /* @__PURE__ */ jsxRuntime.jsx("td", { style: { ...S.td, fontSize: 12, whiteSpace: "nowrap" }, children: fmtDate(log.createdAt) }),
125
+ /* @__PURE__ */ jsxRuntime.jsx("td", { style: { ...S.td, maxWidth: 200, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: log.recipientEmail || "--" }),
126
+ /* @__PURE__ */ jsxRuntime.jsx("td", { style: { ...S.td, maxWidth: 250, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: log.subject || "--" }),
127
+ /* @__PURE__ */ jsxRuntime.jsx("td", { style: S.td, children: log.ticketNumber || "--" }),
128
+ /* @__PURE__ */ jsxRuntime.jsx("td", { style: S.td, children: /* @__PURE__ */ jsxRuntime.jsx("span", { style: { ...S.badge, background: STATUS_CFG[log.status]?.bg, color: STATUS_CFG[log.status]?.color }, children: STATUS_CFG[log.status]?.key ? t(STATUS_CFG[log.status].key) : log.status }) }),
129
+ /* @__PURE__ */ jsxRuntime.jsx("td", { style: { ...S.td, fontSize: 12 }, children: log.action || "--" }),
130
+ /* @__PURE__ */ jsxRuntime.jsx("td", { style: { ...S.td, textAlign: "right" }, children: log.processingTimeMs != null ? /* @__PURE__ */ jsxRuntime.jsxs("span", { style: { fontFamily: "monospace", fontSize: 12, color: log.processingTimeMs > 2e3 ? "#dc2626" : "#16a34a" }, children: [
131
+ log.processingTimeMs,
132
+ "ms"
133
+ ] }) : "--" })
134
+ ] }),
135
+ expandedRow === log.id && log.errorMessage && /* @__PURE__ */ jsxRuntime.jsx("tr", { children: /* @__PURE__ */ jsxRuntime.jsx("td", { colSpan: 7, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { padding: "8px 12px", background: "#fef2f2", borderRadius: 6, fontSize: 12, color: "#dc2626" }, children: [
136
+ "Erreur",
137
+ log.httpStatus ? ` (HTTP ${log.httpStatus})` : "",
138
+ ": ",
139
+ log.errorMessage
140
+ ] }) }) })
141
+ ] }, log.id)) })
142
+ ] }),
143
+ totalDocs > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", justifyContent: "center", gap: 12, marginTop: 16, alignItems: "center" }, children: [
144
+ /* @__PURE__ */ jsxRuntime.jsx("button", { style: S.btn, onClick: () => setPage((p) => Math.max(1, p - 1)), disabled: page <= 1, children: t("common.previous") }),
145
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { style: { fontSize: 12, color: "var(--theme-elevation-500)" }, children: [
146
+ t("common.page"),
147
+ " ",
148
+ page,
149
+ " -- ",
150
+ totalDocs,
151
+ " ",
152
+ t("common.results")
153
+ ] }),
154
+ /* @__PURE__ */ jsxRuntime.jsx("button", { style: S.btn, onClick: () => setPage((p) => p + 1), disabled: !hasMore, children: t("common.next") })
155
+ ] })
156
+ ] });
157
+ };
158
+
159
+ exports.EmailTrackingClient = EmailTrackingClient;
@@ -0,0 +1,154 @@
1
+ "use client";
2
+ import { jsxs, jsx } from 'react/jsx-runtime';
3
+ import React, { useState, useCallback, useEffect } from 'react';
4
+ import { useTranslation } from '../../components/TicketConversation/hooks/useTranslation';
5
+
6
+ const STATUS_CFG = {
7
+ success: { key: "emailTracking.status.success", bg: "#dcfce7", color: "#16a34a" },
8
+ error: { key: "emailTracking.status.error", bg: "#fef2f2", color: "#dc2626" },
9
+ ignored: { key: "emailTracking.status.ignored", bg: "#f3f4f6", color: "#6b7280" }
10
+ };
11
+ function fmtDate(d) {
12
+ return new Date(d).toLocaleDateString("fr-FR", { day: "2-digit", month: "2-digit", year: "2-digit", hour: "2-digit", minute: "2-digit" });
13
+ }
14
+ const EmailTrackingClient = () => {
15
+ const { t } = useTranslation();
16
+ const [logs, setLogs] = useState([]);
17
+ const [stats, setStats] = useState(null);
18
+ const [loading, setLoading] = useState(true);
19
+ const [tab, setTab] = useState("all");
20
+ const [dateRange, setDateRange] = useState(7);
21
+ const [search, setSearch] = useState("");
22
+ const [expandedRow, setExpandedRow] = useState(null);
23
+ const [page, setPage] = useState(1);
24
+ const [hasMore, setHasMore] = useState(false);
25
+ const [totalDocs, setTotalDocs] = useState(0);
26
+ const fetchStats = useCallback(async () => {
27
+ try {
28
+ const r = await fetch(`/api/support/email-stats?days=${dateRange}`);
29
+ if (r.ok) setStats(await r.json());
30
+ } catch (err) {
31
+ console.warn("[support] fetchStats error:", err);
32
+ }
33
+ }, [dateRange]);
34
+ const fetchLogs = useCallback(async () => {
35
+ const cutoff = new Date(Date.now() - dateRange * 864e5).toISOString();
36
+ const where = [`where[createdAt][greater_than]=${cutoff}`];
37
+ if (tab !== "all") where.push(`where[status][equals]=${tab}`);
38
+ if (search.trim()) {
39
+ where.push(`where[or][0][recipientEmail][contains]=${encodeURIComponent(search)}`, `where[or][1][subject][contains]=${encodeURIComponent(search)}`);
40
+ }
41
+ try {
42
+ const r = await fetch(`/api/email-logs?${where.join("&")}&sort=-createdAt&limit=30&page=${page}&depth=0`);
43
+ if (r.ok) {
44
+ const d = await r.json();
45
+ setLogs(d.docs);
46
+ setHasMore(d.hasNextPage);
47
+ setTotalDocs(d.totalDocs);
48
+ }
49
+ } catch (err) {
50
+ console.warn("[support] fetchLogs error:", err);
51
+ }
52
+ setLoading(false);
53
+ }, [dateRange, tab, search, page]);
54
+ useEffect(() => {
55
+ setLoading(true);
56
+ setPage(1);
57
+ }, [dateRange, tab, search]);
58
+ useEffect(() => {
59
+ fetchStats();
60
+ fetchLogs();
61
+ }, [fetchStats, fetchLogs]);
62
+ const S = {
63
+ page: { padding: "20px 30px", maxWidth: 1100, margin: "0 auto" },
64
+ statGrid: { display: "grid", gridTemplateColumns: "repeat(4, 1fr)", gap: 12, marginBottom: 20 },
65
+ statCard: { padding: "12px 16px", borderRadius: 8, border: "1px solid var(--theme-elevation-150)" },
66
+ statLabel: { fontSize: 11, color: "var(--theme-elevation-500)" },
67
+ statValue: { fontSize: 22, fontWeight: 700, color: "var(--theme-text)" },
68
+ filters: { display: "flex", gap: 12, alignItems: "center", marginBottom: 16, flexWrap: "wrap" },
69
+ tab: { padding: "4px 10px", borderRadius: 6, border: "none", background: "none", cursor: "pointer", fontSize: 12, color: "var(--theme-elevation-500)" },
70
+ tabActive: { background: "var(--theme-elevation-100)", fontWeight: 700, color: "var(--theme-text)" },
71
+ dateBtn: { padding: "4px 8px", borderRadius: 4, border: "1px solid var(--theme-elevation-200)", fontSize: 11, cursor: "pointer", background: "var(--theme-elevation-0)", color: "var(--theme-text)" },
72
+ dateBtnActive: { background: "#2563eb", color: "#fff", borderColor: "#2563eb" },
73
+ table: { width: "100%", borderCollapse: "collapse", fontSize: 13 },
74
+ th: { textAlign: "left", padding: "6px 8px", borderBottom: "1px solid var(--theme-elevation-200)", fontSize: 11, color: "var(--theme-elevation-500)" },
75
+ td: { padding: "6px 8px", borderBottom: "1px solid var(--theme-elevation-100)" },
76
+ badge: { padding: "2px 6px", borderRadius: 4, fontSize: 11, fontWeight: 600 },
77
+ btn: { padding: "4px 10px", borderRadius: 6, border: "1px solid var(--theme-elevation-200)", fontSize: 11, cursor: "pointer", background: "var(--theme-elevation-0)", color: "var(--theme-text)" }
78
+ };
79
+ return /* @__PURE__ */ jsxs("div", { style: S.page, children: [
80
+ /* @__PURE__ */ jsx("h1", { style: { fontSize: 22, fontWeight: 700, marginBottom: 16, color: "var(--theme-text)" }, children: t("emailTracking.title") }),
81
+ /* @__PURE__ */ jsxs("div", { style: S.statGrid, children: [
82
+ /* @__PURE__ */ jsxs("div", { style: S.statCard, children: [
83
+ /* @__PURE__ */ jsx("div", { style: S.statLabel, children: t("emailTracking.stats.emailsSent") }),
84
+ /* @__PURE__ */ jsx("div", { style: S.statValue, children: stats?.total ?? "--" })
85
+ ] }),
86
+ /* @__PURE__ */ jsxs("div", { style: S.statCard, children: [
87
+ /* @__PURE__ */ jsx("div", { style: S.statLabel, children: t("emailTracking.stats.successRate") }),
88
+ /* @__PURE__ */ jsx("div", { style: S.statValue, children: stats ? `${stats.successRate}%` : "--" })
89
+ ] }),
90
+ /* @__PURE__ */ jsxs("div", { style: S.statCard, children: [
91
+ /* @__PURE__ */ jsx("div", { style: S.statLabel, children: t("emailTracking.stats.errors") }),
92
+ /* @__PURE__ */ jsx("div", { style: S.statValue, children: stats?.errors ?? "--" })
93
+ ] }),
94
+ /* @__PURE__ */ jsxs("div", { style: S.statCard, children: [
95
+ /* @__PURE__ */ jsx("div", { style: S.statLabel, children: t("emailTracking.stats.avgTime") }),
96
+ /* @__PURE__ */ jsx("div", { style: S.statValue, children: stats ? `${stats.avgProcessingTime}ms` : "--" })
97
+ ] })
98
+ ] }),
99
+ /* @__PURE__ */ jsxs("div", { style: S.filters, children: [
100
+ /* @__PURE__ */ jsx("div", { style: { display: "flex", gap: 4 }, children: ["all", "success", "error", "ignored"].map((st) => /* @__PURE__ */ jsx("button", { style: { ...S.tab, ...tab === st ? S.tabActive : {} }, onClick: () => setTab(st), children: t(`emailTracking.tabs.${st === "error" ? "errors" : st}`) }, st)) }),
101
+ /* @__PURE__ */ jsx("div", { style: { display: "flex", gap: 4 }, children: [7, 30, 90].map((v) => /* @__PURE__ */ jsxs("button", { style: { ...S.dateBtn, ...dateRange === v ? S.dateBtnActive : {} }, onClick: () => setDateRange(v), children: [
102
+ v,
103
+ "j"
104
+ ] }, v)) }),
105
+ /* @__PURE__ */ jsx("input", { type: "text", placeholder: t("emailTracking.searchPlaceholder"), value: search, onChange: (e) => setSearch(e.target.value), style: { padding: "6px 10px", borderRadius: 6, border: "1px solid var(--theme-elevation-200)", fontSize: 12, color: "var(--theme-text)", background: "var(--theme-elevation-0)" } })
106
+ ] }),
107
+ loading ? /* @__PURE__ */ jsx("div", { style: { padding: 40, textAlign: "center", color: "#94a3b8" }, children: t("common.loading") }) : logs.length === 0 ? /* @__PURE__ */ jsx("div", { style: { padding: 40, textAlign: "center", color: "#94a3b8" }, children: t("emailTracking.noLogs") }) : /* @__PURE__ */ jsxs("table", { style: S.table, children: [
108
+ /* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsxs("tr", { children: [
109
+ /* @__PURE__ */ jsx("th", { style: S.th, children: t("emailTracking.tableHeaders.date") }),
110
+ /* @__PURE__ */ jsx("th", { style: S.th, children: t("emailTracking.tableHeaders.recipient") }),
111
+ /* @__PURE__ */ jsx("th", { style: S.th, children: t("emailTracking.tableHeaders.subject") }),
112
+ /* @__PURE__ */ jsx("th", { style: S.th, children: t("emailTracking.tableHeaders.ticket") }),
113
+ /* @__PURE__ */ jsx("th", { style: S.th, children: t("emailTracking.tableHeaders.status") }),
114
+ /* @__PURE__ */ jsx("th", { style: S.th, children: t("emailTracking.tableHeaders.action") }),
115
+ /* @__PURE__ */ jsx("th", { style: { ...S.th, textAlign: "right" }, children: t("emailTracking.tableHeaders.time") })
116
+ ] }) }),
117
+ /* @__PURE__ */ jsx("tbody", { children: logs.map((log) => /* @__PURE__ */ jsxs(React.Fragment, { children: [
118
+ /* @__PURE__ */ jsxs("tr", { onClick: () => log.status === "error" && log.errorMessage ? setExpandedRow(expandedRow === log.id ? null : log.id) : null, style: { cursor: log.status === "error" ? "pointer" : "default" }, children: [
119
+ /* @__PURE__ */ jsx("td", { style: { ...S.td, fontSize: 12, whiteSpace: "nowrap" }, children: fmtDate(log.createdAt) }),
120
+ /* @__PURE__ */ jsx("td", { style: { ...S.td, maxWidth: 200, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: log.recipientEmail || "--" }),
121
+ /* @__PURE__ */ jsx("td", { style: { ...S.td, maxWidth: 250, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: log.subject || "--" }),
122
+ /* @__PURE__ */ jsx("td", { style: S.td, children: log.ticketNumber || "--" }),
123
+ /* @__PURE__ */ jsx("td", { style: S.td, children: /* @__PURE__ */ jsx("span", { style: { ...S.badge, background: STATUS_CFG[log.status]?.bg, color: STATUS_CFG[log.status]?.color }, children: STATUS_CFG[log.status]?.key ? t(STATUS_CFG[log.status].key) : log.status }) }),
124
+ /* @__PURE__ */ jsx("td", { style: { ...S.td, fontSize: 12 }, children: log.action || "--" }),
125
+ /* @__PURE__ */ jsx("td", { style: { ...S.td, textAlign: "right" }, children: log.processingTimeMs != null ? /* @__PURE__ */ jsxs("span", { style: { fontFamily: "monospace", fontSize: 12, color: log.processingTimeMs > 2e3 ? "#dc2626" : "#16a34a" }, children: [
126
+ log.processingTimeMs,
127
+ "ms"
128
+ ] }) : "--" })
129
+ ] }),
130
+ expandedRow === log.id && log.errorMessage && /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx("td", { colSpan: 7, children: /* @__PURE__ */ jsxs("div", { style: { padding: "8px 12px", background: "#fef2f2", borderRadius: 6, fontSize: 12, color: "#dc2626" }, children: [
131
+ "Erreur",
132
+ log.httpStatus ? ` (HTTP ${log.httpStatus})` : "",
133
+ ": ",
134
+ log.errorMessage
135
+ ] }) }) })
136
+ ] }, log.id)) })
137
+ ] }),
138
+ totalDocs > 0 && /* @__PURE__ */ jsxs("div", { style: { display: "flex", justifyContent: "center", gap: 12, marginTop: 16, alignItems: "center" }, children: [
139
+ /* @__PURE__ */ jsx("button", { style: S.btn, onClick: () => setPage((p) => Math.max(1, p - 1)), disabled: page <= 1, children: t("common.previous") }),
140
+ /* @__PURE__ */ jsxs("span", { style: { fontSize: 12, color: "var(--theme-elevation-500)" }, children: [
141
+ t("common.page"),
142
+ " ",
143
+ page,
144
+ " -- ",
145
+ totalDocs,
146
+ " ",
147
+ t("common.results")
148
+ ] }),
149
+ /* @__PURE__ */ jsx("button", { style: S.btn, onClick: () => setPage((p) => p + 1), disabled: !hasMore, children: t("common.next") })
150
+ ] })
151
+ ] });
152
+ };
153
+
154
+ export { EmailTrackingClient };
@@ -0,0 +1,34 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var jsxRuntime = require('react/jsx-runtime');
6
+ var templates = require('@payloadcms/next/templates');
7
+ var navigation = require('next/navigation');
8
+ var ErrorBoundary = require('../shared/ErrorBoundary');
9
+ var client = require('./client');
10
+
11
+ const EmailTrackingView = ({ initPageResult }) => {
12
+ const { req, visibleEntities } = initPageResult;
13
+ if (!req.user) {
14
+ navigation.redirect("/admin/login");
15
+ }
16
+ return /* @__PURE__ */ jsxRuntime.jsx(
17
+ templates.DefaultTemplate,
18
+ {
19
+ i18n: req.i18n,
20
+ locale: initPageResult.locale,
21
+ params: {},
22
+ payload: req.payload,
23
+ permissions: initPageResult.permissions,
24
+ searchParams: {},
25
+ user: req.user,
26
+ visibleEntities,
27
+ children: /* @__PURE__ */ jsxRuntime.jsx(ErrorBoundary.AdminErrorBoundary, { viewName: "EmailTrackingView", children: /* @__PURE__ */ jsxRuntime.jsx(client.EmailTrackingClient, {}) })
28
+ }
29
+ );
30
+ };
31
+ var EmailTrackingView_default = EmailTrackingView;
32
+
33
+ exports.EmailTrackingView = EmailTrackingView;
34
+ exports.default = EmailTrackingView_default;
@@ -0,0 +1,29 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import { DefaultTemplate } from '@payloadcms/next/templates';
3
+ import { redirect } from 'next/navigation';
4
+ import { AdminErrorBoundary } from '../shared/ErrorBoundary';
5
+ import { EmailTrackingClient } from './client';
6
+
7
+ const EmailTrackingView = ({ initPageResult }) => {
8
+ const { req, visibleEntities } = initPageResult;
9
+ if (!req.user) {
10
+ redirect("/admin/login");
11
+ }
12
+ return /* @__PURE__ */ jsx(
13
+ DefaultTemplate,
14
+ {
15
+ i18n: req.i18n,
16
+ locale: initPageResult.locale,
17
+ params: {},
18
+ payload: req.payload,
19
+ permissions: initPageResult.permissions,
20
+ searchParams: {},
21
+ user: req.user,
22
+ visibleEntities,
23
+ children: /* @__PURE__ */ jsx(AdminErrorBoundary, { viewName: "EmailTrackingView", children: /* @__PURE__ */ jsx(EmailTrackingClient, {}) })
24
+ }
25
+ );
26
+ };
27
+ var EmailTrackingView_default = EmailTrackingView;
28
+
29
+ export { EmailTrackingView, EmailTrackingView_default as default };
@@ -0,0 +1,205 @@
1
+ 'use strict';
2
+
3
+ var jsxRuntime = require('react/jsx-runtime');
4
+ var react = require('react');
5
+ var useTranslation = require('../../components/TicketConversation/hooks/useTranslation');
6
+
7
+ function ImportConversationClient() {
8
+ const { t } = useTranslation.useTranslation();
9
+ const [markdown, setMarkdown] = react.useState("");
10
+ const [fileName, setFileName] = react.useState("");
11
+ const [isDragOver, setIsDragOver] = react.useState(false);
12
+ const [preview, setPreview] = react.useState(null);
13
+ const [result, setResult] = react.useState(null);
14
+ const [error, setError] = react.useState("");
15
+ const [loading, setLoading] = react.useState(false);
16
+ const fileRef = react.useRef(null);
17
+ const handleFile = react.useCallback((file) => {
18
+ if (!file.name.endsWith(".md") && !file.name.endsWith(".txt")) {
19
+ setError(t("import.formatError"));
20
+ return;
21
+ }
22
+ if (file.size > 512e3) {
23
+ setError(t("import.sizeError"));
24
+ return;
25
+ }
26
+ setError("");
27
+ setFileName(file.name);
28
+ setResult(null);
29
+ setPreview(null);
30
+ const reader = new FileReader();
31
+ reader.onload = (e) => {
32
+ setMarkdown(e.target?.result);
33
+ };
34
+ reader.readAsText(file);
35
+ }, []);
36
+ const onDrop = react.useCallback((e) => {
37
+ e.preventDefault();
38
+ setIsDragOver(false);
39
+ const file = e.dataTransfer.files[0];
40
+ if (file) handleFile(file);
41
+ }, [handleFile]);
42
+ const onFileChange = react.useCallback((e) => {
43
+ const file = e.target.files?.[0];
44
+ if (file) handleFile(file);
45
+ }, [handleFile]);
46
+ const doPreview = react.useCallback(async () => {
47
+ if (!markdown) return;
48
+ setLoading(true);
49
+ setError("");
50
+ setPreview(null);
51
+ try {
52
+ const res = await fetch("/api/support/import-conversation", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ markdown, previewOnly: true }) });
53
+ const data = await res.json();
54
+ if (!res.ok) {
55
+ setError(data.error || "Erreur");
56
+ return;
57
+ }
58
+ ;
59
+ setPreview(data);
60
+ } catch {
61
+ setError("Erreur reseau");
62
+ } finally {
63
+ setLoading(false);
64
+ }
65
+ }, [markdown]);
66
+ const doImport = react.useCallback(async () => {
67
+ if (!markdown) return;
68
+ setLoading(true);
69
+ setError("");
70
+ try {
71
+ const res = await fetch("/api/support/import-conversation", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ markdown }) });
72
+ const data = await res.json();
73
+ if (!res.ok) {
74
+ setError(data.error || "Erreur");
75
+ return;
76
+ }
77
+ ;
78
+ setResult(data);
79
+ setPreview(null);
80
+ } catch {
81
+ setError("Erreur reseau");
82
+ } finally {
83
+ setLoading(false);
84
+ }
85
+ }, [markdown]);
86
+ const reset = react.useCallback(() => {
87
+ setMarkdown("");
88
+ setFileName("");
89
+ setPreview(null);
90
+ setResult(null);
91
+ setError("");
92
+ if (fileRef.current) fileRef.current.value = "";
93
+ }, []);
94
+ const S = {
95
+ page: { padding: "20px 30px", maxWidth: 720, margin: "0 auto" },
96
+ dropzone: { border: "2px dashed var(--theme-elevation-300)", borderRadius: 12, padding: 40, textAlign: "center", cursor: "pointer", transition: "all 150ms" },
97
+ dropzoneDragOver: { border: "2px dashed #2563eb", borderRadius: 12, padding: 40, textAlign: "center", cursor: "pointer", background: "#eff6ff" },
98
+ dropzoneHasFile: { border: "2px solid #22c55e", borderRadius: 12, padding: 40, textAlign: "center", cursor: "pointer", background: "#f0fdf4" },
99
+ btn: { padding: "8px 16px", borderRadius: 8, border: "1px solid var(--theme-elevation-200)", fontSize: 13, cursor: "pointer", background: "var(--theme-elevation-0)", color: "var(--theme-text)", fontWeight: 600 },
100
+ btnPrimary: { padding: "8px 16px", borderRadius: 8, border: "none", fontSize: 13, cursor: "pointer", background: "#2563eb", color: "#fff", fontWeight: 600 },
101
+ btnGreen: { padding: "8px 16px", borderRadius: 8, border: "none", fontSize: 13, cursor: "pointer", background: "#16a34a", color: "#fff", fontWeight: 600 },
102
+ btnAmber: { padding: "8px 16px", borderRadius: 8, border: "none", fontSize: 13, cursor: "pointer", background: "#d97706", color: "#fff", fontWeight: 600 },
103
+ section: { padding: 16, borderRadius: 10, border: "1px solid var(--theme-elevation-150)", marginBottom: 12 },
104
+ infoRow: { display: "flex", justifyContent: "space-between", padding: "4px 0", fontSize: 13 },
105
+ infoLabel: { color: "var(--theme-elevation-500)" },
106
+ infoValue: { fontWeight: 600, color: "var(--theme-text)" },
107
+ msgAdmin: { padding: "8px 12px", borderRadius: 8, background: "#dbeafe", marginBottom: 6 },
108
+ msgClient: { padding: "8px 12px", borderRadius: 8, background: "var(--theme-elevation-50)", marginBottom: 6 },
109
+ resultSuccess: { padding: 20, borderRadius: 10, border: "2px solid #22c55e", background: "#f0fdf4" },
110
+ resultError: { padding: 16, borderRadius: 10, border: "1px solid #fecaca", background: "#fef2f2", color: "#dc2626", marginBottom: 12 }
111
+ };
112
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: S.page, children: [
113
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "center", marginBottom: 20 }, children: [
114
+ /* @__PURE__ */ jsxRuntime.jsx("h1", { style: { fontSize: 22, fontWeight: 700, margin: 0 }, children: t("import.title") }),
115
+ result && /* @__PURE__ */ jsxRuntime.jsx("button", { onClick: reset, style: S.btnPrimary, children: t("import.newImport") })
116
+ ] }),
117
+ !result && /* @__PURE__ */ jsxRuntime.jsxs("div", { style: isDragOver ? S.dropzoneDragOver : markdown ? S.dropzoneHasFile : S.dropzone, onDragOver: (e) => {
118
+ e.preventDefault();
119
+ setIsDragOver(true);
120
+ }, onDragLeave: () => setIsDragOver(false), onDrop, onClick: () => fileRef.current?.click(), children: [
121
+ /* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: 24, marginBottom: 8 }, children: "\u2191" }),
122
+ /* @__PURE__ */ jsxRuntime.jsx("p", { style: { fontSize: 14, color: "var(--theme-text)" }, children: markdown ? t("import.dropzoneLoaded") : t("import.dropzoneText") }),
123
+ !markdown && /* @__PURE__ */ jsxRuntime.jsx("p", { style: { fontSize: 12, color: "var(--theme-elevation-400)", marginTop: 8 }, children: t("import.acceptedFormats") }),
124
+ fileName && /* @__PURE__ */ jsxRuntime.jsx("p", { style: { fontSize: 12, fontWeight: 600, marginTop: 8 }, children: fileName }),
125
+ /* @__PURE__ */ jsxRuntime.jsx("input", { ref: fileRef, type: "file", accept: ".md,.txt", onChange: onFileChange, style: { display: "none" } })
126
+ ] }),
127
+ error && /* @__PURE__ */ jsxRuntime.jsxs("div", { style: S.resultError, children: [
128
+ /* @__PURE__ */ jsxRuntime.jsx("strong", { children: t("common.error") }),
129
+ /* @__PURE__ */ jsxRuntime.jsx("p", { style: { margin: "4px 0 0" }, children: error })
130
+ ] }),
131
+ markdown && !preview && !result && /* @__PURE__ */ jsxRuntime.jsx("div", { style: { display: "flex", justifyContent: "center", marginTop: 16 }, children: /* @__PURE__ */ jsxRuntime.jsx("button", { onClick: doPreview, disabled: loading, style: S.btnAmber, children: loading ? t("import.analyzing") : t("import.preview") }) }),
132
+ preview && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
133
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { style: S.section, children: [
134
+ /* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontWeight: 700, marginBottom: 8 }, children: t("import.client") }),
135
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { style: S.infoRow, children: [
136
+ /* @__PURE__ */ jsxRuntime.jsx("span", { style: S.infoLabel, children: t("import.name") }),
137
+ /* @__PURE__ */ jsxRuntime.jsx("span", { style: S.infoValue, children: preview.client.name })
138
+ ] }),
139
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { style: S.infoRow, children: [
140
+ /* @__PURE__ */ jsxRuntime.jsx("span", { style: S.infoLabel, children: t("import.email") }),
141
+ /* @__PURE__ */ jsxRuntime.jsx("span", { style: S.infoValue, children: preview.client.email })
142
+ ] }),
143
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { style: S.infoRow, children: [
144
+ /* @__PURE__ */ jsxRuntime.jsx("span", { style: S.infoLabel, children: t("import.company") }),
145
+ /* @__PURE__ */ jsxRuntime.jsx("span", { style: S.infoValue, children: preview.client.company })
146
+ ] }),
147
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { style: S.infoRow, children: [
148
+ /* @__PURE__ */ jsxRuntime.jsx("span", { style: S.infoLabel, children: t("import.parsing") }),
149
+ /* @__PURE__ */ jsxRuntime.jsx("span", { style: S.infoValue, children: preview.parseMethod === "structured" ? t("import.parsingRegex") : t("import.parsingAi") })
150
+ ] })
151
+ ] }),
152
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { style: S.section, children: [
153
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { fontWeight: 700, marginBottom: 8, display: "flex", justifyContent: "space-between" }, children: [
154
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: preview.subject }),
155
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { style: { color: "var(--theme-elevation-500)", fontSize: 12 }, children: [
156
+ preview.messageCount,
157
+ " ",
158
+ t("import.messages")
159
+ ] })
160
+ ] }),
161
+ preview.messages.map((msg, i) => /* @__PURE__ */ jsxRuntime.jsxs("div", { style: msg.from === "admin" ? S.msgAdmin : S.msgClient, children: [
162
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", justifyContent: "space-between", fontSize: 12, marginBottom: 4 }, children: [
163
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { style: { fontWeight: 600 }, children: [
164
+ msg.from === "admin" ? ">> " : "<< ",
165
+ msg.name
166
+ ] }),
167
+ /* @__PURE__ */ jsxRuntime.jsx("span", { style: { color: "var(--theme-elevation-400)" }, children: msg.date })
168
+ ] }),
169
+ /* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: 13 }, children: msg.preview })
170
+ ] }, i))
171
+ ] }),
172
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", gap: 8, justifyContent: "flex-end", marginTop: 12 }, children: [
173
+ /* @__PURE__ */ jsxRuntime.jsx("button", { onClick: () => setPreview(null), style: S.btn, children: t("common.cancel") }),
174
+ /* @__PURE__ */ jsxRuntime.jsx("button", { onClick: doImport, disabled: loading, style: S.btnGreen, children: loading ? t("import.importing") : t("import.importButton", { count: String(preview.messageCount) }) })
175
+ ] })
176
+ ] }),
177
+ result && /* @__PURE__ */ jsxRuntime.jsxs("div", { style: S.resultSuccess, children: [
178
+ /* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontWeight: 700, fontSize: 16, marginBottom: 12, color: "#166534" }, children: t("import.resultTitle") }),
179
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { style: S.infoRow, children: [
180
+ /* @__PURE__ */ jsxRuntime.jsx("span", { style: S.infoLabel, children: t("import.resultTicket") }),
181
+ /* @__PURE__ */ jsxRuntime.jsx("span", { style: S.infoValue, children: /* @__PURE__ */ jsxRuntime.jsx("a", { href: `/admin/support/ticket?id=${result.ticketId}`, style: { color: "#2563eb" }, children: result.ticketNumber }) })
182
+ ] }),
183
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { style: S.infoRow, children: [
184
+ /* @__PURE__ */ jsxRuntime.jsx("span", { style: S.infoLabel, children: t("import.resultClient") }),
185
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { style: S.infoValue, children: [
186
+ result.clientName,
187
+ " (",
188
+ result.clientEmail,
189
+ ")",
190
+ result.isNewClient && /* @__PURE__ */ jsxRuntime.jsx("span", { style: { marginLeft: 8, padding: "1px 6px", borderRadius: 4, background: "#dbeafe", color: "#1e40af", fontSize: 10 }, children: t("import.resultNew") })
191
+ ] })
192
+ ] }),
193
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { style: S.infoRow, children: [
194
+ /* @__PURE__ */ jsxRuntime.jsx("span", { style: S.infoLabel, children: t("import.resultCompany") }),
195
+ /* @__PURE__ */ jsxRuntime.jsx("span", { style: S.infoValue, children: result.clientCompany })
196
+ ] }),
197
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { style: S.infoRow, children: [
198
+ /* @__PURE__ */ jsxRuntime.jsx("span", { style: S.infoLabel, children: t("import.resultMessages") }),
199
+ /* @__PURE__ */ jsxRuntime.jsx("span", { style: S.infoValue, children: t("import.resultImported", { count: String(result.messagesImported) }) })
200
+ ] })
201
+ ] })
202
+ ] });
203
+ }
204
+
205
+ exports.ImportConversationClient = ImportConversationClient;