strapi-plugin-magic-link-v5 5.5.8 → 6.0.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.
Files changed (58) hide show
  1. package/CHANGELOG.md +740 -0
  2. package/README.md +662 -928
  3. package/dist/admin/LicenseGuard-BgLA9go3.mjs +495 -0
  4. package/dist/admin/LicenseGuard-ewCjpc17.js +513 -0
  5. package/dist/admin/de-B1FNErPH.mjs +673 -0
  6. package/dist/admin/de-e75OECdq.js +673 -0
  7. package/dist/admin/en-CABKGbxH.js +673 -0
  8. package/dist/admin/en-HqDOFBCc.mjs +673 -0
  9. package/dist/admin/es-DpWl0Fax.js +673 -0
  10. package/dist/admin/es-jb94jqPR.mjs +673 -0
  11. package/dist/admin/fr-BQhLPvYw.js +673 -0
  12. package/dist/admin/fr-BseH1wrr.mjs +673 -0
  13. package/dist/admin/index-6ot9j1cN.js +5268 -0
  14. package/dist/admin/index-B390rccl.js +622 -0
  15. package/dist/admin/index-BPGKtruf.mjs +5266 -0
  16. package/dist/admin/index-BaTIQtnA.js +3869 -0
  17. package/dist/admin/index-CmG-93yx.js +141 -0
  18. package/dist/admin/index-DXe_ge4v.mjs +620 -0
  19. package/dist/admin/index-Dv5PVT1E.mjs +3867 -0
  20. package/dist/admin/index-k240ls6p.mjs +142 -0
  21. package/dist/admin/index.js +3 -3
  22. package/dist/admin/index.mjs +1 -2
  23. package/dist/admin/pt-CPkaveti.js +673 -0
  24. package/dist/admin/pt-DhlSCJn2.mjs +673 -0
  25. package/dist/admin/useUnsavedChangesGuard-BVZ4Mg4E.js +225 -0
  26. package/dist/admin/useUnsavedChangesGuard-QnkiZTLP.mjs +224 -0
  27. package/dist/server/i18n/de.json +32 -1
  28. package/dist/server/i18n/en.json +32 -1
  29. package/dist/server/i18n/es.json +32 -1
  30. package/dist/server/i18n/fr.json +32 -1
  31. package/dist/server/i18n/pt.json +32 -1
  32. package/dist/server/index.js +7092 -5979
  33. package/dist/server/index.mjs +7114 -5979
  34. package/package.json +42 -41
  35. package/strapi-admin.js +3 -1
  36. package/strapi-server.js +3 -2
  37. package/dist/_chunks/LicenseGuard-CiyjFnrw.js +0 -54
  38. package/dist/_chunks/LicenseGuard-DJ5fq2UZ.mjs +0 -55
  39. package/dist/_chunks/de-BSOk5suQ.js +0 -454
  40. package/dist/_chunks/de-CwhYs3O3.mjs +0 -454
  41. package/dist/_chunks/en-DnvSpXvu.js +0 -454
  42. package/dist/_chunks/en-gXXgGDV1.mjs +0 -454
  43. package/dist/_chunks/es-B-tnwByt.js +0 -407
  44. package/dist/_chunks/es-DG5gW3RZ.mjs +0 -407
  45. package/dist/_chunks/fr-BKo8t7Fx.js +0 -407
  46. package/dist/_chunks/fr-BQn1OHOR.mjs +0 -407
  47. package/dist/_chunks/index-01GHNxSr.js +0 -307
  48. package/dist/_chunks/index-B9Ch8Jpe.mjs +0 -5066
  49. package/dist/_chunks/index-Bj-erY7g.mjs +0 -143
  50. package/dist/_chunks/index-CGxbhJfg.js +0 -142
  51. package/dist/_chunks/index-DF3Edydl.mjs +0 -330
  52. package/dist/_chunks/index-Dufv-daf.mjs +0 -305
  53. package/dist/_chunks/index-I72rBTkL.js +0 -332
  54. package/dist/_chunks/index-SCxv154G.mjs +0 -2904
  55. package/dist/_chunks/index-XYWLmmEs.js +0 -5068
  56. package/dist/_chunks/index-zzoovbM0.js +0 -2906
  57. package/dist/_chunks/pt-CjEkXBAz.js +0 -407
  58. package/dist/_chunks/pt-trziAOzT.mjs +0 -407
@@ -1,2906 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const jsxRuntime = require("react/jsx-runtime");
4
- const react = require("react");
5
- const styled = require("styled-components");
6
- const reactIntl = require("react-intl");
7
- const designSystem = require("@strapi/design-system");
8
- const icons = require("@strapi/icons");
9
- const admin = require("@strapi/strapi/admin");
10
- const index = require("./index-CGxbhJfg.js");
11
- const LicenseGuard = require("./LicenseGuard-CiyjFnrw.js");
12
- const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
13
- const styled__default = /* @__PURE__ */ _interopDefault(styled);
14
- const EMAIL_TEMPLATES = {
15
- modern: {
16
- name: "Modern Gradient",
17
- preview: "Modern design with gradient header",
18
- html: `<!DOCTYPE html>
19
- <html lang="en">
20
- <head>
21
- <meta charset="UTF-8">
22
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
23
- <title>Magic Link Login</title>
24
- </head>
25
- <body style="margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;">
26
- <table width="100%" cellpadding="0" cellspacing="0" style="background-color: #f7fafc; padding: 40px 20px;">
27
- <tr>
28
- <td align="center">
29
- <table width="600" cellpadding="0" cellspacing="0" style="background-color: #ffffff; border-radius: 16px; overflow: hidden; box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);">
30
- <!-- Header with Gradient -->
31
- <tr>
32
- <td style="background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); padding: 40px 30px; text-align: center;">
33
- <h1 style="color: #ffffff; margin: 0; font-size: 28px; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 8px;">
34
- <svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="display: inline-block; vertical-align: middle;"><rect x="3" y="11" width="18" height="11" rx="2" ry="2"></rect><path d="M7 11V7a5 5 0 0 1 10 0v4"></path></svg>
35
- Magic Link Login
36
- </h1>
37
- <p style="color: rgba(255, 255, 255, 0.9); margin: 10px 0 0; font-size: 16px;">
38
- Secure passwordless authentication
39
- </p>
40
- </td>
41
- </tr>
42
-
43
- <!-- Content -->
44
- <tr>
45
- <td style="padding: 40px 30px;">
46
- <h2 style="color: #2d3748; margin: 0 0 20px; font-size: 22px; font-weight: 600;">
47
- Click to login
48
- </h2>
49
- <p style="color: #4a5568; line-height: 1.6; margin: 0 0 30px; font-size: 16px;">
50
- We received a login request for your account. Click the button below to securely sign in.
51
- </p>
52
-
53
- <!-- Button -->
54
- <table width="100%" cellpadding="0" cellspacing="0">
55
- <tr>
56
- <td align="center" style="padding: 20px 0;">
57
- <a href="<%= URL %>?loginToken=<%= CODE %>"
58
- style="display: inline-block; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: #ffffff; padding: 16px 48px; border-radius: 12px; text-decoration: none; font-weight: 600; font-size: 16px; box-shadow: 0 4px 14px rgba(102, 126, 234, 0.4);">
59
- Sign In Securely
60
- </a>
61
- </td>
62
- </tr>
63
- </table>
64
-
65
- <p style="color: #718096; line-height: 1.6; margin: 30px 0 0; font-size: 14px;">
66
- Or copy and paste this link into your browser:<br>
67
- <a href="<%= URL %>?loginToken=<%= CODE %>" style="color: #667eea; word-break: break-all;"><%= URL %>?loginToken=<%= CODE %></a>
68
- </p>
69
- </td>
70
- </tr>
71
-
72
- <!-- Footer -->
73
- <tr>
74
- <td style="background-color: #f7fafc; padding: 30px; text-align: center; border-top: 1px solid #e2e8f0;">
75
- <p style="color: #718096; margin: 0 0 10px; font-size: 13px; display: flex; align-items: center; justify-content: center; gap: 6px;">
76
- <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="display: inline-block; vertical-align: middle;"><circle cx="12" cy="12" r="10"></circle><polyline points="12 6 12 12 16 14"></polyline></svg>
77
- This link expires in <%= EXPIRY_TEXT %>
78
- </p>
79
- <p style="color: #a0aec0; margin: 0; font-size: 12px;">
80
- If you didn't request this, you can safely ignore this email.
81
- </p>
82
- </td>
83
- </tr>
84
- </table>
85
- </td>
86
- </tr>
87
- </table>
88
- </body>
89
- </html>`,
90
- text: `Magic Link Login
91
-
92
- Click to login:
93
- <%= URL %>?loginToken=<%= CODE %>
94
-
95
- This link expires in <%= EXPIRY_TEXT %>.
96
-
97
- If you didn't request this, you can safely ignore this email.`
98
- },
99
- minimal: {
100
- name: "Clean Minimal",
101
- preview: "Simple and elegant design",
102
- html: `<!DOCTYPE html>
103
- <html lang="en">
104
- <head>
105
- <meta charset="UTF-8">
106
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
107
- <title>Your Magic Link</title>
108
- </head>
109
- <body style="margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;">
110
- <table width="100%" cellpadding="0" cellspacing="0" style="background-color: #ffffff; padding: 60px 20px;">
111
- <tr>
112
- <td align="center">
113
- <table width="500" cellpadding="0" cellspacing="0">
114
- <tr>
115
- <td style="text-align: center; padding-bottom: 40px;">
116
- <div style="width: 64px; height: 64px; background: #0EA5E9; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;">
117
- <svg width="32" height="32" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>
118
- </div>
119
- </td>
120
- </tr>
121
- <tr>
122
- <td style="text-align: center;">
123
- <h1 style="color: #111827; margin: 0 0 16px; font-size: 32px; font-weight: 700;">
124
- Your Magic Link
125
- </h1>
126
- <p style="color: #6B7280; line-height: 1.6; margin: 0 0 40px; font-size: 16px;">
127
- Click the button below to sign in to your account
128
- </p>
129
-
130
- <a href="<%= URL %>?loginToken=<%= CODE %>"
131
- style="display: inline-block; background-color: #0EA5E9; color: #ffffff; padding: 16px 40px; border-radius: 8px; text-decoration: none; font-weight: 600; font-size: 16px;">
132
- Sign In
133
- </a>
134
-
135
- <p style="color: #9CA3AF; margin: 40px 0 0; font-size: 14px;">
136
- Link expires in 1 hour
137
- </p>
138
- </td>
139
- </tr>
140
- </table>
141
- </td>
142
- </tr>
143
- </table>
144
- </body>
145
- </html>`,
146
- text: `Your Magic Link
147
-
148
- Click to sign in:
149
- <%= URL %>?loginToken=<%= CODE %>
150
-
151
- Link expires in <%= EXPIRY_TEXT %>.`
152
- },
153
- professional: {
154
- name: "Professional Blue",
155
- preview: "Corporate and trustworthy",
156
- html: `<!DOCTYPE html>
157
- <html lang="en">
158
- <head>
159
- <meta charset="UTF-8">
160
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
161
- <title>Secure Login Request</title>
162
- </head>
163
- <body style="margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background-color: #F3F4F6;">
164
- <table width="100%" cellpadding="0" cellspacing="0" style="padding: 40px 20px;">
165
- <tr>
166
- <td align="center">
167
- <table width="600" cellpadding="0" cellspacing="0" style="background-color: #ffffff; border-radius: 8px; overflow: hidden;">
168
- <!-- Logo/Brand Area -->
169
- <tr>
170
- <td style="background-color: #1E40AF; padding: 30px; text-align: center;">
171
- <h1 style="color: #ffffff; margin: 0; font-size: 24px; font-weight: 600; letter-spacing: 0.5px;">
172
- SECURE ACCESS
173
- </h1>
174
- </td>
175
- </tr>
176
-
177
- <!-- Content -->
178
- <tr>
179
- <td style="padding: 40px 40px 30px;">
180
- <p style="color: #111827; margin: 0 0 20px; font-size: 16px; font-weight: 600;">
181
- Hello,
182
- </p>
183
- <p style="color: #4B5563; line-height: 1.6; margin: 0 0 30px; font-size: 15px;">
184
- You have requested secure access to your account. Please click the button below to proceed with authentication.
185
- </p>
186
-
187
- <!-- Button Container -->
188
- <table width="100%" cellpadding="0" cellspacing="0" style="margin: 0 0 30px;">
189
- <tr>
190
- <td align="center" style="padding: 10px 0;">
191
- <a href="<%= URL %>?loginToken=<%= CODE %>"
192
- style="display: inline-block; background-color: #1E40AF; color: #ffffff; padding: 14px 32px; border-radius: 6px; text-decoration: none; font-weight: 600; font-size: 15px;">
193
- Verify & Sign In
194
- </a>
195
- </td>
196
- </tr>
197
- </table>
198
-
199
- <!-- Security Info Box -->
200
- <table width="100%" cellpadding="0" cellspacing="0" style="background-color: #EFF6FF; border-left: 4px solid #3B82F6; padding: 16px; margin: 0 0 20px;">
201
- <tr>
202
- <td>
203
- <p style="color: #1E40AF; margin: 0; font-size: 13px; line-height: 1.5;">
204
- <strong>🔒 Security Notice:</strong><br>
205
- This link will expire in 60 minutes. For your security, do not share this link with anyone.
206
- </p>
207
- </td>
208
- </tr>
209
- </table>
210
-
211
- <p style="color: #6B7280; line-height: 1.6; margin: 0; font-size: 13px;">
212
- If you did not request this authentication, please disregard this email or contact support if you have concerns.
213
- </p>
214
- </td>
215
- </tr>
216
-
217
- <!-- Footer -->
218
- <tr>
219
- <td style="background-color: #F9FAFB; padding: 20px 40px; border-top: 1px solid #E5E7EB;">
220
- <p style="color: #9CA3AF; margin: 0; font-size: 12px; text-align: center;">
221
- This is an automated message. Please do not reply to this email.
222
- </p>
223
- </td>
224
- </tr>
225
- </table>
226
- </td>
227
- </tr>
228
- </table>
229
- </body>
230
- </html>`,
231
- text: `SECURE ACCESS
232
-
233
- Hello,
234
-
235
- You have requested secure access to your account.
236
-
237
- Click to verify and sign in:
238
- <%= URL %>?loginToken=<%= CODE %>
239
-
240
- Security Notice:
241
- This link will expire in <%= EXPIRY_TEXT %>. Do not share this link.
242
-
243
- If you did not request this, please disregard this email.`
244
- },
245
- dark: {
246
- name: "Dark Mode",
247
- preview: "Modern dark theme",
248
- html: `<!DOCTYPE html>
249
- <html lang="en">
250
- <head>
251
- <meta charset="UTF-8">
252
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
253
- <title>Magic Link</title>
254
- </head>
255
- <body style="margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;">
256
- <table width="100%" cellpadding="0" cellspacing="0" style="background-color: #0F172A; padding: 40px 20px;">
257
- <tr>
258
- <td align="center">
259
- <table width="600" cellpadding="0" cellspacing="0" style="background-color: #1E293B; border-radius: 16px; overflow: hidden; border: 1px solid #334155;">
260
- <!-- Header -->
261
- <tr>
262
- <td style="padding: 40px 30px; text-align: center; background: linear-gradient(135deg, #312E81 0%, #1E293B 100%);">
263
- <h1 style="color: #E0E7FF; margin: 0; font-size: 28px; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 8px;">
264
- <svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="display: inline-block; vertical-align: middle;"><polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"></polygon></svg>
265
- Magic Link
266
- </h1>
267
- <p style="color: #A5B4FC; margin: 10px 0 0; font-size: 16px;">
268
- Passwordless Authentication
269
- </p>
270
- </td>
271
- </tr>
272
-
273
- <!-- Content -->
274
- <tr>
275
- <td style="padding: 40px 30px;">
276
- <p style="color: #E2E8F0; line-height: 1.6; margin: 0 0 24px; font-size: 16px;">
277
- Hey there! 👋
278
- </p>
279
- <p style="color: #CBD5E1; line-height: 1.6; margin: 0 0 32px; font-size: 15px;">
280
- Click the magic button below to access your account. No passwords, no hassle.
281
- </p>
282
-
283
- <!-- Button -->
284
- <table width="100%" cellpadding="0" cellspacing="0">
285
- <tr>
286
- <td align="center" style="padding: 20px 0;">
287
- <a href="<%= URL %>?loginToken=<%= CODE %>"
288
- style="display: inline-flex; align-items: center; gap: 8px; background: linear-gradient(135deg, #6366F1 0%, #8B5CF6 100%); color: #ffffff; padding: 16px 48px; border-radius: 12px; text-decoration: none; font-weight: 600; font-size: 16px; box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);">
289
- <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 2v20M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6"></path></svg>
290
- Launch Access
291
- </a>
292
- </td>
293
- </tr>
294
- </table>
295
-
296
- <p style="color: #94A3B8; line-height: 1.6; margin: 32px 0 0; font-size: 13px; text-align: center;">
297
- Or paste this URL in your browser:<br>
298
- <span style="color: #818CF8; word-break: break-all;"><%= URL %>?loginToken=<%= CODE %></span>
299
- </p>
300
- </td>
301
- </tr>
302
-
303
- <!-- Footer -->
304
- <tr>
305
- <td style="background-color: #0F172A; padding: 24px 30px; text-align: center; border-top: 1px solid #334155;">
306
- <p style="color: #64748B; margin: 0 0 8px; font-size: 13px;">
307
- ⏰ Expires in 1 hour
308
- </p>
309
- <p style="color: #475569; margin: 0; font-size: 12px;">
310
- Didn't request this? Just ignore this email.
311
- </p>
312
- </td>
313
- </tr>
314
- </table>
315
- </td>
316
- </tr>
317
- </table>
318
- </body>
319
- </html>`,
320
- text: `Magic Link
321
-
322
- Hey there!
323
-
324
- Click the link below to access your account:
325
- <%= URL %>?loginToken=<%= CODE %>
326
-
327
- Expires in <%= EXPIRY_TEXT %>.
328
-
329
- Didn't request this? Just ignore this email.`
330
- },
331
- playful: {
332
- name: "Playful & Fun",
333
- preview: "Colorful and engaging",
334
- html: `<!DOCTYPE html>
335
- <html lang="en">
336
- <head>
337
- <meta charset="UTF-8">
338
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
339
- <title>Your Magic Link is Ready!</title>
340
- </head>
341
- <body style="margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;">
342
- <table width="100%" cellpadding="0" cellspacing="0" style="background: linear-gradient(135deg, #FEF3C7 0%, #FED7AA 50%, #FECACA 100%); padding: 40px 20px;">
343
- <tr>
344
- <td align="center">
345
- <table width="600" cellpadding="0" cellspacing="0" style="background-color: #ffffff; border-radius: 24px; overflow: hidden; box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);">
346
- <!-- Fun Header -->
347
- <tr>
348
- <td style="padding: 40px 30px 30px; text-align: center;">
349
- <div style="margin-bottom: 16px; display: inline-block;">
350
- <svg width="64" height="64" viewBox="0 0 24 24" fill="none" stroke="#DC2626" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"></path><circle cx="12" cy="7" r="4"></circle></svg>
351
- </div>
352
- <h1 style="color: #DC2626; margin: 0; font-size: 32px; font-weight: 800;">
353
- Your Magic Link is Ready!
354
- </h1>
355
- <p style="color: #F59E0B; margin: 12px 0 0; font-size: 18px; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 6px;">
356
- Let's get you signed in
357
- <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="display: inline-block; vertical-align: middle;"><polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"></polygon></svg>
358
- </p>
359
- </td>
360
- </tr>
361
-
362
- <!-- Content -->
363
- <tr>
364
- <td style="padding: 20px 40px 40px;">
365
- <p style="color: #374151; line-height: 1.7; margin: 0 0 30px; font-size: 16px; text-align: center;">
366
- Hey friend! We've prepared something special for you. Click the shiny button below to access your account!
367
- </p>
368
-
369
- <!-- Colorful Button -->
370
- <table width="100%" cellpadding="0" cellspacing="0">
371
- <tr>
372
- <td align="center" style="padding: 10px 0 30px;">
373
- <a href="<%= URL %>?loginToken=<%= CODE %>"
374
- style="display: inline-flex; align-items: center; gap: 8px; background: linear-gradient(135deg, #F59E0B 0%, #DC2626 100%); color: #ffffff; padding: 18px 54px; border-radius: 16px; text-decoration: none; font-weight: 700; font-size: 18px; box-shadow: 0 8px 16px rgba(245, 158, 11, 0.4); text-transform: uppercase; letter-spacing: 0.5px;">
375
- <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"></circle><polyline points="8 12 12 16 16 12"></polyline><line x1="12" y1="8" x2="12" y2="16"></line></svg>
376
- Click Here!
377
- </a>
378
- </td>
379
- </tr>
380
- </table>
381
-
382
- <!-- Fun Fact Box -->
383
- <table width="100%" cellpadding="0" cellspacing="0" style="background: linear-gradient(135deg, #DBEAFE 0%, #E0E7FF 100%); border-radius: 12px; padding: 20px; margin: 20px 0;">
384
- <tr>
385
- <td style="text-align: center;">
386
- <p style="color: #1E40AF; margin: 0; font-size: 14px; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 6px;">
387
- <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="display: inline-block; vertical-align: middle;"><circle cx="12" cy="12" r="10"></circle><line x1="12" y1="16" x2="12" y2="12"></line><line x1="12" y1="8" x2="12.01" y2="8"></line></svg>
388
- Pro Tip: Save this email for quick access later!
389
- </p>
390
- </td>
391
- </tr>
392
- </table>
393
-
394
- <p style="color: #6B7280; line-height: 1.6; margin: 20px 0 0; font-size: 13px; text-align: center;">
395
- Can't click? Copy & paste: <span style="color: #F59E0B; word-break: break-all;"><%= URL %>?loginToken=<%= CODE %></span>
396
- </p>
397
- </td>
398
- </tr>
399
-
400
- <!-- Footer -->
401
- <tr>
402
- <td style="background: linear-gradient(135deg, #FEF3C7 0%, #FECACA 100%); padding: 24px; text-align: center;">
403
- <p style="color: #B91C1C; margin: 0 0 8px; font-size: 14px; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 6px;">
404
- <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="display: inline-block; vertical-align: middle;"><circle cx="12" cy="12" r="10"></circle><polyline points="12 6 12 12 16 14"></polyline></svg>
405
- Hurry! Link expires in <%= EXPIRY_TEXT %>
406
- </p>
407
- <p style="color: #DC2626; margin: 0; font-size: 12px;">
408
- Not you? No worries, just delete this email!
409
- </p>
410
- </td>
411
- </tr>
412
- </table>
413
- </td>
414
- </tr>
415
- </table>
416
- </body>
417
- </html>`,
418
- text: `Your Magic Link is Ready!
419
-
420
- Let's get you signed in!
421
-
422
- Click here:
423
- <%= URL %>?loginToken=<%= CODE %>
424
-
425
- Pro Tip: Save this email for quick access later!
426
-
427
- Hurry! Link expires in <%= EXPIRY_TEXT %>.
428
-
429
- Not you? No worries, just delete this email!`
430
- }
431
- };
432
- const getTemplateList = () => {
433
- return Object.entries(EMAIL_TEMPLATES).map(([key, template]) => ({
434
- value: key,
435
- label: template.name,
436
- preview: template.preview
437
- }));
438
- };
439
- const getTemplate = (key) => {
440
- return EMAIL_TEMPLATES[key] || EMAIL_TEMPLATES.modern;
441
- };
442
- const theme = {
443
- shadows: { sm: "0 1px 3px rgba(0,0,0,0.1)" },
444
- borderRadius: { md: "8px", lg: "12px" }
445
- };
446
- const fadeIn = styled.keyframes`
447
- from { opacity: 0; transform: translateY(10px); }
448
- to { opacity: 1; transform: translateY(0); }
449
- `;
450
- const PlaceholderGrid = styled__default.default(designSystem.Box)`
451
- display: grid;
452
- grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
453
- gap: 12px;
454
- `;
455
- const PlaceholderTile = styled__default.default(designSystem.Box)`
456
- border-radius: 8px;
457
- border: 1px solid rgba(14, 165, 233, 0.3);
458
- background: rgba(14, 165, 233, 0.04);
459
- padding: 14px;
460
- cursor: pointer;
461
- display: flex;
462
- flex-direction: column;
463
- min-height: 120px;
464
- transition: all 0.15s ease;
465
-
466
- &:hover {
467
- transform: translateY(-2px);
468
- box-shadow: 0 6px 16px rgba(2, 132, 199, 0.15);
469
- border-color: rgba(14, 165, 233, 0.6);
470
- }
471
-
472
- &:active {
473
- transform: translateY(0);
474
- }
475
- `;
476
- styled.keyframes`
477
- 0% { background-position: -200% 0; }
478
- 100% { background-position: 200% 0; }
479
- `;
480
- const Container = styled__default.default(designSystem.Box)`
481
- animation: ${fadeIn} 0.5s;
482
- max-width: 1400px;
483
- margin: 0 auto;
484
- `;
485
- const ToggleCard = styled__default.default(designSystem.Box)`
486
- background: ${(props) => props.$active ? "rgba(22, 163, 74, 0.08)" : "rgba(128, 128, 128, 0.06)"};
487
- border-radius: ${theme.borderRadius.md};
488
- padding: 20px;
489
- transition: all 0.2s ease;
490
- border: 2px solid ${(props) => props.$active ? "rgba(22, 163, 74, 0.4)" : "rgba(128, 128, 128, 0.2)"};
491
- box-shadow: ${(props) => props.$active ? "0 4px 12px rgba(34, 197, 94, 0.15)" : "0 1px 3px rgba(0, 0, 0, 0.1)"};
492
- position: relative;
493
- user-select: none;
494
- cursor: pointer;
495
-
496
- &:hover {
497
- transform: translateY(-2px);
498
- box-shadow: ${(props) => props.$active ? "0 6px 16px rgba(34, 197, 94, 0.25)" : "0 3px 8px rgba(128, 128, 128, 0.2)"};
499
- border-color: ${(props) => props.$active ? "rgba(22, 163, 74, 0.6)" : "rgba(128, 128, 128, 0.4)"};
500
- }
501
-
502
- &:active {
503
- transform: translateY(0px);
504
- box-shadow: ${(props) => props.$active ? "0 2px 6px rgba(34, 197, 94, 0.15)" : "0 1px 2px rgba(0, 0, 0, 0.1)"};
505
- }
506
-
507
- ${(props) => props.$active && `
508
- &::before {
509
- content: '${props.$statusLabel || ""}';
510
- position: absolute;
511
- top: 8px;
512
- right: 8px;
513
- background: #16A34A;
514
- color: white;
515
- padding: 2px 8px;
516
- border-radius: 4px;
517
- font-size: 10px;
518
- font-weight: bold;
519
- }
520
- `}
521
-
522
- ${(props) => !props.$active && `
523
- &::before {
524
- content: '${props.$statusLabel || ""}';
525
- position: absolute;
526
- top: 8px;
527
- right: 8px;
528
- background: rgba(128, 128, 128, 0.5);
529
- color: white;
530
- padding: 2px 8px;
531
- border-radius: 4px;
532
- font-size: 10px;
533
- font-weight: bold;
534
- }
535
- `}
536
- `;
537
- const GreenToggle = styled__default.default.div`
538
- ${(props) => props.$isActive && `
539
- button[role="switch"] {
540
- background-color: #16A34A !important;
541
- border-color: #16A34A !important;
542
-
543
- &:hover {
544
- background-color: #15803D !important;
545
- border-color: #15803D !important;
546
- }
547
-
548
- &:focus {
549
- background-color: #16A34A !important;
550
- border-color: #16A34A !important;
551
- box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.2) !important;
552
- }
553
- }
554
-
555
- /* Toggle handle */
556
- button[role="switch"] > span {
557
- background-color: white !important;
558
- }
559
- `}
560
-
561
- ${(props) => !props.$isActive && `
562
- button[role="switch"] {
563
- background-color: rgba(128, 128, 128, 0.3);
564
-
565
- &:hover {
566
- background-color: rgba(128, 128, 128, 0.4);
567
- }
568
- }
569
- `}
570
- `;
571
- const StickySaveBar = styled__default.default(designSystem.Box)`
572
- position: sticky;
573
- top: 0;
574
- z-index: 10;
575
- border-bottom: 1px solid rgba(128, 128, 128, 0.2);
576
- box-shadow: ${theme.shadows.sm};
577
- `;
578
- const IconWrapper = styled__default.default.div`
579
- width: 48px;
580
- height: 48px;
581
- border-radius: 12px;
582
- display: flex;
583
- align-items: center;
584
- justify-content: center;
585
- margin-bottom: 12px;
586
- background: ${(props) => props.$bgColor || "rgba(2, 132, 199, 0.12)"};
587
-
588
- svg {
589
- width: 24px;
590
- height: 24px;
591
- color: ${(props) => props.$iconColor || "var(--colors-primary600, #0284C7)"};
592
- }
593
- `;
594
- const SettingsModern = () => {
595
- const { formatMessage } = reactIntl.useIntl();
596
- const { toggleNotification } = admin.useNotification();
597
- const { get, put } = admin.useFetchClient();
598
- const { language, changeLanguage } = LicenseGuard.usePluginLanguage();
599
- const [isLoading, setIsLoading] = react.useState(false);
600
- const [isSaving, setIsSaving] = react.useState(false);
601
- const [settings, setSettings] = react.useState({
602
- enabled: true,
603
- createUserIfNotExists: true,
604
- expire_period: 3600,
605
- confirmationUrl: "",
606
- from_name: "",
607
- from_email: "",
608
- response_email: "",
609
- token_length: 32,
610
- stays_valid: false,
611
- object: "",
612
- message_html: "",
613
- message_text: "",
614
- max_login_attempts: 5,
615
- context_whitelist: [],
616
- context_blacklist: ["password", "secret", "apiKey", "token"],
617
- login_path: "/magic-link/login",
618
- user_creation_strategy: "email",
619
- verify_email: false,
620
- welcome_email: false,
621
- use_jwt_token: true,
622
- jwt_token_expires_in: "30d",
623
- callback_url: "",
624
- allow_magic_links_on_public_registration: false,
625
- store_login_info: true,
626
- ui_language: "en",
627
- rate_limit_enabled: true,
628
- rate_limit_max_attempts: 5,
629
- rate_limit_window_minutes: 15,
630
- use_email_designer: false,
631
- email_designer_template_id: "",
632
- use_magic_mail: false,
633
- // OTP Settings
634
- otp_enabled: false,
635
- otp_type: "email",
636
- otp_length: 6,
637
- otp_expiry: 300,
638
- otp_max_attempts: 3,
639
- otp_resend_cooldown: 60,
640
- // MFA Settings
641
- mfa_mode: "disabled",
642
- mfa_require_totp: false,
643
- totp_as_primary_auth: false,
644
- // TOTP Settings
645
- totp_issuer: "Magic Link",
646
- totp_algorithm: "SHA1",
647
- totp_digits: 6,
648
- totp_period: 30,
649
- // WhatsApp Settings
650
- whatsapp_enabled: false,
651
- whatsapp_debug: false,
652
- whatsapp_app_name: "Magic Link",
653
- whatsapp_message_template: `*{{appName}} Login*
654
-
655
- Klicke auf den Link um dich einzuloggen:
656
-
657
- {{link}}
658
-
659
- Dieser Link ist {{expiry}} gültig.
660
-
661
- _Falls du diesen Link nicht angefordert hast, ignoriere diese Nachricht._`,
662
- // Frontend URL Settings
663
- frontend_url: "",
664
- frontend_login_path: "/auth/magic-link"
665
- });
666
- const [rateLimitStats, setRateLimitStats] = react.useState(null);
667
- const [emailDesignerInstalled, setEmailDesignerInstalled] = react.useState(false);
668
- const [magicMailInstalled, setMagicMailInstalled] = react.useState(false);
669
- const [emailProviderConfigured, setEmailProviderConfigured] = react.useState(false);
670
- const [emailProviderName, setEmailProviderName] = react.useState(null);
671
- const [otpCodes, setOtpCodes] = react.useState([]);
672
- const [selectedEmailTemplate, setSelectedEmailTemplate] = react.useState(null);
673
- const [textEditorHeight, setTextEditorHeight] = react.useState(300);
674
- const [licenseInfo, setLicenseInfo] = react.useState(null);
675
- const [magicMailTemplates, setMagicMailTemplates] = react.useState([]);
676
- const [emailTemplates, setEmailTemplates] = react.useState([]);
677
- const placeholderList = react.useMemo(() => [
678
- {
679
- code: formatMessage({ id: index.getTrad("settings.email.placeholders.url") }),
680
- desc: formatMessage({ id: index.getTrad("settings.email.placeholders.url.description") }),
681
- example: formatMessage({ id: index.getTrad("settings.email.placeholders.url.example") })
682
- },
683
- {
684
- code: formatMessage({ id: index.getTrad("settings.email.placeholders.code") }),
685
- desc: formatMessage({ id: index.getTrad("settings.email.placeholders.code.description") }),
686
- example: formatMessage({ id: index.getTrad("settings.email.placeholders.code.example") })
687
- },
688
- {
689
- code: formatMessage({ id: index.getTrad("settings.email.placeholders.expiry") }),
690
- desc: formatMessage({ id: index.getTrad("settings.email.placeholders.expiry.description") }),
691
- example: formatMessage({ id: index.getTrad("settings.email.placeholders.expiry.example") })
692
- },
693
- {
694
- code: formatMessage({ id: index.getTrad("settings.email.placeholders.link") }),
695
- desc: formatMessage({ id: index.getTrad("settings.email.placeholders.link.description") }),
696
- example: formatMessage({ id: index.getTrad("settings.email.placeholders.link.example") })
697
- },
698
- {
699
- code: formatMessage({ id: index.getTrad("settings.email.placeholders.username") }),
700
- desc: formatMessage({ id: index.getTrad("settings.email.placeholders.username.description") }),
701
- example: formatMessage({ id: index.getTrad("settings.email.placeholders.username.example") })
702
- },
703
- {
704
- code: formatMessage({ id: index.getTrad("settings.email.placeholders.email") }),
705
- desc: formatMessage({ id: index.getTrad("settings.email.placeholders.email.description") }),
706
- example: formatMessage({ id: index.getTrad("settings.email.placeholders.email.example") })
707
- }
708
- ], [formatMessage]);
709
- const [selectedTemplateKey, setSelectedTemplateKey] = react.useState(null);
710
- const loadSettings = react.useCallback(async () => {
711
- setIsLoading(true);
712
- try {
713
- const res = await get("/magic-link/settings");
714
- console.log("🔍 Settings Response:", res.data);
715
- const settingsData = res.data.settings || res.data.data || res.data;
716
- setSettings((prev) => ({ ...prev, ...settingsData }));
717
- if (res.data.emailDesignerInstalled !== void 0) {
718
- setEmailDesignerInstalled(res.data.emailDesignerInstalled);
719
- console.log("📧 Email Designer:", res.data.emailDesignerInstalled);
720
- }
721
- if (res.data.magicMailInstalled !== void 0) {
722
- setMagicMailInstalled(res.data.magicMailInstalled);
723
- console.log("📬 MagicMail:", res.data.magicMailInstalled);
724
- }
725
- if (res.data.emailProviderConfigured !== void 0) {
726
- setEmailProviderConfigured(res.data.emailProviderConfigured);
727
- console.log("✉️ Email Provider Configured:", res.data.emailProviderConfigured);
728
- }
729
- if (res.data.emailProviderName !== void 0) {
730
- setEmailProviderName(res.data.emailProviderName);
731
- console.log("📮 Email Provider Name:", res.data.emailProviderName);
732
- }
733
- try {
734
- const statsRes = await get("/magic-link/rate-limit/stats");
735
- if (statsRes?.data?.data) {
736
- setRateLimitStats(statsRes.data.data);
737
- }
738
- } catch (error) {
739
- console.error("Error loading rate limit stats:", error);
740
- }
741
- try {
742
- const licenseRes = await get("/magic-link/license/status");
743
- if (licenseRes?.data) {
744
- const licenseData = licenseRes.data.data || {};
745
- const enrichedLicenseInfo = {
746
- ...licenseData,
747
- tier: "enterprise",
748
- valid: licenseRes.data.valid !== false,
749
- hasKey: licenseRes.data.hasKey === true
750
- };
751
- setLicenseInfo(enrichedLicenseInfo);
752
- }
753
- } catch (error) {
754
- console.error("Error loading license info:", error);
755
- setLicenseInfo({ tier: "enterprise", valid: true, hasKey: false });
756
- }
757
- } catch (error) {
758
- if (error.name !== "AbortError") {
759
- console.error("Error loading settings:", error);
760
- toggleNotification({
761
- type: "warning",
762
- message: formatMessage({ id: index.getTrad("settings.load.error") })
763
- });
764
- }
765
- } finally {
766
- setIsLoading(false);
767
- }
768
- }, [get, toggleNotification, formatMessage]);
769
- react.useEffect(() => {
770
- const fetchEmailTemplates = async () => {
771
- if (!emailDesignerInstalled) return;
772
- try {
773
- const response = await get("/email-designer-5/templates");
774
- const payload = response?.data;
775
- const templates = Array.isArray(payload) ? payload : payload?.data || payload?.templates || [];
776
- setEmailTemplates(templates);
777
- console.log(`✅ Email Designer templates loaded: ${templates.length}`);
778
- } catch (error) {
779
- console.error("❌ Error fetching email templates:", error);
780
- setEmailTemplates([]);
781
- }
782
- };
783
- fetchEmailTemplates();
784
- }, [emailDesignerInstalled, get]);
785
- react.useEffect(() => {
786
- const fetchMagicMailTemplates = async () => {
787
- if (magicMailInstalled) {
788
- try {
789
- const response = await get("/magic-mail/designer/templates");
790
- const payload = response?.data;
791
- const templates = Array.isArray(payload) ? payload : payload?.data || payload?.templates || [];
792
- setMagicMailTemplates(templates);
793
- console.log(`✅ MagicMail templates loaded: ${templates.length}`);
794
- } catch (error) {
795
- console.error("❌ Error fetching MagicMail templates:", error);
796
- setMagicMailTemplates([]);
797
- }
798
- }
799
- };
800
- fetchMagicMailTemplates();
801
- }, [magicMailInstalled, get]);
802
- react.useEffect(() => {
803
- loadSettings();
804
- }, []);
805
- react.useEffect(() => {
806
- const templateEntry = getTemplateList().find(({ value }) => {
807
- const tpl = getTemplate(value);
808
- return tpl.html === settings.message_html && tpl.text === settings.message_text;
809
- });
810
- if (templateEntry && templateEntry.value !== selectedTemplateKey) {
811
- setSelectedTemplateKey(templateEntry.value);
812
- }
813
- }, [settings.message_html, settings.message_text, selectedTemplateKey]);
814
- const handleSave = async (e) => {
815
- e.preventDefault();
816
- setIsSaving(true);
817
- try {
818
- const toSave = { ...settings, ui_language: language };
819
- if (typeof toSave.context_whitelist === "string") {
820
- toSave.context_whitelist = toSave.context_whitelist.split(",").map((s) => s.trim()).filter(Boolean);
821
- }
822
- if (typeof toSave.context_blacklist === "string") {
823
- toSave.context_blacklist = toSave.context_blacklist.split(",").map((s) => s.trim()).filter(Boolean);
824
- }
825
- await put("/magic-link/settings", toSave);
826
- toggleNotification({
827
- type: "success",
828
- message: formatMessage({ id: index.getTrad("settings.save.success") })
829
- });
830
- } catch (error) {
831
- if (error.name !== "AbortError") {
832
- console.error("Error saving settings:", error);
833
- toggleNotification({
834
- type: "danger",
835
- message: formatMessage({ id: index.getTrad("settings.save.error") })
836
- });
837
- }
838
- } finally {
839
- setIsSaving(false);
840
- }
841
- };
842
- const updateSetting = (key, value) => {
843
- setSettings({ ...settings, [key]: value });
844
- };
845
- const handleLanguageChange = (newLang) => {
846
- changeLanguage(newLang);
847
- };
848
- const handleRateLimitCleanup = async () => {
849
- try {
850
- await get("/magic-link/rate-limit/cleanup");
851
- toggleNotification({
852
- type: "success",
853
- message: formatMessage({ id: index.getTrad("settings.rateLimit.cleanupSuccess") })
854
- });
855
- loadSettings();
856
- } catch (error) {
857
- toggleNotification({
858
- type: "danger",
859
- message: formatMessage({ id: index.getTrad("settings.rateLimit.cleanupError") })
860
- });
861
- }
862
- };
863
- const handleRateLimitReset = async () => {
864
- if (window.confirm(formatMessage({ id: index.getTrad("settings.rateLimit.resetConfirm") }))) {
865
- try {
866
- await get("/magic-link/rate-limit/reset");
867
- toggleNotification({
868
- type: "success",
869
- message: formatMessage({ id: index.getTrad("settings.rateLimit.resetSuccess") })
870
- });
871
- loadSettings();
872
- } catch (error) {
873
- toggleNotification({
874
- type: "danger",
875
- message: formatMessage({ id: index.getTrad("settings.rateLimit.resetError") })
876
- });
877
- }
878
- }
879
- };
880
- if (isLoading) {
881
- return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { padding: 8, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { children: formatMessage({ id: index.getTrad("settings.load.loading") }) }) });
882
- }
883
- const statusActive = formatMessage({ id: index.getTrad("status.active") });
884
- const statusInactive = formatMessage({ id: index.getTrad("status.inactive") });
885
- return /* @__PURE__ */ jsxRuntime.jsxs(Container, { as: "form", onSubmit: handleSave, children: [
886
- /* @__PURE__ */ jsxRuntime.jsx(StickySaveBar, { background: "neutral0", paddingTop: 5, paddingBottom: 5, paddingLeft: 6, paddingRight: 6, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { justifyContent: "space-between", alignItems: "center", children: [
887
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", gap: 1, alignItems: "flex-start", children: [
888
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "alpha", fontWeight: "bold", textColor: "neutral800", tag: "h1", style: { fontSize: "24px" }, children: formatMessage({ id: index.getTrad("settings.page.title") }) }),
889
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "epsilon", textColor: "neutral600", tag: "p", children: formatMessage({ id: index.getTrad("settings.page.subtitle") }) })
890
- ] }),
891
- /* @__PURE__ */ jsxRuntime.jsx(
892
- designSystem.Button,
893
- {
894
- type: "submit",
895
- loading: isSaving,
896
- startIcon: /* @__PURE__ */ jsxRuntime.jsx(icons.Check, {}),
897
- disabled: isSaving,
898
- size: "L",
899
- style: {
900
- background: "linear-gradient(135deg, #667eea 0%, #764ba2 100%)",
901
- color: "white",
902
- fontWeight: "600",
903
- padding: "12px 24px",
904
- border: "none",
905
- boxShadow: "0 4px 12px rgba(102, 126, 234, 0.4)",
906
- transition: "all 0.3s cubic-bezier(0.4, 0, 0.2, 1)"
907
- },
908
- onMouseEnter: (e) => {
909
- if (!isSaving) {
910
- e.currentTarget.style.transform = "translateY(-2px)";
911
- e.currentTarget.style.boxShadow = "0 8px 20px rgba(102, 126, 234, 0.5)";
912
- }
913
- },
914
- onMouseLeave: (e) => {
915
- e.currentTarget.style.transform = "translateY(0)";
916
- e.currentTarget.style.boxShadow = "0 4px 12px rgba(102, 126, 234, 0.4)";
917
- },
918
- children: isSaving ? formatMessage({ id: index.getTrad("settings.save.saving") }) : formatMessage({ id: index.getTrad("settings.save.button") })
919
- }
920
- )
921
- ] }) }),
922
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { paddingTop: 6, paddingLeft: 6, paddingRight: 6, paddingBottom: 10, children: [
923
- /* @__PURE__ */ jsxRuntime.jsx(
924
- designSystem.Box,
925
- {
926
- padding: 5,
927
- style: { borderRadius: theme.borderRadius.lg, border: "2px solid rgba(2, 132, 199, 0.3)", marginBottom: "24px", background: "rgba(2, 132, 199, 0.06)" },
928
- children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 3, alignItems: "flex-start", children: [
929
- /* @__PURE__ */ jsxRuntime.jsx(
930
- designSystem.Box,
931
- {
932
- style: {
933
- width: "40px",
934
- height: "40px",
935
- borderRadius: "50%",
936
- background: "var(--colors-primary600, #0284C7)",
937
- display: "flex",
938
- alignItems: "center",
939
- justifyContent: "center",
940
- flexShrink: 0
941
- },
942
- children: /* @__PURE__ */ jsxRuntime.jsx(icons.Cog, { style: { width: "20px", height: "20px", color: "white" } })
943
- }
944
- ),
945
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { children: [
946
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", fontWeight: "bold", textColor: "neutral800", style: { fontSize: "14px", marginBottom: "4px", display: "block" }, children: formatMessage({ id: index.getTrad("settings.info.header") }) }),
947
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Typography, { variant: "pi", textColor: "neutral600", style: { lineHeight: "1.6", fontSize: "13px" }, children: [
948
- "• ",
949
- formatMessage({ id: index.getTrad("settings.info.line1") }),
950
- /* @__PURE__ */ jsxRuntime.jsx("br", {}),
951
- "• ",
952
- formatMessage({ id: index.getTrad("settings.info.line2") }),
953
- /* @__PURE__ */ jsxRuntime.jsx("br", {}),
954
- "• ",
955
- formatMessage({ id: index.getTrad("settings.info.line3") }),
956
- /* @__PURE__ */ jsxRuntime.jsx("br", {}),
957
- "• ",
958
- formatMessage({ id: index.getTrad("settings.info.line4") })
959
- ] })
960
- ] })
961
- ] })
962
- }
963
- ),
964
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Accordion.Root, { type: "multiple", defaultValue: ["general", "auth", "email", "mfa"], children: [
965
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Accordion.Item, { value: "general", children: [
966
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Accordion.Header, { children: /* @__PURE__ */ jsxRuntime.jsx(
967
- designSystem.Accordion.Trigger,
968
- {
969
- icon: icons.Cog,
970
- description: formatMessage({ id: index.getTrad("settings.section.general.description") }),
971
- children: formatMessage({ id: index.getTrad("settings.section.general") })
972
- }
973
- ) }),
974
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Accordion.Content, { children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { padding: 6, children: [
975
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { background: "neutral50", padding: 4, style: { borderRadius: theme.borderRadius.md, border: "2px solid rgba(128, 128, 128, 0.2)", marginBottom: "24px" }, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 4, alignItems: "center", children: [
976
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", fontWeight: "bold", style: { minWidth: "150px" }, children: formatMessage({ id: index.getTrad("settings.language.label") }) }),
977
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { style: { width: "200px" }, children: /* @__PURE__ */ jsxRuntime.jsxs(
978
- designSystem.SingleSelect,
979
- {
980
- value: language,
981
- onChange: handleLanguageChange,
982
- size: "S",
983
- children: [
984
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "en", children: formatMessage({ id: index.getTrad("settings.language.en") }) }),
985
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "de", children: formatMessage({ id: index.getTrad("settings.language.de") }) }),
986
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "fr", children: formatMessage({ id: index.getTrad("settings.language.fr") }) }),
987
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "es", children: formatMessage({ id: index.getTrad("settings.language.es") }) }),
988
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "pt", children: formatMessage({ id: index.getTrad("settings.language.pt") }) })
989
- ]
990
- }
991
- ) }),
992
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "neutral600", style: { fontSize: "11px", flex: 1 }, children: formatMessage({ id: index.getTrad("settings.language.hint") }) })
993
- ] }) }),
994
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { background: "neutral100", padding: 5, style: { borderRadius: theme.borderRadius.md, marginBottom: "24px" }, children: [
995
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "sigma", fontWeight: "bold", style: { marginBottom: "8px", display: "block", textAlign: "center", color: "var(--colors-neutral700)" }, children: formatMessage({ id: index.getTrad("settings.features.title") }) }),
996
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "neutral600", style: { marginBottom: "20px", display: "block", textAlign: "center", fontSize: "12px" }, children: formatMessage({ id: index.getTrad("settings.features.subtitle") }) }),
997
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Grid.Root, { gap: 4, children: [
998
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 4, s: 6, xs: 12, children: /* @__PURE__ */ jsxRuntime.jsx(ToggleCard, { $active: settings.enabled, $statusLabel: settings.enabled ? statusActive : statusInactive, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", gap: 3, children: [
999
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "center", alignItems: "center", style: { marginBottom: "8px" }, children: /* @__PURE__ */ jsxRuntime.jsx(
1000
- designSystem.Switch,
1001
- {
1002
- checked: settings.enabled,
1003
- onCheckedChange: (checked) => updateSetting("enabled", checked)
1004
- }
1005
- ) }),
1006
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { children: [
1007
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", fontWeight: "bold", style: { fontSize: "14px", marginBottom: "6px", display: "block", textAlign: "center" }, children: formatMessage({ id: index.getTrad("settings.feature.enabled.title") }) }),
1008
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "omega", textColor: "neutral600", style: { fontSize: "12px", lineHeight: "1.4", textAlign: "center" }, children: formatMessage({ id: index.getTrad("settings.feature.enabled.description") }) })
1009
- ] })
1010
- ] }) }) }),
1011
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 4, s: 6, xs: 12, children: /* @__PURE__ */ jsxRuntime.jsx(ToggleCard, { $active: settings.createUserIfNotExists, $statusLabel: settings.createUserIfNotExists ? statusActive : statusInactive, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", gap: 3, children: [
1012
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "center", alignItems: "center", style: { marginBottom: "8px" }, children: /* @__PURE__ */ jsxRuntime.jsx(
1013
- designSystem.Switch,
1014
- {
1015
- checked: settings.createUserIfNotExists,
1016
- onCheckedChange: (checked) => updateSetting("createUserIfNotExists", checked)
1017
- }
1018
- ) }),
1019
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { children: [
1020
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", fontWeight: "bold", style: { fontSize: "14px", marginBottom: "6px", display: "block", textAlign: "center" }, children: formatMessage({ id: index.getTrad("settings.feature.createUser.title") }) }),
1021
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "omega", textColor: "neutral600", style: { fontSize: "12px", lineHeight: "1.4", textAlign: "center" }, children: formatMessage({ id: index.getTrad("settings.feature.createUser.description") }) })
1022
- ] })
1023
- ] }) }) }),
1024
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 4, s: 6, xs: 12, children: /* @__PURE__ */ jsxRuntime.jsx(ToggleCard, { $active: settings.stays_valid, $statusLabel: settings.stays_valid ? statusActive : statusInactive, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", gap: 3, children: [
1025
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "center", alignItems: "center", style: { marginBottom: "8px" }, children: /* @__PURE__ */ jsxRuntime.jsx(
1026
- designSystem.Switch,
1027
- {
1028
- checked: settings.stays_valid,
1029
- onCheckedChange: (checked) => updateSetting("stays_valid", checked)
1030
- }
1031
- ) }),
1032
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { children: [
1033
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", fontWeight: "bold", style: { fontSize: "14px", marginBottom: "6px", display: "block", textAlign: "center" }, children: formatMessage({ id: index.getTrad("settings.feature.staysValid.title") }) }),
1034
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "omega", textColor: "neutral600", style: { fontSize: "12px", lineHeight: "1.4", textAlign: "center" }, children: formatMessage({ id: index.getTrad("settings.feature.staysValid.description") }) })
1035
- ] })
1036
- ] }) }) })
1037
- ] })
1038
- ] }),
1039
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "sigma", fontWeight: "bold", style: { marginBottom: "16px", display: "block", color: "var(--colors-neutral700)" }, children: formatMessage({ id: index.getTrad("settings.time.title") }) }),
1040
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Grid.Root, { gap: 6, style: { marginBottom: "32px" }, children: [
1041
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 6, s: 12, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { children: [
1042
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", fontWeight: "bold", style: { marginBottom: "8px", display: "block" }, children: formatMessage({ id: index.getTrad("settings.expire.label") }) }),
1043
- /* @__PURE__ */ jsxRuntime.jsx(
1044
- designSystem.NumberInput,
1045
- {
1046
- hint: formatMessage({ id: index.getTrad("settings.expire.hint") }),
1047
- value: settings.expire_period,
1048
- onValueChange: (val) => updateSetting("expire_period", val),
1049
- placeholder: formatMessage({ id: index.getTrad("settings.expire.placeholder") })
1050
- }
1051
- ),
1052
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { padding: 2, background: "primary50", style: { borderRadius: "4px", marginTop: "8px" }, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "primary700", style: { fontSize: "11px" }, children: formatMessage({ id: index.getTrad("settings.expire.recommendation") }) }) })
1053
- ] }) }),
1054
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 6, s: 12, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { children: [
1055
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", fontWeight: "bold", style: { marginBottom: "8px", display: "block" }, children: formatMessage({ id: index.getTrad("settings.tokenLength.label") }) }),
1056
- /* @__PURE__ */ jsxRuntime.jsx(
1057
- designSystem.NumberInput,
1058
- {
1059
- hint: formatMessage({ id: index.getTrad("settings.tokenLength.hint") }),
1060
- value: settings.token_length,
1061
- onValueChange: (val) => updateSetting("token_length", val),
1062
- placeholder: formatMessage({ id: index.getTrad("settings.tokenLength.placeholder") })
1063
- }
1064
- ),
1065
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { padding: 2, background: "success50", style: { borderRadius: "4px", marginTop: "8px" }, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "success700", style: { fontSize: "11px" }, children: formatMessage({ id: index.getTrad("settings.tokenLength.recommendation") }, { length: settings.token_length }) }) })
1066
- ] }) })
1067
- ] }),
1068
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "sigma", fontWeight: "bold", style: { marginBottom: "16px", display: "block", color: "var(--colors-neutral700)" }, children: formatMessage({ id: index.getTrad("settings.security.title") }) }),
1069
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Root, { gap: 6, style: { marginBottom: "32px" }, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 12, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { children: [
1070
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", fontWeight: "bold", style: { marginBottom: "8px", display: "block" }, children: formatMessage({ id: index.getTrad("settings.maxAttempts.label") }) }),
1071
- /* @__PURE__ */ jsxRuntime.jsx(
1072
- designSystem.NumberInput,
1073
- {
1074
- hint: formatMessage({ id: index.getTrad("settings.maxAttempts.hint") }),
1075
- value: settings.max_login_attempts,
1076
- onValueChange: (val) => updateSetting("max_login_attempts", val),
1077
- placeholder: formatMessage({ id: index.getTrad("settings.maxAttempts.placeholder") })
1078
- }
1079
- ),
1080
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { padding: 2, background: "warning50", style: { borderRadius: "4px", marginTop: "8px" }, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "warning700", style: { fontSize: "11px" }, children: formatMessage({ id: index.getTrad("settings.maxAttempts.warning") }) }) })
1081
- ] }) }) }),
1082
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "sigma", fontWeight: "bold", style: { marginBottom: "16px", display: "block", color: "var(--colors-neutral700)" }, children: formatMessage({ id: index.getTrad("settings.context.title") }) }),
1083
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Grid.Root, { gap: 6, style: { marginBottom: "32px" }, children: [
1084
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 6, s: 12, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { children: [
1085
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", fontWeight: "bold", style: { marginBottom: "8px", display: "block" }, children: formatMessage({ id: index.getTrad("settings.context.whitelist.label") }) }),
1086
- /* @__PURE__ */ jsxRuntime.jsx(
1087
- designSystem.TextInput,
1088
- {
1089
- hint: formatMessage({ id: index.getTrad("settings.context.whitelist.hint") }),
1090
- value: typeof settings.context_whitelist === "string" ? settings.context_whitelist : (settings.context_whitelist || []).join(", "),
1091
- onChange: (e) => {
1092
- updateSetting("context_whitelist", e.target.value);
1093
- },
1094
- onBlur: (e) => {
1095
- const value = typeof settings.context_whitelist === "string" ? settings.context_whitelist : "";
1096
- const list = value ? value.split(",").map((s) => s.trim()).filter(Boolean) : [];
1097
- updateSetting("context_whitelist", list);
1098
- },
1099
- placeholder: formatMessage({ id: index.getTrad("settings.context.whitelist.placeholder") })
1100
- }
1101
- ),
1102
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { padding: 2, background: "primary50", style: { borderRadius: "4px", marginTop: "8px" }, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "primary700", style: { fontSize: "11px" }, children: formatMessage({ id: index.getTrad("settings.context.whitelist.info") }) }) })
1103
- ] }) }),
1104
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 6, s: 12, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { children: [
1105
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", fontWeight: "bold", style: { marginBottom: "8px", display: "block" }, children: formatMessage({ id: index.getTrad("settings.context.blacklist.label") }) }),
1106
- /* @__PURE__ */ jsxRuntime.jsx(
1107
- designSystem.TextInput,
1108
- {
1109
- hint: formatMessage({ id: index.getTrad("settings.context.blacklist.hint") }),
1110
- value: typeof settings.context_blacklist === "string" ? settings.context_blacklist : (settings.context_blacklist || []).join(", "),
1111
- onChange: (e) => {
1112
- updateSetting("context_blacklist", e.target.value);
1113
- },
1114
- onBlur: (e) => {
1115
- const value = typeof settings.context_blacklist === "string" ? settings.context_blacklist : "";
1116
- const list = value ? value.split(",").map((s) => s.trim()).filter(Boolean) : [];
1117
- updateSetting("context_blacklist", list);
1118
- },
1119
- placeholder: formatMessage({ id: index.getTrad("settings.context.blacklist.placeholder") })
1120
- }
1121
- ),
1122
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { padding: 2, background: "danger50", style: { borderRadius: "4px", marginTop: "8px" }, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "danger700", style: { fontSize: "11px" }, children: formatMessage({ id: index.getTrad("settings.context.blacklist.info") }) }) })
1123
- ] }) })
1124
- ] }),
1125
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "sigma", fontWeight: "bold", style: { marginBottom: "16px", display: "block", color: "var(--colors-neutral700)" }, children: formatMessage({ id: index.getTrad("settings.api.title") }) }),
1126
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Grid.Root, { gap: 6, children: [
1127
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 12, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { children: [
1128
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", fontWeight: "bold", style: { marginBottom: "8px", display: "block" }, children: formatMessage({ id: index.getTrad("settings.loginPath.label") }) }),
1129
- /* @__PURE__ */ jsxRuntime.jsx(
1130
- designSystem.TextInput,
1131
- {
1132
- hint: formatMessage({ id: index.getTrad("settings.loginPath.hint") }),
1133
- value: settings.login_path,
1134
- onChange: (e) => updateSetting("login_path", e.target.value),
1135
- placeholder: formatMessage({ id: index.getTrad("settings.loginPath.placeholder") })
1136
- }
1137
- ),
1138
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { padding: 2, background: "neutral100", style: { borderRadius: "4px", marginTop: "8px", border: "1px solid rgba(128, 128, 128, 0.2)" }, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "neutral700", style: { fontSize: "11px", fontFamily: "monospace" }, children: formatMessage({ id: index.getTrad("settings.loginPath.fullPath") }, { path: settings.login_path }) }) })
1139
- ] }) }),
1140
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 12, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { children: [
1141
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", fontWeight: "bold", style: { marginBottom: "8px", display: "block" }, children: formatMessage({ id: index.getTrad("settings.confirmationUrl.label") }) }),
1142
- /* @__PURE__ */ jsxRuntime.jsx(
1143
- designSystem.TextInput,
1144
- {
1145
- hint: formatMessage({ id: index.getTrad("settings.confirmationUrl.hint") }),
1146
- value: settings.confirmationUrl,
1147
- onChange: (e) => updateSetting("confirmationUrl", e.target.value),
1148
- placeholder: formatMessage({ id: index.getTrad("settings.confirmationUrl.placeholder") })
1149
- }
1150
- ),
1151
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { padding: 2, background: "primary50", style: { borderRadius: "4px", marginTop: "8px" }, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "primary700", style: { fontSize: "11px" }, children: formatMessage({ id: index.getTrad("settings.confirmationUrl.example") }, { url: settings.confirmationUrl || "https://yourapp.com" }) }) })
1152
- ] }) }),
1153
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 12, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { children: [
1154
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", fontWeight: "bold", style: { marginBottom: "8px", display: "block" }, children: formatMessage({ id: index.getTrad("settings.callbackUrl.label") }) }),
1155
- /* @__PURE__ */ jsxRuntime.jsx(
1156
- designSystem.TextInput,
1157
- {
1158
- hint: formatMessage({ id: index.getTrad("settings.callbackUrl.hint") }),
1159
- value: settings.callback_url,
1160
- onChange: (e) => updateSetting("callback_url", e.target.value),
1161
- placeholder: formatMessage({ id: index.getTrad("settings.callbackUrl.placeholder") })
1162
- }
1163
- ),
1164
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "neutral600", style: { fontSize: "11px", marginTop: "8px" }, children: formatMessage({ id: index.getTrad("settings.callbackUrl.note") }) })
1165
- ] }) }),
1166
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Grid.Item, { col: 12, children: [
1167
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Divider, { style: { margin: "16px 0" } }),
1168
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "delta", fontWeight: "bold", style: { marginBottom: "16px", display: "block" }, children: "Frontend URL (for SPA/Mobile Apps)" })
1169
- ] }),
1170
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 6, s: 12, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { children: [
1171
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", fontWeight: "bold", style: { marginBottom: "8px", display: "block" }, children: "Frontend Base URL" }),
1172
- /* @__PURE__ */ jsxRuntime.jsx(
1173
- designSystem.TextInput,
1174
- {
1175
- value: settings.frontend_url || "",
1176
- onChange: (e) => updateSetting("frontend_url", e.target.value),
1177
- placeholder: "https://myapp.com"
1178
- }
1179
- ),
1180
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "neutral600", style: { fontSize: "11px", marginTop: "8px" }, children: "Base URL deiner Frontend-App (React, Vue, etc.). Wenn leer, wird confirmationUrl verwendet." })
1181
- ] }) }),
1182
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 6, s: 12, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { children: [
1183
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", fontWeight: "bold", style: { marginBottom: "8px", display: "block" }, children: "Login Path" }),
1184
- /* @__PURE__ */ jsxRuntime.jsx(
1185
- designSystem.TextInput,
1186
- {
1187
- value: settings.frontend_login_path || "/auth/magic-link",
1188
- onChange: (e) => updateSetting("frontend_login_path", e.target.value),
1189
- placeholder: "/auth/magic-link"
1190
- }
1191
- ),
1192
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "neutral600", style: { fontSize: "11px", marginTop: "8px" }, children: "Pfad der an die Frontend URL angehaengt wird." })
1193
- ] }) }),
1194
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 12, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { padding: 3, background: "primary50", style: { borderRadius: "8px", marginTop: "8px" }, children: [
1195
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", fontWeight: "bold", style: { display: "block", marginBottom: "4px" }, children: "Resultierende Magic Link URL:" }),
1196
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "primary700", style: { fontFamily: "monospace", fontSize: "12px" }, children: settings.frontend_url ? `${settings.frontend_url.replace(/\/$/, "")}${settings.frontend_login_path || "/auth/magic-link"}?loginToken=ABC123` : `${settings.confirmationUrl || "http://localhost:1337/api/magic-link/login"}?loginToken=ABC123` })
1197
- ] }) })
1198
- ] })
1199
- ] }) })
1200
- ] }),
1201
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Accordion.Item, { value: "whatsapp", children: [
1202
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Accordion.Header, { children: /* @__PURE__ */ jsxRuntime.jsx(
1203
- designSystem.Accordion.Trigger,
1204
- {
1205
- icon: icons.Lightning,
1206
- description: "WhatsApp-Nachricht anpassen und Delivery konfigurieren",
1207
- children: "WhatsApp Einstellungen"
1208
- }
1209
- ) }),
1210
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Accordion.Content, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { padding: 6, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Grid.Root, { gap: 4, children: [
1211
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 12, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { background: "success50", padding: 4, style: { borderRadius: "8px", border: "2px solid rgba(34, 197, 94, 0.4)", marginBottom: "16px" }, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 3, alignItems: "flex-start", children: [
1212
- /* @__PURE__ */ jsxRuntime.jsx(icons.Lightning, { style: { color: "#22C55E", width: "24px", height: "24px", flexShrink: 0, marginTop: "2px" } }),
1213
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { children: [
1214
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "delta", fontWeight: "bold", style: { display: "block", marginBottom: "4px" }, children: "WhatsApp Magic Link Delivery" }),
1215
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "neutral600", children: "Sende Magic Links kostenlos via WhatsApp anstatt per Email. Die Nachricht kann hier angepasst werden." })
1216
- ] })
1217
- ] }) }) }),
1218
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 6, s: 12, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { children: [
1219
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", fontWeight: "bold", style: { marginBottom: "8px", display: "block" }, children: "App Name (in WhatsApp Nachricht)" }),
1220
- /* @__PURE__ */ jsxRuntime.jsx(
1221
- designSystem.TextInput,
1222
- {
1223
- value: settings.whatsapp_app_name || "Magic Link",
1224
- onChange: (e) => updateSetting("whatsapp_app_name", e.target.value),
1225
- placeholder: "Magic Link"
1226
- }
1227
- ),
1228
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "neutral600", style: { fontSize: "11px", marginTop: "8px" }, children: "Wird in der WhatsApp-Nachricht als App-Name angezeigt." })
1229
- ] }) }),
1230
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 6, s: 12, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { direction: "column", gap: 3, children: /* @__PURE__ */ jsxRuntime.jsx(ToggleCard, { $active: settings.whatsapp_debug, $statusLabel: settings.whatsapp_debug ? "DEBUG" : "OFF", onClick: () => updateSetting("whatsapp_debug", !settings.whatsapp_debug), children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 3, alignItems: "center", children: [
1231
- /* @__PURE__ */ jsxRuntime.jsx(GreenToggle, { $isActive: settings.whatsapp_debug, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Switch, { checked: settings.whatsapp_debug, onCheckedChange: (checked) => updateSetting("whatsapp_debug", checked) }) }),
1232
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { children: [
1233
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "omega", fontWeight: "bold", children: "Debug Mode" }),
1234
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "neutral600", style: { fontSize: "11px" }, children: "Aktiviert ausfuehrliche WhatsApp-Logs" })
1235
- ] })
1236
- ] }) }) }) }),
1237
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 12, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { children: [
1238
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", fontWeight: "bold", style: { marginBottom: "8px", display: "block" }, children: "WhatsApp Nachricht Template" }),
1239
- /* @__PURE__ */ jsxRuntime.jsx(
1240
- designSystem.Textarea,
1241
- {
1242
- value: settings.whatsapp_message_template || "",
1243
- onChange: (e) => updateSetting("whatsapp_message_template", e.target.value),
1244
- style: { minHeight: "200px", fontFamily: "monospace", fontSize: "13px" }
1245
- }
1246
- ),
1247
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { padding: 3, background: "neutral100", style: { borderRadius: "8px", marginTop: "12px" }, children: [
1248
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", fontWeight: "bold", style: { display: "block", marginBottom: "8px" }, children: "Verfuegbare Platzhalter:" }),
1249
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, wrap: "wrap", children: [
1250
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Badge, { backgroundColor: "primary100", textColor: "primary700", children: "{{appName}}" }),
1251
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Badge, { backgroundColor: "primary100", textColor: "primary700", children: "{{link}}" }),
1252
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Badge, { backgroundColor: "primary100", textColor: "primary700", children: "{{expiry}}" })
1253
- ] }),
1254
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "neutral600", style: { fontSize: "11px", marginTop: "8px", display: "block" }, children: "*text* = Fett, _text_ = Kursiv (WhatsApp Formatierung)" })
1255
- ] })
1256
- ] }) }),
1257
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 12, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { padding: 4, background: "neutral50", style: { borderRadius: "8px", border: "1px solid rgba(128, 128, 128, 0.2)" }, children: [
1258
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", fontWeight: "bold", style: { display: "block", marginBottom: "8px" }, children: "Vorschau:" }),
1259
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { padding: 3, background: "neutral0", style: { borderRadius: "8px", whiteSpace: "pre-wrap", fontFamily: "system-ui", fontSize: "14px", lineHeight: "1.5", border: "1px solid rgba(128, 128, 128, 0.2)" }, children: (settings.whatsapp_message_template || "").replace(/\{\{appName\}\}/g, settings.whatsapp_app_name || "Magic Link").replace(/\{\{link\}\}/g, settings.frontend_url ? `${settings.frontend_url.replace(/\/$/, "")}${settings.frontend_login_path || "/auth/magic-link"}?loginToken=ABC123` : `${settings.confirmationUrl || "http://localhost:1337"}?loginToken=ABC123`).replace(/\{\{expiry\}\}/g, "1 Stunde") })
1260
- ] }) })
1261
- ] }) }) })
1262
- ] }),
1263
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Accordion.Item, { value: "auth", children: [
1264
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Accordion.Header, { children: /* @__PURE__ */ jsxRuntime.jsx(
1265
- designSystem.Accordion.Trigger,
1266
- {
1267
- icon: icons.Shield,
1268
- description: formatMessage({ id: index.getTrad("settings.section.auth.description") }),
1269
- children: formatMessage({ id: index.getTrad("settings.section.auth") })
1270
- }
1271
- ) }),
1272
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Accordion.Content, { children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { padding: 6, children: [
1273
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { background: "neutral100", padding: 5, style: { borderRadius: theme.borderRadius.md, marginBottom: "24px" }, children: [
1274
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "sigma", fontWeight: "bold", style: { marginBottom: "8px", display: "block", textAlign: "center", color: "var(--colors-neutral700)" }, children: formatMessage({ id: index.getTrad("settings.auth.options.title") }) }),
1275
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "neutral600", style: { marginBottom: "20px", display: "block", textAlign: "center", fontSize: "12px" }, children: formatMessage({ id: index.getTrad("settings.auth.options.subtitle") }) }),
1276
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Grid.Root, { gap: 4, children: [
1277
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 3, s: 6, xs: 12, children: /* @__PURE__ */ jsxRuntime.jsx(ToggleCard, { $active: settings.verify_email, $statusLabel: settings.verify_email ? statusActive : statusInactive, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", gap: 3, children: [
1278
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "center", alignItems: "center", style: { marginBottom: "8px" }, children: /* @__PURE__ */ jsxRuntime.jsx(
1279
- designSystem.Switch,
1280
- {
1281
- checked: settings.verify_email,
1282
- onCheckedChange: (checked) => updateSetting("verify_email", checked),
1283
- size: "L"
1284
- }
1285
- ) }),
1286
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { children: [
1287
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", fontWeight: "bold", style: { fontSize: "14px", marginBottom: "6px", display: "block", textAlign: "center" }, children: formatMessage({ id: index.getTrad("settings.auth.verifyEmail.title") }) }),
1288
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "omega", textColor: "neutral600", style: { fontSize: "12px", lineHeight: "1.4", textAlign: "center" }, children: formatMessage({ id: index.getTrad("settings.auth.verifyEmail.description") }) })
1289
- ] })
1290
- ] }) }) }),
1291
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 3, s: 6, xs: 12, children: /* @__PURE__ */ jsxRuntime.jsx(ToggleCard, { $active: settings.welcome_email, $statusLabel: settings.welcome_email ? statusActive : statusInactive, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", gap: 3, children: [
1292
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "center", alignItems: "center", style: { marginBottom: "8px" }, children: /* @__PURE__ */ jsxRuntime.jsx(
1293
- designSystem.Switch,
1294
- {
1295
- checked: settings.welcome_email,
1296
- onCheckedChange: (checked) => updateSetting("welcome_email", checked),
1297
- size: "L"
1298
- }
1299
- ) }),
1300
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { children: [
1301
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", fontWeight: "bold", style: { fontSize: "14px", marginBottom: "6px", display: "block", textAlign: "center" }, children: formatMessage({ id: index.getTrad("settings.auth.welcomeEmail.title") }) }),
1302
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "omega", textColor: "neutral600", style: { fontSize: "12px", lineHeight: "1.4", textAlign: "center" }, children: formatMessage({ id: index.getTrad("settings.auth.welcomeEmail.description") }) })
1303
- ] })
1304
- ] }) }) }),
1305
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 3, s: 6, xs: 12, children: /* @__PURE__ */ jsxRuntime.jsx(ToggleCard, { $active: settings.use_jwt_token, $statusLabel: settings.use_jwt_token ? statusActive : statusInactive, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", gap: 3, children: [
1306
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "center", alignItems: "center", style: { marginBottom: "8px" }, children: /* @__PURE__ */ jsxRuntime.jsx(
1307
- designSystem.Switch,
1308
- {
1309
- checked: settings.use_jwt_token,
1310
- onCheckedChange: (checked) => updateSetting("use_jwt_token", checked),
1311
- size: "L"
1312
- }
1313
- ) }),
1314
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { children: [
1315
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", fontWeight: "bold", style: { fontSize: "14px", marginBottom: "6px", display: "block", textAlign: "center" }, children: formatMessage({ id: index.getTrad("settings.auth.useJwt.title") }) }),
1316
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "omega", textColor: "neutral600", style: { fontSize: "12px", lineHeight: "1.4", textAlign: "center" }, children: formatMessage({ id: index.getTrad("settings.auth.useJwt.description") }) })
1317
- ] })
1318
- ] }) }) }),
1319
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 3, s: 6, xs: 12, children: /* @__PURE__ */ jsxRuntime.jsx(ToggleCard, { $active: settings.store_login_info, $statusLabel: settings.store_login_info ? statusActive : statusInactive, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", gap: 3, children: [
1320
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "center", alignItems: "center", style: { marginBottom: "8px" }, children: /* @__PURE__ */ jsxRuntime.jsx(
1321
- designSystem.Switch,
1322
- {
1323
- checked: settings.store_login_info,
1324
- onCheckedChange: (checked) => updateSetting("store_login_info", checked),
1325
- size: "L"
1326
- }
1327
- ) }),
1328
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { children: [
1329
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", fontWeight: "bold", style: { fontSize: "14px", marginBottom: "6px", display: "block", textAlign: "center" }, children: formatMessage({ id: index.getTrad("settings.auth.storeLoginInfo.title") }) }),
1330
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "omega", textColor: "neutral600", style: { fontSize: "12px", lineHeight: "1.4", textAlign: "center" }, children: formatMessage({ id: index.getTrad("settings.auth.storeLoginInfo.description") }) })
1331
- ] })
1332
- ] }) }) })
1333
- ] })
1334
- ] }),
1335
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "sigma", fontWeight: "bold", style: { marginBottom: "16px", display: "block", color: "var(--colors-neutral700)" }, children: formatMessage({ id: index.getTrad("settings.auth.management.title") }) }),
1336
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Grid.Root, { gap: 6, children: [
1337
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 12, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { children: [
1338
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", fontWeight: "bold", style: { marginBottom: "8px", display: "block" }, children: formatMessage({ id: index.getTrad("settings.auth.strategy.label") }) }),
1339
- /* @__PURE__ */ jsxRuntime.jsxs(
1340
- designSystem.SingleSelect,
1341
- {
1342
- value: settings.user_creation_strategy,
1343
- onChange: (val) => updateSetting("user_creation_strategy", val),
1344
- children: [
1345
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "email", children: formatMessage({ id: index.getTrad("settings.auth.strategy.email") }) }),
1346
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "emailUsername", children: formatMessage({ id: index.getTrad("settings.auth.strategy.emailUsername") }) }),
1347
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "manual", children: formatMessage({ id: index.getTrad("settings.auth.strategy.manual") }) })
1348
- ]
1349
- }
1350
- ),
1351
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { padding: 2, background: "neutral100", style: { borderRadius: "4px", marginTop: "8px", border: "1px solid rgba(128, 128, 128, 0.2)" }, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "neutral700", style: { fontSize: "11px" }, children: formatMessage({ id: index.getTrad("settings.auth.strategy.current") }, {
1352
- strategy: settings.user_creation_strategy === "email" ? formatMessage({ id: index.getTrad("settings.auth.strategy.email") }) : settings.user_creation_strategy === "emailUsername" ? formatMessage({ id: index.getTrad("settings.auth.strategy.emailUsername") }) : formatMessage({ id: index.getTrad("settings.auth.strategy.manual") })
1353
- }) }) })
1354
- ] }) }),
1355
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 12, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { children: [
1356
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", fontWeight: "bold", style: { marginBottom: "8px", display: "block" }, children: formatMessage({ id: index.getTrad("settings.auth.jwtExpiration.label") }) }),
1357
- /* @__PURE__ */ jsxRuntime.jsx(
1358
- designSystem.TextInput,
1359
- {
1360
- hint: formatMessage({ id: index.getTrad("settings.auth.jwtExpiration.hint") }),
1361
- value: settings.jwt_token_expires_in,
1362
- onChange: (e) => updateSetting("jwt_token_expires_in", e.target.value),
1363
- placeholder: formatMessage({ id: index.getTrad("settings.auth.jwtExpiration.placeholder") })
1364
- }
1365
- ),
1366
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { padding: 2, background: "success50", style: { borderRadius: "4px", marginTop: "8px" }, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "success700", style: { fontSize: "11px" }, children: formatMessage({ id: index.getTrad("settings.auth.jwtExpiration.examples") }) }) })
1367
- ] }) })
1368
- ] })
1369
- ] }) })
1370
- ] }),
1371
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Accordion.Item, { value: "email", children: [
1372
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Accordion.Header, { children: /* @__PURE__ */ jsxRuntime.jsx(
1373
- designSystem.Accordion.Trigger,
1374
- {
1375
- icon: icons.Mail,
1376
- description: formatMessage({ id: index.getTrad("settings.section.email.description") }),
1377
- children: formatMessage({ id: index.getTrad("settings.section.email") })
1378
- }
1379
- ) }),
1380
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Accordion.Content, { children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { padding: 6, children: [
1381
- !emailProviderConfigured && !magicMailInstalled && /* @__PURE__ */ jsxRuntime.jsx(
1382
- designSystem.Box,
1383
- {
1384
- background: "danger100",
1385
- padding: 5,
1386
- style: {
1387
- borderRadius: theme.borderRadius.md,
1388
- marginBottom: "32px",
1389
- border: "2px solid rgba(239, 68, 68, 0.4)",
1390
- boxShadow: "0 4px 12px rgba(220, 38, 38, 0.15)"
1391
- },
1392
- children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", gap: 3, children: [
1393
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { alignItems: "center", gap: 2, children: [
1394
- /* @__PURE__ */ jsxRuntime.jsx(icons.Mail, { style: { color: "var(--colors-danger600, #DC2626)", width: "24px", height: "24px" } }),
1395
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "delta", fontWeight: "bold", style: { color: "var(--colors-danger600, #B91C1C)" }, children: "⚠️ No Email Provider Configured" })
1396
- ] }),
1397
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Typography, { variant: "pi", style: { fontSize: "13px", color: "var(--colors-danger600, #B91C1C)", lineHeight: "1.6" }, children: [
1398
- /* @__PURE__ */ jsxRuntime.jsx("strong", { children: "Magic Link cannot send emails!" }),
1399
- " You need to configure an email provider for the plugin to work."
1400
- ] }),
1401
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Divider, { style: { backgroundColor: "rgba(220, 38, 38, 0.3)" } }),
1402
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", fontWeight: "semiBold", style: { fontSize: "13px", color: "var(--colors-danger600, #991B1B)", marginBottom: "8px" }, children: "📋 Choose one of these options:" }),
1403
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { paddingLeft: 3, children: [
1404
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Typography, { variant: "pi", style: { fontSize: "12px", color: "var(--colors-danger600, #B91C1C)", lineHeight: "1.8" }, children: [
1405
- /* @__PURE__ */ jsxRuntime.jsx("strong", { children: "1. Install Nodemailer (Recommended)" }),
1406
- /* @__PURE__ */ jsxRuntime.jsx("br", {}),
1407
- /* @__PURE__ */ jsxRuntime.jsx("code", { style: {
1408
- backgroundColor: "rgba(255,255,255,0.8)",
1409
- padding: "2px 6px",
1410
- borderRadius: "4px",
1411
- fontFamily: "monospace",
1412
- fontSize: "11px"
1413
- }, children: "npm install @strapi/provider-email-nodemailer" }),
1414
- /* @__PURE__ */ jsxRuntime.jsx("br", {}),
1415
- "Then configure in ",
1416
- /* @__PURE__ */ jsxRuntime.jsx("code", { children: "config/plugins.js" })
1417
- ] }),
1418
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Typography, { variant: "pi", style: { fontSize: "12px", color: "var(--colors-danger600, #B91C1C)", lineHeight: "1.8", marginTop: "12px", display: "block" }, children: [
1419
- /* @__PURE__ */ jsxRuntime.jsx("strong", { children: "2. Install MagicMail Plugin" }),
1420
- /* @__PURE__ */ jsxRuntime.jsx("br", {}),
1421
- "Advanced email routing with OAuth2, multi-account support, and analytics"
1422
- ] }),
1423
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Typography, { variant: "pi", style: { fontSize: "12px", color: "var(--colors-danger600, #B91C1C)", lineHeight: "1.8", marginTop: "12px", display: "block" }, children: [
1424
- /* @__PURE__ */ jsxRuntime.jsx("strong", { children: "3. Use other providers" }),
1425
- /* @__PURE__ */ jsxRuntime.jsx("br", {}),
1426
- "SendGrid, Mailgun, Amazon SES, or any Strapi email provider"
1427
- ] })
1428
- ] })
1429
- ] })
1430
- }
1431
- ),
1432
- (emailProviderConfigured || magicMailInstalled) && /* @__PURE__ */ jsxRuntime.jsx(
1433
- designSystem.Box,
1434
- {
1435
- background: "success100",
1436
- padding: 4,
1437
- style: { borderRadius: theme.borderRadius.md, marginBottom: "24px", border: "2px solid rgba(34, 197, 94, 0.4)" },
1438
- children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { alignItems: "center", gap: 2, children: [
1439
- /* @__PURE__ */ jsxRuntime.jsx(icons.Check, { style: { color: "var(--colors-success600, #16A34A)" } }),
1440
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", fontWeight: "semiBold", style: { color: "var(--colors-success600, #15803D)" }, children: magicMailInstalled ? "✅ Email Provider: MagicMail (Advanced Routing)" : `✅ Email Provider: ${emailProviderName || "Configured"}` })
1441
- ] })
1442
- }
1443
- ),
1444
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "sigma", fontWeight: "bold", style: { marginBottom: "8px", display: "block", color: "var(--colors-neutral700)" }, children: formatMessage({ id: index.getTrad("settings.email.sender.title") }) }),
1445
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "neutral600", style: { marginBottom: "20px", display: "block", fontSize: "12px" }, children: formatMessage({ id: index.getTrad("settings.email.sender.subtitle") }) }),
1446
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Grid.Root, { gap: 6, style: { marginBottom: "32px" }, children: [
1447
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 4, s: 12, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { children: [
1448
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", fontWeight: "bold", style: { marginBottom: "8px", display: "block" }, children: formatMessage({ id: index.getTrad("settings.email.fromName.label") }) }),
1449
- /* @__PURE__ */ jsxRuntime.jsx(
1450
- designSystem.TextInput,
1451
- {
1452
- hint: formatMessage({ id: index.getTrad("settings.email.fromName.hint") }),
1453
- value: settings.from_name,
1454
- onChange: (e) => updateSetting("from_name", e.target.value),
1455
- placeholder: formatMessage({ id: index.getTrad("settings.email.fromName.placeholder") })
1456
- }
1457
- ),
1458
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "neutral600", style: { fontSize: "11px", marginTop: "6px" }, children: formatMessage({ id: index.getTrad("settings.email.fromName.example") }) })
1459
- ] }) }),
1460
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 4, s: 12, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { children: [
1461
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", fontWeight: "bold", style: { marginBottom: "8px", display: "block" }, children: formatMessage({ id: index.getTrad("settings.email.fromEmail.label") }) }),
1462
- /* @__PURE__ */ jsxRuntime.jsx(
1463
- designSystem.TextInput,
1464
- {
1465
- type: "email",
1466
- hint: formatMessage({ id: index.getTrad("settings.email.fromEmail.hint") }),
1467
- value: settings.from_email,
1468
- onChange: (e) => updateSetting("from_email", e.target.value),
1469
- placeholder: formatMessage({ id: index.getTrad("settings.email.fromEmail.placeholder") })
1470
- }
1471
- ),
1472
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "neutral600", style: { fontSize: "11px", marginTop: "6px" }, children: formatMessage({ id: index.getTrad("settings.email.fromEmail.note") }) })
1473
- ] }) }),
1474
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 4, s: 12, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { children: [
1475
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", fontWeight: "bold", style: { marginBottom: "8px", display: "block" }, children: formatMessage({ id: index.getTrad("settings.email.responseEmail.label") }) }),
1476
- /* @__PURE__ */ jsxRuntime.jsx(
1477
- designSystem.TextInput,
1478
- {
1479
- type: "email",
1480
- hint: formatMessage({ id: index.getTrad("settings.email.responseEmail.hint") }),
1481
- value: settings.response_email,
1482
- onChange: (e) => updateSetting("response_email", e.target.value),
1483
- placeholder: formatMessage({ id: index.getTrad("settings.email.responseEmail.placeholder") })
1484
- }
1485
- ),
1486
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "neutral600", style: { fontSize: "11px", marginTop: "6px" }, children: formatMessage({ id: index.getTrad("settings.email.responseEmail.note") }) })
1487
- ] }) }),
1488
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 12, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { children: [
1489
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", fontWeight: "bold", style: { marginBottom: "8px", display: "block" }, children: formatMessage({ id: index.getTrad("settings.email.subject.label") }) }),
1490
- /* @__PURE__ */ jsxRuntime.jsx(
1491
- designSystem.TextInput,
1492
- {
1493
- hint: formatMessage({ id: index.getTrad("settings.email.subject.hint") }),
1494
- value: settings.object,
1495
- onChange: (e) => updateSetting("object", e.target.value),
1496
- placeholder: formatMessage({ id: index.getTrad("settings.email.subject.placeholder") })
1497
- }
1498
- ),
1499
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "neutral600", style: { fontSize: "11px", marginTop: "6px" }, children: formatMessage({ id: index.getTrad("settings.email.subject.note") }) })
1500
- ] }) })
1501
- ] }),
1502
- emailDesignerInstalled && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1503
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Divider, { style: { marginBottom: "24px" } }),
1504
- /* @__PURE__ */ jsxRuntime.jsxs(
1505
- designSystem.Box,
1506
- {
1507
- padding: 5,
1508
- style: {
1509
- borderRadius: theme.borderRadius.lg,
1510
- border: "2px solid rgba(16, 185, 129, 0.4)",
1511
- marginBottom: "24px",
1512
- background: "rgba(16, 185, 129, 0.06)"
1513
- },
1514
- children: [
1515
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { alignItems: "center", gap: 3, style: { marginBottom: "12px" }, children: [
1516
- /* @__PURE__ */ jsxRuntime.jsx(icons.Check, { width: "24px", height: "24px", style: { color: "#10b981" } }),
1517
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "delta", fontWeight: "bold", textColor: "success600", children: "Email Designer Integration" }),
1518
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Badge, { style: { backgroundColor: "#10b981", color: "white" }, children: "Active" })
1519
- ] }),
1520
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "success600", style: { fontSize: "13px" }, children: "Use your beautiful Email Designer 5 templates for Magic Link emails!" })
1521
- ]
1522
- }
1523
- ),
1524
- /* @__PURE__ */ jsxRuntime.jsx(
1525
- designSystem.Box,
1526
- {
1527
- background: "neutral0",
1528
- padding: 5,
1529
- style: {
1530
- borderRadius: theme.borderRadius.lg,
1531
- border: "2px solid rgba(128, 128, 128, 0.2)",
1532
- marginBottom: "24px"
1533
- },
1534
- children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Grid.Root, { gap: 6, children: [
1535
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Grid.Item, { col: 12, children: [
1536
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { alignItems: "center", gap: 3, style: { marginBottom: "8px" }, children: [
1537
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", fontWeight: "bold", style: { fontSize: "15px" }, children: "Use Email Designer Template" }),
1538
- /* @__PURE__ */ jsxRuntime.jsx(GreenToggle, { $isActive: settings.use_email_designer || false, children: /* @__PURE__ */ jsxRuntime.jsx(
1539
- designSystem.Switch,
1540
- {
1541
- checked: settings.use_email_designer || false,
1542
- onCheckedChange: (checked) => updateSetting("use_email_designer", checked)
1543
- }
1544
- ) })
1545
- ] }),
1546
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "neutral600", style: { fontSize: "12px" }, children: "Enable to use a professionally designed template from Email Designer 5" })
1547
- ] }),
1548
- settings.use_email_designer && /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Grid.Item, { col: 12, children: [
1549
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Divider, { style: { marginBottom: "16px", marginTop: "8px" } }),
1550
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", fontWeight: "bold", style: { marginBottom: "12px", display: "block", fontSize: "14px" }, children: "📋 Select Your Template" }),
1551
- /* @__PURE__ */ jsxRuntime.jsx(
1552
- designSystem.Box,
1553
- {
1554
- padding: 4,
1555
- background: "primary50",
1556
- style: {
1557
- borderRadius: "8px",
1558
- border: "2px solid rgba(14, 165, 233, 0.3)",
1559
- marginBottom: "16px"
1560
- },
1561
- children: /* @__PURE__ */ jsxRuntime.jsx(
1562
- designSystem.SingleSelect,
1563
- {
1564
- value: settings.email_designer_template_id,
1565
- onChange: (value) => {
1566
- updateSetting("email_designer_template_id", value);
1567
- toggleNotification({
1568
- type: "success",
1569
- message: "✅ Email Designer template selected!"
1570
- });
1571
- },
1572
- placeholder: "Choose a template from Email Designer...",
1573
- size: "L",
1574
- children: emailTemplates.map((template) => /* @__PURE__ */ jsxRuntime.jsxs(designSystem.SingleSelectOption, { value: template.id.toString(), children: [
1575
- "📄 ",
1576
- template.name || template.subject || `Template #${template.id}`
1577
- ] }, template.id))
1578
- }
1579
- )
1580
- }
1581
- ),
1582
- emailTemplates.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx(
1583
- designSystem.Box,
1584
- {
1585
- background: "success100",
1586
- padding: 3,
1587
- style: { borderRadius: "6px", border: "1px solid rgba(34, 197, 94, 0.4)" },
1588
- children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Typography, { variant: "pi", style: { fontSize: "12px", color: "var(--colors-success600, #15803D)" }, children: [
1589
- "✨ ",
1590
- emailTemplates.length,
1591
- " template",
1592
- emailTemplates.length !== 1 ? "s" : "",
1593
- " available"
1594
- ] })
1595
- }
1596
- ) : /* @__PURE__ */ jsxRuntime.jsx(
1597
- designSystem.Box,
1598
- {
1599
- background: "warning100",
1600
- padding: 3,
1601
- style: { borderRadius: "6px", border: "1px solid rgba(234, 179, 8, 0.4)" },
1602
- children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", style: { fontSize: "12px", color: "var(--colors-warning600, #A16207)" }, children: "⚠️ No templates found. Create one in Email Designer 5 first!" })
1603
- }
1604
- )
1605
- ] })
1606
- ] })
1607
- }
1608
- ),
1609
- /* @__PURE__ */ jsxRuntime.jsx(
1610
- designSystem.Box,
1611
- {
1612
- background: "warning100",
1613
- padding: 3,
1614
- style: { borderRadius: theme.borderRadius.md, marginBottom: "24px", border: "1px solid rgba(234, 179, 8, 0.4)" },
1615
- children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", style: { fontSize: "12px", color: "var(--colors-warning600, #A16207)" }, children: formatMessage({ id: index.getTrad("settings.email.designer.variables") }) })
1616
- }
1617
- )
1618
- ] }),
1619
- magicMailInstalled && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1620
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Divider, { style: { marginBottom: "24px" } }),
1621
- /* @__PURE__ */ jsxRuntime.jsxs(
1622
- designSystem.Box,
1623
- {
1624
- padding: 6,
1625
- style: {
1626
- borderRadius: "16px",
1627
- border: "none",
1628
- marginBottom: "24px",
1629
- background: "linear-gradient(135deg, #7C3AED 0%, #5B21B6 100%)",
1630
- boxShadow: "0 10px 25px rgba(124, 58, 237, 0.3)"
1631
- },
1632
- children: [
1633
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { alignItems: "center", gap: 3, style: { marginBottom: "12px" }, children: [
1634
- /* @__PURE__ */ jsxRuntime.jsx("div", { style: {
1635
- background: "rgba(255, 255, 255, 0.2)",
1636
- padding: "10px",
1637
- borderRadius: "12px",
1638
- display: "flex",
1639
- alignItems: "center",
1640
- justifyContent: "center"
1641
- }, children: /* @__PURE__ */ jsxRuntime.jsx(icons.Mail, { width: "24px", height: "24px", style: { color: "white" } }) }),
1642
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "delta", fontWeight: "bold", style: { color: "white", fontSize: "20px" }, children: "MagicMail Integration" }),
1643
- /* @__PURE__ */ jsxRuntime.jsx(
1644
- designSystem.Box,
1645
- {
1646
- style: {
1647
- backgroundColor: "rgba(255, 255, 255, 0.2)",
1648
- color: "#FFFFFF",
1649
- border: "1px solid rgba(255, 255, 255, 0.5)",
1650
- borderRadius: "999px",
1651
- padding: "4px 14px",
1652
- fontSize: "11px",
1653
- fontWeight: 700,
1654
- textTransform: "uppercase",
1655
- letterSpacing: "0.8px"
1656
- },
1657
- children: "Active"
1658
- }
1659
- )
1660
- ] }),
1661
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", style: { color: "rgba(255, 255, 255, 0.9)", fontSize: "14px", lineHeight: "1.6" }, children: "Advanced email routing with OAuth2 accounts, automatic failover, and comprehensive analytics" })
1662
- ]
1663
- }
1664
- ),
1665
- /* @__PURE__ */ jsxRuntime.jsx(
1666
- designSystem.Box,
1667
- {
1668
- background: "neutral0",
1669
- padding: 5,
1670
- style: {
1671
- borderRadius: theme.borderRadius.lg,
1672
- border: "2px solid rgba(128, 128, 128, 0.2)",
1673
- marginBottom: "24px"
1674
- },
1675
- children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Grid.Root, { gap: 6, children: [
1676
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 12, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { alignItems: "center", gap: 3, style: { marginBottom: "8px" }, children: [
1677
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", fontWeight: "bold", style: { fontSize: "15px" }, children: "Use MagicMail for Sending" }),
1678
- /* @__PURE__ */ jsxRuntime.jsx(GreenToggle, { $isActive: settings.use_magic_mail || false, children: /* @__PURE__ */ jsxRuntime.jsx(
1679
- designSystem.Switch,
1680
- {
1681
- checked: settings.use_magic_mail || false,
1682
- onCheckedChange: (checked) => updateSetting("use_magic_mail", checked)
1683
- }
1684
- ) })
1685
- ] }) }),
1686
- settings.use_magic_mail && /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Grid.Item, { col: 12, children: [
1687
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Divider, { style: { marginBottom: "20px", marginTop: "16px" } }),
1688
- /* @__PURE__ */ jsxRuntime.jsxs(
1689
- designSystem.Box,
1690
- {
1691
- padding: 5,
1692
- style: {
1693
- borderRadius: "12px",
1694
- border: "2px solid rgba(139, 92, 246, 0.3)",
1695
- background: "rgba(124, 58, 237, 0.06)",
1696
- marginBottom: "16px"
1697
- },
1698
- children: [
1699
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { alignItems: "center", gap: 2, style: { marginBottom: "16px" }, children: [
1700
- /* @__PURE__ */ jsxRuntime.jsx("div", { style: {
1701
- background: "linear-gradient(135deg, #7C3AED 0%, #5B21B6 100%)",
1702
- padding: "8px",
1703
- borderRadius: "8px",
1704
- display: "flex",
1705
- alignItems: "center",
1706
- justifyContent: "center"
1707
- }, children: /* @__PURE__ */ jsxRuntime.jsx(icons.Mail, { width: "16px", height: "16px", style: { color: "white" } }) }),
1708
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", fontWeight: "bold", style: { fontSize: "15px", color: "var(--colors-neutral800, #5B21B6)" }, children: "Select Email Template" })
1709
- ] }),
1710
- /* @__PURE__ */ jsxRuntime.jsx(
1711
- designSystem.SingleSelect,
1712
- {
1713
- value: settings.magic_mail_template_id,
1714
- onChange: (value) => {
1715
- updateSetting("magic_mail_template_id", value);
1716
- const selectedTemplate = magicMailTemplates.find((t) => t.id.toString() === value);
1717
- toggleNotification({
1718
- type: "success",
1719
- message: `✅ Template "${selectedTemplate?.name || "Selected"}" is now active!`
1720
- });
1721
- },
1722
- placeholder: "🔍 Choose a template from MagicMail...",
1723
- size: "L",
1724
- children: magicMailTemplates.map((template) => /* @__PURE__ */ jsxRuntime.jsxs(designSystem.SingleSelectOption, { value: template.id.toString(), children: [
1725
- "📧 ",
1726
- template.name || template.subject || `Template #${template.id}`
1727
- ] }, template.id))
1728
- }
1729
- ),
1730
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "omega", textColor: "neutral500", style: { fontSize: "12px", marginTop: "12px", display: "block" }, children: "💡 Templates are managed in your MagicMail settings" })
1731
- ]
1732
- }
1733
- )
1734
- ] })
1735
- ] })
1736
- }
1737
- ),
1738
- /* @__PURE__ */ jsxRuntime.jsx(
1739
- designSystem.Box,
1740
- {
1741
- background: "warning100",
1742
- padding: 3,
1743
- style: { borderRadius: theme.borderRadius.md, marginBottom: "24px", border: "1px solid rgba(234, 179, 8, 0.4)" },
1744
- children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, alignItems: "flex-start", children: [
1745
- /* @__PURE__ */ jsxRuntime.jsx(icons.CheckCircle, { width: "14px", height: "14px", style: { color: "var(--colors-warning600, #A16207)", flexShrink: 0, marginTop: "2px" } }),
1746
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Typography, { variant: "pi", style: { fontSize: "12px", color: "var(--colors-warning600, #A16207)" }, children: [
1747
- /* @__PURE__ */ jsxRuntime.jsx("strong", { children: "Tip:" }),
1748
- " MagicMail will use your configured email accounts and routing rules. Make sure you have at least one active account configured in MagicMail settings."
1749
- ] })
1750
- ] })
1751
- }
1752
- )
1753
- ] }),
1754
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Divider, { style: { marginBottom: "24px" } }),
1755
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Typography, { variant: "sigma", fontWeight: "bold", style: { marginBottom: "8px", display: "block", color: "var(--colors-neutral700)" }, children: [
1756
- formatMessage({ id: index.getTrad("settings.email.templates.title") }),
1757
- emailDesignerInstalled && settings.use_email_designer && /* @__PURE__ */ jsxRuntime.jsx(designSystem.Badge, { style: { marginLeft: "8px", backgroundColor: "rgba(128, 128, 128, 0.3)" }, children: formatMessage({ id: index.getTrad("settings.email.designer.fallbackBadge") }) })
1758
- ] }),
1759
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "neutral600", style: { marginBottom: "20px", display: "block", fontSize: "12px" }, children: emailDesignerInstalled && settings.use_email_designer ? formatMessage({ id: index.getTrad("settings.email.designer.fallbackDescription") }) : formatMessage({ id: index.getTrad("settings.email.templates.subtitle") }) }),
1760
- /* @__PURE__ */ jsxRuntime.jsxs(
1761
- designSystem.Box,
1762
- {
1763
- background: "primary100",
1764
- padding: 3,
1765
- style: { borderRadius: theme.borderRadius.md, marginBottom: "16px", border: "2px solid rgba(14, 165, 233, 0.3)" },
1766
- children: [
1767
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { justifyContent: "space-between", alignItems: "center", style: { marginBottom: "12px" }, children: [
1768
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Typography, { variant: "pi", fontWeight: "bold", style: { color: "var(--colors-primary600, #075985)", fontSize: "13px" }, children: [
1769
- "📋 ",
1770
- formatMessage({ id: index.getTrad("settings.email.placeholders.title") })
1771
- ] }),
1772
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "neutral600", style: { fontSize: "11px" }, children: formatMessage({ id: index.getTrad("settings.email.placeholders.clickToCopy") }) })
1773
- ] }),
1774
- /* @__PURE__ */ jsxRuntime.jsx(PlaceholderGrid, { children: placeholderList.map((placeholder) => /* @__PURE__ */ jsxRuntime.jsxs(
1775
- PlaceholderTile,
1776
- {
1777
- onClick: () => {
1778
- navigator.clipboard.writeText(placeholder.code);
1779
- toggleNotification({
1780
- type: "success",
1781
- message: formatMessage({ id: index.getTrad("settings.email.placeholders.copied") }, { placeholder: placeholder.code })
1782
- });
1783
- },
1784
- children: [
1785
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { alignItems: "center", justifyContent: "space-between", style: { marginBottom: "6px" }, children: [
1786
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", style: {
1787
- fontFamily: "monospace",
1788
- fontSize: "13px",
1789
- color: "var(--colors-primary600, #075985)",
1790
- fontWeight: "bold",
1791
- wordBreak: "break-all"
1792
- }, children: placeholder.code }),
1793
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Badge, { size: "S", style: { backgroundColor: "#0EA5E9", color: "white" }, children: formatMessage({ id: index.getTrad("settings.email.placeholders.copyLabel") }) })
1794
- ] }),
1795
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "omega", textColor: "neutral600", style: { fontSize: "11px", lineHeight: "1.4", flexGrow: 1 }, children: placeholder.desc }),
1796
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "omega", style: { fontSize: "9px", color: "#999", fontFamily: "monospace", marginTop: "6px" }, children: placeholder.example })
1797
- ]
1798
- },
1799
- placeholder.code
1800
- )) })
1801
- ]
1802
- }
1803
- ),
1804
- !settings.use_magic_mail && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1805
- /* @__PURE__ */ jsxRuntime.jsxs(
1806
- designSystem.Box,
1807
- {
1808
- background: "neutral0",
1809
- padding: 5,
1810
- style: { borderRadius: theme.borderRadius.lg, border: "2px solid rgba(14, 165, 233, 0.4)", marginBottom: "24px", background: "rgba(14, 165, 233, 0.06)" },
1811
- children: [
1812
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { alignItems: "center", gap: 2, style: { marginBottom: "12px" }, children: [
1813
- /* @__PURE__ */ jsxRuntime.jsx(icons.Mail, { width: "20px", height: "20px", style: { color: "#0EA5E9" } }),
1814
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "delta", fontWeight: "bold", style: { color: "var(--colors-primary600, #0369A1)" }, children: "Email Template Gallery" }),
1815
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Badge, { style: { backgroundColor: "#0EA5E9", color: "white" }, children: "New" })
1816
- ] }),
1817
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "neutral600", style: { marginBottom: "16px", fontSize: "13px" }, children: "Choose from our professionally designed templates. Click to instantly load a beautiful template!" }),
1818
- /* @__PURE__ */ jsxRuntime.jsx(
1819
- designSystem.Box,
1820
- {
1821
- style: {
1822
- display: "grid",
1823
- gridTemplateColumns: "repeat(auto-fit, minmax(190px, 1fr))",
1824
- gap: "12px"
1825
- },
1826
- children: getTemplateList().map((template) => {
1827
- const isActive = selectedTemplateKey === template.value;
1828
- return /* @__PURE__ */ jsxRuntime.jsxs(
1829
- designSystem.Box,
1830
- {
1831
- role: "button",
1832
- tabIndex: 0,
1833
- background: "neutral0",
1834
- style: {
1835
- borderRadius: "10px",
1836
- border: `2px solid ${isActive ? "rgba(2, 132, 199, 0.6)" : "rgba(128, 128, 128, 0.2)"}`,
1837
- cursor: "pointer",
1838
- transition: "all 0.2s",
1839
- padding: "16px",
1840
- minHeight: "110px",
1841
- boxShadow: isActive ? "0 8px 20px rgba(2, 132, 199, 0.25)" : "0 2px 6px rgba(15, 23, 42, 0.08)",
1842
- background: isActive ? "rgba(14, 165, 233, 0.08)" : "rgba(128, 128, 128, 0.04)",
1843
- outline: "none",
1844
- display: "flex",
1845
- flexDirection: "column",
1846
- justifyContent: "space-between"
1847
- },
1848
- onClick: () => {
1849
- const selectedTemplate = getTemplate(template.value);
1850
- setSelectedTemplateKey(template.value);
1851
- setSettings((prev) => ({
1852
- ...prev,
1853
- message_html: selectedTemplate.html,
1854
- message_text: selectedTemplate.text
1855
- }));
1856
- toggleNotification({
1857
- type: "success",
1858
- message: `✨ Template "${template.label}" loaded!`
1859
- });
1860
- },
1861
- onKeyDown: (e) => {
1862
- if (e.key === "Enter" || e.key === " ") {
1863
- e.preventDefault();
1864
- const selectedTemplate = getTemplate(template.value);
1865
- setSelectedTemplateKey(template.value);
1866
- setSettings((prev) => ({
1867
- ...prev,
1868
- message_html: selectedTemplate.html,
1869
- message_text: selectedTemplate.text
1870
- }));
1871
- toggleNotification({
1872
- type: "success",
1873
- message: `✨ Template "${template.label}" loaded!`
1874
- });
1875
- }
1876
- },
1877
- children: [
1878
- /* @__PURE__ */ jsxRuntime.jsx(
1879
- designSystem.Typography,
1880
- {
1881
- variant: "pi",
1882
- fontWeight: "bold",
1883
- style: {
1884
- marginBottom: "6px",
1885
- display: "block",
1886
- fontSize: "14px",
1887
- color: isActive ? "#0F172A" : "#111827"
1888
- },
1889
- children: template.label
1890
- }
1891
- ),
1892
- /* @__PURE__ */ jsxRuntime.jsx(
1893
- designSystem.Typography,
1894
- {
1895
- variant: "omega",
1896
- textColor: "neutral600",
1897
- style: { fontSize: "12px", lineHeight: "1.4" },
1898
- children: template.preview
1899
- }
1900
- )
1901
- ]
1902
- },
1903
- template.value
1904
- );
1905
- })
1906
- }
1907
- )
1908
- ]
1909
- }
1910
- ),
1911
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Grid.Root, { gap: 8, children: [
1912
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 12, children: /* @__PURE__ */ jsxRuntime.jsxs(
1913
- designSystem.Box,
1914
- {
1915
- background: "neutral0",
1916
- padding: 6,
1917
- style: { borderRadius: theme.borderRadius.lg, border: "2px solid rgba(128, 128, 128, 0.2)", width: "100%" },
1918
- children: [
1919
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { justifyContent: "space-between", alignItems: "center", style: { marginBottom: "16px" }, children: [
1920
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { alignItems: "center", gap: 2, children: [
1921
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "delta", fontWeight: "bold", style: { fontSize: "18px" }, children: formatMessage({ id: index.getTrad("settings.email.html.title") }) }),
1922
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Badge, { variant: "success", children: formatMessage({ id: index.getTrad("settings.email.html.badge") }) })
1923
- ] }),
1924
- /* @__PURE__ */ jsxRuntime.jsx(
1925
- designSystem.Button,
1926
- {
1927
- variant: "tertiary",
1928
- size: "S",
1929
- onClick: () => {
1930
- const defaultTemplate = `<!DOCTYPE html>
1931
- <html>
1932
- <head>
1933
- <meta charset="utf-8">
1934
- </head>
1935
- <body style="font-family: Arial, sans-serif; padding: 20px;">
1936
- <h2>Magic Link Login</h2>
1937
- <p>${formatMessage({ id: index.getTrad("settings.email.placeholders.url.description") })}</p>
1938
- <p><a href="<%= URL %>?loginToken=<%= CODE %>">${language === "de" ? "Jetzt anmelden" : "Sign in now"}</a></p>
1939
- <p style="color: #666; font-size: 14px;">${language === "de" ? "Der Link läuft in 1 Stunde ab." : "The link expires in 1 hour."}</p>
1940
- </body>
1941
- </html>`;
1942
- updateSetting("message_html", defaultTemplate);
1943
- toggleNotification({ type: "success", message: formatMessage({ id: index.getTrad("settings.email.html.defaultLoaded") }) });
1944
- },
1945
- children: formatMessage({ id: index.getTrad("settings.email.html.loadDefault") })
1946
- }
1947
- )
1948
- ] }),
1949
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "neutral600", style: { marginBottom: "16px", display: "block", fontSize: "14px" }, children: formatMessage({ id: index.getTrad("settings.email.html.description") }) }),
1950
- /* @__PURE__ */ jsxRuntime.jsxs(
1951
- designSystem.Box,
1952
- {
1953
- style: {
1954
- border: "2px solid rgba(128, 128, 128, 0.2)",
1955
- borderRadius: "6px",
1956
- overflow: "hidden",
1957
- background: "#1e1e1e",
1958
- height: "700px",
1959
- display: "flex",
1960
- flexDirection: "column"
1961
- },
1962
- children: [
1963
- /* @__PURE__ */ jsxRuntime.jsx(
1964
- designSystem.Box,
1965
- {
1966
- padding: 2,
1967
- background: "neutral700",
1968
- style: { borderBottom: "1px solid #333", flexShrink: 0 },
1969
- children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "omega", style: { color: "#888", fontSize: "11px", fontFamily: "monospace" }, children: formatMessage({ id: index.getTrad("settings.email.html.filename") }) })
1970
- }
1971
- ),
1972
- /* @__PURE__ */ jsxRuntime.jsx(
1973
- "textarea",
1974
- {
1975
- value: settings.message_html,
1976
- onChange: (e) => updateSetting("message_html", e.target.value),
1977
- style: {
1978
- fontFamily: 'Monaco, Consolas, "Courier New", monospace',
1979
- height: "100%",
1980
- fontSize: "14px",
1981
- lineHeight: "1.8",
1982
- background: "#1e1e1e",
1983
- color: "#d4d4d4",
1984
- border: "none",
1985
- padding: "20px",
1986
- resize: "none",
1987
- width: "100%",
1988
- boxSizing: "border-box",
1989
- outline: "none",
1990
- margin: 0,
1991
- display: "block",
1992
- overflow: "auto"
1993
- },
1994
- placeholder: formatMessage({ id: index.getTrad("settings.email.html.placeholder") })
1995
- }
1996
- )
1997
- ]
1998
- }
1999
- ),
2000
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, style: { marginTop: "12px" }, wrap: "wrap", children: [
2001
- /* @__PURE__ */ jsxRuntime.jsx(
2002
- designSystem.Button,
2003
- {
2004
- variant: "secondary",
2005
- size: "S",
2006
- onClick: () => {
2007
- navigator.clipboard.writeText(settings.message_html);
2008
- toggleNotification({ type: "success", message: formatMessage({ id: index.getTrad("settings.email.html.copy") }) + "!" });
2009
- },
2010
- children: formatMessage({ id: index.getTrad("settings.email.html.copy") })
2011
- }
2012
- ),
2013
- /* @__PURE__ */ jsxRuntime.jsx(
2014
- designSystem.Button,
2015
- {
2016
- variant: "tertiary",
2017
- size: "S",
2018
- onClick: () => {
2019
- const lines = settings.message_html.split("\n").length;
2020
- const chars = settings.message_html.length;
2021
- toggleNotification({
2022
- type: "info",
2023
- message: formatMessage({ id: index.getTrad("settings.email.html.stats") }, { lines, chars })
2024
- });
2025
- },
2026
- children: formatMessage({ id: index.getTrad("settings.email.html.info") })
2027
- }
2028
- )
2029
- ] })
2030
- ]
2031
- }
2032
- ) }),
2033
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 12, children: /* @__PURE__ */ jsxRuntime.jsxs(
2034
- designSystem.Box,
2035
- {
2036
- background: "neutral0",
2037
- padding: 6,
2038
- style: { borderRadius: theme.borderRadius.lg, border: "2px solid rgba(128, 128, 128, 0.2)", width: "100%" },
2039
- children: [
2040
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { justifyContent: "space-between", alignItems: "center", style: { marginBottom: "16px" }, children: [
2041
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { alignItems: "center", gap: 2, children: [
2042
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "delta", fontWeight: "bold", style: { fontSize: "18px" }, children: formatMessage({ id: index.getTrad("settings.email.text.title") }) }),
2043
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Badge, { variant: "secondary", children: formatMessage({ id: index.getTrad("settings.email.text.badge") }) })
2044
- ] }),
2045
- /* @__PURE__ */ jsxRuntime.jsx(
2046
- designSystem.Button,
2047
- {
2048
- variant: "tertiary",
2049
- size: "S",
2050
- onClick: () => {
2051
- const defaultTemplate = `${language === "de" ? "Hallo" : "Hello"},
2052
-
2053
- ${language === "de" ? "Klicke auf den folgenden Link, um dich anzumelden" : "Click the following link to sign in"}:
2054
-
2055
- <%= URL %>?loginToken=<%= CODE %>
2056
-
2057
- ${language === "de" ? "Der Link läuft in 1 Stunde ab." : "The link expires in 1 hour."}`;
2058
- updateSetting("message_text", defaultTemplate);
2059
- toggleNotification({ type: "success", message: formatMessage({ id: index.getTrad("settings.email.text.defaultLoaded") }) });
2060
- },
2061
- children: formatMessage({ id: index.getTrad("settings.email.text.loadDefault") })
2062
- }
2063
- )
2064
- ] }),
2065
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "neutral600", style: { marginBottom: "16px", display: "block", fontSize: "14px" }, children: formatMessage({ id: index.getTrad("settings.email.text.description") }) }),
2066
- /* @__PURE__ */ jsxRuntime.jsxs(
2067
- designSystem.Box,
2068
- {
2069
- style: {
2070
- border: "2px solid rgba(128, 128, 128, 0.2)",
2071
- borderRadius: "6px",
2072
- overflow: "hidden",
2073
- background: "var(--colors-neutral100, #f5f5f5)",
2074
- height: "500px",
2075
- display: "flex",
2076
- flexDirection: "column"
2077
- },
2078
- children: [
2079
- /* @__PURE__ */ jsxRuntime.jsx(
2080
- designSystem.Box,
2081
- {
2082
- padding: 2,
2083
- background: "neutral200",
2084
- style: { borderBottom: "1px solid rgba(128, 128, 128, 0.2)", flexShrink: 0 },
2085
- children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "omega", style: { color: "#666", fontSize: "11px", fontFamily: "monospace" }, children: formatMessage({ id: index.getTrad("settings.email.text.filename") }) })
2086
- }
2087
- ),
2088
- /* @__PURE__ */ jsxRuntime.jsx(
2089
- "textarea",
2090
- {
2091
- value: settings.message_text,
2092
- onChange: (e) => updateSetting("message_text", e.target.value),
2093
- style: {
2094
- fontFamily: 'Monaco, Consolas, "Courier New", monospace',
2095
- height: "100%",
2096
- fontSize: "14px",
2097
- lineHeight: "1.8",
2098
- background: "var(--colors-neutral100, #f5f5f5)",
2099
- color: "var(--colors-neutral800, #1f2937)",
2100
- border: "none",
2101
- padding: "20px",
2102
- resize: "none",
2103
- width: "100%",
2104
- boxSizing: "border-box",
2105
- outline: "none",
2106
- margin: 0,
2107
- display: "block",
2108
- overflow: "auto"
2109
- },
2110
- placeholder: formatMessage({ id: index.getTrad("settings.email.text.placeholder") })
2111
- }
2112
- )
2113
- ]
2114
- }
2115
- ),
2116
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { gap: 2, style: { marginTop: "12px" }, wrap: "wrap", children: /* @__PURE__ */ jsxRuntime.jsx(
2117
- designSystem.Button,
2118
- {
2119
- variant: "secondary",
2120
- size: "S",
2121
- onClick: () => {
2122
- navigator.clipboard.writeText(settings.message_text);
2123
- toggleNotification({ type: "success", message: formatMessage({ id: index.getTrad("settings.email.text.copy") }) + "!" });
2124
- },
2125
- children: formatMessage({ id: index.getTrad("settings.email.text.copy") })
2126
- }
2127
- ) })
2128
- ]
2129
- }
2130
- ) })
2131
- ] })
2132
- ] })
2133
- ] }) })
2134
- ] }),
2135
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Accordion.Item, { value: "advanced", children: [
2136
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Accordion.Header, { children: /* @__PURE__ */ jsxRuntime.jsx(
2137
- designSystem.Accordion.Trigger,
2138
- {
2139
- icon: icons.Code,
2140
- description: formatMessage({ id: index.getTrad("settings.section.advanced.description") }),
2141
- children: formatMessage({ id: index.getTrad("settings.section.advanced") })
2142
- }
2143
- ) }),
2144
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Accordion.Content, { children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { padding: 6, children: [
2145
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "sigma", fontWeight: "bold", style: { marginBottom: "8px", display: "block", color: "var(--colors-neutral700)" }, children: formatMessage({ id: index.getTrad("settings.advanced.title") }) }),
2146
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "neutral600", style: { marginBottom: "20px", display: "block", fontSize: "12px" }, children: formatMessage({ id: index.getTrad("settings.advanced.subtitle") }) }),
2147
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Root, { gap: 6, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 12, children: /* @__PURE__ */ jsxRuntime.jsx(ToggleCard, { $active: settings.allow_magic_links_on_public_registration, $statusLabel: settings.allow_magic_links_on_public_registration ? statusActive : statusInactive, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", gap: 3, children: [
2148
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "center", alignItems: "center", style: { marginBottom: "8px" }, children: /* @__PURE__ */ jsxRuntime.jsx(
2149
- designSystem.Switch,
2150
- {
2151
- checked: settings.allow_magic_links_on_public_registration,
2152
- onCheckedChange: (checked) => updateSetting("allow_magic_links_on_public_registration", checked),
2153
- size: "L"
2154
- }
2155
- ) }),
2156
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { children: [
2157
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", fontWeight: "bold", style: { fontSize: "14px", marginBottom: "6px", display: "block", textAlign: "center" }, children: formatMessage({ id: index.getTrad("settings.advanced.publicRegistration.title") }) }),
2158
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "omega", textColor: "neutral600", style: { fontSize: "12px", lineHeight: "1.4", textAlign: "center" }, children: formatMessage({ id: index.getTrad("settings.advanced.publicRegistration.description") }) })
2159
- ] })
2160
- ] }) }) }) })
2161
- ] }) })
2162
- ] }),
2163
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Accordion.Item, { value: "mfa", children: [
2164
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Accordion.Header, { children: /* @__PURE__ */ jsxRuntime.jsx(
2165
- designSystem.Accordion.Trigger,
2166
- {
2167
- icon: icons.Shield,
2168
- description: "Multi-Factor Authentication & Login Modes (Advanced)",
2169
- children: "MFA & Login Modes"
2170
- }
2171
- ) }),
2172
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Accordion.Content, { children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { padding: 6, children: [
2173
- /* @__PURE__ */ jsxRuntime.jsxs(
2174
- designSystem.Box,
2175
- {
2176
- background: "neutral100",
2177
- padding: 4,
2178
- style: {
2179
- borderRadius: theme.borderRadius.md,
2180
- marginBottom: "24px",
2181
- border: "2px solid rgba(128, 128, 128, 0.2)"
2182
- },
2183
- children: [
2184
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { alignItems: "center", gap: 2, style: { marginBottom: "8px" }, children: [
2185
- /* @__PURE__ */ jsxRuntime.jsx(icons.Shield, { width: "20px", height: "20px", style: { color: "#16A34A" } }),
2186
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", fontWeight: "bold", style: { fontSize: "14px" }, children: "All authentication modes are available" })
2187
- ] }),
2188
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Typography, { variant: "pi", textColor: "neutral600", style: { fontSize: "12px", lineHeight: "1.5" }, children: [
2189
- "💡 ",
2190
- /* @__PURE__ */ jsxRuntime.jsx("strong", { children: "Wähle deinen Login-Modus:" }),
2191
- " Magic Link (schnell), Email OTP (sicherer) oder TOTP Authenticator (höchste Sicherheit)"
2192
- ] })
2193
- ]
2194
- }
2195
- ),
2196
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "delta", fontWeight: "bold", style: { marginBottom: "16px", display: "block", color: "var(--colors-neutral800)" }, children: "Choose Authentication Mode" }),
2197
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Grid.Root, { gap: 4, style: { marginBottom: "24px" }, children: [
2198
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 4, s: 12, style: { display: "flex" }, children: /* @__PURE__ */ jsxRuntime.jsxs(
2199
- ToggleCard,
2200
- {
2201
- $active: !settings.otp_enabled && !settings.mfa_require_totp && !settings.totp_as_primary_auth || settings.otp_enabled && !["premium", "advanced", "enterprise"].includes(licenseInfo?.tier) || settings.mfa_require_totp && !["advanced", "enterprise"].includes(licenseInfo?.tier),
2202
- $statusLabel: !settings.otp_enabled && !settings.mfa_require_totp && !settings.totp_as_primary_auth || settings.otp_enabled && !["premium", "advanced", "enterprise"].includes(licenseInfo?.tier) || settings.mfa_require_totp && !["advanced", "enterprise"].includes(licenseInfo?.tier) ? "ACTIVE" : "OFF",
2203
- onClick: () => {
2204
- updateSetting("otp_enabled", false);
2205
- updateSetting("mfa_require_totp", false);
2206
- updateSetting("totp_as_primary_auth", false);
2207
- },
2208
- style: { cursor: "pointer", minHeight: "160px", width: "100%", display: "flex", flexDirection: "column", justifyContent: "space-between" },
2209
- children: [
2210
- /* @__PURE__ */ jsxRuntime.jsx(IconWrapper, { $bgColor: "rgba(2, 132, 199, 0.12)", $iconColor: "var(--colors-primary600, #0284C7)", children: /* @__PURE__ */ jsxRuntime.jsx(icons.Link, {}) }),
2211
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { children: [
2212
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", fontWeight: "bold", style: { marginBottom: "8px", display: "block" }, children: "Magic Link Only" }),
2213
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "neutral600", style: { fontSize: "11px", marginBottom: "12px" }, children: "Ein-Klick-Login per E-Mail. Schnell und benutzerfreundlich." }),
2214
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Typography, { variant: "pi", style: { fontSize: "10px", color: "var(--colors-primary600, #0284C7)", display: "block", marginBottom: "8px" }, children: [
2215
- "✓ Keine Passwörter",
2216
- /* @__PURE__ */ jsxRuntime.jsx("br", {}),
2217
- "✓ Schneller Login",
2218
- /* @__PURE__ */ jsxRuntime.jsx("br", {}),
2219
- "✓ Immer verfügbar"
2220
- ] })
2221
- ] }),
2222
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Badge, { style: {
2223
- marginTop: "8px",
2224
- backgroundColor: "var(--colors-primary600, #0284C7)",
2225
- color: "white",
2226
- fontWeight: "600",
2227
- fontSize: "11px",
2228
- padding: "4px 10px"
2229
- }, children: "Free" }),
2230
- !(!settings.otp_enabled && !settings.mfa_require_totp && !settings.totp_as_primary_auth) && /* @__PURE__ */ jsxRuntime.jsx(
2231
- designSystem.Button,
2232
- {
2233
- variant: "secondary",
2234
- startIcon: /* @__PURE__ */ jsxRuntime.jsx(icons.Check, {}),
2235
- onClick: async (e) => {
2236
- e.stopPropagation();
2237
- try {
2238
- const newSettings = {
2239
- ...settings,
2240
- otp_enabled: false,
2241
- mfa_require_totp: false,
2242
- totp_as_primary_auth: false
2243
- };
2244
- await put("/magic-link/settings", newSettings);
2245
- setSettings(newSettings);
2246
- toggleNotification({
2247
- type: "success",
2248
- message: "✅ Modus geändert: Magic Link Only"
2249
- });
2250
- } catch (error) {
2251
- console.error("Error saving mode:", error);
2252
- toggleNotification({
2253
- type: "danger",
2254
- message: "❌ Fehler beim Speichern"
2255
- });
2256
- }
2257
- },
2258
- style: { marginTop: "12px", width: "100%" },
2259
- children: "Aktivieren"
2260
- }
2261
- )
2262
- ]
2263
- }
2264
- ) }),
2265
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 4, s: 12, style: { display: "flex", position: "relative" }, children: /* @__PURE__ */ jsxRuntime.jsxs(
2266
- ToggleCard,
2267
- {
2268
- $active: settings.otp_enabled && !settings.mfa_require_totp && ["premium", "advanced", "enterprise"].includes(licenseInfo?.tier),
2269
- $statusLabel: settings.otp_enabled && !settings.mfa_require_totp && ["premium", "advanced", "enterprise"].includes(licenseInfo?.tier) ? "ACTIVE" : !["premium", "advanced", "enterprise"].includes(licenseInfo?.tier) ? "🔒 LOCKED" : "OFF",
2270
- onClick: () => {
2271
- updateSetting("otp_enabled", true);
2272
- updateSetting("mfa_require_totp", false);
2273
- updateSetting("totp_as_primary_auth", false);
2274
- },
2275
- style: {
2276
- cursor: !["premium", "advanced", "enterprise"].includes(licenseInfo?.tier) ? "not-allowed" : "pointer",
2277
- minHeight: "160px",
2278
- width: "100%",
2279
- display: "flex",
2280
- flexDirection: "column",
2281
- justifyContent: "space-between",
2282
- opacity: !["premium", "advanced", "enterprise"].includes(licenseInfo?.tier) ? 0.6 : 1,
2283
- position: "relative"
2284
- },
2285
- children: [
2286
- /* @__PURE__ */ jsxRuntime.jsx(IconWrapper, { $bgColor: "rgba(124, 58, 237, 0.1)", $iconColor: "#7C3AED", children: /* @__PURE__ */ jsxRuntime.jsx(icons.Mail, {}) }),
2287
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { children: [
2288
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", fontWeight: "bold", style: { marginBottom: "8px", display: "block" }, children: "Magic Link + Email OTP" }),
2289
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "neutral600", style: { fontSize: "11px", marginBottom: "12px" }, children: "Extra Sicherheit: 6-stelliger Code nach dem Klicken des Magic Links." }),
2290
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Typography, { variant: "pi", style: { fontSize: "10px", color: "#7C3AED", display: "block", marginBottom: "8px" }, children: [
2291
- "✓ Email-Code Verifikation",
2292
- /* @__PURE__ */ jsxRuntime.jsx("br", {}),
2293
- "✓ Konfigurierbare Code-Länge",
2294
- /* @__PURE__ */ jsxRuntime.jsx("br", {}),
2295
- "✓ Ablaufzeit einstellbar"
2296
- ] })
2297
- ] }),
2298
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Badge, { style: {
2299
- marginTop: "8px",
2300
- backgroundColor: "#5B21B6",
2301
- color: "#FAF5FF",
2302
- fontWeight: "600",
2303
- fontSize: "11px",
2304
- padding: "4px 10px",
2305
- border: "1px solid #4C1D95"
2306
- }, children: "Premium" }),
2307
- ["premium", "advanced", "enterprise"].includes(licenseInfo?.tier) && !(settings.otp_enabled && !settings.mfa_require_totp) && /* @__PURE__ */ jsxRuntime.jsx(
2308
- designSystem.Button,
2309
- {
2310
- variant: "secondary",
2311
- startIcon: /* @__PURE__ */ jsxRuntime.jsx(icons.Check, {}),
2312
- onClick: async (e) => {
2313
- e.stopPropagation();
2314
- try {
2315
- const newSettings = {
2316
- ...settings,
2317
- otp_enabled: true,
2318
- mfa_require_totp: false,
2319
- totp_as_primary_auth: false
2320
- };
2321
- await put("/magic-link/settings", newSettings);
2322
- setSettings(newSettings);
2323
- toggleNotification({
2324
- type: "success",
2325
- message: "✅ Modus geändert: Magic Link + Email OTP"
2326
- });
2327
- } catch (error) {
2328
- console.error("Error saving mode:", error);
2329
- toggleNotification({
2330
- type: "danger",
2331
- message: "❌ Fehler beim Speichern"
2332
- });
2333
- }
2334
- },
2335
- style: { marginTop: "12px", width: "100%" },
2336
- children: "Aktivieren"
2337
- }
2338
- )
2339
- ]
2340
- }
2341
- ) }),
2342
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 4, s: 12, style: { display: "flex", position: "relative" }, children: /* @__PURE__ */ jsxRuntime.jsxs(
2343
- ToggleCard,
2344
- {
2345
- $active: settings.mfa_require_totp && ["advanced", "enterprise"].includes(licenseInfo?.tier),
2346
- $statusLabel: settings.mfa_require_totp && ["advanced", "enterprise"].includes(licenseInfo?.tier) ? "ACTIVE" : !["advanced", "enterprise"].includes(licenseInfo?.tier) ? "🔒 LOCKED" : "OFF",
2347
- onClick: () => {
2348
- updateSetting("otp_enabled", false);
2349
- updateSetting("mfa_require_totp", true);
2350
- updateSetting("totp_as_primary_auth", false);
2351
- },
2352
- style: {
2353
- cursor: !["advanced", "enterprise"].includes(licenseInfo?.tier) ? "not-allowed" : "pointer",
2354
- minHeight: "160px",
2355
- width: "100%",
2356
- display: "flex",
2357
- flexDirection: "column",
2358
- justifyContent: "space-between",
2359
- opacity: !["advanced", "enterprise"].includes(licenseInfo?.tier) ? 0.6 : 1,
2360
- position: "relative"
2361
- },
2362
- children: [
2363
- /* @__PURE__ */ jsxRuntime.jsx(IconWrapper, { $bgColor: "rgba(217, 119, 6, 0.1)", $iconColor: "#D97706", children: /* @__PURE__ */ jsxRuntime.jsx(icons.Lock, {}) }),
2364
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { children: [
2365
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", fontWeight: "bold", style: { marginBottom: "8px", display: "block" }, children: "Magic Link + TOTP (MFA)" }),
2366
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "neutral600", style: { fontSize: "11px", marginBottom: "12px" }, children: "Höchste Sicherheit: Magic Link + Authenticator App (Google Authenticator, Authy)." }),
2367
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Typography, { variant: "pi", style: { fontSize: "10px", color: "#D97706", display: "block", marginBottom: "8px" }, children: [
2368
- "✓ TOTP Authenticator App",
2369
- /* @__PURE__ */ jsxRuntime.jsx("br", {}),
2370
- "✓ QR-Code Setup",
2371
- /* @__PURE__ */ jsxRuntime.jsx("br", {}),
2372
- "✓ 30s Code-Rotation"
2373
- ] })
2374
- ] }),
2375
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Badge, { style: {
2376
- marginTop: "8px",
2377
- backgroundColor: "#92400E",
2378
- color: "#FEFCE8",
2379
- fontWeight: "600",
2380
- fontSize: "11px",
2381
- padding: "4px 10px",
2382
- border: "1px solid #78350F"
2383
- }, children: "Advanced" }),
2384
- ["advanced", "enterprise"].includes(licenseInfo?.tier) && !settings.mfa_require_totp && /* @__PURE__ */ jsxRuntime.jsx(
2385
- designSystem.Button,
2386
- {
2387
- variant: "secondary",
2388
- startIcon: /* @__PURE__ */ jsxRuntime.jsx(icons.Check, {}),
2389
- onClick: async (e) => {
2390
- e.stopPropagation();
2391
- try {
2392
- const newSettings = {
2393
- ...settings,
2394
- otp_enabled: false,
2395
- mfa_require_totp: true,
2396
- totp_as_primary_auth: false
2397
- };
2398
- await put("/magic-link/settings", newSettings);
2399
- setSettings(newSettings);
2400
- toggleNotification({
2401
- type: "success",
2402
- message: "✅ Modus geändert: Magic Link + TOTP (MFA)"
2403
- });
2404
- } catch (error) {
2405
- console.error("Error saving mode:", error);
2406
- toggleNotification({
2407
- type: "danger",
2408
- message: "❌ Fehler beim Speichern"
2409
- });
2410
- }
2411
- },
2412
- style: { marginTop: "12px", width: "100%" },
2413
- children: "Aktivieren"
2414
- }
2415
- )
2416
- ]
2417
- }
2418
- ) })
2419
- ] }),
2420
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Divider, { style: { marginBottom: "24px" } }),
2421
- settings.otp_enabled && !settings.mfa_require_totp && ["premium", "advanced", "enterprise"].includes(licenseInfo?.tier) && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
2422
- /* @__PURE__ */ jsxRuntime.jsxs(
2423
- designSystem.Box,
2424
- {
2425
- background: "primary100",
2426
- padding: 4,
2427
- style: {
2428
- borderRadius: theme.borderRadius.md,
2429
- marginBottom: "24px",
2430
- border: "1px solid rgba(14, 165, 233, 0.3)"
2431
- },
2432
- children: [
2433
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { alignItems: "center", gap: 2, style: { marginBottom: "8px" }, children: [
2434
- /* @__PURE__ */ jsxRuntime.jsx(icons.Mail, { width: "18px", height: "18px", style: { color: "var(--colors-primary600, #075985)" } }),
2435
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", fontWeight: "bold", style: { color: "var(--colors-primary600, #075985)" }, children: "Email OTP Einstellungen" })
2436
- ] }),
2437
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", style: { fontSize: "12px", color: "var(--colors-primary600, #075985)", lineHeight: "1.6" }, children: "Konfiguriere hier, wie der OTP-Code per E-Mail verschickt wird. Benutzer erhalten nach dem Klick auf den Magic Link einen zusätzlichen Verifikationscode per E-Mail." })
2438
- ]
2439
- }
2440
- ),
2441
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "sigma", fontWeight: "bold", style: { marginBottom: "16px", display: "block", color: "var(--colors-neutral700)" }, children: "Code-Einstellungen" }),
2442
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Grid.Root, { gap: 6, style: { marginBottom: "24px" }, children: [
2443
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 6, s: 12, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { children: [
2444
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", fontWeight: "bold", style: { marginBottom: "8px", display: "block" }, children: "📧 Versandmethode" }),
2445
- /* @__PURE__ */ jsxRuntime.jsxs(
2446
- designSystem.SingleSelect,
2447
- {
2448
- value: settings.otp_type || "email",
2449
- onChange: (value) => updateSetting("otp_type", value),
2450
- placeholder: "Wähle Versandmethode",
2451
- children: [
2452
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "email", children: "E-Mail OTP (Premium)" }),
2453
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "sms", children: "SMS OTP (Advanced)" }),
2454
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "totp", children: "Authenticator App (Advanced)" })
2455
- ]
2456
- }
2457
- ),
2458
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "neutral600", style: { fontSize: "11px", marginTop: "6px" }, children: "Wie sollen Benutzer den Verifikationscode erhalten?" })
2459
- ] }) }),
2460
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 3, s: 12, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { children: [
2461
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", fontWeight: "bold", style: { marginBottom: "8px", display: "block" }, children: "🔢 Code-Länge" }),
2462
- /* @__PURE__ */ jsxRuntime.jsx(
2463
- designSystem.NumberInput,
2464
- {
2465
- value: settings.otp_length || 6,
2466
- onValueChange: (value) => updateSetting("otp_length", value),
2467
- placeholder: "6",
2468
- min: 4,
2469
- max: 8
2470
- }
2471
- ),
2472
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "neutral600", style: { fontSize: "11px", marginTop: "6px" }, children: "Anzahl der Ziffern (4-8). Standard: 6 Ziffern" })
2473
- ] }) }),
2474
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 3, s: 12, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { children: [
2475
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", fontWeight: "bold", style: { marginBottom: "8px", display: "block" }, children: "⏱️ Gültigkeit (Sekunden)" }),
2476
- /* @__PURE__ */ jsxRuntime.jsx(
2477
- designSystem.NumberInput,
2478
- {
2479
- value: settings.otp_expiry || 300,
2480
- onValueChange: (value) => updateSetting("otp_expiry", value),
2481
- placeholder: "300"
2482
- }
2483
- ),
2484
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "neutral600", style: { fontSize: "11px", marginTop: "6px" }, children: "Wie lange ist der Code gültig? Standard: 300s (5 Min)" })
2485
- ] }) })
2486
- ] }),
2487
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Grid.Root, { gap: 6, style: { marginBottom: "24px" }, children: [
2488
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 6, s: 12, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { children: [
2489
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", fontWeight: "bold", style: { marginBottom: "8px", display: "block" }, children: "⚠️ Max. Fehlversuche" }),
2490
- /* @__PURE__ */ jsxRuntime.jsx(
2491
- designSystem.NumberInput,
2492
- {
2493
- value: settings.otp_max_attempts || 3,
2494
- onValueChange: (value) => updateSetting("otp_max_attempts", value),
2495
- placeholder: "3"
2496
- }
2497
- ),
2498
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "neutral600", style: { fontSize: "11px", marginTop: "6px" }, children: "Nach wie vielen Fehlversuchen wird der Code ungültig? Standard: 3" })
2499
- ] }) }),
2500
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 6, s: 12, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { children: [
2501
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", fontWeight: "bold", style: { marginBottom: "8px", display: "block" }, children: "🔄 Wartezeit für neuen Code" }),
2502
- /* @__PURE__ */ jsxRuntime.jsx(
2503
- designSystem.NumberInput,
2504
- {
2505
- value: settings.otp_resend_cooldown || 60,
2506
- onValueChange: (value) => updateSetting("otp_resend_cooldown", value),
2507
- placeholder: "60"
2508
- }
2509
- ),
2510
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "neutral600", style: { fontSize: "11px", marginTop: "6px" }, children: "Wie lange muss der Benutzer warten, bevor ein neuer Code angefordert werden kann? Standard: 60s" })
2511
- ] }) })
2512
- ] }),
2513
- /* @__PURE__ */ jsxRuntime.jsx(
2514
- designSystem.Box,
2515
- {
2516
- background: "success100",
2517
- padding: 4,
2518
- style: { borderRadius: theme.borderRadius.md, border: "1px solid rgba(34, 197, 94, 0.3)", marginBottom: "24px" },
2519
- children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, alignItems: "flex-start", style: { marginBottom: "12px" }, children: [
2520
- /* @__PURE__ */ jsxRuntime.jsx(icons.CheckCircle, { width: "16px", height: "16px", style: { color: "var(--colors-success600, #15803D)", flexShrink: 0, marginTop: "2px" } }),
2521
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { children: [
2522
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", fontWeight: "bold", style: { fontSize: "13px", color: "var(--colors-success600, #15803D)", marginBottom: "6px", display: "block" }, children: "So funktioniert's:" }),
2523
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Typography, { variant: "pi", style: { fontSize: "12px", color: "var(--colors-success600, #15803D)", lineHeight: "1.6" }, children: [
2524
- "1. Benutzer klickt auf Magic Link in der E-Mail",
2525
- /* @__PURE__ */ jsxRuntime.jsx("br", {}),
2526
- "2. Wird zu OTP-Verifikationsseite weitergeleitet",
2527
- /* @__PURE__ */ jsxRuntime.jsx("br", {}),
2528
- "3. Gibt den ",
2529
- settings.otp_length || 6,
2530
- "-stelligen Code ein, der an ",
2531
- settings.otp_type === "sms" ? "sein Telefon" : "seine E-Mail",
2532
- " gesendet wurde",
2533
- /* @__PURE__ */ jsxRuntime.jsx("br", {}),
2534
- "4. Nach erfolgreicher Verifikation ist der Benutzer eingeloggt"
2535
- ] })
2536
- ] })
2537
- ] })
2538
- }
2539
- ),
2540
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Divider, { style: { marginBottom: "24px" } })
2541
- ] }),
2542
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { background: "neutral100", padding: 5, style: { borderRadius: theme.borderRadius.md, marginBottom: "24px" }, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { alignItems: "flex-start", gap: 4, children: [
2543
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { flex: "1", children: [
2544
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { alignItems: "center", gap: 2, style: { marginBottom: "8px" }, children: [
2545
- /* @__PURE__ */ jsxRuntime.jsx(icons.Lightning, { width: "16px", height: "16px", style: { color: "#D97706" } }),
2546
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", fontWeight: "bold", children: "Enable TOTP-Only Login" }),
2547
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Badge, { style: {
2548
- backgroundColor: "#92400E",
2549
- color: "#FEFCE8",
2550
- fontWeight: "600",
2551
- fontSize: "11px",
2552
- padding: "3px 8px",
2553
- border: "1px solid #78350F"
2554
- }, children: "Advanced" })
2555
- ] }),
2556
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "neutral600", style: { fontSize: "11px", marginBottom: "12px" }, children: "Allow users to login with Email + TOTP code directly, without waiting for magic link email." }),
2557
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, alignItems: "flex-start", children: [
2558
- /* @__PURE__ */ jsxRuntime.jsx(icons.Lightning, { width: "14px", height: "14px", style: { color: "var(--colors-warning600, #A16207)", flexShrink: 0, marginTop: "2px" } }),
2559
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Typography, { variant: "pi", style: { fontSize: "11px", color: "var(--colors-warning600, #A16207)" }, children: [
2560
- /* @__PURE__ */ jsxRuntime.jsx("strong", { children: "Fast login:" }),
2561
- " Users open authenticator app, enter code → instant login (no email needed)"
2562
- ] })
2563
- ] })
2564
- ] }),
2565
- /* @__PURE__ */ jsxRuntime.jsx(GreenToggle, { $isActive: settings.totp_as_primary_auth, children: /* @__PURE__ */ jsxRuntime.jsx(
2566
- designSystem.Switch,
2567
- {
2568
- checked: settings.totp_as_primary_auth || false,
2569
- onCheckedChange: (checked) => {
2570
- updateSetting("totp_as_primary_auth", checked);
2571
- }
2572
- }
2573
- ) })
2574
- ] }) }),
2575
- (settings.mfa_require_totp || settings.totp_as_primary_auth) && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
2576
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Divider, { style: { marginBottom: "24px" } }),
2577
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "sigma", fontWeight: "bold", style: { marginBottom: "16px", display: "block", color: "var(--colors-neutral700)" }, children: "TOTP Configuration" }),
2578
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Grid.Root, { gap: 6, children: [
2579
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 6, s: 12, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { children: [
2580
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", fontWeight: "bold", style: { marginBottom: "8px", display: "block" }, children: "Issuer Name" }),
2581
- /* @__PURE__ */ jsxRuntime.jsx(
2582
- designSystem.TextInput,
2583
- {
2584
- value: settings.totp_issuer || "Magic Link",
2585
- onChange: (e) => updateSetting("totp_issuer", e.target.value),
2586
- placeholder: "Magic Link"
2587
- }
2588
- ),
2589
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "neutral600", style: { fontSize: "11px", marginTop: "6px" }, children: 'Displayed in authenticator apps (e.g., "MyApp")' })
2590
- ] }) }),
2591
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 3, s: 12, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { children: [
2592
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", fontWeight: "bold", style: { marginBottom: "8px", display: "block" }, children: "Code Digits" }),
2593
- /* @__PURE__ */ jsxRuntime.jsxs(
2594
- designSystem.SingleSelect,
2595
- {
2596
- value: settings.totp_digits?.toString() || "6",
2597
- onChange: (value) => updateSetting("totp_digits", parseInt(value)),
2598
- children: [
2599
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "6", children: "6 digits" }),
2600
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "8", children: "8 digits" })
2601
- ]
2602
- }
2603
- )
2604
- ] }) }),
2605
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 3, s: 12, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { children: [
2606
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", fontWeight: "bold", style: { marginBottom: "8px", display: "block" }, children: "Time Period (s)" }),
2607
- /* @__PURE__ */ jsxRuntime.jsx(
2608
- designSystem.NumberInput,
2609
- {
2610
- value: settings.totp_period || 30,
2611
- onValueChange: (value) => updateSetting("totp_period", value),
2612
- placeholder: "30"
2613
- }
2614
- ),
2615
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "neutral600", style: { fontSize: "11px", marginTop: "6px" }, children: "Default: 30 seconds" })
2616
- ] }) })
2617
- ] }),
2618
- /* @__PURE__ */ jsxRuntime.jsx(
2619
- designSystem.Box,
2620
- {
2621
- background: "success100",
2622
- padding: 4,
2623
- style: { borderRadius: theme.borderRadius.md, border: "1px solid rgba(34, 197, 94, 0.3)", marginTop: "16px" },
2624
- children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, alignItems: "flex-start", children: [
2625
- /* @__PURE__ */ jsxRuntime.jsx(icons.Key, { width: "14px", height: "14px", style: { color: "var(--colors-success600, #15803D)", flexShrink: 0, marginTop: "2px" } }),
2626
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Typography, { variant: "pi", style: { fontSize: "12px", color: "var(--colors-success600, #15803D)" }, children: [
2627
- /* @__PURE__ */ jsxRuntime.jsx("strong", { children: "How it works:" }),
2628
- " Users scan QR code with Google Authenticator, Authy, or any TOTP app. They'll get a new 6-digit code every 30 seconds."
2629
- ] })
2630
- ] })
2631
- }
2632
- )
2633
- ] }),
2634
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Divider, { style: { marginTop: "24px", marginBottom: "24px" } }),
2635
- /* @__PURE__ */ jsxRuntime.jsxs(
2636
- designSystem.Box,
2637
- {
2638
- background: "primary100",
2639
- padding: 4,
2640
- style: { borderRadius: theme.borderRadius.md, border: "2px solid rgba(14, 165, 233, 0.3)" },
2641
- children: [
2642
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, alignItems: "center", style: { marginBottom: "8px" }, children: [
2643
- /* @__PURE__ */ jsxRuntime.jsx(icons.CheckCircle, { width: "16px", height: "16px", style: { color: "var(--colors-primary600, #075985)" } }),
2644
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", fontWeight: "bold", style: { color: "var(--colors-primary600, #075985)" }, children: "Current Configuration:" })
2645
- ] }),
2646
- !settings.otp_enabled && !settings.mfa_require_totp && !settings.totp_as_primary_auth && /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, alignItems: "flex-start", children: [
2647
- /* @__PURE__ */ jsxRuntime.jsx(icons.Link, { width: "14px", height: "14px", style: { color: "var(--colors-neutral700)", flexShrink: 0, marginTop: "2px" } }),
2648
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", style: { fontSize: "12px", color: "var(--colors-neutral700)" }, children: "Users login with Magic Link only (one-click email login)" })
2649
- ] }),
2650
- settings.otp_enabled && !settings.mfa_require_totp && /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, alignItems: "flex-start", children: [
2651
- /* @__PURE__ */ jsxRuntime.jsx(icons.Mail, { width: "14px", height: "14px", style: { color: "var(--colors-neutral700)", flexShrink: 0, marginTop: "2px" } }),
2652
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", style: { fontSize: "12px", color: "var(--colors-neutral700)" }, children: "Users click Magic Link → Enter 6-digit code from email" })
2653
- ] }),
2654
- settings.mfa_require_totp && /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, alignItems: "flex-start", children: [
2655
- /* @__PURE__ */ jsxRuntime.jsx(icons.Lock, { width: "14px", height: "14px", style: { color: "var(--colors-neutral700)", flexShrink: 0, marginTop: "2px" } }),
2656
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", style: { fontSize: "12px", color: "var(--colors-neutral700)" }, children: "Users click Magic Link → Enter code from authenticator app (MFA)" })
2657
- ] }),
2658
- settings.totp_as_primary_auth && /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, alignItems: "flex-start", style: { marginTop: settings.mfa_require_totp ? "8px" : "0" }, children: [
2659
- /* @__PURE__ */ jsxRuntime.jsx(icons.Lightning, { width: "14px", height: "14px", style: { color: "var(--colors-neutral700)", flexShrink: 0, marginTop: "2px" } }),
2660
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", style: { fontSize: "12px", color: "var(--colors-neutral700)" }, children: "+ TOTP-only login enabled (users can skip email and login with code directly)" })
2661
- ] })
2662
- ]
2663
- }
2664
- )
2665
- ] }) })
2666
- ] }),
2667
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Accordion.Item, { value: "ratelimit", children: [
2668
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Accordion.Header, { children: /* @__PURE__ */ jsxRuntime.jsx(
2669
- designSystem.Accordion.Trigger,
2670
- {
2671
- icon: icons.Shield,
2672
- description: formatMessage({ id: index.getTrad("settings.section.rateLimit.description") }),
2673
- children: formatMessage({ id: index.getTrad("settings.section.rateLimit") })
2674
- }
2675
- ) }),
2676
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Accordion.Content, { children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { padding: 6, children: [
2677
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { background: "neutral100", padding: 5, style: { borderRadius: theme.borderRadius.md, marginBottom: "24px" }, children: [
2678
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "sigma", fontWeight: "bold", style: { marginBottom: "8px", display: "block", textAlign: "center", color: "var(--colors-neutral700)" }, children: formatMessage({ id: index.getTrad("settings.rateLimit.title") }) }),
2679
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "neutral600", style: { marginBottom: "20px", display: "block", textAlign: "center", fontSize: "12px" }, children: formatMessage({ id: index.getTrad("settings.rateLimit.subtitle") }) }),
2680
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Root, { gap: 4, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 12, children: /* @__PURE__ */ jsxRuntime.jsx(ToggleCard, { $active: settings.rate_limit_enabled, $statusLabel: settings.rate_limit_enabled ? statusActive : statusInactive, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", gap: 3, children: [
2681
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "center", alignItems: "center", style: { marginBottom: "8px" }, children: /* @__PURE__ */ jsxRuntime.jsx(
2682
- designSystem.Switch,
2683
- {
2684
- checked: settings.rate_limit_enabled,
2685
- onCheckedChange: (checked) => updateSetting("rate_limit_enabled", checked),
2686
- size: "L"
2687
- }
2688
- ) }),
2689
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { children: [
2690
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", fontWeight: "bold", style: { fontSize: "14px", marginBottom: "6px", display: "block", textAlign: "center" }, children: formatMessage({ id: index.getTrad("settings.rateLimit.enable.title") }) }),
2691
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "omega", textColor: "neutral600", style: { fontSize: "12px", lineHeight: "1.4", textAlign: "center" }, children: formatMessage({ id: index.getTrad("settings.rateLimit.enable.description") }) })
2692
- ] })
2693
- ] }) }) }) })
2694
- ] }),
2695
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "sigma", fontWeight: "bold", style: { marginBottom: "16px", display: "block", color: "var(--colors-neutral700)" }, children: formatMessage({ id: index.getTrad("settings.rateLimit.config.title") }) }),
2696
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Grid.Root, { gap: 6, style: { marginBottom: "32px" }, children: [
2697
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 6, s: 12, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { children: [
2698
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", fontWeight: "bold", style: { marginBottom: "8px", display: "block" }, children: formatMessage({ id: index.getTrad("settings.rateLimit.maxAttempts.label") }) }),
2699
- /* @__PURE__ */ jsxRuntime.jsx(
2700
- designSystem.NumberInput,
2701
- {
2702
- name: "rate_limit_max_attempts",
2703
- hint: formatMessage({ id: index.getTrad("settings.rateLimit.maxAttempts.hint") }),
2704
- value: settings.rate_limit_max_attempts,
2705
- onValueChange: (val) => updateSetting("rate_limit_max_attempts", val),
2706
- min: 1,
2707
- max: 100
2708
- }
2709
- )
2710
- ] }) }),
2711
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 6, s: 12, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { children: [
2712
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", fontWeight: "bold", style: { marginBottom: "8px", display: "block" }, children: formatMessage({ id: index.getTrad("settings.rateLimit.windowMinutes.label") }) }),
2713
- /* @__PURE__ */ jsxRuntime.jsx(
2714
- designSystem.NumberInput,
2715
- {
2716
- name: "rate_limit_window_minutes",
2717
- hint: formatMessage({ id: index.getTrad("settings.rateLimit.windowMinutes.hint") }),
2718
- value: settings.rate_limit_window_minutes,
2719
- onValueChange: (val) => updateSetting("rate_limit_window_minutes", val),
2720
- min: 1,
2721
- max: 1440
2722
- }
2723
- )
2724
- ] }) })
2725
- ] }),
2726
- rateLimitStats && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
2727
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Divider, { style: { marginBottom: "24px" } }),
2728
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "sigma", fontWeight: "bold", style: { marginBottom: "16px", display: "block", color: "var(--colors-neutral700)" }, children: formatMessage({ id: index.getTrad("settings.rateLimit.stats.title") }) }),
2729
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 4, wrap: "wrap", justifyContent: "center", style: { marginBottom: "24px" }, children: [
2730
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { padding: 4, background: "neutral100", style: { borderRadius: "8px", textAlign: "center", minWidth: "140px", flex: "1" }, children: [
2731
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "beta", style: { color: "var(--colors-primary600, #0284C7)", fontWeight: "700" }, children: rateLimitStats.totalEntries || 0 }),
2732
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "omega", textColor: "neutral600", style: { fontSize: "11px", marginTop: "4px", display: "block" }, children: formatMessage({ id: index.getTrad("settings.rateLimit.stats.total") }) })
2733
- ] }),
2734
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { padding: 4, background: "danger100", style: { borderRadius: "8px", textAlign: "center", minWidth: "140px", flex: "1" }, children: [
2735
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "beta", style: { color: "var(--colors-danger600, #DC2626)", fontWeight: "700" }, children: rateLimitStats.blocked || 0 }),
2736
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "omega", textColor: "neutral600", style: { fontSize: "11px", marginTop: "4px", display: "block" }, children: formatMessage({ id: index.getTrad("settings.rateLimit.stats.blocked") }) })
2737
- ] }),
2738
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { padding: 4, background: "primary100", style: { borderRadius: "8px", textAlign: "center", minWidth: "140px", flex: "1" }, children: [
2739
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "beta", style: { color: "var(--colors-primary600, #0284C7)", fontWeight: "700" }, children: rateLimitStats.ipLimits || 0 }),
2740
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "omega", textColor: "neutral600", style: { fontSize: "11px", marginTop: "4px", display: "block" }, children: formatMessage({ id: index.getTrad("settings.rateLimit.stats.ipLimits") }) })
2741
- ] }),
2742
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { padding: 4, background: "success100", style: { borderRadius: "8px", textAlign: "center", minWidth: "140px", flex: "1" }, children: [
2743
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "beta", style: { color: "var(--colors-success600, #16A34A)", fontWeight: "700" }, children: rateLimitStats.emailLimits || 0 }),
2744
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "omega", textColor: "neutral600", style: { fontSize: "11px", marginTop: "4px", display: "block" }, children: formatMessage({ id: index.getTrad("settings.rateLimit.stats.emailLimits") }) })
2745
- ] })
2746
- ] }),
2747
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 3, justifyContent: "center", children: [
2748
- /* @__PURE__ */ jsxRuntime.jsx(
2749
- designSystem.Button,
2750
- {
2751
- onClick: handleRateLimitCleanup,
2752
- variant: "secondary",
2753
- size: "M",
2754
- children: formatMessage({ id: index.getTrad("settings.rateLimit.cleanup") })
2755
- }
2756
- ),
2757
- /* @__PURE__ */ jsxRuntime.jsx(
2758
- designSystem.Button,
2759
- {
2760
- onClick: handleRateLimitReset,
2761
- variant: "danger",
2762
- size: "M",
2763
- children: formatMessage({ id: index.getTrad("settings.rateLimit.reset") })
2764
- }
2765
- )
2766
- ] })
2767
- ] })
2768
- ] }) })
2769
- ] }),
2770
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Accordion.Item, { value: "compatibility", children: [
2771
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Accordion.Header, { children: /* @__PURE__ */ jsxRuntime.jsx(
2772
- designSystem.Accordion.Trigger,
2773
- {
2774
- icon: icons.Link,
2775
- description: formatMessage({ id: index.getTrad("settings.section.compatibility.description") }),
2776
- children: formatMessage({ id: index.getTrad("settings.section.compatibility") })
2777
- }
2778
- ) }),
2779
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Accordion.Content, { children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { padding: 6, children: [
2780
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "sigma", fontWeight: "bold", style: { marginBottom: "8px", display: "block", color: "var(--colors-neutral700)" }, children: formatMessage({ id: index.getTrad("settings.compatibility.title") }) }),
2781
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "neutral600", style: { marginBottom: "20px", display: "block", fontSize: "12px" }, children: formatMessage({ id: index.getTrad("settings.compatibility.subtitle") }) }),
2782
- /* @__PURE__ */ jsxRuntime.jsx(
2783
- designSystem.Box,
2784
- {
2785
- background: "primary100",
2786
- padding: 4,
2787
- style: {
2788
- borderRadius: theme.borderRadius.md,
2789
- marginBottom: "24px",
2790
- border: "2px solid rgba(14, 165, 233, 0.3)"
2791
- },
2792
- children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { alignItems: "flex-start", gap: 3, children: [
2793
- /* @__PURE__ */ jsxRuntime.jsx(icons.Link, { width: "20px", height: "20px", style: { color: "var(--colors-primary600, #0284C7)", flexShrink: 0, marginTop: "2px" } }),
2794
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { children: [
2795
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", fontWeight: "bold", style: { marginBottom: "6px", display: "block" }, children: formatMessage({ id: index.getTrad("settings.compatibility.info.title") }) }),
2796
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "neutral600", style: { fontSize: "12px", lineHeight: "1.5" }, children: formatMessage({ id: index.getTrad("settings.compatibility.info.description") }) })
2797
- ] })
2798
- ] })
2799
- }
2800
- ),
2801
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Grid.Root, { gap: 6, children: [
2802
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 6, s: 12, children: /* @__PURE__ */ jsxRuntime.jsx(ToggleCard, { $active: settings.passwordlessCompatibility, $statusLabel: settings.passwordlessCompatibility ? statusActive : statusInactive, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", gap: 3, children: [
2803
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "center", alignItems: "center", style: { marginBottom: "8px" }, children: /* @__PURE__ */ jsxRuntime.jsx(
2804
- designSystem.Switch,
2805
- {
2806
- checked: settings.passwordlessCompatibility,
2807
- onCheckedChange: (checked) => updateSetting("passwordlessCompatibility", checked),
2808
- size: "L"
2809
- }
2810
- ) }),
2811
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { children: [
2812
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", fontWeight: "bold", style: { fontSize: "14px", marginBottom: "6px", display: "block", textAlign: "center" }, children: formatMessage({ id: index.getTrad("settings.compatibility.passwordless.title") }) }),
2813
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "omega", textColor: "neutral600", style: { fontSize: "12px", lineHeight: "1.4", textAlign: "center" }, children: formatMessage({ id: index.getTrad("settings.compatibility.passwordless.description") }) })
2814
- ] }),
2815
- settings.passwordlessCompatibility && /* @__PURE__ */ jsxRuntime.jsx(
2816
- designSystem.Box,
2817
- {
2818
- background: "success100",
2819
- padding: 3,
2820
- style: {
2821
- borderRadius: theme.borderRadius.md,
2822
- marginTop: "8px",
2823
- border: "1px solid rgba(34, 197, 94, 0.3)"
2824
- },
2825
- children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Typography, { variant: "pi", style: { fontSize: "11px", fontFamily: "monospace" }, children: [
2826
- "POST /api/passwordless/send-link",
2827
- /* @__PURE__ */ jsxRuntime.jsx("br", {}),
2828
- "GET /api/passwordless/login"
2829
- ] })
2830
- }
2831
- )
2832
- ] }) }) }),
2833
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 6, s: 12, children: /* @__PURE__ */ jsxRuntime.jsx(ToggleCard, { $active: settings.emailDesignerCompatibility, $statusLabel: settings.emailDesignerCompatibility ? statusActive : statusInactive, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", gap: 3, children: [
2834
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "center", alignItems: "center", style: { marginBottom: "8px" }, children: /* @__PURE__ */ jsxRuntime.jsx(
2835
- designSystem.Switch,
2836
- {
2837
- checked: settings.emailDesignerCompatibility,
2838
- onCheckedChange: (checked) => updateSetting("emailDesignerCompatibility", checked),
2839
- size: "L"
2840
- }
2841
- ) }),
2842
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { children: [
2843
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", fontWeight: "bold", style: { fontSize: "14px", marginBottom: "6px", display: "block", textAlign: "center" }, children: formatMessage({ id: index.getTrad("settings.compatibility.emailDesigner.title") }) }),
2844
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "omega", textColor: "neutral600", style: { fontSize: "12px", lineHeight: "1.4", textAlign: "center" }, children: formatMessage({ id: index.getTrad("settings.compatibility.emailDesigner.description") }) })
2845
- ] }),
2846
- settings.emailDesignerCompatibility && /* @__PURE__ */ jsxRuntime.jsx(
2847
- designSystem.Box,
2848
- {
2849
- background: "success100",
2850
- padding: 3,
2851
- style: {
2852
- borderRadius: theme.borderRadius.md,
2853
- marginTop: "8px",
2854
- border: "1px solid rgba(34, 197, 94, 0.3)"
2855
- },
2856
- children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Typography, { variant: "pi", style: { fontSize: "11px" }, children: [
2857
- "✓ Email Designer 5 Integration",
2858
- /* @__PURE__ */ jsxRuntime.jsx("br", {}),
2859
- "✓ sendTemplatedEmail() Support"
2860
- ] })
2861
- }
2862
- )
2863
- ] }) }) })
2864
- ] }),
2865
- /* @__PURE__ */ jsxRuntime.jsx(
2866
- designSystem.Box,
2867
- {
2868
- background: "warning100",
2869
- padding: 4,
2870
- style: {
2871
- borderRadius: theme.borderRadius.md,
2872
- marginTop: "24px",
2873
- border: "2px solid rgba(234, 179, 8, 0.4)"
2874
- },
2875
- children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { alignItems: "flex-start", gap: 3, children: [
2876
- /* @__PURE__ */ jsxRuntime.jsx(icons.Code, { width: "20px", height: "20px", style: { color: "var(--colors-warning600, #D97706)", flexShrink: 0, marginTop: "2px" } }),
2877
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { children: [
2878
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", fontWeight: "bold", style: { marginBottom: "6px", display: "block" }, children: formatMessage({ id: index.getTrad("settings.compatibility.migration.title") }) }),
2879
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "neutral600", style: { fontSize: "12px", lineHeight: "1.5" }, children: formatMessage({ id: index.getTrad("settings.compatibility.migration.description") }) })
2880
- ] })
2881
- ] })
2882
- }
2883
- )
2884
- ] }) })
2885
- ] })
2886
- ] }),
2887
- /* @__PURE__ */ jsxRuntime.jsx(
2888
- designSystem.Box,
2889
- {
2890
- background: "success50",
2891
- padding: 5,
2892
- style: { borderRadius: theme.borderRadius.lg, marginTop: "32px", border: "2px solid rgba(34, 197, 94, 0.3)" },
2893
- children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 3, alignItems: "center", justifyContent: "center", children: [
2894
- /* @__PURE__ */ jsxRuntime.jsx(icons.Check, { style: { width: "24px", height: "24px", color: "var(--colors-success600, #16A34A)" } }),
2895
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { children: [
2896
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", fontWeight: "bold", style: { marginBottom: "4px", display: "block" }, children: formatMessage({ id: index.getTrad("settings.footer.quickhelp") }) }),
2897
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "neutral700", style: { fontSize: "13px" }, children: /* @__PURE__ */ jsxRuntime.jsx("strong", { children: formatMessage({ id: index.getTrad("settings.footer.reminder") }) }) })
2898
- ] })
2899
- ] })
2900
- }
2901
- )
2902
- ] })
2903
- ] });
2904
- };
2905
- const SettingsWithLanguage = () => /* @__PURE__ */ jsxRuntime.jsx(LicenseGuard.LicenseGuard, { children: /* @__PURE__ */ jsxRuntime.jsx(LicenseGuard.LanguageProvider, { children: /* @__PURE__ */ jsxRuntime.jsx(SettingsModern, {}) }) });
2906
- exports.default = SettingsWithLanguage;