@burdenoff/microfe-newsletter 2026.510.108
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.
- package/README.md +277 -0
- package/dist/dev/main.d.ts +2 -0
- package/dist/dev/main.d.ts.map +1 -0
- package/dist/generated/global-operations.d.ts +2170 -0
- package/dist/generated/global-operations.d.ts.map +1 -0
- package/dist/generated/global-operations.js +672 -0
- package/dist/generated/global-operations.js.map +1 -0
- package/dist/generated/global-types.d.ts +20716 -0
- package/dist/generated/global-types.d.ts.map +1 -0
- package/dist/generated/wspace-operations.d.ts +2 -0
- package/dist/generated/wspace-operations.d.ts.map +1 -0
- package/dist/generated/wspace-types.d.ts +53363 -0
- package/dist/generated/wspace-types.d.ts.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +8 -0
- package/dist/newsletter/AdminNewsletterRoot.d.ts +49 -0
- package/dist/newsletter/AdminNewsletterRoot.d.ts.map +1 -0
- package/dist/newsletter/AdminNewsletterRoot.js +227 -0
- package/dist/newsletter/AdminNewsletterRoot.js.map +1 -0
- package/dist/newsletter/AdminNewsletterRoutes.d.ts +36 -0
- package/dist/newsletter/AdminNewsletterRoutes.d.ts.map +1 -0
- package/dist/newsletter/AdminNewsletterRoutes.js +116 -0
- package/dist/newsletter/AdminNewsletterRoutes.js.map +1 -0
- package/dist/newsletter/NewsletterRoot.d.ts +11 -0
- package/dist/newsletter/NewsletterRoot.d.ts.map +1 -0
- package/dist/newsletter/NewsletterRoot.js +7 -0
- package/dist/newsletter/NewsletterRoot.js.map +1 -0
- package/dist/newsletter/NewsletterRoutes.d.ts +8 -0
- package/dist/newsletter/NewsletterRoutes.d.ts.map +1 -0
- package/dist/newsletter/UserNewsletterRoot.d.ts +38 -0
- package/dist/newsletter/UserNewsletterRoot.d.ts.map +1 -0
- package/dist/newsletter/UserNewsletterRoot.js +91 -0
- package/dist/newsletter/UserNewsletterRoot.js.map +1 -0
- package/dist/newsletter/UserNewsletterRoutes.d.ts +25 -0
- package/dist/newsletter/UserNewsletterRoutes.d.ts.map +1 -0
- package/dist/newsletter/UserNewsletterRoutes.js +56 -0
- package/dist/newsletter/UserNewsletterRoutes.js.map +1 -0
- package/dist/newsletter/components/index.d.ts +25 -0
- package/dist/newsletter/components/index.d.ts.map +1 -0
- package/dist/newsletter/components/ui.d.ts +6 -0
- package/dist/newsletter/components/ui.d.ts.map +1 -0
- package/dist/newsletter/constants/permissions.d.ts +44 -0
- package/dist/newsletter/constants/permissions.d.ts.map +1 -0
- package/dist/newsletter/constants/permissions.js +33 -0
- package/dist/newsletter/constants/permissions.js.map +1 -0
- package/dist/newsletter/hooks/index.d.ts +9 -0
- package/dist/newsletter/hooks/index.d.ts.map +1 -0
- package/dist/newsletter/hooks/index.js +5 -0
- package/dist/newsletter/hooks/useAnalyticsOperations.d.ts +98 -0
- package/dist/newsletter/hooks/useAnalyticsOperations.d.ts.map +1 -0
- package/dist/newsletter/hooks/useAnalyticsOperations.js +33 -0
- package/dist/newsletter/hooks/useAnalyticsOperations.js.map +1 -0
- package/dist/newsletter/hooks/useComplianceOperations.d.ts +185 -0
- package/dist/newsletter/hooks/useComplianceOperations.d.ts.map +1 -0
- package/dist/newsletter/hooks/useComplianceOperations.js +95 -0
- package/dist/newsletter/hooks/useComplianceOperations.js.map +1 -0
- package/dist/newsletter/hooks/useNewsletterOperations.d.ts +459 -0
- package/dist/newsletter/hooks/useNewsletterOperations.d.ts.map +1 -0
- package/dist/newsletter/hooks/useNewsletterOperations.js +397 -0
- package/dist/newsletter/hooks/useNewsletterOperations.js.map +1 -0
- package/dist/newsletter/hooks/useNewsletterPermissions.d.ts +41 -0
- package/dist/newsletter/hooks/useNewsletterPermissions.d.ts.map +1 -0
- package/dist/newsletter/hooks/useNewsletterPermissions.js +35 -0
- package/dist/newsletter/hooks/useNewsletterPermissions.js.map +1 -0
- package/dist/newsletter/hooks/useWaitlistOperations.d.ts +95 -0
- package/dist/newsletter/hooks/useWaitlistOperations.d.ts.map +1 -0
- package/dist/newsletter/hooks/useWaitlistOperations.js +46 -0
- package/dist/newsletter/hooks/useWaitlistOperations.js.map +1 -0
- package/dist/newsletter/index.d.ts +55 -0
- package/dist/newsletter/index.d.ts.map +1 -0
- package/dist/newsletter/index.js +7 -0
- package/dist/newsletter/pages/ABTestingPage.d.ts +17 -0
- package/dist/newsletter/pages/ABTestingPage.d.ts.map +1 -0
- package/dist/newsletter/pages/ABTestingPage.js +806 -0
- package/dist/newsletter/pages/ABTestingPage.js.map +1 -0
- package/dist/newsletter/pages/AnalyticsDashboardPage.d.ts +17 -0
- package/dist/newsletter/pages/AnalyticsDashboardPage.d.ts.map +1 -0
- package/dist/newsletter/pages/AnalyticsDashboardPage.js +452 -0
- package/dist/newsletter/pages/AnalyticsDashboardPage.js.map +1 -0
- package/dist/newsletter/pages/CampaignAnalyticsPage.d.ts +17 -0
- package/dist/newsletter/pages/CampaignAnalyticsPage.d.ts.map +1 -0
- package/dist/newsletter/pages/CampaignAnalyticsPage.js +498 -0
- package/dist/newsletter/pages/CampaignAnalyticsPage.js.map +1 -0
- package/dist/newsletter/pages/CampaignEditorPage.d.ts +16 -0
- package/dist/newsletter/pages/CampaignEditorPage.d.ts.map +1 -0
- package/dist/newsletter/pages/CampaignEditorPage.js +523 -0
- package/dist/newsletter/pages/CampaignEditorPage.js.map +1 -0
- package/dist/newsletter/pages/CampaignsListPage.d.ts +15 -0
- package/dist/newsletter/pages/CampaignsListPage.d.ts.map +1 -0
- package/dist/newsletter/pages/CampaignsListPage.js +302 -0
- package/dist/newsletter/pages/CampaignsListPage.js.map +1 -0
- package/dist/newsletter/pages/CompliancePage.d.ts +17 -0
- package/dist/newsletter/pages/CompliancePage.d.ts.map +1 -0
- package/dist/newsletter/pages/CompliancePage.js +1094 -0
- package/dist/newsletter/pages/CompliancePage.js.map +1 -0
- package/dist/newsletter/pages/SchedulerPage.d.ts +17 -0
- package/dist/newsletter/pages/SchedulerPage.d.ts.map +1 -0
- package/dist/newsletter/pages/SchedulerPage.js +503 -0
- package/dist/newsletter/pages/SchedulerPage.js.map +1 -0
- package/dist/newsletter/pages/SubscriberDetailPage.d.ts +17 -0
- package/dist/newsletter/pages/SubscriberDetailPage.d.ts.map +1 -0
- package/dist/newsletter/pages/SubscriberDetailPage.js +442 -0
- package/dist/newsletter/pages/SubscriberDetailPage.js.map +1 -0
- package/dist/newsletter/pages/SubscribersListPage.d.ts +17 -0
- package/dist/newsletter/pages/SubscribersListPage.d.ts.map +1 -0
- package/dist/newsletter/pages/SubscribersListPage.js +553 -0
- package/dist/newsletter/pages/SubscribersListPage.js.map +1 -0
- package/dist/newsletter/pages/TemplateEditorPage.d.ts +17 -0
- package/dist/newsletter/pages/TemplateEditorPage.d.ts.map +1 -0
- package/dist/newsletter/pages/TemplateEditorPage.js +451 -0
- package/dist/newsletter/pages/TemplateEditorPage.js.map +1 -0
- package/dist/newsletter/pages/TemplateLibraryPage.d.ts +17 -0
- package/dist/newsletter/pages/TemplateLibraryPage.d.ts.map +1 -0
- package/dist/newsletter/pages/TemplateLibraryPage.js +360 -0
- package/dist/newsletter/pages/TemplateLibraryPage.js.map +1 -0
- package/dist/newsletter/pages/WaitlistDetailPage.d.ts +13 -0
- package/dist/newsletter/pages/WaitlistDetailPage.d.ts.map +1 -0
- package/dist/newsletter/pages/WaitlistDetailPage.js +321 -0
- package/dist/newsletter/pages/WaitlistDetailPage.js.map +1 -0
- package/dist/newsletter/pages/WaitlistListPage.d.ts +15 -0
- package/dist/newsletter/pages/WaitlistListPage.d.ts.map +1 -0
- package/dist/newsletter/pages/WaitlistListPage.js +432 -0
- package/dist/newsletter/pages/WaitlistListPage.js.map +1 -0
- package/dist/newsletter/providers/NewsletterProvider.d.ts +54 -0
- package/dist/newsletter/providers/NewsletterProvider.d.ts.map +1 -0
- package/dist/newsletter/providers/NewsletterProvider.js +119 -0
- package/dist/newsletter/providers/NewsletterProvider.js.map +1 -0
- package/dist/newsletter/shared/hooks/useTr.d.ts +14 -0
- package/dist/newsletter/shared/hooks/useTr.d.ts.map +1 -0
- package/dist/newsletter/shared/hooks/useTr.js +14 -0
- package/dist/newsletter/shared/hooks/useTr.js.map +1 -0
- package/dist/newsletter/store/newsletterStore.d.ts +49 -0
- package/dist/newsletter/store/newsletterStore.d.ts.map +1 -0
- package/dist/newsletter/store/newsletterStore.js +109 -0
- package/dist/newsletter/store/newsletterStore.js.map +1 -0
- package/dist/newsletter/types/index.d.ts +509 -0
- package/dist/newsletter/types/index.d.ts.map +1 -0
- package/dist/newsletter/utils/cn.d.ts +8 -0
- package/dist/newsletter/utils/cn.d.ts.map +1 -0
- package/dist/newsletter/utils/formatting.d.ts +29 -0
- package/dist/newsletter/utils/formatting.d.ts.map +1 -0
- package/dist/newsletter/utils/index.d.ts +6 -0
- package/dist/newsletter/utils/index.d.ts.map +1 -0
- package/dist/newsletter/utils/validation.d.ts +26 -0
- package/dist/newsletter/utils/validation.d.ts.map +1 -0
- package/dist/node_modules/@apollo/client/errors/index.js +22 -0
- package/dist/node_modules/@apollo/client/errors/index.js.map +1 -0
- package/dist/node_modules/@apollo/client/link/core/ApolloLink.js +75 -0
- package/dist/node_modules/@apollo/client/link/core/ApolloLink.js.map +1 -0
- package/dist/node_modules/@apollo/client/link/subscriptions/index.js +38 -0
- package/dist/node_modules/@apollo/client/link/subscriptions/index.js.map +1 -0
- package/dist/node_modules/@apollo/client/link/utils/createOperation.js +20 -0
- package/dist/node_modules/@apollo/client/link/utils/createOperation.js.map +1 -0
- package/dist/node_modules/@apollo/client/link/utils/transformOperation.js +15 -0
- package/dist/node_modules/@apollo/client/link/utils/transformOperation.js.map +1 -0
- package/dist/node_modules/@apollo/client/link/utils/validateOperation.js +19 -0
- package/dist/node_modules/@apollo/client/link/utils/validateOperation.js.map +1 -0
- package/dist/node_modules/@apollo/client/node_modules/tslib/tslib.es6.js +30 -0
- package/dist/node_modules/@apollo/client/node_modules/tslib/tslib.es6.js.map +1 -0
- package/dist/node_modules/@apollo/client/utilities/caching/caches.js +19 -0
- package/dist/node_modules/@apollo/client/utilities/caching/caches.js.map +1 -0
- package/dist/node_modules/@apollo/client/utilities/caching/getMemoryInternals.js +27 -0
- package/dist/node_modules/@apollo/client/utilities/caching/getMemoryInternals.js.map +1 -0
- package/dist/node_modules/@apollo/client/utilities/caching/sizes.js +7 -0
- package/dist/node_modules/@apollo/client/utilities/caching/sizes.js.map +1 -0
- package/dist/node_modules/@apollo/client/utilities/common/makeUniqueId.js +10 -0
- package/dist/node_modules/@apollo/client/utilities/common/makeUniqueId.js.map +1 -0
- package/dist/node_modules/@apollo/client/utilities/common/objects.js +8 -0
- package/dist/node_modules/@apollo/client/utilities/common/objects.js.map +1 -0
- package/dist/node_modules/@apollo/client/utilities/common/stringifyForDisplay.js +13 -0
- package/dist/node_modules/@apollo/client/utilities/common/stringifyForDisplay.js.map +1 -0
- package/dist/node_modules/@apollo/client/utilities/deprecation/index.js +15 -0
- package/dist/node_modules/@apollo/client/utilities/deprecation/index.js.map +1 -0
- package/dist/node_modules/@apollo/client/utilities/globals/global.js +17 -0
- package/dist/node_modules/@apollo/client/utilities/globals/global.js.map +1 -0
- package/dist/node_modules/@apollo/client/utilities/globals/invariantWrappers.js +51 -0
- package/dist/node_modules/@apollo/client/utilities/globals/invariantWrappers.js.map +1 -0
- package/dist/node_modules/@apollo/client/utilities/globals/maybe.js +10 -0
- package/dist/node_modules/@apollo/client/utilities/globals/maybe.js.map +1 -0
- package/dist/node_modules/@apollo/client/utilities/graphql/getFromAST.js +36 -0
- package/dist/node_modules/@apollo/client/utilities/graphql/getFromAST.js.map +1 -0
- package/dist/node_modules/@apollo/client/utilities/graphql/print.js +18 -0
- package/dist/node_modules/@apollo/client/utilities/graphql/print.js.map +1 -0
- package/dist/node_modules/@apollo/client/version.js +6 -0
- package/dist/node_modules/@apollo/client/version.js.map +1 -0
- package/dist/node_modules/@wry/caches/lib/weak.js +67 -0
- package/dist/node_modules/@wry/caches/lib/weak.js.map +1 -0
- package/dist/node_modules/@wry/context/lib/index.js +6 -0
- package/dist/node_modules/@wry/context/lib/index.js.map +1 -0
- package/dist/node_modules/@wry/context/lib/slot.js +79 -0
- package/dist/node_modules/@wry/context/lib/slot.js.map +1 -0
- package/dist/node_modules/@wry/trie/lib/index.js +5 -0
- package/dist/node_modules/@wry/trie/lib/index.js.map +1 -0
- package/dist/node_modules/graphql-ws/lib/client.js +320 -0
- package/dist/node_modules/graphql-ws/lib/client.js.map +1 -0
- package/dist/node_modules/graphql-ws/lib/common.js +58 -0
- package/dist/node_modules/graphql-ws/lib/common.js.map +1 -0
- package/dist/node_modules/graphql-ws/lib/utils.js +17 -0
- package/dist/node_modules/graphql-ws/lib/utils.js.map +1 -0
- package/dist/node_modules/optimism/lib/context.js +8 -0
- package/dist/node_modules/optimism/lib/context.js.map +1 -0
- package/dist/node_modules/optimism/lib/dep.js +2 -0
- package/dist/node_modules/optimism/lib/entry.js +124 -0
- package/dist/node_modules/optimism/lib/entry.js.map +1 -0
- package/dist/node_modules/optimism/lib/helpers.js +13 -0
- package/dist/node_modules/optimism/lib/helpers.js.map +1 -0
- package/dist/node_modules/optimism/lib/index.js +5 -0
- package/dist/node_modules/ts-invariant/lib/invariant.js +35 -0
- package/dist/node_modules/ts-invariant/lib/invariant.js.map +1 -0
- package/dist/node_modules/ts-invariant/node_modules/tslib/tslib.es6.js +20 -0
- package/dist/node_modules/ts-invariant/node_modules/tslib/tslib.es6.js.map +1 -0
- package/dist/node_modules/zen-observable-ts/module.js +402 -0
- package/dist/node_modules/zen-observable-ts/module.js.map +1 -0
- package/dist/utils/nativeBridge.d.ts +3 -0
- package/dist/utils/nativeBridge.d.ts.map +1 -0
- package/dist/utils/nativeBridge.js +2 -0
- package/package.json +106 -0
|
@@ -0,0 +1,1094 @@
|
|
|
1
|
+
import { useComplianceAuditLog as e, useComplianceSettings as t, useComplianceSettingsMutations as n, useSuppressionMutations as r, useSuppressions as i } from "../hooks/useComplianceOperations.js";
|
|
2
|
+
import "../hooks/index.js";
|
|
3
|
+
import { useNewsletter as a } from "../providers/NewsletterProvider.js";
|
|
4
|
+
import { NEWSLETTER_PERMISSIONS as o } from "../constants/permissions.js";
|
|
5
|
+
import { useTr as s } from "../shared/hooks/useTr.js";
|
|
6
|
+
import { useCallback as c, useMemo as l, useState as u } from "react";
|
|
7
|
+
import { AccessDenied as d } from "@burdenoff/fe-libs/shared/components";
|
|
8
|
+
import { AlertCircle as f, AlertTriangle as p, CheckCircle as m, Clock as h, Download as g, FileText as _, Loader2 as v, Mail as y, RefreshCw as b, Search as x, Settings as S, Shield as C, ShieldAlert as w, ShieldCheck as T, Trash2 as E, UserX as D } from "lucide-react";
|
|
9
|
+
import { usePermissions as O } from "@burdenoff/fe-libs/shared/providers/shell";
|
|
10
|
+
import { jsx as k, jsxs as A } from "react/jsx-runtime";
|
|
11
|
+
import { useI18n as j } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
12
|
+
//#region src/newsletter/pages/CompliancePage.tsx
|
|
13
|
+
function M() {
|
|
14
|
+
let { t: e } = j(), n = c((t, n) => {
|
|
15
|
+
let r = e(t);
|
|
16
|
+
return r === t ? n : r;
|
|
17
|
+
}, [e]), { productId: r } = a(), { hasPermission: i, isLoading: s, permissions: p } = O(), [h, g] = u("CHECKLIST"), [y, b] = u(null), [x, C] = u(""), { settings: w, loading: E } = t(r), M = (e, t) => {
|
|
18
|
+
b({
|
|
19
|
+
type: e,
|
|
20
|
+
message: t
|
|
21
|
+
}), setTimeout(() => b(null), 5e3);
|
|
22
|
+
}, I = l(() => {
|
|
23
|
+
let e = !!w?.physicalAddress?.trim(), t = !!w?.unsubscribeUrl?.trim(), r = !!w?.privacyPolicyUrl?.trim(), i = !!w?.doubleOptIn, a = [
|
|
24
|
+
{
|
|
25
|
+
label: n("compliance.physicalAddressFooter", "Physical address in footer"),
|
|
26
|
+
status: e ? "PASS" : "FAIL"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
label: n("compliance.oneClickUnsubscribe", "One-click unsubscribe link"),
|
|
30
|
+
status: t ? "PASS" : "FAIL"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
label: n("compliance.clearSenderIdentification", "Clear sender identification"),
|
|
34
|
+
status: "PASS"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
label: n("compliance.accurateSubjectLines", "Accurate subject lines"),
|
|
38
|
+
status: "PASS"
|
|
39
|
+
}
|
|
40
|
+
], o = [
|
|
41
|
+
{
|
|
42
|
+
label: n("compliance.explicitConsentTracking", "Explicit consent tracking"),
|
|
43
|
+
status: "PASS"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
label: n("compliance.dataExportFunctionality", "Data export functionality"),
|
|
47
|
+
status: "PASS"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
label: n("compliance.privacyPolicyLink", "Privacy policy link"),
|
|
51
|
+
status: r ? "PASS" : "FAIL"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
label: n("compliance.rightToErasureSupport", "Right to erasure support"),
|
|
55
|
+
status: "PASS"
|
|
56
|
+
}
|
|
57
|
+
], s = [
|
|
58
|
+
{
|
|
59
|
+
label: n("compliance.consentTracking", "Consent tracking"),
|
|
60
|
+
status: i ? "PASS" : "WARN"
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
label: n("compliance.senderContactInformation", "Sender contact information"),
|
|
64
|
+
status: e ? "PASS" : "FAIL"
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
label: n("compliance.unsubscribeMechanism", "Unsubscribe mechanism"),
|
|
68
|
+
status: "PASS"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
label: n("compliance.consentExpiryManagement", "Consent expiry management"),
|
|
72
|
+
status: "WARN"
|
|
73
|
+
}
|
|
74
|
+
], c = [
|
|
75
|
+
{
|
|
76
|
+
label: n("compliance.privacyPolicyDisclosure", "Privacy policy disclosure"),
|
|
77
|
+
status: r ? "PASS" : "FAIL"
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
label: n("compliance.dataDeletionCapability", "Data deletion capability"),
|
|
81
|
+
status: "PASS"
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
label: n("compliance.optOutMechanism", "Opt-out mechanism"),
|
|
85
|
+
status: "PASS"
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
label: n("compliance.doNotSellOption", "\"Do Not Sell\" option"),
|
|
89
|
+
status: "PASS"
|
|
90
|
+
}
|
|
91
|
+
], l = (e) => e.some((e) => e.status === "FAIL") ? "NON_COMPLIANT" : e.some((e) => e.status === "WARN") ? "WARNING" : "COMPLIANT";
|
|
92
|
+
return [
|
|
93
|
+
{
|
|
94
|
+
id: "CAN_SPAM",
|
|
95
|
+
name: n("compliance.canSpamAct", "CAN-SPAM Act (US)"),
|
|
96
|
+
description: n("compliance.canSpamDescription", "Physical mailing address included, unsubscribe link present, no deceptive subject lines"),
|
|
97
|
+
status: l(a),
|
|
98
|
+
items: a
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
id: "GDPR",
|
|
102
|
+
name: n("compliance.gdprEu", "GDPR (EU)"),
|
|
103
|
+
description: n("compliance.gdprDescription", "Explicit consent obtained, data export available, consent records maintained"),
|
|
104
|
+
status: l(o),
|
|
105
|
+
items: o
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
id: "CASL",
|
|
109
|
+
name: n("compliance.caslCanada", "CASL (Canada)"),
|
|
110
|
+
description: n("compliance.caslDescription", "Express or implied consent, sender identification, unsubscribe mechanism"),
|
|
111
|
+
status: l(s),
|
|
112
|
+
items: s
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
id: "CCPA",
|
|
116
|
+
name: n("compliance.ccpaCalifornia", "CCPA (California)"),
|
|
117
|
+
description: n("compliance.ccpaDescription", "Data disclosure, opt-out mechanism, deletion requests, privacy policy"),
|
|
118
|
+
status: l(c),
|
|
119
|
+
items: c
|
|
120
|
+
}
|
|
121
|
+
];
|
|
122
|
+
}, [w, n]), R = () => {
|
|
123
|
+
let e = I.length, t = I.filter((e) => e.status === "COMPLIANT").length;
|
|
124
|
+
return Math.round(t / e * 100);
|
|
125
|
+
}, z = (Array.isArray(p) ? p : p?.permissionStrings)?.some?.((e) => e.startsWith("tenantmodule-newsletter:")) ? i(o.CONFIG_VIEW) : !0, B = [
|
|
126
|
+
{
|
|
127
|
+
id: "CHECKLIST",
|
|
128
|
+
label: n("compliance.tabChecklist", "Compliance Checklist"),
|
|
129
|
+
icon: T
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
id: "SUPPRESSION",
|
|
133
|
+
label: n("compliance.tabSuppression", "Suppression List"),
|
|
134
|
+
icon: D
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
id: "SETTINGS",
|
|
138
|
+
label: n("compliance.tabSettings", "Settings"),
|
|
139
|
+
icon: S
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
id: "AUDIT",
|
|
143
|
+
label: n("compliance.tabAudit", "Audit Log"),
|
|
144
|
+
icon: _
|
|
145
|
+
}
|
|
146
|
+
];
|
|
147
|
+
return s ? /* @__PURE__ */ k("div", {
|
|
148
|
+
className: "flex items-center justify-center h-full",
|
|
149
|
+
children: /* @__PURE__ */ A("div", {
|
|
150
|
+
className: "flex items-center gap-2 text-muted-foreground",
|
|
151
|
+
children: [/* @__PURE__ */ k(v, {
|
|
152
|
+
className: "animate-spin",
|
|
153
|
+
size: 24
|
|
154
|
+
}), /* @__PURE__ */ k("span", { children: n("newsletterCommon.loading", "Loading...") })]
|
|
155
|
+
})
|
|
156
|
+
}) : !s && p && p.permissionStrings?.length > 0 && !z ? /* @__PURE__ */ k(d, {}) : /* @__PURE__ */ A("div", {
|
|
157
|
+
className: "flex flex-col h-full",
|
|
158
|
+
children: [
|
|
159
|
+
y && /* @__PURE__ */ A("div", {
|
|
160
|
+
className: `fixed top-4 right-4 z-50 flex items-center gap-2 px-4 py-3 rounded-lg shadow-lg ${y.type === "success" ? "bg-green-100 text-green-800 border border-green-200" : "bg-red-100 text-red-800 border border-red-200"}`,
|
|
161
|
+
children: [y.type === "success" ? /* @__PURE__ */ k(m, { size: 20 }) : /* @__PURE__ */ k(f, { size: 20 }), /* @__PURE__ */ k("span", { children: y.message })]
|
|
162
|
+
}),
|
|
163
|
+
/* @__PURE__ */ A("div", {
|
|
164
|
+
className: "p-6 border-b",
|
|
165
|
+
children: [/* @__PURE__ */ A("div", {
|
|
166
|
+
className: "flex items-center justify-between",
|
|
167
|
+
children: [/* @__PURE__ */ A("div", { children: [/* @__PURE__ */ k("h1", {
|
|
168
|
+
className: "text-2xl font-semibold text-foreground",
|
|
169
|
+
children: n("compliance.complianceManagement", "Compliance Management")
|
|
170
|
+
}), /* @__PURE__ */ k("p", {
|
|
171
|
+
className: "mt-1 text-sm text-muted-foreground",
|
|
172
|
+
children: n("compliance.description", "Ensure your newsletter campaigns comply with regulations")
|
|
173
|
+
})] }), /* @__PURE__ */ k("div", {
|
|
174
|
+
className: "flex items-center gap-4",
|
|
175
|
+
children: /* @__PURE__ */ A("div", {
|
|
176
|
+
className: "flex items-center gap-2 px-4 py-2 bg-green-500/10 rounded-lg",
|
|
177
|
+
children: [/* @__PURE__ */ k(T, {
|
|
178
|
+
size: 24,
|
|
179
|
+
className: "text-green-600"
|
|
180
|
+
}), /* @__PURE__ */ A("div", { children: [/* @__PURE__ */ k("div", {
|
|
181
|
+
className: "text-sm text-muted-foreground",
|
|
182
|
+
children: n("compliance.complianceScore", "Compliance Score")
|
|
183
|
+
}), /* @__PURE__ */ k("div", {
|
|
184
|
+
className: "text-xl font-bold text-green-600",
|
|
185
|
+
children: E ? "..." : `${R()}%`
|
|
186
|
+
})] })]
|
|
187
|
+
})
|
|
188
|
+
})]
|
|
189
|
+
}), /* @__PURE__ */ k("div", {
|
|
190
|
+
className: "flex items-center gap-1 mt-6",
|
|
191
|
+
children: B.map((e) => /* @__PURE__ */ A("button", {
|
|
192
|
+
onClick: () => g(e.id),
|
|
193
|
+
className: `flex items-center gap-2 px-4 py-2 rounded-lg transition-colors ${h === e.id ? "bg-primary/10 text-primary" : "text-muted-foreground hover:bg-accent"}`,
|
|
194
|
+
children: [/* @__PURE__ */ k(e.icon, { size: 18 }), e.label]
|
|
195
|
+
}, e.id))
|
|
196
|
+
})]
|
|
197
|
+
}),
|
|
198
|
+
/* @__PURE__ */ A("div", {
|
|
199
|
+
className: "flex-1 overflow-auto",
|
|
200
|
+
children: [
|
|
201
|
+
h === "CHECKLIST" && /* @__PURE__ */ k(N, { complianceItems: I }),
|
|
202
|
+
h === "SUPPRESSION" && /* @__PURE__ */ k(P, {
|
|
203
|
+
searchQuery: x,
|
|
204
|
+
setSearchQuery: C,
|
|
205
|
+
showNotification: M
|
|
206
|
+
}),
|
|
207
|
+
h === "SETTINGS" && /* @__PURE__ */ k(F, {
|
|
208
|
+
platformProductId: r,
|
|
209
|
+
showNotification: M
|
|
210
|
+
}),
|
|
211
|
+
h === "AUDIT" && /* @__PURE__ */ k(L, { platformProductId: r })
|
|
212
|
+
]
|
|
213
|
+
})
|
|
214
|
+
]
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
function N({ complianceItems: e }) {
|
|
218
|
+
let t = s(), n = (e) => {
|
|
219
|
+
switch (e) {
|
|
220
|
+
case "COMPLIANT":
|
|
221
|
+
case "PASS": return /* @__PURE__ */ k(m, {
|
|
222
|
+
size: 20,
|
|
223
|
+
className: "text-green-600"
|
|
224
|
+
});
|
|
225
|
+
case "WARNING":
|
|
226
|
+
case "WARN": return /* @__PURE__ */ k(p, {
|
|
227
|
+
size: 20,
|
|
228
|
+
className: "text-yellow-600"
|
|
229
|
+
});
|
|
230
|
+
case "NON_COMPLIANT":
|
|
231
|
+
case "FAIL": return /* @__PURE__ */ k(f, {
|
|
232
|
+
size: 20,
|
|
233
|
+
className: "text-red-600"
|
|
234
|
+
});
|
|
235
|
+
default: return /* @__PURE__ */ k(f, {
|
|
236
|
+
size: 20,
|
|
237
|
+
className: "text-muted-foreground"
|
|
238
|
+
});
|
|
239
|
+
}
|
|
240
|
+
}, r = (e) => {
|
|
241
|
+
let n = {
|
|
242
|
+
COMPLIANT: "bg-green-500/10 text-green-600 dark:text-green-400",
|
|
243
|
+
WARNING: "bg-yellow-500/10 text-yellow-600 dark:text-yellow-400",
|
|
244
|
+
NON_COMPLIANT: "bg-destructive/10 text-destructive"
|
|
245
|
+
}, r = {
|
|
246
|
+
COMPLIANT: t("compliance.compliant", "Compliant"),
|
|
247
|
+
WARNING: t("compliance.needsReview", "Needs Review"),
|
|
248
|
+
NON_COMPLIANT: t("compliance.nonCompliant", "Non-Compliant")
|
|
249
|
+
};
|
|
250
|
+
return /* @__PURE__ */ k("span", {
|
|
251
|
+
className: `px-2.5 py-0.5 rounded-full text-xs font-medium ${n[e]}`,
|
|
252
|
+
children: r[e]
|
|
253
|
+
});
|
|
254
|
+
};
|
|
255
|
+
return /* @__PURE__ */ A("div", {
|
|
256
|
+
className: "p-6 space-y-4",
|
|
257
|
+
children: [e.map((e) => /* @__PURE__ */ k("div", {
|
|
258
|
+
className: "border rounded-lg p-4",
|
|
259
|
+
children: /* @__PURE__ */ A("div", {
|
|
260
|
+
className: "flex items-start gap-3",
|
|
261
|
+
children: [/* @__PURE__ */ k("div", {
|
|
262
|
+
className: "flex-shrink-0 mt-1",
|
|
263
|
+
children: e.status === "COMPLIANT" ? /* @__PURE__ */ k(T, {
|
|
264
|
+
size: 28,
|
|
265
|
+
className: "text-green-600"
|
|
266
|
+
}) : e.status === "WARNING" ? /* @__PURE__ */ k(w, {
|
|
267
|
+
size: 28,
|
|
268
|
+
className: "text-yellow-600"
|
|
269
|
+
}) : /* @__PURE__ */ k(C, {
|
|
270
|
+
size: 28,
|
|
271
|
+
className: "text-red-600"
|
|
272
|
+
})
|
|
273
|
+
}), /* @__PURE__ */ A("div", {
|
|
274
|
+
className: "flex-1",
|
|
275
|
+
children: [
|
|
276
|
+
/* @__PURE__ */ A("div", {
|
|
277
|
+
className: "flex items-center justify-between mb-1",
|
|
278
|
+
children: [/* @__PURE__ */ k("h3", {
|
|
279
|
+
className: "font-medium text-foreground",
|
|
280
|
+
children: e.name
|
|
281
|
+
}), r(e.status)]
|
|
282
|
+
}),
|
|
283
|
+
/* @__PURE__ */ k("p", {
|
|
284
|
+
className: "text-sm text-muted-foreground mb-3",
|
|
285
|
+
children: e.description
|
|
286
|
+
}),
|
|
287
|
+
/* @__PURE__ */ k("div", {
|
|
288
|
+
className: "grid grid-cols-2 gap-2",
|
|
289
|
+
children: e.items.map((e, t) => /* @__PURE__ */ A("div", {
|
|
290
|
+
className: "flex items-center gap-2 text-sm",
|
|
291
|
+
children: [n(e.status), /* @__PURE__ */ k("span", {
|
|
292
|
+
className: e.status === "PASS" ? "text-foreground" : e.status === "WARN" ? "text-yellow-600 dark:text-yellow-400" : "text-destructive",
|
|
293
|
+
children: e.label
|
|
294
|
+
})]
|
|
295
|
+
}, t))
|
|
296
|
+
})
|
|
297
|
+
]
|
|
298
|
+
})]
|
|
299
|
+
})
|
|
300
|
+
}, e.id)), /* @__PURE__ */ A("div", {
|
|
301
|
+
className: "border border-border rounded-lg p-4 bg-primary/5",
|
|
302
|
+
children: [/* @__PURE__ */ k("h3", {
|
|
303
|
+
className: "font-medium text-primary mb-2",
|
|
304
|
+
children: t("compliance.bestPractices", "Compliance Best Practices")
|
|
305
|
+
}), /* @__PURE__ */ A("ul", {
|
|
306
|
+
className: "text-sm text-primary/80 space-y-1",
|
|
307
|
+
children: [
|
|
308
|
+
/* @__PURE__ */ A("li", { children: [
|
|
309
|
+
"•",
|
|
310
|
+
" ",
|
|
311
|
+
t("compliance.bestPractice1", "Always include a clear unsubscribe link in every email")
|
|
312
|
+
] }),
|
|
313
|
+
/* @__PURE__ */ A("li", { children: [
|
|
314
|
+
"•",
|
|
315
|
+
" ",
|
|
316
|
+
t("compliance.bestPractice2", "Keep accurate records of consent for all subscribers")
|
|
317
|
+
] }),
|
|
318
|
+
/* @__PURE__ */ A("li", { children: [
|
|
319
|
+
"•",
|
|
320
|
+
" ",
|
|
321
|
+
t("compliance.bestPractice3", "Honor unsubscribe requests within 10 business days (CAN-SPAM)")
|
|
322
|
+
] }),
|
|
323
|
+
/* @__PURE__ */ A("li", { children: [
|
|
324
|
+
"•",
|
|
325
|
+
" ",
|
|
326
|
+
t("compliance.bestPractice4", "Provide a physical mailing address in your email footer")
|
|
327
|
+
] }),
|
|
328
|
+
/* @__PURE__ */ A("li", { children: ["• ", t("compliance.bestPractice5", "Use accurate sender names and subject lines")] })
|
|
329
|
+
]
|
|
330
|
+
})]
|
|
331
|
+
})]
|
|
332
|
+
});
|
|
333
|
+
}
|
|
334
|
+
function P({ searchQuery: e, setSearchQuery: t, showNotification: n }) {
|
|
335
|
+
let { t: o, locale: s } = j(), l = c((e, t) => {
|
|
336
|
+
let n = o(e);
|
|
337
|
+
return n === e ? t : n;
|
|
338
|
+
}, [o]), { productId: d } = a(), [m, h] = u("ALL"), { suppressions: _, loading: S, error: C, refetch: w } = i({ platformProductId: d }, 100), { removeSuppression: T, removing: O } = r(), M = _.filter((t) => {
|
|
339
|
+
if (m !== "ALL" && t.reason !== m) return !1;
|
|
340
|
+
if (e) {
|
|
341
|
+
let n = e.toLowerCase();
|
|
342
|
+
return t.email.toLowerCase().includes(n);
|
|
343
|
+
}
|
|
344
|
+
return !0;
|
|
345
|
+
}), N = {
|
|
346
|
+
unsubscribed: _.filter((e) => e.reason === "unsubscribed").length,
|
|
347
|
+
bounced: _.filter((e) => e.reason === "bounced" || e.reason === "hard_bounce").length,
|
|
348
|
+
complained: _.filter((e) => e.reason === "complained" || e.reason === "spam_complaint").length,
|
|
349
|
+
total: _.length
|
|
350
|
+
}, P = () => {
|
|
351
|
+
try {
|
|
352
|
+
let e = [[
|
|
353
|
+
l("newsletter.email", "Email"),
|
|
354
|
+
l("compliance.reason", "Reason"),
|
|
355
|
+
l("compliance.source", "Source"),
|
|
356
|
+
l("compliance.addedAt", "Added At")
|
|
357
|
+
], ..._.map((e) => [
|
|
358
|
+
e.email,
|
|
359
|
+
e.reason,
|
|
360
|
+
e.source || "",
|
|
361
|
+
e.addedAt
|
|
362
|
+
])].map((e) => e.join(",")).join("\n"), t = new Blob([e], { type: "text/csv" }), r = URL.createObjectURL(t), i = document.createElement("a");
|
|
363
|
+
i.href = r, i.download = `${l("compliance.suppressionExportFilename", "suppression-list")}.csv`, i.click(), URL.revokeObjectURL(r), n("success", l("compliance.suppressionListExported", "Suppression list exported"));
|
|
364
|
+
} catch (e) {
|
|
365
|
+
n("error", `${l("subscribers.failedToExport", "Failed to export")}: ${e instanceof Error ? e.message : l("newsletter.unknownError", "Unknown error")}`);
|
|
366
|
+
}
|
|
367
|
+
}, F = async (e) => {
|
|
368
|
+
if (confirm(`${l("compliance.confirmRemoveSuppressionPrefix", "Remove")} ${e.email} ${l("compliance.confirmRemoveSuppressionSuffix", "from suppression list? They will be able to receive emails again.")}`)) try {
|
|
369
|
+
await T(e.id), n("success", `${e.email} ${l("compliance.removedFromSuppressionSuffix", "removed from suppression list")}`), w();
|
|
370
|
+
} catch (e) {
|
|
371
|
+
n("error", `${l("compliance.failedToRemove", "Failed to remove")}: ${e instanceof Error ? e.message : l("newsletter.unknownError", "Unknown error")}`);
|
|
372
|
+
}
|
|
373
|
+
}, I = (e) => e ? new Date(e).toLocaleDateString(s || "en-US", {
|
|
374
|
+
month: "short",
|
|
375
|
+
day: "numeric",
|
|
376
|
+
year: "numeric"
|
|
377
|
+
}) : l("newsletterCommon.notAvailable", "N/A"), L = (e) => {
|
|
378
|
+
let t = {
|
|
379
|
+
unsubscribed: "bg-muted text-muted-foreground",
|
|
380
|
+
bounced: "bg-destructive/10 text-destructive",
|
|
381
|
+
hard_bounce: "bg-destructive/10 text-destructive",
|
|
382
|
+
complained: "bg-orange-500/10 text-orange-600 dark:text-orange-400",
|
|
383
|
+
spam_complaint: "bg-orange-500/10 text-orange-600 dark:text-orange-400",
|
|
384
|
+
manual: "bg-primary/10 text-primary"
|
|
385
|
+
}, n = {
|
|
386
|
+
unsubscribed: l("compliance.unsubscribed", "Unsubscribed"),
|
|
387
|
+
bounced: l("compliance.bounced", "Bounced"),
|
|
388
|
+
hard_bounce: l("compliance.hardBounce", "Hard bounce"),
|
|
389
|
+
complained: l("compliance.complained", "Complained"),
|
|
390
|
+
spam_complaint: l("compliance.spamComplaint", "Spam complaint"),
|
|
391
|
+
manual: l("compliance.manual", "Manual")
|
|
392
|
+
};
|
|
393
|
+
return /* @__PURE__ */ k("span", {
|
|
394
|
+
className: `px-2 py-0.5 rounded-full text-xs font-medium ${t[e] || "bg-muted text-muted-foreground"}`,
|
|
395
|
+
children: n[e] || e.replace("_", " ")
|
|
396
|
+
});
|
|
397
|
+
};
|
|
398
|
+
return C ? /* @__PURE__ */ A("div", {
|
|
399
|
+
className: "flex flex-col items-center justify-center h-full text-center p-6",
|
|
400
|
+
children: [
|
|
401
|
+
/* @__PURE__ */ k(f, {
|
|
402
|
+
size: 48,
|
|
403
|
+
className: "text-red-500 mb-4"
|
|
404
|
+
}),
|
|
405
|
+
/* @__PURE__ */ k("h3", {
|
|
406
|
+
className: "text-lg font-medium text-foreground mb-2",
|
|
407
|
+
children: l("compliance.failedLoadSuppression", "Failed to load suppression list")
|
|
408
|
+
}),
|
|
409
|
+
/* @__PURE__ */ k("p", {
|
|
410
|
+
className: "text-sm text-muted-foreground mb-4",
|
|
411
|
+
children: C.message
|
|
412
|
+
}),
|
|
413
|
+
/* @__PURE__ */ k("button", {
|
|
414
|
+
onClick: () => w(),
|
|
415
|
+
className: "px-4 py-2 bg-primary text-white rounded-lg hover:bg-primary/90 transition-colors",
|
|
416
|
+
children: l("newsletterCommon.tryAgain", "Try Again")
|
|
417
|
+
})
|
|
418
|
+
]
|
|
419
|
+
}) : /* @__PURE__ */ A("div", {
|
|
420
|
+
className: "p-6",
|
|
421
|
+
children: [
|
|
422
|
+
/* @__PURE__ */ A("div", {
|
|
423
|
+
className: "grid grid-cols-4 gap-4 mb-6",
|
|
424
|
+
children: [
|
|
425
|
+
/* @__PURE__ */ A("div", {
|
|
426
|
+
className: "border rounded-lg p-4",
|
|
427
|
+
children: [/* @__PURE__ */ A("div", {
|
|
428
|
+
className: "flex items-center gap-2 mb-1",
|
|
429
|
+
children: [/* @__PURE__ */ k(D, {
|
|
430
|
+
size: 18,
|
|
431
|
+
className: "text-muted-foreground"
|
|
432
|
+
}), /* @__PURE__ */ k("span", {
|
|
433
|
+
className: "text-sm text-muted-foreground",
|
|
434
|
+
children: l("compliance.totalSuppressed", "Total Suppressed")
|
|
435
|
+
})]
|
|
436
|
+
}), /* @__PURE__ */ k("div", {
|
|
437
|
+
className: "text-2xl font-bold text-foreground",
|
|
438
|
+
children: N.total
|
|
439
|
+
})]
|
|
440
|
+
}),
|
|
441
|
+
/* @__PURE__ */ A("div", {
|
|
442
|
+
className: "border rounded-lg p-4",
|
|
443
|
+
children: [/* @__PURE__ */ A("div", {
|
|
444
|
+
className: "flex items-center gap-2 mb-1",
|
|
445
|
+
children: [/* @__PURE__ */ k(y, {
|
|
446
|
+
size: 18,
|
|
447
|
+
className: "text-muted-foreground"
|
|
448
|
+
}), /* @__PURE__ */ k("span", {
|
|
449
|
+
className: "text-sm text-muted-foreground",
|
|
450
|
+
children: l("compliance.unsubscribed", "Unsubscribed")
|
|
451
|
+
})]
|
|
452
|
+
}), /* @__PURE__ */ k("div", {
|
|
453
|
+
className: "text-2xl font-bold text-foreground",
|
|
454
|
+
children: N.unsubscribed
|
|
455
|
+
})]
|
|
456
|
+
}),
|
|
457
|
+
/* @__PURE__ */ A("div", {
|
|
458
|
+
className: "border rounded-lg p-4",
|
|
459
|
+
children: [/* @__PURE__ */ A("div", {
|
|
460
|
+
className: "flex items-center gap-2 mb-1",
|
|
461
|
+
children: [/* @__PURE__ */ k(p, {
|
|
462
|
+
size: 18,
|
|
463
|
+
className: "text-red-500"
|
|
464
|
+
}), /* @__PURE__ */ k("span", {
|
|
465
|
+
className: "text-sm text-muted-foreground",
|
|
466
|
+
children: l("compliance.bounced", "Bounced")
|
|
467
|
+
})]
|
|
468
|
+
}), /* @__PURE__ */ k("div", {
|
|
469
|
+
className: "text-2xl font-bold text-red-600",
|
|
470
|
+
children: N.bounced
|
|
471
|
+
})]
|
|
472
|
+
}),
|
|
473
|
+
/* @__PURE__ */ A("div", {
|
|
474
|
+
className: "border rounded-lg p-4",
|
|
475
|
+
children: [/* @__PURE__ */ A("div", {
|
|
476
|
+
className: "flex items-center gap-2 mb-1",
|
|
477
|
+
children: [/* @__PURE__ */ k(f, {
|
|
478
|
+
size: 18,
|
|
479
|
+
className: "text-orange-500"
|
|
480
|
+
}), /* @__PURE__ */ k("span", {
|
|
481
|
+
className: "text-sm text-muted-foreground",
|
|
482
|
+
children: l("compliance.complained", "Complained")
|
|
483
|
+
})]
|
|
484
|
+
}), /* @__PURE__ */ k("div", {
|
|
485
|
+
className: "text-2xl font-bold text-orange-600",
|
|
486
|
+
children: N.complained
|
|
487
|
+
})]
|
|
488
|
+
})
|
|
489
|
+
]
|
|
490
|
+
}),
|
|
491
|
+
/* @__PURE__ */ A("div", {
|
|
492
|
+
className: "flex items-center justify-between mb-4",
|
|
493
|
+
children: [/* @__PURE__ */ A("div", {
|
|
494
|
+
className: "flex items-center gap-4",
|
|
495
|
+
children: [/* @__PURE__ */ A("div", {
|
|
496
|
+
className: "relative",
|
|
497
|
+
children: [/* @__PURE__ */ k(x, {
|
|
498
|
+
className: "absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground",
|
|
499
|
+
size: 18
|
|
500
|
+
}), /* @__PURE__ */ k("input", {
|
|
501
|
+
type: "text",
|
|
502
|
+
placeholder: l("compliance.searchEmails", "Search emails..."),
|
|
503
|
+
value: e,
|
|
504
|
+
onChange: (e) => t(e.target.value),
|
|
505
|
+
className: "pl-10 pr-4 py-2 border border-border rounded-lg focus:ring-2 focus:ring-primary/50 focus:border-transparent w-64"
|
|
506
|
+
})]
|
|
507
|
+
}), /* @__PURE__ */ A("select", {
|
|
508
|
+
value: m,
|
|
509
|
+
onChange: (e) => h(e.target.value),
|
|
510
|
+
className: "px-4 py-2 border border-border rounded-lg focus:ring-2 focus:ring-primary/50 focus:border-transparent",
|
|
511
|
+
children: [
|
|
512
|
+
/* @__PURE__ */ k("option", {
|
|
513
|
+
value: "ALL",
|
|
514
|
+
children: l("compliance.allReasons", "All Reasons")
|
|
515
|
+
}),
|
|
516
|
+
/* @__PURE__ */ k("option", {
|
|
517
|
+
value: "unsubscribed",
|
|
518
|
+
children: l("compliance.unsubscribed", "Unsubscribed")
|
|
519
|
+
}),
|
|
520
|
+
/* @__PURE__ */ k("option", {
|
|
521
|
+
value: "bounced",
|
|
522
|
+
children: l("compliance.bounced", "Bounced")
|
|
523
|
+
}),
|
|
524
|
+
/* @__PURE__ */ k("option", {
|
|
525
|
+
value: "complained",
|
|
526
|
+
children: l("compliance.complained", "Complained")
|
|
527
|
+
}),
|
|
528
|
+
/* @__PURE__ */ k("option", {
|
|
529
|
+
value: "manual",
|
|
530
|
+
children: l("compliance.manual", "Manual")
|
|
531
|
+
})
|
|
532
|
+
]
|
|
533
|
+
})]
|
|
534
|
+
}), /* @__PURE__ */ A("div", {
|
|
535
|
+
className: "flex items-center gap-2",
|
|
536
|
+
children: [/* @__PURE__ */ k("button", {
|
|
537
|
+
onClick: () => w(),
|
|
538
|
+
className: "p-2 border border-border rounded-lg hover:bg-accent transition-colors",
|
|
539
|
+
title: l("newsletter.refresh", "Refresh"),
|
|
540
|
+
children: /* @__PURE__ */ k(b, {
|
|
541
|
+
size: 20,
|
|
542
|
+
className: S ? "animate-spin" : ""
|
|
543
|
+
})
|
|
544
|
+
}), /* @__PURE__ */ A("button", {
|
|
545
|
+
onClick: P,
|
|
546
|
+
disabled: _.length === 0,
|
|
547
|
+
className: "flex items-center gap-2 px-4 py-2 border border-border rounded-lg hover:bg-accent transition-colors disabled:opacity-50",
|
|
548
|
+
children: [/* @__PURE__ */ k(g, { size: 18 }), l("subscribers.export", "Export")]
|
|
549
|
+
})]
|
|
550
|
+
})]
|
|
551
|
+
}),
|
|
552
|
+
S && _.length === 0 ? /* @__PURE__ */ k("div", {
|
|
553
|
+
className: "flex items-center justify-center h-48",
|
|
554
|
+
children: /* @__PURE__ */ A("div", {
|
|
555
|
+
className: "flex items-center gap-2 text-muted-foreground",
|
|
556
|
+
children: [/* @__PURE__ */ k(v, {
|
|
557
|
+
className: "animate-spin",
|
|
558
|
+
size: 24
|
|
559
|
+
}), /* @__PURE__ */ k("span", { children: l("compliance.loadingSuppressionList", "Loading suppression list...") })]
|
|
560
|
+
})
|
|
561
|
+
}) : M.length === 0 ? /* @__PURE__ */ A("div", {
|
|
562
|
+
className: "text-center py-12",
|
|
563
|
+
children: [
|
|
564
|
+
/* @__PURE__ */ k(D, {
|
|
565
|
+
size: 48,
|
|
566
|
+
className: "mx-auto text-muted-foreground/50 mb-4"
|
|
567
|
+
}),
|
|
568
|
+
/* @__PURE__ */ k("h3", {
|
|
569
|
+
className: "text-lg font-medium text-foreground mb-2",
|
|
570
|
+
children: e ? l("compliance.noMatchingEmails", "No matching emails found") : l("compliance.suppressionListEmpty", "Suppression list is empty")
|
|
571
|
+
}),
|
|
572
|
+
/* @__PURE__ */ k("p", {
|
|
573
|
+
className: "text-sm text-muted-foreground",
|
|
574
|
+
children: e ? l("newsletterCommon.tryDifferentSearch", "Try a different search term") : l("compliance.suppressionDescription", "Unsubscribed, bounced, and complained emails will appear here")
|
|
575
|
+
})
|
|
576
|
+
]
|
|
577
|
+
}) : /* @__PURE__ */ k("div", {
|
|
578
|
+
className: "border rounded-lg overflow-hidden",
|
|
579
|
+
children: /* @__PURE__ */ A("table", {
|
|
580
|
+
className: "w-full",
|
|
581
|
+
children: [/* @__PURE__ */ k("thead", {
|
|
582
|
+
className: "bg-muted",
|
|
583
|
+
children: /* @__PURE__ */ A("tr", { children: [
|
|
584
|
+
/* @__PURE__ */ k("th", {
|
|
585
|
+
className: "px-4 py-3 text-left text-xs font-medium text-muted-foreground uppercase",
|
|
586
|
+
children: l("newsletter.email", "Email")
|
|
587
|
+
}),
|
|
588
|
+
/* @__PURE__ */ k("th", {
|
|
589
|
+
className: "px-4 py-3 text-left text-xs font-medium text-muted-foreground uppercase",
|
|
590
|
+
children: l("compliance.reason", "Reason")
|
|
591
|
+
}),
|
|
592
|
+
/* @__PURE__ */ k("th", {
|
|
593
|
+
className: "px-4 py-3 text-left text-xs font-medium text-muted-foreground uppercase",
|
|
594
|
+
children: l("compliance.source", "Source")
|
|
595
|
+
}),
|
|
596
|
+
/* @__PURE__ */ k("th", {
|
|
597
|
+
className: "px-4 py-3 text-left text-xs font-medium text-muted-foreground uppercase",
|
|
598
|
+
children: l("newsletterCommon.date", "Date")
|
|
599
|
+
}),
|
|
600
|
+
/* @__PURE__ */ k("th", {
|
|
601
|
+
className: "px-4 py-3 text-right text-xs font-medium text-muted-foreground uppercase",
|
|
602
|
+
children: l("newsletter.actions", "Actions")
|
|
603
|
+
})
|
|
604
|
+
] })
|
|
605
|
+
}), /* @__PURE__ */ k("tbody", {
|
|
606
|
+
className: "divide-y divide-border",
|
|
607
|
+
children: M.map((e) => /* @__PURE__ */ A("tr", {
|
|
608
|
+
className: "hover:bg-accent",
|
|
609
|
+
children: [
|
|
610
|
+
/* @__PURE__ */ k("td", {
|
|
611
|
+
className: "px-4 py-3 text-sm text-foreground",
|
|
612
|
+
children: e.email
|
|
613
|
+
}),
|
|
614
|
+
/* @__PURE__ */ k("td", {
|
|
615
|
+
className: "px-4 py-3",
|
|
616
|
+
children: L(e.reason)
|
|
617
|
+
}),
|
|
618
|
+
/* @__PURE__ */ k("td", {
|
|
619
|
+
className: "px-4 py-3 text-sm text-muted-foreground",
|
|
620
|
+
children: e.source || l("newsletterCommon.notAvailable", "N/A")
|
|
621
|
+
}),
|
|
622
|
+
/* @__PURE__ */ k("td", {
|
|
623
|
+
className: "px-4 py-3 text-sm text-muted-foreground",
|
|
624
|
+
children: I(e.addedAt)
|
|
625
|
+
}),
|
|
626
|
+
/* @__PURE__ */ k("td", {
|
|
627
|
+
className: "px-4 py-3 text-right",
|
|
628
|
+
children: /* @__PURE__ */ k("button", {
|
|
629
|
+
onClick: () => F(e),
|
|
630
|
+
disabled: O,
|
|
631
|
+
className: "p-1 text-destructive hover:bg-destructive/10 rounded",
|
|
632
|
+
title: l("compliance.removeFromSuppression", "Remove from suppression"),
|
|
633
|
+
children: /* @__PURE__ */ k(E, { size: 16 })
|
|
634
|
+
})
|
|
635
|
+
})
|
|
636
|
+
]
|
|
637
|
+
}, e.id))
|
|
638
|
+
})]
|
|
639
|
+
})
|
|
640
|
+
})
|
|
641
|
+
]
|
|
642
|
+
});
|
|
643
|
+
}
|
|
644
|
+
function F({ platformProductId: e, showNotification: n }) {
|
|
645
|
+
let r = s(), { settings: i, loading: a } = t(e);
|
|
646
|
+
return a ? /* @__PURE__ */ k("div", {
|
|
647
|
+
className: "flex items-center justify-center h-48",
|
|
648
|
+
children: /* @__PURE__ */ A("div", {
|
|
649
|
+
className: "flex items-center gap-2 text-muted-foreground",
|
|
650
|
+
children: [/* @__PURE__ */ k(v, {
|
|
651
|
+
className: "animate-spin",
|
|
652
|
+
size: 24
|
|
653
|
+
}), /* @__PURE__ */ k("span", { children: r("compliance.loadingSettings", "Loading settings...") })]
|
|
654
|
+
})
|
|
655
|
+
}) : /* @__PURE__ */ k(I, {
|
|
656
|
+
platformProductId: e,
|
|
657
|
+
initialSettings: i,
|
|
658
|
+
showNotification: n
|
|
659
|
+
}, i?.id ?? "new");
|
|
660
|
+
}
|
|
661
|
+
function I({ platformProductId: e, initialSettings: t, showNotification: r }) {
|
|
662
|
+
let i = s(), { upsertComplianceSettings: a, loading: o } = n(), [c, l] = u(t?.unsubscribeUrl ?? ""), [d, f] = u(t?.privacyPolicyUrl ?? ""), [p, h] = u(t?.physicalAddress ?? ""), [g, _] = u(t?.collectReasons ?? !1), [y, b] = u(t?.allowResubscribe ?? !1), [x, S] = u(t?.doubleOptIn ?? !1), [C, w] = u(String(t?.analyticsRetention ?? 365)), [T, E] = u(String(t?.inactiveCleanup ?? 0));
|
|
663
|
+
return /* @__PURE__ */ A("div", {
|
|
664
|
+
className: "p-6 space-y-6",
|
|
665
|
+
children: [
|
|
666
|
+
/* @__PURE__ */ A("div", {
|
|
667
|
+
className: "border rounded-lg p-4",
|
|
668
|
+
children: [/* @__PURE__ */ k("h3", {
|
|
669
|
+
className: "font-medium text-foreground mb-4",
|
|
670
|
+
children: i("compliance.unsubscribeSettings", "Unsubscribe Settings")
|
|
671
|
+
}), /* @__PURE__ */ A("div", {
|
|
672
|
+
className: "space-y-4",
|
|
673
|
+
children: [
|
|
674
|
+
/* @__PURE__ */ A("div", { children: [/* @__PURE__ */ k("label", {
|
|
675
|
+
className: "block text-sm font-medium text-foreground mb-1",
|
|
676
|
+
children: i("compliance.unsubscribeLandingPageUrl", "Unsubscribe Landing Page URL")
|
|
677
|
+
}), /* @__PURE__ */ k("input", {
|
|
678
|
+
type: "text",
|
|
679
|
+
value: c,
|
|
680
|
+
onChange: (e) => l(e.target.value),
|
|
681
|
+
className: "w-full px-3 py-2 border border-border rounded-lg focus:ring-2 focus:ring-primary/50 focus:border-transparent"
|
|
682
|
+
})] }),
|
|
683
|
+
/* @__PURE__ */ A("div", {
|
|
684
|
+
className: "flex items-center gap-2",
|
|
685
|
+
children: [/* @__PURE__ */ k("input", {
|
|
686
|
+
type: "checkbox",
|
|
687
|
+
id: "collect-reasons",
|
|
688
|
+
checked: g,
|
|
689
|
+
onChange: (e) => _(e.target.checked),
|
|
690
|
+
className: "rounded border-border"
|
|
691
|
+
}), /* @__PURE__ */ k("label", {
|
|
692
|
+
htmlFor: "collect-reasons",
|
|
693
|
+
className: "text-sm text-foreground",
|
|
694
|
+
children: i("compliance.collectUnsubscribeReasons", "Collect unsubscribe reasons (optional survey)")
|
|
695
|
+
})]
|
|
696
|
+
}),
|
|
697
|
+
/* @__PURE__ */ A("div", {
|
|
698
|
+
className: "flex items-center gap-2",
|
|
699
|
+
children: [/* @__PURE__ */ k("input", {
|
|
700
|
+
type: "checkbox",
|
|
701
|
+
id: "allow-resubscribe",
|
|
702
|
+
checked: y,
|
|
703
|
+
onChange: (e) => b(e.target.checked),
|
|
704
|
+
className: "rounded border-border"
|
|
705
|
+
}), /* @__PURE__ */ k("label", {
|
|
706
|
+
htmlFor: "allow-resubscribe",
|
|
707
|
+
className: "text-sm text-foreground",
|
|
708
|
+
children: i("compliance.allowResubscribeWorkflow", "Allow resubscribe workflow")
|
|
709
|
+
})]
|
|
710
|
+
})
|
|
711
|
+
]
|
|
712
|
+
})]
|
|
713
|
+
}),
|
|
714
|
+
/* @__PURE__ */ A("div", {
|
|
715
|
+
className: "border rounded-lg p-4",
|
|
716
|
+
children: [/* @__PURE__ */ k("h3", {
|
|
717
|
+
className: "font-medium text-foreground mb-4",
|
|
718
|
+
children: i("compliance.subscriptionSettings", "Subscription Settings")
|
|
719
|
+
}), /* @__PURE__ */ A("div", {
|
|
720
|
+
className: "space-y-4",
|
|
721
|
+
children: [/* @__PURE__ */ A("div", {
|
|
722
|
+
className: "flex items-center gap-2",
|
|
723
|
+
children: [/* @__PURE__ */ k("input", {
|
|
724
|
+
type: "checkbox",
|
|
725
|
+
id: "double-opt-in",
|
|
726
|
+
checked: x,
|
|
727
|
+
onChange: (e) => S(e.target.checked),
|
|
728
|
+
className: "rounded border-border"
|
|
729
|
+
}), /* @__PURE__ */ k("label", {
|
|
730
|
+
htmlFor: "double-opt-in",
|
|
731
|
+
className: "text-sm text-foreground",
|
|
732
|
+
children: i("compliance.enableDoubleOptIn", "Enable double opt-in confirmation emails")
|
|
733
|
+
})]
|
|
734
|
+
}), /* @__PURE__ */ k("p", {
|
|
735
|
+
className: "text-xs text-muted-foreground ml-6",
|
|
736
|
+
children: i("compliance.doubleOptInDescription", "Subscribers will receive a confirmation email and must click the link to complete subscription")
|
|
737
|
+
})]
|
|
738
|
+
})]
|
|
739
|
+
}),
|
|
740
|
+
/* @__PURE__ */ A("div", {
|
|
741
|
+
className: "border rounded-lg p-4",
|
|
742
|
+
children: [/* @__PURE__ */ k("h3", {
|
|
743
|
+
className: "font-medium text-foreground mb-4",
|
|
744
|
+
children: i("compliance.legalRequirements", "Legal Requirements")
|
|
745
|
+
}), /* @__PURE__ */ A("div", {
|
|
746
|
+
className: "space-y-4",
|
|
747
|
+
children: [/* @__PURE__ */ A("div", { children: [
|
|
748
|
+
/* @__PURE__ */ k("label", {
|
|
749
|
+
className: "block text-sm font-medium text-foreground mb-1",
|
|
750
|
+
children: i("compliance.physicalMailingAddress", "Physical Mailing Address (CAN-SPAM)")
|
|
751
|
+
}),
|
|
752
|
+
/* @__PURE__ */ k("textarea", {
|
|
753
|
+
value: p,
|
|
754
|
+
onChange: (e) => h(e.target.value),
|
|
755
|
+
rows: 2,
|
|
756
|
+
className: "w-full px-3 py-2 border border-border rounded-lg focus:ring-2 focus:ring-primary/50 focus:border-transparent"
|
|
757
|
+
}),
|
|
758
|
+
/* @__PURE__ */ k("p", {
|
|
759
|
+
className: "text-xs text-muted-foreground mt-1",
|
|
760
|
+
children: i("compliance.addressInFooter", "This address will appear in the footer of all emails")
|
|
761
|
+
})
|
|
762
|
+
] }), /* @__PURE__ */ A("div", { children: [/* @__PURE__ */ k("label", {
|
|
763
|
+
className: "block text-sm font-medium text-foreground mb-1",
|
|
764
|
+
children: i("compliance.privacyPolicyUrl", "Privacy Policy URL")
|
|
765
|
+
}), /* @__PURE__ */ k("input", {
|
|
766
|
+
type: "text",
|
|
767
|
+
value: d,
|
|
768
|
+
onChange: (e) => f(e.target.value),
|
|
769
|
+
className: "w-full px-3 py-2 border border-border rounded-lg focus:ring-2 focus:ring-primary/50 focus:border-transparent"
|
|
770
|
+
})] })]
|
|
771
|
+
})]
|
|
772
|
+
}),
|
|
773
|
+
/* @__PURE__ */ A("div", {
|
|
774
|
+
className: "border rounded-lg p-4",
|
|
775
|
+
children: [/* @__PURE__ */ k("h3", {
|
|
776
|
+
className: "font-medium text-foreground mb-4",
|
|
777
|
+
children: i("compliance.dataRetention", "Data Retention")
|
|
778
|
+
}), /* @__PURE__ */ A("div", {
|
|
779
|
+
className: "space-y-4",
|
|
780
|
+
children: [/* @__PURE__ */ A("div", { children: [/* @__PURE__ */ k("label", {
|
|
781
|
+
className: "block text-sm font-medium text-foreground mb-1",
|
|
782
|
+
children: i("compliance.analyticsDataRetention", "Analytics Data Retention")
|
|
783
|
+
}), /* @__PURE__ */ A("select", {
|
|
784
|
+
value: C,
|
|
785
|
+
onChange: (e) => w(e.target.value),
|
|
786
|
+
className: "w-full px-3 py-2 border rounded-lg focus:ring-2 focus:ring-primary/50 focus:border-transparent",
|
|
787
|
+
children: [
|
|
788
|
+
/* @__PURE__ */ k("option", {
|
|
789
|
+
value: "30",
|
|
790
|
+
children: i("compliance.thirtyDays", "30 days")
|
|
791
|
+
}),
|
|
792
|
+
/* @__PURE__ */ k("option", {
|
|
793
|
+
value: "90",
|
|
794
|
+
children: i("compliance.ninetyDays", "90 days")
|
|
795
|
+
}),
|
|
796
|
+
/* @__PURE__ */ k("option", {
|
|
797
|
+
value: "180",
|
|
798
|
+
children: i("compliance.sixMonths", "6 months")
|
|
799
|
+
}),
|
|
800
|
+
/* @__PURE__ */ k("option", {
|
|
801
|
+
value: "365",
|
|
802
|
+
children: i("compliance.oneYear", "1 year")
|
|
803
|
+
}),
|
|
804
|
+
/* @__PURE__ */ k("option", {
|
|
805
|
+
value: "730",
|
|
806
|
+
children: i("compliance.twoYears", "2 years")
|
|
807
|
+
})
|
|
808
|
+
]
|
|
809
|
+
})] }), /* @__PURE__ */ A("div", { children: [/* @__PURE__ */ k("label", {
|
|
810
|
+
className: "block text-sm font-medium text-foreground mb-1",
|
|
811
|
+
children: i("compliance.inactiveSubscriberCleanup", "Inactive Subscriber Cleanup")
|
|
812
|
+
}), /* @__PURE__ */ A("select", {
|
|
813
|
+
value: T,
|
|
814
|
+
onChange: (e) => E(e.target.value),
|
|
815
|
+
className: "w-full px-3 py-2 border rounded-lg focus:ring-2 focus:ring-primary/50 focus:border-transparent",
|
|
816
|
+
children: [
|
|
817
|
+
/* @__PURE__ */ k("option", {
|
|
818
|
+
value: "0",
|
|
819
|
+
children: i("compliance.never", "Never")
|
|
820
|
+
}),
|
|
821
|
+
/* @__PURE__ */ k("option", {
|
|
822
|
+
value: "180",
|
|
823
|
+
children: i("compliance.after6Months", "After 6 months of inactivity")
|
|
824
|
+
}),
|
|
825
|
+
/* @__PURE__ */ k("option", {
|
|
826
|
+
value: "365",
|
|
827
|
+
children: i("compliance.after1Year", "After 1 year of inactivity")
|
|
828
|
+
}),
|
|
829
|
+
/* @__PURE__ */ k("option", {
|
|
830
|
+
value: "730",
|
|
831
|
+
children: i("compliance.after2Years", "After 2 years of inactivity")
|
|
832
|
+
})
|
|
833
|
+
]
|
|
834
|
+
})] })]
|
|
835
|
+
})]
|
|
836
|
+
}),
|
|
837
|
+
/* @__PURE__ */ k("div", {
|
|
838
|
+
className: "flex justify-end",
|
|
839
|
+
children: /* @__PURE__ */ A("button", {
|
|
840
|
+
onClick: async () => {
|
|
841
|
+
if (!p.trim()) {
|
|
842
|
+
r("error", i("compliance.physicalAddressRequired", "Physical mailing address is required for CAN-SPAM compliance"));
|
|
843
|
+
return;
|
|
844
|
+
}
|
|
845
|
+
try {
|
|
846
|
+
await a(e, {
|
|
847
|
+
unsubscribeUrl: c || void 0,
|
|
848
|
+
privacyPolicyUrl: d || void 0,
|
|
849
|
+
physicalAddress: p,
|
|
850
|
+
collectReasons: g,
|
|
851
|
+
allowResubscribe: y,
|
|
852
|
+
doubleOptIn: x,
|
|
853
|
+
analyticsRetention: parseInt(C, 10),
|
|
854
|
+
inactiveCleanup: parseInt(T, 10)
|
|
855
|
+
}), r("success", i("compliance.settingsSaved", "Compliance settings saved"));
|
|
856
|
+
} catch (e) {
|
|
857
|
+
r("error", `${i("newsletter.failedToSave", "Failed to save")}: ${e instanceof Error ? e.message : i("newsletter.unknownError", "Unknown error")}`);
|
|
858
|
+
}
|
|
859
|
+
},
|
|
860
|
+
disabled: o,
|
|
861
|
+
className: "flex items-center gap-2 px-6 py-2 bg-primary text-white rounded-lg hover:bg-primary/90 transition-colors disabled:opacity-50",
|
|
862
|
+
children: [o ? /* @__PURE__ */ k(v, {
|
|
863
|
+
size: 18,
|
|
864
|
+
className: "animate-spin"
|
|
865
|
+
}) : /* @__PURE__ */ k(m, { size: 18 }), i("compliance.saveSettings", "Save Settings")]
|
|
866
|
+
})
|
|
867
|
+
})
|
|
868
|
+
]
|
|
869
|
+
});
|
|
870
|
+
}
|
|
871
|
+
function L({ platformProductId: t }) {
|
|
872
|
+
let { t: n, locale: r } = j(), i = c((e, t) => {
|
|
873
|
+
let r = n(e);
|
|
874
|
+
return r === e ? t : r;
|
|
875
|
+
}, [n]), [a, o] = u("7d"), { auditLogs: s, loading: d, error: p, refetch: m } = e(t, l(() => {
|
|
876
|
+
switch (a) {
|
|
877
|
+
case "7d": return 7;
|
|
878
|
+
case "30d": return 30;
|
|
879
|
+
case "90d": return 90;
|
|
880
|
+
case "all": return;
|
|
881
|
+
default: return 7;
|
|
882
|
+
}
|
|
883
|
+
}, [a])), y = (e) => {
|
|
884
|
+
let t = {
|
|
885
|
+
UNSUBSCRIBE: "bg-yellow-500/10 text-yellow-600 dark:text-yellow-400",
|
|
886
|
+
GDPR_EXPORT: "bg-primary/10 text-primary",
|
|
887
|
+
COMPLAINT: "bg-destructive/10 text-destructive",
|
|
888
|
+
BOUNCE: "bg-orange-500/10 text-orange-600 dark:text-orange-400",
|
|
889
|
+
RESUBSCRIBE: "bg-green-500/10 text-green-600 dark:text-green-400",
|
|
890
|
+
CONSENT: "bg-purple-500/10 text-purple-600 dark:text-purple-400",
|
|
891
|
+
SUPPRESSION: "bg-muted text-muted-foreground",
|
|
892
|
+
DELETE: "bg-muted text-muted-foreground"
|
|
893
|
+
}, n = {
|
|
894
|
+
UNSUBSCRIBE: i("compliance.eventUnsubscribe", "Unsubscribe"),
|
|
895
|
+
GDPR_EXPORT: i("compliance.eventGdprExport", "GDPR export"),
|
|
896
|
+
COMPLAINT: i("compliance.eventComplaint", "Complaint"),
|
|
897
|
+
BOUNCE: i("compliance.eventBounce", "Bounce"),
|
|
898
|
+
RESUBSCRIBE: i("compliance.eventResubscribe", "Resubscribe"),
|
|
899
|
+
CONSENT: i("compliance.eventConsent", "Consent"),
|
|
900
|
+
SUPPRESSION: i("compliance.eventSuppression", "Suppression"),
|
|
901
|
+
DELETE: i("compliance.eventDelete", "Delete")
|
|
902
|
+
};
|
|
903
|
+
return /* @__PURE__ */ k("span", {
|
|
904
|
+
className: `px-2 py-0.5 rounded-full text-xs font-medium ${t[e] || "bg-muted text-muted-foreground"}`,
|
|
905
|
+
children: n[e] || e.replace("_", " ")
|
|
906
|
+
});
|
|
907
|
+
}, b = (e) => new Date(e).toLocaleString(r || "en-US", {
|
|
908
|
+
month: "short",
|
|
909
|
+
day: "numeric",
|
|
910
|
+
hour: "2-digit",
|
|
911
|
+
minute: "2-digit"
|
|
912
|
+
});
|
|
913
|
+
return p ? /* @__PURE__ */ A("div", {
|
|
914
|
+
className: "flex flex-col items-center justify-center h-full text-center p-6",
|
|
915
|
+
children: [
|
|
916
|
+
/* @__PURE__ */ k(f, {
|
|
917
|
+
size: 48,
|
|
918
|
+
className: "text-red-500 mb-4"
|
|
919
|
+
}),
|
|
920
|
+
/* @__PURE__ */ k("h3", {
|
|
921
|
+
className: "text-lg font-medium text-foreground mb-2",
|
|
922
|
+
children: i("compliance.failedLoadAuditLog", "Failed to load audit log")
|
|
923
|
+
}),
|
|
924
|
+
/* @__PURE__ */ k("p", {
|
|
925
|
+
className: "text-sm text-muted-foreground mb-4",
|
|
926
|
+
children: p.message
|
|
927
|
+
}),
|
|
928
|
+
/* @__PURE__ */ k("button", {
|
|
929
|
+
onClick: () => m(),
|
|
930
|
+
className: "px-4 py-2 bg-primary text-white rounded-lg hover:bg-primary/90 transition-colors",
|
|
931
|
+
children: i("newsletterCommon.tryAgain", "Try Again")
|
|
932
|
+
})
|
|
933
|
+
]
|
|
934
|
+
}) : /* @__PURE__ */ A("div", {
|
|
935
|
+
className: "p-6",
|
|
936
|
+
children: [
|
|
937
|
+
/* @__PURE__ */ A("div", {
|
|
938
|
+
className: "flex items-center justify-between mb-4",
|
|
939
|
+
children: [/* @__PURE__ */ A("div", {
|
|
940
|
+
className: "flex items-center gap-2",
|
|
941
|
+
children: [/* @__PURE__ */ A("select", {
|
|
942
|
+
value: a,
|
|
943
|
+
onChange: (e) => o(e.target.value),
|
|
944
|
+
className: "px-4 py-2 border rounded-lg focus:ring-2 focus:ring-primary/50 focus:border-transparent",
|
|
945
|
+
children: [
|
|
946
|
+
/* @__PURE__ */ k("option", {
|
|
947
|
+
value: "7d",
|
|
948
|
+
children: i("analytics.last7Days", "Last 7 days")
|
|
949
|
+
}),
|
|
950
|
+
/* @__PURE__ */ k("option", {
|
|
951
|
+
value: "30d",
|
|
952
|
+
children: i("analytics.last30Days", "Last 30 days")
|
|
953
|
+
}),
|
|
954
|
+
/* @__PURE__ */ k("option", {
|
|
955
|
+
value: "90d",
|
|
956
|
+
children: i("analytics.last90Days", "Last 90 days")
|
|
957
|
+
}),
|
|
958
|
+
/* @__PURE__ */ k("option", {
|
|
959
|
+
value: "all",
|
|
960
|
+
children: i("analytics.allTime", "All time")
|
|
961
|
+
})
|
|
962
|
+
]
|
|
963
|
+
}), d && /* @__PURE__ */ k(v, {
|
|
964
|
+
size: 18,
|
|
965
|
+
className: "animate-spin text-muted-foreground"
|
|
966
|
+
})]
|
|
967
|
+
}), /* @__PURE__ */ A("button", {
|
|
968
|
+
onClick: () => {
|
|
969
|
+
if (s.length !== 0) try {
|
|
970
|
+
let e = [[
|
|
971
|
+
i("compliance.event", "Event"),
|
|
972
|
+
i("newsletter.email", "Email"),
|
|
973
|
+
i("compliance.details", "Details"),
|
|
974
|
+
i("compliance.ipAddress", "IP Address"),
|
|
975
|
+
i("compliance.timestamp", "Timestamp")
|
|
976
|
+
], ...s.map((e) => [
|
|
977
|
+
e.event,
|
|
978
|
+
e.email,
|
|
979
|
+
`"${e.details.replace(/"/g, "\"\"")}"`,
|
|
980
|
+
e.ip || "",
|
|
981
|
+
e.timestamp
|
|
982
|
+
])].map((e) => e.join(",")).join("\n"), t = new Blob([e], { type: "text/csv" }), n = URL.createObjectURL(t), r = document.createElement("a");
|
|
983
|
+
r.href = n, r.download = `${i("compliance.auditExportFilename", "compliance-audit-log")}.csv`, r.click(), URL.revokeObjectURL(n);
|
|
984
|
+
} catch {}
|
|
985
|
+
},
|
|
986
|
+
disabled: s.length === 0,
|
|
987
|
+
className: "flex items-center gap-2 px-4 py-2 border rounded-lg hover:bg-accent transition-colors disabled:opacity-50",
|
|
988
|
+
children: [/* @__PURE__ */ k(g, { size: 18 }), i("compliance.exportLog", "Export Log")]
|
|
989
|
+
})]
|
|
990
|
+
}),
|
|
991
|
+
d && s.length === 0 ? /* @__PURE__ */ k("div", {
|
|
992
|
+
className: "flex items-center justify-center h-48",
|
|
993
|
+
children: /* @__PURE__ */ A("div", {
|
|
994
|
+
className: "flex items-center gap-2 text-muted-foreground",
|
|
995
|
+
children: [/* @__PURE__ */ k(v, {
|
|
996
|
+
className: "animate-spin",
|
|
997
|
+
size: 24
|
|
998
|
+
}), /* @__PURE__ */ k("span", { children: i("compliance.loadingAuditLog", "Loading audit log...") })]
|
|
999
|
+
})
|
|
1000
|
+
}) : s.length === 0 ? /* @__PURE__ */ A("div", {
|
|
1001
|
+
className: "text-center py-12 border rounded-lg",
|
|
1002
|
+
children: [
|
|
1003
|
+
/* @__PURE__ */ k(_, {
|
|
1004
|
+
size: 48,
|
|
1005
|
+
className: "mx-auto text-muted-foreground/50 mb-4"
|
|
1006
|
+
}),
|
|
1007
|
+
/* @__PURE__ */ k("h3", {
|
|
1008
|
+
className: "text-lg font-medium text-foreground mb-2",
|
|
1009
|
+
children: i("compliance.noAuditLogsYet", "No audit logs yet")
|
|
1010
|
+
}),
|
|
1011
|
+
/* @__PURE__ */ k("p", {
|
|
1012
|
+
className: "text-sm text-muted-foreground max-w-md mx-auto",
|
|
1013
|
+
children: i("compliance.auditLogsDescription", "Compliance events such as unsubscribes, GDPR exports, bounces, and complaints will appear here when they occur.")
|
|
1014
|
+
})
|
|
1015
|
+
]
|
|
1016
|
+
}) : /* @__PURE__ */ k("div", {
|
|
1017
|
+
className: "border rounded-lg overflow-hidden",
|
|
1018
|
+
children: /* @__PURE__ */ A("table", {
|
|
1019
|
+
className: "w-full",
|
|
1020
|
+
children: [/* @__PURE__ */ k("thead", {
|
|
1021
|
+
className: "bg-muted",
|
|
1022
|
+
children: /* @__PURE__ */ A("tr", { children: [
|
|
1023
|
+
/* @__PURE__ */ k("th", {
|
|
1024
|
+
className: "px-4 py-3 text-left text-xs font-medium text-muted-foreground uppercase",
|
|
1025
|
+
children: i("compliance.event", "Event")
|
|
1026
|
+
}),
|
|
1027
|
+
/* @__PURE__ */ k("th", {
|
|
1028
|
+
className: "px-4 py-3 text-left text-xs font-medium text-muted-foreground uppercase",
|
|
1029
|
+
children: i("newsletter.email", "Email")
|
|
1030
|
+
}),
|
|
1031
|
+
/* @__PURE__ */ k("th", {
|
|
1032
|
+
className: "px-4 py-3 text-left text-xs font-medium text-muted-foreground uppercase",
|
|
1033
|
+
children: i("compliance.details", "Details")
|
|
1034
|
+
}),
|
|
1035
|
+
/* @__PURE__ */ k("th", {
|
|
1036
|
+
className: "px-4 py-3 text-left text-xs font-medium text-muted-foreground uppercase",
|
|
1037
|
+
children: i("compliance.ipAddress", "IP Address")
|
|
1038
|
+
}),
|
|
1039
|
+
/* @__PURE__ */ k("th", {
|
|
1040
|
+
className: "px-4 py-3 text-left text-xs font-medium text-muted-foreground uppercase",
|
|
1041
|
+
children: i("compliance.timestamp", "Timestamp")
|
|
1042
|
+
})
|
|
1043
|
+
] })
|
|
1044
|
+
}), /* @__PURE__ */ k("tbody", {
|
|
1045
|
+
className: "divide-y divide-border",
|
|
1046
|
+
children: s.map((e) => /* @__PURE__ */ A("tr", {
|
|
1047
|
+
className: "hover:bg-accent",
|
|
1048
|
+
children: [
|
|
1049
|
+
/* @__PURE__ */ k("td", {
|
|
1050
|
+
className: "px-4 py-3",
|
|
1051
|
+
children: y(e.event)
|
|
1052
|
+
}),
|
|
1053
|
+
/* @__PURE__ */ k("td", {
|
|
1054
|
+
className: "px-4 py-3 text-sm text-foreground",
|
|
1055
|
+
children: e.email
|
|
1056
|
+
}),
|
|
1057
|
+
/* @__PURE__ */ k("td", {
|
|
1058
|
+
className: "px-4 py-3 text-sm text-muted-foreground",
|
|
1059
|
+
children: e.details
|
|
1060
|
+
}),
|
|
1061
|
+
/* @__PURE__ */ k("td", {
|
|
1062
|
+
className: "px-4 py-3 text-sm text-muted-foreground font-mono",
|
|
1063
|
+
children: e.ip || "-"
|
|
1064
|
+
}),
|
|
1065
|
+
/* @__PURE__ */ k("td", {
|
|
1066
|
+
className: "px-4 py-3 text-sm text-muted-foreground",
|
|
1067
|
+
children: /* @__PURE__ */ A("div", {
|
|
1068
|
+
className: "flex items-center gap-1",
|
|
1069
|
+
children: [/* @__PURE__ */ k(h, { size: 14 }), b(e.timestamp)]
|
|
1070
|
+
})
|
|
1071
|
+
})
|
|
1072
|
+
]
|
|
1073
|
+
}, e.id))
|
|
1074
|
+
})]
|
|
1075
|
+
})
|
|
1076
|
+
}),
|
|
1077
|
+
/* @__PURE__ */ k("div", {
|
|
1078
|
+
className: "mt-4 p-4 bg-primary/5 rounded-lg",
|
|
1079
|
+
children: /* @__PURE__ */ A("p", {
|
|
1080
|
+
className: "text-sm text-primary/80",
|
|
1081
|
+
children: [
|
|
1082
|
+
i("compliance.auditRetentionNote", "Audit logs are retained for 2 years to comply with regulatory requirements."),
|
|
1083
|
+
" ",
|
|
1084
|
+
i("compliance.auditRetentionContactSupport", "For older logs, contact support.")
|
|
1085
|
+
]
|
|
1086
|
+
})
|
|
1087
|
+
})
|
|
1088
|
+
]
|
|
1089
|
+
});
|
|
1090
|
+
}
|
|
1091
|
+
//#endregion
|
|
1092
|
+
export { M as CompliancePage };
|
|
1093
|
+
|
|
1094
|
+
//# sourceMappingURL=CompliancePage.js.map
|