strapi-plugin-magic-mail 3.0.4 → 3.1.0
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/CHANGELOG.md +14 -0
- package/README.md +13 -200
- package/dist/admin/{App-DkyWmEgv.mjs → App-Bmav09Ol.mjs} +77 -928
- package/dist/admin/{App-D3TchJYB.js → App-mX8QtU1Q.js} +75 -926
- package/dist/admin/{PluginSettings-DTqdZ-nW.mjs → PluginSettings-D5F5y7n2.mjs} +5 -5
- package/dist/admin/{PluginSettings-B6TdA1qd.js → PluginSettings-DE2PMxlS.js} +5 -5
- package/dist/admin/{de-SKsLY2de.mjs → de-BXyjQhJQ.mjs} +1 -21
- package/dist/admin/{de-DKEFnBGC.js → de-VtWzTjWV.js} +1 -21
- package/dist/admin/{en-CvtZE1HH.js → en-DL_aZYfg.js} +1 -21
- package/dist/admin/{en-Ds2Q7fue.mjs → en-DMdnprlB.mjs} +1 -21
- package/dist/admin/{es-BbLLes3D.js → es-BJ1KgkMA.js} +1 -21
- package/dist/admin/{es-BEvzLtTg.mjs → es-g3CHX4iu.mjs} +1 -21
- package/dist/admin/{fr-nH9uN6s9.js → fr-Bmh5-45j.js} +1 -21
- package/dist/admin/{fr-CRpwImX6.mjs → fr-CN1X3dM-.mjs} +1 -21
- package/dist/admin/index.js +3 -3
- package/dist/admin/index.mjs +3 -3
- package/dist/admin/{pt-qt_48NxL.js → pt-DJ6GNCKb.js} +1 -21
- package/dist/admin/{pt-CjOe2N_n.mjs → pt-m8_Gnsqe.mjs} +1 -21
- package/dist/server/index.js +116 -1244
- package/dist/server/index.mjs +116 -1244
- package/package.json +31 -36
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
|
-
import React, { useRef, useEffect, useState, useCallback } from "react";
|
|
3
2
|
import { useNavigate, useLocation } from "react-router-dom";
|
|
4
3
|
import { Modal, Typography, Flex, Box, Field, TextInput, Alert, Textarea, NumberInput, Divider, Switch, Button, Loader, SingleSelect, SingleSelectOption, Thead, Tr, Th, Tbody, Td, Badge, Table, Tabs, Accordion } from "@strapi/design-system";
|
|
5
4
|
import { useFetchClient, useNotification, Page } from "@strapi/strapi/admin";
|
|
6
|
-
import { EnvelopeIcon, ServerIcon, SparklesIcon, PlusIcon, PencilIcon, PlayIcon, TrashIcon, MagnifyingGlassIcon, FunnelIcon, CheckIcon, Cog6ToothIcon, DocumentTextIcon, ChartBarIcon, CheckCircleIcon, ArrowUpTrayIcon, ArrowDownTrayIcon, DocumentArrowDownIcon, CodeBracketIcon, DocumentDuplicateIcon, BoltIcon, PaperAirplaneIcon, ClipboardDocumentIcon, ArrowLeftIcon, ClockIcon, XMarkIcon, ArrowUturnLeftIcon, EnvelopeOpenIcon, CursorArrowRaysIcon, ExclamationTriangleIcon, XCircleIcon
|
|
5
|
+
import { EnvelopeIcon, ServerIcon, SparklesIcon, PlusIcon, PencilIcon, PlayIcon, TrashIcon, MagnifyingGlassIcon, FunnelIcon, CheckIcon, Cog6ToothIcon, DocumentTextIcon, ChartBarIcon, CheckCircleIcon, ArrowUpTrayIcon, ArrowDownTrayIcon, DocumentArrowDownIcon, CodeBracketIcon, DocumentDuplicateIcon, BoltIcon, PaperAirplaneIcon, ClipboardDocumentIcon, ArrowLeftIcon, ClockIcon, XMarkIcon, ArrowUturnLeftIcon, EnvelopeOpenIcon, CursorArrowRaysIcon, ExclamationTriangleIcon, XCircleIcon } from "@heroicons/react/24/outline";
|
|
6
|
+
import React, { useRef, useEffect, useState } from "react";
|
|
7
7
|
import styled, { css, keyframes } from "styled-components";
|
|
8
|
-
import { Star, Mail, Server, Lock, Cog, Check, Cloud, Key, ArrowLeft, ArrowRight
|
|
8
|
+
import { Star, Mail, Server, Lock, Cog, Check, Cloud, Key, ArrowLeft, ArrowRight } from "@strapi/icons";
|
|
9
9
|
import { T as TertiaryButton, G as GradientButton, C as CTAButton, I as IconButton, a as IconButtonPrimary, b as IconButtonDanger, S as SecondaryButton, c as IconButtonPurple, d as IconButtonSuccess, D as DangerButton } from "./StyledButtons-aq1EWrQ-.mjs";
|
|
10
10
|
import * as ReactEmailEditor from "react-email-editor";
|
|
11
11
|
const useAuthRefresh = () => {
|
|
@@ -61,7 +61,7 @@ const theme$3 = {
|
|
|
61
61
|
xl: "16px"
|
|
62
62
|
}
|
|
63
63
|
};
|
|
64
|
-
const fadeIn$
|
|
64
|
+
const fadeIn$4 = keyframes`
|
|
65
65
|
from {
|
|
66
66
|
opacity: 0;
|
|
67
67
|
transform: translateY(10px);
|
|
@@ -71,7 +71,7 @@ const fadeIn$5 = keyframes`
|
|
|
71
71
|
transform: translateY(0);
|
|
72
72
|
}
|
|
73
73
|
`;
|
|
74
|
-
const pulse$
|
|
74
|
+
const pulse$2 = keyframes`
|
|
75
75
|
0%, 100% {
|
|
76
76
|
transform: scale(1);
|
|
77
77
|
}
|
|
@@ -89,7 +89,7 @@ const slideIn = keyframes`
|
|
|
89
89
|
opacity: 1;
|
|
90
90
|
}
|
|
91
91
|
`;
|
|
92
|
-
const colors
|
|
92
|
+
const colors = {
|
|
93
93
|
primary: "#4945ff",
|
|
94
94
|
// Strapi Primary Blue
|
|
95
95
|
primaryLight: "rgba(73, 69, 255, 0.06)",
|
|
@@ -107,7 +107,7 @@ const StepHeader = styled(Box)`
|
|
|
107
107
|
padding-bottom: 24px;
|
|
108
108
|
margin-bottom: 32px;
|
|
109
109
|
position: relative;
|
|
110
|
-
animation: ${fadeIn$
|
|
110
|
+
animation: ${fadeIn$4} 0.4s ease;
|
|
111
111
|
|
|
112
112
|
&::after {
|
|
113
113
|
content: '';
|
|
@@ -116,11 +116,11 @@ const StepHeader = styled(Box)`
|
|
|
116
116
|
left: -24px;
|
|
117
117
|
right: -24px;
|
|
118
118
|
height: 1px;
|
|
119
|
-
background: linear-gradient(90deg, transparent, ${colors
|
|
119
|
+
background: linear-gradient(90deg, transparent, ${colors.border}, transparent);
|
|
120
120
|
}
|
|
121
121
|
`;
|
|
122
122
|
const StepTitle = styled(Typography)`
|
|
123
|
-
color: ${colors
|
|
123
|
+
color: ${colors.text};
|
|
124
124
|
font-size: 24px;
|
|
125
125
|
font-weight: 600;
|
|
126
126
|
margin-bottom: 8px;
|
|
@@ -129,11 +129,11 @@ const StepTitle = styled(Typography)`
|
|
|
129
129
|
gap: 12px;
|
|
130
130
|
`;
|
|
131
131
|
const StepSubtitle = styled(Typography)`
|
|
132
|
-
color: ${colors
|
|
132
|
+
color: ${colors.textLight};
|
|
133
133
|
font-size: 14px;
|
|
134
134
|
line-height: 1.5;
|
|
135
135
|
`;
|
|
136
|
-
const StepperContainer
|
|
136
|
+
const StepperContainer = styled(Box)`
|
|
137
137
|
display: flex;
|
|
138
138
|
align-items: flex-start;
|
|
139
139
|
justify-content: center;
|
|
@@ -143,7 +143,7 @@ const StepperContainer$1 = styled(Box)`
|
|
|
143
143
|
position: relative;
|
|
144
144
|
padding: 0 40px;
|
|
145
145
|
`;
|
|
146
|
-
const StepWrapper
|
|
146
|
+
const StepWrapper = styled.div`
|
|
147
147
|
flex: 1;
|
|
148
148
|
display: flex;
|
|
149
149
|
flex-direction: column;
|
|
@@ -157,18 +157,18 @@ const StepWrapper$1 = styled.div`
|
|
|
157
157
|
left: 50%;
|
|
158
158
|
width: 100%;
|
|
159
159
|
height: 3px;
|
|
160
|
-
background: ${(props) => props.$completed ? colors
|
|
160
|
+
background: ${(props) => props.$completed ? colors.success : colors.neutralLight};
|
|
161
161
|
transition: all 0.4s ease;
|
|
162
162
|
z-index: 0;
|
|
163
163
|
}
|
|
164
164
|
`;
|
|
165
|
-
const StepDot
|
|
165
|
+
const StepDot = styled.div`
|
|
166
166
|
width: 56px;
|
|
167
167
|
height: 56px;
|
|
168
168
|
border-radius: 50%;
|
|
169
|
-
background: ${(props) => props.$active ? colors
|
|
170
|
-
color: ${(props) => props.$active || props.$completed ? "#ffffff" : colors
|
|
171
|
-
border: 4px solid ${(props) => props.$active ? colors
|
|
169
|
+
background: ${(props) => props.$active ? colors.primary : props.$completed ? colors.success : props.theme.colors.neutral0};
|
|
170
|
+
color: ${(props) => props.$active || props.$completed ? "#ffffff" : colors.textLight};
|
|
171
|
+
border: 4px solid ${(props) => props.$active ? colors.primary : props.$completed ? colors.success : colors.border};
|
|
172
172
|
display: flex;
|
|
173
173
|
align-items: center;
|
|
174
174
|
justify-content: center;
|
|
@@ -178,20 +178,20 @@ const StepDot$1 = styled.div`
|
|
|
178
178
|
position: relative;
|
|
179
179
|
z-index: 1;
|
|
180
180
|
cursor: ${(props) => props.$completed ? "pointer" : "default"};
|
|
181
|
-
box-shadow: ${(props) => props.$active ? `0 4px 16px ${colors
|
|
181
|
+
box-shadow: ${(props) => props.$active ? `0 4px 16px ${colors.primary}40, 0 0 0 8px ${colors.primaryLight}` : props.$completed ? `0 4px 12px ${colors.success}30` : "0 2px 8px rgba(0,0,0,0.08)"};
|
|
182
182
|
|
|
183
183
|
${(props) => props.$active && css`
|
|
184
|
-
animation: ${pulse$
|
|
184
|
+
animation: ${pulse$2} 2s infinite;
|
|
185
185
|
`}
|
|
186
186
|
|
|
187
187
|
&:hover {
|
|
188
188
|
transform: ${(props) => props.$completed ? "scale(1.1)" : props.$active ? "scale(1.05)" : "scale(1)"};
|
|
189
189
|
}
|
|
190
190
|
`;
|
|
191
|
-
const StepLabel
|
|
191
|
+
const StepLabel = styled(Typography)`
|
|
192
192
|
margin-top: 12px;
|
|
193
193
|
font-size: 13px;
|
|
194
|
-
color: ${(props) => props.$active ? colors
|
|
194
|
+
color: ${(props) => props.$active ? colors.primary : props.$completed ? colors.success : colors.textLight};
|
|
195
195
|
white-space: nowrap;
|
|
196
196
|
font-weight: ${(props) => props.$active ? 600 : 500};
|
|
197
197
|
text-align: center;
|
|
@@ -202,13 +202,13 @@ const ProviderCategoryHeader = styled(Box)`
|
|
|
202
202
|
align-items: center;
|
|
203
203
|
gap: 12px;
|
|
204
204
|
margin: 0 0 16px;
|
|
205
|
-
animation: ${fadeIn$
|
|
205
|
+
animation: ${fadeIn$4} 0.4s ease;
|
|
206
206
|
|
|
207
207
|
&::after {
|
|
208
208
|
content: '';
|
|
209
209
|
flex: 1;
|
|
210
210
|
height: 1px;
|
|
211
|
-
background: linear-gradient(90deg, ${colors
|
|
211
|
+
background: linear-gradient(90deg, ${colors.border}, transparent);
|
|
212
212
|
}
|
|
213
213
|
`;
|
|
214
214
|
const ProviderCategoryLabel = styled(Typography)`
|
|
@@ -216,15 +216,15 @@ const ProviderCategoryLabel = styled(Typography)`
|
|
|
216
216
|
font-weight: 600;
|
|
217
217
|
letter-spacing: 0.08em;
|
|
218
218
|
text-transform: uppercase;
|
|
219
|
-
color: ${colors
|
|
219
|
+
color: ${colors.textLight};
|
|
220
220
|
`;
|
|
221
221
|
const ProviderCategoryHint = styled.span`
|
|
222
222
|
font-size: 11px;
|
|
223
223
|
font-weight: 500;
|
|
224
224
|
padding: 3px 10px;
|
|
225
225
|
border-radius: 999px;
|
|
226
|
-
background: ${colors
|
|
227
|
-
color: ${colors
|
|
226
|
+
background: ${colors.primaryLight};
|
|
227
|
+
color: ${colors.primary};
|
|
228
228
|
letter-spacing: 0.02em;
|
|
229
229
|
text-transform: none;
|
|
230
230
|
`;
|
|
@@ -244,8 +244,8 @@ const ProvidersGrid = styled(Box)`
|
|
|
244
244
|
}
|
|
245
245
|
`;
|
|
246
246
|
const ProviderCard = styled(Box)`
|
|
247
|
-
background: ${(props) => props.$selected ? `linear-gradient(180deg, ${colors
|
|
248
|
-
border: 1.5px solid ${(props) => props.$selected ? colors
|
|
247
|
+
background: ${(props) => props.$selected ? `linear-gradient(180deg, ${colors.successLight}, rgba(92, 177, 118, 0.04))` : "var(--colors-neutral100, rgba(255,255,255,0.02))"};
|
|
248
|
+
border: 1.5px solid ${(props) => props.$selected ? colors.success : colors.border};
|
|
249
249
|
border-radius: 14px;
|
|
250
250
|
padding: 22px 20px 20px;
|
|
251
251
|
cursor: pointer;
|
|
@@ -271,7 +271,7 @@ const ProviderCard = styled(Box)`
|
|
|
271
271
|
&:hover {
|
|
272
272
|
transform: translateY(-3px);
|
|
273
273
|
box-shadow: 0 10px 28px rgba(73, 69, 255, 0.18);
|
|
274
|
-
border-color: ${(props) => props.$selected ? colors
|
|
274
|
+
border-color: ${(props) => props.$selected ? colors.success : colors.primary};
|
|
275
275
|
|
|
276
276
|
&::before {
|
|
277
277
|
opacity: 1;
|
|
@@ -279,12 +279,12 @@ const ProviderCard = styled(Box)`
|
|
|
279
279
|
}
|
|
280
280
|
|
|
281
281
|
&:focus-visible {
|
|
282
|
-
outline: 2px solid ${colors
|
|
282
|
+
outline: 2px solid ${colors.primary};
|
|
283
283
|
outline-offset: 2px;
|
|
284
284
|
}
|
|
285
285
|
|
|
286
286
|
${(props) => props.$selected && css`
|
|
287
|
-
box-shadow: 0 0 0 1px ${colors
|
|
287
|
+
box-shadow: 0 0 0 1px ${colors.success}, 0 10px 28px rgba(92, 177, 118, 0.18);
|
|
288
288
|
|
|
289
289
|
&::after {
|
|
290
290
|
content: '✓';
|
|
@@ -293,7 +293,7 @@ const ProviderCard = styled(Box)`
|
|
|
293
293
|
right: 12px;
|
|
294
294
|
width: 24px;
|
|
295
295
|
height: 24px;
|
|
296
|
-
background: ${colors
|
|
296
|
+
background: ${colors.success};
|
|
297
297
|
color: #fff;
|
|
298
298
|
border-radius: 50%;
|
|
299
299
|
display: flex;
|
|
@@ -318,7 +318,7 @@ const ProviderIcon = styled.div`
|
|
|
318
318
|
justify-content: center;
|
|
319
319
|
font-size: ${(props) => props.$fontSize || "22px"};
|
|
320
320
|
font-weight: 700;
|
|
321
|
-
color: ${(props) => props.$color || colors
|
|
321
|
+
color: ${(props) => props.$color || colors.primary};
|
|
322
322
|
box-shadow: 0 4px 14px ${(props) => props.$shadowColor || "rgba(73, 69, 255, 0.25)"};
|
|
323
323
|
flex-shrink: 0;
|
|
324
324
|
`;
|
|
@@ -332,22 +332,22 @@ const ProviderName = styled(Typography)`
|
|
|
332
332
|
font-weight: 600;
|
|
333
333
|
font-size: 16px;
|
|
334
334
|
line-height: 1.25;
|
|
335
|
-
color: ${colors
|
|
335
|
+
color: ${colors.text};
|
|
336
336
|
margin: 0;
|
|
337
337
|
`;
|
|
338
338
|
const ProviderTagline = styled(Typography)`
|
|
339
339
|
font-size: 12.5px;
|
|
340
340
|
line-height: 1.4;
|
|
341
|
-
color: ${colors
|
|
341
|
+
color: ${colors.textLight};
|
|
342
342
|
margin: 0;
|
|
343
343
|
`;
|
|
344
344
|
const InfoAlert = styled(Alert)`
|
|
345
|
-
background: ${colors
|
|
346
|
-
border: 1px solid ${colors
|
|
347
|
-
animation: ${fadeIn$
|
|
345
|
+
background: ${colors.primaryLight};
|
|
346
|
+
border: 1px solid ${colors.primary}33;
|
|
347
|
+
animation: ${fadeIn$4} 0.4s ease;
|
|
348
348
|
|
|
349
349
|
svg {
|
|
350
|
-
color: ${colors
|
|
350
|
+
color: ${colors.primary};
|
|
351
351
|
}
|
|
352
352
|
`;
|
|
353
353
|
const FormSection = styled(Box)`
|
|
@@ -367,7 +367,7 @@ const FullWidthField = styled(Box)`
|
|
|
367
367
|
}
|
|
368
368
|
`;
|
|
369
369
|
const SectionTitle = styled(Typography)`
|
|
370
|
-
color: ${colors
|
|
370
|
+
color: ${colors.text};
|
|
371
371
|
font-weight: 600;
|
|
372
372
|
font-size: 16px;
|
|
373
373
|
margin-bottom: 16px;
|
|
@@ -865,13 +865,13 @@ const AddAccountModal = ({ isOpen, onClose, onAccountAdded, editAccount = null }
|
|
|
865
865
|
currentStep === 4 && "Set rate limits and priority for this account"
|
|
866
866
|
] })
|
|
867
867
|
] }),
|
|
868
|
-
/* @__PURE__ */ jsx(StepperContainer
|
|
869
|
-
StepWrapper
|
|
868
|
+
/* @__PURE__ */ jsx(StepperContainer, { children: [1, 2, 3, 4].map((step) => /* @__PURE__ */ jsxs(
|
|
869
|
+
StepWrapper,
|
|
870
870
|
{
|
|
871
871
|
$completed: currentStep > step,
|
|
872
872
|
children: [
|
|
873
873
|
/* @__PURE__ */ jsx(
|
|
874
|
-
StepDot
|
|
874
|
+
StepDot,
|
|
875
875
|
{
|
|
876
876
|
$active: currentStep === step,
|
|
877
877
|
$completed: currentStep > step,
|
|
@@ -880,7 +880,7 @@ const AddAccountModal = ({ isOpen, onClose, onAccountAdded, editAccount = null }
|
|
|
880
880
|
}
|
|
881
881
|
),
|
|
882
882
|
/* @__PURE__ */ jsx(
|
|
883
|
-
StepLabel
|
|
883
|
+
StepLabel,
|
|
884
884
|
{
|
|
885
885
|
$active: currentStep === step,
|
|
886
886
|
$completed: currentStep > step,
|
|
@@ -1272,7 +1272,7 @@ const AddAccountModal = ({ isOpen, onClose, onAccountAdded, editAccount = null }
|
|
|
1272
1272
|
background: "neutral100",
|
|
1273
1273
|
hasRadius: true,
|
|
1274
1274
|
style: {
|
|
1275
|
-
border: `1px solid ${colors
|
|
1275
|
+
border: `1px solid ${colors.border}`,
|
|
1276
1276
|
borderRadius: "8px"
|
|
1277
1277
|
},
|
|
1278
1278
|
children: [
|
|
@@ -1289,7 +1289,7 @@ const AddAccountModal = ({ isOpen, onClose, onAccountAdded, editAccount = null }
|
|
|
1289
1289
|
/* @__PURE__ */ jsxs(Box, { children: [
|
|
1290
1290
|
/* @__PURE__ */ jsx("strong", { children: "1." }),
|
|
1291
1291
|
" Go to ",
|
|
1292
|
-
/* @__PURE__ */ jsx("a", { href: "https://console.cloud.google.com", target: "_blank", rel: "noopener noreferrer", style: { color: colors
|
|
1292
|
+
/* @__PURE__ */ jsx("a", { href: "https://console.cloud.google.com", target: "_blank", rel: "noopener noreferrer", style: { color: colors.primary, textDecoration: "underline" }, children: "console.cloud.google.com" })
|
|
1293
1293
|
] }),
|
|
1294
1294
|
/* @__PURE__ */ jsxs(Box, { children: [
|
|
1295
1295
|
/* @__PURE__ */ jsx("strong", { children: "2." }),
|
|
@@ -1315,7 +1315,7 @@ const AddAccountModal = ({ isOpen, onClose, onAccountAdded, editAccount = null }
|
|
|
1315
1315
|
fontFamily: "monospace",
|
|
1316
1316
|
fontSize: "13px",
|
|
1317
1317
|
wordBreak: "break-all",
|
|
1318
|
-
border: `1px solid ${colors
|
|
1318
|
+
border: `1px solid ${colors.border}`
|
|
1319
1319
|
},
|
|
1320
1320
|
children: [
|
|
1321
1321
|
window.location.origin,
|
|
@@ -1416,7 +1416,7 @@ const AddAccountModal = ({ isOpen, onClose, onAccountAdded, editAccount = null }
|
|
|
1416
1416
|
background: "neutral100",
|
|
1417
1417
|
hasRadius: true,
|
|
1418
1418
|
style: {
|
|
1419
|
-
border: `1px solid ${colors
|
|
1419
|
+
border: `1px solid ${colors.border}`,
|
|
1420
1420
|
borderRadius: "8px"
|
|
1421
1421
|
},
|
|
1422
1422
|
children: [
|
|
@@ -1433,7 +1433,7 @@ const AddAccountModal = ({ isOpen, onClose, onAccountAdded, editAccount = null }
|
|
|
1433
1433
|
/* @__PURE__ */ jsxs(Box, { children: [
|
|
1434
1434
|
/* @__PURE__ */ jsx("strong", { children: "1." }),
|
|
1435
1435
|
" Go to ",
|
|
1436
|
-
/* @__PURE__ */ jsx("a", { href: "https://portal.azure.com", target: "_blank", rel: "noopener noreferrer", style: { color: colors
|
|
1436
|
+
/* @__PURE__ */ jsx("a", { href: "https://portal.azure.com", target: "_blank", rel: "noopener noreferrer", style: { color: colors.primary, textDecoration: "underline" }, children: "portal.azure.com" })
|
|
1437
1437
|
] }),
|
|
1438
1438
|
/* @__PURE__ */ jsxs(Box, { children: [
|
|
1439
1439
|
/* @__PURE__ */ jsx("strong", { children: "2." }),
|
|
@@ -1467,8 +1467,8 @@ const AddAccountModal = ({ isOpen, onClose, onAccountAdded, editAccount = null }
|
|
|
1467
1467
|
fontFamily: "monospace",
|
|
1468
1468
|
fontSize: "13px",
|
|
1469
1469
|
wordBreak: "break-all",
|
|
1470
|
-
color: colors
|
|
1471
|
-
border: `1px solid ${colors
|
|
1470
|
+
color: colors.textSecondary,
|
|
1471
|
+
border: `1px solid ${colors.border}`
|
|
1472
1472
|
},
|
|
1473
1473
|
children: `${window.location.origin}/magic-mail/oauth/microsoft/callback`
|
|
1474
1474
|
}
|
|
@@ -1593,7 +1593,7 @@ const AddAccountModal = ({ isOpen, onClose, onAccountAdded, editAccount = null }
|
|
|
1593
1593
|
background: "neutral100",
|
|
1594
1594
|
hasRadius: true,
|
|
1595
1595
|
style: {
|
|
1596
|
-
border: `1px solid ${colors
|
|
1596
|
+
border: `1px solid ${colors.border}`,
|
|
1597
1597
|
borderRadius: "8px"
|
|
1598
1598
|
},
|
|
1599
1599
|
children: [
|
|
@@ -1610,7 +1610,7 @@ const AddAccountModal = ({ isOpen, onClose, onAccountAdded, editAccount = null }
|
|
|
1610
1610
|
/* @__PURE__ */ jsxs(Box, { children: [
|
|
1611
1611
|
/* @__PURE__ */ jsx("strong", { children: "1." }),
|
|
1612
1612
|
" Go to ",
|
|
1613
|
-
/* @__PURE__ */ jsx("a", { href: "https://developer.yahoo.com/apps/", target: "_blank", rel: "noopener noreferrer", style: { color: colors
|
|
1613
|
+
/* @__PURE__ */ jsx("a", { href: "https://developer.yahoo.com/apps/", target: "_blank", rel: "noopener noreferrer", style: { color: colors.primary, textDecoration: "underline" }, children: "developer.yahoo.com/apps" })
|
|
1614
1614
|
] }),
|
|
1615
1615
|
/* @__PURE__ */ jsxs(Box, { children: [
|
|
1616
1616
|
/* @__PURE__ */ jsx("strong", { children: "2." }),
|
|
@@ -1636,8 +1636,8 @@ const AddAccountModal = ({ isOpen, onClose, onAccountAdded, editAccount = null }
|
|
|
1636
1636
|
fontFamily: "monospace",
|
|
1637
1637
|
fontSize: "13px",
|
|
1638
1638
|
wordBreak: "break-all",
|
|
1639
|
-
color: colors
|
|
1640
|
-
border: `1px solid ${colors
|
|
1639
|
+
color: colors.textSecondary,
|
|
1640
|
+
border: `1px solid ${colors.border}`
|
|
1641
1641
|
},
|
|
1642
1642
|
children: `${window.location.origin}/magic-mail/oauth/yahoo/callback`
|
|
1643
1643
|
}
|
|
@@ -1902,7 +1902,7 @@ const AddAccountModal = ({ isOpen, onClose, onAccountAdded, editAccount = null }
|
|
|
1902
1902
|
] }) })
|
|
1903
1903
|
] }) });
|
|
1904
1904
|
};
|
|
1905
|
-
const fadeIn$
|
|
1905
|
+
const fadeIn$3 = keyframes`
|
|
1906
1906
|
from { opacity: 0; transform: translateY(10px); }
|
|
1907
1907
|
to { opacity: 1; transform: translateY(0); }
|
|
1908
1908
|
`;
|
|
@@ -1914,7 +1914,7 @@ const float$3 = keyframes`
|
|
|
1914
1914
|
0%, 100% { transform: translateY(0px); }
|
|
1915
1915
|
50% { transform: translateY(-5px); }
|
|
1916
1916
|
`;
|
|
1917
|
-
const pulse$
|
|
1917
|
+
const pulse$1 = keyframes`
|
|
1918
1918
|
0%, 100% { opacity: 1; }
|
|
1919
1919
|
50% { opacity: 0.5; }
|
|
1920
1920
|
`;
|
|
@@ -1930,7 +1930,7 @@ const breakpoints$3 = {
|
|
|
1930
1930
|
mobile: "768px"
|
|
1931
1931
|
};
|
|
1932
1932
|
const Container$4 = styled(Box)`
|
|
1933
|
-
${css`animation: ${fadeIn$
|
|
1933
|
+
${css`animation: ${fadeIn$3} ${theme$3.transitions.slow};`}
|
|
1934
1934
|
min-height: 100vh;
|
|
1935
1935
|
max-width: 1440px;
|
|
1936
1936
|
margin: 0 auto;
|
|
@@ -2048,7 +2048,7 @@ const StatCard$3 = styled(Box)`
|
|
|
2048
2048
|
position: relative;
|
|
2049
2049
|
overflow: hidden;
|
|
2050
2050
|
transition: all ${theme$3.transitions.normal};
|
|
2051
|
-
${css`animation: ${fadeIn$
|
|
2051
|
+
${css`animation: ${fadeIn$3} ${theme$3.transitions.slow} backwards;`}
|
|
2052
2052
|
animation-delay: ${(props) => props.$delay || "0s"};
|
|
2053
2053
|
box-shadow: ${theme$3.shadows.sm};
|
|
2054
2054
|
border: 1px solid rgba(128, 128, 128, 0.2);
|
|
@@ -2174,7 +2174,7 @@ const OnlineBadge$1 = styled.div`
|
|
|
2174
2174
|
background: ${(props) => props.$active ? "var(--colors-success600, #22C55E)" : "rgba(128, 128, 128, 0.4)"};
|
|
2175
2175
|
display: inline-block;
|
|
2176
2176
|
margin-right: 8px;
|
|
2177
|
-
${css`animation: ${(props) => props.$active ? pulse$
|
|
2177
|
+
${css`animation: ${(props) => props.$active ? pulse$1 : "none"} 2s ease-in-out infinite;`}
|
|
2178
2178
|
`;
|
|
2179
2179
|
const StyledTable$3 = styled(Table)`
|
|
2180
2180
|
thead {
|
|
@@ -2936,7 +2936,7 @@ const theme$2 = {
|
|
|
2936
2936
|
xl: "16px"
|
|
2937
2937
|
}
|
|
2938
2938
|
};
|
|
2939
|
-
const fadeIn$
|
|
2939
|
+
const fadeIn$2 = keyframes`
|
|
2940
2940
|
from { opacity: 0; transform: translateY(10px); }
|
|
2941
2941
|
to { opacity: 1; transform: translateY(0); }
|
|
2942
2942
|
`;
|
|
@@ -2948,7 +2948,7 @@ const float$2 = keyframes`
|
|
|
2948
2948
|
0%, 100% { transform: translateY(0px); }
|
|
2949
2949
|
50% { transform: translateY(-5px); }
|
|
2950
2950
|
`;
|
|
2951
|
-
const pulse
|
|
2951
|
+
const pulse = keyframes`
|
|
2952
2952
|
0%, 100% { opacity: 1; }
|
|
2953
2953
|
50% { opacity: 0.5; }
|
|
2954
2954
|
`;
|
|
@@ -2964,7 +2964,7 @@ const breakpoints$2 = {
|
|
|
2964
2964
|
mobile: "768px"
|
|
2965
2965
|
};
|
|
2966
2966
|
const Container$3 = styled(Box)`
|
|
2967
|
-
${css`animation: ${fadeIn$
|
|
2967
|
+
${css`animation: ${fadeIn$2} ${theme$2.transitions.slow};`}
|
|
2968
2968
|
min-height: 100vh;
|
|
2969
2969
|
max-width: 1440px;
|
|
2970
2970
|
margin: 0 auto;
|
|
@@ -3082,7 +3082,7 @@ const StatCard$2 = styled(Box)`
|
|
|
3082
3082
|
position: relative;
|
|
3083
3083
|
overflow: hidden;
|
|
3084
3084
|
transition: all ${theme$2.transitions.normal};
|
|
3085
|
-
${css`animation: ${fadeIn$
|
|
3085
|
+
${css`animation: ${fadeIn$2} ${theme$2.transitions.slow} backwards;`}
|
|
3086
3086
|
animation-delay: ${(props) => props.$delay || "0s"};
|
|
3087
3087
|
box-shadow: ${theme$2.shadows.sm};
|
|
3088
3088
|
border: 1px solid rgba(128, 128, 128, 0.2);
|
|
@@ -3208,7 +3208,7 @@ const OnlineBadge = styled.div`
|
|
|
3208
3208
|
background: ${(props) => props.$active ? "var(--colors-success600, #22C55E)" : "rgba(128, 128, 128, 0.4)"};
|
|
3209
3209
|
display: inline-block;
|
|
3210
3210
|
margin-right: 8px;
|
|
3211
|
-
${css`animation: ${(props) => props.$active ? pulse
|
|
3211
|
+
${css`animation: ${(props) => props.$active ? pulse : "none"} 2s ease-in-out infinite;`}
|
|
3212
3212
|
`;
|
|
3213
3213
|
const StyledTable$2 = styled(Table)`
|
|
3214
3214
|
thead {
|
|
@@ -3506,8 +3506,7 @@ const RoutingRulesPage = () => {
|
|
|
3506
3506
|
rule.fallbackAccountName && /* @__PURE__ */ jsxs(Typography, { variant: "pi", textColor: "neutral600", children: [
|
|
3507
3507
|
"Fallback: ",
|
|
3508
3508
|
rule.fallbackAccountName
|
|
3509
|
-
] })
|
|
3510
|
-
rule.whatsappFallback && /* @__PURE__ */ jsx(Badge, { backgroundColor: "success100", textColor: "success700", size: "S", children: "+ WhatsApp" })
|
|
3509
|
+
] })
|
|
3511
3510
|
] }) }),
|
|
3512
3511
|
/* @__PURE__ */ jsx(Td, { children: /* @__PURE__ */ jsxs(
|
|
3513
3512
|
Badge,
|
|
@@ -3570,8 +3569,7 @@ const RuleModal = ({ rule, accounts, onClose, onSave }) => {
|
|
|
3570
3569
|
matchType: rule?.matchType || "emailType",
|
|
3571
3570
|
matchValue: rule?.matchValue || "",
|
|
3572
3571
|
accountName: rule?.accountName || "",
|
|
3573
|
-
fallbackAccountName: rule?.fallbackAccountName || ""
|
|
3574
|
-
whatsappFallback: rule?.whatsappFallback || false
|
|
3572
|
+
fallbackAccountName: rule?.fallbackAccountName || ""
|
|
3575
3573
|
});
|
|
3576
3574
|
const handleChange = (field, value) => {
|
|
3577
3575
|
setFormData((prev) => ({ ...prev, [field]: value }));
|
|
@@ -3726,38 +3724,6 @@ const RuleModal = ({ rule, accounts, onClose, onSave }) => {
|
|
|
3726
3724
|
),
|
|
3727
3725
|
/* @__PURE__ */ jsx(Field.Hint, { children: "Use this account if the target account is unavailable or rate-limited" })
|
|
3728
3726
|
] }),
|
|
3729
|
-
/* @__PURE__ */ jsx(
|
|
3730
|
-
Box,
|
|
3731
|
-
{
|
|
3732
|
-
padding: 4,
|
|
3733
|
-
background: "neutral100",
|
|
3734
|
-
hasRadius: true,
|
|
3735
|
-
borderColor: "neutral200",
|
|
3736
|
-
borderStyle: "solid",
|
|
3737
|
-
borderWidth: "1px",
|
|
3738
|
-
style: {
|
|
3739
|
-
width: "100%",
|
|
3740
|
-
borderRadius: theme$2.borderRadius.md
|
|
3741
|
-
},
|
|
3742
|
-
children: /* @__PURE__ */ jsxs(Flex, { gap: 3, alignItems: "center", justifyContent: "space-between", children: [
|
|
3743
|
-
/* @__PURE__ */ jsxs(Box, { style: { flex: 1, minWidth: 0 }, children: [
|
|
3744
|
-
/* @__PURE__ */ jsx(Typography, { fontWeight: "semiBold", children: "WhatsApp Fallback" }),
|
|
3745
|
-
/* @__PURE__ */ jsx(Typography, { variant: "pi", textColor: "neutral600", marginTop: 1, children: formData.whatsappFallback ? "If ALL email accounts fail, message will be sent via WhatsApp (requires connected WhatsApp & phone number in email data)" : "Enable to use WhatsApp as last-resort fallback when email delivery fails" })
|
|
3746
|
-
] }),
|
|
3747
|
-
/* @__PURE__ */ jsx(Box, { style: { flexShrink: 0 }, children: /* @__PURE__ */ jsx(
|
|
3748
|
-
Switch,
|
|
3749
|
-
{
|
|
3750
|
-
checked: formData.whatsappFallback,
|
|
3751
|
-
onCheckedChange: (checked) => handleChange("whatsappFallback", checked),
|
|
3752
|
-
"aria-label": "WhatsApp fallback",
|
|
3753
|
-
onLabel: "Enabled",
|
|
3754
|
-
offLabel: "Disabled",
|
|
3755
|
-
visibleLabels: false
|
|
3756
|
-
}
|
|
3757
|
-
) })
|
|
3758
|
-
] })
|
|
3759
|
-
}
|
|
3760
|
-
),
|
|
3761
3727
|
/* @__PURE__ */ jsxs(Field.Root, { style: { width: "100%" }, children: [
|
|
3762
3728
|
/* @__PURE__ */ jsx(Field.Label, { children: "Rule Priority" }),
|
|
3763
3729
|
/* @__PURE__ */ jsx(
|
|
@@ -3831,7 +3797,7 @@ const theme$1 = {
|
|
|
3831
3797
|
spacing: { xs: "4px", sm: "8px", md: "16px", lg: "24px", xl: "32px", "2xl": "48px" },
|
|
3832
3798
|
borderRadius: { md: "8px", lg: "12px", xl: "16px" }
|
|
3833
3799
|
};
|
|
3834
|
-
const fadeIn$
|
|
3800
|
+
const fadeIn$1 = keyframes`
|
|
3835
3801
|
from { opacity: 0; transform: translateY(10px); }
|
|
3836
3802
|
to { opacity: 1; transform: translateY(0); }
|
|
3837
3803
|
`;
|
|
@@ -3985,7 +3951,7 @@ const CopyButton = styled(Button)`
|
|
|
3985
3951
|
height: 14px;
|
|
3986
3952
|
}
|
|
3987
3953
|
`;
|
|
3988
|
-
const InfoBox
|
|
3954
|
+
const InfoBox = styled(Box)`
|
|
3989
3955
|
background: linear-gradient(135deg, ${"rgba(2, 132, 199, 0.06)"}, ${"rgba(2, 132, 199, 0.12)"});
|
|
3990
3956
|
border-left: 4px solid ${"var(--colors-primary600, #0EA5E9)"};
|
|
3991
3957
|
border-radius: 8px;
|
|
@@ -4007,7 +3973,7 @@ const breakpoints$1 = {
|
|
|
4007
3973
|
tablet: "1024px"
|
|
4008
3974
|
};
|
|
4009
3975
|
const Container$2 = styled(Box)`
|
|
4010
|
-
${css`animation: ${fadeIn$
|
|
3976
|
+
${css`animation: ${fadeIn$1} ${theme$1.transitions.slow};`}
|
|
4011
3977
|
min-height: 100vh;
|
|
4012
3978
|
max-width: 1440px;
|
|
4013
3979
|
margin: 0 auto;
|
|
@@ -4120,7 +4086,7 @@ const StatCard$1 = styled(Box)`
|
|
|
4120
4086
|
position: relative;
|
|
4121
4087
|
overflow: hidden;
|
|
4122
4088
|
transition: all ${theme$1.transitions.normal};
|
|
4123
|
-
${css`animation: ${fadeIn$
|
|
4089
|
+
${css`animation: ${fadeIn$1} ${theme$1.transitions.slow} backwards;`}
|
|
4124
4090
|
animation-delay: ${(props) => props.$delay || "0s"};
|
|
4125
4091
|
box-shadow: ${theme$1.shadows.sm};
|
|
4126
4092
|
border: 1px solid rgba(128, 128, 128, 0.2);
|
|
@@ -5159,7 +5125,7 @@ const TemplateList = () => {
|
|
|
5159
5125
|
selectedTemplate.name
|
|
5160
5126
|
] }) }),
|
|
5161
5127
|
/* @__PURE__ */ jsxs(ScrollableDialogBody, { children: [
|
|
5162
|
-
/* @__PURE__ */ jsx(InfoBox
|
|
5128
|
+
/* @__PURE__ */ jsx(InfoBox, { style: { marginTop: 0, marginBottom: "20px" }, children: /* @__PURE__ */ jsxs(Flex, { alignItems: "center", justifyContent: "space-between", children: [
|
|
5163
5129
|
/* @__PURE__ */ jsxs(Typography, { variant: "pi", style: { color: "var(--colors-primary600, #075985)" }, children: [
|
|
5164
5130
|
/* @__PURE__ */ jsx("strong", { children: "Template ID:" }),
|
|
5165
5131
|
" #",
|
|
@@ -6598,7 +6564,7 @@ const theme = {
|
|
|
6598
6564
|
spacing: { xs: "4px", sm: "8px", md: "16px", lg: "24px", xl: "32px", "2xl": "48px" },
|
|
6599
6565
|
borderRadius: { lg: "12px", xl: "16px" }
|
|
6600
6566
|
};
|
|
6601
|
-
const fadeIn
|
|
6567
|
+
const fadeIn = keyframes`
|
|
6602
6568
|
from { opacity: 0; transform: translateY(10px); }
|
|
6603
6569
|
to { opacity: 1; transform: translateY(0); }
|
|
6604
6570
|
`;
|
|
@@ -6614,7 +6580,7 @@ const breakpoints = {
|
|
|
6614
6580
|
mobile: "768px"
|
|
6615
6581
|
};
|
|
6616
6582
|
const Container = styled(Box)`
|
|
6617
|
-
${css`animation: ${fadeIn
|
|
6583
|
+
${css`animation: ${fadeIn} ${theme.transitions.slow};`}
|
|
6618
6584
|
min-height: 100vh;
|
|
6619
6585
|
max-width: 1440px;
|
|
6620
6586
|
margin: 0 auto;
|
|
@@ -6727,7 +6693,7 @@ const StatCard = styled(Box)`
|
|
|
6727
6693
|
position: relative;
|
|
6728
6694
|
overflow: hidden;
|
|
6729
6695
|
transition: all ${theme.transitions.normal};
|
|
6730
|
-
${css`animation: ${fadeIn
|
|
6696
|
+
${css`animation: ${fadeIn} ${theme.transitions.slow} backwards;`}
|
|
6731
6697
|
animation-delay: ${(props) => props.$delay || "0s"};
|
|
6732
6698
|
box-shadow: ${theme.shadows.sm};
|
|
6733
6699
|
border: 1px solid rgba(128, 128, 128, 0.2);
|
|
@@ -7136,814 +7102,6 @@ const Analytics = () => {
|
|
|
7136
7102
|
] }) })
|
|
7137
7103
|
] });
|
|
7138
7104
|
};
|
|
7139
|
-
const fadeIn = keyframes`
|
|
7140
|
-
from {
|
|
7141
|
-
opacity: 0;
|
|
7142
|
-
transform: translateY(10px);
|
|
7143
|
-
}
|
|
7144
|
-
to {
|
|
7145
|
-
opacity: 1;
|
|
7146
|
-
transform: translateY(0);
|
|
7147
|
-
}
|
|
7148
|
-
`;
|
|
7149
|
-
const pulse = keyframes`
|
|
7150
|
-
0%, 100% {
|
|
7151
|
-
transform: scale(1);
|
|
7152
|
-
}
|
|
7153
|
-
50% {
|
|
7154
|
-
transform: scale(1.05);
|
|
7155
|
-
}
|
|
7156
|
-
`;
|
|
7157
|
-
const spin = keyframes`
|
|
7158
|
-
from {
|
|
7159
|
-
transform: rotate(0deg);
|
|
7160
|
-
}
|
|
7161
|
-
to {
|
|
7162
|
-
transform: rotate(360deg);
|
|
7163
|
-
}
|
|
7164
|
-
`;
|
|
7165
|
-
const colors = {
|
|
7166
|
-
whatsapp: "#25D366",
|
|
7167
|
-
whatsappDark: "#128C7E",
|
|
7168
|
-
whatsappLight: "rgba(37, 211, 102, 0.2)",
|
|
7169
|
-
primary: "#4945ff",
|
|
7170
|
-
primaryLight: "rgba(73, 69, 255, 0.06)",
|
|
7171
|
-
success: "#5cb176",
|
|
7172
|
-
successLight: "rgba(92, 177, 118, 0.12)",
|
|
7173
|
-
danger: "#d02b20",
|
|
7174
|
-
neutral: "#8e8ea9",
|
|
7175
|
-
neutralLight: "rgba(142, 142, 169, 0.08)",
|
|
7176
|
-
border: "rgba(128, 128, 128, 0.2)",
|
|
7177
|
-
textLight: "var(--colors-neutral600, #666687)"
|
|
7178
|
-
};
|
|
7179
|
-
const PageContainer = styled(Box)`
|
|
7180
|
-
padding: 40px;
|
|
7181
|
-
max-width: 900px;
|
|
7182
|
-
margin: 0 auto;
|
|
7183
|
-
animation: ${fadeIn} 0.4s ease;
|
|
7184
|
-
`;
|
|
7185
|
-
const HeaderSection = styled(Box)`
|
|
7186
|
-
text-align: center;
|
|
7187
|
-
margin-bottom: 48px;
|
|
7188
|
-
`;
|
|
7189
|
-
const WhatsAppLogo = styled.div`
|
|
7190
|
-
width: 80px;
|
|
7191
|
-
height: 80px;
|
|
7192
|
-
border-radius: 50%;
|
|
7193
|
-
background: linear-gradient(135deg, ${colors.whatsapp}, ${colors.whatsappDark});
|
|
7194
|
-
display: flex;
|
|
7195
|
-
align-items: center;
|
|
7196
|
-
justify-content: center;
|
|
7197
|
-
margin: 0 auto 24px;
|
|
7198
|
-
box-shadow: 0 8px 32px ${colors.whatsapp}40;
|
|
7199
|
-
`;
|
|
7200
|
-
const PhoneIcon = styled.div`
|
|
7201
|
-
width: 40px;
|
|
7202
|
-
height: 40px;
|
|
7203
|
-
color: white;
|
|
7204
|
-
font-size: 32px;
|
|
7205
|
-
`;
|
|
7206
|
-
const StepperContainer = styled(Box)`
|
|
7207
|
-
display: flex;
|
|
7208
|
-
align-items: flex-start;
|
|
7209
|
-
justify-content: center;
|
|
7210
|
-
gap: 0;
|
|
7211
|
-
margin-bottom: 48px;
|
|
7212
|
-
position: relative;
|
|
7213
|
-
padding: 0 40px;
|
|
7214
|
-
`;
|
|
7215
|
-
const StepWrapper = styled.div`
|
|
7216
|
-
flex: 1;
|
|
7217
|
-
display: flex;
|
|
7218
|
-
flex-direction: column;
|
|
7219
|
-
align-items: center;
|
|
7220
|
-
position: relative;
|
|
7221
|
-
|
|
7222
|
-
&:not(:last-child)::after {
|
|
7223
|
-
content: '';
|
|
7224
|
-
position: absolute;
|
|
7225
|
-
top: 28px;
|
|
7226
|
-
left: 50%;
|
|
7227
|
-
width: 100%;
|
|
7228
|
-
height: 3px;
|
|
7229
|
-
background: ${(props) => props.$completed ? colors.success : colors.neutralLight};
|
|
7230
|
-
transition: all 0.4s ease;
|
|
7231
|
-
z-index: 0;
|
|
7232
|
-
}
|
|
7233
|
-
`;
|
|
7234
|
-
const StepDot = styled.div`
|
|
7235
|
-
width: 56px;
|
|
7236
|
-
height: 56px;
|
|
7237
|
-
border-radius: 50%;
|
|
7238
|
-
background: ${(props) => props.$active ? colors.whatsapp : props.$completed ? colors.success : props.theme.colors.neutral0};
|
|
7239
|
-
color: ${(props) => props.$active || props.$completed ? "#ffffff" : colors.textLight};
|
|
7240
|
-
border: 4px solid ${(props) => props.$active ? colors.whatsapp : props.$completed ? colors.success : colors.border};
|
|
7241
|
-
display: flex;
|
|
7242
|
-
align-items: center;
|
|
7243
|
-
justify-content: center;
|
|
7244
|
-
font-weight: 700;
|
|
7245
|
-
font-size: 18px;
|
|
7246
|
-
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
|
7247
|
-
position: relative;
|
|
7248
|
-
z-index: 1;
|
|
7249
|
-
cursor: ${(props) => props.$completed ? "pointer" : "default"};
|
|
7250
|
-
box-shadow: ${(props) => props.$active ? `0 4px 16px ${colors.whatsapp}40, 0 0 0 8px ${colors.whatsappLight}` : props.$completed ? `0 4px 12px ${colors.success}30` : "0 2px 8px rgba(0,0,0,0.08)"};
|
|
7251
|
-
|
|
7252
|
-
${(props) => props.$active && css`
|
|
7253
|
-
animation: ${pulse} 2s infinite;
|
|
7254
|
-
`}
|
|
7255
|
-
|
|
7256
|
-
&:hover {
|
|
7257
|
-
transform: ${(props) => props.$completed ? "scale(1.1)" : props.$active ? "scale(1.05)" : "scale(1)"};
|
|
7258
|
-
}
|
|
7259
|
-
`;
|
|
7260
|
-
const StepLabel = styled(Typography)`
|
|
7261
|
-
margin-top: 12px;
|
|
7262
|
-
font-size: 13px;
|
|
7263
|
-
color: ${(props) => props.$active ? colors.whatsapp : props.$completed ? colors.success : colors.textLight};
|
|
7264
|
-
white-space: nowrap;
|
|
7265
|
-
font-weight: ${(props) => props.$active ? 600 : 500};
|
|
7266
|
-
text-align: center;
|
|
7267
|
-
transition: all 0.3s ease;
|
|
7268
|
-
`;
|
|
7269
|
-
const ContentCard = styled(Box)`
|
|
7270
|
-
background: ${(p) => p.theme.colors.neutral0};
|
|
7271
|
-
border: 1px solid ${colors.border};
|
|
7272
|
-
border-radius: 16px;
|
|
7273
|
-
padding: 32px;
|
|
7274
|
-
margin-bottom: 24px;
|
|
7275
|
-
animation: ${fadeIn} 0.4s ease;
|
|
7276
|
-
box-shadow: 0 4px 24px rgba(0,0,0,0.06);
|
|
7277
|
-
`;
|
|
7278
|
-
const QRCodeContainer = styled.div`
|
|
7279
|
-
display: flex;
|
|
7280
|
-
flex-direction: column;
|
|
7281
|
-
align-items: center;
|
|
7282
|
-
padding: 32px;
|
|
7283
|
-
background: ${colors.neutralLight};
|
|
7284
|
-
border-radius: 16px;
|
|
7285
|
-
margin: 24px 0;
|
|
7286
|
-
`;
|
|
7287
|
-
const QRImage = styled.img`
|
|
7288
|
-
width: 280px;
|
|
7289
|
-
height: 280px;
|
|
7290
|
-
border-radius: 12px;
|
|
7291
|
-
box-shadow: 0 4px 24px rgba(0,0,0,0.1);
|
|
7292
|
-
`;
|
|
7293
|
-
const StatusBadge = styled.div`
|
|
7294
|
-
display: inline-flex;
|
|
7295
|
-
align-items: center;
|
|
7296
|
-
gap: 8px;
|
|
7297
|
-
padding: 8px 16px;
|
|
7298
|
-
border-radius: 20px;
|
|
7299
|
-
font-weight: 600;
|
|
7300
|
-
font-size: 14px;
|
|
7301
|
-
background: ${(props) => {
|
|
7302
|
-
switch (props.$status) {
|
|
7303
|
-
case "connected":
|
|
7304
|
-
return colors.successLight;
|
|
7305
|
-
case "connecting":
|
|
7306
|
-
return colors.primaryLight;
|
|
7307
|
-
case "qr_pending":
|
|
7308
|
-
return colors.whatsappLight;
|
|
7309
|
-
case "disconnected":
|
|
7310
|
-
return colors.neutralLight;
|
|
7311
|
-
default:
|
|
7312
|
-
return colors.neutralLight;
|
|
7313
|
-
}
|
|
7314
|
-
}};
|
|
7315
|
-
color: ${(props) => {
|
|
7316
|
-
switch (props.$status) {
|
|
7317
|
-
case "connected":
|
|
7318
|
-
return colors.success;
|
|
7319
|
-
case "connecting":
|
|
7320
|
-
return colors.primary;
|
|
7321
|
-
case "qr_pending":
|
|
7322
|
-
return colors.whatsappDark;
|
|
7323
|
-
case "disconnected":
|
|
7324
|
-
return colors.neutral;
|
|
7325
|
-
default:
|
|
7326
|
-
return colors.neutral;
|
|
7327
|
-
}
|
|
7328
|
-
}};
|
|
7329
|
-
`;
|
|
7330
|
-
const SpinningLoader = styled.div`
|
|
7331
|
-
width: 20px;
|
|
7332
|
-
height: 20px;
|
|
7333
|
-
border: 2px solid ${colors.primary}40;
|
|
7334
|
-
border-top-color: ${colors.primary};
|
|
7335
|
-
border-radius: 50%;
|
|
7336
|
-
animation: ${spin} 1s linear infinite;
|
|
7337
|
-
`;
|
|
7338
|
-
const ConnectedCard = styled(Box)`
|
|
7339
|
-
background: linear-gradient(135deg, ${colors.successLight}, ${colors.whatsappLight});
|
|
7340
|
-
border: 2px solid ${colors.success};
|
|
7341
|
-
border-radius: 16px;
|
|
7342
|
-
padding: 32px;
|
|
7343
|
-
text-align: center;
|
|
7344
|
-
`;
|
|
7345
|
-
const InfoBox = styled(Box)`
|
|
7346
|
-
background: linear-gradient(135deg, rgba(2, 132, 199, 0.06) 0%, ${colors.whatsappLight} 100%);
|
|
7347
|
-
border: 1px solid rgba(2, 132, 199, 0.2);
|
|
7348
|
-
border-radius: 12px;
|
|
7349
|
-
padding: 24px;
|
|
7350
|
-
margin: 20px 0;
|
|
7351
|
-
`;
|
|
7352
|
-
const TestSection = styled(Box)`
|
|
7353
|
-
background: linear-gradient(135deg, ${colors.whatsappLight} 0%, rgba(34, 197, 94, 0.1) 100%);
|
|
7354
|
-
border: 1px solid ${colors.whatsapp}40;
|
|
7355
|
-
border-radius: 16px;
|
|
7356
|
-
padding: 24px;
|
|
7357
|
-
margin-top: 24px;
|
|
7358
|
-
`;
|
|
7359
|
-
const WhatsAppInput = styled.input`
|
|
7360
|
-
width: 100%;
|
|
7361
|
-
padding: 14px 16px;
|
|
7362
|
-
border: 2px solid rgba(128, 128, 128, 0.2);
|
|
7363
|
-
border-radius: 12px;
|
|
7364
|
-
font-size: 15px;
|
|
7365
|
-
background: ${(p) => p.theme.colors.neutral0};
|
|
7366
|
-
color: var(--colors-neutral800);
|
|
7367
|
-
transition: all 0.2s ease;
|
|
7368
|
-
box-sizing: border-box;
|
|
7369
|
-
|
|
7370
|
-
&:focus {
|
|
7371
|
-
outline: none;
|
|
7372
|
-
border-color: ${colors.whatsapp};
|
|
7373
|
-
box-shadow: 0 0 0 3px ${colors.whatsapp}20;
|
|
7374
|
-
}
|
|
7375
|
-
|
|
7376
|
-
&::placeholder {
|
|
7377
|
-
color: rgba(128, 128, 128, 0.4);
|
|
7378
|
-
}
|
|
7379
|
-
`;
|
|
7380
|
-
const WhatsAppTextarea = styled.textarea`
|
|
7381
|
-
width: 100%;
|
|
7382
|
-
padding: 14px 16px;
|
|
7383
|
-
border: 2px solid rgba(128, 128, 128, 0.2);
|
|
7384
|
-
border-radius: 12px;
|
|
7385
|
-
font-size: 15px;
|
|
7386
|
-
background: ${(p) => p.theme.colors.neutral0};
|
|
7387
|
-
color: var(--colors-neutral800);
|
|
7388
|
-
transition: all 0.2s ease;
|
|
7389
|
-
box-sizing: border-box;
|
|
7390
|
-
resize: vertical;
|
|
7391
|
-
min-height: 80px;
|
|
7392
|
-
font-family: inherit;
|
|
7393
|
-
|
|
7394
|
-
&:focus {
|
|
7395
|
-
outline: none;
|
|
7396
|
-
border-color: ${colors.whatsapp};
|
|
7397
|
-
box-shadow: 0 0 0 3px ${colors.whatsapp}20;
|
|
7398
|
-
}
|
|
7399
|
-
|
|
7400
|
-
&::placeholder {
|
|
7401
|
-
color: rgba(128, 128, 128, 0.4);
|
|
7402
|
-
}
|
|
7403
|
-
`;
|
|
7404
|
-
const InputLabel = styled.label`
|
|
7405
|
-
display: flex;
|
|
7406
|
-
align-items: center;
|
|
7407
|
-
gap: 8px;
|
|
7408
|
-
font-size: 14px;
|
|
7409
|
-
font-weight: 600;
|
|
7410
|
-
color: ${colors.whatsappDark};
|
|
7411
|
-
margin-bottom: 8px;
|
|
7412
|
-
`;
|
|
7413
|
-
const InputHint = styled.span`
|
|
7414
|
-
font-size: 12px;
|
|
7415
|
-
color: var(--colors-neutral500);
|
|
7416
|
-
margin-top: 6px;
|
|
7417
|
-
display: block;
|
|
7418
|
-
`;
|
|
7419
|
-
const PhoneSymbol = styled.span`
|
|
7420
|
-
font-size: 16px;
|
|
7421
|
-
font-weight: 700;
|
|
7422
|
-
`;
|
|
7423
|
-
const MessageSymbol = styled.span`
|
|
7424
|
-
font-size: 16px;
|
|
7425
|
-
`;
|
|
7426
|
-
const UseCaseCard = styled(Box)`
|
|
7427
|
-
background: linear-gradient(135deg, ${colors.whatsappLight}, rgba(2, 132, 199, 0.06));
|
|
7428
|
-
border: 2px solid ${colors.whatsapp};
|
|
7429
|
-
border-radius: 16px;
|
|
7430
|
-
padding: 24px;
|
|
7431
|
-
margin-bottom: 32px;
|
|
7432
|
-
`;
|
|
7433
|
-
const ButtonRow = styled(Flex)`
|
|
7434
|
-
margin-top: 32px;
|
|
7435
|
-
padding-top: 24px;
|
|
7436
|
-
border-top: 1px solid rgba(128, 128, 128, 0.2);
|
|
7437
|
-
`;
|
|
7438
|
-
const AlertBox = styled(Box)`
|
|
7439
|
-
background: rgba(2, 132, 199, 0.06);
|
|
7440
|
-
border: 1px solid rgba(2, 132, 199, 0.2);
|
|
7441
|
-
border-radius: 12px;
|
|
7442
|
-
padding: 16px 20px;
|
|
7443
|
-
margin-top: 20px;
|
|
7444
|
-
display: flex;
|
|
7445
|
-
align-items: flex-start;
|
|
7446
|
-
gap: 12px;
|
|
7447
|
-
`;
|
|
7448
|
-
const AlertIcon = styled.div`
|
|
7449
|
-
width: 24px;
|
|
7450
|
-
height: 24px;
|
|
7451
|
-
border-radius: 50%;
|
|
7452
|
-
background: var(--colors-primary600, #0EA5E9);
|
|
7453
|
-
color: white;
|
|
7454
|
-
display: flex;
|
|
7455
|
-
align-items: center;
|
|
7456
|
-
justify-content: center;
|
|
7457
|
-
font-size: 14px;
|
|
7458
|
-
font-weight: bold;
|
|
7459
|
-
flex-shrink: 0;
|
|
7460
|
-
`;
|
|
7461
|
-
const SuccessBox = styled(Box)`
|
|
7462
|
-
background: rgba(22, 163, 74, 0.06);
|
|
7463
|
-
border: 1px solid rgba(22, 163, 74, 0.2);
|
|
7464
|
-
border-radius: 12px;
|
|
7465
|
-
padding: 16px 20px;
|
|
7466
|
-
display: flex;
|
|
7467
|
-
align-items: flex-start;
|
|
7468
|
-
gap: 12px;
|
|
7469
|
-
`;
|
|
7470
|
-
const SuccessIcon = styled.div`
|
|
7471
|
-
width: 24px;
|
|
7472
|
-
height: 24px;
|
|
7473
|
-
border-radius: 50%;
|
|
7474
|
-
background: var(--colors-success600, #22C55E);
|
|
7475
|
-
color: white;
|
|
7476
|
-
display: flex;
|
|
7477
|
-
align-items: center;
|
|
7478
|
-
justify-content: center;
|
|
7479
|
-
flex-shrink: 0;
|
|
7480
|
-
`;
|
|
7481
|
-
const WhatsAppButton = styled(GradientButton)`
|
|
7482
|
-
&& {
|
|
7483
|
-
background: linear-gradient(135deg, ${colors.whatsapp} 0%, ${colors.whatsappDark} 100%) !important;
|
|
7484
|
-
|
|
7485
|
-
&:hover:not(:disabled) {
|
|
7486
|
-
background: linear-gradient(135deg, ${colors.whatsappDark} 0%, ${colors.whatsapp} 100%) !important;
|
|
7487
|
-
}
|
|
7488
|
-
}
|
|
7489
|
-
`;
|
|
7490
|
-
const NotInstalledCard = styled(Box)`
|
|
7491
|
-
background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(220, 38, 38, 0.12));
|
|
7492
|
-
border: 2px solid var(--colors-warning600, #F59E0B);
|
|
7493
|
-
border-radius: 16px;
|
|
7494
|
-
padding: 32px;
|
|
7495
|
-
text-align: center;
|
|
7496
|
-
`;
|
|
7497
|
-
const WhatsAppPage = () => {
|
|
7498
|
-
const { get, post } = useFetchClient();
|
|
7499
|
-
const { toggleNotification } = useNotification();
|
|
7500
|
-
const [currentStep, setCurrentStep] = useState(1);
|
|
7501
|
-
const [loading, setLoading] = useState(true);
|
|
7502
|
-
const [connecting, setConnecting] = useState(false);
|
|
7503
|
-
const [isAvailable, setIsAvailable] = useState(false);
|
|
7504
|
-
const [status, setStatus] = useState({
|
|
7505
|
-
status: "disconnected",
|
|
7506
|
-
qrCode: null,
|
|
7507
|
-
isConnected: false,
|
|
7508
|
-
session: null
|
|
7509
|
-
});
|
|
7510
|
-
const [testPhone, setTestPhone] = useState("");
|
|
7511
|
-
const [testMessage, setTestMessage] = useState("");
|
|
7512
|
-
const [sendingTest, setSendingTest] = useState(false);
|
|
7513
|
-
const stepTitles = ["Check Installation", "Connect WhatsApp", "Scan QR Code", "Ready to Use"];
|
|
7514
|
-
const checkAvailability = useCallback(async () => {
|
|
7515
|
-
try {
|
|
7516
|
-
const { data } = await get("/magic-mail/whatsapp/available");
|
|
7517
|
-
setIsAvailable(data.data.available);
|
|
7518
|
-
return data.data.available;
|
|
7519
|
-
} catch (error) {
|
|
7520
|
-
console.error("[MagicMail WhatsApp] Error checking availability:", error);
|
|
7521
|
-
setIsAvailable(false);
|
|
7522
|
-
return false;
|
|
7523
|
-
}
|
|
7524
|
-
}, [get]);
|
|
7525
|
-
const fetchStatus = useCallback(async () => {
|
|
7526
|
-
try {
|
|
7527
|
-
const { data } = await get("/magic-mail/whatsapp/status");
|
|
7528
|
-
setStatus(data.data);
|
|
7529
|
-
if (data.data.isConnected) {
|
|
7530
|
-
setCurrentStep(4);
|
|
7531
|
-
} else if (data.data.qrCode) {
|
|
7532
|
-
setCurrentStep(3);
|
|
7533
|
-
} else if (isAvailable) {
|
|
7534
|
-
setCurrentStep(2);
|
|
7535
|
-
}
|
|
7536
|
-
return data.data;
|
|
7537
|
-
} catch (error) {
|
|
7538
|
-
console.error("[MagicMail WhatsApp] Error fetching status:", error);
|
|
7539
|
-
return null;
|
|
7540
|
-
}
|
|
7541
|
-
}, [get, isAvailable]);
|
|
7542
|
-
useEffect(() => {
|
|
7543
|
-
const init = async () => {
|
|
7544
|
-
setLoading(true);
|
|
7545
|
-
const available = await checkAvailability();
|
|
7546
|
-
if (available) {
|
|
7547
|
-
await fetchStatus();
|
|
7548
|
-
}
|
|
7549
|
-
setLoading(false);
|
|
7550
|
-
};
|
|
7551
|
-
init();
|
|
7552
|
-
}, [checkAvailability, fetchStatus]);
|
|
7553
|
-
useEffect(() => {
|
|
7554
|
-
let pollInterval;
|
|
7555
|
-
if (connecting || status.status === "connecting" || status.status === "qr_pending") {
|
|
7556
|
-
pollInterval = setInterval(async () => {
|
|
7557
|
-
const newStatus = await fetchStatus();
|
|
7558
|
-
if (newStatus?.isConnected) {
|
|
7559
|
-
setConnecting(false);
|
|
7560
|
-
setCurrentStep(4);
|
|
7561
|
-
toggleNotification({
|
|
7562
|
-
type: "success",
|
|
7563
|
-
message: "[SUCCESS] WhatsApp connected successfully!"
|
|
7564
|
-
});
|
|
7565
|
-
}
|
|
7566
|
-
}, 2e3);
|
|
7567
|
-
}
|
|
7568
|
-
return () => {
|
|
7569
|
-
if (pollInterval) clearInterval(pollInterval);
|
|
7570
|
-
};
|
|
7571
|
-
}, [connecting, status.status, fetchStatus, toggleNotification]);
|
|
7572
|
-
const handleConnect = async () => {
|
|
7573
|
-
setConnecting(true);
|
|
7574
|
-
try {
|
|
7575
|
-
const { data } = await post("/magic-mail/whatsapp/connect", {});
|
|
7576
|
-
if (data.data.qrCode) {
|
|
7577
|
-
setStatus((prev) => ({ ...prev, qrCode: data.data.qrCode, status: "qr_pending" }));
|
|
7578
|
-
setCurrentStep(3);
|
|
7579
|
-
} else if (data.data.status === "connected") {
|
|
7580
|
-
setStatus((prev) => ({ ...prev, isConnected: true, status: "connected" }));
|
|
7581
|
-
setCurrentStep(4);
|
|
7582
|
-
toggleNotification({
|
|
7583
|
-
type: "success",
|
|
7584
|
-
message: "[SUCCESS] WhatsApp already connected!"
|
|
7585
|
-
});
|
|
7586
|
-
}
|
|
7587
|
-
} catch (error) {
|
|
7588
|
-
toggleNotification({
|
|
7589
|
-
type: "danger",
|
|
7590
|
-
message: "[ERROR] Failed to connect: " + (error.response?.data?.error?.message || error.message)
|
|
7591
|
-
});
|
|
7592
|
-
setConnecting(false);
|
|
7593
|
-
}
|
|
7594
|
-
};
|
|
7595
|
-
const handleDisconnect = async () => {
|
|
7596
|
-
try {
|
|
7597
|
-
await post("/magic-mail/whatsapp/disconnect", {});
|
|
7598
|
-
setStatus({
|
|
7599
|
-
status: "disconnected",
|
|
7600
|
-
qrCode: null,
|
|
7601
|
-
isConnected: false,
|
|
7602
|
-
session: null
|
|
7603
|
-
});
|
|
7604
|
-
setCurrentStep(2);
|
|
7605
|
-
toggleNotification({
|
|
7606
|
-
type: "success",
|
|
7607
|
-
message: "[SUCCESS] WhatsApp disconnected"
|
|
7608
|
-
});
|
|
7609
|
-
} catch (error) {
|
|
7610
|
-
toggleNotification({
|
|
7611
|
-
type: "danger",
|
|
7612
|
-
message: "[ERROR] Failed to disconnect"
|
|
7613
|
-
});
|
|
7614
|
-
}
|
|
7615
|
-
};
|
|
7616
|
-
const handleSendTest = async () => {
|
|
7617
|
-
if (!testPhone) {
|
|
7618
|
-
toggleNotification({
|
|
7619
|
-
type: "warning",
|
|
7620
|
-
message: "Please enter a phone number"
|
|
7621
|
-
});
|
|
7622
|
-
return;
|
|
7623
|
-
}
|
|
7624
|
-
setSendingTest(true);
|
|
7625
|
-
try {
|
|
7626
|
-
const { data } = await post("/magic-mail/whatsapp/send-test", {
|
|
7627
|
-
phoneNumber: testPhone,
|
|
7628
|
-
message: testMessage || void 0
|
|
7629
|
-
});
|
|
7630
|
-
if (data.success) {
|
|
7631
|
-
toggleNotification({
|
|
7632
|
-
type: "success",
|
|
7633
|
-
message: "[SUCCESS] Test message sent!"
|
|
7634
|
-
});
|
|
7635
|
-
setTestPhone("");
|
|
7636
|
-
setTestMessage("");
|
|
7637
|
-
} else {
|
|
7638
|
-
toggleNotification({
|
|
7639
|
-
type: "danger",
|
|
7640
|
-
message: "[ERROR] " + (data.data.error || "Failed to send message")
|
|
7641
|
-
});
|
|
7642
|
-
}
|
|
7643
|
-
} catch (error) {
|
|
7644
|
-
toggleNotification({
|
|
7645
|
-
type: "danger",
|
|
7646
|
-
message: "[ERROR] " + (error.response?.data?.error?.message || error.message)
|
|
7647
|
-
});
|
|
7648
|
-
} finally {
|
|
7649
|
-
setSendingTest(false);
|
|
7650
|
-
}
|
|
7651
|
-
};
|
|
7652
|
-
const renderStatusBadge = () => {
|
|
7653
|
-
const statusText = {
|
|
7654
|
-
connected: "Connected",
|
|
7655
|
-
connecting: "Connecting...",
|
|
7656
|
-
qr_pending: "Waiting for QR Scan",
|
|
7657
|
-
disconnected: "Disconnected"
|
|
7658
|
-
};
|
|
7659
|
-
return /* @__PURE__ */ jsxs(StatusBadge, { $status: status.status, children: [
|
|
7660
|
-
status.status === "connecting" && /* @__PURE__ */ jsx(SpinningLoader, {}),
|
|
7661
|
-
status.status === "connected" && /* @__PURE__ */ jsx(Check, {}),
|
|
7662
|
-
statusText[status.status] || "Unknown"
|
|
7663
|
-
] });
|
|
7664
|
-
};
|
|
7665
|
-
if (loading) {
|
|
7666
|
-
return /* @__PURE__ */ jsx(PageContainer, { children: /* @__PURE__ */ jsx(Flex, { justifyContent: "center", alignItems: "center", style: { minHeight: "400px" }, children: /* @__PURE__ */ jsx(Loader, {}) }) });
|
|
7667
|
-
}
|
|
7668
|
-
return /* @__PURE__ */ jsxs(PageContainer, { children: [
|
|
7669
|
-
/* @__PURE__ */ jsxs(HeaderSection, { children: [
|
|
7670
|
-
/* @__PURE__ */ jsx(WhatsAppLogo, { children: /* @__PURE__ */ jsx(PhoneIcon, { children: /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", fill: "currentColor", width: "40", height: "40", children: /* @__PURE__ */ jsx("path", { d: "M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413z" }) }) }) }),
|
|
7671
|
-
/* @__PURE__ */ jsx(Typography, { variant: "alpha", fontWeight: "bold", style: { display: "block", marginBottom: "8px" }, children: "WhatsApp Integration" }),
|
|
7672
|
-
/* @__PURE__ */ jsx(Typography, { variant: "epsilon", textColor: "neutral600", style: { display: "block" }, children: "Send messages via WhatsApp - completely free!" }),
|
|
7673
|
-
/* @__PURE__ */ jsx(Box, { marginTop: 3, children: renderStatusBadge() })
|
|
7674
|
-
] }),
|
|
7675
|
-
/* @__PURE__ */ jsx(StepperContainer, { children: [1, 2, 3, 4].map((step) => /* @__PURE__ */ jsxs(
|
|
7676
|
-
StepWrapper,
|
|
7677
|
-
{
|
|
7678
|
-
$completed: currentStep > step,
|
|
7679
|
-
children: [
|
|
7680
|
-
/* @__PURE__ */ jsx(
|
|
7681
|
-
StepDot,
|
|
7682
|
-
{
|
|
7683
|
-
$active: currentStep === step,
|
|
7684
|
-
$completed: currentStep > step,
|
|
7685
|
-
onClick: () => currentStep > step && setCurrentStep(step),
|
|
7686
|
-
children: currentStep > step ? /* @__PURE__ */ jsx(Check, {}) : step
|
|
7687
|
-
}
|
|
7688
|
-
),
|
|
7689
|
-
/* @__PURE__ */ jsx(
|
|
7690
|
-
StepLabel,
|
|
7691
|
-
{
|
|
7692
|
-
$active: currentStep === step,
|
|
7693
|
-
$completed: currentStep > step,
|
|
7694
|
-
children: stepTitles[step - 1]
|
|
7695
|
-
}
|
|
7696
|
-
)
|
|
7697
|
-
]
|
|
7698
|
-
},
|
|
7699
|
-
step
|
|
7700
|
-
)) }),
|
|
7701
|
-
/* @__PURE__ */ jsxs(UseCaseCard, { children: [
|
|
7702
|
-
/* @__PURE__ */ jsx(Typography, { variant: "delta", fontWeight: "bold", style: { display: "block", marginBottom: "12px" }, children: "What can you do with WhatsApp?" }),
|
|
7703
|
-
/* @__PURE__ */ jsx(Typography, { variant: "omega", textColor: "neutral700", style: { display: "block", marginBottom: "16px" }, children: "WhatsApp integration provides free messaging as an alternative or backup to email delivery." }),
|
|
7704
|
-
/* @__PURE__ */ jsxs(Flex, { direction: "column", gap: 3, children: [
|
|
7705
|
-
/* @__PURE__ */ jsxs(Box, { padding: 3, background: "neutral0", hasRadius: true, style: { border: `1px solid ${colors.border}` }, children: [
|
|
7706
|
-
/* @__PURE__ */ jsx(Typography, { variant: "pi", fontWeight: "bold", style: { display: "block", marginBottom: "4px" }, children: "1. FALLBACK-KANAL" }),
|
|
7707
|
-
/* @__PURE__ */ jsx(Typography, { variant: "pi", textColor: "neutral600", style: { display: "block" }, children: "Wenn alle Email-Accounts fehlschlagen, wird die Nachricht automatisch via WhatsApp zugestellt." })
|
|
7708
|
-
] }),
|
|
7709
|
-
/* @__PURE__ */ jsxs(Box, { padding: 3, background: "neutral0", hasRadius: true, style: { border: `1px solid ${colors.border}` }, children: [
|
|
7710
|
-
/* @__PURE__ */ jsx(Typography, { variant: "pi", fontWeight: "bold", style: { display: "block", marginBottom: "4px" }, children: "2. ADMIN-BENACHRICHTIGUNGEN" }),
|
|
7711
|
-
/* @__PURE__ */ jsx(Typography, { variant: "pi", textColor: "neutral600", style: { display: "block" }, children: "Bei Email-Bounces, Quota-Limits oder Account-Fehlern wird der Admin via WhatsApp benachrichtigt." })
|
|
7712
|
-
] }),
|
|
7713
|
-
/* @__PURE__ */ jsxs(Box, { padding: 3, background: "neutral0", hasRadius: true, style: { border: `1px solid ${colors.border}` }, children: [
|
|
7714
|
-
/* @__PURE__ */ jsx(Typography, { variant: "pi", fontWeight: "bold", style: { display: "block", marginBottom: "4px" }, children: "3. ROUTING-INTEGRATION" }),
|
|
7715
|
-
/* @__PURE__ */ jsx(Typography, { variant: "pi", textColor: "neutral600", style: { display: "block" }, children: "In Routing-Regeln kann WhatsApp als Fallback-Kanal definiert werden (Routing Rules Tab)." })
|
|
7716
|
-
] })
|
|
7717
|
-
] })
|
|
7718
|
-
] }),
|
|
7719
|
-
currentStep === 1 && /* @__PURE__ */ jsxs(ContentCard, { children: [
|
|
7720
|
-
/* @__PURE__ */ jsx(Typography, { variant: "beta", fontWeight: "bold", style: { display: "block", marginBottom: "8px" }, children: "Check Installation" }),
|
|
7721
|
-
/* @__PURE__ */ jsx(Typography, { variant: "omega", textColor: "neutral600", style: { display: "block", marginBottom: "24px" }, children: "First, we need to verify that the required dependencies are installed." }),
|
|
7722
|
-
isAvailable ? /* @__PURE__ */ jsxs(SuccessBox, { children: [
|
|
7723
|
-
/* @__PURE__ */ jsx(SuccessIcon, { children: /* @__PURE__ */ jsx(Check, { style: { width: 14, height: 14 } }) }),
|
|
7724
|
-
/* @__PURE__ */ jsxs(Box, { children: [
|
|
7725
|
-
/* @__PURE__ */ jsx(Typography, { variant: "omega", fontWeight: "semiBold", style: { display: "block", marginBottom: "4px", color: "var(--colors-success600, #15803D)" }, children: "Dependencies Installed" }),
|
|
7726
|
-
/* @__PURE__ */ jsx(Typography, { variant: "pi", textColor: "neutral600", children: "Baileys library is installed and ready to use. You can proceed to connect your WhatsApp account." })
|
|
7727
|
-
] })
|
|
7728
|
-
] }) : /* @__PURE__ */ jsxs(NotInstalledCard, { children: [
|
|
7729
|
-
/* @__PURE__ */ jsx(Typography, { variant: "beta", fontWeight: "bold", style: { display: "block", marginBottom: "12px", color: colors.danger }, children: "[WARNING] Dependencies Not Installed" }),
|
|
7730
|
-
/* @__PURE__ */ jsx(Typography, { variant: "omega", textColor: "neutral600", style: { display: "block", marginBottom: "16px" }, children: "The WhatsApp integration requires additional dependencies. Please install them:" }),
|
|
7731
|
-
/* @__PURE__ */ jsx(
|
|
7732
|
-
Box,
|
|
7733
|
-
{
|
|
7734
|
-
padding: 4,
|
|
7735
|
-
background: "neutral0",
|
|
7736
|
-
hasRadius: true,
|
|
7737
|
-
style: {
|
|
7738
|
-
fontFamily: "monospace",
|
|
7739
|
-
fontSize: "14px",
|
|
7740
|
-
border: `1px solid ${colors.border}`,
|
|
7741
|
-
marginBottom: "16px"
|
|
7742
|
-
},
|
|
7743
|
-
children: "npm install baileys pino qrcode"
|
|
7744
|
-
}
|
|
7745
|
-
),
|
|
7746
|
-
/* @__PURE__ */ jsx(Typography, { variant: "pi", textColor: "neutral600", children: "After installing, restart your Strapi server and refresh this page." })
|
|
7747
|
-
] }),
|
|
7748
|
-
/* @__PURE__ */ jsxs(ButtonRow, { justifyContent: "flex-end", gap: 3, children: [
|
|
7749
|
-
/* @__PURE__ */ jsx(
|
|
7750
|
-
SecondaryButton,
|
|
7751
|
-
{
|
|
7752
|
-
onClick: () => {
|
|
7753
|
-
checkAvailability();
|
|
7754
|
-
},
|
|
7755
|
-
startIcon: /* @__PURE__ */ jsx(ArrowClockwise, {}),
|
|
7756
|
-
children: "Refresh"
|
|
7757
|
-
}
|
|
7758
|
-
),
|
|
7759
|
-
/* @__PURE__ */ jsx(
|
|
7760
|
-
GradientButton,
|
|
7761
|
-
{
|
|
7762
|
-
onClick: () => setCurrentStep(2),
|
|
7763
|
-
disabled: !isAvailable,
|
|
7764
|
-
endIcon: /* @__PURE__ */ jsx(ArrowRight, {}),
|
|
7765
|
-
children: "Continue"
|
|
7766
|
-
}
|
|
7767
|
-
)
|
|
7768
|
-
] })
|
|
7769
|
-
] }),
|
|
7770
|
-
currentStep === 2 && /* @__PURE__ */ jsxs(ContentCard, { children: [
|
|
7771
|
-
/* @__PURE__ */ jsx(Typography, { variant: "beta", fontWeight: "bold", style: { display: "block", marginBottom: "8px" }, children: "Connect Your WhatsApp" }),
|
|
7772
|
-
/* @__PURE__ */ jsx(Typography, { variant: "omega", textColor: "neutral600", style: { display: "block", marginBottom: "24px" }, children: "Click the button below to start the connection process. A QR code will be generated for you to scan." }),
|
|
7773
|
-
/* @__PURE__ */ jsxs(InfoBox, { children: [
|
|
7774
|
-
/* @__PURE__ */ jsx(Typography, { variant: "delta", fontWeight: "bold", style: { display: "block", marginBottom: "16px", color: "var(--colors-primary600, #075985)" }, children: "How it works" }),
|
|
7775
|
-
/* @__PURE__ */ jsxs(Flex, { direction: "column", gap: 3, children: [
|
|
7776
|
-
/* @__PURE__ */ jsx(Typography, { variant: "omega", textColor: "neutral700", children: '1. Click "Connect WhatsApp" to generate a QR code' }),
|
|
7777
|
-
/* @__PURE__ */ jsx(Typography, { variant: "omega", textColor: "neutral700", children: "2. Open WhatsApp on your phone" }),
|
|
7778
|
-
/* @__PURE__ */ jsx(Typography, { variant: "omega", textColor: "neutral700", children: "3. Go to Settings - Linked Devices - Link a Device" }),
|
|
7779
|
-
/* @__PURE__ */ jsx(Typography, { variant: "omega", textColor: "neutral700", children: "4. Scan the QR code with your phone" })
|
|
7780
|
-
] })
|
|
7781
|
-
] }),
|
|
7782
|
-
/* @__PURE__ */ jsxs(AlertBox, { children: [
|
|
7783
|
-
/* @__PURE__ */ jsx(AlertIcon, { children: "i" }),
|
|
7784
|
-
/* @__PURE__ */ jsxs(Box, { children: [
|
|
7785
|
-
/* @__PURE__ */ jsx(Typography, { variant: "omega", fontWeight: "semiBold", style: { display: "block", marginBottom: "4px" }, children: "Session Persistence" }),
|
|
7786
|
-
/* @__PURE__ */ jsx(Typography, { variant: "pi", textColor: "neutral600", children: "Your WhatsApp session will be saved. You won't need to scan the QR code again unless you manually disconnect or your session expires." })
|
|
7787
|
-
] })
|
|
7788
|
-
] }),
|
|
7789
|
-
/* @__PURE__ */ jsxs(ButtonRow, { justifyContent: "space-between", children: [
|
|
7790
|
-
/* @__PURE__ */ jsx(
|
|
7791
|
-
TertiaryButton,
|
|
7792
|
-
{
|
|
7793
|
-
onClick: () => setCurrentStep(1),
|
|
7794
|
-
startIcon: /* @__PURE__ */ jsx(ArrowLeft, {}),
|
|
7795
|
-
children: "Back"
|
|
7796
|
-
}
|
|
7797
|
-
),
|
|
7798
|
-
/* @__PURE__ */ jsx(
|
|
7799
|
-
WhatsAppButton,
|
|
7800
|
-
{
|
|
7801
|
-
onClick: handleConnect,
|
|
7802
|
-
loading: connecting,
|
|
7803
|
-
startIcon: /* @__PURE__ */ jsx(Play, {}),
|
|
7804
|
-
children: "Connect WhatsApp"
|
|
7805
|
-
}
|
|
7806
|
-
)
|
|
7807
|
-
] })
|
|
7808
|
-
] }),
|
|
7809
|
-
currentStep === 3 && /* @__PURE__ */ jsxs(ContentCard, { children: [
|
|
7810
|
-
/* @__PURE__ */ jsx(Typography, { variant: "beta", fontWeight: "bold", style: { display: "block", marginBottom: "8px" }, children: "Scan QR Code" }),
|
|
7811
|
-
/* @__PURE__ */ jsx(Typography, { variant: "omega", textColor: "neutral600", style: { display: "block", marginBottom: "24px" }, children: "Open WhatsApp on your phone and scan this QR code to connect." }),
|
|
7812
|
-
/* @__PURE__ */ jsx(QRCodeContainer, { children: status.qrCode ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
7813
|
-
/* @__PURE__ */ jsx(QRImage, { src: status.qrCode, alt: "WhatsApp QR Code" }),
|
|
7814
|
-
/* @__PURE__ */ jsx(Typography, { variant: "pi", textColor: "neutral600", style: { marginTop: "16px" }, children: 'QR code expires in 60 seconds. If it expires, click "Refresh QR".' })
|
|
7815
|
-
] }) : /* @__PURE__ */ jsxs(Flex, { direction: "column", alignItems: "center", gap: 3, children: [
|
|
7816
|
-
/* @__PURE__ */ jsx(SpinningLoader, { style: { width: "40px", height: "40px" } }),
|
|
7817
|
-
/* @__PURE__ */ jsx(Typography, { variant: "omega", children: "Generating QR code..." })
|
|
7818
|
-
] }) }),
|
|
7819
|
-
/* @__PURE__ */ jsxs(InfoBox, { children: [
|
|
7820
|
-
/* @__PURE__ */ jsx(Typography, { variant: "delta", fontWeight: "bold", style: { display: "block", marginBottom: "16px", color: "var(--colors-primary600, #075985)" }, children: "Instructions" }),
|
|
7821
|
-
/* @__PURE__ */ jsxs(Flex, { direction: "column", gap: 2, children: [
|
|
7822
|
-
/* @__PURE__ */ jsx(Typography, { variant: "omega", textColor: "neutral700", children: "1. Open WhatsApp on your phone" }),
|
|
7823
|
-
/* @__PURE__ */ jsx(Typography, { variant: "omega", textColor: "neutral700", children: "2. Tap Menu or Settings" }),
|
|
7824
|
-
/* @__PURE__ */ jsx(Typography, { variant: "omega", textColor: "neutral700", children: '3. Select "Linked Devices"' }),
|
|
7825
|
-
/* @__PURE__ */ jsx(Typography, { variant: "omega", textColor: "neutral700", children: '4. Tap "Link a Device"' }),
|
|
7826
|
-
/* @__PURE__ */ jsx(Typography, { variant: "omega", textColor: "neutral700", children: "5. Point your phone camera at this QR code" })
|
|
7827
|
-
] })
|
|
7828
|
-
] }),
|
|
7829
|
-
/* @__PURE__ */ jsxs(ButtonRow, { justifyContent: "space-between", children: [
|
|
7830
|
-
/* @__PURE__ */ jsx(
|
|
7831
|
-
TertiaryButton,
|
|
7832
|
-
{
|
|
7833
|
-
onClick: () => setCurrentStep(2),
|
|
7834
|
-
startIcon: /* @__PURE__ */ jsx(ArrowLeft, {}),
|
|
7835
|
-
children: "Back"
|
|
7836
|
-
}
|
|
7837
|
-
),
|
|
7838
|
-
/* @__PURE__ */ jsx(
|
|
7839
|
-
SecondaryButton,
|
|
7840
|
-
{
|
|
7841
|
-
onClick: handleConnect,
|
|
7842
|
-
startIcon: /* @__PURE__ */ jsx(ArrowClockwise, {}),
|
|
7843
|
-
children: "Refresh QR"
|
|
7844
|
-
}
|
|
7845
|
-
)
|
|
7846
|
-
] })
|
|
7847
|
-
] }),
|
|
7848
|
-
currentStep === 4 && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
7849
|
-
/* @__PURE__ */ jsxs(ConnectedCard, { children: [
|
|
7850
|
-
/* @__PURE__ */ jsx(Box, { marginBottom: 4, children: /* @__PURE__ */ jsx(Check, { style: { width: "48px", height: "48px", color: colors.success } }) }),
|
|
7851
|
-
/* @__PURE__ */ jsx(Typography, { variant: "alpha", fontWeight: "bold", style: { display: "block", marginBottom: "8px" }, children: "WhatsApp Connected" }),
|
|
7852
|
-
status.session && /* @__PURE__ */ jsxs(Typography, { variant: "omega", textColor: "neutral600", style: { display: "block" }, children: [
|
|
7853
|
-
"Connected as: ",
|
|
7854
|
-
status.session.phoneNumber,
|
|
7855
|
-
" ",
|
|
7856
|
-
status.session.name && `(${status.session.name})`
|
|
7857
|
-
] })
|
|
7858
|
-
] }),
|
|
7859
|
-
/* @__PURE__ */ jsxs(ContentCard, { style: { marginTop: "24px" }, children: [
|
|
7860
|
-
/* @__PURE__ */ jsx(Typography, { variant: "beta", fontWeight: "bold", style: { display: "block", marginBottom: "8px" }, children: "Send Test Message" }),
|
|
7861
|
-
/* @__PURE__ */ jsx(Typography, { variant: "omega", textColor: "neutral600", style: { display: "block", marginBottom: "24px" }, children: "Test your WhatsApp connection by sending a message." }),
|
|
7862
|
-
/* @__PURE__ */ jsxs(TestSection, { children: [
|
|
7863
|
-
/* @__PURE__ */ jsxs(Box, { style: { marginBottom: "20px" }, children: [
|
|
7864
|
-
/* @__PURE__ */ jsxs(InputLabel, { children: [
|
|
7865
|
-
/* @__PURE__ */ jsx(PhoneSymbol, { children: "+" }),
|
|
7866
|
-
"Phone Number"
|
|
7867
|
-
] }),
|
|
7868
|
-
/* @__PURE__ */ jsx(
|
|
7869
|
-
WhatsAppInput,
|
|
7870
|
-
{
|
|
7871
|
-
placeholder: "49123456789",
|
|
7872
|
-
value: testPhone,
|
|
7873
|
-
onChange: (e) => setTestPhone(e.target.value)
|
|
7874
|
-
}
|
|
7875
|
-
),
|
|
7876
|
-
/* @__PURE__ */ jsx(InputHint, { children: "Enter with country code, without + (e.g., 49 for Germany, 1 for USA)" })
|
|
7877
|
-
] }),
|
|
7878
|
-
/* @__PURE__ */ jsxs(Box, { style: { marginBottom: "24px" }, children: [
|
|
7879
|
-
/* @__PURE__ */ jsxs(InputLabel, { children: [
|
|
7880
|
-
/* @__PURE__ */ jsx(MessageSymbol, { children: "@" }),
|
|
7881
|
-
"Message (optional)"
|
|
7882
|
-
] }),
|
|
7883
|
-
/* @__PURE__ */ jsx(
|
|
7884
|
-
WhatsAppTextarea,
|
|
7885
|
-
{
|
|
7886
|
-
placeholder: "Type your message here... or leave empty for default test message",
|
|
7887
|
-
value: testMessage,
|
|
7888
|
-
onChange: (e) => setTestMessage(e.target.value),
|
|
7889
|
-
rows: 3
|
|
7890
|
-
}
|
|
7891
|
-
)
|
|
7892
|
-
] }),
|
|
7893
|
-
/* @__PURE__ */ jsx(
|
|
7894
|
-
WhatsAppButton,
|
|
7895
|
-
{
|
|
7896
|
-
onClick: handleSendTest,
|
|
7897
|
-
loading: sendingTest,
|
|
7898
|
-
disabled: !testPhone,
|
|
7899
|
-
style: { width: "100%" },
|
|
7900
|
-
children: "Send Test Message"
|
|
7901
|
-
}
|
|
7902
|
-
)
|
|
7903
|
-
] }),
|
|
7904
|
-
/* @__PURE__ */ jsx(Divider, { style: { margin: "24px 0" } }),
|
|
7905
|
-
/* @__PURE__ */ jsx(Typography, { variant: "beta", fontWeight: "bold", style: { display: "block", marginBottom: "8px" }, children: "Using WhatsApp in Your Code" }),
|
|
7906
|
-
/* @__PURE__ */ jsx(Typography, { variant: "omega", textColor: "neutral600", style: { display: "block", marginBottom: "16px" }, children: "Use the WhatsApp service programmatically in your Strapi code." }),
|
|
7907
|
-
/* @__PURE__ */ jsx(
|
|
7908
|
-
Box,
|
|
7909
|
-
{
|
|
7910
|
-
padding: 4,
|
|
7911
|
-
background: "neutral100",
|
|
7912
|
-
hasRadius: true,
|
|
7913
|
-
style: {
|
|
7914
|
-
fontFamily: "monospace",
|
|
7915
|
-
fontSize: "13px",
|
|
7916
|
-
lineHeight: "1.6",
|
|
7917
|
-
overflow: "auto"
|
|
7918
|
-
},
|
|
7919
|
-
children: /* @__PURE__ */ jsx("pre", { style: { margin: 0 }, children: `// Send a message via WhatsApp
|
|
7920
|
-
const whatsapp = strapi.plugin('magic-mail').service('whatsapp');
|
|
7921
|
-
|
|
7922
|
-
// Send simple message
|
|
7923
|
-
await whatsapp.sendMessage('49123456789', 'Hello from MagicMail!');
|
|
7924
|
-
|
|
7925
|
-
// Send template message
|
|
7926
|
-
await whatsapp.sendTemplateMessage('49123456789', 'welcome', {
|
|
7927
|
-
name: 'John',
|
|
7928
|
-
company: 'ACME Corp',
|
|
7929
|
-
});` })
|
|
7930
|
-
}
|
|
7931
|
-
),
|
|
7932
|
-
/* @__PURE__ */ jsxs(ButtonRow, { justifyContent: "space-between", alignItems: "center", children: [
|
|
7933
|
-
/* @__PURE__ */ jsx(
|
|
7934
|
-
DangerButton,
|
|
7935
|
-
{
|
|
7936
|
-
onClick: handleDisconnect,
|
|
7937
|
-
startIcon: /* @__PURE__ */ jsx(Cross, {}),
|
|
7938
|
-
children: "Disconnect WhatsApp"
|
|
7939
|
-
}
|
|
7940
|
-
),
|
|
7941
|
-
/* @__PURE__ */ jsx(Badge, { backgroundColor: "success600", textColor: "neutral0", style: { padding: "8px 16px", fontSize: "13px" }, children: "FREE - No API costs!" })
|
|
7942
|
-
] })
|
|
7943
|
-
] })
|
|
7944
|
-
] })
|
|
7945
|
-
] });
|
|
7946
|
-
};
|
|
7947
7105
|
const pluginId = "magic-mail";
|
|
7948
7106
|
const pluginPermissions = {
|
|
7949
7107
|
access: [{ action: `plugin::${pluginId}.access`, subject: null }]
|
|
@@ -7957,22 +7115,18 @@ const App = () => {
|
|
|
7957
7115
|
if (location.pathname.includes("/analytics")) return "analytics";
|
|
7958
7116
|
if (location.pathname.includes("/routing")) return "routing";
|
|
7959
7117
|
if (location.pathname.includes("/designer") && !isEditorRoute) return "templates";
|
|
7960
|
-
if (location.pathname.includes("/whatsapp")) return "whatsapp";
|
|
7961
7118
|
return "accounts";
|
|
7962
7119
|
};
|
|
7963
|
-
const [activeTab, setActiveTab] = useState(getActiveTab());
|
|
7964
7120
|
const handleTabChange = (tab) => {
|
|
7965
|
-
setActiveTab(tab);
|
|
7966
7121
|
if (tab === "accounts") navigate("/plugins/magic-mail");
|
|
7967
7122
|
if (tab === "routing") navigate("/plugins/magic-mail/routing");
|
|
7968
7123
|
if (tab === "templates") navigate("/plugins/magic-mail/designer");
|
|
7969
7124
|
if (tab === "analytics") navigate("/plugins/magic-mail/analytics");
|
|
7970
|
-
if (tab === "whatsapp") navigate("/plugins/magic-mail/whatsapp");
|
|
7971
7125
|
};
|
|
7972
7126
|
if (isEditorRoute) {
|
|
7973
7127
|
return /* @__PURE__ */ jsx(Page.Protect, { permissions: pluginPermissions.access, children: /* @__PURE__ */ jsx(EditorPage, {}) });
|
|
7974
7128
|
}
|
|
7975
|
-
return /* @__PURE__ */ jsx(Page.Protect, { permissions: pluginPermissions.access, children: /* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsxs(Tabs.Root, { value:
|
|
7129
|
+
return /* @__PURE__ */ jsx(Page.Protect, { permissions: pluginPermissions.access, children: /* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsxs(Tabs.Root, { value: getActiveTab(), onValueChange: handleTabChange, children: [
|
|
7976
7130
|
/* @__PURE__ */ jsxs(Tabs.List, { children: [
|
|
7977
7131
|
/* @__PURE__ */ jsx(Tabs.Trigger, { value: "accounts", children: /* @__PURE__ */ jsxs(Flex, { gap: 2, alignItems: "center", children: [
|
|
7978
7132
|
/* @__PURE__ */ jsx(EnvelopeIcon, { style: { width: 16, height: 16 } }),
|
|
@@ -7989,17 +7143,12 @@ const App = () => {
|
|
|
7989
7143
|
/* @__PURE__ */ jsx(Tabs.Trigger, { value: "analytics", children: /* @__PURE__ */ jsxs(Flex, { gap: 2, alignItems: "center", children: [
|
|
7990
7144
|
/* @__PURE__ */ jsx(ChartBarIcon, { style: { width: 16, height: 16 } }),
|
|
7991
7145
|
"Analytics"
|
|
7992
|
-
] }) }),
|
|
7993
|
-
/* @__PURE__ */ jsx(Tabs.Trigger, { value: "whatsapp", children: /* @__PURE__ */ jsxs(Flex, { gap: 2, alignItems: "center", children: [
|
|
7994
|
-
/* @__PURE__ */ jsx(ChatBubbleLeftIcon, { style: { width: 16, height: 16 } }),
|
|
7995
|
-
"WhatsApp"
|
|
7996
7146
|
] }) })
|
|
7997
7147
|
] }),
|
|
7998
7148
|
/* @__PURE__ */ jsx(Tabs.Content, { value: "accounts", children: /* @__PURE__ */ jsx(HomePage, {}) }),
|
|
7999
7149
|
/* @__PURE__ */ jsx(Tabs.Content, { value: "routing", children: /* @__PURE__ */ jsx(RoutingRulesPage, {}) }),
|
|
8000
7150
|
/* @__PURE__ */ jsx(Tabs.Content, { value: "templates", children: /* @__PURE__ */ jsx(TemplateList, {}) }),
|
|
8001
|
-
/* @__PURE__ */ jsx(Tabs.Content, { value: "analytics", children: /* @__PURE__ */ jsx(Analytics, {}) })
|
|
8002
|
-
/* @__PURE__ */ jsx(Tabs.Content, { value: "whatsapp", children: /* @__PURE__ */ jsx(WhatsAppPage, {}) })
|
|
7151
|
+
/* @__PURE__ */ jsx(Tabs.Content, { value: "analytics", children: /* @__PURE__ */ jsx(Analytics, {}) })
|
|
8003
7152
|
] }) }) });
|
|
8004
7153
|
};
|
|
8005
7154
|
export {
|