@exyconn/common 2.1.0 → 2.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (122) hide show
  1. package/README.md +864 -261
  2. package/dist/client/hooks/index.d.mts +1042 -0
  3. package/dist/client/hooks/index.d.ts +1042 -0
  4. package/dist/client/hooks/index.js +2276 -0
  5. package/dist/client/hooks/index.js.map +1 -0
  6. package/dist/client/hooks/index.mjs +2217 -0
  7. package/dist/client/hooks/index.mjs.map +1 -0
  8. package/dist/client/index.d.mts +3 -1
  9. package/dist/client/index.d.ts +3 -1
  10. package/dist/client/web/index.d.mts +1461 -0
  11. package/dist/client/web/index.d.ts +1461 -0
  12. package/dist/client/web/index.js +2681 -0
  13. package/dist/client/web/index.js.map +1 -0
  14. package/dist/client/web/index.mjs +2618 -0
  15. package/dist/client/web/index.mjs.map +1 -0
  16. package/dist/data/brand-identity.d.mts +149 -0
  17. package/dist/data/brand-identity.d.ts +149 -0
  18. package/dist/data/brand-identity.js +235 -0
  19. package/dist/data/brand-identity.js.map +1 -0
  20. package/dist/data/brand-identity.mjs +220 -0
  21. package/dist/data/brand-identity.mjs.map +1 -0
  22. package/dist/data/countries.d.mts +61 -0
  23. package/dist/data/countries.d.ts +61 -0
  24. package/dist/data/countries.js +987 -0
  25. package/dist/data/countries.js.map +1 -0
  26. package/dist/data/countries.mjs +971 -0
  27. package/dist/data/countries.mjs.map +1 -0
  28. package/dist/data/currencies.d.mts +19 -0
  29. package/dist/data/currencies.d.ts +19 -0
  30. package/dist/data/currencies.js +162 -0
  31. package/dist/data/currencies.js.map +1 -0
  32. package/dist/data/currencies.mjs +153 -0
  33. package/dist/data/currencies.mjs.map +1 -0
  34. package/dist/data/index.d.mts +7 -0
  35. package/dist/data/index.d.ts +7 -0
  36. package/dist/data/index.js +2087 -0
  37. package/dist/data/index.js.map +1 -0
  38. package/dist/data/index.mjs +1948 -0
  39. package/dist/data/index.mjs.map +1 -0
  40. package/dist/data/phone-codes.d.mts +15 -0
  41. package/dist/data/phone-codes.d.ts +15 -0
  42. package/dist/data/phone-codes.js +219 -0
  43. package/dist/data/phone-codes.js.map +1 -0
  44. package/dist/data/phone-codes.mjs +211 -0
  45. package/dist/data/phone-codes.mjs.map +1 -0
  46. package/dist/data/regex.d.mts +287 -0
  47. package/dist/data/regex.d.ts +287 -0
  48. package/dist/data/regex.js +306 -0
  49. package/dist/data/regex.js.map +1 -0
  50. package/dist/data/regex.mjs +208 -0
  51. package/dist/data/regex.mjs.map +1 -0
  52. package/dist/data/timezones.d.mts +16 -0
  53. package/dist/data/timezones.d.ts +16 -0
  54. package/dist/data/timezones.js +98 -0
  55. package/dist/data/timezones.js.map +1 -0
  56. package/dist/data/timezones.mjs +89 -0
  57. package/dist/data/timezones.mjs.map +1 -0
  58. package/dist/index-01hoqibP.d.ts +119 -0
  59. package/dist/index-D3yCCjBZ.d.mts +119 -0
  60. package/dist/index-D9a9oxQy.d.ts +305 -0
  61. package/dist/index-DKn4raO7.d.ts +222 -0
  62. package/dist/index-DuxL84IW.d.mts +305 -0
  63. package/dist/index-NS8dS0p9.d.mts +222 -0
  64. package/dist/index-Nqm5_lwT.d.ts +188 -0
  65. package/dist/index-jBi3V6e5.d.mts +188 -0
  66. package/dist/index.d.mts +20 -579
  67. package/dist/index.d.ts +20 -579
  68. package/dist/index.js +717 -18
  69. package/dist/index.js.map +1 -1
  70. package/dist/index.mjs +716 -18
  71. package/dist/index.mjs.map +1 -1
  72. package/dist/server/configs/index.d.mts +602 -0
  73. package/dist/server/configs/index.d.ts +602 -0
  74. package/dist/server/configs/index.js +707 -0
  75. package/dist/server/configs/index.js.map +1 -0
  76. package/dist/server/configs/index.mjs +665 -0
  77. package/dist/server/configs/index.mjs.map +1 -0
  78. package/dist/server/index.d.mts +3 -0
  79. package/dist/server/index.d.ts +3 -0
  80. package/dist/server/index.js +699 -0
  81. package/dist/server/index.js.map +1 -1
  82. package/dist/server/index.mjs +662 -1
  83. package/dist/server/index.mjs.map +1 -1
  84. package/dist/shared/config/index.d.mts +40 -0
  85. package/dist/shared/config/index.d.ts +40 -0
  86. package/dist/shared/config/index.js +58 -0
  87. package/dist/shared/config/index.js.map +1 -0
  88. package/dist/shared/config/index.mjs +51 -0
  89. package/dist/shared/config/index.mjs.map +1 -0
  90. package/dist/shared/constants/index.d.mts +593 -0
  91. package/dist/shared/constants/index.d.ts +593 -0
  92. package/dist/shared/constants/index.js +391 -0
  93. package/dist/shared/constants/index.js.map +1 -0
  94. package/dist/shared/constants/index.mjs +360 -0
  95. package/dist/shared/constants/index.mjs.map +1 -0
  96. package/dist/shared/index.d.mts +5 -1
  97. package/dist/shared/index.d.ts +5 -1
  98. package/dist/shared/types/index.d.mts +140 -0
  99. package/dist/shared/types/index.d.ts +140 -0
  100. package/dist/shared/types/index.js +4 -0
  101. package/dist/shared/types/index.js.map +1 -0
  102. package/dist/shared/types/index.mjs +3 -0
  103. package/dist/shared/types/index.mjs.map +1 -0
  104. package/dist/shared/utils/index.d.mts +255 -0
  105. package/dist/shared/utils/index.d.ts +255 -0
  106. package/dist/shared/utils/index.js +623 -0
  107. package/dist/shared/utils/index.js.map +1 -0
  108. package/dist/shared/utils/index.mjs +324 -0
  109. package/dist/shared/utils/index.mjs.map +1 -0
  110. package/dist/shared/validation/index.d.mts +258 -0
  111. package/dist/shared/validation/index.d.ts +258 -0
  112. package/dist/shared/validation/index.js +185 -0
  113. package/dist/shared/validation/index.js.map +1 -0
  114. package/dist/shared/validation/index.mjs +172 -0
  115. package/dist/shared/validation/index.mjs.map +1 -0
  116. package/package.json +127 -62
  117. package/dist/index-BcxL4_V4.d.ts +0 -2946
  118. package/dist/index-DEzgM15j.d.ts +0 -67
  119. package/dist/index-DNFVgQx8.d.ts +0 -1375
  120. package/dist/index-DbV04Dx8.d.mts +0 -67
  121. package/dist/index-DfqEP6Oe.d.mts +0 -1375
  122. package/dist/index-bvvCev9Q.d.mts +0 -2946
@@ -0,0 +1,2618 @@
1
+ import { createContext, useContext, useState, useMemo, useEffect, useCallback } from 'react';
2
+ import { jsx, jsxs } from 'react/jsx-runtime';
3
+ import * as Yup from 'yup';
4
+ import { Formik, Form, Field, ErrorMessage } from 'formik';
5
+
6
+ // src/client/web/theme/default-light-theme.ts
7
+ var defaultLightTheme = {
8
+ name: "default-light",
9
+ mode: "light",
10
+ colors: {
11
+ brand: {
12
+ primary: "#3b82f6",
13
+ secondary: "#6366f1",
14
+ accent: "#f59e0b",
15
+ background: "#ffffff",
16
+ foreground: "#111827"
17
+ },
18
+ semantic: {
19
+ primary: "#3b82f6",
20
+ primaryHover: "#2563eb",
21
+ primaryActive: "#1d4ed8",
22
+ primaryDisabled: "#93c5fd",
23
+ secondary: "#6366f1",
24
+ secondaryHover: "#4f46e5",
25
+ secondaryActive: "#4338ca",
26
+ secondaryDisabled: "#a5b4fc",
27
+ accent: "#f59e0b",
28
+ accentHover: "#d97706",
29
+ success: "#22c55e",
30
+ successHover: "#16a34a",
31
+ warning: "#f59e0b",
32
+ warningHover: "#d97706",
33
+ error: "#ef4444",
34
+ errorHover: "#dc2626",
35
+ info: "#3b82f6",
36
+ infoHover: "#2563eb"
37
+ },
38
+ background: {
39
+ default: "#ffffff",
40
+ paper: "#f9fafb",
41
+ card: "#ffffff",
42
+ overlay: "rgba(0, 0, 0, 0.5)",
43
+ input: "#ffffff",
44
+ disabled: "#f3f4f6",
45
+ hover: "#f3f4f6",
46
+ selected: "#eff6ff"
47
+ },
48
+ surface: {
49
+ light: "#f9fafb",
50
+ main: "#f3f4f6",
51
+ dark: "#e5e7eb"
52
+ },
53
+ text: {
54
+ primary: "#111827",
55
+ secondary: "#6b7280",
56
+ disabled: "#9ca3af",
57
+ placeholder: "#9ca3af",
58
+ link: "#3b82f6",
59
+ linkHover: "#2563eb",
60
+ inverse: "#ffffff",
61
+ onPrimary: "#ffffff",
62
+ onSecondary: "#ffffff"
63
+ },
64
+ border: {
65
+ default: "#e5e7eb",
66
+ light: "#f3f4f6",
67
+ dark: "#d1d5db",
68
+ focus: "#3b82f6",
69
+ error: "#ef4444",
70
+ success: "#22c55e",
71
+ disabled: "#e5e7eb"
72
+ }
73
+ },
74
+ shadows: {
75
+ none: "none",
76
+ xs: "0 1px 2px 0 rgb(0 0 0 / 0.05)",
77
+ sm: "0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)",
78
+ md: "0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)",
79
+ lg: "0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)",
80
+ xl: "0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)",
81
+ "2xl": "0 25px 50px -12px rgb(0 0 0 / 0.25)",
82
+ inner: "inset 0 2px 4px 0 rgb(0 0 0 / 0.05)",
83
+ button: "0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)",
84
+ buttonHover: "0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)",
85
+ card: "0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)",
86
+ cardHover: "0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)",
87
+ modal: "0 25px 50px -12px rgb(0 0 0 / 0.25)",
88
+ dropdown: "0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)"
89
+ },
90
+ typography: {
91
+ fontFamily: {
92
+ sans: 'Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif',
93
+ serif: 'ui-serif, Georgia, Cambria, "Times New Roman", Times, serif',
94
+ mono: 'ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace',
95
+ heading: 'Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',
96
+ body: 'Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif'
97
+ },
98
+ fontSize: {
99
+ xs: "0.75rem",
100
+ sm: "0.875rem",
101
+ base: "1rem",
102
+ lg: "1.125rem",
103
+ xl: "1.25rem",
104
+ "2xl": "1.5rem",
105
+ "3xl": "1.875rem",
106
+ "4xl": "2.25rem",
107
+ "5xl": "3rem",
108
+ "6xl": "3.75rem"
109
+ },
110
+ fontWeight: {
111
+ light: 300,
112
+ normal: 400,
113
+ medium: 500,
114
+ semibold: 600,
115
+ bold: 700,
116
+ extrabold: 800
117
+ },
118
+ lineHeight: {
119
+ none: 1,
120
+ tight: 1.25,
121
+ snug: 1.375,
122
+ normal: 1.5,
123
+ relaxed: 1.625,
124
+ loose: 2
125
+ }
126
+ },
127
+ spacing: {
128
+ 0: "0",
129
+ px: "1px",
130
+ 0.5: "0.125rem",
131
+ 1: "0.25rem",
132
+ 1.5: "0.375rem",
133
+ 2: "0.5rem",
134
+ 2.5: "0.625rem",
135
+ 3: "0.75rem",
136
+ 3.5: "0.875rem",
137
+ 4: "1rem",
138
+ 5: "1.25rem",
139
+ 6: "1.5rem",
140
+ 7: "1.75rem",
141
+ 8: "2rem",
142
+ 9: "2.25rem",
143
+ 10: "2.5rem",
144
+ 11: "2.75rem",
145
+ 12: "3rem",
146
+ 14: "3.5rem",
147
+ 16: "4rem",
148
+ 20: "5rem",
149
+ 24: "6rem",
150
+ 28: "7rem",
151
+ 32: "8rem",
152
+ 36: "9rem",
153
+ 40: "10rem",
154
+ 44: "11rem",
155
+ 48: "12rem",
156
+ 52: "13rem",
157
+ 56: "14rem",
158
+ 60: "15rem",
159
+ 64: "16rem",
160
+ 72: "18rem",
161
+ 80: "20rem",
162
+ 96: "24rem"
163
+ },
164
+ borderRadius: {
165
+ none: "0",
166
+ sm: "0.125rem",
167
+ default: "0.25rem",
168
+ md: "0.375rem",
169
+ lg: "0.5rem",
170
+ xl: "0.75rem",
171
+ "2xl": "1rem",
172
+ "3xl": "1.5rem",
173
+ full: "9999px"
174
+ },
175
+ breakpoints: {
176
+ xs: "475px",
177
+ sm: "640px",
178
+ md: "768px",
179
+ lg: "1024px",
180
+ xl: "1280px",
181
+ "2xl": "1536px"
182
+ },
183
+ zIndex: {
184
+ hide: -1,
185
+ auto: "auto",
186
+ base: 0,
187
+ dropdown: 1e3,
188
+ sticky: 1020,
189
+ fixed: 1030,
190
+ modalBackdrop: 1040,
191
+ modal: 1050,
192
+ popover: 1060,
193
+ tooltip: 1070,
194
+ toast: 1080
195
+ },
196
+ transitions: {
197
+ none: "none",
198
+ fast: "150ms ease-in-out",
199
+ normal: "200ms ease-in-out",
200
+ slow: "300ms ease-in-out",
201
+ slower: "500ms ease-in-out",
202
+ colors: "color 200ms ease-in-out, background-color 200ms ease-in-out, border-color 200ms ease-in-out",
203
+ transform: "transform 200ms ease-in-out",
204
+ opacity: "opacity 200ms ease-in-out",
205
+ shadow: "box-shadow 200ms ease-in-out",
206
+ all: "all 200ms ease-in-out"
207
+ },
208
+ components: {
209
+ button: {
210
+ bg: "#3b82f6",
211
+ bgHover: "#2563eb",
212
+ bgActive: "#1d4ed8",
213
+ bgDisabled: "#93c5fd",
214
+ color: "#ffffff",
215
+ colorHover: "#ffffff",
216
+ colorDisabled: "#ffffff",
217
+ border: "transparent",
218
+ borderHover: "transparent",
219
+ borderWidth: "1px",
220
+ borderRadius: "0.375rem",
221
+ shadow: "0 1px 3px 0 rgb(0 0 0 / 0.1)",
222
+ shadowHover: "0 4px 6px -1px rgb(0 0 0 / 0.1)",
223
+ paddingX: "1rem",
224
+ paddingY: "0.5rem",
225
+ fontSize: "0.875rem",
226
+ fontWeight: 500,
227
+ variants: {
228
+ primary: {
229
+ bg: "#3b82f6",
230
+ bgHover: "#2563eb",
231
+ color: "#ffffff"
232
+ },
233
+ secondary: {
234
+ bg: "#6366f1",
235
+ bgHover: "#4f46e5",
236
+ color: "#ffffff"
237
+ },
238
+ outline: {
239
+ bg: "transparent",
240
+ bgHover: "#f3f4f6",
241
+ color: "#374151",
242
+ border: "#d1d5db",
243
+ borderHover: "#9ca3af"
244
+ },
245
+ ghost: {
246
+ bg: "transparent",
247
+ bgHover: "#f3f4f6",
248
+ color: "#374151",
249
+ shadow: "none",
250
+ shadowHover: "none"
251
+ },
252
+ link: {
253
+ bg: "transparent",
254
+ bgHover: "transparent",
255
+ color: "#3b82f6",
256
+ colorHover: "#2563eb",
257
+ shadow: "none",
258
+ shadowHover: "none",
259
+ paddingX: "0",
260
+ paddingY: "0"
261
+ },
262
+ danger: {
263
+ bg: "#ef4444",
264
+ bgHover: "#dc2626",
265
+ color: "#ffffff"
266
+ },
267
+ success: {
268
+ bg: "#22c55e",
269
+ bgHover: "#16a34a",
270
+ color: "#ffffff"
271
+ }
272
+ },
273
+ sizes: {
274
+ xs: {
275
+ paddingX: "0.5rem",
276
+ paddingY: "0.25rem",
277
+ fontSize: "0.75rem"
278
+ },
279
+ sm: {
280
+ paddingX: "0.75rem",
281
+ paddingY: "0.375rem",
282
+ fontSize: "0.875rem"
283
+ },
284
+ md: {
285
+ paddingX: "1rem",
286
+ paddingY: "0.5rem",
287
+ fontSize: "0.875rem"
288
+ },
289
+ lg: {
290
+ paddingX: "1.25rem",
291
+ paddingY: "0.625rem",
292
+ fontSize: "1rem"
293
+ },
294
+ xl: {
295
+ paddingX: "1.5rem",
296
+ paddingY: "0.75rem",
297
+ fontSize: "1.125rem"
298
+ }
299
+ }
300
+ },
301
+ input: {
302
+ bg: "#ffffff",
303
+ bgFocus: "#ffffff",
304
+ bgDisabled: "#f3f4f6",
305
+ bgError: "#fef2f2",
306
+ color: "#111827",
307
+ colorPlaceholder: "#9ca3af",
308
+ colorDisabled: "#9ca3af",
309
+ border: "#d1d5db",
310
+ borderFocus: "#3b82f6",
311
+ borderError: "#ef4444",
312
+ borderWidth: "1px",
313
+ borderRadius: "0.375rem",
314
+ shadow: "0 1px 2px 0 rgb(0 0 0 / 0.05)",
315
+ shadowFocus: "0 0 0 3px rgb(59 130 246 / 0.1)",
316
+ paddingX: "0.75rem",
317
+ paddingY: "0.5rem",
318
+ fontSize: "0.875rem",
319
+ labelColor: "#374151",
320
+ labelFontSize: "0.875rem",
321
+ labelFontWeight: 500,
322
+ helperColor: "#6b7280",
323
+ errorColor: "#ef4444",
324
+ sizes: {
325
+ sm: {
326
+ paddingX: "0.5rem",
327
+ paddingY: "0.375rem",
328
+ fontSize: "0.75rem"
329
+ },
330
+ md: {
331
+ paddingX: "0.75rem",
332
+ paddingY: "0.5rem",
333
+ fontSize: "0.875rem"
334
+ },
335
+ lg: {
336
+ paddingX: "1rem",
337
+ paddingY: "0.625rem",
338
+ fontSize: "1rem"
339
+ }
340
+ }
341
+ },
342
+ card: {
343
+ bg: "#ffffff",
344
+ bgHover: "#ffffff",
345
+ border: "#e5e7eb",
346
+ borderWidth: "1px",
347
+ borderRadius: "0.5rem",
348
+ shadow: "0 1px 3px 0 rgb(0 0 0 / 0.1)",
349
+ shadowHover: "0 10px 15px -3px rgb(0 0 0 / 0.1)",
350
+ padding: "1.5rem",
351
+ headerBg: "#f9fafb",
352
+ headerBorder: "#e5e7eb",
353
+ headerPadding: "1rem 1.5rem",
354
+ footerBg: "#f9fafb",
355
+ footerBorder: "#e5e7eb",
356
+ footerPadding: "1rem 1.5rem"
357
+ },
358
+ header: {
359
+ bg: "#ffffff",
360
+ bgScrolled: "rgba(255, 255, 255, 0.95)",
361
+ color: "#111827",
362
+ border: "#e5e7eb",
363
+ shadow: "none",
364
+ shadowScrolled: "0 1px 3px 0 rgb(0 0 0 / 0.1)",
365
+ height: "4rem",
366
+ paddingX: "1.5rem",
367
+ logoHeight: "2rem",
368
+ navColor: "#374151",
369
+ navColorHover: "#111827",
370
+ navColorActive: "#3b82f6",
371
+ navFontSize: "0.875rem",
372
+ navFontWeight: 500,
373
+ mobileMenuBg: "#ffffff",
374
+ mobileMenuShadow: "0 10px 15px -3px rgb(0 0 0 / 0.1)"
375
+ },
376
+ footer: {
377
+ bg: "#111827",
378
+ color: "#d1d5db",
379
+ colorMuted: "#9ca3af",
380
+ border: "#374151",
381
+ padding: "4rem 1.5rem",
382
+ linkColor: "#d1d5db",
383
+ linkColorHover: "#ffffff",
384
+ headingColor: "#ffffff",
385
+ headingFontSize: "1rem",
386
+ headingFontWeight: 600,
387
+ copyrightBg: "#0f172a",
388
+ copyrightColor: "#9ca3af"
389
+ },
390
+ banner: {
391
+ bg: "#eff6ff",
392
+ color: "#1e40af",
393
+ border: "#bfdbfe",
394
+ borderRadius: "0.5rem",
395
+ padding: "1rem 1.5rem",
396
+ shadow: "none",
397
+ closeBg: "transparent",
398
+ closeColor: "#1e40af",
399
+ variants: {
400
+ info: {
401
+ bg: "#eff6ff",
402
+ color: "#1e40af",
403
+ border: "#bfdbfe"
404
+ },
405
+ success: {
406
+ bg: "#f0fdf4",
407
+ color: "#166534",
408
+ border: "#bbf7d0"
409
+ },
410
+ warning: {
411
+ bg: "#fffbeb",
412
+ color: "#92400e",
413
+ border: "#fde68a"
414
+ },
415
+ error: {
416
+ bg: "#fef2f2",
417
+ color: "#991b1b",
418
+ border: "#fecaca"
419
+ },
420
+ promo: {
421
+ bg: "#faf5ff",
422
+ color: "#6b21a8",
423
+ border: "#e9d5ff"
424
+ }
425
+ }
426
+ },
427
+ loader: {
428
+ color: "#3b82f6",
429
+ colorSecondary: "#e5e7eb",
430
+ size: "2.5rem",
431
+ borderWidth: "3px",
432
+ overlayBg: "rgba(255, 255, 255, 0.8)",
433
+ overlayOpacity: 1,
434
+ sizes: {
435
+ xs: "1rem",
436
+ sm: "1.5rem",
437
+ md: "2.5rem",
438
+ lg: "3.5rem",
439
+ xl: "5rem"
440
+ }
441
+ },
442
+ modal: {
443
+ bg: "#ffffff",
444
+ color: "#111827",
445
+ border: "#e5e7eb",
446
+ borderRadius: "0.5rem",
447
+ shadow: "0 25px 50px -12px rgb(0 0 0 / 0.25)",
448
+ padding: "1.5rem",
449
+ overlayBg: "rgba(0, 0, 0, 0.5)",
450
+ overlayOpacity: 1,
451
+ headerBg: "#ffffff",
452
+ headerBorder: "#e5e7eb",
453
+ headerPadding: "1rem 1.5rem",
454
+ footerBg: "#f9fafb",
455
+ footerBorder: "#e5e7eb",
456
+ footerPadding: "1rem 1.5rem",
457
+ closeBg: "transparent",
458
+ closeColor: "#6b7280",
459
+ closeHoverBg: "#f3f4f6",
460
+ sizes: {
461
+ sm: "24rem",
462
+ md: "32rem",
463
+ lg: "48rem",
464
+ xl: "64rem",
465
+ full: "100%"
466
+ }
467
+ },
468
+ toast: {
469
+ bg: "#ffffff",
470
+ color: "#111827",
471
+ border: "#e5e7eb",
472
+ borderRadius: "0.5rem",
473
+ shadow: "0 10px 15px -3px rgb(0 0 0 / 0.1)",
474
+ padding: "1rem",
475
+ variants: {
476
+ success: {
477
+ bg: "#f0fdf4",
478
+ color: "#166534",
479
+ border: "#bbf7d0"
480
+ },
481
+ error: {
482
+ bg: "#fef2f2",
483
+ color: "#991b1b",
484
+ border: "#fecaca"
485
+ },
486
+ warning: {
487
+ bg: "#fffbeb",
488
+ color: "#92400e",
489
+ border: "#fde68a"
490
+ },
491
+ info: {
492
+ bg: "#eff6ff",
493
+ color: "#1e40af",
494
+ border: "#bfdbfe"
495
+ }
496
+ }
497
+ },
498
+ newsletter: {
499
+ bg: "#f9fafb",
500
+ color: "#111827",
501
+ border: "#e5e7eb",
502
+ borderRadius: "0.5rem",
503
+ padding: "2rem",
504
+ titleColor: "#111827",
505
+ titleFontSize: "1.5rem",
506
+ descColor: "#6b7280",
507
+ descFontSize: "1rem",
508
+ inputBg: "#ffffff",
509
+ inputBorder: "#d1d5db",
510
+ buttonBg: "#3b82f6",
511
+ buttonColor: "#ffffff"
512
+ }
513
+ }
514
+ };
515
+
516
+ // src/client/web/theme/default-dark-theme.ts
517
+ var defaultDarkTheme = {
518
+ name: "default-dark",
519
+ mode: "dark",
520
+ colors: {
521
+ brand: {
522
+ primary: "#60a5fa",
523
+ secondary: "#818cf8",
524
+ accent: "#fbbf24",
525
+ background: "#0f172a",
526
+ foreground: "#f8fafc"
527
+ },
528
+ semantic: {
529
+ primary: "#60a5fa",
530
+ primaryHover: "#3b82f6",
531
+ primaryActive: "#2563eb",
532
+ primaryDisabled: "#1e3a5f",
533
+ secondary: "#818cf8",
534
+ secondaryHover: "#6366f1",
535
+ secondaryActive: "#4f46e5",
536
+ secondaryDisabled: "#312e81",
537
+ accent: "#fbbf24",
538
+ accentHover: "#f59e0b",
539
+ success: "#4ade80",
540
+ successHover: "#22c55e",
541
+ warning: "#fbbf24",
542
+ warningHover: "#f59e0b",
543
+ error: "#f87171",
544
+ errorHover: "#ef4444",
545
+ info: "#60a5fa",
546
+ infoHover: "#3b82f6"
547
+ },
548
+ background: {
549
+ default: "#0f172a",
550
+ paper: "#1e293b",
551
+ card: "#1e293b",
552
+ overlay: "rgba(0, 0, 0, 0.7)",
553
+ input: "#1e293b",
554
+ disabled: "#334155",
555
+ hover: "#334155",
556
+ selected: "#1e3a5f"
557
+ },
558
+ surface: {
559
+ light: "#334155",
560
+ main: "#1e293b",
561
+ dark: "#0f172a"
562
+ },
563
+ text: {
564
+ primary: "#f8fafc",
565
+ secondary: "#94a3b8",
566
+ disabled: "#64748b",
567
+ placeholder: "#64748b",
568
+ link: "#60a5fa",
569
+ linkHover: "#3b82f6",
570
+ inverse: "#0f172a",
571
+ onPrimary: "#0f172a",
572
+ onSecondary: "#0f172a"
573
+ },
574
+ border: {
575
+ default: "#334155",
576
+ light: "#475569",
577
+ dark: "#1e293b",
578
+ focus: "#60a5fa",
579
+ error: "#f87171",
580
+ success: "#4ade80",
581
+ disabled: "#334155"
582
+ }
583
+ },
584
+ shadows: {
585
+ none: "none",
586
+ xs: "0 1px 2px 0 rgb(0 0 0 / 0.3)",
587
+ sm: "0 1px 3px 0 rgb(0 0 0 / 0.4), 0 1px 2px -1px rgb(0 0 0 / 0.4)",
588
+ md: "0 4px 6px -1px rgb(0 0 0 / 0.4), 0 2px 4px -2px rgb(0 0 0 / 0.4)",
589
+ lg: "0 10px 15px -3px rgb(0 0 0 / 0.4), 0 4px 6px -4px rgb(0 0 0 / 0.4)",
590
+ xl: "0 20px 25px -5px rgb(0 0 0 / 0.4), 0 8px 10px -6px rgb(0 0 0 / 0.4)",
591
+ "2xl": "0 25px 50px -12px rgb(0 0 0 / 0.6)",
592
+ inner: "inset 0 2px 4px 0 rgb(0 0 0 / 0.3)",
593
+ button: "0 1px 3px 0 rgb(0 0 0 / 0.4)",
594
+ buttonHover: "0 4px 6px -1px rgb(0 0 0 / 0.4)",
595
+ card: "0 1px 3px 0 rgb(0 0 0 / 0.4)",
596
+ cardHover: "0 10px 15px -3px rgb(0 0 0 / 0.4)",
597
+ modal: "0 25px 50px -12px rgb(0 0 0 / 0.6)",
598
+ dropdown: "0 10px 15px -3px rgb(0 0 0 / 0.4)"
599
+ },
600
+ typography: {
601
+ fontFamily: {
602
+ sans: 'Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif',
603
+ serif: 'ui-serif, Georgia, Cambria, "Times New Roman", Times, serif',
604
+ mono: 'ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace',
605
+ heading: 'Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',
606
+ body: 'Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif'
607
+ },
608
+ fontSize: {
609
+ xs: "0.75rem",
610
+ sm: "0.875rem",
611
+ base: "1rem",
612
+ lg: "1.125rem",
613
+ xl: "1.25rem",
614
+ "2xl": "1.5rem",
615
+ "3xl": "1.875rem",
616
+ "4xl": "2.25rem",
617
+ "5xl": "3rem",
618
+ "6xl": "3.75rem"
619
+ },
620
+ fontWeight: {
621
+ light: 300,
622
+ normal: 400,
623
+ medium: 500,
624
+ semibold: 600,
625
+ bold: 700,
626
+ extrabold: 800
627
+ },
628
+ lineHeight: {
629
+ none: 1,
630
+ tight: 1.25,
631
+ snug: 1.375,
632
+ normal: 1.5,
633
+ relaxed: 1.625,
634
+ loose: 2
635
+ }
636
+ },
637
+ spacing: {
638
+ 0: "0",
639
+ px: "1px",
640
+ 0.5: "0.125rem",
641
+ 1: "0.25rem",
642
+ 1.5: "0.375rem",
643
+ 2: "0.5rem",
644
+ 2.5: "0.625rem",
645
+ 3: "0.75rem",
646
+ 3.5: "0.875rem",
647
+ 4: "1rem",
648
+ 5: "1.25rem",
649
+ 6: "1.5rem",
650
+ 7: "1.75rem",
651
+ 8: "2rem",
652
+ 9: "2.25rem",
653
+ 10: "2.5rem",
654
+ 11: "2.75rem",
655
+ 12: "3rem",
656
+ 14: "3.5rem",
657
+ 16: "4rem",
658
+ 20: "5rem",
659
+ 24: "6rem",
660
+ 28: "7rem",
661
+ 32: "8rem",
662
+ 36: "9rem",
663
+ 40: "10rem",
664
+ 44: "11rem",
665
+ 48: "12rem",
666
+ 52: "13rem",
667
+ 56: "14rem",
668
+ 60: "15rem",
669
+ 64: "16rem",
670
+ 72: "18rem",
671
+ 80: "20rem",
672
+ 96: "24rem"
673
+ },
674
+ borderRadius: {
675
+ none: "0",
676
+ sm: "0.125rem",
677
+ default: "0.25rem",
678
+ md: "0.375rem",
679
+ lg: "0.5rem",
680
+ xl: "0.75rem",
681
+ "2xl": "1rem",
682
+ "3xl": "1.5rem",
683
+ full: "9999px"
684
+ },
685
+ breakpoints: {
686
+ xs: "475px",
687
+ sm: "640px",
688
+ md: "768px",
689
+ lg: "1024px",
690
+ xl: "1280px",
691
+ "2xl": "1536px"
692
+ },
693
+ zIndex: {
694
+ hide: -1,
695
+ auto: "auto",
696
+ base: 0,
697
+ dropdown: 1e3,
698
+ sticky: 1020,
699
+ fixed: 1030,
700
+ modalBackdrop: 1040,
701
+ modal: 1050,
702
+ popover: 1060,
703
+ tooltip: 1070,
704
+ toast: 1080
705
+ },
706
+ transitions: {
707
+ none: "none",
708
+ fast: "150ms ease-in-out",
709
+ normal: "200ms ease-in-out",
710
+ slow: "300ms ease-in-out",
711
+ slower: "500ms ease-in-out",
712
+ colors: "color 200ms ease-in-out, background-color 200ms ease-in-out, border-color 200ms ease-in-out",
713
+ transform: "transform 200ms ease-in-out",
714
+ opacity: "opacity 200ms ease-in-out",
715
+ shadow: "box-shadow 200ms ease-in-out",
716
+ all: "all 200ms ease-in-out"
717
+ },
718
+ components: {
719
+ button: {
720
+ bg: "#60a5fa",
721
+ bgHover: "#3b82f6",
722
+ bgActive: "#2563eb",
723
+ bgDisabled: "#1e3a5f",
724
+ color: "#0f172a",
725
+ colorHover: "#0f172a",
726
+ colorDisabled: "#64748b",
727
+ border: "transparent",
728
+ borderHover: "transparent",
729
+ borderWidth: "1px",
730
+ borderRadius: "0.375rem",
731
+ shadow: "0 1px 3px 0 rgb(0 0 0 / 0.4)",
732
+ shadowHover: "0 4px 6px -1px rgb(0 0 0 / 0.4)",
733
+ paddingX: "1rem",
734
+ paddingY: "0.5rem",
735
+ fontSize: "0.875rem",
736
+ fontWeight: 500,
737
+ variants: {
738
+ primary: {
739
+ bg: "#60a5fa",
740
+ bgHover: "#3b82f6",
741
+ color: "#0f172a"
742
+ },
743
+ secondary: {
744
+ bg: "#818cf8",
745
+ bgHover: "#6366f1",
746
+ color: "#0f172a"
747
+ },
748
+ outline: {
749
+ bg: "transparent",
750
+ bgHover: "#334155",
751
+ color: "#f8fafc",
752
+ border: "#475569",
753
+ borderHover: "#64748b"
754
+ },
755
+ ghost: {
756
+ bg: "transparent",
757
+ bgHover: "#334155",
758
+ color: "#f8fafc",
759
+ shadow: "none",
760
+ shadowHover: "none"
761
+ },
762
+ link: {
763
+ bg: "transparent",
764
+ bgHover: "transparent",
765
+ color: "#60a5fa",
766
+ colorHover: "#3b82f6",
767
+ shadow: "none",
768
+ shadowHover: "none",
769
+ paddingX: "0",
770
+ paddingY: "0"
771
+ },
772
+ danger: {
773
+ bg: "#f87171",
774
+ bgHover: "#ef4444",
775
+ color: "#0f172a"
776
+ },
777
+ success: {
778
+ bg: "#4ade80",
779
+ bgHover: "#22c55e",
780
+ color: "#0f172a"
781
+ }
782
+ },
783
+ sizes: {
784
+ xs: {
785
+ paddingX: "0.5rem",
786
+ paddingY: "0.25rem",
787
+ fontSize: "0.75rem"
788
+ },
789
+ sm: {
790
+ paddingX: "0.75rem",
791
+ paddingY: "0.375rem",
792
+ fontSize: "0.875rem"
793
+ },
794
+ md: {
795
+ paddingX: "1rem",
796
+ paddingY: "0.5rem",
797
+ fontSize: "0.875rem"
798
+ },
799
+ lg: {
800
+ paddingX: "1.25rem",
801
+ paddingY: "0.625rem",
802
+ fontSize: "1rem"
803
+ },
804
+ xl: {
805
+ paddingX: "1.5rem",
806
+ paddingY: "0.75rem",
807
+ fontSize: "1.125rem"
808
+ }
809
+ }
810
+ },
811
+ input: {
812
+ bg: "#1e293b",
813
+ bgFocus: "#1e293b",
814
+ bgDisabled: "#334155",
815
+ bgError: "#450a0a",
816
+ color: "#f8fafc",
817
+ colorPlaceholder: "#64748b",
818
+ colorDisabled: "#64748b",
819
+ border: "#475569",
820
+ borderFocus: "#60a5fa",
821
+ borderError: "#f87171",
822
+ borderWidth: "1px",
823
+ borderRadius: "0.375rem",
824
+ shadow: "0 1px 2px 0 rgb(0 0 0 / 0.3)",
825
+ shadowFocus: "0 0 0 3px rgb(96 165 250 / 0.2)",
826
+ paddingX: "0.75rem",
827
+ paddingY: "0.5rem",
828
+ fontSize: "0.875rem",
829
+ labelColor: "#e2e8f0",
830
+ labelFontSize: "0.875rem",
831
+ labelFontWeight: 500,
832
+ helperColor: "#94a3b8",
833
+ errorColor: "#f87171",
834
+ sizes: {
835
+ sm: {
836
+ paddingX: "0.5rem",
837
+ paddingY: "0.375rem",
838
+ fontSize: "0.75rem"
839
+ },
840
+ md: {
841
+ paddingX: "0.75rem",
842
+ paddingY: "0.5rem",
843
+ fontSize: "0.875rem"
844
+ },
845
+ lg: {
846
+ paddingX: "1rem",
847
+ paddingY: "0.625rem",
848
+ fontSize: "1rem"
849
+ }
850
+ }
851
+ },
852
+ card: {
853
+ bg: "#1e293b",
854
+ bgHover: "#1e293b",
855
+ border: "#334155",
856
+ borderWidth: "1px",
857
+ borderRadius: "0.5rem",
858
+ shadow: "0 1px 3px 0 rgb(0 0 0 / 0.4)",
859
+ shadowHover: "0 10px 15px -3px rgb(0 0 0 / 0.4)",
860
+ padding: "1.5rem",
861
+ headerBg: "#0f172a",
862
+ headerBorder: "#334155",
863
+ headerPadding: "1rem 1.5rem",
864
+ footerBg: "#0f172a",
865
+ footerBorder: "#334155",
866
+ footerPadding: "1rem 1.5rem"
867
+ },
868
+ header: {
869
+ bg: "#0f172a",
870
+ bgScrolled: "rgba(15, 23, 42, 0.95)",
871
+ color: "#f8fafc",
872
+ border: "#334155",
873
+ shadow: "none",
874
+ shadowScrolled: "0 1px 3px 0 rgb(0 0 0 / 0.4)",
875
+ height: "4rem",
876
+ paddingX: "1.5rem",
877
+ logoHeight: "2rem",
878
+ navColor: "#94a3b8",
879
+ navColorHover: "#f8fafc",
880
+ navColorActive: "#60a5fa",
881
+ navFontSize: "0.875rem",
882
+ navFontWeight: 500,
883
+ mobileMenuBg: "#1e293b",
884
+ mobileMenuShadow: "0 10px 15px -3px rgb(0 0 0 / 0.4)"
885
+ },
886
+ footer: {
887
+ bg: "#020617",
888
+ color: "#94a3b8",
889
+ colorMuted: "#64748b",
890
+ border: "#1e293b",
891
+ padding: "4rem 1.5rem",
892
+ linkColor: "#94a3b8",
893
+ linkColorHover: "#f8fafc",
894
+ headingColor: "#f8fafc",
895
+ headingFontSize: "1rem",
896
+ headingFontWeight: 600,
897
+ copyrightBg: "#0f172a",
898
+ copyrightColor: "#64748b"
899
+ },
900
+ banner: {
901
+ bg: "#1e3a5f",
902
+ color: "#bfdbfe",
903
+ border: "#3b82f6",
904
+ borderRadius: "0.5rem",
905
+ padding: "1rem 1.5rem",
906
+ shadow: "none",
907
+ closeBg: "transparent",
908
+ closeColor: "#bfdbfe",
909
+ variants: {
910
+ info: {
911
+ bg: "#1e3a5f",
912
+ color: "#bfdbfe",
913
+ border: "#3b82f6"
914
+ },
915
+ success: {
916
+ bg: "#14532d",
917
+ color: "#bbf7d0",
918
+ border: "#22c55e"
919
+ },
920
+ warning: {
921
+ bg: "#78350f",
922
+ color: "#fde68a",
923
+ border: "#f59e0b"
924
+ },
925
+ error: {
926
+ bg: "#7f1d1d",
927
+ color: "#fecaca",
928
+ border: "#ef4444"
929
+ },
930
+ promo: {
931
+ bg: "#581c87",
932
+ color: "#e9d5ff",
933
+ border: "#a855f7"
934
+ }
935
+ }
936
+ },
937
+ loader: {
938
+ color: "#60a5fa",
939
+ colorSecondary: "#334155",
940
+ size: "2.5rem",
941
+ borderWidth: "3px",
942
+ overlayBg: "rgba(15, 23, 42, 0.8)",
943
+ overlayOpacity: 1,
944
+ sizes: {
945
+ xs: "1rem",
946
+ sm: "1.5rem",
947
+ md: "2.5rem",
948
+ lg: "3.5rem",
949
+ xl: "5rem"
950
+ }
951
+ },
952
+ modal: {
953
+ bg: "#1e293b",
954
+ color: "#f8fafc",
955
+ border: "#334155",
956
+ borderRadius: "0.5rem",
957
+ shadow: "0 25px 50px -12px rgb(0 0 0 / 0.6)",
958
+ padding: "1.5rem",
959
+ overlayBg: "rgba(0, 0, 0, 0.7)",
960
+ overlayOpacity: 1,
961
+ headerBg: "#1e293b",
962
+ headerBorder: "#334155",
963
+ headerPadding: "1rem 1.5rem",
964
+ footerBg: "#0f172a",
965
+ footerBorder: "#334155",
966
+ footerPadding: "1rem 1.5rem",
967
+ closeBg: "transparent",
968
+ closeColor: "#94a3b8",
969
+ closeHoverBg: "#334155",
970
+ sizes: {
971
+ sm: "24rem",
972
+ md: "32rem",
973
+ lg: "48rem",
974
+ xl: "64rem",
975
+ full: "100%"
976
+ }
977
+ },
978
+ toast: {
979
+ bg: "#1e293b",
980
+ color: "#f8fafc",
981
+ border: "#334155",
982
+ borderRadius: "0.5rem",
983
+ shadow: "0 10px 15px -3px rgb(0 0 0 / 0.4)",
984
+ padding: "1rem",
985
+ variants: {
986
+ success: {
987
+ bg: "#14532d",
988
+ color: "#bbf7d0",
989
+ border: "#22c55e"
990
+ },
991
+ error: {
992
+ bg: "#7f1d1d",
993
+ color: "#fecaca",
994
+ border: "#ef4444"
995
+ },
996
+ warning: {
997
+ bg: "#78350f",
998
+ color: "#fde68a",
999
+ border: "#f59e0b"
1000
+ },
1001
+ info: {
1002
+ bg: "#1e3a5f",
1003
+ color: "#bfdbfe",
1004
+ border: "#3b82f6"
1005
+ }
1006
+ }
1007
+ },
1008
+ newsletter: {
1009
+ bg: "#1e293b",
1010
+ color: "#f8fafc",
1011
+ border: "#334155",
1012
+ borderRadius: "0.5rem",
1013
+ padding: "2rem",
1014
+ titleColor: "#f8fafc",
1015
+ titleFontSize: "1.5rem",
1016
+ descColor: "#94a3b8",
1017
+ descFontSize: "1rem",
1018
+ inputBg: "#0f172a",
1019
+ inputBorder: "#475569",
1020
+ buttonBg: "#60a5fa",
1021
+ buttonColor: "#0f172a"
1022
+ }
1023
+ }
1024
+ };
1025
+
1026
+ // src/client/web/theme/theme-utils.ts
1027
+ function deepMerge(target, source) {
1028
+ const output = { ...target };
1029
+ for (const key in source) {
1030
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
1031
+ const sourceValue = source[key];
1032
+ const targetValue = target[key];
1033
+ if (sourceValue && typeof sourceValue === "object" && !Array.isArray(sourceValue) && targetValue && typeof targetValue === "object" && !Array.isArray(targetValue)) {
1034
+ output[key] = deepMerge(
1035
+ targetValue,
1036
+ sourceValue
1037
+ );
1038
+ } else if (sourceValue !== void 0) {
1039
+ output[key] = sourceValue;
1040
+ }
1041
+ }
1042
+ }
1043
+ return output;
1044
+ }
1045
+ function createThemeFromBrand(brand, baseTheme = defaultLightTheme) {
1046
+ const { colors } = brand;
1047
+ const brandOverrides = {
1048
+ brand,
1049
+ colors: {
1050
+ brand: {
1051
+ primary: colors.primary,
1052
+ secondary: colors.secondary,
1053
+ accent: colors.accent || colors.primary,
1054
+ background: colors.background || baseTheme.colors.background.default,
1055
+ foreground: colors.foreground || baseTheme.colors.text.primary
1056
+ },
1057
+ semantic: {
1058
+ primary: colors.primary,
1059
+ primaryHover: adjustColor(colors.primary, -10),
1060
+ primaryActive: adjustColor(colors.primary, -20),
1061
+ primaryDisabled: adjustColor(colors.primary, 40),
1062
+ secondary: colors.secondary,
1063
+ secondaryHover: adjustColor(colors.secondary, -10),
1064
+ secondaryActive: adjustColor(colors.secondary, -20),
1065
+ secondaryDisabled: adjustColor(colors.secondary, 40),
1066
+ accent: colors.accent || colors.primary,
1067
+ accentHover: adjustColor(colors.accent || colors.primary, -10)
1068
+ }
1069
+ },
1070
+ components: {
1071
+ button: {
1072
+ bg: colors.primary,
1073
+ bgHover: adjustColor(colors.primary, -10),
1074
+ bgActive: adjustColor(colors.primary, -20),
1075
+ variants: {
1076
+ primary: {
1077
+ bg: colors.primary,
1078
+ bgHover: adjustColor(colors.primary, -10)
1079
+ },
1080
+ secondary: {
1081
+ bg: colors.secondary,
1082
+ bgHover: adjustColor(colors.secondary, -10)
1083
+ }
1084
+ }
1085
+ },
1086
+ input: {
1087
+ borderFocus: colors.primary
1088
+ },
1089
+ header: {
1090
+ navColorActive: colors.primary
1091
+ },
1092
+ loader: {
1093
+ color: colors.primary
1094
+ },
1095
+ newsletter: {
1096
+ buttonBg: colors.primary
1097
+ }
1098
+ }
1099
+ };
1100
+ return deepMerge(baseTheme, brandOverrides);
1101
+ }
1102
+ function adjustColor(hex, percent) {
1103
+ hex = hex.replace(/^#/, "");
1104
+ let r = parseInt(hex.substring(0, 2), 16);
1105
+ let g = parseInt(hex.substring(2, 4), 16);
1106
+ let b = parseInt(hex.substring(4, 6), 16);
1107
+ r = Math.min(255, Math.max(0, r + r * percent / 100));
1108
+ g = Math.min(255, Math.max(0, g + g * percent / 100));
1109
+ b = Math.min(255, Math.max(0, b + b * percent / 100));
1110
+ const toHex = (n) => Math.round(n).toString(16).padStart(2, "0");
1111
+ return `#${toHex(r)}${toHex(g)}${toHex(b)}`;
1112
+ }
1113
+ function hexToRgba(hex, alpha = 1) {
1114
+ hex = hex.replace(/^#/, "");
1115
+ const r = parseInt(hex.substring(0, 2), 16);
1116
+ const g = parseInt(hex.substring(2, 4), 16);
1117
+ const b = parseInt(hex.substring(4, 6), 16);
1118
+ return `rgba(${r}, ${g}, ${b}, ${alpha})`;
1119
+ }
1120
+ function getContrastColor(hex) {
1121
+ hex = hex.replace(/^#/, "");
1122
+ const r = parseInt(hex.substring(0, 2), 16);
1123
+ const g = parseInt(hex.substring(2, 4), 16);
1124
+ const b = parseInt(hex.substring(4, 6), 16);
1125
+ const luminance = (0.299 * r + 0.587 * g + 0.114 * b) / 255;
1126
+ return luminance > 0.5 ? "#000000" : "#ffffff";
1127
+ }
1128
+ function flattenToCssVars(obj, prefix = "--ec") {
1129
+ const result = {};
1130
+ function flatten(current, path = []) {
1131
+ for (const key in current) {
1132
+ if (Object.prototype.hasOwnProperty.call(current, key)) {
1133
+ const value = current[key];
1134
+ const newPath = [...path, key];
1135
+ const varName = `${prefix}-${newPath.join("-")}`;
1136
+ if (value && typeof value === "object" && !Array.isArray(value)) {
1137
+ flatten(value, newPath);
1138
+ } else if (typeof value === "string" || typeof value === "number") {
1139
+ result[varName] = String(value);
1140
+ }
1141
+ }
1142
+ }
1143
+ }
1144
+ flatten(obj);
1145
+ return result;
1146
+ }
1147
+ function generateCssVars(theme, prefix = "--ec") {
1148
+ const cssVars = flattenToCssVars(theme, prefix);
1149
+ return Object.entries(cssVars).map(([key, value]) => `${key}: ${value};`).join("\n");
1150
+ }
1151
+ function injectCssVars(theme, prefix = "--ec") {
1152
+ if (typeof document === "undefined") return;
1153
+ const cssVars = flattenToCssVars(theme, prefix);
1154
+ const root = document.documentElement;
1155
+ for (const [key, value] of Object.entries(cssVars)) {
1156
+ root.style.setProperty(key, value);
1157
+ }
1158
+ }
1159
+ function removeCssVars(prefix = "--ec") {
1160
+ if (typeof document === "undefined") return;
1161
+ const root = document.documentElement;
1162
+ const style = root.style;
1163
+ for (let i = style.length - 1; i >= 0; i--) {
1164
+ const name = style[i];
1165
+ if (name.startsWith(prefix)) {
1166
+ root.style.removeProperty(name);
1167
+ }
1168
+ }
1169
+ }
1170
+ async function loadThemeFromUrl(url) {
1171
+ try {
1172
+ const response = await fetch(url, {
1173
+ headers: {
1174
+ Accept: "application/json"
1175
+ }
1176
+ });
1177
+ if (!response.ok) {
1178
+ console.error(`Failed to load theme from ${url}: ${response.status}`);
1179
+ return null;
1180
+ }
1181
+ const themeData = await response.json();
1182
+ return themeData;
1183
+ } catch (error) {
1184
+ console.error(`Error loading theme from ${url}:`, error);
1185
+ return null;
1186
+ }
1187
+ }
1188
+ async function createTheme(config = {}) {
1189
+ let lightTheme = { ...defaultLightTheme };
1190
+ let darkTheme = { ...defaultDarkTheme };
1191
+ if (config.themeUrl) {
1192
+ const urlTheme = await loadThemeFromUrl(config.themeUrl);
1193
+ if (urlTheme) {
1194
+ lightTheme = deepMerge(lightTheme, urlTheme);
1195
+ darkTheme = deepMerge(darkTheme, urlTheme);
1196
+ }
1197
+ }
1198
+ if (config.brandIdentity) {
1199
+ lightTheme = createThemeFromBrand(config.brandIdentity, lightTheme);
1200
+ darkTheme = createThemeFromBrand(config.brandIdentity, darkTheme);
1201
+ }
1202
+ if (config.light) {
1203
+ lightTheme = deepMerge(lightTheme, config.light);
1204
+ }
1205
+ if (config.dark) {
1206
+ darkTheme = deepMerge(darkTheme, config.dark);
1207
+ }
1208
+ return { light: lightTheme, dark: darkTheme };
1209
+ }
1210
+ var DEFAULT_STORAGE_KEY = "ec-theme-mode";
1211
+ function saveThemeMode(mode, storageKey = DEFAULT_STORAGE_KEY) {
1212
+ if (typeof localStorage === "undefined") return;
1213
+ try {
1214
+ localStorage.setItem(storageKey, mode);
1215
+ } catch (error) {
1216
+ console.error("Failed to save theme mode:", error);
1217
+ }
1218
+ }
1219
+ function loadThemeMode(storageKey = DEFAULT_STORAGE_KEY) {
1220
+ if (typeof localStorage === "undefined") return null;
1221
+ try {
1222
+ const mode = localStorage.getItem(storageKey);
1223
+ if (mode === "light" || mode === "dark" || mode === "system") {
1224
+ return mode;
1225
+ }
1226
+ return null;
1227
+ } catch (error) {
1228
+ console.error("Failed to load theme mode:", error);
1229
+ return null;
1230
+ }
1231
+ }
1232
+ function getSystemColorScheme() {
1233
+ if (typeof window === "undefined") return "light";
1234
+ return window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
1235
+ }
1236
+ function resolveThemeMode(mode) {
1237
+ if (mode === "system") {
1238
+ return getSystemColorScheme();
1239
+ }
1240
+ return mode;
1241
+ }
1242
+ var ThemeContext = createContext(null);
1243
+ function useTheme() {
1244
+ const context = useContext(ThemeContext);
1245
+ if (!context) {
1246
+ throw new Error("useTheme must be used within a ThemeProvider");
1247
+ }
1248
+ return context;
1249
+ }
1250
+ function ThemeProvider({
1251
+ children,
1252
+ config = {},
1253
+ initialTheme
1254
+ }) {
1255
+ const {
1256
+ defaultMode = "system",
1257
+ themeUrl,
1258
+ light: lightOverrides,
1259
+ dark: darkOverrides,
1260
+ brandIdentity,
1261
+ enableSystemTheme = true,
1262
+ persistTheme = true,
1263
+ storageKey = "ec-theme-mode",
1264
+ cssVarPrefix = "--ec"
1265
+ } = config;
1266
+ const [mode, setModeState] = useState(() => {
1267
+ if (persistTheme && typeof window !== "undefined") {
1268
+ const savedMode = loadThemeMode(storageKey);
1269
+ if (savedMode) return savedMode;
1270
+ }
1271
+ return defaultMode;
1272
+ });
1273
+ const [lightTheme, setLightTheme] = useState(() => {
1274
+ if (initialTheme && initialTheme.mode === "light") return initialTheme;
1275
+ let theme2 = defaultLightTheme;
1276
+ if (brandIdentity) {
1277
+ theme2 = createThemeFromBrand(brandIdentity, theme2);
1278
+ }
1279
+ if (lightOverrides) {
1280
+ theme2 = deepMerge(theme2, lightOverrides);
1281
+ }
1282
+ return theme2;
1283
+ });
1284
+ const [darkTheme, setDarkTheme] = useState(() => {
1285
+ if (initialTheme && initialTheme.mode === "dark") return initialTheme;
1286
+ let theme2 = defaultDarkTheme;
1287
+ if (brandIdentity) {
1288
+ theme2 = createThemeFromBrand(brandIdentity, theme2);
1289
+ }
1290
+ if (darkOverrides) {
1291
+ theme2 = deepMerge(theme2, darkOverrides);
1292
+ }
1293
+ return theme2;
1294
+ });
1295
+ const [isLoading, setIsLoading] = useState(!!themeUrl);
1296
+ const [error, setError] = useState(null);
1297
+ const resolvedMode = useMemo(() => resolveThemeMode(mode), [mode]);
1298
+ const theme = useMemo(
1299
+ () => resolvedMode === "dark" ? darkTheme : lightTheme,
1300
+ [resolvedMode, lightTheme, darkTheme]
1301
+ );
1302
+ const isDark = resolvedMode === "dark";
1303
+ const isLight = resolvedMode === "light";
1304
+ useEffect(() => {
1305
+ if (!themeUrl) return;
1306
+ setIsLoading(true);
1307
+ setError(null);
1308
+ loadThemeFromUrl(themeUrl).then((urlTheme) => {
1309
+ if (urlTheme) {
1310
+ setLightTheme((prev) => deepMerge(prev, urlTheme));
1311
+ setDarkTheme((prev) => deepMerge(prev, urlTheme));
1312
+ }
1313
+ }).catch((err) => {
1314
+ setError(err instanceof Error ? err.message : "Failed to load theme");
1315
+ }).finally(() => {
1316
+ setIsLoading(false);
1317
+ });
1318
+ }, [themeUrl]);
1319
+ useEffect(() => {
1320
+ if (typeof window !== "undefined") {
1321
+ injectCssVars(theme, cssVarPrefix);
1322
+ }
1323
+ }, [theme, cssVarPrefix]);
1324
+ useEffect(() => {
1325
+ if (typeof document !== "undefined") {
1326
+ document.documentElement.setAttribute("data-theme", resolvedMode);
1327
+ document.documentElement.style.colorScheme = resolvedMode;
1328
+ }
1329
+ }, [resolvedMode]);
1330
+ useEffect(() => {
1331
+ if (!enableSystemTheme || typeof window === "undefined") return;
1332
+ const mediaQuery = window.matchMedia("(prefers-color-scheme: dark)");
1333
+ const handleChange = () => {
1334
+ if (mode === "system") {
1335
+ setModeState("system");
1336
+ }
1337
+ };
1338
+ mediaQuery.addEventListener("change", handleChange);
1339
+ return () => mediaQuery.removeEventListener("change", handleChange);
1340
+ }, [mode, enableSystemTheme]);
1341
+ useEffect(() => {
1342
+ if (persistTheme && typeof window !== "undefined") {
1343
+ saveThemeMode(mode, storageKey);
1344
+ }
1345
+ }, [mode, persistTheme, storageKey]);
1346
+ const setMode = useCallback((newMode) => {
1347
+ setModeState(newMode);
1348
+ }, []);
1349
+ const toggleMode = useCallback(() => {
1350
+ setModeState((prev) => {
1351
+ const current = resolveThemeMode(prev);
1352
+ return current === "dark" ? "light" : "dark";
1353
+ });
1354
+ }, []);
1355
+ const updateTheme = useCallback((updates) => {
1356
+ setLightTheme((prev) => deepMerge(prev, updates));
1357
+ setDarkTheme((prev) => deepMerge(prev, updates));
1358
+ }, []);
1359
+ const resetTheme = useCallback(() => {
1360
+ let light = defaultLightTheme;
1361
+ let dark = defaultDarkTheme;
1362
+ if (brandIdentity) {
1363
+ light = createThemeFromBrand(brandIdentity, light);
1364
+ dark = createThemeFromBrand(brandIdentity, dark);
1365
+ }
1366
+ if (lightOverrides) {
1367
+ light = deepMerge(light, lightOverrides);
1368
+ }
1369
+ if (darkOverrides) {
1370
+ dark = deepMerge(dark, darkOverrides);
1371
+ }
1372
+ setLightTheme(light);
1373
+ setDarkTheme(dark);
1374
+ }, [brandIdentity, lightOverrides, darkOverrides]);
1375
+ const contextValue = useMemo(
1376
+ () => ({
1377
+ theme,
1378
+ mode,
1379
+ setMode,
1380
+ toggleMode,
1381
+ updateTheme,
1382
+ resetTheme,
1383
+ isDark,
1384
+ isLight,
1385
+ isLoading,
1386
+ error
1387
+ }),
1388
+ [theme, mode, setMode, toggleMode, updateTheme, resetTheme, isDark, isLight, isLoading, error]
1389
+ );
1390
+ return /* @__PURE__ */ jsx(ThemeContext.Provider, { value: contextValue, children });
1391
+ }
1392
+ function cssVar(path, prefix = "--ec") {
1393
+ return `var(${prefix}-${path.replace(/\./g, "-")})`;
1394
+ }
1395
+ function useThemeValue(selector) {
1396
+ const { theme } = useTheme();
1397
+ return selector(theme);
1398
+ }
1399
+ function ThemeToggle({
1400
+ className = "",
1401
+ size = 24,
1402
+ showLabel = false,
1403
+ lightLabel = "Light",
1404
+ darkLabel = "Dark"
1405
+ }) {
1406
+ const { isDark, toggleMode } = useTheme();
1407
+ return /* @__PURE__ */ jsxs(
1408
+ "button",
1409
+ {
1410
+ type: "button",
1411
+ onClick: toggleMode,
1412
+ className: `ec-theme-toggle ${className}`,
1413
+ "aria-label": isDark ? "Switch to light mode" : "Switch to dark mode",
1414
+ style: {
1415
+ background: "none",
1416
+ border: "none",
1417
+ cursor: "pointer",
1418
+ display: "inline-flex",
1419
+ alignItems: "center",
1420
+ gap: "0.5rem",
1421
+ padding: "0.5rem",
1422
+ borderRadius: "0.375rem",
1423
+ transition: "background-color 200ms ease-in-out"
1424
+ },
1425
+ children: [
1426
+ isDark ? (
1427
+ // Sun icon for dark mode (click to go light)
1428
+ /* @__PURE__ */ jsxs(
1429
+ "svg",
1430
+ {
1431
+ width: size,
1432
+ height: size,
1433
+ viewBox: "0 0 24 24",
1434
+ fill: "none",
1435
+ stroke: "currentColor",
1436
+ strokeWidth: "2",
1437
+ strokeLinecap: "round",
1438
+ strokeLinejoin: "round",
1439
+ children: [
1440
+ /* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", r: "5" }),
1441
+ /* @__PURE__ */ jsx("line", { x1: "12", y1: "1", x2: "12", y2: "3" }),
1442
+ /* @__PURE__ */ jsx("line", { x1: "12", y1: "21", x2: "12", y2: "23" }),
1443
+ /* @__PURE__ */ jsx("line", { x1: "4.22", y1: "4.22", x2: "5.64", y2: "5.64" }),
1444
+ /* @__PURE__ */ jsx("line", { x1: "18.36", y1: "18.36", x2: "19.78", y2: "19.78" }),
1445
+ /* @__PURE__ */ jsx("line", { x1: "1", y1: "12", x2: "3", y2: "12" }),
1446
+ /* @__PURE__ */ jsx("line", { x1: "21", y1: "12", x2: "23", y2: "12" }),
1447
+ /* @__PURE__ */ jsx("line", { x1: "4.22", y1: "19.78", x2: "5.64", y2: "18.36" }),
1448
+ /* @__PURE__ */ jsx("line", { x1: "18.36", y1: "5.64", x2: "19.78", y2: "4.22" })
1449
+ ]
1450
+ }
1451
+ )
1452
+ ) : (
1453
+ // Moon icon for light mode (click to go dark)
1454
+ /* @__PURE__ */ jsx(
1455
+ "svg",
1456
+ {
1457
+ width: size,
1458
+ height: size,
1459
+ viewBox: "0 0 24 24",
1460
+ fill: "none",
1461
+ stroke: "currentColor",
1462
+ strokeWidth: "2",
1463
+ strokeLinecap: "round",
1464
+ strokeLinejoin: "round",
1465
+ children: /* @__PURE__ */ jsx("path", { d: "M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z" })
1466
+ }
1467
+ )
1468
+ ),
1469
+ showLabel && /* @__PURE__ */ jsx("span", { children: isDark ? darkLabel : lightLabel })
1470
+ ]
1471
+ }
1472
+ );
1473
+ }
1474
+
1475
+ // src/client/web/astro/types.ts
1476
+ function dummyImage(width, height, text, bgColor = "cccccc", textColor = "969696") {
1477
+ const label = text ? `&text=${encodeURIComponent(text)}` : "";
1478
+ return `https://dummyimage.com/${width}x${height}/${bgColor}/${textColor}${label}`;
1479
+ }
1480
+ function loremIpsum(type = "paragraph", count = 1) {
1481
+ const words = [
1482
+ "lorem",
1483
+ "ipsum",
1484
+ "dolor",
1485
+ "sit",
1486
+ "amet",
1487
+ "consectetur",
1488
+ "adipiscing",
1489
+ "elit",
1490
+ "sed",
1491
+ "do",
1492
+ "eiusmod",
1493
+ "tempor",
1494
+ "incididunt",
1495
+ "ut",
1496
+ "labore",
1497
+ "et",
1498
+ "dolore",
1499
+ "magna",
1500
+ "aliqua",
1501
+ "enim",
1502
+ "ad",
1503
+ "minim",
1504
+ "veniam",
1505
+ "quis",
1506
+ "nostrud",
1507
+ "exercitation",
1508
+ "ullamco",
1509
+ "laboris",
1510
+ "nisi",
1511
+ "aliquip",
1512
+ "ex",
1513
+ "ea",
1514
+ "commodo",
1515
+ "consequat",
1516
+ "duis",
1517
+ "aute",
1518
+ "irure",
1519
+ "in",
1520
+ "reprehenderit",
1521
+ "voluptate",
1522
+ "velit",
1523
+ "esse",
1524
+ "cillum",
1525
+ "fugiat",
1526
+ "nulla",
1527
+ "pariatur",
1528
+ "excepteur",
1529
+ "sint",
1530
+ "occaecat",
1531
+ "cupidatat",
1532
+ "non",
1533
+ "proident",
1534
+ "sunt",
1535
+ "culpa",
1536
+ "qui",
1537
+ "officia",
1538
+ "deserunt",
1539
+ "mollit",
1540
+ "anim",
1541
+ "id",
1542
+ "est",
1543
+ "laborum"
1544
+ ];
1545
+ const getWords = (n) => {
1546
+ const result = [];
1547
+ for (let i = 0; i < n; i++) {
1548
+ result.push(words[Math.floor(Math.random() * words.length)]);
1549
+ }
1550
+ return result;
1551
+ };
1552
+ const capitalize = (str) => str.charAt(0).toUpperCase() + str.slice(1);
1553
+ if (type === "word") {
1554
+ return getWords(count).join(" ");
1555
+ }
1556
+ if (type === "sentence") {
1557
+ const sentences = [];
1558
+ for (let i = 0; i < count; i++) {
1559
+ const sentence = capitalize(getWords(Math.floor(Math.random() * 10) + 5).join(" ")) + ".";
1560
+ sentences.push(sentence);
1561
+ }
1562
+ return sentences.join(" ");
1563
+ }
1564
+ const paragraphs = [];
1565
+ for (let i = 0; i < count; i++) {
1566
+ const sentences = [];
1567
+ const sentenceCount = Math.floor(Math.random() * 4) + 3;
1568
+ for (let j = 0; j < sentenceCount; j++) {
1569
+ sentences.push(capitalize(getWords(Math.floor(Math.random() * 10) + 5).join(" ")) + ".");
1570
+ }
1571
+ paragraphs.push(sentences.join(" "));
1572
+ }
1573
+ return paragraphs.join("\n\n");
1574
+ }
1575
+ var dummyHeaderData = {
1576
+ logo: dummyImage(120, 40, "Logo"),
1577
+ logoAlt: "Company Logo",
1578
+ navLinks: [
1579
+ { text: "Home", href: "/", active: true },
1580
+ { text: "About", href: "/about" },
1581
+ { text: "Services", href: "/services" },
1582
+ { text: "Blog", href: "/blog" },
1583
+ { text: "Contact", href: "/contact" }
1584
+ ],
1585
+ cta: {
1586
+ text: "Get Started",
1587
+ href: "/signup",
1588
+ variant: "primary"
1589
+ },
1590
+ sticky: true
1591
+ };
1592
+ var dummyFooterData = {
1593
+ logo: dummyImage(120, 40, "Logo"),
1594
+ logoAlt: "Company Logo",
1595
+ description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore.",
1596
+ columns: [
1597
+ {
1598
+ title: "Product",
1599
+ links: [
1600
+ { text: "Features", href: "/features" },
1601
+ { text: "Pricing", href: "/pricing" },
1602
+ { text: "Integrations", href: "/integrations" },
1603
+ { text: "API", href: "/api" }
1604
+ ]
1605
+ },
1606
+ {
1607
+ title: "Company",
1608
+ links: [
1609
+ { text: "About", href: "/about" },
1610
+ { text: "Blog", href: "/blog" },
1611
+ { text: "Careers", href: "/careers" },
1612
+ { text: "Contact", href: "/contact" }
1613
+ ]
1614
+ },
1615
+ {
1616
+ title: "Legal",
1617
+ links: [
1618
+ { text: "Privacy Policy", href: "/privacy" },
1619
+ { text: "Terms of Service", href: "/terms" },
1620
+ { text: "Cookie Policy", href: "/cookies" }
1621
+ ]
1622
+ }
1623
+ ],
1624
+ socialLinks: [
1625
+ { platform: "twitter", href: "https://twitter.com" },
1626
+ { platform: "facebook", href: "https://facebook.com" },
1627
+ { platform: "instagram", href: "https://instagram.com" },
1628
+ { platform: "linkedin", href: "https://linkedin.com" },
1629
+ { platform: "github", href: "https://github.com" }
1630
+ ],
1631
+ copyright: `\xA9 ${(/* @__PURE__ */ new Date()).getFullYear()} Company Name. All rights reserved.`
1632
+ };
1633
+ var dummyBannerData = {
1634
+ title: "Build Something Amazing Today",
1635
+ subtitle: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.",
1636
+ backgroundImage: dummyImage(1920, 800, "Hero+Background", "1e293b", "334155"),
1637
+ primaryCta: {
1638
+ text: "Get Started Free",
1639
+ href: "/signup",
1640
+ variant: "primary"
1641
+ },
1642
+ secondaryCta: {
1643
+ text: "Learn More",
1644
+ href: "/about",
1645
+ variant: "outline"
1646
+ },
1647
+ height: "lg",
1648
+ align: "center"
1649
+ };
1650
+ var dummyFeatures = [
1651
+ {
1652
+ title: "Lightning Fast",
1653
+ description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
1654
+ icon: '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 10V3L4 14h7v7l9-11h-7z" /></svg>'
1655
+ },
1656
+ {
1657
+ title: "Secure & Reliable",
1658
+ description: "Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.",
1659
+ icon: '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z" /></svg>'
1660
+ },
1661
+ {
1662
+ title: "Easy to Use",
1663
+ description: "Ut enim ad minim veniam, quis nostrud exercitation ullamco.",
1664
+ icon: '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z" /></svg>'
1665
+ }
1666
+ ];
1667
+ var dummyTestimonials = [
1668
+ {
1669
+ name: "John Doe",
1670
+ role: "CEO",
1671
+ company: "Tech Corp",
1672
+ avatar: dummyImage(80, 80, "JD", "3b82f6", "ffffff"),
1673
+ text: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.",
1674
+ rating: 5
1675
+ },
1676
+ {
1677
+ name: "Jane Smith",
1678
+ role: "CTO",
1679
+ company: "Startup Inc",
1680
+ avatar: dummyImage(80, 80, "JS", "10b981", "ffffff"),
1681
+ text: "Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.",
1682
+ rating: 5
1683
+ },
1684
+ {
1685
+ name: "Bob Wilson",
1686
+ role: "Product Manager",
1687
+ company: "Enterprise Co",
1688
+ avatar: dummyImage(80, 80, "BW", "f59e0b", "ffffff"),
1689
+ text: "Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.",
1690
+ rating: 4
1691
+ }
1692
+ ];
1693
+ var dummyPricingPlans = [
1694
+ {
1695
+ name: "Starter",
1696
+ description: "Perfect for individuals",
1697
+ price: "$9",
1698
+ period: "/month",
1699
+ features: [
1700
+ { text: "5 Projects", included: true },
1701
+ { text: "10GB Storage", included: true },
1702
+ { text: "Email Support", included: true },
1703
+ { text: "API Access", included: false },
1704
+ { text: "Custom Domain", included: false }
1705
+ ],
1706
+ ctaText: "Start Free Trial",
1707
+ ctaHref: "/signup?plan=starter"
1708
+ },
1709
+ {
1710
+ name: "Professional",
1711
+ description: "Best for growing teams",
1712
+ price: "$29",
1713
+ period: "/month",
1714
+ features: [
1715
+ { text: "Unlimited Projects", included: true },
1716
+ { text: "100GB Storage", included: true },
1717
+ { text: "Priority Support", included: true },
1718
+ { text: "API Access", included: true },
1719
+ { text: "Custom Domain", included: false }
1720
+ ],
1721
+ ctaText: "Start Free Trial",
1722
+ ctaHref: "/signup?plan=pro",
1723
+ popular: true,
1724
+ badge: "Most Popular"
1725
+ },
1726
+ {
1727
+ name: "Enterprise",
1728
+ description: "For large organizations",
1729
+ price: "$99",
1730
+ period: "/month",
1731
+ features: [
1732
+ { text: "Unlimited Projects", included: true },
1733
+ { text: "Unlimited Storage", included: true },
1734
+ { text: "24/7 Support", included: true },
1735
+ { text: "API Access", included: true },
1736
+ { text: "Custom Domain", included: true }
1737
+ ],
1738
+ ctaText: "Contact Sales",
1739
+ ctaHref: "/contact?plan=enterprise"
1740
+ }
1741
+ ];
1742
+ var dummyFaqItems = [
1743
+ {
1744
+ question: "What is your refund policy?",
1745
+ answer: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."
1746
+ },
1747
+ {
1748
+ question: "How do I cancel my subscription?",
1749
+ answer: "Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat."
1750
+ },
1751
+ {
1752
+ question: "Can I change my plan later?",
1753
+ answer: "Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur."
1754
+ },
1755
+ {
1756
+ question: "Do you offer discounts for non-profits?",
1757
+ answer: "Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
1758
+ }
1759
+ ];
1760
+
1761
+ // src/client/web/forms/types.ts
1762
+ var VALIDATION_MESSAGES = {
1763
+ required: "This field is required",
1764
+ email: "Please enter a valid email address",
1765
+ phone: "Please enter a valid phone number",
1766
+ minLength: (min) => `Must be at least ${min} characters`,
1767
+ maxLength: (max) => `Must be no more than ${max} characters`,
1768
+ passwordMatch: "Passwords must match",
1769
+ acceptTerms: "You must accept the terms and conditions",
1770
+ passwordUppercase: "Password must contain at least one uppercase letter",
1771
+ passwordLowercase: "Password must contain at least one lowercase letter",
1772
+ passwordNumber: "Password must contain at least one number",
1773
+ passwordSpecial: "Password must contain at least one special character"
1774
+ };
1775
+ var contactFormSchema = Yup.object().shape({
1776
+ name: Yup.string().required(VALIDATION_MESSAGES.required).min(2, VALIDATION_MESSAGES.minLength(2)).max(100, VALIDATION_MESSAGES.maxLength(100)),
1777
+ email: Yup.string().required(VALIDATION_MESSAGES.required).email(VALIDATION_MESSAGES.email),
1778
+ phone: Yup.string().matches(
1779
+ /^[+]?[(]?[0-9]{1,4}[)]?[-\s./0-9]*$/,
1780
+ VALIDATION_MESSAGES.phone
1781
+ ).nullable(),
1782
+ subject: Yup.string().max(200, VALIDATION_MESSAGES.maxLength(200)).nullable(),
1783
+ message: Yup.string().required(VALIDATION_MESSAGES.required).min(10, VALIDATION_MESSAGES.minLength(10)).max(2e3, VALIDATION_MESSAGES.maxLength(2e3))
1784
+ });
1785
+ var newsletterFormSchema = Yup.object().shape({
1786
+ email: Yup.string().required(VALIDATION_MESSAGES.required).email(VALIDATION_MESSAGES.email),
1787
+ firstName: Yup.string().min(2, VALIDATION_MESSAGES.minLength(2)).max(50, VALIDATION_MESSAGES.maxLength(50)).nullable(),
1788
+ lastName: Yup.string().min(2, VALIDATION_MESSAGES.minLength(2)).max(50, VALIDATION_MESSAGES.maxLength(50)).nullable()
1789
+ });
1790
+ var loginFormSchema = Yup.object().shape({
1791
+ email: Yup.string().required(VALIDATION_MESSAGES.required).email(VALIDATION_MESSAGES.email),
1792
+ password: Yup.string().required(VALIDATION_MESSAGES.required).min(8, VALIDATION_MESSAGES.minLength(8)),
1793
+ rememberMe: Yup.boolean()
1794
+ });
1795
+ function createRegisterFormSchema(requirements = {}) {
1796
+ const {
1797
+ minLength = 8,
1798
+ requireUppercase = true,
1799
+ requireLowercase = true,
1800
+ requireNumber = true,
1801
+ requireSpecial = false
1802
+ } = requirements;
1803
+ let passwordSchema = Yup.string().required(VALIDATION_MESSAGES.required).min(minLength, VALIDATION_MESSAGES.minLength(minLength));
1804
+ if (requireUppercase) {
1805
+ passwordSchema = passwordSchema.matches(
1806
+ /[A-Z]/,
1807
+ VALIDATION_MESSAGES.passwordUppercase
1808
+ );
1809
+ }
1810
+ if (requireLowercase) {
1811
+ passwordSchema = passwordSchema.matches(
1812
+ /[a-z]/,
1813
+ VALIDATION_MESSAGES.passwordLowercase
1814
+ );
1815
+ }
1816
+ if (requireNumber) {
1817
+ passwordSchema = passwordSchema.matches(
1818
+ /[0-9]/,
1819
+ VALIDATION_MESSAGES.passwordNumber
1820
+ );
1821
+ }
1822
+ if (requireSpecial) {
1823
+ passwordSchema = passwordSchema.matches(
1824
+ /[!@#$%^&*(),.?":{}|<>]/,
1825
+ VALIDATION_MESSAGES.passwordSpecial
1826
+ );
1827
+ }
1828
+ return Yup.object().shape({
1829
+ firstName: Yup.string().required(VALIDATION_MESSAGES.required).min(2, VALIDATION_MESSAGES.minLength(2)).max(50, VALIDATION_MESSAGES.maxLength(50)),
1830
+ lastName: Yup.string().required(VALIDATION_MESSAGES.required).min(2, VALIDATION_MESSAGES.minLength(2)).max(50, VALIDATION_MESSAGES.maxLength(50)),
1831
+ email: Yup.string().required(VALIDATION_MESSAGES.required).email(VALIDATION_MESSAGES.email),
1832
+ password: passwordSchema,
1833
+ confirmPassword: Yup.string().required(VALIDATION_MESSAGES.required).oneOf([Yup.ref("password")], VALIDATION_MESSAGES.passwordMatch),
1834
+ acceptTerms: Yup.boolean().oneOf([true], VALIDATION_MESSAGES.acceptTerms)
1835
+ });
1836
+ }
1837
+ var registerFormSchema = createRegisterFormSchema();
1838
+ var defaultInitialValues = {
1839
+ name: "",
1840
+ email: "",
1841
+ phone: "",
1842
+ subject: "",
1843
+ message: ""
1844
+ };
1845
+ var defaultSubjectOptions = [
1846
+ "General Inquiry",
1847
+ "Support Request",
1848
+ "Sales Question",
1849
+ "Partnership",
1850
+ "Feedback",
1851
+ "Other"
1852
+ ];
1853
+ function ContactForm({
1854
+ actionUrl,
1855
+ onSubmit,
1856
+ initialValues,
1857
+ showPhone = true,
1858
+ showSubject = true,
1859
+ subjectOptions = defaultSubjectOptions,
1860
+ submitText = "Send Message",
1861
+ successMessage = "Thank you! Your message has been sent successfully.",
1862
+ className = "",
1863
+ formClass = "",
1864
+ inputClass = "",
1865
+ labelClass = "",
1866
+ buttonClass = "",
1867
+ errorClass = ""
1868
+ }) {
1869
+ const [submitStatus, setSubmitStatus] = useState("idle");
1870
+ const [submitMessage, setSubmitMessage] = useState("");
1871
+ const mergedInitialValues = {
1872
+ ...defaultInitialValues,
1873
+ ...initialValues
1874
+ };
1875
+ const baseInputClass = "w-full px-4 py-3 rounded-lg border border-gray-300 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent transition-colors";
1876
+ const baseLabelClass = "block text-sm font-medium text-gray-700 mb-1";
1877
+ const baseErrorClass = "text-sm text-red-600 mt-1";
1878
+ const baseButtonClass = "w-full px-6 py-3 bg-blue-600 hover:bg-blue-700 text-white font-medium rounded-lg transition-colors disabled:opacity-50 disabled:cursor-not-allowed";
1879
+ const handleSubmit = async (values, { setSubmitting, resetForm }) => {
1880
+ try {
1881
+ let result;
1882
+ if (onSubmit) {
1883
+ result = await onSubmit(values);
1884
+ } else if (actionUrl) {
1885
+ const response = await fetch(actionUrl, {
1886
+ method: "POST",
1887
+ headers: { "Content-Type": "application/json" },
1888
+ body: JSON.stringify(values)
1889
+ });
1890
+ result = await response.json();
1891
+ } else {
1892
+ await new Promise((resolve) => setTimeout(resolve, 1e3));
1893
+ result = { success: true };
1894
+ }
1895
+ if (result.success) {
1896
+ setSubmitStatus("success");
1897
+ setSubmitMessage(result.message || successMessage);
1898
+ resetForm();
1899
+ } else {
1900
+ setSubmitStatus("error");
1901
+ setSubmitMessage(result.message || "Something went wrong. Please try again.");
1902
+ }
1903
+ } catch (error) {
1904
+ setSubmitStatus("error");
1905
+ setSubmitMessage("An error occurred. Please try again later.");
1906
+ } finally {
1907
+ setSubmitting(false);
1908
+ }
1909
+ };
1910
+ return /* @__PURE__ */ jsx("div", { className: `ec-contact-form ${className}`, children: submitStatus === "success" ? /* @__PURE__ */ jsxs("div", { className: "p-6 bg-green-50 border border-green-200 rounded-lg text-center", children: [
1911
+ /* @__PURE__ */ jsx("svg", { className: "w-12 h-12 text-green-500 mx-auto mb-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z" }) }),
1912
+ /* @__PURE__ */ jsx("p", { className: "text-green-800 font-medium", children: submitMessage }),
1913
+ /* @__PURE__ */ jsx(
1914
+ "button",
1915
+ {
1916
+ type: "button",
1917
+ onClick: () => setSubmitStatus("idle"),
1918
+ className: "mt-4 text-green-600 hover:text-green-700 text-sm font-medium",
1919
+ children: "Send another message"
1920
+ }
1921
+ )
1922
+ ] }) : /* @__PURE__ */ jsx(
1923
+ Formik,
1924
+ {
1925
+ initialValues: mergedInitialValues,
1926
+ validationSchema: contactFormSchema,
1927
+ onSubmit: handleSubmit,
1928
+ children: ({ isSubmitting, errors, touched }) => /* @__PURE__ */ jsxs(Form, { className: `space-y-4 ${formClass}`, noValidate: true, children: [
1929
+ /* @__PURE__ */ jsxs("div", { children: [
1930
+ /* @__PURE__ */ jsxs("label", { htmlFor: "contact-name", className: `${baseLabelClass} ${labelClass}`, children: [
1931
+ "Name ",
1932
+ /* @__PURE__ */ jsx("span", { className: "text-red-500", children: "*" })
1933
+ ] }),
1934
+ /* @__PURE__ */ jsx(
1935
+ Field,
1936
+ {
1937
+ type: "text",
1938
+ id: "contact-name",
1939
+ name: "name",
1940
+ placeholder: "John Doe",
1941
+ className: `${baseInputClass} ${inputClass} ${errors.name && touched.name ? "border-red-500 focus:ring-red-500" : ""}`
1942
+ }
1943
+ ),
1944
+ /* @__PURE__ */ jsx(ErrorMessage, { name: "name", component: "p", className: `${baseErrorClass} ${errorClass}` })
1945
+ ] }),
1946
+ /* @__PURE__ */ jsxs("div", { children: [
1947
+ /* @__PURE__ */ jsxs("label", { htmlFor: "contact-email", className: `${baseLabelClass} ${labelClass}`, children: [
1948
+ "Email ",
1949
+ /* @__PURE__ */ jsx("span", { className: "text-red-500", children: "*" })
1950
+ ] }),
1951
+ /* @__PURE__ */ jsx(
1952
+ Field,
1953
+ {
1954
+ type: "email",
1955
+ id: "contact-email",
1956
+ name: "email",
1957
+ placeholder: "john@example.com",
1958
+ className: `${baseInputClass} ${inputClass} ${errors.email && touched.email ? "border-red-500 focus:ring-red-500" : ""}`
1959
+ }
1960
+ ),
1961
+ /* @__PURE__ */ jsx(ErrorMessage, { name: "email", component: "p", className: `${baseErrorClass} ${errorClass}` })
1962
+ ] }),
1963
+ showPhone && /* @__PURE__ */ jsxs("div", { children: [
1964
+ /* @__PURE__ */ jsx("label", { htmlFor: "contact-phone", className: `${baseLabelClass} ${labelClass}`, children: "Phone" }),
1965
+ /* @__PURE__ */ jsx(
1966
+ Field,
1967
+ {
1968
+ type: "tel",
1969
+ id: "contact-phone",
1970
+ name: "phone",
1971
+ placeholder: "+1 (555) 000-0000",
1972
+ className: `${baseInputClass} ${inputClass} ${errors.phone && touched.phone ? "border-red-500 focus:ring-red-500" : ""}`
1973
+ }
1974
+ ),
1975
+ /* @__PURE__ */ jsx(ErrorMessage, { name: "phone", component: "p", className: `${baseErrorClass} ${errorClass}` })
1976
+ ] }),
1977
+ showSubject && /* @__PURE__ */ jsxs("div", { children: [
1978
+ /* @__PURE__ */ jsx("label", { htmlFor: "contact-subject", className: `${baseLabelClass} ${labelClass}`, children: "Subject" }),
1979
+ /* @__PURE__ */ jsxs(
1980
+ Field,
1981
+ {
1982
+ as: "select",
1983
+ id: "contact-subject",
1984
+ name: "subject",
1985
+ className: `${baseInputClass} ${inputClass}`,
1986
+ children: [
1987
+ /* @__PURE__ */ jsx("option", { value: "", children: "Select a subject..." }),
1988
+ subjectOptions.map((option) => /* @__PURE__ */ jsx("option", { value: option, children: option }, option))
1989
+ ]
1990
+ }
1991
+ ),
1992
+ /* @__PURE__ */ jsx(ErrorMessage, { name: "subject", component: "p", className: `${baseErrorClass} ${errorClass}` })
1993
+ ] }),
1994
+ /* @__PURE__ */ jsxs("div", { children: [
1995
+ /* @__PURE__ */ jsxs("label", { htmlFor: "contact-message", className: `${baseLabelClass} ${labelClass}`, children: [
1996
+ "Message ",
1997
+ /* @__PURE__ */ jsx("span", { className: "text-red-500", children: "*" })
1998
+ ] }),
1999
+ /* @__PURE__ */ jsx(
2000
+ Field,
2001
+ {
2002
+ as: "textarea",
2003
+ id: "contact-message",
2004
+ name: "message",
2005
+ rows: 5,
2006
+ placeholder: "Your message...",
2007
+ className: `${baseInputClass} ${inputClass} resize-none ${errors.message && touched.message ? "border-red-500 focus:ring-red-500" : ""}`
2008
+ }
2009
+ ),
2010
+ /* @__PURE__ */ jsx(ErrorMessage, { name: "message", component: "p", className: `${baseErrorClass} ${errorClass}` })
2011
+ ] }),
2012
+ submitStatus === "error" && /* @__PURE__ */ jsx("div", { className: "p-4 bg-red-50 border border-red-200 rounded-lg", children: /* @__PURE__ */ jsx("p", { className: "text-red-800 text-sm", children: submitMessage }) }),
2013
+ /* @__PURE__ */ jsx(
2014
+ "button",
2015
+ {
2016
+ type: "submit",
2017
+ disabled: isSubmitting,
2018
+ className: `${baseButtonClass} ${buttonClass}`,
2019
+ children: isSubmitting ? /* @__PURE__ */ jsxs("span", { className: "flex items-center justify-center gap-2", children: [
2020
+ /* @__PURE__ */ jsxs("svg", { className: "animate-spin w-5 h-5", fill: "none", viewBox: "0 0 24 24", children: [
2021
+ /* @__PURE__ */ jsx("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }),
2022
+ /* @__PURE__ */ jsx("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z" })
2023
+ ] }),
2024
+ "Sending..."
2025
+ ] }) : submitText
2026
+ }
2027
+ )
2028
+ ] })
2029
+ }
2030
+ ) });
2031
+ }
2032
+ var defaultInitialValues2 = {
2033
+ email: "",
2034
+ firstName: "",
2035
+ lastName: ""
2036
+ };
2037
+ function NewsletterForm({
2038
+ actionUrl,
2039
+ onSubmit,
2040
+ initialValues,
2041
+ showName = false,
2042
+ placeholder = "Enter your email",
2043
+ submitText = "Subscribe",
2044
+ successMessage = "Thank you for subscribing!",
2045
+ layout = "inline",
2046
+ className = "",
2047
+ formClass = "",
2048
+ inputClass = "",
2049
+ buttonClass = ""
2050
+ }) {
2051
+ const [submitStatus, setSubmitStatus] = useState("idle");
2052
+ const [submitMessage, setSubmitMessage] = useState("");
2053
+ const mergedInitialValues = {
2054
+ ...defaultInitialValues2,
2055
+ ...initialValues
2056
+ };
2057
+ const baseInputClass = "px-4 py-3 rounded-lg border border-gray-300 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent transition-colors";
2058
+ const baseButtonClass = "px-6 py-3 bg-blue-600 hover:bg-blue-700 text-white font-medium rounded-lg transition-colors disabled:opacity-50 disabled:cursor-not-allowed";
2059
+ const handleSubmit = async (values, { setSubmitting, resetForm }) => {
2060
+ try {
2061
+ let result;
2062
+ if (onSubmit) {
2063
+ result = await onSubmit(values);
2064
+ } else if (actionUrl) {
2065
+ const response = await fetch(actionUrl, {
2066
+ method: "POST",
2067
+ headers: { "Content-Type": "application/json" },
2068
+ body: JSON.stringify(values)
2069
+ });
2070
+ result = await response.json();
2071
+ } else {
2072
+ await new Promise((resolve) => setTimeout(resolve, 1e3));
2073
+ result = { success: true };
2074
+ }
2075
+ if (result.success) {
2076
+ setSubmitStatus("success");
2077
+ setSubmitMessage(result.message || successMessage);
2078
+ resetForm();
2079
+ } else {
2080
+ setSubmitStatus("error");
2081
+ setSubmitMessage(result.message || "Something went wrong. Please try again.");
2082
+ }
2083
+ } catch (error) {
2084
+ setSubmitStatus("error");
2085
+ setSubmitMessage("An error occurred. Please try again later.");
2086
+ } finally {
2087
+ setSubmitting(false);
2088
+ }
2089
+ };
2090
+ if (submitStatus === "success") {
2091
+ return /* @__PURE__ */ jsx("div", { className: `ec-newsletter-form ${className}`, children: /* @__PURE__ */ jsxs("div", { className: "p-4 bg-green-50 border border-green-200 rounded-lg text-center", children: [
2092
+ /* @__PURE__ */ jsx("p", { className: "text-green-800 font-medium", children: submitMessage }),
2093
+ /* @__PURE__ */ jsx(
2094
+ "button",
2095
+ {
2096
+ type: "button",
2097
+ onClick: () => setSubmitStatus("idle"),
2098
+ className: "mt-2 text-green-600 hover:text-green-700 text-sm",
2099
+ children: "Subscribe another email"
2100
+ }
2101
+ )
2102
+ ] }) });
2103
+ }
2104
+ return /* @__PURE__ */ jsxs("div", { className: `ec-newsletter-form ${className}`, children: [
2105
+ /* @__PURE__ */ jsx(
2106
+ Formik,
2107
+ {
2108
+ initialValues: mergedInitialValues,
2109
+ validationSchema: newsletterFormSchema,
2110
+ onSubmit: handleSubmit,
2111
+ children: ({ isSubmitting, errors, touched }) => /* @__PURE__ */ jsxs(
2112
+ Form,
2113
+ {
2114
+ className: `${layout === "inline" ? "flex flex-col sm:flex-row gap-3" : "space-y-4"} ${formClass}`,
2115
+ noValidate: true,
2116
+ children: [
2117
+ showName && /* @__PURE__ */ jsxs("div", { className: layout === "inline" ? "flex gap-3 flex-1" : "grid grid-cols-2 gap-4", children: [
2118
+ /* @__PURE__ */ jsxs("div", { className: "flex-1", children: [
2119
+ /* @__PURE__ */ jsx(
2120
+ Field,
2121
+ {
2122
+ type: "text",
2123
+ name: "firstName",
2124
+ placeholder: "First name",
2125
+ className: `w-full ${baseInputClass} ${inputClass} ${errors.firstName && touched.firstName ? "border-red-500" : ""}`
2126
+ }
2127
+ ),
2128
+ layout === "stacked" && /* @__PURE__ */ jsx(ErrorMessage, { name: "firstName", component: "p", className: "text-sm text-red-600 mt-1" })
2129
+ ] }),
2130
+ /* @__PURE__ */ jsxs("div", { className: "flex-1", children: [
2131
+ /* @__PURE__ */ jsx(
2132
+ Field,
2133
+ {
2134
+ type: "text",
2135
+ name: "lastName",
2136
+ placeholder: "Last name",
2137
+ className: `w-full ${baseInputClass} ${inputClass} ${errors.lastName && touched.lastName ? "border-red-500" : ""}`
2138
+ }
2139
+ ),
2140
+ layout === "stacked" && /* @__PURE__ */ jsx(ErrorMessage, { name: "lastName", component: "p", className: "text-sm text-red-600 mt-1" })
2141
+ ] })
2142
+ ] }),
2143
+ /* @__PURE__ */ jsxs("div", { className: layout === "inline" ? "flex-1" : "", children: [
2144
+ /* @__PURE__ */ jsx(
2145
+ Field,
2146
+ {
2147
+ type: "email",
2148
+ name: "email",
2149
+ placeholder,
2150
+ className: `w-full ${baseInputClass} ${inputClass} ${errors.email && touched.email ? "border-red-500" : ""}`
2151
+ }
2152
+ ),
2153
+ layout === "stacked" && /* @__PURE__ */ jsx(ErrorMessage, { name: "email", component: "p", className: "text-sm text-red-600 mt-1" })
2154
+ ] }),
2155
+ /* @__PURE__ */ jsx(
2156
+ "button",
2157
+ {
2158
+ type: "submit",
2159
+ disabled: isSubmitting,
2160
+ className: `${baseButtonClass} ${buttonClass} ${layout === "stacked" ? "w-full" : ""}`,
2161
+ children: isSubmitting ? /* @__PURE__ */ jsxs("span", { className: "flex items-center justify-center gap-2", children: [
2162
+ /* @__PURE__ */ jsxs("svg", { className: "animate-spin w-5 h-5", fill: "none", viewBox: "0 0 24 24", children: [
2163
+ /* @__PURE__ */ jsx("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }),
2164
+ /* @__PURE__ */ jsx("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z" })
2165
+ ] }),
2166
+ "Subscribing..."
2167
+ ] }) : submitText
2168
+ }
2169
+ ),
2170
+ layout === "inline" && errors.email && touched.email && /* @__PURE__ */ jsx("div", { className: "w-full sm:w-auto", children: /* @__PURE__ */ jsx("p", { className: "text-sm text-red-600", children: errors.email }) })
2171
+ ]
2172
+ }
2173
+ )
2174
+ }
2175
+ ),
2176
+ submitStatus === "error" && /* @__PURE__ */ jsx("div", { className: "mt-4 p-4 bg-red-50 border border-red-200 rounded-lg", children: /* @__PURE__ */ jsx("p", { className: "text-red-800 text-sm", children: submitMessage }) })
2177
+ ] });
2178
+ }
2179
+ var defaultInitialValues3 = {
2180
+ email: "",
2181
+ password: "",
2182
+ rememberMe: false
2183
+ };
2184
+ function LoginForm({
2185
+ actionUrl,
2186
+ onSubmit,
2187
+ initialValues,
2188
+ showRememberMe = true,
2189
+ forgotPasswordLink = "/forgot-password",
2190
+ registerLink = "/register",
2191
+ submitText = "Sign In",
2192
+ successRedirect,
2193
+ className = "",
2194
+ formClass = "",
2195
+ inputClass = "",
2196
+ buttonClass = ""
2197
+ }) {
2198
+ const [submitStatus, setSubmitStatus] = useState("idle");
2199
+ const [submitMessage, setSubmitMessage] = useState("");
2200
+ const [showPassword, setShowPassword] = useState(false);
2201
+ const mergedInitialValues = {
2202
+ ...defaultInitialValues3,
2203
+ ...initialValues
2204
+ };
2205
+ const baseInputClass = "w-full px-4 py-3 rounded-lg border border-gray-300 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent transition-colors";
2206
+ const baseLabelClass = "block text-sm font-medium text-gray-700 mb-1";
2207
+ const baseErrorClass = "text-sm text-red-600 mt-1";
2208
+ const baseButtonClass = "w-full px-6 py-3 bg-blue-600 hover:bg-blue-700 text-white font-medium rounded-lg transition-colors disabled:opacity-50 disabled:cursor-not-allowed";
2209
+ const handleSubmit = async (values, { setSubmitting }) => {
2210
+ try {
2211
+ let result;
2212
+ if (onSubmit) {
2213
+ result = await onSubmit(values);
2214
+ } else if (actionUrl) {
2215
+ const response = await fetch(actionUrl, {
2216
+ method: "POST",
2217
+ headers: { "Content-Type": "application/json" },
2218
+ body: JSON.stringify(values)
2219
+ });
2220
+ result = await response.json();
2221
+ } else {
2222
+ await new Promise((resolve) => setTimeout(resolve, 1e3));
2223
+ result = { success: true };
2224
+ }
2225
+ if (result.success) {
2226
+ setSubmitStatus("success");
2227
+ setSubmitMessage(result.message || "Login successful!");
2228
+ if (successRedirect && typeof window !== "undefined") {
2229
+ window.location.href = successRedirect;
2230
+ }
2231
+ } else {
2232
+ setSubmitStatus("error");
2233
+ setSubmitMessage(result.message || "Invalid email or password.");
2234
+ }
2235
+ } catch (error) {
2236
+ setSubmitStatus("error");
2237
+ setSubmitMessage("An error occurred. Please try again later.");
2238
+ } finally {
2239
+ setSubmitting(false);
2240
+ }
2241
+ };
2242
+ return /* @__PURE__ */ jsx("div", { className: `ec-login-form ${className}`, children: /* @__PURE__ */ jsx(
2243
+ Formik,
2244
+ {
2245
+ initialValues: mergedInitialValues,
2246
+ validationSchema: loginFormSchema,
2247
+ onSubmit: handleSubmit,
2248
+ children: ({ isSubmitting, errors, touched }) => /* @__PURE__ */ jsxs(Form, { className: `space-y-4 ${formClass}`, noValidate: true, children: [
2249
+ /* @__PURE__ */ jsxs("div", { children: [
2250
+ /* @__PURE__ */ jsx("label", { htmlFor: "login-email", className: baseLabelClass, children: "Email" }),
2251
+ /* @__PURE__ */ jsx(
2252
+ Field,
2253
+ {
2254
+ type: "email",
2255
+ id: "login-email",
2256
+ name: "email",
2257
+ placeholder: "you@example.com",
2258
+ autoComplete: "email",
2259
+ className: `${baseInputClass} ${inputClass} ${errors.email && touched.email ? "border-red-500 focus:ring-red-500" : ""}`
2260
+ }
2261
+ ),
2262
+ /* @__PURE__ */ jsx(ErrorMessage, { name: "email", component: "p", className: baseErrorClass })
2263
+ ] }),
2264
+ /* @__PURE__ */ jsxs("div", { children: [
2265
+ /* @__PURE__ */ jsx("label", { htmlFor: "login-password", className: baseLabelClass, children: "Password" }),
2266
+ /* @__PURE__ */ jsxs("div", { className: "relative", children: [
2267
+ /* @__PURE__ */ jsx(
2268
+ Field,
2269
+ {
2270
+ type: showPassword ? "text" : "password",
2271
+ id: "login-password",
2272
+ name: "password",
2273
+ placeholder: "\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022",
2274
+ autoComplete: "current-password",
2275
+ className: `${baseInputClass} ${inputClass} pr-12 ${errors.password && touched.password ? "border-red-500 focus:ring-red-500" : ""}`
2276
+ }
2277
+ ),
2278
+ /* @__PURE__ */ jsx(
2279
+ "button",
2280
+ {
2281
+ type: "button",
2282
+ onClick: () => setShowPassword(!showPassword),
2283
+ className: "absolute right-3 top-1/2 -translate-y-1/2 text-gray-500 hover:text-gray-700",
2284
+ tabIndex: -1,
2285
+ children: showPassword ? /* @__PURE__ */ jsx("svg", { className: "w-5 h-5", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M13.875 18.825A10.05 10.05 0 0112 19c-4.478 0-8.268-2.943-9.543-7a9.97 9.97 0 011.563-3.029m5.858.908a3 3 0 114.243 4.243M9.878 9.878l4.242 4.242M9.88 9.88l-3.29-3.29m7.532 7.532l3.29 3.29M3 3l3.59 3.59m0 0A9.953 9.953 0 0112 5c4.478 0 8.268 2.943 9.543 7a10.025 10.025 0 01-4.132 5.411m0 0L21 21" }) }) : /* @__PURE__ */ jsxs("svg", { className: "w-5 h-5", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: [
2286
+ /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M15 12a3 3 0 11-6 0 3 3 0 016 0z" }),
2287
+ /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z" })
2288
+ ] })
2289
+ }
2290
+ )
2291
+ ] }),
2292
+ /* @__PURE__ */ jsx(ErrorMessage, { name: "password", component: "p", className: baseErrorClass })
2293
+ ] }),
2294
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
2295
+ showRememberMe && /* @__PURE__ */ jsxs("label", { className: "flex items-center gap-2 cursor-pointer", children: [
2296
+ /* @__PURE__ */ jsx(
2297
+ Field,
2298
+ {
2299
+ type: "checkbox",
2300
+ name: "rememberMe",
2301
+ className: "w-4 h-4 rounded border-gray-300 text-blue-600 focus:ring-blue-500"
2302
+ }
2303
+ ),
2304
+ /* @__PURE__ */ jsx("span", { className: "text-sm text-gray-600", children: "Remember me" })
2305
+ ] }),
2306
+ forgotPasswordLink && /* @__PURE__ */ jsx(
2307
+ "a",
2308
+ {
2309
+ href: forgotPasswordLink,
2310
+ className: "text-sm text-blue-600 hover:text-blue-700 font-medium",
2311
+ children: "Forgot password?"
2312
+ }
2313
+ )
2314
+ ] }),
2315
+ submitStatus === "error" && /* @__PURE__ */ jsx("div", { className: "p-4 bg-red-50 border border-red-200 rounded-lg", children: /* @__PURE__ */ jsx("p", { className: "text-red-800 text-sm", children: submitMessage }) }),
2316
+ /* @__PURE__ */ jsx(
2317
+ "button",
2318
+ {
2319
+ type: "submit",
2320
+ disabled: isSubmitting,
2321
+ className: `${baseButtonClass} ${buttonClass}`,
2322
+ children: isSubmitting ? /* @__PURE__ */ jsxs("span", { className: "flex items-center justify-center gap-2", children: [
2323
+ /* @__PURE__ */ jsxs("svg", { className: "animate-spin w-5 h-5", fill: "none", viewBox: "0 0 24 24", children: [
2324
+ /* @__PURE__ */ jsx("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }),
2325
+ /* @__PURE__ */ jsx("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z" })
2326
+ ] }),
2327
+ "Signing in..."
2328
+ ] }) : submitText
2329
+ }
2330
+ ),
2331
+ registerLink && /* @__PURE__ */ jsxs("p", { className: "text-center text-sm text-gray-600", children: [
2332
+ "Don't have an account?",
2333
+ " ",
2334
+ /* @__PURE__ */ jsx("a", { href: registerLink, className: "text-blue-600 hover:text-blue-700 font-medium", children: "Sign up" })
2335
+ ] })
2336
+ ] })
2337
+ }
2338
+ ) });
2339
+ }
2340
+ var defaultInitialValues4 = {
2341
+ firstName: "",
2342
+ lastName: "",
2343
+ email: "",
2344
+ password: "",
2345
+ confirmPassword: "",
2346
+ acceptTerms: false
2347
+ };
2348
+ function RegisterForm({
2349
+ actionUrl,
2350
+ onSubmit,
2351
+ initialValues,
2352
+ termsLink = "/terms",
2353
+ privacyLink = "/privacy",
2354
+ loginLink = "/login",
2355
+ submitText = "Create Account",
2356
+ successRedirect,
2357
+ passwordRequirements = {
2358
+ minLength: 8,
2359
+ requireUppercase: true,
2360
+ requireLowercase: true,
2361
+ requireNumber: true,
2362
+ requireSpecial: false
2363
+ },
2364
+ className = "",
2365
+ formClass = "",
2366
+ inputClass = "",
2367
+ buttonClass = ""
2368
+ }) {
2369
+ const [submitStatus, setSubmitStatus] = useState("idle");
2370
+ const [submitMessage, setSubmitMessage] = useState("");
2371
+ const [showPassword, setShowPassword] = useState(false);
2372
+ const [showConfirmPassword, setShowConfirmPassword] = useState(false);
2373
+ const mergedInitialValues = {
2374
+ ...defaultInitialValues4,
2375
+ ...initialValues
2376
+ };
2377
+ const validationSchema = createRegisterFormSchema(passwordRequirements);
2378
+ const baseInputClass = "w-full px-4 py-3 rounded-lg border border-gray-300 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent transition-colors";
2379
+ const baseLabelClass = "block text-sm font-medium text-gray-700 mb-1";
2380
+ const baseErrorClass = "text-sm text-red-600 mt-1";
2381
+ const baseButtonClass = "w-full px-6 py-3 bg-blue-600 hover:bg-blue-700 text-white font-medium rounded-lg transition-colors disabled:opacity-50 disabled:cursor-not-allowed";
2382
+ const handleSubmit = async (values, { setSubmitting }) => {
2383
+ try {
2384
+ let result;
2385
+ if (onSubmit) {
2386
+ result = await onSubmit(values);
2387
+ } else if (actionUrl) {
2388
+ const response = await fetch(actionUrl, {
2389
+ method: "POST",
2390
+ headers: { "Content-Type": "application/json" },
2391
+ body: JSON.stringify(values)
2392
+ });
2393
+ result = await response.json();
2394
+ } else {
2395
+ await new Promise((resolve) => setTimeout(resolve, 1e3));
2396
+ result = { success: true };
2397
+ }
2398
+ if (result.success) {
2399
+ setSubmitStatus("success");
2400
+ setSubmitMessage(result.message || "Account created successfully!");
2401
+ if (successRedirect && typeof window !== "undefined") {
2402
+ window.location.href = successRedirect;
2403
+ }
2404
+ } else {
2405
+ setSubmitStatus("error");
2406
+ setSubmitMessage(result.message || "Registration failed. Please try again.");
2407
+ }
2408
+ } catch (error) {
2409
+ setSubmitStatus("error");
2410
+ setSubmitMessage("An error occurred. Please try again later.");
2411
+ } finally {
2412
+ setSubmitting(false);
2413
+ }
2414
+ };
2415
+ if (submitStatus === "success") {
2416
+ return /* @__PURE__ */ jsx("div", { className: `ec-register-form ${className}`, children: /* @__PURE__ */ jsxs("div", { className: "p-6 bg-green-50 border border-green-200 rounded-lg text-center", children: [
2417
+ /* @__PURE__ */ jsx("svg", { className: "w-12 h-12 text-green-500 mx-auto mb-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z" }) }),
2418
+ /* @__PURE__ */ jsx("p", { className: "text-green-800 font-medium", children: submitMessage }),
2419
+ loginLink && /* @__PURE__ */ jsx(
2420
+ "a",
2421
+ {
2422
+ href: loginLink,
2423
+ className: "inline-block mt-4 text-green-600 hover:text-green-700 font-medium",
2424
+ children: "Sign in to your account"
2425
+ }
2426
+ )
2427
+ ] }) });
2428
+ }
2429
+ return /* @__PURE__ */ jsx("div", { className: `ec-register-form ${className}`, children: /* @__PURE__ */ jsx(
2430
+ Formik,
2431
+ {
2432
+ initialValues: mergedInitialValues,
2433
+ validationSchema,
2434
+ onSubmit: handleSubmit,
2435
+ children: ({ isSubmitting, errors, touched }) => /* @__PURE__ */ jsxs(Form, { className: `space-y-4 ${formClass}`, noValidate: true, children: [
2436
+ /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-4", children: [
2437
+ /* @__PURE__ */ jsxs("div", { children: [
2438
+ /* @__PURE__ */ jsxs("label", { htmlFor: "register-firstName", className: baseLabelClass, children: [
2439
+ "First Name ",
2440
+ /* @__PURE__ */ jsx("span", { className: "text-red-500", children: "*" })
2441
+ ] }),
2442
+ /* @__PURE__ */ jsx(
2443
+ Field,
2444
+ {
2445
+ type: "text",
2446
+ id: "register-firstName",
2447
+ name: "firstName",
2448
+ placeholder: "John",
2449
+ autoComplete: "given-name",
2450
+ className: `${baseInputClass} ${inputClass} ${errors.firstName && touched.firstName ? "border-red-500 focus:ring-red-500" : ""}`
2451
+ }
2452
+ ),
2453
+ /* @__PURE__ */ jsx(ErrorMessage, { name: "firstName", component: "p", className: baseErrorClass })
2454
+ ] }),
2455
+ /* @__PURE__ */ jsxs("div", { children: [
2456
+ /* @__PURE__ */ jsxs("label", { htmlFor: "register-lastName", className: baseLabelClass, children: [
2457
+ "Last Name ",
2458
+ /* @__PURE__ */ jsx("span", { className: "text-red-500", children: "*" })
2459
+ ] }),
2460
+ /* @__PURE__ */ jsx(
2461
+ Field,
2462
+ {
2463
+ type: "text",
2464
+ id: "register-lastName",
2465
+ name: "lastName",
2466
+ placeholder: "Doe",
2467
+ autoComplete: "family-name",
2468
+ className: `${baseInputClass} ${inputClass} ${errors.lastName && touched.lastName ? "border-red-500 focus:ring-red-500" : ""}`
2469
+ }
2470
+ ),
2471
+ /* @__PURE__ */ jsx(ErrorMessage, { name: "lastName", component: "p", className: baseErrorClass })
2472
+ ] })
2473
+ ] }),
2474
+ /* @__PURE__ */ jsxs("div", { children: [
2475
+ /* @__PURE__ */ jsxs("label", { htmlFor: "register-email", className: baseLabelClass, children: [
2476
+ "Email ",
2477
+ /* @__PURE__ */ jsx("span", { className: "text-red-500", children: "*" })
2478
+ ] }),
2479
+ /* @__PURE__ */ jsx(
2480
+ Field,
2481
+ {
2482
+ type: "email",
2483
+ id: "register-email",
2484
+ name: "email",
2485
+ placeholder: "you@example.com",
2486
+ autoComplete: "email",
2487
+ className: `${baseInputClass} ${inputClass} ${errors.email && touched.email ? "border-red-500 focus:ring-red-500" : ""}`
2488
+ }
2489
+ ),
2490
+ /* @__PURE__ */ jsx(ErrorMessage, { name: "email", component: "p", className: baseErrorClass })
2491
+ ] }),
2492
+ /* @__PURE__ */ jsxs("div", { children: [
2493
+ /* @__PURE__ */ jsxs("label", { htmlFor: "register-password", className: baseLabelClass, children: [
2494
+ "Password ",
2495
+ /* @__PURE__ */ jsx("span", { className: "text-red-500", children: "*" })
2496
+ ] }),
2497
+ /* @__PURE__ */ jsxs("div", { className: "relative", children: [
2498
+ /* @__PURE__ */ jsx(
2499
+ Field,
2500
+ {
2501
+ type: showPassword ? "text" : "password",
2502
+ id: "register-password",
2503
+ name: "password",
2504
+ placeholder: "\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022",
2505
+ autoComplete: "new-password",
2506
+ className: `${baseInputClass} ${inputClass} pr-12 ${errors.password && touched.password ? "border-red-500 focus:ring-red-500" : ""}`
2507
+ }
2508
+ ),
2509
+ /* @__PURE__ */ jsx(
2510
+ "button",
2511
+ {
2512
+ type: "button",
2513
+ onClick: () => setShowPassword(!showPassword),
2514
+ className: "absolute right-3 top-1/2 -translate-y-1/2 text-gray-500 hover:text-gray-700",
2515
+ tabIndex: -1,
2516
+ children: showPassword ? /* @__PURE__ */ jsx("svg", { className: "w-5 h-5", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M13.875 18.825A10.05 10.05 0 0112 19c-4.478 0-8.268-2.943-9.543-7a9.97 9.97 0 011.563-3.029m5.858.908a3 3 0 114.243 4.243M9.878 9.878l4.242 4.242M9.88 9.88l-3.29-3.29m7.532 7.532l3.29 3.29M3 3l3.59 3.59m0 0A9.953 9.953 0 0112 5c4.478 0 8.268 2.943 9.543 7a10.025 10.025 0 01-4.132 5.411m0 0L21 21" }) }) : /* @__PURE__ */ jsxs("svg", { className: "w-5 h-5", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: [
2517
+ /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M15 12a3 3 0 11-6 0 3 3 0 016 0z" }),
2518
+ /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z" })
2519
+ ] })
2520
+ }
2521
+ )
2522
+ ] }),
2523
+ /* @__PURE__ */ jsx(ErrorMessage, { name: "password", component: "p", className: baseErrorClass }),
2524
+ /* @__PURE__ */ jsxs("p", { className: "text-xs text-gray-500 mt-1", children: [
2525
+ "Min ",
2526
+ passwordRequirements.minLength,
2527
+ " characters",
2528
+ passwordRequirements.requireUppercase && ", uppercase",
2529
+ passwordRequirements.requireLowercase && ", lowercase",
2530
+ passwordRequirements.requireNumber && ", number",
2531
+ passwordRequirements.requireSpecial && ", special character"
2532
+ ] })
2533
+ ] }),
2534
+ /* @__PURE__ */ jsxs("div", { children: [
2535
+ /* @__PURE__ */ jsxs("label", { htmlFor: "register-confirmPassword", className: baseLabelClass, children: [
2536
+ "Confirm Password ",
2537
+ /* @__PURE__ */ jsx("span", { className: "text-red-500", children: "*" })
2538
+ ] }),
2539
+ /* @__PURE__ */ jsxs("div", { className: "relative", children: [
2540
+ /* @__PURE__ */ jsx(
2541
+ Field,
2542
+ {
2543
+ type: showConfirmPassword ? "text" : "password",
2544
+ id: "register-confirmPassword",
2545
+ name: "confirmPassword",
2546
+ placeholder: "\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022",
2547
+ autoComplete: "new-password",
2548
+ className: `${baseInputClass} ${inputClass} pr-12 ${errors.confirmPassword && touched.confirmPassword ? "border-red-500 focus:ring-red-500" : ""}`
2549
+ }
2550
+ ),
2551
+ /* @__PURE__ */ jsx(
2552
+ "button",
2553
+ {
2554
+ type: "button",
2555
+ onClick: () => setShowConfirmPassword(!showConfirmPassword),
2556
+ className: "absolute right-3 top-1/2 -translate-y-1/2 text-gray-500 hover:text-gray-700",
2557
+ tabIndex: -1,
2558
+ children: showConfirmPassword ? /* @__PURE__ */ jsx("svg", { className: "w-5 h-5", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M13.875 18.825A10.05 10.05 0 0112 19c-4.478 0-8.268-2.943-9.543-7a9.97 9.97 0 011.563-3.029m5.858.908a3 3 0 114.243 4.243M9.878 9.878l4.242 4.242M9.88 9.88l-3.29-3.29m7.532 7.532l3.29 3.29M3 3l3.59 3.59m0 0A9.953 9.953 0 0112 5c4.478 0 8.268 2.943 9.543 7a10.025 10.025 0 01-4.132 5.411m0 0L21 21" }) }) : /* @__PURE__ */ jsxs("svg", { className: "w-5 h-5", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: [
2559
+ /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M15 12a3 3 0 11-6 0 3 3 0 016 0z" }),
2560
+ /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z" })
2561
+ ] })
2562
+ }
2563
+ )
2564
+ ] }),
2565
+ /* @__PURE__ */ jsx(ErrorMessage, { name: "confirmPassword", component: "p", className: baseErrorClass })
2566
+ ] }),
2567
+ /* @__PURE__ */ jsxs("div", { children: [
2568
+ /* @__PURE__ */ jsxs("label", { className: "flex items-start gap-2 cursor-pointer", children: [
2569
+ /* @__PURE__ */ jsx(
2570
+ Field,
2571
+ {
2572
+ type: "checkbox",
2573
+ name: "acceptTerms",
2574
+ className: "w-4 h-4 mt-1 rounded border-gray-300 text-blue-600 focus:ring-blue-500"
2575
+ }
2576
+ ),
2577
+ /* @__PURE__ */ jsxs("span", { className: "text-sm text-gray-600", children: [
2578
+ "I agree to the",
2579
+ " ",
2580
+ /* @__PURE__ */ jsx("a", { href: termsLink, className: "text-blue-600 hover:underline", target: "_blank", rel: "noopener noreferrer", children: "Terms of Service" }),
2581
+ " ",
2582
+ "and",
2583
+ " ",
2584
+ /* @__PURE__ */ jsx("a", { href: privacyLink, className: "text-blue-600 hover:underline", target: "_blank", rel: "noopener noreferrer", children: "Privacy Policy" }),
2585
+ /* @__PURE__ */ jsx("span", { className: "text-red-500", children: " *" })
2586
+ ] })
2587
+ ] }),
2588
+ /* @__PURE__ */ jsx(ErrorMessage, { name: "acceptTerms", component: "p", className: baseErrorClass })
2589
+ ] }),
2590
+ submitStatus === "error" && /* @__PURE__ */ jsx("div", { className: "p-4 bg-red-50 border border-red-200 rounded-lg", children: /* @__PURE__ */ jsx("p", { className: "text-red-800 text-sm", children: submitMessage }) }),
2591
+ /* @__PURE__ */ jsx(
2592
+ "button",
2593
+ {
2594
+ type: "submit",
2595
+ disabled: isSubmitting,
2596
+ className: `${baseButtonClass} ${buttonClass}`,
2597
+ children: isSubmitting ? /* @__PURE__ */ jsxs("span", { className: "flex items-center justify-center gap-2", children: [
2598
+ /* @__PURE__ */ jsxs("svg", { className: "animate-spin w-5 h-5", fill: "none", viewBox: "0 0 24 24", children: [
2599
+ /* @__PURE__ */ jsx("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }),
2600
+ /* @__PURE__ */ jsx("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z" })
2601
+ ] }),
2602
+ "Creating account..."
2603
+ ] }) : submitText
2604
+ }
2605
+ ),
2606
+ loginLink && /* @__PURE__ */ jsxs("p", { className: "text-center text-sm text-gray-600", children: [
2607
+ "Already have an account?",
2608
+ " ",
2609
+ /* @__PURE__ */ jsx("a", { href: loginLink, className: "text-blue-600 hover:text-blue-700 font-medium", children: "Sign in" })
2610
+ ] })
2611
+ ] })
2612
+ }
2613
+ ) });
2614
+ }
2615
+
2616
+ export { ContactForm, LoginForm, NewsletterForm, RegisterForm, ThemeContext, ThemeProvider, ThemeToggle, VALIDATION_MESSAGES, adjustColor, contactFormSchema, createRegisterFormSchema, createTheme, createThemeFromBrand, cssVar, deepMerge, defaultDarkTheme, defaultLightTheme, dummyBannerData, dummyFaqItems, dummyFeatures, dummyFooterData, dummyHeaderData, dummyImage, dummyPricingPlans, dummyTestimonials, flattenToCssVars, generateCssVars, getContrastColor, getSystemColorScheme, hexToRgba, injectCssVars, loadThemeFromUrl, loadThemeMode, loginFormSchema, loremIpsum, newsletterFormSchema, registerFormSchema, removeCssVars, resolveThemeMode, saveThemeMode, useTheme, useThemeValue };
2617
+ //# sourceMappingURL=index.mjs.map
2618
+ //# sourceMappingURL=index.mjs.map